@domino-sdk/relay 1.0.0-next.9 → 1.0.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/README.md +1 -1
- package/dist/activity-DeKJsRry.d.ts +9112 -0
- package/dist/authoring.d.ts +1027 -233
- package/dist/authoring.js +478 -277
- package/dist/automatic-outcomes-B1xrETxm.d.ts +758 -0
- package/dist/avatar.d.ts +2 -2
- package/dist/browser-DFe7sWSN.d.ts +4154 -0
- package/dist/browser.d.ts +11 -2613
- package/dist/browser.js +8 -6
- package/dist/{integrations-Ba5TtqTv.d.ts → capability-error-DNMwKmlL.d.ts} +124 -76
- package/dist/{chunk-PHU5VDLR.js → chunk-36HTX2BM.js} +389 -169
- package/dist/chunk-6QJ3LADK.js +112 -0
- package/dist/{chunk-4LBUTHD6.js → chunk-BGGKNIRP.js} +1 -1
- package/dist/chunk-EYH5RDIE.js +496 -0
- package/dist/chunk-GQKYAQM6.js +84 -0
- package/dist/chunk-GUP7YRR4.js +42 -0
- package/dist/{chunk-X2F2RAR3.js → chunk-GZ6FJAXN.js} +380 -128
- package/dist/chunk-JON5SESL.js +2986 -0
- package/dist/chunk-MC6V6VMG.js +49 -0
- package/dist/chunk-NPGENI7K.js +37 -0
- package/dist/chunk-VFHHLN6A.js +284 -0
- package/dist/chunk-WJSSJ7AF.js +151 -0
- package/dist/{chunk-7Q4BGGT6.js → chunk-XFMSUPNS.js} +1 -1
- package/dist/{chunk-P6FK43GG.js → chunk-ZVIRG24J.js} +145 -42
- package/dist/{client-CT4-S5vc.d.ts → client-XiuFnug_.d.ts} +2161 -615
- package/dist/{submission-input-0OOGaq8c.d.ts → groups-Ck-OxzjD.d.ts} +916 -1139
- package/dist/identity-integration-GxAHdKR2.d.ts +58 -0
- package/dist/images-Dv-P5VBw.d.ts +234 -0
- package/dist/index.d.ts +13 -9
- package/dist/index.js +17 -6
- package/dist/internal.d.ts +82 -44
- package/dist/internal.js +43 -89
- package/dist/offers-Cy-e4o5x.d.ts +431 -0
- package/dist/{pages-D3titw5B.d.ts → outcomes-kVB-Juzs.d.ts} +2157 -1448
- package/dist/pages-BBYD21IE.d.ts +359 -0
- package/dist/participant-rewards-3duLb8YJ.d.ts +668 -0
- package/dist/portal-proxy.js +22 -4
- package/dist/{profiles-DDMFBRKe.d.ts → profiles-D2aFcOxu.d.ts} +15 -15
- package/dist/react/index.d.ts +3038 -1029
- package/dist/react/index.js +1627 -779
- package/dist/request-error-DWduJCGV.d.ts +62 -0
- package/dist/schema-DfJzH2ci.d.ts +5644 -0
- package/dist/schema.d.ts +15 -4168
- package/dist/schema.js +310 -81
- package/dist/server/index.d.ts +81498 -0
- package/dist/server/index.js +2520 -0
- package/dist/{streaks-CwGReWGt.d.ts → streaks-CWyq8Px5.d.ts} +2 -4
- package/dist/submission-input-BZkm6ohU.d.ts +290 -0
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +1 -0
- package/dist/{wallet-BGOfFkG9.d.ts → wallet-YssWxGg8.d.ts} +35 -38
- package/package.json +8 -2
- package/dist/chunk-QR7ZA2BJ.js +0 -257
- package/dist/chunk-YYD4QUBO.js +0 -2348
- package/dist/chunk-ZWY3R6B3.js +0 -26
- package/dist/collection-BGneJ6Bk.d.ts +0 -114
- package/dist/images-BTgk6OmC.d.ts +0 -1564
- package/dist/point-ledgers-iS00Z_v0.d.ts +0 -37
- package/dist/schema-Di3aLSiK.d.ts +0 -3532
package/dist/portal-proxy.js
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
|
+
isActivityParticipantRoute,
|
|
2
3
|
isContentParticipantRoute,
|
|
4
|
+
isOfferParticipantRoute,
|
|
5
|
+
isPointsParticipantRoute,
|
|
3
6
|
isProfileParticipantRoute,
|
|
7
|
+
isQuestOutcomeParticipantRoute,
|
|
8
|
+
isRewardsParticipantRoute,
|
|
4
9
|
isWalletParticipantRoute,
|
|
5
10
|
isWalletSignInRoute
|
|
6
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-GUP7YRR4.js";
|
|
7
12
|
import {
|
|
8
13
|
exchangeResultSchema
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-XFMSUPNS.js";
|
|
15
|
+
import "./chunk-JON5SESL.js";
|
|
11
16
|
|
|
12
17
|
// src/portal-proxy.ts
|
|
13
18
|
async function proxyParticipant(request, upstream) {
|
|
@@ -17,7 +22,7 @@ async function proxyParticipant(request, upstream) {
|
|
|
17
22
|
path
|
|
18
23
|
) || /^\/v1\/me\/(progress|experience|attempts|evidence|collection-pass)$/.test(
|
|
19
24
|
path
|
|
20
|
-
) || isWalletParticipantRoute(path) || isWalletSignInRoute(path) || path === "/v1/me" && request.method === "GET" || /^\/v1\/attempts\/[\w-]+\/retry$/.test(path) || /^\/v1\/referrals(?:\/(me|history))?$/.test(path) && request.method === "GET" || isContentParticipantRoute(path, request.method) || isProfileParticipantRoute(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"));
|
|
25
|
+
) || isWalletParticipantRoute(path) || isWalletSignInRoute(path) || path === "/v1/me" && request.method === "GET" || /^\/v1\/attempts\/[\w-]+\/retry$/.test(path) || /^\/v1\/referrals(?:\/(me|history))?$/.test(path) && request.method === "GET" || isContentParticipantRoute(path, request.method) || isQuestOutcomeParticipantRoute(path, request.method) || isProfileParticipantRoute(path, request.method) || isPointsParticipantRoute(path, request.method) || isRewardsParticipantRoute(path, request.method) || isActivityParticipantRoute(path, request.method) || isOfferParticipantRoute(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"));
|
|
21
26
|
if (!allowed || !["GET", "POST"].includes(request.method)) {
|
|
22
27
|
return Response.json({ error: "Route not found" }, { status: 404 });
|
|
23
28
|
}
|
|
@@ -111,6 +116,19 @@ function createParticipantBackend(options) {
|
|
|
111
116
|
},
|
|
112
117
|
body: JSON.stringify({ subject: identity.subject, previousToken })
|
|
113
118
|
});
|
|
119
|
+
if (exchanged.status === 409) {
|
|
120
|
+
const body = await exchanged.json().catch(() => null);
|
|
121
|
+
return Response.json(
|
|
122
|
+
{
|
|
123
|
+
error: typeof body?.error === "string" ? body.error : "Domino refused this account. Ask an organizer.",
|
|
124
|
+
...typeof body?.code === "string" ? { code: body.code } : {}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
status: 409,
|
|
128
|
+
headers: { "Set-Cookie": cookie(""), "Cache-Control": "no-store" }
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
}
|
|
114
132
|
if (!exchanged.ok) {
|
|
115
133
|
return reject(
|
|
116
134
|
"Domino identity exchange failed. Check the server integration key and its expiry in Console Settings.",
|
|
@@ -9,9 +9,9 @@ declare const profileVisibilitySchema: z.ZodEnum<{
|
|
|
9
9
|
type ProfileVisibility = z.infer<typeof profileVisibilitySchema>;
|
|
10
10
|
/** Connected accounts a member can take a picture from. */
|
|
11
11
|
declare const avatarProviderSchema: z.ZodEnum<{
|
|
12
|
+
discord: "discord";
|
|
12
13
|
google: "google";
|
|
13
14
|
x: "x";
|
|
14
|
-
discord: "discord";
|
|
15
15
|
}>;
|
|
16
16
|
type AvatarProvider = z.infer<typeof avatarProviderSchema>;
|
|
17
17
|
/**
|
|
@@ -19,8 +19,8 @@ type AvatarProvider = z.infer<typeof avatarProviderSchema>;
|
|
|
19
19
|
* accounts are usually a legal name and a personal photo, so they never do.
|
|
20
20
|
*/
|
|
21
21
|
declare const profileDefaultProviderSchema: z.ZodEnum<{
|
|
22
|
-
x: "x";
|
|
23
22
|
discord: "discord";
|
|
23
|
+
x: "x";
|
|
24
24
|
}>;
|
|
25
25
|
type ProfileDefaultProvider = z.infer<typeof profileDefaultProviderSchema>;
|
|
26
26
|
/**
|
|
@@ -28,8 +28,8 @@ type ProfileDefaultProvider = z.infer<typeof profileDefaultProviderSchema>;
|
|
|
28
28
|
* accounts the member connected that has one, in order. Empty means generated values.
|
|
29
29
|
*/
|
|
30
30
|
declare const profileDefaultsSchema: z.ZodArray<z.ZodEnum<{
|
|
31
|
-
x: "x";
|
|
32
31
|
discord: "discord";
|
|
32
|
+
x: "x";
|
|
33
33
|
}>>;
|
|
34
34
|
type ProfileDefaults = z.infer<typeof profileDefaultsSchema>;
|
|
35
35
|
/**
|
|
@@ -49,9 +49,9 @@ declare const profileAvatarSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
49
49
|
}, z.core.$strip>, z.ZodObject<{
|
|
50
50
|
source: z.ZodLiteral<"account">;
|
|
51
51
|
provider: z.ZodEnum<{
|
|
52
|
+
discord: "discord";
|
|
52
53
|
google: "google";
|
|
53
54
|
x: "x";
|
|
54
|
-
discord: "discord";
|
|
55
55
|
}>;
|
|
56
56
|
url: z.ZodString;
|
|
57
57
|
seed: z.ZodString;
|
|
@@ -71,9 +71,9 @@ declare const profileSummarySchema: z.ZodObject<{
|
|
|
71
71
|
}, z.core.$strip>, z.ZodObject<{
|
|
72
72
|
source: z.ZodLiteral<"account">;
|
|
73
73
|
provider: z.ZodEnum<{
|
|
74
|
+
discord: "discord";
|
|
74
75
|
google: "google";
|
|
75
76
|
x: "x";
|
|
76
|
-
discord: "discord";
|
|
77
77
|
}>;
|
|
78
78
|
url: z.ZodString;
|
|
79
79
|
seed: z.ZodString;
|
|
@@ -98,9 +98,9 @@ declare const profileUpdateSchema: z.ZodObject<{
|
|
|
98
98
|
avatar: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
99
99
|
source: z.ZodLiteral<"account">;
|
|
100
100
|
provider: z.ZodEnum<{
|
|
101
|
+
discord: "discord";
|
|
101
102
|
google: "google";
|
|
102
103
|
x: "x";
|
|
103
|
-
discord: "discord";
|
|
104
104
|
}>;
|
|
105
105
|
}, z.core.$strict>, z.ZodObject<{
|
|
106
106
|
source: z.ZodLiteral<"generated">;
|
|
@@ -119,9 +119,9 @@ declare const ownProfileSchema: z.ZodObject<{
|
|
|
119
119
|
}, z.core.$strip>, z.ZodObject<{
|
|
120
120
|
source: z.ZodLiteral<"account">;
|
|
121
121
|
provider: z.ZodEnum<{
|
|
122
|
+
discord: "discord";
|
|
122
123
|
google: "google";
|
|
123
124
|
x: "x";
|
|
124
|
-
discord: "discord";
|
|
125
125
|
}>;
|
|
126
126
|
url: z.ZodString;
|
|
127
127
|
seed: z.ZodString;
|
|
@@ -137,9 +137,9 @@ declare const ownProfileSchema: z.ZodObject<{
|
|
|
137
137
|
generated: "generated";
|
|
138
138
|
}>;
|
|
139
139
|
avatarProvider: z.ZodNullable<z.ZodEnum<{
|
|
140
|
+
discord: "discord";
|
|
140
141
|
google: "google";
|
|
141
142
|
x: "x";
|
|
142
|
-
discord: "discord";
|
|
143
143
|
}>>;
|
|
144
144
|
hidden: z.ZodBoolean;
|
|
145
145
|
locked: z.ZodBoolean;
|
|
@@ -150,9 +150,9 @@ declare const ownProfileSchema: z.ZodObject<{
|
|
|
150
150
|
}>;
|
|
151
151
|
options: z.ZodArray<z.ZodObject<{
|
|
152
152
|
provider: z.ZodEnum<{
|
|
153
|
+
discord: "discord";
|
|
153
154
|
google: "google";
|
|
154
155
|
x: "x";
|
|
155
|
-
discord: "discord";
|
|
156
156
|
}>;
|
|
157
157
|
name: z.ZodNullable<z.ZodString>;
|
|
158
158
|
imageUrl: z.ZodNullable<z.ZodString>;
|
|
@@ -211,8 +211,8 @@ declare const profileSettingsSchema: z.ZodObject<{
|
|
|
211
211
|
public: "public";
|
|
212
212
|
}>;
|
|
213
213
|
defaults: z.ZodArray<z.ZodEnum<{
|
|
214
|
-
x: "x";
|
|
215
214
|
discord: "discord";
|
|
215
|
+
x: "x";
|
|
216
216
|
}>>;
|
|
217
217
|
revision: z.ZodNumber;
|
|
218
218
|
actor: z.ZodNullable<z.ZodString>;
|
|
@@ -226,8 +226,8 @@ declare const profileSettingsInputSchema: z.ZodObject<{
|
|
|
226
226
|
public: "public";
|
|
227
227
|
}>;
|
|
228
228
|
defaults: z.ZodArray<z.ZodEnum<{
|
|
229
|
-
x: "x";
|
|
230
229
|
discord: "discord";
|
|
230
|
+
x: "x";
|
|
231
231
|
}>>;
|
|
232
232
|
actionId: z.ZodString;
|
|
233
233
|
expectedRevision: z.ZodNumber;
|
|
@@ -245,9 +245,9 @@ declare const profileModerationSchema: z.ZodObject<{
|
|
|
245
245
|
type ProfileModeration = z.input<typeof profileModerationSchema>;
|
|
246
246
|
/** A member's profile as operators see it: always, whatever the settings. */
|
|
247
247
|
declare const managedProfileSchema: z.ZodObject<{
|
|
248
|
-
displayName: z.ZodNullable<z.ZodString>;
|
|
249
248
|
id: z.ZodString;
|
|
250
249
|
name: z.ZodString;
|
|
250
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
251
251
|
hidden: z.ZodBoolean;
|
|
252
252
|
visibility: z.ZodEnum<{
|
|
253
253
|
private: "private";
|
|
@@ -262,9 +262,9 @@ declare const managedProfileSchema: z.ZodObject<{
|
|
|
262
262
|
}, z.core.$strip>, z.ZodObject<{
|
|
263
263
|
source: z.ZodLiteral<"account">;
|
|
264
264
|
provider: z.ZodEnum<{
|
|
265
|
+
discord: "discord";
|
|
265
266
|
google: "google";
|
|
266
267
|
x: "x";
|
|
267
|
-
discord: "discord";
|
|
268
268
|
}>;
|
|
269
269
|
url: z.ZodString;
|
|
270
270
|
seed: z.ZodString;
|
|
@@ -279,9 +279,9 @@ declare const managedProfileSchema: z.ZodObject<{
|
|
|
279
279
|
generated: "generated";
|
|
280
280
|
}>;
|
|
281
281
|
avatarProvider: z.ZodNullable<z.ZodEnum<{
|
|
282
|
+
discord: "discord";
|
|
282
283
|
google: "google";
|
|
283
284
|
x: "x";
|
|
284
|
-
discord: "discord";
|
|
285
285
|
}>>;
|
|
286
286
|
member: z.ZodString;
|
|
287
287
|
lockedAt: z.ZodNullable<z.ZodNumber>;
|
|
@@ -294,4 +294,4 @@ type ManagedProfile = z.infer<typeof managedProfileSchema>;
|
|
|
294
294
|
declare const AVATAR_UPLOAD_LIMIT: number;
|
|
295
295
|
declare const avatarUploadTypes: string[];
|
|
296
296
|
|
|
297
|
-
export { type AvatarProvider as A,
|
|
297
|
+
export { type AvatarProvider as A, profileReferralSchema as B, profileSettingsInputSchema as C, profileSettingsSchema as D, profileSummarySchema as E, profileUpdateSchema as F, profileVisibilitySchema as G, type ManagedProfile as M, type OwnProfile as O, type ProfileAvatar as P, type ProfileCompletion as a, type ProfileCompletionPage as b, type ProfileCompletionQuery as c, type ProfileReferral as d, type ProfileSummary as e, type ProfileUpdate as f, type ProfileVisibility as g, AVATAR_UPLOAD_LIMIT as h, type ProfileDefaultProvider as i, type ProfileDefaults as j, type ProfileModeration as k, type ProfileSettings as l, type ProfileSettingsInput as m, avatarProviderSchema as n, avatarSeedSchema as o, avatarUploadTypes as p, displayNameSchema as q, managedProfileSchema as r, ownProfileSchema as s, profileAvatarSchema as t, profileCompletionPageSchema as u, profileCompletionQuerySchema as v, profileCompletionSchema as w, profileDefaultProviderSchema as x, profileDefaultsSchema as y, profileModerationSchema as z };
|