@domino-sdk/relay 1.15.0 → 1.18.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/{attempt-captures-DHwIVoRP.d.ts → attempt-captures-ByzZyggX.d.ts} +5 -1
- package/dist/authoring.d.ts +119 -46
- package/dist/authoring.js +14 -9
- package/dist/{automatic-outcomes-BcEn_L46.d.ts → automatic-outcomes-BBSdMf0R.d.ts} +2 -1
- package/dist/avatar.d.ts +1 -1
- package/dist/browser.d.ts +7 -7
- package/dist/browser.js +9 -11
- package/dist/{chunk-PJXBW754.js → chunk-4VWMY4II.js} +32 -25
- package/dist/{chunk-6QJ3LADK.js → chunk-5P5PTZ3T.js} +1 -1
- package/dist/{chunk-PUY35TH3.js → chunk-BWW3XLEE.js} +2 -2
- package/dist/{chunk-W335CWYJ.js → chunk-CVQG2AZZ.js} +2 -2
- package/dist/{chunk-ZLYBUM7K.js → chunk-DQWRDRVO.js} +26 -14
- package/dist/{chunk-46C33ASD.js → chunk-EMLDFUTV.js} +1314 -908
- package/dist/{chunk-4OLQYRSA.js → chunk-GMKJPHN4.js} +1 -1
- package/dist/{chunk-CHD6HHWG.js → chunk-HQBCFU5G.js} +6 -8
- package/dist/{chunk-3PPEXDWR.js → chunk-I525XMUY.js} +1 -1
- package/dist/{chunk-LLMJ2SUT.js → chunk-IE4QOQUI.js} +21 -4
- package/dist/{chunk-ZGH6NEG6.js → chunk-JIQHUDVZ.js} +1 -1
- package/dist/{chunk-NIYCAW2I.js → chunk-NGP2NMZ4.js} +1 -1
- package/dist/{chunk-XMBM2XD5.js → chunk-T47OFHHX.js} +2 -4
- package/dist/{chunk-AXRMT33W.js → chunk-UIHPWC4C.js} +3 -0
- package/dist/{chunk-UJACD6K2.js → chunk-XSLRNFIY.js} +346 -304
- package/dist/{chunk-PT5STHFH.js → chunk-YXAK2637.js} +1 -1
- package/dist/{client-DFSCmf3H.d.ts → client-93pUw04R.d.ts} +182 -14
- package/dist/{deployments-Ci6GyANg.d.ts → deployments-D0mrWCsp.d.ts} +931 -115
- package/dist/{groups-Bi7lc54m.d.ts → groups-jLLG7MML.d.ts} +27 -2
- package/dist/{images-Cb8QHGjn.d.ts → images-BPiPqVKn.d.ts} +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.js +12 -16
- package/dist/internal.d.ts +10 -10
- package/dist/internal.js +9 -10
- package/dist/{offers-Catj06u7.d.ts → offers-CPqiF3dZ.d.ts} +92 -3
- package/dist/{pages-CpYt56Km.d.ts → pages-1h1387a3.d.ts} +757 -3
- package/dist/portal-proxy.js +4 -4
- package/dist/react/index.d.ts +47 -19
- package/dist/react/index.js +361 -340
- package/dist/{schema-BaVl2VBS.d.ts → schema-Br3c1GOu.d.ts} +508 -2
- package/dist/schema.d.ts +866 -325
- package/dist/schema.js +61 -32
- package/dist/server/index.d.ts +10 -10
- package/dist/server/index.js +799 -541
- package/dist/{sign-in-options-CU1ND6-y.d.ts → sign-in-options--25uHySG.d.ts} +1 -1
- package/dist/{submission-input-Bi4HipqI.d.ts → submission-input-BEJ9qENg.d.ts} +2 -2
- package/dist/testing.d.ts +3 -3
- package/dist/testing.js +10 -13
- package/dist/{transport-0ttRwUat.d.ts → transport-C2cK-6wO.d.ts} +8598 -2008
- package/package.json +2 -1
- package/dist/chunk-2UAVZCMH.js +0 -314
- package/dist/chunk-NPGENI7K.js +0 -37
- package/dist/{profiles-BHMVj0kM.d.ts → profiles-D29SS12z.d.ts} +1 -1
package/dist/server/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
attemptCaptureSchema,
|
|
3
3
|
capturedFactSchema
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-NGP2NMZ4.js";
|
|
5
5
|
import {
|
|
6
6
|
activityTypeSchema,
|
|
7
7
|
activityTypes,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
publishDeploymentSchema,
|
|
26
26
|
rejectDeploymentSchema,
|
|
27
27
|
submitDeploymentSchema
|
|
28
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-DQWRDRVO.js";
|
|
29
29
|
import "../chunk-MC6V6VMG.js";
|
|
30
30
|
import {
|
|
31
31
|
DEFAULT_MANAGEMENT_TIMEOUT,
|
|
@@ -44,28 +44,28 @@ import {
|
|
|
44
44
|
participantExchangeSchema,
|
|
45
45
|
questConfiguration,
|
|
46
46
|
sequenceCursorSchema
|
|
47
|
-
} from "../chunk-
|
|
47
|
+
} from "../chunk-HQBCFU5G.js";
|
|
48
48
|
import {
|
|
49
49
|
parseImageExtraction,
|
|
50
50
|
parseImageResult
|
|
51
|
-
} from "../chunk-
|
|
51
|
+
} from "../chunk-CVQG2AZZ.js";
|
|
52
52
|
import {
|
|
53
53
|
imageAssetArtifactSchema
|
|
54
|
-
} from "../chunk-
|
|
54
|
+
} from "../chunk-JIQHUDVZ.js";
|
|
55
55
|
import {
|
|
56
56
|
sourceDataSchema,
|
|
57
57
|
sourceRoles,
|
|
58
58
|
validateQuestShape
|
|
59
|
-
} from "../chunk-
|
|
59
|
+
} from "../chunk-GMKJPHN4.js";
|
|
60
60
|
import {
|
|
61
61
|
isIntegrationParticipantPath,
|
|
62
62
|
isParticipantRoute,
|
|
63
63
|
participantRoutePattern,
|
|
64
64
|
participantRoutes
|
|
65
|
-
} from "../chunk-
|
|
65
|
+
} from "../chunk-UIHPWC4C.js";
|
|
66
66
|
import {
|
|
67
67
|
withActionId
|
|
68
|
-
} from "../chunk-
|
|
68
|
+
} from "../chunk-T47OFHHX.js";
|
|
69
69
|
import {
|
|
70
70
|
allocateQuestSchema,
|
|
71
71
|
allocatedQuestSchema,
|
|
@@ -83,8 +83,12 @@ import {
|
|
|
83
83
|
rewardDeliveriesSchema,
|
|
84
84
|
rewardDeliverySchema,
|
|
85
85
|
saveQuestDraftSchema
|
|
86
|
-
} from "../chunk-
|
|
86
|
+
} from "../chunk-IE4QOQUI.js";
|
|
87
87
|
import {
|
|
88
|
+
badgeMutationResultSchema,
|
|
89
|
+
badgeMutationSchema,
|
|
90
|
+
badgePropertiesSchema,
|
|
91
|
+
createBadgeSchema,
|
|
88
92
|
createPointLedgerSchema,
|
|
89
93
|
engagementBoundaryPageSchema,
|
|
90
94
|
engagementChangePreviewInputSchema,
|
|
@@ -104,9 +108,11 @@ import {
|
|
|
104
108
|
leaderboardSettlementApprovalSchema,
|
|
105
109
|
leaderboardSettlementSchema,
|
|
106
110
|
leaderboardSettlementSummarySchema,
|
|
111
|
+
managedBadgeSchema,
|
|
107
112
|
managedPointHistoryPageSchema,
|
|
108
113
|
managedPointLedgerSchema,
|
|
109
114
|
managedProfileSchema,
|
|
115
|
+
memberBadgesSchema,
|
|
110
116
|
offerControlSchema,
|
|
111
117
|
offerSchema,
|
|
112
118
|
pointLedgerPropertiesSchema,
|
|
@@ -127,20 +133,10 @@ import {
|
|
|
127
133
|
referralQualificationSchema,
|
|
128
134
|
referralRewardResolutionSchema,
|
|
129
135
|
referralSuspensionSchema
|
|
130
|
-
} from "../chunk-
|
|
131
|
-
import
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
linkedWalletSchema,
|
|
135
|
-
solanaMainnet,
|
|
136
|
-
walletBalanceSchema,
|
|
137
|
-
walletSignInNetworksSchema,
|
|
138
|
-
walletUnlinkInputSchema
|
|
139
|
-
} from "../chunk-2UAVZCMH.js";
|
|
140
|
-
import "../chunk-6QJ3LADK.js";
|
|
141
|
-
import "../chunk-NPGENI7K.js";
|
|
142
|
-
import "../chunk-3PPEXDWR.js";
|
|
143
|
-
import "../chunk-PT5STHFH.js";
|
|
136
|
+
} from "../chunk-XSLRNFIY.js";
|
|
137
|
+
import "../chunk-5P5PTZ3T.js";
|
|
138
|
+
import "../chunk-I525XMUY.js";
|
|
139
|
+
import "../chunk-YXAK2637.js";
|
|
144
140
|
import {
|
|
145
141
|
CompletionSourceKind,
|
|
146
142
|
addGroupMemberSchema,
|
|
@@ -156,6 +152,7 @@ import {
|
|
|
156
152
|
contentPerformanceQuerySchema,
|
|
157
153
|
contentQualificationPageSchema,
|
|
158
154
|
contentQualificationQuerySchema,
|
|
155
|
+
cosmosNetworkSchema,
|
|
159
156
|
counterHistoryQuerySchema,
|
|
160
157
|
counterHistorySchema,
|
|
161
158
|
counterModerationResultSchema,
|
|
@@ -165,6 +162,7 @@ import {
|
|
|
165
162
|
entitlementCorrectionSchema,
|
|
166
163
|
entitlementSchema,
|
|
167
164
|
eventSchema,
|
|
165
|
+
evmChainIdSchema,
|
|
168
166
|
groupMemberPageSchema,
|
|
169
167
|
groupMemberSchema,
|
|
170
168
|
groupPageQuerySchema,
|
|
@@ -172,6 +170,7 @@ import {
|
|
|
172
170
|
identifier,
|
|
173
171
|
knownResponse,
|
|
174
172
|
lazyResponseReaders,
|
|
173
|
+
linkedWalletSchema,
|
|
175
174
|
managedGroupSchema,
|
|
176
175
|
managementStateQuerySchema,
|
|
177
176
|
memberCampaignEnrollmentInputSchema,
|
|
@@ -190,6 +189,7 @@ import {
|
|
|
190
189
|
removeGroupMemberSchema,
|
|
191
190
|
responseSchema,
|
|
192
191
|
snapshotSchema,
|
|
192
|
+
solanaMainnet,
|
|
193
193
|
staffDecisionSchema,
|
|
194
194
|
stockItemSchema,
|
|
195
195
|
submitSchema,
|
|
@@ -213,8 +213,11 @@ import {
|
|
|
213
213
|
trackerTriggerOutcomePageSchema,
|
|
214
214
|
trackerTriggerOutcomeQuerySchema,
|
|
215
215
|
updateGroupSchema,
|
|
216
|
+
walletBalanceSchema,
|
|
217
|
+
walletSignInNetworksSchema,
|
|
218
|
+
walletUnlinkInputSchema,
|
|
216
219
|
whereSchemaIssue
|
|
217
|
-
} from "../chunk-
|
|
220
|
+
} from "../chunk-EMLDFUTV.js";
|
|
218
221
|
|
|
219
222
|
// src/server/identity-links.ts
|
|
220
223
|
import { z } from "zod";
|
|
@@ -557,13 +560,177 @@ var resourceArchiveInputSchema = resourceLifecycleInputSchema.omit({
|
|
|
557
560
|
});
|
|
558
561
|
|
|
559
562
|
// src/server/index.ts
|
|
560
|
-
import { z as
|
|
563
|
+
import { z as z13 } from "zod";
|
|
561
564
|
|
|
562
565
|
// src/server/hosting.ts
|
|
563
|
-
import { z as
|
|
566
|
+
import { z as z10 } from "zod";
|
|
564
567
|
|
|
565
|
-
// src/server/
|
|
568
|
+
// src/server/schedules.ts
|
|
566
569
|
import { z as z8 } from "zod";
|
|
570
|
+
import { Cron } from "croner";
|
|
571
|
+
var APP_SCHEDULE_LIMIT = 10;
|
|
572
|
+
var APP_SCHEDULE_MIN_INTERVAL = 3e5;
|
|
573
|
+
var APP_SCHEDULE_TIMEOUT = 3e4;
|
|
574
|
+
var appScheduleNameSchema = z8.string().regex(/^[a-z][a-z0-9-]{0,63}$/);
|
|
575
|
+
var appSchedulePathSchema = z8.string().min(2).max(512).refine((path) => {
|
|
576
|
+
if (!/^\/[a-zA-Z0-9_/-]+$/.test(path) || path.startsWith("//")) {
|
|
577
|
+
return false;
|
|
578
|
+
}
|
|
579
|
+
return path.split("/").slice(1).every((part) => part.length > 0) && new URL(path, "https://app.invalid").pathname === path;
|
|
580
|
+
}, "Expected an absolute route path without a query or hidden segments");
|
|
581
|
+
function interval(value) {
|
|
582
|
+
const amount = Number(value.slice(0, -1));
|
|
583
|
+
const unit = value.slice(-1);
|
|
584
|
+
return amount * (unit === "m" ? 6e4 : unit === "h" ? 36e5 : 864e5);
|
|
585
|
+
}
|
|
586
|
+
var everySchema = z8.string().regex(/^[1-9]\d{0,3}[mhd]$/).refine(
|
|
587
|
+
(value) => interval(value) >= APP_SCHEDULE_MIN_INTERVAL && interval(value) <= 365 * 864e5,
|
|
588
|
+
"Use an interval from 5 minutes to 365 days, such as 5m, 1h or 1d"
|
|
589
|
+
);
|
|
590
|
+
var cronSchema = z8.string().max(120).refine((value) => {
|
|
591
|
+
const fields = value.trim().split(/\s+/);
|
|
592
|
+
if (fields.length !== 5 || fields.some((field) => !/^[\d*,/-]+$/.test(field))) {
|
|
593
|
+
return false;
|
|
594
|
+
}
|
|
595
|
+
try {
|
|
596
|
+
const job = new Cron(value, { paused: true, timezone: "UTC" });
|
|
597
|
+
if (!job.nextRun()) {
|
|
598
|
+
return false;
|
|
599
|
+
}
|
|
600
|
+
const minutes = new Cron(`${fields[0]} * * * *`, {
|
|
601
|
+
paused: true,
|
|
602
|
+
timezone: "UTC"
|
|
603
|
+
});
|
|
604
|
+
const times = minutes.nextRuns(13, /* @__PURE__ */ new Date("2024-01-01T00:00:00Z"));
|
|
605
|
+
return times.every(
|
|
606
|
+
(time, i) => i === 0 || time.getTime() - times[i - 1].getTime() >= APP_SCHEDULE_MIN_INTERVAL
|
|
607
|
+
);
|
|
608
|
+
} catch {
|
|
609
|
+
return false;
|
|
610
|
+
}
|
|
611
|
+
}, "Expected a five-field UTC cron expression with minute slots at least five minutes apart");
|
|
612
|
+
var declaration = {
|
|
613
|
+
name: appScheduleNameSchema,
|
|
614
|
+
path: appSchedulePathSchema,
|
|
615
|
+
description: z8.string().min(1).max(500)
|
|
616
|
+
};
|
|
617
|
+
var everySchedule = z8.object({ ...declaration, every: everySchema });
|
|
618
|
+
var cronSchedule = z8.object({ ...declaration, cron: cronSchema });
|
|
619
|
+
var appScheduleSchema = z8.union([
|
|
620
|
+
everySchedule.strict(),
|
|
621
|
+
cronSchedule.strict()
|
|
622
|
+
]);
|
|
623
|
+
var appSchedulesSchema = z8.array(appScheduleSchema).max(APP_SCHEDULE_LIMIT).refine(
|
|
624
|
+
(items) => new Set(items.map((item) => item.name)).size === items.length,
|
|
625
|
+
"Schedule names must be unique"
|
|
626
|
+
);
|
|
627
|
+
function nextScheduleRun(schedule, after) {
|
|
628
|
+
if ("every" in schedule) {
|
|
629
|
+
return after + interval(schedule.every);
|
|
630
|
+
}
|
|
631
|
+
const next = new Cron(schedule.cron, {
|
|
632
|
+
paused: true,
|
|
633
|
+
timezone: "UTC"
|
|
634
|
+
}).nextRun(new Date(after));
|
|
635
|
+
if (!next) {
|
|
636
|
+
throw new Error("Schedule has no next occurrence");
|
|
637
|
+
}
|
|
638
|
+
return next.getTime();
|
|
639
|
+
}
|
|
640
|
+
var appScheduleStateSchema = z8.enum(["active", "paused", "archived"]);
|
|
641
|
+
var appScheduleRunSchema = z8.object({
|
|
642
|
+
id: z8.string().uuid(),
|
|
643
|
+
build: z8.string().uuid(),
|
|
644
|
+
startedAt: z8.number(),
|
|
645
|
+
scheduledAt: z8.number(),
|
|
646
|
+
manual: z8.boolean(),
|
|
647
|
+
status: z8.enum(["queued", "running", "succeeded", "failed", "uncertain"]),
|
|
648
|
+
duration: z8.number().nullable(),
|
|
649
|
+
error: z8.string().nullable()
|
|
650
|
+
});
|
|
651
|
+
var appScheduleListSchema = z8.object({
|
|
652
|
+
state: appScheduleStateSchema,
|
|
653
|
+
schedules: z8.array(
|
|
654
|
+
z8.object({
|
|
655
|
+
declaration: z8.union([everySchedule, cronSchedule]),
|
|
656
|
+
nextRun: z8.number().nullable(),
|
|
657
|
+
blocked: z8.boolean(),
|
|
658
|
+
lastRun: appScheduleRunSchema.nullable()
|
|
659
|
+
})
|
|
660
|
+
)
|
|
661
|
+
});
|
|
662
|
+
var scheduledInvocationSchema = z8.object({
|
|
663
|
+
id: z8.string().uuid(),
|
|
664
|
+
build: z8.string().uuid(),
|
|
665
|
+
name: appScheduleNameSchema,
|
|
666
|
+
scheduledAt: z8.number().int(),
|
|
667
|
+
startedAt: z8.number().int(),
|
|
668
|
+
manual: z8.boolean()
|
|
669
|
+
}).strict();
|
|
670
|
+
async function verifyScheduledRequest(request, key) {
|
|
671
|
+
const signature = request.headers.get("X-Domino-Schedule-Signature");
|
|
672
|
+
const url = new URL(request.url);
|
|
673
|
+
if (request.method !== "POST" || url.search !== "" || url.hash !== "" || !key || !signature || !/^[a-f0-9]{64}$/.test(signature)) {
|
|
674
|
+
return null;
|
|
675
|
+
}
|
|
676
|
+
const reader = request.clone().body?.getReader();
|
|
677
|
+
if (!reader) {
|
|
678
|
+
return null;
|
|
679
|
+
}
|
|
680
|
+
let body = "";
|
|
681
|
+
let size = 0;
|
|
682
|
+
const decoder = new TextDecoder();
|
|
683
|
+
try {
|
|
684
|
+
for (; ; ) {
|
|
685
|
+
const chunk = await reader.read();
|
|
686
|
+
if (chunk.done) {
|
|
687
|
+
break;
|
|
688
|
+
}
|
|
689
|
+
size += chunk.value.byteLength;
|
|
690
|
+
if (size > 4096) {
|
|
691
|
+
void reader.cancel().catch(() => {
|
|
692
|
+
});
|
|
693
|
+
return null;
|
|
694
|
+
}
|
|
695
|
+
body += decoder.decode(chunk.value, { stream: true });
|
|
696
|
+
}
|
|
697
|
+
body += decoder.decode();
|
|
698
|
+
} catch {
|
|
699
|
+
return null;
|
|
700
|
+
}
|
|
701
|
+
const secret = await crypto.subtle.importKey(
|
|
702
|
+
"raw",
|
|
703
|
+
new TextEncoder().encode(key),
|
|
704
|
+
{ name: "HMAC", hash: "SHA-256" },
|
|
705
|
+
false,
|
|
706
|
+
["verify"]
|
|
707
|
+
);
|
|
708
|
+
const bytes = Uint8Array.from(
|
|
709
|
+
signature.match(/../g) ?? [],
|
|
710
|
+
(byte) => Number.parseInt(byte, 16)
|
|
711
|
+
);
|
|
712
|
+
const valid = await crypto.subtle.verify(
|
|
713
|
+
"HMAC",
|
|
714
|
+
secret,
|
|
715
|
+
bytes,
|
|
716
|
+
new TextEncoder().encode(`POST
|
|
717
|
+
${url.pathname}
|
|
718
|
+
${body}`)
|
|
719
|
+
);
|
|
720
|
+
if (!valid) {
|
|
721
|
+
return null;
|
|
722
|
+
}
|
|
723
|
+
const parsed = scheduledInvocationSchema.safeParse(
|
|
724
|
+
await new Response(body).json().catch(() => null)
|
|
725
|
+
);
|
|
726
|
+
if (!parsed.success || Math.abs(Date.now() - parsed.data.startedAt) > 6e4) {
|
|
727
|
+
return null;
|
|
728
|
+
}
|
|
729
|
+
return parsed.data;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
// src/server/starters.ts
|
|
733
|
+
import { z as z9 } from "zod";
|
|
567
734
|
var starterTemplates = [
|
|
568
735
|
{
|
|
569
736
|
id: "campaign",
|
|
@@ -596,63 +763,63 @@ var starterTemplates = [
|
|
|
596
763
|
summary: "A headless Worker with typed routes and interactive API docs, for plugging Domino into your own product."
|
|
597
764
|
}
|
|
598
765
|
];
|
|
599
|
-
var starterIdSchema =
|
|
766
|
+
var starterIdSchema = z9.enum(
|
|
600
767
|
starterTemplates.map((template) => template.id)
|
|
601
768
|
);
|
|
602
769
|
|
|
603
770
|
// src/server/hosting.ts
|
|
604
|
-
var outputPathSchema =
|
|
771
|
+
var outputPathSchema = z10.string().min(1).max(512).refine(
|
|
605
772
|
(path) => path.split("/").every(
|
|
606
773
|
(part) => /^[\w-][\w.-]*$/.test(part) && part !== "node_modules"
|
|
607
774
|
),
|
|
608
775
|
"Expected a relative build output path without hidden segments"
|
|
609
776
|
);
|
|
610
|
-
var appRoutingSchema =
|
|
777
|
+
var appRoutingSchema = z10.enum(["legacy", "transparent"]).default("legacy");
|
|
611
778
|
var APP_SECRET_LIMIT = 50;
|
|
612
779
|
var APP_KV_LIMIT = 5;
|
|
613
780
|
var APP_SQL_LIMIT = 5;
|
|
614
781
|
var APP_MIGRATION_LIMIT = 100;
|
|
615
782
|
var APP_MIGRATION_FILE_BYTES = 9e4;
|
|
616
783
|
var APP_MIGRATION_TOTAL_BYTES = 1e6;
|
|
617
|
-
var appSecretNameSchema =
|
|
784
|
+
var appSecretNameSchema = z10.string().regex(
|
|
618
785
|
/^[A-Z_][A-Z0-9_]{0,63}$/,
|
|
619
786
|
"Use 1-64 uppercase letters, digits, and underscores, not starting with a digit"
|
|
620
787
|
).refine(
|
|
621
788
|
(name) => !name.startsWith("DOMINO_") && name !== "ASSETS",
|
|
622
789
|
"DOMINO_ names and ASSETS are reserved for Domino's own bindings"
|
|
623
790
|
);
|
|
624
|
-
var appSecretValueSchema =
|
|
791
|
+
var appSecretValueSchema = z10.string().min(1).refine(
|
|
625
792
|
(value) => new TextEncoder().encode(value).length <= 5120,
|
|
626
793
|
"Secret values can be at most 5 KiB"
|
|
627
794
|
);
|
|
628
|
-
var appSecretInputSchema =
|
|
629
|
-
var appSecretSchema =
|
|
795
|
+
var appSecretInputSchema = z10.object({ value: appSecretValueSchema }).strict();
|
|
796
|
+
var appSecretSchema = z10.object({
|
|
630
797
|
name: appSecretNameSchema,
|
|
631
|
-
updatedAt:
|
|
632
|
-
updatedBy:
|
|
798
|
+
updatedAt: z10.number(),
|
|
799
|
+
updatedBy: z10.string()
|
|
633
800
|
});
|
|
634
|
-
var appSecretDeclarationSchema =
|
|
635
|
-
description:
|
|
636
|
-
required:
|
|
801
|
+
var appSecretDeclarationSchema = z10.object({
|
|
802
|
+
description: z10.string().trim().min(1).max(500),
|
|
803
|
+
required: z10.boolean().default(true)
|
|
637
804
|
}).strict();
|
|
638
|
-
var appSecretDeclarationsSchema =
|
|
805
|
+
var appSecretDeclarationsSchema = z10.record(appSecretNameSchema, appSecretDeclarationSchema).refine(
|
|
639
806
|
(secrets) => Object.keys(secrets).length <= APP_SECRET_LIMIT,
|
|
640
807
|
`Declare at most ${APP_SECRET_LIMIT} app secrets`
|
|
641
808
|
);
|
|
642
|
-
var appSecretListSchema =
|
|
643
|
-
secrets:
|
|
644
|
-
declared:
|
|
809
|
+
var appSecretListSchema = z10.object({
|
|
810
|
+
secrets: z10.array(appSecretSchema),
|
|
811
|
+
declared: z10.array(appSecretDeclarationSchema.extend({ name: appSecretNameSchema })).default([])
|
|
645
812
|
});
|
|
646
|
-
var hostedAppSecretsSchema =
|
|
647
|
-
var storageDescription =
|
|
648
|
-
description:
|
|
813
|
+
var hostedAppSecretsSchema = z10.object({ secrets: z10.record(appSecretNameSchema, appSecretValueSchema) }).strict();
|
|
814
|
+
var storageDescription = z10.object({
|
|
815
|
+
description: z10.string().trim().min(1).max(500)
|
|
649
816
|
}).strict();
|
|
650
|
-
var appStorageSchema =
|
|
651
|
-
kv:
|
|
817
|
+
var appStorageSchema = z10.object({
|
|
818
|
+
kv: z10.record(appSecretNameSchema, storageDescription).refine(
|
|
652
819
|
(stores) => Object.keys(stores).length <= APP_KV_LIMIT,
|
|
653
820
|
`Declare at most ${APP_KV_LIMIT} KV stores`
|
|
654
821
|
).default({}),
|
|
655
|
-
sql:
|
|
822
|
+
sql: z10.record(
|
|
656
823
|
appSecretNameSchema,
|
|
657
824
|
storageDescription.extend({
|
|
658
825
|
migrations: outputPathSchema.optional()
|
|
@@ -662,60 +829,60 @@ var appStorageSchema = z9.object({
|
|
|
662
829
|
`Declare at most ${APP_SQL_LIMIT} SQL stores`
|
|
663
830
|
).default({})
|
|
664
831
|
}).strict();
|
|
665
|
-
var appStorageKindSchema =
|
|
666
|
-
var appStorageListSchema =
|
|
667
|
-
stores:
|
|
668
|
-
|
|
669
|
-
kind:
|
|
832
|
+
var appStorageKindSchema = z10.enum(["kv", "sql"]);
|
|
833
|
+
var appStorageListSchema = z10.object({
|
|
834
|
+
stores: z10.array(
|
|
835
|
+
z10.object({
|
|
836
|
+
kind: z10.string(),
|
|
670
837
|
name: appSecretNameSchema,
|
|
671
|
-
createdAt:
|
|
672
|
-
declared:
|
|
673
|
-
description:
|
|
838
|
+
createdAt: z10.number().nullable(),
|
|
839
|
+
declared: z10.boolean(),
|
|
840
|
+
description: z10.string().optional()
|
|
674
841
|
})
|
|
675
842
|
)
|
|
676
843
|
});
|
|
677
844
|
var APP_STORAGE_ROW_LIMIT = 50;
|
|
678
845
|
var APP_STORAGE_PREVIEW_CHARACTERS = 2e3;
|
|
679
|
-
var appStorageCellSchema =
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
846
|
+
var appStorageCellSchema = z10.union([
|
|
847
|
+
z10.string(),
|
|
848
|
+
z10.number(),
|
|
849
|
+
z10.null(),
|
|
850
|
+
z10.object({ text: z10.string(), truncated: z10.literal(true) }),
|
|
851
|
+
z10.object({ blob: z10.number().int().min(0) })
|
|
685
852
|
]);
|
|
686
|
-
var appStorageTablesSchema =
|
|
687
|
-
tables:
|
|
853
|
+
var appStorageTablesSchema = z10.object({
|
|
854
|
+
tables: z10.array(
|
|
688
855
|
/** `kind` is SQLite's: `table` or `view`. */
|
|
689
|
-
|
|
856
|
+
z10.object({ name: z10.string(), kind: z10.string() })
|
|
690
857
|
)
|
|
691
858
|
});
|
|
692
|
-
var appStorageRowsSchema =
|
|
693
|
-
table:
|
|
694
|
-
columns:
|
|
695
|
-
rows:
|
|
859
|
+
var appStorageRowsSchema = z10.object({
|
|
860
|
+
table: z10.string(),
|
|
861
|
+
columns: z10.array(z10.string()),
|
|
862
|
+
rows: z10.array(z10.array(appStorageCellSchema)),
|
|
696
863
|
/** How many rows come before this page in storage order. */
|
|
697
|
-
offset:
|
|
698
|
-
total:
|
|
864
|
+
offset: z10.number().int().min(0),
|
|
865
|
+
total: z10.number().int().min(0),
|
|
699
866
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
700
867
|
nextCursor: pageCursorSchema.nullable().default(null)
|
|
701
868
|
});
|
|
702
|
-
var appStorageKeysSchema =
|
|
703
|
-
keys:
|
|
704
|
-
|
|
869
|
+
var appStorageKeysSchema = z10.object({
|
|
870
|
+
keys: z10.array(
|
|
871
|
+
z10.object({ name: z10.string(), expiration: z10.number().nullable() })
|
|
705
872
|
),
|
|
706
873
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
707
874
|
nextCursor: pageCursorSchema.nullable().default(null),
|
|
708
875
|
/** @deprecated Use `nextCursor`. Removed in 2.0.0. */
|
|
709
|
-
cursor:
|
|
876
|
+
cursor: z10.string().nullable()
|
|
710
877
|
});
|
|
711
|
-
var appStorageValueSchema =
|
|
712
|
-
key:
|
|
713
|
-
size:
|
|
878
|
+
var appStorageValueSchema = z10.object({
|
|
879
|
+
key: z10.string(),
|
|
880
|
+
size: z10.number().int().min(0),
|
|
714
881
|
/** Null when the value is not UTF-8 text. */
|
|
715
|
-
text:
|
|
716
|
-
truncated:
|
|
882
|
+
text: z10.string().nullable(),
|
|
883
|
+
truncated: z10.boolean()
|
|
717
884
|
});
|
|
718
|
-
var appMigrationNameSchema =
|
|
885
|
+
var appMigrationNameSchema = z10.string().max(255).regex(/^[\w-][\w.-]*\.sql$/);
|
|
719
886
|
function compareAppMigrations(a, b) {
|
|
720
887
|
const left = Number.parseInt(a.split("_")[0], 10);
|
|
721
888
|
const right = Number.parseInt(b.split("_")[0], 10);
|
|
@@ -732,12 +899,12 @@ function compareAppMigrations(a, b) {
|
|
|
732
899
|
}
|
|
733
900
|
return a < b ? -1 : a > b ? 1 : 0;
|
|
734
901
|
}
|
|
735
|
-
var appMigrationsSchema =
|
|
902
|
+
var appMigrationsSchema = z10.record(
|
|
736
903
|
appSecretNameSchema,
|
|
737
|
-
|
|
738
|
-
|
|
904
|
+
z10.array(
|
|
905
|
+
z10.object({
|
|
739
906
|
name: appMigrationNameSchema,
|
|
740
|
-
sql:
|
|
907
|
+
sql: z10.string().min(1).refine(
|
|
741
908
|
(sql) => new TextEncoder().encode(sql).length <= APP_MIGRATION_FILE_BYTES,
|
|
742
909
|
`A migration file must not exceed ${APP_MIGRATION_FILE_BYTES} bytes`
|
|
743
910
|
)
|
|
@@ -755,24 +922,25 @@ var appMigrationsSchema = z9.record(
|
|
|
755
922
|
);
|
|
756
923
|
var appScripts = {
|
|
757
924
|
routing: appRoutingSchema,
|
|
758
|
-
devScript:
|
|
759
|
-
checkScript:
|
|
760
|
-
buildScript:
|
|
925
|
+
devScript: z10.string().regex(/^[\w:-]+$/),
|
|
926
|
+
checkScript: z10.string().regex(/^[\w:-]+$/),
|
|
927
|
+
buildScript: z10.string().regex(/^[\w:-]+$/)
|
|
761
928
|
};
|
|
762
929
|
var workerSettings = {
|
|
763
|
-
runWorkerFirst:
|
|
930
|
+
runWorkerFirst: z10.boolean().default(false),
|
|
764
931
|
main: outputPathSchema.refine(
|
|
765
932
|
(path) => /\.m?js$/.test(path),
|
|
766
933
|
"Expected a compiled JavaScript entry"
|
|
767
934
|
),
|
|
768
|
-
compatibilityDate:
|
|
769
|
-
compatibilityFlags:
|
|
770
|
-
vars:
|
|
771
|
-
|
|
772
|
-
|
|
935
|
+
compatibilityDate: z10.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
936
|
+
compatibilityFlags: z10.array(z10.string().min(1)).max(50).default([]),
|
|
937
|
+
vars: z10.record(
|
|
938
|
+
z10.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).refine((name) => name !== "ASSETS"),
|
|
939
|
+
z10.string()
|
|
773
940
|
).default({}),
|
|
774
941
|
secrets: appSecretDeclarationsSchema.default({}),
|
|
775
|
-
storage: appStorageSchema.optional()
|
|
942
|
+
storage: appStorageSchema.optional(),
|
|
943
|
+
schedules: appSchedulesSchema.optional()
|
|
776
944
|
};
|
|
777
945
|
var distinctBindings = (worker, ctx) => {
|
|
778
946
|
const owners = /* @__PURE__ */ new Map();
|
|
@@ -797,62 +965,62 @@ var distinctBindings = (worker, ctx) => {
|
|
|
797
965
|
}
|
|
798
966
|
}
|
|
799
967
|
};
|
|
800
|
-
var hostedAppSchema =
|
|
801
|
-
|
|
802
|
-
kind:
|
|
968
|
+
var hostedAppSchema = z10.discriminatedUnion("kind", [
|
|
969
|
+
z10.object({
|
|
970
|
+
kind: z10.literal("static"),
|
|
803
971
|
directory: outputPathSchema,
|
|
804
972
|
...appScripts
|
|
805
973
|
}).strict(),
|
|
806
|
-
|
|
807
|
-
kind:
|
|
974
|
+
z10.object({
|
|
975
|
+
kind: z10.literal("worker"),
|
|
808
976
|
directory: outputPathSchema,
|
|
809
977
|
assetsDirectory: outputPathSchema.optional(),
|
|
810
978
|
...appScripts,
|
|
811
979
|
...workerSettings
|
|
812
980
|
}).strict().superRefine(distinctBindings)
|
|
813
981
|
]);
|
|
814
|
-
var repositorySchema =
|
|
815
|
-
id:
|
|
982
|
+
var repositorySchema = z10.object({
|
|
983
|
+
id: z10.string().uuid(),
|
|
816
984
|
organization: identifier,
|
|
817
985
|
project: identifier,
|
|
818
|
-
remote:
|
|
819
|
-
defaultBranch:
|
|
820
|
-
status:
|
|
986
|
+
remote: z10.string().url(),
|
|
987
|
+
defaultBranch: z10.string(),
|
|
988
|
+
status: z10.enum(["provisioning", "ready"])
|
|
821
989
|
});
|
|
822
|
-
var createRepositorySchema =
|
|
990
|
+
var createRepositorySchema = z10.object({
|
|
823
991
|
/** Omitted: the starter chosen at project setup, else `campaign`. */
|
|
824
992
|
starter: starterIdSchema.optional()
|
|
825
993
|
}).strict();
|
|
826
|
-
var deviceStartSchema =
|
|
827
|
-
challenge:
|
|
994
|
+
var deviceStartSchema = z10.object({
|
|
995
|
+
challenge: z10.string().regex(/^[a-f0-9]{64}$/)
|
|
828
996
|
}).strict();
|
|
829
|
-
var deviceRedeemSchema =
|
|
830
|
-
id:
|
|
831
|
-
verifier:
|
|
997
|
+
var deviceRedeemSchema = z10.object({
|
|
998
|
+
id: z10.string().uuid(),
|
|
999
|
+
verifier: z10.string().min(43).max(128)
|
|
832
1000
|
}).strict();
|
|
833
|
-
var deviceApproveSchema =
|
|
834
|
-
id:
|
|
835
|
-
code:
|
|
1001
|
+
var deviceApproveSchema = z10.object({
|
|
1002
|
+
id: z10.string().uuid(),
|
|
1003
|
+
code: z10.string().regex(/^[A-F0-9]{4}-[A-F0-9]{4}$/)
|
|
836
1004
|
}).strict();
|
|
837
|
-
var commitSchema =
|
|
838
|
-
var stageRequestSchema =
|
|
1005
|
+
var commitSchema = z10.string().regex(/^[a-f0-9]{40}$/);
|
|
1006
|
+
var stageRequestSchema = z10.object({
|
|
839
1007
|
commit: commitSchema,
|
|
840
|
-
requestId:
|
|
1008
|
+
requestId: z10.string().uuid()
|
|
841
1009
|
}).strict();
|
|
842
|
-
var buildIdentitySchema =
|
|
1010
|
+
var buildIdentitySchema = z10.object({
|
|
843
1011
|
routing: appRoutingSchema,
|
|
844
|
-
slug:
|
|
845
|
-
runtime:
|
|
846
|
-
id:
|
|
847
|
-
repository:
|
|
1012
|
+
slug: z10.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional(),
|
|
1013
|
+
runtime: z10.enum(["simulation", "hosted-test"]).default("simulation"),
|
|
1014
|
+
id: z10.string().uuid(),
|
|
1015
|
+
repository: z10.string().uuid(),
|
|
848
1016
|
organization: identifier,
|
|
849
1017
|
project: identifier,
|
|
850
1018
|
commit: commitSchema,
|
|
851
|
-
createdAt:
|
|
852
|
-
actor:
|
|
853
|
-
commitMessage:
|
|
1019
|
+
createdAt: z10.number(),
|
|
1020
|
+
actor: z10.string(),
|
|
1021
|
+
commitMessage: z10.string().max(500).optional()
|
|
854
1022
|
});
|
|
855
|
-
var buildPhaseSchema =
|
|
1023
|
+
var buildPhaseSchema = z10.enum([
|
|
856
1024
|
"queued",
|
|
857
1025
|
"source",
|
|
858
1026
|
"install",
|
|
@@ -862,72 +1030,72 @@ var buildPhaseSchema = z9.enum([
|
|
|
862
1030
|
"ready",
|
|
863
1031
|
"failed"
|
|
864
1032
|
]);
|
|
865
|
-
var buildStatusSchema =
|
|
1033
|
+
var buildStatusSchema = z10.object({
|
|
866
1034
|
phase: buildPhaseSchema,
|
|
867
1035
|
failedPhase: buildPhaseSchema.optional(),
|
|
868
|
-
updatedAt:
|
|
869
|
-
message:
|
|
1036
|
+
updatedAt: z10.number(),
|
|
1037
|
+
message: z10.string()
|
|
870
1038
|
});
|
|
871
1039
|
var hostedBuildSchema = buildIdentitySchema.extend({
|
|
872
1040
|
...buildStatusSchema.shape,
|
|
873
|
-
finished:
|
|
874
|
-
current:
|
|
875
|
-
stagingUrl:
|
|
876
|
-
});
|
|
877
|
-
var stagingAccessModeSchema =
|
|
878
|
-
var stagingAccessSchema =
|
|
879
|
-
var stagingAccessInputSchema =
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
mode:
|
|
883
|
-
password:
|
|
1041
|
+
finished: z10.boolean(),
|
|
1042
|
+
current: z10.boolean(),
|
|
1043
|
+
stagingUrl: z10.string().url()
|
|
1044
|
+
});
|
|
1045
|
+
var stagingAccessModeSchema = z10.enum(["console", "password"]);
|
|
1046
|
+
var stagingAccessSchema = z10.object({ mode: stagingAccessModeSchema });
|
|
1047
|
+
var stagingAccessInputSchema = z10.discriminatedUnion("mode", [
|
|
1048
|
+
z10.object({ mode: z10.literal("console") }).strict(),
|
|
1049
|
+
z10.object({
|
|
1050
|
+
mode: z10.literal("password"),
|
|
1051
|
+
password: z10.string().min(8).max(128)
|
|
884
1052
|
}).strict()
|
|
885
1053
|
]);
|
|
886
|
-
var stagingPathSchema =
|
|
1054
|
+
var stagingPathSchema = z10.string().max(2048).refine(
|
|
887
1055
|
(path) => path.startsWith("/") && !path.startsWith("//") && !path.includes("\\"),
|
|
888
1056
|
"Expected a path on the staging host"
|
|
889
1057
|
);
|
|
890
|
-
var stagingLinkSchema =
|
|
891
|
-
url:
|
|
892
|
-
expiresAt:
|
|
1058
|
+
var stagingLinkSchema = z10.object({
|
|
1059
|
+
url: z10.string().url(),
|
|
1060
|
+
expiresAt: z10.number()
|
|
893
1061
|
});
|
|
894
|
-
var buildSnapshotSchema =
|
|
895
|
-
builds:
|
|
1062
|
+
var buildSnapshotSchema = z10.object({
|
|
1063
|
+
builds: z10.array(hostedBuildSchema),
|
|
896
1064
|
current: hostedBuildSchema.nullable(),
|
|
897
1065
|
selected: hostedBuildSchema.nullable(),
|
|
898
|
-
logs:
|
|
1066
|
+
logs: z10.string()
|
|
899
1067
|
});
|
|
900
|
-
var assetPathSchema =
|
|
1068
|
+
var assetPathSchema = z10.string().max(512).refine(
|
|
901
1069
|
(path) => path.startsWith("/") && // oxlint-disable-next-line no-control-regex -- Asset paths must reject control characters.
|
|
902
1070
|
!/[\\\u0000-\u001f?#%]/.test(path) && path.slice(1).split("/").every((part) => part.length > 0 && !part.startsWith(".")),
|
|
903
1071
|
"Expected a public asset path without hidden segments"
|
|
904
1072
|
);
|
|
905
|
-
var base64Schema =
|
|
1073
|
+
var base64Schema = z10.string().regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
|
|
906
1074
|
var stagedDeploymentLimits = {
|
|
907
1075
|
/** Bytes of JSON, uncompressed. */
|
|
908
1076
|
size: 64e6,
|
|
909
1077
|
/** Bytes of the Brotli-compressed object. */
|
|
910
1078
|
compressedSize: 1e7
|
|
911
1079
|
};
|
|
912
|
-
var stagedDeploymentSchema =
|
|
913
|
-
encoding:
|
|
914
|
-
sha256:
|
|
915
|
-
compressedSize:
|
|
916
|
-
size:
|
|
1080
|
+
var stagedDeploymentSchema = z10.object({
|
|
1081
|
+
encoding: z10.literal("br"),
|
|
1082
|
+
sha256: z10.string().regex(/^[0-9a-f]{64}$/),
|
|
1083
|
+
compressedSize: z10.number().int().positive().max(stagedDeploymentLimits.compressedSize),
|
|
1084
|
+
size: z10.number().int().positive().max(stagedDeploymentLimits.size)
|
|
917
1085
|
}).strict();
|
|
918
1086
|
var stagedDeploymentContentSchema = stagedDeploymentSchema.extend({
|
|
919
|
-
content:
|
|
1087
|
+
content: z10.string().max(Math.ceil(stagedDeploymentLimits.compressedSize / 3) * 4)
|
|
920
1088
|
}).strict();
|
|
921
1089
|
var stagedDeploymentKey = (build, sha256) => `builds/${build}/deployment/${sha256}.br`;
|
|
922
1090
|
var artifactFields = {
|
|
923
1091
|
routing: appRoutingSchema,
|
|
924
|
-
worker:
|
|
1092
|
+
worker: z10.object({
|
|
925
1093
|
...workerSettings,
|
|
926
1094
|
migrations: appMigrationsSchema.optional(),
|
|
927
|
-
modules:
|
|
928
|
-
|
|
1095
|
+
modules: z10.array(
|
|
1096
|
+
z10.object({
|
|
929
1097
|
path: outputPathSchema.refine((path) => path !== "metadata"),
|
|
930
|
-
type:
|
|
1098
|
+
type: z10.enum([
|
|
931
1099
|
"application/javascript+module",
|
|
932
1100
|
"application/wasm",
|
|
933
1101
|
"text/plain",
|
|
@@ -937,26 +1105,26 @@ var artifactFields = {
|
|
|
937
1105
|
}).strict()
|
|
938
1106
|
).min(1).max(500)
|
|
939
1107
|
}).strict().superRefine(distinctBindings).optional(),
|
|
940
|
-
assets:
|
|
941
|
-
|
|
1108
|
+
assets: z10.array(
|
|
1109
|
+
z10.object({
|
|
942
1110
|
path: assetPathSchema,
|
|
943
1111
|
content: base64Schema.max(14e6),
|
|
944
|
-
size:
|
|
1112
|
+
size: z10.number().int().min(0).max(1e7)
|
|
945
1113
|
}).strict()
|
|
946
1114
|
).max(500)
|
|
947
1115
|
};
|
|
948
|
-
var buildArtifactsSchema =
|
|
949
|
-
|
|
950
|
-
format:
|
|
1116
|
+
var buildArtifactsSchema = z10.discriminatedUnion("format", [
|
|
1117
|
+
z10.object({
|
|
1118
|
+
format: z10.literal(1),
|
|
951
1119
|
...artifactFields,
|
|
952
|
-
quests:
|
|
953
|
-
catalog:
|
|
1120
|
+
quests: z10.unknown(),
|
|
1121
|
+
catalog: z10.unknown()
|
|
954
1122
|
}).strict(),
|
|
955
|
-
|
|
956
|
-
format:
|
|
1123
|
+
z10.object({
|
|
1124
|
+
format: z10.literal(2),
|
|
957
1125
|
...artifactFields,
|
|
958
1126
|
deployment: stagedDeploymentSchema,
|
|
959
|
-
images:
|
|
1127
|
+
images: z10.array(imageAssetArtifactSchema).max(10)
|
|
960
1128
|
}).strict()
|
|
961
1129
|
]).superRefine((value, ctx) => {
|
|
962
1130
|
if (value.worker) {
|
|
@@ -1008,39 +1176,39 @@ var buildArtifactsSchema = z9.discriminatedUnion("format", [
|
|
|
1008
1176
|
});
|
|
1009
1177
|
|
|
1010
1178
|
// src/server/development.ts
|
|
1011
|
-
import { z as
|
|
1012
|
-
var developmentPreflightSchema =
|
|
1013
|
-
organization:
|
|
1014
|
-
project:
|
|
1015
|
-
environment:
|
|
1016
|
-
identity:
|
|
1017
|
-
exchange:
|
|
1018
|
-
activeIntegrations:
|
|
1179
|
+
import { z as z11 } from "zod";
|
|
1180
|
+
var developmentPreflightSchema = z11.object({
|
|
1181
|
+
organization: z11.string(),
|
|
1182
|
+
project: z11.string(),
|
|
1183
|
+
environment: z11.enum(["test", "live"]),
|
|
1184
|
+
identity: z11.object({
|
|
1185
|
+
exchange: z11.literal("supported"),
|
|
1186
|
+
activeIntegrations: z11.number().int().nonnegative()
|
|
1019
1187
|
}).optional(),
|
|
1020
|
-
staging:
|
|
1021
|
-
development:
|
|
1022
|
-
status:
|
|
1188
|
+
staging: z11.enum(["configured", "blocked"]),
|
|
1189
|
+
development: z11.object({
|
|
1190
|
+
status: z11.enum(["configured", "blocked"]),
|
|
1023
1191
|
// How `domino dev` reaches the preview origin: a Cloudflare tunnel, or a direct route on a
|
|
1024
1192
|
// local development stack. APIs that predate the field use tunnels.
|
|
1025
|
-
transport:
|
|
1026
|
-
missing:
|
|
1027
|
-
authentication:
|
|
1193
|
+
transport: z11.enum(["tunnel", "direct"]).default("tunnel"),
|
|
1194
|
+
missing: z11.array(z11.string()),
|
|
1195
|
+
authentication: z11.array(z11.string())
|
|
1028
1196
|
}),
|
|
1029
|
-
checks:
|
|
1030
|
-
|
|
1031
|
-
id:
|
|
1032
|
-
status:
|
|
1033
|
-
message:
|
|
1034
|
-
missing:
|
|
1035
|
-
issues:
|
|
1197
|
+
checks: z11.array(
|
|
1198
|
+
z11.object({
|
|
1199
|
+
id: z11.string(),
|
|
1200
|
+
status: z11.enum(["ok", "error"]),
|
|
1201
|
+
message: z11.string(),
|
|
1202
|
+
missing: z11.array(z11.string()).optional(),
|
|
1203
|
+
issues: z11.array(z11.string()).optional()
|
|
1036
1204
|
})
|
|
1037
1205
|
)
|
|
1038
1206
|
});
|
|
1039
1207
|
|
|
1040
1208
|
// src/server/hosted.ts
|
|
1041
|
-
import { z as
|
|
1209
|
+
import { z as z12 } from "zod";
|
|
1042
1210
|
var hostedKeyPermissions = ["read", "points", "ingest"];
|
|
1043
|
-
var hostedKeyPermissionList =
|
|
1211
|
+
var hostedKeyPermissionList = z12.array(z12.string()).transform(
|
|
1044
1212
|
(values) => values.filter(
|
|
1045
1213
|
(value) => hostedKeyPermissions.includes(value)
|
|
1046
1214
|
)
|
|
@@ -1052,17 +1220,17 @@ var hostedManagementBindings = [
|
|
|
1052
1220
|
"DOMINO_PROJECT",
|
|
1053
1221
|
"DOMINO_ENVIRONMENT"
|
|
1054
1222
|
];
|
|
1055
|
-
var hostedKeySecretSchema =
|
|
1056
|
-
var hostedKeySchema =
|
|
1057
|
-
id:
|
|
1223
|
+
var hostedKeySecretSchema = z12.string().regex(/^dhk_[A-Za-z0-9_-]{43}$/, "Expected a hosted app key");
|
|
1224
|
+
var hostedKeySchema = z12.object({
|
|
1225
|
+
id: z12.string().uuid(),
|
|
1058
1226
|
token: hostedKeySecretSchema,
|
|
1059
1227
|
organization: identifier,
|
|
1060
1228
|
project: identifier,
|
|
1061
|
-
environment:
|
|
1229
|
+
environment: z12.enum(["test", "live"]),
|
|
1062
1230
|
permissions: hostedKeyPermissionList,
|
|
1063
|
-
expiresAt:
|
|
1231
|
+
expiresAt: z12.number().nullable()
|
|
1064
1232
|
}).strict();
|
|
1065
|
-
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl:
|
|
1233
|
+
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl: z12.string().url() }).strict();
|
|
1066
1234
|
function hostedManagementClient(env) {
|
|
1067
1235
|
const missing = hostedManagementBindings.filter((name) => !env[name]);
|
|
1068
1236
|
if (missing.length) {
|
|
@@ -1070,7 +1238,7 @@ function hostedManagementClient(env) {
|
|
|
1070
1238
|
`Missing ${missing.join(", ")}. Domino sets these for hosted apps and domino dev; update the project's vite.config.ts to forward them in development.`
|
|
1071
1239
|
);
|
|
1072
1240
|
}
|
|
1073
|
-
const environment =
|
|
1241
|
+
const environment = z12.enum(["test", "live"]).parse(env.DOMINO_ENVIRONMENT);
|
|
1074
1242
|
const token = env.DOMINO_MANAGEMENT_KEY;
|
|
1075
1243
|
return createManagementClient({
|
|
1076
1244
|
baseUrl: env.DOMINO_API_URL.replace(/\/+$/, ""),
|
|
@@ -1082,9 +1250,9 @@ function hostedManagementClient(env) {
|
|
|
1082
1250
|
}
|
|
1083
1251
|
|
|
1084
1252
|
// src/server/index.ts
|
|
1085
|
-
var environmentSchema =
|
|
1086
|
-
var roleSchema =
|
|
1087
|
-
var permissionSchema =
|
|
1253
|
+
var environmentSchema = z13.enum(["test", "live"]);
|
|
1254
|
+
var roleSchema = z13.enum(["editor", "reviewer", "staff"]);
|
|
1255
|
+
var permissionSchema = z13.enum([
|
|
1088
1256
|
"read",
|
|
1089
1257
|
"publish",
|
|
1090
1258
|
"review",
|
|
@@ -1104,7 +1272,7 @@ var permissionSchema = z12.enum([
|
|
|
1104
1272
|
*/
|
|
1105
1273
|
"enroll"
|
|
1106
1274
|
]);
|
|
1107
|
-
var permissionListSchema =
|
|
1275
|
+
var permissionListSchema = z13.array(z13.string()).transform(
|
|
1108
1276
|
(values) => values.filter(
|
|
1109
1277
|
(value) => permissionSchema.safeParse(value).success
|
|
1110
1278
|
)
|
|
@@ -1114,33 +1282,33 @@ var rolePermissions = {
|
|
|
1114
1282
|
reviewer: ["read", "review"],
|
|
1115
1283
|
staff: ["read", "confirm", "handover"]
|
|
1116
1284
|
};
|
|
1117
|
-
var projectSetupSchema =
|
|
1118
|
-
mode:
|
|
1119
|
-
brief:
|
|
1285
|
+
var projectSetupSchema = z13.object({
|
|
1286
|
+
mode: z13.enum(["new", "existing"]),
|
|
1287
|
+
brief: z13.string().trim().min(1).max(4e3)
|
|
1120
1288
|
}).strict();
|
|
1121
|
-
var operatorUserSchema =
|
|
1122
|
-
id:
|
|
1123
|
-
name:
|
|
1124
|
-
email:
|
|
1125
|
-
avatar:
|
|
1126
|
-
});
|
|
1127
|
-
var projectSchema =
|
|
1128
|
-
slug:
|
|
1129
|
-
createdBy:
|
|
1289
|
+
var operatorUserSchema = z13.object({
|
|
1290
|
+
id: z13.string(),
|
|
1291
|
+
name: z13.string().nullable(),
|
|
1292
|
+
email: z13.string().nullable(),
|
|
1293
|
+
avatar: z13.string().nullable()
|
|
1294
|
+
});
|
|
1295
|
+
var projectSchema = z13.object({
|
|
1296
|
+
slug: z13.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
1297
|
+
createdBy: z13.string().nullable().optional(),
|
|
1130
1298
|
creator: operatorUserSchema.nullable().optional(),
|
|
1131
1299
|
/** A response, so fields a newer server adds to the setup are dropped, not rejected. */
|
|
1132
|
-
setup:
|
|
1300
|
+
setup: z13.object(projectSetupSchema.shape).optional(),
|
|
1133
1301
|
/** The starter chosen at setup. A plain string, so later starters still parse. */
|
|
1134
|
-
starter:
|
|
1135
|
-
id:
|
|
1302
|
+
starter: z13.string().optional(),
|
|
1303
|
+
id: z13.string().min(1),
|
|
1136
1304
|
organization: identifier,
|
|
1137
1305
|
project: identifier,
|
|
1138
|
-
name:
|
|
1139
|
-
subtitle:
|
|
1140
|
-
initials:
|
|
1141
|
-
color:
|
|
1306
|
+
name: z13.string(),
|
|
1307
|
+
subtitle: z13.string(),
|
|
1308
|
+
initials: z13.string(),
|
|
1309
|
+
color: z13.string(),
|
|
1142
1310
|
permissions: permissionListSchema,
|
|
1143
|
-
environments:
|
|
1311
|
+
environments: z13.array(environmentSchema)
|
|
1144
1312
|
}).refine(
|
|
1145
1313
|
(project) => !project.creator || project.creator.id === project.createdBy,
|
|
1146
1314
|
{
|
|
@@ -1148,45 +1316,45 @@ var projectSchema = z12.object({
|
|
|
1148
1316
|
path: ["creator"]
|
|
1149
1317
|
}
|
|
1150
1318
|
);
|
|
1151
|
-
var projectInputSchema =
|
|
1319
|
+
var projectInputSchema = z13.object({
|
|
1152
1320
|
actionId: identifier,
|
|
1153
|
-
name:
|
|
1321
|
+
name: z13.string().trim().min(1).max(80),
|
|
1154
1322
|
setup: projectSetupSchema.optional(),
|
|
1155
1323
|
/** The starter a new hosted app begins from, with `setup.mode` "new". */
|
|
1156
1324
|
starter: starterIdSchema.optional()
|
|
1157
1325
|
}).strict();
|
|
1158
|
-
var projectUpdateInputSchema =
|
|
1159
|
-
|
|
1160
|
-
|
|
1326
|
+
var projectUpdateInputSchema = z13.union([
|
|
1327
|
+
z13.object({ name: projectInputSchema.shape.name }).strict(),
|
|
1328
|
+
z13.object({
|
|
1161
1329
|
slug: projectSchema.shape.slug,
|
|
1162
|
-
confirm:
|
|
1330
|
+
confirm: z13.string().min(1).max(80)
|
|
1163
1331
|
}).strict()
|
|
1164
1332
|
]);
|
|
1165
|
-
var projectDeletionInputSchema =
|
|
1166
|
-
var projectDeletionSchema =
|
|
1333
|
+
var projectDeletionInputSchema = z13.object({ confirm: z13.string().min(1).max(80) }).strict();
|
|
1334
|
+
var projectDeletionSchema = z13.object({
|
|
1167
1335
|
project: identifier,
|
|
1168
|
-
purgeAfter:
|
|
1336
|
+
purgeAfter: z13.number().int()
|
|
1169
1337
|
});
|
|
1170
|
-
var projectTransferInputSchema =
|
|
1171
|
-
var projectTransferSchema =
|
|
1338
|
+
var projectTransferInputSchema = z13.object({ organization: identifier, confirm: z13.string().min(1).max(80) }).strict();
|
|
1339
|
+
var projectTransferSchema = z13.object({
|
|
1172
1340
|
organization: identifier,
|
|
1173
1341
|
project: identifier
|
|
1174
1342
|
});
|
|
1175
|
-
var grantSchema =
|
|
1176
|
-
subject:
|
|
1177
|
-
roles:
|
|
1178
|
-
environments:
|
|
1343
|
+
var grantSchema = z13.object({
|
|
1344
|
+
subject: z13.string().min(1).max(200),
|
|
1345
|
+
roles: z13.array(roleSchema),
|
|
1346
|
+
environments: z13.array(environmentSchema)
|
|
1179
1347
|
}).strict();
|
|
1180
|
-
var grantRecordSchema =
|
|
1181
|
-
var stockAdditionSchema =
|
|
1348
|
+
var grantRecordSchema = z13.object(grantSchema.shape);
|
|
1349
|
+
var stockAdditionSchema = z13.object({
|
|
1182
1350
|
item: identifier,
|
|
1183
|
-
quantity:
|
|
1351
|
+
quantity: z13.number().int(),
|
|
1184
1352
|
actionId: identifier
|
|
1185
1353
|
});
|
|
1186
|
-
var completionRevokeSchema =
|
|
1354
|
+
var completionRevokeSchema = z13.object({
|
|
1187
1355
|
actionId: identifier,
|
|
1188
|
-
reason:
|
|
1189
|
-
freeOccurrence:
|
|
1356
|
+
reason: z13.string().trim().min(1).max(500),
|
|
1357
|
+
freeOccurrence: z13.boolean().default(false)
|
|
1190
1358
|
}).strict();
|
|
1191
1359
|
var RevokedEntitlementOutcome = {
|
|
1192
1360
|
/** No other completion grants the reward: it is void, after cancelling a handover in progress. */
|
|
@@ -1214,218 +1382,219 @@ var RevokedReferralOutcome = {
|
|
|
1214
1382
|
/** Qualified on another accepted completion of the program's quest instead. */
|
|
1215
1383
|
Requalified: "requalified"
|
|
1216
1384
|
};
|
|
1217
|
-
var entitlementOutcomeSchema =
|
|
1218
|
-
var deliveryOutcomeSchema =
|
|
1219
|
-
var referralOutcomeSchema =
|
|
1220
|
-
var completionRevocationSchema =
|
|
1385
|
+
var entitlementOutcomeSchema = z13.string().min(1).max(64);
|
|
1386
|
+
var deliveryOutcomeSchema = z13.string().min(1).max(64);
|
|
1387
|
+
var referralOutcomeSchema = z13.string().min(1).max(64);
|
|
1388
|
+
var completionRevocationSchema = z13.object({
|
|
1221
1389
|
completion: identifier,
|
|
1222
1390
|
/** The quest ID, or the board ID when `source.kind` is `leaderboard`. */
|
|
1223
1391
|
quest: identifier,
|
|
1224
1392
|
member: identifier,
|
|
1225
1393
|
/** What paid the revoked completion. `source.id` repeats `quest`. */
|
|
1226
1394
|
source: completionSourceSchema.optional(),
|
|
1227
|
-
revokedAt:
|
|
1228
|
-
occurrenceFreed:
|
|
1229
|
-
|
|
1230
|
-
|
|
1395
|
+
revokedAt: z13.number(),
|
|
1396
|
+
occurrenceFreed: z13.boolean(),
|
|
1397
|
+
badges: z13.array(z13.object({ badge: identifier, stillAwarded: z13.boolean() })).optional(),
|
|
1398
|
+
points: z13.array(
|
|
1399
|
+
z13.object({
|
|
1231
1400
|
entry: identifier,
|
|
1232
1401
|
balance: identifier,
|
|
1233
1402
|
reversal: identifier.nullable(),
|
|
1234
|
-
reversed:
|
|
1235
|
-
unreversed:
|
|
1403
|
+
reversed: z13.number().int(),
|
|
1404
|
+
unreversed: z13.number().int()
|
|
1236
1405
|
})
|
|
1237
1406
|
),
|
|
1238
|
-
entitlements:
|
|
1239
|
-
|
|
1407
|
+
entitlements: z13.array(
|
|
1408
|
+
z13.object({
|
|
1240
1409
|
entitlement: identifier,
|
|
1241
1410
|
reward: identifier,
|
|
1242
1411
|
outcome: entitlementOutcomeSchema,
|
|
1243
|
-
status:
|
|
1412
|
+
status: z13.string()
|
|
1244
1413
|
})
|
|
1245
1414
|
),
|
|
1246
|
-
deliveries:
|
|
1247
|
-
|
|
1248
|
-
delivery:
|
|
1249
|
-
roleId:
|
|
1415
|
+
deliveries: z13.array(
|
|
1416
|
+
z13.object({
|
|
1417
|
+
delivery: z13.string(),
|
|
1418
|
+
roleId: z13.string(),
|
|
1250
1419
|
outcome: deliveryOutcomeSchema,
|
|
1251
1420
|
/**
|
|
1252
1421
|
* By Relay's records, another accepted, unrevoked completion of the member also granted this
|
|
1253
1422
|
* role to the same Discord account and server. Relay does not read Discord's membership.
|
|
1254
1423
|
*/
|
|
1255
|
-
stillGranted:
|
|
1424
|
+
stillGranted: z13.boolean()
|
|
1256
1425
|
})
|
|
1257
1426
|
),
|
|
1258
|
-
referrals:
|
|
1259
|
-
|
|
1427
|
+
referrals: z13.array(
|
|
1428
|
+
z13.object({
|
|
1260
1429
|
program: identifier,
|
|
1261
1430
|
outcome: referralOutcomeSchema
|
|
1262
1431
|
})
|
|
1263
1432
|
),
|
|
1264
|
-
streakMilestone:
|
|
1265
|
-
});
|
|
1266
|
-
var accessSchema =
|
|
1267
|
-
actor:
|
|
1268
|
-
organization:
|
|
1269
|
-
admin:
|
|
1270
|
-
local:
|
|
1271
|
-
projects:
|
|
1272
|
-
});
|
|
1273
|
-
var querySchema =
|
|
1274
|
-
q:
|
|
1275
|
-
filter:
|
|
1276
|
-
offset:
|
|
1277
|
-
limit:
|
|
1278
|
-
});
|
|
1279
|
-
var accountProfileSchema =
|
|
1280
|
-
name:
|
|
1433
|
+
streakMilestone: z13.boolean()
|
|
1434
|
+
});
|
|
1435
|
+
var accessSchema = z13.object({
|
|
1436
|
+
actor: z13.string(),
|
|
1437
|
+
organization: z13.string(),
|
|
1438
|
+
admin: z13.boolean(),
|
|
1439
|
+
local: z13.boolean(),
|
|
1440
|
+
projects: z13.array(projectSchema)
|
|
1441
|
+
});
|
|
1442
|
+
var querySchema = z13.object({
|
|
1443
|
+
q: z13.string().max(200).default(""),
|
|
1444
|
+
filter: z13.string().max(50).default("all"),
|
|
1445
|
+
offset: z13.coerce.number().int().min(0).max(1e6).default(0),
|
|
1446
|
+
limit: z13.coerce.number().int().min(1).max(100).default(25)
|
|
1447
|
+
});
|
|
1448
|
+
var accountProfileSchema = z13.object({
|
|
1449
|
+
name: z13.string().optional(),
|
|
1281
1450
|
/** The account's handle, where the provider has one (X and Discord). */
|
|
1282
|
-
username:
|
|
1283
|
-
email:
|
|
1284
|
-
emailVerified:
|
|
1285
|
-
imageUrl:
|
|
1451
|
+
username: z13.string().optional(),
|
|
1452
|
+
email: z13.string().optional(),
|
|
1453
|
+
emailVerified: z13.boolean().default(false),
|
|
1454
|
+
imageUrl: z13.string().url().optional()
|
|
1286
1455
|
});
|
|
1287
|
-
var memberAccountSchema =
|
|
1456
|
+
var memberAccountSchema = z13.object({
|
|
1288
1457
|
/** `wallet` for wallet sign-in, `account` for every other connected account. */
|
|
1289
|
-
kind:
|
|
1290
|
-
provider:
|
|
1291
|
-
subject:
|
|
1292
|
-
signInEnabled:
|
|
1458
|
+
kind: z13.enum(["account", "wallet"]),
|
|
1459
|
+
provider: z13.string(),
|
|
1460
|
+
subject: z13.string(),
|
|
1461
|
+
signInEnabled: z13.boolean(),
|
|
1293
1462
|
profile: accountProfileSchema.optional()
|
|
1294
1463
|
});
|
|
1295
|
-
var operationSchema =
|
|
1296
|
-
target:
|
|
1297
|
-
paused:
|
|
1298
|
-
revision:
|
|
1299
|
-
reason:
|
|
1300
|
-
actor:
|
|
1301
|
-
changedAt:
|
|
1302
|
-
});
|
|
1303
|
-
var operationInputSchema =
|
|
1304
|
-
target:
|
|
1305
|
-
|
|
1306
|
-
|
|
1464
|
+
var operationSchema = z13.object({
|
|
1465
|
+
target: z13.string(),
|
|
1466
|
+
paused: z13.boolean(),
|
|
1467
|
+
revision: z13.number().int(),
|
|
1468
|
+
reason: z13.string(),
|
|
1469
|
+
actor: z13.string().nullable(),
|
|
1470
|
+
changedAt: z13.number()
|
|
1471
|
+
});
|
|
1472
|
+
var operationInputSchema = z13.object({
|
|
1473
|
+
target: z13.union([
|
|
1474
|
+
z13.literal("redemptions"),
|
|
1475
|
+
z13.string().regex(/^quest:[\w-]+$/)
|
|
1307
1476
|
]),
|
|
1308
|
-
paused:
|
|
1309
|
-
revision:
|
|
1310
|
-
reason:
|
|
1477
|
+
paused: z13.boolean(),
|
|
1478
|
+
revision: z13.number().int().nonnegative(),
|
|
1479
|
+
reason: z13.string().trim().min(1).max(500),
|
|
1311
1480
|
actionId: identifier
|
|
1312
1481
|
}).strict();
|
|
1313
|
-
var questLifecycleInputSchema =
|
|
1482
|
+
var questLifecycleInputSchema = z13.object({
|
|
1314
1483
|
quest: identifier,
|
|
1315
1484
|
expectedRelease: identifier.optional(),
|
|
1316
|
-
archived:
|
|
1317
|
-
reason:
|
|
1485
|
+
archived: z13.boolean(),
|
|
1486
|
+
reason: z13.string().trim().min(1).max(500),
|
|
1318
1487
|
actionId: identifier
|
|
1319
1488
|
}).strict();
|
|
1320
|
-
var questLifecycleSchema =
|
|
1489
|
+
var questLifecycleSchema = z13.object({
|
|
1321
1490
|
quest: identifier,
|
|
1322
1491
|
key: identifier.nullable(),
|
|
1323
|
-
title:
|
|
1492
|
+
title: z13.string(),
|
|
1324
1493
|
release: identifier,
|
|
1325
|
-
lifecycle:
|
|
1326
|
-
changed:
|
|
1327
|
-
});
|
|
1328
|
-
var memberSchema =
|
|
1329
|
-
id:
|
|
1330
|
-
test:
|
|
1331
|
-
name:
|
|
1332
|
-
accounts:
|
|
1333
|
-
attempts:
|
|
1334
|
-
completions:
|
|
1335
|
-
rewards:
|
|
1336
|
-
lastActivity:
|
|
1337
|
-
});
|
|
1338
|
-
var personSchema =
|
|
1339
|
-
id:
|
|
1340
|
-
test:
|
|
1341
|
-
name:
|
|
1342
|
-
accounts:
|
|
1343
|
-
});
|
|
1344
|
-
var metricsSchema =
|
|
1345
|
-
quests:
|
|
1346
|
-
members:
|
|
1347
|
-
attempts:
|
|
1348
|
-
completions:
|
|
1349
|
-
review:
|
|
1350
|
-
failed:
|
|
1351
|
-
entitlements:
|
|
1352
|
-
});
|
|
1353
|
-
var readinessSchema =
|
|
1354
|
-
checks:
|
|
1355
|
-
|
|
1356
|
-
id:
|
|
1357
|
-
status:
|
|
1358
|
-
title:
|
|
1359
|
-
detail:
|
|
1494
|
+
lifecycle: z13.enum(["active", "paused", "archived"]),
|
|
1495
|
+
changed: z13.boolean()
|
|
1496
|
+
});
|
|
1497
|
+
var memberSchema = z13.object({
|
|
1498
|
+
id: z13.string(),
|
|
1499
|
+
test: z13.boolean().optional(),
|
|
1500
|
+
name: z13.string().nullable().optional(),
|
|
1501
|
+
accounts: z13.array(memberAccountSchema).default([]),
|
|
1502
|
+
attempts: z13.number(),
|
|
1503
|
+
completions: z13.number(),
|
|
1504
|
+
rewards: z13.number(),
|
|
1505
|
+
lastActivity: z13.number().nullable()
|
|
1506
|
+
});
|
|
1507
|
+
var personSchema = z13.object({
|
|
1508
|
+
id: z13.string(),
|
|
1509
|
+
test: z13.boolean().optional(),
|
|
1510
|
+
name: z13.string().nullable().optional(),
|
|
1511
|
+
accounts: z13.array(memberAccountSchema).default([])
|
|
1512
|
+
});
|
|
1513
|
+
var metricsSchema = z13.object({
|
|
1514
|
+
quests: z13.number(),
|
|
1515
|
+
members: z13.number(),
|
|
1516
|
+
attempts: z13.number(),
|
|
1517
|
+
completions: z13.number(),
|
|
1518
|
+
review: z13.number(),
|
|
1519
|
+
failed: z13.number(),
|
|
1520
|
+
entitlements: z13.number()
|
|
1521
|
+
});
|
|
1522
|
+
var readinessSchema = z13.object({
|
|
1523
|
+
checks: z13.array(
|
|
1524
|
+
z13.object({
|
|
1525
|
+
id: z13.string(),
|
|
1526
|
+
status: z13.enum(["ready", "blocked"]),
|
|
1527
|
+
title: z13.string(),
|
|
1528
|
+
detail: z13.string()
|
|
1360
1529
|
})
|
|
1361
1530
|
)
|
|
1362
1531
|
});
|
|
1363
|
-
var inventorySchema =
|
|
1364
|
-
item:
|
|
1365
|
-
name:
|
|
1366
|
-
available:
|
|
1367
|
-
reserved:
|
|
1368
|
-
allocated:
|
|
1369
|
-
});
|
|
1370
|
-
var auditRecordSchema =
|
|
1371
|
-
id:
|
|
1372
|
-
action:
|
|
1373
|
-
actor:
|
|
1532
|
+
var inventorySchema = z13.object({
|
|
1533
|
+
item: z13.string(),
|
|
1534
|
+
name: z13.string().nullable().default(null),
|
|
1535
|
+
available: z13.number(),
|
|
1536
|
+
reserved: z13.number(),
|
|
1537
|
+
allocated: z13.number().default(0)
|
|
1538
|
+
});
|
|
1539
|
+
var auditRecordSchema = z13.object({
|
|
1540
|
+
id: z13.string(),
|
|
1541
|
+
action: z13.string(),
|
|
1542
|
+
actor: z13.string().nullable(),
|
|
1374
1543
|
user: operatorUserSchema.nullable().optional(),
|
|
1375
|
-
detail:
|
|
1376
|
-
at:
|
|
1377
|
-
attempt:
|
|
1544
|
+
detail: z13.string(),
|
|
1545
|
+
at: z13.number(),
|
|
1546
|
+
attempt: z13.string().nullable()
|
|
1378
1547
|
}).refine((record) => !record.user || record.user.id === record.actor, {
|
|
1379
1548
|
message: "User profile must match the recorded actor",
|
|
1380
1549
|
path: ["user"]
|
|
1381
1550
|
});
|
|
1382
|
-
var pageSchema =
|
|
1551
|
+
var pageSchema = z13.object({
|
|
1383
1552
|
snapshot: snapshotSchema,
|
|
1384
|
-
members:
|
|
1385
|
-
people:
|
|
1553
|
+
members: z13.array(memberSchema),
|
|
1554
|
+
people: z13.array(personSchema).default([]),
|
|
1386
1555
|
metrics: metricsSchema,
|
|
1387
|
-
total:
|
|
1388
|
-
offset:
|
|
1389
|
-
limit:
|
|
1390
|
-
inventory:
|
|
1391
|
-
operations:
|
|
1392
|
-
audit:
|
|
1393
|
-
questCounts:
|
|
1394
|
-
});
|
|
1395
|
-
var managedOAuthAccountBaseSchema =
|
|
1396
|
-
provider:
|
|
1397
|
-
revision:
|
|
1398
|
-
});
|
|
1399
|
-
var managedOAuthAccountSchema =
|
|
1556
|
+
total: z13.number(),
|
|
1557
|
+
offset: z13.number(),
|
|
1558
|
+
limit: z13.number(),
|
|
1559
|
+
inventory: z13.array(inventorySchema),
|
|
1560
|
+
operations: z13.array(operationSchema).default([]),
|
|
1561
|
+
audit: z13.array(auditRecordSchema).default([]),
|
|
1562
|
+
questCounts: z13.record(z13.string(), z13.number())
|
|
1563
|
+
});
|
|
1564
|
+
var managedOAuthAccountBaseSchema = z13.object({
|
|
1565
|
+
provider: z13.enum(["x", "discord"]),
|
|
1566
|
+
revision: z13.number().int().nonnegative()
|
|
1567
|
+
});
|
|
1568
|
+
var managedOAuthAccountSchema = z13.discriminatedUnion("status", [
|
|
1400
1569
|
managedOAuthAccountBaseSchema.extend({
|
|
1401
|
-
status:
|
|
1402
|
-
subject:
|
|
1403
|
-
linkedAt:
|
|
1570
|
+
status: z13.literal("connected"),
|
|
1571
|
+
subject: z13.string().min(1),
|
|
1572
|
+
linkedAt: z13.number()
|
|
1404
1573
|
}),
|
|
1405
|
-
managedOAuthAccountBaseSchema.extend({ status:
|
|
1574
|
+
managedOAuthAccountBaseSchema.extend({ status: z13.literal("disconnected") })
|
|
1406
1575
|
]);
|
|
1407
|
-
var memberOAuthUnlinkInputSchema =
|
|
1408
|
-
provider:
|
|
1409
|
-
subject:
|
|
1410
|
-
revision:
|
|
1411
|
-
reason:
|
|
1576
|
+
var memberOAuthUnlinkInputSchema = z13.object({
|
|
1577
|
+
provider: z13.enum(["x", "discord"]),
|
|
1578
|
+
subject: z13.string().min(1).max(4096),
|
|
1579
|
+
revision: z13.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER - 1),
|
|
1580
|
+
reason: z13.string().trim().min(1).max(500)
|
|
1412
1581
|
}).strict();
|
|
1413
1582
|
var managedWalletSchema = linkedWalletSchema.extend({
|
|
1414
|
-
status:
|
|
1415
|
-
unlinkedAt:
|
|
1583
|
+
status: z13.enum(["linked", "unlinked"]),
|
|
1584
|
+
unlinkedAt: z13.number().int().nullable(),
|
|
1416
1585
|
/** "member", or the operator or key that unlinked it. */
|
|
1417
|
-
unlinkedBy:
|
|
1586
|
+
unlinkedBy: z13.string().nullable()
|
|
1418
1587
|
});
|
|
1419
1588
|
var managedMemberIdentitySchema = memberIdentitySchema.extend({
|
|
1420
|
-
status:
|
|
1421
|
-
unlinkedAt:
|
|
1589
|
+
status: z13.enum(["linked", "unlinked"]),
|
|
1590
|
+
unlinkedAt: z13.number().int().nullable(),
|
|
1422
1591
|
/** The operator or key that unlinked it. */
|
|
1423
|
-
unlinkedBy:
|
|
1592
|
+
unlinkedBy: z13.string().nullable()
|
|
1424
1593
|
});
|
|
1425
|
-
var memberIdentityChangeInputSchema =
|
|
1594
|
+
var memberIdentityChangeInputSchema = z13.object({
|
|
1426
1595
|
kind: appIdentityKindSchema,
|
|
1427
|
-
subject:
|
|
1428
|
-
reason:
|
|
1596
|
+
subject: z13.string().min(1).max(256),
|
|
1597
|
+
reason: z13.string().trim().min(1).max(500)
|
|
1429
1598
|
}).strict();
|
|
1430
1599
|
var balanceCheckSchema = walletBalanceSchema.pick({
|
|
1431
1600
|
chain: true,
|
|
@@ -1435,65 +1604,65 @@ var balanceCheckSchema = walletBalanceSchema.pick({
|
|
|
1435
1604
|
wallets: true,
|
|
1436
1605
|
observedAt: true
|
|
1437
1606
|
}).extend({ attempt: identifier });
|
|
1438
|
-
var walletBalanceChainsSchema =
|
|
1439
|
-
chains:
|
|
1440
|
-
|
|
1441
|
-
chain:
|
|
1442
|
-
|
|
1607
|
+
var walletBalanceChainsSchema = z13.object({
|
|
1608
|
+
chains: z13.array(
|
|
1609
|
+
z13.object({
|
|
1610
|
+
chain: z13.union([
|
|
1611
|
+
z13.literal(solanaMainnet),
|
|
1443
1612
|
cosmosNetworkSchema,
|
|
1444
1613
|
evmChainIdSchema
|
|
1445
1614
|
]),
|
|
1446
|
-
name:
|
|
1447
|
-
testnet:
|
|
1615
|
+
name: z13.string(),
|
|
1616
|
+
testnet: z13.boolean()
|
|
1448
1617
|
})
|
|
1449
1618
|
)
|
|
1450
1619
|
});
|
|
1451
|
-
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason:
|
|
1620
|
+
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason: z13.string().trim().min(1).max(500) }).strict();
|
|
1452
1621
|
var memberWalletSignInInputSchema = walletUnlinkInputSchema.extend({
|
|
1453
|
-
enabled:
|
|
1454
|
-
reason:
|
|
1622
|
+
enabled: z13.boolean(),
|
|
1623
|
+
reason: z13.string().trim().min(1).max(500)
|
|
1455
1624
|
}).strict();
|
|
1456
|
-
var participantSignInSchema =
|
|
1457
|
-
providers:
|
|
1458
|
-
|
|
1625
|
+
var participantSignInSchema = z13.object({
|
|
1626
|
+
providers: z13.array(
|
|
1627
|
+
z13.object({ provider: authProviderSchema, configured: z13.boolean() })
|
|
1459
1628
|
),
|
|
1460
|
-
email:
|
|
1629
|
+
email: z13.boolean(),
|
|
1461
1630
|
/** Wallet families: `"solana"`, `"eip155"`, `"cosmos"`. */
|
|
1462
1631
|
wallets: walletSignInNetworksSchema,
|
|
1463
1632
|
/** Why participants cannot sign in to this project, or null. */
|
|
1464
|
-
issue:
|
|
1465
|
-
updatedAt:
|
|
1466
|
-
updatedBy:
|
|
1633
|
+
issue: z13.string().nullable(),
|
|
1634
|
+
updatedAt: z13.number().nullable(),
|
|
1635
|
+
updatedBy: z13.string().nullable()
|
|
1467
1636
|
});
|
|
1468
|
-
var participantSignInInputSchema =
|
|
1637
|
+
var participantSignInInputSchema = z13.object({
|
|
1469
1638
|
wallets: walletSignInNetworksSchema
|
|
1470
1639
|
}).strict();
|
|
1471
|
-
var completionRevocationShortfallSchema =
|
|
1640
|
+
var completionRevocationShortfallSchema = z13.object({
|
|
1472
1641
|
completion: identifier,
|
|
1473
1642
|
quest: identifier,
|
|
1474
|
-
revokedAt:
|
|
1475
|
-
unreversedPoints:
|
|
1643
|
+
revokedAt: z13.number().int().nonnegative().safe(),
|
|
1644
|
+
unreversedPoints: z13.record(identifier, z13.number().int().positive().safe())
|
|
1476
1645
|
});
|
|
1477
|
-
var memberDetailSchema =
|
|
1646
|
+
var memberDetailSchema = z13.object({
|
|
1478
1647
|
snapshot: snapshotSchema,
|
|
1479
1648
|
member: memberSchema,
|
|
1480
1649
|
progress: memberProgressSchema,
|
|
1481
1650
|
/** Up to 25 revoked completions with an unreversed point remainder, newest first. */
|
|
1482
|
-
revocationShortfalls:
|
|
1651
|
+
revocationShortfalls: z13.array(completionRevocationShortfallSchema).default([]),
|
|
1483
1652
|
/** Current and historical campaign enrollment state, including inactive enrollments. */
|
|
1484
|
-
campaignEnrollments:
|
|
1485
|
-
passes:
|
|
1486
|
-
|
|
1487
|
-
provider:
|
|
1488
|
-
event:
|
|
1489
|
-
subject:
|
|
1653
|
+
campaignEnrollments: z13.array(campaignEnrollmentSchema).default([]),
|
|
1654
|
+
passes: z13.array(
|
|
1655
|
+
z13.object({
|
|
1656
|
+
provider: z13.string(),
|
|
1657
|
+
event: z13.string(),
|
|
1658
|
+
subject: z13.string(),
|
|
1490
1659
|
attempt: identifier.nullable()
|
|
1491
1660
|
})
|
|
1492
1661
|
).default([]),
|
|
1493
1662
|
/** Linked and unlinked wallets. */
|
|
1494
|
-
wallets:
|
|
1663
|
+
wallets: z13.array(managedWalletSchema),
|
|
1495
1664
|
/** The member's 10 most recent recorded balance reads, newest first. */
|
|
1496
|
-
balanceChecks:
|
|
1665
|
+
balanceChecks: z13.array(balanceCheckSchema),
|
|
1497
1666
|
/** The member's participant profile in this project. */
|
|
1498
1667
|
profile: managedProfileSchema.nullable(),
|
|
1499
1668
|
/**
|
|
@@ -1501,126 +1670,126 @@ var memberDetailSchema = z12.object({
|
|
|
1501
1670
|
* member ID: their selected X and Discord accounts and their `app:<name>` identities in this
|
|
1502
1671
|
* project, including app identities an operator unlinked, by kind.
|
|
1503
1672
|
*/
|
|
1504
|
-
identities:
|
|
1673
|
+
identities: z13.array(managedMemberIdentitySchema)
|
|
1505
1674
|
});
|
|
1506
|
-
var stockInputSchema =
|
|
1675
|
+
var stockInputSchema = z13.object({
|
|
1507
1676
|
item: identifier,
|
|
1508
|
-
quantity:
|
|
1677
|
+
quantity: z13.number().int().positive().max(1e6),
|
|
1509
1678
|
actionId: identifier
|
|
1510
1679
|
}).strict();
|
|
1511
|
-
var ingestTrackerScopeSchema =
|
|
1512
|
-
var tokenScopeInputSchema =
|
|
1513
|
-
var tokenInputSchema =
|
|
1514
|
-
name:
|
|
1680
|
+
var ingestTrackerScopeSchema = z13.array(identifier).min(1).max(100).nullable();
|
|
1681
|
+
var tokenScopeInputSchema = z13.object({ ingestTrackers: ingestTrackerScopeSchema }).strict();
|
|
1682
|
+
var tokenInputSchema = z13.object({
|
|
1683
|
+
name: z13.string().trim().min(1).max(80),
|
|
1515
1684
|
project: identifier,
|
|
1516
1685
|
environment: environmentSchema,
|
|
1517
|
-
permissions:
|
|
1686
|
+
permissions: z13.array(permissionSchema).min(1),
|
|
1518
1687
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
1519
|
-
days:
|
|
1688
|
+
days: z13.number().int().min(1).max(90).default(30)
|
|
1520
1689
|
}).strict();
|
|
1521
|
-
var tokenSchema =
|
|
1522
|
-
id:
|
|
1523
|
-
name:
|
|
1524
|
-
project:
|
|
1690
|
+
var tokenSchema = z13.object({
|
|
1691
|
+
id: z13.string(),
|
|
1692
|
+
name: z13.string(),
|
|
1693
|
+
project: z13.string(),
|
|
1525
1694
|
environment: environmentSchema,
|
|
1526
1695
|
permissions: permissionListSchema,
|
|
1527
1696
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
1528
|
-
expiresAt:
|
|
1697
|
+
expiresAt: z13.number()
|
|
1529
1698
|
});
|
|
1530
|
-
var issuedTokenSchema = tokenSchema.extend({ token:
|
|
1531
|
-
var teamSchema =
|
|
1532
|
-
|
|
1699
|
+
var issuedTokenSchema = tokenSchema.extend({ token: z13.string() });
|
|
1700
|
+
var teamSchema = z13.array(
|
|
1701
|
+
z13.object({ id: z13.string(), label: z13.string() })
|
|
1533
1702
|
);
|
|
1534
|
-
var memberLookupSchema =
|
|
1535
|
-
provider:
|
|
1536
|
-
subject:
|
|
1703
|
+
var memberLookupSchema = z13.object({
|
|
1704
|
+
provider: z13.string().min(1).max(200),
|
|
1705
|
+
subject: z13.string().min(1).max(2048)
|
|
1537
1706
|
}).strict();
|
|
1538
|
-
var booleanQuery =
|
|
1539
|
-
|
|
1540
|
-
|
|
1707
|
+
var booleanQuery = z13.union([
|
|
1708
|
+
z13.boolean(),
|
|
1709
|
+
z13.enum(["true", "false"]).transform((v) => v === "true")
|
|
1541
1710
|
]);
|
|
1542
|
-
var managedMemberQuerySchema =
|
|
1543
|
-
q:
|
|
1711
|
+
var managedMemberQuerySchema = z13.strictObject({
|
|
1712
|
+
q: z13.string().max(200).optional(),
|
|
1544
1713
|
needsReview: booleanQuery.optional(),
|
|
1545
|
-
limit:
|
|
1714
|
+
limit: z13.coerce.number().int().min(1).max(100).optional(),
|
|
1546
1715
|
cursor: pageCursorSchema.optional()
|
|
1547
1716
|
});
|
|
1548
|
-
var managedMemberPageSchema =
|
|
1549
|
-
items:
|
|
1550
|
-
total:
|
|
1551
|
-
nextCursor:
|
|
1717
|
+
var managedMemberPageSchema = z13.object({
|
|
1718
|
+
items: z13.array(memberSchema),
|
|
1719
|
+
total: z13.number().int().nonnegative(),
|
|
1720
|
+
nextCursor: z13.string().nullable()
|
|
1552
1721
|
});
|
|
1553
1722
|
var projectMetricsSchema = metricsSchema.extend({
|
|
1554
|
-
completionsByQuest:
|
|
1555
|
-
|
|
1723
|
+
completionsByQuest: z13.array(
|
|
1724
|
+
z13.object({ quest: identifier, completions: z13.number() })
|
|
1556
1725
|
)
|
|
1557
1726
|
});
|
|
1558
|
-
var pageLimit =
|
|
1559
|
-
var managedAttemptQuerySchema =
|
|
1560
|
-
q:
|
|
1561
|
-
status:
|
|
1727
|
+
var pageLimit = z13.coerce.number().int().min(1).max(100).optional();
|
|
1728
|
+
var managedAttemptQuerySchema = z13.strictObject({
|
|
1729
|
+
q: z13.string().max(200).optional(),
|
|
1730
|
+
status: z13.string().min(1).max(50).optional(),
|
|
1562
1731
|
limit: pageLimit,
|
|
1563
1732
|
cursor: pageCursorSchema.optional()
|
|
1564
1733
|
});
|
|
1565
|
-
var managedAttemptPageSchema =
|
|
1566
|
-
items:
|
|
1567
|
-
releases:
|
|
1568
|
-
people:
|
|
1569
|
-
total:
|
|
1570
|
-
nextCursor:
|
|
1734
|
+
var managedAttemptPageSchema = z13.object({
|
|
1735
|
+
items: z13.array(attemptSchema),
|
|
1736
|
+
releases: z13.array(publishedReleaseSchema),
|
|
1737
|
+
people: z13.array(personSchema),
|
|
1738
|
+
total: z13.number().int().nonnegative(),
|
|
1739
|
+
nextCursor: z13.string().nullable()
|
|
1571
1740
|
});
|
|
1572
|
-
var managedReleaseQuerySchema =
|
|
1741
|
+
var managedReleaseQuerySchema = z13.strictObject({
|
|
1573
1742
|
quest: identifier.optional(),
|
|
1574
1743
|
limit: pageLimit,
|
|
1575
1744
|
cursor: pageCursorSchema.optional()
|
|
1576
1745
|
});
|
|
1577
|
-
var managedReleasePageSchema =
|
|
1578
|
-
items:
|
|
1579
|
-
nextCursor:
|
|
1746
|
+
var managedReleasePageSchema = z13.object({
|
|
1747
|
+
items: z13.array(publishedReleaseSchema),
|
|
1748
|
+
nextCursor: z13.string().nullable()
|
|
1580
1749
|
});
|
|
1581
|
-
var managedAttemptSchema =
|
|
1750
|
+
var managedAttemptSchema = z13.object({
|
|
1582
1751
|
attempt: attemptSchema,
|
|
1583
1752
|
release: publishedReleaseSchema.nullable(),
|
|
1584
|
-
events:
|
|
1753
|
+
events: z13.array(eventSchema),
|
|
1585
1754
|
person: personSchema
|
|
1586
1755
|
});
|
|
1587
|
-
var managedEntitlementQuerySchema =
|
|
1588
|
-
q:
|
|
1589
|
-
status:
|
|
1756
|
+
var managedEntitlementQuerySchema = z13.strictObject({
|
|
1757
|
+
q: z13.string().max(200).optional(),
|
|
1758
|
+
status: z13.string().min(1).max(50).optional(),
|
|
1590
1759
|
limit: pageLimit,
|
|
1591
1760
|
cursor: pageCursorSchema.optional()
|
|
1592
1761
|
});
|
|
1593
|
-
var managedEntitlementPageSchema =
|
|
1594
|
-
items:
|
|
1595
|
-
people:
|
|
1596
|
-
total:
|
|
1597
|
-
nextCursor:
|
|
1762
|
+
var managedEntitlementPageSchema = z13.object({
|
|
1763
|
+
items: z13.array(entitlementSchema),
|
|
1764
|
+
people: z13.array(personSchema),
|
|
1765
|
+
total: z13.number().int().nonnegative(),
|
|
1766
|
+
nextCursor: z13.string().nullable()
|
|
1598
1767
|
});
|
|
1599
|
-
var managedEntitlementSchema =
|
|
1768
|
+
var managedEntitlementSchema = z13.object({
|
|
1600
1769
|
entitlement: entitlementSchema,
|
|
1601
1770
|
person: personSchema
|
|
1602
1771
|
});
|
|
1603
1772
|
var managedStockItemSchema = inventorySchema.extend({
|
|
1604
|
-
offers:
|
|
1773
|
+
offers: z13.array(identifier)
|
|
1605
1774
|
});
|
|
1606
|
-
var auditQuerySchema =
|
|
1607
|
-
category:
|
|
1608
|
-
q:
|
|
1775
|
+
var auditQuerySchema = z13.strictObject({
|
|
1776
|
+
category: z13.enum(["reviews", "rewards", "configuration"]).optional(),
|
|
1777
|
+
q: z13.string().max(200).optional(),
|
|
1609
1778
|
limit: pageLimit,
|
|
1610
1779
|
cursor: pageCursorSchema.optional()
|
|
1611
1780
|
});
|
|
1612
1781
|
var accessHistoryQuerySchema = auditQuerySchema.omit({
|
|
1613
1782
|
category: true
|
|
1614
1783
|
});
|
|
1615
|
-
var auditPageSchema =
|
|
1616
|
-
items:
|
|
1617
|
-
total:
|
|
1618
|
-
nextCursor:
|
|
1784
|
+
var auditPageSchema = z13.object({
|
|
1785
|
+
items: z13.array(auditRecordSchema),
|
|
1786
|
+
total: z13.number().int().nonnegative(),
|
|
1787
|
+
nextCursor: z13.string().nullable()
|
|
1619
1788
|
});
|
|
1620
|
-
var verifiedPassSchema =
|
|
1789
|
+
var verifiedPassSchema = z13.object({
|
|
1621
1790
|
provider: identifier,
|
|
1622
1791
|
event: identifier,
|
|
1623
|
-
subject:
|
|
1792
|
+
subject: z13.string().min(1).max(2048),
|
|
1624
1793
|
member: identifier,
|
|
1625
1794
|
quest: identifier
|
|
1626
1795
|
}).strict();
|
|
@@ -1644,7 +1813,7 @@ function clientFailure(error) {
|
|
|
1644
1813
|
return new ManagementError({
|
|
1645
1814
|
kind: "client",
|
|
1646
1815
|
code: ManagementErrorCode.InvalidInput,
|
|
1647
|
-
message: error instanceof
|
|
1816
|
+
message: error instanceof z13.ZodError ? `Invalid management request: ${z13.prettifyError(error)}` : error instanceof Error ? error.message : "Invalid management request",
|
|
1648
1817
|
cause: error
|
|
1649
1818
|
});
|
|
1650
1819
|
}
|
|
@@ -1682,7 +1851,7 @@ function managementClient(options) {
|
|
|
1682
1851
|
call
|
|
1683
1852
|
);
|
|
1684
1853
|
}
|
|
1685
|
-
const ok =
|
|
1854
|
+
const ok = z13.object({ ok: z13.literal(true) });
|
|
1686
1855
|
function pointHistory(member, ledger, query = {}, call) {
|
|
1687
1856
|
return get(
|
|
1688
1857
|
`/points/${identifier.parse(member)}/${identifier.parse(ledger)}/history${queryString(typeof query === "number" ? { before: query } : pageQuerySchema.parse(query))}`,
|
|
@@ -1804,8 +1973,8 @@ function managementClient(options) {
|
|
|
1804
1973
|
}
|
|
1805
1974
|
return exchange(
|
|
1806
1975
|
path,
|
|
1807
|
-
|
|
1808
|
-
status:
|
|
1976
|
+
z13.object({
|
|
1977
|
+
status: z13.number(),
|
|
1809
1978
|
operationId: identifier.optional(),
|
|
1810
1979
|
result: schema
|
|
1811
1980
|
}),
|
|
@@ -1836,7 +2005,7 @@ function managementClient(options) {
|
|
|
1836
2005
|
call
|
|
1837
2006
|
),
|
|
1838
2007
|
...resourceArchiveMethods("tracker"),
|
|
1839
|
-
list: (call) => get("/trackers",
|
|
2008
|
+
list: (call) => get("/trackers", z13.array(trackerStatusSchema), call),
|
|
1840
2009
|
get: (reference, call) => get(
|
|
1841
2010
|
`/trackers/${identifier.parse(reference)}`,
|
|
1842
2011
|
trackerStatusSchema,
|
|
@@ -1952,7 +2121,7 @@ function managementClient(options) {
|
|
|
1952
2121
|
engagementPublishSchema.parse(withActionId(input)),
|
|
1953
2122
|
call
|
|
1954
2123
|
),
|
|
1955
|
-
list: (call) => get("/engagement",
|
|
2124
|
+
list: (call) => get("/engagement", z13.array(engagementRuleSchema), call),
|
|
1956
2125
|
page: (input, call) => get(
|
|
1957
2126
|
"/engagement/history" + queryString(engagementPageQuerySchema.parse(input)),
|
|
1958
2127
|
engagementPageSchema,
|
|
@@ -1971,9 +2140,51 @@ function managementClient(options) {
|
|
|
1971
2140
|
call
|
|
1972
2141
|
)
|
|
1973
2142
|
},
|
|
2143
|
+
badges: {
|
|
2144
|
+
list: (call) => get("/badges", z13.array(managedBadgeSchema), call),
|
|
2145
|
+
create: (input, call) => create("/badges", managedBadgeSchema, createBadgeSchema, input, call),
|
|
2146
|
+
update: (badge, input, call) => {
|
|
2147
|
+
const body = badgePropertiesSchema.extend(badgeMutationSchema.shape).parse(withActionId(input));
|
|
2148
|
+
return post(
|
|
2149
|
+
`/badges/${identifier.parse(badge)}/update`,
|
|
2150
|
+
managedBadgeSchema,
|
|
2151
|
+
body,
|
|
2152
|
+
call
|
|
2153
|
+
);
|
|
2154
|
+
},
|
|
2155
|
+
archive: (badge, input, call) => post(
|
|
2156
|
+
`/badges/${identifier.parse(badge)}/archive`,
|
|
2157
|
+
managedBadgeSchema,
|
|
2158
|
+
badgeMutationSchema.parse(withActionId(input)),
|
|
2159
|
+
call
|
|
2160
|
+
),
|
|
2161
|
+
unarchive: (badge, input, call) => post(
|
|
2162
|
+
`/badges/${identifier.parse(badge)}/unarchive`,
|
|
2163
|
+
managedBadgeSchema,
|
|
2164
|
+
badgeMutationSchema.parse(withActionId(input)),
|
|
2165
|
+
call
|
|
2166
|
+
),
|
|
2167
|
+
member: (member, call) => get(
|
|
2168
|
+
`/members/${identifier.parse(member)}/badges`,
|
|
2169
|
+
memberBadgesSchema,
|
|
2170
|
+
call
|
|
2171
|
+
),
|
|
2172
|
+
award: (member, badge, input, call) => post(
|
|
2173
|
+
`/members/${identifier.parse(member)}/badges/${identifier.parse(badge)}/award`,
|
|
2174
|
+
badgeMutationResultSchema,
|
|
2175
|
+
badgeMutationSchema.parse(withActionId(input)),
|
|
2176
|
+
call
|
|
2177
|
+
),
|
|
2178
|
+
revoke: (member, badge, input, call) => post(
|
|
2179
|
+
`/members/${identifier.parse(member)}/badges/${identifier.parse(badge)}/revoke`,
|
|
2180
|
+
badgeMutationResultSchema,
|
|
2181
|
+
badgeMutationSchema.parse(withActionId(input)),
|
|
2182
|
+
call
|
|
2183
|
+
)
|
|
2184
|
+
},
|
|
1974
2185
|
pointLedgers: {
|
|
1975
2186
|
unarchive: (ledger, input, call) => archiveResource("point-ledger", ledger, false, input, call),
|
|
1976
|
-
list: (call) => get("/point-ledgers",
|
|
2187
|
+
list: (call) => get("/point-ledgers", z13.array(managedPointLedgerSchema), call),
|
|
1977
2188
|
/**
|
|
1978
2189
|
* Creates a point ledger, with a stable `key` when code refers to it; requires `publish`. In
|
|
1979
2190
|
* live, only a person in Console can create one.
|
|
@@ -2003,7 +2214,7 @@ function managementClient(options) {
|
|
|
2003
2214
|
},
|
|
2004
2215
|
points: {
|
|
2005
2216
|
/** @deprecated Use `pointLedgers.list()`, which reads the same ledgers. Removed in 2.0.0. */
|
|
2006
|
-
ledgers: (call) => get("/point-ledgers",
|
|
2217
|
+
ledgers: (call) => get("/point-ledgers", z13.array(managedPointLedgerSchema), call),
|
|
2007
2218
|
/** @deprecated Use `pointLedgers.create(input)`. Removed in 2.0.0. */
|
|
2008
2219
|
createLedger: createPointLedger,
|
|
2009
2220
|
/**
|
|
@@ -2041,7 +2252,7 @@ function managementClient(options) {
|
|
|
2041
2252
|
referralHistorySchema,
|
|
2042
2253
|
call
|
|
2043
2254
|
),
|
|
2044
|
-
list: (call) => get("/referrals",
|
|
2255
|
+
list: (call) => get("/referrals", z13.array(publishedReferralSchema), call),
|
|
2045
2256
|
participants: referralParticipants,
|
|
2046
2257
|
/**
|
|
2047
2258
|
* Suspends or restores a member's referral relationship, with a reason; requires `publish`.
|
|
@@ -2104,7 +2315,7 @@ function managementClient(options) {
|
|
|
2104
2315
|
},
|
|
2105
2316
|
leaderboards: {
|
|
2106
2317
|
...resourceArchiveMethods("leaderboard"),
|
|
2107
|
-
list: (call) => get("/leaderboards",
|
|
2318
|
+
list: (call) => get("/leaderboards", z13.array(publishedLeaderboardSchema), call),
|
|
2108
2319
|
standings: (board, input = {}, call) => {
|
|
2109
2320
|
const query = leaderboardQuerySchema.parse(input);
|
|
2110
2321
|
return get(
|
|
@@ -2118,12 +2329,12 @@ function managementClient(options) {
|
|
|
2118
2329
|
},
|
|
2119
2330
|
history: (board, call) => get(
|
|
2120
2331
|
`/leaderboards/${identifier.parse(board)}/history`,
|
|
2121
|
-
|
|
2332
|
+
z13.array(publishedLeaderboardSchema),
|
|
2122
2333
|
call
|
|
2123
2334
|
),
|
|
2124
2335
|
exclusions: (board, call) => get(
|
|
2125
2336
|
`/leaderboards/${identifier.parse(board)}/exclusions`,
|
|
2126
|
-
|
|
2337
|
+
z13.array(z13.object({ member: identifier })),
|
|
2127
2338
|
call
|
|
2128
2339
|
),
|
|
2129
2340
|
exclude: (board, input, call) => post(
|
|
@@ -2164,7 +2375,7 @@ function managementClient(options) {
|
|
|
2164
2375
|
),
|
|
2165
2376
|
settlements: (board, call) => get(
|
|
2166
2377
|
`/leaderboards/${identifier.parse(board)}/settlements`,
|
|
2167
|
-
|
|
2378
|
+
z13.array(leaderboardSettlementSummarySchema),
|
|
2168
2379
|
call
|
|
2169
2380
|
),
|
|
2170
2381
|
settlement: (settlement, call) => get(
|
|
@@ -2244,7 +2455,7 @@ function managementClient(options) {
|
|
|
2244
2455
|
)
|
|
2245
2456
|
},
|
|
2246
2457
|
deployments: {
|
|
2247
|
-
list: (call) => get("/deployments",
|
|
2458
|
+
list: (call) => get("/deployments", z13.array(deploymentRecordSchema), call),
|
|
2248
2459
|
get: (deployment, call) => get(
|
|
2249
2460
|
`/deployments/${identifier.parse(deployment)}`,
|
|
2250
2461
|
deploymentRecordSchema,
|
|
@@ -2513,7 +2724,7 @@ function managementClient(options) {
|
|
|
2513
2724
|
},
|
|
2514
2725
|
operations: {
|
|
2515
2726
|
/** Every paused or resumed operation: redemptions and each quest's participation; requires `read`. */
|
|
2516
|
-
list: (call) => get("/operations",
|
|
2727
|
+
list: (call) => get("/operations", z13.array(operationSchema), call),
|
|
2517
2728
|
/**
|
|
2518
2729
|
* Pauses or resumes redemptions or one quest's participation, against the `revision` the
|
|
2519
2730
|
* operator saw, with a reason; requires `publish` permission.
|
|
@@ -2562,7 +2773,7 @@ function managementClient(options) {
|
|
|
2562
2773
|
call
|
|
2563
2774
|
),
|
|
2564
2775
|
/** Every stock item with its counts and the offers that sell it; requires `read` permission. */
|
|
2565
|
-
list: (call) => get("/stock-items",
|
|
2776
|
+
list: (call) => get("/stock-items", z13.array(managedStockItemSchema), call),
|
|
2566
2777
|
createItem: (input, call) => create(
|
|
2567
2778
|
"/stock-items",
|
|
2568
2779
|
stockItemSchema,
|
|
@@ -2577,7 +2788,7 @@ function managementClient(options) {
|
|
|
2577
2788
|
stockInputSchema.parse(withActionId(input)),
|
|
2578
2789
|
call
|
|
2579
2790
|
),
|
|
2580
|
-
catalog: (call) => get("/pickup-inventory",
|
|
2791
|
+
catalog: (call) => get("/pickup-inventory", z13.array(pickupCatalogSchema), call),
|
|
2581
2792
|
configure: (input, call) => post(
|
|
2582
2793
|
"/pickup-inventory",
|
|
2583
2794
|
pickupCatalogSchema,
|
|
@@ -2603,10 +2814,10 @@ function managementClient(options) {
|
|
|
2603
2814
|
offerControlSchema.omit({ enabled: true }).parse(withActionId(input)),
|
|
2604
2815
|
call
|
|
2605
2816
|
),
|
|
2606
|
-
list: (call) => get("/offers",
|
|
2817
|
+
list: (call) => get("/offers", z13.array(offerSchema), call),
|
|
2607
2818
|
redemptions: (input = {}, call) => get(
|
|
2608
2819
|
`/redemptions${queryString({ member: input.member })}`,
|
|
2609
|
-
|
|
2820
|
+
z13.array(redemptionSchema),
|
|
2610
2821
|
call
|
|
2611
2822
|
),
|
|
2612
2823
|
/** Pauses or resumes an offer at the revision the operator saw. */
|
|
@@ -2655,7 +2866,7 @@ function managementClient(options) {
|
|
|
2655
2866
|
* them; API keys and project-scoped playground sessions cannot.
|
|
2656
2867
|
*/
|
|
2657
2868
|
tokens: {
|
|
2658
|
-
list: (call) => get("/tokens",
|
|
2869
|
+
list: (call) => get("/tokens", z13.array(tokenSchema), call),
|
|
2659
2870
|
/**
|
|
2660
2871
|
* Issues a key for one project and environment, limited to permissions the caller holds
|
|
2661
2872
|
* there. The secret `token` is in this response only.
|
|
@@ -2663,14 +2874,14 @@ function managementClient(options) {
|
|
|
2663
2874
|
create: (input, call) => post("/tokens", issuedTokenSchema, tokenInputSchema.parse(input), call),
|
|
2664
2875
|
/** Replace a personal key's ingestion restriction without changing its secret. */
|
|
2665
2876
|
scope: (id, input, call) => request(
|
|
2666
|
-
`/tokens/${encodeURIComponent(
|
|
2877
|
+
`/tokens/${encodeURIComponent(z13.string().min(1).parse(id))}/scope`,
|
|
2667
2878
|
tokenSchema,
|
|
2668
2879
|
tokenScopeInputSchema.parse(input),
|
|
2669
2880
|
"PUT",
|
|
2670
2881
|
call
|
|
2671
2882
|
),
|
|
2672
2883
|
revoke: (id, call) => request(
|
|
2673
|
-
`/tokens/${encodeURIComponent(
|
|
2884
|
+
`/tokens/${encodeURIComponent(z13.string().min(1).parse(id))}`,
|
|
2674
2885
|
ok,
|
|
2675
2886
|
void 0,
|
|
2676
2887
|
"DELETE",
|
|
@@ -2679,7 +2890,7 @@ function managementClient(options) {
|
|
|
2679
2890
|
},
|
|
2680
2891
|
/** Who holds which roles on the client's project; organization administrators only. */
|
|
2681
2892
|
grants: {
|
|
2682
|
-
list: (call) => get("/grants",
|
|
2893
|
+
list: (call) => get("/grants", z13.array(grantRecordSchema), call),
|
|
2683
2894
|
/** Replaces one person's roles and environments on the project. The audit log records it. */
|
|
2684
2895
|
set: (input, call) => request(
|
|
2685
2896
|
"/grants",
|
|
@@ -2696,7 +2907,7 @@ function managementClient(options) {
|
|
|
2696
2907
|
/** Signed activity notifications for one project/environment; writes require publish permission. */
|
|
2697
2908
|
webhooks: {
|
|
2698
2909
|
state: (id, call) => get(
|
|
2699
|
-
`/webhooks/${
|
|
2910
|
+
`/webhooks/${z13.string().uuid().parse(id)}/state`,
|
|
2700
2911
|
webhookEndpointStateSchema,
|
|
2701
2912
|
call
|
|
2702
2913
|
),
|
|
@@ -2707,24 +2918,24 @@ function managementClient(options) {
|
|
|
2707
2918
|
call
|
|
2708
2919
|
),
|
|
2709
2920
|
delete: (id, input, call) => post(
|
|
2710
|
-
`/webhooks/${
|
|
2921
|
+
`/webhooks/${z13.string().uuid().parse(id)}/delete`,
|
|
2711
2922
|
webhookEndpointStateSchema,
|
|
2712
2923
|
webhookDeleteInputSchema.parse(withActionId(input)),
|
|
2713
2924
|
call
|
|
2714
2925
|
),
|
|
2715
2926
|
pause: (id, input = {}, call) => post(
|
|
2716
|
-
`/webhooks/${
|
|
2927
|
+
`/webhooks/${z13.string().uuid().parse(id)}/pause`,
|
|
2717
2928
|
webhookEndpointSchema,
|
|
2718
2929
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
2719
2930
|
call
|
|
2720
2931
|
),
|
|
2721
2932
|
resume: (id, input = {}, call) => post(
|
|
2722
|
-
`/webhooks/${
|
|
2933
|
+
`/webhooks/${z13.string().uuid().parse(id)}/resume`,
|
|
2723
2934
|
webhookEndpointSchema,
|
|
2724
2935
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
2725
2936
|
call
|
|
2726
2937
|
),
|
|
2727
|
-
list: (call) => get("/webhooks",
|
|
2938
|
+
list: (call) => get("/webhooks", z13.array(webhookEndpointSchema), call),
|
|
2728
2939
|
create: (input, call) => post(
|
|
2729
2940
|
"/webhooks",
|
|
2730
2941
|
webhookSecretSchema,
|
|
@@ -2732,7 +2943,7 @@ function managementClient(options) {
|
|
|
2732
2943
|
call
|
|
2733
2944
|
),
|
|
2734
2945
|
update: (id, input, call) => request(
|
|
2735
|
-
`/webhooks/${
|
|
2946
|
+
`/webhooks/${z13.string().uuid().parse(id)}`,
|
|
2736
2947
|
webhookEndpointSchema,
|
|
2737
2948
|
webhookUpdateSchema.parse(input),
|
|
2738
2949
|
"PUT",
|
|
@@ -2740,24 +2951,24 @@ function managementClient(options) {
|
|
|
2740
2951
|
),
|
|
2741
2952
|
/** @deprecated Use pause. Removed in 2.0.0. */
|
|
2742
2953
|
disable: (id, call) => post(
|
|
2743
|
-
`/webhooks/${
|
|
2954
|
+
`/webhooks/${z13.string().uuid().parse(id)}/disable`,
|
|
2744
2955
|
webhookEndpointSchema,
|
|
2745
2956
|
{},
|
|
2746
2957
|
call
|
|
2747
2958
|
),
|
|
2748
2959
|
rotateSecret: (id, call) => post(
|
|
2749
|
-
`/webhooks/${
|
|
2960
|
+
`/webhooks/${z13.string().uuid().parse(id)}/rotate-secret`,
|
|
2750
2961
|
webhookSecretSchema,
|
|
2751
2962
|
{},
|
|
2752
2963
|
call
|
|
2753
2964
|
),
|
|
2754
2965
|
deliveries: (id, query = {}, call) => get(
|
|
2755
|
-
`/webhooks/${
|
|
2966
|
+
`/webhooks/${z13.string().uuid().parse(id)}/deliveries${queryString(webhookQuerySchema.parse(query))}`,
|
|
2756
2967
|
webhookDeliveryPageSchema,
|
|
2757
2968
|
call
|
|
2758
2969
|
),
|
|
2759
2970
|
replay: (id, delivery, call) => post(
|
|
2760
|
-
`/webhooks/${
|
|
2971
|
+
`/webhooks/${z13.string().uuid().parse(id)}/deliveries/${z13.string().uuid().parse(delivery)}/replay`,
|
|
2761
2972
|
webhookDeliverySchema,
|
|
2762
2973
|
{},
|
|
2763
2974
|
call
|
|
@@ -2768,7 +2979,7 @@ function managementClient(options) {
|
|
|
2768
2979
|
* environment. Organization administrators, from a Console session only.
|
|
2769
2980
|
*/
|
|
2770
2981
|
identityIntegrations: {
|
|
2771
|
-
list: (call) => get("/identity-integrations",
|
|
2982
|
+
list: (call) => get("/identity-integrations", z13.array(identityIntegrationSchema), call),
|
|
2772
2983
|
/** The secret `token` is in this response only. */
|
|
2773
2984
|
create: (input, call) => post(
|
|
2774
2985
|
"/identity-integrations",
|
|
@@ -2778,7 +2989,7 @@ function managementClient(options) {
|
|
|
2778
2989
|
),
|
|
2779
2990
|
/** Replaces the key's secret and extends it by 90 days; the old secret stops working. */
|
|
2780
2991
|
rotate: (id, call) => post(
|
|
2781
|
-
`/identity-integrations/${
|
|
2992
|
+
`/identity-integrations/${z13.string().uuid().parse(id)}/rotate`,
|
|
2782
2993
|
identityIntegrationSecretSchema,
|
|
2783
2994
|
{},
|
|
2784
2995
|
call
|
|
@@ -2790,7 +3001,7 @@ function managementClient(options) {
|
|
|
2790
3001
|
*/
|
|
2791
3002
|
kinds: (call) => get(
|
|
2792
3003
|
"/identity-integrations/kinds",
|
|
2793
|
-
|
|
3004
|
+
z13.array(identityKindClaimSchema),
|
|
2794
3005
|
call
|
|
2795
3006
|
),
|
|
2796
3007
|
/**
|
|
@@ -2798,8 +3009,8 @@ function managementClient(options) {
|
|
|
2798
3009
|
* and keep attributing tracker records; unlink them on the member to stop that.
|
|
2799
3010
|
*/
|
|
2800
3011
|
revoke: (id, call) => request(
|
|
2801
|
-
`/identity-integrations/${
|
|
2802
|
-
|
|
3012
|
+
`/identity-integrations/${z13.string().uuid().parse(id)}`,
|
|
3013
|
+
z13.null(),
|
|
2803
3014
|
void 0,
|
|
2804
3015
|
"DELETE",
|
|
2805
3016
|
call
|
|
@@ -2850,7 +3061,7 @@ function managementClient(options) {
|
|
|
2850
3061
|
resources: {
|
|
2851
3062
|
list: (call) => get(
|
|
2852
3063
|
"/resources",
|
|
2853
|
-
|
|
3064
|
+
z13.object({ resources: z13.array(managedResourceSchema) }),
|
|
2854
3065
|
call
|
|
2855
3066
|
),
|
|
2856
3067
|
/** @deprecated Use the resource archive/unarchive methods. Removed in 2.0.0. */
|
|
@@ -2887,7 +3098,7 @@ function managementClient(options) {
|
|
|
2887
3098
|
testMemberCreateSchema.parse(withActionId(input)),
|
|
2888
3099
|
call
|
|
2889
3100
|
),
|
|
2890
|
-
list: (call) => get("/test-members",
|
|
3101
|
+
list: (call) => get("/test-members", z13.array(testMemberSchema), call),
|
|
2891
3102
|
history: (member, query = {}, call) => get(
|
|
2892
3103
|
`/test-members/${identifier.parse(member)}/history${queryString(testMemberHistoryQuerySchema.parse(query))}`,
|
|
2893
3104
|
testMemberHistorySchema,
|
|
@@ -2969,26 +3180,26 @@ function managementClient(options) {
|
|
|
2969
3180
|
/** Who each member is: up to 100 distinct IDs; unknown IDs come back without accounts. */
|
|
2970
3181
|
people: (members, call) => get(
|
|
2971
3182
|
`/people${queryString({ ids: members.join(",") })}`,
|
|
2972
|
-
|
|
3183
|
+
z13.array(personSchema),
|
|
2973
3184
|
call
|
|
2974
3185
|
),
|
|
2975
3186
|
/** Current X and Discord quest account selections; requires read permission. */
|
|
2976
3187
|
oauthAccounts: (member, call) => get(
|
|
2977
3188
|
`/members/${encodeURIComponent(member)}/oauth-accounts`,
|
|
2978
|
-
|
|
3189
|
+
z13.array(managedOAuthAccountSchema),
|
|
2979
3190
|
call
|
|
2980
3191
|
),
|
|
2981
3192
|
/** Unlinks the reviewed selection across this organization/environment, preserving ownership and sign-in. */
|
|
2982
3193
|
unlinkOAuthAccount: (member, input, call) => post(
|
|
2983
3194
|
`/members/${encodeURIComponent(member)}/oauth-accounts/unlink`,
|
|
2984
|
-
|
|
3195
|
+
z13.array(managedOAuthAccountSchema),
|
|
2985
3196
|
memberOAuthUnlinkInputSchema.parse(input),
|
|
2986
3197
|
call
|
|
2987
3198
|
),
|
|
2988
3199
|
/** Unlinks a member's wallet from the project with a reason; requires `review` permission. The address stays bound to the member. */
|
|
2989
3200
|
unlinkWallet: (member, input, call) => post(
|
|
2990
3201
|
`/members/${encodeURIComponent(member)}/wallets/unlink`,
|
|
2991
|
-
|
|
3202
|
+
z13.array(managedWalletSchema),
|
|
2992
3203
|
memberWalletUnlinkInputSchema.parse(input),
|
|
2993
3204
|
call
|
|
2994
3205
|
),
|
|
@@ -2999,14 +3210,14 @@ function managementClient(options) {
|
|
|
2999
3210
|
*/
|
|
3000
3211
|
unlinkIdentity: (member, input, call) => post(
|
|
3001
3212
|
`/members/${encodeURIComponent(member)}/identities/unlink`,
|
|
3002
|
-
|
|
3213
|
+
z13.array(managedMemberIdentitySchema),
|
|
3003
3214
|
memberIdentityChangeInputSchema.parse(input),
|
|
3004
3215
|
call
|
|
3005
3216
|
),
|
|
3006
3217
|
/** Relinks an `app:<name>` identity an operator unlinked from this member, with a reason; requires `review` permission. */
|
|
3007
3218
|
relinkIdentity: (member, input, call) => post(
|
|
3008
3219
|
`/members/${encodeURIComponent(member)}/identities/relink`,
|
|
3009
|
-
|
|
3220
|
+
z13.array(managedMemberIdentitySchema),
|
|
3010
3221
|
memberIdentityChangeInputSchema.parse(input),
|
|
3011
3222
|
call
|
|
3012
3223
|
),
|
|
@@ -3016,7 +3227,7 @@ function managementClient(options) {
|
|
|
3016
3227
|
*/
|
|
3017
3228
|
setWalletSignIn: (member, input, call) => post(
|
|
3018
3229
|
`/members/${encodeURIComponent(member)}/wallets/sign-in`,
|
|
3019
|
-
|
|
3230
|
+
z13.array(managedWalletSchema),
|
|
3020
3231
|
memberWalletSignInInputSchema.parse(input),
|
|
3021
3232
|
call
|
|
3022
3233
|
)
|
|
@@ -3043,6 +3254,28 @@ function managementClient(options) {
|
|
|
3043
3254
|
* deleting a store need `publish`. Reads never change data, and only a store no serving build
|
|
3044
3255
|
* declares can be deleted.
|
|
3045
3256
|
*/
|
|
3257
|
+
schedules: {
|
|
3258
|
+
list: (call) => get("/schedules", appScheduleListSchema, call),
|
|
3259
|
+
run: (name, call) => post(
|
|
3260
|
+
`/schedules/${appScheduleNameSchema.parse(name)}/run`,
|
|
3261
|
+
appScheduleListSchema,
|
|
3262
|
+
{},
|
|
3263
|
+
call
|
|
3264
|
+
),
|
|
3265
|
+
setState: (state2, call) => request(
|
|
3266
|
+
"/schedules/state",
|
|
3267
|
+
appScheduleListSchema,
|
|
3268
|
+
{ state: appScheduleStateSchema.parse(state2) },
|
|
3269
|
+
"PUT",
|
|
3270
|
+
call
|
|
3271
|
+
),
|
|
3272
|
+
recover: (name, input, call) => post(
|
|
3273
|
+
`/schedules/${appScheduleNameSchema.parse(name)}/recover`,
|
|
3274
|
+
appScheduleListSchema,
|
|
3275
|
+
input,
|
|
3276
|
+
call
|
|
3277
|
+
)
|
|
3278
|
+
},
|
|
3046
3279
|
storage: {
|
|
3047
3280
|
list: (call) => get("/storage", appStorageListSchema, call),
|
|
3048
3281
|
/** A SQL store's tables and views, without SQLite's and D1's own. */
|
|
@@ -3166,7 +3399,7 @@ function managementClient(options) {
|
|
|
3166
3399
|
* Each quest's current release, the most recently published first, archived quests
|
|
3167
3400
|
* included; requires `read` permission.
|
|
3168
3401
|
*/
|
|
3169
|
-
list: (call) => get("/quests/list",
|
|
3402
|
+
list: (call) => get("/quests/list", z13.array(publishedReleaseSchema), call),
|
|
3170
3403
|
/** Pending and exhausted asynchronous balance checks. Requires read. */
|
|
3171
3404
|
automaticScheduling: (query = {}, call) => get(
|
|
3172
3405
|
`/quests/automatic-scheduling${queryString(automaticSchedulingQuerySchema.parse(query))}`,
|
|
@@ -3267,6 +3500,15 @@ function managementClient(options) {
|
|
|
3267
3500
|
});
|
|
3268
3501
|
}
|
|
3269
3502
|
var managementResponseSchemas = lazyResponseReaders({
|
|
3503
|
+
get managedBadgeSchema() {
|
|
3504
|
+
return knownResponse(managedBadgeSchema);
|
|
3505
|
+
},
|
|
3506
|
+
get memberBadgesSchema() {
|
|
3507
|
+
return knownResponse(memberBadgesSchema);
|
|
3508
|
+
},
|
|
3509
|
+
get badgeMutationResultSchema() {
|
|
3510
|
+
return knownResponse(badgeMutationResultSchema);
|
|
3511
|
+
},
|
|
3270
3512
|
get memberIdentityLinkPageSchema() {
|
|
3271
3513
|
return knownResponse(memberIdentityLinkPageSchema);
|
|
3272
3514
|
},
|
|
@@ -3644,6 +3886,9 @@ var managementResponseSchemas = lazyResponseReaders({
|
|
|
3644
3886
|
}
|
|
3645
3887
|
});
|
|
3646
3888
|
var managementResponses = {
|
|
3889
|
+
managedBadgeSchema: responseSchema(managedBadgeSchema),
|
|
3890
|
+
memberBadgesSchema: responseSchema(memberBadgesSchema),
|
|
3891
|
+
badgeMutationResultSchema: responseSchema(badgeMutationResultSchema),
|
|
3647
3892
|
memberIdentityLinkPageSchema: responseSchema(memberIdentityLinkPageSchema),
|
|
3648
3893
|
managedQuestEnrollmentPageSchema: responseSchema(
|
|
3649
3894
|
managedQuestEnrollmentPageSchema
|
|
@@ -3795,6 +4040,9 @@ export {
|
|
|
3795
4040
|
APP_MIGRATION_FILE_BYTES,
|
|
3796
4041
|
APP_MIGRATION_LIMIT,
|
|
3797
4042
|
APP_MIGRATION_TOTAL_BYTES,
|
|
4043
|
+
APP_SCHEDULE_LIMIT,
|
|
4044
|
+
APP_SCHEDULE_MIN_INTERVAL,
|
|
4045
|
+
APP_SCHEDULE_TIMEOUT,
|
|
3798
4046
|
APP_SECRET_LIMIT,
|
|
3799
4047
|
APP_SQL_LIMIT,
|
|
3800
4048
|
APP_STORAGE_PREVIEW_CHARACTERS,
|
|
@@ -3817,6 +4065,13 @@ export {
|
|
|
3817
4065
|
addGroupMemberSchema,
|
|
3818
4066
|
appMigrationNameSchema,
|
|
3819
4067
|
appRoutingSchema,
|
|
4068
|
+
appScheduleListSchema,
|
|
4069
|
+
appScheduleNameSchema,
|
|
4070
|
+
appSchedulePathSchema,
|
|
4071
|
+
appScheduleRunSchema,
|
|
4072
|
+
appScheduleSchema,
|
|
4073
|
+
appScheduleStateSchema,
|
|
4074
|
+
appSchedulesSchema,
|
|
3820
4075
|
appSecretDeclarationSchema,
|
|
3821
4076
|
appSecretDeclarationsSchema,
|
|
3822
4077
|
appSecretInputSchema,
|
|
@@ -3934,6 +4189,7 @@ export {
|
|
|
3934
4189
|
memberWalletSignInInputSchema,
|
|
3935
4190
|
memberWalletUnlinkInputSchema,
|
|
3936
4191
|
metricsSchema,
|
|
4192
|
+
nextScheduleRun,
|
|
3937
4193
|
oauthIdentitySelectorSchema,
|
|
3938
4194
|
operationInputSchema,
|
|
3939
4195
|
operationSchema,
|
|
@@ -3978,6 +4234,7 @@ export {
|
|
|
3978
4234
|
resourceLifecycleResultSchema,
|
|
3979
4235
|
rolePermissions,
|
|
3980
4236
|
roleSchema,
|
|
4237
|
+
scheduledInvocationSchema,
|
|
3981
4238
|
sequenceCursorSchema,
|
|
3982
4239
|
sourceDataSchema,
|
|
3983
4240
|
sourceRoles,
|
|
@@ -4013,6 +4270,7 @@ export {
|
|
|
4013
4270
|
updateGroupSchema,
|
|
4014
4271
|
validateQuestShape,
|
|
4015
4272
|
verifiedPassSchema,
|
|
4273
|
+
verifyScheduledRequest,
|
|
4016
4274
|
verifyWebhook,
|
|
4017
4275
|
walletBalanceChainsSchema,
|
|
4018
4276
|
walletIdentitySelectorSchema,
|