@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.
- package/CHANGELOG.md +276 -8
- package/README.md +3 -2
- package/dist/{schema-CZ6Rj0ZF.d.ts → accounts-nz3mzfRQ.d.ts} +3146 -1765
- package/dist/action-9Xl0StBg.d.ts +33 -0
- package/dist/{attempt-captures-DYnJVkfg.d.ts → attempt-captures-DMi8oR9T.d.ts} +1 -1
- package/dist/authoring.d.ts +171 -49
- package/dist/authoring.js +158 -49
- package/dist/{automatic-outcomes-If88LR9f.d.ts → automatic-outcomes-C_LLQU1p.d.ts} +15 -1
- package/dist/avatar.d.ts +1 -1
- package/dist/browser.d.ts +15 -11
- package/dist/browser.js +18 -12
- package/dist/capability-error-CuI_F7yM.d.ts +296 -0
- package/dist/{pages-K7-KjSXw.d.ts → catalog-BaTOKpNw.d.ts} +56 -567
- package/dist/{chunk-XBV2CK2H.js → chunk-3RFP6GT5.js} +15 -3
- package/dist/{chunk-VURRFVNP.js → chunk-4GQW43UU.js} +239 -361
- package/dist/chunk-4NOFSGAL.js +320 -0
- package/dist/{chunk-24I4R732.js → chunk-5XLZ34PV.js} +34 -19
- package/dist/{chunk-L77O64I4.js → chunk-7X67QLPB.js} +43 -43
- package/dist/{chunk-RHBS5FJL.js → chunk-7Z4SZ6YM.js} +3 -3
- package/dist/{chunk-QEAS4ZGS.js → chunk-AQOL3SK5.js} +1 -1
- package/dist/chunk-EHUSD3O2.js +377 -0
- package/dist/chunk-FO2LCZTL.js +19 -0
- package/dist/{chunk-DYXDZFKA.js → chunk-FU5CGNTR.js} +166 -178
- package/dist/chunk-FWLQ5XCS.js +21 -0
- package/dist/chunk-GLH6MEI2.js +193 -0
- package/dist/chunk-ICXZZNPS.js +199 -0
- package/dist/{chunk-ZDJLPN4L.js → chunk-ID3BZXFZ.js} +2696 -2693
- package/dist/chunk-KP2MCX3R.js +587 -0
- package/dist/{chunk-SKGTNTLF.js → chunk-LZWXCBUB.js} +213 -297
- package/dist/chunk-MTKRIQEU.js +31 -0
- package/dist/{chunk-4OC7REYX.js → chunk-MWMCQLCG.js} +3 -3
- package/dist/{chunk-PPB7HALD.js → chunk-N4BDKS6Y.js} +27 -26
- package/dist/{chunk-5I54XBK2.js → chunk-N4LNEGQX.js} +2 -2
- package/dist/chunk-NQDEWJWE.js +554 -0
- package/dist/chunk-QR6HH4DI.js +508 -0
- package/dist/chunk-TLSQETTY.js +41 -0
- package/dist/{chunk-MHPKEVEW.js → chunk-U66GUVSG.js} +7 -2
- package/dist/{chunk-KDR2VAJP.js → chunk-UYVJZR33.js} +2 -2
- package/dist/chunk-UZ765UGH.js +18 -0
- package/dist/{chunk-7A4J67ZL.js → chunk-VWQGWGCH.js} +7 -7
- package/dist/chunk-W7YSMSGC.js +725 -0
- package/dist/{client-C51w7fMb.d.ts → client-DHmG7rn6.d.ts} +126 -93
- package/dist/{announcements-CHx3-HBw.d.ts → dashboards-CLemT6kj.d.ts} +14 -137
- package/dist/{deployments-kWoHFaqj.d.ts → deployments-DTULi7dF.d.ts} +450 -18
- package/dist/identity-integration-DOeNZaxF.d.ts +1271 -0
- package/dist/index.d.ts +13 -11
- package/dist/index.js +16 -11
- package/dist/internal.d.ts +29 -13
- package/dist/internal.js +57 -17
- package/dist/{integrations-B3y36OaB.d.ts → limits-kNzYdZ00.d.ts} +464 -53
- package/dist/{offers-BoV4ryUc.d.ts → offers-CYeN_I0Y.d.ts} +22 -4
- package/dist/{participant-activity-DHL8QYks.d.ts → participant-activity-D-Drp24G.d.ts} +16 -3
- package/dist/portal-proxy.d.ts +75 -2
- package/dist/portal-proxy.js +153 -25
- package/dist/react/index.d.ts +214 -27
- package/dist/react/index.js +196 -42
- package/dist/{action-DBzILFx9.d.ts → request-error-D_dUPLwo.d.ts} +1 -31
- package/dist/reward-deliveries-drp-x1G-.d.ts +782 -0
- package/dist/runtime/authoring.js +1 -1
- package/dist/runtime/chunks/UGDV5W4N.js +1 -0
- package/dist/runtime/manifest.json +3 -3
- package/dist/runtime/schema.js +1 -1
- package/dist/schema.d.ts +330 -31
- package/dist/schema.js +147 -91
- package/dist/server/index.d.ts +14 -12
- package/dist/server/index.js +6425 -6260
- package/dist/sign-in-providers-B1Q9eDRm.d.ts +44 -0
- package/dist/submission-input-DZCbjQUH.d.ts +343 -0
- package/dist/{telegram-browser-BUceZIGZ.d.ts → telegram-browser-NL0Asmsi.d.ts} +46 -6
- package/dist/telegram.d.ts +64 -0
- package/dist/telegram.js +23 -0
- package/dist/testing.d.ts +326 -27
- package/dist/testing.js +440 -90
- package/dist/tracker-data-esm3WG8R.d.ts +1881 -0
- package/dist/{transport-BrX9pIGN.d.ts → transport-Czht_irp.d.ts} +43483 -38512
- package/dist/{wallet-CIqFoxdm.d.ts → wallet-B7e06v4m.d.ts} +32 -9
- package/package.json +5 -1
- package/dist/accounts-DoabriBX.d.ts +0 -306
- package/dist/capability-error-DufwG3G0.d.ts +0 -159
- package/dist/chunk-3Y3L2F54.js +0 -982
- package/dist/chunk-DHXDBAJF.js +0 -544
- package/dist/chunk-EN3M5Z4J.js +0 -13
- package/dist/chunk-QNUHWK7R.js +0 -602
- package/dist/chunk-SE4PFJPT.js +0 -247
- package/dist/groups-CqcA2Ycs.d.ts +0 -2827
- package/dist/runtime/chunks/5QVFB4TU.js +0 -1
- package/dist/submission-input-C54Q8yAD.d.ts +0 -146
- package/dist/x-D1PGi8Sq.d.ts +0 -331
package/dist/react/index.d.ts
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import { B as Badge,
|
|
2
|
-
import { b as ParticipantSession, R as RelayEvent, P as ParticipantActivity, M as MemberSummary } from '../participant-activity-
|
|
3
|
-
import { g as RelayError, R as RelayClient, m as SubmissionDraft } from '../client-
|
|
4
|
-
import { P as Page,
|
|
5
|
-
export { C as
|
|
1
|
+
import { B as Badge, c as MemberBadges, O as Offer, f as Redemption } from '../offers-CYeN_I0Y.js';
|
|
2
|
+
import { b as ParticipantSession, R as RelayEvent, P as ParticipantActivity, M as MemberSummary } from '../participant-activity-D-Drp24G.js';
|
|
3
|
+
import { g as RelayError, R as RelayClient, m as SubmissionDraft } from '../client-DHmG7rn6.js';
|
|
4
|
+
import { P as Page, u as RewardDeliveryAction, e as CreatorAccountProvider, K as KnownConsentChannel, M as MemberConsent, n as QuestOutcomeQuery, l as QuestOutcome } from '../reward-deliveries-drp-x1G-.js';
|
|
5
|
+
export { C as ConsentChannel, b as ConsentSource, c as ConsentState, d as CreatorAccount, f as CreatorAccounts, g as KnownConsentSource, h as KnownConsentState } from '../reward-deliveries-drp-x1G-.js';
|
|
6
6
|
import * as react from 'react';
|
|
7
7
|
import { ReactNode } from 'react';
|
|
8
8
|
import * as z from 'zod';
|
|
9
9
|
import { z as z$1 } from 'zod';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
export {
|
|
13
|
-
import { c as SignInMethods, C as CosmosChains, d as SignInOption, f as SignInUnavailable, T as TelegramSignInOption, g as SignInWallet, D as DiscoveredWallet } from '../telegram-browser-
|
|
14
|
-
export { a as EmailSignInOption, O as OAuthSignInOption, b as SignInIcon, W as WalletSignInOption, t as telegramMiniAppInitData } from '../telegram-browser-
|
|
15
|
-
import { m as WalletSigner, k as WalletSignInNetwork, L as LinkedWallet, g as ProfileUpdate, f as ProfileSummary, b as ProfileCompletion, e as ProfileReferral } from '../wallet-
|
|
16
|
-
|
|
17
|
-
import '../
|
|
18
|
-
import '../
|
|
10
|
+
import { l as collectionViewSchema, b as QuestView } from '../catalog-BaTOKpNw.js';
|
|
11
|
+
import { E as Entitlement, b as AttemptStatus, V as AttemptCodeSource, c as AuthProvider, J as SignInProvider, A as AccountConnection, I as SignInAccountStatus, p as LeaderboardPlacement, dL as referralSummarySchema, o as LeaderboardPage, u as PointEntry, t as PointBalances, y as PointLedgerReference, U as TieredRewardReference } from '../accounts-nz3mzfRQ.js';
|
|
12
|
+
export { S as SignInAccount, N as SignInProviderOption } from '../accounts-nz3mzfRQ.js';
|
|
13
|
+
import { c as SignInMethods, C as CosmosChains, d as SignInOption, P as ProviderSignInOption, f as SignInUnavailable, T as TelegramSignInOption, g as SignInWallet, D as DiscoveredWallet } from '../telegram-browser-NL0Asmsi.js';
|
|
14
|
+
export { a as EmailSignInOption, O as OAuthSignInOption, b as SignInIcon, W as WalletSignInOption, t as telegramMiniAppInitData } from '../telegram-browser-NL0Asmsi.js';
|
|
15
|
+
import { m as WalletSigner, k as WalletSignInNetwork, L as LinkedWallet, g as ProfileUpdate, f as ProfileSummary, b as ProfileCompletion, e as ProfileReferral } from '../wallet-B7e06v4m.js';
|
|
16
|
+
export { T as TelegramAccountConnection, a as TelegramSignInMethods } from '../submission-input-DZCbjQUH.js';
|
|
17
|
+
import '../tracker-data-esm3WG8R.js';
|
|
18
|
+
import '../request-error-D_dUPLwo.js';
|
|
19
|
+
import '../action-9Xl0StBg.js';
|
|
20
|
+
import '../sign-in-providers-B1Q9eDRm.js';
|
|
19
21
|
|
|
20
22
|
/**
|
|
21
23
|
* A query's identity: plain JSON values, outermost group first, such as
|
|
@@ -340,13 +342,20 @@ declare function useRelay(): RelayClient;
|
|
|
340
342
|
* experience every `polling.snapshotMs` (30 seconds), for changes no event announces and as the
|
|
341
343
|
* fallback when the feed is unavailable. A new `polling` value takes effect like a new client.
|
|
342
344
|
*
|
|
345
|
+
* After a wallet sign-in, the provider follows the wallet: when it switches to another account or
|
|
346
|
+
* locks, the member is signed out, so the page never shows one account's progress beside another
|
|
347
|
+
* account's wallet. Pass `followWallet={false}` to keep the session until the member signs out,
|
|
348
|
+
* for an app that handles `accountsChanged` itself.
|
|
349
|
+
*
|
|
343
350
|
* On a staging host, Domino's test toolbar fires `domino:test-state-changed` on `window` after it
|
|
344
351
|
* changes test data under the page; the provider then reads the session and every query again.
|
|
345
352
|
*/
|
|
346
|
-
declare function RelayProvider({ client, baseUrl, polling, children, }: {
|
|
353
|
+
declare function RelayProvider({ client, baseUrl, polling, followWallet, children, }: {
|
|
347
354
|
client?: RelayClient;
|
|
348
355
|
baseUrl?: string;
|
|
349
356
|
polling?: RelayPolling;
|
|
357
|
+
/** Sign the member out when the wallet they signed in with switches account or locks. Default true. */
|
|
358
|
+
followWallet?: boolean;
|
|
350
359
|
children: ReactNode;
|
|
351
360
|
}): react.JSX.Element;
|
|
352
361
|
|
|
@@ -360,12 +369,14 @@ declare const relayKeys: {
|
|
|
360
369
|
readonly experience: readonly ["experience"];
|
|
361
370
|
/** `useMe`. */
|
|
362
371
|
readonly me: readonly ["me"];
|
|
363
|
-
/** `useAccounts`. */
|
|
372
|
+
/** `useAccounts`, `useAccount`, `useTelegramAccount`, `useCreatorAccounts`. */
|
|
364
373
|
readonly accounts: readonly ["accounts"];
|
|
365
374
|
/** `useWallets`. */
|
|
366
375
|
readonly wallets: readonly ["wallets"];
|
|
367
376
|
/** `useMyProfile`, `useProfile`, `useProfileCompletions`, `useProfileReferral`. */
|
|
368
377
|
readonly profiles: readonly ["profiles"];
|
|
378
|
+
/** `useConsent`. */
|
|
379
|
+
readonly consent: readonly ["consent"];
|
|
369
380
|
/** `useLeaderboard`, `useLeaderboardPlacement`, `useLeaderboardHistory`. */
|
|
370
381
|
readonly leaderboards: readonly ["leaderboards"];
|
|
371
382
|
/** `useReferralSummary`. */
|
|
@@ -759,12 +770,17 @@ declare function useDeliveries(options?: QueryOptions): MemberQuery<{
|
|
|
759
770
|
}>;
|
|
760
771
|
|
|
761
772
|
/**
|
|
762
|
-
* All a participant sees of a
|
|
763
|
-
*
|
|
773
|
+
* All a participant sees of a Discord role Domino grants for a quest. Attempts,
|
|
774
|
+
* errors, and role IDs stay out of the page.
|
|
764
775
|
*/
|
|
765
776
|
type RoleDelivery = {
|
|
766
777
|
quest: string;
|
|
767
778
|
status: string;
|
|
779
|
+
/**
|
|
780
|
+
* Raw rows from `me.rewardDeliveries()` carry it; only `grant-role` rows are
|
|
781
|
+
* roles. Rows without it count as roles.
|
|
782
|
+
*/
|
|
783
|
+
action?: RewardDeliveryAction;
|
|
768
784
|
revokedAt?: number | null;
|
|
769
785
|
reconciliation?: {
|
|
770
786
|
status: string;
|
|
@@ -775,8 +791,10 @@ type KnownRoleDeliveryStatus = "pending" | "failed" | "granted";
|
|
|
775
791
|
/** Where one quest's role deliveries stand, as a code an app can localize; open for new codes. */
|
|
776
792
|
type RoleDeliveryStatus = KnownRoleDeliveryStatus | (string & {});
|
|
777
793
|
/**
|
|
778
|
-
* Where one quest's roles stand, or null when it
|
|
779
|
-
*
|
|
794
|
+
* Where one quest's roles stand, or null when it grants no role. Takes rows from
|
|
795
|
+
* `useExperience` or raw `me.rewardDeliveries()` rows; announcement rows never
|
|
796
|
+
* count. This never changes whether the quest is completed: the role follows
|
|
797
|
+
* the completion.
|
|
780
798
|
* `failed` means Domino gave up; only the organizer can grant the role now.
|
|
781
799
|
*/
|
|
782
800
|
declare function roleDeliveryStatus(deliveries: readonly RoleDelivery[], quest: string): RoleDeliveryStatus | null;
|
|
@@ -787,7 +805,7 @@ declare function roleDeliveryLabel(status: RoleDeliveryStatus | null): "Role del
|
|
|
787
805
|
* The signed-in participant's quests and collections, polled for the whole app by one observer,
|
|
788
806
|
* which pauses while the tab is hidden. `data` holds `quests` and `collections`; `signed-out`
|
|
789
807
|
* means nobody is signed in. `deliveries` lists Discord roles earned from quests and whether each
|
|
790
|
-
* has arrived yet.
|
|
808
|
+
* has arrived yet; announcement (`post-message`) deliveries are left out.
|
|
791
809
|
*/
|
|
792
810
|
declare function useExperience(): MemberQuery<ExperienceData> & {
|
|
793
811
|
deliveries: readonly RoleDelivery[];
|
|
@@ -1017,6 +1035,7 @@ declare function useQuest(observed: QuestView): {
|
|
|
1017
1035
|
kind: "once";
|
|
1018
1036
|
} | {
|
|
1019
1037
|
kind: "keyed";
|
|
1038
|
+
across?: "members" | undefined;
|
|
1020
1039
|
};
|
|
1021
1040
|
progress: {
|
|
1022
1041
|
current: number;
|
|
@@ -1138,6 +1157,7 @@ declare function useQuest(observed: QuestView): {
|
|
|
1138
1157
|
};
|
|
1139
1158
|
release?: string | undefined;
|
|
1140
1159
|
} | undefined;
|
|
1160
|
+
codeSource?: AttemptCodeSource | null | undefined;
|
|
1141
1161
|
} | null;
|
|
1142
1162
|
release: string;
|
|
1143
1163
|
interaction: "url" | "text" | "staff" | "claim" | "automatic" | "quiz" | "photo";
|
|
@@ -1461,6 +1481,7 @@ declare function useQuestAction(observed: QuestView): {
|
|
|
1461
1481
|
kind: "once";
|
|
1462
1482
|
} | {
|
|
1463
1483
|
kind: "keyed";
|
|
1484
|
+
across?: "members" | undefined;
|
|
1464
1485
|
};
|
|
1465
1486
|
progress: {
|
|
1466
1487
|
current: number;
|
|
@@ -1582,6 +1603,7 @@ declare function useQuestAction(observed: QuestView): {
|
|
|
1582
1603
|
};
|
|
1583
1604
|
release?: string | undefined;
|
|
1584
1605
|
} | undefined;
|
|
1606
|
+
codeSource?: AttemptCodeSource | null | undefined;
|
|
1585
1607
|
} | null;
|
|
1586
1608
|
release: string;
|
|
1587
1609
|
interaction: "url" | "text" | "staff" | "claim" | "automatic" | "quiz" | "photo";
|
|
@@ -1865,18 +1887,26 @@ declare function useSignIn(): {
|
|
|
1865
1887
|
sendCode: (email: string) => Promise<void>;
|
|
1866
1888
|
verifyCode: (code: string) => Promise<void>;
|
|
1867
1889
|
startOver: () => void;
|
|
1868
|
-
|
|
1890
|
+
/**
|
|
1891
|
+
* Leaves for the provider's consent screen: any of `providers().signInProviders`, Telegram
|
|
1892
|
+
* included.
|
|
1893
|
+
*/
|
|
1894
|
+
withProvider: (provider: SignInProvider) => Promise<void>;
|
|
1869
1895
|
/**
|
|
1870
1896
|
* Signs in, or signs up, with a wallet; the wallet asks the participant to sign a message. A
|
|
1871
1897
|
* wallet that can watch its accounts, such as an EVM browser wallet, is followed: switching
|
|
1872
1898
|
* to another account in it, or locking it, signs out.
|
|
1873
1899
|
*/
|
|
1874
1900
|
withWallet: (signer: WalletSigner) => Promise<void>;
|
|
1875
|
-
/**
|
|
1901
|
+
/**
|
|
1902
|
+
* Leaves for Telegram Login, where the platform configured it.
|
|
1903
|
+
*
|
|
1904
|
+
* @deprecated Use `withProvider("telegram")`. Removed in 2.0.0.
|
|
1905
|
+
*/
|
|
1876
1906
|
withTelegram: () => Promise<void>;
|
|
1877
1907
|
/**
|
|
1878
1908
|
* Signs in, or signs up, inside a Telegram Mini App the project enabled, with its launch data
|
|
1879
|
-
* (`telegramMiniAppInitData()`).
|
|
1909
|
+
* (`telegramMiniAppInitData()` from `@domino-sdk/relay/telegram`).
|
|
1880
1910
|
*/
|
|
1881
1911
|
withTelegramMiniApp: (initData: string) => Promise<void>;
|
|
1882
1912
|
};
|
|
@@ -1913,8 +1943,18 @@ declare function useSignInOptions(input?: {
|
|
|
1913
1943
|
cosmos?: CosmosChains;
|
|
1914
1944
|
}): {
|
|
1915
1945
|
options: SignInOption[] | null;
|
|
1946
|
+
/**
|
|
1947
|
+
* Every sign-in provider the platform configured, Telegram included, in Relay's order: render
|
|
1948
|
+
* these in place of the `oauth` entries of `options`, which SDK 1.x keeps to `AuthProvider`.
|
|
1949
|
+
* Null while `options` is.
|
|
1950
|
+
*/
|
|
1951
|
+
signInProviders: ProviderSignInOption[] | null;
|
|
1916
1952
|
unavailable: SignInUnavailable[];
|
|
1917
|
-
/**
|
|
1953
|
+
/**
|
|
1954
|
+
* Telegram Login, to render beside `options`; null when the platform did not configure it.
|
|
1955
|
+
*
|
|
1956
|
+
* @deprecated Use the `"telegram"` entry of `signInProviders`. Removed in 2.0.0.
|
|
1957
|
+
*/
|
|
1918
1958
|
telegram: TelegramSignInOption | null;
|
|
1919
1959
|
/** Why the project's methods could not be read; the options are then email alone. */
|
|
1920
1960
|
methodsError: RelayError | null;
|
|
@@ -2010,11 +2050,87 @@ declare function useAccounts(): {
|
|
|
2010
2050
|
error: RelayError | null;
|
|
2011
2051
|
refresh(): Promise<void>;
|
|
2012
2052
|
};
|
|
2053
|
+
/**
|
|
2054
|
+
* The signed-in participant's account on one sign-in provider in `data`, any of
|
|
2055
|
+
* `providers().signInProviders`, Telegram included; null while Relay lists no such provider.
|
|
2056
|
+
* It behaves as `useAccounts()` does: `connect()` leaves for the provider's consent screen and
|
|
2057
|
+
* comes back linked, the account is read again when the window regains focus and after a
|
|
2058
|
+
* disconnect, and a failure lands in `actionError`.
|
|
2059
|
+
*/
|
|
2060
|
+
declare function useAccount(provider: SignInProvider): {
|
|
2061
|
+
connect: () => Promise<boolean>;
|
|
2062
|
+
disconnect: () => Promise<boolean>;
|
|
2063
|
+
isPending: boolean;
|
|
2064
|
+
actionError: RelayError | null;
|
|
2065
|
+
resetAction: () => void;
|
|
2066
|
+
retry: () => Promise<boolean>;
|
|
2067
|
+
settle: () => boolean;
|
|
2068
|
+
/** True when the account can be used to verify quests right now. */
|
|
2069
|
+
isConnected: boolean;
|
|
2070
|
+
status: "loading";
|
|
2071
|
+
data: undefined;
|
|
2072
|
+
error: null;
|
|
2073
|
+
refresh(): Promise<void>;
|
|
2074
|
+
} | {
|
|
2075
|
+
connect: () => Promise<boolean>;
|
|
2076
|
+
disconnect: () => Promise<boolean>;
|
|
2077
|
+
isPending: boolean;
|
|
2078
|
+
actionError: RelayError | null;
|
|
2079
|
+
resetAction: () => void;
|
|
2080
|
+
retry: () => Promise<boolean>;
|
|
2081
|
+
settle: () => boolean;
|
|
2082
|
+
/** True when the account can be used to verify quests right now. */
|
|
2083
|
+
isConnected: boolean;
|
|
2084
|
+
status: "error";
|
|
2085
|
+
data: undefined;
|
|
2086
|
+
error: RelayError;
|
|
2087
|
+
refresh(): Promise<void>;
|
|
2088
|
+
} | {
|
|
2089
|
+
connect: () => Promise<boolean>;
|
|
2090
|
+
disconnect: () => Promise<boolean>;
|
|
2091
|
+
isPending: boolean;
|
|
2092
|
+
actionError: RelayError | null;
|
|
2093
|
+
resetAction: () => void;
|
|
2094
|
+
retry: () => Promise<boolean>;
|
|
2095
|
+
settle: () => boolean;
|
|
2096
|
+
/** True when the account can be used to verify quests right now. */
|
|
2097
|
+
isConnected: boolean;
|
|
2098
|
+
status: "signed-out";
|
|
2099
|
+
data: undefined;
|
|
2100
|
+
error: null;
|
|
2101
|
+
refresh(): Promise<void>;
|
|
2102
|
+
} | {
|
|
2103
|
+
connect: () => Promise<boolean>;
|
|
2104
|
+
disconnect: () => Promise<boolean>;
|
|
2105
|
+
isPending: boolean;
|
|
2106
|
+
actionError: RelayError | null;
|
|
2107
|
+
resetAction: () => void;
|
|
2108
|
+
retry: () => Promise<boolean>;
|
|
2109
|
+
settle: () => boolean;
|
|
2110
|
+
/** True when the account can be used to verify quests right now. */
|
|
2111
|
+
isConnected: boolean;
|
|
2112
|
+
status: "ready";
|
|
2113
|
+
data: {
|
|
2114
|
+
provider: SignInProvider;
|
|
2115
|
+
configured: boolean;
|
|
2116
|
+
status: SignInAccountStatus;
|
|
2117
|
+
subject: string | null;
|
|
2118
|
+
revision: number;
|
|
2119
|
+
} | null;
|
|
2120
|
+
error: RelayError | null;
|
|
2121
|
+
refresh(): Promise<void>;
|
|
2122
|
+
};
|
|
2013
2123
|
/**
|
|
2014
2124
|
* The signed-in participant's Telegram account in `data`. Telegram is not one of `useAccounts()`'s
|
|
2015
2125
|
* providers in SDK 1.x, so it has this hook of its own, with the same behavior: `connect()` leaves
|
|
2016
2126
|
* for Telegram Login, `connectMiniApp(initData)` links the user who opened a Telegram Mini App,
|
|
2017
2127
|
* and a failure lands in `actionError`.
|
|
2128
|
+
*
|
|
2129
|
+
* @deprecated Use `useAccount("telegram")`, which reads, connects and disconnects the same account.
|
|
2130
|
+
* Inside a Mini App, link it with `withTelegram(relay).telegram.miniApp.connect(initData)` from
|
|
2131
|
+
* `@domino-sdk/relay/telegram`, then call
|
|
2132
|
+
* `invalidate([relayKeys.accounts, relayKeys.experience])` from `useInvalidate()`, as
|
|
2133
|
+
* `connectMiniApp` does. Removed in 2.0.0.
|
|
2018
2134
|
*/
|
|
2019
2135
|
declare function useTelegramAccount(): {
|
|
2020
2136
|
connect: () => Promise<boolean>;
|
|
@@ -2397,6 +2513,76 @@ declare function useProfileCompletions(profile: string, options?: {
|
|
|
2397
2513
|
limit?: number;
|
|
2398
2514
|
}): PagedQuery<ProfileCompletion>;
|
|
2399
2515
|
|
|
2516
|
+
/**
|
|
2517
|
+
* The signed-in member's marketing consent in `data`, one entry per channel they chose on, and
|
|
2518
|
+
* the changes to it. Show the checkbox in your app and pass its label as `wording`: Relay records
|
|
2519
|
+
* the exact text with its own time. A channel missing from `data` has no record, which is not the
|
|
2520
|
+
* same as withdrawn.
|
|
2521
|
+
*
|
|
2522
|
+
* `grant` and `withdraw` never reject: they resolve true once saved, `isPending` is true while one
|
|
2523
|
+
* runs, and a failure lands in `actionError` until `resetAction()`. Each change is bound to the
|
|
2524
|
+
* session the consent was read with.
|
|
2525
|
+
*
|
|
2526
|
+
* @experimental A minor release can change the consent API.
|
|
2527
|
+
*/
|
|
2528
|
+
declare function useConsent(): {
|
|
2529
|
+
/** Records the member's opt-in on `channel`, with the wording they saw. */
|
|
2530
|
+
grant: (channel: KnownConsentChannel, wording: string) => Promise<boolean>;
|
|
2531
|
+
/** Records the member's opt-out on `channel`, with the wording they saw if there was any. */
|
|
2532
|
+
withdraw: (channel: KnownConsentChannel, wording?: string) => Promise<boolean>;
|
|
2533
|
+
isPending: boolean;
|
|
2534
|
+
actionError: RelayError | null;
|
|
2535
|
+
resetAction: () => void;
|
|
2536
|
+
retry: () => Promise<boolean>;
|
|
2537
|
+
settle: () => boolean;
|
|
2538
|
+
status: "loading";
|
|
2539
|
+
data: undefined;
|
|
2540
|
+
error: null;
|
|
2541
|
+
refresh(): Promise<void>;
|
|
2542
|
+
} | {
|
|
2543
|
+
/** Records the member's opt-in on `channel`, with the wording they saw. */
|
|
2544
|
+
grant: (channel: KnownConsentChannel, wording: string) => Promise<boolean>;
|
|
2545
|
+
/** Records the member's opt-out on `channel`, with the wording they saw if there was any. */
|
|
2546
|
+
withdraw: (channel: KnownConsentChannel, wording?: string) => Promise<boolean>;
|
|
2547
|
+
isPending: boolean;
|
|
2548
|
+
actionError: RelayError | null;
|
|
2549
|
+
resetAction: () => void;
|
|
2550
|
+
retry: () => Promise<boolean>;
|
|
2551
|
+
settle: () => boolean;
|
|
2552
|
+
status: "error";
|
|
2553
|
+
data: undefined;
|
|
2554
|
+
error: RelayError;
|
|
2555
|
+
refresh(): Promise<void>;
|
|
2556
|
+
} | {
|
|
2557
|
+
/** Records the member's opt-in on `channel`, with the wording they saw. */
|
|
2558
|
+
grant: (channel: KnownConsentChannel, wording: string) => Promise<boolean>;
|
|
2559
|
+
/** Records the member's opt-out on `channel`, with the wording they saw if there was any. */
|
|
2560
|
+
withdraw: (channel: KnownConsentChannel, wording?: string) => Promise<boolean>;
|
|
2561
|
+
isPending: boolean;
|
|
2562
|
+
actionError: RelayError | null;
|
|
2563
|
+
resetAction: () => void;
|
|
2564
|
+
retry: () => Promise<boolean>;
|
|
2565
|
+
settle: () => boolean;
|
|
2566
|
+
status: "signed-out";
|
|
2567
|
+
data: undefined;
|
|
2568
|
+
error: null;
|
|
2569
|
+
refresh(): Promise<void>;
|
|
2570
|
+
} | {
|
|
2571
|
+
/** Records the member's opt-in on `channel`, with the wording they saw. */
|
|
2572
|
+
grant: (channel: KnownConsentChannel, wording: string) => Promise<boolean>;
|
|
2573
|
+
/** Records the member's opt-out on `channel`, with the wording they saw if there was any. */
|
|
2574
|
+
withdraw: (channel: KnownConsentChannel, wording?: string) => Promise<boolean>;
|
|
2575
|
+
isPending: boolean;
|
|
2576
|
+
actionError: RelayError | null;
|
|
2577
|
+
resetAction: () => void;
|
|
2578
|
+
retry: () => Promise<boolean>;
|
|
2579
|
+
settle: () => boolean;
|
|
2580
|
+
status: "ready";
|
|
2581
|
+
data: MemberConsent[];
|
|
2582
|
+
error: RelayError | null;
|
|
2583
|
+
refresh(): Promise<void>;
|
|
2584
|
+
};
|
|
2585
|
+
|
|
2400
2586
|
type ReferralSummary = z$1.infer<typeof referralSummarySchema>;
|
|
2401
2587
|
/**
|
|
2402
2588
|
* Keeps an invitation code from the landing URL (`?ref=CODE` by default)
|
|
@@ -2433,7 +2619,8 @@ type Invitation = {
|
|
|
2433
2619
|
* signed in. Render it once near the app root so the code survives sign-in.
|
|
2434
2620
|
*
|
|
2435
2621
|
* Domino rejects self-referrals, cycles, codes from another project, and
|
|
2436
|
-
* invitations accepted after the participant
|
|
2622
|
+
* invitations accepted after the participant completed a quest other than a
|
|
2623
|
+
* referral program's qualifying quest. Show the
|
|
2437
2624
|
* reason; `accept(code)` also serves a manual "Have a code?" input. Once
|
|
2438
2625
|
* accepted, the referral summary and referral progress are read again.
|
|
2439
2626
|
*/
|
|
@@ -2533,4 +2720,4 @@ declare function usePointLedgers(): Query<PointLedgerReference[]>;
|
|
|
2533
2720
|
*/
|
|
2534
2721
|
declare function useTieredRewards(): Query<TieredRewardReference[]>;
|
|
2535
2722
|
|
|
2536
|
-
export { type Collection, CosmosChains, CreatorAccountProvider, DiscoveredWallet, type ExperienceData, type Invitation, type KnownQuestStatusCode, type KnownRoleDeliveryStatus, type MemberPagedQuery, type MemberQuery, type MemberQueryOptions, type MemberSnapshot, type Mutation, type MutationContext, type MutationOptions, type MutationStatus, type OAuthProvider, Page, type PageLoader, type PageRead, type PagedQuery, type Query, type QueryContext, type QueryKey, type QueryOptions, type QueryRead, type QuerySnapshot, type QuestActionState, type QuestInput, type QuestNotice, type QuestStatus, type QuestStatusCode, type QuestStatusText, type QuestTone, type ReferralSummary, type RelayActionResult, RelayClient, type RelayPolling, RelayProvider, type RelayQueryOptions, type RoleDelivery, type RoleDeliveryStatus, type SavedSubmission, SignInMethods, SignInOption, SignInUnavailable, SignInWallet, TelegramSignInOption, canRepeat, canSubmit, captureReferralCode, completionCountText, isAutomatic, isConnected, isCoolingDown, isFinished, progressOf, questActionState, questGroups, questStatus, questStatusText, relayKeys, roleDeliveryLabel, roleDeliveryStatus, useAccounts, useActivity, useBadgeCatalog, useBadges, useBalances, useCreatorAccounts, useDeliveries, useEntitlements, useExperience, useInvalidate, useInvitation, useLeaderboard, useLeaderboardHistory, useLeaderboardPlacement, useMe, useMemberPages, useMemberQuery, useMyProfile, useOffers, usePointHistory, usePointLedgers, useProfile, useProfileBadges, useProfileCompletions, useProfileReferral, useQuest, useQuestAction, useQuestOutcomes, useRedeemOffer, useReferralSummary, useRelay, useRelayAction, useRelayMutation, useRelayPages, useRelayQuery, useSession, useSetQueryData, useSignIn, useSignInMethods, useSignInOptions, useSignInWallets, useSignOut, useTelegramAccount, useTieredRewards, useWalletDiscovery, useWallets };
|
|
2723
|
+
export { type Collection, CosmosChains, CreatorAccountProvider, DiscoveredWallet, type ExperienceData, type Invitation, KnownConsentChannel, type KnownQuestStatusCode, type KnownRoleDeliveryStatus, MemberConsent, type MemberPagedQuery, type MemberQuery, type MemberQueryOptions, type MemberSnapshot, type Mutation, type MutationContext, type MutationOptions, type MutationStatus, type OAuthProvider, Page, type PageLoader, type PageRead, type PagedQuery, ProviderSignInOption, type Query, type QueryContext, type QueryKey, type QueryOptions, type QueryRead, type QuerySnapshot, type QuestActionState, type QuestInput, type QuestNotice, type QuestStatus, type QuestStatusCode, type QuestStatusText, type QuestTone, type ReferralSummary, type RelayActionResult, RelayClient, type RelayPolling, RelayProvider, type RelayQueryOptions, type RoleDelivery, type RoleDeliveryStatus, type SavedSubmission, SignInMethods, SignInOption, SignInProvider, SignInUnavailable, SignInWallet, TelegramSignInOption, canRepeat, canSubmit, captureReferralCode, completionCountText, isAutomatic, isConnected, isCoolingDown, isFinished, progressOf, questActionState, questGroups, questStatus, questStatusText, relayKeys, roleDeliveryLabel, roleDeliveryStatus, useAccount, useAccounts, useActivity, useBadgeCatalog, useBadges, useBalances, useConsent, useCreatorAccounts, useDeliveries, useEntitlements, useExperience, useInvalidate, useInvitation, useLeaderboard, useLeaderboardHistory, useLeaderboardPlacement, useMe, useMemberPages, useMemberQuery, useMyProfile, useOffers, usePointHistory, usePointLedgers, useProfile, useProfileBadges, useProfileCompletions, useProfileReferral, useQuest, useQuestAction, useQuestOutcomes, useRedeemOffer, useReferralSummary, useRelay, useRelayAction, useRelayMutation, useRelayPages, useRelayQuery, useSession, useSetQueryData, useSignIn, useSignInMethods, useSignInOptions, useSignInWallets, useSignOut, useTelegramAccount, useTieredRewards, useWalletDiscovery, useWallets };
|