@ouispec/contract 0.1.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/INTEGRATOR-GUIDE.md +729 -0
- package/LICENSE +21 -0
- package/README.md +10 -0
- package/dist/codegen.d.ts +71 -0
- package/dist/codegen.d.ts.map +1 -0
- package/dist/codegen.js +195 -0
- package/dist/codegen.js.map +1 -0
- package/dist/generated/contract.d.ts +1286 -0
- package/dist/generated/contract.d.ts.map +1 -0
- package/dist/generated/contract.js +14 -0
- package/dist/generated/contract.js.map +1 -0
- package/dist/generated/schemas.d.ts +111 -0
- package/dist/generated/schemas.d.ts.map +1 -0
- package/dist/generated/schemas.js +3256 -0
- package/dist/generated/schemas.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/render-contract.d.ts +47 -0
- package/dist/render-contract.d.ts.map +1 -0
- package/dist/render-contract.js +123 -0
- package/dist/render-contract.js.map +1 -0
- package/dist/render-guide.d.ts +4 -0
- package/dist/render-guide.d.ts.map +1 -0
- package/dist/render-guide.js +132 -0
- package/dist/render-guide.js.map +1 -0
- package/dist/schema-document.d.ts +7 -0
- package/dist/schema-document.d.ts.map +1 -0
- package/dist/schema-document.js +2 -0
- package/dist/schema-document.js.map +1 -0
- package/dist/validate.d.ts +22 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +89 -0
- package/dist/validate.js.map +1 -0
- package/package.json +65 -0
- package/schemas/action-effect.json +113 -0
- package/schemas/agent-binding.json +58 -0
- package/schemas/approvals.json +249 -0
- package/schemas/control-kind-registration.json +187 -0
- package/schemas/control-table.json +276 -0
- package/schemas/event-declarations.json +316 -0
- package/schemas/generated-knowledge.json +58 -0
- package/schemas/json-schema.json +153 -0
- package/schemas/oui-config.json +178 -0
- package/schemas/oui-manifest.json +346 -0
- package/schemas/room-catalog-data.json +455 -0
- package/schemas/tier2-mapping.json +195 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Closure Studio
|
|
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,10 @@
|
|
|
1
|
+
# @ouispec/contract
|
|
2
|
+
|
|
3
|
+
The OUI integrator contract (ADR-0226 §3): the JSON Schemas a product builds against, versioned together by `MANIFEST_VERSION`, the TypeScript types generated from them, a validator, and the [integrator guide](INTEGRATOR-GUIDE.md).
|
|
4
|
+
|
|
5
|
+
- `schemas/*.json` — the authority. Each `$id` is `https://schemas.closurestudio.ai/oui/v<major>/<file>`; the event declarations keep their own `…/agent-sdk/event-declarations/v1.json`. Published as `@ouispec/contract/schemas/<file>`.
|
|
6
|
+
- `@ouispec/contract` — the generated types (`ControlTableFile`, `AgentBinding`, `OuiManifest`, `Approvals`' messages, …), `MANIFEST_VERSION`, and every schema as a value (`CONTRACT_SCHEMAS`).
|
|
7
|
+
- `@ouispec/contract/validate` — `contractProblems(ref, value)`, by file or by type name.
|
|
8
|
+
- `@ouispec/contract/codegen` — the one schema-to-TypeScript renderer, also used for a product's event payload types.
|
|
9
|
+
|
|
10
|
+
Edit a schema or a `guide/` section, then `pnpm generate`: it rewrites `src/generated/` and `INTEGRATOR-GUIDE.md`. `pnpm build` fails when either is stale.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ouispec/contract/codegen — TypeScript from JSON Schema.
|
|
3
|
+
*
|
|
4
|
+
* One renderer for every type the platform generates from a schema: the
|
|
5
|
+
* contract's own types (this package's `src/generated/contract.ts`) and a
|
|
6
|
+
* product's event payload types (`@ouispec/agent-events/codegen`).
|
|
7
|
+
* The schema is the authority and the types follow it, never the other way
|
|
8
|
+
* round.
|
|
9
|
+
*
|
|
10
|
+
* It renders the keywords that shape a value (`$ref`, `const`, `enum`,
|
|
11
|
+
* `type`, `properties`, `required`, `additionalProperties`, `items`, `allOf`,
|
|
12
|
+
* `anyOf`, `oneOf`) and treats the rest as validation only. Where JSON Schema
|
|
13
|
+
* cannot say what TypeScript can (a template literal, `keyof`), a schema
|
|
14
|
+
* states the type in its `$comment` as `ts: <type>`, which every validator
|
|
15
|
+
* ignores.
|
|
16
|
+
*/
|
|
17
|
+
/** The schema keywords the renderer reads. Any other keyword is validation only. */
|
|
18
|
+
export interface RenderableSchema {
|
|
19
|
+
$ref?: string;
|
|
20
|
+
$comment?: string;
|
|
21
|
+
type?: string | readonly string[];
|
|
22
|
+
description?: string;
|
|
23
|
+
const?: unknown;
|
|
24
|
+
enum?: readonly unknown[];
|
|
25
|
+
properties?: Readonly<Record<string, RenderableSchema>>;
|
|
26
|
+
required?: readonly string[];
|
|
27
|
+
additionalProperties?: boolean | RenderableSchema;
|
|
28
|
+
items?: RenderableSchema;
|
|
29
|
+
allOf?: readonly RenderableSchema[];
|
|
30
|
+
anyOf?: readonly RenderableSchema[];
|
|
31
|
+
oneOf?: readonly RenderableSchema[];
|
|
32
|
+
[keyword: string]: unknown;
|
|
33
|
+
}
|
|
34
|
+
export interface RenderOptions {
|
|
35
|
+
/** The type name a `$ref` names. Throws for one that names nothing. */
|
|
36
|
+
refName(ref: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* How an array renders: `Array<T>`, or `readonly T[]` for a contract whose
|
|
39
|
+
* values are read, never changed, by whoever receives them. Default `Array`.
|
|
40
|
+
*/
|
|
41
|
+
arrays?: 'Array' | 'readonly';
|
|
42
|
+
/**
|
|
43
|
+
* An object with no properties of its own but a schema for every other key:
|
|
44
|
+
* as an index signature member (`{ [key: string]: T }`), or as
|
|
45
|
+
* `Readonly<Record<string, T>>`. Default `index`.
|
|
46
|
+
*/
|
|
47
|
+
maps?: 'index' | 'Record';
|
|
48
|
+
/**
|
|
49
|
+
* The index signature of an object that has both properties and a schema
|
|
50
|
+
* for every other key: `unknown`, or every type a key can hold (TypeScript
|
|
51
|
+
* requires each property to fit it). Default `unknown`.
|
|
52
|
+
*/
|
|
53
|
+
indexSignature?: 'unknown' | 'union';
|
|
54
|
+
}
|
|
55
|
+
/** A property name as TypeScript writes it: bare when it can be, quoted otherwise. */
|
|
56
|
+
export declare const propertyKey: (name: string) => string;
|
|
57
|
+
/** A JSON value as a TypeScript literal type. */
|
|
58
|
+
export declare const literal: (value: unknown) => string;
|
|
59
|
+
/** A doc comment, wrapped to 96 columns, or nothing when there is no text. */
|
|
60
|
+
export declare function doc(text: string | undefined, indent: string): string;
|
|
61
|
+
/** The type a schema states in its `$comment`, if it states one. */
|
|
62
|
+
export declare function statedType(schema: RenderableSchema): string | null;
|
|
63
|
+
/** A schema as a TypeScript type expression. */
|
|
64
|
+
export declare function renderType(schema: RenderableSchema, indent: string, options: RenderOptions): string;
|
|
65
|
+
/** The members of an object schema, one per line. */
|
|
66
|
+
export declare function renderMembers(schema: RenderableSchema, indent: string, options: RenderOptions): string;
|
|
67
|
+
/** An object schema as an object type. */
|
|
68
|
+
export declare function renderObject(schema: RenderableSchema, indent: string, options: RenderOptions): string;
|
|
69
|
+
/** One named type: an alias, an interface, or an interface extending its `$ref`s. */
|
|
70
|
+
export declare function renderNamed(name: string, schema: RenderableSchema, description: string | undefined, options: RenderOptions): string;
|
|
71
|
+
//# sourceMappingURL=codegen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../src/codegen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,oFAAoF;AACpF,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC;IACxD,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,oBAAoB,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAAC;IAClD,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,KAAK,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACpC,KAAK,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACpC,KAAK,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACpC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED,MAAM,WA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|
|
|
1
|
+
/**
|
|
2
|
+
* @ouispec/contract/codegen — TypeScript from JSON Schema.
|
|
3
|
+
*
|
|
4
|
+
* One renderer for every type the platform generates from a schema: the
|
|
5
|
+
* contract's own types (this package's `src/generated/contract.ts`) and a
|
|
6
|
+
* product's event payload types (`@ouispec/agent-events/codegen`).
|
|
7
|
+
* The schema is the authority and the types follow it, never the other way
|
|
8
|
+
* round.
|
|
9
|
+
*
|
|
10
|
+
* It renders the keywords that shape a value (`$ref`, `const`, `enum`,
|
|
11
|
+
* `type`, `properties`, `required`, `additionalProperties`, `items`, `allOf`,
|
|
12
|
+
* `anyOf`, `oneOf`) and treats the rest as validation only. Where JSON Schema
|
|
13
|
+
* cannot say what TypeScript can (a template literal, `keyof`), a schema
|
|
14
|
+
* states the type in its `$comment` as `ts: <type>`, which every validator
|
|
15
|
+
* ignores.
|
|
16
|
+
*/
|
|
17
|
+
const IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
|
|
18
|
+
const TS_COMMENT = /^ts:\s*(.+)$/s;
|
|
19
|
+
/** A property name as TypeScript writes it: bare when it can be, quoted otherwise. */
|
|
20
|
+
export const propertyKey = (name) => (IDENTIFIER.test(name) ? name : `'${name}'`);
|
|
21
|
+
/** A JSON value as a TypeScript literal type. */
|
|
22
|
+
export const literal = (value) => typeof value === 'string' ? `'${value.replace(/\\/g, '\\\\').replace(/'/g, "\\'")}'` : JSON.stringify(value);
|
|
23
|
+
/** Break a paragraph into lines of at most `width` characters, at spaces. */
|
|
24
|
+
function wrap(paragraph, width) {
|
|
25
|
+
const lines = [];
|
|
26
|
+
let line = '';
|
|
27
|
+
for (const word of paragraph.split(' ')) {
|
|
28
|
+
if (line && line.length + 1 + word.length > width) {
|
|
29
|
+
lines.push(line);
|
|
30
|
+
line = word;
|
|
31
|
+
}
|
|
32
|
+
else
|
|
33
|
+
line = line ? `${line} ${word}` : word;
|
|
34
|
+
}
|
|
35
|
+
return [...lines, line];
|
|
36
|
+
}
|
|
37
|
+
/** A doc comment, wrapped to 96 columns, or nothing when there is no text. */
|
|
38
|
+
export function doc(text, indent) {
|
|
39
|
+
if (!text)
|
|
40
|
+
return '';
|
|
41
|
+
const width = 96 - indent.length;
|
|
42
|
+
const safe = text.replace(/\*\//g, '*\\/');
|
|
43
|
+
if (!safe.includes('\n') && safe.length <= width - 7)
|
|
44
|
+
return `${indent}/** ${safe} */\n`;
|
|
45
|
+
// Tables and fenced code keep their lines; prose wraps.
|
|
46
|
+
let fenced = false;
|
|
47
|
+
const lines = safe.split('\n').flatMap((p) => {
|
|
48
|
+
if (p.startsWith('```'))
|
|
49
|
+
fenced = !fenced;
|
|
50
|
+
if (fenced || p.startsWith('```') || p.startsWith('|'))
|
|
51
|
+
return [p];
|
|
52
|
+
return p ? wrap(p, width - 3) : [''];
|
|
53
|
+
});
|
|
54
|
+
return `${indent}/**\n${lines.map((l) => `${indent} *${l ? ` ${l}` : ''}`).join('\n')}\n${indent} */\n`;
|
|
55
|
+
}
|
|
56
|
+
/** The type a schema states in its `$comment`, if it states one. */
|
|
57
|
+
export function statedType(schema) {
|
|
58
|
+
return typeof schema.$comment === 'string' ? (TS_COMMENT.exec(schema.$comment.trim())?.[1].trim() ?? null) : null;
|
|
59
|
+
}
|
|
60
|
+
/** Whether a type expression has a `|` or `&` outside any brackets, so it needs parentheses as an element type. */
|
|
61
|
+
function isCompound(type) {
|
|
62
|
+
let depth = 0;
|
|
63
|
+
for (let i = 0; i < type.length; i++) {
|
|
64
|
+
const c = type[i];
|
|
65
|
+
if (c === '{' || c === '(' || c === '<' || c === '[')
|
|
66
|
+
depth++;
|
|
67
|
+
else if (c === '}' || c === ')' || c === '>' || c === ']')
|
|
68
|
+
depth--;
|
|
69
|
+
else if (depth === 0 && (c === '|' || c === '&') && type[i - 1] === ' ')
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
function arrayOf(element, options) {
|
|
75
|
+
if ((options.arrays ?? 'Array') === 'Array')
|
|
76
|
+
return `Array<${element}>`;
|
|
77
|
+
return `readonly ${isCompound(element) ? `(${element})` : element}[]`;
|
|
78
|
+
}
|
|
79
|
+
/** A schema as a TypeScript type expression. */
|
|
80
|
+
export function renderType(schema, indent, options) {
|
|
81
|
+
const stated = statedType(schema);
|
|
82
|
+
if (stated)
|
|
83
|
+
return stated;
|
|
84
|
+
if (typeof schema.$ref === 'string')
|
|
85
|
+
return options.refName(schema.$ref);
|
|
86
|
+
if ('const' in schema)
|
|
87
|
+
return literal(schema.const);
|
|
88
|
+
if (schema.enum)
|
|
89
|
+
return schema.enum.map(literal).join(' | ');
|
|
90
|
+
if (schema.allOf?.length) {
|
|
91
|
+
const parts = schema.allOf.map((s) => renderType(s, indent, options));
|
|
92
|
+
const own = schema.properties ? [renderObject(schema, indent, options)] : [];
|
|
93
|
+
return [...parts, ...own].join(' & ');
|
|
94
|
+
}
|
|
95
|
+
const union = schema.anyOf ?? schema.oneOf;
|
|
96
|
+
if (union)
|
|
97
|
+
return union.map((s) => renderType(s, indent, options)).join(' | ');
|
|
98
|
+
const types = schema.type === undefined ? [] : Array.isArray(schema.type) ? schema.type : [schema.type];
|
|
99
|
+
if (types.length === 0)
|
|
100
|
+
return schema.properties ? renderObject(schema, indent, options) : 'unknown';
|
|
101
|
+
return types
|
|
102
|
+
.map((type) => {
|
|
103
|
+
switch (type) {
|
|
104
|
+
case 'string':
|
|
105
|
+
return 'string';
|
|
106
|
+
case 'number':
|
|
107
|
+
case 'integer':
|
|
108
|
+
return 'number';
|
|
109
|
+
case 'boolean':
|
|
110
|
+
return 'boolean';
|
|
111
|
+
case 'null':
|
|
112
|
+
return 'null';
|
|
113
|
+
case 'array':
|
|
114
|
+
return schema.items ? arrayOf(renderType(schema.items, indent, options), options) : arrayOf('unknown', options).replace('Array<unknown>', 'unknown[]');
|
|
115
|
+
case 'object':
|
|
116
|
+
return schema.properties || schema.additionalProperties ? renderObject(schema, indent, options) : 'Record<string, unknown>';
|
|
117
|
+
default:
|
|
118
|
+
return 'unknown';
|
|
119
|
+
}
|
|
120
|
+
})
|
|
121
|
+
.join(' | ');
|
|
122
|
+
}
|
|
123
|
+
const isOpen = (extra) => extra === true || (!!extra && typeof extra === 'object' && Object.keys(extra).length === 0);
|
|
124
|
+
/** The members of an object schema, one per line. */
|
|
125
|
+
export function renderMembers(schema, indent, options) {
|
|
126
|
+
const required = new Set(schema.required ?? []);
|
|
127
|
+
let out = '';
|
|
128
|
+
const held = [];
|
|
129
|
+
let optional = false;
|
|
130
|
+
for (const [name, prop] of Object.entries(schema.properties ?? {})) {
|
|
131
|
+
const type = renderType(prop, indent, options);
|
|
132
|
+
held.push(type);
|
|
133
|
+
if (!required.has(name))
|
|
134
|
+
optional = true;
|
|
135
|
+
out += doc(prop.description, indent);
|
|
136
|
+
out += `${indent}${propertyKey(name)}${required.has(name) ? '' : '?'}: ${type};\n`;
|
|
137
|
+
}
|
|
138
|
+
const extra = schema.additionalProperties;
|
|
139
|
+
if (isOpen(extra)) {
|
|
140
|
+
out += `${indent}[key: string]: unknown;\n`;
|
|
141
|
+
}
|
|
142
|
+
else if (extra && typeof extra === 'object') {
|
|
143
|
+
let index;
|
|
144
|
+
if (!schema.properties)
|
|
145
|
+
index = renderType(extra, indent, options);
|
|
146
|
+
else if ((options.indexSignature ?? 'unknown') === 'unknown')
|
|
147
|
+
index = 'unknown';
|
|
148
|
+
else
|
|
149
|
+
index = [...new Set([renderType(extra, indent, options), ...held, ...(optional ? ['undefined'] : [])])].join(' | ');
|
|
150
|
+
out += `${indent}[key: string]: ${index};\n`;
|
|
151
|
+
}
|
|
152
|
+
return out;
|
|
153
|
+
}
|
|
154
|
+
/** An object schema as an object type. */
|
|
155
|
+
export function renderObject(schema, indent, options) {
|
|
156
|
+
const extra = schema.additionalProperties;
|
|
157
|
+
if (options.maps === 'Record' &&
|
|
158
|
+
!schema.properties &&
|
|
159
|
+
extra !== undefined &&
|
|
160
|
+
extra !== false) {
|
|
161
|
+
return `Readonly<Record<string, ${isOpen(extra) ? 'unknown' : renderType(extra, indent, options)}>>`;
|
|
162
|
+
}
|
|
163
|
+
const inner = `${indent} `;
|
|
164
|
+
const members = renderMembers(schema, inner, options);
|
|
165
|
+
return members ? `{\n${members}${indent}}` : 'Record<string, never>';
|
|
166
|
+
}
|
|
167
|
+
/** One named type: an alias, an interface, or an interface extending its `$ref`s. */
|
|
168
|
+
export function renderNamed(name, schema, description, options) {
|
|
169
|
+
const head = doc(description ?? schema.description, '');
|
|
170
|
+
const stated = statedType(schema);
|
|
171
|
+
if (stated)
|
|
172
|
+
return `${head}export type ${name} = ${stated};\n`;
|
|
173
|
+
const onlyRef = typeof schema.$ref === 'string' && !schema.properties && !schema.allOf;
|
|
174
|
+
if (onlyRef)
|
|
175
|
+
return `${head}export type ${name} = ${options.refName(schema.$ref)};\n`;
|
|
176
|
+
const parts = schema.allOf ?? [];
|
|
177
|
+
const isRefPart = (p) => typeof p.$ref === 'string' && Object.keys(p).every((k) => k === '$ref' || k === 'description');
|
|
178
|
+
const refs = parts.filter(isRefPart).map((p) => options.refName(p.$ref));
|
|
179
|
+
const rest = parts.filter((p) => !isRefPart(p));
|
|
180
|
+
const own = {
|
|
181
|
+
properties: { ...Object.assign({}, ...rest.map((p) => p.properties ?? {})), ...schema.properties },
|
|
182
|
+
required: [...rest.flatMap((p) => p.required ?? []), ...(schema.required ?? [])],
|
|
183
|
+
additionalProperties: schema.additionalProperties ?? rest.find((p) => p.additionalProperties !== undefined)?.additionalProperties,
|
|
184
|
+
};
|
|
185
|
+
const isObject = schema.type === 'object' || refs.length > 0 || rest.length > 0 || !!schema.properties;
|
|
186
|
+
if (!isObject || schema.anyOf || schema.oneOf || rest.some((p) => p.anyOf || p.oneOf || p.$ref)) {
|
|
187
|
+
return `${head}export type ${name} = ${renderType(schema, '', options)};\n`;
|
|
188
|
+
}
|
|
189
|
+
if (options.maps === 'Record' && !schema.properties && refs.length === 0 && rest.length === 0) {
|
|
190
|
+
return `${head}export type ${name} = ${renderObject(schema, '', options)};\n`;
|
|
191
|
+
}
|
|
192
|
+
const members = renderMembers(own, ' ', options);
|
|
193
|
+
return `${head}export interface ${name}${refs.length ? ` extends ${refs.join(', ')}` : ''} {\n${members}}\n`;
|
|
194
|
+
}
|
|
195
|
+
//# sourceMappingURL=codegen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen.js","sourceRoot":"","sources":["../src/codegen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA0CH,MAAM,UAAU,GAAG,4BAA4B,CAAC;AAChD,MAAM,UAAU,GAAG,eAAe,CAAC;AAEnC,sFAAsF;AACtF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC;AAElG,iDAAiD;AACjD,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAc,EAAU,EAAE,CAChD,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAE/G,6EAA6E;AAC7E,SAAS,IAAI,CAAC,SAAiB,EAAE,KAAa;IAC5C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACxC,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,KAAK,EAAE,CAAC;YAClD,KAAK,CAAC,IAAI,CAAC,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