@trojs/openapi-server 1.13.1 → 1.15.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@trojs/openapi-server",
3
3
  "description": "OpenAPI Server",
4
- "version": "1.13.1",
4
+ "version": "1.15.0",
5
5
  "author": {
6
6
  "name": "Pieter Wigboldus",
7
7
  "url": "https://trojs.org/"
@@ -14,9 +14,12 @@
14
14
  "lint:rules": "eslint --print-config src/index.js > eslintconfig.json",
15
15
  "test": "node --test --experimental-test-coverage --test-reporter=spec --test-reporter=lcov --test-reporter-destination=stdout --test-reporter-destination=./coverage/lcov.info",
16
16
  "cpd": "node_modules/jscpd/bin/jscpd src",
17
- "vulnerabilities": "npm audit --omit=dev"
17
+ "vulnerabilities": "npm audit --omit=dev",
18
+ "build:types": "tsc",
19
+ "prepublishOnly": "npm run build:types"
18
20
  },
19
21
  "type": "module",
22
+ "types": "types/server.d.ts",
20
23
  "files": [
21
24
  "src/api.js",
22
25
  "src/openapi.js",
@@ -30,14 +33,16 @@
30
33
  "src/handlers/not-found.js",
31
34
  "src/handlers/request-validation.js",
32
35
  "src/handlers/response-validation.js",
33
- "src/handlers/unauthorized.js"
36
+ "src/handlers/unauthorized.js",
37
+ "types/**"
34
38
  ],
35
39
  "main": "src/server.js",
36
40
  "devDependencies": {
37
41
  "@eslint/js": "^9.15.0",
42
+ "@trojs/error": "^4.3.6",
38
43
  "@trojs/lint": "^0.3.4",
39
- "@types/node": "^22.0.0",
40
44
  "@types/express-serve-static-core": "^5.0.6",
45
+ "@types/node": "^22.0.0",
41
46
  "eslint": "^9.15.0",
42
47
  "globals": "^16.0.0",
43
48
  "jscpd": "^4.0.5",
@@ -65,7 +70,8 @@
65
70
  "express": "^5.1.0",
66
71
  "helmet": "^8.0.0",
67
72
  "openapi-backend": "^5.9.2",
68
- "swagger-ui-express": "^5.0.0"
73
+ "swagger-ui-express": "^5.0.0",
74
+ "typescript": "^5.9.2"
69
75
  },
