@contractspec/lib.contracts-transformers 1.57.0 → 1.58.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/browser/common/index.js +86 -0
- package/dist/browser/index.js +2414 -0
- package/dist/browser/openapi/index.js +2404 -0
- package/dist/common/index.d.ts +6 -3
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +87 -3
- package/dist/common/types.d.ts +119 -120
- package/dist/common/types.d.ts.map +1 -1
- package/dist/common/utils.d.ts +11 -14
- package/dist/common/utils.d.ts.map +1 -1
- package/dist/index.d.ts +18 -18
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2415 -18
- package/dist/node/common/index.js +86 -0
- package/dist/node/index.js +2414 -0
- package/dist/node/openapi/index.js +2404 -0
- package/dist/openapi/differ.d.ts +21 -21
- package/dist/openapi/differ.d.ts.map +1 -1
- package/dist/openapi/exporter/data-views.d.ts +24 -25
- package/dist/openapi/exporter/data-views.d.ts.map +1 -1
- package/dist/openapi/exporter/events.d.ts +15 -15
- package/dist/openapi/exporter/events.d.ts.map +1 -1
- package/dist/openapi/exporter/features.d.ts +23 -24
- package/dist/openapi/exporter/features.d.ts.map +1 -1
- package/dist/openapi/exporter/forms.d.ts +17 -17
- package/dist/openapi/exporter/forms.d.ts.map +1 -1
- package/dist/openapi/exporter/index.d.ts +12 -0
- package/dist/openapi/exporter/index.d.ts.map +1 -0
- package/dist/openapi/exporter/operations.d.ts +29 -29
- package/dist/openapi/exporter/operations.d.ts.map +1 -1
- package/dist/openapi/exporter/presentations.d.ts +16 -17
- package/dist/openapi/exporter/presentations.d.ts.map +1 -1
- package/dist/openapi/exporter/registries.d.ts +13 -14
- package/dist/openapi/exporter/registries.d.ts.map +1 -1
- package/dist/openapi/exporter/workflows.d.ts +23 -24
- package/dist/openapi/exporter/workflows.d.ts.map +1 -1
- package/dist/openapi/exporter.d.ts +24 -23
- package/dist/openapi/exporter.d.ts.map +1 -1
- package/dist/openapi/exporter.test.d.ts +2 -0
- package/dist/openapi/exporter.test.d.ts.map +1 -0
- package/dist/openapi/importer/analyzer.d.ts +14 -0
- package/dist/openapi/importer/analyzer.d.ts.map +1 -0
- package/dist/openapi/importer/events.d.ts +7 -0
- package/dist/openapi/importer/events.d.ts.map +1 -0
- package/dist/openapi/importer/generator.d.ts +8 -0
- package/dist/openapi/importer/generator.d.ts.map +1 -0
- package/dist/openapi/importer/grouping.d.ts +27 -0
- package/dist/openapi/importer/grouping.d.ts.map +1 -0
- package/dist/openapi/importer/index.d.ts +11 -9
- package/dist/openapi/importer/index.d.ts.map +1 -1
- package/dist/openapi/importer/models.d.ts +7 -0
- package/dist/openapi/importer/models.d.ts.map +1 -0
- package/dist/openapi/importer/schemas.d.ts +15 -0
- package/dist/openapi/importer/schemas.d.ts.map +1 -0
- package/dist/openapi/importer.d.ts +6 -0
- package/dist/openapi/importer.d.ts.map +1 -0
- package/dist/openapi/index.d.ts +12 -16
- package/dist/openapi/index.d.ts.map +1 -0
- package/dist/openapi/index.js +2405 -18
- package/dist/openapi/parser/document.d.ts +5 -9
- package/dist/openapi/parser/document.d.ts.map +1 -1
- package/dist/openapi/parser/index.d.ts +6 -0
- package/dist/openapi/parser/index.d.ts.map +1 -0
- package/dist/openapi/parser/operation.d.ts +7 -0
- package/dist/openapi/parser/operation.d.ts.map +1 -0
- package/dist/openapi/parser/parameters.d.ts +11 -0
- package/dist/openapi/parser/parameters.d.ts.map +1 -0
- package/dist/openapi/parser/resolvers.d.ts +21 -0
- package/dist/openapi/parser/resolvers.d.ts.map +1 -0
- package/dist/openapi/parser/utils.d.ts +9 -8
- package/dist/openapi/parser/utils.d.ts.map +1 -1
- package/dist/openapi/parser.d.ts +6 -0
- package/dist/openapi/parser.d.ts.map +1 -0
- package/dist/openapi/schema-converter.d.ts +45 -45
- package/dist/openapi/schema-converter.d.ts.map +1 -1
- package/dist/openapi/schema-generators/index.d.ts +115 -0
- package/dist/openapi/schema-generators/index.d.ts.map +1 -0
- package/dist/openapi/schema-generators.test.d.ts +2 -0
- package/dist/openapi/schema-generators.test.d.ts.map +1 -0
- package/dist/openapi/types.d.ts +198 -198
- package/dist/openapi/types.d.ts.map +1 -1
- package/package.json +53 -20
- package/dist/common/utils.js +0 -103
- package/dist/common/utils.js.map +0 -1
- package/dist/openapi/differ.js +0 -222
- package/dist/openapi/differ.js.map +0 -1
- package/dist/openapi/exporter/data-views.js +0 -47
- package/dist/openapi/exporter/data-views.js.map +0 -1
- package/dist/openapi/exporter/events.js +0 -39
- package/dist/openapi/exporter/events.js.map +0 -1
- package/dist/openapi/exporter/features.js +0 -46
- package/dist/openapi/exporter/features.js.map +0 -1
- package/dist/openapi/exporter/forms.js +0 -49
- package/dist/openapi/exporter/forms.js.map +0 -1
- package/dist/openapi/exporter/index.js +0 -8
- package/dist/openapi/exporter/operations.js +0 -143
- package/dist/openapi/exporter/operations.js.map +0 -1
- package/dist/openapi/exporter/presentations.js +0 -60
- package/dist/openapi/exporter/presentations.js.map +0 -1
- package/dist/openapi/exporter/registries.js +0 -29
- package/dist/openapi/exporter/registries.js.map +0 -1
- package/dist/openapi/exporter/workflows.js +0 -54
- package/dist/openapi/exporter/workflows.js.map +0 -1
- package/dist/openapi/exporter.js +0 -122
- package/dist/openapi/exporter.js.map +0 -1
- package/dist/openapi/importer/analyzer.js +0 -28
- package/dist/openapi/importer/analyzer.js.map +0 -1
- package/dist/openapi/importer/events.js +0 -40
- package/dist/openapi/importer/events.js.map +0 -1
- package/dist/openapi/importer/generator.js +0 -105
- package/dist/openapi/importer/generator.js.map +0 -1
- package/dist/openapi/importer/grouping.js +0 -72
- package/dist/openapi/importer/grouping.js.map +0 -1
- package/dist/openapi/importer/index.js +0 -175
- package/dist/openapi/importer/index.js.map +0 -1
- package/dist/openapi/importer/models.js +0 -22
- package/dist/openapi/importer/models.js.map +0 -1
- package/dist/openapi/importer/schemas.js +0 -60
- package/dist/openapi/importer/schemas.js.map +0 -1
- package/dist/openapi/parser/document.js +0 -95
- package/dist/openapi/parser/document.js.map +0 -1
- package/dist/openapi/parser/index.js +0 -5
- package/dist/openapi/parser/operation.js +0 -59
- package/dist/openapi/parser/operation.js.map +0 -1
- package/dist/openapi/parser/parameters.js +0 -37
- package/dist/openapi/parser/parameters.js.map +0 -1
- package/dist/openapi/parser/resolvers.js +0 -63
- package/dist/openapi/parser/resolvers.js.map +0 -1
- package/dist/openapi/parser/utils.js +0 -48
- package/dist/openapi/parser/utils.js.map +0 -1
- package/dist/openapi/parser.js +0 -6
- package/dist/openapi/schema-converter.js +0 -161
- package/dist/openapi/schema-converter.js.map +0 -1
- package/dist/openapi/schema-generators/index.js +0 -461
- package/dist/openapi/schema-generators/index.js.map +0 -1
package/dist/openapi/types.d.ts
CHANGED
|
@@ -1,275 +1,275 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* OpenAPI types and ContractSpec mapping types.
|
|
3
|
+
*/
|
|
4
|
+
import type { OpenAPIV3, OpenAPIV3_1 } from 'openapi-types';
|
|
5
|
+
import type { SpecSource, TransportHints } from '../common/types';
|
|
5
6
|
/**
|
|
6
7
|
* Supported OpenAPI versions.
|
|
7
8
|
*/
|
|
8
|
-
type OpenApiVersion = '3.0' | '3.1';
|
|
9
|
+
export type OpenApiVersion = '3.0' | '3.1';
|
|
9
10
|
/**
|
|
10
11
|
* OpenAPI document (union of supported versions).
|
|
11
12
|
*/
|
|
12
|
-
type OpenApiDocument = OpenAPIV3.Document | OpenAPIV3_1.Document;
|
|
13
|
+
export type OpenApiDocument = OpenAPIV3.Document | OpenAPIV3_1.Document;
|
|
13
14
|
/**
|
|
14
15
|
* OpenAPI operation object.
|
|
15
16
|
*/
|
|
16
|
-
type OpenApiOperation = OpenAPIV3.OperationObject | OpenAPIV3_1.OperationObject;
|
|
17
|
+
export type OpenApiOperation = OpenAPIV3.OperationObject | OpenAPIV3_1.OperationObject;
|
|
17
18
|
/**
|
|
18
19
|
* OpenAPI schema object.
|
|
19
20
|
*/
|
|
20
|
-
type OpenApiSchema = OpenAPIV3.SchemaObject | OpenAPIV3_1.SchemaObject | OpenAPIV3.ReferenceObject | OpenAPIV3_1.ReferenceObject;
|
|
21
|
+
export type OpenApiSchema = OpenAPIV3.SchemaObject | OpenAPIV3_1.SchemaObject | OpenAPIV3.ReferenceObject | OpenAPIV3_1.ReferenceObject;
|
|
21
22
|
/**
|
|
22
23
|
* OpenAPI parameter object.
|
|
23
24
|
*/
|
|
24
|
-
type OpenApiParameter = OpenAPIV3.ParameterObject | OpenAPIV3_1.ParameterObject | OpenAPIV3.ReferenceObject | OpenAPIV3_1.ReferenceObject;
|
|
25
|
+
export type OpenApiParameter = OpenAPIV3.ParameterObject | OpenAPIV3_1.ParameterObject | OpenAPIV3.ReferenceObject | OpenAPIV3_1.ReferenceObject;
|
|
25
26
|
/**
|
|
26
27
|
* HTTP methods supported by OpenAPI.
|
|
27
28
|
*/
|
|
28
|
-
type HttpMethod = 'get' | 'post' | 'put' | 'delete' | 'patch' | 'head' | 'options' | 'trace';
|
|
29
|
+
export type HttpMethod = 'get' | 'post' | 'put' | 'delete' | 'patch' | 'head' | 'options' | 'trace';
|
|
29
30
|
/**
|
|
30
31
|
* Parameter location in OpenAPI.
|
|
31
32
|
*/
|
|
32
|
-
type ParameterLocation = 'path' | 'query' | 'header' | 'cookie';
|
|
33
|
+
export type ParameterLocation = 'path' | 'query' | 'header' | 'cookie';
|
|
33
34
|
/**
|
|
34
35
|
* Server configuration for OpenAPI export.
|
|
35
36
|
*/
|
|
36
|
-
interface OpenApiServer {
|
|
37
|
-
|
|
38
|
-
description?: string;
|
|
39
|
-
variables?: Record<string, {
|
|
40
|
-
default: string;
|
|
41
|
-
enum?: string[];
|
|
37
|
+
export interface OpenApiServer {
|
|
38
|
+
url: string;
|
|
42
39
|
description?: string;
|
|
43
|
-
|
|
40
|
+
variables?: Record<string, {
|
|
41
|
+
default: string;
|
|
42
|
+
enum?: string[];
|
|
43
|
+
description?: string;
|
|
44
|
+
}>;
|
|
44
45
|
}
|
|
45
46
|
/**
|
|
46
47
|
* Options for exporting to OpenAPI.
|
|
47
48
|
*/
|
|
48
|
-
interface OpenApiExportOptions {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
49
|
+
export interface OpenApiExportOptions {
|
|
50
|
+
/** API title */
|
|
51
|
+
title?: string;
|
|
52
|
+
/** API version */
|
|
53
|
+
version?: string;
|
|
54
|
+
/** API description */
|
|
55
|
+
description?: string;
|
|
56
|
+
/** Server configurations */
|
|
57
|
+
servers?: OpenApiServer[];
|
|
58
|
+
/** Additional OpenAPI extensions */
|
|
59
|
+
extensions?: Record<string, unknown>;
|
|
59
60
|
}
|
|
60
61
|
/**
|
|
61
62
|
* Options for parsing OpenAPI documents.
|
|
62
63
|
*/
|
|
63
|
-
interface OpenApiParseOptions {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
export interface OpenApiParseOptions {
|
|
65
|
+
/** Base URL for resolving relative references */
|
|
66
|
+
baseUrl?: string;
|
|
67
|
+
/** Whether to resolve $ref references */
|
|
68
|
+
resolveRefs?: boolean;
|
|
69
|
+
/** Timeout for HTTP requests (ms) */
|
|
70
|
+
timeout?: number;
|
|
70
71
|
}
|
|
71
72
|
/**
|
|
72
73
|
* Parsed operation with resolved metadata.
|
|
73
74
|
*/
|
|
74
|
-
interface ParsedOperation {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
75
|
+
export interface ParsedOperation {
|
|
76
|
+
/** Operation ID (generated if not present) */
|
|
77
|
+
operationId: string;
|
|
78
|
+
/** HTTP method */
|
|
79
|
+
method: HttpMethod;
|
|
80
|
+
/** Path template */
|
|
81
|
+
path: string;
|
|
82
|
+
/** Operation summary */
|
|
83
|
+
summary?: string;
|
|
84
|
+
/** Operation description */
|
|
85
|
+
description?: string;
|
|
86
|
+
/** Operation tags */
|
|
87
|
+
tags: string[];
|
|
88
|
+
/** Path parameters */
|
|
89
|
+
pathParams: ParsedParameter[];
|
|
90
|
+
/** Query parameters */
|
|
91
|
+
queryParams: ParsedParameter[];
|
|
92
|
+
/** Header parameters */
|
|
93
|
+
headerParams: ParsedParameter[];
|
|
94
|
+
/** Cookie parameters */
|
|
95
|
+
cookieParams: ParsedParameter[];
|
|
96
|
+
/** Request body schema */
|
|
97
|
+
requestBody?: {
|
|
98
|
+
required: boolean;
|
|
99
|
+
schema: OpenApiSchema;
|
|
100
|
+
contentType: string;
|
|
101
|
+
};
|
|
102
|
+
/** Response schemas by status code */
|
|
103
|
+
responses: Record<string, {
|
|
104
|
+
description: string;
|
|
105
|
+
schema?: OpenApiSchema;
|
|
106
|
+
contentType?: string;
|
|
107
|
+
}>;
|
|
108
|
+
/** Whether the operation is deprecated */
|
|
109
|
+
deprecated: boolean;
|
|
110
|
+
/** Security requirements */
|
|
111
|
+
security?: Record<string, string[]>[];
|
|
112
|
+
/** ContractSpec extension data if present */
|
|
113
|
+
contractSpecMeta?: {
|
|
114
|
+
name: string;
|
|
115
|
+
version: string;
|
|
116
|
+
kind: 'command' | 'query';
|
|
117
|
+
};
|
|
117
118
|
}
|
|
118
119
|
/**
|
|
119
120
|
* Parsed parameter with resolved schema.
|
|
120
121
|
*/
|
|
121
|
-
interface ParsedParameter {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
122
|
+
export interface ParsedParameter {
|
|
123
|
+
/** Parameter name */
|
|
124
|
+
name: string;
|
|
125
|
+
/** Parameter location */
|
|
126
|
+
in: ParameterLocation;
|
|
127
|
+
/** Whether the parameter is required */
|
|
128
|
+
required: boolean;
|
|
129
|
+
/** Parameter description */
|
|
130
|
+
description?: string;
|
|
131
|
+
/** Parameter schema */
|
|
132
|
+
schema: OpenApiSchema;
|
|
133
|
+
/** Whether the parameter is deprecated */
|
|
134
|
+
deprecated: boolean;
|
|
134
135
|
}
|
|
135
136
|
/**
|
|
136
137
|
* Result of parsing an OpenAPI document.
|
|
137
138
|
*/
|
|
138
|
-
interface ParseResult {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
139
|
+
export interface ParseResult {
|
|
140
|
+
/** Original document */
|
|
141
|
+
document: OpenApiDocument;
|
|
142
|
+
/** Detected OpenAPI version */
|
|
143
|
+
version: OpenApiVersion;
|
|
144
|
+
/** API info */
|
|
145
|
+
info: {
|
|
146
|
+
title: string;
|
|
147
|
+
version: string;
|
|
148
|
+
description?: string;
|
|
149
|
+
};
|
|
150
|
+
/** Parsed operations */
|
|
151
|
+
operations: ParsedOperation[];
|
|
152
|
+
/** Component schemas (resolved) */
|
|
153
|
+
schemas: Record<string, OpenApiSchema>;
|
|
154
|
+
/** Servers */
|
|
155
|
+
servers: OpenApiServer[];
|
|
156
|
+
/** Parse warnings */
|
|
157
|
+
warnings: string[];
|
|
158
|
+
/** Parsed events (webhooks) */
|
|
159
|
+
events: ParsedEvent[];
|
|
159
160
|
}
|
|
160
161
|
/**
|
|
161
162
|
* Parsed event (webhook).
|
|
162
163
|
*/
|
|
163
|
-
interface ParsedEvent {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
164
|
+
export interface ParsedEvent {
|
|
165
|
+
/** Event name */
|
|
166
|
+
name: string;
|
|
167
|
+
/** Event description */
|
|
168
|
+
description?: string;
|
|
169
|
+
/** Event payload schema */
|
|
170
|
+
payload: OpenApiSchema;
|
|
170
171
|
}
|
|
171
172
|
/**
|
|
172
173
|
* OpenAPI-specific transport hints.
|
|
173
174
|
*/
|
|
174
|
-
interface OpenApiTransportHints extends TransportHints {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
175
|
+
export interface OpenApiTransportHints extends TransportHints {
|
|
176
|
+
rest: {
|
|
177
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
178
|
+
path: string;
|
|
179
|
+
params?: {
|
|
180
|
+
path?: string[];
|
|
181
|
+
query?: string[];
|
|
182
|
+
header?: string[];
|
|
183
|
+
cookie?: string[];
|
|
184
|
+
};
|
|
183
185
|
};
|
|
184
|
-
};
|
|
185
186
|
}
|
|
186
187
|
/**
|
|
187
188
|
* OpenAPI-specific source information.
|
|
188
189
|
*/
|
|
189
|
-
interface OpenApiSource extends SpecSource {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
190
|
+
export interface OpenApiSource extends SpecSource {
|
|
191
|
+
type: 'openapi';
|
|
192
|
+
/** OpenAPI version of source document */
|
|
193
|
+
openApiVersion: OpenApiVersion;
|
|
194
|
+
/** Original operationId from OpenAPI */
|
|
195
|
+
operationId: string;
|
|
195
196
|
}
|
|
196
197
|
/**
|
|
197
198
|
* ContractSpec-compatible OpenAPI document structure.
|
|
198
199
|
* Used for export to maintain compatibility with existing code.
|
|
199
200
|
*/
|
|
200
|
-
interface ContractSpecOpenApiDocument {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
201
|
+
export interface ContractSpecOpenApiDocument {
|
|
202
|
+
openapi: '3.1.0';
|
|
203
|
+
info: {
|
|
204
|
+
title: string;
|
|
205
|
+
version: string;
|
|
206
|
+
description?: string;
|
|
207
|
+
};
|
|
208
|
+
servers?: OpenApiServer[];
|
|
209
|
+
paths: Record<string, Record<string, unknown>>;
|
|
210
|
+
components: {
|
|
211
|
+
schemas: Record<string, Record<string, unknown>>;
|
|
212
|
+
};
|
|
213
|
+
/** ContractSpec extensions for features */
|
|
214
|
+
'x-contractspec-features'?: unknown[];
|
|
215
|
+
/** ContractSpec extensions for events */
|
|
216
|
+
'x-contractspec-events'?: unknown[];
|
|
217
|
+
/** ContractSpec extensions for presentations */
|
|
218
|
+
'x-contractspec-presentations'?: unknown[];
|
|
219
|
+
/** ContractSpec extensions for forms */
|
|
220
|
+
'x-contractspec-forms'?: unknown[];
|
|
221
|
+
/** ContractSpec extensions for data views */
|
|
222
|
+
'x-contractspec-dataviews'?: unknown[];
|
|
223
|
+
/** ContractSpec extensions for workflows */
|
|
224
|
+
'x-contractspec-workflows'?: unknown[];
|
|
224
225
|
}
|
|
225
226
|
/**
|
|
226
227
|
* Unified export options for all ContractSpec surfaces.
|
|
227
228
|
*/
|
|
228
|
-
interface ContractSpecExportOptions extends OpenApiExportOptions {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
229
|
+
export interface ContractSpecExportOptions extends OpenApiExportOptions {
|
|
230
|
+
/** Include operations in export (default: true) */
|
|
231
|
+
operations?: boolean;
|
|
232
|
+
/** Include events in export (default: true) */
|
|
233
|
+
events?: boolean;
|
|
234
|
+
/** Include features in export (default: true) */
|
|
235
|
+
features?: boolean;
|
|
236
|
+
/** Include presentations (V1 and V2) in export (default: true) */
|
|
237
|
+
presentations?: boolean;
|
|
238
|
+
/** Include forms in export (default: true) */
|
|
239
|
+
forms?: boolean;
|
|
240
|
+
/** Include data views in export (default: true) */
|
|
241
|
+
dataViews?: boolean;
|
|
242
|
+
/** Include workflows in export (default: true) */
|
|
243
|
+
workflows?: boolean;
|
|
244
|
+
/** Generate TypeScript registry code (default: true) */
|
|
245
|
+
generateRegistries?: boolean;
|
|
245
246
|
}
|
|
246
247
|
/**
|
|
247
248
|
* Generated registry code for a specific surface.
|
|
248
249
|
*/
|
|
249
|
-
interface GeneratedRegistryCode {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
250
|
+
export interface GeneratedRegistryCode {
|
|
251
|
+
/** The generated TypeScript code */
|
|
252
|
+
code: string;
|
|
253
|
+
/** Suggested filename for the registry */
|
|
254
|
+
fileName: string;
|
|
254
255
|
}
|
|
255
256
|
/**
|
|
256
257
|
* Result of unified ContractSpec export.
|
|
257
258
|
*/
|
|
258
|
-
interface ContractSpecExportResult {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
259
|
+
export interface ContractSpecExportResult {
|
|
260
|
+
/** OpenAPI document with ContractSpec extensions */
|
|
261
|
+
openApi: ContractSpecOpenApiDocument;
|
|
262
|
+
/** Generated TypeScript code for registries */
|
|
263
|
+
registries?: {
|
|
264
|
+
operations?: GeneratedRegistryCode;
|
|
265
|
+
events?: GeneratedRegistryCode;
|
|
266
|
+
features?: GeneratedRegistryCode;
|
|
267
|
+
presentations?: GeneratedRegistryCode;
|
|
268
|
+
forms?: GeneratedRegistryCode;
|
|
269
|
+
dataViews?: GeneratedRegistryCode;
|
|
270
|
+
workflows?: GeneratedRegistryCode;
|
|
271
|
+
/** Index file that re-exports all registries */
|
|
272
|
+
index?: GeneratedRegistryCode;
|
|
273
|
+
};
|
|
272
274
|
}
|
|
273
|
-
//#endregion
|
|
274
|
-
export { ContractSpecExportOptions, ContractSpecExportResult, ContractSpecOpenApiDocument, GeneratedRegistryCode, HttpMethod, OpenApiDocument, OpenApiExportOptions, OpenApiOperation, OpenApiParameter, OpenApiParseOptions, OpenApiSchema, OpenApiServer, OpenApiSource, OpenApiTransportHints, OpenApiVersion, ParameterLocation, ParseResult, ParsedOperation, ParsedParameter };
|
|
275
275
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/openapi/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAClE;;GAEG;AACH,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AgD;QAChD,KAAK,CAAC,EAAE,qBAAqB,CAAC;KAC/B,CAAC;CACH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/lib.contracts-transformers",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.58.0",
|
|
4
4
|
"description": "Contract format transformations: import/export between ContractSpec and external formats (OpenAPI, AsyncAPI, etc.)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contractspec",
|
|
@@ -14,29 +14,30 @@
|
|
|
14
14
|
"scripts": {
|
|
15
15
|
"publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
|
|
16
16
|
"publish:pkg:canary": "bun publish:pkg --tag canary",
|
|
17
|
-
"build": "bun build:
|
|
18
|
-
"build:bundle": "
|
|
19
|
-
"build:types": "
|
|
20
|
-
"dev": "bun
|
|
17
|
+
"build": "bun run prebuild && bun run build:bundle && bun run build:types",
|
|
18
|
+
"build:bundle": "contractspec-bun-build transpile",
|
|
19
|
+
"build:types": "contractspec-bun-build types",
|
|
20
|
+
"dev": "contractspec-bun-build dev",
|
|
21
21
|
"clean": "rimraf dist .turbo",
|
|
22
22
|
"lint": "bun lint:fix",
|
|
23
23
|
"lint:fix": "eslint src --fix",
|
|
24
24
|
"lint:check": "eslint src",
|
|
25
|
-
"test": "bun test"
|
|
25
|
+
"test": "bun test",
|
|
26
|
+
"prebuild": "contractspec-bun-build prebuild",
|
|
27
|
+
"typecheck": "tsc --noEmit"
|
|
26
28
|
},
|
|
27
29
|
"dependencies": {
|
|
28
|
-
"@contractspec/lib.contracts": "1.
|
|
29
|
-
"@contractspec/lib.schema": "1.
|
|
30
|
+
"@contractspec/lib.contracts": "1.58.0",
|
|
31
|
+
"@contractspec/lib.schema": "1.58.0",
|
|
30
32
|
"compare-versions": "^6.1.1",
|
|
31
33
|
"openapi-types": "^12.1.3",
|
|
32
34
|
"yaml": "^2.7.1",
|
|
33
35
|
"zod": "^4.3.5"
|
|
34
36
|
},
|
|
35
37
|
"devDependencies": {
|
|
36
|
-
"@contractspec/tool.
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"typescript": "^5.9.3"
|
|
38
|
+
"@contractspec/tool.typescript": "1.58.0",
|
|
39
|
+
"typescript": "^5.9.3",
|
|
40
|
+
"@contractspec/tool.bun": "1.57.0"
|
|
40
41
|
},
|
|
41
42
|
"types": "./dist/index.d.ts",
|
|
42
43
|
"files": [
|
|
@@ -44,18 +45,50 @@
|
|
|
44
45
|
"README.md"
|
|
45
46
|
],
|
|
46
47
|
"exports": {
|
|
47
|
-
".": "./
|
|
48
|
-
"./common": "./
|
|
49
|
-
"./
|
|
50
|
-
"
|
|
48
|
+
".": "./src/index.ts",
|
|
49
|
+
"./common": "./src/common/index.ts",
|
|
50
|
+
"./common/index": "./src/common/index.ts",
|
|
51
|
+
"./openapi": "./src/openapi/index.ts",
|
|
52
|
+
"./openapi/index": "./src/openapi/index.ts"
|
|
51
53
|
},
|
|
52
54
|
"publishConfig": {
|
|
53
55
|
"access": "public",
|
|
54
56
|
"exports": {
|
|
55
|
-
".":
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
".": {
|
|
58
|
+
"types": "./dist/index.d.ts",
|
|
59
|
+
"bun": "./dist/index.js",
|
|
60
|
+
"node": "./dist/node/index.mjs",
|
|
61
|
+
"browser": "./dist/browser/index.js",
|
|
62
|
+
"default": "./dist/index.js"
|
|
63
|
+
},
|
|
64
|
+
"./common": {
|
|
65
|
+
"types": "./dist/common/index.d.ts",
|
|
66
|
+
"bun": "./dist/common/index.js",
|
|
67
|
+
"node": "./dist/node/common/index.mjs",
|
|
68
|
+
"browser": "./dist/browser/common/index.js",
|
|
69
|
+
"default": "./dist/common/index.js"
|
|
70
|
+
},
|
|
71
|
+
"./common/index": {
|
|
72
|
+
"types": "./dist/common/index.d.ts",
|
|
73
|
+
"bun": "./dist/common/index.js",
|
|
74
|
+
"node": "./dist/node/common/index.mjs",
|
|
75
|
+
"browser": "./dist/browser/common/index.js",
|
|
76
|
+
"default": "./dist/common/index.js"
|
|
77
|
+
},
|
|
78
|
+
"./openapi": {
|
|
79
|
+
"types": "./dist/openapi/index.d.ts",
|
|
80
|
+
"bun": "./dist/openapi/index.js",
|
|
81
|
+
"node": "./dist/node/openapi/index.mjs",
|
|
82
|
+
"browser": "./dist/browser/openapi/index.js",
|
|
83
|
+
"default": "./dist/openapi/index.js"
|
|
84
|
+
},
|
|
85
|
+
"./openapi/index": {
|
|
86
|
+
"types": "./dist/openapi/index.d.ts",
|
|
87
|
+
"bun": "./dist/openapi/index.js",
|
|
88
|
+
"node": "./dist/node/openapi/index.mjs",
|
|
89
|
+
"browser": "./dist/browser/openapi/index.js",
|
|
90
|
+
"default": "./dist/openapi/index.js"
|
|
91
|
+
}
|
|
59
92
|
},
|
|
60
93
|
"registry": "https://registry.npmjs.org/"
|
|
61
94
|
},
|