@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.
@@ -1,4 +1,3 @@
1
- import type { GeneratorKey } from '../types/GeneratorKeys.js';
2
1
  import type { ManifestEntry } from '../types/Manifest.js';
3
2
  import type { Mapping, Preview } from '../types/Preview.js';
4
3
  import type { ResultsItem } from '../types/Results.js';
@@ -14,13 +13,6 @@ export type GetFileOptions = {
14
13
  /** Whether to throw an error if the file is not found */
15
14
  throwIfNotFound?: boolean;
16
15
  };
17
- /**
18
- * Arguments for adding a generator key to the context.
19
- */
20
- export type AddGeneratorKeyArgs = {
21
- /** The generator key to add */
22
- generatorKey: GeneratorKey;
23
- };
24
16
  /**
25
17
  * Result of rendering files in the context.
26
18
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/context/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEtE;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAA;AAEvD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,yDAAyD;IACzD,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,+BAA+B;IAC/B,YAAY,EAAE,YAAY,CAAA;CAC3B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,iBAA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d,iBAAiB,GACjB,kBAAkB,GAClB,mBAAmB,GACnB,kBAAkB,GAClB,gBAAgB,GAChB,mBAAmB,GACnB,gBAAgB,GAChB,mBAAmB,GACnB,wBAAwB,CAAA"}
@@ -1,9 +1,9 @@
1
1
  import type { GenerateContext } from '../../context/GenerateContext.js';
2
2
  import type { RefName } from '../../types/RefName.js';
3
3
  import type { ContentSettings } from '../ContentSettings.js';
4
- import { ModelBase } from './ModelBase.js';
5
4
  import type { Identifier } from '../Identifier.js';
6
5
  import * as v from 'valibot';
6
+ import type { ModelInsertable } from './types.js';
7
7
  /**
8
8
  * Arguments for creating a model insertable instance.
9
9
  *
@@ -17,6 +17,10 @@ export type ModelInsertableArgs<EnrichmentType = undefined> = {
17
17
  /** Reference name identifying the model schema */
18
18
  refName: RefName;
19
19
  };
20
+ type ToEnrichmentsArgs = {
21
+ refName: RefName;
22
+ context: GenerateContext;
23
+ };
20
24
  /**
21
25
  * Configuration for creating a base model class.
22
26
  *
@@ -81,5 +85,23 @@ export type BaseModelConfig<EnrichmentType = undefined> = {
81
85
  * });
82
86
  * ```
83
87
  */
84
- export declare const toModelBase: <EnrichmentType = undefined>(config: BaseModelConfig<EnrichmentType>) => new (args: ModelInsertableArgs<EnrichmentType>) => ModelBase<EnrichmentType>;
88
+ export declare const toModelBase: <EnrichmentType = undefined>(config: BaseModelConfig<EnrichmentType>) => {
89
+ new (args: ModelInsertableArgs<EnrichmentType>): {
90
+ settings: ContentSettings<EnrichmentType>;
91
+ refName: RefName;
92
+ generatorKey: import("../../mod.js").GeneratorKey;
93
+ insertModel<V extends import("../../mod.js").GeneratedValue, EnrichmentType_1 = undefined>(insertable: ModelInsertable<V, EnrichmentType_1>, refName: RefName, options?: Pick<import("../../mod.js").InsertModelOptions<"force">, "noExport">): import("../Inserted.js").Inserted<V, "force", EnrichmentType_1>;
94
+ insertNormalizedModel<V extends import("../../mod.js").GeneratedValue, Schema extends import("../../mod.js").OasSchema | import("../../mod.js").OasRef<"schema"> | import("../../mod.js").OasVoid, EnrichmentType_2 = undefined>(insertable: ModelInsertable<V, EnrichmentType_2>, { schema, fallbackName }: Omit<import("../../mod.js").InsertNormalisedModelArgs<Schema>, "destinationPath">, options?: Pick<import("../../mod.js").InsertModelOptions<"force">, "noExport">): import("../../mod.js").InsertNormalisedModelReturn<V, Schema>;
95
+ register(args: import("../../mod.js").BaseRegisterArgs): void;
96
+ context: GenerateContext;
97
+ skipped: boolean;
98
+ };
99
+ id: string;
100
+ type: "model";
101
+ toIdentifier: (refName: RefName) => Identifier;
102
+ toExportPath: (refName: RefName) => string;
103
+ toEnrichments: ({ refName, context }: ToEnrichmentsArgs) => EnrichmentType;
104
+ isSupported: () => boolean;
105
+ };
106
+ export {};
85
107
  //# sourceMappingURL=toModelBase.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toModelBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/toModelBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAEvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAI5B;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,CAAC,cAAc,GAAG,SAAS,IAAI;IAC5D,2EAA2E;IAC3E,OAAO,EAAE,eAAe,CAAA;IACxB,iEAAiE;IACjE,QAAQ,EAAE,eAAe,CAAC,cAAc,CAAC,CAAA;IACzC,kDAAkD;IAClD,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAOD;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,CAAC,cAAc,GAAG,SAAS,IAAI;IACxD,gDAAgD;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ED,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,eAAe,CAAA;CACzB,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,CAAC,cAAc,GAAG,SAAS,IAAI;IACxD,gDAAgD;IAChD,EAAE,EAAE,MAAM,CAAA;IACV,4DAA4D;IAC5D,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,UAAU,CAAA;IAC9C,6DAA6D;IAC7D,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;IAC1C,gEAAgE;IAChE,kBAAkB,CAAC,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;CAC9F,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,WAAW,GAAI,cAAc,GAAG,SAAS,EACpD,QAAQ,eAAe,CAAC,cAAc,CAAC;eAiBnB,mBAAmB,CAAC,cAAc,CAAC;;;;;;;;;;;UAbvC,OAAO;4BA1DC,OAAO,KAAK,UAAU;4BAEtB,OAAO,KAAK,MAAM;oBA4DhB,sBAAsB,iBAAiB,KAAG,cAAc;;CAmBnF,CAAA"}