70
76
  "funding": {
71
77
  "type": "github",
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @typedef {Error & { status?: number }} StatusError
3
+ */
4
+
1
5
  const errorCodesStatus = [
2
6
  {
3
7
  type: TypeError,
@@ -16,9 +20,10 @@ const errorCodesStatus = [
16
20
  /**
17
21
  * Get a http status when you send an error.
18
22
  * When it is a error, throw back the error.
19
- * @param {Error} error
23
+ * @param {StatusError} error
20
24
  * @returns {number}
21
25
  */
22
26
  export default (error) =>
23
- errorCodesStatus.find((errorCode) => error instanceof errorCode.type)
24
- .status
27
+ error.status
28
+ || errorCodesStatus.find((errorCode) => error instanceof errorCode.type)?.status
29
+ || 500
@@ -23,7 +23,7 @@ import { parseParams } from './params.js'
23
23
  * @returns {Function}
24
24
  */
25
25
  export const makeExpressCallback
26
- = ({ controller, specification, errorDetails, logger, meta, mock, preLog, postLog }) =>
26
+ = ({ controller, specification, errorDetails, logger, meta, mock, preLog, postLog }) =>
27
27
  /**
28
28
  * Handle controller
29
29
  * @async
@@ -32,76 +32,76 @@ export const makeExpressCallback
32
32
  * @param {Response} response
33
33
  * @returns {Promise<any>}
34
34
  */
35
- async (context, request, response) => {
36
- const startTime = hrtime()
37
- try {
38
- const allParameters = {
39
- ...(context.request?.params || {}),
40
- ...(context.request?.query || {})
41
- }
42
- const parameters = parseParams({
43
- query: allParameters,
44
- spec: context.operation.parameters,
45
- mock
46
- })
47
- const url = `${request.protocol}://${request.get('Host')}${request.originalUrl}`
48
- const feedback = {
49
- context,
50
- request,
51
- response,
52
- parameters,
53
- specification,
54
- post: request.body,
55
- url,
56
- logger,
57
- meta
58
- }
59
- if (preLog) {
60
- preLog(feedback)
61
- }
62
- const responseBody = await controller(feedback)
63
- const responseTime = hrtime(startTime)[1] / 1000000 // convert to milliseconds
64
- if (postLog) {
65
- postLog({ ...feedback, responseBody, responseTime })
66
- }
67
- logger.debug({
68
- url,
69
- parameters,
70
- post: request.body,
71
- response: responseBody
72
- })
73
-
74
- return responseBody
75
- } catch (error) {
76
- const errorCodeStatus = getStatusByError(error)
35
+ async (context, request, response) => {
36
+ const startTime = hrtime()
37
+ try {
38
+ const allParameters = {
39
+ ...(context.request?.params || {}),
40
+ ...(context.request?.query || {})
41
+ }
42
+ const parameters = parseParams({
43
+ query: allParameters,
44
+ spec: context.operation.parameters,
45
+ mock
46
+ })
47
+ const url = `${request.protocol}://${request.get('Host')}${request.originalUrl}`
48
+ const feedback = {
49
+ context,
50
+ request,
51
+ response,
52
+ parameters,
53
+ specification,
54
+ post: request.body,
55
+ url,
56
+ logger,
57
+ meta
58
+ }
59
+ if (preLog) {
60
+ preLog(feedback)
61
+ }
62
+ const responseBody = await controller(feedback)
63
+ const responseTime = hrtime(startTime)[1] / 1000000 // convert to milliseconds
64
+ if (postLog) {
65
+ postLog({ ...feedback, responseBody, responseTime })
66
+ }
67
+ logger.debug({
68
+ url,
69
+ parameters,
70
+ post: request.body,
71
+ response: responseBody
72
+ })
77
73
 
78
- if (errorCodeStatus >= 500) {
79
- logger.error(error)
80
- } else {
81
- logger.warn(error)
82
- }
74
+ return responseBody
75
+ } catch (error) {
76
+ const errorCodeStatus = getStatusByError(error)
83
77
 
84
- response.status(errorCodeStatus)
78
+ if (errorCodeStatus >= 500) {
79
+ logger.error(error)
80
+ } else {
81
+ logger.warn(error)
82
+ }
85
83
 
86
- if (errorDetails) {
87
- return {
88
- errors: [
89
- {
90
- message: error.message,
91
- value: error.valueOf(),
92
- type: error.constructor.name
93
- }
94
- ],
95
- status: errorCodeStatus,
96
- timestamp: new Date(),
97
- message: error.message
98
- }
99
- }
84
+ response.status(errorCodeStatus)
100
85
 
86
+ if (errorDetails) {
101
87
  return {
88
+ errors: [
89
+ {
90
+ message: error.message,
91
+ value: error.valueOf(),
92
+ type: error.constructor.name
93
+ }
94
+ ],
102
95
  status: errorCodeStatus,
103
96
  timestamp: new Date(),
104
97
  message: error.message
105
98
  }
106
99
  }
100
+
101
+ return {
102
+ status: errorCodeStatus,
103
+ timestamp: new Date(),
104
+ message: error.message
105
+ }
107
106
  }
107
+ }
package/src/router.js CHANGED
@@ -92,7 +92,7 @@ export const setupRouter = ({
92
92
 
93
93
  api.register('notImplemented', (context) => {
94
94
  const { mock: mockImplementation }
95
- = context.api.mockResponseForOperation(context.operation.operationId)
95
+ = context.api.mockResponseForOperation(context.operation.operationId)
96
96
  return mockImplementation
97
97
  })
98
98
 
package/types/api.d.ts ADDED
@@ -0,0 +1,94 @@
1
+ /**
2
+ * @typedef {import('openapi-backend').Handler} Handler
3
+ * @typedef {import('ajv').Options} AjvOpts
4
+ * @typedef {import('openapi-backend').AjvCustomizer} AjvCustomizer
5
+ * @typedef {object} Logger
6
+ * @property {Function} error
7
+ * @property {Function} warn
8
+ * @property {Function} info
9
+ * @property {Function} debug
10
+ * @typedef {object} SecurityHandler
11
+ * @property {string} name
12
+ * @property {Handler} handler
13
+ * @typedef {object} ApiSchema
14
+ * @property {string} version
15
+ * @property {object} specification
16
+ * @property {object} controllers
17
+ * @property {string=} apiRoot
18
+ * @property {boolean=} strictSpecification
19
+ * @property {boolean=} errorDetails
20
+ * @property {Logger=} logger
21
+ * @property {Function=} preLog
22
+ * @property {Function=} postLog
23
+ * @property {object=} meta
24
+ * @property {SecurityHandler[]=} securityHandlers
25
+ * @property {Handler=} unauthorizedHandler
26
+ * @property {boolean=} swagger
27
+ * @property {boolean=} apiDocs
28
+ * @property {AjvOpts=} ajvOptions
29
+ * @property {AjvCustomizer=} customizeAjv
30
+ * @property {any[]=} middleware
31
+ */
32
+ /**
33
+ * Setup the server for a specific API, so every server can run multiple instances of the API,
34
+ * like different versions, for e.g. different clients
35
+ */
36
+ export class Api {
37
+ /**
38
+ * Create a new instance of the API
39
+ * @class
40
+ * @param {ApiSchema} params
41
+ */
42
+ constructor({ version, specification, controllers, apiRoot, strictSpecification, errorDetails, logger, preLog, postLog, meta, securityHandlers, unauthorizedHandler, swagger, apiDocs, ajvOptions, customizeAjv, middleware }: ApiSchema);
43
+ version: string;
44
+ specification: object;
45
+ controllers: object;
46
+ apiRoot: string | undefined;
47
+ strictSpecification: boolean | undefined;
48
+ errorDetails: boolean;
49
+ logger: Logger;
50
+ preLog: Function | undefined;
51
+ postLog: Function | undefined;
52
+ meta: object;
53
+ securityHandlers: SecurityHandler[];
54
+ unauthorizedHandler: Handler | undefined;
55
+ swagger: boolean;
56
+ apiDocs: boolean;
57
+ ajvOptions: import("ajv").Options;
58
+ customizeAjv: import("openapi-backend").AjvCustomizer | undefined;
59
+ middleware: any[];
60
+ setup(): any;
61
+ }
62
+ export type Handler = import("openapi-backend").Handler;
63
+ export type AjvOpts = import("ajv").Options;
64
+ export type AjvCustomizer = import("openapi-backend").AjvCustomizer;
65
+ export type Logger = {
66
+ error: Function;
67
+ warn: Function;
68
+ info: Function;
69
+ debug: Function;
70
+ };
71
+ export type SecurityHandler = {
72
+ name: string;
73
+ handler: Handler;
74
+ };
75
+ export type ApiSchema = {
76
+ version: string;
77
+ specification: object;
78
+ controllers: object;
79
+ apiRoot?: string | undefined;
80
+ strictSpecification?: boolean | undefined;
81
+ errorDetails?: boolean | undefined;
82
+ logger?: Logger | undefined;
83
+ preLog?: Function | undefined;
84
+ postLog?: Function | undefined;
85
+ meta?: object | undefined;
86
+ securityHandlers?: SecurityHandler[] | undefined;
87
+ unauthorizedHandler?: Handler | undefined;
88
+ swagger?: boolean | undefined;
89
+ apiDocs?: boolean | undefined;
90
+ ajvOptions?: AjvOpts | undefined;
91
+ customizeAjv?: AjvCustomizer | undefined;
92
+ middleware?: any[] | undefined;
93
+ };
94
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH;;;GAGG;AAEH;IACE;;;;OAIG;IACH,+NAFW,SAAS,EAsCnB;IAjBC,gBAAsB;IACtB,sBAAkC;IAClC,oBAA8B;IAC9B,4BAAsB;IACtB,yCAA8C;IAC9C,sBAAyC;IACzC,eAA+B;IAC/B,6BAAiC;IACjC,8BAAmC;IACnC,aAAsB;IACtB,oCAA8C;IAC9C,yCAA2D;IAC3D,iBAA8B;IAC9B,iBAA8B;IAC9B,kCAAoD;IACpD,kEAAgC;IAChC,kBAA4B;IAG9B,aAsDC;CACF;sBAvIY,OAAO,iBAAiB,EAAE,OAAO;sBACjC,OAAO,KAAK,EAAE,OAAO;4BACrB,OAAO,iBAAiB,EAAE,aAAa;;;;;;;;UAOtC,MAAM;aACN,OAAO;;;aAEP,MAAM;mBACN,MAAM;iBACN,MAAM;cACN,MAAM,YAAC;0BACP,OAAO,YAAC;mBACR,OAAO,YAAC;aACR,MAAM,YAAC;aACP,oBAAS;cACT,oBAAS;WACT,MAAM,YAAC;uBACP,eAAe,EAAE,YAAC;0BAClB,OAAO,YAAC;cACR,OAAO,YAAC;cACR,OAAO,YAAC;iBACR,OAAO,YAAC;mBACR,aAAa,YAAC;iBACd,GAAG,EAAE,YAAC"}
@@ -0,0 +1,6 @@
1
+ declare function _default(error: StatusError): number;
2
+ export default _default;
3
+ export type StatusError = Error & {
4
+ status?: number;
5
+ };
6
+ //# sourceMappingURL=error-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-status.d.ts","sourceRoot":"","sources":["../src/error-status.js"],"names":[],"mappings":"AAyBe,iCAHJ,WAAW,GACT,MAAM,CAKX;;0BA3BK,KAAK,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE"}
@@ -0,0 +1,15 @@
1
+ export function makeExpressCallback({ controller, specification, errorDetails, logger, meta, mock, preLog, postLog }: {
2
+ controller: Function;
3
+ specification: object;
4
+ errorDetails?: boolean | undefined;
5
+ logger?: Logger | undefined;
6
+ meta?: object | undefined;
7
+ mock?: boolean | undefined;
8
+ preLog?: Function | undefined;
9
+ postLog?: Function | undefined;
10
+ }): Function;
11
+ export type Request = import("express-serve-static-core").Request;
12
+ export type Response = import("express-serve-static-core").Response;
13
+ export type Context = import("openapi-backend").Context;
14
+ export type Logger = import("./api.js").Logger;
15
+ //# sourceMappingURL=express-callback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"express-callback.d.ts","sourceRoot":"","sources":["../src/express-callback.js"],"names":[],"mappings":"AAwBO,sHAVJ;IAAyB,UAAU;IACZ,aAAa,EAA5B,MAAM;IACW,YAAY,GAA7B,OAAO,YAAC;IACQ,MAAM,GAAtB,MAAM,YAAC;IACS,IAAI,GAApB,MAAM,YAAC;IACU,IAAI,GAArB,OAAO,YAAC;IACU,MAAM,GAAxB,oBAAS;IACS,OAAO,GAAzB,oBAAS;CACjB,YAoFE;sBArGQ,OAAO,2BAA2B,EAAE,OAAO;uBAC3C,OAAO,2BAA2B,EAAE,QAAQ;sBAC5C,OAAO,iBAAiB,EAAE,OAAO;qBACjC,OAAO,UAAU,EAAE,MAAM"}
@@ -0,0 +1,6 @@
1
+ export function notFound(_context: any, request: any, response: any): {
2
+ status: number;
3
+ timestamp: Date;
4
+ message: string;
5
+ };
6
+ //# sourceMappingURL=not-found.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not-found.d.ts","sourceRoot":"","sources":["../../src/handlers/not-found.js"],"names":[],"mappings":"AAAO;;;;EAON"}
@@ -0,0 +1,7 @@
1
+ export function requestValidation(context: any, request: any, response: any): {
2
+ errors: any;
3
+ status: number;
4
+ timestamp: Date;
5
+ message: string;
6
+ };
7
+ //# sourceMappingURL=request-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-validation.d.ts","sourceRoot":"","sources":["../../src/handlers/request-validation.js"],"names":[],"mappings":"AAAO;;;;;EAQN"}
@@ -0,0 +1,3 @@
1
+ declare function _default(logger: any): (context: any, request: any, response: any) => any;
2
+ export default _default;
3
+ //# sourceMappingURL=response-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-validation.d.ts","sourceRoot":"","sources":["../../src/handlers/response-validation.js"],"names":[],"mappings":"AAAe,yCAAa,YAAO,EAAE,YAAO,EAAE,aAAQ,SAsCrD"}
@@ -0,0 +1,6 @@
1
+ export function unauthorized(context: any, request: any, response: any): Promise<{
2
+ status: number;
3
+ timestamp: Date;
4
+ message: string;
5
+ }>;
6
+ //# sourceMappingURL=unauthorized.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unauthorized.d.ts","sourceRoot":"","sources":["../../src/handlers/unauthorized.js"],"names":[],"mappings":"AAAO;;;;GAON"}
@@ -0,0 +1,7 @@
1
+ export function openAPI({ file, base }: {
2
+ file: string;
3
+ base?: string | undefined;
4
+ }): Promise<{
5
+ openAPISpecification: object;
6
+ }>;
7
+ //# sourceMappingURL=openapi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../src/openapi.js"],"names":[],"mappings":"AAUO,wCAJJ;IAAuB,IAAI,EAAnB,MAAM;IACU,IAAI,GAApB,MAAM,YAAC;CACf,GAAU,OAAO,CAAC;IAAE,oBAAoB,EAAE,MAAM,CAAC;CAAE,CAAC,CAMtD"}
@@ -0,0 +1,4 @@
1
+ export function operationIds({ specification }: {
2
+ specification: object;
3
+ }): string[];
4
+ //# sourceMappingURL=operation-ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-ids.d.ts","sourceRoot":"","sources":["../src/operation-ids.js"],"names":[],"mappings":"AAQO,gDAHJ;IAAuB,aAAa,EAA5B,MAAM;CACd,GAAU,MAAM,EAAE,CASV"}
@@ -0,0 +1,6 @@
1
+ export function parseParams({ query, spec, mock }: {
2
+ query: object;
3
+ spec: object;
4
+ mock?: boolean | undefined;
5
+ }): object;
6
+ //# sourceMappingURL=params.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../src/params.js"],"names":[],"mappings":"AAUO,mDALJ;IAAuB,KAAK,EAApB,MAAM;IACS,IAAI,EAAnB,MAAM;IACW,IAAI,GAArB,OAAO,YAAC;CAChB,GAAU,MAAM,CAwCT"}
@@ -0,0 +1,26 @@
1
+ export function setupRouter({ openAPISpecification, controllers, apiRoot, strictSpecification, errorDetails, logger, preLog, postLog, meta, securityHandlers, unauthorizedHandler, ajvOptions, customizeAjv, mock }: {
2
+ openAPISpecification: object;
3
+ controllers: object;
4
+ apiRoot?: string | undefined;
5
+ strictSpecification?: boolean | undefined;
6
+ errorDetails?: boolean | undefined;
7
+ logger?: Logger | undefined;
8
+ preLog?: Function | undefined;
9
+ postLog?: Function | undefined;
10
+ meta?: object | undefined;
11
+ securityHandlers?: SecurityHandler[] | undefined;
12
+ unauthorizedHandler?: Handler | undefined;
13
+ ajvOptions?: AjvOpts | undefined;
14
+ customizeAjv?: AjvCustomizer | undefined;
15
+ mock?: boolean | undefined;
16
+ }): {
17
+ api: OpenAPIBackend<any>;
18
+ openAPISpecification: object;
19
+ };
20
+ export type Logger = import("./api.js").Logger;
21
+ export type SecurityHandler = import("./api.js").SecurityHandler;
22
+ export type Handler = import("./api.js").Handler;
23
+ export type AjvOpts = import("ajv").Options;
24
+ export type AjvCustomizer = import("openapi-backend").AjvCustomizer;
25
+ import { OpenAPIBackend } from 'openapi-backend';
26
+ //# sourceMappingURL=router.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.js"],"names":[],"mappings":"AAoCO,qNAhBJ;IAAuB,oBAAoB,EAAnC,MAAM;IACS,WAAW,EAA1B,MAAM;IACU,OAAO,GAAvB,MAAM,YAAC;IACU,mBAAmB,GAApC,OAAO,YAAC;IACS,YAAY,GAA7B,OAAO,YAAC;IACQ,MAAM,GAAtB,MAAM,YAAC;IACW,MAAM,GAAxB,oBAAS;IACS,OAAO,GAAzB,oBAAS;IACO,IAAI,GAApB,MAAM,YAAC;IACoB,gBAAgB,GAA3C,eAAe,EAAE,YAAC;IACD,mBAAmB,GAApC,OAAO,YAAC;IACS,UAAU,GAA3B,OAAO,YAAC;IACe,YAAY,GAAnC,aAAa,YAAC;IACG,IAAI,GAArB,OAAO,YAAC;CAChB,GAAU;IAAE,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAAC,oBAAoB,EAAE,MAAM,CAAA;CAAE,CAwEtE;qBAhGY,OAAO,UAAU,EAAE,MAAM;8BACzB,OAAO,UAAU,EAAE,eAAe;sBAClC,OAAO,UAAU,EAAE,OAAO;sBAC1B,OAAO,KAAK,EAAE,OAAO;4BACrB,OAAO,iBAAiB,EAAE,aAAa;+BAdrB,iBAAiB"}
@@ -0,0 +1,39 @@
1
+ export function setupServer({ apis, origin, staticFolder, sentry, poweredBy, version, middleware, maximumBodySize }: {
2
+ apis: ApiSchema[];
3
+ origin?: string | undefined;
4
+ staticFolder?: string | undefined;
5
+ sentry?: SentryConfig | undefined;
6
+ poweredBy?: string | undefined;
7
+ version?: string | undefined;
8
+ middleware?: any[] | undefined;
9
+ maximumBodySize?: (string | number) | undefined;
10
+ }): Promise<{
11
+ app: Express;
12
+ }>;
13
+ export type Request = import("express-serve-static-core").Request;
14
+ export type Response = import("express-serve-static-core").Response;
15
+ export type Context = import("openapi-backend").Context;
16
+ export type ApiSchema = import("./api.js").ApiSchema;
17
+ export type Logger = import("./api.js").Logger;
18
+ export type Express = any;
19
+ export type Controller<T = unknown> = {
20
+ context?: Context | undefined;
21
+ request?: Request | undefined;
22
+ response?: Response | undefined;
23
+ parameters?: object | undefined;
24
+ specification?: object | undefined;
25
+ post?: T | undefined;
26
+ url?: string | undefined;
27
+ logger?: Logger | undefined;
28
+ meta?: object | undefined;
29
+ };
30
+ export type SentryConfig = {
31
+ dsn?: string | undefined;
32
+ tracesSampleRate?: number | undefined;
33
+ profilesSampleRate?: number | undefined;
34
+ release?: string | undefined;
35
+ };
36
+ import { openAPI } from './openapi.js';
37
+ import { Api } from './api.js';
38
+ export { openAPI, Api };
39
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.js"],"names":[],"mappings":"AAuEO,qHAVJ;IAA4B,IAAI,EAAxB,SAAS,EAAE;IACK,MAAM,GAAtB,MAAM,YAAC;IACS,YAAY,GAA5B,MAAM,YAAC;IACe,MAAM,GAA5B,YAAY,YAAC;IACG,SAAS,GAAzB,MAAM,YAAC;IACS,OAAO,GAAvB,MAAM,YAAC;IACQ,UAAU,GAAzB,GAAG,EAAE,YAAC;IACiB,eAAe,GAAtC,CAAA,MAAM,GAAC,MAAM,aAAC;CACtB,GAAU,OAAO,CAAC;IAAE,GAAG,EAAE,OAAO,CAAA;CAAE,CAAC,CA4DrC;sBAtGY,OAAO,2BAA2B,EAAE,OAAO;uBAC3C,OAAO,2BAA2B,EAAE,QAAQ;sBAC5C,OAAO,iBAAiB,EAAE,OAAO;wBACjC,OAAO,UAAU,EAAE,SAAS;qBAC5B,OAAO,UAAU,EAAE,MAAM;;uBAKxB,CAAC;cAED,OAAO,YAAC;cACR,OAAO,YAAC;eACR,QAAQ,YAAC;iBACT,MAAM,YAAC;oBACP,MAAM,YAAC;WACP,CAAC,YAAC;UACF,MAAM,YAAC;aACP,MAAM,YAAC;WACP,MAAM,YAAC;;;UAKP,MAAM,YAAC;uBACP,MAAM,YAAC;yBACP,MAAM,YAAC;cACP,MAAM,YAAC;;wBAhDG,cAAc;oBAClB,UAAU"}
@@ -0,0 +1,18 @@
1
+ export namespace types {
2
+ let string: StringConstructor;
3
+ let array: ArrayConstructor;
4
+ let object: ObjectConstructor;
5
+ let number: NumberConstructor;
6
+ let integer: NumberConstructor;
7
+ let boolean: BooleanConstructor;
8
+ let url: {
9
+ new (url: string | URL, base?: string | URL): URL;
10
+ prototype: URL;
11
+ canParse(url: string | URL, base?: string | URL): boolean;
12
+ createObjectURL(obj: Blob | MediaSource): string;
13
+ parse(url: string | URL, base?: string | URL): URL | null;
14
+ revokeObjectURL(url: string): void;
15
+ };
16
+ let date: DateConstructor;
17
+ }
18
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.js"],"names":[],"mappings":""}