@gaganref/confect-core 10.3.1-fork.3 → 10.3.1-fork.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActionCall.d.ts +18 -0
- package/dist/ActionCall.d.ts.map +1 -0
- package/dist/ActionCall.js +21 -0
- package/dist/ActionCall.js.map +1 -0
- package/dist/App.d.ts +14 -3
- package/dist/App.d.ts.map +1 -1
- package/dist/App.js +6 -3
- package/dist/App.js.map +1 -1
- package/dist/Auth.d.ts +2 -2
- package/dist/Auth.d.ts.map +1 -1
- package/dist/Auth.js.map +1 -1
- package/dist/Callback.d.ts +3 -3
- package/dist/Callback.d.ts.map +1 -1
- package/dist/Callback.js +2 -2
- package/dist/Callback.js.map +1 -1
- package/dist/Component.d.ts +8 -8
- package/dist/Component.d.ts.map +1 -1
- package/dist/Component.js +1 -1
- package/dist/Component.js.map +1 -1
- package/dist/FunctionProvenance.d.ts +2 -2
- package/dist/FunctionProvenance.d.ts.map +1 -1
- package/dist/FunctionProvenance.js.map +1 -1
- package/dist/FunctionSpec.d.ts +329 -5
- package/dist/FunctionSpec.d.ts.map +1 -1
- package/dist/FunctionSpec.js +53 -3
- package/dist/FunctionSpec.js.map +1 -1
- package/dist/GenericId.d.ts +2 -2
- package/dist/GenericId.d.ts.map +1 -1
- package/dist/GenericId.js.map +1 -1
- package/dist/GroupPath.d.ts +1 -1
- package/dist/GroupPath.d.ts.map +1 -1
- package/dist/GroupPath.js.map +1 -1
- package/dist/GroupSpec.d.ts +4 -4
- package/dist/GroupSpec.d.ts.map +1 -1
- package/dist/GroupSpec.js +1 -1
- package/dist/GroupSpec.js.map +1 -1
- package/dist/Http.d.ts +1 -1
- package/dist/Http.d.ts.map +1 -1
- package/dist/Http.js.map +1 -1
- package/dist/Manifest.d.ts +1 -1
- package/dist/Manifest.d.ts.map +1 -1
- package/dist/Manifest.js.map +1 -1
- package/dist/MiddlewareAttachment.d.ts +1 -1
- package/dist/MiddlewareAttachment.d.ts.map +1 -1
- package/dist/MiddlewareAttachment.js.map +1 -1
- package/dist/MiddlewareSpec.d.ts +3 -3
- package/dist/MiddlewareSpec.d.ts.map +1 -1
- package/dist/MiddlewareSpec.js.map +1 -1
- package/dist/Profile.d.ts +95 -0
- package/dist/Profile.d.ts.map +1 -0
- package/dist/Profile.js +15 -0
- package/dist/Profile.js.map +1 -0
- package/dist/Ref.d.ts +8 -7
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +7 -4
- package/dist/Ref.js.map +1 -1
- package/dist/Refs.d.ts +5 -5
- package/dist/Refs.d.ts.map +1 -1
- package/dist/Refs.js.map +1 -1
- package/dist/SchemaToValidator.d.ts +2 -2
- package/dist/SchemaToValidator.d.ts.map +1 -1
- package/dist/SchemaToValidator.js +1 -1
- package/dist/SchemaToValidator.js.map +1 -1
- package/dist/Spec.d.ts +1 -1
- package/dist/Spec.d.ts.map +1 -1
- package/dist/Spec.js.map +1 -1
- package/dist/SystemFields.d.ts +2 -2
- package/dist/SystemFields.d.ts.map +1 -1
- package/dist/SystemFields.js +1 -1
- package/dist/SystemFields.js.map +1 -1
- package/dist/Table.d.ts +3 -3
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js.map +1 -1
- package/dist/index.d.ts +31 -29
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -6
- package/package.json +1 -1
- package/src/ActionCall.ts +25 -0
- package/src/App.ts +20 -4
- package/src/Auth.ts +2 -2
- package/src/Callback.ts +4 -3
- package/src/Component.ts +12 -11
- package/src/FunctionProvenance.ts +3 -3
- package/src/FunctionSpec.ts +509 -9
- package/src/GenericId.ts +2 -2
- package/src/GroupPath.ts +1 -1
- package/src/GroupSpec.ts +5 -5
- package/src/Http.ts +1 -1
- package/src/Manifest.ts +1 -1
- package/src/MiddlewareAttachment.ts +1 -1
- package/src/MiddlewareSpec.ts +4 -4
- package/src/Profile.ts +141 -0
- package/src/Ref.ts +19 -10
- package/src/Refs.ts +5 -5
- package/src/SchemaToValidator.ts +3 -3
- package/src/Spec.ts +1 -1
- package/src/SystemFields.ts +2 -2
- package/src/Table.ts +4 -4
- package/src/index.ts +31 -29
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FunctionProvenance.js","names":["PaginationOptions.PaginationOptions","PaginationResult.PaginationResult"],"sources":["../src/FunctionProvenance.ts"],"sourcesContent":["import type { DefaultFunctionArgs } from \"convex/server\";\nimport * as Data from \"effect/Data\";\nimport * as Schema from \"effect/Schema\";\nimport * as Lazy from \"./Lazy\";\nimport * as PaginationOptions from \"./PaginationOptions\";\nimport * as PaginationResult from \"./PaginationResult\";\n\n/**\n * A field map accepted as Confect function args. Restricting each field to a\n * context-free codec means the struct assembled from the fields can always be\n * encoded and decoded synchronously at a Convex boundary.\n */\nexport type ArgsFields = {\n readonly [key: PropertyKey]: Schema.ConstraintCodec<any, any>;\n};\n\n/**\n * A struct-shaped Confect args schema that keeps its exact field map while\n * erasing the rest of `Schema.Struct`'s large implementation type. Decoded and\n * encoded args are derived directly from `ArgsFields_`; keeping the runtime\n * codec structural prevents every ref lookup from expanding the full Effect\n * schema type.\n */\nexport interface ArgsSchema<\n ArgsFields_ extends ArgsFields,\n> extends Schema.Codec<any, any> {\n readonly fields: ArgsFields_;\n}\n\n/**\n * Erased structural view used after the exact field map is no longer needed.\n */\nexport type AnyArgsSchema = ArgsSchema<ArgsFields>;\n\nexport type FunctionProvenance = Data.TaggedEnum<{\n Confect: {\n args: AnyArgsSchema;\n returns: Schema.Codec<any, any>;\n error?: Schema.Codec<any, any>;\n kind: ConfectKind;\n };\n Convex: {\n \"~args\": DefaultFunctionArgs;\n \"~returns\": any;\n };\n}>;\n\n/**\n * The declaration shape of a Confect function—orthogonal to both the provenance\n * origin (Confect vs Convex) and the function type (query/mutation/action). A\n * `Standard` function declares its args fields and returns schema directly; a\n * `Paginated` function declares user-args fields and an item schema from which\n * the Convex-facing `args`/`returns` are composed.\n */\nexport type ConfectKind = Standard | Paginated;\n\nexport interface Standard {\n readonly _tag: \"Standard\";\n}\n\nexport interface Paginated<\n UserArgsFields_ extends ArgsFields = ArgsFields,\n Item extends Schema.Codec<any, any> = Schema.Codec<any, any>,\n> {\n readonly _tag: \"Paginated\";\n /**\n * User-declared args—no `paginationOpts`.\n */\n readonly userArgs: ArgsSchema<UserArgsFields_>;\n /**\n * Page element schema.\n */\n readonly item: Item;\n /**\n * Mutable array of items—the page decode target.\n */\n readonly page: Schema.Codec<any, any>;\n}\n\nexport interface Confect<\n ArgsFields_ extends ArgsFields,\n Returns extends Schema.Codec<any, any>,\n Error extends Schema.Codec<any, any> = never,\n Kind extends ConfectKind = ConfectKind,\n> {\n readonly _tag: \"Confect\";\n readonly \"~ArgsFields\": ArgsFields_;\n readonly args: ArgsSchema<ArgsFields_>;\n readonly returns: Returns;\n readonly error?: Error;\n readonly kind: Kind;\n}\n\nexport interface AnyConfect {\n readonly _tag: \"Confect\";\n readonly args: AnyArgsSchema;\n readonly returns: Schema.Codec<any, any>;\n readonly error?: Schema.Codec<any, any>;\n readonly kind: ConfectKind;\n}\n\nexport interface Convex<Args extends DefaultFunctionArgs, Returns> {\n readonly _tag: \"Convex\";\n readonly \"~args\": Args;\n readonly \"~returns\": Returns;\n}\n\nexport interface AnyConvex extends Convex<DefaultFunctionArgs, any> {}\n\nexport const FunctionProvenance = Data.taggedEnum<FunctionProvenance>();\n\nconst Standard: Standard = { _tag: \"Standard\" };\n\n/**\n * Build a `Confect` provenance from lazy args-fields and schema thunks. `args`,\n * `returns`, and `error` are exposed as sync lazy memoised getters (via\n * {@link Lazy.defineProperty}) that only evaluate their thunk on first access,\n * mirroring how `Table` defers `Fields`/`Doc`. This keeps importing the\n * assembled `_generated/spec.ts` cheap—no\n * `Schema.Struct(...)`/`Schema.Array(...)` work runs at module load; it is\n * deferred to the first invocation that actually compiles validators or runs a\n * codec.\n *\n * The object is built by hand rather than through `FunctionProvenance.Confect`\n * because the `Data` constructor copies its input with `Object.assign`, which\n * would force the getters at construction time and defeat the laziness. `error`\n * is only installed when an `errorThunk` is provided, so its absence is\n * observable via `\"error\" in provenance` without forcing anything; nothing\n * relies on `Data`'s structural `Equal`/`Hash` for provenance values.\n */\nexport const Confect = <\n const ArgsFields_ extends ArgsFields,\n Returns extends Schema.Codec<any, any>,\n Error extends Schema.Codec<any, any> = never,\n>(\n args: () => ArgsFields_,\n returns: () => Returns,\n error?: () => Error,\n): Confect<ArgsFields_, Returns, Error, Standard> => {\n const provenance = { _tag: \"Confect\" as const, kind: Standard };\n\n Lazy.defineProperty(provenance, \"args\", () => Schema.Struct(args()));\n Lazy.defineProperty(provenance, \"returns\", returns);\n if (error !== undefined) {\n Lazy.defineProperty(provenance, \"error\", error);\n }\n\n return provenance as Confect<ArgsFields_, Returns, Error, Standard>;\n};\n\n/**\n * The composed args schema of a paginated query: the user-declared fields plus\n * the `paginationOpts` field managed by Convex's pagination protocol.\n *\n * The fields-first representation keeps the user-declared map available for\n * type-level composition without reconstructing it from an erased schema.\n */\nexport type PaginatedArgsFields<UserArgsFields extends ArgsFields> =\n UserArgsFields & {\n readonly paginationOpts: typeof PaginationOptions.PaginationOptions;\n };\n\nexport type PaginatedArgs<UserArgsFields extends ArgsFields> = Schema.Struct<\n PaginatedArgsFields<UserArgsFields>\n>;\n\n/**\n * The composed returns schema of a paginated query: a `PaginationResult` of the\n * item schema. Same deferred-conditional device as {@link PaginatedArgs}.\n */\nexport type PaginatedReturns<Item extends Schema.Codec<any, any>> =\n PaginationResult.PaginationResult<Item> extends infer ComposedReturns extends\n Schema.Codec<any, any>\n ? ComposedReturns\n : never;\n\nexport interface ConfectPaginated<\n UserArgsFields extends ArgsFields,\n Item extends Schema.Codec<any, any>,\n Error extends Schema.Codec<any, any> = never,\n> extends Confect<\n PaginatedArgsFields<UserArgsFields>,\n PaginatedReturns<Item>,\n Error,\n Paginated<UserArgsFields, Item>\n> {}\n\nexport interface AnyConfectPaginated extends AnyConfect {\n readonly kind: Paginated;\n}\n\n/**\n * Build the provenance of a paginated query from lazy schema thunks, with the\n * same laziness contract as {@link Confect}. The user-facing schemas live on the\n * `Paginated` kind (`kind.userArgs`, `kind.item`, `kind.page`)—the kind\n * container is built eagerly (it is cheap) while the schemas inside it stay\n * lazy. The composed Convex-facing `args`/`returns` are derived lazily from\n * them: `args` spreads the user fields plus `paginationOpts`, and `returns`\n * wraps the item in `PaginationResult`. Composition living here means the\n * composed schemas can never drift from the stored user schemas.\n */\nexport const ConfectPaginated = <\n const UserArgsFields_ extends ArgsFields,\n Item extends Schema.Codec<any, any>,\n Error extends Schema.Codec<any, any> = never,\n>(\n userArgs: () => UserArgsFields_,\n item: () => Item,\n error?: () => Error,\n): ConfectPaginated<UserArgsFields_, Item, Error> => {\n const kind = { _tag: \"Paginated\" as const };\n const paginatedKind = kind as Paginated<UserArgsFields_, Item>;\n\n Lazy.defineProperty(kind, \"userArgs\", () => Schema.Struct(userArgs()));\n Lazy.defineProperty(kind, \"item\", item);\n Lazy.defineProperty(kind, \"page\", () =>\n Schema.mutable(Schema.Array(paginatedKind.item)),\n );\n\n const provenance = { _tag: \"Confect\" as const, kind: paginatedKind };\n const self = provenance as ConfectPaginated<UserArgsFields_, Item, Error>;\n\n Lazy.defineProperty(provenance, \"args\", () => {\n const fields = paginatedKind.userArgs.fields;\n if (\"paginationOpts\" in fields) {\n throw new globalThis.Error(\n \"A paginated query's args schema must not declare `paginationOpts`—\" +\n \"it is added automatically from the `PaginationOptions` schema\",\n );\n }\n return Schema.Struct({\n ...fields,\n paginationOpts: PaginationOptions.PaginationOptions,\n });\n });\n Lazy.defineProperty(provenance, \"returns\", () =>\n PaginationResult.PaginationResult(paginatedKind.item),\n );\n if (error !== undefined) {\n Lazy.defineProperty(provenance, \"error\", error);\n }\n\n return self;\n};\n\nexport const Convex = <Args extends DefaultFunctionArgs, Returns>() =>\n FunctionProvenance.Convex(\n {} as {\n \"~args\": Args;\n \"~returns\": Returns;\n },\n );\n"],"mappings":";;;;;;;;;;;;;AA6GA,MAAa,qBAAqB,KAAK,WAA+B;AAEtE,MAAM,WAAqB,EAAE,MAAM,WAAW;;;;;;;;;;;;;;;;;;AAmB9C,MAAa,WAKX,MACA,SACA,UACmD;CACnD,MAAM,aAAa;EAAE,MAAM;EAAoB,MAAM;CAAS;CAE9D,eAAoB,YAAY,cAAc,OAAO,OAAO,KAAK,CAAC,CAAC;CACnE,eAAoB,YAAY,WAAW,OAAO;CAClD,IAAI,UAAU,KAAA,GACZ,eAAoB,YAAY,SAAS,KAAK;CAGhD,OAAO;AACT;;;;;;;;;;;AAqDA,MAAa,oBAKX,UACA,MACA,UACmD;CACnD,MAAM,OAAO,EAAE,MAAM,YAAqB;CAC1C,MAAM,gBAAgB;CAEtB,eAAoB,MAAM,kBAAkB,OAAO,OAAO,SAAS,CAAC,CAAC;CACrE,eAAoB,MAAM,QAAQ,IAAI;CACtC,eAAoB,MAAM,cACxB,OAAO,QAAQ,OAAO,MAAM,cAAc,IAAI,CAAC,CACjD;CAEA,MAAM,aAAa;EAAE,MAAM;EAAoB,MAAM;CAAc;CACnE,MAAM,OAAO;CAEb,eAAoB,YAAY,cAAc;EAC5C,MAAM,SAAS,cAAc,SAAS;EACtC,IAAI,oBAAoB,QACtB,MAAM,IAAI,WAAW,MACnB,iIAEF;EAEF,OAAO,OAAO,OAAO;GACnB,GAAG;GACH,gBAAgBA;EAClB,CAAC;CACH,CAAC;CACD,eAAoB,YAAY,iBAC9BC,iBAAkC,cAAc,IAAI,CACtD;CACA,IAAI,UAAU,KAAA,GACZ,eAAoB,YAAY,SAAS,KAAK;CAGhD,OAAO;AACT;AAEA,MAAa,eACX,mBAAmB,OACjB,CAAC,CAIH"}
|
|
1
|
+
{"version":3,"file":"FunctionProvenance.js","names":["PaginationOptions.PaginationOptions","PaginationResult.PaginationResult"],"sources":["../src/FunctionProvenance.ts"],"sourcesContent":["import type { DefaultFunctionArgs } from \"convex/server\";\nimport * as Data from \"effect/Data\";\nimport * as Schema from \"effect/Schema\";\nimport * as Lazy from \"./Lazy.js\";\nimport * as PaginationOptions from \"./PaginationOptions.js\";\nimport * as PaginationResult from \"./PaginationResult.js\";\n\n/**\n * A field map accepted as Confect function args. Restricting each field to a\n * context-free codec means the struct assembled from the fields can always be\n * encoded and decoded synchronously at a Convex boundary.\n */\nexport type ArgsFields = {\n readonly [key: PropertyKey]: Schema.ConstraintCodec<any, any>;\n};\n\n/**\n * A struct-shaped Confect args schema that keeps its exact field map while\n * erasing the rest of `Schema.Struct`'s large implementation type. Decoded and\n * encoded args are derived directly from `ArgsFields_`; keeping the runtime\n * codec structural prevents every ref lookup from expanding the full Effect\n * schema type.\n */\nexport interface ArgsSchema<\n ArgsFields_ extends ArgsFields,\n> extends Schema.Codec<any, any> {\n readonly fields: ArgsFields_;\n}\n\n/**\n * Erased structural view used after the exact field map is no longer needed.\n */\nexport type AnyArgsSchema = ArgsSchema<ArgsFields>;\n\nexport type FunctionProvenance = Data.TaggedEnum<{\n Confect: {\n args: AnyArgsSchema;\n returns: Schema.Codec<any, any>;\n error?: Schema.Codec<any, any>;\n kind: ConfectKind;\n };\n Convex: {\n \"~args\": DefaultFunctionArgs;\n \"~returns\": any;\n };\n}>;\n\n/**\n * The declaration shape of a Confect function—orthogonal to both the provenance\n * origin (Confect vs Convex) and the function type (query/mutation/action). A\n * `Standard` function declares its args fields and returns schema directly; a\n * `Paginated` function declares user-args fields and an item schema from which\n * the Convex-facing `args`/`returns` are composed.\n */\nexport type ConfectKind = Standard | Paginated;\n\nexport interface Standard {\n readonly _tag: \"Standard\";\n}\n\nexport interface Paginated<\n UserArgsFields_ extends ArgsFields = ArgsFields,\n Item extends Schema.Codec<any, any> = Schema.Codec<any, any>,\n> {\n readonly _tag: \"Paginated\";\n /**\n * User-declared args—no `paginationOpts`.\n */\n readonly userArgs: ArgsSchema<UserArgsFields_>;\n /**\n * Page element schema.\n */\n readonly item: Item;\n /**\n * Mutable array of items—the page decode target.\n */\n readonly page: Schema.Codec<any, any>;\n}\n\nexport interface Confect<\n ArgsFields_ extends ArgsFields,\n Returns extends Schema.Codec<any, any>,\n Error extends Schema.Codec<any, any> = never,\n Kind extends ConfectKind = ConfectKind,\n> {\n readonly _tag: \"Confect\";\n readonly \"~ArgsFields\": ArgsFields_;\n readonly args: ArgsSchema<ArgsFields_>;\n readonly returns: Returns;\n readonly error?: Error;\n readonly kind: Kind;\n}\n\nexport interface AnyConfect {\n readonly _tag: \"Confect\";\n readonly args: AnyArgsSchema;\n readonly returns: Schema.Codec<any, any>;\n readonly error?: Schema.Codec<any, any>;\n readonly kind: ConfectKind;\n}\n\nexport interface Convex<Args extends DefaultFunctionArgs, Returns> {\n readonly _tag: \"Convex\";\n readonly \"~args\": Args;\n readonly \"~returns\": Returns;\n}\n\nexport interface AnyConvex extends Convex<DefaultFunctionArgs, any> {}\n\nexport const FunctionProvenance = Data.taggedEnum<FunctionProvenance>();\n\nconst Standard: Standard = { _tag: \"Standard\" };\n\n/**\n * Build a `Confect` provenance from lazy args-fields and schema thunks. `args`,\n * `returns`, and `error` are exposed as sync lazy memoised getters (via\n * {@link Lazy.defineProperty}) that only evaluate their thunk on first access,\n * mirroring how `Table` defers `Fields`/`Doc`. This keeps importing the\n * assembled `_generated/spec.ts` cheap—no\n * `Schema.Struct(...)`/`Schema.Array(...)` work runs at module load; it is\n * deferred to the first invocation that actually compiles validators or runs a\n * codec.\n *\n * The object is built by hand rather than through `FunctionProvenance.Confect`\n * because the `Data` constructor copies its input with `Object.assign`, which\n * would force the getters at construction time and defeat the laziness. `error`\n * is only installed when an `errorThunk` is provided, so its absence is\n * observable via `\"error\" in provenance` without forcing anything; nothing\n * relies on `Data`'s structural `Equal`/`Hash` for provenance values.\n */\nexport const Confect = <\n const ArgsFields_ extends ArgsFields,\n Returns extends Schema.Codec<any, any>,\n Error extends Schema.Codec<any, any> = never,\n>(\n args: () => ArgsFields_,\n returns: () => Returns,\n error?: () => Error,\n): Confect<ArgsFields_, Returns, Error, Standard> => {\n const provenance = { _tag: \"Confect\" as const, kind: Standard };\n\n Lazy.defineProperty(provenance, \"args\", () => Schema.Struct(args()));\n Lazy.defineProperty(provenance, \"returns\", returns);\n if (error !== undefined) {\n Lazy.defineProperty(provenance, \"error\", error);\n }\n\n return provenance as Confect<ArgsFields_, Returns, Error, Standard>;\n};\n\n/**\n * The composed args schema of a paginated query: the user-declared fields plus\n * the `paginationOpts` field managed by Convex's pagination protocol.\n *\n * The fields-first representation keeps the user-declared map available for\n * type-level composition without reconstructing it from an erased schema.\n */\nexport type PaginatedArgsFields<UserArgsFields extends ArgsFields> =\n UserArgsFields & {\n readonly paginationOpts: typeof PaginationOptions.PaginationOptions;\n };\n\nexport type PaginatedArgs<UserArgsFields extends ArgsFields> = Schema.Struct<\n PaginatedArgsFields<UserArgsFields>\n>;\n\n/**\n * The composed returns schema of a paginated query: a `PaginationResult` of the\n * item schema. Same deferred-conditional device as {@link PaginatedArgs}.\n */\nexport type PaginatedReturns<Item extends Schema.Codec<any, any>> =\n PaginationResult.PaginationResult<Item> extends infer ComposedReturns extends\n Schema.Codec<any, any>\n ? ComposedReturns\n : never;\n\nexport interface ConfectPaginated<\n UserArgsFields extends ArgsFields,\n Item extends Schema.Codec<any, any>,\n Error extends Schema.Codec<any, any> = never,\n> extends Confect<\n PaginatedArgsFields<UserArgsFields>,\n PaginatedReturns<Item>,\n Error,\n Paginated<UserArgsFields, Item>\n> {}\n\nexport interface AnyConfectPaginated extends AnyConfect {\n readonly kind: Paginated;\n}\n\n/**\n * Build the provenance of a paginated query from lazy schema thunks, with the\n * same laziness contract as {@link Confect}. The user-facing schemas live on the\n * `Paginated` kind (`kind.userArgs`, `kind.item`, `kind.page`)—the kind\n * container is built eagerly (it is cheap) while the schemas inside it stay\n * lazy. The composed Convex-facing `args`/`returns` are derived lazily from\n * them: `args` spreads the user fields plus `paginationOpts`, and `returns`\n * wraps the item in `PaginationResult`. Composition living here means the\n * composed schemas can never drift from the stored user schemas.\n */\nexport const ConfectPaginated = <\n const UserArgsFields_ extends ArgsFields,\n Item extends Schema.Codec<any, any>,\n Error extends Schema.Codec<any, any> = never,\n>(\n userArgs: () => UserArgsFields_,\n item: () => Item,\n error?: () => Error,\n): ConfectPaginated<UserArgsFields_, Item, Error> => {\n const kind = { _tag: \"Paginated\" as const };\n const paginatedKind = kind as Paginated<UserArgsFields_, Item>;\n\n Lazy.defineProperty(kind, \"userArgs\", () => Schema.Struct(userArgs()));\n Lazy.defineProperty(kind, \"item\", item);\n Lazy.defineProperty(kind, \"page\", () =>\n Schema.mutable(Schema.Array(paginatedKind.item)),\n );\n\n const provenance = { _tag: \"Confect\" as const, kind: paginatedKind };\n const self = provenance as ConfectPaginated<UserArgsFields_, Item, Error>;\n\n Lazy.defineProperty(provenance, \"args\", () => {\n const fields = paginatedKind.userArgs.fields;\n if (\"paginationOpts\" in fields) {\n throw new globalThis.Error(\n \"A paginated query's args schema must not declare `paginationOpts`—\" +\n \"it is added automatically from the `PaginationOptions` schema\",\n );\n }\n return Schema.Struct({\n ...fields,\n paginationOpts: PaginationOptions.PaginationOptions,\n });\n });\n Lazy.defineProperty(provenance, \"returns\", () =>\n PaginationResult.PaginationResult(paginatedKind.item),\n );\n if (error !== undefined) {\n Lazy.defineProperty(provenance, \"error\", error);\n }\n\n return self;\n};\n\nexport const Convex = <Args extends DefaultFunctionArgs, Returns>() =>\n FunctionProvenance.Convex(\n {} as {\n \"~args\": Args;\n \"~returns\": Returns;\n },\n );\n"],"mappings":";;;;;;;;;;;;;AA6GA,MAAa,qBAAqB,KAAK,WAA+B;AAEtE,MAAM,WAAqB,EAAE,MAAM,WAAW;;;;;;;;;;;;;;;;;;AAmB9C,MAAa,WAKX,MACA,SACA,UACmD;CACnD,MAAM,aAAa;EAAE,MAAM;EAAoB,MAAM;CAAS;CAE9D,eAAoB,YAAY,cAAc,OAAO,OAAO,KAAK,CAAC,CAAC;CACnE,eAAoB,YAAY,WAAW,OAAO;CAClD,IAAI,UAAU,KAAA,GACZ,eAAoB,YAAY,SAAS,KAAK;CAGhD,OAAO;AACT;;;;;;;;;;;AAqDA,MAAa,oBAKX,UACA,MACA,UACmD;CACnD,MAAM,OAAO,EAAE,MAAM,YAAqB;CAC1C,MAAM,gBAAgB;CAEtB,eAAoB,MAAM,kBAAkB,OAAO,OAAO,SAAS,CAAC,CAAC;CACrE,eAAoB,MAAM,QAAQ,IAAI;CACtC,eAAoB,MAAM,cACxB,OAAO,QAAQ,OAAO,MAAM,cAAc,IAAI,CAAC,CACjD;CAEA,MAAM,aAAa;EAAE,MAAM;EAAoB,MAAM;CAAc;CACnE,MAAM,OAAO;CAEb,eAAoB,YAAY,cAAc;EAC5C,MAAM,SAAS,cAAc,SAAS;EACtC,IAAI,oBAAoB,QACtB,MAAM,IAAI,WAAW,MACnB,iIAEF;EAEF,OAAO,OAAO,OAAO;GACnB,GAAG;GACH,gBAAgBA;EAClB,CAAC;CACH,CAAC;CACD,eAAoB,YAAY,iBAC9BC,iBAAkC,cAAc,IAAI,CACtD;CACA,IAAI,UAAU,KAAA,GACZ,eAAoB,YAAY,SAAS,KAAK;CAGhD,OAAO;AACT;AAEA,MAAa,eACX,mBAAmB,OACjB,CAAC,CAIH"}
|
package/dist/FunctionSpec.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type * as MiddlewareAttachment from "./MiddlewareAttachment";
|
|
1
|
+
import type * as MiddlewareAttachment from "./MiddlewareAttachment.js";
|
|
2
2
|
import type { DefaultFunctionArgs, FunctionType, FunctionVisibility, RegisteredAction, RegisteredMutation, RegisteredQuery } from "convex/server";
|
|
3
|
-
import
|
|
4
|
-
import * as FunctionProvenance from "./FunctionProvenance";
|
|
5
|
-
import
|
|
6
|
-
import * as
|
|
3
|
+
import * as Schema from "effect/Schema";
|
|
4
|
+
import * as FunctionProvenance from "./FunctionProvenance.js";
|
|
5
|
+
import * as MiddlewareSpec from "./MiddlewareSpec.js";
|
|
6
|
+
import type * as Profile from "./Profile.js";
|
|
7
|
+
import * as RuntimeAndFunctionType from "./RuntimeAndFunctionType.js";
|
|
7
8
|
export declare const TypeId = "~@confect/core/FunctionSpec";
|
|
8
9
|
export type TypeId = typeof TypeId;
|
|
9
10
|
export declare const isFunctionSpec: (u: unknown) => u is AnyWithProps;
|
|
@@ -19,10 +20,24 @@ export interface FunctionSpec<RuntimeAndFunctionType_ extends RuntimeAndFunction
|
|
|
19
20
|
export interface Builder<RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType, FunctionVisibility_ extends FunctionVisibility, Name_ extends string, FunctionProvenance_ extends FunctionProvenance.FunctionProvenance, MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec = never> extends FunctionSpec<RuntimeAndFunctionType_, FunctionVisibility_, Name_, FunctionProvenance_, MiddlewareSpecs_> {
|
|
20
21
|
middleware<MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec>(middlewareSpec: MiddlewareSpec_ & MiddlewareSpec.ValidateFunctionAttach<MiddlewareSpec_, RuntimeAndFunctionType_, FunctionProvenance_, MiddlewareSpecs_>, ...options: MiddlewareAttachment.Args<NoInfer<MiddlewareSpec_>>): Builder<RuntimeAndFunctionType_, FunctionVisibility_, Name_, FunctionProvenance_, MiddlewareSpecs_ | MiddlewareSpec_>;
|
|
21
22
|
}
|
|
23
|
+
export interface DescribedBuilder<RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType, FunctionVisibility_ extends FunctionVisibility, Name_ extends string, FunctionProvenance_ extends FunctionProvenance.FunctionProvenance, MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec = never> extends Builder<RuntimeAndFunctionType_, FunctionVisibility_, Name_, FunctionProvenance_, MiddlewareSpecs_> {
|
|
24
|
+
readonly description?: string;
|
|
25
|
+
middleware<MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec>(middlewareSpec: MiddlewareSpec_ & MiddlewareSpec.ValidateFunctionAttach<MiddlewareSpec_, RuntimeAndFunctionType_, FunctionProvenance_, MiddlewareSpecs_>, ...options: MiddlewareAttachment.Args<NoInfer<MiddlewareSpec_>>): DescribedBuilder<RuntimeAndFunctionType_, FunctionVisibility_, Name_, FunctionProvenance_, MiddlewareSpecs_ | MiddlewareSpec_>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A spec built through {@link extend}, keeping its fields through middleware.
|
|
29
|
+
*/
|
|
30
|
+
export interface ExtendedBuilder<RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType, FunctionVisibility_ extends FunctionVisibility, Name_ extends string, FunctionProvenance_ extends FunctionProvenance.FunctionProvenance, MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec, Fields_> extends Builder<RuntimeAndFunctionType_, FunctionVisibility_, Name_, FunctionProvenance_, MiddlewareSpecs_> {
|
|
31
|
+
readonly description?: string;
|
|
32
|
+
readonly fields: Profile.Info<Fields_>["fields"];
|
|
33
|
+
middleware<MiddlewareSpec_ extends MiddlewareSpec.AnyMiddlewareSpec>(middlewareSpec: MiddlewareSpec_ & MiddlewareSpec.ValidateFunctionAttach<MiddlewareSpec_, RuntimeAndFunctionType_, FunctionProvenance_, MiddlewareSpecs_>, ...options: MiddlewareAttachment.Args<NoInfer<MiddlewareSpec_>>): ExtendedBuilder<RuntimeAndFunctionType_, FunctionVisibility_, Name_, FunctionProvenance_, MiddlewareSpecs_ | MiddlewareSpec_, Fields_>;
|
|
34
|
+
}
|
|
22
35
|
export interface Any {
|
|
23
36
|
readonly [TypeId]: TypeId;
|
|
24
37
|
}
|
|
25
38
|
export interface AnyWithProps extends FunctionSpec<RuntimeAndFunctionType.RuntimeAndFunctionType, FunctionVisibility, string, FunctionProvenance.FunctionProvenance, MiddlewareSpec.AnyMiddlewareSpec> {
|
|
39
|
+
readonly description?: string;
|
|
40
|
+
readonly fields?: object;
|
|
26
41
|
}
|
|
27
42
|
export interface AnyConfect extends FunctionSpec<RuntimeAndFunctionType.RuntimeAndFunctionType, FunctionVisibility, string, FunctionProvenance.AnyConfect, MiddlewareSpec.AnyMiddlewareSpec> {
|
|
28
43
|
}
|
|
@@ -129,6 +144,7 @@ type ForbidPaginationOpts<UserArgsFields extends FunctionProvenance.ArgsFields>
|
|
|
129
144
|
export declare const publicQuery: {
|
|
130
145
|
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
131
146
|
name: Name_;
|
|
147
|
+
description?: never;
|
|
132
148
|
args: () => ArgsFields_;
|
|
133
149
|
returns: () => Returns_;
|
|
134
150
|
error?: () => Error_;
|
|
@@ -138,6 +154,7 @@ export declare const publicQuery: {
|
|
|
138
154
|
}, "public", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
139
155
|
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
140
156
|
name: Name_;
|
|
157
|
+
description?: never;
|
|
141
158
|
args?: never;
|
|
142
159
|
returns: () => Returns_;
|
|
143
160
|
error?: () => Error_;
|
|
@@ -145,10 +162,31 @@ export declare const publicQuery: {
|
|
|
145
162
|
readonly runtime: "Convex";
|
|
146
163
|
readonly functionType: "query";
|
|
147
164
|
}, "public", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
165
|
+
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
166
|
+
name: Name_;
|
|
167
|
+
description?: string;
|
|
168
|
+
args: () => ArgsFields_;
|
|
169
|
+
returns: () => Returns_;
|
|
170
|
+
error?: () => Error_;
|
|
171
|
+
}): DescribedBuilder<{
|
|
172
|
+
readonly runtime: "Convex";
|
|
173
|
+
readonly functionType: "query";
|
|
174
|
+
}, "public", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
175
|
+
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
176
|
+
name: Name_;
|
|
177
|
+
description?: string;
|
|
178
|
+
args?: never;
|
|
179
|
+
returns: () => Returns_;
|
|
180
|
+
error?: () => Error_;
|
|
181
|
+
}): DescribedBuilder<{
|
|
182
|
+
readonly runtime: "Convex";
|
|
183
|
+
readonly functionType: "query";
|
|
184
|
+
}, "public", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
148
185
|
};
|
|
149
186
|
export declare const internalQuery: {
|
|
150
187
|
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
151
188
|
name: Name_;
|
|
189
|
+
description?: never;
|
|
152
190
|
args: () => ArgsFields_;
|
|
153
191
|
returns: () => Returns_;
|
|
154
192
|
error?: () => Error_;
|
|
@@ -158,6 +196,7 @@ export declare const internalQuery: {
|
|
|
158
196
|
}, "internal", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
159
197
|
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
160
198
|
name: Name_;
|
|
199
|
+
description?: never;
|
|
161
200
|
args?: never;
|
|
162
201
|
returns: () => Returns_;
|
|
163
202
|
error?: () => Error_;
|
|
@@ -165,10 +204,31 @@ export declare const internalQuery: {
|
|
|
165
204
|
readonly runtime: "Convex";
|
|
166
205
|
readonly functionType: "query";
|
|
167
206
|
}, "internal", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
207
|
+
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
208
|
+
name: Name_;
|
|
209
|
+
description?: never;
|
|
210
|
+
args: () => ArgsFields_;
|
|
211
|
+
returns: () => Returns_;
|
|
212
|
+
error?: () => Error_;
|
|
213
|
+
}): DescribedBuilder<{
|
|
214
|
+
readonly runtime: "Convex";
|
|
215
|
+
readonly functionType: "query";
|
|
216
|
+
}, "internal", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
217
|
+
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
218
|
+
name: Name_;
|
|
219
|
+
description?: never;
|
|
220
|
+
args?: never;
|
|
221
|
+
returns: () => Returns_;
|
|
222
|
+
error?: () => Error_;
|
|
223
|
+
}): DescribedBuilder<{
|
|
224
|
+
readonly runtime: "Convex";
|
|
225
|
+
readonly functionType: "query";
|
|
226
|
+
}, "internal", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
168
227
|
};
|
|
169
228
|
export declare const publicPaginatedQuery: {
|
|
170
229
|
<const Name_ extends string, const UserArgsFields_ extends FunctionProvenance.ArgsFields, Item_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
171
230
|
name: Name_;
|
|
231
|
+
description?: never;
|
|
172
232
|
args: () => UserArgsFields_ & ForbidPaginationOpts<UserArgsFields_>;
|
|
173
233
|
item: () => Item_;
|
|
174
234
|
error?: () => Error_;
|
|
@@ -178,6 +238,7 @@ export declare const publicPaginatedQuery: {
|
|
|
178
238
|
}, "public", Name_, FunctionProvenance.ConfectPaginated<UserArgsFields_, Item_, Error_>, never>;
|
|
179
239
|
<const Name_ extends string, Item_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
180
240
|
name: Name_;
|
|
241
|
+
description?: never;
|
|
181
242
|
args?: never;
|
|
182
243
|
item: () => Item_;
|
|
183
244
|
error?: () => Error_;
|
|
@@ -185,10 +246,31 @@ export declare const publicPaginatedQuery: {
|
|
|
185
246
|
readonly runtime: "Convex";
|
|
186
247
|
readonly functionType: "query";
|
|
187
248
|
}, "public", Name_, FunctionProvenance.ConfectPaginated<{}, Item_, Error_>, never>;
|
|
249
|
+
<const Name_ extends string, const UserArgsFields_ extends FunctionProvenance.ArgsFields, Item_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
250
|
+
name: Name_;
|
|
251
|
+
description?: string;
|
|
252
|
+
args: () => UserArgsFields_ & ForbidPaginationOpts<UserArgsFields_>;
|
|
253
|
+
item: () => Item_;
|
|
254
|
+
error?: () => Error_;
|
|
255
|
+
}): DescribedBuilder<{
|
|
256
|
+
readonly runtime: "Convex";
|
|
257
|
+
readonly functionType: "query";
|
|
258
|
+
}, "public", Name_, FunctionProvenance.ConfectPaginated<UserArgsFields_, Item_, Error_>, never>;
|
|
259
|
+
<const Name_ extends string, Item_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
260
|
+
name: Name_;
|
|
261
|
+
description?: string;
|
|
262
|
+
args?: never;
|
|
263
|
+
item: () => Item_;
|
|
264
|
+
error?: () => Error_;
|
|
265
|
+
}): DescribedBuilder<{
|
|
266
|
+
readonly runtime: "Convex";
|
|
267
|
+
readonly functionType: "query";
|
|
268
|
+
}, "public", Name_, FunctionProvenance.ConfectPaginated<{}, Item_, Error_>, never>;
|
|
188
269
|
};
|
|
189
270
|
export declare const internalPaginatedQuery: {
|
|
190
271
|
<const Name_ extends string, const UserArgsFields_ extends FunctionProvenance.ArgsFields, Item_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
191
272
|
name: Name_;
|
|
273
|
+
description?: never;
|
|
192
274
|
args: () => UserArgsFields_ & ForbidPaginationOpts<UserArgsFields_>;
|
|
193
275
|
item: () => Item_;
|
|
194
276
|
error?: () => Error_;
|
|
@@ -198,6 +280,7 @@ export declare const internalPaginatedQuery: {
|
|
|
198
280
|
}, "internal", Name_, FunctionProvenance.ConfectPaginated<UserArgsFields_, Item_, Error_>, never>;
|
|
199
281
|
<const Name_ extends string, Item_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
200
282
|
name: Name_;
|
|
283
|
+
description?: never;
|
|
201
284
|
args?: never;
|
|
202
285
|
item: () => Item_;
|
|
203
286
|
error?: () => Error_;
|
|
@@ -205,10 +288,31 @@ export declare const internalPaginatedQuery: {
|
|
|
205
288
|
readonly runtime: "Convex";
|
|
206
289
|
readonly functionType: "query";
|
|
207
290
|
}, "internal", Name_, FunctionProvenance.ConfectPaginated<{}, Item_, Error_>, never>;
|
|
291
|
+
<const Name_ extends string, const UserArgsFields_ extends FunctionProvenance.ArgsFields, Item_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
292
|
+
name: Name_;
|
|
293
|
+
description?: never;
|
|
294
|
+
args: () => UserArgsFields_ & ForbidPaginationOpts<UserArgsFields_>;
|
|
295
|
+
item: () => Item_;
|
|
296
|
+
error?: () => Error_;
|
|
297
|
+
}): DescribedBuilder<{
|
|
298
|
+
readonly runtime: "Convex";
|
|
299
|
+
readonly functionType: "query";
|
|
300
|
+
}, "internal", Name_, FunctionProvenance.ConfectPaginated<UserArgsFields_, Item_, Error_>, never>;
|
|
301
|
+
<const Name_ extends string, Item_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
302
|
+
name: Name_;
|
|
303
|
+
description?: never;
|
|
304
|
+
args?: never;
|
|
305
|
+
item: () => Item_;
|
|
306
|
+
error?: () => Error_;
|
|
307
|
+
}): DescribedBuilder<{
|
|
308
|
+
readonly runtime: "Convex";
|
|
309
|
+
readonly functionType: "query";
|
|
310
|
+
}, "internal", Name_, FunctionProvenance.ConfectPaginated<{}, Item_, Error_>, never>;
|
|
208
311
|
};
|
|
209
312
|
export declare const publicMutation: {
|
|
210
313
|
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
211
314
|
name: Name_;
|
|
315
|
+
description?: never;
|
|
212
316
|
args: () => ArgsFields_;
|
|
213
317
|
returns: () => Returns_;
|
|
214
318
|
error?: () => Error_;
|
|
@@ -218,6 +322,7 @@ export declare const publicMutation: {
|
|
|
218
322
|
}, "public", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
219
323
|
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
220
324
|
name: Name_;
|
|
325
|
+
description?: never;
|
|
221
326
|
args?: never;
|
|
222
327
|
returns: () => Returns_;
|
|
223
328
|
error?: () => Error_;
|
|
@@ -225,10 +330,31 @@ export declare const publicMutation: {
|
|
|
225
330
|
readonly runtime: "Convex";
|
|
226
331
|
readonly functionType: "mutation";
|
|
227
332
|
}, "public", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
333
|
+
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
334
|
+
name: Name_;
|
|
335
|
+
description?: string;
|
|
336
|
+
args: () => ArgsFields_;
|
|
337
|
+
returns: () => Returns_;
|
|
338
|
+
error?: () => Error_;
|
|
339
|
+
}): DescribedBuilder<{
|
|
340
|
+
readonly runtime: "Convex";
|
|
341
|
+
readonly functionType: "mutation";
|
|
342
|
+
}, "public", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
343
|
+
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
344
|
+
name: Name_;
|
|
345
|
+
description?: string;
|
|
346
|
+
args?: never;
|
|
347
|
+
returns: () => Returns_;
|
|
348
|
+
error?: () => Error_;
|
|
349
|
+
}): DescribedBuilder<{
|
|
350
|
+
readonly runtime: "Convex";
|
|
351
|
+
readonly functionType: "mutation";
|
|
352
|
+
}, "public", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
228
353
|
};
|
|
229
354
|
export declare const internalMutation: {
|
|
230
355
|
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
231
356
|
name: Name_;
|
|
357
|
+
description?: never;
|
|
232
358
|
args: () => ArgsFields_;
|
|
233
359
|
returns: () => Returns_;
|
|
234
360
|
error?: () => Error_;
|
|
@@ -238,6 +364,7 @@ export declare const internalMutation: {
|
|
|
238
364
|
}, "internal", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
239
365
|
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
240
366
|
name: Name_;
|
|
367
|
+
description?: never;
|
|
241
368
|
args?: never;
|
|
242
369
|
returns: () => Returns_;
|
|
243
370
|
error?: () => Error_;
|
|
@@ -245,10 +372,31 @@ export declare const internalMutation: {
|
|
|
245
372
|
readonly runtime: "Convex";
|
|
246
373
|
readonly functionType: "mutation";
|
|
247
374
|
}, "internal", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
375
|
+
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
376
|
+
name: Name_;
|
|
377
|
+
description?: never;
|
|
378
|
+
args: () => ArgsFields_;
|
|
379
|
+
returns: () => Returns_;
|
|
380
|
+
error?: () => Error_;
|
|
381
|
+
}): DescribedBuilder<{
|
|
382
|
+
readonly runtime: "Convex";
|
|
383
|
+
readonly functionType: "mutation";
|
|
384
|
+
}, "internal", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
385
|
+
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
386
|
+
name: Name_;
|
|
387
|
+
description?: never;
|
|
388
|
+
args?: never;
|
|
389
|
+
returns: () => Returns_;
|
|
390
|
+
error?: () => Error_;
|
|
391
|
+
}): DescribedBuilder<{
|
|
392
|
+
readonly runtime: "Convex";
|
|
393
|
+
readonly functionType: "mutation";
|
|
394
|
+
}, "internal", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
248
395
|
};
|
|
249
396
|
export declare const publicAction: {
|
|
250
397
|
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
251
398
|
name: Name_;
|
|
399
|
+
description?: never;
|
|
252
400
|
args: () => ArgsFields_;
|
|
253
401
|
returns: () => Returns_;
|
|
254
402
|
error?: () => Error_;
|
|
@@ -258,6 +406,7 @@ export declare const publicAction: {
|
|
|
258
406
|
}, "public", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
259
407
|
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
260
408
|
name: Name_;
|
|
409
|
+
description?: never;
|
|
261
410
|
args?: never;
|
|
262
411
|
returns: () => Returns_;
|
|
263
412
|
error?: () => Error_;
|
|
@@ -265,10 +414,31 @@ export declare const publicAction: {
|
|
|
265
414
|
readonly runtime: "Convex";
|
|
266
415
|
readonly functionType: "action";
|
|
267
416
|
}, "public", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
417
|
+
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
418
|
+
name: Name_;
|
|
419
|
+
description?: string;
|
|
420
|
+
args: () => ArgsFields_;
|
|
421
|
+
returns: () => Returns_;
|
|
422
|
+
error?: () => Error_;
|
|
423
|
+
}): DescribedBuilder<{
|
|
424
|
+
readonly runtime: "Convex";
|
|
425
|
+
readonly functionType: "action";
|
|
426
|
+
}, "public", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
427
|
+
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
428
|
+
name: Name_;
|
|
429
|
+
description?: string;
|
|
430
|
+
args?: never;
|
|
431
|
+
returns: () => Returns_;
|
|
432
|
+
error?: () => Error_;
|
|
433
|
+
}): DescribedBuilder<{
|
|
434
|
+
readonly runtime: "Convex";
|
|
435
|
+
readonly functionType: "action";
|
|
436
|
+
}, "public", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
268
437
|
};
|
|
269
438
|
export declare const internalAction: {
|
|
270
439
|
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
271
440
|
name: Name_;
|
|
441
|
+
description?: never;
|
|
272
442
|
args: () => ArgsFields_;
|
|
273
443
|
returns: () => Returns_;
|
|
274
444
|
error?: () => Error_;
|
|
@@ -278,6 +448,7 @@ export declare const internalAction: {
|
|
|
278
448
|
}, "internal", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
279
449
|
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
280
450
|
name: Name_;
|
|
451
|
+
description?: never;
|
|
281
452
|
args?: never;
|
|
282
453
|
returns: () => Returns_;
|
|
283
454
|
error?: () => Error_;
|
|
@@ -285,10 +456,31 @@ export declare const internalAction: {
|
|
|
285
456
|
readonly runtime: "Convex";
|
|
286
457
|
readonly functionType: "action";
|
|
287
458
|
}, "internal", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
459
|
+
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
460
|
+
name: Name_;
|
|
461
|
+
description?: never;
|
|
462
|
+
args: () => ArgsFields_;
|
|
463
|
+
returns: () => Returns_;
|
|
464
|
+
error?: () => Error_;
|
|
465
|
+
}): DescribedBuilder<{
|
|
466
|
+
readonly runtime: "Convex";
|
|
467
|
+
readonly functionType: "action";
|
|
468
|
+
}, "internal", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
469
|
+
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
470
|
+
name: Name_;
|
|
471
|
+
description?: never;
|
|
472
|
+
args?: never;
|
|
473
|
+
returns: () => Returns_;
|
|
474
|
+
error?: () => Error_;
|
|
475
|
+
}): DescribedBuilder<{
|
|
476
|
+
readonly runtime: "Convex";
|
|
477
|
+
readonly functionType: "action";
|
|
478
|
+
}, "internal", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
288
479
|
};
|
|
289
480
|
export declare const publicNodeAction: {
|
|
290
481
|
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
291
482
|
name: Name_;
|
|
483
|
+
description?: never;
|
|
292
484
|
args: () => ArgsFields_;
|
|
293
485
|
returns: () => Returns_;
|
|
294
486
|
error?: () => Error_;
|
|
@@ -298,6 +490,7 @@ export declare const publicNodeAction: {
|
|
|
298
490
|
}, "public", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
299
491
|
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
300
492
|
name: Name_;
|
|
493
|
+
description?: never;
|
|
301
494
|
args?: never;
|
|
302
495
|
returns: () => Returns_;
|
|
303
496
|
error?: () => Error_;
|
|
@@ -305,10 +498,31 @@ export declare const publicNodeAction: {
|
|
|
305
498
|
readonly runtime: "Node";
|
|
306
499
|
readonly functionType: "action";
|
|
307
500
|
}, "public", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
501
|
+
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
502
|
+
name: Name_;
|
|
503
|
+
description?: string;
|
|
504
|
+
args: () => ArgsFields_;
|
|
505
|
+
returns: () => Returns_;
|
|
506
|
+
error?: () => Error_;
|
|
507
|
+
}): DescribedBuilder<{
|
|
508
|
+
readonly runtime: "Node";
|
|
509
|
+
readonly functionType: "action";
|
|
510
|
+
}, "public", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
511
|
+
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
512
|
+
name: Name_;
|
|
513
|
+
description?: string;
|
|
514
|
+
args?: never;
|
|
515
|
+
returns: () => Returns_;
|
|
516
|
+
error?: () => Error_;
|
|
517
|
+
}): DescribedBuilder<{
|
|
518
|
+
readonly runtime: "Node";
|
|
519
|
+
readonly functionType: "action";
|
|
520
|
+
}, "public", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
308
521
|
};
|
|
309
522
|
export declare const internalNodeAction: {
|
|
310
523
|
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
311
524
|
name: Name_;
|
|
525
|
+
description?: never;
|
|
312
526
|
args: () => ArgsFields_;
|
|
313
527
|
returns: () => Returns_;
|
|
314
528
|
error?: () => Error_;
|
|
@@ -318,6 +532,7 @@ export declare const internalNodeAction: {
|
|
|
318
532
|
}, "internal", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
319
533
|
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
320
534
|
name: Name_;
|
|
535
|
+
description?: never;
|
|
321
536
|
args?: never;
|
|
322
537
|
returns: () => Returns_;
|
|
323
538
|
error?: () => Error_;
|
|
@@ -325,7 +540,116 @@ export declare const internalNodeAction: {
|
|
|
325
540
|
readonly runtime: "Node";
|
|
326
541
|
readonly functionType: "action";
|
|
327
542
|
}, "internal", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
543
|
+
<const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
544
|
+
name: Name_;
|
|
545
|
+
description?: never;
|
|
546
|
+
args: () => ArgsFields_;
|
|
547
|
+
returns: () => Returns_;
|
|
548
|
+
error?: () => Error_;
|
|
549
|
+
}): DescribedBuilder<{
|
|
550
|
+
readonly runtime: "Node";
|
|
551
|
+
readonly functionType: "action";
|
|
552
|
+
}, "internal", Name_, FunctionProvenance.Confect<ArgsFields_, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
553
|
+
<const Name_ extends string, Returns_ extends Schema.Codec<any, any>, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
554
|
+
name: Name_;
|
|
555
|
+
description?: never;
|
|
556
|
+
args?: never;
|
|
557
|
+
returns: () => Returns_;
|
|
558
|
+
error?: () => Error_;
|
|
559
|
+
}): DescribedBuilder<{
|
|
560
|
+
readonly runtime: "Node";
|
|
561
|
+
readonly functionType: "action";
|
|
562
|
+
}, "internal", Name_, FunctionProvenance.Confect<{}, Returns_, Error_, FunctionProvenance.ConfectKind>, never>;
|
|
563
|
+
};
|
|
564
|
+
type OptionlessMiddlewareSpec = MiddlewareSpec.AnyMiddlewareSpec & {
|
|
565
|
+
readonly "~Options": never;
|
|
566
|
+
};
|
|
567
|
+
type BuilderOption = "name" | "description" | "args" | "returns" | "item" | "error";
|
|
568
|
+
/**
|
|
569
|
+
* Only a required description string may name a builder option. The builder
|
|
570
|
+
* reads it as that option. The conditional keeps the mapped type out of a
|
|
571
|
+
* builder call's inference, which would otherwise widen the function's name to
|
|
572
|
+
* `string` when reporting the error.
|
|
573
|
+
*/
|
|
574
|
+
type OptionFree<Type> = [keyof Type & BuilderOption] extends [never] ? unknown : {
|
|
575
|
+
readonly [Option in keyof Type & BuilderOption as Option extends "description" ? Type[Option] extends string ? string extends Type[Option] ? never : Option : Option : Option]: never;
|
|
328
576
|
};
|
|
577
|
+
/**
|
|
578
|
+
* A function's fields, checked once applied, since a profile's field type can
|
|
579
|
+
* branch on the function's name.
|
|
580
|
+
*/
|
|
581
|
+
type CheckedFields<Type> = Type & OptionFree<Type>;
|
|
582
|
+
type NotRepeated<Middleware_, Inherited extends MiddlewareSpec.AnyMiddlewareSpec> = Middleware_ extends {
|
|
583
|
+
readonly key: infer Key extends MiddlewareSpec.Key<Inherited>;
|
|
584
|
+
} ? MiddlewareSpec.AttachmentError<`Middleware "${Key}" is already attached by this profile`> : Middleware_;
|
|
585
|
+
/**
|
|
586
|
+
* Refuses a middleware without options that an earlier layer attached, as it is
|
|
587
|
+
* attached at most once; one with options may repeat. Each member of an
|
|
588
|
+
* element's union is checked, so an array typed `(A | B)[]` is refused when
|
|
589
|
+
* either was attached.
|
|
590
|
+
*/
|
|
591
|
+
type NotInherited<Middleware_ extends ReadonlyArray<unknown>, Inherited extends MiddlewareSpec.AnyMiddlewareSpec> = {
|
|
592
|
+
readonly [Index in keyof Middleware_]: NotRepeated<Middleware_[Index], Inherited>;
|
|
593
|
+
};
|
|
594
|
+
/**
|
|
595
|
+
* A profile's middleware: a spec without options, or an attachment.
|
|
596
|
+
*/
|
|
597
|
+
type ProfileMiddleware<FieldsType> = OptionlessMiddlewareSpec | Profile.Attachment<MiddlewareSpec.AnyMiddlewareSpec, FieldsType>;
|
|
598
|
+
type SpecOf<Middleware_> = Middleware_ extends Profile.Attachment<infer MiddlewareSpec_, any> ? MiddlewareSpec_ : Extract<Middleware_, MiddlewareSpec.AnyMiddlewareSpec>;
|
|
599
|
+
/**
|
|
600
|
+
* `never` when a profile middleware does not declare the function type.
|
|
601
|
+
*/
|
|
602
|
+
type Declared<MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec, FunctionType_ extends FunctionType, Make> = [
|
|
603
|
+
MiddlewareSpecs_ extends unknown ? FunctionType_ extends MiddlewareSpec.FunctionTypes<MiddlewareSpecs_> ? never : MiddlewareSpecs_ : never
|
|
604
|
+
] extends [never] ? Make : never;
|
|
605
|
+
type Wrapped<Layers extends ReadonlyArray<Profile.Transforms>, Key extends keyof Profile.Transforms, Input> = Layers extends readonly [
|
|
606
|
+
infer First extends Profile.Transforms,
|
|
607
|
+
...infer Rest extends ReadonlyArray<Profile.Transforms>
|
|
608
|
+
] ? Wrapped<Rest, Key, Key extends keyof First ? [Input] extends [never] ? Key extends "error" ? Profile.Transform<First[Key], typeof Schema.Never> : never : Profile.Transform<First[Key], Input> : Input> : Input;
|
|
609
|
+
type UserArgs<A> = [A] extends [never] ? {} : A;
|
|
610
|
+
type ExtendedMake<RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType, Fields_ extends Profile.Fields, MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec, Layers extends ReadonlyArray<Profile.Transforms>> = Declared<MiddlewareSpecs_, RuntimeAndFunctionType_["functionType"], <const Name_ extends string, const ArgsFields_ extends FunctionProvenance.ArgsFields = never, Returns_ extends Schema.Codec<any, any> = never, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
611
|
+
readonly name: Name_;
|
|
612
|
+
readonly description?: string;
|
|
613
|
+
readonly args?: () => ArgsFields_;
|
|
614
|
+
readonly returns: () => Returns_;
|
|
615
|
+
readonly error?: () => Error_;
|
|
616
|
+
} & NoInfer<CheckedFields<Profile.Apply<Fields_, Name_, UserArgs<ArgsFields_>>>>) => ExtendedBuilder<RuntimeAndFunctionType_, "public", Name_, FunctionProvenance.Confect<UserArgs<Wrapped<Layers, "args", ArgsFields_>>, Wrapped<Layers, "returns", Returns_>, Wrapped<Layers, "error", Error_>>, MiddlewareSpecs_, Profile.Apply<Fields_, Name_, UserArgs<ArgsFields_>>>>;
|
|
617
|
+
type ExtendedMakePaginated<Fields_ extends Profile.Fields, MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec, Layers extends ReadonlyArray<Profile.Transforms>> = Declared<MiddlewareSpecs_, "query", <const Name_ extends string, const UserArgsFields_ extends FunctionProvenance.ArgsFields = never, Item_ extends Schema.Codec<any, any> = never, Error_ extends Schema.Codec<any, any> = never>(options: {
|
|
618
|
+
readonly name: Name_;
|
|
619
|
+
readonly description?: string;
|
|
620
|
+
readonly args?: () => UserArgsFields_ & ForbidPaginationOpts<UserArgsFields_>;
|
|
621
|
+
readonly item: () => Item_;
|
|
622
|
+
readonly error?: () => Error_;
|
|
623
|
+
} & NoInfer<CheckedFields<Profile.Apply<Fields_, Name_, UserArgs<UserArgsFields_>>>>) => ExtendedBuilder<RuntimeAndFunctionType.ConvexQuery, "public", Name_, FunctionProvenance.ConfectPaginated<UserArgs<Wrapped<Layers, "args", UserArgsFields_>>, Wrapped<Layers, "item", Item_>, Wrapped<Layers, "error", Error_>>, MiddlewareSpecs_, Profile.Apply<Fields_, Name_, UserArgs<UserArgsFields_>>>>;
|
|
624
|
+
interface ExtendedRuntimes {
|
|
625
|
+
readonly publicQuery: RuntimeAndFunctionType.ConvexQuery;
|
|
626
|
+
readonly publicMutation: RuntimeAndFunctionType.ConvexMutation;
|
|
627
|
+
readonly publicAction: RuntimeAndFunctionType.ConvexAction;
|
|
628
|
+
readonly publicNodeAction: RuntimeAndFunctionType.NodeAction;
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* A profile's five public builders and its own `extend`.
|
|
632
|
+
*/
|
|
633
|
+
export type Extended<Fields_ extends Profile.Fields, MiddlewareSpecs_ extends MiddlewareSpec.AnyMiddlewareSpec, Layers extends ReadonlyArray<Profile.Transforms> = []> = {
|
|
634
|
+
readonly [Builder_ in keyof ExtendedRuntimes]: ExtendedMake<ExtendedRuntimes[Builder_], Fields_, MiddlewareSpecs_, Layers>;
|
|
635
|
+
} & {
|
|
636
|
+
readonly publicPaginatedQuery: ExtendedMakePaginated<Fields_, MiddlewareSpecs_, Layers>;
|
|
637
|
+
/**
|
|
638
|
+
* Require more fields and attach more middleware after this profile's.
|
|
639
|
+
*/
|
|
640
|
+
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: {
|
|
641
|
+
readonly middleware: Middleware_ & NotInherited<Middleware_, MiddlewareSpecs_>;
|
|
642
|
+
} & OptionFree<Extension["Type"]> & Profile.SchemaConfig<Transforms, Profile.Apply<Profile.Both<Fields_, Extension>, string, any>>) => Extended<Profile.Both<Fields_, Extension>, MiddlewareSpecs_ | SpecOf<Middleware_[number]>, [
|
|
643
|
+
...Layers,
|
|
644
|
+
Transforms
|
|
645
|
+
]>;
|
|
646
|
+
};
|
|
647
|
+
/**
|
|
648
|
+
* Public builders whose specs require and keep `Fields_`, with `middleware`.
|
|
649
|
+
*/
|
|
650
|
+
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: {
|
|
651
|
+
readonly middleware: Middleware_;
|
|
652
|
+
} & OptionFree<Fields_["Type"]> & Profile.SchemaConfig<Transforms, Profile.Apply<Fields_, string, any>>) => Extended<Fields_, SpecOf<Middleware_[number]>, [Transforms]>;
|
|
329
653
|
type MatchingRegisteredFunction<RuntimeAndFunctionType_ extends RuntimeAndFunctionType.RuntimeAndFunctionType, FunctionVisibility_ extends FunctionVisibility> = RuntimeAndFunctionType.GetFunctionType<RuntimeAndFunctionType_> extends "query" ? RegisteredQuery<FunctionVisibility_, any, any> : RuntimeAndFunctionType.GetFunctionType<RuntimeAndFunctionType_> extends "mutation" ? RegisteredMutation<FunctionVisibility_, any, any> : RuntimeAndFunctionType.GetFunctionType<RuntimeAndFunctionType_> extends "action" ? RegisteredAction<FunctionVisibility_, any, any> : never;
|
|
330
654
|
type ExtractArgs<F> = F extends RegisteredQuery<any, infer A extends DefaultFunctionArgs, any> ? A : F extends RegisteredMutation<any, infer A extends DefaultFunctionArgs, any> ? A : F extends RegisteredAction<any, infer A extends DefaultFunctionArgs, any> ? A : never;
|
|
331
655
|
type ExtractReturns<F> = F extends RegisteredQuery<any, any, infer R> ? R : F extends RegisteredMutation<any, any, infer R> ? R : F extends RegisteredAction<any, any, infer R> ? R : never;
|