@lykosjs/openapi 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +371 -2
- package/dist/core/generator.d.ts +16 -0
- package/dist/core/generator.d.ts.map +1 -0
- package/dist/core/openapi.d.ts +42 -0
- package/dist/core/openapi.d.ts.map +1 -0
- package/dist/core/resolve-options.d.ts +8 -0
- package/dist/core/resolve-options.d.ts.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1237 -0
- package/dist/schemas/schema-converter.d.ts +17 -0
- package/dist/schemas/schema-converter.d.ts.map +1 -0
- package/dist/types/internal.types.d.ts +52 -0
- package/dist/types/internal.types.d.ts.map +1 -0
- package/dist/types/openapi.types.d.ts +73 -0
- package/dist/types/openapi.types.d.ts.map +1 -0
- package/dist/types/route.types.d.ts +66 -0
- package/dist/types/route.types.d.ts.map +1 -0
- package/dist/types/schema.types.d.ts +35 -0
- package/dist/types/schema.types.d.ts.map +1 -0
- package/dist/ui/swagger-ui.d.ts +21 -0
- package/dist/ui/swagger-ui.d.ts.map +1 -0
- package/dist/utils/guards.d.ts +6 -0
- package/dist/utils/guards.d.ts.map +1 -0
- package/dist/utils/path.d.ts +33 -0
- package/dist/utils/path.d.ts.map +1 -0
- package/dist/validation/route-validator.d.ts +29 -0
- package/dist/validation/route-validator.d.ts.map +1 -0
- package/dist/validation/validation-error.d.ts +28 -0
- package/dist/validation/validation-error.d.ts.map +1 -0
- package/package.json +57 -4
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ConvertedSchema } from '../types/schema.types.js';
|
|
2
|
+
/** Thrown when a LykosJS schema cannot be represented faithfully as JSON Schema. */
|
|
3
|
+
export declare class SchemaConversionError extends Error {
|
|
4
|
+
readonly problems: readonly string[];
|
|
5
|
+
constructor(problems: readonly string[]);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Converts a LykosJS validation schema (the result of `defineSchema`) to a JSON Schema
|
|
9
|
+
* object (OpenAPI 3.1).
|
|
10
|
+
*
|
|
11
|
+
* Conversions are only produced for rules the LykosJS `Validator` really enforces.
|
|
12
|
+
* Anything that cannot be represented faithfully throws a `SchemaConversionError`
|
|
13
|
+
* instead of being silently dropped. Text transformations (`trim`, `lowercase`) change the
|
|
14
|
+
* value the Validator returns but do not constrain the input, so they are not documented.
|
|
15
|
+
*/
|
|
16
|
+
export declare function convertSchema(schema: unknown): ConvertedSchema;
|
|
17
|
+
//# sourceMappingURL=schema-converter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter.d.ts","sourceRoot":"","sources":["../../src/schemas/schema-converter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,eAAe,EAIhB,MAAM,0BAA0B,CAAA;AAGjC,oFAAoF;AACpF,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;gBAExB,QAAQ,EAAE,SAAS,MAAM,EAAE;CAKxC;AA4OD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,eAAe,CAa9D"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ContextMiddleware, Context } from 'lykosjs';
|
|
2
|
+
import type { OpenAPIInfo, OpenAPISecurityScheme, OpenAPIServer } from './openapi.types.js';
|
|
3
|
+
import type { OpenAPIMethod } from './route.types.js';
|
|
4
|
+
import type { ConvertedSchema } from './schema.types.js';
|
|
5
|
+
/** Internal (not exported from the package entry point). */
|
|
6
|
+
export interface ResolvedResponse {
|
|
7
|
+
readonly status: number;
|
|
8
|
+
readonly description: string;
|
|
9
|
+
readonly schema?: ConvertedSchema;
|
|
10
|
+
readonly contentType: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ResolvedRoute {
|
|
13
|
+
/** Documentation key (becomes the `operationId`). */
|
|
14
|
+
readonly key: string;
|
|
15
|
+
readonly method: OpenAPIMethod;
|
|
16
|
+
/** OpenAPI style, normalized (`/users/{id}`). */
|
|
17
|
+
readonly path: string;
|
|
18
|
+
/** Same shape, parameter names erased (`/users/{}`). */
|
|
19
|
+
readonly shape: string;
|
|
20
|
+
readonly pathParams: readonly string[];
|
|
21
|
+
readonly summary?: string;
|
|
22
|
+
readonly description?: string;
|
|
23
|
+
readonly tags?: readonly string[];
|
|
24
|
+
readonly deprecated: boolean;
|
|
25
|
+
readonly isRequired: boolean;
|
|
26
|
+
readonly security: readonly string[];
|
|
27
|
+
readonly body?: {
|
|
28
|
+
readonly schema: ConvertedSchema;
|
|
29
|
+
readonly contentType: string;
|
|
30
|
+
};
|
|
31
|
+
readonly query?: ConvertedSchema;
|
|
32
|
+
readonly params?: ConvertedSchema;
|
|
33
|
+
readonly headers?: ConvertedSchema;
|
|
34
|
+
readonly responses: readonly ResolvedResponse[];
|
|
35
|
+
}
|
|
36
|
+
export interface ResolvedSwaggerUI {
|
|
37
|
+
readonly title: string;
|
|
38
|
+
readonly persistAuthorization: boolean;
|
|
39
|
+
readonly docExpansion: 'list' | 'full' | 'none';
|
|
40
|
+
}
|
|
41
|
+
export interface ResolvedOptions {
|
|
42
|
+
readonly info: OpenAPIInfo;
|
|
43
|
+
readonly servers: readonly OpenAPIServer[];
|
|
44
|
+
readonly securitySchemes: Readonly<Record<string, OpenAPISecurityScheme>>;
|
|
45
|
+
/** Normalized static path, or `undefined` when disabled. */
|
|
46
|
+
readonly docsPath: string | undefined;
|
|
47
|
+
readonly jsonPath: string | undefined;
|
|
48
|
+
readonly middlewares: readonly ContextMiddleware<Context>[];
|
|
49
|
+
readonly swaggerUI: ResolvedSwaggerUI;
|
|
50
|
+
readonly routes: readonly ResolvedRoute[];
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=internal.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.types.d.ts","sourceRoot":"","sources":["../../src/types/internal.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD,4DAA4D;AAC5D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAA;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,qDAAqD;IACrD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;IAC9B,iDAAiD;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,wDAAwD;IACxD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;IACpC,QAAQ,CAAC,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;QAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAA;IAClF,QAAQ,CAAC,KAAK,CAAC,EAAE,eAAe,CAAA;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAA;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,CAAA;IAClC,QAAQ,CAAC,SAAS,EAAE,SAAS,gBAAgB,EAAE,CAAA;CAChD;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAA;IACtC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;CAChD;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,CAAA;IAC1C,QAAQ,CAAC,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAA;IACzE,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,QAAQ,CAAC,WAAW,EAAE,SAAS,iBAAiB,CAAC,OAAO,CAAC,EAAE,CAAA;IAC3D,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAA;IACrC,QAAQ,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAA;CAC1C"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { JsonSchema } from './schema.types.js';
|
|
2
|
+
export interface OpenAPIInfo {
|
|
3
|
+
title: string;
|
|
4
|
+
version: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
termsOfService?: string;
|
|
7
|
+
contact?: {
|
|
8
|
+
name?: string;
|
|
9
|
+
email?: string;
|
|
10
|
+
url?: string;
|
|
11
|
+
};
|
|
12
|
+
license?: {
|
|
13
|
+
name: string;
|
|
14
|
+
url?: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface OpenAPIServer {
|
|
18
|
+
/** Absolute http(s) URL or a path starting with `/`. */
|
|
19
|
+
url: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
}
|
|
22
|
+
export type OpenAPISecurityScheme = {
|
|
23
|
+
type: 'http';
|
|
24
|
+
scheme: 'bearer';
|
|
25
|
+
/** e.g. `JWT`. */
|
|
26
|
+
bearerFormat?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
} | {
|
|
29
|
+
/** Also used for cookie authentication (`in: 'cookie'`). */
|
|
30
|
+
type: 'apiKey';
|
|
31
|
+
in: 'header' | 'query' | 'cookie';
|
|
32
|
+
name: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
};
|
|
35
|
+
export interface OpenAPIMediaType {
|
|
36
|
+
schema: JsonSchema;
|
|
37
|
+
}
|
|
38
|
+
export interface OpenAPIParameter {
|
|
39
|
+
name: string;
|
|
40
|
+
in: 'path' | 'query' | 'header';
|
|
41
|
+
required: boolean;
|
|
42
|
+
schema: JsonSchema;
|
|
43
|
+
}
|
|
44
|
+
export interface OpenAPIRequestBody {
|
|
45
|
+
required: boolean;
|
|
46
|
+
content: Record<string, OpenAPIMediaType>;
|
|
47
|
+
}
|
|
48
|
+
export interface OpenAPIResponseObject {
|
|
49
|
+
description: string;
|
|
50
|
+
content?: Record<string, OpenAPIMediaType>;
|
|
51
|
+
}
|
|
52
|
+
export interface OpenAPIOperation {
|
|
53
|
+
summary?: string;
|
|
54
|
+
description?: string;
|
|
55
|
+
tags?: string[];
|
|
56
|
+
operationId: string;
|
|
57
|
+
deprecated?: true;
|
|
58
|
+
parameters?: OpenAPIParameter[];
|
|
59
|
+
requestBody?: OpenAPIRequestBody;
|
|
60
|
+
responses: Record<string, OpenAPIResponseObject>;
|
|
61
|
+
security?: Record<string, string[]>[];
|
|
62
|
+
}
|
|
63
|
+
export type OpenAPIPathItem = Partial<Record<'get' | 'post' | 'put' | 'patch' | 'delete' | 'head', OpenAPIOperation>>;
|
|
64
|
+
export interface OpenAPIDocument {
|
|
65
|
+
openapi: '3.1.0';
|
|
66
|
+
info: OpenAPIInfo;
|
|
67
|
+
servers?: OpenAPIServer[];
|
|
68
|
+
paths: Record<string, OpenAPIPathItem>;
|
|
69
|
+
components?: {
|
|
70
|
+
securitySchemes: Record<string, OpenAPISecurityScheme>;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=openapi.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi.types.d.ts","sourceRoot":"","sources":["../../src/types/openapi.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,GAAG,CAAC,EAAE,MAAM,CAAA;KACb,CAAA;IACD,OAAO,CAAC,EAAE;QACR,IAAI,EAAE,MAAM,CAAA;QACZ,GAAG,CAAC,EAAE,MAAM,CAAA;KACb,CAAA;CACF;AAED,MAAM,WAAW,aAAa;IAC5B,wDAAwD;IACxD,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,MAAM,qBAAqB,GAC7B;IACE,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,QAAQ,CAAA;IAChB,kBAAkB;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,GACD;IACE,4DAA4D;IAC5D,IAAI,EAAE,QAAQ,CAAA;IACd,EAAE,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAA;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAIL,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,UAAU,CAAA;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;IAC/B,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,UAAU,CAAA;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,OAAO,CAAA;IACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;CAC1C;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;CAC3C;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,IAAI,CAAA;IACjB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC/B,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAA;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,CAAA;CACtC;AAED,MAAM,MAAM,eAAe,GAAG,OAAO,CACnC,MAAM,CAAC,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,EAAE,gBAAgB,CAAC,CAC/E,CAAA;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,WAAW,CAAA;IACjB,OAAO,CAAC,EAAE,aAAa,EAAE,CAAA;IACzB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IACtC,UAAU,CAAC,EAAE;QACX,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAA;KACvD,CAAA;CACF"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { ContextMiddleware, Context } from 'lykosjs';
|
|
2
|
+
import type { OpenAPIInfo, OpenAPIServer, OpenAPISecurityScheme } from './openapi.types.js';
|
|
3
|
+
import type { LykosSchema } from './schema.types.js';
|
|
4
|
+
/**
|
|
5
|
+
* HTTP methods that can be documented.
|
|
6
|
+
*
|
|
7
|
+
* `OPTIONS` is intentionally absent: LykosJS's HTTP server answers every
|
|
8
|
+
* `OPTIONS` request (CORS preflight) before it reaches the router, so a
|
|
9
|
+
* registered `OPTIONS` route can never be reached and must not be documented.
|
|
10
|
+
*/
|
|
11
|
+
export type OpenAPIMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD';
|
|
12
|
+
/** Body encodings LykosJS can read (`json()` and `formData()`). */
|
|
13
|
+
export type OpenAPIBodyContentType = 'application/json' | 'application/x-www-form-urlencoded' | 'multipart/form-data';
|
|
14
|
+
export interface OpenAPIRequest {
|
|
15
|
+
body?: LykosSchema;
|
|
16
|
+
/** Defaults to `application/json`. */
|
|
17
|
+
contentType?: OpenAPIBodyContentType;
|
|
18
|
+
query?: LykosSchema;
|
|
19
|
+
params?: LykosSchema;
|
|
20
|
+
headers?: LykosSchema;
|
|
21
|
+
}
|
|
22
|
+
export interface OpenAPIResponse {
|
|
23
|
+
description: string;
|
|
24
|
+
schema?: LykosSchema;
|
|
25
|
+
/** Media type of `schema`. Defaults to `application/json`. */
|
|
26
|
+
contentType?: string;
|
|
27
|
+
}
|
|
28
|
+
export type OpenAPIResponses = Record<number, OpenAPIResponse>;
|
|
29
|
+
export interface OpenAPIRoute {
|
|
30
|
+
method: OpenAPIMethod;
|
|
31
|
+
/** LykosJS style (`/users/:id`) or OpenAPI style (`/users/{id}`). */
|
|
32
|
+
path: string;
|
|
33
|
+
summary?: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
tags?: string[];
|
|
36
|
+
/** Defaults to `true`: the route must be registered in LykosJS. */
|
|
37
|
+
isRequired?: boolean;
|
|
38
|
+
deprecated?: boolean;
|
|
39
|
+
request?: OpenAPIRequest;
|
|
40
|
+
response: OpenAPIResponses;
|
|
41
|
+
/** Names of entries of `securitySchemes`. Each name is an alternative (OR). */
|
|
42
|
+
security?: string[];
|
|
43
|
+
}
|
|
44
|
+
export interface SwaggerUIOptions {
|
|
45
|
+
/** HTML title of the documentation page. Defaults to `info.title`. */
|
|
46
|
+
title?: string;
|
|
47
|
+
persistAuthorization?: boolean;
|
|
48
|
+
docExpansion?: 'list' | 'full' | 'none';
|
|
49
|
+
}
|
|
50
|
+
export interface OpenAPIOptions {
|
|
51
|
+
info: OpenAPIInfo;
|
|
52
|
+
/** Swagger UI path, `false` to disable it. Defaults to `/docs`. */
|
|
53
|
+
docs?: string | false;
|
|
54
|
+
/** OpenAPI JSON path, `false` to disable it. Defaults to `/docs/json`. */
|
|
55
|
+
json?: string | false;
|
|
56
|
+
routes: Record<string, OpenAPIRoute>;
|
|
57
|
+
servers?: OpenAPIServer[];
|
|
58
|
+
securitySchemes?: Record<string, OpenAPISecurityScheme>;
|
|
59
|
+
/**
|
|
60
|
+
* LykosJS middlewares applied to the documentation routes only
|
|
61
|
+
* (e.g. an authentication middleware to keep the docs private).
|
|
62
|
+
*/
|
|
63
|
+
middlewares?: ContextMiddleware<Context>[];
|
|
64
|
+
swaggerUI?: SwaggerUIOptions;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=route.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.types.d.ts","sourceRoot":"","sources":["../../src/types/route.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC3F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEpD;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEhF,mEAAmE;AACnE,MAAM,MAAM,sBAAsB,GAC9B,kBAAkB,GAClB,mCAAmC,GACnC,qBAAqB,CAAA;AAEzB,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,sCAAsC;IACtC,WAAW,CAAC,EAAE,sBAAsB,CAAA;IACpC,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,OAAO,CAAC,EAAE,WAAW,CAAA;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;AAE9D,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,aAAa,CAAA;IACrB,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,mEAAmE;IACnE,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;CACxC;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,WAAW,CAAA;IACjB,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IACrB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACpC,OAAO,CAAC,EAAE,aAAa,EAAE,CAAA;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAA;IACvD;;;OAGG;IACH,WAAW,CAAC,EAAE,iBAAiB,CAAC,OAAO,CAAC,EAAE,CAAA;IAC1C,SAAS,CAAC,EAAE,gBAAgB,CAAA;CAC7B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ValidationSchema } from 'lykosjs';
|
|
2
|
+
export type LykosSchema = ValidationSchema;
|
|
3
|
+
export type JsonSchemaTypeName = 'string' | 'number' | 'boolean' | 'array' | 'object' | 'null';
|
|
4
|
+
/** The subset of JSON Schema (draft 2020-12, as used by OpenAPI 3.1) this library emits. */
|
|
5
|
+
export interface JsonSchema {
|
|
6
|
+
type?: JsonSchemaTypeName | readonly JsonSchemaTypeName[];
|
|
7
|
+
format?: 'email' | 'uri';
|
|
8
|
+
pattern?: string;
|
|
9
|
+
enum?: readonly (string | null)[];
|
|
10
|
+
minLength?: number;
|
|
11
|
+
maxLength?: number;
|
|
12
|
+
minimum?: number;
|
|
13
|
+
maximum?: number;
|
|
14
|
+
minItems?: number;
|
|
15
|
+
maxItems?: number;
|
|
16
|
+
description?: string;
|
|
17
|
+
properties?: Readonly<Record<string, JsonSchema>>;
|
|
18
|
+
required?: readonly string[];
|
|
19
|
+
}
|
|
20
|
+
export interface JsonObjectSchema extends JsonSchema {
|
|
21
|
+
type: 'object';
|
|
22
|
+
properties: Readonly<Record<string, JsonSchema>>;
|
|
23
|
+
}
|
|
24
|
+
/** One converted field of a LykosJS schema. */
|
|
25
|
+
export interface ConvertedField {
|
|
26
|
+
readonly name: string;
|
|
27
|
+
readonly required: boolean;
|
|
28
|
+
readonly schema: JsonSchema;
|
|
29
|
+
}
|
|
30
|
+
/** Result of converting a LykosJS schema. */
|
|
31
|
+
export interface ConvertedSchema {
|
|
32
|
+
readonly fields: readonly ConvertedField[];
|
|
33
|
+
readonly objectSchema: JsonObjectSchema;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=schema.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.types.d.ts","sourceRoot":"","sources":["../../src/types/schema.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C,MAAM,MAAM,WAAW,GAAG,gBAAgB,CAAA;AAE1C,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;AAE9F,4FAA4F;AAC5F,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,kBAAkB,GAAG,SAAS,kBAAkB,EAAE,CAAA;IACzD,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAA;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA;IACjD,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC7B;AAED,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD,IAAI,EAAE,QAAQ,CAAA;IACd,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA;CACjD;AAED,+CAA+C;AAC/C,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;CAC5B;AAED,6CAA6C;AAC7C,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,CAAA;IAC1C,QAAQ,CAAC,YAAY,EAAE,gBAAgB,CAAA;CACxC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ContextHandler } from 'lykosjs';
|
|
2
|
+
import type { ResolvedSwaggerUI } from '../types/internal.types.js';
|
|
3
|
+
export interface DocsRoute {
|
|
4
|
+
readonly path: string;
|
|
5
|
+
readonly handler: ContextHandler;
|
|
6
|
+
}
|
|
7
|
+
export declare function escapeHtml(value: string): string;
|
|
8
|
+
export declare function assetBase(docsPath: string): string;
|
|
9
|
+
export declare function renderHtml(docsPath: string, title: string): string;
|
|
10
|
+
export declare function renderInitScript(jsonPath: string, ui: ResolvedSwaggerUI): string;
|
|
11
|
+
/**
|
|
12
|
+
* Builds the documentation routes. Everything except the (cached on first use)
|
|
13
|
+
* Swagger UI static files is computed once, here: requests never trigger generation.
|
|
14
|
+
*/
|
|
15
|
+
export declare function createDocsRoutes(input: {
|
|
16
|
+
readonly docsPath: string | undefined;
|
|
17
|
+
readonly jsonPath: string | undefined;
|
|
18
|
+
readonly json: string;
|
|
19
|
+
readonly ui: ResolvedSwaggerUI;
|
|
20
|
+
}): DocsRoute[];
|
|
21
|
+
//# sourceMappingURL=swagger-ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swagger-ui.d.ts","sourceRoot":"","sources":["../../src/ui/swagger-ui.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AA2BnE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAA;CACjC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOhD;AAoBD,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAiBlE;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,iBAAiB,GAAG,MAAM,CAehF;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,EAAE,iBAAiB,CAAA;CAC/B,GAAG,SAAS,EAAE,CAyEd"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
2
|
+
export declare function isNonEmptyString(value: unknown): value is string;
|
|
3
|
+
/** True when the string contains control characters (incl. newlines in single-line fields). */
|
|
4
|
+
export declare function hasControlCharacters(value: string): boolean;
|
|
5
|
+
export declare function isHttpUrl(value: string): boolean;
|
|
6
|
+
//# sourceMappingURL=guards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../src/utils/guards.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAEhE;AAED,+FAA+F;AAC/F,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAM3D;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAOhD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type PathSegment = {
|
|
2
|
+
readonly kind: 'static';
|
|
3
|
+
readonly value: string;
|
|
4
|
+
} | {
|
|
5
|
+
readonly kind: 'param';
|
|
6
|
+
readonly name: string;
|
|
7
|
+
};
|
|
8
|
+
export interface ParsedPath {
|
|
9
|
+
/** OpenAPI style, normalized: `/users/{id}`. */
|
|
10
|
+
readonly canonical: string;
|
|
11
|
+
/** Same shape with parameter names erased: `/users/{}`. */
|
|
12
|
+
readonly shape: string;
|
|
13
|
+
readonly params: readonly string[];
|
|
14
|
+
readonly segments: readonly PathSegment[];
|
|
15
|
+
}
|
|
16
|
+
export type PathParseResult = {
|
|
17
|
+
readonly ok: true;
|
|
18
|
+
readonly path: ParsedPath;
|
|
19
|
+
} | {
|
|
20
|
+
readonly ok: false;
|
|
21
|
+
readonly reason: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Parses a path written by a developer: LykosJS style (`:id`) or OpenAPI style (`{id}`).
|
|
25
|
+
* Empty segments are dropped, exactly like LykosJS's router does, so
|
|
26
|
+
* `/users/` and `/users` are the same path.
|
|
27
|
+
*/
|
|
28
|
+
export declare function parsePath(path: unknown): PathParseResult;
|
|
29
|
+
/** Parses a path as stored by LykosJS's router (already normalized, `:id` style). */
|
|
30
|
+
export declare function parseRegisteredPath(path: string): ParsedPath;
|
|
31
|
+
/** True when a registered (possibly dynamic) route would match the concrete path `target`. */
|
|
32
|
+
export declare function routeMatchesStaticPath(route: ParsedPath, target: ParsedPath): boolean;
|
|
33
|
+
//# sourceMappingURL=path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/utils/path.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GACnB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAErD,MAAM,WAAW,UAAU;IACzB,gDAAgD;IAChD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,2DAA2D;IAC3D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;IAClC,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAA;CAC1C;AAED,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAChD;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAuBnD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,eAAe,CAqDxD;AAED,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAW5D;AAED,8FAA8F;AAC9F,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAQrF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { RegisteredRoute } from 'lykosjs';
|
|
2
|
+
import type { ResolvedRoute } from '../types/internal.types.js';
|
|
3
|
+
import type { ValidationIssue } from './validation-error.js';
|
|
4
|
+
export interface RouteValidationResult {
|
|
5
|
+
/** Missing *required* routes (errors). */
|
|
6
|
+
readonly issues: readonly ValidationIssue[];
|
|
7
|
+
/** Documented routes that really exist in LykosJS, in declaration order. */
|
|
8
|
+
readonly active: readonly ResolvedRoute[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Strict validation: every documented route must match a registered LykosJS
|
|
12
|
+
* route on method AND path (parameter names included).
|
|
13
|
+
*
|
|
14
|
+
* - present → documented
|
|
15
|
+
* - missing + isRequired (default) → error (all errors are collected)
|
|
16
|
+
* - missing + isRequired: false → left out of the document, no error
|
|
17
|
+
*/
|
|
18
|
+
export declare function validateRegisteredRoutes(routes: readonly ResolvedRoute[], registered: readonly RegisteredRoute[]): RouteValidationResult;
|
|
19
|
+
export interface DocsEndpoint {
|
|
20
|
+
readonly target: string;
|
|
21
|
+
readonly path: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A documentation path must not collide with the application's own routes:
|
|
25
|
+
* LykosJS gives static routes priority, so a documentation route would silently
|
|
26
|
+
* take over the path of a registered GET route (including dynamic ones like `/:slug`).
|
|
27
|
+
*/
|
|
28
|
+
export declare function findDocsConflicts(endpoints: readonly DocsEndpoint[], registered: readonly RegisteredRoute[]): ValidationIssue[];
|
|
29
|
+
//# sourceMappingURL=route-validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-validator.d.ts","sourceRoot":"","sources":["../../src/validation/route-validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAE5D,MAAM,WAAW,qBAAqB;IACpC,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAA;IAC3C,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAA;CAC1C;AAMD;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,UAAU,EAAE,SAAS,eAAe,EAAE,GACrC,qBAAqB,CAiDvB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,SAAS,YAAY,EAAE,EAClC,UAAU,EAAE,SAAS,eAAe,EAAE,GACrC,eAAe,EAAE,CAsBnB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type ValidationIssue = {
|
|
2
|
+
readonly kind: 'config';
|
|
3
|
+
/** Where the problem is, e.g. `routes.getUsers.path`. */
|
|
4
|
+
readonly location: string;
|
|
5
|
+
readonly message: string;
|
|
6
|
+
} | {
|
|
7
|
+
readonly kind: 'missing-route';
|
|
8
|
+
readonly key: string;
|
|
9
|
+
readonly method: string;
|
|
10
|
+
readonly path: string;
|
|
11
|
+
readonly hints: readonly string[];
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: 'docs-conflict';
|
|
14
|
+
readonly target: string;
|
|
15
|
+
readonly path: string;
|
|
16
|
+
readonly message: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function formatIssues(issues: readonly ValidationIssue[]): string;
|
|
19
|
+
/**
|
|
20
|
+
* Thrown by `new OpenAPI()` (invalid configuration) and `OpenAPI.setup()`
|
|
21
|
+
* (strict validation, documentation path conflicts, incompatible LykosJS).
|
|
22
|
+
* All problems found are reported together in `issues`.
|
|
23
|
+
*/
|
|
24
|
+
export declare class OpenAPIValidationError extends Error {
|
|
25
|
+
readonly issues: readonly ValidationIssue[];
|
|
26
|
+
constructor(issues: readonly ValidationIssue[], message?: string);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=validation-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation-error.d.ts","sourceRoot":"","sources":["../../src/validation/validation-error.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GACvB;IACE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;IACvB,yDAAyD;IACzD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAA;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CAClC,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAA;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,CAAA;AAoBL,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,GAAG,MAAM,CA+BvE;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAA;gBAE/B,MAAM,EAAE,SAAS,eAAe,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM;CAKjE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lykosjs/openapi",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Official OpenAPI 3.1 documentation generator and Swagger UI for the LykosJS framework. Document every endpoint in one place and let LykosJS handle the rest.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE"
|
|
20
|
+
],
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"scripts": {
|
|
23
|
+
"clean": "bun -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
24
|
+
"build:js": "bun build ./src/index.ts --outdir ./dist --target bun --packages external",
|
|
25
|
+
"build:types": "tsc -p tsconfig.build.json",
|
|
26
|
+
"build": "bun run clean && bun run build:js && bun run build:types",
|
|
27
|
+
"test": "bun test",
|
|
28
|
+
"typecheck": "tsc --noEmit",
|
|
29
|
+
"check": "bun run typecheck && bun test"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"lykosjs",
|
|
33
|
+
"openapi",
|
|
34
|
+
"openapi-3.1",
|
|
35
|
+
"swagger",
|
|
36
|
+
"swagger-ui",
|
|
37
|
+
"bun",
|
|
38
|
+
"typescript"
|
|
39
|
+
],
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"bun": "1.4.4"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"lykosjs": "1.0.0"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"swagger-ui-dist": "5.18.2"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@seriousme/openapi-schema-validator": "^2.12.0",
|
|
55
|
+
"@types/bun": "^1.4.4",
|
|
56
|
+
"lykosjs": "1.0.0",
|
|
57
|
+
"typescript": "^5.9.3"
|
|
58
|
+
}
|
|
59
|
+
}
|