@gaganref/confect-core 10.3.1-fork.44 → 10.3.1-fork.46

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.
@@ -1,3 +1,4 @@
1
+ import type * as ManifestSection from "./ManifestSection.js";
1
2
  import type * as MiddlewareAttachment from "./MiddlewareAttachment.js";
2
3
  import type { DefaultFunctionArgs, FunctionType, FunctionVisibility, RegisteredAction, RegisteredMutation, RegisteredQuery } from "convex/server";
3
4
  import * as Schema from "effect/Schema";
@@ -14,6 +15,7 @@ export interface FunctionSpec<RuntimeAndFunctionType_ extends RuntimeAndFunction
14
15
  readonly functionVisibility: FunctionVisibility_;
15
16
  readonly name: Name_;
16
17
  readonly reservedArgument?: string;
18
+ readonly manifestSections?: ReadonlyArray<ManifestSection.Entry>;
17
19
  readonly functionProvenance: FunctionProvenance_;
18
20
  readonly middlewareSpecs: ReadonlyArray<MiddlewareSpecs_>;
19
21
  readonly middlewareAttachments: ReadonlyArray<MiddlewareAttachment.MiddlewareAttachment<MiddlewareSpecs_>>;
@@ -671,6 +673,7 @@ export type Extended<Fields_ extends Profile.Fields, MiddlewareSpecs_ extends Mi
671
673
  * Require more fields and attach more middleware after this profile's.
672
674
  */
