@capixjs/transport-rest 0.1.0-alpha.12 → 0.1.0-alpha.13

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.ts CHANGED
@@ -7,4 +7,6 @@ export { compileRouter, generateRoutes } from './router.js';
7
7
  export type { RouteDefinition, RouterMatch, Router, GenerateRoutesOptions, HttpOverride } from './router.js';
8
8
  export { uploadedFile } from './multipart.js';
9
9
  export type { UploadedFile, MultipartOptions } from './multipart.js';
10
+ export { generateOpenAPI } from './openapi.js';
11
+ export type { OpenAPIOptions, OpenAPIServer } from './openapi.js';
10
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,YAAY,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC7G,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,YAAY,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC7G,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -4,4 +4,5 @@
4
4
  export { restTransport } from './transport.js';
5
5
  export { compileRouter, generateRoutes } from './router.js';
6
6
  export { uploadedFile } from './multipart.js';
7
+ export { generateOpenAPI } from './openapi.js';
7
8
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * openapi.ts — generate an OpenAPI 3.1 document from a capability registry.
3
+ *
4
+ * Routes come from the same inference engine the REST transport uses at mount
5
+ * time (generateRoutes), so the spec always matches what the server actually
6
+ * serves — including urlCase and route overrides. Input schemas become path
7
+ * parameters, query parameters (for GET/DELETE), or a JSON request body
8
+ * (for POST/PATCH/PUT); output schemas become the `data` payload of the 200
9
+ * response, mirroring the transport's `{ "data": ... }` envelope.
10
+ *
11
+ * Use programmatically:
12
+ * import { generateOpenAPI } from '@capixjs/transport-rest';
13
+ * const spec = generateOpenAPI(registry, { title: 'My API', version: '1.0.0' });
14
+ *
15
+ * Or via the CLI:
16
+ * capix openapi --output openapi.json
17
+ */
18
+ import type { CapabilityRegistry } from '@capixjs/core';
19
+ import type { HttpOverride } from './router.js';
20
+ export type OpenAPIServer = {
21
+ readonly url: string;
22
+ readonly description?: string;
23
+ };
24
+ export type OpenAPIOptions = {
25
+ /** info.title — default 'Capix API'. */
26
+ readonly title?: string;
27
+ /** info.version — default '0.0.0'. */
28
+ readonly version?: string;
29
+ /** info.description. */
30
+ readonly description?: string;
31
+ /** servers array (e.g. [{ url: 'https://api.example.com' }]). */
32
+ readonly servers?: ReadonlyArray<OpenAPIServer>;
33
+ /** Case style for inferred URL segments — must match the restTransport option. */
34
+ readonly urlCase?: 'kebab' | 'camel' | 'snake';
35
+ /** Route overrides — must match the restTransport option for an accurate spec. */
36
+ readonly overrides?: Record<string, HttpOverride>;
37
+ };
38
+ /**
39
+ * Generates an OpenAPI 3.1 document for every capability in the registry.
40
+ *
41
+ * Pass the same `urlCase` and `overrides` you give to `restTransport` so the
42
+ * generated paths match the running server.
43
+ */
44
+ export declare function generateOpenAPI(registry: CapabilityRegistry, options?: OpenAPIOptions): Record<string, unknown>;
45
+ //# sourceMappingURL=openapi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../src/openapi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,wCAAwC;IACxC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,sCAAsC;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,wBAAwB;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,iEAAiE;IACjE,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAChD,kFAAkF;IAClF,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;IAC/C,kFAAkF;IAClF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CACnD,CAAC;AAkDF;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,GAAE,cAAmB,GAC3B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA8HzB"}
@@ -0,0 +1,190 @@
1
+ /**
2
+ * openapi.ts — generate an OpenAPI 3.1 document from a capability registry.
3
+ *
4
+ * Routes come from the same inference engine the REST transport uses at mount
5
+ * time (generateRoutes), so the spec always matches what the server actually
6
+ * serves — including urlCase and route overrides. Input schemas become path
7
+ * parameters, query parameters (for GET/DELETE), or a JSON request body
8
+ * (for POST/PATCH/PUT); output schemas become the `data` payload of the 200
9
+ * response, mirroring the transport's `{ "data": ... }` envelope.
10
+ *
11
+ * Use programmatically:
12
+ * import { generateOpenAPI } from '@capixjs/transport-rest';
13
+ * const spec = generateOpenAPI(registry, { title: 'My API', version: '1.0.0' });
14
+ *
15
+ * Or via the CLI:
16
+ * capix openapi --output openapi.json
17
+ */
18
+ import { zodToJsonSchema } from 'zod-to-json-schema';
19
+ import { generateRoutes } from './router.js';
20
+ const NO_BODY_METHODS = new Set(['GET', 'HEAD', 'DELETE']);
21
+ const ERROR_RESPONSE_SCHEMA = {
22
+ type: 'object',
23
+ properties: {
24
+ error: { type: 'string', description: 'Machine-readable error code (e.g. NotFound)' },
25
+ message: { type: 'string', description: 'Human-readable error message' },
26
+ meta: { type: 'object', additionalProperties: true, description: 'Optional error details' },
27
+ },
28
+ required: ['error', 'message'],
29
+ };
30
+ function errorRef(description) {
31
+ return {
32
+ description,
33
+ content: {
34
+ 'application/json': {
35
+ schema: { $ref: '#/components/schemas/ErrorResponse' },
36
+ },
37
+ },
38
+ };
39
+ }
40
+ /** Converts a Zod schema to JSON Schema; null when conversion fails. */
41
+ function toJsonSchema(schema) {
42
+ try {
43
+ const js = zodToJsonSchema(schema, {
44
+ target: 'jsonSchema7',
45
+ $refStrategy: 'none',
46
+ });
47
+ delete js['$schema'];
48
+ return js;
49
+ }
50
+ catch {
51
+ return null;
52
+ }
53
+ }
54
+ function pathParamNames(routePath) {
55
+ const names = [];
56
+ for (const seg of routePath.split('/')) {
57
+ if (seg.startsWith(':'))
58
+ names.push(seg.slice(1));
59
+ }
60
+ return names;
61
+ }
62
+ /**
63
+ * Generates an OpenAPI 3.1 document for every capability in the registry.
64
+ *
65
+ * Pass the same `urlCase` and `overrides` you give to `restTransport` so the
66
+ * generated paths match the running server.
67
+ */
68
+ export function generateOpenAPI(registry, options = {}) {
69
+ const routes = generateRoutes(registry, {
70
+ ...(options.urlCase !== undefined ? { urlCase: options.urlCase } : {}),
71
+ ...(options.overrides !== undefined ? { overrides: options.overrides } : {}),
72
+ });
73
+ const paths = {};
74
+ const tags = new Set();
75
+ for (const route of routes) {
76
+ const cap = registry.get(route.capability);
77
+ if (cap === undefined)
78
+ continue;
79
+ const openapiPath = route.path.replace(/:([^/]+)/g, '{$1}');
80
+ const params = pathParamNames(route.path);
81
+ const paramSet = new Set(params);
82
+ const inputJs = cap.inputSchema !== null ? toJsonSchema(cap.inputSchema) : null;
83
+ const properties = (inputJs?.['properties'] ?? {});
84
+ const requiredFields = new Set((inputJs?.['required'] ?? []));
85
+ // Object schemas split into parameters/body; non-object schemas (z.record,
86
+ // z.any) can't be decomposed — they become the whole request body.
87
+ const isObjectSchema = inputJs !== null && 'properties' in inputJs;
88
+ const parameters = [];
89
+ for (const name of params) {
90
+ parameters.push({
91
+ name,
92
+ in: 'path',
93
+ required: true,
94
+ schema: properties[name] ?? { type: 'string' },
95
+ });
96
+ }
97
+ let requestBody = null;
98
+ if (NO_BODY_METHODS.has(route.method)) {
99
+ // Remaining schema fields are query parameters
100
+ for (const [name, schema] of Object.entries(properties)) {
101
+ if (paramSet.has(name))
102
+ continue;
103
+ parameters.push({
104
+ name,
105
+ in: 'query',
106
+ required: requiredFields.has(name),
107
+ schema,
108
+ });
109
+ }
110
+ }
111
+ else if (isObjectSchema) {
112
+ const bodyProps = {};
113
+ const bodyRequired = [];
114
+ for (const [name, schema] of Object.entries(properties)) {
115
+ if (paramSet.has(name))
116
+ continue;
117
+ bodyProps[name] = schema;
118
+ if (requiredFields.has(name))
119
+ bodyRequired.push(name);
120
+ }
121
+ if (Object.keys(bodyProps).length > 0) {
122
+ requestBody = {
123
+ required: bodyRequired.length > 0,
124
+ content: {
125
+ 'application/json': {
126
+ schema: {
127
+ type: 'object',
128
+ properties: bodyProps,
129
+ ...(bodyRequired.length > 0 ? { required: bodyRequired } : {}),
130
+ },
131
+ },
132
+ },
133
+ };
134
+ }
135
+ }
136
+ else if (inputJs !== null) {
137
+ requestBody = {
138
+ required: true,
139
+ content: { 'application/json': { schema: inputJs } },
140
+ };
141
+ }
142
+ const outputJs = cap.outputSchema !== null ? toJsonSchema(cap.outputSchema) : null;
143
+ const responses = {
144
+ '200': {
145
+ description: 'Success',
146
+ content: {
147
+ 'application/json': {
148
+ schema: {
149
+ type: 'object',
150
+ properties: { data: outputJs ?? {} },
151
+ required: ['data'],
152
+ },
153
+ },
154
+ },
155
+ },
156
+ ...(cap.inputSchema !== null ? { '400': errorRef('Validation error') } : {}),
157
+ default: errorRef('Error'),
158
+ };
159
+ const segments = route.capability.split('.');
160
+ const group = segments.length > 1 ? segments[0] : null;
161
+ if (group !== null)
162
+ tags.add(group);
163
+ const operation = {
164
+ operationId: route.capability.replaceAll('.', '_'),
165
+ summary: route.capability,
166
+ ...(group !== null ? { tags: [group] } : {}),
167
+ ...(parameters.length > 0 ? { parameters } : {}),
168
+ ...(requestBody !== null ? { requestBody } : {}),
169
+ responses,
170
+ };
171
+ if (!(openapiPath in paths))
172
+ paths[openapiPath] = {};
173
+ paths[openapiPath][route.method.toLowerCase()] = operation;
174
+ }
175
+ return {
176
+ openapi: '3.1.0',
177
+ info: {
178
+ title: options.title ?? 'Capix API',
179
+ version: options.version ?? '0.0.0',
180
+ ...(options.description !== undefined ? { description: options.description } : {}),
181
+ },
182
+ ...(options.servers !== undefined && options.servers.length > 0
183
+ ? { servers: options.servers }
184
+ : {}),
185
+ paths,
186
+ components: { schemas: { ErrorResponse: ERROR_RESPONSE_SCHEMA } },
187
+ ...(tags.size > 0 ? { tags: [...tags].sort().map((name) => ({ name })) } : {}),
188
+ };
189
+ }
190
+ //# sourceMappingURL=openapi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openapi.js","sourceRoot":"","sources":["../src/openapi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA0B7C,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAE3D,MAAM,qBAAqB,GAAe;IACxC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,KAAK,EAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6CAA6C,EAAE;QACvF,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8BAA8B,EAAE;QACxE,IAAI,EAA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AAO,EAAE,OAAO,CAAC,OAAO,EAAE;YAC9B,CAAC,CAAC,EAAE,CAAC;QACP,KAAK;QACL,UAAU,EAAE,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,qBAAqB,EAAE,EAAE;QACjE,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC/E,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capixjs/transport-rest",
3
- "version": "0.1.0-alpha.12",
3
+ "version": "0.1.0-alpha.13",
4
4
  "description": "Capix HTTP/REST transport",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -46,7 +46,7 @@
46
46
  "form-data": "^4.0.5",
47
47
  "typescript": "^5.5.0",
48
48
  "vitest": "^1.6.0",
49
- "@capixjs/core": "0.1.0-alpha.12"
49
+ "@capixjs/core": "0.1.0-alpha.13"
50
50
  },
51
51
  "scripts": {
52
52
  "build": "tsc",