@domino-sdk/relay 0.29.0 → 0.30.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 +2 -2
- package/dist/authoring.js +5 -2
- package/dist/browser.d.ts +186 -186
- package/dist/browser.js +5 -5
- package/dist/{chunk-5LLU7UUV.js → chunk-CB7RKKDX.js} +165 -739
- package/dist/{chunk-LAKQCIHX.js → chunk-CWIJDQDT.js} +165 -30
- package/dist/{chunk-YKS6P4IP.js → chunk-HINZLW46.js} +1 -1
- package/dist/chunk-TYYGYDYX.js +42 -0
- package/dist/{chunk-MVCKCDNR.js → chunk-UMKGCDBX.js} +2 -2
- package/dist/index.d.ts +396 -396
- package/dist/index.js +36 -36
- package/dist/portal-proxy.js +5 -5
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +5 -5
- package/dist/{submission-input-C0cOmO4Q.d.ts → submission-input-B6f27BHm.d.ts} +16 -1206
- package/package.json +1 -1
- package/dist/chunk-MRKFRCCI.js +0 -168
package/package.json
CHANGED
package/dist/chunk-MRKFRCCI.js
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
identifier
|
|
3
|
-
} from "./chunk-BE5V6RFD.js";
|
|
4
|
-
|
|
5
|
-
// src/profiles.ts
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
var count = z.number().int().nonnegative().safe();
|
|
8
|
-
var profileVisibilitySchema = z.enum([
|
|
9
|
-
"private",
|
|
10
|
-
"participants",
|
|
11
|
-
"public"
|
|
12
|
-
]);
|
|
13
|
-
var avatarProviderSchema = z.enum(["x", "discord", "google"]);
|
|
14
|
-
var profileDefaultProviderSchema = z.enum(["x", "discord"]);
|
|
15
|
-
var profileDefaultsSchema = z.array(profileDefaultProviderSchema).max(profileDefaultProviderSchema.options.length).refine(
|
|
16
|
-
(providers) => new Set(providers).size === providers.length,
|
|
17
|
-
"List each provider once"
|
|
18
|
-
);
|
|
19
|
-
var avatarSeedSchema = z.string().min(1).max(100);
|
|
20
|
-
var profileAvatarSchema = z.discriminatedUnion("source", [
|
|
21
|
-
z.object({
|
|
22
|
-
source: z.literal("upload"),
|
|
23
|
-
url: z.string().url(),
|
|
24
|
-
seed: avatarSeedSchema
|
|
25
|
-
}),
|
|
26
|
-
z.object({
|
|
27
|
-
source: z.literal("account"),
|
|
28
|
-
provider: avatarProviderSchema,
|
|
29
|
-
url: z.string().url(),
|
|
30
|
-
seed: avatarSeedSchema
|
|
31
|
-
}),
|
|
32
|
-
z.object({ source: z.literal("generated"), seed: avatarSeedSchema })
|
|
33
|
-
]);
|
|
34
|
-
var profileSummarySchema = z.object({
|
|
35
|
-
id: identifier,
|
|
36
|
-
name: z.string(),
|
|
37
|
-
avatar: profileAvatarSchema
|
|
38
|
-
});
|
|
39
|
-
var invisible = /[\p{Cc}----]/u;
|
|
40
|
-
var displayNameSchema = z.string().max(200).transform((value) => value.normalize("NFC").replace(/\s+/g, " ").trim()).pipe(
|
|
41
|
-
z.string().min(1, "Enter a name").max(40, "Use at most 40 characters").refine((value) => !invisible.test(value), "Use visible characters only")
|
|
42
|
-
);
|
|
43
|
-
var profileUpdateSchema = z.object({
|
|
44
|
-
displayName: displayNameSchema.nullable().optional(),
|
|
45
|
-
avatar: z.discriminatedUnion("source", [
|
|
46
|
-
z.object({
|
|
47
|
-
source: z.literal("account"),
|
|
48
|
-
provider: avatarProviderSchema
|
|
49
|
-
}).strict(),
|
|
50
|
-
z.object({ source: z.literal("generated") }).strict()
|
|
51
|
-
]).nullable().optional(),
|
|
52
|
-
hidden: z.boolean().optional()
|
|
53
|
-
}).strict().refine(
|
|
54
|
-
(value) => Object.values(value).some((field) => field !== void 0),
|
|
55
|
-
"Change at least one field"
|
|
56
|
-
);
|
|
57
|
-
var ownProfileSchema = profileSummarySchema.extend({
|
|
58
|
-
/** The name the member chose, or null for the default. */
|
|
59
|
-
displayName: z.string().nullable(),
|
|
60
|
-
/** The avatar the member chose: `default` follows the project's defaults. */
|
|
61
|
-
avatarChoice: z.enum(["default", "upload", "account", "generated"]),
|
|
62
|
-
/** The account of an `account` choice. */
|
|
63
|
-
avatarProvider: avatarProviderSchema.nullable(),
|
|
64
|
-
hidden: z.boolean(),
|
|
65
|
-
/** An operator locked the name and avatar; the member can still hide the profile. */
|
|
66
|
-
locked: z.boolean(),
|
|
67
|
-
/** Who can see profiles in this project, so the app can explain it. */
|
|
68
|
-
visibility: profileVisibilitySchema,
|
|
69
|
-
/** The member's connected accounts a picture or name can come from. */
|
|
70
|
-
options: z.array(
|
|
71
|
-
z.object({
|
|
72
|
-
provider: avatarProviderSchema,
|
|
73
|
-
name: z.string().nullable(),
|
|
74
|
-
imageUrl: z.string().url().nullable()
|
|
75
|
-
})
|
|
76
|
-
)
|
|
77
|
-
});
|
|
78
|
-
var cursor = z.string().min(1).max(512);
|
|
79
|
-
var profileCompletionQuerySchema = z.object({
|
|
80
|
-
limit: z.coerce.number().int().min(1).max(100).default(20),
|
|
81
|
-
cursor: cursor.optional()
|
|
82
|
-
}).strict();
|
|
83
|
-
var profileCompletionSchema = z.object({
|
|
84
|
-
quest: identifier,
|
|
85
|
-
key: identifier.optional(),
|
|
86
|
-
title: z.string(),
|
|
87
|
-
completions: count.positive(),
|
|
88
|
-
/** Null for completions recorded before completion times were. */
|
|
89
|
-
lastCompletedAt: count.nullable()
|
|
90
|
-
});
|
|
91
|
-
var profileCompletionPageSchema = z.object({
|
|
92
|
-
items: z.array(profileCompletionSchema),
|
|
93
|
-
nextCursor: cursor.nullable()
|
|
94
|
-
});
|
|
95
|
-
var profileReferralSchema = z.object({
|
|
96
|
-
program: identifier,
|
|
97
|
-
key: identifier.optional(),
|
|
98
|
-
title: z.string(),
|
|
99
|
-
/** Members this member invited. Invitations are shared by every program. */
|
|
100
|
-
invited: count,
|
|
101
|
-
/** Invited members who qualified in this program. */
|
|
102
|
-
qualified: count,
|
|
103
|
-
milestones: z.array(
|
|
104
|
-
z.object({ id: identifier, count, reached: z.boolean() })
|
|
105
|
-
)
|
|
106
|
-
});
|
|
107
|
-
var profileSettingsSchema = z.object({
|
|
108
|
-
visibility: profileVisibilitySchema,
|
|
109
|
-
defaults: profileDefaultsSchema,
|
|
110
|
-
revision: count,
|
|
111
|
-
actor: z.string().nullable(),
|
|
112
|
-
updatedAt: count.nullable()
|
|
113
|
-
});
|
|
114
|
-
var profileSettingsInputSchema = profileSettingsSchema.omit({ revision: true, actor: true, updatedAt: true }).extend({
|
|
115
|
-
actionId: identifier,
|
|
116
|
-
/** The revision the change was made against; a newer one is a 409. */
|
|
117
|
-
expectedRevision: count,
|
|
118
|
-
reason: z.string().trim().min(1).max(500)
|
|
119
|
-
}).strict();
|
|
120
|
-
var profileModerationSchema = z.object({
|
|
121
|
-
actionId: identifier,
|
|
122
|
-
resetName: z.boolean().default(false),
|
|
123
|
-
removeAvatar: z.boolean().default(false),
|
|
124
|
-
/** True locks the name and avatar, false unlocks them. */
|
|
125
|
-
lock: z.boolean().optional(),
|
|
126
|
-
reason: z.string().trim().min(1).max(1e3)
|
|
127
|
-
}).strict().refine(
|
|
128
|
-
(value) => value.resetName || value.removeAvatar || value.lock !== void 0,
|
|
129
|
-
"Choose an action"
|
|
130
|
-
);
|
|
131
|
-
var managedProfileSchema = ownProfileSchema.omit({ options: true }).extend({
|
|
132
|
-
member: identifier,
|
|
133
|
-
lockedAt: count.nullable(),
|
|
134
|
-
lockedBy: z.string().nullable(),
|
|
135
|
-
lockedReason: z.string().nullable(),
|
|
136
|
-
updatedAt: count
|
|
137
|
-
});
|
|
138
|
-
var AVATAR_UPLOAD_LIMIT = 5 * 1024 * 1024;
|
|
139
|
-
var avatarUploadTypes = ["image/jpeg", "image/png", "image/webp"];
|
|
140
|
-
function isProfileParticipantRoute(path, method) {
|
|
141
|
-
return method === "GET" && (path === "/v1/me/profile" || /^\/v1\/profiles\/[\w-]+(?:\/completions|\/referrals\/[\w-]+)?$/.test(
|
|
142
|
-
path
|
|
143
|
-
) || /^\/v1\/leaderboards\/[\w-]+\/profiles\/[\w-]+$/.test(path)) || method === "POST" && (path === "/v1/me/profile" || path === "/v1/me/profile/avatar");
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export {
|
|
147
|
-
profileVisibilitySchema,
|
|
148
|
-
avatarProviderSchema,
|
|
149
|
-
profileDefaultProviderSchema,
|
|
150
|
-
profileDefaultsSchema,
|
|
151
|
-
avatarSeedSchema,
|
|
152
|
-
profileAvatarSchema,
|
|
153
|
-
profileSummarySchema,
|
|
154
|
-
displayNameSchema,
|
|
155
|
-
profileUpdateSchema,
|
|
156
|
-
ownProfileSchema,
|
|
157
|
-
profileCompletionQuerySchema,
|
|
158
|
-
profileCompletionSchema,
|
|
159
|
-
profileCompletionPageSchema,
|
|
160
|
-
profileReferralSchema,
|
|
161
|
-
profileSettingsSchema,
|
|
162
|
-
profileSettingsInputSchema,
|
|
163
|
-
profileModerationSchema,
|
|
164
|
-
managedProfileSchema,
|
|
165
|
-
AVATAR_UPLOAD_LIMIT,
|
|
166
|
-
avatarUploadTypes,
|
|
167
|
-
isProfileParticipantRoute
|
|
168
|
-
};
|