@extk/expressive 0.5.1 → 0.5.3
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/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +20 -2
- package/dist/index.mjs +20 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -232,6 +232,7 @@ declare class SwaggerBuilder {
|
|
|
232
232
|
withDefaultSecurity(globalAuthMethods: AuthMethod[]): this;
|
|
233
233
|
get(): SwaggerConfig;
|
|
234
234
|
}
|
|
235
|
+
declare function formDataSchema(schema: Schema): Content;
|
|
235
236
|
declare function jsonSchema(schema: Schema): Content;
|
|
236
237
|
declare function jsonSchemaRef(name: string): Content;
|
|
237
238
|
declare function param(inP: Param['in'], id: string, schema: Schema, required?: boolean, description?: string, name?: string): Param;
|
|
@@ -243,6 +244,7 @@ declare const SWG: {
|
|
|
243
244
|
pathParam: typeof pathParam;
|
|
244
245
|
queryParam: typeof queryParam;
|
|
245
246
|
headerParam: typeof headerParam;
|
|
247
|
+
formDataSchema: typeof formDataSchema;
|
|
246
248
|
jsonSchema: typeof jsonSchema;
|
|
247
249
|
jsonSchemaRef: typeof jsonSchemaRef;
|
|
248
250
|
security: (name: string) => AuthMethod;
|
package/dist/index.d.ts
CHANGED
|
@@ -232,6 +232,7 @@ declare class SwaggerBuilder {
|
|
|
232
232
|
withDefaultSecurity(globalAuthMethods: AuthMethod[]): this;
|
|
233
233
|
get(): SwaggerConfig;
|
|
234
234
|
}
|
|
235
|
+
declare function formDataSchema(schema: Schema): Content;
|
|
235
236
|
declare function jsonSchema(schema: Schema): Content;
|
|
236
237
|
declare function jsonSchemaRef(name: string): Content;
|
|
237
238
|
declare function param(inP: Param['in'], id: string, schema: Schema, required?: boolean, description?: string, name?: string): Param;
|
|
@@ -243,6 +244,7 @@ declare const SWG: {
|
|
|
243
244
|
pathParam: typeof pathParam;
|
|
244
245
|
queryParam: typeof queryParam;
|
|
245
246
|
headerParam: typeof headerParam;
|
|
247
|
+
formDataSchema: typeof formDataSchema;
|
|
246
248
|
jsonSchema: typeof jsonSchema;
|
|
247
249
|
jsonSchemaRef: typeof jsonSchemaRef;
|
|
248
250
|
security: (name: string) => AuthMethod;
|
package/dist/index.js
CHANGED
|
@@ -131,6 +131,15 @@ var security = (name) => {
|
|
|
131
131
|
}
|
|
132
132
|
return securityRegistry[name];
|
|
133
133
|
};
|
|
134
|
+
function formDataSchema(schema) {
|
|
135
|
+
return {
|
|
136
|
+
content: {
|
|
137
|
+
"multipart/form-data": {
|
|
138
|
+
schema
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
}
|
|
134
143
|
function jsonSchema(schema) {
|
|
135
144
|
return {
|
|
136
145
|
content: {
|
|
@@ -176,6 +185,7 @@ var SWG = {
|
|
|
176
185
|
pathParam,
|
|
177
186
|
queryParam,
|
|
178
187
|
headerParam,
|
|
188
|
+
formDataSchema,
|
|
179
189
|
jsonSchema,
|
|
180
190
|
jsonSchemaRef,
|
|
181
191
|
security,
|
|
@@ -244,8 +254,16 @@ function buildExpressive(container, swaggerDoc) {
|
|
|
244
254
|
const route = pathOverride ?? convertExpressPath(context.path);
|
|
245
255
|
const pathItem = {
|
|
246
256
|
// -- defaults --
|
|
247
|
-
responses: {
|
|
248
|
-
|
|
257
|
+
responses: {
|
|
258
|
+
// has to be defined or else responses are not documented... ¯\_(ツ)_/¯
|
|
259
|
+
"200": { description: "OK" },
|
|
260
|
+
"201": { description: "Created" },
|
|
261
|
+
"204": { description: "No Content" },
|
|
262
|
+
"400": { description: "Bad Request" },
|
|
263
|
+
"401": { description: "User Unauthorized" },
|
|
264
|
+
"403": { description: "Forbidden" },
|
|
265
|
+
"500": { description: "Internal Server Error" }
|
|
266
|
+
},
|
|
249
267
|
// -- group defaults --
|
|
250
268
|
...configs?.oapi || {},
|
|
251
269
|
// -- overrides --
|
package/dist/index.mjs
CHANGED
|
@@ -70,6 +70,15 @@ var security = (name) => {
|
|
|
70
70
|
}
|
|
71
71
|
return securityRegistry[name];
|
|
72
72
|
};
|
|
73
|
+
function formDataSchema(schema) {
|
|
74
|
+
return {
|
|
75
|
+
content: {
|
|
76
|
+
"multipart/form-data": {
|
|
77
|
+
schema
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
73
82
|
function jsonSchema(schema) {
|
|
74
83
|
return {
|
|
75
84
|
content: {
|
|
@@ -115,6 +124,7 @@ var SWG = {
|
|
|
115
124
|
pathParam,
|
|
116
125
|
queryParam,
|
|
117
126
|
headerParam,
|
|
127
|
+
formDataSchema,
|
|
118
128
|
jsonSchema,
|
|
119
129
|
jsonSchemaRef,
|
|
120
130
|
security,
|
|
@@ -183,8 +193,16 @@ function buildExpressive(container, swaggerDoc) {
|
|
|
183
193
|
const route = pathOverride ?? convertExpressPath(context.path);
|
|
184
194
|
const pathItem = {
|
|
185
195
|
// -- defaults --
|
|
186
|
-
responses: {
|
|
187
|
-
|
|
196
|
+
responses: {
|
|
197
|
+
// has to be defined or else responses are not documented... ¯\_(ツ)_/¯
|
|
198
|
+
"200": { description: "OK" },
|
|
199
|
+
"201": { description: "Created" },
|
|
200
|
+
"204": { description: "No Content" },
|
|
201
|
+
"400": { description: "Bad Request" },
|
|
202
|
+
"401": { description: "User Unauthorized" },
|
|
203
|
+
"403": { description: "Forbidden" },
|
|
204
|
+
"500": { description: "Internal Server Error" }
|
|
205
|
+
},
|
|
188
206
|
// -- group defaults --
|
|
189
207
|
...configs?.oapi || {},
|
|
190
208
|
// -- overrides --
|