@domino-sdk/relay 1.7.0 → 1.10.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 (45) hide show
  1. package/dist/action-9Xl0StBg.d.ts +33 -0
  2. package/dist/{activity-Br6vyYze.d.ts → activity-C0O3g7VJ.d.ts} +9 -9
  3. package/dist/authoring.d.ts +12 -12
  4. package/dist/authoring.js +3 -3
  5. package/dist/{automatic-outcomes-C1Q9LrDb.d.ts → automatic-outcomes-kPIDv6X_.d.ts} +1 -1
  6. package/dist/avatar.d.ts +2 -2
  7. package/dist/browser.d.ts +9 -8
  8. package/dist/browser.js +8 -6
  9. package/dist/{capability-error-Bv996M-h.d.ts → capability-error-ty3SqD_b.d.ts} +1 -1
  10. package/dist/{chunk-KGJSKGKI.js → chunk-23JUD56J.js} +1119 -910
  11. package/dist/{chunk-ZOUEEK5L.js → chunk-7BRHUUVB.js} +83 -26
  12. package/dist/{chunk-C25TDFHN.js → chunk-BKLGWPPD.js} +48 -37
  13. package/dist/{chunk-6ON4RMEN.js → chunk-BUXNTVER.js} +1 -1
  14. package/dist/{chunk-BFZHJA2B.js → chunk-GEPSEVQO.js} +2 -2
  15. package/dist/chunk-GFAFH7XR.js +98 -0
  16. package/dist/{chunk-6RBF3UDA.js → chunk-GPS546KR.js} +232 -7
  17. package/dist/{chunk-5ECM6AWV.js → chunk-MMWTHVXW.js} +3 -3
  18. package/dist/chunk-N2HXMTVA.js +13 -0
  19. package/dist/{chunk-23QJ7WH4.js → chunk-QL77V77D.js} +1 -1
  20. package/dist/{chunk-GMPPLZKH.js → chunk-UIR6NSYZ.js} +243 -228
  21. package/dist/{chunk-JW4G3SY5.js → chunk-WRBPLXVP.js} +60 -47
  22. package/dist/{client-pfml_XAa.d.ts → client-Yq11HA_f.d.ts} +64 -43
  23. package/dist/{groups-BpWEqaPn.d.ts → groups-BK8ts2yK.d.ts} +94 -6
  24. package/dist/{images-BaKYd0fl.d.ts → images-aw6W7vFZ.d.ts} +2 -2
  25. package/dist/index.d.ts +10 -9
  26. package/dist/index.js +10 -5
  27. package/dist/internal.d.ts +3 -3
  28. package/dist/internal.js +5 -5
  29. package/dist/{offers-CYtal8jO.d.ts → offers-C2FANzrG.d.ts} +3 -3
  30. package/dist/{pages-CixTNnF4.d.ts → pages-D00JDZB-.d.ts} +70 -39
  31. package/dist/portal-proxy.js +8 -2
  32. package/dist/react/index.d.ts +203 -19
  33. package/dist/react/index.js +256 -113
  34. package/dist/{referral-reward-kinds-ClxAuCGx.d.ts → referral-reward-kinds-M3f0PdiR.d.ts} +2 -2
  35. package/dist/{schema-CQydLqw4.d.ts → schema-DEM8y8Fm.d.ts} +16 -16
  36. package/dist/schema.d.ts +11239 -13
  37. package/dist/schema.js +38 -6
  38. package/dist/server/index.d.ts +43693 -52
  39. package/dist/server/index.js +465 -53
  40. package/dist/{sign-in-options-CtXUFV7E.d.ts → sign-in-options-Coim0G1u.d.ts} +3 -3
  41. package/dist/{submission-input-CLefHTrj.d.ts → submission-input-BbBJTVlT.d.ts} +3 -3
  42. package/dist/util.d-w9f9t3ua.d.ts +5 -0
  43. package/dist/{wallet-YssWxGg8.d.ts → wallet-CDyo-U4n.d.ts} +1 -1
  44. package/package.json +1 -1
  45. package/dist/{profiles-D2aFcOxu.d.ts → profiles-BHMVj0kM.d.ts} +5 -5
