@domino-sdk/relay 1.10.1 → 1.11.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/authoring.d.ts +37 -37
- package/dist/authoring.js +3 -3
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +8 -8
- package/dist/{chunk-PFKV2M4B.js → chunk-7JHREQ2D.js} +1 -1
- package/dist/{chunk-FH7ZFHDB.js → chunk-CFTTECZZ.js} +2 -2
- package/dist/{chunk-2M3HLQFP.js → chunk-DG4QQUH7.js} +1 -1
- package/dist/{chunk-A2KXEGGD.js → chunk-DJOGMLYT.js} +3 -3
- package/dist/{chunk-S4IHOJEP.js → chunk-FISNMJN3.js} +1 -1
- package/dist/{chunk-NM2ZAWTF.js → chunk-GKTD36JW.js} +2 -2
- package/dist/{chunk-5WK4EB5I.js → chunk-GXT4S5IK.js} +5 -0
- package/dist/{chunk-MJMFGTVV.js → chunk-KLF7XABH.js} +1 -1
- package/dist/{chunk-PRLGLZM4.js → chunk-TV2GYBDZ.js} +1 -1
- package/dist/{chunk-MDN5EJY2.js → chunk-U4KTGJWU.js} +6 -6
- package/dist/{chunk-XMZNIFXH.js → chunk-UIBDEAP2.js} +5 -5
- package/dist/{chunk-WZJQ7XAT.js → chunk-ULU5ZF6R.js} +1 -1
- package/dist/{client-Yq11HA_f.d.ts → client-Dz14Kuu8.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -7
- package/dist/internal.js +5 -5
- package/dist/{pages-D00JDZB-.d.ts → pages-tSpttGrI.d.ts} +9 -3
- package/dist/portal-proxy.js +3 -3
- package/dist/react/index.d.ts +4 -4
- package/dist/react/index.js +8 -8
- package/dist/schema.d.ts +304 -304
- package/dist/schema.js +8 -6
- package/dist/server/index.d.ts +1394 -27
- package/dist/server/index.js +895 -603
- package/dist/{sign-in-options-Coim0G1u.d.ts → sign-in-options-rPCsFr7w.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/{activity-C0O3g7VJ.d.ts → activity-CNiPDPK6.d.ts} +114 -114
package/dist/server/index.js
CHANGED
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
publishDeploymentSchema,
|
|
22
22
|
rejectDeploymentSchema,
|
|
23
23
|
submitDeploymentSchema
|
|
24
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-UIBDEAP2.js";
|
|
25
25
|
import "../chunk-MC6V6VMG.js";
|
|
26
26
|
import {
|
|
27
27
|
REFERRAL_INTEGRATION_REWARD_ERROR,
|
|
@@ -35,15 +35,15 @@ import {
|
|
|
35
35
|
participantExchangeSchema,
|
|
36
36
|
questConfiguration,
|
|
37
37
|
sequenceCursorSchema
|
|
38
|
-
} from "../chunk-
|
|
38
|
+
} from "../chunk-DJOGMLYT.js";
|
|
39
39
|
import {
|
|
40
40
|
imageAssetArtifactSchema
|
|
41
|
-
} from "../chunk-
|
|
41
|
+
} from "../chunk-FISNMJN3.js";
|
|
42
42
|
import {
|
|
43
43
|
sourceDataSchema,
|
|
44
44
|
sourceRoles,
|
|
45
45
|
validateQuestShape
|
|
46
|
-
} from "../chunk-
|
|
46
|
+
} from "../chunk-ULU5ZF6R.js";
|
|
47
47
|
import {
|
|
48
48
|
isIntegrationParticipantPath,
|
|
49
49
|
isParticipantRoute,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
} from "../chunk-AXRMT33W.js";
|
|
53
53
|
import {
|
|
54
54
|
withActionId
|
|
55
|
-
} from "../chunk-
|
|
55
|
+
} from "../chunk-7JHREQ2D.js";
|
|
56
56
|
import {
|
|
57
57
|
allocateQuestSchema,
|
|
58
58
|
allocatedQuestSchema,
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
rewardDeliveriesSchema,
|
|
71
71
|
rewardDeliverySchema,
|
|
72
72
|
saveQuestDraftSchema
|
|
73
|
-
} from "../chunk-
|
|
73
|
+
} from "../chunk-GKTD36JW.js";
|
|
74
74
|
import {
|
|
75
75
|
cosmosNetworkSchema,
|
|
76
76
|
createPointLedgerSchema,
|
|
@@ -121,7 +121,7 @@ import {
|
|
|
121
121
|
walletBalanceSchema,
|
|
122
122
|
walletSignInNetworksSchema,
|
|
123
123
|
walletUnlinkInputSchema
|
|
124
|
-
} from "../chunk-
|
|
124
|
+
} from "../chunk-KLF7XABH.js";
|
|
125
125
|
import {
|
|
126
126
|
MANAGEMENT_TIMEOUT,
|
|
127
127
|
lifetime,
|
|
@@ -135,8 +135,8 @@ import {
|
|
|
135
135
|
} from "../chunk-NPGENI7K.js";
|
|
136
136
|
import {
|
|
137
137
|
clientIdentity
|
|
138
|
-
} from "../chunk-
|
|
139
|
-
import "../chunk-
|
|
138
|
+
} from "../chunk-DG4QQUH7.js";
|
|
139
|
+
import "../chunk-TV2GYBDZ.js";
|
|
140
140
|
import {
|
|
141
141
|
CompletionSourceKind,
|
|
142
142
|
addGroupMemberSchema,
|
|
@@ -168,6 +168,7 @@ import {
|
|
|
168
168
|
identifier,
|
|
169
169
|
knownResponse,
|
|
170
170
|
managedGroupSchema,
|
|
171
|
+
managementStateQuerySchema,
|
|
171
172
|
memberCampaignEnrollmentInputSchema,
|
|
172
173
|
memberCampaignWithdrawalInputSchema,
|
|
173
174
|
memberIdentitySchema,
|
|
@@ -208,123 +209,259 @@ import {
|
|
|
208
209
|
trackerTriggerOutcomeQuerySchema,
|
|
209
210
|
updateGroupSchema,
|
|
210
211
|
whereSchemaIssue
|
|
211
|
-
} from "../chunk-
|
|
212
|
+
} from "../chunk-GXT4S5IK.js";
|
|
212
213
|
|
|
213
|
-
// src/server/
|
|
214
|
+
// src/server/identity-links.ts
|
|
214
215
|
import { z } from "zod";
|
|
215
|
-
var
|
|
216
|
+
var walletIdentitySelectorSchema = walletUnlinkInputSchema.extend({
|
|
217
|
+
kind: z.literal("wallet")
|
|
218
|
+
});
|
|
219
|
+
var oauthIdentitySelectorSchema = z.strictObject({
|
|
220
|
+
kind: z.literal("oauth"),
|
|
221
|
+
provider: z.enum(["x", "discord"]),
|
|
222
|
+
issuer: z.string().min(1).max(4096),
|
|
223
|
+
subject: z.string().min(1).max(4096)
|
|
224
|
+
});
|
|
225
|
+
var identityLinkSelectorSchema = z.discriminatedUnion("kind", [
|
|
226
|
+
walletIdentitySelectorSchema,
|
|
227
|
+
oauthIdentitySelectorSchema
|
|
228
|
+
]);
|
|
229
|
+
var state = {
|
|
230
|
+
revision: z.number().int().safe().nonnegative(),
|
|
231
|
+
linked: z.boolean(),
|
|
232
|
+
canRelink: z.boolean(),
|
|
233
|
+
linkedAt: z.number().int().safe().nonnegative().nullable()
|
|
234
|
+
};
|
|
235
|
+
var memberIdentityLinkSchema = z.discriminatedUnion("kind", [
|
|
236
|
+
walletIdentitySelectorSchema.strip().extend({
|
|
237
|
+
...state,
|
|
238
|
+
scope: z.literal("project"),
|
|
239
|
+
project: z.string()
|
|
240
|
+
}),
|
|
241
|
+
oauthIdentitySelectorSchema.strip().extend({
|
|
242
|
+
...state,
|
|
243
|
+
scope: z.literal("organization-environment")
|
|
244
|
+
})
|
|
245
|
+
]);
|
|
246
|
+
var identityLinkRelinkInputSchema = z.strictObject({
|
|
247
|
+
actionId: z.string().uuid().default(() => crypto.randomUUID()),
|
|
248
|
+
identity: identityLinkSelectorSchema,
|
|
249
|
+
expectedRevision: z.number().int().safe().nonnegative(),
|
|
250
|
+
reason: z.string().trim().min(1).max(500)
|
|
251
|
+
});
|
|
252
|
+
var memberIdentityLinkPageSchema = z.object({
|
|
253
|
+
items: z.array(memberIdentityLinkSchema),
|
|
254
|
+
nextCursor: pageCursorSchema.nullable()
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
// src/server/settlement-reviews.ts
|
|
258
|
+
import { z as z2 } from "zod";
|
|
259
|
+
var decision = {
|
|
260
|
+
status: z2.enum(["pending", "approved", "rejected"]),
|
|
261
|
+
rejectedAt: z2.number().int().safe().nonnegative().nullable(),
|
|
262
|
+
rejectedBy: z2.string().nullable(),
|
|
263
|
+
rejectionReason: z2.string().nullable()
|
|
264
|
+
};
|
|
265
|
+
var leaderboardSettlementReviewSummarySchema = leaderboardSettlementSummarySchema.extend(decision);
|
|
266
|
+
var leaderboardSettlementReviewSchema = leaderboardSettlementSchema.extend(decision);
|
|
267
|
+
var leaderboardSettlementReviewQuerySchema = z2.strictObject({
|
|
268
|
+
cursor: pageCursorSchema.optional(),
|
|
269
|
+
limit: z2.coerce.number().int().min(1).max(100).default(25)
|
|
270
|
+
});
|
|
271
|
+
var leaderboardSettlementReviewPageSchema = z2.object({
|
|
272
|
+
items: z2.array(leaderboardSettlementReviewSummarySchema),
|
|
273
|
+
nextCursor: pageCursorSchema.nullable()
|
|
274
|
+
});
|
|
275
|
+
var leaderboardSettlementRejectionSchema = z2.strictObject({
|
|
276
|
+
actionId: z2.string().uuid().default(() => crypto.randomUUID()),
|
|
277
|
+
expectedCreatedAt: z2.number().int().safe().nonnegative(),
|
|
278
|
+
reason: z2.string().trim().min(1).max(500)
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
// src/server/inventory-items.ts
|
|
282
|
+
import { z as z3 } from "zod";
|
|
283
|
+
var inventoryItemStateSchema = z3.object({
|
|
284
|
+
item: identifier,
|
|
285
|
+
name: z3.string().nullable(),
|
|
286
|
+
available: z3.number().int().safe().nonnegative(),
|
|
287
|
+
reserved: z3.number().int().safe().nonnegative(),
|
|
288
|
+
allocated: z3.number().int().safe().nonnegative(),
|
|
289
|
+
offers: z3.array(identifier),
|
|
290
|
+
revision: z3.number().int().nonnegative(),
|
|
291
|
+
archivedAt: z3.number().int().safe().nonnegative().nullable()
|
|
292
|
+
});
|
|
293
|
+
var correction = {
|
|
294
|
+
actionId: z3.string().uuid().default(() => crypto.randomUUID()),
|
|
295
|
+
expectedRevision: z3.number().int().nonnegative(),
|
|
296
|
+
reason: z3.string().trim().min(1).max(500)
|
|
297
|
+
};
|
|
298
|
+
var inventoryItemActionSchema = z3.strictObject(correction);
|
|
299
|
+
var inventoryItemRenameSchema = z3.strictObject({
|
|
300
|
+
...correction,
|
|
301
|
+
name: z3.string().trim().min(1).max(200)
|
|
302
|
+
});
|
|
303
|
+
var inventoryStockCorrectionSchema = z3.strictObject({
|
|
304
|
+
...correction,
|
|
305
|
+
delta: z3.number().int().safe()
|
|
306
|
+
});
|
|
307
|
+
var inventoryItemPageSchema = z3.object({
|
|
308
|
+
items: z3.array(inventoryItemStateSchema),
|
|
309
|
+
nextCursor: pageCursorSchema.nullable()
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
// src/server/quest-enrollments.ts
|
|
313
|
+
import { z as z4 } from "zod";
|
|
314
|
+
var questEnrollmentStateSchema = questEnrollmentSchema.extend({
|
|
315
|
+
revision: z4.number().int().nonnegative(),
|
|
316
|
+
withdrawnAt: z4.number().int().safe().nonnegative().nullable(),
|
|
317
|
+
withdrawalReason: z4.string().nullable()
|
|
318
|
+
});
|
|
319
|
+
var managedQuestEnrollmentSchema = questEnrollmentStateSchema.extend({
|
|
320
|
+
title: z4.string(),
|
|
321
|
+
key: z4.string().nullable()
|
|
322
|
+
});
|
|
323
|
+
var questEnrollmentWithdrawalInputSchema = z4.object({
|
|
324
|
+
actionId: z4.string().uuid().default(() => crypto.randomUUID()),
|
|
325
|
+
expectedRevision: z4.number().int().nonnegative(),
|
|
326
|
+
reason: z4.string().trim().min(1).max(500)
|
|
327
|
+
}).strict();
|
|
328
|
+
var managedQuestEnrollmentPageSchema = z4.object({
|
|
329
|
+
items: z4.array(managedQuestEnrollmentSchema),
|
|
330
|
+
nextCursor: pageCursorSchema.nullable()
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
// src/server/test-members.ts
|
|
334
|
+
import { z as z5 } from "zod";
|
|
335
|
+
var testMemberSchema = z5.object({
|
|
216
336
|
id: identifier,
|
|
217
|
-
name:
|
|
218
|
-
test:
|
|
337
|
+
name: z5.string(),
|
|
338
|
+
test: z5.literal(true),
|
|
219
339
|
/** Current project-calendar date (YYYY-MM-DD), computed by the server. */
|
|
220
|
-
today:
|
|
340
|
+
today: z5.iso.date().optional(),
|
|
221
341
|
/** Number of calendar days advanced; absent means zero for older servers. */
|
|
222
|
-
offsetDays:
|
|
342
|
+
offsetDays: z5.number().int().min(0).optional()
|
|
223
343
|
});
|
|
224
|
-
var testMemberCreateSchema =
|
|
344
|
+
var testMemberCreateSchema = z5.object({
|
|
225
345
|
actionId: identifier,
|
|
226
|
-
name:
|
|
346
|
+
name: z5.string().trim().min(1).max(40)
|
|
227
347
|
}).strict();
|
|
228
348
|
var testMemberActionSchema = submitSchema.omit({ member: true, faultAfterReview: true }).extend({
|
|
229
|
-
operation:
|
|
349
|
+
operation: z5.literal("attempts.submit")
|
|
230
350
|
}).strict();
|
|
231
|
-
var testMemberResetSchema =
|
|
232
|
-
var testMemberAdvanceSchema =
|
|
351
|
+
var testMemberResetSchema = z5.object({ actionId: identifier }).strict();
|
|
352
|
+
var testMemberAdvanceSchema = z5.object({
|
|
233
353
|
actionId: identifier,
|
|
234
|
-
days:
|
|
354
|
+
days: z5.number().int().min(1).max(30)
|
|
235
355
|
}).strict();
|
|
236
|
-
var testMemberResetResultSchema =
|
|
356
|
+
var testMemberResetResultSchema = z5.object({
|
|
237
357
|
member: identifier,
|
|
238
|
-
deleted:
|
|
358
|
+
deleted: z5.literal(true)
|
|
239
359
|
});
|
|
240
|
-
var testMemberHistoryQuerySchema =
|
|
360
|
+
var testMemberHistoryQuerySchema = z5.object({
|
|
241
361
|
/** Inclusive lower bound on credited activity time, in epoch milliseconds. */
|
|
242
|
-
since:
|
|
362
|
+
since: z5.coerce.number().int().nonnegative().safe().optional()
|
|
243
363
|
});
|
|
244
|
-
var testMemberHistorySchema =
|
|
364
|
+
var testMemberHistorySchema = z5.object({
|
|
245
365
|
/** Newest credited activity first, up to 500 attempts. */
|
|
246
|
-
attempts:
|
|
247
|
-
attemptSchema.extend({ eligibleAt:
|
|
366
|
+
attempts: z5.array(
|
|
367
|
+
attemptSchema.extend({ eligibleAt: z5.number().int().nonnegative().safe() })
|
|
248
368
|
),
|
|
249
369
|
/** Tracker trigger outcomes that admitted no attempt, newest occurrence first, up to 500. */
|
|
250
|
-
skipped:
|
|
251
|
-
|
|
370
|
+
skipped: z5.array(
|
|
371
|
+
z5.object({
|
|
252
372
|
quest: identifier,
|
|
253
373
|
tracker: identifier,
|
|
254
|
-
record:
|
|
255
|
-
code:
|
|
256
|
-
occurredAt:
|
|
374
|
+
record: z5.string(),
|
|
375
|
+
code: z5.string().min(1),
|
|
376
|
+
occurredAt: z5.number().int().nonnegative().safe()
|
|
257
377
|
})
|
|
258
378
|
),
|
|
259
379
|
/** False when older entries were omitted from either list. */
|
|
260
|
-
complete:
|
|
380
|
+
complete: z5.boolean()
|
|
261
381
|
});
|
|
262
382
|
|
|
263
383
|
// src/server/webhooks.ts
|
|
264
|
-
import { z as
|
|
384
|
+
import { z as z6 } from "zod";
|
|
265
385
|
var PayoutSourceKind = {
|
|
266
386
|
Quest: "quest",
|
|
267
387
|
Leaderboard: "leaderboard",
|
|
268
388
|
Engagement: "engagement",
|
|
269
389
|
Manual: "manual"
|
|
270
390
|
};
|
|
271
|
-
var webhookEventSchema =
|
|
272
|
-
id:
|
|
273
|
-
version:
|
|
391
|
+
var webhookEventSchema = z6.object({
|
|
392
|
+
id: z6.string().uuid(),
|
|
393
|
+
version: z6.literal(1),
|
|
274
394
|
type: activityTypeSchema,
|
|
275
|
-
createdAt:
|
|
276
|
-
organization:
|
|
277
|
-
project:
|
|
278
|
-
environment:
|
|
279
|
-
data:
|
|
280
|
-
});
|
|
281
|
-
var webhookControlInputSchema =
|
|
282
|
-
var webhookInputSchema =
|
|
283
|
-
url:
|
|
395
|
+
createdAt: z6.number().int().nonnegative(),
|
|
396
|
+
organization: z6.string(),
|
|
397
|
+
project: z6.string(),
|
|
398
|
+
environment: z6.enum(["test", "live"]),
|
|
399
|
+
data: z6.record(z6.string(), z6.json())
|
|
400
|
+
});
|
|
401
|
+
var webhookControlInputSchema = z6.object({ actionId: z6.string().uuid().optional() }).strict();
|
|
402
|
+
var webhookInputSchema = z6.object({
|
|
403
|
+
url: z6.url().max(2048).refine((value) => {
|
|
284
404
|
const url = new URL(value);
|
|
285
405
|
return url.protocol === "https:" && !url.username && !url.password && !url.hash;
|
|
286
406
|
}, "Use an HTTPS URL without credentials or a fragment"),
|
|
287
|
-
types:
|
|
407
|
+
types: z6.array(activityTypeSchema).min(1).max(100).refine((v) => new Set(v).size === v.length)
|
|
288
408
|
}).strict();
|
|
289
|
-
var webhookUpdateSchema = webhookInputSchema.partial().extend({ enabled:
|
|
290
|
-
var webhookEndpointSchema =
|
|
409
|
+
var webhookUpdateSchema = webhookInputSchema.partial().extend({ enabled: z6.boolean().optional() }).strict();
|
|
410
|
+
var webhookEndpointSchema = z6.object({
|
|
291
411
|
...webhookInputSchema.shape,
|
|
292
|
-
id:
|
|
293
|
-
enabled:
|
|
294
|
-
disabledReason:
|
|
295
|
-
consecutiveFailures:
|
|
296
|
-
createdAt:
|
|
297
|
-
updatedAt:
|
|
298
|
-
});
|
|
299
|
-
var
|
|
412
|
+
id: z6.string().uuid(),
|
|
413
|
+
enabled: z6.boolean(),
|
|
414
|
+
disabledReason: z6.string().nullable(),
|
|
415
|
+
consecutiveFailures: z6.number().int().nonnegative(),
|
|
416
|
+
createdAt: z6.number(),
|
|
417
|
+
updatedAt: z6.number()
|
|
418
|
+
});
|
|
419
|
+
var webhookEndpointStateSchema = webhookEndpointSchema.extend({
|
|
420
|
+
revision: z6.number().int().nonnegative(),
|
|
421
|
+
deletedAt: z6.number().int().safe().nonnegative().nullable()
|
|
422
|
+
});
|
|
423
|
+
var webhookDeleteInputSchema = z6.strictObject({
|
|
424
|
+
actionId: z6.string().uuid().default(() => crypto.randomUUID()),
|
|
425
|
+
expectedRevision: z6.number().int().nonnegative(),
|
|
426
|
+
reason: z6.string().trim().min(1).max(500)
|
|
427
|
+
});
|
|
428
|
+
var webhookStateQuerySchema = z6.strictObject({
|
|
429
|
+
cursor: pageCursorSchema.optional(),
|
|
430
|
+
limit: z6.coerce.number().int().min(1).max(100).default(50)
|
|
431
|
+
});
|
|
432
|
+
var webhookStatePageSchema = z6.object({
|
|
433
|
+
items: z6.array(webhookEndpointStateSchema),
|
|
434
|
+
nextCursor: pageCursorSchema.nullable()
|
|
435
|
+
});
|
|
436
|
+
var webhookSecretSchema = z6.object({
|
|
300
437
|
endpoint: webhookEndpointSchema,
|
|
301
|
-
secret:
|
|
302
|
-
previousValidUntil:
|
|
438
|
+
secret: z6.string(),
|
|
439
|
+
previousValidUntil: z6.number().nullable()
|
|
303
440
|
});
|
|
304
|
-
var webhookDeliverySchema =
|
|
305
|
-
id:
|
|
306
|
-
endpoint:
|
|
441
|
+
var webhookDeliverySchema = z6.object({
|
|
442
|
+
id: z6.string().uuid(),
|
|
443
|
+
endpoint: z6.string().uuid(),
|
|
307
444
|
event: webhookEventSchema,
|
|
308
|
-
status:
|
|
309
|
-
attempts:
|
|
310
|
-
responseStatus:
|
|
311
|
-
lastError:
|
|
312
|
-
createdAt:
|
|
313
|
-
deliveredAt:
|
|
314
|
-
replayOf:
|
|
315
|
-
});
|
|
316
|
-
var webhookQuerySchema =
|
|
445
|
+
status: z6.enum(["pending", "delivered", "failed", "skipped"]),
|
|
446
|
+
attempts: z6.number().int().nonnegative(),
|
|
447
|
+
responseStatus: z6.number().nullable(),
|
|
448
|
+
lastError: z6.string().nullable(),
|
|
449
|
+
createdAt: z6.number(),
|
|
450
|
+
deliveredAt: z6.number().nullable(),
|
|
451
|
+
replayOf: z6.string().uuid().nullable()
|
|
452
|
+
});
|
|
453
|
+
var webhookQuerySchema = z6.object({
|
|
317
454
|
/** A page's `nextCursor`: the deliveries after it, newest first. */
|
|
318
455
|
cursor: pageCursorSchema.optional(),
|
|
319
456
|
/** @deprecated Use `cursor`. Removed in 2.0.0. */
|
|
320
|
-
before:
|
|
321
|
-
limit:
|
|
457
|
+
before: z6.string().uuid().optional(),
|
|
458
|
+
limit: z6.coerce.number().int().min(1).max(100).default(50)
|
|
322
459
|
}).strict();
|
|
323
|
-
var webhookDeliveryPageSchema =
|
|
324
|
-
items:
|
|
460
|
+
var webhookDeliveryPageSchema = z6.object({
|
|
461
|
+
items: z6.array(webhookDeliverySchema),
|
|
325
462
|
nextCursor: pageCursorSchema.nullable().default(null),
|
|
326
463
|
/** @deprecated Use `nextCursor`, passed back as `cursor`. Removed in 2.0.0. */
|
|
327
|
-
next:
|
|
464
|
+
next: z6.string().uuid().nullable()
|
|
328
465
|
});
|
|
329
466
|
var WEBHOOK_MAX_BYTES = 64 * 1024;
|
|
330
467
|
async function verifyWebhook(input) {
|
|
@@ -368,8 +505,8 @@ async function verifyWebhook(input) {
|
|
|
368
505
|
}
|
|
369
506
|
|
|
370
507
|
// src/server/resource-lifecycle.ts
|
|
371
|
-
import { z as
|
|
372
|
-
var resourceLifecycleKindSchema =
|
|
508
|
+
import { z as z7 } from "zod";
|
|
509
|
+
var resourceLifecycleKindSchema = z7.enum([
|
|
373
510
|
"tracker",
|
|
374
511
|
"referral",
|
|
375
512
|
"leaderboard",
|
|
@@ -379,24 +516,24 @@ var resourceLifecycleKindSchema = z3.enum([
|
|
|
379
516
|
"image",
|
|
380
517
|
"point-ledger"
|
|
381
518
|
]);
|
|
382
|
-
var managedResourceSchema =
|
|
519
|
+
var managedResourceSchema = z7.object({
|
|
383
520
|
kind: resourceLifecycleKindSchema,
|
|
384
521
|
id: identifier,
|
|
385
522
|
key: identifier.nullable(),
|
|
386
|
-
title:
|
|
387
|
-
archivedAt:
|
|
523
|
+
title: z7.string(),
|
|
524
|
+
archivedAt: z7.number().int().nonnegative().nullable()
|
|
388
525
|
});
|
|
389
|
-
var resourceLifecycleInputSchema =
|
|
390
|
-
actionId:
|
|
526
|
+
var resourceLifecycleInputSchema = z7.object({
|
|
527
|
+
actionId: z7.string().uuid(),
|
|
391
528
|
kind: resourceLifecycleKindSchema,
|
|
392
529
|
resource: identifier,
|
|
393
|
-
archived:
|
|
394
|
-
reason:
|
|
395
|
-
expectedArchivedAt:
|
|
530
|
+
archived: z7.boolean(),
|
|
531
|
+
reason: z7.string().trim().min(1).max(500),
|
|
532
|
+
expectedArchivedAt: z7.number().int().nonnegative().nullable().optional()
|
|
396
533
|
}).strict();
|
|
397
|
-
var resourceLifecycleResultSchema =
|
|
534
|
+
var resourceLifecycleResultSchema = z7.object({
|
|
398
535
|
resource: managedResourceSchema,
|
|
399
|
-
changed:
|
|
536
|
+
changed: z7.boolean()
|
|
400
537
|
});
|
|
401
538
|
var resourceLifecyclePaths = {
|
|
402
539
|
tracker: "/trackers",
|
|
@@ -415,10 +552,10 @@ var resourceArchiveInputSchema = resourceLifecycleInputSchema.omit({
|
|
|
415
552
|
});
|
|
416
553
|
|
|
417
554
|
// src/server/index.ts
|
|
418
|
-
import { z as
|
|
555
|
+
import { z as z13 } from "zod";
|
|
419
556
|
|
|
420
557
|
// src/server/errors.ts
|
|
421
|
-
import { z as
|
|
558
|
+
import { z as z8 } from "zod";
|
|
422
559
|
var ManagementErrorCode = {
|
|
423
560
|
/** The input or an option failed validation before anything was sent (kind `client`). */
|
|
424
561
|
InvalidInput: "invalid-input",
|
|
@@ -429,9 +566,9 @@ var ManagementErrorCode = {
|
|
|
429
566
|
Aborted: "aborted",
|
|
430
567
|
InvalidResponse: "invalid-response"
|
|
431
568
|
};
|
|
432
|
-
var managementErrorSchema =
|
|
433
|
-
error:
|
|
434
|
-
code:
|
|
569
|
+
var managementErrorSchema = z8.looseObject({
|
|
570
|
+
error: z8.string(),
|
|
571
|
+
code: z8.string().optional()
|
|
435
572
|
});
|
|
436
573
|
var uncertainStatuses = /* @__PURE__ */ new Set([500, 502, 504]);
|
|
437
574
|
function uncertainOutcome(init) {
|
|
@@ -483,10 +620,10 @@ var ManagementError = class extends RequestError {
|
|
|
483
620
|
var DEFAULT_MANAGEMENT_TIMEOUT = MANAGEMENT_TIMEOUT;
|
|
484
621
|
|
|
485
622
|
// src/server/hosting.ts
|
|
486
|
-
import { z as
|
|
623
|
+
import { z as z10 } from "zod";
|
|
487
624
|
|
|
488
625
|
// src/server/starters.ts
|
|
489
|
-
import { z as
|
|
626
|
+
import { z as z9 } from "zod";
|
|
490
627
|
var starterTemplates = [
|
|
491
628
|
{
|
|
492
629
|
id: "campaign",
|
|
@@ -519,63 +656,63 @@ var starterTemplates = [
|
|
|
519
656
|
summary: "A headless Worker with typed routes and interactive API docs, for plugging Domino into your own product."
|
|
520
657
|
}
|
|
521
658
|
];
|
|
522
|
-
var starterIdSchema =
|
|
659
|
+
var starterIdSchema = z9.enum(
|
|
523
660
|
starterTemplates.map((template) => template.id)
|
|
524
661
|
);
|
|
525
662
|
|
|
526
663
|
// src/server/hosting.ts
|
|
527
|
-
var outputPathSchema =
|
|
664
|
+
var outputPathSchema = z10.string().min(1).max(512).refine(
|
|
528
665
|
(path) => path.split("/").every(
|
|
529
666
|
(part) => /^[\w-][\w.-]*$/.test(part) && part !== "node_modules"
|
|
530
667
|
),
|
|
531
668
|
"Expected a relative build output path without hidden segments"
|
|
532
669
|
);
|
|
533
|
-
var appRoutingSchema =
|
|
670
|
+
var appRoutingSchema = z10.enum(["legacy", "transparent"]).default("legacy");
|
|
534
671
|
var APP_SECRET_LIMIT = 50;
|
|
535
672
|
var APP_KV_LIMIT = 5;
|
|
536
673
|
var APP_SQL_LIMIT = 5;
|
|
537
674
|
var APP_MIGRATION_LIMIT = 100;
|
|
538
675
|
var APP_MIGRATION_FILE_BYTES = 9e4;
|
|
539
676
|
var APP_MIGRATION_TOTAL_BYTES = 1e6;
|
|
540
|
-
var appSecretNameSchema =
|
|
677
|
+
var appSecretNameSchema = z10.string().regex(
|
|
541
678
|
/^[A-Z_][A-Z0-9_]{0,63}$/,
|
|
542
679
|
"Use 1-64 uppercase letters, digits, and underscores, not starting with a digit"
|
|
543
680
|
).refine(
|
|
544
681
|
(name) => !name.startsWith("DOMINO_") && name !== "ASSETS",
|
|
545
682
|
"DOMINO_ names and ASSETS are reserved for Domino's own bindings"
|
|
546
683
|
);
|
|
547
|
-
var appSecretValueSchema =
|
|
684
|
+
var appSecretValueSchema = z10.string().min(1).refine(
|
|
548
685
|
(value) => new TextEncoder().encode(value).length <= 5120,
|
|
549
686
|
"Secret values can be at most 5 KiB"
|
|
550
687
|
);
|
|
551
|
-
var appSecretInputSchema =
|
|
552
|
-
var appSecretSchema =
|
|
688
|
+
var appSecretInputSchema = z10.object({ value: appSecretValueSchema }).strict();
|
|
689
|
+
var appSecretSchema = z10.object({
|
|
553
690
|
name: appSecretNameSchema,
|
|
554
|
-
updatedAt:
|
|
555
|
-
updatedBy:
|
|
691
|
+
updatedAt: z10.number(),
|
|
692
|
+
updatedBy: z10.string()
|
|
556
693
|
});
|
|
557
|
-
var appSecretDeclarationSchema =
|
|
558
|
-
description:
|
|
559
|
-
required:
|
|
694
|
+
var appSecretDeclarationSchema = z10.object({
|
|
695
|
+
description: z10.string().trim().min(1).max(500),
|
|
696
|
+
required: z10.boolean().default(true)
|
|
560
697
|
}).strict();
|
|
561
|
-
var appSecretDeclarationsSchema =
|
|
698
|
+
var appSecretDeclarationsSchema = z10.record(appSecretNameSchema, appSecretDeclarationSchema).refine(
|
|
562
699
|
(secrets) => Object.keys(secrets).length <= APP_SECRET_LIMIT,
|
|
563
700
|
`Declare at most ${APP_SECRET_LIMIT} app secrets`
|
|
564
701
|
);
|
|
565
|
-
var appSecretListSchema =
|
|
566
|
-
secrets:
|
|
567
|
-
declared:
|
|
702
|
+
var appSecretListSchema = z10.object({
|
|
703
|
+
secrets: z10.array(appSecretSchema),
|
|
704
|
+
declared: z10.array(appSecretDeclarationSchema.extend({ name: appSecretNameSchema })).default([])
|
|
568
705
|
});
|
|
569
|
-
var hostedAppSecretsSchema =
|
|
570
|
-
var storageDescription =
|
|
571
|
-
description:
|
|
706
|
+
var hostedAppSecretsSchema = z10.object({ secrets: z10.record(appSecretNameSchema, appSecretValueSchema) }).strict();
|
|
707
|
+
var storageDescription = z10.object({
|
|
708
|
+
description: z10.string().trim().min(1).max(500)
|
|
572
709
|
}).strict();
|
|
573
|
-
var appStorageSchema =
|
|
574
|
-
kv:
|
|
710
|
+
var appStorageSchema = z10.object({
|
|
711
|
+
kv: z10.record(appSecretNameSchema, storageDescription).refine(
|
|
575
712
|
(stores) => Object.keys(stores).length <= APP_KV_LIMIT,
|
|
576
713
|
`Declare at most ${APP_KV_LIMIT} KV stores`
|
|
577
714
|
).default({}),
|
|
578
|
-
sql:
|
|
715
|
+
sql: z10.record(
|
|
579
716
|
appSecretNameSchema,
|
|
580
717
|
storageDescription.extend({
|
|
581
718
|
migrations: outputPathSchema.optional()
|
|
@@ -585,60 +722,60 @@ var appStorageSchema = z6.object({
|
|
|
585
722
|
`Declare at most ${APP_SQL_LIMIT} SQL stores`
|
|
586
723
|
).default({})
|
|
587
724
|
}).strict();
|
|
588
|
-
var appStorageKindSchema =
|
|
589
|
-
var appStorageListSchema =
|
|
590
|
-
stores:
|
|
591
|
-
|
|
592
|
-
kind:
|
|
725
|
+
var appStorageKindSchema = z10.enum(["kv", "sql"]);
|
|
726
|
+
var appStorageListSchema = z10.object({
|
|
727
|
+
stores: z10.array(
|
|
728
|
+
z10.object({
|
|
729
|
+
kind: z10.string(),
|
|
593
730
|
name: appSecretNameSchema,
|
|
594
|
-
createdAt:
|
|
595
|
-
declared:
|
|
596
|
-
description:
|
|
731
|
+
createdAt: z10.number().nullable(),
|
|
732
|
+
declared: z10.boolean(),
|
|
733
|
+
description: z10.string().optional()
|
|
597
734
|
})
|
|
598
735
|
)
|
|
599
736
|
});
|
|
600
737
|
var APP_STORAGE_ROW_LIMIT = 50;
|
|
601
738
|
var APP_STORAGE_PREVIEW_CHARACTERS = 2e3;
|
|
602
|
-
var appStorageCellSchema =
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
739
|
+
var appStorageCellSchema = z10.union([
|
|
740
|
+
z10.string(),
|
|
741
|
+
z10.number(),
|
|
742
|
+
z10.null(),
|
|
743
|
+
z10.object({ text: z10.string(), truncated: z10.literal(true) }),
|
|
744
|
+
z10.object({ blob: z10.number().int().min(0) })
|
|
608
745
|
]);
|
|
609
|
-
var appStorageTablesSchema =
|
|
610
|
-
tables:
|
|
746
|
+
var appStorageTablesSchema = z10.object({
|
|
747
|
+
tables: z10.array(
|
|
611
748
|
/** `kind` is SQLite's: `table` or `view`. */
|
|
612
|
-
|
|
749
|
+
z10.object({ name: z10.string(), kind: z10.string() })
|
|
613
750
|
)
|
|
614
751
|
});
|
|
615
|
-
var appStorageRowsSchema =
|
|
616
|
-
table:
|
|
617
|
-
columns:
|
|
618
|
-
rows:
|
|
752
|
+
var appStorageRowsSchema = z10.object({
|
|
753
|
+
table: z10.string(),
|
|
754
|
+
columns: z10.array(z10.string()),
|
|
755
|
+
rows: z10.array(z10.array(appStorageCellSchema)),
|
|
619
756
|
/** How many rows come before this page in storage order. */
|
|
620
|
-
offset:
|
|
621
|
-
total:
|
|
757
|
+
offset: z10.number().int().min(0),
|
|
758
|
+
total: z10.number().int().min(0),
|
|
622
759
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
623
760
|
nextCursor: pageCursorSchema.nullable().default(null)
|
|
624
761
|
});
|
|
625
|
-
var appStorageKeysSchema =
|
|
626
|
-
keys:
|
|
627
|
-
|
|
762
|
+
var appStorageKeysSchema = z10.object({
|
|
763
|
+
keys: z10.array(
|
|
764
|
+
z10.object({ name: z10.string(), expiration: z10.number().nullable() })
|
|
628
765
|
),
|
|
629
766
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
630
767
|
nextCursor: pageCursorSchema.nullable().default(null),
|
|
631
768
|
/** @deprecated Use `nextCursor`. Removed in 2.0.0. */
|
|
632
|
-
cursor:
|
|
769
|
+
cursor: z10.string().nullable()
|
|
633
770
|
});
|
|
634
|
-
var appStorageValueSchema =
|
|
635
|
-
key:
|
|
636
|
-
size:
|
|
771
|
+
var appStorageValueSchema = z10.object({
|
|
772
|
+
key: z10.string(),
|
|
773
|
+
size: z10.number().int().min(0),
|
|
637
774
|
/** Null when the value is not UTF-8 text. */
|
|
638
|
-
text:
|
|
639
|
-
truncated:
|
|
775
|
+
text: z10.string().nullable(),
|
|
776
|
+
truncated: z10.boolean()
|
|
640
777
|
});
|
|
641
|
-
var appMigrationNameSchema =
|
|
778
|
+
var appMigrationNameSchema = z10.string().max(255).regex(/^[\w-][\w.-]*\.sql$/);
|
|
642
779
|
function compareAppMigrations(a, b) {
|
|
643
780
|
const left = Number.parseInt(a.split("_")[0], 10);
|
|
644
781
|
const right = Number.parseInt(b.split("_")[0], 10);
|
|
@@ -655,12 +792,12 @@ function compareAppMigrations(a, b) {
|
|
|
655
792
|
}
|
|
656
793
|
return a < b ? -1 : a > b ? 1 : 0;
|
|
657
794
|
}
|
|
658
|
-
var appMigrationsSchema =
|
|
795
|
+
var appMigrationsSchema = z10.record(
|
|
659
796
|
appSecretNameSchema,
|
|
660
|
-
|
|
661
|
-
|
|
797
|
+
z10.array(
|
|
798
|
+
z10.object({
|
|
662
799
|
name: appMigrationNameSchema,
|
|
663
|
-
sql:
|
|
800
|
+
sql: z10.string().min(1).refine(
|
|
664
801
|
(sql) => new TextEncoder().encode(sql).length <= APP_MIGRATION_FILE_BYTES,
|
|
665
802
|
`A migration file must not exceed ${APP_MIGRATION_FILE_BYTES} bytes`
|
|
666
803
|
)
|
|
@@ -678,21 +815,21 @@ var appMigrationsSchema = z6.record(
|
|
|
678
815
|
);
|
|
679
816
|
var appScripts = {
|
|
680
817
|
routing: appRoutingSchema,
|
|
681
|
-
devScript:
|
|
682
|
-
checkScript:
|
|
683
|
-
buildScript:
|
|
818
|
+
devScript: z10.string().regex(/^[\w:-]+$/),
|
|
819
|
+
checkScript: z10.string().regex(/^[\w:-]+$/),
|
|
820
|
+
buildScript: z10.string().regex(/^[\w:-]+$/)
|
|
684
821
|
};
|
|
685
822
|
var workerSettings = {
|
|
686
|
-
runWorkerFirst:
|
|
823
|
+
runWorkerFirst: z10.boolean().default(false),
|
|
687
824
|
main: outputPathSchema.refine(
|
|
688
825
|
(path) => /\.m?js$/.test(path),
|
|
689
826
|
"Expected a compiled JavaScript entry"
|
|
690
827
|
),
|
|
691
|
-
compatibilityDate:
|
|
692
|
-
compatibilityFlags:
|
|
693
|
-
vars:
|
|
694
|
-
|
|
695
|
-
|
|
828
|
+
compatibilityDate: z10.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
829
|
+
compatibilityFlags: z10.array(z10.string().min(1)).max(50).default([]),
|
|
830
|
+
vars: z10.record(
|
|
831
|
+
z10.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).refine((name) => name !== "ASSETS"),
|
|
832
|
+
z10.string()
|
|
696
833
|
).default({}),
|
|
697
834
|
secrets: appSecretDeclarationsSchema.default({}),
|
|
698
835
|
storage: appStorageSchema.optional()
|
|
@@ -720,62 +857,62 @@ var distinctBindings = (worker, ctx) => {
|
|
|
720
857
|
}
|
|
721
858
|
}
|
|
722
859
|
};
|
|
723
|
-
var hostedAppSchema =
|
|
724
|
-
|
|
725
|
-
kind:
|
|
860
|
+
var hostedAppSchema = z10.discriminatedUnion("kind", [
|
|
861
|
+
z10.object({
|
|
862
|
+
kind: z10.literal("static"),
|
|
726
863
|
directory: outputPathSchema,
|
|
727
864
|
...appScripts
|
|
728
865
|
}).strict(),
|
|
729
|
-
|
|
730
|
-
kind:
|
|
866
|
+
z10.object({
|
|
867
|
+
kind: z10.literal("worker"),
|
|
731
868
|
directory: outputPathSchema,
|
|
732
869
|
assetsDirectory: outputPathSchema.optional(),
|
|
733
870
|
...appScripts,
|
|
734
871
|
...workerSettings
|
|
735
872
|
}).strict().superRefine(distinctBindings)
|
|
736
873
|
]);
|
|
737
|
-
var repositorySchema =
|
|
738
|
-
id:
|
|
874
|
+
var repositorySchema = z10.object({
|
|
875
|
+
id: z10.string().uuid(),
|
|
739
876
|
organization: identifier,
|
|
740
877
|
project: identifier,
|
|
741
|
-
remote:
|
|
742
|
-
defaultBranch:
|
|
743
|
-
status:
|
|
878
|
+
remote: z10.string().url(),
|
|
879
|
+
defaultBranch: z10.string(),
|
|
880
|
+
status: z10.enum(["provisioning", "ready"])
|
|
744
881
|
});
|
|
745
|
-
var createRepositorySchema =
|
|
882
|
+
var createRepositorySchema = z10.object({
|
|
746
883
|
/** Omitted: the starter chosen at project setup, else `campaign`. */
|
|
747
884
|
starter: starterIdSchema.optional()
|
|
748
885
|
}).strict();
|
|
749
|
-
var deviceStartSchema =
|
|
750
|
-
challenge:
|
|
886
|
+
var deviceStartSchema = z10.object({
|
|
887
|
+
challenge: z10.string().regex(/^[a-f0-9]{64}$/)
|
|
751
888
|
}).strict();
|
|
752
|
-
var deviceRedeemSchema =
|
|
753
|
-
id:
|
|
754
|
-
verifier:
|
|
889
|
+
var deviceRedeemSchema = z10.object({
|
|
890
|
+
id: z10.string().uuid(),
|
|
891
|
+
verifier: z10.string().min(43).max(128)
|
|
755
892
|
}).strict();
|
|
756
|
-
var deviceApproveSchema =
|
|
757
|
-
id:
|
|
758
|
-
code:
|
|
893
|
+
var deviceApproveSchema = z10.object({
|
|
894
|
+
id: z10.string().uuid(),
|
|
895
|
+
code: z10.string().regex(/^[A-F0-9]{4}-[A-F0-9]{4}$/)
|
|
759
896
|
}).strict();
|
|
760
|
-
var commitSchema =
|
|
761
|
-
var stageRequestSchema =
|
|
897
|
+
var commitSchema = z10.string().regex(/^[a-f0-9]{40}$/);
|
|
898
|
+
var stageRequestSchema = z10.object({
|
|
762
899
|
commit: commitSchema,
|
|
763
|
-
requestId:
|
|
900
|
+
requestId: z10.string().uuid()
|
|
764
901
|
}).strict();
|
|
765
|
-
var buildIdentitySchema =
|
|
902
|
+
var buildIdentitySchema = z10.object({
|
|
766
903
|
routing: appRoutingSchema,
|
|
767
|
-
slug:
|
|
768
|
-
runtime:
|
|
769
|
-
id:
|
|
770
|
-
repository:
|
|
904
|
+
slug: z10.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional(),
|
|
905
|
+
runtime: z10.enum(["simulation", "hosted-test"]).default("simulation"),
|
|
906
|
+
id: z10.string().uuid(),
|
|
907
|
+
repository: z10.string().uuid(),
|
|
771
908
|
organization: identifier,
|
|
772
909
|
project: identifier,
|
|
773
910
|
commit: commitSchema,
|
|
774
|
-
createdAt:
|
|
775
|
-
actor:
|
|
776
|
-
commitMessage:
|
|
911
|
+
createdAt: z10.number(),
|
|
912
|
+
actor: z10.string(),
|
|
913
|
+
commitMessage: z10.string().max(500).optional()
|
|
777
914
|
});
|
|
778
|
-
var buildPhaseSchema =
|
|
915
|
+
var buildPhaseSchema = z10.enum([
|
|
779
916
|
"queued",
|
|
780
917
|
"source",
|
|
781
918
|
"install",
|
|
@@ -785,72 +922,72 @@ var buildPhaseSchema = z6.enum([
|
|
|
785
922
|
"ready",
|
|
786
923
|
"failed"
|
|
787
924
|
]);
|
|
788
|
-
var buildStatusSchema =
|
|
925
|
+
var buildStatusSchema = z10.object({
|
|
789
926
|
phase: buildPhaseSchema,
|
|
790
927
|
failedPhase: buildPhaseSchema.optional(),
|
|
791
|
-
updatedAt:
|
|
792
|
-
message:
|
|
928
|
+
updatedAt: z10.number(),
|
|
929
|
+
message: z10.string()
|
|
793
930
|
});
|
|
794
931
|
var hostedBuildSchema = buildIdentitySchema.extend({
|
|
795
932
|
...buildStatusSchema.shape,
|
|
796
|
-
finished:
|
|
797
|
-
current:
|
|
798
|
-
stagingUrl:
|
|
799
|
-
});
|
|
800
|
-
var stagingAccessModeSchema =
|
|
801
|
-
var stagingAccessSchema =
|
|
802
|
-
var stagingAccessInputSchema =
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
mode:
|
|
806
|
-
password:
|
|
933
|
+
finished: z10.boolean(),
|
|
934
|
+
current: z10.boolean(),
|
|
935
|
+
stagingUrl: z10.string().url()
|
|
936
|
+
});
|
|
937
|
+
var stagingAccessModeSchema = z10.enum(["console", "password"]);
|
|
938
|
+
var stagingAccessSchema = z10.object({ mode: stagingAccessModeSchema });
|
|
939
|
+
var stagingAccessInputSchema = z10.discriminatedUnion("mode", [
|
|
940
|
+
z10.object({ mode: z10.literal("console") }).strict(),
|
|
941
|
+
z10.object({
|
|
942
|
+
mode: z10.literal("password"),
|
|
943
|
+
password: z10.string().min(8).max(128)
|
|
807
944
|
}).strict()
|
|
808
945
|
]);
|
|
809
|
-
var stagingPathSchema =
|
|
946
|
+
var stagingPathSchema = z10.string().max(2048).refine(
|
|
810
947
|
(path) => path.startsWith("/") && !path.startsWith("//") && !path.includes("\\"),
|
|
811
948
|
"Expected a path on the staging host"
|
|
812
949
|
);
|
|
813
|
-
var stagingLinkSchema =
|
|
814
|
-
url:
|
|
815
|
-
expiresAt:
|
|
950
|
+
var stagingLinkSchema = z10.object({
|
|
951
|
+
url: z10.string().url(),
|
|
952
|
+
expiresAt: z10.number()
|
|
816
953
|
});
|
|
817
|
-
var buildSnapshotSchema =
|
|
818
|
-
builds:
|
|
954
|
+
var buildSnapshotSchema = z10.object({
|
|
955
|
+
builds: z10.array(hostedBuildSchema),
|
|
819
956
|
current: hostedBuildSchema.nullable(),
|
|
820
957
|
selected: hostedBuildSchema.nullable(),
|
|
821
|
-
logs:
|
|
958
|
+
logs: z10.string()
|
|
822
959
|
});
|
|
823
|
-
var assetPathSchema =
|
|
960
|
+
var assetPathSchema = z10.string().max(512).refine(
|
|
824
961
|
(path) => path.startsWith("/") && // oxlint-disable-next-line no-control-regex -- Asset paths must reject control characters.
|
|
825
962
|
!/[\\\u0000-\u001f?#%]/.test(path) && path.slice(1).split("/").every((part) => part.length > 0 && !part.startsWith(".")),
|
|
826
963
|
"Expected a public asset path without hidden segments"
|
|
827
964
|
);
|
|
828
|
-
var base64Schema =
|
|
965
|
+
var base64Schema = z10.string().regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
|
|
829
966
|
var stagedDeploymentLimits = {
|
|
830
967
|
/** Bytes of JSON, uncompressed. */
|
|
831
968
|
size: 64e6,
|
|
832
969
|
/** Bytes of the Brotli-compressed object. */
|
|
833
970
|
compressedSize: 1e7
|
|
834
971
|
};
|
|
835
|
-
var stagedDeploymentSchema =
|
|
836
|
-
encoding:
|
|
837
|
-
sha256:
|
|
838
|
-
compressedSize:
|
|
839
|
-
size:
|
|
972
|
+
var stagedDeploymentSchema = z10.object({
|
|
973
|
+
encoding: z10.literal("br"),
|
|
974
|
+
sha256: z10.string().regex(/^[0-9a-f]{64}$/),
|
|
975
|
+
compressedSize: z10.number().int().positive().max(stagedDeploymentLimits.compressedSize),
|
|
976
|
+
size: z10.number().int().positive().max(stagedDeploymentLimits.size)
|
|
840
977
|
}).strict();
|
|
841
978
|
var stagedDeploymentContentSchema = stagedDeploymentSchema.extend({
|
|
842
|
-
content:
|
|
979
|
+
content: z10.string().max(Math.ceil(stagedDeploymentLimits.compressedSize / 3) * 4)
|
|
843
980
|
}).strict();
|
|
844
981
|
var stagedDeploymentKey = (build, sha256) => `builds/${build}/deployment/${sha256}.br`;
|
|
845
982
|
var artifactFields = {
|
|
846
983
|
routing: appRoutingSchema,
|
|
847
|
-
worker:
|
|
984
|
+
worker: z10.object({
|
|
848
985
|
...workerSettings,
|
|
849
986
|
migrations: appMigrationsSchema.optional(),
|
|
850
|
-
modules:
|
|
851
|
-
|
|
987
|
+
modules: z10.array(
|
|
988
|
+
z10.object({
|
|
852
989
|
path: outputPathSchema.refine((path) => path !== "metadata"),
|
|
853
|
-
type:
|
|
990
|
+
type: z10.enum([
|
|
854
991
|
"application/javascript+module",
|
|
855
992
|
"application/wasm",
|
|
856
993
|
"text/plain",
|
|
@@ -860,26 +997,26 @@ var artifactFields = {
|
|
|
860
997
|
}).strict()
|
|
861
998
|
).min(1).max(500)
|
|
862
999
|
}).strict().superRefine(distinctBindings).optional(),
|
|
863
|
-
assets:
|
|
864
|
-
|
|
1000
|
+
assets: z10.array(
|
|
1001
|
+
z10.object({
|
|
865
1002
|
path: assetPathSchema,
|
|
866
1003
|
content: base64Schema.max(14e6),
|
|
867
|
-
size:
|
|
1004
|
+
size: z10.number().int().min(0).max(1e7)
|
|
868
1005
|
}).strict()
|
|
869
1006
|
).max(500)
|
|
870
1007
|
};
|
|
871
|
-
var buildArtifactsSchema =
|
|
872
|
-
|
|
873
|
-
format:
|
|
1008
|
+
var buildArtifactsSchema = z10.discriminatedUnion("format", [
|
|
1009
|
+
z10.object({
|
|
1010
|
+
format: z10.literal(1),
|
|
874
1011
|
...artifactFields,
|
|
875
|
-
quests:
|
|
876
|
-
catalog:
|
|
1012
|
+
quests: z10.unknown(),
|
|
1013
|
+
catalog: z10.unknown()
|
|
877
1014
|
}).strict(),
|
|
878
|
-
|
|
879
|
-
format:
|
|
1015
|
+
z10.object({
|
|
1016
|
+
format: z10.literal(2),
|
|
880
1017
|
...artifactFields,
|
|
881
1018
|
deployment: stagedDeploymentSchema,
|
|
882
|
-
images:
|
|
1019
|
+
images: z10.array(imageAssetArtifactSchema).max(10)
|
|
883
1020
|
}).strict()
|
|
884
1021
|
]).superRefine((value, ctx) => {
|
|
885
1022
|
if (value.worker) {
|
|
@@ -931,39 +1068,39 @@ var buildArtifactsSchema = z6.discriminatedUnion("format", [
|
|
|
931
1068
|
});
|
|
932
1069
|
|
|
933
1070
|
// src/server/development.ts
|
|
934
|
-
import { z as
|
|
935
|
-
var developmentPreflightSchema =
|
|
936
|
-
organization:
|
|
937
|
-
project:
|
|
938
|
-
environment:
|
|
939
|
-
identity:
|
|
940
|
-
exchange:
|
|
941
|
-
activeIntegrations:
|
|
1071
|
+
import { z as z11 } from "zod";
|
|
1072
|
+
var developmentPreflightSchema = z11.object({
|
|
1073
|
+
organization: z11.string(),
|
|
1074
|
+
project: z11.string(),
|
|
1075
|
+
environment: z11.enum(["test", "live"]),
|
|
1076
|
+
identity: z11.object({
|
|
1077
|
+
exchange: z11.literal("supported"),
|
|
1078
|
+
activeIntegrations: z11.number().int().nonnegative()
|
|
942
1079
|
}).optional(),
|
|
943
|
-
staging:
|
|
944
|
-
development:
|
|
945
|
-
status:
|
|
1080
|
+
staging: z11.enum(["configured", "blocked"]),
|
|
1081
|
+
development: z11.object({
|
|
1082
|
+
status: z11.enum(["configured", "blocked"]),
|
|
946
1083
|
// How `domino dev` reaches the preview origin: a Cloudflare tunnel, or a direct route on a
|
|
947
1084
|
// local development stack. APIs that predate the field use tunnels.
|
|
948
|
-
transport:
|
|
949
|
-
missing:
|
|
950
|
-
authentication:
|
|
1085
|
+
transport: z11.enum(["tunnel", "direct"]).default("tunnel"),
|
|
1086
|
+
missing: z11.array(z11.string()),
|
|
1087
|
+
authentication: z11.array(z11.string())
|
|
951
1088
|
}),
|
|
952
|
-
checks:
|
|
953
|
-
|
|
954
|
-
id:
|
|
955
|
-
status:
|
|
956
|
-
message:
|
|
957
|
-
missing:
|
|
958
|
-
issues:
|
|
1089
|
+
checks: z11.array(
|
|
1090
|
+
z11.object({
|
|
1091
|
+
id: z11.string(),
|
|
1092
|
+
status: z11.enum(["ok", "error"]),
|
|
1093
|
+
message: z11.string(),
|
|
1094
|
+
missing: z11.array(z11.string()).optional(),
|
|
1095
|
+
issues: z11.array(z11.string()).optional()
|
|
959
1096
|
})
|
|
960
1097
|
)
|
|
961
1098
|
});
|
|
962
1099
|
|
|
963
1100
|
// src/server/hosted.ts
|
|
964
|
-
import { z as
|
|
1101
|
+
import { z as z12 } from "zod";
|
|
965
1102
|
var hostedKeyPermissions = ["read", "points", "ingest"];
|
|
966
|
-
var hostedKeyPermissionList =
|
|
1103
|
+
var hostedKeyPermissionList = z12.array(z12.string()).transform(
|
|
967
1104
|
(values) => values.filter(
|
|
968
1105
|
(value) => hostedKeyPermissions.includes(value)
|
|
969
1106
|
)
|
|
@@ -975,17 +1112,17 @@ var hostedManagementBindings = [
|
|
|
975
1112
|
"DOMINO_PROJECT",
|
|
976
1113
|
"DOMINO_ENVIRONMENT"
|
|
977
1114
|
];
|
|
978
|
-
var hostedKeySecretSchema =
|
|
979
|
-
var hostedKeySchema =
|
|
980
|
-
id:
|
|
1115
|
+
var hostedKeySecretSchema = z12.string().regex(/^dhk_[A-Za-z0-9_-]{43}$/, "Expected a hosted app key");
|
|
1116
|
+
var hostedKeySchema = z12.object({
|
|
1117
|
+
id: z12.string().uuid(),
|
|
981
1118
|
token: hostedKeySecretSchema,
|
|
982
1119
|
organization: identifier,
|
|
983
1120
|
project: identifier,
|
|
984
|
-
environment:
|
|
1121
|
+
environment: z12.enum(["test", "live"]),
|
|
985
1122
|
permissions: hostedKeyPermissionList,
|
|
986
|
-
expiresAt:
|
|
1123
|
+
expiresAt: z12.number().nullable()
|
|
987
1124
|
}).strict();
|
|
988
|
-
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl:
|
|
1125
|
+
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl: z12.string().url() }).strict();
|
|
989
1126
|
function hostedManagementClient(env) {
|
|
990
1127
|
const missing = hostedManagementBindings.filter((name) => !env[name]);
|
|
991
1128
|
if (missing.length) {
|
|
@@ -993,7 +1130,7 @@ function hostedManagementClient(env) {
|
|
|
993
1130
|
`Missing ${missing.join(", ")}. Domino sets these for hosted apps and domino dev; update the project's vite.config.ts to forward them in development.`
|
|
994
1131
|
);
|
|
995
1132
|
}
|
|
996
|
-
const environment =
|
|
1133
|
+
const environment = z12.enum(["test", "live"]).parse(env.DOMINO_ENVIRONMENT);
|
|
997
1134
|
const token = env.DOMINO_MANAGEMENT_KEY;
|
|
998
1135
|
return createManagementClient({
|
|
999
1136
|
baseUrl: env.DOMINO_API_URL.replace(/\/+$/, ""),
|
|
@@ -1005,9 +1142,9 @@ function hostedManagementClient(env) {
|
|
|
1005
1142
|
}
|
|
1006
1143
|
|
|
1007
1144
|
// src/server/index.ts
|
|
1008
|
-
var environmentSchema =
|
|
1009
|
-
var roleSchema =
|
|
1010
|
-
var permissionSchema =
|
|
1145
|
+
var environmentSchema = z13.enum(["test", "live"]);
|
|
1146
|
+
var roleSchema = z13.enum(["editor", "reviewer", "staff"]);
|
|
1147
|
+
var permissionSchema = z13.enum([
|
|
1011
1148
|
"read",
|
|
1012
1149
|
"publish",
|
|
1013
1150
|
"review",
|
|
@@ -1027,7 +1164,7 @@ var permissionSchema = z9.enum([
|
|
|
1027
1164
|
*/
|
|
1028
1165
|
"enroll"
|
|
1029
1166
|
]);
|
|
1030
|
-
var permissionListSchema =
|
|
1167
|
+
var permissionListSchema = z13.array(z13.string()).transform(
|
|
1031
1168
|
(values) => values.filter(
|
|
1032
1169
|
(value) => permissionSchema.safeParse(value).success
|
|
1033
1170
|
)
|
|
@@ -1037,33 +1174,33 @@ var rolePermissions = {
|
|
|
1037
1174
|
reviewer: ["read", "review"],
|
|
1038
1175
|
staff: ["read", "confirm", "handover"]
|
|
1039
1176
|
};
|
|
1040
|
-
var projectSetupSchema =
|
|
1041
|
-
mode:
|
|
1042
|
-
brief:
|
|
1177
|
+
var projectSetupSchema = z13.object({
|
|
1178
|
+
mode: z13.enum(["new", "existing"]),
|
|
1179
|
+
brief: z13.string().trim().min(1).max(4e3)
|
|
1043
1180
|
}).strict();
|
|
1044
|
-
var operatorUserSchema =
|
|
1045
|
-
id:
|
|
1046
|
-
name:
|
|
1047
|
-
email:
|
|
1048
|
-
avatar:
|
|
1049
|
-
});
|
|
1050
|
-
var projectSchema =
|
|
1051
|
-
slug:
|
|
1052
|
-
createdBy:
|
|
1181
|
+
var operatorUserSchema = z13.object({
|
|
1182
|
+
id: z13.string(),
|
|
1183
|
+
name: z13.string().nullable(),
|
|
1184
|
+
email: z13.string().nullable(),
|
|
1185
|
+
avatar: z13.string().nullable()
|
|
1186
|
+
});
|
|
1187
|
+
var projectSchema = z13.object({
|
|
1188
|
+
slug: z13.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
1189
|
+
createdBy: z13.string().nullable().optional(),
|
|
1053
1190
|
creator: operatorUserSchema.nullable().optional(),
|
|
1054
1191
|
/** A response, so fields a newer server adds to the setup are dropped, not rejected. */
|
|
1055
|
-
setup:
|
|
1192
|
+
setup: z13.object(projectSetupSchema.shape).optional(),
|
|
1056
1193
|
/** The starter chosen at setup. A plain string, so later starters still parse. */
|
|
1057
|
-
starter:
|
|
1058
|
-
id:
|
|
1194
|
+
starter: z13.string().optional(),
|
|
1195
|
+
id: z13.string().min(1),
|
|
1059
1196
|
organization: identifier,
|
|
1060
1197
|
project: identifier,
|
|
1061
|
-
name:
|
|
1062
|
-
subtitle:
|
|
1063
|
-
initials:
|
|
1064
|
-
color:
|
|
1198
|
+
name: z13.string(),
|
|
1199
|
+
subtitle: z13.string(),
|
|
1200
|
+
initials: z13.string(),
|
|
1201
|
+
color: z13.string(),
|
|
1065
1202
|
permissions: permissionListSchema,
|
|
1066
|
-
environments:
|
|
1203
|
+
environments: z13.array(environmentSchema)
|
|
1067
1204
|
}).refine(
|
|
1068
1205
|
(project) => !project.creator || project.creator.id === project.createdBy,
|
|
1069
1206
|
{
|
|
@@ -1071,45 +1208,45 @@ var projectSchema = z9.object({
|
|
|
1071
1208
|
path: ["creator"]
|
|
1072
1209
|
}
|
|
1073
1210
|
);
|
|
1074
|
-
var projectInputSchema =
|
|
1211
|
+
var projectInputSchema = z13.object({
|
|
1075
1212
|
actionId: identifier,
|
|
1076
|
-
name:
|
|
1213
|
+
name: z13.string().trim().min(1).max(80),
|
|
1077
1214
|
setup: projectSetupSchema.optional(),
|
|
1078
1215
|
/** The starter a new hosted app begins from, with `setup.mode` "new". */
|
|
1079
1216
|
starter: starterIdSchema.optional()
|
|
1080
1217
|
}).strict();
|
|
1081
|
-
var projectUpdateInputSchema =
|
|
1082
|
-
|
|
1083
|
-
|
|
1218
|
+
var projectUpdateInputSchema = z13.union([
|
|
1219
|
+
z13.object({ name: projectInputSchema.shape.name }).strict(),
|
|
1220
|
+
z13.object({
|
|
1084
1221
|
slug: projectSchema.shape.slug,
|
|
1085
|
-
confirm:
|
|
1222
|
+
confirm: z13.string().min(1).max(80)
|
|
1086
1223
|
}).strict()
|
|
1087
1224
|
]);
|
|
1088
|
-
var projectDeletionInputSchema =
|
|
1089
|
-
var projectDeletionSchema =
|
|
1225
|
+
var projectDeletionInputSchema = z13.object({ confirm: z13.string().min(1).max(80) }).strict();
|
|
1226
|
+
var projectDeletionSchema = z13.object({
|
|
1090
1227
|
project: identifier,
|
|
1091
|
-
purgeAfter:
|
|
1228
|
+
purgeAfter: z13.number().int()
|
|
1092
1229
|
});
|
|
1093
|
-
var projectTransferInputSchema =
|
|
1094
|
-
var projectTransferSchema =
|
|
1230
|
+
var projectTransferInputSchema = z13.object({ organization: identifier, confirm: z13.string().min(1).max(80) }).strict();
|
|
1231
|
+
var projectTransferSchema = z13.object({
|
|
1095
1232
|
organization: identifier,
|
|
1096
1233
|
project: identifier
|
|
1097
1234
|
});
|
|
1098
|
-
var grantSchema =
|
|
1099
|
-
subject:
|
|
1100
|
-
roles:
|
|
1101
|
-
environments:
|
|
1235
|
+
var grantSchema = z13.object({
|
|
1236
|
+
subject: z13.string().min(1).max(200),
|
|
1237
|
+
roles: z13.array(roleSchema),
|
|
1238
|
+
environments: z13.array(environmentSchema)
|
|
1102
1239
|
}).strict();
|
|
1103
|
-
var grantRecordSchema =
|
|
1104
|
-
var stockAdditionSchema =
|
|
1240
|
+
var grantRecordSchema = z13.object(grantSchema.shape);
|
|
1241
|
+
var stockAdditionSchema = z13.object({
|
|
1105
1242
|
item: identifier,
|
|
1106
|
-
quantity:
|
|
1243
|
+
quantity: z13.number().int(),
|
|
1107
1244
|
actionId: identifier
|
|
1108
1245
|
});
|
|
1109
|
-
var completionRevokeSchema =
|
|
1246
|
+
var completionRevokeSchema = z13.object({
|
|
1110
1247
|
actionId: identifier,
|
|
1111
|
-
reason:
|
|
1112
|
-
freeOccurrence:
|
|
1248
|
+
reason: z13.string().trim().min(1).max(500),
|
|
1249
|
+
freeOccurrence: z13.boolean().default(false)
|
|
1113
1250
|
}).strict();
|
|
1114
1251
|
var RevokedEntitlementOutcome = {
|
|
1115
1252
|
/** No other completion grants the reward: it is void, after cancelling a handover in progress. */
|
|
@@ -1137,216 +1274,216 @@ var RevokedReferralOutcome = {
|
|
|
1137
1274
|
/** Qualified on another accepted completion of the program's quest instead. */
|
|
1138
1275
|
Requalified: "requalified"
|
|
1139
1276
|
};
|
|
1140
|
-
var entitlementOutcomeSchema =
|
|
1141
|
-
var deliveryOutcomeSchema =
|
|
1142
|
-
var referralOutcomeSchema =
|
|
1143
|
-
var completionRevocationSchema =
|
|
1277
|
+
var entitlementOutcomeSchema = z13.string().min(1).max(64);
|
|
1278
|
+
var deliveryOutcomeSchema = z13.string().min(1).max(64);
|
|
1279
|
+
var referralOutcomeSchema = z13.string().min(1).max(64);
|
|
1280
|
+
var completionRevocationSchema = z13.object({
|
|
1144
1281
|
completion: identifier,
|
|
1145
1282
|
/** The quest ID, or the board ID when `source.kind` is `leaderboard`. */
|
|
1146
1283
|
quest: identifier,
|
|
1147
1284
|
member: identifier,
|
|
1148
1285
|
/** What paid the revoked completion. `source.id` repeats `quest`. */
|
|
1149
1286
|
source: completionSourceSchema.optional(),
|
|
1150
|
-
revokedAt:
|
|
1151
|
-
occurrenceFreed:
|
|
1152
|
-
points:
|
|
1153
|
-
|
|
1287
|
+
revokedAt: z13.number(),
|
|
1288
|
+
occurrenceFreed: z13.boolean(),
|
|
1289
|
+
points: z13.array(
|
|
1290
|
+
z13.object({
|
|
1154
1291
|
entry: identifier,
|
|
1155
1292
|
balance: identifier,
|
|
1156
1293
|
reversal: identifier.nullable(),
|
|
1157
|
-
reversed:
|
|
1158
|
-
unreversed:
|
|
1294
|
+
reversed: z13.number().int(),
|
|
1295
|
+
unreversed: z13.number().int()
|
|
1159
1296
|
})
|
|
1160
1297
|
),
|
|
1161
|
-
entitlements:
|
|
1162
|
-
|
|
1298
|
+
entitlements: z13.array(
|
|
1299
|
+
z13.object({
|
|
1163
1300
|
entitlement: identifier,
|
|
1164
1301
|
reward: identifier,
|
|
1165
1302
|
outcome: entitlementOutcomeSchema,
|
|
1166
|
-
status:
|
|
1303
|
+
status: z13.string()
|
|
1167
1304
|
})
|
|
1168
1305
|
),
|
|
1169
|
-
deliveries:
|
|
1170
|
-
|
|
1171
|
-
delivery:
|
|
1172
|
-
roleId:
|
|
1306
|
+
deliveries: z13.array(
|
|
1307
|
+
z13.object({
|
|
1308
|
+
delivery: z13.string(),
|
|
1309
|
+
roleId: z13.string(),
|
|
1173
1310
|
outcome: deliveryOutcomeSchema,
|
|
1174
1311
|
/**
|
|
1175
1312
|
* By Relay's records, another accepted, unrevoked completion of the member also granted this
|
|
1176
1313
|
* role to the same Discord account and server. Relay does not read Discord's membership.
|
|
1177
1314
|
*/
|
|
1178
|
-
stillGranted:
|
|
1315
|
+
stillGranted: z13.boolean()
|
|
1179
1316
|
})
|
|
1180
1317
|
),
|
|
1181
|
-
referrals:
|
|
1182
|
-
|
|
1318
|
+
referrals: z13.array(
|
|
1319
|
+
z13.object({
|
|
1183
1320
|
program: identifier,
|
|
1184
1321
|
outcome: referralOutcomeSchema
|
|
1185
1322
|
})
|
|
1186
1323
|
),
|
|
1187
|
-
streakMilestone:
|
|
1188
|
-
});
|
|
1189
|
-
var accessSchema =
|
|
1190
|
-
actor:
|
|
1191
|
-
organization:
|
|
1192
|
-
admin:
|
|
1193
|
-
local:
|
|
1194
|
-
projects:
|
|
1195
|
-
});
|
|
1196
|
-
var querySchema =
|
|
1197
|
-
q:
|
|
1198
|
-
filter:
|
|
1199
|
-
offset:
|
|
1200
|
-
limit:
|
|
1201
|
-
});
|
|
1202
|
-
var accountProfileSchema =
|
|
1203
|
-
name:
|
|
1324
|
+
streakMilestone: z13.boolean()
|
|
1325
|
+
});
|
|
1326
|
+
var accessSchema = z13.object({
|
|
1327
|
+
actor: z13.string(),
|
|
1328
|
+
organization: z13.string(),
|
|
1329
|
+
admin: z13.boolean(),
|
|
1330
|
+
local: z13.boolean(),
|
|
1331
|
+
projects: z13.array(projectSchema)
|
|
1332
|
+
});
|
|
1333
|
+
var querySchema = z13.object({
|
|
1334
|
+
q: z13.string().max(200).default(""),
|
|
1335
|
+
filter: z13.string().max(50).default("all"),
|
|
1336
|
+
offset: z13.coerce.number().int().min(0).max(1e6).default(0),
|
|
1337
|
+
limit: z13.coerce.number().int().min(1).max(100).default(25)
|
|
1338
|
+
});
|
|
1339
|
+
var accountProfileSchema = z13.object({
|
|
1340
|
+
name: z13.string().optional(),
|
|
1204
1341
|
/** The account's handle, where the provider has one (X and Discord). */
|
|
1205
|
-
username:
|
|
1206
|
-
email:
|
|
1207
|
-
emailVerified:
|
|
1208
|
-
imageUrl:
|
|
1342
|
+
username: z13.string().optional(),
|
|
1343
|
+
email: z13.string().optional(),
|
|
1344
|
+
emailVerified: z13.boolean().default(false),
|
|
1345
|
+
imageUrl: z13.string().url().optional()
|
|
1209
1346
|
});
|
|
1210
|
-
var memberAccountSchema =
|
|
1347
|
+
var memberAccountSchema = z13.object({
|
|
1211
1348
|
/** `wallet` for wallet sign-in, `account` for every other connected account. */
|
|
1212
|
-
kind:
|
|
1213
|
-
provider:
|
|
1214
|
-
subject:
|
|
1215
|
-
signInEnabled:
|
|
1349
|
+
kind: z13.enum(["account", "wallet"]),
|
|
1350
|
+
provider: z13.string(),
|
|
1351
|
+
subject: z13.string(),
|
|
1352
|
+
signInEnabled: z13.boolean(),
|
|
1216
1353
|
profile: accountProfileSchema.optional()
|
|
1217
1354
|
});
|
|
1218
|
-
var operationSchema =
|
|
1219
|
-
target:
|
|
1220
|
-
paused:
|
|
1221
|
-
revision:
|
|
1222
|
-
reason:
|
|
1223
|
-
actor:
|
|
1224
|
-
changedAt:
|
|
1225
|
-
});
|
|
1226
|
-
var operationInputSchema =
|
|
1227
|
-
target:
|
|
1228
|
-
|
|
1229
|
-
|
|
1355
|
+
var operationSchema = z13.object({
|
|
1356
|
+
target: z13.string(),
|
|
1357
|
+
paused: z13.boolean(),
|
|
1358
|
+
revision: z13.number().int(),
|
|
1359
|
+
reason: z13.string(),
|
|
1360
|
+
actor: z13.string().nullable(),
|
|
1361
|
+
changedAt: z13.number()
|
|
1362
|
+
});
|
|
1363
|
+
var operationInputSchema = z13.object({
|
|
1364
|
+
target: z13.union([
|
|
1365
|
+
z13.literal("redemptions"),
|
|
1366
|
+
z13.string().regex(/^quest:[\w-]+$/)
|
|
1230
1367
|
]),
|
|
1231
|
-
paused:
|
|
1232
|
-
revision:
|
|
1233
|
-
reason:
|
|
1368
|
+
paused: z13.boolean(),
|
|
1369
|
+
revision: z13.number().int().nonnegative(),
|
|
1370
|
+
reason: z13.string().trim().min(1).max(500),
|
|
1234
1371
|
actionId: identifier
|
|
1235
1372
|
}).strict();
|
|
1236
|
-
var questLifecycleInputSchema =
|
|
1373
|
+
var questLifecycleInputSchema = z13.object({
|
|
1237
1374
|
quest: identifier,
|
|
1238
1375
|
expectedRelease: identifier.optional(),
|
|
1239
|
-
archived:
|
|
1240
|
-
reason:
|
|
1376
|
+
archived: z13.boolean(),
|
|
1377
|
+
reason: z13.string().trim().min(1).max(500),
|
|
1241
1378
|
actionId: identifier
|
|
1242
1379
|
}).strict();
|
|
1243
|
-
var questLifecycleSchema =
|
|
1380
|
+
var questLifecycleSchema = z13.object({
|
|
1244
1381
|
quest: identifier,
|
|
1245
1382
|
key: identifier.nullable(),
|
|
1246
|
-
title:
|
|
1383
|
+
title: z13.string(),
|
|
1247
1384
|
release: identifier,
|
|
1248
|
-
lifecycle:
|
|
1249
|
-
changed:
|
|
1250
|
-
});
|
|
1251
|
-
var memberSchema =
|
|
1252
|
-
id:
|
|
1253
|
-
test:
|
|
1254
|
-
name:
|
|
1255
|
-
accounts:
|
|
1256
|
-
attempts:
|
|
1257
|
-
completions:
|
|
1258
|
-
rewards:
|
|
1259
|
-
lastActivity:
|
|
1260
|
-
});
|
|
1261
|
-
var personSchema =
|
|
1262
|
-
id:
|
|
1263
|
-
accounts:
|
|
1264
|
-
});
|
|
1265
|
-
var metricsSchema =
|
|
1266
|
-
quests:
|
|
1267
|
-
members:
|
|
1268
|
-
attempts:
|
|
1269
|
-
completions:
|
|
1270
|
-
review:
|
|
1271
|
-
failed:
|
|
1272
|
-
entitlements:
|
|
1273
|
-
});
|
|
1274
|
-
var readinessSchema =
|
|
1275
|
-
checks:
|
|
1276
|
-
|
|
1277
|
-
id:
|
|
1278
|
-
status:
|
|
1279
|
-
title:
|
|
1280
|
-
detail:
|
|
1385
|
+
lifecycle: z13.enum(["active", "paused", "archived"]),
|
|
1386
|
+
changed: z13.boolean()
|
|
1387
|
+
});
|
|
1388
|
+
var memberSchema = z13.object({
|
|
1389
|
+
id: z13.string(),
|
|
1390
|
+
test: z13.boolean().optional(),
|
|
1391
|
+
name: z13.string().nullable().optional(),
|
|
1392
|
+
accounts: z13.array(memberAccountSchema).default([]),
|
|
1393
|
+
attempts: z13.number(),
|
|
1394
|
+
completions: z13.number(),
|
|
1395
|
+
rewards: z13.number(),
|
|
1396
|
+
lastActivity: z13.number().nullable()
|
|
1397
|
+
});
|
|
1398
|
+
var personSchema = z13.object({
|
|
1399
|
+
id: z13.string(),
|
|
1400
|
+
accounts: z13.array(memberAccountSchema).default([])
|
|
1401
|
+
});
|
|
1402
|
+
var metricsSchema = z13.object({
|
|
1403
|
+
quests: z13.number(),
|
|
1404
|
+
members: z13.number(),
|
|
1405
|
+
attempts: z13.number(),
|
|
1406
|
+
completions: z13.number(),
|
|
1407
|
+
review: z13.number(),
|
|
1408
|
+
failed: z13.number(),
|
|
1409
|
+
entitlements: z13.number()
|
|
1410
|
+
});
|
|
1411
|
+
var readinessSchema = z13.object({
|
|
1412
|
+
checks: z13.array(
|
|
1413
|
+
z13.object({
|
|
1414
|
+
id: z13.string(),
|
|
1415
|
+
status: z13.enum(["ready", "blocked"]),
|
|
1416
|
+
title: z13.string(),
|
|
1417
|
+
detail: z13.string()
|
|
1281
1418
|
})
|
|
1282
1419
|
)
|
|
1283
1420
|
});
|
|
1284
|
-
var inventorySchema =
|
|
1285
|
-
item:
|
|
1286
|
-
name:
|
|
1287
|
-
available:
|
|
1288
|
-
reserved:
|
|
1289
|
-
allocated:
|
|
1290
|
-
});
|
|
1291
|
-
var auditRecordSchema =
|
|
1292
|
-
id:
|
|
1293
|
-
action:
|
|
1294
|
-
actor:
|
|
1421
|
+
var inventorySchema = z13.object({
|
|
1422
|
+
item: z13.string(),
|
|
1423
|
+
name: z13.string().nullable().default(null),
|
|
1424
|
+
available: z13.number(),
|
|
1425
|
+
reserved: z13.number(),
|
|
1426
|
+
allocated: z13.number().default(0)
|
|
1427
|
+
});
|
|
1428
|
+
var auditRecordSchema = z13.object({
|
|
1429
|
+
id: z13.string(),
|
|
1430
|
+
action: z13.string(),
|
|
1431
|
+
actor: z13.string().nullable(),
|
|
1295
1432
|
user: operatorUserSchema.nullable().optional(),
|
|
1296
|
-
detail:
|
|
1297
|
-
at:
|
|
1298
|
-
attempt:
|
|
1433
|
+
detail: z13.string(),
|
|
1434
|
+
at: z13.number(),
|
|
1435
|
+
attempt: z13.string().nullable()
|
|
1299
1436
|
}).refine((record) => !record.user || record.user.id === record.actor, {
|
|
1300
1437
|
message: "User profile must match the recorded actor",
|
|
1301
1438
|
path: ["user"]
|
|
1302
1439
|
});
|
|
1303
|
-
var pageSchema =
|
|
1440
|
+
var pageSchema = z13.object({
|
|
1304
1441
|
snapshot: snapshotSchema,
|
|
1305
|
-
members:
|
|
1306
|
-
people:
|
|
1442
|
+
members: z13.array(memberSchema),
|
|
1443
|
+
people: z13.array(personSchema).default([]),
|
|
1307
1444
|
metrics: metricsSchema,
|
|
1308
|
-
total:
|
|
1309
|
-
offset:
|
|
1310
|
-
limit:
|
|
1311
|
-
inventory:
|
|
1312
|
-
operations:
|
|
1313
|
-
audit:
|
|
1314
|
-
questCounts:
|
|
1315
|
-
});
|
|
1316
|
-
var managedOAuthAccountBaseSchema =
|
|
1317
|
-
provider:
|
|
1318
|
-
revision:
|
|
1319
|
-
});
|
|
1320
|
-
var managedOAuthAccountSchema =
|
|
1445
|
+
total: z13.number(),
|
|
1446
|
+
offset: z13.number(),
|
|
1447
|
+
limit: z13.number(),
|
|
1448
|
+
inventory: z13.array(inventorySchema),
|
|
1449
|
+
operations: z13.array(operationSchema).default([]),
|
|
1450
|
+
audit: z13.array(auditRecordSchema).default([]),
|
|
1451
|
+
questCounts: z13.record(z13.string(), z13.number())
|
|
1452
|
+
});
|
|
1453
|
+
var managedOAuthAccountBaseSchema = z13.object({
|
|
1454
|
+
provider: z13.enum(["x", "discord"]),
|
|
1455
|
+
revision: z13.number().int().nonnegative()
|
|
1456
|
+
});
|
|
1457
|
+
var managedOAuthAccountSchema = z13.discriminatedUnion("status", [
|
|
1321
1458
|
managedOAuthAccountBaseSchema.extend({
|
|
1322
|
-
status:
|
|
1323
|
-
subject:
|
|
1324
|
-
linkedAt:
|
|
1459
|
+
status: z13.literal("connected"),
|
|
1460
|
+
subject: z13.string().min(1),
|
|
1461
|
+
linkedAt: z13.number()
|
|
1325
1462
|
}),
|
|
1326
|
-
managedOAuthAccountBaseSchema.extend({ status:
|
|
1463
|
+
managedOAuthAccountBaseSchema.extend({ status: z13.literal("disconnected") })
|
|
1327
1464
|
]);
|
|
1328
|
-
var memberOAuthUnlinkInputSchema =
|
|
1329
|
-
provider:
|
|
1330
|
-
subject:
|
|
1331
|
-
revision:
|
|
1332
|
-
reason:
|
|
1465
|
+
var memberOAuthUnlinkInputSchema = z13.object({
|
|
1466
|
+
provider: z13.enum(["x", "discord"]),
|
|
1467
|
+
subject: z13.string().min(1).max(4096),
|
|
1468
|
+
revision: z13.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER - 1),
|
|
1469
|
+
reason: z13.string().trim().min(1).max(500)
|
|
1333
1470
|
}).strict();
|
|
1334
1471
|
var managedWalletSchema = linkedWalletSchema.extend({
|
|
1335
|
-
status:
|
|
1336
|
-
unlinkedAt:
|
|
1472
|
+
status: z13.enum(["linked", "unlinked"]),
|
|
1473
|
+
unlinkedAt: z13.number().int().nullable(),
|
|
1337
1474
|
/** "member", or the operator or key that unlinked it. */
|
|
1338
|
-
unlinkedBy:
|
|
1475
|
+
unlinkedBy: z13.string().nullable()
|
|
1339
1476
|
});
|
|
1340
1477
|
var managedMemberIdentitySchema = memberIdentitySchema.extend({
|
|
1341
|
-
status:
|
|
1342
|
-
unlinkedAt:
|
|
1478
|
+
status: z13.enum(["linked", "unlinked"]),
|
|
1479
|
+
unlinkedAt: z13.number().int().nullable(),
|
|
1343
1480
|
/** The operator or key that unlinked it. */
|
|
1344
|
-
unlinkedBy:
|
|
1481
|
+
unlinkedBy: z13.string().nullable()
|
|
1345
1482
|
});
|
|
1346
|
-
var memberIdentityChangeInputSchema =
|
|
1483
|
+
var memberIdentityChangeInputSchema = z13.object({
|
|
1347
1484
|
kind: appIdentityKindSchema,
|
|
1348
|
-
subject:
|
|
1349
|
-
reason:
|
|
1485
|
+
subject: z13.string().min(1).max(256),
|
|
1486
|
+
reason: z13.string().trim().min(1).max(500)
|
|
1350
1487
|
}).strict();
|
|
1351
1488
|
var balanceCheckSchema = walletBalanceSchema.pick({
|
|
1352
1489
|
chain: true,
|
|
@@ -1356,65 +1493,65 @@ var balanceCheckSchema = walletBalanceSchema.pick({
|
|
|
1356
1493
|
wallets: true,
|
|
1357
1494
|
observedAt: true
|
|
1358
1495
|
}).extend({ attempt: identifier });
|
|
1359
|
-
var walletBalanceChainsSchema =
|
|
1360
|
-
chains:
|
|
1361
|
-
|
|
1362
|
-
chain:
|
|
1363
|
-
|
|
1496
|
+
var walletBalanceChainsSchema = z13.object({
|
|
1497
|
+
chains: z13.array(
|
|
1498
|
+
z13.object({
|
|
1499
|
+
chain: z13.union([
|
|
1500
|
+
z13.literal(solanaMainnet),
|
|
1364
1501
|
cosmosNetworkSchema,
|
|
1365
1502
|
evmChainIdSchema
|
|
1366
1503
|
]),
|
|
1367
|
-
name:
|
|
1368
|
-
testnet:
|
|
1504
|
+
name: z13.string(),
|
|
1505
|
+
testnet: z13.boolean()
|
|
1369
1506
|
})
|
|
1370
1507
|
)
|
|
1371
1508
|
});
|
|
1372
|
-
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason:
|
|
1509
|
+
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason: z13.string().trim().min(1).max(500) }).strict();
|
|
1373
1510
|
var memberWalletSignInInputSchema = walletUnlinkInputSchema.extend({
|
|
1374
|
-
enabled:
|
|
1375
|
-
reason:
|
|
1511
|
+
enabled: z13.boolean(),
|
|
1512
|
+
reason: z13.string().trim().min(1).max(500)
|
|
1376
1513
|
}).strict();
|
|
1377
|
-
var participantSignInSchema =
|
|
1378
|
-
providers:
|
|
1379
|
-
|
|
1514
|
+
var participantSignInSchema = z13.object({
|
|
1515
|
+
providers: z13.array(
|
|
1516
|
+
z13.object({ provider: authProviderSchema, configured: z13.boolean() })
|
|
1380
1517
|
),
|
|
1381
|
-
email:
|
|
1518
|
+
email: z13.boolean(),
|
|
1382
1519
|
/** Wallet families: `"solana"`, `"eip155"`, `"cosmos"`. */
|
|
1383
1520
|
wallets: walletSignInNetworksSchema,
|
|
1384
1521
|
/** Why participants cannot sign in to this project, or null. */
|
|
1385
|
-
issue:
|
|
1386
|
-
updatedAt:
|
|
1387
|
-
updatedBy:
|
|
1522
|
+
issue: z13.string().nullable(),
|
|
1523
|
+
updatedAt: z13.number().nullable(),
|
|
1524
|
+
updatedBy: z13.string().nullable()
|
|
1388
1525
|
});
|
|
1389
|
-
var participantSignInInputSchema =
|
|
1526
|
+
var participantSignInInputSchema = z13.object({
|
|
1390
1527
|
wallets: walletSignInNetworksSchema
|
|
1391
1528
|
}).strict();
|
|
1392
|
-
var completionRevocationShortfallSchema =
|
|
1529
|
+
var completionRevocationShortfallSchema = z13.object({
|
|
1393
1530
|
completion: identifier,
|
|
1394
1531
|
quest: identifier,
|
|
1395
|
-
revokedAt:
|
|
1396
|
-
unreversedPoints:
|
|
1532
|
+
revokedAt: z13.number().int().nonnegative().safe(),
|
|
1533
|
+
unreversedPoints: z13.record(identifier, z13.number().int().positive().safe())
|
|
1397
1534
|
});
|
|
1398
|
-
var memberDetailSchema =
|
|
1535
|
+
var memberDetailSchema = z13.object({
|
|
1399
1536
|
snapshot: snapshotSchema,
|
|
1400
1537
|
member: memberSchema,
|
|
1401
1538
|
progress: memberProgressSchema,
|
|
1402
1539
|
/** Up to 25 revoked completions with an unreversed point remainder, newest first. */
|
|
1403
|
-
revocationShortfalls:
|
|
1540
|
+
revocationShortfalls: z13.array(completionRevocationShortfallSchema).default([]),
|
|
1404
1541
|
/** Current and historical campaign enrollment state, including inactive enrollments. */
|
|
1405
|
-
campaignEnrollments:
|
|
1406
|
-
passes:
|
|
1407
|
-
|
|
1408
|
-
provider:
|
|
1409
|
-
event:
|
|
1410
|
-
subject:
|
|
1542
|
+
campaignEnrollments: z13.array(campaignEnrollmentSchema).default([]),
|
|
1543
|
+
passes: z13.array(
|
|
1544
|
+
z13.object({
|
|
1545
|
+
provider: z13.string(),
|
|
1546
|
+
event: z13.string(),
|
|
1547
|
+
subject: z13.string(),
|
|
1411
1548
|
attempt: identifier.nullable()
|
|
1412
1549
|
})
|
|
1413
1550
|
).default([]),
|
|
1414
1551
|
/** Linked and unlinked wallets. */
|
|
1415
|
-
wallets:
|
|
1552
|
+
wallets: z13.array(managedWalletSchema),
|
|
1416
1553
|
/** The member's 10 most recent recorded balance reads, newest first. */
|
|
1417
|
-
balanceChecks:
|
|
1554
|
+
balanceChecks: z13.array(balanceCheckSchema),
|
|
1418
1555
|
/** The member's participant profile in this project. */
|
|
1419
1556
|
profile: managedProfileSchema.nullable(),
|
|
1420
1557
|
/**
|
|
@@ -1422,117 +1559,117 @@ var memberDetailSchema = z9.object({
|
|
|
1422
1559
|
* member ID: their selected X and Discord accounts and their `app:<name>` identities in this
|
|
1423
1560
|
* project, including app identities an operator unlinked, by kind.
|
|
1424
1561
|
*/
|
|
1425
|
-
identities:
|
|
1562
|
+
identities: z13.array(managedMemberIdentitySchema)
|
|
1426
1563
|
});
|
|
1427
|
-
var stockInputSchema =
|
|
1564
|
+
var stockInputSchema = z13.object({
|
|
1428
1565
|
item: identifier,
|
|
1429
|
-
quantity:
|
|
1566
|
+
quantity: z13.number().int().positive().max(1e6),
|
|
1430
1567
|
actionId: identifier
|
|
1431
1568
|
}).strict();
|
|
1432
|
-
var ingestTrackerScopeSchema =
|
|
1433
|
-
var tokenScopeInputSchema =
|
|
1434
|
-
var tokenInputSchema =
|
|
1435
|
-
name:
|
|
1569
|
+
var ingestTrackerScopeSchema = z13.array(identifier).min(1).max(100).nullable();
|
|
1570
|
+
var tokenScopeInputSchema = z13.object({ ingestTrackers: ingestTrackerScopeSchema }).strict();
|
|
1571
|
+
var tokenInputSchema = z13.object({
|
|
1572
|
+
name: z13.string().trim().min(1).max(80),
|
|
1436
1573
|
project: identifier,
|
|
1437
1574
|
environment: environmentSchema,
|
|
1438
|
-
permissions:
|
|
1575
|
+
permissions: z13.array(permissionSchema).min(1),
|
|
1439
1576
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
1440
|
-
days:
|
|
1577
|
+
days: z13.number().int().min(1).max(90).default(30)
|
|
1441
1578
|
}).strict();
|
|
1442
|
-
var tokenSchema =
|
|
1443
|
-
id:
|
|
1444
|
-
name:
|
|
1445
|
-
project:
|
|
1579
|
+
var tokenSchema = z13.object({
|
|
1580
|
+
id: z13.string(),
|
|
1581
|
+
name: z13.string(),
|
|
1582
|
+
project: z13.string(),
|
|
1446
1583
|
environment: environmentSchema,
|
|
1447
1584
|
permissions: permissionListSchema,
|
|
1448
1585
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
1449
|
-
expiresAt:
|
|
1586
|
+
expiresAt: z13.number()
|
|
1450
1587
|
});
|
|
1451
|
-
var issuedTokenSchema = tokenSchema.extend({ token:
|
|
1452
|
-
var teamSchema =
|
|
1453
|
-
|
|
1588
|
+
var issuedTokenSchema = tokenSchema.extend({ token: z13.string() });
|
|
1589
|
+
var teamSchema = z13.array(
|
|
1590
|
+
z13.object({ id: z13.string(), label: z13.string() })
|
|
1454
1591
|
);
|
|
1455
|
-
var memberLookupSchema =
|
|
1456
|
-
provider:
|
|
1457
|
-
subject:
|
|
1592
|
+
var memberLookupSchema = z13.object({
|
|
1593
|
+
provider: z13.string().min(1).max(200),
|
|
1594
|
+
subject: z13.string().min(1).max(2048)
|
|
1458
1595
|
}).strict();
|
|
1459
|
-
var booleanQuery =
|
|
1460
|
-
|
|
1461
|
-
|
|
1596
|
+
var booleanQuery = z13.union([
|
|
1597
|
+
z13.boolean(),
|
|
1598
|
+
z13.enum(["true", "false"]).transform((v) => v === "true")
|
|
1462
1599
|
]);
|
|
1463
|
-
var managedMemberQuerySchema =
|
|
1464
|
-
q:
|
|
1600
|
+
var managedMemberQuerySchema = z13.strictObject({
|
|
1601
|
+
q: z13.string().max(200).optional(),
|
|
1465
1602
|
needsReview: booleanQuery.optional(),
|
|
1466
|
-
limit:
|
|
1603
|
+
limit: z13.coerce.number().int().min(1).max(100).optional(),
|
|
1467
1604
|
cursor: pageCursorSchema.optional()
|
|
1468
1605
|
});
|
|
1469
|
-
var managedMemberPageSchema =
|
|
1470
|
-
items:
|
|
1471
|
-
total:
|
|
1472
|
-
nextCursor:
|
|
1606
|
+
var managedMemberPageSchema = z13.object({
|
|
1607
|
+
items: z13.array(memberSchema),
|
|
1608
|
+
total: z13.number().int().nonnegative(),
|
|
1609
|
+
nextCursor: z13.string().nullable()
|
|
1473
1610
|
});
|
|
1474
1611
|
var projectMetricsSchema = metricsSchema.extend({
|
|
1475
|
-
completionsByQuest:
|
|
1476
|
-
|
|
1612
|
+
completionsByQuest: z13.array(
|
|
1613
|
+
z13.object({ quest: identifier, completions: z13.number() })
|
|
1477
1614
|
)
|
|
1478
1615
|
});
|
|
1479
|
-
var pageLimit =
|
|
1480
|
-
var managedAttemptQuerySchema =
|
|
1481
|
-
q:
|
|
1482
|
-
status:
|
|
1616
|
+
var pageLimit = z13.coerce.number().int().min(1).max(100).optional();
|
|
1617
|
+
var managedAttemptQuerySchema = z13.strictObject({
|
|
1618
|
+
q: z13.string().max(200).optional(),
|
|
1619
|
+
status: z13.string().min(1).max(50).optional(),
|
|
1483
1620
|
limit: pageLimit,
|
|
1484
1621
|
cursor: pageCursorSchema.optional()
|
|
1485
1622
|
});
|
|
1486
|
-
var managedAttemptPageSchema =
|
|
1487
|
-
items:
|
|
1488
|
-
releases:
|
|
1489
|
-
people:
|
|
1490
|
-
total:
|
|
1491
|
-
nextCursor:
|
|
1623
|
+
var managedAttemptPageSchema = z13.object({
|
|
1624
|
+
items: z13.array(attemptSchema),
|
|
1625
|
+
releases: z13.array(publishedReleaseSchema),
|
|
1626
|
+
people: z13.array(personSchema),
|
|
1627
|
+
total: z13.number().int().nonnegative(),
|
|
1628
|
+
nextCursor: z13.string().nullable()
|
|
1492
1629
|
});
|
|
1493
|
-
var managedAttemptSchema =
|
|
1630
|
+
var managedAttemptSchema = z13.object({
|
|
1494
1631
|
attempt: attemptSchema,
|
|
1495
1632
|
release: publishedReleaseSchema.nullable(),
|
|
1496
|
-
events:
|
|
1633
|
+
events: z13.array(eventSchema),
|
|
1497
1634
|
person: personSchema
|
|
1498
1635
|
});
|
|
1499
|
-
var managedEntitlementQuerySchema =
|
|
1500
|
-
q:
|
|
1501
|
-
status:
|
|
1636
|
+
var managedEntitlementQuerySchema = z13.strictObject({
|
|
1637
|
+
q: z13.string().max(200).optional(),
|
|
1638
|
+
status: z13.string().min(1).max(50).optional(),
|
|
1502
1639
|
limit: pageLimit,
|
|
1503
1640
|
cursor: pageCursorSchema.optional()
|
|
1504
1641
|
});
|
|
1505
|
-
var managedEntitlementPageSchema =
|
|
1506
|
-
items:
|
|
1507
|
-
people:
|
|
1508
|
-
total:
|
|
1509
|
-
nextCursor:
|
|
1642
|
+
var managedEntitlementPageSchema = z13.object({
|
|
1643
|
+
items: z13.array(entitlementSchema),
|
|
1644
|
+
people: z13.array(personSchema),
|
|
1645
|
+
total: z13.number().int().nonnegative(),
|
|
1646
|
+
nextCursor: z13.string().nullable()
|
|
1510
1647
|
});
|
|
1511
|
-
var managedEntitlementSchema =
|
|
1648
|
+
var managedEntitlementSchema = z13.object({
|
|
1512
1649
|
entitlement: entitlementSchema,
|
|
1513
1650
|
person: personSchema
|
|
1514
1651
|
});
|
|
1515
1652
|
var managedStockItemSchema = inventorySchema.extend({
|
|
1516
|
-
offers:
|
|
1653
|
+
offers: z13.array(identifier)
|
|
1517
1654
|
});
|
|
1518
|
-
var auditQuerySchema =
|
|
1519
|
-
category:
|
|
1520
|
-
q:
|
|
1655
|
+
var auditQuerySchema = z13.strictObject({
|
|
1656
|
+
category: z13.enum(["reviews", "rewards", "configuration"]).optional(),
|
|
1657
|
+
q: z13.string().max(200).optional(),
|
|
1521
1658
|
limit: pageLimit,
|
|
1522
1659
|
cursor: pageCursorSchema.optional()
|
|
1523
1660
|
});
|
|
1524
1661
|
var accessHistoryQuerySchema = auditQuerySchema.omit({
|
|
1525
1662
|
category: true
|
|
1526
1663
|
});
|
|
1527
|
-
var auditPageSchema =
|
|
1528
|
-
items:
|
|
1529
|
-
total:
|
|
1530
|
-
nextCursor:
|
|
1664
|
+
var auditPageSchema = z13.object({
|
|
1665
|
+
items: z13.array(auditRecordSchema),
|
|
1666
|
+
total: z13.number().int().nonnegative(),
|
|
1667
|
+
nextCursor: z13.string().nullable()
|
|
1531
1668
|
});
|
|
1532
|
-
var verifiedPassSchema =
|
|
1669
|
+
var verifiedPassSchema = z13.object({
|
|
1533
1670
|
provider: identifier,
|
|
1534
1671
|
event: identifier,
|
|
1535
|
-
subject:
|
|
1672
|
+
subject: z13.string().min(1).max(2048),
|
|
1536
1673
|
member: identifier,
|
|
1537
1674
|
quest: identifier
|
|
1538
1675
|
}).strict();
|
|
@@ -1569,7 +1706,7 @@ function clientFailure(error) {
|
|
|
1569
1706
|
return new ManagementError({
|
|
1570
1707
|
kind: "client",
|
|
1571
1708
|
code: ManagementErrorCode.InvalidInput,
|
|
1572
|
-
message: error instanceof
|
|
1709
|
+
message: error instanceof z13.ZodError ? `Invalid management request: ${z13.prettifyError(error)}` : error instanceof Error ? error.message : "Invalid management request",
|
|
1573
1710
|
cause: error
|
|
1574
1711
|
});
|
|
1575
1712
|
}
|
|
@@ -1831,7 +1968,7 @@ function managementClient(options) {
|
|
|
1831
1968
|
call
|
|
1832
1969
|
);
|
|
1833
1970
|
}
|
|
1834
|
-
const ok =
|
|
1971
|
+
const ok = z13.object({ ok: z13.literal(true) });
|
|
1835
1972
|
function pointHistory(member, ledger, query = {}, call) {
|
|
1836
1973
|
return get(
|
|
1837
1974
|
`/points/${identifier.parse(member)}/${identifier.parse(ledger)}/history${queryString(typeof query === "number" ? { before: query } : pageQuerySchema.parse(query))}`,
|
|
@@ -1953,8 +2090,8 @@ function managementClient(options) {
|
|
|
1953
2090
|
}
|
|
1954
2091
|
return exchange(
|
|
1955
2092
|
path,
|
|
1956
|
-
|
|
1957
|
-
status:
|
|
2093
|
+
z13.object({
|
|
2094
|
+
status: z13.number(),
|
|
1958
2095
|
operationId: identifier.optional(),
|
|
1959
2096
|
result: schema
|
|
1960
2097
|
}),
|
|
@@ -1985,7 +2122,7 @@ function managementClient(options) {
|
|
|
1985
2122
|
call
|
|
1986
2123
|
),
|
|
1987
2124
|
...resourceArchiveMethods("tracker"),
|
|
1988
|
-
list: (call) => get("/trackers",
|
|
2125
|
+
list: (call) => get("/trackers", z13.array(trackerStatusSchema), call),
|
|
1989
2126
|
get: (reference, call) => get(
|
|
1990
2127
|
`/trackers/${identifier.parse(reference)}`,
|
|
1991
2128
|
trackerStatusSchema,
|
|
@@ -2101,7 +2238,7 @@ function managementClient(options) {
|
|
|
2101
2238
|
engagementPublishSchema.parse(withActionId(input)),
|
|
2102
2239
|
call
|
|
2103
2240
|
),
|
|
2104
|
-
list: (call) => get("/engagement",
|
|
2241
|
+
list: (call) => get("/engagement", z13.array(engagementRuleSchema), call),
|
|
2105
2242
|
page: (input, call) => get(
|
|
2106
2243
|
"/engagement/history" + queryString(engagementPageQuerySchema.parse(input)),
|
|
2107
2244
|
engagementPageSchema,
|
|
@@ -2122,7 +2259,7 @@ function managementClient(options) {
|
|
|
2122
2259
|
},
|
|
2123
2260
|
pointLedgers: {
|
|
2124
2261
|
unarchive: (ledger, input, call) => archiveResource("point-ledger", ledger, false, input, call),
|
|
2125
|
-
list: (call) => get("/point-ledgers",
|
|
2262
|
+
list: (call) => get("/point-ledgers", z13.array(managedPointLedgerSchema), call),
|
|
2126
2263
|
/**
|
|
2127
2264
|
* Creates a point ledger, with a stable `key` when code refers to it; requires `publish`. In
|
|
2128
2265
|
* live, only a person in Console can create one.
|
|
@@ -2152,7 +2289,7 @@ function managementClient(options) {
|
|
|
2152
2289
|
},
|
|
2153
2290
|
points: {
|
|
2154
2291
|
/** @deprecated Use `pointLedgers.list()`, which reads the same ledgers. Removed in 2.0.0. */
|
|
2155
|
-
ledgers: (call) => get("/point-ledgers",
|
|
2292
|
+
ledgers: (call) => get("/point-ledgers", z13.array(managedPointLedgerSchema), call),
|
|
2156
2293
|
/** @deprecated Use `pointLedgers.create(input)`. Removed in 2.0.0. */
|
|
2157
2294
|
createLedger: createPointLedger,
|
|
2158
2295
|
/**
|
|
@@ -2190,7 +2327,7 @@ function managementClient(options) {
|
|
|
2190
2327
|
referralHistorySchema,
|
|
2191
2328
|
call
|
|
2192
2329
|
),
|
|
2193
|
-
list: (call) => get("/referrals",
|
|
2330
|
+
list: (call) => get("/referrals", z13.array(publishedReferralSchema), call),
|
|
2194
2331
|
participants: referralParticipants,
|
|
2195
2332
|
/**
|
|
2196
2333
|
* Suspends or restores a member's referral relationship, with a reason; requires `publish`.
|
|
@@ -2253,7 +2390,7 @@ function managementClient(options) {
|
|
|
2253
2390
|
},
|
|
2254
2391
|
leaderboards: {
|
|
2255
2392
|
...resourceArchiveMethods("leaderboard"),
|
|
2256
|
-
list: (call) => get("/leaderboards",
|
|
2393
|
+
list: (call) => get("/leaderboards", z13.array(publishedLeaderboardSchema), call),
|
|
2257
2394
|
standings: (board, input = {}, call) => {
|
|
2258
2395
|
const query = leaderboardQuerySchema.parse(input);
|
|
2259
2396
|
return get(
|
|
@@ -2267,12 +2404,12 @@ function managementClient(options) {
|
|
|
2267
2404
|
},
|
|
2268
2405
|
history: (board, call) => get(
|
|
2269
2406
|
`/leaderboards/${identifier.parse(board)}/history`,
|
|
2270
|
-
|
|
2407
|
+
z13.array(publishedLeaderboardSchema),
|
|
2271
2408
|
call
|
|
2272
2409
|
),
|
|
2273
2410
|
exclusions: (board, call) => get(
|
|
2274
2411
|
`/leaderboards/${identifier.parse(board)}/exclusions`,
|
|
2275
|
-
|
|
2412
|
+
z13.array(z13.object({ member: identifier })),
|
|
2276
2413
|
call
|
|
2277
2414
|
),
|
|
2278
2415
|
exclude: (board, input, call) => post(
|
|
@@ -2294,9 +2431,26 @@ function managementClient(options) {
|
|
|
2294
2431
|
leaderboardGroupSchema.parse(withActionId(input)),
|
|
2295
2432
|
call
|
|
2296
2433
|
),
|
|
2434
|
+
/** Pending, approved and rejected snapshots; requires read permission. */
|
|
2435
|
+
settlementReviews: (reference, query = {}, call) => get(
|
|
2436
|
+
`/leaderboards/${identifier.parse(reference)}/settlement-reviews${queryString(leaderboardSettlementReviewQuerySchema.parse(query))}`,
|
|
2437
|
+
leaderboardSettlementReviewPageSchema,
|
|
2438
|
+
call
|
|
2439
|
+
),
|
|
2440
|
+
settlementReview: (settlement, call) => get(
|
|
2441
|
+
`/leaderboard-settlements/${identifier.parse(settlement)}/review`,
|
|
2442
|
+
leaderboardSettlementReviewSchema,
|
|
2443
|
+
call
|
|
2444
|
+
),
|
|
2445
|
+
rejectSettlement: (settlement, input, call) => post(
|
|
2446
|
+
`/leaderboard-settlements/${identifier.parse(settlement)}/reject`,
|
|
2447
|
+
leaderboardSettlementReviewSchema,
|
|
2448
|
+
leaderboardSettlementRejectionSchema.parse(withActionId(input)),
|
|
2449
|
+
call
|
|
2450
|
+
),
|
|
2297
2451
|
settlements: (board, call) => get(
|
|
2298
2452
|
`/leaderboards/${identifier.parse(board)}/settlements`,
|
|
2299
|
-
|
|
2453
|
+
z13.array(leaderboardSettlementSummarySchema),
|
|
2300
2454
|
call
|
|
2301
2455
|
),
|
|
2302
2456
|
settlement: (settlement, call) => get(
|
|
@@ -2376,7 +2530,7 @@ function managementClient(options) {
|
|
|
2376
2530
|
)
|
|
2377
2531
|
},
|
|
2378
2532
|
deployments: {
|
|
2379
|
-
list: (call) => get("/deployments",
|
|
2533
|
+
list: (call) => get("/deployments", z13.array(deploymentRecordSchema), call),
|
|
2380
2534
|
get: (deployment, call) => get(
|
|
2381
2535
|
`/deployments/${identifier.parse(deployment)}`,
|
|
2382
2536
|
deploymentRecordSchema,
|
|
@@ -2612,7 +2766,7 @@ function managementClient(options) {
|
|
|
2612
2766
|
},
|
|
2613
2767
|
operations: {
|
|
2614
2768
|
/** Every paused or resumed operation: redemptions and each quest's participation; requires `read`. */
|
|
2615
|
-
list: (call) => get("/operations",
|
|
2769
|
+
list: (call) => get("/operations", z13.array(operationSchema), call),
|
|
2616
2770
|
/**
|
|
2617
2771
|
* Pauses or resumes redemptions or one quest's participation, against the `revision` the
|
|
2618
2772
|
* operator saw, with a reason; requires `publish` permission.
|
|
@@ -2630,8 +2784,38 @@ function managementClient(options) {
|
|
|
2630
2784
|
resume: (input, call) => operationVerb("redemptions", false, input, call)
|
|
2631
2785
|
},
|
|
2632
2786
|
inventory: {
|
|
2787
|
+
/** Includes archived items and revision fences; requires read permission. */
|
|
2788
|
+
items: (query = {}, call) => get(
|
|
2789
|
+
"/stock-items/states" + queryString(managementStateQuerySchema.parse(query)),
|
|
2790
|
+
inventoryItemPageSchema,
|
|
2791
|
+
call
|
|
2792
|
+
),
|
|
2793
|
+
rename: (item, input, call) => post(
|
|
2794
|
+
`/stock-items/${encodeURIComponent(item)}/rename`,
|
|
2795
|
+
inventoryItemStateSchema,
|
|
2796
|
+
inventoryItemRenameSchema.parse(withActionId(input)),
|
|
2797
|
+
call
|
|
2798
|
+
),
|
|
2799
|
+
archive: (item, input, call) => post(
|
|
2800
|
+
`/stock-items/${encodeURIComponent(item)}/archive`,
|
|
2801
|
+
inventoryItemStateSchema,
|
|
2802
|
+
inventoryItemActionSchema.parse(withActionId(input)),
|
|
2803
|
+
call
|
|
2804
|
+
),
|
|
2805
|
+
unarchive: (item, input, call) => post(
|
|
2806
|
+
`/stock-items/${encodeURIComponent(item)}/unarchive`,
|
|
2807
|
+
inventoryItemStateSchema,
|
|
2808
|
+
inventoryItemActionSchema.parse(withActionId(input)),
|
|
2809
|
+
call
|
|
2810
|
+
),
|
|
2811
|
+
adjustStock: (item, input, call) => post(
|
|
2812
|
+
`/stock-items/${encodeURIComponent(item)}/adjust-stock`,
|
|
2813
|
+
inventoryItemStateSchema,
|
|
2814
|
+
inventoryStockCorrectionSchema.parse(withActionId(input)),
|
|
2815
|
+
call
|
|
2816
|
+
),
|
|
2633
2817
|
/** Every stock item with its counts and the offers that sell it; requires `read` permission. */
|
|
2634
|
-
list: (call) => get("/stock-items",
|
|
2818
|
+
list: (call) => get("/stock-items", z13.array(managedStockItemSchema), call),
|
|
2635
2819
|
createItem: (input, call) => create(
|
|
2636
2820
|
"/stock-items",
|
|
2637
2821
|
stockItemSchema,
|
|
@@ -2646,7 +2830,7 @@ function managementClient(options) {
|
|
|
2646
2830
|
stockInputSchema.parse(withActionId(input)),
|
|
2647
2831
|
call
|
|
2648
2832
|
),
|
|
2649
|
-
catalog: (call) => get("/pickup-inventory",
|
|
2833
|
+
catalog: (call) => get("/pickup-inventory", z13.array(pickupCatalogSchema), call),
|
|
2650
2834
|
configure: (input, call) => post(
|
|
2651
2835
|
"/pickup-inventory",
|
|
2652
2836
|
pickupCatalogSchema,
|
|
@@ -2672,10 +2856,10 @@ function managementClient(options) {
|
|
|
2672
2856
|
offerControlSchema.omit({ enabled: true }).parse(withActionId(input)),
|
|
2673
2857
|
call
|
|
2674
2858
|
),
|
|
2675
|
-
list: (call) => get("/offers",
|
|
2859
|
+
list: (call) => get("/offers", z13.array(offerSchema), call),
|
|
2676
2860
|
redemptions: (input = {}, call) => get(
|
|
2677
2861
|
`/redemptions${queryString({ member: input.member })}`,
|
|
2678
|
-
|
|
2862
|
+
z13.array(redemptionSchema),
|
|
2679
2863
|
call
|
|
2680
2864
|
),
|
|
2681
2865
|
/** Pauses or resumes an offer at the revision the operator saw. */
|
|
@@ -2724,7 +2908,7 @@ function managementClient(options) {
|
|
|
2724
2908
|
* them; API keys and project-scoped playground sessions cannot.
|
|
2725
2909
|
*/
|
|
2726
2910
|
tokens: {
|
|
2727
|
-
list: (call) => get("/tokens",
|
|
2911
|
+
list: (call) => get("/tokens", z13.array(tokenSchema), call),
|
|
2728
2912
|
/**
|
|
2729
2913
|
* Issues a key for one project and environment, limited to permissions the caller holds
|
|
2730
2914
|
* there. The secret `token` is in this response only.
|
|
@@ -2732,14 +2916,14 @@ function managementClient(options) {
|
|
|
2732
2916
|
create: (input, call) => post("/tokens", issuedTokenSchema, tokenInputSchema.parse(input), call),
|
|
2733
2917
|
/** Replace a personal key's ingestion restriction without changing its secret. */
|
|
2734
2918
|
scope: (id, input, call) => request(
|
|
2735
|
-
`/tokens/${encodeURIComponent(
|
|
2919
|
+
`/tokens/${encodeURIComponent(z13.string().min(1).parse(id))}/scope`,
|
|
2736
2920
|
tokenSchema,
|
|
2737
2921
|
tokenScopeInputSchema.parse(input),
|
|
2738
2922
|
"PUT",
|
|
2739
2923
|
call
|
|
2740
2924
|
),
|
|
2741
2925
|
revoke: (id, call) => request(
|
|
2742
|
-
`/tokens/${encodeURIComponent(
|
|
2926
|
+
`/tokens/${encodeURIComponent(z13.string().min(1).parse(id))}`,
|
|
2743
2927
|
ok,
|
|
2744
2928
|
void 0,
|
|
2745
2929
|
"DELETE",
|
|
@@ -2748,7 +2932,7 @@ function managementClient(options) {
|
|
|
2748
2932
|
},
|
|
2749
2933
|
/** Who holds which roles on the client's project; organization administrators only. */
|
|
2750
2934
|
grants: {
|
|
2751
|
-
list: (call) => get("/grants",
|
|
2935
|
+
list: (call) => get("/grants", z13.array(grantRecordSchema), call),
|
|
2752
2936
|
/** Replaces one person's roles and environments on the project. The audit log records it. */
|
|
2753
2937
|
set: (input, call) => request(
|
|
2754
2938
|
"/grants",
|
|
@@ -2764,19 +2948,36 @@ function managementClient(options) {
|
|
|
2764
2948
|
},
|
|
2765
2949
|
/** Signed activity notifications for one project/environment; writes require publish permission. */
|
|
2766
2950
|
webhooks: {
|
|
2951
|
+
state: (id, call) => get(
|
|
2952
|
+
`/webhooks/${z13.string().uuid().parse(id)}/state`,
|
|
2953
|
+
webhookEndpointStateSchema,
|
|
2954
|
+
call
|
|
2955
|
+
),
|
|
2956
|
+
/** Includes deleted endpoints, ordered by ID; requires read permission. */
|
|
2957
|
+
states: (query = {}, call) => get(
|
|
2958
|
+
"/webhooks/states" + queryString(webhookStateQuerySchema.parse(query)),
|
|
2959
|
+
webhookStatePageSchema,
|
|
2960
|
+
call
|
|
2961
|
+
),
|
|
2962
|
+
delete: (id, input, call) => post(
|
|
2963
|
+
`/webhooks/${z13.string().uuid().parse(id)}/delete`,
|
|
2964
|
+
webhookEndpointStateSchema,
|
|
2965
|
+
webhookDeleteInputSchema.parse(withActionId(input)),
|
|
2966
|
+
call
|
|
2967
|
+
),
|
|
2767
2968
|
pause: (id, input = {}, call) => post(
|
|
2768
|
-
`/webhooks/${
|
|
2969
|
+
`/webhooks/${z13.string().uuid().parse(id)}/pause`,
|
|
2769
2970
|
webhookEndpointSchema,
|
|
2770
2971
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
2771
2972
|
call
|
|
2772
2973
|
),
|
|
2773
2974
|
resume: (id, input = {}, call) => post(
|
|
2774
|
-
`/webhooks/${
|
|
2975
|
+
`/webhooks/${z13.string().uuid().parse(id)}/resume`,
|
|
2775
2976
|
webhookEndpointSchema,
|
|
2776
2977
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
2777
2978
|
call
|
|
2778
2979
|
),
|
|
2779
|
-
list: (call) => get("/webhooks",
|
|
2980
|
+
list: (call) => get("/webhooks", z13.array(webhookEndpointSchema), call),
|
|
2780
2981
|
create: (input, call) => post(
|
|
2781
2982
|
"/webhooks",
|
|
2782
2983
|
webhookSecretSchema,
|
|
@@ -2784,7 +2985,7 @@ function managementClient(options) {
|
|
|
2784
2985
|
call
|
|
2785
2986
|
),
|
|
2786
2987
|
update: (id, input, call) => request(
|
|
2787
|
-
`/webhooks/${
|
|
2988
|
+
`/webhooks/${z13.string().uuid().parse(id)}`,
|
|
2788
2989
|
webhookEndpointSchema,
|
|
2789
2990
|
webhookUpdateSchema.parse(input),
|
|
2790
2991
|
"PUT",
|
|
@@ -2792,24 +2993,24 @@ function managementClient(options) {
|
|
|
2792
2993
|
),
|
|
2793
2994
|
/** @deprecated Use pause. Removed in 2.0.0. */
|
|
2794
2995
|
disable: (id, call) => post(
|
|
2795
|
-
`/webhooks/${
|
|
2996
|
+
`/webhooks/${z13.string().uuid().parse(id)}/disable`,
|
|
2796
2997
|
webhookEndpointSchema,
|
|
2797
2998
|
{},
|
|
2798
2999
|
call
|
|
2799
3000
|
),
|
|
2800
3001
|
rotateSecret: (id, call) => post(
|
|
2801
|
-
`/webhooks/${
|
|
3002
|
+
`/webhooks/${z13.string().uuid().parse(id)}/rotate-secret`,
|
|
2802
3003
|
webhookSecretSchema,
|
|
2803
3004
|
{},
|
|
2804
3005
|
call
|
|
2805
3006
|
),
|
|
2806
3007
|
deliveries: (id, query = {}, call) => get(
|
|
2807
|
-
`/webhooks/${
|
|
3008
|
+
`/webhooks/${z13.string().uuid().parse(id)}/deliveries${queryString(webhookQuerySchema.parse(query))}`,
|
|
2808
3009
|
webhookDeliveryPageSchema,
|
|
2809
3010
|
call
|
|
2810
3011
|
),
|
|
2811
3012
|
replay: (id, delivery, call) => post(
|
|
2812
|
-
`/webhooks/${
|
|
3013
|
+
`/webhooks/${z13.string().uuid().parse(id)}/deliveries/${z13.string().uuid().parse(delivery)}/replay`,
|
|
2813
3014
|
webhookDeliverySchema,
|
|
2814
3015
|
{},
|
|
2815
3016
|
call
|
|
@@ -2820,7 +3021,7 @@ function managementClient(options) {
|
|
|
2820
3021
|
* environment. Organization administrators, from a Console session only.
|
|
2821
3022
|
*/
|
|
2822
3023
|
identityIntegrations: {
|
|
2823
|
-
list: (call) => get("/identity-integrations",
|
|
3024
|
+
list: (call) => get("/identity-integrations", z13.array(identityIntegrationSchema), call),
|
|
2824
3025
|
/** The secret `token` is in this response only. */
|
|
2825
3026
|
create: (input, call) => post(
|
|
2826
3027
|
"/identity-integrations",
|
|
@@ -2830,7 +3031,7 @@ function managementClient(options) {
|
|
|
2830
3031
|
),
|
|
2831
3032
|
/** Replaces the key's secret and extends it by 90 days; the old secret stops working. */
|
|
2832
3033
|
rotate: (id, call) => post(
|
|
2833
|
-
`/identity-integrations/${
|
|
3034
|
+
`/identity-integrations/${z13.string().uuid().parse(id)}/rotate`,
|
|
2834
3035
|
identityIntegrationSecretSchema,
|
|
2835
3036
|
{},
|
|
2836
3037
|
call
|
|
@@ -2842,7 +3043,7 @@ function managementClient(options) {
|
|
|
2842
3043
|
*/
|
|
2843
3044
|
kinds: (call) => get(
|
|
2844
3045
|
"/identity-integrations/kinds",
|
|
2845
|
-
|
|
3046
|
+
z13.array(identityKindClaimSchema),
|
|
2846
3047
|
call
|
|
2847
3048
|
),
|
|
2848
3049
|
/**
|
|
@@ -2850,8 +3051,8 @@ function managementClient(options) {
|
|
|
2850
3051
|
* and keep attributing tracker records; unlink them on the member to stop that.
|
|
2851
3052
|
*/
|
|
2852
3053
|
revoke: (id, call) => request(
|
|
2853
|
-
`/identity-integrations/${
|
|
2854
|
-
|
|
3054
|
+
`/identity-integrations/${z13.string().uuid().parse(id)}`,
|
|
3055
|
+
z13.null(),
|
|
2855
3056
|
void 0,
|
|
2856
3057
|
"DELETE",
|
|
2857
3058
|
call
|
|
@@ -2903,7 +3104,7 @@ function managementClient(options) {
|
|
|
2903
3104
|
resources: {
|
|
2904
3105
|
list: (call) => get(
|
|
2905
3106
|
"/resources",
|
|
2906
|
-
|
|
3107
|
+
z13.object({ resources: z13.array(managedResourceSchema) }),
|
|
2907
3108
|
call
|
|
2908
3109
|
),
|
|
2909
3110
|
/** @deprecated Use the resource archive/unarchive methods. Removed in 2.0.0. */
|
|
@@ -2940,7 +3141,7 @@ function managementClient(options) {
|
|
|
2940
3141
|
testMemberCreateSchema.parse(withActionId(input)),
|
|
2941
3142
|
call
|
|
2942
3143
|
),
|
|
2943
|
-
list: (call) => get("/test-members",
|
|
3144
|
+
list: (call) => get("/test-members", z13.array(testMemberSchema), call),
|
|
2944
3145
|
history: (member, query = {}, call) => get(
|
|
2945
3146
|
`/test-members/${identifier.parse(member)}/history${queryString(testMemberHistoryQuerySchema.parse(query))}`,
|
|
2946
3147
|
testMemberHistorySchema,
|
|
@@ -2968,6 +3169,21 @@ function managementClient(options) {
|
|
|
2968
3169
|
},
|
|
2969
3170
|
/** The project's members, as operators see them. */
|
|
2970
3171
|
members: {
|
|
3172
|
+
identityLinks: {
|
|
3173
|
+
/** Owned wallet links and exact owned OAuth choices; requires read permission. */
|
|
3174
|
+
list: (member, query = {}, call) => get(
|
|
3175
|
+
`/members/${identifier.parse(member)}/identity-links${queryString(managementStateQuerySchema.parse(query))}`,
|
|
3176
|
+
memberIdentityLinkPageSchema,
|
|
3177
|
+
call
|
|
3178
|
+
),
|
|
3179
|
+
/** Restores attribution for the same owner; requires review permission. Sign-in is separate. */
|
|
3180
|
+
relink: (member, input, call) => post(
|
|
3181
|
+
`/members/${identifier.parse(member)}/identity-links/relink`,
|
|
3182
|
+
memberIdentityLinkSchema,
|
|
3183
|
+
identityLinkRelinkInputSchema.parse(withActionId(input)),
|
|
3184
|
+
call
|
|
3185
|
+
)
|
|
3186
|
+
},
|
|
2971
3187
|
counters: {
|
|
2972
3188
|
history: (member, quest, query = {}, call) => get(
|
|
2973
3189
|
`/members/${identifier.parse(member)}/counters/${identifier.parse(quest)}${queryString(counterHistoryQuerySchema.parse(query))}`,
|
|
@@ -3007,26 +3223,26 @@ function managementClient(options) {
|
|
|
3007
3223
|
/** Who each member is: up to 100 distinct IDs; unknown IDs come back without accounts. */
|
|
3008
3224
|
people: (members, call) => get(
|
|
3009
3225
|
`/people${queryString({ ids: members.join(",") })}`,
|
|
3010
|
-
|
|
3226
|
+
z13.array(personSchema),
|
|
3011
3227
|
call
|
|
3012
3228
|
),
|
|
3013
3229
|
/** Current X and Discord quest account selections; requires read permission. */
|
|
3014
3230
|
oauthAccounts: (member, call) => get(
|
|
3015
3231
|
`/members/${encodeURIComponent(member)}/oauth-accounts`,
|
|
3016
|
-
|
|
3232
|
+
z13.array(managedOAuthAccountSchema),
|
|
3017
3233
|
call
|
|
3018
3234
|
),
|
|
3019
3235
|
/** Unlinks the reviewed selection across this organization/environment, preserving ownership and sign-in. */
|
|
3020
3236
|
unlinkOAuthAccount: (member, input, call) => post(
|
|
3021
3237
|
`/members/${encodeURIComponent(member)}/oauth-accounts/unlink`,
|
|
3022
|
-
|
|
3238
|
+
z13.array(managedOAuthAccountSchema),
|
|
3023
3239
|
memberOAuthUnlinkInputSchema.parse(input),
|
|
3024
3240
|
call
|
|
3025
3241
|
),
|
|
3026
3242
|
/** Unlinks a member's wallet from the project with a reason; requires `review` permission. The address stays bound to the member. */
|
|
3027
3243
|
unlinkWallet: (member, input, call) => post(
|
|
3028
3244
|
`/members/${encodeURIComponent(member)}/wallets/unlink`,
|
|
3029
|
-
|
|
3245
|
+
z13.array(managedWalletSchema),
|
|
3030
3246
|
memberWalletUnlinkInputSchema.parse(input),
|
|
3031
3247
|
call
|
|
3032
3248
|
),
|
|
@@ -3037,14 +3253,14 @@ function managementClient(options) {
|
|
|
3037
3253
|
*/
|
|
3038
3254
|
unlinkIdentity: (member, input, call) => post(
|
|
3039
3255
|
`/members/${encodeURIComponent(member)}/identities/unlink`,
|
|
3040
|
-
|
|
3256
|
+
z13.array(managedMemberIdentitySchema),
|
|
3041
3257
|
memberIdentityChangeInputSchema.parse(input),
|
|
3042
3258
|
call
|
|
3043
3259
|
),
|
|
3044
3260
|
/** Relinks an `app:<name>` identity an operator unlinked from this member, with a reason; requires `review` permission. */
|
|
3045
3261
|
relinkIdentity: (member, input, call) => post(
|
|
3046
3262
|
`/members/${encodeURIComponent(member)}/identities/relink`,
|
|
3047
|
-
|
|
3263
|
+
z13.array(managedMemberIdentitySchema),
|
|
3048
3264
|
memberIdentityChangeInputSchema.parse(input),
|
|
3049
3265
|
call
|
|
3050
3266
|
),
|
|
@@ -3054,7 +3270,7 @@ function managementClient(options) {
|
|
|
3054
3270
|
*/
|
|
3055
3271
|
setWalletSignIn: (member, input, call) => post(
|
|
3056
3272
|
`/members/${encodeURIComponent(member)}/wallets/sign-in`,
|
|
3057
|
-
|
|
3273
|
+
z13.array(managedWalletSchema),
|
|
3058
3274
|
memberWalletSignInInputSchema.parse(input),
|
|
3059
3275
|
call
|
|
3060
3276
|
)
|
|
@@ -3204,7 +3420,7 @@ function managementClient(options) {
|
|
|
3204
3420
|
* Each quest's current release, the most recently published first, archived quests
|
|
3205
3421
|
* included; requires `read` permission.
|
|
3206
3422
|
*/
|
|
3207
|
-
list: (call) => get("/quests/list",
|
|
3423
|
+
list: (call) => get("/quests/list", z13.array(publishedReleaseSchema), call),
|
|
3208
3424
|
/** Pending and exhausted asynchronous balance checks. Requires read. */
|
|
3209
3425
|
automaticScheduling: (query = {}, call) => get(
|
|
3210
3426
|
`/quests/automatic-scheduling${queryString(automaticSchedulingQuerySchema.parse(query))}`,
|
|
@@ -3238,10 +3454,21 @@ function managementClient(options) {
|
|
|
3238
3454
|
automaticCatchUpConfirmSchema.parse(withActionId(input)),
|
|
3239
3455
|
call
|
|
3240
3456
|
),
|
|
3457
|
+
enrollments: (member, query = {}, call) => get(
|
|
3458
|
+
`/members/${encodeURIComponent(member)}/quest-enrollments${queryString(managementStateQuerySchema.parse(query))}`,
|
|
3459
|
+
managedQuestEnrollmentPageSchema,
|
|
3460
|
+
call
|
|
3461
|
+
),
|
|
3462
|
+
withdraw: (quest, member, input, call) => post(
|
|
3463
|
+
`/quests/${encodeURIComponent(quest)}/enrollments/${encodeURIComponent(member)}/withdraw`,
|
|
3464
|
+
questEnrollmentStateSchema,
|
|
3465
|
+
questEnrollmentWithdrawalInputSchema.parse(withActionId(input)),
|
|
3466
|
+
call
|
|
3467
|
+
),
|
|
3241
3468
|
/**
|
|
3242
3469
|
* Enrolls a member in a quest whose tracker trigger requires enrollment, vouching for their
|
|
3243
3470
|
* consent; requires `enroll` permission. The member must have joined the project. Enrolling
|
|
3244
|
-
* again returns the
|
|
3471
|
+
* again returns the active enrollment. After withdrawal it starts a new enrollment. The member's skips recorded as `not-enrolled` on the
|
|
3245
3472
|
* quest are decided again.
|
|
3246
3473
|
*/
|
|
3247
3474
|
enroll: (input, call) => post(
|
|
@@ -3294,6 +3521,26 @@ function managementClient(options) {
|
|
|
3294
3521
|
});
|
|
3295
3522
|
}
|
|
3296
3523
|
var managementResponseSchemas = {
|
|
3524
|
+
memberIdentityLinkPageSchema: knownResponse(memberIdentityLinkPageSchema),
|
|
3525
|
+
managedQuestEnrollmentPageSchema: knownResponse(
|
|
3526
|
+
managedQuestEnrollmentPageSchema
|
|
3527
|
+
),
|
|
3528
|
+
inventoryItemPageSchema: knownResponse(inventoryItemPageSchema),
|
|
3529
|
+
inventoryItemStateSchema: knownResponse(inventoryItemStateSchema),
|
|
3530
|
+
questEnrollmentStateSchema: knownResponse(questEnrollmentStateSchema),
|
|
3531
|
+
managedQuestEnrollmentSchema: knownResponse(managedQuestEnrollmentSchema),
|
|
3532
|
+
memberIdentityLinkSchema: knownResponse(memberIdentityLinkSchema),
|
|
3533
|
+
leaderboardSettlementReviewSchema: knownResponse(
|
|
3534
|
+
leaderboardSettlementReviewSchema
|
|
3535
|
+
),
|
|
3536
|
+
leaderboardSettlementReviewSummarySchema: knownResponse(
|
|
3537
|
+
leaderboardSettlementReviewSummarySchema
|
|
3538
|
+
),
|
|
3539
|
+
leaderboardSettlementReviewPageSchema: knownResponse(
|
|
3540
|
+
leaderboardSettlementReviewPageSchema
|
|
3541
|
+
),
|
|
3542
|
+
webhookEndpointStateSchema: knownResponse(webhookEndpointStateSchema),
|
|
3543
|
+
webhookStatePageSchema: knownResponse(webhookStatePageSchema),
|
|
3297
3544
|
accessSchema: knownResponse(accessSchema),
|
|
3298
3545
|
allocatedQuestSchema: knownResponse(allocatedQuestSchema),
|
|
3299
3546
|
appSecretListSchema: knownResponse(appSecretListSchema),
|
|
@@ -3416,6 +3663,26 @@ var managementResponseSchemas = {
|
|
|
3416
3663
|
webhookSecretSchema: knownResponse(webhookSecretSchema)
|
|
3417
3664
|
};
|
|
3418
3665
|
var managementResponses = {
|
|
3666
|
+
memberIdentityLinkPageSchema: responseSchema(memberIdentityLinkPageSchema),
|
|
3667
|
+
managedQuestEnrollmentPageSchema: responseSchema(
|
|
3668
|
+
managedQuestEnrollmentPageSchema
|
|
3669
|
+
),
|
|
3670
|
+
inventoryItemPageSchema: responseSchema(inventoryItemPageSchema),
|
|
3671
|
+
inventoryItemStateSchema: responseSchema(inventoryItemStateSchema),
|
|
3672
|
+
questEnrollmentStateSchema: responseSchema(questEnrollmentStateSchema),
|
|
3673
|
+
managedQuestEnrollmentSchema: responseSchema(managedQuestEnrollmentSchema),
|
|
3674
|
+
memberIdentityLinkSchema: responseSchema(memberIdentityLinkSchema),
|
|
3675
|
+
leaderboardSettlementReviewSchema: responseSchema(
|
|
3676
|
+
leaderboardSettlementReviewSchema
|
|
3677
|
+
),
|
|
3678
|
+
leaderboardSettlementReviewSummarySchema: responseSchema(
|
|
3679
|
+
leaderboardSettlementReviewSummarySchema
|
|
3680
|
+
),
|
|
3681
|
+
leaderboardSettlementReviewPageSchema: responseSchema(
|
|
3682
|
+
leaderboardSettlementReviewPageSchema
|
|
3683
|
+
),
|
|
3684
|
+
webhookEndpointStateSchema: responseSchema(webhookEndpointStateSchema),
|
|
3685
|
+
webhookStatePageSchema: responseSchema(webhookStatePageSchema),
|
|
3419
3686
|
accessSchema: responseSchema(accessSchema),
|
|
3420
3687
|
allocatedQuestSchema: responseSchema(allocatedQuestSchema),
|
|
3421
3688
|
appSecretListSchema: responseSchema(appSecretListSchema),
|
|
@@ -3630,12 +3897,24 @@ export {
|
|
|
3630
3897
|
identityIntegrationInputSchema,
|
|
3631
3898
|
identityIntegrationSchema,
|
|
3632
3899
|
identityKindClaimSchema,
|
|
3900
|
+
identityLinkRelinkInputSchema,
|
|
3901
|
+
identityLinkSelectorSchema,
|
|
3633
3902
|
ingestTrackerScopeSchema,
|
|
3903
|
+
inventoryItemActionSchema,
|
|
3904
|
+
inventoryItemPageSchema,
|
|
3905
|
+
inventoryItemRenameSchema,
|
|
3906
|
+
inventoryItemStateSchema,
|
|
3634
3907
|
inventorySchema,
|
|
3908
|
+
inventoryStockCorrectionSchema,
|
|
3635
3909
|
isIntegrationParticipantPath,
|
|
3636
3910
|
isManagementError,
|
|
3637
3911
|
isParticipantRoute,
|
|
3638
3912
|
issuedTokenSchema,
|
|
3913
|
+
leaderboardSettlementRejectionSchema,
|
|
3914
|
+
leaderboardSettlementReviewPageSchema,
|
|
3915
|
+
leaderboardSettlementReviewQuerySchema,
|
|
3916
|
+
leaderboardSettlementReviewSchema,
|
|
3917
|
+
leaderboardSettlementReviewSummarySchema,
|
|
3639
3918
|
managedAttemptPageSchema,
|
|
3640
3919
|
managedAttemptQuerySchema,
|
|
3641
3920
|
managedAttemptSchema,
|
|
@@ -3648,15 +3927,20 @@ export {
|
|
|
3648
3927
|
managedMemberQuerySchema,
|
|
3649
3928
|
managedOAuthAccountSchema,
|
|
3650
3929
|
managedPointHistoryPageSchema,
|
|
3930
|
+
managedQuestEnrollmentPageSchema,
|
|
3931
|
+
managedQuestEnrollmentSchema,
|
|
3651
3932
|
managedResourceSchema,
|
|
3652
3933
|
managedStockItemSchema,
|
|
3653
3934
|
managedWalletSchema,
|
|
3654
3935
|
managementErrorSchema,
|
|
3655
3936
|
managementResponseSchemas,
|
|
3656
3937
|
managementResponses,
|
|
3938
|
+
managementStateQuerySchema,
|
|
3657
3939
|
memberAccountSchema,
|
|
3658
3940
|
memberDetailSchema,
|
|
3659
3941
|
memberIdentityChangeInputSchema,
|
|
3942
|
+
memberIdentityLinkPageSchema,
|
|
3943
|
+
memberIdentityLinkSchema,
|
|
3660
3944
|
memberIdentitySchema,
|
|
3661
3945
|
memberLookupSchema,
|
|
3662
3946
|
memberOAuthUnlinkInputSchema,
|
|
@@ -3664,6 +3948,7 @@ export {
|
|
|
3664
3948
|
memberWalletSignInInputSchema,
|
|
3665
3949
|
memberWalletUnlinkInputSchema,
|
|
3666
3950
|
metricsSchema,
|
|
3951
|
+
oauthIdentitySelectorSchema,
|
|
3667
3952
|
operationInputSchema,
|
|
3668
3953
|
operationSchema,
|
|
3669
3954
|
operatorUserSchema,
|
|
@@ -3689,6 +3974,8 @@ export {
|
|
|
3689
3974
|
projectUpdateInputSchema,
|
|
3690
3975
|
querySchema,
|
|
3691
3976
|
questConfiguration,
|
|
3977
|
+
questEnrollmentStateSchema,
|
|
3978
|
+
questEnrollmentWithdrawalInputSchema,
|
|
3692
3979
|
questLifecycleInputSchema,
|
|
3693
3980
|
questLifecycleSchema,
|
|
3694
3981
|
readinessSchema,
|
|
@@ -3742,14 +4029,19 @@ export {
|
|
|
3742
4029
|
verifiedPassSchema,
|
|
3743
4030
|
verifyWebhook,
|
|
3744
4031
|
walletBalanceChainsSchema,
|
|
4032
|
+
walletIdentitySelectorSchema,
|
|
3745
4033
|
webhookControlInputSchema,
|
|
4034
|
+
webhookDeleteInputSchema,
|
|
3746
4035
|
webhookDeliveryPageSchema,
|
|
3747
4036
|
webhookDeliverySchema,
|
|
3748
4037
|
webhookEndpointSchema,
|
|
4038
|
+
webhookEndpointStateSchema,
|
|
3749
4039
|
webhookEventSchema,
|
|
3750
4040
|
webhookInputSchema,
|
|
3751
4041
|
webhookQuerySchema,
|
|
3752
4042
|
webhookSecretSchema,
|
|
4043
|
+
webhookStatePageSchema,
|
|
4044
|
+
webhookStateQuerySchema,
|
|
3753
4045
|
webhookUpdateSchema,
|
|
3754
4046
|
whereSchemaIssue
|
|
3755
4047
|
};
|