@domino-sdk/relay 1.61.0 → 1.63.0

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 (88) hide show
  1. package/CHANGELOG.md +276 -8
  2. package/README.md +3 -2
  3. package/dist/{schema-CZ6Rj0ZF.d.ts → accounts-nz3mzfRQ.d.ts} +3146 -1765
  4. package/dist/action-9Xl0StBg.d.ts +33 -0
  5. package/dist/{attempt-captures-DYnJVkfg.d.ts → attempt-captures-DMi8oR9T.d.ts} +1 -1
  6. package/dist/authoring.d.ts +171 -49
  7. package/dist/authoring.js +158 -49
  8. package/dist/{automatic-outcomes-If88LR9f.d.ts → automatic-outcomes-C_LLQU1p.d.ts} +15 -1
  9. package/dist/avatar.d.ts +1 -1
  10. package/dist/browser.d.ts +15 -11
  11. package/dist/browser.js +18 -12
  12. package/dist/capability-error-CuI_F7yM.d.ts +296 -0
  13. package/dist/{pages-K7-KjSXw.d.ts → catalog-BaTOKpNw.d.ts} +56 -567
  14. package/dist/{chunk-XBV2CK2H.js → chunk-3RFP6GT5.js} +15 -3
  15. package/dist/{chunk-VURRFVNP.js → chunk-4GQW43UU.js} +239 -361
  16. package/dist/chunk-4NOFSGAL.js +320 -0
  17. package/dist/{chunk-24I4R732.js → chunk-5XLZ34PV.js} +34 -19
  18. package/dist/{chunk-L77O64I4.js → chunk-7X67QLPB.js} +43 -43
  19. package/dist/{chunk-RHBS5FJL.js → chunk-7Z4SZ6YM.js} +3 -3
  20. package/dist/{chunk-QEAS4ZGS.js → chunk-AQOL3SK5.js} +1 -1
  21. package/dist/chunk-EHUSD3O2.js +377 -0
  22. package/dist/chunk-FO2LCZTL.js +19 -0
  23. package/dist/{chunk-DYXDZFKA.js → chunk-FU5CGNTR.js} +166 -178
  24. package/dist/chunk-FWLQ5XCS.js +21 -0
  25. package/dist/chunk-GLH6MEI2.js +193 -0
  26. package/dist/chunk-ICXZZNPS.js +199 -0
  27. package/dist/{chunk-ZDJLPN4L.js → chunk-ID3BZXFZ.js} +2696 -2693
  28. package/dist/chunk-KP2MCX3R.js +587 -0
  29. package/dist/{chunk-SKGTNTLF.js → chunk-LZWXCBUB.js} +213 -297
  30. package/dist/chunk-MTKRIQEU.js +31 -0
  31. package/dist/{chunk-4OC7REYX.js → chunk-MWMCQLCG.js} +3 -3
  32. package/dist/{chunk-PPB7HALD.js → chunk-N4BDKS6Y.js} +27 -26
  33. package/dist/{chunk-5I54XBK2.js → chunk-N4LNEGQX.js} +2 -2
  34. package/dist/chunk-NQDEWJWE.js +554 -0
  35. package/dist/chunk-QR6HH4DI.js +508 -0
  36. package/dist/chunk-TLSQETTY.js +41 -0
  37. package/dist/{chunk-MHPKEVEW.js → chunk-U66GUVSG.js} +7 -2
  38. package/dist/{chunk-KDR2VAJP.js → chunk-UYVJZR33.js} +2 -2
  39. package/dist/chunk-UZ765UGH.js +18 -0
  40. package/dist/{chunk-7A4J67ZL.js → chunk-VWQGWGCH.js} +7 -7
  41. package/dist/chunk-W7YSMSGC.js +725 -0
  42. package/dist/{client-C51w7fMb.d.ts → client-DHmG7rn6.d.ts} +126 -93
  43. package/dist/{announcements-CHx3-HBw.d.ts → dashboards-CLemT6kj.d.ts} +14 -137
  44. package/dist/{deployments-kWoHFaqj.d.ts → deployments-DTULi7dF.d.ts} +450 -18
  45. package/dist/identity-integration-DOeNZaxF.d.ts +1271 -0
  46. package/dist/index.d.ts +13 -11
  47. package/dist/index.js +16 -11
  48. package/dist/internal.d.ts +29 -13
  49. package/dist/internal.js +57 -17
  50. package/dist/{integrations-B3y36OaB.d.ts → limits-kNzYdZ00.d.ts} +464 -53
  51. package/dist/{offers-BoV4ryUc.d.ts → offers-CYeN_I0Y.d.ts} +22 -4
  52. package/dist/{participant-activity-DHL8QYks.d.ts → participant-activity-D-Drp24G.d.ts} +16 -3
  53. package/dist/portal-proxy.d.ts +75 -2
  54. package/dist/portal-proxy.js +153 -25
  55. package/dist/react/index.d.ts +214 -27
  56. package/dist/react/index.js +196 -42
  57. package/dist/{action-DBzILFx9.d.ts → request-error-D_dUPLwo.d.ts} +1 -31
  58. package/dist/reward-deliveries-drp-x1G-.d.ts +782 -0
  59. package/dist/runtime/authoring.js +1 -1
  60. package/dist/runtime/chunks/UGDV5W4N.js +1 -0
  61. package/dist/runtime/manifest.json +3 -3
  62. package/dist/runtime/schema.js +1 -1
  63. package/dist/schema.d.ts +330 -31
  64. package/dist/schema.js +147 -91
  65. package/dist/server/index.d.ts +14 -12
  66. package/dist/server/index.js +6425 -6260
  67. package/dist/sign-in-providers-B1Q9eDRm.d.ts +44 -0
  68. package/dist/submission-input-DZCbjQUH.d.ts +343 -0
  69. package/dist/{telegram-browser-BUceZIGZ.d.ts → telegram-browser-NL0Asmsi.d.ts} +46 -6
  70. package/dist/telegram.d.ts +64 -0
  71. package/dist/telegram.js +23 -0
  72. package/dist/testing.d.ts +326 -27
  73. package/dist/testing.js +440 -90
  74. package/dist/tracker-data-esm3WG8R.d.ts +1881 -0
  75. package/dist/{transport-BrX9pIGN.d.ts → transport-Czht_irp.d.ts} +43483 -38512
  76. package/dist/{wallet-CIqFoxdm.d.ts → wallet-B7e06v4m.d.ts} +32 -9
  77. package/package.json +5 -1
  78. package/dist/accounts-DoabriBX.d.ts +0 -306
  79. package/dist/capability-error-DufwG3G0.d.ts +0 -159
  80. package/dist/chunk-3Y3L2F54.js +0 -982
  81. package/dist/chunk-DHXDBAJF.js +0 -544
  82. package/dist/chunk-EN3M5Z4J.js +0 -13
  83. package/dist/chunk-QNUHWK7R.js +0 -602
  84. package/dist/chunk-SE4PFJPT.js +0 -247
  85. package/dist/groups-CqcA2Ycs.d.ts +0 -2827
  86. package/dist/runtime/chunks/5QVFB4TU.js +0 -1
  87. package/dist/submission-input-C54Q8yAD.d.ts +0 -146
  88. package/dist/x-D1PGi8Sq.d.ts +0 -331