@@ -1,18 +1,20 @@
1
1
  import { b as ParticipantSession, R as RelayEvent, P as ParticipantActivity, M as MemberSummary } from '../participant-activity-DkL3nY5a.js';
2
- import { g as RelayError, R as RelayClient, S as SubmissionDraft } from '../client-pfml_XAa.js';
3
- import { P as Page, j as QuestView, g as QuestOutcomeQuery, e as QuestOutcome } from '../pages-CixTNnF4.js';
2
+ import { g as RelayError, R as RelayClient, S as SubmissionDraft } from '../client-Yq11HA_f.js';
3
+ import { P as Page, j as QuestView, g as QuestOutcomeQuery, e as QuestOutcome } from '../pages-D00JDZB-.js';
4
4
  import * as react from 'react';
5
5
  import { ReactNode } from 'react';
6
- import { E as Entitlement, a as AttemptStatus, T as TieredRewardReference } from '../schema-CQydLqw4.js';
7
- import { a as AuthProvider, A as AccountConnection } from '../submission-input-CLefHTrj.js';
8
- import { c as SignInMethods, C as CosmosChains, d as SignInOption, f as SignInUnavailable, g as SignInWallet, D as DiscoveredWallet } from '../sign-in-options-CtXUFV7E.js';
9
- export { a as EmailSignInOption, O as OAuthSignInOption, b as SignInIcon, W as WalletSignInOption } from '../sign-in-options-CtXUFV7E.js';
10
- import { f as WalletSigner, d as WalletSignInNetwork, L as LinkedWallet } from '../wallet-YssWxGg8.js';
11
- import { f as LeaderboardPlacement, b5 as referralSummarySchema, e as LeaderboardPage, i as PointBalances, j as PointEntry, n as PointLedgerReference } from '../groups-BpWEqaPn.js';
12
- import { f as ProfileUpdate, e as ProfileSummary, a as ProfileCompletion, d as ProfileReferral } from '../profiles-D2aFcOxu.js';
6
+ import { J as JSONType } from '../util.d-w9f9t3ua.js';
7
+ import { E as Entitlement, a as AttemptStatus, T as TieredRewardReference } from '../schema-DEM8y8Fm.js';
8
+ import { a as AuthProvider, A as AccountConnection } from '../submission-input-BbBJTVlT.js';
9
+ import { c as SignInMethods, C as CosmosChains, d as SignInOption, f as SignInUnavailable, g as SignInWallet, D as DiscoveredWallet } from '../sign-in-options-Coim0G1u.js';
10
+ export { a as EmailSignInOption, O as OAuthSignInOption, b as SignInIcon, W as WalletSignInOption } from '../sign-in-options-Coim0G1u.js';
11
+ import { f as WalletSigner, d as WalletSignInNetwork, L as LinkedWallet } from '../wallet-CDyo-U4n.js';
12
+ import { f as LeaderboardPlacement, b7 as referralSummarySchema, e as LeaderboardPage, i as PointBalances, j as PointEntry, n as PointLedgerReference } from '../groups-BK8ts2yK.js';
13
+ import { f as ProfileUpdate, e as ProfileSummary, a as ProfileCompletion, d as ProfileReferral } from '../profiles-BHMVj0kM.js';
13
14
  import { z } from 'zod';
14
- import { O as Offer, c as Redemption } from '../offers-CYtal8jO.js';
15
+ import { O as Offer } from '../offers-C2FANzrG.js';
15
16
  import '../request-error-D_dUPLwo.js';
17
+ import '../action-9Xl0StBg.js';
16
18
 
