@ir-kit/openapi-tools 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/parse.d.ts +5 -0
- package/dist/parse.d.ts.map +1 -1
- package/dist/parse.js +8 -0
- package/dist/parse.js.map +1 -1
- package/package.json +5 -5
package/dist/parse.d.ts
CHANGED
|
@@ -3,5 +3,10 @@ import { type IR } from "@hey-api/shared";
|
|
|
3
3
|
* Parse an OpenAPI spec (2.0, 3.0, or 3.1) into hey-api's normalized IR.
|
|
4
4
|
*/
|
|
5
5
|
export declare function parseSpec(spec: Record<string, unknown>): IR.Model;
|
|
6
|
+
/** Codegen input: the IR plus each operation's security scheme names, which the IR drops. */
|
|
7
|
+
export declare function parseForCodegen(spec: Record<string, unknown>): {
|
|
8
|
+
ir: IR.Model;
|
|
9
|
+
securitySchemeNames: Map<string, ReadonlyArray<string>>;
|
|
10
|
+
};
|
|
6
11
|
export type { IR };
|
|
7
12
|
//# sourceMappingURL=parse.d.ts.map
|
package/dist/parse.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,KAAK,EAAE,EAAoB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,KAAK,EAAE,EAAoB,MAAM,iBAAiB,CAAC;AAGhF;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,CAgBjE;AAED,6FAA6F;AAC7F,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAC9D,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC;IACb,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;CACzD,CAKA;AAED,YAAY,EAAE,EAAE,EAAE,CAAC"}
|
package/dist/parse.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Logger, Project } from "@hey-api/codegen-core";
|
|
2
2
|
import { Context, getParser, parseOpenApiSpec } from "@hey-api/shared";
|
|
3
|
+
import { extractSecuritySchemeNames } from "@ir-kit/openapi";
|
|
3
4
|
/**
|
|
4
5
|
* Parse an OpenAPI spec (2.0, 3.0, or 3.1) into hey-api's normalized IR.
|
|
5
6
|
*/
|
|
@@ -20,4 +21,11 @@ export function parseSpec(spec) {
|
|
|
20
21
|
parseOpenApiSpec(context);
|
|
21
22
|
return context.ir;
|
|
22
23
|
}
|
|
24
|
+
/** Codegen input: the IR plus each operation's security scheme names, which the IR drops. */
|
|
25
|
+
export function parseForCodegen(spec) {
|
|
26
|
+
return {
|
|
27
|
+
ir: parseSpec(spec),
|
|
28
|
+
securitySchemeNames: extractSecuritySchemeNames(spec),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
23
31
|
//# sourceMappingURL=parse.js.map
|
package/dist/parse.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAW,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAW,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAE7D;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,IAA6B;IACrD,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC;QAC1B,MAAM,EAAE;YACN,MAAM,EAAE,IAAI;YACZ,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,SAAS,CAAC,EAAE,CAAC;YACrB,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,EAAE;SACiD;QAClE,YAAY,EAAE,EAAE;QAChB,MAAM,EAAE,IAAI,MAAM,EAAE;QACpB,OAAO,EAAE,IAAI,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QAClC,IAAI;KACL,CAAC,CAAC;IACH,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC1B,OAAO,OAAO,CAAC,EAAE,CAAC;AACpB,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,eAAe,CAAC,IAA6B;IAI3D,OAAO;QACL,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC;QACnB,mBAAmB,EAAE,0BAA0B,CAAC,IAAI,CAAC;KACtD,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ir-kit/openapi-tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "OpenAPI utilities — request matching, spec diffing, parsing. Tree-shakable, pure functions, works on frontend or backend",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openapi",
|
|
@@ -81,12 +81,12 @@
|
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
83
|
"urlpattern-polyfill": "^10.1.0",
|
|
84
|
-
"@ir-kit/openapi": "0.
|
|
85
|
-
"@ir-kit/schema": "0.3.
|
|
84
|
+
"@ir-kit/openapi": "0.5.0",
|
|
85
|
+
"@ir-kit/schema": "0.3.1"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@hey-api/codegen-core": "^0.
|
|
89
|
-
"@hey-api/shared": "^0.
|
|
88
|
+
"@hey-api/codegen-core": "^0.9.1",
|
|
89
|
+
"@hey-api/shared": "^0.5.0",
|
|
90
90
|
"@hey-api/spec-types": "^0.2.0",
|
|
91
91
|
"@types/node": "^22",
|
|
92
92
|
"vitest": "^4.0.0",
|