@@ -30,7 +30,7 @@ export type WithTransformModel = {
30
30
  /**
31
31
  * Arguments for generating enrichment data for models.
32
32
  */
33
- export type ModelToEnrichmentsArgs = {
33
+ export type ToModelEnrichmentsArgs = {
34
34
  refName: RefName;
35
35
  context: GenerateContext;
36
36
  };
@@ -81,7 +81,7 @@ export type ModelInsertable<V, EnrichmentType = undefined> = {
81
81
  type: 'model';
82
82
  toIdentifier: (refName: RefName) => Identifier;
83
83
  toExportPath: (refName: RefName) => string;
84
- toEnrichments: ({ refName, context }: ModelToEnrichmentsArgs) => EnrichmentType;
84
+ toEnrichments: ({ refName, context }: ToModelEnrichmentsArgs) => EnrichmentType;
85
85
  schemaToValueFn: SchemaToValueFn;
86
86
  createIdentifier: (name: string) => Identifier;
87
87
  } & Function;
@@ -1,7 +1,7 @@
1
+ import type { GenerateContext } from '../../context/GenerateContext.js';
1
2
  import type { OasOperation } from '../../oas/operation/Operation.js';
2
- import { OperationBase } from './OperationBase.js';
3
3
  import type { Identifier } from '../Identifier.js';
4
- import type { OperationInsertableArgs } from './types.js';
4
+ import type { OperationInsertable, OperationInsertableArgs } from './types.js';
5
5
  import * as v from 'valibot';
6
6
  /**
7
7
  * Configuration for creating a base operation class.
@@ -21,6 +21,10 @@ export type BaseOperationConfig<EnrichmentType = undefined> = {
21
21
  /** Optional function to provide enrichment validation schema */
22
22
  toEnrichmentSchema?: () => v.BaseSchema<EnrichmentType, EnrichmentType, v.BaseIssue<unknown>>;
23
23
  };
24
+ type ToEnrichmentsArgs = {
25
+ operation: OasOperation;
26
+ context: GenerateContext;
27
+ };
24
28
  /**
25
29
  * Creates a base operation class constructor for generating type-safe operation artifacts.
26
30
  *
@@ -67,5 +71,24 @@ export type BaseOperationConfig<EnrichmentType = undefined> = {
67
71
  * });
68
72
  * ```
69
73
  */
70
- export declare const toOperationBase: <EnrichmentType = undefined>(config: BaseOperationConfig<EnrichmentType>) => new (args: OperationInsertableArgs<EnrichmentType>) => OperationBase<EnrichmentType>;
74
+ export declare const toOperationBase: <EnrichmentType = undefined>(config: BaseOperationConfig<EnrichmentType>) => {
75
+ new (args: OperationInsertableArgs<EnrichmentType>): {
76
+ settings: import("../ContentSettings.js").ContentSettings<EnrichmentType>;
77
+ operation: OasOperation;
78
+ generatorKey: import("../../mod.js").GeneratorKey;
79
+ insertOperation<V extends import("../../mod.js").GeneratedValue, EnrichmentType_1 = undefined>(insertable: OperationInsertable<V, EnrichmentType_1>, operation: OasOperation, options?: Pick<import("../../mod.js").InsertOperationOptions<"force">, "noExport">): import("../Inserted.js").Inserted<V, "force", EnrichmentType_1>;
80
+ insertModel<V extends import("../../mod.js").GeneratedValue, EnrichmentType_2 = undefined>(insertable: import("../model/types.js").ModelInsertable<V, EnrichmentType_2>, refName: import("../../mod.js").RefName, options?: Pick<import("../../mod.js").InsertModelOptions<"force">, "noExport">): import("../Inserted.js").Inserted<V, "force", EnrichmentType_2>;
81
+ insertNormalizedModel<V extends import("../../mod.js").GeneratedValue, Schema extends import("../../mod.js").OasSchema | import("../../mod.js").OasRef<"schema"> | import("../../mod.js").OasVoid, EnrichmentType_3 = undefined>(insertable: import("../model/types.js").ModelInsertable<V, EnrichmentType_3>, { schema, fallbackName }: Omit<import("../../mod.js").InsertNormalisedModelArgs<Schema>, "destinationPath">, options?: Pick<import("../../mod.js").InsertModelOptions<"force">, "noExport">): import("../../mod.js").InsertNormalisedModelReturn<V, Schema>;
82
+ defineAndRegister<V extends import("../../mod.js").GeneratedValue>({ identifier, value, noExport }: Omit<import("../../mod.js").DefineAndRegisterArgs<V>, "destinationPath">): import("../Definition.js").Definition<V>;
83
+ register(args: import("../../mod.js").BaseRegisterArgs): void;
84
+ context: GenerateContext;
85
+ skipped: boolean;
86
+ };
87
+ id: string;
88
+ type: "operation";
89
+ toIdentifier: (operation: OasOperation) => Identifier;
90
+ toExportPath: (operation: OasOperation) => string;
91
+ toEnrichments: ({ operation, context }: ToEnrichmentsArgs) => EnrichmentType;
92
+ };
93
+ export {};
71
94
  //# sourceMappingURL=toOperationBase.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toOperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationBase.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAI5B;;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rD,wDAAwD;IACxD,YAAY,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,MAAM,CAAA;IACjD,gEAAgE;IAChE,kBAAkB,CAAC,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;CAC9F,CAAA;AAED,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,YAAY,CAAA;IACvB,OAAO,EAAE,eAAe,CAAA;CACzB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,eAAe,GAAI,cAAc,GAAG,SAAS,EACxD,QAAQ,mBAAmB,CAAC,cAAc,CAAC;eAoBvB,uBAAuB,CAAC,cAAc,CAAC;;;;;;;;;;;;;UAhB3C,WAAW;8BA/DD,YAAY,KAAK,UAAU;8BAE3B,YAAY,KAAK,MAAM;oBAkEvB,wBAAwB,iBAAiB,KAAG,cAAc;CAqBrF,CAAA"}
@@ -54,7 +54,7 @@ export type IsSupportedOperationArgs = {
54
54
  /**
55
55
  * Arguments for generating enrichment data for operations.
56
56
  */
57
- export type OperationToEnrichmentsArgs = {
57
+ export type ToOperationEnrichmentsArgs = {
58
58
  operation: OasOperation;
59
59
  context: GenerateContext;
60
60
  };
@@ -95,7 +95,7 @@ export type OperationInsertable<V, EnrichmentType = undefined> = {
95
95
  type: 'operation';
96
96
  toIdentifier: (operation: OasOperation) => Identifier;
97
97
  toExportPath: (operation: OasOperation) => string;
98
- toEnrichments: ({ operation, context }: OperationToEnrichmentsArgs) => EnrichmentType;
98
+ toEnrichments: ({ operation, context }: ToOperationEnrichmentsArgs) => EnrichmentType;
99
99
  } & Function;
100
100
  /**
101
101
  * Arguments for checking if an operation is supported for generation.
@@ -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
- get description(): string | undefined;
60
+ description: string | undefined;
239
61
  /** Indicates if header is mandatory. Default value is `false` */
240
- get required(): boolean | undefined;
62
+ required: boolean | undefined;
241
63
  /** Indicates if header is deprecated and should no longer be used. Default value is false */
242
- get deprecated(): boolean | undefined;
64
+ deprecated: boolean | undefined;
243
65
  /** Schema for the header */
244
- get schema(): OasSchema | OasRef<'schema'> | undefined;
66
+ schema: OasSchema | OasRef<'schema'> | undefined;
245
67
  /** Examples of the header */
246
- get examples(): Record<string, OasExample | OasRef<'example'>> | undefined;
68
+ examples: Record<string, OasExample | OasRef<'example'>> | undefined;
247
69
  /** Content of the header */
248
- get content(): Record<string, OasMediaType> | undefined;
70
+ content: Record<string, OasMediaType> | undefined;
249
71
  /** Specification Extension fields */
250
- get extensionFields(): Record<string, unknown> | undefined;
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,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,SAAS,CAAA;IACjD,+CAA+C;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC1C,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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