17
19
  /**
18
20
  * A query's identity: plain JSON values, outermost group first, such as
@@ -143,6 +145,26 @@ declare function useActivity(options?: {
143
145
  intervalMs?: number;
144
146
  }): MemberQuery<ParticipantActivity>;
145
147
 
148
+ type RelayActionResult<T> = {
149
+ ok: true;
150
+ value: T;
151
+ } | {
152
+ ok: false;
153
+ };
154
+ /**
155
+ * One logical mutation at a time, with a key and exact callback retained across uncertain errors.
156
+ * `run` and `retry` never reject; their result distinguishes success from failure, including a
157
+ * successful null value. A failure appears in `error`. Pass a client or
158
+ * session as `scope` to isolate actions when the signed-in member or project changes.
159
+ */
160
+ declare function useRelayAction<T = unknown>(scope?: unknown): {
161
+ run: (task?: (actionId: string) => Promise<T>) => Promise<RelayActionResult<T>>;
162
+ retry: () => Promise<RelayActionResult<T>>;
163
+ settle: () => boolean;
164
+ busy: boolean;
165
+ error: RelayError | null;
166
+ };
167
+
146
168
  type Collection = {
147
169
  id: string;
148
170
  /** The collection's authoring key, when it has one. */
@@ -217,10 +239,6 @@ declare const relayKeys: {
217
239
  readonly offers: readonly ["offers"];
218
240
  };
219
241
 
220
- type JSONType = string | number | boolean | null | JSONType[] | {
221
- [key: string]: JSONType;
222
- };
223
-
224
242
  /** Earned tiers and pickup/collection state, scoped to the current session. */
225
243
  declare function useEntitlements(options?: QueryOptions): MemberQuery<{
226
244
  items: ({
@@ -754,7 +772,7 @@ declare function useQuest(observed: QuestView): {
754
772
  };
755
773
  availability: {
756
774
  kind: "available";
757
- input: "text" | "none" | "url" | "quiz" | "photo";
775
+ input: "url" | "text" | "none" | "quiz" | "photo";
758
776
  } | {
759
777
  kind: "completed";
760
778
  } | {
@@ -947,7 +965,7 @@ declare function useQuest(observed: QuestView): {
947
965
  } | undefined;
948
966
  } | null;
949
967
  release: string;
950
- interaction: "text" | "staff" | "claim" | "automatic" | "url" | "quiz" | "photo";
968
+ interaction: "url" | "text" | "staff" | "claim" | "automatic" | "quiz" | "photo";
951
969
  lifecycle: "paused" | "active" | "archived";
952
970
  rewards: ({
953
971
  kind: "points";
@@ -1226,6 +1244,8 @@ declare function useAccounts(): {
1226
1244
  disconnect: (provider: AuthProvider) => Promise<boolean>;
1227
1245
  busy: boolean;
1228
1246
  actionError: RelayError | null;
1247
+ retry: () => Promise<boolean>;
1248
+ settle: () => boolean;
1229
1249
  isConnected: (provider: AuthProvider) => boolean;
1230
1250
  status: "loading";
1231
1251
  data: undefined;
@@ -1236,6 +1256,8 @@ declare function useAccounts(): {
1236
1256
  disconnect: (provider: AuthProvider) => Promise<boolean>;
1237
1257
  busy: boolean;
1238
1258
  actionError: RelayError | null;
1259
+ retry: () => Promise<boolean>;
1260
+ settle: () => boolean;
1239
1261
  isConnected: (provider: AuthProvider) => boolean;
1240
1262
  status: "error";
1241
1263
  data: undefined;
@@ -1246,6 +1268,8 @@ declare function useAccounts(): {
1246
1268
  disconnect: (provider: AuthProvider) => Promise<boolean>;
1247
1269
  busy: boolean;
1248
1270
  actionError: RelayError | null;
1271
+ retry: () => Promise<boolean>;
1272
+ settle: () => boolean;
1249
1273
  isConnected: (provider: AuthProvider) => boolean;
1250
1274
  status: "signed-out";
1251
1275
  data: undefined;
@@ -1256,6 +1280,8 @@ declare function useAccounts(): {
1256
1280
  disconnect: (provider: AuthProvider) => Promise<boolean>;
1257
1281
  busy: boolean;
1258
1282
  actionError: RelayError | null;
1283
+ retry: () => Promise<boolean>;
1284
+ settle: () => boolean;
1259
1285
  isConnected: (provider: AuthProvider) => boolean;
1260
1286
  status: "ready";
1261
1287
  data: {
@@ -1283,6 +1309,8 @@ declare function useWallets(): {
1283
1309
  unlink: (wallet: Pick<LinkedWallet, "chain" | "address">) => Promise<boolean>;
1284
1310
  busy: boolean;
1285
1311
  actionError: RelayError | null;
1312
+ retry: () => Promise<boolean>;
1313
+ settle: () => boolean;
1286
1314
  status: "loading";
1287
1315
  data: undefined;
1288
1316
  error: null;
@@ -1293,6 +1321,8 @@ declare function useWallets(): {
1293
1321
  unlink: (wallet: Pick<LinkedWallet, "chain" | "address">) => Promise<boolean>;
1294
1322
  busy: boolean;
1295
1323
  actionError: RelayError | null;
1324
+ retry: () => Promise<boolean>;
1325
+ settle: () => boolean;
1296
1326
  status: "error";
1297
1327
  data: undefined;
1298
1328
  error: RelayError;
@@ -1303,6 +1333,8 @@ declare function useWallets(): {
1303
1333
  unlink: (wallet: Pick<LinkedWallet, "chain" | "address">) => Promise<boolean>;
1304
1334
  busy: boolean;
1305
1335
  actionError: RelayError | null;
1336
+ retry: () => Promise<boolean>;
1337
+ settle: () => boolean;
1306
1338
  status: "signed-out";
1307
1339
  data: undefined;
1308
1340
  error: null;
@@ -1313,6 +1345,8 @@ declare function useWallets(): {
1313
1345
  unlink: (wallet: Pick<LinkedWallet, "chain" | "address">) => Promise<boolean>;
1314
1346
  busy: boolean;
1315
1347
  actionError: RelayError | null;
1348
+ retry: () => Promise<boolean>;
1349
+ settle: () => boolean;
1316
1350
  status: "ready";
1317
1351
  data: {
1318
1352
  chain: "solana" | "eip155" | "cosmos";
@@ -1367,6 +1401,8 @@ declare function useMyProfile(): {
1367
1401
  uploadAvatar: (file: Blob) => Promise<boolean>;
1368
1402
  busy: boolean;
1369
1403
  actionError: RelayError | null;
1404
+ retry: () => Promise<boolean>;
1405
+ settle: () => boolean;
1370
1406
  status: "loading";
1371
1407
  data: undefined;
1372
1408
  error: null;
@@ -1377,6 +1413,8 @@ declare function useMyProfile(): {
1377
1413
  uploadAvatar: (file: Blob) => Promise<boolean>;
1378
1414
  busy: boolean;
1379
1415
  actionError: RelayError | null;
1416
+ retry: () => Promise<boolean>;
1417
+ settle: () => boolean;
1380
1418
  status: "error";
1381
1419
  data: undefined;
1382
1420
  error: RelayError;
@@ -1387,6 +1425,8 @@ declare function useMyProfile(): {
1387
1425
  uploadAvatar: (file: Blob) => Promise<boolean>;
1388
1426
  busy: boolean;
1389
1427
  actionError: RelayError | null;
1428
+ retry: () => Promise<boolean>;
1429
+ settle: () => boolean;
1390
1430
  status: "signed-out";
1391
1431
  data: undefined;
1392
1432
  error: null;
@@ -1397,6 +1437,8 @@ declare function useMyProfile(): {
1397
1437
  uploadAvatar: (file: Blob) => Promise<boolean>;
1398
1438
  busy: boolean;
1399
1439
  actionError: RelayError | null;
1440
+ retry: () => Promise<boolean>;
1441
+ settle: () => boolean;
1400
1442
  status: "ready";
1401
1443
  data: {
1402
1444
  id: string;
@@ -1419,7 +1461,7 @@ declare function useMyProfile(): {
1419
1461
  avatarProvider: "discord" | "x" | "google" | null;
1420
1462
  hidden: boolean;
1421
1463
  locked: boolean;
1422
- visibility: "private" | "participants" | "public";
1464
+ visibility: "public" | "private" | "participants";
1423
1465
  options: {
1424
1466
  provider: "discord" | "x" | "google";
1425
1467
  name: string | null;
@@ -1562,7 +1604,149 @@ declare function useQuestOutcomes(query?: Omit<QuestOutcomeQuery, "cursor">): Me
1562
1604
  declare function useOffers(): Query<Offer[]>;
1563
1605
  /** Redeem an offer, then refresh offers and point balances. */
1564
1606
  declare function useRedeemOffer(): {
1565
- redeem: (offer: string) => Promise<Redemption | null>;
1607
+ redeem: (offer: string) => Promise<{
1608
+ status: "fulfilled";
1609
+ id: string;
1610
+ offer: string;
1611
+ member: string;
1612
+ reservation: string;
1613
+ price: {
1614
+ kind: "points";
1615
+ balance: string;
1616
+ amount: number;
1617
+ };
1618
+ reward: {
1619
+ kind: "tier";
1620
+ reward: {
1621
+ id: string;
1622
+ title: string;
1623
+ tiers: {
1624
+ id: string;
1625
+ title: string;
1626
+ }[];
1627
+ inventory: {
1628
+ kind: "untracked";
1629
+ };
1630
+ fulfillment: {
1631
+ kind: "staff-handover";
1632
+ } | {
1633
+ kind: "automatic";
1634
+ };
1635
+ };
1636
+ tier: string;
1637
+ };
1638
+ entitlement: string;
1639
+ revision: number;
1640
+ redeemedAt: number;
1641
+ } | {
1642
+ status: "canceled";
1643
+ canceledAt: number;
1644
+ reason: string;
1645
+ id: string;
1646
+ offer: string;
1647
+ member: string;
1648
+ reservation: string;
1649
+ price: {
1650
+ kind: "points";
1651
+ balance: string;
1652
+ amount: number;
1653
+ };
1654
+ reward: {
1655
+ kind: "tier";
1656
+ reward: {
1657
+ id: string;
1658
+ title: string;
1659
+ tiers: {
1660
+ id: string;
1661
+ title: string;
1662
+ }[];
1663
+ inventory: {
1664
+ kind: "untracked";
1665
+ };
1666
+ fulfillment: {
1667
+ kind: "staff-handover";
1668
+ } | {
1669
+ kind: "automatic";
1670
+ };
1671
+ };
1672
+ tier: string;
1673
+ };
1674
+ entitlement: string;
1675
+ revision: number;
1676
+ redeemedAt: number;
1677
+ } | null>;
1678
+ retry: () => Promise<{
1679
+ status: "fulfilled";
1680
+ id: string;
1681
+ offer: string;
1682
+ member: string;
1683
+ reservation: string;
1684
+ price: {
1685
+ kind: "points";
1686
+ balance: string;
1687
+ amount: number;
1688
+ };
1689
+ reward: {
1690
+ kind: "tier";
1691
+ reward: {
1692
+ id: string;
1693
+ title: string;
1694
+ tiers: {
1695
+ id: string;
1696
+ title: string;
1697
+ }[];
1698
+ inventory: {
1699
+ kind: "untracked";
1700
+ };
1701
+ fulfillment: {
1702
+ kind: "staff-handover";
1703
+ } | {
1704
+ kind: "automatic";
1705
+ };
1706
+ };
1707
+ tier: string;
1708
+ };
1709
+ entitlement: string;
1710
+ revision: number;
1711
+ redeemedAt: number;
1712
+ } | {
1713
+ status: "canceled";
1714
+ canceledAt: number;
1715
+ reason: string;
1716
+ id: string;
1717
+ offer: string;
1718
+ member: string;
1719
+ reservation: string;
1720
+ price: {
1721
+ kind: "points";
1722
+ balance: string;
1723
+ amount: number;
1724
+ };
1725
+ reward: {
1726
+ kind: "tier";
1727
+ reward: {
1728
+ id: string;
1729
+ title: string;
1730
+ tiers: {
1731
+ id: string;
1732
+ title: string;
1733
+ }[];
1734
+ inventory: {
1735
+ kind: "untracked";
1736
+ };
1737
+ fulfillment: {
1738
+ kind: "staff-handover";
1739
+ } | {
1740
+ kind: "automatic";
1741
+ };
1742
+ };
1743
+ tier: string;
1744
+ };
1745
+ entitlement: string;
1746
+ revision: number;
1747
+ redeemedAt: number;
1748
+ } | null>;
1749
+ settle: () => boolean;
1566
1750
  busy: boolean;
1567
1751
  error: RelayError | null;
1568
1752
  };
@@ -1584,4 +1768,4 @@ declare function usePointLedgers(): Query<PointLedgerReference[]>;
1584
1768
  */
1585
1769
  declare function useTieredRewards(): Query<TieredRewardReference[]>;
1586
1770
 
1587
- export { type Collection, CosmosChains, DiscoveredWallet, type ExperienceData, type Invitation, type KnownQuestStatusCode, type KnownRoleDeliveryStatus, type MemberPagedQuery, type MemberQuery, type MemberSnapshot, type OAuthProvider, Page, type PageLoader, type PageRead, type PagedQuery, type Query, type QueryContext, type QueryKey, type QueryOptions, type QueryRead, type QuerySnapshot, type QuestInput, type QuestNotice, type QuestStatus, type QuestStatusCode, type QuestStatusText, type QuestTone, type ReferralSummary, RelayClient, RelayProvider, type RoleDelivery, type RoleDeliveryStatus, type SavedSubmission, SignInMethods, SignInOption, SignInUnavailable, SignInWallet, canRepeat, canSubmit, captureReferralCode, completionCountText, isAutomatic, isConnected, isFinished, progressOf, questGroups, questStatus, questStatusText, relayKeys, roleDeliveryLabel, roleDeliveryStatus, useAccounts, useActivity, useBalances, useDeliveries, useEntitlements, useExperience, useInvalidate, useInvitation, useLeaderboard, useLeaderboardPlacement, useMe, useMemberPages, useMemberQuery, useMyProfile, useOffers, usePointHistory, usePointLedgers, useProfile, useProfileCompletions, useProfileReferral, useQuest, useQuestOutcomes, useRedeemOffer, useReferralSummary, useRelay, useRelayPages, useRelayQuery, useSession, useSignIn, useSignInMethods, useSignInOptions, useSignInWallets, useSignOut, useTieredRewards, useWalletDiscovery, useWallets };
1771
+ export { type Collection, CosmosChains, DiscoveredWallet, type ExperienceData, type Invitation, type KnownQuestStatusCode, type KnownRoleDeliveryStatus, type MemberPagedQuery, type MemberQuery, type MemberSnapshot, type OAuthProvider, Page, type PageLoader, type PageRead, type PagedQuery, type Query, type QueryContext, type QueryKey, type QueryOptions, type QueryRead, type QuerySnapshot, type QuestInput, type QuestNotice, type QuestStatus, type QuestStatusCode, type QuestStatusText, type QuestTone, type ReferralSummary, type RelayActionResult, RelayClient, RelayProvider, type RoleDelivery, type RoleDeliveryStatus, type SavedSubmission, SignInMethods, SignInOption, SignInUnavailable, SignInWallet, canRepeat, canSubmit, captureReferralCode, completionCountText, isAutomatic, isConnected, isFinished, progressOf, questGroups, questStatus, questStatusText, relayKeys, roleDeliveryLabel, roleDeliveryStatus, useAccounts, useActivity, useBalances, useDeliveries, useEntitlements, useExperience, useInvalidate, useInvitation, useLeaderboard, useLeaderboardPlacement, useMe, useMemberPages, useMemberQuery, useMyProfile, useOffers, usePointHistory, usePointLedgers, useProfile, useProfileCompletions, useProfileReferral, useQuest, useQuestOutcomes, useRedeemOffer, useReferralSummary, useRelay, useRelayAction, useRelayPages, useRelayQuery, useSession, useSignIn, useSignInMethods, useSignInOptions, useSignInWallets, useSignOut, useTieredRewards, useWalletDiscovery, useWallets };