@domino-sdk/relay 1.54.0 → 1.56.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/CHANGELOG.md +1859 -0
- package/dist/analytics-URV-mxjH.d.ts +482 -0
- package/dist/{attempt-captures-QC4kTA44.d.ts → attempt-captures-CxxO7DeD.d.ts} +1 -1
- package/dist/authoring.d.ts +277 -40
- package/dist/authoring.js +142 -14
- package/dist/{automatic-outcomes-CVyZHxir.d.ts → automatic-outcomes-DxW_v5Wc.d.ts} +5 -2
- package/dist/avatar.d.ts +1 -1
- package/dist/browser.d.ts +7 -7
- package/dist/browser.js +10 -10
- package/dist/{capability-error-FQGGb5xS.d.ts → capability-error-DSd8EMQC.d.ts} +76 -2
- package/dist/{chunk-RP4LLEON.js → chunk-ABJ4G47X.js} +1 -1
- package/dist/{chunk-IELNFM3V.js → chunk-BHHUSBSD.js} +97 -8
- package/dist/chunk-BJYMTCWG.js +950 -0
- package/dist/{chunk-K6TVMNU4.js → chunk-CK7HO32Z.js} +1 -1
- package/dist/{chunk-GTQJSDBS.js → chunk-CXKXPB7K.js} +32 -16
- package/dist/{chunk-TL5TL5RD.js → chunk-G6XVBYH7.js} +4 -4
- package/dist/{chunk-S2PMKZSX.js → chunk-H2MD6E7Z.js} +21 -2
- package/dist/{chunk-YVC3B72P.js → chunk-INSWI2VZ.js} +1 -1
- package/dist/{chunk-XFAYQFRO.js → chunk-KBVH4XZC.js} +1 -1
- package/dist/{chunk-MLIXJPKL.js → chunk-MHPKEVEW.js} +1 -0
- package/dist/{chunk-7BNCLWAO.js → chunk-MNU6UPXY.js} +1 -1
- package/dist/{chunk-JL7J3EQQ.js → chunk-NK6EER33.js} +46 -16
- package/dist/{chunk-QIDQWXSF.js → chunk-OTITLABX.js} +2 -2
- package/dist/{chunk-53JMTUWG.js → chunk-QNQNKIAA.js} +1 -1
- package/dist/{chunk-ZJ3FVZRP.js → chunk-RBPMT53S.js} +132 -99
- package/dist/chunk-ULQU7KC4.js +704 -0
- package/dist/chunk-VSHV7FEA.js +344 -0
- package/dist/{chunk-LPHXTZDA.js → chunk-W5U2WXG3.js} +2 -2
- package/dist/{client-CzNtl8UO.d.ts → client-bX3oTpRu.d.ts} +111 -8
- package/dist/{deployments-ovtqtAcx.d.ts → deployments-D3lxfQMB.d.ts} +1436 -185
- package/dist/{groups-B5R1RCsl.d.ts → groups-DPE004_V.d.ts} +135 -139
- package/dist/index.d.ts +8 -8
- package/dist/index.js +9 -9
- package/dist/integrations-CcD5NPEA.d.ts +633 -0
- package/dist/internal.d.ts +11 -10
- package/dist/internal.js +9 -9
- package/dist/{offers-CH1RZekg.d.ts → offers-CtzMeB7O.d.ts} +207 -2
- package/dist/{pages-BTlOg8sl.d.ts → pages-BlLqB8ZQ.d.ts} +82 -2
- package/dist/portal-proxy.d.ts +11 -1
- package/dist/portal-proxy.js +27 -6
- package/dist/{profiles-Cdv4BSd_.d.ts → profiles-BoOK03cR.d.ts} +2 -0
- package/dist/react/index.d.ts +566 -13
- package/dist/react/index.js +105 -15
- package/dist/runtime/authoring.js +1 -1
- package/dist/runtime/chunks/NDB42VFF.js +1 -0
- package/dist/runtime/manifest.json +3 -3
- package/dist/runtime/schema.js +1 -1
- package/dist/{schema-BJ9bOgpN.d.ts → schema-C4m9RhCR.d.ts} +166 -6
- package/dist/schema.d.ts +383 -79
- package/dist/schema.js +105 -41
- package/dist/server/index.d.ts +11 -10
- package/dist/server/index.js +1590 -1175
- package/dist/{submission-input-BNah53go.d.ts → submission-input-wTiYGdgA.d.ts} +2 -2
- package/dist/{telegram-browser-C36j_6v-.d.ts → telegram-browser-Bh3i0HiH.d.ts} +1 -1
- package/dist/testing.d.ts +85 -12
- package/dist/testing.js +322 -37
- package/dist/{transport-C8BlCzmF.d.ts → transport-CnKA-_RL.d.ts} +7625 -1265
- package/dist/vite.d.ts +54 -1
- package/dist/vite.js +35 -0
- package/dist/{x-BfQcsDp0.d.ts → x-1czZFVUW.d.ts} +1 -1
- package/package.json +3 -2
- package/dist/chunk-2NUD237O.js +0 -102
- package/dist/chunk-CCE2JWES.js +0 -1083
- package/dist/integrations-CllF-kWg.d.ts +0 -314
- package/dist/runtime/chunks/AVRVSLHX.js +0 -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-MNU6UPXY.js";
|
|
5
5
|
import {
|
|
6
6
|
activityTypeSchema,
|
|
7
7
|
activityTypes,
|
|
@@ -27,7 +27,22 @@ import {
|
|
|
27
27
|
publishDeploymentSchema,
|
|
28
28
|
rejectDeploymentSchema,
|
|
29
29
|
submitDeploymentSchema
|
|
30
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-CXKXPB7K.js";
|
|
31
|
+
import {
|
|
32
|
+
analyticsBreakdowns,
|
|
33
|
+
analyticsCatalog,
|
|
34
|
+
analyticsCatalogSchema,
|
|
35
|
+
analyticsCharts,
|
|
36
|
+
analyticsFilters,
|
|
37
|
+
analyticsMetricIds,
|
|
38
|
+
analyticsMetricQuerySchema,
|
|
39
|
+
analyticsMetricResultSchema,
|
|
40
|
+
analyticsQueryLimit,
|
|
41
|
+
analyticsQuerySchema,
|
|
42
|
+
analyticsRanges,
|
|
43
|
+
analyticsReadSchema,
|
|
44
|
+
dashboardDefinitionSchema
|
|
45
|
+
} from "../chunk-ULQU7KC4.js";
|
|
31
46
|
import "../chunk-4OC7REYX.js";
|
|
32
47
|
import {
|
|
33
48
|
DEFAULT_MANAGEMENT_TIMEOUT,
|
|
@@ -48,31 +63,31 @@ import {
|
|
|
48
63
|
participantExchangeSchema,
|
|
49
64
|
questConfiguration,
|
|
50
65
|
sequenceCursorSchema
|
|
51
|
-
} from "../chunk-
|
|
66
|
+
} from "../chunk-G6XVBYH7.js";
|
|
52
67
|
import {
|
|
53
68
|
parseImageExtraction,
|
|
54
69
|
parseImageResult
|
|
55
|
-
} from "../chunk-
|
|
70
|
+
} from "../chunk-W5U2WXG3.js";
|
|
56
71
|
import {
|
|
57
72
|
imageAssetArtifactSchema,
|
|
58
73
|
xUserLookupInputSchema,
|
|
59
74
|
xUserSchema,
|
|
60
75
|
xUsernameSchema
|
|
61
|
-
} from "../chunk-
|
|
76
|
+
} from "../chunk-CK7HO32Z.js";
|
|
62
77
|
import {
|
|
63
78
|
sourceDataSchema,
|
|
64
79
|
sourceRoles,
|
|
65
80
|
validateQuestShape
|
|
66
|
-
} from "../chunk-
|
|
81
|
+
} from "../chunk-H2MD6E7Z.js";
|
|
67
82
|
import {
|
|
68
83
|
isIntegrationParticipantPath,
|
|
69
84
|
isParticipantRoute,
|
|
70
85
|
participantRoutePattern,
|
|
71
86
|
participantRoutes
|
|
72
|
-
} from "../chunk-
|
|
87
|
+
} from "../chunk-MHPKEVEW.js";
|
|
73
88
|
import {
|
|
74
89
|
withActionId
|
|
75
|
-
} from "../chunk-
|
|
90
|
+
} from "../chunk-INSWI2VZ.js";
|
|
76
91
|
import {
|
|
77
92
|
allocateQuestSchema,
|
|
78
93
|
allocatedQuestSchema,
|
|
@@ -81,6 +96,7 @@ import {
|
|
|
81
96
|
collectionBeginSchema,
|
|
82
97
|
collectionPreviewSchema,
|
|
83
98
|
collectionResolveSchema,
|
|
99
|
+
creatorAccountProviderSchema,
|
|
84
100
|
memberEnrollmentInputSchema,
|
|
85
101
|
publishQuestDraftSchema,
|
|
86
102
|
questCatalogSchema,
|
|
@@ -91,13 +107,13 @@ import {
|
|
|
91
107
|
rewardDeliveryQuerySchema,
|
|
92
108
|
rewardDeliverySchema,
|
|
93
109
|
saveQuestDraftSchema
|
|
94
|
-
} from "../chunk-
|
|
110
|
+
} from "../chunk-RBPMT53S.js";
|
|
95
111
|
import {
|
|
96
112
|
badgeMutationResultSchema,
|
|
97
113
|
badgeMutationSchema,
|
|
98
114
|
badgePropertiesSchema,
|
|
115
|
+
baseUnitsSchema,
|
|
99
116
|
createBadgeSchema,
|
|
100
|
-
createPointLedgerSchema,
|
|
101
117
|
engagementBoundaryPageSchema,
|
|
102
118
|
engagementChangePreviewInputSchema,
|
|
103
119
|
engagementChangePreviewSchema,
|
|
@@ -116,23 +132,17 @@ import {
|
|
|
116
132
|
leaderboardPageSchema,
|
|
117
133
|
leaderboardQuerySchema,
|
|
118
134
|
leaderboardSettlementApprovalSchema,
|
|
135
|
+
leaderboardSettlementPoolSchema,
|
|
119
136
|
leaderboardSettlementSchema,
|
|
120
137
|
leaderboardSettlementSummarySchema,
|
|
121
138
|
managedBadgeSchema,
|
|
122
139
|
managedPointHistoryPageSchema,
|
|
123
|
-
managedPointLedgerSchema,
|
|
124
|
-
managedProfileSchema,
|
|
125
140
|
memberBadgesSchema,
|
|
126
141
|
offerControlSchema,
|
|
127
142
|
offerSchema,
|
|
128
|
-
pointLedgerPropertiesSchema,
|
|
129
|
-
pointLedgerSchema,
|
|
130
143
|
pointsAccountSchema,
|
|
131
144
|
pointsMutationSchema,
|
|
132
145
|
pointsResultSchema,
|
|
133
|
-
profileModerationSchema,
|
|
134
|
-
profileSettingsInputSchema,
|
|
135
|
-
profileSettingsSchema,
|
|
136
146
|
publishedLeaderboardSchema,
|
|
137
147
|
publishedReferralSchema,
|
|
138
148
|
redemptionCancellationSchema,
|
|
@@ -145,15 +155,23 @@ import {
|
|
|
145
155
|
referralQualificationSchema,
|
|
146
156
|
referralRewardResolutionSchema,
|
|
147
157
|
referralSuspensionSchema
|
|
148
|
-
} from "../chunk-
|
|
158
|
+
} from "../chunk-BJYMTCWG.js";
|
|
149
159
|
import {
|
|
160
|
+
createPointLedgerSchema,
|
|
161
|
+
managedPointLedgerSchema,
|
|
162
|
+
managedProfileSchema,
|
|
163
|
+
pointLedgerPropertiesSchema,
|
|
164
|
+
pointLedgerSchema,
|
|
165
|
+
profileModerationSchema,
|
|
166
|
+
profileSettingsInputSchema,
|
|
167
|
+
profileSettingsSchema,
|
|
150
168
|
telegramChatConnectionSchema,
|
|
151
169
|
telegramChatIdSchema,
|
|
152
170
|
telegramChatsSchema
|
|
153
|
-
} from "../chunk-
|
|
154
|
-
import "../chunk-
|
|
155
|
-
import "../chunk-
|
|
156
|
-
import "../chunk-
|
|
171
|
+
} from "../chunk-VSHV7FEA.js";
|
|
172
|
+
import "../chunk-KBVH4XZC.js";
|
|
173
|
+
import "../chunk-ABJ4G47X.js";
|
|
174
|
+
import "../chunk-QNQNKIAA.js";
|
|
157
175
|
import {
|
|
158
176
|
CompletionSourceKind,
|
|
159
177
|
addGroupMemberSchema,
|
|
@@ -243,7 +261,7 @@ import {
|
|
|
243
261
|
walletSignInNetworksSchema,
|
|
244
262
|
walletUnlinkInputSchema,
|
|
245
263
|
whereSchemaIssue
|
|
246
|
-
} from "../chunk-
|
|
264
|
+
} from "../chunk-BHHUSBSD.js";
|
|
247
265
|
|
|
248
266
|
// src/server/identity-links.ts
|
|
249
267
|
import * as z from "zod";
|
|
@@ -364,124 +382,191 @@ var memberIdentitySignInInputSchema = z2.strictObject({
|
|
|
364
382
|
enabled: z2.boolean()
|
|
365
383
|
});
|
|
366
384
|
|
|
367
|
-
// src/server/
|
|
385
|
+
// src/server/creator-accounts.ts
|
|
368
386
|
import * as z3 from "zod";
|
|
387
|
+
var managedCreatorAccountSchema = z3.object({
|
|
388
|
+
provider: creatorAccountProviderSchema,
|
|
389
|
+
/** The platform's account ID, such as a YouTube channel ID (`UC…`) or a TikTok `open_id`. */
|
|
390
|
+
subject: z3.string().min(1),
|
|
391
|
+
revision: z3.number().int().nonnegative(),
|
|
392
|
+
/** When the member linked it, epoch milliseconds. */
|
|
393
|
+
linkedAt: z3.number().int().nonnegative().nullable(),
|
|
394
|
+
status: z3.enum(["connected", "needs-reconnect"]),
|
|
395
|
+
/** Why the member must link it again: `revoked`, `expired` or `missing-scope`. */
|
|
396
|
+
reason: z3.string().optional(),
|
|
397
|
+
/** The public name, handle and picture the platform reported at link time. */
|
|
398
|
+
profile: z3.object({
|
|
399
|
+
name: z3.string().optional(),
|
|
400
|
+
username: z3.string().optional(),
|
|
401
|
+
imageUrl: z3.string().optional()
|
|
402
|
+
}).nullable()
|
|
403
|
+
});
|
|
404
|
+
var managedCreatorAccountsSchema = z3.object({
|
|
405
|
+
accounts: z3.array(managedCreatorAccountSchema)
|
|
406
|
+
});
|
|
407
|
+
var memberCreatorAccountUnlinkInputSchema = z3.strictObject({
|
|
408
|
+
provider: creatorAccountProviderSchema,
|
|
409
|
+
subject: z3.string().min(1).max(4096),
|
|
410
|
+
revision: z3.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER - 1),
|
|
411
|
+
reason: z3.string().trim().min(1).max(500)
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
// src/server/settlement-reviews.ts
|
|
415
|
+
import * as z4 from "zod";
|
|
416
|
+
var timestamp = z4.number().int().safe().nonnegative();
|
|
369
417
|
var decision = {
|
|
370
|
-
status:
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
418
|
+
status: z4.enum(["pending", "approved", "rejected"]),
|
|
419
|
+
/**
|
|
420
|
+
* Present while the window has ended but Relay is still taking closing measurements of the
|
|
421
|
+
* content its engagement points pay for. The settlement reads as `pending` with no rows, cannot
|
|
422
|
+
* be approved yet, and freezes when the measurements arrive or their wait ends after `deadline`.
|
|
423
|
+
*/
|
|
424
|
+
closing: z4.object({ startedAt: timestamp, deadline: timestamp }).optional(),
|
|
425
|
+
rejectedAt: z4.number().int().safe().nonnegative().nullable(),
|
|
426
|
+
rejectedBy: z4.string().nullable(),
|
|
427
|
+
rejectionReason: z4.string().nullable()
|
|
374
428
|
};
|
|
375
429
|
var leaderboardSettlementReviewSummarySchema = leaderboardSettlementSummarySchema.extend(decision);
|
|
376
430
|
var leaderboardSettlementReviewSchema = leaderboardSettlementSchema.extend(decision);
|
|
377
|
-
var leaderboardSettlementReviewQuerySchema =
|
|
431
|
+
var leaderboardSettlementReviewQuerySchema = z4.strictObject({
|
|
378
432
|
cursor: pageCursorSchema.optional(),
|
|
379
|
-
limit:
|
|
433
|
+
limit: z4.coerce.number().int().min(1).max(100).default(25)
|
|
380
434
|
});
|
|
381
|
-
var leaderboardSettlementReviewPageSchema =
|
|
382
|
-
items:
|
|
435
|
+
var leaderboardSettlementReviewPageSchema = z4.object({
|
|
436
|
+
items: z4.array(leaderboardSettlementReviewSummarySchema),
|
|
383
437
|
nextCursor: pageCursorSchema.nullable()
|
|
384
438
|
});
|
|
385
|
-
var leaderboardSettlementRejectionSchema =
|
|
386
|
-
actionId:
|
|
387
|
-
expectedCreatedAt:
|
|
388
|
-
reason:
|
|
439
|
+
var leaderboardSettlementRejectionSchema = z4.strictObject({
|
|
440
|
+
actionId: z4.string().uuid().default(() => crypto.randomUUID()),
|
|
441
|
+
expectedCreatedAt: z4.number().int().safe().nonnegative(),
|
|
442
|
+
reason: z4.string().trim().min(1).max(500)
|
|
443
|
+
});
|
|
444
|
+
var leaderboardSettlementMeasurementRetrySchema = z4.strictObject({
|
|
445
|
+
actionId: z4.string().uuid().default(() => crypto.randomUUID())
|
|
446
|
+
});
|
|
447
|
+
var leaderboardSettlementExportSchema = z4.object({
|
|
448
|
+
settlement: identifier,
|
|
449
|
+
leaderboard: identifier,
|
|
450
|
+
title: z4.string(),
|
|
451
|
+
period: z4.object({ start: timestamp, end: timestamp }),
|
|
452
|
+
status: z4.enum(["pending", "approved", "rejected"]),
|
|
453
|
+
pool: leaderboardSettlementPoolSchema.nullable(),
|
|
454
|
+
rows: z4.array(
|
|
455
|
+
z4.object({
|
|
456
|
+
member: identifier,
|
|
457
|
+
score: z4.number().int().safe(),
|
|
458
|
+
rank: z4.number().int().safe().positive(),
|
|
459
|
+
/** The pool share in base units; null without a pool. */
|
|
460
|
+
share: baseUnitsSchema.nullable(),
|
|
461
|
+
/** The pool share in whole units: `"600.5"` for 600500000 USDC base units. */
|
|
462
|
+
amount: z4.string().nullable(),
|
|
463
|
+
/** Linked wallets the member proved, on every chain, newest first per chain. */
|
|
464
|
+
wallets: z4.array(
|
|
465
|
+
z4.object({
|
|
466
|
+
chain: walletChainSchema,
|
|
467
|
+
/** The CAIP-2 network, for Cosmos wallets only. */
|
|
468
|
+
network: z4.string().nullable(),
|
|
469
|
+
address: z4.string()
|
|
470
|
+
})
|
|
471
|
+
)
|
|
472
|
+
})
|
|
473
|
+
)
|
|
389
474
|
});
|
|
390
475
|
|
|
391
476
|
// src/server/inventory-items.ts
|
|
392
|
-
import * as
|
|
393
|
-
var inventoryItemStateSchema =
|
|
477
|
+
import * as z5 from "zod";
|
|
478
|
+
var inventoryItemStateSchema = z5.object({
|
|
394
479
|
item: identifier,
|
|
395
|
-
name:
|
|
396
|
-
available:
|
|
397
|
-
reserved:
|
|
398
|
-
allocated:
|
|
399
|
-
offers:
|
|
400
|
-
revision:
|
|
401
|
-
archivedAt:
|
|
480
|
+
name: z5.string().nullable(),
|
|
481
|
+
available: z5.number().int().safe().nonnegative(),
|
|
482
|
+
reserved: z5.number().int().safe().nonnegative(),
|
|
483
|
+
allocated: z5.number().int().safe().nonnegative(),
|
|
484
|
+
offers: z5.array(identifier),
|
|
485
|
+
revision: z5.number().int().nonnegative(),
|
|
486
|
+
archivedAt: z5.number().int().safe().nonnegative().nullable()
|
|
402
487
|
});
|
|
403
488
|
var correction = {
|
|
404
|
-
actionId:
|
|
405
|
-
expectedRevision:
|
|
406
|
-
reason:
|
|
489
|
+
actionId: z5.string().uuid().default(() => crypto.randomUUID()),
|
|
490
|
+
expectedRevision: z5.number().int().nonnegative(),
|
|
491
|
+
reason: z5.string().trim().min(1).max(500)
|
|
407
492
|
};
|
|
408
|
-
var inventoryItemActionSchema =
|
|
409
|
-
var inventoryItemRenameSchema =
|
|
493
|
+
var inventoryItemActionSchema = z5.strictObject(correction);
|
|
494
|
+
var inventoryItemRenameSchema = z5.strictObject({
|
|
410
495
|
...correction,
|
|
411
|
-
name:
|
|
496
|
+
name: z5.string().trim().min(1).max(200)
|
|
412
497
|
});
|
|
413
|
-
var inventoryStockCorrectionSchema =
|
|
498
|
+
var inventoryStockCorrectionSchema = z5.strictObject({
|
|
414
499
|
...correction,
|
|
415
|
-
delta:
|
|
500
|
+
delta: z5.number().int().safe()
|
|
416
501
|
});
|
|
417
|
-
var inventoryItemPageSchema =
|
|
418
|
-
items:
|
|
502
|
+
var inventoryItemPageSchema = z5.object({
|
|
503
|
+
items: z5.array(inventoryItemStateSchema),
|
|
419
504
|
nextCursor: pageCursorSchema.nullable()
|
|
420
505
|
});
|
|
421
506
|
|
|
422
507
|
// src/server/quest-enrollments.ts
|
|
423
|
-
import * as
|
|
508
|
+
import * as z6 from "zod";
|
|
424
509
|
var questEnrollmentStateSchema = questEnrollmentSchema.extend({
|
|
425
|
-
revision:
|
|
426
|
-
withdrawnAt:
|
|
427
|
-
withdrawalReason:
|
|
510
|
+
revision: z6.number().int().nonnegative(),
|
|
511
|
+
withdrawnAt: z6.number().int().safe().nonnegative().nullable(),
|
|
512
|
+
withdrawalReason: z6.string().nullable()
|
|
428
513
|
});
|
|
429
514
|
var managedQuestEnrollmentSchema = questEnrollmentStateSchema.extend({
|
|
430
|
-
title:
|
|
431
|
-
key:
|
|
515
|
+
title: z6.string(),
|
|
516
|
+
key: z6.string().nullable()
|
|
432
517
|
});
|
|
433
|
-
var questEnrollmentWithdrawalInputSchema =
|
|
434
|
-
actionId:
|
|
435
|
-
expectedRevision:
|
|
436
|
-
reason:
|
|
518
|
+
var questEnrollmentWithdrawalInputSchema = z6.object({
|
|
519
|
+
actionId: z6.string().uuid().default(() => crypto.randomUUID()),
|
|
520
|
+
expectedRevision: z6.number().int().nonnegative(),
|
|
521
|
+
reason: z6.string().trim().min(1).max(500)
|
|
437
522
|
}).strict();
|
|
438
|
-
var managedQuestEnrollmentPageSchema =
|
|
439
|
-
items:
|
|
523
|
+
var managedQuestEnrollmentPageSchema = z6.object({
|
|
524
|
+
items: z6.array(managedQuestEnrollmentSchema),
|
|
440
525
|
nextCursor: pageCursorSchema.nullable()
|
|
441
526
|
});
|
|
442
527
|
|
|
443
528
|
// src/server/test-members.ts
|
|
444
|
-
import * as
|
|
445
|
-
var testMemberWalletSchema =
|
|
529
|
+
import * as z7 from "zod";
|
|
530
|
+
var testMemberWalletSchema = z7.object({
|
|
446
531
|
chain: walletChainSchema,
|
|
447
532
|
/** CAIP-2 network, Cosmos only. */
|
|
448
533
|
network: cosmosNetworkSchema.nullable(),
|
|
449
|
-
address:
|
|
534
|
+
address: z7.string()
|
|
450
535
|
});
|
|
451
|
-
var testMemberAccountSchema =
|
|
452
|
-
provider:
|
|
536
|
+
var testMemberAccountSchema = z7.object({
|
|
537
|
+
provider: z7.enum(["x", "discord"]),
|
|
453
538
|
/** The X user ID or Discord user ID. */
|
|
454
|
-
id:
|
|
539
|
+
id: z7.string(),
|
|
455
540
|
/** The X handle, when the account was linked by username; otherwise null. */
|
|
456
|
-
username:
|
|
541
|
+
username: z7.string().nullable(),
|
|
457
542
|
/**
|
|
458
543
|
* `linked`: an operator linked a real account with `linkAccount`. `synthetic`: the account Relay
|
|
459
544
|
* linked for synthetic records. `connected`: the member connected it through X or Discord while
|
|
460
545
|
* a staging site acted as them.
|
|
461
546
|
*/
|
|
462
|
-
source:
|
|
547
|
+
source: z7.enum(["linked", "synthetic", "connected"])
|
|
463
548
|
});
|
|
464
|
-
var testMemberSchema =
|
|
549
|
+
var testMemberSchema = z7.object({
|
|
465
550
|
id: identifier,
|
|
466
|
-
name:
|
|
467
|
-
test:
|
|
551
|
+
name: z7.string(),
|
|
552
|
+
test: z7.literal(true),
|
|
468
553
|
/** Current project-calendar date (YYYY-MM-DD), computed by the server. */
|
|
469
|
-
today:
|
|
554
|
+
today: z7.iso.date().optional(),
|
|
470
555
|
/** Number of calendar days advanced; absent means zero for older servers. */
|
|
471
|
-
offsetDays:
|
|
556
|
+
offsetDays: z7.number().int().min(0).optional(),
|
|
472
557
|
/** Linked wallet addresses, by chain then newest first; absent from older servers. */
|
|
473
|
-
wallets:
|
|
558
|
+
wallets: z7.array(testMemberWalletSchema).optional(),
|
|
474
559
|
/** Its X and Discord accounts, X first; absent from older servers. */
|
|
475
|
-
accounts:
|
|
560
|
+
accounts: z7.array(testMemberAccountSchema).optional()
|
|
476
561
|
});
|
|
477
|
-
var testMemberCreateSchema =
|
|
562
|
+
var testMemberCreateSchema = z7.object({
|
|
478
563
|
actionId: identifier,
|
|
479
|
-
name:
|
|
564
|
+
name: z7.string().trim().min(1).max(40)
|
|
480
565
|
}).strict();
|
|
481
566
|
var testMemberActionSchema = submitSchema.omit({ member: true, faultAfterReview: true }).extend({
|
|
482
|
-
operation:
|
|
567
|
+
operation: z7.literal("attempts.submit")
|
|
483
568
|
}).strict();
|
|
484
|
-
var testMemberPassSchema =
|
|
569
|
+
var testMemberPassSchema = z7.object({
|
|
485
570
|
actionId: identifier,
|
|
486
571
|
/** A manual quest, by key or ID. Automatic quests start from their tracker or schedule. */
|
|
487
572
|
quest: identifier,
|
|
@@ -492,77 +577,77 @@ var testMemberPassSchema = z6.object({
|
|
|
492
577
|
*/
|
|
493
578
|
completionKey: completionKeySchema.optional()
|
|
494
579
|
}).strict();
|
|
495
|
-
var testMemberAcceptAnywaySchema =
|
|
580
|
+
var testMemberAcceptAnywaySchema = z7.object({
|
|
496
581
|
actionId: identifier,
|
|
497
582
|
attempt: identifier
|
|
498
583
|
}).strict();
|
|
499
|
-
var testMemberReferralAcceptSchema =
|
|
500
|
-
|
|
501
|
-
|
|
584
|
+
var testMemberReferralAcceptSchema = z7.union([
|
|
585
|
+
z7.object({ actionId: identifier, code: identifier }).strict(),
|
|
586
|
+
z7.object({ actionId: identifier, inviter: identifier }).strict()
|
|
502
587
|
]);
|
|
503
|
-
var testMemberResetSchema =
|
|
504
|
-
var testMemberAdvanceSchema =
|
|
588
|
+
var testMemberResetSchema = z7.object({ actionId: identifier }).strict();
|
|
589
|
+
var testMemberAdvanceSchema = z7.object({
|
|
505
590
|
actionId: identifier,
|
|
506
|
-
days:
|
|
591
|
+
days: z7.number().int().min(1).max(30)
|
|
507
592
|
}).strict();
|
|
508
|
-
var testMemberResetResultSchema =
|
|
593
|
+
var testMemberResetResultSchema = z7.object({
|
|
509
594
|
member: identifier,
|
|
510
|
-
deleted:
|
|
595
|
+
deleted: z7.literal(true)
|
|
511
596
|
});
|
|
512
|
-
var testMemberWalletLinkSchema =
|
|
513
|
-
|
|
597
|
+
var testMemberWalletLinkSchema = z7.discriminatedUnion("chain", [
|
|
598
|
+
z7.object({
|
|
514
599
|
actionId: identifier,
|
|
515
|
-
chain:
|
|
600
|
+
chain: z7.literal("solana"),
|
|
516
601
|
address: solanaAddressSchema
|
|
517
602
|
}).strict(),
|
|
518
|
-
|
|
603
|
+
z7.object({
|
|
519
604
|
actionId: identifier,
|
|
520
|
-
chain:
|
|
605
|
+
chain: z7.literal("eip155"),
|
|
521
606
|
address: evmAddressSchema
|
|
522
607
|
}).strict(),
|
|
523
|
-
|
|
608
|
+
z7.object({
|
|
524
609
|
actionId: identifier,
|
|
525
|
-
chain:
|
|
610
|
+
chain: z7.literal("cosmos"),
|
|
526
611
|
network: cosmosNetworkSchema,
|
|
527
612
|
address: cosmosAddressSchema
|
|
528
613
|
}).strict()
|
|
529
614
|
]);
|
|
530
|
-
var testMemberWalletUnlinkSchema =
|
|
615
|
+
var testMemberWalletUnlinkSchema = z7.object({
|
|
531
616
|
actionId: identifier,
|
|
532
617
|
chain: walletChainSchema,
|
|
533
|
-
address:
|
|
618
|
+
address: z7.string().min(1).max(100)
|
|
534
619
|
}).strict();
|
|
535
|
-
var snowflake =
|
|
536
|
-
var accountId =
|
|
537
|
-
var testMemberAccountLinkSchema =
|
|
538
|
-
|
|
620
|
+
var snowflake = z7.string().regex(/^[0-9]{1,20}$/);
|
|
621
|
+
var accountId = z7.string().regex(/^[0-9]{1,20}$/, "Use the numeric user ID");
|
|
622
|
+
var testMemberAccountLinkSchema = z7.union([
|
|
623
|
+
z7.object({
|
|
539
624
|
actionId: identifier,
|
|
540
|
-
provider:
|
|
625
|
+
provider: z7.enum(["x", "discord"]),
|
|
541
626
|
id: accountId
|
|
542
627
|
}).strict(),
|
|
543
|
-
|
|
628
|
+
z7.object({
|
|
544
629
|
actionId: identifier,
|
|
545
|
-
provider:
|
|
630
|
+
provider: z7.literal("x"),
|
|
546
631
|
username: xUsernameSchema
|
|
547
632
|
}).strict()
|
|
548
633
|
]);
|
|
549
|
-
var testMemberAccountUnlinkSchema =
|
|
634
|
+
var testMemberAccountUnlinkSchema = z7.object({
|
|
550
635
|
actionId: identifier,
|
|
551
|
-
provider:
|
|
636
|
+
provider: z7.enum(["x", "discord"]),
|
|
552
637
|
id: accountId
|
|
553
638
|
}).strict();
|
|
554
|
-
var metric =
|
|
555
|
-
var testMemberXPostSchema =
|
|
556
|
-
content:
|
|
557
|
-
author:
|
|
639
|
+
var metric = z7.number().int().nonnegative().safe();
|
|
640
|
+
var testMemberXPostSchema = z7.strictObject({
|
|
641
|
+
content: z7.string().max(4e3).default(""),
|
|
642
|
+
author: z7.strictObject({
|
|
558
643
|
/** Defaults to `test_` and the end of the synthetic account ID. */
|
|
559
|
-
username:
|
|
644
|
+
username: z7.string().min(1).max(50).optional(),
|
|
560
645
|
/** Defaults to the test member's name. */
|
|
561
|
-
name:
|
|
646
|
+
name: z7.string().min(1).max(100).optional()
|
|
562
647
|
}).default({}),
|
|
563
|
-
isReply:
|
|
564
|
-
isRetweet:
|
|
565
|
-
isQuoteTweet:
|
|
648
|
+
isReply: z7.boolean().default(false),
|
|
649
|
+
isRetweet: z7.boolean().default(false),
|
|
650
|
+
isQuoteTweet: z7.boolean().default(false),
|
|
566
651
|
likeCount: metric.default(0),
|
|
567
652
|
replyCount: metric.default(0),
|
|
568
653
|
retweetCount: metric.default(0),
|
|
@@ -570,23 +655,23 @@ var testMemberXPostSchema = z6.strictObject({
|
|
|
570
655
|
viewCount: metric.default(0),
|
|
571
656
|
bookmarkCount: metric.default(0)
|
|
572
657
|
});
|
|
573
|
-
var testMemberDiscordMessageSchema =
|
|
658
|
+
var testMemberDiscordMessageSchema = z7.strictObject({
|
|
574
659
|
channelId: snowflake.optional(),
|
|
575
660
|
replyTo: snowflake.nullable().default(null),
|
|
576
|
-
text:
|
|
661
|
+
text: z7.string().max(4e3).optional()
|
|
577
662
|
});
|
|
578
|
-
var testMemberDiscordReactionSchema =
|
|
663
|
+
var testMemberDiscordReactionSchema = z7.strictObject({
|
|
579
664
|
channelId: snowflake.optional(),
|
|
580
665
|
messageId: snowflake.optional(),
|
|
581
|
-
emoji:
|
|
666
|
+
emoji: z7.strictObject({
|
|
582
667
|
/** A custom emoji's ID, or null for a Unicode emoji. */
|
|
583
668
|
id: snowflake.nullable().default(null),
|
|
584
|
-
name:
|
|
669
|
+
name: z7.string().min(1).max(100)
|
|
585
670
|
}).default({ id: null, name: "\u{1F44D}" }),
|
|
586
|
-
reactorRoles:
|
|
587
|
-
messagePublishedAt:
|
|
671
|
+
reactorRoles: z7.array(snowflake).max(50).default([]),
|
|
672
|
+
messagePublishedAt: z7.number().int().nonnegative().safe().optional()
|
|
588
673
|
});
|
|
589
|
-
var testMemberRecordSchema =
|
|
674
|
+
var testMemberRecordSchema = z7.object({
|
|
590
675
|
actionId: identifier,
|
|
591
676
|
/** A managed X or Discord tracker, by key or ID. */
|
|
592
677
|
tracker: identifier,
|
|
@@ -594,16 +679,16 @@ var testMemberRecordSchema = z6.object({
|
|
|
594
679
|
* The record account the test member holds. `messageAuthor` (Discord reactions only) makes the
|
|
595
680
|
* member the reacted-to message's author, and the reactor a synthetic account no member holds.
|
|
596
681
|
*/
|
|
597
|
-
as:
|
|
598
|
-
data:
|
|
682
|
+
as: z7.enum(["author", "messageAuthor"]).default("author"),
|
|
683
|
+
data: z7.record(z7.string(), z7.json()).default({})
|
|
599
684
|
}).strict();
|
|
600
685
|
var testMemberRecordResultSchema = trackerIngestResultSchema.extend({
|
|
601
686
|
/** The tracker's stable ID. */
|
|
602
687
|
tracker: identifier,
|
|
603
688
|
/** The stored record's ID. */
|
|
604
|
-
record:
|
|
689
|
+
record: z7.string(),
|
|
605
690
|
/** The account the record names for the test member: its linked one, else its synthetic one. */
|
|
606
|
-
account:
|
|
691
|
+
account: z7.object({ kind: z7.enum(["x", "discord"]), id: z7.string() })
|
|
607
692
|
});
|
|
608
693
|
var TestMemberDecisionKind = {
|
|
609
694
|
/** `testMembers.pass`: the quest's check never ran. */
|
|
@@ -611,113 +696,113 @@ var TestMemberDecisionKind = {
|
|
|
611
696
|
/** `testMembers.acceptAnyway`: the attempt was rejected, then accepted. */
|
|
612
697
|
AcceptAnyway: "accept-anyway"
|
|
613
698
|
};
|
|
614
|
-
var testMemberDecisionKindSchema =
|
|
615
|
-
var testMemberOperatorDecisionSchema =
|
|
699
|
+
var testMemberDecisionKindSchema = z7.string();
|
|
700
|
+
var testMemberOperatorDecisionSchema = z7.object({
|
|
616
701
|
kind: testMemberDecisionKindSchema,
|
|
617
702
|
/** The operator who decided, as audit history names them. */
|
|
618
|
-
actor:
|
|
619
|
-
at:
|
|
703
|
+
actor: z7.string().nullable(),
|
|
704
|
+
at: z7.number().int().nonnegative().safe()
|
|
620
705
|
});
|
|
621
|
-
var testMemberHistoryQuerySchema =
|
|
706
|
+
var testMemberHistoryQuerySchema = z7.object({
|
|
622
707
|
/** Inclusive lower bound on credited activity time, in epoch milliseconds. */
|
|
623
|
-
since:
|
|
708
|
+
since: z7.coerce.number().int().nonnegative().safe().optional()
|
|
624
709
|
});
|
|
625
|
-
var testMemberHistorySchema =
|
|
710
|
+
var testMemberHistorySchema = z7.object({
|
|
626
711
|
/** Newest credited activity first, up to 500 attempts. */
|
|
627
|
-
attempts:
|
|
712
|
+
attempts: z7.array(
|
|
628
713
|
attemptSchema.extend({
|
|
629
|
-
eligibleAt:
|
|
714
|
+
eligibleAt: z7.number().int().nonnegative().safe(),
|
|
630
715
|
/** Set when an operator decided the attempt in place of its evaluator; absent otherwise. */
|
|
631
716
|
operatorDecision: testMemberOperatorDecisionSchema.optional(),
|
|
632
717
|
/**
|
|
633
718
|
* Rewards of this attempt's completion that Relay never sent, each with why: a role reward
|
|
634
719
|
* for a test-linked Discord account. Absent when every reward was sent.
|
|
635
720
|
*/
|
|
636
|
-
rewardsNotSent:
|
|
721
|
+
rewardsNotSent: z7.array(z7.object({ reason: z7.string() })).optional()
|
|
637
722
|
})
|
|
638
723
|
),
|
|
639
724
|
/** Tracker trigger outcomes that admitted no attempt, newest occurrence first, up to 500. */
|
|
640
|
-
skipped:
|
|
641
|
-
|
|
725
|
+
skipped: z7.array(
|
|
726
|
+
z7.object({
|
|
642
727
|
quest: identifier,
|
|
643
728
|
tracker: identifier,
|
|
644
|
-
record:
|
|
645
|
-
code:
|
|
646
|
-
occurredAt:
|
|
729
|
+
record: z7.string(),
|
|
730
|
+
code: z7.string().min(1),
|
|
731
|
+
occurredAt: z7.number().int().nonnegative().safe()
|
|
647
732
|
})
|
|
648
733
|
),
|
|
649
734
|
/** False when older entries were omitted from either list. */
|
|
650
|
-
complete:
|
|
735
|
+
complete: z7.boolean()
|
|
651
736
|
});
|
|
652
737
|
|
|
653
738
|
// src/server/member-imports.ts
|
|
654
|
-
import * as
|
|
655
|
-
var importTimeSchema =
|
|
656
|
-
|
|
657
|
-
|
|
739
|
+
import * as z8 from "zod";
|
|
740
|
+
var importTimeSchema = z8.union([
|
|
741
|
+
z8.number().int().nonnegative().safe(),
|
|
742
|
+
z8.iso.datetime({ offset: true }).transform((value) => Date.parse(value))
|
|
658
743
|
]);
|
|
659
|
-
var importWalletSchema =
|
|
660
|
-
|
|
661
|
-
kind:
|
|
662
|
-
chain:
|
|
744
|
+
var importWalletSchema = z8.discriminatedUnion("chain", [
|
|
745
|
+
z8.object({
|
|
746
|
+
kind: z8.literal("wallet"),
|
|
747
|
+
chain: z8.literal("solana"),
|
|
663
748
|
address: solanaAddressSchema
|
|
664
749
|
}).strict(),
|
|
665
|
-
|
|
666
|
-
kind:
|
|
667
|
-
chain:
|
|
750
|
+
z8.object({
|
|
751
|
+
kind: z8.literal("wallet"),
|
|
752
|
+
chain: z8.literal("eip155"),
|
|
668
753
|
address: evmAddressSchema
|
|
669
754
|
}).strict(),
|
|
670
|
-
|
|
671
|
-
kind:
|
|
672
|
-
chain:
|
|
755
|
+
z8.object({
|
|
756
|
+
kind: z8.literal("wallet"),
|
|
757
|
+
chain: z8.literal("cosmos"),
|
|
673
758
|
network: cosmosNetworkSchema,
|
|
674
759
|
address: cosmosAddressSchema
|
|
675
760
|
}).strict()
|
|
676
761
|
]);
|
|
677
|
-
var importXSchema =
|
|
678
|
-
kind:
|
|
679
|
-
subject:
|
|
762
|
+
var importXSchema = z8.object({
|
|
763
|
+
kind: z8.literal("x"),
|
|
764
|
+
subject: z8.string().regex(/^[1-9][0-9]{0,19}$/, "Use the numeric X user ID")
|
|
680
765
|
}).strict();
|
|
681
|
-
var importAppIdentitySchema =
|
|
682
|
-
var memberImportIdentitySchema =
|
|
766
|
+
var importAppIdentitySchema = z8.object({ kind: appIdentityKindSchema, subject: z8.string().min(1).max(256) }).strict();
|
|
767
|
+
var memberImportIdentitySchema = z8.union([
|
|
683
768
|
importAppIdentitySchema,
|
|
684
769
|
importWalletSchema,
|
|
685
770
|
importXSchema
|
|
686
771
|
]);
|
|
687
|
-
var memberImportAccountSchema =
|
|
772
|
+
var memberImportAccountSchema = z8.union([
|
|
688
773
|
importWalletSchema,
|
|
689
774
|
importXSchema
|
|
690
775
|
]);
|
|
691
|
-
var memberImportActionSchema =
|
|
776
|
+
var memberImportActionSchema = z8.object({
|
|
692
777
|
at: importTimeSchema,
|
|
693
|
-
key:
|
|
778
|
+
key: z8.string().min(1).max(200).optional()
|
|
694
779
|
}).strict();
|
|
695
|
-
var memberImportRowSchema =
|
|
780
|
+
var memberImportRowSchema = z8.object({
|
|
696
781
|
/** The member's ID on the platform they come from. Unique within an import. */
|
|
697
|
-
ref:
|
|
782
|
+
ref: z8.string().trim().min(1).max(200),
|
|
698
783
|
identity: memberImportIdentitySchema,
|
|
699
|
-
accounts:
|
|
784
|
+
accounts: z8.array(memberImportAccountSchema).max(20).default([]),
|
|
700
785
|
/** Opening balances, credited once per ledger as an imported entry. */
|
|
701
|
-
points:
|
|
702
|
-
|
|
703
|
-
ledger:
|
|
704
|
-
balance:
|
|
786
|
+
points: z8.array(
|
|
787
|
+
z8.object({
|
|
788
|
+
ledger: z8.string().min(1).max(200),
|
|
789
|
+
balance: z8.number().int().positive().safe()
|
|
705
790
|
}).strict()
|
|
706
791
|
).max(50).default([]),
|
|
707
792
|
/** Quest progress, by quest authoring key or ID. */
|
|
708
|
-
quests:
|
|
709
|
-
|
|
710
|
-
quest:
|
|
711
|
-
actions:
|
|
793
|
+
quests: z8.array(
|
|
794
|
+
z8.object({
|
|
795
|
+
quest: z8.string().min(1).max(200),
|
|
796
|
+
actions: z8.array(memberImportActionSchema).min(1).max(3660)
|
|
712
797
|
}).strict()
|
|
713
798
|
).max(200).default([])
|
|
714
799
|
}).strict();
|
|
715
|
-
var memberImportCreateSchema =
|
|
800
|
+
var memberImportCreateSchema = z8.object({
|
|
716
801
|
actionId: identifier,
|
|
717
802
|
/** Where the members come from, such as "legacy-domino". */
|
|
718
|
-
source:
|
|
803
|
+
source: z8.string().trim().min(1).max(100)
|
|
719
804
|
}).strict();
|
|
720
|
-
var memberImportRowsInputSchema =
|
|
805
|
+
var memberImportRowsInputSchema = z8.object({ rows: z8.array(memberImportRowSchema).min(1).max(500) }).strict();
|
|
721
806
|
var MemberImportRefusalCode = {
|
|
722
807
|
/** An account or identity belongs to another member in the project. */
|
|
723
808
|
AccountLinkedElsewhere: "account-linked-elsewhere",
|
|
@@ -744,57 +829,57 @@ var MemberImportRefusalCode = {
|
|
|
744
829
|
/** The row names one point ledger or quest twice, by any of its names. */
|
|
745
830
|
DuplicateEntry: "duplicate-entry"
|
|
746
831
|
};
|
|
747
|
-
var refusalCodeSchema =
|
|
748
|
-
var memberImportRefusalSchema =
|
|
832
|
+
var refusalCodeSchema = z8.string();
|
|
833
|
+
var memberImportRefusalSchema = z8.object({
|
|
749
834
|
code: refusalCodeSchema,
|
|
750
|
-
message:
|
|
835
|
+
message: z8.string()
|
|
751
836
|
});
|
|
752
|
-
var memberImportRowResultSchema =
|
|
753
|
-
line:
|
|
754
|
-
ref:
|
|
755
|
-
status:
|
|
837
|
+
var memberImportRowResultSchema = z8.object({
|
|
838
|
+
line: z8.number().int().positive(),
|
|
839
|
+
ref: z8.string(),
|
|
840
|
+
status: z8.enum(["pending", "ready", "applied", "refused"]),
|
|
756
841
|
/** The member the row resolves to: an existing member, or the one applying created. */
|
|
757
842
|
member: identifier.nullable(),
|
|
758
843
|
/** Whether the row's identity names a member who already exists. Null until checked. */
|
|
759
|
-
existing:
|
|
760
|
-
refusals:
|
|
844
|
+
existing: z8.boolean().nullable(),
|
|
845
|
+
refusals: z8.array(memberImportRefusalSchema)
|
|
761
846
|
});
|
|
762
|
-
var memberImportRowPageSchema =
|
|
763
|
-
items:
|
|
764
|
-
nextCursor:
|
|
847
|
+
var memberImportRowPageSchema = z8.object({
|
|
848
|
+
items: z8.array(memberImportRowResultSchema),
|
|
849
|
+
nextCursor: z8.string().nullable()
|
|
765
850
|
});
|
|
766
|
-
var memberImportRowQuerySchema =
|
|
767
|
-
status:
|
|
768
|
-
cursor:
|
|
769
|
-
limit:
|
|
851
|
+
var memberImportRowQuerySchema = z8.object({
|
|
852
|
+
status: z8.enum(["pending", "ready", "applied", "refused"]).optional(),
|
|
853
|
+
cursor: z8.string().max(200).optional(),
|
|
854
|
+
limit: z8.coerce.number().int().min(1).max(500).optional()
|
|
770
855
|
}).strict();
|
|
771
|
-
var memberImportSummarySchema =
|
|
772
|
-
rows:
|
|
773
|
-
ready:
|
|
774
|
-
refused:
|
|
775
|
-
members:
|
|
776
|
-
created:
|
|
777
|
-
existing:
|
|
856
|
+
var memberImportSummarySchema = z8.object({
|
|
857
|
+
rows: z8.number().int().nonnegative(),
|
|
858
|
+
ready: z8.number().int().nonnegative(),
|
|
859
|
+
refused: z8.number().int().nonnegative(),
|
|
860
|
+
members: z8.object({
|
|
861
|
+
created: z8.number().int().nonnegative(),
|
|
862
|
+
existing: z8.number().int().nonnegative()
|
|
778
863
|
}),
|
|
779
864
|
/** Identities and accounts the ready rows attach, sign-in identities included. */
|
|
780
|
-
accounts:
|
|
865
|
+
accounts: z8.number().int().nonnegative(),
|
|
781
866
|
/** Opening balance totals, by ledger as the rows name it. */
|
|
782
|
-
points:
|
|
783
|
-
|
|
867
|
+
points: z8.array(
|
|
868
|
+
z8.object({ ledger: z8.string(), total: z8.number().int().nonnegative() })
|
|
784
869
|
),
|
|
785
870
|
/** Imported actions, by quest as the rows name it. */
|
|
786
|
-
actions:
|
|
787
|
-
|
|
871
|
+
actions: z8.array(
|
|
872
|
+
z8.object({ quest: z8.string(), total: z8.number().int().nonnegative() })
|
|
788
873
|
),
|
|
789
874
|
/** Refused rows, by refusal code. A row can have several. */
|
|
790
|
-
refusals:
|
|
791
|
-
|
|
875
|
+
refusals: z8.array(
|
|
876
|
+
z8.object({ code: refusalCodeSchema, rows: z8.number().int().nonnegative() })
|
|
792
877
|
)
|
|
793
878
|
});
|
|
794
|
-
var memberImportSchema =
|
|
879
|
+
var memberImportSchema = z8.object({
|
|
795
880
|
id: identifier,
|
|
796
|
-
source:
|
|
797
|
-
status:
|
|
881
|
+
source: z8.string(),
|
|
882
|
+
status: z8.enum([
|
|
798
883
|
"open",
|
|
799
884
|
"checking",
|
|
800
885
|
"checked",
|
|
@@ -802,115 +887,115 @@ var memberImportSchema = z7.object({
|
|
|
802
887
|
"applied",
|
|
803
888
|
"canceled"
|
|
804
889
|
]),
|
|
805
|
-
rows:
|
|
890
|
+
rows: z8.number().int().nonnegative(),
|
|
806
891
|
/** The latest check's summary, or null before the first check and after rows change. */
|
|
807
892
|
summary: memberImportSummarySchema.nullable(),
|
|
808
893
|
/** While applying and after: rows applied and refused so far. */
|
|
809
|
-
progress:
|
|
810
|
-
applied:
|
|
811
|
-
refused:
|
|
894
|
+
progress: z8.object({
|
|
895
|
+
applied: z8.number().int().nonnegative(),
|
|
896
|
+
refused: z8.number().int().nonnegative()
|
|
812
897
|
}),
|
|
813
|
-
createdAt:
|
|
814
|
-
createdBy:
|
|
815
|
-
checkedAt:
|
|
816
|
-
appliedAt:
|
|
817
|
-
appliedBy:
|
|
818
|
-
canceledAt:
|
|
819
|
-
canceledBy:
|
|
820
|
-
});
|
|
821
|
-
var memberImportPageSchema =
|
|
822
|
-
items:
|
|
823
|
-
nextCursor:
|
|
824
|
-
});
|
|
825
|
-
var memberImportListQuerySchema =
|
|
826
|
-
cursor:
|
|
827
|
-
limit:
|
|
898
|
+
createdAt: z8.number().int(),
|
|
899
|
+
createdBy: z8.string().nullable(),
|
|
900
|
+
checkedAt: z8.number().int().nullable(),
|
|
901
|
+
appliedAt: z8.number().int().nullable(),
|
|
902
|
+
appliedBy: z8.string().nullable(),
|
|
903
|
+
canceledAt: z8.number().int().nullable(),
|
|
904
|
+
canceledBy: z8.string().nullable()
|
|
905
|
+
});
|
|
906
|
+
var memberImportPageSchema = z8.object({
|
|
907
|
+
items: z8.array(memberImportSchema),
|
|
908
|
+
nextCursor: z8.string().nullable()
|
|
909
|
+
});
|
|
910
|
+
var memberImportListQuerySchema = z8.object({
|
|
911
|
+
cursor: z8.string().max(200).optional(),
|
|
912
|
+
limit: z8.coerce.number().int().min(1).max(100).optional()
|
|
828
913
|
}).strict();
|
|
829
914
|
|
|
830
915
|
// src/server/webhooks.ts
|
|
831
|
-
import * as
|
|
916
|
+
import * as z9 from "zod";
|
|
832
917
|
var PayoutSourceKind = {
|
|
833
918
|
Quest: "quest",
|
|
834
919
|
Leaderboard: "leaderboard",
|
|
835
920
|
Engagement: "engagement",
|
|
836
921
|
Manual: "manual"
|
|
837
922
|
};
|
|
838
|
-
var webhookEventSchema =
|
|
839
|
-
id:
|
|
840
|
-
version:
|
|
923
|
+
var webhookEventSchema = z9.object({
|
|
924
|
+
id: z9.string().uuid(),
|
|
925
|
+
version: z9.literal(1),
|
|
841
926
|
type: activityTypeSchema,
|
|
842
|
-
createdAt:
|
|
843
|
-
organization:
|
|
844
|
-
project:
|
|
845
|
-
environment:
|
|
846
|
-
data:
|
|
847
|
-
});
|
|
848
|
-
var webhookControlInputSchema =
|
|
849
|
-
var webhookInputSchema =
|
|
850
|
-
url:
|
|
927
|
+
createdAt: z9.number().int().nonnegative(),
|
|
928
|
+
organization: z9.string(),
|
|
929
|
+
project: z9.string(),
|
|
930
|
+
environment: z9.enum(["test", "live"]),
|
|
931
|
+
data: z9.record(z9.string(), z9.json())
|
|
932
|
+
});
|
|
933
|
+
var webhookControlInputSchema = z9.object({ actionId: z9.string().uuid().optional() }).strict();
|
|
934
|
+
var webhookInputSchema = z9.object({
|
|
935
|
+
url: z9.url().max(2048).refine((value) => {
|
|
851
936
|
const url2 = new URL(value);
|
|
852
937
|
return url2.protocol === "https:" && !url2.username && !url2.password && !url2.hash;
|
|
853
938
|
}, "Use an HTTPS URL without credentials or a fragment"),
|
|
854
|
-
types:
|
|
939
|
+
types: z9.array(activityTypeSchema).min(1).max(100).refine((v) => new Set(v).size === v.length)
|
|
855
940
|
}).strict();
|
|
856
|
-
var webhookCreateInputSchema = webhookInputSchema.extend({ actionId:
|
|
857
|
-
var webhookRotateInputSchema =
|
|
858
|
-
var webhookUpdateSchema = webhookInputSchema.partial().extend({ enabled:
|
|
859
|
-
var webhookEndpointSchema =
|
|
941
|
+
var webhookCreateInputSchema = webhookInputSchema.extend({ actionId: z9.string().uuid().optional() }).strict();
|
|
942
|
+
var webhookRotateInputSchema = z9.object({ actionId: z9.string().uuid().optional() }).strict();
|
|
943
|
+
var webhookUpdateSchema = webhookInputSchema.partial().extend({ enabled: z9.boolean().optional() }).strict();
|
|
944
|
+
var webhookEndpointSchema = z9.object({
|
|
860
945
|
...webhookInputSchema.shape,
|
|
861
|
-
id:
|
|
862
|
-
enabled:
|
|
863
|
-
disabledReason:
|
|
864
|
-
consecutiveFailures:
|
|
865
|
-
createdAt:
|
|
866
|
-
updatedAt:
|
|
946
|
+
id: z9.string().uuid(),
|
|
947
|
+
enabled: z9.boolean(),
|
|
948
|
+
disabledReason: z9.string().nullable(),
|
|
949
|
+
consecutiveFailures: z9.number().int().nonnegative(),
|
|
950
|
+
createdAt: z9.number(),
|
|
951
|
+
updatedAt: z9.number()
|
|
867
952
|
});
|
|
868
953
|
var webhookEndpointStateSchema = webhookEndpointSchema.extend({
|
|
869
|
-
revision:
|
|
870
|
-
deletedAt:
|
|
954
|
+
revision: z9.number().int().nonnegative(),
|
|
955
|
+
deletedAt: z9.number().int().safe().nonnegative().nullable()
|
|
871
956
|
});
|
|
872
|
-
var webhookDeleteInputSchema =
|
|
873
|
-
actionId:
|
|
874
|
-
expectedRevision:
|
|
875
|
-
reason:
|
|
957
|
+
var webhookDeleteInputSchema = z9.strictObject({
|
|
958
|
+
actionId: z9.string().uuid().default(() => crypto.randomUUID()),
|
|
959
|
+
expectedRevision: z9.number().int().nonnegative(),
|
|
960
|
+
reason: z9.string().trim().min(1).max(500)
|
|
876
961
|
});
|
|
877
|
-
var webhookStateQuerySchema =
|
|
962
|
+
var webhookStateQuerySchema = z9.strictObject({
|
|
878
963
|
cursor: pageCursorSchema.optional(),
|
|
879
|
-
limit:
|
|
964
|
+
limit: z9.coerce.number().int().min(1).max(100).default(50)
|
|
880
965
|
});
|
|
881
|
-
var webhookStatePageSchema =
|
|
882
|
-
items:
|
|
966
|
+
var webhookStatePageSchema = z9.object({
|
|
967
|
+
items: z9.array(webhookEndpointStateSchema),
|
|
883
968
|
nextCursor: pageCursorSchema.nullable()
|
|
884
969
|
});
|
|
885
|
-
var webhookSecretSchema =
|
|
970
|
+
var webhookSecretSchema = z9.object({
|
|
886
971
|
endpoint: webhookEndpointSchema,
|
|
887
|
-
secret:
|
|
888
|
-
previousValidUntil:
|
|
972
|
+
secret: z9.string(),
|
|
973
|
+
previousValidUntil: z9.number().nullable()
|
|
889
974
|
});
|
|
890
|
-
var webhookDeliverySchema =
|
|
891
|
-
id:
|
|
892
|
-
endpoint:
|
|
975
|
+
var webhookDeliverySchema = z9.object({
|
|
976
|
+
id: z9.string().uuid(),
|
|
977
|
+
endpoint: z9.string().uuid(),
|
|
893
978
|
event: webhookEventSchema,
|
|
894
|
-
status:
|
|
895
|
-
attempts:
|
|
896
|
-
responseStatus:
|
|
897
|
-
lastError:
|
|
898
|
-
createdAt:
|
|
899
|
-
deliveredAt:
|
|
900
|
-
replayOf:
|
|
901
|
-
});
|
|
902
|
-
var webhookQuerySchema =
|
|
979
|
+
status: z9.enum(["pending", "delivered", "failed", "skipped"]),
|
|
980
|
+
attempts: z9.number().int().nonnegative(),
|
|
981
|
+
responseStatus: z9.number().nullable(),
|
|
982
|
+
lastError: z9.string().nullable(),
|
|
983
|
+
createdAt: z9.number(),
|
|
984
|
+
deliveredAt: z9.number().nullable(),
|
|
985
|
+
replayOf: z9.string().uuid().nullable()
|
|
986
|
+
});
|
|
987
|
+
var webhookQuerySchema = z9.object({
|
|
903
988
|
/** A page's `nextCursor`: the deliveries after it, newest first. */
|
|
904
989
|
cursor: pageCursorSchema.optional(),
|
|
905
990
|
/** @deprecated Use `cursor`. Removed in 2.0.0. */
|
|
906
|
-
before:
|
|
907
|
-
limit:
|
|
991
|
+
before: z9.string().uuid().optional(),
|
|
992
|
+
limit: z9.coerce.number().int().min(1).max(100).default(50)
|
|
908
993
|
}).strict();
|
|
909
|
-
var webhookDeliveryPageSchema =
|
|
910
|
-
items:
|
|
994
|
+
var webhookDeliveryPageSchema = z9.object({
|
|
995
|
+
items: z9.array(webhookDeliverySchema),
|
|
911
996
|
nextCursor: pageCursorSchema.nullable().default(null),
|
|
912
997
|
/** @deprecated Use `nextCursor`, passed back as `cursor`. Removed in 2.0.0. */
|
|
913
|
-
next:
|
|
998
|
+
next: z9.string().uuid().nullable()
|
|
914
999
|
});
|
|
915
1000
|
var WEBHOOK_MAX_BYTES = 64 * 1024;
|
|
916
1001
|
async function verifyWebhook(input) {
|
|
@@ -922,13 +1007,13 @@ async function verifyWebhook(input) {
|
|
|
922
1007
|
}
|
|
923
1008
|
const parts = input.signature.split(",");
|
|
924
1009
|
const timestamps = parts.filter((part) => part.startsWith("t="));
|
|
925
|
-
const
|
|
1010
|
+
const timestamp2 = timestamps[0]?.slice(2) ?? "";
|
|
926
1011
|
const signatures = parts.filter((part) => /^v1=[a-f0-9]{64}$/.test(part)).map((part) => part.slice(3));
|
|
927
|
-
if (timestamps.length !== 1 || !/^\d{1,12}$/.test(
|
|
1012
|
+
if (timestamps.length !== 1 || !/^\d{1,12}$/.test(timestamp2) || Math.abs(now / 1e3 - Number(timestamp2)) > tolerance || signatures.length < 1 || signatures.length > 2) {
|
|
928
1013
|
throw new Error("Invalid or expired webhook signature");
|
|
929
1014
|
}
|
|
930
1015
|
const secrets = typeof input.secret === "string" ? [input.secret] : input.secret;
|
|
931
|
-
const message = new TextEncoder().encode(`${
|
|
1016
|
+
const message = new TextEncoder().encode(`${timestamp2}.${input.body}`);
|
|
932
1017
|
for (const secret of secrets) {
|
|
933
1018
|
if (!secret) {
|
|
934
1019
|
continue;
|
|
@@ -954,8 +1039,8 @@ async function verifyWebhook(input) {
|
|
|
954
1039
|
}
|
|
955
1040
|
|
|
956
1041
|
// src/server/resource-lifecycle.ts
|
|
957
|
-
import * as
|
|
958
|
-
var resourceLifecycleKindSchema =
|
|
1042
|
+
import * as z10 from "zod";
|
|
1043
|
+
var resourceLifecycleKindSchema = z10.enum([
|
|
959
1044
|
"tracker",
|
|
960
1045
|
"referral",
|
|
961
1046
|
"leaderboard",
|
|
@@ -965,24 +1050,24 @@ var resourceLifecycleKindSchema = z9.enum([
|
|
|
965
1050
|
"image",
|
|
966
1051
|
"point-ledger"
|
|
967
1052
|
]);
|
|
968
|
-
var managedResourceSchema =
|
|
1053
|
+
var managedResourceSchema = z10.object({
|
|
969
1054
|
kind: resourceLifecycleKindSchema,
|
|
970
1055
|
id: identifier,
|
|
971
1056
|
key: identifier.nullable(),
|
|
972
|
-
title:
|
|
973
|
-
archivedAt:
|
|
1057
|
+
title: z10.string(),
|
|
1058
|
+
archivedAt: z10.number().int().nonnegative().nullable()
|
|
974
1059
|
});
|
|
975
|
-
var resourceLifecycleInputSchema =
|
|
976
|
-
actionId:
|
|
1060
|
+
var resourceLifecycleInputSchema = z10.object({
|
|
1061
|
+
actionId: z10.string().uuid(),
|
|
977
1062
|
kind: resourceLifecycleKindSchema,
|
|
978
1063
|
resource: identifier,
|
|
979
|
-
archived:
|
|
980
|
-
reason:
|
|
981
|
-
expectedArchivedAt:
|
|
1064
|
+
archived: z10.boolean(),
|
|
1065
|
+
reason: z10.string().trim().min(1).max(500),
|
|
1066
|
+
expectedArchivedAt: z10.number().int().nonnegative().nullable().optional()
|
|
982
1067
|
}).strict();
|
|
983
|
-
var resourceLifecycleResultSchema =
|
|
1068
|
+
var resourceLifecycleResultSchema = z10.object({
|
|
984
1069
|
resource: managedResourceSchema,
|
|
985
|
-
changed:
|
|
1070
|
+
changed: z10.boolean()
|
|
986
1071
|
});
|
|
987
1072
|
var resourceLifecyclePaths = {
|
|
988
1073
|
tracker: "/trackers",
|
|
@@ -1001,8 +1086,8 @@ var resourceArchiveInputSchema = resourceLifecycleInputSchema.omit({
|
|
|
1001
1086
|
});
|
|
1002
1087
|
|
|
1003
1088
|
// src/server/promotions.ts
|
|
1004
|
-
import * as
|
|
1005
|
-
var promotionResourceKindSchema =
|
|
1089
|
+
import * as z11 from "zod";
|
|
1090
|
+
var promotionResourceKindSchema = z11.enum([
|
|
1006
1091
|
"quest",
|
|
1007
1092
|
"quest-type",
|
|
1008
1093
|
"collection",
|
|
@@ -1021,268 +1106,257 @@ var promotionResourceKindSchema = z10.enum([
|
|
|
1021
1106
|
"profile-settings",
|
|
1022
1107
|
"app-build"
|
|
1023
1108
|
]);
|
|
1024
|
-
var promotionChangeSchema =
|
|
1025
|
-
kind:
|
|
1026
|
-
key:
|
|
1027
|
-
title:
|
|
1109
|
+
var promotionChangeSchema = z11.object({
|
|
1110
|
+
kind: z11.union([promotionResourceKindSchema, z11.string()]),
|
|
1111
|
+
key: z11.string(),
|
|
1112
|
+
title: z11.string(),
|
|
1028
1113
|
/** `added`: new in live. `changed`: live's differs. `archived` and `unarchived` change only its lifecycle. */
|
|
1029
|
-
change:
|
|
1030
|
-
|
|
1031
|
-
|
|
1114
|
+
change: z11.union([
|
|
1115
|
+
z11.enum(["added", "changed", "archived", "unarchived"]),
|
|
1116
|
+
z11.string()
|
|
1032
1117
|
])
|
|
1033
1118
|
});
|
|
1034
|
-
var promotionWarningSchema =
|
|
1035
|
-
code:
|
|
1036
|
-
message:
|
|
1037
|
-
kind:
|
|
1038
|
-
key:
|
|
1119
|
+
var promotionWarningSchema = z11.object({
|
|
1120
|
+
code: z11.string(),
|
|
1121
|
+
message: z11.string(),
|
|
1122
|
+
kind: z11.string().optional(),
|
|
1123
|
+
key: z11.string().optional()
|
|
1039
1124
|
});
|
|
1040
|
-
var promotionBuildSchema =
|
|
1125
|
+
var promotionBuildSchema = z11.object({
|
|
1041
1126
|
repository: identifier,
|
|
1042
1127
|
build: identifier
|
|
1043
1128
|
});
|
|
1044
|
-
var promotionSourceSchema =
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1129
|
+
var promotionSourceSchema = z11.discriminatedUnion("kind", [
|
|
1130
|
+
z11.object({ kind: z11.literal("test") }),
|
|
1131
|
+
z11.object({ kind: z11.literal("rollback"), promotion: identifier }),
|
|
1132
|
+
z11.object({ kind: z11.literal("deployment"), deployment: identifier })
|
|
1048
1133
|
]);
|
|
1049
1134
|
var promotionMetadata = {
|
|
1050
1135
|
id: identifier,
|
|
1051
1136
|
source: promotionSourceSchema,
|
|
1052
|
-
changes:
|
|
1053
|
-
warnings:
|
|
1137
|
+
changes: z11.array(promotionChangeSchema),
|
|
1138
|
+
warnings: z11.array(promotionWarningSchema),
|
|
1054
1139
|
build: promotionBuildSchema.nullable(),
|
|
1055
|
-
createdAt:
|
|
1056
|
-
createdBy:
|
|
1140
|
+
createdAt: z11.number().int().nonnegative(),
|
|
1141
|
+
createdBy: z11.string().nullable()
|
|
1057
1142
|
};
|
|
1058
1143
|
var decided = {
|
|
1059
|
-
decidedAt:
|
|
1060
|
-
decidedBy:
|
|
1144
|
+
decidedAt: z11.number().int().nonnegative(),
|
|
1145
|
+
decidedBy: z11.string().nullable()
|
|
1061
1146
|
};
|
|
1062
|
-
var promotionRecordSchema =
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1147
|
+
var promotionRecordSchema = z11.discriminatedUnion("status", [
|
|
1148
|
+
z11.object({ ...promotionMetadata, status: z11.literal("pending") }),
|
|
1149
|
+
z11.object({ ...promotionMetadata, ...decided, status: z11.literal("applied") }),
|
|
1150
|
+
z11.object({
|
|
1066
1151
|
...promotionMetadata,
|
|
1067
1152
|
...decided,
|
|
1068
|
-
status:
|
|
1069
|
-
reason:
|
|
1153
|
+
status: z11.literal("rejected"),
|
|
1154
|
+
reason: z11.string()
|
|
1070
1155
|
}),
|
|
1071
|
-
|
|
1156
|
+
z11.object({
|
|
1072
1157
|
...promotionMetadata,
|
|
1073
1158
|
...decided,
|
|
1074
|
-
status:
|
|
1159
|
+
status: z11.literal("superseded")
|
|
1075
1160
|
})
|
|
1076
1161
|
]);
|
|
1077
|
-
var promotionActionSchema =
|
|
1078
|
-
var promotionRejectionSchema =
|
|
1079
|
-
var promotionHistoryQuerySchema =
|
|
1162
|
+
var promotionActionSchema = z11.object({ actionId: z11.string().uuid() }).strict();
|
|
1163
|
+
var promotionRejectionSchema = z11.object({ reason: z11.string().trim().min(1).max(1e3) }).strict();
|
|
1164
|
+
var promotionHistoryQuerySchema = z11.strictObject({
|
|
1080
1165
|
cursor: pageCursorSchema.optional(),
|
|
1081
|
-
limit:
|
|
1166
|
+
limit: z11.coerce.number().int().min(1).max(100).optional()
|
|
1082
1167
|
});
|
|
1083
|
-
var promotionHistoryPageSchema =
|
|
1084
|
-
items:
|
|
1168
|
+
var promotionHistoryPageSchema = z11.object({
|
|
1169
|
+
items: z11.array(promotionRecordSchema),
|
|
1085
1170
|
nextCursor: pageCursorSchema.nullable()
|
|
1086
1171
|
});
|
|
1087
1172
|
|
|
1088
|
-
// src/server/
|
|
1089
|
-
import * as
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
var
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
);
|
|
1116
|
-
var
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
);
|
|
1132
|
-
var quest = once(
|
|
1133
|
-
() => z11.object({
|
|
1134
|
-
quest: identifier,
|
|
1135
|
-
title: z11.string(),
|
|
1136
|
-
/** Attempts created in the range. */
|
|
1137
|
-
attempts: amount(),
|
|
1138
|
-
/** Completions in the range that were never revoked. */
|
|
1139
|
-
completions: amount(),
|
|
1140
|
-
/** Attempts decided in the range: accepted, progressed or rejected. */
|
|
1141
|
-
decided: amount(),
|
|
1142
|
-
/** Attempts rejected in the range. */
|
|
1143
|
-
rejected: amount(),
|
|
1144
|
-
/** Attempts created in the range that went to staff review. */
|
|
1145
|
-
needsReview: amount(),
|
|
1146
|
-
/** `rejected ÷ decided`, or null below 10 decided attempts. */
|
|
1147
|
-
rejectionRate: z11.number().min(0).max(1).nullable(),
|
|
1148
|
-
/**
|
|
1149
|
-
* The 5 most common rejections, most frequent first. Rejections with a code (an evaluator's
|
|
1150
|
-
* reject code or one Relay writes, such as `budget-exhausted`) group by it, and `reason` is the
|
|
1151
|
-
* latest rejection's reason; rejections without one group by their exact reason.
|
|
1152
|
-
*/
|
|
1153
|
-
topReasons: z11.array(
|
|
1154
|
-
z11.object({
|
|
1155
|
-
reason: z11.string(),
|
|
1156
|
-
code: z11.string().nullable(),
|
|
1157
|
-
count: amount()
|
|
1158
|
-
})
|
|
1159
|
-
),
|
|
1160
|
-
/** Rejections by who made them: the evaluator, staff, an exhausted budget, an expired deferral. */
|
|
1161
|
-
rejectionsBySource: z11.object({
|
|
1162
|
-
evaluator: amount(),
|
|
1163
|
-
staff: amount(),
|
|
1164
|
-
budget: amount(),
|
|
1165
|
-
expired: amount()
|
|
1166
|
-
}),
|
|
1167
|
-
/** Attempts and completions per bucket. */
|
|
1168
|
-
series: z11.object({ attempts: amounts(), completions: amounts() })
|
|
1169
|
-
})
|
|
1170
|
-
);
|
|
1171
|
-
var analyticsReadSchema = z11.object(
|
|
1172
|
-
lazyShape({
|
|
1173
|
-
range: () => z11.object({
|
|
1174
|
-
key: z11.enum(analyticsRanges),
|
|
1175
|
-
from: instant(),
|
|
1176
|
-
/** Now, by the database's clock, when the read ran. */
|
|
1177
|
-
to: instant(),
|
|
1178
|
-
bucket: z11.enum(["day", "week"]),
|
|
1179
|
-
/** The project calendar's time zone now. Buckets before a time zone change follow the old one. */
|
|
1180
|
-
timeZone: z11.string(),
|
|
1181
|
-
buckets: z11.array(bucket())
|
|
1182
|
-
}),
|
|
1183
|
-
/** The range of equal length before this one, which `previousTotal` covers. Absent for `all`. */
|
|
1184
|
-
previous: () => z11.object({ from: instant(), to: instant() }).optional(),
|
|
1185
|
-
members: () => z11.object({
|
|
1186
|
-
/** Members who joined the project. */
|
|
1187
|
-
signUps: metric2(),
|
|
1188
|
-
/** Distinct members with an attempt; the total counts each member once over the range. */
|
|
1189
|
-
active: metric2()
|
|
1190
|
-
}),
|
|
1191
|
-
quests: () => z11.object({
|
|
1192
|
-
attempts: metric2(),
|
|
1193
|
-
completions: metric2(),
|
|
1194
|
-
rejections: metric2(),
|
|
1195
|
-
needsReview: metric2(),
|
|
1196
|
-
/** Quests with activity in the range, most attempted first. */
|
|
1197
|
-
byQuest: z11.array(quest())
|
|
1198
|
-
}),
|
|
1199
|
-
points: () => z11.object({
|
|
1200
|
-
/** The project's point ledgers, oldest first. */
|
|
1201
|
-
ledgers: z11.array(
|
|
1202
|
-
z11.object({ key: identifier, name: z11.string(), archived: z11.boolean() })
|
|
1203
|
-
),
|
|
1204
|
-
/** The ledger this section reads, or null when the project has none to read. */
|
|
1205
|
-
ledger: identifier.nullable(),
|
|
1206
|
-
/** Whether the ledger has a spend entry. `spent` and `net` are present only when it does. */
|
|
1207
|
-
hasSpending: z11.boolean(),
|
|
1208
|
-
/** Points in award entries. */
|
|
1209
|
-
awarded: metric2(),
|
|
1210
|
-
/** Points in spend entries, as a positive number. */
|
|
1211
|
-
spent: optionalMetric(),
|
|
1212
|
-
/** Every entry's signed amount: awards, spends, adjustments and reversals. */
|
|
1213
|
-
net: optionalMetric(),
|
|
1214
|
-
/** Distinct members awarded points; the total counts each member once over the range. */
|
|
1215
|
-
membersEarning: metric2()
|
|
1216
|
-
}),
|
|
1217
|
-
/** Fulfilled offer redemptions. Present only when the project has an offer. */
|
|
1218
|
-
offers: () => z11.object({
|
|
1219
|
-
redemptions: metric2(),
|
|
1220
|
-
/** Every offer, most redeemed first. */
|
|
1221
|
-
byOffer: z11.array(
|
|
1222
|
-
z11.object({
|
|
1223
|
-
offer: identifier,
|
|
1224
|
-
title: z11.string(),
|
|
1225
|
-
redemptions: amount(),
|
|
1226
|
-
series: amounts()
|
|
1227
|
-
})
|
|
1228
|
-
)
|
|
1229
|
-
}).optional(),
|
|
1230
|
-
/** Present only when the project has a referral program. */
|
|
1231
|
-
referrals: () => z11.object({
|
|
1232
|
-
/** Referrals accepted. */
|
|
1233
|
-
accepted: metric2(),
|
|
1234
|
-
/** Active qualifications, by when they first qualified; suspended referrals still count. */
|
|
1235
|
-
qualified: metric2(),
|
|
1236
|
-
/**
|
|
1237
|
-
* Of the referrals accepted in the range (and in the range before), how many have an
|
|
1238
|
-
* active qualification now, each counted once; suspended referrals still count.
|
|
1239
|
-
* `acceptedQualified.total ÷ accepted.total` is the share of the range's friends who have
|
|
1240
|
-
* qualified since, never above 1.
|
|
1241
|
-
*/
|
|
1242
|
-
acceptedQualified: z11.object({
|
|
1243
|
-
total: amount(),
|
|
1244
|
-
previousTotal: amount().optional()
|
|
1245
|
-
})
|
|
1246
|
-
}).optional(),
|
|
1247
|
-
/** Present only in the test environment. */
|
|
1248
|
-
testEnvironment: () => z11.object({
|
|
1249
|
-
/** When a test member was last reset, deleting their history, or null. */
|
|
1250
|
-
lastResetAt: instant().nullable(),
|
|
1251
|
-
/** Test members whose clock is advanced, so their activity can be dated in the future. */
|
|
1252
|
-
shiftedClockMembers: amount()
|
|
1253
|
-
}).optional()
|
|
1254
|
-
})
|
|
1255
|
-
);
|
|
1173
|
+
// src/server/dashboards.ts
|
|
1174
|
+
import * as z12 from "zod";
|
|
1175
|
+
var dashboardListQuerySchema = z12.strictObject({
|
|
1176
|
+
includeArchived: z12.union([z12.boolean(), z12.enum(["true", "false"])]).transform((value) => value === true || value === "true").optional()
|
|
1177
|
+
});
|
|
1178
|
+
var summaryFields = {
|
|
1179
|
+
key: identifier,
|
|
1180
|
+
title: z12.string(),
|
|
1181
|
+
description: z12.string().nullable(),
|
|
1182
|
+
/** Lists order by it, dashboards without one last, then by title. */
|
|
1183
|
+
position: z12.number().int().nullable(),
|
|
1184
|
+
archivedAt: z12.number().int().nonnegative().nullable(),
|
|
1185
|
+
/** When the current version was published. */
|
|
1186
|
+
updatedAt: z12.number().int().nonnegative()
|
|
1187
|
+
};
|
|
1188
|
+
var dashboardSummarySchema = z12.object(summaryFields);
|
|
1189
|
+
var dashboardListSchema = z12.array(dashboardSummarySchema);
|
|
1190
|
+
var dashboardLifecycleInputSchema = z12.strictObject({
|
|
1191
|
+
actionId: z12.string().uuid(),
|
|
1192
|
+
dashboard: identifier,
|
|
1193
|
+
archived: z12.boolean(),
|
|
1194
|
+
reason: z12.string().trim().min(1).max(500),
|
|
1195
|
+
expectedArchivedAt: z12.number().int().nonnegative().nullable().optional()
|
|
1196
|
+
});
|
|
1197
|
+
var dashboardLifecycleResultSchema = z12.object({
|
|
1198
|
+
dashboard: dashboardSummarySchema,
|
|
1199
|
+
changed: z12.boolean()
|
|
1200
|
+
});
|
|
1201
|
+
var dashboardReadQuerySchema = z12.strictObject({
|
|
1202
|
+
key: identifier,
|
|
1203
|
+
range: z12.enum(analyticsRanges).optional()
|
|
1204
|
+
});
|
|
1205
|
+
var dashboardReadSchema = z12.object({
|
|
1206
|
+
...summaryFields,
|
|
1207
|
+
definition: dashboardDefinitionSchema,
|
|
1208
|
+
range: z12.enum(analyticsRanges),
|
|
1209
|
+
panels: z12.array(
|
|
1210
|
+
z12.object({
|
|
1211
|
+
key: identifier,
|
|
1212
|
+
result: analyticsMetricResultSchema.optional(),
|
|
1213
|
+
error: z12.object({ code: z12.string(), message: z12.string() }).optional()
|
|
1214
|
+
})
|
|
1215
|
+
)
|
|
1216
|
+
});
|
|
1256
1217
|
|
|
1257
1218
|
// src/server/index.ts
|
|
1258
|
-
import * as
|
|
1219
|
+
import * as z19 from "zod";
|
|
1220
|
+
|
|
1221
|
+
// src/server/billing.ts
|
|
1222
|
+
import { z as z13 } from "zod";
|
|
1223
|
+
var billingSubscriptionPlans = ["launch", "growth", "scale"];
|
|
1224
|
+
var billingIntervals = ["month", "year"];
|
|
1225
|
+
var billingCheckoutInputSchema = z13.strictObject({
|
|
1226
|
+
plan: z13.enum(billingSubscriptionPlans),
|
|
1227
|
+
interval: z13.enum(billingIntervals)
|
|
1228
|
+
});
|
|
1229
|
+
var billingPlanChangeInputSchema = z13.strictObject({
|
|
1230
|
+
plan: z13.enum(billingSubscriptionPlans),
|
|
1231
|
+
interval: z13.enum(billingIntervals)
|
|
1232
|
+
});
|
|
1233
|
+
var billingPlanChangeSchema = z13.object({
|
|
1234
|
+
timing: z13.enum(["now", "renewal", "none"]),
|
|
1235
|
+
invoiceUrl: z13.string().url().nullable()
|
|
1236
|
+
});
|
|
1237
|
+
var billingTopupMaxQuantity = 10;
|
|
1238
|
+
var billingTopupInputSchema = z13.strictObject({
|
|
1239
|
+
quantity: z13.number().int().min(1).max(billingTopupMaxQuantity)
|
|
1240
|
+
});
|
|
1241
|
+
var billingSessionSchema = z13.object({ url: z13.string().url() });
|
|
1242
|
+
var billingSubscriptionSchema = z13.object({
|
|
1243
|
+
plan: z13.enum(billingSubscriptionPlans),
|
|
1244
|
+
interval: z13.enum(billingIntervals),
|
|
1245
|
+
status: z13.string(),
|
|
1246
|
+
currentPeriodEnd: z13.number().int().nullable(),
|
|
1247
|
+
cancelAtPeriodEnd: z13.boolean(),
|
|
1248
|
+
lastInvoice: z13.enum(["paid", "failed"]).nullable(),
|
|
1249
|
+
livemode: z13.boolean(),
|
|
1250
|
+
scheduledChange: z13.object({
|
|
1251
|
+
plan: z13.enum(billingSubscriptionPlans),
|
|
1252
|
+
interval: z13.enum(billingIntervals),
|
|
1253
|
+
at: z13.number().int()
|
|
1254
|
+
}).nullable().default(null),
|
|
1255
|
+
endedFor: z13.enum(["project-deleted", "project-transferred"]).nullable().default(null),
|
|
1256
|
+
unpaid: z13.object({
|
|
1257
|
+
since: z13.number().int(),
|
|
1258
|
+
promotionsRefusedAt: z13.number().int(),
|
|
1259
|
+
offlineAt: z13.number().int()
|
|
1260
|
+
}).nullable().default(null)
|
|
1261
|
+
});
|
|
1262
|
+
var projectBillingSchema = z13.object({
|
|
1263
|
+
available: z13.boolean(),
|
|
1264
|
+
reason: z13.enum(["admin-required", "staff-only", "not-configured"]).nullable(),
|
|
1265
|
+
subscription: billingSubscriptionSchema.nullable()
|
|
1266
|
+
});
|
|
1267
|
+
var projectPlanSchema = z13.object({
|
|
1268
|
+
plan: z13.string(),
|
|
1269
|
+
source: z13.string().nullable(),
|
|
1270
|
+
live: z13.object({
|
|
1271
|
+
allowed: z13.boolean(),
|
|
1272
|
+
reason: z13.string(),
|
|
1273
|
+
until: z13.number().int().nullable()
|
|
1274
|
+
}),
|
|
1275
|
+
liveState: z13.object({
|
|
1276
|
+
state: z13.string(),
|
|
1277
|
+
reason: z13.string(),
|
|
1278
|
+
since: z13.number().int(),
|
|
1279
|
+
until: z13.number().int().nullable()
|
|
1280
|
+
}).nullable(),
|
|
1281
|
+
trial: z13.object({
|
|
1282
|
+
state: z13.string(),
|
|
1283
|
+
project: z13.string().nullable(),
|
|
1284
|
+
startedAt: z13.number().int().nullable(),
|
|
1285
|
+
endsAt: z13.number().int().nullable()
|
|
1286
|
+
}),
|
|
1287
|
+
customDomain: z13.boolean(),
|
|
1288
|
+
ai: z13.object({
|
|
1289
|
+
source: z13.string(),
|
|
1290
|
+
allowanceUsdPerMonth: z13.number().nullable(),
|
|
1291
|
+
pools: z13.array(
|
|
1292
|
+
z13.object({
|
|
1293
|
+
pool: z13.string(),
|
|
1294
|
+
capacity: z13.number(),
|
|
1295
|
+
used: z13.number(),
|
|
1296
|
+
remaining: z13.number()
|
|
1297
|
+
})
|
|
1298
|
+
),
|
|
1299
|
+
remaining: z13.number(),
|
|
1300
|
+
renewsAt: z13.number().int()
|
|
1301
|
+
}),
|
|
1302
|
+
subscription: billingSubscriptionSchema.nullable(),
|
|
1303
|
+
enforcement: z13.boolean()
|
|
1304
|
+
});
|
|
1305
|
+
var organizationBillingSchema = z13.object({
|
|
1306
|
+
billing: projectBillingSchema.pick({ available: true, reason: true }),
|
|
1307
|
+
freeProjects: z13.object({
|
|
1308
|
+
count: z13.number().int(),
|
|
1309
|
+
limit: z13.number().int()
|
|
1310
|
+
}),
|
|
1311
|
+
trial: projectPlanSchema.shape.trial,
|
|
1312
|
+
freeAi: z13.object({
|
|
1313
|
+
usdPerMonth: z13.number(),
|
|
1314
|
+
oneTimeUsd: z13.number(),
|
|
1315
|
+
pools: projectPlanSchema.shape.ai.shape.pools,
|
|
1316
|
+
remaining: z13.number(),
|
|
1317
|
+
renewsAt: z13.number().int()
|
|
1318
|
+
}),
|
|
1319
|
+
aiAllowanceUsdPerMonth: z13.number(),
|
|
1320
|
+
enforcement: z13.boolean(),
|
|
1321
|
+
projects: z13.array(
|
|
1322
|
+
z13.object({
|
|
1323
|
+
id: z13.string(),
|
|
1324
|
+
name: z13.string(),
|
|
1325
|
+
plan: projectPlanSchema.shape.plan,
|
|
1326
|
+
source: projectPlanSchema.shape.source,
|
|
1327
|
+
live: projectPlanSchema.shape.live,
|
|
1328
|
+
liveState: projectPlanSchema.shape.liveState,
|
|
1329
|
+
subscription: billingSubscriptionSchema.nullable()
|
|
1330
|
+
})
|
|
1331
|
+
)
|
|
1332
|
+
});
|
|
1259
1333
|
|
|
1260
1334
|
// src/server/hosting.ts
|
|
1261
|
-
import * as
|
|
1335
|
+
import * as z16 from "zod";
|
|
1262
1336
|
|
|
1263
1337
|
// src/server/schedules.ts
|
|
1264
|
-
import * as
|
|
1338
|
+
import * as z14 from "zod";
|
|
1265
1339
|
import { Cron } from "croner";
|
|
1266
1340
|
var APP_SCHEDULE_LIMIT = 10;
|
|
1267
1341
|
var APP_SCHEDULE_MIN_INTERVAL = 3e5;
|
|
1268
1342
|
var APP_SCHEDULE_TIMEOUT = 3e4;
|
|
1269
|
-
var appScheduleNameSchema =
|
|
1270
|
-
var appSchedulePathSchema =
|
|
1343
|
+
var appScheduleNameSchema = z14.string().regex(/^[a-z][a-z0-9-]{0,63}$/);
|
|
1344
|
+
var appSchedulePathSchema = z14.string().min(2).max(512).refine((path) => {
|
|
1271
1345
|
if (!/^\/[a-zA-Z0-9_/-]+$/.test(path) || path.startsWith("//")) {
|
|
1272
1346
|
return false;
|
|
1273
1347
|
}
|
|
1274
1348
|
return path.split("/").slice(1).every((part) => part.length > 0) && new URL(path, "https://app.invalid").pathname === path;
|
|
1275
1349
|
}, "Expected an absolute route path without a query or hidden segments");
|
|
1276
1350
|
function interval(value) {
|
|
1277
|
-
const
|
|
1351
|
+
const amount = Number(value.slice(0, -1));
|
|
1278
1352
|
const unit = value.slice(-1);
|
|
1279
|
-
return
|
|
1353
|
+
return amount * (unit === "m" ? 6e4 : unit === "h" ? 36e5 : 864e5);
|
|
1280
1354
|
}
|
|
1281
|
-
var everySchema =
|
|
1355
|
+
var everySchema = z14.string().regex(/^[1-9]\d{0,3}[mhd]$/).refine(
|
|
1282
1356
|
(value) => interval(value) >= APP_SCHEDULE_MIN_INTERVAL && interval(value) <= 365 * 864e5,
|
|
1283
1357
|
"Use an interval from 5 minutes to 365 days, such as 5m, 1h or 1d"
|
|
1284
1358
|
);
|
|
1285
|
-
var cronSchema =
|
|
1359
|
+
var cronSchema = z14.string().max(120).refine((value) => {
|
|
1286
1360
|
const fields = value.trim().split(/\s+/);
|
|
1287
1361
|
if (fields.length !== 5 || fields.some((field) => !/^[\d*,/-]+$/.test(field))) {
|
|
1288
1362
|
return false;
|
|
@@ -1307,15 +1381,15 @@ var cronSchema = z12.string().max(120).refine((value) => {
|
|
|
1307
1381
|
var declaration = {
|
|
1308
1382
|
name: appScheduleNameSchema,
|
|
1309
1383
|
path: appSchedulePathSchema,
|
|
1310
|
-
description:
|
|
1384
|
+
description: z14.string().min(1).max(500)
|
|
1311
1385
|
};
|
|
1312
|
-
var everySchedule =
|
|
1313
|
-
var cronSchedule =
|
|
1314
|
-
var appScheduleSchema =
|
|
1386
|
+
var everySchedule = z14.object({ ...declaration, every: everySchema });
|
|
1387
|
+
var cronSchedule = z14.object({ ...declaration, cron: cronSchema });
|
|
1388
|
+
var appScheduleSchema = z14.union([
|
|
1315
1389
|
everySchedule.strict(),
|
|
1316
1390
|
cronSchedule.strict()
|
|
1317
1391
|
]);
|
|
1318
|
-
var appSchedulesSchema =
|
|
1392
|
+
var appSchedulesSchema = z14.array(appScheduleSchema).max(APP_SCHEDULE_LIMIT).refine(
|
|
1319
1393
|
(items) => new Set(items.map((item) => item.name)).size === items.length,
|
|
1320
1394
|
"Schedule names must be unique"
|
|
1321
1395
|
);
|
|
@@ -1332,25 +1406,25 @@ function nextScheduleRun(schedule, after) {
|
|
|
1332
1406
|
}
|
|
1333
1407
|
return next.getTime();
|
|
1334
1408
|
}
|
|
1335
|
-
var appScheduleStateSchema =
|
|
1409
|
+
var appScheduleStateSchema = z14.enum(["active", "paused", "archived"]);
|
|
1336
1410
|
var APP_SCHEDULE_RESULT_BYTES = 16384;
|
|
1337
|
-
var appScheduleDiagnosticSchema =
|
|
1338
|
-
level:
|
|
1339
|
-
message:
|
|
1411
|
+
var appScheduleDiagnosticSchema = z14.object({
|
|
1412
|
+
level: z14.enum(["error", "warning", "info"]),
|
|
1413
|
+
message: z14.string().min(1).max(500),
|
|
1340
1414
|
/** What the line is about, such as a member, record or tracker ID. */
|
|
1341
|
-
subject:
|
|
1415
|
+
subject: z14.string().min(1).max(200).optional(),
|
|
1342
1416
|
/** A stable code the app chooses, such as `ingest-timeout`. */
|
|
1343
|
-
code:
|
|
1417
|
+
code: z14.string().min(1).max(100).optional()
|
|
1344
1418
|
});
|
|
1345
|
-
var appScheduleResultSchema =
|
|
1346
|
-
outcome:
|
|
1347
|
-
summary:
|
|
1419
|
+
var appScheduleResultSchema = z14.object({
|
|
1420
|
+
outcome: z14.enum(["succeeded", "partial", "failed"]),
|
|
1421
|
+
summary: z14.string().min(1).max(500).optional(),
|
|
1348
1422
|
/** Counts and gauges, such as processed and failed members. */
|
|
1349
|
-
metrics:
|
|
1423
|
+
metrics: z14.record(z14.string().regex(/^[A-Za-z][\w.-]{0,63}$/), z14.number()).refine(
|
|
1350
1424
|
(metrics) => Object.keys(metrics).length <= 50,
|
|
1351
1425
|
"Report at most 50 metrics"
|
|
1352
1426
|
).optional(),
|
|
1353
|
-
diagnostics:
|
|
1427
|
+
diagnostics: z14.array(appScheduleDiagnosticSchema).max(50).optional()
|
|
1354
1428
|
});
|
|
1355
1429
|
function scheduleResult(result) {
|
|
1356
1430
|
const body = JSON.stringify(appScheduleResultSchema.parse(result));
|
|
@@ -1363,41 +1437,41 @@ function scheduleResult(result) {
|
|
|
1363
1437
|
headers: { "Content-Type": "application/json" }
|
|
1364
1438
|
});
|
|
1365
1439
|
}
|
|
1366
|
-
var appScheduleRunSchema =
|
|
1367
|
-
id:
|
|
1368
|
-
build:
|
|
1369
|
-
startedAt:
|
|
1370
|
-
scheduledAt:
|
|
1371
|
-
manual:
|
|
1372
|
-
status:
|
|
1373
|
-
duration:
|
|
1440
|
+
var appScheduleRunSchema = z14.object({
|
|
1441
|
+
id: z14.string().uuid(),
|
|
1442
|
+
build: z14.string().uuid(),
|
|
1443
|
+
startedAt: z14.number(),
|
|
1444
|
+
scheduledAt: z14.number(),
|
|
1445
|
+
manual: z14.boolean(),
|
|
1446
|
+
status: z14.enum(["queued", "running", "succeeded", "failed", "uncertain"]),
|
|
1447
|
+
duration: z14.number().nullable(),
|
|
1374
1448
|
/** Why the run failed or is uncertain, or why Relay ignored the app's result. */
|
|
1375
|
-
error:
|
|
1449
|
+
error: z14.string().nullable(),
|
|
1376
1450
|
/** The app's JSON answer when it sent a valid result. Absent on runs from before results. */
|
|
1377
1451
|
result: appScheduleResultSchema.nullable().optional()
|
|
1378
1452
|
});
|
|
1379
|
-
var appScheduleRunsSchema =
|
|
1453
|
+
var appScheduleRunsSchema = z14.object({
|
|
1380
1454
|
/** Newest first: the latest twenty runs of one schedule, including a queued or running one. */
|
|
1381
|
-
runs:
|
|
1455
|
+
runs: z14.array(appScheduleRunSchema)
|
|
1382
1456
|
});
|
|
1383
|
-
var appScheduleListSchema =
|
|
1457
|
+
var appScheduleListSchema = z14.object({
|
|
1384
1458
|
state: appScheduleStateSchema,
|
|
1385
|
-
schedules:
|
|
1386
|
-
|
|
1387
|
-
declaration:
|
|
1388
|
-
nextRun:
|
|
1389
|
-
blocked:
|
|
1459
|
+
schedules: z14.array(
|
|
1460
|
+
z14.object({
|
|
1461
|
+
declaration: z14.union([everySchedule, cronSchedule]),
|
|
1462
|
+
nextRun: z14.number().nullable(),
|
|
1463
|
+
blocked: z14.boolean(),
|
|
1390
1464
|
lastRun: appScheduleRunSchema.nullable()
|
|
1391
1465
|
})
|
|
1392
1466
|
)
|
|
1393
1467
|
});
|
|
1394
|
-
var scheduledInvocationSchema =
|
|
1395
|
-
id:
|
|
1396
|
-
build:
|
|
1468
|
+
var scheduledInvocationSchema = z14.object({
|
|
1469
|
+
id: z14.string().uuid(),
|
|
1470
|
+
build: z14.string().uuid(),
|
|
1397
1471
|
name: appScheduleNameSchema,
|
|
1398
|
-
scheduledAt:
|
|
1399
|
-
startedAt:
|
|
1400
|
-
manual:
|
|
1472
|
+
scheduledAt: z14.number().int(),
|
|
1473
|
+
startedAt: z14.number().int(),
|
|
1474
|
+
manual: z14.boolean()
|
|
1401
1475
|
}).strict();
|
|
1402
1476
|
async function verifyScheduledRequest(request, key) {
|
|
1403
1477
|
const signature = request.headers.get("X-Domino-Schedule-Signature");
|
|
@@ -1462,7 +1536,7 @@ ${body}`)
|
|
|
1462
1536
|
}
|
|
1463
1537
|
|
|
1464
1538
|
// src/server/starters.ts
|
|
1465
|
-
import * as
|
|
1539
|
+
import * as z15 from "zod";
|
|
1466
1540
|
var starterTemplates = [
|
|
1467
1541
|
{
|
|
1468
1542
|
id: "campaign",
|
|
@@ -1495,63 +1569,63 @@ var starterTemplates = [
|
|
|
1495
1569
|
summary: "A headless Worker with typed routes and interactive API docs, for plugging Domino into your own product."
|
|
1496
1570
|
}
|
|
1497
1571
|
];
|
|
1498
|
-
var starterIdSchema =
|
|
1572
|
+
var starterIdSchema = z15.enum(
|
|
1499
1573
|
starterTemplates.map((template) => template.id)
|
|
1500
1574
|
);
|
|
1501
1575
|
|
|
1502
1576
|
// src/server/hosting.ts
|
|
1503
|
-
var outputPathSchema =
|
|
1577
|
+
var outputPathSchema = z16.string().min(1).max(512).refine(
|
|
1504
1578
|
(path) => path.split("/").every(
|
|
1505
1579
|
(part) => /^[\w-][\w.-]*$/.test(part) && part !== "node_modules"
|
|
1506
1580
|
),
|
|
1507
1581
|
"Expected a relative build output path without hidden segments"
|
|
1508
1582
|
);
|
|
1509
|
-
var appRoutingSchema =
|
|
1583
|
+
var appRoutingSchema = z16.enum(["legacy", "transparent"]).default("legacy");
|
|
1510
1584
|
var APP_SECRET_LIMIT = 50;
|
|
1511
1585
|
var APP_KV_LIMIT = 5;
|
|
1512
1586
|
var APP_SQL_LIMIT = 5;
|
|
1513
1587
|
var APP_MIGRATION_LIMIT = 100;
|
|
1514
1588
|
var APP_MIGRATION_FILE_BYTES = 9e4;
|
|
1515
1589
|
var APP_MIGRATION_TOTAL_BYTES = 1e6;
|
|
1516
|
-
var appSecretNameSchema =
|
|
1590
|
+
var appSecretNameSchema = z16.string().regex(
|
|
1517
1591
|
/^[A-Z_][A-Z0-9_]{0,63}$/,
|
|
1518
1592
|
"Use 1-64 uppercase letters, digits, and underscores, not starting with a digit"
|
|
1519
1593
|
).refine(
|
|
1520
1594
|
(name) => !name.startsWith("DOMINO_") && name !== "ASSETS",
|
|
1521
1595
|
"DOMINO_ names and ASSETS are reserved for Domino's own bindings"
|
|
1522
1596
|
);
|
|
1523
|
-
var appSecretValueSchema =
|
|
1597
|
+
var appSecretValueSchema = z16.string().min(1).refine(
|
|
1524
1598
|
(value) => new TextEncoder().encode(value).length <= 5120,
|
|
1525
1599
|
"Secret values can be at most 5 KiB"
|
|
1526
1600
|
);
|
|
1527
|
-
var appSecretInputSchema =
|
|
1528
|
-
var appSecretSchema =
|
|
1601
|
+
var appSecretInputSchema = z16.object({ value: appSecretValueSchema }).strict();
|
|
1602
|
+
var appSecretSchema = z16.object({
|
|
1529
1603
|
name: appSecretNameSchema,
|
|
1530
|
-
updatedAt:
|
|
1531
|
-
updatedBy:
|
|
1604
|
+
updatedAt: z16.number(),
|
|
1605
|
+
updatedBy: z16.string()
|
|
1532
1606
|
});
|
|
1533
|
-
var appSecretDeclarationSchema =
|
|
1534
|
-
description:
|
|
1535
|
-
required:
|
|
1607
|
+
var appSecretDeclarationSchema = z16.object({
|
|
1608
|
+
description: z16.string().trim().min(1).max(500),
|
|
1609
|
+
required: z16.boolean().default(true)
|
|
1536
1610
|
}).strict();
|
|
1537
|
-
var appSecretDeclarationsSchema =
|
|
1611
|
+
var appSecretDeclarationsSchema = z16.record(appSecretNameSchema, appSecretDeclarationSchema).refine(
|
|
1538
1612
|
(secrets) => Object.keys(secrets).length <= APP_SECRET_LIMIT,
|
|
1539
1613
|
`Declare at most ${APP_SECRET_LIMIT} app secrets`
|
|
1540
1614
|
);
|
|
1541
|
-
var appSecretListSchema =
|
|
1542
|
-
secrets:
|
|
1543
|
-
declared:
|
|
1615
|
+
var appSecretListSchema = z16.object({
|
|
1616
|
+
secrets: z16.array(appSecretSchema),
|
|
1617
|
+
declared: z16.array(appSecretDeclarationSchema.extend({ name: appSecretNameSchema })).default([])
|
|
1544
1618
|
});
|
|
1545
|
-
var hostedAppSecretsSchema =
|
|
1546
|
-
var storageDescription =
|
|
1547
|
-
description:
|
|
1619
|
+
var hostedAppSecretsSchema = z16.object({ secrets: z16.record(appSecretNameSchema, appSecretValueSchema) }).strict();
|
|
1620
|
+
var storageDescription = z16.object({
|
|
1621
|
+
description: z16.string().trim().min(1).max(500)
|
|
1548
1622
|
}).strict();
|
|
1549
|
-
var appStorageSchema =
|
|
1550
|
-
kv:
|
|
1623
|
+
var appStorageSchema = z16.object({
|
|
1624
|
+
kv: z16.record(appSecretNameSchema, storageDescription).refine(
|
|
1551
1625
|
(stores) => Object.keys(stores).length <= APP_KV_LIMIT,
|
|
1552
1626
|
`Declare at most ${APP_KV_LIMIT} KV stores`
|
|
1553
1627
|
).default({}),
|
|
1554
|
-
sql:
|
|
1628
|
+
sql: z16.record(
|
|
1555
1629
|
appSecretNameSchema,
|
|
1556
1630
|
storageDescription.extend({
|
|
1557
1631
|
migrations: outputPathSchema.optional()
|
|
@@ -1561,77 +1635,77 @@ var appStorageSchema = z14.object({
|
|
|
1561
1635
|
`Declare at most ${APP_SQL_LIMIT} SQL stores`
|
|
1562
1636
|
).default({})
|
|
1563
1637
|
}).strict();
|
|
1564
|
-
var appStorageKindSchema =
|
|
1565
|
-
var appStorageListSchema =
|
|
1566
|
-
stores:
|
|
1567
|
-
|
|
1568
|
-
kind:
|
|
1638
|
+
var appStorageKindSchema = z16.enum(["kv", "sql"]);
|
|
1639
|
+
var appStorageListSchema = z16.object({
|
|
1640
|
+
stores: z16.array(
|
|
1641
|
+
z16.object({
|
|
1642
|
+
kind: z16.string(),
|
|
1569
1643
|
name: appSecretNameSchema,
|
|
1570
|
-
createdAt:
|
|
1571
|
-
declared:
|
|
1572
|
-
description:
|
|
1644
|
+
createdAt: z16.number().nullable(),
|
|
1645
|
+
declared: z16.boolean(),
|
|
1646
|
+
description: z16.string().optional()
|
|
1573
1647
|
})
|
|
1574
1648
|
)
|
|
1575
1649
|
});
|
|
1576
1650
|
var APP_STORAGE_ROW_LIMIT = 50;
|
|
1577
1651
|
var APP_STORAGE_PREVIEW_CHARACTERS = 2e3;
|
|
1578
|
-
var appStorageCellSchema =
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1652
|
+
var appStorageCellSchema = z16.union([
|
|
1653
|
+
z16.string(),
|
|
1654
|
+
z16.number(),
|
|
1655
|
+
z16.null(),
|
|
1656
|
+
z16.object({ text: z16.string(), truncated: z16.literal(true) }),
|
|
1657
|
+
z16.object({ blob: z16.number().int().min(0) })
|
|
1584
1658
|
]);
|
|
1585
|
-
var appStorageTablesSchema =
|
|
1586
|
-
tables:
|
|
1659
|
+
var appStorageTablesSchema = z16.object({
|
|
1660
|
+
tables: z16.array(
|
|
1587
1661
|
/** `kind` is SQLite's: `table` or `view`. */
|
|
1588
|
-
|
|
1662
|
+
z16.object({ name: z16.string(), kind: z16.string() })
|
|
1589
1663
|
)
|
|
1590
1664
|
});
|
|
1591
|
-
var appStorageRowsSchema =
|
|
1592
|
-
table:
|
|
1593
|
-
columns:
|
|
1594
|
-
rows:
|
|
1665
|
+
var appStorageRowsSchema = z16.object({
|
|
1666
|
+
table: z16.string(),
|
|
1667
|
+
columns: z16.array(z16.string()),
|
|
1668
|
+
rows: z16.array(z16.array(appStorageCellSchema)),
|
|
1595
1669
|
/** How many rows come before this page in storage order. */
|
|
1596
|
-
offset:
|
|
1597
|
-
total:
|
|
1670
|
+
offset: z16.number().int().min(0),
|
|
1671
|
+
total: z16.number().int().min(0),
|
|
1598
1672
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
1599
1673
|
nextCursor: pageCursorSchema.nullable().default(null)
|
|
1600
1674
|
});
|
|
1601
|
-
var appStorageKeysSchema =
|
|
1602
|
-
keys:
|
|
1603
|
-
|
|
1675
|
+
var appStorageKeysSchema = z16.object({
|
|
1676
|
+
keys: z16.array(
|
|
1677
|
+
z16.object({ name: z16.string(), expiration: z16.number().nullable() })
|
|
1604
1678
|
),
|
|
1605
1679
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
1606
1680
|
nextCursor: pageCursorSchema.nullable().default(null),
|
|
1607
1681
|
/** @deprecated Use `nextCursor`. Removed in 2.0.0. */
|
|
1608
|
-
cursor:
|
|
1682
|
+
cursor: z16.string().nullable()
|
|
1609
1683
|
});
|
|
1610
|
-
var appStorageValueSchema =
|
|
1611
|
-
key:
|
|
1612
|
-
size:
|
|
1684
|
+
var appStorageValueSchema = z16.object({
|
|
1685
|
+
key: z16.string(),
|
|
1686
|
+
size: z16.number().int().min(0),
|
|
1613
1687
|
/** Null when the value is not UTF-8 text. */
|
|
1614
|
-
text:
|
|
1615
|
-
truncated:
|
|
1688
|
+
text: z16.string().nullable(),
|
|
1689
|
+
truncated: z16.boolean()
|
|
1616
1690
|
});
|
|
1617
1691
|
var APP_STORAGE_CELL_CHARACTERS = 1e5;
|
|
1618
|
-
var appStorageCellPageSchema =
|
|
1619
|
-
table:
|
|
1620
|
-
column:
|
|
1692
|
+
var appStorageCellPageSchema = z16.object({
|
|
1693
|
+
table: z16.string(),
|
|
1694
|
+
column: z16.string(),
|
|
1621
1695
|
/** The row's position in storage order: a rows page's `offset` plus its index on that page. */
|
|
1622
|
-
row:
|
|
1696
|
+
row: z16.number().int().min(0),
|
|
1623
1697
|
/** SQLite's storage class. */
|
|
1624
|
-
type:
|
|
1698
|
+
type: z16.enum(["text", "integer", "real", "blob", "null"]),
|
|
1625
1699
|
/** Characters of text, or of a number's text form; bytes of a BLOB; null for NULL. */
|
|
1626
|
-
length:
|
|
1700
|
+
length: z16.number().int().min(0).nullable(),
|
|
1627
1701
|
/** How many characters come before this page. */
|
|
1628
|
-
offset:
|
|
1702
|
+
offset: z16.number().int().min(0),
|
|
1629
1703
|
/** Up to 100,000 characters from `offset`. Null for a BLOB, whose bytes are never read, and NULL. */
|
|
1630
|
-
text:
|
|
1704
|
+
text: z16.string().nullable(),
|
|
1631
1705
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
1632
1706
|
nextCursor: pageCursorSchema.nullable().default(null)
|
|
1633
1707
|
});
|
|
1634
|
-
var appMigrationNameSchema =
|
|
1708
|
+
var appMigrationNameSchema = z16.string().max(255).regex(/^[\w-][\w.-]*\.sql$/);
|
|
1635
1709
|
function compareAppMigrations(a, b) {
|
|
1636
1710
|
const left = Number.parseInt(a.split("_")[0], 10);
|
|
1637
1711
|
const right = Number.parseInt(b.split("_")[0], 10);
|
|
@@ -1648,12 +1722,12 @@ function compareAppMigrations(a, b) {
|
|
|
1648
1722
|
}
|
|
1649
1723
|
return a < b ? -1 : a > b ? 1 : 0;
|
|
1650
1724
|
}
|
|
1651
|
-
var appMigrationsSchema =
|
|
1725
|
+
var appMigrationsSchema = z16.record(
|
|
1652
1726
|
appSecretNameSchema,
|
|
1653
|
-
|
|
1654
|
-
|
|
1727
|
+
z16.array(
|
|
1728
|
+
z16.object({
|
|
1655
1729
|
name: appMigrationNameSchema,
|
|
1656
|
-
sql:
|
|
1730
|
+
sql: z16.string().min(1).refine(
|
|
1657
1731
|
(sql) => new TextEncoder().encode(sql).length <= APP_MIGRATION_FILE_BYTES,
|
|
1658
1732
|
`A migration file must not exceed ${APP_MIGRATION_FILE_BYTES} bytes`
|
|
1659
1733
|
)
|
|
@@ -1671,21 +1745,21 @@ var appMigrationsSchema = z14.record(
|
|
|
1671
1745
|
);
|
|
1672
1746
|
var appScripts = {
|
|
1673
1747
|
routing: appRoutingSchema,
|
|
1674
|
-
devScript:
|
|
1675
|
-
checkScript:
|
|
1676
|
-
buildScript:
|
|
1748
|
+
devScript: z16.string().regex(/^[\w:-]+$/),
|
|
1749
|
+
checkScript: z16.string().regex(/^[\w:-]+$/),
|
|
1750
|
+
buildScript: z16.string().regex(/^[\w:-]+$/)
|
|
1677
1751
|
};
|
|
1678
1752
|
var workerSettings = {
|
|
1679
|
-
runWorkerFirst:
|
|
1753
|
+
runWorkerFirst: z16.boolean().default(false),
|
|
1680
1754
|
main: outputPathSchema.refine(
|
|
1681
1755
|
(path) => /\.m?js$/.test(path),
|
|
1682
1756
|
"Expected a compiled JavaScript entry"
|
|
1683
1757
|
),
|
|
1684
|
-
compatibilityDate:
|
|
1685
|
-
compatibilityFlags:
|
|
1686
|
-
vars:
|
|
1687
|
-
|
|
1688
|
-
|
|
1758
|
+
compatibilityDate: z16.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
1759
|
+
compatibilityFlags: z16.array(z16.string().min(1)).max(50).default([]),
|
|
1760
|
+
vars: z16.record(
|
|
1761
|
+
z16.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).refine((name) => name !== "ASSETS"),
|
|
1762
|
+
z16.string()
|
|
1689
1763
|
).default({}),
|
|
1690
1764
|
secrets: appSecretDeclarationsSchema.default({}),
|
|
1691
1765
|
storage: appStorageSchema.optional(),
|
|
@@ -1714,62 +1788,62 @@ var distinctBindings = (worker, ctx) => {
|
|
|
1714
1788
|
}
|
|
1715
1789
|
}
|
|
1716
1790
|
};
|
|
1717
|
-
var hostedAppSchema =
|
|
1718
|
-
|
|
1719
|
-
kind:
|
|
1791
|
+
var hostedAppSchema = z16.discriminatedUnion("kind", [
|
|
1792
|
+
z16.object({
|
|
1793
|
+
kind: z16.literal("static"),
|
|
1720
1794
|
directory: outputPathSchema,
|
|
1721
1795
|
...appScripts
|
|
1722
1796
|
}).strict(),
|
|
1723
|
-
|
|
1724
|
-
kind:
|
|
1797
|
+
z16.object({
|
|
1798
|
+
kind: z16.literal("worker"),
|
|
1725
1799
|
directory: outputPathSchema,
|
|
1726
1800
|
assetsDirectory: outputPathSchema.optional(),
|
|
1727
1801
|
...appScripts,
|
|
1728
1802
|
...workerSettings
|
|
1729
1803
|
}).strict().superRefine(distinctBindings)
|
|
1730
1804
|
]);
|
|
1731
|
-
var repositorySchema =
|
|
1732
|
-
id:
|
|
1805
|
+
var repositorySchema = z16.object({
|
|
1806
|
+
id: z16.string().uuid(),
|
|
1733
1807
|
organization: identifier,
|
|
1734
1808
|
project: identifier,
|
|
1735
|
-
remote:
|
|
1736
|
-
defaultBranch:
|
|
1737
|
-
status:
|
|
1809
|
+
remote: z16.string().url(),
|
|
1810
|
+
defaultBranch: z16.string(),
|
|
1811
|
+
status: z16.enum(["provisioning", "ready"])
|
|
1738
1812
|
});
|
|
1739
|
-
var createRepositorySchema =
|
|
1813
|
+
var createRepositorySchema = z16.object({
|
|
1740
1814
|
/** Omitted: the starter chosen at project setup, else `campaign`. */
|
|
1741
1815
|
starter: starterIdSchema.optional()
|
|
1742
1816
|
}).strict();
|
|
1743
|
-
var deviceStartSchema =
|
|
1744
|
-
challenge:
|
|
1817
|
+
var deviceStartSchema = z16.object({
|
|
1818
|
+
challenge: z16.string().regex(/^[a-f0-9]{64}$/)
|
|
1745
1819
|
}).strict();
|
|
1746
|
-
var deviceRedeemSchema =
|
|
1747
|
-
id:
|
|
1748
|
-
verifier:
|
|
1820
|
+
var deviceRedeemSchema = z16.object({
|
|
1821
|
+
id: z16.string().uuid(),
|
|
1822
|
+
verifier: z16.string().min(43).max(128)
|
|
1749
1823
|
}).strict();
|
|
1750
|
-
var deviceApproveSchema =
|
|
1751
|
-
id:
|
|
1752
|
-
code:
|
|
1824
|
+
var deviceApproveSchema = z16.object({
|
|
1825
|
+
id: z16.string().uuid(),
|
|
1826
|
+
code: z16.string().regex(/^[A-F0-9]{4}-[A-F0-9]{4}$/)
|
|
1753
1827
|
}).strict();
|
|
1754
|
-
var commitSchema =
|
|
1755
|
-
var stageRequestSchema =
|
|
1828
|
+
var commitSchema = z16.string().regex(/^[a-f0-9]{40}$/);
|
|
1829
|
+
var stageRequestSchema = z16.object({
|
|
1756
1830
|
commit: commitSchema,
|
|
1757
|
-
requestId:
|
|
1831
|
+
requestId: z16.string().uuid()
|
|
1758
1832
|
}).strict();
|
|
1759
|
-
var buildIdentitySchema =
|
|
1833
|
+
var buildIdentitySchema = z16.object({
|
|
1760
1834
|
routing: appRoutingSchema,
|
|
1761
|
-
slug:
|
|
1762
|
-
runtime:
|
|
1763
|
-
id:
|
|
1764
|
-
repository:
|
|
1835
|
+
slug: z16.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional(),
|
|
1836
|
+
runtime: z16.enum(["simulation", "hosted-test"]).default("simulation"),
|
|
1837
|
+
id: z16.string().uuid(),
|
|
1838
|
+
repository: z16.string().uuid(),
|
|
1765
1839
|
organization: identifier,
|
|
1766
1840
|
project: identifier,
|
|
1767
1841
|
commit: commitSchema,
|
|
1768
|
-
createdAt:
|
|
1769
|
-
actor:
|
|
1770
|
-
commitMessage:
|
|
1842
|
+
createdAt: z16.number(),
|
|
1843
|
+
actor: z16.string(),
|
|
1844
|
+
commitMessage: z16.string().max(500).optional()
|
|
1771
1845
|
});
|
|
1772
|
-
var buildPhaseSchema =
|
|
1846
|
+
var buildPhaseSchema = z16.enum([
|
|
1773
1847
|
"queued",
|
|
1774
1848
|
"source",
|
|
1775
1849
|
"install",
|
|
@@ -1779,120 +1853,120 @@ var buildPhaseSchema = z14.enum([
|
|
|
1779
1853
|
"ready",
|
|
1780
1854
|
"failed"
|
|
1781
1855
|
]);
|
|
1782
|
-
var buildStatusSchema =
|
|
1856
|
+
var buildStatusSchema = z16.object({
|
|
1783
1857
|
phase: buildPhaseSchema,
|
|
1784
1858
|
failedPhase: buildPhaseSchema.optional(),
|
|
1785
|
-
updatedAt:
|
|
1786
|
-
message:
|
|
1859
|
+
updatedAt: z16.number(),
|
|
1860
|
+
message: z16.string()
|
|
1787
1861
|
});
|
|
1788
1862
|
var hostedBuildSchema = buildIdentitySchema.extend({
|
|
1789
1863
|
...buildStatusSchema.shape,
|
|
1790
|
-
finished:
|
|
1791
|
-
current:
|
|
1792
|
-
stagingUrl:
|
|
1864
|
+
finished: z16.boolean(),
|
|
1865
|
+
current: z16.boolean(),
|
|
1866
|
+
stagingUrl: z16.string().url()
|
|
1793
1867
|
});
|
|
1794
|
-
var liveAppSchema =
|
|
1795
|
-
url:
|
|
1796
|
-
state:
|
|
1868
|
+
var liveAppSchema = z16.object({
|
|
1869
|
+
url: z16.string().url().nullable(),
|
|
1870
|
+
state: z16.enum(["none", "deploying", "live", "failed"]),
|
|
1797
1871
|
/** The build the address serves, or null before the first one goes live. */
|
|
1798
|
-
build:
|
|
1872
|
+
build: z16.string().uuid().nullable(),
|
|
1799
1873
|
/** The build the last approved promotion asked for, while it differs from `build`. */
|
|
1800
|
-
requested:
|
|
1801
|
-
failure:
|
|
1874
|
+
requested: z16.string().uuid().nullable(),
|
|
1875
|
+
failure: z16.string().nullable()
|
|
1802
1876
|
});
|
|
1803
|
-
var customDomainStateSchema =
|
|
1877
|
+
var customDomainStateSchema = z16.enum([
|
|
1804
1878
|
"awaiting-dns",
|
|
1805
1879
|
"provisioning",
|
|
1806
1880
|
"active",
|
|
1807
1881
|
"attention",
|
|
1808
1882
|
"suspended"
|
|
1809
1883
|
]);
|
|
1810
|
-
var customDomainRecordSchema =
|
|
1811
|
-
type:
|
|
1812
|
-
name:
|
|
1813
|
-
value:
|
|
1884
|
+
var customDomainRecordSchema = z16.object({
|
|
1885
|
+
type: z16.enum(["CNAME", "TXT"]),
|
|
1886
|
+
name: z16.string(),
|
|
1887
|
+
value: z16.string(),
|
|
1814
1888
|
/** The values public DNS returned: empty when it had none, null before Domino looked. */
|
|
1815
|
-
found:
|
|
1816
|
-
matches:
|
|
1889
|
+
found: z16.array(z16.string()).nullable(),
|
|
1890
|
+
matches: z16.boolean()
|
|
1817
1891
|
});
|
|
1818
|
-
var customDomainSchema =
|
|
1819
|
-
id:
|
|
1820
|
-
hostname:
|
|
1821
|
-
url:
|
|
1892
|
+
var customDomainSchema = z16.object({
|
|
1893
|
+
id: z16.string().uuid(),
|
|
1894
|
+
hostname: z16.string(),
|
|
1895
|
+
url: z16.string().url(),
|
|
1822
1896
|
state: customDomainStateSchema,
|
|
1823
1897
|
/** What to fix, in plain words, while the domain needs attention or is suspended. */
|
|
1824
|
-
issue:
|
|
1825
|
-
records:
|
|
1898
|
+
issue: z16.object({ code: z16.string(), message: z16.string() }).nullable(),
|
|
1899
|
+
records: z16.array(customDomainRecordSchema),
|
|
1826
1900
|
/** Cloudflare's statuses and errors in its own words, once the domain is proven. */
|
|
1827
|
-
cloudflare:
|
|
1828
|
-
hostnameStatus:
|
|
1829
|
-
certificateStatus:
|
|
1830
|
-
validationErrors:
|
|
1831
|
-
verificationErrors:
|
|
1832
|
-
certificateExpiresAt:
|
|
1901
|
+
cloudflare: z16.object({
|
|
1902
|
+
hostnameStatus: z16.string(),
|
|
1903
|
+
certificateStatus: z16.string().nullable(),
|
|
1904
|
+
validationErrors: z16.array(z16.string()),
|
|
1905
|
+
verificationErrors: z16.array(z16.string()),
|
|
1906
|
+
certificateExpiresAt: z16.string().nullable()
|
|
1833
1907
|
}).nullable(),
|
|
1834
|
-
checkedAt:
|
|
1835
|
-
nextCheckAt:
|
|
1836
|
-
createdAt:
|
|
1837
|
-
});
|
|
1838
|
-
var customDomainListSchema =
|
|
1839
|
-
domains:
|
|
1840
|
-
});
|
|
1841
|
-
var customDomainInputSchema =
|
|
1842
|
-
var stagingAccessModeSchema =
|
|
1843
|
-
var stagingAccessSchema =
|
|
1844
|
-
var stagingAccessInputSchema =
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
mode:
|
|
1848
|
-
password:
|
|
1908
|
+
checkedAt: z16.string().nullable(),
|
|
1909
|
+
nextCheckAt: z16.string().nullable(),
|
|
1910
|
+
createdAt: z16.string()
|
|
1911
|
+
});
|
|
1912
|
+
var customDomainListSchema = z16.object({
|
|
1913
|
+
domains: z16.array(customDomainSchema)
|
|
1914
|
+
});
|
|
1915
|
+
var customDomainInputSchema = z16.object({ hostname: z16.string().min(1).max(300) }).strict();
|
|
1916
|
+
var stagingAccessModeSchema = z16.enum(["console", "password"]);
|
|
1917
|
+
var stagingAccessSchema = z16.object({ mode: stagingAccessModeSchema });
|
|
1918
|
+
var stagingAccessInputSchema = z16.discriminatedUnion("mode", [
|
|
1919
|
+
z16.object({ mode: z16.literal("console") }).strict(),
|
|
1920
|
+
z16.object({
|
|
1921
|
+
mode: z16.literal("password"),
|
|
1922
|
+
password: z16.string().min(8).max(128)
|
|
1849
1923
|
}).strict()
|
|
1850
1924
|
]);
|
|
1851
|
-
var stagingPathSchema =
|
|
1925
|
+
var stagingPathSchema = z16.string().max(2048).refine(
|
|
1852
1926
|
(path) => path.startsWith("/") && !path.startsWith("//") && !path.includes("\\"),
|
|
1853
1927
|
"Expected a path on the staging host"
|
|
1854
1928
|
);
|
|
1855
|
-
var stagingLinkSchema =
|
|
1856
|
-
url:
|
|
1857
|
-
expiresAt:
|
|
1929
|
+
var stagingLinkSchema = z16.object({
|
|
1930
|
+
url: z16.string().url(),
|
|
1931
|
+
expiresAt: z16.number()
|
|
1858
1932
|
});
|
|
1859
|
-
var buildSnapshotSchema =
|
|
1860
|
-
builds:
|
|
1933
|
+
var buildSnapshotSchema = z16.object({
|
|
1934
|
+
builds: z16.array(hostedBuildSchema),
|
|
1861
1935
|
current: hostedBuildSchema.nullable(),
|
|
1862
1936
|
selected: hostedBuildSchema.nullable(),
|
|
1863
|
-
logs:
|
|
1937
|
+
logs: z16.string()
|
|
1864
1938
|
});
|
|
1865
|
-
var assetPathSchema =
|
|
1939
|
+
var assetPathSchema = z16.string().max(512).refine(
|
|
1866
1940
|
(path) => path.startsWith("/") && // oxlint-disable-next-line no-control-regex -- Asset paths must reject control characters.
|
|
1867
1941
|
!/[\\\u0000-\u001f?#%]/.test(path) && path.slice(1).split("/").every((part) => part.length > 0 && !part.startsWith(".")),
|
|
1868
1942
|
"Expected a public asset path without hidden segments"
|
|
1869
1943
|
);
|
|
1870
|
-
var base64Schema =
|
|
1944
|
+
var base64Schema = z16.string().regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
|
|
1871
1945
|
var stagedDeploymentLimits = {
|
|
1872
1946
|
/** Bytes of JSON, uncompressed. */
|
|
1873
1947
|
size: 64e6,
|
|
1874
1948
|
/** Bytes of the Brotli-compressed object. */
|
|
1875
1949
|
compressedSize: 1e7
|
|
1876
1950
|
};
|
|
1877
|
-
var stagedDeploymentSchema =
|
|
1878
|
-
encoding:
|
|
1879
|
-
sha256:
|
|
1880
|
-
compressedSize:
|
|
1881
|
-
size:
|
|
1951
|
+
var stagedDeploymentSchema = z16.object({
|
|
1952
|
+
encoding: z16.literal("br"),
|
|
1953
|
+
sha256: z16.string().regex(/^[0-9a-f]{64}$/),
|
|
1954
|
+
compressedSize: z16.number().int().positive().max(stagedDeploymentLimits.compressedSize),
|
|
1955
|
+
size: z16.number().int().positive().max(stagedDeploymentLimits.size)
|
|
1882
1956
|
}).strict();
|
|
1883
1957
|
var stagedDeploymentContentSchema = stagedDeploymentSchema.extend({
|
|
1884
|
-
content:
|
|
1958
|
+
content: z16.string().max(Math.ceil(stagedDeploymentLimits.compressedSize / 3) * 4)
|
|
1885
1959
|
}).strict();
|
|
1886
1960
|
var stagedDeploymentKey = (build, sha256) => `builds/${build}/deployment/${sha256}.br`;
|
|
1887
1961
|
var artifactFields = {
|
|
1888
1962
|
routing: appRoutingSchema,
|
|
1889
|
-
worker:
|
|
1963
|
+
worker: z16.object({
|
|
1890
1964
|
...workerSettings,
|
|
1891
1965
|
migrations: appMigrationsSchema.optional(),
|
|
1892
|
-
modules:
|
|
1893
|
-
|
|
1966
|
+
modules: z16.array(
|
|
1967
|
+
z16.object({
|
|
1894
1968
|
path: outputPathSchema.refine((path) => path !== "metadata"),
|
|
1895
|
-
type:
|
|
1969
|
+
type: z16.enum([
|
|
1896
1970
|
"application/javascript+module",
|
|
1897
1971
|
"application/wasm",
|
|
1898
1972
|
"text/plain",
|
|
@@ -1902,26 +1976,26 @@ var artifactFields = {
|
|
|
1902
1976
|
}).strict()
|
|
1903
1977
|
).min(1).max(500)
|
|
1904
1978
|
}).strict().superRefine(distinctBindings).optional(),
|
|
1905
|
-
assets:
|
|
1906
|
-
|
|
1979
|
+
assets: z16.array(
|
|
1980
|
+
z16.object({
|
|
1907
1981
|
path: assetPathSchema,
|
|
1908
1982
|
content: base64Schema.max(14e6),
|
|
1909
|
-
size:
|
|
1983
|
+
size: z16.number().int().min(0).max(1e7)
|
|
1910
1984
|
}).strict()
|
|
1911
1985
|
).max(500)
|
|
1912
1986
|
};
|
|
1913
|
-
var buildArtifactsSchema =
|
|
1914
|
-
|
|
1915
|
-
format:
|
|
1987
|
+
var buildArtifactsSchema = z16.discriminatedUnion("format", [
|
|
1988
|
+
z16.object({
|
|
1989
|
+
format: z16.literal(1),
|
|
1916
1990
|
...artifactFields,
|
|
1917
|
-
quests:
|
|
1918
|
-
catalog:
|
|
1991
|
+
quests: z16.unknown(),
|
|
1992
|
+
catalog: z16.unknown()
|
|
1919
1993
|
}).strict(),
|
|
1920
|
-
|
|
1921
|
-
format:
|
|
1994
|
+
z16.object({
|
|
1995
|
+
format: z16.literal(2),
|
|
1922
1996
|
...artifactFields,
|
|
1923
1997
|
deployment: stagedDeploymentSchema,
|
|
1924
|
-
images:
|
|
1998
|
+
images: z16.array(imageAssetArtifactSchema).max(10)
|
|
1925
1999
|
}).strict()
|
|
1926
2000
|
]).superRefine((value, ctx) => {
|
|
1927
2001
|
if (value.worker) {
|
|
@@ -1973,39 +2047,39 @@ var buildArtifactsSchema = z14.discriminatedUnion("format", [
|
|
|
1973
2047
|
});
|
|
1974
2048
|
|
|
1975
2049
|
// src/server/development.ts
|
|
1976
|
-
import * as
|
|
1977
|
-
var developmentPreflightSchema =
|
|
1978
|
-
organization:
|
|
1979
|
-
project:
|
|
1980
|
-
environment:
|
|
1981
|
-
identity:
|
|
1982
|
-
exchange:
|
|
1983
|
-
activeIntegrations:
|
|
2050
|
+
import * as z17 from "zod";
|
|
2051
|
+
var developmentPreflightSchema = z17.object({
|
|
2052
|
+
organization: z17.string(),
|
|
2053
|
+
project: z17.string(),
|
|
2054
|
+
environment: z17.enum(["test", "live"]),
|
|
2055
|
+
identity: z17.object({
|
|
2056
|
+
exchange: z17.literal("supported"),
|
|
2057
|
+
activeIntegrations: z17.number().int().nonnegative()
|
|
1984
2058
|
}).optional(),
|
|
1985
|
-
staging:
|
|
1986
|
-
development:
|
|
1987
|
-
status:
|
|
2059
|
+
staging: z17.enum(["configured", "blocked"]),
|
|
2060
|
+
development: z17.object({
|
|
2061
|
+
status: z17.enum(["configured", "blocked"]),
|
|
1988
2062
|
// How `domino dev` reaches the preview origin: a Cloudflare tunnel, or a direct route on a
|
|
1989
2063
|
// local development stack. APIs that predate the field use tunnels.
|
|
1990
|
-
transport:
|
|
1991
|
-
missing:
|
|
1992
|
-
authentication:
|
|
2064
|
+
transport: z17.enum(["tunnel", "direct"]).default("tunnel"),
|
|
2065
|
+
missing: z17.array(z17.string()),
|
|
2066
|
+
authentication: z17.array(z17.string())
|
|
1993
2067
|
}),
|
|
1994
|
-
checks:
|
|
1995
|
-
|
|
1996
|
-
id:
|
|
1997
|
-
status:
|
|
1998
|
-
message:
|
|
1999
|
-
missing:
|
|
2000
|
-
issues:
|
|
2068
|
+
checks: z17.array(
|
|
2069
|
+
z17.object({
|
|
2070
|
+
id: z17.string(),
|
|
2071
|
+
status: z17.enum(["ok", "error"]),
|
|
2072
|
+
message: z17.string(),
|
|
2073
|
+
missing: z17.array(z17.string()).optional(),
|
|
2074
|
+
issues: z17.array(z17.string()).optional()
|
|
2001
2075
|
})
|
|
2002
2076
|
)
|
|
2003
2077
|
});
|
|
2004
2078
|
|
|
2005
2079
|
// src/server/hosted.ts
|
|
2006
|
-
import * as
|
|
2080
|
+
import * as z18 from "zod";
|
|
2007
2081
|
var hostedKeyPermissions = ["read", "points", "ingest"];
|
|
2008
|
-
var hostedKeyPermissionList =
|
|
2082
|
+
var hostedKeyPermissionList = z18.array(z18.string()).transform(
|
|
2009
2083
|
(values) => values.filter(
|
|
2010
2084
|
(value) => hostedKeyPermissions.includes(value)
|
|
2011
2085
|
)
|
|
@@ -2017,17 +2091,17 @@ var hostedManagementBindings = [
|
|
|
2017
2091
|
"DOMINO_PROJECT",
|
|
2018
2092
|
"DOMINO_ENVIRONMENT"
|
|
2019
2093
|
];
|
|
2020
|
-
var hostedKeySecretSchema =
|
|
2021
|
-
var hostedKeySchema =
|
|
2022
|
-
id:
|
|
2094
|
+
var hostedKeySecretSchema = z18.string().regex(/^dhk_[A-Za-z0-9_-]{43}$/, "Expected a hosted app key");
|
|
2095
|
+
var hostedKeySchema = z18.object({
|
|
2096
|
+
id: z18.string().uuid(),
|
|
2023
2097
|
token: hostedKeySecretSchema,
|
|
2024
2098
|
organization: identifier,
|
|
2025
2099
|
project: identifier,
|
|
2026
|
-
environment:
|
|
2100
|
+
environment: z18.enum(["test", "live"]),
|
|
2027
2101
|
permissions: hostedKeyPermissionList,
|
|
2028
|
-
expiresAt:
|
|
2102
|
+
expiresAt: z18.number().nullable()
|
|
2029
2103
|
}).strict();
|
|
2030
|
-
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl:
|
|
2104
|
+
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl: z18.string().url() }).strict();
|
|
2031
2105
|
function hostedManagementClient(env) {
|
|
2032
2106
|
const missing = hostedManagementBindings.filter((name) => !env[name]);
|
|
2033
2107
|
if (missing.length) {
|
|
@@ -2035,7 +2109,7 @@ function hostedManagementClient(env) {
|
|
|
2035
2109
|
`Missing ${missing.join(", ")}. Domino sets these for hosted apps and domino dev; update the project's vite.config.ts to forward them in development.`
|
|
2036
2110
|
);
|
|
2037
2111
|
}
|
|
2038
|
-
const environment =
|
|
2112
|
+
const environment = z18.enum(["test", "live"]).parse(env.DOMINO_ENVIRONMENT);
|
|
2039
2113
|
const token = env.DOMINO_MANAGEMENT_KEY;
|
|
2040
2114
|
return createManagementClient({
|
|
2041
2115
|
baseUrl: env.DOMINO_API_URL.replace(/\/+$/, ""),
|
|
@@ -2047,9 +2121,9 @@ function hostedManagementClient(env) {
|
|
|
2047
2121
|
}
|
|
2048
2122
|
|
|
2049
2123
|
// src/server/index.ts
|
|
2050
|
-
var environmentSchema =
|
|
2051
|
-
var roleSchema =
|
|
2052
|
-
var permissionSchema =
|
|
2124
|
+
var environmentSchema = z19.enum(["test", "live"]);
|
|
2125
|
+
var roleSchema = z19.enum(["editor", "reviewer", "staff"]);
|
|
2126
|
+
var permissionSchema = z19.enum([
|
|
2053
2127
|
"read",
|
|
2054
2128
|
"publish",
|
|
2055
2129
|
"review",
|
|
@@ -2069,7 +2143,7 @@ var permissionSchema = z17.enum([
|
|
|
2069
2143
|
*/
|
|
2070
2144
|
"enroll"
|
|
2071
2145
|
]);
|
|
2072
|
-
var permissionListSchema =
|
|
2146
|
+
var permissionListSchema = z19.array(z19.string()).transform(
|
|
2073
2147
|
(values) => values.filter(
|
|
2074
2148
|
(value) => permissionSchema.safeParse(value).success
|
|
2075
2149
|
)
|
|
@@ -2079,38 +2153,38 @@ var rolePermissions = {
|
|
|
2079
2153
|
reviewer: ["read", "review"],
|
|
2080
2154
|
staff: ["read", "confirm", "handover"]
|
|
2081
2155
|
};
|
|
2082
|
-
var projectSetupSchema =
|
|
2083
|
-
mode:
|
|
2084
|
-
brief:
|
|
2156
|
+
var projectSetupSchema = z19.object({
|
|
2157
|
+
mode: z19.enum(["new", "existing"]),
|
|
2158
|
+
brief: z19.string().trim().min(1).max(4e3)
|
|
2085
2159
|
}).strict();
|
|
2086
|
-
var operatorUserSchema =
|
|
2087
|
-
id:
|
|
2088
|
-
name:
|
|
2089
|
-
email:
|
|
2090
|
-
avatar:
|
|
2160
|
+
var operatorUserSchema = z19.object({
|
|
2161
|
+
id: z19.string(),
|
|
2162
|
+
name: z19.string().nullable(),
|
|
2163
|
+
email: z19.string().nullable(),
|
|
2164
|
+
avatar: z19.string().nullable()
|
|
2091
2165
|
});
|
|
2092
|
-
var projectSchema =
|
|
2166
|
+
var projectSchema = z19.object({
|
|
2093
2167
|
/**
|
|
2094
2168
|
* Names the project's hosted addresses. The server gives a new project, and accepts in a
|
|
2095
2169
|
* slug change, only slugs of at least 3 characters that Domino does not reserve. This schema
|
|
2096
2170
|
* checks only the format, so it parses every slug that exists.
|
|
2097
2171
|
*/
|
|
2098
|
-
slug:
|
|
2099
|
-
createdBy:
|
|
2172
|
+
slug: z19.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
2173
|
+
createdBy: z19.string().nullable().optional(),
|
|
2100
2174
|
creator: operatorUserSchema.nullable().optional(),
|
|
2101
2175
|
/** A response, so fields a newer server adds to the setup are dropped, not rejected. */
|
|
2102
|
-
setup:
|
|
2176
|
+
setup: z19.object(projectSetupSchema.shape).optional(),
|
|
2103
2177
|
/** The starter chosen at setup. A plain string, so later starters still parse. */
|
|
2104
|
-
starter:
|
|
2105
|
-
id:
|
|
2178
|
+
starter: z19.string().optional(),
|
|
2179
|
+
id: z19.string().min(1),
|
|
2106
2180
|
organization: identifier,
|
|
2107
2181
|
project: identifier,
|
|
2108
|
-
name:
|
|
2109
|
-
subtitle:
|
|
2110
|
-
initials:
|
|
2111
|
-
color:
|
|
2182
|
+
name: z19.string(),
|
|
2183
|
+
subtitle: z19.string(),
|
|
2184
|
+
initials: z19.string(),
|
|
2185
|
+
color: z19.string(),
|
|
2112
2186
|
permissions: permissionListSchema,
|
|
2113
|
-
environments:
|
|
2187
|
+
environments: z19.array(environmentSchema)
|
|
2114
2188
|
}).refine(
|
|
2115
2189
|
(project) => !project.creator || project.creator.id === project.createdBy,
|
|
2116
2190
|
{
|
|
@@ -2118,45 +2192,45 @@ var projectSchema = z17.object({
|
|
|
2118
2192
|
path: ["creator"]
|
|
2119
2193
|
}
|
|
2120
2194
|
);
|
|
2121
|
-
var projectInputSchema =
|
|
2195
|
+
var projectInputSchema = z19.object({
|
|
2122
2196
|
actionId: identifier,
|
|
2123
|
-
name:
|
|
2197
|
+
name: z19.string().trim().min(1).max(80),
|
|
2124
2198
|
setup: projectSetupSchema.optional(),
|
|
2125
2199
|
/** The starter a new hosted app begins from, with `setup.mode` "new". */
|
|
2126
2200
|
starter: starterIdSchema.optional()
|
|
2127
2201
|
}).strict();
|
|
2128
|
-
var projectUpdateInputSchema =
|
|
2129
|
-
|
|
2130
|
-
|
|
2202
|
+
var projectUpdateInputSchema = z19.union([
|
|
2203
|
+
z19.object({ name: projectInputSchema.shape.name }).strict(),
|
|
2204
|
+
z19.object({
|
|
2131
2205
|
slug: projectSchema.shape.slug,
|
|
2132
|
-
confirm:
|
|
2206
|
+
confirm: z19.string().min(1).max(80)
|
|
2133
2207
|
}).strict()
|
|
2134
2208
|
]);
|
|
2135
|
-
var projectDeletionInputSchema =
|
|
2136
|
-
var projectDeletionSchema =
|
|
2209
|
+
var projectDeletionInputSchema = z19.object({ confirm: z19.string().min(1).max(80) }).strict();
|
|
2210
|
+
var projectDeletionSchema = z19.object({
|
|
2137
2211
|
project: identifier,
|
|
2138
|
-
purgeAfter:
|
|
2212
|
+
purgeAfter: z19.number().int()
|
|
2139
2213
|
});
|
|
2140
|
-
var projectTransferInputSchema =
|
|
2141
|
-
var projectTransferSchema =
|
|
2214
|
+
var projectTransferInputSchema = z19.object({ organization: identifier, confirm: z19.string().min(1).max(80) }).strict();
|
|
2215
|
+
var projectTransferSchema = z19.object({
|
|
2142
2216
|
organization: identifier,
|
|
2143
2217
|
project: identifier
|
|
2144
2218
|
});
|
|
2145
|
-
var grantSchema =
|
|
2146
|
-
subject:
|
|
2147
|
-
roles:
|
|
2148
|
-
environments:
|
|
2219
|
+
var grantSchema = z19.object({
|
|
2220
|
+
subject: z19.string().min(1).max(200),
|
|
2221
|
+
roles: z19.array(roleSchema),
|
|
2222
|
+
environments: z19.array(environmentSchema)
|
|
2149
2223
|
}).strict();
|
|
2150
|
-
var grantRecordSchema =
|
|
2151
|
-
var stockAdditionSchema =
|
|
2224
|
+
var grantRecordSchema = z19.object(grantSchema.shape);
|
|
2225
|
+
var stockAdditionSchema = z19.object({
|
|
2152
2226
|
item: identifier,
|
|
2153
|
-
quantity:
|
|
2227
|
+
quantity: z19.number().int(),
|
|
2154
2228
|
actionId: identifier
|
|
2155
2229
|
});
|
|
2156
|
-
var completionRevokeSchema =
|
|
2230
|
+
var completionRevokeSchema = z19.object({
|
|
2157
2231
|
actionId: identifier,
|
|
2158
|
-
reason:
|
|
2159
|
-
freeOccurrence:
|
|
2232
|
+
reason: z19.string().trim().min(1).max(500),
|
|
2233
|
+
freeOccurrence: z19.boolean().default(false)
|
|
2160
2234
|
}).strict();
|
|
2161
2235
|
var RevokedEntitlementOutcome = {
|
|
2162
2236
|
/** No other completion grants the reward: it is void, after cancelling a handover in progress. */
|
|
@@ -2184,227 +2258,238 @@ var RevokedReferralOutcome = {
|
|
|
2184
2258
|
/** Qualified on another accepted completion of the program's quest instead. */
|
|
2185
2259
|
Requalified: "requalified"
|
|
2186
2260
|
};
|
|
2187
|
-
var entitlementOutcomeSchema =
|
|
2188
|
-
var deliveryOutcomeSchema =
|
|
2189
|
-
var referralOutcomeSchema =
|
|
2190
|
-
var completionRevocationSchema =
|
|
2261
|
+
var entitlementOutcomeSchema = z19.string().min(1).max(64);
|
|
2262
|
+
var deliveryOutcomeSchema = z19.string().min(1).max(64);
|
|
2263
|
+
var referralOutcomeSchema = z19.string().min(1).max(64);
|
|
2264
|
+
var completionRevocationSchema = z19.object({
|
|
2191
2265
|
completion: identifier,
|
|
2192
2266
|
/** The quest ID, or the board ID when `source.kind` is `leaderboard`. */
|
|
2193
2267
|
quest: identifier,
|
|
2194
2268
|
member: identifier,
|
|
2195
2269
|
/** What paid the revoked completion. `source.id` repeats `quest`. */
|
|
2196
2270
|
source: completionSourceSchema.optional(),
|
|
2197
|
-
revokedAt:
|
|
2198
|
-
occurrenceFreed:
|
|
2199
|
-
badges:
|
|
2200
|
-
groups:
|
|
2201
|
-
points:
|
|
2202
|
-
|
|
2271
|
+
revokedAt: z19.number(),
|
|
2272
|
+
occurrenceFreed: z19.boolean(),
|
|
2273
|
+
badges: z19.array(z19.object({ badge: identifier, stillAwarded: z19.boolean() })).optional(),
|
|
2274
|
+
groups: z19.array(z19.object({ group: identifier, stillMember: z19.boolean() })).optional(),
|
|
2275
|
+
points: z19.array(
|
|
2276
|
+
z19.object({
|
|
2203
2277
|
entry: identifier,
|
|
2204
2278
|
balance: identifier,
|
|
2205
2279
|
reversal: identifier.nullable(),
|
|
2206
|
-
reversed:
|
|
2207
|
-
unreversed:
|
|
2280
|
+
reversed: z19.number().int(),
|
|
2281
|
+
unreversed: z19.number().int()
|
|
2208
2282
|
})
|
|
2209
2283
|
),
|
|
2210
|
-
entitlements:
|
|
2211
|
-
|
|
2284
|
+
entitlements: z19.array(
|
|
2285
|
+
z19.object({
|
|
2212
2286
|
entitlement: identifier,
|
|
2213
2287
|
reward: identifier,
|
|
2214
2288
|
outcome: entitlementOutcomeSchema,
|
|
2215
|
-
status:
|
|
2289
|
+
status: z19.string()
|
|
2216
2290
|
})
|
|
2217
2291
|
),
|
|
2218
|
-
deliveries:
|
|
2219
|
-
|
|
2220
|
-
delivery:
|
|
2221
|
-
roleId:
|
|
2292
|
+
deliveries: z19.array(
|
|
2293
|
+
z19.object({
|
|
2294
|
+
delivery: z19.string(),
|
|
2295
|
+
roleId: z19.string(),
|
|
2222
2296
|
outcome: deliveryOutcomeSchema,
|
|
2223
2297
|
/**
|
|
2224
2298
|
* By Relay's records, another accepted, unrevoked completion of the member also granted this
|
|
2225
2299
|
* role to the same Discord account and server. Relay does not read Discord's membership.
|
|
2226
2300
|
*/
|
|
2227
|
-
stillGranted:
|
|
2301
|
+
stillGranted: z19.boolean()
|
|
2228
2302
|
})
|
|
2229
2303
|
),
|
|
2230
|
-
referrals:
|
|
2231
|
-
|
|
2304
|
+
referrals: z19.array(
|
|
2305
|
+
z19.object({
|
|
2232
2306
|
program: identifier,
|
|
2233
2307
|
outcome: referralOutcomeSchema
|
|
2234
2308
|
})
|
|
2235
2309
|
),
|
|
2236
|
-
streakMilestone:
|
|
2310
|
+
streakMilestone: z19.boolean()
|
|
2237
2311
|
});
|
|
2238
|
-
var accessSchema =
|
|
2239
|
-
actor:
|
|
2240
|
-
organization:
|
|
2241
|
-
admin:
|
|
2242
|
-
local:
|
|
2243
|
-
projects:
|
|
2244
|
-
});
|
|
2245
|
-
var querySchema =
|
|
2246
|
-
q:
|
|
2247
|
-
filter:
|
|
2248
|
-
offset:
|
|
2249
|
-
limit:
|
|
2250
|
-
});
|
|
2251
|
-
var accountProfileSchema =
|
|
2252
|
-
name:
|
|
2312
|
+
var accessSchema = z19.object({
|
|
2313
|
+
actor: z19.string(),
|
|
2314
|
+
organization: z19.string(),
|
|
2315
|
+
admin: z19.boolean(),
|
|
2316
|
+
local: z19.boolean(),
|
|
2317
|
+
projects: z19.array(projectSchema)
|
|
2318
|
+
});
|
|
2319
|
+
var querySchema = z19.object({
|
|
2320
|
+
q: z19.string().max(200).default(""),
|
|
2321
|
+
filter: z19.string().max(50).default("all"),
|
|
2322
|
+
offset: z19.coerce.number().int().min(0).max(1e6).default(0),
|
|
2323
|
+
limit: z19.coerce.number().int().min(1).max(100).default(25)
|
|
2324
|
+
});
|
|
2325
|
+
var accountProfileSchema = z19.object({
|
|
2326
|
+
name: z19.string().optional(),
|
|
2253
2327
|
/** The account's handle, where the provider has one (X and Discord). */
|
|
2254
|
-
username:
|
|
2255
|
-
email:
|
|
2256
|
-
emailVerified:
|
|
2257
|
-
imageUrl:
|
|
2328
|
+
username: z19.string().optional(),
|
|
2329
|
+
email: z19.string().optional(),
|
|
2330
|
+
emailVerified: z19.boolean().default(false),
|
|
2331
|
+
imageUrl: z19.string().url().optional()
|
|
2258
2332
|
});
|
|
2259
|
-
var memberAccountSchema =
|
|
2333
|
+
var memberAccountSchema = z19.object({
|
|
2260
2334
|
/** `wallet` for wallet sign-in, `account` for every other connected account. */
|
|
2261
|
-
kind:
|
|
2262
|
-
provider:
|
|
2263
|
-
subject:
|
|
2264
|
-
signInEnabled:
|
|
2265
|
-
profile: accountProfileSchema.optional()
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2335
|
+
kind: z19.enum(["account", "wallet"]),
|
|
2336
|
+
provider: z19.string(),
|
|
2337
|
+
subject: z19.string(),
|
|
2338
|
+
signInEnabled: z19.boolean(),
|
|
2339
|
+
profile: accountProfileSchema.optional(),
|
|
2340
|
+
/**
|
|
2341
|
+
* Present only for accounts Relay reads in the background with the member's own tokens:
|
|
2342
|
+
* `needs-reconnect` once those tokens stopped working, until the member links the account again.
|
|
2343
|
+
*/
|
|
2344
|
+
status: z19.enum(["connected", "needs-reconnect"]).optional(),
|
|
2345
|
+
/**
|
|
2346
|
+
* Why the account needs reconnecting: the member or the provider revoked access (`revoked`),
|
|
2347
|
+
* the tokens expired and cannot be refreshed (`expired`), or a source needs a permission the
|
|
2348
|
+
* member did not grant (`missing-scope`).
|
|
2349
|
+
*/
|
|
2350
|
+
reason: z19.enum(["revoked", "expired", "missing-scope"]).optional()
|
|
2351
|
+
});
|
|
2352
|
+
var operationSchema = z19.object({
|
|
2353
|
+
target: z19.string(),
|
|
2354
|
+
paused: z19.boolean(),
|
|
2355
|
+
revision: z19.number().int(),
|
|
2356
|
+
reason: z19.string(),
|
|
2357
|
+
actor: z19.string().nullable(),
|
|
2358
|
+
changedAt: z19.number()
|
|
2359
|
+
});
|
|
2360
|
+
var operationInputSchema = z19.object({
|
|
2361
|
+
target: z19.union([
|
|
2362
|
+
z19.literal("redemptions"),
|
|
2363
|
+
z19.string().regex(/^quest:[\w-]+$/)
|
|
2279
2364
|
]),
|
|
2280
|
-
paused:
|
|
2281
|
-
revision:
|
|
2282
|
-
reason:
|
|
2365
|
+
paused: z19.boolean(),
|
|
2366
|
+
revision: z19.number().int().nonnegative(),
|
|
2367
|
+
reason: z19.string().trim().min(1).max(500),
|
|
2283
2368
|
actionId: identifier
|
|
2284
2369
|
}).strict();
|
|
2285
|
-
var questLifecycleInputSchema =
|
|
2370
|
+
var questLifecycleInputSchema = z19.object({
|
|
2286
2371
|
quest: identifier,
|
|
2287
2372
|
expectedRelease: identifier.optional(),
|
|
2288
|
-
archived:
|
|
2289
|
-
reason:
|
|
2373
|
+
archived: z19.boolean(),
|
|
2374
|
+
reason: z19.string().trim().min(1).max(500),
|
|
2290
2375
|
actionId: identifier
|
|
2291
2376
|
}).strict();
|
|
2292
|
-
var questLifecycleSchema =
|
|
2377
|
+
var questLifecycleSchema = z19.object({
|
|
2293
2378
|
quest: identifier,
|
|
2294
2379
|
key: identifier.nullable(),
|
|
2295
|
-
title:
|
|
2380
|
+
title: z19.string(),
|
|
2296
2381
|
release: identifier,
|
|
2297
|
-
lifecycle:
|
|
2298
|
-
changed:
|
|
2299
|
-
});
|
|
2300
|
-
var memberSchema =
|
|
2301
|
-
id:
|
|
2302
|
-
test:
|
|
2303
|
-
name:
|
|
2304
|
-
accounts:
|
|
2305
|
-
attempts:
|
|
2306
|
-
completions:
|
|
2307
|
-
rewards:
|
|
2308
|
-
lastActivity:
|
|
2309
|
-
});
|
|
2310
|
-
var personSchema =
|
|
2311
|
-
id:
|
|
2312
|
-
test:
|
|
2313
|
-
name:
|
|
2314
|
-
accounts:
|
|
2315
|
-
});
|
|
2316
|
-
var metricsSchema =
|
|
2317
|
-
quests:
|
|
2318
|
-
members:
|
|
2319
|
-
attempts:
|
|
2320
|
-
completions:
|
|
2321
|
-
review:
|
|
2322
|
-
failed:
|
|
2323
|
-
entitlements:
|
|
2324
|
-
});
|
|
2325
|
-
var readinessSchema =
|
|
2326
|
-
checks:
|
|
2327
|
-
|
|
2328
|
-
id:
|
|
2329
|
-
status:
|
|
2330
|
-
title:
|
|
2331
|
-
detail:
|
|
2382
|
+
lifecycle: z19.enum(["active", "paused", "archived"]),
|
|
2383
|
+
changed: z19.boolean()
|
|
2384
|
+
});
|
|
2385
|
+
var memberSchema = z19.object({
|
|
2386
|
+
id: z19.string(),
|
|
2387
|
+
test: z19.boolean().optional(),
|
|
2388
|
+
name: z19.string().nullable().optional(),
|
|
2389
|
+
accounts: z19.array(memberAccountSchema).default([]),
|
|
2390
|
+
attempts: z19.number(),
|
|
2391
|
+
completions: z19.number(),
|
|
2392
|
+
rewards: z19.number(),
|
|
2393
|
+
lastActivity: z19.number().nullable()
|
|
2394
|
+
});
|
|
2395
|
+
var personSchema = z19.object({
|
|
2396
|
+
id: z19.string(),
|
|
2397
|
+
test: z19.boolean().optional(),
|
|
2398
|
+
name: z19.string().nullable().optional(),
|
|
2399
|
+
accounts: z19.array(memberAccountSchema).default([])
|
|
2400
|
+
});
|
|
2401
|
+
var metricsSchema = z19.object({
|
|
2402
|
+
quests: z19.number(),
|
|
2403
|
+
members: z19.number(),
|
|
2404
|
+
attempts: z19.number(),
|
|
2405
|
+
completions: z19.number(),
|
|
2406
|
+
review: z19.number(),
|
|
2407
|
+
failed: z19.number(),
|
|
2408
|
+
entitlements: z19.number()
|
|
2409
|
+
});
|
|
2410
|
+
var readinessSchema = z19.object({
|
|
2411
|
+
checks: z19.array(
|
|
2412
|
+
z19.object({
|
|
2413
|
+
id: z19.string(),
|
|
2414
|
+
status: z19.enum(["ready", "blocked"]),
|
|
2415
|
+
title: z19.string(),
|
|
2416
|
+
detail: z19.string()
|
|
2332
2417
|
})
|
|
2333
2418
|
)
|
|
2334
2419
|
});
|
|
2335
|
-
var inventorySchema =
|
|
2336
|
-
item:
|
|
2337
|
-
name:
|
|
2338
|
-
available:
|
|
2339
|
-
reserved:
|
|
2340
|
-
allocated:
|
|
2341
|
-
});
|
|
2342
|
-
var auditRecordSchema =
|
|
2343
|
-
id:
|
|
2344
|
-
action:
|
|
2345
|
-
actor:
|
|
2420
|
+
var inventorySchema = z19.object({
|
|
2421
|
+
item: z19.string(),
|
|
2422
|
+
name: z19.string().nullable().default(null),
|
|
2423
|
+
available: z19.number(),
|
|
2424
|
+
reserved: z19.number(),
|
|
2425
|
+
allocated: z19.number().default(0)
|
|
2426
|
+
});
|
|
2427
|
+
var auditRecordSchema = z19.object({
|
|
2428
|
+
id: z19.string(),
|
|
2429
|
+
action: z19.string(),
|
|
2430
|
+
actor: z19.string().nullable(),
|
|
2346
2431
|
user: operatorUserSchema.nullable().optional(),
|
|
2347
|
-
detail:
|
|
2348
|
-
at:
|
|
2349
|
-
attempt:
|
|
2432
|
+
detail: z19.string(),
|
|
2433
|
+
at: z19.number(),
|
|
2434
|
+
attempt: z19.string().nullable()
|
|
2350
2435
|
}).refine((record6) => !record6.user || record6.user.id === record6.actor, {
|
|
2351
2436
|
message: "User profile must match the recorded actor",
|
|
2352
2437
|
path: ["user"]
|
|
2353
2438
|
});
|
|
2354
|
-
var pageSchema =
|
|
2439
|
+
var pageSchema = z19.object({
|
|
2355
2440
|
snapshot: snapshotSchema,
|
|
2356
|
-
members:
|
|
2357
|
-
people:
|
|
2441
|
+
members: z19.array(memberSchema),
|
|
2442
|
+
people: z19.array(personSchema).default([]),
|
|
2358
2443
|
metrics: metricsSchema,
|
|
2359
|
-
total:
|
|
2360
|
-
offset:
|
|
2361
|
-
limit:
|
|
2362
|
-
inventory:
|
|
2363
|
-
operations:
|
|
2364
|
-
audit:
|
|
2365
|
-
questCounts:
|
|
2366
|
-
});
|
|
2367
|
-
var managedOAuthAccountBaseSchema =
|
|
2368
|
-
provider:
|
|
2369
|
-
revision:
|
|
2370
|
-
});
|
|
2371
|
-
var managedOAuthAccountSchema =
|
|
2444
|
+
total: z19.number(),
|
|
2445
|
+
offset: z19.number(),
|
|
2446
|
+
limit: z19.number(),
|
|
2447
|
+
inventory: z19.array(inventorySchema),
|
|
2448
|
+
operations: z19.array(operationSchema).default([]),
|
|
2449
|
+
audit: z19.array(auditRecordSchema).default([]),
|
|
2450
|
+
questCounts: z19.record(z19.string(), z19.number())
|
|
2451
|
+
});
|
|
2452
|
+
var managedOAuthAccountBaseSchema = z19.object({
|
|
2453
|
+
provider: z19.enum(["x", "discord"]),
|
|
2454
|
+
revision: z19.number().int().nonnegative()
|
|
2455
|
+
});
|
|
2456
|
+
var managedOAuthAccountSchema = z19.discriminatedUnion("status", [
|
|
2372
2457
|
managedOAuthAccountBaseSchema.extend({
|
|
2373
|
-
status:
|
|
2374
|
-
subject:
|
|
2375
|
-
linkedAt:
|
|
2458
|
+
status: z19.literal("connected"),
|
|
2459
|
+
subject: z19.string().min(1),
|
|
2460
|
+
linkedAt: z19.number(),
|
|
2376
2461
|
/**
|
|
2377
2462
|
* True when a member import attached the account with the organization's word for it, not the
|
|
2378
2463
|
* member's proof. Absent from Relay versions without imports.
|
|
2379
2464
|
*/
|
|
2380
|
-
imported:
|
|
2465
|
+
imported: z19.boolean().optional(),
|
|
2381
2466
|
/**
|
|
2382
2467
|
* True for a real account an operator linked to a test member without OAuth
|
|
2383
2468
|
* (`testMembers.linkAccount`). Absent from Relay versions without it.
|
|
2384
2469
|
*/
|
|
2385
|
-
testLinked:
|
|
2470
|
+
testLinked: z19.boolean().optional()
|
|
2386
2471
|
}),
|
|
2387
|
-
managedOAuthAccountBaseSchema.extend({ status:
|
|
2472
|
+
managedOAuthAccountBaseSchema.extend({ status: z19.literal("disconnected") })
|
|
2388
2473
|
]);
|
|
2389
2474
|
var managedTelegramAccountBaseSchema = managedOAuthAccountBaseSchema.extend({
|
|
2390
|
-
provider:
|
|
2475
|
+
provider: z19.literal("telegram")
|
|
2391
2476
|
});
|
|
2392
|
-
var managedTelegramAccountSchema =
|
|
2477
|
+
var managedTelegramAccountSchema = z19.discriminatedUnion("status", [
|
|
2393
2478
|
managedTelegramAccountBaseSchema.extend({
|
|
2394
|
-
status:
|
|
2479
|
+
status: z19.literal("connected"),
|
|
2395
2480
|
/** The numeric Telegram user ID. */
|
|
2396
|
-
subject:
|
|
2397
|
-
linkedAt:
|
|
2481
|
+
subject: z19.string().min(1),
|
|
2482
|
+
linkedAt: z19.number()
|
|
2398
2483
|
}),
|
|
2399
2484
|
managedTelegramAccountBaseSchema.extend({
|
|
2400
|
-
status:
|
|
2485
|
+
status: z19.literal("disconnected")
|
|
2401
2486
|
})
|
|
2402
2487
|
]);
|
|
2403
|
-
var memberOAuthUnlinkInputSchema =
|
|
2404
|
-
provider:
|
|
2405
|
-
subject:
|
|
2406
|
-
revision:
|
|
2407
|
-
reason:
|
|
2488
|
+
var memberOAuthUnlinkInputSchema = z19.object({
|
|
2489
|
+
provider: z19.enum(["x", "discord"]),
|
|
2490
|
+
subject: z19.string().min(1).max(4096),
|
|
2491
|
+
revision: z19.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER - 1),
|
|
2492
|
+
reason: z19.string().trim().min(1).max(500)
|
|
2408
2493
|
}).strict();
|
|
2409
2494
|
var memberTelegramUnlinkInputSchema = memberOAuthUnlinkInputSchema.omit({ provider: true }).strict();
|
|
2410
2495
|
var managedWalletSchema = linkedWalletSchema.extend({
|
|
@@ -2412,32 +2497,32 @@ var managedWalletSchema = linkedWalletSchema.extend({
|
|
|
2412
2497
|
* True when a member import attached the wallet with the organization's word for it, and the
|
|
2413
2498
|
* member has not proved it since. Absent from Relay versions without imports.
|
|
2414
2499
|
*/
|
|
2415
|
-
imported:
|
|
2416
|
-
status:
|
|
2417
|
-
unlinkedAt:
|
|
2500
|
+
imported: z19.boolean().optional(),
|
|
2501
|
+
status: z19.enum(["linked", "unlinked"]),
|
|
2502
|
+
unlinkedAt: z19.number().int().nullable(),
|
|
2418
2503
|
/** "member", or the operator or key that unlinked it. */
|
|
2419
|
-
unlinkedBy:
|
|
2504
|
+
unlinkedBy: z19.string().nullable()
|
|
2420
2505
|
});
|
|
2421
2506
|
var managedMemberIdentitySchema = memberIdentitySchema.extend({
|
|
2422
2507
|
/**
|
|
2423
2508
|
* True for an X account a member import attached, until the member links or signs in with it
|
|
2424
2509
|
* through X. Absent from Relay versions without imports.
|
|
2425
2510
|
*/
|
|
2426
|
-
imported:
|
|
2511
|
+
imported: z19.boolean().optional(),
|
|
2427
2512
|
/**
|
|
2428
2513
|
* True for a real X or Discord account an operator linked to a test member without OAuth
|
|
2429
2514
|
* (`testMembers.linkAccount`). Absent from Relay versions without it.
|
|
2430
2515
|
*/
|
|
2431
|
-
testLinked:
|
|
2432
|
-
status:
|
|
2433
|
-
unlinkedAt:
|
|
2516
|
+
testLinked: z19.boolean().optional(),
|
|
2517
|
+
status: z19.enum(["linked", "unlinked"]),
|
|
2518
|
+
unlinkedAt: z19.number().int().nullable(),
|
|
2434
2519
|
/** The operator or key that unlinked it. */
|
|
2435
|
-
unlinkedBy:
|
|
2520
|
+
unlinkedBy: z19.string().nullable()
|
|
2436
2521
|
});
|
|
2437
|
-
var memberIdentityChangeInputSchema =
|
|
2522
|
+
var memberIdentityChangeInputSchema = z19.object({
|
|
2438
2523
|
kind: appIdentityKindSchema,
|
|
2439
|
-
subject:
|
|
2440
|
-
reason:
|
|
2524
|
+
subject: z19.string().min(1).max(256),
|
|
2525
|
+
reason: z19.string().trim().min(1).max(500)
|
|
2441
2526
|
}).strict();
|
|
2442
2527
|
var balanceCheckSchema = walletBalanceSchema.pick({
|
|
2443
2528
|
chain: true,
|
|
@@ -2447,76 +2532,76 @@ var balanceCheckSchema = walletBalanceSchema.pick({
|
|
|
2447
2532
|
wallets: true,
|
|
2448
2533
|
observedAt: true
|
|
2449
2534
|
}).extend({ attempt: identifier });
|
|
2450
|
-
var walletBalanceChainsSchema =
|
|
2451
|
-
chains:
|
|
2452
|
-
|
|
2453
|
-
chain:
|
|
2454
|
-
|
|
2535
|
+
var walletBalanceChainsSchema = z19.object({
|
|
2536
|
+
chains: z19.array(
|
|
2537
|
+
z19.object({
|
|
2538
|
+
chain: z19.union([
|
|
2539
|
+
z19.literal(solanaMainnet),
|
|
2455
2540
|
cosmosNetworkSchema,
|
|
2456
2541
|
evmChainIdSchema
|
|
2457
2542
|
]),
|
|
2458
|
-
name:
|
|
2459
|
-
testnet:
|
|
2543
|
+
name: z19.string(),
|
|
2544
|
+
testnet: z19.boolean()
|
|
2460
2545
|
})
|
|
2461
2546
|
)
|
|
2462
2547
|
});
|
|
2463
|
-
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason:
|
|
2548
|
+
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason: z19.string().trim().min(1).max(500) }).strict();
|
|
2464
2549
|
var memberWalletSignInInputSchema = walletUnlinkInputSchema.extend({
|
|
2465
|
-
enabled:
|
|
2466
|
-
reason:
|
|
2550
|
+
enabled: z19.boolean(),
|
|
2551
|
+
reason: z19.string().trim().min(1).max(500)
|
|
2467
2552
|
}).strict();
|
|
2468
|
-
var telegramBotIdSchema =
|
|
2469
|
-
var participantSignInSchema =
|
|
2470
|
-
providers:
|
|
2471
|
-
|
|
2553
|
+
var telegramBotIdSchema = z19.string().regex(/^[1-9][0-9]{0,19}$/, "Enter the bot's numeric ID, such as 123456789");
|
|
2554
|
+
var participantSignInSchema = z19.object({
|
|
2555
|
+
providers: z19.array(
|
|
2556
|
+
z19.object({ provider: authProviderSchema, configured: z19.boolean() })
|
|
2472
2557
|
),
|
|
2473
|
-
email:
|
|
2558
|
+
email: z19.boolean(),
|
|
2474
2559
|
/** Wallet families: `"solana"`, `"eip155"`, `"cosmos"`. */
|
|
2475
2560
|
wallets: walletSignInNetworksSchema,
|
|
2476
2561
|
/** Why participants cannot sign in to this project, or null. */
|
|
2477
|
-
issue:
|
|
2562
|
+
issue: z19.string().nullable(),
|
|
2478
2563
|
/**
|
|
2479
2564
|
* Telegram, outside `providers` in SDK 1.x: whether Domino configured Telegram Login, and the
|
|
2480
2565
|
* bot whose Mini App participants sign in from, or null when Mini App sign-in is off. Absent
|
|
2481
2566
|
* from Relay versions without Telegram.
|
|
2482
2567
|
*/
|
|
2483
|
-
telegram:
|
|
2484
|
-
login:
|
|
2568
|
+
telegram: z19.object({
|
|
2569
|
+
login: z19.boolean(),
|
|
2485
2570
|
miniAppBotId: telegramBotIdSchema.nullable()
|
|
2486
2571
|
}).optional(),
|
|
2487
|
-
updatedAt:
|
|
2488
|
-
updatedBy:
|
|
2572
|
+
updatedAt: z19.number().nullable(),
|
|
2573
|
+
updatedBy: z19.string().nullable()
|
|
2489
2574
|
});
|
|
2490
|
-
var participantSignInInputSchema =
|
|
2575
|
+
var participantSignInInputSchema = z19.object({
|
|
2491
2576
|
wallets: walletSignInNetworksSchema,
|
|
2492
|
-
telegram:
|
|
2577
|
+
telegram: z19.object({ miniAppBotId: telegramBotIdSchema.nullable() }).strict().optional()
|
|
2493
2578
|
}).strict();
|
|
2494
|
-
var completionRevocationShortfallSchema =
|
|
2579
|
+
var completionRevocationShortfallSchema = z19.object({
|
|
2495
2580
|
completion: identifier,
|
|
2496
2581
|
quest: identifier,
|
|
2497
|
-
revokedAt:
|
|
2498
|
-
unreversedPoints:
|
|
2582
|
+
revokedAt: z19.number().int().nonnegative().safe(),
|
|
2583
|
+
unreversedPoints: z19.record(identifier, z19.number().int().positive().safe())
|
|
2499
2584
|
});
|
|
2500
|
-
var memberDetailSchema =
|
|
2585
|
+
var memberDetailSchema = z19.object({
|
|
2501
2586
|
snapshot: snapshotSchema,
|
|
2502
2587
|
member: memberSchema,
|
|
2503
2588
|
progress: memberProgressSchema,
|
|
2504
2589
|
/** Up to 25 revoked completions with an unreversed point remainder, newest first. */
|
|
2505
|
-
revocationShortfalls:
|
|
2590
|
+
revocationShortfalls: z19.array(completionRevocationShortfallSchema).default([]),
|
|
2506
2591
|
/** Current and historical campaign enrollment state, including inactive enrollments. */
|
|
2507
|
-
campaignEnrollments:
|
|
2508
|
-
passes:
|
|
2509
|
-
|
|
2510
|
-
provider:
|
|
2511
|
-
event:
|
|
2512
|
-
subject:
|
|
2592
|
+
campaignEnrollments: z19.array(campaignEnrollmentSchema).default([]),
|
|
2593
|
+
passes: z19.array(
|
|
2594
|
+
z19.object({
|
|
2595
|
+
provider: z19.string(),
|
|
2596
|
+
event: z19.string(),
|
|
2597
|
+
subject: z19.string(),
|
|
2513
2598
|
attempt: identifier.nullable()
|
|
2514
2599
|
})
|
|
2515
2600
|
).default([]),
|
|
2516
2601
|
/** Linked and unlinked wallets. */
|
|
2517
|
-
wallets:
|
|
2602
|
+
wallets: z19.array(managedWalletSchema),
|
|
2518
2603
|
/** The member's 10 most recent recorded balance reads, newest first. */
|
|
2519
|
-
balanceChecks:
|
|
2604
|
+
balanceChecks: z19.array(balanceCheckSchema),
|
|
2520
2605
|
/** The member's participant profile in this project. */
|
|
2521
2606
|
profile: managedProfileSchema.nullable(),
|
|
2522
2607
|
/**
|
|
@@ -2524,11 +2609,16 @@ var memberDetailSchema = z17.object({
|
|
|
2524
2609
|
* member ID: their selected X and Discord accounts and their `app:<name>` identities in this
|
|
2525
2610
|
* project, including app identities an operator unlinked, by kind.
|
|
2526
2611
|
*/
|
|
2527
|
-
identities:
|
|
2612
|
+
identities: z19.array(managedMemberIdentitySchema),
|
|
2613
|
+
/**
|
|
2614
|
+
* The creator accounts the member linked (a YouTube channel), whose content managed tracker
|
|
2615
|
+
* sources attribute to them. Absent from Relay versions without creator accounts.
|
|
2616
|
+
*/
|
|
2617
|
+
creatorAccounts: z19.array(managedCreatorAccountSchema).optional()
|
|
2528
2618
|
});
|
|
2529
|
-
var managedMemberProgressSchema =
|
|
2619
|
+
var managedMemberProgressSchema = z19.object({
|
|
2530
2620
|
member: identifier,
|
|
2531
|
-
quests:
|
|
2621
|
+
quests: z19.array(
|
|
2532
2622
|
memberProgressSchema.shape.quests.element.extend({
|
|
2533
2623
|
/** The streak as `members.get` reports it, without the list of qualifying days. */
|
|
2534
2624
|
streak: streakProgressSchema.omit({ days: true }).nullable().optional()
|
|
@@ -2539,156 +2629,172 @@ var managedMemberProgressSchema = z17.object({
|
|
|
2539
2629
|
/** Each point balance the member has, by balance ID. */
|
|
2540
2630
|
balances: snapshotSchema.shape.balances
|
|
2541
2631
|
});
|
|
2542
|
-
var stockInputSchema =
|
|
2632
|
+
var stockInputSchema = z19.object({
|
|
2543
2633
|
item: identifier,
|
|
2544
|
-
quantity:
|
|
2634
|
+
quantity: z19.number().int().positive().max(1e6),
|
|
2545
2635
|
actionId: identifier
|
|
2546
2636
|
}).strict();
|
|
2547
|
-
var ingestTrackerScopeSchema =
|
|
2548
|
-
var tokenScopeInputSchema =
|
|
2549
|
-
var tokenInputSchema =
|
|
2550
|
-
name:
|
|
2637
|
+
var ingestTrackerScopeSchema = z19.array(identifier).min(1).max(100).nullable();
|
|
2638
|
+
var tokenScopeInputSchema = z19.object({ ingestTrackers: ingestTrackerScopeSchema }).strict();
|
|
2639
|
+
var tokenInputSchema = z19.object({
|
|
2640
|
+
name: z19.string().trim().min(1).max(80),
|
|
2551
2641
|
project: identifier,
|
|
2552
2642
|
environment: environmentSchema,
|
|
2553
|
-
permissions:
|
|
2643
|
+
permissions: z19.array(permissionSchema).min(1),
|
|
2554
2644
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
2555
|
-
days:
|
|
2645
|
+
days: z19.number().int().min(1).max(90).default(30)
|
|
2556
2646
|
}).strict();
|
|
2557
|
-
var tokenSchema =
|
|
2558
|
-
id:
|
|
2559
|
-
name:
|
|
2560
|
-
project:
|
|
2647
|
+
var tokenSchema = z19.object({
|
|
2648
|
+
id: z19.string(),
|
|
2649
|
+
name: z19.string(),
|
|
2650
|
+
project: z19.string(),
|
|
2561
2651
|
environment: environmentSchema,
|
|
2562
2652
|
permissions: permissionListSchema,
|
|
2563
2653
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
2564
|
-
expiresAt:
|
|
2654
|
+
expiresAt: z19.number()
|
|
2565
2655
|
});
|
|
2566
|
-
var issuedTokenSchema = tokenSchema.extend({ token:
|
|
2567
|
-
var serviceKeyInputSchema =
|
|
2568
|
-
name:
|
|
2569
|
-
permissions:
|
|
2656
|
+
var issuedTokenSchema = tokenSchema.extend({ token: z19.string() });
|
|
2657
|
+
var serviceKeyInputSchema = z19.object({
|
|
2658
|
+
name: z19.string().trim().min(1).max(80),
|
|
2659
|
+
permissions: z19.array(permissionSchema).min(1).refine(
|
|
2570
2660
|
(permissions) => !permissions.includes("access"),
|
|
2571
2661
|
"Service keys cannot hold the access permission"
|
|
2572
2662
|
),
|
|
2573
2663
|
/** Days until the first secret expires. Omit it for a key that never expires. */
|
|
2574
|
-
expiresInDays:
|
|
2664
|
+
expiresInDays: z19.number().int().min(1).max(3650).optional()
|
|
2575
2665
|
}).strict();
|
|
2576
|
-
var serviceKeySchema =
|
|
2577
|
-
id:
|
|
2578
|
-
organization:
|
|
2579
|
-
project:
|
|
2666
|
+
var serviceKeySchema = z19.object({
|
|
2667
|
+
id: z19.string().uuid(),
|
|
2668
|
+
organization: z19.string(),
|
|
2669
|
+
project: z19.string(),
|
|
2580
2670
|
environment: environmentSchema,
|
|
2581
|
-
name:
|
|
2671
|
+
name: z19.string(),
|
|
2582
2672
|
permissions: permissionListSchema,
|
|
2583
2673
|
/** The Clerk user ID of the administrator who created it. */
|
|
2584
|
-
createdBy:
|
|
2585
|
-
createdAt:
|
|
2674
|
+
createdBy: z19.string(),
|
|
2675
|
+
createdAt: z19.number(),
|
|
2586
2676
|
/** The latest use of any of its secrets, revoked ones included; null when none was used. */
|
|
2587
|
-
lastUsedAt:
|
|
2677
|
+
lastUsedAt: z19.number().nullable(),
|
|
2588
2678
|
/** Its working secrets, oldest first. Any of them authenticates the key. */
|
|
2589
|
-
secrets:
|
|
2679
|
+
secrets: z19.array(credentialSecretSchema)
|
|
2590
2680
|
});
|
|
2591
2681
|
var issuedServiceKeySchema = serviceKeySchema.extend({
|
|
2592
|
-
secret:
|
|
2593
|
-
token:
|
|
2682
|
+
secret: z19.string().uuid(),
|
|
2683
|
+
token: z19.string()
|
|
2594
2684
|
});
|
|
2595
|
-
var teamSchema =
|
|
2596
|
-
|
|
2685
|
+
var teamSchema = z19.array(
|
|
2686
|
+
z19.object({ id: z19.string(), label: z19.string() })
|
|
2597
2687
|
);
|
|
2598
|
-
var memberLookupSchema =
|
|
2599
|
-
provider:
|
|
2600
|
-
subject:
|
|
2688
|
+
var memberLookupSchema = z19.object({
|
|
2689
|
+
provider: z19.string().min(1).max(200),
|
|
2690
|
+
subject: z19.string().min(1).max(2048)
|
|
2601
2691
|
}).strict();
|
|
2602
|
-
var booleanQuery =
|
|
2603
|
-
|
|
2604
|
-
|
|
2692
|
+
var booleanQuery = z19.union([
|
|
2693
|
+
z19.boolean(),
|
|
2694
|
+
z19.enum(["true", "false"]).transform((v) => v === "true")
|
|
2605
2695
|
]);
|
|
2606
|
-
var managedMemberQuerySchema =
|
|
2607
|
-
q:
|
|
2696
|
+
var managedMemberQuerySchema = z19.strictObject({
|
|
2697
|
+
q: z19.string().max(200).optional(),
|
|
2608
2698
|
needsReview: booleanQuery.optional(),
|
|
2609
|
-
limit:
|
|
2699
|
+
limit: z19.coerce.number().int().min(1).max(100).optional(),
|
|
2610
2700
|
cursor: pageCursorSchema.optional()
|
|
2611
2701
|
});
|
|
2612
|
-
var managedMemberPageSchema =
|
|
2613
|
-
items:
|
|
2614
|
-
total:
|
|
2615
|
-
nextCursor:
|
|
2702
|
+
var managedMemberPageSchema = z19.object({
|
|
2703
|
+
items: z19.array(memberSchema),
|
|
2704
|
+
total: z19.number().int().nonnegative(),
|
|
2705
|
+
nextCursor: z19.string().nullable()
|
|
2706
|
+
});
|
|
2707
|
+
var activeMemberMonthSchema = z19.object({
|
|
2708
|
+
/** `YYYY-MM`, in UTC. */
|
|
2709
|
+
month: z19.string(),
|
|
2710
|
+
activeMembers: z19.number().int().nonnegative()
|
|
2711
|
+
});
|
|
2712
|
+
var activeMemberUsageSchema = activeMemberMonthSchema.extend({
|
|
2713
|
+
plan: z19.string(),
|
|
2714
|
+
limit: z19.number().int().nonnegative().nullable(),
|
|
2715
|
+
history: z19.array(activeMemberMonthSchema)
|
|
2716
|
+
});
|
|
2717
|
+
var realPeopleInTestUsageSchema = z19.object({
|
|
2718
|
+
realPeople: z19.number().int().nonnegative(),
|
|
2719
|
+
plan: z19.string(),
|
|
2720
|
+
limit: z19.number().int().nonnegative(),
|
|
2721
|
+
enforced: z19.boolean()
|
|
2616
2722
|
});
|
|
2617
2723
|
var projectMetricsSchema = metricsSchema.extend({
|
|
2618
|
-
completionsByQuest:
|
|
2619
|
-
|
|
2724
|
+
completionsByQuest: z19.array(
|
|
2725
|
+
z19.object({ quest: identifier, completions: z19.number() })
|
|
2620
2726
|
)
|
|
2621
2727
|
});
|
|
2622
|
-
var pageLimit =
|
|
2623
|
-
var managedAttemptQuerySchema =
|
|
2624
|
-
q:
|
|
2728
|
+
var pageLimit = z19.coerce.number().int().min(1).max(100).optional();
|
|
2729
|
+
var managedAttemptQuerySchema = z19.strictObject({
|
|
2730
|
+
q: z19.string().max(200).optional(),
|
|
2625
2731
|
quest: identifier.optional(),
|
|
2626
|
-
status:
|
|
2732
|
+
status: z19.string().min(1).max(50).optional(),
|
|
2627
2733
|
limit: pageLimit,
|
|
2628
2734
|
cursor: pageCursorSchema.optional()
|
|
2629
2735
|
});
|
|
2630
|
-
var managedAttemptPageSchema =
|
|
2631
|
-
items:
|
|
2632
|
-
releases:
|
|
2633
|
-
people:
|
|
2634
|
-
total:
|
|
2635
|
-
nextCursor:
|
|
2736
|
+
var managedAttemptPageSchema = z19.object({
|
|
2737
|
+
items: z19.array(attemptSchema),
|
|
2738
|
+
releases: z19.array(publishedReleaseSchema),
|
|
2739
|
+
people: z19.array(personSchema),
|
|
2740
|
+
total: z19.number().int().nonnegative(),
|
|
2741
|
+
nextCursor: z19.string().nullable()
|
|
2636
2742
|
});
|
|
2637
|
-
var managedReleaseQuerySchema =
|
|
2743
|
+
var managedReleaseQuerySchema = z19.strictObject({
|
|
2638
2744
|
quest: identifier.optional(),
|
|
2639
2745
|
limit: pageLimit,
|
|
2640
2746
|
cursor: pageCursorSchema.optional()
|
|
2641
2747
|
});
|
|
2642
|
-
var managedReleasePageSchema =
|
|
2643
|
-
items:
|
|
2644
|
-
nextCursor:
|
|
2748
|
+
var managedReleasePageSchema = z19.object({
|
|
2749
|
+
items: z19.array(publishedReleaseSchema),
|
|
2750
|
+
nextCursor: z19.string().nullable()
|
|
2645
2751
|
});
|
|
2646
|
-
var managedAttemptSchema =
|
|
2752
|
+
var managedAttemptSchema = z19.object({
|
|
2647
2753
|
attempt: attemptSchema,
|
|
2648
2754
|
release: publishedReleaseSchema.nullable(),
|
|
2649
|
-
events:
|
|
2755
|
+
events: z19.array(eventSchema),
|
|
2650
2756
|
person: personSchema
|
|
2651
2757
|
});
|
|
2652
|
-
var managedEntitlementQuerySchema =
|
|
2653
|
-
q:
|
|
2654
|
-
status:
|
|
2758
|
+
var managedEntitlementQuerySchema = z19.strictObject({
|
|
2759
|
+
q: z19.string().max(200).optional(),
|
|
2760
|
+
status: z19.string().min(1).max(50).optional(),
|
|
2655
2761
|
limit: pageLimit,
|
|
2656
2762
|
cursor: pageCursorSchema.optional()
|
|
2657
2763
|
});
|
|
2658
|
-
var managedEntitlementPageSchema =
|
|
2659
|
-
items:
|
|
2660
|
-
people:
|
|
2661
|
-
total:
|
|
2662
|
-
nextCursor:
|
|
2764
|
+
var managedEntitlementPageSchema = z19.object({
|
|
2765
|
+
items: z19.array(entitlementSchema),
|
|
2766
|
+
people: z19.array(personSchema),
|
|
2767
|
+
total: z19.number().int().nonnegative(),
|
|
2768
|
+
nextCursor: z19.string().nullable()
|
|
2663
2769
|
});
|
|
2664
|
-
var managedEntitlementSchema =
|
|
2770
|
+
var managedEntitlementSchema = z19.object({
|
|
2665
2771
|
entitlement: entitlementSchema,
|
|
2666
2772
|
person: personSchema
|
|
2667
2773
|
});
|
|
2668
2774
|
var managedStockItemSchema = inventorySchema.extend({
|
|
2669
|
-
offers:
|
|
2775
|
+
offers: z19.array(identifier)
|
|
2670
2776
|
});
|
|
2671
|
-
var auditQuerySchema =
|
|
2672
|
-
category:
|
|
2673
|
-
q:
|
|
2777
|
+
var auditQuerySchema = z19.strictObject({
|
|
2778
|
+
category: z19.enum(["reviews", "rewards", "configuration"]).optional(),
|
|
2779
|
+
q: z19.string().max(200).optional(),
|
|
2674
2780
|
limit: pageLimit,
|
|
2675
2781
|
cursor: pageCursorSchema.optional()
|
|
2676
2782
|
});
|
|
2677
2783
|
var auditListQuerySchema = auditQuerySchema.extend({
|
|
2678
|
-
category:
|
|
2784
|
+
category: z19.enum(["reviews", "rewards", "configuration", "test-members"]).optional()
|
|
2679
2785
|
});
|
|
2680
2786
|
var accessHistoryQuerySchema = auditQuerySchema.omit({
|
|
2681
2787
|
category: true
|
|
2682
2788
|
});
|
|
2683
|
-
var auditPageSchema =
|
|
2684
|
-
items:
|
|
2685
|
-
total:
|
|
2686
|
-
nextCursor:
|
|
2789
|
+
var auditPageSchema = z19.object({
|
|
2790
|
+
items: z19.array(auditRecordSchema),
|
|
2791
|
+
total: z19.number().int().nonnegative(),
|
|
2792
|
+
nextCursor: z19.string().nullable()
|
|
2687
2793
|
});
|
|
2688
|
-
var verifiedPassSchema =
|
|
2794
|
+
var verifiedPassSchema = z19.object({
|
|
2689
2795
|
provider: identifier,
|
|
2690
2796
|
event: identifier,
|
|
2691
|
-
subject:
|
|
2797
|
+
subject: z19.string().min(1).max(2048),
|
|
2692
2798
|
member: identifier,
|
|
2693
2799
|
quest: identifier
|
|
2694
2800
|
}).strict();
|
|
@@ -2705,6 +2811,18 @@ function queryString(values) {
|
|
|
2705
2811
|
).toString();
|
|
2706
2812
|
return query ? "?" + query : "";
|
|
2707
2813
|
}
|
|
2814
|
+
function analyticsMetricQueryString(input) {
|
|
2815
|
+
const { filter, ...query } = analyticsMetricQuerySchema.parse(input);
|
|
2816
|
+
return queryString({
|
|
2817
|
+
...query,
|
|
2818
|
+
...Object.fromEntries(
|
|
2819
|
+
Object.entries(filter ?? {}).map(([name, keys]) => [
|
|
2820
|
+
`filter.${name}`,
|
|
2821
|
+
[].concat(keys).join(",")
|
|
2822
|
+
])
|
|
2823
|
+
)
|
|
2824
|
+
});
|
|
2825
|
+
}
|
|
2708
2826
|
function clientFailure(error) {
|
|
2709
2827
|
if (error instanceof ManagementError) {
|
|
2710
2828
|
return error;
|
|
@@ -2712,7 +2830,7 @@ function clientFailure(error) {
|
|
|
2712
2830
|
return new ManagementError({
|
|
2713
2831
|
kind: "client",
|
|
2714
2832
|
code: ManagementErrorCode.InvalidInput,
|
|
2715
|
-
message: error instanceof
|
|
2833
|
+
message: error instanceof z19.ZodError ? `Invalid management request: ${z19.prettifyError(error)}` : error instanceof Error ? error.message : "Invalid management request",
|
|
2716
2834
|
cause: error
|
|
2717
2835
|
});
|
|
2718
2836
|
}
|
|
@@ -2750,7 +2868,7 @@ function managementClient(options) {
|
|
|
2750
2868
|
call
|
|
2751
2869
|
);
|
|
2752
2870
|
}
|
|
2753
|
-
const ok =
|
|
2871
|
+
const ok = z19.object({ ok: z19.literal(true) });
|
|
2754
2872
|
function pointHistory(member, ledger, query = {}, call) {
|
|
2755
2873
|
return get(
|
|
2756
2874
|
`/points/${identifier.parse(member)}/${identifier.parse(ledger)}/history${queryString(typeof query === "number" ? { before: query } : pageQuerySchema.parse(query))}`,
|
|
@@ -2835,7 +2953,7 @@ function managementClient(options) {
|
|
|
2835
2953
|
const input = isInput ? inputOrCall ?? {} : {};
|
|
2836
2954
|
const options2 = isInput ? call : inputOrCall;
|
|
2837
2955
|
return post(
|
|
2838
|
-
`/webhooks/${
|
|
2956
|
+
`/webhooks/${z19.string().uuid().parse(id)}/rotate-secret`,
|
|
2839
2957
|
webhookSecretSchema,
|
|
2840
2958
|
webhookRotateInputSchema.parse(withActionId(input)),
|
|
2841
2959
|
options2
|
|
@@ -2883,8 +3001,8 @@ function managementClient(options) {
|
|
|
2883
3001
|
}
|
|
2884
3002
|
return exchange(
|
|
2885
3003
|
path,
|
|
2886
|
-
|
|
2887
|
-
status:
|
|
3004
|
+
z19.object({
|
|
3005
|
+
status: z19.number(),
|
|
2888
3006
|
operationId: identifier.optional(),
|
|
2889
3007
|
result: schema
|
|
2890
3008
|
}),
|
|
@@ -2939,7 +3057,7 @@ function managementClient(options) {
|
|
|
2939
3057
|
call
|
|
2940
3058
|
),
|
|
2941
3059
|
...resourceArchiveMethods("tracker"),
|
|
2942
|
-
list: (call) => get("/trackers",
|
|
3060
|
+
list: (call) => get("/trackers", z19.array(trackerStatusSchema), call),
|
|
2943
3061
|
get: (reference, call) => get(
|
|
2944
3062
|
`/trackers/${identifier.parse(reference)}`,
|
|
2945
3063
|
trackerStatusSchema,
|
|
@@ -3055,7 +3173,7 @@ function managementClient(options) {
|
|
|
3055
3173
|
engagementPublishSchema.parse(withActionId(input)),
|
|
3056
3174
|
call
|
|
3057
3175
|
),
|
|
3058
|
-
list: (call) => get("/engagement",
|
|
3176
|
+
list: (call) => get("/engagement", z19.array(engagementRuleSchema), call),
|
|
3059
3177
|
page: (input, call) => get(
|
|
3060
3178
|
"/engagement/history" + queryString(engagementPageQuerySchema.parse(input)),
|
|
3061
3179
|
engagementPageSchema,
|
|
@@ -3075,7 +3193,7 @@ function managementClient(options) {
|
|
|
3075
3193
|
)
|
|
3076
3194
|
},
|
|
3077
3195
|
badges: {
|
|
3078
|
-
list: (call) => get("/badges",
|
|
3196
|
+
list: (call) => get("/badges", z19.array(managedBadgeSchema), call),
|
|
3079
3197
|
create: (input, call) => create("/badges", managedBadgeSchema, createBadgeSchema, input, call),
|
|
3080
3198
|
update: (badge, input, call) => {
|
|
3081
3199
|
const body = badgePropertiesSchema.extend(badgeMutationSchema.shape).parse(withActionId(input));
|
|
@@ -3118,7 +3236,7 @@ function managementClient(options) {
|
|
|
3118
3236
|
},
|
|
3119
3237
|
pointLedgers: {
|
|
3120
3238
|
unarchive: (ledger, input, call) => archiveResource("point-ledger", ledger, false, input, call),
|
|
3121
|
-
list: (call) => get("/point-ledgers",
|
|
3239
|
+
list: (call) => get("/point-ledgers", z19.array(managedPointLedgerSchema), call),
|
|
3122
3240
|
/**
|
|
3123
3241
|
* Creates a point ledger, with a stable `key` when code refers to it; requires `publish`. In
|
|
3124
3242
|
* live, only a person in Console can create one.
|
|
@@ -3148,7 +3266,7 @@ function managementClient(options) {
|
|
|
3148
3266
|
},
|
|
3149
3267
|
points: {
|
|
3150
3268
|
/** @deprecated Use `pointLedgers.list()`, which reads the same ledgers. Removed in 2.0.0. */
|
|
3151
|
-
ledgers: (call) => get("/point-ledgers",
|
|
3269
|
+
ledgers: (call) => get("/point-ledgers", z19.array(managedPointLedgerSchema), call),
|
|
3152
3270
|
/** @deprecated Use `pointLedgers.create(input)`. Removed in 2.0.0. */
|
|
3153
3271
|
createLedger: createPointLedger,
|
|
3154
3272
|
/**
|
|
@@ -3186,7 +3304,7 @@ function managementClient(options) {
|
|
|
3186
3304
|
referralHistorySchema,
|
|
3187
3305
|
call
|
|
3188
3306
|
),
|
|
3189
|
-
list: (call) => get("/referrals",
|
|
3307
|
+
list: (call) => get("/referrals", z19.array(publishedReferralSchema), call),
|
|
3190
3308
|
participants: referralParticipants,
|
|
3191
3309
|
/**
|
|
3192
3310
|
* Suspends or restores a member's referral relationship, with a reason; requires `publish`.
|
|
@@ -3249,7 +3367,7 @@ function managementClient(options) {
|
|
|
3249
3367
|
},
|
|
3250
3368
|
leaderboards: {
|
|
3251
3369
|
...resourceArchiveMethods("leaderboard"),
|
|
3252
|
-
list: (call) => get("/leaderboards",
|
|
3370
|
+
list: (call) => get("/leaderboards", z19.array(publishedLeaderboardSchema), call),
|
|
3253
3371
|
standings: (board, input = {}, call) => {
|
|
3254
3372
|
const query = leaderboardQuerySchema.parse(input);
|
|
3255
3373
|
return get(
|
|
@@ -3263,13 +3381,13 @@ function managementClient(options) {
|
|
|
3263
3381
|
},
|
|
3264
3382
|
history: (board, call) => get(
|
|
3265
3383
|
`/leaderboards/${identifier.parse(board)}/history`,
|
|
3266
|
-
|
|
3384
|
+
z19.array(publishedLeaderboardSchema),
|
|
3267
3385
|
call
|
|
3268
3386
|
),
|
|
3269
3387
|
/** Current members of the board's exclusion group (`exclusionGroup`), by member ID. */
|
|
3270
3388
|
exclusions: (board, call) => get(
|
|
3271
3389
|
`/leaderboards/${identifier.parse(board)}/exclusions`,
|
|
3272
|
-
|
|
3390
|
+
z19.array(z19.object({ member: identifier })),
|
|
3273
3391
|
call
|
|
3274
3392
|
),
|
|
3275
3393
|
/**
|
|
@@ -3315,7 +3433,7 @@ function managementClient(options) {
|
|
|
3315
3433
|
leaderboardGroupSchema.parse(withActionId(input)),
|
|
3316
3434
|
call
|
|
3317
3435
|
),
|
|
3318
|
-
/**
|
|
3436
|
+
/** Closing, pending, approved and rejected snapshots; requires read permission. */
|
|
3319
3437
|
settlementReviews: (reference, query = {}, call) => get(
|
|
3320
3438
|
`/leaderboards/${identifier.parse(reference)}/settlement-reviews${queryString(leaderboardSettlementReviewQuerySchema.parse(query))}`,
|
|
3321
3439
|
leaderboardSettlementReviewPageSchema,
|
|
@@ -3326,15 +3444,37 @@ function managementClient(options) {
|
|
|
3326
3444
|
leaderboardSettlementReviewSchema,
|
|
3327
3445
|
call
|
|
3328
3446
|
),
|
|
3447
|
+
/**
|
|
3448
|
+
* A settlement as a payout list: each frozen row's pool share, in base units and formatted,
|
|
3449
|
+
* with the member's verified linked wallets. Requires read permission.
|
|
3450
|
+
*/
|
|
3451
|
+
settlementExport: (settlement, call) => get(
|
|
3452
|
+
`/leaderboard-settlements/${identifier.parse(settlement)}/export`,
|
|
3453
|
+
leaderboardSettlementExportSchema,
|
|
3454
|
+
call
|
|
3455
|
+
),
|
|
3329
3456
|
rejectSettlement: (settlement, input, call) => post(
|
|
3330
3457
|
`/leaderboard-settlements/${identifier.parse(settlement)}/reject`,
|
|
3331
3458
|
leaderboardSettlementReviewSchema,
|
|
3332
3459
|
leaderboardSettlementRejectionSchema.parse(withActionId(input)),
|
|
3333
3460
|
call
|
|
3334
3461
|
),
|
|
3462
|
+
/**
|
|
3463
|
+
* Takes the closing measurement again for the content a settlement froze without it (its
|
|
3464
|
+
* `unmeasured` list), or extends a closing settlement's wait. The settlement returns to
|
|
3465
|
+
* closing and freezes again when the measurement ends. Requires review permission.
|
|
3466
|
+
*/
|
|
3467
|
+
retrySettlementMeasurement: (settlement, input = {}, call) => post(
|
|
3468
|
+
`/leaderboard-settlements/${identifier.parse(settlement)}/retry-measurement`,
|
|
3469
|
+
leaderboardSettlementReviewSchema,
|
|
3470
|
+
leaderboardSettlementMeasurementRetrySchema.parse(
|
|
3471
|
+
withActionId(input)
|
|
3472
|
+
),
|
|
3473
|
+
call
|
|
3474
|
+
),
|
|
3335
3475
|
settlements: (board, call) => get(
|
|
3336
3476
|
`/leaderboards/${identifier.parse(board)}/settlements`,
|
|
3337
|
-
|
|
3477
|
+
z19.array(leaderboardSettlementSummarySchema),
|
|
3338
3478
|
call
|
|
3339
3479
|
),
|
|
3340
3480
|
settlement: (settlement, call) => get(
|
|
@@ -3419,7 +3559,7 @@ function managementClient(options) {
|
|
|
3419
3559
|
*
|
|
3420
3560
|
* @deprecated Use `history`, which pages by `cursor` and `nextCursor`. Removed in 2.0.0.
|
|
3421
3561
|
*/
|
|
3422
|
-
list: (call) => get("/deployments",
|
|
3562
|
+
list: (call) => get("/deployments", z19.array(deploymentRecordSchema), call),
|
|
3423
3563
|
/**
|
|
3424
3564
|
* The project environment's deployments, newest first, one page at a time, with the two
|
|
3425
3565
|
* newest published deployments beside every page. Pass a page's `nextCursor` back as
|
|
@@ -3554,6 +3694,78 @@ function managementClient(options) {
|
|
|
3554
3694
|
call
|
|
3555
3695
|
)
|
|
3556
3696
|
},
|
|
3697
|
+
/**
|
|
3698
|
+
* The project's Stripe subscription, Checkout, plan changes and the organization's customer
|
|
3699
|
+
* portal. Everything but `read` needs an organization administrator, and while billing is
|
|
3700
|
+
* staff-only, Domino staff.
|
|
3701
|
+
*/
|
|
3702
|
+
billing: {
|
|
3703
|
+
/** Whether billing is open to the caller, and the project's subscription when it is. */
|
|
3704
|
+
read: (call) => get("/billing", projectBillingSchema, call),
|
|
3705
|
+
/**
|
|
3706
|
+
* A Stripe Checkout page subscribing the project to `plan`, billed every `interval`. A project
|
|
3707
|
+
* with a subscription that still holds its plan is refused with `subscription-exists`.
|
|
3708
|
+
*/
|
|
3709
|
+
checkout: (input, call) => post(
|
|
3710
|
+
"/billing/checkout",
|
|
3711
|
+
billingSessionSchema,
|
|
3712
|
+
billingCheckoutInputSchema.parse(input),
|
|
3713
|
+
call
|
|
3714
|
+
),
|
|
3715
|
+
/**
|
|
3716
|
+
* Moves the project's subscription to `plan`, billed every `interval`: a higher plan or annual
|
|
3717
|
+
* billing now, prorated; a lower plan or monthly billing at the renewal. Refused without a
|
|
3718
|
+
* subscription that holds its plan (`no-subscription`) and while it is set to cancel
|
|
3719
|
+
* (`subscription-canceling`).
|
|
3720
|
+
*/
|
|
3721
|
+
changePlan: (input, call) => post(
|
|
3722
|
+
"/billing/plan",
|
|
3723
|
+
billingPlanChangeSchema,
|
|
3724
|
+
billingPlanChangeInputSchema.parse(input),
|
|
3725
|
+
call
|
|
3726
|
+
),
|
|
3727
|
+
/**
|
|
3728
|
+
* Sets the subscription to end when the period paid for ends; the project keeps its plan
|
|
3729
|
+
* until then. Drops a plan change held for the renewal.
|
|
3730
|
+
*/
|
|
3731
|
+
cancel: (call) => post("/billing/cancel", projectBillingSchema, {}, call),
|
|
3732
|
+
/** Takes back a cancellation before the period ends. */
|
|
3733
|
+
resume: (call) => post("/billing/resume", projectBillingSchema, {}, call),
|
|
3734
|
+
/**
|
|
3735
|
+
* A Stripe Checkout page buying `quantity` packs of AI builder credit for the project, on any
|
|
3736
|
+
* plan; the credit is added once the payment is in.
|
|
3737
|
+
*/
|
|
3738
|
+
topup: (input, call) => post(
|
|
3739
|
+
"/billing/topup",
|
|
3740
|
+
billingSessionSchema,
|
|
3741
|
+
billingTopupInputSchema.parse(input),
|
|
3742
|
+
call
|
|
3743
|
+
),
|
|
3744
|
+
/** The Stripe customer portal for the organization's cards, invoices and billing details. */
|
|
3745
|
+
portal: (call) => post("/billing/portal", billingSessionSchema, {}, call),
|
|
3746
|
+
/**
|
|
3747
|
+
* The organization's billing for any of its members: each project's plan and subscription,
|
|
3748
|
+
* the Free projects against their limit, the shared free AI allowance and the trial.
|
|
3749
|
+
*/
|
|
3750
|
+
organization: (call) => get("/organization/billing", organizationBillingSchema, call),
|
|
3751
|
+
/**
|
|
3752
|
+
* The customer portal, as `portal()` opens it, returning to the organization's billing page in
|
|
3753
|
+
* Console rather than a project's.
|
|
3754
|
+
*/
|
|
3755
|
+
organizationPortal: (call) => post("/organization/billing/portal", billingSessionSchema, {}, call)
|
|
3756
|
+
},
|
|
3757
|
+
/** What the project uses against its plan; requires `read` permission. */
|
|
3758
|
+
usage: {
|
|
3759
|
+
/** Live active members this UTC month, the plan's limit, and the previous six months. */
|
|
3760
|
+
activeMembers: (call) => get("/usage/active-members", activeMemberUsageSchema, call),
|
|
3761
|
+
/** Real people in the test environment, against the plan's limit. */
|
|
3762
|
+
realPeopleInTest: (call) => get("/usage/real-people-in-test", realPeopleInTestUsageSchema, call),
|
|
3763
|
+
/**
|
|
3764
|
+
* The project's plan and where it came from, whether it may serve live, the organization's
|
|
3765
|
+
* trial, the AI builder balance and the Stripe subscription.
|
|
3766
|
+
*/
|
|
3767
|
+
plan: (call) => get("/usage/plan", projectPlanSchema, call)
|
|
3768
|
+
},
|
|
3557
3769
|
/** The project's headline counts; requires `read` permission. */
|
|
3558
3770
|
metrics: {
|
|
3559
3771
|
read: (call) => get("/metrics", projectMetricsSchema, call)
|
|
@@ -3570,6 +3782,74 @@ function managementClient(options) {
|
|
|
3570
3782
|
`/analytics${queryString(analyticsQuerySchema.parse(query))}`,
|
|
3571
3783
|
analyticsReadSchema,
|
|
3572
3784
|
call
|
|
3785
|
+
),
|
|
3786
|
+
/**
|
|
3787
|
+
* The closed metric catalog: every metric's ID, definition, breakdowns, filters, allowed
|
|
3788
|
+
* charts and whether it needs a point ledger. Requires `read` permission.
|
|
3789
|
+
*/
|
|
3790
|
+
catalog: (call) => get("/analytics/catalog", analyticsCatalogSchema, call),
|
|
3791
|
+
/**
|
|
3792
|
+
* One catalog metric over a range, bucketed like `read`: its value and, with `breakdown`, a
|
|
3793
|
+
* row per quest, offer, program, source or reason, largest first, capped by `limit` (1 to
|
|
3794
|
+
* 100, default 100) with the rest summed into `other`. `filter` narrows to keys
|
|
3795
|
+
* (`{ quest: ["a", "b"], group: "vip" }`), and `ledger` names the point ledger a points
|
|
3796
|
+
* metric reads. A metric, breakdown or filter the catalog doesn't accept is a 422. Requires
|
|
3797
|
+
* `read` permission.
|
|
3798
|
+
*/
|
|
3799
|
+
query: (query, call) => get(
|
|
3800
|
+
`/analytics/query${analyticsMetricQueryString(query)}`,
|
|
3801
|
+
analyticsMetricResultSchema,
|
|
3802
|
+
call
|
|
3803
|
+
)
|
|
3804
|
+
},
|
|
3805
|
+
/**
|
|
3806
|
+
* Dashboards defined in project code (`defineDashboard`), each a set of catalog metric
|
|
3807
|
+
* panels. They are deployed in test and promoted to live, and archived rather than deleted.
|
|
3808
|
+
*/
|
|
3809
|
+
dashboards: {
|
|
3810
|
+
/**
|
|
3811
|
+
* The project's dashboards by position (those without one last), then title. Archived
|
|
3812
|
+
* dashboards are left out unless `includeArchived`. Requires `read` permission.
|
|
3813
|
+
*/
|
|
3814
|
+
list: (query = {}, call) => {
|
|
3815
|
+
dashboardListQuerySchema.parse(query);
|
|
3816
|
+
return get(
|
|
3817
|
+
`/dashboards${queryString(query)}`,
|
|
3818
|
+
dashboardListSchema,
|
|
3819
|
+
call
|
|
3820
|
+
);
|
|
3821
|
+
},
|
|
3822
|
+
/**
|
|
3823
|
+
* One dashboard, archived ones included, with every panel's result over `range` (the
|
|
3824
|
+
* dashboard's `defaultRange` by default) in one response. A panel whose query fails, such as
|
|
3825
|
+
* on a group this environment lacks or a timeout, carries its own coded `error` and the
|
|
3826
|
+
* other panels still have results. Requires `read` permission.
|
|
3827
|
+
*/
|
|
3828
|
+
read: (query, call) => {
|
|
3829
|
+
const { key, ...rest } = dashboardReadQuerySchema.parse(query);
|
|
3830
|
+
return get(
|
|
3831
|
+
`/dashboards/${key}${queryString(rest)}`,
|
|
3832
|
+
dashboardReadSchema,
|
|
3833
|
+
call
|
|
3834
|
+
);
|
|
3835
|
+
},
|
|
3836
|
+
/**
|
|
3837
|
+
* Archive a dashboard in test, with a reason the audit log records: it leaves `list` unless
|
|
3838
|
+
* `includeArchived`, stays readable, and stays archived when its code deploys again. Live
|
|
3839
|
+
* gets the change through a promotion. Requires `publish` permission.
|
|
3840
|
+
*/
|
|
3841
|
+
archive: (key, input, call) => post(
|
|
3842
|
+
`/dashboards/${identifier.parse(key)}/archive`,
|
|
3843
|
+
dashboardLifecycleResultSchema,
|
|
3844
|
+
resourceArchiveInputSchema.parse(withActionId(input)),
|
|
3845
|
+
call
|
|
3846
|
+
),
|
|
3847
|
+
/** Restore an archived dashboard in test. Requires `publish` permission. */
|
|
3848
|
+
unarchive: (key, input, call) => post(
|
|
3849
|
+
`/dashboards/${identifier.parse(key)}/unarchive`,
|
|
3850
|
+
dashboardLifecycleResultSchema,
|
|
3851
|
+
resourceArchiveInputSchema.parse(withActionId(input)),
|
|
3852
|
+
call
|
|
3573
3853
|
)
|
|
3574
3854
|
},
|
|
3575
3855
|
/** Release history: every version a quest has been published as. */
|
|
@@ -3774,7 +4054,7 @@ function managementClient(options) {
|
|
|
3774
4054
|
},
|
|
3775
4055
|
operations: {
|
|
3776
4056
|
/** Every paused or resumed operation: redemptions and each quest's participation; requires `read`. */
|
|
3777
|
-
list: (call) => get("/operations",
|
|
4057
|
+
list: (call) => get("/operations", z19.array(operationSchema), call),
|
|
3778
4058
|
/**
|
|
3779
4059
|
* Pauses or resumes redemptions or one quest's participation, against the `revision` the
|
|
3780
4060
|
* operator saw, with a reason; requires `publish` permission.
|
|
@@ -3832,7 +4112,7 @@ function managementClient(options) {
|
|
|
3832
4112
|
call
|
|
3833
4113
|
),
|
|
3834
4114
|
/** Every stock item with its counts and the offers that sell it; requires `read` permission. */
|
|
3835
|
-
list: (call) => get("/stock-items",
|
|
4115
|
+
list: (call) => get("/stock-items", z19.array(managedStockItemSchema), call),
|
|
3836
4116
|
createItem: (input, call) => create(
|
|
3837
4117
|
"/stock-items",
|
|
3838
4118
|
stockItemSchema,
|
|
@@ -3847,7 +4127,7 @@ function managementClient(options) {
|
|
|
3847
4127
|
stockInputSchema.parse(withActionId(input)),
|
|
3848
4128
|
call
|
|
3849
4129
|
),
|
|
3850
|
-
catalog: (call) => get("/pickup-inventory",
|
|
4130
|
+
catalog: (call) => get("/pickup-inventory", z19.array(pickupCatalogSchema), call),
|
|
3851
4131
|
configure: (input, call) => post(
|
|
3852
4132
|
"/pickup-inventory",
|
|
3853
4133
|
pickupCatalogSchema,
|
|
@@ -3873,7 +4153,7 @@ function managementClient(options) {
|
|
|
3873
4153
|
offerControlSchema.omit({ enabled: true }).parse(withActionId(input)),
|
|
3874
4154
|
call
|
|
3875
4155
|
),
|
|
3876
|
-
list: (call) => get("/offers",
|
|
4156
|
+
list: (call) => get("/offers", z19.array(offerSchema), call),
|
|
3877
4157
|
/**
|
|
3878
4158
|
* Every redemption, or one member's, newest first, in one unbounded response.
|
|
3879
4159
|
*
|
|
@@ -3881,7 +4161,7 @@ function managementClient(options) {
|
|
|
3881
4161
|
*/
|
|
3882
4162
|
redemptions: (input = {}, call) => get(
|
|
3883
4163
|
`/redemptions${queryString({ member: input.member })}`,
|
|
3884
|
-
|
|
4164
|
+
z19.array(redemptionSchema),
|
|
3885
4165
|
call
|
|
3886
4166
|
),
|
|
3887
4167
|
/** Pauses or resumes an offer at the revision the operator saw. */
|
|
@@ -3930,7 +4210,7 @@ function managementClient(options) {
|
|
|
3930
4210
|
* them; API keys and project-scoped playground sessions cannot.
|
|
3931
4211
|
*/
|
|
3932
4212
|
tokens: {
|
|
3933
|
-
list: (call) => get("/tokens",
|
|
4213
|
+
list: (call) => get("/tokens", z19.array(tokenSchema), call),
|
|
3934
4214
|
/**
|
|
3935
4215
|
* Issues a key for one project and environment, limited to permissions the caller holds
|
|
3936
4216
|
* there. The secret `token` is in this response only.
|
|
@@ -3938,14 +4218,14 @@ function managementClient(options) {
|
|
|
3938
4218
|
create: (input, call) => post("/tokens", issuedTokenSchema, tokenInputSchema.parse(input), call),
|
|
3939
4219
|
/** Replace a personal key's ingestion restriction without changing its secret. */
|
|
3940
4220
|
scope: (id, input, call) => request(
|
|
3941
|
-
`/tokens/${encodeURIComponent(
|
|
4221
|
+
`/tokens/${encodeURIComponent(z19.string().min(1).parse(id))}/scope`,
|
|
3942
4222
|
tokenSchema,
|
|
3943
4223
|
tokenScopeInputSchema.parse(input),
|
|
3944
4224
|
"PUT",
|
|
3945
4225
|
call
|
|
3946
4226
|
),
|
|
3947
4227
|
revoke: (id, call) => request(
|
|
3948
|
-
`/tokens/${encodeURIComponent(
|
|
4228
|
+
`/tokens/${encodeURIComponent(z19.string().min(1).parse(id))}`,
|
|
3949
4229
|
ok,
|
|
3950
4230
|
void 0,
|
|
3951
4231
|
"DELETE",
|
|
@@ -3957,7 +4237,7 @@ function managementClient(options) {
|
|
|
3957
4237
|
* environment, owned by no person. Only an organization administrator in Console manages them.
|
|
3958
4238
|
*/
|
|
3959
4239
|
serviceKeys: {
|
|
3960
|
-
list: (call) => get("/service-keys",
|
|
4240
|
+
list: (call) => get("/service-keys", z19.array(serviceKeySchema), call),
|
|
3961
4241
|
/** The secret `token` is in this response only. */
|
|
3962
4242
|
create: (input, call) => post(
|
|
3963
4243
|
"/service-keys",
|
|
@@ -3970,14 +4250,14 @@ function managementClient(options) {
|
|
|
3970
4250
|
* them with `revokeSecret`. The new `token` is in this response only.
|
|
3971
4251
|
*/
|
|
3972
4252
|
addSecret: (id, input = {}, call) => post(
|
|
3973
|
-
`/service-keys/${
|
|
4253
|
+
`/service-keys/${z19.string().uuid().parse(id)}/secrets`,
|
|
3974
4254
|
issuedServiceKeySchema,
|
|
3975
4255
|
credentialSecretInputSchema.parse(input),
|
|
3976
4256
|
call
|
|
3977
4257
|
),
|
|
3978
4258
|
/** Stops one secret working. A key's last secret cannot be revoked; revoke the key instead. */
|
|
3979
4259
|
revokeSecret: (id, secret, call) => request(
|
|
3980
|
-
`/service-keys/${
|
|
4260
|
+
`/service-keys/${z19.string().uuid().parse(id)}/secrets/${z19.string().uuid().parse(secret)}`,
|
|
3981
4261
|
serviceKeySchema,
|
|
3982
4262
|
void 0,
|
|
3983
4263
|
"DELETE",
|
|
@@ -3985,8 +4265,8 @@ function managementClient(options) {
|
|
|
3985
4265
|
),
|
|
3986
4266
|
/** Deletes the key; every secret stops working. */
|
|
3987
4267
|
revoke: (id, call) => request(
|
|
3988
|
-
`/service-keys/${
|
|
3989
|
-
|
|
4268
|
+
`/service-keys/${z19.string().uuid().parse(id)}`,
|
|
4269
|
+
z19.null(),
|
|
3990
4270
|
void 0,
|
|
3991
4271
|
"DELETE",
|
|
3992
4272
|
call
|
|
@@ -3994,7 +4274,7 @@ function managementClient(options) {
|
|
|
3994
4274
|
},
|
|
3995
4275
|
/** Who holds which roles on the client's project; organization administrators only. */
|
|
3996
4276
|
grants: {
|
|
3997
|
-
list: (call) => get("/grants",
|
|
4277
|
+
list: (call) => get("/grants", z19.array(grantRecordSchema), call),
|
|
3998
4278
|
/** Replaces one person's roles and environments on the project. The audit log records it. */
|
|
3999
4279
|
set: (input, call) => request(
|
|
4000
4280
|
"/grants",
|
|
@@ -4011,7 +4291,7 @@ function managementClient(options) {
|
|
|
4011
4291
|
/** Signed activity notifications for one project/environment; writes require publish permission. */
|
|
4012
4292
|
webhooks: {
|
|
4013
4293
|
state: (id, call) => get(
|
|
4014
|
-
`/webhooks/${
|
|
4294
|
+
`/webhooks/${z19.string().uuid().parse(id)}/state`,
|
|
4015
4295
|
webhookEndpointStateSchema,
|
|
4016
4296
|
call
|
|
4017
4297
|
),
|
|
@@ -4022,24 +4302,24 @@ function managementClient(options) {
|
|
|
4022
4302
|
call
|
|
4023
4303
|
),
|
|
4024
4304
|
delete: (id, input, call) => post(
|
|
4025
|
-
`/webhooks/${
|
|
4305
|
+
`/webhooks/${z19.string().uuid().parse(id)}/delete`,
|
|
4026
4306
|
webhookEndpointStateSchema,
|
|
4027
4307
|
webhookDeleteInputSchema.parse(withActionId(input)),
|
|
4028
4308
|
call
|
|
4029
4309
|
),
|
|
4030
4310
|
pause: (id, input = {}, call) => post(
|
|
4031
|
-
`/webhooks/${
|
|
4311
|
+
`/webhooks/${z19.string().uuid().parse(id)}/pause`,
|
|
4032
4312
|
webhookEndpointSchema,
|
|
4033
4313
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
4034
4314
|
call
|
|
4035
4315
|
),
|
|
4036
4316
|
resume: (id, input = {}, call) => post(
|
|
4037
|
-
`/webhooks/${
|
|
4317
|
+
`/webhooks/${z19.string().uuid().parse(id)}/resume`,
|
|
4038
4318
|
webhookEndpointSchema,
|
|
4039
4319
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
4040
4320
|
call
|
|
4041
4321
|
),
|
|
4042
|
-
list: (call) => get("/webhooks",
|
|
4322
|
+
list: (call) => get("/webhooks", z19.array(webhookEndpointSchema), call),
|
|
4043
4323
|
/** Pass an `actionId` to recover the endpoint and its secret after a lost answer. */
|
|
4044
4324
|
create: (input, call) => post(
|
|
4045
4325
|
"/webhooks",
|
|
@@ -4048,7 +4328,7 @@ function managementClient(options) {
|
|
|
4048
4328
|
call
|
|
4049
4329
|
),
|
|
4050
4330
|
update: (id, input, call) => request(
|
|
4051
|
-
`/webhooks/${
|
|
4331
|
+
`/webhooks/${z19.string().uuid().parse(id)}`,
|
|
4052
4332
|
webhookEndpointSchema,
|
|
4053
4333
|
webhookUpdateSchema.parse(input),
|
|
4054
4334
|
"PUT",
|
|
@@ -4056,19 +4336,19 @@ function managementClient(options) {
|
|
|
4056
4336
|
),
|
|
4057
4337
|
/** @deprecated Use pause. Removed in 2.0.0. */
|
|
4058
4338
|
disable: (id, call) => post(
|
|
4059
|
-
`/webhooks/${
|
|
4339
|
+
`/webhooks/${z19.string().uuid().parse(id)}/disable`,
|
|
4060
4340
|
webhookEndpointSchema,
|
|
4061
4341
|
{},
|
|
4062
4342
|
call
|
|
4063
4343
|
),
|
|
4064
4344
|
rotateSecret: rotateWebhookSecret,
|
|
4065
4345
|
deliveries: (id, query = {}, call) => get(
|
|
4066
|
-
`/webhooks/${
|
|
4346
|
+
`/webhooks/${z19.string().uuid().parse(id)}/deliveries${queryString(webhookQuerySchema.parse(query))}`,
|
|
4067
4347
|
webhookDeliveryPageSchema,
|
|
4068
4348
|
call
|
|
4069
4349
|
),
|
|
4070
4350
|
replay: (id, delivery, call) => post(
|
|
4071
|
-
`/webhooks/${
|
|
4351
|
+
`/webhooks/${z19.string().uuid().parse(id)}/deliveries/${z19.string().uuid().parse(delivery)}/replay`,
|
|
4072
4352
|
webhookDeliverySchema,
|
|
4073
4353
|
{},
|
|
4074
4354
|
call
|
|
@@ -4079,7 +4359,7 @@ function managementClient(options) {
|
|
|
4079
4359
|
* environment. Organization administrators, from a Console session only.
|
|
4080
4360
|
*/
|
|
4081
4361
|
identityIntegrations: {
|
|
4082
|
-
list: (call) => get("/identity-integrations",
|
|
4362
|
+
list: (call) => get("/identity-integrations", z19.array(identityIntegrationSchema), call),
|
|
4083
4363
|
/** The secret `token` is in this response only. */
|
|
4084
4364
|
create: (input, call) => post(
|
|
4085
4365
|
"/identity-integrations",
|
|
@@ -4094,7 +4374,7 @@ function managementClient(options) {
|
|
|
4094
4374
|
* @deprecated Use `addSecret`, then `revokeSecret` the old secret once your app uses the new one.
|
|
4095
4375
|
*/
|
|
4096
4376
|
rotate: (id, call) => post(
|
|
4097
|
-
`/identity-integrations/${
|
|
4377
|
+
`/identity-integrations/${z19.string().uuid().parse(id)}/rotate`,
|
|
4098
4378
|
identityIntegrationSecretSchema,
|
|
4099
4379
|
{},
|
|
4100
4380
|
call
|
|
@@ -4104,7 +4384,7 @@ function managementClient(options) {
|
|
|
4104
4384
|
* revoke them with `revokeSecret`. The new `token` is in this response only.
|
|
4105
4385
|
*/
|
|
4106
4386
|
addSecret: (id, input = {}, call) => post(
|
|
4107
|
-
`/identity-integrations/${
|
|
4387
|
+
`/identity-integrations/${z19.string().uuid().parse(id)}/secrets`,
|
|
4108
4388
|
identityIntegrationSecretSchema,
|
|
4109
4389
|
credentialSecretInputSchema.parse(input),
|
|
4110
4390
|
call
|
|
@@ -4114,7 +4394,7 @@ function managementClient(options) {
|
|
|
4114
4394
|
* revoked; disconnect the integration with `revoke` instead.
|
|
4115
4395
|
*/
|
|
4116
4396
|
revokeSecret: (id, secret, call) => request(
|
|
4117
|
-
`/identity-integrations/${
|
|
4397
|
+
`/identity-integrations/${z19.string().uuid().parse(id)}/secrets/${z19.string().uuid().parse(secret)}`,
|
|
4118
4398
|
identityIntegrationSchema,
|
|
4119
4399
|
void 0,
|
|
4120
4400
|
"DELETE",
|
|
@@ -4122,7 +4402,7 @@ function managementClient(options) {
|
|
|
4122
4402
|
),
|
|
4123
4403
|
/** Makes one secret never expire. */
|
|
4124
4404
|
removeSecretExpiry: (id, secret, call) => request(
|
|
4125
|
-
`/identity-integrations/${
|
|
4405
|
+
`/identity-integrations/${z19.string().uuid().parse(id)}/secrets/${z19.string().uuid().parse(secret)}/expiry`,
|
|
4126
4406
|
identityIntegrationSchema,
|
|
4127
4407
|
void 0,
|
|
4128
4408
|
"DELETE",
|
|
@@ -4135,7 +4415,7 @@ function managementClient(options) {
|
|
|
4135
4415
|
*/
|
|
4136
4416
|
kinds: (call) => get(
|
|
4137
4417
|
"/identity-integrations/kinds",
|
|
4138
|
-
|
|
4418
|
+
z19.array(identityKindClaimSchema),
|
|
4139
4419
|
call
|
|
4140
4420
|
),
|
|
4141
4421
|
/**
|
|
@@ -4143,8 +4423,8 @@ function managementClient(options) {
|
|
|
4143
4423
|
* and keep attributing tracker records; unlink them on the member to stop that.
|
|
4144
4424
|
*/
|
|
4145
4425
|
revoke: (id, call) => request(
|
|
4146
|
-
`/identity-integrations/${
|
|
4147
|
-
|
|
4426
|
+
`/identity-integrations/${z19.string().uuid().parse(id)}`,
|
|
4427
|
+
z19.null(),
|
|
4148
4428
|
void 0,
|
|
4149
4429
|
"DELETE",
|
|
4150
4430
|
call
|
|
@@ -4195,7 +4475,7 @@ function managementClient(options) {
|
|
|
4195
4475
|
resources: {
|
|
4196
4476
|
list: (call) => get(
|
|
4197
4477
|
"/resources",
|
|
4198
|
-
|
|
4478
|
+
z19.object({ resources: z19.array(managedResourceSchema) }),
|
|
4199
4479
|
call
|
|
4200
4480
|
),
|
|
4201
4481
|
/** @deprecated Use the resource archive/unarchive methods. Removed in 2.0.0. */
|
|
@@ -4266,7 +4546,7 @@ function managementClient(options) {
|
|
|
4266
4546
|
testMemberCreateSchema.parse(withActionId(input)),
|
|
4267
4547
|
call
|
|
4268
4548
|
),
|
|
4269
|
-
list: (call) => get("/test-members",
|
|
4549
|
+
list: (call) => get("/test-members", z19.array(testMemberSchema), call),
|
|
4270
4550
|
history: (member, query = {}, call) => get(
|
|
4271
4551
|
`/test-members/${identifier.parse(member)}/history${queryString(testMemberHistoryQuerySchema.parse(query))}`,
|
|
4272
4552
|
testMemberHistorySchema,
|
|
@@ -4502,13 +4782,13 @@ function managementClient(options) {
|
|
|
4502
4782
|
)
|
|
4503
4783
|
},
|
|
4504
4784
|
counters: {
|
|
4505
|
-
history: (member,
|
|
4506
|
-
`/members/${identifier.parse(member)}/counters/${identifier.parse(
|
|
4785
|
+
history: (member, quest, query = {}, call) => get(
|
|
4786
|
+
`/members/${identifier.parse(member)}/counters/${identifier.parse(quest)}${queryString(counterHistoryQuerySchema.parse(query))}`,
|
|
4507
4787
|
counterHistorySchema,
|
|
4508
4788
|
call
|
|
4509
4789
|
),
|
|
4510
|
-
moderate: (member,
|
|
4511
|
-
`/members/${identifier.parse(member)}/counters/${identifier.parse(
|
|
4790
|
+
moderate: (member, quest, contribution, input, call) => post(
|
|
4791
|
+
`/members/${identifier.parse(member)}/counters/${identifier.parse(quest)}/${identifier.parse(contribution)}/moderate`,
|
|
4512
4792
|
counterModerationResultSchema,
|
|
4513
4793
|
counterModerationSchema.parse(withActionId(input)),
|
|
4514
4794
|
call
|
|
@@ -4550,7 +4830,7 @@ function managementClient(options) {
|
|
|
4550
4830
|
/** Who each member is: up to 100 distinct IDs; unknown IDs come back without accounts. */
|
|
4551
4831
|
people: (members, call) => get(
|
|
4552
4832
|
`/people${queryString({ ids: members.join(",") })}`,
|
|
4553
|
-
|
|
4833
|
+
z19.array(personSchema),
|
|
4554
4834
|
call
|
|
4555
4835
|
),
|
|
4556
4836
|
/**
|
|
@@ -4560,7 +4840,7 @@ function managementClient(options) {
|
|
|
4560
4840
|
*/
|
|
4561
4841
|
oauthAccounts: (member, call) => get(
|
|
4562
4842
|
`/members/${encodeURIComponent(member)}/oauth-accounts`,
|
|
4563
|
-
|
|
4843
|
+
z19.array(managedOAuthAccountSchema),
|
|
4564
4844
|
call
|
|
4565
4845
|
),
|
|
4566
4846
|
/**
|
|
@@ -4570,7 +4850,7 @@ function managementClient(options) {
|
|
|
4570
4850
|
*/
|
|
4571
4851
|
unlinkOAuthAccount: (member, input, call) => post(
|
|
4572
4852
|
`/members/${encodeURIComponent(member)}/oauth-accounts/unlink`,
|
|
4573
|
-
|
|
4853
|
+
z19.array(managedOAuthAccountSchema),
|
|
4574
4854
|
memberOAuthUnlinkInputSchema.parse(input),
|
|
4575
4855
|
call
|
|
4576
4856
|
),
|
|
@@ -4596,6 +4876,27 @@ function managementClient(options) {
|
|
|
4596
4876
|
memberTelegramUnlinkInputSchema.parse(input),
|
|
4597
4877
|
call
|
|
4598
4878
|
),
|
|
4879
|
+
/**
|
|
4880
|
+
* The member's linked creator accounts, such as a YouTube channel; requires `read`
|
|
4881
|
+
* permission. Creator accounts are not identity states in SDK 1.x, so they have this read
|
|
4882
|
+
* and `unlinkCreatorAccount` of their own.
|
|
4883
|
+
*/
|
|
4884
|
+
creatorAccounts: (member, call) => get(
|
|
4885
|
+
`/members/${identifier.parse(member)}/creator-accounts`,
|
|
4886
|
+
managedCreatorAccountsSchema,
|
|
4887
|
+
call
|
|
4888
|
+
),
|
|
4889
|
+
/**
|
|
4890
|
+
* Unlinks the member's reviewed creator account in this project and environment; requires
|
|
4891
|
+
* `review` permission. Relay stops reading it; records it authored stay, and the account
|
|
4892
|
+
* stays bound to the member.
|
|
4893
|
+
*/
|
|
4894
|
+
unlinkCreatorAccount: (member, input, call) => post(
|
|
4895
|
+
`/members/${identifier.parse(member)}/creator-accounts/unlink`,
|
|
4896
|
+
managedCreatorAccountsSchema,
|
|
4897
|
+
memberCreatorAccountUnlinkInputSchema.parse(input),
|
|
4898
|
+
call
|
|
4899
|
+
),
|
|
4599
4900
|
/**
|
|
4600
4901
|
* Unlinks a member's wallet from the project with a reason; requires `review` permission. The address stays bound to the member.
|
|
4601
4902
|
*
|
|
@@ -4603,7 +4904,7 @@ function managementClient(options) {
|
|
|
4603
4904
|
*/
|
|
4604
4905
|
unlinkWallet: (member, input, call) => post(
|
|
4605
4906
|
`/members/${encodeURIComponent(member)}/wallets/unlink`,
|
|
4606
|
-
|
|
4907
|
+
z19.array(managedWalletSchema),
|
|
4607
4908
|
memberWalletUnlinkInputSchema.parse(input),
|
|
4608
4909
|
call
|
|
4609
4910
|
),
|
|
@@ -4616,7 +4917,7 @@ function managementClient(options) {
|
|
|
4616
4917
|
*/
|
|
4617
4918
|
unlinkIdentity: (member, input, call) => post(
|
|
4618
4919
|
`/members/${encodeURIComponent(member)}/identities/unlink`,
|
|
4619
|
-
|
|
4920
|
+
z19.array(managedMemberIdentitySchema),
|
|
4620
4921
|
memberIdentityChangeInputSchema.parse(input),
|
|
4621
4922
|
call
|
|
4622
4923
|
),
|
|
@@ -4627,7 +4928,7 @@ function managementClient(options) {
|
|
|
4627
4928
|
*/
|
|
4628
4929
|
relinkIdentity: (member, input, call) => post(
|
|
4629
4930
|
`/members/${encodeURIComponent(member)}/identities/relink`,
|
|
4630
|
-
|
|
4931
|
+
z19.array(managedMemberIdentitySchema),
|
|
4631
4932
|
memberIdentityChangeInputSchema.parse(input),
|
|
4632
4933
|
call
|
|
4633
4934
|
),
|
|
@@ -4639,7 +4940,7 @@ function managementClient(options) {
|
|
|
4639
4940
|
*/
|
|
4640
4941
|
setWalletSignIn: (member, input, call) => post(
|
|
4641
4942
|
`/members/${encodeURIComponent(member)}/wallets/sign-in`,
|
|
4642
|
-
|
|
4943
|
+
z19.array(managedWalletSchema),
|
|
4643
4944
|
memberWalletSignInInputSchema.parse(input),
|
|
4644
4945
|
call
|
|
4645
4946
|
)
|
|
@@ -4763,7 +5064,7 @@ function managementClient(options) {
|
|
|
4763
5064
|
`/storage/sql/${appSecretNameSchema.parse(name)}/cell?${new URLSearchParams(
|
|
4764
5065
|
{
|
|
4765
5066
|
table,
|
|
4766
|
-
row: String(
|
|
5067
|
+
row: String(z19.number().int().min(0).parse(options2.row)),
|
|
4767
5068
|
column: options2.column,
|
|
4768
5069
|
...options2.cursor === void 0 ? {} : { cursor: pageCursorSchema.parse(options2.cursor) }
|
|
4769
5070
|
}
|
|
@@ -4869,13 +5170,13 @@ function managementClient(options) {
|
|
|
4869
5170
|
)
|
|
4870
5171
|
},
|
|
4871
5172
|
quests: {
|
|
4872
|
-
pause: (
|
|
4873
|
-
resume: (
|
|
5173
|
+
pause: (quest, input, call) => operationVerb(`quest:${identifier.parse(quest)}`, true, input, call),
|
|
5174
|
+
resume: (quest, input, call) => operationVerb(`quest:${identifier.parse(quest)}`, false, input, call),
|
|
4874
5175
|
/**
|
|
4875
5176
|
* Each quest's current release, the most recently published first, archived quests
|
|
4876
5177
|
* included; requires `read` permission.
|
|
4877
5178
|
*/
|
|
4878
|
-
list: (call) => get("/quests/list",
|
|
5179
|
+
list: (call) => get("/quests/list", z19.array(publishedReleaseSchema), call),
|
|
4879
5180
|
/** Pending and exhausted asynchronous balance checks. Requires read. */
|
|
4880
5181
|
automaticScheduling: (query = {}, call) => get(
|
|
4881
5182
|
`/quests/automatic-scheduling${queryString(automaticSchedulingQuerySchema.parse(query))}`,
|
|
@@ -4920,7 +5221,7 @@ function managementClient(options) {
|
|
|
4920
5221
|
*/
|
|
4921
5222
|
submissions: (member, call) => get(
|
|
4922
5223
|
`/members/${encodeURIComponent(member)}/quest-submissions`,
|
|
4923
|
-
|
|
5224
|
+
z19.object({ items: z19.array(questSubmissionSchema) }),
|
|
4924
5225
|
call
|
|
4925
5226
|
),
|
|
4926
5227
|
/**
|
|
@@ -4933,8 +5234,8 @@ function managementClient(options) {
|
|
|
4933
5234
|
{},
|
|
4934
5235
|
call
|
|
4935
5236
|
),
|
|
4936
|
-
withdraw: (
|
|
4937
|
-
`/quests/${encodeURIComponent(
|
|
5237
|
+
withdraw: (quest, member, input, call) => post(
|
|
5238
|
+
`/quests/${encodeURIComponent(quest)}/enrollments/${encodeURIComponent(member)}/withdraw`,
|
|
4938
5239
|
questEnrollmentStateSchema,
|
|
4939
5240
|
questEnrollmentWithdrawalInputSchema.parse(withActionId(input)),
|
|
4940
5241
|
call
|
|
@@ -4955,8 +5256,8 @@ function managementClient(options) {
|
|
|
4955
5256
|
* Stops new participation and hides the quest from collections, with a reason. Completions,
|
|
4956
5257
|
* attempts and rewards stay. Deploying the quest's code again keeps it archived.
|
|
4957
5258
|
*/
|
|
4958
|
-
archive: (
|
|
4959
|
-
`/quests/${identifier.parse(
|
|
5259
|
+
archive: (quest, input, call) => post(
|
|
5260
|
+
`/quests/${identifier.parse(quest)}/archive`,
|
|
4960
5261
|
questLifecycleSchema,
|
|
4961
5262
|
questLifecycleInputSchema.omit({ quest: true, archived: true }).parse(withActionId(input)),
|
|
4962
5263
|
call
|
|
@@ -4965,8 +5266,8 @@ function managementClient(options) {
|
|
|
4965
5266
|
* Opens an archived quest again, with a reason. It must pass the prerequisite graph and the
|
|
4966
5267
|
* app's supported interactions; it stays paused while a resource setting is empty.
|
|
4967
5268
|
*/
|
|
4968
|
-
unarchive: (
|
|
4969
|
-
`/quests/${identifier.parse(
|
|
5269
|
+
unarchive: (quest, input, call) => post(
|
|
5270
|
+
`/quests/${identifier.parse(quest)}/unarchive`,
|
|
4970
5271
|
questLifecycleSchema,
|
|
4971
5272
|
questLifecycleInputSchema.omit({ quest: true, archived: true }).parse(withActionId(input)),
|
|
4972
5273
|
call
|
|
@@ -5044,6 +5345,27 @@ function managementClient(options) {
|
|
|
5044
5345
|
});
|
|
5045
5346
|
}
|
|
5046
5347
|
var managementResponseSchemas = lazyResponseReaders({
|
|
5348
|
+
get activeMemberUsageSchema() {
|
|
5349
|
+
return knownResponse(activeMemberUsageSchema);
|
|
5350
|
+
},
|
|
5351
|
+
get billingPlanChangeSchema() {
|
|
5352
|
+
return knownResponse(billingPlanChangeSchema);
|
|
5353
|
+
},
|
|
5354
|
+
get billingSessionSchema() {
|
|
5355
|
+
return knownResponse(billingSessionSchema);
|
|
5356
|
+
},
|
|
5357
|
+
get organizationBillingSchema() {
|
|
5358
|
+
return knownResponse(organizationBillingSchema);
|
|
5359
|
+
},
|
|
5360
|
+
get projectBillingSchema() {
|
|
5361
|
+
return knownResponse(projectBillingSchema);
|
|
5362
|
+
},
|
|
5363
|
+
get projectPlanSchema() {
|
|
5364
|
+
return knownResponse(projectPlanSchema);
|
|
5365
|
+
},
|
|
5366
|
+
get realPeopleInTestUsageSchema() {
|
|
5367
|
+
return knownResponse(realPeopleInTestUsageSchema);
|
|
5368
|
+
},
|
|
5047
5369
|
get managedBadgeSchema() {
|
|
5048
5370
|
return knownResponse(managedBadgeSchema);
|
|
5049
5371
|
},
|
|
@@ -5284,6 +5606,9 @@ var managementResponseSchemas = lazyResponseReaders({
|
|
|
5284
5606
|
get managedTelegramAccountSchema() {
|
|
5285
5607
|
return knownResponse(managedTelegramAccountSchema);
|
|
5286
5608
|
},
|
|
5609
|
+
get managedCreatorAccountsSchema() {
|
|
5610
|
+
return knownResponse(managedCreatorAccountsSchema);
|
|
5611
|
+
},
|
|
5287
5612
|
get telegramChatsSchema() {
|
|
5288
5613
|
return knownResponse(telegramChatsSchema);
|
|
5289
5614
|
},
|
|
@@ -5356,6 +5681,21 @@ var managementResponseSchemas = lazyResponseReaders({
|
|
|
5356
5681
|
get analyticsReadSchema() {
|
|
5357
5682
|
return knownResponse(analyticsReadSchema);
|
|
5358
5683
|
},
|
|
5684
|
+
get analyticsCatalogSchema() {
|
|
5685
|
+
return knownResponse(analyticsCatalogSchema);
|
|
5686
|
+
},
|
|
5687
|
+
get analyticsMetricResultSchema() {
|
|
5688
|
+
return knownResponse(analyticsMetricResultSchema);
|
|
5689
|
+
},
|
|
5690
|
+
get dashboardListSchema() {
|
|
5691
|
+
return knownResponse(dashboardListSchema);
|
|
5692
|
+
},
|
|
5693
|
+
get dashboardReadSchema() {
|
|
5694
|
+
return knownResponse(dashboardReadSchema);
|
|
5695
|
+
},
|
|
5696
|
+
get dashboardLifecycleResultSchema() {
|
|
5697
|
+
return knownResponse(dashboardLifecycleResultSchema);
|
|
5698
|
+
},
|
|
5359
5699
|
get projectSchema() {
|
|
5360
5700
|
return knownResponse(projectSchema);
|
|
5361
5701
|
},
|
|
@@ -5481,6 +5821,27 @@ var managementResponseSchemas = lazyResponseReaders({
|
|
|
5481
5821
|
}
|
|
5482
5822
|
});
|
|
5483
5823
|
var managementResponses = lazyResponseReaders({
|
|
5824
|
+
get activeMemberUsageSchema() {
|
|
5825
|
+
return responseSchema(activeMemberUsageSchema);
|
|
5826
|
+
},
|
|
5827
|
+
get billingPlanChangeSchema() {
|
|
5828
|
+
return responseSchema(billingPlanChangeSchema);
|
|
5829
|
+
},
|
|
5830
|
+
get billingSessionSchema() {
|
|
5831
|
+
return responseSchema(billingSessionSchema);
|
|
5832
|
+
},
|
|
5833
|
+
get organizationBillingSchema() {
|
|
5834
|
+
return responseSchema(organizationBillingSchema);
|
|
5835
|
+
},
|
|
5836
|
+
get projectBillingSchema() {
|
|
5837
|
+
return responseSchema(projectBillingSchema);
|
|
5838
|
+
},
|
|
5839
|
+
get projectPlanSchema() {
|
|
5840
|
+
return responseSchema(projectPlanSchema);
|
|
5841
|
+
},
|
|
5842
|
+
get realPeopleInTestUsageSchema() {
|
|
5843
|
+
return responseSchema(realPeopleInTestUsageSchema);
|
|
5844
|
+
},
|
|
5484
5845
|
get managedBadgeSchema() {
|
|
5485
5846
|
return responseSchema(managedBadgeSchema);
|
|
5486
5847
|
},
|
|
@@ -5721,6 +6082,9 @@ var managementResponses = lazyResponseReaders({
|
|
|
5721
6082
|
get managedTelegramAccountSchema() {
|
|
5722
6083
|
return responseSchema(managedTelegramAccountSchema);
|
|
5723
6084
|
},
|
|
6085
|
+
get managedCreatorAccountsSchema() {
|
|
6086
|
+
return responseSchema(managedCreatorAccountsSchema);
|
|
6087
|
+
},
|
|
5724
6088
|
get telegramChatsSchema() {
|
|
5725
6089
|
return responseSchema(telegramChatsSchema);
|
|
5726
6090
|
},
|
|
@@ -5793,6 +6157,21 @@ var managementResponses = lazyResponseReaders({
|
|
|
5793
6157
|
get analyticsReadSchema() {
|
|
5794
6158
|
return responseSchema(analyticsReadSchema);
|
|
5795
6159
|
},
|
|
6160
|
+
get analyticsCatalogSchema() {
|
|
6161
|
+
return responseSchema(analyticsCatalogSchema);
|
|
6162
|
+
},
|
|
6163
|
+
get analyticsMetricResultSchema() {
|
|
6164
|
+
return responseSchema(analyticsMetricResultSchema);
|
|
6165
|
+
},
|
|
6166
|
+
get dashboardListSchema() {
|
|
6167
|
+
return responseSchema(dashboardListSchema);
|
|
6168
|
+
},
|
|
6169
|
+
get dashboardReadSchema() {
|
|
6170
|
+
return responseSchema(dashboardReadSchema);
|
|
6171
|
+
},
|
|
6172
|
+
get dashboardLifecycleResultSchema() {
|
|
6173
|
+
return responseSchema(dashboardLifecycleResultSchema);
|
|
6174
|
+
},
|
|
5796
6175
|
get projectSchema() {
|
|
5797
6176
|
return responseSchema(projectSchema);
|
|
5798
6177
|
},
|
|
@@ -5946,9 +6325,20 @@ export {
|
|
|
5946
6325
|
accessHistoryQuerySchema,
|
|
5947
6326
|
accessSchema,
|
|
5948
6327
|
accountProfileSchema,
|
|
6328
|
+
activeMemberMonthSchema,
|
|
6329
|
+
activeMemberUsageSchema,
|
|
5949
6330
|
activityTypeSchema,
|
|
5950
6331
|
activityTypes,
|
|
5951
6332
|
addGroupMemberSchema,
|
|
6333
|
+
analyticsBreakdowns,
|
|
6334
|
+
analyticsCatalog,
|
|
6335
|
+
analyticsCatalogSchema,
|
|
6336
|
+
analyticsCharts,
|
|
6337
|
+
analyticsFilters,
|
|
6338
|
+
analyticsMetricIds,
|
|
6339
|
+
analyticsMetricQuerySchema,
|
|
6340
|
+
analyticsMetricResultSchema,
|
|
6341
|
+
analyticsQueryLimit,
|
|
5952
6342
|
analyticsQuerySchema,
|
|
5953
6343
|
analyticsRanges,
|
|
5954
6344
|
analyticsReadSchema,
|
|
@@ -5988,6 +6378,15 @@ export {
|
|
|
5988
6378
|
auditQuerySchema,
|
|
5989
6379
|
auditRecordSchema,
|
|
5990
6380
|
balanceCheckSchema,
|
|
6381
|
+
billingCheckoutInputSchema,
|
|
6382
|
+
billingIntervals,
|
|
6383
|
+
billingPlanChangeInputSchema,
|
|
6384
|
+
billingPlanChangeSchema,
|
|
6385
|
+
billingSessionSchema,
|
|
6386
|
+
billingSubscriptionPlans,
|
|
6387
|
+
billingSubscriptionSchema,
|
|
6388
|
+
billingTopupInputSchema,
|
|
6389
|
+
billingTopupMaxQuantity,
|
|
5991
6390
|
buildArtifactsSchema,
|
|
5992
6391
|
buildIdentitySchema,
|
|
5993
6392
|
buildPhaseSchema,
|
|
@@ -6010,6 +6409,13 @@ export {
|
|
|
6010
6409
|
customDomainRecordSchema,
|
|
6011
6410
|
customDomainSchema,
|
|
6012
6411
|
customDomainStateSchema,
|
|
6412
|
+
dashboardLifecycleInputSchema,
|
|
6413
|
+
dashboardLifecycleResultSchema,
|
|
6414
|
+
dashboardListQuerySchema,
|
|
6415
|
+
dashboardListSchema,
|
|
6416
|
+
dashboardReadQuerySchema,
|
|
6417
|
+
dashboardReadSchema,
|
|
6418
|
+
dashboardSummarySchema,
|
|
6013
6419
|
deploymentActionSchema,
|
|
6014
6420
|
deploymentRejectionSchema,
|
|
6015
6421
|
developmentPreflightSchema,
|
|
@@ -6052,6 +6458,8 @@ export {
|
|
|
6052
6458
|
isParticipantRoute,
|
|
6053
6459
|
issuedServiceKeySchema,
|
|
6054
6460
|
issuedTokenSchema,
|
|
6461
|
+
leaderboardSettlementExportSchema,
|
|
6462
|
+
leaderboardSettlementMeasurementRetrySchema,
|
|
6055
6463
|
leaderboardSettlementRejectionSchema,
|
|
6056
6464
|
leaderboardSettlementReviewPageSchema,
|
|
6057
6465
|
leaderboardSettlementReviewQuerySchema,
|
|
@@ -6061,6 +6469,8 @@ export {
|
|
|
6061
6469
|
managedAttemptPageSchema,
|
|
6062
6470
|
managedAttemptQuerySchema,
|
|
6063
6471
|
managedAttemptSchema,
|
|
6472
|
+
managedCreatorAccountSchema,
|
|
6473
|
+
managedCreatorAccountsSchema,
|
|
6064
6474
|
managedEntitlementPageSchema,
|
|
6065
6475
|
managedEntitlementQuerySchema,
|
|
6066
6476
|
managedEntitlementSchema,
|
|
@@ -6084,6 +6494,7 @@ export {
|
|
|
6084
6494
|
managementResponses,
|
|
6085
6495
|
managementStateQuerySchema,
|
|
6086
6496
|
memberAccountSchema,
|
|
6497
|
+
memberCreatorAccountUnlinkInputSchema,
|
|
6087
6498
|
memberDetailSchema,
|
|
6088
6499
|
memberIdentityChangeInputSchema,
|
|
6089
6500
|
memberIdentityLinkChangeInputSchema,
|
|
@@ -6120,6 +6531,7 @@ export {
|
|
|
6120
6531
|
operationInputSchema,
|
|
6121
6532
|
operationSchema,
|
|
6122
6533
|
operatorUserSchema,
|
|
6534
|
+
organizationBillingSchema,
|
|
6123
6535
|
pageSchema,
|
|
6124
6536
|
parseImageExtraction,
|
|
6125
6537
|
parseImageResult,
|
|
@@ -6131,10 +6543,12 @@ export {
|
|
|
6131
6543
|
permissionSchema,
|
|
6132
6544
|
personSchema,
|
|
6133
6545
|
pointLedgerPropertiesSchema,
|
|
6546
|
+
projectBillingSchema,
|
|
6134
6547
|
projectDeletionInputSchema,
|
|
6135
6548
|
projectDeletionSchema,
|
|
6136
6549
|
projectInputSchema,
|
|
6137
6550
|
projectMetricsSchema,
|
|
6551
|
+
projectPlanSchema,
|
|
6138
6552
|
projectSchema,
|
|
6139
6553
|
projectSetupSchema,
|
|
6140
6554
|
projectTransferInputSchema,
|
|
@@ -6157,6 +6571,7 @@ export {
|
|
|
6157
6571
|
questLifecycleInputSchema,
|
|
6158
6572
|
questLifecycleSchema,
|
|
6159
6573
|
readinessSchema,
|
|
6574
|
+
realPeopleInTestUsageSchema,
|
|
6160
6575
|
referralManagementSchema,
|
|
6161
6576
|
referralQualificationSchema,
|
|
6162
6577
|
referralRewardResolutionSchema,
|