@haddowg/json-api-codegen 1.0.1 → 1.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/dist/cli.d.mts +8 -2
- package/dist/cli.d.mts.map +1 -1
- package/dist/cli.mjs +20 -5
- package/dist/cli.mjs.map +1 -1
- package/dist/{index-C0becRSc.d.mts → index-BNJgU3mg.d.mts} +87 -9
- package/dist/index-BNJgU3mg.d.mts.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{src-B24cYyjM.mjs → src-C3hOfyvh.mjs} +431 -44
- package/dist/src-C3hOfyvh.mjs.map +1 -0
- package/package.json +2 -2
- package/dist/index-C0becRSc.d.mts.map +0 -1
- package/dist/src-B24cYyjM.mjs.map +0 -1
package/dist/cli.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as CodegenConfig } from "./index-
|
|
1
|
+
import { r as CodegenConfig } from "./index-BNJgU3mg.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/cli.d.ts
|
|
4
4
|
declare const USAGE = "Usage: json-api-codegen --input <url|file> --output <file> [--server <name>] [--schemas <url|file>] [--check]";
|
|
@@ -9,6 +9,12 @@ declare const USAGE = "Usage: json-api-codegen --input <url|file> --output <file
|
|
|
9
9
|
*/
|
|
10
10
|
declare function parseArgs(argv: string[]): Partial<CodegenConfig>;
|
|
11
11
|
declare function run(argv: string[]): Promise<number>;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the module at `moduleUrl` is the script node was asked to run (`argv1`). Compares real
|
|
14
|
+
* paths, because a package manager installs the bin as a symlink (`node_modules/.bin/...`) and
|
|
15
|
+
* node reports the symlink in `process.argv[1]` but the resolved file in `import.meta.url`.
|
|
16
|
+
*/
|
|
17
|
+
declare function isEntry(moduleUrl: string, argv1: string | undefined): boolean;
|
|
12
18
|
//#endregion
|
|
13
|
-
export { USAGE, parseArgs, run };
|
|
19
|
+
export { USAGE, isEntry, parseArgs, run };
|
|
14
20
|
//# sourceMappingURL=cli.d.mts.map
|
package/dist/cli.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.mts","names":[],"sources":["../src/cli.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"cli.d.mts","names":[],"sources":["../src/cli.ts"],"mappings":";;;cAKa,KAAA;AAAb;;;;AAAkB;AAAlB,iBAQgB,SAAA,CAAU,IAAA,aAAiB,OAAO,CAAC,aAAA;AAAA,iBA6B7B,GAAA,CAAI,IAAA,aAAiB,OAAO;;;;;;iBAgClC,OAAA,CAAQ,SAAA,UAAmB,KAAyB"}
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as generate, t as check } from "./src-
|
|
3
|
-
import {
|
|
2
|
+
import { n as generate, r as schemasOutputPath, t as check } from "./src-C3hOfyvh.mjs";
|
|
3
|
+
import { realpathSync } from "node:fs";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
4
5
|
//#region src/cli.ts
|
|
5
6
|
const USAGE = "Usage: json-api-codegen --input <url|file> --output <file> [--server <name>] [--schemas <url|file>] [--check]";
|
|
6
7
|
/**
|
|
@@ -50,17 +51,31 @@ async function run(argv) {
|
|
|
50
51
|
return 0;
|
|
51
52
|
}
|
|
52
53
|
await generate(config);
|
|
54
|
+
console.error(`wrote ${config.output}`);
|
|
55
|
+
if (config.schemas !== void 0) console.error(`wrote ${schemasOutputPath(config.output)}`);
|
|
53
56
|
return 0;
|
|
54
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Whether the module at `moduleUrl` is the script node was asked to run (`argv1`). Compares real
|
|
60
|
+
* paths, because a package manager installs the bin as a symlink (`node_modules/.bin/...`) and
|
|
61
|
+
* node reports the symlink in `process.argv[1]` but the resolved file in `import.meta.url`.
|
|
62
|
+
*/
|
|
63
|
+
function isEntry(moduleUrl, argv1) {
|
|
64
|
+
if (argv1 === void 0) return false;
|
|
65
|
+
try {
|
|
66
|
+
return realpathSync(fileURLToPath(moduleUrl)) === realpathSync(argv1);
|
|
67
|
+
} catch {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
55
71
|
async function main() {
|
|
56
72
|
process.exitCode = await run(process.argv.slice(2));
|
|
57
73
|
}
|
|
58
|
-
|
|
59
|
-
if (entry !== void 0 && import.meta.url === pathToFileURL(entry).href) main().catch((error) => {
|
|
74
|
+
if (isEntry(import.meta.url, process.argv[1])) main().catch((error) => {
|
|
60
75
|
console.error(error instanceof Error ? error.message : error);
|
|
61
76
|
process.exitCode = 1;
|
|
62
77
|
});
|
|
63
78
|
//#endregion
|
|
64
|
-
export { USAGE, parseArgs, run };
|
|
79
|
+
export { USAGE, isEntry, parseArgs, run };
|
|
65
80
|
|
|
66
81
|
//# sourceMappingURL=cli.mjs.map
|
package/dist/cli.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.mjs","names":[],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport {
|
|
1
|
+
{"version":3,"file":"cli.mjs","names":[],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { realpathSync } from 'node:fs'\nimport { fileURLToPath } from 'node:url'\nimport { check, generate, schemasOutputPath, type CodegenConfig } from './index'\n\nexport const USAGE =\n 'Usage: json-api-codegen --input <url|file> --output <file> [--server <name>] [--schemas <url|file>] [--check]'\n\n/**\n * Thin CLI wrapper. Real arg parsing + `japi.config.ts` discovery land with the\n * generator itself; this stub establishes the bin entry and the shape of invocation.\n * `--check` is a boolean flag (drift gate) with no value.\n */\nexport function parseArgs(argv: string[]): Partial<CodegenConfig> {\n const config: Partial<CodegenConfig> = {}\n for (let i = 0; i < argv.length; i++) {\n const arg = argv[i]\n if (arg === '--check') {\n config.check = true\n continue\n }\n const next = argv[i + 1]\n if (next === undefined) {\n continue\n }\n if (arg === '--input') {\n config.input = next\n i++\n } else if (arg === '--output') {\n config.output = next\n i++\n } else if (arg === '--server') {\n config.server = next\n i++\n } else if (arg === '--schemas') {\n config.schemas = next\n i++\n }\n }\n return config\n}\n\nexport async function run(argv: string[]): Promise<number> {\n const config = parseArgs(argv)\n if (!config.input || !config.output) {\n console.error(USAGE)\n return 1\n }\n if (config.check) {\n const result = await check(config as CodegenConfig)\n for (const { path, upToDate } of result.artifacts) {\n console.error(`${upToDate ? 'ok ' : 'DRIFT'} ${path}`)\n }\n if (!result.ok) {\n console.error(\n 'Generated client is out of date with the source spec. Regenerate (drop --check) and commit the result.',\n )\n return 1\n }\n return 0\n }\n await generate(config as CodegenConfig)\n console.error(`wrote ${config.output}`)\n if (config.schemas !== undefined) {\n console.error(`wrote ${schemasOutputPath(config.output)}`)\n }\n return 0\n}\n\n/**\n * Whether the module at `moduleUrl` is the script node was asked to run (`argv1`). Compares real\n * paths, because a package manager installs the bin as a symlink (`node_modules/.bin/...`) and\n * node reports the symlink in `process.argv[1]` but the resolved file in `import.meta.url`.\n */\nexport function isEntry(moduleUrl: string, argv1: string | undefined): boolean {\n if (argv1 === undefined) {\n return false\n }\n try {\n return realpathSync(fileURLToPath(moduleUrl)) === realpathSync(argv1)\n } catch {\n return false\n }\n}\n\nasync function main(): Promise<void> {\n process.exitCode = await run(process.argv.slice(2))\n}\n\n// Only run when invoked as the bin, not when imported (e.g. by tests).\nif (isEntry(import.meta.url, process.argv[1])) {\n main().catch((error: unknown) => {\n console.error(error instanceof Error ? error.message : error)\n process.exitCode = 1\n })\n}\n"],"mappings":";;;;;AAKA,MAAa,QACX;;;;;;AAOF,SAAgB,UAAU,MAAwC;CAChE,MAAM,SAAiC,CAAC;CACxC,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,MAAM,MAAM,KAAK;EACjB,IAAI,QAAQ,WAAW;GACrB,OAAO,QAAQ;GACf;EACF;EACA,MAAM,OAAO,KAAK,IAAI;EAC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K;CAC5D,QAAQ,WAAW;AACrB,CAAC"}
|
|
@@ -42,6 +42,8 @@ interface ParameterObject {
|
|
|
42
42
|
in?: string;
|
|
43
43
|
$ref?: string;
|
|
44
44
|
schema?: SchemaObject;
|
|
45
|
+
style?: string;
|
|
46
|
+
explode?: boolean;
|
|
45
47
|
/** The negotiation profile a client must opt into to use this parameter (e.g. `withCount`). */
|
|
46
48
|
'x-profile'?: string;
|
|
47
49
|
}
|
|
@@ -55,6 +57,10 @@ type PathItemObject = Partial<Record<HttpMethod, OperationObject>>;
|
|
|
55
57
|
interface InfoObject {
|
|
56
58
|
title?: string;
|
|
57
59
|
version?: string;
|
|
60
|
+
/** The projector's generator contract, bumped whenever the emitted structure changes. */
|
|
61
|
+
'x-generator'?: {
|
|
62
|
+
contract?: number;
|
|
63
|
+
};
|
|
58
64
|
}
|
|
59
65
|
interface OpenApiDocument {
|
|
60
66
|
openapi?: string;
|
|
@@ -83,6 +89,13 @@ declare class DescriptorBuilder {
|
|
|
83
89
|
*/
|
|
84
90
|
private typePaginator;
|
|
85
91
|
build(): ApiDescriptor;
|
|
92
|
+
/**
|
|
93
|
+
* Warn about relations a create or update body accepts but the resource never renders. A
|
|
94
|
+
* write-only relation (generator contract 5) is left out of the response schema, and the
|
|
95
|
+
* descriptor has no way to mark a relation as writable but unreadable, so it is missing from
|
|
96
|
+
* the client entirely rather than typed onto reads that never carry it.
|
|
97
|
+
*/
|
|
98
|
+
private warnWriteOnlyRelations;
|
|
86
99
|
/**
|
|
87
100
|
* The server-level Atomic Operations capability: the path whose `POST` requestBody
|
|
88
101
|
* declares the atomic ext media type ({@link ATOMIC_EXT}). `null` when no such endpoint
|
|
@@ -160,15 +173,24 @@ declare class DescriptorBuilder {
|
|
|
160
173
|
/** Any `P/{id}/<rel>` related path (excludes relationships/ and custom `-actions`). */
|
|
161
174
|
private hasRelatedPath;
|
|
162
175
|
private hasRelationshipPath;
|
|
163
|
-
/** Detect the paginator
|
|
176
|
+
/** Detect the paginator from the fetchMany operation's page parameters. */
|
|
164
177
|
private paginator;
|
|
165
178
|
/**
|
|
166
|
-
* Detect the paginator
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
* `label` (a path
|
|
179
|
+
* Detect the paginator an operation advertises. A page schema stamped with `x-paginator`
|
|
180
|
+
* (contract 3) names its strategy and the wire key for each role, so it decides both. Without
|
|
181
|
+
* the stamp, the strategy is inferred from canonical member names (see {@link kindOfMembers}).
|
|
182
|
+
* Anything unrecognised warns and generates as unpaginated. `label` (a path) names the endpoint
|
|
183
|
+
* in the warning; without it nothing is logged.
|
|
184
|
+
*/
|
|
185
|
+
private paginatorOf;
|
|
186
|
+
/**
|
|
187
|
+
* The `page` members an operation accepts, from either wire form: one `page` parameter
|
|
188
|
+
* (`style: deepObject`) whose schema `properties` name the members, as `haddowg/json-api` v1
|
|
189
|
+
* projects it, or the older flattened `page[number]`/`page[size]` parameters. A `oneOf` page
|
|
190
|
+
* schema (a MultiPaginator menu) yields each arm's members in `menu` instead, minus the
|
|
191
|
+
* `kind` discriminator.
|
|
170
192
|
*/
|
|
171
|
-
private
|
|
193
|
+
private pageMembers;
|
|
172
194
|
/**
|
|
173
195
|
* The `withCount` capability (Countable profile) for a type's COLLECTION read (`list`): the
|
|
174
196
|
* count tokens (`schema.items.enum`) + the negotiation profile (`x-profile`) carried by the
|
|
@@ -206,7 +228,6 @@ declare class DescriptorBuilder {
|
|
|
206
228
|
* deliberately not captured — `filter` values stay `unknown` (out of scope for v0.1).
|
|
207
229
|
*/
|
|
208
230
|
private filterable;
|
|
209
|
-
private queryParamNames;
|
|
210
231
|
private operation;
|
|
211
232
|
private requestBodyRef;
|
|
212
233
|
private okResponseRef;
|
|
@@ -216,6 +237,19 @@ declare function buildDescriptor(doc: OpenApiDocument): ApiDescriptor;
|
|
|
216
237
|
/** Detect the server-level Atomic Operations capability (`null` when none). */
|
|
217
238
|
declare function buildAtomic(doc: OpenApiDocument): AtomicDescriptor | null;
|
|
218
239
|
//#endregion
|
|
240
|
+
//#region src/contract.d.ts
|
|
241
|
+
/** Below this the document predates the structures this codegen reads. */
|
|
242
|
+
declare const MINIMUM_CONTRACT = 1;
|
|
243
|
+
/** Above this the document carries structures this codegen does not read. */
|
|
244
|
+
declare const MAXIMUM_CONTRACT = 5;
|
|
245
|
+
/**
|
|
246
|
+
* Check the document's `info.x-generator.contract` against the range this codegen reads. A
|
|
247
|
+
* document older than the range throws; a newer one returns a warning, because its new
|
|
248
|
+
* structures would go unread and the client would silently miss what the server offers. A
|
|
249
|
+
* document with no contract (json-api before 1.1.0) passes.
|
|
250
|
+
*/
|
|
251
|
+
declare function checkContract(doc: OpenApiDocument): string | undefined;
|
|
252
|
+
//#endregion
|
|
219
253
|
//#region src/emit.d.ts
|
|
220
254
|
/** A relation name that will later collide with a fluent-surface verb. */
|
|
221
255
|
interface VerbCollision {
|
|
@@ -299,6 +333,15 @@ declare class Emitter {
|
|
|
299
333
|
private actionBodyType;
|
|
300
334
|
/** Emit the server-level atomic capability constant (`{ path }` or `null`). */
|
|
301
335
|
private atomicConst;
|
|
336
|
+
/**
|
|
337
|
+
* The `pageLimits` const: per collection, the `default`, `minimum` and `maximum` each `page`
|
|
338
|
+
* member declares (generator contract 5 adds the paginator's default and page-size cap). A
|
|
339
|
+
* menu nests them under each arm's `kind`. Members declaring none, and collections with no
|
|
340
|
+
* such member, are left out. The client never clamps a `page` argument to these.
|
|
341
|
+
*/
|
|
342
|
+
private pageLimitsConst;
|
|
343
|
+
/** One page schema's members that declare a `default`, `minimum` or `maximum`, as literal lines. */
|
|
344
|
+
private pageMemberLimits;
|
|
302
345
|
/**
|
|
303
346
|
* Render an attribute interface from a property map, a field order, and a `required`
|
|
304
347
|
* predicate (true => no `?`). Shared by the read and write attribute interfaces so the
|
|
@@ -347,6 +390,41 @@ declare class Emitter {
|
|
|
347
390
|
*/
|
|
348
391
|
declare function emit(doc: OpenApiDocument, descriptor: ApiDescriptor, atomic?: AtomicDescriptor | null): string;
|
|
349
392
|
//#endregion
|
|
393
|
+
//#region src/error-codes.d.ts
|
|
394
|
+
/** One documented error code, with whatever the document says about it. */
|
|
395
|
+
interface DocumentedErrorCode {
|
|
396
|
+
code: string;
|
|
397
|
+
/** The `<Code>Error` component's `description`, when the document has one (contract 4). */
|
|
398
|
+
description?: string;
|
|
399
|
+
/** Example `detail` values, from the component's `detail` property (`example` / `examples`). */
|
|
400
|
+
examples: unknown[];
|
|
401
|
+
}
|
|
402
|
+
/** The server's error catalogue as the codegen reads it. */
|
|
403
|
+
interface ErrorCatalogue {
|
|
404
|
+
/** Every code any error document offers, sorted by code. */
|
|
405
|
+
codes: DocumentedErrorCode[];
|
|
406
|
+
/**
|
|
407
|
+
* Per status, the codes its `ErrorDocument<NNN>` offers, sorted by code. A status whose
|
|
408
|
+
* document offers only the generic `Error` maps to an empty list.
|
|
409
|
+
*/
|
|
410
|
+
byStatus: Map<number, string[]>;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Read the documented error codes off a document's error documents. `ErrorDocument` and each
|
|
414
|
+
* `ErrorDocument<NNN>` offer their codes as `errors.items.anyOf` branches that `$ref` a
|
|
415
|
+
* `<Code>Error` component; a branch with a `code` const names a code, and the generic `Error`
|
|
416
|
+
* branch (no const) names none.
|
|
417
|
+
*/
|
|
418
|
+
declare function readErrorCatalogue(doc: OpenApiDocument): ErrorCatalogue;
|
|
419
|
+
/**
|
|
420
|
+
* Emit `ErrorCodes`, a const object keyed by every documented code with its TSDoc on the key
|
|
421
|
+
* (editors show TSDoc on an object key, not on a string-literal union member), the `ErrorCode`
|
|
422
|
+
* union derived from it, and `ErrorCodeByStatus`, the codes each status's error document offers.
|
|
423
|
+
* A document with no code catalogue gets an empty `ErrorCodes` and `ErrorCode = string`, so the
|
|
424
|
+
* bound guard still takes any code.
|
|
425
|
+
*/
|
|
426
|
+
declare function emitErrorCodes(catalogue: ErrorCatalogue): string;
|
|
427
|
+
//#endregion
|
|
350
428
|
//#region src/reader.d.ts
|
|
351
429
|
/** A self-contained JSON Schema document, keyed by JSON:API type, as served at `GET /schemas.json`. */
|
|
352
430
|
type SchemaBundle = Record<string, SchemaObject>;
|
|
@@ -467,5 +545,5 @@ declare function generate(config: CodegenConfig): Promise<string>;
|
|
|
467
545
|
*/
|
|
468
546
|
declare function check(config: CodegenConfig): Promise<CheckResult>;
|
|
469
547
|
//#endregion
|
|
470
|
-
export {
|
|
471
|
-
//# sourceMappingURL=index-
|
|
548
|
+
export { InfoObject as A, MAXIMUM_CONTRACT as C, buildAtomic as D, DescriptorBuilder as E, PathItemObject as F, RequestBodyObject as I, ResponseObject as L, OpenApiDocument as M, OperationObject as N, buildDescriptor as O, ParameterObject as P, SchemaObject as R, emit as S, checkContract as T, emitErrorCodes as _, generate as a, VerbCollision as b, deriveProvenance as c, emitSchemas as d, SchemaBundle as f, ErrorCatalogue as g, DocumentedErrorCode as h, check as i, MediaTypeObject as j, HttpMethod as k, hashJson as l, readSchemas as m, CheckResult as n, schemasOutputPath as o, readDocument as p, CodegenConfig as r, Provenance as s, ArtifactDrift as t, provenanceLines as u, readErrorCatalogue as v, MINIMUM_CONTRACT as w, detectVerbCollisions as x, Emitter as y, SchemaOrBool as z };
|
|
549
|
+
//# sourceMappingURL=index-BNJgU3mg.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BNJgU3mg.d.mts","names":[],"sources":["../src/openapi.ts","../src/build-descriptor.ts","../src/contract.ts","../src/emit.ts","../src/error-codes.ts","../src/reader.ts","../src/emit-schemas.ts","../src/provenance.ts","../src/index.ts"],"mappings":";;;;;;AAQA;;;;UAAiB,YAAA;EACf,IAAA;EACA,IAAA;EACA,KAAA;EACA,MAAA;EACA,WAAA;EACA,IAAA;EACA,UAAA,GAAa,MAAA,SAAe,YAAA;EAC5B,KAAA,GAAQ,YAAA;EACR,QAAA;EACA,KAAA,YAAiB,YAAA;EACjB,KAAA,YAAiB,YAAA;EACjB,KAAA,YAAiB,YAAA;EACjB,iB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;;;;iBAsFxD,cAAA,CAAe,SAAyB,EAAd,cAAc;;;;KC7I5C,YAAA,GAAe,MAAM,SAAS,YAAA;;;;;iBA+CpB,YAAA,CAAa,KAAA,WAAgB,OAAO,CAAC,eAAA;;;;;;iBASrC,WAAA,CAAY,KAAA,WAAgB,OAAO,CAAC,YAAA;;;;;ALtD1D;;;;;;;;;;;;;iBMUgB,WAAA,CAAY,MAAoB,EAAZ,YAAY;;;;;ANVhD;;;;UOCiB,UAAA;EPOP;EAAA,SOLC,MAAA;EPQQ;EAAA,SONR,MAAA;EPOoB;EAAA,SOLpB,IAAA;AAAA;;iBAwBK,QAAA,CAAS,KAAc;;;;;;iBAYvB,gBAAA,CAAiB,GAAA,EAAK,eAAA,GAAkB,UAAU;;;;;;iBAelD,eAAA,CAAgB,UAAsB,EAAV,UAAU;;;UChCrC,aAAA;ERjBf;EQmBA,KAAA;ERlBiB;EQoBjB,MAAA;ERnBiB;EQqBjB,MAAA;ERpBiB;EQsBjB,OAAA;ERpBA;;;AACY;AAId;EQqBE,KAAA;AAAA;;UAIe,aAAA;ERvBA;EQyBf,IAAA;;EAEA,QAAQ;AAAA;ARvBV;AAAA,UQ2BiB,WAAA;EACf,EAAA;EACA,SAAA,EAAW,aAAa;AAAA;;;;;iBAOV,iBAAA,CAAkB,MAAc;AR/BhD;;;;;;;;AAC0C;AAG1C;;;;;AAJA,iBQmGsB,QAAA,CAAS,MAAA,EAAQ,aAAA,GAAgB,OAAO;;;;;;;iBAgBxC,KAAA,CAAM,MAAA,EAAQ,aAAA,GAAgB,OAAA,CAAQ,WAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { ArtifactDrift, CheckResult, CodegenConfig, DescriptorBuilder, Emitter, type HttpMethod, type InfoObject, type MediaTypeObject, type OpenApiDocument, type OperationObject, type ParameterObject, type PathItemObject, type Provenance, type RequestBodyObject, type ResponseObject, type SchemaBundle, type SchemaObject, type SchemaOrBool, type VerbCollision, buildAtomic, buildDescriptor, check, deriveProvenance, detectVerbCollisions, emit, emitSchemas, generate, hashJson, provenanceLines, readDocument, readSchemas, schemasOutputPath };
|
|
1
|
+
import { A as InfoObject, C as MAXIMUM_CONTRACT, D as buildAtomic, E as DescriptorBuilder, F as PathItemObject, I as RequestBodyObject, L as ResponseObject, M as OpenApiDocument, N as OperationObject, O as buildDescriptor, P as ParameterObject, R as SchemaObject, S as emit, T as checkContract, _ as emitErrorCodes, a as generate, b as VerbCollision, c as deriveProvenance, d as emitSchemas, f as SchemaBundle, g as ErrorCatalogue, h as DocumentedErrorCode, i as check, j as MediaTypeObject, k as HttpMethod, l as hashJson, m as readSchemas, n as CheckResult, o as schemasOutputPath, p as readDocument, r as CodegenConfig, s as Provenance, t as ArtifactDrift, u as provenanceLines, v as readErrorCatalogue, w as MINIMUM_CONTRACT, x as detectVerbCollisions, y as Emitter, z as SchemaOrBool } from "./index-BNJgU3mg.mjs";
|
|
2
|
+
export { ArtifactDrift, CheckResult, CodegenConfig, DescriptorBuilder, type DocumentedErrorCode, Emitter, type ErrorCatalogue, type HttpMethod, type InfoObject, MAXIMUM_CONTRACT, MINIMUM_CONTRACT, type MediaTypeObject, type OpenApiDocument, type OperationObject, type ParameterObject, type PathItemObject, type Provenance, type RequestBodyObject, type ResponseObject, type SchemaBundle, type SchemaObject, type SchemaOrBool, type VerbCollision, buildAtomic, buildDescriptor, check, checkContract, deriveProvenance, detectVerbCollisions, emit, emitErrorCodes, emitSchemas, generate, hashJson, provenanceLines, readDocument, readErrorCatalogue, readSchemas, schemasOutputPath };
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as readSchemas, c as detectVerbCollisions, d as hashJson, f as provenanceLines, h as
|
|
2
|
-
export { DescriptorBuilder, Emitter, buildAtomic, buildDescriptor, check, deriveProvenance, detectVerbCollisions, emit, emitSchemas, generate, hashJson, provenanceLines, readDocument, readSchemas, schemasOutputPath };
|
|
1
|
+
import { _ as checkContract, a as readSchemas, b as buildDescriptor, c as detectVerbCollisions, d as hashJson, f as provenanceLines, g as MINIMUM_CONTRACT, h as MAXIMUM_CONTRACT, i as readDocument, l as emit, m as readErrorCatalogue, n as generate, o as emitSchemas, p as emitErrorCodes, r as schemasOutputPath, s as Emitter, t as check, u as deriveProvenance, v as DescriptorBuilder, y as buildAtomic } from "./src-C3hOfyvh.mjs";
|
|
2
|
+
export { DescriptorBuilder, Emitter, MAXIMUM_CONTRACT, MINIMUM_CONTRACT, buildAtomic, buildDescriptor, check, checkContract, deriveProvenance, detectVerbCollisions, emit, emitErrorCodes, emitSchemas, generate, hashJson, provenanceLines, readDocument, readErrorCatalogue, readSchemas, schemasOutputPath };
|