@extk/expressive 0.3.0 → 0.3.1
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 +108 -16
- package/dist/index.d.ts +108 -16
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -269,29 +269,121 @@ declare function bootstrap(container: Container): {
|
|
|
269
269
|
silently: (fn: () => Promise<void>, reqSnapshot?: ReqSnapshot) => void;
|
|
270
270
|
getErrorHandlerMiddleware: (errorMapper?: (err: Error & Record<string, unknown>) => ApiError | null | undefined) => (err: Error & Record<string, unknown>, req: express.Request, res: express.Response, _next: express.NextFunction) => Promise<void>;
|
|
271
271
|
swaggerBuilder: () => {
|
|
272
|
-
withInfo(info: SwaggerConfig["info"])
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
272
|
+
readonly withInfo: (info: SwaggerConfig["info"]) => {
|
|
273
|
+
readonly withInfo: /*elided*/ any;
|
|
274
|
+
readonly withServers: (servers: Servers) => /*elided*/ any;
|
|
275
|
+
readonly withSecuritySchemes: (schemes: Record<string, SecurityScheme>) => /*elided*/ any;
|
|
276
|
+
readonly withSchemas: (schemas: Record<string, Schema>) => /*elided*/ any;
|
|
277
|
+
readonly withDefaultSecurity: (globalAuthMethods: AuthMethod[]) => /*elided*/ any;
|
|
278
|
+
readonly get: () => SwaggerConfig;
|
|
279
|
+
};
|
|
280
|
+
readonly withServers: (servers: Servers) => {
|
|
281
|
+
readonly withInfo: (info: SwaggerConfig["info"]) => /*elided*/ any;
|
|
282
|
+
readonly withServers: /*elided*/ any;
|
|
283
|
+
readonly withSecuritySchemes: (schemes: Record<string, SecurityScheme>) => /*elided*/ any;
|
|
284
|
+
readonly withSchemas: (schemas: Record<string, Schema>) => /*elided*/ any;
|
|
285
|
+
readonly withDefaultSecurity: (globalAuthMethods: AuthMethod[]) => /*elided*/ any;
|
|
286
|
+
readonly get: () => SwaggerConfig;
|
|
287
|
+
};
|
|
288
|
+
readonly withSecuritySchemes: (schemes: Record<string, SecurityScheme>) => {
|
|
289
|
+
readonly withInfo: (info: SwaggerConfig["info"]) => /*elided*/ any;
|
|
290
|
+
readonly withServers: (servers: Servers) => /*elided*/ any;
|
|
291
|
+
readonly withSecuritySchemes: /*elided*/ any;
|
|
292
|
+
readonly withSchemas: (schemas: Record<string, Schema>) => /*elided*/ any;
|
|
293
|
+
readonly withDefaultSecurity: (globalAuthMethods: AuthMethod[]) => /*elided*/ any;
|
|
294
|
+
readonly get: () => SwaggerConfig;
|
|
295
|
+
};
|
|
296
|
+
readonly withSchemas: (schemas: Record<string, Schema>) => {
|
|
297
|
+
readonly withInfo: (info: SwaggerConfig["info"]) => /*elided*/ any;
|
|
298
|
+
readonly withServers: (servers: Servers) => /*elided*/ any;
|
|
299
|
+
readonly withSecuritySchemes: (schemes: Record<string, SecurityScheme>) => /*elided*/ any;
|
|
300
|
+
readonly withSchemas: /*elided*/ any;
|
|
301
|
+
readonly withDefaultSecurity: (globalAuthMethods: AuthMethod[]) => /*elided*/ any;
|
|
302
|
+
readonly get: () => SwaggerConfig;
|
|
303
|
+
};
|
|
304
|
+
readonly withDefaultSecurity: (globalAuthMethods: AuthMethod[]) => {
|
|
305
|
+
readonly withInfo: (info: SwaggerConfig["info"]) => /*elided*/ any;
|
|
306
|
+
readonly withServers: (servers: Servers) => /*elided*/ any;
|
|
307
|
+
readonly withSecuritySchemes: (schemes: Record<string, SecurityScheme>) => /*elided*/ any;
|
|
308
|
+
readonly withSchemas: (schemas: Record<string, Schema>) => /*elided*/ any;
|
|
309
|
+
readonly withDefaultSecurity: /*elided*/ any;
|
|
310
|
+
readonly get: () => SwaggerConfig;
|
|
311
|
+
};
|
|
312
|
+
readonly get: () => SwaggerConfig;
|
|
278
313
|
};
|
|
279
|
-
expressiveServer(configs
|
|
314
|
+
expressiveServer(configs?: {
|
|
280
315
|
app?: express.Express;
|
|
281
316
|
}): {
|
|
282
|
-
get()
|
|
283
|
-
withHelmet(options?: Readonly<helmet.HelmetOptions>)
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
317
|
+
readonly get: () => express.Express;
|
|
318
|
+
readonly withHelmet: (options?: Readonly<helmet.HelmetOptions>) => {
|
|
319
|
+
readonly get: () => express.Express;
|
|
320
|
+
readonly withHelmet: /*elided*/ any;
|
|
321
|
+
readonly withQs: () => /*elided*/ any;
|
|
322
|
+
readonly withMorgan: (format?: string, options?: Parameters<typeof morgan>[1]) => /*elided*/ any;
|
|
323
|
+
readonly withSwagger: (swagger: {
|
|
324
|
+
path?: ExpressRoute;
|
|
325
|
+
doc: SwaggerConfig;
|
|
326
|
+
}, ...handlers: ExpressHandler[]) => /*elided*/ any;
|
|
327
|
+
readonly defaults: {
|
|
328
|
+
readonly get: (swagger: {
|
|
329
|
+
path?: ExpressRoute;
|
|
330
|
+
doc: SwaggerConfig;
|
|
331
|
+
}) => express.Express;
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
readonly withQs: () => {
|
|
335
|
+
readonly get: () => express.Express;
|
|
336
|
+
readonly withHelmet: (options?: Readonly<helmet.HelmetOptions>) => /*elided*/ any;
|
|
337
|
+
readonly withQs: /*elided*/ any;
|
|
338
|
+
readonly withMorgan: (format?: string, options?: Parameters<typeof morgan>[1]) => /*elided*/ any;
|
|
339
|
+
readonly withSwagger: (swagger: {
|
|
340
|
+
path?: ExpressRoute;
|
|
341
|
+
doc: SwaggerConfig;
|
|
342
|
+
}, ...handlers: ExpressHandler[]) => /*elided*/ any;
|
|
343
|
+
readonly defaults: {
|
|
344
|
+
readonly get: (swagger: {
|
|
345
|
+
path?: ExpressRoute;
|
|
346
|
+
doc: SwaggerConfig;
|
|
347
|
+
}) => express.Express;
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
readonly withMorgan: (format?: string, options?: Parameters<typeof morgan>[1]) => {
|
|
351
|
+
readonly get: () => express.Express;
|
|
352
|
+
readonly withHelmet: (options?: Readonly<helmet.HelmetOptions>) => /*elided*/ any;
|
|
353
|
+
readonly withQs: () => /*elided*/ any;
|
|
354
|
+
readonly withMorgan: /*elided*/ any;
|
|
355
|
+
readonly withSwagger: (swagger: {
|
|
356
|
+
path?: ExpressRoute;
|
|
357
|
+
doc: SwaggerConfig;
|
|
358
|
+
}, ...handlers: ExpressHandler[]) => /*elided*/ any;
|
|
359
|
+
readonly defaults: {
|
|
360
|
+
readonly get: (swagger: {
|
|
361
|
+
path?: ExpressRoute;
|
|
362
|
+
doc: SwaggerConfig;
|
|
363
|
+
}) => express.Express;
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
readonly withSwagger: (swagger: {
|
|
287
367
|
path?: ExpressRoute;
|
|
288
368
|
doc: SwaggerConfig;
|
|
289
|
-
}, ...handlers: ExpressHandler[])
|
|
290
|
-
|
|
291
|
-
|
|
369
|
+
}, ...handlers: ExpressHandler[]) => {
|
|
370
|
+
readonly get: () => express.Express;
|
|
371
|
+
readonly withHelmet: (options?: Readonly<helmet.HelmetOptions>) => /*elided*/ any;
|
|
372
|
+
readonly withQs: () => /*elided*/ any;
|
|
373
|
+
readonly withMorgan: (format?: string, options?: Parameters<typeof morgan>[1]) => /*elided*/ any;
|
|
374
|
+
readonly withSwagger: /*elided*/ any;
|
|
375
|
+
readonly defaults: {
|
|
376
|
+
readonly get: (swagger: {
|
|
377
|
+
path?: ExpressRoute;
|
|
378
|
+
doc: SwaggerConfig;
|
|
379
|
+
}) => express.Express;
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
readonly defaults: {
|
|
383
|
+
readonly get: (swagger: {
|
|
292
384
|
path?: ExpressRoute;
|
|
293
385
|
doc: SwaggerConfig;
|
|
294
|
-
})
|
|
386
|
+
}) => express.Express;
|
|
295
387
|
};
|
|
296
388
|
};
|
|
297
389
|
expressiveRouter(configs: {
|
package/dist/index.d.ts
CHANGED
|
@@ -269,29 +269,121 @@ declare function bootstrap(container: Container): {
|
|
|
269
269
|
silently: (fn: () => Promise<void>, reqSnapshot?: ReqSnapshot) => void;
|
|
270
270
|
getErrorHandlerMiddleware: (errorMapper?: (err: Error & Record<string, unknown>) => ApiError | null | undefined) => (err: Error & Record<string, unknown>, req: express.Request, res: express.Response, _next: express.NextFunction) => Promise<void>;
|
|
271
271
|
swaggerBuilder: () => {
|
|
272
|
-
withInfo(info: SwaggerConfig["info"])
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
272
|
+
readonly withInfo: (info: SwaggerConfig["info"]) => {
|
|
273
|
+
readonly withInfo: /*elided*/ any;
|
|
274
|
+
readonly withServers: (servers: Servers) => /*elided*/ any;
|
|
275
|
+
readonly withSecuritySchemes: (schemes: Record<string, SecurityScheme>) => /*elided*/ any;
|
|
276
|
+
readonly withSchemas: (schemas: Record<string, Schema>) => /*elided*/ any;
|
|
277
|
+
readonly withDefaultSecurity: (globalAuthMethods: AuthMethod[]) => /*elided*/ any;
|
|
278
|
+
readonly get: () => SwaggerConfig;
|
|
279
|
+
};
|
|
280
|
+
readonly withServers: (servers: Servers) => {
|
|
281
|
+
readonly withInfo: (info: SwaggerConfig["info"]) => /*elided*/ any;
|
|
282
|
+
readonly withServers: /*elided*/ any;
|
|
283
|
+
readonly withSecuritySchemes: (schemes: Record<string, SecurityScheme>) => /*elided*/ any;
|
|
284
|
+
readonly withSchemas: (schemas: Record<string, Schema>) => /*elided*/ any;
|
|
285
|
+
readonly withDefaultSecurity: (globalAuthMethods: AuthMethod[]) => /*elided*/ any;
|
|
286
|
+
readonly get: () => SwaggerConfig;
|
|
287
|
+
};
|
|
288
|
+
readonly withSecuritySchemes: (schemes: Record<string, SecurityScheme>) => {
|
|
289
|
+
readonly withInfo: (info: SwaggerConfig["info"]) => /*elided*/ any;
|
|
290
|
+
readonly withServers: (servers: Servers) => /*elided*/ any;
|
|
291
|
+
readonly withSecuritySchemes: /*elided*/ any;
|
|
292
|
+
readonly withSchemas: (schemas: Record<string, Schema>) => /*elided*/ any;
|
|
293
|
+
readonly withDefaultSecurity: (globalAuthMethods: AuthMethod[]) => /*elided*/ any;
|
|
294
|
+
readonly get: () => SwaggerConfig;
|
|
295
|
+
};
|
|
296
|
+
readonly withSchemas: (schemas: Record<string, Schema>) => {
|
|
297
|
+
readonly withInfo: (info: SwaggerConfig["info"]) => /*elided*/ any;
|
|
298
|
+
readonly withServers: (servers: Servers) => /*elided*/ any;
|
|
299
|
+
readonly withSecuritySchemes: (schemes: Record<string, SecurityScheme>) => /*elided*/ any;
|
|
300
|
+
readonly withSchemas: /*elided*/ any;
|
|
301
|
+
readonly withDefaultSecurity: (globalAuthMethods: AuthMethod[]) => /*elided*/ any;
|
|
302
|
+
readonly get: () => SwaggerConfig;
|
|
303
|
+
};
|
|
304
|
+
readonly withDefaultSecurity: (globalAuthMethods: AuthMethod[]) => {
|
|
305
|
+
readonly withInfo: (info: SwaggerConfig["info"]) => /*elided*/ any;
|
|
306
|
+
readonly withServers: (servers: Servers) => /*elided*/ any;
|
|
307
|
+
readonly withSecuritySchemes: (schemes: Record<string, SecurityScheme>) => /*elided*/ any;
|
|
308
|
+
readonly withSchemas: (schemas: Record<string, Schema>) => /*elided*/ any;
|
|
309
|
+
readonly withDefaultSecurity: /*elided*/ any;
|
|
310
|
+
readonly get: () => SwaggerConfig;
|
|
311
|
+
};
|
|
312
|
+
readonly get: () => SwaggerConfig;
|
|
278
313
|
};
|
|
279
|
-
expressiveServer(configs
|
|
314
|
+
expressiveServer(configs?: {
|
|
280
315
|
app?: express.Express;
|
|
281
316
|
}): {
|
|
282
|
-
get()
|
|
283
|
-
withHelmet(options?: Readonly<helmet.HelmetOptions>)
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
317
|
+
readonly get: () => express.Express;
|
|
318
|
+
readonly withHelmet: (options?: Readonly<helmet.HelmetOptions>) => {
|
|
319
|
+
readonly get: () => express.Express;
|
|
320
|
+
readonly withHelmet: /*elided*/ any;
|
|
321
|
+
readonly withQs: () => /*elided*/ any;
|
|
322
|
+
readonly withMorgan: (format?: string, options?: Parameters<typeof morgan>[1]) => /*elided*/ any;
|
|
323
|
+
readonly withSwagger: (swagger: {
|
|
324
|
+
path?: ExpressRoute;
|
|
325
|
+
doc: SwaggerConfig;
|
|
326
|
+
}, ...handlers: ExpressHandler[]) => /*elided*/ any;
|
|
327
|
+
readonly defaults: {
|
|
328
|
+
readonly get: (swagger: {
|
|
329
|
+
path?: ExpressRoute;
|
|
330
|
+
doc: SwaggerConfig;
|
|
331
|
+
}) => express.Express;
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
readonly withQs: () => {
|
|
335
|
+
readonly get: () => express.Express;
|
|
336
|
+
readonly withHelmet: (options?: Readonly<helmet.HelmetOptions>) => /*elided*/ any;
|
|
337
|
+
readonly withQs: /*elided*/ any;
|
|
338
|
+
readonly withMorgan: (format?: string, options?: Parameters<typeof morgan>[1]) => /*elided*/ any;
|
|
339
|
+
readonly withSwagger: (swagger: {
|
|
340
|
+
path?: ExpressRoute;
|
|
341
|
+
doc: SwaggerConfig;
|
|
342
|
+
}, ...handlers: ExpressHandler[]) => /*elided*/ any;
|
|
343
|
+
readonly defaults: {
|
|
344
|
+
readonly get: (swagger: {
|
|
345
|
+
path?: ExpressRoute;
|
|
346
|
+
doc: SwaggerConfig;
|
|
347
|
+
}) => express.Express;
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
readonly withMorgan: (format?: string, options?: Parameters<typeof morgan>[1]) => {
|
|
351
|
+
readonly get: () => express.Express;
|
|
352
|
+
readonly withHelmet: (options?: Readonly<helmet.HelmetOptions>) => /*elided*/ any;
|
|
353
|
+
readonly withQs: () => /*elided*/ any;
|
|
354
|
+
readonly withMorgan: /*elided*/ any;
|
|
355
|
+
readonly withSwagger: (swagger: {
|
|
356
|
+
path?: ExpressRoute;
|
|
357
|
+
doc: SwaggerConfig;
|
|
358
|
+
}, ...handlers: ExpressHandler[]) => /*elided*/ any;
|
|
359
|
+
readonly defaults: {
|
|
360
|
+
readonly get: (swagger: {
|
|
361
|
+
path?: ExpressRoute;
|
|
362
|
+
doc: SwaggerConfig;
|
|
363
|
+
}) => express.Express;
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
readonly withSwagger: (swagger: {
|
|
287
367
|
path?: ExpressRoute;
|
|
288
368
|
doc: SwaggerConfig;
|
|
289
|
-
}, ...handlers: ExpressHandler[])
|
|
290
|
-
|
|
291
|
-
|
|
369
|
+
}, ...handlers: ExpressHandler[]) => {
|
|
370
|
+
readonly get: () => express.Express;
|
|
371
|
+
readonly withHelmet: (options?: Readonly<helmet.HelmetOptions>) => /*elided*/ any;
|
|
372
|
+
readonly withQs: () => /*elided*/ any;
|
|
373
|
+
readonly withMorgan: (format?: string, options?: Parameters<typeof morgan>[1]) => /*elided*/ any;
|
|
374
|
+
readonly withSwagger: /*elided*/ any;
|
|
375
|
+
readonly defaults: {
|
|
376
|
+
readonly get: (swagger: {
|
|
377
|
+
path?: ExpressRoute;
|
|
378
|
+
doc: SwaggerConfig;
|
|
379
|
+
}) => express.Express;
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
readonly defaults: {
|
|
383
|
+
readonly get: (swagger: {
|
|
292
384
|
path?: ExpressRoute;
|
|
293
385
|
doc: SwaggerConfig;
|
|
294
|
-
})
|
|
386
|
+
}) => express.Express;
|
|
295
387
|
};
|
|
296
388
|
};
|
|
297
389
|
expressiveRouter(configs: {
|
package/dist/index.js
CHANGED
|
@@ -193,7 +193,7 @@ var SWG = {
|
|
|
193
193
|
function buildExpressive(container, swaggerDoc) {
|
|
194
194
|
return {
|
|
195
195
|
expressiveServer(configs) {
|
|
196
|
-
const app = configs
|
|
196
|
+
const app = configs?.app ?? (0, import_express.default)();
|
|
197
197
|
const result = {
|
|
198
198
|
get() {
|
|
199
199
|
return app;
|
package/dist/index.mjs
CHANGED