cvx-kit 0.1.20 → 0.1.22

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.
Files changed (80) hide show
  1. package/README.md +40 -2
  2. package/dist/errors.d.mts +3 -2
  3. package/dist/errors.mjs +1 -1
  4. package/dist/errors.mjs.map +1 -1
  5. package/dist/filters.d.mts +4 -0
  6. package/dist/filters.mjs +1 -0
  7. package/dist/index.d.mts +3 -3
  8. package/dist/modules/contracts/errors.d.mts +531 -0
  9. package/dist/modules/contracts/errors.mjs +1 -1
  10. package/dist/modules/contracts/errors.mjs.map +1 -1
  11. package/dist/modules/effect/client.d.mts +1 -0
  12. package/dist/modules/effect/crud.d.mts +28 -0
  13. package/dist/querying/cursors.d.mts +30 -4
  14. package/dist/querying/cursors.mjs +1 -1
  15. package/dist/querying/cursors.mjs.map +1 -1
  16. package/dist/querying/execution.d.mts +14 -3
  17. package/dist/querying/execution.mjs +1 -1
  18. package/dist/querying/execution.mjs.map +1 -1
  19. package/dist/querying/failures.d.mts +13 -0
  20. package/dist/querying/failures.mjs +2 -0
  21. package/dist/querying/failures.mjs.map +1 -0
  22. package/dist/querying/filters.d.mts +39 -45
  23. package/dist/querying/filters.mjs +1 -1
  24. package/dist/querying/filters.mjs.map +1 -1
  25. package/dist/querying/planner.d.mts +11 -5
  26. package/dist/querying/planner.mjs +1 -1
  27. package/dist/querying/planner.mjs.map +1 -1
  28. package/dist/querying/relationships.d.mts +21 -4
  29. package/dist/querying/relationships.mjs +1 -1
  30. package/dist/querying/relationships.mjs.map +1 -1
  31. package/dist/querying/schema-snapshot.mjs +1 -1
  32. package/dist/querying/schema-snapshot.mjs.map +1 -1
  33. package/dist/querying/search.d.mts +69 -0
  34. package/dist/querying/search.mjs +2 -0
  35. package/dist/querying/search.mjs.map +1 -0
  36. package/dist/querying/security.d.mts +19 -2
  37. package/dist/querying/security.mjs +1 -1
  38. package/dist/querying/security.mjs.map +1 -1
  39. package/dist/querying/shared/ast.d.mts +28 -0
  40. package/dist/querying/shared/ast.mjs +2 -0
  41. package/dist/querying/shared/ast.mjs.map +1 -0
  42. package/dist/querying/shared/contract.d.mts +104 -0
  43. package/dist/querying/shared/contract.mjs +2 -0
  44. package/dist/querying/shared/contract.mjs.map +1 -0
  45. package/dist/querying/shared/evaluate.d.mts +7 -0
  46. package/dist/querying/shared/evaluate.mjs +2 -0
  47. package/dist/querying/shared/evaluate.mjs.map +1 -0
  48. package/dist/querying/shared/filters.d.mts +31 -0
  49. package/dist/querying/shared/filters.mjs +2 -0
  50. package/dist/querying/shared/filters.mjs.map +1 -0
  51. package/dist/querying.d.mts +47 -16
  52. package/dist/querying.mjs +1 -1
  53. package/dist/querying.mjs.map +1 -1
  54. package/dist/react/failures.d.mts +26 -0
  55. package/dist/react/failures.mjs +2 -0
  56. package/dist/react/failures.mjs.map +1 -0
  57. package/dist/react/optimistic.d.mts +47 -0
  58. package/dist/react/optimistic.mjs +2 -0
  59. package/dist/react/optimistic.mjs.map +1 -0
  60. package/dist/react/pagination-state.d.mts +40 -0
  61. package/dist/react/pagination-state.mjs +2 -0
  62. package/dist/react/pagination-state.mjs.map +1 -0
  63. package/dist/react/use-command.d.mts +24 -0
  64. package/dist/react/use-command.mjs +2 -0
  65. package/dist/react/use-command.mjs.map +1 -0
  66. package/dist/react/use-paginated-list.d.mts +36 -0
  67. package/dist/react/use-paginated-list.mjs +2 -0
  68. package/dist/react/use-paginated-list.mjs.map +1 -0
  69. package/dist/react.d.mts +6 -0
  70. package/dist/react.mjs +1 -0
  71. package/dist/relations-public.d.mts +2 -2
  72. package/dist/relations.d.mts +62 -7
  73. package/dist/relations.mjs +1 -1
  74. package/dist/relations.mjs.map +1 -1
  75. package/dist/zod-convex.mjs +1 -1
  76. package/dist/zod-convex.mjs.map +1 -1
  77. package/dist/zod-table.d.mts +15 -1
  78. package/dist/zod-table.mjs +1 -1
  79. package/dist/zod-table.mjs.map +1 -1
  80. package/package.json +21 -4
package/README.md CHANGED
@@ -230,7 +230,7 @@ usable equality prefix, then stable index-name order, with creation-time fallbac
230
230
  `order: 'desc'` reverses the chosen native index order. Native continuation,
231
231
  split/end cursors, and page status are preserved, with external tokens protected.
232
232
 
233
- Page sizes are positive integers up to 100; central `maxPageSize` may lower that
233
+ Browse page sizes are positive integers up to 100; central `maxPageSize` may lower that
234
234
  ceiling. Central budgets bound read operations, index ranges, raw candidates,
235
235
  observed/reserved document bytes, fan-out, depth, and memo entries across a
