kizunajs 2.0.0-beta.21 → 2.0.0-beta.23
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/README.md +1 -1
- package/dist/{adapter-D4bTPElA.d.mts → adapter-BdkB6ql9.d.mts} +5 -1
- package/dist/{adapter-ClaFZoab.cjs → adapter-CK8ccDOC.cjs} +78 -8
- package/dist/{adapter-BSqNrxhq.mjs → adapter-DU3Ljl0P.mjs} +73 -9
- package/dist/{adapter-C3WYdSfx.d.cts → adapter-nQIkQwsM.d.cts} +5 -1
- package/dist/adapter.cjs +4 -3
- package/dist/adapter.d.cts +2 -2
- package/dist/adapter.d.mts +2 -2
- package/dist/adapter.mjs +4 -4
- package/dist/{error-response-CNQaKVYd.mjs → error-response-D7urgxeq.mjs} +16 -3
- package/dist/{error-response-C9ymqSU4.cjs → error-response-DN5Dsf8b.cjs} +21 -2
- package/dist/generator.cjs +5 -3
- package/dist/generator.d.cts +6 -2
- package/dist/generator.d.mts +6 -2
- package/dist/generator.mjs +5 -4
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +4 -4
- package/dist/jobs-entry.cjs +2 -2
- package/dist/jobs-entry.d.cts +1 -1
- package/dist/jobs-entry.d.mts +1 -1
- package/dist/jobs-entry.mjs +2 -2
- package/dist/{plugin-server-kUsK7thV.cjs → plugin-server-CfF82yZL.cjs} +11 -6
- package/dist/{plugin-server-BztlE1fz.mjs → plugin-server-DNQ9_DL7.mjs} +11 -6
- package/dist/plugin.d.cts +1 -1
- package/dist/plugin.d.mts +1 -1
- package/dist/{schemas-DNPVDvkd.cjs → schemas-Bre1FVHq.cjs} +1 -1
- package/dist/{schemas-HW2FDsvz.mjs → schemas-DBX8DwFb.mjs} +1 -1
- package/dist/schemas.cjs +2 -2
- package/dist/schemas.mjs +2 -2
- package/package.json +1 -1
- package/src/adapter.ts +8 -5
- package/src/coercion.ts +25 -16
- package/src/generator.ts +4 -2
- package/src/routes.ts +97 -1
- package/src/zod-internals.ts +17 -2
package/dist/generator.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { K as RouteDefinition, W as ResponseHeaders, Z as Routes, j as CachePolicy } from "./error-response-YbkRMKno.cjs";
|
|
2
|
-
import {
|
|
2
|
+
import { At as sanitizeIdentifier, Cn as GeneratedFile, Ct as resolveResponseBody, Dt as resolveResponseHeaders, Et as resolveResponseEtag, In as FlattenedJob, Ji as EVENT_STREAM_MEDIA_TYPE, Mt as statusToCamelCase, Nt as toCamelCase, Ot as resolveResponseStream, Pn as CompiledJob, Pt as toPascalCase, Qn as isCompiledJob, St as mergeHeaderFields, Tn as ApiDefinition, Tt as resolveResponseContentType, Zn as flattenJobs, _t as isJsonMediaType, bt as isZodSchema, ca as soleStreamResponse, da as streamSchemas, er as jobAt, fa as streamStatuses, gt as isHintPrefix, jt as shortTypeName, kt as sanitizeFieldName, la as streamContentType, oa as isNamedStream, qi as parsePath, qn as Jobs, ra as StreamMode, sa as routeStreams, ua as streamMode, vt as isStreamResponse, wt as resolveResponseCache, xt as localTypeName, yt as isSuccessStatus } from "./adapter-nQIkQwsM.cjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/zod-internals.d.ts
|
|
@@ -107,6 +107,10 @@ declare const isBinarySchema: (schema: z.core.$ZodType) => boolean;
|
|
|
107
107
|
* Returns a schema's metadata (set via `.meta()`), or undefined.
|
|
108
108
|
*/
|
|
109
109
|
declare const readMeta: (schema: z.core.$ZodType) => Record<string, unknown> | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Returns the `Kizuna.model` a schema is, or was copied from by `.describe()` or `.meta()`.
|
|
112
|
+
*/
|
|
113
|
+
declare const readModelSchema: (schema: z.core.$ZodType) => z.core.$ZodType | undefined;
|
|
110
114
|
/**
|
|
111
115
|
* Returns a `Kizuna.model` schema's `id` metadata, or undefined.
|
|
112
116
|
*/
|
|
@@ -376,4 +380,4 @@ interface GeneratorDefinition<Schema extends z.ZodType | undefined> {
|
|
|
376
380
|
*/
|
|
377
381
|
declare const defineGenerator: <Schema extends z.ZodType | undefined = undefined>(definition: GeneratorDefinition<Schema>) => ((options: OptionsInput<Schema> & GeneratedFileOptions) => GeneratedFile);
|
|
378
382
|
//#endregion
|
|
379
|
-
export { ClientDefinition, type CompiledJob, type DiscriminatedUnion, EVENT_STREAM_MEDIA_TYPE, FILE_PROBE, type FlattenedJob, GenerateContext, type GeneratedFile, GeneratedFileOptions, GeneratorDefinition, GeneratorModelContext, GeneratorPluginInfo, GeneratorRouteContext, GeneratorWalk, type Jobs, type RouteDefinition, type Routes, type StreamMode, type ToolNameEntry, type ToolOrigin, WalkApiOptions, type ZodDef, cacheHeaders, defineClient, defineGenerator, deprecationHeaders, deriveToolNames, flattenJobs, globalRegistrySchemas, isBinarySchema, isCompiledJob, isDiscriminatedUnionSchema, isFileSchema, isHintPrefix, isIntegerSchema, isJsonMediaType, isNamedStream, isObjectSchema, isStreamResponse, isSuccessStatus, isVoidSchema, isZodSchema, jobAt, listedRoutes, localTypeName, mergeHeaderFields, parsePath, readDef, readDefType, readDeprecation, readDiscriminatedUnion, readDiscriminatorLiteral, readDiscriminatorStringLiteral, readMeta, readMetaBrand, readMetaDescription, readMetaExamples, readMetaId, readObjectShape, resolveResponseBody, resolveResponseCache, resolveResponseContentType, resolveResponseEtag, resolveResponseHeaders, resolveResponseStream, routeStreams, sanitizeFieldName, sanitizeIdentifier, shortTypeName, soleStreamResponse, statusToCamelCase, streamContentType, streamMode, streamSchemas, streamStatuses, toCamelCase, toPascalCase, toToolName, unwrapOptionalWrappers, walkApi };
|
|
383
|
+
export { ClientDefinition, type CompiledJob, type DiscriminatedUnion, EVENT_STREAM_MEDIA_TYPE, FILE_PROBE, type FlattenedJob, GenerateContext, type GeneratedFile, GeneratedFileOptions, GeneratorDefinition, GeneratorModelContext, GeneratorPluginInfo, GeneratorRouteContext, GeneratorWalk, type Jobs, type RouteDefinition, type Routes, type StreamMode, type ToolNameEntry, type ToolOrigin, WalkApiOptions, type ZodDef, cacheHeaders, defineClient, defineGenerator, deprecationHeaders, deriveToolNames, flattenJobs, globalRegistrySchemas, isBinarySchema, isCompiledJob, isDiscriminatedUnionSchema, isFileSchema, isHintPrefix, isIntegerSchema, isJsonMediaType, isNamedStream, isObjectSchema, isStreamResponse, isSuccessStatus, isVoidSchema, isZodSchema, jobAt, listedRoutes, localTypeName, mergeHeaderFields, parsePath, readDef, readDefType, readDeprecation, readDiscriminatedUnion, readDiscriminatorLiteral, readDiscriminatorStringLiteral, readMeta, readMetaBrand, readMetaDescription, readMetaExamples, readMetaId, readModelSchema, readObjectShape, resolveResponseBody, resolveResponseCache, resolveResponseContentType, resolveResponseEtag, resolveResponseHeaders, resolveResponseStream, routeStreams, sanitizeFieldName, sanitizeIdentifier, shortTypeName, soleStreamResponse, statusToCamelCase, streamContentType, streamMode, streamSchemas, streamStatuses, toCamelCase, toPascalCase, toToolName, unwrapOptionalWrappers, walkApi };
|
package/dist/generator.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { K as RouteDefinition, W as ResponseHeaders, Z as Routes, j as CachePolicy } from "./error-response-NoOGdh8H.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { At as sanitizeIdentifier, Cn as GeneratedFile, Ct as resolveResponseBody, Dt as resolveResponseHeaders, Et as resolveResponseEtag, In as FlattenedJob, Ji as EVENT_STREAM_MEDIA_TYPE, Mt as statusToCamelCase, Nt as toCamelCase, Ot as resolveResponseStream, Pn as CompiledJob, Pt as toPascalCase, Qn as isCompiledJob, St as mergeHeaderFields, Tn as ApiDefinition, Tt as resolveResponseContentType, Zn as flattenJobs, _t as isJsonMediaType, bt as isZodSchema, ca as soleStreamResponse, da as streamSchemas, er as jobAt, fa as streamStatuses, gt as isHintPrefix, jt as shortTypeName, kt as sanitizeFieldName, la as streamContentType, oa as isNamedStream, qi as parsePath, qn as Jobs, ra as StreamMode, sa as routeStreams, ua as streamMode, vt as isStreamResponse, wt as resolveResponseCache, xt as localTypeName, yt as isSuccessStatus } from "./adapter-BdkB6ql9.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/zod-internals.d.ts
|
|
@@ -107,6 +107,10 @@ declare const isBinarySchema: (schema: z.core.$ZodType) => boolean;
|
|
|
107
107
|
* Returns a schema's metadata (set via `.meta()`), or undefined.
|
|
108
108
|
*/
|
|
109
109
|
declare const readMeta: (schema: z.core.$ZodType) => Record<string, unknown> | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Returns the `Kizuna.model` a schema is, or was copied from by `.describe()` or `.meta()`.
|
|
112
|
+
*/
|
|
113
|
+
declare const readModelSchema: (schema: z.core.$ZodType) => z.core.$ZodType | undefined;
|
|
110
114
|
/**
|
|
111
115
|
* Returns a `Kizuna.model` schema's `id` metadata, or undefined.
|
|
112
116
|
*/
|
|
@@ -376,4 +380,4 @@ interface GeneratorDefinition<Schema extends z.ZodType | undefined> {
|
|
|
376
380
|
*/
|
|
377
381
|
declare const defineGenerator: <Schema extends z.ZodType | undefined = undefined>(definition: GeneratorDefinition<Schema>) => ((options: OptionsInput<Schema> & GeneratedFileOptions) => GeneratedFile);
|
|
378
382
|
//#endregion
|
|
379
|
-
export { ClientDefinition, type CompiledJob, type DiscriminatedUnion, EVENT_STREAM_MEDIA_TYPE, FILE_PROBE, type FlattenedJob, GenerateContext, type GeneratedFile, GeneratedFileOptions, GeneratorDefinition, GeneratorModelContext, GeneratorPluginInfo, GeneratorRouteContext, GeneratorWalk, type Jobs, type RouteDefinition, type Routes, type StreamMode, type ToolNameEntry, type ToolOrigin, WalkApiOptions, type ZodDef, cacheHeaders, defineClient, defineGenerator, deprecationHeaders, deriveToolNames, flattenJobs, globalRegistrySchemas, isBinarySchema, isCompiledJob, isDiscriminatedUnionSchema, isFileSchema, isHintPrefix, isIntegerSchema, isJsonMediaType, isNamedStream, isObjectSchema, isStreamResponse, isSuccessStatus, isVoidSchema, isZodSchema, jobAt, listedRoutes, localTypeName, mergeHeaderFields, parsePath, readDef, readDefType, readDeprecation, readDiscriminatedUnion, readDiscriminatorLiteral, readDiscriminatorStringLiteral, readMeta, readMetaBrand, readMetaDescription, readMetaExamples, readMetaId, readObjectShape, resolveResponseBody, resolveResponseCache, resolveResponseContentType, resolveResponseEtag, resolveResponseHeaders, resolveResponseStream, routeStreams, sanitizeFieldName, sanitizeIdentifier, shortTypeName, soleStreamResponse, statusToCamelCase, streamContentType, streamMode, streamSchemas, streamStatuses, toCamelCase, toPascalCase, toToolName, unwrapOptionalWrappers, walkApi };
|
|
383
|
+
export { ClientDefinition, type CompiledJob, type DiscriminatedUnion, EVENT_STREAM_MEDIA_TYPE, FILE_PROBE, type FlattenedJob, GenerateContext, type GeneratedFile, GeneratedFileOptions, GeneratorDefinition, GeneratorModelContext, GeneratorPluginInfo, GeneratorRouteContext, GeneratorWalk, type Jobs, type RouteDefinition, type Routes, type StreamMode, type ToolNameEntry, type ToolOrigin, WalkApiOptions, type ZodDef, cacheHeaders, defineClient, defineGenerator, deprecationHeaders, deriveToolNames, flattenJobs, globalRegistrySchemas, isBinarySchema, isCompiledJob, isDiscriminatedUnionSchema, isFileSchema, isHintPrefix, isIntegerSchema, isJsonMediaType, isNamedStream, isObjectSchema, isStreamResponse, isSuccessStatus, isVoidSchema, isZodSchema, jobAt, listedRoutes, localTypeName, mergeHeaderFields, parsePath, readDef, readDefType, readDeprecation, readDiscriminatedUnion, readDiscriminatorLiteral, readDiscriminatorStringLiteral, readMeta, readMetaBrand, readMetaDescription, readMetaExamples, readMetaId, readModelSchema, readObjectShape, resolveResponseBody, resolveResponseCache, resolveResponseContentType, resolveResponseEtag, resolveResponseHeaders, resolveResponseStream, routeStreams, sanitizeFieldName, sanitizeIdentifier, shortTypeName, soleStreamResponse, statusToCamelCase, streamContentType, streamMode, streamSchemas, streamStatuses, toCamelCase, toPascalCase, toToolName, unwrapOptionalWrappers, walkApi };
|
package/dist/generator.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as readMetaExamples,
|
|
2
|
-
import { $ as resolveResponseStream, A as toToolName, B as streamStatuses, F as routeStreams, G as isZodSchema, H as isJsonMediaType, I as soleStreamResponse, J as resolveResponseBody, K as localTypeName, L as streamContentType, P as isNamedStream, Q as resolveResponseHeaders, R as streamMode, U as isStreamResponse, V as isHintPrefix, W as isSuccessStatus, X as resolveResponseContentType, Y as resolveResponseCache, Z as resolveResponseEtag, _ as jobAt, a as pluginRoutesOf, at as toPascalCase, c as cacheHeaders, dt as isRouteDefinition, et as sanitizeFieldName, h as isCompiledJob, it as toCamelCase, j as EVENT_STREAM_MEDIA_TYPE, k as deriveToolNames, lt as flattenRoutes, m as flattenJobs, n as describeIssue, nt as shortTypeName, q as mergeHeaderFields, rt as statusToCamelCase, st as parsePath, tt as sanitizeIdentifier, u as deprecationHeaders, z as streamSchemas } from "./plugin-server-
|
|
1
|
+
import { C as readMetaExamples, E as readObjectShape, O as unwrapOptionalWrappers, S as readMetaDescription, T as readModelSchema, _ as readDiscriminatedUnion, b as readMeta, c as isBinarySchema, d as isIntegerSchema, f as isObjectSchema, g as readDeprecation, h as readDefType, i as FILE_PROBE, l as isDiscriminatedUnionSchema, m as readDef, p as isVoidSchema, s as globalRegistrySchemas, u as isFileSchema, v as readDiscriminatorLiteral, w as readMetaId, x as readMetaBrand, y as readDiscriminatorStringLiteral } from "./error-response-D7urgxeq.mjs";
|
|
2
|
+
import { $ as resolveResponseStream, A as toToolName, B as streamStatuses, F as routeStreams, G as isZodSchema, H as isJsonMediaType, I as soleStreamResponse, J as resolveResponseBody, K as localTypeName, L as streamContentType, P as isNamedStream, Q as resolveResponseHeaders, R as streamMode, U as isStreamResponse, V as isHintPrefix, W as isSuccessStatus, X as resolveResponseContentType, Y as resolveResponseCache, Z as resolveResponseEtag, _ as jobAt, a as pluginRoutesOf, at as toPascalCase, c as cacheHeaders, dt as isRouteDefinition, et as sanitizeFieldName, h as isCompiledJob, it as toCamelCase, j as EVENT_STREAM_MEDIA_TYPE, k as deriveToolNames, lt as flattenRoutes, m as flattenJobs, n as describeIssue, nt as shortTypeName, q as mergeHeaderFields, rt as statusToCamelCase, st as parsePath, tt as sanitizeIdentifier, u as deprecationHeaders, z as streamSchemas } from "./plugin-server-DNQ9_DL7.mjs";
|
|
3
3
|
//#region src/generator.ts
|
|
4
4
|
/**
|
|
5
5
|
* Every route the api serves, the app's and the plugins' under their slugs,
|
|
@@ -41,7 +41,8 @@ const reachModels = (value, models, found, seen) => {
|
|
|
41
41
|
if (typeof value !== "object" || value === null || seen.has(value)) return;
|
|
42
42
|
seen.add(value);
|
|
43
43
|
if (isSchema(value)) {
|
|
44
|
-
|
|
44
|
+
const model = readModelSchema(value);
|
|
45
|
+
if (model !== void 0 && models.has(model)) found.add(model);
|
|
45
46
|
const def = value._zod.def;
|
|
46
47
|
for (const [key, child] of Object.entries(def)) {
|
|
47
48
|
if (key === "checks") continue;
|
|
@@ -168,4 +169,4 @@ const defineGenerator = (definition) => (input) => {
|
|
|
168
169
|
};
|
|
169
170
|
};
|
|
170
171
|
//#endregion
|
|
171
|
-
export { EVENT_STREAM_MEDIA_TYPE, FILE_PROBE, cacheHeaders, defineClient, defineGenerator, deprecationHeaders, deriveToolNames, flattenJobs, globalRegistrySchemas, isBinarySchema, isCompiledJob, isDiscriminatedUnionSchema, isFileSchema, isHintPrefix, isIntegerSchema, isJsonMediaType, isNamedStream, isObjectSchema, isStreamResponse, isSuccessStatus, isVoidSchema, isZodSchema, jobAt, listedRoutes, localTypeName, mergeHeaderFields, parsePath, readDef, readDefType, readDeprecation, readDiscriminatedUnion, readDiscriminatorLiteral, readDiscriminatorStringLiteral, readMeta, readMetaBrand, readMetaDescription, readMetaExamples, readMetaId, readObjectShape, resolveResponseBody, resolveResponseCache, resolveResponseContentType, resolveResponseEtag, resolveResponseHeaders, resolveResponseStream, routeStreams, sanitizeFieldName, sanitizeIdentifier, shortTypeName, soleStreamResponse, statusToCamelCase, streamContentType, streamMode, streamSchemas, streamStatuses, toCamelCase, toPascalCase, toToolName, unwrapOptionalWrappers, walkApi };
|
|
172
|
+
export { EVENT_STREAM_MEDIA_TYPE, FILE_PROBE, cacheHeaders, defineClient, defineGenerator, deprecationHeaders, deriveToolNames, flattenJobs, globalRegistrySchemas, isBinarySchema, isCompiledJob, isDiscriminatedUnionSchema, isFileSchema, isHintPrefix, isIntegerSchema, isJsonMediaType, isNamedStream, isObjectSchema, isStreamResponse, isSuccessStatus, isVoidSchema, isZodSchema, jobAt, listedRoutes, localTypeName, mergeHeaderFields, parsePath, readDef, readDefType, readDeprecation, readDiscriminatedUnion, readDiscriminatorLiteral, readDiscriminatorStringLiteral, readMeta, readMetaBrand, readMetaDescription, readMetaExamples, readMetaId, readModelSchema, readObjectShape, resolveResponseBody, resolveResponseCache, resolveResponseContentType, resolveResponseEtag, resolveResponseHeaders, resolveResponseStream, routeStreams, sanitizeFieldName, sanitizeIdentifier, shortTypeName, soleStreamResponse, statusToCamelCase, streamContentType, streamMode, streamSchemas, streamStatuses, toCamelCase, toPascalCase, toToolName, unwrapOptionalWrappers, walkApi };
|
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_plugin = require("./plugin-Dw-yCjTY.cjs");
|
|
3
|
-
const require_error_response = require("./error-response-
|
|
4
|
-
const require_plugin_server = require("./plugin-server-
|
|
5
|
-
const require_schemas = require("./schemas-
|
|
6
|
-
const require_adapter = require("./adapter-
|
|
3
|
+
const require_error_response = require("./error-response-DN5Dsf8b.cjs");
|
|
4
|
+
const require_plugin_server = require("./plugin-server-CfF82yZL.cjs");
|
|
5
|
+
const require_schemas = require("./schemas-Bre1FVHq.cjs");
|
|
6
|
+
const require_adapter = require("./adapter-CK8ccDOC.cjs");
|
|
7
7
|
let zod = require("zod");
|
|
8
8
|
//#region src/group-routes.ts
|
|
9
9
|
/**
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ as SecurityRequirement, A as AutoResponsesBrand, B as ROUTES_GROUP, C as isPermissions, D as AUTO_RESPONSES_BRAND, E as AUTO_GUARD_WRITTEN_BRAND, F as HANDLER, G as RouteAuth, H as ResponseContentType, I as HANDLER_CONTEXT_BRAND, J as RouteHiddenToolCheck, K as RouteDefinition, L as HandlerContextBrand, M as DECLARATION, N as DeclarationKind, O as AuthoredRouteDefinition, P as GuardStatus, Q as SchemeNameOf, R as METHODS, S as createRoles, T as AUTO_GUARD_BRAND, U as ResponseDefinition, V as RequiredPermissions, X as RouteToolOptions, Y as RoutePath, Z as Routes, _ as PermissionSet, a as OAuthFlows, at as ProblemDetails, b as RoleNamesOf, ct as problemFromBody, d as isSecurityScheme, et as StreamDefinition, g as PermissionName, h as PermissionCatalog, i as OAuthFlow, it as GuardSchemaCheck, j as CachePolicy, k as AuthoredRoutes, l as authorizationServerIssuer, lt as STATUS_TITLES, m as GrantNamesOf, n as isProblemDetails, nt as GuardBody, o as OpenApiSecuritySchemeObject, ot as StripProblemEnvelope, p as CatalogOf, q as RouteHandlerFunction, r as ContextOf, rt as GuardOutput, s as SecurityScheme, st as problemDetails, tt as StreamResponseDefinition, u as declaredScopes, ut as getStatusText, v as Permissions, w as isRoles, x as Roles, y as RoleDefinition, z as Method } from "./error-response-YbkRMKno.cjs";
|
|
2
|
-
import { $i as
|
|
2
|
+
import { $i as StreamComment, $n as isJobDefinition, $r as AuthContextOf, $t as PluginsBySlug, Aa as BearerConfig, Ai as ToolRunOptions, An as RoutesOf, Ar as parseCron, Ba as NoCredential, Bi as ExtractPathParams, Bn as JobHandler, Br as GroupSet, Bt as PluginApi, Ci as isRouteDefinition, Cn as GeneratedFile, Cr as ParsedCron, Da as ApiKeyCredential, Di as ToolAnswer, Dn as GuardSchemaOf, Dr as firesBetween, E as MountedOf, Ea as ApiKeyConfig, Ei as StreamTools, En as ApiPluginsOf, Er as dueSchedules, Fa as GrantsOf, Fn as CompiledJobs, Fr as RequestContextHeaderValues, Ft as AnyPlugin, Gi as RoutePathParamsCheck, Gn as JobRunnerConfig, Gt as PluginExportsOf, Ha as OpenIdConnectConfig, Hi as PathParamName, Hn as JobHandlerReturn, Hr as createGroups, Ht as PluginDeclaration, Ia as GuardHoldings, In as FlattenedJob, Ir as RequestContextSchema, It as ApiPlugins, J as getHeaderValue, Ji as EVENT_STREAM_MEDIA_TYPE, Jn as JobsArg, Jr as RouteWithHandler, Ki as buildPath, Kn as JobVoidReturn, Kt as PluginFactory, La as Identity, Ln as HttpJobsConfig, Lr as GroupOptions, Ma as Credential, Mi as ToolDefinition, Mn as AuthoredJobDefinition, Mr as scheduleTimezone, Na as CredentialOf, Nn as AuthoredJobs, Nr as RequestContextConfig, Oa as BasicConfig, Oi as ToolEventYield, On as JobsOf, Or as nextRun, Pa as CustomConfig, Pn as CompiledJob, Pr as RequestContextHeaderInputs, Qi as StreamChunk, Qn as isCompiledJob, Qt as PluginSetupContext, Ra as IdentityParamsOf, Rn as InProcessJobsConfig, Rr as GroupPaths, Sn as DiffSettings, Sr as JobSchedule, T as MountArgsOf, Ti as ModelToolCall, Tn as ApiDefinition, Tr as cron, Ua as RoleOf, Ui as PathParamsCheck, Un as JobHandlers, Ut as PluginDefinition, Va as OAuth2Config, Vi as HasPathParams, Vn as JobHandlerArgs, Vr as ResolvedGroup, Vt as PluginArgs, Wa as RolesOf, Wn as JobResponses, Wt as PluginExportValues, Xi as StreamBody, Xn as NoJobs, Xt as PluginRoutesOf, Yn as JobsConfig, Yt as PluginRoutes, Zi as StreamBodyOf, Zn as flattenJobs, Zt as PluginSetup, _ as GuardDeny, _a as ToolEvents, _i as ThrowableReturn, _n as ConfiguredRequestContextSchemas, _r as JobTransportSupports, ai as GuardReturn, ar as JobQueueArgs, ba as expandStreamTools, bn as KizunaConfigShape, br as ScheduledJob, bt as isZodSchema, ca as soleStreamResponse, ci as HandlerArgs, cn as ConfiguredAdapterContext, cr as JobRunner, dn as ConfiguredGroups, dr as jobFnAt, ea as StreamContext, ei as BrandedHandlerContext, er as jobAt, fa as streamStatuses, fn as ConfiguredGuardSchema, fr as JobDescriptor, ga as ToolError, gi as RoutesWithHandlerContext, gn as ConfiguredRequestContext, gr as JobTransportDefinition, h as GuardDenial, ha as ToolCall, hn as ConfiguredPlugins, hr as JobTransport, ia as StreamYield, in as definePlugin, ir as JobInputError, ja as BearerCredential, ji as ToolRunResult, jn as SchemesOf, jr as scheduleExpression, ka as BasicCredential, ki as ToolRunCall, kn as RequestContextOf, kr as nextRuns, la as streamContentType, li as HandlerReturn, ln as ConfiguredAdapterValue, lr as JobRunnerOptions, lt as ResponseError, ma as ToolAt, mn as ConfiguredJobs, mr as JobMessage, na as StreamMessageOf, nr as JobFn, oa as isNamedStream, oi as GuardSuccess, or as JobQueueOptions, pa as StreamWithTools, pi as RouteGuardBrandOf, pn as ConfiguredIdentities, pr as JobDispatchError, qi as parsePath, qn as Jobs, qr as RouteBuilder, qt as PluginList, ra as StreamMode, ri as GuardAnswer, rr as JobFnByKey, s as AnyAdapter, sa as routeStreams, sr as JobRunArgs, ta as StreamMessage, ti as ContextFromAuth, tr as JobErrorHandler, u as ApiWithRouter, ua as streamMode, un as ConfiguredCodes, ur as createJobRunner, va as ToolKeys, vn as JobFnOf, vr as JobWorker, vt as isStreamResponse, wn as apiEntries, wr as assertValidSchedule, xa as toolEvents, xn as ApiEntry, xr as defineJobTransport, ya as ToolResult, yn as JobsOfTree, yr as JobWorkerContext, za as IdentityRole, zn as JobDefinition, zr as GroupPathsOf } from "./adapter-nQIkQwsM.cjs";
|
|
3
3
|
import { a as buildProtectedResourceMetadata, c as ValidationErrorFor, d as isValidationError, i as assertCanonicalResourceUri, n as ProtectedResourceMetadata, o as BuiltinIssueCode, s as ValidationError, t as ProtectedResourceConfig, u as ValidationIssueCode } from "./protected-resource-metadata-B9hMFQ9N.cjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { $input, $output } from "zod/v4/core";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ as SecurityRequirement, A as AutoResponsesBrand, B as ROUTES_GROUP, C as isPermissions, D as AUTO_RESPONSES_BRAND, E as AUTO_GUARD_WRITTEN_BRAND, F as HANDLER, G as RouteAuth, H as ResponseContentType, I as HANDLER_CONTEXT_BRAND, J as RouteHiddenToolCheck, K as RouteDefinition, L as HandlerContextBrand, M as DECLARATION, N as DeclarationKind, O as AuthoredRouteDefinition, P as GuardStatus, Q as SchemeNameOf, R as METHODS, S as createRoles, T as AUTO_GUARD_BRAND, U as ResponseDefinition, V as RequiredPermissions, X as RouteToolOptions, Y as RoutePath, Z as Routes, _ as PermissionSet, a as OAuthFlows, at as ProblemDetails, b as RoleNamesOf, ct as problemFromBody, d as isSecurityScheme, et as StreamDefinition, g as PermissionName, h as PermissionCatalog, i as OAuthFlow, it as GuardSchemaCheck, j as CachePolicy, k as AuthoredRoutes, l as authorizationServerIssuer, lt as STATUS_TITLES, m as GrantNamesOf, n as isProblemDetails, nt as GuardBody, o as OpenApiSecuritySchemeObject, ot as StripProblemEnvelope, p as CatalogOf, q as RouteHandlerFunction, r as ContextOf, rt as GuardOutput, s as SecurityScheme, st as problemDetails, tt as StreamResponseDefinition, u as declaredScopes, ut as getStatusText, v as Permissions, w as isRoles, x as Roles, y as RoleDefinition, z as Method } from "./error-response-NoOGdh8H.mjs";
|
|
2
|
-
import { $i as
|
|
2
|
+
import { $i as StreamComment, $n as isJobDefinition, $r as AuthContextOf, $t as PluginsBySlug, Aa as BearerConfig, Ai as ToolRunOptions, An as RoutesOf, Ar as parseCron, Ba as NoCredential, Bi as ExtractPathParams, Bn as JobHandler, Br as GroupSet, Bt as PluginApi, Ci as isRouteDefinition, Cn as GeneratedFile, Cr as ParsedCron, Da as ApiKeyCredential, Di as ToolAnswer, Dn as GuardSchemaOf, Dr as firesBetween, E as MountedOf, Ea as ApiKeyConfig, Ei as StreamTools, En as ApiPluginsOf, Er as dueSchedules, Fa as GrantsOf, Fn as CompiledJobs, Fr as RequestContextHeaderValues, Ft as AnyPlugin, Gi as RoutePathParamsCheck, Gn as JobRunnerConfig, Gt as PluginExportsOf, Ha as OpenIdConnectConfig, Hi as PathParamName, Hn as JobHandlerReturn, Hr as createGroups, Ht as PluginDeclaration, Ia as GuardHoldings, In as FlattenedJob, Ir as RequestContextSchema, It as ApiPlugins, J as getHeaderValue, Ji as EVENT_STREAM_MEDIA_TYPE, Jn as JobsArg, Jr as RouteWithHandler, Ki as buildPath, Kn as JobVoidReturn, Kt as PluginFactory, La as Identity, Ln as HttpJobsConfig, Lr as GroupOptions, Ma as Credential, Mi as ToolDefinition, Mn as AuthoredJobDefinition, Mr as scheduleTimezone, Na as CredentialOf, Nn as AuthoredJobs, Nr as RequestContextConfig, Oa as BasicConfig, Oi as ToolEventYield, On as JobsOf, Or as nextRun, Pa as CustomConfig, Pn as CompiledJob, Pr as RequestContextHeaderInputs, Qi as StreamChunk, Qn as isCompiledJob, Qt as PluginSetupContext, Ra as IdentityParamsOf, Rn as InProcessJobsConfig, Rr as GroupPaths, Sn as DiffSettings, Sr as JobSchedule, T as MountArgsOf, Ti as ModelToolCall, Tn as ApiDefinition, Tr as cron, Ua as RoleOf, Ui as PathParamsCheck, Un as JobHandlers, Ut as PluginDefinition, Va as OAuth2Config, Vi as HasPathParams, Vn as JobHandlerArgs, Vr as ResolvedGroup, Vt as PluginArgs, Wa as RolesOf, Wn as JobResponses, Wt as PluginExportValues, Xi as StreamBody, Xn as NoJobs, Xt as PluginRoutesOf, Yn as JobsConfig, Yt as PluginRoutes, Zi as StreamBodyOf, Zn as flattenJobs, Zt as PluginSetup, _ as GuardDeny, _a as ToolEvents, _i as ThrowableReturn, _n as ConfiguredRequestContextSchemas, _r as JobTransportSupports, ai as GuardReturn, ar as JobQueueArgs, ba as expandStreamTools, bn as KizunaConfigShape, br as ScheduledJob, bt as isZodSchema, ca as soleStreamResponse, ci as HandlerArgs, cn as ConfiguredAdapterContext, cr as JobRunner, dn as ConfiguredGroups, dr as jobFnAt, ea as StreamContext, ei as BrandedHandlerContext, er as jobAt, fa as streamStatuses, fn as ConfiguredGuardSchema, fr as JobDescriptor, ga as ToolError, gi as RoutesWithHandlerContext, gn as ConfiguredRequestContext, gr as JobTransportDefinition, h as GuardDenial, ha as ToolCall, hn as ConfiguredPlugins, hr as JobTransport, ia as StreamYield, in as definePlugin, ir as JobInputError, ja as BearerCredential, ji as ToolRunResult, jn as SchemesOf, jr as scheduleExpression, ka as BasicCredential, ki as ToolRunCall, kn as RequestContextOf, kr as nextRuns, la as streamContentType, li as HandlerReturn, ln as ConfiguredAdapterValue, lr as JobRunnerOptions, lt as ResponseError, ma as ToolAt, mn as ConfiguredJobs, mr as JobMessage, na as StreamMessageOf, nr as JobFn, oa as isNamedStream, oi as GuardSuccess, or as JobQueueOptions, pa as StreamWithTools, pi as RouteGuardBrandOf, pn as ConfiguredIdentities, pr as JobDispatchError, qi as parsePath, qn as Jobs, qr as RouteBuilder, qt as PluginList, ra as StreamMode, ri as GuardAnswer, rr as JobFnByKey, s as AnyAdapter, sa as routeStreams, sr as JobRunArgs, ta as StreamMessage, ti as ContextFromAuth, tr as JobErrorHandler, u as ApiWithRouter, ua as streamMode, un as ConfiguredCodes, ur as createJobRunner, va as ToolKeys, vn as JobFnOf, vr as JobWorker, vt as isStreamResponse, wn as apiEntries, wr as assertValidSchedule, xa as toolEvents, xn as ApiEntry, xr as defineJobTransport, ya as ToolResult, yn as JobsOfTree, yr as JobWorkerContext, za as IdentityRole, zn as JobDefinition, zr as GroupPathsOf } from "./adapter-BdkB6ql9.mjs";
|
|
3
3
|
import { a as buildProtectedResourceMetadata, c as ValidationErrorFor, d as isValidationError, i as assertCanonicalResourceUri, n as ProtectedResourceMetadata, o as BuiltinIssueCode, s as ValidationError, t as ProtectedResourceConfig, u as ValidationIssueCode } from "./protected-resource-metadata-CfBVsqIk.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { $input, $output } from "zod/v4/core";
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as definePlugin, c as createRoute, d as AUTO_RESPONSES_BRAND, f as DECLARATION, g as ROUTES_GROUP, h as METHODS, l as AUTO_GUARD_BRAND, m as HANDLER_CONTEXT_BRAND, o as pluginRouteTree, p as HANDLER, u as AUTO_GUARD_WRITTEN_BRAND } from "./plugin-xxCxibmu.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { B as streamStatuses, C as firesBetween, D as scheduleExpression, E as parseCron, F as routeStreams, G as isZodSchema, I as soleStreamResponse, J as resolveResponseBody, L as streamContentType, O as scheduleTimezone, P as isNamedStream, R as streamMode, S as dueSchedules, T as nextRuns, U as isStreamResponse, _ as jobAt, b as assertValidSchedule, dt as isRouteDefinition, f as assertJobRunner, g as isJobDefinition, h as isCompiledJob, j as EVENT_STREAM_MEDIA_TYPE, l as assertValidDeprecationDates, lt as flattenRoutes, m as flattenJobs, o as resolvePlugins, ot as buildPath, p as buildJobs, r as pluginExportsOf, s as assertValidCache, st as parsePath, t as createApiReference, v as jobClaims, w as nextRun, x as cron } from "./plugin-server-
|
|
4
|
-
import { a as assertCanonicalResourceUri, c as isValidationError, d as declaredScopes, f as isSecurityScheme, l as authenticationChallenge, o as buildProtectedResourceMetadata, p as resolveSecurityRequirements, u as authorizationServerIssuer } from "./schemas-
|
|
5
|
-
import { $ as
|
|
2
|
+
import { E as readObjectShape, m as readDef, n as isProblemDetails, r as createModel, t as ProblemDetailsSchema } from "./error-response-D7urgxeq.mjs";
|
|
3
|
+
import { B as streamStatuses, C as firesBetween, D as scheduleExpression, E as parseCron, F as routeStreams, G as isZodSchema, I as soleStreamResponse, J as resolveResponseBody, L as streamContentType, O as scheduleTimezone, P as isNamedStream, R as streamMode, S as dueSchedules, T as nextRuns, U as isStreamResponse, _ as jobAt, b as assertValidSchedule, dt as isRouteDefinition, f as assertJobRunner, g as isJobDefinition, h as isCompiledJob, j as EVENT_STREAM_MEDIA_TYPE, l as assertValidDeprecationDates, lt as flattenRoutes, m as flattenJobs, o as resolvePlugins, ot as buildPath, p as buildJobs, r as pluginExportsOf, s as assertValidCache, st as parsePath, t as createApiReference, v as jobClaims, w as nextRun, x as cron } from "./plugin-server-DNQ9_DL7.mjs";
|
|
4
|
+
import { a as assertCanonicalResourceUri, c as isValidationError, d as declaredScopes, f as isSecurityScheme, l as authenticationChallenge, o as buildProtectedResourceMetadata, p as resolveSecurityRequirements, u as authorizationServerIssuer } from "./schemas-DBX8DwFb.mjs";
|
|
5
|
+
import { $ as dispatchDueJobs, F as warnUnsupportedJobOptions, G as JobDispatchError, J as createJobRunner, K as defineJobTransport, M as routerFromRoutes, Q as DispatchResultSchema, R as assertNoPathCollisions, S as getHeaderValue, X as ResponseError, Y as jobFnAt, Z as DispatchFailedSchema, _t as toolEvents, at as STATUS_TITLES, ct as createRoles, dt as permissionNames, et as dispatchSucceeded, ft as createGroups, gt as expandStreamTools, ht as groupRoutes, it as problemFromBody, lt as isPermissions, mt as assembleRoutes, nt as failedJobs, o as JOBS_META, ot as getStatusText, p as assembleApi, q as JobInputError, rt as problemDetails, st as createPermissions, tt as dueJobs, ut as isRoles, z as routeClaims } from "./adapter-DU3Ljl0P.mjs";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/group-routes.ts
|
|
8
8
|
/**
|
package/dist/jobs-entry.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_plugin_server = require("./plugin-server-
|
|
3
|
-
const require_adapter = require("./adapter-
|
|
2
|
+
const require_plugin_server = require("./plugin-server-CfF82yZL.cjs");
|
|
3
|
+
const require_adapter = require("./adapter-CK8ccDOC.cjs");
|
|
4
4
|
//#region src/start-jobs.ts
|
|
5
5
|
/**
|
|
6
6
|
* The dedupe key an occurrence gets. Every instance ticking the same minute
|
package/dist/jobs-entry.d.cts
CHANGED
package/dist/jobs-entry.d.mts
CHANGED
package/dist/jobs-entry.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as scheduleExpression, O as scheduleTimezone, m as flattenJobs, w as nextRun } from "./plugin-server-
|
|
2
|
-
import {
|
|
1
|
+
import { D as scheduleExpression, O as scheduleTimezone, m as flattenJobs, w as nextRun } from "./plugin-server-DNQ9_DL7.mjs";
|
|
2
|
+
import { O as jobRunnerFrom, Y as jobFnAt, h as boundJobKeys, o as JOBS_META } from "./adapter-DU3Ljl0P.mjs";
|
|
3
3
|
//#region src/start-jobs.ts
|
|
4
4
|
/**
|
|
5
5
|
* The dedupe key an occurrence gets. Every instance ticking the same minute
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_plugin = require("./plugin-Dw-yCjTY.cjs");
|
|
2
|
-
const require_error_response = require("./error-response-
|
|
2
|
+
const require_error_response = require("./error-response-DN5Dsf8b.cjs");
|
|
3
3
|
let zod = require("zod");
|
|
4
4
|
//#region src/coercion.ts
|
|
5
5
|
/**
|
|
@@ -28,9 +28,9 @@ const buildCoercionPlan = (schema) => {
|
|
|
28
28
|
if (baseType === "array") {
|
|
29
29
|
const element = resolveArrayElement(fieldSchema);
|
|
30
30
|
const elementType = element ? require_error_response.resolveBaseType(element) : void 0;
|
|
31
|
-
|
|
31
|
+
fields.push({
|
|
32
32
|
key,
|
|
33
|
-
type: elementType,
|
|
33
|
+
type: elementType !== void 0 && COERCIBLE_TYPES.has(elementType) ? elementType : void 0,
|
|
34
34
|
array: true
|
|
35
35
|
});
|
|
36
36
|
continue;
|
|
@@ -84,10 +84,15 @@ const coerceValue = (value, type) => {
|
|
|
84
84
|
const date = new Date(value);
|
|
85
85
|
return Number.isNaN(date.getTime()) ? value : date;
|
|
86
86
|
};
|
|
87
|
+
/**
|
|
88
|
+
* A lone value is a one-item list, the way OpenAPI's default `form` style
|
|
89
|
+
* sends `?tag=work`.
|
|
90
|
+
*/
|
|
87
91
|
const coerceArray = (value, type) => {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
const items = Array.isArray(value) ? value : [value];
|
|
93
|
+
if (type === void 0) return items;
|
|
94
|
+
let changed = items !== value;
|
|
95
|
+
const coerced = items.map((item) => {
|
|
91
96
|
const next = coerceValue(item, type);
|
|
92
97
|
if (next !== item) changed = true;
|
|
93
98
|
return next;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as ROUTES_GROUP, n as PLUGIN_SERVERS_META_KEY, t as PLUGIN_ROUTES_META_KEY } from "./plugin-xxCxibmu.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { D as resolveBaseType, E as readObjectShape, a as WRAPPER_TYPES, c as isBinarySchema, m as readDef, t as ProblemDetailsSchema } from "./error-response-D7urgxeq.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/coercion.ts
|
|
5
5
|
/**
|
|
@@ -28,9 +28,9 @@ const buildCoercionPlan = (schema) => {
|
|
|
28
28
|
if (baseType === "array") {
|
|
29
29
|
const element = resolveArrayElement(fieldSchema);
|
|
30
30
|
const elementType = element ? resolveBaseType(element) : void 0;
|
|
31
|
-
|
|
31
|
+
fields.push({
|
|
32
32
|
key,
|
|
33
|
-
type: elementType,
|
|
33
|
+
type: elementType !== void 0 && COERCIBLE_TYPES.has(elementType) ? elementType : void 0,
|
|
34
34
|
array: true
|
|
35
35
|
});
|
|
36
36
|
continue;
|
|
@@ -84,10 +84,15 @@ const coerceValue = (value, type) => {
|
|
|
84
84
|
const date = new Date(value);
|
|
85
85
|
return Number.isNaN(date.getTime()) ? value : date;
|
|
86
86
|
};
|
|
87
|
+
/**
|
|
88
|
+
* A lone value is a one-item list, the way OpenAPI's default `form` style
|
|
89
|
+
* sends `?tag=work`.
|
|
90
|
+
*/
|
|
87
91
|
const coerceArray = (value, type) => {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
const items = Array.isArray(value) ? value : [value];
|
|
93
|
+
if (type === void 0) return items;
|
|
94
|
+
let changed = items !== value;
|
|
95
|
+
const coerced = items.map((item) => {
|
|
91
96
|
const next = coerceValue(item, type);
|
|
92
97
|
if (next !== item) changed = true;
|
|
93
98
|
return next;
|
package/dist/plugin.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Y as RoutePath } from "./error-response-YbkRMKno.cjs";
|
|
2
|
-
import { $t as
|
|
2
|
+
import { $t as PluginsBySlug, Bt as PluginApi, Ft as AnyPlugin, Gt as PluginExportsOf, Ht as PluginDeclaration, It as ApiPlugins, Jt as PluginRouteBuilder, Kt as PluginFactory, Lt as InstallOptions, Qt as PluginSetupContext, Rt as PLUGIN_ROUTES_META_KEY, Ut as PluginDefinition, Vt as PluginArgs, Wt as PluginExportValues, Xt as PluginRoutesOf, Yt as PluginRoutes, Zt as PluginSetup, an as pluginRouteTree, en as ResolvedPlugin, in as definePlugin, nn as RoutePathSchema, on as route, qt as PluginList, rn as SlugOption, sn as ApiContext, tn as RouteAuthSchema, zt as PLUGIN_SERVERS_META_KEY } from "./adapter-nQIkQwsM.cjs";
|
|
3
3
|
export { AnyPlugin, ApiContext, ApiPlugins, InstallOptions, PLUGIN_ROUTES_META_KEY, PLUGIN_SERVERS_META_KEY, PluginApi, PluginArgs, PluginDeclaration, PluginDefinition, PluginExportValues, PluginExportsOf, PluginFactory, PluginList, PluginRouteBuilder, PluginRoutes, PluginRoutesOf, PluginSetup, PluginSetupContext, PluginsBySlug, ResolvedPlugin, RouteAuthSchema, RoutePath, RoutePathSchema, SlugOption, definePlugin, pluginRouteTree, route };
|
package/dist/plugin.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Y as RoutePath } from "./error-response-NoOGdh8H.mjs";
|
|
2
|
-
import { $t as
|
|
2
|
+
import { $t as PluginsBySlug, Bt as PluginApi, Ft as AnyPlugin, Gt as PluginExportsOf, Ht as PluginDeclaration, It as ApiPlugins, Jt as PluginRouteBuilder, Kt as PluginFactory, Lt as InstallOptions, Qt as PluginSetupContext, Rt as PLUGIN_ROUTES_META_KEY, Ut as PluginDefinition, Vt as PluginArgs, Wt as PluginExportValues, Xt as PluginRoutesOf, Yt as PluginRoutes, Zt as PluginSetup, an as pluginRouteTree, en as ResolvedPlugin, in as definePlugin, nn as RoutePathSchema, on as route, qt as PluginList, rn as SlugOption, sn as ApiContext, tn as RouteAuthSchema, zt as PLUGIN_SERVERS_META_KEY } from "./adapter-BdkB6ql9.mjs";
|
|
3
3
|
export { AnyPlugin, ApiContext, ApiPlugins, InstallOptions, PLUGIN_ROUTES_META_KEY, PLUGIN_SERVERS_META_KEY, PluginApi, PluginArgs, PluginDeclaration, PluginDefinition, PluginExportValues, PluginExportsOf, PluginFactory, PluginList, PluginRouteBuilder, PluginRoutes, PluginRoutesOf, PluginSetup, PluginSetupContext, PluginsBySlug, ResolvedPlugin, RouteAuthSchema, RoutePath, RoutePathSchema, SlugOption, definePlugin, pluginRouteTree, route };
|
package/dist/schemas.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_error_response = require("./error-response-
|
|
3
|
-
const require_schemas = require("./schemas-
|
|
2
|
+
const require_error_response = require("./error-response-DN5Dsf8b.cjs");
|
|
3
|
+
const require_schemas = require("./schemas-Bre1FVHq.cjs");
|
|
4
4
|
exports.BinarySchema = require_schemas.BinarySchema;
|
|
5
5
|
exports.FileSchema = require_schemas.FileSchema;
|
|
6
6
|
exports.ProblemDetailsSchema = require_error_response.ProblemDetailsSchema;
|
package/dist/schemas.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as ProblemDetailsSchema } from "./error-response-
|
|
2
|
-
import { i as ProtectedResourceMetadataSchema, n as BinarySchema, r as FileSchema, s as ValidationErrorSchema, t as ToolAnswerSchema } from "./schemas-
|
|
1
|
+
import { t as ProblemDetailsSchema } from "./error-response-D7urgxeq.mjs";
|
|
2
|
+
import { i as ProtectedResourceMetadataSchema, n as BinarySchema, r as FileSchema, s as ValidationErrorSchema, t as ToolAnswerSchema } from "./schemas-DBX8DwFb.mjs";
|
|
3
3
|
export { BinarySchema, FileSchema, ProblemDetailsSchema, ProtectedResourceMetadataSchema, ToolAnswerSchema, ValidationErrorSchema };
|
package/package.json
CHANGED
package/src/adapter.ts
CHANGED
|
@@ -1832,9 +1832,12 @@ const renderResult = (
|
|
|
1832
1832
|
}
|
|
1833
1833
|
};
|
|
1834
1834
|
|
|
1835
|
-
|
|
1835
|
+
/**
|
|
1836
|
+
* A query string or form as an object. A repeated key collects every value into a list.
|
|
1837
|
+
*/
|
|
1838
|
+
export const entriesToObject = (source: URLSearchParams | FormData): Record<string, unknown> => {
|
|
1836
1839
|
const result: Record<string, unknown> = {};
|
|
1837
|
-
for (const [key, value] of
|
|
1840
|
+
for (const [key, value] of source.entries()) {
|
|
1838
1841
|
const existing = result[key];
|
|
1839
1842
|
if (existing === undefined) {
|
|
1840
1843
|
result[key] = value;
|
|
@@ -1852,7 +1855,7 @@ const formDataToObject = (form: FormData): Record<string, unknown> => {
|
|
|
1852
1855
|
* whose text core already read.
|
|
1853
1856
|
*/
|
|
1854
1857
|
export const parseBodyText = (text: string, route: RouteDefinition): unknown => {
|
|
1855
|
-
if (route.contentType === 'application/x-www-form-urlencoded') return
|
|
1858
|
+
if (route.contentType === 'application/x-www-form-urlencoded') return entriesToObject(new URLSearchParams(text));
|
|
1856
1859
|
return text.length > 0 ? JSON.parse(text) : undefined;
|
|
1857
1860
|
};
|
|
1858
1861
|
|
|
@@ -1865,9 +1868,9 @@ export const parseBodyText = (text: string, route: RouteDefinition): unknown =>
|
|
|
1865
1868
|
export const parseFetchBody = async (request: Request, route: RouteDefinition): Promise<unknown> => {
|
|
1866
1869
|
switch (route.contentType) {
|
|
1867
1870
|
case 'multipart/form-data':
|
|
1868
|
-
return
|
|
1871
|
+
return entriesToObject(await request.formData());
|
|
1869
1872
|
case 'application/x-www-form-urlencoded':
|
|
1870
|
-
return
|
|
1873
|
+
return entriesToObject(new URLSearchParams(await request.text()));
|
|
1871
1874
|
default: {
|
|
1872
1875
|
const text = await request.text();
|
|
1873
1876
|
return text.length > 0 ? JSON.parse(text) : undefined;
|
package/src/coercion.ts
CHANGED
|
@@ -8,11 +8,17 @@ import { readDef, readObjectShape, resolveBaseType, WRAPPER_TYPES } from './zod-
|
|
|
8
8
|
*/
|
|
9
9
|
const COERCIBLE_TYPES: ReadonlySet<string> = new Set(['number', 'int', 'boolean', 'bigint', 'date']);
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
type CoercionField =
|
|
12
|
+
| {
|
|
13
|
+
key: string;
|
|
14
|
+
type: string;
|
|
15
|
+
array: false;
|
|
16
|
+
}
|
|
17
|
+
| {
|
|
18
|
+
key: string;
|
|
19
|
+
type: string | undefined;
|
|
20
|
+
array: true;
|
|
21
|
+
};
|
|
16
22
|
|
|
17
23
|
/**
|
|
18
24
|
* The fields of one request schema that need coercion, or `null` when none do.
|
|
@@ -43,13 +49,11 @@ const buildCoercionPlan = (schema: z.ZodType): CoercionPlan => {
|
|
|
43
49
|
if (baseType === 'array') {
|
|
44
50
|
const element = resolveArrayElement(fieldSchema);
|
|
45
51
|
const elementType = element ? resolveBaseType(element) : undefined;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
});
|
|
52
|
-
}
|
|
52
|
+
fields.push({
|
|
53
|
+
key,
|
|
54
|
+
type: elementType !== undefined && COERCIBLE_TYPES.has(elementType) ? elementType : undefined,
|
|
55
|
+
array: true,
|
|
56
|
+
});
|
|
53
57
|
continue;
|
|
54
58
|
}
|
|
55
59
|
if (COERCIBLE_TYPES.has(baseType)) {
|
|
@@ -111,10 +115,15 @@ const coerceValue = (value: unknown, type: string): unknown => {
|
|
|
111
115
|
return Number.isNaN(date.getTime()) ? value : date;
|
|
112
116
|
};
|
|
113
117
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
+
/**
|
|
119
|
+
* A lone value is a one-item list, the way OpenAPI's default `form` style
|
|
120
|
+
* sends `?tag=work`.
|
|
121
|
+
*/
|
|
122
|
+
const coerceArray = (value: unknown, type: string | undefined): unknown => {
|
|
123
|
+
const items = Array.isArray(value) ? value : [value];
|
|
124
|
+
if (type === undefined) return items;
|
|
125
|
+
let changed = items !== value;
|
|
126
|
+
const coerced = items.map((item) => {
|
|
118
127
|
const next = coerceValue(item, type);
|
|
119
128
|
if (next !== item) changed = true;
|
|
120
129
|
return next;
|
package/src/generator.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { Routes, RouteDefinition } from './types.js';
|
|
|
5
5
|
import type { ApiDefinition } from './api-definition.js';
|
|
6
6
|
import { isRouteDefinition } from './handler-pipeline.js';
|
|
7
7
|
import { describeIssue, pluginRoutesOf } from './plugin-server.js';
|
|
8
|
-
import { globalRegistrySchemas, readMetaDescription } from './zod-internals.js';
|
|
8
|
+
import { globalRegistrySchemas, readMetaDescription, readModelSchema } from './zod-internals.js';
|
|
9
9
|
import type { GeneratedFile } from './config.js';
|
|
10
10
|
import type { z } from 'zod';
|
|
11
11
|
|
|
@@ -28,6 +28,7 @@ export {
|
|
|
28
28
|
readDiscriminatedUnion,
|
|
29
29
|
readMeta,
|
|
30
30
|
readMetaId,
|
|
31
|
+
readModelSchema,
|
|
31
32
|
readMetaDescription,
|
|
32
33
|
readMetaBrand,
|
|
33
34
|
readMetaExamples,
|
|
@@ -222,7 +223,8 @@ const reachModels = (value: unknown, models: Map<z.core.$ZodType, string>, found
|
|
|
222
223
|
if (typeof value !== 'object' || value === null || seen.has(value)) return;
|
|
223
224
|
seen.add(value);
|
|
224
225
|
if (isSchema(value)) {
|
|
225
|
-
|
|
226
|
+
const model = readModelSchema(value);
|
|
227
|
+
if (model !== undefined && models.has(model)) found.add(model);
|
|
226
228
|
const def = value._zod.def as unknown as Record<string, unknown>;
|
|
227
229
|
for (const [key, child] of Object.entries(def)) {
|
|
228
230
|
if (key === 'checks') continue;
|