@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.
- package/README.md +29 -16
- package/dist/attr/index.cjs +34 -0
- package/dist/attr/index.d.cts +2 -0
- package/dist/attr/index.d.ts +2 -0
- package/dist/attr/index.js +3 -0
- package/dist/attr-BDZ-APg5.js +809 -0
- package/dist/attr-BDZ-APg5.js.map +1 -0
- package/dist/attr-BvxHN99W.cjs +1029 -0
- package/dist/chains/index.cjs +2 -3
- package/dist/chains/index.d.cts +22 -60
- package/dist/chains/index.d.cts.map +1 -1
- package/dist/chains/index.d.ts +22 -60
- package/dist/chains/index.d.ts.map +1 -1
- package/dist/chains/index.js +2 -2
- package/dist/chains-BJrZs6sG.js +57 -0
- package/dist/chains-BJrZs6sG.js.map +1 -0
- package/dist/chains-BYRTTipa.cjs +73 -0
- package/dist/changeOwnership-B7bEgla4.d.cts +509 -0
- package/dist/changeOwnership-B7bEgla4.d.cts.map +1 -0
- package/dist/changeOwnership-DwgtdSFc.d.ts +509 -0
- package/dist/changeOwnership-DwgtdSFc.d.ts.map +1 -0
- package/dist/entity/index.cjs +19 -0
- package/dist/entity/index.d.cts +4 -0
- package/dist/entity/index.d.ts +4 -0
- package/dist/entity/index.js +6 -0
- package/dist/entity-B0t6sN7F.cjs +71 -0
- package/dist/entity-BIp_df9u.js +67 -0
- package/dist/entity-BIp_df9u.js.map +1 -0
- package/dist/entity-CFhbAv0R.js +70 -0
- package/dist/entity-CFhbAv0R.js.map +1 -0
- package/dist/entity-wfBnZd91.cjs +98 -0
- package/dist/errors-D-eJkGVc.cjs +56 -0
- package/dist/errors-DGB8AgT2.js +33 -0
- package/dist/errors-DGB8AgT2.js.map +1 -0
- package/dist/expiry-BUYIXTGb.cjs +135 -0
- package/dist/expiry-BxOlvVWC.d.ts +79 -0
- package/dist/expiry-BxOlvVWC.d.ts.map +1 -0
- package/dist/expiry-DGRzrSan.js +95 -0
- package/dist/expiry-DGRzrSan.js.map +1 -0
- package/dist/expiry-DRV29F1r.d.cts +79 -0
- package/dist/expiry-DRV29F1r.d.cts.map +1 -0
- package/dist/flags-0Vl5rrHq.d.cts +41 -0
- package/dist/flags-0Vl5rrHq.d.cts.map +1 -0
- package/dist/flags-Ct8k0gpB.cjs +43 -0
- package/dist/flags-ZtlvOIIk.js +33 -0
- package/dist/flags-ZtlvOIIk.js.map +1 -0
- package/dist/flags-wmcMoAnN.d.ts +41 -0
- package/dist/flags-wmcMoAnN.d.ts.map +1 -0
- package/dist/index-Cgw1u5aY.d.cts +278 -0
- package/dist/index-Cgw1u5aY.d.cts.map +1 -0
- package/dist/index-ClgIuxJ8.d.ts +159 -0
- package/dist/index-ClgIuxJ8.d.ts.map +1 -0
- package/dist/index-D0CmtiWT.d.cts +159 -0
- package/dist/index-D0CmtiWT.d.cts.map +1 -0
- package/dist/index-D8LZt-3J.d.cts +417 -0
- package/dist/index-D8LZt-3J.d.cts.map +1 -0
- package/dist/index-DVYFaXNV.d.ts +417 -0
- package/dist/index-DVYFaXNV.d.ts.map +1 -0
- package/dist/index-VCqgn29D.d.ts +278 -0
- package/dist/index-VCqgn29D.d.ts.map +1 -0
- package/dist/index.cjs +676 -375
- package/dist/index.d.cts +247 -208
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +247 -208
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +626 -368
- package/dist/index.js.map +1 -1
- package/dist/payload-Bnw1hrvb.cjs +83 -0
- package/dist/payload-CIxSn_DW.js +67 -0
- package/dist/payload-CIxSn_DW.js.map +1 -0
- package/dist/payload-Dgx3PQeK.d.ts +94 -0
- package/dist/payload-Dgx3PQeK.d.ts.map +1 -0
- package/dist/payload-P0nWyjLg.d.cts +94 -0
- package/dist/payload-P0nWyjLg.d.cts.map +1 -0
- package/dist/query/index.cjs +24 -150
- package/dist/query/index.d.cts +5 -3
- package/dist/query/index.d.ts +5 -3
- package/dist/query/index.js +6 -138
- package/dist/queryBuilder-BXDvX1K_.cjs +1123 -0
- package/dist/queryBuilder-CbLL4pG5.js +963 -0
- package/dist/queryBuilder-CbLL4pG5.js.map +1 -0
- package/dist/selection-BvK6yX0g.d.cts +433 -0
- package/dist/selection-BvK6yX0g.d.cts.map +1 -0
- package/dist/selection-fpmI3ADQ.d.ts +433 -0
- package/dist/selection-fpmI3ADQ.d.ts.map +1 -0
- package/dist/types/index.cjs +3 -3
- package/dist/types/index.d.cts +7 -2
- package/dist/types/index.d.ts +7 -2
- package/dist/types/index.js +3 -3
- package/dist/utils/index.cjs +4 -17
- package/dist/utils/index.d.cts +3 -17
- package/dist/utils/index.d.ts +3 -17
- package/dist/utils/index.js +4 -18
- package/package.json +26 -5
- package/src/actions/public/getEntity.ts +27 -43
- package/src/actions/public/getEntityNonce.ts +30 -0
- package/src/actions/public/predictEntityKeys.test.ts +143 -0
- package/src/actions/public/predictEntityKeys.ts +138 -0
- package/src/actions/public/query.ts +33 -69
- package/src/actions/public/watchEntityEvents.test.ts +414 -0
- package/src/actions/public/watchEntityEvents.ts +225 -0
- package/src/actions/wallet/changeOwnership.ts +2 -2
- package/src/actions/wallet/createEntity.ts +99 -24
- package/src/actions/wallet/extendEntity.ts +37 -13
- package/src/actions/wallet/mutateEntities.test.ts +76 -0
- package/src/actions/wallet/mutateEntities.ts +19 -21
- package/src/actions/wallet/patchEntity.ts +90 -0
- package/src/attr/attributes.test.ts +120 -0
- package/src/attr/attributes.ts +190 -0
- package/src/attr/codec.test.ts +162 -0
- package/src/attr/codec.ts +220 -0
- package/src/attr/decimal.ts +86 -0
- package/src/attr/errors.ts +145 -0
- package/src/attr/index.ts +50 -0
- package/src/attr/names.ts +106 -0
- package/src/attr/types.ts +150 -0
- package/src/attr/values.test.ts +271 -0
- package/src/attr/values.ts +502 -0
- package/src/chains/cheesecake.ts +22 -0
- package/src/chains/index.ts +1 -2
- package/src/clients/createPublicClient.test.ts +3 -5
- package/src/clients/createPublicClient.ts +5 -4
- package/src/clients/createWalletClient.test.ts +2 -2
- package/src/clients/createWalletClient.ts +13 -7
- package/src/clients/decorators/arkivPublic.ts +160 -139
- package/src/clients/decorators/arkivWallet.ts +86 -94
- package/src/entity/create.test.ts +184 -0
- package/src/entity/errors.ts +38 -0
- package/src/entity/events.ts +16 -0
- package/src/entity/expiry.test.ts +195 -0
- package/src/entity/expiry.ts +181 -0
- package/src/entity/flags.ts +65 -0
- package/src/entity/index.ts +14 -0
- package/src/entity/key.ts +68 -0
- package/src/entity/operations.ts +134 -0
- package/src/entity/params.ts +15 -0
- package/src/errors.ts +26 -49
- package/src/index.ts +6 -0
- package/src/query/engine.ts +59 -139
- package/src/query/errors.ts +151 -0
- package/src/query/expression.test.ts +286 -0
- package/src/query/expression.ts +493 -0
- package/src/query/index.ts +40 -4
- package/src/query/injection.test.ts +151 -0
- package/src/query/queryBuilder.test.ts +322 -637
- package/src/query/queryBuilder.ts +126 -359
- package/src/query/queryResult.ts +54 -51
- package/src/query/selection.test.ts +48 -98
- package/src/query/selection.ts +77 -65
- package/src/types/entity.test.ts +44 -155
- package/src/types/entity.ts +60 -52
- package/src/types/events.ts +59 -16
- package/src/types/index.ts +20 -17
- package/src/types/rpcSchema.ts +69 -37
- package/src/utils/arkivTransactions.test.ts +600 -155
- package/src/utils/arkivTransactions.ts +181 -190
- package/src/utils/chains.test.ts +21 -24
- package/src/utils/compression.ts +1 -1
- package/src/utils/entities.test.ts +62 -0
- package/src/utils/entities.ts +109 -37
- package/src/utils/expirationTime.ts +114 -10
- package/src/utils/logger.ts +2 -2
- package/src/utils/revert.test.ts +99 -0
- package/src/utils/revert.ts +145 -0
- package/dist/chains-BifaY04V.cjs +0 -108
- package/dist/chains-CrtkVbBh.js +0 -86
- package/dist/chains-CrtkVbBh.js.map +0 -1
- package/dist/consts-Bz0LZQZY.js +0 -7
- package/dist/consts-Bz0LZQZY.js.map +0 -1
- package/dist/consts-CxT1-RXU.cjs +0 -18
- package/dist/entity-BhSXaB23.cjs +0 -81
- package/dist/entity-CN41IOrq.d.cts +0 -401
- package/dist/entity-CN41IOrq.d.cts.map +0 -1
- package/dist/entity-DGfVyB-a.js +0 -71
- package/dist/entity-DGfVyB-a.js.map +0 -1
- package/dist/entity-NnEVlePN.d.ts +0 -401
- package/dist/entity-NnEVlePN.d.ts.map +0 -1
- package/dist/index-ClkpS6s_.d.ts +0 -481
- package/dist/index-ClkpS6s_.d.ts.map +0 -1
- package/dist/index-w4qop0Pe.d.cts +0 -481
- package/dist/index-w4qop0Pe.d.cts.map +0 -1
- package/dist/payload-BpNUPOnY.js +0 -13
- package/dist/payload-BpNUPOnY.js.map +0 -1
- package/dist/payload-C2KHOUoj.d.ts +0 -6
- package/dist/payload-C2KHOUoj.d.ts.map +0 -1
- package/dist/payload-CJN8fTvX.d.cts +0 -6
- package/dist/payload-CJN8fTvX.d.cts.map +0 -1
- package/dist/payload-D8YLKcJj.cjs +0 -23
- package/dist/query/index.js.map +0 -1
- package/dist/queryBuilder-BE_XhLLa.js +0 -735
- package/dist/queryBuilder-BE_XhLLa.js.map +0 -1
- package/dist/queryBuilder-J37buGCi.cjs +0 -865
- package/dist/utils/index.d.cts.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/src/actions/public/buildQuery.ts +0 -10
- package/src/actions/public/subscribeEntityEvents.ts +0 -93
- package/src/actions/wallet/updateEntity.ts +0 -59
- package/src/chains/braga.ts +0 -26
- package/src/chains/kaolin.ts +0 -29
- package/src/query/engine.test.ts +0 -571
- package/src/query/predicate.test.ts +0 -461
- package/src/query/predicate.ts +0 -144
- package/src/query/queryResult.test.ts +0 -270
- package/src/query/selectQueryBuilder.test.ts +0 -213
- package/src/types/attributes.ts +0 -28
- package/src/utils/validation.test.ts +0 -106
- package/src/utils/validation.ts +0 -80
- /package/dist/{types-Ci4BRClw.js → types-Bx1EKe0v.js} +0 -0
- /package/dist/{types-a8gm_IaQ.cjs → types-CKPddlfS.cjs} +0 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { i as Lifetime, n as Expiry } from "./expiry-BxOlvVWC.js";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/expirationTime.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The optional floor a deadline can carry.
|
|
7
|
+
*
|
|
8
|
+
* `atLeast` takes a duration — one of the `from*` helpers — and never another deadline, so
|
|
9
|
+
* `atBlock(x, { atLeast: atBlock(y) })` does not compile. Two deadlines are not a thing the engine
|
|
10
|
+
* can resolve.
|
|
11
|
+
*/
|
|
12
|
+
type DeadlineOptions = {
|
|
13
|
+
/** Live at least this long from now, even if the deadline is sooner. */
|
|
14
|
+
atLeast?: Lifetime | undefined;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Builds the `expires` of a create or an extension.
|
|
18
|
+
*
|
|
19
|
+
* Every helper returns the `{ minLifetime, expiresAt }` pair the ABI carries, so what you write is
|
|
20
|
+
* what goes on the wire. The `from*` helpers fill `minLifetime` and leave `expiresAt` at `0n`;
|
|
21
|
+
* {@link ExpirationTime.atBlock} and {@link ExpirationTime.atDate} do the reverse. The engine takes
|
|
22
|
+
* whichever comes later, which is why a deadline can also carry a floor.
|
|
23
|
+
*
|
|
24
|
+
* Values are plain data — no methods, no prototype — so they log, clone and compare like any other
|
|
25
|
+
* object.
|
|
26
|
+
*
|
|
27
|
+
* @example The 90% case: a duration, and nothing else to think about.
|
|
28
|
+
* await client.createEntity({ payload, contentType, expires: ExpirationTime.fromDays(30) })
|
|
29
|
+
*
|
|
30
|
+
* @example An exact block, or a wall-clock date.
|
|
31
|
+
* expires: ExpirationTime.atBlock(1_200_000n)
|
|
32
|
+
* expires: ExpirationTime.atDate(new Date("2027-01-01"))
|
|
33
|
+
*
|
|
34
|
+
* @example A deadline that still guarantees a minimum life.
|
|
35
|
+
* expires: ExpirationTime.atBlock(1_200_000n, { atLeast: ExpirationTime.fromDays(1) })
|
|
36
|
+
*/
|
|
37
|
+
declare const ExpirationTime: {
|
|
38
|
+
/**
|
|
39
|
+
* A raw number of seconds. Must be a whole number of blocks' worth — see the other helpers, which
|
|
40
|
+
* all produce one by construction.
|
|
41
|
+
*
|
|
42
|
+
* @throws {InvalidExpiryError} If the duration is not a positive multiple of the block time.
|
|
43
|
+
*/
|
|
44
|
+
fromSeconds: (seconds: number) => Lifetime;
|
|
45
|
+
fromMinutes: (minutes: number) => Lifetime;
|
|
46
|
+
fromHours: (hours: number) => Lifetime;
|
|
47
|
+
fromDays: (days: number) => Lifetime;
|
|
48
|
+
fromWeeks: (weeks: number) => Lifetime;
|
|
49
|
+
fromMonths: (months: number) => Lifetime;
|
|
50
|
+
fromYears: (years: number) => Lifetime;
|
|
51
|
+
/**
|
|
52
|
+
* A number of blocks, for callers who think in the chain's own unit. Always exact — there is no
|
|
53
|
+
* conversion to be approximate about.
|
|
54
|
+
*
|
|
55
|
+
* @throws {InvalidExpiryError} If the count is not a positive whole number.
|
|
56
|
+
*/
|
|
57
|
+
fromBlocks: (blocks: number) => Lifetime;
|
|
58
|
+
/**
|
|
59
|
+
* An absolute block height.
|
|
60
|
+
*
|
|
61
|
+
* @param block - The block the entity expires at.
|
|
62
|
+
* @param options - Optionally, a floor: `{ atLeast: ExpirationTime.fromDays(1) }`.
|
|
63
|
+
* @throws {InvalidExpiryError} If the height is negative.
|
|
64
|
+
*/
|
|
65
|
+
atBlock: (block: bigint, options?: DeadlineOptions) => Expiry;
|
|
66
|
+
/**
|
|
67
|
+
* A wall-clock instant, placed against the block the transaction is built on.
|
|
68
|
+
*
|
|
69
|
+
* A date cannot land on a block boundary in general, so it rounds **up** to the next block: the
|
|
70
|
+
* entity lives until at least the instant asked for. This is why a date is never rejected for
|
|
71
|
+
* "not being a whole number of blocks" the way a duration is — it becomes a block height, not a
|
|
72
|
+
* duration.
|
|
73
|
+
*
|
|
74
|
+
* @param date - When the entity should expire.
|
|
75
|
+
* @param options - Optionally, a floor: `{ atLeast: ExpirationTime.fromDays(1) }`.
|
|
76
|
+
* @throws {InvalidExpiryError} If the value is not a valid `Date`.
|
|
77
|
+
*/
|
|
78
|
+
atDate: (date: Date, options?: DeadlineOptions) => Expiry;
|
|
79
|
+
/**
|
|
80
|
+
* An entity that should never expire.
|
|
81
|
+
*
|
|
82
|
+
* This is `atBlock(MAX_EXPIRES_AT)` — the largest expiry the `uint64` field holds — and the
|
|
83
|
+
* engine treats it as an ordinary deadline rather than a special case. There is no permanence
|
|
84
|
+
* flag; a block height no chain will reach is what permanence is.
|
|
85
|
+
*/
|
|
86
|
+
permanent: () => Expiry;
|
|
87
|
+
};
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/utils/payload.d.ts
|
|
90
|
+
declare function jsonToPayload(json: object): Uint8Array;
|
|
91
|
+
declare function stringToPayload(data: string): Uint8Array;
|
|
92
|
+
//#endregion
|
|
93
|
+
export { ExpirationTime as i, stringToPayload as n, DeadlineOptions as r, jsonToPayload as t };
|
|
94
|
+
//# sourceMappingURL=payload-Dgx3PQeK.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload-Dgx3PQeK.d.ts","names":[],"sources":["../src/utils/expirationTime.ts","../src/utils/payload.ts"],"sourcesContent":[],"mappings":";;;;;;AAWA;AAkCA;;;;AAU4B,KA5ChB,eAAA,GA4CgB;EACE;EACE,OAAA,CAAA,EA5CpB,QA4CoB,GAAA,SAAA;CACF;;;;;;;;;;;;ACxD9B;AAIA;;;;;;;;;cDuCa;;;;;;;oCAOqB;oCACA;gCACJ;8BACF;gCACE;kCACE;gCACF;;;;;;;kCAQE;;;;;;;;qCAgBK,oBAAkB;;;;;;;;;;;;;iBAmBtC,gBAAgB,oBAAkB;;;;;;;;mBAclC;;;;iBCjHD,aAAA,gBAA6B;iBAI7B,eAAA,gBAA+B"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { i as Lifetime, n as Expiry } from "./expiry-DRV29F1r.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/expirationTime.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The optional floor a deadline can carry.
|
|
7
|
+
*
|
|
8
|
+
* `atLeast` takes a duration — one of the `from*` helpers — and never another deadline, so
|
|
9
|
+
* `atBlock(x, { atLeast: atBlock(y) })` does not compile. Two deadlines are not a thing the engine
|
|
10
|
+
* can resolve.
|
|
11
|
+
*/
|
|
12
|
+
type DeadlineOptions = {
|
|
13
|
+
/** Live at least this long from now, even if the deadline is sooner. */
|
|
14
|
+
atLeast?: Lifetime | undefined;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Builds the `expires` of a create or an extension.
|
|
18
|
+
*
|
|
19
|
+
* Every helper returns the `{ minLifetime, expiresAt }` pair the ABI carries, so what you write is
|
|
20
|
+
* what goes on the wire. The `from*` helpers fill `minLifetime` and leave `expiresAt` at `0n`;
|
|
21
|
+
* {@link ExpirationTime.atBlock} and {@link ExpirationTime.atDate} do the reverse. The engine takes
|
|
22
|
+
* whichever comes later, which is why a deadline can also carry a floor.
|
|
23
|
+
*
|
|
24
|
+
* Values are plain data — no methods, no prototype — so they log, clone and compare like any other
|
|
25
|
+
* object.
|
|
26
|
+
*
|
|
27
|
+
* @example The 90% case: a duration, and nothing else to think about.
|
|
28
|
+
* await client.createEntity({ payload, contentType, expires: ExpirationTime.fromDays(30) })
|
|
29
|
+
*
|
|
30
|
+
* @example An exact block, or a wall-clock date.
|
|
31
|
+
* expires: ExpirationTime.atBlock(1_200_000n)
|
|
32
|
+
* expires: ExpirationTime.atDate(new Date("2027-01-01"))
|
|
33
|
+
*
|
|
34
|
+
* @example A deadline that still guarantees a minimum life.
|
|
35
|
+
* expires: ExpirationTime.atBlock(1_200_000n, { atLeast: ExpirationTime.fromDays(1) })
|
|
36
|
+
*/
|
|
37
|
+
declare const ExpirationTime: {
|
|
38
|
+
/**
|
|
39
|
+
* A raw number of seconds. Must be a whole number of blocks' worth — see the other helpers, which
|
|
40
|
+
* all produce one by construction.
|
|
41
|
+
*
|
|
42
|
+
* @throws {InvalidExpiryError} If the duration is not a positive multiple of the block time.
|
|
43
|
+
*/
|
|
44
|
+
fromSeconds: (seconds: number) => Lifetime;
|
|
45
|
+
fromMinutes: (minutes: number) => Lifetime;
|
|
46
|
+
fromHours: (hours: number) => Lifetime;
|
|
47
|
+
fromDays: (days: number) => Lifetime;
|
|
48
|
+
fromWeeks: (weeks: number) => Lifetime;
|
|
49
|
+
fromMonths: (months: number) => Lifetime;
|
|
50
|
+
fromYears: (years: number) => Lifetime;
|
|
51
|
+
/**
|
|
52
|
+
* A number of blocks, for callers who think in the chain's own unit. Always exact — there is no
|
|
53
|
+
* conversion to be approximate about.
|
|
54
|
+
*
|
|
55
|
+
* @throws {InvalidExpiryError} If the count is not a positive whole number.
|
|
56
|
+
*/
|
|
57
|
+
fromBlocks: (blocks: number) => Lifetime;
|
|
58
|
+
/**
|
|
59
|
+
* An absolute block height.
|
|
60
|
+
*
|
|
61
|
+
* @param block - The block the entity expires at.
|
|
62
|
+
* @param options - Optionally, a floor: `{ atLeast: ExpirationTime.fromDays(1) }`.
|
|
63
|
+
* @throws {InvalidExpiryError} If the height is negative.
|
|
64
|
+
*/
|
|
65
|
+
atBlock: (block: bigint, options?: DeadlineOptions) => Expiry;
|
|
66
|
+
/**
|
|
67
|
+
* A wall-clock instant, placed against the block the transaction is built on.
|
|
68
|
+
*
|
|
69
|
+
* A date cannot land on a block boundary in general, so it rounds **up** to the next block: the
|
|
70
|
+
* entity lives until at least the instant asked for. This is why a date is never rejected for
|
|
71
|
+
* "not being a whole number of blocks" the way a duration is — it becomes a block height, not a
|
|
72
|
+
* duration.
|
|
73
|
+
*
|
|
74
|
+
* @param date - When the entity should expire.
|
|
75
|
+
* @param options - Optionally, a floor: `{ atLeast: ExpirationTime.fromDays(1) }`.
|
|
76
|
+
* @throws {InvalidExpiryError} If the value is not a valid `Date`.
|
|
77
|
+
*/
|
|
78
|
+
atDate: (date: Date, options?: DeadlineOptions) => Expiry;
|
|
79
|
+
/**
|
|
80
|
+
* An entity that should never expire.
|
|
81
|
+
*
|
|
82
|
+
* This is `atBlock(MAX_EXPIRES_AT)` — the largest expiry the `uint64` field holds — and the
|
|
83
|
+
* engine treats it as an ordinary deadline rather than a special case. There is no permanence
|
|
84
|
+
* flag; a block height no chain will reach is what permanence is.
|
|
85
|
+
*/
|
|
86
|
+
permanent: () => Expiry;
|
|
87
|
+
};
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/utils/payload.d.ts
|
|
90
|
+
declare function jsonToPayload(json: object): Uint8Array;
|
|
91
|
+
declare function stringToPayload(data: string): Uint8Array;
|
|
92
|
+
//#endregion
|
|
93
|
+
export { ExpirationTime as i, stringToPayload as n, DeadlineOptions as r, jsonToPayload as t };
|
|
94
|
+
//# sourceMappingURL=payload-P0nWyjLg.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload-P0nWyjLg.d.cts","names":[],"sources":["../src/utils/expirationTime.ts","../src/utils/payload.ts"],"sourcesContent":[],"mappings":";;;;;;AAWA;AAkCA;;;;AAU4B,KA5ChB,eAAA,GA4CgB;EACE;EACE,OAAA,CAAA,EA5CpB,QA4CoB,GAAA,SAAA;CACF;;;;;;;;;;;;ACxD9B;AAIA;;;;;;;;;cDuCa;;;;;;;oCAOqB;oCACA;gCACJ;8BACF;gCACE;kCACE;gCACF;;;;;;;kCAQE;;;;;;;;qCAgBK,oBAAkB;;;;;;;;;;;;;iBAmBtC,gBAAgB,oBAAkB;;;;;;;;mBAclC;;;;iBCjHD,aAAA,gBAA6B;iBAI7B,eAAA,gBAA+B"}
|
package/dist/query/index.cjs
CHANGED
|
@@ -1,153 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
require('../
|
|
3
|
-
require('../
|
|
1
|
+
require('../attr-BvxHN99W.cjs');
|
|
2
|
+
const require_queryBuilder = require('../queryBuilder-BXDvX1K_.cjs');
|
|
3
|
+
require('../errors-D-eJkGVc.cjs');
|
|
4
|
+
require('../flags-Ct8k0gpB.cjs');
|
|
5
|
+
require('../entity-B0t6sN7F.cjs');
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
type: "or",
|
|
9
|
-
predicates: predicates.flat()
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
function and(...predicates) {
|
|
13
|
-
return {
|
|
14
|
-
type: "and",
|
|
15
|
-
predicates: predicates.flat()
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Creates an equality predicate
|
|
20
|
-
* @param key - The key to compare
|
|
21
|
-
* @param value - The value to compare
|
|
22
|
-
* @returns The equality predicate
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* const predicate = eq("name", "John")
|
|
26
|
-
* // result = { type: "eq", key: "name", value: "John" }
|
|
27
|
-
*/
|
|
28
|
-
function eq(key, value) {
|
|
29
|
-
return {
|
|
30
|
-
type: "eq",
|
|
31
|
-
key,
|
|
32
|
-
value
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Creates a not equal predicate
|
|
37
|
-
* @param key - The key to compare
|
|
38
|
-
* @param value - The value to compare
|
|
39
|
-
* @returns The not equal predicate
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* const predicate = neq("name", "John")
|
|
43
|
-
* // result = { type: "neq", key: "name", value: "John" }
|
|
44
|
-
*/
|
|
45
|
-
function neq(key, value) {
|
|
46
|
-
return {
|
|
47
|
-
type: "neq",
|
|
48
|
-
key,
|
|
49
|
-
value
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Creates a greater than predicate
|
|
54
|
-
* @param key - The key to compare
|
|
55
|
-
* @param value - The value to compare
|
|
56
|
-
* @returns The greater than predicate
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* const predicate = gt("name", "John")
|
|
60
|
-
* // result = { type: "gt", key: "name", value: "John" }
|
|
61
|
-
*/
|
|
62
|
-
function gt(key, value) {
|
|
63
|
-
return {
|
|
64
|
-
type: "gt",
|
|
65
|
-
key,
|
|
66
|
-
value
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Creates a greater than or equal predicate
|
|
71
|
-
* @param key - The key to compare
|
|
72
|
-
* @param value - The value to compare
|
|
73
|
-
* @returns The greater than or equal predicate
|
|
74
|
-
*
|
|
75
|
-
* @example
|
|
76
|
-
* const predicate = gte("name", "John")
|
|
77
|
-
* // result = { type: "gte", key: "name", value: "John" }
|
|
78
|
-
*/
|
|
79
|
-
function gte(key, value) {
|
|
80
|
-
return {
|
|
81
|
-
type: "gte",
|
|
82
|
-
key,
|
|
83
|
-
value
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Creates a less than predicate
|
|
88
|
-
* @param key - The key to compare
|
|
89
|
-
* @param value - The value to compare
|
|
90
|
-
* @returns The less than predicate
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
* const predicate = lt("name", "John")
|
|
94
|
-
* // result = { type: "lt", key: "name", value: "John" }
|
|
95
|
-
*/
|
|
96
|
-
function lt(key, value) {
|
|
97
|
-
return {
|
|
98
|
-
type: "lt",
|
|
99
|
-
key,
|
|
100
|
-
value
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Creates a less than or equal predicate
|
|
105
|
-
* @param key - The key to compare
|
|
106
|
-
* @param value - The value to compare
|
|
107
|
-
* @returns The less than or equal predicate
|
|
108
|
-
*
|
|
109
|
-
* @example
|
|
110
|
-
* const predicate = lte("name", "John")
|
|
111
|
-
* // result = { type: "lte", key: "name", value: "John" }
|
|
112
|
-
*/
|
|
113
|
-
function lte(key, value) {
|
|
114
|
-
return {
|
|
115
|
-
type: "lte",
|
|
116
|
-
key,
|
|
117
|
-
value
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Creates a not predicate
|
|
122
|
-
* @param key - The key to compare
|
|
123
|
-
* @returns The not predicate
|
|
124
|
-
*
|
|
125
|
-
* @example
|
|
126
|
-
* const predicate = not("name")
|
|
127
|
-
* // result = { type: "not", key: "name", value: "" }
|
|
128
|
-
*/
|
|
129
|
-
function not(key) {
|
|
130
|
-
return {
|
|
131
|
-
type: "not",
|
|
132
|
-
key,
|
|
133
|
-
value: ""
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
//#endregion
|
|
138
|
-
exports.BaseQueryBuilder = require_queryBuilder.BaseQueryBuilder;
|
|
139
|
-
exports.QueryBuilder = require_queryBuilder.QueryBuilder;
|
|
7
|
+
exports.InvalidPredicateError = require_queryBuilder.InvalidPredicateError;
|
|
8
|
+
exports.MAX_LIMIT = require_queryBuilder.MAX_LIMIT;
|
|
9
|
+
exports.QueryError = require_queryBuilder.QueryError;
|
|
140
10
|
exports.QueryResult = require_queryBuilder.QueryResult;
|
|
141
11
|
exports.SelectQueryBuilder = require_queryBuilder.SelectQueryBuilder;
|
|
142
|
-
exports.
|
|
143
|
-
exports.
|
|
144
|
-
exports.
|
|
145
|
-
exports.
|
|
146
|
-
exports.gt = gt;
|
|
147
|
-
exports.gte = gte;
|
|
148
|
-
exports.
|
|
149
|
-
exports.
|
|
150
|
-
exports.
|
|
151
|
-
exports.
|
|
152
|
-
exports.
|
|
153
|
-
exports.
|
|
12
|
+
exports.UnsupportedOperatorError = require_queryBuilder.UnsupportedOperatorError;
|
|
13
|
+
exports.and = require_queryBuilder.and;
|
|
14
|
+
exports.eq = require_queryBuilder.eq;
|
|
15
|
+
exports.exists = require_queryBuilder.exists;
|
|
16
|
+
exports.gt = require_queryBuilder.gt;
|
|
17
|
+
exports.gte = require_queryBuilder.gte;
|
|
18
|
+
exports.hasType = require_queryBuilder.hasType;
|
|
19
|
+
exports.lt = require_queryBuilder.lt;
|
|
20
|
+
exports.lte = require_queryBuilder.lte;
|
|
21
|
+
exports.ne = require_queryBuilder.ne;
|
|
22
|
+
exports.not = require_queryBuilder.not;
|
|
23
|
+
exports.or = require_queryBuilder.or;
|
|
24
|
+
exports.render = require_queryBuilder.render;
|
|
25
|
+
exports.runQuery = require_queryBuilder.runQuery;
|
|
26
|
+
exports.startsWith = require_queryBuilder.startsWith;
|
|
27
|
+
exports.toRpcSelect = require_queryBuilder.toRpcSelect;
|
package/dist/query/index.d.cts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import "../index-D8LZt-3J.cjs";
|
|
2
|
+
import "../flags-0Vl5rrHq.cjs";
|
|
3
|
+
import { C as lte, D as render, E as or, O as startsWith, S as lt, T as not, _ as eq, a as SelectionFields, b as gte, c as ComparisonNode, d as Expression, f as NotNode, g as and, h as TypeOfNode, i as SelectArg, l as ComparisonOperator, m as StartsWithNode, n as FullEntity, o as toRpcSelect, p as OrNode, r as ProjectedEntity, s as AndNode, t as EntitySelection, u as ExistsNode, v as exists, w as ne, x as hasType, y as gt } from "../selection-BvK6yX0g.cjs";
|
|
4
|
+
import { a as QueryErrorKind, c as QueryRequest, i as QueryError, l as QueryResponse, n as QueryResult, o as UnsupportedOperatorError, r as InvalidPredicateError, s as MAX_LIMIT, t as SelectQueryBuilder, u as runQuery } from "../index-Cgw1u5aY.cjs";
|
|
5
|
+
export { AndNode, ComparisonNode, ComparisonOperator, EntitySelection, ExistsNode, Expression, FullEntity, InvalidPredicateError, MAX_LIMIT, NotNode, OrNode, ProjectedEntity, QueryError, QueryErrorKind, QueryRequest, QueryResponse, QueryResult, SelectArg, SelectQueryBuilder, SelectionFields, StartsWithNode, TypeOfNode, UnsupportedOperatorError, and, eq, exists, gt, gte, hasType, lt, lte, ne, not, or, render, runQuery, startsWith, toRpcSelect };
|
package/dist/query/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import "../index-DVYFaXNV.js";
|
|
2
|
+
import "../flags-wmcMoAnN.js";
|
|
3
|
+
import { C as lte, D as render, E as or, O as startsWith, S as lt, T as not, _ as eq, a as SelectionFields, b as gte, c as ComparisonNode, d as Expression, f as NotNode, g as and, h as TypeOfNode, i as SelectArg, l as ComparisonOperator, m as StartsWithNode, n as FullEntity, o as toRpcSelect, p as OrNode, r as ProjectedEntity, s as AndNode, t as EntitySelection, u as ExistsNode, v as exists, w as ne, x as hasType, y as gt } from "../selection-fpmI3ADQ.js";
|
|
4
|
+
import { a as QueryErrorKind, c as QueryRequest, i as QueryError, l as QueryResponse, n as QueryResult, o as UnsupportedOperatorError, r as InvalidPredicateError, s as MAX_LIMIT, t as SelectQueryBuilder, u as runQuery } from "../index-VCqgn29D.js";
|
|
5
|
+
export { AndNode, ComparisonNode, ComparisonOperator, EntitySelection, ExistsNode, Expression, FullEntity, InvalidPredicateError, MAX_LIMIT, NotNode, OrNode, ProjectedEntity, QueryError, QueryErrorKind, QueryRequest, QueryResponse, QueryResult, SelectArg, SelectQueryBuilder, SelectionFields, StartsWithNode, TypeOfNode, UnsupportedOperatorError, and, eq, exists, gt, gte, hasType, lt, lte, ne, not, or, render, runQuery, startsWith, toRpcSelect };
|
package/dist/query/index.js
CHANGED
|
@@ -1,139 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "../
|
|
3
|
-
import "../
|
|
1
|
+
import "../attr-BDZ-APg5.js";
|
|
2
|
+
import { _ as MAX_LIMIT, a as eq, b as QueryError, c as gte, d as lte, f as ne, g as startsWith, h as render, i as and, l as hasType, m as or, n as QueryResult, o as exists, p as not, r as toRpcSelect, s as gt, t as SelectQueryBuilder, u as lt, v as runQuery, x as UnsupportedOperatorError, y as InvalidPredicateError } from "../queryBuilder-CbLL4pG5.js";
|
|
3
|
+
import "../errors-DGB8AgT2.js";
|
|
4
|
+
import "../flags-ZtlvOIIk.js";
|
|
5
|
+
import "../entity-BIp_df9u.js";
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
function or(...predicates) {
|
|
7
|
-
return {
|
|
8
|
-
type: "or",
|
|
9
|
-
predicates: predicates.flat()
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
function and(...predicates) {
|
|
13
|
-
return {
|
|
14
|
-
type: "and",
|
|
15
|
-
predicates: predicates.flat()
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Creates an equality predicate
|
|
20
|
-
* @param key - The key to compare
|
|
21
|
-
* @param value - The value to compare
|
|
22
|
-
* @returns The equality predicate
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* const predicate = eq("name", "John")
|
|
26
|
-
* // result = { type: "eq", key: "name", value: "John" }
|
|
27
|
-
*/
|
|
28
|
-
function eq(key, value) {
|
|
29
|
-
return {
|
|
30
|
-
type: "eq",
|
|
31
|
-
key,
|
|
32
|
-
value
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Creates a not equal predicate
|
|
37
|
-
* @param key - The key to compare
|
|
38
|
-
* @param value - The value to compare
|
|
39
|
-
* @returns The not equal predicate
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* const predicate = neq("name", "John")
|
|
43
|
-
* // result = { type: "neq", key: "name", value: "John" }
|
|
44
|
-
*/
|
|
45
|
-
function neq(key, value) {
|
|
46
|
-
return {
|
|
47
|
-
type: "neq",
|
|
48
|
-
key,
|
|
49
|
-
value
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Creates a greater than predicate
|
|
54
|
-
* @param key - The key to compare
|
|
55
|
-
* @param value - The value to compare
|
|
56
|
-
* @returns The greater than predicate
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* const predicate = gt("name", "John")
|
|
60
|
-
* // result = { type: "gt", key: "name", value: "John" }
|
|
61
|
-
*/
|
|
62
|
-
function gt(key, value) {
|
|
63
|
-
return {
|
|
64
|
-
type: "gt",
|
|
65
|
-
key,
|
|
66
|
-
value
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Creates a greater than or equal predicate
|
|
71
|
-
* @param key - The key to compare
|
|
72
|
-
* @param value - The value to compare
|
|
73
|
-
* @returns The greater than or equal predicate
|
|
74
|
-
*
|
|
75
|
-
* @example
|
|
76
|
-
* const predicate = gte("name", "John")
|
|
77
|
-
* // result = { type: "gte", key: "name", value: "John" }
|
|
78
|
-
*/
|
|
79
|
-
function gte(key, value) {
|
|
80
|
-
return {
|
|
81
|
-
type: "gte",
|
|
82
|
-
key,
|
|
83
|
-
value
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Creates a less than predicate
|
|
88
|
-
* @param key - The key to compare
|
|
89
|
-
* @param value - The value to compare
|
|
90
|
-
* @returns The less than predicate
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
* const predicate = lt("name", "John")
|
|
94
|
-
* // result = { type: "lt", key: "name", value: "John" }
|
|
95
|
-
*/
|
|
96
|
-
function lt(key, value) {
|
|
97
|
-
return {
|
|
98
|
-
type: "lt",
|
|
99
|
-
key,
|
|
100
|
-
value
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Creates a less than or equal predicate
|
|
105
|
-
* @param key - The key to compare
|
|
106
|
-
* @param value - The value to compare
|
|
107
|
-
* @returns The less than or equal predicate
|
|
108
|
-
*
|
|
109
|
-
* @example
|
|
110
|
-
* const predicate = lte("name", "John")
|
|
111
|
-
* // result = { type: "lte", key: "name", value: "John" }
|
|
112
|
-
*/
|
|
113
|
-
function lte(key, value) {
|
|
114
|
-
return {
|
|
115
|
-
type: "lte",
|
|
116
|
-
key,
|
|
117
|
-
value
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Creates a not predicate
|
|
122
|
-
* @param key - The key to compare
|
|
123
|
-
* @returns The not predicate
|
|
124
|
-
*
|
|
125
|
-
* @example
|
|
126
|
-
* const predicate = not("name")
|
|
127
|
-
* // result = { type: "not", key: "name", value: "" }
|
|
128
|
-
*/
|
|
129
|
-
function not(key) {
|
|
130
|
-
return {
|
|
131
|
-
type: "not",
|
|
132
|
-
key,
|
|
133
|
-
value: ""
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
//#endregion
|
|
138
|
-
export { BaseQueryBuilder, QueryBuilder, QueryResult, SelectQueryBuilder, and, asc, desc, eq, gt, gte, lt, lte, neq, not, or, selectionToIncludeData };
|
|
139
|
-
//# sourceMappingURL=index.js.map
|
|
7
|
+
export { InvalidPredicateError, MAX_LIMIT, QueryError, QueryResult, SelectQueryBuilder, UnsupportedOperatorError, and, eq, exists, gt, gte, hasType, lt, lte, ne, not, or, render, runQuery, startsWith, toRpcSelect };
|