@skmtc/core 0.0.809 → 0.0.811
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/esm/context/types.d.ts +0 -8
- package/esm/context/types.d.ts.map +1 -1
- package/esm/dsl/model/toModelBase.d.ts +24 -2
- package/esm/dsl/model/toModelBase.d.ts.map +1 -1
- package/esm/dsl/model/types.d.ts +2 -2
- package/esm/dsl/operation/toOperationBase.d.ts +26 -3
- package/esm/dsl/operation/toOperationBase.d.ts.map +1 -1
- package/esm/dsl/operation/types.d.ts +2 -2
- package/esm/oas/header/Header.d.ts +8 -185
- package/esm/oas/header/Header.d.ts.map +1 -1
- package/esm/oas/header/Header.js +57 -220
- package/esm/typescript/List.d.ts +2 -2
- package/esm/typescript/List.d.ts.map +1 -1
- package/esm/typescript/List.js +4 -4
- package/esm/typescript/toPathTemplate.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/context/types.d.ts +0 -8
- package/script/context/types.d.ts.map +1 -1
- package/script/dsl/model/toModelBase.d.ts +24 -2
- package/script/dsl/model/toModelBase.d.ts.map +1 -1
- package/script/dsl/model/types.d.ts +2 -2
- package/script/dsl/operation/toOperationBase.d.ts +26 -3
- package/script/dsl/operation/toOperationBase.d.ts.map +1 -1
- package/script/dsl/operation/types.d.ts +2 -2
- package/script/oas/header/Header.d.ts +8 -185
- package/script/oas/header/Header.d.ts.map +1 -1
- package/script/oas/header/Header.js +57 -220
- package/script/typescript/List.d.ts +2 -2
- package/script/typescript/List.d.ts.map +1 -1
- package/script/typescript/List.js +4 -4
- package/script/typescript/toPathTemplate.d.ts.map +1 -1
|
@@ -34,15 +34,6 @@ export type HeaderFields = {
|
|
|
34
34
|
* This class provides comprehensive support for header definitions with typed
|
|
35
35
|
* values, validation schemas, examples, and documentation.
|
|
36
36
|
*
|
|
37
|
-
* ## Key Features
|
|
38
|
-
*
|
|
39
|
-
* - **Schema Validation**: Typed header values through schema definitions
|
|
40
|
-
* - **Examples**: Multiple example values for documentation and testing
|
|
41
|
-
* - **Content Types**: Support for complex header values with media types
|
|
42
|
-
* - **Deprecation Support**: Mark headers as deprecated with proper warnings
|
|
43
|
-
* - **Required/Optional**: Control whether headers are mandatory
|
|
44
|
-
* - **Documentation**: Rich description support for API documentation
|
|
45
|
-
*
|
|
46
37
|
* @example Basic authentication header
|
|
47
38
|
* ```typescript
|
|
48
39
|
* import { OasHeader, OasString } from '@skmtc/core';
|
|
@@ -62,192 +53,24 @@ export type HeaderFields = {
|
|
|
62
53
|
* }
|
|
63
54
|
* });
|
|
64
55
|
* ```
|
|
65
|
-
*
|
|
66
|
-
* @example Pagination headers
|
|
67
|
-
* ```typescript
|
|
68
|
-
* const totalCountHeader = new OasHeader({
|
|
69
|
-
* description: 'Total number of items available',
|
|
70
|
-
* required: false,
|
|
71
|
-
* schema: new OasInteger({
|
|
72
|
-
* minimum: 0,
|
|
73
|
-
* description: 'Non-negative integer count'
|
|
74
|
-
* }),
|
|
75
|
-
* examples: {
|
|
76
|
-
* empty: new OasExample({ value: 0, description: 'No items' }),
|
|
77
|
-
* normal: new OasExample({ value: 150, description: 'Normal case' }),
|
|
78
|
-
* large: new OasExample({ value: 10000, description: 'Large dataset' })
|
|
79
|
-
* }
|
|
80
|
-
* });
|
|
81
|
-
*
|
|
82
|
-
* const linkHeader = new OasHeader({
|
|
83
|
-
* description: 'Pagination links (RFC 5988)',
|
|
84
|
-
* required: false,
|
|
85
|
-
* schema: new OasString({
|
|
86
|
-
* description: 'Comma-separated list of link relations'
|
|
87
|
-
* }),
|
|
88
|
-
* examples: {
|
|
89
|
-
* withNext: new OasExample({
|
|
90
|
-
* value: '</api/users?page=2>; rel="next", </api/users?page=10>; rel="last"'
|
|
91
|
-
* }),
|
|
92
|
-
* lastPage: new OasExample({
|
|
93
|
-
* value: '</api/users?page=9>; rel="prev", </api/users?page=1>; rel="first"'
|
|
94
|
-
* })
|
|
95
|
-
* }
|
|
96
|
-
* });
|
|
97
|
-
* ```
|
|
98
|
-
*
|
|
99
|
-
* @example Content type and encoding headers
|
|
100
|
-
* ```typescript
|
|
101
|
-
* const contentTypeHeader = new OasHeader({
|
|
102
|
-
* description: 'MIME type of the response content',
|
|
103
|
-
* required: true,
|
|
104
|
-
* schema: new OasString({
|
|
105
|
-
* enum: [
|
|
106
|
-
* 'application/json',
|
|
107
|
-
* 'application/xml',
|
|
108
|
-
* 'text/csv',
|
|
109
|
-
* 'application/pdf',
|
|
110
|
-
* 'application/octet-stream'
|
|
111
|
-
* ]
|
|
112
|
-
* }),
|
|
113
|
-
* examples: {
|
|
114
|
-
* json: new OasExample({ value: 'application/json' }),
|
|
115
|
-
* xml: new OasExample({ value: 'application/xml' }),
|
|
116
|
-
* csv: new OasExample({ value: 'text/csv' })
|
|
117
|
-
* }
|
|
118
|
-
* });
|
|
119
|
-
*
|
|
120
|
-
* const contentLengthHeader = new OasHeader({
|
|
121
|
-
* description: 'Size of the response body in bytes',
|
|
122
|
-
* required: false,
|
|
123
|
-
* schema: new OasInteger({
|
|
124
|
-
* minimum: 0,
|
|
125
|
-
* description: 'Content size in bytes'
|
|
126
|
-
* })
|
|
127
|
-
* });
|
|
128
|
-
* ```
|
|
129
|
-
*
|
|
130
|
-
* @example Rate limiting headers
|
|
131
|
-
* ```typescript
|
|
132
|
-
* const rateLimitHeader = new OasHeader({
|
|
133
|
-
* description: 'Number of requests remaining in the current window',
|
|
134
|
-
* required: false,
|
|
135
|
-
* schema: new OasInteger({
|
|
136
|
-
* minimum: 0,
|
|
137
|
-
* description: 'Remaining request count'
|
|
138
|
-
* }),
|
|
139
|
-
* examples: {
|
|
140
|
-
* available: new OasExample({ value: 95, description: '95 requests remaining' }),
|
|
141
|
-
* depleted: new OasExample({ value: 0, description: 'Rate limit reached' })
|
|
142
|
-
* }
|
|
143
|
-
* });
|
|
144
|
-
*
|
|
145
|
-
* const rateLimitResetHeader = new OasHeader({
|
|
146
|
-
* description: 'Unix timestamp when the rate limit window resets',
|
|
147
|
-
* required: false,
|
|
148
|
-
* schema: new OasInteger({
|
|
149
|
-
* minimum: 0,
|
|
150
|
-
* description: 'Unix timestamp in seconds'
|
|
151
|
-
* }),
|
|
152
|
-
* examples: {
|
|
153
|
-
* reset: new OasExample({
|
|
154
|
-
* value: 1634567890,
|
|
155
|
-
* description: 'Reset at 2021-10-18 12:31:30 UTC'
|
|
156
|
-
* })
|
|
157
|
-
* }
|
|
158
|
-
* });
|
|
159
|
-
* ```
|
|
160
|
-
*
|
|
161
|
-
* @example Custom application headers
|
|
162
|
-
* ```typescript
|
|
163
|
-
* const requestIdHeader = new OasHeader({
|
|
164
|
-
* description: 'Unique identifier for request tracing',
|
|
165
|
-
* required: false,
|
|
166
|
-
* schema: new OasString({
|
|
167
|
-
* format: 'uuid',
|
|
168
|
-
* description: 'UUID v4 request identifier'
|
|
169
|
-
* }),
|
|
170
|
-
* examples: {
|
|
171
|
-
* uuid: new OasExample({
|
|
172
|
-
* value: '123e4567-e89b-12d3-a456-426614174000',
|
|
173
|
-
* description: 'Request tracking ID'
|
|
174
|
-
* })
|
|
175
|
-
* }
|
|
176
|
-
* });
|
|
177
|
-
*
|
|
178
|
-
* const serverTimingHeader = new OasHeader({
|
|
179
|
-
* description: 'Server-side performance metrics',
|
|
180
|
-
* required: false,
|
|
181
|
-
* schema: new OasString({
|
|
182
|
-
* description: 'Server-Timing header format (RFC 8760)'
|
|
183
|
-
* }),
|
|
184
|
-
* examples: {
|
|
185
|
-
* timing: new OasExample({
|
|
186
|
-
* value: 'db;dur=53, app;dur=47.2',
|
|
187
|
-
* description: 'Database took 53ms, app logic 47.2ms'
|
|
188
|
-
* })
|
|
189
|
-
* }
|
|
190
|
-
* });
|
|
191
|
-
* ```
|
|
192
|
-
*
|
|
193
|
-
* @example Deprecated header
|
|
194
|
-
* ```typescript
|
|
195
|
-
* const deprecatedHeader = new OasHeader({
|
|
196
|
-
* description: 'Legacy API version header (deprecated)',
|
|
197
|
-
* required: false,
|
|
198
|
-
* deprecated: true,
|
|
199
|
-
* schema: new OasString({
|
|
200
|
-
* enum: ['v1', 'v2'],
|
|
201
|
-
* description: 'Use Accept or Content-Type header instead'
|
|
202
|
-
* }),
|
|
203
|
-
* examples: {
|
|
204
|
-
* legacy: new OasExample({
|
|
205
|
-
* value: 'v1',
|
|
206
|
-
* description: 'Legacy version (use Accept header instead)'
|
|
207
|
-
* })
|
|
208
|
-
* }
|
|
209
|
-
* });
|
|
210
|
-
* ```
|
|
211
|
-
*
|
|
212
|
-
* @example Using in response definitions
|
|
213
|
-
* ```typescript
|
|
214
|
-
* const successResponse = new OasResponse({
|
|
215
|
-
* description: 'Paginated user list',
|
|
216
|
-
* headers: {
|
|
217
|
-
* 'X-Total-Count': totalCountHeader,
|
|
218
|
-
* 'Link': linkHeader,
|
|
219
|
-
* 'X-Rate-Limit-Remaining': rateLimitHeader,
|
|
220
|
-
* 'X-Rate-Limit-Reset': rateLimitResetHeader,
|
|
221
|
-
* 'X-Request-ID': requestIdHeader
|
|
222
|
-
* },
|
|
223
|
-
* content: {
|
|
224
|
-
* 'application/json': new OasMediaType({
|
|
225
|
-
* schema: new OasArray({
|
|
226
|
-
* items: new OasRef({ $ref: '#/components/schemas/User' })
|
|
227
|
-
* })
|
|
228
|
-
* })
|
|
229
|
-
* }
|
|
230
|
-
* });
|
|
231
|
-
* ```
|
|
232
56
|
*/
|
|
233
57
|
export declare class OasHeader {
|
|
234
|
-
#private;
|
|
235
58
|
oasType: 'header';
|
|
236
|
-
constructor(fields: HeaderFields);
|
|
237
59
|
/** Brief description of header */
|
|
238
|
-
|
|
60
|
+
description: string | undefined;
|
|
239
61
|
/** Indicates if header is mandatory. Default value is `false` */
|
|
240
|
-
|
|
62
|
+
required: boolean | undefined;
|
|
241
63
|
/** Indicates if header is deprecated and should no longer be used. Default value is false */
|
|
242
|
-
|
|
64
|
+
deprecated: boolean | undefined;
|
|
243
65
|
/** Schema for the header */
|
|
244
|
-
|
|
66
|
+
schema: OasSchema | OasRef<'schema'> | undefined;
|
|
245
67
|
/** Examples of the header */
|
|
246
|
-
|
|
68
|
+
examples: Record<string, OasExample | OasRef<'example'>> | undefined;
|
|
247
69
|
/** Content of the header */
|
|
248
|
-
|
|
70
|
+
content: Record<string, OasMediaType> | undefined;
|
|
249
71
|
/** Specification Extension fields */
|
|
250
|
-
|
|
72
|
+
extensionFields: Record<string, unknown> | undefined;
|
|
73
|
+
constructor(fields: HeaderFields);
|
|
251
74
|
/** Returns true if object is a reference */
|
|
252
75
|
isRef(): this is OasRef<'header'>;
|
|
253
76
|
/** Returns itself */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/oas/header/Header.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,wCAAwC;IACxC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,qCAAqC;IACrC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,uCAAuC;IACvC,UAAU,EAAE,OAAO,GAAG,SAAS,CAAA;IAC/B,6CAA6C;IAC7C,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAA;IAChD,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,SAAS,CAAA;IACpE,oDAAoD;IACpD,O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;;GA8BG;AACH,qBAAa,SAAS;IACpB,OAAO,EAAE,QAAQ,CAAW;IAC5B,kCAAkC;IAClC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,iEAAiE;IACjE,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,6FAA6F;IAC7F,UAAU,EAAE,OAAO,GAAG,SAAS,CAAA;IAC/B,4BAA4B;IAC5B,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAA;IAChD,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,SAAS,CAAA;IACpE,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,SAAS,CAAA;IACjD,qCAAqC;IACrC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;gBAExC,MAAM,EAAE,YAAY;IAUhC,4CAA4C;IAC5C,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC;IAIjC,qBAAqB;IACrB,OAAO,IAAI,SAAS;IAIpB,WAAW,IAAI,SAAS;IAIxB;;;;OAIG;IACH,QAAQ,CAAC,SAAS,GAAE,MAA2B,GAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;IAc9E,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,SAAS,CAAC,YAAY;CASnE"}
|
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
-
};
|
|
8
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
-
};
|
|
13
|
-
var _OasHeader_fields;
|
|
14
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
3
|
exports.OasHeader = void 0;
|
|
16
4
|
/**
|
|
@@ -24,15 +12,6 @@ exports.OasHeader = void 0;
|
|
|
24
12
|
* This class provides comprehensive support for header definitions with typed
|
|
25
13
|
* values, validation schemas, examples, and documentation.
|
|
26
14
|
*
|
|
27
|
-
* ## Key Features
|
|
28
|
-
*
|
|
29
|
-
* - **Schema Validation**: Typed header values through schema definitions
|
|
30
|
-
* - **Examples**: Multiple example values for documentation and testing
|
|
31
|
-
* - **Content Types**: Support for complex header values with media types
|
|
32
|
-
* - **Deprecation Support**: Mark headers as deprecated with proper warnings
|
|
33
|
-
* - **Required/Optional**: Control whether headers are mandatory
|
|
34
|
-
* - **Documentation**: Rich description support for API documentation
|
|
35
|
-
*
|
|
36
15
|
* @example Basic authentication header
|
|
37
16
|
* ```typescript
|
|
38
17
|
* import { OasHeader, OasString } from '@skmtc/core';
|
|
@@ -52,173 +31,6 @@ exports.OasHeader = void 0;
|
|
|
52
31
|
* }
|
|
53
32
|
* });
|
|
54
33
|
* ```
|
|
55
|
-
*
|
|
56
|
-
* @example Pagination headers
|
|
57
|
-
* ```typescript
|
|
58
|
-
* const totalCountHeader = new OasHeader({
|
|
59
|
-
* description: 'Total number of items available',
|
|
60
|
-
* required: false,
|
|
61
|
-
* schema: new OasInteger({
|
|
62
|
-
* minimum: 0,
|
|
63
|
-
* description: 'Non-negative integer count'
|
|
64
|
-
* }),
|
|
65
|
-
* examples: {
|
|
66
|
-
* empty: new OasExample({ value: 0, description: 'No items' }),
|
|
67
|
-
* normal: new OasExample({ value: 150, description: 'Normal case' }),
|
|
68
|
-
* large: new OasExample({ value: 10000, description: 'Large dataset' })
|
|
69
|
-
* }
|
|
70
|
-
* });
|
|
71
|
-
*
|
|
72
|
-
* const linkHeader = new OasHeader({
|
|
73
|
-
* description: 'Pagination links (RFC 5988)',
|
|
74
|
-
* required: false,
|
|
75
|
-
* schema: new OasString({
|
|
76
|
-
* description: 'Comma-separated list of link relations'
|
|
77
|
-
* }),
|
|
78
|
-
* examples: {
|
|
79
|
-
* withNext: new OasExample({
|
|
80
|
-
* value: '</api/users?page=2>; rel="next", </api/users?page=10>; rel="last"'
|
|
81
|
-
* }),
|
|
82
|
-
* lastPage: new OasExample({
|
|
83
|
-
* value: '</api/users?page=9>; rel="prev", </api/users?page=1>; rel="first"'
|
|
84
|
-
* })
|
|
85
|
-
* }
|
|
86
|
-
* });
|
|
87
|
-
* ```
|
|
88
|
-
*
|
|
89
|
-
* @example Content type and encoding headers
|
|
90
|
-
* ```typescript
|
|
91
|
-
* const contentTypeHeader = new OasHeader({
|
|
92
|
-
* description: 'MIME type of the response content',
|
|
93
|
-
* required: true,
|
|
94
|
-
* schema: new OasString({
|
|
95
|
-
* enum: [
|
|
96
|
-
* 'application/json',
|
|
97
|
-
* 'application/xml',
|
|
98
|
-
* 'text/csv',
|
|
99
|
-
* 'application/pdf',
|
|
100
|
-
* 'application/octet-stream'
|
|
101
|
-
* ]
|
|
102
|
-
* }),
|
|
103
|
-
* examples: {
|
|
104
|
-
* json: new OasExample({ value: 'application/json' }),
|
|
105
|
-
* xml: new OasExample({ value: 'application/xml' }),
|
|
106
|
-
* csv: new OasExample({ value: 'text/csv' })
|
|
107
|
-
* }
|
|
108
|
-
* });
|
|
109
|
-
*
|
|
110
|
-
* const contentLengthHeader = new OasHeader({
|
|
111
|
-
* description: 'Size of the response body in bytes',
|
|
112
|
-
* required: false,
|
|
113
|
-
* schema: new OasInteger({
|
|
114
|
-
* minimum: 0,
|
|
115
|
-
* description: 'Content size in bytes'
|
|
116
|
-
* })
|
|
117
|
-
* });
|
|
118
|
-
* ```
|
|
119
|
-
*
|
|
120
|
-
* @example Rate limiting headers
|
|
121
|
-
* ```typescript
|
|
122
|
-
* const rateLimitHeader = new OasHeader({
|
|
123
|
-
* description: 'Number of requests remaining in the current window',
|
|
124
|
-
* required: false,
|
|
125
|
-
* schema: new OasInteger({
|
|
126
|
-
* minimum: 0,
|
|
127
|
-
* description: 'Remaining request count'
|
|
128
|
-
* }),
|
|
129
|
-
* examples: {
|
|
130
|
-
* available: new OasExample({ value: 95, description: '95 requests remaining' }),
|
|
131
|
-
* depleted: new OasExample({ value: 0, description: 'Rate limit reached' })
|
|
132
|
-
* }
|
|
133
|
-
* });
|
|
134
|
-
*
|
|
135
|
-
* const rateLimitResetHeader = new OasHeader({
|
|
136
|
-
* description: 'Unix timestamp when the rate limit window resets',
|
|
137
|
-
* required: false,
|
|
138
|
-
* schema: new OasInteger({
|
|
139
|
-
* minimum: 0,
|
|
140
|
-
* description: 'Unix timestamp in seconds'
|
|
141
|
-
* }),
|
|
142
|
-
* examples: {
|
|
143
|
-
* reset: new OasExample({
|
|
144
|
-
* value: 1634567890,
|
|
145
|
-
* description: 'Reset at 2021-10-18 12:31:30 UTC'
|
|
146
|
-
* })
|
|
147
|
-
* }
|
|
148
|
-
* });
|
|
149
|
-
* ```
|
|
150
|
-
*
|
|
151
|
-
* @example Custom application headers
|
|
152
|
-
* ```typescript
|
|
153
|
-
* const requestIdHeader = new OasHeader({
|
|
154
|
-
* description: 'Unique identifier for request tracing',
|
|
155
|
-
* required: false,
|
|
156
|
-
* schema: new OasString({
|
|
157
|
-
* format: 'uuid',
|
|
158
|
-
* description: 'UUID v4 request identifier'
|
|
159
|
-
* }),
|
|
160
|
-
* examples: {
|
|
161
|
-
* uuid: new OasExample({
|
|
162
|
-
* value: '123e4567-e89b-12d3-a456-426614174000',
|
|
163
|
-
* description: 'Request tracking ID'
|
|
164
|
-
* })
|
|
165
|
-
* }
|
|
166
|
-
* });
|
|
167
|
-
*
|
|
168
|
-
* const serverTimingHeader = new OasHeader({
|
|
169
|
-
* description: 'Server-side performance metrics',
|
|
170
|
-
* required: false,
|
|
171
|
-
* schema: new OasString({
|
|
172
|
-
* description: 'Server-Timing header format (RFC 8760)'
|
|
173
|
-
* }),
|
|
174
|
-
* examples: {
|
|
175
|
-
* timing: new OasExample({
|
|
176
|
-
* value: 'db;dur=53, app;dur=47.2',
|
|
177
|
-
* description: 'Database took 53ms, app logic 47.2ms'
|
|
178
|
-
* })
|
|
179
|
-
* }
|
|
180
|
-
* });
|
|
181
|
-
* ```
|
|
182
|
-
*
|
|
183
|
-
* @example Deprecated header
|
|
184
|
-
* ```typescript
|
|
185
|
-
* const deprecatedHeader = new OasHeader({
|
|
186
|
-
* description: 'Legacy API version header (deprecated)',
|
|
187
|
-
* required: false,
|
|
188
|
-
* deprecated: true,
|
|
189
|
-
* schema: new OasString({
|
|
190
|
-
* enum: ['v1', 'v2'],
|
|
191
|
-
* description: 'Use Accept or Content-Type header instead'
|
|
192
|
-
* }),
|
|
193
|
-
* examples: {
|
|
194
|
-
* legacy: new OasExample({
|
|
195
|
-
* value: 'v1',
|
|
196
|
-
* description: 'Legacy version (use Accept header instead)'
|
|
197
|
-
* })
|
|
198
|
-
* }
|
|
199
|
-
* });
|
|
200
|
-
* ```
|
|
201
|
-
*
|
|
202
|
-
* @example Using in response definitions
|
|
203
|
-
* ```typescript
|
|
204
|
-
* const successResponse = new OasResponse({
|
|
205
|
-
* description: 'Paginated user list',
|
|
206
|
-
* headers: {
|
|
207
|
-
* 'X-Total-Count': totalCountHeader,
|
|
208
|
-
* 'Link': linkHeader,
|
|
209
|
-
* 'X-Rate-Limit-Remaining': rateLimitHeader,
|
|
210
|
-
* 'X-Rate-Limit-Reset': rateLimitResetHeader,
|
|
211
|
-
* 'X-Request-ID': requestIdHeader
|
|
212
|
-
* },
|
|
213
|
-
* content: {
|
|
214
|
-
* 'application/json': new OasMediaType({
|
|
215
|
-
* schema: new OasArray({
|
|
216
|
-
* items: new OasRef({ $ref: '#/components/schemas/User' })
|
|
217
|
-
* })
|
|
218
|
-
* })
|
|
219
|
-
* }
|
|
220
|
-
* });
|
|
221
|
-
* ```
|
|
222
34
|
*/
|
|
223
35
|
class OasHeader {
|
|
224
36
|
constructor(fields) {
|
|
@@ -228,36 +40,62 @@ class OasHeader {
|
|
|
228
40
|
writable: true,
|
|
229
41
|
value: 'header'
|
|
230
42
|
});
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
43
|
+
/** Brief description of header */
|
|
44
|
+
Object.defineProperty(this, "description", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
configurable: true,
|
|
47
|
+
writable: true,
|
|
48
|
+
value: void 0
|
|
49
|
+
});
|
|
50
|
+
/** Indicates if header is mandatory. Default value is `false` */
|
|
51
|
+
Object.defineProperty(this, "required", {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
configurable: true,
|
|
54
|
+
writable: true,
|
|
55
|
+
value: void 0
|
|
56
|
+
});
|
|
57
|
+
/** Indicates if header is deprecated and should no longer be used. Default value is false */
|
|
58
|
+
Object.defineProperty(this, "deprecated", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
configurable: true,
|
|
61
|
+
writable: true,
|
|
62
|
+
value: void 0
|
|
63
|
+
});
|
|
64
|
+
/** Schema for the header */
|
|
65
|
+
Object.defineProperty(this, "schema", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
configurable: true,
|
|
68
|
+
writable: true,
|
|
69
|
+
value: void 0
|
|
70
|
+
});
|
|
71
|
+
/** Examples of the header */
|
|
72
|
+
Object.defineProperty(this, "examples", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
configurable: true,
|
|
75
|
+
writable: true,
|
|
76
|
+
value: void 0
|
|
77
|
+
});
|
|
78
|
+
/** Content of the header */
|
|
79
|
+
Object.defineProperty(this, "content", {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
configurable: true,
|
|
82
|
+
writable: true,
|
|
83
|
+
value: void 0
|
|
84
|
+
});
|
|
85
|
+
/** Specification Extension fields */
|
|
86
|
+
Object.defineProperty(this, "extensionFields", {
|
|
87
|
+
enumerable: true,
|
|
88
|
+
configurable: true,
|
|
89
|
+
writable: true,
|
|
90
|
+
value: void 0
|
|
91
|
+
});
|
|
92
|
+
this.description = fields.description;
|
|
93
|
+
this.required = fields.required;
|
|
94
|
+
this.deprecated = fields.deprecated;
|
|
95
|
+
this.schema = fields.schema;
|
|
96
|
+
this.examples = fields.examples;
|
|
97
|
+
this.content = fields.content;
|
|
98
|
+
this.extensionFields = fields.extensionFields;
|
|
261
99
|
}
|
|
262
100
|
/** Returns true if object is a reference */
|
|
263
101
|
isRef() {
|
|
@@ -279,7 +117,7 @@ class OasHeader {
|
|
|
279
117
|
if (this.schema) {
|
|
280
118
|
return this.schema;
|
|
281
119
|
}
|
|
282
|
-
const schema =
|
|
120
|
+
const schema = this.content?.[mediaType]?.schema;
|
|
283
121
|
if (!schema) {
|
|
284
122
|
throw new Error(`Schema not found for media type ${mediaType}`);
|
|
285
123
|
}
|
|
@@ -296,4 +134,3 @@ class OasHeader {
|
|
|
296
134
|
}
|
|
297
135
|
}
|
|
298
136
|
exports.OasHeader = OasHeader;
|
|
299
|
-
_OasHeader_fields = new WeakMap();
|
|
@@ -27,7 +27,7 @@ export type ListKeyValue<Key extends Stringable, Value extends Stringable> = Lis
|
|
|
27
27
|
/**
|
|
28
28
|
* Type representing the different bookend styles for lists.
|
|
29
29
|
*/
|
|
30
|
-
export type BookendsType = '[]' | '{}' | '()' | '
|
|
30
|
+
export type BookendsType = '[]' | '{}' | '()' | 'none';
|
|
31
31
|
type ConstructorOptions<Separator extends string = ', ', Bookends extends BookendsType = 'none'> = {
|
|
32
32
|
separator?: Separator;
|
|
33
33
|
bookends?: Bookends;
|
|
@@ -62,7 +62,7 @@ type ToConditionalReturn<Value extends Stringable, Condition extends boolean> =
|
|
|
62
62
|
*
|
|
63
63
|
* @template Values - Array of stringable values
|
|
64
64
|
* @template Separator - String used to separate items
|
|
65
|
-
* @template Bookends - Style of bookends ('[]', '{}', '()', '
|
|
65
|
+
* @template Bookends - Style of bookends ('[]', '{}', '()', 'none')
|
|
66
66
|
*
|
|
67
67
|
* @example Basic usage
|
|
68
68
|
* ```typescript
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/typescript/List.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAGtD,4EAA4E;AAC5E,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,UAAU,IAAI,IAAI,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAEpE,2DAA2D;AAC3D,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,UAAU,IAAI,IAAI,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;AAErE,8EAA8E;AAC9E,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,UAAU,IAAI,IAAI,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAEnE,gF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C;CAGlC;AAED;;GAEG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,UAAU,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAA;AAEjE;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,UAAU,IAAI,CACnE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EACf,KAAK,EAAE,MAAM,KACV,CAAC,GAAG,SAAS,CAAA;AAElB;;;;;;;GAOG;AACH,qBAAa,SAAS,CAAC,CAAC,SAAS,UAAU;IACzC,sCAAsC;IACtC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;IAEnB;;;;OAIG;gBACS,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE;IAI/B;;;;;OAKG;IACH,QAAQ,CAAC,CAAC,SAAS,UAAU,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;IAItE;;;;;OAKG;IACH,OAAO,CAAC,CAAC,SAAS,UAAU,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;IAIpE;;;;;OAKG;IACH,OAAO,CAAC,CAAC,SAAS,UAAU,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;CAGrE"}
|
|
@@ -25,7 +25,7 @@ const ts_pattern_1 = require("ts-pattern");
|
|
|
25
25
|
*
|
|
26
26
|
* @template Values - Array of stringable values
|
|
27
27
|
* @template Separator - String used to separate items
|
|
28
|
-
* @template Bookends - Style of bookends ('[]', '{}', '()', '
|
|
28
|
+
* @template Bookends - Style of bookends ('[]', '{}', '()', 'none')
|
|
29
29
|
*
|
|
30
30
|
* @example Basic usage
|
|
31
31
|
* ```typescript
|
|
@@ -152,13 +152,13 @@ class List {
|
|
|
152
152
|
return '';
|
|
153
153
|
}
|
|
154
154
|
const joined = this.values.map(value => value.toString()).join(this.separator);
|
|
155
|
-
return (0, ts_pattern_1.match)(this.bookends)
|
|
155
|
+
return ((0, ts_pattern_1.match)(this.bookends)
|
|
156
156
|
.with('[]', () => `[${joined}]`)
|
|
157
157
|
.with('{}', () => `{${joined}}`)
|
|
158
158
|
.with('()', () => `(${joined})`)
|
|
159
|
-
.with('<>', () => `<${joined}>`)
|
|
159
|
+
// .with('<>', () => `<${joined}>`)
|
|
160
160
|
.with('none', () => joined)
|
|
161
|
-
.exhaustive();
|
|
161
|
+
.exhaustive());
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
exports.List = List;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toPathTemplate.d.ts","sourceRoot":"","sources":["../../src/typescript/toPathTemplate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiHG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,EAAE,WAAW,MAAM,KAAG,
|
|
1
|
+
{"version":3,"file":"toPathTemplate.d.ts","sourceRoot":"","sources":["../../src/typescript/toPathTemplate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiHG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,EAAE,WAAW,MAAM,KAAG,MAEhE,CAAA"}
|