@domino-sdk/relay 1.11.1 → 1.14.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 -0
- package/build.mjs +15 -0
- package/dist/accounts-5ciAkCMP.d.ts +147 -0
- package/dist/{activity-CNiPDPK6.d.ts → activity-D_R3J-gU.d.ts} +115 -115
- package/dist/attempt-captures-DZldPZJc.d.ts +285 -0
- package/dist/authoring.d.ts +49 -47
- package/dist/authoring.js +6 -4
- package/dist/{automatic-outcomes-kPIDv6X_.d.ts → automatic-outcomes-6lJGnSDe.d.ts} +1 -1
- package/dist/browser.d.ts +8 -7
- package/dist/browser.js +7 -6
- package/dist/capability-error-oTd3eYFH.d.ts +151 -0
- package/dist/chunk-2UAVZCMH.js +314 -0
- package/dist/chunk-5TS3OAWS.js +470 -0
- package/dist/{chunk-PUDL4JBY.js → chunk-6DD7DVNQ.js} +2 -2
- package/dist/{chunk-AGFUDCNM.js → chunk-C3CB4WIQ.js} +1 -1
- package/dist/{chunk-T657WO56.js → chunk-LLMJ2SUT.js} +6 -2
- package/dist/chunk-NIYCAW2I.js +79 -0
- package/dist/chunk-UJACD6K2.js +987 -0
- package/dist/{chunk-XK5E4HAS.js → chunk-VBHFJH3P.js} +80 -28
- package/dist/chunk-W335CWYJ.js +53 -0
- package/dist/{chunk-X7ECZ3AK.js → chunk-XMBM2XD5.js} +1 -1
- package/dist/{chunk-2K2QBPAD.js → chunk-ZLYBUM7K.js} +6 -4
- package/dist/{client-fUSERMAC.d.ts → client-BTd_CyX3.d.ts} +26 -6
- package/dist/{groups-BK8ts2yK.d.ts → groups-4Jb3uYFO.d.ts} +1 -1
- package/dist/{images-aw6W7vFZ.d.ts → images-D5kpqHxv.d.ts} +1 -1
- package/dist/index.d.ts +9 -8
- package/dist/index.js +8 -6
- package/dist/{capability-error-ty3SqD_b.d.ts → integrations-Cr9EhGI_.d.ts} +1 -149
- package/dist/internal.d.ts +32 -5
- package/dist/internal.js +8 -3
- package/dist/{offers-C2FANzrG.d.ts → offers-BFI5t-e-.d.ts} +2 -2
- package/dist/{pages-Chb6OZSB.d.ts → pages-nIoMT9J3.d.ts} +1 -1
- package/dist/{participant-activity-DkL3nY5a.d.ts → participant-activity-DYdUUhw2.d.ts} +1 -0
- package/dist/portal-proxy.js +1 -1
- package/dist/react/index.d.ts +246 -177
- package/dist/react/index.js +954 -383
- package/dist/{referral-reward-kinds-M3f0PdiR.d.ts → referral-reward-kinds-DnvQXL8L.d.ts} +100 -3
- package/dist/{schema-DEM8y8Fm.d.ts → schema-K-Pg5lPz.d.ts} +1 -1
- package/dist/schema.d.ts +316 -314
- package/dist/schema.js +16 -14
- package/dist/server/index.d.ts +2546 -377
- package/dist/server/index.js +594 -841
- package/dist/{sign-in-options-iWOp9puZ.d.ts → sign-in-options-DBjMzgnu.d.ts} +2 -2
- package/dist/submission-input-CPIsJt-_.d.ts +146 -0
- package/dist/testing.d.ts +641 -0
- package/dist/testing.js +1282 -0
- package/package.json +6 -2
- package/dist/chunk-OCXGG75K.js +0 -171
- package/dist/chunk-ZFABFKIY.js +0 -1295
- package/dist/submission-input-BbBJTVlT.d.ts +0 -290
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { L as LedgerReference, r as QuestHandle } from './schema-DEM8y8Fm.js';
|
|
3
|
-
import { p as ProjectGroupReference } from './groups-BK8ts2yK.js';
|
|
4
|
-
|
|
5
|
-
/** A Discord message as `ctx.discord.message()` reads it, from the project's Discord server. */
|
|
6
|
-
declare const discordMessageSchema: z.ZodObject<{
|
|
7
|
-
guildId: z.ZodString;
|
|
8
|
-
channelId: z.ZodString;
|
|
9
|
-
messageId: z.ZodString;
|
|
10
|
-
userId: z.ZodString;
|
|
11
|
-
content: z.ZodNullable<z.ZodString>;
|
|
12
|
-
replyTo: z.ZodNullable<z.ZodString>;
|
|
13
|
-
publishedAt: z.ZodNumber;
|
|
14
|
-
}, z.core.$strict>;
|
|
15
|
-
type DiscordMessage = z.infer<typeof discordMessageSchema>;
|
|
16
|
-
/**
|
|
17
|
-
* Messages posted in the project's Discord server, written by the Discord gateway. The record's
|
|
18
|
-
* `author` is the message author's Discord account. Message text is stored only with `text: true`.
|
|
19
|
-
* Edits update stored text. Deleting a message, or turning text off, removes retained text.
|
|
20
|
-
*/
|
|
21
|
-
declare const discordMessagesSourceSchema: z.ZodObject<{
|
|
22
|
-
kind: z.ZodLiteral<"discord-messages">;
|
|
23
|
-
/** Store each message's text in `data.text`. Off unless set. */
|
|
24
|
-
text: z.ZodOptional<z.ZodBoolean>;
|
|
25
|
-
}, z.core.$strict>;
|
|
26
|
-
/**
|
|
27
|
-
* Reactions added in the project's Discord server, written by the Discord gateway. The record's
|
|
28
|
-
* `author` is the reactor's Discord account and its `messageAuthor` account is the message's
|
|
29
|
-
* author, when Discord could name it.
|
|
30
|
-
*/
|
|
31
|
-
declare const discordReactionsSourceSchema: z.ZodObject<{
|
|
32
|
-
kind: z.ZodLiteral<"discord-reactions">;
|
|
33
|
-
}, z.core.$strict>;
|
|
34
|
-
/** The `data` of a `discord.messages()` record. IDs are Discord snowflakes. */
|
|
35
|
-
declare const discordMessageDataSchema: z.ZodObject<{
|
|
36
|
-
guildId: z.ZodString;
|
|
37
|
-
channelId: z.ZodString;
|
|
38
|
-
messageId: z.ZodString;
|
|
39
|
-
replyTo: z.ZodNullable<z.ZodString>;
|
|
40
|
-
publishedAt: z.ZodNumber;
|
|
41
|
-
}, z.core.$strip>;
|
|
42
|
-
type DiscordMessageData = z.infer<typeof discordMessageDataSchema>;
|
|
43
|
-
/**
|
|
44
|
-
* The `data` of a `discord.messages({ text: true })` record. `text` is null when the platform's
|
|
45
|
-
* bot does not receive message content.
|
|
46
|
-
*/
|
|
47
|
-
declare const discordMessageTextDataSchema: z.ZodObject<{
|
|
48
|
-
guildId: z.ZodString;
|
|
49
|
-
channelId: z.ZodString;
|
|
50
|
-
messageId: z.ZodString;
|
|
51
|
-
replyTo: z.ZodNullable<z.ZodString>;
|
|
52
|
-
publishedAt: z.ZodNumber;
|
|
53
|
-
text: z.ZodNullable<z.ZodString>;
|
|
54
|
-
}, z.core.$strip>;
|
|
55
|
-
type DiscordMessageTextData = z.infer<typeof discordMessageTextDataSchema>;
|
|
56
|
-
/** The `data` of a `discord.reactions()` record. IDs are Discord snowflakes. */
|
|
57
|
-
declare const discordReactionDataSchema: z.ZodObject<{
|
|
58
|
-
guildId: z.ZodString;
|
|
59
|
-
channelId: z.ZodString;
|
|
60
|
-
messageId: z.ZodString;
|
|
61
|
-
emoji: z.ZodObject<{
|
|
62
|
-
id: z.ZodNullable<z.ZodString>;
|
|
63
|
-
name: z.ZodString;
|
|
64
|
-
}, z.core.$strip>;
|
|
65
|
-
reactorRoles: z.ZodArray<z.ZodString>;
|
|
66
|
-
messagePublishedAt: z.ZodNumber;
|
|
67
|
-
}, z.core.$strip>;
|
|
68
|
-
type DiscordReactionData = z.infer<typeof discordReactionDataSchema>;
|
|
69
|
-
/** Rewards and resource selectors supported by the Discord integration. */
|
|
70
|
-
declare const discordRewardSchema: z.ZodObject<{
|
|
71
|
-
kind: z.ZodLiteral<"integration">;
|
|
72
|
-
provider: z.ZodLiteral<"discord">;
|
|
73
|
-
action: z.ZodLiteral<"grant-role">;
|
|
74
|
-
roleId: z.ZodString;
|
|
75
|
-
}, z.core.$strict>;
|
|
76
|
-
declare const discordResourceSourceSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
77
|
-
provider: z.ZodLiteral<"discord">;
|
|
78
|
-
resource: z.ZodLiteral<"channel">;
|
|
79
|
-
types: z.ZodArray<z.ZodEnum<{
|
|
80
|
-
text: "text";
|
|
81
|
-
announcement: "announcement";
|
|
82
|
-
}>>;
|
|
83
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
84
|
-
provider: z.ZodLiteral<"discord">;
|
|
85
|
-
resource: z.ZodLiteral<"role">;
|
|
86
|
-
assignable: z.ZodDefault<z.ZodBoolean>;
|
|
87
|
-
}, z.core.$strict>]>;
|
|
88
|
-
|
|
89
|
-
declare const completionPrerequisiteSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
90
|
-
kind: z.ZodLiteral<"completion">;
|
|
91
|
-
quest: z.ZodString;
|
|
92
|
-
scope: z.ZodLiteral<"ever">;
|
|
93
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
94
|
-
kind: z.ZodLiteral<"completion">;
|
|
95
|
-
quest: z.ZodString;
|
|
96
|
-
scope: z.ZodLiteral<"period">;
|
|
97
|
-
period: z.ZodEnum<{
|
|
98
|
-
day: "day";
|
|
99
|
-
week: "week";
|
|
100
|
-
month: "month";
|
|
101
|
-
}>;
|
|
102
|
-
}, z.core.$strict>], "scope">;
|
|
103
|
-
declare const balancePrerequisiteSchema: z.ZodObject<{
|
|
104
|
-
kind: z.ZodLiteral<"balance">;
|
|
105
|
-
balance: z.ZodString;
|
|
106
|
-
minimum: z.ZodNumber;
|
|
107
|
-
}, z.core.$strict>;
|
|
108
|
-
declare const groupPrerequisiteSchema: z.ZodObject<{
|
|
109
|
-
kind: z.ZodLiteral<"group">;
|
|
110
|
-
group: z.ZodString;
|
|
111
|
-
title: z.ZodString;
|
|
112
|
-
}, z.core.$strict>;
|
|
113
|
-
declare const prerequisiteSchema: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
114
|
-
kind: z.ZodLiteral<"completion">;
|
|
115
|
-
quest: z.ZodString;
|
|
116
|
-
scope: z.ZodLiteral<"ever">;
|
|
117
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
118
|
-
kind: z.ZodLiteral<"completion">;
|
|
119
|
-
quest: z.ZodString;
|
|
120
|
-
scope: z.ZodLiteral<"period">;
|
|
121
|
-
period: z.ZodEnum<{
|
|
122
|
-
day: "day";
|
|
123
|
-
week: "week";
|
|
124
|
-
month: "month";
|
|
125
|
-
}>;
|
|
126
|
-
}, z.core.$strict>], "scope">, z.ZodObject<{
|
|
127
|
-
kind: z.ZodLiteral<"balance">;
|
|
128
|
-
balance: z.ZodString;
|
|
129
|
-
minimum: z.ZodNumber;
|
|
130
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
131
|
-
kind: z.ZodLiteral<"group">;
|
|
132
|
-
group: z.ZodString;
|
|
133
|
-
title: z.ZodString;
|
|
134
|
-
}, z.core.$strict>], "kind">;
|
|
135
|
-
type Prerequisite = z.infer<typeof prerequisiteSchema>;
|
|
136
|
-
declare const missingPrerequisiteSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
137
|
-
kind: z.ZodLiteral<"completion">;
|
|
138
|
-
quest: z.ZodString;
|
|
139
|
-
title: z.ZodString;
|
|
140
|
-
scope: z.ZodLiteral<"ever">;
|
|
141
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
142
|
-
kind: z.ZodLiteral<"completion">;
|
|
143
|
-
quest: z.ZodString;
|
|
144
|
-
title: z.ZodString;
|
|
145
|
-
scope: z.ZodLiteral<"period">;
|
|
146
|
-
period: z.ZodEnum<{
|
|
147
|
-
day: "day";
|
|
148
|
-
week: "week";
|
|
149
|
-
month: "month";
|
|
150
|
-
}>;
|
|
151
|
-
resetsAt: z.ZodNumber;
|
|
152
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
153
|
-
kind: z.ZodLiteral<"balance">;
|
|
154
|
-
balance: z.ZodString;
|
|
155
|
-
title: z.ZodString;
|
|
156
|
-
minimum: z.ZodNumber;
|
|
157
|
-
current: z.ZodNumber;
|
|
158
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
159
|
-
kind: z.ZodLiteral<"group">;
|
|
160
|
-
group: z.ZodString;
|
|
161
|
-
title: z.ZodString;
|
|
162
|
-
}, z.core.$strip>]>;
|
|
163
|
-
type MissingPrerequisite = z.infer<typeof missingPrerequisiteSchema>;
|
|
164
|
-
declare function completed(quest: QuestHandle, options?: {
|
|
165
|
-
scope?: "ever";
|
|
166
|
-
} | {
|
|
167
|
-
scope: "period";
|
|
168
|
-
period: "day" | "week" | "month";
|
|
169
|
-
}): {
|
|
170
|
-
kind: "completion";
|
|
171
|
-
quest: string;
|
|
172
|
-
scope: "ever";
|
|
173
|
-
} | {
|
|
174
|
-
kind: "completion";
|
|
175
|
-
quest: string;
|
|
176
|
-
scope: "period";
|
|
177
|
-
period: "day" | "week" | "month";
|
|
178
|
-
};
|
|
179
|
-
declare function balanceAtLeast(balance: LedgerReference, minimum: number): {
|
|
180
|
-
kind: "balance";
|
|
181
|
-
balance: string;
|
|
182
|
-
minimum: number;
|
|
183
|
-
};
|
|
184
|
-
declare function inGroup(group: ProjectGroupReference): {
|
|
185
|
-
kind: "group";
|
|
186
|
-
group: string;
|
|
187
|
-
title: string;
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
declare const authProviderSchema: z.ZodEnum<{
|
|
191
|
-
discord: "discord";
|
|
192
|
-
google: "google";
|
|
193
|
-
apple: "apple";
|
|
194
|
-
x: "x";
|
|
195
|
-
}>;
|
|
196
|
-
type AuthProvider = z.infer<typeof authProviderSchema>;
|
|
197
|
-
declare const accountConnectionSchema: z.ZodObject<{
|
|
198
|
-
provider: z.ZodEnum<{
|
|
199
|
-
discord: "discord";
|
|
200
|
-
google: "google";
|
|
201
|
-
apple: "apple";
|
|
202
|
-
x: "x";
|
|
203
|
-
}>;
|
|
204
|
-
configured: z.ZodBoolean;
|
|
205
|
-
status: z.ZodEnum<{
|
|
206
|
-
disconnected: "disconnected";
|
|
207
|
-
connected: "connected";
|
|
208
|
-
reconnect: "reconnect";
|
|
209
|
-
}>;
|
|
210
|
-
subject: z.ZodNullable<z.ZodString>;
|
|
211
|
-
revision: z.ZodNumber;
|
|
212
|
-
}, z.core.$strip>;
|
|
213
|
-
type AccountConnection = z.infer<typeof accountConnectionSchema>;
|
|
214
|
-
declare const discordMemberInputSchema: z.ZodObject<{}, z.core.$strict>;
|
|
215
|
-
declare const discordMessageInputSchema: z.ZodObject<{
|
|
216
|
-
channelId: z.ZodString;
|
|
217
|
-
messageId: z.ZodString;
|
|
218
|
-
}, z.core.$strict>;
|
|
219
|
-
declare const discordMemberSchema: z.ZodObject<{
|
|
220
|
-
userId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
221
|
-
nickname: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
222
|
-
displayName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
223
|
-
boostingSince: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
224
|
-
roles: z.ZodArray<z.ZodString>;
|
|
225
|
-
joinedAt: z.ZodNullable<z.ZodString>;
|
|
226
|
-
pending: z.ZodBoolean;
|
|
227
|
-
}, z.core.$strip>;
|
|
228
|
-
type DiscordMember = z.infer<typeof discordMemberSchema>;
|
|
229
|
-
/**
|
|
230
|
-
* Reads the project's connected Discord server for the member's linked Discord account. The
|
|
231
|
-
* account and the integration are pinned at the attempt's first Discord read: later links and
|
|
232
|
-
* unlinks do not change the attempt. Provider failures, and an integration that is not ready,
|
|
233
|
-
* throw `CapabilityError` with code `"provider-unavailable"`.
|
|
234
|
-
*/
|
|
235
|
-
interface DiscordReader {
|
|
236
|
-
/** The member's server membership; null when they are not in the server or have not linked Discord. */
|
|
237
|
-
member(): Promise<DiscordMember | null>;
|
|
238
|
-
/**
|
|
239
|
-
* A message in the connected server; null when it does not exist. The bot reads it, so the
|
|
240
|
-
* member needs no linked Discord account. A channel outside the connected server, or one the
|
|
241
|
-
* bot cannot see, throws
|
|
242
|
-
* `CapabilityError` with code `"author-error"`.
|
|
243
|
-
*/
|
|
244
|
-
message(input: {
|
|
245
|
-
channelId: string;
|
|
246
|
-
messageId: string;
|
|
247
|
-
}): Promise<DiscordMessage | null>;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
declare const textOptionsSchema: z.ZodObject<{
|
|
251
|
-
required: z.ZodDefault<z.ZodBoolean>;
|
|
252
|
-
minLength: z.ZodDefault<z.ZodNumber>;
|
|
253
|
-
maxLength: z.ZodDefault<z.ZodNumber>;
|
|
254
|
-
}, z.core.$strict>;
|
|
255
|
-
declare const urlOptionsSchema: z.ZodObject<{
|
|
256
|
-
required: z.ZodDefault<z.ZodBoolean>;
|
|
257
|
-
allowedHosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
258
|
-
}, z.core.$strict>;
|
|
259
|
-
type TextOptions = z.input<typeof textOptionsSchema>;
|
|
260
|
-
type UrlOptions = z.input<typeof urlOptionsSchema>;
|
|
261
|
-
declare const textEvidenceSchema: z.ZodObject<{
|
|
262
|
-
kind: z.ZodLiteral<"text">;
|
|
263
|
-
value: z.ZodString;
|
|
264
|
-
}, z.core.$strict>;
|
|
265
|
-
declare const urlEvidenceSchema: z.ZodObject<{
|
|
266
|
-
kind: z.ZodLiteral<"url">;
|
|
267
|
-
value: z.ZodString;
|
|
268
|
-
}, z.core.$strict>;
|
|
269
|
-
declare const valueEvidenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
270
|
-
kind: z.ZodLiteral<"text">;
|
|
271
|
-
value: z.ZodString;
|
|
272
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
273
|
-
kind: z.ZodLiteral<"url">;
|
|
274
|
-
value: z.ZodString;
|
|
275
|
-
}, z.core.$strict>], "kind">;
|
|
276
|
-
type TextEvidence = z.infer<typeof textEvidenceSchema>;
|
|
277
|
-
type UrlEvidence = z.infer<typeof urlEvidenceSchema>;
|
|
278
|
-
type ValueEvidence = z.infer<typeof valueEvidenceSchema>;
|
|
279
|
-
/** Validates a claim without fetching it or changing the captured value. */
|
|
280
|
-
declare function validateSubmissionValue(input: ValueEvidence, contract: {
|
|
281
|
-
input: "text";
|
|
282
|
-
constraints: z.output<typeof textOptionsSchema>;
|
|
283
|
-
} | {
|
|
284
|
-
input: "url";
|
|
285
|
-
constraints: z.output<typeof urlOptionsSchema>;
|
|
286
|
-
}): string | null;
|
|
287
|
-
/** Extract an ID only. The URL and its author name are untrusted claims. */
|
|
288
|
-
declare function xPostId(value: string): string | null;
|
|
289
|
-
|
|
290
|
-
export { type AccountConnection as A, groupPrerequisiteSchema as B, missingPrerequisiteSchema as C, type DiscordMessageData as D, prerequisiteSchema as E, textEvidenceSchema as F, textOptionsSchema as G, urlEvidenceSchema as H, urlOptionsSchema as I, validateSubmissionValue as J, valueEvidenceSchema as K, xPostId as L, type MissingPrerequisite as M, type Prerequisite as P, type TextEvidence as T, type UrlEvidence as U, type ValueEvidence as V, type AuthProvider as a, type TextOptions as b, type UrlOptions as c, discordMessagesSourceSchema as d, type DiscordMessageTextData as e, discordReactionsSourceSchema as f, type DiscordReactionData as g, type DiscordReader as h, balanceAtLeast as i, completed as j, inGroup as k, type DiscordMember as l, type DiscordMessage as m, accountConnectionSchema as n, authProviderSchema as o, balancePrerequisiteSchema as p, completionPrerequisiteSchema as q, discordMemberInputSchema as r, discordMemberSchema as s, discordMessageDataSchema as t, discordMessageInputSchema as u, discordMessageSchema as v, discordMessageTextDataSchema as w, discordReactionDataSchema as x, discordResourceSourceSchema as y, discordRewardSchema as z };
|