@@ -425,6 +425,8 @@ declare function walletAddressInput(signer: WalletSigner): Promise<WalletAddress
425
425
  /**
426
426
  * The most wallets of one chain family a member can have linked to one project at a time. Sign-in
427
427
  * wallets do not count: signing in always links the wallet.
428
+ *
429
+ * @deprecated Use `limits.walletsPerChain`, which a 1.x release can raise.
428
430
  */
429
431
  declare const WALLETS_PER_CHAIN = 5;
430
432
  /** The wallet families a project can enable for sign-in, in their stored order. */
@@ -743,7 +745,11 @@ declare function isContractEvent(value: string): value is ContractEvent;
743
745
  type WalletEventCondition = string | boolean | {
744
746
  gte: string;
745
747
  };
746
- /** The most logs one `ctx.wallet.events()` read may match before `where` filters them. */
748
+ /**
749
+ * The most logs one `ctx.wallet.events()` read may match before `where` filters them.
750
+ *
751
+ * @deprecated Use `limits.walletEventLogs`, which a 1.x release can raise.
752
+ */
747
753
  declare const maxWalletEventLogs = 1000;
748
754
  /** How far before the evaluation `ctx.wallet.events()` may look back: 30 days. */
749
755
  declare const maxWalletEventLookback: number;
@@ -767,6 +773,14 @@ type WalletEventsQuery = {
767
773
  where?: Record<string, WalletEventCondition>;
768
774
  /** One of the member's linked EVM wallets; omit to read all of them. */
769
775
  address?: string;
776
+ /**
777
+ * Return only the newest matching events, at most this many: from 1 to
778
+ * {@link limits.walletEventLogs}. Relay reads back from the newest block and stops at its caps
779
+ * (1,000 logs, 3,000,000 blocks) instead of throwing, and the result's `complete` is false when
780
+ * older matching events may be left out. Without it, a read that reaches a cap throws
781
+ * `author-error`.
782
+ */
783
+ newest?: number;
770
784
  };
771
785
  /**
772
786
  * A decoded event argument: integers in decimal, addresses EIP-55, bytes in lowercase hex, and an
@@ -789,6 +803,7 @@ declare const walletEventsSchema: z.ZodObject<{
789
803
  finalized: "finalized";
790
804
  safe: "safe";
791
805
  }>;
806
+ complete: z.ZodOptional<z.ZodBoolean>;
792
807
  logs: z.ZodArray<z.ZodObject<{
793
808
  wallet: z.ZodString;
794
809
  block: z.ZodString;
@@ -832,7 +847,11 @@ declare const solanaProgramIdlSchema: z.ZodObject<{
832
847
  idl: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
833
848
  }, z.core.$strict>;
834
849
  type SolanaProgramIdl = z.infer<typeof solanaProgramIdlSchema>;
835
- /** The most transactions one `ctx.wallet.transactions()` read fetches per wallet. */
850
+ /**
851
+ * The most transactions one `ctx.wallet.transactions()` read fetches per wallet.
852
+ *
853
+ * @deprecated Use `limits.walletTransactions`, which a 1.x release can raise.
854
+ */
836
855
  declare const maxWalletTransactions = 1000;
837
856
  /** How far before the evaluation `ctx.wallet.transactions()` may look back: 30 days. */
838
857
  declare const maxWalletTransactionLookback: number;
@@ -954,12 +973,16 @@ interface WalletReader {
954
973
  * wallets, from `since` up to the chain's finalized block (its `safe` block on a chain without
955
974
  * finality), oldest first. Null when the member has no linked EVM wallet. A malformed event, a
956
975
  * chain Relay does not read, an `account` that is not an indexed `address` argument, a `where`
