openapi-contract-kit 0.0.1 → 0.0.3

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +13 -5
  3. package/dist/bin/openapi-contract-kit.d.ts +2 -0
  4. package/dist/bin/openapi-contract-kit.js +3 -0
  5. package/dist/src/cli/formatOutput.d.ts +6 -0
  6. package/dist/src/cli/formatOutput.js +32 -0
  7. package/dist/src/generator/config.d.ts +3 -0
  8. package/dist/src/generator/config.js +72 -0
  9. package/dist/src/generator/documents.d.ts +11 -0
  10. package/dist/src/generator/documents.js +92 -0
  11. package/dist/src/generator/emitEndpoints.d.ts +2 -0
  12. package/{src/generator/emitEndpoints.mjs → dist/src/generator/emitEndpoints.js} +48 -80
  13. package/dist/src/generator/emitMakers.d.ts +2 -0
  14. package/dist/src/generator/emitMakers.js +328 -0
  15. package/dist/src/generator/emitTypes.d.ts +3 -0
  16. package/dist/src/generator/emitTypes.js +87 -0
  17. package/dist/src/generator/generateOpenApiRuntime.d.ts +3 -0
  18. package/dist/src/generator/generateOpenApiRuntime.js +41 -0
  19. package/dist/src/generator/model.d.ts +2 -0
  20. package/dist/src/generator/model.js +278 -0
  21. package/dist/src/generator/schemaModel.d.ts +9 -0
  22. package/dist/src/generator/schemaModel.js +408 -0
  23. package/dist/src/generator/types.d.ts +82 -0
  24. package/dist/src/generator/writeOutput.d.ts +5 -0
  25. package/dist/src/generator/writeOutput.js +141 -0
  26. package/dist/src/index.d.ts +2 -0
  27. package/dist/src/index.js +1 -0
  28. package/dist/src/runtime.d.ts +14 -0
  29. package/dist/src/runtime.js +1 -0
  30. package/package.json +30 -18
  31. package/bin/openapi-contract-kit.mjs +0 -5
  32. package/src/generator/config.mjs +0 -92
  33. package/src/generator/documents.mjs +0 -119
  34. package/src/generator/emitMakers.mjs +0 -459
  35. package/src/generator/emitTypes.mjs +0 -104
  36. package/src/generator/generateOpenApiRuntime.mjs +0 -48
  37. package/src/generator/model.mjs +0 -415
  38. package/src/generator/schemaModel.mjs +0 -497
  39. package/src/generator/writeOutput.mjs +0 -196
  40. package/src/index.d.ts +0 -16
  41. package/src/index.mjs +0 -4
  42. package/src/runtime.d.ts +0 -14
  43. /package/{src/runtime.mjs → dist/src/generator/types.js} +0 -0
