@domino-sdk/relay 1.55.0 → 1.59.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 +85 -0
- package/dist/{accounts-DRPENuZe.d.ts → accounts-CVonEkdb.d.ts} +18 -7
- package/dist/{attempt-captures-CxxO7DeD.d.ts → attempt-captures-DBj-rxak.d.ts} +1 -1
- package/dist/authoring.d.ts +306 -72
- package/dist/authoring.js +264 -9
- package/dist/{automatic-outcomes-DxW_v5Wc.d.ts → automatic-outcomes-FS9okvBP.d.ts} +1 -1
- package/dist/avatar.d.ts +1 -2
- package/dist/browser.d.ts +8 -9
- package/dist/browser.js +10 -10
- package/dist/{capability-error-DSd8EMQC.d.ts → capability-error-DDJl0LY-.d.ts} +0 -6
- package/dist/{chunk-IZRITLVV.js → chunk-2LKGAL63.js} +2 -2
- package/dist/{chunk-GL43VQ5D.js → chunk-577DG2IT.js} +38 -8
- package/dist/{chunk-UY6KMLQG.js → chunk-6U5WWH3W.js} +141 -100
- package/dist/{chunk-YCOKTQ4E.js → chunk-AWWCEP7F.js} +1403 -882
- package/dist/{chunk-56DBFNR2.js → chunk-EQF4ID47.js} +1 -1
- package/dist/{chunk-YEVD4A5X.js → chunk-IBROKMFV.js} +2 -2
- package/dist/{chunk-XALIFNMD.js → chunk-KBCTII6C.js} +1 -1
- package/dist/{chunk-WHG5WE43.js → chunk-KYUQEZZA.js} +1 -1
- package/dist/{chunk-WUEQOKJH.js → chunk-LDLOB2UZ.js} +4 -4
- package/dist/{chunk-IUF7DW76.js → chunk-M2JQPDUX.js} +39 -9
- package/dist/{chunk-MLIXJPKL.js → chunk-MHPKEVEW.js} +1 -0
- package/dist/{chunk-TLK2MD4S.js → chunk-R4S6BFOH.js} +1 -1
- package/dist/{chunk-VFBQVY4X.js → chunk-TZJT5CRF.js} +1 -1
- package/dist/{chunk-C7QZ4UBB.js → chunk-UEMLYPKJ.js} +21 -5
- package/dist/{chunk-F6HECAXA.js → chunk-W42KMMH5.js} +140 -101
- package/dist/{chunk-WHMXXHPX.js → chunk-XGXDINGM.js} +16 -3
- package/dist/{chunk-SABMNPF2.js → chunk-YMWRLAAP.js} +1 -1
- package/dist/{chunk-YE3XYB2F.js → chunk-YRSU2X2P.js} +2 -2
- package/dist/{client-C4zUZKpj.d.ts → client-3b9HjSzZ.d.ts} +191 -117
- package/dist/{deployments-B32QS1CI.d.ts → deployments-BydFVj4Q.d.ts} +798 -235
- package/dist/{groups-O6onGPmC.d.ts → groups-CFuTfFqG.d.ts} +15 -9
- package/dist/index.d.ts +9 -10
- package/dist/index.js +9 -9
- package/dist/{integrations-C6_uUh-s.d.ts → integrations-DrbKQSTD.d.ts} +42 -22
- package/dist/internal.d.ts +10 -10
- package/dist/internal.js +9 -9
- package/dist/{offers-BMDNcvwB.d.ts → offers-DAfe1O3_.d.ts} +211 -2
- package/dist/{pages-BFloMpyQ.d.ts → pages-ChDVLrgR.d.ts} +95 -10
- package/dist/portal-proxy.js +4 -4
- package/dist/react/index.d.ts +149 -72
- package/dist/react/index.js +65 -10
- package/dist/runtime/authoring.js +1 -1
- package/dist/runtime/chunks/BG43KQ2T.js +1 -0
- package/dist/runtime/chunks/EWU4OKSY.js +62 -0
- package/dist/runtime/manifest.json +5 -5
- package/dist/runtime/schema.js +1 -1
- package/dist/runtime/zod.js +1 -1
- package/dist/{schema-C4m9RhCR.d.ts → schema-BA0nRRlt.d.ts} +184 -35
- package/dist/schema.d.ts +1265 -697
- package/dist/schema.js +96 -12
- package/dist/server/index.d.ts +10 -10
- package/dist/server/index.js +1644 -1105
- package/dist/{submission-input-BbdawqVy.d.ts → submission-input-DxQ6RnKo.d.ts} +2 -2
- package/dist/{telegram-browser-CwaxROAZ.d.ts → telegram-browser-o3OIxGrJ.d.ts} +3 -3
- package/dist/testing.d.ts +89 -9
- package/dist/testing.js +215 -10
- package/dist/{transport-CZJOW5Sr.d.ts → transport-D_Eqf78J.d.ts} +8592 -4384
- package/dist/wallet-B06zvDXp.d.ts +972 -0
- package/dist/{x-1czZFVUW.d.ts → x-C28SNifw.d.ts} +2 -2
- package/package.json +2 -2
- package/dist/profiles-BoOK03cR.d.ts +0 -299
- package/dist/runtime/chunks/IDOMZWRY.js +0 -40
- package/dist/runtime/chunks/WKATKZXE.js +0 -1
- package/dist/util.d-w9f9t3ua.d.ts +0 -5
- package/dist/wallet-Ac7OFpOr.d.ts +0 -228
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-KBCTII6C.js";
|
|
5
5
|
import {
|
|
6
6
|
activityTypeSchema,
|
|
7
7
|
activityTypes,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
publishDeploymentSchema,
|
|
28
28
|
rejectDeploymentSchema,
|
|
29
29
|
submitDeploymentSchema
|
|
30
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-M2JQPDUX.js";
|
|
31
31
|
import {
|
|
32
32
|
analyticsBreakdowns,
|
|
33
33
|
analyticsCatalog,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
analyticsRanges,
|
|
43
43
|
analyticsReadSchema,
|
|
44
44
|
dashboardDefinitionSchema
|
|
45
|
-
} from "../chunk-
|
|
45
|
+
} from "../chunk-W42KMMH5.js";
|
|
46
46
|
import "../chunk-4OC7REYX.js";
|
|
47
47
|
import {
|
|
48
48
|
DEFAULT_MANAGEMENT_TIMEOUT,
|
|
@@ -63,31 +63,31 @@ import {
|
|
|
63
63
|
participantExchangeSchema,
|
|
64
64
|
questConfiguration,
|
|
65
65
|
sequenceCursorSchema
|
|
66
|
-
} from "../chunk-
|
|
66
|
+
} from "../chunk-LDLOB2UZ.js";
|
|
67
67
|
import {
|
|
68
68
|
parseImageExtraction,
|
|
69
69
|
parseImageResult
|
|
70
|
-
} from "../chunk-
|
|
70
|
+
} from "../chunk-YRSU2X2P.js";
|
|
71
71
|
import {
|
|
72
72
|
imageAssetArtifactSchema,
|
|
73
73
|
xUserLookupInputSchema,
|
|
74
74
|
xUserSchema,
|
|
75
75
|
xUsernameSchema
|
|
76
|
-
} from "../chunk-
|
|
76
|
+
} from "../chunk-IBROKMFV.js";
|
|
77
77
|
import {
|
|
78
78
|
sourceDataSchema,
|
|
79
79
|
sourceRoles,
|
|
80
80
|
validateQuestShape
|
|
81
|
-
} from "../chunk-
|
|
81
|
+
} from "../chunk-YMWRLAAP.js";
|
|
82
82
|
import {
|
|
83
83
|
isIntegrationParticipantPath,
|
|
84
84
|
isParticipantRoute,
|
|
85
85
|
participantRoutePattern,
|
|
86
86
|
participantRoutes
|
|
87
|
-
} from "../chunk-
|
|
87
|
+
} from "../chunk-MHPKEVEW.js";
|
|
88
88
|
import {
|
|
89
89
|
withActionId
|
|
90
|
-
} from "../chunk-
|
|
90
|
+
} from "../chunk-KYUQEZZA.js";
|
|
91
91
|
import {
|
|
92
92
|
allocateQuestSchema,
|
|
93
93
|
allocatedQuestSchema,
|
|
@@ -96,6 +96,8 @@ import {
|
|
|
96
96
|
collectionBeginSchema,
|
|
97
97
|
collectionPreviewSchema,
|
|
98
98
|
collectionResolveSchema,
|
|
99
|
+
creatorAccountProviderSchema,
|
|
100
|
+
discordRoleRewardsSchema,
|
|
99
101
|
memberEnrollmentInputSchema,
|
|
100
102
|
publishQuestDraftSchema,
|
|
101
103
|
questCatalogSchema,
|
|
@@ -106,7 +108,7 @@ import {
|
|
|
106
108
|
rewardDeliveryQuerySchema,
|
|
107
109
|
rewardDeliverySchema,
|
|
108
110
|
saveQuestDraftSchema
|
|
109
|
-
} from "../chunk-
|
|
111
|
+
} from "../chunk-6U5WWH3W.js";
|
|
110
112
|
import {
|
|
111
113
|
badgeMutationResultSchema,
|
|
112
114
|
badgeMutationSchema,
|
|
@@ -154,7 +156,7 @@ import {
|
|
|
154
156
|
referralQualificationSchema,
|
|
155
157
|
referralRewardResolutionSchema,
|
|
156
158
|
referralSuspensionSchema
|
|
157
|
-
} from "../chunk-
|
|
159
|
+
} from "../chunk-UEMLYPKJ.js";
|
|
158
160
|
import {
|
|
159
161
|
createPointLedgerSchema,
|
|
160
162
|
managedPointLedgerSchema,
|
|
@@ -167,12 +169,13 @@ import {
|
|
|
167
169
|
telegramChatConnectionSchema,
|
|
168
170
|
telegramChatIdSchema,
|
|
169
171
|
telegramChatsSchema
|
|
170
|
-
} from "../chunk-
|
|
171
|
-
import "../chunk-
|
|
172
|
-
import "../chunk-
|
|
173
|
-
import "../chunk-
|
|
172
|
+
} from "../chunk-XGXDINGM.js";
|
|
173
|
+
import "../chunk-R4S6BFOH.js";
|
|
174
|
+
import "../chunk-TZJT5CRF.js";
|
|
175
|
+
import "../chunk-EQF4ID47.js";
|
|
174
176
|
import {
|
|
175
177
|
CompletionSourceKind,
|
|
178
|
+
acceptAnywaySchema,
|
|
176
179
|
addGroupMemberSchema,
|
|
177
180
|
appIdentityKindSchema,
|
|
178
181
|
attemptSchema,
|
|
@@ -200,6 +203,7 @@ import {
|
|
|
200
203
|
eventSchema,
|
|
201
204
|
evmAddressSchema,
|
|
202
205
|
evmChainIdSchema,
|
|
206
|
+
groupArchiveInputSchema,
|
|
203
207
|
groupMemberPageSchema,
|
|
204
208
|
groupMemberSchema,
|
|
205
209
|
groupPageQuerySchema,
|
|
@@ -207,13 +211,16 @@ import {
|
|
|
207
211
|
identifier,
|
|
208
212
|
knownResponse,
|
|
209
213
|
lazyResponseReaders,
|
|
214
|
+
lifecycleReasonSchema,
|
|
210
215
|
linkedWalletSchema,
|
|
211
216
|
managedGroupSchema,
|
|
217
|
+
managedTrackerCreateSchema,
|
|
212
218
|
managementStateQuerySchema,
|
|
213
219
|
memberCampaignEnrollmentInputSchema,
|
|
214
220
|
memberCampaignWithdrawalInputSchema,
|
|
215
221
|
memberIdentitySchema,
|
|
216
222
|
memberProgressSchema,
|
|
223
|
+
offsetDateTimeSchema,
|
|
217
224
|
pageCursorSchema,
|
|
218
225
|
pageQuerySchema,
|
|
219
226
|
pickupAvailabilitySchema,
|
|
@@ -236,7 +243,6 @@ import {
|
|
|
236
243
|
trackerContentReadSchema,
|
|
237
244
|
trackerContentSchema,
|
|
238
245
|
trackerControlSchema,
|
|
239
|
-
trackerCreateSchema,
|
|
240
246
|
trackerDataIssue,
|
|
241
247
|
trackerDataIssues,
|
|
242
248
|
trackerIngestResultSchema,
|
|
@@ -260,7 +266,7 @@ import {
|
|
|
260
266
|
walletSignInNetworksSchema,
|
|
261
267
|
walletUnlinkInputSchema,
|
|
262
268
|
whereSchemaIssue
|
|
263
|
-
} from "../chunk-
|
|
269
|
+
} from "../chunk-AWWCEP7F.js";
|
|
264
270
|
|
|
265
271
|
// src/server/identity-links.ts
|
|
266
272
|
import * as z from "zod";
|
|
@@ -381,162 +387,210 @@ var memberIdentitySignInInputSchema = z2.strictObject({
|
|
|
381
387
|
enabled: z2.boolean()
|
|
382
388
|
});
|
|
383
389
|
|
|
384
|
-
// src/server/
|
|
390
|
+
// src/server/creator-accounts.ts
|
|
385
391
|
import * as z3 from "zod";
|
|
386
|
-
var
|
|
392
|
+
var managedCreatorAccountSchema = z3.object({
|
|
393
|
+
provider: creatorAccountProviderSchema,
|
|
394
|
+
/** The platform's account ID, such as a YouTube channel ID (`UC…`) or a TikTok `open_id`. */
|
|
395
|
+
subject: z3.string().min(1),
|
|
396
|
+
revision: z3.number().int().nonnegative(),
|
|
397
|
+
/** When the member linked it, epoch milliseconds. */
|
|
398
|
+
linkedAt: z3.number().int().nonnegative().nullable(),
|
|
399
|
+
status: z3.enum(["connected", "needs-reconnect"]),
|
|
400
|
+
/** Why the member must link it again: `revoked`, `expired` or `missing-scope`. */
|
|
401
|
+
reason: z3.string().optional(),
|
|
402
|
+
/** The public name, handle and picture the platform reported at link time. */
|
|
403
|
+
profile: z3.object({
|
|
404
|
+
name: z3.string().optional(),
|
|
405
|
+
username: z3.string().optional(),
|
|
406
|
+
imageUrl: z3.string().optional()
|
|
407
|
+
}).nullable()
|
|
408
|
+
});
|
|
409
|
+
var managedCreatorAccountsSchema = z3.object({
|
|
410
|
+
accounts: z3.array(managedCreatorAccountSchema)
|
|
411
|
+
});
|
|
412
|
+
var memberCreatorAccountUnlinkInputSchema = z3.strictObject({
|
|
413
|
+
provider: creatorAccountProviderSchema,
|
|
414
|
+
subject: z3.string().min(1).max(4096),
|
|
415
|
+
revision: z3.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER - 1),
|
|
416
|
+
reason: z3.string().trim().min(1).max(500)
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
// src/server/settlement-reviews.ts
|
|
420
|
+
import * as z4 from "zod";
|
|
421
|
+
var timestamp = z4.number().int().safe().nonnegative();
|
|
387
422
|
var decision = {
|
|
388
|
-
status:
|
|
423
|
+
status: z4.enum(["pending", "approved", "rejected"]),
|
|
389
424
|
/**
|
|
390
425
|
* Present while the window has ended but Relay is still taking closing measurements of the
|
|
391
426
|
* content its engagement points pay for. The settlement reads as `pending` with no rows, cannot
|
|
392
427
|
* be approved yet, and freezes when the measurements arrive or their wait ends after `deadline`.
|
|
393
428
|
*/
|
|
394
|
-
closing:
|
|
395
|
-
rejectedAt:
|
|
396
|
-
rejectedBy:
|
|
397
|
-
rejectionReason:
|
|
429
|
+
closing: z4.object({ startedAt: timestamp, deadline: timestamp }).optional(),
|
|
430
|
+
rejectedAt: z4.number().int().safe().nonnegative().nullable(),
|
|
431
|
+
rejectedBy: z4.string().nullable(),
|
|
432
|
+
rejectionReason: z4.string().nullable()
|
|
398
433
|
};
|
|
399
434
|
var leaderboardSettlementReviewSummarySchema = leaderboardSettlementSummarySchema.extend(decision);
|
|
400
435
|
var leaderboardSettlementReviewSchema = leaderboardSettlementSchema.extend(decision);
|
|
401
|
-
var leaderboardSettlementReviewQuerySchema =
|
|
436
|
+
var leaderboardSettlementReviewQuerySchema = z4.strictObject({
|
|
402
437
|
cursor: pageCursorSchema.optional(),
|
|
403
|
-
limit:
|
|
438
|
+
limit: z4.coerce.number().int().min(1).max(100).default(25)
|
|
404
439
|
});
|
|
405
|
-
var leaderboardSettlementReviewPageSchema =
|
|
406
|
-
items:
|
|
440
|
+
var leaderboardSettlementReviewPageSchema = z4.object({
|
|
441
|
+
items: z4.array(leaderboardSettlementReviewSummarySchema),
|
|
407
442
|
nextCursor: pageCursorSchema.nullable()
|
|
408
443
|
});
|
|
409
|
-
var leaderboardSettlementRejectionSchema =
|
|
410
|
-
actionId:
|
|
411
|
-
expectedCreatedAt:
|
|
412
|
-
reason:
|
|
444
|
+
var leaderboardSettlementRejectionSchema = z4.strictObject({
|
|
445
|
+
actionId: z4.string().uuid().default(() => crypto.randomUUID()),
|
|
446
|
+
expectedCreatedAt: z4.number().int().safe().nonnegative(),
|
|
447
|
+
reason: z4.string().trim().min(1).max(500)
|
|
413
448
|
});
|
|
414
|
-
var leaderboardSettlementMeasurementRetrySchema =
|
|
415
|
-
actionId:
|
|
449
|
+
var leaderboardSettlementMeasurementRetrySchema = z4.strictObject({
|
|
450
|
+
actionId: z4.string().uuid().default(() => crypto.randomUUID())
|
|
416
451
|
});
|
|
417
|
-
var leaderboardSettlementExportSchema =
|
|
452
|
+
var leaderboardSettlementExportSchema = z4.object({
|
|
418
453
|
settlement: identifier,
|
|
419
454
|
leaderboard: identifier,
|
|
420
|
-
title:
|
|
421
|
-
period:
|
|
422
|
-
status:
|
|
455
|
+
title: z4.string(),
|
|
456
|
+
period: z4.object({ start: timestamp, end: timestamp }),
|
|
457
|
+
status: z4.enum(["pending", "approved", "rejected"]),
|
|
423
458
|
pool: leaderboardSettlementPoolSchema.nullable(),
|
|
424
|
-
rows:
|
|
425
|
-
|
|
459
|
+
rows: z4.array(
|
|
460
|
+
z4.object({
|
|
426
461
|
member: identifier,
|
|
427
|
-
score:
|
|
428
|
-
rank:
|
|
462
|
+
score: z4.number().int().safe(),
|
|
463
|
+
rank: z4.number().int().safe().positive(),
|
|
429
464
|
/** The pool share in base units; null without a pool. */
|
|
430
465
|
share: baseUnitsSchema.nullable(),
|
|
431
466
|
/** The pool share in whole units: `"600.5"` for 600500000 USDC base units. */
|
|
432
|
-
amount:
|
|
467
|
+
amount: z4.string().nullable(),
|
|
433
468
|
/** Linked wallets the member proved, on every chain, newest first per chain. */
|
|
434
|
-
wallets:
|
|
435
|
-
|
|
469
|
+
wallets: z4.array(
|
|
470
|
+
z4.object({
|
|
436
471
|
chain: walletChainSchema,
|
|
437
472
|
/** The CAIP-2 network, for Cosmos wallets only. */
|
|
438
|
-
network:
|
|
439
|
-
address:
|
|
473
|
+
network: z4.string().nullable(),
|
|
474
|
+
address: z4.string()
|
|
440
475
|
})
|
|
441
476
|
)
|
|
442
477
|
})
|
|
443
478
|
)
|
|
444
479
|
});
|
|
480
|
+
var csvField = (value) => {
|
|
481
|
+
const text = value == null ? "" : String(value);
|
|
482
|
+
return /[",\r\n]/.test(text) ? `"${text.replaceAll('"', '""')}"` : text;
|
|
483
|
+
};
|
|
484
|
+
function settlementPayoutCsv(exported) {
|
|
485
|
+
const unit = exported.pool === null ? "" : exported.pool.unit === "points" ? "points" : exported.pool.unit.code;
|
|
486
|
+
return [
|
|
487
|
+
["member", "score", "rank", "share", "amount", "unit", "wallets"],
|
|
488
|
+
...exported.rows.map((row) => [
|
|
489
|
+
row.member,
|
|
490
|
+
row.score,
|
|
491
|
+
row.rank,
|
|
492
|
+
row.share,
|
|
493
|
+
row.amount,
|
|
494
|
+
row.share === null ? "" : unit,
|
|
495
|
+
row.wallets.map((wallet) => `${wallet.network ?? wallet.chain}:${wallet.address}`).join(" ")
|
|
496
|
+
])
|
|
497
|
+
].map((fields) => fields.map(csvField).join(",")).join("\n");
|
|
498
|
+
}
|
|
445
499
|
|
|
446
500
|
// src/server/inventory-items.ts
|
|
447
|
-
import * as
|
|
448
|
-
var inventoryItemStateSchema =
|
|
501
|
+
import * as z5 from "zod";
|
|
502
|
+
var inventoryItemStateSchema = z5.object({
|
|
449
503
|
item: identifier,
|
|
450
|
-
name:
|
|
451
|
-
available:
|
|
452
|
-
reserved:
|
|
453
|
-
allocated:
|
|
454
|
-
offers:
|
|
455
|
-
revision:
|
|
456
|
-
archivedAt:
|
|
504
|
+
name: z5.string().nullable(),
|
|
505
|
+
available: z5.number().int().safe().nonnegative(),
|
|
506
|
+
reserved: z5.number().int().safe().nonnegative(),
|
|
507
|
+
allocated: z5.number().int().safe().nonnegative(),
|
|
508
|
+
offers: z5.array(identifier),
|
|
509
|
+
revision: z5.number().int().nonnegative(),
|
|
510
|
+
archivedAt: z5.number().int().safe().nonnegative().nullable()
|
|
457
511
|
});
|
|
458
512
|
var correction = {
|
|
459
|
-
actionId:
|
|
460
|
-
expectedRevision:
|
|
461
|
-
reason:
|
|
513
|
+
actionId: z5.string().uuid().default(() => crypto.randomUUID()),
|
|
514
|
+
expectedRevision: z5.number().int().nonnegative(),
|
|
515
|
+
reason: z5.string().trim().min(1).max(500)
|
|
462
516
|
};
|
|
463
|
-
var inventoryItemActionSchema =
|
|
464
|
-
var inventoryItemRenameSchema =
|
|
517
|
+
var inventoryItemActionSchema = z5.strictObject(correction);
|
|
518
|
+
var inventoryItemRenameSchema = z5.strictObject({
|
|
465
519
|
...correction,
|
|
466
|
-
name:
|
|
520
|
+
name: z5.string().trim().min(1).max(200)
|
|
467
521
|
});
|
|
468
|
-
var inventoryStockCorrectionSchema =
|
|
522
|
+
var inventoryStockCorrectionSchema = z5.strictObject({
|
|
469
523
|
...correction,
|
|
470
|
-
delta:
|
|
524
|
+
delta: z5.number().int().safe()
|
|
471
525
|
});
|
|
472
|
-
var inventoryItemPageSchema =
|
|
473
|
-
items:
|
|
526
|
+
var inventoryItemPageSchema = z5.object({
|
|
527
|
+
items: z5.array(inventoryItemStateSchema),
|
|
474
528
|
nextCursor: pageCursorSchema.nullable()
|
|
475
529
|
});
|
|
476
530
|
|
|
477
531
|
// src/server/quest-enrollments.ts
|
|
478
|
-
import * as
|
|
532
|
+
import * as z6 from "zod";
|
|
479
533
|
var questEnrollmentStateSchema = questEnrollmentSchema.extend({
|
|
480
|
-
revision:
|
|
481
|
-
withdrawnAt:
|
|
482
|
-
withdrawalReason:
|
|
534
|
+
revision: z6.number().int().nonnegative(),
|
|
535
|
+
withdrawnAt: z6.number().int().safe().nonnegative().nullable(),
|
|
536
|
+
withdrawalReason: z6.string().nullable()
|
|
483
537
|
});
|
|
484
538
|
var managedQuestEnrollmentSchema = questEnrollmentStateSchema.extend({
|
|
485
|
-
title:
|
|
486
|
-
key:
|
|
539
|
+
title: z6.string(),
|
|
540
|
+
key: z6.string().nullable()
|
|
487
541
|
});
|
|
488
|
-
var questEnrollmentWithdrawalInputSchema =
|
|
489
|
-
actionId:
|
|
490
|
-
expectedRevision:
|
|
491
|
-
reason:
|
|
542
|
+
var questEnrollmentWithdrawalInputSchema = z6.object({
|
|
543
|
+
actionId: z6.string().uuid().default(() => crypto.randomUUID()),
|
|
544
|
+
expectedRevision: z6.number().int().nonnegative(),
|
|
545
|
+
reason: z6.string().trim().min(1).max(500)
|
|
492
546
|
}).strict();
|
|
493
|
-
var managedQuestEnrollmentPageSchema =
|
|
494
|
-
items:
|
|
547
|
+
var managedQuestEnrollmentPageSchema = z6.object({
|
|
548
|
+
items: z6.array(managedQuestEnrollmentSchema),
|
|
495
549
|
nextCursor: pageCursorSchema.nullable()
|
|
496
550
|
});
|
|
497
551
|
|
|
498
552
|
// src/server/test-members.ts
|
|
499
|
-
import * as
|
|
500
|
-
var testMemberWalletSchema =
|
|
553
|
+
import * as z7 from "zod";
|
|
554
|
+
var testMemberWalletSchema = z7.object({
|
|
501
555
|
chain: walletChainSchema,
|
|
502
556
|
/** CAIP-2 network, Cosmos only. */
|
|
503
557
|
network: cosmosNetworkSchema.nullable(),
|
|
504
|
-
address:
|
|
558
|
+
address: z7.string()
|
|
505
559
|
});
|
|
506
|
-
var testMemberAccountSchema =
|
|
507
|
-
provider:
|
|
560
|
+
var testMemberAccountSchema = z7.object({
|
|
561
|
+
provider: z7.enum(["x", "discord"]),
|
|
508
562
|
/** The X user ID or Discord user ID. */
|
|
509
|
-
id:
|
|
563
|
+
id: z7.string(),
|
|
510
564
|
/** The X handle, when the account was linked by username; otherwise null. */
|
|
511
|
-
username:
|
|
565
|
+
username: z7.string().nullable(),
|
|
512
566
|
/**
|
|
513
567
|
* `linked`: an operator linked a real account with `linkAccount`. `synthetic`: the account Relay
|
|
514
568
|
* linked for synthetic records. `connected`: the member connected it through X or Discord while
|
|
515
569
|
* a staging site acted as them.
|
|
516
570
|
*/
|
|
517
|
-
source:
|
|
571
|
+
source: z7.enum(["linked", "synthetic", "connected"])
|
|
518
572
|
});
|
|
519
|
-
var testMemberSchema =
|
|
573
|
+
var testMemberSchema = z7.object({
|
|
520
574
|
id: identifier,
|
|
521
|
-
name:
|
|
522
|
-
test:
|
|
575
|
+
name: z7.string(),
|
|
576
|
+
test: z7.literal(true),
|
|
523
577
|
/** Current project-calendar date (YYYY-MM-DD), computed by the server. */
|
|
524
|
-
today:
|
|
578
|
+
today: z7.iso.date().optional(),
|
|
525
579
|
/** Number of calendar days advanced; absent means zero for older servers. */
|
|
526
|
-
offsetDays:
|
|
580
|
+
offsetDays: z7.number().int().min(0).optional(),
|
|
527
581
|
/** Linked wallet addresses, by chain then newest first; absent from older servers. */
|
|
528
|
-
wallets:
|
|
582
|
+
wallets: z7.array(testMemberWalletSchema).optional(),
|
|
529
583
|
/** Its X and Discord accounts, X first; absent from older servers. */
|
|
530
|
-
accounts:
|
|
584
|
+
accounts: z7.array(testMemberAccountSchema).optional()
|
|
531
585
|
});
|
|
532
|
-
var testMemberCreateSchema =
|
|
586
|
+
var testMemberCreateSchema = z7.object({
|
|
533
587
|
actionId: identifier,
|
|
534
|
-
name:
|
|
588
|
+
name: z7.string().trim().min(1).max(40)
|
|
535
589
|
}).strict();
|
|
536
590
|
var testMemberActionSchema = submitSchema.omit({ member: true, faultAfterReview: true }).extend({
|
|
537
|
-
operation:
|
|
591
|
+
operation: z7.literal("attempts.submit")
|
|
538
592
|
}).strict();
|
|
539
|
-
var testMemberPassSchema =
|
|
593
|
+
var testMemberPassSchema = z7.object({
|
|
540
594
|
actionId: identifier,
|
|
541
595
|
/** A manual quest, by key or ID. Automatic quests start from their tracker or schedule. */
|
|
542
596
|
quest: identifier,
|
|
@@ -547,77 +601,77 @@ var testMemberPassSchema = z6.object({
|
|
|
547
601
|
*/
|
|
548
602
|
completionKey: completionKeySchema.optional()
|
|
549
603
|
}).strict();
|
|
550
|
-
var testMemberAcceptAnywaySchema =
|
|
604
|
+
var testMemberAcceptAnywaySchema = z7.object({
|
|
551
605
|
actionId: identifier,
|
|
552
606
|
attempt: identifier
|
|
553
607
|
}).strict();
|
|
554
|
-
var testMemberReferralAcceptSchema =
|
|
555
|
-
|
|
556
|
-
|
|
608
|
+
var testMemberReferralAcceptSchema = z7.union([
|
|
609
|
+
z7.object({ actionId: identifier, code: identifier }).strict(),
|
|
610
|
+
z7.object({ actionId: identifier, inviter: identifier }).strict()
|
|
557
611
|
]);
|
|
558
|
-
var testMemberResetSchema =
|
|
559
|
-
var testMemberAdvanceSchema =
|
|
612
|
+
var testMemberResetSchema = z7.object({ actionId: identifier }).strict();
|
|
613
|
+
var testMemberAdvanceSchema = z7.object({
|
|
560
614
|
actionId: identifier,
|
|
561
|
-
days:
|
|
615
|
+
days: z7.number().int().min(1).max(30)
|
|
562
616
|
}).strict();
|
|
563
|
-
var testMemberResetResultSchema =
|
|
617
|
+
var testMemberResetResultSchema = z7.object({
|
|
564
618
|
member: identifier,
|
|
565
|
-
deleted:
|
|
619
|
+
deleted: z7.literal(true)
|
|
566
620
|
});
|
|
567
|
-
var testMemberWalletLinkSchema =
|
|
568
|
-
|
|
621
|
+
var testMemberWalletLinkSchema = z7.discriminatedUnion("chain", [
|
|
622
|
+
z7.object({
|
|
569
623
|
actionId: identifier,
|
|
570
|
-
chain:
|
|
624
|
+
chain: z7.literal("solana"),
|
|
571
625
|
address: solanaAddressSchema
|
|
572
626
|
}).strict(),
|
|
573
|
-
|
|
627
|
+
z7.object({
|
|
574
628
|
actionId: identifier,
|
|
575
|
-
chain:
|
|
629
|
+
chain: z7.literal("eip155"),
|
|
576
630
|
address: evmAddressSchema
|
|
577
631
|
}).strict(),
|
|
578
|
-
|
|
632
|
+
z7.object({
|
|
579
633
|
actionId: identifier,
|
|
580
|
-
chain:
|
|
634
|
+
chain: z7.literal("cosmos"),
|
|
581
635
|
network: cosmosNetworkSchema,
|
|
582
636
|
address: cosmosAddressSchema
|
|
583
637
|
}).strict()
|
|
584
638
|
]);
|
|
585
|
-
var testMemberWalletUnlinkSchema =
|
|
639
|
+
var testMemberWalletUnlinkSchema = z7.object({
|
|
586
640
|
actionId: identifier,
|
|
587
641
|
chain: walletChainSchema,
|
|
588
|
-
address:
|
|
642
|
+
address: z7.string().min(1).max(100)
|
|
589
643
|
}).strict();
|
|
590
|
-
var snowflake =
|
|
591
|
-
var accountId =
|
|
592
|
-
var testMemberAccountLinkSchema =
|
|
593
|
-
|
|
644
|
+
var snowflake = z7.string().regex(/^[0-9]{1,20}$/);
|
|
645
|
+
var accountId = z7.string().regex(/^[0-9]{1,20}$/, "Use the numeric user ID");
|
|
646
|
+
var testMemberAccountLinkSchema = z7.union([
|
|
647
|
+
z7.object({
|
|
594
648
|
actionId: identifier,
|
|
595
|
-
provider:
|
|
649
|
+
provider: z7.enum(["x", "discord"]),
|
|
596
650
|
id: accountId
|
|
597
651
|
}).strict(),
|
|
598
|
-
|
|
652
|
+
z7.object({
|
|
599
653
|
actionId: identifier,
|
|
600
|
-
provider:
|
|
654
|
+
provider: z7.literal("x"),
|
|
601
655
|
username: xUsernameSchema
|
|
602
656
|
}).strict()
|
|
603
657
|
]);
|
|
604
|
-
var testMemberAccountUnlinkSchema =
|
|
658
|
+
var testMemberAccountUnlinkSchema = z7.object({
|
|
605
659
|
actionId: identifier,
|
|
606
|
-
provider:
|
|
660
|
+
provider: z7.enum(["x", "discord"]),
|
|
607
661
|
id: accountId
|
|
608
662
|
}).strict();
|
|
609
|
-
var metric =
|
|
610
|
-
var testMemberXPostSchema =
|
|
611
|
-
content:
|
|
612
|
-
author:
|
|
663
|
+
var metric = z7.number().int().nonnegative().safe();
|
|
664
|
+
var testMemberXPostSchema = z7.strictObject({
|
|
665
|
+
content: z7.string().max(4e3).default(""),
|
|
666
|
+
author: z7.strictObject({
|
|
613
667
|
/** Defaults to `test_` and the end of the synthetic account ID. */
|
|
614
|
-
username:
|
|
668
|
+
username: z7.string().min(1).max(50).optional(),
|
|
615
669
|
/** Defaults to the test member's name. */
|
|
616
|
-
name:
|
|
670
|
+
name: z7.string().min(1).max(100).optional()
|
|
617
671
|
}).default({}),
|
|
618
|
-
isReply:
|
|
619
|
-
isRetweet:
|
|
620
|
-
isQuoteTweet:
|
|
672
|
+
isReply: z7.boolean().default(false),
|
|
673
|
+
isRetweet: z7.boolean().default(false),
|
|
674
|
+
isQuoteTweet: z7.boolean().default(false),
|
|
621
675
|
likeCount: metric.default(0),
|
|
622
676
|
replyCount: metric.default(0),
|
|
623
677
|
retweetCount: metric.default(0),
|
|
@@ -625,23 +679,23 @@ var testMemberXPostSchema = z6.strictObject({
|
|
|
625
679
|
viewCount: metric.default(0),
|
|
626
680
|
bookmarkCount: metric.default(0)
|
|
627
681
|
});
|
|
628
|
-
var testMemberDiscordMessageSchema =
|
|
682
|
+
var testMemberDiscordMessageSchema = z7.strictObject({
|
|
629
683
|
channelId: snowflake.optional(),
|
|
630
684
|
replyTo: snowflake.nullable().default(null),
|
|
631
|
-
text:
|
|
685
|
+
text: z7.string().max(4e3).optional()
|
|
632
686
|
});
|
|
633
|
-
var testMemberDiscordReactionSchema =
|
|
687
|
+
var testMemberDiscordReactionSchema = z7.strictObject({
|
|
634
688
|
channelId: snowflake.optional(),
|
|
635
689
|
messageId: snowflake.optional(),
|
|
636
|
-
emoji:
|
|
690
|
+
emoji: z7.strictObject({
|
|
637
691
|
/** A custom emoji's ID, or null for a Unicode emoji. */
|
|
638
692
|
id: snowflake.nullable().default(null),
|
|
639
|
-
name:
|
|
693
|
+
name: z7.string().min(1).max(100)
|
|
640
694
|
}).default({ id: null, name: "\u{1F44D}" }),
|
|
641
|
-
reactorRoles:
|
|
642
|
-
messagePublishedAt:
|
|
695
|
+
reactorRoles: z7.array(snowflake).max(50).default([]),
|
|
696
|
+
messagePublishedAt: z7.number().int().nonnegative().safe().optional()
|
|
643
697
|
});
|
|
644
|
-
var testMemberRecordSchema =
|
|
698
|
+
var testMemberRecordSchema = z7.object({
|
|
645
699
|
actionId: identifier,
|
|
646
700
|
/** A managed X or Discord tracker, by key or ID. */
|
|
647
701
|
tracker: identifier,
|
|
@@ -649,16 +703,16 @@ var testMemberRecordSchema = z6.object({
|
|
|
649
703
|
* The record account the test member holds. `messageAuthor` (Discord reactions only) makes the
|
|
650
704
|
* member the reacted-to message's author, and the reactor a synthetic account no member holds.
|
|
651
705
|
*/
|
|
652
|
-
as:
|
|
653
|
-
data:
|
|
706
|
+
as: z7.enum(["author", "messageAuthor"]).default("author"),
|
|
707
|
+
data: z7.record(z7.string(), z7.json()).default({})
|
|
654
708
|
}).strict();
|
|
655
709
|
var testMemberRecordResultSchema = trackerIngestResultSchema.extend({
|
|
656
710
|
/** The tracker's stable ID. */
|
|
657
711
|
tracker: identifier,
|
|
658
712
|
/** The stored record's ID. */
|
|
659
|
-
record:
|
|
713
|
+
record: z7.string(),
|
|
660
714
|
/** The account the record names for the test member: its linked one, else its synthetic one. */
|
|
661
|
-
account:
|
|
715
|
+
account: z7.object({ kind: z7.enum(["x", "discord"]), id: z7.string() })
|
|
662
716
|
});
|
|
663
717
|
var TestMemberDecisionKind = {
|
|
664
718
|
/** `testMembers.pass`: the quest's check never ran. */
|
|
@@ -666,113 +720,113 @@ var TestMemberDecisionKind = {
|
|
|
666
720
|
/** `testMembers.acceptAnyway`: the attempt was rejected, then accepted. */
|
|
667
721
|
AcceptAnyway: "accept-anyway"
|
|
668
722
|
};
|
|
669
|
-
var testMemberDecisionKindSchema =
|
|
670
|
-
var testMemberOperatorDecisionSchema =
|
|
723
|
+
var testMemberDecisionKindSchema = z7.string();
|
|
724
|
+
var testMemberOperatorDecisionSchema = z7.object({
|
|
671
725
|
kind: testMemberDecisionKindSchema,
|
|
672
726
|
/** The operator who decided, as audit history names them. */
|
|
673
|
-
actor:
|
|
674
|
-
at:
|
|
727
|
+
actor: z7.string().nullable(),
|
|
728
|
+
at: z7.number().int().nonnegative().safe()
|
|
675
729
|
});
|
|
676
|
-
var testMemberHistoryQuerySchema =
|
|
730
|
+
var testMemberHistoryQuerySchema = z7.object({
|
|
677
731
|
/** Inclusive lower bound on credited activity time, in epoch milliseconds. */
|
|
678
|
-
since:
|
|
732
|
+
since: z7.coerce.number().int().nonnegative().safe().optional()
|
|
679
733
|
});
|
|
680
|
-
var testMemberHistorySchema =
|
|
734
|
+
var testMemberHistorySchema = z7.object({
|
|
681
735
|
/** Newest credited activity first, up to 500 attempts. */
|
|
682
|
-
attempts:
|
|
736
|
+
attempts: z7.array(
|
|
683
737
|
attemptSchema.extend({
|
|
684
|
-
eligibleAt:
|
|
738
|
+
eligibleAt: z7.number().int().nonnegative().safe(),
|
|
685
739
|
/** Set when an operator decided the attempt in place of its evaluator; absent otherwise. */
|
|
686
740
|
operatorDecision: testMemberOperatorDecisionSchema.optional(),
|
|
687
741
|
/**
|
|
688
742
|
* Rewards of this attempt's completion that Relay never sent, each with why: a role reward
|
|
689
743
|
* for a test-linked Discord account. Absent when every reward was sent.
|
|
690
744
|
*/
|
|
691
|
-
rewardsNotSent:
|
|
745
|
+
rewardsNotSent: z7.array(z7.object({ reason: z7.string() })).optional()
|
|
692
746
|
})
|
|
693
747
|
),
|
|
694
748
|
/** Tracker trigger outcomes that admitted no attempt, newest occurrence first, up to 500. */
|
|
695
|
-
skipped:
|
|
696
|
-
|
|
749
|
+
skipped: z7.array(
|
|
750
|
+
z7.object({
|
|
697
751
|
quest: identifier,
|
|
698
752
|
tracker: identifier,
|
|
699
|
-
record:
|
|
700
|
-
code:
|
|
701
|
-
occurredAt:
|
|
753
|
+
record: z7.string(),
|
|
754
|
+
code: z7.string().min(1),
|
|
755
|
+
occurredAt: z7.number().int().nonnegative().safe()
|
|
702
756
|
})
|
|
703
757
|
),
|
|
704
758
|
/** False when older entries were omitted from either list. */
|
|
705
|
-
complete:
|
|
759
|
+
complete: z7.boolean()
|
|
706
760
|
});
|
|
707
761
|
|
|
708
762
|
// src/server/member-imports.ts
|
|
709
|
-
import * as
|
|
710
|
-
var importTimeSchema =
|
|
711
|
-
|
|
712
|
-
|
|
763
|
+
import * as z8 from "zod";
|
|
764
|
+
var importTimeSchema = z8.union([
|
|
765
|
+
z8.number().int().nonnegative().safe(),
|
|
766
|
+
offsetDateTimeSchema().transform((value) => Date.parse(value))
|
|
713
767
|
]);
|
|
714
|
-
var importWalletSchema =
|
|
715
|
-
|
|
716
|
-
kind:
|
|
717
|
-
chain:
|
|
768
|
+
var importWalletSchema = z8.discriminatedUnion("chain", [
|
|
769
|
+
z8.object({
|
|
770
|
+
kind: z8.literal("wallet"),
|
|
771
|
+
chain: z8.literal("solana"),
|
|
718
772
|
address: solanaAddressSchema
|
|
719
773
|
}).strict(),
|
|
720
|
-
|
|
721
|
-
kind:
|
|
722
|
-
chain:
|
|
774
|
+
z8.object({
|
|
775
|
+
kind: z8.literal("wallet"),
|
|
776
|
+
chain: z8.literal("eip155"),
|
|
723
777
|
address: evmAddressSchema
|
|
724
778
|
}).strict(),
|
|
725
|
-
|
|
726
|
-
kind:
|
|
727
|
-
chain:
|
|
779
|
+
z8.object({
|
|
780
|
+
kind: z8.literal("wallet"),
|
|
781
|
+
chain: z8.literal("cosmos"),
|
|
728
782
|
network: cosmosNetworkSchema,
|
|
729
783
|
address: cosmosAddressSchema
|
|
730
784
|
}).strict()
|
|
731
785
|
]);
|
|
732
|
-
var importXSchema =
|
|
733
|
-
kind:
|
|
734
|
-
subject:
|
|
786
|
+
var importXSchema = z8.object({
|
|
787
|
+
kind: z8.literal("x"),
|
|
788
|
+
subject: z8.string().regex(/^[1-9][0-9]{0,19}$/, "Use the numeric X user ID")
|
|
735
789
|
}).strict();
|
|
736
|
-
var importAppIdentitySchema =
|
|
737
|
-
var memberImportIdentitySchema =
|
|
790
|
+
var importAppIdentitySchema = z8.object({ kind: appIdentityKindSchema, subject: z8.string().min(1).max(256) }).strict();
|
|
791
|
+
var memberImportIdentitySchema = z8.union([
|
|
738
792
|
importAppIdentitySchema,
|
|
739
793
|
importWalletSchema,
|
|
740
794
|
importXSchema
|
|
741
795
|
]);
|
|
742
|
-
var memberImportAccountSchema =
|
|
796
|
+
var memberImportAccountSchema = z8.union([
|
|
743
797
|
importWalletSchema,
|
|
744
798
|
importXSchema
|
|
745
799
|
]);
|
|
746
|
-
var memberImportActionSchema =
|
|
800
|
+
var memberImportActionSchema = z8.object({
|
|
747
801
|
at: importTimeSchema,
|
|
748
|
-
key:
|
|
802
|
+
key: z8.string().min(1).max(200).optional()
|
|
749
803
|
}).strict();
|
|
750
|
-
var memberImportRowSchema =
|
|
804
|
+
var memberImportRowSchema = z8.object({
|
|
751
805
|
/** The member's ID on the platform they come from. Unique within an import. */
|
|
752
|
-
ref:
|
|
806
|
+
ref: z8.string().trim().min(1).max(200),
|
|
753
807
|
identity: memberImportIdentitySchema,
|
|
754
|
-
accounts:
|
|
808
|
+
accounts: z8.array(memberImportAccountSchema).max(20).default([]),
|
|
755
809
|
/** Opening balances, credited once per ledger as an imported entry. */
|
|
756
|
-
points:
|
|
757
|
-
|
|
758
|
-
ledger:
|
|
759
|
-
balance:
|
|
810
|
+
points: z8.array(
|
|
811
|
+
z8.object({
|
|
812
|
+
ledger: z8.string().min(1).max(200),
|
|
813
|
+
balance: z8.number().int().positive().safe()
|
|
760
814
|
}).strict()
|
|
761
815
|
).max(50).default([]),
|
|
762
816
|
/** Quest progress, by quest authoring key or ID. */
|
|
763
|
-
quests:
|
|
764
|
-
|
|
765
|
-
quest:
|
|
766
|
-
actions:
|
|
817
|
+
quests: z8.array(
|
|
818
|
+
z8.object({
|
|
819
|
+
quest: z8.string().min(1).max(200),
|
|
820
|
+
actions: z8.array(memberImportActionSchema).min(1).max(3660)
|
|
767
821
|
}).strict()
|
|
768
822
|
).max(200).default([])
|
|
769
823
|
}).strict();
|
|
770
|
-
var memberImportCreateSchema =
|
|
824
|
+
var memberImportCreateSchema = z8.object({
|
|
771
825
|
actionId: identifier,
|
|
772
826
|
/** Where the members come from, such as "legacy-domino". */
|
|
773
|
-
source:
|
|
827
|
+
source: z8.string().trim().min(1).max(100)
|
|
774
828
|
}).strict();
|
|
775
|
-
var memberImportRowsInputSchema =
|
|
829
|
+
var memberImportRowsInputSchema = z8.object({ rows: z8.array(memberImportRowSchema).min(1).max(500) }).strict();
|
|
776
830
|
var MemberImportRefusalCode = {
|
|
777
831
|
/** An account or identity belongs to another member in the project. */
|
|
778
832
|
AccountLinkedElsewhere: "account-linked-elsewhere",
|
|
@@ -799,57 +853,57 @@ var MemberImportRefusalCode = {
|
|
|
799
853
|
/** The row names one point ledger or quest twice, by any of its names. */
|
|
800
854
|
DuplicateEntry: "duplicate-entry"
|
|
801
855
|
};
|
|
802
|
-
var refusalCodeSchema =
|
|
803
|
-
var memberImportRefusalSchema =
|
|
856
|
+
var refusalCodeSchema = z8.string();
|
|
857
|
+
var memberImportRefusalSchema = z8.object({
|
|
804
858
|
code: refusalCodeSchema,
|
|
805
|
-
message:
|
|
859
|
+
message: z8.string()
|
|
806
860
|
});
|
|
807
|
-
var memberImportRowResultSchema =
|
|
808
|
-
line:
|
|
809
|
-
ref:
|
|
810
|
-
status:
|
|
861
|
+
var memberImportRowResultSchema = z8.object({
|
|
862
|
+
line: z8.number().int().positive(),
|
|
863
|
+
ref: z8.string(),
|
|
864
|
+
status: z8.enum(["pending", "ready", "applied", "refused"]),
|
|
811
865
|
/** The member the row resolves to: an existing member, or the one applying created. */
|
|
812
866
|
member: identifier.nullable(),
|
|
813
867
|
/** Whether the row's identity names a member who already exists. Null until checked. */
|
|
814
|
-
existing:
|
|
815
|
-
refusals:
|
|
868
|
+
existing: z8.boolean().nullable(),
|
|
869
|
+
refusals: z8.array(memberImportRefusalSchema)
|
|
816
870
|
});
|
|
817
|
-
var memberImportRowPageSchema =
|
|
818
|
-
items:
|
|
819
|
-
nextCursor:
|
|
871
|
+
var memberImportRowPageSchema = z8.object({
|
|
872
|
+
items: z8.array(memberImportRowResultSchema),
|
|
873
|
+
nextCursor: z8.string().nullable()
|
|
820
874
|
});
|
|
821
|
-
var memberImportRowQuerySchema =
|
|
822
|
-
status:
|
|
823
|
-
cursor:
|
|
824
|
-
limit:
|
|
875
|
+
var memberImportRowQuerySchema = z8.object({
|
|
876
|
+
status: z8.enum(["pending", "ready", "applied", "refused"]).optional(),
|
|
877
|
+
cursor: z8.string().max(200).optional(),
|
|
878
|
+
limit: z8.coerce.number().int().min(1).max(500).optional()
|
|
825
879
|
}).strict();
|
|
826
|
-
var memberImportSummarySchema =
|
|
827
|
-
rows:
|
|
828
|
-
ready:
|
|
829
|
-
refused:
|
|
830
|
-
members:
|
|
831
|
-
created:
|
|
832
|
-
existing:
|
|
880
|
+
var memberImportSummarySchema = z8.object({
|
|
881
|
+
rows: z8.number().int().nonnegative(),
|
|
882
|
+
ready: z8.number().int().nonnegative(),
|
|
883
|
+
refused: z8.number().int().nonnegative(),
|
|
884
|
+
members: z8.object({
|
|
885
|
+
created: z8.number().int().nonnegative(),
|
|
886
|
+
existing: z8.number().int().nonnegative()
|
|
833
887
|
}),
|
|
834
888
|
/** Identities and accounts the ready rows attach, sign-in identities included. */
|
|
835
|
-
accounts:
|
|
889
|
+
accounts: z8.number().int().nonnegative(),
|
|
836
890
|
/** Opening balance totals, by ledger as the rows name it. */
|
|
837
|
-
points:
|
|
838
|
-
|
|
891
|
+
points: z8.array(
|
|
892
|
+
z8.object({ ledger: z8.string(), total: z8.number().int().nonnegative() })
|
|
839
893
|
),
|
|
840
894
|
/** Imported actions, by quest as the rows name it. */
|
|
841
|
-
actions:
|
|
842
|
-
|
|
895
|
+
actions: z8.array(
|
|
896
|
+
z8.object({ quest: z8.string(), total: z8.number().int().nonnegative() })
|
|
843
897
|
),
|
|
844
898
|
/** Refused rows, by refusal code. A row can have several. */
|
|
845
|
-
refusals:
|
|
846
|
-
|
|
899
|
+
refusals: z8.array(
|
|
900
|
+
z8.object({ code: refusalCodeSchema, rows: z8.number().int().nonnegative() })
|
|
847
901
|
)
|
|
848
902
|
});
|
|
849
|
-
var memberImportSchema =
|
|
903
|
+
var memberImportSchema = z8.object({
|
|
850
904
|
id: identifier,
|
|
851
|
-
source:
|
|
852
|
-
status:
|
|
905
|
+
source: z8.string(),
|
|
906
|
+
status: z8.enum([
|
|
853
907
|
"open",
|
|
854
908
|
"checking",
|
|
855
909
|
"checked",
|
|
@@ -857,115 +911,115 @@ var memberImportSchema = z7.object({
|
|
|
857
911
|
"applied",
|
|
858
912
|
"canceled"
|
|
859
913
|
]),
|
|
860
|
-
rows:
|
|
914
|
+
rows: z8.number().int().nonnegative(),
|
|
861
915
|
/** The latest check's summary, or null before the first check and after rows change. */
|
|
862
916
|
summary: memberImportSummarySchema.nullable(),
|
|
863
917
|
/** While applying and after: rows applied and refused so far. */
|
|
864
|
-
progress:
|
|
865
|
-
applied:
|
|
866
|
-
refused:
|
|
918
|
+
progress: z8.object({
|
|
919
|
+
applied: z8.number().int().nonnegative(),
|
|
920
|
+
refused: z8.number().int().nonnegative()
|
|
867
921
|
}),
|
|
868
|
-
createdAt:
|
|
869
|
-
createdBy:
|
|
870
|
-
checkedAt:
|
|
871
|
-
appliedAt:
|
|
872
|
-
appliedBy:
|
|
873
|
-
canceledAt:
|
|
874
|
-
canceledBy:
|
|
875
|
-
});
|
|
876
|
-
var memberImportPageSchema =
|
|
877
|
-
items:
|
|
878
|
-
nextCursor:
|
|
879
|
-
});
|
|
880
|
-
var memberImportListQuerySchema =
|
|
881
|
-
cursor:
|
|
882
|
-
limit:
|
|
922
|
+
createdAt: z8.number().int(),
|
|
923
|
+
createdBy: z8.string().nullable(),
|
|
924
|
+
checkedAt: z8.number().int().nullable(),
|
|
925
|
+
appliedAt: z8.number().int().nullable(),
|
|
926
|
+
appliedBy: z8.string().nullable(),
|
|
927
|
+
canceledAt: z8.number().int().nullable(),
|
|
928
|
+
canceledBy: z8.string().nullable()
|
|
929
|
+
});
|
|
930
|
+
var memberImportPageSchema = z8.object({
|
|
931
|
+
items: z8.array(memberImportSchema),
|
|
932
|
+
nextCursor: z8.string().nullable()
|
|
933
|
+
});
|
|
934
|
+
var memberImportListQuerySchema = z8.object({
|
|
935
|
+
cursor: z8.string().max(200).optional(),
|
|
936
|
+
limit: z8.coerce.number().int().min(1).max(100).optional()
|
|
883
937
|
}).strict();
|
|
884
938
|
|
|
885
939
|
// src/server/webhooks.ts
|
|
886
|
-
import * as
|
|
940
|
+
import * as z9 from "zod";
|
|
887
941
|
var PayoutSourceKind = {
|
|
888
942
|
Quest: "quest",
|
|
889
943
|
Leaderboard: "leaderboard",
|
|
890
944
|
Engagement: "engagement",
|
|
891
945
|
Manual: "manual"
|
|
892
946
|
};
|
|
893
|
-
var webhookEventSchema =
|
|
894
|
-
id:
|
|
895
|
-
version:
|
|
947
|
+
var webhookEventSchema = z9.object({
|
|
948
|
+
id: z9.string().uuid(),
|
|
949
|
+
version: z9.literal(1),
|
|
896
950
|
type: activityTypeSchema,
|
|
897
|
-
createdAt:
|
|
898
|
-
organization:
|
|
899
|
-
project:
|
|
900
|
-
environment:
|
|
901
|
-
data:
|
|
902
|
-
});
|
|
903
|
-
var webhookControlInputSchema =
|
|
904
|
-
var webhookInputSchema =
|
|
905
|
-
url:
|
|
951
|
+
createdAt: z9.number().int().nonnegative(),
|
|
952
|
+
organization: z9.string(),
|
|
953
|
+
project: z9.string(),
|
|
954
|
+
environment: z9.enum(["test", "live"]),
|
|
955
|
+
data: z9.record(z9.string(), z9.json())
|
|
956
|
+
});
|
|
957
|
+
var webhookControlInputSchema = z9.object({ actionId: z9.string().uuid().optional() }).strict();
|
|
958
|
+
var webhookInputSchema = z9.object({
|
|
959
|
+
url: z9.url().max(2048).refine((value) => {
|
|
906
960
|
const url2 = new URL(value);
|
|
907
961
|
return url2.protocol === "https:" && !url2.username && !url2.password && !url2.hash;
|
|
908
962
|
}, "Use an HTTPS URL without credentials or a fragment"),
|
|
909
|
-
types:
|
|
963
|
+
types: z9.array(activityTypeSchema).min(1).max(100).refine((v) => new Set(v).size === v.length)
|
|
910
964
|
}).strict();
|
|
911
|
-
var webhookCreateInputSchema = webhookInputSchema.extend({ actionId:
|
|
912
|
-
var webhookRotateInputSchema =
|
|
913
|
-
var webhookUpdateSchema = webhookInputSchema.partial().extend({ enabled:
|
|
914
|
-
var webhookEndpointSchema =
|
|
965
|
+
var webhookCreateInputSchema = webhookInputSchema.extend({ actionId: z9.string().uuid().optional() }).strict();
|
|
966
|
+
var webhookRotateInputSchema = z9.object({ actionId: z9.string().uuid().optional() }).strict();
|
|
967
|
+
var webhookUpdateSchema = webhookInputSchema.partial().extend({ enabled: z9.boolean().optional() }).strict();
|
|
968
|
+
var webhookEndpointSchema = z9.object({
|
|
915
969
|
...webhookInputSchema.shape,
|
|
916
|
-
id:
|
|
917
|
-
enabled:
|
|
918
|
-
disabledReason:
|
|
919
|
-
consecutiveFailures:
|
|
920
|
-
createdAt:
|
|
921
|
-
updatedAt:
|
|
970
|
+
id: z9.string().uuid(),
|
|
971
|
+
enabled: z9.boolean(),
|
|
972
|
+
disabledReason: z9.string().nullable(),
|
|
973
|
+
consecutiveFailures: z9.number().int().nonnegative(),
|
|
974
|
+
createdAt: z9.number(),
|
|
975
|
+
updatedAt: z9.number()
|
|
922
976
|
});
|
|
923
977
|
var webhookEndpointStateSchema = webhookEndpointSchema.extend({
|
|
924
|
-
revision:
|
|
925
|
-
deletedAt:
|
|
978
|
+
revision: z9.number().int().nonnegative(),
|
|
979
|
+
deletedAt: z9.number().int().safe().nonnegative().nullable()
|
|
926
980
|
});
|
|
927
|
-
var webhookDeleteInputSchema =
|
|
928
|
-
actionId:
|
|
929
|
-
expectedRevision:
|
|
930
|
-
reason:
|
|
981
|
+
var webhookDeleteInputSchema = z9.strictObject({
|
|
982
|
+
actionId: z9.string().uuid().default(() => crypto.randomUUID()),
|
|
983
|
+
expectedRevision: z9.number().int().nonnegative(),
|
|
984
|
+
reason: z9.string().trim().min(1).max(500)
|
|
931
985
|
});
|
|
932
|
-
var webhookStateQuerySchema =
|
|
986
|
+
var webhookStateQuerySchema = z9.strictObject({
|
|
933
987
|
cursor: pageCursorSchema.optional(),
|
|
934
|
-
limit:
|
|
988
|
+
limit: z9.coerce.number().int().min(1).max(100).default(50)
|
|
935
989
|
});
|
|
936
|
-
var webhookStatePageSchema =
|
|
937
|
-
items:
|
|
990
|
+
var webhookStatePageSchema = z9.object({
|
|
991
|
+
items: z9.array(webhookEndpointStateSchema),
|
|
938
992
|
nextCursor: pageCursorSchema.nullable()
|
|
939
993
|
});
|
|
940
|
-
var webhookSecretSchema =
|
|
994
|
+
var webhookSecretSchema = z9.object({
|
|
941
995
|
endpoint: webhookEndpointSchema,
|
|
942
|
-
secret:
|
|
943
|
-
previousValidUntil:
|
|
996
|
+
secret: z9.string(),
|
|
997
|
+
previousValidUntil: z9.number().nullable()
|
|
944
998
|
});
|
|
945
|
-
var webhookDeliverySchema =
|
|
946
|
-
id:
|
|
947
|
-
endpoint:
|
|
999
|
+
var webhookDeliverySchema = z9.object({
|
|
1000
|
+
id: z9.string().uuid(),
|
|
1001
|
+
endpoint: z9.string().uuid(),
|
|
948
1002
|
event: webhookEventSchema,
|
|
949
|
-
status:
|
|
950
|
-
attempts:
|
|
951
|
-
responseStatus:
|
|
952
|
-
lastError:
|
|
953
|
-
createdAt:
|
|
954
|
-
deliveredAt:
|
|
955
|
-
replayOf:
|
|
956
|
-
});
|
|
957
|
-
var webhookQuerySchema =
|
|
1003
|
+
status: z9.enum(["pending", "delivered", "failed", "skipped"]),
|
|
1004
|
+
attempts: z9.number().int().nonnegative(),
|
|
1005
|
+
responseStatus: z9.number().nullable(),
|
|
1006
|
+
lastError: z9.string().nullable(),
|
|
1007
|
+
createdAt: z9.number(),
|
|
1008
|
+
deliveredAt: z9.number().nullable(),
|
|
1009
|
+
replayOf: z9.string().uuid().nullable()
|
|
1010
|
+
});
|
|
1011
|
+
var webhookQuerySchema = z9.object({
|
|
958
1012
|
/** A page's `nextCursor`: the deliveries after it, newest first. */
|
|
959
1013
|
cursor: pageCursorSchema.optional(),
|
|
960
1014
|
/** @deprecated Use `cursor`. Removed in 2.0.0. */
|
|
961
|
-
before:
|
|
962
|
-
limit:
|
|
1015
|
+
before: z9.string().uuid().optional(),
|
|
1016
|
+
limit: z9.coerce.number().int().min(1).max(100).default(50)
|
|
963
1017
|
}).strict();
|
|
964
|
-
var webhookDeliveryPageSchema =
|
|
965
|
-
items:
|
|
1018
|
+
var webhookDeliveryPageSchema = z9.object({
|
|
1019
|
+
items: z9.array(webhookDeliverySchema),
|
|
966
1020
|
nextCursor: pageCursorSchema.nullable().default(null),
|
|
967
1021
|
/** @deprecated Use `nextCursor`, passed back as `cursor`. Removed in 2.0.0. */
|
|
968
|
-
next:
|
|
1022
|
+
next: z9.string().uuid().nullable()
|
|
969
1023
|
});
|
|
970
1024
|
var WEBHOOK_MAX_BYTES = 64 * 1024;
|
|
971
1025
|
async function verifyWebhook(input) {
|
|
@@ -1009,8 +1063,8 @@ async function verifyWebhook(input) {
|
|
|
1009
1063
|
}
|
|
1010
1064
|
|
|
1011
1065
|
// src/server/resource-lifecycle.ts
|
|
1012
|
-
import * as
|
|
1013
|
-
var resourceLifecycleKindSchema =
|
|
1066
|
+
import * as z10 from "zod";
|
|
1067
|
+
var resourceLifecycleKindSchema = z10.enum([
|
|
1014
1068
|
"tracker",
|
|
1015
1069
|
"referral",
|
|
1016
1070
|
"leaderboard",
|
|
@@ -1020,24 +1074,24 @@ var resourceLifecycleKindSchema = z9.enum([
|
|
|
1020
1074
|
"image",
|
|
1021
1075
|
"point-ledger"
|
|
1022
1076
|
]);
|
|
1023
|
-
var managedResourceSchema =
|
|
1077
|
+
var managedResourceSchema = z10.object({
|
|
1024
1078
|
kind: resourceLifecycleKindSchema,
|
|
1025
1079
|
id: identifier,
|
|
1026
1080
|
key: identifier.nullable(),
|
|
1027
|
-
title:
|
|
1028
|
-
archivedAt:
|
|
1081
|
+
title: z10.string(),
|
|
1082
|
+
archivedAt: z10.number().int().nonnegative().nullable()
|
|
1029
1083
|
});
|
|
1030
|
-
var resourceLifecycleInputSchema =
|
|
1031
|
-
actionId:
|
|
1084
|
+
var resourceLifecycleInputSchema = z10.object({
|
|
1085
|
+
actionId: z10.string().uuid(),
|
|
1032
1086
|
kind: resourceLifecycleKindSchema,
|
|
1033
1087
|
resource: identifier,
|
|
1034
|
-
archived:
|
|
1035
|
-
reason:
|
|
1036
|
-
expectedArchivedAt:
|
|
1088
|
+
archived: z10.boolean(),
|
|
1089
|
+
reason: lifecycleReasonSchema,
|
|
1090
|
+
expectedArchivedAt: z10.number().int().nonnegative().nullable().optional()
|
|
1037
1091
|
}).strict();
|
|
1038
|
-
var resourceLifecycleResultSchema =
|
|
1092
|
+
var resourceLifecycleResultSchema = z10.object({
|
|
1039
1093
|
resource: managedResourceSchema,
|
|
1040
|
-
changed:
|
|
1094
|
+
changed: z10.boolean()
|
|
1041
1095
|
});
|
|
1042
1096
|
var resourceLifecyclePaths = {
|
|
1043
1097
|
tracker: "/trackers",
|
|
@@ -1056,8 +1110,8 @@ var resourceArchiveInputSchema = resourceLifecycleInputSchema.omit({
|
|
|
1056
1110
|
});
|
|
1057
1111
|
|
|
1058
1112
|
// src/server/promotions.ts
|
|
1059
|
-
import * as
|
|
1060
|
-
var promotionResourceKindSchema =
|
|
1113
|
+
import * as z11 from "zod";
|
|
1114
|
+
var promotionResourceKindSchema = z11.enum([
|
|
1061
1115
|
"quest",
|
|
1062
1116
|
"quest-type",
|
|
1063
1117
|
"collection",
|
|
@@ -1076,176 +1130,242 @@ var promotionResourceKindSchema = z10.enum([
|
|
|
1076
1130
|
"profile-settings",
|
|
1077
1131
|
"app-build"
|
|
1078
1132
|
]);
|
|
1079
|
-
var promotionChangeSchema =
|
|
1080
|
-
kind:
|
|
1081
|
-
key:
|
|
1082
|
-
title:
|
|
1133
|
+
var promotionChangeSchema = z11.object({
|
|
1134
|
+
kind: z11.union([promotionResourceKindSchema, z11.string()]),
|
|
1135
|
+
key: z11.string(),
|
|
1136
|
+
title: z11.string(),
|
|
1083
1137
|
/** `added`: new in live. `changed`: live's differs. `archived` and `unarchived` change only its lifecycle. */
|
|
1084
|
-
change:
|
|
1085
|
-
|
|
1086
|
-
|
|
1138
|
+
change: z11.union([
|
|
1139
|
+
z11.enum(["added", "changed", "archived", "unarchived"]),
|
|
1140
|
+
z11.string()
|
|
1087
1141
|
])
|
|
1088
1142
|
});
|
|
1089
|
-
var promotionWarningSchema =
|
|
1090
|
-
code:
|
|
1091
|
-
message:
|
|
1092
|
-
kind:
|
|
1093
|
-
key:
|
|
1143
|
+
var promotionWarningSchema = z11.object({
|
|
1144
|
+
code: z11.string(),
|
|
1145
|
+
message: z11.string(),
|
|
1146
|
+
kind: z11.string().optional(),
|
|
1147
|
+
key: z11.string().optional()
|
|
1094
1148
|
});
|
|
1095
|
-
var promotionBuildSchema =
|
|
1149
|
+
var promotionBuildSchema = z11.object({
|
|
1096
1150
|
repository: identifier,
|
|
1097
1151
|
build: identifier
|
|
1098
1152
|
});
|
|
1099
|
-
var promotionSourceSchema =
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1153
|
+
var promotionSourceSchema = z11.discriminatedUnion("kind", [
|
|
1154
|
+
z11.object({ kind: z11.literal("test") }),
|
|
1155
|
+
z11.object({ kind: z11.literal("rollback"), promotion: identifier }),
|
|
1156
|
+
z11.object({ kind: z11.literal("deployment"), deployment: identifier })
|
|
1103
1157
|
]);
|
|
1104
1158
|
var promotionMetadata = {
|
|
1105
1159
|
id: identifier,
|
|
1106
1160
|
source: promotionSourceSchema,
|
|
1107
|
-
changes:
|
|
1108
|
-
warnings:
|
|
1161
|
+
changes: z11.array(promotionChangeSchema),
|
|
1162
|
+
warnings: z11.array(promotionWarningSchema),
|
|
1109
1163
|
build: promotionBuildSchema.nullable(),
|
|
1110
|
-
createdAt:
|
|
1111
|
-
createdBy:
|
|
1164
|
+
createdAt: z11.number().int().nonnegative(),
|
|
1165
|
+
createdBy: z11.string().nullable()
|
|
1112
1166
|
};
|
|
1113
1167
|
var decided = {
|
|
1114
|
-
decidedAt:
|
|
1115
|
-
decidedBy:
|
|
1168
|
+
decidedAt: z11.number().int().nonnegative(),
|
|
1169
|
+
decidedBy: z11.string().nullable()
|
|
1116
1170
|
};
|
|
1117
|
-
var promotionRecordSchema =
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1171
|
+
var promotionRecordSchema = z11.discriminatedUnion("status", [
|
|
1172
|
+
z11.object({ ...promotionMetadata, status: z11.literal("pending") }),
|
|
1173
|
+
z11.object({ ...promotionMetadata, ...decided, status: z11.literal("applied") }),
|
|
1174
|
+
z11.object({
|
|
1121
1175
|
...promotionMetadata,
|
|
1122
1176
|
...decided,
|
|
1123
|
-
status:
|
|
1124
|
-
reason:
|
|
1177
|
+
status: z11.literal("rejected"),
|
|
1178
|
+
reason: z11.string()
|
|
1125
1179
|
}),
|
|
1126
|
-
|
|
1180
|
+
z11.object({
|
|
1127
1181
|
...promotionMetadata,
|
|
1128
1182
|
...decided,
|
|
1129
|
-
status:
|
|
1183
|
+
status: z11.literal("superseded")
|
|
1130
1184
|
})
|
|
1131
1185
|
]);
|
|
1132
|
-
var promotionActionSchema =
|
|
1133
|
-
var promotionRejectionSchema =
|
|
1134
|
-
var promotionHistoryQuerySchema =
|
|
1186
|
+
var promotionActionSchema = z11.object({ actionId: z11.string().uuid() }).strict();
|
|
1187
|
+
var promotionRejectionSchema = z11.object({ reason: z11.string().trim().min(1).max(1e3) }).strict();
|
|
1188
|
+
var promotionHistoryQuerySchema = z11.strictObject({
|
|
1135
1189
|
cursor: pageCursorSchema.optional(),
|
|
1136
|
-
limit:
|
|
1190
|
+
limit: z11.coerce.number().int().min(1).max(100).optional()
|
|
1137
1191
|
});
|
|
1138
|
-
var promotionHistoryPageSchema =
|
|
1139
|
-
items:
|
|
1192
|
+
var promotionHistoryPageSchema = z11.object({
|
|
1193
|
+
items: z11.array(promotionRecordSchema),
|
|
1140
1194
|
nextCursor: pageCursorSchema.nullable()
|
|
1141
1195
|
});
|
|
1142
1196
|
|
|
1143
1197
|
// src/server/dashboards.ts
|
|
1144
|
-
import * as
|
|
1145
|
-
var dashboardListQuerySchema =
|
|
1146
|
-
includeArchived:
|
|
1198
|
+
import * as z12 from "zod";
|
|
1199
|
+
var dashboardListQuerySchema = z12.strictObject({
|
|
1200
|
+
includeArchived: z12.union([z12.boolean(), z12.enum(["true", "false"])]).transform((value) => value === true || value === "true").optional()
|
|
1147
1201
|
});
|
|
1148
1202
|
var summaryFields = {
|
|
1149
1203
|
key: identifier,
|
|
1150
|
-
title:
|
|
1151
|
-
description:
|
|
1204
|
+
title: z12.string(),
|
|
1205
|
+
description: z12.string().nullable(),
|
|
1152
1206
|
/** Lists order by it, dashboards without one last, then by title. */
|
|
1153
|
-
position:
|
|
1154
|
-
archivedAt:
|
|
1207
|
+
position: z12.number().int().nullable(),
|
|
1208
|
+
archivedAt: z12.number().int().nonnegative().nullable(),
|
|
1155
1209
|
/** When the current version was published. */
|
|
1156
|
-
updatedAt:
|
|
1210
|
+
updatedAt: z12.number().int().nonnegative()
|
|
1157
1211
|
};
|
|
1158
|
-
var dashboardSummarySchema =
|
|
1159
|
-
var dashboardListSchema =
|
|
1160
|
-
var dashboardLifecycleInputSchema =
|
|
1161
|
-
actionId:
|
|
1212
|
+
var dashboardSummarySchema = z12.object(summaryFields);
|
|
1213
|
+
var dashboardListSchema = z12.array(dashboardSummarySchema);
|
|
1214
|
+
var dashboardLifecycleInputSchema = z12.strictObject({
|
|
1215
|
+
actionId: z12.string().uuid(),
|
|
1162
1216
|
dashboard: identifier,
|
|
1163
|
-
archived:
|
|
1164
|
-
reason:
|
|
1165
|
-
expectedArchivedAt:
|
|
1217
|
+
archived: z12.boolean(),
|
|
1218
|
+
reason: z12.string().trim().min(1).max(500),
|
|
1219
|
+
expectedArchivedAt: z12.number().int().nonnegative().nullable().optional()
|
|
1166
1220
|
});
|
|
1167
|
-
var dashboardLifecycleResultSchema =
|
|
1221
|
+
var dashboardLifecycleResultSchema = z12.object({
|
|
1168
1222
|
dashboard: dashboardSummarySchema,
|
|
1169
|
-
changed:
|
|
1223
|
+
changed: z12.boolean()
|
|
1170
1224
|
});
|
|
1171
|
-
var dashboardReadQuerySchema =
|
|
1225
|
+
var dashboardReadQuerySchema = z12.strictObject({
|
|
1172
1226
|
key: identifier,
|
|
1173
|
-
range:
|
|
1227
|
+
range: z12.enum(analyticsRanges).optional()
|
|
1174
1228
|
});
|
|
1175
|
-
var dashboardReadSchema =
|
|
1229
|
+
var dashboardReadSchema = z12.object({
|
|
1176
1230
|
...summaryFields,
|
|
1177
1231
|
definition: dashboardDefinitionSchema,
|
|
1178
|
-
range:
|
|
1179
|
-
panels:
|
|
1180
|
-
|
|
1232
|
+
range: z12.enum(analyticsRanges),
|
|
1233
|
+
panels: z12.array(
|
|
1234
|
+
z12.object({
|
|
1181
1235
|
key: identifier,
|
|
1182
1236
|
result: analyticsMetricResultSchema.optional(),
|
|
1183
|
-
error:
|
|
1237
|
+
error: z12.object({ code: z12.string(), message: z12.string() }).optional()
|
|
1184
1238
|
})
|
|
1185
1239
|
)
|
|
1186
1240
|
});
|
|
1187
1241
|
|
|
1188
1242
|
// src/server/index.ts
|
|
1189
|
-
import * as
|
|
1243
|
+
import * as z19 from "zod";
|
|
1190
1244
|
|
|
1191
1245
|
// src/server/billing.ts
|
|
1192
|
-
import { z as
|
|
1246
|
+
import { z as z13 } from "zod";
|
|
1193
1247
|
var billingSubscriptionPlans = ["launch", "growth", "scale"];
|
|
1194
1248
|
var billingIntervals = ["month", "year"];
|
|
1195
|
-
var billingCheckoutInputSchema =
|
|
1196
|
-
plan:
|
|
1197
|
-
interval:
|
|
1249
|
+
var billingCheckoutInputSchema = z13.strictObject({
|
|
1250
|
+
plan: z13.enum(billingSubscriptionPlans),
|
|
1251
|
+
interval: z13.enum(billingIntervals)
|
|
1198
1252
|
});
|
|
1199
|
-
var billingPlanChangeInputSchema =
|
|
1200
|
-
plan:
|
|
1201
|
-
interval:
|
|
1253
|
+
var billingPlanChangeInputSchema = z13.strictObject({
|
|
1254
|
+
plan: z13.enum(billingSubscriptionPlans),
|
|
1255
|
+
interval: z13.enum(billingIntervals)
|
|
1202
1256
|
});
|
|
1203
|
-
var billingPlanChangeSchema =
|
|
1204
|
-
timing:
|
|
1205
|
-
invoiceUrl:
|
|
1257
|
+
var billingPlanChangeSchema = z13.object({
|
|
1258
|
+
timing: z13.enum(["now", "renewal", "none"]),
|
|
1259
|
+
invoiceUrl: z13.string().url().nullable()
|
|
1206
1260
|
});
|
|
1207
1261
|
var billingTopupMaxQuantity = 10;
|
|
1208
|
-
var billingTopupInputSchema =
|
|
1209
|
-
quantity:
|
|
1210
|
-
});
|
|
1211
|
-
var billingSessionSchema =
|
|
1212
|
-
var billingSubscriptionSchema =
|
|
1213
|
-
plan:
|
|
1214
|
-
interval:
|
|
1215
|
-
status:
|
|
1216
|
-
currentPeriodEnd:
|
|
1217
|
-
cancelAtPeriodEnd:
|
|
1218
|
-
lastInvoice:
|
|
1219
|
-
livemode:
|
|
1220
|
-
scheduledChange:
|
|
1221
|
-
plan:
|
|
1222
|
-
interval:
|
|
1223
|
-
at:
|
|
1262
|
+
var billingTopupInputSchema = z13.strictObject({
|
|
1263
|
+
quantity: z13.number().int().min(1).max(billingTopupMaxQuantity)
|
|
1264
|
+
});
|
|
1265
|
+
var billingSessionSchema = z13.object({ url: z13.string().url() });
|
|
1266
|
+
var billingSubscriptionSchema = z13.object({
|
|
1267
|
+
plan: z13.enum(billingSubscriptionPlans),
|
|
1268
|
+
interval: z13.enum(billingIntervals),
|
|
1269
|
+
status: z13.string(),
|
|
1270
|
+
currentPeriodEnd: z13.number().int().nullable(),
|
|
1271
|
+
cancelAtPeriodEnd: z13.boolean(),
|
|
1272
|
+
lastInvoice: z13.enum(["paid", "failed"]).nullable(),
|
|
1273
|
+
livemode: z13.boolean(),
|
|
1274
|
+
scheduledChange: z13.object({
|
|
1275
|
+
plan: z13.enum(billingSubscriptionPlans),
|
|
1276
|
+
interval: z13.enum(billingIntervals),
|
|
1277
|
+
at: z13.number().int()
|
|
1224
1278
|
}).nullable().default(null),
|
|
1225
|
-
endedFor:
|
|
1226
|
-
unpaid:
|
|
1227
|
-
since:
|
|
1228
|
-
promotionsRefusedAt:
|
|
1229
|
-
offlineAt:
|
|
1279
|
+
endedFor: z13.enum(["project-deleted", "project-transferred"]).nullable().default(null),
|
|
1280
|
+
unpaid: z13.object({
|
|
1281
|
+
since: z13.number().int(),
|
|
1282
|
+
promotionsRefusedAt: z13.number().int(),
|
|
1283
|
+
offlineAt: z13.number().int()
|
|
1230
1284
|
}).nullable().default(null)
|
|
1231
1285
|
});
|
|
1232
|
-
var projectBillingSchema =
|
|
1233
|
-
available:
|
|
1234
|
-
reason:
|
|
1286
|
+
var projectBillingSchema = z13.object({
|
|
1287
|
+
available: z13.boolean(),
|
|
1288
|
+
reason: z13.enum(["admin-required", "staff-only", "not-configured"]).nullable(),
|
|
1235
1289
|
subscription: billingSubscriptionSchema.nullable()
|
|
1236
1290
|
});
|
|
1291
|
+
var projectPlanSchema = z13.object({
|
|
1292
|
+
plan: z13.string(),
|
|
1293
|
+
source: z13.string().nullable(),
|
|
1294
|
+
live: z13.object({
|
|
1295
|
+
allowed: z13.boolean(),
|
|
1296
|
+
reason: z13.string(),
|
|
1297
|
+
until: z13.number().int().nullable()
|
|
1298
|
+
}),
|
|
1299
|
+
liveState: z13.object({
|
|
1300
|
+
state: z13.string(),
|
|
1301
|
+
reason: z13.string(),
|
|
1302
|
+
since: z13.number().int(),
|
|
1303
|
+
until: z13.number().int().nullable()
|
|
1304
|
+
}).nullable(),
|
|
1305
|
+
trial: z13.object({
|
|
1306
|
+
state: z13.string(),
|
|
1307
|
+
project: z13.string().nullable(),
|
|
1308
|
+
startedAt: z13.number().int().nullable(),
|
|
1309
|
+
endsAt: z13.number().int().nullable()
|
|
1310
|
+
}),
|
|
1311
|
+
customDomain: z13.boolean(),
|
|
1312
|
+
ai: z13.object({
|
|
1313
|
+
source: z13.string(),
|
|
1314
|
+
allowanceUsdPerMonth: z13.number().nullable(),
|
|
1315
|
+
pools: z13.array(
|
|
1316
|
+
z13.object({
|
|
1317
|
+
pool: z13.string(),
|
|
1318
|
+
capacity: z13.number(),
|
|
1319
|
+
used: z13.number(),
|
|
1320
|
+
remaining: z13.number()
|
|
1321
|
+
})
|
|
1322
|
+
),
|
|
1323
|
+
remaining: z13.number(),
|
|
1324
|
+
renewsAt: z13.number().int()
|
|
1325
|
+
}),
|
|
1326
|
+
subscription: billingSubscriptionSchema.nullable(),
|
|
1327
|
+
enforcement: z13.boolean()
|
|
1328
|
+
});
|
|
1329
|
+
var organizationBillingSchema = z13.object({
|
|
1330
|
+
billing: projectBillingSchema.pick({ available: true, reason: true }),
|
|
1331
|
+
freeProjects: z13.object({
|
|
1332
|
+
count: z13.number().int(),
|
|
1333
|
+
limit: z13.number().int()
|
|
1334
|
+
}),
|
|
1335
|
+
trial: projectPlanSchema.shape.trial,
|
|
1336
|
+
freeAi: z13.object({
|
|
1337
|
+
usdPerMonth: z13.number(),
|
|
1338
|
+
oneTimeUsd: z13.number(),
|
|
1339
|
+
pools: projectPlanSchema.shape.ai.shape.pools,
|
|
1340
|
+
remaining: z13.number(),
|
|
1341
|
+
renewsAt: z13.number().int()
|
|
1342
|
+
}),
|
|
1343
|
+
aiAllowanceUsdPerMonth: z13.number(),
|
|
1344
|
+
enforcement: z13.boolean(),
|
|
1345
|
+
projects: z13.array(
|
|
1346
|
+
z13.object({
|
|
1347
|
+
id: z13.string(),
|
|
1348
|
+
name: z13.string(),
|
|
1349
|
+
plan: projectPlanSchema.shape.plan,
|
|
1350
|
+
source: projectPlanSchema.shape.source,
|
|
1351
|
+
live: projectPlanSchema.shape.live,
|
|
1352
|
+
liveState: projectPlanSchema.shape.liveState,
|
|
1353
|
+
subscription: billingSubscriptionSchema.nullable()
|
|
1354
|
+
})
|
|
1355
|
+
)
|
|
1356
|
+
});
|
|
1237
1357
|
|
|
1238
1358
|
// src/server/hosting.ts
|
|
1239
|
-
import * as
|
|
1359
|
+
import * as z16 from "zod";
|
|
1240
1360
|
|
|
1241
1361
|
// src/server/schedules.ts
|
|
1242
|
-
import * as
|
|
1362
|
+
import * as z14 from "zod";
|
|
1243
1363
|
import { Cron } from "croner";
|
|
1244
1364
|
var APP_SCHEDULE_LIMIT = 10;
|
|
1245
1365
|
var APP_SCHEDULE_MIN_INTERVAL = 3e5;
|
|
1246
1366
|
var APP_SCHEDULE_TIMEOUT = 3e4;
|
|
1247
|
-
var appScheduleNameSchema =
|
|
1248
|
-
var appSchedulePathSchema =
|
|
1367
|
+
var appScheduleNameSchema = z14.string().regex(/^[a-z][a-z0-9-]{0,63}$/);
|
|
1368
|
+
var appSchedulePathSchema = z14.string().min(2).max(512).refine((path) => {
|
|
1249
1369
|
if (!/^\/[a-zA-Z0-9_/-]+$/.test(path) || path.startsWith("//")) {
|
|
1250
1370
|
return false;
|
|
1251
1371
|
}
|
|
@@ -1256,11 +1376,11 @@ function interval(value) {
|
|
|
1256
1376
|
const unit = value.slice(-1);
|
|
1257
1377
|
return amount * (unit === "m" ? 6e4 : unit === "h" ? 36e5 : 864e5);
|
|
1258
1378
|
}
|
|
1259
|
-
var everySchema =
|
|
1379
|
+
var everySchema = z14.string().regex(/^[1-9]\d{0,3}[mhd]$/).refine(
|
|
1260
1380
|
(value) => interval(value) >= APP_SCHEDULE_MIN_INTERVAL && interval(value) <= 365 * 864e5,
|
|
1261
1381
|
"Use an interval from 5 minutes to 365 days, such as 5m, 1h or 1d"
|
|
1262
1382
|
);
|
|
1263
|
-
var cronSchema =
|
|
1383
|
+
var cronSchema = z14.string().max(120).refine((value) => {
|
|
1264
1384
|
const fields = value.trim().split(/\s+/);
|
|
1265
1385
|
if (fields.length !== 5 || fields.some((field) => !/^[\d*,/-]+$/.test(field))) {
|
|
1266
1386
|
return false;
|
|
@@ -1285,15 +1405,15 @@ var cronSchema = z13.string().max(120).refine((value) => {
|
|
|
1285
1405
|
var declaration = {
|
|
1286
1406
|
name: appScheduleNameSchema,
|
|
1287
1407
|
path: appSchedulePathSchema,
|
|
1288
|
-
description:
|
|
1408
|
+
description: z14.string().min(1).max(500)
|
|
1289
1409
|
};
|
|
1290
|
-
var everySchedule =
|
|
1291
|
-
var cronSchedule =
|
|
1292
|
-
var appScheduleSchema =
|
|
1410
|
+
var everySchedule = z14.object({ ...declaration, every: everySchema });
|
|
1411
|
+
var cronSchedule = z14.object({ ...declaration, cron: cronSchema });
|
|
1412
|
+
var appScheduleSchema = z14.union([
|
|
1293
1413
|
everySchedule.strict(),
|
|
1294
1414
|
cronSchedule.strict()
|
|
1295
1415
|
]);
|
|
1296
|
-
var appSchedulesSchema =
|
|
1416
|
+
var appSchedulesSchema = z14.array(appScheduleSchema).max(APP_SCHEDULE_LIMIT).refine(
|
|
1297
1417
|
(items) => new Set(items.map((item) => item.name)).size === items.length,
|
|
1298
1418
|
"Schedule names must be unique"
|
|
1299
1419
|
);
|
|
@@ -1310,25 +1430,29 @@ function nextScheduleRun(schedule, after) {
|
|
|
1310
1430
|
}
|
|
1311
1431
|
return next.getTime();
|
|
1312
1432
|
}
|
|
1313
|
-
var appScheduleStateSchema =
|
|
1433
|
+
var appScheduleStateSchema = z14.enum(["active", "paused", "archived"]);
|
|
1434
|
+
var appScheduleStateInputSchema = z14.object({
|
|
1435
|
+
state: appScheduleStateSchema,
|
|
1436
|
+
reason: lifecycleReasonSchema.optional()
|
|
1437
|
+
}).strict();
|
|
1314
1438
|
var APP_SCHEDULE_RESULT_BYTES = 16384;
|
|
1315
|
-
var appScheduleDiagnosticSchema =
|
|
1316
|
-
level:
|
|
1317
|
-
message:
|
|
1439
|
+
var appScheduleDiagnosticSchema = z14.object({
|
|
1440
|
+
level: z14.enum(["error", "warning", "info"]),
|
|
1441
|
+
message: z14.string().min(1).max(500),
|
|
1318
1442
|
/** What the line is about, such as a member, record or tracker ID. */
|
|
1319
|
-
subject:
|
|
1443
|
+
subject: z14.string().min(1).max(200).optional(),
|
|
1320
1444
|
/** A stable code the app chooses, such as `ingest-timeout`. */
|
|
1321
|
-
code:
|
|
1445
|
+
code: z14.string().min(1).max(100).optional()
|
|
1322
1446
|
});
|
|
1323
|
-
var appScheduleResultSchema =
|
|
1324
|
-
outcome:
|
|
1325
|
-
summary:
|
|
1447
|
+
var appScheduleResultSchema = z14.object({
|
|
1448
|
+
outcome: z14.enum(["succeeded", "partial", "failed"]),
|
|
1449
|
+
summary: z14.string().min(1).max(500).optional(),
|
|
1326
1450
|
/** Counts and gauges, such as processed and failed members. */
|
|
1327
|
-
metrics:
|
|
1451
|
+
metrics: z14.record(z14.string().regex(/^[A-Za-z][\w.-]{0,63}$/), z14.number()).refine(
|
|
1328
1452
|
(metrics) => Object.keys(metrics).length <= 50,
|
|
1329
1453
|
"Report at most 50 metrics"
|
|
1330
1454
|
).optional(),
|
|
1331
|
-
diagnostics:
|
|
1455
|
+
diagnostics: z14.array(appScheduleDiagnosticSchema).max(50).optional()
|
|
1332
1456
|
});
|
|
1333
1457
|
function scheduleResult(result) {
|
|
1334
1458
|
const body = JSON.stringify(appScheduleResultSchema.parse(result));
|
|
@@ -1341,41 +1465,41 @@ function scheduleResult(result) {
|
|
|
1341
1465
|
headers: { "Content-Type": "application/json" }
|
|
1342
1466
|
});
|
|
1343
1467
|
}
|
|
1344
|
-
var appScheduleRunSchema =
|
|
1345
|
-
id:
|
|
1346
|
-
build:
|
|
1347
|
-
startedAt:
|
|
1348
|
-
scheduledAt:
|
|
1349
|
-
manual:
|
|
1350
|
-
status:
|
|
1351
|
-
duration:
|
|
1468
|
+
var appScheduleRunSchema = z14.object({
|
|
1469
|
+
id: z14.string().uuid(),
|
|
1470
|
+
build: z14.string().uuid(),
|
|
1471
|
+
startedAt: z14.number(),
|
|
1472
|
+
scheduledAt: z14.number(),
|
|
1473
|
+
manual: z14.boolean(),
|
|
1474
|
+
status: z14.enum(["queued", "running", "succeeded", "failed", "uncertain"]),
|
|
1475
|
+
duration: z14.number().nullable(),
|
|
1352
1476
|
/** Why the run failed or is uncertain, or why Relay ignored the app's result. */
|
|
1353
|
-
error:
|
|
1477
|
+
error: z14.string().nullable(),
|
|
1354
1478
|
/** The app's JSON answer when it sent a valid result. Absent on runs from before results. */
|
|
1355
1479
|
result: appScheduleResultSchema.nullable().optional()
|
|
1356
1480
|
});
|
|
1357
|
-
var appScheduleRunsSchema =
|
|
1481
|
+
var appScheduleRunsSchema = z14.object({
|
|
1358
1482
|
/** Newest first: the latest twenty runs of one schedule, including a queued or running one. */
|
|
1359
|
-
runs:
|
|
1483
|
+
runs: z14.array(appScheduleRunSchema)
|
|
1360
1484
|
});
|
|
1361
|
-
var appScheduleListSchema =
|
|
1485
|
+
var appScheduleListSchema = z14.object({
|
|
1362
1486
|
state: appScheduleStateSchema,
|
|
1363
|
-
schedules:
|
|
1364
|
-
|
|
1365
|
-
declaration:
|
|
1366
|
-
nextRun:
|
|
1367
|
-
blocked:
|
|
1487
|
+
schedules: z14.array(
|
|
1488
|
+
z14.object({
|
|
1489
|
+
declaration: z14.union([everySchedule, cronSchedule]),
|
|
1490
|
+
nextRun: z14.number().nullable(),
|
|
1491
|
+
blocked: z14.boolean(),
|
|
1368
1492
|
lastRun: appScheduleRunSchema.nullable()
|
|
1369
1493
|
})
|
|
1370
1494
|
)
|
|
1371
1495
|
});
|
|
1372
|
-
var scheduledInvocationSchema =
|
|
1373
|
-
id:
|
|
1374
|
-
build:
|
|
1496
|
+
var scheduledInvocationSchema = z14.object({
|
|
1497
|
+
id: z14.string().uuid(),
|
|
1498
|
+
build: z14.string().uuid(),
|
|
1375
1499
|
name: appScheduleNameSchema,
|
|
1376
|
-
scheduledAt:
|
|
1377
|
-
startedAt:
|
|
1378
|
-
manual:
|
|
1500
|
+
scheduledAt: z14.number().int(),
|
|
1501
|
+
startedAt: z14.number().int(),
|
|
1502
|
+
manual: z14.boolean()
|
|
1379
1503
|
}).strict();
|
|
1380
1504
|
async function verifyScheduledRequest(request, key) {
|
|
1381
1505
|
const signature = request.headers.get("X-Domino-Schedule-Signature");
|
|
@@ -1440,7 +1564,47 @@ ${body}`)
|
|
|
1440
1564
|
}
|
|
1441
1565
|
|
|
1442
1566
|
// src/server/starters.ts
|
|
1443
|
-
import * as
|
|
1567
|
+
import * as z15 from "zod";
|
|
1568
|
+
var starters = [
|
|
1569
|
+
{
|
|
1570
|
+
id: "campaign",
|
|
1571
|
+
title: "Campaign tour",
|
|
1572
|
+
summary: "A neutral quest app with a guided tour of every quest kind. The blank canvas for anything."
|
|
1573
|
+
},
|
|
1574
|
+
{
|
|
1575
|
+
id: "classic",
|
|
1576
|
+
title: "Classic questboard",
|
|
1577
|
+
summary: "The familiar Domino portal: quests in a grid grouped by section, a claim page, points, and a leaderboard."
|
|
1578
|
+
},
|
|
1579
|
+
{
|
|
1580
|
+
id: "waitlist",
|
|
1581
|
+
title: "Waitlist",
|
|
1582
|
+
summary: "Collect sign-ups before launch. People move up the line by inviting friends."
|
|
1583
|
+
},
|
|
1584
|
+
{
|
|
1585
|
+
id: "referral",
|
|
1586
|
+
title: "Referral program",
|
|
1587
|
+
summary: "Give every member an invite link and reward them when friends join and qualify."
|
|
1588
|
+
},
|
|
1589
|
+
{
|
|
1590
|
+
id: "discord",
|
|
1591
|
+
title: "Discord activation",
|
|
1592
|
+
summary: "Turn new Discord members into regulars with quests for joining, introducing themselves, and taking part, rewarded with roles."
|
|
1593
|
+
},
|
|
1594
|
+
{
|
|
1595
|
+
id: "loyalty",
|
|
1596
|
+
title: "Loyalty program",
|
|
1597
|
+
summary: "Members earn points in a campaign, qualify into a members' group, and spend points on offers, some for members only."
|
|
1598
|
+
},
|
|
1599
|
+
{
|
|
1600
|
+
id: "api",
|
|
1601
|
+
title: "API",
|
|
1602
|
+
summary: "A headless Worker with typed routes and interactive API docs, for plugging Domino into your own product."
|
|
1603
|
+
}
|
|
1604
|
+
];
|
|
1605
|
+
var offeredStarterSchema = z15.string().refine((id) => starters.some((starter) => starter.id === id), {
|
|
1606
|
+
error: `Unknown starter. Choose one of: ${starters.map((starter) => starter.id).join(", ")}.`
|
|
1607
|
+
});
|
|
1444
1608
|
var starterTemplates = [
|
|
1445
1609
|
{
|
|
1446
1610
|
id: "campaign",
|
|
@@ -1473,63 +1637,63 @@ var starterTemplates = [
|
|
|
1473
1637
|
summary: "A headless Worker with typed routes and interactive API docs, for plugging Domino into your own product."
|
|
1474
1638
|
}
|
|
1475
1639
|
];
|
|
1476
|
-
var starterIdSchema =
|
|
1640
|
+
var starterIdSchema = z15.enum(
|
|
1477
1641
|
starterTemplates.map((template) => template.id)
|
|
1478
1642
|
);
|
|
1479
1643
|
|
|
1480
1644
|
// src/server/hosting.ts
|
|
1481
|
-
var outputPathSchema =
|
|
1645
|
+
var outputPathSchema = z16.string().min(1).max(512).refine(
|
|
1482
1646
|
(path) => path.split("/").every(
|
|
1483
1647
|
(part) => /^[\w-][\w.-]*$/.test(part) && part !== "node_modules"
|
|
1484
1648
|
),
|
|
1485
1649
|
"Expected a relative build output path without hidden segments"
|
|
1486
1650
|
);
|
|
1487
|
-
var appRoutingSchema =
|
|
1651
|
+
var appRoutingSchema = z16.enum(["legacy", "transparent"]).default("legacy");
|
|
1488
1652
|
var APP_SECRET_LIMIT = 50;
|
|
1489
1653
|
var APP_KV_LIMIT = 5;
|
|
1490
1654
|
var APP_SQL_LIMIT = 5;
|
|
1491
1655
|
var APP_MIGRATION_LIMIT = 100;
|
|
1492
1656
|
var APP_MIGRATION_FILE_BYTES = 9e4;
|
|
1493
1657
|
var APP_MIGRATION_TOTAL_BYTES = 1e6;
|
|
1494
|
-
var appSecretNameSchema =
|
|
1658
|
+
var appSecretNameSchema = z16.string().regex(
|
|
1495
1659
|
/^[A-Z_][A-Z0-9_]{0,63}$/,
|
|
1496
1660
|
"Use 1-64 uppercase letters, digits, and underscores, not starting with a digit"
|
|
1497
1661
|
).refine(
|
|
1498
1662
|
(name) => !name.startsWith("DOMINO_") && name !== "ASSETS",
|
|
1499
1663
|
"DOMINO_ names and ASSETS are reserved for Domino's own bindings"
|
|
1500
1664
|
);
|
|
1501
|
-
var appSecretValueSchema =
|
|
1665
|
+
var appSecretValueSchema = z16.string().min(1).refine(
|
|
1502
1666
|
(value) => new TextEncoder().encode(value).length <= 5120,
|
|
1503
1667
|
"Secret values can be at most 5 KiB"
|
|
1504
1668
|
);
|
|
1505
|
-
var appSecretInputSchema =
|
|
1506
|
-
var appSecretSchema =
|
|
1669
|
+
var appSecretInputSchema = z16.object({ value: appSecretValueSchema }).strict();
|
|
1670
|
+
var appSecretSchema = z16.object({
|
|
1507
1671
|
name: appSecretNameSchema,
|
|
1508
|
-
updatedAt:
|
|
1509
|
-
updatedBy:
|
|
1672
|
+
updatedAt: z16.number(),
|
|
1673
|
+
updatedBy: z16.string()
|
|
1510
1674
|
});
|
|
1511
|
-
var appSecretDeclarationSchema =
|
|
1512
|
-
description:
|
|
1513
|
-
required:
|
|
1675
|
+
var appSecretDeclarationSchema = z16.object({
|
|
1676
|
+
description: z16.string().trim().min(1).max(500),
|
|
1677
|
+
required: z16.boolean().default(true)
|
|
1514
1678
|
}).strict();
|
|
1515
|
-
var appSecretDeclarationsSchema =
|
|
1679
|
+
var appSecretDeclarationsSchema = z16.record(appSecretNameSchema, appSecretDeclarationSchema).refine(
|
|
1516
1680
|
(secrets) => Object.keys(secrets).length <= APP_SECRET_LIMIT,
|
|
1517
1681
|
`Declare at most ${APP_SECRET_LIMIT} app secrets`
|
|
1518
1682
|
);
|
|
1519
|
-
var appSecretListSchema =
|
|
1520
|
-
secrets:
|
|
1521
|
-
declared:
|
|
1683
|
+
var appSecretListSchema = z16.object({
|
|
1684
|
+
secrets: z16.array(appSecretSchema),
|
|
1685
|
+
declared: z16.array(appSecretDeclarationSchema.extend({ name: appSecretNameSchema })).default([])
|
|
1522
1686
|
});
|
|
1523
|
-
var hostedAppSecretsSchema =
|
|
1524
|
-
var storageDescription =
|
|
1525
|
-
description:
|
|
1687
|
+
var hostedAppSecretsSchema = z16.object({ secrets: z16.record(appSecretNameSchema, appSecretValueSchema) }).strict();
|
|
1688
|
+
var storageDescription = z16.object({
|
|
1689
|
+
description: z16.string().trim().min(1).max(500)
|
|
1526
1690
|
}).strict();
|
|
1527
|
-
var appStorageSchema =
|
|
1528
|
-
kv:
|
|
1691
|
+
var appStorageSchema = z16.object({
|
|
1692
|
+
kv: z16.record(appSecretNameSchema, storageDescription).refine(
|
|
1529
1693
|
(stores) => Object.keys(stores).length <= APP_KV_LIMIT,
|
|
1530
1694
|
`Declare at most ${APP_KV_LIMIT} KV stores`
|
|
1531
1695
|
).default({}),
|
|
1532
|
-
sql:
|
|
1696
|
+
sql: z16.record(
|
|
1533
1697
|
appSecretNameSchema,
|
|
1534
1698
|
storageDescription.extend({
|
|
1535
1699
|
migrations: outputPathSchema.optional()
|
|
@@ -1539,77 +1703,77 @@ var appStorageSchema = z15.object({
|
|
|
1539
1703
|
`Declare at most ${APP_SQL_LIMIT} SQL stores`
|
|
1540
1704
|
).default({})
|
|
1541
1705
|
}).strict();
|
|
1542
|
-
var appStorageKindSchema =
|
|
1543
|
-
var appStorageListSchema =
|
|
1544
|
-
stores:
|
|
1545
|
-
|
|
1546
|
-
kind:
|
|
1706
|
+
var appStorageKindSchema = z16.enum(["kv", "sql"]);
|
|
1707
|
+
var appStorageListSchema = z16.object({
|
|
1708
|
+
stores: z16.array(
|
|
1709
|
+
z16.object({
|
|
1710
|
+
kind: z16.string(),
|
|
1547
1711
|
name: appSecretNameSchema,
|
|
1548
|
-
createdAt:
|
|
1549
|
-
declared:
|
|
1550
|
-
description:
|
|
1712
|
+
createdAt: z16.number().nullable(),
|
|
1713
|
+
declared: z16.boolean(),
|
|
1714
|
+
description: z16.string().optional()
|
|
1551
1715
|
})
|
|
1552
1716
|
)
|
|
1553
1717
|
});
|
|
1554
1718
|
var APP_STORAGE_ROW_LIMIT = 50;
|
|
1555
1719
|
var APP_STORAGE_PREVIEW_CHARACTERS = 2e3;
|
|
1556
|
-
var appStorageCellSchema =
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1720
|
+
var appStorageCellSchema = z16.union([
|
|
1721
|
+
z16.string(),
|
|
1722
|
+
z16.number(),
|
|
1723
|
+
z16.null(),
|
|
1724
|
+
z16.object({ text: z16.string(), truncated: z16.literal(true) }),
|
|
1725
|
+
z16.object({ blob: z16.number().int().min(0) })
|
|
1562
1726
|
]);
|
|
1563
|
-
var appStorageTablesSchema =
|
|
1564
|
-
tables:
|
|
1727
|
+
var appStorageTablesSchema = z16.object({
|
|
1728
|
+
tables: z16.array(
|
|
1565
1729
|
/** `kind` is SQLite's: `table` or `view`. */
|
|
1566
|
-
|
|
1730
|
+
z16.object({ name: z16.string(), kind: z16.string() })
|
|
1567
1731
|
)
|
|
1568
1732
|
});
|
|
1569
|
-
var appStorageRowsSchema =
|
|
1570
|
-
table:
|
|
1571
|
-
columns:
|
|
1572
|
-
rows:
|
|
1733
|
+
var appStorageRowsSchema = z16.object({
|
|
1734
|
+
table: z16.string(),
|
|
1735
|
+
columns: z16.array(z16.string()),
|
|
1736
|
+
rows: z16.array(z16.array(appStorageCellSchema)),
|
|
1573
1737
|
/** How many rows come before this page in storage order. */
|
|
1574
|
-
offset:
|
|
1575
|
-
total:
|
|
1738
|
+
offset: z16.number().int().min(0),
|
|
1739
|
+
total: z16.number().int().min(0),
|
|
1576
1740
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
1577
1741
|
nextCursor: pageCursorSchema.nullable().default(null)
|
|
1578
1742
|
});
|
|
1579
|
-
var appStorageKeysSchema =
|
|
1580
|
-
keys:
|
|
1581
|
-
|
|
1743
|
+
var appStorageKeysSchema = z16.object({
|
|
1744
|
+
keys: z16.array(
|
|
1745
|
+
z16.object({ name: z16.string(), expiration: z16.number().nullable() })
|
|
1582
1746
|
),
|
|
1583
1747
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
1584
1748
|
nextCursor: pageCursorSchema.nullable().default(null),
|
|
1585
1749
|
/** @deprecated Use `nextCursor`. Removed in 2.0.0. */
|
|
1586
|
-
cursor:
|
|
1750
|
+
cursor: z16.string().nullable()
|
|
1587
1751
|
});
|
|
1588
|
-
var appStorageValueSchema =
|
|
1589
|
-
key:
|
|
1590
|
-
size:
|
|
1752
|
+
var appStorageValueSchema = z16.object({
|
|
1753
|
+
key: z16.string(),
|
|
1754
|
+
size: z16.number().int().min(0),
|
|
1591
1755
|
/** Null when the value is not UTF-8 text. */
|
|
1592
|
-
text:
|
|
1593
|
-
truncated:
|
|
1756
|
+
text: z16.string().nullable(),
|
|
1757
|
+
truncated: z16.boolean()
|
|
1594
1758
|
});
|
|
1595
1759
|
var APP_STORAGE_CELL_CHARACTERS = 1e5;
|
|
1596
|
-
var appStorageCellPageSchema =
|
|
1597
|
-
table:
|
|
1598
|
-
column:
|
|
1760
|
+
var appStorageCellPageSchema = z16.object({
|
|
1761
|
+
table: z16.string(),
|
|
1762
|
+
column: z16.string(),
|
|
1599
1763
|
/** The row's position in storage order: a rows page's `offset` plus its index on that page. */
|
|
1600
|
-
row:
|
|
1764
|
+
row: z16.number().int().min(0),
|
|
1601
1765
|
/** SQLite's storage class. */
|
|
1602
|
-
type:
|
|
1766
|
+
type: z16.enum(["text", "integer", "real", "blob", "null"]),
|
|
1603
1767
|
/** Characters of text, or of a number's text form; bytes of a BLOB; null for NULL. */
|
|
1604
|
-
length:
|
|
1768
|
+
length: z16.number().int().min(0).nullable(),
|
|
1605
1769
|
/** How many characters come before this page. */
|
|
1606
|
-
offset:
|
|
1770
|
+
offset: z16.number().int().min(0),
|
|
1607
1771
|
/** Up to 100,000 characters from `offset`. Null for a BLOB, whose bytes are never read, and NULL. */
|
|
1608
|
-
text:
|
|
1772
|
+
text: z16.string().nullable(),
|
|
1609
1773
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
1610
1774
|
nextCursor: pageCursorSchema.nullable().default(null)
|
|
1611
1775
|
});
|
|
1612
|
-
var appMigrationNameSchema =
|
|
1776
|
+
var appMigrationNameSchema = z16.string().max(255).regex(/^[\w-][\w.-]*\.sql$/);
|
|
1613
1777
|
function compareAppMigrations(a, b) {
|
|
1614
1778
|
const left = Number.parseInt(a.split("_")[0], 10);
|
|
1615
1779
|
const right = Number.parseInt(b.split("_")[0], 10);
|
|
@@ -1626,12 +1790,12 @@ function compareAppMigrations(a, b) {
|
|
|
1626
1790
|
}
|
|
1627
1791
|
return a < b ? -1 : a > b ? 1 : 0;
|
|
1628
1792
|
}
|
|
1629
|
-
var appMigrationsSchema =
|
|
1793
|
+
var appMigrationsSchema = z16.record(
|
|
1630
1794
|
appSecretNameSchema,
|
|
1631
|
-
|
|
1632
|
-
|
|
1795
|
+
z16.array(
|
|
1796
|
+
z16.object({
|
|
1633
1797
|
name: appMigrationNameSchema,
|
|
1634
|
-
sql:
|
|
1798
|
+
sql: z16.string().min(1).refine(
|
|
1635
1799
|
(sql) => new TextEncoder().encode(sql).length <= APP_MIGRATION_FILE_BYTES,
|
|
1636
1800
|
`A migration file must not exceed ${APP_MIGRATION_FILE_BYTES} bytes`
|
|
1637
1801
|
)
|
|
@@ -1649,21 +1813,21 @@ var appMigrationsSchema = z15.record(
|
|
|
1649
1813
|
);
|
|
1650
1814
|
var appScripts = {
|
|
1651
1815
|
routing: appRoutingSchema,
|
|
1652
|
-
devScript:
|
|
1653
|
-
checkScript:
|
|
1654
|
-
buildScript:
|
|
1816
|
+
devScript: z16.string().regex(/^[\w:-]+$/),
|
|
1817
|
+
checkScript: z16.string().regex(/^[\w:-]+$/),
|
|
1818
|
+
buildScript: z16.string().regex(/^[\w:-]+$/)
|
|
1655
1819
|
};
|
|
1656
1820
|
var workerSettings = {
|
|
1657
|
-
runWorkerFirst:
|
|
1821
|
+
runWorkerFirst: z16.boolean().default(false),
|
|
1658
1822
|
main: outputPathSchema.refine(
|
|
1659
1823
|
(path) => /\.m?js$/.test(path),
|
|
1660
1824
|
"Expected a compiled JavaScript entry"
|
|
1661
1825
|
),
|
|
1662
|
-
compatibilityDate:
|
|
1663
|
-
compatibilityFlags:
|
|
1664
|
-
vars:
|
|
1665
|
-
|
|
1666
|
-
|
|
1826
|
+
compatibilityDate: z16.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
1827
|
+
compatibilityFlags: z16.array(z16.string().min(1)).max(50).default([]),
|
|
1828
|
+
vars: z16.record(
|
|
1829
|
+
z16.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).refine((name) => name !== "ASSETS"),
|
|
1830
|
+
z16.string()
|
|
1667
1831
|
).default({}),
|
|
1668
1832
|
secrets: appSecretDeclarationsSchema.default({}),
|
|
1669
1833
|
storage: appStorageSchema.optional(),
|
|
@@ -1692,62 +1856,66 @@ var distinctBindings = (worker, ctx) => {
|
|
|
1692
1856
|
}
|
|
1693
1857
|
}
|
|
1694
1858
|
};
|
|
1695
|
-
var hostedAppSchema =
|
|
1696
|
-
|
|
1697
|
-
kind:
|
|
1859
|
+
var hostedAppSchema = z16.discriminatedUnion("kind", [
|
|
1860
|
+
z16.object({
|
|
1861
|
+
kind: z16.literal("static"),
|
|
1698
1862
|
directory: outputPathSchema,
|
|
1699
1863
|
...appScripts
|
|
1700
1864
|
}).strict(),
|
|
1701
|
-
|
|
1702
|
-
kind:
|
|
1865
|
+
z16.object({
|
|
1866
|
+
kind: z16.literal("worker"),
|
|
1703
1867
|
directory: outputPathSchema,
|
|
1704
1868
|
assetsDirectory: outputPathSchema.optional(),
|
|
1705
1869
|
...appScripts,
|
|
1706
1870
|
...workerSettings
|
|
1707
1871
|
}).strict().superRefine(distinctBindings)
|
|
1708
1872
|
]);
|
|
1709
|
-
var repositorySchema =
|
|
1710
|
-
id:
|
|
1873
|
+
var repositorySchema = z16.object({
|
|
1874
|
+
id: z16.string().uuid(),
|
|
1711
1875
|
organization: identifier,
|
|
1712
1876
|
project: identifier,
|
|
1713
|
-
remote:
|
|
1714
|
-
defaultBranch:
|
|
1715
|
-
status:
|
|
1877
|
+
remote: z16.string().url(),
|
|
1878
|
+
defaultBranch: z16.string(),
|
|
1879
|
+
status: z16.enum(["provisioning", "ready"])
|
|
1716
1880
|
});
|
|
1717
|
-
var
|
|
1881
|
+
var repositoryCreateSchema = z16.object({
|
|
1882
|
+
/** Omitted: the starter chosen at project setup, else `campaign`. */
|
|
1883
|
+
starter: offeredStarterSchema.optional()
|
|
1884
|
+
}).strict();
|
|
1885
|
+
var createRepositorySchema = z16.object({
|
|
1718
1886
|
/** Omitted: the starter chosen at project setup, else `campaign`. */
|
|
1719
1887
|
starter: starterIdSchema.optional()
|
|
1720
1888
|
}).strict();
|
|
1721
|
-
var deviceStartSchema =
|
|
1722
|
-
challenge:
|
|
1889
|
+
var deviceStartSchema = z16.object({
|
|
1890
|
+
challenge: z16.string().regex(/^[a-f0-9]{64}$/)
|
|
1723
1891
|
}).strict();
|
|
1724
|
-
var deviceRedeemSchema =
|
|
1725
|
-
id:
|
|
1726
|
-
verifier:
|
|
1892
|
+
var deviceRedeemSchema = z16.object({
|
|
1893
|
+
id: z16.string().uuid(),
|
|
1894
|
+
verifier: z16.string().min(43).max(128)
|
|
1727
1895
|
}).strict();
|
|
1728
|
-
var deviceApproveSchema =
|
|
1729
|
-
id:
|
|
1730
|
-
code:
|
|
1896
|
+
var deviceApproveSchema = z16.object({
|
|
1897
|
+
id: z16.string().uuid(),
|
|
1898
|
+
code: z16.string().regex(/^[A-F0-9]{4}-[A-F0-9]{4}$/)
|
|
1731
1899
|
}).strict();
|
|
1732
|
-
var commitSchema =
|
|
1733
|
-
var stageRequestSchema =
|
|
1900
|
+
var commitSchema = z16.string().regex(/^[a-f0-9]{40}$/);
|
|
1901
|
+
var stageRequestSchema = z16.object({
|
|
1734
1902
|
commit: commitSchema,
|
|
1735
|
-
requestId:
|
|
1903
|
+
requestId: z16.string().uuid()
|
|
1736
1904
|
}).strict();
|
|
1737
|
-
var buildIdentitySchema =
|
|
1905
|
+
var buildIdentitySchema = z16.object({
|
|
1738
1906
|
routing: appRoutingSchema,
|
|
1739
|
-
slug:
|
|
1740
|
-
runtime:
|
|
1741
|
-
id:
|
|
1742
|
-
repository:
|
|
1907
|
+
slug: z16.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional(),
|
|
1908
|
+
runtime: z16.enum(["simulation", "hosted-test"]).default("simulation"),
|
|
1909
|
+
id: z16.string().uuid(),
|
|
1910
|
+
repository: z16.string().uuid(),
|
|
1743
1911
|
organization: identifier,
|
|
1744
1912
|
project: identifier,
|
|
1745
1913
|
commit: commitSchema,
|
|
1746
|
-
createdAt:
|
|
1747
|
-
actor:
|
|
1748
|
-
commitMessage:
|
|
1914
|
+
createdAt: z16.number(),
|
|
1915
|
+
actor: z16.string(),
|
|
1916
|
+
commitMessage: z16.string().max(500).optional()
|
|
1749
1917
|
});
|
|
1750
|
-
var buildPhaseSchema =
|
|
1918
|
+
var buildPhaseSchema = z16.enum([
|
|
1751
1919
|
"queued",
|
|
1752
1920
|
"source",
|
|
1753
1921
|
"install",
|
|
@@ -1757,120 +1925,128 @@ var buildPhaseSchema = z15.enum([
|
|
|
1757
1925
|
"ready",
|
|
1758
1926
|
"failed"
|
|
1759
1927
|
]);
|
|
1760
|
-
var buildStatusSchema =
|
|
1928
|
+
var buildStatusSchema = z16.object({
|
|
1761
1929
|
phase: buildPhaseSchema,
|
|
1762
1930
|
failedPhase: buildPhaseSchema.optional(),
|
|
1763
|
-
updatedAt:
|
|
1764
|
-
message:
|
|
1931
|
+
updatedAt: z16.number(),
|
|
1932
|
+
message: z16.string()
|
|
1765
1933
|
});
|
|
1766
1934
|
var hostedBuildSchema = buildIdentitySchema.extend({
|
|
1767
1935
|
...buildStatusSchema.shape,
|
|
1768
|
-
finished:
|
|
1769
|
-
current:
|
|
1770
|
-
stagingUrl:
|
|
1936
|
+
finished: z16.boolean(),
|
|
1937
|
+
current: z16.boolean(),
|
|
1938
|
+
stagingUrl: z16.string().url()
|
|
1771
1939
|
});
|
|
1772
|
-
var liveAppSchema =
|
|
1773
|
-
url:
|
|
1774
|
-
state:
|
|
1940
|
+
var liveAppSchema = z16.object({
|
|
1941
|
+
url: z16.string().url().nullable(),
|
|
1942
|
+
state: z16.enum(["none", "deploying", "live", "failed"]),
|
|
1775
1943
|
/** The build the address serves, or null before the first one goes live. */
|
|
1776
|
-
build:
|
|
1944
|
+
build: z16.string().uuid().nullable(),
|
|
1777
1945
|
/** The build the last approved promotion asked for, while it differs from `build`. */
|
|
1778
|
-
requested:
|
|
1779
|
-
failure:
|
|
1946
|
+
requested: z16.string().uuid().nullable(),
|
|
1947
|
+
failure: z16.string().nullable()
|
|
1780
1948
|
});
|
|
1781
|
-
var customDomainStateSchema =
|
|
1949
|
+
var customDomainStateSchema = z16.enum([
|
|
1782
1950
|
"awaiting-dns",
|
|
1783
1951
|
"provisioning",
|
|
1784
1952
|
"active",
|
|
1785
1953
|
"attention",
|
|
1786
1954
|
"suspended"
|
|
1787
1955
|
]);
|
|
1788
|
-
var customDomainRecordSchema =
|
|
1789
|
-
type:
|
|
1790
|
-
name:
|
|
1791
|
-
value:
|
|
1956
|
+
var customDomainRecordSchema = z16.object({
|
|
1957
|
+
type: z16.enum(["CNAME", "TXT"]),
|
|
1958
|
+
name: z16.string(),
|
|
1959
|
+
value: z16.string(),
|
|
1792
1960
|
/** The values public DNS returned: empty when it had none, null before Domino looked. */
|
|
1793
|
-
found:
|
|
1794
|
-
matches:
|
|
1961
|
+
found: z16.array(z16.string()).nullable(),
|
|
1962
|
+
matches: z16.boolean()
|
|
1795
1963
|
});
|
|
1796
|
-
var customDomainSchema =
|
|
1797
|
-
id:
|
|
1798
|
-
hostname:
|
|
1799
|
-
url:
|
|
1964
|
+
var customDomainSchema = z16.object({
|
|
1965
|
+
id: z16.string().uuid(),
|
|
1966
|
+
hostname: z16.string(),
|
|
1967
|
+
url: z16.string().url(),
|
|
1800
1968
|
state: customDomainStateSchema,
|
|
1801
1969
|
/** What to fix, in plain words, while the domain needs attention or is suspended. */
|
|
1802
|
-
issue:
|
|
1803
|
-
records:
|
|
1970
|
+
issue: z16.object({ code: z16.string(), message: z16.string() }).nullable(),
|
|
1971
|
+
records: z16.array(customDomainRecordSchema),
|
|
1804
1972
|
/** Cloudflare's statuses and errors in its own words, once the domain is proven. */
|
|
1805
|
-
cloudflare:
|
|
1806
|
-
hostnameStatus:
|
|
1807
|
-
certificateStatus:
|
|
1808
|
-
validationErrors:
|
|
1809
|
-
verificationErrors:
|
|
1810
|
-
certificateExpiresAt:
|
|
1973
|
+
cloudflare: z16.object({
|
|
1974
|
+
hostnameStatus: z16.string(),
|
|
1975
|
+
certificateStatus: z16.string().nullable(),
|
|
1976
|
+
validationErrors: z16.array(z16.string()),
|
|
1977
|
+
verificationErrors: z16.array(z16.string()),
|
|
1978
|
+
certificateExpiresAt: z16.string().nullable()
|
|
1811
1979
|
}).nullable(),
|
|
1812
|
-
checkedAt:
|
|
1813
|
-
nextCheckAt:
|
|
1814
|
-
createdAt:
|
|
1815
|
-
});
|
|
1816
|
-
var customDomainListSchema =
|
|
1817
|
-
domains:
|
|
1818
|
-
});
|
|
1819
|
-
var customDomainInputSchema =
|
|
1820
|
-
var stagingAccessModeSchema =
|
|
1821
|
-
var stagingAccessSchema =
|
|
1822
|
-
var stagingAccessInputSchema =
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
mode:
|
|
1826
|
-
password:
|
|
1980
|
+
checkedAt: z16.string().nullable(),
|
|
1981
|
+
nextCheckAt: z16.string().nullable(),
|
|
1982
|
+
createdAt: z16.string()
|
|
1983
|
+
});
|
|
1984
|
+
var customDomainListSchema = z16.object({
|
|
1985
|
+
domains: z16.array(customDomainSchema)
|
|
1986
|
+
});
|
|
1987
|
+
var customDomainInputSchema = z16.object({ hostname: z16.string().min(1).max(300) }).strict();
|
|
1988
|
+
var stagingAccessModeSchema = z16.enum(["console", "password"]);
|
|
1989
|
+
var stagingAccessSchema = z16.object({ mode: stagingAccessModeSchema });
|
|
1990
|
+
var stagingAccessInputSchema = z16.discriminatedUnion("mode", [
|
|
1991
|
+
z16.object({ mode: z16.literal("console") }).strict(),
|
|
1992
|
+
z16.object({
|
|
1993
|
+
mode: z16.literal("password"),
|
|
1994
|
+
password: z16.string().min(8).max(128)
|
|
1827
1995
|
}).strict()
|
|
1828
1996
|
]);
|
|
1829
|
-
var
|
|
1830
|
-
|
|
1831
|
-
"
|
|
1832
|
-
)
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1997
|
+
var stagingOrigin = "https://staging.invalid";
|
|
1998
|
+
var stagingPathSchema = z16.string().max(2048).refine((path) => {
|
|
1999
|
+
if (!path.startsWith("/") || path.startsWith("//") || path.includes("\\") || // oxlint-disable-next-line no-control-regex
|
|
2000
|
+
/[\u0000-\u001f\u007f]/.test(path)) {
|
|
2001
|
+
return false;
|
|
2002
|
+
}
|
|
2003
|
+
try {
|
|
2004
|
+
return new URL(path, stagingOrigin).origin === stagingOrigin;
|
|
2005
|
+
} catch {
|
|
2006
|
+
return false;
|
|
2007
|
+
}
|
|
2008
|
+
}, "Expected a path on the staging host");
|
|
2009
|
+
var stagingLinkSchema = z16.object({
|
|
2010
|
+
url: z16.string().url(),
|
|
2011
|
+
expiresAt: z16.number()
|
|
1836
2012
|
});
|
|
1837
|
-
var buildSnapshotSchema =
|
|
1838
|
-
builds:
|
|
2013
|
+
var buildSnapshotSchema = z16.object({
|
|
2014
|
+
builds: z16.array(hostedBuildSchema),
|
|
1839
2015
|
current: hostedBuildSchema.nullable(),
|
|
1840
2016
|
selected: hostedBuildSchema.nullable(),
|
|
1841
|
-
logs:
|
|
2017
|
+
logs: z16.string()
|
|
1842
2018
|
});
|
|
1843
|
-
var assetPathSchema =
|
|
2019
|
+
var assetPathSchema = z16.string().max(512).refine(
|
|
1844
2020
|
(path) => path.startsWith("/") && // oxlint-disable-next-line no-control-regex -- Asset paths must reject control characters.
|
|
1845
2021
|
!/[\\\u0000-\u001f?#%]/.test(path) && path.slice(1).split("/").every((part) => part.length > 0 && !part.startsWith(".")),
|
|
1846
2022
|
"Expected a public asset path without hidden segments"
|
|
1847
2023
|
);
|
|
1848
|
-
var base64Schema =
|
|
2024
|
+
var base64Schema = z16.string().regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
|
|
1849
2025
|
var stagedDeploymentLimits = {
|
|
1850
2026
|
/** Bytes of JSON, uncompressed. */
|
|
1851
2027
|
size: 64e6,
|
|
1852
2028
|
/** Bytes of the Brotli-compressed object. */
|
|
1853
2029
|
compressedSize: 1e7
|
|
1854
2030
|
};
|
|
1855
|
-
var stagedDeploymentSchema =
|
|
1856
|
-
encoding:
|
|
1857
|
-
sha256:
|
|
1858
|
-
compressedSize:
|
|
1859
|
-
size:
|
|
2031
|
+
var stagedDeploymentSchema = z16.object({
|
|
2032
|
+
encoding: z16.literal("br"),
|
|
2033
|
+
sha256: z16.string().regex(/^[0-9a-f]{64}$/),
|
|
2034
|
+
compressedSize: z16.number().int().positive().max(stagedDeploymentLimits.compressedSize),
|
|
2035
|
+
size: z16.number().int().positive().max(stagedDeploymentLimits.size)
|
|
1860
2036
|
}).strict();
|
|
1861
2037
|
var stagedDeploymentContentSchema = stagedDeploymentSchema.extend({
|
|
1862
|
-
content:
|
|
2038
|
+
content: z16.string().max(Math.ceil(stagedDeploymentLimits.compressedSize / 3) * 4)
|
|
1863
2039
|
}).strict();
|
|
1864
2040
|
var stagedDeploymentKey = (build, sha256) => `builds/${build}/deployment/${sha256}.br`;
|
|
1865
2041
|
var artifactFields = {
|
|
1866
2042
|
routing: appRoutingSchema,
|
|
1867
|
-
worker:
|
|
2043
|
+
worker: z16.object({
|
|
1868
2044
|
...workerSettings,
|
|
1869
2045
|
migrations: appMigrationsSchema.optional(),
|
|
1870
|
-
modules:
|
|
1871
|
-
|
|
2046
|
+
modules: z16.array(
|
|
2047
|
+
z16.object({
|
|
1872
2048
|
path: outputPathSchema.refine((path) => path !== "metadata"),
|
|
1873
|
-
type:
|
|
2049
|
+
type: z16.enum([
|
|
1874
2050
|
"application/javascript+module",
|
|
1875
2051
|
"application/wasm",
|
|
1876
2052
|
"text/plain",
|
|
@@ -1880,26 +2056,27 @@ var artifactFields = {
|
|
|
1880
2056
|
}).strict()
|
|
1881
2057
|
).min(1).max(500)
|
|
1882
2058
|
}).strict().superRefine(distinctBindings).optional(),
|
|
1883
|
-
assets:
|
|
1884
|
-
|
|
2059
|
+
assets: z16.array(
|
|
2060
|
+
z16.object({
|
|
1885
2061
|
path: assetPathSchema,
|
|
1886
2062
|
content: base64Schema.max(14e6),
|
|
1887
|
-
size:
|
|
2063
|
+
size: z16.number().int().min(0).max(1e7)
|
|
1888
2064
|
}).strict()
|
|
1889
2065
|
).max(500)
|
|
1890
2066
|
};
|
|
1891
|
-
var
|
|
1892
|
-
|
|
1893
|
-
|
|
2067
|
+
var inlineCode = () => z16.unknown().optional().transform((value) => value);
|
|
2068
|
+
var buildArtifactsSchema = z16.discriminatedUnion("format", [
|
|
2069
|
+
z16.object({
|
|
2070
|
+
format: z16.literal(1),
|
|
1894
2071
|
...artifactFields,
|
|
1895
|
-
quests:
|
|
1896
|
-
catalog:
|
|
2072
|
+
quests: inlineCode(),
|
|
2073
|
+
catalog: inlineCode()
|
|
1897
2074
|
}).strict(),
|
|
1898
|
-
|
|
1899
|
-
format:
|
|
2075
|
+
z16.object({
|
|
2076
|
+
format: z16.literal(2),
|
|
1900
2077
|
...artifactFields,
|
|
1901
2078
|
deployment: stagedDeploymentSchema,
|
|
1902
|
-
images:
|
|
2079
|
+
images: z16.array(imageAssetArtifactSchema).max(10)
|
|
1903
2080
|
}).strict()
|
|
1904
2081
|
]).superRefine((value, ctx) => {
|
|
1905
2082
|
if (value.worker) {
|
|
@@ -1951,39 +2128,39 @@ var buildArtifactsSchema = z15.discriminatedUnion("format", [
|
|
|
1951
2128
|
});
|
|
1952
2129
|
|
|
1953
2130
|
// src/server/development.ts
|
|
1954
|
-
import * as
|
|
1955
|
-
var developmentPreflightSchema =
|
|
1956
|
-
organization:
|
|
1957
|
-
project:
|
|
1958
|
-
environment:
|
|
1959
|
-
identity:
|
|
1960
|
-
exchange:
|
|
1961
|
-
activeIntegrations:
|
|
2131
|
+
import * as z17 from "zod";
|
|
2132
|
+
var developmentPreflightSchema = z17.object({
|
|
2133
|
+
organization: z17.string(),
|
|
2134
|
+
project: z17.string(),
|
|
2135
|
+
environment: z17.enum(["test", "live"]),
|
|
2136
|
+
identity: z17.object({
|
|
2137
|
+
exchange: z17.literal("supported"),
|
|
2138
|
+
activeIntegrations: z17.number().int().nonnegative()
|
|
1962
2139
|
}).optional(),
|
|
1963
|
-
staging:
|
|
1964
|
-
development:
|
|
1965
|
-
status:
|
|
2140
|
+
staging: z17.enum(["configured", "blocked"]),
|
|
2141
|
+
development: z17.object({
|
|
2142
|
+
status: z17.enum(["configured", "blocked"]),
|
|
1966
2143
|
// How `domino dev` reaches the preview origin: a Cloudflare tunnel, or a direct route on a
|
|
1967
2144
|
// local development stack. APIs that predate the field use tunnels.
|
|
1968
|
-
transport:
|
|
1969
|
-
missing:
|
|
1970
|
-
authentication:
|
|
2145
|
+
transport: z17.enum(["tunnel", "direct"]).default("tunnel"),
|
|
2146
|
+
missing: z17.array(z17.string()),
|
|
2147
|
+
authentication: z17.array(z17.string())
|
|
1971
2148
|
}),
|
|
1972
|
-
checks:
|
|
1973
|
-
|
|
1974
|
-
id:
|
|
1975
|
-
status:
|
|
1976
|
-
message:
|
|
1977
|
-
missing:
|
|
1978
|
-
issues:
|
|
2149
|
+
checks: z17.array(
|
|
2150
|
+
z17.object({
|
|
2151
|
+
id: z17.string(),
|
|
2152
|
+
status: z17.enum(["ok", "error"]),
|
|
2153
|
+
message: z17.string(),
|
|
2154
|
+
missing: z17.array(z17.string()).optional(),
|
|
2155
|
+
issues: z17.array(z17.string()).optional()
|
|
1979
2156
|
})
|
|
1980
2157
|
)
|
|
1981
2158
|
});
|
|
1982
2159
|
|
|
1983
2160
|
// src/server/hosted.ts
|
|
1984
|
-
import * as
|
|
2161
|
+
import * as z18 from "zod";
|
|
1985
2162
|
var hostedKeyPermissions = ["read", "points", "ingest"];
|
|
1986
|
-
var hostedKeyPermissionList =
|
|
2163
|
+
var hostedKeyPermissionList = z18.array(z18.string()).transform(
|
|
1987
2164
|
(values) => values.filter(
|
|
1988
2165
|
(value) => hostedKeyPermissions.includes(value)
|
|
1989
2166
|
)
|
|
@@ -1995,17 +2172,17 @@ var hostedManagementBindings = [
|
|
|
1995
2172
|
"DOMINO_PROJECT",
|
|
1996
2173
|
"DOMINO_ENVIRONMENT"
|
|
1997
2174
|
];
|
|
1998
|
-
var hostedKeySecretSchema =
|
|
1999
|
-
var hostedKeySchema =
|
|
2000
|
-
id:
|
|
2175
|
+
var hostedKeySecretSchema = z18.string().regex(/^dhk_[A-Za-z0-9_-]{43}$/, "Expected a hosted app key");
|
|
2176
|
+
var hostedKeySchema = z18.object({
|
|
2177
|
+
id: z18.string().uuid(),
|
|
2001
2178
|
token: hostedKeySecretSchema,
|
|
2002
2179
|
organization: identifier,
|
|
2003
2180
|
project: identifier,
|
|
2004
|
-
environment:
|
|
2181
|
+
environment: z18.enum(["test", "live"]),
|
|
2005
2182
|
permissions: hostedKeyPermissionList,
|
|
2006
|
-
expiresAt:
|
|
2183
|
+
expiresAt: z18.number().nullable()
|
|
2007
2184
|
}).strict();
|
|
2008
|
-
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl:
|
|
2185
|
+
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl: z18.string().url() }).strict();
|
|
2009
2186
|
function hostedManagementClient(env) {
|
|
2010
2187
|
const missing = hostedManagementBindings.filter((name) => !env[name]);
|
|
2011
2188
|
if (missing.length) {
|
|
@@ -2013,7 +2190,7 @@ function hostedManagementClient(env) {
|
|
|
2013
2190
|
`Missing ${missing.join(", ")}. Domino sets these for hosted apps and domino dev; update the project's vite.config.ts to forward them in development.`
|
|
2014
2191
|
);
|
|
2015
2192
|
}
|
|
2016
|
-
const environment =
|
|
2193
|
+
const environment = z18.enum(["test", "live"]).parse(env.DOMINO_ENVIRONMENT);
|
|
2017
2194
|
const token = env.DOMINO_MANAGEMENT_KEY;
|
|
2018
2195
|
return createManagementClient({
|
|
2019
2196
|
baseUrl: env.DOMINO_API_URL.replace(/\/+$/, ""),
|
|
@@ -2025,9 +2202,9 @@ function hostedManagementClient(env) {
|
|
|
2025
2202
|
}
|
|
2026
2203
|
|
|
2027
2204
|
// src/server/index.ts
|
|
2028
|
-
var environmentSchema =
|
|
2029
|
-
var roleSchema =
|
|
2030
|
-
var permissionSchema =
|
|
2205
|
+
var environmentSchema = z19.enum(["test", "live"]);
|
|
2206
|
+
var roleSchema = z19.enum(["editor", "reviewer", "staff"]);
|
|
2207
|
+
var permissionSchema = z19.enum([
|
|
2031
2208
|
"read",
|
|
2032
2209
|
"publish",
|
|
2033
2210
|
"review",
|
|
@@ -2047,7 +2224,7 @@ var permissionSchema = z18.enum([
|
|
|
2047
2224
|
*/
|
|
2048
2225
|
"enroll"
|
|
2049
2226
|
]);
|
|
2050
|
-
var permissionListSchema =
|
|
2227
|
+
var permissionListSchema = z19.array(z19.string()).transform(
|
|
2051
2228
|
(values) => values.filter(
|
|
2052
2229
|
(value) => permissionSchema.safeParse(value).success
|
|
2053
2230
|
)
|
|
@@ -2057,38 +2234,38 @@ var rolePermissions = {
|
|
|
2057
2234
|
reviewer: ["read", "review"],
|
|
2058
2235
|
staff: ["read", "confirm", "handover"]
|
|
2059
2236
|
};
|
|
2060
|
-
var projectSetupSchema =
|
|
2061
|
-
mode:
|
|
2062
|
-
brief:
|
|
2237
|
+
var projectSetupSchema = z19.object({
|
|
2238
|
+
mode: z19.enum(["new", "existing"]),
|
|
2239
|
+
brief: z19.string().trim().min(1).max(4e3)
|
|
2063
2240
|
}).strict();
|
|
2064
|
-
var operatorUserSchema =
|
|
2065
|
-
id:
|
|
2066
|
-
name:
|
|
2067
|
-
email:
|
|
2068
|
-
avatar:
|
|
2241
|
+
var operatorUserSchema = z19.object({
|
|
2242
|
+
id: z19.string(),
|
|
2243
|
+
name: z19.string().nullable(),
|
|
2244
|
+
email: z19.string().nullable(),
|
|
2245
|
+
avatar: z19.string().nullable()
|
|
2069
2246
|
});
|
|
2070
|
-
var projectSchema =
|
|
2247
|
+
var projectSchema = z19.object({
|
|
2071
2248
|
/**
|
|
2072
2249
|
* Names the project's hosted addresses. The server gives a new project, and accepts in a
|
|
2073
2250
|
* slug change, only slugs of at least 3 characters that Domino does not reserve. This schema
|
|
2074
2251
|
* checks only the format, so it parses every slug that exists.
|
|
2075
2252
|
*/
|
|
2076
|
-
slug:
|
|
2077
|
-
createdBy:
|
|
2253
|
+
slug: z19.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
2254
|
+
createdBy: z19.string().nullable().optional(),
|
|
2078
2255
|
creator: operatorUserSchema.nullable().optional(),
|
|
2079
2256
|
/** A response, so fields a newer server adds to the setup are dropped, not rejected. */
|
|
2080
|
-
setup:
|
|
2257
|
+
setup: z19.object(projectSetupSchema.shape).optional(),
|
|
2081
2258
|
/** The starter chosen at setup. A plain string, so later starters still parse. */
|
|
2082
|
-
starter:
|
|
2083
|
-
id:
|
|
2259
|
+
starter: z19.string().optional(),
|
|
2260
|
+
id: z19.string().min(1),
|
|
2084
2261
|
organization: identifier,
|
|
2085
2262
|
project: identifier,
|
|
2086
|
-
name:
|
|
2087
|
-
subtitle:
|
|
2088
|
-
initials:
|
|
2089
|
-
color:
|
|
2263
|
+
name: z19.string(),
|
|
2264
|
+
subtitle: z19.string(),
|
|
2265
|
+
initials: z19.string(),
|
|
2266
|
+
color: z19.string(),
|
|
2090
2267
|
permissions: permissionListSchema,
|
|
2091
|
-
environments:
|
|
2268
|
+
environments: z19.array(environmentSchema)
|
|
2092
2269
|
}).refine(
|
|
2093
2270
|
(project) => !project.creator || project.creator.id === project.createdBy,
|
|
2094
2271
|
{
|
|
@@ -2096,45 +2273,52 @@ var projectSchema = z18.object({
|
|
|
2096
2273
|
path: ["creator"]
|
|
2097
2274
|
}
|
|
2098
2275
|
);
|
|
2099
|
-
var
|
|
2276
|
+
var projectCreateInputSchema = z19.object({
|
|
2100
2277
|
actionId: identifier,
|
|
2101
|
-
name:
|
|
2278
|
+
name: z19.string().trim().min(1).max(80),
|
|
2279
|
+
setup: projectSetupSchema.optional(),
|
|
2280
|
+
/** The starter a new hosted app begins from, with `setup.mode` "new". */
|
|
2281
|
+
starter: offeredStarterSchema.optional()
|
|
2282
|
+
}).strict();
|
|
2283
|
+
var projectInputSchema = z19.object({
|
|
2284
|
+
actionId: identifier,
|
|
2285
|
+
name: z19.string().trim().min(1).max(80),
|
|
2102
2286
|
setup: projectSetupSchema.optional(),
|
|
2103
2287
|
/** The starter a new hosted app begins from, with `setup.mode` "new". */
|
|
2104
2288
|
starter: starterIdSchema.optional()
|
|
2105
2289
|
}).strict();
|
|
2106
|
-
var projectUpdateInputSchema =
|
|
2107
|
-
|
|
2108
|
-
|
|
2290
|
+
var projectUpdateInputSchema = z19.union([
|
|
2291
|
+
z19.object({ name: projectCreateInputSchema.shape.name }).strict(),
|
|
2292
|
+
z19.object({
|
|
2109
2293
|
slug: projectSchema.shape.slug,
|
|
2110
|
-
confirm:
|
|
2294
|
+
confirm: z19.string().min(1).max(80)
|
|
2111
2295
|
}).strict()
|
|
2112
2296
|
]);
|
|
2113
|
-
var projectDeletionInputSchema =
|
|
2114
|
-
var projectDeletionSchema =
|
|
2297
|
+
var projectDeletionInputSchema = z19.object({ confirm: z19.string().min(1).max(80) }).strict();
|
|
2298
|
+
var projectDeletionSchema = z19.object({
|
|
2115
2299
|
project: identifier,
|
|
2116
|
-
purgeAfter:
|
|
2300
|
+
purgeAfter: z19.number().int()
|
|
2117
2301
|
});
|
|
2118
|
-
var projectTransferInputSchema =
|
|
2119
|
-
var projectTransferSchema =
|
|
2302
|
+
var projectTransferInputSchema = z19.object({ organization: identifier, confirm: z19.string().min(1).max(80) }).strict();
|
|
2303
|
+
var projectTransferSchema = z19.object({
|
|
2120
2304
|
organization: identifier,
|
|
2121
2305
|
project: identifier
|
|
2122
2306
|
});
|
|
2123
|
-
var grantSchema =
|
|
2124
|
-
subject:
|
|
2125
|
-
roles:
|
|
2126
|
-
environments:
|
|
2307
|
+
var grantSchema = z19.object({
|
|
2308
|
+
subject: z19.string().min(1).max(200),
|
|
2309
|
+
roles: z19.array(roleSchema),
|
|
2310
|
+
environments: z19.array(environmentSchema)
|
|
2127
2311
|
}).strict();
|
|
2128
|
-
var grantRecordSchema =
|
|
2129
|
-
var stockAdditionSchema =
|
|
2312
|
+
var grantRecordSchema = z19.object(grantSchema.shape);
|
|
2313
|
+
var stockAdditionSchema = z19.object({
|
|
2130
2314
|
item: identifier,
|
|
2131
|
-
quantity:
|
|
2315
|
+
quantity: z19.number().int(),
|
|
2132
2316
|
actionId: identifier
|
|
2133
2317
|
});
|
|
2134
|
-
var completionRevokeSchema =
|
|
2318
|
+
var completionRevokeSchema = z19.object({
|
|
2135
2319
|
actionId: identifier,
|
|
2136
|
-
reason:
|
|
2137
|
-
freeOccurrence:
|
|
2320
|
+
reason: z19.string().trim().min(1).max(500),
|
|
2321
|
+
freeOccurrence: z19.boolean().default(false)
|
|
2138
2322
|
}).strict();
|
|
2139
2323
|
var RevokedEntitlementOutcome = {
|
|
2140
2324
|
/** No other completion grants the reward: it is void, after cancelling a handover in progress. */
|
|
@@ -2162,238 +2346,313 @@ var RevokedReferralOutcome = {
|
|
|
2162
2346
|
/** Qualified on another accepted completion of the program's quest instead. */
|
|
2163
2347
|
Requalified: "requalified"
|
|
2164
2348
|
};
|
|
2165
|
-
var entitlementOutcomeSchema =
|
|
2166
|
-
var deliveryOutcomeSchema =
|
|
2167
|
-
var referralOutcomeSchema =
|
|
2168
|
-
var completionRevocationSchema =
|
|
2349
|
+
var entitlementOutcomeSchema = z19.string().min(1).max(64);
|
|
2350
|
+
var deliveryOutcomeSchema = z19.string().min(1).max(64);
|
|
2351
|
+
var referralOutcomeSchema = z19.string().min(1).max(64);
|
|
2352
|
+
var completionRevocationSchema = z19.object({
|
|
2169
2353
|
completion: identifier,
|
|
2170
2354
|
/** The quest ID, or the board ID when `source.kind` is `leaderboard`. */
|
|
2171
2355
|
quest: identifier,
|
|
2172
2356
|
member: identifier,
|
|
2173
2357
|
/** What paid the revoked completion. `source.id` repeats `quest`. */
|
|
2174
2358
|
source: completionSourceSchema.optional(),
|
|
2175
|
-
revokedAt:
|
|
2176
|
-
occurrenceFreed:
|
|
2177
|
-
badges:
|
|
2178
|
-
groups:
|
|
2179
|
-
points:
|
|
2180
|
-
|
|
2359
|
+
revokedAt: z19.number(),
|
|
2360
|
+
occurrenceFreed: z19.boolean(),
|
|
2361
|
+
badges: z19.array(z19.object({ badge: identifier, stillAwarded: z19.boolean() })).optional(),
|
|
2362
|
+
groups: z19.array(z19.object({ group: identifier, stillMember: z19.boolean() })).optional(),
|
|
2363
|
+
points: z19.array(
|
|
2364
|
+
z19.object({
|
|
2181
2365
|
entry: identifier,
|
|
2182
2366
|
balance: identifier,
|
|
2183
2367
|
reversal: identifier.nullable(),
|
|
2184
|
-
reversed:
|
|
2185
|
-
unreversed:
|
|
2368
|
+
reversed: z19.number().int(),
|
|
2369
|
+
unreversed: z19.number().int()
|
|
2186
2370
|
})
|
|
2187
2371
|
),
|
|
2188
|
-
entitlements:
|
|
2189
|
-
|
|
2372
|
+
entitlements: z19.array(
|
|
2373
|
+
z19.object({
|
|
2190
2374
|
entitlement: identifier,
|
|
2191
2375
|
reward: identifier,
|
|
2192
2376
|
outcome: entitlementOutcomeSchema,
|
|
2193
|
-
status:
|
|
2377
|
+
status: z19.string()
|
|
2194
2378
|
})
|
|
2195
2379
|
),
|
|
2196
|
-
deliveries:
|
|
2197
|
-
|
|
2198
|
-
delivery:
|
|
2199
|
-
roleId:
|
|
2380
|
+
deliveries: z19.array(
|
|
2381
|
+
z19.object({
|
|
2382
|
+
delivery: z19.string(),
|
|
2383
|
+
roleId: z19.string(),
|
|
2200
2384
|
outcome: deliveryOutcomeSchema,
|
|
2201
2385
|
/**
|
|
2202
2386
|
* By Relay's records, another accepted, unrevoked completion of the member also granted this
|
|
2203
2387
|
* role to the same Discord account and server. Relay does not read Discord's membership.
|
|
2204
2388
|
*/
|
|
2205
|
-
stillGranted:
|
|
2389
|
+
stillGranted: z19.boolean()
|
|
2206
2390
|
})
|
|
2207
2391
|
),
|
|
2208
|
-
referrals:
|
|
2209
|
-
|
|
2392
|
+
referrals: z19.array(
|
|
2393
|
+
z19.object({
|
|
2210
2394
|
program: identifier,
|
|
2211
2395
|
outcome: referralOutcomeSchema
|
|
2212
2396
|
})
|
|
2213
2397
|
),
|
|
2214
|
-
streakMilestone:
|
|
2215
|
-
});
|
|
2216
|
-
var
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2398
|
+
streakMilestone: z19.boolean()
|
|
2399
|
+
});
|
|
2400
|
+
var completionRestoreSchema = z19.object({
|
|
2401
|
+
actionId: identifier,
|
|
2402
|
+
reason: z19.string().trim().min(1).max(500)
|
|
2403
|
+
}).strict();
|
|
2404
|
+
var RestoredEntitlementOutcome = {
|
|
2405
|
+
/** The revocation voided it, and it is available again. */
|
|
2406
|
+
Restored: "restored",
|
|
2407
|
+
/** The revocation lowered or flagged it: its earned tier is the completion's again. */
|
|
2408
|
+
Raised: "raised",
|
|
2409
|
+
/** It changed since the revocation (an operator restored, voided or corrected it), so it stays. */
|
|
2410
|
+
Kept: "kept"
|
|
2411
|
+
};
|
|
2412
|
+
var RestoredDeliveryOutcome = {
|
|
2413
|
+
/** The grant had not reached Discord, and it is queued again. */
|
|
2414
|
+
Requeued: "requeued",
|
|
2415
|
+
/** The grant counts again for reconciliation, and its delivery status stays. */
|
|
2416
|
+
Kept: "kept"
|
|
2417
|
+
};
|
|
2418
|
+
var RestoredReferralOutcome = {
|
|
2419
|
+
/** The member qualifies on this completion again. */
|
|
2420
|
+
Qualified: "qualified",
|
|
2421
|
+
/** The program is disabled or gone, or the referral is suspended, so nothing changed. */
|
|
2422
|
+
Kept: "kept"
|
|
2423
|
+
};
|
|
2424
|
+
var openOutcome = z19.string().min(1).max(64);
|
|
2425
|
+
var completionRestorationSchema = z19.object({
|
|
2426
|
+
completion: identifier,
|
|
2427
|
+
/** The quest ID, or the board ID when `source.kind` is `leaderboard`. */
|
|
2428
|
+
quest: identifier,
|
|
2429
|
+
member: identifier,
|
|
2430
|
+
source: completionSourceSchema.optional(),
|
|
2431
|
+
restoredAt: z19.number(),
|
|
2432
|
+
points: z19.array(
|
|
2433
|
+
z19.object({
|
|
2434
|
+
entry: identifier,
|
|
2435
|
+
balance: identifier,
|
|
2436
|
+
reversal: identifier,
|
|
2437
|
+
amount: z19.number().int()
|
|
2438
|
+
})
|
|
2439
|
+
),
|
|
2440
|
+
badges: z19.array(z19.object({ badge: identifier })),
|
|
2441
|
+
groups: z19.array(z19.object({ group: identifier, added: z19.boolean() })),
|
|
2442
|
+
entitlements: z19.array(
|
|
2443
|
+
z19.object({
|
|
2444
|
+
entitlement: identifier,
|
|
2445
|
+
reward: identifier,
|
|
2446
|
+
outcome: openOutcome,
|
|
2447
|
+
status: z19.string()
|
|
2448
|
+
})
|
|
2449
|
+
),
|
|
2450
|
+
deliveries: z19.array(
|
|
2451
|
+
z19.object({
|
|
2452
|
+
delivery: z19.string(),
|
|
2453
|
+
roleId: z19.string(),
|
|
2454
|
+
outcome: openOutcome
|
|
2455
|
+
})
|
|
2456
|
+
),
|
|
2457
|
+
referrals: z19.array(
|
|
2458
|
+
z19.object({
|
|
2459
|
+
program: identifier,
|
|
2460
|
+
outcome: openOutcome
|
|
2461
|
+
})
|
|
2462
|
+
),
|
|
2463
|
+
streakMilestone: z19.boolean()
|
|
2464
|
+
});
|
|
2465
|
+
var accessSchema = z19.object({
|
|
2466
|
+
actor: z19.string(),
|
|
2467
|
+
organization: z19.string(),
|
|
2468
|
+
admin: z19.boolean(),
|
|
2469
|
+
local: z19.boolean(),
|
|
2470
|
+
projects: z19.array(projectSchema),
|
|
2471
|
+
/** The credential's own kind and scope, when it is an organization automation key. */
|
|
2472
|
+
credential: z19.object({
|
|
2473
|
+
kind: z19.string(),
|
|
2474
|
+
id: z19.string(),
|
|
2475
|
+
name: z19.string(),
|
|
2476
|
+
/** The projects it reaches; null for every project of the organization. */
|
|
2477
|
+
projects: z19.array(z19.string()).nullable(),
|
|
2478
|
+
createProjects: z19.boolean(),
|
|
2479
|
+
permissions: permissionListSchema
|
|
2480
|
+
}).optional()
|
|
2481
|
+
});
|
|
2482
|
+
var querySchema = z19.object({
|
|
2483
|
+
q: z19.string().max(200).default(""),
|
|
2484
|
+
filter: z19.string().max(50).default("all"),
|
|
2485
|
+
offset: z19.coerce.number().int().min(0).max(1e6).default(0),
|
|
2486
|
+
limit: z19.coerce.number().int().min(1).max(100).default(25)
|
|
2487
|
+
});
|
|
2488
|
+
var accountProfileSchema = z19.object({
|
|
2489
|
+
name: z19.string().optional(),
|
|
2231
2490
|
/** The account's handle, where the provider has one (X and Discord). */
|
|
2232
|
-
username:
|
|
2233
|
-
email:
|
|
2234
|
-
emailVerified:
|
|
2235
|
-
imageUrl:
|
|
2491
|
+
username: z19.string().optional(),
|
|
2492
|
+
email: z19.string().optional(),
|
|
2493
|
+
emailVerified: z19.boolean().default(false),
|
|
2494
|
+
imageUrl: z19.string().url().optional()
|
|
2236
2495
|
});
|
|
2237
|
-
var memberAccountSchema =
|
|
2496
|
+
var memberAccountSchema = z19.object({
|
|
2238
2497
|
/** `wallet` for wallet sign-in, `account` for every other connected account. */
|
|
2239
|
-
kind:
|
|
2240
|
-
provider:
|
|
2241
|
-
subject:
|
|
2242
|
-
signInEnabled:
|
|
2498
|
+
kind: z19.enum(["account", "wallet"]),
|
|
2499
|
+
provider: z19.string(),
|
|
2500
|
+
subject: z19.string(),
|
|
2501
|
+
signInEnabled: z19.boolean(),
|
|
2243
2502
|
profile: accountProfileSchema.optional(),
|
|
2244
2503
|
/**
|
|
2245
2504
|
* Present only for accounts Relay reads in the background with the member's own tokens:
|
|
2246
2505
|
* `needs-reconnect` once those tokens stopped working, until the member links the account again.
|
|
2247
2506
|
*/
|
|
2248
|
-
status:
|
|
2507
|
+
status: z19.enum(["connected", "needs-reconnect"]).optional(),
|
|
2249
2508
|
/**
|
|
2250
2509
|
* Why the account needs reconnecting: the member or the provider revoked access (`revoked`),
|
|
2251
2510
|
* the tokens expired and cannot be refreshed (`expired`), or a source needs a permission the
|
|
2252
2511
|
* member did not grant (`missing-scope`).
|
|
2253
2512
|
*/
|
|
2254
|
-
reason:
|
|
2255
|
-
});
|
|
2256
|
-
var operationSchema =
|
|
2257
|
-
target:
|
|
2258
|
-
paused:
|
|
2259
|
-
revision:
|
|
2260
|
-
reason:
|
|
2261
|
-
actor:
|
|
2262
|
-
changedAt:
|
|
2263
|
-
});
|
|
2264
|
-
var operationInputSchema =
|
|
2265
|
-
target:
|
|
2266
|
-
|
|
2267
|
-
|
|
2513
|
+
reason: z19.enum(["revoked", "expired", "missing-scope"]).optional()
|
|
2514
|
+
});
|
|
2515
|
+
var operationSchema = z19.object({
|
|
2516
|
+
target: z19.string(),
|
|
2517
|
+
paused: z19.boolean(),
|
|
2518
|
+
revision: z19.number().int(),
|
|
2519
|
+
reason: z19.string(),
|
|
2520
|
+
actor: z19.string().nullable(),
|
|
2521
|
+
changedAt: z19.number()
|
|
2522
|
+
});
|
|
2523
|
+
var operationInputSchema = z19.object({
|
|
2524
|
+
target: z19.union([
|
|
2525
|
+
z19.literal("redemptions"),
|
|
2526
|
+
z19.string().regex(/^quest:[\w-]+$/)
|
|
2268
2527
|
]),
|
|
2269
|
-
paused:
|
|
2270
|
-
revision:
|
|
2271
|
-
reason:
|
|
2528
|
+
paused: z19.boolean(),
|
|
2529
|
+
revision: z19.number().int().nonnegative(),
|
|
2530
|
+
reason: z19.string().trim().min(1).max(500),
|
|
2272
2531
|
actionId: identifier
|
|
2273
2532
|
}).strict();
|
|
2274
|
-
var questLifecycleInputSchema =
|
|
2533
|
+
var questLifecycleInputSchema = z19.object({
|
|
2275
2534
|
quest: identifier,
|
|
2276
2535
|
expectedRelease: identifier.optional(),
|
|
2277
|
-
archived:
|
|
2278
|
-
reason:
|
|
2536
|
+
archived: z19.boolean(),
|
|
2537
|
+
reason: z19.string().trim().min(1).max(500),
|
|
2279
2538
|
actionId: identifier
|
|
2280
2539
|
}).strict();
|
|
2281
|
-
var questLifecycleSchema =
|
|
2540
|
+
var questLifecycleSchema = z19.object({
|
|
2282
2541
|
quest: identifier,
|
|
2283
2542
|
key: identifier.nullable(),
|
|
2284
|
-
title:
|
|
2543
|
+
title: z19.string(),
|
|
2285
2544
|
release: identifier,
|
|
2286
|
-
lifecycle:
|
|
2287
|
-
changed:
|
|
2288
|
-
});
|
|
2289
|
-
var memberSchema =
|
|
2290
|
-
id:
|
|
2291
|
-
test:
|
|
2292
|
-
name:
|
|
2293
|
-
accounts:
|
|
2294
|
-
attempts:
|
|
2295
|
-
completions:
|
|
2296
|
-
rewards:
|
|
2297
|
-
lastActivity:
|
|
2298
|
-
});
|
|
2299
|
-
var personSchema =
|
|
2300
|
-
id:
|
|
2301
|
-
test:
|
|
2302
|
-
name:
|
|
2303
|
-
accounts:
|
|
2304
|
-
});
|
|
2305
|
-
var metricsSchema =
|
|
2306
|
-
quests:
|
|
2307
|
-
members:
|
|
2308
|
-
attempts:
|
|
2309
|
-
completions:
|
|
2310
|
-
review:
|
|
2311
|
-
failed:
|
|
2312
|
-
entitlements:
|
|
2313
|
-
});
|
|
2314
|
-
var readinessSchema =
|
|
2315
|
-
checks:
|
|
2316
|
-
|
|
2317
|
-
id:
|
|
2318
|
-
status:
|
|
2319
|
-
title:
|
|
2320
|
-
detail:
|
|
2545
|
+
lifecycle: z19.enum(["active", "paused", "archived"]),
|
|
2546
|
+
changed: z19.boolean()
|
|
2547
|
+
});
|
|
2548
|
+
var memberSchema = z19.object({
|
|
2549
|
+
id: z19.string(),
|
|
2550
|
+
test: z19.boolean().optional(),
|
|
2551
|
+
name: z19.string().nullable().optional(),
|
|
2552
|
+
accounts: z19.array(memberAccountSchema).default([]),
|
|
2553
|
+
attempts: z19.number(),
|
|
2554
|
+
completions: z19.number(),
|
|
2555
|
+
rewards: z19.number(),
|
|
2556
|
+
lastActivity: z19.number().nullable()
|
|
2557
|
+
});
|
|
2558
|
+
var personSchema = z19.object({
|
|
2559
|
+
id: z19.string(),
|
|
2560
|
+
test: z19.boolean().optional(),
|
|
2561
|
+
name: z19.string().nullable().optional(),
|
|
2562
|
+
accounts: z19.array(memberAccountSchema).default([])
|
|
2563
|
+
});
|
|
2564
|
+
var metricsSchema = z19.object({
|
|
2565
|
+
quests: z19.number(),
|
|
2566
|
+
members: z19.number(),
|
|
2567
|
+
attempts: z19.number(),
|
|
2568
|
+
completions: z19.number(),
|
|
2569
|
+
review: z19.number(),
|
|
2570
|
+
failed: z19.number(),
|
|
2571
|
+
entitlements: z19.number()
|
|
2572
|
+
});
|
|
2573
|
+
var readinessSchema = z19.object({
|
|
2574
|
+
checks: z19.array(
|
|
2575
|
+
z19.object({
|
|
2576
|
+
id: z19.string(),
|
|
2577
|
+
status: z19.enum(["ready", "blocked"]),
|
|
2578
|
+
title: z19.string(),
|
|
2579
|
+
detail: z19.string()
|
|
2321
2580
|
})
|
|
2322
2581
|
)
|
|
2323
2582
|
});
|
|
2324
|
-
var inventorySchema =
|
|
2325
|
-
item:
|
|
2326
|
-
name:
|
|
2327
|
-
available:
|
|
2328
|
-
reserved:
|
|
2329
|
-
allocated:
|
|
2330
|
-
});
|
|
2331
|
-
var auditRecordSchema =
|
|
2332
|
-
id:
|
|
2333
|
-
action:
|
|
2334
|
-
actor:
|
|
2583
|
+
var inventorySchema = z19.object({
|
|
2584
|
+
item: z19.string(),
|
|
2585
|
+
name: z19.string().nullable().default(null),
|
|
2586
|
+
available: z19.number(),
|
|
2587
|
+
reserved: z19.number(),
|
|
2588
|
+
allocated: z19.number().default(0)
|
|
2589
|
+
});
|
|
2590
|
+
var auditRecordSchema = z19.object({
|
|
2591
|
+
id: z19.string(),
|
|
2592
|
+
action: z19.string(),
|
|
2593
|
+
actor: z19.string().nullable(),
|
|
2335
2594
|
user: operatorUserSchema.nullable().optional(),
|
|
2336
|
-
detail:
|
|
2337
|
-
at:
|
|
2338
|
-
attempt:
|
|
2595
|
+
detail: z19.string(),
|
|
2596
|
+
at: z19.number(),
|
|
2597
|
+
attempt: z19.string().nullable()
|
|
2339
2598
|
}).refine((record6) => !record6.user || record6.user.id === record6.actor, {
|
|
2340
2599
|
message: "User profile must match the recorded actor",
|
|
2341
2600
|
path: ["user"]
|
|
2342
2601
|
});
|
|
2343
|
-
var pageSchema =
|
|
2602
|
+
var pageSchema = z19.object({
|
|
2344
2603
|
snapshot: snapshotSchema,
|
|
2345
|
-
members:
|
|
2346
|
-
people:
|
|
2604
|
+
members: z19.array(memberSchema),
|
|
2605
|
+
people: z19.array(personSchema).default([]),
|
|
2347
2606
|
metrics: metricsSchema,
|
|
2348
|
-
total:
|
|
2349
|
-
offset:
|
|
2350
|
-
limit:
|
|
2351
|
-
inventory:
|
|
2352
|
-
operations:
|
|
2353
|
-
audit:
|
|
2354
|
-
questCounts:
|
|
2355
|
-
});
|
|
2356
|
-
var managedOAuthAccountBaseSchema =
|
|
2357
|
-
provider:
|
|
2358
|
-
revision:
|
|
2359
|
-
});
|
|
2360
|
-
var managedOAuthAccountSchema =
|
|
2607
|
+
total: z19.number(),
|
|
2608
|
+
offset: z19.number(),
|
|
2609
|
+
limit: z19.number(),
|
|
2610
|
+
inventory: z19.array(inventorySchema),
|
|
2611
|
+
operations: z19.array(operationSchema).default([]),
|
|
2612
|
+
audit: z19.array(auditRecordSchema).default([]),
|
|
2613
|
+
questCounts: z19.record(z19.string(), z19.number())
|
|
2614
|
+
});
|
|
2615
|
+
var managedOAuthAccountBaseSchema = z19.object({
|
|
2616
|
+
provider: z19.enum(["x", "discord"]),
|
|
2617
|
+
revision: z19.number().int().nonnegative()
|
|
2618
|
+
});
|
|
2619
|
+
var managedOAuthAccountSchema = z19.discriminatedUnion("status", [
|
|
2361
2620
|
managedOAuthAccountBaseSchema.extend({
|
|
2362
|
-
status:
|
|
2363
|
-
subject:
|
|
2364
|
-
linkedAt:
|
|
2621
|
+
status: z19.literal("connected"),
|
|
2622
|
+
subject: z19.string().min(1),
|
|
2623
|
+
linkedAt: z19.number(),
|
|
2365
2624
|
/**
|
|
2366
2625
|
* True when a member import attached the account with the organization's word for it, not the
|
|
2367
2626
|
* member's proof. Absent from Relay versions without imports.
|
|
2368
2627
|
*/
|
|
2369
|
-
imported:
|
|
2628
|
+
imported: z19.boolean().optional(),
|
|
2370
2629
|
/**
|
|
2371
2630
|
* True for a real account an operator linked to a test member without OAuth
|
|
2372
2631
|
* (`testMembers.linkAccount`). Absent from Relay versions without it.
|
|
2373
2632
|
*/
|
|
2374
|
-
testLinked:
|
|
2633
|
+
testLinked: z19.boolean().optional()
|
|
2375
2634
|
}),
|
|
2376
|
-
managedOAuthAccountBaseSchema.extend({ status:
|
|
2635
|
+
managedOAuthAccountBaseSchema.extend({ status: z19.literal("disconnected") })
|
|
2377
2636
|
]);
|
|
2378
2637
|
var managedTelegramAccountBaseSchema = managedOAuthAccountBaseSchema.extend({
|
|
2379
|
-
provider:
|
|
2638
|
+
provider: z19.literal("telegram")
|
|
2380
2639
|
});
|
|
2381
|
-
var managedTelegramAccountSchema =
|
|
2640
|
+
var managedTelegramAccountSchema = z19.discriminatedUnion("status", [
|
|
2382
2641
|
managedTelegramAccountBaseSchema.extend({
|
|
2383
|
-
status:
|
|
2642
|
+
status: z19.literal("connected"),
|
|
2384
2643
|
/** The numeric Telegram user ID. */
|
|
2385
|
-
subject:
|
|
2386
|
-
linkedAt:
|
|
2644
|
+
subject: z19.string().min(1),
|
|
2645
|
+
linkedAt: z19.number()
|
|
2387
2646
|
}),
|
|
2388
2647
|
managedTelegramAccountBaseSchema.extend({
|
|
2389
|
-
status:
|
|
2648
|
+
status: z19.literal("disconnected")
|
|
2390
2649
|
})
|
|
2391
2650
|
]);
|
|
2392
|
-
var memberOAuthUnlinkInputSchema =
|
|
2393
|
-
provider:
|
|
2394
|
-
subject:
|
|
2395
|
-
revision:
|
|
2396
|
-
reason:
|
|
2651
|
+
var memberOAuthUnlinkInputSchema = z19.object({
|
|
2652
|
+
provider: z19.enum(["x", "discord"]),
|
|
2653
|
+
subject: z19.string().min(1).max(4096),
|
|
2654
|
+
revision: z19.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER - 1),
|
|
2655
|
+
reason: z19.string().trim().min(1).max(500)
|
|
2397
2656
|
}).strict();
|
|
2398
2657
|
var memberTelegramUnlinkInputSchema = memberOAuthUnlinkInputSchema.omit({ provider: true }).strict();
|
|
2399
2658
|
var managedWalletSchema = linkedWalletSchema.extend({
|
|
@@ -2401,32 +2660,32 @@ var managedWalletSchema = linkedWalletSchema.extend({
|
|
|
2401
2660
|
* True when a member import attached the wallet with the organization's word for it, and the
|
|
2402
2661
|
* member has not proved it since. Absent from Relay versions without imports.
|
|
2403
2662
|
*/
|
|
2404
|
-
imported:
|
|
2405
|
-
status:
|
|
2406
|
-
unlinkedAt:
|
|
2663
|
+
imported: z19.boolean().optional(),
|
|
2664
|
+
status: z19.enum(["linked", "unlinked"]),
|
|
2665
|
+
unlinkedAt: z19.number().int().nullable(),
|
|
2407
2666
|
/** "member", or the operator or key that unlinked it. */
|
|
2408
|
-
unlinkedBy:
|
|
2667
|
+
unlinkedBy: z19.string().nullable()
|
|
2409
2668
|
});
|
|
2410
2669
|
var managedMemberIdentitySchema = memberIdentitySchema.extend({
|
|
2411
2670
|
/**
|
|
2412
2671
|
* True for an X account a member import attached, until the member links or signs in with it
|
|
2413
2672
|
* through X. Absent from Relay versions without imports.
|
|
2414
2673
|
*/
|
|
2415
|
-
imported:
|
|
2674
|
+
imported: z19.boolean().optional(),
|
|
2416
2675
|
/**
|
|
2417
2676
|
* True for a real X or Discord account an operator linked to a test member without OAuth
|
|
2418
2677
|
* (`testMembers.linkAccount`). Absent from Relay versions without it.
|
|
2419
2678
|
*/
|
|
2420
|
-
testLinked:
|
|
2421
|
-
status:
|
|
2422
|
-
unlinkedAt:
|
|
2679
|
+
testLinked: z19.boolean().optional(),
|
|
2680
|
+
status: z19.enum(["linked", "unlinked"]),
|
|
2681
|
+
unlinkedAt: z19.number().int().nullable(),
|
|
2423
2682
|
/** The operator or key that unlinked it. */
|
|
2424
|
-
unlinkedBy:
|
|
2683
|
+
unlinkedBy: z19.string().nullable()
|
|
2425
2684
|
});
|
|
2426
|
-
var memberIdentityChangeInputSchema =
|
|
2685
|
+
var memberIdentityChangeInputSchema = z19.object({
|
|
2427
2686
|
kind: appIdentityKindSchema,
|
|
2428
|
-
subject:
|
|
2429
|
-
reason:
|
|
2687
|
+
subject: z19.string().min(1).max(256),
|
|
2688
|
+
reason: z19.string().trim().min(1).max(500)
|
|
2430
2689
|
}).strict();
|
|
2431
2690
|
var balanceCheckSchema = walletBalanceSchema.pick({
|
|
2432
2691
|
chain: true,
|
|
@@ -2436,76 +2695,99 @@ var balanceCheckSchema = walletBalanceSchema.pick({
|
|
|
2436
2695
|
wallets: true,
|
|
2437
2696
|
observedAt: true
|
|
2438
2697
|
}).extend({ attempt: identifier });
|
|
2439
|
-
var walletBalanceChainsSchema =
|
|
2440
|
-
chains:
|
|
2441
|
-
|
|
2442
|
-
chain:
|
|
2443
|
-
|
|
2698
|
+
var walletBalanceChainsSchema = z19.object({
|
|
2699
|
+
chains: z19.array(
|
|
2700
|
+
z19.object({
|
|
2701
|
+
chain: z19.union([
|
|
2702
|
+
z19.literal(solanaMainnet),
|
|
2444
2703
|
cosmosNetworkSchema,
|
|
2445
2704
|
evmChainIdSchema
|
|
2446
2705
|
]),
|
|
2447
|
-
name:
|
|
2448
|
-
testnet:
|
|
2706
|
+
name: z19.string(),
|
|
2707
|
+
testnet: z19.boolean()
|
|
2449
2708
|
})
|
|
2450
2709
|
)
|
|
2451
2710
|
});
|
|
2452
|
-
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason:
|
|
2711
|
+
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason: z19.string().trim().min(1).max(500) }).strict();
|
|
2453
2712
|
var memberWalletSignInInputSchema = walletUnlinkInputSchema.extend({
|
|
2454
|
-
enabled:
|
|
2455
|
-
reason:
|
|
2713
|
+
enabled: z19.boolean(),
|
|
2714
|
+
reason: z19.string().trim().min(1).max(500)
|
|
2456
2715
|
}).strict();
|
|
2457
|
-
var telegramBotIdSchema =
|
|
2458
|
-
var participantSignInSchema =
|
|
2459
|
-
providers:
|
|
2460
|
-
|
|
2716
|
+
var telegramBotIdSchema = z19.string().regex(/^[1-9][0-9]{0,19}$/, "Enter the bot's numeric ID, such as 123456789");
|
|
2717
|
+
var participantSignInSchema = z19.object({
|
|
2718
|
+
providers: z19.array(
|
|
2719
|
+
z19.object({ provider: authProviderSchema, configured: z19.boolean() })
|
|
2461
2720
|
),
|
|
2462
|
-
email:
|
|
2721
|
+
email: z19.boolean(),
|
|
2463
2722
|
/** Wallet families: `"solana"`, `"eip155"`, `"cosmos"`. */
|
|
2464
2723
|
wallets: walletSignInNetworksSchema,
|
|
2465
2724
|
/** Why participants cannot sign in to this project, or null. */
|
|
2466
|
-
issue:
|
|
2725
|
+
issue: z19.string().nullable(),
|
|
2467
2726
|
/**
|
|
2468
2727
|
* Telegram, outside `providers` in SDK 1.x: whether Domino configured Telegram Login, and the
|
|
2469
2728
|
* bot whose Mini App participants sign in from, or null when Mini App sign-in is off. Absent
|
|
2470
2729
|
* from Relay versions without Telegram.
|
|
2471
2730
|
*/
|
|
2472
|
-
telegram:
|
|
2473
|
-
login:
|
|
2731
|
+
telegram: z19.object({
|
|
2732
|
+
login: z19.boolean(),
|
|
2474
2733
|
miniAppBotId: telegramBotIdSchema.nullable()
|
|
2475
2734
|
}).optional(),
|
|
2476
|
-
|
|
2477
|
-
|
|
2735
|
+
/**
|
|
2736
|
+
* The creator-account providers, such as `youtube`, and whether Domino configured each, so
|
|
2737
|
+
* members can link accounts that trackers like `youtube.shorts()` read. Absent from older Relay
|
|
2738
|
+
* versions.
|
|
2739
|
+
*/
|
|
2740
|
+
creatorAccounts: z19.array(
|
|
2741
|
+
z19.object({
|
|
2742
|
+
provider: creatorAccountProviderSchema,
|
|
2743
|
+
configured: z19.boolean()
|
|
2744
|
+
})
|
|
2745
|
+
).optional(),
|
|
2746
|
+
updatedAt: z19.number().nullable(),
|
|
2747
|
+
updatedBy: z19.string().nullable()
|
|
2478
2748
|
});
|
|
2479
|
-
var participantSignInInputSchema =
|
|
2749
|
+
var participantSignInInputSchema = z19.object({
|
|
2480
2750
|
wallets: walletSignInNetworksSchema,
|
|
2481
|
-
telegram:
|
|
2751
|
+
telegram: z19.object({ miniAppBotId: telegramBotIdSchema.nullable() }).strict().optional()
|
|
2482
2752
|
}).strict();
|
|
2483
|
-
var completionRevocationShortfallSchema =
|
|
2753
|
+
var completionRevocationShortfallSchema = z19.object({
|
|
2484
2754
|
completion: identifier,
|
|
2485
2755
|
quest: identifier,
|
|
2486
|
-
revokedAt:
|
|
2487
|
-
unreversedPoints:
|
|
2756
|
+
revokedAt: z19.number().int().nonnegative().safe(),
|
|
2757
|
+
unreversedPoints: z19.record(identifier, z19.number().int().positive().safe())
|
|
2488
2758
|
});
|
|
2489
|
-
var
|
|
2759
|
+
var revokedCompletionSchema = z19.object({
|
|
2760
|
+
completion: identifier,
|
|
2761
|
+
quest: identifier,
|
|
2762
|
+
/** The completion key: its occurrence, such as `once` or a day. */
|
|
2763
|
+
key: z19.string(),
|
|
2764
|
+
revokedAt: z19.number().int().nonnegative().safe(),
|
|
2765
|
+
/** Why it was revoked, and what the revoke did, which a restore re-applies. */
|
|
2766
|
+
reason: z19.string().optional(),
|
|
2767
|
+
revocation: completionRevocationSchema.optional()
|
|
2768
|
+
});
|
|
2769
|
+
var memberDetailSchema = z19.object({
|
|
2490
2770
|
snapshot: snapshotSchema,
|
|
2491
2771
|
member: memberSchema,
|
|
2492
2772
|
progress: memberProgressSchema,
|
|
2493
2773
|
/** Up to 25 revoked completions with an unreversed point remainder, newest first. */
|
|
2494
|
-
revocationShortfalls:
|
|
2774
|
+
revocationShortfalls: z19.array(completionRevocationShortfallSchema).default([]),
|
|
2775
|
+
/** Up to 25 revoked completions, newest first. Relay older than restore leaves it out. */
|
|
2776
|
+
revokedCompletions: z19.array(revokedCompletionSchema).optional(),
|
|
2495
2777
|
/** Current and historical campaign enrollment state, including inactive enrollments. */
|
|
2496
|
-
campaignEnrollments:
|
|
2497
|
-
passes:
|
|
2498
|
-
|
|
2499
|
-
provider:
|
|
2500
|
-
event:
|
|
2501
|
-
subject:
|
|
2778
|
+
campaignEnrollments: z19.array(campaignEnrollmentSchema).default([]),
|
|
2779
|
+
passes: z19.array(
|
|
2780
|
+
z19.object({
|
|
2781
|
+
provider: z19.string(),
|
|
2782
|
+
event: z19.string(),
|
|
2783
|
+
subject: z19.string(),
|
|
2502
2784
|
attempt: identifier.nullable()
|
|
2503
2785
|
})
|
|
2504
2786
|
).default([]),
|
|
2505
2787
|
/** Linked and unlinked wallets. */
|
|
2506
|
-
wallets:
|
|
2788
|
+
wallets: z19.array(managedWalletSchema),
|
|
2507
2789
|
/** The member's 10 most recent recorded balance reads, newest first. */
|
|
2508
|
-
balanceChecks:
|
|
2790
|
+
balanceChecks: z19.array(balanceCheckSchema),
|
|
2509
2791
|
/** The member's participant profile in this project. */
|
|
2510
2792
|
profile: managedProfileSchema.nullable(),
|
|
2511
2793
|
/**
|
|
@@ -2513,11 +2795,16 @@ var memberDetailSchema = z18.object({
|
|
|
2513
2795
|
* member ID: their selected X and Discord accounts and their `app:<name>` identities in this
|
|
2514
2796
|
* project, including app identities an operator unlinked, by kind.
|
|
2515
2797
|
*/
|
|
2516
|
-
identities:
|
|
2798
|
+
identities: z19.array(managedMemberIdentitySchema),
|
|
2799
|
+
/**
|
|
2800
|
+
* The creator accounts the member linked (a YouTube channel), whose content managed tracker
|
|
2801
|
+
* sources attribute to them. Absent from Relay versions without creator accounts.
|
|
2802
|
+
*/
|
|
2803
|
+
creatorAccounts: z19.array(managedCreatorAccountSchema).optional()
|
|
2517
2804
|
});
|
|
2518
|
-
var managedMemberProgressSchema =
|
|
2805
|
+
var managedMemberProgressSchema = z19.object({
|
|
2519
2806
|
member: identifier,
|
|
2520
|
-
quests:
|
|
2807
|
+
quests: z19.array(
|
|
2521
2808
|
memberProgressSchema.shape.quests.element.extend({
|
|
2522
2809
|
/** The streak as `members.get` reports it, without the list of qualifying days. */
|
|
2523
2810
|
streak: streakProgressSchema.omit({ days: true }).nullable().optional()
|
|
@@ -2528,172 +2815,211 @@ var managedMemberProgressSchema = z18.object({
|
|
|
2528
2815
|
/** Each point balance the member has, by balance ID. */
|
|
2529
2816
|
balances: snapshotSchema.shape.balances
|
|
2530
2817
|
});
|
|
2531
|
-
var stockInputSchema =
|
|
2818
|
+
var stockInputSchema = z19.object({
|
|
2532
2819
|
item: identifier,
|
|
2533
|
-
quantity:
|
|
2820
|
+
quantity: z19.number().int().positive().max(1e6),
|
|
2534
2821
|
actionId: identifier
|
|
2535
2822
|
}).strict();
|
|
2536
|
-
var ingestTrackerScopeSchema =
|
|
2537
|
-
var tokenScopeInputSchema =
|
|
2538
|
-
var tokenInputSchema =
|
|
2539
|
-
name:
|
|
2823
|
+
var ingestTrackerScopeSchema = z19.array(identifier).min(1).max(100).nullable();
|
|
2824
|
+
var tokenScopeInputSchema = z19.object({ ingestTrackers: ingestTrackerScopeSchema }).strict();
|
|
2825
|
+
var tokenInputSchema = z19.object({
|
|
2826
|
+
name: z19.string().trim().min(1).max(80),
|
|
2540
2827
|
project: identifier,
|
|
2541
2828
|
environment: environmentSchema,
|
|
2542
|
-
permissions:
|
|
2829
|
+
permissions: z19.array(permissionSchema).min(1),
|
|
2543
2830
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
2544
|
-
days:
|
|
2831
|
+
days: z19.number().int().min(1).max(90).default(30)
|
|
2545
2832
|
}).strict();
|
|
2546
|
-
var tokenSchema =
|
|
2547
|
-
id:
|
|
2548
|
-
name:
|
|
2549
|
-
project:
|
|
2833
|
+
var tokenSchema = z19.object({
|
|
2834
|
+
id: z19.string(),
|
|
2835
|
+
name: z19.string(),
|
|
2836
|
+
project: z19.string(),
|
|
2550
2837
|
environment: environmentSchema,
|
|
2551
2838
|
permissions: permissionListSchema,
|
|
2552
2839
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
2553
|
-
expiresAt:
|
|
2840
|
+
expiresAt: z19.number()
|
|
2554
2841
|
});
|
|
2555
|
-
var issuedTokenSchema = tokenSchema.extend({ token:
|
|
2556
|
-
var serviceKeyInputSchema =
|
|
2557
|
-
name:
|
|
2558
|
-
permissions:
|
|
2842
|
+
var issuedTokenSchema = tokenSchema.extend({ token: z19.string() });
|
|
2843
|
+
var serviceKeyInputSchema = z19.object({
|
|
2844
|
+
name: z19.string().trim().min(1).max(80),
|
|
2845
|
+
permissions: z19.array(permissionSchema).min(1).refine(
|
|
2559
2846
|
(permissions) => !permissions.includes("access"),
|
|
2560
2847
|
"Service keys cannot hold the access permission"
|
|
2561
2848
|
),
|
|
2562
2849
|
/** Days until the first secret expires. Omit it for a key that never expires. */
|
|
2563
|
-
expiresInDays:
|
|
2850
|
+
expiresInDays: z19.number().int().min(1).max(3650).optional()
|
|
2564
2851
|
}).strict();
|
|
2565
|
-
var serviceKeySchema =
|
|
2566
|
-
id:
|
|
2567
|
-
organization:
|
|
2568
|
-
project:
|
|
2852
|
+
var serviceKeySchema = z19.object({
|
|
2853
|
+
id: z19.string().uuid(),
|
|
2854
|
+
organization: z19.string(),
|
|
2855
|
+
project: z19.string(),
|
|
2569
2856
|
environment: environmentSchema,
|
|
2570
|
-
name:
|
|
2857
|
+
name: z19.string(),
|
|
2571
2858
|
permissions: permissionListSchema,
|
|
2572
2859
|
/** The Clerk user ID of the administrator who created it. */
|
|
2573
|
-
createdBy:
|
|
2574
|
-
createdAt:
|
|
2860
|
+
createdBy: z19.string(),
|
|
2861
|
+
createdAt: z19.number(),
|
|
2575
2862
|
/** The latest use of any of its secrets, revoked ones included; null when none was used. */
|
|
2576
|
-
lastUsedAt:
|
|
2863
|
+
lastUsedAt: z19.number().nullable(),
|
|
2577
2864
|
/** Its working secrets, oldest first. Any of them authenticates the key. */
|
|
2578
|
-
secrets:
|
|
2865
|
+
secrets: z19.array(credentialSecretSchema)
|
|
2579
2866
|
});
|
|
2580
2867
|
var issuedServiceKeySchema = serviceKeySchema.extend({
|
|
2581
|
-
secret:
|
|
2582
|
-
token:
|
|
2868
|
+
secret: z19.string().uuid(),
|
|
2869
|
+
token: z19.string()
|
|
2870
|
+
});
|
|
2871
|
+
var automationKeyPermissionSchema = z19.enum([
|
|
2872
|
+
"read",
|
|
2873
|
+
"publish",
|
|
2874
|
+
"inventory",
|
|
2875
|
+
"points",
|
|
2876
|
+
"ingest",
|
|
2877
|
+
"enroll"
|
|
2878
|
+
]);
|
|
2879
|
+
var automationKeyInputSchema = z19.object({
|
|
2880
|
+
name: z19.string().trim().min(1).max(80),
|
|
2881
|
+
permissions: z19.array(automationKeyPermissionSchema).min(1),
|
|
2882
|
+
/** The projects it reaches. Omit it for every project of the organization, current and future. */
|
|
2883
|
+
projects: z19.array(identifier).min(1).max(100).optional(),
|
|
2884
|
+
/** Whether it may create projects. A project it creates joins its `projects` list. */
|
|
2885
|
+
createProjects: z19.boolean().default(false),
|
|
2886
|
+
/** Days until the first secret expires. Omit it for a key that never expires. */
|
|
2887
|
+
expiresInDays: z19.number().int().min(1).max(3650).optional()
|
|
2888
|
+
}).strict();
|
|
2889
|
+
var automationKeySchema = z19.object({
|
|
2890
|
+
id: z19.string().uuid(),
|
|
2891
|
+
organization: z19.string(),
|
|
2892
|
+
name: z19.string(),
|
|
2893
|
+
permissions: permissionListSchema,
|
|
2894
|
+
/** The projects it reaches; null for every project of the organization. */
|
|
2895
|
+
projects: z19.array(z19.string()).nullable(),
|
|
2896
|
+
createProjects: z19.boolean(),
|
|
2897
|
+
/** The Clerk user ID of the administrator who created it. */
|
|
2898
|
+
createdBy: z19.string(),
|
|
2899
|
+
createdAt: z19.number(),
|
|
2900
|
+
/** The latest use of any of its secrets, revoked ones included; null when none was used. */
|
|
2901
|
+
lastUsedAt: z19.number().nullable(),
|
|
2902
|
+
/** Its working secrets, oldest first. Any of them authenticates the key. */
|
|
2903
|
+
secrets: z19.array(credentialSecretSchema)
|
|
2904
|
+
});
|
|
2905
|
+
var issuedAutomationKeySchema = automationKeySchema.extend({
|
|
2906
|
+
secret: z19.string().uuid(),
|
|
2907
|
+
token: z19.string()
|
|
2583
2908
|
});
|
|
2584
|
-
var teamSchema =
|
|
2585
|
-
|
|
2909
|
+
var teamSchema = z19.array(
|
|
2910
|
+
z19.object({ id: z19.string(), label: z19.string() })
|
|
2586
2911
|
);
|
|
2587
|
-
var memberLookupSchema =
|
|
2588
|
-
provider:
|
|
2589
|
-
subject:
|
|
2912
|
+
var memberLookupSchema = z19.object({
|
|
2913
|
+
provider: z19.string().min(1).max(200),
|
|
2914
|
+
subject: z19.string().min(1).max(2048)
|
|
2590
2915
|
}).strict();
|
|
2591
|
-
var booleanQuery =
|
|
2592
|
-
|
|
2593
|
-
|
|
2916
|
+
var booleanQuery = z19.union([
|
|
2917
|
+
z19.boolean(),
|
|
2918
|
+
z19.enum(["true", "false"]).transform((v) => v === "true")
|
|
2594
2919
|
]);
|
|
2595
|
-
var managedMemberQuerySchema =
|
|
2596
|
-
q:
|
|
2920
|
+
var managedMemberQuerySchema = z19.strictObject({
|
|
2921
|
+
q: z19.string().max(200).optional(),
|
|
2597
2922
|
needsReview: booleanQuery.optional(),
|
|
2598
|
-
limit:
|
|
2923
|
+
limit: z19.coerce.number().int().min(1).max(100).optional(),
|
|
2599
2924
|
cursor: pageCursorSchema.optional()
|
|
2600
2925
|
});
|
|
2601
|
-
var managedMemberPageSchema =
|
|
2602
|
-
items:
|
|
2603
|
-
total:
|
|
2604
|
-
nextCursor:
|
|
2926
|
+
var managedMemberPageSchema = z19.object({
|
|
2927
|
+
items: z19.array(memberSchema),
|
|
2928
|
+
total: z19.number().int().nonnegative(),
|
|
2929
|
+
nextCursor: z19.string().nullable()
|
|
2605
2930
|
});
|
|
2606
|
-
var activeMemberMonthSchema =
|
|
2931
|
+
var activeMemberMonthSchema = z19.object({
|
|
2607
2932
|
/** `YYYY-MM`, in UTC. */
|
|
2608
|
-
month:
|
|
2609
|
-
activeMembers:
|
|
2933
|
+
month: z19.string(),
|
|
2934
|
+
activeMembers: z19.number().int().nonnegative()
|
|
2610
2935
|
});
|
|
2611
2936
|
var activeMemberUsageSchema = activeMemberMonthSchema.extend({
|
|
2612
|
-
plan:
|
|
2613
|
-
limit:
|
|
2614
|
-
history:
|
|
2937
|
+
plan: z19.string(),
|
|
2938
|
+
limit: z19.number().int().nonnegative().nullable(),
|
|
2939
|
+
history: z19.array(activeMemberMonthSchema)
|
|
2615
2940
|
});
|
|
2616
|
-
var realPeopleInTestUsageSchema =
|
|
2617
|
-
realPeople:
|
|
2618
|
-
plan:
|
|
2619
|
-
limit:
|
|
2620
|
-
enforced:
|
|
2941
|
+
var realPeopleInTestUsageSchema = z19.object({
|
|
2942
|
+
realPeople: z19.number().int().nonnegative(),
|
|
2943
|
+
plan: z19.string(),
|
|
2944
|
+
limit: z19.number().int().nonnegative(),
|
|
2945
|
+
enforced: z19.boolean()
|
|
2621
2946
|
});
|
|
2622
2947
|
var projectMetricsSchema = metricsSchema.extend({
|
|
2623
|
-
completionsByQuest:
|
|
2624
|
-
|
|
2948
|
+
completionsByQuest: z19.array(
|
|
2949
|
+
z19.object({ quest: identifier, completions: z19.number() })
|
|
2625
2950
|
)
|
|
2626
2951
|
});
|
|
2627
|
-
var pageLimit =
|
|
2628
|
-
var managedAttemptQuerySchema =
|
|
2629
|
-
q:
|
|
2952
|
+
var pageLimit = z19.coerce.number().int().min(1).max(100).optional();
|
|
2953
|
+
var managedAttemptQuerySchema = z19.strictObject({
|
|
2954
|
+
q: z19.string().max(200).optional(),
|
|
2630
2955
|
quest: identifier.optional(),
|
|
2631
|
-
status:
|
|
2956
|
+
status: z19.string().min(1).max(50).optional(),
|
|
2632
2957
|
limit: pageLimit,
|
|
2633
2958
|
cursor: pageCursorSchema.optional()
|
|
2634
2959
|
});
|
|
2635
|
-
var managedAttemptPageSchema =
|
|
2636
|
-
items:
|
|
2637
|
-
releases:
|
|
2638
|
-
people:
|
|
2639
|
-
total:
|
|
2640
|
-
nextCursor:
|
|
2960
|
+
var managedAttemptPageSchema = z19.object({
|
|
2961
|
+
items: z19.array(attemptSchema),
|
|
2962
|
+
releases: z19.array(publishedReleaseSchema),
|
|
2963
|
+
people: z19.array(personSchema),
|
|
2964
|
+
total: z19.number().int().nonnegative(),
|
|
2965
|
+
nextCursor: z19.string().nullable()
|
|
2641
2966
|
});
|
|
2642
|
-
var managedReleaseQuerySchema =
|
|
2967
|
+
var managedReleaseQuerySchema = z19.strictObject({
|
|
2643
2968
|
quest: identifier.optional(),
|
|
2644
2969
|
limit: pageLimit,
|
|
2645
2970
|
cursor: pageCursorSchema.optional()
|
|
2646
2971
|
});
|
|
2647
|
-
var managedReleasePageSchema =
|
|
2648
|
-
items:
|
|
2649
|
-
nextCursor:
|
|
2972
|
+
var managedReleasePageSchema = z19.object({
|
|
2973
|
+
items: z19.array(publishedReleaseSchema),
|
|
2974
|
+
nextCursor: z19.string().nullable()
|
|
2650
2975
|
});
|
|
2651
|
-
var managedAttemptSchema =
|
|
2976
|
+
var managedAttemptSchema = z19.object({
|
|
2652
2977
|
attempt: attemptSchema,
|
|
2653
2978
|
release: publishedReleaseSchema.nullable(),
|
|
2654
|
-
events:
|
|
2979
|
+
events: z19.array(eventSchema),
|
|
2980
|
+
supersededBy: z19.string().nullable().optional(),
|
|
2655
2981
|
person: personSchema
|
|
2656
2982
|
});
|
|
2657
|
-
var managedEntitlementQuerySchema =
|
|
2658
|
-
q:
|
|
2659
|
-
status:
|
|
2983
|
+
var managedEntitlementQuerySchema = z19.strictObject({
|
|
2984
|
+
q: z19.string().max(200).optional(),
|
|
2985
|
+
status: z19.string().min(1).max(50).optional(),
|
|
2660
2986
|
limit: pageLimit,
|
|
2661
2987
|
cursor: pageCursorSchema.optional()
|
|
2662
2988
|
});
|
|
2663
|
-
var managedEntitlementPageSchema =
|
|
2664
|
-
items:
|
|
2665
|
-
people:
|
|
2666
|
-
total:
|
|
2667
|
-
nextCursor:
|
|
2989
|
+
var managedEntitlementPageSchema = z19.object({
|
|
2990
|
+
items: z19.array(entitlementSchema),
|
|
2991
|
+
people: z19.array(personSchema),
|
|
2992
|
+
total: z19.number().int().nonnegative(),
|
|
2993
|
+
nextCursor: z19.string().nullable()
|
|
2668
2994
|
});
|
|
2669
|
-
var managedEntitlementSchema =
|
|
2995
|
+
var managedEntitlementSchema = z19.object({
|
|
2670
2996
|
entitlement: entitlementSchema,
|
|
2671
2997
|
person: personSchema
|
|
2672
2998
|
});
|
|
2673
2999
|
var managedStockItemSchema = inventorySchema.extend({
|
|
2674
|
-
offers:
|
|
3000
|
+
offers: z19.array(identifier)
|
|
2675
3001
|
});
|
|
2676
|
-
var auditQuerySchema =
|
|
2677
|
-
category:
|
|
2678
|
-
q:
|
|
3002
|
+
var auditQuerySchema = z19.strictObject({
|
|
3003
|
+
category: z19.enum(["reviews", "rewards", "configuration"]).optional(),
|
|
3004
|
+
q: z19.string().max(200).optional(),
|
|
2679
3005
|
limit: pageLimit,
|
|
2680
3006
|
cursor: pageCursorSchema.optional()
|
|
2681
3007
|
});
|
|
2682
3008
|
var auditListQuerySchema = auditQuerySchema.extend({
|
|
2683
|
-
category:
|
|
3009
|
+
category: z19.enum(["reviews", "rewards", "configuration", "test-members"]).optional()
|
|
2684
3010
|
});
|
|
2685
3011
|
var accessHistoryQuerySchema = auditQuerySchema.omit({
|
|
2686
3012
|
category: true
|
|
2687
3013
|
});
|
|
2688
|
-
var auditPageSchema =
|
|
2689
|
-
items:
|
|
2690
|
-
total:
|
|
2691
|
-
nextCursor:
|
|
3014
|
+
var auditPageSchema = z19.object({
|
|
3015
|
+
items: z19.array(auditRecordSchema),
|
|
3016
|
+
total: z19.number().int().nonnegative(),
|
|
3017
|
+
nextCursor: z19.string().nullable()
|
|
2692
3018
|
});
|
|
2693
|
-
var verifiedPassSchema =
|
|
3019
|
+
var verifiedPassSchema = z19.object({
|
|
2694
3020
|
provider: identifier,
|
|
2695
3021
|
event: identifier,
|
|
2696
|
-
subject:
|
|
3022
|
+
subject: z19.string().min(1).max(2048),
|
|
2697
3023
|
member: identifier,
|
|
2698
3024
|
quest: identifier
|
|
2699
3025
|
}).strict();
|
|
@@ -2729,7 +3055,7 @@ function clientFailure(error) {
|
|
|
2729
3055
|
return new ManagementError({
|
|
2730
3056
|
kind: "client",
|
|
2731
3057
|
code: ManagementErrorCode.InvalidInput,
|
|
2732
|
-
message: error instanceof
|
|
3058
|
+
message: error instanceof z19.ZodError ? `Invalid management request: ${z19.prettifyError(error)}` : error instanceof Error ? error.message : "Invalid management request",
|
|
2733
3059
|
cause: error
|
|
2734
3060
|
});
|
|
2735
3061
|
}
|
|
@@ -2767,7 +3093,7 @@ function managementClient(options) {
|
|
|
2767
3093
|
call
|
|
2768
3094
|
);
|
|
2769
3095
|
}
|
|
2770
|
-
const ok =
|
|
3096
|
+
const ok = z19.object({ ok: z19.literal(true) });
|
|
2771
3097
|
function pointHistory(member, ledger, query = {}, call) {
|
|
2772
3098
|
return get(
|
|
2773
3099
|
`/points/${identifier.parse(member)}/${identifier.parse(ledger)}/history${queryString(typeof query === "number" ? { before: query } : pageQuerySchema.parse(query))}`,
|
|
@@ -2837,6 +3163,31 @@ function managementClient(options) {
|
|
|
2837
3163
|
typeof target === "string" ? call : inputOrCall
|
|
2838
3164
|
);
|
|
2839
3165
|
}
|
|
3166
|
+
function setAppScheduleState(state3, inputOrCall, call) {
|
|
3167
|
+
const reasoned = call !== void 0 || inputOrCall !== void 0 && "reason" in inputOrCall;
|
|
3168
|
+
return request(
|
|
3169
|
+
"/schedules/state",
|
|
3170
|
+
appScheduleListSchema,
|
|
3171
|
+
appScheduleStateInputSchema.parse({
|
|
3172
|
+
...reasoned ? inputOrCall : {},
|
|
3173
|
+
state: state3
|
|
3174
|
+
}),
|
|
3175
|
+
"PUT",
|
|
3176
|
+
reasoned ? call : inputOrCall
|
|
3177
|
+
);
|
|
3178
|
+
}
|
|
3179
|
+
function archiveManagedGroup(verb) {
|
|
3180
|
+
function change(group, inputOrCall, call) {
|
|
3181
|
+
const reasoned = call !== void 0 || inputOrCall !== void 0 && "reason" in inputOrCall;
|
|
3182
|
+
return post(
|
|
3183
|
+
`/groups/${groupKey(group)}/${verb}`,
|
|
3184
|
+
managedGroupSchema,
|
|
3185
|
+
reasoned ? groupArchiveInputSchema.parse(inputOrCall) : {},
|
|
3186
|
+
reasoned ? call : inputOrCall
|
|
3187
|
+
);
|
|
3188
|
+
}
|
|
3189
|
+
return change;
|
|
3190
|
+
}
|
|
2840
3191
|
function archiveManagedPointLedger(ledger, inputOrCall, call) {
|
|
2841
3192
|
const input = inputOrCall && "reason" in inputOrCall ? resourceArchiveInputSchema.parse(withActionId(inputOrCall)) : {};
|
|
2842
3193
|
const options2 = inputOrCall && "reason" in inputOrCall ? call : inputOrCall;
|
|
@@ -2852,7 +3203,7 @@ function managementClient(options) {
|
|
|
2852
3203
|
const input = isInput ? inputOrCall ?? {} : {};
|
|
2853
3204
|
const options2 = isInput ? call : inputOrCall;
|
|
2854
3205
|
return post(
|
|
2855
|
-
`/webhooks/${
|
|
3206
|
+
`/webhooks/${z19.string().uuid().parse(id)}/rotate-secret`,
|
|
2856
3207
|
webhookSecretSchema,
|
|
2857
3208
|
webhookRotateInputSchema.parse(withActionId(input)),
|
|
2858
3209
|
options2
|
|
@@ -2900,8 +3251,8 @@ function managementClient(options) {
|
|
|
2900
3251
|
}
|
|
2901
3252
|
return exchange(
|
|
2902
3253
|
path,
|
|
2903
|
-
|
|
2904
|
-
status:
|
|
3254
|
+
z19.object({
|
|
3255
|
+
status: z19.number(),
|
|
2905
3256
|
operationId: identifier.optional(),
|
|
2906
3257
|
result: schema
|
|
2907
3258
|
}),
|
|
@@ -2914,22 +3265,25 @@ function managementClient(options) {
|
|
|
2914
3265
|
},
|
|
2915
3266
|
trackers: {
|
|
2916
3267
|
/**
|
|
2917
|
-
* Creates
|
|
2918
|
-
*
|
|
2919
|
-
*
|
|
2920
|
-
*
|
|
3268
|
+
* Creates a tracker as data in test, with the same validation as `defineTracker`; requires
|
|
3269
|
+
* `publish`. Name its source with `source`, such as `{ kind: "discord-messages", text: true }`,
|
|
3270
|
+
* or an X search with `query` alone. An X tracker's first collection searches from
|
|
3271
|
+
* `window.start`. Live refuses it with `promotion-required`: the tracker reaches live through
|
|
3272
|
+
* a promotion. A key a deployment already publishes is refused with `tracker-owned-by-code`.
|
|
2921
3273
|
*/
|
|
2922
3274
|
create: (input, call) => create(
|
|
2923
3275
|
"/trackers",
|
|
2924
3276
|
trackerStatusSchema,
|
|
2925
|
-
|
|
3277
|
+
managedTrackerCreateSchema,
|
|
2926
3278
|
input,
|
|
2927
3279
|
call
|
|
2928
3280
|
),
|
|
2929
3281
|
/**
|
|
2930
|
-
* Changes a tracker created with `create`, in test; fields left out keep their value.
|
|
2931
|
-
*
|
|
2932
|
-
*
|
|
3282
|
+
* Changes a tracker created with `create`, in test; fields left out keep their value. `source`
|
|
3283
|
+
* replaces the source's settings but never its kind (`validation-failed`). A new query or
|
|
3284
|
+
* window collects from now on and never searches the past, and turning Discord message text
|
|
3285
|
+
* off erases the text already stored. A tracker defined in code changes only through a
|
|
3286
|
+
* deployment (`tracker-owned-by-code`).
|
|
2933
3287
|
*/
|
|
2934
3288
|
update: (reference, input, call) => post(
|
|
2935
3289
|
`/trackers/${identifier.parse(reference)}/update`,
|
|
@@ -2956,7 +3310,7 @@ function managementClient(options) {
|
|
|
2956
3310
|
call
|
|
2957
3311
|
),
|
|
2958
3312
|
...resourceArchiveMethods("tracker"),
|
|
2959
|
-
list: (call) => get("/trackers",
|
|
3313
|
+
list: (call) => get("/trackers", z19.array(trackerStatusSchema), call),
|
|
2960
3314
|
get: (reference, call) => get(
|
|
2961
3315
|
`/trackers/${identifier.parse(reference)}`,
|
|
2962
3316
|
trackerStatusSchema,
|
|
@@ -3072,7 +3426,7 @@ function managementClient(options) {
|
|
|
3072
3426
|
engagementPublishSchema.parse(withActionId(input)),
|
|
3073
3427
|
call
|
|
3074
3428
|
),
|
|
3075
|
-
list: (call) => get("/engagement",
|
|
3429
|
+
list: (call) => get("/engagement", z19.array(engagementRuleSchema), call),
|
|
3076
3430
|
page: (input, call) => get(
|
|
3077
3431
|
"/engagement/history" + queryString(engagementPageQuerySchema.parse(input)),
|
|
3078
3432
|
engagementPageSchema,
|
|
@@ -3092,7 +3446,7 @@ function managementClient(options) {
|
|
|
3092
3446
|
)
|
|
3093
3447
|
},
|
|
3094
3448
|
badges: {
|
|
3095
|
-
list: (call) => get("/badges",
|
|
3449
|
+
list: (call) => get("/badges", z19.array(managedBadgeSchema), call),
|
|
3096
3450
|
create: (input, call) => create("/badges", managedBadgeSchema, createBadgeSchema, input, call),
|
|
3097
3451
|
update: (badge, input, call) => {
|
|
3098
3452
|
const body = badgePropertiesSchema.extend(badgeMutationSchema.shape).parse(withActionId(input));
|
|
@@ -3135,7 +3489,7 @@ function managementClient(options) {
|
|
|
3135
3489
|
},
|
|
3136
3490
|
pointLedgers: {
|
|
3137
3491
|
unarchive: (ledger, input, call) => archiveResource("point-ledger", ledger, false, input, call),
|
|
3138
|
-
list: (call) => get("/point-ledgers",
|
|
3492
|
+
list: (call) => get("/point-ledgers", z19.array(managedPointLedgerSchema), call),
|
|
3139
3493
|
/**
|
|
3140
3494
|
* Creates a point ledger, with a stable `key` when code refers to it; requires `publish`. In
|
|
3141
3495
|
* live, only a person in Console can create one.
|
|
@@ -3165,7 +3519,7 @@ function managementClient(options) {
|
|
|
3165
3519
|
},
|
|
3166
3520
|
points: {
|
|
3167
3521
|
/** @deprecated Use `pointLedgers.list()`, which reads the same ledgers. Removed in 2.0.0. */
|
|
3168
|
-
ledgers: (call) => get("/point-ledgers",
|
|
3522
|
+
ledgers: (call) => get("/point-ledgers", z19.array(managedPointLedgerSchema), call),
|
|
3169
3523
|
/** @deprecated Use `pointLedgers.create(input)`. Removed in 2.0.0. */
|
|
3170
3524
|
createLedger: createPointLedger,
|
|
3171
3525
|
/**
|
|
@@ -3203,7 +3557,7 @@ function managementClient(options) {
|
|
|
3203
3557
|
referralHistorySchema,
|
|
3204
3558
|
call
|
|
3205
3559
|
),
|
|
3206
|
-
list: (call) => get("/referrals",
|
|
3560
|
+
list: (call) => get("/referrals", z19.array(publishedReferralSchema), call),
|
|
3207
3561
|
participants: referralParticipants,
|
|
3208
3562
|
/**
|
|
3209
3563
|
* Suspends or restores a member's referral relationship, with a reason; requires `publish`.
|
|
@@ -3266,7 +3620,7 @@ function managementClient(options) {
|
|
|
3266
3620
|
},
|
|
3267
3621
|
leaderboards: {
|
|
3268
3622
|
...resourceArchiveMethods("leaderboard"),
|
|
3269
|
-
list: (call) => get("/leaderboards",
|
|
3623
|
+
list: (call) => get("/leaderboards", z19.array(publishedLeaderboardSchema), call),
|
|
3270
3624
|
standings: (board, input = {}, call) => {
|
|
3271
3625
|
const query = leaderboardQuerySchema.parse(input);
|
|
3272
3626
|
return get(
|
|
@@ -3280,13 +3634,13 @@ function managementClient(options) {
|
|
|
3280
3634
|
},
|
|
3281
3635
|
history: (board, call) => get(
|
|
3282
3636
|
`/leaderboards/${identifier.parse(board)}/history`,
|
|
3283
|
-
|
|
3637
|
+
z19.array(publishedLeaderboardSchema),
|
|
3284
3638
|
call
|
|
3285
3639
|
),
|
|
3286
3640
|
/** Current members of the board's exclusion group (`exclusionGroup`), by member ID. */
|
|
3287
3641
|
exclusions: (board, call) => get(
|
|
3288
3642
|
`/leaderboards/${identifier.parse(board)}/exclusions`,
|
|
3289
|
-
|
|
3643
|
+
z19.array(z19.object({ member: identifier })),
|
|
3290
3644
|
call
|
|
3291
3645
|
),
|
|
3292
3646
|
/**
|
|
@@ -3373,7 +3727,7 @@ function managementClient(options) {
|
|
|
3373
3727
|
),
|
|
3374
3728
|
settlements: (board, call) => get(
|
|
3375
3729
|
`/leaderboards/${identifier.parse(board)}/settlements`,
|
|
3376
|
-
|
|
3730
|
+
z19.array(leaderboardSettlementSummarySchema),
|
|
3377
3731
|
call
|
|
3378
3732
|
),
|
|
3379
3733
|
settlement: (settlement, call) => get(
|
|
@@ -3411,20 +3765,11 @@ function managementClient(options) {
|
|
|
3411
3765
|
),
|
|
3412
3766
|
/**
|
|
3413
3767
|
* Freezes a group's membership. Its members still count for prerequisites, leaderboards
|
|
3414
|
-
* and referral rules.
|
|
3768
|
+
* and referral rules. Pass `{ reason }` to record why in the audit log.
|
|
3415
3769
|
*/
|
|
3416
|
-
archive: (
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
{},
|
|
3420
|
-
call
|
|
3421
|
-
),
|
|
3422
|
-
unarchive: (group, call) => post(
|
|
3423
|
-
`/groups/${groupKey(group)}/unarchive`,
|
|
3424
|
-
managedGroupSchema,
|
|
3425
|
-
{},
|
|
3426
|
-
call
|
|
3427
|
-
),
|
|
3770
|
+
archive: archiveManagedGroup("archive"),
|
|
3771
|
+
/** Lets a group's membership change again, with an optional `{ reason }` for the audit log. */
|
|
3772
|
+
unarchive: archiveManagedGroup("unarchive"),
|
|
3428
3773
|
/** A group's current members by member ID. Pass `nextCursor` back as `cursor`. */
|
|
3429
3774
|
members: (group, query = {}, call) => get(
|
|
3430
3775
|
`/groups/${groupKey(group)}/members${queryString(groupPageQuerySchema.parse(query))}`,
|
|
@@ -3458,7 +3803,7 @@ function managementClient(options) {
|
|
|
3458
3803
|
*
|
|
3459
3804
|
* @deprecated Use `history`, which pages by `cursor` and `nextCursor`. Removed in 2.0.0.
|
|
3460
3805
|
*/
|
|
3461
|
-
list: (call) => get("/deployments",
|
|
3806
|
+
list: (call) => get("/deployments", z19.array(deploymentRecordSchema), call),
|
|
3462
3807
|
/**
|
|
3463
3808
|
* The project environment's deployments, newest first, one page at a time, with the two
|
|
3464
3809
|
* newest published deployments beside every page. Pass a page's `nextCursor` back as
|
|
@@ -3641,14 +3986,29 @@ function managementClient(options) {
|
|
|
3641
3986
|
call
|
|
3642
3987
|
),
|
|
3643
3988
|
/** The Stripe customer portal for the organization's cards, invoices and billing details. */
|
|
3644
|
-
portal: (call) => post("/billing/portal", billingSessionSchema, {}, call)
|
|
3989
|
+
portal: (call) => post("/billing/portal", billingSessionSchema, {}, call),
|
|
3990
|
+
/**
|
|
3991
|
+
* The organization's billing for any of its members: each project's plan and subscription,
|
|
3992
|
+
* the Free projects against their limit, the shared free AI allowance and the trial.
|
|
3993
|
+
*/
|
|
3994
|
+
organization: (call) => get("/organization/billing", organizationBillingSchema, call),
|
|
3995
|
+
/**
|
|
3996
|
+
* The customer portal, as `portal()` opens it, returning to the organization's billing page in
|
|
3997
|
+
* Console rather than a project's.
|
|
3998
|
+
*/
|
|
3999
|
+
organizationPortal: (call) => post("/organization/billing/portal", billingSessionSchema, {}, call)
|
|
3645
4000
|
},
|
|
3646
4001
|
/** What the project uses against its plan; requires `read` permission. */
|
|
3647
4002
|
usage: {
|
|
3648
4003
|
/** Live active members this UTC month, the plan's limit, and the previous six months. */
|
|
3649
4004
|
activeMembers: (call) => get("/usage/active-members", activeMemberUsageSchema, call),
|
|
3650
4005
|
/** Real people in the test environment, against the plan's limit. */
|
|
3651
|
-
realPeopleInTest: (call) => get("/usage/real-people-in-test", realPeopleInTestUsageSchema, call)
|
|
4006
|
+
realPeopleInTest: (call) => get("/usage/real-people-in-test", realPeopleInTestUsageSchema, call),
|
|
4007
|
+
/**
|
|
4008
|
+
* The project's plan and where it came from, whether it may serve live, the organization's
|
|
4009
|
+
* trial, the AI builder balance and the Stripe subscription.
|
|
4010
|
+
*/
|
|
4011
|
+
plan: (call) => get("/usage/plan", projectPlanSchema, call)
|
|
3652
4012
|
},
|
|
3653
4013
|
/** The project's headline counts; requires `read` permission. */
|
|
3654
4014
|
metrics: {
|
|
@@ -3811,6 +4171,24 @@ function managementClient(options) {
|
|
|
3811
4171
|
staffDecisionSchema.parse(withActionId(input)),
|
|
3812
4172
|
call
|
|
3813
4173
|
),
|
|
4174
|
+
/**
|
|
4175
|
+
* Accepts a rejected attempt anyway, with a reason, for any member; requires `review`
|
|
4176
|
+
* permission. The evaluator's or a reviewer's rejection stays in the attempt's events, its
|
|
4177
|
+
* retry cooldown ends, and the acceptance pays as a reviewer's approval would, with the
|
|
4178
|
+
* normal accepted events and webhook. Only the member's latest attempt on a quest that isn't
|
|
4179
|
+
* archived (409 `attempt-superseded`, `quest-archived`); a cap the acceptance would break is
|
|
4180
|
+
* refused, not bypassed (409 `completion-cooldown`, `budget-exhausted`, `completion-revoked`,
|
|
4181
|
+
* `already-completed`). Replaying the action ID returns the first result.
|
|
4182
|
+
*/
|
|
4183
|
+
acceptAnyway: (input, call) => {
|
|
4184
|
+
const { attempt, ...body } = input;
|
|
4185
|
+
return post(
|
|
4186
|
+
`/attempts/${identifier.parse(attempt)}/accept-anyway`,
|
|
4187
|
+
attemptSchema,
|
|
4188
|
+
acceptAnywaySchema.parse(withActionId(body)),
|
|
4189
|
+
call
|
|
4190
|
+
);
|
|
4191
|
+
},
|
|
3814
4192
|
/** Evaluates a failed attempt again under a new generation; requires `review` permission. */
|
|
3815
4193
|
retry: (attempt, call) => post(
|
|
3816
4194
|
`/attempts/${identifier.parse(attempt)}/retry`,
|
|
@@ -3850,6 +4228,26 @@ function managementClient(options) {
|
|
|
3850
4228
|
completionRevokeSchema.parse(withActionId(body)),
|
|
3851
4229
|
call
|
|
3852
4230
|
);
|
|
4231
|
+
},
|
|
4232
|
+
/**
|
|
4233
|
+
* Restores a revoked completion with a reason; requires `review` permission. In one
|
|
4234
|
+
* transaction it clears the revocation and re-applies what the revocation recorded: awards
|
|
4235
|
+
* back the points it reversed (not those it could not reverse), re-awards its badges, re-adds
|
|
4236
|
+
* its group memberships, restores the tiered rewards it voided and raises those it lowered,
|
|
4237
|
+
* queues its stopped Discord role grants again, re-qualifies its referrals, and restores a
|
|
4238
|
+
* streak milestone. Budgets stay spent. Fails with 409 `completion-not-revoked` when the
|
|
4239
|
+
* completion counts already, and with 409 `occurrence-taken` when the revocation freed the
|
|
4240
|
+
* occurrence and another completion holds it now. Replaying the action ID returns the first
|
|
4241
|
+
* result.
|
|
4242
|
+
*/
|
|
4243
|
+
restore: (input, call) => {
|
|
4244
|
+
const { completion, ...body } = input;
|
|
4245
|
+
return post(
|
|
4246
|
+
`/completions/${identifier.parse(completion)}/restore`,
|
|
4247
|
+
completionRestorationSchema,
|
|
4248
|
+
completionRestoreSchema.parse(withActionId(body)),
|
|
4249
|
+
call
|
|
4250
|
+
);
|
|
3853
4251
|
}
|
|
3854
4252
|
},
|
|
3855
4253
|
/** Staff handover of a member's reward entitlement; requires `handover` permission. */
|
|
@@ -3911,6 +4309,20 @@ function managementClient(options) {
|
|
|
3911
4309
|
entitlementCorrectionSchema.parse(withActionId(input)),
|
|
3912
4310
|
call
|
|
3913
4311
|
),
|
|
4312
|
+
/**
|
|
4313
|
+
* Restores an entitlement an operator voided, at the `revision` the operator saw, with a
|
|
4314
|
+
* reason. It is available again at the tier an accepted completion still earns, with any
|
|
4315
|
+
* referral review the void settled. Fails with 409 `entitlement-status` when it isn't void;
|
|
4316
|
+
* when a completion revocation voided it, or no accepted completion still earns it, with the
|
|
4317
|
+
* revoked `completion` to restore instead; when canceling a redemption voided it; and for a
|
|
4318
|
+
* referral reward voided before voids kept their referral reviews.
|
|
4319
|
+
*/
|
|
4320
|
+
restore: (entitlement, input, call) => post(
|
|
4321
|
+
`/entitlements/${identifier.parse(entitlement)}/restore`,
|
|
4322
|
+
entitlementSchema,
|
|
4323
|
+
entitlementCorrectionSchema.parse(withActionId(input)),
|
|
4324
|
+
call
|
|
4325
|
+
),
|
|
3914
4326
|
/**
|
|
3915
4327
|
* Corrects a collection recorded by mistake, at the `revision` the operator saw, with a
|
|
3916
4328
|
* reason. The entitlement is available again and any pickup size it held returns to stock.
|
|
@@ -3938,7 +4350,7 @@ function managementClient(options) {
|
|
|
3938
4350
|
},
|
|
3939
4351
|
operations: {
|
|
3940
4352
|
/** Every paused or resumed operation: redemptions and each quest's participation; requires `read`. */
|
|
3941
|
-
list: (call) => get("/operations",
|
|
4353
|
+
list: (call) => get("/operations", z19.array(operationSchema), call),
|
|
3942
4354
|
/**
|
|
3943
4355
|
* Pauses or resumes redemptions or one quest's participation, against the `revision` the
|
|
3944
4356
|
* operator saw, with a reason; requires `publish` permission.
|
|
@@ -3996,7 +4408,7 @@ function managementClient(options) {
|
|
|
3996
4408
|
call
|
|
3997
4409
|
),
|
|
3998
4410
|
/** Every stock item with its counts and the offers that sell it; requires `read` permission. */
|
|
3999
|
-
list: (call) => get("/stock-items",
|
|
4411
|
+
list: (call) => get("/stock-items", z19.array(managedStockItemSchema), call),
|
|
4000
4412
|
createItem: (input, call) => create(
|
|
4001
4413
|
"/stock-items",
|
|
4002
4414
|
stockItemSchema,
|
|
@@ -4011,7 +4423,7 @@ function managementClient(options) {
|
|
|
4011
4423
|
stockInputSchema.parse(withActionId(input)),
|
|
4012
4424
|
call
|
|
4013
4425
|
),
|
|
4014
|
-
catalog: (call) => get("/pickup-inventory",
|
|
4426
|
+
catalog: (call) => get("/pickup-inventory", z19.array(pickupCatalogSchema), call),
|
|
4015
4427
|
configure: (input, call) => post(
|
|
4016
4428
|
"/pickup-inventory",
|
|
4017
4429
|
pickupCatalogSchema,
|
|
@@ -4037,7 +4449,7 @@ function managementClient(options) {
|
|
|
4037
4449
|
offerControlSchema.omit({ enabled: true }).parse(withActionId(input)),
|
|
4038
4450
|
call
|
|
4039
4451
|
),
|
|
4040
|
-
list: (call) => get("/offers",
|
|
4452
|
+
list: (call) => get("/offers", z19.array(offerSchema), call),
|
|
4041
4453
|
/**
|
|
4042
4454
|
* Every redemption, or one member's, newest first, in one unbounded response.
|
|
4043
4455
|
*
|
|
@@ -4045,7 +4457,7 @@ function managementClient(options) {
|
|
|
4045
4457
|
*/
|
|
4046
4458
|
redemptions: (input = {}, call) => get(
|
|
4047
4459
|
`/redemptions${queryString({ member: input.member })}`,
|
|
4048
|
-
|
|
4460
|
+
z19.array(redemptionSchema),
|
|
4049
4461
|
call
|
|
4050
4462
|
),
|
|
4051
4463
|
/** Pauses or resumes an offer at the revision the operator saw. */
|
|
@@ -4066,7 +4478,7 @@ function managementClient(options) {
|
|
|
4066
4478
|
},
|
|
4067
4479
|
readiness: (call) => get("/readiness", readinessSchema, call),
|
|
4068
4480
|
access: (call) => get("/access", accessSchema, call),
|
|
4069
|
-
createProject: (input, call) => create("/projects", projectSchema,
|
|
4481
|
+
createProject: (input, call) => create("/projects", projectSchema, projectCreateInputSchema, input, call),
|
|
4070
4482
|
updateProject: (input, call) => request(
|
|
4071
4483
|
"/project",
|
|
4072
4484
|
projectSchema,
|
|
@@ -4094,7 +4506,7 @@ function managementClient(options) {
|
|
|
4094
4506
|
* them; API keys and project-scoped playground sessions cannot.
|
|
4095
4507
|
*/
|
|
4096
4508
|
tokens: {
|
|
4097
|
-
list: (call) => get("/tokens",
|
|
4509
|
+
list: (call) => get("/tokens", z19.array(tokenSchema), call),
|
|
4098
4510
|
/**
|
|
4099
4511
|
* Issues a key for one project and environment, limited to permissions the caller holds
|
|
4100
4512
|
* there. The secret `token` is in this response only.
|
|
@@ -4102,14 +4514,14 @@ function managementClient(options) {
|
|
|
4102
4514
|
create: (input, call) => post("/tokens", issuedTokenSchema, tokenInputSchema.parse(input), call),
|
|
4103
4515
|
/** Replace a personal key's ingestion restriction without changing its secret. */
|
|
4104
4516
|
scope: (id, input, call) => request(
|
|
4105
|
-
`/tokens/${encodeURIComponent(
|
|
4517
|
+
`/tokens/${encodeURIComponent(z19.string().min(1).parse(id))}/scope`,
|
|
4106
4518
|
tokenSchema,
|
|
4107
4519
|
tokenScopeInputSchema.parse(input),
|
|
4108
4520
|
"PUT",
|
|
4109
4521
|
call
|
|
4110
4522
|
),
|
|
4111
4523
|
revoke: (id, call) => request(
|
|
4112
|
-
`/tokens/${encodeURIComponent(
|
|
4524
|
+
`/tokens/${encodeURIComponent(z19.string().min(1).parse(id))}`,
|
|
4113
4525
|
ok,
|
|
4114
4526
|
void 0,
|
|
4115
4527
|
"DELETE",
|
|
@@ -4121,7 +4533,7 @@ function managementClient(options) {
|
|
|
4121
4533
|
* environment, owned by no person. Only an organization administrator in Console manages them.
|
|
4122
4534
|
*/
|
|
4123
4535
|
serviceKeys: {
|
|
4124
|
-
list: (call) => get("/service-keys",
|
|
4536
|
+
list: (call) => get("/service-keys", z19.array(serviceKeySchema), call),
|
|
4125
4537
|
/** The secret `token` is in this response only. */
|
|
4126
4538
|
create: (input, call) => post(
|
|
4127
4539
|
"/service-keys",
|
|
@@ -4134,14 +4546,14 @@ function managementClient(options) {
|
|
|
4134
4546
|
* them with `revokeSecret`. The new `token` is in this response only.
|
|
4135
4547
|
*/
|
|
4136
4548
|
addSecret: (id, input = {}, call) => post(
|
|
4137
|
-
`/service-keys/${
|
|
4549
|
+
`/service-keys/${z19.string().uuid().parse(id)}/secrets`,
|
|
4138
4550
|
issuedServiceKeySchema,
|
|
4139
4551
|
credentialSecretInputSchema.parse(input),
|
|
4140
4552
|
call
|
|
4141
4553
|
),
|
|
4142
4554
|
/** Stops one secret working. A key's last secret cannot be revoked; revoke the key instead. */
|
|
4143
4555
|
revokeSecret: (id, secret, call) => request(
|
|
4144
|
-
`/service-keys/${
|
|
4556
|
+
`/service-keys/${z19.string().uuid().parse(id)}/secrets/${z19.string().uuid().parse(secret)}`,
|
|
4145
4557
|
serviceKeySchema,
|
|
4146
4558
|
void 0,
|
|
4147
4559
|
"DELETE",
|
|
@@ -4149,8 +4561,49 @@ function managementClient(options) {
|
|
|
4149
4561
|
),
|
|
4150
4562
|
/** Deletes the key; every secret stops working. */
|
|
4151
4563
|
revoke: (id, call) => request(
|
|
4152
|
-
`/service-keys/${
|
|
4153
|
-
|
|
4564
|
+
`/service-keys/${z19.string().uuid().parse(id)}`,
|
|
4565
|
+
z19.null(),
|
|
4566
|
+
void 0,
|
|
4567
|
+
"DELETE",
|
|
4568
|
+
call
|
|
4569
|
+
)
|
|
4570
|
+
},
|
|
4571
|
+
/**
|
|
4572
|
+
* Organization automation keys (`dak_`): credentials for a headless agent or CI across the
|
|
4573
|
+
* organization's projects, owned by no person. They write in test only. Only an organization
|
|
4574
|
+
* administrator in Console manages them.
|
|
4575
|
+
*/
|
|
4576
|
+
automationKeys: {
|
|
4577
|
+
list: (call) => get("/automation-keys", z19.array(automationKeySchema), call),
|
|
4578
|
+
/** The secret `token` is in this response only. */
|
|
4579
|
+
create: (input, call) => post(
|
|
4580
|
+
"/automation-keys",
|
|
4581
|
+
issuedAutomationKeySchema,
|
|
4582
|
+
automationKeyInputSchema.parse(input),
|
|
4583
|
+
call
|
|
4584
|
+
),
|
|
4585
|
+
/**
|
|
4586
|
+
* Rotation: issues another secret. The key's other secrets keep working until you revoke
|
|
4587
|
+
* them with `revokeSecret`. The new `token` is in this response only.
|
|
4588
|
+
*/
|
|
4589
|
+
addSecret: (id, input = {}, call) => post(
|
|
4590
|
+
`/automation-keys/${z19.string().uuid().parse(id)}/secrets`,
|
|
4591
|
+
issuedAutomationKeySchema,
|
|
4592
|
+
credentialSecretInputSchema.parse(input),
|
|
4593
|
+
call
|
|
4594
|
+
),
|
|
4595
|
+
/** Stops one secret working. A key's last secret cannot be revoked; revoke the key instead. */
|
|
4596
|
+
revokeSecret: (id, secret, call) => request(
|
|
4597
|
+
`/automation-keys/${z19.string().uuid().parse(id)}/secrets/${z19.string().uuid().parse(secret)}`,
|
|
4598
|
+
automationKeySchema,
|
|
4599
|
+
void 0,
|
|
4600
|
+
"DELETE",
|
|
4601
|
+
call
|
|
4602
|
+
),
|
|
4603
|
+
/** Deletes the key; every secret stops working. */
|
|
4604
|
+
revoke: (id, call) => request(
|
|
4605
|
+
`/automation-keys/${z19.string().uuid().parse(id)}`,
|
|
4606
|
+
z19.null(),
|
|
4154
4607
|
void 0,
|
|
4155
4608
|
"DELETE",
|
|
4156
4609
|
call
|
|
@@ -4158,7 +4611,7 @@ function managementClient(options) {
|
|
|
4158
4611
|
},
|
|
4159
4612
|
/** Who holds which roles on the client's project; organization administrators only. */
|
|
4160
4613
|
grants: {
|
|
4161
|
-
list: (call) => get("/grants",
|
|
4614
|
+
list: (call) => get("/grants", z19.array(grantRecordSchema), call),
|
|
4162
4615
|
/** Replaces one person's roles and environments on the project. The audit log records it. */
|
|
4163
4616
|
set: (input, call) => request(
|
|
4164
4617
|
"/grants",
|
|
@@ -4175,7 +4628,7 @@ function managementClient(options) {
|
|
|
4175
4628
|
/** Signed activity notifications for one project/environment; writes require publish permission. */
|
|
4176
4629
|
webhooks: {
|
|
4177
4630
|
state: (id, call) => get(
|
|
4178
|
-
`/webhooks/${
|
|
4631
|
+
`/webhooks/${z19.string().uuid().parse(id)}/state`,
|
|
4179
4632
|
webhookEndpointStateSchema,
|
|
4180
4633
|
call
|
|
4181
4634
|
),
|
|
@@ -4186,24 +4639,24 @@ function managementClient(options) {
|
|
|
4186
4639
|
call
|
|
4187
4640
|
),
|
|
4188
4641
|
delete: (id, input, call) => post(
|
|
4189
|
-
`/webhooks/${
|
|
4642
|
+
`/webhooks/${z19.string().uuid().parse(id)}/delete`,
|
|
4190
4643
|
webhookEndpointStateSchema,
|
|
4191
4644
|
webhookDeleteInputSchema.parse(withActionId(input)),
|
|
4192
4645
|
call
|
|
4193
4646
|
),
|
|
4194
4647
|
pause: (id, input = {}, call) => post(
|
|
4195
|
-
`/webhooks/${
|
|
4648
|
+
`/webhooks/${z19.string().uuid().parse(id)}/pause`,
|
|
4196
4649
|
webhookEndpointSchema,
|
|
4197
4650
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
4198
4651
|
call
|
|
4199
4652
|
),
|
|
4200
4653
|
resume: (id, input = {}, call) => post(
|
|
4201
|
-
`/webhooks/${
|
|
4654
|
+
`/webhooks/${z19.string().uuid().parse(id)}/resume`,
|
|
4202
4655
|
webhookEndpointSchema,
|
|
4203
4656
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
4204
4657
|
call
|
|
4205
4658
|
),
|
|
4206
|
-
list: (call) => get("/webhooks",
|
|
4659
|
+
list: (call) => get("/webhooks", z19.array(webhookEndpointSchema), call),
|
|
4207
4660
|
/** Pass an `actionId` to recover the endpoint and its secret after a lost answer. */
|
|
4208
4661
|
create: (input, call) => post(
|
|
4209
4662
|
"/webhooks",
|
|
@@ -4212,7 +4665,7 @@ function managementClient(options) {
|
|
|
4212
4665
|
call
|
|
4213
4666
|
),
|
|
4214
4667
|
update: (id, input, call) => request(
|
|
4215
|
-
`/webhooks/${
|
|
4668
|
+
`/webhooks/${z19.string().uuid().parse(id)}`,
|
|
4216
4669
|
webhookEndpointSchema,
|
|
4217
4670
|
webhookUpdateSchema.parse(input),
|
|
4218
4671
|
"PUT",
|
|
@@ -4220,19 +4673,19 @@ function managementClient(options) {
|
|
|
4220
4673
|
),
|
|
4221
4674
|
/** @deprecated Use pause. Removed in 2.0.0. */
|
|
4222
4675
|
disable: (id, call) => post(
|
|
4223
|
-
`/webhooks/${
|
|
4676
|
+
`/webhooks/${z19.string().uuid().parse(id)}/disable`,
|
|
4224
4677
|
webhookEndpointSchema,
|
|
4225
4678
|
{},
|
|
4226
4679
|
call
|
|
4227
4680
|
),
|
|
4228
4681
|
rotateSecret: rotateWebhookSecret,
|
|
4229
4682
|
deliveries: (id, query = {}, call) => get(
|
|
4230
|
-
`/webhooks/${
|
|
4683
|
+
`/webhooks/${z19.string().uuid().parse(id)}/deliveries${queryString(webhookQuerySchema.parse(query))}`,
|
|
4231
4684
|
webhookDeliveryPageSchema,
|
|
4232
4685
|
call
|
|
4233
4686
|
),
|
|
4234
4687
|
replay: (id, delivery, call) => post(
|
|
4235
|
-
`/webhooks/${
|
|
4688
|
+
`/webhooks/${z19.string().uuid().parse(id)}/deliveries/${z19.string().uuid().parse(delivery)}/replay`,
|
|
4236
4689
|
webhookDeliverySchema,
|
|
4237
4690
|
{},
|
|
4238
4691
|
call
|
|
@@ -4243,7 +4696,7 @@ function managementClient(options) {
|
|
|
4243
4696
|
* environment. Organization administrators, from a Console session only.
|
|
4244
4697
|
*/
|
|
4245
4698
|
identityIntegrations: {
|
|
4246
|
-
list: (call) => get("/identity-integrations",
|
|
4699
|
+
list: (call) => get("/identity-integrations", z19.array(identityIntegrationSchema), call),
|
|
4247
4700
|
/** The secret `token` is in this response only. */
|
|
4248
4701
|
create: (input, call) => post(
|
|
4249
4702
|
"/identity-integrations",
|
|
@@ -4258,7 +4711,7 @@ function managementClient(options) {
|
|
|
4258
4711
|
* @deprecated Use `addSecret`, then `revokeSecret` the old secret once your app uses the new one.
|
|
4259
4712
|
*/
|
|
4260
4713
|
rotate: (id, call) => post(
|
|
4261
|
-
`/identity-integrations/${
|
|
4714
|
+
`/identity-integrations/${z19.string().uuid().parse(id)}/rotate`,
|
|
4262
4715
|
identityIntegrationSecretSchema,
|
|
4263
4716
|
{},
|
|
4264
4717
|
call
|
|
@@ -4268,7 +4721,7 @@ function managementClient(options) {
|
|
|
4268
4721
|
* revoke them with `revokeSecret`. The new `token` is in this response only.
|
|
4269
4722
|
*/
|
|
4270
4723
|
addSecret: (id, input = {}, call) => post(
|
|
4271
|
-
`/identity-integrations/${
|
|
4724
|
+
`/identity-integrations/${z19.string().uuid().parse(id)}/secrets`,
|
|
4272
4725
|
identityIntegrationSecretSchema,
|
|
4273
4726
|
credentialSecretInputSchema.parse(input),
|
|
4274
4727
|
call
|
|
@@ -4278,7 +4731,7 @@ function managementClient(options) {
|
|
|
4278
4731
|
* revoked; disconnect the integration with `revoke` instead.
|
|
4279
4732
|
*/
|
|
4280
4733
|
revokeSecret: (id, secret, call) => request(
|
|
4281
|
-
`/identity-integrations/${
|
|
4734
|
+
`/identity-integrations/${z19.string().uuid().parse(id)}/secrets/${z19.string().uuid().parse(secret)}`,
|
|
4282
4735
|
identityIntegrationSchema,
|
|
4283
4736
|
void 0,
|
|
4284
4737
|
"DELETE",
|
|
@@ -4286,7 +4739,7 @@ function managementClient(options) {
|
|
|
4286
4739
|
),
|
|
4287
4740
|
/** Makes one secret never expire. */
|
|
4288
4741
|
removeSecretExpiry: (id, secret, call) => request(
|
|
4289
|
-
`/identity-integrations/${
|
|
4742
|
+
`/identity-integrations/${z19.string().uuid().parse(id)}/secrets/${z19.string().uuid().parse(secret)}/expiry`,
|
|
4290
4743
|
identityIntegrationSchema,
|
|
4291
4744
|
void 0,
|
|
4292
4745
|
"DELETE",
|
|
@@ -4299,7 +4752,7 @@ function managementClient(options) {
|
|
|
4299
4752
|
*/
|
|
4300
4753
|
kinds: (call) => get(
|
|
4301
4754
|
"/identity-integrations/kinds",
|
|
4302
|
-
|
|
4755
|
+
z19.array(identityKindClaimSchema),
|
|
4303
4756
|
call
|
|
4304
4757
|
),
|
|
4305
4758
|
/**
|
|
@@ -4307,8 +4760,8 @@ function managementClient(options) {
|
|
|
4307
4760
|
* and keep attributing tracker records; unlink them on the member to stop that.
|
|
4308
4761
|
*/
|
|
4309
4762
|
revoke: (id, call) => request(
|
|
4310
|
-
`/identity-integrations/${
|
|
4311
|
-
|
|
4763
|
+
`/identity-integrations/${z19.string().uuid().parse(id)}`,
|
|
4764
|
+
z19.null(),
|
|
4312
4765
|
void 0,
|
|
4313
4766
|
"DELETE",
|
|
4314
4767
|
call
|
|
@@ -4359,7 +4812,7 @@ function managementClient(options) {
|
|
|
4359
4812
|
resources: {
|
|
4360
4813
|
list: (call) => get(
|
|
4361
4814
|
"/resources",
|
|
4362
|
-
|
|
4815
|
+
z19.object({ resources: z19.array(managedResourceSchema) }),
|
|
4363
4816
|
call
|
|
4364
4817
|
),
|
|
4365
4818
|
/** @deprecated Use the resource archive/unarchive methods. Removed in 2.0.0. */
|
|
@@ -4399,6 +4852,12 @@ function managementClient(options) {
|
|
|
4399
4852
|
),
|
|
4400
4853
|
/** Operations of the Discord role reward kind on assignments it delivered. */
|
|
4401
4854
|
discordRoles: {
|
|
4855
|
+
/**
|
|
4856
|
+
* Every Discord role the project's reward deliveries grant in this environment, with the
|
|
4857
|
+
* quests that requested it and its deliveries counted by status. Unlike `rewardDeliveries`,
|
|
4858
|
+
* it covers the whole history, so a role granted only long ago still appears.
|
|
4859
|
+
*/
|
|
4860
|
+
list: (call) => get("/reward-deliveries/roles", discordRoleRewardsSchema, call),
|
|
4402
4861
|
/**
|
|
4403
4862
|
* Hands the role assignment a delivery made to an external administrator or bot: Relay stops
|
|
4404
4863
|
* removing it automatically, in every project and environment that shares the assignment.
|
|
@@ -4430,7 +4889,7 @@ function managementClient(options) {
|
|
|
4430
4889
|
testMemberCreateSchema.parse(withActionId(input)),
|
|
4431
4890
|
call
|
|
4432
4891
|
),
|
|
4433
|
-
list: (call) => get("/test-members",
|
|
4892
|
+
list: (call) => get("/test-members", z19.array(testMemberSchema), call),
|
|
4434
4893
|
history: (member, query = {}, call) => get(
|
|
4435
4894
|
`/test-members/${identifier.parse(member)}/history${queryString(testMemberHistoryQuerySchema.parse(query))}`,
|
|
4436
4895
|
testMemberHistorySchema,
|
|
@@ -4714,7 +5173,7 @@ function managementClient(options) {
|
|
|
4714
5173
|
/** Who each member is: up to 100 distinct IDs; unknown IDs come back without accounts. */
|
|
4715
5174
|
people: (members, call) => get(
|
|
4716
5175
|
`/people${queryString({ ids: members.join(",") })}`,
|
|
4717
|
-
|
|
5176
|
+
z19.array(personSchema),
|
|
4718
5177
|
call
|
|
4719
5178
|
),
|
|
4720
5179
|
/**
|
|
@@ -4724,7 +5183,7 @@ function managementClient(options) {
|
|
|
4724
5183
|
*/
|
|
4725
5184
|
oauthAccounts: (member, call) => get(
|
|
4726
5185
|
`/members/${encodeURIComponent(member)}/oauth-accounts`,
|
|
4727
|
-
|
|
5186
|
+
z19.array(managedOAuthAccountSchema),
|
|
4728
5187
|
call
|
|
4729
5188
|
),
|
|
4730
5189
|
/**
|
|
@@ -4734,7 +5193,7 @@ function managementClient(options) {
|
|
|
4734
5193
|
*/
|
|
4735
5194
|
unlinkOAuthAccount: (member, input, call) => post(
|
|
4736
5195
|
`/members/${encodeURIComponent(member)}/oauth-accounts/unlink`,
|
|
4737
|
-
|
|
5196
|
+
z19.array(managedOAuthAccountSchema),
|
|
4738
5197
|
memberOAuthUnlinkInputSchema.parse(input),
|
|
4739
5198
|
call
|
|
4740
5199
|
),
|
|
@@ -4760,6 +5219,27 @@ function managementClient(options) {
|
|
|
4760
5219
|
memberTelegramUnlinkInputSchema.parse(input),
|
|
4761
5220
|
call
|
|
4762
5221
|
),
|
|
5222
|
+
/**
|
|
5223
|
+
* The member's linked creator accounts, such as a YouTube channel; requires `read`
|
|
5224
|
+
* permission. Creator accounts are not identity states in SDK 1.x, so they have this read
|
|
5225
|
+
* and `unlinkCreatorAccount` of their own.
|
|
5226
|
+
*/
|
|
5227
|
+
creatorAccounts: (member, call) => get(
|
|
5228
|
+
`/members/${identifier.parse(member)}/creator-accounts`,
|
|
5229
|
+
managedCreatorAccountsSchema,
|
|
5230
|
+
call
|
|
5231
|
+
),
|
|
5232
|
+
/**
|
|
5233
|
+
* Unlinks the member's reviewed creator account in this project and environment; requires
|
|
5234
|
+
* `review` permission. Relay stops reading it; records it authored stay, and the account
|
|
5235
|
+
* stays bound to the member.
|
|
5236
|
+
*/
|
|
5237
|
+
unlinkCreatorAccount: (member, input, call) => post(
|
|
5238
|
+
`/members/${identifier.parse(member)}/creator-accounts/unlink`,
|
|
5239
|
+
managedCreatorAccountsSchema,
|
|
5240
|
+
memberCreatorAccountUnlinkInputSchema.parse(input),
|
|
5241
|
+
call
|
|
5242
|
+
),
|
|
4763
5243
|
/**
|
|
4764
5244
|
* Unlinks a member's wallet from the project with a reason; requires `review` permission. The address stays bound to the member.
|
|
4765
5245
|
*
|
|
@@ -4767,7 +5247,7 @@ function managementClient(options) {
|
|
|
4767
5247
|
*/
|
|
4768
5248
|
unlinkWallet: (member, input, call) => post(
|
|
4769
5249
|
`/members/${encodeURIComponent(member)}/wallets/unlink`,
|
|
4770
|
-
|
|
5250
|
+
z19.array(managedWalletSchema),
|
|
4771
5251
|
memberWalletUnlinkInputSchema.parse(input),
|
|
4772
5252
|
call
|
|
4773
5253
|
),
|
|
@@ -4780,7 +5260,7 @@ function managementClient(options) {
|
|
|
4780
5260
|
*/
|
|
4781
5261
|
unlinkIdentity: (member, input, call) => post(
|
|
4782
5262
|
`/members/${encodeURIComponent(member)}/identities/unlink`,
|
|
4783
|
-
|
|
5263
|
+
z19.array(managedMemberIdentitySchema),
|
|
4784
5264
|
memberIdentityChangeInputSchema.parse(input),
|
|
4785
5265
|
call
|
|
4786
5266
|
),
|
|
@@ -4791,7 +5271,7 @@ function managementClient(options) {
|
|
|
4791
5271
|
*/
|
|
4792
5272
|
relinkIdentity: (member, input, call) => post(
|
|
4793
5273
|
`/members/${encodeURIComponent(member)}/identities/relink`,
|
|
4794
|
-
|
|
5274
|
+
z19.array(managedMemberIdentitySchema),
|
|
4795
5275
|
memberIdentityChangeInputSchema.parse(input),
|
|
4796
5276
|
call
|
|
4797
5277
|
),
|
|
@@ -4803,7 +5283,7 @@ function managementClient(options) {
|
|
|
4803
5283
|
*/
|
|
4804
5284
|
setWalletSignIn: (member, input, call) => post(
|
|
4805
5285
|
`/members/${encodeURIComponent(member)}/wallets/sign-in`,
|
|
4806
|
-
|
|
5286
|
+
z19.array(managedWalletSchema),
|
|
4807
5287
|
memberWalletSignInInputSchema.parse(input),
|
|
4808
5288
|
call
|
|
4809
5289
|
)
|
|
@@ -4885,13 +5365,8 @@ function managementClient(options) {
|
|
|
4885
5365
|
{},
|
|
4886
5366
|
call
|
|
4887
5367
|
),
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
appScheduleListSchema,
|
|
4891
|
-
{ state: appScheduleStateSchema.parse(state3) },
|
|
4892
|
-
"PUT",
|
|
4893
|
-
call
|
|
4894
|
-
),
|
|
5368
|
+
/** Activates, pauses or archives the project's schedules, with an optional audited reason. */
|
|
5369
|
+
setState: setAppScheduleState,
|
|
4895
5370
|
recover: (name, input, call) => post(
|
|
4896
5371
|
`/schedules/${appScheduleNameSchema.parse(name)}/recover`,
|
|
4897
5372
|
appScheduleListSchema,
|
|
@@ -4927,7 +5402,7 @@ function managementClient(options) {
|
|
|
4927
5402
|
`/storage/sql/${appSecretNameSchema.parse(name)}/cell?${new URLSearchParams(
|
|
4928
5403
|
{
|
|
4929
5404
|
table,
|
|
4930
|
-
row: String(
|
|
5405
|
+
row: String(z19.number().int().min(0).parse(options2.row)),
|
|
4931
5406
|
column: options2.column,
|
|
4932
5407
|
...options2.cursor === void 0 ? {} : { cursor: pageCursorSchema.parse(options2.cursor) }
|
|
4933
5408
|
}
|
|
@@ -5039,7 +5514,7 @@ function managementClient(options) {
|
|
|
5039
5514
|
* Each quest's current release, the most recently published first, archived quests
|
|
5040
5515
|
* included; requires `read` permission.
|
|
5041
5516
|
*/
|
|
5042
|
-
list: (call) => get("/quests/list",
|
|
5517
|
+
list: (call) => get("/quests/list", z19.array(publishedReleaseSchema), call),
|
|
5043
5518
|
/** Pending and exhausted asynchronous balance checks. Requires read. */
|
|
5044
5519
|
automaticScheduling: (query = {}, call) => get(
|
|
5045
5520
|
`/quests/automatic-scheduling${queryString(automaticSchedulingQuerySchema.parse(query))}`,
|
|
@@ -5084,7 +5559,7 @@ function managementClient(options) {
|
|
|
5084
5559
|
*/
|
|
5085
5560
|
submissions: (member, call) => get(
|
|
5086
5561
|
`/members/${encodeURIComponent(member)}/quest-submissions`,
|
|
5087
|
-
|
|
5562
|
+
z19.object({ items: z19.array(questSubmissionSchema) }),
|
|
5088
5563
|
call
|
|
5089
5564
|
),
|
|
5090
5565
|
/**
|
|
@@ -5217,9 +5692,15 @@ var managementResponseSchemas = lazyResponseReaders({
|
|
|
5217
5692
|
get billingSessionSchema() {
|
|
5218
5693
|
return knownResponse(billingSessionSchema);
|
|
5219
5694
|
},
|
|
5695
|
+
get organizationBillingSchema() {
|
|
5696
|
+
return knownResponse(organizationBillingSchema);
|
|
5697
|
+
},
|
|
5220
5698
|
get projectBillingSchema() {
|
|
5221
5699
|
return knownResponse(projectBillingSchema);
|
|
5222
5700
|
},
|
|
5701
|
+
get projectPlanSchema() {
|
|
5702
|
+
return knownResponse(projectPlanSchema);
|
|
5703
|
+
},
|
|
5223
5704
|
get realPeopleInTestUsageSchema() {
|
|
5224
5705
|
return knownResponse(realPeopleInTestUsageSchema);
|
|
5225
5706
|
},
|
|
@@ -5337,6 +5818,9 @@ var managementResponseSchemas = lazyResponseReaders({
|
|
|
5337
5818
|
get completionRevocationSchema() {
|
|
5338
5819
|
return knownResponse(completionRevocationSchema);
|
|
5339
5820
|
},
|
|
5821
|
+
get completionRestorationSchema() {
|
|
5822
|
+
return knownResponse(completionRestorationSchema);
|
|
5823
|
+
},
|
|
5340
5824
|
get contentPerformancePageSchema() {
|
|
5341
5825
|
return knownResponse(contentPerformancePageSchema);
|
|
5342
5826
|
},
|
|
@@ -5361,6 +5845,9 @@ var managementResponseSchemas = lazyResponseReaders({
|
|
|
5361
5845
|
get deploymentResultSchema() {
|
|
5362
5846
|
return knownResponse(deploymentResultSchema);
|
|
5363
5847
|
},
|
|
5848
|
+
get discordRoleRewardsSchema() {
|
|
5849
|
+
return knownResponse(discordRoleRewardsSchema);
|
|
5850
|
+
},
|
|
5364
5851
|
get engagementBoundaryPageSchema() {
|
|
5365
5852
|
return knownResponse(engagementBoundaryPageSchema);
|
|
5366
5853
|
},
|
|
@@ -5412,6 +5899,12 @@ var managementResponseSchemas = lazyResponseReaders({
|
|
|
5412
5899
|
get issuedServiceKeySchema() {
|
|
5413
5900
|
return knownResponse(issuedServiceKeySchema);
|
|
5414
5901
|
},
|
|
5902
|
+
get automationKeySchema() {
|
|
5903
|
+
return knownResponse(automationKeySchema);
|
|
5904
|
+
},
|
|
5905
|
+
get issuedAutomationKeySchema() {
|
|
5906
|
+
return knownResponse(issuedAutomationKeySchema);
|
|
5907
|
+
},
|
|
5415
5908
|
get leaderboardPageSchema() {
|
|
5416
5909
|
return knownResponse(leaderboardPageSchema);
|
|
5417
5910
|
},
|
|
@@ -5463,6 +5956,9 @@ var managementResponseSchemas = lazyResponseReaders({
|
|
|
5463
5956
|
get managedTelegramAccountSchema() {
|
|
5464
5957
|
return knownResponse(managedTelegramAccountSchema);
|
|
5465
5958
|
},
|
|
5959
|
+
get managedCreatorAccountsSchema() {
|
|
5960
|
+
return knownResponse(managedCreatorAccountsSchema);
|
|
5961
|
+
},
|
|
5466
5962
|
get telegramChatsSchema() {
|
|
5467
5963
|
return knownResponse(telegramChatsSchema);
|
|
5468
5964
|
},
|
|
@@ -5684,9 +6180,15 @@ var managementResponses = lazyResponseReaders({
|
|
|
5684
6180
|
get billingSessionSchema() {
|
|
5685
6181
|
return responseSchema(billingSessionSchema);
|
|
5686
6182
|
},
|
|
6183
|
+
get organizationBillingSchema() {
|
|
6184
|
+
return responseSchema(organizationBillingSchema);
|
|
6185
|
+
},
|
|
5687
6186
|
get projectBillingSchema() {
|
|
5688
6187
|
return responseSchema(projectBillingSchema);
|
|
5689
6188
|
},
|
|
6189
|
+
get projectPlanSchema() {
|
|
6190
|
+
return responseSchema(projectPlanSchema);
|
|
6191
|
+
},
|
|
5690
6192
|
get realPeopleInTestUsageSchema() {
|
|
5691
6193
|
return responseSchema(realPeopleInTestUsageSchema);
|
|
5692
6194
|
},
|
|
@@ -5804,6 +6306,9 @@ var managementResponses = lazyResponseReaders({
|
|
|
5804
6306
|
get completionRevocationSchema() {
|
|
5805
6307
|
return responseSchema(completionRevocationSchema);
|
|
5806
6308
|
},
|
|
6309
|
+
get completionRestorationSchema() {
|
|
6310
|
+
return responseSchema(completionRestorationSchema);
|
|
6311
|
+
},
|
|
5807
6312
|
get contentPerformancePageSchema() {
|
|
5808
6313
|
return responseSchema(contentPerformancePageSchema);
|
|
5809
6314
|
},
|
|
@@ -5828,6 +6333,9 @@ var managementResponses = lazyResponseReaders({
|
|
|
5828
6333
|
get deploymentResultSchema() {
|
|
5829
6334
|
return responseSchema(deploymentResultSchema);
|
|
5830
6335
|
},
|
|
6336
|
+
get discordRoleRewardsSchema() {
|
|
6337
|
+
return responseSchema(discordRoleRewardsSchema);
|
|
6338
|
+
},
|
|
5831
6339
|
get engagementBoundaryPageSchema() {
|
|
5832
6340
|
return responseSchema(engagementBoundaryPageSchema);
|
|
5833
6341
|
},
|
|
@@ -5879,6 +6387,12 @@ var managementResponses = lazyResponseReaders({
|
|
|
5879
6387
|
get issuedServiceKeySchema() {
|
|
5880
6388
|
return responseSchema(issuedServiceKeySchema);
|
|
5881
6389
|
},
|
|
6390
|
+
get automationKeySchema() {
|
|
6391
|
+
return responseSchema(automationKeySchema);
|
|
6392
|
+
},
|
|
6393
|
+
get issuedAutomationKeySchema() {
|
|
6394
|
+
return responseSchema(issuedAutomationKeySchema);
|
|
6395
|
+
},
|
|
5882
6396
|
get leaderboardPageSchema() {
|
|
5883
6397
|
return responseSchema(leaderboardPageSchema);
|
|
5884
6398
|
},
|
|
@@ -5930,6 +6444,9 @@ var managementResponses = lazyResponseReaders({
|
|
|
5930
6444
|
get managedTelegramAccountSchema() {
|
|
5931
6445
|
return responseSchema(managedTelegramAccountSchema);
|
|
5932
6446
|
},
|
|
6447
|
+
get managedCreatorAccountsSchema() {
|
|
6448
|
+
return responseSchema(managedCreatorAccountsSchema);
|
|
6449
|
+
},
|
|
5933
6450
|
get telegramChatsSchema() {
|
|
5934
6451
|
return responseSchema(telegramChatsSchema);
|
|
5935
6452
|
},
|
|
@@ -6162,6 +6679,9 @@ export {
|
|
|
6162
6679
|
MemberImportRefusalCode,
|
|
6163
6680
|
PayoutSourceKind,
|
|
6164
6681
|
REFERRAL_INTEGRATION_REWARD_ERROR,
|
|
6682
|
+
RestoredDeliveryOutcome,
|
|
6683
|
+
RestoredEntitlementOutcome,
|
|
6684
|
+
RestoredReferralOutcome,
|
|
6165
6685
|
RevokedDeliveryOutcome,
|
|
6166
6686
|
RevokedEntitlementOutcome,
|
|
6167
6687
|
RevokedReferralOutcome,
|
|
@@ -6198,6 +6718,7 @@ export {
|
|
|
6198
6718
|
appScheduleRunSchema,
|
|
6199
6719
|
appScheduleRunsSchema,
|
|
6200
6720
|
appScheduleSchema,
|
|
6721
|
+
appScheduleStateInputSchema,
|
|
6201
6722
|
appScheduleStateSchema,
|
|
6202
6723
|
appSchedulesSchema,
|
|
6203
6724
|
appSecretDeclarationSchema,
|
|
@@ -6222,6 +6743,9 @@ export {
|
|
|
6222
6743
|
auditPageSchema,
|
|
6223
6744
|
auditQuerySchema,
|
|
6224
6745
|
auditRecordSchema,
|
|
6746
|
+
automationKeyInputSchema,
|
|
6747
|
+
automationKeyPermissionSchema,
|
|
6748
|
+
automationKeySchema,
|
|
6225
6749
|
balanceCheckSchema,
|
|
6226
6750
|
billingCheckoutInputSchema,
|
|
6227
6751
|
billingIntervals,
|
|
@@ -6240,6 +6764,8 @@ export {
|
|
|
6240
6764
|
capturedFactSchema,
|
|
6241
6765
|
commitSchema,
|
|
6242
6766
|
compareAppMigrations,
|
|
6767
|
+
completionRestorationSchema,
|
|
6768
|
+
completionRestoreSchema,
|
|
6243
6769
|
completionRevocationSchema,
|
|
6244
6770
|
completionRevocationShortfallSchema,
|
|
6245
6771
|
completionRevokeSchema,
|
|
@@ -6273,6 +6799,7 @@ export {
|
|
|
6273
6799
|
environmentSchema,
|
|
6274
6800
|
grantRecordSchema,
|
|
6275
6801
|
grantSchema,
|
|
6802
|
+
groupArchiveInputSchema,
|
|
6276
6803
|
groupMemberPageSchema,
|
|
6277
6804
|
groupMemberSchema,
|
|
6278
6805
|
groupPageQuerySchema,
|
|
@@ -6301,6 +6828,7 @@ export {
|
|
|
6301
6828
|
isIntegrationParticipantPath,
|
|
6302
6829
|
isManagementError,
|
|
6303
6830
|
isParticipantRoute,
|
|
6831
|
+
issuedAutomationKeySchema,
|
|
6304
6832
|
issuedServiceKeySchema,
|
|
6305
6833
|
issuedTokenSchema,
|
|
6306
6834
|
leaderboardSettlementExportSchema,
|
|
@@ -6314,6 +6842,8 @@ export {
|
|
|
6314
6842
|
managedAttemptPageSchema,
|
|
6315
6843
|
managedAttemptQuerySchema,
|
|
6316
6844
|
managedAttemptSchema,
|
|
6845
|
+
managedCreatorAccountSchema,
|
|
6846
|
+
managedCreatorAccountsSchema,
|
|
6317
6847
|
managedEntitlementPageSchema,
|
|
6318
6848
|
managedEntitlementQuerySchema,
|
|
6319
6849
|
managedEntitlementSchema,
|
|
@@ -6337,6 +6867,7 @@ export {
|
|
|
6337
6867
|
managementResponses,
|
|
6338
6868
|
managementStateQuerySchema,
|
|
6339
6869
|
memberAccountSchema,
|
|
6870
|
+
memberCreatorAccountUnlinkInputSchema,
|
|
6340
6871
|
memberDetailSchema,
|
|
6341
6872
|
memberIdentityChangeInputSchema,
|
|
6342
6873
|
memberIdentityLinkChangeInputSchema,
|
|
@@ -6370,9 +6901,11 @@ export {
|
|
|
6370
6901
|
metricsSchema,
|
|
6371
6902
|
nextScheduleRun,
|
|
6372
6903
|
oauthIdentitySelectorSchema,
|
|
6904
|
+
offeredStarterSchema,
|
|
6373
6905
|
operationInputSchema,
|
|
6374
6906
|
operationSchema,
|
|
6375
6907
|
operatorUserSchema,
|
|
6908
|
+
organizationBillingSchema,
|
|
6376
6909
|
pageSchema,
|
|
6377
6910
|
parseImageExtraction,
|
|
6378
6911
|
parseImageResult,
|
|
@@ -6385,10 +6918,12 @@ export {
|
|
|
6385
6918
|
personSchema,
|
|
6386
6919
|
pointLedgerPropertiesSchema,
|
|
6387
6920
|
projectBillingSchema,
|
|
6921
|
+
projectCreateInputSchema,
|
|
6388
6922
|
projectDeletionInputSchema,
|
|
6389
6923
|
projectDeletionSchema,
|
|
6390
6924
|
projectInputSchema,
|
|
6391
6925
|
projectMetricsSchema,
|
|
6926
|
+
projectPlanSchema,
|
|
6392
6927
|
projectSchema,
|
|
6393
6928
|
projectSetupSchema,
|
|
6394
6929
|
projectTransferInputSchema,
|
|
@@ -6417,12 +6952,14 @@ export {
|
|
|
6417
6952
|
referralRewardResolutionSchema,
|
|
6418
6953
|
referralSuspensionSchema,
|
|
6419
6954
|
removeGroupMemberSchema,
|
|
6955
|
+
repositoryCreateSchema,
|
|
6420
6956
|
repositorySchema,
|
|
6421
6957
|
resourceArchiveInputSchema,
|
|
6422
6958
|
resourceLifecycleInputSchema,
|
|
6423
6959
|
resourceLifecycleKindSchema,
|
|
6424
6960
|
resourceLifecyclePaths,
|
|
6425
6961
|
resourceLifecycleResultSchema,
|
|
6962
|
+
revokedCompletionSchema,
|
|
6426
6963
|
rolePermissions,
|
|
6427
6964
|
roleSchema,
|
|
6428
6965
|
scheduleResult,
|
|
@@ -6430,6 +6967,7 @@ export {
|
|
|
6430
6967
|
sequenceCursorSchema,
|
|
6431
6968
|
serviceKeyInputSchema,
|
|
6432
6969
|
serviceKeySchema,
|
|
6970
|
+
settlementPayoutCsv,
|
|
6433
6971
|
sourceDataSchema,
|
|
6434
6972
|
sourceRoles,
|
|
6435
6973
|
stageRequestSchema,
|
|
@@ -6444,6 +6982,7 @@ export {
|
|
|
6444
6982
|
stagingPathSchema,
|
|
6445
6983
|
starterIdSchema,
|
|
6446
6984
|
starterTemplates,
|
|
6985
|
+
starters,
|
|
6447
6986
|
stockAdditionSchema,
|
|
6448
6987
|
stockInputSchema,
|
|
6449
6988
|
teamSchema,
|