@domino-sdk/relay 1.39.0 → 1.42.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-CSiN1HKd.d.ts → attempt-captures-CoaD0RmS.d.ts} +1 -1
- package/dist/authoring.d.ts +49 -49
- package/dist/authoring.js +4 -4
- package/dist/{automatic-outcomes-DDbgRubQ.d.ts → automatic-outcomes-B82GzaVN.d.ts} +1 -1
- package/dist/avatar.d.ts +2 -2
- package/dist/browser.d.ts +9 -9
- package/dist/browser.js +10 -10
- package/dist/{chunk-SBW52XXL.js → chunk-34ZGBXN7.js} +1 -1
- package/dist/{chunk-E4CDOF4H.js → chunk-3VSX2V5N.js} +13 -7
- package/dist/{chunk-BYX27T2S.js → chunk-6KZPQI6F.js} +2 -2
- package/dist/{chunk-OEO5OBY5.js → chunk-6RYZG6TV.js} +579 -533
- package/dist/{chunk-V7KYVH3Z.js → chunk-B3KVWKL2.js} +1 -1
- package/dist/{chunk-FTGW72A6.js → chunk-IEBVJN6A.js} +1 -1
- package/dist/{chunk-RW4XQN4Z.js → chunk-JFNJE2I4.js} +1 -1
- package/dist/{chunk-B65YJ6K4.js → chunk-OZQML7VU.js} +1 -1
- package/dist/{chunk-CRX274HO.js → chunk-PG3MC2AM.js} +1 -1
- package/dist/{chunk-ANHELJIY.js → chunk-QLDURQPB.js} +1 -1
- package/dist/{chunk-ZT7FPD7B.js → chunk-RMZXRL4V.js} +1 -1
- package/dist/{chunk-XZKZJIES.js → chunk-SAUBTWEA.js} +6 -2
- package/dist/{chunk-2JBNPAE7.js → chunk-TA3SFVT5.js} +2 -2
- package/dist/{chunk-ZTEXSD5D.js → chunk-UXFFSWB3.js} +8 -8
- package/dist/{chunk-VDRO7BU5.js → chunk-Y2BQRXJD.js} +4 -4
- package/dist/{chunk-YNQPFRQO.js → chunk-Y4OM7CHT.js} +1 -1
- package/dist/{client-CxHKODc4.d.ts → client-CAgnkFxn.d.ts} +7 -7
- package/dist/{deployments-DYeuxXYg.d.ts → deployments-DuIdJ2Ui.d.ts} +349 -213
- package/dist/{groups-DY5rZssO.d.ts → groups-CX1C9gln.d.ts} +2 -2
- package/dist/index.d.ts +10 -10
- package/dist/index.js +9 -9
- package/dist/internal.d.ts +10 -10
- package/dist/internal.js +8 -8
- package/dist/{offers-DtYGNKdQ.d.ts → offers-UL9bdaP0.d.ts} +2 -2
- package/dist/{pages-DR2YRvAp.d.ts → pages-Brtjxb2P.d.ts} +26 -2
- package/dist/{participant-activity-CoB2F30C.d.ts → participant-activity-iciCEs_8.d.ts} +1 -1
- package/dist/portal-proxy.js +3 -3
- package/dist/{profiles-BHuQdzsW.d.ts → profiles-Cdv4BSd_.d.ts} +1 -1
- package/dist/react/index.d.ts +14 -11
- package/dist/react/index.js +17 -10
- package/dist/{schema-Cgmj-CbC.d.ts → schema-Dg5_t7Pq.d.ts} +17 -1
- package/dist/schema.d.ts +367 -325
- package/dist/schema.js +19 -7
- package/dist/server/index.d.ts +10 -10
- package/dist/server/index.js +768 -611
- package/dist/{submission-input-BkIbBPRU.d.ts → submission-input-D5Gh3GR0.d.ts} +2 -2
- package/dist/{telegram-browser-laDdm730.d.ts → telegram-browser-riVjoKFg.d.ts} +3 -3
- package/dist/testing.d.ts +4 -4
- package/dist/testing.js +5 -5
- package/dist/{transport-CkTEfXL9.d.ts → transport-VGEsiskZ.d.ts} +5100 -3074
- package/dist/{wallet-t7uNDg9p.d.ts → wallet-Ac7OFpOr.d.ts} +1 -1
- package/dist/{x-vVG6gZqi.d.ts → x-CAxOrR61.d.ts} +1 -1
- package/package.json +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-RMZXRL4V.js";
|
|
5
5
|
import {
|
|
6
6
|
activityTypeSchema,
|
|
7
7
|
activityTypes,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
publishDeploymentSchema,
|
|
28
28
|
rejectDeploymentSchema,
|
|
29
29
|
submitDeploymentSchema
|
|
30
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-3VSX2V5N.js";
|
|
31
31
|
import "../chunk-4OC7REYX.js";
|
|
32
32
|
import {
|
|
33
33
|
DEFAULT_MANAGEMENT_TIMEOUT,
|
|
@@ -48,21 +48,21 @@ import {
|
|
|
48
48
|
participantExchangeSchema,
|
|
49
49
|
questConfiguration,
|
|
50
50
|
sequenceCursorSchema
|
|
51
|
-
} from "../chunk-
|
|
51
|
+
} from "../chunk-Y2BQRXJD.js";
|
|
52
52
|
import {
|
|
53
53
|
parseImageExtraction,
|
|
54
54
|
parseImageResult
|
|
55
|
-
} from "../chunk-
|
|
55
|
+
} from "../chunk-6KZPQI6F.js";
|
|
56
56
|
import {
|
|
57
57
|
imageAssetArtifactSchema,
|
|
58
58
|
xUserLookupInputSchema,
|
|
59
59
|
xUserSchema
|
|
60
|
-
} from "../chunk-
|
|
60
|
+
} from "../chunk-B3KVWKL2.js";
|
|
61
61
|
import {
|
|
62
62
|
sourceDataSchema,
|
|
63
63
|
sourceRoles,
|
|
64
64
|
validateQuestShape
|
|
65
|
-
} from "../chunk-
|
|
65
|
+
} from "../chunk-Y4OM7CHT.js";
|
|
66
66
|
import {
|
|
67
67
|
isIntegrationParticipantPath,
|
|
68
68
|
isParticipantRoute,
|
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
} from "../chunk-MLIXJPKL.js";
|
|
72
72
|
import {
|
|
73
73
|
withActionId
|
|
74
|
-
} from "../chunk-
|
|
74
|
+
} from "../chunk-PG3MC2AM.js";
|
|
75
75
|
import {
|
|
76
76
|
allocateQuestSchema,
|
|
77
77
|
allocatedQuestSchema,
|
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
rewardDeliveryQuerySchema,
|
|
91
91
|
rewardDeliverySchema,
|
|
92
92
|
saveQuestDraftSchema
|
|
93
|
-
} from "../chunk-
|
|
93
|
+
} from "../chunk-SAUBTWEA.js";
|
|
94
94
|
import {
|
|
95
95
|
badgeMutationResultSchema,
|
|
96
96
|
badgeMutationSchema,
|
|
@@ -144,15 +144,15 @@ import {
|
|
|
144
144
|
referralQualificationSchema,
|
|
145
145
|
referralRewardResolutionSchema,
|
|
146
146
|
referralSuspensionSchema
|
|
147
|
-
} from "../chunk-
|
|
147
|
+
} from "../chunk-JFNJE2I4.js";
|
|
148
148
|
import {
|
|
149
149
|
telegramChatConnectionSchema,
|
|
150
150
|
telegramChatIdSchema,
|
|
151
151
|
telegramChatsSchema
|
|
152
|
-
} from "../chunk-
|
|
153
|
-
import "../chunk-
|
|
154
|
-
import "../chunk-
|
|
155
|
-
import "../chunk-
|
|
152
|
+
} from "../chunk-OZQML7VU.js";
|
|
153
|
+
import "../chunk-34ZGBXN7.js";
|
|
154
|
+
import "../chunk-QLDURQPB.js";
|
|
155
|
+
import "../chunk-IEBVJN6A.js";
|
|
156
156
|
import {
|
|
157
157
|
CompletionSourceKind,
|
|
158
158
|
addGroupMemberSchema,
|
|
@@ -241,7 +241,7 @@ import {
|
|
|
241
241
|
walletSignInNetworksSchema,
|
|
242
242
|
walletUnlinkInputSchema,
|
|
243
243
|
whereSchemaIssue
|
|
244
|
-
} from "../chunk-
|
|
244
|
+
} from "../chunk-6RYZG6TV.js";
|
|
245
245
|
|
|
246
246
|
// src/server/identity-links.ts
|
|
247
247
|
import * as z from "zod";
|
|
@@ -869,20 +869,105 @@ var resourceArchiveInputSchema = resourceLifecycleInputSchema.omit({
|
|
|
869
869
|
archived: true
|
|
870
870
|
});
|
|
871
871
|
|
|
872
|
+
// src/server/promotions.ts
|
|
873
|
+
import * as z10 from "zod";
|
|
874
|
+
var promotionResourceKindSchema = z10.enum([
|
|
875
|
+
"quest",
|
|
876
|
+
"quest-type",
|
|
877
|
+
"collection",
|
|
878
|
+
"quest-interactions",
|
|
879
|
+
"point-ledger",
|
|
880
|
+
"badge",
|
|
881
|
+
"offer",
|
|
882
|
+
"referral",
|
|
883
|
+
"leaderboard",
|
|
884
|
+
"tracker",
|
|
885
|
+
"engagement",
|
|
886
|
+
"image",
|
|
887
|
+
"stock-item",
|
|
888
|
+
"pickup",
|
|
889
|
+
"calendar",
|
|
890
|
+
"profile-settings",
|
|
891
|
+
"app-build"
|
|
892
|
+
]);
|
|
893
|
+
var promotionChangeSchema = z10.object({
|
|
894
|
+
kind: z10.union([promotionResourceKindSchema, z10.string()]),
|
|
895
|
+
key: z10.string(),
|
|
896
|
+
title: z10.string(),
|
|
897
|
+
/** `added`: new in live. `changed`: live's differs. `archived` and `unarchived` change only its lifecycle. */
|
|
898
|
+
change: z10.union([
|
|
899
|
+
z10.enum(["added", "changed", "archived", "unarchived"]),
|
|
900
|
+
z10.string()
|
|
901
|
+
])
|
|
902
|
+
});
|
|
903
|
+
var promotionWarningSchema = z10.object({
|
|
904
|
+
code: z10.string(),
|
|
905
|
+
message: z10.string(),
|
|
906
|
+
kind: z10.string().optional(),
|
|
907
|
+
key: z10.string().optional()
|
|
908
|
+
});
|
|
909
|
+
var promotionBuildSchema = z10.object({
|
|
910
|
+
repository: identifier,
|
|
911
|
+
build: identifier
|
|
912
|
+
});
|
|
913
|
+
var promotionSourceSchema = z10.discriminatedUnion("kind", [
|
|
914
|
+
z10.object({ kind: z10.literal("test") }),
|
|
915
|
+
z10.object({ kind: z10.literal("rollback"), promotion: identifier }),
|
|
916
|
+
z10.object({ kind: z10.literal("deployment"), deployment: identifier })
|
|
917
|
+
]);
|
|
918
|
+
var promotionMetadata = {
|
|
919
|
+
id: identifier,
|
|
920
|
+
source: promotionSourceSchema,
|
|
921
|
+
changes: z10.array(promotionChangeSchema),
|
|
922
|
+
warnings: z10.array(promotionWarningSchema),
|
|
923
|
+
build: promotionBuildSchema.nullable(),
|
|
924
|
+
createdAt: z10.number().int().nonnegative(),
|
|
925
|
+
createdBy: z10.string().nullable()
|
|
926
|
+
};
|
|
927
|
+
var decided = {
|
|
928
|
+
decidedAt: z10.number().int().nonnegative(),
|
|
929
|
+
decidedBy: z10.string().nullable()
|
|
930
|
+
};
|
|
931
|
+
var promotionRecordSchema = z10.discriminatedUnion("status", [
|
|
932
|
+
z10.object({ ...promotionMetadata, status: z10.literal("pending") }),
|
|
933
|
+
z10.object({ ...promotionMetadata, ...decided, status: z10.literal("applied") }),
|
|
934
|
+
z10.object({
|
|
935
|
+
...promotionMetadata,
|
|
936
|
+
...decided,
|
|
937
|
+
status: z10.literal("rejected"),
|
|
938
|
+
reason: z10.string()
|
|
939
|
+
}),
|
|
940
|
+
z10.object({
|
|
941
|
+
...promotionMetadata,
|
|
942
|
+
...decided,
|
|
943
|
+
status: z10.literal("superseded")
|
|
944
|
+
})
|
|
945
|
+
]);
|
|
946
|
+
var promotionActionSchema = z10.object({ actionId: z10.string().uuid() }).strict();
|
|
947
|
+
var promotionRejectionSchema = z10.object({ reason: z10.string().trim().min(1).max(1e3) }).strict();
|
|
948
|
+
var promotionHistoryQuerySchema = z10.strictObject({
|
|
949
|
+
cursor: pageCursorSchema.optional(),
|
|
950
|
+
limit: z10.coerce.number().int().min(1).max(100).optional()
|
|
951
|
+
});
|
|
952
|
+
var promotionHistoryPageSchema = z10.object({
|
|
953
|
+
items: z10.array(promotionRecordSchema),
|
|
954
|
+
nextCursor: pageCursorSchema.nullable()
|
|
955
|
+
});
|
|
956
|
+
|
|
872
957
|
// src/server/index.ts
|
|
873
|
-
import * as
|
|
958
|
+
import * as z16 from "zod";
|
|
874
959
|
|
|
875
960
|
// src/server/hosting.ts
|
|
876
|
-
import * as
|
|
961
|
+
import * as z13 from "zod";
|
|
877
962
|
|
|
878
963
|
// src/server/schedules.ts
|
|
879
|
-
import * as
|
|
964
|
+
import * as z11 from "zod";
|
|
880
965
|
import { Cron } from "croner";
|
|
881
966
|
var APP_SCHEDULE_LIMIT = 10;
|
|
882
967
|
var APP_SCHEDULE_MIN_INTERVAL = 3e5;
|
|
883
968
|
var APP_SCHEDULE_TIMEOUT = 3e4;
|
|
884
|
-
var appScheduleNameSchema =
|
|
885
|
-
var appSchedulePathSchema =
|
|
969
|
+
var appScheduleNameSchema = z11.string().regex(/^[a-z][a-z0-9-]{0,63}$/);
|
|
970
|
+
var appSchedulePathSchema = z11.string().min(2).max(512).refine((path) => {
|
|
886
971
|
if (!/^\/[a-zA-Z0-9_/-]+$/.test(path) || path.startsWith("//")) {
|
|
887
972
|
return false;
|
|
888
973
|
}
|
|
@@ -893,11 +978,11 @@ function interval(value) {
|
|
|
893
978
|
const unit = value.slice(-1);
|
|
894
979
|
return amount * (unit === "m" ? 6e4 : unit === "h" ? 36e5 : 864e5);
|
|
895
980
|
}
|
|
896
|
-
var everySchema =
|
|
981
|
+
var everySchema = z11.string().regex(/^[1-9]\d{0,3}[mhd]$/).refine(
|
|
897
982
|
(value) => interval(value) >= APP_SCHEDULE_MIN_INTERVAL && interval(value) <= 365 * 864e5,
|
|
898
983
|
"Use an interval from 5 minutes to 365 days, such as 5m, 1h or 1d"
|
|
899
984
|
);
|
|
900
|
-
var cronSchema =
|
|
985
|
+
var cronSchema = z11.string().max(120).refine((value) => {
|
|
901
986
|
const fields = value.trim().split(/\s+/);
|
|
902
987
|
if (fields.length !== 5 || fields.some((field) => !/^[\d*,/-]+$/.test(field))) {
|
|
903
988
|
return false;
|
|
@@ -922,15 +1007,15 @@ var cronSchema = z10.string().max(120).refine((value) => {
|
|
|
922
1007
|
var declaration = {
|
|
923
1008
|
name: appScheduleNameSchema,
|
|
924
1009
|
path: appSchedulePathSchema,
|
|
925
|
-
description:
|
|
1010
|
+
description: z11.string().min(1).max(500)
|
|
926
1011
|
};
|
|
927
|
-
var everySchedule =
|
|
928
|
-
var cronSchedule =
|
|
929
|
-
var appScheduleSchema =
|
|
1012
|
+
var everySchedule = z11.object({ ...declaration, every: everySchema });
|
|
1013
|
+
var cronSchedule = z11.object({ ...declaration, cron: cronSchema });
|
|
1014
|
+
var appScheduleSchema = z11.union([
|
|
930
1015
|
everySchedule.strict(),
|
|
931
1016
|
cronSchedule.strict()
|
|
932
1017
|
]);
|
|
933
|
-
var appSchedulesSchema =
|
|
1018
|
+
var appSchedulesSchema = z11.array(appScheduleSchema).max(APP_SCHEDULE_LIMIT).refine(
|
|
934
1019
|
(items) => new Set(items.map((item) => item.name)).size === items.length,
|
|
935
1020
|
"Schedule names must be unique"
|
|
936
1021
|
);
|
|
@@ -947,25 +1032,25 @@ function nextScheduleRun(schedule, after) {
|
|
|
947
1032
|
}
|
|
948
1033
|
return next.getTime();
|
|
949
1034
|
}
|
|
950
|
-
var appScheduleStateSchema =
|
|
1035
|
+
var appScheduleStateSchema = z11.enum(["active", "paused", "archived"]);
|
|
951
1036
|
var APP_SCHEDULE_RESULT_BYTES = 16384;
|
|
952
|
-
var appScheduleDiagnosticSchema =
|
|
953
|
-
level:
|
|
954
|
-
message:
|
|
1037
|
+
var appScheduleDiagnosticSchema = z11.object({
|
|
1038
|
+
level: z11.enum(["error", "warning", "info"]),
|
|
1039
|
+
message: z11.string().min(1).max(500),
|
|
955
1040
|
/** What the line is about, such as a member, record or tracker ID. */
|
|
956
|
-
subject:
|
|
1041
|
+
subject: z11.string().min(1).max(200).optional(),
|
|
957
1042
|
/** A stable code the app chooses, such as `ingest-timeout`. */
|
|
958
|
-
code:
|
|
1043
|
+
code: z11.string().min(1).max(100).optional()
|
|
959
1044
|
});
|
|
960
|
-
var appScheduleResultSchema =
|
|
961
|
-
outcome:
|
|
962
|
-
summary:
|
|
1045
|
+
var appScheduleResultSchema = z11.object({
|
|
1046
|
+
outcome: z11.enum(["succeeded", "partial", "failed"]),
|
|
1047
|
+
summary: z11.string().min(1).max(500).optional(),
|
|
963
1048
|
/** Counts and gauges, such as processed and failed members. */
|
|
964
|
-
metrics:
|
|
1049
|
+
metrics: z11.record(z11.string().regex(/^[A-Za-z][\w.-]{0,63}$/), z11.number()).refine(
|
|
965
1050
|
(metrics) => Object.keys(metrics).length <= 50,
|
|
966
1051
|
"Report at most 50 metrics"
|
|
967
1052
|
).optional(),
|
|
968
|
-
diagnostics:
|
|
1053
|
+
diagnostics: z11.array(appScheduleDiagnosticSchema).max(50).optional()
|
|
969
1054
|
});
|
|
970
1055
|
function scheduleResult(result) {
|
|
971
1056
|
const body = JSON.stringify(appScheduleResultSchema.parse(result));
|
|
@@ -978,41 +1063,41 @@ function scheduleResult(result) {
|
|
|
978
1063
|
headers: { "Content-Type": "application/json" }
|
|
979
1064
|
});
|
|
980
1065
|
}
|
|
981
|
-
var appScheduleRunSchema =
|
|
982
|
-
id:
|
|
983
|
-
build:
|
|
984
|
-
startedAt:
|
|
985
|
-
scheduledAt:
|
|
986
|
-
manual:
|
|
987
|
-
status:
|
|
988
|
-
duration:
|
|
1066
|
+
var appScheduleRunSchema = z11.object({
|
|
1067
|
+
id: z11.string().uuid(),
|
|
1068
|
+
build: z11.string().uuid(),
|
|
1069
|
+
startedAt: z11.number(),
|
|
1070
|
+
scheduledAt: z11.number(),
|
|
1071
|
+
manual: z11.boolean(),
|
|
1072
|
+
status: z11.enum(["queued", "running", "succeeded", "failed", "uncertain"]),
|
|
1073
|
+
duration: z11.number().nullable(),
|
|
989
1074
|
/** Why the run failed or is uncertain, or why Relay ignored the app's result. */
|
|
990
|
-
error:
|
|
1075
|
+
error: z11.string().nullable(),
|
|
991
1076
|
/** The app's JSON answer when it sent a valid result. Absent on runs from before results. */
|
|
992
1077
|
result: appScheduleResultSchema.nullable().optional()
|
|
993
1078
|
});
|
|
994
|
-
var appScheduleRunsSchema =
|
|
1079
|
+
var appScheduleRunsSchema = z11.object({
|
|
995
1080
|
/** Newest first: the latest twenty runs of one schedule, including a queued or running one. */
|
|
996
|
-
runs:
|
|
1081
|
+
runs: z11.array(appScheduleRunSchema)
|
|
997
1082
|
});
|
|
998
|
-
var appScheduleListSchema =
|
|
1083
|
+
var appScheduleListSchema = z11.object({
|
|
999
1084
|
state: appScheduleStateSchema,
|
|
1000
|
-
schedules:
|
|
1001
|
-
|
|
1002
|
-
declaration:
|
|
1003
|
-
nextRun:
|
|
1004
|
-
blocked:
|
|
1085
|
+
schedules: z11.array(
|
|
1086
|
+
z11.object({
|
|
1087
|
+
declaration: z11.union([everySchedule, cronSchedule]),
|
|
1088
|
+
nextRun: z11.number().nullable(),
|
|
1089
|
+
blocked: z11.boolean(),
|
|
1005
1090
|
lastRun: appScheduleRunSchema.nullable()
|
|
1006
1091
|
})
|
|
1007
1092
|
)
|
|
1008
1093
|
});
|
|
1009
|
-
var scheduledInvocationSchema =
|
|
1010
|
-
id:
|
|
1011
|
-
build:
|
|
1094
|
+
var scheduledInvocationSchema = z11.object({
|
|
1095
|
+
id: z11.string().uuid(),
|
|
1096
|
+
build: z11.string().uuid(),
|
|
1012
1097
|
name: appScheduleNameSchema,
|
|
1013
|
-
scheduledAt:
|
|
1014
|
-
startedAt:
|
|
1015
|
-
manual:
|
|
1098
|
+
scheduledAt: z11.number().int(),
|
|
1099
|
+
startedAt: z11.number().int(),
|
|
1100
|
+
manual: z11.boolean()
|
|
1016
1101
|
}).strict();
|
|
1017
1102
|
async function verifyScheduledRequest(request, key) {
|
|
1018
1103
|
const signature = request.headers.get("X-Domino-Schedule-Signature");
|
|
@@ -1077,7 +1162,7 @@ ${body}`)
|
|
|
1077
1162
|
}
|
|
1078
1163
|
|
|
1079
1164
|
// src/server/starters.ts
|
|
1080
|
-
import * as
|
|
1165
|
+
import * as z12 from "zod";
|
|
1081
1166
|
var starterTemplates = [
|
|
1082
1167
|
{
|
|
1083
1168
|
id: "campaign",
|
|
@@ -1110,63 +1195,63 @@ var starterTemplates = [
|
|
|
1110
1195
|
summary: "A headless Worker with typed routes and interactive API docs, for plugging Domino into your own product."
|
|
1111
1196
|
}
|
|
1112
1197
|
];
|
|
1113
|
-
var starterIdSchema =
|
|
1198
|
+
var starterIdSchema = z12.enum(
|
|
1114
1199
|
starterTemplates.map((template) => template.id)
|
|
1115
1200
|
);
|
|
1116
1201
|
|
|
1117
1202
|
// src/server/hosting.ts
|
|
1118
|
-
var outputPathSchema =
|
|
1203
|
+
var outputPathSchema = z13.string().min(1).max(512).refine(
|
|
1119
1204
|
(path) => path.split("/").every(
|
|
1120
1205
|
(part) => /^[\w-][\w.-]*$/.test(part) && part !== "node_modules"
|
|
1121
1206
|
),
|
|
1122
1207
|
"Expected a relative build output path without hidden segments"
|
|
1123
1208
|
);
|
|
1124
|
-
var appRoutingSchema =
|
|
1209
|
+
var appRoutingSchema = z13.enum(["legacy", "transparent"]).default("legacy");
|
|
1125
1210
|
var APP_SECRET_LIMIT = 50;
|
|
1126
1211
|
var APP_KV_LIMIT = 5;
|
|
1127
1212
|
var APP_SQL_LIMIT = 5;
|
|
1128
1213
|
var APP_MIGRATION_LIMIT = 100;
|
|
1129
1214
|
var APP_MIGRATION_FILE_BYTES = 9e4;
|
|
1130
1215
|
var APP_MIGRATION_TOTAL_BYTES = 1e6;
|
|
1131
|
-
var appSecretNameSchema =
|
|
1216
|
+
var appSecretNameSchema = z13.string().regex(
|
|
1132
1217
|
/^[A-Z_][A-Z0-9_]{0,63}$/,
|
|
1133
1218
|
"Use 1-64 uppercase letters, digits, and underscores, not starting with a digit"
|
|
1134
1219
|
).refine(
|
|
1135
1220
|
(name) => !name.startsWith("DOMINO_") && name !== "ASSETS",
|
|
1136
1221
|
"DOMINO_ names and ASSETS are reserved for Domino's own bindings"
|
|
1137
1222
|
);
|
|
1138
|
-
var appSecretValueSchema =
|
|
1223
|
+
var appSecretValueSchema = z13.string().min(1).refine(
|
|
1139
1224
|
(value) => new TextEncoder().encode(value).length <= 5120,
|
|
1140
1225
|
"Secret values can be at most 5 KiB"
|
|
1141
1226
|
);
|
|
1142
|
-
var appSecretInputSchema =
|
|
1143
|
-
var appSecretSchema =
|
|
1227
|
+
var appSecretInputSchema = z13.object({ value: appSecretValueSchema }).strict();
|
|
1228
|
+
var appSecretSchema = z13.object({
|
|
1144
1229
|
name: appSecretNameSchema,
|
|
1145
|
-
updatedAt:
|
|
1146
|
-
updatedBy:
|
|
1230
|
+
updatedAt: z13.number(),
|
|
1231
|
+
updatedBy: z13.string()
|
|
1147
1232
|
});
|
|
1148
|
-
var appSecretDeclarationSchema =
|
|
1149
|
-
description:
|
|
1150
|
-
required:
|
|
1233
|
+
var appSecretDeclarationSchema = z13.object({
|
|
1234
|
+
description: z13.string().trim().min(1).max(500),
|
|
1235
|
+
required: z13.boolean().default(true)
|
|
1151
1236
|
}).strict();
|
|
1152
|
-
var appSecretDeclarationsSchema =
|
|
1237
|
+
var appSecretDeclarationsSchema = z13.record(appSecretNameSchema, appSecretDeclarationSchema).refine(
|
|
1153
1238
|
(secrets) => Object.keys(secrets).length <= APP_SECRET_LIMIT,
|
|
1154
1239
|
`Declare at most ${APP_SECRET_LIMIT} app secrets`
|
|
1155
1240
|
);
|
|
1156
|
-
var appSecretListSchema =
|
|
1157
|
-
secrets:
|
|
1158
|
-
declared:
|
|
1241
|
+
var appSecretListSchema = z13.object({
|
|
1242
|
+
secrets: z13.array(appSecretSchema),
|
|
1243
|
+
declared: z13.array(appSecretDeclarationSchema.extend({ name: appSecretNameSchema })).default([])
|
|
1159
1244
|
});
|
|
1160
|
-
var hostedAppSecretsSchema =
|
|
1161
|
-
var storageDescription =
|
|
1162
|
-
description:
|
|
1245
|
+
var hostedAppSecretsSchema = z13.object({ secrets: z13.record(appSecretNameSchema, appSecretValueSchema) }).strict();
|
|
1246
|
+
var storageDescription = z13.object({
|
|
1247
|
+
description: z13.string().trim().min(1).max(500)
|
|
1163
1248
|
}).strict();
|
|
1164
|
-
var appStorageSchema =
|
|
1165
|
-
kv:
|
|
1249
|
+
var appStorageSchema = z13.object({
|
|
1250
|
+
kv: z13.record(appSecretNameSchema, storageDescription).refine(
|
|
1166
1251
|
(stores) => Object.keys(stores).length <= APP_KV_LIMIT,
|
|
1167
1252
|
`Declare at most ${APP_KV_LIMIT} KV stores`
|
|
1168
1253
|
).default({}),
|
|
1169
|
-
sql:
|
|
1254
|
+
sql: z13.record(
|
|
1170
1255
|
appSecretNameSchema,
|
|
1171
1256
|
storageDescription.extend({
|
|
1172
1257
|
migrations: outputPathSchema.optional()
|
|
@@ -1176,77 +1261,77 @@ var appStorageSchema = z12.object({
|
|
|
1176
1261
|
`Declare at most ${APP_SQL_LIMIT} SQL stores`
|
|
1177
1262
|
).default({})
|
|
1178
1263
|
}).strict();
|
|
1179
|
-
var appStorageKindSchema =
|
|
1180
|
-
var appStorageListSchema =
|
|
1181
|
-
stores:
|
|
1182
|
-
|
|
1183
|
-
kind:
|
|
1264
|
+
var appStorageKindSchema = z13.enum(["kv", "sql"]);
|
|
1265
|
+
var appStorageListSchema = z13.object({
|
|
1266
|
+
stores: z13.array(
|
|
1267
|
+
z13.object({
|
|
1268
|
+
kind: z13.string(),
|
|
1184
1269
|
name: appSecretNameSchema,
|
|
1185
|
-
createdAt:
|
|
1186
|
-
declared:
|
|
1187
|
-
description:
|
|
1270
|
+
createdAt: z13.number().nullable(),
|
|
1271
|
+
declared: z13.boolean(),
|
|
1272
|
+
description: z13.string().optional()
|
|
1188
1273
|
})
|
|
1189
1274
|
)
|
|
1190
1275
|
});
|
|
1191
1276
|
var APP_STORAGE_ROW_LIMIT = 50;
|
|
1192
1277
|
var APP_STORAGE_PREVIEW_CHARACTERS = 2e3;
|
|
1193
|
-
var appStorageCellSchema =
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1278
|
+
var appStorageCellSchema = z13.union([
|
|
1279
|
+
z13.string(),
|
|
1280
|
+
z13.number(),
|
|
1281
|
+
z13.null(),
|
|
1282
|
+
z13.object({ text: z13.string(), truncated: z13.literal(true) }),
|
|
1283
|
+
z13.object({ blob: z13.number().int().min(0) })
|
|
1199
1284
|
]);
|
|
1200
|
-
var appStorageTablesSchema =
|
|
1201
|
-
tables:
|
|
1285
|
+
var appStorageTablesSchema = z13.object({
|
|
1286
|
+
tables: z13.array(
|
|
1202
1287
|
/** `kind` is SQLite's: `table` or `view`. */
|
|
1203
|
-
|
|
1288
|
+
z13.object({ name: z13.string(), kind: z13.string() })
|
|
1204
1289
|
)
|
|
1205
1290
|
});
|
|
1206
|
-
var appStorageRowsSchema =
|
|
1207
|
-
table:
|
|
1208
|
-
columns:
|
|
1209
|
-
rows:
|
|
1291
|
+
var appStorageRowsSchema = z13.object({
|
|
1292
|
+
table: z13.string(),
|
|
1293
|
+
columns: z13.array(z13.string()),
|
|
1294
|
+
rows: z13.array(z13.array(appStorageCellSchema)),
|
|
1210
1295
|
/** How many rows come before this page in storage order. */
|
|
1211
|
-
offset:
|
|
1212
|
-
total:
|
|
1296
|
+
offset: z13.number().int().min(0),
|
|
1297
|
+
total: z13.number().int().min(0),
|
|
1213
1298
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
1214
1299
|
nextCursor: pageCursorSchema.nullable().default(null)
|
|
1215
1300
|
});
|
|
1216
|
-
var appStorageKeysSchema =
|
|
1217
|
-
keys:
|
|
1218
|
-
|
|
1301
|
+
var appStorageKeysSchema = z13.object({
|
|
1302
|
+
keys: z13.array(
|
|
1303
|
+
z13.object({ name: z13.string(), expiration: z13.number().nullable() })
|
|
1219
1304
|
),
|
|
1220
1305
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
1221
1306
|
nextCursor: pageCursorSchema.nullable().default(null),
|
|
1222
1307
|
/** @deprecated Use `nextCursor`. Removed in 2.0.0. */
|
|
1223
|
-
cursor:
|
|
1308
|
+
cursor: z13.string().nullable()
|
|
1224
1309
|
});
|
|
1225
|
-
var appStorageValueSchema =
|
|
1226
|
-
key:
|
|
1227
|
-
size:
|
|
1310
|
+
var appStorageValueSchema = z13.object({
|
|
1311
|
+
key: z13.string(),
|
|
1312
|
+
size: z13.number().int().min(0),
|
|
1228
1313
|
/** Null when the value is not UTF-8 text. */
|
|
1229
|
-
text:
|
|
1230
|
-
truncated:
|
|
1314
|
+
text: z13.string().nullable(),
|
|
1315
|
+
truncated: z13.boolean()
|
|
1231
1316
|
});
|
|
1232
1317
|
var APP_STORAGE_CELL_CHARACTERS = 1e5;
|
|
1233
|
-
var appStorageCellPageSchema =
|
|
1234
|
-
table:
|
|
1235
|
-
column:
|
|
1318
|
+
var appStorageCellPageSchema = z13.object({
|
|
1319
|
+
table: z13.string(),
|
|
1320
|
+
column: z13.string(),
|
|
1236
1321
|
/** The row's position in storage order: a rows page's `offset` plus its index on that page. */
|
|
1237
|
-
row:
|
|
1322
|
+
row: z13.number().int().min(0),
|
|
1238
1323
|
/** SQLite's storage class. */
|
|
1239
|
-
type:
|
|
1324
|
+
type: z13.enum(["text", "integer", "real", "blob", "null"]),
|
|
1240
1325
|
/** Characters of text, or of a number's text form; bytes of a BLOB; null for NULL. */
|
|
1241
|
-
length:
|
|
1326
|
+
length: z13.number().int().min(0).nullable(),
|
|
1242
1327
|
/** How many characters come before this page. */
|
|
1243
|
-
offset:
|
|
1328
|
+
offset: z13.number().int().min(0),
|
|
1244
1329
|
/** Up to 100,000 characters from `offset`. Null for a BLOB, whose bytes are never read, and NULL. */
|
|
1245
|
-
text:
|
|
1330
|
+
text: z13.string().nullable(),
|
|
1246
1331
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
1247
1332
|
nextCursor: pageCursorSchema.nullable().default(null)
|
|
1248
1333
|
});
|
|
1249
|
-
var appMigrationNameSchema =
|
|
1334
|
+
var appMigrationNameSchema = z13.string().max(255).regex(/^[\w-][\w.-]*\.sql$/);
|
|
1250
1335
|
function compareAppMigrations(a, b) {
|
|
1251
1336
|
const left = Number.parseInt(a.split("_")[0], 10);
|
|
1252
1337
|
const right = Number.parseInt(b.split("_")[0], 10);
|
|
@@ -1263,12 +1348,12 @@ function compareAppMigrations(a, b) {
|
|
|
1263
1348
|
}
|
|
1264
1349
|
return a < b ? -1 : a > b ? 1 : 0;
|
|
1265
1350
|
}
|
|
1266
|
-
var appMigrationsSchema =
|
|
1351
|
+
var appMigrationsSchema = z13.record(
|
|
1267
1352
|
appSecretNameSchema,
|
|
1268
|
-
|
|
1269
|
-
|
|
1353
|
+
z13.array(
|
|
1354
|
+
z13.object({
|
|
1270
1355
|
name: appMigrationNameSchema,
|
|
1271
|
-
sql:
|
|
1356
|
+
sql: z13.string().min(1).refine(
|
|
1272
1357
|
(sql) => new TextEncoder().encode(sql).length <= APP_MIGRATION_FILE_BYTES,
|
|
1273
1358
|
`A migration file must not exceed ${APP_MIGRATION_FILE_BYTES} bytes`
|
|
1274
1359
|
)
|
|
@@ -1286,21 +1371,21 @@ var appMigrationsSchema = z12.record(
|
|
|
1286
1371
|
);
|
|
1287
1372
|
var appScripts = {
|
|
1288
1373
|
routing: appRoutingSchema,
|
|
1289
|
-
devScript:
|
|
1290
|
-
checkScript:
|
|
1291
|
-
buildScript:
|
|
1374
|
+
devScript: z13.string().regex(/^[\w:-]+$/),
|
|
1375
|
+
checkScript: z13.string().regex(/^[\w:-]+$/),
|
|
1376
|
+
buildScript: z13.string().regex(/^[\w:-]+$/)
|
|
1292
1377
|
};
|
|
1293
1378
|
var workerSettings = {
|
|
1294
|
-
runWorkerFirst:
|
|
1379
|
+
runWorkerFirst: z13.boolean().default(false),
|
|
1295
1380
|
main: outputPathSchema.refine(
|
|
1296
1381
|
(path) => /\.m?js$/.test(path),
|
|
1297
1382
|
"Expected a compiled JavaScript entry"
|
|
1298
1383
|
),
|
|
1299
|
-
compatibilityDate:
|
|
1300
|
-
compatibilityFlags:
|
|
1301
|
-
vars:
|
|
1302
|
-
|
|
1303
|
-
|
|
1384
|
+
compatibilityDate: z13.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
1385
|
+
compatibilityFlags: z13.array(z13.string().min(1)).max(50).default([]),
|
|
1386
|
+
vars: z13.record(
|
|
1387
|
+
z13.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).refine((name) => name !== "ASSETS"),
|
|
1388
|
+
z13.string()
|
|
1304
1389
|
).default({}),
|
|
1305
1390
|
secrets: appSecretDeclarationsSchema.default({}),
|
|
1306
1391
|
storage: appStorageSchema.optional(),
|
|
@@ -1329,62 +1414,62 @@ var distinctBindings = (worker, ctx) => {
|
|
|
1329
1414
|
}
|
|
1330
1415
|
}
|
|
1331
1416
|
};
|
|
1332
|
-
var hostedAppSchema =
|
|
1333
|
-
|
|
1334
|
-
kind:
|
|
1417
|
+
var hostedAppSchema = z13.discriminatedUnion("kind", [
|
|
1418
|
+
z13.object({
|
|
1419
|
+
kind: z13.literal("static"),
|
|
1335
1420
|
directory: outputPathSchema,
|
|
1336
1421
|
...appScripts
|
|
1337
1422
|
}).strict(),
|
|
1338
|
-
|
|
1339
|
-
kind:
|
|
1423
|
+
z13.object({
|
|
1424
|
+
kind: z13.literal("worker"),
|
|
1340
1425
|
directory: outputPathSchema,
|
|
1341
1426
|
assetsDirectory: outputPathSchema.optional(),
|
|
1342
1427
|
...appScripts,
|
|
1343
1428
|
...workerSettings
|
|
1344
1429
|
}).strict().superRefine(distinctBindings)
|
|
1345
1430
|
]);
|
|
1346
|
-
var repositorySchema =
|
|
1347
|
-
id:
|
|
1431
|
+
var repositorySchema = z13.object({
|
|
1432
|
+
id: z13.string().uuid(),
|
|
1348
1433
|
organization: identifier,
|
|
1349
1434
|
project: identifier,
|
|
1350
|
-
remote:
|
|
1351
|
-
defaultBranch:
|
|
1352
|
-
status:
|
|
1435
|
+
remote: z13.string().url(),
|
|
1436
|
+
defaultBranch: z13.string(),
|
|
1437
|
+
status: z13.enum(["provisioning", "ready"])
|
|
1353
1438
|
});
|
|
1354
|
-
var createRepositorySchema =
|
|
1439
|
+
var createRepositorySchema = z13.object({
|
|
1355
1440
|
/** Omitted: the starter chosen at project setup, else `campaign`. */
|
|
1356
1441
|
starter: starterIdSchema.optional()
|
|
1357
1442
|
}).strict();
|
|
1358
|
-
var deviceStartSchema =
|
|
1359
|
-
challenge:
|
|
1443
|
+
var deviceStartSchema = z13.object({
|
|
1444
|
+
challenge: z13.string().regex(/^[a-f0-9]{64}$/)
|
|
1360
1445
|
}).strict();
|
|
1361
|
-
var deviceRedeemSchema =
|
|
1362
|
-
id:
|
|
1363
|
-
verifier:
|
|
1446
|
+
var deviceRedeemSchema = z13.object({
|
|
1447
|
+
id: z13.string().uuid(),
|
|
1448
|
+
verifier: z13.string().min(43).max(128)
|
|
1364
1449
|
}).strict();
|
|
1365
|
-
var deviceApproveSchema =
|
|
1366
|
-
id:
|
|
1367
|
-
code:
|
|
1450
|
+
var deviceApproveSchema = z13.object({
|
|
1451
|
+
id: z13.string().uuid(),
|
|
1452
|
+
code: z13.string().regex(/^[A-F0-9]{4}-[A-F0-9]{4}$/)
|
|
1368
1453
|
}).strict();
|
|
1369
|
-
var commitSchema =
|
|
1370
|
-
var stageRequestSchema =
|
|
1454
|
+
var commitSchema = z13.string().regex(/^[a-f0-9]{40}$/);
|
|
1455
|
+
var stageRequestSchema = z13.object({
|
|
1371
1456
|
commit: commitSchema,
|
|
1372
|
-
requestId:
|
|
1457
|
+
requestId: z13.string().uuid()
|
|
1373
1458
|
}).strict();
|
|
1374
|
-
var buildIdentitySchema =
|
|
1459
|
+
var buildIdentitySchema = z13.object({
|
|
1375
1460
|
routing: appRoutingSchema,
|
|
1376
|
-
slug:
|
|
1377
|
-
runtime:
|
|
1378
|
-
id:
|
|
1379
|
-
repository:
|
|
1461
|
+
slug: z13.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional(),
|
|
1462
|
+
runtime: z13.enum(["simulation", "hosted-test"]).default("simulation"),
|
|
1463
|
+
id: z13.string().uuid(),
|
|
1464
|
+
repository: z13.string().uuid(),
|
|
1380
1465
|
organization: identifier,
|
|
1381
1466
|
project: identifier,
|
|
1382
1467
|
commit: commitSchema,
|
|
1383
|
-
createdAt:
|
|
1384
|
-
actor:
|
|
1385
|
-
commitMessage:
|
|
1468
|
+
createdAt: z13.number(),
|
|
1469
|
+
actor: z13.string(),
|
|
1470
|
+
commitMessage: z13.string().max(500).optional()
|
|
1386
1471
|
});
|
|
1387
|
-
var buildPhaseSchema =
|
|
1472
|
+
var buildPhaseSchema = z13.enum([
|
|
1388
1473
|
"queued",
|
|
1389
1474
|
"source",
|
|
1390
1475
|
"install",
|
|
@@ -1394,72 +1479,72 @@ var buildPhaseSchema = z12.enum([
|
|
|
1394
1479
|
"ready",
|
|
1395
1480
|
"failed"
|
|
1396
1481
|
]);
|
|
1397
|
-
var buildStatusSchema =
|
|
1482
|
+
var buildStatusSchema = z13.object({
|
|
1398
1483
|
phase: buildPhaseSchema,
|
|
1399
1484
|
failedPhase: buildPhaseSchema.optional(),
|
|
1400
|
-
updatedAt:
|
|
1401
|
-
message:
|
|
1485
|
+
updatedAt: z13.number(),
|
|
1486
|
+
message: z13.string()
|
|
1402
1487
|
});
|
|
1403
1488
|
var hostedBuildSchema = buildIdentitySchema.extend({
|
|
1404
1489
|
...buildStatusSchema.shape,
|
|
1405
|
-
finished:
|
|
1406
|
-
current:
|
|
1407
|
-
stagingUrl:
|
|
1490
|
+
finished: z13.boolean(),
|
|
1491
|
+
current: z13.boolean(),
|
|
1492
|
+
stagingUrl: z13.string().url()
|
|
1408
1493
|
});
|
|
1409
|
-
var stagingAccessModeSchema =
|
|
1410
|
-
var stagingAccessSchema =
|
|
1411
|
-
var stagingAccessInputSchema =
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
mode:
|
|
1415
|
-
password:
|
|
1494
|
+
var stagingAccessModeSchema = z13.enum(["console", "password"]);
|
|
1495
|
+
var stagingAccessSchema = z13.object({ mode: stagingAccessModeSchema });
|
|
1496
|
+
var stagingAccessInputSchema = z13.discriminatedUnion("mode", [
|
|
1497
|
+
z13.object({ mode: z13.literal("console") }).strict(),
|
|
1498
|
+
z13.object({
|
|
1499
|
+
mode: z13.literal("password"),
|
|
1500
|
+
password: z13.string().min(8).max(128)
|
|
1416
1501
|
}).strict()
|
|
1417
1502
|
]);
|
|
1418
|
-
var stagingPathSchema =
|
|
1503
|
+
var stagingPathSchema = z13.string().max(2048).refine(
|
|
1419
1504
|
(path) => path.startsWith("/") && !path.startsWith("//") && !path.includes("\\"),
|
|
1420
1505
|
"Expected a path on the staging host"
|
|
1421
1506
|
);
|
|
1422
|
-
var stagingLinkSchema =
|
|
1423
|
-
url:
|
|
1424
|
-
expiresAt:
|
|
1507
|
+
var stagingLinkSchema = z13.object({
|
|
1508
|
+
url: z13.string().url(),
|
|
1509
|
+
expiresAt: z13.number()
|
|
1425
1510
|
});
|
|
1426
|
-
var buildSnapshotSchema =
|
|
1427
|
-
builds:
|
|
1511
|
+
var buildSnapshotSchema = z13.object({
|
|
1512
|
+
builds: z13.array(hostedBuildSchema),
|
|
1428
1513
|
current: hostedBuildSchema.nullable(),
|
|
1429
1514
|
selected: hostedBuildSchema.nullable(),
|
|
1430
|
-
logs:
|
|
1515
|
+
logs: z13.string()
|
|
1431
1516
|
});
|
|
1432
|
-
var assetPathSchema =
|
|
1517
|
+
var assetPathSchema = z13.string().max(512).refine(
|
|
1433
1518
|
(path) => path.startsWith("/") && // oxlint-disable-next-line no-control-regex -- Asset paths must reject control characters.
|
|
1434
1519
|
!/[\\\u0000-\u001f?#%]/.test(path) && path.slice(1).split("/").every((part) => part.length > 0 && !part.startsWith(".")),
|
|
1435
1520
|
"Expected a public asset path without hidden segments"
|
|
1436
1521
|
);
|
|
1437
|
-
var base64Schema =
|
|
1522
|
+
var base64Schema = z13.string().regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
|
|
1438
1523
|
var stagedDeploymentLimits = {
|
|
1439
1524
|
/** Bytes of JSON, uncompressed. */
|
|
1440
1525
|
size: 64e6,
|
|
1441
1526
|
/** Bytes of the Brotli-compressed object. */
|
|
1442
1527
|
compressedSize: 1e7
|
|
1443
1528
|
};
|
|
1444
|
-
var stagedDeploymentSchema =
|
|
1445
|
-
encoding:
|
|
1446
|
-
sha256:
|
|
1447
|
-
compressedSize:
|
|
1448
|
-
size:
|
|
1529
|
+
var stagedDeploymentSchema = z13.object({
|
|
1530
|
+
encoding: z13.literal("br"),
|
|
1531
|
+
sha256: z13.string().regex(/^[0-9a-f]{64}$/),
|
|
1532
|
+
compressedSize: z13.number().int().positive().max(stagedDeploymentLimits.compressedSize),
|
|
1533
|
+
size: z13.number().int().positive().max(stagedDeploymentLimits.size)
|
|
1449
1534
|
}).strict();
|
|
1450
1535
|
var stagedDeploymentContentSchema = stagedDeploymentSchema.extend({
|
|
1451
|
-
content:
|
|
1536
|
+
content: z13.string().max(Math.ceil(stagedDeploymentLimits.compressedSize / 3) * 4)
|
|
1452
1537
|
}).strict();
|
|
1453
1538
|
var stagedDeploymentKey = (build, sha256) => `builds/${build}/deployment/${sha256}.br`;
|
|
1454
1539
|
var artifactFields = {
|
|
1455
1540
|
routing: appRoutingSchema,
|
|
1456
|
-
worker:
|
|
1541
|
+
worker: z13.object({
|
|
1457
1542
|
...workerSettings,
|
|
1458
1543
|
migrations: appMigrationsSchema.optional(),
|
|
1459
|
-
modules:
|
|
1460
|
-
|
|
1544
|
+
modules: z13.array(
|
|
1545
|
+
z13.object({
|
|
1461
1546
|
path: outputPathSchema.refine((path) => path !== "metadata"),
|
|
1462
|
-
type:
|
|
1547
|
+
type: z13.enum([
|
|
1463
1548
|
"application/javascript+module",
|
|
1464
1549
|
"application/wasm",
|
|
1465
1550
|
"text/plain",
|
|
@@ -1469,26 +1554,26 @@ var artifactFields = {
|
|
|
1469
1554
|
}).strict()
|
|
1470
1555
|
).min(1).max(500)
|
|
1471
1556
|
}).strict().superRefine(distinctBindings).optional(),
|
|
1472
|
-
assets:
|
|
1473
|
-
|
|
1557
|
+
assets: z13.array(
|
|
1558
|
+
z13.object({
|
|
1474
1559
|
path: assetPathSchema,
|
|
1475
1560
|
content: base64Schema.max(14e6),
|
|
1476
|
-
size:
|
|
1561
|
+
size: z13.number().int().min(0).max(1e7)
|
|
1477
1562
|
}).strict()
|
|
1478
1563
|
).max(500)
|
|
1479
1564
|
};
|
|
1480
|
-
var buildArtifactsSchema =
|
|
1481
|
-
|
|
1482
|
-
format:
|
|
1565
|
+
var buildArtifactsSchema = z13.discriminatedUnion("format", [
|
|
1566
|
+
z13.object({
|
|
1567
|
+
format: z13.literal(1),
|
|
1483
1568
|
...artifactFields,
|
|
1484
|
-
quests:
|
|
1485
|
-
catalog:
|
|
1569
|
+
quests: z13.unknown(),
|
|
1570
|
+
catalog: z13.unknown()
|
|
1486
1571
|
}).strict(),
|
|
1487
|
-
|
|
1488
|
-
format:
|
|
1572
|
+
z13.object({
|
|
1573
|
+
format: z13.literal(2),
|
|
1489
1574
|
...artifactFields,
|
|
1490
1575
|
deployment: stagedDeploymentSchema,
|
|
1491
|
-
images:
|
|
1576
|
+
images: z13.array(imageAssetArtifactSchema).max(10)
|
|
1492
1577
|
}).strict()
|
|
1493
1578
|
]).superRefine((value, ctx) => {
|
|
1494
1579
|
if (value.worker) {
|
|
@@ -1540,39 +1625,39 @@ var buildArtifactsSchema = z12.discriminatedUnion("format", [
|
|
|
1540
1625
|
});
|
|
1541
1626
|
|
|
1542
1627
|
// src/server/development.ts
|
|
1543
|
-
import * as
|
|
1544
|
-
var developmentPreflightSchema =
|
|
1545
|
-
organization:
|
|
1546
|
-
project:
|
|
1547
|
-
environment:
|
|
1548
|
-
identity:
|
|
1549
|
-
exchange:
|
|
1550
|
-
activeIntegrations:
|
|
1628
|
+
import * as z14 from "zod";
|
|
1629
|
+
var developmentPreflightSchema = z14.object({
|
|
1630
|
+
organization: z14.string(),
|
|
1631
|
+
project: z14.string(),
|
|
1632
|
+
environment: z14.enum(["test", "live"]),
|
|
1633
|
+
identity: z14.object({
|
|
1634
|
+
exchange: z14.literal("supported"),
|
|
1635
|
+
activeIntegrations: z14.number().int().nonnegative()
|
|
1551
1636
|
}).optional(),
|
|
1552
|
-
staging:
|
|
1553
|
-
development:
|
|
1554
|
-
status:
|
|
1637
|
+
staging: z14.enum(["configured", "blocked"]),
|
|
1638
|
+
development: z14.object({
|
|
1639
|
+
status: z14.enum(["configured", "blocked"]),
|
|
1555
1640
|
// How `domino dev` reaches the preview origin: a Cloudflare tunnel, or a direct route on a
|
|
1556
1641
|
// local development stack. APIs that predate the field use tunnels.
|
|
1557
|
-
transport:
|
|
1558
|
-
missing:
|
|
1559
|
-
authentication:
|
|
1642
|
+
transport: z14.enum(["tunnel", "direct"]).default("tunnel"),
|
|
1643
|
+
missing: z14.array(z14.string()),
|
|
1644
|
+
authentication: z14.array(z14.string())
|
|
1560
1645
|
}),
|
|
1561
|
-
checks:
|
|
1562
|
-
|
|
1563
|
-
id:
|
|
1564
|
-
status:
|
|
1565
|
-
message:
|
|
1566
|
-
missing:
|
|
1567
|
-
issues:
|
|
1646
|
+
checks: z14.array(
|
|
1647
|
+
z14.object({
|
|
1648
|
+
id: z14.string(),
|
|
1649
|
+
status: z14.enum(["ok", "error"]),
|
|
1650
|
+
message: z14.string(),
|
|
1651
|
+
missing: z14.array(z14.string()).optional(),
|
|
1652
|
+
issues: z14.array(z14.string()).optional()
|
|
1568
1653
|
})
|
|
1569
1654
|
)
|
|
1570
1655
|
});
|
|
1571
1656
|
|
|
1572
1657
|
// src/server/hosted.ts
|
|
1573
|
-
import * as
|
|
1658
|
+
import * as z15 from "zod";
|
|
1574
1659
|
var hostedKeyPermissions = ["read", "points", "ingest"];
|
|
1575
|
-
var hostedKeyPermissionList =
|
|
1660
|
+
var hostedKeyPermissionList = z15.array(z15.string()).transform(
|
|
1576
1661
|
(values) => values.filter(
|
|
1577
1662
|
(value) => hostedKeyPermissions.includes(value)
|
|
1578
1663
|
)
|
|
@@ -1584,17 +1669,17 @@ var hostedManagementBindings = [
|
|
|
1584
1669
|
"DOMINO_PROJECT",
|
|
1585
1670
|
"DOMINO_ENVIRONMENT"
|
|
1586
1671
|
];
|
|
1587
|
-
var hostedKeySecretSchema =
|
|
1588
|
-
var hostedKeySchema =
|
|
1589
|
-
id:
|
|
1672
|
+
var hostedKeySecretSchema = z15.string().regex(/^dhk_[A-Za-z0-9_-]{43}$/, "Expected a hosted app key");
|
|
1673
|
+
var hostedKeySchema = z15.object({
|
|
1674
|
+
id: z15.string().uuid(),
|
|
1590
1675
|
token: hostedKeySecretSchema,
|
|
1591
1676
|
organization: identifier,
|
|
1592
1677
|
project: identifier,
|
|
1593
|
-
environment:
|
|
1678
|
+
environment: z15.enum(["test", "live"]),
|
|
1594
1679
|
permissions: hostedKeyPermissionList,
|
|
1595
|
-
expiresAt:
|
|
1680
|
+
expiresAt: z15.number().nullable()
|
|
1596
1681
|
}).strict();
|
|
1597
|
-
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl:
|
|
1682
|
+
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl: z15.string().url() }).strict();
|
|
1598
1683
|
function hostedManagementClient(env) {
|
|
1599
1684
|
const missing = hostedManagementBindings.filter((name) => !env[name]);
|
|
1600
1685
|
if (missing.length) {
|
|
@@ -1602,7 +1687,7 @@ function hostedManagementClient(env) {
|
|
|
1602
1687
|
`Missing ${missing.join(", ")}. Domino sets these for hosted apps and domino dev; update the project's vite.config.ts to forward them in development.`
|
|
1603
1688
|
);
|
|
1604
1689
|
}
|
|
1605
|
-
const environment =
|
|
1690
|
+
const environment = z15.enum(["test", "live"]).parse(env.DOMINO_ENVIRONMENT);
|
|
1606
1691
|
const token = env.DOMINO_MANAGEMENT_KEY;
|
|
1607
1692
|
return createManagementClient({
|
|
1608
1693
|
baseUrl: env.DOMINO_API_URL.replace(/\/+$/, ""),
|
|
@@ -1614,9 +1699,9 @@ function hostedManagementClient(env) {
|
|
|
1614
1699
|
}
|
|
1615
1700
|
|
|
1616
1701
|
// src/server/index.ts
|
|
1617
|
-
var environmentSchema =
|
|
1618
|
-
var roleSchema =
|
|
1619
|
-
var permissionSchema =
|
|
1702
|
+
var environmentSchema = z16.enum(["test", "live"]);
|
|
1703
|
+
var roleSchema = z16.enum(["editor", "reviewer", "staff"]);
|
|
1704
|
+
var permissionSchema = z16.enum([
|
|
1620
1705
|
"read",
|
|
1621
1706
|
"publish",
|
|
1622
1707
|
"review",
|
|
@@ -1636,7 +1721,7 @@ var permissionSchema = z15.enum([
|
|
|
1636
1721
|
*/
|
|
1637
1722
|
"enroll"
|
|
1638
1723
|
]);
|
|
1639
|
-
var permissionListSchema =
|
|
1724
|
+
var permissionListSchema = z16.array(z16.string()).transform(
|
|
1640
1725
|
(values) => values.filter(
|
|
1641
1726
|
(value) => permissionSchema.safeParse(value).success
|
|
1642
1727
|
)
|
|
@@ -1646,38 +1731,38 @@ var rolePermissions = {
|
|
|
1646
1731
|
reviewer: ["read", "review"],
|
|
1647
1732
|
staff: ["read", "confirm", "handover"]
|
|
1648
1733
|
};
|
|
1649
|
-
var projectSetupSchema =
|
|
1650
|
-
mode:
|
|
1651
|
-
brief:
|
|
1734
|
+
var projectSetupSchema = z16.object({
|
|
1735
|
+
mode: z16.enum(["new", "existing"]),
|
|
1736
|
+
brief: z16.string().trim().min(1).max(4e3)
|
|
1652
1737
|
}).strict();
|
|
1653
|
-
var operatorUserSchema =
|
|
1654
|
-
id:
|
|
1655
|
-
name:
|
|
1656
|
-
email:
|
|
1657
|
-
avatar:
|
|
1738
|
+
var operatorUserSchema = z16.object({
|
|
1739
|
+
id: z16.string(),
|
|
1740
|
+
name: z16.string().nullable(),
|
|
1741
|
+
email: z16.string().nullable(),
|
|
1742
|
+
avatar: z16.string().nullable()
|
|
1658
1743
|
});
|
|
1659
|
-
var projectSchema =
|
|
1744
|
+
var projectSchema = z16.object({
|
|
1660
1745
|
/**
|
|
1661
1746
|
* Names the project's hosted addresses. The server gives a new project, and accepts in a
|
|
1662
1747
|
* slug change, only slugs of at least 3 characters that Domino does not reserve. This schema
|
|
1663
1748
|
* checks only the format, so it parses every slug that exists.
|
|
1664
1749
|
*/
|
|
1665
|
-
slug:
|
|
1666
|
-
createdBy:
|
|
1750
|
+
slug: z16.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
1751
|
+
createdBy: z16.string().nullable().optional(),
|
|
1667
1752
|
creator: operatorUserSchema.nullable().optional(),
|
|
1668
1753
|
/** A response, so fields a newer server adds to the setup are dropped, not rejected. */
|
|
1669
|
-
setup:
|
|
1754
|
+
setup: z16.object(projectSetupSchema.shape).optional(),
|
|
1670
1755
|
/** The starter chosen at setup. A plain string, so later starters still parse. */
|
|
1671
|
-
starter:
|
|
1672
|
-
id:
|
|
1756
|
+
starter: z16.string().optional(),
|
|
1757
|
+
id: z16.string().min(1),
|
|
1673
1758
|
organization: identifier,
|
|
1674
1759
|
project: identifier,
|
|
1675
|
-
name:
|
|
1676
|
-
subtitle:
|
|
1677
|
-
initials:
|
|
1678
|
-
color:
|
|
1760
|
+
name: z16.string(),
|
|
1761
|
+
subtitle: z16.string(),
|
|
1762
|
+
initials: z16.string(),
|
|
1763
|
+
color: z16.string(),
|
|
1679
1764
|
permissions: permissionListSchema,
|
|
1680
|
-
environments:
|
|
1765
|
+
environments: z16.array(environmentSchema)
|
|
1681
1766
|
}).refine(
|
|
1682
1767
|
(project) => !project.creator || project.creator.id === project.createdBy,
|
|
1683
1768
|
{
|
|
@@ -1685,45 +1770,45 @@ var projectSchema = z15.object({
|
|
|
1685
1770
|
path: ["creator"]
|
|
1686
1771
|
}
|
|
1687
1772
|
);
|
|
1688
|
-
var projectInputSchema =
|
|
1773
|
+
var projectInputSchema = z16.object({
|
|
1689
1774
|
actionId: identifier,
|
|
1690
|
-
name:
|
|
1775
|
+
name: z16.string().trim().min(1).max(80),
|
|
1691
1776
|
setup: projectSetupSchema.optional(),
|
|
1692
1777
|
/** The starter a new hosted app begins from, with `setup.mode` "new". */
|
|
1693
1778
|
starter: starterIdSchema.optional()
|
|
1694
1779
|
}).strict();
|
|
1695
|
-
var projectUpdateInputSchema =
|
|
1696
|
-
|
|
1697
|
-
|
|
1780
|
+
var projectUpdateInputSchema = z16.union([
|
|
1781
|
+
z16.object({ name: projectInputSchema.shape.name }).strict(),
|
|
1782
|
+
z16.object({
|
|
1698
1783
|
slug: projectSchema.shape.slug,
|
|
1699
|
-
confirm:
|
|
1784
|
+
confirm: z16.string().min(1).max(80)
|
|
1700
1785
|
}).strict()
|
|
1701
1786
|
]);
|
|
1702
|
-
var projectDeletionInputSchema =
|
|
1703
|
-
var projectDeletionSchema =
|
|
1787
|
+
var projectDeletionInputSchema = z16.object({ confirm: z16.string().min(1).max(80) }).strict();
|
|
1788
|
+
var projectDeletionSchema = z16.object({
|
|
1704
1789
|
project: identifier,
|
|
1705
|
-
purgeAfter:
|
|
1790
|
+
purgeAfter: z16.number().int()
|
|
1706
1791
|
});
|
|
1707
|
-
var projectTransferInputSchema =
|
|
1708
|
-
var projectTransferSchema =
|
|
1792
|
+
var projectTransferInputSchema = z16.object({ organization: identifier, confirm: z16.string().min(1).max(80) }).strict();
|
|
1793
|
+
var projectTransferSchema = z16.object({
|
|
1709
1794
|
organization: identifier,
|
|
1710
1795
|
project: identifier
|
|
1711
1796
|
});
|
|
1712
|
-
var grantSchema =
|
|
1713
|
-
subject:
|
|
1714
|
-
roles:
|
|
1715
|
-
environments:
|
|
1797
|
+
var grantSchema = z16.object({
|
|
1798
|
+
subject: z16.string().min(1).max(200),
|
|
1799
|
+
roles: z16.array(roleSchema),
|
|
1800
|
+
environments: z16.array(environmentSchema)
|
|
1716
1801
|
}).strict();
|
|
1717
|
-
var grantRecordSchema =
|
|
1718
|
-
var stockAdditionSchema =
|
|
1802
|
+
var grantRecordSchema = z16.object(grantSchema.shape);
|
|
1803
|
+
var stockAdditionSchema = z16.object({
|
|
1719
1804
|
item: identifier,
|
|
1720
|
-
quantity:
|
|
1805
|
+
quantity: z16.number().int(),
|
|
1721
1806
|
actionId: identifier
|
|
1722
1807
|
});
|
|
1723
|
-
var completionRevokeSchema =
|
|
1808
|
+
var completionRevokeSchema = z16.object({
|
|
1724
1809
|
actionId: identifier,
|
|
1725
|
-
reason:
|
|
1726
|
-
freeOccurrence:
|
|
1810
|
+
reason: z16.string().trim().min(1).max(500),
|
|
1811
|
+
freeOccurrence: z16.boolean().default(false)
|
|
1727
1812
|
}).strict();
|
|
1728
1813
|
var RevokedEntitlementOutcome = {
|
|
1729
1814
|
/** No other completion grants the reward: it is void, after cancelling a handover in progress. */
|
|
@@ -1751,221 +1836,221 @@ var RevokedReferralOutcome = {
|
|
|
1751
1836
|
/** Qualified on another accepted completion of the program's quest instead. */
|
|
1752
1837
|
Requalified: "requalified"
|
|
1753
1838
|
};
|
|
1754
|
-
var entitlementOutcomeSchema =
|
|
1755
|
-
var deliveryOutcomeSchema =
|
|
1756
|
-
var referralOutcomeSchema =
|
|
1757
|
-
var completionRevocationSchema =
|
|
1839
|
+
var entitlementOutcomeSchema = z16.string().min(1).max(64);
|
|
1840
|
+
var deliveryOutcomeSchema = z16.string().min(1).max(64);
|
|
1841
|
+
var referralOutcomeSchema = z16.string().min(1).max(64);
|
|
1842
|
+
var completionRevocationSchema = z16.object({
|
|
1758
1843
|
completion: identifier,
|
|
1759
1844
|
/** The quest ID, or the board ID when `source.kind` is `leaderboard`. */
|
|
1760
1845
|
quest: identifier,
|
|
1761
1846
|
member: identifier,
|
|
1762
1847
|
/** What paid the revoked completion. `source.id` repeats `quest`. */
|
|
1763
1848
|
source: completionSourceSchema.optional(),
|
|
1764
|
-
revokedAt:
|
|
1765
|
-
occurrenceFreed:
|
|
1766
|
-
badges:
|
|
1767
|
-
points:
|
|
1768
|
-
|
|
1849
|
+
revokedAt: z16.number(),
|
|
1850
|
+
occurrenceFreed: z16.boolean(),
|
|
1851
|
+
badges: z16.array(z16.object({ badge: identifier, stillAwarded: z16.boolean() })).optional(),
|
|
1852
|
+
points: z16.array(
|
|
1853
|
+
z16.object({
|
|
1769
1854
|
entry: identifier,
|
|
1770
1855
|
balance: identifier,
|
|
1771
1856
|
reversal: identifier.nullable(),
|
|
1772
|
-
reversed:
|
|
1773
|
-
unreversed:
|
|
1857
|
+
reversed: z16.number().int(),
|
|
1858
|
+
unreversed: z16.number().int()
|
|
1774
1859
|
})
|
|
1775
1860
|
),
|
|
1776
|
-
entitlements:
|
|
1777
|
-
|
|
1861
|
+
entitlements: z16.array(
|
|
1862
|
+
z16.object({
|
|
1778
1863
|
entitlement: identifier,
|
|
1779
1864
|
reward: identifier,
|
|
1780
1865
|
outcome: entitlementOutcomeSchema,
|
|
1781
|
-
status:
|
|
1866
|
+
status: z16.string()
|
|
1782
1867
|
})
|
|
1783
1868
|
),
|
|
1784
|
-
deliveries:
|
|
1785
|
-
|
|
1786
|
-
delivery:
|
|
1787
|
-
roleId:
|
|
1869
|
+
deliveries: z16.array(
|
|
1870
|
+
z16.object({
|
|
1871
|
+
delivery: z16.string(),
|
|
1872
|
+
roleId: z16.string(),
|
|
1788
1873
|
outcome: deliveryOutcomeSchema,
|
|
1789
1874
|
/**
|
|
1790
1875
|
* By Relay's records, another accepted, unrevoked completion of the member also granted this
|
|
1791
1876
|
* role to the same Discord account and server. Relay does not read Discord's membership.
|
|
1792
1877
|
*/
|
|
1793
|
-
stillGranted:
|
|
1878
|
+
stillGranted: z16.boolean()
|
|
1794
1879
|
})
|
|
1795
1880
|
),
|
|
1796
|
-
referrals:
|
|
1797
|
-
|
|
1881
|
+
referrals: z16.array(
|
|
1882
|
+
z16.object({
|
|
1798
1883
|
program: identifier,
|
|
1799
1884
|
outcome: referralOutcomeSchema
|
|
1800
1885
|
})
|
|
1801
1886
|
),
|
|
1802
|
-
streakMilestone:
|
|
1887
|
+
streakMilestone: z16.boolean()
|
|
1803
1888
|
});
|
|
1804
|
-
var accessSchema =
|
|
1805
|
-
actor:
|
|
1806
|
-
organization:
|
|
1807
|
-
admin:
|
|
1808
|
-
local:
|
|
1809
|
-
projects:
|
|
1889
|
+
var accessSchema = z16.object({
|
|
1890
|
+
actor: z16.string(),
|
|
1891
|
+
organization: z16.string(),
|
|
1892
|
+
admin: z16.boolean(),
|
|
1893
|
+
local: z16.boolean(),
|
|
1894
|
+
projects: z16.array(projectSchema)
|
|
1810
1895
|
});
|
|
1811
|
-
var querySchema =
|
|
1812
|
-
q:
|
|
1813
|
-
filter:
|
|
1814
|
-
offset:
|
|
1815
|
-
limit:
|
|
1896
|
+
var querySchema = z16.object({
|
|
1897
|
+
q: z16.string().max(200).default(""),
|
|
1898
|
+
filter: z16.string().max(50).default("all"),
|
|
1899
|
+
offset: z16.coerce.number().int().min(0).max(1e6).default(0),
|
|
1900
|
+
limit: z16.coerce.number().int().min(1).max(100).default(25)
|
|
1816
1901
|
});
|
|
1817
|
-
var accountProfileSchema =
|
|
1818
|
-
name:
|
|
1902
|
+
var accountProfileSchema = z16.object({
|
|
1903
|
+
name: z16.string().optional(),
|
|
1819
1904
|
/** The account's handle, where the provider has one (X and Discord). */
|
|
1820
|
-
username:
|
|
1821
|
-
email:
|
|
1822
|
-
emailVerified:
|
|
1823
|
-
imageUrl:
|
|
1905
|
+
username: z16.string().optional(),
|
|
1906
|
+
email: z16.string().optional(),
|
|
1907
|
+
emailVerified: z16.boolean().default(false),
|
|
1908
|
+
imageUrl: z16.string().url().optional()
|
|
1824
1909
|
});
|
|
1825
|
-
var memberAccountSchema =
|
|
1910
|
+
var memberAccountSchema = z16.object({
|
|
1826
1911
|
/** `wallet` for wallet sign-in, `account` for every other connected account. */
|
|
1827
|
-
kind:
|
|
1828
|
-
provider:
|
|
1829
|
-
subject:
|
|
1830
|
-
signInEnabled:
|
|
1912
|
+
kind: z16.enum(["account", "wallet"]),
|
|
1913
|
+
provider: z16.string(),
|
|
1914
|
+
subject: z16.string(),
|
|
1915
|
+
signInEnabled: z16.boolean(),
|
|
1831
1916
|
profile: accountProfileSchema.optional()
|
|
1832
1917
|
});
|
|
1833
|
-
var operationSchema =
|
|
1834
|
-
target:
|
|
1835
|
-
paused:
|
|
1836
|
-
revision:
|
|
1837
|
-
reason:
|
|
1838
|
-
actor:
|
|
1839
|
-
changedAt:
|
|
1918
|
+
var operationSchema = z16.object({
|
|
1919
|
+
target: z16.string(),
|
|
1920
|
+
paused: z16.boolean(),
|
|
1921
|
+
revision: z16.number().int(),
|
|
1922
|
+
reason: z16.string(),
|
|
1923
|
+
actor: z16.string().nullable(),
|
|
1924
|
+
changedAt: z16.number()
|
|
1840
1925
|
});
|
|
1841
|
-
var operationInputSchema =
|
|
1842
|
-
target:
|
|
1843
|
-
|
|
1844
|
-
|
|
1926
|
+
var operationInputSchema = z16.object({
|
|
1927
|
+
target: z16.union([
|
|
1928
|
+
z16.literal("redemptions"),
|
|
1929
|
+
z16.string().regex(/^quest:[\w-]+$/)
|
|
1845
1930
|
]),
|
|
1846
|
-
paused:
|
|
1847
|
-
revision:
|
|
1848
|
-
reason:
|
|
1931
|
+
paused: z16.boolean(),
|
|
1932
|
+
revision: z16.number().int().nonnegative(),
|
|
1933
|
+
reason: z16.string().trim().min(1).max(500),
|
|
1849
1934
|
actionId: identifier
|
|
1850
1935
|
}).strict();
|
|
1851
|
-
var questLifecycleInputSchema =
|
|
1936
|
+
var questLifecycleInputSchema = z16.object({
|
|
1852
1937
|
quest: identifier,
|
|
1853
1938
|
expectedRelease: identifier.optional(),
|
|
1854
|
-
archived:
|
|
1855
|
-
reason:
|
|
1939
|
+
archived: z16.boolean(),
|
|
1940
|
+
reason: z16.string().trim().min(1).max(500),
|
|
1856
1941
|
actionId: identifier
|
|
1857
1942
|
}).strict();
|
|
1858
|
-
var questLifecycleSchema =
|
|
1943
|
+
var questLifecycleSchema = z16.object({
|
|
1859
1944
|
quest: identifier,
|
|
1860
1945
|
key: identifier.nullable(),
|
|
1861
|
-
title:
|
|
1946
|
+
title: z16.string(),
|
|
1862
1947
|
release: identifier,
|
|
1863
|
-
lifecycle:
|
|
1864
|
-
changed:
|
|
1948
|
+
lifecycle: z16.enum(["active", "paused", "archived"]),
|
|
1949
|
+
changed: z16.boolean()
|
|
1865
1950
|
});
|
|
1866
|
-
var memberSchema =
|
|
1867
|
-
id:
|
|
1868
|
-
test:
|
|
1869
|
-
name:
|
|
1870
|
-
accounts:
|
|
1871
|
-
attempts:
|
|
1872
|
-
completions:
|
|
1873
|
-
rewards:
|
|
1874
|
-
lastActivity:
|
|
1951
|
+
var memberSchema = z16.object({
|
|
1952
|
+
id: z16.string(),
|
|
1953
|
+
test: z16.boolean().optional(),
|
|
1954
|
+
name: z16.string().nullable().optional(),
|
|
1955
|
+
accounts: z16.array(memberAccountSchema).default([]),
|
|
1956
|
+
attempts: z16.number(),
|
|
1957
|
+
completions: z16.number(),
|
|
1958
|
+
rewards: z16.number(),
|
|
1959
|
+
lastActivity: z16.number().nullable()
|
|
1875
1960
|
});
|
|
1876
|
-
var personSchema =
|
|
1877
|
-
id:
|
|
1878
|
-
test:
|
|
1879
|
-
name:
|
|
1880
|
-
accounts:
|
|
1961
|
+
var personSchema = z16.object({
|
|
1962
|
+
id: z16.string(),
|
|
1963
|
+
test: z16.boolean().optional(),
|
|
1964
|
+
name: z16.string().nullable().optional(),
|
|
1965
|
+
accounts: z16.array(memberAccountSchema).default([])
|
|
1881
1966
|
});
|
|
1882
|
-
var metricsSchema =
|
|
1883
|
-
quests:
|
|
1884
|
-
members:
|
|
1885
|
-
attempts:
|
|
1886
|
-
completions:
|
|
1887
|
-
review:
|
|
1888
|
-
failed:
|
|
1889
|
-
entitlements:
|
|
1967
|
+
var metricsSchema = z16.object({
|
|
1968
|
+
quests: z16.number(),
|
|
1969
|
+
members: z16.number(),
|
|
1970
|
+
attempts: z16.number(),
|
|
1971
|
+
completions: z16.number(),
|
|
1972
|
+
review: z16.number(),
|
|
1973
|
+
failed: z16.number(),
|
|
1974
|
+
entitlements: z16.number()
|
|
1890
1975
|
});
|
|
1891
|
-
var readinessSchema =
|
|
1892
|
-
checks:
|
|
1893
|
-
|
|
1894
|
-
id:
|
|
1895
|
-
status:
|
|
1896
|
-
title:
|
|
1897
|
-
detail:
|
|
1976
|
+
var readinessSchema = z16.object({
|
|
1977
|
+
checks: z16.array(
|
|
1978
|
+
z16.object({
|
|
1979
|
+
id: z16.string(),
|
|
1980
|
+
status: z16.enum(["ready", "blocked"]),
|
|
1981
|
+
title: z16.string(),
|
|
1982
|
+
detail: z16.string()
|
|
1898
1983
|
})
|
|
1899
1984
|
)
|
|
1900
1985
|
});
|
|
1901
|
-
var inventorySchema =
|
|
1902
|
-
item:
|
|
1903
|
-
name:
|
|
1904
|
-
available:
|
|
1905
|
-
reserved:
|
|
1906
|
-
allocated:
|
|
1986
|
+
var inventorySchema = z16.object({
|
|
1987
|
+
item: z16.string(),
|
|
1988
|
+
name: z16.string().nullable().default(null),
|
|
1989
|
+
available: z16.number(),
|
|
1990
|
+
reserved: z16.number(),
|
|
1991
|
+
allocated: z16.number().default(0)
|
|
1907
1992
|
});
|
|
1908
|
-
var auditRecordSchema =
|
|
1909
|
-
id:
|
|
1910
|
-
action:
|
|
1911
|
-
actor:
|
|
1993
|
+
var auditRecordSchema = z16.object({
|
|
1994
|
+
id: z16.string(),
|
|
1995
|
+
action: z16.string(),
|
|
1996
|
+
actor: z16.string().nullable(),
|
|
1912
1997
|
user: operatorUserSchema.nullable().optional(),
|
|
1913
|
-
detail:
|
|
1914
|
-
at:
|
|
1915
|
-
attempt:
|
|
1998
|
+
detail: z16.string(),
|
|
1999
|
+
at: z16.number(),
|
|
2000
|
+
attempt: z16.string().nullable()
|
|
1916
2001
|
}).refine((record5) => !record5.user || record5.user.id === record5.actor, {
|
|
1917
2002
|
message: "User profile must match the recorded actor",
|
|
1918
2003
|
path: ["user"]
|
|
1919
2004
|
});
|
|
1920
|
-
var pageSchema =
|
|
2005
|
+
var pageSchema = z16.object({
|
|
1921
2006
|
snapshot: snapshotSchema,
|
|
1922
|
-
members:
|
|
1923
|
-
people:
|
|
2007
|
+
members: z16.array(memberSchema),
|
|
2008
|
+
people: z16.array(personSchema).default([]),
|
|
1924
2009
|
metrics: metricsSchema,
|
|
1925
|
-
total:
|
|
1926
|
-
offset:
|
|
1927
|
-
limit:
|
|
1928
|
-
inventory:
|
|
1929
|
-
operations:
|
|
1930
|
-
audit:
|
|
1931
|
-
questCounts:
|
|
2010
|
+
total: z16.number(),
|
|
2011
|
+
offset: z16.number(),
|
|
2012
|
+
limit: z16.number(),
|
|
2013
|
+
inventory: z16.array(inventorySchema),
|
|
2014
|
+
operations: z16.array(operationSchema).default([]),
|
|
2015
|
+
audit: z16.array(auditRecordSchema).default([]),
|
|
2016
|
+
questCounts: z16.record(z16.string(), z16.number())
|
|
1932
2017
|
});
|
|
1933
|
-
var managedOAuthAccountBaseSchema =
|
|
1934
|
-
provider:
|
|
1935
|
-
revision:
|
|
2018
|
+
var managedOAuthAccountBaseSchema = z16.object({
|
|
2019
|
+
provider: z16.enum(["x", "discord"]),
|
|
2020
|
+
revision: z16.number().int().nonnegative()
|
|
1936
2021
|
});
|
|
1937
|
-
var managedOAuthAccountSchema =
|
|
2022
|
+
var managedOAuthAccountSchema = z16.discriminatedUnion("status", [
|
|
1938
2023
|
managedOAuthAccountBaseSchema.extend({
|
|
1939
|
-
status:
|
|
1940
|
-
subject:
|
|
1941
|
-
linkedAt:
|
|
2024
|
+
status: z16.literal("connected"),
|
|
2025
|
+
subject: z16.string().min(1),
|
|
2026
|
+
linkedAt: z16.number(),
|
|
1942
2027
|
/**
|
|
1943
2028
|
* True when a member import attached the account with the organization's word for it, not the
|
|
1944
2029
|
* member's proof. Absent from Relay versions without imports.
|
|
1945
2030
|
*/
|
|
1946
|
-
imported:
|
|
2031
|
+
imported: z16.boolean().optional()
|
|
1947
2032
|
}),
|
|
1948
|
-
managedOAuthAccountBaseSchema.extend({ status:
|
|
2033
|
+
managedOAuthAccountBaseSchema.extend({ status: z16.literal("disconnected") })
|
|
1949
2034
|
]);
|
|
1950
2035
|
var managedTelegramAccountBaseSchema = managedOAuthAccountBaseSchema.extend({
|
|
1951
|
-
provider:
|
|
2036
|
+
provider: z16.literal("telegram")
|
|
1952
2037
|
});
|
|
1953
|
-
var managedTelegramAccountSchema =
|
|
2038
|
+
var managedTelegramAccountSchema = z16.discriminatedUnion("status", [
|
|
1954
2039
|
managedTelegramAccountBaseSchema.extend({
|
|
1955
|
-
status:
|
|
2040
|
+
status: z16.literal("connected"),
|
|
1956
2041
|
/** The numeric Telegram user ID. */
|
|
1957
|
-
subject:
|
|
1958
|
-
linkedAt:
|
|
2042
|
+
subject: z16.string().min(1),
|
|
2043
|
+
linkedAt: z16.number()
|
|
1959
2044
|
}),
|
|
1960
2045
|
managedTelegramAccountBaseSchema.extend({
|
|
1961
|
-
status:
|
|
2046
|
+
status: z16.literal("disconnected")
|
|
1962
2047
|
})
|
|
1963
2048
|
]);
|
|
1964
|
-
var memberOAuthUnlinkInputSchema =
|
|
1965
|
-
provider:
|
|
1966
|
-
subject:
|
|
1967
|
-
revision:
|
|
1968
|
-
reason:
|
|
2049
|
+
var memberOAuthUnlinkInputSchema = z16.object({
|
|
2050
|
+
provider: z16.enum(["x", "discord"]),
|
|
2051
|
+
subject: z16.string().min(1).max(4096),
|
|
2052
|
+
revision: z16.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER - 1),
|
|
2053
|
+
reason: z16.string().trim().min(1).max(500)
|
|
1969
2054
|
}).strict();
|
|
1970
2055
|
var memberTelegramUnlinkInputSchema = memberOAuthUnlinkInputSchema.omit({ provider: true }).strict();
|
|
1971
2056
|
var managedWalletSchema = linkedWalletSchema.extend({
|
|
@@ -1973,27 +2058,27 @@ var managedWalletSchema = linkedWalletSchema.extend({
|
|
|
1973
2058
|
* True when a member import attached the wallet with the organization's word for it, and the
|
|
1974
2059
|
* member has not proved it since. Absent from Relay versions without imports.
|
|
1975
2060
|
*/
|
|
1976
|
-
imported:
|
|
1977
|
-
status:
|
|
1978
|
-
unlinkedAt:
|
|
2061
|
+
imported: z16.boolean().optional(),
|
|
2062
|
+
status: z16.enum(["linked", "unlinked"]),
|
|
2063
|
+
unlinkedAt: z16.number().int().nullable(),
|
|
1979
2064
|
/** "member", or the operator or key that unlinked it. */
|
|
1980
|
-
unlinkedBy:
|
|
2065
|
+
unlinkedBy: z16.string().nullable()
|
|
1981
2066
|
});
|
|
1982
2067
|
var managedMemberIdentitySchema = memberIdentitySchema.extend({
|
|
1983
2068
|
/**
|
|
1984
2069
|
* True for an X account a member import attached, until the member links or signs in with it
|
|
1985
2070
|
* through X. Absent from Relay versions without imports.
|
|
1986
2071
|
*/
|
|
1987
|
-
imported:
|
|
1988
|
-
status:
|
|
1989
|
-
unlinkedAt:
|
|
2072
|
+
imported: z16.boolean().optional(),
|
|
2073
|
+
status: z16.enum(["linked", "unlinked"]),
|
|
2074
|
+
unlinkedAt: z16.number().int().nullable(),
|
|
1990
2075
|
/** The operator or key that unlinked it. */
|
|
1991
|
-
unlinkedBy:
|
|
2076
|
+
unlinkedBy: z16.string().nullable()
|
|
1992
2077
|
});
|
|
1993
|
-
var memberIdentityChangeInputSchema =
|
|
2078
|
+
var memberIdentityChangeInputSchema = z16.object({
|
|
1994
2079
|
kind: appIdentityKindSchema,
|
|
1995
|
-
subject:
|
|
1996
|
-
reason:
|
|
2080
|
+
subject: z16.string().min(1).max(256),
|
|
2081
|
+
reason: z16.string().trim().min(1).max(500)
|
|
1997
2082
|
}).strict();
|
|
1998
2083
|
var balanceCheckSchema = walletBalanceSchema.pick({
|
|
1999
2084
|
chain: true,
|
|
@@ -2003,76 +2088,76 @@ var balanceCheckSchema = walletBalanceSchema.pick({
|
|
|
2003
2088
|
wallets: true,
|
|
2004
2089
|
observedAt: true
|
|
2005
2090
|
}).extend({ attempt: identifier });
|
|
2006
|
-
var walletBalanceChainsSchema =
|
|
2007
|
-
chains:
|
|
2008
|
-
|
|
2009
|
-
chain:
|
|
2010
|
-
|
|
2091
|
+
var walletBalanceChainsSchema = z16.object({
|
|
2092
|
+
chains: z16.array(
|
|
2093
|
+
z16.object({
|
|
2094
|
+
chain: z16.union([
|
|
2095
|
+
z16.literal(solanaMainnet),
|
|
2011
2096
|
cosmosNetworkSchema,
|
|
2012
2097
|
evmChainIdSchema
|
|
2013
2098
|
]),
|
|
2014
|
-
name:
|
|
2015
|
-
testnet:
|
|
2099
|
+
name: z16.string(),
|
|
2100
|
+
testnet: z16.boolean()
|
|
2016
2101
|
})
|
|
2017
2102
|
)
|
|
2018
2103
|
});
|
|
2019
|
-
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason:
|
|
2104
|
+
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason: z16.string().trim().min(1).max(500) }).strict();
|
|
2020
2105
|
var memberWalletSignInInputSchema = walletUnlinkInputSchema.extend({
|
|
2021
|
-
enabled:
|
|
2022
|
-
reason:
|
|
2106
|
+
enabled: z16.boolean(),
|
|
2107
|
+
reason: z16.string().trim().min(1).max(500)
|
|
2023
2108
|
}).strict();
|
|
2024
|
-
var telegramBotIdSchema =
|
|
2025
|
-
var participantSignInSchema =
|
|
2026
|
-
providers:
|
|
2027
|
-
|
|
2109
|
+
var telegramBotIdSchema = z16.string().regex(/^[1-9][0-9]{0,19}$/, "Enter the bot's numeric ID, such as 123456789");
|
|
2110
|
+
var participantSignInSchema = z16.object({
|
|
2111
|
+
providers: z16.array(
|
|
2112
|
+
z16.object({ provider: authProviderSchema, configured: z16.boolean() })
|
|
2028
2113
|
),
|
|
2029
|
-
email:
|
|
2114
|
+
email: z16.boolean(),
|
|
2030
2115
|
/** Wallet families: `"solana"`, `"eip155"`, `"cosmos"`. */
|
|
2031
2116
|
wallets: walletSignInNetworksSchema,
|
|
2032
2117
|
/** Why participants cannot sign in to this project, or null. */
|
|
2033
|
-
issue:
|
|
2118
|
+
issue: z16.string().nullable(),
|
|
2034
2119
|
/**
|
|
2035
2120
|
* Telegram, outside `providers` in SDK 1.x: whether Domino configured Telegram Login, and the
|
|
2036
2121
|
* bot whose Mini App participants sign in from, or null when Mini App sign-in is off. Absent
|
|
2037
2122
|
* from Relay versions without Telegram.
|
|
2038
2123
|
*/
|
|
2039
|
-
telegram:
|
|
2040
|
-
login:
|
|
2124
|
+
telegram: z16.object({
|
|
2125
|
+
login: z16.boolean(),
|
|
2041
2126
|
miniAppBotId: telegramBotIdSchema.nullable()
|
|
2042
2127
|
}).optional(),
|
|
2043
|
-
updatedAt:
|
|
2044
|
-
updatedBy:
|
|
2128
|
+
updatedAt: z16.number().nullable(),
|
|
2129
|
+
updatedBy: z16.string().nullable()
|
|
2045
2130
|
});
|
|
2046
|
-
var participantSignInInputSchema =
|
|
2131
|
+
var participantSignInInputSchema = z16.object({
|
|
2047
2132
|
wallets: walletSignInNetworksSchema,
|
|
2048
|
-
telegram:
|
|
2133
|
+
telegram: z16.object({ miniAppBotId: telegramBotIdSchema.nullable() }).strict().optional()
|
|
2049
2134
|
}).strict();
|
|
2050
|
-
var completionRevocationShortfallSchema =
|
|
2135
|
+
var completionRevocationShortfallSchema = z16.object({
|
|
2051
2136
|
completion: identifier,
|
|
2052
2137
|
quest: identifier,
|
|
2053
|
-
revokedAt:
|
|
2054
|
-
unreversedPoints:
|
|
2138
|
+
revokedAt: z16.number().int().nonnegative().safe(),
|
|
2139
|
+
unreversedPoints: z16.record(identifier, z16.number().int().positive().safe())
|
|
2055
2140
|
});
|
|
2056
|
-
var memberDetailSchema =
|
|
2141
|
+
var memberDetailSchema = z16.object({
|
|
2057
2142
|
snapshot: snapshotSchema,
|
|
2058
2143
|
member: memberSchema,
|
|
2059
2144
|
progress: memberProgressSchema,
|
|
2060
2145
|
/** Up to 25 revoked completions with an unreversed point remainder, newest first. */
|
|
2061
|
-
revocationShortfalls:
|
|
2146
|
+
revocationShortfalls: z16.array(completionRevocationShortfallSchema).default([]),
|
|
2062
2147
|
/** Current and historical campaign enrollment state, including inactive enrollments. */
|
|
2063
|
-
campaignEnrollments:
|
|
2064
|
-
passes:
|
|
2065
|
-
|
|
2066
|
-
provider:
|
|
2067
|
-
event:
|
|
2068
|
-
subject:
|
|
2148
|
+
campaignEnrollments: z16.array(campaignEnrollmentSchema).default([]),
|
|
2149
|
+
passes: z16.array(
|
|
2150
|
+
z16.object({
|
|
2151
|
+
provider: z16.string(),
|
|
2152
|
+
event: z16.string(),
|
|
2153
|
+
subject: z16.string(),
|
|
2069
2154
|
attempt: identifier.nullable()
|
|
2070
2155
|
})
|
|
2071
2156
|
).default([]),
|
|
2072
2157
|
/** Linked and unlinked wallets. */
|
|
2073
|
-
wallets:
|
|
2158
|
+
wallets: z16.array(managedWalletSchema),
|
|
2074
2159
|
/** The member's 10 most recent recorded balance reads, newest first. */
|
|
2075
|
-
balanceChecks:
|
|
2160
|
+
balanceChecks: z16.array(balanceCheckSchema),
|
|
2076
2161
|
/** The member's participant profile in this project. */
|
|
2077
2162
|
profile: managedProfileSchema.nullable(),
|
|
2078
2163
|
/**
|
|
@@ -2080,11 +2165,11 @@ var memberDetailSchema = z15.object({
|
|
|
2080
2165
|
* member ID: their selected X and Discord accounts and their `app:<name>` identities in this
|
|
2081
2166
|
* project, including app identities an operator unlinked, by kind.
|
|
2082
2167
|
*/
|
|
2083
|
-
identities:
|
|
2168
|
+
identities: z16.array(managedMemberIdentitySchema)
|
|
2084
2169
|
});
|
|
2085
|
-
var managedMemberProgressSchema =
|
|
2170
|
+
var managedMemberProgressSchema = z16.object({
|
|
2086
2171
|
member: identifier,
|
|
2087
|
-
quests:
|
|
2172
|
+
quests: z16.array(
|
|
2088
2173
|
memberProgressSchema.shape.quests.element.extend({
|
|
2089
2174
|
/** The streak as `members.get` reports it, without the list of qualifying days. */
|
|
2090
2175
|
streak: streakProgressSchema.omit({ days: true }).nullable().optional()
|
|
@@ -2095,152 +2180,152 @@ var managedMemberProgressSchema = z15.object({
|
|
|
2095
2180
|
/** Each point balance the member has, by balance ID. */
|
|
2096
2181
|
balances: snapshotSchema.shape.balances
|
|
2097
2182
|
});
|
|
2098
|
-
var stockInputSchema =
|
|
2183
|
+
var stockInputSchema = z16.object({
|
|
2099
2184
|
item: identifier,
|
|
2100
|
-
quantity:
|
|
2185
|
+
quantity: z16.number().int().positive().max(1e6),
|
|
2101
2186
|
actionId: identifier
|
|
2102
2187
|
}).strict();
|
|
2103
|
-
var ingestTrackerScopeSchema =
|
|
2104
|
-
var tokenScopeInputSchema =
|
|
2105
|
-
var tokenInputSchema =
|
|
2106
|
-
name:
|
|
2188
|
+
var ingestTrackerScopeSchema = z16.array(identifier).min(1).max(100).nullable();
|
|
2189
|
+
var tokenScopeInputSchema = z16.object({ ingestTrackers: ingestTrackerScopeSchema }).strict();
|
|
2190
|
+
var tokenInputSchema = z16.object({
|
|
2191
|
+
name: z16.string().trim().min(1).max(80),
|
|
2107
2192
|
project: identifier,
|
|
2108
2193
|
environment: environmentSchema,
|
|
2109
|
-
permissions:
|
|
2194
|
+
permissions: z16.array(permissionSchema).min(1),
|
|
2110
2195
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
2111
|
-
days:
|
|
2196
|
+
days: z16.number().int().min(1).max(90).default(30)
|
|
2112
2197
|
}).strict();
|
|
2113
|
-
var tokenSchema =
|
|
2114
|
-
id:
|
|
2115
|
-
name:
|
|
2116
|
-
project:
|
|
2198
|
+
var tokenSchema = z16.object({
|
|
2199
|
+
id: z16.string(),
|
|
2200
|
+
name: z16.string(),
|
|
2201
|
+
project: z16.string(),
|
|
2117
2202
|
environment: environmentSchema,
|
|
2118
2203
|
permissions: permissionListSchema,
|
|
2119
2204
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
2120
|
-
expiresAt:
|
|
2205
|
+
expiresAt: z16.number()
|
|
2121
2206
|
});
|
|
2122
|
-
var issuedTokenSchema = tokenSchema.extend({ token:
|
|
2123
|
-
var serviceKeyInputSchema =
|
|
2124
|
-
name:
|
|
2125
|
-
permissions:
|
|
2207
|
+
var issuedTokenSchema = tokenSchema.extend({ token: z16.string() });
|
|
2208
|
+
var serviceKeyInputSchema = z16.object({
|
|
2209
|
+
name: z16.string().trim().min(1).max(80),
|
|
2210
|
+
permissions: z16.array(permissionSchema).min(1).refine(
|
|
2126
2211
|
(permissions) => !permissions.includes("access"),
|
|
2127
2212
|
"Service keys cannot hold the access permission"
|
|
2128
2213
|
),
|
|
2129
2214
|
/** Days until the first secret expires. Omit it for a key that never expires. */
|
|
2130
|
-
expiresInDays:
|
|
2215
|
+
expiresInDays: z16.number().int().min(1).max(3650).optional()
|
|
2131
2216
|
}).strict();
|
|
2132
|
-
var serviceKeySchema =
|
|
2133
|
-
id:
|
|
2134
|
-
organization:
|
|
2135
|
-
project:
|
|
2217
|
+
var serviceKeySchema = z16.object({
|
|
2218
|
+
id: z16.string().uuid(),
|
|
2219
|
+
organization: z16.string(),
|
|
2220
|
+
project: z16.string(),
|
|
2136
2221
|
environment: environmentSchema,
|
|
2137
|
-
name:
|
|
2222
|
+
name: z16.string(),
|
|
2138
2223
|
permissions: permissionListSchema,
|
|
2139
2224
|
/** The Clerk user ID of the administrator who created it. */
|
|
2140
|
-
createdBy:
|
|
2141
|
-
createdAt:
|
|
2225
|
+
createdBy: z16.string(),
|
|
2226
|
+
createdAt: z16.number(),
|
|
2142
2227
|
/** The latest use of any of its secrets, revoked ones included; null when none was used. */
|
|
2143
|
-
lastUsedAt:
|
|
2228
|
+
lastUsedAt: z16.number().nullable(),
|
|
2144
2229
|
/** Its working secrets, oldest first. Any of them authenticates the key. */
|
|
2145
|
-
secrets:
|
|
2230
|
+
secrets: z16.array(credentialSecretSchema)
|
|
2146
2231
|
});
|
|
2147
2232
|
var issuedServiceKeySchema = serviceKeySchema.extend({
|
|
2148
|
-
secret:
|
|
2149
|
-
token:
|
|
2233
|
+
secret: z16.string().uuid(),
|
|
2234
|
+
token: z16.string()
|
|
2150
2235
|
});
|
|
2151
|
-
var teamSchema =
|
|
2152
|
-
|
|
2236
|
+
var teamSchema = z16.array(
|
|
2237
|
+
z16.object({ id: z16.string(), label: z16.string() })
|
|
2153
2238
|
);
|
|
2154
|
-
var memberLookupSchema =
|
|
2155
|
-
provider:
|
|
2156
|
-
subject:
|
|
2239
|
+
var memberLookupSchema = z16.object({
|
|
2240
|
+
provider: z16.string().min(1).max(200),
|
|
2241
|
+
subject: z16.string().min(1).max(2048)
|
|
2157
2242
|
}).strict();
|
|
2158
|
-
var booleanQuery =
|
|
2159
|
-
|
|
2160
|
-
|
|
2243
|
+
var booleanQuery = z16.union([
|
|
2244
|
+
z16.boolean(),
|
|
2245
|
+
z16.enum(["true", "false"]).transform((v) => v === "true")
|
|
2161
2246
|
]);
|
|
2162
|
-
var managedMemberQuerySchema =
|
|
2163
|
-
q:
|
|
2247
|
+
var managedMemberQuerySchema = z16.strictObject({
|
|
2248
|
+
q: z16.string().max(200).optional(),
|
|
2164
2249
|
needsReview: booleanQuery.optional(),
|
|
2165
|
-
limit:
|
|
2250
|
+
limit: z16.coerce.number().int().min(1).max(100).optional(),
|
|
2166
2251
|
cursor: pageCursorSchema.optional()
|
|
2167
2252
|
});
|
|
2168
|
-
var managedMemberPageSchema =
|
|
2169
|
-
items:
|
|
2170
|
-
total:
|
|
2171
|
-
nextCursor:
|
|
2253
|
+
var managedMemberPageSchema = z16.object({
|
|
2254
|
+
items: z16.array(memberSchema),
|
|
2255
|
+
total: z16.number().int().nonnegative(),
|
|
2256
|
+
nextCursor: z16.string().nullable()
|
|
2172
2257
|
});
|
|
2173
2258
|
var projectMetricsSchema = metricsSchema.extend({
|
|
2174
|
-
completionsByQuest:
|
|
2175
|
-
|
|
2259
|
+
completionsByQuest: z16.array(
|
|
2260
|
+
z16.object({ quest: identifier, completions: z16.number() })
|
|
2176
2261
|
)
|
|
2177
2262
|
});
|
|
2178
|
-
var pageLimit =
|
|
2179
|
-
var managedAttemptQuerySchema =
|
|
2180
|
-
q:
|
|
2181
|
-
status:
|
|
2263
|
+
var pageLimit = z16.coerce.number().int().min(1).max(100).optional();
|
|
2264
|
+
var managedAttemptQuerySchema = z16.strictObject({
|
|
2265
|
+
q: z16.string().max(200).optional(),
|
|
2266
|
+
status: z16.string().min(1).max(50).optional(),
|
|
2182
2267
|
limit: pageLimit,
|
|
2183
2268
|
cursor: pageCursorSchema.optional()
|
|
2184
2269
|
});
|
|
2185
|
-
var managedAttemptPageSchema =
|
|
2186
|
-
items:
|
|
2187
|
-
releases:
|
|
2188
|
-
people:
|
|
2189
|
-
total:
|
|
2190
|
-
nextCursor:
|
|
2270
|
+
var managedAttemptPageSchema = z16.object({
|
|
2271
|
+
items: z16.array(attemptSchema),
|
|
2272
|
+
releases: z16.array(publishedReleaseSchema),
|
|
2273
|
+
people: z16.array(personSchema),
|
|
2274
|
+
total: z16.number().int().nonnegative(),
|
|
2275
|
+
nextCursor: z16.string().nullable()
|
|
2191
2276
|
});
|
|
2192
|
-
var managedReleaseQuerySchema =
|
|
2277
|
+
var managedReleaseQuerySchema = z16.strictObject({
|
|
2193
2278
|
quest: identifier.optional(),
|
|
2194
2279
|
limit: pageLimit,
|
|
2195
2280
|
cursor: pageCursorSchema.optional()
|
|
2196
2281
|
});
|
|
2197
|
-
var managedReleasePageSchema =
|
|
2198
|
-
items:
|
|
2199
|
-
nextCursor:
|
|
2282
|
+
var managedReleasePageSchema = z16.object({
|
|
2283
|
+
items: z16.array(publishedReleaseSchema),
|
|
2284
|
+
nextCursor: z16.string().nullable()
|
|
2200
2285
|
});
|
|
2201
|
-
var managedAttemptSchema =
|
|
2286
|
+
var managedAttemptSchema = z16.object({
|
|
2202
2287
|
attempt: attemptSchema,
|
|
2203
2288
|
release: publishedReleaseSchema.nullable(),
|
|
2204
|
-
events:
|
|
2289
|
+
events: z16.array(eventSchema),
|
|
2205
2290
|
person: personSchema
|
|
2206
2291
|
});
|
|
2207
|
-
var managedEntitlementQuerySchema =
|
|
2208
|
-
q:
|
|
2209
|
-
status:
|
|
2292
|
+
var managedEntitlementQuerySchema = z16.strictObject({
|
|
2293
|
+
q: z16.string().max(200).optional(),
|
|
2294
|
+
status: z16.string().min(1).max(50).optional(),
|
|
2210
2295
|
limit: pageLimit,
|
|
2211
2296
|
cursor: pageCursorSchema.optional()
|
|
2212
2297
|
});
|
|
2213
|
-
var managedEntitlementPageSchema =
|
|
2214
|
-
items:
|
|
2215
|
-
people:
|
|
2216
|
-
total:
|
|
2217
|
-
nextCursor:
|
|
2298
|
+
var managedEntitlementPageSchema = z16.object({
|
|
2299
|
+
items: z16.array(entitlementSchema),
|
|
2300
|
+
people: z16.array(personSchema),
|
|
2301
|
+
total: z16.number().int().nonnegative(),
|
|
2302
|
+
nextCursor: z16.string().nullable()
|
|
2218
2303
|
});
|
|
2219
|
-
var managedEntitlementSchema =
|
|
2304
|
+
var managedEntitlementSchema = z16.object({
|
|
2220
2305
|
entitlement: entitlementSchema,
|
|
2221
2306
|
person: personSchema
|
|
2222
2307
|
});
|
|
2223
2308
|
var managedStockItemSchema = inventorySchema.extend({
|
|
2224
|
-
offers:
|
|
2309
|
+
offers: z16.array(identifier)
|
|
2225
2310
|
});
|
|
2226
|
-
var auditQuerySchema =
|
|
2227
|
-
category:
|
|
2228
|
-
q:
|
|
2311
|
+
var auditQuerySchema = z16.strictObject({
|
|
2312
|
+
category: z16.enum(["reviews", "rewards", "configuration"]).optional(),
|
|
2313
|
+
q: z16.string().max(200).optional(),
|
|
2229
2314
|
limit: pageLimit,
|
|
2230
2315
|
cursor: pageCursorSchema.optional()
|
|
2231
2316
|
});
|
|
2232
2317
|
var accessHistoryQuerySchema = auditQuerySchema.omit({
|
|
2233
2318
|
category: true
|
|
2234
2319
|
});
|
|
2235
|
-
var auditPageSchema =
|
|
2236
|
-
items:
|
|
2237
|
-
total:
|
|
2238
|
-
nextCursor:
|
|
2320
|
+
var auditPageSchema = z16.object({
|
|
2321
|
+
items: z16.array(auditRecordSchema),
|
|
2322
|
+
total: z16.number().int().nonnegative(),
|
|
2323
|
+
nextCursor: z16.string().nullable()
|
|
2239
2324
|
});
|
|
2240
|
-
var verifiedPassSchema =
|
|
2325
|
+
var verifiedPassSchema = z16.object({
|
|
2241
2326
|
provider: identifier,
|
|
2242
2327
|
event: identifier,
|
|
2243
|
-
subject:
|
|
2328
|
+
subject: z16.string().min(1).max(2048),
|
|
2244
2329
|
member: identifier,
|
|
2245
2330
|
quest: identifier
|
|
2246
2331
|
}).strict();
|
|
@@ -2264,7 +2349,7 @@ function clientFailure(error) {
|
|
|
2264
2349
|
return new ManagementError({
|
|
2265
2350
|
kind: "client",
|
|
2266
2351
|
code: ManagementErrorCode.InvalidInput,
|
|
2267
|
-
message: error instanceof
|
|
2352
|
+
message: error instanceof z16.ZodError ? `Invalid management request: ${z16.prettifyError(error)}` : error instanceof Error ? error.message : "Invalid management request",
|
|
2268
2353
|
cause: error
|
|
2269
2354
|
});
|
|
2270
2355
|
}
|
|
@@ -2302,7 +2387,7 @@ function managementClient(options) {
|
|
|
2302
2387
|
call
|
|
2303
2388
|
);
|
|
2304
2389
|
}
|
|
2305
|
-
const ok =
|
|
2390
|
+
const ok = z16.object({ ok: z16.literal(true) });
|
|
2306
2391
|
function pointHistory(member, ledger, query = {}, call) {
|
|
2307
2392
|
return get(
|
|
2308
2393
|
`/points/${identifier.parse(member)}/${identifier.parse(ledger)}/history${queryString(typeof query === "number" ? { before: query } : pageQuerySchema.parse(query))}`,
|
|
@@ -2387,7 +2472,7 @@ function managementClient(options) {
|
|
|
2387
2472
|
const input = isInput ? inputOrCall ?? {} : {};
|
|
2388
2473
|
const options2 = isInput ? call : inputOrCall;
|
|
2389
2474
|
return post(
|
|
2390
|
-
`/webhooks/${
|
|
2475
|
+
`/webhooks/${z16.string().uuid().parse(id)}/rotate-secret`,
|
|
2391
2476
|
webhookSecretSchema,
|
|
2392
2477
|
webhookRotateInputSchema.parse(withActionId(input)),
|
|
2393
2478
|
options2
|
|
@@ -2435,8 +2520,8 @@ function managementClient(options) {
|
|
|
2435
2520
|
}
|
|
2436
2521
|
return exchange(
|
|
2437
2522
|
path,
|
|
2438
|
-
|
|
2439
|
-
status:
|
|
2523
|
+
z16.object({
|
|
2524
|
+
status: z16.number(),
|
|
2440
2525
|
operationId: identifier.optional(),
|
|
2441
2526
|
result: schema
|
|
2442
2527
|
}),
|
|
@@ -2491,7 +2576,7 @@ function managementClient(options) {
|
|
|
2491
2576
|
call
|
|
2492
2577
|
),
|
|
2493
2578
|
...resourceArchiveMethods("tracker"),
|
|
2494
|
-
list: (call) => get("/trackers",
|
|
2579
|
+
list: (call) => get("/trackers", z16.array(trackerStatusSchema), call),
|
|
2495
2580
|
get: (reference, call) => get(
|
|
2496
2581
|
`/trackers/${identifier.parse(reference)}`,
|
|
2497
2582
|
trackerStatusSchema,
|
|
@@ -2607,7 +2692,7 @@ function managementClient(options) {
|
|
|
2607
2692
|
engagementPublishSchema.parse(withActionId(input)),
|
|
2608
2693
|
call
|
|
2609
2694
|
),
|
|
2610
|
-
list: (call) => get("/engagement",
|
|
2695
|
+
list: (call) => get("/engagement", z16.array(engagementRuleSchema), call),
|
|
2611
2696
|
page: (input, call) => get(
|
|
2612
2697
|
"/engagement/history" + queryString(engagementPageQuerySchema.parse(input)),
|
|
2613
2698
|
engagementPageSchema,
|
|
@@ -2627,7 +2712,7 @@ function managementClient(options) {
|
|
|
2627
2712
|
)
|
|
2628
2713
|
},
|
|
2629
2714
|
badges: {
|
|
2630
|
-
list: (call) => get("/badges",
|
|
2715
|
+
list: (call) => get("/badges", z16.array(managedBadgeSchema), call),
|
|
2631
2716
|
create: (input, call) => create("/badges", managedBadgeSchema, createBadgeSchema, input, call),
|
|
2632
2717
|
update: (badge, input, call) => {
|
|
2633
2718
|
const body = badgePropertiesSchema.extend(badgeMutationSchema.shape).parse(withActionId(input));
|
|
@@ -2670,7 +2755,7 @@ function managementClient(options) {
|
|
|
2670
2755
|
},
|
|
2671
2756
|
pointLedgers: {
|
|
2672
2757
|
unarchive: (ledger, input, call) => archiveResource("point-ledger", ledger, false, input, call),
|
|
2673
|
-
list: (call) => get("/point-ledgers",
|
|
2758
|
+
list: (call) => get("/point-ledgers", z16.array(managedPointLedgerSchema), call),
|
|
2674
2759
|
/**
|
|
2675
2760
|
* Creates a point ledger, with a stable `key` when code refers to it; requires `publish`. In
|
|
2676
2761
|
* live, only a person in Console can create one.
|
|
@@ -2700,7 +2785,7 @@ function managementClient(options) {
|
|
|
2700
2785
|
},
|
|
2701
2786
|
points: {
|
|
2702
2787
|
/** @deprecated Use `pointLedgers.list()`, which reads the same ledgers. Removed in 2.0.0. */
|
|
2703
|
-
ledgers: (call) => get("/point-ledgers",
|
|
2788
|
+
ledgers: (call) => get("/point-ledgers", z16.array(managedPointLedgerSchema), call),
|
|
2704
2789
|
/** @deprecated Use `pointLedgers.create(input)`. Removed in 2.0.0. */
|
|
2705
2790
|
createLedger: createPointLedger,
|
|
2706
2791
|
/**
|
|
@@ -2738,7 +2823,7 @@ function managementClient(options) {
|
|
|
2738
2823
|
referralHistorySchema,
|
|
2739
2824
|
call
|
|
2740
2825
|
),
|
|
2741
|
-
list: (call) => get("/referrals",
|
|
2826
|
+
list: (call) => get("/referrals", z16.array(publishedReferralSchema), call),
|
|
2742
2827
|
participants: referralParticipants,
|
|
2743
2828
|
/**
|
|
2744
2829
|
* Suspends or restores a member's referral relationship, with a reason; requires `publish`.
|
|
@@ -2801,7 +2886,7 @@ function managementClient(options) {
|
|
|
2801
2886
|
},
|
|
2802
2887
|
leaderboards: {
|
|
2803
2888
|
...resourceArchiveMethods("leaderboard"),
|
|
2804
|
-
list: (call) => get("/leaderboards",
|
|
2889
|
+
list: (call) => get("/leaderboards", z16.array(publishedLeaderboardSchema), call),
|
|
2805
2890
|
standings: (board, input = {}, call) => {
|
|
2806
2891
|
const query = leaderboardQuerySchema.parse(input);
|
|
2807
2892
|
return get(
|
|
@@ -2815,13 +2900,13 @@ function managementClient(options) {
|
|
|
2815
2900
|
},
|
|
2816
2901
|
history: (board, call) => get(
|
|
2817
2902
|
`/leaderboards/${identifier.parse(board)}/history`,
|
|
2818
|
-
|
|
2903
|
+
z16.array(publishedLeaderboardSchema),
|
|
2819
2904
|
call
|
|
2820
2905
|
),
|
|
2821
2906
|
/** Current members of the board's exclusion group (`exclusionGroup`), by member ID. */
|
|
2822
2907
|
exclusions: (board, call) => get(
|
|
2823
2908
|
`/leaderboards/${identifier.parse(board)}/exclusions`,
|
|
2824
|
-
|
|
2909
|
+
z16.array(z16.object({ member: identifier })),
|
|
2825
2910
|
call
|
|
2826
2911
|
),
|
|
2827
2912
|
/**
|
|
@@ -2886,7 +2971,7 @@ function managementClient(options) {
|
|
|
2886
2971
|
),
|
|
2887
2972
|
settlements: (board, call) => get(
|
|
2888
2973
|
`/leaderboards/${identifier.parse(board)}/settlements`,
|
|
2889
|
-
|
|
2974
|
+
z16.array(leaderboardSettlementSummarySchema),
|
|
2890
2975
|
call
|
|
2891
2976
|
),
|
|
2892
2977
|
settlement: (settlement, call) => get(
|
|
@@ -2971,7 +3056,7 @@ function managementClient(options) {
|
|
|
2971
3056
|
*
|
|
2972
3057
|
* @deprecated Use `history`, which pages by `cursor` and `nextCursor`. Removed in 2.0.0.
|
|
2973
3058
|
*/
|
|
2974
|
-
list: (call) => get("/deployments",
|
|
3059
|
+
list: (call) => get("/deployments", z16.array(deploymentRecordSchema), call),
|
|
2975
3060
|
/**
|
|
2976
3061
|
* The project environment's deployments, newest first, one page at a time, with the two
|
|
2977
3062
|
* newest published deployments beside every page. Pass a page's `nextCursor` back as
|
|
@@ -2987,6 +3072,10 @@ function managementClient(options) {
|
|
|
2987
3072
|
deploymentRecordSchema,
|
|
2988
3073
|
call
|
|
2989
3074
|
),
|
|
3075
|
+
/**
|
|
3076
|
+
* Resolves a deployment against test without publishing it. Live refuses it with
|
|
3077
|
+
* `promotion-required`: code reaches live through a promotion from test.
|
|
3078
|
+
*/
|
|
2990
3079
|
preview: (input, call) => {
|
|
2991
3080
|
const { engagement, ...deployment } = projectDeploymentSchema.parse(input);
|
|
2992
3081
|
return post(
|
|
@@ -3002,6 +3091,64 @@ function managementClient(options) {
|
|
|
3002
3091
|
promote: promoteDeployment,
|
|
3003
3092
|
rollback: rollbackDeployment
|
|
3004
3093
|
},
|
|
3094
|
+
/**
|
|
3095
|
+
* Environment promotions: a reviewed request that makes live match test, for every definition
|
|
3096
|
+
* and the hosted app's active staged build. Prepare one with a client for the test environment;
|
|
3097
|
+
* a person approves or rejects it in Console, against live.
|
|
3098
|
+
*/
|
|
3099
|
+
promotions: {
|
|
3100
|
+
/**
|
|
3101
|
+
* Prepares a promotion of test as it is now and answers it `pending`, with what it changes in
|
|
3102
|
+
* live and the environment bindings live lacks. Refuses with `promotion-empty` when live
|
|
3103
|
+
* already matches. The action ID, generated when absent, makes a retry answer with the first
|
|
3104
|
+
* result. Requires `publish` in test.
|
|
3105
|
+
*/
|
|
3106
|
+
prepare: (input = {}, call) => post(
|
|
3107
|
+
"/promotions",
|
|
3108
|
+
promotionRecordSchema,
|
|
3109
|
+
promotionActionSchema.parse(withActionId(input)),
|
|
3110
|
+
call
|
|
3111
|
+
),
|
|
3112
|
+
/** The project's promotions, newest first, one page at a time. Pass `nextCursor` back as `cursor`. */
|
|
3113
|
+
history: (query = {}, call) => get(
|
|
3114
|
+
`/promotions/history${queryString(promotionHistoryQuerySchema.parse(query))}`,
|
|
3115
|
+
promotionHistoryPageSchema,
|
|
3116
|
+
call
|
|
3117
|
+
),
|
|
3118
|
+
get: (promotion, call) => get(
|
|
3119
|
+
`/promotions/${identifier.parse(promotion)}`,
|
|
3120
|
+
promotionRecordSchema,
|
|
3121
|
+
call
|
|
3122
|
+
),
|
|
3123
|
+
/**
|
|
3124
|
+
* Applies a pending promotion to live in one transaction. Live only, from a Console session
|
|
3125
|
+
* with `publish`; refuses with `promotion-changed` when test or live changed since it was
|
|
3126
|
+
* prepared.
|
|
3127
|
+
*/
|
|
3128
|
+
approve: (promotion, call) => post(
|
|
3129
|
+
`/promotions/${identifier.parse(promotion)}/approve`,
|
|
3130
|
+
promotionRecordSchema,
|
|
3131
|
+
{},
|
|
3132
|
+
call
|
|
3133
|
+
),
|
|
3134
|
+
/** Declines a pending promotion. Live only, from a Console session with `publish`. */
|
|
3135
|
+
reject: (promotion, input, call) => post(
|
|
3136
|
+
`/promotions/${identifier.parse(promotion)}/reject`,
|
|
3137
|
+
promotionRecordSchema,
|
|
3138
|
+
promotionRejectionSchema.parse(input),
|
|
3139
|
+
call
|
|
3140
|
+
),
|
|
3141
|
+
/**
|
|
3142
|
+
* Prepares a promotion of the definitions and build an applied promotion made live, for a
|
|
3143
|
+
* person to approve like any other. Requires `publish` in live.
|
|
3144
|
+
*/
|
|
3145
|
+
rollback: (promotion, input = {}, call) => post(
|
|
3146
|
+
`/promotions/${identifier.parse(promotion)}/rollback`,
|
|
3147
|
+
promotionRecordSchema,
|
|
3148
|
+
promotionActionSchema.parse(withActionId(input)),
|
|
3149
|
+
call
|
|
3150
|
+
)
|
|
3151
|
+
},
|
|
3005
3152
|
catalog: {
|
|
3006
3153
|
allocateQuest: (input = {}, call) => create(
|
|
3007
3154
|
"/catalog/quests",
|
|
@@ -3250,7 +3397,7 @@ function managementClient(options) {
|
|
|
3250
3397
|
},
|
|
3251
3398
|
operations: {
|
|
3252
3399
|
/** Every paused or resumed operation: redemptions and each quest's participation; requires `read`. */
|
|
3253
|
-
list: (call) => get("/operations",
|
|
3400
|
+
list: (call) => get("/operations", z16.array(operationSchema), call),
|
|
3254
3401
|
/**
|
|
3255
3402
|
* Pauses or resumes redemptions or one quest's participation, against the `revision` the
|
|
3256
3403
|
* operator saw, with a reason; requires `publish` permission.
|
|
@@ -3308,7 +3455,7 @@ function managementClient(options) {
|
|
|
3308
3455
|
call
|
|
3309
3456
|
),
|
|
3310
3457
|
/** Every stock item with its counts and the offers that sell it; requires `read` permission. */
|
|
3311
|
-
list: (call) => get("/stock-items",
|
|
3458
|
+
list: (call) => get("/stock-items", z16.array(managedStockItemSchema), call),
|
|
3312
3459
|
createItem: (input, call) => create(
|
|
3313
3460
|
"/stock-items",
|
|
3314
3461
|
stockItemSchema,
|
|
@@ -3323,7 +3470,7 @@ function managementClient(options) {
|
|
|
3323
3470
|
stockInputSchema.parse(withActionId(input)),
|
|
3324
3471
|
call
|
|
3325
3472
|
),
|
|
3326
|
-
catalog: (call) => get("/pickup-inventory",
|
|
3473
|
+
catalog: (call) => get("/pickup-inventory", z16.array(pickupCatalogSchema), call),
|
|
3327
3474
|
configure: (input, call) => post(
|
|
3328
3475
|
"/pickup-inventory",
|
|
3329
3476
|
pickupCatalogSchema,
|
|
@@ -3349,7 +3496,7 @@ function managementClient(options) {
|
|
|
3349
3496
|
offerControlSchema.omit({ enabled: true }).parse(withActionId(input)),
|
|
3350
3497
|
call
|
|
3351
3498
|
),
|
|
3352
|
-
list: (call) => get("/offers",
|
|
3499
|
+
list: (call) => get("/offers", z16.array(offerSchema), call),
|
|
3353
3500
|
/**
|
|
3354
3501
|
* Every redemption, or one member's, newest first, in one unbounded response.
|
|
3355
3502
|
*
|
|
@@ -3357,7 +3504,7 @@ function managementClient(options) {
|
|
|
3357
3504
|
*/
|
|
3358
3505
|
redemptions: (input = {}, call) => get(
|
|
3359
3506
|
`/redemptions${queryString({ member: input.member })}`,
|
|
3360
|
-
|
|
3507
|
+
z16.array(redemptionSchema),
|
|
3361
3508
|
call
|
|
3362
3509
|
),
|
|
3363
3510
|
/** Pauses or resumes an offer at the revision the operator saw. */
|
|
@@ -3406,7 +3553,7 @@ function managementClient(options) {
|
|
|
3406
3553
|
* them; API keys and project-scoped playground sessions cannot.
|
|
3407
3554
|
*/
|
|
3408
3555
|
tokens: {
|
|
3409
|
-
list: (call) => get("/tokens",
|
|
3556
|
+
list: (call) => get("/tokens", z16.array(tokenSchema), call),
|
|
3410
3557
|
/**
|
|
3411
3558
|
* Issues a key for one project and environment, limited to permissions the caller holds
|
|
3412
3559
|
* there. The secret `token` is in this response only.
|
|
@@ -3414,14 +3561,14 @@ function managementClient(options) {
|
|
|
3414
3561
|
create: (input, call) => post("/tokens", issuedTokenSchema, tokenInputSchema.parse(input), call),
|
|
3415
3562
|
/** Replace a personal key's ingestion restriction without changing its secret. */
|
|
3416
3563
|
scope: (id, input, call) => request(
|
|
3417
|
-
`/tokens/${encodeURIComponent(
|
|
3564
|
+
`/tokens/${encodeURIComponent(z16.string().min(1).parse(id))}/scope`,
|
|
3418
3565
|
tokenSchema,
|
|
3419
3566
|
tokenScopeInputSchema.parse(input),
|
|
3420
3567
|
"PUT",
|
|
3421
3568
|
call
|
|
3422
3569
|
),
|
|
3423
3570
|
revoke: (id, call) => request(
|
|
3424
|
-
`/tokens/${encodeURIComponent(
|
|
3571
|
+
`/tokens/${encodeURIComponent(z16.string().min(1).parse(id))}`,
|
|
3425
3572
|
ok,
|
|
3426
3573
|
void 0,
|
|
3427
3574
|
"DELETE",
|
|
@@ -3433,7 +3580,7 @@ function managementClient(options) {
|
|
|
3433
3580
|
* environment, owned by no person. Only an organization administrator in Console manages them.
|
|
3434
3581
|
*/
|
|
3435
3582
|
serviceKeys: {
|
|
3436
|
-
list: (call) => get("/service-keys",
|
|
3583
|
+
list: (call) => get("/service-keys", z16.array(serviceKeySchema), call),
|
|
3437
3584
|
/** The secret `token` is in this response only. */
|
|
3438
3585
|
create: (input, call) => post(
|
|
3439
3586
|
"/service-keys",
|
|
@@ -3446,14 +3593,14 @@ function managementClient(options) {
|
|
|
3446
3593
|
* them with `revokeSecret`. The new `token` is in this response only.
|
|
3447
3594
|
*/
|
|
3448
3595
|
addSecret: (id, input = {}, call) => post(
|
|
3449
|
-
`/service-keys/${
|
|
3596
|
+
`/service-keys/${z16.string().uuid().parse(id)}/secrets`,
|
|
3450
3597
|
issuedServiceKeySchema,
|
|
3451
3598
|
credentialSecretInputSchema.parse(input),
|
|
3452
3599
|
call
|
|
3453
3600
|
),
|
|
3454
3601
|
/** Stops one secret working. A key's last secret cannot be revoked; revoke the key instead. */
|
|
3455
3602
|
revokeSecret: (id, secret, call) => request(
|
|
3456
|
-
`/service-keys/${
|
|
3603
|
+
`/service-keys/${z16.string().uuid().parse(id)}/secrets/${z16.string().uuid().parse(secret)}`,
|
|
3457
3604
|
serviceKeySchema,
|
|
3458
3605
|
void 0,
|
|
3459
3606
|
"DELETE",
|
|
@@ -3461,8 +3608,8 @@ function managementClient(options) {
|
|
|
3461
3608
|
),
|
|
3462
3609
|
/** Deletes the key; every secret stops working. */
|
|
3463
3610
|
revoke: (id, call) => request(
|
|
3464
|
-
`/service-keys/${
|
|
3465
|
-
|
|
3611
|
+
`/service-keys/${z16.string().uuid().parse(id)}`,
|
|
3612
|
+
z16.null(),
|
|
3466
3613
|
void 0,
|
|
3467
3614
|
"DELETE",
|
|
3468
3615
|
call
|
|
@@ -3470,7 +3617,7 @@ function managementClient(options) {
|
|
|
3470
3617
|
},
|
|
3471
3618
|
/** Who holds which roles on the client's project; organization administrators only. */
|
|
3472
3619
|
grants: {
|
|
3473
|
-
list: (call) => get("/grants",
|
|
3620
|
+
list: (call) => get("/grants", z16.array(grantRecordSchema), call),
|
|
3474
3621
|
/** Replaces one person's roles and environments on the project. The audit log records it. */
|
|
3475
3622
|
set: (input, call) => request(
|
|
3476
3623
|
"/grants",
|
|
@@ -3487,7 +3634,7 @@ function managementClient(options) {
|
|
|
3487
3634
|
/** Signed activity notifications for one project/environment; writes require publish permission. */
|
|
3488
3635
|
webhooks: {
|
|
3489
3636
|
state: (id, call) => get(
|
|
3490
|
-
`/webhooks/${
|
|
3637
|
+
`/webhooks/${z16.string().uuid().parse(id)}/state`,
|
|
3491
3638
|
webhookEndpointStateSchema,
|
|
3492
3639
|
call
|
|
3493
3640
|
),
|
|
@@ -3498,24 +3645,24 @@ function managementClient(options) {
|
|
|
3498
3645
|
call
|
|
3499
3646
|
),
|
|
3500
3647
|
delete: (id, input, call) => post(
|
|
3501
|
-
`/webhooks/${
|
|
3648
|
+
`/webhooks/${z16.string().uuid().parse(id)}/delete`,
|
|
3502
3649
|
webhookEndpointStateSchema,
|
|
3503
3650
|
webhookDeleteInputSchema.parse(withActionId(input)),
|
|
3504
3651
|
call
|
|
3505
3652
|
),
|
|
3506
3653
|
pause: (id, input = {}, call) => post(
|
|
3507
|
-
`/webhooks/${
|
|
3654
|
+
`/webhooks/${z16.string().uuid().parse(id)}/pause`,
|
|
3508
3655
|
webhookEndpointSchema,
|
|
3509
3656
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
3510
3657
|
call
|
|
3511
3658
|
),
|
|
3512
3659
|
resume: (id, input = {}, call) => post(
|
|
3513
|
-
`/webhooks/${
|
|
3660
|
+
`/webhooks/${z16.string().uuid().parse(id)}/resume`,
|
|
3514
3661
|
webhookEndpointSchema,
|
|
3515
3662
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
3516
3663
|
call
|
|
3517
3664
|
),
|
|
3518
|
-
list: (call) => get("/webhooks",
|
|
3665
|
+
list: (call) => get("/webhooks", z16.array(webhookEndpointSchema), call),
|
|
3519
3666
|
/** Pass an `actionId` to recover the endpoint and its secret after a lost answer. */
|
|
3520
3667
|
create: (input, call) => post(
|
|
3521
3668
|
"/webhooks",
|
|
@@ -3524,7 +3671,7 @@ function managementClient(options) {
|
|
|
3524
3671
|
call
|
|
3525
3672
|
),
|
|
3526
3673
|
update: (id, input, call) => request(
|
|
3527
|
-
`/webhooks/${
|
|
3674
|
+
`/webhooks/${z16.string().uuid().parse(id)}`,
|
|
3528
3675
|
webhookEndpointSchema,
|
|
3529
3676
|
webhookUpdateSchema.parse(input),
|
|
3530
3677
|
"PUT",
|
|
@@ -3532,19 +3679,19 @@ function managementClient(options) {
|
|
|
3532
3679
|
),
|
|
3533
3680
|
/** @deprecated Use pause. Removed in 2.0.0. */
|
|
3534
3681
|
disable: (id, call) => post(
|
|
3535
|
-
`/webhooks/${
|
|
3682
|
+
`/webhooks/${z16.string().uuid().parse(id)}/disable`,
|
|
3536
3683
|
webhookEndpointSchema,
|
|
3537
3684
|
{},
|
|
3538
3685
|
call
|
|
3539
3686
|
),
|
|
3540
3687
|
rotateSecret: rotateWebhookSecret,
|
|
3541
3688
|
deliveries: (id, query = {}, call) => get(
|
|
3542
|
-
`/webhooks/${
|
|
3689
|
+
`/webhooks/${z16.string().uuid().parse(id)}/deliveries${queryString(webhookQuerySchema.parse(query))}`,
|
|
3543
3690
|
webhookDeliveryPageSchema,
|
|
3544
3691
|
call
|
|
3545
3692
|
),
|
|
3546
3693
|
replay: (id, delivery, call) => post(
|
|
3547
|
-
`/webhooks/${
|
|
3694
|
+
`/webhooks/${z16.string().uuid().parse(id)}/deliveries/${z16.string().uuid().parse(delivery)}/replay`,
|
|
3548
3695
|
webhookDeliverySchema,
|
|
3549
3696
|
{},
|
|
3550
3697
|
call
|
|
@@ -3555,7 +3702,7 @@ function managementClient(options) {
|
|
|
3555
3702
|
* environment. Organization administrators, from a Console session only.
|
|
3556
3703
|
*/
|
|
3557
3704
|
identityIntegrations: {
|
|
3558
|
-
list: (call) => get("/identity-integrations",
|
|
3705
|
+
list: (call) => get("/identity-integrations", z16.array(identityIntegrationSchema), call),
|
|
3559
3706
|
/** The secret `token` is in this response only. */
|
|
3560
3707
|
create: (input, call) => post(
|
|
3561
3708
|
"/identity-integrations",
|
|
@@ -3570,7 +3717,7 @@ function managementClient(options) {
|
|
|
3570
3717
|
* @deprecated Use `addSecret`, then `revokeSecret` the old secret once your app uses the new one.
|
|
3571
3718
|
*/
|
|
3572
3719
|
rotate: (id, call) => post(
|
|
3573
|
-
`/identity-integrations/${
|
|
3720
|
+
`/identity-integrations/${z16.string().uuid().parse(id)}/rotate`,
|
|
3574
3721
|
identityIntegrationSecretSchema,
|
|
3575
3722
|
{},
|
|
3576
3723
|
call
|
|
@@ -3580,7 +3727,7 @@ function managementClient(options) {
|
|
|
3580
3727
|
* revoke them with `revokeSecret`. The new `token` is in this response only.
|
|
3581
3728
|
*/
|
|
3582
3729
|
addSecret: (id, input = {}, call) => post(
|
|
3583
|
-
`/identity-integrations/${
|
|
3730
|
+
`/identity-integrations/${z16.string().uuid().parse(id)}/secrets`,
|
|
3584
3731
|
identityIntegrationSecretSchema,
|
|
3585
3732
|
credentialSecretInputSchema.parse(input),
|
|
3586
3733
|
call
|
|
@@ -3590,7 +3737,7 @@ function managementClient(options) {
|
|
|
3590
3737
|
* revoked; disconnect the integration with `revoke` instead.
|
|
3591
3738
|
*/
|
|
3592
3739
|
revokeSecret: (id, secret, call) => request(
|
|
3593
|
-
`/identity-integrations/${
|
|
3740
|
+
`/identity-integrations/${z16.string().uuid().parse(id)}/secrets/${z16.string().uuid().parse(secret)}`,
|
|
3594
3741
|
identityIntegrationSchema,
|
|
3595
3742
|
void 0,
|
|
3596
3743
|
"DELETE",
|
|
@@ -3598,7 +3745,7 @@ function managementClient(options) {
|
|
|
3598
3745
|
),
|
|
3599
3746
|
/** Makes one secret never expire. */
|
|
3600
3747
|
removeSecretExpiry: (id, secret, call) => request(
|
|
3601
|
-
`/identity-integrations/${
|
|
3748
|
+
`/identity-integrations/${z16.string().uuid().parse(id)}/secrets/${z16.string().uuid().parse(secret)}/expiry`,
|
|
3602
3749
|
identityIntegrationSchema,
|
|
3603
3750
|
void 0,
|
|
3604
3751
|
"DELETE",
|
|
@@ -3611,7 +3758,7 @@ function managementClient(options) {
|
|
|
3611
3758
|
*/
|
|
3612
3759
|
kinds: (call) => get(
|
|
3613
3760
|
"/identity-integrations/kinds",
|
|
3614
|
-
|
|
3761
|
+
z16.array(identityKindClaimSchema),
|
|
3615
3762
|
call
|
|
3616
3763
|
),
|
|
3617
3764
|
/**
|
|
@@ -3619,8 +3766,8 @@ function managementClient(options) {
|
|
|
3619
3766
|
* and keep attributing tracker records; unlink them on the member to stop that.
|
|
3620
3767
|
*/
|
|
3621
3768
|
revoke: (id, call) => request(
|
|
3622
|
-
`/identity-integrations/${
|
|
3623
|
-
|
|
3769
|
+
`/identity-integrations/${z16.string().uuid().parse(id)}`,
|
|
3770
|
+
z16.null(),
|
|
3624
3771
|
void 0,
|
|
3625
3772
|
"DELETE",
|
|
3626
3773
|
call
|
|
@@ -3671,7 +3818,7 @@ function managementClient(options) {
|
|
|
3671
3818
|
resources: {
|
|
3672
3819
|
list: (call) => get(
|
|
3673
3820
|
"/resources",
|
|
3674
|
-
|
|
3821
|
+
z16.object({ resources: z16.array(managedResourceSchema) }),
|
|
3675
3822
|
call
|
|
3676
3823
|
),
|
|
3677
3824
|
/** @deprecated Use the resource archive/unarchive methods. Removed in 2.0.0. */
|
|
@@ -3741,7 +3888,7 @@ function managementClient(options) {
|
|
|
3741
3888
|
testMemberCreateSchema.parse(withActionId(input)),
|
|
3742
3889
|
call
|
|
3743
3890
|
),
|
|
3744
|
-
list: (call) => get("/test-members",
|
|
3891
|
+
list: (call) => get("/test-members", z16.array(testMemberSchema), call),
|
|
3745
3892
|
history: (member, query = {}, call) => get(
|
|
3746
3893
|
`/test-members/${identifier.parse(member)}/history${queryString(testMemberHistoryQuerySchema.parse(query))}`,
|
|
3747
3894
|
testMemberHistorySchema,
|
|
@@ -3959,7 +4106,7 @@ function managementClient(options) {
|
|
|
3959
4106
|
/** Who each member is: up to 100 distinct IDs; unknown IDs come back without accounts. */
|
|
3960
4107
|
people: (members, call) => get(
|
|
3961
4108
|
`/people${queryString({ ids: members.join(",") })}`,
|
|
3962
|
-
|
|
4109
|
+
z16.array(personSchema),
|
|
3963
4110
|
call
|
|
3964
4111
|
),
|
|
3965
4112
|
/**
|
|
@@ -3969,7 +4116,7 @@ function managementClient(options) {
|
|
|
3969
4116
|
*/
|
|
3970
4117
|
oauthAccounts: (member, call) => get(
|
|
3971
4118
|
`/members/${encodeURIComponent(member)}/oauth-accounts`,
|
|
3972
|
-
|
|
4119
|
+
z16.array(managedOAuthAccountSchema),
|
|
3973
4120
|
call
|
|
3974
4121
|
),
|
|
3975
4122
|
/**
|
|
@@ -3979,7 +4126,7 @@ function managementClient(options) {
|
|
|
3979
4126
|
*/
|
|
3980
4127
|
unlinkOAuthAccount: (member, input, call) => post(
|
|
3981
4128
|
`/members/${encodeURIComponent(member)}/oauth-accounts/unlink`,
|
|
3982
|
-
|
|
4129
|
+
z16.array(managedOAuthAccountSchema),
|
|
3983
4130
|
memberOAuthUnlinkInputSchema.parse(input),
|
|
3984
4131
|
call
|
|
3985
4132
|
),
|
|
@@ -4012,7 +4159,7 @@ function managementClient(options) {
|
|
|
4012
4159
|
*/
|
|
4013
4160
|
unlinkWallet: (member, input, call) => post(
|
|
4014
4161
|
`/members/${encodeURIComponent(member)}/wallets/unlink`,
|
|
4015
|
-
|
|
4162
|
+
z16.array(managedWalletSchema),
|
|
4016
4163
|
memberWalletUnlinkInputSchema.parse(input),
|
|
4017
4164
|
call
|
|
4018
4165
|
),
|
|
@@ -4025,7 +4172,7 @@ function managementClient(options) {
|
|
|
4025
4172
|
*/
|
|
4026
4173
|
unlinkIdentity: (member, input, call) => post(
|
|
4027
4174
|
`/members/${encodeURIComponent(member)}/identities/unlink`,
|
|
4028
|
-
|
|
4175
|
+
z16.array(managedMemberIdentitySchema),
|
|
4029
4176
|
memberIdentityChangeInputSchema.parse(input),
|
|
4030
4177
|
call
|
|
4031
4178
|
),
|
|
@@ -4036,7 +4183,7 @@ function managementClient(options) {
|
|
|
4036
4183
|
*/
|
|
4037
4184
|
relinkIdentity: (member, input, call) => post(
|
|
4038
4185
|
`/members/${encodeURIComponent(member)}/identities/relink`,
|
|
4039
|
-
|
|
4186
|
+
z16.array(managedMemberIdentitySchema),
|
|
4040
4187
|
memberIdentityChangeInputSchema.parse(input),
|
|
4041
4188
|
call
|
|
4042
4189
|
),
|
|
@@ -4048,7 +4195,7 @@ function managementClient(options) {
|
|
|
4048
4195
|
*/
|
|
4049
4196
|
setWalletSignIn: (member, input, call) => post(
|
|
4050
4197
|
`/members/${encodeURIComponent(member)}/wallets/sign-in`,
|
|
4051
|
-
|
|
4198
|
+
z16.array(managedWalletSchema),
|
|
4052
4199
|
memberWalletSignInInputSchema.parse(input),
|
|
4053
4200
|
call
|
|
4054
4201
|
)
|
|
@@ -4131,7 +4278,7 @@ function managementClient(options) {
|
|
|
4131
4278
|
`/storage/sql/${appSecretNameSchema.parse(name)}/cell?${new URLSearchParams(
|
|
4132
4279
|
{
|
|
4133
4280
|
table,
|
|
4134
|
-
row: String(
|
|
4281
|
+
row: String(z16.number().int().min(0).parse(options2.row)),
|
|
4135
4282
|
column: options2.column,
|
|
4136
4283
|
...options2.cursor === void 0 ? {} : { cursor: pageCursorSchema.parse(options2.cursor) }
|
|
4137
4284
|
}
|
|
@@ -4243,7 +4390,7 @@ function managementClient(options) {
|
|
|
4243
4390
|
* Each quest's current release, the most recently published first, archived quests
|
|
4244
4391
|
* included; requires `read` permission.
|
|
4245
4392
|
*/
|
|
4246
|
-
list: (call) => get("/quests/list",
|
|
4393
|
+
list: (call) => get("/quests/list", z16.array(publishedReleaseSchema), call),
|
|
4247
4394
|
/** Pending and exhausted asynchronous balance checks. Requires read. */
|
|
4248
4395
|
automaticScheduling: (query = {}, call) => get(
|
|
4249
4396
|
`/quests/automatic-scheduling${queryString(automaticSchedulingQuerySchema.parse(query))}`,
|
|
@@ -4288,7 +4435,7 @@ function managementClient(options) {
|
|
|
4288
4435
|
*/
|
|
4289
4436
|
submissions: (member, call) => get(
|
|
4290
4437
|
`/members/${encodeURIComponent(member)}/quest-submissions`,
|
|
4291
|
-
|
|
4438
|
+
z16.object({ items: z16.array(questSubmissionSchema) }),
|
|
4292
4439
|
call
|
|
4293
4440
|
),
|
|
4294
4441
|
/**
|
|
@@ -5219,6 +5366,16 @@ export {
|
|
|
5219
5366
|
projectTransferInputSchema,
|
|
5220
5367
|
projectTransferSchema,
|
|
5221
5368
|
projectUpdateInputSchema,
|
|
5369
|
+
promotionActionSchema,
|
|
5370
|
+
promotionBuildSchema,
|
|
5371
|
+
promotionChangeSchema,
|
|
5372
|
+
promotionHistoryPageSchema,
|
|
5373
|
+
promotionHistoryQuerySchema,
|
|
5374
|
+
promotionRecordSchema,
|
|
5375
|
+
promotionRejectionSchema,
|
|
5376
|
+
promotionResourceKindSchema,
|
|
5377
|
+
promotionSourceSchema,
|
|
5378
|
+
promotionWarningSchema,
|
|
5222
5379
|
querySchema,
|
|
5223
5380
|
questConfiguration,
|
|
5224
5381
|
questEnrollmentStateSchema,
|