@domino-sdk/relay 1.11.1 → 1.15.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/README.md +1 -0
- package/build.mjs +15 -0
- package/dist/accounts-5ciAkCMP.d.ts +147 -0
- package/dist/{request-error-D_dUPLwo.d.ts → action-DBzILFx9.d.ts} +31 -1
- package/dist/attempt-captures-DHwIVoRP.d.ts +285 -0
- package/dist/authoring.d.ts +12 -10
- package/dist/authoring.js +6 -4
- package/dist/{automatic-outcomes-kPIDv6X_.d.ts → automatic-outcomes-BcEn_L46.d.ts} +1 -1
- package/dist/browser.d.ts +9 -9
- package/dist/browser.js +7 -6
- package/dist/capability-error-oTd3eYFH.d.ts +151 -0
- package/dist/chunk-2UAVZCMH.js +314 -0
- package/dist/{chunk-AGFUDCNM.js → chunk-3PPEXDWR.js} +1 -1
- package/dist/chunk-CHD6HHWG.js +485 -0
- package/dist/{chunk-T657WO56.js → chunk-LLMJ2SUT.js} +6 -2
- package/dist/chunk-NIYCAW2I.js +79 -0
- package/dist/{chunk-XK5E4HAS.js → chunk-PJXBW754.js} +80 -28
- package/dist/{chunk-PUDL4JBY.js → chunk-PUY35TH3.js} +2 -2
- package/dist/chunk-UJACD6K2.js +987 -0
- package/dist/chunk-W335CWYJ.js +53 -0
- package/dist/{chunk-X7ECZ3AK.js → chunk-XMBM2XD5.js} +1 -1
- package/dist/{chunk-2K2QBPAD.js → chunk-ZLYBUM7K.js} +6 -4
- package/dist/{client-fUSERMAC.d.ts → client-DFSCmf3H.d.ts} +27 -8
- package/dist/{activity-CNiPDPK6.d.ts → deployments-Ci6GyANg.d.ts} +15 -15
- package/dist/{groups-BK8ts2yK.d.ts → groups-Bi7lc54m.d.ts} +1 -1
- package/dist/{images-aw6W7vFZ.d.ts → images-Cb8QHGjn.d.ts} +1 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.js +8 -6
- package/dist/{capability-error-ty3SqD_b.d.ts → integrations-Cr9EhGI_.d.ts} +1 -149
- package/dist/internal.d.ts +11 -4
- package/dist/internal.js +8 -3
- package/dist/{offers-C2FANzrG.d.ts → offers-Catj06u7.d.ts} +2 -2
- package/dist/{pages-Chb6OZSB.d.ts → pages-CpYt56Km.d.ts} +1 -1
- package/dist/{participant-activity-DkL3nY5a.d.ts → participant-activity-DYdUUhw2.d.ts} +1 -0
- package/dist/portal-proxy.js +1 -1
- package/dist/react/index.d.ts +247 -179
- package/dist/react/index.js +954 -383
- package/dist/{schema-DEM8y8Fm.d.ts → schema-BaVl2VBS.d.ts} +1 -1
- package/dist/schema.d.ts +15 -13
- package/dist/schema.js +16 -14
- package/dist/server/index.d.ts +12 -70916
- package/dist/server/index.js +594 -841
- package/dist/{sign-in-options-iWOp9puZ.d.ts → sign-in-options-CU1ND6-y.d.ts} +2 -2
- package/dist/submission-input-Bi4HipqI.d.ts +146 -0
- package/dist/testing.d.ts +641 -0
- package/dist/testing.js +1282 -0
- package/dist/transport-0ttRwUat.d.ts +73361 -0
- package/package.json +6 -2
- package/dist/action-9Xl0StBg.d.ts +0 -33
- package/dist/chunk-OCXGG75K.js +0 -171
- package/dist/chunk-ZFABFKIY.js +0 -1295
- package/dist/referral-reward-kinds-M3f0PdiR.d.ts +0 -171
- package/dist/submission-input-BbBJTVlT.d.ts +0 -290
package/dist/server/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
attemptCaptureSchema,
|
|
3
|
+
capturedFactSchema
|
|
4
|
+
} from "../chunk-NIYCAW2I.js";
|
|
1
5
|
import {
|
|
2
6
|
activityTypeSchema,
|
|
3
7
|
activityTypes,
|
|
@@ -21,21 +25,30 @@ import {
|
|
|
21
25
|
publishDeploymentSchema,
|
|
22
26
|
rejectDeploymentSchema,
|
|
23
27
|
submitDeploymentSchema
|
|
24
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-ZLYBUM7K.js";
|
|
25
29
|
import "../chunk-MC6V6VMG.js";
|
|
26
30
|
import {
|
|
31
|
+
DEFAULT_MANAGEMENT_TIMEOUT,
|
|
32
|
+
ManagementError,
|
|
33
|
+
ManagementErrorCode,
|
|
27
34
|
REFERRAL_INTEGRATION_REWARD_ERROR,
|
|
35
|
+
actionIdOf,
|
|
28
36
|
containsReferralIntegrationReward,
|
|
29
37
|
identityIntegrationInputSchema,
|
|
30
38
|
identityIntegrationSchema,
|
|
31
39
|
identityIntegrationSecretSchema,
|
|
32
40
|
identityKindClaimSchema,
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
isManagementError,
|
|
42
|
+
managementErrorSchema,
|
|
43
|
+
managementTransport,
|
|
35
44
|
participantExchangeSchema,
|
|
36
45
|
questConfiguration,
|
|
37
46
|
sequenceCursorSchema
|
|
38
|
-
} from "../chunk-
|
|
47
|
+
} from "../chunk-CHD6HHWG.js";
|
|
48
|
+
import {
|
|
49
|
+
parseImageExtraction,
|
|
50
|
+
parseImageResult
|
|
51
|
+
} from "../chunk-W335CWYJ.js";
|
|
39
52
|
import {
|
|
40
53
|
imageAssetArtifactSchema
|
|
41
54
|
} from "../chunk-ZGH6NEG6.js";
|
|
@@ -52,7 +65,7 @@ import {
|
|
|
52
65
|
} from "../chunk-AXRMT33W.js";
|
|
53
66
|
import {
|
|
54
67
|
withActionId
|
|
55
|
-
} from "../chunk-
|
|
68
|
+
} from "../chunk-XMBM2XD5.js";
|
|
56
69
|
import {
|
|
57
70
|
allocateQuestSchema,
|
|
58
71
|
allocatedQuestSchema,
|
|
@@ -70,9 +83,8 @@ import {
|
|
|
70
83
|
rewardDeliveriesSchema,
|
|
71
84
|
rewardDeliverySchema,
|
|
72
85
|
saveQuestDraftSchema
|
|
73
|
-
} from "../chunk-
|
|
86
|
+
} from "../chunk-LLMJ2SUT.js";
|
|
74
87
|
import {
|
|
75
|
-
cosmosNetworkSchema,
|
|
76
88
|
createPointLedgerSchema,
|
|
77
89
|
engagementBoundaryPageSchema,
|
|
78
90
|
engagementChangePreviewInputSchema,
|
|
@@ -85,7 +97,6 @@ import {
|
|
|
85
97
|
engagementRuleVersionPageSchema,
|
|
86
98
|
engagementVersionPageSchema,
|
|
87
99
|
engagementVersionQuerySchema,
|
|
88
|
-
evmChainIdSchema,
|
|
89
100
|
leaderboardExclusionSchema,
|
|
90
101
|
leaderboardGroupSchema,
|
|
91
102
|
leaderboardPageSchema,
|
|
@@ -93,7 +104,6 @@ import {
|
|
|
93
104
|
leaderboardSettlementApprovalSchema,
|
|
94
105
|
leaderboardSettlementSchema,
|
|
95
106
|
leaderboardSettlementSummarySchema,
|
|
96
|
-
linkedWalletSchema,
|
|
97
107
|
managedPointHistoryPageSchema,
|
|
98
108
|
managedPointLedgerSchema,
|
|
99
109
|
managedProfileSchema,
|
|
@@ -116,26 +126,20 @@ import {
|
|
|
116
126
|
referralManagementSchema,
|
|
117
127
|
referralQualificationSchema,
|
|
118
128
|
referralRewardResolutionSchema,
|
|
119
|
-
referralSuspensionSchema
|
|
129
|
+
referralSuspensionSchema
|
|
130
|
+
} from "../chunk-UJACD6K2.js";
|
|
131
|
+
import {
|
|
132
|
+
cosmosNetworkSchema,
|
|
133
|
+
evmChainIdSchema,
|
|
134
|
+
linkedWalletSchema,
|
|
120
135
|
solanaMainnet,
|
|
121
136
|
walletBalanceSchema,
|
|
122
137
|
walletSignInNetworksSchema,
|
|
123
138
|
walletUnlinkInputSchema
|
|
124
|
-
} from "../chunk-
|
|
125
|
-
import
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
retryAfter,
|
|
129
|
-
retrying,
|
|
130
|
-
validTimeout
|
|
131
|
-
} from "../chunk-6QJ3LADK.js";
|
|
132
|
-
import {
|
|
133
|
-
RequestError,
|
|
134
|
-
isRequestError
|
|
135
|
-
} from "../chunk-NPGENI7K.js";
|
|
136
|
-
import {
|
|
137
|
-
clientIdentity
|
|
138
|
-
} from "../chunk-AGFUDCNM.js";
|
|
139
|
+
} from "../chunk-2UAVZCMH.js";
|
|
140
|
+
import "../chunk-6QJ3LADK.js";
|
|
141
|
+
import "../chunk-NPGENI7K.js";
|
|
142
|
+
import "../chunk-3PPEXDWR.js";
|
|
139
143
|
import "../chunk-PT5STHFH.js";
|
|
140
144
|
import {
|
|
141
145
|
CompletionSourceKind,
|
|
@@ -553,78 +557,13 @@ var resourceArchiveInputSchema = resourceLifecycleInputSchema.omit({
|
|
|
553
557
|
});
|
|
554
558
|
|
|
555
559
|
// src/server/index.ts
|
|
556
|
-
import { z as
|
|
557
|
-
|
|
558
|
-
// src/server/errors.ts
|
|
559
|
-
import { z as z8 } from "zod";
|
|
560
|
-
var ManagementErrorCode = {
|
|
561
|
-
/** The input or an option failed validation before anything was sent (kind `client`). */
|
|
562
|
-
InvalidInput: "invalid-input",
|
|
563
|
-
/** The client's `getToken` failed before anything was sent (kind `client` or `network`). */
|
|
564
|
-
Credential: "credential",
|
|
565
|
-
Network: "network",
|
|
566
|
-
Timeout: "timeout",
|
|
567
|
-
Aborted: "aborted",
|
|
568
|
-
InvalidResponse: "invalid-response"
|
|
569
|
-
};
|
|
570
|
-
var managementErrorSchema = z8.looseObject({
|
|
571
|
-
error: z8.string(),
|
|
572
|
-
code: z8.string().optional()
|
|
573
|
-
});
|
|
574
|
-
var uncertainStatuses = /* @__PURE__ */ new Set([500, 502, 504]);
|
|
575
|
-
function uncertainOutcome(init) {
|
|
576
|
-
if (init.method === void 0 || init.method === "GET") {
|
|
577
|
-
return false;
|
|
578
|
-
}
|
|
579
|
-
switch (init.kind) {
|
|
580
|
-
case "network":
|
|
581
|
-
case "timeout":
|
|
582
|
-
case "aborted":
|
|
583
|
-
return true;
|
|
584
|
-
case "http":
|
|
585
|
-
return uncertainStatuses.has(init.status ?? 0);
|
|
586
|
-
case "invalid-response":
|
|
587
|
-
return (init.status ?? 0) >= 200 && (init.status ?? 0) < 300;
|
|
588
|
-
default:
|
|
589
|
-
return false;
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
var managementErrorBrand = /* @__PURE__ */ Symbol.for("@domino-sdk/relay.ManagementError");
|
|
593
|
-
function isManagementError(value) {
|
|
594
|
-
return isRequestError(value) && value[managementErrorBrand] === true;
|
|
595
|
-
}
|
|
596
|
-
var ManagementError = class extends RequestError {
|
|
597
|
-
name = "ManagementError";
|
|
598
|
-
[managementErrorBrand] = true;
|
|
599
|
-
/** The rest of the server's error body besides `error` and `code`, such as `moved`; absent when there is none. */
|
|
600
|
-
details;
|
|
601
|
-
/** The request's method; absent when the call failed before forming a request. */
|
|
602
|
-
method;
|
|
603
|
-
/** The management API path, below `/management/v1`, without its query; absent like `method`. */
|
|
604
|
-
path;
|
|
605
|
-
constructor(init) {
|
|
606
|
-
super(init.message, {
|
|
607
|
-
kind: init.kind,
|
|
608
|
-
uncertain: init.uncertain ?? uncertainOutcome(init),
|
|
609
|
-
status: init.status,
|
|
610
|
-
code: init.code,
|
|
611
|
-
operationId: init.actionId,
|
|
612
|
-
replaySafe: init.replaySafe,
|
|
613
|
-
retryAfter: init.retryAfter,
|
|
614
|
-
cause: init.cause
|
|
615
|
-
});
|
|
616
|
-
this.details = init.details && Object.keys(init.details).length ? init.details : void 0;
|
|
617
|
-
this.method = init.method;
|
|
618
|
-
this.path = init.path;
|
|
619
|
-
}
|
|
620
|
-
};
|
|
621
|
-
var DEFAULT_MANAGEMENT_TIMEOUT = MANAGEMENT_TIMEOUT;
|
|
560
|
+
import { z as z12 } from "zod";
|
|
622
561
|
|
|
623
562
|
// src/server/hosting.ts
|
|
624
|
-
import { z as
|
|
563
|
+
import { z as z9 } from "zod";
|
|
625
564
|
|
|
626
565
|
// src/server/starters.ts
|
|
627
|
-
import { z as
|
|
566
|
+
import { z as z8 } from "zod";
|
|
628
567
|
var starterTemplates = [
|
|
629
568
|
{
|
|
630
569
|
id: "campaign",
|
|
@@ -657,63 +596,63 @@ var starterTemplates = [
|
|
|
657
596
|
summary: "A headless Worker with typed routes and interactive API docs, for plugging Domino into your own product."
|
|
658
597
|
}
|
|
659
598
|
];
|
|
660
|
-
var starterIdSchema =
|
|
599
|
+
var starterIdSchema = z8.enum(
|
|
661
600
|
starterTemplates.map((template) => template.id)
|
|
662
601
|
);
|
|
663
602
|
|
|
664
603
|
// src/server/hosting.ts
|
|
665
|
-
var outputPathSchema =
|
|
604
|
+
var outputPathSchema = z9.string().min(1).max(512).refine(
|
|
666
605
|
(path) => path.split("/").every(
|
|
667
606
|
(part) => /^[\w-][\w.-]*$/.test(part) && part !== "node_modules"
|
|
668
607
|
),
|
|
669
608
|
"Expected a relative build output path without hidden segments"
|
|
670
609
|
);
|
|
671
|
-
var appRoutingSchema =
|
|
610
|
+
var appRoutingSchema = z9.enum(["legacy", "transparent"]).default("legacy");
|
|
672
611
|
var APP_SECRET_LIMIT = 50;
|
|
673
612
|
var APP_KV_LIMIT = 5;
|
|
674
613
|
var APP_SQL_LIMIT = 5;
|
|
675
614
|
var APP_MIGRATION_LIMIT = 100;
|
|
676
615
|
var APP_MIGRATION_FILE_BYTES = 9e4;
|
|
677
616
|
var APP_MIGRATION_TOTAL_BYTES = 1e6;
|
|
678
|
-
var appSecretNameSchema =
|
|
617
|
+
var appSecretNameSchema = z9.string().regex(
|
|
679
618
|
/^[A-Z_][A-Z0-9_]{0,63}$/,
|
|
680
619
|
"Use 1-64 uppercase letters, digits, and underscores, not starting with a digit"
|
|
681
620
|
).refine(
|
|
682
621
|
(name) => !name.startsWith("DOMINO_") && name !== "ASSETS",
|
|
683
622
|
"DOMINO_ names and ASSETS are reserved for Domino's own bindings"
|
|
684
623
|
);
|
|
685
|
-
var appSecretValueSchema =
|
|
624
|
+
var appSecretValueSchema = z9.string().min(1).refine(
|
|
686
625
|
(value) => new TextEncoder().encode(value).length <= 5120,
|
|
687
626
|
"Secret values can be at most 5 KiB"
|
|
688
627
|
);
|
|
689
|
-
var appSecretInputSchema =
|
|
690
|
-
var appSecretSchema =
|
|
628
|
+
var appSecretInputSchema = z9.object({ value: appSecretValueSchema }).strict();
|
|
629
|
+
var appSecretSchema = z9.object({
|
|
691
630
|
name: appSecretNameSchema,
|
|
692
|
-
updatedAt:
|
|
693
|
-
updatedBy:
|
|
631
|
+
updatedAt: z9.number(),
|
|
632
|
+
updatedBy: z9.string()
|
|
694
633
|
});
|
|
695
|
-
var appSecretDeclarationSchema =
|
|
696
|
-
description:
|
|
697
|
-
required:
|
|
634
|
+
var appSecretDeclarationSchema = z9.object({
|
|
635
|
+
description: z9.string().trim().min(1).max(500),
|
|
636
|
+
required: z9.boolean().default(true)
|
|
698
637
|
}).strict();
|
|
699
|
-
var appSecretDeclarationsSchema =
|
|
638
|
+
var appSecretDeclarationsSchema = z9.record(appSecretNameSchema, appSecretDeclarationSchema).refine(
|
|
700
639
|
(secrets) => Object.keys(secrets).length <= APP_SECRET_LIMIT,
|
|
701
640
|
`Declare at most ${APP_SECRET_LIMIT} app secrets`
|
|
702
641
|
);
|
|
703
|
-
var appSecretListSchema =
|
|
704
|
-
secrets:
|
|
705
|
-
declared:
|
|
642
|
+
var appSecretListSchema = z9.object({
|
|
643
|
+
secrets: z9.array(appSecretSchema),
|
|
644
|
+
declared: z9.array(appSecretDeclarationSchema.extend({ name: appSecretNameSchema })).default([])
|
|
706
645
|
});
|
|
707
|
-
var hostedAppSecretsSchema =
|
|
708
|
-
var storageDescription =
|
|
709
|
-
description:
|
|
646
|
+
var hostedAppSecretsSchema = z9.object({ secrets: z9.record(appSecretNameSchema, appSecretValueSchema) }).strict();
|
|
647
|
+
var storageDescription = z9.object({
|
|
648
|
+
description: z9.string().trim().min(1).max(500)
|
|
710
649
|
}).strict();
|
|
711
|
-
var appStorageSchema =
|
|
712
|
-
kv:
|
|
650
|
+
var appStorageSchema = z9.object({
|
|
651
|
+
kv: z9.record(appSecretNameSchema, storageDescription).refine(
|
|
713
652
|
(stores) => Object.keys(stores).length <= APP_KV_LIMIT,
|
|
714
653
|
`Declare at most ${APP_KV_LIMIT} KV stores`
|
|
715
654
|
).default({}),
|
|
716
|
-
sql:
|
|
655
|
+
sql: z9.record(
|
|
717
656
|
appSecretNameSchema,
|
|
718
657
|
storageDescription.extend({
|
|
719
658
|
migrations: outputPathSchema.optional()
|
|
@@ -723,60 +662,60 @@ var appStorageSchema = z10.object({
|
|
|
723
662
|
`Declare at most ${APP_SQL_LIMIT} SQL stores`
|
|
724
663
|
).default({})
|
|
725
664
|
}).strict();
|
|
726
|
-
var appStorageKindSchema =
|
|
727
|
-
var appStorageListSchema =
|
|
728
|
-
stores:
|
|
729
|
-
|
|
730
|
-
kind:
|
|
665
|
+
var appStorageKindSchema = z9.enum(["kv", "sql"]);
|
|
666
|
+
var appStorageListSchema = z9.object({
|
|
667
|
+
stores: z9.array(
|
|
668
|
+
z9.object({
|
|
669
|
+
kind: z9.string(),
|
|
731
670
|
name: appSecretNameSchema,
|
|
732
|
-
createdAt:
|
|
733
|
-
declared:
|
|
734
|
-
description:
|
|
671
|
+
createdAt: z9.number().nullable(),
|
|
672
|
+
declared: z9.boolean(),
|
|
673
|
+
description: z9.string().optional()
|
|
735
674
|
})
|
|
736
675
|
)
|
|
737
676
|
});
|
|
738
677
|
var APP_STORAGE_ROW_LIMIT = 50;
|
|
739
678
|
var APP_STORAGE_PREVIEW_CHARACTERS = 2e3;
|
|
740
|
-
var appStorageCellSchema =
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
679
|
+
var appStorageCellSchema = z9.union([
|
|
680
|
+
z9.string(),
|
|
681
|
+
z9.number(),
|
|
682
|
+
z9.null(),
|
|
683
|
+
z9.object({ text: z9.string(), truncated: z9.literal(true) }),
|
|
684
|
+
z9.object({ blob: z9.number().int().min(0) })
|
|
746
685
|
]);
|
|
747
|
-
var appStorageTablesSchema =
|
|
748
|
-
tables:
|
|
686
|
+
var appStorageTablesSchema = z9.object({
|
|
687
|
+
tables: z9.array(
|
|
749
688
|
/** `kind` is SQLite's: `table` or `view`. */
|
|
750
|
-
|
|
689
|
+
z9.object({ name: z9.string(), kind: z9.string() })
|
|
751
690
|
)
|
|
752
691
|
});
|
|
753
|
-
var appStorageRowsSchema =
|
|
754
|
-
table:
|
|
755
|
-
columns:
|
|
756
|
-
rows:
|
|
692
|
+
var appStorageRowsSchema = z9.object({
|
|
693
|
+
table: z9.string(),
|
|
694
|
+
columns: z9.array(z9.string()),
|
|
695
|
+
rows: z9.array(z9.array(appStorageCellSchema)),
|
|
757
696
|
/** How many rows come before this page in storage order. */
|
|
758
|
-
offset:
|
|
759
|
-
total:
|
|
697
|
+
offset: z9.number().int().min(0),
|
|
698
|
+
total: z9.number().int().min(0),
|
|
760
699
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
761
700
|
nextCursor: pageCursorSchema.nullable().default(null)
|
|
762
701
|
});
|
|
763
|
-
var appStorageKeysSchema =
|
|
764
|
-
keys:
|
|
765
|
-
|
|
702
|
+
var appStorageKeysSchema = z9.object({
|
|
703
|
+
keys: z9.array(
|
|
704
|
+
z9.object({ name: z9.string(), expiration: z9.number().nullable() })
|
|
766
705
|
),
|
|
767
706
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
768
707
|
nextCursor: pageCursorSchema.nullable().default(null),
|
|
769
708
|
/** @deprecated Use `nextCursor`. Removed in 2.0.0. */
|
|
770
|
-
cursor:
|
|
709
|
+
cursor: z9.string().nullable()
|
|
771
710
|
});
|
|
772
|
-
var appStorageValueSchema =
|
|
773
|
-
key:
|
|
774
|
-
size:
|
|
711
|
+
var appStorageValueSchema = z9.object({
|
|
712
|
+
key: z9.string(),
|
|
713
|
+
size: z9.number().int().min(0),
|
|
775
714
|
/** Null when the value is not UTF-8 text. */
|
|
776
|
-
text:
|
|
777
|
-
truncated:
|
|
715
|
+
text: z9.string().nullable(),
|
|
716
|
+
truncated: z9.boolean()
|
|
778
717
|
});
|
|
779
|
-
var appMigrationNameSchema =
|
|
718
|
+
var appMigrationNameSchema = z9.string().max(255).regex(/^[\w-][\w.-]*\.sql$/);
|
|
780
719
|
function compareAppMigrations(a, b) {
|
|
781
720
|
const left = Number.parseInt(a.split("_")[0], 10);
|
|
782
721
|
const right = Number.parseInt(b.split("_")[0], 10);
|
|
@@ -793,12 +732,12 @@ function compareAppMigrations(a, b) {
|
|
|
793
732
|
}
|
|
794
733
|
return a < b ? -1 : a > b ? 1 : 0;
|
|
795
734
|
}
|
|
796
|
-
var appMigrationsSchema =
|
|
735
|
+
var appMigrationsSchema = z9.record(
|
|
797
736
|
appSecretNameSchema,
|
|
798
|
-
|
|
799
|
-
|
|
737
|
+
z9.array(
|
|
738
|
+
z9.object({
|
|
800
739
|
name: appMigrationNameSchema,
|
|
801
|
-
sql:
|
|
740
|
+
sql: z9.string().min(1).refine(
|
|
802
741
|
(sql) => new TextEncoder().encode(sql).length <= APP_MIGRATION_FILE_BYTES,
|
|
803
742
|
`A migration file must not exceed ${APP_MIGRATION_FILE_BYTES} bytes`
|
|
804
743
|
)
|
|
@@ -816,21 +755,21 @@ var appMigrationsSchema = z10.record(
|
|
|
816
755
|
);
|
|
817
756
|
var appScripts = {
|
|
818
757
|
routing: appRoutingSchema,
|
|
819
|
-
devScript:
|
|
820
|
-
checkScript:
|
|
821
|
-
buildScript:
|
|
758
|
+
devScript: z9.string().regex(/^[\w:-]+$/),
|
|
759
|
+
checkScript: z9.string().regex(/^[\w:-]+$/),
|
|
760
|
+
buildScript: z9.string().regex(/^[\w:-]+$/)
|
|
822
761
|
};
|
|
823
762
|
var workerSettings = {
|
|
824
|
-
runWorkerFirst:
|
|
763
|
+
runWorkerFirst: z9.boolean().default(false),
|
|
825
764
|
main: outputPathSchema.refine(
|
|
826
765
|
(path) => /\.m?js$/.test(path),
|
|
827
766
|
"Expected a compiled JavaScript entry"
|
|
828
767
|
),
|
|
829
|
-
compatibilityDate:
|
|
830
|
-
compatibilityFlags:
|
|
831
|
-
vars:
|
|
832
|
-
|
|
833
|
-
|
|
768
|
+
compatibilityDate: z9.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
769
|
+
compatibilityFlags: z9.array(z9.string().min(1)).max(50).default([]),
|
|
770
|
+
vars: z9.record(
|
|
771
|
+
z9.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).refine((name) => name !== "ASSETS"),
|
|
772
|
+
z9.string()
|
|
834
773
|
).default({}),
|
|
835
774
|
secrets: appSecretDeclarationsSchema.default({}),
|
|
836
775
|
storage: appStorageSchema.optional()
|
|
@@ -858,62 +797,62 @@ var distinctBindings = (worker, ctx) => {
|
|
|
858
797
|
}
|
|
859
798
|
}
|
|
860
799
|
};
|
|
861
|
-
var hostedAppSchema =
|
|
862
|
-
|
|
863
|
-
kind:
|
|
800
|
+
var hostedAppSchema = z9.discriminatedUnion("kind", [
|
|
801
|
+
z9.object({
|
|
802
|
+
kind: z9.literal("static"),
|
|
864
803
|
directory: outputPathSchema,
|
|
865
804
|
...appScripts
|
|
866
805
|
}).strict(),
|
|
867
|
-
|
|
868
|
-
kind:
|
|
806
|
+
z9.object({
|
|
807
|
+
kind: z9.literal("worker"),
|
|
869
808
|
directory: outputPathSchema,
|
|
870
809
|
assetsDirectory: outputPathSchema.optional(),
|
|
871
810
|
...appScripts,
|
|
872
811
|
...workerSettings
|
|
873
812
|
}).strict().superRefine(distinctBindings)
|
|
874
813
|
]);
|
|
875
|
-
var repositorySchema =
|
|
876
|
-
id:
|
|
814
|
+
var repositorySchema = z9.object({
|
|
815
|
+
id: z9.string().uuid(),
|
|
877
816
|
organization: identifier,
|
|
878
817
|
project: identifier,
|
|
879
|
-
remote:
|
|
880
|
-
defaultBranch:
|
|
881
|
-
status:
|
|
818
|
+
remote: z9.string().url(),
|
|
819
|
+
defaultBranch: z9.string(),
|
|
820
|
+
status: z9.enum(["provisioning", "ready"])
|
|
882
821
|
});
|
|
883
|
-
var createRepositorySchema =
|
|
822
|
+
var createRepositorySchema = z9.object({
|
|
884
823
|
/** Omitted: the starter chosen at project setup, else `campaign`. */
|
|
885
824
|
starter: starterIdSchema.optional()
|
|
886
825
|
}).strict();
|
|
887
|
-
var deviceStartSchema =
|
|
888
|
-
challenge:
|
|
826
|
+
var deviceStartSchema = z9.object({
|
|
827
|
+
challenge: z9.string().regex(/^[a-f0-9]{64}$/)
|
|
889
828
|
}).strict();
|
|
890
|
-
var deviceRedeemSchema =
|
|
891
|
-
id:
|
|
892
|
-
verifier:
|
|
829
|
+
var deviceRedeemSchema = z9.object({
|
|
830
|
+
id: z9.string().uuid(),
|
|
831
|
+
verifier: z9.string().min(43).max(128)
|
|
893
832
|
}).strict();
|
|
894
|
-
var deviceApproveSchema =
|
|
895
|
-
id:
|
|
896
|
-
code:
|
|
833
|
+
var deviceApproveSchema = z9.object({
|
|
834
|
+
id: z9.string().uuid(),
|
|
835
|
+
code: z9.string().regex(/^[A-F0-9]{4}-[A-F0-9]{4}$/)
|
|
897
836
|
}).strict();
|
|
898
|
-
var commitSchema =
|
|
899
|
-
var stageRequestSchema =
|
|
837
|
+
var commitSchema = z9.string().regex(/^[a-f0-9]{40}$/);
|
|
838
|
+
var stageRequestSchema = z9.object({
|
|
900
839
|
commit: commitSchema,
|
|
901
|
-
requestId:
|
|
840
|
+
requestId: z9.string().uuid()
|
|
902
841
|
}).strict();
|
|
903
|
-
var buildIdentitySchema =
|
|
842
|
+
var buildIdentitySchema = z9.object({
|
|
904
843
|
routing: appRoutingSchema,
|
|
905
|
-
slug:
|
|
906
|
-
runtime:
|
|
907
|
-
id:
|
|
908
|
-
repository:
|
|
844
|
+
slug: z9.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional(),
|
|
845
|
+
runtime: z9.enum(["simulation", "hosted-test"]).default("simulation"),
|
|
846
|
+
id: z9.string().uuid(),
|
|
847
|
+
repository: z9.string().uuid(),
|
|
909
848
|
organization: identifier,
|
|
910
849
|
project: identifier,
|
|
911
850
|
commit: commitSchema,
|
|
912
|
-
createdAt:
|
|
913
|
-
actor:
|
|
914
|
-
commitMessage:
|
|
851
|
+
createdAt: z9.number(),
|
|
852
|
+
actor: z9.string(),
|
|
853
|
+
commitMessage: z9.string().max(500).optional()
|
|
915
854
|
});
|
|
916
|
-
var buildPhaseSchema =
|
|
855
|
+
var buildPhaseSchema = z9.enum([
|
|
917
856
|
"queued",
|
|
918
857
|
"source",
|
|
919
858
|
"install",
|
|
@@ -923,72 +862,72 @@ var buildPhaseSchema = z10.enum([
|
|
|
923
862
|
"ready",
|
|
924
863
|
"failed"
|
|
925
864
|
]);
|
|
926
|
-
var buildStatusSchema =
|
|
865
|
+
var buildStatusSchema = z9.object({
|
|
927
866
|
phase: buildPhaseSchema,
|
|
928
867
|
failedPhase: buildPhaseSchema.optional(),
|
|
929
|
-
updatedAt:
|
|
930
|
-
message:
|
|
868
|
+
updatedAt: z9.number(),
|
|
869
|
+
message: z9.string()
|
|
931
870
|
});
|
|
932
871
|
var hostedBuildSchema = buildIdentitySchema.extend({
|
|
933
872
|
...buildStatusSchema.shape,
|
|
934
|
-
finished:
|
|
935
|
-
current:
|
|
936
|
-
stagingUrl:
|
|
937
|
-
});
|
|
938
|
-
var stagingAccessModeSchema =
|
|
939
|
-
var stagingAccessSchema =
|
|
940
|
-
var stagingAccessInputSchema =
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
mode:
|
|
944
|
-
password:
|
|
873
|
+
finished: z9.boolean(),
|
|
874
|
+
current: z9.boolean(),
|
|
875
|
+
stagingUrl: z9.string().url()
|
|
876
|
+
});
|
|
877
|
+
var stagingAccessModeSchema = z9.enum(["console", "password"]);
|
|
878
|
+
var stagingAccessSchema = z9.object({ mode: stagingAccessModeSchema });
|
|
879
|
+
var stagingAccessInputSchema = z9.discriminatedUnion("mode", [
|
|
880
|
+
z9.object({ mode: z9.literal("console") }).strict(),
|
|
881
|
+
z9.object({
|
|
882
|
+
mode: z9.literal("password"),
|
|
883
|
+
password: z9.string().min(8).max(128)
|
|
945
884
|
}).strict()
|
|
946
885
|
]);
|
|
947
|
-
var stagingPathSchema =
|
|
886
|
+
var stagingPathSchema = z9.string().max(2048).refine(
|
|
948
887
|
(path) => path.startsWith("/") && !path.startsWith("//") && !path.includes("\\"),
|
|
949
888
|
"Expected a path on the staging host"
|
|
950
889
|
);
|
|
951
|
-
var stagingLinkSchema =
|
|
952
|
-
url:
|
|
953
|
-
expiresAt:
|
|
890
|
+
var stagingLinkSchema = z9.object({
|
|
891
|
+
url: z9.string().url(),
|
|
892
|
+
expiresAt: z9.number()
|
|
954
893
|
});
|
|
955
|
-
var buildSnapshotSchema =
|
|
956
|
-
builds:
|
|
894
|
+
var buildSnapshotSchema = z9.object({
|
|
895
|
+
builds: z9.array(hostedBuildSchema),
|
|
957
896
|
current: hostedBuildSchema.nullable(),
|
|
958
897
|
selected: hostedBuildSchema.nullable(),
|
|
959
|
-
logs:
|
|
898
|
+
logs: z9.string()
|
|
960
899
|
});
|
|
961
|
-
var assetPathSchema =
|
|
900
|
+
var assetPathSchema = z9.string().max(512).refine(
|
|
962
901
|
(path) => path.startsWith("/") && // oxlint-disable-next-line no-control-regex -- Asset paths must reject control characters.
|
|
963
902
|
!/[\\\u0000-\u001f?#%]/.test(path) && path.slice(1).split("/").every((part) => part.length > 0 && !part.startsWith(".")),
|
|
964
903
|
"Expected a public asset path without hidden segments"
|
|
965
904
|
);
|
|
966
|
-
var base64Schema =
|
|
905
|
+
var base64Schema = z9.string().regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
|
|
967
906
|
var stagedDeploymentLimits = {
|
|
968
907
|
/** Bytes of JSON, uncompressed. */
|
|
969
908
|
size: 64e6,
|
|
970
909
|
/** Bytes of the Brotli-compressed object. */
|
|
971
910
|
compressedSize: 1e7
|
|
972
911
|
};
|
|
973
|
-
var stagedDeploymentSchema =
|
|
974
|
-
encoding:
|
|
975
|
-
sha256:
|
|
976
|
-
compressedSize:
|
|
977
|
-
size:
|
|
912
|
+
var stagedDeploymentSchema = z9.object({
|
|
913
|
+
encoding: z9.literal("br"),
|
|
914
|
+
sha256: z9.string().regex(/^[0-9a-f]{64}$/),
|
|
915
|
+
compressedSize: z9.number().int().positive().max(stagedDeploymentLimits.compressedSize),
|
|
916
|
+
size: z9.number().int().positive().max(stagedDeploymentLimits.size)
|
|
978
917
|
}).strict();
|
|
979
918
|
var stagedDeploymentContentSchema = stagedDeploymentSchema.extend({
|
|
980
|
-
content:
|
|
919
|
+
content: z9.string().max(Math.ceil(stagedDeploymentLimits.compressedSize / 3) * 4)
|
|
981
920
|
}).strict();
|
|
982
921
|
var stagedDeploymentKey = (build, sha256) => `builds/${build}/deployment/${sha256}.br`;
|
|
983
922
|
var artifactFields = {
|
|
984
923
|
routing: appRoutingSchema,
|
|
985
|
-
worker:
|
|
924
|
+
worker: z9.object({
|
|
986
925
|
...workerSettings,
|
|
987
926
|
migrations: appMigrationsSchema.optional(),
|
|
988
|
-
modules:
|
|
989
|
-
|
|
927
|
+
modules: z9.array(
|
|
928
|
+
z9.object({
|
|
990
929
|
path: outputPathSchema.refine((path) => path !== "metadata"),
|
|
991
|
-
type:
|
|
930
|
+
type: z9.enum([
|
|
992
931
|
"application/javascript+module",
|
|
993
932
|
"application/wasm",
|
|
994
933
|
"text/plain",
|
|
@@ -998,26 +937,26 @@ var artifactFields = {
|
|
|
998
937
|
}).strict()
|
|
999
938
|
).min(1).max(500)
|
|
1000
939
|
}).strict().superRefine(distinctBindings).optional(),
|
|
1001
|
-
assets:
|
|
1002
|
-
|
|
940
|
+
assets: z9.array(
|
|
941
|
+
z9.object({
|
|
1003
942
|
path: assetPathSchema,
|
|
1004
943
|
content: base64Schema.max(14e6),
|
|
1005
|
-
size:
|
|
944
|
+
size: z9.number().int().min(0).max(1e7)
|
|
1006
945
|
}).strict()
|
|
1007
946
|
).max(500)
|
|
1008
947
|
};
|
|
1009
|
-
var buildArtifactsSchema =
|
|
1010
|
-
|
|
1011
|
-
format:
|
|
948
|
+
var buildArtifactsSchema = z9.discriminatedUnion("format", [
|
|
949
|
+
z9.object({
|
|
950
|
+
format: z9.literal(1),
|
|
1012
951
|
...artifactFields,
|
|
1013
|
-
quests:
|
|
1014
|
-
catalog:
|
|
952
|
+
quests: z9.unknown(),
|
|
953
|
+
catalog: z9.unknown()
|
|
1015
954
|
}).strict(),
|
|
1016
|
-
|
|
1017
|
-
format:
|
|
955
|
+
z9.object({
|
|
956
|
+
format: z9.literal(2),
|
|
1018
957
|
...artifactFields,
|
|
1019
958
|
deployment: stagedDeploymentSchema,
|
|
1020
|
-
images:
|
|
959
|
+
images: z9.array(imageAssetArtifactSchema).max(10)
|
|
1021
960
|
}).strict()
|
|
1022
961
|
]).superRefine((value, ctx) => {
|
|
1023
962
|
if (value.worker) {
|
|
@@ -1069,39 +1008,39 @@ var buildArtifactsSchema = z10.discriminatedUnion("format", [
|
|
|
1069
1008
|
});
|
|
1070
1009
|
|
|
1071
1010
|
// src/server/development.ts
|
|
1072
|
-
import { z as
|
|
1073
|
-
var developmentPreflightSchema =
|
|
1074
|
-
organization:
|
|
1075
|
-
project:
|
|
1076
|
-
environment:
|
|
1077
|
-
identity:
|
|
1078
|
-
exchange:
|
|
1079
|
-
activeIntegrations:
|
|
1011
|
+
import { z as z10 } from "zod";
|
|
1012
|
+
var developmentPreflightSchema = z10.object({
|
|
1013
|
+
organization: z10.string(),
|
|
1014
|
+
project: z10.string(),
|
|
1015
|
+
environment: z10.enum(["test", "live"]),
|
|
1016
|
+
identity: z10.object({
|
|
1017
|
+
exchange: z10.literal("supported"),
|
|
1018
|
+
activeIntegrations: z10.number().int().nonnegative()
|
|
1080
1019
|
}).optional(),
|
|
1081
|
-
staging:
|
|
1082
|
-
development:
|
|
1083
|
-
status:
|
|
1020
|
+
staging: z10.enum(["configured", "blocked"]),
|
|
1021
|
+
development: z10.object({
|
|
1022
|
+
status: z10.enum(["configured", "blocked"]),
|
|
1084
1023
|
// How `domino dev` reaches the preview origin: a Cloudflare tunnel, or a direct route on a
|
|
1085
1024
|
// local development stack. APIs that predate the field use tunnels.
|
|
1086
|
-
transport:
|
|
1087
|
-
missing:
|
|
1088
|
-
authentication:
|
|
1025
|
+
transport: z10.enum(["tunnel", "direct"]).default("tunnel"),
|
|
1026
|
+
missing: z10.array(z10.string()),
|
|
1027
|
+
authentication: z10.array(z10.string())
|
|
1089
1028
|
}),
|
|
1090
|
-
checks:
|
|
1091
|
-
|
|
1092
|
-
id:
|
|
1093
|
-
status:
|
|
1094
|
-
message:
|
|
1095
|
-
missing:
|
|
1096
|
-
issues:
|
|
1029
|
+
checks: z10.array(
|
|
1030
|
+
z10.object({
|
|
1031
|
+
id: z10.string(),
|
|
1032
|
+
status: z10.enum(["ok", "error"]),
|
|
1033
|
+
message: z10.string(),
|
|
1034
|
+
missing: z10.array(z10.string()).optional(),
|
|
1035
|
+
issues: z10.array(z10.string()).optional()
|
|
1097
1036
|
})
|
|
1098
1037
|
)
|
|
1099
1038
|
});
|
|
1100
1039
|
|
|
1101
1040
|
// src/server/hosted.ts
|
|
1102
|
-
import { z as
|
|
1041
|
+
import { z as z11 } from "zod";
|
|
1103
1042
|
var hostedKeyPermissions = ["read", "points", "ingest"];
|
|
1104
|
-
var hostedKeyPermissionList =
|
|
1043
|
+
var hostedKeyPermissionList = z11.array(z11.string()).transform(
|
|
1105
1044
|
(values) => values.filter(
|
|
1106
1045
|
(value) => hostedKeyPermissions.includes(value)
|
|
1107
1046
|
)
|
|
@@ -1113,17 +1052,17 @@ var hostedManagementBindings = [
|
|
|
1113
1052
|
"DOMINO_PROJECT",
|
|
1114
1053
|
"DOMINO_ENVIRONMENT"
|
|
1115
1054
|
];
|
|
1116
|
-
var hostedKeySecretSchema =
|
|
1117
|
-
var hostedKeySchema =
|
|
1118
|
-
id:
|
|
1055
|
+
var hostedKeySecretSchema = z11.string().regex(/^dhk_[A-Za-z0-9_-]{43}$/, "Expected a hosted app key");
|
|
1056
|
+
var hostedKeySchema = z11.object({
|
|
1057
|
+
id: z11.string().uuid(),
|
|
1119
1058
|
token: hostedKeySecretSchema,
|
|
1120
1059
|
organization: identifier,
|
|
1121
1060
|
project: identifier,
|
|
1122
|
-
environment:
|
|
1061
|
+
environment: z11.enum(["test", "live"]),
|
|
1123
1062
|
permissions: hostedKeyPermissionList,
|
|
1124
|
-
expiresAt:
|
|
1063
|
+
expiresAt: z11.number().nullable()
|
|
1125
1064
|
}).strict();
|
|
1126
|
-
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl:
|
|
1065
|
+
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl: z11.string().url() }).strict();
|
|
1127
1066
|
function hostedManagementClient(env) {
|
|
1128
1067
|
const missing = hostedManagementBindings.filter((name) => !env[name]);
|
|
1129
1068
|
if (missing.length) {
|
|
@@ -1131,7 +1070,7 @@ function hostedManagementClient(env) {
|
|
|
1131
1070
|
`Missing ${missing.join(", ")}. Domino sets these for hosted apps and domino dev; update the project's vite.config.ts to forward them in development.`
|
|
1132
1071
|
);
|
|
1133
1072
|
}
|
|
1134
|
-
const environment =
|
|
1073
|
+
const environment = z11.enum(["test", "live"]).parse(env.DOMINO_ENVIRONMENT);
|
|
1135
1074
|
const token = env.DOMINO_MANAGEMENT_KEY;
|
|
1136
1075
|
return createManagementClient({
|
|
1137
1076
|
baseUrl: env.DOMINO_API_URL.replace(/\/+$/, ""),
|
|
@@ -1143,9 +1082,9 @@ function hostedManagementClient(env) {
|
|
|
1143
1082
|
}
|
|
1144
1083
|
|
|
1145
1084
|
// src/server/index.ts
|
|
1146
|
-
var environmentSchema =
|
|
1147
|
-
var roleSchema =
|
|
1148
|
-
var permissionSchema =
|
|
1085
|
+
var environmentSchema = z12.enum(["test", "live"]);
|
|
1086
|
+
var roleSchema = z12.enum(["editor", "reviewer", "staff"]);
|
|
1087
|
+
var permissionSchema = z12.enum([
|
|
1149
1088
|
"read",
|
|
1150
1089
|
"publish",
|
|
1151
1090
|
"review",
|
|
@@ -1165,7 +1104,7 @@ var permissionSchema = z13.enum([
|
|
|
1165
1104
|
*/
|
|
1166
1105
|
"enroll"
|
|
1167
1106
|
]);
|
|
1168
|
-
var permissionListSchema =
|
|
1107
|
+
var permissionListSchema = z12.array(z12.string()).transform(
|
|
1169
1108
|
(values) => values.filter(
|
|
1170
1109
|
(value) => permissionSchema.safeParse(value).success
|
|
1171
1110
|
)
|
|
@@ -1175,33 +1114,33 @@ var rolePermissions = {
|
|
|
1175
1114
|
reviewer: ["read", "review"],
|
|
1176
1115
|
staff: ["read", "confirm", "handover"]
|
|
1177
1116
|
};
|
|
1178
|
-
var projectSetupSchema =
|
|
1179
|
-
mode:
|
|
1180
|
-
brief:
|
|
1117
|
+
var projectSetupSchema = z12.object({
|
|
1118
|
+
mode: z12.enum(["new", "existing"]),
|
|
1119
|
+
brief: z12.string().trim().min(1).max(4e3)
|
|
1181
1120
|
}).strict();
|
|
1182
|
-
var operatorUserSchema =
|
|
1183
|
-
id:
|
|
1184
|
-
name:
|
|
1185
|
-
email:
|
|
1186
|
-
avatar:
|
|
1187
|
-
});
|
|
1188
|
-
var projectSchema =
|
|
1189
|
-
slug:
|
|
1190
|
-
createdBy:
|
|
1121
|
+
var operatorUserSchema = z12.object({
|
|
1122
|
+
id: z12.string(),
|
|
1123
|
+
name: z12.string().nullable(),
|
|
1124
|
+
email: z12.string().nullable(),
|
|
1125
|
+
avatar: z12.string().nullable()
|
|
1126
|
+
});
|
|
1127
|
+
var projectSchema = z12.object({
|
|
1128
|
+
slug: z12.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
1129
|
+
createdBy: z12.string().nullable().optional(),
|
|
1191
1130
|
creator: operatorUserSchema.nullable().optional(),
|
|
1192
1131
|
/** A response, so fields a newer server adds to the setup are dropped, not rejected. */
|
|
1193
|
-
setup:
|
|
1132
|
+
setup: z12.object(projectSetupSchema.shape).optional(),
|
|
1194
1133
|
/** The starter chosen at setup. A plain string, so later starters still parse. */
|
|
1195
|
-
starter:
|
|
1196
|
-
id:
|
|
1134
|
+
starter: z12.string().optional(),
|
|
1135
|
+
id: z12.string().min(1),
|
|
1197
1136
|
organization: identifier,
|
|
1198
1137
|
project: identifier,
|
|
1199
|
-
name:
|
|
1200
|
-
subtitle:
|
|
1201
|
-
initials:
|
|
1202
|
-
color:
|
|
1138
|
+
name: z12.string(),
|
|
1139
|
+
subtitle: z12.string(),
|
|
1140
|
+
initials: z12.string(),
|
|
1141
|
+
color: z12.string(),
|
|
1203
1142
|
permissions: permissionListSchema,
|
|
1204
|
-
environments:
|
|
1143
|
+
environments: z12.array(environmentSchema)
|
|
1205
1144
|
}).refine(
|
|
1206
1145
|
(project) => !project.creator || project.creator.id === project.createdBy,
|
|
1207
1146
|
{
|
|
@@ -1209,45 +1148,45 @@ var projectSchema = z13.object({
|
|
|
1209
1148
|
path: ["creator"]
|
|
1210
1149
|
}
|
|
1211
1150
|
);
|
|
1212
|
-
var projectInputSchema =
|
|
1151
|
+
var projectInputSchema = z12.object({
|
|
1213
1152
|
actionId: identifier,
|
|
1214
|
-
name:
|
|
1153
|
+
name: z12.string().trim().min(1).max(80),
|
|
1215
1154
|
setup: projectSetupSchema.optional(),
|
|
1216
1155
|
/** The starter a new hosted app begins from, with `setup.mode` "new". */
|
|
1217
1156
|
starter: starterIdSchema.optional()
|
|
1218
1157
|
}).strict();
|
|
1219
|
-
var projectUpdateInputSchema =
|
|
1220
|
-
|
|
1221
|
-
|
|
1158
|
+
var projectUpdateInputSchema = z12.union([
|
|
1159
|
+
z12.object({ name: projectInputSchema.shape.name }).strict(),
|
|
1160
|
+
z12.object({
|
|
1222
1161
|
slug: projectSchema.shape.slug,
|
|
1223
|
-
confirm:
|
|
1162
|
+
confirm: z12.string().min(1).max(80)
|
|
1224
1163
|
}).strict()
|
|
1225
1164
|
]);
|
|
1226
|
-
var projectDeletionInputSchema =
|
|
1227
|
-
var projectDeletionSchema =
|
|
1165
|
+
var projectDeletionInputSchema = z12.object({ confirm: z12.string().min(1).max(80) }).strict();
|
|
1166
|
+
var projectDeletionSchema = z12.object({
|
|
1228
1167
|
project: identifier,
|
|
1229
|
-
purgeAfter:
|
|
1168
|
+
purgeAfter: z12.number().int()
|
|
1230
1169
|
});
|
|
1231
|
-
var projectTransferInputSchema =
|
|
1232
|
-
var projectTransferSchema =
|
|
1170
|
+
var projectTransferInputSchema = z12.object({ organization: identifier, confirm: z12.string().min(1).max(80) }).strict();
|
|
1171
|
+
var projectTransferSchema = z12.object({
|
|
1233
1172
|
organization: identifier,
|
|
1234
1173
|
project: identifier
|
|
1235
1174
|
});
|
|
1236
|
-
var grantSchema =
|
|
1237
|
-
subject:
|
|
1238
|
-
roles:
|
|
1239
|
-
environments:
|
|
1175
|
+
var grantSchema = z12.object({
|
|
1176
|
+
subject: z12.string().min(1).max(200),
|
|
1177
|
+
roles: z12.array(roleSchema),
|
|
1178
|
+
environments: z12.array(environmentSchema)
|
|
1240
1179
|
}).strict();
|
|
1241
|
-
var grantRecordSchema =
|
|
1242
|
-
var stockAdditionSchema =
|
|
1180
|
+
var grantRecordSchema = z12.object(grantSchema.shape);
|
|
1181
|
+
var stockAdditionSchema = z12.object({
|
|
1243
1182
|
item: identifier,
|
|
1244
|
-
quantity:
|
|
1183
|
+
quantity: z12.number().int(),
|
|
1245
1184
|
actionId: identifier
|
|
1246
1185
|
});
|
|
1247
|
-
var completionRevokeSchema =
|
|
1186
|
+
var completionRevokeSchema = z12.object({
|
|
1248
1187
|
actionId: identifier,
|
|
1249
|
-
reason:
|
|
1250
|
-
freeOccurrence:
|
|
1188
|
+
reason: z12.string().trim().min(1).max(500),
|
|
1189
|
+
freeOccurrence: z12.boolean().default(false)
|
|
1251
1190
|
}).strict();
|
|
1252
1191
|
var RevokedEntitlementOutcome = {
|
|
1253
1192
|
/** No other completion grants the reward: it is void, after cancelling a handover in progress. */
|
|
@@ -1275,216 +1214,218 @@ var RevokedReferralOutcome = {
|
|
|
1275
1214
|
/** Qualified on another accepted completion of the program's quest instead. */
|
|
1276
1215
|
Requalified: "requalified"
|
|
1277
1216
|
};
|
|
1278
|
-
var entitlementOutcomeSchema =
|
|
1279
|
-
var deliveryOutcomeSchema =
|
|
1280
|
-
var referralOutcomeSchema =
|
|
1281
|
-
var completionRevocationSchema =
|
|
1217
|
+
var entitlementOutcomeSchema = z12.string().min(1).max(64);
|
|
1218
|
+
var deliveryOutcomeSchema = z12.string().min(1).max(64);
|
|
1219
|
+
var referralOutcomeSchema = z12.string().min(1).max(64);
|
|
1220
|
+
var completionRevocationSchema = z12.object({
|
|
1282
1221
|
completion: identifier,
|
|
1283
1222
|
/** The quest ID, or the board ID when `source.kind` is `leaderboard`. */
|
|
1284
1223
|
quest: identifier,
|
|
1285
1224
|
member: identifier,
|
|
1286
1225
|
/** What paid the revoked completion. `source.id` repeats `quest`. */
|
|
1287
1226
|
source: completionSourceSchema.optional(),
|
|
1288
|
-
revokedAt:
|
|
1289
|
-
occurrenceFreed:
|
|
1290
|
-
points:
|
|
1291
|
-
|
|
1227
|
+
revokedAt: z12.number(),
|
|
1228
|
+
occurrenceFreed: z12.boolean(),
|
|
1229
|
+
points: z12.array(
|
|
1230
|
+
z12.object({
|
|
1292
1231
|
entry: identifier,
|
|
1293
1232
|
balance: identifier,
|
|
1294
1233
|
reversal: identifier.nullable(),
|
|
1295
|
-
reversed:
|
|
1296
|
-
unreversed:
|
|
1234
|
+
reversed: z12.number().int(),
|
|
1235
|
+
unreversed: z12.number().int()
|
|
1297
1236
|
})
|
|
1298
1237
|
),
|
|
1299
|
-
entitlements:
|
|
1300
|
-
|
|
1238
|
+
entitlements: z12.array(
|
|
1239
|
+
z12.object({
|
|
1301
1240
|
entitlement: identifier,
|
|
1302
1241
|
reward: identifier,
|
|
1303
1242
|
outcome: entitlementOutcomeSchema,
|
|
1304
|
-
status:
|
|
1243
|
+
status: z12.string()
|
|
1305
1244
|
})
|
|
1306
1245
|
),
|
|
1307
|
-
deliveries:
|
|
1308
|
-
|
|
1309
|
-
delivery:
|
|
1310
|
-
roleId:
|
|
1246
|
+
deliveries: z12.array(
|
|
1247
|
+
z12.object({
|
|
1248
|
+
delivery: z12.string(),
|
|
1249
|
+
roleId: z12.string(),
|
|
1311
1250
|
outcome: deliveryOutcomeSchema,
|
|
1312
1251
|
/**
|
|
1313
1252
|
* By Relay's records, another accepted, unrevoked completion of the member also granted this
|
|
1314
1253
|
* role to the same Discord account and server. Relay does not read Discord's membership.
|
|
1315
1254
|
*/
|
|
1316
|
-
stillGranted:
|
|
1255
|
+
stillGranted: z12.boolean()
|
|
1317
1256
|
})
|
|
1318
1257
|
),
|
|
1319
|
-
referrals:
|
|
1320
|
-
|
|
1258
|
+
referrals: z12.array(
|
|
1259
|
+
z12.object({
|
|
1321
1260
|
program: identifier,
|
|
1322
1261
|
outcome: referralOutcomeSchema
|
|
1323
1262
|
})
|
|
1324
1263
|
),
|
|
1325
|
-
streakMilestone:
|
|
1326
|
-
});
|
|
1327
|
-
var accessSchema =
|
|
1328
|
-
actor:
|
|
1329
|
-
organization:
|
|
1330
|
-
admin:
|
|
1331
|
-
local:
|
|
1332
|
-
projects:
|
|
1333
|
-
});
|
|
1334
|
-
var querySchema =
|
|
1335
|
-
q:
|
|
1336
|
-
filter:
|
|
1337
|
-
offset:
|
|
1338
|
-
limit:
|
|
1339
|
-
});
|
|
1340
|
-
var accountProfileSchema =
|
|
1341
|
-
name:
|
|
1264
|
+
streakMilestone: z12.boolean()
|
|
1265
|
+
});
|
|
1266
|
+
var accessSchema = z12.object({
|
|
1267
|
+
actor: z12.string(),
|
|
1268
|
+
organization: z12.string(),
|
|
1269
|
+
admin: z12.boolean(),
|
|
1270
|
+
local: z12.boolean(),
|
|
1271
|
+
projects: z12.array(projectSchema)
|
|
1272
|
+
});
|
|
1273
|
+
var querySchema = z12.object({
|
|
1274
|
+
q: z12.string().max(200).default(""),
|
|
1275
|
+
filter: z12.string().max(50).default("all"),
|
|
1276
|
+
offset: z12.coerce.number().int().min(0).max(1e6).default(0),
|
|
1277
|
+
limit: z12.coerce.number().int().min(1).max(100).default(25)
|
|
1278
|
+
});
|
|
1279
|
+
var accountProfileSchema = z12.object({
|
|
1280
|
+
name: z12.string().optional(),
|
|
1342
1281
|
/** The account's handle, where the provider has one (X and Discord). */
|
|
1343
|
-
username:
|
|
1344
|
-
email:
|
|
1345
|
-
emailVerified:
|
|
1346
|
-
imageUrl:
|
|
1282
|
+
username: z12.string().optional(),
|
|
1283
|
+
email: z12.string().optional(),
|
|
1284
|
+
emailVerified: z12.boolean().default(false),
|
|
1285
|
+
imageUrl: z12.string().url().optional()
|
|
1347
1286
|
});
|
|
1348
|
-
var memberAccountSchema =
|
|
1287
|
+
var memberAccountSchema = z12.object({
|
|
1349
1288
|
/** `wallet` for wallet sign-in, `account` for every other connected account. */
|
|
1350
|
-
kind:
|
|
1351
|
-
provider:
|
|
1352
|
-
subject:
|
|
1353
|
-
signInEnabled:
|
|
1289
|
+
kind: z12.enum(["account", "wallet"]),
|
|
1290
|
+
provider: z12.string(),
|
|
1291
|
+
subject: z12.string(),
|
|
1292
|
+
signInEnabled: z12.boolean(),
|
|
1354
1293
|
profile: accountProfileSchema.optional()
|
|
1355
1294
|
});
|
|
1356
|
-
var operationSchema =
|
|
1357
|
-
target:
|
|
1358
|
-
paused:
|
|
1359
|
-
revision:
|
|
1360
|
-
reason:
|
|
1361
|
-
actor:
|
|
1362
|
-
changedAt:
|
|
1363
|
-
});
|
|
1364
|
-
var operationInputSchema =
|
|
1365
|
-
target:
|
|
1366
|
-
|
|
1367
|
-
|
|
1295
|
+
var operationSchema = z12.object({
|
|
1296
|
+
target: z12.string(),
|
|
1297
|
+
paused: z12.boolean(),
|
|
1298
|
+
revision: z12.number().int(),
|
|
1299
|
+
reason: z12.string(),
|
|
1300
|
+
actor: z12.string().nullable(),
|
|
1301
|
+
changedAt: z12.number()
|
|
1302
|
+
});
|
|
1303
|
+
var operationInputSchema = z12.object({
|
|
1304
|
+
target: z12.union([
|
|
1305
|
+
z12.literal("redemptions"),
|
|
1306
|
+
z12.string().regex(/^quest:[\w-]+$/)
|
|
1368
1307
|
]),
|
|
1369
|
-
paused:
|
|
1370
|
-
revision:
|
|
1371
|
-
reason:
|
|
1308
|
+
paused: z12.boolean(),
|
|
1309
|
+
revision: z12.number().int().nonnegative(),
|
|
1310
|
+
reason: z12.string().trim().min(1).max(500),
|
|
1372
1311
|
actionId: identifier
|
|
1373
1312
|
}).strict();
|
|
1374
|
-
var questLifecycleInputSchema =
|
|
1313
|
+
var questLifecycleInputSchema = z12.object({
|
|
1375
1314
|
quest: identifier,
|
|
1376
1315
|
expectedRelease: identifier.optional(),
|
|
1377
|
-
archived:
|
|
1378
|
-
reason:
|
|
1316
|
+
archived: z12.boolean(),
|
|
1317
|
+
reason: z12.string().trim().min(1).max(500),
|
|
1379
1318
|
actionId: identifier
|
|
1380
1319
|
}).strict();
|
|
1381
|
-
var questLifecycleSchema =
|
|
1320
|
+
var questLifecycleSchema = z12.object({
|
|
1382
1321
|
quest: identifier,
|
|
1383
1322
|
key: identifier.nullable(),
|
|
1384
|
-
title:
|
|
1323
|
+
title: z12.string(),
|
|
1385
1324
|
release: identifier,
|
|
1386
|
-
lifecycle:
|
|
1387
|
-
changed:
|
|
1388
|
-
});
|
|
1389
|
-
var memberSchema =
|
|
1390
|
-
id:
|
|
1391
|
-
test:
|
|
1392
|
-
name:
|
|
1393
|
-
accounts:
|
|
1394
|
-
attempts:
|
|
1395
|
-
completions:
|
|
1396
|
-
rewards:
|
|
1397
|
-
lastActivity:
|
|
1398
|
-
});
|
|
1399
|
-
var personSchema =
|
|
1400
|
-
id:
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1325
|
+
lifecycle: z12.enum(["active", "paused", "archived"]),
|
|
1326
|
+
changed: z12.boolean()
|
|
1327
|
+
});
|
|
1328
|
+
var memberSchema = z12.object({
|
|
1329
|
+
id: z12.string(),
|
|
1330
|
+
test: z12.boolean().optional(),
|
|
1331
|
+
name: z12.string().nullable().optional(),
|
|
1332
|
+
accounts: z12.array(memberAccountSchema).default([]),
|
|
1333
|
+
attempts: z12.number(),
|
|
1334
|
+
completions: z12.number(),
|
|
1335
|
+
rewards: z12.number(),
|
|
1336
|
+
lastActivity: z12.number().nullable()
|
|
1337
|
+
});
|
|
1338
|
+
var personSchema = z12.object({
|
|
1339
|
+
id: z12.string(),
|
|
1340
|
+
test: z12.boolean().optional(),
|
|
1341
|
+
name: z12.string().nullable().optional(),
|
|
1342
|
+
accounts: z12.array(memberAccountSchema).default([])
|
|
1343
|
+
});
|
|
1344
|
+
var metricsSchema = z12.object({
|
|
1345
|
+
quests: z12.number(),
|
|
1346
|
+
members: z12.number(),
|
|
1347
|
+
attempts: z12.number(),
|
|
1348
|
+
completions: z12.number(),
|
|
1349
|
+
review: z12.number(),
|
|
1350
|
+
failed: z12.number(),
|
|
1351
|
+
entitlements: z12.number()
|
|
1352
|
+
});
|
|
1353
|
+
var readinessSchema = z12.object({
|
|
1354
|
+
checks: z12.array(
|
|
1355
|
+
z12.object({
|
|
1356
|
+
id: z12.string(),
|
|
1357
|
+
status: z12.enum(["ready", "blocked"]),
|
|
1358
|
+
title: z12.string(),
|
|
1359
|
+
detail: z12.string()
|
|
1419
1360
|
})
|
|
1420
1361
|
)
|
|
1421
1362
|
});
|
|
1422
|
-
var inventorySchema =
|
|
1423
|
-
item:
|
|
1424
|
-
name:
|
|
1425
|
-
available:
|
|
1426
|
-
reserved:
|
|
1427
|
-
allocated:
|
|
1428
|
-
});
|
|
1429
|
-
var auditRecordSchema =
|
|
1430
|
-
id:
|
|
1431
|
-
action:
|
|
1432
|
-
actor:
|
|
1363
|
+
var inventorySchema = z12.object({
|
|
1364
|
+
item: z12.string(),
|
|
1365
|
+
name: z12.string().nullable().default(null),
|
|
1366
|
+
available: z12.number(),
|
|
1367
|
+
reserved: z12.number(),
|
|
1368
|
+
allocated: z12.number().default(0)
|
|
1369
|
+
});
|
|
1370
|
+
var auditRecordSchema = z12.object({
|
|
1371
|
+
id: z12.string(),
|
|
1372
|
+
action: z12.string(),
|
|
1373
|
+
actor: z12.string().nullable(),
|
|
1433
1374
|
user: operatorUserSchema.nullable().optional(),
|
|
1434
|
-
detail:
|
|
1435
|
-
at:
|
|
1436
|
-
attempt:
|
|
1375
|
+
detail: z12.string(),
|
|
1376
|
+
at: z12.number(),
|
|
1377
|
+
attempt: z12.string().nullable()
|
|
1437
1378
|
}).refine((record) => !record.user || record.user.id === record.actor, {
|
|
1438
1379
|
message: "User profile must match the recorded actor",
|
|
1439
1380
|
path: ["user"]
|
|
1440
1381
|
});
|
|
1441
|
-
var pageSchema =
|
|
1382
|
+
var pageSchema = z12.object({
|
|
1442
1383
|
snapshot: snapshotSchema,
|
|
1443
|
-
members:
|
|
1444
|
-
people:
|
|
1384
|
+
members: z12.array(memberSchema),
|
|
1385
|
+
people: z12.array(personSchema).default([]),
|
|
1445
1386
|
metrics: metricsSchema,
|
|
1446
|
-
total:
|
|
1447
|
-
offset:
|
|
1448
|
-
limit:
|
|
1449
|
-
inventory:
|
|
1450
|
-
operations:
|
|
1451
|
-
audit:
|
|
1452
|
-
questCounts:
|
|
1453
|
-
});
|
|
1454
|
-
var managedOAuthAccountBaseSchema =
|
|
1455
|
-
provider:
|
|
1456
|
-
revision:
|
|
1457
|
-
});
|
|
1458
|
-
var managedOAuthAccountSchema =
|
|
1387
|
+
total: z12.number(),
|
|
1388
|
+
offset: z12.number(),
|
|
1389
|
+
limit: z12.number(),
|
|
1390
|
+
inventory: z12.array(inventorySchema),
|
|
1391
|
+
operations: z12.array(operationSchema).default([]),
|
|
1392
|
+
audit: z12.array(auditRecordSchema).default([]),
|
|
1393
|
+
questCounts: z12.record(z12.string(), z12.number())
|
|
1394
|
+
});
|
|
1395
|
+
var managedOAuthAccountBaseSchema = z12.object({
|
|
1396
|
+
provider: z12.enum(["x", "discord"]),
|
|
1397
|
+
revision: z12.number().int().nonnegative()
|
|
1398
|
+
});
|
|
1399
|
+
var managedOAuthAccountSchema = z12.discriminatedUnion("status", [
|
|
1459
1400
|
managedOAuthAccountBaseSchema.extend({
|
|
1460
|
-
status:
|
|
1461
|
-
subject:
|
|
1462
|
-
linkedAt:
|
|
1401
|
+
status: z12.literal("connected"),
|
|
1402
|
+
subject: z12.string().min(1),
|
|
1403
|
+
linkedAt: z12.number()
|
|
1463
1404
|
}),
|
|
1464
|
-
managedOAuthAccountBaseSchema.extend({ status:
|
|
1405
|
+
managedOAuthAccountBaseSchema.extend({ status: z12.literal("disconnected") })
|
|
1465
1406
|
]);
|
|
1466
|
-
var memberOAuthUnlinkInputSchema =
|
|
1467
|
-
provider:
|
|
1468
|
-
subject:
|
|
1469
|
-
revision:
|
|
1470
|
-
reason:
|
|
1407
|
+
var memberOAuthUnlinkInputSchema = z12.object({
|
|
1408
|
+
provider: z12.enum(["x", "discord"]),
|
|
1409
|
+
subject: z12.string().min(1).max(4096),
|
|
1410
|
+
revision: z12.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER - 1),
|
|
1411
|
+
reason: z12.string().trim().min(1).max(500)
|
|
1471
1412
|
}).strict();
|
|
1472
1413
|
var managedWalletSchema = linkedWalletSchema.extend({
|
|
1473
|
-
status:
|
|
1474
|
-
unlinkedAt:
|
|
1414
|
+
status: z12.enum(["linked", "unlinked"]),
|
|
1415
|
+
unlinkedAt: z12.number().int().nullable(),
|
|
1475
1416
|
/** "member", or the operator or key that unlinked it. */
|
|
1476
|
-
unlinkedBy:
|
|
1417
|
+
unlinkedBy: z12.string().nullable()
|
|
1477
1418
|
});
|
|
1478
1419
|
var managedMemberIdentitySchema = memberIdentitySchema.extend({
|
|
1479
|
-
status:
|
|
1480
|
-
unlinkedAt:
|
|
1420
|
+
status: z12.enum(["linked", "unlinked"]),
|
|
1421
|
+
unlinkedAt: z12.number().int().nullable(),
|
|
1481
1422
|
/** The operator or key that unlinked it. */
|
|
1482
|
-
unlinkedBy:
|
|
1423
|
+
unlinkedBy: z12.string().nullable()
|
|
1483
1424
|
});
|
|
1484
|
-
var memberIdentityChangeInputSchema =
|
|
1425
|
+
var memberIdentityChangeInputSchema = z12.object({
|
|
1485
1426
|
kind: appIdentityKindSchema,
|
|
1486
|
-
subject:
|
|
1487
|
-
reason:
|
|
1427
|
+
subject: z12.string().min(1).max(256),
|
|
1428
|
+
reason: z12.string().trim().min(1).max(500)
|
|
1488
1429
|
}).strict();
|
|
1489
1430
|
var balanceCheckSchema = walletBalanceSchema.pick({
|
|
1490
1431
|
chain: true,
|
|
@@ -1494,65 +1435,65 @@ var balanceCheckSchema = walletBalanceSchema.pick({
|
|
|
1494
1435
|
wallets: true,
|
|
1495
1436
|
observedAt: true
|
|
1496
1437
|
}).extend({ attempt: identifier });
|
|
1497
|
-
var walletBalanceChainsSchema =
|
|
1498
|
-
chains:
|
|
1499
|
-
|
|
1500
|
-
chain:
|
|
1501
|
-
|
|
1438
|
+
var walletBalanceChainsSchema = z12.object({
|
|
1439
|
+
chains: z12.array(
|
|
1440
|
+
z12.object({
|
|
1441
|
+
chain: z12.union([
|
|
1442
|
+
z12.literal(solanaMainnet),
|
|
1502
1443
|
cosmosNetworkSchema,
|
|
1503
1444
|
evmChainIdSchema
|
|
1504
1445
|
]),
|
|
1505
|
-
name:
|
|
1506
|
-
testnet:
|
|
1446
|
+
name: z12.string(),
|
|
1447
|
+
testnet: z12.boolean()
|
|
1507
1448
|
})
|
|
1508
1449
|
)
|
|
1509
1450
|
});
|
|
1510
|
-
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason:
|
|
1451
|
+
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason: z12.string().trim().min(1).max(500) }).strict();
|
|
1511
1452
|
var memberWalletSignInInputSchema = walletUnlinkInputSchema.extend({
|
|
1512
|
-
enabled:
|
|
1513
|
-
reason:
|
|
1453
|
+
enabled: z12.boolean(),
|
|
1454
|
+
reason: z12.string().trim().min(1).max(500)
|
|
1514
1455
|
}).strict();
|
|
1515
|
-
var participantSignInSchema =
|
|
1516
|
-
providers:
|
|
1517
|
-
|
|
1456
|
+
var participantSignInSchema = z12.object({
|
|
1457
|
+
providers: z12.array(
|
|
1458
|
+
z12.object({ provider: authProviderSchema, configured: z12.boolean() })
|
|
1518
1459
|
),
|
|
1519
|
-
email:
|
|
1460
|
+
email: z12.boolean(),
|
|
1520
1461
|
/** Wallet families: `"solana"`, `"eip155"`, `"cosmos"`. */
|
|
1521
1462
|
wallets: walletSignInNetworksSchema,
|
|
1522
1463
|
/** Why participants cannot sign in to this project, or null. */
|
|
1523
|
-
issue:
|
|
1524
|
-
updatedAt:
|
|
1525
|
-
updatedBy:
|
|
1464
|
+
issue: z12.string().nullable(),
|
|
1465
|
+
updatedAt: z12.number().nullable(),
|
|
1466
|
+
updatedBy: z12.string().nullable()
|
|
1526
1467
|
});
|
|
1527
|
-
var participantSignInInputSchema =
|
|
1468
|
+
var participantSignInInputSchema = z12.object({
|
|
1528
1469
|
wallets: walletSignInNetworksSchema
|
|
1529
1470
|
}).strict();
|
|
1530
|
-
var completionRevocationShortfallSchema =
|
|
1471
|
+
var completionRevocationShortfallSchema = z12.object({
|
|
1531
1472
|
completion: identifier,
|
|
1532
1473
|
quest: identifier,
|
|
1533
|
-
revokedAt:
|
|
1534
|
-
unreversedPoints:
|
|
1474
|
+
revokedAt: z12.number().int().nonnegative().safe(),
|
|
1475
|
+
unreversedPoints: z12.record(identifier, z12.number().int().positive().safe())
|
|
1535
1476
|
});
|
|
1536
|
-
var memberDetailSchema =
|
|
1477
|
+
var memberDetailSchema = z12.object({
|
|
1537
1478
|
snapshot: snapshotSchema,
|
|
1538
1479
|
member: memberSchema,
|
|
1539
1480
|
progress: memberProgressSchema,
|
|
1540
1481
|
/** Up to 25 revoked completions with an unreversed point remainder, newest first. */
|
|
1541
|
-
revocationShortfalls:
|
|
1482
|
+
revocationShortfalls: z12.array(completionRevocationShortfallSchema).default([]),
|
|
1542
1483
|
/** Current and historical campaign enrollment state, including inactive enrollments. */
|
|
1543
|
-
campaignEnrollments:
|
|
1544
|
-
passes:
|
|
1545
|
-
|
|
1546
|
-
provider:
|
|
1547
|
-
event:
|
|
1548
|
-
subject:
|
|
1484
|
+
campaignEnrollments: z12.array(campaignEnrollmentSchema).default([]),
|
|
1485
|
+
passes: z12.array(
|
|
1486
|
+
z12.object({
|
|
1487
|
+
provider: z12.string(),
|
|
1488
|
+
event: z12.string(),
|
|
1489
|
+
subject: z12.string(),
|
|
1549
1490
|
attempt: identifier.nullable()
|
|
1550
1491
|
})
|
|
1551
1492
|
).default([]),
|
|
1552
1493
|
/** Linked and unlinked wallets. */
|
|
1553
|
-
wallets:
|
|
1494
|
+
wallets: z12.array(managedWalletSchema),
|
|
1554
1495
|
/** The member's 10 most recent recorded balance reads, newest first. */
|
|
1555
|
-
balanceChecks:
|
|
1496
|
+
balanceChecks: z12.array(balanceCheckSchema),
|
|
1556
1497
|
/** The member's participant profile in this project. */
|
|
1557
1498
|
profile: managedProfileSchema.nullable(),
|
|
1558
1499
|
/**
|
|
@@ -1560,123 +1501,129 @@ var memberDetailSchema = z13.object({
|
|
|
1560
1501
|
* member ID: their selected X and Discord accounts and their `app:<name>` identities in this
|
|
1561
1502
|
* project, including app identities an operator unlinked, by kind.
|
|
1562
1503
|
*/
|
|
1563
|
-
identities:
|
|
1504
|
+
identities: z12.array(managedMemberIdentitySchema)
|
|
1564
1505
|
});
|
|
1565
|
-
var stockInputSchema =
|
|
1506
|
+
var stockInputSchema = z12.object({
|
|
1566
1507
|
item: identifier,
|
|
1567
|
-
quantity:
|
|
1508
|
+
quantity: z12.number().int().positive().max(1e6),
|
|
1568
1509
|
actionId: identifier
|
|
1569
1510
|
}).strict();
|
|
1570
|
-
var ingestTrackerScopeSchema =
|
|
1571
|
-
var tokenScopeInputSchema =
|
|
1572
|
-
var tokenInputSchema =
|
|
1573
|
-
name:
|
|
1511
|
+
var ingestTrackerScopeSchema = z12.array(identifier).min(1).max(100).nullable();
|
|
1512
|
+
var tokenScopeInputSchema = z12.object({ ingestTrackers: ingestTrackerScopeSchema }).strict();
|
|
1513
|
+
var tokenInputSchema = z12.object({
|
|
1514
|
+
name: z12.string().trim().min(1).max(80),
|
|
1574
1515
|
project: identifier,
|
|
1575
1516
|
environment: environmentSchema,
|
|
1576
|
-
permissions:
|
|
1517
|
+
permissions: z12.array(permissionSchema).min(1),
|
|
1577
1518
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
1578
|
-
days:
|
|
1519
|
+
days: z12.number().int().min(1).max(90).default(30)
|
|
1579
1520
|
}).strict();
|
|
1580
|
-
var tokenSchema =
|
|
1581
|
-
id:
|
|
1582
|
-
name:
|
|
1583
|
-
project:
|
|
1521
|
+
var tokenSchema = z12.object({
|
|
1522
|
+
id: z12.string(),
|
|
1523
|
+
name: z12.string(),
|
|
1524
|
+
project: z12.string(),
|
|
1584
1525
|
environment: environmentSchema,
|
|
1585
1526
|
permissions: permissionListSchema,
|
|
1586
1527
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
1587
|
-
expiresAt:
|
|
1528
|
+
expiresAt: z12.number()
|
|
1588
1529
|
});
|
|
1589
|
-
var issuedTokenSchema = tokenSchema.extend({ token:
|
|
1590
|
-
var teamSchema =
|
|
1591
|
-
|
|
1530
|
+
var issuedTokenSchema = tokenSchema.extend({ token: z12.string() });
|
|
1531
|
+
var teamSchema = z12.array(
|
|
1532
|
+
z12.object({ id: z12.string(), label: z12.string() })
|
|
1592
1533
|
);
|
|
1593
|
-
var memberLookupSchema =
|
|
1594
|
-
provider:
|
|
1595
|
-
subject:
|
|
1534
|
+
var memberLookupSchema = z12.object({
|
|
1535
|
+
provider: z12.string().min(1).max(200),
|
|
1536
|
+
subject: z12.string().min(1).max(2048)
|
|
1596
1537
|
}).strict();
|
|
1597
|
-
var booleanQuery =
|
|
1598
|
-
|
|
1599
|
-
|
|
1538
|
+
var booleanQuery = z12.union([
|
|
1539
|
+
z12.boolean(),
|
|
1540
|
+
z12.enum(["true", "false"]).transform((v) => v === "true")
|
|
1600
1541
|
]);
|
|
1601
|
-
var managedMemberQuerySchema =
|
|
1602
|
-
q:
|
|
1542
|
+
var managedMemberQuerySchema = z12.strictObject({
|
|
1543
|
+
q: z12.string().max(200).optional(),
|
|
1603
1544
|
needsReview: booleanQuery.optional(),
|
|
1604
|
-
limit:
|
|
1545
|
+
limit: z12.coerce.number().int().min(1).max(100).optional(),
|
|
1605
1546
|
cursor: pageCursorSchema.optional()
|
|
1606
1547
|
});
|
|
1607
|
-
var managedMemberPageSchema =
|
|
1608
|
-
items:
|
|
1609
|
-
total:
|
|
1610
|
-
nextCursor:
|
|
1548
|
+
var managedMemberPageSchema = z12.object({
|
|
1549
|
+
items: z12.array(memberSchema),
|
|
1550
|
+
total: z12.number().int().nonnegative(),
|
|
1551
|
+
nextCursor: z12.string().nullable()
|
|
1611
1552
|
});
|
|
1612
1553
|
var projectMetricsSchema = metricsSchema.extend({
|
|
1613
|
-
completionsByQuest:
|
|
1614
|
-
|
|
1554
|
+
completionsByQuest: z12.array(
|
|
1555
|
+
z12.object({ quest: identifier, completions: z12.number() })
|
|
1615
1556
|
)
|
|
1616
1557
|
});
|
|
1617
|
-
var pageLimit =
|
|
1618
|
-
var managedAttemptQuerySchema =
|
|
1619
|
-
q:
|
|
1620
|
-
status:
|
|
1558
|
+
var pageLimit = z12.coerce.number().int().min(1).max(100).optional();
|
|
1559
|
+
var managedAttemptQuerySchema = z12.strictObject({
|
|
1560
|
+
q: z12.string().max(200).optional(),
|
|
1561
|
+
status: z12.string().min(1).max(50).optional(),
|
|
1562
|
+
limit: pageLimit,
|
|
1563
|
+
cursor: pageCursorSchema.optional()
|
|
1564
|
+
});
|
|
1565
|
+
var managedAttemptPageSchema = z12.object({
|
|
1566
|
+
items: z12.array(attemptSchema),
|
|
1567
|
+
releases: z12.array(publishedReleaseSchema),
|
|
1568
|
+
people: z12.array(personSchema),
|
|
1569
|
+
total: z12.number().int().nonnegative(),
|
|
1570
|
+
nextCursor: z12.string().nullable()
|
|
1571
|
+
});
|
|
1572
|
+
var managedReleaseQuerySchema = z12.strictObject({
|
|
1573
|
+
quest: identifier.optional(),
|
|
1621
1574
|
limit: pageLimit,
|
|
1622
1575
|
cursor: pageCursorSchema.optional()
|
|
1623
1576
|
});
|
|
1624
|
-
var
|
|
1625
|
-
items:
|
|
1626
|
-
|
|
1627
|
-
people: z13.array(personSchema),
|
|
1628
|
-
total: z13.number().int().nonnegative(),
|
|
1629
|
-
nextCursor: z13.string().nullable()
|
|
1577
|
+
var managedReleasePageSchema = z12.object({
|
|
1578
|
+
items: z12.array(publishedReleaseSchema),
|
|
1579
|
+
nextCursor: z12.string().nullable()
|
|
1630
1580
|
});
|
|
1631
|
-
var managedAttemptSchema =
|
|
1581
|
+
var managedAttemptSchema = z12.object({
|
|
1632
1582
|
attempt: attemptSchema,
|
|
1633
1583
|
release: publishedReleaseSchema.nullable(),
|
|
1634
|
-
events:
|
|
1584
|
+
events: z12.array(eventSchema),
|
|
1635
1585
|
person: personSchema
|
|
1636
1586
|
});
|
|
1637
|
-
var managedEntitlementQuerySchema =
|
|
1638
|
-
q:
|
|
1639
|
-
status:
|
|
1587
|
+
var managedEntitlementQuerySchema = z12.strictObject({
|
|
1588
|
+
q: z12.string().max(200).optional(),
|
|
1589
|
+
status: z12.string().min(1).max(50).optional(),
|
|
1640
1590
|
limit: pageLimit,
|
|
1641
1591
|
cursor: pageCursorSchema.optional()
|
|
1642
1592
|
});
|
|
1643
|
-
var managedEntitlementPageSchema =
|
|
1644
|
-
items:
|
|
1645
|
-
people:
|
|
1646
|
-
total:
|
|
1647
|
-
nextCursor:
|
|
1593
|
+
var managedEntitlementPageSchema = z12.object({
|
|
1594
|
+
items: z12.array(entitlementSchema),
|
|
1595
|
+
people: z12.array(personSchema),
|
|
1596
|
+
total: z12.number().int().nonnegative(),
|
|
1597
|
+
nextCursor: z12.string().nullable()
|
|
1648
1598
|
});
|
|
1649
|
-
var managedEntitlementSchema =
|
|
1599
|
+
var managedEntitlementSchema = z12.object({
|
|
1650
1600
|
entitlement: entitlementSchema,
|
|
1651
1601
|
person: personSchema
|
|
1652
1602
|
});
|
|
1653
1603
|
var managedStockItemSchema = inventorySchema.extend({
|
|
1654
|
-
offers:
|
|
1604
|
+
offers: z12.array(identifier)
|
|
1655
1605
|
});
|
|
1656
|
-
var auditQuerySchema =
|
|
1657
|
-
category:
|
|
1658
|
-
q:
|
|
1606
|
+
var auditQuerySchema = z12.strictObject({
|
|
1607
|
+
category: z12.enum(["reviews", "rewards", "configuration"]).optional(),
|
|
1608
|
+
q: z12.string().max(200).optional(),
|
|
1659
1609
|
limit: pageLimit,
|
|
1660
1610
|
cursor: pageCursorSchema.optional()
|
|
1661
1611
|
});
|
|
1662
1612
|
var accessHistoryQuerySchema = auditQuerySchema.omit({
|
|
1663
1613
|
category: true
|
|
1664
1614
|
});
|
|
1665
|
-
var auditPageSchema =
|
|
1666
|
-
items:
|
|
1667
|
-
total:
|
|
1668
|
-
nextCursor:
|
|
1615
|
+
var auditPageSchema = z12.object({
|
|
1616
|
+
items: z12.array(auditRecordSchema),
|
|
1617
|
+
total: z12.number().int().nonnegative(),
|
|
1618
|
+
nextCursor: z12.string().nullable()
|
|
1669
1619
|
});
|
|
1670
|
-
var verifiedPassSchema =
|
|
1620
|
+
var verifiedPassSchema = z12.object({
|
|
1671
1621
|
provider: identifier,
|
|
1672
1622
|
event: identifier,
|
|
1673
|
-
subject:
|
|
1623
|
+
subject: z12.string().min(1).max(2048),
|
|
1674
1624
|
member: identifier,
|
|
1675
1625
|
quest: identifier
|
|
1676
1626
|
}).strict();
|
|
1677
|
-
function actionIdOf(input) {
|
|
1678
|
-
return typeof input === "object" && input !== null && "actionId" in input && typeof input.actionId === "string" ? input.actionId : void 0;
|
|
1679
|
-
}
|
|
1680
1627
|
function groupKey(group) {
|
|
1681
1628
|
return identifier.parse(
|
|
1682
1629
|
typeof group === "string" ? group : projectGroupKey(group)
|
|
@@ -1690,16 +1637,6 @@ function queryString(values) {
|
|
|
1690
1637
|
).toString();
|
|
1691
1638
|
return query ? "?" + query : "";
|
|
1692
1639
|
}
|
|
1693
|
-
function checkedTimeout(timeout) {
|
|
1694
|
-
if (timeout !== void 0 && !validTimeout(timeout)) {
|
|
1695
|
-
throw new ManagementError({
|
|
1696
|
-
kind: "client",
|
|
1697
|
-
code: ManagementErrorCode.InvalidInput,
|
|
1698
|
-
message: "Management timeout must be a positive, finite number of milliseconds"
|
|
1699
|
-
});
|
|
1700
|
-
}
|
|
1701
|
-
return timeout;
|
|
1702
|
-
}
|
|
1703
1640
|
function clientFailure(error) {
|
|
1704
1641
|
if (error instanceof ManagementError) {
|
|
1705
1642
|
return error;
|
|
@@ -1707,7 +1644,7 @@ function clientFailure(error) {
|
|
|
1707
1644
|
return new ManagementError({
|
|
1708
1645
|
kind: "client",
|
|
1709
1646
|
code: ManagementErrorCode.InvalidInput,
|
|
1710
|
-
message: error instanceof
|
|
1647
|
+
message: error instanceof z12.ZodError ? `Invalid management request: ${z12.prettifyError(error)}` : error instanceof Error ? error.message : "Invalid management request",
|
|
1711
1648
|
cause: error
|
|
1712
1649
|
});
|
|
1713
1650
|
}
|
|
@@ -1731,231 +1668,7 @@ function createManagementClient(options) {
|
|
|
1731
1668
|
return managementClient(options);
|
|
1732
1669
|
}
|
|
1733
1670
|
function managementClient(options) {
|
|
1734
|
-
const
|
|
1735
|
-
function callLifetime(call) {
|
|
1736
|
-
return lifetime(
|
|
1737
|
-
checkedTimeout(call?.timeout) ?? clientTimeout,
|
|
1738
|
-
call?.signal ?? void 0
|
|
1739
|
-
);
|
|
1740
|
-
}
|
|
1741
|
-
function transportFailure(error, context, life, sent, status, refused = false, headers) {
|
|
1742
|
-
if (error instanceof ManagementError) {
|
|
1743
|
-
return error;
|
|
1744
|
-
}
|
|
1745
|
-
const unsent = {
|
|
1746
|
-
retryAfter: headers ? retryAfter(headers) : void 0,
|
|
1747
|
-
...!sent ? { uncertain: false } : refused ? {
|
|
1748
|
-
uncertain: context.method !== "GET" && [500, 502, 504].includes(status ?? 0)
|
|
1749
|
-
} : {},
|
|
1750
|
-
...status === void 0 ? {} : { status }
|
|
1751
|
-
};
|
|
1752
|
-
const ended = life.ended();
|
|
1753
|
-
if (ended === "aborted") {
|
|
1754
|
-
return new ManagementError({
|
|
1755
|
-
...context,
|
|
1756
|
-
...unsent,
|
|
1757
|
-
kind: "aborted",
|
|
1758
|
-
code: ManagementErrorCode.Aborted,
|
|
1759
|
-
message: "The management request was cancelled",
|
|
1760
|
-
cause: life.reason()
|
|
1761
|
-
});
|
|
1762
|
-
}
|
|
1763
|
-
if (ended === "timeout") {
|
|
1764
|
-
return new ManagementError({
|
|
1765
|
-
...context,
|
|
1766
|
-
...unsent,
|
|
1767
|
-
kind: "timeout",
|
|
1768
|
-
code: ManagementErrorCode.Timeout,
|
|
1769
|
-
message: `The management request did not finish within ${life.timeout} ms`,
|
|
1770
|
-
cause: error
|
|
1771
|
-
});
|
|
1772
|
-
}
|
|
1773
|
-
return new ManagementError({
|
|
1774
|
-
...context,
|
|
1775
|
-
...unsent,
|
|
1776
|
-
kind: "network",
|
|
1777
|
-
code: ManagementErrorCode.Network,
|
|
1778
|
-
message: "The management request failed before Domino answered",
|
|
1779
|
-
cause: error
|
|
1780
|
-
});
|
|
1781
|
-
}
|
|
1782
|
-
async function credential(context, life) {
|
|
1783
|
-
if (!options.getToken) {
|
|
1784
|
-
return null;
|
|
1785
|
-
}
|
|
1786
|
-
const getToken = options.getToken;
|
|
1787
|
-
try {
|
|
1788
|
-
return await new Promise((resolve, reject) => {
|
|
1789
|
-
const stop = () => reject(life.signal.reason);
|
|
1790
|
-
life.signal.addEventListener("abort", stop, { once: true });
|
|
1791
|
-
getToken().then(resolve, reject).finally(() => life.signal.removeEventListener("abort", stop));
|
|
1792
|
-
});
|
|
1793
|
-
} catch (error) {
|
|
1794
|
-
if (life.signal.aborted) {
|
|
1795
|
-
throw transportFailure(error, context, life, false);
|
|
1796
|
-
}
|
|
1797
|
-
throw new ManagementError({
|
|
1798
|
-
...context,
|
|
1799
|
-
// A token source that could not reach its own service failed like a network call.
|
|
1800
|
-
kind: error instanceof TypeError ? "network" : "client",
|
|
1801
|
-
code: ManagementErrorCode.Credential,
|
|
1802
|
-
uncertain: false,
|
|
1803
|
-
message: "Could not get a management credential",
|
|
1804
|
-
cause: error
|
|
1805
|
-
});
|
|
1806
|
-
}
|
|
1807
|
-
}
|
|
1808
|
-
async function send(path, fetchInit, context, life) {
|
|
1809
|
-
if (life.signal.aborted) {
|
|
1810
|
-
throw transportFailure(life.reason(), context, life, false);
|
|
1811
|
-
}
|
|
1812
|
-
const headers = new Headers(fetchInit.headers);
|
|
1813
|
-
headers.set("X-Domino-Client", clientIdentity());
|
|
1814
|
-
const token = await credential(context, life);
|
|
1815
|
-
if (token) {
|
|
1816
|
-
headers.set("Authorization", `Bearer ${token}`);
|
|
1817
|
-
}
|
|
1818
|
-
if (options.organization) {
|
|
1819
|
-
headers.set("X-Relay-Organization", options.organization);
|
|
1820
|
-
}
|
|
1821
|
-
if (options.project) {
|
|
1822
|
-
headers.set("X-Relay-Project", options.project);
|
|
1823
|
-
}
|
|
1824
|
-
if (options.environment) {
|
|
1825
|
-
headers.set("X-Relay-Environment", options.environment);
|
|
1826
|
-
}
|
|
1827
|
-
let response;
|
|
1828
|
-
try {
|
|
1829
|
-
response = await fetch(`${options.baseUrl}/management/v1${path}`, {
|
|
1830
|
-
...fetchInit,
|
|
1831
|
-
headers,
|
|
1832
|
-
signal: life.signal
|
|
1833
|
-
});
|
|
1834
|
-
} catch (error) {
|
|
1835
|
-
throw transportFailure(error, context, life, true);
|
|
1836
|
-
}
|
|
1837
|
-
if (!response.ok) {
|
|
1838
|
-
let text;
|
|
1839
|
-
try {
|
|
1840
|
-
text = await response.text();
|
|
1841
|
-
} catch (error2) {
|
|
1842
|
-
throw transportFailure(
|
|
1843
|
-
error2,
|
|
1844
|
-
context,
|
|
1845
|
-
life,
|
|
1846
|
-
true,
|
|
1847
|
-
response.status,
|
|
1848
|
-
true,
|
|
1849
|
-
response.headers
|
|
1850
|
-
);
|
|
1851
|
-
}
|
|
1852
|
-
let body = null;
|
|
1853
|
-
try {
|
|
1854
|
-
body = JSON.parse(text);
|
|
1855
|
-
} catch {
|
|
1856
|
-
}
|
|
1857
|
-
const parsed = managementErrorSchema.safeParse(body);
|
|
1858
|
-
const { error, code, ...details } = parsed.success ? parsed.data : { error: `Request failed (${response.status})`, code: void 0 };
|
|
1859
|
-
throw new ManagementError({
|
|
1860
|
-
...context,
|
|
1861
|
-
kind: "http",
|
|
1862
|
-
status: response.status,
|
|
1863
|
-
message: error,
|
|
1864
|
-
...code === void 0 ? {} : { code },
|
|
1865
|
-
details,
|
|
1866
|
-
retryAfter: retryAfter(response.headers)
|
|
1867
|
-
});
|
|
1868
|
-
}
|
|
1869
|
-
return response;
|
|
1870
|
-
}
|
|
1871
|
-
async function raw(path, init) {
|
|
1872
|
-
const { timeout, signal, ...fetchInit } = init ?? {};
|
|
1873
|
-
const life = callLifetime({ timeout, signal: signal ?? void 0 });
|
|
1874
|
-
try {
|
|
1875
|
-
return await send(
|
|
1876
|
-
path,
|
|
1877
|
-
fetchInit,
|
|
1878
|
-
{
|
|
1879
|
-
method: (fetchInit.method ?? "GET").toUpperCase(),
|
|
1880
|
-
path: path.split("?")[0],
|
|
1881
|
-
replaySafe: false
|
|
1882
|
-
},
|
|
1883
|
-
life
|
|
1884
|
-
);
|
|
1885
|
-
} finally {
|
|
1886
|
-
life.end();
|
|
1887
|
-
}
|
|
1888
|
-
}
|
|
1889
|
-
async function exchange(path, schema, input, method, call, replaySafe, tolerant = false) {
|
|
1890
|
-
const actionId = actionIdOf(input);
|
|
1891
|
-
const context = {
|
|
1892
|
-
method,
|
|
1893
|
-
replaySafe,
|
|
1894
|
-
path: path.split("?")[0],
|
|
1895
|
-
...actionId ? { actionId } : {}
|
|
1896
|
-
};
|
|
1897
|
-
const fetchInit = {
|
|
1898
|
-
method,
|
|
1899
|
-
headers: tolerant ? { "X-Domino-Response": "tolerant-v1" } : void 0,
|
|
1900
|
-
...input === void 0 ? {} : {
|
|
1901
|
-
headers: {
|
|
1902
|
-
"Content-Type": "application/json",
|
|
1903
|
-
...tolerant ? { "X-Domino-Response": "tolerant-v1" } : {}
|
|
1904
|
-
},
|
|
1905
|
-
body: JSON.stringify(input)
|
|
1906
|
-
}
|
|
1907
|
-
};
|
|
1908
|
-
const life = callLifetime(call);
|
|
1909
|
-
try {
|
|
1910
|
-
return await retrying(
|
|
1911
|
-
life,
|
|
1912
|
-
{ replaySafe: method === "GET" || replaySafe },
|
|
1913
|
-
async () => {
|
|
1914
|
-
const response = await send(path, fetchInit, context, life);
|
|
1915
|
-
let body;
|
|
1916
|
-
try {
|
|
1917
|
-
body = await response.json();
|
|
1918
|
-
} catch (error) {
|
|
1919
|
-
if (error instanceof SyntaxError && !life.signal.aborted) {
|
|
1920
|
-
throw new ManagementError({
|
|
1921
|
-
...context,
|
|
1922
|
-
kind: "invalid-response",
|
|
1923
|
-
code: ManagementErrorCode.InvalidResponse,
|
|
1924
|
-
status: response.status,
|
|
1925
|
-
message: "Domino answered with a body that is not JSON",
|
|
1926
|
-
cause: error
|
|
1927
|
-
});
|
|
1928
|
-
}
|
|
1929
|
-
throw transportFailure(
|
|
1930
|
-
error,
|
|
1931
|
-
context,
|
|
1932
|
-
life,
|
|
1933
|
-
true,
|
|
1934
|
-
response.status,
|
|
1935
|
-
false,
|
|
1936
|
-
response.headers
|
|
1937
|
-
);
|
|
1938
|
-
}
|
|
1939
|
-
const parsed = knownResponse(schema).safeParse(
|
|
1940
|
-
tolerant ? { status: response.status, operationId: actionId, result: body } : body
|
|
1941
|
-
);
|
|
1942
|
-
if (!parsed.success) {
|
|
1943
|
-
throw new ManagementError({
|
|
1944
|
-
...context,
|
|
1945
|
-
kind: "invalid-response",
|
|
1946
|
-
code: ManagementErrorCode.InvalidResponse,
|
|
1947
|
-
status: response.status,
|
|
1948
|
-
message: "Domino answered with a response this client does not recognize",
|
|
1949
|
-
cause: parsed.error
|
|
1950
|
-
});
|
|
1951
|
-
}
|
|
1952
|
-
return parsed.data;
|
|
1953
|
-
}
|
|
1954
|
-
);
|
|
1955
|
-
} finally {
|
|
1956
|
-
life.end();
|
|
1957
|
-
}
|
|
1958
|
-
}
|
|
1671
|
+
const { raw, exchange } = managementTransport(options);
|
|
1959
1672
|
async function request(path, schema, input, method = input === void 0 ? "GET" : "POST", call) {
|
|
1960
1673
|
return exchange(path, schema, input, method.toUpperCase(), call, false);
|
|
1961
1674
|
}
|
|
@@ -1969,7 +1682,7 @@ function managementClient(options) {
|
|
|
1969
1682
|
call
|
|
1970
1683
|
);
|
|
1971
1684
|
}
|
|
1972
|
-
const ok =
|
|
1685
|
+
const ok = z12.object({ ok: z12.literal(true) });
|
|
1973
1686
|
function pointHistory(member, ledger, query = {}, call) {
|
|
1974
1687
|
return get(
|
|
1975
1688
|
`/points/${identifier.parse(member)}/${identifier.parse(ledger)}/history${queryString(typeof query === "number" ? { before: query } : pageQuerySchema.parse(query))}`,
|
|
@@ -2091,8 +1804,8 @@ function managementClient(options) {
|
|
|
2091
1804
|
}
|
|
2092
1805
|
return exchange(
|
|
2093
1806
|
path,
|
|
2094
|
-
|
|
2095
|
-
status:
|
|
1807
|
+
z12.object({
|
|
1808
|
+
status: z12.number(),
|
|
2096
1809
|
operationId: identifier.optional(),
|
|
2097
1810
|
result: schema
|
|
2098
1811
|
}),
|
|
@@ -2123,7 +1836,7 @@ function managementClient(options) {
|
|
|
2123
1836
|
call
|
|
2124
1837
|
),
|
|
2125
1838
|
...resourceArchiveMethods("tracker"),
|
|
2126
|
-
list: (call) => get("/trackers",
|
|
1839
|
+
list: (call) => get("/trackers", z12.array(trackerStatusSchema), call),
|
|
2127
1840
|
get: (reference, call) => get(
|
|
2128
1841
|
`/trackers/${identifier.parse(reference)}`,
|
|
2129
1842
|
trackerStatusSchema,
|
|
@@ -2239,7 +1952,7 @@ function managementClient(options) {
|
|
|
2239
1952
|
engagementPublishSchema.parse(withActionId(input)),
|
|
2240
1953
|
call
|
|
2241
1954
|
),
|
|
2242
|
-
list: (call) => get("/engagement",
|
|
1955
|
+
list: (call) => get("/engagement", z12.array(engagementRuleSchema), call),
|
|
2243
1956
|
page: (input, call) => get(
|
|
2244
1957
|
"/engagement/history" + queryString(engagementPageQuerySchema.parse(input)),
|
|
2245
1958
|
engagementPageSchema,
|
|
@@ -2260,7 +1973,7 @@ function managementClient(options) {
|
|
|
2260
1973
|
},
|
|
2261
1974
|
pointLedgers: {
|
|
2262
1975
|
unarchive: (ledger, input, call) => archiveResource("point-ledger", ledger, false, input, call),
|
|
2263
|
-
list: (call) => get("/point-ledgers",
|
|
1976
|
+
list: (call) => get("/point-ledgers", z12.array(managedPointLedgerSchema), call),
|
|
2264
1977
|
/**
|
|
2265
1978
|
* Creates a point ledger, with a stable `key` when code refers to it; requires `publish`. In
|
|
2266
1979
|
* live, only a person in Console can create one.
|
|
@@ -2290,7 +2003,7 @@ function managementClient(options) {
|
|
|
2290
2003
|
},
|
|
2291
2004
|
points: {
|
|
2292
2005
|
/** @deprecated Use `pointLedgers.list()`, which reads the same ledgers. Removed in 2.0.0. */
|
|
2293
|
-
ledgers: (call) => get("/point-ledgers",
|
|
2006
|
+
ledgers: (call) => get("/point-ledgers", z12.array(managedPointLedgerSchema), call),
|
|
2294
2007
|
/** @deprecated Use `pointLedgers.create(input)`. Removed in 2.0.0. */
|
|
2295
2008
|
createLedger: createPointLedger,
|
|
2296
2009
|
/**
|
|
@@ -2328,7 +2041,7 @@ function managementClient(options) {
|
|
|
2328
2041
|
referralHistorySchema,
|
|
2329
2042
|
call
|
|
2330
2043
|
),
|
|
2331
|
-
list: (call) => get("/referrals",
|
|
2044
|
+
list: (call) => get("/referrals", z12.array(publishedReferralSchema), call),
|
|
2332
2045
|
participants: referralParticipants,
|
|
2333
2046
|
/**
|
|
2334
2047
|
* Suspends or restores a member's referral relationship, with a reason; requires `publish`.
|
|
@@ -2391,7 +2104,7 @@ function managementClient(options) {
|
|
|
2391
2104
|
},
|
|
2392
2105
|
leaderboards: {
|
|
2393
2106
|
...resourceArchiveMethods("leaderboard"),
|
|
2394
|
-
list: (call) => get("/leaderboards",
|
|
2107
|
+
list: (call) => get("/leaderboards", z12.array(publishedLeaderboardSchema), call),
|
|
2395
2108
|
standings: (board, input = {}, call) => {
|
|
2396
2109
|
const query = leaderboardQuerySchema.parse(input);
|
|
2397
2110
|
return get(
|
|
@@ -2405,12 +2118,12 @@ function managementClient(options) {
|
|
|
2405
2118
|
},
|
|
2406
2119
|
history: (board, call) => get(
|
|
2407
2120
|
`/leaderboards/${identifier.parse(board)}/history`,
|
|
2408
|
-
|
|
2121
|
+
z12.array(publishedLeaderboardSchema),
|
|
2409
2122
|
call
|
|
2410
2123
|
),
|
|
2411
2124
|
exclusions: (board, call) => get(
|
|
2412
2125
|
`/leaderboards/${identifier.parse(board)}/exclusions`,
|
|
2413
|
-
|
|
2126
|
+
z12.array(z12.object({ member: identifier })),
|
|
2414
2127
|
call
|
|
2415
2128
|
),
|
|
2416
2129
|
exclude: (board, input, call) => post(
|
|
@@ -2451,7 +2164,7 @@ function managementClient(options) {
|
|
|
2451
2164
|
),
|
|
2452
2165
|
settlements: (board, call) => get(
|
|
2453
2166
|
`/leaderboards/${identifier.parse(board)}/settlements`,
|
|
2454
|
-
|
|
2167
|
+
z12.array(leaderboardSettlementSummarySchema),
|
|
2455
2168
|
call
|
|
2456
2169
|
),
|
|
2457
2170
|
settlement: (settlement, call) => get(
|
|
@@ -2531,7 +2244,7 @@ function managementClient(options) {
|
|
|
2531
2244
|
)
|
|
2532
2245
|
},
|
|
2533
2246
|
deployments: {
|
|
2534
|
-
list: (call) => get("/deployments",
|
|
2247
|
+
list: (call) => get("/deployments", z12.array(deploymentRecordSchema), call),
|
|
2535
2248
|
get: (deployment, call) => get(
|
|
2536
2249
|
`/deployments/${identifier.parse(deployment)}`,
|
|
2537
2250
|
deploymentRecordSchema,
|
|
@@ -2598,6 +2311,28 @@ function managementClient(options) {
|
|
|
2598
2311
|
metrics: {
|
|
2599
2312
|
read: (call) => get("/metrics", projectMetricsSchema, call)
|
|
2600
2313
|
},
|
|
2314
|
+
/** Release history: every version a quest has been published as. */
|
|
2315
|
+
releases: {
|
|
2316
|
+
/**
|
|
2317
|
+
* One page of the project's releases, newest first, including each quest's earlier
|
|
2318
|
+
* releases; `quest` keeps one quest's. Pass a page's `nextCursor` back as `cursor` for the
|
|
2319
|
+
* next page. Requires `read` and `publish` permission.
|
|
2320
|
+
*/
|
|
2321
|
+
list: (query = {}, call) => get(
|
|
2322
|
+
`/releases/list${queryString(managedReleaseQuerySchema.parse(query))}`,
|
|
2323
|
+
managedReleasePageSchema,
|
|
2324
|
+
call
|
|
2325
|
+
),
|
|
2326
|
+
/**
|
|
2327
|
+
* One release by ID, current or historical. Requires `read` and `publish` permission.
|
|
2328
|
+
* Fails with 404 when the project has no such release.
|
|
2329
|
+
*/
|
|
2330
|
+
get: (release, call) => get(
|
|
2331
|
+
`/releases/${identifier.parse(release)}`,
|
|
2332
|
+
publishedReleaseSchema,
|
|
2333
|
+
call
|
|
2334
|
+
)
|
|
2335
|
+
},
|
|
2601
2336
|
/** Attempts, staff-confirmed quests and reviews. */
|
|
2602
2337
|
attempts: {
|
|
2603
2338
|
/**
|
|
@@ -2619,6 +2354,17 @@ function managementClient(options) {
|
|
|
2619
2354
|
managedAttemptSchema,
|
|
2620
2355
|
call
|
|
2621
2356
|
),
|
|
2357
|
+
/**
|
|
2358
|
+
* Everything one evaluation run of a test-environment attempt read, for `replayAttempt` from
|
|
2359
|
+
* `@domino-sdk/relay/testing`; requires `publish` permission, because captures hold raw provider answers. Relay serves captures only in the
|
|
2360
|
+
* test environment: in live it fails with 422 `test-environment-required`. An attempt with
|
|
2361
|
+
* no evaluation run yet fails with 409 `attempt-not-evaluated`.
|
|
2362
|
+
*/
|
|
2363
|
+
capture: (attempt, call) => get(
|
|
2364
|
+
`/attempts/${identifier.parse(attempt)}/capture`,
|
|
2365
|
+
attemptCaptureSchema,
|
|
2366
|
+
call
|
|
2367
|
+
),
|
|
2622
2368
|
/**
|
|
2623
2369
|
* Submits a staff-confirmed quest (`manual({ actor: "staff" })`) for a member; requires
|
|
2624
2370
|
* `confirm` permission. Resolves with the queued attempt, or with the original attempt when
|
|
@@ -2767,7 +2513,7 @@ function managementClient(options) {
|
|
|
2767
2513
|
},
|
|
2768
2514
|
operations: {
|
|
2769
2515
|
/** Every paused or resumed operation: redemptions and each quest's participation; requires `read`. */
|
|
2770
|
-
list: (call) => get("/operations",
|
|
2516
|
+
list: (call) => get("/operations", z12.array(operationSchema), call),
|
|
2771
2517
|
/**
|
|
2772
2518
|
* Pauses or resumes redemptions or one quest's participation, against the `revision` the
|
|
2773
2519
|
* operator saw, with a reason; requires `publish` permission.
|
|
@@ -2816,7 +2562,7 @@ function managementClient(options) {
|
|
|
2816
2562
|
call
|
|
2817
2563
|
),
|
|
2818
2564
|
/** Every stock item with its counts and the offers that sell it; requires `read` permission. */
|
|
2819
|
-
list: (call) => get("/stock-items",
|
|
2565
|
+
list: (call) => get("/stock-items", z12.array(managedStockItemSchema), call),
|
|
2820
2566
|
createItem: (input, call) => create(
|
|
2821
2567
|
"/stock-items",
|
|
2822
2568
|
stockItemSchema,
|
|
@@ -2831,7 +2577,7 @@ function managementClient(options) {
|
|
|
2831
2577
|
stockInputSchema.parse(withActionId(input)),
|
|
2832
2578
|
call
|
|
2833
2579
|
),
|
|
2834
|
-
catalog: (call) => get("/pickup-inventory",
|
|
2580
|
+
catalog: (call) => get("/pickup-inventory", z12.array(pickupCatalogSchema), call),
|
|
2835
2581
|
configure: (input, call) => post(
|
|
2836
2582
|
"/pickup-inventory",
|
|
2837
2583
|
pickupCatalogSchema,
|
|
@@ -2857,10 +2603,10 @@ function managementClient(options) {
|
|
|
2857
2603
|
offerControlSchema.omit({ enabled: true }).parse(withActionId(input)),
|
|
2858
2604
|
call
|
|
2859
2605
|
),
|
|
2860
|
-
list: (call) => get("/offers",
|
|
2606
|
+
list: (call) => get("/offers", z12.array(offerSchema), call),
|
|
2861
2607
|
redemptions: (input = {}, call) => get(
|
|
2862
2608
|
`/redemptions${queryString({ member: input.member })}`,
|
|
2863
|
-
|
|
2609
|
+
z12.array(redemptionSchema),
|
|
2864
2610
|
call
|
|
2865
2611
|
),
|
|
2866
2612
|
/** Pauses or resumes an offer at the revision the operator saw. */
|
|
@@ -2909,7 +2655,7 @@ function managementClient(options) {
|
|
|
2909
2655
|
* them; API keys and project-scoped playground sessions cannot.
|
|
2910
2656
|
*/
|
|
2911
2657
|
tokens: {
|
|
2912
|
-
list: (call) => get("/tokens",
|
|
2658
|
+
list: (call) => get("/tokens", z12.array(tokenSchema), call),
|
|
2913
2659
|
/**
|
|
2914
2660
|
* Issues a key for one project and environment, limited to permissions the caller holds
|
|
2915
2661
|
* there. The secret `token` is in this response only.
|
|
@@ -2917,14 +2663,14 @@ function managementClient(options) {
|
|
|
2917
2663
|
create: (input, call) => post("/tokens", issuedTokenSchema, tokenInputSchema.parse(input), call),
|
|
2918
2664
|
/** Replace a personal key's ingestion restriction without changing its secret. */
|
|
2919
2665
|
scope: (id, input, call) => request(
|
|
2920
|
-
`/tokens/${encodeURIComponent(
|
|
2666
|
+
`/tokens/${encodeURIComponent(z12.string().min(1).parse(id))}/scope`,
|
|
2921
2667
|
tokenSchema,
|
|
2922
2668
|
tokenScopeInputSchema.parse(input),
|
|
2923
2669
|
"PUT",
|
|
2924
2670
|
call
|
|
2925
2671
|
),
|
|
2926
2672
|
revoke: (id, call) => request(
|
|
2927
|
-
`/tokens/${encodeURIComponent(
|
|
2673
|
+
`/tokens/${encodeURIComponent(z12.string().min(1).parse(id))}`,
|
|
2928
2674
|
ok,
|
|
2929
2675
|
void 0,
|
|
2930
2676
|
"DELETE",
|
|
@@ -2933,7 +2679,7 @@ function managementClient(options) {
|
|
|
2933
2679
|
},
|
|
2934
2680
|
/** Who holds which roles on the client's project; organization administrators only. */
|
|
2935
2681
|
grants: {
|
|
2936
|
-
list: (call) => get("/grants",
|
|
2682
|
+
list: (call) => get("/grants", z12.array(grantRecordSchema), call),
|
|
2937
2683
|
/** Replaces one person's roles and environments on the project. The audit log records it. */
|
|
2938
2684
|
set: (input, call) => request(
|
|
2939
2685
|
"/grants",
|
|
@@ -2950,7 +2696,7 @@ function managementClient(options) {
|
|
|
2950
2696
|
/** Signed activity notifications for one project/environment; writes require publish permission. */
|
|
2951
2697
|
webhooks: {
|
|
2952
2698
|
state: (id, call) => get(
|
|
2953
|
-
`/webhooks/${
|
|
2699
|
+
`/webhooks/${z12.string().uuid().parse(id)}/state`,
|
|
2954
2700
|
webhookEndpointStateSchema,
|
|
2955
2701
|
call
|
|
2956
2702
|
),
|
|
@@ -2961,24 +2707,24 @@ function managementClient(options) {
|
|
|
2961
2707
|
call
|
|
2962
2708
|
),
|
|
2963
2709
|
delete: (id, input, call) => post(
|
|
2964
|
-
`/webhooks/${
|
|
2710
|
+
`/webhooks/${z12.string().uuid().parse(id)}/delete`,
|
|
2965
2711
|
webhookEndpointStateSchema,
|
|
2966
2712
|
webhookDeleteInputSchema.parse(withActionId(input)),
|
|
2967
2713
|
call
|
|
2968
2714
|
),
|
|
2969
2715
|
pause: (id, input = {}, call) => post(
|
|
2970
|
-
`/webhooks/${
|
|
2716
|
+
`/webhooks/${z12.string().uuid().parse(id)}/pause`,
|
|
2971
2717
|
webhookEndpointSchema,
|
|
2972
2718
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
2973
2719
|
call
|
|
2974
2720
|
),
|
|
2975
2721
|
resume: (id, input = {}, call) => post(
|
|
2976
|
-
`/webhooks/${
|
|
2722
|
+
`/webhooks/${z12.string().uuid().parse(id)}/resume`,
|
|
2977
2723
|
webhookEndpointSchema,
|
|
2978
2724
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
2979
2725
|
call
|
|
2980
2726
|
),
|
|
2981
|
-
list: (call) => get("/webhooks",
|
|
2727
|
+
list: (call) => get("/webhooks", z12.array(webhookEndpointSchema), call),
|
|
2982
2728
|
create: (input, call) => post(
|
|
2983
2729
|
"/webhooks",
|
|
2984
2730
|
webhookSecretSchema,
|
|
@@ -2986,7 +2732,7 @@ function managementClient(options) {
|
|
|
2986
2732
|
call
|
|
2987
2733
|
),
|
|
2988
2734
|
update: (id, input, call) => request(
|
|
2989
|
-
`/webhooks/${
|
|
2735
|
+
`/webhooks/${z12.string().uuid().parse(id)}`,
|
|
2990
2736
|
webhookEndpointSchema,
|
|
2991
2737
|
webhookUpdateSchema.parse(input),
|
|
2992
2738
|
"PUT",
|
|
@@ -2994,24 +2740,24 @@ function managementClient(options) {
|
|
|
2994
2740
|
),
|
|
2995
2741
|
/** @deprecated Use pause. Removed in 2.0.0. */
|
|
2996
2742
|
disable: (id, call) => post(
|
|
2997
|
-
`/webhooks/${
|
|
2743
|
+
`/webhooks/${z12.string().uuid().parse(id)}/disable`,
|
|
2998
2744
|
webhookEndpointSchema,
|
|
2999
2745
|
{},
|
|
3000
2746
|
call
|
|
3001
2747
|
),
|
|
3002
2748
|
rotateSecret: (id, call) => post(
|
|
3003
|
-
`/webhooks/${
|
|
2749
|
+
`/webhooks/${z12.string().uuid().parse(id)}/rotate-secret`,
|
|
3004
2750
|
webhookSecretSchema,
|
|
3005
2751
|
{},
|
|
3006
2752
|
call
|
|
3007
2753
|
),
|
|
3008
2754
|
deliveries: (id, query = {}, call) => get(
|
|
3009
|
-
`/webhooks/${
|
|
2755
|
+
`/webhooks/${z12.string().uuid().parse(id)}/deliveries${queryString(webhookQuerySchema.parse(query))}`,
|
|
3010
2756
|
webhookDeliveryPageSchema,
|
|
3011
2757
|
call
|
|
3012
2758
|
),
|
|
3013
2759
|
replay: (id, delivery, call) => post(
|
|
3014
|
-
`/webhooks/${
|
|
2760
|
+
`/webhooks/${z12.string().uuid().parse(id)}/deliveries/${z12.string().uuid().parse(delivery)}/replay`,
|
|
3015
2761
|
webhookDeliverySchema,
|
|
3016
2762
|
{},
|
|
3017
2763
|
call
|
|
@@ -3022,7 +2768,7 @@ function managementClient(options) {
|
|
|
3022
2768
|
* environment. Organization administrators, from a Console session only.
|
|
3023
2769
|
*/
|
|
3024
2770
|
identityIntegrations: {
|
|
3025
|
-
list: (call) => get("/identity-integrations",
|
|
2771
|
+
list: (call) => get("/identity-integrations", z12.array(identityIntegrationSchema), call),
|
|
3026
2772
|
/** The secret `token` is in this response only. */
|
|
3027
2773
|
create: (input, call) => post(
|
|
3028
2774
|
"/identity-integrations",
|
|
@@ -3032,7 +2778,7 @@ function managementClient(options) {
|
|
|
3032
2778
|
),
|
|
3033
2779
|
/** Replaces the key's secret and extends it by 90 days; the old secret stops working. */
|
|
3034
2780
|
rotate: (id, call) => post(
|
|
3035
|
-
`/identity-integrations/${
|
|
2781
|
+
`/identity-integrations/${z12.string().uuid().parse(id)}/rotate`,
|
|
3036
2782
|
identityIntegrationSecretSchema,
|
|
3037
2783
|
{},
|
|
3038
2784
|
call
|
|
@@ -3044,7 +2790,7 @@ function managementClient(options) {
|
|
|
3044
2790
|
*/
|
|
3045
2791
|
kinds: (call) => get(
|
|
3046
2792
|
"/identity-integrations/kinds",
|
|
3047
|
-
|
|
2793
|
+
z12.array(identityKindClaimSchema),
|
|
3048
2794
|
call
|
|
3049
2795
|
),
|
|
3050
2796
|
/**
|
|
@@ -3052,8 +2798,8 @@ function managementClient(options) {
|
|
|
3052
2798
|
* and keep attributing tracker records; unlink them on the member to stop that.
|
|
3053
2799
|
*/
|
|
3054
2800
|
revoke: (id, call) => request(
|
|
3055
|
-
`/identity-integrations/${
|
|
3056
|
-
|
|
2801
|
+
`/identity-integrations/${z12.string().uuid().parse(id)}`,
|
|
2802
|
+
z12.null(),
|
|
3057
2803
|
void 0,
|
|
3058
2804
|
"DELETE",
|
|
3059
2805
|
call
|
|
@@ -3068,9 +2814,8 @@ function managementClient(options) {
|
|
|
3068
2814
|
* and finds a `detail` quest in that result. `activity` uses `attempts.list`, and its `detail`
|
|
3069
2815
|
* uses `attempts.get`. `members` uses `members.list`; `page()` ignores its `detail`, while
|
|
3070
2816
|
* `members.get` reads a member. `rewards` uses `entitlements.list` and `inventory.list`, and
|
|
3071
|
-
* its `detail` uses `entitlements.get`.
|
|
3072
|
-
*
|
|
3073
|
-
* `quests.list` returns current releases only. `settings` uses `metrics.read`, `quests.list`
|
|
2817
|
+
* its `detail` uses `entitlements.get`. `releases` uses `releases.list`, and its `detail`
|
|
2818
|
+
* uses `releases.get`. `settings` uses `metrics.read`, `quests.list`
|
|
3074
2819
|
* and `operations.list`; its `detail` has no effect. `audit` uses `audit.list`, except
|
|
3075
2820
|
* `filter: "access"` uses `audit.access`; its `detail` has no effect. On every page,
|
|
3076
2821
|
* `detail: "new"` is client-side create mode and triggers no replacement read. Resource lists
|
|
@@ -3105,7 +2850,7 @@ function managementClient(options) {
|
|
|
3105
2850
|
resources: {
|
|
3106
2851
|
list: (call) => get(
|
|
3107
2852
|
"/resources",
|
|
3108
|
-
|
|
2853
|
+
z12.object({ resources: z12.array(managedResourceSchema) }),
|
|
3109
2854
|
call
|
|
3110
2855
|
),
|
|
3111
2856
|
/** @deprecated Use the resource archive/unarchive methods. Removed in 2.0.0. */
|
|
@@ -3142,7 +2887,7 @@ function managementClient(options) {
|
|
|
3142
2887
|
testMemberCreateSchema.parse(withActionId(input)),
|
|
3143
2888
|
call
|
|
3144
2889
|
),
|
|
3145
|
-
list: (call) => get("/test-members",
|
|
2890
|
+
list: (call) => get("/test-members", z12.array(testMemberSchema), call),
|
|
3146
2891
|
history: (member, query = {}, call) => get(
|
|
3147
2892
|
`/test-members/${identifier.parse(member)}/history${queryString(testMemberHistoryQuerySchema.parse(query))}`,
|
|
3148
2893
|
testMemberHistorySchema,
|
|
@@ -3224,26 +2969,26 @@ function managementClient(options) {
|
|
|
3224
2969
|
/** Who each member is: up to 100 distinct IDs; unknown IDs come back without accounts. */
|
|
3225
2970
|
people: (members, call) => get(
|
|
3226
2971
|
`/people${queryString({ ids: members.join(",") })}`,
|
|
3227
|
-
|
|
2972
|
+
z12.array(personSchema),
|
|
3228
2973
|
call
|
|
3229
2974
|
),
|
|
3230
2975
|
/** Current X and Discord quest account selections; requires read permission. */
|
|
3231
2976
|
oauthAccounts: (member, call) => get(
|
|
3232
2977
|
`/members/${encodeURIComponent(member)}/oauth-accounts`,
|
|
3233
|
-
|
|
2978
|
+
z12.array(managedOAuthAccountSchema),
|
|
3234
2979
|
call
|
|
3235
2980
|
),
|
|
3236
2981
|
/** Unlinks the reviewed selection across this organization/environment, preserving ownership and sign-in. */
|
|
3237
2982
|
unlinkOAuthAccount: (member, input, call) => post(
|
|
3238
2983
|
`/members/${encodeURIComponent(member)}/oauth-accounts/unlink`,
|
|
3239
|
-
|
|
2984
|
+
z12.array(managedOAuthAccountSchema),
|
|
3240
2985
|
memberOAuthUnlinkInputSchema.parse(input),
|
|
3241
2986
|
call
|
|
3242
2987
|
),
|
|
3243
2988
|
/** Unlinks a member's wallet from the project with a reason; requires `review` permission. The address stays bound to the member. */
|
|
3244
2989
|
unlinkWallet: (member, input, call) => post(
|
|
3245
2990
|
`/members/${encodeURIComponent(member)}/wallets/unlink`,
|
|
3246
|
-
|
|
2991
|
+
z12.array(managedWalletSchema),
|
|
3247
2992
|
memberWalletUnlinkInputSchema.parse(input),
|
|
3248
2993
|
call
|
|
3249
2994
|
),
|
|
@@ -3254,14 +2999,14 @@ function managementClient(options) {
|
|
|
3254
2999
|
*/
|
|
3255
3000
|
unlinkIdentity: (member, input, call) => post(
|
|
3256
3001
|
`/members/${encodeURIComponent(member)}/identities/unlink`,
|
|
3257
|
-
|
|
3002
|
+
z12.array(managedMemberIdentitySchema),
|
|
3258
3003
|
memberIdentityChangeInputSchema.parse(input),
|
|
3259
3004
|
call
|
|
3260
3005
|
),
|
|
3261
3006
|
/** Relinks an `app:<name>` identity an operator unlinked from this member, with a reason; requires `review` permission. */
|
|
3262
3007
|
relinkIdentity: (member, input, call) => post(
|
|
3263
3008
|
`/members/${encodeURIComponent(member)}/identities/relink`,
|
|
3264
|
-
|
|
3009
|
+
z12.array(managedMemberIdentitySchema),
|
|
3265
3010
|
memberIdentityChangeInputSchema.parse(input),
|
|
3266
3011
|
call
|
|
3267
3012
|
),
|
|
@@ -3271,7 +3016,7 @@ function managementClient(options) {
|
|
|
3271
3016
|
*/
|
|
3272
3017
|
setWalletSignIn: (member, input, call) => post(
|
|
3273
3018
|
`/members/${encodeURIComponent(member)}/wallets/sign-in`,
|
|
3274
|
-
|
|
3019
|
+
z12.array(managedWalletSchema),
|
|
3275
3020
|
memberWalletSignInInputSchema.parse(input),
|
|
3276
3021
|
call
|
|
3277
3022
|
)
|
|
@@ -3421,7 +3166,7 @@ function managementClient(options) {
|
|
|
3421
3166
|
* Each quest's current release, the most recently published first, archived quests
|
|
3422
3167
|
* included; requires `read` permission.
|
|
3423
3168
|
*/
|
|
3424
|
-
list: (call) => get("/quests/list",
|
|
3169
|
+
list: (call) => get("/quests/list", z12.array(publishedReleaseSchema), call),
|
|
3425
3170
|
/** Pending and exhausted asynchronous balance checks. Requires read. */
|
|
3426
3171
|
automaticScheduling: (query = {}, call) => get(
|
|
3427
3172
|
`/quests/automatic-scheduling${queryString(automaticSchedulingQuerySchema.parse(query))}`,
|
|
@@ -3696,6 +3441,9 @@ var managementResponseSchemas = lazyResponseReaders({
|
|
|
3696
3441
|
get managedAttemptPageSchema() {
|
|
3697
3442
|
return knownResponse(managedAttemptPageSchema);
|
|
3698
3443
|
},
|
|
3444
|
+
get managedReleasePageSchema() {
|
|
3445
|
+
return knownResponse(managedReleasePageSchema);
|
|
3446
|
+
},
|
|
3699
3447
|
get managedAttemptSchema() {
|
|
3700
3448
|
return knownResponse(managedAttemptSchema);
|
|
3701
3449
|
},
|
|
@@ -3972,6 +3720,7 @@ var managementResponses = {
|
|
|
3972
3720
|
leaderboardSettlementSummarySchema
|
|
3973
3721
|
),
|
|
3974
3722
|
managedAttemptPageSchema: responseSchema(managedAttemptPageSchema),
|
|
3723
|
+
managedReleasePageSchema: responseSchema(managedReleasePageSchema),
|
|
3975
3724
|
managedAttemptSchema: responseSchema(managedAttemptSchema),
|
|
3976
3725
|
managedEntitlementPageSchema: responseSchema(managedEntitlementPageSchema),
|
|
3977
3726
|
managedEntitlementSchema: responseSchema(managedEntitlementSchema),
|
|
@@ -4084,6 +3833,7 @@ export {
|
|
|
4084
3833
|
appStorageTablesSchema,
|
|
4085
3834
|
appStorageValueSchema,
|
|
4086
3835
|
assetPathSchema,
|
|
3836
|
+
attemptCaptureSchema,
|
|
4087
3837
|
auditPageSchema,
|
|
4088
3838
|
auditQuerySchema,
|
|
4089
3839
|
auditRecordSchema,
|
|
@@ -4093,6 +3843,7 @@ export {
|
|
|
4093
3843
|
buildPhaseSchema,
|
|
4094
3844
|
buildSnapshotSchema,
|
|
4095
3845
|
buildStatusSchema,
|
|
3846
|
+
capturedFactSchema,
|
|
4096
3847
|
commitSchema,
|
|
4097
3848
|
compareAppMigrations,
|
|
4098
3849
|
completionRevocationSchema,
|
|
@@ -4162,6 +3913,8 @@ export {
|
|
|
4162
3913
|
managedPointHistoryPageSchema,
|
|
4163
3914
|
managedQuestEnrollmentPageSchema,
|
|
4164
3915
|
managedQuestEnrollmentSchema,
|
|
3916
|
+
managedReleasePageSchema,
|
|
3917
|
+
managedReleaseQuerySchema,
|
|
4165
3918
|
managedResourceSchema,
|
|
4166
3919
|
managedStockItemSchema,
|
|
4167
3920
|
managedWalletSchema,
|