236
236
  request, including policy reads. Native request read limits may lower ceilings.
@@ -242,9 +242,47 @@ many reads. Application/helper accounting does not measure physical platform I/O
242
242
  Kit auth query contexts carry the engine's private read capability. Unknown
243
243
  contexts fail closed unless a centrally configured trusted adapter attests their
244
244
  query reader, effective policy, and security scope. Mutation/action contexts,
245
- search/vector optimization, arbitrary predicates/projections,
245
+ vector search, arbitrary predicates/projections,
246
246
  and custom sorts are outside this API.
247
247
 
248
+ Root full-text search uses a declared native search index and keeps native relevance order:
249
+
250
+ ```ts
251
+ const page = await querying(ctx).tasks
252
+ .search('search_text', input.text)
253
+ .where({ status: 'open' })
254
+ .include({ finance: 'if-permitted' })
255
+ .with({ labels: true })
256
+ .paginate({ numItems: 25, cursor: input.cursor, scanLimit: 250 })
257
+ ```
258
+
259
+ Declare `search_text` on the exact native table registered in `relations`.
260
+ Search supports the existing root filters, field groups and nested output;
261
+ direct `.relation(...).search(...)` is unsupported. Nested relationship pages
262
+ remain ordinary browse pages. Root search returns `paginationMode: 'native-search'`,
263
+ null split metadata, and no caller-pinned `endCursor`, custom order or refill.
264
+ A short or denied-empty page can still have `isDone: false`: continue manually
265
+ with its `continueCursor` (or `usePaginatedList().fetchNextPage()`).
266
+
267
+ Search `numItems` requests a positive integer initial native target, clamped by
268
+ central limits and the remaining branch threshold. Live windows can return more raw rows.
269
+ `scanLimit` is a cursor-branch admission threshold: all raw candidates, including
270
+ denied rows, count in authenticated `seen` state. A whole window can overshoot
271
+ (e.g. seen 6 + 5 rows with limit 9 returns all authorized rows, then stops with
272
+ `result-cap`). Replaying a cursor repeats that branch; this is no global quota.
273
+ Root search payload accounting is separate from shared policy/relationship read,
274
+ byte, depth and fan-out budgets. Any unfinished nested read, policy exception or
275
+ DTO failure aborts the whole page and mints no new continuation.
276
+
277
+ Project errors explicitly at registered endpoint boundaries: ordinary `authQuery`
278
+ handlers catch and throw `new ConvexError(queryFailureContract.project(error))`
279
+ from `cvx-kit/querying`. Effect constructors configure
280
+ `query: { errors: queryFailureContract }` and wrap the promise in
281
+ `Effect.tryPromise({ try: () => /* search page */, catch: error => error })`.
282
+ The declared contract sanitizes unknown failures; do not transport raw exceptions.
283
+ See the [search contract](skills/cvx-kit/references/querying.md#root-full-text-search)
284
+ and [React list protocol](skills/cvx-kit/references/client-list.md).
285
+
248
286
  For manual projection, `tasks.toPublicDto(row)` still omits IDs and unselected
249
287
  storage fields. `tasks.toPublicDto(row, true)` or `{ _id: true }` adds the branded
250
288
  ID only. Computed extensions use matching schemas:
package/dist/errors.d.mts CHANGED
@@ -1,4 +1,5 @@
1
- import { DeclaredError, DeclaredFailure, DecodedFailure, ErrorContract, ErrorDefinitions, ErrorDetailParser, UnknownFailure, defineErrorContract } from "./modules/contracts/errors.mjs";
1
+ import { DeclaredError, DeclaredFailure, DecodedFailure, ErrorContract, ErrorDefinitions, ErrorDetailParser, UnknownFailure, combineErrorContracts, decodeFailure, defineErrorContract, queryErrors } from "./modules/contracts/errors.mjs";
2
+ import { FailureHandlers, failureOf, isFailure, matchFailure } from "./react/failures.mjs";
2
3
  //#region src/errors.d.ts
3
4
  /** Structured application error carried across Convex function boundaries. */
4
5
  export declare class KitError extends Error {
@@ -21,5 +22,5 @@ export type ErrorFactory = {
21
22
  };
22
23
  export declare const defaultErrors: ErrorFactory;
23
24
  //#endregion
24
- export { type DeclaredError, type DeclaredFailure, type DecodedFailure, type ErrorContract, type ErrorDefinitions, type ErrorDetailParser, type UnknownFailure, defineErrorContract };
25
+ export { type DeclaredError, type DeclaredFailure, type DecodedFailure, type ErrorContract, type ErrorDefinitions, type ErrorDetailParser, type FailureHandlers, type UnknownFailure, combineErrorContracts, decodeFailure, defineErrorContract, failureOf, isFailure, matchFailure, queryErrors };
25
26
  //# sourceMappingURL=errors.d.mts.map
package/dist/errors.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{defineErrorContract as e}from"./modules/contracts/errors.mjs";var t=class extends Error{code;constructor(e){super(e.message??e.code),this.name=`KitError`,this.code=e.code}};const n={throw(e){throw new t(e)}};export{t as KitError,n as defaultErrors,e as defineErrorContract};
1
+ import{combineErrorContracts as e,decodeFailure as t,defineErrorContract as n,queryErrors as r}from"./modules/contracts/errors.mjs";import{failureOf as i,isFailure as a,matchFailure as o}from"./react/failures.mjs";var s=class extends Error{code;constructor(e){super(e.message??e.code),this.name=`KitError`,this.code=e.code}};const c={throw(e){throw new s(e)}};export{s as KitError,e as combineErrorContracts,t as decodeFailure,c as defaultErrors,n as defineErrorContract,i as failureOf,a as isFailure,o as matchFailure,r as queryErrors};
2
2
  //# sourceMappingURL=errors.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.mjs","names":["KitError","input","defaultErrors","defineErrorContract"],"sources":["../src/errors.ts"],"sourcesContent":["/** Structured application error carried across Convex function boundaries. */\nexport class KitError extends Error {\n\treadonly code: string\n\n\tconstructor(input: { code: string; message?: string }) {\n\t\tsuper(input.message ?? input.code)\n\t\tthis.name = 'KitError'\n\t\tthis.code = input.code\n\t}\n}\n\nexport {\n\tdefineErrorContract,\n\ttype ErrorContract,\n\ttype ErrorDefinitions,\n\ttype ErrorDetailParser,\n\ttype DeclaredError,\n\ttype DeclaredFailure,\n\ttype DecodedFailure,\n\ttype UnknownFailure,\n} from './modules/contracts/errors'\n\n/**\n * Injection seam for host error policy. Hosts with their own error taxonomy\n * (e.g. an App.errors singleton) adapt it to this shape; everyone else uses\n * the default factory below.\n */\nexport type ErrorFactory = {\n\tthrow(input: { code: string; message?: string }): never\n}\n\nexport const defaultErrors: ErrorFactory = {\n\tthrow(input) {\n\t\tthrow new KitError(input)\n\t},\n}\n"],"mappings":"qEACA,IAAaA,EAAb,cAA8B,KAAM,CACnC,KAEA,YAAY,EAA2C,CACtD,MAAMC,EAAM,SAAWA,EAAM,IAAI,EACjC,KAAK,KAAO,WACZ,KAAK,KAAOA,EAAM,IACnB,CACD,EAsBA,MAAaC,EAA8B,CAC1C,MAAM,EAAO,CACZ,MAAM,IAAIF,EAASC,CAAK,CACzB,CACD"}
1
+ {"version":3,"file":"errors.mjs","names":["KitError","input","defaultErrors","combineErrorContracts","decodeFailure","defineErrorContract","failureOf","isFailure","matchFailure","queryErrors"],"sources":["../src/errors.ts"],"sourcesContent":["/** Structured application error carried across Convex function boundaries. */\nexport class KitError extends Error {\n\treadonly code: string\n\n\tconstructor(input: { code: string; message?: string }) {\n\t\tsuper(input.message ?? input.code)\n\t\tthis.name = 'KitError'\n\t\tthis.code = input.code\n\t}\n}\n\nexport {\n\tdefineErrorContract,\n\tqueryErrors,\n\tcombineErrorContracts,\n\ttype ErrorContract,\n\ttype ErrorDefinitions,\n\ttype ErrorDetailParser,\n\ttype DeclaredError,\n\ttype DeclaredFailure,\n\ttype DecodedFailure,\n\ttype UnknownFailure,\n} from './modules/contracts/errors'\n\n/**\n * Injection seam for host error policy. Hosts with their own error taxonomy\n * (e.g. an App.errors singleton) adapt it to this shape; everyone else uses\n * the default factory below.\n */\nexport type ErrorFactory = {\n\tthrow(input: { code: string; message?: string }): never\n}\n\nexport const defaultErrors: ErrorFactory = {\n\tthrow(input) {\n\t\tthrow new KitError(input)\n\t},\n}\n\n// Pure helpers do not import React or server query-engine modules.\nexport {\n\tdecodeFailure,\n\tmatchFailure,\n\tfailureOf,\n\tisFailure,\n\ttype FailureHandlers,\n} from './react/failures'\n"],"mappings":"sNACA,IAAaA,EAAb,cAA8B,KAAM,CACnC,KAEA,YAAY,EAA2C,CACtD,MAAMC,EAAM,SAAWA,EAAM,IAAI,EACjC,KAAK,KAAO,WACZ,KAAK,KAAOA,EAAM,IACnB,CACD,EAwBA,MAAaC,EAA8B,CAC1C,MAAM,EAAO,CACZ,MAAM,IAAIF,EAASC,CAAK,CACzB,CACD"}
@@ -0,0 +1,4 @@
1
+ import { FilterContract, FilterDescriptor, SharedField, SharedFilters, defineFilterContract } from "./querying/shared/contract.mjs";
2
+ import { FilterAst, FilterOperator, FilterScalar } from "./querying/shared/ast.mjs";
3
+ import { evaluateFilter } from "./querying/shared/evaluate.mjs";
4
+ export { type FilterAst, type FilterContract, type FilterDescriptor, type FilterOperator, type FilterScalar, type SharedField, type SharedFilters, defineFilterContract, evaluateFilter };
@@ -0,0 +1 @@
1
+ import{evaluateFilter as e}from"./querying/shared/evaluate.mjs";import{defineFilterContract as t}from"./querying/shared/contract.mjs";export{t as defineFilterContract,e as evaluateFilter};
package/dist/index.d.mts CHANGED
@@ -1,17 +1,17 @@
1
1
  import { AgentToolHandlers, AgentToolRecord, createAgentTools } from "./agent-tools.mjs";
2
2
  import { ErrorFactory, KitError, defaultErrors } from "./errors.mjs";
3
+ import { ScalarFilters, ScalarSelection, ServerFilter } from "./querying/filters.mjs";
4
+ import { DtoOptions, TIMESTAMP_FIELDS, TableBoundaryOptions, createModule, createTable, jsonSafeZid, paginated, tenantTable, zodTable, zodVariantTable } from "./zod-table.mjs";
5
+ import { FieldReference, RelationBuilder, RelationDeclarations, RelationEdge, RelationFilterSelection, RelationFilters, RelationRegistry, RelationRegistryIdentity, RelationRow, RelationSelection, RelationTable, RelationTableHelpers, RelationTables, ThroughReference, defineRelations } from "./relations.mjs";
3
6
  import { RLSConfig, Rules, TENANT_FIELD, assertTenantOwned, composeRules, createTenantRules, requireTenantReference } from "./tenancy.mjs";
4
7
  import { Actor, AuthBundle, AuthFunctions, AuthFunctionsConfig, DefaultRole, Include, IncludedQuery, SecurityConfig, createAuthFunctions, createInclude, defaultRoleMap } from "./auth.mjs";
5
8
  import { AnyQueryMiddleware, QueryMiddleware } from "./components/foundation/modules/query/query.mjs";
6
9
  import { AnyCommandMiddleware, ApplicationCommand, AuditEntryInput, AuditWriter, AuditedOperation, AuditedRegistry, CommandConstructor, CommandDefaults, CommandMiddleware, Foundation, FoundationOptions, PermissionChecker } from "./components/foundation/client.mjs";
7
10
  import { CrudConfig, createCrudCommands } from "./crud.mjs";
8
- import { ScalarFilters, ScalarSelection, ServerFilter } from "./querying/filters.mjs";
9
- import { DtoOptions, TIMESTAMP_FIELDS, TableBoundaryOptions, createModule, createTable, jsonSafeZid, paginated, tenantTable, zodTable, zodVariantTable } from "./zod-table.mjs";
10
11
  import { RateLimiterLike, rateLimit } from "./middleware.mjs";
11
12
  import { WebhookBoundaryConfig, createWebhookBoundary, recordWebhookEvent, webhookEventsTable } from "./webhooks.mjs";
12
13
  import { createStateMachine } from "./state-machine.mjs";
13
14
  import { Change, Trigger, Triggers, appendOnly, createTriggers, noDelete, tenantOwnership, timestamps } from "./triggers.mjs";
14
15
  import { FoundationRegistry, FoundationRegistryOptions, createFoundation } from "./modules/foundation/foundation.mjs";
15
- import { FieldReference, RelationBuilder, RelationDeclarations, RelationEdge, RelationFilterSelection, RelationFilters, RelationRegistry, RelationRegistryIdentity, RelationRow, RelationSelection, RelationTable, RelationTableHelpers, RelationTables, ThroughReference, defineRelations } from "./relations.mjs";
16
16
  import { QueryEngineConfig, createQueryEngine } from "./querying.mjs";
17
17
  export { type Actor, type AgentToolHandlers, type AgentToolRecord, type AnyCommandMiddleware, type AnyQueryMiddleware, type ApplicationCommand, type AuditEntryInput, type AuditWriter, type AuditedOperation, type AuditedRegistry, type AuthBundle, type AuthFunctions, type AuthFunctionsConfig, type Change, type CommandConstructor, type CommandDefaults, type CommandMiddleware, type CrudConfig, type DefaultRole, type DtoOptions, type ErrorFactory, type FieldReference, Foundation, type FoundationOptions, type FoundationRegistry, type FoundationRegistryOptions, type Include, type IncludedQuery, KitError, type PermissionChecker, type QueryEngineConfig, type QueryMiddleware, type RLSConfig, type RateLimiterLike, type RelationBuilder, type RelationDeclarations, type RelationEdge, type RelationFilterSelection, type RelationFilters, type RelationRegistry, type RelationRegistryIdentity, type RelationRow, type RelationSelection, type RelationTable, type RelationTableHelpers, type RelationTables, type Rules, type ScalarFilters, type ScalarSelection, type SecurityConfig, type ServerFilter, TENANT_FIELD, TIMESTAMP_FIELDS, type TableBoundaryOptions, type ThroughReference, type Trigger, Triggers, type WebhookBoundaryConfig, appendOnly, assertTenantOwned, composeRules, createAgentTools, createAuthFunctions, createCrudCommands, createFoundation, createInclude, createModule, createQueryEngine, createStateMachine, createTable, createTenantRules, createTriggers, createWebhookBoundary, defaultErrors, defaultRoleMap, defineRelations, jsonSafeZid, noDelete, paginated, rateLimit, recordWebhookEvent, requireTenantReference, tenantOwnership, tenantTable, timestamps, webhookEventsTable, zodTable, zodVariantTable };
@@ -1,3 +1,4 @@
1
+ import { ConvexError } from "convex/values";
1
2
  //#region src/modules/contracts/errors.d.ts
2
3
  /** Explicit synchronous validators for the final public detail representation. */
3
4
  export type ErrorDetailParser<Output = unknown> = Readonly<{
@@ -33,11 +34,541 @@ export type ErrorContract<Definitions extends ErrorDefinitions> = Readonly<{
33
34
  create: <Key extends Code<Definitions>>(code: Key, details: Details<Definitions[NoInfer<Key>]>) => Extract<DeclaredError<Definitions>, {
34
35
  code: Key;
35
36
  }>;
37
+ envelope: <Key extends Code<Definitions>>(code: Key, details: Details<Definitions[NoInfer<Key>]>) => Extract<DeclaredFailure<Definitions>, {
38
+ code: Key;
39
+ }>;
40
+ toConvexError: <Key extends Code<Definitions>>(code: Key, details: Details<Definitions[NoInfer<Key>]>) => ConvexError<Extract<DeclaredFailure<Definitions>, {
41
+ code: Key;
42
+ }>>;
36
43
  project: (error: unknown) => DecodedFailure<Definitions>;
37
44
  /** Receives envelope data, e.g. ConvexError.data; never parses error messages. */
38
45
  decode: (payload: unknown) => DecodedFailure<Definitions>;
39
46
  }>;
40
47
  /** Closed safe codes, allowlisted details, and a versioned checked transport union. */
41
48
  export declare function defineErrorContract<const Definitions extends ErrorDefinitions>(definitions: Definitions): ErrorContract<Definitions>;
49
+ /** A structural decoder also accepts combined contracts without requiring constructors. */
50
+ export type FailureContract = Pick<ErrorContract<ErrorDefinitions>, 'decode'>;
51
+ export type FailureOf<Contract extends FailureContract> = ReturnType<Contract['decode']>;
52
+ type ProjectingContract = FailureContract & Pick<ErrorContract<ErrorDefinitions>, 'project'>;
53
+ /** Extract only ConvexError.data, including one bounded serialized JSON envelope. */
54
+ export declare function decodeFailure<Contract extends FailureContract>(error: unknown, contract: Contract): FailureOf<Contract>;
55
+ type CombinedErrorContract<Contracts extends readonly ProjectingContract[]> = Readonly<{
56
+ project: (error: unknown) => FailureOf<Contracts[number]> | UnknownFailure;
57
+ decode: (payload: unknown) => FailureOf<Contracts[number]> | UnknownFailure;
58
+ }>;
59
+ /** Ordered projection and decoding; duplicate codes retain the union of member details. */
60
+ export declare function combineErrorContracts<const Contracts extends readonly ProjectingContract[]>(...contracts: Contracts): CombinedErrorContract<Contracts>;
61
+ /** Fixed, diagnostic-free transport shared by query endpoints and client recovery. */
62
+ export declare const queryErrors: Readonly<{
63
+ create: <Key extends Code<{
64
+ readonly 'invalid-cursor': {
65
+ readonly message: "Invalid cursor";
66
+ readonly details: {};
67
+ };
68
+ readonly FIELD_GROUP_DENIED: {
69
+ readonly message: "Field group access denied";
70
+ readonly details: {};
71
+ };
72
+ readonly QUERY_FANOUT: {
73
+ readonly message: "Query fan-out limit exceeded";
74
+ readonly details: {};
75
+ };
76
+ readonly SEARCH_TEXT_REQUIRED: {
77
+ readonly message: "Search text required";
78
+ readonly details: {};
79
+ };
80
+ readonly SEARCH_END_CURSOR_UNSUPPORTED: {
81
+ readonly message: "Search end cursor unsupported";
82
+ readonly details: {};
83
+ };
84
+ readonly SEARCH_ORDER_UNSUPPORTED: {
85
+ readonly message: "Search ordering unsupported";
86
+ readonly details: {};
87
+ };
88
+ readonly SEARCH_RELATION_UNSUPPORTED: {
89
+ readonly message: "Relation search unsupported";
90
+ readonly details: {};
91
+ };
92
+ readonly SEARCH_OPTIONS_UNSUPPORTED: {
93
+ readonly message: "Search options unsupported";
94
+ readonly details: {};
95
+ };
96
+ readonly SEARCH_PROTOCOL_UNSUPPORTED: {
97
+ readonly message: "Search pagination protocol unsupported";
98
+ readonly details: {};
99
+ };
100
+ }>>(code: Key, details: Details<{
101
+ readonly 'invalid-cursor': {
102
+ readonly message: "Invalid cursor";
103
+ readonly details: {};
104
+ };
105
+ readonly FIELD_GROUP_DENIED: {
106
+ readonly message: "Field group access denied";
107
+ readonly details: {};
108
+ };
109
+ readonly QUERY_FANOUT: {
110
+ readonly message: "Query fan-out limit exceeded";
111
+ readonly details: {};
112
+ };
113
+ readonly SEARCH_TEXT_REQUIRED: {
114
+ readonly message: "Search text required";
115
+ readonly details: {};
116
+ };
117
+ readonly SEARCH_END_CURSOR_UNSUPPORTED: {
118
+ readonly message: "Search end cursor unsupported";
119
+ readonly details: {};
120
+ };
121
+ readonly SEARCH_ORDER_UNSUPPORTED: {
122
+ readonly message: "Search ordering unsupported";
123
+ readonly details: {};
124
+ };
125
+ readonly SEARCH_RELATION_UNSUPPORTED: {
126
+ readonly message: "Relation search unsupported";
127
+ readonly details: {};
128
+ };
129
+ readonly SEARCH_OPTIONS_UNSUPPORTED: {
130
+ readonly message: "Search options unsupported";
131
+ readonly details: {};
132
+ };
133
+ readonly SEARCH_PROTOCOL_UNSUPPORTED: {
134
+ readonly message: "Search pagination protocol unsupported";
135
+ readonly details: {};
136
+ };
137
+ }[NoInfer<Key>]>) => Extract<Readonly<{
138
+ _tag: 'DeclaredError';
139
+ code: "FIELD_GROUP_DENIED";
140
+ details: {};
141
+ [declaredErrorBrand]: true;
142
+ }>, {
143
+ code: Key;
144
+ }> | Extract<Readonly<{
145
+ _tag: 'DeclaredError';
146
+ code: "QUERY_FANOUT";
147
+ details: {};
148
+ [declaredErrorBrand]: true;
149
+ }>, {
150
+ code: Key;
151
+ }> | Extract<Readonly<{
152
+ _tag: 'DeclaredError';
153
+ code: "SEARCH_END_CURSOR_UNSUPPORTED";
154
+ details: {};
155
+ [declaredErrorBrand]: true;
156
+ }>, {
157
+ code: Key;
158
+ }> | Extract<Readonly<{
159
+ _tag: 'DeclaredError';
160
+ code: "SEARCH_OPTIONS_UNSUPPORTED";
161
+ details: {};
162
+ [declaredErrorBrand]: true;
163
+ }>, {
164
+ code: Key;
165
+ }> | Extract<Readonly<{
166
+ _tag: 'DeclaredError';
167
+ code: "SEARCH_ORDER_UNSUPPORTED";
168
+ details: {};
169
+ [declaredErrorBrand]: true;
170
+ }>, {
171
+ code: Key;
172
+ }> | Extract<Readonly<{
173
+ _tag: 'DeclaredError';
174
+ code: "SEARCH_PROTOCOL_UNSUPPORTED";
175
+ details: {};
176
+ [declaredErrorBrand]: true;
177
+ }>, {
178
+ code: Key;
179
+ }> | Extract<Readonly<{
180
+ _tag: 'DeclaredError';
181
+ code: "SEARCH_RELATION_UNSUPPORTED";
182
+ details: {};
183
+ [declaredErrorBrand]: true;
184
+ }>, {
185
+ code: Key;
186
+ }> | Extract<Readonly<{
187
+ _tag: 'DeclaredError';
188
+ code: "SEARCH_TEXT_REQUIRED";
189
+ details: {};
190
+ [declaredErrorBrand]: true;
191
+ }>, {
192
+ code: Key;
193
+ }> | Extract<Readonly<{
194
+ _tag: 'DeclaredError';
195
+ code: "invalid-cursor";
196
+ details: {};
197
+ [declaredErrorBrand]: true;
198
+ }>, {
199
+ code: Key;
200
+ }>;
201
+ envelope: <Key extends Code<{
202
+ readonly 'invalid-cursor': {
203
+ readonly message: "Invalid cursor";
204
+ readonly details: {};
205
+ };
206
+ readonly FIELD_GROUP_DENIED: {
207
+ readonly message: "Field group access denied";
208
+ readonly details: {};
209
+ };
210
+ readonly QUERY_FANOUT: {
211
+ readonly message: "Query fan-out limit exceeded";
212
+ readonly details: {};
213
+ };
214
+ readonly SEARCH_TEXT_REQUIRED: {
215
+ readonly message: "Search text required";
216
+ readonly details: {};
217
+ };
218
+ readonly SEARCH_END_CURSOR_UNSUPPORTED: {
219
+ readonly message: "Search end cursor unsupported";
220
+ readonly details: {};
221
+ };
222
+ readonly SEARCH_ORDER_UNSUPPORTED: {
223
+ readonly message: "Search ordering unsupported";
224
+ readonly details: {};
225
+ };
226
+ readonly SEARCH_RELATION_UNSUPPORTED: {
227
+ readonly message: "Relation search unsupported";
228
+ readonly details: {};
229
+ };
230
+ readonly SEARCH_OPTIONS_UNSUPPORTED: {
231
+ readonly message: "Search options unsupported";
232
+ readonly details: {};
233
+ };
234
+ readonly SEARCH_PROTOCOL_UNSUPPORTED: {
235
+ readonly message: "Search pagination protocol unsupported";
236
+ readonly details: {};
237
+ };
238
+ }>>(code: Key, details: Details<{
239
+ readonly 'invalid-cursor': {
240
+ readonly message: "Invalid cursor";
241
+ readonly details: {};
242
+ };
243
+ readonly FIELD_GROUP_DENIED: {
244
+ readonly message: "Field group access denied";
245
+ readonly details: {};
246
+ };
247
+ readonly QUERY_FANOUT: {
248
+ readonly message: "Query fan-out limit exceeded";
249
+ readonly details: {};
250
+ };
251
+ readonly SEARCH_TEXT_REQUIRED: {
252
+ readonly message: "Search text required";
253
+ readonly details: {};
254
+ };
255
+ readonly SEARCH_END_CURSOR_UNSUPPORTED: {
256
+ readonly message: "Search end cursor unsupported";
257
+ readonly details: {};
258
+ };
259
+ readonly SEARCH_ORDER_UNSUPPORTED: {
260
+ readonly message: "Search ordering unsupported";
261
+ readonly details: {};
262
+ };
263
+ readonly SEARCH_RELATION_UNSUPPORTED: {
264
+ readonly message: "Relation search unsupported";
265
+ readonly details: {};
266
+ };
267
+ readonly SEARCH_OPTIONS_UNSUPPORTED: {
268
+ readonly message: "Search options unsupported";
269
+ readonly details: {};
270
+ };
271
+ readonly SEARCH_PROTOCOL_UNSUPPORTED: {
272
+ readonly message: "Search pagination protocol unsupported";
273
+ readonly details: {};
274
+ };
275
+ }[NoInfer<Key>]>) => Extract<Readonly<{
276
+ _tag: 'DeclaredFailure';
277
+ version: 1;
278
+ code: "FIELD_GROUP_DENIED";
279
+ message: string;
280
+ details: {};
281
+ }>, {
282
+ code: Key;
283
+ }> | Extract<Readonly<{
284
+ _tag: 'DeclaredFailure';
285
+ version: 1;
286
+ code: "QUERY_FANOUT";
287
+ message: string;
288
+ details: {};
289
+ }>, {
290
+ code: Key;
291
+ }> | Extract<Readonly<{
292
+ _tag: 'DeclaredFailure';
293
+ version: 1;
294
+ code: "SEARCH_END_CURSOR_UNSUPPORTED";
295
+ message: string;
296
+ details: {};
297
+ }>, {
298
+ code: Key;
299
+ }> | Extract<Readonly<{
300
+ _tag: 'DeclaredFailure';
301
+ version: 1;
302
+ code: "SEARCH_OPTIONS_UNSUPPORTED";
303
+ message: string;
304
+ details: {};
305
+ }>, {
306
+ code: Key;
307
+ }> | Extract<Readonly<{
308
+ _tag: 'DeclaredFailure';
309
+ version: 1;
310
+ code: "SEARCH_ORDER_UNSUPPORTED";
311
+ message: string;
312
+ details: {};
313
+ }>, {
314
+ code: Key;
315
+ }> | Extract<Readonly<{
316
+ _tag: 'DeclaredFailure';
317
+ version: 1;
318
+ code: "SEARCH_PROTOCOL_UNSUPPORTED";
319
+ message: string;
320
+ details: {};
321
+ }>, {
322
+ code: Key;
323
+ }> | Extract<Readonly<{
324
+ _tag: 'DeclaredFailure';
325
+ version: 1;
326
+ code: "SEARCH_RELATION_UNSUPPORTED";
327
+ message: string;
328
+ details: {};
329
+ }>, {
330
+ code: Key;
331
+ }> | Extract<Readonly<{
332
+ _tag: 'DeclaredFailure';
333
+ version: 1;
334
+ code: "SEARCH_TEXT_REQUIRED";
335
+ message: string;
336
+ details: {};
337
+ }>, {
338
+ code: Key;
339
+ }> | Extract<Readonly<{
340
+ _tag: 'DeclaredFailure';
341
+ version: 1;
342
+ code: "invalid-cursor";
343
+ message: string;
344
+ details: {};
345
+ }>, {
346
+ code: Key;
347
+ }>;
348
+ toConvexError: <Key extends Code<{
349
+ readonly 'invalid-cursor': {
350
+ readonly message: "Invalid cursor";
351
+ readonly details: {};
352
+ };
353
+ readonly FIELD_GROUP_DENIED: {
354
+ readonly message: "Field group access denied";
355
+ readonly details: {};
356
+ };
357
+ readonly QUERY_FANOUT: {
358
+ readonly message: "Query fan-out limit exceeded";
359
+ readonly details: {};
360
+ };
361
+ readonly SEARCH_TEXT_REQUIRED: {
362
+ readonly message: "Search text required";
363
+ readonly details: {};
364
+ };
365
+ readonly SEARCH_END_CURSOR_UNSUPPORTED: {
366
+ readonly message: "Search end cursor unsupported";
367
+ readonly details: {};
368
+ };
369
+ readonly SEARCH_ORDER_UNSUPPORTED: {
370
+ readonly message: "Search ordering unsupported";
371
+ readonly details: {};
372
+ };
373
+ readonly SEARCH_RELATION_UNSUPPORTED: {
374
+ readonly message: "Relation search unsupported";
375
+ readonly details: {};
376
+ };
377
+ readonly SEARCH_OPTIONS_UNSUPPORTED: {
378
+ readonly message: "Search options unsupported";
379
+ readonly details: {};
380
+ };
381
+ readonly SEARCH_PROTOCOL_UNSUPPORTED: {
382
+ readonly message: "Search pagination protocol unsupported";
383
+ readonly details: {};
384
+ };
385
+ }>>(code: Key, details: Details<{
386
+ readonly 'invalid-cursor': {
387
+ readonly message: "Invalid cursor";
388
+ readonly details: {};
389
+ };
390
+ readonly FIELD_GROUP_DENIED: {
391
+ readonly message: "Field group access denied";
392
+ readonly details: {};
393
+ };
394
+ readonly QUERY_FANOUT: {
395
+ readonly message: "Query fan-out limit exceeded";
396
+ readonly details: {};
397
+ };
398
+ readonly SEARCH_TEXT_REQUIRED: {
399
+ readonly message: "Search text required";
400
+ readonly details: {};
401
+ };
402
+ readonly SEARCH_END_CURSOR_UNSUPPORTED: {
403
+ readonly message: "Search end cursor unsupported";
404
+ readonly details: {};
405
+ };
406
+ readonly SEARCH_ORDER_UNSUPPORTED: {
407
+ readonly message: "Search ordering unsupported";
408
+ readonly details: {};
409
+ };
410
+ readonly SEARCH_RELATION_UNSUPPORTED: {
411
+ readonly message: "Relation search unsupported";
412
+ readonly details: {};
413
+ };
414
+ readonly SEARCH_OPTIONS_UNSUPPORTED: {
415
+ readonly message: "Search options unsupported";
416
+ readonly details: {};
417
+ };
418
+ readonly SEARCH_PROTOCOL_UNSUPPORTED: {
419
+ readonly message: "Search pagination protocol unsupported";
420
+ readonly details: {};
421
+ };
422
+ }[NoInfer<Key>]>) => ConvexError<Extract<Readonly<{
423
+ _tag: 'DeclaredFailure';
424
+ version: 1;
425
+ code: "FIELD_GROUP_DENIED";
426
+ message: string;
427
+ details: {};
428
+ }>, {
429
+ code: Key;
430
+ }> | Extract<Readonly<{
431
+ _tag: 'DeclaredFailure';
432
+ version: 1;
433
+ code: "QUERY_FANOUT";
434
+ message: string;
435
+ details: {};
436
+ }>, {
437
+ code: Key;
438
+ }> | Extract<Readonly<{
439
+ _tag: 'DeclaredFailure';
440
+ version: 1;
441
+ code: "SEARCH_END_CURSOR_UNSUPPORTED";
442
+ message: string;
443
+ details: {};
444
+ }>, {
445
+ code: Key;
446
+ }> | Extract<Readonly<{
447
+ _tag: 'DeclaredFailure';
448
+ version: 1;
449
+ code: "SEARCH_OPTIONS_UNSUPPORTED";
450
+ message: string;
451
+ details: {};
452
+ }>, {
453
+ code: Key;
454
+ }> | Extract<Readonly<{
455
+ _tag: 'DeclaredFailure';
456
+ version: 1;
457
+ code: "SEARCH_ORDER_UNSUPPORTED";
458
+ message: string;
459
+ details: {};
460
+ }>, {
461
+ code: Key;
462
+ }> | Extract<Readonly<{
463
+ _tag: 'DeclaredFailure';
464
+ version: 1;
465
+ code: "SEARCH_PROTOCOL_UNSUPPORTED";
466
+ message: string;
467
+ details: {};
468
+ }>, {
469
+ code: Key;
470
+ }> | Extract<Readonly<{
471
+ _tag: 'DeclaredFailure';
472
+ version: 1;
473
+ code: "SEARCH_RELATION_UNSUPPORTED";
474
+ message: string;
475
+ details: {};
476
+ }>, {
477
+ code: Key;
478
+ }> | Extract<Readonly<{
479
+ _tag: 'DeclaredFailure';
480
+ version: 1;
481
+ code: "SEARCH_TEXT_REQUIRED";
482
+ message: string;
483
+ details: {};
484
+ }>, {
485
+ code: Key;
486
+ }> | Extract<Readonly<{
487
+ _tag: 'DeclaredFailure';
488
+ version: 1;
489
+ code: "invalid-cursor";
490
+ message: string;
491
+ details: {};
492
+ }>, {
493
+ code: Key;
494
+ }>>;
495
+ project: (error: unknown) => DecodedFailure<{
496
+ readonly 'invalid-cursor': {
497
+ readonly message: "Invalid cursor";
498
+ readonly details: {};
499
+ };
500
+ readonly FIELD_GROUP_DENIED: {
501
+ readonly message: "Field group access denied";
502
+ readonly details: {};
503
+ };
504
+ readonly QUERY_FANOUT: {
505
+ readonly message: "Query fan-out limit exceeded";
506
+ readonly details: {};
507
+ };
508
+ readonly SEARCH_TEXT_REQUIRED: {
509
+ readonly message: "Search text required";
510
+ readonly details: {};
511
+ };
512
+ readonly SEARCH_END_CURSOR_UNSUPPORTED: {
513
+ readonly message: "Search end cursor unsupported";
514
+ readonly details: {};
515
+ };
516
+ readonly SEARCH_ORDER_UNSUPPORTED: {
517
+ readonly message: "Search ordering unsupported";
518
+ readonly details: {};
519
+ };
520
+ readonly SEARCH_RELATION_UNSUPPORTED: {
521
+ readonly message: "Relation search unsupported";
522
+ readonly details: {};
523
+ };
524
+ readonly SEARCH_OPTIONS_UNSUPPORTED: {
525
+ readonly message: "Search options unsupported";
526
+ readonly details: {};
527
+ };
528
+ readonly SEARCH_PROTOCOL_UNSUPPORTED: {
529
+ readonly message: "Search pagination protocol unsupported";
530
+ readonly details: {};
531
+ };
532
+ }>;
533
+ /** Receives envelope data, e.g. ConvexError.data; never parses error messages. */
534
+ decode: (payload: unknown) => DecodedFailure<{
535
+ readonly 'invalid-cursor': {
536
+ readonly message: "Invalid cursor";
537
+ readonly details: {};
538
+ };
539
+ readonly FIELD_GROUP_DENIED: {
540
+ readonly message: "Field group access denied";
541
+ readonly details: {};
542
+ };
543
+ readonly QUERY_FANOUT: {
544
+ readonly message: "Query fan-out limit exceeded";
545
+ readonly details: {};
546
+ };
547
+ readonly SEARCH_TEXT_REQUIRED: {
548
+ readonly message: "Search text required";
549
+ readonly details: {};
550
+ };
551
+ readonly SEARCH_END_CURSOR_UNSUPPORTED: {
552
+ readonly message: "Search end cursor unsupported";
553
+ readonly details: {};
554
+ };
555
+ readonly SEARCH_ORDER_UNSUPPORTED: {
556
+ readonly message: "Search ordering unsupported";
557
+ readonly details: {};
558
+ };
559
+ readonly SEARCH_RELATION_UNSUPPORTED: {
560
+ readonly message: "Relation search unsupported";
561
+ readonly details: {};
562
+ };
563
+ readonly SEARCH_OPTIONS_UNSUPPORTED: {
564
+ readonly message: "Search options unsupported";
565
+ readonly details: {};
566
+ };
567
+ readonly SEARCH_PROTOCOL_UNSUPPORTED: {
568
+ readonly message: "Search pagination protocol unsupported";
569
+ readonly details: {};
570
+ };
571
+ }>;
572
+ }>;
42
573
  //#endregion
43
574
  //# sourceMappingURL=errors.d.mts.map