Gathering detailed insights and metrics for @har-sdk/editor
Gathering detailed insights and metrics for @har-sdk/editor
Gathering detailed insights and metrics for @har-sdk/editor
Gathering detailed insights and metrics for @har-sdk/editor
HAR SDK enables Node.js developers to easily work with HAR, convert it from OAS/Swagger and Postman collection, and more.
npm install @har-sdk/editor
Typescript
Module System
Node Version
NPM Version
@har-sdk/oas@2.12.2
Updated on Apr 03, 2025
@har-sdk/openapi-sampler@2.4.2
Updated on Apr 03, 2025
@har-sdk/editor@1.5.14
Updated on Mar 25, 2025
@har-sdk/validator@2.6.1
Updated on Mar 25, 2025
@har-sdk/types@1.1.10
Updated on Mar 25, 2025
@har-sdk/postman@2.4.7
Updated on Mar 25, 2025
TypeScript (98.24%)
JavaScript (1.72%)
Shell (0.04%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
11 Stars
157 Commits
5 Forks
15 Watchers
7 Branches
26 Contributors
Updated on Apr 03, 2025
Latest Version
1.5.14
Package Id
@har-sdk/editor@1.5.14
Unpacked Size
130.56 kB
Size
28.67 kB
File Count
123
NPM Version
10.8.2
Node Version
18.20.7
Published on
Mar 25, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
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
all changesets reviewed
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
no binaries found in the repo
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
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
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
16 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
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