@domino-sdk/relay 0.6.0 → 0.7.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 +7 -2
- package/dist/authoring.js +2 -2
- package/dist/browser.d.ts +67 -42
- package/dist/browser.js +4 -4
- package/dist/{chunk-PLO5PPLU.js → chunk-36LZ3IOO.js} +1 -1
- package/dist/{chunk-MXK7KEDA.js → chunk-6QUCADMF.js} +13 -1
- package/dist/{chunk-CCLIDCUU.js → chunk-LXLNC4CN.js} +178 -169
- package/dist/{chunk-UIC6OF3C.js → chunk-TYVT5BPZ.js} +1 -1
- package/dist/index.d.ts +192 -94
- package/dist/index.js +6 -4
- package/dist/portal-proxy.js +2 -2
- package/dist/schema.d.ts +30 -0
- package/dist/schema.js +1 -1
- package/dist/{settings-BrC6C9yl.d.ts → settings-CU_oBcx0.d.ts} +13 -0
- package/package.json +1 -1
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
referralDefinitionSchema,
|
|
11
11
|
referralHistorySchema,
|
|
12
12
|
referralSummarySchema
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-TYVT5BPZ.js";
|
|
14
14
|
import {
|
|
15
15
|
authScopeSchema,
|
|
16
16
|
exchangeResultSchema,
|
|
17
17
|
sessionSchema
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-36LZ3IOO.js";
|
|
19
19
|
import {
|
|
20
20
|
accountConnectionSchema,
|
|
21
21
|
attemptSchema,
|
|
@@ -39,27 +39,35 @@ import {
|
|
|
39
39
|
settingsValuesSchema,
|
|
40
40
|
snapshotSchema,
|
|
41
41
|
templateSchema
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-6QUCADMF.js";
|
|
43
43
|
|
|
44
|
-
// src/
|
|
44
|
+
// src/point-ledgers.ts
|
|
45
45
|
import { z } from "zod";
|
|
46
|
-
var
|
|
47
|
-
id:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
46
|
+
var pointLedgerSchema = z.object({
|
|
47
|
+
id: identifier,
|
|
48
|
+
name: z.string().trim().min(1).max(120),
|
|
49
|
+
description: z.string().trim().max(1e3).default("")
|
|
50
|
+
}).strict();
|
|
51
|
+
|
|
52
|
+
// src/reward-deliveries.ts
|
|
53
|
+
import { z as z2 } from "zod";
|
|
54
|
+
var rewardDeliverySchema = z2.object({
|
|
55
|
+
id: z2.string(),
|
|
56
|
+
quest: z2.string(),
|
|
57
|
+
completion: z2.string(),
|
|
58
|
+
member: z2.string(),
|
|
59
|
+
provider: z2.literal("discord"),
|
|
60
|
+
action: z2.literal("grant-role"),
|
|
61
|
+
roleId: z2.string(),
|
|
62
|
+
status: z2.enum(["pending", "delivered"]),
|
|
63
|
+
attempts: z2.number().int(),
|
|
64
|
+
nextAt: z2.number(),
|
|
65
|
+
lastError: z2.string().nullable(),
|
|
66
|
+
createdAt: z2.number(),
|
|
67
|
+
deliveredAt: z2.number().nullable()
|
|
60
68
|
});
|
|
61
|
-
var rewardDeliveriesSchema =
|
|
62
|
-
deliveries:
|
|
69
|
+
var rewardDeliveriesSchema = z2.object({
|
|
70
|
+
deliveries: z2.array(rewardDeliverySchema)
|
|
63
71
|
});
|
|
64
72
|
|
|
65
73
|
// src/resource-id.ts
|
|
@@ -76,8 +84,8 @@ function resourceId(prefix) {
|
|
|
76
84
|
}
|
|
77
85
|
|
|
78
86
|
// src/catalog.ts
|
|
79
|
-
import { z as
|
|
80
|
-
var interactionSchema =
|
|
87
|
+
import { z as z3 } from "zod";
|
|
88
|
+
var interactionSchema = z3.enum([
|
|
81
89
|
"photo",
|
|
82
90
|
"quiz",
|
|
83
91
|
"claim",
|
|
@@ -87,103 +95,103 @@ var interactionSchema = z2.enum([
|
|
|
87
95
|
function questInteraction(trigger) {
|
|
88
96
|
return trigger.kind === "automatic" ? "automatic" : trigger.actor === "staff" ? "staff" : trigger.input === "none" ? "claim" : trigger.input;
|
|
89
97
|
}
|
|
90
|
-
var questTypeVersionSchema =
|
|
98
|
+
var questTypeVersionSchema = z3.object({
|
|
91
99
|
id: identifier,
|
|
92
100
|
version: identifier,
|
|
93
|
-
code:
|
|
101
|
+
code: z3.string(),
|
|
94
102
|
definition: questDescriptionSchema,
|
|
95
103
|
provider: reviewModeSchema,
|
|
96
|
-
createdAt:
|
|
104
|
+
createdAt: z3.number()
|
|
97
105
|
});
|
|
98
|
-
var collectionSlotSchema =
|
|
106
|
+
var collectionSlotSchema = z3.object({ id: identifier, title: z3.string().trim().min(1).max(120) }).strict();
|
|
99
107
|
var questCollectionSchema = collectionSlotSchema.extend({
|
|
100
|
-
quests:
|
|
108
|
+
quests: z3.array(identifier).max(100).refine(
|
|
101
109
|
(v) => new Set(v).size === v.length,
|
|
102
110
|
"A collection can contain a quest only once"
|
|
103
111
|
)
|
|
104
112
|
});
|
|
105
|
-
var questInstanceSchema =
|
|
113
|
+
var questInstanceSchema = z3.object({
|
|
106
114
|
id: identifier,
|
|
107
|
-
title:
|
|
115
|
+
title: z3.string().trim().min(1).max(120),
|
|
108
116
|
typeVersion: identifier,
|
|
109
117
|
settings: settingsValuesSchema,
|
|
110
|
-
requires:
|
|
111
|
-
status:
|
|
118
|
+
requires: z3.array(identifier).max(30),
|
|
119
|
+
status: z3.enum(["active", "paused", "archived"])
|
|
112
120
|
}).strict();
|
|
113
|
-
var questDraftChangesSchema =
|
|
114
|
-
quests:
|
|
121
|
+
var questDraftChangesSchema = z3.object({
|
|
122
|
+
quests: z3.array(
|
|
115
123
|
questInstanceSchema.extend({ expectedRelease: identifier.nullable() })
|
|
116
124
|
).max(50),
|
|
117
|
-
collections:
|
|
125
|
+
collections: z3.array(questCollectionSchema).max(50)
|
|
118
126
|
}).strict();
|
|
119
|
-
var draftBase =
|
|
127
|
+
var draftBase = z3.object({
|
|
120
128
|
id: identifier,
|
|
121
|
-
revision:
|
|
122
|
-
baseRevision:
|
|
129
|
+
revision: z3.number().int().positive(),
|
|
130
|
+
baseRevision: z3.number().int().nonnegative(),
|
|
123
131
|
changes: questDraftChangesSchema
|
|
124
132
|
});
|
|
125
|
-
var questDraftSchema =
|
|
126
|
-
draftBase.extend({ status:
|
|
133
|
+
var questDraftSchema = z3.discriminatedUnion("status", [
|
|
134
|
+
draftBase.extend({ status: z3.literal("draft") }),
|
|
127
135
|
draftBase.extend({
|
|
128
|
-
status:
|
|
129
|
-
releaseIds:
|
|
136
|
+
status: z3.literal("published"),
|
|
137
|
+
releaseIds: z3.array(identifier)
|
|
130
138
|
})
|
|
131
139
|
]);
|
|
132
|
-
var questCatalogSchema =
|
|
133
|
-
revision:
|
|
134
|
-
types:
|
|
135
|
-
collections:
|
|
136
|
-
quests:
|
|
137
|
-
drafts:
|
|
138
|
-
releases:
|
|
139
|
-
supportedInteractions:
|
|
140
|
+
var questCatalogSchema = z3.object({
|
|
141
|
+
revision: z3.number().int().nonnegative(),
|
|
142
|
+
types: z3.array(questTypeVersionSchema),
|
|
143
|
+
collections: z3.array(questCollectionSchema),
|
|
144
|
+
quests: z3.array(questInstanceSchema),
|
|
145
|
+
drafts: z3.array(questDraftSchema),
|
|
146
|
+
releases: z3.array(publishedReleaseSchema).default([]),
|
|
147
|
+
supportedInteractions: z3.array(interactionSchema)
|
|
140
148
|
});
|
|
141
|
-
var catalogDeploymentSchema =
|
|
142
|
-
expectedRevision:
|
|
143
|
-
types:
|
|
144
|
-
|
|
145
|
-
code:
|
|
149
|
+
var catalogDeploymentSchema = z3.object({
|
|
150
|
+
expectedRevision: z3.number().int().nonnegative(),
|
|
151
|
+
types: z3.array(
|
|
152
|
+
z3.object({
|
|
153
|
+
code: z3.string().min(1).max(1e6),
|
|
146
154
|
provider: reviewModeSchema
|
|
147
155
|
})
|
|
148
156
|
).max(50).default([]),
|
|
149
|
-
collections:
|
|
150
|
-
supportedInteractions:
|
|
157
|
+
collections: z3.array(collectionSlotSchema).max(50).default([]),
|
|
158
|
+
supportedInteractions: z3.array(interactionSchema).min(1).optional()
|
|
151
159
|
}).strict();
|
|
152
|
-
var catalogDeploymentPreviewSchema =
|
|
153
|
-
revision:
|
|
154
|
-
types:
|
|
155
|
-
collections:
|
|
156
|
-
supportedInteractions:
|
|
160
|
+
var catalogDeploymentPreviewSchema = z3.object({
|
|
161
|
+
revision: z3.number().int().nonnegative(),
|
|
162
|
+
types: z3.array(questTypeVersionSchema),
|
|
163
|
+
collections: z3.array(collectionSlotSchema),
|
|
164
|
+
supportedInteractions: z3.array(interactionSchema)
|
|
157
165
|
});
|
|
158
|
-
var saveQuestDraftSchema =
|
|
166
|
+
var saveQuestDraftSchema = z3.object({
|
|
159
167
|
id: identifier,
|
|
160
|
-
expectedRevision:
|
|
161
|
-
baseRevision:
|
|
168
|
+
expectedRevision: z3.number().int().nonnegative(),
|
|
169
|
+
baseRevision: z3.number().int().nonnegative(),
|
|
162
170
|
changes: questDraftChangesSchema
|
|
163
171
|
}).strict();
|
|
164
|
-
var publishQuestDraftSchema =
|
|
172
|
+
var publishQuestDraftSchema = z3.object({ id: identifier, expectedRevision: z3.number().int().positive() }).strict();
|
|
165
173
|
var questViewSchema = memberProgressSchema.shape.quests.element.extend(
|
|
166
174
|
{
|
|
167
175
|
release: identifier,
|
|
168
176
|
interaction: interactionSchema,
|
|
169
|
-
lifecycle:
|
|
170
|
-
rewards:
|
|
177
|
+
lifecycle: z3.enum(["active", "paused", "archived"]),
|
|
178
|
+
rewards: z3.array(z3.object({ label: z3.string() }))
|
|
171
179
|
}
|
|
172
180
|
);
|
|
173
|
-
var collectionViewSchema =
|
|
181
|
+
var collectionViewSchema = z3.object({
|
|
174
182
|
id: identifier,
|
|
175
|
-
title:
|
|
176
|
-
quests:
|
|
183
|
+
title: z3.string(),
|
|
184
|
+
quests: z3.array(questViewSchema)
|
|
177
185
|
});
|
|
178
|
-
var questExperienceSchema =
|
|
186
|
+
var questExperienceSchema = z3.object({
|
|
179
187
|
member: identifier,
|
|
180
|
-
quests:
|
|
181
|
-
collections:
|
|
188
|
+
quests: z3.array(questViewSchema),
|
|
189
|
+
collections: z3.array(collectionViewSchema)
|
|
182
190
|
});
|
|
183
|
-
var questPublicationPreviewSchema =
|
|
191
|
+
var questPublicationPreviewSchema = z3.object({
|
|
184
192
|
draft: questDraftSchema,
|
|
185
|
-
releases:
|
|
186
|
-
affectedCollections:
|
|
193
|
+
releases: z3.array(publishedReleaseSchema),
|
|
194
|
+
affectedCollections: z3.array(questCollectionSchema)
|
|
187
195
|
});
|
|
188
196
|
|
|
189
197
|
// src/errors.ts
|
|
@@ -200,43 +208,43 @@ var RelayError = class extends Error {
|
|
|
200
208
|
};
|
|
201
209
|
|
|
202
210
|
// src/submissions.ts
|
|
203
|
-
import { z as
|
|
211
|
+
import { z as z4 } from "zod";
|
|
204
212
|
var common = {
|
|
205
213
|
id: identifier,
|
|
206
214
|
quest: identifier,
|
|
207
215
|
release: identifier.optional()
|
|
208
216
|
};
|
|
209
|
-
var claimInputSchema =
|
|
217
|
+
var claimInputSchema = z4.union([
|
|
210
218
|
quizEvidenceSchema,
|
|
211
|
-
|
|
219
|
+
z4.object({ kind: z4.literal("none") }).strict()
|
|
212
220
|
]);
|
|
213
|
-
var draftSchema =
|
|
221
|
+
var draftSchema = z4.union([
|
|
214
222
|
claimInputSchema,
|
|
215
|
-
|
|
223
|
+
z4.object({ kind: z4.literal("photo"), file: z4.instanceof(Blob) })
|
|
216
224
|
]);
|
|
217
|
-
var recordSchema =
|
|
218
|
-
|
|
225
|
+
var recordSchema = z4.union([
|
|
226
|
+
z4.object({
|
|
219
227
|
...common,
|
|
220
|
-
stage:
|
|
228
|
+
stage: z4.literal("review"),
|
|
221
229
|
draft: draftSchema.nullable()
|
|
222
230
|
}),
|
|
223
|
-
|
|
224
|
-
|
|
231
|
+
z4.object({ ...common, stage: z4.literal("upload"), file: z4.instanceof(Blob) }),
|
|
232
|
+
z4.object({
|
|
225
233
|
...common,
|
|
226
|
-
stage:
|
|
234
|
+
stage: z4.literal("claim"),
|
|
227
235
|
evidence: identifier,
|
|
228
|
-
file:
|
|
236
|
+
file: z4.instanceof(Blob).optional()
|
|
229
237
|
}),
|
|
230
|
-
|
|
238
|
+
z4.object({
|
|
231
239
|
...common,
|
|
232
|
-
stage:
|
|
240
|
+
stage: z4.literal("submitted"),
|
|
233
241
|
evidence: identifier,
|
|
234
242
|
attempt: identifier
|
|
235
243
|
}),
|
|
236
|
-
|
|
237
|
-
|
|
244
|
+
z4.object({ ...common, stage: z4.literal("claim"), input: claimInputSchema }),
|
|
245
|
+
z4.object({
|
|
238
246
|
...common,
|
|
239
|
-
stage:
|
|
247
|
+
stage: z4.literal("submitted"),
|
|
240
248
|
input: claimInputSchema,
|
|
241
249
|
attempt: identifier
|
|
242
250
|
})
|
|
@@ -650,56 +658,56 @@ function observeProgress(transport, listener, options = {}, onDispose = () => {
|
|
|
650
658
|
}
|
|
651
659
|
|
|
652
660
|
// src/index.ts
|
|
653
|
-
import { z as
|
|
661
|
+
import { z as z9 } from "zod";
|
|
654
662
|
|
|
655
663
|
// src/wallet.ts
|
|
656
|
-
import { z as
|
|
657
|
-
var solanaAddressSchema =
|
|
658
|
-
var walletConnectionSchema =
|
|
659
|
-
chain:
|
|
664
|
+
import { z as z5 } from "zod";
|
|
665
|
+
var solanaAddressSchema = z5.string().min(32).max(44).regex(/^[1-9A-HJ-NP-Za-km-z]+$/);
|
|
666
|
+
var walletConnectionSchema = z5.object({
|
|
667
|
+
chain: z5.literal("solana"),
|
|
660
668
|
address: solanaAddressSchema,
|
|
661
|
-
verifiedAt:
|
|
662
|
-
revision:
|
|
669
|
+
verifiedAt: z5.number().int().nonnegative(),
|
|
670
|
+
revision: z5.number().int().positive()
|
|
663
671
|
}).strict();
|
|
664
|
-
var walletChallengeInputSchema =
|
|
665
|
-
chain:
|
|
672
|
+
var walletChallengeInputSchema = z5.object({
|
|
673
|
+
chain: z5.literal("solana"),
|
|
666
674
|
address: solanaAddressSchema
|
|
667
675
|
}).strict();
|
|
668
676
|
var walletChallengeSchema = walletChallengeInputSchema.extend({
|
|
669
|
-
id:
|
|
670
|
-
message:
|
|
671
|
-
expiresAt:
|
|
677
|
+
id: z5.string().uuid(),
|
|
678
|
+
message: z5.string(),
|
|
679
|
+
expiresAt: z5.number()
|
|
672
680
|
});
|
|
673
|
-
var walletProofSchema =
|
|
674
|
-
challenge:
|
|
675
|
-
signature:
|
|
681
|
+
var walletProofSchema = z5.object({
|
|
682
|
+
challenge: z5.string().uuid(),
|
|
683
|
+
signature: z5.string().min(64).max(88).regex(/^[1-9A-HJ-NP-Za-km-z]+$/)
|
|
676
684
|
}).strict();
|
|
677
|
-
var solanaBalanceSchema =
|
|
685
|
+
var solanaBalanceSchema = z5.object({
|
|
678
686
|
address: solanaAddressSchema,
|
|
679
|
-
network:
|
|
680
|
-
lamports:
|
|
681
|
-
slot:
|
|
682
|
-
observedAt:
|
|
687
|
+
network: z5.literal("mainnet-beta"),
|
|
688
|
+
lamports: z5.string().regex(/^(0|[1-9][0-9]*)$/),
|
|
689
|
+
slot: z5.number().int().nonnegative().safe(),
|
|
690
|
+
observedAt: z5.number().int().nonnegative()
|
|
683
691
|
}).strict();
|
|
684
692
|
|
|
685
693
|
// src/collection.ts
|
|
686
|
-
import { z as
|
|
687
|
-
var collectionCodeSchema =
|
|
688
|
-
var collectionPassSchema =
|
|
694
|
+
import { z as z6 } from "zod";
|
|
695
|
+
var collectionCodeSchema = z6.string().regex(/^relay:collect:[a-f0-9]{64}$/);
|
|
696
|
+
var collectionPassSchema = z6.object({
|
|
689
697
|
code: collectionCodeSchema,
|
|
690
|
-
expiresAt:
|
|
698
|
+
expiresAt: z6.number(),
|
|
691
699
|
entitlement: identifier
|
|
692
700
|
});
|
|
693
|
-
var collectionResolveSchema =
|
|
701
|
+
var collectionResolveSchema = z6.object({ code: collectionCodeSchema }).strict();
|
|
694
702
|
var collectionBeginSchema = collectionResolveSchema.extend({
|
|
695
703
|
actionId: identifier,
|
|
696
|
-
revision:
|
|
704
|
+
revision: z6.number().int().positive(),
|
|
697
705
|
selection: pickupSelectionSchema.optional()
|
|
698
706
|
});
|
|
699
|
-
var collectionPreviewSchema =
|
|
707
|
+
var collectionPreviewSchema = z6.object({
|
|
700
708
|
entitlement: entitlementSchema,
|
|
701
709
|
inventory: pickupAvailabilitySchema,
|
|
702
|
-
expiresAt:
|
|
710
|
+
expiresAt: z6.number()
|
|
703
711
|
});
|
|
704
712
|
|
|
705
713
|
// src/configuration.ts
|
|
@@ -717,53 +725,53 @@ function questConfiguration(release) {
|
|
|
717
725
|
}
|
|
718
726
|
|
|
719
727
|
// src/deployments.ts
|
|
720
|
-
import { z as
|
|
728
|
+
import { z as z7 } from "zod";
|
|
721
729
|
var projectCatalogArtifactSchema = catalogDeploymentSchema.omit({ expectedRevision: true }).extend({
|
|
722
|
-
referrals:
|
|
723
|
-
leaderboards:
|
|
730
|
+
referrals: z7.array(referralArtifactSchema).max(50).default([]),
|
|
731
|
+
leaderboards: z7.array(leaderboardArtifactSchema).max(50).default([])
|
|
724
732
|
});
|
|
725
|
-
var projectDeploymentSchema = projectCatalogArtifactSchema.extend({ releases:
|
|
733
|
+
var projectDeploymentSchema = projectCatalogArtifactSchema.extend({ releases: z7.array(releaseSchema).max(50).default([]) }).refine(
|
|
726
734
|
(value) => value.releases.length > 0 || value.leaderboards.length > 0 || value.referrals.length > 0 || value.types.length > 0 || value.collections.length > 0 || value.supportedInteractions !== void 0,
|
|
727
735
|
"No resources configured. Add quests, questTypes, leaderboards, collections, or supportedInteractions to relay.json."
|
|
728
736
|
);
|
|
729
|
-
var deploymentPreviewSchema =
|
|
737
|
+
var deploymentPreviewSchema = z7.object({
|
|
730
738
|
id: identifier,
|
|
731
|
-
baseRevision:
|
|
732
|
-
releases:
|
|
733
|
-
types:
|
|
734
|
-
collections:
|
|
735
|
-
supportedInteractions:
|
|
736
|
-
referrals:
|
|
737
|
-
leaderboards:
|
|
739
|
+
baseRevision: z7.number().int().nonnegative(),
|
|
740
|
+
releases: z7.array(publishedReleaseSchema),
|
|
741
|
+
types: z7.array(questTypeVersionSchema),
|
|
742
|
+
collections: z7.array(questCollectionSchema),
|
|
743
|
+
supportedInteractions: z7.array(interactionSchema),
|
|
744
|
+
referrals: z7.array(publishedReferralSchema).default([]),
|
|
745
|
+
leaderboards: z7.array(leaderboardPreviewSchema).default([])
|
|
738
746
|
});
|
|
739
|
-
var publishDeploymentSchema =
|
|
747
|
+
var publishDeploymentSchema = z7.object({ id: identifier }).strict();
|
|
740
748
|
var deploymentResultSchema = deploymentPreviewSchema.extend({
|
|
741
|
-
revision:
|
|
749
|
+
revision: z7.number().int().positive()
|
|
742
750
|
});
|
|
743
751
|
|
|
744
752
|
// src/identity-integration.ts
|
|
745
|
-
import { z as
|
|
746
|
-
var identityIntegrationInputSchema =
|
|
747
|
-
name:
|
|
748
|
-
origin:
|
|
753
|
+
import { z as z8 } from "zod";
|
|
754
|
+
var identityIntegrationInputSchema = z8.object({
|
|
755
|
+
name: z8.string().trim().min(1).max(80),
|
|
756
|
+
origin: z8.string().url().refine((value) => {
|
|
749
757
|
const url = new URL(value);
|
|
750
758
|
return url.protocol === "https:" && url.origin === value;
|
|
751
759
|
}, "Use an exact HTTPS application origin")
|
|
752
760
|
}).strict();
|
|
753
761
|
var identityIntegrationSchema = authScopeSchema.extend({
|
|
754
|
-
id:
|
|
755
|
-
name:
|
|
756
|
-
origin:
|
|
757
|
-
expiresAt:
|
|
762
|
+
id: z8.string().uuid(),
|
|
763
|
+
name: z8.string(),
|
|
764
|
+
origin: z8.string(),
|
|
765
|
+
expiresAt: z8.number()
|
|
758
766
|
});
|
|
759
767
|
var identityIntegrationSecretSchema = identityIntegrationSchema.extend(
|
|
760
768
|
{
|
|
761
|
-
token:
|
|
769
|
+
token: z8.string()
|
|
762
770
|
}
|
|
763
771
|
);
|
|
764
|
-
var participantExchangeSchema =
|
|
765
|
-
subject:
|
|
766
|
-
previousToken:
|
|
772
|
+
var participantExchangeSchema = z8.object({
|
|
773
|
+
subject: z8.string().min(1).max(200),
|
|
774
|
+
previousToken: z8.string().max(200).optional()
|
|
767
775
|
}).strict();
|
|
768
776
|
|
|
769
777
|
// src/index.ts
|
|
@@ -876,19 +884,19 @@ function createRelayClient(options) {
|
|
|
876
884
|
}
|
|
877
885
|
return {
|
|
878
886
|
referrals: {
|
|
879
|
-
list: () => request("/v1/referrals",
|
|
887
|
+
list: () => request("/v1/referrals", z9.array(referralDefinitionSchema)),
|
|
880
888
|
summary: () => request("/v1/referrals/me", referralSummarySchema),
|
|
881
889
|
history: (before) => request(
|
|
882
890
|
query("/v1/referrals/history", { before }),
|
|
883
891
|
referralHistorySchema
|
|
884
892
|
),
|
|
885
|
-
accept: (input) => request("/v1/referrals/accept",
|
|
893
|
+
accept: (input) => request("/v1/referrals/accept", z9.object({ ok: z9.literal(true) }), {
|
|
886
894
|
method: "POST",
|
|
887
895
|
body: JSON.stringify(referralAcceptSchema.parse(input))
|
|
888
896
|
})
|
|
889
897
|
},
|
|
890
898
|
leaderboards: {
|
|
891
|
-
list: () => request("/v1/leaderboards",
|
|
899
|
+
list: () => request("/v1/leaderboards", z9.array(leaderboardDefinitionSchema)),
|
|
892
900
|
standings: (board, options2 = {}) => {
|
|
893
901
|
const parsed = leaderboardQuerySchema.parse(options2);
|
|
894
902
|
return request(
|
|
@@ -968,25 +976,25 @@ function createRelayClient(options) {
|
|
|
968
976
|
auth: {
|
|
969
977
|
providers: () => request(
|
|
970
978
|
"/v1/auth/providers",
|
|
971
|
-
|
|
972
|
-
providers:
|
|
973
|
-
|
|
979
|
+
z9.object({
|
|
980
|
+
providers: z9.array(
|
|
981
|
+
z9.object({
|
|
974
982
|
provider: authProviderSchema,
|
|
975
|
-
configured:
|
|
983
|
+
configured: z9.boolean()
|
|
976
984
|
})
|
|
977
985
|
),
|
|
978
|
-
email:
|
|
979
|
-
demo:
|
|
986
|
+
email: z9.boolean(),
|
|
987
|
+
demo: z9.boolean()
|
|
980
988
|
})
|
|
981
989
|
),
|
|
982
990
|
start: (provider, mode) => request(
|
|
983
991
|
"/v1/auth/start",
|
|
984
|
-
|
|
992
|
+
z9.object({ url: z9.string() }),
|
|
985
993
|
json({ provider, mode })
|
|
986
994
|
),
|
|
987
995
|
emailStart: (email) => request(
|
|
988
996
|
"/v1/auth/email/start",
|
|
989
|
-
|
|
997
|
+
z9.object({ challenge: z9.string() }),
|
|
990
998
|
json({ email })
|
|
991
999
|
),
|
|
992
1000
|
emailVerify: (challenge, code) => changeSession(
|
|
@@ -996,25 +1004,25 @@ function createRelayClient(options) {
|
|
|
996
1004
|
json({ challenge, code })
|
|
997
1005
|
)
|
|
998
1006
|
),
|
|
999
|
-
accounts: () => request("/v1/auth/accounts",
|
|
1007
|
+
accounts: () => request("/v1/auth/accounts", z9.array(accountConnectionSchema)),
|
|
1000
1008
|
disconnect: (provider) => request(
|
|
1001
1009
|
"/v1/auth/accounts/disconnect",
|
|
1002
|
-
|
|
1010
|
+
z9.object({ ok: z9.boolean() }),
|
|
1003
1011
|
json({ provider })
|
|
1004
1012
|
),
|
|
1005
1013
|
connections: () => request(
|
|
1006
1014
|
"/v1/auth/connections",
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
provider:
|
|
1010
|
-
subject:
|
|
1011
|
-
signInEnabled:
|
|
1015
|
+
z9.array(
|
|
1016
|
+
z9.object({
|
|
1017
|
+
provider: z9.string(),
|
|
1018
|
+
subject: z9.string(),
|
|
1019
|
+
signInEnabled: z9.boolean()
|
|
1012
1020
|
})
|
|
1013
1021
|
)
|
|
1014
1022
|
),
|
|
1015
1023
|
session: () => request("/v1/auth/session", sessionSchema.nullable()),
|
|
1016
1024
|
signOut: () => changeSession(
|
|
1017
|
-
() => request("/v1/auth/logout",
|
|
1025
|
+
() => request("/v1/auth/logout", z9.object({ ok: z9.boolean() }), json({}))
|
|
1018
1026
|
),
|
|
1019
1027
|
/** Local development only. Existing hosted apps use createParticipantBackend from /portal-proxy. */
|
|
1020
1028
|
exchange: (input) => request("/v1/auth/exchange", exchangeResultSchema, json(input))
|
|
@@ -1090,16 +1098,16 @@ function createRelayClient(options) {
|
|
|
1090
1098
|
},
|
|
1091
1099
|
lookupMember: (issuer, subject) => request(
|
|
1092
1100
|
"/v1/members/lookup",
|
|
1093
|
-
|
|
1101
|
+
z9.object({ member: z9.string() }),
|
|
1094
1102
|
json({ issuer, subject })
|
|
1095
1103
|
),
|
|
1096
|
-
journeyTemplate: () => request("/v1/journey-template",
|
|
1104
|
+
journeyTemplate: () => request("/v1/journey-template", z9.array(templateSchema)),
|
|
1097
1105
|
template: () => request("/v1/template", templateSchema),
|
|
1098
1106
|
snapshot: () => request("/v1/snapshot", snapshotSchema),
|
|
1099
1107
|
publish: (release) => request("/v1/releases", publishedReleaseSchema, json(release)),
|
|
1100
1108
|
publishBatch: (releases) => request(
|
|
1101
1109
|
"/v1/releases/batch",
|
|
1102
|
-
|
|
1110
|
+
z9.array(publishedReleaseSchema),
|
|
1103
1111
|
json({ releases })
|
|
1104
1112
|
),
|
|
1105
1113
|
progress: (member) => request(
|
|
@@ -1124,6 +1132,7 @@ function createRelayClient(options) {
|
|
|
1124
1132
|
}
|
|
1125
1133
|
|
|
1126
1134
|
export {
|
|
1135
|
+
pointLedgerSchema,
|
|
1127
1136
|
rewardDeliverySchema,
|
|
1128
1137
|
rewardDeliveriesSchema,
|
|
1129
1138
|
resourceId,
|