@domino-sdk/relay 0.19.0 → 0.24.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/dist/authoring.d.ts +3 -2
- package/dist/authoring.js +3 -2
- package/dist/browser.d.ts +162 -153
- package/dist/browser.js +5 -5
- package/dist/{chunk-6GH4NC2T.js → chunk-57TGYC5Y.js} +1 -1
- package/dist/{chunk-MVDIVWR5.js → chunk-ND3CVNIW.js} +1 -1
- package/dist/{chunk-TQUK4DIW.js → chunk-RTBIXGMH.js} +301 -112
- package/dist/{chunk-23ZZTCDK.js → chunk-UYS522ER.js} +5 -0
- package/dist/{chunk-FBOW2TLN.js → chunk-ZOL7RYHW.js} +1 -1
- package/dist/index.d.ts +407 -241
- package/dist/index.js +38 -4
- package/dist/portal-proxy.js +3 -3
- package/dist/react/index.d.ts +179 -94
- package/dist/react/index.js +36 -5
- package/dist/schema.d.ts +11 -3
- package/dist/schema.js +3 -1
- package/dist/{submission-input-C67qt2Ph.d.ts → submission-input-CK4Dy19H.d.ts} +258 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20,15 +20,30 @@ import {
|
|
|
20
20
|
identityIntegrationInputSchema,
|
|
21
21
|
identityIntegrationSchema,
|
|
22
22
|
identityIntegrationSecretSchema,
|
|
23
|
+
imageAssetArtifactSchema,
|
|
24
|
+
imageComparisonSchema,
|
|
25
|
+
imageExtractionSchema,
|
|
26
|
+
imageFieldSchema,
|
|
27
|
+
imageFieldsSchema,
|
|
28
|
+
imageInspectionSchema,
|
|
29
|
+
imageReferenceSchema,
|
|
30
|
+
imageRequestSchema,
|
|
31
|
+
imageSightingsSchema,
|
|
32
|
+
imageUploadRequestSchema,
|
|
33
|
+
imageUploadsSchema,
|
|
23
34
|
interactionSchema,
|
|
35
|
+
parseImageExtraction,
|
|
36
|
+
parseImageResult,
|
|
24
37
|
participantExchangeSchema,
|
|
25
38
|
pointLedgerDeclarationSchema,
|
|
26
39
|
pointLedgerPropertiesSchema,
|
|
40
|
+
pointLedgerReferenceSchema,
|
|
27
41
|
pointLedgerSchema,
|
|
28
42
|
projectCatalogArtifactSchema,
|
|
29
43
|
projectDeploymentSchema,
|
|
30
44
|
publishDeploymentSchema,
|
|
31
45
|
publishQuestDraftSchema,
|
|
46
|
+
publishedImageSchema,
|
|
32
47
|
questActions,
|
|
33
48
|
questCatalogSchema,
|
|
34
49
|
questCollectionSchema,
|
|
@@ -39,6 +54,7 @@ import {
|
|
|
39
54
|
questInstanceSchema,
|
|
40
55
|
questInteraction,
|
|
41
56
|
questPublicationPreviewSchema,
|
|
57
|
+
questRewardViewSchema,
|
|
42
58
|
questTypeVersionSchema,
|
|
43
59
|
questViewSchema,
|
|
44
60
|
reconcileQuestDraft,
|
|
@@ -56,7 +72,7 @@ import {
|
|
|
56
72
|
xPostSchema,
|
|
57
73
|
xProfileSchema,
|
|
58
74
|
xRequestSchema
|
|
59
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-RTBIXGMH.js";
|
|
60
76
|
import {
|
|
61
77
|
defineEngagementReward,
|
|
62
78
|
defineLeaderboard,
|
|
@@ -103,14 +119,14 @@ import {
|
|
|
103
119
|
referralManagementSchema,
|
|
104
120
|
referralRelationshipSchema,
|
|
105
121
|
referralSummarySchema
|
|
106
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-ZOL7RYHW.js";
|
|
107
123
|
import {
|
|
108
124
|
authScopeSchema,
|
|
109
125
|
exchangeResultSchema,
|
|
110
126
|
exchangeSchema,
|
|
111
127
|
principalSchema,
|
|
112
128
|
sessionSchema
|
|
113
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-57TGYC5Y.js";
|
|
114
130
|
import {
|
|
115
131
|
accountConnectionSchema,
|
|
116
132
|
admittedContentSchema,
|
|
@@ -230,6 +246,7 @@ import {
|
|
|
230
246
|
textReviewInputSchema,
|
|
231
247
|
tierRewardSchema,
|
|
232
248
|
tieredRewardDefinitionSchema,
|
|
249
|
+
tieredRewardReferenceSchema,
|
|
233
250
|
trackerArtifactSchema,
|
|
234
251
|
trackerContentQuerySchema,
|
|
235
252
|
trackerContentReadSchema,
|
|
@@ -257,7 +274,7 @@ import {
|
|
|
257
274
|
xContentBodySchema,
|
|
258
275
|
xPostId,
|
|
259
276
|
xTweetSchema
|
|
260
|
-
} from "./chunk-
|
|
277
|
+
} from "./chunk-UYS522ER.js";
|
|
261
278
|
export {
|
|
262
279
|
QuestUpdatedError,
|
|
263
280
|
RelayError,
|
|
@@ -351,6 +368,17 @@ export {
|
|
|
351
368
|
identityIntegrationInputSchema,
|
|
352
369
|
identityIntegrationSchema,
|
|
353
370
|
identityIntegrationSecretSchema,
|
|
371
|
+
imageAssetArtifactSchema,
|
|
372
|
+
imageComparisonSchema,
|
|
373
|
+
imageExtractionSchema,
|
|
374
|
+
imageFieldSchema,
|
|
375
|
+
imageFieldsSchema,
|
|
376
|
+
imageInspectionSchema,
|
|
377
|
+
imageReferenceSchema,
|
|
378
|
+
imageRequestSchema,
|
|
379
|
+
imageSightingsSchema,
|
|
380
|
+
imageUploadRequestSchema,
|
|
381
|
+
imageUploadsSchema,
|
|
354
382
|
integrationProviderSchema,
|
|
355
383
|
integrationRewardSchema,
|
|
356
384
|
interactionSchema,
|
|
@@ -374,6 +402,8 @@ export {
|
|
|
374
402
|
observationReceiptSchema,
|
|
375
403
|
observationSchema,
|
|
376
404
|
observationTriggerSchema,
|
|
405
|
+
parseImageExtraction,
|
|
406
|
+
parseImageResult,
|
|
377
407
|
parseSettings,
|
|
378
408
|
participantExchangeSchema,
|
|
379
409
|
perContent,
|
|
@@ -385,6 +415,7 @@ export {
|
|
|
385
415
|
pickupSelectionSchema,
|
|
386
416
|
pointLedgerDeclarationSchema,
|
|
387
417
|
pointLedgerPropertiesSchema,
|
|
418
|
+
pointLedgerReferenceSchema,
|
|
388
419
|
pointLedgerSchema,
|
|
389
420
|
pointLedgers,
|
|
390
421
|
pointsAccountSchema,
|
|
@@ -399,6 +430,7 @@ export {
|
|
|
399
430
|
projectIntegrationSchema,
|
|
400
431
|
publishDeploymentSchema,
|
|
401
432
|
publishQuestDraftSchema,
|
|
433
|
+
publishedImageSchema,
|
|
402
434
|
publishedLeaderboardSchema,
|
|
403
435
|
publishedReferralSchema,
|
|
404
436
|
publishedReleaseSchema,
|
|
@@ -416,6 +448,7 @@ export {
|
|
|
416
448
|
questInteraction,
|
|
417
449
|
questPresentationSchema,
|
|
418
450
|
questPublicationPreviewSchema,
|
|
451
|
+
questRewardViewSchema,
|
|
419
452
|
questSettingsInputSchema,
|
|
420
453
|
questTypeVersionSchema,
|
|
421
454
|
questViewSchema,
|
|
@@ -475,6 +508,7 @@ export {
|
|
|
475
508
|
textReviewInputSchema,
|
|
476
509
|
tierRewardSchema,
|
|
477
510
|
tieredRewardDefinitionSchema,
|
|
511
|
+
tieredRewardReferenceSchema,
|
|
478
512
|
trackerArtifactSchema,
|
|
479
513
|
trackerContentQuerySchema,
|
|
480
514
|
trackerContentReadSchema,
|
package/dist/portal-proxy.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
exchangeResultSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-57TGYC5Y.js";
|
|
4
4
|
import {
|
|
5
5
|
isContentParticipantRoute
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UYS522ER.js";
|
|
7
7
|
|
|
8
8
|
// src/portal-proxy.ts
|
|
9
9
|
async function proxyParticipant(request, upstream) {
|
|
@@ -13,7 +13,7 @@ async function proxyParticipant(request, upstream) {
|
|
|
13
13
|
path
|
|
14
14
|
) || /^\/v1\/me\/(progress|experience|attempts|evidence|pass|collection-pass|wallet(?:\/challenge|\/verify)?)$/.test(
|
|
15
15
|
path
|
|
16
|
-
) || /^\/v1\/attempts\/[\w-]+(?:\/retry)?$/.test(path) || /^\/v1\/referrals(?:\/(me|history))?$/.test(path) && request.method === "GET" || isContentParticipantRoute(path, request.method) || path === "/v1/reward-deliveries" && request.method === "GET" || path === "/v1/referrals/accept" && request.method === "POST" || request.method === "GET" && /^\/v1\/leaderboards(?:\/[\w-]+)?$/.test(path));
|
|
16
|
+
) || /^\/v1\/attempts\/[\w-]+(?:\/retry)?$/.test(path) || /^\/v1\/referrals(?:\/(me|history))?$/.test(path) && request.method === "GET" || isContentParticipantRoute(path, request.method) || path === "/v1/reward-deliveries" && request.method === "GET" || path === "/v1/referrals/accept" && request.method === "POST" || request.method === "GET" && /^\/v1\/leaderboards(?:\/[\w-]+)?$/.test(path) || request.method === "GET" && (path === "/v1/point-ledgers" || path === "/v1/tiered-rewards"));
|
|
17
17
|
if (!allowed || !["GET", "POST"].includes(request.method)) {
|
|
18
18
|
return Response.json({ error: "Route not found" }, { status: 404 });
|
|
19
19
|
}
|
package/dist/react/index.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import * as zod from 'zod';
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import { QuestView, QuestController, ProgressObservation, questExperienceSchema, ProgressObserver, ExchangeInput, PhotoSubmission, QuizSubmission, ClaimSubmission, ValueSubmission, SubmissionDraft } from '../index.js';
|
|
6
|
-
import {
|
|
7
|
-
import { SubmitInput,
|
|
5
|
+
import { QuestView, QuestController, ProgressObservation, questExperienceSchema, ProgressObserver, ExchangeInput, PhotoSubmission, QuizSubmission, ClaimSubmission, ValueSubmission, SubmissionDraft, PointLedgerReference } from '../index.js';
|
|
6
|
+
import { t as referralAcceptSchema, L as LeaderboardQuery, w as walletChallengeInputSchema, u as walletProofSchema, v as AuthProvider, y as engagementPageQuerySchema, z as contentQualificationQuerySchema, E as contentAdmissionQuerySchema, F as contentEnrollmentInputSchema, G as contentReleaseInputSchema, H as AccountConnection, J as referralSummarySchema, K as LeaderboardPage } from '../submission-input-CK4Dy19H.js';
|
|
7
|
+
import { SubmitInput, ReleaseInput, beginHandoverSchema, contentPerformanceQuerySchema, TieredRewardReference } from '../schema.js';
|
|
8
8
|
import { createBrowserRelayClient } from '../browser.js';
|
|
9
9
|
|
|
10
10
|
type RelayClient = ReturnType<typeof createBrowserRelayClient>;
|
|
@@ -239,6 +239,19 @@ declare function useRelay(): {
|
|
|
239
239
|
ok: true;
|
|
240
240
|
}>;
|
|
241
241
|
};
|
|
242
|
+
tieredRewards: {
|
|
243
|
+
list: () => Promise<{
|
|
244
|
+
id: string;
|
|
245
|
+
key: string | null;
|
|
246
|
+
}[]>;
|
|
247
|
+
};
|
|
248
|
+
pointLedgers: {
|
|
249
|
+
list: () => Promise<{
|
|
250
|
+
id: string;
|
|
251
|
+
key: string | null;
|
|
252
|
+
name: string;
|
|
253
|
+
}[]>;
|
|
254
|
+
};
|
|
242
255
|
leaderboards: {
|
|
243
256
|
list: () => Promise<{
|
|
244
257
|
id: string;
|
|
@@ -484,9 +497,28 @@ declare function useRelay(): {
|
|
|
484
497
|
release: string;
|
|
485
498
|
interaction: "text" | "url" | "automatic" | "claim" | "staff" | "quiz" | "photo";
|
|
486
499
|
lifecycle: "paused" | "active" | "archived";
|
|
487
|
-
rewards: {
|
|
500
|
+
rewards: ({
|
|
501
|
+
kind: "points";
|
|
488
502
|
label: string;
|
|
489
|
-
|
|
503
|
+
amount: number;
|
|
504
|
+
ledger: {
|
|
505
|
+
id: string;
|
|
506
|
+
key: string | null;
|
|
507
|
+
name: string;
|
|
508
|
+
};
|
|
509
|
+
} | {
|
|
510
|
+
kind: "tier";
|
|
511
|
+
label: string;
|
|
512
|
+
reward: {
|
|
513
|
+
id: string;
|
|
514
|
+
key: string | null;
|
|
515
|
+
title: string;
|
|
516
|
+
};
|
|
517
|
+
tier: string;
|
|
518
|
+
} | {
|
|
519
|
+
kind: "integration";
|
|
520
|
+
label: string;
|
|
521
|
+
})[];
|
|
490
522
|
key?: string | undefined;
|
|
491
523
|
streak?: {
|
|
492
524
|
goal: number;
|
|
@@ -737,9 +769,28 @@ declare function useRelay(): {
|
|
|
737
769
|
release: string;
|
|
738
770
|
interaction: "text" | "url" | "automatic" | "claim" | "staff" | "quiz" | "photo";
|
|
739
771
|
lifecycle: "paused" | "active" | "archived";
|
|
740
|
-
rewards: {
|
|
772
|
+
rewards: ({
|
|
773
|
+
kind: "points";
|
|
741
774
|
label: string;
|
|
742
|
-
|
|
775
|
+
amount: number;
|
|
776
|
+
ledger: {
|
|
777
|
+
id: string;
|
|
778
|
+
key: string | null;
|
|
779
|
+
name: string;
|
|
780
|
+
};
|
|
781
|
+
} | {
|
|
782
|
+
kind: "tier";
|
|
783
|
+
label: string;
|
|
784
|
+
reward: {
|
|
785
|
+
id: string;
|
|
786
|
+
key: string | null;
|
|
787
|
+
title: string;
|
|
788
|
+
};
|
|
789
|
+
tier: string;
|
|
790
|
+
} | {
|
|
791
|
+
kind: "integration";
|
|
792
|
+
label: string;
|
|
793
|
+
})[];
|
|
743
794
|
key?: string | undefined;
|
|
744
795
|
streak?: {
|
|
745
796
|
goal: number;
|
|
@@ -938,9 +989,28 @@ declare function useRelay(): {
|
|
|
938
989
|
release: string;
|
|
939
990
|
interaction: "text" | "url" | "automatic" | "claim" | "staff" | "quiz" | "photo";
|
|
940
991
|
lifecycle: "paused" | "active" | "archived";
|
|
941
|
-
rewards: {
|
|
992
|
+
rewards: ({
|
|
993
|
+
kind: "points";
|
|
942
994
|
label: string;
|
|
943
|
-
|
|
995
|
+
amount: number;
|
|
996
|
+
ledger: {
|
|
997
|
+
id: string;
|
|
998
|
+
key: string | null;
|
|
999
|
+
name: string;
|
|
1000
|
+
};
|
|
1001
|
+
} | {
|
|
1002
|
+
kind: "tier";
|
|
1003
|
+
label: string;
|
|
1004
|
+
reward: {
|
|
1005
|
+
id: string;
|
|
1006
|
+
key: string | null;
|
|
1007
|
+
title: string;
|
|
1008
|
+
};
|
|
1009
|
+
tier: string;
|
|
1010
|
+
} | {
|
|
1011
|
+
kind: "integration";
|
|
1012
|
+
label: string;
|
|
1013
|
+
})[];
|
|
944
1014
|
key?: string | undefined;
|
|
945
1015
|
streak?: {
|
|
946
1016
|
goal: number;
|
|
@@ -1142,9 +1212,28 @@ declare function useRelay(): {
|
|
|
1142
1212
|
release: string;
|
|
1143
1213
|
interaction: "text" | "url" | "automatic" | "claim" | "staff" | "quiz" | "photo";
|
|
1144
1214
|
lifecycle: "paused" | "active" | "archived";
|
|
1145
|
-
rewards: {
|
|
1215
|
+
rewards: ({
|
|
1216
|
+
kind: "points";
|
|
1146
1217
|
label: string;
|
|
1147
|
-
|
|
1218
|
+
amount: number;
|
|
1219
|
+
ledger: {
|
|
1220
|
+
id: string;
|
|
1221
|
+
key: string | null;
|
|
1222
|
+
name: string;
|
|
1223
|
+
};
|
|
1224
|
+
} | {
|
|
1225
|
+
kind: "tier";
|
|
1226
|
+
label: string;
|
|
1227
|
+
reward: {
|
|
1228
|
+
id: string;
|
|
1229
|
+
key: string | null;
|
|
1230
|
+
title: string;
|
|
1231
|
+
};
|
|
1232
|
+
tier: string;
|
|
1233
|
+
} | {
|
|
1234
|
+
kind: "integration";
|
|
1235
|
+
label: string;
|
|
1236
|
+
})[];
|
|
1148
1237
|
key?: string | undefined;
|
|
1149
1238
|
streak?: {
|
|
1150
1239
|
goal: number;
|
|
@@ -1735,86 +1824,6 @@ declare function useRelay(): {
|
|
|
1735
1824
|
size: number;
|
|
1736
1825
|
}>;
|
|
1737
1826
|
};
|
|
1738
|
-
reviews: {
|
|
1739
|
-
list: (options?: ReviewListOptions, requestOptions?: {
|
|
1740
|
-
signal?: AbortSignal;
|
|
1741
|
-
}) => Promise<{
|
|
1742
|
-
items: {
|
|
1743
|
-
attempt: {
|
|
1744
|
-
id: string;
|
|
1745
|
-
release: string;
|
|
1746
|
-
quest: string;
|
|
1747
|
-
member: string;
|
|
1748
|
-
evidence: string | null;
|
|
1749
|
-
status: "needs-review" | "failed" | "queued" | "evaluating" | "accepted" | "progressed" | "rejected";
|
|
1750
|
-
reason: string | null;
|
|
1751
|
-
retries: number;
|
|
1752
|
-
generation: number;
|
|
1753
|
-
completion: string | null;
|
|
1754
|
-
reviewRewards: ({
|
|
1755
|
-
kind: "tier";
|
|
1756
|
-
reward: {
|
|
1757
|
-
id: string;
|
|
1758
|
-
title: string;
|
|
1759
|
-
tiers: {
|
|
1760
|
-
id: string;
|
|
1761
|
-
title: string;
|
|
1762
|
-
}[];
|
|
1763
|
-
inventory: {
|
|
1764
|
-
kind: "untracked";
|
|
1765
|
-
};
|
|
1766
|
-
fulfillment: {
|
|
1767
|
-
kind: "staff-handover";
|
|
1768
|
-
};
|
|
1769
|
-
};
|
|
1770
|
-
tier: string;
|
|
1771
|
-
} | {
|
|
1772
|
-
kind: "points";
|
|
1773
|
-
balance: string;
|
|
1774
|
-
amount: number;
|
|
1775
|
-
} | {
|
|
1776
|
-
kind: "integration";
|
|
1777
|
-
provider: "discord";
|
|
1778
|
-
action: "grant-role";
|
|
1779
|
-
roleId: string;
|
|
1780
|
-
})[] | null;
|
|
1781
|
-
createdAt: number;
|
|
1782
|
-
input?: {
|
|
1783
|
-
kind: "text";
|
|
1784
|
-
value: string;
|
|
1785
|
-
} | {
|
|
1786
|
-
kind: "url";
|
|
1787
|
-
value: string;
|
|
1788
|
-
} | {
|
|
1789
|
-
kind: "quiz";
|
|
1790
|
-
answers: {
|
|
1791
|
-
[k: string]: string;
|
|
1792
|
-
};
|
|
1793
|
-
release?: string | undefined;
|
|
1794
|
-
} | undefined;
|
|
1795
|
-
};
|
|
1796
|
-
title: string;
|
|
1797
|
-
checks: {
|
|
1798
|
-
criteria: string;
|
|
1799
|
-
result: {
|
|
1800
|
-
kind: "pass" | "fail" | "unclear";
|
|
1801
|
-
reason: string;
|
|
1802
|
-
};
|
|
1803
|
-
}[];
|
|
1804
|
-
}[];
|
|
1805
|
-
nextCursor: string | null;
|
|
1806
|
-
}>;
|
|
1807
|
-
};
|
|
1808
|
-
members: {
|
|
1809
|
-
list: (options?: MemberListOptions, requestOptions?: {
|
|
1810
|
-
signal?: AbortSignal;
|
|
1811
|
-
}) => Promise<{
|
|
1812
|
-
items: {
|
|
1813
|
-
member: string;
|
|
1814
|
-
}[];
|
|
1815
|
-
nextCursor: string | null;
|
|
1816
|
-
}>;
|
|
1817
|
-
};
|
|
1818
1827
|
evidence: {
|
|
1819
1828
|
download(id: string, requestOptions?: {
|
|
1820
1829
|
signal?: AbortSignal;
|
|
@@ -4110,9 +4119,28 @@ declare function useQuest(observed: QuestView): {
|
|
|
4110
4119
|
release: string;
|
|
4111
4120
|
interaction: "text" | "url" | "automatic" | "claim" | "staff" | "quiz" | "photo";
|
|
4112
4121
|
lifecycle: "paused" | "active" | "archived";
|
|
4113
|
-
rewards: {
|
|
4122
|
+
rewards: ({
|
|
4123
|
+
kind: "points";
|
|
4114
4124
|
label: string;
|
|
4115
|
-
|
|
4125
|
+
amount: number;
|
|
4126
|
+
ledger: {
|
|
4127
|
+
id: string;
|
|
4128
|
+
key: string | null;
|
|
4129
|
+
name: string;
|
|
4130
|
+
};
|
|
4131
|
+
} | {
|
|
4132
|
+
kind: "tier";
|
|
4133
|
+
label: string;
|
|
4134
|
+
reward: {
|
|
4135
|
+
id: string;
|
|
4136
|
+
key: string | null;
|
|
4137
|
+
title: string;
|
|
4138
|
+
};
|
|
4139
|
+
tier: string;
|
|
4140
|
+
} | {
|
|
4141
|
+
kind: "integration";
|
|
4142
|
+
label: string;
|
|
4143
|
+
})[];
|
|
4116
4144
|
key?: string | undefined;
|
|
4117
4145
|
streak?: {
|
|
4118
4146
|
goal: number;
|
|
@@ -4458,4 +4486,61 @@ declare function useLeaderboard(board: string, options?: {
|
|
|
4458
4486
|
stale: string | null;
|
|
4459
4487
|
};
|
|
4460
4488
|
|
|
4461
|
-
|
|
4489
|
+
type ReferencesState<T> = {
|
|
4490
|
+
status: "loading";
|
|
4491
|
+
} | {
|
|
4492
|
+
status: "error";
|
|
4493
|
+
message: string;
|
|
4494
|
+
} | {
|
|
4495
|
+
status: "ready";
|
|
4496
|
+
items: T[];
|
|
4497
|
+
};
|
|
4498
|
+
type PointLedgersState = ReferencesState<PointLedgerReference>;
|
|
4499
|
+
type TieredRewardsState = ReferencesState<TieredRewardReference>;
|
|
4500
|
+
/**
|
|
4501
|
+
* The project's point ledgers with their keys and names.
|
|
4502
|
+
*
|
|
4503
|
+
* Reads such as referral summaries and history name ledgers by ID. Find a
|
|
4504
|
+
* ledger by the key your app declared, then compare IDs:
|
|
4505
|
+
* `items.find((l) => l.key === "credits")?.id`.
|
|
4506
|
+
*/
|
|
4507
|
+
declare function usePointLedgers(): {
|
|
4508
|
+
refresh: () => Promise<void>;
|
|
4509
|
+
status: "loading";
|
|
4510
|
+
} | {
|
|
4511
|
+
refresh: () => Promise<void>;
|
|
4512
|
+
status: "error";
|
|
4513
|
+
message: string;
|
|
4514
|
+
} | {
|
|
4515
|
+
refresh: () => Promise<void>;
|
|
4516
|
+
status: "ready";
|
|
4517
|
+
items: {
|
|
4518
|
+
id: string;
|
|
4519
|
+
key: string | null;
|
|
4520
|
+
name: string;
|
|
4521
|
+
}[];
|
|
4522
|
+
};
|
|
4523
|
+
/**
|
|
4524
|
+
* The project's tiered rewards with their keys.
|
|
4525
|
+
*
|
|
4526
|
+
* Entitlements and reward definitions name tiered rewards by ID. Find a reward
|
|
4527
|
+
* by the key you gave defineTieredReward, then compare IDs:
|
|
4528
|
+
* `items.find((r) => r.key === "tote")?.id`.
|
|
4529
|
+
*/
|
|
4530
|
+
declare function useTieredRewards(): {
|
|
4531
|
+
refresh: () => Promise<void>;
|
|
4532
|
+
status: "loading";
|
|
4533
|
+
} | {
|
|
4534
|
+
refresh: () => Promise<void>;
|
|
4535
|
+
status: "error";
|
|
4536
|
+
message: string;
|
|
4537
|
+
} | {
|
|
4538
|
+
refresh: () => Promise<void>;
|
|
4539
|
+
status: "ready";
|
|
4540
|
+
items: {
|
|
4541
|
+
id: string;
|
|
4542
|
+
key: string | null;
|
|
4543
|
+
}[];
|
|
4544
|
+
};
|
|
4545
|
+
|
|
4546
|
+
export { type Collection, type Experience, type Invitation, type LeaderboardState, type OAuthProvider, PENDING_POLL_MS, type PointLedgersState, type QuestInput, type QuestNotice, type QuestStatus, type QuestTone, RETRY_DELAYS_MS, type ReferencesState, type ReferralSummary, type RelayClient, RelayProvider, type RoleDelivery, type SavedSubmission, type TieredRewardsState, canRepeat, canSubmit, captureReferralCode, completionCountLabel, completionMark, hasPending, isAutomatic, isConnected, isFinished, progressOf, questGroups, questStatus, roleDeliveryLabel, runsSilently, sanitizeDeliveries, useAccounts, useExperience, useInvitation, useLeaderboard, usePointLedgers, useQuest, useReferralSummary, useRelay, useSignIn, useSignInMethods, useSignOut, useTieredRewards, visibleQuests, watchRoleDeliveries };
|
package/dist/react/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createBrowserRelayClient
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-ND3CVNIW.js";
|
|
4
4
|
import {
|
|
5
5
|
RelayError
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-RTBIXGMH.js";
|
|
7
|
+
import "../chunk-ZOL7RYHW.js";
|
|
8
|
+
import "../chunk-57TGYC5Y.js";
|
|
9
|
+
import "../chunk-UYS522ER.js";
|
|
10
10
|
|
|
11
11
|
// src/react/provider.tsx
|
|
12
12
|
import { useState as useState3 } from "react";
|
|
@@ -802,6 +802,35 @@ function useLeaderboard(board, options = {}) {
|
|
|
802
802
|
}, [refresh, member, intervalMs]);
|
|
803
803
|
return { ...state, refresh };
|
|
804
804
|
}
|
|
805
|
+
|
|
806
|
+
// src/react/references.ts
|
|
807
|
+
import { useCallback as useCallback5, useEffect as useEffect8, useState as useState9 } from "react";
|
|
808
|
+
function useReferences(read, failure) {
|
|
809
|
+
const relay = useRelay();
|
|
810
|
+
const [state, setState] = useState9({ status: "loading" });
|
|
811
|
+
const refresh = useCallback5(async () => {
|
|
812
|
+
try {
|
|
813
|
+
setState({ status: "ready", items: await read(relay) });
|
|
814
|
+
} catch (cause) {
|
|
815
|
+
setState({
|
|
816
|
+
status: "error",
|
|
817
|
+
message: cause instanceof Error && cause.message ? cause.message : failure
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
}, [relay, read, failure]);
|
|
821
|
+
useEffect8(() => {
|
|
822
|
+
void refresh();
|
|
823
|
+
}, [refresh]);
|
|
824
|
+
return { ...state, refresh };
|
|
825
|
+
}
|
|
826
|
+
var readPointLedgers = (relay) => relay.pointLedgers.list();
|
|
827
|
+
var readTieredRewards = (relay) => relay.tieredRewards.list();
|
|
828
|
+
function usePointLedgers() {
|
|
829
|
+
return useReferences(readPointLedgers, "Could not load point ledgers.");
|
|
830
|
+
}
|
|
831
|
+
function useTieredRewards() {
|
|
832
|
+
return useReferences(readTieredRewards, "Could not load tiered rewards.");
|
|
833
|
+
}
|
|
805
834
|
export {
|
|
806
835
|
PENDING_POLL_MS,
|
|
807
836
|
RETRY_DELAYS_MS,
|
|
@@ -825,12 +854,14 @@ export {
|
|
|
825
854
|
useExperience,
|
|
826
855
|
useInvitation,
|
|
827
856
|
useLeaderboard,
|
|
857
|
+
usePointLedgers,
|
|
828
858
|
useQuest,
|
|
829
859
|
useReferralSummary,
|
|
830
860
|
useRelay,
|
|
831
861
|
useSignIn,
|
|
832
862
|
useSignInMethods,
|
|
833
863
|
useSignOut,
|
|
864
|
+
useTieredRewards,
|
|
834
865
|
visibleQuests,
|
|
835
866
|
watchRoleDeliveries
|
|
836
867
|
};
|
package/dist/schema.d.ts
CHANGED
|
@@ -22,6 +22,16 @@ declare const tieredRewardDefinitionSchema: z.ZodObject<{
|
|
|
22
22
|
}, z.core.$strict>;
|
|
23
23
|
}, z.core.$strict>;
|
|
24
24
|
type TieredRewardDefinition = z.infer<typeof tieredRewardDefinitionSchema>;
|
|
25
|
+
/**
|
|
26
|
+
* A tiered reward's stored ID with its authoring key, null for rewards created
|
|
27
|
+
* without one. Reads name tiered rewards by ID (`reward.id`); match them against
|
|
28
|
+
* `key` rather than comparing an ID with the key given to defineTieredReward.
|
|
29
|
+
*/
|
|
30
|
+
declare const tieredRewardReferenceSchema: z.ZodObject<{
|
|
31
|
+
id: z.ZodString;
|
|
32
|
+
key: z.ZodNullable<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
type TieredRewardReference = z.infer<typeof tieredRewardReferenceSchema>;
|
|
25
35
|
declare const tierRewardSchema: z.ZodObject<{
|
|
26
36
|
kind: z.ZodLiteral<"tier">;
|
|
27
37
|
reward: z.ZodObject<{
|
|
@@ -2853,8 +2863,6 @@ declare const memberListSchema: z.ZodObject<{
|
|
|
2853
2863
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
2854
2864
|
cursor: z.ZodOptional<z.ZodString>;
|
|
2855
2865
|
}, z.core.$strict>;
|
|
2856
|
-
type ReviewListOptions = z.input<typeof reviewListSchema>;
|
|
2857
|
-
type MemberListOptions = z.input<typeof memberListSchema>;
|
|
2858
2866
|
declare const reviewItemSchema: z.ZodObject<{
|
|
2859
2867
|
attempt: z.ZodObject<{
|
|
2860
2868
|
id: z.ZodString;
|
|
@@ -3124,4 +3132,4 @@ declare const contentPerformancePageSchema: z.ZodObject<{
|
|
|
3124
3132
|
next: z.ZodNullable<z.ZodNumber>;
|
|
3125
3133
|
}, z.core.$strict>;
|
|
3126
3134
|
|
|
3127
|
-
export { type Attempt, type ContentPerformanceSnapshot, type Decision, type Entitlement, type
|
|
3135
|
+
export { type Attempt, type ContentPerformanceSnapshot, type Decision, type Entitlement, type MemberPage, type MemberProgress, type PhotoResult, type PickupAvailability, type PublishedRelease, type QuestAvailability, type QuestDescription, type QuestPresentation, type QuestSettingsInput, type QuizEvidence, type ReleaseInput, type ReviewPage, type Reward, type Snapshot, type SubmissionEvidence, type SubmitInput, type TextResult, type TextReviewInput, type TieredRewardDefinition, type TieredRewardReference, artifactSchema, attemptSchema, batchReleaseSchema, beginHandoverSchema, completionRecordSchema, configurePickupSchema, confirmHandoverSchema, contentPerformancePageSchema, contentPerformanceQuerySchema, contentPerformanceSnapshotSchema, createStockItemSchema, decisionSchema, entitlementSchema, errorSchema, eventSchema, evidenceSchema, identifier, integrationRewardSchema, mediaUrlSchema, memberListSchema, memberPageSchema, memberProgressSchema, photoResultSchema, pickupAllocationSchema, pickupAvailabilitySchema, pickupCatalogSchema, pickupPolicySchema, pickupSelectionSchema, pointsRewardSchema, prerequisiteSchema, publishedReleaseSchema, questAvailabilitySchema, questDescriptionSchema, questPresentationSchema, questSettingsInputSchema, quizAnswersSchema, quizEvidenceSchema, releaseSchema, reservationSchema, reviewItemSchema, reviewListSchema, reviewModeSchema, reviewPageSchema, rewardBundleSchema, rewardKey, rewardSchema, snapshotSchema, staffDecisionSchema, stockItemSchema, stockSchema, storedReviewModeSchema, submissionEvidenceSchema, submitSchema, templateSchema, textResultSchema, textReviewInputSchema, tierRewardSchema, tieredRewardDefinitionSchema, tieredRewardReferenceSchema, triggerSchema };
|
package/dist/schema.js
CHANGED
|
@@ -57,8 +57,9 @@ import {
|
|
|
57
57
|
textReviewInputSchema,
|
|
58
58
|
tierRewardSchema,
|
|
59
59
|
tieredRewardDefinitionSchema,
|
|
60
|
+
tieredRewardReferenceSchema,
|
|
60
61
|
triggerSchema
|
|
61
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-UYS522ER.js";
|
|
62
63
|
export {
|
|
63
64
|
artifactSchema,
|
|
64
65
|
attemptSchema,
|
|
@@ -118,5 +119,6 @@ export {
|
|
|
118
119
|
textReviewInputSchema,
|
|
119
120
|
tierRewardSchema,
|
|
120
121
|
tieredRewardDefinitionSchema,
|
|
122
|
+
tieredRewardReferenceSchema,
|
|
121
123
|
triggerSchema
|
|
122
124
|
};
|