@furystack/rest 8.0.21 → 8.0.23
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/api-endpoint-schema.d.ts +43 -0
- package/esm/api-endpoint-schema.d.ts.map +1 -0
- package/esm/api-endpoint-schema.js +2 -0
- package/esm/api-endpoint-schema.js.map +1 -0
- package/esm/index.d.ts +4 -2
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +4 -2
- package/esm/index.js.map +1 -1
- package/esm/rest-api.d.ts +19 -0
- package/esm/rest-api.d.ts.map +1 -1
- package/esm/swagger-document.d.ts +196 -0
- package/esm/swagger-document.d.ts.map +1 -0
- package/esm/swagger-document.js +2 -0
- package/esm/swagger-document.js.map +1 -0
- package/package.json +4 -4
- package/src/api-endpoint-schema.ts +45 -0
- package/src/index.ts +4 -2
- package/src/rest-api.ts +13 -0
- package/src/swagger-document.schema.json +1263 -0
- package/src/swagger-document.ts +220 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
export type SwaggerDocument = {
|
|
2
|
+
openapi: string
|
|
3
|
+
info: InfoObject
|
|
4
|
+
jsonSchemaDialect?: string
|
|
5
|
+
externalDocs?: ExternalDocumentationObject
|
|
6
|
+
servers?: ServerObject[]
|
|
7
|
+
tags?: TagObject[]
|
|
8
|
+
security?: SecurityRequirementObject[]
|
|
9
|
+
paths?: Record<string, PathItem>
|
|
10
|
+
webhooks?: Record<string, PathItem>
|
|
11
|
+
components?: ComponentsObject
|
|
12
|
+
[key: `x-${string}`]: unknown
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type InfoObject = {
|
|
16
|
+
title: string
|
|
17
|
+
version: string
|
|
18
|
+
description?: string
|
|
19
|
+
summary?: string
|
|
20
|
+
termsOfService?: string
|
|
21
|
+
contact?: ContactObject
|
|
22
|
+
license?: LicenseObject
|
|
23
|
+
[key: `x-${string}`]: unknown
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type ContactObject = {
|
|
27
|
+
name?: string
|
|
28
|
+
url?: string
|
|
29
|
+
email?: string
|
|
30
|
+
[key: `x-${string}`]: unknown
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type LicenseObject = {
|
|
34
|
+
name: string
|
|
35
|
+
identifier?: string
|
|
36
|
+
url?: string
|
|
37
|
+
[key: `x-${string}`]: unknown
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type ExternalDocumentationObject = {
|
|
41
|
+
url: string
|
|
42
|
+
description?: string
|
|
43
|
+
[key: `x-${string}`]: unknown
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type ServerObject = {
|
|
47
|
+
url: string
|
|
48
|
+
description?: string
|
|
49
|
+
variables?: Record<string, ServerVariableObject>
|
|
50
|
+
[key: `x-${string}`]: unknown
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type ServerVariableObject = {
|
|
54
|
+
default: string
|
|
55
|
+
description?: string
|
|
56
|
+
enum?: string[]
|
|
57
|
+
[key: `x-${string}`]: unknown
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type TagObject = {
|
|
61
|
+
name: string
|
|
62
|
+
description?: string
|
|
63
|
+
externalDocs?: ExternalDocumentationObject
|
|
64
|
+
[key: `x-${string}`]: unknown
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export type SecurityRequirementObject = Record<string, string[]>
|
|
68
|
+
|
|
69
|
+
export type ComponentsObject = {
|
|
70
|
+
schemas?: Record<string, object | boolean>
|
|
71
|
+
responses?: Record<string, ResponseObject | ReferenceObject>
|
|
72
|
+
parameters?: Record<string, ParameterObject | ReferenceObject>
|
|
73
|
+
examples?: Record<string, ExampleObject | ReferenceObject>
|
|
74
|
+
requestBodies?: Record<string, RequestBodyObject | ReferenceObject>
|
|
75
|
+
headers?: Record<string, HeaderObject | ReferenceObject>
|
|
76
|
+
securitySchemes?: Record<string, SecuritySchemeObject | ReferenceObject>
|
|
77
|
+
links?: Record<string, LinkObject | ReferenceObject>
|
|
78
|
+
callbacks?: Record<string, CallbackObject | ReferenceObject>
|
|
79
|
+
pathItems?: Record<string, PathItem | ReferenceObject>
|
|
80
|
+
[key: `x-${string}`]: unknown
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type ReferenceObject = {
|
|
84
|
+
$ref: string
|
|
85
|
+
description?: string
|
|
86
|
+
summary?: string
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type PathItem = {
|
|
90
|
+
summary?: string
|
|
91
|
+
description?: string
|
|
92
|
+
get?: Operation
|
|
93
|
+
put?: Operation
|
|
94
|
+
post?: Operation
|
|
95
|
+
delete?: Operation
|
|
96
|
+
options?: Operation
|
|
97
|
+
head?: Operation
|
|
98
|
+
patch?: Operation
|
|
99
|
+
trace?: Operation
|
|
100
|
+
servers?: ServerObject[]
|
|
101
|
+
parameters?: Array<ParameterObject | ReferenceObject>
|
|
102
|
+
[key: `x-${string}`]: unknown
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export type Operation = {
|
|
106
|
+
tags?: string[]
|
|
107
|
+
summary?: string
|
|
108
|
+
description?: string
|
|
109
|
+
externalDocs?: ExternalDocumentationObject
|
|
110
|
+
operationId?: string
|
|
111
|
+
parameters?: Array<ParameterObject | ReferenceObject>
|
|
112
|
+
requestBody?: RequestBodyObject | ReferenceObject
|
|
113
|
+
responses: ResponsesObject
|
|
114
|
+
callbacks?: Record<string, CallbackObject | ReferenceObject>
|
|
115
|
+
deprecated?: boolean
|
|
116
|
+
security?: SecurityRequirementObject[]
|
|
117
|
+
servers?: ServerObject[]
|
|
118
|
+
[key: `x-${string}`]: unknown
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export type ParameterObject = {
|
|
122
|
+
name: string
|
|
123
|
+
in: 'query' | 'header' | 'path' | 'cookie'
|
|
124
|
+
description?: string
|
|
125
|
+
required?: boolean
|
|
126
|
+
deprecated?: boolean
|
|
127
|
+
allowEmptyValue?: boolean
|
|
128
|
+
style?: string
|
|
129
|
+
explode?: boolean
|
|
130
|
+
allowReserved?: boolean
|
|
131
|
+
schema?: object | boolean
|
|
132
|
+
example?: unknown
|
|
133
|
+
examples?: Record<string, ExampleObject | ReferenceObject>
|
|
134
|
+
content?: Record<string, MediaTypeObject>
|
|
135
|
+
[key: `x-${string}`]: unknown
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export type RequestBodyObject = {
|
|
139
|
+
description?: string
|
|
140
|
+
content: Record<string, MediaTypeObject>
|
|
141
|
+
required?: boolean
|
|
142
|
+
[key: `x-${string}`]: unknown
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export type MediaTypeObject = {
|
|
146
|
+
schema?: object | boolean
|
|
147
|
+
example?: unknown
|
|
148
|
+
examples?: Record<string, ExampleObject | ReferenceObject>
|
|
149
|
+
encoding?: Record<string, EncodingObject>
|
|
150
|
+
[key: `x-${string}`]: unknown
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export type EncodingObject = {
|
|
154
|
+
contentType?: string
|
|
155
|
+
headers?: Record<string, HeaderObject | ReferenceObject>
|
|
156
|
+
style?: string
|
|
157
|
+
explode?: boolean
|
|
158
|
+
allowReserved?: boolean
|
|
159
|
+
[key: `x-${string}`]: unknown
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export type ResponsesObject = Record<string, ResponseObject | ReferenceObject>
|
|
163
|
+
|
|
164
|
+
export type ResponseObject = {
|
|
165
|
+
description: string
|
|
166
|
+
headers?: Record<string, HeaderObject | ReferenceObject>
|
|
167
|
+
content?: Record<string, MediaTypeObject>
|
|
168
|
+
links?: Record<string, LinkObject | ReferenceObject>
|
|
169
|
+
[key: `x-${string}`]: unknown
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export type HeaderObject = Omit<ParameterObject, 'name' | 'in'>
|
|
173
|
+
|
|
174
|
+
export type ExampleObject = {
|
|
175
|
+
summary?: string
|
|
176
|
+
description?: string
|
|
177
|
+
value?: unknown
|
|
178
|
+
externalValue?: string
|
|
179
|
+
[key: `x-${string}`]: unknown
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export type LinkObject = {
|
|
183
|
+
operationRef?: string
|
|
184
|
+
operationId?: string
|
|
185
|
+
parameters?: Record<string, unknown>
|
|
186
|
+
requestBody?: unknown
|
|
187
|
+
description?: string
|
|
188
|
+
server?: ServerObject
|
|
189
|
+
[key: `x-${string}`]: unknown
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export type CallbackObject = Record<string, PathItem>
|
|
193
|
+
|
|
194
|
+
export type SecuritySchemeObject = {
|
|
195
|
+
type: 'apiKey' | 'http' | 'mutualTLS' | 'oauth2' | 'openIdConnect'
|
|
196
|
+
description?: string
|
|
197
|
+
name?: string
|
|
198
|
+
in?: 'query' | 'header' | 'cookie'
|
|
199
|
+
scheme?: string
|
|
200
|
+
bearerFormat?: string
|
|
201
|
+
flows?: OAuthFlowsObject
|
|
202
|
+
openIdConnectUrl?: string
|
|
203
|
+
[key: `x-${string}`]: unknown
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export type OAuthFlowsObject = {
|
|
207
|
+
implicit?: OAuthFlowObject
|
|
208
|
+
password?: OAuthFlowObject
|
|
209
|
+
clientCredentials?: OAuthFlowObject
|
|
210
|
+
authorizationCode?: OAuthFlowObject
|
|
211
|
+
[key: `x-${string}`]: unknown
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export type OAuthFlowObject = {
|
|
215
|
+
authorizationUrl?: string
|
|
216
|
+
tokenUrl?: string
|
|
217
|
+
refreshUrl?: string
|
|
218
|
+
scopes: Record<string, string>
|
|
219
|
+
[key: `x-${string}`]: unknown
|
|
220
|
+
}
|