673
675
  extend<Extension extends Profile.Fields = Profile.NoFields, Transforms extends Profile.Transforms = {}>(): <const Middleware_ extends ReadonlyArray<ProfileMiddleware<Profile.Apply<Profile.Both<Fields_, Extension>, string, any>>>>(config: {
676
+ readonly manifest?: Readonly<Record<string, ManifestSection.ManifestSection>>;
674
677
  readonly reservedArgument?: string;
675
678
  readonly middleware: Middleware_ & NotInherited<Middleware_, MiddlewareSpecs_>;
676
679
  } & OptionFree<Extension["Type"]> & Profile.SchemaConfig<Transforms, Profile.Apply<Profile.Both<Fields_, Extension>, string, any>>) => Extended<Profile.Both<Fields_, Extension>, MiddlewareSpecs_ | SpecOf<Middleware_[number]>, [
@@ -682,6 +685,7 @@ export type Extended<Fields_ extends Profile.Fields, MiddlewareSpecs_ extends Mi
682
685
  * Public builders whose specs require and keep `Fields_`, with `middleware`.
683
686
  */
684
687
  export declare const extend: <Fields_ extends Profile.Fields = Profile.NoFields, Transforms extends Profile.Transforms = {}>() => <const Middleware_ extends ReadonlyArray<ProfileMiddleware<Profile.Apply<Fields_, string, any>>>>(config: {
688
+ readonly manifest?: Readonly<Record<string, ManifestSection.ManifestSection>>;
685
689
  readonly reservedArgument?: string;
686
690
  readonly middleware: Middleware_;
687
691
  } & OptionFree<Fields_["Type"]> & Profile.SchemaConfig<Transforms, Profile.Apply<Fields_, string, any>>) => Extended<Fields_, SpecOf<Middleware_[number]>, [Transforms]>;
@@ -1 +1 @@
1
- {"version":3,"file":"FunctionSpec.d.ts","sourceRoot":"","sources":["../src/FunctionSpec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,oBAAoB,MAAM,2BAA2B,CAAC;AACvE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EAChB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAC;AAE9D,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,KAAK,OAAO,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,sBAAsB,MAAM,6BAA6B,CAAC;AAEtE,eAAO,MAAM,MAAM,gCAAgC,CAAC;AACpD,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC;AAEnC,eAAO,MAAM,cAAc,MAAO,OAAO,KAAG,CAAC,IAAI,YACf,CAAC;AAEnC,MAAM,WAAW,YAAY,CAC3B,uBAAuB,SAAS,sBAAsB,CAAC,sBAAsB,EAC7E,mBAAmB,SAAS,kBAAkB,EAC9C,KAAK,SAAS,MAAM,EACpB,mBAAmB,SAAS,kBAAkB,CAAC,kBAAkB,EACjE,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AM,CAAC,CAAC,GAC7C,CAAC,GACD,CAAC,SAAS,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,GAC3C,CAAC,GACD,KAAK,CAAC;AAuChB,eAAO,MAAM,iBAAiB,GA3B1B,CAAC,SAAS,0BAA0B;;;YAGnC,cAEI,KAAK,SAAS,MAAM;;;wFAyB5B,CAAC;AACF,eAAO,MAAM,mBAAmB,GA/B5B,CAAC,SAAS,0BAA0B;;;cAGnC,cAEI,KAAK,SAAS,MAAM;;;0FA6B5B,CAAC;AACF,eAAO,MAAM,oBAAoB,GAnC7B,CAAC,SAAS,0BAA0B;;;YAGnC,cAEI,KAAK,SAAS,MAAM;;;wFAiC5B,CAAC;AACF,eAAO,MAAM,sBAAsB,GAvC/B,CAAC,SAAS,0BAA0B;;;cAGnC,cAEI,KAAK,SAAS,MAAM;;;0FAqC5B,CAAC;AACF,eAAO,MAAM,kBAAkB,GA3C3B,CAAC,SAAS,0BAA0B;;;YAGnC,cAEI,KAAK,SAAS,MAAM;;;wFAyC5B,CAAC;AACF,eAAO,MAAM,oBAAoB,GA/C7B,CAAC,SAAS,0BAA0B;;;cAGnC,cAEI,KAAK,SAAS,MAAM;;;0FA6C5B,CAAC;AACF,eAAO,MAAM,sBAAsB,GAnD/B,CAAC,SAAS,0BAA0B;;;YAGnC,cAEI,KAAK,SAAS,MAAM;;;wFAiD5B,CAAC;AACF,eAAO,MAAM,wBAAwB,GAvDjC,CAAC,SAAS,0BAA0B;;;cAGnC,cAEI,KAAK,SAAS,MAAM;;;0FAqD5B,CAAC"}
@@ -45,6 +45,7 @@ const Proto = {
45
45
  runtimeAndFunctionType: this.runtimeAndFunctionType,
46
46
  functionVisibility: this.functionVisibility,
47
47
  name: this.name,
48
+ ...this.manifestSections === void 0 ? {} : { manifestSections: this.manifestSections },
48
49
  ...this.reservedArgument === void 0 ? {} : { reservedArgument: this.reservedArgument },
49
50
  ..."description" in this ? { description: this.description } : {},
50
51
  ..."fields" in this ? { fields: this.fields } : {},
@@ -95,7 +96,7 @@ const publicAction = make(ConvexAction, "public");
95
96
  const internalAction = make(ConvexAction, "internal");
96
97
  const publicNodeAction = make(NodeAction, "public");
97
98
  const internalNodeAction = make(NodeAction, "internal");
98
- const makeExtended = (middleware, schemas = [], reservedArgument) => {
99
+ const makeExtended = (middleware, schemas = [], reservedArgument, manifestSections = []) => {
99
100
  const extended = (makeSpec, paginated = false, reserves = false) => ({ name, description, args, returns, item, error, ...fields }) => {
100
101
  const info = {
101
102
  name,
@@ -125,6 +126,7 @@ const makeExtended = (middleware, schemas = [], reservedArgument) => {
125
126
  ...thunks
126
127
  }), {
127
128
  fields,
129
+ manifestSections,
128
130
  ...reserves && reservedArgument !== void 0 ? { reservedArgument } : {}
129
131
  }));
130
132
  };
@@ -134,13 +136,19 @@ const makeExtended = (middleware, schemas = [], reservedArgument) => {
134
136
  publicAction: extended(publicAction, false, true),
135
137
  publicNodeAction: extended(publicNodeAction, false, true),
136
138
  publicPaginatedQuery: extended(publicPaginatedQuery, true),
137
- extend: () => (config) => makeExtended([...middleware, ...config.middleware], [...schemas, config.schemas ?? {}], config.reservedArgument ?? reservedArgument)
139
+ extend: () => (config) => makeExtended([...middleware, ...config.middleware], [...schemas, config.schemas ?? {}], config.reservedArgument ?? reservedArgument, [...manifestSections, ...Object.entries(config.manifest ?? {}).map(([key, section]) => ({
140
+ key,
141
+ section
142
+ }))])
138
143
  };
139
144
  };
140
145
  /**
141
146
  * Public builders whose specs require and keep `Fields_`, with `middleware`.
142
147
  */
143
- const extend = () => (config) => makeExtended(config.middleware, [config.schemas ?? {}], config.reservedArgument);
148
+ const extend = () => (config) => makeExtended(config.middleware, [config.schemas ?? {}], config.reservedArgument, Object.entries(config.manifest ?? {}).map(([key, section]) => ({
149
+ key,
150
+ section
151
+ })));
144
152
  const makeConvex = (runtimeAndFunctionType, functionVisibility) => () => (name) => {
145
153
  validateConfectFunctionIdentifier(name);
146
154
  return Object.assign(Object.create(Proto), {
@@ -1 +1 @@
1
- {"version":3,"file":"FunctionSpec.js","names":["FunctionProvenance.Confect","FunctionProvenance.ConfectPaginated","RuntimeAndFunctionType.ConvexQuery","RuntimeAndFunctionType.ConvexMutation","RuntimeAndFunctionType.ConvexAction","RuntimeAndFunctionType.NodeAction","MiddlewareSpec.isMiddlewareSpec","FunctionProvenance.Convex"],"sources":["../src/FunctionSpec.ts"],"sourcesContent":["import type * as MiddlewareAttachment from \"./MiddlewareAttachment.js\";\nimport type {\n DefaultFunctionArgs,\n FunctionType,\n FunctionVisibility,\n RegisteredAction,\n RegisteredMutation,\n RegisteredQuery,\n} from \"convex/server\";\nimport * as Schema from \"effect/Schema\";\nimport * as Predicate from \"effect/Predicate\";\nimport * as FunctionProvenance from \"./FunctionProvenance.js\";\nimport { validateConfectFunctionIdentifier } from \"./Identifier.js\";\nimport * as MiddlewareSpec from \"./MiddlewareSpec.js\";\nimport type * as Profile from \"./Profile.js\";\nimport * as RuntimeAndFunctionType from \"./RuntimeAndFunctionType.js\";\n\nexport const TypeId = \"~@confect/core/FunctionSpec\";\nexport type TypeId = typeof TypeId;\n\nexport const isFunctionSpec = (u: unknown): u is AnyWithProps =>\n Predicate.hasProperty(u, TypeId);\n\nexport interface FunctionSpec<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n Name_ extends string,\n FunctionProvenance_ extends FunctionProvenance.FunctionProvenance,\n MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec = never,\n> {\n readonly [TypeId]: TypeId;\n readonly runtimeAndFunctionType: RuntimeAndFunctionType_;\n readonly functionVisibility: FunctionVisibility_;\n readonly name: Name_;\n readonly reservedArgument?: string;\n readonly functionProvenance: FunctionProvenance_;\n readonly middlewareSpecs: ReadonlyArray<MiddlewareSpecs_>;\n readonly middlewareAttachments: ReadonlyArray<\n MiddlewareAttachment.MiddlewareAttachment<MiddlewareSpecs_>\n >;\n}\n\nexport interface Builder<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n Name_ extends string,\n FunctionProvenance_ extends FunctionProvenance.FunctionProvenance,\n MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec = never,\n> extends FunctionSpec<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance_,\n MiddlewareSpecs_\n> {\n middleware<MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec>(\n middlewareSpec: MiddlewareSpec_ &\n MiddlewareSpec.ValidateFunctionAttach<\n MiddlewareSpec_,\n RuntimeAndFunctionType_,\n FunctionProvenance_,\n MiddlewareSpecs_\n >,\n ...options: MiddlewareAttachment.Args<NoInfer<MiddlewareSpec_>>\n ): Builder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance_,\n MiddlewareSpecs_ | MiddlewareSpec_\n >;\n}\n\nexport interface DescribedBuilder<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n Name_ extends string,\n FunctionProvenance_ extends FunctionProvenance.FunctionProvenance,\n MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec = never,\n> extends Builder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance_,\n MiddlewareSpecs_\n> {\n readonly description?: string;\n\n middleware<MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec>(\n middlewareSpec: MiddlewareSpec_ &\n MiddlewareSpec.ValidateFunctionAttach<\n MiddlewareSpec_,\n RuntimeAndFunctionType_,\n FunctionProvenance_,\n MiddlewareSpecs_\n >,\n ...options: MiddlewareAttachment.Args<NoInfer<MiddlewareSpec_>>\n ): DescribedBuilder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance_,\n MiddlewareSpecs_ | MiddlewareSpec_\n >;\n}\n\n/**\n * A spec built through {@link extend}, keeping its fields through middleware.\n */\nexport interface ExtendedBuilder<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n Name_ extends string,\n FunctionProvenance_ extends FunctionProvenance.FunctionProvenance,\n MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec,\n Fields_,\n> extends Builder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance_,\n MiddlewareSpecs_\n> {\n readonly description?: string;\n readonly fields: Profile.Info<Fields_>[\"fields\"];\n\n middleware<MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec>(\n middlewareSpec: MiddlewareSpec_ &\n MiddlewareSpec.ValidateFunctionAttach<\n MiddlewareSpec_,\n RuntimeAndFunctionType_,\n FunctionProvenance_,\n MiddlewareSpecs_\n >,\n ...options: MiddlewareAttachment.Args<NoInfer<MiddlewareSpec_>>\n ): ExtendedBuilder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance_,\n MiddlewareSpecs_ | MiddlewareSpec_,\n Fields_\n >;\n}\n\nexport interface Any {\n readonly [TypeId]: TypeId;\n}\n\nexport interface AnyWithProps extends FunctionSpec<\n RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility,\n string,\n FunctionProvenance.FunctionProvenance,\n MiddlewareSpec.AnyMiddlewareSpec\n> {\n readonly description?: string;\n readonly fields?: object;\n}\n\nexport interface AnyConfect extends FunctionSpec<\n RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility,\n string,\n FunctionProvenance.AnyConfect,\n MiddlewareSpec.AnyMiddlewareSpec\n> {}\n\nexport interface AnyConvex extends FunctionSpec<\n RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility,\n string,\n FunctionProvenance.AnyConvex,\n MiddlewareSpec.AnyMiddlewareSpec\n> {}\n\nexport interface AnyWithPropsWithRuntime<\n Runtime extends RuntimeAndFunctionType.Runtime,\n> extends FunctionSpec<\n RuntimeAndFunctionType.WithRuntime<Runtime>,\n FunctionVisibility,\n string,\n FunctionProvenance.FunctionProvenance,\n MiddlewareSpec.AnyMiddlewareSpec\n> {}\n\nexport interface AnyWithPropsWithFunctionType<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n> extends FunctionSpec<\n RuntimeAndFunctionType_,\n FunctionVisibility,\n string,\n FunctionProvenance.FunctionProvenance,\n MiddlewareSpec.AnyMiddlewareSpec\n> {}\n\nexport interface AnyWithPropsWithFunctionProvenance<\n FunctionProvenance_ extends FunctionProvenance.FunctionProvenance,\n> extends FunctionSpec<\n RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility,\n string,\n FunctionProvenance_,\n MiddlewareSpec.AnyMiddlewareSpec\n> {}\n\nexport type GetRuntimeAndFunctionType<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_[\"runtimeAndFunctionType\"];\n\nexport type GetFunctionVisibility<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_[\"functionVisibility\"];\n\nexport type GetFunctionProvenance<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_[\"functionProvenance\"];\n\nexport type Name<FunctionSpec_ extends AnyWithProps> = FunctionSpec_[\"name\"];\n\nexport type MiddlewareSpecs<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_[\"middlewareSpecs\"][number];\n\n/**\n * The field map declared by a Confect-provenance spec.\n */\nexport type ArgsFields<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_ extends {\n readonly functionProvenance: {\n readonly _tag: \"Confect\";\n readonly \"~ArgsFields\": infer ArgsFields_ extends\n FunctionProvenance.ArgsFields;\n };\n }\n ? ArgsFields_\n : FunctionSpec_ extends {\n readonly functionProvenance: { readonly _tag: \"Confect\" };\n }\n ? FunctionProvenance.ArgsFields\n : never;\n\n/**\n * The args schema assembled from a Confect-provenance spec's field map.\n */\nexport type ArgsSchema<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_ extends {\n readonly functionProvenance: {\n readonly _tag: \"Confect\";\n readonly \"~ArgsFields\": infer ArgsFields_ extends\n FunctionProvenance.ArgsFields;\n };\n }\n ? Schema.Struct<ArgsFields_>\n : FunctionSpec_ extends {\n readonly functionProvenance: {\n readonly _tag: \"Confect\";\n readonly args: infer ArgsSchema_ extends\n FunctionProvenance.AnyArgsSchema;\n };\n }\n ? ArgsSchema_\n : never;\n\nexport type ReturnsSchema<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_ extends {\n readonly functionProvenance: {\n readonly _tag: \"Confect\";\n readonly returns: infer ReturnsSchema_ extends Schema.Codec<any, any>;\n };\n }\n ? ReturnsSchema_\n : never;\n\nexport type ErrorSchema<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_ extends {\n readonly functionProvenance: {\n readonly _tag: \"Confect\";\n readonly error?: infer ErrorSchema_;\n };\n }\n ? Extract<ErrorSchema_, Schema.Codec<any, any>>\n : never;\n\nexport type Args<FunctionSpec_ extends AnyWithProps> = FunctionSpec_ extends {\n readonly functionProvenance: { readonly _tag: \"Confect\" };\n}\n ? ArgsSchema<FunctionSpec_>[\"Type\"]\n : GetFunctionProvenance<FunctionSpec_> extends FunctionProvenance.Convex<\n infer Args_,\n any\n >\n ? Args_\n : never;\n\nexport type Returns<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_ extends {\n readonly functionProvenance: { readonly _tag: \"Confect\" };\n }\n ? ReturnsSchema<FunctionSpec_>[\"Type\"]\n : GetFunctionProvenance<FunctionSpec_> extends FunctionProvenance.Convex<\n any,\n infer Returns_\n >\n ? Awaited<Returns_>\n : never;\n\nexport type EncodedArgs<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_ extends {\n readonly functionProvenance: { readonly _tag: \"Confect\" };\n }\n ? ArgsSchema<FunctionSpec_>[\"Encoded\"]\n : GetFunctionProvenance<FunctionSpec_> extends FunctionProvenance.Convex<\n infer Args_,\n any\n >\n ? Args_\n : never;\n\nexport type EncodedReturns<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_ extends {\n readonly functionProvenance: { readonly _tag: \"Confect\" };\n }\n ? ReturnsSchema<FunctionSpec_>[\"Encoded\"]\n : GetFunctionProvenance<FunctionSpec_> extends FunctionProvenance.Convex<\n any,\n infer Returns_\n >\n ? Returns_\n : never;\n\nexport type Error<FunctionSpec_ extends AnyWithProps> =\n ErrorSchema<FunctionSpec_>[\"Type\"];\n\nexport type EncodedError<FunctionSpec_ extends AnyWithProps> =\n ErrorSchema<FunctionSpec_>[\"Encoded\"];\n\nexport type WithName<\n FunctionSpec_ extends AnyWithProps,\n Name_ extends string,\n> = Extract<FunctionSpec_, { readonly name: Name_ }>;\n\nexport type WithRuntimeAndFunctionType<\n FunctionSpec_ extends AnyWithProps,\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n> = Extract<\n FunctionSpec_,\n { readonly runtimeAndFunctionType: RuntimeAndFunctionType_ }\n>;\n\nexport type WithFunctionType<\n FunctionSpec_ extends AnyWithProps,\n FunctionType_ extends FunctionType,\n> = Extract<\n FunctionSpec_,\n { readonly runtimeAndFunctionType: { readonly functionType: FunctionType_ } }\n>;\n\nexport type WithFunctionProvenance<\n FunctionSpec_ extends AnyWithProps,\n FunctionProvenance_ extends FunctionProvenance.FunctionProvenance,\n> = Extract<\n FunctionSpec_,\n { readonly functionProvenance: FunctionProvenance_ }\n>;\n\nexport type WithoutName<\n FunctionSpec_ extends AnyWithProps,\n Name_ extends Name<FunctionSpec_>,\n> = Exclude<FunctionSpec_, { readonly name: Name_ }>;\n\nconst Proto = {\n [TypeId]: TypeId,\n\n get middlewareSpecs() {\n return this.middlewareAttachments.map(({ spec }) => spec);\n },\n\n middleware(\n this: AnyWithProps,\n middlewareSpec: MiddlewareSpec.AnyMiddlewareSpec,\n ...options: ReadonlyArray<unknown>\n ) {\n if (this.functionProvenance._tag === \"Convex\") {\n throw new Error(\n `Plain Convex function \"${this.name}\" cannot have middleware`,\n );\n }\n const functionType = this.runtimeAndFunctionType.functionType;\n if (!middlewareSpec.functionTypes[functionType]) {\n throw new Error(\n `Middleware \"${middlewareSpec.key}\" does not declare function type \"${functionType}\" of function \"${this.name}\"`,\n );\n }\n if (\n !(\"options\" in middlewareSpec) &&\n this.middlewareAttachments.some(\n ({ spec }) => spec.key === middlewareSpec.key,\n )\n ) {\n throw new Error(\n `Middleware \"${middlewareSpec.key}\" is already attached to function \"${this.name}\"`,\n );\n }\n\n return Object.assign(Object.create(Proto), {\n runtimeAndFunctionType: this.runtimeAndFunctionType,\n functionVisibility: this.functionVisibility,\n name: this.name,\n ...(this.reservedArgument === undefined\n ? {}\n : { reservedArgument: this.reservedArgument }),\n ...(\"description\" in this ? { description: this.description } : {}),\n ...(\"fields\" in this ? { fields: this.fields } : {}),\n functionProvenance: this.functionProvenance,\n middlewareAttachments: [\n ...this.middlewareAttachments,\n { spec: middlewareSpec, options: options[0] },\n ],\n });\n },\n} satisfies ThisType<AnyWithProps>;\n\ninterface Options {\n readonly reservedArgument?: string;\n readonly description?: string;\n readonly name: string;\n readonly args?: () => FunctionProvenance.ArgsFields;\n readonly returns: () => Schema.Codec<any, any>;\n readonly error?: () => Schema.Codec<any, any>;\n}\n\nconst make = <\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n>(\n runtimeAndFunctionType: RuntimeAndFunctionType_,\n functionVisibility: FunctionVisibility_,\n) => {\n function makeSpec<\n const Name_ extends string,\n const ArgsFields_ extends FunctionProvenance.ArgsFields,\n Returns_ extends Schema.Codec<any, any>,\n Error_ extends Schema.Codec<any, any> = never,\n >(options: {\n reservedArgument?: RuntimeAndFunctionType_[\"functionType\"] extends \"query\"\n ? never\n : string;\n name: Name_;\n description?: never;\n args: () => ArgsFields_;\n returns: () => Returns_;\n error?: () => Error_;\n }): Builder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance.Confect<ArgsFields_, Returns_, Error_>\n >;\n function makeSpec<\n const Name_ extends string,\n Returns_ extends Schema.Codec<any, any>,\n Error_ extends Schema.Codec<any, any> = never,\n >(options: {\n reservedArgument?: RuntimeAndFunctionType_[\"functionType\"] extends \"query\"\n ? never\n : string;\n name: Name_;\n description?: never;\n args?: never;\n returns: () => Returns_;\n error?: () => Error_;\n }): Builder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance.Confect<{}, Returns_, Error_>\n >;\n function makeSpec<\n const Name_ extends string,\n const ArgsFields_ extends FunctionProvenance.ArgsFields,\n Returns_ extends Schema.Codec<any, any>,\n Error_ extends Schema.Codec<any, any> = never,\n >(options: {\n reservedArgument?: RuntimeAndFunctionType_[\"functionType\"] extends \"query\"\n ? never\n : string;\n name: Name_;\n description?: FunctionVisibility_ extends \"public\" ? string : never;\n args: () => ArgsFields_;\n returns: () => Returns_;\n error?: () => Error_;\n }): DescribedBuilder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance.Confect<ArgsFields_, Returns_, Error_>\n >;\n function makeSpec<\n const Name_ extends string,\n Returns_ extends Schema.Codec<any, any>,\n Error_ extends Schema.Codec<any, any> = never,\n >(options: {\n reservedArgument?: RuntimeAndFunctionType_[\"functionType\"] extends \"query\"\n ? never\n : string;\n name: Name_;\n description?: FunctionVisibility_ extends \"public\" ? string : never;\n args?: never;\n returns: () => Returns_;\n error?: () => Error_;\n }): DescribedBuilder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance.Confect<{}, Returns_, Error_>\n >;\n function makeSpec({\n name,\n description,\n args,\n returns,\n error,\n reservedArgument,\n }: Options) {\n validateConfectFunctionIdentifier(name);\n\n return Object.assign(Object.create(Proto), {\n runtimeAndFunctionType,\n functionVisibility,\n name,\n ...(runtimeAndFunctionType.functionType !== \"query\" &&\n reservedArgument !== undefined\n ? { reservedArgument }\n : {}),\n ...(description === undefined ? {} : { description }),\n functionProvenance:\n args === undefined\n ? FunctionProvenance.Confect(() => ({}), returns, error)\n : FunctionProvenance.Confect(args, returns, error),\n middlewareAttachments: [],\n });\n }\n\n return makeSpec;\n};\n\n/**\n * `Schema.Struct` fields that must not declare `paginationOpts`. Used to reject\n * a user args schema that redeclares the field the paginated constructors add\n * themselves; the check reports at the `args` thunk with an unsatisfiable type\n * when violated.\n */\ntype ForbidPaginationOpts<\n UserArgsFields extends FunctionProvenance.ArgsFields,\n> = \"paginationOpts\" extends keyof UserArgsFields\n ? { readonly paginationOpts: never }\n : unknown;\n\ninterface PaginatedOptions {\n readonly description?: string;\n readonly name: string;\n readonly args?: () => FunctionProvenance.ArgsFields;\n readonly item: () => Schema.Codec<any, any>;\n readonly error?: () => Schema.Codec<any, any>;\n}\n\nconst makePaginated = <\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n>(\n runtimeAndFunctionType: RuntimeAndFunctionType_,\n functionVisibility: FunctionVisibility_,\n) => {\n function makeSpec<\n const Name_ extends string,\n const UserArgsFields_ extends FunctionProvenance.ArgsFields,\n Item_ extends Schema.Codec<any, any>,\n Error_ extends Schema.Codec<any, any> = never,\n >(options: {\n name: Name_;\n description?: never;\n args: () => UserArgsFields_ & ForbidPaginationOpts<UserArgsFields_>;\n item: () => Item_;\n error?: () => Error_;\n }): Builder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance.ConfectPaginated<UserArgsFields_, Item_, Error_>\n >;\n function makeSpec<\n const Name_ extends string,\n Item_ extends Schema.Codec<any, any>,\n Error_ extends Schema.Codec<any, any> = never,\n >(options: {\n name: Name_;\n description?: never;\n args?: never;\n item: () => Item_;\n error?: () => Error_;\n }): Builder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance.ConfectPaginated<{}, Item_, Error_>\n >;\n function makeSpec<\n const Name_ extends string,\n const UserArgsFields_ extends FunctionProvenance.ArgsFields,\n Item_ extends Schema.Codec<any, any>,\n Error_ extends Schema.Codec<any, any> = never,\n >(options: {\n name: Name_;\n description?: FunctionVisibility_ extends \"public\" ? string : never;\n args: () => UserArgsFields_ & ForbidPaginationOpts<UserArgsFields_>;\n item: () => Item_;\n error?: () => Error_;\n }): DescribedBuilder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance.ConfectPaginated<UserArgsFields_, Item_, Error_>\n >;\n function makeSpec<\n const Name_ extends string,\n Item_ extends Schema.Codec<any, any>,\n Error_ extends Schema.Codec<any, any> = never,\n >(options: {\n name: Name_;\n description?: FunctionVisibility_ extends \"public\" ? string : never;\n args?: never;\n item: () => Item_;\n error?: () => Error_;\n }): DescribedBuilder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance.ConfectPaginated<{}, Item_, Error_>\n >;\n function makeSpec({\n name,\n description,\n args,\n item,\n error,\n }: PaginatedOptions) {\n validateConfectFunctionIdentifier(name);\n\n return Object.assign(Object.create(Proto), {\n runtimeAndFunctionType,\n functionVisibility,\n name,\n ...(description === undefined ? {} : { description }),\n functionProvenance:\n args === undefined\n ? FunctionProvenance.ConfectPaginated(() => ({}), item, error)\n : FunctionProvenance.ConfectPaginated(args, item, error),\n middlewareAttachments: [],\n });\n }\n\n return makeSpec;\n};\n\nexport const publicQuery = make(RuntimeAndFunctionType.ConvexQuery, \"public\");\nexport const internalQuery = make(\n RuntimeAndFunctionType.ConvexQuery,\n \"internal\",\n);\nexport const publicPaginatedQuery = makePaginated(\n RuntimeAndFunctionType.ConvexQuery,\n \"public\",\n);\nexport const internalPaginatedQuery = makePaginated(\n RuntimeAndFunctionType.ConvexQuery,\n \"internal\",\n);\nexport const publicMutation = make(\n RuntimeAndFunctionType.ConvexMutation,\n \"public\",\n);\nexport const internalMutation = make(\n RuntimeAndFunctionType.ConvexMutation,\n \"internal\",\n);\nexport const publicAction = make(RuntimeAndFunctionType.ConvexAction, \"public\");\nexport const internalAction = make(\n RuntimeAndFunctionType.ConvexAction,\n \"internal\",\n);\n\nexport const publicNodeAction = make(\n RuntimeAndFunctionType.NodeAction,\n \"public\",\n);\nexport const internalNodeAction = make(\n RuntimeAndFunctionType.NodeAction,\n \"internal\",\n);\n\ntype OptionlessMiddlewareSpec = MiddlewareSpec.AnyMiddlewareSpec & {\n readonly \"~Options\": never;\n};\n\ntype BuilderOption =\n | \"name\"\n | \"description\"\n | \"args\"\n | \"returns\"\n | \"item\"\n | \"error\";\n\n/**\n * Only a required description string may name a builder option. The builder\n * reads it as that option. The conditional keeps the mapped type out of a\n * builder call's inference, which would otherwise widen the function's name to\n * `string` when reporting the error.\n */\ntype OptionFree<Type> = [keyof Type & BuilderOption] extends [never]\n ? unknown\n : {\n readonly [\n Option in keyof Type & BuilderOption as Option extends \"description\"\n ? Type[Option] extends string\n ? string extends Type[Option]\n ? never\n : Option\n : Option\n : Option\n ]: never;\n };\n\n/**\n * A function's fields, checked once applied, since a profile's field type can\n * branch on the function's name.\n */\ntype CheckedFields<Type> = Type & OptionFree<Type>;\n\ntype NotRepeated<\n Middleware_,\n Inherited extends MiddlewareSpec.AnyMiddlewareSpec,\n> = Middleware_ extends {\n readonly key: infer Key extends MiddlewareSpec.Key<Inherited>;\n}\n ? MiddlewareSpec.AttachmentError<`Middleware \"${Key}\" is already attached by this profile`>\n : Middleware_;\n\n/**\n * Refuses a middleware without options that an earlier layer attached, as it is\n * attached at most once; one with options may repeat. Each member of an\n * element's union is checked, so an array typed `(A | B)[]` is refused when\n * either was attached.\n */\ntype NotInherited<\n Middleware_ extends ReadonlyArray<unknown>,\n Inherited extends MiddlewareSpec.AnyMiddlewareSpec,\n> = {\n readonly [Index in keyof Middleware_]: NotRepeated<\n Middleware_[Index],\n Inherited\n >;\n};\n\n/**\n * A profile's middleware: a spec without options, or an attachment.\n */\ntype ProfileMiddleware<FieldsType> =\n | OptionlessMiddlewareSpec\n | Profile.Attachment<MiddlewareSpec.AnyMiddlewareSpec, FieldsType>;\n\ntype SpecOf<Middleware_> =\n Middleware_ extends Profile.Attachment<infer MiddlewareSpec_, any>\n ? MiddlewareSpec_\n : Extract<Middleware_, MiddlewareSpec.AnyMiddlewareSpec>;\n\n/**\n * `never` when a profile middleware does not declare the function type.\n */\ntype Declared<\n MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec,\n FunctionType_ extends FunctionType,\n Make,\n> = [\n MiddlewareSpecs_ extends unknown\n ? FunctionType_ extends MiddlewareSpec.FunctionTypes<MiddlewareSpecs_>\n ? never\n : MiddlewareSpecs_\n : never,\n] extends [never]\n ? Make\n : never;\n\ntype Wrapped<\n Layers extends ReadonlyArray<Profile.Transforms>,\n Key extends keyof Profile.Transforms,\n Input,\n> = Layers extends readonly [\n infer First extends Profile.Transforms,\n ...infer Rest extends ReadonlyArray<Profile.Transforms>,\n]\n ? Wrapped<\n Rest,\n Key,\n Key extends keyof First\n ? [Input] extends [never]\n ? Key extends \"error\"\n ? Profile.Transform<First[Key], typeof Schema.Never>\n : never\n : Profile.Transform<First[Key], Input>\n : Input\n >\n : Input;\n\ntype UserArgs<A> = [A] extends [never] ? {} : A;\n\ntype ExtendedMake<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n Fields_ extends Profile.Fields,\n MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec,\n Layers extends ReadonlyArray<Profile.Transforms>,\n> = Declared<\n MiddlewareSpecs_,\n RuntimeAndFunctionType_[\"functionType\"],\n <\n const Name_ extends string,\n const ArgsFields_ extends FunctionProvenance.ArgsFields = never,\n Returns_ extends Schema.Codec<any, any> = never,\n Error_ extends Schema.Codec<any, any> = never,\n >(\n options: {\n readonly name: Name_;\n readonly description?: string;\n readonly args?: () => ArgsFields_;\n readonly returns: () => Returns_;\n readonly error?: () => Error_;\n } & NoInfer<\n CheckedFields<Profile.Apply<Fields_, Name_, UserArgs<ArgsFields_>>>\n >,\n ) => ExtendedBuilder<\n RuntimeAndFunctionType_,\n \"public\",\n Name_,\n FunctionProvenance.Confect<\n UserArgs<Wrapped<Layers, \"args\", ArgsFields_>>,\n Wrapped<Layers, \"returns\", Returns_>,\n Wrapped<Layers, \"error\", Error_>\n >,\n MiddlewareSpecs_,\n Profile.Apply<Fields_, Name_, UserArgs<ArgsFields_>>\n >\n>;\n\ntype ExtendedMakePaginated<\n Fields_ extends Profile.Fields,\n MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec,\n Layers extends ReadonlyArray<Profile.Transforms>,\n> = Declared<\n MiddlewareSpecs_,\n \"query\",\n <\n const Name_ extends string,\n const UserArgsFields_ extends FunctionProvenance.ArgsFields = never,\n Item_ extends Schema.Codec<any, any> = never,\n Error_ extends Schema.Codec<any, any> = never,\n >(\n options: {\n readonly name: Name_;\n readonly description?: string;\n readonly args?: () => UserArgsFields_ &\n ForbidPaginationOpts<UserArgsFields_>;\n readonly item: () => Item_;\n readonly error?: () => Error_;\n } & NoInfer<\n CheckedFields<Profile.Apply<Fields_, Name_, UserArgs<UserArgsFields_>>>\n >,\n ) => ExtendedBuilder<\n RuntimeAndFunctionType.ConvexQuery,\n \"public\",\n Name_,\n FunctionProvenance.ConfectPaginated<\n UserArgs<Wrapped<Layers, \"args\", UserArgsFields_>>,\n Wrapped<Layers, \"item\", Item_>,\n Wrapped<Layers, \"error\", Error_>\n >,\n MiddlewareSpecs_,\n Profile.Apply<Fields_, Name_, UserArgs<UserArgsFields_>>\n >\n>;\n\ninterface ExtendedRuntimes {\n readonly publicQuery: RuntimeAndFunctionType.ConvexQuery;\n readonly publicMutation: RuntimeAndFunctionType.ConvexMutation;\n readonly publicAction: RuntimeAndFunctionType.ConvexAction;\n readonly publicNodeAction: RuntimeAndFunctionType.NodeAction;\n}\n\n/**\n * A profile's five public builders and its own `extend`.\n */\nexport type Extended<\n Fields_ extends Profile.Fields,\n MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec,\n Layers extends ReadonlyArray<Profile.Transforms> = [],\n> = {\n readonly [Builder_ in keyof ExtendedRuntimes]: ExtendedMake<\n ExtendedRuntimes[Builder_],\n Fields_,\n MiddlewareSpecs_,\n Layers\n >;\n} & {\n readonly publicPaginatedQuery: ExtendedMakePaginated<\n Fields_,\n MiddlewareSpecs_,\n Layers\n >;\n /**\n * Require more fields and attach more middleware after this profile's.\n */\n extend<\n Extension extends Profile.Fields = Profile.NoFields,\n Transforms extends Profile.Transforms = {},\n >(): <\n const Middleware_ extends ReadonlyArray<\n ProfileMiddleware<\n Profile.Apply<Profile.Both<Fields_, Extension>, string, any>\n >\n >,\n >(\n config: {\n readonly reservedArgument?: string;\n readonly middleware: Middleware_ &\n NotInherited<Middleware_, MiddlewareSpecs_>;\n } & OptionFree<Extension[\"Type\"]> &\n Profile.SchemaConfig<\n Transforms,\n Profile.Apply<Profile.Both<Fields_, Extension>, string, any>\n >,\n ) => Extended<\n Profile.Both<Fields_, Extension>,\n MiddlewareSpecs_ | SpecOf<Middleware_[number]>,\n [...Layers, Transforms]\n >;\n};\n\ntype RuntimeWrappers = Partial<\n Record<\n keyof Profile.Transforms,\n (thunk: () => any, info: Profile.Info<any>) => () => any\n >\n>;\n\nconst makeExtended = (\n middleware: ReadonlyArray<ProfileMiddleware<any>>,\n schemas: ReadonlyArray<RuntimeWrappers> = [],\n reservedArgument?: string,\n): Extended<any, any> => {\n const extended =\n (\n makeSpec: (options: never) => object,\n paginated = false,\n reserves = false,\n ): any =>\n ({\n name,\n description,\n args,\n returns,\n item,\n error,\n ...fields\n }: Record<string, unknown>) => {\n const info = {\n name,\n ...(description === undefined ? {} : { description }),\n args: args ?? (() => ({})),\n fields,\n } as Profile.Info<unknown>;\n const thunks = {\n args,\n returns: paginated ? undefined : returns,\n item: paginated ? item : undefined,\n error,\n } as Partial<Record<keyof Profile.Transforms, () => any>>;\n for (const wrappers of schemas) {\n for (const key of [\"args\", \"returns\", \"item\", \"error\"] as const) {\n const wrap = wrappers[key];\n const thunk =\n thunks[key] ?? (key === \"error\" ? () => Schema.Never : undefined);\n if (wrap !== undefined && thunk !== undefined) {\n thunks[key] = () => wrap(thunk, info)();\n }\n }\n }\n return middleware.reduce(\n (spec: any, entry) =>\n MiddlewareSpec.isMiddlewareSpec(entry)\n ? spec.middleware(entry)\n : spec.middleware(entry.spec, entry.options(info)),\n Object.assign(makeSpec({ name, description, ...thunks } as never), {\n fields,\n ...(reserves && reservedArgument !== undefined\n ? { reservedArgument }\n : {}),\n }),\n );\n };\n\n return {\n publicQuery: extended(publicQuery),\n publicMutation: extended(publicMutation, false, true),\n publicAction: extended(publicAction, false, true),\n publicNodeAction: extended(publicNodeAction, false, true),\n publicPaginatedQuery: extended(publicPaginatedQuery, true),\n extend:\n () =>\n (config: {\n middleware: ReadonlyArray<ProfileMiddleware<any>>;\n schemas?: RuntimeWrappers;\n reservedArgument?: string;\n }) =>\n makeExtended(\n [...middleware, ...config.middleware],\n [...schemas, config.schemas ?? {}],\n config.reservedArgument ?? reservedArgument,\n ),\n };\n};\n\n/**\n * Public builders whose specs require and keep `Fields_`, with `middleware`.\n */\nexport const extend =\n <\n Fields_ extends Profile.Fields = Profile.NoFields,\n Transforms extends Profile.Transforms = {},\n >() =>\n <\n const Middleware_ extends ReadonlyArray<\n ProfileMiddleware<Profile.Apply<Fields_, string, any>>\n >,\n >(\n config: {\n readonly reservedArgument?: string;\n readonly middleware: Middleware_;\n } & OptionFree<Fields_[\"Type\"]> &\n Profile.SchemaConfig<Transforms, Profile.Apply<Fields_, string, any>>,\n ) =>\n makeExtended(\n config.middleware,\n [config.schemas ?? {}],\n config.reservedArgument,\n ) as Extended<Fields_, SpecOf<Middleware_[number]>, [Transforms]>;\n\ntype MatchingRegisteredFunction<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n> =\n RuntimeAndFunctionType.GetFunctionType<RuntimeAndFunctionType_> extends \"query\"\n ? RegisteredQuery<FunctionVisibility_, any, any>\n : RuntimeAndFunctionType.GetFunctionType<RuntimeAndFunctionType_> extends \"mutation\"\n ? RegisteredMutation<FunctionVisibility_, any, any>\n : RuntimeAndFunctionType.GetFunctionType<RuntimeAndFunctionType_> extends \"action\"\n ? RegisteredAction<FunctionVisibility_, any, any>\n : never;\n\ntype ExtractArgs<F> =\n F extends RegisteredQuery<any, infer A extends DefaultFunctionArgs, any>\n ? A\n : F extends RegisteredMutation<\n any,\n infer A extends DefaultFunctionArgs,\n any\n >\n ? A\n : F extends RegisteredAction<\n any,\n infer A extends DefaultFunctionArgs,\n any\n >\n ? A\n : never;\n\ntype ExtractReturns<F> =\n F extends RegisteredQuery<any, any, infer R>\n ? R\n : F extends RegisteredMutation<any, any, infer R>\n ? R\n : F extends RegisteredAction<any, any, infer R>\n ? R\n : never;\n\nconst makeConvex =\n <\n RuntimeAndFunctionType_ extends\n RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n >(\n runtimeAndFunctionType: RuntimeAndFunctionType_,\n functionVisibility: FunctionVisibility_,\n ) =>\n <\n F extends MatchingRegisteredFunction<\n RuntimeAndFunctionType_,\n FunctionVisibility_\n >,\n >() =>\n <const Name_ extends string>(\n name: Name_,\n ): Builder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance.Convex<ExtractArgs<F>, ExtractReturns<F>>\n > => {\n validateConfectFunctionIdentifier(name);\n\n return Object.assign(Object.create(Proto), {\n runtimeAndFunctionType,\n functionVisibility,\n name,\n functionProvenance: FunctionProvenance.Convex<\n ExtractArgs<F>,\n ExtractReturns<F>\n >(),\n middlewareAttachments: [],\n }) as any;\n };\n\nexport const convexPublicQuery = makeConvex(\n RuntimeAndFunctionType.ConvexQuery,\n \"public\",\n);\nexport const convexInternalQuery = makeConvex(\n RuntimeAndFunctionType.ConvexQuery,\n \"internal\",\n);\nexport const convexPublicMutation = makeConvex(\n RuntimeAndFunctionType.ConvexMutation,\n \"public\",\n);\nexport const convexInternalMutation = makeConvex(\n RuntimeAndFunctionType.ConvexMutation,\n \"internal\",\n);\nexport const convexPublicAction = makeConvex(\n RuntimeAndFunctionType.ConvexAction,\n \"public\",\n);\nexport const convexInternalAction = makeConvex(\n RuntimeAndFunctionType.ConvexAction,\n \"internal\",\n);\nexport const convexPublicNodeAction = makeConvex(\n RuntimeAndFunctionType.NodeAction,\n \"public\",\n);\nexport const convexInternalNodeAction = makeConvex(\n RuntimeAndFunctionType.NodeAction,\n \"internal\",\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAa,SAAS;AAGtB,MAAa,kBAAkB,MAC7B,UAAU,YAAY,GAAG,MAAM;AA0VjC,MAAM,QAAQ;EACX,SAAS;CAEV,IAAI,kBAAkB;EACpB,OAAO,KAAK,sBAAsB,KAAK,EAAE,WAAW,IAAI;CAC1D;CAEA,WAEE,gBACA,GAAG,SACH;EACA,IAAI,KAAK,mBAAmB,SAAS,UACnC,MAAM,IAAI,MACR,0BAA0B,KAAK,KAAK,yBACtC;EAEF,MAAM,eAAe,KAAK,uBAAuB;EACjD,IAAI,CAAC,eAAe,cAAc,eAChC,MAAM,IAAI,MACR,eAAe,eAAe,IAAI,oCAAoC,aAAa,iBAAiB,KAAK,KAAK,EAChH;EAEF,IACE,EAAE,aAAa,mBACf,KAAK,sBAAsB,MACxB,EAAE,WAAW,KAAK,QAAQ,eAAe,GAC5C,GAEA,MAAM,IAAI,MACR,eAAe,eAAe,IAAI,qCAAqC,KAAK,KAAK,EACnF;EAGF,OAAO,OAAO,OAAO,OAAO,OAAO,KAAK,GAAG;GACzC,wBAAwB,KAAK;GAC7B,oBAAoB,KAAK;GACzB,MAAM,KAAK;GACX,GAAI,KAAK,qBAAqB,KAAA,IAC1B,CAAC,IACD,EAAE,kBAAkB,KAAK,iBAAiB;GAC9C,GAAI,iBAAiB,OAAO,EAAE,aAA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BAAkB,SAAS,kBAAkB,OAAO,IAAI;EACxD,sBAAsB,SAAS,sBAAsB,IAAI;EACzD,eAEG,WAKC,aACE,CAAC,GAAG,YAAY,GAAG,OAAO,UAAU,GACpC,CAAC,GAAG,SAAS,OAAO,WAAW,CAAC,CAAC,GACjC,OAAO,oBAAoB,gBAC7B;CACN;AACF;;;;AAKA,MAAa,gBAUT,WAMA,aACE,OAAO,YACP,CAAC,OAAO,WAAW,CAAC,CAAC,GACrB,OAAO,gBACT;AAwCJ,MAAM,cAMF,wBACA,8BASA,SAMG;CACH,kCAAkC,IAAI;CAEtC,OAAO,OAAO,OAAO,OAAO,OAAO,KAAK,GAAG;EACzC;EACA;EACA;EACA,oBAAoBC,OAGlB;EACF,uBAAuB,CAAC;CAC1B,CAAC;AACH;AAEF,MAAa,oBAAoB,WAC/BL,aACA,QACF;AACA,MAAa,sBAAsB,WACjCA,aACA,UACF;AACA,MAAa,uBAAuB,WAClCC,gBACA,QACF;AACA,MAAa,yBAAyB,WACpCA,gBACA,UACF;AACA,MAAa,qBAAqB,WAChCC,cACA,QACF;AACA,MAAa,uBAAuB,WAClCA,cACA,UACF;AACA,MAAa,yBAAyB,WACpCC,YACA,QACF;AACA,MAAa,2BAA2B,WACtCA,YACA,UACF"}
1
+ {"version":3,"file":"FunctionSpec.js","names":["FunctionProvenance.Confect","FunctionProvenance.ConfectPaginated","RuntimeAndFunctionType.ConvexQuery","RuntimeAndFunctionType.ConvexMutation","RuntimeAndFunctionType.ConvexAction","RuntimeAndFunctionType.NodeAction","MiddlewareSpec.isMiddlewareSpec","FunctionProvenance.Convex"],"sources":["../src/FunctionSpec.ts"],"sourcesContent":["import type * as ManifestSection from \"./ManifestSection.js\";\nimport type * as MiddlewareAttachment from \"./MiddlewareAttachment.js\";\nimport type {\n DefaultFunctionArgs,\n FunctionType,\n FunctionVisibility,\n RegisteredAction,\n RegisteredMutation,\n RegisteredQuery,\n} from \"convex/server\";\nimport * as Schema from \"effect/Schema\";\nimport * as Predicate from \"effect/Predicate\";\nimport * as FunctionProvenance from \"./FunctionProvenance.js\";\nimport { validateConfectFunctionIdentifier } from \"./Identifier.js\";\nimport * as MiddlewareSpec from \"./MiddlewareSpec.js\";\nimport type * as Profile from \"./Profile.js\";\nimport * as RuntimeAndFunctionType from \"./RuntimeAndFunctionType.js\";\n\nexport const TypeId = \"~@confect/core/FunctionSpec\";\nexport type TypeId = typeof TypeId;\n\nexport const isFunctionSpec = (u: unknown): u is AnyWithProps =>\n Predicate.hasProperty(u, TypeId);\n\nexport interface FunctionSpec<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n Name_ extends string,\n FunctionProvenance_ extends FunctionProvenance.FunctionProvenance,\n MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec = never,\n> {\n readonly [TypeId]: TypeId;\n readonly runtimeAndFunctionType: RuntimeAndFunctionType_;\n readonly functionVisibility: FunctionVisibility_;\n readonly name: Name_;\n readonly reservedArgument?: string;\n readonly manifestSections?: ReadonlyArray<ManifestSection.Entry>;\n readonly functionProvenance: FunctionProvenance_;\n readonly middlewareSpecs: ReadonlyArray<MiddlewareSpecs_>;\n readonly middlewareAttachments: ReadonlyArray<\n MiddlewareAttachment.MiddlewareAttachment<MiddlewareSpecs_>\n >;\n}\n\nexport interface Builder<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n Name_ extends string,\n FunctionProvenance_ extends FunctionProvenance.FunctionProvenance,\n MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec = never,\n> extends FunctionSpec<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance_,\n MiddlewareSpecs_\n> {\n middleware<MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec>(\n middlewareSpec: MiddlewareSpec_ &\n MiddlewareSpec.ValidateFunctionAttach<\n MiddlewareSpec_,\n RuntimeAndFunctionType_,\n FunctionProvenance_,\n MiddlewareSpecs_\n >,\n ...options: MiddlewareAttachment.Args<NoInfer<MiddlewareSpec_>>\n ): Builder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance_,\n MiddlewareSpecs_ | MiddlewareSpec_\n >;\n}\n\nexport interface DescribedBuilder<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n Name_ extends string,\n FunctionProvenance_ extends FunctionProvenance.FunctionProvenance,\n MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec = never,\n> extends Builder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance_,\n MiddlewareSpecs_\n> {\n readonly description?: string;\n\n middleware<MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec>(\n middlewareSpec: MiddlewareSpec_ &\n MiddlewareSpec.ValidateFunctionAttach<\n MiddlewareSpec_,\n RuntimeAndFunctionType_,\n FunctionProvenance_,\n MiddlewareSpecs_\n >,\n ...options: MiddlewareAttachment.Args<NoInfer<MiddlewareSpec_>>\n ): DescribedBuilder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance_,\n MiddlewareSpecs_ | MiddlewareSpec_\n >;\n}\n\n/**\n * A spec built through {@link extend}, keeping its fields through middleware.\n */\nexport interface ExtendedBuilder<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n Name_ extends string,\n FunctionProvenance_ extends FunctionProvenance.FunctionProvenance,\n MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec,\n Fields_,\n> extends Builder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance_,\n MiddlewareSpecs_\n> {\n readonly description?: string;\n readonly fields: Profile.Info<Fields_>[\"fields\"];\n\n middleware<MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec>(\n middlewareSpec: MiddlewareSpec_ &\n MiddlewareSpec.ValidateFunctionAttach<\n MiddlewareSpec_,\n RuntimeAndFunctionType_,\n FunctionProvenance_,\n MiddlewareSpecs_\n >,\n ...options: MiddlewareAttachment.Args<NoInfer<MiddlewareSpec_>>\n ): ExtendedBuilder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance_,\n MiddlewareSpecs_ | MiddlewareSpec_,\n Fields_\n >;\n}\n\nexport interface Any {\n readonly [TypeId]: TypeId;\n}\n\nexport interface AnyWithProps extends FunctionSpec<\n RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility,\n string,\n FunctionProvenance.FunctionProvenance,\n MiddlewareSpec.AnyMiddlewareSpec\n> {\n readonly description?: string;\n readonly fields?: object;\n}\n\nexport interface AnyConfect extends FunctionSpec<\n RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility,\n string,\n FunctionProvenance.AnyConfect,\n MiddlewareSpec.AnyMiddlewareSpec\n> {}\n\nexport interface AnyConvex extends FunctionSpec<\n RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility,\n string,\n FunctionProvenance.AnyConvex,\n MiddlewareSpec.AnyMiddlewareSpec\n> {}\n\nexport interface AnyWithPropsWithRuntime<\n Runtime extends RuntimeAndFunctionType.Runtime,\n> extends FunctionSpec<\n RuntimeAndFunctionType.WithRuntime<Runtime>,\n FunctionVisibility,\n string,\n FunctionProvenance.FunctionProvenance,\n MiddlewareSpec.AnyMiddlewareSpec\n> {}\n\nexport interface AnyWithPropsWithFunctionType<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n> extends FunctionSpec<\n RuntimeAndFunctionType_,\n FunctionVisibility,\n string,\n FunctionProvenance.FunctionProvenance,\n MiddlewareSpec.AnyMiddlewareSpec\n> {}\n\nexport interface AnyWithPropsWithFunctionProvenance<\n FunctionProvenance_ extends FunctionProvenance.FunctionProvenance,\n> extends FunctionSpec<\n RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility,\n string,\n FunctionProvenance_,\n MiddlewareSpec.AnyMiddlewareSpec\n> {}\n\nexport type GetRuntimeAndFunctionType<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_[\"runtimeAndFunctionType\"];\n\nexport type GetFunctionVisibility<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_[\"functionVisibility\"];\n\nexport type GetFunctionProvenance<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_[\"functionProvenance\"];\n\nexport type Name<FunctionSpec_ extends AnyWithProps> = FunctionSpec_[\"name\"];\n\nexport type MiddlewareSpecs<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_[\"middlewareSpecs\"][number];\n\n/**\n * The field map declared by a Confect-provenance spec.\n */\nexport type ArgsFields<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_ extends {\n readonly functionProvenance: {\n readonly _tag: \"Confect\";\n readonly \"~ArgsFields\": infer ArgsFields_ extends\n FunctionProvenance.ArgsFields;\n };\n }\n ? ArgsFields_\n : FunctionSpec_ extends {\n readonly functionProvenance: { readonly _tag: \"Confect\" };\n }\n ? FunctionProvenance.ArgsFields\n : never;\n\n/**\n * The args schema assembled from a Confect-provenance spec's field map.\n */\nexport type ArgsSchema<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_ extends {\n readonly functionProvenance: {\n readonly _tag: \"Confect\";\n readonly \"~ArgsFields\": infer ArgsFields_ extends\n FunctionProvenance.ArgsFields;\n };\n }\n ? Schema.Struct<ArgsFields_>\n : FunctionSpec_ extends {\n readonly functionProvenance: {\n readonly _tag: \"Confect\";\n readonly args: infer ArgsSchema_ extends\n FunctionProvenance.AnyArgsSchema;\n };\n }\n ? ArgsSchema_\n : never;\n\nexport type ReturnsSchema<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_ extends {\n readonly functionProvenance: {\n readonly _tag: \"Confect\";\n readonly returns: infer ReturnsSchema_ extends Schema.Codec<any, any>;\n };\n }\n ? ReturnsSchema_\n : never;\n\nexport type ErrorSchema<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_ extends {\n readonly functionProvenance: {\n readonly _tag: \"Confect\";\n readonly error?: infer ErrorSchema_;\n };\n }\n ? Extract<ErrorSchema_, Schema.Codec<any, any>>\n : never;\n\nexport type Args<FunctionSpec_ extends AnyWithProps> = FunctionSpec_ extends {\n readonly functionProvenance: { readonly _tag: \"Confect\" };\n}\n ? ArgsSchema<FunctionSpec_>[\"Type\"]\n : GetFunctionProvenance<FunctionSpec_> extends FunctionProvenance.Convex<\n infer Args_,\n any\n >\n ? Args_\n : never;\n\nexport type Returns<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_ extends {\n readonly functionProvenance: { readonly _tag: \"Confect\" };\n }\n ? ReturnsSchema<FunctionSpec_>[\"Type\"]\n : GetFunctionProvenance<FunctionSpec_> extends FunctionProvenance.Convex<\n any,\n infer Returns_\n >\n ? Awaited<Returns_>\n : never;\n\nexport type EncodedArgs<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_ extends {\n readonly functionProvenance: { readonly _tag: \"Confect\" };\n }\n ? ArgsSchema<FunctionSpec_>[\"Encoded\"]\n : GetFunctionProvenance<FunctionSpec_> extends FunctionProvenance.Convex<\n infer Args_,\n any\n >\n ? Args_\n : never;\n\nexport type EncodedReturns<FunctionSpec_ extends AnyWithProps> =\n FunctionSpec_ extends {\n readonly functionProvenance: { readonly _tag: \"Confect\" };\n }\n ? ReturnsSchema<FunctionSpec_>[\"Encoded\"]\n : GetFunctionProvenance<FunctionSpec_> extends FunctionProvenance.Convex<\n any,\n infer Returns_\n >\n ? Returns_\n : never;\n\nexport type Error<FunctionSpec_ extends AnyWithProps> =\n ErrorSchema<FunctionSpec_>[\"Type\"];\n\nexport type EncodedError<FunctionSpec_ extends AnyWithProps> =\n ErrorSchema<FunctionSpec_>[\"Encoded\"];\n\nexport type WithName<\n FunctionSpec_ extends AnyWithProps,\n Name_ extends string,\n> = Extract<FunctionSpec_, { readonly name: Name_ }>;\n\nexport type WithRuntimeAndFunctionType<\n FunctionSpec_ extends AnyWithProps,\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n> = Extract<\n FunctionSpec_,\n { readonly runtimeAndFunctionType: RuntimeAndFunctionType_ }\n>;\n\nexport type WithFunctionType<\n FunctionSpec_ extends AnyWithProps,\n FunctionType_ extends FunctionType,\n> = Extract<\n FunctionSpec_,\n { readonly runtimeAndFunctionType: { readonly functionType: FunctionType_ } }\n>;\n\nexport type WithFunctionProvenance<\n FunctionSpec_ extends AnyWithProps,\n FunctionProvenance_ extends FunctionProvenance.FunctionProvenance,\n> = Extract<\n FunctionSpec_,\n { readonly functionProvenance: FunctionProvenance_ }\n>;\n\nexport type WithoutName<\n FunctionSpec_ extends AnyWithProps,\n Name_ extends Name<FunctionSpec_>,\n> = Exclude<FunctionSpec_, { readonly name: Name_ }>;\n\nconst Proto = {\n [TypeId]: TypeId,\n\n get middlewareSpecs() {\n return this.middlewareAttachments.map(({ spec }) => spec);\n },\n\n middleware(\n this: AnyWithProps,\n middlewareSpec: MiddlewareSpec.AnyMiddlewareSpec,\n ...options: ReadonlyArray<unknown>\n ) {\n if (this.functionProvenance._tag === \"Convex\") {\n throw new Error(\n `Plain Convex function \"${this.name}\" cannot have middleware`,\n );\n }\n const functionType = this.runtimeAndFunctionType.functionType;\n if (!middlewareSpec.functionTypes[functionType]) {\n throw new Error(\n `Middleware \"${middlewareSpec.key}\" does not declare function type \"${functionType}\" of function \"${this.name}\"`,\n );\n }\n if (\n !(\"options\" in middlewareSpec) &&\n this.middlewareAttachments.some(\n ({ spec }) => spec.key === middlewareSpec.key,\n )\n ) {\n throw new Error(\n `Middleware \"${middlewareSpec.key}\" is already attached to function \"${this.name}\"`,\n );\n }\n\n return Object.assign(Object.create(Proto), {\n runtimeAndFunctionType: this.runtimeAndFunctionType,\n functionVisibility: this.functionVisibility,\n name: this.name,\n ...(this.manifestSections === undefined\n ? {}\n : { manifestSections: this.manifestSections }),\n ...(this.reservedArgument === undefined\n ? {}\n : { reservedArgument: this.reservedArgument }),\n ...(\"description\" in this ? { description: this.description } : {}),\n ...(\"fields\" in this ? { fields: this.fields } : {}),\n functionProvenance: this.functionProvenance,\n middlewareAttachments: [\n ...this.middlewareAttachments,\n { spec: middlewareSpec, options: options[0] },\n ],\n });\n },\n} satisfies ThisType<AnyWithProps>;\n\ninterface Options {\n readonly reservedArgument?: string;\n readonly description?: string;\n readonly name: string;\n readonly args?: () => FunctionProvenance.ArgsFields;\n readonly returns: () => Schema.Codec<any, any>;\n readonly error?: () => Schema.Codec<any, any>;\n}\n\nconst make = <\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n>(\n runtimeAndFunctionType: RuntimeAndFunctionType_,\n functionVisibility: FunctionVisibility_,\n) => {\n function makeSpec<\n const Name_ extends string,\n const ArgsFields_ extends FunctionProvenance.ArgsFields,\n Returns_ extends Schema.Codec<any, any>,\n Error_ extends Schema.Codec<any, any> = never,\n >(options: {\n reservedArgument?: RuntimeAndFunctionType_[\"functionType\"] extends \"query\"\n ? never\n : string;\n name: Name_;\n description?: never;\n args: () => ArgsFields_;\n returns: () => Returns_;\n error?: () => Error_;\n }): Builder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance.Confect<ArgsFields_, Returns_, Error_>\n >;\n function makeSpec<\n const Name_ extends string,\n Returns_ extends Schema.Codec<any, any>,\n Error_ extends Schema.Codec<any, any> = never,\n >(options: {\n reservedArgument?: RuntimeAndFunctionType_[\"functionType\"] extends \"query\"\n ? never\n : string;\n name: Name_;\n description?: never;\n args?: never;\n returns: () => Returns_;\n error?: () => Error_;\n }): Builder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance.Confect<{}, Returns_, Error_>\n >;\n function makeSpec<\n const Name_ extends string,\n const ArgsFields_ extends FunctionProvenance.ArgsFields,\n Returns_ extends Schema.Codec<any, any>,\n Error_ extends Schema.Codec<any, any> = never,\n >(options: {\n reservedArgument?: RuntimeAndFunctionType_[\"functionType\"] extends \"query\"\n ? never\n : string;\n name: Name_;\n description?: FunctionVisibility_ extends \"public\" ? string : never;\n args: () => ArgsFields_;\n returns: () => Returns_;\n error?: () => Error_;\n }): DescribedBuilder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance.Confect<ArgsFields_, Returns_, Error_>\n >;\n function makeSpec<\n const Name_ extends string,\n Returns_ extends Schema.Codec<any, any>,\n Error_ extends Schema.Codec<any, any> = never,\n >(options: {\n reservedArgument?: RuntimeAndFunctionType_[\"functionType\"] extends \"query\"\n ? never\n : string;\n name: Name_;\n description?: FunctionVisibility_ extends \"public\" ? string : never;\n args?: never;\n returns: () => Returns_;\n error?: () => Error_;\n }): DescribedBuilder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance.Confect<{}, Returns_, Error_>\n >;\n function makeSpec({\n name,\n description,\n args,\n returns,\n error,\n reservedArgument,\n }: Options) {\n validateConfectFunctionIdentifier(name);\n\n return Object.assign(Object.create(Proto), {\n runtimeAndFunctionType,\n functionVisibility,\n name,\n ...(runtimeAndFunctionType.functionType !== \"query\" &&\n reservedArgument !== undefined\n ? { reservedArgument }\n : {}),\n ...(description === undefined ? {} : { description }),\n functionProvenance:\n args === undefined\n ? FunctionProvenance.Confect(() => ({}), returns, error)\n : FunctionProvenance.Confect(args, returns, error),\n middlewareAttachments: [],\n });\n }\n\n return makeSpec;\n};\n\n/**\n * `Schema.Struct` fields that must not declare `paginationOpts`. Used to reject\n * a user args schema that redeclares the field the paginated constructors add\n * themselves; the check reports at the `args` thunk with an unsatisfiable type\n * when violated.\n */\ntype ForbidPaginationOpts<\n UserArgsFields extends FunctionProvenance.ArgsFields,\n> = \"paginationOpts\" extends keyof UserArgsFields\n ? { readonly paginationOpts: never }\n : unknown;\n\ninterface PaginatedOptions {\n readonly description?: string;\n readonly name: string;\n readonly args?: () => FunctionProvenance.ArgsFields;\n readonly item: () => Schema.Codec<any, any>;\n readonly error?: () => Schema.Codec<any, any>;\n}\n\nconst makePaginated = <\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n>(\n runtimeAndFunctionType: RuntimeAndFunctionType_,\n functionVisibility: FunctionVisibility_,\n) => {\n function makeSpec<\n const Name_ extends string,\n const UserArgsFields_ extends FunctionProvenance.ArgsFields,\n Item_ extends Schema.Codec<any, any>,\n Error_ extends Schema.Codec<any, any> = never,\n >(options: {\n name: Name_;\n description?: never;\n args: () => UserArgsFields_ & ForbidPaginationOpts<UserArgsFields_>;\n item: () => Item_;\n error?: () => Error_;\n }): Builder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance.ConfectPaginated<UserArgsFields_, Item_, Error_>\n >;\n function makeSpec<\n const Name_ extends string,\n Item_ extends Schema.Codec<any, any>,\n Error_ extends Schema.Codec<any, any> = never,\n >(options: {\n name: Name_;\n description?: never;\n args?: never;\n item: () => Item_;\n error?: () => Error_;\n }): Builder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance.ConfectPaginated<{}, Item_, Error_>\n >;\n function makeSpec<\n const Name_ extends string,\n const UserArgsFields_ extends FunctionProvenance.ArgsFields,\n Item_ extends Schema.Codec<any, any>,\n Error_ extends Schema.Codec<any, any> = never,\n >(options: {\n name: Name_;\n description?: FunctionVisibility_ extends \"public\" ? string : never;\n args: () => UserArgsFields_ & ForbidPaginationOpts<UserArgsFields_>;\n item: () => Item_;\n error?: () => Error_;\n }): DescribedBuilder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance.ConfectPaginated<UserArgsFields_, Item_, Error_>\n >;\n function makeSpec<\n const Name_ extends string,\n Item_ extends Schema.Codec<any, any>,\n Error_ extends Schema.Codec<any, any> = never,\n >(options: {\n name: Name_;\n description?: FunctionVisibility_ extends \"public\" ? string : never;\n args?: never;\n item: () => Item_;\n error?: () => Error_;\n }): DescribedBuilder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance.ConfectPaginated<{}, Item_, Error_>\n >;\n function makeSpec({\n name,\n description,\n args,\n item,\n error,\n }: PaginatedOptions) {\n validateConfectFunctionIdentifier(name);\n\n return Object.assign(Object.create(Proto), {\n runtimeAndFunctionType,\n functionVisibility,\n name,\n ...(description === undefined ? {} : { description }),\n functionProvenance:\n args === undefined\n ? FunctionProvenance.ConfectPaginated(() => ({}), item, error)\n : FunctionProvenance.ConfectPaginated(args, item, error),\n middlewareAttachments: [],\n });\n }\n\n return makeSpec;\n};\n\nexport const publicQuery = make(RuntimeAndFunctionType.ConvexQuery, \"public\");\nexport const internalQuery = make(\n RuntimeAndFunctionType.ConvexQuery,\n \"internal\",\n);\nexport const publicPaginatedQuery = makePaginated(\n RuntimeAndFunctionType.ConvexQuery,\n \"public\",\n);\nexport const internalPaginatedQuery = makePaginated(\n RuntimeAndFunctionType.ConvexQuery,\n \"internal\",\n);\nexport const publicMutation = make(\n RuntimeAndFunctionType.ConvexMutation,\n \"public\",\n);\nexport const internalMutation = make(\n RuntimeAndFunctionType.ConvexMutation,\n \"internal\",\n);\nexport const publicAction = make(RuntimeAndFunctionType.ConvexAction, \"public\");\nexport const internalAction = make(\n RuntimeAndFunctionType.ConvexAction,\n \"internal\",\n);\n\nexport const publicNodeAction = make(\n RuntimeAndFunctionType.NodeAction,\n \"public\",\n);\nexport const internalNodeAction = make(\n RuntimeAndFunctionType.NodeAction,\n \"internal\",\n);\n\ntype OptionlessMiddlewareSpec = MiddlewareSpec.AnyMiddlewareSpec & {\n readonly \"~Options\": never;\n};\n\ntype BuilderOption =\n | \"name\"\n | \"description\"\n | \"args\"\n | \"returns\"\n | \"item\"\n | \"error\";\n\n/**\n * Only a required description string may name a builder option. The builder\n * reads it as that option. The conditional keeps the mapped type out of a\n * builder call's inference, which would otherwise widen the function's name to\n * `string` when reporting the error.\n */\ntype OptionFree<Type> = [keyof Type & BuilderOption] extends [never]\n ? unknown\n : {\n readonly [\n Option in keyof Type & BuilderOption as Option extends \"description\"\n ? Type[Option] extends string\n ? string extends Type[Option]\n ? never\n : Option\n : Option\n : Option\n ]: never;\n };\n\n/**\n * A function's fields, checked once applied, since a profile's field type can\n * branch on the function's name.\n */\ntype CheckedFields<Type> = Type & OptionFree<Type>;\n\ntype NotRepeated<\n Middleware_,\n Inherited extends MiddlewareSpec.AnyMiddlewareSpec,\n> = Middleware_ extends {\n readonly key: infer Key extends MiddlewareSpec.Key<Inherited>;\n}\n ? MiddlewareSpec.AttachmentError<`Middleware \"${Key}\" is already attached by this profile`>\n : Middleware_;\n\n/**\n * Refuses a middleware without options that an earlier layer attached, as it is\n * attached at most once; one with options may repeat. Each member of an\n * element's union is checked, so an array typed `(A | B)[]` is refused when\n * either was attached.\n */\ntype NotInherited<\n Middleware_ extends ReadonlyArray<unknown>,\n Inherited extends MiddlewareSpec.AnyMiddlewareSpec,\n> = {\n readonly [Index in keyof Middleware_]: NotRepeated<\n Middleware_[Index],\n Inherited\n >;\n};\n\n/**\n * A profile's middleware: a spec without options, or an attachment.\n */\ntype ProfileMiddleware<FieldsType> =\n | OptionlessMiddlewareSpec\n | Profile.Attachment<MiddlewareSpec.AnyMiddlewareSpec, FieldsType>;\n\ntype SpecOf<Middleware_> =\n Middleware_ extends Profile.Attachment<infer MiddlewareSpec_, any>\n ? MiddlewareSpec_\n : Extract<Middleware_, MiddlewareSpec.AnyMiddlewareSpec>;\n\n/**\n * `never` when a profile middleware does not declare the function type.\n */\ntype Declared<\n MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec,\n FunctionType_ extends FunctionType,\n Make,\n> = [\n MiddlewareSpecs_ extends unknown\n ? FunctionType_ extends MiddlewareSpec.FunctionTypes<MiddlewareSpecs_>\n ? never\n : MiddlewareSpecs_\n : never,\n] extends [never]\n ? Make\n : never;\n\ntype Wrapped<\n Layers extends ReadonlyArray<Profile.Transforms>,\n Key extends keyof Profile.Transforms,\n Input,\n> = Layers extends readonly [\n infer First extends Profile.Transforms,\n ...infer Rest extends ReadonlyArray<Profile.Transforms>,\n]\n ? Wrapped<\n Rest,\n Key,\n Key extends keyof First\n ? [Input] extends [never]\n ? Key extends \"error\"\n ? Profile.Transform<First[Key], typeof Schema.Never>\n : never\n : Profile.Transform<First[Key], Input>\n : Input\n >\n : Input;\n\ntype UserArgs<A> = [A] extends [never] ? {} : A;\n\ntype ExtendedMake<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n Fields_ extends Profile.Fields,\n MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec,\n Layers extends ReadonlyArray<Profile.Transforms>,\n> = Declared<\n MiddlewareSpecs_,\n RuntimeAndFunctionType_[\"functionType\"],\n <\n const Name_ extends string,\n const ArgsFields_ extends FunctionProvenance.ArgsFields = never,\n Returns_ extends Schema.Codec<any, any> = never,\n Error_ extends Schema.Codec<any, any> = never,\n >(\n options: {\n readonly name: Name_;\n readonly description?: string;\n readonly args?: () => ArgsFields_;\n readonly returns: () => Returns_;\n readonly error?: () => Error_;\n } & NoInfer<\n CheckedFields<Profile.Apply<Fields_, Name_, UserArgs<ArgsFields_>>>\n >,\n ) => ExtendedBuilder<\n RuntimeAndFunctionType_,\n \"public\",\n Name_,\n FunctionProvenance.Confect<\n UserArgs<Wrapped<Layers, \"args\", ArgsFields_>>,\n Wrapped<Layers, \"returns\", Returns_>,\n Wrapped<Layers, \"error\", Error_>\n >,\n MiddlewareSpecs_,\n Profile.Apply<Fields_, Name_, UserArgs<ArgsFields_>>\n >\n>;\n\ntype ExtendedMakePaginated<\n Fields_ extends Profile.Fields,\n MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec,\n Layers extends ReadonlyArray<Profile.Transforms>,\n> = Declared<\n MiddlewareSpecs_,\n \"query\",\n <\n const Name_ extends string,\n const UserArgsFields_ extends FunctionProvenance.ArgsFields = never,\n Item_ extends Schema.Codec<any, any> = never,\n Error_ extends Schema.Codec<any, any> = never,\n >(\n options: {\n readonly name: Name_;\n readonly description?: string;\n readonly args?: () => UserArgsFields_ &\n ForbidPaginationOpts<UserArgsFields_>;\n readonly item: () => Item_;\n readonly error?: () => Error_;\n } & NoInfer<\n CheckedFields<Profile.Apply<Fields_, Name_, UserArgs<UserArgsFields_>>>\n >,\n ) => ExtendedBuilder<\n RuntimeAndFunctionType.ConvexQuery,\n \"public\",\n Name_,\n FunctionProvenance.ConfectPaginated<\n UserArgs<Wrapped<Layers, \"args\", UserArgsFields_>>,\n Wrapped<Layers, \"item\", Item_>,\n Wrapped<Layers, \"error\", Error_>\n >,\n MiddlewareSpecs_,\n Profile.Apply<Fields_, Name_, UserArgs<UserArgsFields_>>\n >\n>;\n\ninterface ExtendedRuntimes {\n readonly publicQuery: RuntimeAndFunctionType.ConvexQuery;\n readonly publicMutation: RuntimeAndFunctionType.ConvexMutation;\n readonly publicAction: RuntimeAndFunctionType.ConvexAction;\n readonly publicNodeAction: RuntimeAndFunctionType.NodeAction;\n}\n\n/**\n * A profile's five public builders and its own `extend`.\n */\nexport type Extended<\n Fields_ extends Profile.Fields,\n MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec,\n Layers extends ReadonlyArray<Profile.Transforms> = [],\n> = {\n readonly [Builder_ in keyof ExtendedRuntimes]: ExtendedMake<\n ExtendedRuntimes[Builder_],\n Fields_,\n MiddlewareSpecs_,\n Layers\n >;\n} & {\n readonly publicPaginatedQuery: ExtendedMakePaginated<\n Fields_,\n MiddlewareSpecs_,\n Layers\n >;\n /**\n * Require more fields and attach more middleware after this profile's.\n */\n extend<\n Extension extends Profile.Fields = Profile.NoFields,\n Transforms extends Profile.Transforms = {},\n >(): <\n const Middleware_ extends ReadonlyArray<\n ProfileMiddleware<\n Profile.Apply<Profile.Both<Fields_, Extension>, string, any>\n >\n >,\n >(\n config: {\n readonly manifest?: Readonly<\n Record<string, ManifestSection.ManifestSection>\n >;\n readonly reservedArgument?: string;\n readonly middleware: Middleware_ &\n NotInherited<Middleware_, MiddlewareSpecs_>;\n } & OptionFree<Extension[\"Type\"]> &\n Profile.SchemaConfig<\n Transforms,\n Profile.Apply<Profile.Both<Fields_, Extension>, string, any>\n >,\n ) => Extended<\n Profile.Both<Fields_, Extension>,\n MiddlewareSpecs_ | SpecOf<Middleware_[number]>,\n [...Layers, Transforms]\n >;\n};\n\ntype RuntimeWrappers = Partial<\n Record<\n keyof Profile.Transforms,\n (thunk: () => any, info: Profile.Info<any>) => () => any\n >\n>;\n\nconst makeExtended = (\n middleware: ReadonlyArray<ProfileMiddleware<any>>,\n schemas: ReadonlyArray<RuntimeWrappers> = [],\n reservedArgument?: string,\n manifestSections: ReadonlyArray<ManifestSection.Entry> = [],\n): Extended<any, any> => {\n const extended =\n (\n makeSpec: (options: never) => object,\n paginated = false,\n reserves = false,\n ): any =>\n ({\n name,\n description,\n args,\n returns,\n item,\n error,\n ...fields\n }: Record<string, unknown>) => {\n const info = {\n name,\n ...(description === undefined ? {} : { description }),\n args: args ?? (() => ({})),\n fields,\n } as Profile.Info<unknown>;\n const thunks = {\n args,\n returns: paginated ? undefined : returns,\n item: paginated ? item : undefined,\n error,\n } as Partial<Record<keyof Profile.Transforms, () => any>>;\n for (const wrappers of schemas) {\n for (const key of [\"args\", \"returns\", \"item\", \"error\"] as const) {\n const wrap = wrappers[key];\n const thunk =\n thunks[key] ?? (key === \"error\" ? () => Schema.Never : undefined);\n if (wrap !== undefined && thunk !== undefined) {\n thunks[key] = () => wrap(thunk, info)();\n }\n }\n }\n return middleware.reduce(\n (spec: any, entry) =>\n MiddlewareSpec.isMiddlewareSpec(entry)\n ? spec.middleware(entry)\n : spec.middleware(entry.spec, entry.options(info)),\n Object.assign(makeSpec({ name, description, ...thunks } as never), {\n fields,\n manifestSections,\n ...(reserves && reservedArgument !== undefined\n ? { reservedArgument }\n : {}),\n }),\n );\n };\n\n return {\n publicQuery: extended(publicQuery),\n publicMutation: extended(publicMutation, false, true),\n publicAction: extended(publicAction, false, true),\n publicNodeAction: extended(publicNodeAction, false, true),\n publicPaginatedQuery: extended(publicPaginatedQuery, true),\n extend:\n () =>\n (config: {\n middleware: ReadonlyArray<ProfileMiddleware<any>>;\n schemas?: RuntimeWrappers;\n reservedArgument?: string;\n manifest?: Readonly<Record<string, ManifestSection.ManifestSection>>;\n }) =>\n makeExtended(\n [...middleware, ...config.middleware],\n [...schemas, config.schemas ?? {}],\n config.reservedArgument ?? reservedArgument,\n [\n ...manifestSections,\n ...Object.entries(config.manifest ?? {}).map(([key, section]) => ({\n key,\n section,\n })),\n ],\n ),\n };\n};\n\n/**\n * Public builders whose specs require and keep `Fields_`, with `middleware`.\n */\nexport const extend =\n <\n Fields_ extends Profile.Fields = Profile.NoFields,\n Transforms extends Profile.Transforms = {},\n >() =>\n <\n const Middleware_ extends ReadonlyArray<\n ProfileMiddleware<Profile.Apply<Fields_, string, any>>\n >,\n >(\n config: {\n readonly manifest?: Readonly<\n Record<string, ManifestSection.ManifestSection>\n >;\n readonly reservedArgument?: string;\n readonly middleware: Middleware_;\n } & OptionFree<Fields_[\"Type\"]> &\n Profile.SchemaConfig<Transforms, Profile.Apply<Fields_, string, any>>,\n ) =>\n makeExtended(\n config.middleware,\n [config.schemas ?? {}],\n config.reservedArgument,\n Object.entries(config.manifest ?? {}).map(([key, section]) => ({\n key,\n section,\n })),\n ) as Extended<Fields_, SpecOf<Middleware_[number]>, [Transforms]>;\n\ntype MatchingRegisteredFunction<\n RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n> =\n RuntimeAndFunctionType.GetFunctionType<RuntimeAndFunctionType_> extends \"query\"\n ? RegisteredQuery<FunctionVisibility_, any, any>\n : RuntimeAndFunctionType.GetFunctionType<RuntimeAndFunctionType_> extends \"mutation\"\n ? RegisteredMutation<FunctionVisibility_, any, any>\n : RuntimeAndFunctionType.GetFunctionType<RuntimeAndFunctionType_> extends \"action\"\n ? RegisteredAction<FunctionVisibility_, any, any>\n : never;\n\ntype ExtractArgs<F> =\n F extends RegisteredQuery<any, infer A extends DefaultFunctionArgs, any>\n ? A\n : F extends RegisteredMutation<\n any,\n infer A extends DefaultFunctionArgs,\n any\n >\n ? A\n : F extends RegisteredAction<\n any,\n infer A extends DefaultFunctionArgs,\n any\n >\n ? A\n : never;\n\ntype ExtractReturns<F> =\n F extends RegisteredQuery<any, any, infer R>\n ? R\n : F extends RegisteredMutation<any, any, infer R>\n ? R\n : F extends RegisteredAction<any, any, infer R>\n ? R\n : never;\n\nconst makeConvex =\n <\n RuntimeAndFunctionType_ extends\n RuntimeAndFunctionType.RuntimeAndFunctionType,\n FunctionVisibility_ extends FunctionVisibility,\n >(\n runtimeAndFunctionType: RuntimeAndFunctionType_,\n functionVisibility: FunctionVisibility_,\n ) =>\n <\n F extends MatchingRegisteredFunction<\n RuntimeAndFunctionType_,\n FunctionVisibility_\n >,\n >() =>\n <const Name_ extends string>(\n name: Name_,\n ): Builder<\n RuntimeAndFunctionType_,\n FunctionVisibility_,\n Name_,\n FunctionProvenance.Convex<ExtractArgs<F>, ExtractReturns<F>>\n > => {\n validateConfectFunctionIdentifier(name);\n\n return Object.assign(Object.create(Proto), {\n runtimeAndFunctionType,\n functionVisibility,\n name,\n functionProvenance: FunctionProvenance.Convex<\n ExtractArgs<F>,\n ExtractReturns<F>\n >(),\n middlewareAttachments: [],\n }) as any;\n };\n\nexport const convexPublicQuery = makeConvex(\n RuntimeAndFunctionType.ConvexQuery,\n \"public\",\n);\nexport const convexInternalQuery = makeConvex(\n RuntimeAndFunctionType.ConvexQuery,\n \"internal\",\n);\nexport const convexPublicMutation = makeConvex(\n RuntimeAndFunctionType.ConvexMutation,\n \"public\",\n);\nexport const convexInternalMutation = makeConvex(\n RuntimeAndFunctionType.ConvexMutation,\n \"internal\",\n);\nexport const convexPublicAction = makeConvex(\n RuntimeAndFunctionType.ConvexAction,\n \"public\",\n);\nexport const convexInternalAction = makeConvex(\n RuntimeAndFunctionType.ConvexAction,\n \"internal\",\n);\nexport const convexPublicNodeAction = makeConvex(\n RuntimeAndFunctionType.NodeAction,\n \"public\",\n);\nexport const convexInternalNodeAction = makeConvex(\n RuntimeAndFunctionType.NodeAction,\n \"internal\",\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAa,SAAS;AAGtB,MAAa,kBAAkB,MAC7B,UAAU,YAAY,GAAG,MAAM;AA2VjC,MAAM,QAAQ;EACX,SAAS;CAEV,IAAI,kBAAkB;EACpB,OAAO,KAAK,sBAAsB,KAAK,EAAE,WAAW,IAAI;CAC1D;CAEA,WAEE,gBACA,GAAG,SACH;EACA,IAAI,KAAK,mBAAmB,SAAS,UACnC,MAAM,IAAI,MACR,0BAA0B,KAAK,KAAK,yBACtC;EAEF,MAAM,eAAe,KAAK,uBAAuB;EACjD,IAAI,CAAC,eAAe,cAAc,eAChC,MAAM,IAAI,MACR,eAAe,eAAe,IAAI,oCAAoC,aAAa,iBAAiB,KAAK,KAAK,EAChH;EAEF,IACE,EAAE,aAAa,mBACf,KAAK,sBAAsB,MACxB,EAAE,WAAW,KAAK,QAAQ,eAAe,GAC5C,GAEA,MAAM,IAAI,MACR,eAAe,eAAe,IAAI,qCAAqC,KAAK,KAAK,EACnF;EAGF,OAAO,OAAO,OAAO,OAAO,OAAO,KAAK,GAAG;GACzC,wBAAwB,KAAK;GAC7B,oBAAoB,KAAK;GACzB,MAAM,KAAK;GACX,GAAI,KAAK,qBAAqB,KAAA,IAC1B,CAAC,IACD,EAAE,kBAAkB,KAAK,iBAAiB;GAC9C,GAAI,KAAK,qBAAqB,KAAA,IAC1B,CAAC,IACD,EAAE,kBAAkB,KAAK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,SAAS,gBAAgB,OAAO,IAAI;EACpD,cAAc,SAAS,cAAc,OAAO,IAAI;EAChD,kBAAkB,SAAS,kBAAkB,OAAO,IAAI;EACxD,sBAAsB,SAAS,sBAAsB,IAAI;EACzD,eAEG,WAMC,aACE,CAAC,GAAG,YAAY,GAAG,OAAO,UAAU,GACpC,CAAC,GAAG,SAAS,OAAO,WAAW,CAAC,CAAC,GACjC,OAAO,oBAAoB,kBAC3B,CACE,GAAG,kBACH,GAAG,OAAO,QAAQ,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,cAAc;GAChE;GACA;EACF,EAAE,CACJ,CACF;CACN;AACF;;;;AAKA,MAAa,gBAUT,WASA,aACE,OAAO,YACP,CAAC,OAAO,WAAW,CAAC,CAAC,GACrB,OAAO,kBACP,OAAO,QAAQ,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,cAAc;CAC7D;CACA;AACF,EAAE,CACJ;AAwCJ,MAAM,cAMF,wBACA,8BASA,SAMG;CACH,kCAAkC,IAAI;CAEtC,OAAO,OAAO,OAAO,OAAO,OAAO,KAAK,GAAG;EACzC;EACA;EACA;EACA,oBAAoBC,OAGlB;EACF,uBAAuB,CAAC;CAC1B,CAAC;AACH;AAEF,MAAa,oBAAoB,WAC/BL,aACA,QACF;AACA,MAAa,sBAAsB,WACjCA,aACA,UACF;AACA,MAAa,uBAAuB,WAClCC,gBACA,QACF;AACA,MAAa,yBAAyB,WACpCA,gBACA,UACF;AACA,MAAa,qBAAqB,WAChCC,cACA,QACF;AACA,MAAa,uBAAuB,WAClCA,cACA,UACF;AACA,MAAa,yBAAyB,WACpCC,YACA,QACF;AACA,MAAa,2BAA2B,WACtCA,YACA,UACF"}
@@ -0,0 +1,24 @@
1
+ import type * as FunctionSpec from "./FunctionSpec.js";
2
+ import type * as MiddlewareSpec from "./MiddlewareSpec.js";
3
+ export interface Data<Value = unknown> {
4
+ readonly format: number;
5
+ readonly functions: Readonly<Record<string, Value>>;
6
+ }
7
+ export interface ManifestSection<Value = unknown> {
8
+ readonly owner: string;
9
+ readonly format: number;
10
+ describe(input: {
11
+ readonly path: string;
12
+ readonly spec: FunctionSpec.AnyWithProps;
13
+ readonly middleware: ReadonlyArray<MiddlewareSpec.AnyMiddlewareSpec>;
14
+ }): Value;
15
+ check?(next: Data<Value>, previous: unknown): {
16
+ readonly errors: ReadonlyArray<string>;
17
+ readonly notes: ReadonlyArray<string>;
18
+ };
19
+ }
20
+ export interface Entry {
21
+ readonly key: string;
22
+ readonly section: ManifestSection;
23
+ }
24
+ //# sourceMappingURL=ManifestSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ManifestSection.d.ts","sourceRoot":"","sources":["../src/ManifestSection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,YAAY,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,KAAK,cAAc,MAAM,qBAAqB,CAAC;AAE3D,MAAM,WAAW,IAAI,CAAC,KAAK,GAAG,OAAO;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;CACrD;AAED,MAAM,WAAW,eAAe,CAAC,KAAK,GAAG,OAAO;IAC9C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC,YAAY,CAAC;QACzC,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;KACtE,GAAG,KAAK,CAAC;IACV,KAAK,CAAC,CACJ,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,EACjB,QAAQ,EAAE,OAAO,GAChB;QACD,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;QACvC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;KACvC,CAAC;CACH;AAED,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;CACnC"}
@@ -0,0 +1,7 @@
1
+ import { __exportAll } from "./_virtual/_rolldown/runtime.js";
2
+ //#region src/ManifestSection.ts
3
+ var ManifestSection_exports = /* @__PURE__ */ __exportAll({});
4
+ //#endregion
5
+ export { ManifestSection_exports };
6
+
7
+ //# sourceMappingURL=ManifestSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ManifestSection.js","names":[],"sources":["../src/ManifestSection.ts"],"sourcesContent":["import type * as FunctionSpec from \"./FunctionSpec.js\";\nimport type * as MiddlewareSpec from \"./MiddlewareSpec.js\";\n\nexport interface Data<Value = unknown> {\n readonly format: number;\n readonly functions: Readonly<Record<string, Value>>;\n}\n\nexport interface ManifestSection<Value = unknown> {\n readonly owner: string;\n readonly format: number;\n describe(input: {\n readonly path: string;\n readonly spec: FunctionSpec.AnyWithProps;\n readonly middleware: ReadonlyArray<MiddlewareSpec.AnyMiddlewareSpec>;\n }): Value;\n check?(\n next: Data<Value>,\n previous: unknown,\n ): {\n readonly errors: ReadonlyArray<string>;\n readonly notes: ReadonlyArray<string>;\n };\n}\n\nexport interface Entry {\n readonly key: string;\n readonly section: ManifestSection;\n}\n"],"mappings":""}
package/dist/index.d.ts CHANGED
@@ -14,6 +14,7 @@ export * as GroupSpec from "./GroupSpec.js";
14
14
  export * as Identifier from "./Identifier.js";
15
15
  export * as Lazy from "./Lazy.js";
16
16
  export * as Manifest from "./Manifest.js";
17
+ export * as ManifestSection from "./ManifestSection.js";
17
18
  export * as MiddlewareAttachment from "./MiddlewareAttachment.js";
18
19
  export * as MiddlewareSpec from "./MiddlewareSpec.js";
19
20
  export * as PaginationError from "./PaginationError.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,oBAAoB,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,sBAAsB,MAAM,6BAA6B,CA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AO,KAAK,iBAAiB,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,sBAAsB,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ import { Env_exports } from "./Env.js";
21
21
  import { GroupPath_exports } from "./GroupPath.js";
22
22
  import { Http_exports } from "./Http.js";
23
23
  import { Manifest_exports } from "./Manifest.js";
24
+ import { ManifestSection_exports } from "./ManifestSection.js";
24
25
  import { PaginationError_exports } from "./PaginationError.js";
25
26
  import { Profile_exports } from "./Profile.js";
26
27
  import { Refs_exports } from "./Refs.js";
@@ -29,4 +30,4 @@ import { SystemFields_exports } from "./SystemFields.js";
29
30
  import { Table_exports } from "./Table.js";
30
31
  import { Types_exports } from "./Types.js";
31
32
  import { UserIdentity_exports } from "./UserIdentity.js";
32
- export { ActionCall_exports as ActionCall, App_exports as App, Auth_exports as Auth, Callback_exports as Callback, Component_exports as Component, Env_exports as Env, FunctionProvenance_exports as FunctionProvenance, FunctionSpec_exports as FunctionSpec, GenericId_exports as GenericId, GroupPath_exports as GroupPath, GroupSpec_exports as GroupSpec, Http_exports as Http, IdScope_exports as IdScope, Identifier_exports as Identifier, Lazy_exports as Lazy, Manifest_exports as Manifest, MiddlewareAttachment_exports as MiddlewareAttachment, MiddlewareSpec_exports as MiddlewareSpec, PaginationError_exports as PaginationError, PaginationOptions_exports as PaginationOptions, PaginationResult_exports as PaginationResult, Profile_exports as Profile, Ref_exports as Ref, Refs_exports as Refs, RuntimeAndFunctionType_exports as RuntimeAndFunctionType, SchemaToValidator_exports as SchemaToValidator, Spec_exports as Spec, SystemFields_exports as SystemFields, Table_exports as Table, Types_exports as Types, UserIdentity_exports as UserIdentity };
33
+ export { ActionCall_exports as ActionCall, App_exports as App, Auth_exports as Auth, Callback_exports as Callback, Component_exports as Component, Env_exports as Env, FunctionProvenance_exports as FunctionProvenance, FunctionSpec_exports as FunctionSpec, GenericId_exports as GenericId, GroupPath_exports as GroupPath, GroupSpec_exports as GroupSpec, Http_exports as Http, IdScope_exports as IdScope, Identifier_exports as Identifier, Lazy_exports as Lazy, Manifest_exports as Manifest, ManifestSection_exports as ManifestSection, MiddlewareAttachment_exports as MiddlewareAttachment, MiddlewareSpec_exports as MiddlewareSpec, PaginationError_exports as PaginationError, PaginationOptions_exports as PaginationOptions, PaginationResult_exports as PaginationResult, Profile_exports as Profile, Ref_exports as Ref, Refs_exports as Refs, RuntimeAndFunctionType_exports as RuntimeAndFunctionType, SchemaToValidator_exports as SchemaToValidator, Spec_exports as Spec, SystemFields_exports as SystemFields, Table_exports as Table, Types_exports as Types, UserIdentity_exports as UserIdentity };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gaganref/confect-core",
3
- "version": "10.3.1-fork.44",
3
+ "version": "10.3.1-fork.46",
4
4
  "peerDependencies": {
5
5
  "convex": "^1.48.0",
6
6
  "effect": ">=4.0.0 <4.1.0"
@@ -1,3 +1,4 @@
1
+ import type * as ManifestSection from "./ManifestSection.js";
1
2
  import type * as MiddlewareAttachment from "./MiddlewareAttachment.js";
2
3
  import type {
3
4
  DefaultFunctionArgs,
@@ -33,6 +34,7 @@ export interface FunctionSpec<
33
34
  readonly functionVisibility: FunctionVisibility_;
34
35
  readonly name: Name_;
35
36
  readonly reservedArgument?: string;
37
+ readonly manifestSections?: ReadonlyArray<ManifestSection.Entry>;
36
38
  readonly functionProvenance: FunctionProvenance_;
37
39
  readonly middlewareSpecs: ReadonlyArray<MiddlewareSpecs_>;
38
40
  readonly middlewareAttachments: ReadonlyArray<
@@ -403,6 +405,9 @@ const Proto = {
403
405
  runtimeAndFunctionType: this.runtimeAndFunctionType,
404
406
  functionVisibility: this.functionVisibility,
405
407
  name: this.name,
408
+ ...(this.manifestSections === undefined
409
+ ? {}
410
+ : { manifestSections: this.manifestSections }),
406
411
  ...(this.reservedArgument === undefined
407
412
  ? {}
408
413
  : { reservedArgument: this.reservedArgument }),
@@ -925,6 +930,9 @@ export type Extended<
925
930
  >,
926
931
  >(
927
932
  config: {
933
+ readonly manifest?: Readonly<
934
+ Record<string, ManifestSection.ManifestSection>
935
+ >;
928
936
  readonly reservedArgument?: string;
929
937
  readonly middleware: Middleware_ &
930
938
  NotInherited<Middleware_, MiddlewareSpecs_>;
@@ -951,6 +959,7 @@ const makeExtended = (
951
959
  middleware: ReadonlyArray<ProfileMiddleware<any>>,
952
960
  schemas: ReadonlyArray<RuntimeWrappers> = [],
953
961
  reservedArgument?: string,
962
+ manifestSections: ReadonlyArray<ManifestSection.Entry> = [],
954
963
  ): Extended<any, any> => {
955
964
  const extended =
956
965
  (
@@ -996,6 +1005,7 @@ const makeExtended = (
996
1005
  : spec.middleware(entry.spec, entry.options(info)),
997
1006
  Object.assign(makeSpec({ name, description, ...thunks } as never), {
998
1007
  fields,
1008
+ manifestSections,
999
1009
  ...(reserves && reservedArgument !== undefined
1000
1010
  ? { reservedArgument }
1001
1011
  : {}),
@@ -1015,11 +1025,19 @@ const makeExtended = (
1015
1025
  middleware: ReadonlyArray<ProfileMiddleware<any>>;
1016
1026
  schemas?: RuntimeWrappers;
1017
1027
  reservedArgument?: string;
1028
+ manifest?: Readonly<Record<string, ManifestSection.ManifestSection>>;
1018
1029
  }) =>
1019
1030
  makeExtended(
1020
1031
  [...middleware, ...config.middleware],
1021
1032
  [...schemas, config.schemas ?? {}],
1022
1033
  config.reservedArgument ?? reservedArgument,
1034
+ [
1035
+ ...manifestSections,
1036
+ ...Object.entries(config.manifest ?? {}).map(([key, section]) => ({
1037
+ key,
1038
+ section,
1039
+ })),
1040
+ ],
1023
1041
  ),
1024
1042
  };
1025
1043
  };
@@ -1038,6 +1056,9 @@ export const extend =
1038
1056
  >,
1039
1057
  >(
1040
1058
  config: {
1059
+ readonly manifest?: Readonly<
1060
+ Record<string, ManifestSection.ManifestSection>
1061
+ >;
1041
1062
  readonly reservedArgument?: string;
1042
1063
  readonly middleware: Middleware_;
1043
1064
  } & OptionFree<Fields_["Type"]> &
@@ -1047,6 +1068,10 @@ export const extend =
1047
1068
  config.middleware,
1048
1069
  [config.schemas ?? {}],
1049
1070
  config.reservedArgument,
1071
+ Object.entries(config.manifest ?? {}).map(([key, section]) => ({
1072
+ key,
1073
+ section,
1074
+ })),
1050
1075
  ) as Extended<Fields_, SpecOf<Middleware_[number]>, [Transforms]>;
1051
1076
 
1052
1077
  type MatchingRegisteredFunction<
@@ -0,0 +1,29 @@
1
+ import type * as FunctionSpec from "./FunctionSpec.js";
2
+ import type * as MiddlewareSpec from "./MiddlewareSpec.js";
3
+
4
+ export interface Data<Value = unknown> {
5
+ readonly format: number;
6
+ readonly functions: Readonly<Record<string, Value>>;
7
+ }
8
+
9
+ export interface ManifestSection<Value = unknown> {
10
+ readonly owner: string;
11
+ readonly format: number;
12
+ describe(input: {
13
+ readonly path: string;
14
+ readonly spec: FunctionSpec.AnyWithProps;
15
+ readonly middleware: ReadonlyArray<MiddlewareSpec.AnyMiddlewareSpec>;
16
+ }): Value;
17
+ check?(
18
+ next: Data<Value>,
19
+ previous: unknown,
20
+ ): {
21
+ readonly errors: ReadonlyArray<string>;
22
+ readonly notes: ReadonlyArray<string>;
23
+ };
24
+ }
25
+
26
+ export interface Entry {
27
+ readonly key: string;
28
+ readonly section: ManifestSection;
29
+ }
package/src/index.ts CHANGED
@@ -14,6 +14,7 @@ export * as GroupSpec from "./GroupSpec.js";
14
14
  export * as Identifier from "./Identifier.js";
15
15
  export * as Lazy from "./Lazy.js";
16
16
  export * as Manifest from "./Manifest.js";
17
+ export * as ManifestSection from "./ManifestSection.js";
17
18
  export * as MiddlewareAttachment from "./MiddlewareAttachment.js";
18
19
  export * as MiddlewareSpec from "./MiddlewareSpec.js";
19
20
  export * as PaginationError from "./PaginationError.js";