@arkiv-network/sdk 0.7.0-dev.1 → 0.8.0-dev.1

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 (210) hide show
  1. package/README.md +29 -16
  2. package/dist/attr/index.cjs +34 -0
  3. package/dist/attr/index.d.cts +2 -0
  4. package/dist/attr/index.d.ts +2 -0
  5. package/dist/attr/index.js +3 -0
  6. package/dist/attr-BDZ-APg5.js +809 -0
  7. package/dist/attr-BDZ-APg5.js.map +1 -0
  8. package/dist/attr-BvxHN99W.cjs +1029 -0
  9. package/dist/chains/index.cjs +2 -3
  10. package/dist/chains/index.d.cts +22 -60
  11. package/dist/chains/index.d.cts.map +1 -1
  12. package/dist/chains/index.d.ts +22 -60
  13. package/dist/chains/index.d.ts.map +1 -1
  14. package/dist/chains/index.js +2 -2
  15. package/dist/chains-BJrZs6sG.js +57 -0
  16. package/dist/chains-BJrZs6sG.js.map +1 -0
  17. package/dist/chains-BYRTTipa.cjs +73 -0
  18. package/dist/changeOwnership-B7bEgla4.d.cts +509 -0
  19. package/dist/changeOwnership-B7bEgla4.d.cts.map +1 -0
  20. package/dist/changeOwnership-DwgtdSFc.d.ts +509 -0
  21. package/dist/changeOwnership-DwgtdSFc.d.ts.map +1 -0
  22. package/dist/entity/index.cjs +19 -0
  23. package/dist/entity/index.d.cts +4 -0
  24. package/dist/entity/index.d.ts +4 -0
  25. package/dist/entity/index.js +6 -0
  26. package/dist/entity-B0t6sN7F.cjs +71 -0
  27. package/dist/entity-BIp_df9u.js +67 -0
  28. package/dist/entity-BIp_df9u.js.map +1 -0
  29. package/dist/entity-CFhbAv0R.js +70 -0
  30. package/dist/entity-CFhbAv0R.js.map +1 -0
  31. package/dist/entity-wfBnZd91.cjs +98 -0
  32. package/dist/errors-D-eJkGVc.cjs +56 -0
  33. package/dist/errors-DGB8AgT2.js +33 -0
  34. package/dist/errors-DGB8AgT2.js.map +1 -0
  35. package/dist/expiry-BUYIXTGb.cjs +135 -0
  36. package/dist/expiry-BxOlvVWC.d.ts +79 -0
  37. package/dist/expiry-BxOlvVWC.d.ts.map +1 -0
  38. package/dist/expiry-DGRzrSan.js +95 -0
  39. package/dist/expiry-DGRzrSan.js.map +1 -0
  40. package/dist/expiry-DRV29F1r.d.cts +79 -0
  41. package/dist/expiry-DRV29F1r.d.cts.map +1 -0
  42. package/dist/flags-0Vl5rrHq.d.cts +41 -0
  43. package/dist/flags-0Vl5rrHq.d.cts.map +1 -0
  44. package/dist/flags-Ct8k0gpB.cjs +43 -0
  45. package/dist/flags-ZtlvOIIk.js +33 -0
  46. package/dist/flags-ZtlvOIIk.js.map +1 -0
  47. package/dist/flags-wmcMoAnN.d.ts +41 -0
  48. package/dist/flags-wmcMoAnN.d.ts.map +1 -0
  49. package/dist/index-Cgw1u5aY.d.cts +278 -0
  50. package/dist/index-Cgw1u5aY.d.cts.map +1 -0
  51. package/dist/index-ClgIuxJ8.d.ts +159 -0
  52. package/dist/index-ClgIuxJ8.d.ts.map +1 -0
  53. package/dist/index-D0CmtiWT.d.cts +159 -0
  54. package/dist/index-D0CmtiWT.d.cts.map +1 -0
  55. package/dist/index-D8LZt-3J.d.cts +417 -0
  56. package/dist/index-D8LZt-3J.d.cts.map +1 -0
  57. package/dist/index-DVYFaXNV.d.ts +417 -0
  58. package/dist/index-DVYFaXNV.d.ts.map +1 -0
  59. package/dist/index-VCqgn29D.d.ts +278 -0
  60. package/dist/index-VCqgn29D.d.ts.map +1 -0
  61. package/dist/index.cjs +676 -375
  62. package/dist/index.d.cts +247 -208
  63. package/dist/index.d.cts.map +1 -1
  64. package/dist/index.d.ts +247 -208
  65. package/dist/index.d.ts.map +1 -1
  66. package/dist/index.js +626 -368
  67. package/dist/index.js.map +1 -1
  68. package/dist/payload-Bnw1hrvb.cjs +83 -0
  69. package/dist/payload-CIxSn_DW.js +67 -0
  70. package/dist/payload-CIxSn_DW.js.map +1 -0
  71. package/dist/payload-Dgx3PQeK.d.ts +94 -0
  72. package/dist/payload-Dgx3PQeK.d.ts.map +1 -0
  73. package/dist/payload-P0nWyjLg.d.cts +94 -0
  74. package/dist/payload-P0nWyjLg.d.cts.map +1 -0
  75. package/dist/query/index.cjs +24 -150
  76. package/dist/query/index.d.cts +5 -3
  77. package/dist/query/index.d.ts +5 -3
  78. package/dist/query/index.js +6 -138
  79. package/dist/queryBuilder-BXDvX1K_.cjs +1123 -0
  80. package/dist/queryBuilder-CbLL4pG5.js +963 -0
  81. package/dist/queryBuilder-CbLL4pG5.js.map +1 -0
  82. package/dist/selection-BvK6yX0g.d.cts +433 -0
  83. package/dist/selection-BvK6yX0g.d.cts.map +1 -0
  84. package/dist/selection-fpmI3ADQ.d.ts +433 -0
  85. package/dist/selection-fpmI3ADQ.d.ts.map +1 -0
  86. package/dist/types/index.cjs +3 -3
  87. package/dist/types/index.d.cts +7 -2
  88. package/dist/types/index.d.ts +7 -2
  89. package/dist/types/index.js +3 -3
  90. package/dist/utils/index.cjs +4 -17
  91. package/dist/utils/index.d.cts +3 -17
  92. package/dist/utils/index.d.ts +3 -17
  93. package/dist/utils/index.js +4 -18
  94. package/package.json +26 -5
  95. package/src/actions/public/getEntity.ts +27 -43
  96. package/src/actions/public/getEntityNonce.ts +30 -0
  97. package/src/actions/public/predictEntityKeys.test.ts +143 -0
  98. package/src/actions/public/predictEntityKeys.ts +138 -0
  99. package/src/actions/public/query.ts +33 -69
  100. package/src/actions/public/watchEntityEvents.test.ts +414 -0
  101. package/src/actions/public/watchEntityEvents.ts +225 -0
  102. package/src/actions/wallet/changeOwnership.ts +2 -2
  103. package/src/actions/wallet/createEntity.ts +99 -24
  104. package/src/actions/wallet/extendEntity.ts +37 -13
  105. package/src/actions/wallet/mutateEntities.test.ts +76 -0
  106. package/src/actions/wallet/mutateEntities.ts +19 -21
  107. package/src/actions/wallet/patchEntity.ts +90 -0
  108. package/src/attr/attributes.test.ts +120 -0
  109. package/src/attr/attributes.ts +190 -0
  110. package/src/attr/codec.test.ts +162 -0
  111. package/src/attr/codec.ts +220 -0
  112. package/src/attr/decimal.ts +86 -0
  113. package/src/attr/errors.ts +145 -0
  114. package/src/attr/index.ts +50 -0
  115. package/src/attr/names.ts +106 -0
  116. package/src/attr/types.ts +150 -0
  117. package/src/attr/values.test.ts +271 -0
  118. package/src/attr/values.ts +502 -0
  119. package/src/chains/cheesecake.ts +22 -0
  120. package/src/chains/index.ts +1 -2
  121. package/src/clients/createPublicClient.test.ts +3 -5
  122. package/src/clients/createPublicClient.ts +5 -4
  123. package/src/clients/createWalletClient.test.ts +2 -2
  124. package/src/clients/createWalletClient.ts +13 -7
  125. package/src/clients/decorators/arkivPublic.ts +160 -139
  126. package/src/clients/decorators/arkivWallet.ts +86 -94
  127. package/src/entity/create.test.ts +184 -0
  128. package/src/entity/errors.ts +38 -0
  129. package/src/entity/events.ts +16 -0
  130. package/src/entity/expiry.test.ts +195 -0
  131. package/src/entity/expiry.ts +181 -0
  132. package/src/entity/flags.ts +65 -0
  133. package/src/entity/index.ts +14 -0
  134. package/src/entity/key.ts +68 -0
  135. package/src/entity/operations.ts +134 -0
  136. package/src/entity/params.ts +15 -0
  137. package/src/errors.ts +26 -49
  138. package/src/index.ts +6 -0
  139. package/src/query/engine.ts +59 -139
  140. package/src/query/errors.ts +151 -0
  141. package/src/query/expression.test.ts +286 -0
  142. package/src/query/expression.ts +493 -0
  143. package/src/query/index.ts +40 -4
  144. package/src/query/injection.test.ts +151 -0
  145. package/src/query/queryBuilder.test.ts +322 -637
  146. package/src/query/queryBuilder.ts +126 -359
  147. package/src/query/queryResult.ts +54 -51
  148. package/src/query/selection.test.ts +48 -98
  149. package/src/query/selection.ts +77 -65
  150. package/src/types/entity.test.ts +44 -155
  151. package/src/types/entity.ts +60 -52
  152. package/src/types/events.ts +59 -16
  153. package/src/types/index.ts +20 -17
  154. package/src/types/rpcSchema.ts +69 -37
  155. package/src/utils/arkivTransactions.test.ts +600 -155
  156. package/src/utils/arkivTransactions.ts +181 -190
  157. package/src/utils/chains.test.ts +21 -24
  158. package/src/utils/compression.ts +1 -1
  159. package/src/utils/entities.test.ts +62 -0
  160. package/src/utils/entities.ts +109 -37
  161. package/src/utils/expirationTime.ts +114 -10
  162. package/src/utils/logger.ts +2 -2
  163. package/src/utils/revert.test.ts +99 -0
  164. package/src/utils/revert.ts +145 -0
  165. package/dist/chains-BifaY04V.cjs +0 -108
  166. package/dist/chains-CrtkVbBh.js +0 -86
  167. package/dist/chains-CrtkVbBh.js.map +0 -1
  168. package/dist/consts-Bz0LZQZY.js +0 -7
  169. package/dist/consts-Bz0LZQZY.js.map +0 -1
  170. package/dist/consts-CxT1-RXU.cjs +0 -18
  171. package/dist/entity-BhSXaB23.cjs +0 -81
  172. package/dist/entity-CN41IOrq.d.cts +0 -401
  173. package/dist/entity-CN41IOrq.d.cts.map +0 -1
  174. package/dist/entity-DGfVyB-a.js +0 -71
  175. package/dist/entity-DGfVyB-a.js.map +0 -1
  176. package/dist/entity-NnEVlePN.d.ts +0 -401
  177. package/dist/entity-NnEVlePN.d.ts.map +0 -1
  178. package/dist/index-ClkpS6s_.d.ts +0 -481
  179. package/dist/index-ClkpS6s_.d.ts.map +0 -1
  180. package/dist/index-w4qop0Pe.d.cts +0 -481
  181. package/dist/index-w4qop0Pe.d.cts.map +0 -1
  182. package/dist/payload-BpNUPOnY.js +0 -13
  183. package/dist/payload-BpNUPOnY.js.map +0 -1
  184. package/dist/payload-C2KHOUoj.d.ts +0 -6
  185. package/dist/payload-C2KHOUoj.d.ts.map +0 -1
  186. package/dist/payload-CJN8fTvX.d.cts +0 -6
  187. package/dist/payload-CJN8fTvX.d.cts.map +0 -1
  188. package/dist/payload-D8YLKcJj.cjs +0 -23
  189. package/dist/query/index.js.map +0 -1
  190. package/dist/queryBuilder-BE_XhLLa.js +0 -735
  191. package/dist/queryBuilder-BE_XhLLa.js.map +0 -1
  192. package/dist/queryBuilder-J37buGCi.cjs +0 -865
  193. package/dist/utils/index.d.cts.map +0 -1
  194. package/dist/utils/index.d.ts.map +0 -1
  195. package/dist/utils/index.js.map +0 -1
  196. package/src/actions/public/buildQuery.ts +0 -10
  197. package/src/actions/public/subscribeEntityEvents.ts +0 -93
  198. package/src/actions/wallet/updateEntity.ts +0 -59
  199. package/src/chains/braga.ts +0 -26
  200. package/src/chains/kaolin.ts +0 -29
  201. package/src/query/engine.test.ts +0 -571
  202. package/src/query/predicate.test.ts +0 -461
  203. package/src/query/predicate.ts +0 -144
  204. package/src/query/queryResult.test.ts +0 -270
  205. package/src/query/selectQueryBuilder.test.ts +0 -213
  206. package/src/types/attributes.ts +0 -28
  207. package/src/utils/validation.test.ts +0 -106
  208. package/src/utils/validation.ts +0 -80
  209. /package/dist/{types-Ci4BRClw.js → types-Bx1EKe0v.js} +0 -0
  210. /package/dist/{types-a8gm_IaQ.cjs → types-CKPddlfS.cjs} +0 -0
