@domino-sdk/relay 1.39.1 → 1.43.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-p7JPb7Xi.d.ts} +1 -1
- package/dist/authoring.d.ts +11 -11
- package/dist/authoring.js +4 -4
- package/dist/{automatic-outcomes-DDbgRubQ.d.ts → automatic-outcomes-YkGhnxsc.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-JIHWQCVW.js → chunk-4XC24SUM.js} +2 -2
- package/dist/{chunk-BYX27T2S.js → chunk-HO4FZJSH.js} +2 -2
- package/dist/{chunk-VYAANO5L.js → chunk-IIKQH5L6.js} +8 -8
- package/dist/{chunk-V7KYVH3Z.js → chunk-ILH73K3H.js} +1 -1
- package/dist/{chunk-B65YJ6K4.js → chunk-J7YJHMF7.js} +1 -1
- package/dist/{chunk-X7LHRYAO.js → chunk-JISXC5ZB.js} +4 -4
- package/dist/{chunk-SBW52XXL.js → chunk-NNGGEUMQ.js} +1 -1
- package/dist/{chunk-OEO5OBY5.js → chunk-PMSCHJKX.js} +584 -533
- package/dist/{chunk-FTGW72A6.js → chunk-Q5PX3GDA.js} +1 -1
- package/dist/{chunk-XZKZJIES.js → chunk-TEPZZXDI.js} +6 -2
- package/dist/{chunk-CRX274HO.js → chunk-UOHYYB7V.js} +1 -1
- package/dist/{chunk-ZT7FPD7B.js → chunk-W5UBRNDT.js} +1 -1
- package/dist/{chunk-RW4XQN4Z.js → chunk-WSOUOG6S.js} +1 -1
- package/dist/{chunk-E4CDOF4H.js → chunk-YBMCF54E.js} +13 -7
- package/dist/{chunk-4PYFM2YF.js → chunk-YNKJMRA7.js} +1 -1
- package/dist/{chunk-YNQPFRQO.js → chunk-ZY4RI4DJ.js} +1 -1
- package/dist/{client-CxHKODc4.d.ts → client-CVG_MoXx.d.ts} +7 -7
- package/dist/{deployments-DYeuxXYg.d.ts → deployments-BWav9s6t.d.ts} +137 -1
- package/dist/{groups-DY5rZssO.d.ts → groups-CMZROR9a.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-Cvk4uBjo.d.ts} +2 -2
- package/dist/{pages-DR2YRvAp.d.ts → pages-BXZP4o-w.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-BgjSnV9D.d.ts} +19 -1
- package/dist/schema.d.ts +58 -16
- package/dist/schema.js +19 -7
- package/dist/server/index.d.ts +10 -10
- package/dist/server/index.js +846 -613
- package/dist/{submission-input-BkIbBPRU.d.ts → submission-input-CD59rLYk.d.ts} +2 -2
- package/dist/{telegram-browser-laDdm730.d.ts → telegram-browser-bnRKW9KG.d.ts} +3 -3
- package/dist/testing.d.ts +4 -4
- package/dist/testing.js +5 -5
- package/dist/{transport-CkTEfXL9.d.ts → transport-xSupcGFD.d.ts} +2189 -11
- package/dist/{wallet-t7uNDg9p.d.ts → wallet-Ac7OFpOr.d.ts} +1 -1
- package/dist/{x-vVG6gZqi.d.ts → x-B_7RCkOo.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-W5UBRNDT.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-YBMCF54E.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-JISXC5ZB.js";
|
|
52
52
|
import {
|
|
53
53
|
parseImageExtraction,
|
|
54
54
|
parseImageResult
|
|
55
|
-
} from "../chunk-
|
|
55
|
+
} from "../chunk-HO4FZJSH.js";
|
|
56
56
|
import {
|
|
57
57
|
imageAssetArtifactSchema,
|
|
58
58
|
xUserLookupInputSchema,
|
|
59
59
|
xUserSchema
|
|
60
|
-
} from "../chunk-
|
|
60
|
+
} from "../chunk-ILH73K3H.js";
|
|
61
61
|
import {
|
|
62
62
|
sourceDataSchema,
|
|
63
63
|
sourceRoles,
|
|
64
64
|
validateQuestShape
|
|
65
|
-
} from "../chunk-
|
|
65
|
+
} from "../chunk-ZY4RI4DJ.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-UOHYYB7V.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-TEPZZXDI.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-WSOUOG6S.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-J7YJHMF7.js";
|
|
153
|
+
import "../chunk-NNGGEUMQ.js";
|
|
154
|
+
import "../chunk-YNKJMRA7.js";
|
|
155
|
+
import "../chunk-Q5PX3GDA.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-PMSCHJKX.js";
|
|
245
245
|
|
|
246
246
|
// src/server/identity-links.ts
|
|
247
247
|
import * as z from "zod";
|
|
@@ -496,6 +496,61 @@ var testMemberWalletUnlinkSchema = z6.object({
|
|
|
496
496
|
chain: walletChainSchema,
|
|
497
497
|
address: z6.string().min(1).max(100)
|
|
498
498
|
}).strict();
|
|
499
|
+
var snowflake = z6.string().regex(/^[0-9]{1,20}$/);
|
|
500
|
+
var metric = z6.number().int().nonnegative().safe();
|
|
501
|
+
var testMemberXPostSchema = z6.strictObject({
|
|
502
|
+
content: z6.string().max(4e3).default(""),
|
|
503
|
+
author: z6.strictObject({
|
|
504
|
+
/** Defaults to `test_` and the end of the synthetic account ID. */
|
|
505
|
+
username: z6.string().min(1).max(50).optional(),
|
|
506
|
+
/** Defaults to the test member's name. */
|
|
507
|
+
name: z6.string().min(1).max(100).optional()
|
|
508
|
+
}).default({}),
|
|
509
|
+
isReply: z6.boolean().default(false),
|
|
510
|
+
isRetweet: z6.boolean().default(false),
|
|
511
|
+
isQuoteTweet: z6.boolean().default(false),
|
|
512
|
+
likeCount: metric.default(0),
|
|
513
|
+
replyCount: metric.default(0),
|
|
514
|
+
retweetCount: metric.default(0),
|
|
515
|
+
quoteCount: metric.default(0),
|
|
516
|
+
viewCount: metric.default(0),
|
|
517
|
+
bookmarkCount: metric.default(0)
|
|
518
|
+
});
|
|
519
|
+
var testMemberDiscordMessageSchema = z6.strictObject({
|
|
520
|
+
channelId: snowflake.optional(),
|
|
521
|
+
replyTo: snowflake.nullable().default(null),
|
|
522
|
+
text: z6.string().max(4e3).optional()
|
|
523
|
+
});
|
|
524
|
+
var testMemberDiscordReactionSchema = z6.strictObject({
|
|
525
|
+
channelId: snowflake.optional(),
|
|
526
|
+
messageId: snowflake.optional(),
|
|
527
|
+
emoji: z6.strictObject({
|
|
528
|
+
/** A custom emoji's ID, or null for a Unicode emoji. */
|
|
529
|
+
id: snowflake.nullable().default(null),
|
|
530
|
+
name: z6.string().min(1).max(100)
|
|
531
|
+
}).default({ id: null, name: "\u{1F44D}" }),
|
|
532
|
+
reactorRoles: z6.array(snowflake).max(50).default([]),
|
|
533
|
+
messagePublishedAt: z6.number().int().nonnegative().safe().optional()
|
|
534
|
+
});
|
|
535
|
+
var testMemberRecordSchema = z6.object({
|
|
536
|
+
actionId: identifier,
|
|
537
|
+
/** A managed X or Discord tracker, by key or ID. */
|
|
538
|
+
tracker: identifier,
|
|
539
|
+
/**
|
|
540
|
+
* The record account the test member holds. `messageAuthor` (Discord reactions only) makes the
|
|
541
|
+
* member the reacted-to message's author, and the reactor a synthetic account no member holds.
|
|
542
|
+
*/
|
|
543
|
+
as: z6.enum(["author", "messageAuthor"]).default("author"),
|
|
544
|
+
data: z6.record(z6.string(), z6.json()).default({})
|
|
545
|
+
}).strict();
|
|
546
|
+
var testMemberRecordResultSchema = trackerIngestResultSchema.extend({
|
|
547
|
+
/** The tracker's stable ID. */
|
|
548
|
+
tracker: identifier,
|
|
549
|
+
/** The stored record's ID. */
|
|
550
|
+
record: z6.string(),
|
|
551
|
+
/** The synthetic account the record names for the test member. */
|
|
552
|
+
account: z6.object({ kind: z6.enum(["x", "discord"]), id: z6.string() })
|
|
553
|
+
});
|
|
499
554
|
var testMemberHistoryQuerySchema = z6.object({
|
|
500
555
|
/** Inclusive lower bound on credited activity time, in epoch milliseconds. */
|
|
501
556
|
since: z6.coerce.number().int().nonnegative().safe().optional()
|
|
@@ -869,20 +924,105 @@ var resourceArchiveInputSchema = resourceLifecycleInputSchema.omit({
|
|
|
869
924
|
archived: true
|
|
870
925
|
});
|
|
871
926
|
|
|
927
|
+
// src/server/promotions.ts
|
|
928
|
+
import * as z10 from "zod";
|
|
929
|
+
var promotionResourceKindSchema = z10.enum([
|
|
930
|
+
"quest",
|
|
931
|
+
"quest-type",
|
|
932
|
+
"collection",
|
|
933
|
+
"quest-interactions",
|
|
934
|
+
"point-ledger",
|
|
935
|
+
"badge",
|
|
936
|
+
"offer",
|
|
937
|
+
"referral",
|
|
938
|
+
"leaderboard",
|
|
939
|
+
"tracker",
|
|
940
|
+
"engagement",
|
|
941
|
+
"image",
|
|
942
|
+
"stock-item",
|
|
943
|
+
"pickup",
|
|
944
|
+
"calendar",
|
|
945
|
+
"profile-settings",
|
|
946
|
+
"app-build"
|
|
947
|
+
]);
|
|
948
|
+
var promotionChangeSchema = z10.object({
|
|
949
|
+
kind: z10.union([promotionResourceKindSchema, z10.string()]),
|
|
950
|
+
key: z10.string(),
|
|
951
|
+
title: z10.string(),
|
|
952
|
+
/** `added`: new in live. `changed`: live's differs. `archived` and `unarchived` change only its lifecycle. */
|
|
953
|
+
change: z10.union([
|
|
954
|
+
z10.enum(["added", "changed", "archived", "unarchived"]),
|
|
955
|
+
z10.string()
|
|
956
|
+
])
|
|
957
|
+
});
|
|
958
|
+
var promotionWarningSchema = z10.object({
|
|
959
|
+
code: z10.string(),
|
|
960
|
+
message: z10.string(),
|
|
961
|
+
kind: z10.string().optional(),
|
|
962
|
+
key: z10.string().optional()
|
|
963
|
+
});
|
|
964
|
+
var promotionBuildSchema = z10.object({
|
|
965
|
+
repository: identifier,
|
|
966
|
+
build: identifier
|
|
967
|
+
});
|
|
968
|
+
var promotionSourceSchema = z10.discriminatedUnion("kind", [
|
|
969
|
+
z10.object({ kind: z10.literal("test") }),
|
|
970
|
+
z10.object({ kind: z10.literal("rollback"), promotion: identifier }),
|
|
971
|
+
z10.object({ kind: z10.literal("deployment"), deployment: identifier })
|
|
972
|
+
]);
|
|
973
|
+
var promotionMetadata = {
|
|
974
|
+
id: identifier,
|
|
975
|
+
source: promotionSourceSchema,
|
|
976
|
+
changes: z10.array(promotionChangeSchema),
|
|
977
|
+
warnings: z10.array(promotionWarningSchema),
|
|
978
|
+
build: promotionBuildSchema.nullable(),
|
|
979
|
+
createdAt: z10.number().int().nonnegative(),
|
|
980
|
+
createdBy: z10.string().nullable()
|
|
981
|
+
};
|
|
982
|
+
var decided = {
|
|
983
|
+
decidedAt: z10.number().int().nonnegative(),
|
|
984
|
+
decidedBy: z10.string().nullable()
|
|
985
|
+
};
|
|
986
|
+
var promotionRecordSchema = z10.discriminatedUnion("status", [
|
|
987
|
+
z10.object({ ...promotionMetadata, status: z10.literal("pending") }),
|
|
988
|
+
z10.object({ ...promotionMetadata, ...decided, status: z10.literal("applied") }),
|
|
989
|
+
z10.object({
|
|
990
|
+
...promotionMetadata,
|
|
991
|
+
...decided,
|
|
992
|
+
status: z10.literal("rejected"),
|
|
993
|
+
reason: z10.string()
|
|
994
|
+
}),
|
|
995
|
+
z10.object({
|
|
996
|
+
...promotionMetadata,
|
|
997
|
+
...decided,
|
|
998
|
+
status: z10.literal("superseded")
|
|
999
|
+
})
|
|
1000
|
+
]);
|
|
1001
|
+
var promotionActionSchema = z10.object({ actionId: z10.string().uuid() }).strict();
|
|
1002
|
+
var promotionRejectionSchema = z10.object({ reason: z10.string().trim().min(1).max(1e3) }).strict();
|
|
1003
|
+
var promotionHistoryQuerySchema = z10.strictObject({
|
|
1004
|
+
cursor: pageCursorSchema.optional(),
|
|
1005
|
+
limit: z10.coerce.number().int().min(1).max(100).optional()
|
|
1006
|
+
});
|
|
1007
|
+
var promotionHistoryPageSchema = z10.object({
|
|
1008
|
+
items: z10.array(promotionRecordSchema),
|
|
1009
|
+
nextCursor: pageCursorSchema.nullable()
|
|
1010
|
+
});
|
|
1011
|
+
|
|
872
1012
|
// src/server/index.ts
|
|
873
|
-
import * as
|
|
1013
|
+
import * as z16 from "zod";
|
|
874
1014
|
|
|
875
1015
|
// src/server/hosting.ts
|
|
876
|
-
import * as
|
|
1016
|
+
import * as z13 from "zod";
|
|
877
1017
|
|
|
878
1018
|
// src/server/schedules.ts
|
|
879
|
-
import * as
|
|
1019
|
+
import * as z11 from "zod";
|
|
880
1020
|
import { Cron } from "croner";
|
|
881
1021
|
var APP_SCHEDULE_LIMIT = 10;
|
|
882
1022
|
var APP_SCHEDULE_MIN_INTERVAL = 3e5;
|
|
883
1023
|
var APP_SCHEDULE_TIMEOUT = 3e4;
|
|
884
|
-
var appScheduleNameSchema =
|
|
885
|
-
var appSchedulePathSchema =
|
|
1024
|
+
var appScheduleNameSchema = z11.string().regex(/^[a-z][a-z0-9-]{0,63}$/);
|
|
1025
|
+
var appSchedulePathSchema = z11.string().min(2).max(512).refine((path) => {
|
|
886
1026
|
if (!/^\/[a-zA-Z0-9_/-]+$/.test(path) || path.startsWith("//")) {
|
|
887
1027
|
return false;
|
|
888
1028
|
}
|
|
@@ -893,11 +1033,11 @@ function interval(value) {
|
|
|
893
1033
|
const unit = value.slice(-1);
|
|
894
1034
|
return amount * (unit === "m" ? 6e4 : unit === "h" ? 36e5 : 864e5);
|
|
895
1035
|
}
|
|
896
|
-
var everySchema =
|
|
1036
|
+
var everySchema = z11.string().regex(/^[1-9]\d{0,3}[mhd]$/).refine(
|
|
897
1037
|
(value) => interval(value) >= APP_SCHEDULE_MIN_INTERVAL && interval(value) <= 365 * 864e5,
|
|
898
1038
|
"Use an interval from 5 minutes to 365 days, such as 5m, 1h or 1d"
|
|
899
1039
|
);
|
|
900
|
-
var cronSchema =
|
|
1040
|
+
var cronSchema = z11.string().max(120).refine((value) => {
|
|
901
1041
|
const fields = value.trim().split(/\s+/);
|
|
902
1042
|
if (fields.length !== 5 || fields.some((field) => !/^[\d*,/-]+$/.test(field))) {
|
|
903
1043
|
return false;
|
|
@@ -922,15 +1062,15 @@ var cronSchema = z10.string().max(120).refine((value) => {
|
|
|
922
1062
|
var declaration = {
|
|
923
1063
|
name: appScheduleNameSchema,
|
|
924
1064
|
path: appSchedulePathSchema,
|
|
925
|
-
description:
|
|
1065
|
+
description: z11.string().min(1).max(500)
|
|
926
1066
|
};
|
|
927
|
-
var everySchedule =
|
|
928
|
-
var cronSchedule =
|
|
929
|
-
var appScheduleSchema =
|
|
1067
|
+
var everySchedule = z11.object({ ...declaration, every: everySchema });
|
|
1068
|
+
var cronSchedule = z11.object({ ...declaration, cron: cronSchema });
|
|
1069
|
+
var appScheduleSchema = z11.union([
|
|
930
1070
|
everySchedule.strict(),
|
|
931
1071
|
cronSchedule.strict()
|
|
932
1072
|
]);
|
|
933
|
-
var appSchedulesSchema =
|
|
1073
|
+
var appSchedulesSchema = z11.array(appScheduleSchema).max(APP_SCHEDULE_LIMIT).refine(
|
|
934
1074
|
(items) => new Set(items.map((item) => item.name)).size === items.length,
|
|
935
1075
|
"Schedule names must be unique"
|
|
936
1076
|
);
|
|
@@ -947,25 +1087,25 @@ function nextScheduleRun(schedule, after) {
|
|
|
947
1087
|
}
|
|
948
1088
|
return next.getTime();
|
|
949
1089
|
}
|
|
950
|
-
var appScheduleStateSchema =
|
|
1090
|
+
var appScheduleStateSchema = z11.enum(["active", "paused", "archived"]);
|
|
951
1091
|
var APP_SCHEDULE_RESULT_BYTES = 16384;
|
|
952
|
-
var appScheduleDiagnosticSchema =
|
|
953
|
-
level:
|
|
954
|
-
message:
|
|
1092
|
+
var appScheduleDiagnosticSchema = z11.object({
|
|
1093
|
+
level: z11.enum(["error", "warning", "info"]),
|
|
1094
|
+
message: z11.string().min(1).max(500),
|
|
955
1095
|
/** What the line is about, such as a member, record or tracker ID. */
|
|
956
|
-
subject:
|
|
1096
|
+
subject: z11.string().min(1).max(200).optional(),
|
|
957
1097
|
/** A stable code the app chooses, such as `ingest-timeout`. */
|
|
958
|
-
code:
|
|
1098
|
+
code: z11.string().min(1).max(100).optional()
|
|
959
1099
|
});
|
|
960
|
-
var appScheduleResultSchema =
|
|
961
|
-
outcome:
|
|
962
|
-
summary:
|
|
1100
|
+
var appScheduleResultSchema = z11.object({
|
|
1101
|
+
outcome: z11.enum(["succeeded", "partial", "failed"]),
|
|
1102
|
+
summary: z11.string().min(1).max(500).optional(),
|
|
963
1103
|
/** Counts and gauges, such as processed and failed members. */
|
|
964
|
-
metrics:
|
|
1104
|
+
metrics: z11.record(z11.string().regex(/^[A-Za-z][\w.-]{0,63}$/), z11.number()).refine(
|
|
965
1105
|
(metrics) => Object.keys(metrics).length <= 50,
|
|
966
1106
|
"Report at most 50 metrics"
|
|
967
1107
|
).optional(),
|
|
968
|
-
diagnostics:
|
|
1108
|
+
diagnostics: z11.array(appScheduleDiagnosticSchema).max(50).optional()
|
|
969
1109
|
});
|
|
970
1110
|
function scheduleResult(result) {
|
|
971
1111
|
const body = JSON.stringify(appScheduleResultSchema.parse(result));
|
|
@@ -978,41 +1118,41 @@ function scheduleResult(result) {
|
|
|
978
1118
|
headers: { "Content-Type": "application/json" }
|
|
979
1119
|
});
|
|
980
1120
|
}
|
|
981
|
-
var appScheduleRunSchema =
|
|
982
|
-
id:
|
|
983
|
-
build:
|
|
984
|
-
startedAt:
|
|
985
|
-
scheduledAt:
|
|
986
|
-
manual:
|
|
987
|
-
status:
|
|
988
|
-
duration:
|
|
1121
|
+
var appScheduleRunSchema = z11.object({
|
|
1122
|
+
id: z11.string().uuid(),
|
|
1123
|
+
build: z11.string().uuid(),
|
|
1124
|
+
startedAt: z11.number(),
|
|
1125
|
+
scheduledAt: z11.number(),
|
|
1126
|
+
manual: z11.boolean(),
|
|
1127
|
+
status: z11.enum(["queued", "running", "succeeded", "failed", "uncertain"]),
|
|
1128
|
+
duration: z11.number().nullable(),
|
|
989
1129
|
/** Why the run failed or is uncertain, or why Relay ignored the app's result. */
|
|
990
|
-
error:
|
|
1130
|
+
error: z11.string().nullable(),
|
|
991
1131
|
/** The app's JSON answer when it sent a valid result. Absent on runs from before results. */
|
|
992
1132
|
result: appScheduleResultSchema.nullable().optional()
|
|
993
1133
|
});
|
|
994
|
-
var appScheduleRunsSchema =
|
|
1134
|
+
var appScheduleRunsSchema = z11.object({
|
|
995
1135
|
/** Newest first: the latest twenty runs of one schedule, including a queued or running one. */
|
|
996
|
-
runs:
|
|
1136
|
+
runs: z11.array(appScheduleRunSchema)
|
|
997
1137
|
});
|
|
998
|
-
var appScheduleListSchema =
|
|
1138
|
+
var appScheduleListSchema = z11.object({
|
|
999
1139
|
state: appScheduleStateSchema,
|
|
1000
|
-
schedules:
|
|
1001
|
-
|
|
1002
|
-
declaration:
|
|
1003
|
-
nextRun:
|
|
1004
|
-
blocked:
|
|
1140
|
+
schedules: z11.array(
|
|
1141
|
+
z11.object({
|
|
1142
|
+
declaration: z11.union([everySchedule, cronSchedule]),
|
|
1143
|
+
nextRun: z11.number().nullable(),
|
|
1144
|
+
blocked: z11.boolean(),
|
|
1005
1145
|
lastRun: appScheduleRunSchema.nullable()
|
|
1006
1146
|
})
|
|
1007
1147
|
)
|
|
1008
1148
|
});
|
|
1009
|
-
var scheduledInvocationSchema =
|
|
1010
|
-
id:
|
|
1011
|
-
build:
|
|
1149
|
+
var scheduledInvocationSchema = z11.object({
|
|
1150
|
+
id: z11.string().uuid(),
|
|
1151
|
+
build: z11.string().uuid(),
|
|
1012
1152
|
name: appScheduleNameSchema,
|
|
1013
|
-
scheduledAt:
|
|
1014
|
-
startedAt:
|
|
1015
|
-
manual:
|
|
1153
|
+
scheduledAt: z11.number().int(),
|
|
1154
|
+
startedAt: z11.number().int(),
|
|
1155
|
+
manual: z11.boolean()
|
|
1016
1156
|
}).strict();
|
|
1017
1157
|
async function verifyScheduledRequest(request, key) {
|
|
1018
1158
|
const signature = request.headers.get("X-Domino-Schedule-Signature");
|
|
@@ -1077,7 +1217,7 @@ ${body}`)
|
|
|
1077
1217
|
}
|
|
1078
1218
|
|
|
1079
1219
|
// src/server/starters.ts
|
|
1080
|
-
import * as
|
|
1220
|
+
import * as z12 from "zod";
|
|
1081
1221
|
var starterTemplates = [
|
|
1082
1222
|
{
|
|
1083
1223
|
id: "campaign",
|
|
@@ -1110,63 +1250,63 @@ var starterTemplates = [
|
|
|
1110
1250
|
summary: "A headless Worker with typed routes and interactive API docs, for plugging Domino into your own product."
|
|
1111
1251
|
}
|
|
1112
1252
|
];
|
|
1113
|
-
var starterIdSchema =
|
|
1253
|
+
var starterIdSchema = z12.enum(
|
|
1114
1254
|
starterTemplates.map((template) => template.id)
|
|
1115
1255
|
);
|
|
1116
1256
|
|
|
1117
1257
|
// src/server/hosting.ts
|
|
1118
|
-
var outputPathSchema =
|
|
1258
|
+
var outputPathSchema = z13.string().min(1).max(512).refine(
|
|
1119
1259
|
(path) => path.split("/").every(
|
|
1120
1260
|
(part) => /^[\w-][\w.-]*$/.test(part) && part !== "node_modules"
|
|
1121
1261
|
),
|
|
1122
1262
|
"Expected a relative build output path without hidden segments"
|
|
1123
1263
|
);
|
|
1124
|
-
var appRoutingSchema =
|
|
1264
|
+
var appRoutingSchema = z13.enum(["legacy", "transparent"]).default("legacy");
|
|
1125
1265
|
var APP_SECRET_LIMIT = 50;
|
|
1126
1266
|
var APP_KV_LIMIT = 5;
|
|
1127
1267
|
var APP_SQL_LIMIT = 5;
|
|
1128
1268
|
var APP_MIGRATION_LIMIT = 100;
|
|
1129
1269
|
var APP_MIGRATION_FILE_BYTES = 9e4;
|
|
1130
1270
|
var APP_MIGRATION_TOTAL_BYTES = 1e6;
|
|
1131
|
-
var appSecretNameSchema =
|
|
1271
|
+
var appSecretNameSchema = z13.string().regex(
|
|
1132
1272
|
/^[A-Z_][A-Z0-9_]{0,63}$/,
|
|
1133
1273
|
"Use 1-64 uppercase letters, digits, and underscores, not starting with a digit"
|
|
1134
1274
|
).refine(
|
|
1135
1275
|
(name) => !name.startsWith("DOMINO_") && name !== "ASSETS",
|
|
1136
1276
|
"DOMINO_ names and ASSETS are reserved for Domino's own bindings"
|
|
1137
1277
|
);
|
|
1138
|
-
var appSecretValueSchema =
|
|
1278
|
+
var appSecretValueSchema = z13.string().min(1).refine(
|
|
1139
1279
|
(value) => new TextEncoder().encode(value).length <= 5120,
|
|
1140
1280
|
"Secret values can be at most 5 KiB"
|
|
1141
1281
|
);
|
|
1142
|
-
var appSecretInputSchema =
|
|
1143
|
-
var appSecretSchema =
|
|
1282
|
+
var appSecretInputSchema = z13.object({ value: appSecretValueSchema }).strict();
|
|
1283
|
+
var appSecretSchema = z13.object({
|
|
1144
1284
|
name: appSecretNameSchema,
|
|
1145
|
-
updatedAt:
|
|
1146
|
-
updatedBy:
|
|
1285
|
+
updatedAt: z13.number(),
|
|
1286
|
+
updatedBy: z13.string()
|
|
1147
1287
|
});
|
|
1148
|
-
var appSecretDeclarationSchema =
|
|
1149
|
-
description:
|
|
1150
|
-
required:
|
|
1288
|
+
var appSecretDeclarationSchema = z13.object({
|
|
1289
|
+
description: z13.string().trim().min(1).max(500),
|
|
1290
|
+
required: z13.boolean().default(true)
|
|
1151
1291
|
}).strict();
|
|
1152
|
-
var appSecretDeclarationsSchema =
|
|
1292
|
+
var appSecretDeclarationsSchema = z13.record(appSecretNameSchema, appSecretDeclarationSchema).refine(
|
|
1153
1293
|
(secrets) => Object.keys(secrets).length <= APP_SECRET_LIMIT,
|
|
1154
1294
|
`Declare at most ${APP_SECRET_LIMIT} app secrets`
|
|
1155
1295
|
);
|
|
1156
|
-
var appSecretListSchema =
|
|
1157
|
-
secrets:
|
|
1158
|
-
declared:
|
|
1296
|
+
var appSecretListSchema = z13.object({
|
|
1297
|
+
secrets: z13.array(appSecretSchema),
|
|
1298
|
+
declared: z13.array(appSecretDeclarationSchema.extend({ name: appSecretNameSchema })).default([])
|
|
1159
1299
|
});
|
|
1160
|
-
var hostedAppSecretsSchema =
|
|
1161
|
-
var storageDescription =
|
|
1162
|
-
description:
|
|
1300
|
+
var hostedAppSecretsSchema = z13.object({ secrets: z13.record(appSecretNameSchema, appSecretValueSchema) }).strict();
|
|
1301
|
+
var storageDescription = z13.object({
|
|
1302
|
+
description: z13.string().trim().min(1).max(500)
|
|
1163
1303
|
}).strict();
|
|
1164
|
-
var appStorageSchema =
|
|
1165
|
-
kv:
|
|
1304
|
+
var appStorageSchema = z13.object({
|
|
1305
|
+
kv: z13.record(appSecretNameSchema, storageDescription).refine(
|
|
1166
1306
|
(stores) => Object.keys(stores).length <= APP_KV_LIMIT,
|
|
1167
1307
|
`Declare at most ${APP_KV_LIMIT} KV stores`
|
|
1168
1308
|
).default({}),
|
|
1169
|
-
sql:
|
|
1309
|
+
sql: z13.record(
|
|
1170
1310
|
appSecretNameSchema,
|
|
1171
1311
|
storageDescription.extend({
|
|
1172
1312
|
migrations: outputPathSchema.optional()
|
|
@@ -1176,77 +1316,77 @@ var appStorageSchema = z12.object({
|
|
|
1176
1316
|
`Declare at most ${APP_SQL_LIMIT} SQL stores`
|
|
1177
1317
|
).default({})
|
|
1178
1318
|
}).strict();
|
|
1179
|
-
var appStorageKindSchema =
|
|
1180
|
-
var appStorageListSchema =
|
|
1181
|
-
stores:
|
|
1182
|
-
|
|
1183
|
-
kind:
|
|
1319
|
+
var appStorageKindSchema = z13.enum(["kv", "sql"]);
|
|
1320
|
+
var appStorageListSchema = z13.object({
|
|
1321
|
+
stores: z13.array(
|
|
1322
|
+
z13.object({
|
|
1323
|
+
kind: z13.string(),
|
|
1184
1324
|
name: appSecretNameSchema,
|
|
1185
|
-
createdAt:
|
|
1186
|
-
declared:
|
|
1187
|
-
description:
|
|
1325
|
+
createdAt: z13.number().nullable(),
|
|
1326
|
+
declared: z13.boolean(),
|
|
1327
|
+
description: z13.string().optional()
|
|
1188
1328
|
})
|
|
1189
1329
|
)
|
|
1190
1330
|
});
|
|
1191
1331
|
var APP_STORAGE_ROW_LIMIT = 50;
|
|
1192
1332
|
var APP_STORAGE_PREVIEW_CHARACTERS = 2e3;
|
|
1193
|
-
var appStorageCellSchema =
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1333
|
+
var appStorageCellSchema = z13.union([
|
|
1334
|
+
z13.string(),
|
|
1335
|
+
z13.number(),
|
|
1336
|
+
z13.null(),
|
|
1337
|
+
z13.object({ text: z13.string(), truncated: z13.literal(true) }),
|
|
1338
|
+
z13.object({ blob: z13.number().int().min(0) })
|
|
1199
1339
|
]);
|
|
1200
|
-
var appStorageTablesSchema =
|
|
1201
|
-
tables:
|
|
1340
|
+
var appStorageTablesSchema = z13.object({
|
|
1341
|
+
tables: z13.array(
|
|
1202
1342
|
/** `kind` is SQLite's: `table` or `view`. */
|
|
1203
|
-
|
|
1343
|
+
z13.object({ name: z13.string(), kind: z13.string() })
|
|
1204
1344
|
)
|
|
1205
1345
|
});
|
|
1206
|
-
var appStorageRowsSchema =
|
|
1207
|
-
table:
|
|
1208
|
-
columns:
|
|
1209
|
-
rows:
|
|
1346
|
+
var appStorageRowsSchema = z13.object({
|
|
1347
|
+
table: z13.string(),
|
|
1348
|
+
columns: z13.array(z13.string()),
|
|
1349
|
+
rows: z13.array(z13.array(appStorageCellSchema)),
|
|
1210
1350
|
/** How many rows come before this page in storage order. */
|
|
1211
|
-
offset:
|
|
1212
|
-
total:
|
|
1351
|
+
offset: z13.number().int().min(0),
|
|
1352
|
+
total: z13.number().int().min(0),
|
|
1213
1353
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
1214
1354
|
nextCursor: pageCursorSchema.nullable().default(null)
|
|
1215
1355
|
});
|
|
1216
|
-
var appStorageKeysSchema =
|
|
1217
|
-
keys:
|
|
1218
|
-
|
|
1356
|
+
var appStorageKeysSchema = z13.object({
|
|
1357
|
+
keys: z13.array(
|
|
1358
|
+
z13.object({ name: z13.string(), expiration: z13.number().nullable() })
|
|
1219
1359
|
),
|
|
1220
1360
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
1221
1361
|
nextCursor: pageCursorSchema.nullable().default(null),
|
|
1222
1362
|
/** @deprecated Use `nextCursor`. Removed in 2.0.0. */
|
|
1223
|
-
cursor:
|
|
1363
|
+
cursor: z13.string().nullable()
|
|
1224
1364
|
});
|
|
1225
|
-
var appStorageValueSchema =
|
|
1226
|
-
key:
|
|
1227
|
-
size:
|
|
1365
|
+
var appStorageValueSchema = z13.object({
|
|
1366
|
+
key: z13.string(),
|
|
1367
|
+
size: z13.number().int().min(0),
|
|
1228
1368
|
/** Null when the value is not UTF-8 text. */
|
|
1229
|
-
text:
|
|
1230
|
-
truncated:
|
|
1369
|
+
text: z13.string().nullable(),
|
|
1370
|
+
truncated: z13.boolean()
|
|
1231
1371
|
});
|
|
1232
1372
|
var APP_STORAGE_CELL_CHARACTERS = 1e5;
|
|
1233
|
-
var appStorageCellPageSchema =
|
|
1234
|
-
table:
|
|
1235
|
-
column:
|
|
1373
|
+
var appStorageCellPageSchema = z13.object({
|
|
1374
|
+
table: z13.string(),
|
|
1375
|
+
column: z13.string(),
|
|
1236
1376
|
/** The row's position in storage order: a rows page's `offset` plus its index on that page. */
|
|
1237
|
-
row:
|
|
1377
|
+
row: z13.number().int().min(0),
|
|
1238
1378
|
/** SQLite's storage class. */
|
|
1239
|
-
type:
|
|
1379
|
+
type: z13.enum(["text", "integer", "real", "blob", "null"]),
|
|
1240
1380
|
/** Characters of text, or of a number's text form; bytes of a BLOB; null for NULL. */
|
|
1241
|
-
length:
|
|
1381
|
+
length: z13.number().int().min(0).nullable(),
|
|
1242
1382
|
/** How many characters come before this page. */
|
|
1243
|
-
offset:
|
|
1383
|
+
offset: z13.number().int().min(0),
|
|
1244
1384
|
/** Up to 100,000 characters from `offset`. Null for a BLOB, whose bytes are never read, and NULL. */
|
|
1245
|
-
text:
|
|
1385
|
+
text: z13.string().nullable(),
|
|
1246
1386
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
1247
1387
|
nextCursor: pageCursorSchema.nullable().default(null)
|
|
1248
1388
|
});
|
|
1249
|
-
var appMigrationNameSchema =
|
|
1389
|
+
var appMigrationNameSchema = z13.string().max(255).regex(/^[\w-][\w.-]*\.sql$/);
|
|
1250
1390
|
function compareAppMigrations(a, b) {
|
|
1251
1391
|
const left = Number.parseInt(a.split("_")[0], 10);
|
|
1252
1392
|
const right = Number.parseInt(b.split("_")[0], 10);
|
|
@@ -1263,12 +1403,12 @@ function compareAppMigrations(a, b) {
|
|
|
1263
1403
|
}
|
|
1264
1404
|
return a < b ? -1 : a > b ? 1 : 0;
|
|
1265
1405
|
}
|
|
1266
|
-
var appMigrationsSchema =
|
|
1406
|
+
var appMigrationsSchema = z13.record(
|
|
1267
1407
|
appSecretNameSchema,
|
|
1268
|
-
|
|
1269
|
-
|
|
1408
|
+
z13.array(
|
|
1409
|
+
z13.object({
|
|
1270
1410
|
name: appMigrationNameSchema,
|
|
1271
|
-
sql:
|
|
1411
|
+
sql: z13.string().min(1).refine(
|
|
1272
1412
|
(sql) => new TextEncoder().encode(sql).length <= APP_MIGRATION_FILE_BYTES,
|
|
1273
1413
|
`A migration file must not exceed ${APP_MIGRATION_FILE_BYTES} bytes`
|
|
1274
1414
|
)
|
|
@@ -1286,21 +1426,21 @@ var appMigrationsSchema = z12.record(
|
|
|
1286
1426
|
);
|
|
1287
1427
|
var appScripts = {
|
|
1288
1428
|
routing: appRoutingSchema,
|
|
1289
|
-
devScript:
|
|
1290
|
-
checkScript:
|
|
1291
|
-
buildScript:
|
|
1429
|
+
devScript: z13.string().regex(/^[\w:-]+$/),
|
|
1430
|
+
checkScript: z13.string().regex(/^[\w:-]+$/),
|
|
1431
|
+
buildScript: z13.string().regex(/^[\w:-]+$/)
|
|
1292
1432
|
};
|
|
1293
1433
|
var workerSettings = {
|
|
1294
|
-
runWorkerFirst:
|
|
1434
|
+
runWorkerFirst: z13.boolean().default(false),
|
|
1295
1435
|
main: outputPathSchema.refine(
|
|
1296
1436
|
(path) => /\.m?js$/.test(path),
|
|
1297
1437
|
"Expected a compiled JavaScript entry"
|
|
1298
1438
|
),
|
|
1299
|
-
compatibilityDate:
|
|
1300
|
-
compatibilityFlags:
|
|
1301
|
-
vars:
|
|
1302
|
-
|
|
1303
|
-
|
|
1439
|
+
compatibilityDate: z13.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
1440
|
+
compatibilityFlags: z13.array(z13.string().min(1)).max(50).default([]),
|
|
1441
|
+
vars: z13.record(
|
|
1442
|
+
z13.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).refine((name) => name !== "ASSETS"),
|
|
1443
|
+
z13.string()
|
|
1304
1444
|
).default({}),
|
|
1305
1445
|
secrets: appSecretDeclarationsSchema.default({}),
|
|
1306
1446
|
storage: appStorageSchema.optional(),
|
|
@@ -1329,62 +1469,62 @@ var distinctBindings = (worker, ctx) => {
|
|
|
1329
1469
|
}
|
|
1330
1470
|
}
|
|
1331
1471
|
};
|
|
1332
|
-
var hostedAppSchema =
|
|
1333
|
-
|
|
1334
|
-
kind:
|
|
1472
|
+
var hostedAppSchema = z13.discriminatedUnion("kind", [
|
|
1473
|
+
z13.object({
|
|
1474
|
+
kind: z13.literal("static"),
|
|
1335
1475
|
directory: outputPathSchema,
|
|
1336
1476
|
...appScripts
|
|
1337
1477
|
}).strict(),
|
|
1338
|
-
|
|
1339
|
-
kind:
|
|
1478
|
+
z13.object({
|
|
1479
|
+
kind: z13.literal("worker"),
|
|
1340
1480
|
directory: outputPathSchema,
|
|
1341
1481
|
assetsDirectory: outputPathSchema.optional(),
|
|
1342
1482
|
...appScripts,
|
|
1343
1483
|
...workerSettings
|
|
1344
1484
|
}).strict().superRefine(distinctBindings)
|
|
1345
1485
|
]);
|
|
1346
|
-
var repositorySchema =
|
|
1347
|
-
id:
|
|
1486
|
+
var repositorySchema = z13.object({
|
|
1487
|
+
id: z13.string().uuid(),
|
|
1348
1488
|
organization: identifier,
|
|
1349
1489
|
project: identifier,
|
|
1350
|
-
remote:
|
|
1351
|
-
defaultBranch:
|
|
1352
|
-
status:
|
|
1490
|
+
remote: z13.string().url(),
|
|
1491
|
+
defaultBranch: z13.string(),
|
|
1492
|
+
status: z13.enum(["provisioning", "ready"])
|
|
1353
1493
|
});
|
|
1354
|
-
var createRepositorySchema =
|
|
1494
|
+
var createRepositorySchema = z13.object({
|
|
1355
1495
|
/** Omitted: the starter chosen at project setup, else `campaign`. */
|
|
1356
1496
|
starter: starterIdSchema.optional()
|
|
1357
1497
|
}).strict();
|
|
1358
|
-
var deviceStartSchema =
|
|
1359
|
-
challenge:
|
|
1498
|
+
var deviceStartSchema = z13.object({
|
|
1499
|
+
challenge: z13.string().regex(/^[a-f0-9]{64}$/)
|
|
1360
1500
|
}).strict();
|
|
1361
|
-
var deviceRedeemSchema =
|
|
1362
|
-
id:
|
|
1363
|
-
verifier:
|
|
1501
|
+
var deviceRedeemSchema = z13.object({
|
|
1502
|
+
id: z13.string().uuid(),
|
|
1503
|
+
verifier: z13.string().min(43).max(128)
|
|
1364
1504
|
}).strict();
|
|
1365
|
-
var deviceApproveSchema =
|
|
1366
|
-
id:
|
|
1367
|
-
code:
|
|
1505
|
+
var deviceApproveSchema = z13.object({
|
|
1506
|
+
id: z13.string().uuid(),
|
|
1507
|
+
code: z13.string().regex(/^[A-F0-9]{4}-[A-F0-9]{4}$/)
|
|
1368
1508
|
}).strict();
|
|
1369
|
-
var commitSchema =
|
|
1370
|
-
var stageRequestSchema =
|
|
1509
|
+
var commitSchema = z13.string().regex(/^[a-f0-9]{40}$/);
|
|
1510
|
+
var stageRequestSchema = z13.object({
|
|
1371
1511
|
commit: commitSchema,
|
|
1372
|
-
requestId:
|
|
1512
|
+
requestId: z13.string().uuid()
|
|
1373
1513
|
}).strict();
|
|
1374
|
-
var buildIdentitySchema =
|
|
1514
|
+
var buildIdentitySchema = z13.object({
|
|
1375
1515
|
routing: appRoutingSchema,
|
|
1376
|
-
slug:
|
|
1377
|
-
runtime:
|
|
1378
|
-
id:
|
|
1379
|
-
repository:
|
|
1516
|
+
slug: z13.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional(),
|
|
1517
|
+
runtime: z13.enum(["simulation", "hosted-test"]).default("simulation"),
|
|
1518
|
+
id: z13.string().uuid(),
|
|
1519
|
+
repository: z13.string().uuid(),
|
|
1380
1520
|
organization: identifier,
|
|
1381
1521
|
project: identifier,
|
|
1382
1522
|
commit: commitSchema,
|
|
1383
|
-
createdAt:
|
|
1384
|
-
actor:
|
|
1385
|
-
commitMessage:
|
|
1523
|
+
createdAt: z13.number(),
|
|
1524
|
+
actor: z13.string(),
|
|
1525
|
+
commitMessage: z13.string().max(500).optional()
|
|
1386
1526
|
});
|
|
1387
|
-
var buildPhaseSchema =
|
|
1527
|
+
var buildPhaseSchema = z13.enum([
|
|
1388
1528
|
"queued",
|
|
1389
1529
|
"source",
|
|
1390
1530
|
"install",
|
|
@@ -1394,72 +1534,72 @@ var buildPhaseSchema = z12.enum([
|
|
|
1394
1534
|
"ready",
|
|
1395
1535
|
"failed"
|
|
1396
1536
|
]);
|
|
1397
|
-
var buildStatusSchema =
|
|
1537
|
+
var buildStatusSchema = z13.object({
|
|
1398
1538
|
phase: buildPhaseSchema,
|
|
1399
1539
|
failedPhase: buildPhaseSchema.optional(),
|
|
1400
|
-
updatedAt:
|
|
1401
|
-
message:
|
|
1540
|
+
updatedAt: z13.number(),
|
|
1541
|
+
message: z13.string()
|
|
1402
1542
|
});
|
|
1403
1543
|
var hostedBuildSchema = buildIdentitySchema.extend({
|
|
1404
1544
|
...buildStatusSchema.shape,
|
|
1405
|
-
finished:
|
|
1406
|
-
current:
|
|
1407
|
-
stagingUrl:
|
|
1545
|
+
finished: z13.boolean(),
|
|
1546
|
+
current: z13.boolean(),
|
|
1547
|
+
stagingUrl: z13.string().url()
|
|
1408
1548
|
});
|
|
1409
|
-
var stagingAccessModeSchema =
|
|
1410
|
-
var stagingAccessSchema =
|
|
1411
|
-
var stagingAccessInputSchema =
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
mode:
|
|
1415
|
-
password:
|
|
1549
|
+
var stagingAccessModeSchema = z13.enum(["console", "password"]);
|
|
1550
|
+
var stagingAccessSchema = z13.object({ mode: stagingAccessModeSchema });
|
|
1551
|
+
var stagingAccessInputSchema = z13.discriminatedUnion("mode", [
|
|
1552
|
+
z13.object({ mode: z13.literal("console") }).strict(),
|
|
1553
|
+
z13.object({
|
|
1554
|
+
mode: z13.literal("password"),
|
|
1555
|
+
password: z13.string().min(8).max(128)
|
|
1416
1556
|
}).strict()
|
|
1417
1557
|
]);
|
|
1418
|
-
var stagingPathSchema =
|
|
1558
|
+
var stagingPathSchema = z13.string().max(2048).refine(
|
|
1419
1559
|
(path) => path.startsWith("/") && !path.startsWith("//") && !path.includes("\\"),
|
|
1420
1560
|
"Expected a path on the staging host"
|
|
1421
1561
|
);
|
|
1422
|
-
var stagingLinkSchema =
|
|
1423
|
-
url:
|
|
1424
|
-
expiresAt:
|
|
1562
|
+
var stagingLinkSchema = z13.object({
|
|
1563
|
+
url: z13.string().url(),
|
|
1564
|
+
expiresAt: z13.number()
|
|
1425
1565
|
});
|
|
1426
|
-
var buildSnapshotSchema =
|
|
1427
|
-
builds:
|
|
1566
|
+
var buildSnapshotSchema = z13.object({
|
|
1567
|
+
builds: z13.array(hostedBuildSchema),
|
|
1428
1568
|
current: hostedBuildSchema.nullable(),
|
|
1429
1569
|
selected: hostedBuildSchema.nullable(),
|
|
1430
|
-
logs:
|
|
1570
|
+
logs: z13.string()
|
|
1431
1571
|
});
|
|
1432
|
-
var assetPathSchema =
|
|
1572
|
+
var assetPathSchema = z13.string().max(512).refine(
|
|
1433
1573
|
(path) => path.startsWith("/") && // oxlint-disable-next-line no-control-regex -- Asset paths must reject control characters.
|
|
1434
1574
|
!/[\\\u0000-\u001f?#%]/.test(path) && path.slice(1).split("/").every((part) => part.length > 0 && !part.startsWith(".")),
|
|
1435
1575
|
"Expected a public asset path without hidden segments"
|
|
1436
1576
|
);
|
|
1437
|
-
var base64Schema =
|
|
1577
|
+
var base64Schema = z13.string().regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
|
|
1438
1578
|
var stagedDeploymentLimits = {
|
|
1439
1579
|
/** Bytes of JSON, uncompressed. */
|
|
1440
1580
|
size: 64e6,
|
|
1441
1581
|
/** Bytes of the Brotli-compressed object. */
|
|
1442
1582
|
compressedSize: 1e7
|
|
1443
1583
|
};
|
|
1444
|
-
var stagedDeploymentSchema =
|
|
1445
|
-
encoding:
|
|
1446
|
-
sha256:
|
|
1447
|
-
compressedSize:
|
|
1448
|
-
size:
|
|
1584
|
+
var stagedDeploymentSchema = z13.object({
|
|
1585
|
+
encoding: z13.literal("br"),
|
|
1586
|
+
sha256: z13.string().regex(/^[0-9a-f]{64}$/),
|
|
1587
|
+
compressedSize: z13.number().int().positive().max(stagedDeploymentLimits.compressedSize),
|
|
1588
|
+
size: z13.number().int().positive().max(stagedDeploymentLimits.size)
|
|
1449
1589
|
}).strict();
|
|
1450
1590
|
var stagedDeploymentContentSchema = stagedDeploymentSchema.extend({
|
|
1451
|
-
content:
|
|
1591
|
+
content: z13.string().max(Math.ceil(stagedDeploymentLimits.compressedSize / 3) * 4)
|
|
1452
1592
|
}).strict();
|
|
1453
1593
|
var stagedDeploymentKey = (build, sha256) => `builds/${build}/deployment/${sha256}.br`;
|
|
1454
1594
|
var artifactFields = {
|
|
1455
1595
|
routing: appRoutingSchema,
|
|
1456
|
-
worker:
|
|
1596
|
+
worker: z13.object({
|
|
1457
1597
|
...workerSettings,
|
|
1458
1598
|
migrations: appMigrationsSchema.optional(),
|
|
1459
|
-
modules:
|
|
1460
|
-
|
|
1599
|
+
modules: z13.array(
|
|
1600
|
+
z13.object({
|
|
1461
1601
|
path: outputPathSchema.refine((path) => path !== "metadata"),
|
|
1462
|
-
type:
|
|
1602
|
+
type: z13.enum([
|
|
1463
1603
|
"application/javascript+module",
|
|
1464
1604
|
"application/wasm",
|
|
1465
1605
|
"text/plain",
|
|
@@ -1469,26 +1609,26 @@ var artifactFields = {
|
|
|
1469
1609
|
}).strict()
|
|
1470
1610
|
).min(1).max(500)
|
|
1471
1611
|
}).strict().superRefine(distinctBindings).optional(),
|
|
1472
|
-
assets:
|
|
1473
|
-
|
|
1612
|
+
assets: z13.array(
|
|
1613
|
+
z13.object({
|
|
1474
1614
|
path: assetPathSchema,
|
|
1475
1615
|
content: base64Schema.max(14e6),
|
|
1476
|
-
size:
|
|
1616
|
+
size: z13.number().int().min(0).max(1e7)
|
|
1477
1617
|
}).strict()
|
|
1478
1618
|
).max(500)
|
|
1479
1619
|
};
|
|
1480
|
-
var buildArtifactsSchema =
|
|
1481
|
-
|
|
1482
|
-
format:
|
|
1620
|
+
var buildArtifactsSchema = z13.discriminatedUnion("format", [
|
|
1621
|
+
z13.object({
|
|
1622
|
+
format: z13.literal(1),
|
|
1483
1623
|
...artifactFields,
|
|
1484
|
-
quests:
|
|
1485
|
-
catalog:
|
|
1624
|
+
quests: z13.unknown(),
|
|
1625
|
+
catalog: z13.unknown()
|
|
1486
1626
|
}).strict(),
|
|
1487
|
-
|
|
1488
|
-
format:
|
|
1627
|
+
z13.object({
|
|
1628
|
+
format: z13.literal(2),
|
|
1489
1629
|
...artifactFields,
|
|
1490
1630
|
deployment: stagedDeploymentSchema,
|
|
1491
|
-
images:
|
|
1631
|
+
images: z13.array(imageAssetArtifactSchema).max(10)
|
|
1492
1632
|
}).strict()
|
|
1493
1633
|
]).superRefine((value, ctx) => {
|
|
1494
1634
|
if (value.worker) {
|
|
@@ -1540,39 +1680,39 @@ var buildArtifactsSchema = z12.discriminatedUnion("format", [
|
|
|
1540
1680
|
});
|
|
1541
1681
|
|
|
1542
1682
|
// src/server/development.ts
|
|
1543
|
-
import * as
|
|
1544
|
-
var developmentPreflightSchema =
|
|
1545
|
-
organization:
|
|
1546
|
-
project:
|
|
1547
|
-
environment:
|
|
1548
|
-
identity:
|
|
1549
|
-
exchange:
|
|
1550
|
-
activeIntegrations:
|
|
1683
|
+
import * as z14 from "zod";
|
|
1684
|
+
var developmentPreflightSchema = z14.object({
|
|
1685
|
+
organization: z14.string(),
|
|
1686
|
+
project: z14.string(),
|
|
1687
|
+
environment: z14.enum(["test", "live"]),
|
|
1688
|
+
identity: z14.object({
|
|
1689
|
+
exchange: z14.literal("supported"),
|
|
1690
|
+
activeIntegrations: z14.number().int().nonnegative()
|
|
1551
1691
|
}).optional(),
|
|
1552
|
-
staging:
|
|
1553
|
-
development:
|
|
1554
|
-
status:
|
|
1692
|
+
staging: z14.enum(["configured", "blocked"]),
|
|
1693
|
+
development: z14.object({
|
|
1694
|
+
status: z14.enum(["configured", "blocked"]),
|
|
1555
1695
|
// How `domino dev` reaches the preview origin: a Cloudflare tunnel, or a direct route on a
|
|
1556
1696
|
// local development stack. APIs that predate the field use tunnels.
|
|
1557
|
-
transport:
|
|
1558
|
-
missing:
|
|
1559
|
-
authentication:
|
|
1697
|
+
transport: z14.enum(["tunnel", "direct"]).default("tunnel"),
|
|
1698
|
+
missing: z14.array(z14.string()),
|
|
1699
|
+
authentication: z14.array(z14.string())
|
|
1560
1700
|
}),
|
|
1561
|
-
checks:
|
|
1562
|
-
|
|
1563
|
-
id:
|
|
1564
|
-
status:
|
|
1565
|
-
message:
|
|
1566
|
-
missing:
|
|
1567
|
-
issues:
|
|
1701
|
+
checks: z14.array(
|
|
1702
|
+
z14.object({
|
|
1703
|
+
id: z14.string(),
|
|
1704
|
+
status: z14.enum(["ok", "error"]),
|
|
1705
|
+
message: z14.string(),
|
|
1706
|
+
missing: z14.array(z14.string()).optional(),
|
|
1707
|
+
issues: z14.array(z14.string()).optional()
|
|
1568
1708
|
})
|
|
1569
1709
|
)
|
|
1570
1710
|
});
|
|
1571
1711
|
|
|
1572
1712
|
// src/server/hosted.ts
|
|
1573
|
-
import * as
|
|
1713
|
+
import * as z15 from "zod";
|
|
1574
1714
|
var hostedKeyPermissions = ["read", "points", "ingest"];
|
|
1575
|
-
var hostedKeyPermissionList =
|
|
1715
|
+
var hostedKeyPermissionList = z15.array(z15.string()).transform(
|
|
1576
1716
|
(values) => values.filter(
|
|
1577
1717
|
(value) => hostedKeyPermissions.includes(value)
|
|
1578
1718
|
)
|
|
@@ -1584,17 +1724,17 @@ var hostedManagementBindings = [
|
|
|
1584
1724
|
"DOMINO_PROJECT",
|
|
1585
1725
|
"DOMINO_ENVIRONMENT"
|
|
1586
1726
|
];
|
|
1587
|
-
var hostedKeySecretSchema =
|
|
1588
|
-
var hostedKeySchema =
|
|
1589
|
-
id:
|
|
1727
|
+
var hostedKeySecretSchema = z15.string().regex(/^dhk_[A-Za-z0-9_-]{43}$/, "Expected a hosted app key");
|
|
1728
|
+
var hostedKeySchema = z15.object({
|
|
1729
|
+
id: z15.string().uuid(),
|
|
1590
1730
|
token: hostedKeySecretSchema,
|
|
1591
1731
|
organization: identifier,
|
|
1592
1732
|
project: identifier,
|
|
1593
|
-
environment:
|
|
1733
|
+
environment: z15.enum(["test", "live"]),
|
|
1594
1734
|
permissions: hostedKeyPermissionList,
|
|
1595
|
-
expiresAt:
|
|
1735
|
+
expiresAt: z15.number().nullable()
|
|
1596
1736
|
}).strict();
|
|
1597
|
-
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl:
|
|
1737
|
+
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl: z15.string().url() }).strict();
|
|
1598
1738
|
function hostedManagementClient(env) {
|
|
1599
1739
|
const missing = hostedManagementBindings.filter((name) => !env[name]);
|
|
1600
1740
|
if (missing.length) {
|
|
@@ -1602,7 +1742,7 @@ function hostedManagementClient(env) {
|
|
|
1602
1742
|
`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
1743
|
);
|
|
1604
1744
|
}
|
|
1605
|
-
const environment =
|
|
1745
|
+
const environment = z15.enum(["test", "live"]).parse(env.DOMINO_ENVIRONMENT);
|
|
1606
1746
|
const token = env.DOMINO_MANAGEMENT_KEY;
|
|
1607
1747
|
return createManagementClient({
|
|
1608
1748
|
baseUrl: env.DOMINO_API_URL.replace(/\/+$/, ""),
|
|
@@ -1614,9 +1754,9 @@ function hostedManagementClient(env) {
|
|
|
1614
1754
|
}
|
|
1615
1755
|
|
|
1616
1756
|
// src/server/index.ts
|
|
1617
|
-
var environmentSchema =
|
|
1618
|
-
var roleSchema =
|
|
1619
|
-
var permissionSchema =
|
|
1757
|
+
var environmentSchema = z16.enum(["test", "live"]);
|
|
1758
|
+
var roleSchema = z16.enum(["editor", "reviewer", "staff"]);
|
|
1759
|
+
var permissionSchema = z16.enum([
|
|
1620
1760
|
"read",
|
|
1621
1761
|
"publish",
|
|
1622
1762
|
"review",
|
|
@@ -1636,7 +1776,7 @@ var permissionSchema = z15.enum([
|
|
|
1636
1776
|
*/
|
|
1637
1777
|
"enroll"
|
|
1638
1778
|
]);
|
|
1639
|
-
var permissionListSchema =
|
|
1779
|
+
var permissionListSchema = z16.array(z16.string()).transform(
|
|
1640
1780
|
(values) => values.filter(
|
|
1641
1781
|
(value) => permissionSchema.safeParse(value).success
|
|
1642
1782
|
)
|
|
@@ -1646,38 +1786,38 @@ var rolePermissions = {
|
|
|
1646
1786
|
reviewer: ["read", "review"],
|
|
1647
1787
|
staff: ["read", "confirm", "handover"]
|
|
1648
1788
|
};
|
|
1649
|
-
var projectSetupSchema =
|
|
1650
|
-
mode:
|
|
1651
|
-
brief:
|
|
1789
|
+
var projectSetupSchema = z16.object({
|
|
1790
|
+
mode: z16.enum(["new", "existing"]),
|
|
1791
|
+
brief: z16.string().trim().min(1).max(4e3)
|
|
1652
1792
|
}).strict();
|
|
1653
|
-
var operatorUserSchema =
|
|
1654
|
-
id:
|
|
1655
|
-
name:
|
|
1656
|
-
email:
|
|
1657
|
-
avatar:
|
|
1793
|
+
var operatorUserSchema = z16.object({
|
|
1794
|
+
id: z16.string(),
|
|
1795
|
+
name: z16.string().nullable(),
|
|
1796
|
+
email: z16.string().nullable(),
|
|
1797
|
+
avatar: z16.string().nullable()
|
|
1658
1798
|
});
|
|
1659
|
-
var projectSchema =
|
|
1799
|
+
var projectSchema = z16.object({
|
|
1660
1800
|
/**
|
|
1661
1801
|
* Names the project's hosted addresses. The server gives a new project, and accepts in a
|
|
1662
1802
|
* slug change, only slugs of at least 3 characters that Domino does not reserve. This schema
|
|
1663
1803
|
* checks only the format, so it parses every slug that exists.
|
|
1664
1804
|
*/
|
|
1665
|
-
slug:
|
|
1666
|
-
createdBy:
|
|
1805
|
+
slug: z16.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
1806
|
+
createdBy: z16.string().nullable().optional(),
|
|
1667
1807
|
creator: operatorUserSchema.nullable().optional(),
|
|
1668
1808
|
/** A response, so fields a newer server adds to the setup are dropped, not rejected. */
|
|
1669
|
-
setup:
|
|
1809
|
+
setup: z16.object(projectSetupSchema.shape).optional(),
|
|
1670
1810
|
/** The starter chosen at setup. A plain string, so later starters still parse. */
|
|
1671
|
-
starter:
|
|
1672
|
-
id:
|
|
1811
|
+
starter: z16.string().optional(),
|
|
1812
|
+
id: z16.string().min(1),
|
|
1673
1813
|
organization: identifier,
|
|
1674
1814
|
project: identifier,
|
|
1675
|
-
name:
|
|
1676
|
-
subtitle:
|
|
1677
|
-
initials:
|
|
1678
|
-
color:
|
|
1815
|
+
name: z16.string(),
|
|
1816
|
+
subtitle: z16.string(),
|
|
1817
|
+
initials: z16.string(),
|
|
1818
|
+
color: z16.string(),
|
|
1679
1819
|
permissions: permissionListSchema,
|
|
1680
|
-
environments:
|
|
1820
|
+
environments: z16.array(environmentSchema)
|
|
1681
1821
|
}).refine(
|
|
1682
1822
|
(project) => !project.creator || project.creator.id === project.createdBy,
|
|
1683
1823
|
{
|
|
@@ -1685,45 +1825,45 @@ var projectSchema = z15.object({
|
|
|
1685
1825
|
path: ["creator"]
|
|
1686
1826
|
}
|
|
1687
1827
|
);
|
|
1688
|
-
var projectInputSchema =
|
|
1828
|
+
var projectInputSchema = z16.object({
|
|
1689
1829
|
actionId: identifier,
|
|
1690
|
-
name:
|
|
1830
|
+
name: z16.string().trim().min(1).max(80),
|
|
1691
1831
|
setup: projectSetupSchema.optional(),
|
|
1692
1832
|
/** The starter a new hosted app begins from, with `setup.mode` "new". */
|
|
1693
1833
|
starter: starterIdSchema.optional()
|
|
1694
1834
|
}).strict();
|
|
1695
|
-
var projectUpdateInputSchema =
|
|
1696
|
-
|
|
1697
|
-
|
|
1835
|
+
var projectUpdateInputSchema = z16.union([
|
|
1836
|
+
z16.object({ name: projectInputSchema.shape.name }).strict(),
|
|
1837
|
+
z16.object({
|
|
1698
1838
|
slug: projectSchema.shape.slug,
|
|
1699
|
-
confirm:
|
|
1839
|
+
confirm: z16.string().min(1).max(80)
|
|
1700
1840
|
}).strict()
|
|
1701
1841
|
]);
|
|
1702
|
-
var projectDeletionInputSchema =
|
|
1703
|
-
var projectDeletionSchema =
|
|
1842
|
+
var projectDeletionInputSchema = z16.object({ confirm: z16.string().min(1).max(80) }).strict();
|
|
1843
|
+
var projectDeletionSchema = z16.object({
|
|
1704
1844
|
project: identifier,
|
|
1705
|
-
purgeAfter:
|
|
1845
|
+
purgeAfter: z16.number().int()
|
|
1706
1846
|
});
|
|
1707
|
-
var projectTransferInputSchema =
|
|
1708
|
-
var projectTransferSchema =
|
|
1847
|
+
var projectTransferInputSchema = z16.object({ organization: identifier, confirm: z16.string().min(1).max(80) }).strict();
|
|
1848
|
+
var projectTransferSchema = z16.object({
|
|
1709
1849
|
organization: identifier,
|
|
1710
1850
|
project: identifier
|
|
1711
1851
|
});
|
|
1712
|
-
var grantSchema =
|
|
1713
|
-
subject:
|
|
1714
|
-
roles:
|
|
1715
|
-
environments:
|
|
1852
|
+
var grantSchema = z16.object({
|
|
1853
|
+
subject: z16.string().min(1).max(200),
|
|
1854
|
+
roles: z16.array(roleSchema),
|
|
1855
|
+
environments: z16.array(environmentSchema)
|
|
1716
1856
|
}).strict();
|
|
1717
|
-
var grantRecordSchema =
|
|
1718
|
-
var stockAdditionSchema =
|
|
1857
|
+
var grantRecordSchema = z16.object(grantSchema.shape);
|
|
1858
|
+
var stockAdditionSchema = z16.object({
|
|
1719
1859
|
item: identifier,
|
|
1720
|
-
quantity:
|
|
1860
|
+
quantity: z16.number().int(),
|
|
1721
1861
|
actionId: identifier
|
|
1722
1862
|
});
|
|
1723
|
-
var completionRevokeSchema =
|
|
1863
|
+
var completionRevokeSchema = z16.object({
|
|
1724
1864
|
actionId: identifier,
|
|
1725
|
-
reason:
|
|
1726
|
-
freeOccurrence:
|
|
1865
|
+
reason: z16.string().trim().min(1).max(500),
|
|
1866
|
+
freeOccurrence: z16.boolean().default(false)
|
|
1727
1867
|
}).strict();
|
|
1728
1868
|
var RevokedEntitlementOutcome = {
|
|
1729
1869
|
/** No other completion grants the reward: it is void, after cancelling a handover in progress. */
|
|
@@ -1751,221 +1891,221 @@ var RevokedReferralOutcome = {
|
|
|
1751
1891
|
/** Qualified on another accepted completion of the program's quest instead. */
|
|
1752
1892
|
Requalified: "requalified"
|
|
1753
1893
|
};
|
|
1754
|
-
var entitlementOutcomeSchema =
|
|
1755
|
-
var deliveryOutcomeSchema =
|
|
1756
|
-
var referralOutcomeSchema =
|
|
1757
|
-
var completionRevocationSchema =
|
|
1894
|
+
var entitlementOutcomeSchema = z16.string().min(1).max(64);
|
|
1895
|
+
var deliveryOutcomeSchema = z16.string().min(1).max(64);
|
|
1896
|
+
var referralOutcomeSchema = z16.string().min(1).max(64);
|
|
1897
|
+
var completionRevocationSchema = z16.object({
|
|
1758
1898
|
completion: identifier,
|
|
1759
1899
|
/** The quest ID, or the board ID when `source.kind` is `leaderboard`. */
|
|
1760
1900
|
quest: identifier,
|
|
1761
1901
|
member: identifier,
|
|
1762
1902
|
/** What paid the revoked completion. `source.id` repeats `quest`. */
|
|
1763
1903
|
source: completionSourceSchema.optional(),
|
|
1764
|
-
revokedAt:
|
|
1765
|
-
occurrenceFreed:
|
|
1766
|
-
badges:
|
|
1767
|
-
points:
|
|
1768
|
-
|
|
1904
|
+
revokedAt: z16.number(),
|
|
1905
|
+
occurrenceFreed: z16.boolean(),
|
|
1906
|
+
badges: z16.array(z16.object({ badge: identifier, stillAwarded: z16.boolean() })).optional(),
|
|
1907
|
+
points: z16.array(
|
|
1908
|
+
z16.object({
|
|
1769
1909
|
entry: identifier,
|
|
1770
1910
|
balance: identifier,
|
|
1771
1911
|
reversal: identifier.nullable(),
|
|
1772
|
-
reversed:
|
|
1773
|
-
unreversed:
|
|
1912
|
+
reversed: z16.number().int(),
|
|
1913
|
+
unreversed: z16.number().int()
|
|
1774
1914
|
})
|
|
1775
1915
|
),
|
|
1776
|
-
entitlements:
|
|
1777
|
-
|
|
1916
|
+
entitlements: z16.array(
|
|
1917
|
+
z16.object({
|
|
1778
1918
|
entitlement: identifier,
|
|
1779
1919
|
reward: identifier,
|
|
1780
1920
|
outcome: entitlementOutcomeSchema,
|
|
1781
|
-
status:
|
|
1921
|
+
status: z16.string()
|
|
1782
1922
|
})
|
|
1783
1923
|
),
|
|
1784
|
-
deliveries:
|
|
1785
|
-
|
|
1786
|
-
delivery:
|
|
1787
|
-
roleId:
|
|
1924
|
+
deliveries: z16.array(
|
|
1925
|
+
z16.object({
|
|
1926
|
+
delivery: z16.string(),
|
|
1927
|
+
roleId: z16.string(),
|
|
1788
1928
|
outcome: deliveryOutcomeSchema,
|
|
1789
1929
|
/**
|
|
1790
1930
|
* By Relay's records, another accepted, unrevoked completion of the member also granted this
|
|
1791
1931
|
* role to the same Discord account and server. Relay does not read Discord's membership.
|
|
1792
1932
|
*/
|
|
1793
|
-
stillGranted:
|
|
1933
|
+
stillGranted: z16.boolean()
|
|
1794
1934
|
})
|
|
1795
1935
|
),
|
|
1796
|
-
referrals:
|
|
1797
|
-
|
|
1936
|
+
referrals: z16.array(
|
|
1937
|
+
z16.object({
|
|
1798
1938
|
program: identifier,
|
|
1799
1939
|
outcome: referralOutcomeSchema
|
|
1800
1940
|
})
|
|
1801
1941
|
),
|
|
1802
|
-
streakMilestone:
|
|
1942
|
+
streakMilestone: z16.boolean()
|
|
1803
1943
|
});
|
|
1804
|
-
var accessSchema =
|
|
1805
|
-
actor:
|
|
1806
|
-
organization:
|
|
1807
|
-
admin:
|
|
1808
|
-
local:
|
|
1809
|
-
projects:
|
|
1944
|
+
var accessSchema = z16.object({
|
|
1945
|
+
actor: z16.string(),
|
|
1946
|
+
organization: z16.string(),
|
|
1947
|
+
admin: z16.boolean(),
|
|
1948
|
+
local: z16.boolean(),
|
|
1949
|
+
projects: z16.array(projectSchema)
|
|
1810
1950
|
});
|
|
1811
|
-
var querySchema =
|
|
1812
|
-
q:
|
|
1813
|
-
filter:
|
|
1814
|
-
offset:
|
|
1815
|
-
limit:
|
|
1951
|
+
var querySchema = z16.object({
|
|
1952
|
+
q: z16.string().max(200).default(""),
|
|
1953
|
+
filter: z16.string().max(50).default("all"),
|
|
1954
|
+
offset: z16.coerce.number().int().min(0).max(1e6).default(0),
|
|
1955
|
+
limit: z16.coerce.number().int().min(1).max(100).default(25)
|
|
1816
1956
|
});
|
|
1817
|
-
var accountProfileSchema =
|
|
1818
|
-
name:
|
|
1957
|
+
var accountProfileSchema = z16.object({
|
|
1958
|
+
name: z16.string().optional(),
|
|
1819
1959
|
/** The account's handle, where the provider has one (X and Discord). */
|
|
1820
|
-
username:
|
|
1821
|
-
email:
|
|
1822
|
-
emailVerified:
|
|
1823
|
-
imageUrl:
|
|
1960
|
+
username: z16.string().optional(),
|
|
1961
|
+
email: z16.string().optional(),
|
|
1962
|
+
emailVerified: z16.boolean().default(false),
|
|
1963
|
+
imageUrl: z16.string().url().optional()
|
|
1824
1964
|
});
|
|
1825
|
-
var memberAccountSchema =
|
|
1965
|
+
var memberAccountSchema = z16.object({
|
|
1826
1966
|
/** `wallet` for wallet sign-in, `account` for every other connected account. */
|
|
1827
|
-
kind:
|
|
1828
|
-
provider:
|
|
1829
|
-
subject:
|
|
1830
|
-
signInEnabled:
|
|
1967
|
+
kind: z16.enum(["account", "wallet"]),
|
|
1968
|
+
provider: z16.string(),
|
|
1969
|
+
subject: z16.string(),
|
|
1970
|
+
signInEnabled: z16.boolean(),
|
|
1831
1971
|
profile: accountProfileSchema.optional()
|
|
1832
1972
|
});
|
|
1833
|
-
var operationSchema =
|
|
1834
|
-
target:
|
|
1835
|
-
paused:
|
|
1836
|
-
revision:
|
|
1837
|
-
reason:
|
|
1838
|
-
actor:
|
|
1839
|
-
changedAt:
|
|
1973
|
+
var operationSchema = z16.object({
|
|
1974
|
+
target: z16.string(),
|
|
1975
|
+
paused: z16.boolean(),
|
|
1976
|
+
revision: z16.number().int(),
|
|
1977
|
+
reason: z16.string(),
|
|
1978
|
+
actor: z16.string().nullable(),
|
|
1979
|
+
changedAt: z16.number()
|
|
1840
1980
|
});
|
|
1841
|
-
var operationInputSchema =
|
|
1842
|
-
target:
|
|
1843
|
-
|
|
1844
|
-
|
|
1981
|
+
var operationInputSchema = z16.object({
|
|
1982
|
+
target: z16.union([
|
|
1983
|
+
z16.literal("redemptions"),
|
|
1984
|
+
z16.string().regex(/^quest:[\w-]+$/)
|
|
1845
1985
|
]),
|
|
1846
|
-
paused:
|
|
1847
|
-
revision:
|
|
1848
|
-
reason:
|
|
1986
|
+
paused: z16.boolean(),
|
|
1987
|
+
revision: z16.number().int().nonnegative(),
|
|
1988
|
+
reason: z16.string().trim().min(1).max(500),
|
|
1849
1989
|
actionId: identifier
|
|
1850
1990
|
}).strict();
|
|
1851
|
-
var questLifecycleInputSchema =
|
|
1991
|
+
var questLifecycleInputSchema = z16.object({
|
|
1852
1992
|
quest: identifier,
|
|
1853
1993
|
expectedRelease: identifier.optional(),
|
|
1854
|
-
archived:
|
|
1855
|
-
reason:
|
|
1994
|
+
archived: z16.boolean(),
|
|
1995
|
+
reason: z16.string().trim().min(1).max(500),
|
|
1856
1996
|
actionId: identifier
|
|
1857
1997
|
}).strict();
|
|
1858
|
-
var questLifecycleSchema =
|
|
1998
|
+
var questLifecycleSchema = z16.object({
|
|
1859
1999
|
quest: identifier,
|
|
1860
2000
|
key: identifier.nullable(),
|
|
1861
|
-
title:
|
|
2001
|
+
title: z16.string(),
|
|
1862
2002
|
release: identifier,
|
|
1863
|
-
lifecycle:
|
|
1864
|
-
changed:
|
|
2003
|
+
lifecycle: z16.enum(["active", "paused", "archived"]),
|
|
2004
|
+
changed: z16.boolean()
|
|
1865
2005
|
});
|
|
1866
|
-
var memberSchema =
|
|
1867
|
-
id:
|
|
1868
|
-
test:
|
|
1869
|
-
name:
|
|
1870
|
-
accounts:
|
|
1871
|
-
attempts:
|
|
1872
|
-
completions:
|
|
1873
|
-
rewards:
|
|
1874
|
-
lastActivity:
|
|
2006
|
+
var memberSchema = z16.object({
|
|
2007
|
+
id: z16.string(),
|
|
2008
|
+
test: z16.boolean().optional(),
|
|
2009
|
+
name: z16.string().nullable().optional(),
|
|
2010
|
+
accounts: z16.array(memberAccountSchema).default([]),
|
|
2011
|
+
attempts: z16.number(),
|
|
2012
|
+
completions: z16.number(),
|
|
2013
|
+
rewards: z16.number(),
|
|
2014
|
+
lastActivity: z16.number().nullable()
|
|
1875
2015
|
});
|
|
1876
|
-
var personSchema =
|
|
1877
|
-
id:
|
|
1878
|
-
test:
|
|
1879
|
-
name:
|
|
1880
|
-
accounts:
|
|
2016
|
+
var personSchema = z16.object({
|
|
2017
|
+
id: z16.string(),
|
|
2018
|
+
test: z16.boolean().optional(),
|
|
2019
|
+
name: z16.string().nullable().optional(),
|
|
2020
|
+
accounts: z16.array(memberAccountSchema).default([])
|
|
1881
2021
|
});
|
|
1882
|
-
var metricsSchema =
|
|
1883
|
-
quests:
|
|
1884
|
-
members:
|
|
1885
|
-
attempts:
|
|
1886
|
-
completions:
|
|
1887
|
-
review:
|
|
1888
|
-
failed:
|
|
1889
|
-
entitlements:
|
|
2022
|
+
var metricsSchema = z16.object({
|
|
2023
|
+
quests: z16.number(),
|
|
2024
|
+
members: z16.number(),
|
|
2025
|
+
attempts: z16.number(),
|
|
2026
|
+
completions: z16.number(),
|
|
2027
|
+
review: z16.number(),
|
|
2028
|
+
failed: z16.number(),
|
|
2029
|
+
entitlements: z16.number()
|
|
1890
2030
|
});
|
|
1891
|
-
var readinessSchema =
|
|
1892
|
-
checks:
|
|
1893
|
-
|
|
1894
|
-
id:
|
|
1895
|
-
status:
|
|
1896
|
-
title:
|
|
1897
|
-
detail:
|
|
2031
|
+
var readinessSchema = z16.object({
|
|
2032
|
+
checks: z16.array(
|
|
2033
|
+
z16.object({
|
|
2034
|
+
id: z16.string(),
|
|
2035
|
+
status: z16.enum(["ready", "blocked"]),
|
|
2036
|
+
title: z16.string(),
|
|
2037
|
+
detail: z16.string()
|
|
1898
2038
|
})
|
|
1899
2039
|
)
|
|
1900
2040
|
});
|
|
1901
|
-
var inventorySchema =
|
|
1902
|
-
item:
|
|
1903
|
-
name:
|
|
1904
|
-
available:
|
|
1905
|
-
reserved:
|
|
1906
|
-
allocated:
|
|
2041
|
+
var inventorySchema = z16.object({
|
|
2042
|
+
item: z16.string(),
|
|
2043
|
+
name: z16.string().nullable().default(null),
|
|
2044
|
+
available: z16.number(),
|
|
2045
|
+
reserved: z16.number(),
|
|
2046
|
+
allocated: z16.number().default(0)
|
|
1907
2047
|
});
|
|
1908
|
-
var auditRecordSchema =
|
|
1909
|
-
id:
|
|
1910
|
-
action:
|
|
1911
|
-
actor:
|
|
2048
|
+
var auditRecordSchema = z16.object({
|
|
2049
|
+
id: z16.string(),
|
|
2050
|
+
action: z16.string(),
|
|
2051
|
+
actor: z16.string().nullable(),
|
|
1912
2052
|
user: operatorUserSchema.nullable().optional(),
|
|
1913
|
-
detail:
|
|
1914
|
-
at:
|
|
1915
|
-
attempt:
|
|
1916
|
-
}).refine((
|
|
2053
|
+
detail: z16.string(),
|
|
2054
|
+
at: z16.number(),
|
|
2055
|
+
attempt: z16.string().nullable()
|
|
2056
|
+
}).refine((record6) => !record6.user || record6.user.id === record6.actor, {
|
|
1917
2057
|
message: "User profile must match the recorded actor",
|
|
1918
2058
|
path: ["user"]
|
|
1919
2059
|
});
|
|
1920
|
-
var pageSchema =
|
|
2060
|
+
var pageSchema = z16.object({
|
|
1921
2061
|
snapshot: snapshotSchema,
|
|
1922
|
-
members:
|
|
1923
|
-
people:
|
|
2062
|
+
members: z16.array(memberSchema),
|
|
2063
|
+
people: z16.array(personSchema).default([]),
|
|
1924
2064
|
metrics: metricsSchema,
|
|
1925
|
-
total:
|
|
1926
|
-
offset:
|
|
1927
|
-
limit:
|
|
1928
|
-
inventory:
|
|
1929
|
-
operations:
|
|
1930
|
-
audit:
|
|
1931
|
-
questCounts:
|
|
2065
|
+
total: z16.number(),
|
|
2066
|
+
offset: z16.number(),
|
|
2067
|
+
limit: z16.number(),
|
|
2068
|
+
inventory: z16.array(inventorySchema),
|
|
2069
|
+
operations: z16.array(operationSchema).default([]),
|
|
2070
|
+
audit: z16.array(auditRecordSchema).default([]),
|
|
2071
|
+
questCounts: z16.record(z16.string(), z16.number())
|
|
1932
2072
|
});
|
|
1933
|
-
var managedOAuthAccountBaseSchema =
|
|
1934
|
-
provider:
|
|
1935
|
-
revision:
|
|
2073
|
+
var managedOAuthAccountBaseSchema = z16.object({
|
|
2074
|
+
provider: z16.enum(["x", "discord"]),
|
|
2075
|
+
revision: z16.number().int().nonnegative()
|
|
1936
2076
|
});
|
|
1937
|
-
var managedOAuthAccountSchema =
|
|
2077
|
+
var managedOAuthAccountSchema = z16.discriminatedUnion("status", [
|
|
1938
2078
|
managedOAuthAccountBaseSchema.extend({
|
|
1939
|
-
status:
|
|
1940
|
-
subject:
|
|
1941
|
-
linkedAt:
|
|
2079
|
+
status: z16.literal("connected"),
|
|
2080
|
+
subject: z16.string().min(1),
|
|
2081
|
+
linkedAt: z16.number(),
|
|
1942
2082
|
/**
|
|
1943
2083
|
* True when a member import attached the account with the organization's word for it, not the
|
|
1944
2084
|
* member's proof. Absent from Relay versions without imports.
|
|
1945
2085
|
*/
|
|
1946
|
-
imported:
|
|
2086
|
+
imported: z16.boolean().optional()
|
|
1947
2087
|
}),
|
|
1948
|
-
managedOAuthAccountBaseSchema.extend({ status:
|
|
2088
|
+
managedOAuthAccountBaseSchema.extend({ status: z16.literal("disconnected") })
|
|
1949
2089
|
]);
|
|
1950
2090
|
var managedTelegramAccountBaseSchema = managedOAuthAccountBaseSchema.extend({
|
|
1951
|
-
provider:
|
|
2091
|
+
provider: z16.literal("telegram")
|
|
1952
2092
|
});
|
|
1953
|
-
var managedTelegramAccountSchema =
|
|
2093
|
+
var managedTelegramAccountSchema = z16.discriminatedUnion("status", [
|
|
1954
2094
|
managedTelegramAccountBaseSchema.extend({
|
|
1955
|
-
status:
|
|
2095
|
+
status: z16.literal("connected"),
|
|
1956
2096
|
/** The numeric Telegram user ID. */
|
|
1957
|
-
subject:
|
|
1958
|
-
linkedAt:
|
|
2097
|
+
subject: z16.string().min(1),
|
|
2098
|
+
linkedAt: z16.number()
|
|
1959
2099
|
}),
|
|
1960
2100
|
managedTelegramAccountBaseSchema.extend({
|
|
1961
|
-
status:
|
|
2101
|
+
status: z16.literal("disconnected")
|
|
1962
2102
|
})
|
|
1963
2103
|
]);
|
|
1964
|
-
var memberOAuthUnlinkInputSchema =
|
|
1965
|
-
provider:
|
|
1966
|
-
subject:
|
|
1967
|
-
revision:
|
|
1968
|
-
reason:
|
|
2104
|
+
var memberOAuthUnlinkInputSchema = z16.object({
|
|
2105
|
+
provider: z16.enum(["x", "discord"]),
|
|
2106
|
+
subject: z16.string().min(1).max(4096),
|
|
2107
|
+
revision: z16.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER - 1),
|
|
2108
|
+
reason: z16.string().trim().min(1).max(500)
|
|
1969
2109
|
}).strict();
|
|
1970
2110
|
var memberTelegramUnlinkInputSchema = memberOAuthUnlinkInputSchema.omit({ provider: true }).strict();
|
|
1971
2111
|
var managedWalletSchema = linkedWalletSchema.extend({
|
|
@@ -1973,27 +2113,27 @@ var managedWalletSchema = linkedWalletSchema.extend({
|
|
|
1973
2113
|
* True when a member import attached the wallet with the organization's word for it, and the
|
|
1974
2114
|
* member has not proved it since. Absent from Relay versions without imports.
|
|
1975
2115
|
*/
|
|
1976
|
-
imported:
|
|
1977
|
-
status:
|
|
1978
|
-
unlinkedAt:
|
|
2116
|
+
imported: z16.boolean().optional(),
|
|
2117
|
+
status: z16.enum(["linked", "unlinked"]),
|
|
2118
|
+
unlinkedAt: z16.number().int().nullable(),
|
|
1979
2119
|
/** "member", or the operator or key that unlinked it. */
|
|
1980
|
-
unlinkedBy:
|
|
2120
|
+
unlinkedBy: z16.string().nullable()
|
|
1981
2121
|
});
|
|
1982
2122
|
var managedMemberIdentitySchema = memberIdentitySchema.extend({
|
|
1983
2123
|
/**
|
|
1984
2124
|
* True for an X account a member import attached, until the member links or signs in with it
|
|
1985
2125
|
* through X. Absent from Relay versions without imports.
|
|
1986
2126
|
*/
|
|
1987
|
-
imported:
|
|
1988
|
-
status:
|
|
1989
|
-
unlinkedAt:
|
|
2127
|
+
imported: z16.boolean().optional(),
|
|
2128
|
+
status: z16.enum(["linked", "unlinked"]),
|
|
2129
|
+
unlinkedAt: z16.number().int().nullable(),
|
|
1990
2130
|
/** The operator or key that unlinked it. */
|
|
1991
|
-
unlinkedBy:
|
|
2131
|
+
unlinkedBy: z16.string().nullable()
|
|
1992
2132
|
});
|
|
1993
|
-
var memberIdentityChangeInputSchema =
|
|
2133
|
+
var memberIdentityChangeInputSchema = z16.object({
|
|
1994
2134
|
kind: appIdentityKindSchema,
|
|
1995
|
-
subject:
|
|
1996
|
-
reason:
|
|
2135
|
+
subject: z16.string().min(1).max(256),
|
|
2136
|
+
reason: z16.string().trim().min(1).max(500)
|
|
1997
2137
|
}).strict();
|
|
1998
2138
|
var balanceCheckSchema = walletBalanceSchema.pick({
|
|
1999
2139
|
chain: true,
|
|
@@ -2003,76 +2143,76 @@ var balanceCheckSchema = walletBalanceSchema.pick({
|
|
|
2003
2143
|
wallets: true,
|
|
2004
2144
|
observedAt: true
|
|
2005
2145
|
}).extend({ attempt: identifier });
|
|
2006
|
-
var walletBalanceChainsSchema =
|
|
2007
|
-
chains:
|
|
2008
|
-
|
|
2009
|
-
chain:
|
|
2010
|
-
|
|
2146
|
+
var walletBalanceChainsSchema = z16.object({
|
|
2147
|
+
chains: z16.array(
|
|
2148
|
+
z16.object({
|
|
2149
|
+
chain: z16.union([
|
|
2150
|
+
z16.literal(solanaMainnet),
|
|
2011
2151
|
cosmosNetworkSchema,
|
|
2012
2152
|
evmChainIdSchema
|
|
2013
2153
|
]),
|
|
2014
|
-
name:
|
|
2015
|
-
testnet:
|
|
2154
|
+
name: z16.string(),
|
|
2155
|
+
testnet: z16.boolean()
|
|
2016
2156
|
})
|
|
2017
2157
|
)
|
|
2018
2158
|
});
|
|
2019
|
-
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason:
|
|
2159
|
+
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason: z16.string().trim().min(1).max(500) }).strict();
|
|
2020
2160
|
var memberWalletSignInInputSchema = walletUnlinkInputSchema.extend({
|
|
2021
|
-
enabled:
|
|
2022
|
-
reason:
|
|
2161
|
+
enabled: z16.boolean(),
|
|
2162
|
+
reason: z16.string().trim().min(1).max(500)
|
|
2023
2163
|
}).strict();
|
|
2024
|
-
var telegramBotIdSchema =
|
|
2025
|
-
var participantSignInSchema =
|
|
2026
|
-
providers:
|
|
2027
|
-
|
|
2164
|
+
var telegramBotIdSchema = z16.string().regex(/^[1-9][0-9]{0,19}$/, "Enter the bot's numeric ID, such as 123456789");
|
|
2165
|
+
var participantSignInSchema = z16.object({
|
|
2166
|
+
providers: z16.array(
|
|
2167
|
+
z16.object({ provider: authProviderSchema, configured: z16.boolean() })
|
|
2028
2168
|
),
|
|
2029
|
-
email:
|
|
2169
|
+
email: z16.boolean(),
|
|
2030
2170
|
/** Wallet families: `"solana"`, `"eip155"`, `"cosmos"`. */
|
|
2031
2171
|
wallets: walletSignInNetworksSchema,
|
|
2032
2172
|
/** Why participants cannot sign in to this project, or null. */
|
|
2033
|
-
issue:
|
|
2173
|
+
issue: z16.string().nullable(),
|
|
2034
2174
|
/**
|
|
2035
2175
|
* Telegram, outside `providers` in SDK 1.x: whether Domino configured Telegram Login, and the
|
|
2036
2176
|
* bot whose Mini App participants sign in from, or null when Mini App sign-in is off. Absent
|
|
2037
2177
|
* from Relay versions without Telegram.
|
|
2038
2178
|
*/
|
|
2039
|
-
telegram:
|
|
2040
|
-
login:
|
|
2179
|
+
telegram: z16.object({
|
|
2180
|
+
login: z16.boolean(),
|
|
2041
2181
|
miniAppBotId: telegramBotIdSchema.nullable()
|
|
2042
2182
|
}).optional(),
|
|
2043
|
-
updatedAt:
|
|
2044
|
-
updatedBy:
|
|
2183
|
+
updatedAt: z16.number().nullable(),
|
|
2184
|
+
updatedBy: z16.string().nullable()
|
|
2045
2185
|
});
|
|
2046
|
-
var participantSignInInputSchema =
|
|
2186
|
+
var participantSignInInputSchema = z16.object({
|
|
2047
2187
|
wallets: walletSignInNetworksSchema,
|
|
2048
|
-
telegram:
|
|
2188
|
+
telegram: z16.object({ miniAppBotId: telegramBotIdSchema.nullable() }).strict().optional()
|
|
2049
2189
|
}).strict();
|
|
2050
|
-
var completionRevocationShortfallSchema =
|
|
2190
|
+
var completionRevocationShortfallSchema = z16.object({
|
|
2051
2191
|
completion: identifier,
|
|
2052
2192
|
quest: identifier,
|
|
2053
|
-
revokedAt:
|
|
2054
|
-
unreversedPoints:
|
|
2193
|
+
revokedAt: z16.number().int().nonnegative().safe(),
|
|
2194
|
+
unreversedPoints: z16.record(identifier, z16.number().int().positive().safe())
|
|
2055
2195
|
});
|
|
2056
|
-
var memberDetailSchema =
|
|
2196
|
+
var memberDetailSchema = z16.object({
|
|
2057
2197
|
snapshot: snapshotSchema,
|
|
2058
2198
|
member: memberSchema,
|
|
2059
2199
|
progress: memberProgressSchema,
|
|
2060
2200
|
/** Up to 25 revoked completions with an unreversed point remainder, newest first. */
|
|
2061
|
-
revocationShortfalls:
|
|
2201
|
+
revocationShortfalls: z16.array(completionRevocationShortfallSchema).default([]),
|
|
2062
2202
|
/** Current and historical campaign enrollment state, including inactive enrollments. */
|
|
2063
|
-
campaignEnrollments:
|
|
2064
|
-
passes:
|
|
2065
|
-
|
|
2066
|
-
provider:
|
|
2067
|
-
event:
|
|
2068
|
-
subject:
|
|
2203
|
+
campaignEnrollments: z16.array(campaignEnrollmentSchema).default([]),
|
|
2204
|
+
passes: z16.array(
|
|
2205
|
+
z16.object({
|
|
2206
|
+
provider: z16.string(),
|
|
2207
|
+
event: z16.string(),
|
|
2208
|
+
subject: z16.string(),
|
|
2069
2209
|
attempt: identifier.nullable()
|
|
2070
2210
|
})
|
|
2071
2211
|
).default([]),
|
|
2072
2212
|
/** Linked and unlinked wallets. */
|
|
2073
|
-
wallets:
|
|
2213
|
+
wallets: z16.array(managedWalletSchema),
|
|
2074
2214
|
/** The member's 10 most recent recorded balance reads, newest first. */
|
|
2075
|
-
balanceChecks:
|
|
2215
|
+
balanceChecks: z16.array(balanceCheckSchema),
|
|
2076
2216
|
/** The member's participant profile in this project. */
|
|
2077
2217
|
profile: managedProfileSchema.nullable(),
|
|
2078
2218
|
/**
|
|
@@ -2080,11 +2220,11 @@ var memberDetailSchema = z15.object({
|
|
|
2080
2220
|
* member ID: their selected X and Discord accounts and their `app:<name>` identities in this
|
|
2081
2221
|
* project, including app identities an operator unlinked, by kind.
|
|
2082
2222
|
*/
|
|
2083
|
-
identities:
|
|
2223
|
+
identities: z16.array(managedMemberIdentitySchema)
|
|
2084
2224
|
});
|
|
2085
|
-
var managedMemberProgressSchema =
|
|
2225
|
+
var managedMemberProgressSchema = z16.object({
|
|
2086
2226
|
member: identifier,
|
|
2087
|
-
quests:
|
|
2227
|
+
quests: z16.array(
|
|
2088
2228
|
memberProgressSchema.shape.quests.element.extend({
|
|
2089
2229
|
/** The streak as `members.get` reports it, without the list of qualifying days. */
|
|
2090
2230
|
streak: streakProgressSchema.omit({ days: true }).nullable().optional()
|
|
@@ -2095,152 +2235,152 @@ var managedMemberProgressSchema = z15.object({
|
|
|
2095
2235
|
/** Each point balance the member has, by balance ID. */
|
|
2096
2236
|
balances: snapshotSchema.shape.balances
|
|
2097
2237
|
});
|
|
2098
|
-
var stockInputSchema =
|
|
2238
|
+
var stockInputSchema = z16.object({
|
|
2099
2239
|
item: identifier,
|
|
2100
|
-
quantity:
|
|
2240
|
+
quantity: z16.number().int().positive().max(1e6),
|
|
2101
2241
|
actionId: identifier
|
|
2102
2242
|
}).strict();
|
|
2103
|
-
var ingestTrackerScopeSchema =
|
|
2104
|
-
var tokenScopeInputSchema =
|
|
2105
|
-
var tokenInputSchema =
|
|
2106
|
-
name:
|
|
2243
|
+
var ingestTrackerScopeSchema = z16.array(identifier).min(1).max(100).nullable();
|
|
2244
|
+
var tokenScopeInputSchema = z16.object({ ingestTrackers: ingestTrackerScopeSchema }).strict();
|
|
2245
|
+
var tokenInputSchema = z16.object({
|
|
2246
|
+
name: z16.string().trim().min(1).max(80),
|
|
2107
2247
|
project: identifier,
|
|
2108
2248
|
environment: environmentSchema,
|
|
2109
|
-
permissions:
|
|
2249
|
+
permissions: z16.array(permissionSchema).min(1),
|
|
2110
2250
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
2111
|
-
days:
|
|
2251
|
+
days: z16.number().int().min(1).max(90).default(30)
|
|
2112
2252
|
}).strict();
|
|
2113
|
-
var tokenSchema =
|
|
2114
|
-
id:
|
|
2115
|
-
name:
|
|
2116
|
-
project:
|
|
2253
|
+
var tokenSchema = z16.object({
|
|
2254
|
+
id: z16.string(),
|
|
2255
|
+
name: z16.string(),
|
|
2256
|
+
project: z16.string(),
|
|
2117
2257
|
environment: environmentSchema,
|
|
2118
2258
|
permissions: permissionListSchema,
|
|
2119
2259
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
2120
|
-
expiresAt:
|
|
2260
|
+
expiresAt: z16.number()
|
|
2121
2261
|
});
|
|
2122
|
-
var issuedTokenSchema = tokenSchema.extend({ token:
|
|
2123
|
-
var serviceKeyInputSchema =
|
|
2124
|
-
name:
|
|
2125
|
-
permissions:
|
|
2262
|
+
var issuedTokenSchema = tokenSchema.extend({ token: z16.string() });
|
|
2263
|
+
var serviceKeyInputSchema = z16.object({
|
|
2264
|
+
name: z16.string().trim().min(1).max(80),
|
|
2265
|
+
permissions: z16.array(permissionSchema).min(1).refine(
|
|
2126
2266
|
(permissions) => !permissions.includes("access"),
|
|
2127
2267
|
"Service keys cannot hold the access permission"
|
|
2128
2268
|
),
|
|
2129
2269
|
/** Days until the first secret expires. Omit it for a key that never expires. */
|
|
2130
|
-
expiresInDays:
|
|
2270
|
+
expiresInDays: z16.number().int().min(1).max(3650).optional()
|
|
2131
2271
|
}).strict();
|
|
2132
|
-
var serviceKeySchema =
|
|
2133
|
-
id:
|
|
2134
|
-
organization:
|
|
2135
|
-
project:
|
|
2272
|
+
var serviceKeySchema = z16.object({
|
|
2273
|
+
id: z16.string().uuid(),
|
|
2274
|
+
organization: z16.string(),
|
|
2275
|
+
project: z16.string(),
|
|
2136
2276
|
environment: environmentSchema,
|
|
2137
|
-
name:
|
|
2277
|
+
name: z16.string(),
|
|
2138
2278
|
permissions: permissionListSchema,
|
|
2139
2279
|
/** The Clerk user ID of the administrator who created it. */
|
|
2140
|
-
createdBy:
|
|
2141
|
-
createdAt:
|
|
2280
|
+
createdBy: z16.string(),
|
|
2281
|
+
createdAt: z16.number(),
|
|
2142
2282
|
/** The latest use of any of its secrets, revoked ones included; null when none was used. */
|
|
2143
|
-
lastUsedAt:
|
|
2283
|
+
lastUsedAt: z16.number().nullable(),
|
|
2144
2284
|
/** Its working secrets, oldest first. Any of them authenticates the key. */
|
|
2145
|
-
secrets:
|
|
2285
|
+
secrets: z16.array(credentialSecretSchema)
|
|
2146
2286
|
});
|
|
2147
2287
|
var issuedServiceKeySchema = serviceKeySchema.extend({
|
|
2148
|
-
secret:
|
|
2149
|
-
token:
|
|
2288
|
+
secret: z16.string().uuid(),
|
|
2289
|
+
token: z16.string()
|
|
2150
2290
|
});
|
|
2151
|
-
var teamSchema =
|
|
2152
|
-
|
|
2291
|
+
var teamSchema = z16.array(
|
|
2292
|
+
z16.object({ id: z16.string(), label: z16.string() })
|
|
2153
2293
|
);
|
|
2154
|
-
var memberLookupSchema =
|
|
2155
|
-
provider:
|
|
2156
|
-
subject:
|
|
2294
|
+
var memberLookupSchema = z16.object({
|
|
2295
|
+
provider: z16.string().min(1).max(200),
|
|
2296
|
+
subject: z16.string().min(1).max(2048)
|
|
2157
2297
|
}).strict();
|
|
2158
|
-
var booleanQuery =
|
|
2159
|
-
|
|
2160
|
-
|
|
2298
|
+
var booleanQuery = z16.union([
|
|
2299
|
+
z16.boolean(),
|
|
2300
|
+
z16.enum(["true", "false"]).transform((v) => v === "true")
|
|
2161
2301
|
]);
|
|
2162
|
-
var managedMemberQuerySchema =
|
|
2163
|
-
q:
|
|
2302
|
+
var managedMemberQuerySchema = z16.strictObject({
|
|
2303
|
+
q: z16.string().max(200).optional(),
|
|
2164
2304
|
needsReview: booleanQuery.optional(),
|
|
2165
|
-
limit:
|
|
2305
|
+
limit: z16.coerce.number().int().min(1).max(100).optional(),
|
|
2166
2306
|
cursor: pageCursorSchema.optional()
|
|
2167
2307
|
});
|
|
2168
|
-
var managedMemberPageSchema =
|
|
2169
|
-
items:
|
|
2170
|
-
total:
|
|
2171
|
-
nextCursor:
|
|
2308
|
+
var managedMemberPageSchema = z16.object({
|
|
2309
|
+
items: z16.array(memberSchema),
|
|
2310
|
+
total: z16.number().int().nonnegative(),
|
|
2311
|
+
nextCursor: z16.string().nullable()
|
|
2172
2312
|
});
|
|
2173
2313
|
var projectMetricsSchema = metricsSchema.extend({
|
|
2174
|
-
completionsByQuest:
|
|
2175
|
-
|
|
2314
|
+
completionsByQuest: z16.array(
|
|
2315
|
+
z16.object({ quest: identifier, completions: z16.number() })
|
|
2176
2316
|
)
|
|
2177
2317
|
});
|
|
2178
|
-
var pageLimit =
|
|
2179
|
-
var managedAttemptQuerySchema =
|
|
2180
|
-
q:
|
|
2181
|
-
status:
|
|
2318
|
+
var pageLimit = z16.coerce.number().int().min(1).max(100).optional();
|
|
2319
|
+
var managedAttemptQuerySchema = z16.strictObject({
|
|
2320
|
+
q: z16.string().max(200).optional(),
|
|
2321
|
+
status: z16.string().min(1).max(50).optional(),
|
|
2182
2322
|
limit: pageLimit,
|
|
2183
2323
|
cursor: pageCursorSchema.optional()
|
|
2184
2324
|
});
|
|
2185
|
-
var managedAttemptPageSchema =
|
|
2186
|
-
items:
|
|
2187
|
-
releases:
|
|
2188
|
-
people:
|
|
2189
|
-
total:
|
|
2190
|
-
nextCursor:
|
|
2325
|
+
var managedAttemptPageSchema = z16.object({
|
|
2326
|
+
items: z16.array(attemptSchema),
|
|
2327
|
+
releases: z16.array(publishedReleaseSchema),
|
|
2328
|
+
people: z16.array(personSchema),
|
|
2329
|
+
total: z16.number().int().nonnegative(),
|
|
2330
|
+
nextCursor: z16.string().nullable()
|
|
2191
2331
|
});
|
|
2192
|
-
var managedReleaseQuerySchema =
|
|
2332
|
+
var managedReleaseQuerySchema = z16.strictObject({
|
|
2193
2333
|
quest: identifier.optional(),
|
|
2194
2334
|
limit: pageLimit,
|
|
2195
2335
|
cursor: pageCursorSchema.optional()
|
|
2196
2336
|
});
|
|
2197
|
-
var managedReleasePageSchema =
|
|
2198
|
-
items:
|
|
2199
|
-
nextCursor:
|
|
2337
|
+
var managedReleasePageSchema = z16.object({
|
|
2338
|
+
items: z16.array(publishedReleaseSchema),
|
|
2339
|
+
nextCursor: z16.string().nullable()
|
|
2200
2340
|
});
|
|
2201
|
-
var managedAttemptSchema =
|
|
2341
|
+
var managedAttemptSchema = z16.object({
|
|
2202
2342
|
attempt: attemptSchema,
|
|
2203
2343
|
release: publishedReleaseSchema.nullable(),
|
|
2204
|
-
events:
|
|
2344
|
+
events: z16.array(eventSchema),
|
|
2205
2345
|
person: personSchema
|
|
2206
2346
|
});
|
|
2207
|
-
var managedEntitlementQuerySchema =
|
|
2208
|
-
q:
|
|
2209
|
-
status:
|
|
2347
|
+
var managedEntitlementQuerySchema = z16.strictObject({
|
|
2348
|
+
q: z16.string().max(200).optional(),
|
|
2349
|
+
status: z16.string().min(1).max(50).optional(),
|
|
2210
2350
|
limit: pageLimit,
|
|
2211
2351
|
cursor: pageCursorSchema.optional()
|
|
2212
2352
|
});
|
|
2213
|
-
var managedEntitlementPageSchema =
|
|
2214
|
-
items:
|
|
2215
|
-
people:
|
|
2216
|
-
total:
|
|
2217
|
-
nextCursor:
|
|
2353
|
+
var managedEntitlementPageSchema = z16.object({
|
|
2354
|
+
items: z16.array(entitlementSchema),
|
|
2355
|
+
people: z16.array(personSchema),
|
|
2356
|
+
total: z16.number().int().nonnegative(),
|
|
2357
|
+
nextCursor: z16.string().nullable()
|
|
2218
2358
|
});
|
|
2219
|
-
var managedEntitlementSchema =
|
|
2359
|
+
var managedEntitlementSchema = z16.object({
|
|
2220
2360
|
entitlement: entitlementSchema,
|
|
2221
2361
|
person: personSchema
|
|
2222
2362
|
});
|
|
2223
2363
|
var managedStockItemSchema = inventorySchema.extend({
|
|
2224
|
-
offers:
|
|
2364
|
+
offers: z16.array(identifier)
|
|
2225
2365
|
});
|
|
2226
|
-
var auditQuerySchema =
|
|
2227
|
-
category:
|
|
2228
|
-
q:
|
|
2366
|
+
var auditQuerySchema = z16.strictObject({
|
|
2367
|
+
category: z16.enum(["reviews", "rewards", "configuration"]).optional(),
|
|
2368
|
+
q: z16.string().max(200).optional(),
|
|
2229
2369
|
limit: pageLimit,
|
|
2230
2370
|
cursor: pageCursorSchema.optional()
|
|
2231
2371
|
});
|
|
2232
2372
|
var accessHistoryQuerySchema = auditQuerySchema.omit({
|
|
2233
2373
|
category: true
|
|
2234
2374
|
});
|
|
2235
|
-
var auditPageSchema =
|
|
2236
|
-
items:
|
|
2237
|
-
total:
|
|
2238
|
-
nextCursor:
|
|
2375
|
+
var auditPageSchema = z16.object({
|
|
2376
|
+
items: z16.array(auditRecordSchema),
|
|
2377
|
+
total: z16.number().int().nonnegative(),
|
|
2378
|
+
nextCursor: z16.string().nullable()
|
|
2239
2379
|
});
|
|
2240
|
-
var verifiedPassSchema =
|
|
2380
|
+
var verifiedPassSchema = z16.object({
|
|
2241
2381
|
provider: identifier,
|
|
2242
2382
|
event: identifier,
|
|
2243
|
-
subject:
|
|
2383
|
+
subject: z16.string().min(1).max(2048),
|
|
2244
2384
|
member: identifier,
|
|
2245
2385
|
quest: identifier
|
|
2246
2386
|
}).strict();
|
|
@@ -2264,7 +2404,7 @@ function clientFailure(error) {
|
|
|
2264
2404
|
return new ManagementError({
|
|
2265
2405
|
kind: "client",
|
|
2266
2406
|
code: ManagementErrorCode.InvalidInput,
|
|
2267
|
-
message: error instanceof
|
|
2407
|
+
message: error instanceof z16.ZodError ? `Invalid management request: ${z16.prettifyError(error)}` : error instanceof Error ? error.message : "Invalid management request",
|
|
2268
2408
|
cause: error
|
|
2269
2409
|
});
|
|
2270
2410
|
}
|
|
@@ -2302,7 +2442,7 @@ function managementClient(options) {
|
|
|
2302
2442
|
call
|
|
2303
2443
|
);
|
|
2304
2444
|
}
|
|
2305
|
-
const ok =
|
|
2445
|
+
const ok = z16.object({ ok: z16.literal(true) });
|
|
2306
2446
|
function pointHistory(member, ledger, query = {}, call) {
|
|
2307
2447
|
return get(
|
|
2308
2448
|
`/points/${identifier.parse(member)}/${identifier.parse(ledger)}/history${queryString(typeof query === "number" ? { before: query } : pageQuerySchema.parse(query))}`,
|
|
@@ -2387,7 +2527,7 @@ function managementClient(options) {
|
|
|
2387
2527
|
const input = isInput ? inputOrCall ?? {} : {};
|
|
2388
2528
|
const options2 = isInput ? call : inputOrCall;
|
|
2389
2529
|
return post(
|
|
2390
|
-
`/webhooks/${
|
|
2530
|
+
`/webhooks/${z16.string().uuid().parse(id)}/rotate-secret`,
|
|
2391
2531
|
webhookSecretSchema,
|
|
2392
2532
|
webhookRotateInputSchema.parse(withActionId(input)),
|
|
2393
2533
|
options2
|
|
@@ -2435,8 +2575,8 @@ function managementClient(options) {
|
|
|
2435
2575
|
}
|
|
2436
2576
|
return exchange(
|
|
2437
2577
|
path,
|
|
2438
|
-
|
|
2439
|
-
status:
|
|
2578
|
+
z16.object({
|
|
2579
|
+
status: z16.number(),
|
|
2440
2580
|
operationId: identifier.optional(),
|
|
2441
2581
|
result: schema
|
|
2442
2582
|
}),
|
|
@@ -2491,7 +2631,7 @@ function managementClient(options) {
|
|
|
2491
2631
|
call
|
|
2492
2632
|
),
|
|
2493
2633
|
...resourceArchiveMethods("tracker"),
|
|
2494
|
-
list: (call) => get("/trackers",
|
|
2634
|
+
list: (call) => get("/trackers", z16.array(trackerStatusSchema), call),
|
|
2495
2635
|
get: (reference, call) => get(
|
|
2496
2636
|
`/trackers/${identifier.parse(reference)}`,
|
|
2497
2637
|
trackerStatusSchema,
|
|
@@ -2607,7 +2747,7 @@ function managementClient(options) {
|
|
|
2607
2747
|
engagementPublishSchema.parse(withActionId(input)),
|
|
2608
2748
|
call
|
|
2609
2749
|
),
|
|
2610
|
-
list: (call) => get("/engagement",
|
|
2750
|
+
list: (call) => get("/engagement", z16.array(engagementRuleSchema), call),
|
|
2611
2751
|
page: (input, call) => get(
|
|
2612
2752
|
"/engagement/history" + queryString(engagementPageQuerySchema.parse(input)),
|
|
2613
2753
|
engagementPageSchema,
|
|
@@ -2627,7 +2767,7 @@ function managementClient(options) {
|
|
|
2627
2767
|
)
|
|
2628
2768
|
},
|
|
2629
2769
|
badges: {
|
|
2630
|
-
list: (call) => get("/badges",
|
|
2770
|
+
list: (call) => get("/badges", z16.array(managedBadgeSchema), call),
|
|
2631
2771
|
create: (input, call) => create("/badges", managedBadgeSchema, createBadgeSchema, input, call),
|
|
2632
2772
|
update: (badge, input, call) => {
|
|
2633
2773
|
const body = badgePropertiesSchema.extend(badgeMutationSchema.shape).parse(withActionId(input));
|
|
@@ -2670,7 +2810,7 @@ function managementClient(options) {
|
|
|
2670
2810
|
},
|
|
2671
2811
|
pointLedgers: {
|
|
2672
2812
|
unarchive: (ledger, input, call) => archiveResource("point-ledger", ledger, false, input, call),
|
|
2673
|
-
list: (call) => get("/point-ledgers",
|
|
2813
|
+
list: (call) => get("/point-ledgers", z16.array(managedPointLedgerSchema), call),
|
|
2674
2814
|
/**
|
|
2675
2815
|
* Creates a point ledger, with a stable `key` when code refers to it; requires `publish`. In
|
|
2676
2816
|
* live, only a person in Console can create one.
|
|
@@ -2700,7 +2840,7 @@ function managementClient(options) {
|
|
|
2700
2840
|
},
|
|
2701
2841
|
points: {
|
|
2702
2842
|
/** @deprecated Use `pointLedgers.list()`, which reads the same ledgers. Removed in 2.0.0. */
|
|
2703
|
-
ledgers: (call) => get("/point-ledgers",
|
|
2843
|
+
ledgers: (call) => get("/point-ledgers", z16.array(managedPointLedgerSchema), call),
|
|
2704
2844
|
/** @deprecated Use `pointLedgers.create(input)`. Removed in 2.0.0. */
|
|
2705
2845
|
createLedger: createPointLedger,
|
|
2706
2846
|
/**
|
|
@@ -2738,7 +2878,7 @@ function managementClient(options) {
|
|
|
2738
2878
|
referralHistorySchema,
|
|
2739
2879
|
call
|
|
2740
2880
|
),
|
|
2741
|
-
list: (call) => get("/referrals",
|
|
2881
|
+
list: (call) => get("/referrals", z16.array(publishedReferralSchema), call),
|
|
2742
2882
|
participants: referralParticipants,
|
|
2743
2883
|
/**
|
|
2744
2884
|
* Suspends or restores a member's referral relationship, with a reason; requires `publish`.
|
|
@@ -2801,7 +2941,7 @@ function managementClient(options) {
|
|
|
2801
2941
|
},
|
|
2802
2942
|
leaderboards: {
|
|
2803
2943
|
...resourceArchiveMethods("leaderboard"),
|
|
2804
|
-
list: (call) => get("/leaderboards",
|
|
2944
|
+
list: (call) => get("/leaderboards", z16.array(publishedLeaderboardSchema), call),
|
|
2805
2945
|
standings: (board, input = {}, call) => {
|
|
2806
2946
|
const query = leaderboardQuerySchema.parse(input);
|
|
2807
2947
|
return get(
|
|
@@ -2815,13 +2955,13 @@ function managementClient(options) {
|
|
|
2815
2955
|
},
|
|
2816
2956
|
history: (board, call) => get(
|
|
2817
2957
|
`/leaderboards/${identifier.parse(board)}/history`,
|
|
2818
|
-
|
|
2958
|
+
z16.array(publishedLeaderboardSchema),
|
|
2819
2959
|
call
|
|
2820
2960
|
),
|
|
2821
2961
|
/** Current members of the board's exclusion group (`exclusionGroup`), by member ID. */
|
|
2822
2962
|
exclusions: (board, call) => get(
|
|
2823
2963
|
`/leaderboards/${identifier.parse(board)}/exclusions`,
|
|
2824
|
-
|
|
2964
|
+
z16.array(z16.object({ member: identifier })),
|
|
2825
2965
|
call
|
|
2826
2966
|
),
|
|
2827
2967
|
/**
|
|
@@ -2886,7 +3026,7 @@ function managementClient(options) {
|
|
|
2886
3026
|
),
|
|
2887
3027
|
settlements: (board, call) => get(
|
|
2888
3028
|
`/leaderboards/${identifier.parse(board)}/settlements`,
|
|
2889
|
-
|
|
3029
|
+
z16.array(leaderboardSettlementSummarySchema),
|
|
2890
3030
|
call
|
|
2891
3031
|
),
|
|
2892
3032
|
settlement: (settlement, call) => get(
|
|
@@ -2971,7 +3111,7 @@ function managementClient(options) {
|
|
|
2971
3111
|
*
|
|
2972
3112
|
* @deprecated Use `history`, which pages by `cursor` and `nextCursor`. Removed in 2.0.0.
|
|
2973
3113
|
*/
|
|
2974
|
-
list: (call) => get("/deployments",
|
|
3114
|
+
list: (call) => get("/deployments", z16.array(deploymentRecordSchema), call),
|
|
2975
3115
|
/**
|
|
2976
3116
|
* The project environment's deployments, newest first, one page at a time, with the two
|
|
2977
3117
|
* newest published deployments beside every page. Pass a page's `nextCursor` back as
|
|
@@ -2987,6 +3127,10 @@ function managementClient(options) {
|
|
|
2987
3127
|
deploymentRecordSchema,
|
|
2988
3128
|
call
|
|
2989
3129
|
),
|
|
3130
|
+
/**
|
|
3131
|
+
* Resolves a deployment against test without publishing it. Live refuses it with
|
|
3132
|
+
* `promotion-required`: code reaches live through a promotion from test.
|
|
3133
|
+
*/
|
|
2990
3134
|
preview: (input, call) => {
|
|
2991
3135
|
const { engagement, ...deployment } = projectDeploymentSchema.parse(input);
|
|
2992
3136
|
return post(
|
|
@@ -3002,6 +3146,64 @@ function managementClient(options) {
|
|
|
3002
3146
|
promote: promoteDeployment,
|
|
3003
3147
|
rollback: rollbackDeployment
|
|
3004
3148
|
},
|
|
3149
|
+
/**
|
|
3150
|
+
* Environment promotions: a reviewed request that makes live match test, for every definition
|
|
3151
|
+
* and the hosted app's active staged build. Prepare one with a client for the test environment;
|
|
3152
|
+
* a person approves or rejects it in Console, against live.
|
|
3153
|
+
*/
|
|
3154
|
+
promotions: {
|
|
3155
|
+
/**
|
|
3156
|
+
* Prepares a promotion of test as it is now and answers it `pending`, with what it changes in
|
|
3157
|
+
* live and the environment bindings live lacks. Refuses with `promotion-empty` when live
|
|
3158
|
+
* already matches. The action ID, generated when absent, makes a retry answer with the first
|
|
3159
|
+
* result. Requires `publish` in test.
|
|
3160
|
+
*/
|
|
3161
|
+
prepare: (input = {}, call) => post(
|
|
3162
|
+
"/promotions",
|
|
3163
|
+
promotionRecordSchema,
|
|
3164
|
+
promotionActionSchema.parse(withActionId(input)),
|
|
3165
|
+
call
|
|
3166
|
+
),
|
|
3167
|
+
/** The project's promotions, newest first, one page at a time. Pass `nextCursor` back as `cursor`. */
|
|
3168
|
+
history: (query = {}, call) => get(
|
|
3169
|
+
`/promotions/history${queryString(promotionHistoryQuerySchema.parse(query))}`,
|
|
3170
|
+
promotionHistoryPageSchema,
|
|
3171
|
+
call
|
|
3172
|
+
),
|
|
3173
|
+
get: (promotion, call) => get(
|
|
3174
|
+
`/promotions/${identifier.parse(promotion)}`,
|
|
3175
|
+
promotionRecordSchema,
|
|
3176
|
+
call
|
|
3177
|
+
),
|
|
3178
|
+
/**
|
|
3179
|
+
* Applies a pending promotion to live in one transaction. Live only, from a Console session
|
|
3180
|
+
* with `publish`; refuses with `promotion-changed` when test or live changed since it was
|
|
3181
|
+
* prepared.
|
|
3182
|
+
*/
|
|
3183
|
+
approve: (promotion, call) => post(
|
|
3184
|
+
`/promotions/${identifier.parse(promotion)}/approve`,
|
|
3185
|
+
promotionRecordSchema,
|
|
3186
|
+
{},
|
|
3187
|
+
call
|
|
3188
|
+
),
|
|
3189
|
+
/** Declines a pending promotion. Live only, from a Console session with `publish`. */
|
|
3190
|
+
reject: (promotion, input, call) => post(
|
|
3191
|
+
`/promotions/${identifier.parse(promotion)}/reject`,
|
|
3192
|
+
promotionRecordSchema,
|
|
3193
|
+
promotionRejectionSchema.parse(input),
|
|
3194
|
+
call
|
|
3195
|
+
),
|
|
3196
|
+
/**
|
|
3197
|
+
* Prepares a promotion of the definitions and build an applied promotion made live, for a
|
|
3198
|
+
* person to approve like any other. Requires `publish` in live.
|
|
3199
|
+
*/
|
|
3200
|
+
rollback: (promotion, input = {}, call) => post(
|
|
3201
|
+
`/promotions/${identifier.parse(promotion)}/rollback`,
|
|
3202
|
+
promotionRecordSchema,
|
|
3203
|
+
promotionActionSchema.parse(withActionId(input)),
|
|
3204
|
+
call
|
|
3205
|
+
)
|
|
3206
|
+
},
|
|
3005
3207
|
catalog: {
|
|
3006
3208
|
allocateQuest: (input = {}, call) => create(
|
|
3007
3209
|
"/catalog/quests",
|
|
@@ -3250,7 +3452,7 @@ function managementClient(options) {
|
|
|
3250
3452
|
},
|
|
3251
3453
|
operations: {
|
|
3252
3454
|
/** Every paused or resumed operation: redemptions and each quest's participation; requires `read`. */
|
|
3253
|
-
list: (call) => get("/operations",
|
|
3455
|
+
list: (call) => get("/operations", z16.array(operationSchema), call),
|
|
3254
3456
|
/**
|
|
3255
3457
|
* Pauses or resumes redemptions or one quest's participation, against the `revision` the
|
|
3256
3458
|
* operator saw, with a reason; requires `publish` permission.
|
|
@@ -3308,7 +3510,7 @@ function managementClient(options) {
|
|
|
3308
3510
|
call
|
|
3309
3511
|
),
|
|
3310
3512
|
/** Every stock item with its counts and the offers that sell it; requires `read` permission. */
|
|
3311
|
-
list: (call) => get("/stock-items",
|
|
3513
|
+
list: (call) => get("/stock-items", z16.array(managedStockItemSchema), call),
|
|
3312
3514
|
createItem: (input, call) => create(
|
|
3313
3515
|
"/stock-items",
|
|
3314
3516
|
stockItemSchema,
|
|
@@ -3323,7 +3525,7 @@ function managementClient(options) {
|
|
|
3323
3525
|
stockInputSchema.parse(withActionId(input)),
|
|
3324
3526
|
call
|
|
3325
3527
|
),
|
|
3326
|
-
catalog: (call) => get("/pickup-inventory",
|
|
3528
|
+
catalog: (call) => get("/pickup-inventory", z16.array(pickupCatalogSchema), call),
|
|
3327
3529
|
configure: (input, call) => post(
|
|
3328
3530
|
"/pickup-inventory",
|
|
3329
3531
|
pickupCatalogSchema,
|
|
@@ -3349,7 +3551,7 @@ function managementClient(options) {
|
|
|
3349
3551
|
offerControlSchema.omit({ enabled: true }).parse(withActionId(input)),
|
|
3350
3552
|
call
|
|
3351
3553
|
),
|
|
3352
|
-
list: (call) => get("/offers",
|
|
3554
|
+
list: (call) => get("/offers", z16.array(offerSchema), call),
|
|
3353
3555
|
/**
|
|
3354
3556
|
* Every redemption, or one member's, newest first, in one unbounded response.
|
|
3355
3557
|
*
|
|
@@ -3357,7 +3559,7 @@ function managementClient(options) {
|
|
|
3357
3559
|
*/
|
|
3358
3560
|
redemptions: (input = {}, call) => get(
|
|
3359
3561
|
`/redemptions${queryString({ member: input.member })}`,
|
|
3360
|
-
|
|
3562
|
+
z16.array(redemptionSchema),
|
|
3361
3563
|
call
|
|
3362
3564
|
),
|
|
3363
3565
|
/** Pauses or resumes an offer at the revision the operator saw. */
|
|
@@ -3406,7 +3608,7 @@ function managementClient(options) {
|
|
|
3406
3608
|
* them; API keys and project-scoped playground sessions cannot.
|
|
3407
3609
|
*/
|
|
3408
3610
|
tokens: {
|
|
3409
|
-
list: (call) => get("/tokens",
|
|
3611
|
+
list: (call) => get("/tokens", z16.array(tokenSchema), call),
|
|
3410
3612
|
/**
|
|
3411
3613
|
* Issues a key for one project and environment, limited to permissions the caller holds
|
|
3412
3614
|
* there. The secret `token` is in this response only.
|
|
@@ -3414,14 +3616,14 @@ function managementClient(options) {
|
|
|
3414
3616
|
create: (input, call) => post("/tokens", issuedTokenSchema, tokenInputSchema.parse(input), call),
|
|
3415
3617
|
/** Replace a personal key's ingestion restriction without changing its secret. */
|
|
3416
3618
|
scope: (id, input, call) => request(
|
|
3417
|
-
`/tokens/${encodeURIComponent(
|
|
3619
|
+
`/tokens/${encodeURIComponent(z16.string().min(1).parse(id))}/scope`,
|
|
3418
3620
|
tokenSchema,
|
|
3419
3621
|
tokenScopeInputSchema.parse(input),
|
|
3420
3622
|
"PUT",
|
|
3421
3623
|
call
|
|
3422
3624
|
),
|
|
3423
3625
|
revoke: (id, call) => request(
|
|
3424
|
-
`/tokens/${encodeURIComponent(
|
|
3626
|
+
`/tokens/${encodeURIComponent(z16.string().min(1).parse(id))}`,
|
|
3425
3627
|
ok,
|
|
3426
3628
|
void 0,
|
|
3427
3629
|
"DELETE",
|
|
@@ -3433,7 +3635,7 @@ function managementClient(options) {
|
|
|
3433
3635
|
* environment, owned by no person. Only an organization administrator in Console manages them.
|
|
3434
3636
|
*/
|
|
3435
3637
|
serviceKeys: {
|
|
3436
|
-
list: (call) => get("/service-keys",
|
|
3638
|
+
list: (call) => get("/service-keys", z16.array(serviceKeySchema), call),
|
|
3437
3639
|
/** The secret `token` is in this response only. */
|
|
3438
3640
|
create: (input, call) => post(
|
|
3439
3641
|
"/service-keys",
|
|
@@ -3446,14 +3648,14 @@ function managementClient(options) {
|
|
|
3446
3648
|
* them with `revokeSecret`. The new `token` is in this response only.
|
|
3447
3649
|
*/
|
|
3448
3650
|
addSecret: (id, input = {}, call) => post(
|
|
3449
|
-
`/service-keys/${
|
|
3651
|
+
`/service-keys/${z16.string().uuid().parse(id)}/secrets`,
|
|
3450
3652
|
issuedServiceKeySchema,
|
|
3451
3653
|
credentialSecretInputSchema.parse(input),
|
|
3452
3654
|
call
|
|
3453
3655
|
),
|
|
3454
3656
|
/** Stops one secret working. A key's last secret cannot be revoked; revoke the key instead. */
|
|
3455
3657
|
revokeSecret: (id, secret, call) => request(
|
|
3456
|
-
`/service-keys/${
|
|
3658
|
+
`/service-keys/${z16.string().uuid().parse(id)}/secrets/${z16.string().uuid().parse(secret)}`,
|
|
3457
3659
|
serviceKeySchema,
|
|
3458
3660
|
void 0,
|
|
3459
3661
|
"DELETE",
|
|
@@ -3461,8 +3663,8 @@ function managementClient(options) {
|
|
|
3461
3663
|
),
|
|
3462
3664
|
/** Deletes the key; every secret stops working. */
|
|
3463
3665
|
revoke: (id, call) => request(
|
|
3464
|
-
`/service-keys/${
|
|
3465
|
-
|
|
3666
|
+
`/service-keys/${z16.string().uuid().parse(id)}`,
|
|
3667
|
+
z16.null(),
|
|
3466
3668
|
void 0,
|
|
3467
3669
|
"DELETE",
|
|
3468
3670
|
call
|
|
@@ -3470,7 +3672,7 @@ function managementClient(options) {
|
|
|
3470
3672
|
},
|
|
3471
3673
|
/** Who holds which roles on the client's project; organization administrators only. */
|
|
3472
3674
|
grants: {
|
|
3473
|
-
list: (call) => get("/grants",
|
|
3675
|
+
list: (call) => get("/grants", z16.array(grantRecordSchema), call),
|
|
3474
3676
|
/** Replaces one person's roles and environments on the project. The audit log records it. */
|
|
3475
3677
|
set: (input, call) => request(
|
|
3476
3678
|
"/grants",
|
|
@@ -3487,7 +3689,7 @@ function managementClient(options) {
|
|
|
3487
3689
|
/** Signed activity notifications for one project/environment; writes require publish permission. */
|
|
3488
3690
|
webhooks: {
|
|
3489
3691
|
state: (id, call) => get(
|
|
3490
|
-
`/webhooks/${
|
|
3692
|
+
`/webhooks/${z16.string().uuid().parse(id)}/state`,
|
|
3491
3693
|
webhookEndpointStateSchema,
|
|
3492
3694
|
call
|
|
3493
3695
|
),
|
|
@@ -3498,24 +3700,24 @@ function managementClient(options) {
|
|
|
3498
3700
|
call
|
|
3499
3701
|
),
|
|
3500
3702
|
delete: (id, input, call) => post(
|
|
3501
|
-
`/webhooks/${
|
|
3703
|
+
`/webhooks/${z16.string().uuid().parse(id)}/delete`,
|
|
3502
3704
|
webhookEndpointStateSchema,
|
|
3503
3705
|
webhookDeleteInputSchema.parse(withActionId(input)),
|
|
3504
3706
|
call
|
|
3505
3707
|
),
|
|
3506
3708
|
pause: (id, input = {}, call) => post(
|
|
3507
|
-
`/webhooks/${
|
|
3709
|
+
`/webhooks/${z16.string().uuid().parse(id)}/pause`,
|
|
3508
3710
|
webhookEndpointSchema,
|
|
3509
3711
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
3510
3712
|
call
|
|
3511
3713
|
),
|
|
3512
3714
|
resume: (id, input = {}, call) => post(
|
|
3513
|
-
`/webhooks/${
|
|
3715
|
+
`/webhooks/${z16.string().uuid().parse(id)}/resume`,
|
|
3514
3716
|
webhookEndpointSchema,
|
|
3515
3717
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
3516
3718
|
call
|
|
3517
3719
|
),
|
|
3518
|
-
list: (call) => get("/webhooks",
|
|
3720
|
+
list: (call) => get("/webhooks", z16.array(webhookEndpointSchema), call),
|
|
3519
3721
|
/** Pass an `actionId` to recover the endpoint and its secret after a lost answer. */
|
|
3520
3722
|
create: (input, call) => post(
|
|
3521
3723
|
"/webhooks",
|
|
@@ -3524,7 +3726,7 @@ function managementClient(options) {
|
|
|
3524
3726
|
call
|
|
3525
3727
|
),
|
|
3526
3728
|
update: (id, input, call) => request(
|
|
3527
|
-
`/webhooks/${
|
|
3729
|
+
`/webhooks/${z16.string().uuid().parse(id)}`,
|
|
3528
3730
|
webhookEndpointSchema,
|
|
3529
3731
|
webhookUpdateSchema.parse(input),
|
|
3530
3732
|
"PUT",
|
|
@@ -3532,19 +3734,19 @@ function managementClient(options) {
|
|
|
3532
3734
|
),
|
|
3533
3735
|
/** @deprecated Use pause. Removed in 2.0.0. */
|
|
3534
3736
|
disable: (id, call) => post(
|
|
3535
|
-
`/webhooks/${
|
|
3737
|
+
`/webhooks/${z16.string().uuid().parse(id)}/disable`,
|
|
3536
3738
|
webhookEndpointSchema,
|
|
3537
3739
|
{},
|
|
3538
3740
|
call
|
|
3539
3741
|
),
|
|
3540
3742
|
rotateSecret: rotateWebhookSecret,
|
|
3541
3743
|
deliveries: (id, query = {}, call) => get(
|
|
3542
|
-
`/webhooks/${
|
|
3744
|
+
`/webhooks/${z16.string().uuid().parse(id)}/deliveries${queryString(webhookQuerySchema.parse(query))}`,
|
|
3543
3745
|
webhookDeliveryPageSchema,
|
|
3544
3746
|
call
|
|
3545
3747
|
),
|
|
3546
3748
|
replay: (id, delivery, call) => post(
|
|
3547
|
-
`/webhooks/${
|
|
3749
|
+
`/webhooks/${z16.string().uuid().parse(id)}/deliveries/${z16.string().uuid().parse(delivery)}/replay`,
|
|
3548
3750
|
webhookDeliverySchema,
|
|
3549
3751
|
{},
|
|
3550
3752
|
call
|
|
@@ -3555,7 +3757,7 @@ function managementClient(options) {
|
|
|
3555
3757
|
* environment. Organization administrators, from a Console session only.
|
|
3556
3758
|
*/
|
|
3557
3759
|
identityIntegrations: {
|
|
3558
|
-
list: (call) => get("/identity-integrations",
|
|
3760
|
+
list: (call) => get("/identity-integrations", z16.array(identityIntegrationSchema), call),
|
|
3559
3761
|
/** The secret `token` is in this response only. */
|
|
3560
3762
|
create: (input, call) => post(
|
|
3561
3763
|
"/identity-integrations",
|
|
@@ -3570,7 +3772,7 @@ function managementClient(options) {
|
|
|
3570
3772
|
* @deprecated Use `addSecret`, then `revokeSecret` the old secret once your app uses the new one.
|
|
3571
3773
|
*/
|
|
3572
3774
|
rotate: (id, call) => post(
|
|
3573
|
-
`/identity-integrations/${
|
|
3775
|
+
`/identity-integrations/${z16.string().uuid().parse(id)}/rotate`,
|
|
3574
3776
|
identityIntegrationSecretSchema,
|
|
3575
3777
|
{},
|
|
3576
3778
|
call
|
|
@@ -3580,7 +3782,7 @@ function managementClient(options) {
|
|
|
3580
3782
|
* revoke them with `revokeSecret`. The new `token` is in this response only.
|
|
3581
3783
|
*/
|
|
3582
3784
|
addSecret: (id, input = {}, call) => post(
|
|
3583
|
-
`/identity-integrations/${
|
|
3785
|
+
`/identity-integrations/${z16.string().uuid().parse(id)}/secrets`,
|
|
3584
3786
|
identityIntegrationSecretSchema,
|
|
3585
3787
|
credentialSecretInputSchema.parse(input),
|
|
3586
3788
|
call
|
|
@@ -3590,7 +3792,7 @@ function managementClient(options) {
|
|
|
3590
3792
|
* revoked; disconnect the integration with `revoke` instead.
|
|
3591
3793
|
*/
|
|
3592
3794
|
revokeSecret: (id, secret, call) => request(
|
|
3593
|
-
`/identity-integrations/${
|
|
3795
|
+
`/identity-integrations/${z16.string().uuid().parse(id)}/secrets/${z16.string().uuid().parse(secret)}`,
|
|
3594
3796
|
identityIntegrationSchema,
|
|
3595
3797
|
void 0,
|
|
3596
3798
|
"DELETE",
|
|
@@ -3598,7 +3800,7 @@ function managementClient(options) {
|
|
|
3598
3800
|
),
|
|
3599
3801
|
/** Makes one secret never expire. */
|
|
3600
3802
|
removeSecretExpiry: (id, secret, call) => request(
|
|
3601
|
-
`/identity-integrations/${
|
|
3803
|
+
`/identity-integrations/${z16.string().uuid().parse(id)}/secrets/${z16.string().uuid().parse(secret)}/expiry`,
|
|
3602
3804
|
identityIntegrationSchema,
|
|
3603
3805
|
void 0,
|
|
3604
3806
|
"DELETE",
|
|
@@ -3611,7 +3813,7 @@ function managementClient(options) {
|
|
|
3611
3813
|
*/
|
|
3612
3814
|
kinds: (call) => get(
|
|
3613
3815
|
"/identity-integrations/kinds",
|
|
3614
|
-
|
|
3816
|
+
z16.array(identityKindClaimSchema),
|
|
3615
3817
|
call
|
|
3616
3818
|
),
|
|
3617
3819
|
/**
|
|
@@ -3619,8 +3821,8 @@ function managementClient(options) {
|
|
|
3619
3821
|
* and keep attributing tracker records; unlink them on the member to stop that.
|
|
3620
3822
|
*/
|
|
3621
3823
|
revoke: (id, call) => request(
|
|
3622
|
-
`/identity-integrations/${
|
|
3623
|
-
|
|
3824
|
+
`/identity-integrations/${z16.string().uuid().parse(id)}`,
|
|
3825
|
+
z16.null(),
|
|
3624
3826
|
void 0,
|
|
3625
3827
|
"DELETE",
|
|
3626
3828
|
call
|
|
@@ -3671,7 +3873,7 @@ function managementClient(options) {
|
|
|
3671
3873
|
resources: {
|
|
3672
3874
|
list: (call) => get(
|
|
3673
3875
|
"/resources",
|
|
3674
|
-
|
|
3876
|
+
z16.object({ resources: z16.array(managedResourceSchema) }),
|
|
3675
3877
|
call
|
|
3676
3878
|
),
|
|
3677
3879
|
/** @deprecated Use the resource archive/unarchive methods. Removed in 2.0.0. */
|
|
@@ -3732,7 +3934,7 @@ function managementClient(options) {
|
|
|
3732
3934
|
),
|
|
3733
3935
|
/**
|
|
3734
3936
|
* Needs publish permission, in test only; hosted app keys cannot call these. Reset deletes the
|
|
3735
|
-
* member
|
|
3937
|
+
* member, frees its wallet addresses and removes its synthetic accounts and records.
|
|
3736
3938
|
*/
|
|
3737
3939
|
testMembers: {
|
|
3738
3940
|
create: (input, call) => post(
|
|
@@ -3741,7 +3943,7 @@ function managementClient(options) {
|
|
|
3741
3943
|
testMemberCreateSchema.parse(withActionId(input)),
|
|
3742
3944
|
call
|
|
3743
3945
|
),
|
|
3744
|
-
list: (call) => get("/test-members",
|
|
3946
|
+
list: (call) => get("/test-members", z16.array(testMemberSchema), call),
|
|
3745
3947
|
history: (member, query = {}, call) => get(
|
|
3746
3948
|
`/test-members/${identifier.parse(member)}/history${queryString(testMemberHistoryQuerySchema.parse(query))}`,
|
|
3747
3949
|
testMemberHistorySchema,
|
|
@@ -3777,6 +3979,18 @@ function managementClient(options) {
|
|
|
3777
3979
|
testMemberWalletUnlinkSchema.parse(withActionId(input)),
|
|
3778
3980
|
call
|
|
3779
3981
|
),
|
|
3982
|
+
/**
|
|
3983
|
+
* Writes one synthetic record into a managed X or Discord tracker as the test member, through
|
|
3984
|
+
* the same attribution and quest triggers as a collected record. The first record for a
|
|
3985
|
+
* provider links the member a synthetic X or Discord account; reset removes it and its
|
|
3986
|
+
* records.
|
|
3987
|
+
*/
|
|
3988
|
+
record: (member, input, call) => post(
|
|
3989
|
+
`/test-members/${identifier.parse(member)}/records`,
|
|
3990
|
+
testMemberRecordResultSchema,
|
|
3991
|
+
testMemberRecordSchema.parse(withActionId(input)),
|
|
3992
|
+
call
|
|
3993
|
+
),
|
|
3780
3994
|
reset: (member, input, call) => post(
|
|
3781
3995
|
`/test-members/${identifier.parse(member)}/reset`,
|
|
3782
3996
|
testMemberResetResultSchema,
|
|
@@ -3959,7 +4173,7 @@ function managementClient(options) {
|
|
|
3959
4173
|
/** Who each member is: up to 100 distinct IDs; unknown IDs come back without accounts. */
|
|
3960
4174
|
people: (members, call) => get(
|
|
3961
4175
|
`/people${queryString({ ids: members.join(",") })}`,
|
|
3962
|
-
|
|
4176
|
+
z16.array(personSchema),
|
|
3963
4177
|
call
|
|
3964
4178
|
),
|
|
3965
4179
|
/**
|
|
@@ -3969,7 +4183,7 @@ function managementClient(options) {
|
|
|
3969
4183
|
*/
|
|
3970
4184
|
oauthAccounts: (member, call) => get(
|
|
3971
4185
|
`/members/${encodeURIComponent(member)}/oauth-accounts`,
|
|
3972
|
-
|
|
4186
|
+
z16.array(managedOAuthAccountSchema),
|
|
3973
4187
|
call
|
|
3974
4188
|
),
|
|
3975
4189
|
/**
|
|
@@ -3979,7 +4193,7 @@ function managementClient(options) {
|
|
|
3979
4193
|
*/
|
|
3980
4194
|
unlinkOAuthAccount: (member, input, call) => post(
|
|
3981
4195
|
`/members/${encodeURIComponent(member)}/oauth-accounts/unlink`,
|
|
3982
|
-
|
|
4196
|
+
z16.array(managedOAuthAccountSchema),
|
|
3983
4197
|
memberOAuthUnlinkInputSchema.parse(input),
|
|
3984
4198
|
call
|
|
3985
4199
|
),
|
|
@@ -4012,7 +4226,7 @@ function managementClient(options) {
|
|
|
4012
4226
|
*/
|
|
4013
4227
|
unlinkWallet: (member, input, call) => post(
|
|
4014
4228
|
`/members/${encodeURIComponent(member)}/wallets/unlink`,
|
|
4015
|
-
|
|
4229
|
+
z16.array(managedWalletSchema),
|
|
4016
4230
|
memberWalletUnlinkInputSchema.parse(input),
|
|
4017
4231
|
call
|
|
4018
4232
|
),
|
|
@@ -4025,7 +4239,7 @@ function managementClient(options) {
|
|
|
4025
4239
|
*/
|
|
4026
4240
|
unlinkIdentity: (member, input, call) => post(
|
|
4027
4241
|
`/members/${encodeURIComponent(member)}/identities/unlink`,
|
|
4028
|
-
|
|
4242
|
+
z16.array(managedMemberIdentitySchema),
|
|
4029
4243
|
memberIdentityChangeInputSchema.parse(input),
|
|
4030
4244
|
call
|
|
4031
4245
|
),
|
|
@@ -4036,7 +4250,7 @@ function managementClient(options) {
|
|
|
4036
4250
|
*/
|
|
4037
4251
|
relinkIdentity: (member, input, call) => post(
|
|
4038
4252
|
`/members/${encodeURIComponent(member)}/identities/relink`,
|
|
4039
|
-
|
|
4253
|
+
z16.array(managedMemberIdentitySchema),
|
|
4040
4254
|
memberIdentityChangeInputSchema.parse(input),
|
|
4041
4255
|
call
|
|
4042
4256
|
),
|
|
@@ -4048,7 +4262,7 @@ function managementClient(options) {
|
|
|
4048
4262
|
*/
|
|
4049
4263
|
setWalletSignIn: (member, input, call) => post(
|
|
4050
4264
|
`/members/${encodeURIComponent(member)}/wallets/sign-in`,
|
|
4051
|
-
|
|
4265
|
+
z16.array(managedWalletSchema),
|
|
4052
4266
|
memberWalletSignInInputSchema.parse(input),
|
|
4053
4267
|
call
|
|
4054
4268
|
)
|
|
@@ -4131,7 +4345,7 @@ function managementClient(options) {
|
|
|
4131
4345
|
`/storage/sql/${appSecretNameSchema.parse(name)}/cell?${new URLSearchParams(
|
|
4132
4346
|
{
|
|
4133
4347
|
table,
|
|
4134
|
-
row: String(
|
|
4348
|
+
row: String(z16.number().int().min(0).parse(options2.row)),
|
|
4135
4349
|
column: options2.column,
|
|
4136
4350
|
...options2.cursor === void 0 ? {} : { cursor: pageCursorSchema.parse(options2.cursor) }
|
|
4137
4351
|
}
|
|
@@ -4243,7 +4457,7 @@ function managementClient(options) {
|
|
|
4243
4457
|
* Each quest's current release, the most recently published first, archived quests
|
|
4244
4458
|
* included; requires `read` permission.
|
|
4245
4459
|
*/
|
|
4246
|
-
list: (call) => get("/quests/list",
|
|
4460
|
+
list: (call) => get("/quests/list", z16.array(publishedReleaseSchema), call),
|
|
4247
4461
|
/** Pending and exhausted asynchronous balance checks. Requires read. */
|
|
4248
4462
|
automaticScheduling: (query = {}, call) => get(
|
|
4249
4463
|
`/quests/automatic-scheduling${queryString(automaticSchedulingQuerySchema.parse(query))}`,
|
|
@@ -4288,7 +4502,7 @@ function managementClient(options) {
|
|
|
4288
4502
|
*/
|
|
4289
4503
|
submissions: (member, call) => get(
|
|
4290
4504
|
`/members/${encodeURIComponent(member)}/quest-submissions`,
|
|
4291
|
-
|
|
4505
|
+
z16.object({ items: z16.array(questSubmissionSchema) }),
|
|
4292
4506
|
call
|
|
4293
4507
|
),
|
|
4294
4508
|
/**
|
|
@@ -4787,6 +5001,9 @@ var managementResponseSchemas = lazyResponseReaders({
|
|
|
4787
5001
|
get testMemberHistorySchema() {
|
|
4788
5002
|
return knownResponse(testMemberHistorySchema);
|
|
4789
5003
|
},
|
|
5004
|
+
get testMemberRecordResultSchema() {
|
|
5005
|
+
return knownResponse(testMemberRecordResultSchema);
|
|
5006
|
+
},
|
|
4790
5007
|
get testMemberResetResultSchema() {
|
|
4791
5008
|
return knownResponse(testMemberResetResultSchema);
|
|
4792
5009
|
},
|
|
@@ -4986,6 +5203,7 @@ var managementResponses = {
|
|
|
4986
5203
|
stockItemSchema: responseSchema(stockItemSchema),
|
|
4987
5204
|
teamSchema: responseSchema(teamSchema),
|
|
4988
5205
|
testMemberHistorySchema: responseSchema(testMemberHistorySchema),
|
|
5206
|
+
testMemberRecordResultSchema: responseSchema(testMemberRecordResultSchema),
|
|
4989
5207
|
testMemberResetResultSchema: responseSchema(testMemberResetResultSchema),
|
|
4990
5208
|
testMemberSchema: responseSchema(testMemberSchema),
|
|
4991
5209
|
tokenSchema: responseSchema(tokenSchema),
|
|
@@ -5219,6 +5437,16 @@ export {
|
|
|
5219
5437
|
projectTransferInputSchema,
|
|
5220
5438
|
projectTransferSchema,
|
|
5221
5439
|
projectUpdateInputSchema,
|
|
5440
|
+
promotionActionSchema,
|
|
5441
|
+
promotionBuildSchema,
|
|
5442
|
+
promotionChangeSchema,
|
|
5443
|
+
promotionHistoryPageSchema,
|
|
5444
|
+
promotionHistoryQuerySchema,
|
|
5445
|
+
promotionRecordSchema,
|
|
5446
|
+
promotionRejectionSchema,
|
|
5447
|
+
promotionResourceKindSchema,
|
|
5448
|
+
promotionSourceSchema,
|
|
5449
|
+
promotionWarningSchema,
|
|
5222
5450
|
querySchema,
|
|
5223
5451
|
questConfiguration,
|
|
5224
5452
|
questEnrollmentStateSchema,
|
|
@@ -5266,14 +5494,19 @@ export {
|
|
|
5266
5494
|
testMemberActionSchema,
|
|
5267
5495
|
testMemberAdvanceSchema,
|
|
5268
5496
|
testMemberCreateSchema,
|
|
5497
|
+
testMemberDiscordMessageSchema,
|
|
5498
|
+
testMemberDiscordReactionSchema,
|
|
5269
5499
|
testMemberHistoryQuerySchema,
|
|
5270
5500
|
testMemberHistorySchema,
|
|
5501
|
+
testMemberRecordResultSchema,
|
|
5502
|
+
testMemberRecordSchema,
|
|
5271
5503
|
testMemberResetResultSchema,
|
|
5272
5504
|
testMemberResetSchema,
|
|
5273
5505
|
testMemberSchema,
|
|
5274
5506
|
testMemberWalletLinkSchema,
|
|
5275
5507
|
testMemberWalletSchema,
|
|
5276
5508
|
testMemberWalletUnlinkSchema,
|
|
5509
|
+
testMemberXPostSchema,
|
|
5277
5510
|
tokenInputSchema,
|
|
5278
5511
|
tokenSchema,
|
|
5279
5512
|
tokenScopeInputSchema,
|