957
- * on an unknown argument, a `since` more than 30 days before the evaluation, a read over too
958
- * many blocks or more than 1,000 logs, and an `address` the member never linked throw
959
- * `CapabilityError` with code `"author-error"`. Only events that name the member in an indexed
960
- * argument can be read: a router or aggregator call where the member is only the transaction's
961
- * sender cannot. Relay supplies it to every evaluation; it is optional only so that test
962
- * doubles written before it keep compiling.
976
+ * on an unknown argument, a `since` more than 30 days before the evaluation, a read over more
977
+ * than 3,000,000 blocks or 1,000 logs, and an `address` the member never linked throw
978
+ * `CapabilityError` with code `"author-error"`. 3,000,000 blocks is less than 30 days on fast
979
+ * chains; at block times measured in October 2026, about: Robinhood 3 days, Gravity 8, opBNB 8,
980
+ * Arbitrum One 9, Monad 10, Cronos 14, Plume 15, BNB Smart Chain 15, Sei 16, Telos 17, Arc 17,
981
+ * Tempo 19, Playnance 20, Aurora 22, Stable 24 and Moca 28. With `newest`, a read that reaches
982
+ * either cap returns the newest matching events instead, with `complete: false`. Only events
983
+ * that name the member in an indexed argument can be read: a router or aggregator call where
984
+ * the member is only the transaction's sender cannot. Relay supplies it to every evaluation; it
985
+ * is optional only so that test doubles written before it keep compiling.
963
986
  */
964
987
  events?(query: WalletEventsQuery): Promise<WalletEvents | null>;
