@lssm/lib.contracts-transformers 0.0.0-canary-20251217083314 → 1.41.1
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/common/index.js +1 -3
- package/dist/common/utils.js +1 -102
- package/dist/index.js +1 -9
- package/dist/openapi/differ.js +2 -214
- package/dist/openapi/exporter.js +1 -150
- package/dist/openapi/importer.js +2 -264
- package/dist/openapi/index.js +1 -7
- package/dist/openapi/parser.js +1 -231
- package/dist/openapi/schema-converter.js +4 -201
- package/package.json +8 -8
- package/dist/common/index.d.ts +0 -3
- package/dist/common/types.d.ts +0 -152
- package/dist/common/utils.d.ts +0 -51
- package/dist/index.d.ts +0 -9
- package/dist/openapi/differ.d.ts +0 -41
- package/dist/openapi/exporter.d.ts +0 -27
- package/dist/openapi/importer.d.ts +0 -15
- package/dist/openapi/index.d.ts +0 -7
- package/dist/openapi/parser.d.ts +0 -31
- package/dist/openapi/schema-converter.d.ts +0 -69
- package/dist/openapi/types.d.ts +0 -221
package/dist/openapi/types.d.ts
DELETED
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import { SpecSource, TransportHints } from "../common/types.js";
|
|
2
|
-
import { OpenAPIV3, OpenAPIV3_1 } from "openapi-types";
|
|
3
|
-
|
|
4
|
-
//#region src/openapi/types.d.ts
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Supported OpenAPI versions.
|
|
8
|
-
*/
|
|
9
|
-
type OpenApiVersion = '3.0' | '3.1';
|
|
10
|
-
/**
|
|
11
|
-
* OpenAPI document (union of supported versions).
|
|
12
|
-
*/
|
|
13
|
-
type OpenApiDocument = OpenAPIV3.Document | OpenAPIV3_1.Document;
|
|
14
|
-
/**
|
|
15
|
-
* OpenAPI operation object.
|
|
16
|
-
*/
|
|
17
|
-
type OpenApiOperation = OpenAPIV3.OperationObject | OpenAPIV3_1.OperationObject;
|
|
18
|
-
/**
|
|
19
|
-
* OpenAPI schema object.
|
|
20
|
-
*/
|
|
21
|
-
type OpenApiSchema = OpenAPIV3.SchemaObject | OpenAPIV3_1.SchemaObject | OpenAPIV3.ReferenceObject | OpenAPIV3_1.ReferenceObject;
|
|
22
|
-
/**
|
|
23
|
-
* OpenAPI parameter object.
|
|
24
|
-
*/
|
|
25
|
-
type OpenApiParameter = OpenAPIV3.ParameterObject | OpenAPIV3_1.ParameterObject | OpenAPIV3.ReferenceObject | OpenAPIV3_1.ReferenceObject;
|
|
26
|
-
/**
|
|
27
|
-
* HTTP methods supported by OpenAPI.
|
|
28
|
-
*/
|
|
29
|
-
type HttpMethod = 'get' | 'post' | 'put' | 'delete' | 'patch' | 'head' | 'options' | 'trace';
|
|
30
|
-
/**
|
|
31
|
-
* Parameter location in OpenAPI.
|
|
32
|
-
*/
|
|
33
|
-
type ParameterLocation = 'path' | 'query' | 'header' | 'cookie';
|
|
34
|
-
/**
|
|
35
|
-
* Server configuration for OpenAPI export.
|
|
36
|
-
*/
|
|
37
|
-
interface OpenApiServer {
|
|
38
|
-
url: string;
|
|
39
|
-
description?: string;
|
|
40
|
-
variables?: Record<string, {
|
|
41
|
-
default: string;
|
|
42
|
-
enum?: string[];
|
|
43
|
-
description?: string;
|
|
44
|
-
}>;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Options for exporting to OpenAPI.
|
|
48
|
-
*/
|
|
49
|
-
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>;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Options for importing from OpenAPI.
|
|
63
|
-
*/
|
|
64
|
-
interface OpenApiImportOptions {
|
|
65
|
-
/** Prefix for generated spec names */
|
|
66
|
-
prefix?: string;
|
|
67
|
-
/** Only import operations with these tags */
|
|
68
|
-
tags?: string[];
|
|
69
|
-
/** Exclude operations with these operationIds */
|
|
70
|
-
exclude?: string[];
|
|
71
|
-
/** Include operations with these operationIds (overrides exclude) */
|
|
72
|
-
include?: string[];
|
|
73
|
-
/** Default stability for imported specs */
|
|
74
|
-
defaultStability?: 'experimental' | 'beta' | 'stable' | 'deprecated';
|
|
75
|
-
/** Default owners for imported specs */
|
|
76
|
-
defaultOwners?: string[];
|
|
77
|
-
/** Default auth level for imported specs */
|
|
78
|
-
defaultAuth?: 'anonymous' | 'user' | 'admin';
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Options for parsing OpenAPI documents.
|
|
82
|
-
*/
|
|
83
|
-
interface OpenApiParseOptions {
|
|
84
|
-
/** Base URL for resolving relative references */
|
|
85
|
-
baseUrl?: string;
|
|
86
|
-
/** Whether to resolve $ref references */
|
|
87
|
-
resolveRefs?: boolean;
|
|
88
|
-
/** Timeout for HTTP requests (ms) */
|
|
89
|
-
timeout?: number;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Parsed operation with resolved metadata.
|
|
93
|
-
*/
|
|
94
|
-
interface ParsedOperation {
|
|
95
|
-
/** Operation ID (generated if not present) */
|
|
96
|
-
operationId: string;
|
|
97
|
-
/** HTTP method */
|
|
98
|
-
method: HttpMethod;
|
|
99
|
-
/** Path template */
|
|
100
|
-
path: string;
|
|
101
|
-
/** Operation summary */
|
|
102
|
-
summary?: string;
|
|
103
|
-
/** Operation description */
|
|
104
|
-
description?: string;
|
|
105
|
-
/** Operation tags */
|
|
106
|
-
tags: string[];
|
|
107
|
-
/** Path parameters */
|
|
108
|
-
pathParams: ParsedParameter[];
|
|
109
|
-
/** Query parameters */
|
|
110
|
-
queryParams: ParsedParameter[];
|
|
111
|
-
/** Header parameters */
|
|
112
|
-
headerParams: ParsedParameter[];
|
|
113
|
-
/** Cookie parameters */
|
|
114
|
-
cookieParams: ParsedParameter[];
|
|
115
|
-
/** Request body schema */
|
|
116
|
-
requestBody?: {
|
|
117
|
-
required: boolean;
|
|
118
|
-
schema: OpenApiSchema;
|
|
119
|
-
contentType: string;
|
|
120
|
-
};
|
|
121
|
-
/** Response schemas by status code */
|
|
122
|
-
responses: Record<string, {
|
|
123
|
-
description: string;
|
|
124
|
-
schema?: OpenApiSchema;
|
|
125
|
-
contentType?: string;
|
|
126
|
-
}>;
|
|
127
|
-
/** Whether the operation is deprecated */
|
|
128
|
-
deprecated: boolean;
|
|
129
|
-
/** Security requirements */
|
|
130
|
-
security?: Array<Record<string, string[]>>;
|
|
131
|
-
/** ContractSpec extension data if present */
|
|
132
|
-
contractSpecMeta?: {
|
|
133
|
-
name: string;
|
|
134
|
-
version: number;
|
|
135
|
-
kind: 'command' | 'query';
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Parsed parameter with resolved schema.
|
|
140
|
-
*/
|
|
141
|
-
interface ParsedParameter {
|
|
142
|
-
/** Parameter name */
|
|
143
|
-
name: string;
|
|
144
|
-
/** Parameter location */
|
|
145
|
-
in: ParameterLocation;
|
|
146
|
-
/** Whether the parameter is required */
|
|
147
|
-
required: boolean;
|
|
148
|
-
/** Parameter description */
|
|
149
|
-
description?: string;
|
|
150
|
-
/** Parameter schema */
|
|
151
|
-
schema: OpenApiSchema;
|
|
152
|
-
/** Whether the parameter is deprecated */
|
|
153
|
-
deprecated: boolean;
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Result of parsing an OpenAPI document.
|
|
157
|
-
*/
|
|
158
|
-
interface ParseResult {
|
|
159
|
-
/** Original document */
|
|
160
|
-
document: OpenApiDocument;
|
|
161
|
-
/** Detected OpenAPI version */
|
|
162
|
-
version: OpenApiVersion;
|
|
163
|
-
/** API info */
|
|
164
|
-
info: {
|
|
165
|
-
title: string;
|
|
166
|
-
version: string;
|
|
167
|
-
description?: string;
|
|
168
|
-
};
|
|
169
|
-
/** Parsed operations */
|
|
170
|
-
operations: ParsedOperation[];
|
|
171
|
-
/** Component schemas (resolved) */
|
|
172
|
-
schemas: Record<string, OpenApiSchema>;
|
|
173
|
-
/** Servers */
|
|
174
|
-
servers: OpenApiServer[];
|
|
175
|
-
/** Parse warnings */
|
|
176
|
-
warnings: string[];
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* OpenAPI-specific transport hints.
|
|
180
|
-
*/
|
|
181
|
-
interface OpenApiTransportHints extends TransportHints {
|
|
182
|
-
rest: {
|
|
183
|
-
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
184
|
-
path: string;
|
|
185
|
-
params?: {
|
|
186
|
-
path?: string[];
|
|
187
|
-
query?: string[];
|
|
188
|
-
header?: string[];
|
|
189
|
-
cookie?: string[];
|
|
190
|
-
};
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* OpenAPI-specific source information.
|
|
195
|
-
*/
|
|
196
|
-
interface OpenApiSource extends SpecSource {
|
|
197
|
-
type: 'openapi';
|
|
198
|
-
/** OpenAPI version of source document */
|
|
199
|
-
openApiVersion: OpenApiVersion;
|
|
200
|
-
/** Original operationId from OpenAPI */
|
|
201
|
-
operationId: string;
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* ContractSpec-compatible OpenAPI document structure.
|
|
205
|
-
* Used for export to maintain compatibility with existing code.
|
|
206
|
-
*/
|
|
207
|
-
interface ContractSpecOpenApiDocument {
|
|
208
|
-
openapi: '3.1.0';
|
|
209
|
-
info: {
|
|
210
|
-
title: string;
|
|
211
|
-
version: string;
|
|
212
|
-
description?: string;
|
|
213
|
-
};
|
|
214
|
-
servers?: OpenApiServer[];
|
|
215
|
-
paths: Record<string, Record<string, unknown>>;
|
|
216
|
-
components: {
|
|
217
|
-
schemas: Record<string, Record<string, unknown>>;
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
//#endregion
|
|
221
|
-
export { ContractSpecOpenApiDocument, HttpMethod, OpenApiDocument, OpenApiExportOptions, OpenApiImportOptions, OpenApiOperation, OpenApiParameter, OpenApiParseOptions, OpenApiSchema, OpenApiServer, OpenApiSource, OpenApiTransportHints, OpenApiVersion, ParameterLocation, ParseResult, ParsedOperation, ParsedParameter };
|