Gathering detailed insights and metrics for @har-sdk/editor
Gathering detailed insights and metrics for @har-sdk/editor
npm install @har-sdk/editor
Typescript
Module System
Node Version
NPM Version
69.4
Supply Chain
95.4
Quality
77.9
Maintenance
100
Vulnerability
99.6
License
@har-sdk/oas@2.10.0
Published on 07 Oct 2024
@har-sdk/postman@2.4.6
Published on 22 Aug 2024
@har-sdk/oas@2.9.3
Published on 22 Aug 2024
@har-sdk/oas@2.9.2
Published on 14 Aug 2024
@har-sdk/openapi-sampler@2.2.1
Published on 14 Aug 2024
@har-sdk/oas@2.9.1
Published on 22 Apr 2024
TypeScript (98.02%)
JavaScript (1.94%)
Shell (0.04%)
Total Downloads
10,605
Last Day
4
Last Week
23
Last Month
94
Last Year
1,324
11 Stars
142 Commits
5 Forks
16 Watching
10 Branches
25 Contributors
Minified
Minified + Gzipped
Latest Version
1.5.12
Package Id
@har-sdk/editor@1.5.12
Unpacked Size
127.65 kB
Size
27.94 kB
File Count
123
NPM Version
8.19.3
Node Version
18.17.1
Publised On
21 Sept 2023
Cumulative downloads
Total Downloads
Last day
-90.9%
4
Compared to previous day
Last week
-54.9%
23
Compared to previous week
Last month
2.2%
94
Compared to previous month
Last year
-69.6%
1,324
Compared to previous year
Parses OAS and Postman API specification files into form of tree with endpoints and parameters as leaves; tree is useful for GUI representation of specification parameters
Each node and parameter value have JSON pointer, that could be used to change parameter value or to remove node.
1npm i --save @har-sdk/editor
1import { OasV3Editor, SpecTreeNode } from '@har-sdk/editor';
2
3const openApiEditor = new OasV3Editor();
4openApiEditor.setup(jsonOrYamlSourceString).then(() => {
5 // tree parsing
6 let tree: SpecTreeNode = openApiEditor.parse();
7
8 // setting/updating parameter value
9 tree = openApiEditor.setParameterValue(
10 // parameter `valueJsonPointer` is pointer to `example` for oas3 and `default` for oas2;
11 // referenced parameter will be dereferenced automatically
12 tree.parameters[0].valueJsonPointer,
13 someNewValue
14 );
15
16 // removing specific node
17 tree = openApiEditor.removeNode(tree.children[1].jsonPointer);
18
19 // serialization
20 const serializedUpdatedSpec = openApiEditor.stringify();
21});
All of them implement both TreeParser
and Editor
interfaces.
1export interface TreeParser { 2 setup(source: string): Promise<void>; 3 parse(): SpecTreeNode; 4 stringify(): string; 5} 6 7export interface Editor { 8 setParameterValue(jsonPointer: string, value: any): SpecTreeNode; 9 removeNode(jsonPointer: string): SpecTreeNode; 10}
1export interface SpecTreeNode { 2 readonly path: string; 3 readonly name?: string; 4 readonly method?: HttpMethod; 5 readonly jsonPointer: string; 6 readonly children?: ReadonlyArray<SpecTreeNode>; 7 readonly parameters?: ReadonlyArray<SpecTreeNodeParam>; 8} 9 10export interface SpecTreeNodeParam { 11 readonly paramType: 'location' | 'requestBody' | 'variable'; 12 readonly value?: any; 13 readonly valueJsonPointer: string; 14} 15 16// Specific parameter types with specific properties 17 18export interface SpecTreeNodeVariableParam extends SpecTreeNodeParam { 19 readonly paramType: 'variable'; 20 readonly name: string; 21} 22 23export interface SpecTreeNodeLocationParam extends SpecTreeNodeParam { 24 readonly paramType: 'location'; 25 readonly name: string; 26 readonly location: ParamLocation; 27} 28 29export interface SpecTreeRequestBodyParam extends SpecTreeNodeParam { 30 readonly paramType: 'requestBody'; 31 readonly bodyType: string; 32} 33 34// Enums 35 36export enum ParamLocation { 37 PATH = 'path', 38 QUERY = 'query', 39 HEADER = 'header', 40 BODY = 'body' 41} 42 43export enum HttpMethod { 44 GET = 'GET', 45 PUT = 'PUT', 46 POST = 'POST', 47 DELETE = 'DELETE', 48 OPTIONS = 'OPTIONS', 49 HEAD = 'HEAD', 50 PATCH = 'PATCH', 51 TRACE = 'TRACE' 52}
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 21/22 approved changesets -- score normalized to 9
Reason
dependency not pinned by hash detected -- score normalized to 5
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
13 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More