@kizunajs/openapi 2.0.0-beta.11 → 2.0.0-beta.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.cjs +8 -4
- package/dist/index.d.cts +5 -2
- package/dist/index.d.mts +5 -2
- package/dist/index.mjs +8 -4
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -91,10 +91,10 @@ const JSON_ENCODING = {
|
|
|
91
91
|
bigint: { type: "string" }
|
|
92
92
|
};
|
|
93
93
|
/**
|
|
94
|
-
* kizuna's metadata widens JSON Schema: `deprecated` may carry a message
|
|
95
|
-
* `example` holds one value or several
|
|
96
|
-
* `examples` array
|
|
97
|
-
* Swift's `@available`.
|
|
94
|
+
* kizuna's metadata widens JSON Schema: `deprecated` may carry a message,
|
|
95
|
+
* `example` holds one value or several, and `brand` has no keyword. Emit
|
|
96
|
+
* `deprecated: true`, an `examples` array and `x-kizuna-brand`; the message
|
|
97
|
+
* stays in outputs with a place for it, like Swift's `@available`.
|
|
98
98
|
*/
|
|
99
99
|
const normalizeMeta = ({ zodSchema, jsonSchema }) => {
|
|
100
100
|
const encoding = JSON_ENCODING[(0, kizunajs_generator.readDef)(zodSchema).type ?? ""];
|
|
@@ -106,6 +106,10 @@ const normalizeMeta = ({ zodSchema, jsonSchema }) => {
|
|
|
106
106
|
jsonSchema.examples = [...given, ...declared];
|
|
107
107
|
delete jsonSchema.example;
|
|
108
108
|
}
|
|
109
|
+
if ("brand" in jsonSchema) {
|
|
110
|
+
jsonSchema["x-kizuna-brand"] = jsonSchema.brand;
|
|
111
|
+
delete jsonSchema.brand;
|
|
112
|
+
}
|
|
109
113
|
};
|
|
110
114
|
const toJsonSchema = (schema, io = "output") => {
|
|
111
115
|
const id = (0, kizunajs_generator.readMetaId)(schema);
|
package/dist/index.d.cts
CHANGED
|
@@ -2,6 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { RouteDefinition } from "kizunajs/generator";
|
|
3
3
|
import * as _$kizunajs from "kizunajs";
|
|
4
4
|
import { ApiDefinition } from "kizunajs";
|
|
5
|
+
import * as _$kizunajs_plugin0 from "kizunajs/plugin";
|
|
5
6
|
import { RoutePath } from "kizunajs/plugin";
|
|
6
7
|
|
|
7
8
|
//#region src/types.d.ts
|
|
@@ -200,8 +201,8 @@ declare const openApiPlugin: {
|
|
|
200
201
|
pageTitle?: string | undefined;
|
|
201
202
|
configuration?: Record<string, unknown> | undefined;
|
|
202
203
|
} & {
|
|
203
|
-
|
|
204
|
-
}): _$kizunajs.PluginDeclaration<Slug, {
|
|
204
|
+
basePath?: never;
|
|
205
|
+
} & _$kizunajs_plugin0.SlugOption<Slug>): _$kizunajs.PluginDeclaration<Slug, {
|
|
205
206
|
routes: _$kizunajs.PluginRoutes;
|
|
206
207
|
generators: _$kizunajs.GeneratedFile[];
|
|
207
208
|
}>;
|
|
@@ -232,6 +233,8 @@ declare const openApiPlugin: {
|
|
|
232
233
|
cdnUrl?: string | undefined;
|
|
233
234
|
pageTitle?: string | undefined;
|
|
234
235
|
configuration?: Record<string, unknown> | undefined;
|
|
236
|
+
} & {
|
|
237
|
+
basePath?: never;
|
|
235
238
|
}): _$kizunajs.PluginDeclaration<"openApi", {
|
|
236
239
|
routes: _$kizunajs.PluginRoutes;
|
|
237
240
|
generators: _$kizunajs.GeneratedFile[];
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import * as _$kizunajs_plugin0 from "kizunajs/plugin";
|
|
2
3
|
import { RoutePath } from "kizunajs/plugin";
|
|
3
4
|
import { RouteDefinition } from "kizunajs/generator";
|
|
4
5
|
import * as _$kizunajs from "kizunajs";
|
|
@@ -200,8 +201,8 @@ declare const openApiPlugin: {
|
|
|
200
201
|
pageTitle?: string | undefined;
|
|
201
202
|
configuration?: Record<string, unknown> | undefined;
|
|
202
203
|
} & {
|
|
203
|
-
|
|
204
|
-
}): _$kizunajs.PluginDeclaration<Slug, {
|
|
204
|
+
basePath?: never;
|
|
205
|
+
} & _$kizunajs_plugin0.SlugOption<Slug>): _$kizunajs.PluginDeclaration<Slug, {
|
|
205
206
|
routes: _$kizunajs.PluginRoutes;
|
|
206
207
|
generators: _$kizunajs.GeneratedFile[];
|
|
207
208
|
}>;
|
|
@@ -232,6 +233,8 @@ declare const openApiPlugin: {
|
|
|
232
233
|
cdnUrl?: string | undefined;
|
|
233
234
|
pageTitle?: string | undefined;
|
|
234
235
|
configuration?: Record<string, unknown> | undefined;
|
|
236
|
+
} & {
|
|
237
|
+
basePath?: never;
|
|
235
238
|
}): _$kizunajs.PluginDeclaration<"openApi", {
|
|
236
239
|
routes: _$kizunajs.PluginRoutes;
|
|
237
240
|
generators: _$kizunajs.GeneratedFile[];
|
package/dist/index.mjs
CHANGED
|
@@ -90,10 +90,10 @@ const JSON_ENCODING = {
|
|
|
90
90
|
bigint: { type: "string" }
|
|
91
91
|
};
|
|
92
92
|
/**
|
|
93
|
-
* kizuna's metadata widens JSON Schema: `deprecated` may carry a message
|
|
94
|
-
* `example` holds one value or several
|
|
95
|
-
* `examples` array
|
|
96
|
-
* Swift's `@available`.
|
|
93
|
+
* kizuna's metadata widens JSON Schema: `deprecated` may carry a message,
|
|
94
|
+
* `example` holds one value or several, and `brand` has no keyword. Emit
|
|
95
|
+
* `deprecated: true`, an `examples` array and `x-kizuna-brand`; the message
|
|
96
|
+
* stays in outputs with a place for it, like Swift's `@available`.
|
|
97
97
|
*/
|
|
98
98
|
const normalizeMeta = ({ zodSchema, jsonSchema }) => {
|
|
99
99
|
const encoding = JSON_ENCODING[readDef(zodSchema).type ?? ""];
|
|
@@ -105,6 +105,10 @@ const normalizeMeta = ({ zodSchema, jsonSchema }) => {
|
|
|
105
105
|
jsonSchema.examples = [...given, ...declared];
|
|
106
106
|
delete jsonSchema.example;
|
|
107
107
|
}
|
|
108
|
+
if ("brand" in jsonSchema) {
|
|
109
|
+
jsonSchema["x-kizuna-brand"] = jsonSchema.brand;
|
|
110
|
+
delete jsonSchema.brand;
|
|
111
|
+
}
|
|
108
112
|
};
|
|
109
113
|
const toJsonSchema = (schema, io = "output") => {
|
|
110
114
|
const id = readMetaId(schema);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kizunajs/openapi",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.13",
|
|
4
4
|
"description": "OpenAPI 3.1 generation for Kizuna.js APIs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kizunajs",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"zod": "^4.0.0",
|
|
63
|
-
"kizunajs": "2.0.0-beta.
|
|
63
|
+
"kizunajs": "2.0.0-beta.13"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/express": "^5.0.0",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"tsdown": "^0.21.0",
|
|
69
69
|
"typescript": "^6.0.3",
|
|
70
70
|
"zod": "^4.0.0",
|
|
71
|
-
"
|
|
72
|
-
"kizunajs": "2.0.0-beta.
|
|
71
|
+
"kizunajs": "2.0.0-beta.13",
|
|
72
|
+
"@kizunajs/express": "2.0.0-beta.13"
|
|
73
73
|
},
|
|
74
74
|
"scripts": {
|
|
75
75
|
"build": "tsdown src/index.ts --format esm,cjs --dts --clean --external kizunajs --external zod",
|