965
988
  /**
@@ -976,4 +999,4 @@ interface WalletReader {
976
999
  transactions?(query: WalletTransactionsQuery): Promise<WalletTransactions | null>;
977
1000
  }
978
1001
 
979
- export { type WalletTransactionsQuery as $, type AvatarProvider as A, type NftCollectionParts as B, type CosmosChain as C, type NftStandard as D, type EvmChainId as E, type WalletBalance as F, type WalletBalanceChange as G, type WalletBalanceQuery as H, type WalletBalanceSample as I, type WalletCall as J, type WalletCallArgument as K, type LinkedWallet as L, type WalletCallQuery as M, type NftCollection as N, type OwnProfile as O, type ProfileAvatar as P, type WalletDelegations as Q, type WalletDelegationsQuery as R, type SolanaProgram as S, type WalletEventCondition as T, type WalletEventValue as U, type WalletEvents as V, type WalletAddressInput as W, type WalletEventsQuery as X, type WalletNfts as Y, type WalletNftsQuery as Z, type WalletTransactions as _, type CosmosNetwork as a, solanaProgramIdlSchema as a$, cosmosDenomSchema as a0, cosmosNetworkSchema as a1, isContractCall as a2, isContractEvent as a3, isEvmChainId as a4, isNftCollection as a5, isSolanaProgram as a6, maxWalletEventLogs as a7, maxWalletEventLookback as a8, maxWalletTransactionLookback as a9, type SolanaProgramIdl as aA, WALLETS_PER_CHAIN as aB, anchorIdlSchema as aC, avatarProviderSchema as aD, avatarSeedSchema as aE, avatarUploadTypes as aF, caip10 as aG, cosmosAddressSchema as aH, cosmosChain as aI, displayNameSchema as aJ, evmAddressSchema as aK, evmChainIdSchema as aL, managedProfileSchema as aM, ownProfileSchema as aN, profileAvatarSchema as aO, profileCompletionPageSchema as aP, profileCompletionQuerySchema as aQ, profileCompletionSchema as aR, profileDefaultProviderSchema as aS, profileDefaultsSchema as aT, profileModerationSchema as aU, profileSettingsInputSchema as aV, profileSettingsSchema as aW, profileSummarySchema as aX, profileVisibilitySchema as aY, solanaAddressSchema as aZ, solanaMainnet as a_, maxWalletTransactions as aa, parseContractCall as ab, parseContractEvent as ac, parseContractFunction as ad, parseNftCollection as ae, type SolanaIdlSource as af, profileUpdateSchema as ag, walletAddressInputSchema as ah, walletSignatureSchema as ai, profileReferralSchema as aj, linkedWalletSchema as ak, walletBalanceSchema as al, walletNftsSchema as am, walletCallSchema as an, walletDelegationsSchema as ao, walletEventsSchema as ap, walletTransactionsSchema as aq, AVATAR_UPLOAD_LIMIT as ar, type AnchorIdl as as, type KnownSolanaIdlSource as at, type ManagedProfile as au, type ProfileDefaultProvider as av, type ProfileDefaults as aw, type ProfileModeration as ax, type ProfileSettings as ay, type ProfileSettingsInput as az, type ProfileCompletion as b, walletAddressInput as b0, walletBalanceSampleSchema as b1, walletChainSchema as b2, walletMessageChallengeSchema as b3, walletSignInFamilies as b4, walletSignInNetwork as b5, walletSignInNetworkSchema as b6, walletSignInNetworksSchema as b7, walletUnlinkInputSchema as b8, type ProfileCompletionPage as c, type ProfileCompletionQuery as d, type ProfileReferral as e, type ProfileSummary as f, type ProfileUpdate as g, type ProfileVisibility as h, type WalletChain as i, type WalletMessageChallenge as j, type WalletSignInNetwork as k, type WalletSignature as l, type WalletSigner as m, type WalletUnlinkInput as n, type ContractCall as o, type ContractEvent as p, type WalletBalanceSourceQuery as q, type WalletTransaction as r, type WalletInstruction as s, type WalletReader as t, type ContractCallParts as u, type ContractCallReturnType as v, type ContractEventInput as w, type ContractEventParts as x, type ContractFunction as y, type CosmosDenom as z };
1002
+ export { type WalletTransactions as $, type AvatarProvider as A, type ContractFunction as B, type CosmosChain as C, type CosmosDenom as D, type EvmChainId as E, type NftCollectionParts as F, type NftStandard as G, type WalletBalance as H, type WalletBalanceChange as I, type WalletBalanceSample as J, type WalletCall as K, type LinkedWallet as L, type WalletCallArgument as M, type NftCollection as N, type OwnProfile as O, type ProfileAvatar as P, type WalletCallQuery as Q, type WalletDelegations as R, type SolanaIdlSource as S, type WalletDelegationsQuery as T, type WalletEventCondition as U, type WalletEventValue as V, type WalletAddressInput as W, type WalletEvents as X, type WalletEventsQuery as Y, type WalletNfts as Z, type WalletNftsQuery as _, type CosmosNetwork as a, walletDelegationsSchema as a$, type WalletTransactionsQuery as a0, cosmosDenomSchema as a1, cosmosNetworkSchema as a2, isContractCall as a3, isContractEvent as a4, isEvmChainId as a5, isNftCollection as a6, isSolanaProgram as a7, maxWalletEventLogs as a8, maxWalletEventLookback as a9, cosmosChain as aA, displayNameSchema as aB, evmAddressSchema as aC, evmChainIdSchema as aD, linkedWalletSchema as aE, managedProfileSchema as aF, ownProfileSchema as aG, profileAvatarSchema as aH, profileCompletionPageSchema as aI, profileCompletionQuerySchema as aJ, profileCompletionSchema as aK, profileDefaultProviderSchema as aL, profileDefaultsSchema as aM, profileModerationSchema as aN, profileReferralSchema as aO, profileSettingsInputSchema as aP, profileSettingsSchema as aQ, profileSummarySchema as aR, profileVisibilitySchema as aS, solanaAddressSchema as aT, solanaMainnet as aU, solanaProgramIdlSchema as aV, walletAddressInput as aW, walletBalanceSampleSchema as aX, walletBalanceSchema as aY, walletCallSchema as aZ, walletChainSchema as a_, maxWalletTransactionLookback as aa, maxWalletTransactions as ab, parseContractCall as ac, parseContractEvent as ad, parseContractFunction as ae, parseNftCollection as af, profileUpdateSchema as ag, walletAddressInputSchema as ah, walletSignatureSchema as ai, AVATAR_UPLOAD_LIMIT as aj, type AnchorIdl as ak, type KnownSolanaIdlSource as al, type ManagedProfile as am, type ProfileDefaultProvider as an, type ProfileDefaults as ao, type ProfileModeration as ap, type ProfileSettings as aq, type ProfileSettingsInput as ar, type SolanaProgramIdl as as, WALLETS_PER_CHAIN as at, anchorIdlSchema as au, avatarProviderSchema as av, avatarSeedSchema as aw, avatarUploadTypes as ax, caip10 as ay, cosmosAddressSchema as az, type ProfileCompletion as b, walletEventsSchema as b0, walletMessageChallengeSchema as b1, walletNftsSchema as b2, walletSignInFamilies as b3, walletSignInNetwork as b4, walletSignInNetworkSchema as b5, walletSignInNetworksSchema as b6, walletTransactionsSchema as b7, walletUnlinkInputSchema as b8, type ProfileCompletionPage as c, type ProfileCompletionQuery as d, type ProfileReferral as e, type ProfileSummary as f, type ProfileUpdate as g, type ProfileVisibility as h, type WalletChain as i, type WalletMessageChallenge as j, type WalletSignInNetwork as k, type WalletSignature as l, type WalletSigner as m, type WalletUnlinkInput as n, type WalletBalanceQuery as o, type ContractCall as p, type ContractEvent as q, type SolanaProgram as r, type WalletBalanceSourceQuery as s, type WalletTransaction as t, type WalletInstruction as u, type WalletReader as v, type ContractCallParts as w, type ContractCallReturnType as x, type ContractEventInput as y, type ContractEventParts as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domino-sdk/relay",
3
- "version": "1.61.0",
3
+ "version": "1.63.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -50,6 +50,10 @@
50
50
  "./testing": {
51
51
  "types": "./dist/testing.d.ts",
52
52
  "default": "./dist/testing.js"
53
+ },
54
+ "./telegram": {
55
+ "types": "./dist/telegram.d.ts",
56
+ "default": "./dist/telegram.js"
53
57
  }
54
58
  },
55
59
  "sideEffects": false,
@@ -1,306 +0,0 @@
1
- import * as z from 'zod';
2
-
3
- /** A Discord message as `ctx.discord.message()` reads it, from the project's Discord server. */
4
- declare const discordMessageSchema: z.ZodObject<{
5
- guildId: z.ZodString;
6
- channelId: z.ZodString;
7
- messageId: z.ZodString;
8
- userId: z.ZodString;
9
- content: z.ZodNullable<z.ZodString>;
10
- replyTo: z.ZodNullable<z.ZodString>;
11
- publishedAt: z.ZodNumber;
12
- }, z.core.$strict>;
13
- type DiscordMessage = z.infer<typeof discordMessageSchema>;
14
- /**
15
- * Messages posted in the project's Discord server, written by the Discord gateway. The record's
16
- * `author` is the message author's Discord account. Message text is stored only with `text: true`.
17
- * Edits update stored text. Deleting a message, or turning text off, removes retained text.
18
- */
19
- declare const discordMessagesSourceSchema: z.ZodObject<{
20
- kind: z.ZodLiteral<"discord-messages">;
21
- text: z.ZodOptional<z.ZodBoolean>;
22
- }, z.core.$strict>;
23
- /**
24
- * Reactions added in the project's Discord server, written by the Discord gateway. The record's
25
- * `author` is the reactor's Discord account and its `messageAuthor` account is the message's
26
- * author, when Discord could name it.
27
- */
28
- declare const discordReactionsSourceSchema: z.ZodObject<{
29
- kind: z.ZodLiteral<"discord-reactions">;
30
- }, z.core.$strict>;
31
- /** The `data` of a `discord.messages()` record. IDs are Discord snowflakes. */
32
- declare const discordMessageDataSchema: z.ZodObject<{
33
- guildId: z.ZodString;
34
- channelId: z.ZodString;
35
- messageId: z.ZodString;
36
- replyTo: z.ZodNullable<z.ZodString>;
37
- publishedAt: z.ZodNumber;
38
- }, z.core.$strip>;
39
- type DiscordMessageData = z.infer<typeof discordMessageDataSchema>;
40
- /**
41
- * The `data` of a `discord.messages({ text: true })` record. `text` is null when the platform's
42
- * bot does not receive message content.
43
- */
44
- declare const discordMessageTextDataSchema: z.ZodObject<{
45
- guildId: z.ZodString;
46
- channelId: z.ZodString;
47
- messageId: z.ZodString;
48
- replyTo: z.ZodNullable<z.ZodString>;
49
- publishedAt: z.ZodNumber;
50
- text: z.ZodNullable<z.ZodString>;
51
- }, z.core.$strip>;
52
- type DiscordMessageTextData = z.infer<typeof discordMessageTextDataSchema>;
53
- /** The `data` of a `discord.reactions()` record. IDs are Discord snowflakes. */
54
- declare const discordReactionDataSchema: z.ZodObject<{
55
- guildId: z.ZodString;
56
- channelId: z.ZodString;
57
- messageId: z.ZodString;
58
- emoji: z.ZodObject<{
59
- id: z.ZodNullable<z.ZodString>;
60
- name: z.ZodString;
61
- }, z.core.$strip>;
62
- reactorRoles: z.ZodArray<z.ZodString>;
63
- messagePublishedAt: z.ZodNumber;
64
- }, z.core.$strip>;
65
- type DiscordReactionData = z.infer<typeof discordReactionDataSchema>;
66
- /** Rewards and resource selectors supported by the Discord integration. */
67
- declare const discordRewardSchema: z.ZodObject<{
68
- kind: z.ZodLiteral<"integration">;
69
- provider: z.ZodLiteral<"discord">;
70
- action: z.ZodLiteral<"grant-role">;
71
- roleId: z.ZodString;
72
- }, z.core.$strict>;
73
- declare const discordResourceSourceSchema: z.ZodUnion<readonly [z.ZodObject<{
74
- provider: z.ZodLiteral<"discord">;
75
- resource: z.ZodLiteral<"channel">;
76
- types: z.ZodArray<z.ZodEnum<{
77
- text: "text";
78
- announcement: "announcement";
79
- }>>;
80
- postable: z.ZodOptional<z.ZodLiteral<true>>;
81
- }, z.core.$strict>, z.ZodObject<{
82
- provider: z.ZodLiteral<"discord">;
83
- resource: z.ZodLiteral<"role">;
84
- assignable: z.ZodDefault<z.ZodBoolean>;
85
- }, z.core.$strict>]>;
86
-
87
- /**
88
- * The Telegram sign-in a project offers, beside `providers` in `relay.auth.providers()`.
89
- *
90
- * @compat output
91
- */
92
- declare const telegramSignInMethodsSchema: z.ZodObject<{
93
- login: z.ZodBoolean;
94
- miniApp: z.ZodBoolean;
95
- }, z.core.$strip>;
96
- type TelegramSignInMethods = z.infer<typeof telegramSignInMethodsSchema>;
97
- /**
98
- * The member's Telegram account, as `AccountConnection` describes the other providers'. `subject`
99
- * is the numeric Telegram user ID; `configured` is whether Telegram Login is.
100
- *
101
- * @compat output
102
- */
103
- declare const telegramAccountConnectionSchema: z.ZodObject<{
104
- configured: z.ZodBoolean;
105
- status: z.ZodEnum<{
106
- disconnected: "disconnected";
107
- connected: "connected";
108
- reconnect: "reconnect";
109
- }>;
110
- subject: z.ZodNullable<z.ZodString>;
111
- revision: z.ZodNumber;
112
- provider: z.ZodLiteral<"telegram">;
113
- }, z.core.$strip>;
114
- type TelegramAccountConnection = z.infer<typeof telegramAccountConnectionSchema>;
115
- /** The signed launch data a Telegram Mini App receives, `Telegram.WebApp.initData`. */
116
- declare const telegramInitDataSchema: z.ZodString;
117
- /** `POST /v1/auth/telegram/mini-app`: sign in, or connect Telegram to the signed-in member. */
118
- declare const telegramMiniAppSignInSchema: z.ZodObject<{
119
- initData: z.ZodString;
120
- mode: z.ZodEnum<{
121
- "sign-in": "sign-in";
122
- connect: "connect";
123
- }>;
124
- }, z.core.$strict>;
125
- /** A Telegram chat ID as a decimal string: negative for groups, supergroups and channels. */
126
- declare const telegramChatIdSchema: z.ZodString;
127
- /**
128
- * A chat bound to the project through Domino's bot. `status` is `ready` while the bot can read
129
- * the chat as an administrator, `attention` with an `issue` once it cannot.
130
- *
131
- * @compat output
132
- */
133
- declare const telegramChatSchema: z.ZodObject<{
134
- id: z.ZodString;
135
- type: z.ZodString;
136
- title: z.ZodString;
137
- username: z.ZodNullable<z.ZodString>;
138
- status: z.ZodString;
139
- issue: z.ZodNullable<z.ZodString>;
140
- canPost: z.ZodOptional<z.ZodBoolean>;
141
- connectedAt: z.ZodNumber;
142
- }, z.core.$strip>;
143
- type TelegramChat = z.infer<typeof telegramChatSchema>;
144
- /**
145
- * The project's Telegram chats in this environment, and Domino's bot. `configured` is whether
146
- * Domino configured its bot; without it no chat can be added.
147
- *
148
- * @compat output
149
- */
150
- declare const telegramChatsSchema: z.ZodObject<{
151
- configured: z.ZodBoolean;
152
- bot: z.ZodNullable<z.ZodObject<{
153
- username: z.ZodString;
154
- }, z.core.$strip>>;
155
- chats: z.ZodArray<z.ZodObject<{
156
- id: z.ZodString;
157
- type: z.ZodString;
158
- title: z.ZodString;
159
- username: z.ZodNullable<z.ZodString>;
160
- status: z.ZodString;
161
- issue: z.ZodNullable<z.ZodString>;
162
- canPost: z.ZodOptional<z.ZodBoolean>;
163
- connectedAt: z.ZodNumber;
164
- }, z.core.$strip>>;
165
- }, z.core.$strip>;
166
- type TelegramChats = z.infer<typeof telegramChatsSchema>;
167
- /**
168
- * A chat installation in progress: open `url` in Telegram, start Domino's bot and choose the chat.
169
- * It expires at `expiresAt`, epoch milliseconds.
170
- *
171
- * @compat output
172
- */
173
- declare const telegramChatConnectionSchema: z.ZodObject<{
174
- url: z.ZodString;
175
- expiresAt: z.ZodNumber;
176
- }, z.core.$strip>;
177
- type TelegramChatConnection = z.infer<typeof telegramChatConnectionSchema>;
178
- /** `ctx.telegram.member({ chat })`: a chat the project bound, by its numeric ID or @username. */
179
- declare const telegramMemberInputSchema: z.ZodObject<{
180
- chat: z.ZodString;
181
- }, z.core.$strict>;
182
- /** A member's status in a chat as Telegram reports it; a later Telegram may add others. */
183
- type TelegramChatMemberStatus = "creator" | "administrator" | "member" | "restricted" | (string & {});
184
- /**
185
- * The member's place in a Telegram chat, read with Domino's bot when quest code asks.
186
- *
187
- * @compat output
188
- */
189
- declare const telegramChatMemberSchema: z.ZodObject<{
190
- userId: z.ZodString;
191
- username: z.ZodNullable<z.ZodString>;
192
- status: z.ZodCustom<TelegramChatMemberStatus, TelegramChatMemberStatus>;
193
- isMember: z.ZodBoolean;
194
- isAdmin: z.ZodBoolean;
195
- untilDate: z.ZodNullable<z.ZodNumber>;
196
- }, z.core.$strip>;
197
- type TelegramChatMember = z.infer<typeof telegramChatMemberSchema>;
198
- /**
199
- * Reads a chat the project connected, for the member's linked Telegram account. The account is
200
- * pinned at the attempt's first Telegram call, so later links and unlinks do not change the
201
- * attempt; each call reads the chat as it is then. A chat the project has not connected, or whose bot lost access,
202
- * throws `CapabilityError` with code `"integration-required"`; a Telegram outage throws
203
- * `"provider-unavailable"`.
204
- */
205
- interface TelegramReader {
206
- /** The member in `chat`; null when they are not in it or have not linked Telegram. */
207
- member(input: {
208
- chat: string;
209
- }): Promise<TelegramChatMember | null>;
210
- }
211
-
212
- /**
213
- * One reaction a Telegram user added to a message, as a `telegram.reactions()` record's `data`.
214
- * Every field is a scalar, so a trigger's `where` can select on it.
215
- *
216
- * @compat output
217
- */
218
- declare const telegramReactionDataSchema: z.ZodObject<{
219
- chatId: z.ZodString;
220
- chatType: z.ZodString;
221
- messageId: z.ZodNumber;
222
- reactionType: z.ZodString;
223
- emoji: z.ZodNullable<z.ZodString>;
224
- customEmojiId: z.ZodNullable<z.ZodString>;
225
- reactorStatus: z.ZodString;
226
- reactorIsAdmin: z.ZodBoolean;
227
- }, z.core.$strip>;
228
- type TelegramReactionData = z.infer<typeof telegramReactionDataSchema>;
229
-
230
- /**
231
- * One message a Telegram user posted in a connected group, as a `telegram.messages()` record's
232
- * `data`. It names the message and never holds its text. Every field is a scalar, so a trigger's
233
- * `where` can select on it.
234
- *
235
- * @compat output
236
- */
237
- declare const telegramMessageDataSchema: z.ZodObject<{
238
- chatId: z.ZodString;
239
- chatType: z.ZodString;
240
- messageId: z.ZodNumber;
241
- replyToMessageId: z.ZodNullable<z.ZodNumber>;
242
- threadId: z.ZodNullable<z.ZodNumber>;
243
- }, z.core.$strip>;
244
- type TelegramMessageData = z.infer<typeof telegramMessageDataSchema>;
245
-
246
- declare const authProviderSchema: z.ZodEnum<{
247
- discord: "discord";
248
- google: "google";
249
- apple: "apple";
250
- x: "x";
251
- }>;
252
- type AuthProvider = z.infer<typeof authProviderSchema>;
253
- declare const accountConnectionSchema: z.ZodObject<{
254
- provider: z.ZodEnum<{
255
- discord: "discord";
256
- google: "google";
257
- apple: "apple";
258
- x: "x";
259
- }>;
260
- configured: z.ZodBoolean;
261
- status: z.ZodEnum<{
262
- disconnected: "disconnected";
263
- connected: "connected";
264
- reconnect: "reconnect";
265
- }>;
266
- subject: z.ZodNullable<z.ZodString>;
267
- revision: z.ZodNumber;
268
- }, z.core.$strip>;
269
- type AccountConnection = z.infer<typeof accountConnectionSchema>;
270
- declare const discordMemberInputSchema: z.ZodObject<{}, z.core.$strict>;
271
- declare const discordMessageInputSchema: z.ZodObject<{
272
- channelId: z.ZodString;
273
- messageId: z.ZodString;
274
- }, z.core.$strict>;
275
- declare const discordMemberSchema: z.ZodObject<{
276
- userId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
277
- nickname: z.ZodDefault<z.ZodNullable<z.ZodString>>;
278
- displayName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
279
- boostingSince: z.ZodDefault<z.ZodNullable<z.ZodString>>;
280
- roles: z.ZodArray<z.ZodString>;
281
- joinedAt: z.ZodNullable<z.ZodString>;
282
- pending: z.ZodBoolean;
283
- }, z.core.$strip>;
284
- type DiscordMember = z.infer<typeof discordMemberSchema>;
285
- /**
286
- * Reads the project's connected Discord server for the member's linked Discord account. The
287
- * account and the integration are pinned at the attempt's first Discord read: later links and
288
- * unlinks do not change the attempt. Provider failures, and an integration that is not ready,
289
- * throw `CapabilityError` with code `"provider-unavailable"`.
290
- */
291
- interface DiscordReader {
292
- /** The member's server membership; null when they are not in the server or have not linked Discord. */
293
- member(): Promise<DiscordMember | null>;
294
- /**
295
- * A message in the connected server; null when it does not exist. The bot reads it, so the
296
- * member needs no linked Discord account. A channel outside the connected server, or one the
297
- * bot cannot see, throws
298
- * `CapabilityError` with code `"author-error"`.
299
- */
300
- message(input: {
301
- channelId: string;
302
- messageId: string;
303
- }): Promise<DiscordMessage | null>;
304
- }
305
-
306
- export { type AccountConnection as A, discordReactionDataSchema as B, discordResourceSourceSchema as C, type DiscordMessageData as D, discordRewardSchema as E, telegramAccountConnectionSchema as F, telegramChatConnectionSchema as G, telegramChatIdSchema as H, telegramChatSchema as I, telegramChatsSchema as J, telegramInitDataSchema as K, telegramMemberInputSchema as L, telegramMessageDataSchema as M, telegramMiniAppSignInSchema as N, telegramReactionDataSchema as O, telegramSignInMethodsSchema as P, type TelegramAccountConnection as T, type AuthProvider as a, type TelegramSignInMethods as b, type DiscordMessageTextData as c, discordMessagesSourceSchema as d, discordReactionsSourceSchema as e, type DiscordReactionData as f, type TelegramReader as g, type DiscordReader as h, type TelegramChatMember as i, type TelegramChatMemberStatus as j, type TelegramMessageData as k, type TelegramReactionData as l, discordMemberSchema as m, discordMessageSchema as n, type DiscordMember as o, type DiscordMessage as p, type TelegramChat as q, type TelegramChatConnection as r, type TelegramChats as s, telegramChatMemberSchema as t, accountConnectionSchema as u, authProviderSchema as v, discordMemberInputSchema as w, discordMessageDataSchema as x, discordMessageInputSchema as y, discordMessageTextDataSchema as z };
@@ -1,159 +0,0 @@
1
- import * as z from 'zod';
2
-
3
- declare const completionPolicySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4
- kind: z.ZodLiteral<"streak">;
5
- days: z.ZodNumber;
6
- }, z.core.$strip>, z.ZodObject<{
7
- kind: z.ZodLiteral<"progress">;
8
- goal: z.ZodObject<{
9
- kind: z.ZodLiteral<"count">;
10
- count: z.ZodNumber;
11
- }, z.core.$strict>;
12
- window: z.ZodDiscriminatedUnion<[z.ZodObject<{
13
- kind: z.ZodLiteral<"lifetime">;
14
- }, z.core.$strict>, z.ZodObject<{
15
- kind: z.ZodLiteral<"calendar">;
16
- period: z.ZodEnum<{
17
- day: "day";
18
- week: "week";
19
- month: "month";
20
- }>;
21
- latenessMs: z.ZodDefault<z.ZodNumber>;
22
- }, z.core.$strict>, z.ZodObject<{
23
- kind: z.ZodLiteral<"rolling">;
24
- durationMs: z.ZodNumber;
25
- }, z.core.$strict>], "kind">;
26
- repeat: z.ZodDefault<z.ZodEnum<{
27
- repeat: "repeat";
28
- once: "once";
29
- }>>;
30
- }, z.core.$strict>, z.ZodObject<{
31
- kind: z.ZodLiteral<"once">;
32
- }, z.core.$strict>, z.ZodObject<{
33
- kind: z.ZodLiteral<"keyed">;
34
- }, z.core.$strict>], "kind">;
35
- declare const completionKeySchema: z.ZodString;
36
- declare const budgetSchema: z.ZodObject<{
37
- id: z.ZodString;
38
- scope: z.ZodEnum<{
39
- member: "member";
40
- project: "project";
41
- }>;
42
- period: z.ZodEnum<{
43
- lifetime: "lifetime";
44
- day: "day";
45
- week: "week";
46
- month: "month";
47
- }>;
48
- limit: z.ZodNumber;
49
- cost: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
50
- balance: z.ZodString;
51
- }, z.core.$strict>]>;
52
- }, z.core.$strict>;
53
- type Budget = z.infer<typeof budgetSchema>;
54
- /**
55
- * A budget counted per tracker record author: the account that caused the record, such as a
56
- * reaction's reactor, whether or not it belongs to a member. It caps what one person gives when a
57
- * quest pays someone else. Only quests with a tracker trigger take one, in their `authorBudgets`.
58
- */
59
- declare const authorBudgetSchema: z.ZodObject<{
60
- id: z.ZodString;
61
- period: z.ZodEnum<{
62
- lifetime: "lifetime";
63
- day: "day";
64
- week: "week";
65
- month: "month";
66
- }>;
67
- limit: z.ZodNumber;
68
- cost: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
69
- balance: z.ZodString;
70
- }, z.core.$strict>]>;
71
- scope: z.ZodLiteral<"author">;
72
- }, z.core.$strict>;
73
- type AuthorBudget = z.infer<typeof authorBudgetSchema>;
74
- /**
75
- * One of the member's accepted, unrevoked quest completions, as `ctx.member.completions()` reads
76
- * it. `quest` is the quest's key and `key` the completion key. `completedAt` is when it was
77
- * recorded, in epoch milliseconds on the member's clock (a test member's advanced one); null for
78
- * older completions recorded without a time.
79
- */
80
- declare const memberCompletionSchema: z.ZodObject<{
81
- quest: z.ZodString;
82
- key: z.ZodString;
83
- completedAt: z.ZodNullable<z.ZodNumber>;
84
- }, z.core.$strip>;
85
- type MemberCompletion = z.infer<typeof memberCompletionSchema>;
86
- /** The most completions one `ctx.member.completions()` call returns, and its default `limit`. */
87
- declare const maxMemberCompletions = 100;
88
-
89
- /**
90
- * Why an evaluator capability could not answer:
91
- *
92
- * - `not-linked`: the call needs a member account that is not linked, and its result cannot be
93
- * null, such as an image check of the member's X profile picture. Readers of the member's own
94
- * accounts return `null` instead.
95
- * - `provider-unavailable`: the provider (X, Discord, a chain RPC, AI review) did not answer, or
96
- * the project's integration cannot reach it.
97
- * - `author-error`: the call cannot be answered as written: invalid input, an undeclared
98
- * integration, an unknown tracker, a chain Relay does not read, a wallet the member never
99
- * linked, or an image that does not exist.
100
- *
101
- * Later versions can add codes. Relay also sends codes this tuple does not list, as SDK 1.x keeps
102
- * it fixed:
103
- *
104
- * - `integration-required`: the project's integration needs configuration before the call can
105
- * answer.
106
- * - `capability-limit`: the evaluation run already made its eight capability calls, which all
107
- * capabilities share. Never retryable: the run makes the same calls again.
108
- *
109
- * Treat an unknown code as a failure its `message` explains.
110
- */
111
- declare const capabilityErrorCodes: readonly ["not-linked", "provider-unavailable", "author-error"];
112
- /** @compat open */
113
- type KnownCapabilityErrorCode = (typeof capabilityErrorCodes)[number];
114
- /** A known code, or one a newer Relay added. */
115
- type CapabilityErrorCode = KnownCapabilityErrorCode | (string & {});
116
- /**
117
- * A capability failure as it crosses the sandbox boundary and as Relay captures it. Open, so a
118
- * newer Relay can add codes and fields without breaking an older evaluator or Worker.
119
- */
120
- declare const capabilityFailureSchema: z.ZodObject<{
121
- code: z.ZodString;
122
- message: z.ZodString;
123
- retryable: z.ZodBoolean;
124
- }, z.core.$loose>;
125
- type CapabilityFailure = z.infer<typeof capabilityFailureSchema>;
126
- /**
127
- * Thrown by an evaluator capability (`ctx.x`, `ctx.discord`, `ctx.wallet`, `ctx.trackers`,
128
- * `ctx.images`, `ctx.review`) that could not answer. A capability whose subject is missing (an
129
- * account the member has not linked, a deleted post or message) returns `null` instead of
130
- * throwing.
131
- *
132
- * Catch it to decide yourself; rethrow anything else. An uncaught retryable error makes Relay
133
- * retry the attempt later; an uncaught one that is not retryable fails it.
134
- *
135
- * ```ts
136
- * try {
137
- * return (await ctx.x.follows({ userId })) ? decision.accept() : decision.reject({ reason })
138
- * } catch (error) {
139
- * if (error instanceof CapabilityError && error.code === "provider-unavailable")
140
- * return decision.review({ reason: "X is unavailable" })
141
- * throw error
142
- * }
143
- * ```
144
- */
145
- declare class CapabilityError extends Error {
146
- readonly code: CapabilityErrorCode;
147
- readonly retryable: boolean;
148
- constructor(code: CapabilityErrorCode, message: string, options?: {
149
- retryable?: boolean;
150
- });
151
- static [Symbol.hasInstance](value: unknown): boolean;
152
- /**
153
- * The error for a captured or transported failure. A code this SDK does not know is never
154
- * retryable: nothing tells it a retry would help.
155
- */
156
- static from(failure: CapabilityFailure): CapabilityError;
157
- }
158
-
159
- export { type AuthorBudget as A, type Budget as B, CapabilityError as C, type KnownCapabilityErrorCode as K, type MemberCompletion as M, type CapabilityErrorCode as a, type CapabilityFailure as b, capabilityErrorCodes as c, authorBudgetSchema as d, budgetSchema as e, capabilityFailureSchema as f, completionKeySchema as g, completionPolicySchema as h, maxMemberCompletions as i, memberCompletionSchema as m };