@@ -0,0 +1,278 @@
1
+ import { K as TypeTag } from "./index-DVYFaXNV.js";
2
+ import { R as RpcSelect, d as Expression, i as SelectArg, j as ArkivClient, k as Entity } from "./selection-fpmI3ADQ.js";
3
+ import { Hex } from "viem";
4
+
5
+ //#region src/query/engine.d.ts
6
+ declare const MAX_LIMIT = 200;
7
+ /** One `arkiv_query` call. */
8
+ type QueryRequest = {
9
+ /** The query expression, already rendered. */
10
+ query: string;
11
+ /** What to return. */
12
+ select: RpcSelect;
13
+ /** Page size, up to {@link MAX_LIMIT}. Defaults to the node's own page size. */
14
+ limit?: number | undefined;
15
+ /** Cursor from a previous page. */
16
+ cursor?: string | undefined;
17
+ /** Block height to read at. Defaults to the head. */
18
+ atBlock?: bigint | undefined;
19
+ };
20
+ /** One page of results. */
21
+ type QueryResponse = {
22
+ entities: Entity[];
23
+ /** The block the page was read at — the same for every page of a paginated query. */
24
+ blockNumber: bigint;
25
+ /** The cursor for the next page, or `undefined` when this was the last one. */
26
+ cursor: string | undefined;
27
+ };
28
+ /**
29
+ * Runs one query and decodes the page it returns.
30
+ *
31
+ * @throws {QueryError} If the node rejects the query.
32
+ */
33
+ declare function runQuery(client: ArkivClient, request: QueryRequest): Promise<QueryResponse>;
34
+ //#endregion
35
+ //#region src/query/errors.d.ts
36
+ /**
37
+ * A predicate asked for an operator the query language does not define for that type.
38
+ *
39
+ * The operator × type matrix is part of the language, not a policy: a range comparison on an
40
+ * equality-only type is a **parse error** at the node, not an empty result. Catching it here turns
41
+ * a round trip and an RPC error code into a stack trace pointing at the call site.
42
+ *
43
+ * | | `=` `!=` | `<` `<=` `>` `>=` | `STARTSWITH` |
44
+ * | --- | --- | --- | --- |
45
+ * | `bool` | yes | no | no |
46
+ * | `i32` `u256` `dec` | yes | yes | no |
47
+ * | `str` | yes | no | yes |
48
+ * | `addr` `key` `bytes32` | yes | no | no |
49
+ */
50
+ declare class UnsupportedOperatorError extends Error {
51
+ /** The attribute the predicate names. */
52
+ readonly attributeName: string;
53
+ /** The operator, as it would have been written in the query. */
54
+ readonly operator: string;
55
+ /** The type of the value it was applied to. */
56
+ readonly tag: TypeTag;
57
+ constructor(attributeName: string, operator: string, tag: TypeTag, hint?: string);
58
+ }
59
+ /**
60
+ * A predicate could not be expressed in the query language for a reason other than its operator —
61
+ * a system attribute that is returned in results but cannot be filtered on, a system attribute
62
+ * compared against the wrong type, or a combinator with nothing to combine.
63
+ */
64
+ declare class InvalidPredicateError extends Error {
65
+ /** The attribute the predicate names, where there is one. */
66
+ readonly attributeName: string | undefined;
67
+ constructor(message: string, attributeName?: string);
68
+ }
69
+ /**
70
+ * What a node rejected a query for. Part of the frozen RPC surface, so it is safe to branch on —
71
+ * a `"cursor"` failure means start the query again, a `"block"` failure means the node no longer
72
+ * retains that height, and the rest mean the query itself needs fixing.
73
+ */
74
+ type QueryErrorKind = /** The query string does not parse. `data` locates it: `{ position, expected, got }`. */
75
+ "parse"
76
+ /** A predicate is well-formed but ill-typed — a range operator on an equality-only type, an unknown tag. */ | "type"
77
+ /** A literal failed validation — an `i32` out of range, a bad EIP-55 checksum, more than 18 decimal places. */ | "literal"
78
+ /** A node budget was exceeded — query length, predicate count, nesting depth, bitmap operations. */ | "limits"
79
+ /** The cursor expired, is malformed, or belongs to a different query, block or selection. */ | "cursor"
80
+ /** `atBlock` is outside the range the node retains. */ | "block";
81
+ /**
82
+ * The node rejected a query.
83
+ *
84
+ * These codes are part of the frozen `arkiv_query` surface, so {@link kind} and {@link data} are
85
+ * stable enough to branch on — which the underlying JSON-RPC error is not, because the codes
86
+ * overlap Ethereum's own EIP-1474 numbering and get wrapped accordingly on the way up.
87
+ *
88
+ * @example
89
+ * try {
90
+ * await result.next()
91
+ * } catch (error) {
92
+ * if (error instanceof QueryError && error.kind === "cursor") {
93
+ * // The page is gone — start the query over.
94
+ * }
95
+ * }
96
+ */
97
+ declare class QueryError extends Error {
98
+ /** Which failure this is. */
99
+ readonly kind: QueryErrorKind;
100
+ /** The JSON-RPC error code. */
101
+ readonly code: number;
102
+ /** The machine-readable detail the node sent, if any — e.g. `{ position, expected, got }`. */
103
+ readonly data: unknown;
104
+ /** The query string that was rejected. */
105
+ readonly query: string;
106
+ constructor(kind: QueryErrorKind, code: number, query: string, data: unknown, detail?: string);
107
+ }
108
+ //#endregion
109
+ //#region src/query/queryResult.d.ts
110
+ /** Fetches the page a cursor points at. */
111
+ type FetchPage<TEntity> = (cursor: string) => Promise<QueryResult<TEntity>>;
112
+ /**
113
+ * One page of query results.
114
+ *
115
+ * A page is immutable: {@link next} returns the following page rather than mutating this one, so a
116
+ * page that has been read stays readable.
117
+ *
118
+ * @typeParam TEntity - The shape of each entity, inferred from the selection by `client.select()`.
119
+ *
120
+ * @example
121
+ * let page = await client.select({ key: true }).where(eq("category", "docs")).limit(100).fetch()
122
+ * while (page.hasNextPage()) {
123
+ * page = await page.next()
124
+ * }
125
+ */
126
+ declare class QueryResult<TEntity = Entity> {
127
+ /** The entities on this page. */
128
+ readonly entities: readonly TEntity[];
129
+ /**
130
+ * The block this page was read at.
131
+ *
132
+ * Every page of one walk reads the same block — the cursor is bound to it — so results cannot
133
+ * shift under a paginating reader.
134
+ */
135
+ readonly blockNumber: bigint;
136
+ /** The cursor for the next page, or `undefined` when this was the last one. */
137
+ readonly cursor: string | undefined;
138
+ private readonly fetchPage;
139
+ constructor(entities: readonly TEntity[], blockNumber: bigint, cursor: string | undefined, fetchPage: FetchPage<TEntity>);
140
+ /**
141
+ * Whether another page follows.
142
+ *
143
+ * The node omits the cursor once nothing remains, so this is an answer rather than the guess a
144
+ * short final page would be — a full last page is reported correctly.
145
+ */
146
+ hasNextPage(): boolean;
147
+ /**
148
+ * Fetches the next page.
149
+ *
150
+ * @throws {NoMoreResultsError} If this was the last page — check {@link hasNextPage} first.
151
+ * @throws {QueryError} If the node rejects the request; `kind === "cursor"` means the cursor
152
+ * expired and the walk has to start again.
153
+ */
154
+ next(): Promise<QueryResult<TEntity>>;
155
+ }
156
+ //#endregion
157
+ //#region src/query/queryBuilder.d.ts
158
+ /**
159
+ * Builds and runs a query.
160
+ *
161
+ * The selection is fixed when the builder is created and the filter is added by chaining, so the
162
+ * result type is known before a single predicate is written. Create one with `client.select(...)`
163
+ * rather than constructing it directly — that is what infers the entity shape from the selection.
164
+ *
165
+ * Every filter added with {@link where}, {@link ownedBy} and {@link createdBy} must hold; use
166
+ * {@link or} for alternatives inside one call.
167
+ *
168
+ * @typeParam TEntity - The projected entity shape, inferred from the selection by `client.select()`.
169
+ *
170
+ * @example
171
+ * import { createPublicClient } from "@arkiv-network/sdk"
172
+ * import { i32 } from "@arkiv-network/sdk/attr"
173
+ * import { cheesecake } from "@arkiv-network/sdk/chains"
174
+ * import { eq, gte, or } from "@arkiv-network/sdk/query"
175
+ * import { http } from "viem"
176
+ *
177
+ * const client = createPublicClient({ chain: cheesecake, transport: http() })
178
+ *
179
+ * const page = await client
180
+ * .select({ key: true, attributes: true })
181
+ * .where(gte("level", i32(10)), or(eq("status", "open"), eq("status", "review")))
182
+ * .ownedBy(owner)
183
+ * .limit(100)
184
+ * .fetch()
185
+ *
186
+ * for (const entity of page.entities) console.log(entity.key, entity.attributes)
187
+ */
188
+ declare class SelectQueryBuilder<TEntity = Entity> {
189
+ private readonly _client;
190
+ private readonly _select;
191
+ private readonly _filters;
192
+ private _ownedBy;
193
+ private _createdBy;
194
+ private _limit;
195
+ private _cursor;
196
+ private _atBlock;
197
+ constructor(client: ArkivClient, selection?: SelectArg);
198
+ /**
199
+ * Adds filters. Everything passed here, and across repeated calls, must hold.
200
+ *
201
+ * @param expressions - The expressions, as separate arguments or one array.
202
+ *
203
+ * @example
204
+ * builder.where(eq("category", "docs"))
205
+ * builder.where(gte("level", i32(10)), lt("level", i32(20)))
206
+ * builder.where(or(eq("status", "open"), not(exists("closedAt"))))
207
+ */
208
+ where(expressions: readonly Expression[]): this;
209
+ where(...expressions: Expression[]): this;
210
+ /**
211
+ * Restricts the results to entities this account owns — shorthand for
212
+ * `where(eq("$owner", addr(owner)))`. Calling it again replaces the filter.
213
+ *
214
+ * @example
215
+ * builder.ownedBy("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045")
216
+ */
217
+ ownedBy(owner: Hex): this;
218
+ /**
219
+ * Restricts the results to entities this account created — shorthand for
220
+ * `where(eq("$creator", addr(creator)))`. Calling it again replaces the filter.
221
+ *
222
+ * The creator never changes; the owner does, so these differ after a transfer.
223
+ */
224
+ createdBy(creator: Hex): this;
225
+ /**
226
+ * Sets the page size, up to the node maximum of 200. Without it the node picks the page size.
227
+ *
228
+ * @example
229
+ * builder.limit(100)
230
+ */
231
+ limit(limit: number): this;
232
+ /**
233
+ * Starts from a cursor returned by an earlier page.
234
+ *
235
+ * Pagination normally goes through {@link QueryResult.next}, which carries the cursor for you;
236
+ * this is for resuming a walk in a later process. A cursor is bound to the query, block and
237
+ * selection it came from, so it must be used with an identically-built query.
238
+ */
239
+ cursor(cursor: string): this;
240
+ /**
241
+ * Reads the state as of a given block rather than the head. The block must be within the range
242
+ * the node retains.
243
+ *
244
+ * @example
245
+ * builder.atBlock(1_297_000n)
246
+ */
247
+ atBlock(block: bigint): this;
248
+ /**
249
+ * The query string this builder will send — the same text the node parses.
250
+ *
251
+ * @throws {InvalidPredicateError} If no filter has been added.
252
+ */
253
+ toString(): string;
254
+ /**
255
+ * Runs the query and returns the first page.
256
+ *
257
+ * @throws {InvalidPredicateError} If no filter has been added.
258
+ * @throws {QueryError} If the node rejects the query.
259
+ *
260
+ * @example
261
+ * const page = await client.select({ key: true }).where(eq("category", "docs")).fetch()
262
+ * page.entities // this page
263
+ * await page.next() // the next one
264
+ */
265
+ fetch(): Promise<QueryResult<TEntity>>;
266
+ /**
267
+ * Walks every page, yielding one entity at a time.
268
+ *
269
+ * @example
270
+ * for await (const entity of client.select({ key: true }).where(eq("category", "docs"))) {
271
+ * console.log(entity.key)
272
+ * }
273
+ */
274
+ [Symbol.asyncIterator](): AsyncGenerator<TEntity>;
275
+ }
276
+ //#endregion
277
+ export { QueryErrorKind as a, QueryRequest as c, QueryError as i, QueryResponse as l, QueryResult as n, UnsupportedOperatorError as o, InvalidPredicateError as r, MAX_LIMIT as s, SelectQueryBuilder as t, runQuery as u };
278
+ //# sourceMappingURL=index-VCqgn29D.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-VCqgn29D.d.ts","names":[],"sources":["../src/query/engine.ts","../src/query/errors.ts","../src/query/queryResult.ts","../src/query/queryBuilder.ts"],"sourcesContent":[],"mappings":";;;;;cAUa,SAAA;;AAAA,KAGD,YAAA,GAHU;EAGV;EAcA,KAAA,EAAA,MAAA;EAaU;EAAiB,MAAA,EAvB7B,SAuB6B;EAAsB;EAAuB,KAAA,CAAA,EAAA,MAAA,GAAA,SAAA;EAAR;EAAO,MAAA,CAAA,EAAA,MAAA,GAAA,SAAA;;;;ACxBnF;AAMgB,KDKJ,aAAA,GCLI;EAE4C,QAAA,EDIhD,MCJgD,EAAA;EARd;EAAK,WAAA,EAAA,MAAA;EAyBtC;EAgBD,MAAA,EAAA,MAAA,GAAc,SAAA;AAwC1B,CAAA;;;;;;iBDzDsB,QAAA,SAAiB,sBAAsB,eAAe,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