@domino-sdk/relay 1.24.0 → 1.29.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/{accounts-B31dWEYD.d.ts → accounts-DRPENuZe.d.ts} +1 -1
- package/dist/{attempt-captures-JDIgz2lY.d.ts → attempt-captures-BPMbTDYG.d.ts} +2 -2
- package/dist/authoring.d.ts +56 -56
- package/dist/authoring.js +7 -7
- package/dist/{automatic-outcomes-T9lEIvTj.d.ts → automatic-outcomes-CGAxTwEj.d.ts} +2 -2
- package/dist/avatar.d.ts +2 -2
- package/dist/browser.d.ts +10 -10
- package/dist/browser.js +10 -10
- package/dist/{capability-error-oTd3eYFH.d.ts → capability-error-CvSZaif2.d.ts} +1 -1
- package/dist/{chunk-B4EZ76WX.js → chunk-22QERRAG.js} +3 -3
- package/dist/{chunk-MC6V6VMG.js → chunk-4OC7REYX.js} +1 -1
- package/dist/{chunk-MO2FASX4.js → chunk-5FQ2BNG2.js} +1 -1
- package/dist/{chunk-UCZGXYCN.js → chunk-6YLULKQM.js} +10 -10
- package/dist/{chunk-6UFXPKLA.js → chunk-BVEWY2ZL.js} +99 -39
- package/dist/{chunk-MRU7GX2V.js → chunk-C3KL5SGM.js} +21 -8
- package/dist/{chunk-WOGCRDFT.js → chunk-CCTZIHWN.js} +1 -1
- package/dist/{chunk-G75JVB4D.js → chunk-DDA7G23P.js} +3 -3
- package/dist/{chunk-USVER53M.js → chunk-DP4YWFMY.js} +7 -0
- package/dist/{chunk-W33PYWYQ.js → chunk-JNBNL7FE.js} +2 -2
- package/dist/{chunk-AXQYGVOP.js → chunk-LPURBE7D.js} +1 -1
- package/dist/{chunk-GB26FIZT.js → chunk-MNL5NSC4.js} +8 -8
- package/dist/{chunk-JUQ2GNMD.js → chunk-PNCLJOUD.js} +2 -2
- package/dist/{chunk-NXWPYO6U.js → chunk-V4FGPIR3.js} +47 -16
- package/dist/{chunk-VT7355QN.js → chunk-VP63H7IE.js} +2 -2
- package/dist/{chunk-ENBQ6UEE.js → chunk-W2HGXOZ5.js} +3 -3
- package/dist/{chunk-E7MVYASS.js → chunk-W7PDXGYB.js} +1 -1
- package/dist/{chunk-PLELWE5L.js → chunk-ZLYVOLU2.js} +595 -147
- package/dist/{client-HG0uMG0Q.d.ts → client-D4WMWeWC.d.ts} +123 -58
- package/dist/{deployments-BFl_dOgc.d.ts → deployments-r5RxhZ9x.d.ts} +110 -110
- package/dist/{groups-CfyRewkJ.d.ts → groups-BNUhmxYY.d.ts} +26 -3
- package/dist/{images-DwNmzqWv.d.ts → images-PPPTL2Ct.d.ts} +2 -2
- package/dist/index.d.ts +13 -13
- package/dist/index.js +12 -10
- package/dist/{integrations-BMNtARU_.d.ts → integrations-CllF-kWg.d.ts} +1 -1
- package/dist/internal.d.ts +10 -10
- package/dist/internal.js +9 -9
- package/dist/{offers-CEwkAGsB.d.ts → offers-CdB5jnRl.d.ts} +3 -3
- package/dist/{pages-D1xrbGJl.d.ts → pages-BUmWkUu2.d.ts} +17 -3
- package/dist/{participant-activity-DYdUUhw2.d.ts → participant-activity-BPZiW7m7.d.ts} +1 -1
- package/dist/{participant-rewards-3duLb8YJ.d.ts → participant-rewards-BcWkBRn_.d.ts} +1 -1
- package/dist/portal-proxy.js +4 -4
- package/dist/{profiles-D29SS12z.d.ts → profiles-BHuQdzsW.d.ts} +1 -1
- package/dist/react/index.d.ts +13 -13
- package/dist/react/index.js +16 -15
- package/dist/{schema-D57mhL2q.d.ts → schema-lmOnv5C5.d.ts} +164 -2
- package/dist/schema.d.ts +380 -381
- package/dist/schema.js +22 -8
- package/dist/server/index.d.ts +10 -10
- package/dist/server/index.js +978 -723
- package/dist/{streaks-CWyq8Px5.d.ts → streaks-0YuipsUQ.d.ts} +1 -1
- package/dist/{submission-input-DjXg0o-r.d.ts → submission-input-DdvTz7ac.d.ts} +3 -3
- package/dist/{telegram-browser-DaP0Rawg.d.ts → telegram-browser-SK3KxXBL.d.ts} +13 -5
- package/dist/testing.d.ts +8 -8
- package/dist/testing.js +15 -15
- package/dist/{transport-M8ouWh7j.d.ts → transport-BNdKQ_m4.d.ts} +6150 -3299
- package/dist/{wallet-CDyo-U4n.d.ts → wallet-t7uNDg9p.d.ts} +1 -1
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
attemptCaptureSchema,
|
|
3
3
|
capturedFactSchema
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-DDA7G23P.js";
|
|
5
5
|
import {
|
|
6
6
|
activityTypeSchema,
|
|
7
7
|
activityTypes,
|
|
@@ -25,8 +25,8 @@ import {
|
|
|
25
25
|
publishDeploymentSchema,
|
|
26
26
|
rejectDeploymentSchema,
|
|
27
27
|
submitDeploymentSchema
|
|
28
|
-
} from "../chunk-
|
|
29
|
-
import "../chunk-
|
|
28
|
+
} from "../chunk-6YLULKQM.js";
|
|
29
|
+
import "../chunk-4OC7REYX.js";
|
|
30
30
|
import {
|
|
31
31
|
DEFAULT_MANAGEMENT_TIMEOUT,
|
|
32
32
|
ManagementError,
|
|
@@ -44,28 +44,28 @@ import {
|
|
|
44
44
|
participantExchangeSchema,
|
|
45
45
|
questConfiguration,
|
|
46
46
|
sequenceCursorSchema
|
|
47
|
-
} from "../chunk-
|
|
47
|
+
} from "../chunk-V4FGPIR3.js";
|
|
48
48
|
import {
|
|
49
49
|
parseImageExtraction,
|
|
50
50
|
parseImageResult
|
|
51
|
-
} from "../chunk-
|
|
51
|
+
} from "../chunk-W2HGXOZ5.js";
|
|
52
52
|
import {
|
|
53
53
|
imageAssetArtifactSchema
|
|
54
|
-
} from "../chunk-
|
|
54
|
+
} from "../chunk-22QERRAG.js";
|
|
55
55
|
import {
|
|
56
56
|
sourceDataSchema,
|
|
57
57
|
sourceRoles,
|
|
58
58
|
validateQuestShape
|
|
59
|
-
} from "../chunk-
|
|
59
|
+
} from "../chunk-LPURBE7D.js";
|
|
60
60
|
import {
|
|
61
61
|
isIntegrationParticipantPath,
|
|
62
62
|
isParticipantRoute,
|
|
63
63
|
participantRoutePattern,
|
|
64
64
|
participantRoutes
|
|
65
|
-
} from "../chunk-
|
|
65
|
+
} from "../chunk-DP4YWFMY.js";
|
|
66
66
|
import {
|
|
67
67
|
withActionId
|
|
68
|
-
} from "../chunk-
|
|
68
|
+
} from "../chunk-W7PDXGYB.js";
|
|
69
69
|
import {
|
|
70
70
|
allocateQuestSchema,
|
|
71
71
|
allocatedQuestSchema,
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
rewardDeliveriesSchema,
|
|
84
84
|
rewardDeliverySchema,
|
|
85
85
|
saveQuestDraftSchema
|
|
86
|
-
} from "../chunk-
|
|
86
|
+
} from "../chunk-MNL5NSC4.js";
|
|
87
87
|
import {
|
|
88
88
|
badgeMutationResultSchema,
|
|
89
89
|
badgeMutationSchema,
|
|
@@ -101,6 +101,8 @@ import {
|
|
|
101
101
|
engagementRuleVersionPageSchema,
|
|
102
102
|
engagementVersionPageSchema,
|
|
103
103
|
engagementVersionQuerySchema,
|
|
104
|
+
leaderboardExclusionGroupBindingSchema,
|
|
105
|
+
leaderboardExclusionGroupSchema,
|
|
104
106
|
leaderboardExclusionSchema,
|
|
105
107
|
leaderboardGroupSchema,
|
|
106
108
|
leaderboardPageSchema,
|
|
@@ -133,15 +135,15 @@ import {
|
|
|
133
135
|
referralQualificationSchema,
|
|
134
136
|
referralRewardResolutionSchema,
|
|
135
137
|
referralSuspensionSchema
|
|
136
|
-
} from "../chunk-
|
|
138
|
+
} from "../chunk-C3KL5SGM.js";
|
|
137
139
|
import {
|
|
138
140
|
telegramChatConnectionSchema,
|
|
139
141
|
telegramChatIdSchema,
|
|
140
142
|
telegramChatsSchema
|
|
141
|
-
} from "../chunk-
|
|
142
|
-
import "../chunk-
|
|
143
|
-
import "../chunk-
|
|
144
|
-
import "../chunk-
|
|
143
|
+
} from "../chunk-JNBNL7FE.js";
|
|
144
|
+
import "../chunk-CCTZIHWN.js";
|
|
145
|
+
import "../chunk-5FQ2BNG2.js";
|
|
146
|
+
import "../chunk-PNCLJOUD.js";
|
|
145
147
|
import {
|
|
146
148
|
CompletionSourceKind,
|
|
147
149
|
addGroupMemberSchema,
|
|
@@ -193,6 +195,7 @@ import {
|
|
|
193
195
|
projectGroupKey,
|
|
194
196
|
publishedReleaseSchema,
|
|
195
197
|
questSettingsInputSchema,
|
|
198
|
+
questSubmissionSchema,
|
|
196
199
|
removeGroupMemberSchema,
|
|
197
200
|
responseSchema,
|
|
198
201
|
snapshotSchema,
|
|
@@ -200,6 +203,7 @@ import {
|
|
|
200
203
|
solanaMainnet,
|
|
201
204
|
staffDecisionSchema,
|
|
202
205
|
stockItemSchema,
|
|
206
|
+
streakProgressSchema,
|
|
203
207
|
submitSchema,
|
|
204
208
|
trackerContentReadSchema,
|
|
205
209
|
trackerContentSchema,
|
|
@@ -226,10 +230,10 @@ import {
|
|
|
226
230
|
walletSignInNetworksSchema,
|
|
227
231
|
walletUnlinkInputSchema,
|
|
228
232
|
whereSchemaIssue
|
|
229
|
-
} from "../chunk-
|
|
233
|
+
} from "../chunk-BVEWY2ZL.js";
|
|
230
234
|
|
|
231
235
|
// src/server/identity-links.ts
|
|
232
|
-
import
|
|
236
|
+
import * as z from "zod";
|
|
233
237
|
var walletIdentitySelectorSchema = walletUnlinkInputSchema.extend({
|
|
234
238
|
kind: z.literal("wallet")
|
|
235
239
|
});
|
|
@@ -275,247 +279,319 @@ var memberIdentityLinkPageSchema = z.object({
|
|
|
275
279
|
nextCursor: pageCursorSchema.nullable()
|
|
276
280
|
});
|
|
277
281
|
|
|
282
|
+
// src/server/identity-states.ts
|
|
283
|
+
import * as z2 from "zod";
|
|
284
|
+
var telegramIdentitySelectorSchema = z2.strictObject({
|
|
285
|
+
kind: z2.literal("telegram"),
|
|
286
|
+
subject: z2.string().min(1).max(4096)
|
|
287
|
+
});
|
|
288
|
+
var appIdentitySelectorSchema = z2.strictObject({
|
|
289
|
+
kind: z2.literal("app"),
|
|
290
|
+
appKind: appIdentityKindSchema,
|
|
291
|
+
subject: z2.string().min(1).max(256)
|
|
292
|
+
});
|
|
293
|
+
var memberIdentitySelectorSchema = z2.discriminatedUnion("kind", [
|
|
294
|
+
walletIdentitySelectorSchema,
|
|
295
|
+
oauthIdentitySelectorSchema,
|
|
296
|
+
telegramIdentitySelectorSchema,
|
|
297
|
+
appIdentitySelectorSchema
|
|
298
|
+
]);
|
|
299
|
+
var state2 = {
|
|
300
|
+
/** Every identity state belongs to the member's project and environment. */
|
|
301
|
+
scope: z2.literal("project"),
|
|
302
|
+
/**
|
|
303
|
+
* What `expectedRevision` names. A wallet and an app identity count their own changes; an X,
|
|
304
|
+
* Discord or Telegram account shares its provider's selection revision with the member's other
|
|
305
|
+
* accounts of that provider, because the member selects one of them at a time.
|
|
306
|
+
*/
|
|
307
|
+
revision: z2.number().int().safe().nonnegative(),
|
|
308
|
+
/** Whether trackers attribute records to the member through this identity. */
|
|
309
|
+
linked: z2.boolean(),
|
|
310
|
+
/** When the current link began; null while unlinked, or for a link older than link times. */
|
|
311
|
+
linkedAt: z2.number().int().safe().nonnegative().nullable(),
|
|
312
|
+
/** When an operator or the member unlinked a wallet or app identity; null otherwise. */
|
|
313
|
+
unlinkedAt: z2.number().int().safe().nonnegative().nullable(),
|
|
314
|
+
/** "member", or the operator or key that unlinked it. */
|
|
315
|
+
unlinkedBy: z2.string().nullable(),
|
|
316
|
+
canUnlink: z2.boolean(),
|
|
317
|
+
/**
|
|
318
|
+
* False while linked, and for an X, Discord or Telegram account while the member has selected
|
|
319
|
+
* another account of that provider: unlink that one first.
|
|
320
|
+
*/
|
|
321
|
+
canRelink: z2.boolean(),
|
|
322
|
+
/**
|
|
323
|
+
* For a wallet: whether it signs the member in, which `setSignIn` changes on its own. Null for
|
|
324
|
+
* the other kinds: an app identity signs in exactly while it is linked, and an X, Discord or
|
|
325
|
+
* Telegram account signs in as its provider allows, whatever its link.
|
|
326
|
+
*/
|
|
327
|
+
signIn: z2.boolean().nullable()
|
|
328
|
+
};
|
|
329
|
+
var memberIdentityStateSchema = z2.discriminatedUnion("kind", [
|
|
330
|
+
walletIdentitySelectorSchema.strip().extend(state2),
|
|
331
|
+
oauthIdentitySelectorSchema.strip().extend(state2),
|
|
332
|
+
telegramIdentitySelectorSchema.strip().extend(state2),
|
|
333
|
+
appIdentitySelectorSchema.strip().extend(state2)
|
|
334
|
+
]);
|
|
335
|
+
var memberIdentityStatePageSchema = z2.object({
|
|
336
|
+
items: z2.array(memberIdentityStateSchema),
|
|
337
|
+
nextCursor: pageCursorSchema.nullable()
|
|
338
|
+
});
|
|
339
|
+
var command = {
|
|
340
|
+
actionId: z2.string().uuid().default(() => crypto.randomUUID()),
|
|
341
|
+
reason: z2.string().trim().min(1).max(500)
|
|
342
|
+
};
|
|
343
|
+
var memberIdentityLinkChangeInputSchema = z2.strictObject({
|
|
344
|
+
...command,
|
|
345
|
+
identity: memberIdentitySelectorSchema,
|
|
346
|
+
expectedRevision: z2.number().int().safe().nonnegative()
|
|
347
|
+
});
|
|
348
|
+
var memberIdentitySignInInputSchema = z2.strictObject({
|
|
349
|
+
...command,
|
|
350
|
+
identity: z2.discriminatedUnion("kind", [walletIdentitySelectorSchema]),
|
|
351
|
+
enabled: z2.boolean()
|
|
352
|
+
});
|
|
353
|
+
|
|
278
354
|
// src/server/settlement-reviews.ts
|
|
279
|
-
import
|
|
355
|
+
import * as z3 from "zod";
|
|
280
356
|
var decision = {
|
|
281
|
-
status:
|
|
282
|
-
rejectedAt:
|
|
283
|
-
rejectedBy:
|
|
284
|
-
rejectionReason:
|
|
357
|
+
status: z3.enum(["pending", "approved", "rejected"]),
|
|
358
|
+
rejectedAt: z3.number().int().safe().nonnegative().nullable(),
|
|
359
|
+
rejectedBy: z3.string().nullable(),
|
|
360
|
+
rejectionReason: z3.string().nullable()
|
|
285
361
|
};
|
|
286
362
|
var leaderboardSettlementReviewSummarySchema = leaderboardSettlementSummarySchema.extend(decision);
|
|
287
363
|
var leaderboardSettlementReviewSchema = leaderboardSettlementSchema.extend(decision);
|
|
288
|
-
var leaderboardSettlementReviewQuerySchema =
|
|
364
|
+
var leaderboardSettlementReviewQuerySchema = z3.strictObject({
|
|
289
365
|
cursor: pageCursorSchema.optional(),
|
|
290
|
-
limit:
|
|
366
|
+
limit: z3.coerce.number().int().min(1).max(100).default(25)
|
|
291
367
|
});
|
|
292
|
-
var leaderboardSettlementReviewPageSchema =
|
|
293
|
-
items:
|
|
368
|
+
var leaderboardSettlementReviewPageSchema = z3.object({
|
|
369
|
+
items: z3.array(leaderboardSettlementReviewSummarySchema),
|
|
294
370
|
nextCursor: pageCursorSchema.nullable()
|
|
295
371
|
});
|
|
296
|
-
var leaderboardSettlementRejectionSchema =
|
|
297
|
-
actionId:
|
|
298
|
-
expectedCreatedAt:
|
|
299
|
-
reason:
|
|
372
|
+
var leaderboardSettlementRejectionSchema = z3.strictObject({
|
|
373
|
+
actionId: z3.string().uuid().default(() => crypto.randomUUID()),
|
|
374
|
+
expectedCreatedAt: z3.number().int().safe().nonnegative(),
|
|
375
|
+
reason: z3.string().trim().min(1).max(500)
|
|
300
376
|
});
|
|
301
377
|
|
|
302
378
|
// src/server/inventory-items.ts
|
|
303
|
-
import
|
|
304
|
-
var inventoryItemStateSchema =
|
|
379
|
+
import * as z4 from "zod";
|
|
380
|
+
var inventoryItemStateSchema = z4.object({
|
|
305
381
|
item: identifier,
|
|
306
|
-
name:
|
|
307
|
-
available:
|
|
308
|
-
reserved:
|
|
309
|
-
allocated:
|
|
310
|
-
offers:
|
|
311
|
-
revision:
|
|
312
|
-
archivedAt:
|
|
382
|
+
name: z4.string().nullable(),
|
|
383
|
+
available: z4.number().int().safe().nonnegative(),
|
|
384
|
+
reserved: z4.number().int().safe().nonnegative(),
|
|
385
|
+
allocated: z4.number().int().safe().nonnegative(),
|
|
386
|
+
offers: z4.array(identifier),
|
|
387
|
+
revision: z4.number().int().nonnegative(),
|
|
388
|
+
archivedAt: z4.number().int().safe().nonnegative().nullable()
|
|
313
389
|
});
|
|
314
390
|
var correction = {
|
|
315
|
-
actionId:
|
|
316
|
-
expectedRevision:
|
|
317
|
-
reason:
|
|
391
|
+
actionId: z4.string().uuid().default(() => crypto.randomUUID()),
|
|
392
|
+
expectedRevision: z4.number().int().nonnegative(),
|
|
393
|
+
reason: z4.string().trim().min(1).max(500)
|
|
318
394
|
};
|
|
319
|
-
var inventoryItemActionSchema =
|
|
320
|
-
var inventoryItemRenameSchema =
|
|
395
|
+
var inventoryItemActionSchema = z4.strictObject(correction);
|
|
396
|
+
var inventoryItemRenameSchema = z4.strictObject({
|
|
321
397
|
...correction,
|
|
322
|
-
name:
|
|
398
|
+
name: z4.string().trim().min(1).max(200)
|
|
323
399
|
});
|
|
324
|
-
var inventoryStockCorrectionSchema =
|
|
400
|
+
var inventoryStockCorrectionSchema = z4.strictObject({
|
|
325
401
|
...correction,
|
|
326
|
-
delta:
|
|
402
|
+
delta: z4.number().int().safe()
|
|
327
403
|
});
|
|
328
|
-
var inventoryItemPageSchema =
|
|
329
|
-
items:
|
|
404
|
+
var inventoryItemPageSchema = z4.object({
|
|
405
|
+
items: z4.array(inventoryItemStateSchema),
|
|
330
406
|
nextCursor: pageCursorSchema.nullable()
|
|
331
407
|
});
|
|
332
408
|
|
|
333
409
|
// src/server/quest-enrollments.ts
|
|
334
|
-
import
|
|
410
|
+
import * as z5 from "zod";
|
|
335
411
|
var questEnrollmentStateSchema = questEnrollmentSchema.extend({
|
|
336
|
-
revision:
|
|
337
|
-
withdrawnAt:
|
|
338
|
-
withdrawalReason:
|
|
412
|
+
revision: z5.number().int().nonnegative(),
|
|
413
|
+
withdrawnAt: z5.number().int().safe().nonnegative().nullable(),
|
|
414
|
+
withdrawalReason: z5.string().nullable()
|
|
339
415
|
});
|
|
340
416
|
var managedQuestEnrollmentSchema = questEnrollmentStateSchema.extend({
|
|
341
|
-
title:
|
|
342
|
-
key:
|
|
417
|
+
title: z5.string(),
|
|
418
|
+
key: z5.string().nullable()
|
|
343
419
|
});
|
|
344
|
-
var questEnrollmentWithdrawalInputSchema =
|
|
345
|
-
actionId:
|
|
346
|
-
expectedRevision:
|
|
347
|
-
reason:
|
|
420
|
+
var questEnrollmentWithdrawalInputSchema = z5.object({
|
|
421
|
+
actionId: z5.string().uuid().default(() => crypto.randomUUID()),
|
|
422
|
+
expectedRevision: z5.number().int().nonnegative(),
|
|
423
|
+
reason: z5.string().trim().min(1).max(500)
|
|
348
424
|
}).strict();
|
|
349
|
-
var managedQuestEnrollmentPageSchema =
|
|
350
|
-
items:
|
|
425
|
+
var managedQuestEnrollmentPageSchema = z5.object({
|
|
426
|
+
items: z5.array(managedQuestEnrollmentSchema),
|
|
351
427
|
nextCursor: pageCursorSchema.nullable()
|
|
352
428
|
});
|
|
353
429
|
|
|
354
430
|
// src/server/test-members.ts
|
|
355
|
-
import
|
|
356
|
-
var testMemberWalletSchema =
|
|
431
|
+
import * as z6 from "zod";
|
|
432
|
+
var testMemberWalletSchema = z6.object({
|
|
357
433
|
chain: walletChainSchema,
|
|
358
434
|
/** CAIP-2 network, Cosmos only. */
|
|
359
435
|
network: cosmosNetworkSchema.nullable(),
|
|
360
|
-
address:
|
|
436
|
+
address: z6.string()
|
|
361
437
|
});
|
|
362
|
-
var testMemberSchema =
|
|
438
|
+
var testMemberSchema = z6.object({
|
|
363
439
|
id: identifier,
|
|
364
|
-
name:
|
|
365
|
-
test:
|
|
440
|
+
name: z6.string(),
|
|
441
|
+
test: z6.literal(true),
|
|
366
442
|
/** Current project-calendar date (YYYY-MM-DD), computed by the server. */
|
|
367
|
-
today:
|
|
443
|
+
today: z6.iso.date().optional(),
|
|
368
444
|
/** Number of calendar days advanced; absent means zero for older servers. */
|
|
369
|
-
offsetDays:
|
|
445
|
+
offsetDays: z6.number().int().min(0).optional(),
|
|
370
446
|
/** Linked wallet addresses, by chain then newest first; absent from older servers. */
|
|
371
|
-
wallets:
|
|
447
|
+
wallets: z6.array(testMemberWalletSchema).optional()
|
|
372
448
|
});
|
|
373
|
-
var testMemberCreateSchema =
|
|
449
|
+
var testMemberCreateSchema = z6.object({
|
|
374
450
|
actionId: identifier,
|
|
375
|
-
name:
|
|
451
|
+
name: z6.string().trim().min(1).max(40)
|
|
376
452
|
}).strict();
|
|
377
453
|
var testMemberActionSchema = submitSchema.omit({ member: true, faultAfterReview: true }).extend({
|
|
378
|
-
operation:
|
|
454
|
+
operation: z6.literal("attempts.submit")
|
|
379
455
|
}).strict();
|
|
380
|
-
var testMemberResetSchema =
|
|
381
|
-
var testMemberAdvanceSchema =
|
|
456
|
+
var testMemberResetSchema = z6.object({ actionId: identifier }).strict();
|
|
457
|
+
var testMemberAdvanceSchema = z6.object({
|
|
382
458
|
actionId: identifier,
|
|
383
|
-
days:
|
|
459
|
+
days: z6.number().int().min(1).max(30)
|
|
384
460
|
}).strict();
|
|
385
|
-
var testMemberResetResultSchema =
|
|
461
|
+
var testMemberResetResultSchema = z6.object({
|
|
386
462
|
member: identifier,
|
|
387
|
-
deleted:
|
|
463
|
+
deleted: z6.literal(true)
|
|
388
464
|
});
|
|
389
|
-
var testMemberWalletLinkSchema =
|
|
390
|
-
|
|
465
|
+
var testMemberWalletLinkSchema = z6.discriminatedUnion("chain", [
|
|
466
|
+
z6.object({
|
|
391
467
|
actionId: identifier,
|
|
392
|
-
chain:
|
|
468
|
+
chain: z6.literal("solana"),
|
|
393
469
|
address: solanaAddressSchema
|
|
394
470
|
}).strict(),
|
|
395
|
-
|
|
471
|
+
z6.object({
|
|
396
472
|
actionId: identifier,
|
|
397
|
-
chain:
|
|
473
|
+
chain: z6.literal("eip155"),
|
|
398
474
|
address: evmAddressSchema
|
|
399
475
|
}).strict(),
|
|
400
|
-
|
|
476
|
+
z6.object({
|
|
401
477
|
actionId: identifier,
|
|
402
|
-
chain:
|
|
478
|
+
chain: z6.literal("cosmos"),
|
|
403
479
|
network: cosmosNetworkSchema,
|
|
404
480
|
address: cosmosAddressSchema
|
|
405
481
|
}).strict()
|
|
406
482
|
]);
|
|
407
|
-
var testMemberWalletUnlinkSchema =
|
|
483
|
+
var testMemberWalletUnlinkSchema = z6.object({
|
|
408
484
|
actionId: identifier,
|
|
409
485
|
chain: walletChainSchema,
|
|
410
|
-
address:
|
|
486
|
+
address: z6.string().min(1).max(100)
|
|
411
487
|
}).strict();
|
|
412
|
-
var testMemberHistoryQuerySchema =
|
|
488
|
+
var testMemberHistoryQuerySchema = z6.object({
|
|
413
489
|
/** Inclusive lower bound on credited activity time, in epoch milliseconds. */
|
|
414
|
-
since:
|
|
490
|
+
since: z6.coerce.number().int().nonnegative().safe().optional()
|
|
415
491
|
});
|
|
416
|
-
var testMemberHistorySchema =
|
|
492
|
+
var testMemberHistorySchema = z6.object({
|
|
417
493
|
/** Newest credited activity first, up to 500 attempts. */
|
|
418
|
-
attempts:
|
|
419
|
-
attemptSchema.extend({ eligibleAt:
|
|
494
|
+
attempts: z6.array(
|
|
495
|
+
attemptSchema.extend({ eligibleAt: z6.number().int().nonnegative().safe() })
|
|
420
496
|
),
|
|
421
497
|
/** Tracker trigger outcomes that admitted no attempt, newest occurrence first, up to 500. */
|
|
422
|
-
skipped:
|
|
423
|
-
|
|
498
|
+
skipped: z6.array(
|
|
499
|
+
z6.object({
|
|
424
500
|
quest: identifier,
|
|
425
501
|
tracker: identifier,
|
|
426
|
-
record:
|
|
427
|
-
code:
|
|
428
|
-
occurredAt:
|
|
502
|
+
record: z6.string(),
|
|
503
|
+
code: z6.string().min(1),
|
|
504
|
+
occurredAt: z6.number().int().nonnegative().safe()
|
|
429
505
|
})
|
|
430
506
|
),
|
|
431
507
|
/** False when older entries were omitted from either list. */
|
|
432
|
-
complete:
|
|
508
|
+
complete: z6.boolean()
|
|
433
509
|
});
|
|
434
510
|
|
|
435
511
|
// src/server/webhooks.ts
|
|
436
|
-
import
|
|
512
|
+
import * as z7 from "zod";
|
|
437
513
|
var PayoutSourceKind = {
|
|
438
514
|
Quest: "quest",
|
|
439
515
|
Leaderboard: "leaderboard",
|
|
440
516
|
Engagement: "engagement",
|
|
441
517
|
Manual: "manual"
|
|
442
518
|
};
|
|
443
|
-
var webhookEventSchema =
|
|
444
|
-
id:
|
|
445
|
-
version:
|
|
519
|
+
var webhookEventSchema = z7.object({
|
|
520
|
+
id: z7.string().uuid(),
|
|
521
|
+
version: z7.literal(1),
|
|
446
522
|
type: activityTypeSchema,
|
|
447
|
-
createdAt:
|
|
448
|
-
organization:
|
|
449
|
-
project:
|
|
450
|
-
environment:
|
|
451
|
-
data:
|
|
523
|
+
createdAt: z7.number().int().nonnegative(),
|
|
524
|
+
organization: z7.string(),
|
|
525
|
+
project: z7.string(),
|
|
526
|
+
environment: z7.enum(["test", "live"]),
|
|
527
|
+
data: z7.record(z7.string(), z7.json())
|
|
452
528
|
});
|
|
453
|
-
var webhookControlInputSchema =
|
|
454
|
-
var webhookInputSchema =
|
|
455
|
-
url:
|
|
456
|
-
const
|
|
457
|
-
return
|
|
529
|
+
var webhookControlInputSchema = z7.object({ actionId: z7.string().uuid().optional() }).strict();
|
|
530
|
+
var webhookInputSchema = z7.object({
|
|
531
|
+
url: z7.url().max(2048).refine((value) => {
|
|
532
|
+
const url2 = new URL(value);
|
|
533
|
+
return url2.protocol === "https:" && !url2.username && !url2.password && !url2.hash;
|
|
458
534
|
}, "Use an HTTPS URL without credentials or a fragment"),
|
|
459
|
-
types:
|
|
535
|
+
types: z7.array(activityTypeSchema).min(1).max(100).refine((v) => new Set(v).size === v.length)
|
|
460
536
|
}).strict();
|
|
461
|
-
var webhookCreateInputSchema = webhookInputSchema.extend({ actionId:
|
|
462
|
-
var webhookRotateInputSchema =
|
|
463
|
-
var webhookUpdateSchema = webhookInputSchema.partial().extend({ enabled:
|
|
464
|
-
var webhookEndpointSchema =
|
|
537
|
+
var webhookCreateInputSchema = webhookInputSchema.extend({ actionId: z7.string().uuid().optional() }).strict();
|
|
538
|
+
var webhookRotateInputSchema = z7.object({ actionId: z7.string().uuid().optional() }).strict();
|
|
539
|
+
var webhookUpdateSchema = webhookInputSchema.partial().extend({ enabled: z7.boolean().optional() }).strict();
|
|
540
|
+
var webhookEndpointSchema = z7.object({
|
|
465
541
|
...webhookInputSchema.shape,
|
|
466
|
-
id:
|
|
467
|
-
enabled:
|
|
468
|
-
disabledReason:
|
|
469
|
-
consecutiveFailures:
|
|
470
|
-
createdAt:
|
|
471
|
-
updatedAt:
|
|
542
|
+
id: z7.string().uuid(),
|
|
543
|
+
enabled: z7.boolean(),
|
|
544
|
+
disabledReason: z7.string().nullable(),
|
|
545
|
+
consecutiveFailures: z7.number().int().nonnegative(),
|
|
546
|
+
createdAt: z7.number(),
|
|
547
|
+
updatedAt: z7.number()
|
|
472
548
|
});
|
|
473
549
|
var webhookEndpointStateSchema = webhookEndpointSchema.extend({
|
|
474
|
-
revision:
|
|
475
|
-
deletedAt:
|
|
550
|
+
revision: z7.number().int().nonnegative(),
|
|
551
|
+
deletedAt: z7.number().int().safe().nonnegative().nullable()
|
|
476
552
|
});
|
|
477
|
-
var webhookDeleteInputSchema =
|
|
478
|
-
actionId:
|
|
479
|
-
expectedRevision:
|
|
480
|
-
reason:
|
|
553
|
+
var webhookDeleteInputSchema = z7.strictObject({
|
|
554
|
+
actionId: z7.string().uuid().default(() => crypto.randomUUID()),
|
|
555
|
+
expectedRevision: z7.number().int().nonnegative(),
|
|
556
|
+
reason: z7.string().trim().min(1).max(500)
|
|
481
557
|
});
|
|
482
|
-
var webhookStateQuerySchema =
|
|
558
|
+
var webhookStateQuerySchema = z7.strictObject({
|
|
483
559
|
cursor: pageCursorSchema.optional(),
|
|
484
|
-
limit:
|
|
560
|
+
limit: z7.coerce.number().int().min(1).max(100).default(50)
|
|
485
561
|
});
|
|
486
|
-
var webhookStatePageSchema =
|
|
487
|
-
items:
|
|
562
|
+
var webhookStatePageSchema = z7.object({
|
|
563
|
+
items: z7.array(webhookEndpointStateSchema),
|
|
488
564
|
nextCursor: pageCursorSchema.nullable()
|
|
489
565
|
});
|
|
490
|
-
var webhookSecretSchema =
|
|
566
|
+
var webhookSecretSchema = z7.object({
|
|
491
567
|
endpoint: webhookEndpointSchema,
|
|
492
|
-
secret:
|
|
493
|
-
previousValidUntil:
|
|
568
|
+
secret: z7.string(),
|
|
569
|
+
previousValidUntil: z7.number().nullable()
|
|
494
570
|
});
|
|
495
|
-
var webhookDeliverySchema =
|
|
496
|
-
id:
|
|
497
|
-
endpoint:
|
|
571
|
+
var webhookDeliverySchema = z7.object({
|
|
572
|
+
id: z7.string().uuid(),
|
|
573
|
+
endpoint: z7.string().uuid(),
|
|
498
574
|
event: webhookEventSchema,
|
|
499
|
-
status:
|
|
500
|
-
attempts:
|
|
501
|
-
responseStatus:
|
|
502
|
-
lastError:
|
|
503
|
-
createdAt:
|
|
504
|
-
deliveredAt:
|
|
505
|
-
replayOf:
|
|
575
|
+
status: z7.enum(["pending", "delivered", "failed", "skipped"]),
|
|
576
|
+
attempts: z7.number().int().nonnegative(),
|
|
577
|
+
responseStatus: z7.number().nullable(),
|
|
578
|
+
lastError: z7.string().nullable(),
|
|
579
|
+
createdAt: z7.number(),
|
|
580
|
+
deliveredAt: z7.number().nullable(),
|
|
581
|
+
replayOf: z7.string().uuid().nullable()
|
|
506
582
|
});
|
|
507
|
-
var webhookQuerySchema =
|
|
583
|
+
var webhookQuerySchema = z7.object({
|
|
508
584
|
/** A page's `nextCursor`: the deliveries after it, newest first. */
|
|
509
585
|
cursor: pageCursorSchema.optional(),
|
|
510
586
|
/** @deprecated Use `cursor`. Removed in 2.0.0. */
|
|
511
|
-
before:
|
|
512
|
-
limit:
|
|
587
|
+
before: z7.string().uuid().optional(),
|
|
588
|
+
limit: z7.coerce.number().int().min(1).max(100).default(50)
|
|
513
589
|
}).strict();
|
|
514
|
-
var webhookDeliveryPageSchema =
|
|
515
|
-
items:
|
|
590
|
+
var webhookDeliveryPageSchema = z7.object({
|
|
591
|
+
items: z7.array(webhookDeliverySchema),
|
|
516
592
|
nextCursor: pageCursorSchema.nullable().default(null),
|
|
517
593
|
/** @deprecated Use `nextCursor`, passed back as `cursor`. Removed in 2.0.0. */
|
|
518
|
-
next:
|
|
594
|
+
next: z7.string().uuid().nullable()
|
|
519
595
|
});
|
|
520
596
|
var WEBHOOK_MAX_BYTES = 64 * 1024;
|
|
521
597
|
async function verifyWebhook(input) {
|
|
@@ -559,8 +635,8 @@ async function verifyWebhook(input) {
|
|
|
559
635
|
}
|
|
560
636
|
|
|
561
637
|
// src/server/resource-lifecycle.ts
|
|
562
|
-
import
|
|
563
|
-
var resourceLifecycleKindSchema =
|
|
638
|
+
import * as z8 from "zod";
|
|
639
|
+
var resourceLifecycleKindSchema = z8.enum([
|
|
564
640
|
"tracker",
|
|
565
641
|
"referral",
|
|
566
642
|
"leaderboard",
|
|
@@ -570,24 +646,24 @@ var resourceLifecycleKindSchema = z7.enum([
|
|
|
570
646
|
"image",
|
|
571
647
|
"point-ledger"
|
|
572
648
|
]);
|
|
573
|
-
var managedResourceSchema =
|
|
649
|
+
var managedResourceSchema = z8.object({
|
|
574
650
|
kind: resourceLifecycleKindSchema,
|
|
575
651
|
id: identifier,
|
|
576
652
|
key: identifier.nullable(),
|
|
577
|
-
title:
|
|
578
|
-
archivedAt:
|
|
653
|
+
title: z8.string(),
|
|
654
|
+
archivedAt: z8.number().int().nonnegative().nullable()
|
|
579
655
|
});
|
|
580
|
-
var resourceLifecycleInputSchema =
|
|
581
|
-
actionId:
|
|
656
|
+
var resourceLifecycleInputSchema = z8.object({
|
|
657
|
+
actionId: z8.string().uuid(),
|
|
582
658
|
kind: resourceLifecycleKindSchema,
|
|
583
659
|
resource: identifier,
|
|
584
|
-
archived:
|
|
585
|
-
reason:
|
|
586
|
-
expectedArchivedAt:
|
|
660
|
+
archived: z8.boolean(),
|
|
661
|
+
reason: z8.string().trim().min(1).max(500),
|
|
662
|
+
expectedArchivedAt: z8.number().int().nonnegative().nullable().optional()
|
|
587
663
|
}).strict();
|
|
588
|
-
var resourceLifecycleResultSchema =
|
|
664
|
+
var resourceLifecycleResultSchema = z8.object({
|
|
589
665
|
resource: managedResourceSchema,
|
|
590
|
-
changed:
|
|
666
|
+
changed: z8.boolean()
|
|
591
667
|
});
|
|
592
668
|
var resourceLifecyclePaths = {
|
|
593
669
|
tracker: "/trackers",
|
|
@@ -606,19 +682,19 @@ var resourceArchiveInputSchema = resourceLifecycleInputSchema.omit({
|
|
|
606
682
|
});
|
|
607
683
|
|
|
608
684
|
// src/server/index.ts
|
|
609
|
-
import
|
|
685
|
+
import * as z14 from "zod";
|
|
610
686
|
|
|
611
687
|
// src/server/hosting.ts
|
|
612
|
-
import
|
|
688
|
+
import * as z11 from "zod";
|
|
613
689
|
|
|
614
690
|
// src/server/schedules.ts
|
|
615
|
-
import
|
|
691
|
+
import * as z9 from "zod";
|
|
616
692
|
import { Cron } from "croner";
|
|
617
693
|
var APP_SCHEDULE_LIMIT = 10;
|
|
618
694
|
var APP_SCHEDULE_MIN_INTERVAL = 3e5;
|
|
619
695
|
var APP_SCHEDULE_TIMEOUT = 3e4;
|
|
620
|
-
var appScheduleNameSchema =
|
|
621
|
-
var appSchedulePathSchema =
|
|
696
|
+
var appScheduleNameSchema = z9.string().regex(/^[a-z][a-z0-9-]{0,63}$/);
|
|
697
|
+
var appSchedulePathSchema = z9.string().min(2).max(512).refine((path) => {
|
|
622
698
|
if (!/^\/[a-zA-Z0-9_/-]+$/.test(path) || path.startsWith("//")) {
|
|
623
699
|
return false;
|
|
624
700
|
}
|
|
@@ -629,11 +705,11 @@ function interval(value) {
|
|
|
629
705
|
const unit = value.slice(-1);
|
|
630
706
|
return amount * (unit === "m" ? 6e4 : unit === "h" ? 36e5 : 864e5);
|
|
631
707
|
}
|
|
632
|
-
var everySchema =
|
|
708
|
+
var everySchema = z9.string().regex(/^[1-9]\d{0,3}[mhd]$/).refine(
|
|
633
709
|
(value) => interval(value) >= APP_SCHEDULE_MIN_INTERVAL && interval(value) <= 365 * 864e5,
|
|
634
710
|
"Use an interval from 5 minutes to 365 days, such as 5m, 1h or 1d"
|
|
635
711
|
);
|
|
636
|
-
var cronSchema =
|
|
712
|
+
var cronSchema = z9.string().max(120).refine((value) => {
|
|
637
713
|
const fields = value.trim().split(/\s+/);
|
|
638
714
|
if (fields.length !== 5 || fields.some((field) => !/^[\d*,/-]+$/.test(field))) {
|
|
639
715
|
return false;
|
|
@@ -658,15 +734,15 @@ var cronSchema = z8.string().max(120).refine((value) => {
|
|
|
658
734
|
var declaration = {
|
|
659
735
|
name: appScheduleNameSchema,
|
|
660
736
|
path: appSchedulePathSchema,
|
|
661
|
-
description:
|
|
737
|
+
description: z9.string().min(1).max(500)
|
|
662
738
|
};
|
|
663
|
-
var everySchedule =
|
|
664
|
-
var cronSchedule =
|
|
665
|
-
var appScheduleSchema =
|
|
739
|
+
var everySchedule = z9.object({ ...declaration, every: everySchema });
|
|
740
|
+
var cronSchedule = z9.object({ ...declaration, cron: cronSchema });
|
|
741
|
+
var appScheduleSchema = z9.union([
|
|
666
742
|
everySchedule.strict(),
|
|
667
743
|
cronSchedule.strict()
|
|
668
744
|
]);
|
|
669
|
-
var appSchedulesSchema =
|
|
745
|
+
var appSchedulesSchema = z9.array(appScheduleSchema).max(APP_SCHEDULE_LIMIT).refine(
|
|
670
746
|
(items) => new Set(items.map((item) => item.name)).size === items.length,
|
|
671
747
|
"Schedule names must be unique"
|
|
672
748
|
);
|
|
@@ -683,40 +759,40 @@ function nextScheduleRun(schedule, after) {
|
|
|
683
759
|
}
|
|
684
760
|
return next.getTime();
|
|
685
761
|
}
|
|
686
|
-
var appScheduleStateSchema =
|
|
687
|
-
var appScheduleRunSchema =
|
|
688
|
-
id:
|
|
689
|
-
build:
|
|
690
|
-
startedAt:
|
|
691
|
-
scheduledAt:
|
|
692
|
-
manual:
|
|
693
|
-
status:
|
|
694
|
-
duration:
|
|
695
|
-
error:
|
|
762
|
+
var appScheduleStateSchema = z9.enum(["active", "paused", "archived"]);
|
|
763
|
+
var appScheduleRunSchema = z9.object({
|
|
764
|
+
id: z9.string().uuid(),
|
|
765
|
+
build: z9.string().uuid(),
|
|
766
|
+
startedAt: z9.number(),
|
|
767
|
+
scheduledAt: z9.number(),
|
|
768
|
+
manual: z9.boolean(),
|
|
769
|
+
status: z9.enum(["queued", "running", "succeeded", "failed", "uncertain"]),
|
|
770
|
+
duration: z9.number().nullable(),
|
|
771
|
+
error: z9.string().nullable()
|
|
696
772
|
});
|
|
697
|
-
var appScheduleListSchema =
|
|
773
|
+
var appScheduleListSchema = z9.object({
|
|
698
774
|
state: appScheduleStateSchema,
|
|
699
|
-
schedules:
|
|
700
|
-
|
|
701
|
-
declaration:
|
|
702
|
-
nextRun:
|
|
703
|
-
blocked:
|
|
775
|
+
schedules: z9.array(
|
|
776
|
+
z9.object({
|
|
777
|
+
declaration: z9.union([everySchedule, cronSchedule]),
|
|
778
|
+
nextRun: z9.number().nullable(),
|
|
779
|
+
blocked: z9.boolean(),
|
|
704
780
|
lastRun: appScheduleRunSchema.nullable()
|
|
705
781
|
})
|
|
706
782
|
)
|
|
707
783
|
});
|
|
708
|
-
var scheduledInvocationSchema =
|
|
709
|
-
id:
|
|
710
|
-
build:
|
|
784
|
+
var scheduledInvocationSchema = z9.object({
|
|
785
|
+
id: z9.string().uuid(),
|
|
786
|
+
build: z9.string().uuid(),
|
|
711
787
|
name: appScheduleNameSchema,
|
|
712
|
-
scheduledAt:
|
|
713
|
-
startedAt:
|
|
714
|
-
manual:
|
|
788
|
+
scheduledAt: z9.number().int(),
|
|
789
|
+
startedAt: z9.number().int(),
|
|
790
|
+
manual: z9.boolean()
|
|
715
791
|
}).strict();
|
|
716
792
|
async function verifyScheduledRequest(request, key) {
|
|
717
793
|
const signature = request.headers.get("X-Domino-Schedule-Signature");
|
|
718
|
-
const
|
|
719
|
-
if (request.method !== "POST" ||
|
|
794
|
+
const url2 = new URL(request.url);
|
|
795
|
+
if (request.method !== "POST" || url2.search !== "" || url2.hash !== "" || !key || !signature || !/^[a-f0-9]{64}$/.test(signature)) {
|
|
720
796
|
return null;
|
|
721
797
|
}
|
|
722
798
|
const reader = request.clone().body?.getReader();
|
|
@@ -760,7 +836,7 @@ async function verifyScheduledRequest(request, key) {
|
|
|
760
836
|
secret,
|
|
761
837
|
bytes,
|
|
762
838
|
new TextEncoder().encode(`POST
|
|
763
|
-
${
|
|
839
|
+
${url2.pathname}
|
|
764
840
|
${body}`)
|
|
765
841
|
);
|
|
766
842
|
if (!valid) {
|
|
@@ -776,7 +852,7 @@ ${body}`)
|
|
|
776
852
|
}
|
|
777
853
|
|
|
778
854
|
// src/server/starters.ts
|
|
779
|
-
import
|
|
855
|
+
import * as z10 from "zod";
|
|
780
856
|
var starterTemplates = [
|
|
781
857
|
{
|
|
782
858
|
id: "campaign",
|
|
@@ -809,63 +885,63 @@ var starterTemplates = [
|
|
|
809
885
|
summary: "A headless Worker with typed routes and interactive API docs, for plugging Domino into your own product."
|
|
810
886
|
}
|
|
811
887
|
];
|
|
812
|
-
var starterIdSchema =
|
|
888
|
+
var starterIdSchema = z10.enum(
|
|
813
889
|
starterTemplates.map((template) => template.id)
|
|
814
890
|
);
|
|
815
891
|
|
|
816
892
|
// src/server/hosting.ts
|
|
817
|
-
var outputPathSchema =
|
|
893
|
+
var outputPathSchema = z11.string().min(1).max(512).refine(
|
|
818
894
|
(path) => path.split("/").every(
|
|
819
895
|
(part) => /^[\w-][\w.-]*$/.test(part) && part !== "node_modules"
|
|
820
896
|
),
|
|
821
897
|
"Expected a relative build output path without hidden segments"
|
|
822
898
|
);
|
|
823
|
-
var appRoutingSchema =
|
|
899
|
+
var appRoutingSchema = z11.enum(["legacy", "transparent"]).default("legacy");
|
|
824
900
|
var APP_SECRET_LIMIT = 50;
|
|
825
901
|
var APP_KV_LIMIT = 5;
|
|
826
902
|
var APP_SQL_LIMIT = 5;
|
|
827
903
|
var APP_MIGRATION_LIMIT = 100;
|
|
828
904
|
var APP_MIGRATION_FILE_BYTES = 9e4;
|
|
829
905
|
var APP_MIGRATION_TOTAL_BYTES = 1e6;
|
|
830
|
-
var appSecretNameSchema =
|
|
906
|
+
var appSecretNameSchema = z11.string().regex(
|
|
831
907
|
/^[A-Z_][A-Z0-9_]{0,63}$/,
|
|
832
908
|
"Use 1-64 uppercase letters, digits, and underscores, not starting with a digit"
|
|
833
909
|
).refine(
|
|
834
910
|
(name) => !name.startsWith("DOMINO_") && name !== "ASSETS",
|
|
835
911
|
"DOMINO_ names and ASSETS are reserved for Domino's own bindings"
|
|
836
912
|
);
|
|
837
|
-
var appSecretValueSchema =
|
|
913
|
+
var appSecretValueSchema = z11.string().min(1).refine(
|
|
838
914
|
(value) => new TextEncoder().encode(value).length <= 5120,
|
|
839
915
|
"Secret values can be at most 5 KiB"
|
|
840
916
|
);
|
|
841
|
-
var appSecretInputSchema =
|
|
842
|
-
var appSecretSchema =
|
|
917
|
+
var appSecretInputSchema = z11.object({ value: appSecretValueSchema }).strict();
|
|
918
|
+
var appSecretSchema = z11.object({
|
|
843
919
|
name: appSecretNameSchema,
|
|
844
|
-
updatedAt:
|
|
845
|
-
updatedBy:
|
|
920
|
+
updatedAt: z11.number(),
|
|
921
|
+
updatedBy: z11.string()
|
|
846
922
|
});
|
|
847
|
-
var appSecretDeclarationSchema =
|
|
848
|
-
description:
|
|
849
|
-
required:
|
|
923
|
+
var appSecretDeclarationSchema = z11.object({
|
|
924
|
+
description: z11.string().trim().min(1).max(500),
|
|
925
|
+
required: z11.boolean().default(true)
|
|
850
926
|
}).strict();
|
|
851
|
-
var appSecretDeclarationsSchema =
|
|
927
|
+
var appSecretDeclarationsSchema = z11.record(appSecretNameSchema, appSecretDeclarationSchema).refine(
|
|
852
928
|
(secrets) => Object.keys(secrets).length <= APP_SECRET_LIMIT,
|
|
853
929
|
`Declare at most ${APP_SECRET_LIMIT} app secrets`
|
|
854
930
|
);
|
|
855
|
-
var appSecretListSchema =
|
|
856
|
-
secrets:
|
|
857
|
-
declared:
|
|
931
|
+
var appSecretListSchema = z11.object({
|
|
932
|
+
secrets: z11.array(appSecretSchema),
|
|
933
|
+
declared: z11.array(appSecretDeclarationSchema.extend({ name: appSecretNameSchema })).default([])
|
|
858
934
|
});
|
|
859
|
-
var hostedAppSecretsSchema =
|
|
860
|
-
var storageDescription =
|
|
861
|
-
description:
|
|
935
|
+
var hostedAppSecretsSchema = z11.object({ secrets: z11.record(appSecretNameSchema, appSecretValueSchema) }).strict();
|
|
936
|
+
var storageDescription = z11.object({
|
|
937
|
+
description: z11.string().trim().min(1).max(500)
|
|
862
938
|
}).strict();
|
|
863
|
-
var appStorageSchema =
|
|
864
|
-
kv:
|
|
939
|
+
var appStorageSchema = z11.object({
|
|
940
|
+
kv: z11.record(appSecretNameSchema, storageDescription).refine(
|
|
865
941
|
(stores) => Object.keys(stores).length <= APP_KV_LIMIT,
|
|
866
942
|
`Declare at most ${APP_KV_LIMIT} KV stores`
|
|
867
943
|
).default({}),
|
|
868
|
-
sql:
|
|
944
|
+
sql: z11.record(
|
|
869
945
|
appSecretNameSchema,
|
|
870
946
|
storageDescription.extend({
|
|
871
947
|
migrations: outputPathSchema.optional()
|
|
@@ -875,60 +951,60 @@ var appStorageSchema = z10.object({
|
|
|
875
951
|
`Declare at most ${APP_SQL_LIMIT} SQL stores`
|
|
876
952
|
).default({})
|
|
877
953
|
}).strict();
|
|
878
|
-
var appStorageKindSchema =
|
|
879
|
-
var appStorageListSchema =
|
|
880
|
-
stores:
|
|
881
|
-
|
|
882
|
-
kind:
|
|
954
|
+
var appStorageKindSchema = z11.enum(["kv", "sql"]);
|
|
955
|
+
var appStorageListSchema = z11.object({
|
|
956
|
+
stores: z11.array(
|
|
957
|
+
z11.object({
|
|
958
|
+
kind: z11.string(),
|
|
883
959
|
name: appSecretNameSchema,
|
|
884
|
-
createdAt:
|
|
885
|
-
declared:
|
|
886
|
-
description:
|
|
960
|
+
createdAt: z11.number().nullable(),
|
|
961
|
+
declared: z11.boolean(),
|
|
962
|
+
description: z11.string().optional()
|
|
887
963
|
})
|
|
888
964
|
)
|
|
889
965
|
});
|
|
890
966
|
var APP_STORAGE_ROW_LIMIT = 50;
|
|
891
967
|
var APP_STORAGE_PREVIEW_CHARACTERS = 2e3;
|
|
892
|
-
var appStorageCellSchema =
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
968
|
+
var appStorageCellSchema = z11.union([
|
|
969
|
+
z11.string(),
|
|
970
|
+
z11.number(),
|
|
971
|
+
z11.null(),
|
|
972
|
+
z11.object({ text: z11.string(), truncated: z11.literal(true) }),
|
|
973
|
+
z11.object({ blob: z11.number().int().min(0) })
|
|
898
974
|
]);
|
|
899
|
-
var appStorageTablesSchema =
|
|
900
|
-
tables:
|
|
975
|
+
var appStorageTablesSchema = z11.object({
|
|
976
|
+
tables: z11.array(
|
|
901
977
|
/** `kind` is SQLite's: `table` or `view`. */
|
|
902
|
-
|
|
978
|
+
z11.object({ name: z11.string(), kind: z11.string() })
|
|
903
979
|
)
|
|
904
980
|
});
|
|
905
|
-
var appStorageRowsSchema =
|
|
906
|
-
table:
|
|
907
|
-
columns:
|
|
908
|
-
rows:
|
|
981
|
+
var appStorageRowsSchema = z11.object({
|
|
982
|
+
table: z11.string(),
|
|
983
|
+
columns: z11.array(z11.string()),
|
|
984
|
+
rows: z11.array(z11.array(appStorageCellSchema)),
|
|
909
985
|
/** How many rows come before this page in storage order. */
|
|
910
|
-
offset:
|
|
911
|
-
total:
|
|
986
|
+
offset: z11.number().int().min(0),
|
|
987
|
+
total: z11.number().int().min(0),
|
|
912
988
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
913
989
|
nextCursor: pageCursorSchema.nullable().default(null)
|
|
914
990
|
});
|
|
915
|
-
var appStorageKeysSchema =
|
|
916
|
-
keys:
|
|
917
|
-
|
|
991
|
+
var appStorageKeysSchema = z11.object({
|
|
992
|
+
keys: z11.array(
|
|
993
|
+
z11.object({ name: z11.string(), expiration: z11.number().nullable() })
|
|
918
994
|
),
|
|
919
995
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
920
996
|
nextCursor: pageCursorSchema.nullable().default(null),
|
|
921
997
|
/** @deprecated Use `nextCursor`. Removed in 2.0.0. */
|
|
922
|
-
cursor:
|
|
998
|
+
cursor: z11.string().nullable()
|
|
923
999
|
});
|
|
924
|
-
var appStorageValueSchema =
|
|
925
|
-
key:
|
|
926
|
-
size:
|
|
1000
|
+
var appStorageValueSchema = z11.object({
|
|
1001
|
+
key: z11.string(),
|
|
1002
|
+
size: z11.number().int().min(0),
|
|
927
1003
|
/** Null when the value is not UTF-8 text. */
|
|
928
|
-
text:
|
|
929
|
-
truncated:
|
|
1004
|
+
text: z11.string().nullable(),
|
|
1005
|
+
truncated: z11.boolean()
|
|
930
1006
|
});
|
|
931
|
-
var appMigrationNameSchema =
|
|
1007
|
+
var appMigrationNameSchema = z11.string().max(255).regex(/^[\w-][\w.-]*\.sql$/);
|
|
932
1008
|
function compareAppMigrations(a, b) {
|
|
933
1009
|
const left = Number.parseInt(a.split("_")[0], 10);
|
|
934
1010
|
const right = Number.parseInt(b.split("_")[0], 10);
|
|
@@ -945,12 +1021,12 @@ function compareAppMigrations(a, b) {
|
|
|
945
1021
|
}
|
|
946
1022
|
return a < b ? -1 : a > b ? 1 : 0;
|
|
947
1023
|
}
|
|
948
|
-
var appMigrationsSchema =
|
|
1024
|
+
var appMigrationsSchema = z11.record(
|
|
949
1025
|
appSecretNameSchema,
|
|
950
|
-
|
|
951
|
-
|
|
1026
|
+
z11.array(
|
|
1027
|
+
z11.object({
|
|
952
1028
|
name: appMigrationNameSchema,
|
|
953
|
-
sql:
|
|
1029
|
+
sql: z11.string().min(1).refine(
|
|
954
1030
|
(sql) => new TextEncoder().encode(sql).length <= APP_MIGRATION_FILE_BYTES,
|
|
955
1031
|
`A migration file must not exceed ${APP_MIGRATION_FILE_BYTES} bytes`
|
|
956
1032
|
)
|
|
@@ -968,21 +1044,21 @@ var appMigrationsSchema = z10.record(
|
|
|
968
1044
|
);
|
|
969
1045
|
var appScripts = {
|
|
970
1046
|
routing: appRoutingSchema,
|
|
971
|
-
devScript:
|
|
972
|
-
checkScript:
|
|
973
|
-
buildScript:
|
|
1047
|
+
devScript: z11.string().regex(/^[\w:-]+$/),
|
|
1048
|
+
checkScript: z11.string().regex(/^[\w:-]+$/),
|
|
1049
|
+
buildScript: z11.string().regex(/^[\w:-]+$/)
|
|
974
1050
|
};
|
|
975
1051
|
var workerSettings = {
|
|
976
|
-
runWorkerFirst:
|
|
1052
|
+
runWorkerFirst: z11.boolean().default(false),
|
|
977
1053
|
main: outputPathSchema.refine(
|
|
978
1054
|
(path) => /\.m?js$/.test(path),
|
|
979
1055
|
"Expected a compiled JavaScript entry"
|
|
980
1056
|
),
|
|
981
|
-
compatibilityDate:
|
|
982
|
-
compatibilityFlags:
|
|
983
|
-
vars:
|
|
984
|
-
|
|
985
|
-
|
|
1057
|
+
compatibilityDate: z11.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
1058
|
+
compatibilityFlags: z11.array(z11.string().min(1)).max(50).default([]),
|
|
1059
|
+
vars: z11.record(
|
|
1060
|
+
z11.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).refine((name) => name !== "ASSETS"),
|
|
1061
|
+
z11.string()
|
|
986
1062
|
).default({}),
|
|
987
1063
|
secrets: appSecretDeclarationsSchema.default({}),
|
|
988
1064
|
storage: appStorageSchema.optional(),
|
|
@@ -1011,62 +1087,62 @@ var distinctBindings = (worker, ctx) => {
|
|
|
1011
1087
|
}
|
|
1012
1088
|
}
|
|
1013
1089
|
};
|
|
1014
|
-
var hostedAppSchema =
|
|
1015
|
-
|
|
1016
|
-
kind:
|
|
1090
|
+
var hostedAppSchema = z11.discriminatedUnion("kind", [
|
|
1091
|
+
z11.object({
|
|
1092
|
+
kind: z11.literal("static"),
|
|
1017
1093
|
directory: outputPathSchema,
|
|
1018
1094
|
...appScripts
|
|
1019
1095
|
}).strict(),
|
|
1020
|
-
|
|
1021
|
-
kind:
|
|
1096
|
+
z11.object({
|
|
1097
|
+
kind: z11.literal("worker"),
|
|
1022
1098
|
directory: outputPathSchema,
|
|
1023
1099
|
assetsDirectory: outputPathSchema.optional(),
|
|
1024
1100
|
...appScripts,
|
|
1025
1101
|
...workerSettings
|
|
1026
1102
|
}).strict().superRefine(distinctBindings)
|
|
1027
1103
|
]);
|
|
1028
|
-
var repositorySchema =
|
|
1029
|
-
id:
|
|
1104
|
+
var repositorySchema = z11.object({
|
|
1105
|
+
id: z11.string().uuid(),
|
|
1030
1106
|
organization: identifier,
|
|
1031
1107
|
project: identifier,
|
|
1032
|
-
remote:
|
|
1033
|
-
defaultBranch:
|
|
1034
|
-
status:
|
|
1108
|
+
remote: z11.string().url(),
|
|
1109
|
+
defaultBranch: z11.string(),
|
|
1110
|
+
status: z11.enum(["provisioning", "ready"])
|
|
1035
1111
|
});
|
|
1036
|
-
var createRepositorySchema =
|
|
1112
|
+
var createRepositorySchema = z11.object({
|
|
1037
1113
|
/** Omitted: the starter chosen at project setup, else `campaign`. */
|
|
1038
1114
|
starter: starterIdSchema.optional()
|
|
1039
1115
|
}).strict();
|
|
1040
|
-
var deviceStartSchema =
|
|
1041
|
-
challenge:
|
|
1116
|
+
var deviceStartSchema = z11.object({
|
|
1117
|
+
challenge: z11.string().regex(/^[a-f0-9]{64}$/)
|
|
1042
1118
|
}).strict();
|
|
1043
|
-
var deviceRedeemSchema =
|
|
1044
|
-
id:
|
|
1045
|
-
verifier:
|
|
1119
|
+
var deviceRedeemSchema = z11.object({
|
|
1120
|
+
id: z11.string().uuid(),
|
|
1121
|
+
verifier: z11.string().min(43).max(128)
|
|
1046
1122
|
}).strict();
|
|
1047
|
-
var deviceApproveSchema =
|
|
1048
|
-
id:
|
|
1049
|
-
code:
|
|
1123
|
+
var deviceApproveSchema = z11.object({
|
|
1124
|
+
id: z11.string().uuid(),
|
|
1125
|
+
code: z11.string().regex(/^[A-F0-9]{4}-[A-F0-9]{4}$/)
|
|
1050
1126
|
}).strict();
|
|
1051
|
-
var commitSchema =
|
|
1052
|
-
var stageRequestSchema =
|
|
1127
|
+
var commitSchema = z11.string().regex(/^[a-f0-9]{40}$/);
|
|
1128
|
+
var stageRequestSchema = z11.object({
|
|
1053
1129
|
commit: commitSchema,
|
|
1054
|
-
requestId:
|
|
1130
|
+
requestId: z11.string().uuid()
|
|
1055
1131
|
}).strict();
|
|
1056
|
-
var buildIdentitySchema =
|
|
1132
|
+
var buildIdentitySchema = z11.object({
|
|
1057
1133
|
routing: appRoutingSchema,
|
|
1058
|
-
slug:
|
|
1059
|
-
runtime:
|
|
1060
|
-
id:
|
|
1061
|
-
repository:
|
|
1134
|
+
slug: z11.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional(),
|
|
1135
|
+
runtime: z11.enum(["simulation", "hosted-test"]).default("simulation"),
|
|
1136
|
+
id: z11.string().uuid(),
|
|
1137
|
+
repository: z11.string().uuid(),
|
|
1062
1138
|
organization: identifier,
|
|
1063
1139
|
project: identifier,
|
|
1064
1140
|
commit: commitSchema,
|
|
1065
|
-
createdAt:
|
|
1066
|
-
actor:
|
|
1067
|
-
commitMessage:
|
|
1141
|
+
createdAt: z11.number(),
|
|
1142
|
+
actor: z11.string(),
|
|
1143
|
+
commitMessage: z11.string().max(500).optional()
|
|
1068
1144
|
});
|
|
1069
|
-
var buildPhaseSchema =
|
|
1145
|
+
var buildPhaseSchema = z11.enum([
|
|
1070
1146
|
"queued",
|
|
1071
1147
|
"source",
|
|
1072
1148
|
"install",
|
|
@@ -1076,72 +1152,72 @@ var buildPhaseSchema = z10.enum([
|
|
|
1076
1152
|
"ready",
|
|
1077
1153
|
"failed"
|
|
1078
1154
|
]);
|
|
1079
|
-
var buildStatusSchema =
|
|
1155
|
+
var buildStatusSchema = z11.object({
|
|
1080
1156
|
phase: buildPhaseSchema,
|
|
1081
1157
|
failedPhase: buildPhaseSchema.optional(),
|
|
1082
|
-
updatedAt:
|
|
1083
|
-
message:
|
|
1158
|
+
updatedAt: z11.number(),
|
|
1159
|
+
message: z11.string()
|
|
1084
1160
|
});
|
|
1085
1161
|
var hostedBuildSchema = buildIdentitySchema.extend({
|
|
1086
1162
|
...buildStatusSchema.shape,
|
|
1087
|
-
finished:
|
|
1088
|
-
current:
|
|
1089
|
-
stagingUrl:
|
|
1163
|
+
finished: z11.boolean(),
|
|
1164
|
+
current: z11.boolean(),
|
|
1165
|
+
stagingUrl: z11.string().url()
|
|
1090
1166
|
});
|
|
1091
|
-
var stagingAccessModeSchema =
|
|
1092
|
-
var stagingAccessSchema =
|
|
1093
|
-
var stagingAccessInputSchema =
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
mode:
|
|
1097
|
-
password:
|
|
1167
|
+
var stagingAccessModeSchema = z11.enum(["console", "password"]);
|
|
1168
|
+
var stagingAccessSchema = z11.object({ mode: stagingAccessModeSchema });
|
|
1169
|
+
var stagingAccessInputSchema = z11.discriminatedUnion("mode", [
|
|
1170
|
+
z11.object({ mode: z11.literal("console") }).strict(),
|
|
1171
|
+
z11.object({
|
|
1172
|
+
mode: z11.literal("password"),
|
|
1173
|
+
password: z11.string().min(8).max(128)
|
|
1098
1174
|
}).strict()
|
|
1099
1175
|
]);
|
|
1100
|
-
var stagingPathSchema =
|
|
1176
|
+
var stagingPathSchema = z11.string().max(2048).refine(
|
|
1101
1177
|
(path) => path.startsWith("/") && !path.startsWith("//") && !path.includes("\\"),
|
|
1102
1178
|
"Expected a path on the staging host"
|
|
1103
1179
|
);
|
|
1104
|
-
var stagingLinkSchema =
|
|
1105
|
-
url:
|
|
1106
|
-
expiresAt:
|
|
1180
|
+
var stagingLinkSchema = z11.object({
|
|
1181
|
+
url: z11.string().url(),
|
|
1182
|
+
expiresAt: z11.number()
|
|
1107
1183
|
});
|
|
1108
|
-
var buildSnapshotSchema =
|
|
1109
|
-
builds:
|
|
1184
|
+
var buildSnapshotSchema = z11.object({
|
|
1185
|
+
builds: z11.array(hostedBuildSchema),
|
|
1110
1186
|
current: hostedBuildSchema.nullable(),
|
|
1111
1187
|
selected: hostedBuildSchema.nullable(),
|
|
1112
|
-
logs:
|
|
1188
|
+
logs: z11.string()
|
|
1113
1189
|
});
|
|
1114
|
-
var assetPathSchema =
|
|
1190
|
+
var assetPathSchema = z11.string().max(512).refine(
|
|
1115
1191
|
(path) => path.startsWith("/") && // oxlint-disable-next-line no-control-regex -- Asset paths must reject control characters.
|
|
1116
1192
|
!/[\\\u0000-\u001f?#%]/.test(path) && path.slice(1).split("/").every((part) => part.length > 0 && !part.startsWith(".")),
|
|
1117
1193
|
"Expected a public asset path without hidden segments"
|
|
1118
1194
|
);
|
|
1119
|
-
var base64Schema =
|
|
1195
|
+
var base64Schema = z11.string().regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
|
|
1120
1196
|
var stagedDeploymentLimits = {
|
|
1121
1197
|
/** Bytes of JSON, uncompressed. */
|
|
1122
1198
|
size: 64e6,
|
|
1123
1199
|
/** Bytes of the Brotli-compressed object. */
|
|
1124
1200
|
compressedSize: 1e7
|
|
1125
1201
|
};
|
|
1126
|
-
var stagedDeploymentSchema =
|
|
1127
|
-
encoding:
|
|
1128
|
-
sha256:
|
|
1129
|
-
compressedSize:
|
|
1130
|
-
size:
|
|
1202
|
+
var stagedDeploymentSchema = z11.object({
|
|
1203
|
+
encoding: z11.literal("br"),
|
|
1204
|
+
sha256: z11.string().regex(/^[0-9a-f]{64}$/),
|
|
1205
|
+
compressedSize: z11.number().int().positive().max(stagedDeploymentLimits.compressedSize),
|
|
1206
|
+
size: z11.number().int().positive().max(stagedDeploymentLimits.size)
|
|
1131
1207
|
}).strict();
|
|
1132
1208
|
var stagedDeploymentContentSchema = stagedDeploymentSchema.extend({
|
|
1133
|
-
content:
|
|
1209
|
+
content: z11.string().max(Math.ceil(stagedDeploymentLimits.compressedSize / 3) * 4)
|
|
1134
1210
|
}).strict();
|
|
1135
1211
|
var stagedDeploymentKey = (build, sha256) => `builds/${build}/deployment/${sha256}.br`;
|
|
1136
1212
|
var artifactFields = {
|
|
1137
1213
|
routing: appRoutingSchema,
|
|
1138
|
-
worker:
|
|
1214
|
+
worker: z11.object({
|
|
1139
1215
|
...workerSettings,
|
|
1140
1216
|
migrations: appMigrationsSchema.optional(),
|
|
1141
|
-
modules:
|
|
1142
|
-
|
|
1217
|
+
modules: z11.array(
|
|
1218
|
+
z11.object({
|
|
1143
1219
|
path: outputPathSchema.refine((path) => path !== "metadata"),
|
|
1144
|
-
type:
|
|
1220
|
+
type: z11.enum([
|
|
1145
1221
|
"application/javascript+module",
|
|
1146
1222
|
"application/wasm",
|
|
1147
1223
|
"text/plain",
|
|
@@ -1151,26 +1227,26 @@ var artifactFields = {
|
|
|
1151
1227
|
}).strict()
|
|
1152
1228
|
).min(1).max(500)
|
|
1153
1229
|
}).strict().superRefine(distinctBindings).optional(),
|
|
1154
|
-
assets:
|
|
1155
|
-
|
|
1230
|
+
assets: z11.array(
|
|
1231
|
+
z11.object({
|
|
1156
1232
|
path: assetPathSchema,
|
|
1157
1233
|
content: base64Schema.max(14e6),
|
|
1158
|
-
size:
|
|
1234
|
+
size: z11.number().int().min(0).max(1e7)
|
|
1159
1235
|
}).strict()
|
|
1160
1236
|
).max(500)
|
|
1161
1237
|
};
|
|
1162
|
-
var buildArtifactsSchema =
|
|
1163
|
-
|
|
1164
|
-
format:
|
|
1238
|
+
var buildArtifactsSchema = z11.discriminatedUnion("format", [
|
|
1239
|
+
z11.object({
|
|
1240
|
+
format: z11.literal(1),
|
|
1165
1241
|
...artifactFields,
|
|
1166
|
-
quests:
|
|
1167
|
-
catalog:
|
|
1242
|
+
quests: z11.unknown(),
|
|
1243
|
+
catalog: z11.unknown()
|
|
1168
1244
|
}).strict(),
|
|
1169
|
-
|
|
1170
|
-
format:
|
|
1245
|
+
z11.object({
|
|
1246
|
+
format: z11.literal(2),
|
|
1171
1247
|
...artifactFields,
|
|
1172
1248
|
deployment: stagedDeploymentSchema,
|
|
1173
|
-
images:
|
|
1249
|
+
images: z11.array(imageAssetArtifactSchema).max(10)
|
|
1174
1250
|
}).strict()
|
|
1175
1251
|
]).superRefine((value, ctx) => {
|
|
1176
1252
|
if (value.worker) {
|
|
@@ -1222,39 +1298,39 @@ var buildArtifactsSchema = z10.discriminatedUnion("format", [
|
|
|
1222
1298
|
});
|
|
1223
1299
|
|
|
1224
1300
|
// src/server/development.ts
|
|
1225
|
-
import
|
|
1226
|
-
var developmentPreflightSchema =
|
|
1227
|
-
organization:
|
|
1228
|
-
project:
|
|
1229
|
-
environment:
|
|
1230
|
-
identity:
|
|
1231
|
-
exchange:
|
|
1232
|
-
activeIntegrations:
|
|
1301
|
+
import * as z12 from "zod";
|
|
1302
|
+
var developmentPreflightSchema = z12.object({
|
|
1303
|
+
organization: z12.string(),
|
|
1304
|
+
project: z12.string(),
|
|
1305
|
+
environment: z12.enum(["test", "live"]),
|
|
1306
|
+
identity: z12.object({
|
|
1307
|
+
exchange: z12.literal("supported"),
|
|
1308
|
+
activeIntegrations: z12.number().int().nonnegative()
|
|
1233
1309
|
}).optional(),
|
|
1234
|
-
staging:
|
|
1235
|
-
development:
|
|
1236
|
-
status:
|
|
1310
|
+
staging: z12.enum(["configured", "blocked"]),
|
|
1311
|
+
development: z12.object({
|
|
1312
|
+
status: z12.enum(["configured", "blocked"]),
|
|
1237
1313
|
// How `domino dev` reaches the preview origin: a Cloudflare tunnel, or a direct route on a
|
|
1238
1314
|
// local development stack. APIs that predate the field use tunnels.
|
|
1239
|
-
transport:
|
|
1240
|
-
missing:
|
|
1241
|
-
authentication:
|
|
1315
|
+
transport: z12.enum(["tunnel", "direct"]).default("tunnel"),
|
|
1316
|
+
missing: z12.array(z12.string()),
|
|
1317
|
+
authentication: z12.array(z12.string())
|
|
1242
1318
|
}),
|
|
1243
|
-
checks:
|
|
1244
|
-
|
|
1245
|
-
id:
|
|
1246
|
-
status:
|
|
1247
|
-
message:
|
|
1248
|
-
missing:
|
|
1249
|
-
issues:
|
|
1319
|
+
checks: z12.array(
|
|
1320
|
+
z12.object({
|
|
1321
|
+
id: z12.string(),
|
|
1322
|
+
status: z12.enum(["ok", "error"]),
|
|
1323
|
+
message: z12.string(),
|
|
1324
|
+
missing: z12.array(z12.string()).optional(),
|
|
1325
|
+
issues: z12.array(z12.string()).optional()
|
|
1250
1326
|
})
|
|
1251
1327
|
)
|
|
1252
1328
|
});
|
|
1253
1329
|
|
|
1254
1330
|
// src/server/hosted.ts
|
|
1255
|
-
import
|
|
1331
|
+
import * as z13 from "zod";
|
|
1256
1332
|
var hostedKeyPermissions = ["read", "points", "ingest"];
|
|
1257
|
-
var hostedKeyPermissionList =
|
|
1333
|
+
var hostedKeyPermissionList = z13.array(z13.string()).transform(
|
|
1258
1334
|
(values) => values.filter(
|
|
1259
1335
|
(value) => hostedKeyPermissions.includes(value)
|
|
1260
1336
|
)
|
|
@@ -1266,17 +1342,17 @@ var hostedManagementBindings = [
|
|
|
1266
1342
|
"DOMINO_PROJECT",
|
|
1267
1343
|
"DOMINO_ENVIRONMENT"
|
|
1268
1344
|
];
|
|
1269
|
-
var hostedKeySecretSchema =
|
|
1270
|
-
var hostedKeySchema =
|
|
1271
|
-
id:
|
|
1345
|
+
var hostedKeySecretSchema = z13.string().regex(/^dhk_[A-Za-z0-9_-]{43}$/, "Expected a hosted app key");
|
|
1346
|
+
var hostedKeySchema = z13.object({
|
|
1347
|
+
id: z13.string().uuid(),
|
|
1272
1348
|
token: hostedKeySecretSchema,
|
|
1273
1349
|
organization: identifier,
|
|
1274
1350
|
project: identifier,
|
|
1275
|
-
environment:
|
|
1351
|
+
environment: z13.enum(["test", "live"]),
|
|
1276
1352
|
permissions: hostedKeyPermissionList,
|
|
1277
|
-
expiresAt:
|
|
1353
|
+
expiresAt: z13.number().nullable()
|
|
1278
1354
|
}).strict();
|
|
1279
|
-
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl:
|
|
1355
|
+
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl: z13.string().url() }).strict();
|
|
1280
1356
|
function hostedManagementClient(env) {
|
|
1281
1357
|
const missing = hostedManagementBindings.filter((name) => !env[name]);
|
|
1282
1358
|
if (missing.length) {
|
|
@@ -1284,7 +1360,7 @@ function hostedManagementClient(env) {
|
|
|
1284
1360
|
`Missing ${missing.join(", ")}. Domino sets these for hosted apps and domino dev; update the project's vite.config.ts to forward them in development.`
|
|
1285
1361
|
);
|
|
1286
1362
|
}
|
|
1287
|
-
const environment =
|
|
1363
|
+
const environment = z13.enum(["test", "live"]).parse(env.DOMINO_ENVIRONMENT);
|
|
1288
1364
|
const token = env.DOMINO_MANAGEMENT_KEY;
|
|
1289
1365
|
return createManagementClient({
|
|
1290
1366
|
baseUrl: env.DOMINO_API_URL.replace(/\/+$/, ""),
|
|
@@ -1296,9 +1372,9 @@ function hostedManagementClient(env) {
|
|
|
1296
1372
|
}
|
|
1297
1373
|
|
|
1298
1374
|
// src/server/index.ts
|
|
1299
|
-
var environmentSchema =
|
|
1300
|
-
var roleSchema =
|
|
1301
|
-
var permissionSchema =
|
|
1375
|
+
var environmentSchema = z14.enum(["test", "live"]);
|
|
1376
|
+
var roleSchema = z14.enum(["editor", "reviewer", "staff"]);
|
|
1377
|
+
var permissionSchema = z14.enum([
|
|
1302
1378
|
"read",
|
|
1303
1379
|
"publish",
|
|
1304
1380
|
"review",
|
|
@@ -1318,7 +1394,7 @@ var permissionSchema = z13.enum([
|
|
|
1318
1394
|
*/
|
|
1319
1395
|
"enroll"
|
|
1320
1396
|
]);
|
|
1321
|
-
var permissionListSchema =
|
|
1397
|
+
var permissionListSchema = z14.array(z14.string()).transform(
|
|
1322
1398
|
(values) => values.filter(
|
|
1323
1399
|
(value) => permissionSchema.safeParse(value).success
|
|
1324
1400
|
)
|
|
@@ -1328,33 +1404,33 @@ var rolePermissions = {
|
|
|
1328
1404
|
reviewer: ["read", "review"],
|
|
1329
1405
|
staff: ["read", "confirm", "handover"]
|
|
1330
1406
|
};
|
|
1331
|
-
var projectSetupSchema =
|
|
1332
|
-
mode:
|
|
1333
|
-
brief:
|
|
1407
|
+
var projectSetupSchema = z14.object({
|
|
1408
|
+
mode: z14.enum(["new", "existing"]),
|
|
1409
|
+
brief: z14.string().trim().min(1).max(4e3)
|
|
1334
1410
|
}).strict();
|
|
1335
|
-
var operatorUserSchema =
|
|
1336
|
-
id:
|
|
1337
|
-
name:
|
|
1338
|
-
email:
|
|
1339
|
-
avatar:
|
|
1411
|
+
var operatorUserSchema = z14.object({
|
|
1412
|
+
id: z14.string(),
|
|
1413
|
+
name: z14.string().nullable(),
|
|
1414
|
+
email: z14.string().nullable(),
|
|
1415
|
+
avatar: z14.string().nullable()
|
|
1340
1416
|
});
|
|
1341
|
-
var projectSchema =
|
|
1342
|
-
slug:
|
|
1343
|
-
createdBy:
|
|
1417
|
+
var projectSchema = z14.object({
|
|
1418
|
+
slug: z14.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
1419
|
+
createdBy: z14.string().nullable().optional(),
|
|
1344
1420
|
creator: operatorUserSchema.nullable().optional(),
|
|
1345
1421
|
/** A response, so fields a newer server adds to the setup are dropped, not rejected. */
|
|
1346
|
-
setup:
|
|
1422
|
+
setup: z14.object(projectSetupSchema.shape).optional(),
|
|
1347
1423
|
/** The starter chosen at setup. A plain string, so later starters still parse. */
|
|
1348
|
-
starter:
|
|
1349
|
-
id:
|
|
1424
|
+
starter: z14.string().optional(),
|
|
1425
|
+
id: z14.string().min(1),
|
|
1350
1426
|
organization: identifier,
|
|
1351
1427
|
project: identifier,
|
|
1352
|
-
name:
|
|
1353
|
-
subtitle:
|
|
1354
|
-
initials:
|
|
1355
|
-
color:
|
|
1428
|
+
name: z14.string(),
|
|
1429
|
+
subtitle: z14.string(),
|
|
1430
|
+
initials: z14.string(),
|
|
1431
|
+
color: z14.string(),
|
|
1356
1432
|
permissions: permissionListSchema,
|
|
1357
|
-
environments:
|
|
1433
|
+
environments: z14.array(environmentSchema)
|
|
1358
1434
|
}).refine(
|
|
1359
1435
|
(project) => !project.creator || project.creator.id === project.createdBy,
|
|
1360
1436
|
{
|
|
@@ -1362,45 +1438,45 @@ var projectSchema = z13.object({
|
|
|
1362
1438
|
path: ["creator"]
|
|
1363
1439
|
}
|
|
1364
1440
|
);
|
|
1365
|
-
var projectInputSchema =
|
|
1441
|
+
var projectInputSchema = z14.object({
|
|
1366
1442
|
actionId: identifier,
|
|
1367
|
-
name:
|
|
1443
|
+
name: z14.string().trim().min(1).max(80),
|
|
1368
1444
|
setup: projectSetupSchema.optional(),
|
|
1369
1445
|
/** The starter a new hosted app begins from, with `setup.mode` "new". */
|
|
1370
1446
|
starter: starterIdSchema.optional()
|
|
1371
1447
|
}).strict();
|
|
1372
|
-
var projectUpdateInputSchema =
|
|
1373
|
-
|
|
1374
|
-
|
|
1448
|
+
var projectUpdateInputSchema = z14.union([
|
|
1449
|
+
z14.object({ name: projectInputSchema.shape.name }).strict(),
|
|
1450
|
+
z14.object({
|
|
1375
1451
|
slug: projectSchema.shape.slug,
|
|
1376
|
-
confirm:
|
|
1452
|
+
confirm: z14.string().min(1).max(80)
|
|
1377
1453
|
}).strict()
|
|
1378
1454
|
]);
|
|
1379
|
-
var projectDeletionInputSchema =
|
|
1380
|
-
var projectDeletionSchema =
|
|
1455
|
+
var projectDeletionInputSchema = z14.object({ confirm: z14.string().min(1).max(80) }).strict();
|
|
1456
|
+
var projectDeletionSchema = z14.object({
|
|
1381
1457
|
project: identifier,
|
|
1382
|
-
purgeAfter:
|
|
1458
|
+
purgeAfter: z14.number().int()
|
|
1383
1459
|
});
|
|
1384
|
-
var projectTransferInputSchema =
|
|
1385
|
-
var projectTransferSchema =
|
|
1460
|
+
var projectTransferInputSchema = z14.object({ organization: identifier, confirm: z14.string().min(1).max(80) }).strict();
|
|
1461
|
+
var projectTransferSchema = z14.object({
|
|
1386
1462
|
organization: identifier,
|
|
1387
1463
|
project: identifier
|
|
1388
1464
|
});
|
|
1389
|
-
var grantSchema =
|
|
1390
|
-
subject:
|
|
1391
|
-
roles:
|
|
1392
|
-
environments:
|
|
1465
|
+
var grantSchema = z14.object({
|
|
1466
|
+
subject: z14.string().min(1).max(200),
|
|
1467
|
+
roles: z14.array(roleSchema),
|
|
1468
|
+
environments: z14.array(environmentSchema)
|
|
1393
1469
|
}).strict();
|
|
1394
|
-
var grantRecordSchema =
|
|
1395
|
-
var stockAdditionSchema =
|
|
1470
|
+
var grantRecordSchema = z14.object(grantSchema.shape);
|
|
1471
|
+
var stockAdditionSchema = z14.object({
|
|
1396
1472
|
item: identifier,
|
|
1397
|
-
quantity:
|
|
1473
|
+
quantity: z14.number().int(),
|
|
1398
1474
|
actionId: identifier
|
|
1399
1475
|
});
|
|
1400
|
-
var completionRevokeSchema =
|
|
1476
|
+
var completionRevokeSchema = z14.object({
|
|
1401
1477
|
actionId: identifier,
|
|
1402
|
-
reason:
|
|
1403
|
-
freeOccurrence:
|
|
1478
|
+
reason: z14.string().trim().min(1).max(500),
|
|
1479
|
+
freeOccurrence: z14.boolean().default(false)
|
|
1404
1480
|
}).strict();
|
|
1405
1481
|
var RevokedEntitlementOutcome = {
|
|
1406
1482
|
/** No other completion grants the reward: it is void, after cancelling a handover in progress. */
|
|
@@ -1428,234 +1504,234 @@ var RevokedReferralOutcome = {
|
|
|
1428
1504
|
/** Qualified on another accepted completion of the program's quest instead. */
|
|
1429
1505
|
Requalified: "requalified"
|
|
1430
1506
|
};
|
|
1431
|
-
var entitlementOutcomeSchema =
|
|
1432
|
-
var deliveryOutcomeSchema =
|
|
1433
|
-
var referralOutcomeSchema =
|
|
1434
|
-
var completionRevocationSchema =
|
|
1507
|
+
var entitlementOutcomeSchema = z14.string().min(1).max(64);
|
|
1508
|
+
var deliveryOutcomeSchema = z14.string().min(1).max(64);
|
|
1509
|
+
var referralOutcomeSchema = z14.string().min(1).max(64);
|
|
1510
|
+
var completionRevocationSchema = z14.object({
|
|
1435
1511
|
completion: identifier,
|
|
1436
1512
|
/** The quest ID, or the board ID when `source.kind` is `leaderboard`. */
|
|
1437
1513
|
quest: identifier,
|
|
1438
1514
|
member: identifier,
|
|
1439
1515
|
/** What paid the revoked completion. `source.id` repeats `quest`. */
|
|
1440
1516
|
source: completionSourceSchema.optional(),
|
|
1441
|
-
revokedAt:
|
|
1442
|
-
occurrenceFreed:
|
|
1443
|
-
badges:
|
|
1444
|
-
points:
|
|
1445
|
-
|
|
1517
|
+
revokedAt: z14.number(),
|
|
1518
|
+
occurrenceFreed: z14.boolean(),
|
|
1519
|
+
badges: z14.array(z14.object({ badge: identifier, stillAwarded: z14.boolean() })).optional(),
|
|
1520
|
+
points: z14.array(
|
|
1521
|
+
z14.object({
|
|
1446
1522
|
entry: identifier,
|
|
1447
1523
|
balance: identifier,
|
|
1448
1524
|
reversal: identifier.nullable(),
|
|
1449
|
-
reversed:
|
|
1450
|
-
unreversed:
|
|
1525
|
+
reversed: z14.number().int(),
|
|
1526
|
+
unreversed: z14.number().int()
|
|
1451
1527
|
})
|
|
1452
1528
|
),
|
|
1453
|
-
entitlements:
|
|
1454
|
-
|
|
1529
|
+
entitlements: z14.array(
|
|
1530
|
+
z14.object({
|
|
1455
1531
|
entitlement: identifier,
|
|
1456
1532
|
reward: identifier,
|
|
1457
1533
|
outcome: entitlementOutcomeSchema,
|
|
1458
|
-
status:
|
|
1534
|
+
status: z14.string()
|
|
1459
1535
|
})
|
|
1460
1536
|
),
|
|
1461
|
-
deliveries:
|
|
1462
|
-
|
|
1463
|
-
delivery:
|
|
1464
|
-
roleId:
|
|
1537
|
+
deliveries: z14.array(
|
|
1538
|
+
z14.object({
|
|
1539
|
+
delivery: z14.string(),
|
|
1540
|
+
roleId: z14.string(),
|
|
1465
1541
|
outcome: deliveryOutcomeSchema,
|
|
1466
1542
|
/**
|
|
1467
1543
|
* By Relay's records, another accepted, unrevoked completion of the member also granted this
|
|
1468
1544
|
* role to the same Discord account and server. Relay does not read Discord's membership.
|
|
1469
1545
|
*/
|
|
1470
|
-
stillGranted:
|
|
1546
|
+
stillGranted: z14.boolean()
|
|
1471
1547
|
})
|
|
1472
1548
|
),
|
|
1473
|
-
referrals:
|
|
1474
|
-
|
|
1549
|
+
referrals: z14.array(
|
|
1550
|
+
z14.object({
|
|
1475
1551
|
program: identifier,
|
|
1476
1552
|
outcome: referralOutcomeSchema
|
|
1477
1553
|
})
|
|
1478
1554
|
),
|
|
1479
|
-
streakMilestone:
|
|
1555
|
+
streakMilestone: z14.boolean()
|
|
1480
1556
|
});
|
|
1481
|
-
var accessSchema =
|
|
1482
|
-
actor:
|
|
1483
|
-
organization:
|
|
1484
|
-
admin:
|
|
1485
|
-
local:
|
|
1486
|
-
projects:
|
|
1557
|
+
var accessSchema = z14.object({
|
|
1558
|
+
actor: z14.string(),
|
|
1559
|
+
organization: z14.string(),
|
|
1560
|
+
admin: z14.boolean(),
|
|
1561
|
+
local: z14.boolean(),
|
|
1562
|
+
projects: z14.array(projectSchema)
|
|
1487
1563
|
});
|
|
1488
|
-
var querySchema =
|
|
1489
|
-
q:
|
|
1490
|
-
filter:
|
|
1491
|
-
offset:
|
|
1492
|
-
limit:
|
|
1564
|
+
var querySchema = z14.object({
|
|
1565
|
+
q: z14.string().max(200).default(""),
|
|
1566
|
+
filter: z14.string().max(50).default("all"),
|
|
1567
|
+
offset: z14.coerce.number().int().min(0).max(1e6).default(0),
|
|
1568
|
+
limit: z14.coerce.number().int().min(1).max(100).default(25)
|
|
1493
1569
|
});
|
|
1494
|
-
var accountProfileSchema =
|
|
1495
|
-
name:
|
|
1570
|
+
var accountProfileSchema = z14.object({
|
|
1571
|
+
name: z14.string().optional(),
|
|
1496
1572
|
/** The account's handle, where the provider has one (X and Discord). */
|
|
1497
|
-
username:
|
|
1498
|
-
email:
|
|
1499
|
-
emailVerified:
|
|
1500
|
-
imageUrl:
|
|
1573
|
+
username: z14.string().optional(),
|
|
1574
|
+
email: z14.string().optional(),
|
|
1575
|
+
emailVerified: z14.boolean().default(false),
|
|
1576
|
+
imageUrl: z14.string().url().optional()
|
|
1501
1577
|
});
|
|
1502
|
-
var memberAccountSchema =
|
|
1578
|
+
var memberAccountSchema = z14.object({
|
|
1503
1579
|
/** `wallet` for wallet sign-in, `account` for every other connected account. */
|
|
1504
|
-
kind:
|
|
1505
|
-
provider:
|
|
1506
|
-
subject:
|
|
1507
|
-
signInEnabled:
|
|
1580
|
+
kind: z14.enum(["account", "wallet"]),
|
|
1581
|
+
provider: z14.string(),
|
|
1582
|
+
subject: z14.string(),
|
|
1583
|
+
signInEnabled: z14.boolean(),
|
|
1508
1584
|
profile: accountProfileSchema.optional()
|
|
1509
1585
|
});
|
|
1510
|
-
var operationSchema =
|
|
1511
|
-
target:
|
|
1512
|
-
paused:
|
|
1513
|
-
revision:
|
|
1514
|
-
reason:
|
|
1515
|
-
actor:
|
|
1516
|
-
changedAt:
|
|
1586
|
+
var operationSchema = z14.object({
|
|
1587
|
+
target: z14.string(),
|
|
1588
|
+
paused: z14.boolean(),
|
|
1589
|
+
revision: z14.number().int(),
|
|
1590
|
+
reason: z14.string(),
|
|
1591
|
+
actor: z14.string().nullable(),
|
|
1592
|
+
changedAt: z14.number()
|
|
1517
1593
|
});
|
|
1518
|
-
var operationInputSchema =
|
|
1519
|
-
target:
|
|
1520
|
-
|
|
1521
|
-
|
|
1594
|
+
var operationInputSchema = z14.object({
|
|
1595
|
+
target: z14.union([
|
|
1596
|
+
z14.literal("redemptions"),
|
|
1597
|
+
z14.string().regex(/^quest:[\w-]+$/)
|
|
1522
1598
|
]),
|
|
1523
|
-
paused:
|
|
1524
|
-
revision:
|
|
1525
|
-
reason:
|
|
1599
|
+
paused: z14.boolean(),
|
|
1600
|
+
revision: z14.number().int().nonnegative(),
|
|
1601
|
+
reason: z14.string().trim().min(1).max(500),
|
|
1526
1602
|
actionId: identifier
|
|
1527
1603
|
}).strict();
|
|
1528
|
-
var questLifecycleInputSchema =
|
|
1604
|
+
var questLifecycleInputSchema = z14.object({
|
|
1529
1605
|
quest: identifier,
|
|
1530
1606
|
expectedRelease: identifier.optional(),
|
|
1531
|
-
archived:
|
|
1532
|
-
reason:
|
|
1607
|
+
archived: z14.boolean(),
|
|
1608
|
+
reason: z14.string().trim().min(1).max(500),
|
|
1533
1609
|
actionId: identifier
|
|
1534
1610
|
}).strict();
|
|
1535
|
-
var questLifecycleSchema =
|
|
1611
|
+
var questLifecycleSchema = z14.object({
|
|
1536
1612
|
quest: identifier,
|
|
1537
1613
|
key: identifier.nullable(),
|
|
1538
|
-
title:
|
|
1614
|
+
title: z14.string(),
|
|
1539
1615
|
release: identifier,
|
|
1540
|
-
lifecycle:
|
|
1541
|
-
changed:
|
|
1616
|
+
lifecycle: z14.enum(["active", "paused", "archived"]),
|
|
1617
|
+
changed: z14.boolean()
|
|
1542
1618
|
});
|
|
1543
|
-
var memberSchema =
|
|
1544
|
-
id:
|
|
1545
|
-
test:
|
|
1546
|
-
name:
|
|
1547
|
-
accounts:
|
|
1548
|
-
attempts:
|
|
1549
|
-
completions:
|
|
1550
|
-
rewards:
|
|
1551
|
-
lastActivity:
|
|
1619
|
+
var memberSchema = z14.object({
|
|
1620
|
+
id: z14.string(),
|
|
1621
|
+
test: z14.boolean().optional(),
|
|
1622
|
+
name: z14.string().nullable().optional(),
|
|
1623
|
+
accounts: z14.array(memberAccountSchema).default([]),
|
|
1624
|
+
attempts: z14.number(),
|
|
1625
|
+
completions: z14.number(),
|
|
1626
|
+
rewards: z14.number(),
|
|
1627
|
+
lastActivity: z14.number().nullable()
|
|
1552
1628
|
});
|
|
1553
|
-
var personSchema =
|
|
1554
|
-
id:
|
|
1555
|
-
test:
|
|
1556
|
-
name:
|
|
1557
|
-
accounts:
|
|
1629
|
+
var personSchema = z14.object({
|
|
1630
|
+
id: z14.string(),
|
|
1631
|
+
test: z14.boolean().optional(),
|
|
1632
|
+
name: z14.string().nullable().optional(),
|
|
1633
|
+
accounts: z14.array(memberAccountSchema).default([])
|
|
1558
1634
|
});
|
|
1559
|
-
var metricsSchema =
|
|
1560
|
-
quests:
|
|
1561
|
-
members:
|
|
1562
|
-
attempts:
|
|
1563
|
-
completions:
|
|
1564
|
-
review:
|
|
1565
|
-
failed:
|
|
1566
|
-
entitlements:
|
|
1635
|
+
var metricsSchema = z14.object({
|
|
1636
|
+
quests: z14.number(),
|
|
1637
|
+
members: z14.number(),
|
|
1638
|
+
attempts: z14.number(),
|
|
1639
|
+
completions: z14.number(),
|
|
1640
|
+
review: z14.number(),
|
|
1641
|
+
failed: z14.number(),
|
|
1642
|
+
entitlements: z14.number()
|
|
1567
1643
|
});
|
|
1568
|
-
var readinessSchema =
|
|
1569
|
-
checks:
|
|
1570
|
-
|
|
1571
|
-
id:
|
|
1572
|
-
status:
|
|
1573
|
-
title:
|
|
1574
|
-
detail:
|
|
1644
|
+
var readinessSchema = z14.object({
|
|
1645
|
+
checks: z14.array(
|
|
1646
|
+
z14.object({
|
|
1647
|
+
id: z14.string(),
|
|
1648
|
+
status: z14.enum(["ready", "blocked"]),
|
|
1649
|
+
title: z14.string(),
|
|
1650
|
+
detail: z14.string()
|
|
1575
1651
|
})
|
|
1576
1652
|
)
|
|
1577
1653
|
});
|
|
1578
|
-
var inventorySchema =
|
|
1579
|
-
item:
|
|
1580
|
-
name:
|
|
1581
|
-
available:
|
|
1582
|
-
reserved:
|
|
1583
|
-
allocated:
|
|
1654
|
+
var inventorySchema = z14.object({
|
|
1655
|
+
item: z14.string(),
|
|
1656
|
+
name: z14.string().nullable().default(null),
|
|
1657
|
+
available: z14.number(),
|
|
1658
|
+
reserved: z14.number(),
|
|
1659
|
+
allocated: z14.number().default(0)
|
|
1584
1660
|
});
|
|
1585
|
-
var auditRecordSchema =
|
|
1586
|
-
id:
|
|
1587
|
-
action:
|
|
1588
|
-
actor:
|
|
1661
|
+
var auditRecordSchema = z14.object({
|
|
1662
|
+
id: z14.string(),
|
|
1663
|
+
action: z14.string(),
|
|
1664
|
+
actor: z14.string().nullable(),
|
|
1589
1665
|
user: operatorUserSchema.nullable().optional(),
|
|
1590
|
-
detail:
|
|
1591
|
-
at:
|
|
1592
|
-
attempt:
|
|
1593
|
-
}).refine((
|
|
1666
|
+
detail: z14.string(),
|
|
1667
|
+
at: z14.number(),
|
|
1668
|
+
attempt: z14.string().nullable()
|
|
1669
|
+
}).refine((record4) => !record4.user || record4.user.id === record4.actor, {
|
|
1594
1670
|
message: "User profile must match the recorded actor",
|
|
1595
1671
|
path: ["user"]
|
|
1596
1672
|
});
|
|
1597
|
-
var pageSchema =
|
|
1673
|
+
var pageSchema = z14.object({
|
|
1598
1674
|
snapshot: snapshotSchema,
|
|
1599
|
-
members:
|
|
1600
|
-
people:
|
|
1675
|
+
members: z14.array(memberSchema),
|
|
1676
|
+
people: z14.array(personSchema).default([]),
|
|
1601
1677
|
metrics: metricsSchema,
|
|
1602
|
-
total:
|
|
1603
|
-
offset:
|
|
1604
|
-
limit:
|
|
1605
|
-
inventory:
|
|
1606
|
-
operations:
|
|
1607
|
-
audit:
|
|
1608
|
-
questCounts:
|
|
1678
|
+
total: z14.number(),
|
|
1679
|
+
offset: z14.number(),
|
|
1680
|
+
limit: z14.number(),
|
|
1681
|
+
inventory: z14.array(inventorySchema),
|
|
1682
|
+
operations: z14.array(operationSchema).default([]),
|
|
1683
|
+
audit: z14.array(auditRecordSchema).default([]),
|
|
1684
|
+
questCounts: z14.record(z14.string(), z14.number())
|
|
1609
1685
|
});
|
|
1610
|
-
var managedOAuthAccountBaseSchema =
|
|
1611
|
-
provider:
|
|
1612
|
-
revision:
|
|
1686
|
+
var managedOAuthAccountBaseSchema = z14.object({
|
|
1687
|
+
provider: z14.enum(["x", "discord"]),
|
|
1688
|
+
revision: z14.number().int().nonnegative()
|
|
1613
1689
|
});
|
|
1614
|
-
var managedOAuthAccountSchema =
|
|
1690
|
+
var managedOAuthAccountSchema = z14.discriminatedUnion("status", [
|
|
1615
1691
|
managedOAuthAccountBaseSchema.extend({
|
|
1616
|
-
status:
|
|
1617
|
-
subject:
|
|
1618
|
-
linkedAt:
|
|
1692
|
+
status: z14.literal("connected"),
|
|
1693
|
+
subject: z14.string().min(1),
|
|
1694
|
+
linkedAt: z14.number()
|
|
1619
1695
|
}),
|
|
1620
|
-
managedOAuthAccountBaseSchema.extend({ status:
|
|
1696
|
+
managedOAuthAccountBaseSchema.extend({ status: z14.literal("disconnected") })
|
|
1621
1697
|
]);
|
|
1622
1698
|
var managedTelegramAccountBaseSchema = managedOAuthAccountBaseSchema.extend({
|
|
1623
|
-
provider:
|
|
1699
|
+
provider: z14.literal("telegram")
|
|
1624
1700
|
});
|
|
1625
|
-
var managedTelegramAccountSchema =
|
|
1701
|
+
var managedTelegramAccountSchema = z14.discriminatedUnion("status", [
|
|
1626
1702
|
managedTelegramAccountBaseSchema.extend({
|
|
1627
|
-
status:
|
|
1703
|
+
status: z14.literal("connected"),
|
|
1628
1704
|
/** The numeric Telegram user ID. */
|
|
1629
|
-
subject:
|
|
1630
|
-
linkedAt:
|
|
1705
|
+
subject: z14.string().min(1),
|
|
1706
|
+
linkedAt: z14.number()
|
|
1631
1707
|
}),
|
|
1632
1708
|
managedTelegramAccountBaseSchema.extend({
|
|
1633
|
-
status:
|
|
1709
|
+
status: z14.literal("disconnected")
|
|
1634
1710
|
})
|
|
1635
1711
|
]);
|
|
1636
|
-
var memberOAuthUnlinkInputSchema =
|
|
1637
|
-
provider:
|
|
1638
|
-
subject:
|
|
1639
|
-
revision:
|
|
1640
|
-
reason:
|
|
1712
|
+
var memberOAuthUnlinkInputSchema = z14.object({
|
|
1713
|
+
provider: z14.enum(["x", "discord"]),
|
|
1714
|
+
subject: z14.string().min(1).max(4096),
|
|
1715
|
+
revision: z14.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER - 1),
|
|
1716
|
+
reason: z14.string().trim().min(1).max(500)
|
|
1641
1717
|
}).strict();
|
|
1642
1718
|
var memberTelegramUnlinkInputSchema = memberOAuthUnlinkInputSchema.omit({ provider: true }).strict();
|
|
1643
1719
|
var managedWalletSchema = linkedWalletSchema.extend({
|
|
1644
|
-
status:
|
|
1645
|
-
unlinkedAt:
|
|
1720
|
+
status: z14.enum(["linked", "unlinked"]),
|
|
1721
|
+
unlinkedAt: z14.number().int().nullable(),
|
|
1646
1722
|
/** "member", or the operator or key that unlinked it. */
|
|
1647
|
-
unlinkedBy:
|
|
1723
|
+
unlinkedBy: z14.string().nullable()
|
|
1648
1724
|
});
|
|
1649
1725
|
var managedMemberIdentitySchema = memberIdentitySchema.extend({
|
|
1650
|
-
status:
|
|
1651
|
-
unlinkedAt:
|
|
1726
|
+
status: z14.enum(["linked", "unlinked"]),
|
|
1727
|
+
unlinkedAt: z14.number().int().nullable(),
|
|
1652
1728
|
/** The operator or key that unlinked it. */
|
|
1653
|
-
unlinkedBy:
|
|
1729
|
+
unlinkedBy: z14.string().nullable()
|
|
1654
1730
|
});
|
|
1655
|
-
var memberIdentityChangeInputSchema =
|
|
1731
|
+
var memberIdentityChangeInputSchema = z14.object({
|
|
1656
1732
|
kind: appIdentityKindSchema,
|
|
1657
|
-
subject:
|
|
1658
|
-
reason:
|
|
1733
|
+
subject: z14.string().min(1).max(256),
|
|
1734
|
+
reason: z14.string().trim().min(1).max(500)
|
|
1659
1735
|
}).strict();
|
|
1660
1736
|
var balanceCheckSchema = walletBalanceSchema.pick({
|
|
1661
1737
|
chain: true,
|
|
@@ -1665,76 +1741,76 @@ var balanceCheckSchema = walletBalanceSchema.pick({
|
|
|
1665
1741
|
wallets: true,
|
|
1666
1742
|
observedAt: true
|
|
1667
1743
|
}).extend({ attempt: identifier });
|
|
1668
|
-
var walletBalanceChainsSchema =
|
|
1669
|
-
chains:
|
|
1670
|
-
|
|
1671
|
-
chain:
|
|
1672
|
-
|
|
1744
|
+
var walletBalanceChainsSchema = z14.object({
|
|
1745
|
+
chains: z14.array(
|
|
1746
|
+
z14.object({
|
|
1747
|
+
chain: z14.union([
|
|
1748
|
+
z14.literal(solanaMainnet),
|
|
1673
1749
|
cosmosNetworkSchema,
|
|
1674
1750
|
evmChainIdSchema
|
|
1675
1751
|
]),
|
|
1676
|
-
name:
|
|
1677
|
-
testnet:
|
|
1752
|
+
name: z14.string(),
|
|
1753
|
+
testnet: z14.boolean()
|
|
1678
1754
|
})
|
|
1679
1755
|
)
|
|
1680
1756
|
});
|
|
1681
|
-
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason:
|
|
1757
|
+
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason: z14.string().trim().min(1).max(500) }).strict();
|
|
1682
1758
|
var memberWalletSignInInputSchema = walletUnlinkInputSchema.extend({
|
|
1683
|
-
enabled:
|
|
1684
|
-
reason:
|
|
1759
|
+
enabled: z14.boolean(),
|
|
1760
|
+
reason: z14.string().trim().min(1).max(500)
|
|
1685
1761
|
}).strict();
|
|
1686
|
-
var telegramBotIdSchema =
|
|
1687
|
-
var participantSignInSchema =
|
|
1688
|
-
providers:
|
|
1689
|
-
|
|
1762
|
+
var telegramBotIdSchema = z14.string().regex(/^[1-9][0-9]{0,19}$/, "Enter the bot's numeric ID, such as 123456789");
|
|
1763
|
+
var participantSignInSchema = z14.object({
|
|
1764
|
+
providers: z14.array(
|
|
1765
|
+
z14.object({ provider: authProviderSchema, configured: z14.boolean() })
|
|
1690
1766
|
),
|
|
1691
|
-
email:
|
|
1767
|
+
email: z14.boolean(),
|
|
1692
1768
|
/** Wallet families: `"solana"`, `"eip155"`, `"cosmos"`. */
|
|
1693
1769
|
wallets: walletSignInNetworksSchema,
|
|
1694
1770
|
/** Why participants cannot sign in to this project, or null. */
|
|
1695
|
-
issue:
|
|
1771
|
+
issue: z14.string().nullable(),
|
|
1696
1772
|
/**
|
|
1697
1773
|
* Telegram, outside `providers` in SDK 1.x: whether Domino configured Telegram Login, and the
|
|
1698
1774
|
* bot whose Mini App participants sign in from, or null when Mini App sign-in is off. Absent
|
|
1699
1775
|
* from Relay versions without Telegram.
|
|
1700
1776
|
*/
|
|
1701
|
-
telegram:
|
|
1702
|
-
login:
|
|
1777
|
+
telegram: z14.object({
|
|
1778
|
+
login: z14.boolean(),
|
|
1703
1779
|
miniAppBotId: telegramBotIdSchema.nullable()
|
|
1704
1780
|
}).optional(),
|
|
1705
|
-
updatedAt:
|
|
1706
|
-
updatedBy:
|
|
1781
|
+
updatedAt: z14.number().nullable(),
|
|
1782
|
+
updatedBy: z14.string().nullable()
|
|
1707
1783
|
});
|
|
1708
|
-
var participantSignInInputSchema =
|
|
1784
|
+
var participantSignInInputSchema = z14.object({
|
|
1709
1785
|
wallets: walletSignInNetworksSchema,
|
|
1710
|
-
telegram:
|
|
1786
|
+
telegram: z14.object({ miniAppBotId: telegramBotIdSchema.nullable() }).strict().optional()
|
|
1711
1787
|
}).strict();
|
|
1712
|
-
var completionRevocationShortfallSchema =
|
|
1788
|
+
var completionRevocationShortfallSchema = z14.object({
|
|
1713
1789
|
completion: identifier,
|
|
1714
1790
|
quest: identifier,
|
|
1715
|
-
revokedAt:
|
|
1716
|
-
unreversedPoints:
|
|
1791
|
+
revokedAt: z14.number().int().nonnegative().safe(),
|
|
1792
|
+
unreversedPoints: z14.record(identifier, z14.number().int().positive().safe())
|
|
1717
1793
|
});
|
|
1718
|
-
var memberDetailSchema =
|
|
1794
|
+
var memberDetailSchema = z14.object({
|
|
1719
1795
|
snapshot: snapshotSchema,
|
|
1720
1796
|
member: memberSchema,
|
|
1721
1797
|
progress: memberProgressSchema,
|
|
1722
1798
|
/** Up to 25 revoked completions with an unreversed point remainder, newest first. */
|
|
1723
|
-
revocationShortfalls:
|
|
1799
|
+
revocationShortfalls: z14.array(completionRevocationShortfallSchema).default([]),
|
|
1724
1800
|
/** Current and historical campaign enrollment state, including inactive enrollments. */
|
|
1725
|
-
campaignEnrollments:
|
|
1726
|
-
passes:
|
|
1727
|
-
|
|
1728
|
-
provider:
|
|
1729
|
-
event:
|
|
1730
|
-
subject:
|
|
1801
|
+
campaignEnrollments: z14.array(campaignEnrollmentSchema).default([]),
|
|
1802
|
+
passes: z14.array(
|
|
1803
|
+
z14.object({
|
|
1804
|
+
provider: z14.string(),
|
|
1805
|
+
event: z14.string(),
|
|
1806
|
+
subject: z14.string(),
|
|
1731
1807
|
attempt: identifier.nullable()
|
|
1732
1808
|
})
|
|
1733
1809
|
).default([]),
|
|
1734
1810
|
/** Linked and unlinked wallets. */
|
|
1735
|
-
wallets:
|
|
1811
|
+
wallets: z14.array(managedWalletSchema),
|
|
1736
1812
|
/** The member's 10 most recent recorded balance reads, newest first. */
|
|
1737
|
-
balanceChecks:
|
|
1813
|
+
balanceChecks: z14.array(balanceCheckSchema),
|
|
1738
1814
|
/** The member's participant profile in this project. */
|
|
1739
1815
|
profile: managedProfileSchema.nullable(),
|
|
1740
1816
|
/**
|
|
@@ -1742,126 +1818,139 @@ var memberDetailSchema = z13.object({
|
|
|
1742
1818
|
* member ID: their selected X and Discord accounts and their `app:<name>` identities in this
|
|
1743
1819
|
* project, including app identities an operator unlinked, by kind.
|
|
1744
1820
|
*/
|
|
1745
|
-
identities:
|
|
1821
|
+
identities: z14.array(managedMemberIdentitySchema)
|
|
1746
1822
|
});
|
|
1747
|
-
var
|
|
1823
|
+
var managedMemberProgressSchema = z14.object({
|
|
1824
|
+
member: identifier,
|
|
1825
|
+
quests: z14.array(
|
|
1826
|
+
memberProgressSchema.shape.quests.element.extend({
|
|
1827
|
+
/** The streak as `members.get` reports it, without the list of qualifying days. */
|
|
1828
|
+
streak: streakProgressSchema.omit({ days: true }).nullable().optional()
|
|
1829
|
+
})
|
|
1830
|
+
),
|
|
1831
|
+
/** The member's 25 most recent attempts, newest first. */
|
|
1832
|
+
attempts: snapshotSchema.shape.attempts,
|
|
1833
|
+
/** Each point balance the member has, by balance ID. */
|
|
1834
|
+
balances: snapshotSchema.shape.balances
|
|
1835
|
+
});
|
|
1836
|
+
var stockInputSchema = z14.object({
|
|
1748
1837
|
item: identifier,
|
|
1749
|
-
quantity:
|
|
1838
|
+
quantity: z14.number().int().positive().max(1e6),
|
|
1750
1839
|
actionId: identifier
|
|
1751
1840
|
}).strict();
|
|
1752
|
-
var ingestTrackerScopeSchema =
|
|
1753
|
-
var tokenScopeInputSchema =
|
|
1754
|
-
var tokenInputSchema =
|
|
1755
|
-
name:
|
|
1841
|
+
var ingestTrackerScopeSchema = z14.array(identifier).min(1).max(100).nullable();
|
|
1842
|
+
var tokenScopeInputSchema = z14.object({ ingestTrackers: ingestTrackerScopeSchema }).strict();
|
|
1843
|
+
var tokenInputSchema = z14.object({
|
|
1844
|
+
name: z14.string().trim().min(1).max(80),
|
|
1756
1845
|
project: identifier,
|
|
1757
1846
|
environment: environmentSchema,
|
|
1758
|
-
permissions:
|
|
1847
|
+
permissions: z14.array(permissionSchema).min(1),
|
|
1759
1848
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
1760
|
-
days:
|
|
1849
|
+
days: z14.number().int().min(1).max(90).default(30)
|
|
1761
1850
|
}).strict();
|
|
1762
|
-
var tokenSchema =
|
|
1763
|
-
id:
|
|
1764
|
-
name:
|
|
1765
|
-
project:
|
|
1851
|
+
var tokenSchema = z14.object({
|
|
1852
|
+
id: z14.string(),
|
|
1853
|
+
name: z14.string(),
|
|
1854
|
+
project: z14.string(),
|
|
1766
1855
|
environment: environmentSchema,
|
|
1767
1856
|
permissions: permissionListSchema,
|
|
1768
1857
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
1769
|
-
expiresAt:
|
|
1858
|
+
expiresAt: z14.number()
|
|
1770
1859
|
});
|
|
1771
|
-
var issuedTokenSchema = tokenSchema.extend({ token:
|
|
1772
|
-
var teamSchema =
|
|
1773
|
-
|
|
1860
|
+
var issuedTokenSchema = tokenSchema.extend({ token: z14.string() });
|
|
1861
|
+
var teamSchema = z14.array(
|
|
1862
|
+
z14.object({ id: z14.string(), label: z14.string() })
|
|
1774
1863
|
);
|
|
1775
|
-
var memberLookupSchema =
|
|
1776
|
-
provider:
|
|
1777
|
-
subject:
|
|
1864
|
+
var memberLookupSchema = z14.object({
|
|
1865
|
+
provider: z14.string().min(1).max(200),
|
|
1866
|
+
subject: z14.string().min(1).max(2048)
|
|
1778
1867
|
}).strict();
|
|
1779
|
-
var booleanQuery =
|
|
1780
|
-
|
|
1781
|
-
|
|
1868
|
+
var booleanQuery = z14.union([
|
|
1869
|
+
z14.boolean(),
|
|
1870
|
+
z14.enum(["true", "false"]).transform((v) => v === "true")
|
|
1782
1871
|
]);
|
|
1783
|
-
var managedMemberQuerySchema =
|
|
1784
|
-
q:
|
|
1872
|
+
var managedMemberQuerySchema = z14.strictObject({
|
|
1873
|
+
q: z14.string().max(200).optional(),
|
|
1785
1874
|
needsReview: booleanQuery.optional(),
|
|
1786
|
-
limit:
|
|
1875
|
+
limit: z14.coerce.number().int().min(1).max(100).optional(),
|
|
1787
1876
|
cursor: pageCursorSchema.optional()
|
|
1788
1877
|
});
|
|
1789
|
-
var managedMemberPageSchema =
|
|
1790
|
-
items:
|
|
1791
|
-
total:
|
|
1792
|
-
nextCursor:
|
|
1878
|
+
var managedMemberPageSchema = z14.object({
|
|
1879
|
+
items: z14.array(memberSchema),
|
|
1880
|
+
total: z14.number().int().nonnegative(),
|
|
1881
|
+
nextCursor: z14.string().nullable()
|
|
1793
1882
|
});
|
|
1794
1883
|
var projectMetricsSchema = metricsSchema.extend({
|
|
1795
|
-
completionsByQuest:
|
|
1796
|
-
|
|
1884
|
+
completionsByQuest: z14.array(
|
|
1885
|
+
z14.object({ quest: identifier, completions: z14.number() })
|
|
1797
1886
|
)
|
|
1798
1887
|
});
|
|
1799
|
-
var pageLimit =
|
|
1800
|
-
var managedAttemptQuerySchema =
|
|
1801
|
-
q:
|
|
1802
|
-
status:
|
|
1888
|
+
var pageLimit = z14.coerce.number().int().min(1).max(100).optional();
|
|
1889
|
+
var managedAttemptQuerySchema = z14.strictObject({
|
|
1890
|
+
q: z14.string().max(200).optional(),
|
|
1891
|
+
status: z14.string().min(1).max(50).optional(),
|
|
1803
1892
|
limit: pageLimit,
|
|
1804
1893
|
cursor: pageCursorSchema.optional()
|
|
1805
1894
|
});
|
|
1806
|
-
var managedAttemptPageSchema =
|
|
1807
|
-
items:
|
|
1808
|
-
releases:
|
|
1809
|
-
people:
|
|
1810
|
-
total:
|
|
1811
|
-
nextCursor:
|
|
1895
|
+
var managedAttemptPageSchema = z14.object({
|
|
1896
|
+
items: z14.array(attemptSchema),
|
|
1897
|
+
releases: z14.array(publishedReleaseSchema),
|
|
1898
|
+
people: z14.array(personSchema),
|
|
1899
|
+
total: z14.number().int().nonnegative(),
|
|
1900
|
+
nextCursor: z14.string().nullable()
|
|
1812
1901
|
});
|
|
1813
|
-
var managedReleaseQuerySchema =
|
|
1902
|
+
var managedReleaseQuerySchema = z14.strictObject({
|
|
1814
1903
|
quest: identifier.optional(),
|
|
1815
1904
|
limit: pageLimit,
|
|
1816
1905
|
cursor: pageCursorSchema.optional()
|
|
1817
1906
|
});
|
|
1818
|
-
var managedReleasePageSchema =
|
|
1819
|
-
items:
|
|
1820
|
-
nextCursor:
|
|
1907
|
+
var managedReleasePageSchema = z14.object({
|
|
1908
|
+
items: z14.array(publishedReleaseSchema),
|
|
1909
|
+
nextCursor: z14.string().nullable()
|
|
1821
1910
|
});
|
|
1822
|
-
var managedAttemptSchema =
|
|
1911
|
+
var managedAttemptSchema = z14.object({
|
|
1823
1912
|
attempt: attemptSchema,
|
|
1824
1913
|
release: publishedReleaseSchema.nullable(),
|
|
1825
|
-
events:
|
|
1914
|
+
events: z14.array(eventSchema),
|
|
1826
1915
|
person: personSchema
|
|
1827
1916
|
});
|
|
1828
|
-
var managedEntitlementQuerySchema =
|
|
1829
|
-
q:
|
|
1830
|
-
status:
|
|
1917
|
+
var managedEntitlementQuerySchema = z14.strictObject({
|
|
1918
|
+
q: z14.string().max(200).optional(),
|
|
1919
|
+
status: z14.string().min(1).max(50).optional(),
|
|
1831
1920
|
limit: pageLimit,
|
|
1832
1921
|
cursor: pageCursorSchema.optional()
|
|
1833
1922
|
});
|
|
1834
|
-
var managedEntitlementPageSchema =
|
|
1835
|
-
items:
|
|
1836
|
-
people:
|
|
1837
|
-
total:
|
|
1838
|
-
nextCursor:
|
|
1923
|
+
var managedEntitlementPageSchema = z14.object({
|
|
1924
|
+
items: z14.array(entitlementSchema),
|
|
1925
|
+
people: z14.array(personSchema),
|
|
1926
|
+
total: z14.number().int().nonnegative(),
|
|
1927
|
+
nextCursor: z14.string().nullable()
|
|
1839
1928
|
});
|
|
1840
|
-
var managedEntitlementSchema =
|
|
1929
|
+
var managedEntitlementSchema = z14.object({
|
|
1841
1930
|
entitlement: entitlementSchema,
|
|
1842
1931
|
person: personSchema
|
|
1843
1932
|
});
|
|
1844
1933
|
var managedStockItemSchema = inventorySchema.extend({
|
|
1845
|
-
offers:
|
|
1934
|
+
offers: z14.array(identifier)
|
|
1846
1935
|
});
|
|
1847
|
-
var auditQuerySchema =
|
|
1848
|
-
category:
|
|
1849
|
-
q:
|
|
1936
|
+
var auditQuerySchema = z14.strictObject({
|
|
1937
|
+
category: z14.enum(["reviews", "rewards", "configuration"]).optional(),
|
|
1938
|
+
q: z14.string().max(200).optional(),
|
|
1850
1939
|
limit: pageLimit,
|
|
1851
1940
|
cursor: pageCursorSchema.optional()
|
|
1852
1941
|
});
|
|
1853
1942
|
var accessHistoryQuerySchema = auditQuerySchema.omit({
|
|
1854
1943
|
category: true
|
|
1855
1944
|
});
|
|
1856
|
-
var auditPageSchema =
|
|
1857
|
-
items:
|
|
1858
|
-
total:
|
|
1859
|
-
nextCursor:
|
|
1945
|
+
var auditPageSchema = z14.object({
|
|
1946
|
+
items: z14.array(auditRecordSchema),
|
|
1947
|
+
total: z14.number().int().nonnegative(),
|
|
1948
|
+
nextCursor: z14.string().nullable()
|
|
1860
1949
|
});
|
|
1861
|
-
var verifiedPassSchema =
|
|
1950
|
+
var verifiedPassSchema = z14.object({
|
|
1862
1951
|
provider: identifier,
|
|
1863
1952
|
event: identifier,
|
|
1864
|
-
subject:
|
|
1953
|
+
subject: z14.string().min(1).max(2048),
|
|
1865
1954
|
member: identifier,
|
|
1866
1955
|
quest: identifier
|
|
1867
1956
|
}).strict();
|
|
@@ -1885,7 +1974,7 @@ function clientFailure(error) {
|
|
|
1885
1974
|
return new ManagementError({
|
|
1886
1975
|
kind: "client",
|
|
1887
1976
|
code: ManagementErrorCode.InvalidInput,
|
|
1888
|
-
message: error instanceof
|
|
1977
|
+
message: error instanceof z14.ZodError ? `Invalid management request: ${z14.prettifyError(error)}` : error instanceof Error ? error.message : "Invalid management request",
|
|
1889
1978
|
cause: error
|
|
1890
1979
|
});
|
|
1891
1980
|
}
|
|
@@ -1923,7 +2012,7 @@ function managementClient(options) {
|
|
|
1923
2012
|
call
|
|
1924
2013
|
);
|
|
1925
2014
|
}
|
|
1926
|
-
const ok =
|
|
2015
|
+
const ok = z14.object({ ok: z14.literal(true) });
|
|
1927
2016
|
function pointHistory(member, ledger, query = {}, call) {
|
|
1928
2017
|
return get(
|
|
1929
2018
|
`/points/${identifier.parse(member)}/${identifier.parse(ledger)}/history${queryString(typeof query === "number" ? { before: query } : pageQuerySchema.parse(query))}`,
|
|
@@ -2008,7 +2097,7 @@ function managementClient(options) {
|
|
|
2008
2097
|
const input = isInput ? inputOrCall ?? {} : {};
|
|
2009
2098
|
const options2 = isInput ? call : inputOrCall;
|
|
2010
2099
|
return post(
|
|
2011
|
-
`/webhooks/${
|
|
2100
|
+
`/webhooks/${z14.string().uuid().parse(id)}/rotate-secret`,
|
|
2012
2101
|
webhookSecretSchema,
|
|
2013
2102
|
webhookRotateInputSchema.parse(withActionId(input)),
|
|
2014
2103
|
options2
|
|
@@ -2056,8 +2145,8 @@ function managementClient(options) {
|
|
|
2056
2145
|
}
|
|
2057
2146
|
return exchange(
|
|
2058
2147
|
path,
|
|
2059
|
-
|
|
2060
|
-
status:
|
|
2148
|
+
z14.object({
|
|
2149
|
+
status: z14.number(),
|
|
2061
2150
|
operationId: identifier.optional(),
|
|
2062
2151
|
result: schema
|
|
2063
2152
|
}),
|
|
@@ -2088,7 +2177,7 @@ function managementClient(options) {
|
|
|
2088
2177
|
call
|
|
2089
2178
|
),
|
|
2090
2179
|
...resourceArchiveMethods("tracker"),
|
|
2091
|
-
list: (call) => get("/trackers",
|
|
2180
|
+
list: (call) => get("/trackers", z14.array(trackerStatusSchema), call),
|
|
2092
2181
|
get: (reference, call) => get(
|
|
2093
2182
|
`/trackers/${identifier.parse(reference)}`,
|
|
2094
2183
|
trackerStatusSchema,
|
|
@@ -2204,7 +2293,7 @@ function managementClient(options) {
|
|
|
2204
2293
|
engagementPublishSchema.parse(withActionId(input)),
|
|
2205
2294
|
call
|
|
2206
2295
|
),
|
|
2207
|
-
list: (call) => get("/engagement",
|
|
2296
|
+
list: (call) => get("/engagement", z14.array(engagementRuleSchema), call),
|
|
2208
2297
|
page: (input, call) => get(
|
|
2209
2298
|
"/engagement/history" + queryString(engagementPageQuerySchema.parse(input)),
|
|
2210
2299
|
engagementPageSchema,
|
|
@@ -2224,7 +2313,7 @@ function managementClient(options) {
|
|
|
2224
2313
|
)
|
|
2225
2314
|
},
|
|
2226
2315
|
badges: {
|
|
2227
|
-
list: (call) => get("/badges",
|
|
2316
|
+
list: (call) => get("/badges", z14.array(managedBadgeSchema), call),
|
|
2228
2317
|
create: (input, call) => create("/badges", managedBadgeSchema, createBadgeSchema, input, call),
|
|
2229
2318
|
update: (badge, input, call) => {
|
|
2230
2319
|
const body = badgePropertiesSchema.extend(badgeMutationSchema.shape).parse(withActionId(input));
|
|
@@ -2267,7 +2356,7 @@ function managementClient(options) {
|
|
|
2267
2356
|
},
|
|
2268
2357
|
pointLedgers: {
|
|
2269
2358
|
unarchive: (ledger, input, call) => archiveResource("point-ledger", ledger, false, input, call),
|
|
2270
|
-
list: (call) => get("/point-ledgers",
|
|
2359
|
+
list: (call) => get("/point-ledgers", z14.array(managedPointLedgerSchema), call),
|
|
2271
2360
|
/**
|
|
2272
2361
|
* Creates a point ledger, with a stable `key` when code refers to it; requires `publish`. In
|
|
2273
2362
|
* live, only a person in Console can create one.
|
|
@@ -2297,7 +2386,7 @@ function managementClient(options) {
|
|
|
2297
2386
|
},
|
|
2298
2387
|
points: {
|
|
2299
2388
|
/** @deprecated Use `pointLedgers.list()`, which reads the same ledgers. Removed in 2.0.0. */
|
|
2300
|
-
ledgers: (call) => get("/point-ledgers",
|
|
2389
|
+
ledgers: (call) => get("/point-ledgers", z14.array(managedPointLedgerSchema), call),
|
|
2301
2390
|
/** @deprecated Use `pointLedgers.create(input)`. Removed in 2.0.0. */
|
|
2302
2391
|
createLedger: createPointLedger,
|
|
2303
2392
|
/**
|
|
@@ -2335,7 +2424,7 @@ function managementClient(options) {
|
|
|
2335
2424
|
referralHistorySchema,
|
|
2336
2425
|
call
|
|
2337
2426
|
),
|
|
2338
|
-
list: (call) => get("/referrals",
|
|
2427
|
+
list: (call) => get("/referrals", z14.array(publishedReferralSchema), call),
|
|
2339
2428
|
participants: referralParticipants,
|
|
2340
2429
|
/**
|
|
2341
2430
|
* Suspends or restores a member's referral relationship, with a reason; requires `publish`.
|
|
@@ -2398,7 +2487,7 @@ function managementClient(options) {
|
|
|
2398
2487
|
},
|
|
2399
2488
|
leaderboards: {
|
|
2400
2489
|
...resourceArchiveMethods("leaderboard"),
|
|
2401
|
-
list: (call) => get("/leaderboards",
|
|
2490
|
+
list: (call) => get("/leaderboards", z14.array(publishedLeaderboardSchema), call),
|
|
2402
2491
|
standings: (board, input = {}, call) => {
|
|
2403
2492
|
const query = leaderboardQuerySchema.parse(input);
|
|
2404
2493
|
return get(
|
|
@@ -2412,20 +2501,45 @@ function managementClient(options) {
|
|
|
2412
2501
|
},
|
|
2413
2502
|
history: (board, call) => get(
|
|
2414
2503
|
`/leaderboards/${identifier.parse(board)}/history`,
|
|
2415
|
-
|
|
2504
|
+
z14.array(publishedLeaderboardSchema),
|
|
2416
2505
|
call
|
|
2417
2506
|
),
|
|
2507
|
+
/** Current members of the board's exclusion group (`exclusionGroup`), by member ID. */
|
|
2418
2508
|
exclusions: (board, call) => get(
|
|
2419
2509
|
`/leaderboards/${identifier.parse(board)}/exclusions`,
|
|
2420
|
-
|
|
2510
|
+
z14.array(z14.object({ member: identifier })),
|
|
2421
2511
|
call
|
|
2422
2512
|
),
|
|
2513
|
+
/**
|
|
2514
|
+
* Adds a member to, or removes one from, the board's exclusion group, creating the board's
|
|
2515
|
+
* generated group on its first exclusion. A board bound to a shared group changes that
|
|
2516
|
+
* group, so every board it moderates.
|
|
2517
|
+
*/
|
|
2423
2518
|
exclude: (board, input, call) => post(
|
|
2424
2519
|
`/leaderboards/${identifier.parse(board)}/exclusions`,
|
|
2425
2520
|
ok,
|
|
2426
2521
|
leaderboardExclusionSchema.parse(withActionId(input)),
|
|
2427
2522
|
call
|
|
2428
2523
|
),
|
|
2524
|
+
/**
|
|
2525
|
+
* The group whose members the board leaves out. Change its members with `groups.addMember`
|
|
2526
|
+
* and `groups.removeMember`, or with `exclude`.
|
|
2527
|
+
*/
|
|
2528
|
+
exclusionGroup: (board, call) => get(
|
|
2529
|
+
`/leaderboards/${identifier.parse(board)}/exclusion-group`,
|
|
2530
|
+
leaderboardExclusionGroupSchema,
|
|
2531
|
+
call
|
|
2532
|
+
),
|
|
2533
|
+
/**
|
|
2534
|
+
* Binds the board to another exclusion group, such as one shared by several boards, or back
|
|
2535
|
+
* to its generated group. Settlements read the group bound at their cutoff.
|
|
2536
|
+
*/
|
|
2537
|
+
bindExclusionGroup: (board, input, call) => post(
|
|
2538
|
+
`/leaderboards/${identifier.parse(board)}/exclusion-group`,
|
|
2539
|
+
leaderboardExclusionGroupSchema,
|
|
2540
|
+
leaderboardExclusionGroupBindingSchema.parse(withActionId(input)),
|
|
2541
|
+
call
|
|
2542
|
+
),
|
|
2429
2543
|
/**
|
|
2430
2544
|
* Adds a member to a group, creating the group (titled with its key) when it is new, or
|
|
2431
2545
|
* removes one.
|
|
@@ -2458,7 +2572,7 @@ function managementClient(options) {
|
|
|
2458
2572
|
),
|
|
2459
2573
|
settlements: (board, call) => get(
|
|
2460
2574
|
`/leaderboards/${identifier.parse(board)}/settlements`,
|
|
2461
|
-
|
|
2575
|
+
z14.array(leaderboardSettlementSummarySchema),
|
|
2462
2576
|
call
|
|
2463
2577
|
),
|
|
2464
2578
|
settlement: (settlement, call) => get(
|
|
@@ -2538,7 +2652,7 @@ function managementClient(options) {
|
|
|
2538
2652
|
)
|
|
2539
2653
|
},
|
|
2540
2654
|
deployments: {
|
|
2541
|
-
list: (call) => get("/deployments",
|
|
2655
|
+
list: (call) => get("/deployments", z14.array(deploymentRecordSchema), call),
|
|
2542
2656
|
get: (deployment, call) => get(
|
|
2543
2657
|
`/deployments/${identifier.parse(deployment)}`,
|
|
2544
2658
|
deploymentRecordSchema,
|
|
@@ -2807,7 +2921,7 @@ function managementClient(options) {
|
|
|
2807
2921
|
},
|
|
2808
2922
|
operations: {
|
|
2809
2923
|
/** Every paused or resumed operation: redemptions and each quest's participation; requires `read`. */
|
|
2810
|
-
list: (call) => get("/operations",
|
|
2924
|
+
list: (call) => get("/operations", z14.array(operationSchema), call),
|
|
2811
2925
|
/**
|
|
2812
2926
|
* Pauses or resumes redemptions or one quest's participation, against the `revision` the
|
|
2813
2927
|
* operator saw, with a reason; requires `publish` permission.
|
|
@@ -2856,7 +2970,7 @@ function managementClient(options) {
|
|
|
2856
2970
|
call
|
|
2857
2971
|
),
|
|
2858
2972
|
/** Every stock item with its counts and the offers that sell it; requires `read` permission. */
|
|
2859
|
-
list: (call) => get("/stock-items",
|
|
2973
|
+
list: (call) => get("/stock-items", z14.array(managedStockItemSchema), call),
|
|
2860
2974
|
createItem: (input, call) => create(
|
|
2861
2975
|
"/stock-items",
|
|
2862
2976
|
stockItemSchema,
|
|
@@ -2871,7 +2985,7 @@ function managementClient(options) {
|
|
|
2871
2985
|
stockInputSchema.parse(withActionId(input)),
|
|
2872
2986
|
call
|
|
2873
2987
|
),
|
|
2874
|
-
catalog: (call) => get("/pickup-inventory",
|
|
2988
|
+
catalog: (call) => get("/pickup-inventory", z14.array(pickupCatalogSchema), call),
|
|
2875
2989
|
configure: (input, call) => post(
|
|
2876
2990
|
"/pickup-inventory",
|
|
2877
2991
|
pickupCatalogSchema,
|
|
@@ -2897,10 +3011,10 @@ function managementClient(options) {
|
|
|
2897
3011
|
offerControlSchema.omit({ enabled: true }).parse(withActionId(input)),
|
|
2898
3012
|
call
|
|
2899
3013
|
),
|
|
2900
|
-
list: (call) => get("/offers",
|
|
3014
|
+
list: (call) => get("/offers", z14.array(offerSchema), call),
|
|
2901
3015
|
redemptions: (input = {}, call) => get(
|
|
2902
3016
|
`/redemptions${queryString({ member: input.member })}`,
|
|
2903
|
-
|
|
3017
|
+
z14.array(redemptionSchema),
|
|
2904
3018
|
call
|
|
2905
3019
|
),
|
|
2906
3020
|
/** Pauses or resumes an offer at the revision the operator saw. */
|
|
@@ -2949,7 +3063,7 @@ function managementClient(options) {
|
|
|
2949
3063
|
* them; API keys and project-scoped playground sessions cannot.
|
|
2950
3064
|
*/
|
|
2951
3065
|
tokens: {
|
|
2952
|
-
list: (call) => get("/tokens",
|
|
3066
|
+
list: (call) => get("/tokens", z14.array(tokenSchema), call),
|
|
2953
3067
|
/**
|
|
2954
3068
|
* Issues a key for one project and environment, limited to permissions the caller holds
|
|
2955
3069
|
* there. The secret `token` is in this response only.
|
|
@@ -2957,14 +3071,14 @@ function managementClient(options) {
|
|
|
2957
3071
|
create: (input, call) => post("/tokens", issuedTokenSchema, tokenInputSchema.parse(input), call),
|
|
2958
3072
|
/** Replace a personal key's ingestion restriction without changing its secret. */
|
|
2959
3073
|
scope: (id, input, call) => request(
|
|
2960
|
-
`/tokens/${encodeURIComponent(
|
|
3074
|
+
`/tokens/${encodeURIComponent(z14.string().min(1).parse(id))}/scope`,
|
|
2961
3075
|
tokenSchema,
|
|
2962
3076
|
tokenScopeInputSchema.parse(input),
|
|
2963
3077
|
"PUT",
|
|
2964
3078
|
call
|
|
2965
3079
|
),
|
|
2966
3080
|
revoke: (id, call) => request(
|
|
2967
|
-
`/tokens/${encodeURIComponent(
|
|
3081
|
+
`/tokens/${encodeURIComponent(z14.string().min(1).parse(id))}`,
|
|
2968
3082
|
ok,
|
|
2969
3083
|
void 0,
|
|
2970
3084
|
"DELETE",
|
|
@@ -2973,7 +3087,7 @@ function managementClient(options) {
|
|
|
2973
3087
|
},
|
|
2974
3088
|
/** Who holds which roles on the client's project; organization administrators only. */
|
|
2975
3089
|
grants: {
|
|
2976
|
-
list: (call) => get("/grants",
|
|
3090
|
+
list: (call) => get("/grants", z14.array(grantRecordSchema), call),
|
|
2977
3091
|
/** Replaces one person's roles and environments on the project. The audit log records it. */
|
|
2978
3092
|
set: (input, call) => request(
|
|
2979
3093
|
"/grants",
|
|
@@ -2990,7 +3104,7 @@ function managementClient(options) {
|
|
|
2990
3104
|
/** Signed activity notifications for one project/environment; writes require publish permission. */
|
|
2991
3105
|
webhooks: {
|
|
2992
3106
|
state: (id, call) => get(
|
|
2993
|
-
`/webhooks/${
|
|
3107
|
+
`/webhooks/${z14.string().uuid().parse(id)}/state`,
|
|
2994
3108
|
webhookEndpointStateSchema,
|
|
2995
3109
|
call
|
|
2996
3110
|
),
|
|
@@ -3001,24 +3115,24 @@ function managementClient(options) {
|
|
|
3001
3115
|
call
|
|
3002
3116
|
),
|
|
3003
3117
|
delete: (id, input, call) => post(
|
|
3004
|
-
`/webhooks/${
|
|
3118
|
+
`/webhooks/${z14.string().uuid().parse(id)}/delete`,
|
|
3005
3119
|
webhookEndpointStateSchema,
|
|
3006
3120
|
webhookDeleteInputSchema.parse(withActionId(input)),
|
|
3007
3121
|
call
|
|
3008
3122
|
),
|
|
3009
3123
|
pause: (id, input = {}, call) => post(
|
|
3010
|
-
`/webhooks/${
|
|
3124
|
+
`/webhooks/${z14.string().uuid().parse(id)}/pause`,
|
|
3011
3125
|
webhookEndpointSchema,
|
|
3012
3126
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
3013
3127
|
call
|
|
3014
3128
|
),
|
|
3015
3129
|
resume: (id, input = {}, call) => post(
|
|
3016
|
-
`/webhooks/${
|
|
3130
|
+
`/webhooks/${z14.string().uuid().parse(id)}/resume`,
|
|
3017
3131
|
webhookEndpointSchema,
|
|
3018
3132
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
3019
3133
|
call
|
|
3020
3134
|
),
|
|
3021
|
-
list: (call) => get("/webhooks",
|
|
3135
|
+
list: (call) => get("/webhooks", z14.array(webhookEndpointSchema), call),
|
|
3022
3136
|
/** Pass an `actionId` to recover the endpoint and its secret after a lost answer. */
|
|
3023
3137
|
create: (input, call) => post(
|
|
3024
3138
|
"/webhooks",
|
|
@@ -3027,7 +3141,7 @@ function managementClient(options) {
|
|
|
3027
3141
|
call
|
|
3028
3142
|
),
|
|
3029
3143
|
update: (id, input, call) => request(
|
|
3030
|
-
`/webhooks/${
|
|
3144
|
+
`/webhooks/${z14.string().uuid().parse(id)}`,
|
|
3031
3145
|
webhookEndpointSchema,
|
|
3032
3146
|
webhookUpdateSchema.parse(input),
|
|
3033
3147
|
"PUT",
|
|
@@ -3035,19 +3149,19 @@ function managementClient(options) {
|
|
|
3035
3149
|
),
|
|
3036
3150
|
/** @deprecated Use pause. Removed in 2.0.0. */
|
|
3037
3151
|
disable: (id, call) => post(
|
|
3038
|
-
`/webhooks/${
|
|
3152
|
+
`/webhooks/${z14.string().uuid().parse(id)}/disable`,
|
|
3039
3153
|
webhookEndpointSchema,
|
|
3040
3154
|
{},
|
|
3041
3155
|
call
|
|
3042
3156
|
),
|
|
3043
3157
|
rotateSecret: rotateWebhookSecret,
|
|
3044
3158
|
deliveries: (id, query = {}, call) => get(
|
|
3045
|
-
`/webhooks/${
|
|
3159
|
+
`/webhooks/${z14.string().uuid().parse(id)}/deliveries${queryString(webhookQuerySchema.parse(query))}`,
|
|
3046
3160
|
webhookDeliveryPageSchema,
|
|
3047
3161
|
call
|
|
3048
3162
|
),
|
|
3049
3163
|
replay: (id, delivery, call) => post(
|
|
3050
|
-
`/webhooks/${
|
|
3164
|
+
`/webhooks/${z14.string().uuid().parse(id)}/deliveries/${z14.string().uuid().parse(delivery)}/replay`,
|
|
3051
3165
|
webhookDeliverySchema,
|
|
3052
3166
|
{},
|
|
3053
3167
|
call
|
|
@@ -3058,7 +3172,7 @@ function managementClient(options) {
|
|
|
3058
3172
|
* environment. Organization administrators, from a Console session only.
|
|
3059
3173
|
*/
|
|
3060
3174
|
identityIntegrations: {
|
|
3061
|
-
list: (call) => get("/identity-integrations",
|
|
3175
|
+
list: (call) => get("/identity-integrations", z14.array(identityIntegrationSchema), call),
|
|
3062
3176
|
/** The secret `token` is in this response only. */
|
|
3063
3177
|
create: (input, call) => post(
|
|
3064
3178
|
"/identity-integrations",
|
|
@@ -3068,7 +3182,7 @@ function managementClient(options) {
|
|
|
3068
3182
|
),
|
|
3069
3183
|
/** Replaces the key's secret and extends it by 90 days; the old secret stops working. */
|
|
3070
3184
|
rotate: (id, call) => post(
|
|
3071
|
-
`/identity-integrations/${
|
|
3185
|
+
`/identity-integrations/${z14.string().uuid().parse(id)}/rotate`,
|
|
3072
3186
|
identityIntegrationSecretSchema,
|
|
3073
3187
|
{},
|
|
3074
3188
|
call
|
|
@@ -3080,7 +3194,7 @@ function managementClient(options) {
|
|
|
3080
3194
|
*/
|
|
3081
3195
|
kinds: (call) => get(
|
|
3082
3196
|
"/identity-integrations/kinds",
|
|
3083
|
-
|
|
3197
|
+
z14.array(identityKindClaimSchema),
|
|
3084
3198
|
call
|
|
3085
3199
|
),
|
|
3086
3200
|
/**
|
|
@@ -3088,8 +3202,8 @@ function managementClient(options) {
|
|
|
3088
3202
|
* and keep attributing tracker records; unlink them on the member to stop that.
|
|
3089
3203
|
*/
|
|
3090
3204
|
revoke: (id, call) => request(
|
|
3091
|
-
`/identity-integrations/${
|
|
3092
|
-
|
|
3205
|
+
`/identity-integrations/${z14.string().uuid().parse(id)}`,
|
|
3206
|
+
z14.null(),
|
|
3093
3207
|
void 0,
|
|
3094
3208
|
"DELETE",
|
|
3095
3209
|
call
|
|
@@ -3140,7 +3254,7 @@ function managementClient(options) {
|
|
|
3140
3254
|
resources: {
|
|
3141
3255
|
list: (call) => get(
|
|
3142
3256
|
"/resources",
|
|
3143
|
-
|
|
3257
|
+
z14.object({ resources: z14.array(managedResourceSchema) }),
|
|
3144
3258
|
call
|
|
3145
3259
|
),
|
|
3146
3260
|
/** @deprecated Use the resource archive/unarchive methods. Removed in 2.0.0. */
|
|
@@ -3156,13 +3270,32 @@ function managementClient(options) {
|
|
|
3156
3270
|
rewardDeliveriesSchema,
|
|
3157
3271
|
call
|
|
3158
3272
|
),
|
|
3159
|
-
/**
|
|
3273
|
+
/**
|
|
3274
|
+
* Relinquish automatic removal for an external assignment; requires `review` and an audited reason.
|
|
3275
|
+
*
|
|
3276
|
+
* @deprecated Use `discordRoles.preserve`. Removed in 2.0.0.
|
|
3277
|
+
*/
|
|
3160
3278
|
preserveRewardRole: (id, body, call) => post(
|
|
3161
3279
|
`/reward-deliveries/${encodeURIComponent(id)}/preserve`,
|
|
3162
3280
|
rewardDeliverySchema,
|
|
3163
3281
|
body,
|
|
3164
3282
|
call
|
|
3165
3283
|
),
|
|
3284
|
+
/** Operations of the Discord role reward kind on assignments it delivered. */
|
|
3285
|
+
discordRoles: {
|
|
3286
|
+
/**
|
|
3287
|
+
* Hands the role assignment a delivery made to an external administrator or bot: Relay stops
|
|
3288
|
+
* removing it automatically, in every project and environment that shares the assignment.
|
|
3289
|
+
* Never grants the role again or rewrites delivery history. Requires `review` permission and
|
|
3290
|
+
* a reason the audit log keeps. A delivery of another reward kind is refused with 409.
|
|
3291
|
+
*/
|
|
3292
|
+
preserve: (delivery, input, call) => post(
|
|
3293
|
+
`/reward-deliveries/${encodeURIComponent(delivery)}/preserve`,
|
|
3294
|
+
rewardDeliverySchema,
|
|
3295
|
+
input,
|
|
3296
|
+
call
|
|
3297
|
+
)
|
|
3298
|
+
},
|
|
3166
3299
|
retryRewardDelivery: (id, call) => post(
|
|
3167
3300
|
`/reward-deliveries/${encodeURIComponent(id)}/retry`,
|
|
3168
3301
|
rewardDeliverySchema,
|
|
@@ -3180,7 +3313,7 @@ function managementClient(options) {
|
|
|
3180
3313
|
testMemberCreateSchema.parse(withActionId(input)),
|
|
3181
3314
|
call
|
|
3182
3315
|
),
|
|
3183
|
-
list: (call) => get("/test-members",
|
|
3316
|
+
list: (call) => get("/test-members", z14.array(testMemberSchema), call),
|
|
3184
3317
|
history: (member, query = {}, call) => get(
|
|
3185
3318
|
`/test-members/${identifier.parse(member)}/history${queryString(testMemberHistoryQuerySchema.parse(query))}`,
|
|
3186
3319
|
testMemberHistorySchema,
|
|
@@ -3225,6 +3358,53 @@ function managementClient(options) {
|
|
|
3225
3358
|
},
|
|
3226
3359
|
/** The project's members, as operators see them. */
|
|
3227
3360
|
members: {
|
|
3361
|
+
/**
|
|
3362
|
+
* Every identity a member proved, by kind: wallets, X, Discord and Telegram accounts, and
|
|
3363
|
+
* `app:<name>` identities, each with its link, sign-in and the actions an operator can take.
|
|
3364
|
+
* Attribution (unlink, relink) and wallet sign-in are separate commands.
|
|
3365
|
+
*/
|
|
3366
|
+
identityStates: {
|
|
3367
|
+
/** One page of the member's identities; requires `read` permission. */
|
|
3368
|
+
list: (member, query = {}, call) => get(
|
|
3369
|
+
`/members/${identifier.parse(member)}/identity-states${queryString(managementStateQuerySchema.parse(query))}`,
|
|
3370
|
+
memberIdentityStatePageSchema,
|
|
3371
|
+
call
|
|
3372
|
+
),
|
|
3373
|
+
/**
|
|
3374
|
+
* Stops an identity attributing tracker records to the member, at the revision the
|
|
3375
|
+
* operator reviewed; requires `review` permission. The identity stays bound to the member.
|
|
3376
|
+
* Unlinking an app identity also ends the sessions its integration issued for it and
|
|
3377
|
+
* refuses its sign-in until it is relinked; other kinds keep their sign-in.
|
|
3378
|
+
*/
|
|
3379
|
+
unlink: (member, input, call) => post(
|
|
3380
|
+
`/members/${identifier.parse(member)}/identity-states/unlink`,
|
|
3381
|
+
memberIdentityStateSchema,
|
|
3382
|
+
memberIdentityLinkChangeInputSchema.parse(withActionId(input)),
|
|
3383
|
+
call
|
|
3384
|
+
),
|
|
3385
|
+
/**
|
|
3386
|
+
* Restores an unlinked identity's attribution for the same member, at the revision the
|
|
3387
|
+
* operator reviewed; requires `review` permission. Records it could not attribute are
|
|
3388
|
+
* decided again under each quest's historical policy.
|
|
3389
|
+
*/
|
|
3390
|
+
relink: (member, input, call) => post(
|
|
3391
|
+
`/members/${identifier.parse(member)}/identity-states/relink`,
|
|
3392
|
+
memberIdentityStateSchema,
|
|
3393
|
+
memberIdentityLinkChangeInputSchema.parse(withActionId(input)),
|
|
3394
|
+
call
|
|
3395
|
+
),
|
|
3396
|
+
/**
|
|
3397
|
+
* Turns sign-in with a member's wallet on or off in this project and environment, whatever
|
|
3398
|
+
* its link; requires `review` permission. Sessions it already issued run out within 8 hours.
|
|
3399
|
+
*/
|
|
3400
|
+
setSignIn: (member, input, call) => post(
|
|
3401
|
+
`/members/${identifier.parse(member)}/identity-states/sign-in`,
|
|
3402
|
+
memberIdentityStateSchema,
|
|
3403
|
+
memberIdentitySignInInputSchema.parse(withActionId(input)),
|
|
3404
|
+
call
|
|
3405
|
+
)
|
|
3406
|
+
},
|
|
3407
|
+
/** @deprecated Use `identityStates`, which covers every identity kind. Removed in 2.0.0. */
|
|
3228
3408
|
identityLinks: {
|
|
3229
3409
|
/** Owned wallet links and exact owned OAuth choices; requires read permission. */
|
|
3230
3410
|
list: (member, query = {}, call) => get(
|
|
@@ -3265,6 +3445,16 @@ function managementClient(options) {
|
|
|
3265
3445
|
),
|
|
3266
3446
|
/** A member's detail: accounts, progress, passes, wallets and profile. */
|
|
3267
3447
|
get: (member, call) => get(`/members/${encodeURIComponent(member)}`, memberDetailSchema, call),
|
|
3448
|
+
/**
|
|
3449
|
+
* A member's progress on each active quest, 25 most recent attempts and point balances,
|
|
3450
|
+
* without the quest releases and their evaluator code that `get` answers; requires `read`
|
|
3451
|
+
* permission. Use it for reads that run often or under a deadline.
|
|
3452
|
+
*/
|
|
3453
|
+
progress: (member, call) => get(
|
|
3454
|
+
`/members/${encodeURIComponent(member)}/progress`,
|
|
3455
|
+
managedMemberProgressSchema,
|
|
3456
|
+
call
|
|
3457
|
+
),
|
|
3268
3458
|
/**
|
|
3269
3459
|
* The one member of the client's project holding exactly this account, with `provider` and `subject` as a member's
|
|
3270
3460
|
* `accounts` list them; requires `read` permission. Fails with 404 `member-not-found` when
|
|
@@ -3279,23 +3469,35 @@ function managementClient(options) {
|
|
|
3279
3469
|
/** Who each member is: up to 100 distinct IDs; unknown IDs come back without accounts. */
|
|
3280
3470
|
people: (members, call) => get(
|
|
3281
3471
|
`/people${queryString({ ids: members.join(",") })}`,
|
|
3282
|
-
|
|
3472
|
+
z14.array(personSchema),
|
|
3283
3473
|
call
|
|
3284
3474
|
),
|
|
3285
|
-
/**
|
|
3475
|
+
/**
|
|
3476
|
+
* Current X and Discord quest account selections; requires read permission.
|
|
3477
|
+
*
|
|
3478
|
+
* @deprecated Use `identityStates.list`. Removed in 2.0.0.
|
|
3479
|
+
*/
|
|
3286
3480
|
oauthAccounts: (member, call) => get(
|
|
3287
3481
|
`/members/${encodeURIComponent(member)}/oauth-accounts`,
|
|
3288
|
-
|
|
3482
|
+
z14.array(managedOAuthAccountSchema),
|
|
3289
3483
|
call
|
|
3290
3484
|
),
|
|
3291
|
-
/**
|
|
3485
|
+
/**
|
|
3486
|
+
* Unlinks the reviewed selection in this project and environment, preserving ownership and sign-in.
|
|
3487
|
+
*
|
|
3488
|
+
* @deprecated Use `identityStates.unlink`. Removed in 2.0.0.
|
|
3489
|
+
*/
|
|
3292
3490
|
unlinkOAuthAccount: (member, input, call) => post(
|
|
3293
3491
|
`/members/${encodeURIComponent(member)}/oauth-accounts/unlink`,
|
|
3294
|
-
|
|
3492
|
+
z14.array(managedOAuthAccountSchema),
|
|
3295
3493
|
memberOAuthUnlinkInputSchema.parse(input),
|
|
3296
3494
|
call
|
|
3297
3495
|
),
|
|
3298
|
-
/**
|
|
3496
|
+
/**
|
|
3497
|
+
* The member's Telegram account selection; requires read permission.
|
|
3498
|
+
*
|
|
3499
|
+
* @deprecated Use `identityStates.list`. Removed in 2.0.0.
|
|
3500
|
+
*/
|
|
3299
3501
|
telegramAccount: (member, call) => get(
|
|
3300
3502
|
`/members/${encodeURIComponent(member)}/telegram-account`,
|
|
3301
3503
|
managedTelegramAccountSchema,
|
|
@@ -3304,6 +3506,8 @@ function managementClient(options) {
|
|
|
3304
3506
|
/**
|
|
3305
3507
|
* Unlinks the member's reviewed Telegram account in this project and environment, as
|
|
3306
3508
|
* `unlinkOAuthAccount` does for X and Discord; requires `review` permission.
|
|
3509
|
+
*
|
|
3510
|
+
* @deprecated Use `identityStates.unlink`. Removed in 2.0.0.
|
|
3307
3511
|
*/
|
|
3308
3512
|
unlinkTelegramAccount: (member, input, call) => post(
|
|
3309
3513
|
`/members/${encodeURIComponent(member)}/telegram-account/unlink`,
|
|
@@ -3311,10 +3515,14 @@ function managementClient(options) {
|
|
|
3311
3515
|
memberTelegramUnlinkInputSchema.parse(input),
|
|
3312
3516
|
call
|
|
3313
3517
|
),
|
|
3314
|
-
/**
|
|
3518
|
+
/**
|
|
3519
|
+
* Unlinks a member's wallet from the project with a reason; requires `review` permission. The address stays bound to the member.
|
|
3520
|
+
*
|
|
3521
|
+
* @deprecated Use `identityStates.unlink`. Removed in 2.0.0.
|
|
3522
|
+
*/
|
|
3315
3523
|
unlinkWallet: (member, input, call) => post(
|
|
3316
3524
|
`/members/${encodeURIComponent(member)}/wallets/unlink`,
|
|
3317
|
-
|
|
3525
|
+
z14.array(managedWalletSchema),
|
|
3318
3526
|
memberWalletUnlinkInputSchema.parse(input),
|
|
3319
3527
|
call
|
|
3320
3528
|
),
|
|
@@ -3322,27 +3530,35 @@ function managementClient(options) {
|
|
|
3322
3530
|
* Unlinks one of a member's `app:<name>` identities with a reason; requires `review`
|
|
3323
3531
|
* permission. It stops attributing tracker records, the member's sessions that the kind's
|
|
3324
3532
|
* integration issued for it end, and signing in with it fails until it is relinked.
|
|
3533
|
+
*
|
|
3534
|
+
* @deprecated Use `identityStates.unlink`. Removed in 2.0.0.
|
|
3325
3535
|
*/
|
|
3326
3536
|
unlinkIdentity: (member, input, call) => post(
|
|
3327
3537
|
`/members/${encodeURIComponent(member)}/identities/unlink`,
|
|
3328
|
-
|
|
3538
|
+
z14.array(managedMemberIdentitySchema),
|
|
3329
3539
|
memberIdentityChangeInputSchema.parse(input),
|
|
3330
3540
|
call
|
|
3331
3541
|
),
|
|
3332
|
-
/**
|
|
3542
|
+
/**
|
|
3543
|
+
* Relinks an `app:<name>` identity an operator unlinked from this member, with a reason; requires `review` permission.
|
|
3544
|
+
*
|
|
3545
|
+
* @deprecated Use `identityStates.relink`. Removed in 2.0.0.
|
|
3546
|
+
*/
|
|
3333
3547
|
relinkIdentity: (member, input, call) => post(
|
|
3334
3548
|
`/members/${encodeURIComponent(member)}/identities/relink`,
|
|
3335
|
-
|
|
3549
|
+
z14.array(managedMemberIdentitySchema),
|
|
3336
3550
|
memberIdentityChangeInputSchema.parse(input),
|
|
3337
3551
|
call
|
|
3338
3552
|
),
|
|
3339
3553
|
/**
|
|
3340
3554
|
* Enables or disables sign-in with a member's wallet in this project and environment, with a
|
|
3341
3555
|
* reason; requires `review` permission. Sessions it already issued run out within 8 hours.
|
|
3556
|
+
*
|
|
3557
|
+
* @deprecated Use `identityStates.setSignIn`. Removed in 2.0.0.
|
|
3342
3558
|
*/
|
|
3343
3559
|
setWalletSignIn: (member, input, call) => post(
|
|
3344
3560
|
`/members/${encodeURIComponent(member)}/wallets/sign-in`,
|
|
3345
|
-
|
|
3561
|
+
z14.array(managedWalletSchema),
|
|
3346
3562
|
memberWalletSignInInputSchema.parse(input),
|
|
3347
3563
|
call
|
|
3348
3564
|
)
|
|
@@ -3377,10 +3593,10 @@ function managementClient(options) {
|
|
|
3377
3593
|
{},
|
|
3378
3594
|
call
|
|
3379
3595
|
),
|
|
3380
|
-
setState: (
|
|
3596
|
+
setState: (state3, call) => request(
|
|
3381
3597
|
"/schedules/state",
|
|
3382
3598
|
appScheduleListSchema,
|
|
3383
|
-
{ state: appScheduleStateSchema.parse(
|
|
3599
|
+
{ state: appScheduleStateSchema.parse(state3) },
|
|
3384
3600
|
"PUT",
|
|
3385
3601
|
call
|
|
3386
3602
|
),
|
|
@@ -3514,7 +3730,7 @@ function managementClient(options) {
|
|
|
3514
3730
|
* Each quest's current release, the most recently published first, archived quests
|
|
3515
3731
|
* included; requires `read` permission.
|
|
3516
3732
|
*/
|
|
3517
|
-
list: (call) => get("/quests/list",
|
|
3733
|
+
list: (call) => get("/quests/list", z14.array(publishedReleaseSchema), call),
|
|
3518
3734
|
/** Pending and exhausted asynchronous balance checks. Requires read. */
|
|
3519
3735
|
automaticScheduling: (query = {}, call) => get(
|
|
3520
3736
|
`/quests/automatic-scheduling${queryString(automaticSchedulingQuerySchema.parse(query))}`,
|
|
@@ -3553,6 +3769,25 @@ function managementClient(options) {
|
|
|
3553
3769
|
managedQuestEnrollmentPageSchema,
|
|
3554
3770
|
call
|
|
3555
3771
|
),
|
|
3772
|
+
/**
|
|
3773
|
+
* A member's open quest submissions: drafts they started and have not submitted, newest
|
|
3774
|
+
* change first. Each expires 7 days after its last change. Requires `read`.
|
|
3775
|
+
*/
|
|
3776
|
+
submissions: (member, call) => get(
|
|
3777
|
+
`/members/${encodeURIComponent(member)}/quest-submissions`,
|
|
3778
|
+
z14.object({ items: z14.array(questSubmissionSchema) }),
|
|
3779
|
+
call
|
|
3780
|
+
),
|
|
3781
|
+
/**
|
|
3782
|
+
* Discards a member's open quest submission, such as one stuck on a changed quest; the
|
|
3783
|
+
* member starts a new one. Discarding again returns it. Requires `review` or `confirm`.
|
|
3784
|
+
*/
|
|
3785
|
+
discardSubmission: (member, submission, call) => post(
|
|
3786
|
+
`/members/${encodeURIComponent(member)}/quest-submissions/${encodeURIComponent(submission)}/discard`,
|
|
3787
|
+
questSubmissionSchema,
|
|
3788
|
+
{},
|
|
3789
|
+
call
|
|
3790
|
+
),
|
|
3556
3791
|
withdraw: (quest, member, input, call) => post(
|
|
3557
3792
|
`/quests/${encodeURIComponent(quest)}/enrollments/${encodeURIComponent(member)}/withdraw`,
|
|
3558
3793
|
questEnrollmentStateSchema,
|
|
@@ -3661,6 +3896,12 @@ var managementResponseSchemas = lazyResponseReaders({
|
|
|
3661
3896
|
get memberIdentityLinkPageSchema() {
|
|
3662
3897
|
return knownResponse(memberIdentityLinkPageSchema);
|
|
3663
3898
|
},
|
|
3899
|
+
get memberIdentityStatePageSchema() {
|
|
3900
|
+
return knownResponse(memberIdentityStatePageSchema);
|
|
3901
|
+
},
|
|
3902
|
+
get memberIdentityStateSchema() {
|
|
3903
|
+
return knownResponse(memberIdentityStateSchema);
|
|
3904
|
+
},
|
|
3664
3905
|
get managedQuestEnrollmentPageSchema() {
|
|
3665
3906
|
return knownResponse(managedQuestEnrollmentPageSchema);
|
|
3666
3907
|
},
|
|
@@ -3853,6 +4094,9 @@ var managementResponseSchemas = lazyResponseReaders({
|
|
|
3853
4094
|
get managedMemberPageSchema() {
|
|
3854
4095
|
return knownResponse(managedMemberPageSchema);
|
|
3855
4096
|
},
|
|
4097
|
+
get managedMemberProgressSchema() {
|
|
4098
|
+
return knownResponse(managedMemberProgressSchema);
|
|
4099
|
+
},
|
|
3856
4100
|
get managedOAuthAccountSchema() {
|
|
3857
4101
|
return knownResponse(managedOAuthAccountSchema);
|
|
3858
4102
|
},
|
|
@@ -4048,6 +4292,8 @@ var managementResponses = {
|
|
|
4048
4292
|
memberBadgesSchema: responseSchema(memberBadgesSchema),
|
|
4049
4293
|
badgeMutationResultSchema: responseSchema(badgeMutationResultSchema),
|
|
4050
4294
|
memberIdentityLinkPageSchema: responseSchema(memberIdentityLinkPageSchema),
|
|
4295
|
+
memberIdentityStatePageSchema: responseSchema(memberIdentityStatePageSchema),
|
|
4296
|
+
memberIdentityStateSchema: responseSchema(memberIdentityStateSchema),
|
|
4051
4297
|
managedQuestEnrollmentPageSchema: responseSchema(
|
|
4052
4298
|
managedQuestEnrollmentPageSchema
|
|
4053
4299
|
),
|
|
@@ -4130,6 +4376,7 @@ var managementResponses = {
|
|
|
4130
4376
|
managedGroupSchema: responseSchema(managedGroupSchema),
|
|
4131
4377
|
managedMemberIdentitySchema: responseSchema(managedMemberIdentitySchema),
|
|
4132
4378
|
managedMemberPageSchema: responseSchema(managedMemberPageSchema),
|
|
4379
|
+
managedMemberProgressSchema: responseSchema(managedMemberProgressSchema),
|
|
4133
4380
|
managedOAuthAccountSchema: responseSchema(managedOAuthAccountSchema),
|
|
4134
4381
|
managedTelegramAccountSchema: responseSchema(managedTelegramAccountSchema),
|
|
4135
4382
|
telegramChatsSchema: responseSchema(telegramChatsSchema),
|
|
@@ -4224,6 +4471,7 @@ export {
|
|
|
4224
4471
|
activityTypeSchema,
|
|
4225
4472
|
activityTypes,
|
|
4226
4473
|
addGroupMemberSchema,
|
|
4474
|
+
appIdentitySelectorSchema,
|
|
4227
4475
|
appMigrationNameSchema,
|
|
4228
4476
|
appRoutingSchema,
|
|
4229
4477
|
appScheduleListSchema,
|
|
@@ -4324,6 +4572,7 @@ export {
|
|
|
4324
4572
|
managedGroupSchema,
|
|
4325
4573
|
managedMemberIdentitySchema,
|
|
4326
4574
|
managedMemberPageSchema,
|
|
4575
|
+
managedMemberProgressSchema,
|
|
4327
4576
|
managedMemberQuerySchema,
|
|
4328
4577
|
managedOAuthAccountSchema,
|
|
4329
4578
|
managedPointHistoryPageSchema,
|
|
@@ -4342,9 +4591,14 @@ export {
|
|
|
4342
4591
|
memberAccountSchema,
|
|
4343
4592
|
memberDetailSchema,
|
|
4344
4593
|
memberIdentityChangeInputSchema,
|
|
4594
|
+
memberIdentityLinkChangeInputSchema,
|
|
4345
4595
|
memberIdentityLinkPageSchema,
|
|
4346
4596
|
memberIdentityLinkSchema,
|
|
4347
4597
|
memberIdentitySchema,
|
|
4598
|
+
memberIdentitySelectorSchema,
|
|
4599
|
+
memberIdentitySignInInputSchema,
|
|
4600
|
+
memberIdentityStatePageSchema,
|
|
4601
|
+
memberIdentityStateSchema,
|
|
4348
4602
|
memberLookupSchema,
|
|
4349
4603
|
memberOAuthUnlinkInputSchema,
|
|
4350
4604
|
memberSchema,
|
|
@@ -4417,6 +4671,7 @@ export {
|
|
|
4417
4671
|
stockInputSchema,
|
|
4418
4672
|
teamSchema,
|
|
4419
4673
|
telegramBotIdSchema,
|
|
4674
|
+
telegramIdentitySelectorSchema,
|
|
4420
4675
|
testMemberActionSchema,
|
|
4421
4676
|
testMemberAdvanceSchema,
|
|
4422
4677
|
testMemberCreateSchema,
|