@domino-sdk/relay 1.5.2 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{activity-DeKJsRry.d.ts → activity-mPUN4v5Q.d.ts} +147 -116
- package/dist/authoring.d.ts +59 -47
- package/dist/authoring.js +3 -3
- package/dist/{automatic-outcomes-B1xrETxm.d.ts → automatic-outcomes-DmuqzQiH.d.ts} +224 -13
- package/dist/browser.d.ts +22 -10
- package/dist/browser.js +6 -6
- package/dist/{capability-error-DNMwKmlL.d.ts → capability-error-Bv996M-h.d.ts} +2 -0
- package/dist/{chunk-GQKYAQM6.js → chunk-23QJ7WH4.js} +1 -1
- package/dist/{chunk-XFMSUPNS.js → chunk-6ON4RMEN.js} +1 -1
- package/dist/{chunk-VFHHLN6A.js → chunk-6RBF3UDA.js} +49 -6
- package/dist/chunk-AXRMT33W.js +112 -0
- package/dist/{chunk-24AFCBZN.js → chunk-BFZHJA2B.js} +2 -2
- package/dist/{chunk-EYH5RDIE.js → chunk-C25TDFHN.js} +4 -2
- package/dist/{chunk-36HTX2BM.js → chunk-GMPPLZKH.js} +61 -4
- package/dist/{chunk-BGGKNIRP.js → chunk-JW4G3SY5.js} +1 -1
- package/dist/{chunk-JON5SESL.js → chunk-KGJSKGKI.js} +84 -6
- package/dist/{chunk-WJSSJ7AF.js → chunk-QGLHZ2E5.js} +24 -4
- package/dist/{chunk-DGWMLN35.js → chunk-ZOUEEK5L.js} +16 -5
- package/dist/{client-gqnRUHpC.d.ts → client-CQuTAjSs.d.ts} +88 -41
- package/dist/{groups-Ck-OxzjD.d.ts → groups-D08JtrZu.d.ts} +175 -3
- package/dist/{identity-integration-GxAHdKR2.d.ts → identity-integration-BPovus6e.d.ts} +1 -1
- package/dist/{images-Dv-P5VBw.d.ts → images-D7en0Awp.d.ts} +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +5 -5
- package/dist/internal.d.ts +34 -27
- package/dist/internal.js +18 -24
- package/dist/{offers-Cy-e4o5x.d.ts → offers-BENZl5l5.d.ts} +3 -2
- package/dist/{outcomes-kVB-Juzs.d.ts → pages-CBa-_u_n.d.ts} +142 -99
- package/dist/{pages-BBYD21IE.d.ts → participant-activity-DkL3nY5a.d.ts} +1 -14
- package/dist/portal-proxy.js +48 -36
- package/dist/react/index.d.ts +25 -3949
- package/dist/react/index.js +8 -7
- package/dist/{request-error-DWduJCGV.d.ts → request-error-D_dUPLwo.d.ts} +5 -0
- package/dist/{schema-DfJzH2ci.d.ts → schema-BPdHSCAc.d.ts} +122 -37
- package/dist/schema.d.ts +10 -10
- package/dist/schema.js +48 -6
- package/dist/server/index.d.ts +9672 -66110
- package/dist/server/index.js +1009 -548
- package/dist/sign-in-options-FPKoZMfo.d.ts +202 -0
- package/dist/{submission-input-BZkm6ohU.d.ts → submission-input-BzIWutQi.d.ts} +2 -2
- package/package.json +1 -1
- package/dist/browser-D_3s8B5e.d.ts +0 -4154
- package/dist/chunk-GUP7YRR4.js +0 -42
package/dist/server/index.js
CHANGED
|
@@ -11,28 +11,29 @@ import {
|
|
|
11
11
|
automaticSchedulingQuerySchema,
|
|
12
12
|
automaticSchedulingRetrySchema,
|
|
13
13
|
automaticSchedulingSchema,
|
|
14
|
+
deploymentActionSchema,
|
|
14
15
|
deploymentPreviewSchema,
|
|
15
16
|
deploymentRecordSchema,
|
|
17
|
+
deploymentRejectionSchema,
|
|
16
18
|
deploymentResultSchema,
|
|
17
19
|
projectDeploymentSchema,
|
|
18
20
|
promoteDeploymentSchema,
|
|
19
21
|
publishDeploymentSchema,
|
|
20
22
|
rejectDeploymentSchema,
|
|
21
|
-
rollbackDeploymentSchema,
|
|
22
23
|
submitDeploymentSchema
|
|
23
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-6RBF3UDA.js";
|
|
24
25
|
import "../chunk-MC6V6VMG.js";
|
|
25
26
|
import {
|
|
26
27
|
identityIntegrationInputSchema,
|
|
27
28
|
identityIntegrationSchema,
|
|
28
29
|
identityIntegrationSecretSchema,
|
|
29
30
|
identityKindClaimSchema
|
|
30
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-QGLHZ2E5.js";
|
|
31
32
|
import {
|
|
32
33
|
imageAssetArtifactSchema
|
|
33
|
-
} from "../chunk-
|
|
34
|
-
import "../chunk-
|
|
35
|
-
import "../chunk-
|
|
34
|
+
} from "../chunk-JW4G3SY5.js";
|
|
35
|
+
import "../chunk-23QJ7WH4.js";
|
|
36
|
+
import "../chunk-AXRMT33W.js";
|
|
36
37
|
import {
|
|
37
38
|
allocateQuestSchema,
|
|
38
39
|
allocatedQuestSchema,
|
|
@@ -50,7 +51,7 @@ import {
|
|
|
50
51
|
rewardDeliveriesSchema,
|
|
51
52
|
rewardDeliverySchema,
|
|
52
53
|
saveQuestDraftSchema
|
|
53
|
-
} from "../chunk-
|
|
54
|
+
} from "../chunk-C25TDFHN.js";
|
|
54
55
|
import {
|
|
55
56
|
cosmosNetworkSchema,
|
|
56
57
|
createPointLedgerSchema,
|
|
@@ -62,6 +63,7 @@ import {
|
|
|
62
63
|
engagementPageSchema,
|
|
63
64
|
engagementPublishSchema,
|
|
64
65
|
engagementRuleSchema,
|
|
66
|
+
engagementRuleVersionPageSchema,
|
|
65
67
|
engagementVersionPageSchema,
|
|
66
68
|
engagementVersionQuerySchema,
|
|
67
69
|
evmChainIdSchema,
|
|
@@ -73,13 +75,14 @@ import {
|
|
|
73
75
|
leaderboardSettlementSchema,
|
|
74
76
|
leaderboardSettlementSummarySchema,
|
|
75
77
|
linkedWalletSchema,
|
|
78
|
+
managedPointHistoryPageSchema,
|
|
76
79
|
managedPointLedgerSchema,
|
|
77
80
|
managedProfileSchema,
|
|
78
81
|
offerControlSchema,
|
|
79
82
|
offerSchema,
|
|
83
|
+
pointLedgerPropertiesSchema,
|
|
80
84
|
pointLedgerSchema,
|
|
81
85
|
pointsAccountSchema,
|
|
82
|
-
pointsEntrySchema,
|
|
83
86
|
pointsMutationSchema,
|
|
84
87
|
pointsResultSchema,
|
|
85
88
|
profileModerationSchema,
|
|
@@ -92,11 +95,14 @@ import {
|
|
|
92
95
|
referralControlSchema,
|
|
93
96
|
referralHistorySchema,
|
|
94
97
|
referralManagementSchema,
|
|
98
|
+
referralQualificationSchema,
|
|
99
|
+
referralRewardResolutionSchema,
|
|
100
|
+
referralSuspensionSchema,
|
|
95
101
|
solanaMainnet,
|
|
96
102
|
walletBalanceSchema,
|
|
97
103
|
walletSignInNetworksSchema,
|
|
98
104
|
walletUnlinkInputSchema
|
|
99
|
-
} from "../chunk-
|
|
105
|
+
} from "../chunk-GMPPLZKH.js";
|
|
100
106
|
import {
|
|
101
107
|
MANAGEMENT_TIMEOUT,
|
|
102
108
|
lifetime,
|
|
@@ -108,13 +114,16 @@ import {
|
|
|
108
114
|
RequestError,
|
|
109
115
|
isRequestError
|
|
110
116
|
} from "../chunk-NPGENI7K.js";
|
|
111
|
-
import "../chunk-
|
|
117
|
+
import "../chunk-6ON4RMEN.js";
|
|
112
118
|
import {
|
|
119
|
+
CompletionSourceKind,
|
|
120
|
+
addGroupMemberSchema,
|
|
113
121
|
appIdentityKindSchema,
|
|
114
122
|
attemptSchema,
|
|
115
123
|
authProviderSchema,
|
|
116
124
|
beginHandoverSchema,
|
|
117
125
|
campaignEnrollmentSchema,
|
|
126
|
+
completionSourceSchema,
|
|
118
127
|
configurePickupSchema,
|
|
119
128
|
confirmHandoverSchema,
|
|
120
129
|
contentPerformancePageSchema,
|
|
@@ -125,14 +134,23 @@ import {
|
|
|
125
134
|
counterHistorySchema,
|
|
126
135
|
counterModerationResultSchema,
|
|
127
136
|
counterModerationSchema,
|
|
137
|
+
createGroupSchema,
|
|
128
138
|
createStockItemSchema,
|
|
129
139
|
entitlementCorrectionSchema,
|
|
130
140
|
entitlementSchema,
|
|
141
|
+
eventSchema,
|
|
142
|
+
groupMemberPageSchema,
|
|
143
|
+
groupMemberSchema,
|
|
144
|
+
groupPageQuerySchema,
|
|
145
|
+
groupPageSchema,
|
|
131
146
|
identifier,
|
|
147
|
+
managedGroupSchema,
|
|
132
148
|
memberCampaignEnrollmentInputSchema,
|
|
133
149
|
memberCampaignWithdrawalInputSchema,
|
|
134
150
|
memberIdentitySchema,
|
|
135
151
|
memberProgressSchema,
|
|
152
|
+
pageCursorSchema,
|
|
153
|
+
pageQuerySchema,
|
|
136
154
|
pickupAvailabilitySchema,
|
|
137
155
|
pickupCatalogSchema,
|
|
138
156
|
projectCalendarInputSchema,
|
|
@@ -140,6 +158,7 @@ import {
|
|
|
140
158
|
projectGroupKey,
|
|
141
159
|
publishedReleaseSchema,
|
|
142
160
|
questSettingsInputSchema,
|
|
161
|
+
removeGroupMemberSchema,
|
|
143
162
|
snapshotSchema,
|
|
144
163
|
staffDecisionSchema,
|
|
145
164
|
stockItemSchema,
|
|
@@ -158,8 +177,11 @@ import {
|
|
|
158
177
|
trackerPreviewSchema,
|
|
159
178
|
trackerQuerySchema,
|
|
160
179
|
trackerStatusSchema,
|
|
161
|
-
trackerSummarySchema
|
|
162
|
-
|
|
180
|
+
trackerSummarySchema,
|
|
181
|
+
trackerTriggerOutcomePageSchema,
|
|
182
|
+
trackerTriggerOutcomeQuerySchema,
|
|
183
|
+
updateGroupSchema
|
|
184
|
+
} from "../chunk-KGJSKGKI.js";
|
|
163
185
|
|
|
164
186
|
// src/server/test-members.ts
|
|
165
187
|
import { z } from "zod";
|
|
@@ -213,6 +235,12 @@ var testMemberHistorySchema = z.object({
|
|
|
213
235
|
|
|
214
236
|
// src/server/webhooks.ts
|
|
215
237
|
import { z as z2 } from "zod";
|
|
238
|
+
var PayoutSourceKind = {
|
|
239
|
+
Quest: "quest",
|
|
240
|
+
Leaderboard: "leaderboard",
|
|
241
|
+
Engagement: "engagement",
|
|
242
|
+
Manual: "manual"
|
|
243
|
+
};
|
|
216
244
|
var webhookEventSchema = z2.object({
|
|
217
245
|
id: z2.string().uuid(),
|
|
218
246
|
version: z2.literal(1),
|
|
@@ -258,11 +286,16 @@ var webhookDeliverySchema = z2.object({
|
|
|
258
286
|
replayOf: z2.string().uuid().nullable()
|
|
259
287
|
});
|
|
260
288
|
var webhookQuerySchema = z2.object({
|
|
289
|
+
/** A page's `nextCursor`: the deliveries after it, newest first. */
|
|
290
|
+
cursor: pageCursorSchema.optional(),
|
|
291
|
+
/** @deprecated Use `cursor`. Removed in 2.0.0. */
|
|
261
292
|
before: z2.string().uuid().optional(),
|
|
262
293
|
limit: z2.coerce.number().int().min(1).max(100).default(50)
|
|
263
294
|
}).strict();
|
|
264
295
|
var webhookDeliveryPageSchema = z2.object({
|
|
265
296
|
items: z2.array(webhookDeliverySchema),
|
|
297
|
+
nextCursor: pageCursorSchema.nullable().default(null),
|
|
298
|
+
/** @deprecated Use `nextCursor`, passed back as `cursor`. Removed in 2.0.0. */
|
|
266
299
|
next: z2.string().uuid().nullable()
|
|
267
300
|
});
|
|
268
301
|
var WEBHOOK_MAX_BYTES = 64 * 1024;
|
|
@@ -339,9 +372,10 @@ var resourceLifecycleResultSchema = z3.object({
|
|
|
339
372
|
});
|
|
340
373
|
|
|
341
374
|
// src/server/index.ts
|
|
342
|
-
import { z as
|
|
375
|
+
import { z as z9 } from "zod";
|
|
343
376
|
|
|
344
377
|
// src/server/errors.ts
|
|
378
|
+
import { z as z4 } from "zod";
|
|
345
379
|
var ManagementErrorCode = {
|
|
346
380
|
/** The input or an option failed validation before anything was sent (kind `client`). */
|
|
347
381
|
InvalidInput: "invalid-input",
|
|
@@ -352,6 +386,10 @@ var ManagementErrorCode = {
|
|
|
352
386
|
Aborted: "aborted",
|
|
353
387
|
InvalidResponse: "invalid-response"
|
|
354
388
|
};
|
|
389
|
+
var managementErrorSchema = z4.looseObject({
|
|
390
|
+
error: z4.string(),
|
|
391
|
+
code: z4.string().optional()
|
|
392
|
+
});
|
|
355
393
|
var uncertainStatuses = /* @__PURE__ */ new Set([500, 502, 504]);
|
|
356
394
|
function uncertainOutcome(init) {
|
|
357
395
|
if (init.method === void 0 || init.method === "GET") {
|
|
@@ -402,10 +440,10 @@ var ManagementError = class extends RequestError {
|
|
|
402
440
|
var DEFAULT_MANAGEMENT_TIMEOUT = MANAGEMENT_TIMEOUT;
|
|
403
441
|
|
|
404
442
|
// src/server/hosting.ts
|
|
405
|
-
import { z as
|
|
443
|
+
import { z as z6 } from "zod";
|
|
406
444
|
|
|
407
445
|
// src/server/starters.ts
|
|
408
|
-
import { z as
|
|
446
|
+
import { z as z5 } from "zod";
|
|
409
447
|
var starterTemplates = [
|
|
410
448
|
{
|
|
411
449
|
id: "campaign",
|
|
@@ -438,63 +476,63 @@ var starterTemplates = [
|
|
|
438
476
|
summary: "A headless Worker with typed routes and interactive API docs, for plugging Domino into your own product."
|
|
439
477
|
}
|
|
440
478
|
];
|
|
441
|
-
var starterIdSchema =
|
|
479
|
+
var starterIdSchema = z5.enum(
|
|
442
480
|
starterTemplates.map((template) => template.id)
|
|
443
481
|
);
|
|
444
482
|
|
|
445
483
|
// src/server/hosting.ts
|
|
446
|
-
var outputPathSchema =
|
|
484
|
+
var outputPathSchema = z6.string().min(1).max(512).refine(
|
|
447
485
|
(path) => path.split("/").every(
|
|
448
486
|
(part) => /^[\w-][\w.-]*$/.test(part) && part !== "node_modules"
|
|
449
487
|
),
|
|
450
488
|
"Expected a relative build output path without hidden segments"
|
|
451
489
|
);
|
|
452
|
-
var appRoutingSchema =
|
|
490
|
+
var appRoutingSchema = z6.enum(["legacy", "transparent"]).default("legacy");
|
|
453
491
|
var APP_SECRET_LIMIT = 50;
|
|
454
492
|
var APP_KV_LIMIT = 5;
|
|
455
493
|
var APP_SQL_LIMIT = 5;
|
|
456
494
|
var APP_MIGRATION_LIMIT = 100;
|
|
457
495
|
var APP_MIGRATION_FILE_BYTES = 9e4;
|
|
458
496
|
var APP_MIGRATION_TOTAL_BYTES = 1e6;
|
|
459
|
-
var appSecretNameSchema =
|
|
497
|
+
var appSecretNameSchema = z6.string().regex(
|
|
460
498
|
/^[A-Z_][A-Z0-9_]{0,63}$/,
|
|
461
499
|
"Use 1-64 uppercase letters, digits, and underscores, not starting with a digit"
|
|
462
500
|
).refine(
|
|
463
501
|
(name) => !name.startsWith("DOMINO_") && name !== "ASSETS",
|
|
464
502
|
"DOMINO_ names and ASSETS are reserved for Domino's own bindings"
|
|
465
503
|
);
|
|
466
|
-
var appSecretValueSchema =
|
|
504
|
+
var appSecretValueSchema = z6.string().min(1).refine(
|
|
467
505
|
(value) => new TextEncoder().encode(value).length <= 5120,
|
|
468
506
|
"Secret values can be at most 5 KiB"
|
|
469
507
|
);
|
|
470
|
-
var appSecretInputSchema =
|
|
471
|
-
var appSecretSchema =
|
|
508
|
+
var appSecretInputSchema = z6.object({ value: appSecretValueSchema }).strict();
|
|
509
|
+
var appSecretSchema = z6.object({
|
|
472
510
|
name: appSecretNameSchema,
|
|
473
|
-
updatedAt:
|
|
474
|
-
updatedBy:
|
|
511
|
+
updatedAt: z6.number(),
|
|
512
|
+
updatedBy: z6.string()
|
|
475
513
|
});
|
|
476
|
-
var appSecretDeclarationSchema =
|
|
477
|
-
description:
|
|
478
|
-
required:
|
|
514
|
+
var appSecretDeclarationSchema = z6.object({
|
|
515
|
+
description: z6.string().trim().min(1).max(500),
|
|
516
|
+
required: z6.boolean().default(true)
|
|
479
517
|
}).strict();
|
|
480
|
-
var appSecretDeclarationsSchema =
|
|
518
|
+
var appSecretDeclarationsSchema = z6.record(appSecretNameSchema, appSecretDeclarationSchema).refine(
|
|
481
519
|
(secrets) => Object.keys(secrets).length <= APP_SECRET_LIMIT,
|
|
482
520
|
`Declare at most ${APP_SECRET_LIMIT} app secrets`
|
|
483
521
|
);
|
|
484
|
-
var appSecretListSchema =
|
|
485
|
-
secrets:
|
|
486
|
-
declared:
|
|
522
|
+
var appSecretListSchema = z6.object({
|
|
523
|
+
secrets: z6.array(appSecretSchema),
|
|
524
|
+
declared: z6.array(appSecretDeclarationSchema.extend({ name: appSecretNameSchema })).default([])
|
|
487
525
|
});
|
|
488
|
-
var hostedAppSecretsSchema =
|
|
489
|
-
var storageDescription =
|
|
490
|
-
description:
|
|
526
|
+
var hostedAppSecretsSchema = z6.object({ secrets: z6.record(appSecretNameSchema, appSecretValueSchema) }).strict();
|
|
527
|
+
var storageDescription = z6.object({
|
|
528
|
+
description: z6.string().trim().min(1).max(500)
|
|
491
529
|
}).strict();
|
|
492
|
-
var appStorageSchema =
|
|
493
|
-
kv:
|
|
530
|
+
var appStorageSchema = z6.object({
|
|
531
|
+
kv: z6.record(appSecretNameSchema, storageDescription).refine(
|
|
494
532
|
(stores) => Object.keys(stores).length <= APP_KV_LIMIT,
|
|
495
533
|
`Declare at most ${APP_KV_LIMIT} KV stores`
|
|
496
534
|
).default({}),
|
|
497
|
-
sql:
|
|
535
|
+
sql: z6.record(
|
|
498
536
|
appSecretNameSchema,
|
|
499
537
|
storageDescription.extend({
|
|
500
538
|
migrations: outputPathSchema.optional()
|
|
@@ -504,55 +542,60 @@ var appStorageSchema = z5.object({
|
|
|
504
542
|
`Declare at most ${APP_SQL_LIMIT} SQL stores`
|
|
505
543
|
).default({})
|
|
506
544
|
}).strict();
|
|
507
|
-
var appStorageKindSchema =
|
|
508
|
-
var appStorageListSchema =
|
|
509
|
-
stores:
|
|
510
|
-
|
|
511
|
-
kind:
|
|
545
|
+
var appStorageKindSchema = z6.enum(["kv", "sql"]);
|
|
546
|
+
var appStorageListSchema = z6.object({
|
|
547
|
+
stores: z6.array(
|
|
548
|
+
z6.object({
|
|
549
|
+
kind: z6.string(),
|
|
512
550
|
name: appSecretNameSchema,
|
|
513
|
-
createdAt:
|
|
514
|
-
declared:
|
|
515
|
-
description:
|
|
551
|
+
createdAt: z6.number().nullable(),
|
|
552
|
+
declared: z6.boolean(),
|
|
553
|
+
description: z6.string().optional()
|
|
516
554
|
})
|
|
517
555
|
)
|
|
518
556
|
});
|
|
519
557
|
var APP_STORAGE_ROW_LIMIT = 50;
|
|
520
558
|
var APP_STORAGE_PREVIEW_CHARACTERS = 2e3;
|
|
521
|
-
var appStorageCellSchema =
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
559
|
+
var appStorageCellSchema = z6.union([
|
|
560
|
+
z6.string(),
|
|
561
|
+
z6.number(),
|
|
562
|
+
z6.null(),
|
|
563
|
+
z6.object({ text: z6.string(), truncated: z6.literal(true) }),
|
|
564
|
+
z6.object({ blob: z6.number().int().min(0) })
|
|
527
565
|
]);
|
|
528
|
-
var appStorageTablesSchema =
|
|
529
|
-
tables:
|
|
566
|
+
var appStorageTablesSchema = z6.object({
|
|
567
|
+
tables: z6.array(
|
|
530
568
|
/** `kind` is SQLite's: `table` or `view`. */
|
|
531
|
-
|
|
569
|
+
z6.object({ name: z6.string(), kind: z6.string() })
|
|
532
570
|
)
|
|
533
571
|
});
|
|
534
|
-
var appStorageRowsSchema =
|
|
535
|
-
table:
|
|
536
|
-
columns:
|
|
537
|
-
rows:
|
|
538
|
-
|
|
539
|
-
|
|
572
|
+
var appStorageRowsSchema = z6.object({
|
|
573
|
+
table: z6.string(),
|
|
574
|
+
columns: z6.array(z6.string()),
|
|
575
|
+
rows: z6.array(z6.array(appStorageCellSchema)),
|
|
576
|
+
/** How many rows come before this page in storage order. */
|
|
577
|
+
offset: z6.number().int().min(0),
|
|
578
|
+
total: z6.number().int().min(0),
|
|
579
|
+
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
580
|
+
nextCursor: pageCursorSchema.nullable().default(null)
|
|
540
581
|
});
|
|
541
|
-
var appStorageKeysSchema =
|
|
542
|
-
keys:
|
|
543
|
-
|
|
582
|
+
var appStorageKeysSchema = z6.object({
|
|
583
|
+
keys: z6.array(
|
|
584
|
+
z6.object({ name: z6.string(), expiration: z6.number().nullable() })
|
|
544
585
|
),
|
|
545
|
-
/** Pass back
|
|
546
|
-
|
|
586
|
+
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
587
|
+
nextCursor: pageCursorSchema.nullable().default(null),
|
|
588
|
+
/** @deprecated Use `nextCursor`. Removed in 2.0.0. */
|
|
589
|
+
cursor: z6.string().nullable()
|
|
547
590
|
});
|
|
548
|
-
var appStorageValueSchema =
|
|
549
|
-
key:
|
|
550
|
-
size:
|
|
591
|
+
var appStorageValueSchema = z6.object({
|
|
592
|
+
key: z6.string(),
|
|
593
|
+
size: z6.number().int().min(0),
|
|
551
594
|
/** Null when the value is not UTF-8 text. */
|
|
552
|
-
text:
|
|
553
|
-
truncated:
|
|
595
|
+
text: z6.string().nullable(),
|
|
596
|
+
truncated: z6.boolean()
|
|
554
597
|
});
|
|
555
|
-
var appMigrationNameSchema =
|
|
598
|
+
var appMigrationNameSchema = z6.string().max(255).regex(/^[\w-][\w.-]*\.sql$/);
|
|
556
599
|
function compareAppMigrations(a, b) {
|
|
557
600
|
const left = Number.parseInt(a.split("_")[0], 10);
|
|
558
601
|
const right = Number.parseInt(b.split("_")[0], 10);
|
|
@@ -569,12 +612,12 @@ function compareAppMigrations(a, b) {
|
|
|
569
612
|
}
|
|
570
613
|
return a < b ? -1 : a > b ? 1 : 0;
|
|
571
614
|
}
|
|
572
|
-
var appMigrationsSchema =
|
|
615
|
+
var appMigrationsSchema = z6.record(
|
|
573
616
|
appSecretNameSchema,
|
|
574
|
-
|
|
575
|
-
|
|
617
|
+
z6.array(
|
|
618
|
+
z6.object({
|
|
576
619
|
name: appMigrationNameSchema,
|
|
577
|
-
sql:
|
|
620
|
+
sql: z6.string().min(1).refine(
|
|
578
621
|
(sql) => new TextEncoder().encode(sql).length <= APP_MIGRATION_FILE_BYTES,
|
|
579
622
|
`A migration file must not exceed ${APP_MIGRATION_FILE_BYTES} bytes`
|
|
580
623
|
)
|
|
@@ -592,21 +635,21 @@ var appMigrationsSchema = z5.record(
|
|
|
592
635
|
);
|
|
593
636
|
var appScripts = {
|
|
594
637
|
routing: appRoutingSchema,
|
|
595
|
-
devScript:
|
|
596
|
-
checkScript:
|
|
597
|
-
buildScript:
|
|
638
|
+
devScript: z6.string().regex(/^[\w:-]+$/),
|
|
639
|
+
checkScript: z6.string().regex(/^[\w:-]+$/),
|
|
640
|
+
buildScript: z6.string().regex(/^[\w:-]+$/)
|
|
598
641
|
};
|
|
599
642
|
var workerSettings = {
|
|
600
|
-
runWorkerFirst:
|
|
643
|
+
runWorkerFirst: z6.boolean().default(false),
|
|
601
644
|
main: outputPathSchema.refine(
|
|
602
645
|
(path) => /\.m?js$/.test(path),
|
|
603
646
|
"Expected a compiled JavaScript entry"
|
|
604
647
|
),
|
|
605
|
-
compatibilityDate:
|
|
606
|
-
compatibilityFlags:
|
|
607
|
-
vars:
|
|
608
|
-
|
|
609
|
-
|
|
648
|
+
compatibilityDate: z6.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
649
|
+
compatibilityFlags: z6.array(z6.string().min(1)).max(50).default([]),
|
|
650
|
+
vars: z6.record(
|
|
651
|
+
z6.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).refine((name) => name !== "ASSETS"),
|
|
652
|
+
z6.string()
|
|
610
653
|
).default({}),
|
|
611
654
|
secrets: appSecretDeclarationsSchema.default({}),
|
|
612
655
|
storage: appStorageSchema.optional()
|
|
@@ -634,62 +677,62 @@ var distinctBindings = (worker, ctx) => {
|
|
|
634
677
|
}
|
|
635
678
|
}
|
|
636
679
|
};
|
|
637
|
-
var hostedAppSchema =
|
|
638
|
-
|
|
639
|
-
kind:
|
|
680
|
+
var hostedAppSchema = z6.discriminatedUnion("kind", [
|
|
681
|
+
z6.object({
|
|
682
|
+
kind: z6.literal("static"),
|
|
640
683
|
directory: outputPathSchema,
|
|
641
684
|
...appScripts
|
|
642
685
|
}).strict(),
|
|
643
|
-
|
|
644
|
-
kind:
|
|
686
|
+
z6.object({
|
|
687
|
+
kind: z6.literal("worker"),
|
|
645
688
|
directory: outputPathSchema,
|
|
646
689
|
assetsDirectory: outputPathSchema.optional(),
|
|
647
690
|
...appScripts,
|
|
648
691
|
...workerSettings
|
|
649
692
|
}).strict().superRefine(distinctBindings)
|
|
650
693
|
]);
|
|
651
|
-
var repositorySchema =
|
|
652
|
-
id:
|
|
694
|
+
var repositorySchema = z6.object({
|
|
695
|
+
id: z6.string().uuid(),
|
|
653
696
|
organization: identifier,
|
|
654
697
|
project: identifier,
|
|
655
|
-
remote:
|
|
656
|
-
defaultBranch:
|
|
657
|
-
status:
|
|
698
|
+
remote: z6.string().url(),
|
|
699
|
+
defaultBranch: z6.string(),
|
|
700
|
+
status: z6.enum(["provisioning", "ready"])
|
|
658
701
|
});
|
|
659
|
-
var createRepositorySchema =
|
|
702
|
+
var createRepositorySchema = z6.object({
|
|
660
703
|
/** Omitted: the starter chosen at project setup, else `campaign`. */
|
|
661
704
|
starter: starterIdSchema.optional()
|
|
662
705
|
}).strict();
|
|
663
|
-
var deviceStartSchema =
|
|
664
|
-
challenge:
|
|
706
|
+
var deviceStartSchema = z6.object({
|
|
707
|
+
challenge: z6.string().regex(/^[a-f0-9]{64}$/)
|
|
665
708
|
}).strict();
|
|
666
|
-
var deviceRedeemSchema =
|
|
667
|
-
id:
|
|
668
|
-
verifier:
|
|
709
|
+
var deviceRedeemSchema = z6.object({
|
|
710
|
+
id: z6.string().uuid(),
|
|
711
|
+
verifier: z6.string().min(43).max(128)
|
|
669
712
|
}).strict();
|
|
670
|
-
var deviceApproveSchema =
|
|
671
|
-
id:
|
|
672
|
-
code:
|
|
713
|
+
var deviceApproveSchema = z6.object({
|
|
714
|
+
id: z6.string().uuid(),
|
|
715
|
+
code: z6.string().regex(/^[A-F0-9]{4}-[A-F0-9]{4}$/)
|
|
673
716
|
}).strict();
|
|
674
|
-
var commitSchema =
|
|
675
|
-
var stageRequestSchema =
|
|
717
|
+
var commitSchema = z6.string().regex(/^[a-f0-9]{40}$/);
|
|
718
|
+
var stageRequestSchema = z6.object({
|
|
676
719
|
commit: commitSchema,
|
|
677
|
-
requestId:
|
|
720
|
+
requestId: z6.string().uuid()
|
|
678
721
|
}).strict();
|
|
679
|
-
var buildIdentitySchema =
|
|
722
|
+
var buildIdentitySchema = z6.object({
|
|
680
723
|
routing: appRoutingSchema,
|
|
681
|
-
slug:
|
|
682
|
-
runtime:
|
|
683
|
-
id:
|
|
684
|
-
repository:
|
|
724
|
+
slug: z6.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional(),
|
|
725
|
+
runtime: z6.enum(["simulation", "hosted-test"]).default("simulation"),
|
|
726
|
+
id: z6.string().uuid(),
|
|
727
|
+
repository: z6.string().uuid(),
|
|
685
728
|
organization: identifier,
|
|
686
729
|
project: identifier,
|
|
687
730
|
commit: commitSchema,
|
|
688
|
-
createdAt:
|
|
689
|
-
actor:
|
|
690
|
-
commitMessage:
|
|
731
|
+
createdAt: z6.number(),
|
|
732
|
+
actor: z6.string(),
|
|
733
|
+
commitMessage: z6.string().max(500).optional()
|
|
691
734
|
});
|
|
692
|
-
var buildPhaseSchema =
|
|
735
|
+
var buildPhaseSchema = z6.enum([
|
|
693
736
|
"queued",
|
|
694
737
|
"source",
|
|
695
738
|
"install",
|
|
@@ -699,72 +742,72 @@ var buildPhaseSchema = z5.enum([
|
|
|
699
742
|
"ready",
|
|
700
743
|
"failed"
|
|
701
744
|
]);
|
|
702
|
-
var buildStatusSchema =
|
|
745
|
+
var buildStatusSchema = z6.object({
|
|
703
746
|
phase: buildPhaseSchema,
|
|
704
747
|
failedPhase: buildPhaseSchema.optional(),
|
|
705
|
-
updatedAt:
|
|
706
|
-
message:
|
|
748
|
+
updatedAt: z6.number(),
|
|
749
|
+
message: z6.string()
|
|
707
750
|
});
|
|
708
751
|
var hostedBuildSchema = buildIdentitySchema.extend({
|
|
709
752
|
...buildStatusSchema.shape,
|
|
710
|
-
finished:
|
|
711
|
-
current:
|
|
712
|
-
stagingUrl:
|
|
713
|
-
});
|
|
714
|
-
var stagingAccessModeSchema =
|
|
715
|
-
var stagingAccessSchema =
|
|
716
|
-
var stagingAccessInputSchema =
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
mode:
|
|
720
|
-
password:
|
|
753
|
+
finished: z6.boolean(),
|
|
754
|
+
current: z6.boolean(),
|
|
755
|
+
stagingUrl: z6.string().url()
|
|
756
|
+
});
|
|
757
|
+
var stagingAccessModeSchema = z6.enum(["console", "password"]);
|
|
758
|
+
var stagingAccessSchema = z6.object({ mode: stagingAccessModeSchema });
|
|
759
|
+
var stagingAccessInputSchema = z6.discriminatedUnion("mode", [
|
|
760
|
+
z6.object({ mode: z6.literal("console") }).strict(),
|
|
761
|
+
z6.object({
|
|
762
|
+
mode: z6.literal("password"),
|
|
763
|
+
password: z6.string().min(8).max(128)
|
|
721
764
|
}).strict()
|
|
722
765
|
]);
|
|
723
|
-
var stagingPathSchema =
|
|
766
|
+
var stagingPathSchema = z6.string().max(2048).refine(
|
|
724
767
|
(path) => path.startsWith("/") && !path.startsWith("//") && !path.includes("\\"),
|
|
725
768
|
"Expected a path on the staging host"
|
|
726
769
|
);
|
|
727
|
-
var stagingLinkSchema =
|
|
728
|
-
url:
|
|
729
|
-
expiresAt:
|
|
770
|
+
var stagingLinkSchema = z6.object({
|
|
771
|
+
url: z6.string().url(),
|
|
772
|
+
expiresAt: z6.number()
|
|
730
773
|
});
|
|
731
|
-
var buildSnapshotSchema =
|
|
732
|
-
builds:
|
|
774
|
+
var buildSnapshotSchema = z6.object({
|
|
775
|
+
builds: z6.array(hostedBuildSchema),
|
|
733
776
|
current: hostedBuildSchema.nullable(),
|
|
734
777
|
selected: hostedBuildSchema.nullable(),
|
|
735
|
-
logs:
|
|
778
|
+
logs: z6.string()
|
|
736
779
|
});
|
|
737
|
-
var assetPathSchema =
|
|
780
|
+
var assetPathSchema = z6.string().max(512).refine(
|
|
738
781
|
(path) => path.startsWith("/") && // oxlint-disable-next-line no-control-regex -- Asset paths must reject control characters.
|
|
739
782
|
!/[\\\u0000-\u001f?#%]/.test(path) && path.slice(1).split("/").every((part) => part.length > 0 && !part.startsWith(".")),
|
|
740
783
|
"Expected a public asset path without hidden segments"
|
|
741
784
|
);
|
|
742
|
-
var base64Schema =
|
|
785
|
+
var base64Schema = z6.string().regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
|
|
743
786
|
var stagedDeploymentLimits = {
|
|
744
787
|
/** Bytes of JSON, uncompressed. */
|
|
745
788
|
size: 64e6,
|
|
746
789
|
/** Bytes of the Brotli-compressed object. */
|
|
747
790
|
compressedSize: 1e7
|
|
748
791
|
};
|
|
749
|
-
var stagedDeploymentSchema =
|
|
750
|
-
encoding:
|
|
751
|
-
sha256:
|
|
752
|
-
compressedSize:
|
|
753
|
-
size:
|
|
792
|
+
var stagedDeploymentSchema = z6.object({
|
|
793
|
+
encoding: z6.literal("br"),
|
|
794
|
+
sha256: z6.string().regex(/^[0-9a-f]{64}$/),
|
|
795
|
+
compressedSize: z6.number().int().positive().max(stagedDeploymentLimits.compressedSize),
|
|
796
|
+
size: z6.number().int().positive().max(stagedDeploymentLimits.size)
|
|
754
797
|
}).strict();
|
|
755
798
|
var stagedDeploymentContentSchema = stagedDeploymentSchema.extend({
|
|
756
|
-
content:
|
|
799
|
+
content: z6.string().max(Math.ceil(stagedDeploymentLimits.compressedSize / 3) * 4)
|
|
757
800
|
}).strict();
|
|
758
801
|
var stagedDeploymentKey = (build, sha256) => `builds/${build}/deployment/${sha256}.br`;
|
|
759
802
|
var artifactFields = {
|
|
760
803
|
routing: appRoutingSchema,
|
|
761
|
-
worker:
|
|
804
|
+
worker: z6.object({
|
|
762
805
|
...workerSettings,
|
|
763
806
|
migrations: appMigrationsSchema.optional(),
|
|
764
|
-
modules:
|
|
765
|
-
|
|
807
|
+
modules: z6.array(
|
|
808
|
+
z6.object({
|
|
766
809
|
path: outputPathSchema.refine((path) => path !== "metadata"),
|
|
767
|
-
type:
|
|
810
|
+
type: z6.enum([
|
|
768
811
|
"application/javascript+module",
|
|
769
812
|
"application/wasm",
|
|
770
813
|
"text/plain",
|
|
@@ -774,26 +817,26 @@ var artifactFields = {
|
|
|
774
817
|
}).strict()
|
|
775
818
|
).min(1).max(500)
|
|
776
819
|
}).strict().superRefine(distinctBindings).optional(),
|
|
777
|
-
assets:
|
|
778
|
-
|
|
820
|
+
assets: z6.array(
|
|
821
|
+
z6.object({
|
|
779
822
|
path: assetPathSchema,
|
|
780
823
|
content: base64Schema.max(14e6),
|
|
781
|
-
size:
|
|
824
|
+
size: z6.number().int().min(0).max(1e7)
|
|
782
825
|
}).strict()
|
|
783
826
|
).max(500)
|
|
784
827
|
};
|
|
785
|
-
var buildArtifactsSchema =
|
|
786
|
-
|
|
787
|
-
format:
|
|
828
|
+
var buildArtifactsSchema = z6.discriminatedUnion("format", [
|
|
829
|
+
z6.object({
|
|
830
|
+
format: z6.literal(1),
|
|
788
831
|
...artifactFields,
|
|
789
|
-
quests:
|
|
790
|
-
catalog:
|
|
832
|
+
quests: z6.unknown(),
|
|
833
|
+
catalog: z6.unknown()
|
|
791
834
|
}).strict(),
|
|
792
|
-
|
|
793
|
-
format:
|
|
835
|
+
z6.object({
|
|
836
|
+
format: z6.literal(2),
|
|
794
837
|
...artifactFields,
|
|
795
838
|
deployment: stagedDeploymentSchema,
|
|
796
|
-
images:
|
|
839
|
+
images: z6.array(imageAssetArtifactSchema).max(10)
|
|
797
840
|
}).strict()
|
|
798
841
|
]).superRefine((value, ctx) => {
|
|
799
842
|
if (value.worker) {
|
|
@@ -845,39 +888,39 @@ var buildArtifactsSchema = z5.discriminatedUnion("format", [
|
|
|
845
888
|
});
|
|
846
889
|
|
|
847
890
|
// src/server/development.ts
|
|
848
|
-
import { z as
|
|
849
|
-
var developmentPreflightSchema =
|
|
850
|
-
organization:
|
|
851
|
-
project:
|
|
852
|
-
environment:
|
|
853
|
-
identity:
|
|
854
|
-
exchange:
|
|
855
|
-
activeIntegrations:
|
|
891
|
+
import { z as z7 } from "zod";
|
|
892
|
+
var developmentPreflightSchema = z7.object({
|
|
893
|
+
organization: z7.string(),
|
|
894
|
+
project: z7.string(),
|
|
895
|
+
environment: z7.enum(["test", "live"]),
|
|
896
|
+
identity: z7.object({
|
|
897
|
+
exchange: z7.literal("supported"),
|
|
898
|
+
activeIntegrations: z7.number().int().nonnegative()
|
|
856
899
|
}).optional(),
|
|
857
|
-
staging:
|
|
858
|
-
development:
|
|
859
|
-
status:
|
|
900
|
+
staging: z7.enum(["configured", "blocked"]),
|
|
901
|
+
development: z7.object({
|
|
902
|
+
status: z7.enum(["configured", "blocked"]),
|
|
860
903
|
// How `domino dev` reaches the preview origin: a Cloudflare tunnel, or a direct route on a
|
|
861
904
|
// local development stack. APIs that predate the field use tunnels.
|
|
862
|
-
transport:
|
|
863
|
-
missing:
|
|
864
|
-
authentication:
|
|
905
|
+
transport: z7.enum(["tunnel", "direct"]).default("tunnel"),
|
|
906
|
+
missing: z7.array(z7.string()),
|
|
907
|
+
authentication: z7.array(z7.string())
|
|
865
908
|
}),
|
|
866
|
-
checks:
|
|
867
|
-
|
|
868
|
-
id:
|
|
869
|
-
status:
|
|
870
|
-
message:
|
|
871
|
-
missing:
|
|
872
|
-
issues:
|
|
909
|
+
checks: z7.array(
|
|
910
|
+
z7.object({
|
|
911
|
+
id: z7.string(),
|
|
912
|
+
status: z7.enum(["ok", "error"]),
|
|
913
|
+
message: z7.string(),
|
|
914
|
+
missing: z7.array(z7.string()).optional(),
|
|
915
|
+
issues: z7.array(z7.string()).optional()
|
|
873
916
|
})
|
|
874
917
|
)
|
|
875
918
|
});
|
|
876
919
|
|
|
877
920
|
// src/server/hosted.ts
|
|
878
|
-
import { z as
|
|
921
|
+
import { z as z8 } from "zod";
|
|
879
922
|
var hostedKeyPermissions = ["read", "points", "ingest"];
|
|
880
|
-
var hostedKeyPermissionList =
|
|
923
|
+
var hostedKeyPermissionList = z8.array(z8.string()).transform(
|
|
881
924
|
(values) => values.filter(
|
|
882
925
|
(value) => hostedKeyPermissions.includes(value)
|
|
883
926
|
)
|
|
@@ -889,17 +932,17 @@ var hostedManagementBindings = [
|
|
|
889
932
|
"DOMINO_PROJECT",
|
|
890
933
|
"DOMINO_ENVIRONMENT"
|
|
891
934
|
];
|
|
892
|
-
var hostedKeySecretSchema =
|
|
893
|
-
var hostedKeySchema =
|
|
894
|
-
id:
|
|
935
|
+
var hostedKeySecretSchema = z8.string().regex(/^dhk_[A-Za-z0-9_-]{43}$/, "Expected a hosted app key");
|
|
936
|
+
var hostedKeySchema = z8.object({
|
|
937
|
+
id: z8.string().uuid(),
|
|
895
938
|
token: hostedKeySecretSchema,
|
|
896
939
|
organization: identifier,
|
|
897
940
|
project: identifier,
|
|
898
|
-
environment:
|
|
941
|
+
environment: z8.enum(["test", "live"]),
|
|
899
942
|
permissions: hostedKeyPermissionList,
|
|
900
|
-
expiresAt:
|
|
943
|
+
expiresAt: z8.number().nullable()
|
|
901
944
|
}).strict();
|
|
902
|
-
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl:
|
|
945
|
+
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl: z8.string().url() }).strict();
|
|
903
946
|
function hostedManagementClient(env) {
|
|
904
947
|
const missing = hostedManagementBindings.filter((name) => !env[name]);
|
|
905
948
|
if (missing.length) {
|
|
@@ -907,7 +950,7 @@ function hostedManagementClient(env) {
|
|
|
907
950
|
`Missing ${missing.join(", ")}. Domino sets these for hosted apps and domino dev; update the project's vite.config.ts to forward them in development.`
|
|
908
951
|
);
|
|
909
952
|
}
|
|
910
|
-
const environment =
|
|
953
|
+
const environment = z8.enum(["test", "live"]).parse(env.DOMINO_ENVIRONMENT);
|
|
911
954
|
const token = env.DOMINO_MANAGEMENT_KEY;
|
|
912
955
|
return createManagementClient({
|
|
913
956
|
baseUrl: env.DOMINO_API_URL.replace(/\/+$/, ""),
|
|
@@ -919,9 +962,9 @@ function hostedManagementClient(env) {
|
|
|
919
962
|
}
|
|
920
963
|
|
|
921
964
|
// src/server/index.ts
|
|
922
|
-
var environmentSchema =
|
|
923
|
-
var roleSchema =
|
|
924
|
-
var permissionSchema =
|
|
965
|
+
var environmentSchema = z9.enum(["test", "live"]);
|
|
966
|
+
var roleSchema = z9.enum(["editor", "reviewer", "staff"]);
|
|
967
|
+
var permissionSchema = z9.enum([
|
|
925
968
|
"read",
|
|
926
969
|
"publish",
|
|
927
970
|
"review",
|
|
@@ -941,7 +984,7 @@ var permissionSchema = z8.enum([
|
|
|
941
984
|
*/
|
|
942
985
|
"enroll"
|
|
943
986
|
]);
|
|
944
|
-
var permissionListSchema =
|
|
987
|
+
var permissionListSchema = z9.array(z9.string()).transform(
|
|
945
988
|
(values) => values.filter(
|
|
946
989
|
(value) => permissionSchema.safeParse(value).success
|
|
947
990
|
)
|
|
@@ -951,33 +994,33 @@ var rolePermissions = {
|
|
|
951
994
|
reviewer: ["read", "review"],
|
|
952
995
|
staff: ["read", "confirm", "handover"]
|
|
953
996
|
};
|
|
954
|
-
var projectSetupSchema =
|
|
955
|
-
mode:
|
|
956
|
-
brief:
|
|
997
|
+
var projectSetupSchema = z9.object({
|
|
998
|
+
mode: z9.enum(["new", "existing"]),
|
|
999
|
+
brief: z9.string().trim().min(1).max(4e3)
|
|
957
1000
|
}).strict();
|
|
958
|
-
var operatorUserSchema =
|
|
959
|
-
id:
|
|
960
|
-
name:
|
|
961
|
-
email:
|
|
962
|
-
avatar:
|
|
963
|
-
});
|
|
964
|
-
var projectSchema =
|
|
965
|
-
slug:
|
|
966
|
-
createdBy:
|
|
1001
|
+
var operatorUserSchema = z9.object({
|
|
1002
|
+
id: z9.string(),
|
|
1003
|
+
name: z9.string().nullable(),
|
|
1004
|
+
email: z9.string().nullable(),
|
|
1005
|
+
avatar: z9.string().nullable()
|
|
1006
|
+
});
|
|
1007
|
+
var projectSchema = z9.object({
|
|
1008
|
+
slug: z9.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
1009
|
+
createdBy: z9.string().nullable().optional(),
|
|
967
1010
|
creator: operatorUserSchema.nullable().optional(),
|
|
968
1011
|
/** A response, so fields a newer server adds to the setup are dropped, not rejected. */
|
|
969
|
-
setup:
|
|
1012
|
+
setup: z9.object(projectSetupSchema.shape).optional(),
|
|
970
1013
|
/** The starter chosen at setup. A plain string, so later starters still parse. */
|
|
971
|
-
starter:
|
|
972
|
-
id:
|
|
1014
|
+
starter: z9.string().optional(),
|
|
1015
|
+
id: z9.string().min(1),
|
|
973
1016
|
organization: identifier,
|
|
974
1017
|
project: identifier,
|
|
975
|
-
name:
|
|
976
|
-
subtitle:
|
|
977
|
-
initials:
|
|
978
|
-
color:
|
|
1018
|
+
name: z9.string(),
|
|
1019
|
+
subtitle: z9.string(),
|
|
1020
|
+
initials: z9.string(),
|
|
1021
|
+
color: z9.string(),
|
|
979
1022
|
permissions: permissionListSchema,
|
|
980
|
-
environments:
|
|
1023
|
+
environments: z9.array(environmentSchema)
|
|
981
1024
|
}).refine(
|
|
982
1025
|
(project) => !project.creator || project.creator.id === project.createdBy,
|
|
983
1026
|
{
|
|
@@ -985,45 +1028,45 @@ var projectSchema = z8.object({
|
|
|
985
1028
|
path: ["creator"]
|
|
986
1029
|
}
|
|
987
1030
|
);
|
|
988
|
-
var projectInputSchema =
|
|
1031
|
+
var projectInputSchema = z9.object({
|
|
989
1032
|
actionId: identifier,
|
|
990
|
-
name:
|
|
1033
|
+
name: z9.string().trim().min(1).max(80),
|
|
991
1034
|
setup: projectSetupSchema.optional(),
|
|
992
1035
|
/** The starter a new hosted app begins from, with `setup.mode` "new". */
|
|
993
1036
|
starter: starterIdSchema.optional()
|
|
994
1037
|
}).strict();
|
|
995
|
-
var projectUpdateInputSchema =
|
|
996
|
-
|
|
997
|
-
|
|
1038
|
+
var projectUpdateInputSchema = z9.union([
|
|
1039
|
+
z9.object({ name: projectInputSchema.shape.name }).strict(),
|
|
1040
|
+
z9.object({
|
|
998
1041
|
slug: projectSchema.shape.slug,
|
|
999
|
-
confirm:
|
|
1042
|
+
confirm: z9.string().min(1).max(80)
|
|
1000
1043
|
}).strict()
|
|
1001
1044
|
]);
|
|
1002
|
-
var projectDeletionInputSchema =
|
|
1003
|
-
var projectDeletionSchema =
|
|
1045
|
+
var projectDeletionInputSchema = z9.object({ confirm: z9.string().min(1).max(80) }).strict();
|
|
1046
|
+
var projectDeletionSchema = z9.object({
|
|
1004
1047
|
project: identifier,
|
|
1005
|
-
purgeAfter:
|
|
1048
|
+
purgeAfter: z9.number().int()
|
|
1006
1049
|
});
|
|
1007
|
-
var projectTransferInputSchema =
|
|
1008
|
-
var projectTransferSchema =
|
|
1050
|
+
var projectTransferInputSchema = z9.object({ organization: identifier, confirm: z9.string().min(1).max(80) }).strict();
|
|
1051
|
+
var projectTransferSchema = z9.object({
|
|
1009
1052
|
organization: identifier,
|
|
1010
1053
|
project: identifier
|
|
1011
1054
|
});
|
|
1012
|
-
var grantSchema =
|
|
1013
|
-
subject:
|
|
1014
|
-
roles:
|
|
1015
|
-
environments:
|
|
1055
|
+
var grantSchema = z9.object({
|
|
1056
|
+
subject: z9.string().min(1).max(200),
|
|
1057
|
+
roles: z9.array(roleSchema),
|
|
1058
|
+
environments: z9.array(environmentSchema)
|
|
1016
1059
|
}).strict();
|
|
1017
|
-
var grantRecordSchema =
|
|
1018
|
-
var stockAdditionSchema =
|
|
1060
|
+
var grantRecordSchema = z9.object(grantSchema.shape);
|
|
1061
|
+
var stockAdditionSchema = z9.object({
|
|
1019
1062
|
item: identifier,
|
|
1020
|
-
quantity:
|
|
1063
|
+
quantity: z9.number().int(),
|
|
1021
1064
|
actionId: identifier
|
|
1022
1065
|
});
|
|
1023
|
-
var completionRevokeSchema =
|
|
1066
|
+
var completionRevokeSchema = z9.object({
|
|
1024
1067
|
actionId: identifier,
|
|
1025
|
-
reason:
|
|
1026
|
-
freeOccurrence:
|
|
1068
|
+
reason: z9.string().trim().min(1).max(500),
|
|
1069
|
+
freeOccurrence: z9.boolean().default(false)
|
|
1027
1070
|
}).strict();
|
|
1028
1071
|
var RevokedEntitlementOutcome = {
|
|
1029
1072
|
/** No other completion grants the reward: it is void, after cancelling a handover in progress. */
|
|
@@ -1051,213 +1094,216 @@ var RevokedReferralOutcome = {
|
|
|
1051
1094
|
/** Qualified on another accepted completion of the program's quest instead. */
|
|
1052
1095
|
Requalified: "requalified"
|
|
1053
1096
|
};
|
|
1054
|
-
var entitlementOutcomeSchema =
|
|
1055
|
-
var deliveryOutcomeSchema =
|
|
1056
|
-
var referralOutcomeSchema =
|
|
1057
|
-
var completionRevocationSchema =
|
|
1097
|
+
var entitlementOutcomeSchema = z9.string().min(1).max(64);
|
|
1098
|
+
var deliveryOutcomeSchema = z9.string().min(1).max(64);
|
|
1099
|
+
var referralOutcomeSchema = z9.string().min(1).max(64);
|
|
1100
|
+
var completionRevocationSchema = z9.object({
|
|
1058
1101
|
completion: identifier,
|
|
1102
|
+
/** The quest ID, or the board ID when `source.kind` is `leaderboard`. */
|
|
1059
1103
|
quest: identifier,
|
|
1060
1104
|
member: identifier,
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1105
|
+
/** What paid the revoked completion. `source.id` repeats `quest`. */
|
|
1106
|
+
source: completionSourceSchema.optional(),
|
|
1107
|
+
revokedAt: z9.number(),
|
|
1108
|
+
occurrenceFreed: z9.boolean(),
|
|
1109
|
+
points: z9.array(
|
|
1110
|
+
z9.object({
|
|
1065
1111
|
entry: identifier,
|
|
1066
1112
|
balance: identifier,
|
|
1067
1113
|
reversal: identifier.nullable(),
|
|
1068
|
-
reversed:
|
|
1069
|
-
unreversed:
|
|
1114
|
+
reversed: z9.number().int(),
|
|
1115
|
+
unreversed: z9.number().int()
|
|
1070
1116
|
})
|
|
1071
1117
|
),
|
|
1072
|
-
entitlements:
|
|
1073
|
-
|
|
1118
|
+
entitlements: z9.array(
|
|
1119
|
+
z9.object({
|
|
1074
1120
|
entitlement: identifier,
|
|
1075
1121
|
reward: identifier,
|
|
1076
1122
|
outcome: entitlementOutcomeSchema,
|
|
1077
|
-
status:
|
|
1123
|
+
status: z9.string()
|
|
1078
1124
|
})
|
|
1079
1125
|
),
|
|
1080
|
-
deliveries:
|
|
1081
|
-
|
|
1082
|
-
delivery:
|
|
1083
|
-
roleId:
|
|
1126
|
+
deliveries: z9.array(
|
|
1127
|
+
z9.object({
|
|
1128
|
+
delivery: z9.string(),
|
|
1129
|
+
roleId: z9.string(),
|
|
1084
1130
|
outcome: deliveryOutcomeSchema,
|
|
1085
1131
|
/**
|
|
1086
1132
|
* By Relay's records, another accepted, unrevoked completion of the member also granted this
|
|
1087
1133
|
* role to the same Discord account and server. Relay does not read Discord's membership.
|
|
1088
1134
|
*/
|
|
1089
|
-
stillGranted:
|
|
1135
|
+
stillGranted: z9.boolean()
|
|
1090
1136
|
})
|
|
1091
1137
|
),
|
|
1092
|
-
referrals:
|
|
1093
|
-
|
|
1138
|
+
referrals: z9.array(
|
|
1139
|
+
z9.object({
|
|
1094
1140
|
program: identifier,
|
|
1095
1141
|
outcome: referralOutcomeSchema
|
|
1096
1142
|
})
|
|
1097
1143
|
),
|
|
1098
|
-
streakMilestone:
|
|
1099
|
-
});
|
|
1100
|
-
var accessSchema =
|
|
1101
|
-
actor:
|
|
1102
|
-
organization:
|
|
1103
|
-
admin:
|
|
1104
|
-
local:
|
|
1105
|
-
projects:
|
|
1106
|
-
});
|
|
1107
|
-
var querySchema =
|
|
1108
|
-
q:
|
|
1109
|
-
filter:
|
|
1110
|
-
offset:
|
|
1111
|
-
limit:
|
|
1112
|
-
});
|
|
1113
|
-
var accountProfileSchema =
|
|
1114
|
-
name:
|
|
1144
|
+
streakMilestone: z9.boolean()
|
|
1145
|
+
});
|
|
1146
|
+
var accessSchema = z9.object({
|
|
1147
|
+
actor: z9.string(),
|
|
1148
|
+
organization: z9.string(),
|
|
1149
|
+
admin: z9.boolean(),
|
|
1150
|
+
local: z9.boolean(),
|
|
1151
|
+
projects: z9.array(projectSchema)
|
|
1152
|
+
});
|
|
1153
|
+
var querySchema = z9.object({
|
|
1154
|
+
q: z9.string().max(200).default(""),
|
|
1155
|
+
filter: z9.string().max(50).default("all"),
|
|
1156
|
+
offset: z9.coerce.number().int().min(0).max(1e6).default(0),
|
|
1157
|
+
limit: z9.coerce.number().int().min(1).max(100).default(25)
|
|
1158
|
+
});
|
|
1159
|
+
var accountProfileSchema = z9.object({
|
|
1160
|
+
name: z9.string().optional(),
|
|
1115
1161
|
/** The account's handle, where the provider has one (X and Discord). */
|
|
1116
|
-
username:
|
|
1117
|
-
email:
|
|
1118
|
-
emailVerified:
|
|
1119
|
-
imageUrl:
|
|
1162
|
+
username: z9.string().optional(),
|
|
1163
|
+
email: z9.string().optional(),
|
|
1164
|
+
emailVerified: z9.boolean().default(false),
|
|
1165
|
+
imageUrl: z9.string().url().optional()
|
|
1120
1166
|
});
|
|
1121
|
-
var memberAccountSchema =
|
|
1167
|
+
var memberAccountSchema = z9.object({
|
|
1122
1168
|
/** `wallet` for wallet sign-in, `account` for every other connected account. */
|
|
1123
|
-
kind:
|
|
1124
|
-
provider:
|
|
1125
|
-
subject:
|
|
1126
|
-
signInEnabled:
|
|
1169
|
+
kind: z9.enum(["account", "wallet"]),
|
|
1170
|
+
provider: z9.string(),
|
|
1171
|
+
subject: z9.string(),
|
|
1172
|
+
signInEnabled: z9.boolean(),
|
|
1127
1173
|
profile: accountProfileSchema.optional()
|
|
1128
1174
|
});
|
|
1129
|
-
var operationSchema =
|
|
1130
|
-
target:
|
|
1131
|
-
paused:
|
|
1132
|
-
revision:
|
|
1133
|
-
reason:
|
|
1134
|
-
actor:
|
|
1135
|
-
changedAt:
|
|
1136
|
-
});
|
|
1137
|
-
var operationInputSchema =
|
|
1138
|
-
target:
|
|
1139
|
-
|
|
1140
|
-
|
|
1175
|
+
var operationSchema = z9.object({
|
|
1176
|
+
target: z9.string(),
|
|
1177
|
+
paused: z9.boolean(),
|
|
1178
|
+
revision: z9.number().int(),
|
|
1179
|
+
reason: z9.string(),
|
|
1180
|
+
actor: z9.string().nullable(),
|
|
1181
|
+
changedAt: z9.number()
|
|
1182
|
+
});
|
|
1183
|
+
var operationInputSchema = z9.object({
|
|
1184
|
+
target: z9.union([
|
|
1185
|
+
z9.literal("redemptions"),
|
|
1186
|
+
z9.string().regex(/^quest:[\w-]+$/)
|
|
1141
1187
|
]),
|
|
1142
|
-
paused:
|
|
1143
|
-
revision:
|
|
1144
|
-
reason:
|
|
1188
|
+
paused: z9.boolean(),
|
|
1189
|
+
revision: z9.number().int().nonnegative(),
|
|
1190
|
+
reason: z9.string().trim().min(1).max(500),
|
|
1145
1191
|
actionId: identifier
|
|
1146
1192
|
}).strict();
|
|
1147
|
-
var questLifecycleInputSchema =
|
|
1193
|
+
var questLifecycleInputSchema = z9.object({
|
|
1148
1194
|
quest: identifier,
|
|
1149
1195
|
expectedRelease: identifier.optional(),
|
|
1150
|
-
archived:
|
|
1151
|
-
reason:
|
|
1196
|
+
archived: z9.boolean(),
|
|
1197
|
+
reason: z9.string().trim().min(1).max(500),
|
|
1152
1198
|
actionId: identifier
|
|
1153
1199
|
}).strict();
|
|
1154
|
-
var questLifecycleSchema =
|
|
1200
|
+
var questLifecycleSchema = z9.object({
|
|
1155
1201
|
quest: identifier,
|
|
1156
1202
|
key: identifier.nullable(),
|
|
1157
|
-
title:
|
|
1203
|
+
title: z9.string(),
|
|
1158
1204
|
release: identifier,
|
|
1159
|
-
lifecycle:
|
|
1160
|
-
changed:
|
|
1161
|
-
});
|
|
1162
|
-
var memberSchema =
|
|
1163
|
-
id:
|
|
1164
|
-
test:
|
|
1165
|
-
name:
|
|
1166
|
-
accounts:
|
|
1167
|
-
attempts:
|
|
1168
|
-
completions:
|
|
1169
|
-
rewards:
|
|
1170
|
-
lastActivity:
|
|
1171
|
-
});
|
|
1172
|
-
var personSchema =
|
|
1173
|
-
id:
|
|
1174
|
-
accounts:
|
|
1175
|
-
});
|
|
1176
|
-
var metricsSchema =
|
|
1177
|
-
quests:
|
|
1178
|
-
members:
|
|
1179
|
-
attempts:
|
|
1180
|
-
completions:
|
|
1181
|
-
review:
|
|
1182
|
-
failed:
|
|
1183
|
-
entitlements:
|
|
1184
|
-
});
|
|
1185
|
-
var readinessSchema =
|
|
1186
|
-
checks:
|
|
1187
|
-
|
|
1188
|
-
id:
|
|
1189
|
-
status:
|
|
1190
|
-
title:
|
|
1191
|
-
detail:
|
|
1205
|
+
lifecycle: z9.enum(["active", "paused", "archived"]),
|
|
1206
|
+
changed: z9.boolean()
|
|
1207
|
+
});
|
|
1208
|
+
var memberSchema = z9.object({
|
|
1209
|
+
id: z9.string(),
|
|
1210
|
+
test: z9.boolean().optional(),
|
|
1211
|
+
name: z9.string().nullable().optional(),
|
|
1212
|
+
accounts: z9.array(memberAccountSchema).default([]),
|
|
1213
|
+
attempts: z9.number(),
|
|
1214
|
+
completions: z9.number(),
|
|
1215
|
+
rewards: z9.number(),
|
|
1216
|
+
lastActivity: z9.number().nullable()
|
|
1217
|
+
});
|
|
1218
|
+
var personSchema = z9.object({
|
|
1219
|
+
id: z9.string(),
|
|
1220
|
+
accounts: z9.array(memberAccountSchema).default([])
|
|
1221
|
+
});
|
|
1222
|
+
var metricsSchema = z9.object({
|
|
1223
|
+
quests: z9.number(),
|
|
1224
|
+
members: z9.number(),
|
|
1225
|
+
attempts: z9.number(),
|
|
1226
|
+
completions: z9.number(),
|
|
1227
|
+
review: z9.number(),
|
|
1228
|
+
failed: z9.number(),
|
|
1229
|
+
entitlements: z9.number()
|
|
1230
|
+
});
|
|
1231
|
+
var readinessSchema = z9.object({
|
|
1232
|
+
checks: z9.array(
|
|
1233
|
+
z9.object({
|
|
1234
|
+
id: z9.string(),
|
|
1235
|
+
status: z9.enum(["ready", "blocked"]),
|
|
1236
|
+
title: z9.string(),
|
|
1237
|
+
detail: z9.string()
|
|
1192
1238
|
})
|
|
1193
1239
|
)
|
|
1194
1240
|
});
|
|
1195
|
-
var inventorySchema =
|
|
1196
|
-
item:
|
|
1197
|
-
name:
|
|
1198
|
-
available:
|
|
1199
|
-
reserved:
|
|
1200
|
-
allocated:
|
|
1201
|
-
});
|
|
1202
|
-
var auditRecordSchema =
|
|
1203
|
-
id:
|
|
1204
|
-
action:
|
|
1205
|
-
actor:
|
|
1241
|
+
var inventorySchema = z9.object({
|
|
1242
|
+
item: z9.string(),
|
|
1243
|
+
name: z9.string().nullable().default(null),
|
|
1244
|
+
available: z9.number(),
|
|
1245
|
+
reserved: z9.number(),
|
|
1246
|
+
allocated: z9.number().default(0)
|
|
1247
|
+
});
|
|
1248
|
+
var auditRecordSchema = z9.object({
|
|
1249
|
+
id: z9.string(),
|
|
1250
|
+
action: z9.string(),
|
|
1251
|
+
actor: z9.string().nullable(),
|
|
1206
1252
|
user: operatorUserSchema.nullable().optional(),
|
|
1207
|
-
detail:
|
|
1208
|
-
at:
|
|
1209
|
-
attempt:
|
|
1253
|
+
detail: z9.string(),
|
|
1254
|
+
at: z9.number(),
|
|
1255
|
+
attempt: z9.string().nullable()
|
|
1210
1256
|
}).refine((record) => !record.user || record.user.id === record.actor, {
|
|
1211
1257
|
message: "User profile must match the recorded actor",
|
|
1212
1258
|
path: ["user"]
|
|
1213
1259
|
});
|
|
1214
|
-
var pageSchema =
|
|
1260
|
+
var pageSchema = z9.object({
|
|
1215
1261
|
snapshot: snapshotSchema,
|
|
1216
|
-
members:
|
|
1217
|
-
people:
|
|
1262
|
+
members: z9.array(memberSchema),
|
|
1263
|
+
people: z9.array(personSchema).default([]),
|
|
1218
1264
|
metrics: metricsSchema,
|
|
1219
|
-
total:
|
|
1220
|
-
offset:
|
|
1221
|
-
limit:
|
|
1222
|
-
inventory:
|
|
1223
|
-
operations:
|
|
1224
|
-
audit:
|
|
1225
|
-
questCounts:
|
|
1226
|
-
});
|
|
1227
|
-
var managedOAuthAccountBaseSchema =
|
|
1228
|
-
provider:
|
|
1229
|
-
revision:
|
|
1230
|
-
});
|
|
1231
|
-
var managedOAuthAccountSchema =
|
|
1265
|
+
total: z9.number(),
|
|
1266
|
+
offset: z9.number(),
|
|
1267
|
+
limit: z9.number(),
|
|
1268
|
+
inventory: z9.array(inventorySchema),
|
|
1269
|
+
operations: z9.array(operationSchema).default([]),
|
|
1270
|
+
audit: z9.array(auditRecordSchema).default([]),
|
|
1271
|
+
questCounts: z9.record(z9.string(), z9.number())
|
|
1272
|
+
});
|
|
1273
|
+
var managedOAuthAccountBaseSchema = z9.object({
|
|
1274
|
+
provider: z9.enum(["x", "discord"]),
|
|
1275
|
+
revision: z9.number().int().nonnegative()
|
|
1276
|
+
});
|
|
1277
|
+
var managedOAuthAccountSchema = z9.discriminatedUnion("status", [
|
|
1232
1278
|
managedOAuthAccountBaseSchema.extend({
|
|
1233
|
-
status:
|
|
1234
|
-
subject:
|
|
1235
|
-
linkedAt:
|
|
1279
|
+
status: z9.literal("connected"),
|
|
1280
|
+
subject: z9.string().min(1),
|
|
1281
|
+
linkedAt: z9.number()
|
|
1236
1282
|
}),
|
|
1237
|
-
managedOAuthAccountBaseSchema.extend({ status:
|
|
1283
|
+
managedOAuthAccountBaseSchema.extend({ status: z9.literal("disconnected") })
|
|
1238
1284
|
]);
|
|
1239
|
-
var memberOAuthUnlinkInputSchema =
|
|
1240
|
-
provider:
|
|
1241
|
-
subject:
|
|
1242
|
-
revision:
|
|
1243
|
-
reason:
|
|
1285
|
+
var memberOAuthUnlinkInputSchema = z9.object({
|
|
1286
|
+
provider: z9.enum(["x", "discord"]),
|
|
1287
|
+
subject: z9.string().min(1).max(4096),
|
|
1288
|
+
revision: z9.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER - 1),
|
|
1289
|
+
reason: z9.string().trim().min(1).max(500)
|
|
1244
1290
|
}).strict();
|
|
1245
1291
|
var managedWalletSchema = linkedWalletSchema.extend({
|
|
1246
|
-
status:
|
|
1247
|
-
unlinkedAt:
|
|
1292
|
+
status: z9.enum(["linked", "unlinked"]),
|
|
1293
|
+
unlinkedAt: z9.number().int().nullable(),
|
|
1248
1294
|
/** "member", or the operator or key that unlinked it. */
|
|
1249
|
-
unlinkedBy:
|
|
1295
|
+
unlinkedBy: z9.string().nullable()
|
|
1250
1296
|
});
|
|
1251
1297
|
var managedMemberIdentitySchema = memberIdentitySchema.extend({
|
|
1252
|
-
status:
|
|
1253
|
-
unlinkedAt:
|
|
1298
|
+
status: z9.enum(["linked", "unlinked"]),
|
|
1299
|
+
unlinkedAt: z9.number().int().nullable(),
|
|
1254
1300
|
/** The operator or key that unlinked it. */
|
|
1255
|
-
unlinkedBy:
|
|
1301
|
+
unlinkedBy: z9.string().nullable()
|
|
1256
1302
|
});
|
|
1257
|
-
var memberIdentityChangeInputSchema =
|
|
1303
|
+
var memberIdentityChangeInputSchema = z9.object({
|
|
1258
1304
|
kind: appIdentityKindSchema,
|
|
1259
|
-
subject:
|
|
1260
|
-
reason:
|
|
1305
|
+
subject: z9.string().min(1).max(256),
|
|
1306
|
+
reason: z9.string().trim().min(1).max(500)
|
|
1261
1307
|
}).strict();
|
|
1262
1308
|
var balanceCheckSchema = walletBalanceSchema.pick({
|
|
1263
1309
|
chain: true,
|
|
@@ -1267,57 +1313,65 @@ var balanceCheckSchema = walletBalanceSchema.pick({
|
|
|
1267
1313
|
wallets: true,
|
|
1268
1314
|
observedAt: true
|
|
1269
1315
|
}).extend({ attempt: identifier });
|
|
1270
|
-
var walletBalanceChainsSchema =
|
|
1271
|
-
chains:
|
|
1272
|
-
|
|
1273
|
-
chain:
|
|
1274
|
-
|
|
1316
|
+
var walletBalanceChainsSchema = z9.object({
|
|
1317
|
+
chains: z9.array(
|
|
1318
|
+
z9.object({
|
|
1319
|
+
chain: z9.union([
|
|
1320
|
+
z9.literal(solanaMainnet),
|
|
1275
1321
|
cosmosNetworkSchema,
|
|
1276
1322
|
evmChainIdSchema
|
|
1277
1323
|
]),
|
|
1278
|
-
name:
|
|
1279
|
-
testnet:
|
|
1324
|
+
name: z9.string(),
|
|
1325
|
+
testnet: z9.boolean()
|
|
1280
1326
|
})
|
|
1281
1327
|
)
|
|
1282
1328
|
});
|
|
1283
|
-
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason:
|
|
1329
|
+
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason: z9.string().trim().min(1).max(500) }).strict();
|
|
1284
1330
|
var memberWalletSignInInputSchema = walletUnlinkInputSchema.extend({
|
|
1285
|
-
enabled:
|
|
1286
|
-
reason:
|
|
1331
|
+
enabled: z9.boolean(),
|
|
1332
|
+
reason: z9.string().trim().min(1).max(500)
|
|
1287
1333
|
}).strict();
|
|
1288
|
-
var participantSignInSchema =
|
|
1289
|
-
providers:
|
|
1290
|
-
|
|
1334
|
+
var participantSignInSchema = z9.object({
|
|
1335
|
+
providers: z9.array(
|
|
1336
|
+
z9.object({ provider: authProviderSchema, configured: z9.boolean() })
|
|
1291
1337
|
),
|
|
1292
|
-
email:
|
|
1338
|
+
email: z9.boolean(),
|
|
1293
1339
|
/** Wallet families: `"solana"`, `"eip155"`, `"cosmos"`. */
|
|
1294
1340
|
wallets: walletSignInNetworksSchema,
|
|
1295
1341
|
/** Why participants cannot sign in to this project, or null. */
|
|
1296
|
-
issue:
|
|
1297
|
-
updatedAt:
|
|
1298
|
-
updatedBy:
|
|
1342
|
+
issue: z9.string().nullable(),
|
|
1343
|
+
updatedAt: z9.number().nullable(),
|
|
1344
|
+
updatedBy: z9.string().nullable()
|
|
1299
1345
|
});
|
|
1300
|
-
var participantSignInInputSchema =
|
|
1346
|
+
var participantSignInInputSchema = z9.object({
|
|
1301
1347
|
wallets: walletSignInNetworksSchema
|
|
1302
1348
|
}).strict();
|
|
1303
|
-
var
|
|
1349
|
+
var completionRevocationShortfallSchema = z9.object({
|
|
1350
|
+
completion: identifier,
|
|
1351
|
+
quest: identifier,
|
|
1352
|
+
revokedAt: z9.number().int().nonnegative().safe(),
|
|
1353
|
+
unreversedPoints: z9.record(identifier, z9.number().int().positive().safe())
|
|
1354
|
+
});
|
|
1355
|
+
var memberDetailSchema = z9.object({
|
|
1304
1356
|
snapshot: snapshotSchema,
|
|
1305
1357
|
member: memberSchema,
|
|
1306
1358
|
progress: memberProgressSchema,
|
|
1359
|
+
/** Up to 25 revoked completions with an unreversed point remainder, newest first. */
|
|
1360
|
+
revocationShortfalls: z9.array(completionRevocationShortfallSchema).default([]),
|
|
1307
1361
|
/** Current and historical campaign enrollment state, including inactive enrollments. */
|
|
1308
|
-
campaignEnrollments:
|
|
1309
|
-
passes:
|
|
1310
|
-
|
|
1311
|
-
provider:
|
|
1312
|
-
event:
|
|
1313
|
-
subject:
|
|
1362
|
+
campaignEnrollments: z9.array(campaignEnrollmentSchema).default([]),
|
|
1363
|
+
passes: z9.array(
|
|
1364
|
+
z9.object({
|
|
1365
|
+
provider: z9.string(),
|
|
1366
|
+
event: z9.string(),
|
|
1367
|
+
subject: z9.string(),
|
|
1314
1368
|
attempt: identifier.nullable()
|
|
1315
1369
|
})
|
|
1316
1370
|
).default([]),
|
|
1317
1371
|
/** Linked and unlinked wallets. */
|
|
1318
|
-
wallets:
|
|
1372
|
+
wallets: z9.array(managedWalletSchema),
|
|
1319
1373
|
/** The member's 10 most recent recorded balance reads, newest first. */
|
|
1320
|
-
balanceChecks:
|
|
1374
|
+
balanceChecks: z9.array(balanceCheckSchema),
|
|
1321
1375
|
/** The member's participant profile in this project. */
|
|
1322
1376
|
profile: managedProfileSchema.nullable(),
|
|
1323
1377
|
/**
|
|
@@ -1325,44 +1379,117 @@ var memberDetailSchema = z8.object({
|
|
|
1325
1379
|
* member ID: their selected X and Discord accounts and their `app:<name>` identities in this
|
|
1326
1380
|
* project, including app identities an operator unlinked, by kind.
|
|
1327
1381
|
*/
|
|
1328
|
-
identities:
|
|
1382
|
+
identities: z9.array(managedMemberIdentitySchema)
|
|
1329
1383
|
});
|
|
1330
|
-
var stockInputSchema =
|
|
1384
|
+
var stockInputSchema = z9.object({
|
|
1331
1385
|
item: identifier,
|
|
1332
|
-
quantity:
|
|
1386
|
+
quantity: z9.number().int().positive().max(1e6),
|
|
1333
1387
|
actionId: identifier
|
|
1334
1388
|
}).strict();
|
|
1335
|
-
var ingestTrackerScopeSchema =
|
|
1336
|
-
var tokenScopeInputSchema =
|
|
1337
|
-
var tokenInputSchema =
|
|
1338
|
-
name:
|
|
1389
|
+
var ingestTrackerScopeSchema = z9.array(identifier).min(1).max(100).nullable();
|
|
1390
|
+
var tokenScopeInputSchema = z9.object({ ingestTrackers: ingestTrackerScopeSchema }).strict();
|
|
1391
|
+
var tokenInputSchema = z9.object({
|
|
1392
|
+
name: z9.string().trim().min(1).max(80),
|
|
1339
1393
|
project: identifier,
|
|
1340
1394
|
environment: environmentSchema,
|
|
1341
|
-
permissions:
|
|
1395
|
+
permissions: z9.array(permissionSchema).min(1),
|
|
1342
1396
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
1343
|
-
days:
|
|
1397
|
+
days: z9.number().int().min(1).max(90).default(30)
|
|
1344
1398
|
}).strict();
|
|
1345
|
-
var tokenSchema =
|
|
1346
|
-
id:
|
|
1347
|
-
name:
|
|
1348
|
-
project:
|
|
1399
|
+
var tokenSchema = z9.object({
|
|
1400
|
+
id: z9.string(),
|
|
1401
|
+
name: z9.string(),
|
|
1402
|
+
project: z9.string(),
|
|
1349
1403
|
environment: environmentSchema,
|
|
1350
1404
|
permissions: permissionListSchema,
|
|
1351
1405
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
1352
|
-
expiresAt:
|
|
1406
|
+
expiresAt: z9.number()
|
|
1353
1407
|
});
|
|
1354
|
-
var issuedTokenSchema = tokenSchema.extend({ token:
|
|
1355
|
-
var teamSchema =
|
|
1356
|
-
|
|
1408
|
+
var issuedTokenSchema = tokenSchema.extend({ token: z9.string() });
|
|
1409
|
+
var teamSchema = z9.array(
|
|
1410
|
+
z9.object({ id: z9.string(), label: z9.string() })
|
|
1357
1411
|
);
|
|
1358
|
-
var memberLookupSchema =
|
|
1359
|
-
provider:
|
|
1360
|
-
subject:
|
|
1412
|
+
var memberLookupSchema = z9.object({
|
|
1413
|
+
provider: z9.string().min(1).max(200),
|
|
1414
|
+
subject: z9.string().min(1).max(2048)
|
|
1361
1415
|
}).strict();
|
|
1362
|
-
var
|
|
1416
|
+
var booleanQuery = z9.union([
|
|
1417
|
+
z9.boolean(),
|
|
1418
|
+
z9.enum(["true", "false"]).transform((v) => v === "true")
|
|
1419
|
+
]);
|
|
1420
|
+
var managedMemberQuerySchema = z9.strictObject({
|
|
1421
|
+
q: z9.string().max(200).optional(),
|
|
1422
|
+
needsReview: booleanQuery.optional(),
|
|
1423
|
+
limit: z9.coerce.number().int().min(1).max(100).optional(),
|
|
1424
|
+
cursor: pageCursorSchema.optional()
|
|
1425
|
+
});
|
|
1426
|
+
var managedMemberPageSchema = z9.object({
|
|
1427
|
+
items: z9.array(memberSchema),
|
|
1428
|
+
total: z9.number().int().nonnegative(),
|
|
1429
|
+
nextCursor: z9.string().nullable()
|
|
1430
|
+
});
|
|
1431
|
+
var projectMetricsSchema = metricsSchema.extend({
|
|
1432
|
+
completionsByQuest: z9.array(
|
|
1433
|
+
z9.object({ quest: identifier, completions: z9.number() })
|
|
1434
|
+
)
|
|
1435
|
+
});
|
|
1436
|
+
var pageLimit = z9.coerce.number().int().min(1).max(100).optional();
|
|
1437
|
+
var managedAttemptQuerySchema = z9.strictObject({
|
|
1438
|
+
q: z9.string().max(200).optional(),
|
|
1439
|
+
status: z9.string().min(1).max(50).optional(),
|
|
1440
|
+
limit: pageLimit,
|
|
1441
|
+
cursor: pageCursorSchema.optional()
|
|
1442
|
+
});
|
|
1443
|
+
var managedAttemptPageSchema = z9.object({
|
|
1444
|
+
items: z9.array(attemptSchema),
|
|
1445
|
+
releases: z9.array(publishedReleaseSchema),
|
|
1446
|
+
people: z9.array(personSchema),
|
|
1447
|
+
total: z9.number().int().nonnegative(),
|
|
1448
|
+
nextCursor: z9.string().nullable()
|
|
1449
|
+
});
|
|
1450
|
+
var managedAttemptSchema = z9.object({
|
|
1451
|
+
attempt: attemptSchema,
|
|
1452
|
+
release: publishedReleaseSchema.nullable(),
|
|
1453
|
+
events: z9.array(eventSchema),
|
|
1454
|
+
person: personSchema
|
|
1455
|
+
});
|
|
1456
|
+
var managedEntitlementQuerySchema = z9.strictObject({
|
|
1457
|
+
q: z9.string().max(200).optional(),
|
|
1458
|
+
status: z9.string().min(1).max(50).optional(),
|
|
1459
|
+
limit: pageLimit,
|
|
1460
|
+
cursor: pageCursorSchema.optional()
|
|
1461
|
+
});
|
|
1462
|
+
var managedEntitlementPageSchema = z9.object({
|
|
1463
|
+
items: z9.array(entitlementSchema),
|
|
1464
|
+
people: z9.array(personSchema),
|
|
1465
|
+
total: z9.number().int().nonnegative(),
|
|
1466
|
+
nextCursor: z9.string().nullable()
|
|
1467
|
+
});
|
|
1468
|
+
var managedEntitlementSchema = z9.object({
|
|
1469
|
+
entitlement: entitlementSchema,
|
|
1470
|
+
person: personSchema
|
|
1471
|
+
});
|
|
1472
|
+
var managedStockItemSchema = inventorySchema.extend({
|
|
1473
|
+
offers: z9.array(identifier)
|
|
1474
|
+
});
|
|
1475
|
+
var auditQuerySchema = z9.strictObject({
|
|
1476
|
+
category: z9.enum(["reviews", "rewards", "configuration"]).optional(),
|
|
1477
|
+
q: z9.string().max(200).optional(),
|
|
1478
|
+
limit: pageLimit,
|
|
1479
|
+
cursor: pageCursorSchema.optional()
|
|
1480
|
+
});
|
|
1481
|
+
var accessHistoryQuerySchema = auditQuerySchema.omit({
|
|
1482
|
+
category: true
|
|
1483
|
+
});
|
|
1484
|
+
var auditPageSchema = z9.object({
|
|
1485
|
+
items: z9.array(auditRecordSchema),
|
|
1486
|
+
total: z9.number().int().nonnegative(),
|
|
1487
|
+
nextCursor: z9.string().nullable()
|
|
1488
|
+
});
|
|
1489
|
+
var verifiedPassSchema = z9.object({
|
|
1363
1490
|
provider: identifier,
|
|
1364
1491
|
event: identifier,
|
|
1365
|
-
subject:
|
|
1492
|
+
subject: z9.string().min(1).max(2048),
|
|
1366
1493
|
member: identifier,
|
|
1367
1494
|
quest: identifier
|
|
1368
1495
|
}).strict();
|
|
@@ -1372,6 +1499,11 @@ function withActionId(input) {
|
|
|
1372
1499
|
function actionIdOf(input) {
|
|
1373
1500
|
return typeof input === "object" && input !== null && "actionId" in input && typeof input.actionId === "string" ? input.actionId : void 0;
|
|
1374
1501
|
}
|
|
1502
|
+
function groupKey(group) {
|
|
1503
|
+
return identifier.parse(
|
|
1504
|
+
typeof group === "string" ? group : projectGroupKey(group)
|
|
1505
|
+
);
|
|
1506
|
+
}
|
|
1375
1507
|
function queryString(values) {
|
|
1376
1508
|
const query = new URLSearchParams(
|
|
1377
1509
|
Object.entries(values).flatMap(
|
|
@@ -1380,10 +1512,6 @@ function queryString(values) {
|
|
|
1380
1512
|
).toString();
|
|
1381
1513
|
return query ? "?" + query : "";
|
|
1382
1514
|
}
|
|
1383
|
-
var serverErrorSchema = z8.looseObject({
|
|
1384
|
-
error: z8.string(),
|
|
1385
|
-
code: z8.string().optional()
|
|
1386
|
-
});
|
|
1387
1515
|
function checkedTimeout(timeout) {
|
|
1388
1516
|
if (timeout !== void 0 && !validTimeout(timeout)) {
|
|
1389
1517
|
throw new ManagementError({
|
|
@@ -1401,7 +1529,7 @@ function clientFailure(error) {
|
|
|
1401
1529
|
return new ManagementError({
|
|
1402
1530
|
kind: "client",
|
|
1403
1531
|
code: ManagementErrorCode.InvalidInput,
|
|
1404
|
-
message: error instanceof
|
|
1532
|
+
message: error instanceof z9.ZodError ? `Invalid management request: ${z9.prettifyError(error)}` : error instanceof Error ? error.message : "Invalid management request",
|
|
1405
1533
|
cause: error
|
|
1406
1534
|
});
|
|
1407
1535
|
}
|
|
@@ -1422,6 +1550,9 @@ function guarded(api) {
|
|
|
1422
1550
|
);
|
|
1423
1551
|
}
|
|
1424
1552
|
function createManagementClient(options) {
|
|
1553
|
+
return managementClient(options);
|
|
1554
|
+
}
|
|
1555
|
+
function managementClient(options) {
|
|
1425
1556
|
const clientTimeout = checkedTimeout(options.timeout) ?? DEFAULT_MANAGEMENT_TIMEOUT;
|
|
1426
1557
|
function callLifetime(call) {
|
|
1427
1558
|
return lifetime(
|
|
@@ -1544,7 +1675,7 @@ function createManagementClient(options) {
|
|
|
1544
1675
|
body = JSON.parse(text);
|
|
1545
1676
|
} catch {
|
|
1546
1677
|
}
|
|
1547
|
-
const parsed =
|
|
1678
|
+
const parsed = managementErrorSchema.safeParse(body);
|
|
1548
1679
|
const { error, code, ...details } = parsed.success ? parsed.data : { error: `Request failed (${response.status})`, code: void 0 };
|
|
1549
1680
|
throw new ManagementError({
|
|
1550
1681
|
...context,
|
|
@@ -1653,12 +1784,81 @@ function createManagementClient(options) {
|
|
|
1653
1784
|
call
|
|
1654
1785
|
);
|
|
1655
1786
|
}
|
|
1656
|
-
const ok =
|
|
1787
|
+
const ok = z9.object({ ok: z9.literal(true) });
|
|
1788
|
+
function pointHistory(member, ledger, query = {}, call) {
|
|
1789
|
+
return get(
|
|
1790
|
+
`/points/${identifier.parse(member)}/${identifier.parse(ledger)}/history${queryString(typeof query === "number" ? { before: query } : pageQuerySchema.parse(query))}`,
|
|
1791
|
+
managedPointHistoryPageSchema,
|
|
1792
|
+
call
|
|
1793
|
+
);
|
|
1794
|
+
}
|
|
1795
|
+
function referralParticipants(query = {}, call) {
|
|
1796
|
+
return get(
|
|
1797
|
+
`/referrals/participants${queryString(typeof query === "number" ? { before: query } : pageQuerySchema.parse(query))}`,
|
|
1798
|
+
referralManagementSchema,
|
|
1799
|
+
call
|
|
1800
|
+
);
|
|
1801
|
+
}
|
|
1802
|
+
function createPointLedger(input, call) {
|
|
1803
|
+
return create(
|
|
1804
|
+
"/point-ledgers",
|
|
1805
|
+
pointLedgerSchema,
|
|
1806
|
+
createPointLedgerSchema,
|
|
1807
|
+
input,
|
|
1808
|
+
call
|
|
1809
|
+
);
|
|
1810
|
+
}
|
|
1811
|
+
function recordPoints(input, call) {
|
|
1812
|
+
return post(
|
|
1813
|
+
"/points",
|
|
1814
|
+
pointsResultSchema,
|
|
1815
|
+
pointsMutationSchema.parse(input),
|
|
1816
|
+
call
|
|
1817
|
+
);
|
|
1818
|
+
}
|
|
1819
|
+
function publishDeployment(target, call) {
|
|
1820
|
+
const id = typeof target === "string" ? identifier.parse(target) : publishDeploymentSchema.parse(target).id;
|
|
1821
|
+
return post(`/deployments/${id}/publish`, deploymentResultSchema, {}, call);
|
|
1822
|
+
}
|
|
1823
|
+
function submitDeployment(target, call) {
|
|
1824
|
+
const id = typeof target === "string" ? identifier.parse(target) : submitDeploymentSchema.parse(target).id;
|
|
1825
|
+
return post(`/deployments/${id}/submit`, deploymentRecordSchema, {}, call);
|
|
1826
|
+
}
|
|
1827
|
+
function rejectDeployment(target, inputOrCall, call) {
|
|
1828
|
+
const { id, ...input } = typeof target === "string" ? {
|
|
1829
|
+
id: identifier.parse(target),
|
|
1830
|
+
...deploymentRejectionSchema.parse(inputOrCall)
|
|
1831
|
+
} : rejectDeploymentSchema.parse(target);
|
|
1832
|
+
return post(
|
|
1833
|
+
`/deployments/${id}/reject`,
|
|
1834
|
+
deploymentRecordSchema,
|
|
1835
|
+
input,
|
|
1836
|
+
typeof target === "string" ? call : inputOrCall
|
|
1837
|
+
);
|
|
1838
|
+
}
|
|
1839
|
+
function promoteDeployment(target, inputOrCall, call) {
|
|
1840
|
+
return repeatDeployment("promote", target, inputOrCall, call);
|
|
1841
|
+
}
|
|
1842
|
+
function rollbackDeployment(target, inputOrCall, call) {
|
|
1843
|
+
return repeatDeployment("rollback", target, inputOrCall, call);
|
|
1844
|
+
}
|
|
1845
|
+
function repeatDeployment(verb, target, inputOrCall, call) {
|
|
1846
|
+
const { id, ...input } = typeof target === "string" ? {
|
|
1847
|
+
id: identifier.parse(target),
|
|
1848
|
+
...deploymentActionSchema.parse(withActionId(inputOrCall ?? {}))
|
|
1849
|
+
} : promoteDeploymentSchema.parse(withActionId(target));
|
|
1850
|
+
return post(
|
|
1851
|
+
`/deployments/${id}/${verb}`,
|
|
1852
|
+
deploymentRecordSchema,
|
|
1853
|
+
input,
|
|
1854
|
+
typeof target === "string" ? call : inputOrCall
|
|
1855
|
+
);
|
|
1856
|
+
}
|
|
1657
1857
|
return guarded({
|
|
1658
1858
|
raw,
|
|
1659
1859
|
request,
|
|
1660
1860
|
trackers: {
|
|
1661
|
-
list: (call) => get("/trackers",
|
|
1861
|
+
list: (call) => get("/trackers", z9.array(trackerStatusSchema), call),
|
|
1662
1862
|
get: (reference, call) => get(
|
|
1663
1863
|
`/trackers/${identifier.parse(reference)}`,
|
|
1664
1864
|
trackerStatusSchema,
|
|
@@ -1691,12 +1891,25 @@ function createManagementClient(options) {
|
|
|
1691
1891
|
trackerIngestSchema.parse(input),
|
|
1692
1892
|
call
|
|
1693
1893
|
),
|
|
1694
|
-
/**
|
|
1894
|
+
/**
|
|
1895
|
+
* Why each tracker-triggered quest admitted or skipped a record observation, newest first.
|
|
1896
|
+
*
|
|
1897
|
+
* @deprecated Use `triggerOutcomes`, which pages by `cursor` and `nextCursor`. Removed in 2.0.0.
|
|
1898
|
+
*/
|
|
1695
1899
|
outcomes: (reference, query = {}, call) => get(
|
|
1696
1900
|
`/trackers/${identifier.parse(reference)}/outcomes${queryString(trackerOutcomeQuerySchema.parse(query))}`,
|
|
1697
1901
|
trackerOutcomePageSchema,
|
|
1698
1902
|
call
|
|
1699
1903
|
),
|
|
1904
|
+
/**
|
|
1905
|
+
* Why each tracker-triggered quest admitted or skipped a record observation, newest first.
|
|
1906
|
+
* Pass a page's `nextCursor` back as `cursor` for the next page.
|
|
1907
|
+
*/
|
|
1908
|
+
triggerOutcomes: (reference, query = {}, call) => get(
|
|
1909
|
+
`/trackers/${identifier.parse(reference)}/trigger-outcomes${queryString(trackerTriggerOutcomeQuerySchema.parse(query))}`,
|
|
1910
|
+
trackerTriggerOutcomePageSchema,
|
|
1911
|
+
call
|
|
1912
|
+
),
|
|
1700
1913
|
/**
|
|
1701
1914
|
* Re-runs admission for a skipped observation under the quest's current release, links,
|
|
1702
1915
|
* membership and enrollment, releasing historical activity whatever the quest's historical
|
|
@@ -1730,11 +1943,21 @@ function createManagementClient(options) {
|
|
|
1730
1943
|
engagementChangeSchema.parse(input),
|
|
1731
1944
|
call
|
|
1732
1945
|
),
|
|
1946
|
+
/** @deprecated Use `ruleVersions(rule, { cursor })`. Removed in 2.0.0. */
|
|
1733
1947
|
versions: (input, call) => get(
|
|
1734
1948
|
"/engagement/versions" + queryString(engagementVersionQuerySchema.parse(input)),
|
|
1735
1949
|
engagementVersionPageSchema,
|
|
1736
1950
|
call
|
|
1737
1951
|
),
|
|
1952
|
+
/**
|
|
1953
|
+
* An engagement rule's published versions, newest first. Pass a page's `nextCursor` back as
|
|
1954
|
+
* `cursor` for the next page.
|
|
1955
|
+
*/
|
|
1956
|
+
ruleVersions: (rule, query = {}, call) => get(
|
|
1957
|
+
`/engagement/rules/${identifier.parse(rule)}/versions${queryString(pageQuerySchema.parse(query))}`,
|
|
1958
|
+
engagementRuleVersionPageSchema,
|
|
1959
|
+
call
|
|
1960
|
+
),
|
|
1738
1961
|
boundaries: (input, call) => get(
|
|
1739
1962
|
"/engagement/boundaries" + queryString(engagementPageQuerySchema.parse(input)),
|
|
1740
1963
|
engagementBoundaryPageSchema,
|
|
@@ -1746,7 +1969,7 @@ function createManagementClient(options) {
|
|
|
1746
1969
|
engagementPublishSchema.parse(input),
|
|
1747
1970
|
call
|
|
1748
1971
|
),
|
|
1749
|
-
list: (call) => get("/engagement",
|
|
1972
|
+
list: (call) => get("/engagement", z9.array(engagementRuleSchema), call),
|
|
1750
1973
|
page: (input, call) => get(
|
|
1751
1974
|
"/engagement/history" + queryString(engagementPageQuerySchema.parse(input)),
|
|
1752
1975
|
engagementPageSchema,
|
|
@@ -1766,13 +1989,32 @@ function createManagementClient(options) {
|
|
|
1766
1989
|
)
|
|
1767
1990
|
},
|
|
1768
1991
|
pointLedgers: {
|
|
1769
|
-
list: (call) => get("/point-ledgers",
|
|
1770
|
-
|
|
1771
|
-
|
|
1992
|
+
list: (call) => get("/point-ledgers", z9.array(managedPointLedgerSchema), call),
|
|
1993
|
+
/**
|
|
1994
|
+
* Creates a point ledger, with a stable `key` when code refers to it; requires `publish`. In
|
|
1995
|
+
* live, only a person in Console can create one.
|
|
1996
|
+
*/
|
|
1997
|
+
create: createPointLedger,
|
|
1998
|
+
/**
|
|
1999
|
+
* Renames a point ledger, by key or ID, and replaces its description (empty when omitted);
|
|
2000
|
+
* requires `publish`. In live, only a person in Console can change one.
|
|
2001
|
+
*/
|
|
2002
|
+
update: (ledger, input, call) => post(
|
|
2003
|
+
`/point-ledgers/${identifier.parse(ledger)}/update`,
|
|
1772
2004
|
managedPointLedgerSchema,
|
|
1773
|
-
|
|
2005
|
+
pointLedgerPropertiesSchema.parse(input),
|
|
1774
2006
|
call
|
|
1775
2007
|
),
|
|
2008
|
+
/** @deprecated Use `update(ledger, { name, description })`. Removed in 2.0.0. */
|
|
2009
|
+
save: (input, call) => {
|
|
2010
|
+
const { id, ...properties } = pointLedgerSchema.parse(input);
|
|
2011
|
+
return post(
|
|
2012
|
+
`/point-ledgers/${id}/update`,
|
|
2013
|
+
managedPointLedgerSchema,
|
|
2014
|
+
properties,
|
|
2015
|
+
call
|
|
2016
|
+
);
|
|
2017
|
+
},
|
|
1776
2018
|
archive: (ledger, call) => post(
|
|
1777
2019
|
`/point-ledgers/${identifier.parse(ledger)}/archive`,
|
|
1778
2020
|
managedPointLedgerSchema,
|
|
@@ -1781,33 +2023,24 @@ function createManagementClient(options) {
|
|
|
1781
2023
|
)
|
|
1782
2024
|
},
|
|
1783
2025
|
points: {
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
call
|
|
1797
|
-
),
|
|
2026
|
+
/** @deprecated Use `pointLedgers.list()`, which reads the same ledgers. Removed in 2.0.0. */
|
|
2027
|
+
ledgers: (call) => get("/point-ledgers", z9.array(managedPointLedgerSchema), call),
|
|
2028
|
+
/** @deprecated Use `pointLedgers.create(input)`. Removed in 2.0.0. */
|
|
2029
|
+
createLedger: createPointLedger,
|
|
2030
|
+
/**
|
|
2031
|
+
* Records a change to a member's balance in one ledger: an `award`, a `spend`, an `adjust`,
|
|
2032
|
+
* a `reverse` of an earlier award, or a `set` to an absolute total; requires `points`
|
|
2033
|
+
* permission. The action ID makes a retry answer with the first result.
|
|
2034
|
+
*/
|
|
2035
|
+
record: recordPoints,
|
|
2036
|
+
/** @deprecated Use `record`, which makes the same change. Removed in 2.0.0. */
|
|
2037
|
+
update: recordPoints,
|
|
1798
2038
|
balance: (member, balance, call) => get(
|
|
1799
2039
|
`/points/${identifier.parse(member)}/${identifier.parse(balance)}`,
|
|
1800
2040
|
pointsAccountSchema,
|
|
1801
2041
|
call
|
|
1802
2042
|
),
|
|
1803
|
-
history:
|
|
1804
|
-
`/points/${identifier.parse(member)}/${identifier.parse(balance)}/history${queryString({ before })}`,
|
|
1805
|
-
z8.object({
|
|
1806
|
-
items: z8.array(pointsEntrySchema),
|
|
1807
|
-
next: z8.number().nullable()
|
|
1808
|
-
}),
|
|
1809
|
-
call
|
|
1810
|
-
)
|
|
2043
|
+
history: pointHistory
|
|
1811
2044
|
},
|
|
1812
2045
|
referrals: {
|
|
1813
2046
|
/** A member's referral point history, newest first. Pass `nextCursor` as `cursor`. */
|
|
@@ -1816,21 +2049,68 @@ function createManagementClient(options) {
|
|
|
1816
2049
|
referralHistorySchema,
|
|
1817
2050
|
call
|
|
1818
2051
|
),
|
|
1819
|
-
list: (call) => get("/referrals",
|
|
1820
|
-
participants:
|
|
1821
|
-
|
|
1822
|
-
|
|
2052
|
+
list: (call) => get("/referrals", z9.array(publishedReferralSchema), call),
|
|
2053
|
+
participants: referralParticipants,
|
|
2054
|
+
/**
|
|
2055
|
+
* Suspends or restores a member's referral relationship, with a reason; requires `publish`.
|
|
2056
|
+
* A suspended member earns their inviter nothing.
|
|
2057
|
+
*/
|
|
2058
|
+
suspend: (member, input, call) => post(
|
|
2059
|
+
`/referral-relationships/${identifier.parse(member)}/suspend`,
|
|
2060
|
+
ok,
|
|
2061
|
+
referralSuspensionSchema.parse(withActionId(input)),
|
|
1823
2062
|
call
|
|
1824
2063
|
),
|
|
1825
|
-
|
|
1826
|
-
|
|
2064
|
+
/**
|
|
2065
|
+
* Qualifies or unqualifies a member in a referral program after checking a condition outside
|
|
2066
|
+
* Relay, with a reason; requires `publish`.
|
|
2067
|
+
*/
|
|
2068
|
+
qualify: (program, member, input, call) => post(
|
|
2069
|
+
`/referral-programs/${identifier.parse(program)}/members/${identifier.parse(member)}/qualify`,
|
|
1827
2070
|
ok,
|
|
1828
|
-
|
|
2071
|
+
referralQualificationSchema.parse(withActionId(input)),
|
|
1829
2072
|
call
|
|
1830
|
-
)
|
|
2073
|
+
),
|
|
2074
|
+
/**
|
|
2075
|
+
* Marks a referral reward held for review reconciled, so its entitlement can be handed over
|
|
2076
|
+
* again, with a reason; requires `publish`.
|
|
2077
|
+
*/
|
|
2078
|
+
resolveReward: (entitlement, input, call) => post(
|
|
2079
|
+
`/referral-rewards/${identifier.parse(entitlement)}/resolve`,
|
|
2080
|
+
ok,
|
|
2081
|
+
referralRewardResolutionSchema.parse(withActionId(input)),
|
|
2082
|
+
call
|
|
2083
|
+
),
|
|
2084
|
+
/** @deprecated Use `suspend`, `qualify` or `resolveReward`. Removed in 2.0.0. */
|
|
2085
|
+
control: (input, call) => {
|
|
2086
|
+
const parsed = referralControlSchema.parse(input);
|
|
2087
|
+
const { actionId, reason } = parsed;
|
|
2088
|
+
if (parsed.kind === "suspend") {
|
|
2089
|
+
return post(
|
|
2090
|
+
`/referral-relationships/${parsed.member}/suspend`,
|
|
2091
|
+
ok,
|
|
2092
|
+
{ actionId, suspended: parsed.suspended, reason },
|
|
2093
|
+
call
|
|
2094
|
+
);
|
|
2095
|
+
}
|
|
2096
|
+
if (parsed.kind === "qualify") {
|
|
2097
|
+
return post(
|
|
2098
|
+
`/referral-programs/${parsed.program}/members/${parsed.member}/qualify`,
|
|
2099
|
+
ok,
|
|
2100
|
+
{ actionId, qualified: parsed.qualified, reason },
|
|
2101
|
+
call
|
|
2102
|
+
);
|
|
2103
|
+
}
|
|
2104
|
+
return post(
|
|
2105
|
+
`/referral-rewards/${parsed.entitlement}/resolve`,
|
|
2106
|
+
ok,
|
|
2107
|
+
{ actionId, reason },
|
|
2108
|
+
call
|
|
2109
|
+
);
|
|
2110
|
+
}
|
|
1831
2111
|
},
|
|
1832
2112
|
leaderboards: {
|
|
1833
|
-
list: (call) => get("/leaderboards",
|
|
2113
|
+
list: (call) => get("/leaderboards", z9.array(publishedLeaderboardSchema), call),
|
|
1834
2114
|
standings: (board, input = {}, call) => {
|
|
1835
2115
|
const query = leaderboardQuerySchema.parse(input);
|
|
1836
2116
|
return get(
|
|
@@ -1844,12 +2124,12 @@ function createManagementClient(options) {
|
|
|
1844
2124
|
},
|
|
1845
2125
|
history: (board, call) => get(
|
|
1846
2126
|
`/leaderboards/${identifier.parse(board)}/history`,
|
|
1847
|
-
|
|
2127
|
+
z9.array(publishedLeaderboardSchema),
|
|
1848
2128
|
call
|
|
1849
2129
|
),
|
|
1850
2130
|
exclusions: (board, call) => get(
|
|
1851
2131
|
`/leaderboards/${identifier.parse(board)}/exclusions`,
|
|
1852
|
-
|
|
2132
|
+
z9.array(z9.object({ member: identifier })),
|
|
1853
2133
|
call
|
|
1854
2134
|
),
|
|
1855
2135
|
exclude: (board, input, call) => post(
|
|
@@ -1858,15 +2138,22 @@ function createManagementClient(options) {
|
|
|
1858
2138
|
leaderboardExclusionSchema.parse(input),
|
|
1859
2139
|
call
|
|
1860
2140
|
),
|
|
2141
|
+
/**
|
|
2142
|
+
* Adds a member to a group, creating the group (titled with its key) when it is new, or
|
|
2143
|
+
* removes one.
|
|
2144
|
+
*
|
|
2145
|
+
* @deprecated Use `groups.addMember` and `groups.removeMember` instead; create the group
|
|
2146
|
+
* first with `groups.create`. Removed in 2.0.0.
|
|
2147
|
+
*/
|
|
1861
2148
|
group: (group, input, call) => post(
|
|
1862
|
-
`/leaderboard-groups/${
|
|
2149
|
+
`/leaderboard-groups/${groupKey(group)}`,
|
|
1863
2150
|
ok,
|
|
1864
2151
|
leaderboardGroupSchema.parse(input),
|
|
1865
2152
|
call
|
|
1866
2153
|
),
|
|
1867
2154
|
settlements: (board, call) => get(
|
|
1868
2155
|
`/leaderboards/${identifier.parse(board)}/settlements`,
|
|
1869
|
-
|
|
2156
|
+
z9.array(leaderboardSettlementSummarySchema),
|
|
1870
2157
|
call
|
|
1871
2158
|
),
|
|
1872
2159
|
settlement: (settlement, call) => get(
|
|
@@ -1881,8 +2168,72 @@ function createManagementClient(options) {
|
|
|
1881
2168
|
call
|
|
1882
2169
|
)
|
|
1883
2170
|
},
|
|
2171
|
+
/**
|
|
2172
|
+
* Groups: named sets of members that prerequisites (`inGroup`), leaderboards and referral rules
|
|
2173
|
+
* read by key. Reads need `read`; changes need `publish`, in live too.
|
|
2174
|
+
*/
|
|
2175
|
+
groups: {
|
|
2176
|
+
/** Groups by key, archived ones included. Pass `nextCursor` back as `cursor`. */
|
|
2177
|
+
list: (query = {}, call) => get(
|
|
2178
|
+
`/groups${queryString(groupPageQuerySchema.parse(query))}`,
|
|
2179
|
+
groupPageSchema,
|
|
2180
|
+
call
|
|
2181
|
+
),
|
|
2182
|
+
get: (group, call) => get(`/groups/${groupKey(group)}`, managedGroupSchema, call),
|
|
2183
|
+
/** Creates a group. A key already in use fails with 409. */
|
|
2184
|
+
create: (input, call) => create("/groups", managedGroupSchema, createGroupSchema, input, call),
|
|
2185
|
+
/** Renames a group. Its key and members stay. */
|
|
2186
|
+
update: (group, input, call) => post(
|
|
2187
|
+
`/groups/${groupKey(group)}/update`,
|
|
2188
|
+
managedGroupSchema,
|
|
2189
|
+
updateGroupSchema.parse(input),
|
|
2190
|
+
call
|
|
2191
|
+
),
|
|
2192
|
+
/**
|
|
2193
|
+
* Freezes a group's membership. Its members still count for prerequisites, leaderboards
|
|
2194
|
+
* and referral rules.
|
|
2195
|
+
*/
|
|
2196
|
+
archive: (group, call) => post(
|
|
2197
|
+
`/groups/${groupKey(group)}/archive`,
|
|
2198
|
+
managedGroupSchema,
|
|
2199
|
+
{},
|
|
2200
|
+
call
|
|
2201
|
+
),
|
|
2202
|
+
unarchive: (group, call) => post(
|
|
2203
|
+
`/groups/${groupKey(group)}/unarchive`,
|
|
2204
|
+
managedGroupSchema,
|
|
2205
|
+
{},
|
|
2206
|
+
call
|
|
2207
|
+
),
|
|
2208
|
+
/** A group's current members by member ID. Pass `nextCursor` back as `cursor`. */
|
|
2209
|
+
members: (group, query = {}, call) => get(
|
|
2210
|
+
`/groups/${groupKey(group)}/members${queryString(groupPageQuerySchema.parse(query))}`,
|
|
2211
|
+
groupMemberPageSchema,
|
|
2212
|
+
call
|
|
2213
|
+
),
|
|
2214
|
+
/** One current membership; 404 when the member is not in the group. */
|
|
2215
|
+
member: (group, member, call) => get(
|
|
2216
|
+
`/groups/${groupKey(group)}/members/${identifier.parse(member)}`,
|
|
2217
|
+
groupMemberSchema,
|
|
2218
|
+
call
|
|
2219
|
+
),
|
|
2220
|
+
/** Adds a member, or answers their membership when they already belong. */
|
|
2221
|
+
addMember: (group, input, call) => post(
|
|
2222
|
+
`/groups/${groupKey(group)}/members`,
|
|
2223
|
+
groupMemberSchema,
|
|
2224
|
+
addGroupMemberSchema.parse(withActionId(input)),
|
|
2225
|
+
call
|
|
2226
|
+
),
|
|
2227
|
+
/** Removes a member; removing someone who is not a member changes nothing. */
|
|
2228
|
+
removeMember: (group, member, input, call) => post(
|
|
2229
|
+
`/groups/${groupKey(group)}/members/${identifier.parse(member)}/remove`,
|
|
2230
|
+
ok,
|
|
2231
|
+
removeGroupMemberSchema.parse(withActionId(input)),
|
|
2232
|
+
call
|
|
2233
|
+
)
|
|
2234
|
+
},
|
|
1884
2235
|
deployments: {
|
|
1885
|
-
list: (call) => get("/deployments",
|
|
2236
|
+
list: (call) => get("/deployments", z9.array(deploymentRecordSchema), call),
|
|
1886
2237
|
get: (deployment, call) => get(
|
|
1887
2238
|
`/deployments/${identifier.parse(deployment)}`,
|
|
1888
2239
|
deploymentRecordSchema,
|
|
@@ -1897,42 +2248,11 @@ function createManagementClient(options) {
|
|
|
1897
2248
|
call
|
|
1898
2249
|
);
|
|
1899
2250
|
},
|
|
1900
|
-
publish:
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
),
|
|
1906
|
-
submit: (input, call) => post(
|
|
1907
|
-
"/deployments/submit",
|
|
1908
|
-
deploymentRecordSchema,
|
|
1909
|
-
submitDeploymentSchema.parse(input),
|
|
1910
|
-
call
|
|
1911
|
-
),
|
|
1912
|
-
reject: (input, call) => post(
|
|
1913
|
-
"/deployments/reject",
|
|
1914
|
-
deploymentRecordSchema,
|
|
1915
|
-
rejectDeploymentSchema.parse(input),
|
|
1916
|
-
call
|
|
1917
|
-
),
|
|
1918
|
-
promote: (input, call) => {
|
|
1919
|
-
const parsed = promoteDeploymentSchema.parse(withActionId(input));
|
|
1920
|
-
return post(
|
|
1921
|
-
"/deployments/promote",
|
|
1922
|
-
deploymentRecordSchema,
|
|
1923
|
-
parsed,
|
|
1924
|
-
call
|
|
1925
|
-
);
|
|
1926
|
-
},
|
|
1927
|
-
rollback: (input, call) => {
|
|
1928
|
-
const parsed = rollbackDeploymentSchema.parse(withActionId(input));
|
|
1929
|
-
return post(
|
|
1930
|
-
"/deployments/rollback",
|
|
1931
|
-
deploymentRecordSchema,
|
|
1932
|
-
parsed,
|
|
1933
|
-
call
|
|
1934
|
-
);
|
|
1935
|
-
}
|
|
2251
|
+
publish: publishDeployment,
|
|
2252
|
+
submit: submitDeployment,
|
|
2253
|
+
reject: rejectDeployment,
|
|
2254
|
+
promote: promoteDeployment,
|
|
2255
|
+
rollback: rollbackDeployment
|
|
1936
2256
|
},
|
|
1937
2257
|
catalog: {
|
|
1938
2258
|
allocateQuest: (input = {}, call) => create(
|
|
@@ -1974,8 +2294,31 @@ function createManagementClient(options) {
|
|
|
1974
2294
|
call
|
|
1975
2295
|
)
|
|
1976
2296
|
},
|
|
1977
|
-
/**
|
|
2297
|
+
/** The project's headline counts; requires `read` permission. */
|
|
2298
|
+
metrics: {
|
|
2299
|
+
read: (call) => get("/metrics", projectMetricsSchema, call)
|
|
2300
|
+
},
|
|
2301
|
+
/** Attempts, staff-confirmed quests and reviews. */
|
|
1978
2302
|
attempts: {
|
|
2303
|
+
/**
|
|
2304
|
+
* One page of the project's attempts, newest first, with the releases they were admitted
|
|
2305
|
+
* under and the members they name, and `total`, how many match. Pass a page's `nextCursor`
|
|
2306
|
+
* back as `cursor` for the next page; requires `read` permission.
|
|
2307
|
+
*/
|
|
2308
|
+
list: (query = {}, call) => get(
|
|
2309
|
+
`/attempts${queryString(managedAttemptQuerySchema.parse(query))}`,
|
|
2310
|
+
managedAttemptPageSchema,
|
|
2311
|
+
call
|
|
2312
|
+
),
|
|
2313
|
+
/**
|
|
2314
|
+
* One attempt with its release, its recorded events and its member; requires `read`
|
|
2315
|
+
* permission. Fails with 404 when the project has no such attempt.
|
|
2316
|
+
*/
|
|
2317
|
+
get: (attempt, call) => get(
|
|
2318
|
+
`/attempts/${identifier.parse(attempt)}`,
|
|
2319
|
+
managedAttemptSchema,
|
|
2320
|
+
call
|
|
2321
|
+
),
|
|
1979
2322
|
/**
|
|
1980
2323
|
* Submits a staff-confirmed quest (`manual({ actor: "staff" })`) for a member; requires
|
|
1981
2324
|
* `confirm` permission. Resolves with the queued attempt, or with the original attempt when
|
|
@@ -2065,8 +2408,27 @@ function createManagementClient(options) {
|
|
|
2065
2408
|
call
|
|
2066
2409
|
)
|
|
2067
2410
|
},
|
|
2068
|
-
/**
|
|
2411
|
+
/** Members' reward entitlements; corrections require `review` permission. */
|
|
2069
2412
|
entitlements: {
|
|
2413
|
+
/**
|
|
2414
|
+
* One page of the project's entitlements, newest first, with the members they name, and
|
|
2415
|
+
* `total`, how many match. Pass a page's `nextCursor` back as `cursor` for the next page;
|
|
2416
|
+
* requires `read` permission.
|
|
2417
|
+
*/
|
|
2418
|
+
list: (query = {}, call) => get(
|
|
2419
|
+
`/entitlements${queryString(managedEntitlementQuerySchema.parse(query))}`,
|
|
2420
|
+
managedEntitlementPageSchema,
|
|
2421
|
+
call
|
|
2422
|
+
),
|
|
2423
|
+
/**
|
|
2424
|
+
* One entitlement and its member; requires `read` permission. Fails with 404 when the
|
|
2425
|
+
* project has no such entitlement.
|
|
2426
|
+
*/
|
|
2427
|
+
get: (entitlement, call) => get(
|
|
2428
|
+
`/entitlements/${identifier.parse(entitlement)}`,
|
|
2429
|
+
managedEntitlementSchema,
|
|
2430
|
+
call
|
|
2431
|
+
),
|
|
2070
2432
|
/**
|
|
2071
2433
|
* Voids an available entitlement granted by mistake, at the `revision` the operator saw, with
|
|
2072
2434
|
* a reason. It can no longer be handed over. A quest that grants the member the same reward
|
|
@@ -2104,6 +2466,8 @@ function createManagementClient(options) {
|
|
|
2104
2466
|
)
|
|
2105
2467
|
},
|
|
2106
2468
|
operations: {
|
|
2469
|
+
/** Every paused or resumed operation: redemptions and each quest's participation; requires `read`. */
|
|
2470
|
+
list: (call) => get("/operations", z9.array(operationSchema), call),
|
|
2107
2471
|
/**
|
|
2108
2472
|
* Pauses or resumes redemptions or one quest's participation, against the `revision` the
|
|
2109
2473
|
* operator saw, with a reason; requires `publish` permission.
|
|
@@ -2116,6 +2480,8 @@ function createManagementClient(options) {
|
|
|
2116
2480
|
)
|
|
2117
2481
|
},
|
|
2118
2482
|
inventory: {
|
|
2483
|
+
/** Every stock item with its counts and the offers that sell it; requires `read` permission. */
|
|
2484
|
+
list: (call) => get("/stock-items", z9.array(managedStockItemSchema), call),
|
|
2119
2485
|
createItem: (input, call) => create(
|
|
2120
2486
|
"/stock-items",
|
|
2121
2487
|
stockItemSchema,
|
|
@@ -2130,7 +2496,7 @@ function createManagementClient(options) {
|
|
|
2130
2496
|
stockInputSchema.parse(withActionId(input)),
|
|
2131
2497
|
call
|
|
2132
2498
|
),
|
|
2133
|
-
catalog: (call) => get("/pickup-inventory",
|
|
2499
|
+
catalog: (call) => get("/pickup-inventory", z9.array(pickupCatalogSchema), call),
|
|
2134
2500
|
configure: (input, call) => post(
|
|
2135
2501
|
"/pickup-inventory",
|
|
2136
2502
|
pickupCatalogSchema,
|
|
@@ -2144,10 +2510,10 @@ function createManagementClient(options) {
|
|
|
2144
2510
|
)
|
|
2145
2511
|
},
|
|
2146
2512
|
offers: {
|
|
2147
|
-
list: (call) => get("/offers",
|
|
2513
|
+
list: (call) => get("/offers", z9.array(offerSchema), call),
|
|
2148
2514
|
redemptions: (input = {}, call) => get(
|
|
2149
2515
|
`/redemptions${queryString({ member: input.member })}`,
|
|
2150
|
-
|
|
2516
|
+
z9.array(redemptionSchema),
|
|
2151
2517
|
call
|
|
2152
2518
|
),
|
|
2153
2519
|
/** Pauses or resumes an offer at the revision the operator saw. */
|
|
@@ -2195,7 +2561,7 @@ function createManagementClient(options) {
|
|
|
2195
2561
|
* them; API keys and project-scoped playground sessions cannot.
|
|
2196
2562
|
*/
|
|
2197
2563
|
tokens: {
|
|
2198
|
-
list: (call) => get("/tokens",
|
|
2564
|
+
list: (call) => get("/tokens", z9.array(tokenSchema), call),
|
|
2199
2565
|
/**
|
|
2200
2566
|
* Issues a key for one project and environment, limited to permissions the caller holds
|
|
2201
2567
|
* there. The secret `token` is in this response only.
|
|
@@ -2203,14 +2569,14 @@ function createManagementClient(options) {
|
|
|
2203
2569
|
create: (input, call) => post("/tokens", issuedTokenSchema, tokenInputSchema.parse(input), call),
|
|
2204
2570
|
/** Replace a personal key's ingestion restriction without changing its secret. */
|
|
2205
2571
|
scope: (id, input, call) => request(
|
|
2206
|
-
`/tokens/${encodeURIComponent(
|
|
2572
|
+
`/tokens/${encodeURIComponent(z9.string().min(1).parse(id))}/scope`,
|
|
2207
2573
|
tokenSchema,
|
|
2208
2574
|
tokenScopeInputSchema.parse(input),
|
|
2209
2575
|
"PUT",
|
|
2210
2576
|
call
|
|
2211
2577
|
),
|
|
2212
2578
|
revoke: (id, call) => request(
|
|
2213
|
-
`/tokens/${encodeURIComponent(
|
|
2579
|
+
`/tokens/${encodeURIComponent(z9.string().min(1).parse(id))}`,
|
|
2214
2580
|
ok,
|
|
2215
2581
|
void 0,
|
|
2216
2582
|
"DELETE",
|
|
@@ -2219,7 +2585,7 @@ function createManagementClient(options) {
|
|
|
2219
2585
|
},
|
|
2220
2586
|
/** Who holds which roles on the client's project; organization administrators only. */
|
|
2221
2587
|
grants: {
|
|
2222
|
-
list: (call) => get("/grants",
|
|
2588
|
+
list: (call) => get("/grants", z9.array(grantRecordSchema), call),
|
|
2223
2589
|
/** Replaces one person's roles and environments on the project. The audit log records it. */
|
|
2224
2590
|
set: (input, call) => request(
|
|
2225
2591
|
"/grants",
|
|
@@ -2235,7 +2601,7 @@ function createManagementClient(options) {
|
|
|
2235
2601
|
},
|
|
2236
2602
|
/** Signed activity notifications for one project/environment; writes require publish permission. */
|
|
2237
2603
|
webhooks: {
|
|
2238
|
-
list: (call) => get("/webhooks",
|
|
2604
|
+
list: (call) => get("/webhooks", z9.array(webhookEndpointSchema), call),
|
|
2239
2605
|
create: (input, call) => post(
|
|
2240
2606
|
"/webhooks",
|
|
2241
2607
|
webhookSecretSchema,
|
|
@@ -2243,31 +2609,31 @@ function createManagementClient(options) {
|
|
|
2243
2609
|
call
|
|
2244
2610
|
),
|
|
2245
2611
|
update: (id, input, call) => request(
|
|
2246
|
-
`/webhooks/${
|
|
2612
|
+
`/webhooks/${z9.string().uuid().parse(id)}`,
|
|
2247
2613
|
webhookEndpointSchema,
|
|
2248
2614
|
webhookUpdateSchema.parse(input),
|
|
2249
2615
|
"PUT",
|
|
2250
2616
|
call
|
|
2251
2617
|
),
|
|
2252
2618
|
disable: (id, call) => post(
|
|
2253
|
-
`/webhooks/${
|
|
2619
|
+
`/webhooks/${z9.string().uuid().parse(id)}/disable`,
|
|
2254
2620
|
webhookEndpointSchema,
|
|
2255
2621
|
{},
|
|
2256
2622
|
call
|
|
2257
2623
|
),
|
|
2258
2624
|
rotateSecret: (id, call) => post(
|
|
2259
|
-
`/webhooks/${
|
|
2625
|
+
`/webhooks/${z9.string().uuid().parse(id)}/rotate-secret`,
|
|
2260
2626
|
webhookSecretSchema,
|
|
2261
2627
|
{},
|
|
2262
2628
|
call
|
|
2263
2629
|
),
|
|
2264
2630
|
deliveries: (id, query = {}, call) => get(
|
|
2265
|
-
`/webhooks/${
|
|
2631
|
+
`/webhooks/${z9.string().uuid().parse(id)}/deliveries${queryString(webhookQuerySchema.parse(query))}`,
|
|
2266
2632
|
webhookDeliveryPageSchema,
|
|
2267
2633
|
call
|
|
2268
2634
|
),
|
|
2269
2635
|
replay: (id, delivery, call) => post(
|
|
2270
|
-
`/webhooks/${
|
|
2636
|
+
`/webhooks/${z9.string().uuid().parse(id)}/deliveries/${z9.string().uuid().parse(delivery)}/replay`,
|
|
2271
2637
|
webhookDeliverySchema,
|
|
2272
2638
|
{},
|
|
2273
2639
|
call
|
|
@@ -2278,7 +2644,7 @@ function createManagementClient(options) {
|
|
|
2278
2644
|
* environment. Organization administrators, from a Console session only.
|
|
2279
2645
|
*/
|
|
2280
2646
|
identityIntegrations: {
|
|
2281
|
-
list: (call) => get("/identity-integrations",
|
|
2647
|
+
list: (call) => get("/identity-integrations", z9.array(identityIntegrationSchema), call),
|
|
2282
2648
|
/** The secret `token` is in this response only. */
|
|
2283
2649
|
create: (input, call) => post(
|
|
2284
2650
|
"/identity-integrations",
|
|
@@ -2288,7 +2654,7 @@ function createManagementClient(options) {
|
|
|
2288
2654
|
),
|
|
2289
2655
|
/** Replaces the key's secret and extends it by 90 days; the old secret stops working. */
|
|
2290
2656
|
rotate: (id, call) => post(
|
|
2291
|
-
`/identity-integrations/${
|
|
2657
|
+
`/identity-integrations/${z9.string().uuid().parse(id)}/rotate`,
|
|
2292
2658
|
identityIntegrationSecretSchema,
|
|
2293
2659
|
{},
|
|
2294
2660
|
call
|
|
@@ -2300,7 +2666,7 @@ function createManagementClient(options) {
|
|
|
2300
2666
|
*/
|
|
2301
2667
|
kinds: (call) => get(
|
|
2302
2668
|
"/identity-integrations/kinds",
|
|
2303
|
-
|
|
2669
|
+
z9.array(identityKindClaimSchema),
|
|
2304
2670
|
call
|
|
2305
2671
|
),
|
|
2306
2672
|
/**
|
|
@@ -2308,18 +2674,57 @@ function createManagementClient(options) {
|
|
|
2308
2674
|
* and keep attributing tracker records; unlink them on the member to stop that.
|
|
2309
2675
|
*/
|
|
2310
2676
|
revoke: (id, call) => request(
|
|
2311
|
-
`/identity-integrations/${
|
|
2312
|
-
|
|
2677
|
+
`/identity-integrations/${z9.string().uuid().parse(id)}`,
|
|
2678
|
+
z9.null(),
|
|
2313
2679
|
void 0,
|
|
2314
2680
|
"DELETE",
|
|
2315
2681
|
call
|
|
2316
2682
|
)
|
|
2317
2683
|
},
|
|
2684
|
+
/**
|
|
2685
|
+
* One of Console's former screens (`overview`, `quests`, `activity`, `members`, `rewards`,
|
|
2686
|
+
* `releases`, `settings`, `audit`), paged by `offset`.
|
|
2687
|
+
*
|
|
2688
|
+
* @deprecated Replace each page as follows. `overview` uses `metrics.read`, `attempts.list`,
|
|
2689
|
+
* `quests.list` and `operations.list`; its `detail` has no effect. `quests` uses `quests.list`
|
|
2690
|
+
* and finds a `detail` quest in that result. `activity` uses `attempts.list`, and its `detail`
|
|
2691
|
+
* uses `attempts.get`. `members` uses `members.list`; `page()` ignores its `detail`, while
|
|
2692
|
+
* `members.get` reads a member. `rewards` uses `entitlements.list` and `inventory.list`, and
|
|
2693
|
+
* its `detail` uses `entitlements.get`. No resource read lists historical releases or reads
|
|
2694
|
+
* one historical release, so `releases` and its `detail` have no exact replacement;
|
|
2695
|
+
* `quests.list` returns current releases only. `settings` uses `metrics.read`, `quests.list`
|
|
2696
|
+
* and `operations.list`; its `detail` has no effect. `audit` uses `audit.list`, except
|
|
2697
|
+
* `filter: "access"` uses `audit.access`; its `detail` has no effect. On every page,
|
|
2698
|
+
* `detail: "new"` is client-side create mode and triggers no replacement read. Resource lists
|
|
2699
|
+
* take `cursor` instead of `offset`. Removed in 2.0.0.
|
|
2700
|
+
*/
|
|
2318
2701
|
page: (page, query, call) => get(`/${page}${queryString(query)}`, pageSchema, call),
|
|
2702
|
+
/** The project's audit history; requires `read` permission. */
|
|
2703
|
+
audit: {
|
|
2704
|
+
/**
|
|
2705
|
+
* One page of the project's operations in this environment (reviews, reward changes and
|
|
2706
|
+
* configuration), newest first, and `total`, how many match. Pass a page's `nextCursor`
|
|
2707
|
+
* back as `cursor` for the next page.
|
|
2708
|
+
*/
|
|
2709
|
+
list: (query = {}, call) => get(
|
|
2710
|
+
`/audit/list${queryString(auditQuerySchema.parse(query))}`,
|
|
2711
|
+
auditPageSchema,
|
|
2712
|
+
call
|
|
2713
|
+
),
|
|
2714
|
+
/**
|
|
2715
|
+
* One page of the project's access and API key changes across test and live, newest first.
|
|
2716
|
+
* Requires an organization administrator's Console session or CLI sign-in.
|
|
2717
|
+
*/
|
|
2718
|
+
access: (query = {}, call) => get(
|
|
2719
|
+
`/audit/access${queryString(accessHistoryQuerySchema.parse(query))}`,
|
|
2720
|
+
auditPageSchema,
|
|
2721
|
+
call
|
|
2722
|
+
)
|
|
2723
|
+
},
|
|
2319
2724
|
resources: {
|
|
2320
2725
|
list: (call) => get(
|
|
2321
2726
|
"/resources",
|
|
2322
|
-
|
|
2727
|
+
z9.object({ resources: z9.array(managedResourceSchema) }),
|
|
2323
2728
|
call
|
|
2324
2729
|
),
|
|
2325
2730
|
lifecycle: (input, call) => post(
|
|
@@ -2355,7 +2760,7 @@ function createManagementClient(options) {
|
|
|
2355
2760
|
testMemberCreateSchema.parse(input),
|
|
2356
2761
|
call
|
|
2357
2762
|
),
|
|
2358
|
-
list: (call) => get("/test-members",
|
|
2763
|
+
list: (call) => get("/test-members", z9.array(testMemberSchema), call),
|
|
2359
2764
|
history: (member, query = {}, call) => get(
|
|
2360
2765
|
`/test-members/${identifier.parse(member)}/history${queryString(testMemberHistoryQuerySchema.parse(query))}`,
|
|
2361
2766
|
testMemberHistorySchema,
|
|
@@ -2396,6 +2801,16 @@ function createManagementClient(options) {
|
|
|
2396
2801
|
call
|
|
2397
2802
|
)
|
|
2398
2803
|
},
|
|
2804
|
+
/**
|
|
2805
|
+
* One page of the project's members, most recently joined first, with their accounts and
|
|
2806
|
+
* activity counts, and `total`, how many match. Pass a page's `nextCursor` back as `cursor`
|
|
2807
|
+
* for the next page; requires `read` permission.
|
|
2808
|
+
*/
|
|
2809
|
+
list: (query = {}, call) => get(
|
|
2810
|
+
`/members/list${queryString(managedMemberQuerySchema.parse(query))}`,
|
|
2811
|
+
managedMemberPageSchema,
|
|
2812
|
+
call
|
|
2813
|
+
),
|
|
2399
2814
|
/** A member's detail: accounts, progress, passes, wallets and profile. */
|
|
2400
2815
|
get: (member, call) => get(`/members/${encodeURIComponent(member)}`, memberDetailSchema, call),
|
|
2401
2816
|
/**
|
|
@@ -2412,26 +2827,26 @@ function createManagementClient(options) {
|
|
|
2412
2827
|
/** Who each member is: up to 100 distinct IDs; unknown IDs come back without accounts. */
|
|
2413
2828
|
people: (members, call) => get(
|
|
2414
2829
|
`/people${queryString({ ids: members.join(",") })}`,
|
|
2415
|
-
|
|
2830
|
+
z9.array(personSchema),
|
|
2416
2831
|
call
|
|
2417
2832
|
),
|
|
2418
2833
|
/** Current X and Discord quest account selections; requires read permission. */
|
|
2419
2834
|
oauthAccounts: (member, call) => get(
|
|
2420
2835
|
`/members/${encodeURIComponent(member)}/oauth-accounts`,
|
|
2421
|
-
|
|
2836
|
+
z9.array(managedOAuthAccountSchema),
|
|
2422
2837
|
call
|
|
2423
2838
|
),
|
|
2424
2839
|
/** Unlinks the reviewed selection across this organization/environment, preserving ownership and sign-in. */
|
|
2425
2840
|
unlinkOAuthAccount: (member, input, call) => post(
|
|
2426
2841
|
`/members/${encodeURIComponent(member)}/oauth-accounts/unlink`,
|
|
2427
|
-
|
|
2842
|
+
z9.array(managedOAuthAccountSchema),
|
|
2428
2843
|
memberOAuthUnlinkInputSchema.parse(input),
|
|
2429
2844
|
call
|
|
2430
2845
|
),
|
|
2431
2846
|
/** Unlinks a member's wallet from the project with a reason; requires `review` permission. The address stays bound to the member. */
|
|
2432
2847
|
unlinkWallet: (member, input, call) => post(
|
|
2433
2848
|
`/members/${encodeURIComponent(member)}/wallets/unlink`,
|
|
2434
|
-
|
|
2849
|
+
z9.array(managedWalletSchema),
|
|
2435
2850
|
memberWalletUnlinkInputSchema.parse(input),
|
|
2436
2851
|
call
|
|
2437
2852
|
),
|
|
@@ -2442,14 +2857,14 @@ function createManagementClient(options) {
|
|
|
2442
2857
|
*/
|
|
2443
2858
|
unlinkIdentity: (member, input, call) => post(
|
|
2444
2859
|
`/members/${encodeURIComponent(member)}/identities/unlink`,
|
|
2445
|
-
|
|
2860
|
+
z9.array(managedMemberIdentitySchema),
|
|
2446
2861
|
memberIdentityChangeInputSchema.parse(input),
|
|
2447
2862
|
call
|
|
2448
2863
|
),
|
|
2449
2864
|
/** Relinks an `app:<name>` identity an operator unlinked from this member, with a reason; requires `review` permission. */
|
|
2450
2865
|
relinkIdentity: (member, input, call) => post(
|
|
2451
2866
|
`/members/${encodeURIComponent(member)}/identities/relink`,
|
|
2452
|
-
|
|
2867
|
+
z9.array(managedMemberIdentitySchema),
|
|
2453
2868
|
memberIdentityChangeInputSchema.parse(input),
|
|
2454
2869
|
call
|
|
2455
2870
|
),
|
|
@@ -2459,7 +2874,7 @@ function createManagementClient(options) {
|
|
|
2459
2874
|
*/
|
|
2460
2875
|
setWalletSignIn: (member, input, call) => post(
|
|
2461
2876
|
`/members/${encodeURIComponent(member)}/wallets/sign-in`,
|
|
2462
|
-
|
|
2877
|
+
z9.array(managedWalletSchema),
|
|
2463
2878
|
memberWalletSignInInputSchema.parse(input),
|
|
2464
2879
|
call
|
|
2465
2880
|
)
|
|
@@ -2494,13 +2909,18 @@ function createManagementClient(options) {
|
|
|
2494
2909
|
appStorageTablesSchema,
|
|
2495
2910
|
call
|
|
2496
2911
|
),
|
|
2497
|
-
/**
|
|
2912
|
+
/**
|
|
2913
|
+
* One page of 50 rows in the table's storage order, which rows changing in between can shift.
|
|
2914
|
+
* Pass a page's `nextCursor` back as `cursor` for the next page.
|
|
2915
|
+
*/
|
|
2498
2916
|
rows: (name, table, options2 = {}, call) => get(
|
|
2499
|
-
`/storage/sql/${appSecretNameSchema.parse(name)}/rows?${new URLSearchParams(
|
|
2917
|
+
`/storage/sql/${appSecretNameSchema.parse(name)}/rows?${new URLSearchParams(
|
|
2918
|
+
options2.cursor === void 0 ? { table, offset: String(options2.offset ?? 0) } : { table, cursor: pageCursorSchema.parse(options2.cursor) }
|
|
2919
|
+
)}`,
|
|
2500
2920
|
appStorageRowsSchema,
|
|
2501
2921
|
call
|
|
2502
2922
|
),
|
|
2503
|
-
/** One page of a KV store's keys
|
|
2923
|
+
/** One page of a KV store's keys. Pass a page's `nextCursor` back as `cursor` for the next. */
|
|
2504
2924
|
keys: (name, options2 = {}, call) => get(
|
|
2505
2925
|
`/storage/kv/${appSecretNameSchema.parse(name)}/keys?${new URLSearchParams(
|
|
2506
2926
|
Object.entries(options2).filter(
|
|
@@ -2598,6 +3018,11 @@ function createManagementClient(options) {
|
|
|
2598
3018
|
)
|
|
2599
3019
|
},
|
|
2600
3020
|
quests: {
|
|
3021
|
+
/**
|
|
3022
|
+
* Each quest's current release, the most recently published first, archived quests
|
|
3023
|
+
* included; requires `read` permission.
|
|
3024
|
+
*/
|
|
3025
|
+
list: (call) => get("/quests/list", z9.array(publishedReleaseSchema), call),
|
|
2601
3026
|
/** Pending and exhausted asynchronous balance checks. Requires read. */
|
|
2602
3027
|
automaticScheduling: (query = {}, call) => get(
|
|
2603
3028
|
`/quests/automatic-scheduling${queryString(automaticSchedulingQuerySchema.parse(query))}`,
|
|
@@ -2699,17 +3124,21 @@ export {
|
|
|
2699
3124
|
APP_SQL_LIMIT,
|
|
2700
3125
|
APP_STORAGE_PREVIEW_CHARACTERS,
|
|
2701
3126
|
APP_STORAGE_ROW_LIMIT,
|
|
3127
|
+
CompletionSourceKind,
|
|
2702
3128
|
DEFAULT_MANAGEMENT_TIMEOUT,
|
|
2703
3129
|
ManagementError,
|
|
2704
3130
|
ManagementErrorCode,
|
|
3131
|
+
PayoutSourceKind,
|
|
2705
3132
|
RevokedDeliveryOutcome,
|
|
2706
3133
|
RevokedEntitlementOutcome,
|
|
2707
3134
|
RevokedReferralOutcome,
|
|
2708
3135
|
WEBHOOK_MAX_BYTES,
|
|
3136
|
+
accessHistoryQuerySchema,
|
|
2709
3137
|
accessSchema,
|
|
2710
3138
|
accountProfileSchema,
|
|
2711
3139
|
activityTypeSchema,
|
|
2712
3140
|
activityTypes,
|
|
3141
|
+
addGroupMemberSchema,
|
|
2713
3142
|
appMigrationNameSchema,
|
|
2714
3143
|
appRoutingSchema,
|
|
2715
3144
|
appSecretDeclarationSchema,
|
|
@@ -2728,6 +3157,8 @@ export {
|
|
|
2728
3157
|
appStorageTablesSchema,
|
|
2729
3158
|
appStorageValueSchema,
|
|
2730
3159
|
assetPathSchema,
|
|
3160
|
+
auditPageSchema,
|
|
3161
|
+
auditQuerySchema,
|
|
2731
3162
|
auditRecordSchema,
|
|
2732
3163
|
balanceCheckSchema,
|
|
2733
3164
|
buildArtifactsSchema,
|
|
@@ -2738,18 +3169,27 @@ export {
|
|
|
2738
3169
|
commitSchema,
|
|
2739
3170
|
compareAppMigrations,
|
|
2740
3171
|
completionRevocationSchema,
|
|
3172
|
+
completionRevocationShortfallSchema,
|
|
2741
3173
|
completionRevokeSchema,
|
|
3174
|
+
createGroupSchema,
|
|
2742
3175
|
createManagementClient,
|
|
2743
3176
|
createRepositorySchema,
|
|
3177
|
+
deploymentActionSchema,
|
|
3178
|
+
deploymentRejectionSchema,
|
|
2744
3179
|
developmentPreflightSchema,
|
|
2745
3180
|
deviceApproveSchema,
|
|
2746
3181
|
deviceRedeemSchema,
|
|
2747
3182
|
deviceStartSchema,
|
|
3183
|
+
engagementRuleVersionPageSchema,
|
|
2748
3184
|
entitlementCorrectionSchema,
|
|
2749
3185
|
entitlementSchema,
|
|
2750
3186
|
environmentSchema,
|
|
2751
3187
|
grantRecordSchema,
|
|
2752
3188
|
grantSchema,
|
|
3189
|
+
groupMemberPageSchema,
|
|
3190
|
+
groupMemberSchema,
|
|
3191
|
+
groupPageQuerySchema,
|
|
3192
|
+
groupPageSchema,
|
|
2753
3193
|
hostedAppSchema,
|
|
2754
3194
|
hostedAppSecretsSchema,
|
|
2755
3195
|
hostedBuildSchema,
|
|
@@ -2765,10 +3205,22 @@ export {
|
|
|
2765
3205
|
inventorySchema,
|
|
2766
3206
|
isManagementError,
|
|
2767
3207
|
issuedTokenSchema,
|
|
3208
|
+
managedAttemptPageSchema,
|
|
3209
|
+
managedAttemptQuerySchema,
|
|
3210
|
+
managedAttemptSchema,
|
|
3211
|
+
managedEntitlementPageSchema,
|
|
3212
|
+
managedEntitlementQuerySchema,
|
|
3213
|
+
managedEntitlementSchema,
|
|
3214
|
+
managedGroupSchema,
|
|
2768
3215
|
managedMemberIdentitySchema,
|
|
3216
|
+
managedMemberPageSchema,
|
|
3217
|
+
managedMemberQuerySchema,
|
|
2769
3218
|
managedOAuthAccountSchema,
|
|
3219
|
+
managedPointHistoryPageSchema,
|
|
2770
3220
|
managedResourceSchema,
|
|
3221
|
+
managedStockItemSchema,
|
|
2771
3222
|
managedWalletSchema,
|
|
3223
|
+
managementErrorSchema,
|
|
2772
3224
|
memberAccountSchema,
|
|
2773
3225
|
memberDetailSchema,
|
|
2774
3226
|
memberIdentityChangeInputSchema,
|
|
@@ -2787,9 +3239,11 @@ export {
|
|
|
2787
3239
|
participantSignInSchema,
|
|
2788
3240
|
permissionSchema,
|
|
2789
3241
|
personSchema,
|
|
3242
|
+
pointLedgerPropertiesSchema,
|
|
2790
3243
|
projectDeletionInputSchema,
|
|
2791
3244
|
projectDeletionSchema,
|
|
2792
3245
|
projectInputSchema,
|
|
3246
|
+
projectMetricsSchema,
|
|
2793
3247
|
projectSchema,
|
|
2794
3248
|
projectSetupSchema,
|
|
2795
3249
|
projectTransferInputSchema,
|
|
@@ -2799,6 +3253,11 @@ export {
|
|
|
2799
3253
|
questLifecycleInputSchema,
|
|
2800
3254
|
questLifecycleSchema,
|
|
2801
3255
|
readinessSchema,
|
|
3256
|
+
referralManagementSchema,
|
|
3257
|
+
referralQualificationSchema,
|
|
3258
|
+
referralRewardResolutionSchema,
|
|
3259
|
+
referralSuspensionSchema,
|
|
3260
|
+
removeGroupMemberSchema,
|
|
2802
3261
|
repositorySchema,
|
|
2803
3262
|
resourceLifecycleInputSchema,
|
|
2804
3263
|
resourceLifecycleKindSchema,
|
|
@@ -2831,6 +3290,8 @@ export {
|
|
|
2831
3290
|
tokenInputSchema,
|
|
2832
3291
|
tokenSchema,
|
|
2833
3292
|
tokenScopeInputSchema,
|
|
3293
|
+
trackerTriggerOutcomePageSchema,
|
|
3294
|
+
updateGroupSchema,
|
|
2834
3295
|
verifiedPassSchema,
|
|
2835
3296
|
verifyWebhook,
|
|
2836
3297
|
walletBalanceChainsSchema,
|