@@ -1,497 +0,0 @@
1
- import { basename, extname } from 'node:path';
2
-
3
- import {
4
- isRecord,
5
- locationOf,
6
- pointerChild,
7
- requireRecord,
8
- } from './documents.mjs';
9
-
10
- const SCHEMA_TYPES = new Set([
11
- 'array',
12
- 'boolean',
13
- 'integer',
14
- 'null',
15
- 'number',
16
- 'object',
17
- 'string',
18
- ]);
19
- const ANNOTATION_KEYWORDS = new Set([
20
- '$anchor',
21
- '$comment',
22
- '$defs',
23
- '$id',
24
- '$schema',
25
- 'default',
26
- 'deprecated',
27
- 'description',
28
- 'discriminator',
29
- 'example',
30
- 'examples',
31
- 'externalDocs',
32
- 'readOnly',
33
- 'title',
34
- 'writeOnly',
35
- 'xml',
36
- ]);
37
- const ASSERTION_KEYWORDS = new Set([
38
- '$ref',
39
- 'additionalProperties',
40
- 'allOf',
41
- 'anyOf',
42
- 'const',
43
- 'enum',
44
- 'exclusiveMaximum',
45
- 'exclusiveMinimum',
46
- 'format',
47
- 'items',
48
- 'maxLength',
49
- 'maximum',
50
- 'minLength',
51
- 'minimum',
52
- 'oneOf',
53
- 'pattern',
54
- 'properties',
55
- 'required',
56
- 'type',
57
- ]);
58
- const RESERVED_IDENTIFIERS = new Set([
59
- 'any',
60
- 'boolean',
61
- 'constructor',
62
- 'declare',
63
- 'default',
64
- 'enum',
65
- 'extends',
66
- 'false',
67
- 'infer',
68
- 'interface',
69
- 'keyof',
70
- 'never',
71
- 'null',
72
- 'number',
73
- 'object',
74
- 'makeresult',
75
- 'string',
76
- 'symbol',
77
- 'true',
78
- 'type',
79
- 'undefined',
80
- 'unknown',
81
- 'result',
82
- 'validationissue',
83
- 'validationpath',
84
- ]);
85
-
86
- function requireNumber(value, keyword, location) {
87
- if (typeof value !== 'number' || !Number.isFinite(value)) {
88
- throw new Error(
89
- `Schema keyword "${keyword}" at ${location} must be finite`
90
- );
91
- }
92
-
93
- return value;
94
- }
95
-
96
- function validatePrimitive(value, keyword, location) {
97
- if (
98
- value !== null &&
99
- typeof value !== 'string' &&
100
- typeof value !== 'number' &&
101
- typeof value !== 'boolean'
102
- ) {
103
- throw new Error(
104
- `Schema keyword "${keyword}" at ${location} supports primitive JSON values only`
105
- );
106
- }
107
- if (typeof value === 'number' && !Number.isFinite(value)) {
108
- throw new Error(
109
- `Schema keyword "${keyword}" at ${location} must be finite`
110
- );
111
- }
112
- }
113
-
114
- export function toPascalIdentifier(value, fallback = 'Schema') {
115
- const words = value
116
- .replace(/([a-z0-9])([A-Z])/gu, '$1 $2')
117
- .split(/[^A-Za-z0-9_$]+/u)
118
- .filter(Boolean);
119
- let identifier = words
120
- .map((word) => `${word[0].toUpperCase()}${word.slice(1)}`)
121
- .join('');
122
-
123
- if (identifier.length === 0) {
124
- identifier = fallback;
125
- }
126
- if (!/^[A-Za-z_$]/u.test(identifier)) {
127
- identifier = `${fallback}${identifier}`;
128
- }
129
- if (RESERVED_IDENTIFIERS.has(identifier.toLowerCase())) {
130
- identifier = `${fallback}${identifier}`;
131
- }
132
-
133
- return identifier;
134
- }
135
-
136
- export class SchemaRegistry {
137
- #documents;
138
- #names = new Map();
139
- #rawSchemas = new Map();
140
- #rootPath;
141
-
142
- constructor(documents, rootPath) {
143
- this.#documents = documents;
144
- this.#rootPath = rootPath;
145
- }
146
-
147
- register(rawSchema, context, suggestedName) {
148
- const canonicalKey = locationOf(context.documentPath, context.pointer);
149
- const existing = this.#rawSchemas.get(canonicalKey);
150
-
151
- if (existing !== undefined) {
152
- return existing.name;
153
- }
154
-
155
- const name = toPascalIdentifier(suggestedName);
156
- const nameKey = name.toLowerCase();
157
- const existingCanonicalKey = this.#names.get(nameKey);
158
-
159
- if (
160
- existingCanonicalKey !== undefined &&
161
- existingCanonicalKey !== canonicalKey
162
- ) {
163
- throw new Error(
164
- `Schema name collision for "${name}" at ${canonicalKey} and ${existingCanonicalKey}`
165
- );
166
- }
167
-
168
- this.#names.set(nameKey, canonicalKey);
169
- this.#rawSchemas.set(canonicalKey, {
170
- context,
171
- name,
172
- rawSchema,
173
- });
174
- return name;
175
- }
176
-
177
- async schemaNameFor(schema, context, suggestedName) {
178
- if (
179
- isRecord(schema) &&
180
- schema.$ref !== undefined &&
181
- Object.keys(schema).length === 1
182
- ) {
183
- const resolved = await this.#documents.resolveReference(
184
- schema.$ref,
185
- context.documentPath
186
- );
187
- return this.register(
188
- resolved.value,
189
- { documentPath: resolved.documentPath, pointer: resolved.pointer },
190
- this.#suggestReferenceName(resolved)
191
- );
192
- }
193
-
194
- return this.register(schema, context, suggestedName);
195
- }
196
-
197
- async build() {
198
- const schemas = await this.#normaliseAllSchemas();
199
- this.#rejectReferenceCycles(schemas);
200
- return schemas.sort((left, right) => left.name.localeCompare(right.name));
201
- }
202
-
203
- #suggestReferenceName(resolved) {
204
- const segments = resolved.pointer.split('/').filter(Boolean);
205
- const pointerName = segments.at(-1) ?? 'Schema';
206
-
207
- if (resolved.documentPath === this.#rootPath) {
208
- return pointerName;
209
- }
210
-
211
- const fileName = basename(
212
- resolved.documentPath,
213
- extname(resolved.documentPath)
214
- );
215
- return `${fileName}-${pointerName}`;
216
- }
217
-
218
- async #normaliseAllSchemas() {
219
- const normalised = new Map();
220
- const entries = [...this.#rawSchemas.entries()];
221
-
222
- for (let index = 0; index < entries.length; index += 1) {
223
- const [canonicalKey, entry] = entries[index];
224
- if (normalised.has(canonicalKey)) {
225
- continue;
226
- }
227
- normalised.set(canonicalKey, {
228
- canonicalKey,
229
- name: entry.name,
230
- schema: await this.#normaliseSchema(entry.rawSchema, entry.context),
231
- });
232
-
233
- for (const nextEntry of this.#rawSchemas.entries()) {
234
- if (!entries.some(([key]) => key === nextEntry[0])) {
235
- entries.push(nextEntry);
236
- }
237
- }
238
- }
239
-
240
- return [...normalised.values()];
241
- }
242
-
243
- async #normaliseSchema(rawSchema, context) {
244
- const location = locationOf(context.documentPath, context.pointer);
245
-
246
- if (typeof rawSchema === 'boolean') {
247
- return { booleanSchema: rawSchema, location };
248
- }
249
- const schema = requireRecord(rawSchema, location, 'Schema');
250
-
251
- for (const keyword of Object.keys(schema)) {
252
- if (
253
- !ANNOTATION_KEYWORDS.has(keyword) &&
254
- !ASSERTION_KEYWORDS.has(keyword)
255
- ) {
256
- throw new Error(
257
- `Unsupported schema keyword "${keyword}" at ${location}`
258
- );
259
- }
260
- }
261
-
262
- let reference = null;
263
- if (schema.$ref !== undefined) {
264
- const resolved = await this.#documents.resolveReference(
265
- schema.$ref,
266
- context.documentPath
267
- );
268
- reference = this.register(
269
- resolved.value,
270
- { documentPath: resolved.documentPath, pointer: resolved.pointer },
271
- this.#suggestReferenceName(resolved)
272
- );
273
- }
274
-
275
- let types = null;
276
- if (schema.type !== undefined) {
277
- const rawTypes = Array.isArray(schema.type) ? schema.type : [schema.type];
278
- if (
279
- rawTypes.length === 0 ||
280
- rawTypes.some((type) => !SCHEMA_TYPES.has(type))
281
- ) {
282
- throw new Error(`Unsupported schema type at ${location}`);
283
- }
284
- types = [...new Set(rawTypes)];
285
- }
286
-
287
- const required = schema.required ?? [];
288
- if (
289
- !Array.isArray(required) ||
290
- required.some((property) => typeof property !== 'string')
291
- ) {
292
- throw new Error(
293
- `Schema required list at ${location} must contain strings`
294
- );
295
- }
296
-
297
- const rawProperties = schema.properties ?? {};
298
- requireRecord(rawProperties, location, 'Schema properties');
299
- const propertyNames = [
300
- ...Object.keys(rawProperties),
301
- ...required.filter(
302
- (property) =>
303
- !Object.prototype.hasOwnProperty.call(rawProperties, property)
304
- ),
305
- ];
306
- const properties = [];
307
- for (const propertyName of propertyNames) {
308
- const propertySchema = Object.prototype.hasOwnProperty.call(
309
- rawProperties,
310
- propertyName
311
- )
312
- ? Reflect.get(rawProperties, propertyName)
313
- : true;
314
- properties.push({
315
- name: propertyName,
316
- required: required.includes(propertyName),
317
- schema: await this.#normaliseSchema(propertySchema, {
318
- documentPath: context.documentPath,
319
- pointer: pointerChild(
320
- pointerChild(context.pointer, 'properties'),
321
- propertyName
322
- ),
323
- }),
324
- });
325
- }
326
-
327
- let additionalProperties = true;
328
- if (schema.additionalProperties !== undefined) {
329
- additionalProperties =
330
- typeof schema.additionalProperties === 'boolean'
331
- ? schema.additionalProperties
332
- : await this.#normaliseSchema(schema.additionalProperties, {
333
- documentPath: context.documentPath,
334
- pointer: pointerChild(context.pointer, 'additionalProperties'),
335
- });
336
- }
337
-
338
- const normaliseList = async (keyword) => {
339
- if (schema[keyword] === undefined) {
340
- return [];
341
- }
342
- if (!Array.isArray(schema[keyword]) || schema[keyword].length === 0) {
343
- throw new Error(
344
- `Schema keyword "${keyword}" at ${location} must be non-empty`
345
- );
346
- }
347
- return Promise.all(
348
- schema[keyword].map((child, index) =>
349
- this.#normaliseSchema(child, {
350
- documentPath: context.documentPath,
351
- pointer: pointerChild(
352
- pointerChild(context.pointer, keyword),
353
- index
354
- ),
355
- })
356
- )
357
- );
358
- };
359
-
360
- let items = null;
361
- if (schema.items !== undefined) {
362
- items = await this.#normaliseSchema(schema.items, {
363
- documentPath: context.documentPath,
364
- pointer: pointerChild(context.pointer, 'items'),
365
- });
366
- }
367
-
368
- let enumValues = null;
369
- if (schema.enum !== undefined) {
370
- if (!Array.isArray(schema.enum) || schema.enum.length === 0) {
371
- throw new Error(`Schema enum at ${location} must be non-empty`);
372
- }
373
- for (const value of schema.enum) {
374
- validatePrimitive(value, 'enum', location);
375
- }
376
- enumValues = schema.enum;
377
- }
378
- if (schema.const !== undefined) {
379
- validatePrimitive(schema.const, 'const', location);
380
- }
381
-
382
- if (schema.pattern !== undefined) {
383
- if (typeof schema.pattern !== 'string') {
384
- throw new Error(`Schema pattern at ${location} must be a string`);
385
- }
386
- try {
387
- new RegExp(schema.pattern, 'u');
388
- } catch {
389
- throw new Error(
390
- `Schema pattern at ${location} is not valid JavaScript`
391
- );
392
- }
393
- }
394
- if (schema.format !== undefined && schema.format !== 'email') {
395
- throw new Error(
396
- `Unsupported schema format "${schema.format}" at ${location}`
397
- );
398
- }
399
-
400
- const numberKeyword = (keyword) =>
401
- schema[keyword] === undefined
402
- ? null
403
- : requireNumber(schema[keyword], keyword, location);
404
- const integerKeyword = (keyword) => {
405
- const value = numberKeyword(keyword);
406
- if (value !== null && (!Number.isInteger(value) || value < 0)) {
407
- throw new Error(
408
- `Schema keyword "${keyword}" at ${location} must be >= 0`
409
- );
410
- }
411
- return value;
412
- };
413
-
414
- return {
415
- additionalProperties,
416
- allOf: await normaliseList('allOf'),
417
- anyOf: await normaliseList('anyOf'),
418
- constValue: schema.const,
419
- enumValues,
420
- exclusiveMaximum: numberKeyword('exclusiveMaximum'),
421
- exclusiveMinimum: numberKeyword('exclusiveMinimum'),
422
- format: schema.format ?? null,
423
- items,
424
- location,
425
- maximum: numberKeyword('maximum'),
426
- maxLength: integerKeyword('maxLength'),
427
- minimum: numberKeyword('minimum'),
428
- minLength: integerKeyword('minLength'),
429
- oneOf: await normaliseList('oneOf'),
430
- pattern: schema.pattern ?? null,
431
- properties,
432
- reference,
433
- types,
434
- };
435
- }
436
-
437
- #rejectReferenceCycles(schemas) {
438
- const schemaByName = new Map(
439
- schemas.map((entry) => [entry.name, entry.schema])
440
- );
441
- const visiting = [];
442
- const visited = new Set();
443
-
444
- const collectReferences = (schema, references) => {
445
- if (schema.reference !== null && schema.reference !== undefined) {
446
- references.add(schema.reference);
447
- }
448
- for (const property of schema.properties ?? []) {
449
- collectReferences(property.schema, references);
450
- }
451
- if (
452
- schema.additionalProperties !== true &&
453
- schema.additionalProperties !== false &&
454
- schema.additionalProperties !== undefined
455
- ) {
456
- collectReferences(schema.additionalProperties, references);
457
- }
458
- if (schema.items !== null && schema.items !== undefined) {
459
- collectReferences(schema.items, references);
460
- }
461
- for (const keyword of ['allOf', 'anyOf', 'oneOf']) {
462
- for (const child of schema[keyword] ?? []) {
463
- collectReferences(child, references);
464
- }
465
- }
466
- };
467
-
468
- const visit = (name) => {
469
- if (visited.has(name)) {
470
- return;
471
- }
472
- const cycleIndex = visiting.indexOf(name);
473
- if (cycleIndex !== -1) {
474
- const cycle = [...visiting.slice(cycleIndex), name].join(' -> ');
475
- throw new Error(`Cyclic schema reference: ${cycle}`);
476
- }
477
-
478
- const schema = schemaByName.get(name);
479
- if (schema === undefined) {
480
- throw new Error(`Unresolved schema model reference "${name}"`);
481
- }
482
- visiting.push(name);
483
- const references = new Set();
484
- collectReferences(schema, references);
485
- for (const reference of [...references].sort()) {
486
- visit(reference);
487
- }
488
- visiting.pop();
489
- visited.add(name);
490
- };
491
-
492
- for (const { name } of schemas) {
493
- visit(name);
494
- }
495
- }
496
- }
497
-
@@ -1,196 +0,0 @@
1
- import {
2
- access,
3
- mkdir,
4
- mkdtemp,
5
- readFile,
6
- readdir,
7
- rename,
8
- rm,
9
- writeFile,
10
- } from 'node:fs/promises';
11
- import {
12
- basename,
13
- dirname,
14
- isAbsolute,
15
- join,
16
- parse,
17
- relative,
18
- } from 'node:path';
19
-
20
- const MANIFEST_FILE = '.openapi-runtime-manifest.json';
21
- const LEGACY_GENERATED_FILE =
22
- /^(?:quickpay-api\.ts|(?:endpoints|schemas)\/[^/]+\.ts)$/u;
23
-
24
- async function exists(path) {
25
- try {
26
- await access(path);
27
- return true;
28
- } catch {
29
- return false;
30
- }
31
- }
32
-
33
- async function listFiles(directory, prefix = '') {
34
- const entries = await readdir(directory, { withFileTypes: true });
35
- const files = [];
36
-
37
- for (const entry of entries.sort((left, right) =>
38
- left.name.localeCompare(right.name)
39
- )) {
40
- const relativePath =
41
- prefix.length === 0 ? entry.name : `${prefix}/${entry.name}`;
42
- const absolutePath = join(directory, entry.name);
43
-
44
- if (entry.isDirectory()) {
45
- files.push(...(await listFiles(absolutePath, relativePath)));
46
- } else {
47
- files.push(relativePath);
48
- }
49
- }
50
-
51
- return files;
52
- }
53
-
54
- function validateGeneratedPath(path) {
55
- if (
56
- path.length === 0 ||
57
- isAbsolute(path) ||
58
- path.split('/').some((segment) => segment === '..' || segment.length === 0)
59
- ) {
60
- throw new Error(`Unsafe generated output path "${path}"`);
61
- }
62
- }
63
-
64
- function isAncestor(parent, child) {
65
- const pathFromParent = relative(parent, child);
66
- return (
67
- pathFromParent.length === 0 ||
68
- (!pathFromParent.startsWith('..') && !isAbsolute(pathFromParent))
69
- );
70
- }
71
-
72
- function validateOutputRoot(outDir, protectedPaths) {
73
- if (parse(outDir).root === outDir) {
74
- throw new Error(`Unsafe OpenAPI output directory "${outDir}"`);
75
- }
76
-
77
- for (const protectedPath of protectedPaths) {
78
- if (isAncestor(outDir, protectedPath)) {
79
- throw new Error(
80
- `OpenAPI output directory "${outDir}" contains protected input "${protectedPath}"`
81
- );
82
- }
83
- }
84
- }
85
-
86
- async function validateExistingOutput(outDir) {
87
- if (!(await exists(outDir))) {
88
- return false;
89
- }
90
-
91
- const existingFiles = await listFiles(outDir);
92
- if (existingFiles.length === 0) {
93
- return true;
94
- }
95
-
96
- if (!existingFiles.includes(MANIFEST_FILE)) {
97
- const unexpected = existingFiles.find(
98
- (file) => !LEGACY_GENERATED_FILE.test(file)
99
- );
100
- if (unexpected !== undefined) {
101
- throw new Error(
102
- `OpenAPI output directory contains unexpected file "${unexpected}"`
103
- );
104
- }
105
- return true;
106
- }
107
-
108
- let manifest;
109
- try {
110
- manifest = JSON.parse(await readFile(join(outDir, MANIFEST_FILE), 'utf8'));
111
- } catch {
112
- throw new Error(`OpenAPI output manifest is invalid at ${outDir}`);
113
- }
114
- if (
115
- typeof manifest !== 'object' ||
116
- manifest === null ||
117
- !Array.isArray(manifest.files) ||
118
- manifest.files.some((file) => typeof file !== 'string')
119
- ) {
120
- throw new Error(`OpenAPI output manifest is invalid at ${outDir}`);
121
- }
122
-
123
- const ownedFiles = new Set([...manifest.files, MANIFEST_FILE]);
124
- const unexpected = existingFiles.find((file) => !ownedFiles.has(file));
125
- if (unexpected !== undefined) {
126
- throw new Error(
127
- `OpenAPI output directory contains unexpected file "${unexpected}"`
128
- );
129
- }
130
-
131
- return true;
132
- }
133
-
134
- async function writeStage(stagePath, files) {
135
- await mkdir(stagePath, { recursive: true });
136
-
137
- for (const [relativePath, content] of files) {
138
- validateGeneratedPath(relativePath);
139
- const targetPath = join(stagePath, relativePath);
140
- await mkdir(dirname(targetPath), { recursive: true });
141
- await writeFile(targetPath, content);
142
- }
143
-
144
- const manifest = {
145
- version: 1,
146
- files: [...files.keys()].sort(),
147
- };
148
- await writeFile(
149
- join(stagePath, MANIFEST_FILE),
150
- `${JSON.stringify(manifest, null, 2)}\n`
151
- );
152
- }
153
-
154
- export async function writeGeneratedOutput(
155
- outDir,
156
- files,
157
- { protectedPaths = [] } = {}
158
- ) {
159
- validateOutputRoot(outDir, protectedPaths);
160
- const hadExistingOutput = await validateExistingOutput(outDir);
161
- const parent = dirname(outDir);
162
- await mkdir(parent, { recursive: true });
163
- const swapRoot = await mkdtemp(
164
- join(parent, `.${basename(outDir)}.openapi-runtime-`)
165
- );
166
- const stagedOutput = join(swapRoot, 'next');
167
- const previousOutput = join(swapRoot, 'previous');
168
- let movedPreviousOutput = false;
169
-
170
- try {
171
- await writeStage(stagedOutput, files);
172
- if (hadExistingOutput) {
173
- await rename(outDir, previousOutput);
174
- movedPreviousOutput = true;
175
- }
176
- try {
177
- await rename(stagedOutput, outDir);
178
- } catch (error) {
179
- if (movedPreviousOutput && !(await exists(outDir))) {
180
- await rename(previousOutput, outDir);
181
- movedPreviousOutput = false;
182
- }
183
- throw error;
184
- }
185
- if (movedPreviousOutput) {
186
- await rm(previousOutput, { force: true, recursive: true });
187
- movedPreviousOutput = false;
188
- }
189
- } finally {
190
- if (movedPreviousOutput && !(await exists(outDir))) {
191
- await rename(previousOutput, outDir);
192
- }
193
- await rm(swapRoot, { force: true, recursive: true });
194
- }
195
- }
196
-
package/src/index.d.ts DELETED
@@ -1,16 +0,0 @@
1
- export type GenerateOpenApiRuntimeOptions = {
2
- readonly argv?: readonly string[];
3
- readonly cwd?: string;
4
- };
5
-
6
- export type GenerateOpenApiRuntimeResult = {
7
- readonly operationCount: number;
8
- readonly operationNames: readonly string[];
9
- readonly schemaCount: number;
10
- };
11
-
12
- export function generateOpenApiRuntime(
13
- options?: GenerateOpenApiRuntimeOptions
14
- ): Promise<GenerateOpenApiRuntimeResult>;
15
-
16
- export function main(argv?: readonly string[]): Promise<void>;
package/src/index.mjs DELETED
@@ -1,4 +0,0 @@
1
- export {
2
- generateOpenApiRuntime,
3
- main,
4
- } from './generator/generateOpenApiRuntime.mjs';