cvx-kit 0.1.29 → 0.1.31
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 +52 -0
- package/dist/auth.d.mts +29 -11
- package/dist/auth.mjs +1 -1
- package/dist/auth.mjs.map +1 -1
- package/dist/effect.d.mts +5 -1
- package/dist/effect.mjs +1 -1
- package/dist/modules/contracts/binding.d.mts +1 -3
- package/dist/modules/contracts/binding.mjs +1 -1
- package/dist/modules/contracts/binding.mjs.map +1 -1
- package/dist/modules/contracts/domain.d.mts +5 -1
- package/dist/modules/contracts/domain.mjs +1 -1
- package/dist/modules/contracts/domain.mjs.map +1 -1
- package/dist/modules/contracts/errors.d.mts +4 -0
- package/dist/modules/contracts/errors.mjs +1 -1
- package/dist/modules/contracts/errors.mjs.map +1 -1
- package/dist/modules/contracts/lazy.mjs +1 -1
- package/dist/modules/contracts/lazy.mjs.map +1 -1
- package/dist/modules/effect/action.d.mts +64 -0
- package/dist/modules/effect/action.mjs +2 -0
- package/dist/modules/effect/action.mjs.map +1 -0
- package/dist/modules/effect/api-runtime.mjs +1 -1
- package/dist/modules/effect/api-runtime.mjs.map +1 -1
- package/dist/modules/effect/client.d.mts +5 -1
- package/dist/modules/effect/client.mjs +1 -1
- package/dist/modules/effect/command.d.mts +15 -9
- package/dist/modules/effect/command.mjs +1 -1
- package/dist/modules/effect/command.mjs.map +1 -1
- package/dist/modules/effect/crud.d.mts +17 -16
- package/dist/modules/effect/domain.d.mts +19 -8
- package/dist/modules/effect/domain.mjs +1 -1
- package/dist/modules/effect/domain.mjs.map +1 -1
- package/dist/modules/effect/errors.d.mts +5 -1
- package/dist/modules/effect/errors.mjs +1 -1
- package/dist/modules/effect/errors.mjs.map +1 -1
- package/dist/modules/effect/failure-audit.d.mts +48 -0
- package/dist/modules/effect/failure-audit.mjs +2 -0
- package/dist/modules/effect/failure-audit.mjs.map +1 -0
- package/dist/modules/effect/failures.d.mts +22 -0
- package/dist/modules/effect/failures.mjs +2 -0
- package/dist/modules/effect/failures.mjs.map +1 -0
- package/dist/modules/effect/foundation.d.mts +6 -1
- package/dist/modules/effect/foundation.mjs +1 -1
- package/dist/modules/effect/foundation.mjs.map +1 -1
- package/dist/modules/effect/operation.d.mts +10 -2
- package/dist/modules/effect/operation.mjs +1 -1
- package/dist/modules/effect/operation.mjs.map +1 -1
- package/dist/modules/effect/query.d.mts +5 -1
- package/dist/modules/effect/query.mjs +1 -1
- package/dist/modules/effect/query.mjs.map +1 -1
- package/dist/modules/effect/scope.d.mts +27 -0
- package/dist/modules/effect/scope.mjs +2 -0
- package/dist/modules/effect/scope.mjs.map +1 -0
- package/dist/relations.mjs +1 -1
- package/dist/relations.mjs.map +1 -1
- package/dist/zod-registration.mjs +1 -1
- package/dist/zod-registration.mjs.map +1 -1
- package/package.json +2 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{zodToConvex as e}from"./zod-convex.mjs";import{compactArgumentBoundary as t}from"./querying/filter-boundary.mjs";import{
|
|
1
|
+
import{zodToConvex as e}from"./zod-convex.mjs";import{compactArgumentBoundary as t}from"./querying/filter-boundary.mjs";import{memoize as n}from"./modules/contracts/lazy.mjs";import{zodOutputToConvex as r}from"convex-helpers/server/zod4";import{ConvexError as i}from"convex/values";import{pick as a}from"convex-helpers";import{NoOp as o}from"convex-helpers/server/customFunctions";import{addFieldsToValidator as s}from"convex-helpers/validators";import*as c from"zod/v4";import*as l from"zod/v4/core";function u(e,t){return b(e,t)}function d(e,t){return b(e,t)}function f(e,t){return b(e,t)}const p=/* @__PURE__ */ new WeakMap;function m(e){return p.get(e)??{}}function h(e,t){for(let n=e;n;n=Object.getPrototypeOf(n)){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e}}function g(e,t){let n=h(e,t);if(!n)return{present:!1,data:!1,read:()=>void 0};if(!(`value`in n))return{present:!0,data:!1,read:()=>Reflect.get(e,t)};let r=n.value;return{present:!!r,data:!0,read:()=>r}}const _=/* @__PURE__ */ new Set([`args`,`returns`,`handler`,`skipConvexValidation`]);function v(e){let t={};for(let n of Reflect.ownKeys(e))!_.has(n)&&Object.prototype.propertyIsEnumerable.call(e,n)&&Object.defineProperty(t,n,{value:Reflect.get(e,n),enumerable:!0,writable:!0,configurable:!0});return t}function y(e){if(!(e instanceof l.$ZodType))return e;if(e instanceof l.$ZodObject)return e._zod.def.shape;throw Error(`Unsupported zod type as args validator: `+e.constructor.name)}function b(u,d){let f=d.input??o.input,m=d.args??o.args;return function(o){let d=o.handler===void 0?o:o.handler,h=o.skipConvexValidation!==void 0&&o.skipConvexValidation,_=typeof o==`object`&&o?v(o):{},b=g(o,`args`),x=g(o,`returns`),S=n(()=>{let e=x.read();return e&&!(e instanceof l.$ZodType)?c.object(e):e}),C=n(()=>{let e=S();return e?r(e):void 0}),w=e=>{let t={};return x.present&&!h&&Object.defineProperty(t,"returns",{enumerable:!0,get:C}),t.handler=e,t};if(b.present){let r=b.data,o=r?{...y(b.read())}:void 0,l=n(()=>{let n=c.object(o??{...y(b.read())}),r=Object.keys(n.shape);return h&&e(n),{argsSchema:n,argsKeys:r,boundary:h?void 0:t(n)}}),g=n(()=>{let{argsSchema:t,boundary:n}=l();return s(n?.validator??e(t),m)}),v=w(async(e,t)=>{let{argsSchema:n,argsKeys:r,boundary:o}=l(),s=S();o?.preflight(t),p.set(e,t);let c=await f(e,a(t,Object.keys(m)),_),u=a(t,r),h=await n.safeParseAsync(u);if(!h.success)throw new i({ZodError:JSON.parse(JSON.stringify(h.error.issues,null,2))});let g=h.data,v={...e,...c.ctx},y={...g,...c.args},b=await d(v,y),x=s?await s.parseAsync(b===void 0?null:b):b;return c.onSuccess&&await c.onSuccess({ctx:e,args:g,result:x}),x});return h&&r&&l(),h?v.args=void 0:Object.defineProperty(v,"args",{enumerable:!0,get:g}),u(v)}if(h&&Object.keys(m).length>0)throw Error(`If you're using a custom function with arguments for the input customization, you cannot skip convex validation.`);return u(w(async(e,t)=>{let n=S();p.set(e,t);let r=await f(e,t,_),i={...e,...r.ctx},a={...t,...r.args},o=await d(i,a),s=n?await n.parseAsync(o===void 0?null:o):o;return r.onSuccess&&await r.onSuccess({ctx:e,args:t,result:s}),s}))}}export{m as rawFunctionArgs,f as zCustomAction,d as zCustomMutation,u as zCustomQuery};
|
|
2
2
|
//# sourceMappingURL=zod-registration.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zod-registration.mjs","names":["zodToConvex","zodToConvex$1","z","zCore","zCustomQuery","customFnBuilder","query","customization","zCustomMutation","mutation","zCustomAction","action","rawArguments","rawFunctionArgs","ctx","customInput","NoOp","inputArgs","fn","maybeObject","extra","returns","returnValidator","skipConvexValidation","zodOutputToConvex","args","argsValidator","argsSchema","argsKeys","boundary","compactArgumentBoundary","convexValidator","builder","addFieldsToValidator","allArgs","added","pick","rawArgs","parsed","ConvexError","finalCtx","finalArgs","ret","handler","result"],"sources":["../src/zod-registration.ts"],"sourcesContent":["// Internal auth registration seam. Public wrapper contracts match convex-helpers zod4.\n// Keep the installed helper's registration branches; only argument conversion differs.\nimport { pick } from 'convex-helpers'\nimport { NoOp, type Customization } from 'convex-helpers/server/customFunctions'\nimport { zodOutputToConvex, type CustomBuilder } from 'convex-helpers/server/zod4'\nimport { addFieldsToValidator } from 'convex-helpers/validators'\nimport type {\n\tActionBuilder,\n\tDefaultFunctionArgs,\n\tFunctionVisibility,\n\tGenericActionCtx,\n\tGenericDataModel,\n\tGenericMutationCtx,\n\tGenericQueryCtx,\n\tMutationBuilder,\n\tQueryBuilder,\n} from 'convex/server'\nimport { ConvexError, type PropertyValidators, type Value } from 'convex/values'\nimport * as z from 'zod/v4'\nimport * as zCore from 'zod/v4/core'\nimport { zodToConvex } from './zod-convex'\nimport { compactArgumentBoundary } from './querying/filter-boundary'\n\nexport function zCustomQuery<\n\tCustomArgsValidator extends PropertyValidators,\n\tCustomCtx extends Record<string, any>,\n\tCustomMadeArgs extends Record<string, any>,\n\tVisibility extends FunctionVisibility,\n\tDataModel extends GenericDataModel,\n\tExtraArgs extends Record<string, any> = object,\n>(\n\tquery: QueryBuilder<DataModel, Visibility>,\n\tcustomization: Customization<\n\t\tGenericQueryCtx<DataModel>,\n\t\tCustomArgsValidator,\n\t\tCustomCtx,\n\t\tCustomMadeArgs,\n\t\tExtraArgs\n\t>,\n) {\n\t// SAFETY: the private adapter preserves helper registration semantics; this is\n\t// the same generic boundary assertion used by the public helper wrappers.\n\treturn customFnBuilder(query, customization) as CustomBuilder<\n\t\t'query',\n\t\tCustomArgsValidator,\n\t\tCustomCtx,\n\t\tCustomMadeArgs,\n\t\tGenericQueryCtx<DataModel>,\n\t\tVisibility,\n\t\tExtraArgs\n\t>\n}\n\nexport function zCustomMutation<\n\tCustomArgsValidator extends PropertyValidators,\n\tCustomCtx extends Record<string, any>,\n\tCustomMadeArgs extends Record<string, any>,\n\tVisibility extends FunctionVisibility,\n\tDataModel extends GenericDataModel,\n\tExtraArgs extends Record<string, any> = object,\n>(\n\tmutation: MutationBuilder<DataModel, Visibility>,\n\tcustomization: Customization<\n\t\tGenericMutationCtx<DataModel>,\n\t\tCustomArgsValidator,\n\t\tCustomCtx,\n\t\tCustomMadeArgs,\n\t\tExtraArgs\n\t>,\n) {\n\t// SAFETY: the private adapter preserves helper registration semantics; this is\n\t// the same generic boundary assertion used by the public helper wrappers.\n\treturn customFnBuilder(mutation, customization) as CustomBuilder<\n\t\t'mutation',\n\t\tCustomArgsValidator,\n\t\tCustomCtx,\n\t\tCustomMadeArgs,\n\t\tGenericMutationCtx<DataModel>,\n\t\tVisibility,\n\t\tExtraArgs\n\t>\n}\n\nexport function zCustomAction<\n\tCustomArgsValidator extends PropertyValidators,\n\tCustomCtx extends Record<string, any>,\n\tCustomMadeArgs extends Record<string, any>,\n\tVisibility extends FunctionVisibility,\n\tDataModel extends GenericDataModel,\n\tExtraArgs extends Record<string, any> = object,\n>(\n\taction: ActionBuilder<DataModel, Visibility>,\n\tcustomization: Customization<\n\t\tGenericActionCtx<DataModel>,\n\t\tCustomArgsValidator,\n\t\tCustomCtx,\n\t\tCustomMadeArgs,\n\t\tExtraArgs\n\t>,\n) {\n\t// SAFETY: the private adapter preserves helper registration semantics; this is\n\t// the same generic boundary assertion used by the public helper wrappers.\n\treturn customFnBuilder(action, customization) as CustomBuilder<\n\t\t'action',\n\t\tCustomArgsValidator,\n\t\tCustomCtx,\n\t\tCustomMadeArgs,\n\t\tGenericActionCtx<DataModel>,\n\t\tVisibility,\n\t\tExtraArgs\n\t>\n}\n\n/** Raw (unparsed) function arguments, keyed by the native ctx of one invocation. */\nconst rawArguments = new WeakMap<object, DefaultFunctionArgs>()\n\n/**\n * The raw arguments of the invocation that produced `ctx`, before zod parsing.\n * Available inside a customization `input` callback; empty for unknown contexts.\n */\nexport function rawFunctionArgs<DataModel extends GenericDataModel>(\n\tctx: GenericQueryCtx<DataModel> | GenericMutationCtx<DataModel> | GenericActionCtx<DataModel>,\n): DefaultFunctionArgs {\n\treturn rawArguments.get(ctx) ?? {}\n}\n\nfunction customFnBuilder(\n\tbuilder: (args: any) => any,\n\tcustomization: Customization<any, any, any, any, any>,\n) {\n\t// Looking forward to when input / args / ... are optional\n\tconst customInput: Customization<any, any, any, any, any>['input'] =\n\t\tcustomization.input ?? NoOp.input\n\tconst inputArgs = customization.args ?? NoOp.args\n\treturn function customBuilder(fn: any): any {\n\t\tconst { args, handler = fn, skipConvexValidation = false, returns: maybeObject, ...extra } = fn\n\n\t\tconst returns =\n\t\t\tmaybeObject && !(maybeObject instanceof zCore.$ZodType) ? z.object(maybeObject) : maybeObject\n\n\t\tconst returnValidator =\n\t\t\treturns && !skipConvexValidation ? { returns: zodOutputToConvex(returns) } : null\n\n\t\tif (args) {\n\t\t\tlet argsValidator = args\n\t\t\tif (argsValidator instanceof zCore.$ZodType) {\n\t\t\t\tif (argsValidator instanceof zCore.$ZodObject) {\n\t\t\t\t\targsValidator = argsValidator._zod.def.shape\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t'Unsupported zod type as args validator: ' + argsValidator.constructor.name,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Capture top-level fields once, matching the native validator's registration lifetime.\n\t\t\t// Nested schemas retain their identity; parsing and callbacks still run per invocation.\n\t\t\tconst argsSchema = z.object({ ...argsValidator })\n\t\t\tconst argsKeys = Object.keys(argsSchema.shape)\n\t\t\t// One conversion preserves graph sharing across all user argument fields.\n\t\t\tconst boundary = skipConvexValidation ? undefined : compactArgumentBoundary(argsSchema)\n\t\t\tconst convexValidator = boundary?.validator ?? zodToConvex(argsSchema)\n\t\t\treturn builder({\n\t\t\t\targs: skipConvexValidation ? undefined : addFieldsToValidator(convexValidator, inputArgs),\n\t\t\t\t...returnValidator,\n\t\t\t\thandler: async (ctx: any, allArgs: any) => {\n\t\t\t\t\tboundary?.preflight(allArgs)\n\t\t\t\t\trawArguments.set(ctx, allArgs)\n\t\t\t\t\tconst added = await customInput(ctx, pick(allArgs, Object.keys(inputArgs)), extra)\n\t\t\t\t\tconst rawArgs = pick(allArgs, argsKeys)\n\t\t\t\t\tconst parsed = await argsSchema.safeParseAsync(rawArgs)\n\t\t\t\t\tif (!parsed.success) {\n\t\t\t\t\t\tthrow new ConvexError({\n\t\t\t\t\t\t\t// SAFETY: serialized Zod issues are the helper's existing Convex Value[] error payload.\n\t\t\t\t\t\t\tZodError: JSON.parse(JSON.stringify(parsed.error.issues, null, 2)) as Value[],\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tconst args = parsed.data\n\t\t\t\t\tconst finalCtx = { ...ctx, ...added.ctx }\n\t\t\t\t\tconst finalArgs = { ...args, ...added.args }\n\t\t\t\t\tconst ret = await handler(finalCtx, finalArgs)\n\t\t\t\t\t// We don't catch the error here. It's a developer error and we\n\t\t\t\t\t// don't want to risk exposing the unexpected value to the client.\n\t\t\t\t\tconst result = returns ? await returns.parseAsync(ret === undefined ? null : ret) : ret\n\t\t\t\t\tif (added.onSuccess) {\n\t\t\t\t\t\tawait added.onSuccess({ ctx, args, result })\n\t\t\t\t\t}\n\t\t\t\t\treturn result\n\t\t\t\t},\n\t\t\t})\n\t\t}\n\t\tif (skipConvexValidation && Object.keys(inputArgs).length > 0) {\n\t\t\tthrow new Error(\n\t\t\t\t\"If you're using a custom function with arguments for the input \" +\n\t\t\t\t\t'customization, you cannot skip convex validation.',\n\t\t\t)\n\t\t}\n\t\treturn builder({\n\t\t\t...returnValidator,\n\t\t\thandler: async (ctx: any, args: any) => {\n\t\t\t\trawArguments.set(ctx, args)\n\t\t\t\tconst added = await customInput(ctx, args, extra)\n\t\t\t\tconst finalCtx = { ...ctx, ...added.ctx }\n\t\t\t\tconst finalArgs = { ...args, ...added.args }\n\t\t\t\tconst ret = await handler(finalCtx, finalArgs)\n\t\t\t\t// We don't catch the error here. It's a developer error and we\n\t\t\t\t// don't want to risk exposing the unexpected value to the client.\n\t\t\t\tconst result = returns ? await returns.parseAsync(ret === undefined ? null : ret) : ret\n\t\t\t\tif (added.onSuccess) {\n\t\t\t\t\tawait added.onSuccess({ ctx, args, result })\n\t\t\t\t}\n\t\t\t\treturn result\n\t\t\t},\n\t\t})\n\t}\n}\n"],"mappings":"8bAuBA,SAAgBI,EAQf,EACA,EAOC,CAGD,OAAOC,EAAgBC,EAAOC,CAAa,CAS5C,CAEA,SAAgBC,EAQf,EACA,EAOC,CAGD,OAAOH,EAAgBI,EAAUF,CAAa,CAS/C,CAEA,SAAgBG,EAQf,EACA,EAOC,CAGD,OAAOL,EAAgBM,EAAQJ,CAAa,CAS7C,CAGA,MAAMK,kBAAe,IAAI,QAMzB,SAAgBC,EACf,EACsB,CACtB,OAAOD,EAAa,IAAIE,CAAG,GAAK,CAAC,CAClC,CAEA,SAAST,EACR,EACA,EACC,CAED,IAAMU,EACLR,EAAc,OAASS,EAAK,MACvBC,EAAYV,EAAc,MAAQS,EAAK,KAC7C,OAAO,SAAuB,EAAc,CAC3C,GAAM,CAAE,OAAM,UAAUE,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AQH,EAAUC,CAAS,EAGvCG,EAASvB,EAAU,MAAMA,EAAQ,WAAWqB,IAAQ,IAAA,GAAY,KAAOA,CAAG,EAAIA,EAIpF,OAHIP,EAAM,WACT,MAAMA,EAAM,UAAU,CAAE,MAAK,OAAM,QAAO,CAAC,EAErCS,CACR,CACD,CAAC,CACF,CACA,GAAIrB,GAAwB,OAAO,KAAKN,CAAS,CAAC,CAAC,OAAS,EAC3D,MAAU,MACT,kHAED,EAED,OAAOe,EAAQ,CACd,GAAGV,EACH,QAAS,MAAO,EAAU,IAAc,CACvCV,EAAa,IAAIE,EAAKW,CAAI,EAC1B,IAAMU,EAAQ,MAAMpB,EAAYD,EAAKW,EAAML,CAAK,EAC1CoB,EAAW,CAAE,GAAG1B,EAAK,GAAGqB,EAAM,GAAI,EAClCM,EAAY,CAAE,GAAGhB,EAAM,GAAGU,EAAM,IAAK,EACrCO,EAAM,MAAMC,EAAQH,EAAUC,CAAS,EAGvCG,EAASvB,EAAU,MAAMA,EAAQ,WAAWqB,IAAQ,IAAA,GAAY,KAAOA,CAAG,EAAIA,EAIpF,OAHIP,EAAM,WACT,MAAMA,EAAM,UAAU,CAAE,MAAK,OAAM,QAAO,CAAC,EAErCS,CACR,CACD,CAAC,CACF,CACD"}
|
|
1
|
+
{"version":3,"file":"zod-registration.mjs","names":["zodToConvex","zodToConvex$1","z","zCore","zCustomQuery","customFnBuilder","query","customization","zCustomMutation","mutation","zCustomAction","action","rawArguments","rawFunctionArgs","ctx","declared","target","definition","descriptor","key","presence","value","reserved","extraOptions","extra","argumentFields","args","customInput","NoOp","inputArgs","handler","fn","skipConvexValidation","declaredArgs","declaredReturns","returnsSchema","memoize","maybeObject","returnsValidator","returns","zodOutputToConvex","nativeDefinition","native","handle","dataArgs","capturedFields","argsState","argsSchema","argsKeys","compactArgumentBoundary","argsValidator","addFieldsToValidator","boundary","allArgs","added","pick","rawArgs","parsed","ConvexError","finalCtx","finalArgs","ret","result","builder"],"sources":["../src/zod-registration.ts"],"sourcesContent":["// Internal auth registration seam. Public wrapper contracts match convex-helpers zod4.\n// Keep the installed helper's registration branches; only argument conversion differs.\nimport { pick } from 'convex-helpers'\nimport { NoOp, type Customization } from 'convex-helpers/server/customFunctions'\nimport { zodOutputToConvex, type CustomBuilder } from 'convex-helpers/server/zod4'\nimport { addFieldsToValidator } from 'convex-helpers/validators'\nimport type {\n\tActionBuilder,\n\tDefaultFunctionArgs,\n\tFunctionVisibility,\n\tGenericActionCtx,\n\tGenericDataModel,\n\tGenericMutationCtx,\n\tGenericQueryCtx,\n\tMutationBuilder,\n\tQueryBuilder,\n} from 'convex/server'\nimport { ConvexError, type PropertyValidators, type Value } from 'convex/values'\nimport * as z from 'zod/v4'\nimport * as zCore from 'zod/v4/core'\nimport { zodToConvex } from './zod-convex'\nimport { compactArgumentBoundary } from './querying/filter-boundary'\nimport { memoize } from './modules/contracts/lazy'\n\nexport function zCustomQuery<\n\tCustomArgsValidator extends PropertyValidators,\n\tCustomCtx extends Record<string, any>,\n\tCustomMadeArgs extends Record<string, any>,\n\tVisibility extends FunctionVisibility,\n\tDataModel extends GenericDataModel,\n\tExtraArgs extends Record<string, any> = object,\n>(\n\tquery: QueryBuilder<DataModel, Visibility>,\n\tcustomization: Customization<\n\t\tGenericQueryCtx<DataModel>,\n\t\tCustomArgsValidator,\n\t\tCustomCtx,\n\t\tCustomMadeArgs,\n\t\tExtraArgs\n\t>,\n) {\n\t// SAFETY: the private adapter preserves helper registration semantics; this is\n\t// the same generic boundary assertion used by the public helper wrappers.\n\treturn customFnBuilder(query, customization) as CustomBuilder<\n\t\t'query',\n\t\tCustomArgsValidator,\n\t\tCustomCtx,\n\t\tCustomMadeArgs,\n\t\tGenericQueryCtx<DataModel>,\n\t\tVisibility,\n\t\tExtraArgs\n\t>\n}\n\nexport function zCustomMutation<\n\tCustomArgsValidator extends PropertyValidators,\n\tCustomCtx extends Record<string, any>,\n\tCustomMadeArgs extends Record<string, any>,\n\tVisibility extends FunctionVisibility,\n\tDataModel extends GenericDataModel,\n\tExtraArgs extends Record<string, any> = object,\n>(\n\tmutation: MutationBuilder<DataModel, Visibility>,\n\tcustomization: Customization<\n\t\tGenericMutationCtx<DataModel>,\n\t\tCustomArgsValidator,\n\t\tCustomCtx,\n\t\tCustomMadeArgs,\n\t\tExtraArgs\n\t>,\n) {\n\t// SAFETY: the private adapter preserves helper registration semantics; this is\n\t// the same generic boundary assertion used by the public helper wrappers.\n\treturn customFnBuilder(mutation, customization) as CustomBuilder<\n\t\t'mutation',\n\t\tCustomArgsValidator,\n\t\tCustomCtx,\n\t\tCustomMadeArgs,\n\t\tGenericMutationCtx<DataModel>,\n\t\tVisibility,\n\t\tExtraArgs\n\t>\n}\n\nexport function zCustomAction<\n\tCustomArgsValidator extends PropertyValidators,\n\tCustomCtx extends Record<string, any>,\n\tCustomMadeArgs extends Record<string, any>,\n\tVisibility extends FunctionVisibility,\n\tDataModel extends GenericDataModel,\n\tExtraArgs extends Record<string, any> = object,\n>(\n\taction: ActionBuilder<DataModel, Visibility>,\n\tcustomization: Customization<\n\t\tGenericActionCtx<DataModel>,\n\t\tCustomArgsValidator,\n\t\tCustomCtx,\n\t\tCustomMadeArgs,\n\t\tExtraArgs\n\t>,\n) {\n\t// SAFETY: the private adapter preserves helper registration semantics; this is\n\t// the same generic boundary assertion used by the public helper wrappers.\n\treturn customFnBuilder(action, customization) as CustomBuilder<\n\t\t'action',\n\t\tCustomArgsValidator,\n\t\tCustomCtx,\n\t\tCustomMadeArgs,\n\t\tGenericActionCtx<DataModel>,\n\t\tVisibility,\n\t\tExtraArgs\n\t>\n}\n\n/** Raw (unparsed) function arguments, keyed by the native ctx of one invocation. */\nconst rawArguments = new WeakMap<object, DefaultFunctionArgs>()\n\n/**\n * The raw arguments of the invocation that produced `ctx`, before zod parsing.\n * Available inside a customization `input` callback; empty for unknown contexts.\n */\nexport function rawFunctionArgs<DataModel extends GenericDataModel>(\n\tctx: GenericQueryCtx<DataModel> | GenericMutationCtx<DataModel> | GenericActionCtx<DataModel>,\n): DefaultFunctionArgs {\n\treturn rawArguments.get(ctx) ?? {}\n}\n\n/* oxlint-disable anti-slop/no-object-parameters, anti-slop/no-reflect-get, anti-slop/no-unsafe-dictionary-type, anti-slop/no-known-value-widening -- Registration reads arbitrary user definition records by descriptor so declared accessors stay unread. */\n/** Descriptor lookup that never invokes an accessor; follows the chain like destructuring does. */\nfunction declared(definition: object, key: PropertyKey): PropertyDescriptor | undefined {\n\tfor (let target: object | null = definition; target; target = Object.getPrototypeOf(target)) {\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(target, key)\n\t\tif (descriptor) return descriptor\n\t}\n\treturn undefined\n}\n\n/** Present means the destructured value would select the declared branch; accessors always do. */\nfunction presence(definition: object, key: PropertyKey) {\n\tconst descriptor = declared(definition, key)\n\tif (!descriptor) return { present: false, data: false, read: () => undefined }\n\tif (!('value' in descriptor))\n\t\treturn { present: true, data: false, read: () => Reflect.get(definition, key) }\n\tconst value = descriptor.value\n\treturn { present: Boolean(value), data: true, read: () => value }\n}\n\nconst reserved = new Set<PropertyKey>(['args', 'returns', 'handler', 'skipConvexValidation'])\n\n/** Object-rest equivalent that skips the lazily read keys. */\nfunction extraOptions(definition: object): Record<PropertyKey, unknown> {\n\tconst extra: Record<PropertyKey, unknown> = {}\n\tfor (const key of Reflect.ownKeys(definition)) {\n\t\tif (reserved.has(key) || !Object.prototype.propertyIsEnumerable.call(definition, key)) continue\n\t\t// Define rather than assign, as object rest does, so a `__proto__` key stays an own property.\n\t\tObject.defineProperty(extra, key, {\n\t\t\tvalue: Reflect.get(definition, key),\n\t\t\tenumerable: true,\n\t\t\twritable: true,\n\t\t\tconfigurable: true,\n\t\t})\n\t}\n\treturn extra\n}\n\n/* oxlint-enable anti-slop/no-object-parameters, anti-slop/no-reflect-get, anti-slop/no-unsafe-dictionary-type, anti-slop/no-known-value-widening */\n\nfunction argumentFields(args: any) {\n\tif (!(args instanceof zCore.$ZodType)) return args\n\tif (args instanceof zCore.$ZodObject) return args._zod.def.shape\n\tthrow new Error('Unsupported zod type as args validator: ' + args.constructor.name)\n}\n\nfunction customFnBuilder(\n\tbuilder: (args: any) => any,\n\tcustomization: Customization<any, any, any, any, any>,\n) {\n\t// Looking forward to when input / args / ... are optional\n\tconst customInput: Customization<any, any, any, any, any>['input'] =\n\t\tcustomization.input ?? NoOp.input\n\tconst inputArgs = customization.args ?? NoOp.args\n\treturn function customBuilder(fn: any): any {\n\t\t// Descriptor reads keep getter-declared args/returns unread until Convex or a call needs them.\n\t\tconst handler = fn.handler === undefined ? fn : fn.handler\n\t\tconst skipConvexValidation =\n\t\t\tfn.skipConvexValidation === undefined ? false : fn.skipConvexValidation\n\t\t// oxlint-disable-next-line anti-slop/no-runtime-typeof -- Builders accept a bare handler function or a definition object.\n\t\tconst extra = typeof fn === 'object' && fn !== null ? extraOptions(fn) : {}\n\t\tconst declaredArgs = presence(fn, 'args')\n\t\tconst declaredReturns = presence(fn, 'returns')\n\n\t\tconst returnsSchema = memoize(() => {\n\t\t\tconst maybeObject = declaredReturns.read()\n\t\t\treturn maybeObject && !(maybeObject instanceof zCore.$ZodType)\n\t\t\t\t? z.object(maybeObject)\n\t\t\t\t: maybeObject\n\t\t})\n\t\tconst returnsValidator = memoize(() => {\n\t\t\tconst returns = returnsSchema()\n\t\t\treturn returns ? zodOutputToConvex(returns) : undefined\n\t\t})\n\t\tconst nativeDefinition = (handle: (ctx: any, args: any) => Promise<any>) => {\n\t\t\t// oxlint-disable-next-line anti-slop/no-unsafe-dictionary-type -- The native definition carries opaque validators and the handler.\n\t\t\tconst native: Record<string, unknown> = {}\n\t\t\tif (declaredReturns.present && !skipConvexValidation)\n\t\t\t\tObject.defineProperty(native, 'returns', { enumerable: true, get: returnsValidator })\n\t\t\tnative.handler = handle\n\t\t\treturn native\n\t\t}\n\n\t\tif (declaredArgs.present) {\n\t\t\tconst dataArgs = declaredArgs.data\n\t\t\t// Data-declared fields are shape-checked and captured now, as registration always did;\n\t\t\t// only schema construction waits.\n\t\t\tconst capturedFields = dataArgs ? { ...argumentFields(declaredArgs.read()) } : undefined\n\t\t\tconst argsState = memoize(() => {\n\t\t\t\t// Capture top-level fields once, matching the native validator's registration lifetime.\n\t\t\t\t// Nested schemas retain their identity; parsing and callbacks still run per invocation.\n\t\t\t\tconst argsSchema = z.object(capturedFields ?? { ...argumentFields(declaredArgs.read()) })\n\t\t\t\tconst argsKeys = Object.keys(argsSchema.shape)\n\t\t\t\t// Skipped validation still rejects schemas Convex cannot represent.\n\t\t\t\tif (skipConvexValidation) zodToConvex(argsSchema)\n\t\t\t\tconst boundary = skipConvexValidation ? undefined : compactArgumentBoundary(argsSchema)\n\t\t\t\treturn { argsSchema, argsKeys, boundary }\n\t\t\t})\n\t\t\tconst argsValidator = memoize(() => {\n\t\t\t\tconst { argsSchema, boundary } = argsState()\n\t\t\t\t// One conversion preserves graph sharing across all user argument fields.\n\t\t\t\treturn addFieldsToValidator(boundary?.validator ?? zodToConvex(argsSchema), inputArgs)\n\t\t\t})\n\t\t\tconst native = nativeDefinition(async (ctx: any, allArgs: any) => {\n\t\t\t\tconst { argsSchema, argsKeys, boundary } = argsState()\n\t\t\t\tconst returns = returnsSchema()\n\t\t\t\tboundary?.preflight(allArgs)\n\t\t\t\trawArguments.set(ctx, allArgs)\n\t\t\t\tconst added = await customInput(ctx, pick(allArgs, Object.keys(inputArgs)), extra)\n\t\t\t\tconst rawArgs = pick(allArgs, argsKeys)\n\t\t\t\tconst parsed = await argsSchema.safeParseAsync(rawArgs)\n\t\t\t\tif (!parsed.success) {\n\t\t\t\t\tthrow new ConvexError({\n\t\t\t\t\t\t// SAFETY: serialized Zod issues are the helper's existing Convex Value[] error payload.\n\t\t\t\t\t\tZodError: JSON.parse(JSON.stringify(parsed.error.issues, null, 2)) as Value[],\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tconst args = parsed.data\n\t\t\t\tconst finalCtx = { ...ctx, ...added.ctx }\n\t\t\t\tconst finalArgs = { ...args, ...added.args }\n\t\t\t\tconst ret = await handler(finalCtx, finalArgs)\n\t\t\t\t// We don't catch the error here. It's a developer error and we\n\t\t\t\t// don't want to risk exposing the unexpected value to the client.\n\t\t\t\tconst result = returns ? await returns.parseAsync(ret === undefined ? null : ret) : ret\n\t\t\t\tif (added.onSuccess) {\n\t\t\t\t\tawait added.onSuccess({ ctx, args, result })\n\t\t\t\t}\n\t\t\t\treturn result\n\t\t\t})\n\t\t\t// Skipping is rare and has no export thunk to defer to, so data args keep registration errors.\n\t\t\tif (skipConvexValidation && dataArgs) argsState()\n\t\t\tif (skipConvexValidation) native.args = undefined\n\t\t\telse Object.defineProperty(native, 'args', { enumerable: true, get: argsValidator })\n\t\t\treturn builder(native)\n\t\t}\n\t\tif (skipConvexValidation && Object.keys(inputArgs).length > 0) {\n\t\t\tthrow new Error(\n\t\t\t\t\"If you're using a custom function with arguments for the input \" +\n\t\t\t\t\t'customization, you cannot skip convex validation.',\n\t\t\t)\n\t\t}\n\t\treturn builder(\n\t\t\tnativeDefinition(async (ctx: any, args: any) => {\n\t\t\t\tconst returns = returnsSchema()\n\t\t\t\trawArguments.set(ctx, args)\n\t\t\t\tconst added = await customInput(ctx, args, extra)\n\t\t\t\tconst finalCtx = { ...ctx, ...added.ctx }\n\t\t\t\tconst finalArgs = { ...args, ...added.args }\n\t\t\t\tconst ret = await handler(finalCtx, finalArgs)\n\t\t\t\t// We don't catch the error here. It's a developer error and we\n\t\t\t\t// don't want to risk exposing the unexpected value to the client.\n\t\t\t\tconst result = returns ? await returns.parseAsync(ret === undefined ? null : ret) : ret\n\t\t\t\tif (added.onSuccess) {\n\t\t\t\t\tawait added.onSuccess({ ctx, args, result })\n\t\t\t\t}\n\t\t\t\treturn result\n\t\t\t}),\n\t\t)\n\t}\n}\n"],"mappings":"qfAwBA,SAAgBI,EAQf,EACA,EAOC,CAGD,OAAOC,EAAgBC,EAAOC,CAAa,CAS5C,CAEA,SAAgBC,EAQf,EACA,EAOC,CAGD,OAAOH,EAAgB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ACA,GAAIV,GAAwB,OAAO,KAAKH,CAAS,CAAC,CAAC,OAAS,EAC3D,MAAU,MACT,kHAED,EAED,OAAOkC,EACNtB,EAAiB,MAAO,EAAU,IAAc,CAC/C,IAAMF,EAAUJ,EAAc,EAC9BvB,EAAa,IAAIE,EAAKY,CAAI,EAC1B,IAAM4B,EAAQ,MAAM3B,EAAYb,EAAKY,EAAMF,CAAK,EAC1CmC,EAAW,CAAE,GAAG7C,EAAK,GAAGwC,EAAM,GAAI,EAClCM,EAAY,CAAE,GAAGlC,EAAM,GAAG4B,EAAM,IAAK,EACrCO,EAAM,MAAM/B,EAAQ6B,EAAUC,CAAS,EAGvCE,EAASvB,EAAU,MAAMA,EAAQ,WAAWsB,IAAQ,IAAA,GAAY,KAAOA,CAAG,EAAIA,EAIpF,OAHIP,EAAM,WACT,MAAMA,EAAM,UAAU,CAAE,MAAK,OAAM,QAAO,CAAC,EAErCQ,CACR,CAAC,CACF,CACD,CACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cvx-kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
4
4
|
"description": "Reusable Convex application kit: foundation kernels, approvals component, zod table boundaries, WorkOS-backed auth function constructors, and audited command protocol.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"component",
|
|
@@ -164,6 +164,7 @@
|
|
|
164
164
|
"test:package:smoke:bun": "bun scripts/smoke-packed-components.mjs bun",
|
|
165
165
|
"test:package:smoke:npm": "node scripts/smoke-packed-components.mjs npm",
|
|
166
166
|
"skills:check": "node scripts/check-skills.mjs",
|
|
167
|
+
"bench:app-load": "node scripts/bench-app-load.mjs --check scripts/bench/app-load-budget.json",
|
|
167
168
|
"prepublishOnly": "bun run build && bun run typecheck && bun run test && bun run skills:check",
|
|
168
169
|
"build:codegen": "convex codegen --component-dir ./src/components/foundation && convex codegen --component-dir ./src/components/approvals && vp pack",
|
|
169
170
|
"release": "npm version patch && git push --follow-tags",
|