@typespec/openapi3 1.6.0-dev.8 → 1.6.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/src/cli/actions/convert/convert.d.ts +2 -2
- package/dist/src/cli/actions/convert/convert.d.ts.map +1 -1
- package/dist/src/cli/actions/convert/convert.js.map +1 -1
- package/dist/src/cli/actions/convert/generators/generate-main.d.ts.map +1 -1
- package/dist/src/cli/actions/convert/generators/generate-main.js +8 -2
- package/dist/src/cli/actions/convert/generators/generate-main.js.map +1 -1
- package/dist/src/cli/actions/convert/generators/generate-model.d.ts.map +1 -1
- package/dist/src/cli/actions/convert/generators/generate-model.js +129 -4
- package/dist/src/cli/actions/convert/generators/generate-model.js.map +1 -1
- package/dist/src/cli/actions/convert/generators/generate-response-expressions.js +17 -3
- package/dist/src/cli/actions/convert/generators/generate-response-expressions.js.map +1 -1
- package/dist/src/cli/actions/convert/generators/generate-types.d.ts +6 -6
- package/dist/src/cli/actions/convert/generators/generate-types.d.ts.map +1 -1
- package/dist/src/cli/actions/convert/generators/generate-types.js +4 -1
- package/dist/src/cli/actions/convert/generators/generate-types.js.map +1 -1
- package/dist/src/cli/actions/convert/interfaces.d.ts +9 -9
- package/dist/src/cli/actions/convert/interfaces.d.ts.map +1 -1
- package/dist/src/cli/actions/convert/transforms/transform-component-parameters.d.ts.map +1 -1
- package/dist/src/cli/actions/convert/transforms/transform-component-parameters.js +5 -2
- package/dist/src/cli/actions/convert/transforms/transform-component-parameters.js.map +1 -1
- package/dist/src/cli/actions/convert/transforms/transform-component-schemas.d.ts.map +1 -1
- package/dist/src/cli/actions/convert/transforms/transform-component-schemas.js +29 -13
- package/dist/src/cli/actions/convert/transforms/transform-component-schemas.js.map +1 -1
- package/dist/src/cli/actions/convert/transforms/transform-paths.d.ts +2 -2
- package/dist/src/cli/actions/convert/transforms/transform-paths.d.ts.map +1 -1
- package/dist/src/cli/actions/convert/transforms/transform-paths.js +3 -3
- package/dist/src/cli/actions/convert/transforms/transform-paths.js.map +1 -1
- package/dist/src/cli/actions/convert/transforms/transforms.d.ts.map +1 -1
- package/dist/src/cli/actions/convert/transforms/transforms.js +117 -8
- package/dist/src/cli/actions/convert/transforms/transforms.js.map +1 -1
- package/dist/src/cli/actions/convert/utils/context.d.ts +22 -5
- package/dist/src/cli/actions/convert/utils/context.d.ts.map +1 -1
- package/dist/src/cli/actions/convert/utils/context.js +16 -0
- package/dist/src/cli/actions/convert/utils/context.js.map +1 -1
- package/dist/src/cli/actions/convert/utils/decorators.d.ts +3 -3
- package/dist/src/cli/actions/convert/utils/decorators.d.ts.map +1 -1
- package/dist/src/cli/actions/convert/utils/decorators.js +24 -6
- package/dist/src/cli/actions/convert/utils/decorators.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +18 -3
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +9 -1
- package/dist/src/lib.js.map +1 -1
- package/dist/src/openapi-spec-mappings.d.ts +2 -0
- package/dist/src/openapi-spec-mappings.d.ts.map +1 -1
- package/dist/src/openapi-spec-mappings.js +10 -0
- package/dist/src/openapi-spec-mappings.js.map +1 -1
- package/dist/src/openapi.d.ts.map +1 -1
- package/dist/src/openapi.js +45 -8
- package/dist/src/openapi.js.map +1 -1
- package/dist/src/range.d.ts +4 -0
- package/dist/src/range.d.ts.map +1 -0
- package/dist/src/range.js +22 -0
- package/dist/src/range.js.map +1 -0
- package/dist/src/schema-emitter.d.ts +5 -2
- package/dist/src/schema-emitter.d.ts.map +1 -1
- package/dist/src/schema-emitter.js +6 -3
- package/dist/src/schema-emitter.js.map +1 -1
- package/dist/src/sse-module.d.ts +10 -0
- package/dist/src/sse-module.d.ts.map +1 -0
- package/dist/src/sse-module.js +125 -0
- package/dist/src/sse-module.js.map +1 -0
- package/dist/src/types.d.ts +337 -23
- package/dist/src/types.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +39 -23
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { attachExtensions } from "./attach-extensions.js";
|
|
2
|
+
export async function resolveSSEModule() {
|
|
3
|
+
const [streams, events, sse] = await Promise.all([
|
|
4
|
+
tryImportStreams(),
|
|
5
|
+
tryImportEvents(),
|
|
6
|
+
tryImportSSE(),
|
|
7
|
+
]);
|
|
8
|
+
if (streams === undefined || events === undefined || sse === undefined) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
isSSEStream: (program, type) => {
|
|
13
|
+
if (type.kind !== "Model")
|
|
14
|
+
return false;
|
|
15
|
+
// Check if this is a stream - we rely on contentType filtering in the caller
|
|
16
|
+
const streamOf = streams.getStreamOf(program, type);
|
|
17
|
+
return !!streamOf;
|
|
18
|
+
},
|
|
19
|
+
getSSEStreamType: (program, type) => {
|
|
20
|
+
if (type.kind !== "Model")
|
|
21
|
+
return undefined;
|
|
22
|
+
return streams.getStreamOf(program, type);
|
|
23
|
+
},
|
|
24
|
+
attachSSEItemSchema: (program, options, streamType, emitObject, getSchemaForType) => {
|
|
25
|
+
// Check if the stream type is a union with @events decorator
|
|
26
|
+
if (streamType.kind !== "Union")
|
|
27
|
+
return;
|
|
28
|
+
const isEventsUnion = events.isEvents(program, streamType);
|
|
29
|
+
if (!isEventsUnion)
|
|
30
|
+
return;
|
|
31
|
+
// Get event definitions
|
|
32
|
+
const [eventDefinitions, diagnostics] = events.unsafe_getEventDefinitions(program, streamType);
|
|
33
|
+
if (diagnostics && diagnostics.length) {
|
|
34
|
+
// TODO: Handle diagnostics
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (!eventDefinitions || eventDefinitions.length === 0)
|
|
38
|
+
return;
|
|
39
|
+
// Build the itemSchema structure
|
|
40
|
+
// The itemSchema should have a oneOf with all event variants
|
|
41
|
+
const oneOfSchemas = [];
|
|
42
|
+
for (const eventDef of eventDefinitions) {
|
|
43
|
+
const variant = eventDef.root;
|
|
44
|
+
const eventType = eventDef.eventType;
|
|
45
|
+
const payloadType = eventDef.payloadType;
|
|
46
|
+
const payloadContentType = eventDef.payloadContentType || "application/json";
|
|
47
|
+
// Check if this is a terminal event
|
|
48
|
+
const isTerminal = sse.isTerminalEvent(program, variant);
|
|
49
|
+
// Build the oneOf variant schema
|
|
50
|
+
const variantSchema = {
|
|
51
|
+
properties: {
|
|
52
|
+
data: {
|
|
53
|
+
contentMediaType: payloadContentType,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
if (isTerminal) {
|
|
58
|
+
// If the variant type is a string literal, use it as const
|
|
59
|
+
if (variant.type.kind === "String") {
|
|
60
|
+
variantSchema.properties.data.const = variant.type.value;
|
|
61
|
+
variantSchema.properties.data.contentMediaType =
|
|
62
|
+
payloadContentType;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
// For non-terminal events, add the event type
|
|
67
|
+
if (eventType) {
|
|
68
|
+
variantSchema.properties.event = {
|
|
69
|
+
const: eventType,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
// Add contentSchema for the payload
|
|
73
|
+
variantSchema.properties.data.contentSchema =
|
|
74
|
+
getSchemaForType(payloadType);
|
|
75
|
+
}
|
|
76
|
+
// Attach any extensions from the union variant
|
|
77
|
+
attachExtensions(program, variant, variantSchema);
|
|
78
|
+
oneOfSchemas.push(variantSchema);
|
|
79
|
+
}
|
|
80
|
+
// Set the itemSchema with the base structure and oneOf
|
|
81
|
+
emitObject.itemSchema = {
|
|
82
|
+
type: "object",
|
|
83
|
+
properties: {
|
|
84
|
+
event: {
|
|
85
|
+
type: "string",
|
|
86
|
+
},
|
|
87
|
+
data: {
|
|
88
|
+
type: "string",
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
required: ["event"],
|
|
92
|
+
oneOf: oneOfSchemas,
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
async function tryImportStreams() {
|
|
98
|
+
try {
|
|
99
|
+
const module = await import("@typespec/streams");
|
|
100
|
+
return module;
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
async function tryImportEvents() {
|
|
107
|
+
try {
|
|
108
|
+
const eventsModule = await import("@typespec/events");
|
|
109
|
+
const experimentalModule = await import("@typespec/events/experimental");
|
|
110
|
+
return { ...eventsModule, ...experimentalModule };
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
async function tryImportSSE() {
|
|
117
|
+
try {
|
|
118
|
+
const module = await import("@typespec/sse");
|
|
119
|
+
return module;
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=sse-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sse-module.js","sourceRoot":"","sources":["../../src/sse-module.ts"],"names":[],"mappings":"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"}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Diagnostic, Service } from "@typespec/compiler";
|
|
2
2
|
import { Contact, ExtensionKey, License } from "@typespec/openapi";
|
|
3
|
-
export type CommonOpenAPI3Schema = OpenAPI3Schema & OpenAPISchema3_1;
|
|
4
|
-
export type
|
|
3
|
+
export type CommonOpenAPI3Schema = OpenAPI3Schema & OpenAPISchema3_1 & OpenAPISchema3_2;
|
|
4
|
+
export type SupportedOpenAPISchema = OpenAPI3Schema | OpenAPISchema3_1 | OpenAPISchema3_2;
|
|
5
|
+
export type SupportedOpenAPIDocuments = OpenAPI3Document | OpenAPIDocument3_1 | OpenAPIDocument3_2;
|
|
5
6
|
export type Extensions = {
|
|
6
7
|
[key in ExtensionKey]?: any;
|
|
7
8
|
};
|
|
@@ -96,14 +97,16 @@ export interface OpenAPI3Tag extends Extensions {
|
|
|
96
97
|
description?: string;
|
|
97
98
|
externalDocs?: OpenAPI3ExternalDocs;
|
|
98
99
|
}
|
|
99
|
-
export type
|
|
100
|
+
export type OpenAPI3HttpMethod = "get" | "put" | "post" | "delete" | "options" | "head" | "patch" | "trace";
|
|
101
|
+
export type OpenAPIHttpMethod3_2 = OpenAPI3HttpMethod | "query";
|
|
102
|
+
export type HttpMethod = OpenAPI3HttpMethod | OpenAPIHttpMethod3_2;
|
|
100
103
|
/**
|
|
101
104
|
* Describes the operations available on a single path. A Path Item may be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.
|
|
102
105
|
*
|
|
103
|
-
* @see https://
|
|
106
|
+
* @see https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-6
|
|
104
107
|
*/
|
|
105
108
|
export type OpenAPI3PathItem = {
|
|
106
|
-
[method in
|
|
109
|
+
[method in OpenAPI3HttpMethod]?: OpenAPI3Operation;
|
|
107
110
|
} & {
|
|
108
111
|
parameters?: OpenAPI3Parameter[];
|
|
109
112
|
} & Extensions;
|
|
@@ -134,7 +137,7 @@ export type OpenAPI3Response = Extensions & {
|
|
|
134
137
|
/**
|
|
135
138
|
* Each Media Type Object provides schema and examples for the media type identified by its key.
|
|
136
139
|
*
|
|
137
|
-
* @see https://
|
|
140
|
+
* @see https://spec.openapis.org/oas/v3.0.4.html#media-type-object
|
|
138
141
|
*/
|
|
139
142
|
export type OpenAPI3MediaType = Extensions & {
|
|
140
143
|
/** The schema defining the content of the request, response, or parameter. */
|
|
@@ -149,7 +152,7 @@ export type OpenAPI3MediaType = Extensions & {
|
|
|
149
152
|
/**
|
|
150
153
|
* A single encoding definition applied to a single schema property.
|
|
151
154
|
*
|
|
152
|
-
* see https://
|
|
155
|
+
* @see https://spec.openapis.org/oas/v3.0.4.html#encoding-object
|
|
153
156
|
*/
|
|
154
157
|
export type OpenAPI3Encoding = Extensions & {
|
|
155
158
|
/** the Content-Type for encoding a specific property. Default value depends on the property type: for string with format being binary – application/octet-stream; for other primitive types – text/plain; for object - application/json; for array – the default is defined based on the inner type. The value can be a specific media type (e.g. application/json), a wildcard media type (e.g. image/*), or a comma-separated list of the two types. */
|
|
@@ -166,7 +169,7 @@ export type OpenAPI3Encoding = Extensions & {
|
|
|
166
169
|
/**
|
|
167
170
|
* Describes a single request body.
|
|
168
171
|
*
|
|
169
|
-
* @see https://
|
|
172
|
+
* @see https://spec.openapis.org/oas/v3.0.4.html#request-body-object
|
|
170
173
|
*/
|
|
171
174
|
export type OpenAPI3RequestBody = Extensions & {
|
|
172
175
|
/** A brief description of the request body. This could contain examples of use. CommonMark syntax MAY be used for rich text representation. */
|
|
@@ -180,7 +183,7 @@ export type OpenAPI3SecurityScheme = OpenAPI3ApiKeySecurityScheme | OpenAPI3OAut
|
|
|
180
183
|
/**
|
|
181
184
|
* defines a security scheme that can be used by the operations. Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), OAuth2's common flows (implicit, password, application and access code) as defined in RFC6749, and OpenID Connect Discovery.
|
|
182
185
|
*
|
|
183
|
-
* @see https://
|
|
186
|
+
* @see https://spec.openapis.org/oas/v3.0.4.html#security-scheme-object
|
|
184
187
|
*/
|
|
185
188
|
export interface OpenAPI3SecuritySchemeBase extends Extensions {
|
|
186
189
|
/** A short description for security scheme. CommonMark syntax MAY be used for rich text representation. */
|
|
@@ -219,7 +222,7 @@ export interface OpenAPI3OAuth2SecurityScheme extends OpenAPI3SecuritySchemeBase
|
|
|
219
222
|
/**
|
|
220
223
|
* Allows configuration of the supported OAuth Flows.
|
|
221
224
|
*
|
|
222
|
-
* @see https://
|
|
225
|
+
* @see https://spec.openapis.org/oas/v3.0.4.html#oauth-flows-object
|
|
223
226
|
*/
|
|
224
227
|
export interface OpenAPI3OAuthFlows extends Extensions {
|
|
225
228
|
/** Configuration for the OAuth Implicit flow */
|
|
@@ -277,7 +280,7 @@ export type OpenAPI3Link = {
|
|
|
277
280
|
/**
|
|
278
281
|
* Allows sharing examples for operation responses.
|
|
279
282
|
*
|
|
280
|
-
* @see https://
|
|
283
|
+
* @see https://spec.openapis.org/oas/v2.0.html#example-object
|
|
281
284
|
*/
|
|
282
285
|
export interface OpenAPI3Example {
|
|
283
286
|
summary?: string;
|
|
@@ -289,11 +292,14 @@ export interface OpenAPI3Discriminator extends Extensions {
|
|
|
289
292
|
propertyName: string;
|
|
290
293
|
mapping?: Record<string, string>;
|
|
291
294
|
}
|
|
295
|
+
export interface OpenAPIDiscriminator3_2 extends OpenAPI3Discriminator {
|
|
296
|
+
/**
|
|
297
|
+
* The default mapping value to be used when no other mapping matches.
|
|
298
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#fixed-fields-21
|
|
299
|
+
*/
|
|
300
|
+
defaultMapping?: string;
|
|
301
|
+
}
|
|
292
302
|
export type JsonType = "array" | "boolean" | "integer" | "number" | "object" | "string";
|
|
293
|
-
/**
|
|
294
|
-
* Autorest allows a few properties to be next to $ref of a property.
|
|
295
|
-
*/
|
|
296
|
-
export type OpenAPI3SchemaProperty = Ref<OpenAPI3Schema> | OpenAPI3Schema;
|
|
297
303
|
export type OpenAPI3XmlSchema = Extensions & {
|
|
298
304
|
name?: string;
|
|
299
305
|
namespace?: string;
|
|
@@ -464,7 +470,7 @@ export type OpenAPI3Schema = Extensions & {
|
|
|
464
470
|
* order of the instance properties MAY be in any order.
|
|
465
471
|
*
|
|
466
472
|
*/
|
|
467
|
-
properties?: Record<string,
|
|
473
|
+
properties?: Record<string, Refable<OpenAPI3Schema>>;
|
|
468
474
|
/** indicates that additional unlisted properties can exist in this schema */
|
|
469
475
|
additionalProperties?: boolean | Refable<OpenAPI3Schema>;
|
|
470
476
|
/**
|
|
@@ -500,10 +506,12 @@ export type OpenAPI3ParameterBase = Extensions & {
|
|
|
500
506
|
deprecated?: boolean;
|
|
501
507
|
/** When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map. For other types of parameters this property has no effect. When style is form, the default value is true. For all other styles, the default value is false. */
|
|
502
508
|
explode?: boolean;
|
|
503
|
-
schema
|
|
509
|
+
schema?: Refable<OpenAPI3Schema>;
|
|
504
510
|
/** A free-form property to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary. */
|
|
505
511
|
example?: any;
|
|
506
512
|
examples?: Record<string, Refable<OpenAPI3Example>>;
|
|
513
|
+
/** A map containing the representations for the parameter. The key is the media type and the value describes it. The map MUST only contain one entry. */
|
|
514
|
+
content?: Record<string, OpenAPI3MediaType>;
|
|
507
515
|
};
|
|
508
516
|
export type OpenAPI3QueryParameter = OpenAPI3ParameterBase & {
|
|
509
517
|
/** Name of the parameter. */
|
|
@@ -513,7 +521,7 @@ export type OpenAPI3QueryParameter = OpenAPI3ParameterBase & {
|
|
|
513
521
|
* Describes how the parameter value will be serialized depending on the type of the parameter value.
|
|
514
522
|
*
|
|
515
523
|
* Default value for query parameters is form.
|
|
516
|
-
* @see https://
|
|
524
|
+
* @see https://spec.openapis.org/oas/v3.0.4.html#style-values
|
|
517
525
|
*/
|
|
518
526
|
style?: "form" | "spaceDelimited" | "pipeDelimited" | "deepObject";
|
|
519
527
|
};
|
|
@@ -525,7 +533,7 @@ export type OpenAPI3PathParameter = OpenAPI3ParameterBase & {
|
|
|
525
533
|
* Describes how the parameter value will be serialized depending on the type of the parameter value.
|
|
526
534
|
*
|
|
527
535
|
* Default value for path parameters is simple.
|
|
528
|
-
* @see https://
|
|
536
|
+
* @see https://spec.openapis.org/oas/v3.0.4.html#style-values
|
|
529
537
|
*/
|
|
530
538
|
style?: "simple" | "label" | "matrix";
|
|
531
539
|
};
|
|
@@ -537,11 +545,23 @@ export type OpenAPI3HeaderParameter = OpenAPI3ParameterBase & {
|
|
|
537
545
|
* Describes how the parameter value will be serialized depending on the type of the parameter value.
|
|
538
546
|
*
|
|
539
547
|
* Default value for header parameters is simple.
|
|
540
|
-
* @see https://
|
|
548
|
+
* @see https://spec.openapis.org/oas/v3.0.4.html#style-values
|
|
541
549
|
*/
|
|
542
550
|
style?: "simple";
|
|
543
551
|
};
|
|
544
|
-
export type
|
|
552
|
+
export type OpenAPI3CookieParameter = OpenAPI3ParameterBase & {
|
|
553
|
+
/** Name of the parameter. */
|
|
554
|
+
name: string;
|
|
555
|
+
in: "cookie";
|
|
556
|
+
/**
|
|
557
|
+
* Describes how the parameter value will be serialized depending on the type of the parameter value.
|
|
558
|
+
*
|
|
559
|
+
* Default value for header parameters is simple.
|
|
560
|
+
* @see https://spec.openapis.org/oas/v3.0.4.html#style-values
|
|
561
|
+
*/
|
|
562
|
+
style?: "form";
|
|
563
|
+
};
|
|
564
|
+
export type OpenAPI3Parameter = OpenAPI3HeaderParameter | OpenAPI3QueryParameter | OpenAPI3PathParameter | OpenAPI3CookieParameter;
|
|
545
565
|
export type OpenAPI3ParameterType = OpenAPI3Parameter["in"];
|
|
546
566
|
/**
|
|
547
567
|
* The Header Object follows the structure of the Parameter Object with the following changes:
|
|
@@ -550,7 +570,7 @@ export type OpenAPI3ParameterType = OpenAPI3Parameter["in"];
|
|
|
550
570
|
* in MUST NOT be specified, it is implicitly in header.
|
|
551
571
|
* All traits that are affected by the location MUST be applicable to a location of header (for example, style).
|
|
552
572
|
*
|
|
553
|
-
* @see https://
|
|
573
|
+
* @see https://spec.openapis.org/oas/v3.0.4.html#header-object
|
|
554
574
|
*/
|
|
555
575
|
export type OpenAPI3Header = OpenAPI3ParameterBase & {
|
|
556
576
|
/** Describes how the parameter value will be serialized depending on the type of the parameter value
|
|
@@ -562,7 +582,7 @@ export type OpenAPI3Header = OpenAPI3ParameterBase & {
|
|
|
562
582
|
export type OpenAPI3Operation = Extensions & {
|
|
563
583
|
description?: string;
|
|
564
584
|
summary?: string;
|
|
565
|
-
responses?:
|
|
585
|
+
responses?: Refable<OpenAPI3Responses>;
|
|
566
586
|
tags?: string[];
|
|
567
587
|
operationId?: string;
|
|
568
588
|
requestBody?: Refable<OpenAPI3RequestBody>;
|
|
@@ -932,4 +952,298 @@ export interface OpenAPIComponents3_1 extends Extensions {
|
|
|
932
952
|
callbacks?: Record<string, Record<string, OpenAPI3PathItem>>;
|
|
933
953
|
pathItems?: Record<string, OpenAPI3PathItem>;
|
|
934
954
|
}
|
|
955
|
+
export interface OpenAPIDocument3_2 extends Omit<OpenAPIDocument3_1, "openapi" | "servers" | "components" | "webhooks" | "paths" | "tags"> {
|
|
956
|
+
openapi: "3.2.0";
|
|
957
|
+
/**
|
|
958
|
+
* This string MUST be in the form of a URI reference as defined.
|
|
959
|
+
* The $self field provides the self-assigned URI of this document, which also serves as its base URI.
|
|
960
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#fixed-fields
|
|
961
|
+
*/
|
|
962
|
+
$self?: string;
|
|
963
|
+
/** The available paths and operations for the API */
|
|
964
|
+
paths: Record<string, OpenAPIPathItem3_2>;
|
|
965
|
+
/**
|
|
966
|
+
* The incoming webhooks that may be received as part of this API.
|
|
967
|
+
* The key name is a unique string to refer to each webhook.
|
|
968
|
+
*/
|
|
969
|
+
webhooks?: Record<string, OpenAPIPathItem3_2>;
|
|
970
|
+
/**
|
|
971
|
+
* An array of Server Objects, which provide connectivity information to a target server.
|
|
972
|
+
* If the servers property is not provided, or is an empty array, the default value would be a Server Object with a url value of /.
|
|
973
|
+
*/
|
|
974
|
+
servers?: OpenAPIServer3_2[];
|
|
975
|
+
/**
|
|
976
|
+
* A list of tags used by the specification with additional metadata.
|
|
977
|
+
* The order of the tags can be used to reflect on their order by the parsing tools.
|
|
978
|
+
* Not all tags that are used by the Operation Object must be declared.
|
|
979
|
+
* The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.
|
|
980
|
+
*/
|
|
981
|
+
tags?: OpenAPITag3_2[];
|
|
982
|
+
/** An element to hold various schemas for the specification. */
|
|
983
|
+
components?: OpenAPIComponents3_2;
|
|
984
|
+
}
|
|
985
|
+
export interface OpenAPIServer3_2 extends OpenAPI3Server {
|
|
986
|
+
/**
|
|
987
|
+
* An optional unique string to refer to the host designated by the URL.
|
|
988
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#fixed-fields-3
|
|
989
|
+
*/
|
|
990
|
+
name?: string;
|
|
991
|
+
}
|
|
992
|
+
export interface OpenAPIEncoding3_2 extends OpenAPI3Encoding {
|
|
993
|
+
/**
|
|
994
|
+
* Applies nested Encoding Objects in the same manner as the {@link OpenAPIMediaType3_2.encoding} field
|
|
995
|
+
* @see https://spec.openapis.org/oas/v3.2.0#common-fixed-fields-0
|
|
996
|
+
*/
|
|
997
|
+
encoding?: Record<string, OpenAPIEncoding3_2>;
|
|
998
|
+
/**
|
|
999
|
+
* Applies nested Encoding Objects in the same manner as the {@link OpenAPIMediaType3_2.prefixEncoding} field
|
|
1000
|
+
* @see https://spec.openapis.org/oas/v3.2.0#common-fixed-fields-0
|
|
1001
|
+
*/
|
|
1002
|
+
prefixEncoding?: OpenAPIEncoding3_2[];
|
|
1003
|
+
/**
|
|
1004
|
+
* Applies nested Encoding Objects in the same manner as the {@link OpenAPIMediaType3_2.itemEncoding} field
|
|
1005
|
+
* @see https://spec.openapis.org/oas/v3.2.0#common-fixed-fields-0
|
|
1006
|
+
*/
|
|
1007
|
+
itemEncoding?: OpenAPIEncoding3_2;
|
|
1008
|
+
}
|
|
1009
|
+
export interface OpenAPIMediaType3_2 extends Omit<OpenAPI3MediaType, "examples" | "schema"> {
|
|
1010
|
+
/** The schema defining the content of the request, response, or parameter. */
|
|
1011
|
+
schema?: Refable<OpenAPISchema3_2>;
|
|
1012
|
+
/**
|
|
1013
|
+
* The schema defining the structure of each item in a stream.
|
|
1014
|
+
* Used for streaming content types like text/event-stream.
|
|
1015
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#server-sent-event-streams
|
|
1016
|
+
*/
|
|
1017
|
+
itemSchema?: Refable<OpenAPISchema3_2>;
|
|
1018
|
+
/**
|
|
1019
|
+
* A map between a property name and its encoding information
|
|
1020
|
+
* @see https://spec.openapis.org/oas/v3.2.0#fixed-fields-11
|
|
1021
|
+
*/
|
|
1022
|
+
encoding?: Record<string, OpenAPIEncoding3_2>;
|
|
1023
|
+
/**
|
|
1024
|
+
* An array of positional encoding information
|
|
1025
|
+
* @see https://spec.openapis.org/oas/v3.2.0#fixed-fields-11
|
|
1026
|
+
*/
|
|
1027
|
+
prefixEncoding?: OpenAPIEncoding3_2[];
|
|
1028
|
+
/**
|
|
1029
|
+
* A single Encoding Object that provides encoding information for multiple array items
|
|
1030
|
+
* @see https://spec.openapis.org/oas/v3.2.0#fixed-fields-11
|
|
1031
|
+
*/
|
|
1032
|
+
itemEncoding?: OpenAPIEncoding3_2;
|
|
1033
|
+
/** Examples with title */
|
|
1034
|
+
examples?: Record<string, Refable<OpenAPIExample3_2>>;
|
|
1035
|
+
}
|
|
1036
|
+
export interface OpenAPIComponents3_2 extends Omit<OpenAPIComponents3_1, "responses" | "securitySchemes" | "examples" | "schemas" | "callbacks" | "pathItems" | "parameters" | "requestBodies"> {
|
|
1037
|
+
/**
|
|
1038
|
+
* An object to hold reusable {@link OpenAPIMediaType3_2} objects
|
|
1039
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#fixed-fields-5
|
|
1040
|
+
*/
|
|
1041
|
+
mediaTypes?: Record<string, Refable<OpenAPIMediaType3_2>>;
|
|
1042
|
+
/**
|
|
1043
|
+
* An object to hold reusable {@link OpenAPIResponse3_2} objects
|
|
1044
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#fixed-fields-5
|
|
1045
|
+
*/
|
|
1046
|
+
responses?: Record<string, Refable<OpenAPIResponse3_2>>;
|
|
1047
|
+
/**
|
|
1048
|
+
* An object to hold reusable {@link OpenAPISecurityScheme3_2} objects
|
|
1049
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#fixed-fields-5
|
|
1050
|
+
*/
|
|
1051
|
+
securitySchemes?: Record<string, Refable<OpenAPISecurityScheme3_2>>;
|
|
1052
|
+
/**
|
|
1053
|
+
* An object to hold reusable {@link OpenAPIRequestBody3_2} objects
|
|
1054
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#fixed-fields-5
|
|
1055
|
+
*/
|
|
1056
|
+
requestBodies?: Record<string, Refable<OpenAPIRequestBody3_2>>;
|
|
1057
|
+
/**
|
|
1058
|
+
* An object to hold reusable {@link OpenAPIExample3_2} objects
|
|
1059
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#fixed-fields-5
|
|
1060
|
+
*/
|
|
1061
|
+
examples?: Record<string, Refable<OpenAPIExample3_2>>;
|
|
1062
|
+
/**
|
|
1063
|
+
* An object to hold reusable {@link OpenAPISchema3_2} objects
|
|
1064
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#fixed-fields-5
|
|
1065
|
+
*/
|
|
1066
|
+
schemas?: Record<string, Refable<OpenAPISchema3_2>>;
|
|
1067
|
+
/**
|
|
1068
|
+
* An object to hold reusable {@link OpenAPIPathItem3_2} objects
|
|
1069
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#fixed-fields-5
|
|
1070
|
+
*/
|
|
1071
|
+
callbacks?: Record<string, Record<string, Refable<OpenAPIPathItem3_2>>>;
|
|
1072
|
+
/**
|
|
1073
|
+
* An object to hold reusable {@link OpenAPIPathItem3_2} objects
|
|
1074
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#fixed-fields-5
|
|
1075
|
+
*/
|
|
1076
|
+
pathItems?: Record<string, Refable<OpenAPIPathItem3_2>>;
|
|
1077
|
+
/**
|
|
1078
|
+
* An object to hold reusable {@link OpenAPIParameter3_2} objects
|
|
1079
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#fixed-fields-5
|
|
1080
|
+
*/
|
|
1081
|
+
parameters?: Record<string, Refable<OpenAPIParameter3_2>>;
|
|
1082
|
+
}
|
|
1083
|
+
export type OpenAPIResponses3_2 = {
|
|
1084
|
+
[status: OpenAPI3StatusCode]: Refable<OpenAPIResponse3_2>;
|
|
1085
|
+
} & Extensions;
|
|
1086
|
+
export interface OpenAPIResponse3_2 extends Omit<OpenAPI3Response, "content"> {
|
|
1087
|
+
/** A map containing descriptions of potential response payloads. The key is a media type or media type range and the value describes it. For responses that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/* */
|
|
1088
|
+
content?: Record<string, Refable<OpenAPIMediaType3_2>>;
|
|
1089
|
+
/**
|
|
1090
|
+
* A short summary of the meaning of the response.
|
|
1091
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#fixed-fields-14
|
|
1092
|
+
*/
|
|
1093
|
+
summary?: string;
|
|
1094
|
+
}
|
|
1095
|
+
export interface OpenAPISecuritySchemeBase3_2 extends OpenAPI3SecuritySchemeBase {
|
|
1096
|
+
/**
|
|
1097
|
+
* Specifies that a security scheme is deprecated and SHOULD be transitioned out of usage.
|
|
1098
|
+
*
|
|
1099
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#security-scheme-object
|
|
1100
|
+
*/
|
|
1101
|
+
deprecated?: boolean;
|
|
1102
|
+
}
|
|
1103
|
+
export interface OpenAPIApiKeySecurityScheme3_2 extends OpenAPISecuritySchemeBase3_2, OpenAPI3ApiKeySecurityScheme {
|
|
1104
|
+
}
|
|
1105
|
+
export interface OpenAPIOAuth2SecurityScheme3_2 extends OpenAPISecuritySchemeBase3_2, Omit<OpenAPI3OAuth2SecurityScheme, "flows"> {
|
|
1106
|
+
/** An object containing configuration information for the flow types supported. */
|
|
1107
|
+
flows: OpenAPIOAuthFlows3_2;
|
|
1108
|
+
}
|
|
1109
|
+
export interface OpenAPIOpenIdConnectSecurityScheme3_2 extends OpenAPISecuritySchemeBase3_2, OpenAPI3OpenIdConnectSecurityScheme {
|
|
1110
|
+
}
|
|
1111
|
+
export interface OpenAPIHttpSecurityScheme3_2 extends OpenAPISecuritySchemeBase3_2, OpenAPI3HttpSecurityScheme {
|
|
1112
|
+
}
|
|
1113
|
+
export type OpenAPISecurityScheme3_2 = OpenAPIApiKeySecurityScheme3_2 | OpenAPIOAuth2SecurityScheme3_2 | OpenAPIOpenIdConnectSecurityScheme3_2 | OpenAPIHttpSecurityScheme3_2;
|
|
1114
|
+
/** Configuration for the OAuth Client Credentials flow. Previously called application in OpenAPI 2.0. */
|
|
1115
|
+
export interface OpenAPIDeviceAuthorizationFlow3_2 extends OpenAPI3OAuth2Flow {
|
|
1116
|
+
/** The token URL to be used for this flow. This MUST be in the form of a URL. */
|
|
1117
|
+
tokenUrl: string;
|
|
1118
|
+
/**
|
|
1119
|
+
* The device authorization URL to be used for this flow. This MUST be in the form of a URL.
|
|
1120
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#oauth-flow-object
|
|
1121
|
+
*/
|
|
1122
|
+
deviceAuthorizationUrl: string;
|
|
1123
|
+
}
|
|
1124
|
+
/**
|
|
1125
|
+
* Allows configuration of the supported OAuth Flows.
|
|
1126
|
+
*
|
|
1127
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#oauthFlowsObject
|
|
1128
|
+
*/
|
|
1129
|
+
export interface OpenAPIOAuthFlows3_2 extends OpenAPI3OAuthFlows {
|
|
1130
|
+
/**
|
|
1131
|
+
* Configuration for the OAuth 2.0 Device Authorization Grant flow.
|
|
1132
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#oauth-flows-object
|
|
1133
|
+
*/
|
|
1134
|
+
deviceAuthorization?: OpenAPIDeviceAuthorizationFlow3_2;
|
|
1135
|
+
}
|
|
1136
|
+
/**
|
|
1137
|
+
* Allows sharing examples for operation responses.
|
|
1138
|
+
*
|
|
1139
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#example-object
|
|
1140
|
+
*/
|
|
1141
|
+
export interface OpenAPIExample3_2 extends OpenAPI3Example {
|
|
1142
|
+
/**
|
|
1143
|
+
* An example of the data structure that MUST be valid according to the relevant schema.
|
|
1144
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#example-object
|
|
1145
|
+
*/
|
|
1146
|
+
dataValue?: unknown;
|
|
1147
|
+
/**
|
|
1148
|
+
* An example of the serialized form of the value, including encoding and escaping
|
|
1149
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#example-object
|
|
1150
|
+
*/
|
|
1151
|
+
serializedValue?: string;
|
|
1152
|
+
}
|
|
1153
|
+
export type OpenAPISchema3_2 = JsonSchema<{
|
|
1154
|
+
/**
|
|
1155
|
+
* Adds additional metadata to describe the XML representation of this property.
|
|
1156
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#fixed-fields-20
|
|
1157
|
+
*/
|
|
1158
|
+
xml?: OpenAPIXmlSchema3_2;
|
|
1159
|
+
/**
|
|
1160
|
+
*
|
|
1161
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#fixed-fields-20
|
|
1162
|
+
*/
|
|
1163
|
+
discriminator?: OpenAPIDiscriminator3_2;
|
|
1164
|
+
/**
|
|
1165
|
+
* Additional external documentation for this schema.
|
|
1166
|
+
*
|
|
1167
|
+
* @see https://spec.openapis.org/oas/v3.1.1.html#external-documentation-object
|
|
1168
|
+
*/
|
|
1169
|
+
externalDocs?: OpenAPI3ExternalDocs;
|
|
1170
|
+
} & Extensions>;
|
|
1171
|
+
export interface OpenAPIXmlSchema3_2 extends Omit<OpenAPI3XmlSchema, "attribute" | "wrapped"> {
|
|
1172
|
+
/**
|
|
1173
|
+
* @deprecated This property is deprecated and SHOULD be replaced by the {@link nodeType} property.
|
|
1174
|
+
*/
|
|
1175
|
+
attribute?: boolean;
|
|
1176
|
+
/**
|
|
1177
|
+
* @deprecated This property is deprecated and SHOULD be replaced by the {@link nodeType} property.
|
|
1178
|
+
*/
|
|
1179
|
+
wrapped?: boolean;
|
|
1180
|
+
/**
|
|
1181
|
+
* The type of the XML DOM node.
|
|
1182
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#xml-node-types
|
|
1183
|
+
* @default "none"
|
|
1184
|
+
*/
|
|
1185
|
+
nodeType?: "element" | "attribute" | "text" | "cdata" | "comment" | "none";
|
|
1186
|
+
}
|
|
1187
|
+
export type OpenAPIOperation3_2 = Omit<OpenAPI3Operation, "responses" | "parameters" | "requestBody"> & {
|
|
1188
|
+
responses?: Refable<OpenAPIResponses3_2>;
|
|
1189
|
+
parameters?: Refable<OpenAPIParameter3_2>[];
|
|
1190
|
+
requestBody?: Refable<OpenAPIRequestBody3_2>;
|
|
1191
|
+
};
|
|
1192
|
+
/**
|
|
1193
|
+
* Describes the operations available on a single path. A Path Item may be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.
|
|
1194
|
+
*
|
|
1195
|
+
* @see https://spec.openapis.org/oas/v3.2.0.html#fixed-fields-6
|
|
1196
|
+
*/
|
|
1197
|
+
export type OpenAPIPathItem3_2 = Omit<OpenAPI3PathItem, OpenAPI3HttpMethod | "parameters"> & {
|
|
1198
|
+
[method in OpenAPIHttpMethod3_2]?: OpenAPIOperation3_2;
|
|
1199
|
+
} & {
|
|
1200
|
+
additionalOperations?: Record<string, OpenAPIOperation3_2>;
|
|
1201
|
+
parameters?: Refable<OpenAPIParameter3_2>[];
|
|
1202
|
+
};
|
|
1203
|
+
export type OpenAPIParameterBase3_2 = Omit<OpenAPI3ParameterBase, "content" | "examples" | "schema"> & {
|
|
1204
|
+
/** A map containing the representations for the parameter. The key is the media type and the value describes it. The map MUST only contain one entry. */
|
|
1205
|
+
content?: Record<string, Refable<OpenAPIMediaType3_2>>;
|
|
1206
|
+
examples?: Record<string, Refable<OpenAPIExample3_2>>;
|
|
1207
|
+
schema?: Refable<OpenAPISchema3_2>;
|
|
1208
|
+
};
|
|
1209
|
+
export type OpenAPIQueryStringParameter3_2 = Omit<OpenAPIParameterBase3_2, "style" | "explode" | "allowReserved" | "schema"> & {
|
|
1210
|
+
/** Name of the parameter. */
|
|
1211
|
+
name: string;
|
|
1212
|
+
in: "querystring";
|
|
1213
|
+
};
|
|
1214
|
+
export type OpenAPICookieParameter3_2 = Omit<OpenAPI3CookieParameter, "content" | "examples" | "style"> & OpenAPIParameterBase3_2 & {
|
|
1215
|
+
/**
|
|
1216
|
+
* Describes how the parameter value will be serialized depending on the type of the parameter value.
|
|
1217
|
+
*
|
|
1218
|
+
* Default value for header parameters is simple.
|
|
1219
|
+
* @see https://spec.openapis.org/oas/latest#fixed-fields-9
|
|
1220
|
+
*/
|
|
1221
|
+
style?: "form" | "cookie";
|
|
1222
|
+
};
|
|
1223
|
+
export type OpenAPIHeaderParameter3_2 = Omit<OpenAPI3HeaderParameter, "content" | "examples"> & OpenAPIParameterBase3_2;
|
|
1224
|
+
export type OpenAPIPathParameter3_2 = Omit<OpenAPI3PathParameter, "content" | "examples"> & OpenAPIParameterBase3_2;
|
|
1225
|
+
export type OpenAPIQueryParameter3_2 = Omit<OpenAPI3QueryParameter, "content" | "examples"> & OpenAPIParameterBase3_2;
|
|
1226
|
+
export type OpenAPIParameter3_2 = OpenAPIHeaderParameter3_2 | OpenAPIQueryParameter3_2 | OpenAPIQueryStringParameter3_2 | OpenAPIPathParameter3_2 | OpenAPICookieParameter3_2;
|
|
1227
|
+
export type OpenAPIParameterType3_2 = OpenAPIParameter3_2["in"];
|
|
1228
|
+
export interface OpenAPITag3_2 extends OpenAPI3Tag {
|
|
1229
|
+
/**
|
|
1230
|
+
* A short summary of the tag, used for display purposes.
|
|
1231
|
+
* @see https://spec.openapis.org/oas/latest#fixed-fields-18
|
|
1232
|
+
*/
|
|
1233
|
+
summary?: string;
|
|
1234
|
+
/**
|
|
1235
|
+
* The name of a tag that this tag is nested under. The named tag MUST exist in the API description, and circular references between parent and child tags MUST NOT be used.
|
|
1236
|
+
* @see https://spec.openapis.org/oas/latest#fixed-fields-18
|
|
1237
|
+
*/
|
|
1238
|
+
parent?: string;
|
|
1239
|
+
/**
|
|
1240
|
+
* A machine-readable string to categorize what sort of tag it is
|
|
1241
|
+
* @see https://spec.openapis.org/oas/latest#fixed-fields-18
|
|
1242
|
+
*/
|
|
1243
|
+
kind?: string;
|
|
1244
|
+
}
|
|
1245
|
+
export interface OpenAPIRequestBody3_2 extends Omit<OpenAPI3RequestBody, "content"> {
|
|
1246
|
+
/** A map containing descriptions of potential request payloads. The key is a media type or media type range and the value describes it. For requests that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/* */
|
|
1247
|
+
content: Record<string, Refable<OpenAPIMediaType3_2>>;
|
|
1248
|
+
}
|
|
935
1249
|
//# sourceMappingURL=types.d.ts.map
|