@domino-sdk/relay 1.14.0 → 1.16.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/{request-error-D_dUPLwo.d.ts → action-DBzILFx9.d.ts} +31 -1
- package/dist/{attempt-captures-DZldPZJc.d.ts → attempt-captures-DHwIVoRP.d.ts} +1 -1
- package/dist/authoring.d.ts +8 -8
- package/dist/{automatic-outcomes-6lJGnSDe.d.ts → automatic-outcomes-BcEn_L46.d.ts} +1 -1
- package/dist/browser.d.ts +7 -8
- package/dist/browser.js +3 -3
- package/dist/{chunk-6DD7DVNQ.js → chunk-3YCCHTCU.js} +1 -1
- package/dist/{chunk-5TS3OAWS.js → chunk-NM3IYYPG.js} +27 -12
- package/dist/{chunk-VBHFJH3P.js → chunk-Y6SRF54G.js} +1 -1
- package/dist/{chunk-C3CB4WIQ.js → chunk-YT3QKV2L.js} +1 -1
- package/dist/{client-BTd_CyX3.d.ts → client-DFSCmf3H.d.ts} +5 -6
- package/dist/{activity-D_R3J-gU.d.ts → deployments-DIbKJO_Y.d.ts} +15 -15
- package/dist/{groups-4Jb3uYFO.d.ts → groups-Bi7lc54m.d.ts} +1 -1
- package/dist/{images-D5kpqHxv.d.ts → images-Cb8QHGjn.d.ts} +1 -1
- package/dist/index.d.ts +8 -9
- package/dist/index.js +2 -2
- package/dist/internal.d.ts +13 -33
- package/dist/internal.js +2 -2
- package/dist/{offers-BFI5t-e-.d.ts → offers-Catj06u7.d.ts} +2 -2
- package/dist/{pages-nIoMT9J3.d.ts → pages-CpYt56Km.d.ts} +1 -1
- package/dist/portal-proxy.js +1 -1
- package/dist/react/index.d.ts +9 -10
- package/dist/react/index.js +3 -3
- package/dist/{schema-K-Pg5lPz.d.ts → schema-BaVl2VBS.d.ts} +1 -1
- package/dist/schema.d.ts +11 -11
- package/dist/server/index.d.ts +12 -73085
- package/dist/server/index.js +719 -519
- package/dist/{sign-in-options-DBjMzgnu.d.ts → sign-in-options-CU1ND6-y.d.ts} +1 -1
- package/dist/{submission-input-CPIsJt-_.d.ts → submission-input-Bi4HipqI.d.ts} +2 -2
- package/dist/testing.d.ts +3 -3
- package/dist/transport-BdrcbKi_.d.ts +73612 -0
- package/package.json +2 -1
- package/dist/action-9Xl0StBg.d.ts +0 -33
- package/dist/referral-reward-kinds-DnvQXL8L.d.ts +0 -268
package/dist/server/index.js
CHANGED
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
participantExchangeSchema,
|
|
45
45
|
questConfiguration,
|
|
46
46
|
sequenceCursorSchema
|
|
47
|
-
} from "../chunk-
|
|
47
|
+
} from "../chunk-NM3IYYPG.js";
|
|
48
48
|
import {
|
|
49
49
|
parseImageExtraction,
|
|
50
50
|
parseImageResult
|
|
@@ -139,7 +139,7 @@ import {
|
|
|
139
139
|
} from "../chunk-2UAVZCMH.js";
|
|
140
140
|
import "../chunk-6QJ3LADK.js";
|
|
141
141
|
import "../chunk-NPGENI7K.js";
|
|
142
|
-
import "../chunk-
|
|
142
|
+
import "../chunk-YT3QKV2L.js";
|
|
143
143
|
import "../chunk-PT5STHFH.js";
|
|
144
144
|
import {
|
|
145
145
|
CompletionSourceKind,
|
|
@@ -557,13 +557,177 @@ var resourceArchiveInputSchema = resourceLifecycleInputSchema.omit({
|
|
|
557
557
|
});
|
|
558
558
|
|
|
559
559
|
// src/server/index.ts
|
|
560
|
-
import { z as
|
|
560
|
+
import { z as z13 } from "zod";
|
|
561
561
|
|
|
562
562
|
// src/server/hosting.ts
|
|
563
|
-
import { z as
|
|
563
|
+
import { z as z10 } from "zod";
|
|
564
564
|
|
|
565
|
-
// src/server/
|
|
565
|
+
// src/server/schedules.ts
|
|
566
566
|
import { z as z8 } from "zod";
|
|
567
|
+
import { Cron } from "croner";
|
|
568
|
+
var APP_SCHEDULE_LIMIT = 10;
|
|
569
|
+
var APP_SCHEDULE_MIN_INTERVAL = 3e5;
|
|
570
|
+
var APP_SCHEDULE_TIMEOUT = 3e4;
|
|
571
|
+
var appScheduleNameSchema = z8.string().regex(/^[a-z][a-z0-9-]{0,63}$/);
|
|
572
|
+
var appSchedulePathSchema = z8.string().min(2).max(512).refine((path) => {
|
|
573
|
+
if (!/^\/[a-zA-Z0-9_/-]+$/.test(path) || path.startsWith("//")) {
|
|
574
|
+
return false;
|
|
575
|
+
}
|
|
576
|
+
return path.split("/").slice(1).every((part) => part.length > 0) && new URL(path, "https://app.invalid").pathname === path;
|
|
577
|
+
}, "Expected an absolute route path without a query or hidden segments");
|
|
578
|
+
function interval(value) {
|
|
579
|
+
const amount = Number(value.slice(0, -1));
|
|
580
|
+
const unit = value.slice(-1);
|
|
581
|
+
return amount * (unit === "m" ? 6e4 : unit === "h" ? 36e5 : 864e5);
|
|
582
|
+
}
|
|
583
|
+
var everySchema = z8.string().regex(/^[1-9]\d{0,3}[mhd]$/).refine(
|
|
584
|
+
(value) => interval(value) >= APP_SCHEDULE_MIN_INTERVAL && interval(value) <= 365 * 864e5,
|
|
585
|
+
"Use an interval from 5 minutes to 365 days, such as 5m, 1h or 1d"
|
|
586
|
+
);
|
|
587
|
+
var cronSchema = z8.string().max(120).refine((value) => {
|
|
588
|
+
const fields = value.trim().split(/\s+/);
|
|
589
|
+
if (fields.length !== 5 || fields.some((field) => !/^[\d*,/-]+$/.test(field))) {
|
|
590
|
+
return false;
|
|
591
|
+
}
|
|
592
|
+
try {
|
|
593
|
+
const job = new Cron(value, { paused: true, timezone: "UTC" });
|
|
594
|
+
if (!job.nextRun()) {
|
|
595
|
+
return false;
|
|
596
|
+
}
|
|
597
|
+
const minutes = new Cron(`${fields[0]} * * * *`, {
|
|
598
|
+
paused: true,
|
|
599
|
+
timezone: "UTC"
|
|
600
|
+
});
|
|
601
|
+
const times = minutes.nextRuns(13, /* @__PURE__ */ new Date("2024-01-01T00:00:00Z"));
|
|
602
|
+
return times.every(
|
|
603
|
+
(time, i) => i === 0 || time.getTime() - times[i - 1].getTime() >= APP_SCHEDULE_MIN_INTERVAL
|
|
604
|
+
);
|
|
605
|
+
} catch {
|
|
606
|
+
return false;
|
|
607
|
+
}
|
|
608
|
+
}, "Expected a five-field UTC cron expression with minute slots at least five minutes apart");
|
|
609
|
+
var declaration = {
|
|
610
|
+
name: appScheduleNameSchema,
|
|
611
|
+
path: appSchedulePathSchema,
|
|
612
|
+
description: z8.string().min(1).max(500)
|
|
613
|
+
};
|
|
614
|
+
var everySchedule = z8.object({ ...declaration, every: everySchema });
|
|
615
|
+
var cronSchedule = z8.object({ ...declaration, cron: cronSchema });
|
|
616
|
+
var appScheduleSchema = z8.union([
|
|
617
|
+
everySchedule.strict(),
|
|
618
|
+
cronSchedule.strict()
|
|
619
|
+
]);
|
|
620
|
+
var appSchedulesSchema = z8.array(appScheduleSchema).max(APP_SCHEDULE_LIMIT).refine(
|
|
621
|
+
(items) => new Set(items.map((item) => item.name)).size === items.length,
|
|
622
|
+
"Schedule names must be unique"
|
|
623
|
+
);
|
|
624
|
+
function nextScheduleRun(schedule, after) {
|
|
625
|
+
if ("every" in schedule) {
|
|
626
|
+
return after + interval(schedule.every);
|
|
627
|
+
}
|
|
628
|
+
const next = new Cron(schedule.cron, {
|
|
629
|
+
paused: true,
|
|
630
|
+
timezone: "UTC"
|
|
631
|
+
}).nextRun(new Date(after));
|
|
632
|
+
if (!next) {
|
|
633
|
+
throw new Error("Schedule has no next occurrence");
|
|
634
|
+
}
|
|
635
|
+
return next.getTime();
|
|
636
|
+
}
|
|
637
|
+
var appScheduleStateSchema = z8.enum(["active", "paused", "archived"]);
|
|
638
|
+
var appScheduleRunSchema = z8.object({
|
|
639
|
+
id: z8.string().uuid(),
|
|
640
|
+
build: z8.string().uuid(),
|
|
641
|
+
startedAt: z8.number(),
|
|
642
|
+
scheduledAt: z8.number(),
|
|
643
|
+
manual: z8.boolean(),
|
|
644
|
+
status: z8.enum(["queued", "running", "succeeded", "failed", "uncertain"]),
|
|
645
|
+
duration: z8.number().nullable(),
|
|
646
|
+
error: z8.string().nullable()
|
|
647
|
+
});
|
|
648
|
+
var appScheduleListSchema = z8.object({
|
|
649
|
+
state: appScheduleStateSchema,
|
|
650
|
+
schedules: z8.array(
|
|
651
|
+
z8.object({
|
|
652
|
+
declaration: z8.union([everySchedule, cronSchedule]),
|
|
653
|
+
nextRun: z8.number().nullable(),
|
|
654
|
+
blocked: z8.boolean(),
|
|
655
|
+
lastRun: appScheduleRunSchema.nullable()
|
|
656
|
+
})
|
|
657
|
+
)
|
|
658
|
+
});
|
|
659
|
+
var scheduledInvocationSchema = z8.object({
|
|
660
|
+
id: z8.string().uuid(),
|
|
661
|
+
build: z8.string().uuid(),
|
|
662
|
+
name: appScheduleNameSchema,
|
|
663
|
+
scheduledAt: z8.number().int(),
|
|
664
|
+
startedAt: z8.number().int(),
|
|
665
|
+
manual: z8.boolean()
|
|
666
|
+
}).strict();
|
|
667
|
+
async function verifyScheduledRequest(request, key) {
|
|
668
|
+
const signature = request.headers.get("X-Domino-Schedule-Signature");
|
|
669
|
+
const url = new URL(request.url);
|
|
670
|
+
if (request.method !== "POST" || url.search !== "" || url.hash !== "" || !key || !signature || !/^[a-f0-9]{64}$/.test(signature)) {
|
|
671
|
+
return null;
|
|
672
|
+
}
|
|
673
|
+
const reader = request.clone().body?.getReader();
|
|
674
|
+
if (!reader) {
|
|
675
|
+
return null;
|
|
676
|
+
}
|
|
677
|
+
let body = "";
|
|
678
|
+
let size = 0;
|
|
679
|
+
const decoder = new TextDecoder();
|
|
680
|
+
try {
|
|
681
|
+
for (; ; ) {
|
|
682
|
+
const chunk = await reader.read();
|
|
683
|
+
if (chunk.done) {
|
|
684
|
+
break;
|
|
685
|
+
}
|
|
686
|
+
size += chunk.value.byteLength;
|
|
687
|
+
if (size > 4096) {
|
|
688
|
+
void reader.cancel().catch(() => {
|
|
689
|
+
});
|
|
690
|
+
return null;
|
|
691
|
+
}
|
|
692
|
+
body += decoder.decode(chunk.value, { stream: true });
|
|
693
|
+
}
|
|
694
|
+
body += decoder.decode();
|
|
695
|
+
} catch {
|
|
696
|
+
return null;
|
|
697
|
+
}
|
|
698
|
+
const secret = await crypto.subtle.importKey(
|
|
699
|
+
"raw",
|
|
700
|
+
new TextEncoder().encode(key),
|
|
701
|
+
{ name: "HMAC", hash: "SHA-256" },
|
|
702
|
+
false,
|
|
703
|
+
["verify"]
|
|
704
|
+
);
|
|
705
|
+
const bytes = Uint8Array.from(
|
|
706
|
+
signature.match(/../g) ?? [],
|
|
707
|
+
(byte) => Number.parseInt(byte, 16)
|
|
708
|
+
);
|
|
709
|
+
const valid = await crypto.subtle.verify(
|
|
710
|
+
"HMAC",
|
|
711
|
+
secret,
|
|
712
|
+
bytes,
|
|
713
|
+
new TextEncoder().encode(`POST
|
|
714
|
+
${url.pathname}
|
|
715
|
+
${body}`)
|
|
716
|
+
);
|
|
717
|
+
if (!valid) {
|
|
718
|
+
return null;
|
|
719
|
+
}
|
|
720
|
+
const parsed = scheduledInvocationSchema.safeParse(
|
|
721
|
+
await new Response(body).json().catch(() => null)
|
|
722
|
+
);
|
|
723
|
+
if (!parsed.success || Math.abs(Date.now() - parsed.data.startedAt) > 6e4) {
|
|
724
|
+
return null;
|
|
725
|
+
}
|
|
726
|
+
return parsed.data;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
// src/server/starters.ts
|
|
730
|
+
import { z as z9 } from "zod";
|
|
567
731
|
var starterTemplates = [
|
|
568
732
|
{
|
|
569
733
|
id: "campaign",
|
|
@@ -596,63 +760,63 @@ var starterTemplates = [
|
|
|
596
760
|
summary: "A headless Worker with typed routes and interactive API docs, for plugging Domino into your own product."
|
|
597
761
|
}
|
|
598
762
|
];
|
|
599
|
-
var starterIdSchema =
|
|
763
|
+
var starterIdSchema = z9.enum(
|
|
600
764
|
starterTemplates.map((template) => template.id)
|
|
601
765
|
);
|
|
602
766
|
|
|
603
767
|
// src/server/hosting.ts
|
|
604
|
-
var outputPathSchema =
|
|
768
|
+
var outputPathSchema = z10.string().min(1).max(512).refine(
|
|
605
769
|
(path) => path.split("/").every(
|
|
606
770
|
(part) => /^[\w-][\w.-]*$/.test(part) && part !== "node_modules"
|
|
607
771
|
),
|
|
608
772
|
"Expected a relative build output path without hidden segments"
|
|
609
773
|
);
|
|
610
|
-
var appRoutingSchema =
|
|
774
|
+
var appRoutingSchema = z10.enum(["legacy", "transparent"]).default("legacy");
|
|
611
775
|
var APP_SECRET_LIMIT = 50;
|
|
612
776
|
var APP_KV_LIMIT = 5;
|
|
613
777
|
var APP_SQL_LIMIT = 5;
|
|
614
778
|
var APP_MIGRATION_LIMIT = 100;
|
|
615
779
|
var APP_MIGRATION_FILE_BYTES = 9e4;
|
|
616
780
|
var APP_MIGRATION_TOTAL_BYTES = 1e6;
|
|
617
|
-
var appSecretNameSchema =
|
|
781
|
+
var appSecretNameSchema = z10.string().regex(
|
|
618
782
|
/^[A-Z_][A-Z0-9_]{0,63}$/,
|
|
619
783
|
"Use 1-64 uppercase letters, digits, and underscores, not starting with a digit"
|
|
620
784
|
).refine(
|
|
621
785
|
(name) => !name.startsWith("DOMINO_") && name !== "ASSETS",
|
|
622
786
|
"DOMINO_ names and ASSETS are reserved for Domino's own bindings"
|
|
623
787
|
);
|
|
624
|
-
var appSecretValueSchema =
|
|
788
|
+
var appSecretValueSchema = z10.string().min(1).refine(
|
|
625
789
|
(value) => new TextEncoder().encode(value).length <= 5120,
|
|
626
790
|
"Secret values can be at most 5 KiB"
|
|
627
791
|
);
|
|
628
|
-
var appSecretInputSchema =
|
|
629
|
-
var appSecretSchema =
|
|
792
|
+
var appSecretInputSchema = z10.object({ value: appSecretValueSchema }).strict();
|
|
793
|
+
var appSecretSchema = z10.object({
|
|
630
794
|
name: appSecretNameSchema,
|
|
631
|
-
updatedAt:
|
|
632
|
-
updatedBy:
|
|
795
|
+
updatedAt: z10.number(),
|
|
796
|
+
updatedBy: z10.string()
|
|
633
797
|
});
|
|
634
|
-
var appSecretDeclarationSchema =
|
|
635
|
-
description:
|
|
636
|
-
required:
|
|
798
|
+
var appSecretDeclarationSchema = z10.object({
|
|
799
|
+
description: z10.string().trim().min(1).max(500),
|
|
800
|
+
required: z10.boolean().default(true)
|
|
637
801
|
}).strict();
|
|
638
|
-
var appSecretDeclarationsSchema =
|
|
802
|
+
var appSecretDeclarationsSchema = z10.record(appSecretNameSchema, appSecretDeclarationSchema).refine(
|
|
639
803
|
(secrets) => Object.keys(secrets).length <= APP_SECRET_LIMIT,
|
|
640
804
|
`Declare at most ${APP_SECRET_LIMIT} app secrets`
|
|
641
805
|
);
|
|
642
|
-
var appSecretListSchema =
|
|
643
|
-
secrets:
|
|
644
|
-
declared:
|
|
806
|
+
var appSecretListSchema = z10.object({
|
|
807
|
+
secrets: z10.array(appSecretSchema),
|
|
808
|
+
declared: z10.array(appSecretDeclarationSchema.extend({ name: appSecretNameSchema })).default([])
|
|
645
809
|
});
|
|
646
|
-
var hostedAppSecretsSchema =
|
|
647
|
-
var storageDescription =
|
|
648
|
-
description:
|
|
810
|
+
var hostedAppSecretsSchema = z10.object({ secrets: z10.record(appSecretNameSchema, appSecretValueSchema) }).strict();
|
|
811
|
+
var storageDescription = z10.object({
|
|
812
|
+
description: z10.string().trim().min(1).max(500)
|
|
649
813
|
}).strict();
|
|
650
|
-
var appStorageSchema =
|
|
651
|
-
kv:
|
|
814
|
+
var appStorageSchema = z10.object({
|
|
815
|
+
kv: z10.record(appSecretNameSchema, storageDescription).refine(
|
|
652
816
|
(stores) => Object.keys(stores).length <= APP_KV_LIMIT,
|
|
653
817
|
`Declare at most ${APP_KV_LIMIT} KV stores`
|
|
654
818
|
).default({}),
|
|
655
|
-
sql:
|
|
819
|
+
sql: z10.record(
|
|
656
820
|
appSecretNameSchema,
|
|
657
821
|
storageDescription.extend({
|
|
658
822
|
migrations: outputPathSchema.optional()
|
|
@@ -662,60 +826,60 @@ var appStorageSchema = z9.object({
|
|
|
662
826
|
`Declare at most ${APP_SQL_LIMIT} SQL stores`
|
|
663
827
|
).default({})
|
|
664
828
|
}).strict();
|
|
665
|
-
var appStorageKindSchema =
|
|
666
|
-
var appStorageListSchema =
|
|
667
|
-
stores:
|
|
668
|
-
|
|
669
|
-
kind:
|
|
829
|
+
var appStorageKindSchema = z10.enum(["kv", "sql"]);
|
|
830
|
+
var appStorageListSchema = z10.object({
|
|
831
|
+
stores: z10.array(
|
|
832
|
+
z10.object({
|
|
833
|
+
kind: z10.string(),
|
|
670
834
|
name: appSecretNameSchema,
|
|
671
|
-
createdAt:
|
|
672
|
-
declared:
|
|
673
|
-
description:
|
|
835
|
+
createdAt: z10.number().nullable(),
|
|
836
|
+
declared: z10.boolean(),
|
|
837
|
+
description: z10.string().optional()
|
|
674
838
|
})
|
|
675
839
|
)
|
|
676
840
|
});
|
|
677
841
|
var APP_STORAGE_ROW_LIMIT = 50;
|
|
678
842
|
var APP_STORAGE_PREVIEW_CHARACTERS = 2e3;
|
|
679
|
-
var appStorageCellSchema =
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
843
|
+
var appStorageCellSchema = z10.union([
|
|
844
|
+
z10.string(),
|
|
845
|
+
z10.number(),
|
|
846
|
+
z10.null(),
|
|
847
|
+
z10.object({ text: z10.string(), truncated: z10.literal(true) }),
|
|
848
|
+
z10.object({ blob: z10.number().int().min(0) })
|
|
685
849
|
]);
|
|
686
|
-
var appStorageTablesSchema =
|
|
687
|
-
tables:
|
|
850
|
+
var appStorageTablesSchema = z10.object({
|
|
851
|
+
tables: z10.array(
|
|
688
852
|
/** `kind` is SQLite's: `table` or `view`. */
|
|
689
|
-
|
|
853
|
+
z10.object({ name: z10.string(), kind: z10.string() })
|
|
690
854
|
)
|
|
691
855
|
});
|
|
692
|
-
var appStorageRowsSchema =
|
|
693
|
-
table:
|
|
694
|
-
columns:
|
|
695
|
-
rows:
|
|
856
|
+
var appStorageRowsSchema = z10.object({
|
|
857
|
+
table: z10.string(),
|
|
858
|
+
columns: z10.array(z10.string()),
|
|
859
|
+
rows: z10.array(z10.array(appStorageCellSchema)),
|
|
696
860
|
/** How many rows come before this page in storage order. */
|
|
697
|
-
offset:
|
|
698
|
-
total:
|
|
861
|
+
offset: z10.number().int().min(0),
|
|
862
|
+
total: z10.number().int().min(0),
|
|
699
863
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
700
864
|
nextCursor: pageCursorSchema.nullable().default(null)
|
|
701
865
|
});
|
|
702
|
-
var appStorageKeysSchema =
|
|
703
|
-
keys:
|
|
704
|
-
|
|
866
|
+
var appStorageKeysSchema = z10.object({
|
|
867
|
+
keys: z10.array(
|
|
868
|
+
z10.object({ name: z10.string(), expiration: z10.number().nullable() })
|
|
705
869
|
),
|
|
706
870
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
707
871
|
nextCursor: pageCursorSchema.nullable().default(null),
|
|
708
872
|
/** @deprecated Use `nextCursor`. Removed in 2.0.0. */
|
|
709
|
-
cursor:
|
|
873
|
+
cursor: z10.string().nullable()
|
|
710
874
|
});
|
|
711
|
-
var appStorageValueSchema =
|
|
712
|
-
key:
|
|
713
|
-
size:
|
|
875
|
+
var appStorageValueSchema = z10.object({
|
|
876
|
+
key: z10.string(),
|
|
877
|
+
size: z10.number().int().min(0),
|
|
714
878
|
/** Null when the value is not UTF-8 text. */
|
|
715
|
-
text:
|
|
716
|
-
truncated:
|
|
879
|
+
text: z10.string().nullable(),
|
|
880
|
+
truncated: z10.boolean()
|
|
717
881
|
});
|
|
718
|
-
var appMigrationNameSchema =
|
|
882
|
+
var appMigrationNameSchema = z10.string().max(255).regex(/^[\w-][\w.-]*\.sql$/);
|
|
719
883
|
function compareAppMigrations(a, b) {
|
|
720
884
|
const left = Number.parseInt(a.split("_")[0], 10);
|
|
721
885
|
const right = Number.parseInt(b.split("_")[0], 10);
|
|
@@ -732,12 +896,12 @@ function compareAppMigrations(a, b) {
|
|
|
732
896
|
}
|
|
733
897
|
return a < b ? -1 : a > b ? 1 : 0;
|
|
734
898
|
}
|
|
735
|
-
var appMigrationsSchema =
|
|
899
|
+
var appMigrationsSchema = z10.record(
|
|
736
900
|
appSecretNameSchema,
|
|
737
|
-
|
|
738
|
-
|
|
901
|
+
z10.array(
|
|
902
|
+
z10.object({
|
|
739
903
|
name: appMigrationNameSchema,
|
|
740
|
-
sql:
|
|
904
|
+
sql: z10.string().min(1).refine(
|
|
741
905
|
(sql) => new TextEncoder().encode(sql).length <= APP_MIGRATION_FILE_BYTES,
|
|
742
906
|
`A migration file must not exceed ${APP_MIGRATION_FILE_BYTES} bytes`
|
|
743
907
|
)
|
|
@@ -755,24 +919,25 @@ var appMigrationsSchema = z9.record(
|
|
|
755
919
|
);
|
|
756
920
|
var appScripts = {
|
|
757
921
|
routing: appRoutingSchema,
|
|
758
|
-
devScript:
|
|
759
|
-
checkScript:
|
|
760
|
-
buildScript:
|
|
922
|
+
devScript: z10.string().regex(/^[\w:-]+$/),
|
|
923
|
+
checkScript: z10.string().regex(/^[\w:-]+$/),
|
|
924
|
+
buildScript: z10.string().regex(/^[\w:-]+$/)
|
|
761
925
|
};
|
|
762
926
|
var workerSettings = {
|
|
763
|
-
runWorkerFirst:
|
|
927
|
+
runWorkerFirst: z10.boolean().default(false),
|
|
764
928
|
main: outputPathSchema.refine(
|
|
765
929
|
(path) => /\.m?js$/.test(path),
|
|
766
930
|
"Expected a compiled JavaScript entry"
|
|
767
931
|
),
|
|
768
|
-
compatibilityDate:
|
|
769
|
-
compatibilityFlags:
|
|
770
|
-
vars:
|
|
771
|
-
|
|
772
|
-
|
|
932
|
+
compatibilityDate: z10.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
933
|
+
compatibilityFlags: z10.array(z10.string().min(1)).max(50).default([]),
|
|
934
|
+
vars: z10.record(
|
|
935
|
+
z10.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).refine((name) => name !== "ASSETS"),
|
|
936
|
+
z10.string()
|
|
773
937
|
).default({}),
|
|
774
938
|
secrets: appSecretDeclarationsSchema.default({}),
|
|
775
|
-
storage: appStorageSchema.optional()
|
|
939
|
+
storage: appStorageSchema.optional(),
|
|
940
|
+
schedules: appSchedulesSchema.optional()
|
|
776
941
|
};
|
|
777
942
|
var distinctBindings = (worker, ctx) => {
|
|
778
943
|
const owners = /* @__PURE__ */ new Map();
|
|
@@ -797,62 +962,62 @@ var distinctBindings = (worker, ctx) => {
|
|
|
797
962
|
}
|
|
798
963
|
}
|
|
799
964
|
};
|
|
800
|
-
var hostedAppSchema =
|
|
801
|
-
|
|
802
|
-
kind:
|
|
965
|
+
var hostedAppSchema = z10.discriminatedUnion("kind", [
|
|
966
|
+
z10.object({
|
|
967
|
+
kind: z10.literal("static"),
|
|
803
968
|
directory: outputPathSchema,
|
|
804
969
|
...appScripts
|
|
805
970
|
}).strict(),
|
|
806
|
-
|
|
807
|
-
kind:
|
|
971
|
+
z10.object({
|
|
972
|
+
kind: z10.literal("worker"),
|
|
808
973
|
directory: outputPathSchema,
|
|
809
974
|
assetsDirectory: outputPathSchema.optional(),
|
|
810
975
|
...appScripts,
|
|
811
976
|
...workerSettings
|
|
812
977
|
}).strict().superRefine(distinctBindings)
|
|
813
978
|
]);
|
|
814
|
-
var repositorySchema =
|
|
815
|
-
id:
|
|
979
|
+
var repositorySchema = z10.object({
|
|
980
|
+
id: z10.string().uuid(),
|
|
816
981
|
organization: identifier,
|
|
817
982
|
project: identifier,
|
|
818
|
-
remote:
|
|
819
|
-
defaultBranch:
|
|
820
|
-
status:
|
|
983
|
+
remote: z10.string().url(),
|
|
984
|
+
defaultBranch: z10.string(),
|
|
985
|
+
status: z10.enum(["provisioning", "ready"])
|
|
821
986
|
});
|
|
822
|
-
var createRepositorySchema =
|
|
987
|
+
var createRepositorySchema = z10.object({
|
|
823
988
|
/** Omitted: the starter chosen at project setup, else `campaign`. */
|
|
824
989
|
starter: starterIdSchema.optional()
|
|
825
990
|
}).strict();
|
|
826
|
-
var deviceStartSchema =
|
|
827
|
-
challenge:
|
|
991
|
+
var deviceStartSchema = z10.object({
|
|
992
|
+
challenge: z10.string().regex(/^[a-f0-9]{64}$/)
|
|
828
993
|
}).strict();
|
|
829
|
-
var deviceRedeemSchema =
|
|
830
|
-
id:
|
|
831
|
-
verifier:
|
|
994
|
+
var deviceRedeemSchema = z10.object({
|
|
995
|
+
id: z10.string().uuid(),
|
|
996
|
+
verifier: z10.string().min(43).max(128)
|
|
832
997
|
}).strict();
|
|
833
|
-
var deviceApproveSchema =
|
|
834
|
-
id:
|
|
835
|
-
code:
|
|
998
|
+
var deviceApproveSchema = z10.object({
|
|
999
|
+
id: z10.string().uuid(),
|
|
1000
|
+
code: z10.string().regex(/^[A-F0-9]{4}-[A-F0-9]{4}$/)
|
|
836
1001
|
}).strict();
|
|
837
|
-
var commitSchema =
|
|
838
|
-
var stageRequestSchema =
|
|
1002
|
+
var commitSchema = z10.string().regex(/^[a-f0-9]{40}$/);
|
|
1003
|
+
var stageRequestSchema = z10.object({
|
|
839
1004
|
commit: commitSchema,
|
|
840
|
-
requestId:
|
|
1005
|
+
requestId: z10.string().uuid()
|
|
841
1006
|
}).strict();
|
|
842
|
-
var buildIdentitySchema =
|
|
1007
|
+
var buildIdentitySchema = z10.object({
|
|
843
1008
|
routing: appRoutingSchema,
|
|
844
|
-
slug:
|
|
845
|
-
runtime:
|
|
846
|
-
id:
|
|
847
|
-
repository:
|
|
1009
|
+
slug: z10.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional(),
|
|
1010
|
+
runtime: z10.enum(["simulation", "hosted-test"]).default("simulation"),
|
|
1011
|
+
id: z10.string().uuid(),
|
|
1012
|
+
repository: z10.string().uuid(),
|
|
848
1013
|
organization: identifier,
|
|
849
1014
|
project: identifier,
|
|
850
1015
|
commit: commitSchema,
|
|
851
|
-
createdAt:
|
|
852
|
-
actor:
|
|
853
|
-
commitMessage:
|
|
1016
|
+
createdAt: z10.number(),
|
|
1017
|
+
actor: z10.string(),
|
|
1018
|
+
commitMessage: z10.string().max(500).optional()
|
|
854
1019
|
});
|
|
855
|
-
var buildPhaseSchema =
|
|
1020
|
+
var buildPhaseSchema = z10.enum([
|
|
856
1021
|
"queued",
|
|
857
1022
|
"source",
|
|
858
1023
|
"install",
|
|
@@ -862,72 +1027,72 @@ var buildPhaseSchema = z9.enum([
|
|
|
862
1027
|
"ready",
|
|
863
1028
|
"failed"
|
|
864
1029
|
]);
|
|
865
|
-
var buildStatusSchema =
|
|
1030
|
+
var buildStatusSchema = z10.object({
|
|
866
1031
|
phase: buildPhaseSchema,
|
|
867
1032
|
failedPhase: buildPhaseSchema.optional(),
|
|
868
|
-
updatedAt:
|
|
869
|
-
message:
|
|
1033
|
+
updatedAt: z10.number(),
|
|
1034
|
+
message: z10.string()
|
|
870
1035
|
});
|
|
871
1036
|
var hostedBuildSchema = buildIdentitySchema.extend({
|
|
872
1037
|
...buildStatusSchema.shape,
|
|
873
|
-
finished:
|
|
874
|
-
current:
|
|
875
|
-
stagingUrl:
|
|
876
|
-
});
|
|
877
|
-
var stagingAccessModeSchema =
|
|
878
|
-
var stagingAccessSchema =
|
|
879
|
-
var stagingAccessInputSchema =
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
mode:
|
|
883
|
-
password:
|
|
1038
|
+
finished: z10.boolean(),
|
|
1039
|
+
current: z10.boolean(),
|
|
1040
|
+
stagingUrl: z10.string().url()
|
|
1041
|
+
});
|
|
1042
|
+
var stagingAccessModeSchema = z10.enum(["console", "password"]);
|
|
1043
|
+
var stagingAccessSchema = z10.object({ mode: stagingAccessModeSchema });
|
|
1044
|
+
var stagingAccessInputSchema = z10.discriminatedUnion("mode", [
|
|
1045
|
+
z10.object({ mode: z10.literal("console") }).strict(),
|
|
1046
|
+
z10.object({
|
|
1047
|
+
mode: z10.literal("password"),
|
|
1048
|
+
password: z10.string().min(8).max(128)
|
|
884
1049
|
}).strict()
|
|
885
1050
|
]);
|
|
886
|
-
var stagingPathSchema =
|
|
1051
|
+
var stagingPathSchema = z10.string().max(2048).refine(
|
|
887
1052
|
(path) => path.startsWith("/") && !path.startsWith("//") && !path.includes("\\"),
|
|
888
1053
|
"Expected a path on the staging host"
|
|
889
1054
|
);
|
|
890
|
-
var stagingLinkSchema =
|
|
891
|
-
url:
|
|
892
|
-
expiresAt:
|
|
1055
|
+
var stagingLinkSchema = z10.object({
|
|
1056
|
+
url: z10.string().url(),
|
|
1057
|
+
expiresAt: z10.number()
|
|
893
1058
|
});
|
|
894
|
-
var buildSnapshotSchema =
|
|
895
|
-
builds:
|
|
1059
|
+
var buildSnapshotSchema = z10.object({
|
|
1060
|
+
builds: z10.array(hostedBuildSchema),
|
|
896
1061
|
current: hostedBuildSchema.nullable(),
|
|
897
1062
|
selected: hostedBuildSchema.nullable(),
|
|
898
|
-
logs:
|
|
1063
|
+
logs: z10.string()
|
|
899
1064
|
});
|
|
900
|
-
var assetPathSchema =
|
|
1065
|
+
var assetPathSchema = z10.string().max(512).refine(
|
|
901
1066
|
(path) => path.startsWith("/") && // oxlint-disable-next-line no-control-regex -- Asset paths must reject control characters.
|
|
902
1067
|
!/[\\\u0000-\u001f?#%]/.test(path) && path.slice(1).split("/").every((part) => part.length > 0 && !part.startsWith(".")),
|
|
903
1068
|
"Expected a public asset path without hidden segments"
|
|
904
1069
|
);
|
|
905
|
-
var base64Schema =
|
|
1070
|
+
var base64Schema = z10.string().regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
|
|
906
1071
|
var stagedDeploymentLimits = {
|
|
907
1072
|
/** Bytes of JSON, uncompressed. */
|
|
908
1073
|
size: 64e6,
|
|
909
1074
|
/** Bytes of the Brotli-compressed object. */
|
|
910
1075
|
compressedSize: 1e7
|
|
911
1076
|
};
|
|
912
|
-
var stagedDeploymentSchema =
|
|
913
|
-
encoding:
|
|
914
|
-
sha256:
|
|
915
|
-
compressedSize:
|
|
916
|
-
size:
|
|
1077
|
+
var stagedDeploymentSchema = z10.object({
|
|
1078
|
+
encoding: z10.literal("br"),
|
|
1079
|
+
sha256: z10.string().regex(/^[0-9a-f]{64}$/),
|
|
1080
|
+
compressedSize: z10.number().int().positive().max(stagedDeploymentLimits.compressedSize),
|
|
1081
|
+
size: z10.number().int().positive().max(stagedDeploymentLimits.size)
|
|
917
1082
|
}).strict();
|
|
918
1083
|
var stagedDeploymentContentSchema = stagedDeploymentSchema.extend({
|
|
919
|
-
content:
|
|
1084
|
+
content: z10.string().max(Math.ceil(stagedDeploymentLimits.compressedSize / 3) * 4)
|
|
920
1085
|
}).strict();
|
|
921
1086
|
var stagedDeploymentKey = (build, sha256) => `builds/${build}/deployment/${sha256}.br`;
|
|
922
1087
|
var artifactFields = {
|
|
923
1088
|
routing: appRoutingSchema,
|
|
924
|
-
worker:
|
|
1089
|
+
worker: z10.object({
|
|
925
1090
|
...workerSettings,
|
|
926
1091
|
migrations: appMigrationsSchema.optional(),
|
|
927
|
-
modules:
|
|
928
|
-
|
|
1092
|
+
modules: z10.array(
|
|
1093
|
+
z10.object({
|
|
929
1094
|
path: outputPathSchema.refine((path) => path !== "metadata"),
|
|
930
|
-
type:
|
|
1095
|
+
type: z10.enum([
|
|
931
1096
|
"application/javascript+module",
|
|
932
1097
|
"application/wasm",
|
|
933
1098
|
"text/plain",
|
|
@@ -937,26 +1102,26 @@ var artifactFields = {
|
|
|
937
1102
|
}).strict()
|
|
938
1103
|
).min(1).max(500)
|
|
939
1104
|
}).strict().superRefine(distinctBindings).optional(),
|
|
940
|
-
assets:
|
|
941
|
-
|
|
1105
|
+
assets: z10.array(
|
|
1106
|
+
z10.object({
|
|
942
1107
|
path: assetPathSchema,
|
|
943
1108
|
content: base64Schema.max(14e6),
|
|
944
|
-
size:
|
|
1109
|
+
size: z10.number().int().min(0).max(1e7)
|
|
945
1110
|
}).strict()
|
|
946
1111
|
).max(500)
|
|
947
1112
|
};
|
|
948
|
-
var buildArtifactsSchema =
|
|
949
|
-
|
|
950
|
-
format:
|
|
1113
|
+
var buildArtifactsSchema = z10.discriminatedUnion("format", [
|
|
1114
|
+
z10.object({
|
|
1115
|
+
format: z10.literal(1),
|
|
951
1116
|
...artifactFields,
|
|
952
|
-
quests:
|
|
953
|
-
catalog:
|
|
1117
|
+
quests: z10.unknown(),
|
|
1118
|
+
catalog: z10.unknown()
|
|
954
1119
|
}).strict(),
|
|
955
|
-
|
|
956
|
-
format:
|
|
1120
|
+
z10.object({
|
|
1121
|
+
format: z10.literal(2),
|
|
957
1122
|
...artifactFields,
|
|
958
1123
|
deployment: stagedDeploymentSchema,
|
|
959
|
-
images:
|
|
1124
|
+
images: z10.array(imageAssetArtifactSchema).max(10)
|
|
960
1125
|
}).strict()
|
|
961
1126
|
]).superRefine((value, ctx) => {
|
|
962
1127
|
if (value.worker) {
|
|
@@ -1008,39 +1173,39 @@ var buildArtifactsSchema = z9.discriminatedUnion("format", [
|
|
|
1008
1173
|
});
|
|
1009
1174
|
|
|
1010
1175
|
// src/server/development.ts
|
|
1011
|
-
import { z as
|
|
1012
|
-
var developmentPreflightSchema =
|
|
1013
|
-
organization:
|
|
1014
|
-
project:
|
|
1015
|
-
environment:
|
|
1016
|
-
identity:
|
|
1017
|
-
exchange:
|
|
1018
|
-
activeIntegrations:
|
|
1176
|
+
import { z as z11 } from "zod";
|
|
1177
|
+
var developmentPreflightSchema = z11.object({
|
|
1178
|
+
organization: z11.string(),
|
|
1179
|
+
project: z11.string(),
|
|
1180
|
+
environment: z11.enum(["test", "live"]),
|
|
1181
|
+
identity: z11.object({
|
|
1182
|
+
exchange: z11.literal("supported"),
|
|
1183
|
+
activeIntegrations: z11.number().int().nonnegative()
|
|
1019
1184
|
}).optional(),
|
|
1020
|
-
staging:
|
|
1021
|
-
development:
|
|
1022
|
-
status:
|
|
1185
|
+
staging: z11.enum(["configured", "blocked"]),
|
|
1186
|
+
development: z11.object({
|
|
1187
|
+
status: z11.enum(["configured", "blocked"]),
|
|
1023
1188
|
// How `domino dev` reaches the preview origin: a Cloudflare tunnel, or a direct route on a
|
|
1024
1189
|
// local development stack. APIs that predate the field use tunnels.
|
|
1025
|
-
transport:
|
|
1026
|
-
missing:
|
|
1027
|
-
authentication:
|
|
1190
|
+
transport: z11.enum(["tunnel", "direct"]).default("tunnel"),
|
|
1191
|
+
missing: z11.array(z11.string()),
|
|
1192
|
+
authentication: z11.array(z11.string())
|
|
1028
1193
|
}),
|
|
1029
|
-
checks:
|
|
1030
|
-
|
|
1031
|
-
id:
|
|
1032
|
-
status:
|
|
1033
|
-
message:
|
|
1034
|
-
missing:
|
|
1035
|
-
issues:
|
|
1194
|
+
checks: z11.array(
|
|
1195
|
+
z11.object({
|
|
1196
|
+
id: z11.string(),
|
|
1197
|
+
status: z11.enum(["ok", "error"]),
|
|
1198
|
+
message: z11.string(),
|
|
1199
|
+
missing: z11.array(z11.string()).optional(),
|
|
1200
|
+
issues: z11.array(z11.string()).optional()
|
|
1036
1201
|
})
|
|
1037
1202
|
)
|
|
1038
1203
|
});
|
|
1039
1204
|
|
|
1040
1205
|
// src/server/hosted.ts
|
|
1041
|
-
import { z as
|
|
1206
|
+
import { z as z12 } from "zod";
|
|
1042
1207
|
var hostedKeyPermissions = ["read", "points", "ingest"];
|
|
1043
|
-
var hostedKeyPermissionList =
|
|
1208
|
+
var hostedKeyPermissionList = z12.array(z12.string()).transform(
|
|
1044
1209
|
(values) => values.filter(
|
|
1045
1210
|
(value) => hostedKeyPermissions.includes(value)
|
|
1046
1211
|
)
|
|
@@ -1052,17 +1217,17 @@ var hostedManagementBindings = [
|
|
|
1052
1217
|
"DOMINO_PROJECT",
|
|
1053
1218
|
"DOMINO_ENVIRONMENT"
|
|
1054
1219
|
];
|
|
1055
|
-
var hostedKeySecretSchema =
|
|
1056
|
-
var hostedKeySchema =
|
|
1057
|
-
id:
|
|
1220
|
+
var hostedKeySecretSchema = z12.string().regex(/^dhk_[A-Za-z0-9_-]{43}$/, "Expected a hosted app key");
|
|
1221
|
+
var hostedKeySchema = z12.object({
|
|
1222
|
+
id: z12.string().uuid(),
|
|
1058
1223
|
token: hostedKeySecretSchema,
|
|
1059
1224
|
organization: identifier,
|
|
1060
1225
|
project: identifier,
|
|
1061
|
-
environment:
|
|
1226
|
+
environment: z12.enum(["test", "live"]),
|
|
1062
1227
|
permissions: hostedKeyPermissionList,
|
|
1063
|
-
expiresAt:
|
|
1228
|
+
expiresAt: z12.number().nullable()
|
|
1064
1229
|
}).strict();
|
|
1065
|
-
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl:
|
|
1230
|
+
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl: z12.string().url() }).strict();
|
|
1066
1231
|
function hostedManagementClient(env) {
|
|
1067
1232
|
const missing = hostedManagementBindings.filter((name) => !env[name]);
|
|
1068
1233
|
if (missing.length) {
|
|
@@ -1070,7 +1235,7 @@ function hostedManagementClient(env) {
|
|
|
1070
1235
|
`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
1236
|
);
|
|
1072
1237
|
}
|
|
1073
|
-
const environment =
|
|
1238
|
+
const environment = z12.enum(["test", "live"]).parse(env.DOMINO_ENVIRONMENT);
|
|
1074
1239
|
const token = env.DOMINO_MANAGEMENT_KEY;
|
|
1075
1240
|
return createManagementClient({
|
|
1076
1241
|
baseUrl: env.DOMINO_API_URL.replace(/\/+$/, ""),
|
|
@@ -1082,9 +1247,9 @@ function hostedManagementClient(env) {
|
|
|
1082
1247
|
}
|
|
1083
1248
|
|
|
1084
1249
|
// src/server/index.ts
|
|
1085
|
-
var environmentSchema =
|
|
1086
|
-
var roleSchema =
|
|
1087
|
-
var permissionSchema =
|
|
1250
|
+
var environmentSchema = z13.enum(["test", "live"]);
|
|
1251
|
+
var roleSchema = z13.enum(["editor", "reviewer", "staff"]);
|
|
1252
|
+
var permissionSchema = z13.enum([
|
|
1088
1253
|
"read",
|
|
1089
1254
|
"publish",
|
|
1090
1255
|
"review",
|
|
@@ -1104,7 +1269,7 @@ var permissionSchema = z12.enum([
|
|
|
1104
1269
|
*/
|
|
1105
1270
|
"enroll"
|
|
1106
1271
|
]);
|
|
1107
|
-
var permissionListSchema =
|
|
1272
|
+
var permissionListSchema = z13.array(z13.string()).transform(
|
|
1108
1273
|
(values) => values.filter(
|
|
1109
1274
|
(value) => permissionSchema.safeParse(value).success
|
|
1110
1275
|
)
|
|
@@ -1114,33 +1279,33 @@ var rolePermissions = {
|
|
|
1114
1279
|
reviewer: ["read", "review"],
|
|
1115
1280
|
staff: ["read", "confirm", "handover"]
|
|
1116
1281
|
};
|
|
1117
|
-
var projectSetupSchema =
|
|
1118
|
-
mode:
|
|
1119
|
-
brief:
|
|
1282
|
+
var projectSetupSchema = z13.object({
|
|
1283
|
+
mode: z13.enum(["new", "existing"]),
|
|
1284
|
+
brief: z13.string().trim().min(1).max(4e3)
|
|
1120
1285
|
}).strict();
|
|
1121
|
-
var operatorUserSchema =
|
|
1122
|
-
id:
|
|
1123
|
-
name:
|
|
1124
|
-
email:
|
|
1125
|
-
avatar:
|
|
1126
|
-
});
|
|
1127
|
-
var projectSchema =
|
|
1128
|
-
slug:
|
|
1129
|
-
createdBy:
|
|
1286
|
+
var operatorUserSchema = z13.object({
|
|
1287
|
+
id: z13.string(),
|
|
1288
|
+
name: z13.string().nullable(),
|
|
1289
|
+
email: z13.string().nullable(),
|
|
1290
|
+
avatar: z13.string().nullable()
|
|
1291
|
+
});
|
|
1292
|
+
var projectSchema = z13.object({
|
|
1293
|
+
slug: z13.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
1294
|
+
createdBy: z13.string().nullable().optional(),
|
|
1130
1295
|
creator: operatorUserSchema.nullable().optional(),
|
|
1131
1296
|
/** A response, so fields a newer server adds to the setup are dropped, not rejected. */
|
|
1132
|
-
setup:
|
|
1297
|
+
setup: z13.object(projectSetupSchema.shape).optional(),
|
|
1133
1298
|
/** The starter chosen at setup. A plain string, so later starters still parse. */
|
|
1134
|
-
starter:
|
|
1135
|
-
id:
|
|
1299
|
+
starter: z13.string().optional(),
|
|
1300
|
+
id: z13.string().min(1),
|
|
1136
1301
|
organization: identifier,
|
|
1137
1302
|
project: identifier,
|
|
1138
|
-
name:
|
|
1139
|
-
subtitle:
|
|
1140
|
-
initials:
|
|
1141
|
-
color:
|
|
1303
|
+
name: z13.string(),
|
|
1304
|
+
subtitle: z13.string(),
|
|
1305
|
+
initials: z13.string(),
|
|
1306
|
+
color: z13.string(),
|
|
1142
1307
|
permissions: permissionListSchema,
|
|
1143
|
-
environments:
|
|
1308
|
+
environments: z13.array(environmentSchema)
|
|
1144
1309
|
}).refine(
|
|
1145
1310
|
(project) => !project.creator || project.creator.id === project.createdBy,
|
|
1146
1311
|
{
|
|
@@ -1148,45 +1313,45 @@ var projectSchema = z12.object({
|
|
|
1148
1313
|
path: ["creator"]
|
|
1149
1314
|
}
|
|
1150
1315
|
);
|
|
1151
|
-
var projectInputSchema =
|
|
1316
|
+
var projectInputSchema = z13.object({
|
|
1152
1317
|
actionId: identifier,
|
|
1153
|
-
name:
|
|
1318
|
+
name: z13.string().trim().min(1).max(80),
|
|
1154
1319
|
setup: projectSetupSchema.optional(),
|
|
1155
1320
|
/** The starter a new hosted app begins from, with `setup.mode` "new". */
|
|
1156
1321
|
starter: starterIdSchema.optional()
|
|
1157
1322
|
}).strict();
|
|
1158
|
-
var projectUpdateInputSchema =
|
|
1159
|
-
|
|
1160
|
-
|
|
1323
|
+
var projectUpdateInputSchema = z13.union([
|
|
1324
|
+
z13.object({ name: projectInputSchema.shape.name }).strict(),
|
|
1325
|
+
z13.object({
|
|
1161
1326
|
slug: projectSchema.shape.slug,
|
|
1162
|
-
confirm:
|
|
1327
|
+
confirm: z13.string().min(1).max(80)
|
|
1163
1328
|
}).strict()
|
|
1164
1329
|
]);
|
|
1165
|
-
var projectDeletionInputSchema =
|
|
1166
|
-
var projectDeletionSchema =
|
|
1330
|
+
var projectDeletionInputSchema = z13.object({ confirm: z13.string().min(1).max(80) }).strict();
|
|
1331
|
+
var projectDeletionSchema = z13.object({
|
|
1167
1332
|
project: identifier,
|
|
1168
|
-
purgeAfter:
|
|
1333
|
+
purgeAfter: z13.number().int()
|
|
1169
1334
|
});
|
|
1170
|
-
var projectTransferInputSchema =
|
|
1171
|
-
var projectTransferSchema =
|
|
1335
|
+
var projectTransferInputSchema = z13.object({ organization: identifier, confirm: z13.string().min(1).max(80) }).strict();
|
|
1336
|
+
var projectTransferSchema = z13.object({
|
|
1172
1337
|
organization: identifier,
|
|
1173
1338
|
project: identifier
|
|
1174
1339
|
});
|
|
1175
|
-
var grantSchema =
|
|
1176
|
-
subject:
|
|
1177
|
-
roles:
|
|
1178
|
-
environments:
|
|
1340
|
+
var grantSchema = z13.object({
|
|
1341
|
+
subject: z13.string().min(1).max(200),
|
|
1342
|
+
roles: z13.array(roleSchema),
|
|
1343
|
+
environments: z13.array(environmentSchema)
|
|
1179
1344
|
}).strict();
|
|
1180
|
-
var grantRecordSchema =
|
|
1181
|
-
var stockAdditionSchema =
|
|
1345
|
+
var grantRecordSchema = z13.object(grantSchema.shape);
|
|
1346
|
+
var stockAdditionSchema = z13.object({
|
|
1182
1347
|
item: identifier,
|
|
1183
|
-
quantity:
|
|
1348
|
+
quantity: z13.number().int(),
|
|
1184
1349
|
actionId: identifier
|
|
1185
1350
|
});
|
|
1186
|
-
var completionRevokeSchema =
|
|
1351
|
+
var completionRevokeSchema = z13.object({
|
|
1187
1352
|
actionId: identifier,
|
|
1188
|
-
reason:
|
|
1189
|
-
freeOccurrence:
|
|
1353
|
+
reason: z13.string().trim().min(1).max(500),
|
|
1354
|
+
freeOccurrence: z13.boolean().default(false)
|
|
1190
1355
|
}).strict();
|
|
1191
1356
|
var RevokedEntitlementOutcome = {
|
|
1192
1357
|
/** No other completion grants the reward: it is void, after cancelling a handover in progress. */
|
|
@@ -1214,218 +1379,218 @@ var RevokedReferralOutcome = {
|
|
|
1214
1379
|
/** Qualified on another accepted completion of the program's quest instead. */
|
|
1215
1380
|
Requalified: "requalified"
|
|
1216
1381
|
};
|
|
1217
|
-
var entitlementOutcomeSchema =
|
|
1218
|
-
var deliveryOutcomeSchema =
|
|
1219
|
-
var referralOutcomeSchema =
|
|
1220
|
-
var completionRevocationSchema =
|
|
1382
|
+
var entitlementOutcomeSchema = z13.string().min(1).max(64);
|
|
1383
|
+
var deliveryOutcomeSchema = z13.string().min(1).max(64);
|
|
1384
|
+
var referralOutcomeSchema = z13.string().min(1).max(64);
|
|
1385
|
+
var completionRevocationSchema = z13.object({
|
|
1221
1386
|
completion: identifier,
|
|
1222
1387
|
/** The quest ID, or the board ID when `source.kind` is `leaderboard`. */
|
|
1223
1388
|
quest: identifier,
|
|
1224
1389
|
member: identifier,
|
|
1225
1390
|
/** What paid the revoked completion. `source.id` repeats `quest`. */
|
|
1226
1391
|
source: completionSourceSchema.optional(),
|
|
1227
|
-
revokedAt:
|
|
1228
|
-
occurrenceFreed:
|
|
1229
|
-
points:
|
|
1230
|
-
|
|
1392
|
+
revokedAt: z13.number(),
|
|
1393
|
+
occurrenceFreed: z13.boolean(),
|
|
1394
|
+
points: z13.array(
|
|
1395
|
+
z13.object({
|
|
1231
1396
|
entry: identifier,
|
|
1232
1397
|
balance: identifier,
|
|
1233
1398
|
reversal: identifier.nullable(),
|
|
1234
|
-
reversed:
|
|
1235
|
-
unreversed:
|
|
1399
|
+
reversed: z13.number().int(),
|
|
1400
|
+
unreversed: z13.number().int()
|
|
1236
1401
|
})
|
|
1237
1402
|
),
|
|
1238
|
-
entitlements:
|
|
1239
|
-
|
|
1403
|
+
entitlements: z13.array(
|
|
1404
|
+
z13.object({
|
|
1240
1405
|
entitlement: identifier,
|
|
1241
1406
|
reward: identifier,
|
|
1242
1407
|
outcome: entitlementOutcomeSchema,
|
|
1243
|
-
status:
|
|
1408
|
+
status: z13.string()
|
|
1244
1409
|
})
|
|
1245
1410
|
),
|
|
1246
|
-
deliveries:
|
|
1247
|
-
|
|
1248
|
-
delivery:
|
|
1249
|
-
roleId:
|
|
1411
|
+
deliveries: z13.array(
|
|
1412
|
+
z13.object({
|
|
1413
|
+
delivery: z13.string(),
|
|
1414
|
+
roleId: z13.string(),
|
|
1250
1415
|
outcome: deliveryOutcomeSchema,
|
|
1251
1416
|
/**
|
|
1252
1417
|
* By Relay's records, another accepted, unrevoked completion of the member also granted this
|
|
1253
1418
|
* role to the same Discord account and server. Relay does not read Discord's membership.
|
|
1254
1419
|
*/
|
|
1255
|
-
stillGranted:
|
|
1420
|
+
stillGranted: z13.boolean()
|
|
1256
1421
|
})
|
|
1257
1422
|
),
|
|
1258
|
-
referrals:
|
|
1259
|
-
|
|
1423
|
+
referrals: z13.array(
|
|
1424
|
+
z13.object({
|
|
1260
1425
|
program: identifier,
|
|
1261
1426
|
outcome: referralOutcomeSchema
|
|
1262
1427
|
})
|
|
1263
1428
|
),
|
|
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:
|
|
1429
|
+
streakMilestone: z13.boolean()
|
|
1430
|
+
});
|
|
1431
|
+
var accessSchema = z13.object({
|
|
1432
|
+
actor: z13.string(),
|
|
1433
|
+
organization: z13.string(),
|
|
1434
|
+
admin: z13.boolean(),
|
|
1435
|
+
local: z13.boolean(),
|
|
1436
|
+
projects: z13.array(projectSchema)
|
|
1437
|
+
});
|
|
1438
|
+
var querySchema = z13.object({
|
|
1439
|
+
q: z13.string().max(200).default(""),
|
|
1440
|
+
filter: z13.string().max(50).default("all"),
|
|
1441
|
+
offset: z13.coerce.number().int().min(0).max(1e6).default(0),
|
|
1442
|
+
limit: z13.coerce.number().int().min(1).max(100).default(25)
|
|
1443
|
+
});
|
|
1444
|
+
var accountProfileSchema = z13.object({
|
|
1445
|
+
name: z13.string().optional(),
|
|
1281
1446
|
/** The account's handle, where the provider has one (X and Discord). */
|
|
1282
|
-
username:
|
|
1283
|
-
email:
|
|
1284
|
-
emailVerified:
|
|
1285
|
-
imageUrl:
|
|
1447
|
+
username: z13.string().optional(),
|
|
1448
|
+
email: z13.string().optional(),
|
|
1449
|
+
emailVerified: z13.boolean().default(false),
|
|
1450
|
+
imageUrl: z13.string().url().optional()
|
|
1286
1451
|
});
|
|
1287
|
-
var memberAccountSchema =
|
|
1452
|
+
var memberAccountSchema = z13.object({
|
|
1288
1453
|
/** `wallet` for wallet sign-in, `account` for every other connected account. */
|
|
1289
|
-
kind:
|
|
1290
|
-
provider:
|
|
1291
|
-
subject:
|
|
1292
|
-
signInEnabled:
|
|
1454
|
+
kind: z13.enum(["account", "wallet"]),
|
|
1455
|
+
provider: z13.string(),
|
|
1456
|
+
subject: z13.string(),
|
|
1457
|
+
signInEnabled: z13.boolean(),
|
|
1293
1458
|
profile: accountProfileSchema.optional()
|
|
1294
1459
|
});
|
|
1295
|
-
var operationSchema =
|
|
1296
|
-
target:
|
|
1297
|
-
paused:
|
|
1298
|
-
revision:
|
|
1299
|
-
reason:
|
|
1300
|
-
actor:
|
|
1301
|
-
changedAt:
|
|
1302
|
-
});
|
|
1303
|
-
var operationInputSchema =
|
|
1304
|
-
target:
|
|
1305
|
-
|
|
1306
|
-
|
|
1460
|
+
var operationSchema = z13.object({
|
|
1461
|
+
target: z13.string(),
|
|
1462
|
+
paused: z13.boolean(),
|
|
1463
|
+
revision: z13.number().int(),
|
|
1464
|
+
reason: z13.string(),
|
|
1465
|
+
actor: z13.string().nullable(),
|
|
1466
|
+
changedAt: z13.number()
|
|
1467
|
+
});
|
|
1468
|
+
var operationInputSchema = z13.object({
|
|
1469
|
+
target: z13.union([
|
|
1470
|
+
z13.literal("redemptions"),
|
|
1471
|
+
z13.string().regex(/^quest:[\w-]+$/)
|
|
1307
1472
|
]),
|
|
1308
|
-
paused:
|
|
1309
|
-
revision:
|
|
1310
|
-
reason:
|
|
1473
|
+
paused: z13.boolean(),
|
|
1474
|
+
revision: z13.number().int().nonnegative(),
|
|
1475
|
+
reason: z13.string().trim().min(1).max(500),
|
|
1311
1476
|
actionId: identifier
|
|
1312
1477
|
}).strict();
|
|
1313
|
-
var questLifecycleInputSchema =
|
|
1478
|
+
var questLifecycleInputSchema = z13.object({
|
|
1314
1479
|
quest: identifier,
|
|
1315
1480
|
expectedRelease: identifier.optional(),
|
|
1316
|
-
archived:
|
|
1317
|
-
reason:
|
|
1481
|
+
archived: z13.boolean(),
|
|
1482
|
+
reason: z13.string().trim().min(1).max(500),
|
|
1318
1483
|
actionId: identifier
|
|
1319
1484
|
}).strict();
|
|
1320
|
-
var questLifecycleSchema =
|
|
1485
|
+
var questLifecycleSchema = z13.object({
|
|
1321
1486
|
quest: identifier,
|
|
1322
1487
|
key: identifier.nullable(),
|
|
1323
|
-
title:
|
|
1488
|
+
title: z13.string(),
|
|
1324
1489
|
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:
|
|
1490
|
+
lifecycle: z13.enum(["active", "paused", "archived"]),
|
|
1491
|
+
changed: z13.boolean()
|
|
1492
|
+
});
|
|
1493
|
+
var memberSchema = z13.object({
|
|
1494
|
+
id: z13.string(),
|
|
1495
|
+
test: z13.boolean().optional(),
|
|
1496
|
+
name: z13.string().nullable().optional(),
|
|
1497
|
+
accounts: z13.array(memberAccountSchema).default([]),
|
|
1498
|
+
attempts: z13.number(),
|
|
1499
|
+
completions: z13.number(),
|
|
1500
|
+
rewards: z13.number(),
|
|
1501
|
+
lastActivity: z13.number().nullable()
|
|
1502
|
+
});
|
|
1503
|
+
var personSchema = z13.object({
|
|
1504
|
+
id: z13.string(),
|
|
1505
|
+
test: z13.boolean().optional(),
|
|
1506
|
+
name: z13.string().nullable().optional(),
|
|
1507
|
+
accounts: z13.array(memberAccountSchema).default([])
|
|
1508
|
+
});
|
|
1509
|
+
var metricsSchema = z13.object({
|
|
1510
|
+
quests: z13.number(),
|
|
1511
|
+
members: z13.number(),
|
|
1512
|
+
attempts: z13.number(),
|
|
1513
|
+
completions: z13.number(),
|
|
1514
|
+
review: z13.number(),
|
|
1515
|
+
failed: z13.number(),
|
|
1516
|
+
entitlements: z13.number()
|
|
1517
|
+
});
|
|
1518
|
+
var readinessSchema = z13.object({
|
|
1519
|
+
checks: z13.array(
|
|
1520
|
+
z13.object({
|
|
1521
|
+
id: z13.string(),
|
|
1522
|
+
status: z13.enum(["ready", "blocked"]),
|
|
1523
|
+
title: z13.string(),
|
|
1524
|
+
detail: z13.string()
|
|
1360
1525
|
})
|
|
1361
1526
|
)
|
|
1362
1527
|
});
|
|
1363
|
-
var inventorySchema =
|
|
1364
|
-
item:
|
|
1365
|
-
name:
|
|
1366
|
-
available:
|
|
1367
|
-
reserved:
|
|
1368
|
-
allocated:
|
|
1369
|
-
});
|
|
1370
|
-
var auditRecordSchema =
|
|
1371
|
-
id:
|
|
1372
|
-
action:
|
|
1373
|
-
actor:
|
|
1528
|
+
var inventorySchema = z13.object({
|
|
1529
|
+
item: z13.string(),
|
|
1530
|
+
name: z13.string().nullable().default(null),
|
|
1531
|
+
available: z13.number(),
|
|
1532
|
+
reserved: z13.number(),
|
|
1533
|
+
allocated: z13.number().default(0)
|
|
1534
|
+
});
|
|
1535
|
+
var auditRecordSchema = z13.object({
|
|
1536
|
+
id: z13.string(),
|
|
1537
|
+
action: z13.string(),
|
|
1538
|
+
actor: z13.string().nullable(),
|
|
1374
1539
|
user: operatorUserSchema.nullable().optional(),
|
|
1375
|
-
detail:
|
|
1376
|
-
at:
|
|
1377
|
-
attempt:
|
|
1540
|
+
detail: z13.string(),
|
|
1541
|
+
at: z13.number(),
|
|
1542
|
+
attempt: z13.string().nullable()
|
|
1378
1543
|
}).refine((record) => !record.user || record.user.id === record.actor, {
|
|
1379
1544
|
message: "User profile must match the recorded actor",
|
|
1380
1545
|
path: ["user"]
|
|
1381
1546
|
});
|
|
1382
|
-
var pageSchema =
|
|
1547
|
+
var pageSchema = z13.object({
|
|
1383
1548
|
snapshot: snapshotSchema,
|
|
1384
|
-
members:
|
|
1385
|
-
people:
|
|
1549
|
+
members: z13.array(memberSchema),
|
|
1550
|
+
people: z13.array(personSchema).default([]),
|
|
1386
1551
|
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 =
|
|
1552
|
+
total: z13.number(),
|
|
1553
|
+
offset: z13.number(),
|
|
1554
|
+
limit: z13.number(),
|
|
1555
|
+
inventory: z13.array(inventorySchema),
|
|
1556
|
+
operations: z13.array(operationSchema).default([]),
|
|
1557
|
+
audit: z13.array(auditRecordSchema).default([]),
|
|
1558
|
+
questCounts: z13.record(z13.string(), z13.number())
|
|
1559
|
+
});
|
|
1560
|
+
var managedOAuthAccountBaseSchema = z13.object({
|
|
1561
|
+
provider: z13.enum(["x", "discord"]),
|
|
1562
|
+
revision: z13.number().int().nonnegative()
|
|
1563
|
+
});
|
|
1564
|
+
var managedOAuthAccountSchema = z13.discriminatedUnion("status", [
|
|
1400
1565
|
managedOAuthAccountBaseSchema.extend({
|
|
1401
|
-
status:
|
|
1402
|
-
subject:
|
|
1403
|
-
linkedAt:
|
|
1566
|
+
status: z13.literal("connected"),
|
|
1567
|
+
subject: z13.string().min(1),
|
|
1568
|
+
linkedAt: z13.number()
|
|
1404
1569
|
}),
|
|
1405
|
-
managedOAuthAccountBaseSchema.extend({ status:
|
|
1570
|
+
managedOAuthAccountBaseSchema.extend({ status: z13.literal("disconnected") })
|
|
1406
1571
|
]);
|
|
1407
|
-
var memberOAuthUnlinkInputSchema =
|
|
1408
|
-
provider:
|
|
1409
|
-
subject:
|
|
1410
|
-
revision:
|
|
1411
|
-
reason:
|
|
1572
|
+
var memberOAuthUnlinkInputSchema = z13.object({
|
|
1573
|
+
provider: z13.enum(["x", "discord"]),
|
|
1574
|
+
subject: z13.string().min(1).max(4096),
|
|
1575
|
+
revision: z13.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER - 1),
|
|
1576
|
+
reason: z13.string().trim().min(1).max(500)
|
|
1412
1577
|
}).strict();
|
|
1413
1578
|
var managedWalletSchema = linkedWalletSchema.extend({
|
|
1414
|
-
status:
|
|
1415
|
-
unlinkedAt:
|
|
1579
|
+
status: z13.enum(["linked", "unlinked"]),
|
|
1580
|
+
unlinkedAt: z13.number().int().nullable(),
|
|
1416
1581
|
/** "member", or the operator or key that unlinked it. */
|
|
1417
|
-
unlinkedBy:
|
|
1582
|
+
unlinkedBy: z13.string().nullable()
|
|
1418
1583
|
});
|
|
1419
1584
|
var managedMemberIdentitySchema = memberIdentitySchema.extend({
|
|
1420
|
-
status:
|
|
1421
|
-
unlinkedAt:
|
|
1585
|
+
status: z13.enum(["linked", "unlinked"]),
|
|
1586
|
+
unlinkedAt: z13.number().int().nullable(),
|
|
1422
1587
|
/** The operator or key that unlinked it. */
|
|
1423
|
-
unlinkedBy:
|
|
1588
|
+
unlinkedBy: z13.string().nullable()
|
|
1424
1589
|
});
|
|
1425
|
-
var memberIdentityChangeInputSchema =
|
|
1590
|
+
var memberIdentityChangeInputSchema = z13.object({
|
|
1426
1591
|
kind: appIdentityKindSchema,
|
|
1427
|
-
subject:
|
|
1428
|
-
reason:
|
|
1592
|
+
subject: z13.string().min(1).max(256),
|
|
1593
|
+
reason: z13.string().trim().min(1).max(500)
|
|
1429
1594
|
}).strict();
|
|
1430
1595
|
var balanceCheckSchema = walletBalanceSchema.pick({
|
|
1431
1596
|
chain: true,
|
|
@@ -1435,65 +1600,65 @@ var balanceCheckSchema = walletBalanceSchema.pick({
|
|
|
1435
1600
|
wallets: true,
|
|
1436
1601
|
observedAt: true
|
|
1437
1602
|
}).extend({ attempt: identifier });
|
|
1438
|
-
var walletBalanceChainsSchema =
|
|
1439
|
-
chains:
|
|
1440
|
-
|
|
1441
|
-
chain:
|
|
1442
|
-
|
|
1603
|
+
var walletBalanceChainsSchema = z13.object({
|
|
1604
|
+
chains: z13.array(
|
|
1605
|
+
z13.object({
|
|
1606
|
+
chain: z13.union([
|
|
1607
|
+
z13.literal(solanaMainnet),
|
|
1443
1608
|
cosmosNetworkSchema,
|
|
1444
1609
|
evmChainIdSchema
|
|
1445
1610
|
]),
|
|
1446
|
-
name:
|
|
1447
|
-
testnet:
|
|
1611
|
+
name: z13.string(),
|
|
1612
|
+
testnet: z13.boolean()
|
|
1448
1613
|
})
|
|
1449
1614
|
)
|
|
1450
1615
|
});
|
|
1451
|
-
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason:
|
|
1616
|
+
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason: z13.string().trim().min(1).max(500) }).strict();
|
|
1452
1617
|
var memberWalletSignInInputSchema = walletUnlinkInputSchema.extend({
|
|
1453
|
-
enabled:
|
|
1454
|
-
reason:
|
|
1618
|
+
enabled: z13.boolean(),
|
|
1619
|
+
reason: z13.string().trim().min(1).max(500)
|
|
1455
1620
|
}).strict();
|
|
1456
|
-
var participantSignInSchema =
|
|
1457
|
-
providers:
|
|
1458
|
-
|
|
1621
|
+
var participantSignInSchema = z13.object({
|
|
1622
|
+
providers: z13.array(
|
|
1623
|
+
z13.object({ provider: authProviderSchema, configured: z13.boolean() })
|
|
1459
1624
|
),
|
|
1460
|
-
email:
|
|
1625
|
+
email: z13.boolean(),
|
|
1461
1626
|
/** Wallet families: `"solana"`, `"eip155"`, `"cosmos"`. */
|
|
1462
1627
|
wallets: walletSignInNetworksSchema,
|
|
1463
1628
|
/** Why participants cannot sign in to this project, or null. */
|
|
1464
|
-
issue:
|
|
1465
|
-
updatedAt:
|
|
1466
|
-
updatedBy:
|
|
1629
|
+
issue: z13.string().nullable(),
|
|
1630
|
+
updatedAt: z13.number().nullable(),
|
|
1631
|
+
updatedBy: z13.string().nullable()
|
|
1467
1632
|
});
|
|
1468
|
-
var participantSignInInputSchema =
|
|
1633
|
+
var participantSignInInputSchema = z13.object({
|
|
1469
1634
|
wallets: walletSignInNetworksSchema
|
|
1470
1635
|
}).strict();
|
|
1471
|
-
var completionRevocationShortfallSchema =
|
|
1636
|
+
var completionRevocationShortfallSchema = z13.object({
|
|
1472
1637
|
completion: identifier,
|
|
1473
1638
|
quest: identifier,
|
|
1474
|
-
revokedAt:
|
|
1475
|
-
unreversedPoints:
|
|
1639
|
+
revokedAt: z13.number().int().nonnegative().safe(),
|
|
1640
|
+
unreversedPoints: z13.record(identifier, z13.number().int().positive().safe())
|
|
1476
1641
|
});
|
|
1477
|
-
var memberDetailSchema =
|
|
1642
|
+
var memberDetailSchema = z13.object({
|
|
1478
1643
|
snapshot: snapshotSchema,
|
|
1479
1644
|
member: memberSchema,
|
|
1480
1645
|
progress: memberProgressSchema,
|
|
1481
1646
|
/** Up to 25 revoked completions with an unreversed point remainder, newest first. */
|
|
1482
|
-
revocationShortfalls:
|
|
1647
|
+
revocationShortfalls: z13.array(completionRevocationShortfallSchema).default([]),
|
|
1483
1648
|
/** Current and historical campaign enrollment state, including inactive enrollments. */
|
|
1484
|
-
campaignEnrollments:
|
|
1485
|
-
passes:
|
|
1486
|
-
|
|
1487
|
-
provider:
|
|
1488
|
-
event:
|
|
1489
|
-
subject:
|
|
1649
|
+
campaignEnrollments: z13.array(campaignEnrollmentSchema).default([]),
|
|
1650
|
+
passes: z13.array(
|
|
1651
|
+
z13.object({
|
|
1652
|
+
provider: z13.string(),
|
|
1653
|
+
event: z13.string(),
|
|
1654
|
+
subject: z13.string(),
|
|
1490
1655
|
attempt: identifier.nullable()
|
|
1491
1656
|
})
|
|
1492
1657
|
).default([]),
|
|
1493
1658
|
/** Linked and unlinked wallets. */
|
|
1494
|
-
wallets:
|
|
1659
|
+
wallets: z13.array(managedWalletSchema),
|
|
1495
1660
|
/** The member's 10 most recent recorded balance reads, newest first. */
|
|
1496
|
-
balanceChecks:
|
|
1661
|
+
balanceChecks: z13.array(balanceCheckSchema),
|
|
1497
1662
|
/** The member's participant profile in this project. */
|
|
1498
1663
|
profile: managedProfileSchema.nullable(),
|
|
1499
1664
|
/**
|
|
@@ -1501,126 +1666,126 @@ var memberDetailSchema = z12.object({
|
|
|
1501
1666
|
* member ID: their selected X and Discord accounts and their `app:<name>` identities in this
|
|
1502
1667
|
* project, including app identities an operator unlinked, by kind.
|
|
1503
1668
|
*/
|
|
1504
|
-
identities:
|
|
1669
|
+
identities: z13.array(managedMemberIdentitySchema)
|
|
1505
1670
|
});
|
|
1506
|
-
var stockInputSchema =
|
|
1671
|
+
var stockInputSchema = z13.object({
|
|
1507
1672
|
item: identifier,
|
|
1508
|
-
quantity:
|
|
1673
|
+
quantity: z13.number().int().positive().max(1e6),
|
|
1509
1674
|
actionId: identifier
|
|
1510
1675
|
}).strict();
|
|
1511
|
-
var ingestTrackerScopeSchema =
|
|
1512
|
-
var tokenScopeInputSchema =
|
|
1513
|
-
var tokenInputSchema =
|
|
1514
|
-
name:
|
|
1676
|
+
var ingestTrackerScopeSchema = z13.array(identifier).min(1).max(100).nullable();
|
|
1677
|
+
var tokenScopeInputSchema = z13.object({ ingestTrackers: ingestTrackerScopeSchema }).strict();
|
|
1678
|
+
var tokenInputSchema = z13.object({
|
|
1679
|
+
name: z13.string().trim().min(1).max(80),
|
|
1515
1680
|
project: identifier,
|
|
1516
1681
|
environment: environmentSchema,
|
|
1517
|
-
permissions:
|
|
1682
|
+
permissions: z13.array(permissionSchema).min(1),
|
|
1518
1683
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
1519
|
-
days:
|
|
1684
|
+
days: z13.number().int().min(1).max(90).default(30)
|
|
1520
1685
|
}).strict();
|
|
1521
|
-
var tokenSchema =
|
|
1522
|
-
id:
|
|
1523
|
-
name:
|
|
1524
|
-
project:
|
|
1686
|
+
var tokenSchema = z13.object({
|
|
1687
|
+
id: z13.string(),
|
|
1688
|
+
name: z13.string(),
|
|
1689
|
+
project: z13.string(),
|
|
1525
1690
|
environment: environmentSchema,
|
|
1526
1691
|
permissions: permissionListSchema,
|
|
1527
1692
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
1528
|
-
expiresAt:
|
|
1693
|
+
expiresAt: z13.number()
|
|
1529
1694
|
});
|
|
1530
|
-
var issuedTokenSchema = tokenSchema.extend({ token:
|
|
1531
|
-
var teamSchema =
|
|
1532
|
-
|
|
1695
|
+
var issuedTokenSchema = tokenSchema.extend({ token: z13.string() });
|
|
1696
|
+
var teamSchema = z13.array(
|
|
1697
|
+
z13.object({ id: z13.string(), label: z13.string() })
|
|
1533
1698
|
);
|
|
1534
|
-
var memberLookupSchema =
|
|
1535
|
-
provider:
|
|
1536
|
-
subject:
|
|
1699
|
+
var memberLookupSchema = z13.object({
|
|
1700
|
+
provider: z13.string().min(1).max(200),
|
|
1701
|
+
subject: z13.string().min(1).max(2048)
|
|
1537
1702
|
}).strict();
|
|
1538
|
-
var booleanQuery =
|
|
1539
|
-
|
|
1540
|
-
|
|
1703
|
+
var booleanQuery = z13.union([
|
|
1704
|
+
z13.boolean(),
|
|
1705
|
+
z13.enum(["true", "false"]).transform((v) => v === "true")
|
|
1541
1706
|
]);
|
|
1542
|
-
var managedMemberQuerySchema =
|
|
1543
|
-
q:
|
|
1707
|
+
var managedMemberQuerySchema = z13.strictObject({
|
|
1708
|
+
q: z13.string().max(200).optional(),
|
|
1544
1709
|
needsReview: booleanQuery.optional(),
|
|
1545
|
-
limit:
|
|
1710
|
+
limit: z13.coerce.number().int().min(1).max(100).optional(),
|
|
1546
1711
|
cursor: pageCursorSchema.optional()
|
|
1547
1712
|
});
|
|
1548
|
-
var managedMemberPageSchema =
|
|
1549
|
-
items:
|
|
1550
|
-
total:
|
|
1551
|
-
nextCursor:
|
|
1713
|
+
var managedMemberPageSchema = z13.object({
|
|
1714
|
+
items: z13.array(memberSchema),
|
|
1715
|
+
total: z13.number().int().nonnegative(),
|
|
1716
|
+
nextCursor: z13.string().nullable()
|
|
1552
1717
|
});
|
|
1553
1718
|
var projectMetricsSchema = metricsSchema.extend({
|
|
1554
|
-
completionsByQuest:
|
|
1555
|
-
|
|
1719
|
+
completionsByQuest: z13.array(
|
|
1720
|
+
z13.object({ quest: identifier, completions: z13.number() })
|
|
1556
1721
|
)
|
|
1557
1722
|
});
|
|
1558
|
-
var pageLimit =
|
|
1559
|
-
var managedAttemptQuerySchema =
|
|
1560
|
-
q:
|
|
1561
|
-
status:
|
|
1723
|
+
var pageLimit = z13.coerce.number().int().min(1).max(100).optional();
|
|
1724
|
+
var managedAttemptQuerySchema = z13.strictObject({
|
|
1725
|
+
q: z13.string().max(200).optional(),
|
|
1726
|
+
status: z13.string().min(1).max(50).optional(),
|
|
1562
1727
|
limit: pageLimit,
|
|
1563
1728
|
cursor: pageCursorSchema.optional()
|
|
1564
1729
|
});
|
|
1565
|
-
var managedAttemptPageSchema =
|
|
1566
|
-
items:
|
|
1567
|
-
releases:
|
|
1568
|
-
people:
|
|
1569
|
-
total:
|
|
1570
|
-
nextCursor:
|
|
1730
|
+
var managedAttemptPageSchema = z13.object({
|
|
1731
|
+
items: z13.array(attemptSchema),
|
|
1732
|
+
releases: z13.array(publishedReleaseSchema),
|
|
1733
|
+
people: z13.array(personSchema),
|
|
1734
|
+
total: z13.number().int().nonnegative(),
|
|
1735
|
+
nextCursor: z13.string().nullable()
|
|
1571
1736
|
});
|
|
1572
|
-
var managedReleaseQuerySchema =
|
|
1737
|
+
var managedReleaseQuerySchema = z13.strictObject({
|
|
1573
1738
|
quest: identifier.optional(),
|
|
1574
1739
|
limit: pageLimit,
|
|
1575
1740
|
cursor: pageCursorSchema.optional()
|
|
1576
1741
|
});
|
|
1577
|
-
var managedReleasePageSchema =
|
|
1578
|
-
items:
|
|
1579
|
-
nextCursor:
|
|
1742
|
+
var managedReleasePageSchema = z13.object({
|
|
1743
|
+
items: z13.array(publishedReleaseSchema),
|
|
1744
|
+
nextCursor: z13.string().nullable()
|
|
1580
1745
|
});
|
|
1581
|
-
var managedAttemptSchema =
|
|
1746
|
+
var managedAttemptSchema = z13.object({
|
|
1582
1747
|
attempt: attemptSchema,
|
|
1583
1748
|
release: publishedReleaseSchema.nullable(),
|
|
1584
|
-
events:
|
|
1749
|
+
events: z13.array(eventSchema),
|
|
1585
1750
|
person: personSchema
|
|
1586
1751
|
});
|
|
1587
|
-
var managedEntitlementQuerySchema =
|
|
1588
|
-
q:
|
|
1589
|
-
status:
|
|
1752
|
+
var managedEntitlementQuerySchema = z13.strictObject({
|
|
1753
|
+
q: z13.string().max(200).optional(),
|
|
1754
|
+
status: z13.string().min(1).max(50).optional(),
|
|
1590
1755
|
limit: pageLimit,
|
|
1591
1756
|
cursor: pageCursorSchema.optional()
|
|
1592
1757
|
});
|
|
1593
|
-
var managedEntitlementPageSchema =
|
|
1594
|
-
items:
|
|
1595
|
-
people:
|
|
1596
|
-
total:
|
|
1597
|
-
nextCursor:
|
|
1758
|
+
var managedEntitlementPageSchema = z13.object({
|
|
1759
|
+
items: z13.array(entitlementSchema),
|
|
1760
|
+
people: z13.array(personSchema),
|
|
1761
|
+
total: z13.number().int().nonnegative(),
|
|
1762
|
+
nextCursor: z13.string().nullable()
|
|
1598
1763
|
});
|
|
1599
|
-
var managedEntitlementSchema =
|
|
1764
|
+
var managedEntitlementSchema = z13.object({
|
|
1600
1765
|
entitlement: entitlementSchema,
|
|
1601
1766
|
person: personSchema
|
|
1602
1767
|
});
|
|
1603
1768
|
var managedStockItemSchema = inventorySchema.extend({
|
|
1604
|
-
offers:
|
|
1769
|
+
offers: z13.array(identifier)
|
|
1605
1770
|
});
|
|
1606
|
-
var auditQuerySchema =
|
|
1607
|
-
category:
|
|
1608
|
-
q:
|
|
1771
|
+
var auditQuerySchema = z13.strictObject({
|
|
1772
|
+
category: z13.enum(["reviews", "rewards", "configuration"]).optional(),
|
|
1773
|
+
q: z13.string().max(200).optional(),
|
|
1609
1774
|
limit: pageLimit,
|
|
1610
1775
|
cursor: pageCursorSchema.optional()
|
|
1611
1776
|
});
|
|
1612
1777
|
var accessHistoryQuerySchema = auditQuerySchema.omit({
|
|
1613
1778
|
category: true
|
|
1614
1779
|
});
|
|
1615
|
-
var auditPageSchema =
|
|
1616
|
-
items:
|
|
1617
|
-
total:
|
|
1618
|
-
nextCursor:
|
|
1780
|
+
var auditPageSchema = z13.object({
|
|
1781
|
+
items: z13.array(auditRecordSchema),
|
|
1782
|
+
total: z13.number().int().nonnegative(),
|
|
1783
|
+
nextCursor: z13.string().nullable()
|
|
1619
1784
|
});
|
|
1620
|
-
var verifiedPassSchema =
|
|
1785
|
+
var verifiedPassSchema = z13.object({
|
|
1621
1786
|
provider: identifier,
|
|
1622
1787
|
event: identifier,
|
|
1623
|
-
subject:
|
|
1788
|
+
subject: z13.string().min(1).max(2048),
|
|
1624
1789
|
member: identifier,
|
|
1625
1790
|
quest: identifier
|
|
1626
1791
|
}).strict();
|
|
@@ -1644,7 +1809,7 @@ function clientFailure(error) {
|
|
|
1644
1809
|
return new ManagementError({
|
|
1645
1810
|
kind: "client",
|
|
1646
1811
|
code: ManagementErrorCode.InvalidInput,
|
|
1647
|
-
message: error instanceof
|
|
1812
|
+
message: error instanceof z13.ZodError ? `Invalid management request: ${z13.prettifyError(error)}` : error instanceof Error ? error.message : "Invalid management request",
|
|
1648
1813
|
cause: error
|
|
1649
1814
|
});
|
|
1650
1815
|
}
|
|
@@ -1682,7 +1847,7 @@ function managementClient(options) {
|
|
|
1682
1847
|
call
|
|
1683
1848
|
);
|
|
1684
1849
|
}
|
|
1685
|
-
const ok =
|
|
1850
|
+
const ok = z13.object({ ok: z13.literal(true) });
|
|
1686
1851
|
function pointHistory(member, ledger, query = {}, call) {
|
|
1687
1852
|
return get(
|
|
1688
1853
|
`/points/${identifier.parse(member)}/${identifier.parse(ledger)}/history${queryString(typeof query === "number" ? { before: query } : pageQuerySchema.parse(query))}`,
|
|
@@ -1804,8 +1969,8 @@ function managementClient(options) {
|
|
|
1804
1969
|
}
|
|
1805
1970
|
return exchange(
|
|
1806
1971
|
path,
|
|
1807
|
-
|
|
1808
|
-
status:
|
|
1972
|
+
z13.object({
|
|
1973
|
+
status: z13.number(),
|
|
1809
1974
|
operationId: identifier.optional(),
|
|
1810
1975
|
result: schema
|
|
1811
1976
|
}),
|
|
@@ -1836,7 +2001,7 @@ function managementClient(options) {
|
|
|
1836
2001
|
call
|
|
1837
2002
|
),
|
|
1838
2003
|
...resourceArchiveMethods("tracker"),
|
|
1839
|
-
list: (call) => get("/trackers",
|
|
2004
|
+
list: (call) => get("/trackers", z13.array(trackerStatusSchema), call),
|
|
1840
2005
|
get: (reference, call) => get(
|
|
1841
2006
|
`/trackers/${identifier.parse(reference)}`,
|
|
1842
2007
|
trackerStatusSchema,
|
|
@@ -1952,7 +2117,7 @@ function managementClient(options) {
|
|
|
1952
2117
|
engagementPublishSchema.parse(withActionId(input)),
|
|
1953
2118
|
call
|
|
1954
2119
|
),
|
|
1955
|
-
list: (call) => get("/engagement",
|
|
2120
|
+
list: (call) => get("/engagement", z13.array(engagementRuleSchema), call),
|
|
1956
2121
|
page: (input, call) => get(
|
|
1957
2122
|
"/engagement/history" + queryString(engagementPageQuerySchema.parse(input)),
|
|
1958
2123
|
engagementPageSchema,
|
|
@@ -1973,7 +2138,7 @@ function managementClient(options) {
|
|
|
1973
2138
|
},
|
|
1974
2139
|
pointLedgers: {
|
|
1975
2140
|
unarchive: (ledger, input, call) => archiveResource("point-ledger", ledger, false, input, call),
|
|
1976
|
-
list: (call) => get("/point-ledgers",
|
|
2141
|
+
list: (call) => get("/point-ledgers", z13.array(managedPointLedgerSchema), call),
|
|
1977
2142
|
/**
|
|
1978
2143
|
* Creates a point ledger, with a stable `key` when code refers to it; requires `publish`. In
|
|
1979
2144
|
* live, only a person in Console can create one.
|
|
@@ -2003,7 +2168,7 @@ function managementClient(options) {
|
|
|
2003
2168
|
},
|
|
2004
2169
|
points: {
|
|
2005
2170
|
/** @deprecated Use `pointLedgers.list()`, which reads the same ledgers. Removed in 2.0.0. */
|
|
2006
|
-
ledgers: (call) => get("/point-ledgers",
|
|
2171
|
+
ledgers: (call) => get("/point-ledgers", z13.array(managedPointLedgerSchema), call),
|
|
2007
2172
|
/** @deprecated Use `pointLedgers.create(input)`. Removed in 2.0.0. */
|
|
2008
2173
|
createLedger: createPointLedger,
|
|
2009
2174
|
/**
|
|
@@ -2041,7 +2206,7 @@ function managementClient(options) {
|
|
|
2041
2206
|
referralHistorySchema,
|
|
2042
2207
|
call
|
|
2043
2208
|
),
|
|
2044
|
-
list: (call) => get("/referrals",
|
|
2209
|
+
list: (call) => get("/referrals", z13.array(publishedReferralSchema), call),
|
|
2045
2210
|
participants: referralParticipants,
|
|
2046
2211
|
/**
|
|
2047
2212
|
* Suspends or restores a member's referral relationship, with a reason; requires `publish`.
|
|
@@ -2104,7 +2269,7 @@ function managementClient(options) {
|
|
|
2104
2269
|
},
|
|
2105
2270
|
leaderboards: {
|
|
2106
2271
|
...resourceArchiveMethods("leaderboard"),
|
|
2107
|
-
list: (call) => get("/leaderboards",
|
|
2272
|
+
list: (call) => get("/leaderboards", z13.array(publishedLeaderboardSchema), call),
|
|
2108
2273
|
standings: (board, input = {}, call) => {
|
|
2109
2274
|
const query = leaderboardQuerySchema.parse(input);
|
|
2110
2275
|
return get(
|
|
@@ -2118,12 +2283,12 @@ function managementClient(options) {
|
|
|
2118
2283
|
},
|
|
2119
2284
|
history: (board, call) => get(
|
|
2120
2285
|
`/leaderboards/${identifier.parse(board)}/history`,
|
|
2121
|
-
|
|
2286
|
+
z13.array(publishedLeaderboardSchema),
|
|
2122
2287
|
call
|
|
2123
2288
|
),
|
|
2124
2289
|
exclusions: (board, call) => get(
|
|
2125
2290
|
`/leaderboards/${identifier.parse(board)}/exclusions`,
|
|
2126
|
-
|
|
2291
|
+
z13.array(z13.object({ member: identifier })),
|
|
2127
2292
|
call
|
|
2128
2293
|
),
|
|
2129
2294
|
exclude: (board, input, call) => post(
|
|
@@ -2164,7 +2329,7 @@ function managementClient(options) {
|
|
|
2164
2329
|
),
|
|
2165
2330
|
settlements: (board, call) => get(
|
|
2166
2331
|
`/leaderboards/${identifier.parse(board)}/settlements`,
|
|
2167
|
-
|
|
2332
|
+
z13.array(leaderboardSettlementSummarySchema),
|
|
2168
2333
|
call
|
|
2169
2334
|
),
|
|
2170
2335
|
settlement: (settlement, call) => get(
|
|
@@ -2244,7 +2409,7 @@ function managementClient(options) {
|
|
|
2244
2409
|
)
|
|
2245
2410
|
},
|
|
2246
2411
|
deployments: {
|
|
2247
|
-
list: (call) => get("/deployments",
|
|
2412
|
+
list: (call) => get("/deployments", z13.array(deploymentRecordSchema), call),
|
|
2248
2413
|
get: (deployment, call) => get(
|
|
2249
2414
|
`/deployments/${identifier.parse(deployment)}`,
|
|
2250
2415
|
deploymentRecordSchema,
|
|
@@ -2513,7 +2678,7 @@ function managementClient(options) {
|
|
|
2513
2678
|
},
|
|
2514
2679
|
operations: {
|
|
2515
2680
|
/** Every paused or resumed operation: redemptions and each quest's participation; requires `read`. */
|
|
2516
|
-
list: (call) => get("/operations",
|
|
2681
|
+
list: (call) => get("/operations", z13.array(operationSchema), call),
|
|
2517
2682
|
/**
|
|
2518
2683
|
* Pauses or resumes redemptions or one quest's participation, against the `revision` the
|
|
2519
2684
|
* operator saw, with a reason; requires `publish` permission.
|
|
@@ -2562,7 +2727,7 @@ function managementClient(options) {
|
|
|
2562
2727
|
call
|
|
2563
2728
|
),
|
|
2564
2729
|
/** Every stock item with its counts and the offers that sell it; requires `read` permission. */
|
|
2565
|
-
list: (call) => get("/stock-items",
|
|
2730
|
+
list: (call) => get("/stock-items", z13.array(managedStockItemSchema), call),
|
|
2566
2731
|
createItem: (input, call) => create(
|
|
2567
2732
|
"/stock-items",
|
|
2568
2733
|
stockItemSchema,
|
|
@@ -2577,7 +2742,7 @@ function managementClient(options) {
|
|
|
2577
2742
|
stockInputSchema.parse(withActionId(input)),
|
|
2578
2743
|
call
|
|
2579
2744
|
),
|
|
2580
|
-
catalog: (call) => get("/pickup-inventory",
|
|
2745
|
+
catalog: (call) => get("/pickup-inventory", z13.array(pickupCatalogSchema), call),
|
|
2581
2746
|
configure: (input, call) => post(
|
|
2582
2747
|
"/pickup-inventory",
|
|
2583
2748
|
pickupCatalogSchema,
|
|
@@ -2603,10 +2768,10 @@ function managementClient(options) {
|
|
|
2603
2768
|
offerControlSchema.omit({ enabled: true }).parse(withActionId(input)),
|
|
2604
2769
|
call
|
|
2605
2770
|
),
|
|
2606
|
-
list: (call) => get("/offers",
|
|
2771
|
+
list: (call) => get("/offers", z13.array(offerSchema), call),
|
|
2607
2772
|
redemptions: (input = {}, call) => get(
|
|
2608
2773
|
`/redemptions${queryString({ member: input.member })}`,
|
|
2609
|
-
|
|
2774
|
+
z13.array(redemptionSchema),
|
|
2610
2775
|
call
|
|
2611
2776
|
),
|
|
2612
2777
|
/** Pauses or resumes an offer at the revision the operator saw. */
|
|
@@ -2655,7 +2820,7 @@ function managementClient(options) {
|
|
|
2655
2820
|
* them; API keys and project-scoped playground sessions cannot.
|
|
2656
2821
|
*/
|
|
2657
2822
|
tokens: {
|
|
2658
|
-
list: (call) => get("/tokens",
|
|
2823
|
+
list: (call) => get("/tokens", z13.array(tokenSchema), call),
|
|
2659
2824
|
/**
|
|
2660
2825
|
* Issues a key for one project and environment, limited to permissions the caller holds
|
|
2661
2826
|
* there. The secret `token` is in this response only.
|
|
@@ -2663,14 +2828,14 @@ function managementClient(options) {
|
|
|
2663
2828
|
create: (input, call) => post("/tokens", issuedTokenSchema, tokenInputSchema.parse(input), call),
|
|
2664
2829
|
/** Replace a personal key's ingestion restriction without changing its secret. */
|
|
2665
2830
|
scope: (id, input, call) => request(
|
|
2666
|
-
`/tokens/${encodeURIComponent(
|
|
2831
|
+
`/tokens/${encodeURIComponent(z13.string().min(1).parse(id))}/scope`,
|
|
2667
2832
|
tokenSchema,
|
|
2668
2833
|
tokenScopeInputSchema.parse(input),
|
|
2669
2834
|
"PUT",
|
|
2670
2835
|
call
|
|
2671
2836
|
),
|
|
2672
2837
|
revoke: (id, call) => request(
|
|
2673
|
-
`/tokens/${encodeURIComponent(
|
|
2838
|
+
`/tokens/${encodeURIComponent(z13.string().min(1).parse(id))}`,
|
|
2674
2839
|
ok,
|
|
2675
2840
|
void 0,
|
|
2676
2841
|
"DELETE",
|
|
@@ -2679,7 +2844,7 @@ function managementClient(options) {
|
|
|
2679
2844
|
},
|
|
2680
2845
|
/** Who holds which roles on the client's project; organization administrators only. */
|
|
2681
2846
|
grants: {
|
|
2682
|
-
list: (call) => get("/grants",
|
|
2847
|
+
list: (call) => get("/grants", z13.array(grantRecordSchema), call),
|
|
2683
2848
|
/** Replaces one person's roles and environments on the project. The audit log records it. */
|
|
2684
2849
|
set: (input, call) => request(
|
|
2685
2850
|
"/grants",
|
|
@@ -2696,7 +2861,7 @@ function managementClient(options) {
|
|
|
2696
2861
|
/** Signed activity notifications for one project/environment; writes require publish permission. */
|
|
2697
2862
|
webhooks: {
|
|
2698
2863
|
state: (id, call) => get(
|
|
2699
|
-
`/webhooks/${
|
|
2864
|
+
`/webhooks/${z13.string().uuid().parse(id)}/state`,
|
|
2700
2865
|
webhookEndpointStateSchema,
|
|
2701
2866
|
call
|
|
2702
2867
|
),
|
|
@@ -2707,24 +2872,24 @@ function managementClient(options) {
|
|
|
2707
2872
|
call
|
|
2708
2873
|
),
|
|
2709
2874
|
delete: (id, input, call) => post(
|
|
2710
|
-
`/webhooks/${
|
|
2875
|
+
`/webhooks/${z13.string().uuid().parse(id)}/delete`,
|
|
2711
2876
|
webhookEndpointStateSchema,
|
|
2712
2877
|
webhookDeleteInputSchema.parse(withActionId(input)),
|
|
2713
2878
|
call
|
|
2714
2879
|
),
|
|
2715
2880
|
pause: (id, input = {}, call) => post(
|
|
2716
|
-
`/webhooks/${
|
|
2881
|
+
`/webhooks/${z13.string().uuid().parse(id)}/pause`,
|
|
2717
2882
|
webhookEndpointSchema,
|
|
2718
2883
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
2719
2884
|
call
|
|
2720
2885
|
),
|
|
2721
2886
|
resume: (id, input = {}, call) => post(
|
|
2722
|
-
`/webhooks/${
|
|
2887
|
+
`/webhooks/${z13.string().uuid().parse(id)}/resume`,
|
|
2723
2888
|
webhookEndpointSchema,
|
|
2724
2889
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
2725
2890
|
call
|
|
2726
2891
|
),
|
|
2727
|
-
list: (call) => get("/webhooks",
|
|
2892
|
+
list: (call) => get("/webhooks", z13.array(webhookEndpointSchema), call),
|
|
2728
2893
|
create: (input, call) => post(
|
|
2729
2894
|
"/webhooks",
|
|
2730
2895
|
webhookSecretSchema,
|
|
@@ -2732,7 +2897,7 @@ function managementClient(options) {
|
|
|
2732
2897
|
call
|
|
2733
2898
|
),
|
|
2734
2899
|
update: (id, input, call) => request(
|
|
2735
|
-
`/webhooks/${
|
|
2900
|
+
`/webhooks/${z13.string().uuid().parse(id)}`,
|
|
2736
2901
|
webhookEndpointSchema,
|
|
2737
2902
|
webhookUpdateSchema.parse(input),
|
|
2738
2903
|
"PUT",
|
|
@@ -2740,24 +2905,24 @@ function managementClient(options) {
|
|
|
2740
2905
|
),
|
|
2741
2906
|
/** @deprecated Use pause. Removed in 2.0.0. */
|
|
2742
2907
|
disable: (id, call) => post(
|
|
2743
|
-
`/webhooks/${
|
|
2908
|
+
`/webhooks/${z13.string().uuid().parse(id)}/disable`,
|
|
2744
2909
|
webhookEndpointSchema,
|
|
2745
2910
|
{},
|
|
2746
2911
|
call
|
|
2747
2912
|
),
|
|
2748
2913
|
rotateSecret: (id, call) => post(
|
|
2749
|
-
`/webhooks/${
|
|
2914
|
+
`/webhooks/${z13.string().uuid().parse(id)}/rotate-secret`,
|
|
2750
2915
|
webhookSecretSchema,
|
|
2751
2916
|
{},
|
|
2752
2917
|
call
|
|
2753
2918
|
),
|
|
2754
2919
|
deliveries: (id, query = {}, call) => get(
|
|
2755
|
-
`/webhooks/${
|
|
2920
|
+
`/webhooks/${z13.string().uuid().parse(id)}/deliveries${queryString(webhookQuerySchema.parse(query))}`,
|
|
2756
2921
|
webhookDeliveryPageSchema,
|
|
2757
2922
|
call
|
|
2758
2923
|
),
|
|
2759
2924
|
replay: (id, delivery, call) => post(
|
|
2760
|
-
`/webhooks/${
|
|
2925
|
+
`/webhooks/${z13.string().uuid().parse(id)}/deliveries/${z13.string().uuid().parse(delivery)}/replay`,
|
|
2761
2926
|
webhookDeliverySchema,
|
|
2762
2927
|
{},
|
|
2763
2928
|
call
|
|
@@ -2768,7 +2933,7 @@ function managementClient(options) {
|
|
|
2768
2933
|
* environment. Organization administrators, from a Console session only.
|
|
2769
2934
|
*/
|
|
2770
2935
|
identityIntegrations: {
|
|
2771
|
-
list: (call) => get("/identity-integrations",
|
|
2936
|
+
list: (call) => get("/identity-integrations", z13.array(identityIntegrationSchema), call),
|
|
2772
2937
|
/** The secret `token` is in this response only. */
|
|
2773
2938
|
create: (input, call) => post(
|
|
2774
2939
|
"/identity-integrations",
|
|
@@ -2778,7 +2943,7 @@ function managementClient(options) {
|
|
|
2778
2943
|
),
|
|
2779
2944
|
/** Replaces the key's secret and extends it by 90 days; the old secret stops working. */
|
|
2780
2945
|
rotate: (id, call) => post(
|
|
2781
|
-
`/identity-integrations/${
|
|
2946
|
+
`/identity-integrations/${z13.string().uuid().parse(id)}/rotate`,
|
|
2782
2947
|
identityIntegrationSecretSchema,
|
|
2783
2948
|
{},
|
|
2784
2949
|
call
|
|
@@ -2790,7 +2955,7 @@ function managementClient(options) {
|
|
|
2790
2955
|
*/
|
|
2791
2956
|
kinds: (call) => get(
|
|
2792
2957
|
"/identity-integrations/kinds",
|
|
2793
|
-
|
|
2958
|
+
z13.array(identityKindClaimSchema),
|
|
2794
2959
|
call
|
|
2795
2960
|
),
|
|
2796
2961
|
/**
|
|
@@ -2798,8 +2963,8 @@ function managementClient(options) {
|
|
|
2798
2963
|
* and keep attributing tracker records; unlink them on the member to stop that.
|
|
2799
2964
|
*/
|
|
2800
2965
|
revoke: (id, call) => request(
|
|
2801
|
-
`/identity-integrations/${
|
|
2802
|
-
|
|
2966
|
+
`/identity-integrations/${z13.string().uuid().parse(id)}`,
|
|
2967
|
+
z13.null(),
|
|
2803
2968
|
void 0,
|
|
2804
2969
|
"DELETE",
|
|
2805
2970
|
call
|
|
@@ -2850,7 +3015,7 @@ function managementClient(options) {
|
|
|
2850
3015
|
resources: {
|
|
2851
3016
|
list: (call) => get(
|
|
2852
3017
|
"/resources",
|
|
2853
|
-
|
|
3018
|
+
z13.object({ resources: z13.array(managedResourceSchema) }),
|
|
2854
3019
|
call
|
|
2855
3020
|
),
|
|
2856
3021
|
/** @deprecated Use the resource archive/unarchive methods. Removed in 2.0.0. */
|
|
@@ -2887,7 +3052,7 @@ function managementClient(options) {
|
|
|
2887
3052
|
testMemberCreateSchema.parse(withActionId(input)),
|
|
2888
3053
|
call
|
|
2889
3054
|
),
|
|
2890
|
-
list: (call) => get("/test-members",
|
|
3055
|
+
list: (call) => get("/test-members", z13.array(testMemberSchema), call),
|
|
2891
3056
|
history: (member, query = {}, call) => get(
|
|
2892
3057
|
`/test-members/${identifier.parse(member)}/history${queryString(testMemberHistoryQuerySchema.parse(query))}`,
|
|
2893
3058
|
testMemberHistorySchema,
|
|
@@ -2969,26 +3134,26 @@ function managementClient(options) {
|
|
|
2969
3134
|
/** Who each member is: up to 100 distinct IDs; unknown IDs come back without accounts. */
|
|
2970
3135
|
people: (members, call) => get(
|
|
2971
3136
|
`/people${queryString({ ids: members.join(",") })}`,
|
|
2972
|
-
|
|
3137
|
+
z13.array(personSchema),
|
|
2973
3138
|
call
|
|
2974
3139
|
),
|
|
2975
3140
|
/** Current X and Discord quest account selections; requires read permission. */
|
|
2976
3141
|
oauthAccounts: (member, call) => get(
|
|
2977
3142
|
`/members/${encodeURIComponent(member)}/oauth-accounts`,
|
|
2978
|
-
|
|
3143
|
+
z13.array(managedOAuthAccountSchema),
|
|
2979
3144
|
call
|
|
2980
3145
|
),
|
|
2981
3146
|
/** Unlinks the reviewed selection across this organization/environment, preserving ownership and sign-in. */
|
|
2982
3147
|
unlinkOAuthAccount: (member, input, call) => post(
|
|
2983
3148
|
`/members/${encodeURIComponent(member)}/oauth-accounts/unlink`,
|
|
2984
|
-
|
|
3149
|
+
z13.array(managedOAuthAccountSchema),
|
|
2985
3150
|
memberOAuthUnlinkInputSchema.parse(input),
|
|
2986
3151
|
call
|
|
2987
3152
|
),
|
|
2988
3153
|
/** Unlinks a member's wallet from the project with a reason; requires `review` permission. The address stays bound to the member. */
|
|
2989
3154
|
unlinkWallet: (member, input, call) => post(
|
|
2990
3155
|
`/members/${encodeURIComponent(member)}/wallets/unlink`,
|
|
2991
|
-
|
|
3156
|
+
z13.array(managedWalletSchema),
|
|
2992
3157
|
memberWalletUnlinkInputSchema.parse(input),
|
|
2993
3158
|
call
|
|
2994
3159
|
),
|
|
@@ -2999,14 +3164,14 @@ function managementClient(options) {
|
|
|
2999
3164
|
*/
|
|
3000
3165
|
unlinkIdentity: (member, input, call) => post(
|
|
3001
3166
|
`/members/${encodeURIComponent(member)}/identities/unlink`,
|
|
3002
|
-
|
|
3167
|
+
z13.array(managedMemberIdentitySchema),
|
|
3003
3168
|
memberIdentityChangeInputSchema.parse(input),
|
|
3004
3169
|
call
|
|
3005
3170
|
),
|
|
3006
3171
|
/** Relinks an `app:<name>` identity an operator unlinked from this member, with a reason; requires `review` permission. */
|
|
3007
3172
|
relinkIdentity: (member, input, call) => post(
|
|
3008
3173
|
`/members/${encodeURIComponent(member)}/identities/relink`,
|
|
3009
|
-
|
|
3174
|
+
z13.array(managedMemberIdentitySchema),
|
|
3010
3175
|
memberIdentityChangeInputSchema.parse(input),
|
|
3011
3176
|
call
|
|
3012
3177
|
),
|
|
@@ -3016,7 +3181,7 @@ function managementClient(options) {
|
|
|
3016
3181
|
*/
|
|
3017
3182
|
setWalletSignIn: (member, input, call) => post(
|
|
3018
3183
|
`/members/${encodeURIComponent(member)}/wallets/sign-in`,
|
|
3019
|
-
|
|
3184
|
+
z13.array(managedWalletSchema),
|
|
3020
3185
|
memberWalletSignInInputSchema.parse(input),
|
|
3021
3186
|
call
|
|
3022
3187
|
)
|
|
@@ -3043,6 +3208,28 @@ function managementClient(options) {
|
|
|
3043
3208
|
* deleting a store need `publish`. Reads never change data, and only a store no serving build
|
|
3044
3209
|
* declares can be deleted.
|
|
3045
3210
|
*/
|
|
3211
|
+
schedules: {
|
|
3212
|
+
list: (call) => get("/schedules", appScheduleListSchema, call),
|
|
3213
|
+
run: (name, call) => post(
|
|
3214
|
+
`/schedules/${appScheduleNameSchema.parse(name)}/run`,
|
|
3215
|
+
appScheduleListSchema,
|
|
3216
|
+
{},
|
|
3217
|
+
call
|
|
3218
|
+
),
|
|
3219
|
+
setState: (state2, call) => request(
|
|
3220
|
+
"/schedules/state",
|
|
3221
|
+
appScheduleListSchema,
|
|
3222
|
+
{ state: appScheduleStateSchema.parse(state2) },
|
|
3223
|
+
"PUT",
|
|
3224
|
+
call
|
|
3225
|
+
),
|
|
3226
|
+
recover: (name, input, call) => post(
|
|
3227
|
+
`/schedules/${appScheduleNameSchema.parse(name)}/recover`,
|
|
3228
|
+
appScheduleListSchema,
|
|
3229
|
+
input,
|
|
3230
|
+
call
|
|
3231
|
+
)
|
|
3232
|
+
},
|
|
3046
3233
|
storage: {
|
|
3047
3234
|
list: (call) => get("/storage", appStorageListSchema, call),
|
|
3048
3235
|
/** A SQL store's tables and views, without SQLite's and D1's own. */
|
|
@@ -3166,7 +3353,7 @@ function managementClient(options) {
|
|
|
3166
3353
|
* Each quest's current release, the most recently published first, archived quests
|
|
3167
3354
|
* included; requires `read` permission.
|
|
3168
3355
|
*/
|
|
3169
|
-
list: (call) => get("/quests/list",
|
|
3356
|
+
list: (call) => get("/quests/list", z13.array(publishedReleaseSchema), call),
|
|
3170
3357
|
/** Pending and exhausted asynchronous balance checks. Requires read. */
|
|
3171
3358
|
automaticScheduling: (query = {}, call) => get(
|
|
3172
3359
|
`/quests/automatic-scheduling${queryString(automaticSchedulingQuerySchema.parse(query))}`,
|
|
@@ -3795,6 +3982,9 @@ export {
|
|
|
3795
3982
|
APP_MIGRATION_FILE_BYTES,
|
|
3796
3983
|
APP_MIGRATION_LIMIT,
|
|
3797
3984
|
APP_MIGRATION_TOTAL_BYTES,
|
|
3985
|
+
APP_SCHEDULE_LIMIT,
|
|
3986
|
+
APP_SCHEDULE_MIN_INTERVAL,
|
|
3987
|
+
APP_SCHEDULE_TIMEOUT,
|
|
3798
3988
|
APP_SECRET_LIMIT,
|
|
3799
3989
|
APP_SQL_LIMIT,
|
|
3800
3990
|
APP_STORAGE_PREVIEW_CHARACTERS,
|
|
@@ -3817,6 +4007,13 @@ export {
|
|
|
3817
4007
|
addGroupMemberSchema,
|
|
3818
4008
|
appMigrationNameSchema,
|
|
3819
4009
|
appRoutingSchema,
|
|
4010
|
+
appScheduleListSchema,
|
|
4011
|
+
appScheduleNameSchema,
|
|
4012
|
+
appSchedulePathSchema,
|
|
4013
|
+
appScheduleRunSchema,
|
|
4014
|
+
appScheduleSchema,
|
|
4015
|
+
appScheduleStateSchema,
|
|
4016
|
+
appSchedulesSchema,
|
|
3820
4017
|
appSecretDeclarationSchema,
|
|
3821
4018
|
appSecretDeclarationsSchema,
|
|
3822
4019
|
appSecretInputSchema,
|
|
@@ -3934,6 +4131,7 @@ export {
|
|
|
3934
4131
|
memberWalletSignInInputSchema,
|
|
3935
4132
|
memberWalletUnlinkInputSchema,
|
|
3936
4133
|
metricsSchema,
|
|
4134
|
+
nextScheduleRun,
|
|
3937
4135
|
oauthIdentitySelectorSchema,
|
|
3938
4136
|
operationInputSchema,
|
|
3939
4137
|
operationSchema,
|
|
@@ -3978,6 +4176,7 @@ export {
|
|
|
3978
4176
|
resourceLifecycleResultSchema,
|
|
3979
4177
|
rolePermissions,
|
|
3980
4178
|
roleSchema,
|
|
4179
|
+
scheduledInvocationSchema,
|
|
3981
4180
|
sequenceCursorSchema,
|
|
3982
4181
|
sourceDataSchema,
|
|
3983
4182
|
sourceRoles,
|
|
@@ -4013,6 +4212,7 @@ export {
|
|
|
4013
4212
|
updateGroupSchema,
|
|
4014
4213
|
validateQuestShape,
|
|
4015
4214
|
verifiedPassSchema,
|
|
4215
|
+
verifyScheduledRequest,
|
|
4016
4216
|
verifyWebhook,
|
|
4017
4217
|
walletBalanceChainsSchema,
|
|
4018
4218
|
walletIdentitySelectorSchema,
|