@ir-kit/spec-loader 0.2.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/LICENSE.md +21 -0
- package/README.md +38 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +89 -0
- package/dist/index.js.map +1 -0
- package/package.json +70 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Ahmed Rowaihi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# `@ir-kit/spec-loader`
|
|
2
|
+
|
|
3
|
+
Universal spec loader for OpenAPI, AsyncAPI, and TypeSpec. Detects format by extension + content sniff and dispatches to the matching per-format loader, returning a discriminated `{ kind, document }` result.
|
|
4
|
+
|
|
5
|
+
Part of [ir-kit](https://github.com/ir-kit/ir-kit).
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install @ir-kit/spec-loader
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { loadSpec } from "@ir-kit/spec-loader";
|
|
17
|
+
|
|
18
|
+
const result = await loadSpec({ input: "./api.yaml" });
|
|
19
|
+
// result.kind: "openapi" | "asyncapi"
|
|
20
|
+
// result.document: parsed OpenAPI object or AsyncAPIDocumentInterface
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
TypeSpec input (`.tsp`) compiles to OpenAPI 3 in-memory and returns as `{ kind: "openapi" }`. Pre-parsed objects pass through and are classified by their top-level `asyncapi` / `openapi` / `swagger` key.
|
|
24
|
+
|
|
25
|
+
## API
|
|
26
|
+
|
|
27
|
+
| Export | Description |
|
|
28
|
+
| ------------------------------------------------------------ | ----------------------------------------------- |
|
|
29
|
+
| `loadSpec(opts)` | Detect + dispatch + return `{ kind, document }` |
|
|
30
|
+
| `loadOpenAPI`, `loadAsyncAPI`, `compileTypespec` | Re-exports from each per-format loader |
|
|
31
|
+
| `resolveOpenAPIInput`, `isTypespecPath` | Utility helpers |
|
|
32
|
+
| `SpecKind`, `SpecInput`, `LoadSpecOptions`, `LoadSpecResult` | Public types |
|
|
33
|
+
|
|
34
|
+
Per-format loaders ship as separate packages — `@ir-kit/openapi-loader`, `@ir-kit/asyncapi-loader`, `@ir-kit/typespec-loader` — if you want a smaller dependency footprint and only need one format.
|
|
35
|
+
|
|
36
|
+
## Why a wrapper
|
|
37
|
+
|
|
38
|
+
Every consumer in ir-kit (codegen, docs, diff, recon) needs the same input-handling logic: paths vs URLs vs pre-parsed objects, format detection, `$ref` bundling. Centralizing it here removes that boilerplate from every downstream package.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { AsyncAPIDocumentInterface } from "@asyncapi/parser";
|
|
2
|
+
import { type AsyncAPIInput, type LoadAsyncAPIOptions, loadAsyncAPI } from "@ir-kit/asyncapi-loader";
|
|
3
|
+
import { type LoadOpenAPIOptions, loadOpenAPI, type OpenAPIInput, resolveOpenAPIInput } from "@ir-kit/openapi-loader";
|
|
4
|
+
import { type CompileTypespecOptions, compileTypespec, isTypespecPath } from "@ir-kit/typespec-loader";
|
|
5
|
+
export type { AsyncAPIInput, LoadAsyncAPIOptions, LoadOpenAPIOptions, OpenAPIInput, };
|
|
6
|
+
export { compileTypespec, isTypespecPath, loadAsyncAPI, loadOpenAPI, resolveOpenAPIInput, };
|
|
7
|
+
export type SpecKind = "openapi" | "asyncapi" | "typespec";
|
|
8
|
+
export type SpecInput = string | Record<string, unknown> | AsyncAPIDocumentInterface;
|
|
9
|
+
export interface LoadSpecOptions extends CompileTypespecOptions {
|
|
10
|
+
input: SpecInput;
|
|
11
|
+
/** Force the spec kind, skipping detection. Useful when the file
|
|
12
|
+
* extension is ambiguous (e.g. `api.json` that's actually AsyncAPI). */
|
|
13
|
+
kind?: SpecKind;
|
|
14
|
+
/** Forwarded to `loadOpenAPI` (and to TypeSpec after compile). */
|
|
15
|
+
normalize?: LoadOpenAPIOptions["normalize"];
|
|
16
|
+
}
|
|
17
|
+
export type LoadSpecResult = {
|
|
18
|
+
kind: "openapi";
|
|
19
|
+
document: Record<string, unknown>;
|
|
20
|
+
} | {
|
|
21
|
+
kind: "asyncapi";
|
|
22
|
+
document: AsyncAPIDocumentInterface;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Detect the spec format and dispatch to the matching per-format loader.
|
|
26
|
+
* TypeSpec inputs compile to OpenAPI 3 in-memory and return as
|
|
27
|
+
* `{ kind: "openapi" }`. Pre-parsed objects are kept as-is and
|
|
28
|
+
* classified by the `asyncapi` / `openapi` / `swagger` top-level key.
|
|
29
|
+
*/
|
|
30
|
+
export declare function loadSpec(opts: LoadSpecOptions): Promise<LoadSpecResult>;
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,YAAY,EACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,KAAK,kBAAkB,EACvB,WAAW,EACX,KAAK,YAAY,EACjB,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,sBAAsB,EAC3B,eAAe,EACf,cAAc,EACf,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,GACb,CAAC;AACF,OAAO,EACL,eAAe,EACf,cAAc,EACd,YAAY,EACZ,WAAW,EACX,mBAAmB,GACpB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE3D,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACvB,yBAAyB,CAAC;AAE9B,MAAM,WAAW,eAAgB,SAAQ,sBAAsB;IAC7D,KAAK,EAAE,SAAS,CAAC;IACjB;6EACyE;IACzE,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,kEAAkE;IAClE,SAAS,CAAC,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;CAC7C;AAED,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GACtD;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,yBAAyB,CAAA;CAAE,CAAC;AAE9D;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CA0C7E"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { isAbsolute, resolve } from "node:path";
|
|
3
|
+
import { loadAsyncAPI, } from "@ir-kit/asyncapi-loader";
|
|
4
|
+
import { loadOpenAPI, resolveOpenAPIInput, } from "@ir-kit/openapi-loader";
|
|
5
|
+
import { compileTypespec, isTypespecPath, } from "@ir-kit/typespec-loader";
|
|
6
|
+
export { compileTypespec, isTypespecPath, loadAsyncAPI, loadOpenAPI, resolveOpenAPIInput, };
|
|
7
|
+
/**
|
|
8
|
+
* Detect the spec format and dispatch to the matching per-format loader.
|
|
9
|
+
* TypeSpec inputs compile to OpenAPI 3 in-memory and return as
|
|
10
|
+
* `{ kind: "openapi" }`. Pre-parsed objects are kept as-is and
|
|
11
|
+
* classified by the `asyncapi` / `openapi` / `swagger` top-level key.
|
|
12
|
+
*/
|
|
13
|
+
export async function loadSpec(opts) {
|
|
14
|
+
const kind = opts.kind ?? (await detectKind(opts.input, opts.cwd));
|
|
15
|
+
if (kind === "typespec") {
|
|
16
|
+
const path = typeof opts.input === "string" ? opts.input : "";
|
|
17
|
+
if (!path) {
|
|
18
|
+
throw new Error("TypeSpec input must be a file path ending in .tsp");
|
|
19
|
+
}
|
|
20
|
+
const { document } = await compileTypespec({ path }, opts);
|
|
21
|
+
return {
|
|
22
|
+
kind: "openapi",
|
|
23
|
+
document: document,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
if (kind === "asyncapi") {
|
|
27
|
+
if (typeof opts.input !== "string" && !isAsyncAPIDocument(opts.input)) {
|
|
28
|
+
throw new Error("asyncapi input must be a string path/URL or an AsyncAPIDocumentInterface");
|
|
29
|
+
}
|
|
30
|
+
const document = await loadAsyncAPI({
|
|
31
|
+
input: opts.input,
|
|
32
|
+
cwd: opts.cwd,
|
|
33
|
+
});
|
|
34
|
+
return { kind: "asyncapi", document };
|
|
35
|
+
}
|
|
36
|
+
if (typeof opts.input !== "string" &&
|
|
37
|
+
!isPlainOpenAPIObject(opts.input)) {
|
|
38
|
+
throw new Error("openapi input must be a string path/URL or a plain object");
|
|
39
|
+
}
|
|
40
|
+
const document = await loadOpenAPI({
|
|
41
|
+
input: opts.input,
|
|
42
|
+
cwd: opts.cwd,
|
|
43
|
+
normalize: opts.normalize,
|
|
44
|
+
});
|
|
45
|
+
return { kind: "openapi", document };
|
|
46
|
+
}
|
|
47
|
+
async function detectKind(input, cwd) {
|
|
48
|
+
if (typeof input !== "string") {
|
|
49
|
+
return isAsyncAPIDocument(input) ? "asyncapi" : "openapi";
|
|
50
|
+
}
|
|
51
|
+
const str = input;
|
|
52
|
+
if (/\.tsp$/i.test(str.trim()))
|
|
53
|
+
return "typespec";
|
|
54
|
+
const trimmed = str.trim();
|
|
55
|
+
if (/^https?:\/\//i.test(trimmed)) {
|
|
56
|
+
return sniffKindFromString(await fetchHead(trimmed));
|
|
57
|
+
}
|
|
58
|
+
const path = isAbsolute(trimmed)
|
|
59
|
+
? trimmed
|
|
60
|
+
: resolve(cwd ?? process.cwd(), trimmed);
|
|
61
|
+
return sniffKindFromString(await readFile(path, "utf8"));
|
|
62
|
+
}
|
|
63
|
+
function sniffKindFromString(text) {
|
|
64
|
+
const head = text.slice(0, 2048);
|
|
65
|
+
if (/(^|\n)\s*"?asyncapi"?\s*:/.test(head))
|
|
66
|
+
return "asyncapi";
|
|
67
|
+
if (/(^|\n)\s*"?openapi"?\s*:/.test(head))
|
|
68
|
+
return "openapi";
|
|
69
|
+
if (/(^|\n)\s*"?swagger"?\s*:/.test(head))
|
|
70
|
+
return "openapi";
|
|
71
|
+
return "openapi";
|
|
72
|
+
}
|
|
73
|
+
async function fetchHead(url) {
|
|
74
|
+
const res = await fetch(url);
|
|
75
|
+
if (!res.ok) {
|
|
76
|
+
throw new Error(`Failed to fetch ${url}: ${res.status} ${res.statusText}`);
|
|
77
|
+
}
|
|
78
|
+
return res.text();
|
|
79
|
+
}
|
|
80
|
+
function isAsyncAPIDocument(value) {
|
|
81
|
+
return (typeof value === "object" &&
|
|
82
|
+
value !== null &&
|
|
83
|
+
typeof value.json === "function" &&
|
|
84
|
+
typeof value.version === "function");
|
|
85
|
+
}
|
|
86
|
+
function isPlainOpenAPIObject(value) {
|
|
87
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGhD,OAAO,EAGL,YAAY,GACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,WAAW,EAEX,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,eAAe,EACf,cAAc,GACf,MAAM,yBAAyB,CAAC;AAQjC,OAAO,EACL,eAAe,EACf,cAAc,EACd,YAAY,EACZ,WAAW,EACX,mBAAmB,GACpB,CAAC;AAsBF;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAAqB;IAClD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAEnE,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;QACxB,MAAM,IAAI,GAAG,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,C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AC,EAAE,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,mBAAmB,GAAG,KAAK,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;AACpB,CAAC;AAED,SAAS,kBAAkB,CACzB,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,OAAQ,KAA4B,CAAC,IAAI,KAAK,UAAU;QACxD,OAAQ,KAA+B,CAAC,OAAO,KAAK,UAAU,CAC/D,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAC3B,KAAc;IAEd,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ir-kit/spec-loader",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Universal spec loader for OpenAPI, AsyncAPI, and TypeSpec. Detects format by extension + content sniff and dispatches to the per-format loader, returning a discriminated `{ kind, document }` result.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"openapi",
|
|
7
|
+
"asyncapi",
|
|
8
|
+
"typespec",
|
|
9
|
+
"loader",
|
|
10
|
+
"spec",
|
|
11
|
+
"ir-kit"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://github.com/ir-kit/ir-kit/tree/main/packages/shared/spec-loader",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/ir-kit/ir-kit/issues"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"author": {
|
|
19
|
+
"name": "Ahmed Rowaihi",
|
|
20
|
+
"email": "ahmedrowaihi@gmail.com"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/ir-kit/ir-kit.git",
|
|
25
|
+
"directory": "packages/shared/spec-loader"
|
|
26
|
+
},
|
|
27
|
+
"type": "module",
|
|
28
|
+
"sideEffects": false,
|
|
29
|
+
"main": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"import": "./dist/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./package.json": "./package.json"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"README.md",
|
|
41
|
+
"LICENSE.md"
|
|
42
|
+
],
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public",
|
|
45
|
+
"provenance": true
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"@asyncapi/parser": "^3.6.0"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@ir-kit/asyncapi-loader": "0.2.0",
|
|
52
|
+
"@ir-kit/openapi-loader": "0.2.0",
|
|
53
|
+
"@ir-kit/typespec-loader": "0.2.0"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@asyncapi/parser": "^3.6.0",
|
|
57
|
+
"@types/node": "^22",
|
|
58
|
+
"vitest": "^4.0.0",
|
|
59
|
+
"@ir-kit/tsconfig": "0.0.0"
|
|
60
|
+
},
|
|
61
|
+
"engines": {
|
|
62
|
+
"node": ">=20.19.0"
|
|
63
|
+
},
|
|
64
|
+
"scripts": {
|
|
65
|
+
"build": "tsc -p tsconfig.build.json",
|
|
66
|
+
"dev": "tsc -p tsconfig.build.json --watch",
|
|
67
|
+
"typecheck": "tsc --noEmit",
|
|
68
|
+
"test": "vitest run --passWithNoTests"
|
|
69
|
+
}
|
|
70
|
+
}
|