@domino-sdk/relay 1.31.0 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authoring.d.ts +8 -8
- package/dist/authoring.js +1 -1
- package/dist/browser.d.ts +4 -4
- package/dist/browser.js +5 -5
- package/dist/{chunk-BEGFBWEG.js → chunk-2SL7K42N.js} +2 -2
- package/dist/{chunk-MHPTCD5O.js → chunk-BDWZ2BZP.js} +1 -1
- package/dist/{chunk-F3JLZ7MR.js → chunk-E5OYFYO3.js} +3 -3
- package/dist/{chunk-WULPIU3Z.js → chunk-KWNSYWVH.js} +1 -1
- package/dist/{chunk-5QZGXYH7.js → chunk-ON7RDKQ3.js} +13 -2
- package/dist/{chunk-LSJPJQW4.js → chunk-PM3265GG.js} +61 -31
- package/dist/{chunk-A7SJDWBR.js → chunk-YPI5SGXB.js} +1 -1
- package/dist/{client-CFFgPnIX.d.ts → client-Bkc7gOmF.d.ts} +3 -2
- package/dist/{groups-sgKusEzF.d.ts → groups-C06mpYOs.d.ts} +5 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/internal.d.ts +4 -4
- package/dist/internal.js +2 -2
- package/dist/{offers-D14uyLQQ.d.ts → offers-BbQ9O-5J.d.ts} +1 -1
- package/dist/portal-proxy.js +1 -1
- package/dist/react/index.d.ts +6 -6
- package/dist/react/index.js +5 -5
- package/dist/schema.d.ts +66 -63
- package/dist/schema.js +3 -3
- package/dist/server/index.d.ts +4 -4
- package/dist/server/index.js +1018 -620
- package/dist/{submission-input-Dr0v6J9N.d.ts → submission-input-DUmt6Wyx.d.ts} +1 -1
- package/dist/{telegram-browser-zPO8yYDJ.d.ts → telegram-browser-DWFPGBgU.d.ts} +1 -1
- package/dist/{transport-leWfCbHS.d.ts → transport-DVdbwmrB.d.ts} +1814 -352
- package/package.json +1 -1
- package/dist/{deployments-DMVpPnGX.d.ts → deployments-BZuI2lWF.d.ts} +28 -28
package/dist/server/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
publishDeploymentSchema,
|
|
28
28
|
rejectDeploymentSchema,
|
|
29
29
|
submitDeploymentSchema
|
|
30
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-2SL7K42N.js";
|
|
31
31
|
import "../chunk-4OC7REYX.js";
|
|
32
32
|
import {
|
|
33
33
|
DEFAULT_MANAGEMENT_TIMEOUT,
|
|
@@ -36,6 +36,8 @@ import {
|
|
|
36
36
|
REFERRAL_INTEGRATION_REWARD_ERROR,
|
|
37
37
|
actionIdOf,
|
|
38
38
|
containsReferralIntegrationReward,
|
|
39
|
+
credentialSecretInputSchema,
|
|
40
|
+
credentialSecretSchema,
|
|
39
41
|
identityIntegrationInputSchema,
|
|
40
42
|
identityIntegrationSchema,
|
|
41
43
|
identityIntegrationSecretSchema,
|
|
@@ -46,7 +48,7 @@ import {
|
|
|
46
48
|
participantExchangeSchema,
|
|
47
49
|
questConfiguration,
|
|
48
50
|
sequenceCursorSchema
|
|
49
|
-
} from "../chunk-
|
|
51
|
+
} from "../chunk-PM3265GG.js";
|
|
50
52
|
import {
|
|
51
53
|
parseImageExtraction,
|
|
52
54
|
parseImageResult
|
|
@@ -88,7 +90,7 @@ import {
|
|
|
88
90
|
rewardDeliveryQuerySchema,
|
|
89
91
|
rewardDeliverySchema,
|
|
90
92
|
saveQuestDraftSchema
|
|
91
|
-
} from "../chunk-
|
|
93
|
+
} from "../chunk-BDWZ2BZP.js";
|
|
92
94
|
import {
|
|
93
95
|
badgeMutationResultSchema,
|
|
94
96
|
badgeMutationSchema,
|
|
@@ -142,14 +144,14 @@ import {
|
|
|
142
144
|
referralQualificationSchema,
|
|
143
145
|
referralRewardResolutionSchema,
|
|
144
146
|
referralSuspensionSchema
|
|
145
|
-
} from "../chunk-
|
|
147
|
+
} from "../chunk-ON7RDKQ3.js";
|
|
146
148
|
import {
|
|
147
149
|
telegramChatConnectionSchema,
|
|
148
150
|
telegramChatIdSchema,
|
|
149
151
|
telegramChatsSchema
|
|
150
152
|
} from "../chunk-BUHGXKPY.js";
|
|
151
153
|
import "../chunk-V7K7XXFB.js";
|
|
152
|
-
import "../chunk-
|
|
154
|
+
import "../chunk-YPI5SGXB.js";
|
|
153
155
|
import "../chunk-466IRAJP.js";
|
|
154
156
|
import {
|
|
155
157
|
CompletionSourceKind,
|
|
@@ -515,90 +517,267 @@ var testMemberHistorySchema = z6.object({
|
|
|
515
517
|
complete: z6.boolean()
|
|
516
518
|
});
|
|
517
519
|
|
|
518
|
-
// src/server/
|
|
520
|
+
// src/server/member-imports.ts
|
|
519
521
|
import * as z7 from "zod";
|
|
522
|
+
var importTimeSchema = z7.union([
|
|
523
|
+
z7.number().int().nonnegative().safe(),
|
|
524
|
+
z7.iso.datetime({ offset: true }).transform((value) => Date.parse(value))
|
|
525
|
+
]);
|
|
526
|
+
var importWalletSchema = z7.discriminatedUnion("chain", [
|
|
527
|
+
z7.object({
|
|
528
|
+
kind: z7.literal("wallet"),
|
|
529
|
+
chain: z7.literal("solana"),
|
|
530
|
+
address: solanaAddressSchema
|
|
531
|
+
}).strict(),
|
|
532
|
+
z7.object({
|
|
533
|
+
kind: z7.literal("wallet"),
|
|
534
|
+
chain: z7.literal("eip155"),
|
|
535
|
+
address: evmAddressSchema
|
|
536
|
+
}).strict(),
|
|
537
|
+
z7.object({
|
|
538
|
+
kind: z7.literal("wallet"),
|
|
539
|
+
chain: z7.literal("cosmos"),
|
|
540
|
+
network: cosmosNetworkSchema,
|
|
541
|
+
address: cosmosAddressSchema
|
|
542
|
+
}).strict()
|
|
543
|
+
]);
|
|
544
|
+
var importXSchema = z7.object({
|
|
545
|
+
kind: z7.literal("x"),
|
|
546
|
+
subject: z7.string().regex(/^[1-9][0-9]{0,19}$/, "Use the numeric X user ID")
|
|
547
|
+
}).strict();
|
|
548
|
+
var importAppIdentitySchema = z7.object({ kind: appIdentityKindSchema, subject: z7.string().min(1).max(256) }).strict();
|
|
549
|
+
var memberImportIdentitySchema = z7.union([
|
|
550
|
+
importAppIdentitySchema,
|
|
551
|
+
importWalletSchema,
|
|
552
|
+
importXSchema
|
|
553
|
+
]);
|
|
554
|
+
var memberImportAccountSchema = z7.union([
|
|
555
|
+
importWalletSchema,
|
|
556
|
+
importXSchema
|
|
557
|
+
]);
|
|
558
|
+
var memberImportActionSchema = z7.object({
|
|
559
|
+
at: importTimeSchema,
|
|
560
|
+
key: z7.string().min(1).max(200).optional()
|
|
561
|
+
}).strict();
|
|
562
|
+
var memberImportRowSchema = z7.object({
|
|
563
|
+
/** The member's ID on the platform they come from. Unique within an import. */
|
|
564
|
+
ref: z7.string().trim().min(1).max(200),
|
|
565
|
+
identity: memberImportIdentitySchema,
|
|
566
|
+
accounts: z7.array(memberImportAccountSchema).max(20).default([]),
|
|
567
|
+
/** Opening balances, credited once per ledger as an imported entry. */
|
|
568
|
+
points: z7.array(
|
|
569
|
+
z7.object({
|
|
570
|
+
ledger: z7.string().min(1).max(200),
|
|
571
|
+
balance: z7.number().int().positive().safe()
|
|
572
|
+
}).strict()
|
|
573
|
+
).max(50).default([]),
|
|
574
|
+
/** Quest progress, by quest authoring key or ID. */
|
|
575
|
+
quests: z7.array(
|
|
576
|
+
z7.object({
|
|
577
|
+
quest: z7.string().min(1).max(200),
|
|
578
|
+
actions: z7.array(memberImportActionSchema).min(1).max(3660)
|
|
579
|
+
}).strict()
|
|
580
|
+
).max(200).default([])
|
|
581
|
+
}).strict();
|
|
582
|
+
var memberImportCreateSchema = z7.object({
|
|
583
|
+
actionId: identifier,
|
|
584
|
+
/** Where the members come from, such as "legacy-domino". */
|
|
585
|
+
source: z7.string().trim().min(1).max(100)
|
|
586
|
+
}).strict();
|
|
587
|
+
var memberImportRowsInputSchema = z7.object({ rows: z7.array(memberImportRowSchema).min(1).max(500) }).strict();
|
|
588
|
+
var MemberImportRefusalCode = {
|
|
589
|
+
/** An account or identity belongs to another member in the project. */
|
|
590
|
+
AccountLinkedElsewhere: "account-linked-elsewhere",
|
|
591
|
+
/** An operator unlinked the row's app identity. */
|
|
592
|
+
IdentityUnlinked: "identity-unlinked",
|
|
593
|
+
/** An earlier row of the import names the same account. */
|
|
594
|
+
DuplicateAccount: "duplicate-account",
|
|
595
|
+
/** The member already has another X account selected. */
|
|
596
|
+
XAccountSelected: "x-account-selected",
|
|
597
|
+
/** The member would hold more wallets of a chain family than a member can link. */
|
|
598
|
+
LimitReached: "limit-reached",
|
|
599
|
+
UnknownLedger: "unknown-ledger",
|
|
600
|
+
UnknownQuest: "unknown-quest",
|
|
601
|
+
/** The quest has no active release in this environment. */
|
|
602
|
+
QuestNotPublished: "quest-not-published",
|
|
603
|
+
/** The quest's completions are decided per content item, which an import cannot record. */
|
|
604
|
+
QuestNotImportable: "quest-not-importable",
|
|
605
|
+
/** A keyed quest's action has no `key`. */
|
|
606
|
+
KeyRequired: "key-required",
|
|
607
|
+
/** An action is dated in the future. */
|
|
608
|
+
FutureAction: "future-action",
|
|
609
|
+
/** The row's sign-in wallet or X account is linked to its member without sign-in. */
|
|
610
|
+
SignInDisabled: "sign-in-disabled",
|
|
611
|
+
/** The row names one point ledger or quest twice, by any of its names. */
|
|
612
|
+
DuplicateEntry: "duplicate-entry"
|
|
613
|
+
};
|
|
614
|
+
var refusalCodeSchema = z7.string();
|
|
615
|
+
var memberImportRefusalSchema = z7.object({
|
|
616
|
+
code: refusalCodeSchema,
|
|
617
|
+
message: z7.string()
|
|
618
|
+
});
|
|
619
|
+
var memberImportRowResultSchema = z7.object({
|
|
620
|
+
line: z7.number().int().positive(),
|
|
621
|
+
ref: z7.string(),
|
|
622
|
+
status: z7.enum(["pending", "ready", "applied", "refused"]),
|
|
623
|
+
/** The member the row resolves to: an existing member, or the one applying created. */
|
|
624
|
+
member: identifier.nullable(),
|
|
625
|
+
/** Whether the row's identity names a member who already exists. Null until checked. */
|
|
626
|
+
existing: z7.boolean().nullable(),
|
|
627
|
+
refusals: z7.array(memberImportRefusalSchema)
|
|
628
|
+
});
|
|
629
|
+
var memberImportRowPageSchema = z7.object({
|
|
630
|
+
items: z7.array(memberImportRowResultSchema),
|
|
631
|
+
nextCursor: z7.string().nullable()
|
|
632
|
+
});
|
|
633
|
+
var memberImportRowQuerySchema = z7.object({
|
|
634
|
+
status: z7.enum(["pending", "ready", "applied", "refused"]).optional(),
|
|
635
|
+
cursor: z7.string().max(200).optional(),
|
|
636
|
+
limit: z7.coerce.number().int().min(1).max(500).optional()
|
|
637
|
+
}).strict();
|
|
638
|
+
var memberImportSummarySchema = z7.object({
|
|
639
|
+
rows: z7.number().int().nonnegative(),
|
|
640
|
+
ready: z7.number().int().nonnegative(),
|
|
641
|
+
refused: z7.number().int().nonnegative(),
|
|
642
|
+
members: z7.object({
|
|
643
|
+
created: z7.number().int().nonnegative(),
|
|
644
|
+
existing: z7.number().int().nonnegative()
|
|
645
|
+
}),
|
|
646
|
+
/** Identities and accounts the ready rows attach, sign-in identities included. */
|
|
647
|
+
accounts: z7.number().int().nonnegative(),
|
|
648
|
+
/** Opening balance totals, by ledger as the rows name it. */
|
|
649
|
+
points: z7.array(
|
|
650
|
+
z7.object({ ledger: z7.string(), total: z7.number().int().nonnegative() })
|
|
651
|
+
),
|
|
652
|
+
/** Imported actions, by quest as the rows name it. */
|
|
653
|
+
actions: z7.array(
|
|
654
|
+
z7.object({ quest: z7.string(), total: z7.number().int().nonnegative() })
|
|
655
|
+
),
|
|
656
|
+
/** Refused rows, by refusal code. A row can have several. */
|
|
657
|
+
refusals: z7.array(
|
|
658
|
+
z7.object({ code: refusalCodeSchema, rows: z7.number().int().nonnegative() })
|
|
659
|
+
)
|
|
660
|
+
});
|
|
661
|
+
var memberImportSchema = z7.object({
|
|
662
|
+
id: identifier,
|
|
663
|
+
source: z7.string(),
|
|
664
|
+
status: z7.enum([
|
|
665
|
+
"open",
|
|
666
|
+
"checking",
|
|
667
|
+
"checked",
|
|
668
|
+
"applying",
|
|
669
|
+
"applied",
|
|
670
|
+
"canceled"
|
|
671
|
+
]),
|
|
672
|
+
rows: z7.number().int().nonnegative(),
|
|
673
|
+
/** The latest check's summary, or null before the first check and after rows change. */
|
|
674
|
+
summary: memberImportSummarySchema.nullable(),
|
|
675
|
+
/** While applying and after: rows applied and refused so far. */
|
|
676
|
+
progress: z7.object({
|
|
677
|
+
applied: z7.number().int().nonnegative(),
|
|
678
|
+
refused: z7.number().int().nonnegative()
|
|
679
|
+
}),
|
|
680
|
+
createdAt: z7.number().int(),
|
|
681
|
+
createdBy: z7.string().nullable(),
|
|
682
|
+
checkedAt: z7.number().int().nullable(),
|
|
683
|
+
appliedAt: z7.number().int().nullable(),
|
|
684
|
+
appliedBy: z7.string().nullable(),
|
|
685
|
+
canceledAt: z7.number().int().nullable(),
|
|
686
|
+
canceledBy: z7.string().nullable()
|
|
687
|
+
});
|
|
688
|
+
var memberImportPageSchema = z7.object({
|
|
689
|
+
items: z7.array(memberImportSchema),
|
|
690
|
+
nextCursor: z7.string().nullable()
|
|
691
|
+
});
|
|
692
|
+
var memberImportListQuerySchema = z7.object({
|
|
693
|
+
cursor: z7.string().max(200).optional(),
|
|
694
|
+
limit: z7.coerce.number().int().min(1).max(100).optional()
|
|
695
|
+
}).strict();
|
|
696
|
+
|
|
697
|
+
// src/server/webhooks.ts
|
|
698
|
+
import * as z8 from "zod";
|
|
520
699
|
var PayoutSourceKind = {
|
|
521
700
|
Quest: "quest",
|
|
522
701
|
Leaderboard: "leaderboard",
|
|
523
702
|
Engagement: "engagement",
|
|
524
703
|
Manual: "manual"
|
|
525
704
|
};
|
|
526
|
-
var webhookEventSchema =
|
|
527
|
-
id:
|
|
528
|
-
version:
|
|
705
|
+
var webhookEventSchema = z8.object({
|
|
706
|
+
id: z8.string().uuid(),
|
|
707
|
+
version: z8.literal(1),
|
|
529
708
|
type: activityTypeSchema,
|
|
530
|
-
createdAt:
|
|
531
|
-
organization:
|
|
532
|
-
project:
|
|
533
|
-
environment:
|
|
534
|
-
data:
|
|
709
|
+
createdAt: z8.number().int().nonnegative(),
|
|
710
|
+
organization: z8.string(),
|
|
711
|
+
project: z8.string(),
|
|
712
|
+
environment: z8.enum(["test", "live"]),
|
|
713
|
+
data: z8.record(z8.string(), z8.json())
|
|
535
714
|
});
|
|
536
|
-
var webhookControlInputSchema =
|
|
537
|
-
var webhookInputSchema =
|
|
538
|
-
url:
|
|
715
|
+
var webhookControlInputSchema = z8.object({ actionId: z8.string().uuid().optional() }).strict();
|
|
716
|
+
var webhookInputSchema = z8.object({
|
|
717
|
+
url: z8.url().max(2048).refine((value) => {
|
|
539
718
|
const url2 = new URL(value);
|
|
540
719
|
return url2.protocol === "https:" && !url2.username && !url2.password && !url2.hash;
|
|
541
720
|
}, "Use an HTTPS URL without credentials or a fragment"),
|
|
542
|
-
types:
|
|
721
|
+
types: z8.array(activityTypeSchema).min(1).max(100).refine((v) => new Set(v).size === v.length)
|
|
543
722
|
}).strict();
|
|
544
|
-
var webhookCreateInputSchema = webhookInputSchema.extend({ actionId:
|
|
545
|
-
var webhookRotateInputSchema =
|
|
546
|
-
var webhookUpdateSchema = webhookInputSchema.partial().extend({ enabled:
|
|
547
|
-
var webhookEndpointSchema =
|
|
723
|
+
var webhookCreateInputSchema = webhookInputSchema.extend({ actionId: z8.string().uuid().optional() }).strict();
|
|
724
|
+
var webhookRotateInputSchema = z8.object({ actionId: z8.string().uuid().optional() }).strict();
|
|
725
|
+
var webhookUpdateSchema = webhookInputSchema.partial().extend({ enabled: z8.boolean().optional() }).strict();
|
|
726
|
+
var webhookEndpointSchema = z8.object({
|
|
548
727
|
...webhookInputSchema.shape,
|
|
549
|
-
id:
|
|
550
|
-
enabled:
|
|
551
|
-
disabledReason:
|
|
552
|
-
consecutiveFailures:
|
|
553
|
-
createdAt:
|
|
554
|
-
updatedAt:
|
|
728
|
+
id: z8.string().uuid(),
|
|
729
|
+
enabled: z8.boolean(),
|
|
730
|
+
disabledReason: z8.string().nullable(),
|
|
731
|
+
consecutiveFailures: z8.number().int().nonnegative(),
|
|
732
|
+
createdAt: z8.number(),
|
|
733
|
+
updatedAt: z8.number()
|
|
555
734
|
});
|
|
556
735
|
var webhookEndpointStateSchema = webhookEndpointSchema.extend({
|
|
557
|
-
revision:
|
|
558
|
-
deletedAt:
|
|
736
|
+
revision: z8.number().int().nonnegative(),
|
|
737
|
+
deletedAt: z8.number().int().safe().nonnegative().nullable()
|
|
559
738
|
});
|
|
560
|
-
var webhookDeleteInputSchema =
|
|
561
|
-
actionId:
|
|
562
|
-
expectedRevision:
|
|
563
|
-
reason:
|
|
739
|
+
var webhookDeleteInputSchema = z8.strictObject({
|
|
740
|
+
actionId: z8.string().uuid().default(() => crypto.randomUUID()),
|
|
741
|
+
expectedRevision: z8.number().int().nonnegative(),
|
|
742
|
+
reason: z8.string().trim().min(1).max(500)
|
|
564
743
|
});
|
|
565
|
-
var webhookStateQuerySchema =
|
|
744
|
+
var webhookStateQuerySchema = z8.strictObject({
|
|
566
745
|
cursor: pageCursorSchema.optional(),
|
|
567
|
-
limit:
|
|
746
|
+
limit: z8.coerce.number().int().min(1).max(100).default(50)
|
|
568
747
|
});
|
|
569
|
-
var webhookStatePageSchema =
|
|
570
|
-
items:
|
|
748
|
+
var webhookStatePageSchema = z8.object({
|
|
749
|
+
items: z8.array(webhookEndpointStateSchema),
|
|
571
750
|
nextCursor: pageCursorSchema.nullable()
|
|
572
751
|
});
|
|
573
|
-
var webhookSecretSchema =
|
|
752
|
+
var webhookSecretSchema = z8.object({
|
|
574
753
|
endpoint: webhookEndpointSchema,
|
|
575
|
-
secret:
|
|
576
|
-
previousValidUntil:
|
|
754
|
+
secret: z8.string(),
|
|
755
|
+
previousValidUntil: z8.number().nullable()
|
|
577
756
|
});
|
|
578
|
-
var webhookDeliverySchema =
|
|
579
|
-
id:
|
|
580
|
-
endpoint:
|
|
757
|
+
var webhookDeliverySchema = z8.object({
|
|
758
|
+
id: z8.string().uuid(),
|
|
759
|
+
endpoint: z8.string().uuid(),
|
|
581
760
|
event: webhookEventSchema,
|
|
582
|
-
status:
|
|
583
|
-
attempts:
|
|
584
|
-
responseStatus:
|
|
585
|
-
lastError:
|
|
586
|
-
createdAt:
|
|
587
|
-
deliveredAt:
|
|
588
|
-
replayOf:
|
|
761
|
+
status: z8.enum(["pending", "delivered", "failed", "skipped"]),
|
|
762
|
+
attempts: z8.number().int().nonnegative(),
|
|
763
|
+
responseStatus: z8.number().nullable(),
|
|
764
|
+
lastError: z8.string().nullable(),
|
|
765
|
+
createdAt: z8.number(),
|
|
766
|
+
deliveredAt: z8.number().nullable(),
|
|
767
|
+
replayOf: z8.string().uuid().nullable()
|
|
589
768
|
});
|
|
590
|
-
var webhookQuerySchema =
|
|
769
|
+
var webhookQuerySchema = z8.object({
|
|
591
770
|
/** A page's `nextCursor`: the deliveries after it, newest first. */
|
|
592
771
|
cursor: pageCursorSchema.optional(),
|
|
593
772
|
/** @deprecated Use `cursor`. Removed in 2.0.0. */
|
|
594
|
-
before:
|
|
595
|
-
limit:
|
|
773
|
+
before: z8.string().uuid().optional(),
|
|
774
|
+
limit: z8.coerce.number().int().min(1).max(100).default(50)
|
|
596
775
|
}).strict();
|
|
597
|
-
var webhookDeliveryPageSchema =
|
|
598
|
-
items:
|
|
776
|
+
var webhookDeliveryPageSchema = z8.object({
|
|
777
|
+
items: z8.array(webhookDeliverySchema),
|
|
599
778
|
nextCursor: pageCursorSchema.nullable().default(null),
|
|
600
779
|
/** @deprecated Use `nextCursor`, passed back as `cursor`. Removed in 2.0.0. */
|
|
601
|
-
next:
|
|
780
|
+
next: z8.string().uuid().nullable()
|
|
602
781
|
});
|
|
603
782
|
var WEBHOOK_MAX_BYTES = 64 * 1024;
|
|
604
783
|
async function verifyWebhook(input) {
|
|
@@ -642,8 +821,8 @@ async function verifyWebhook(input) {
|
|
|
642
821
|
}
|
|
643
822
|
|
|
644
823
|
// src/server/resource-lifecycle.ts
|
|
645
|
-
import * as
|
|
646
|
-
var resourceLifecycleKindSchema =
|
|
824
|
+
import * as z9 from "zod";
|
|
825
|
+
var resourceLifecycleKindSchema = z9.enum([
|
|
647
826
|
"tracker",
|
|
648
827
|
"referral",
|
|
649
828
|
"leaderboard",
|
|
@@ -653,24 +832,24 @@ var resourceLifecycleKindSchema = z8.enum([
|
|
|
653
832
|
"image",
|
|
654
833
|
"point-ledger"
|
|
655
834
|
]);
|
|
656
|
-
var managedResourceSchema =
|
|
835
|
+
var managedResourceSchema = z9.object({
|
|
657
836
|
kind: resourceLifecycleKindSchema,
|
|
658
837
|
id: identifier,
|
|
659
838
|
key: identifier.nullable(),
|
|
660
|
-
title:
|
|
661
|
-
archivedAt:
|
|
839
|
+
title: z9.string(),
|
|
840
|
+
archivedAt: z9.number().int().nonnegative().nullable()
|
|
662
841
|
});
|
|
663
|
-
var resourceLifecycleInputSchema =
|
|
664
|
-
actionId:
|
|
842
|
+
var resourceLifecycleInputSchema = z9.object({
|
|
843
|
+
actionId: z9.string().uuid(),
|
|
665
844
|
kind: resourceLifecycleKindSchema,
|
|
666
845
|
resource: identifier,
|
|
667
|
-
archived:
|
|
668
|
-
reason:
|
|
669
|
-
expectedArchivedAt:
|
|
846
|
+
archived: z9.boolean(),
|
|
847
|
+
reason: z9.string().trim().min(1).max(500),
|
|
848
|
+
expectedArchivedAt: z9.number().int().nonnegative().nullable().optional()
|
|
670
849
|
}).strict();
|
|
671
|
-
var resourceLifecycleResultSchema =
|
|
850
|
+
var resourceLifecycleResultSchema = z9.object({
|
|
672
851
|
resource: managedResourceSchema,
|
|
673
|
-
changed:
|
|
852
|
+
changed: z9.boolean()
|
|
674
853
|
});
|
|
675
854
|
var resourceLifecyclePaths = {
|
|
676
855
|
tracker: "/trackers",
|
|
@@ -689,19 +868,19 @@ var resourceArchiveInputSchema = resourceLifecycleInputSchema.omit({
|
|
|
689
868
|
});
|
|
690
869
|
|
|
691
870
|
// src/server/index.ts
|
|
692
|
-
import * as
|
|
871
|
+
import * as z15 from "zod";
|
|
693
872
|
|
|
694
873
|
// src/server/hosting.ts
|
|
695
|
-
import * as
|
|
874
|
+
import * as z12 from "zod";
|
|
696
875
|
|
|
697
876
|
// src/server/schedules.ts
|
|
698
|
-
import * as
|
|
877
|
+
import * as z10 from "zod";
|
|
699
878
|
import { Cron } from "croner";
|
|
700
879
|
var APP_SCHEDULE_LIMIT = 10;
|
|
701
880
|
var APP_SCHEDULE_MIN_INTERVAL = 3e5;
|
|
702
881
|
var APP_SCHEDULE_TIMEOUT = 3e4;
|
|
703
|
-
var appScheduleNameSchema =
|
|
704
|
-
var appSchedulePathSchema =
|
|
882
|
+
var appScheduleNameSchema = z10.string().regex(/^[a-z][a-z0-9-]{0,63}$/);
|
|
883
|
+
var appSchedulePathSchema = z10.string().min(2).max(512).refine((path) => {
|
|
705
884
|
if (!/^\/[a-zA-Z0-9_/-]+$/.test(path) || path.startsWith("//")) {
|
|
706
885
|
return false;
|
|
707
886
|
}
|
|
@@ -712,11 +891,11 @@ function interval(value) {
|
|
|
712
891
|
const unit = value.slice(-1);
|
|
713
892
|
return amount * (unit === "m" ? 6e4 : unit === "h" ? 36e5 : 864e5);
|
|
714
893
|
}
|
|
715
|
-
var everySchema =
|
|
894
|
+
var everySchema = z10.string().regex(/^[1-9]\d{0,3}[mhd]$/).refine(
|
|
716
895
|
(value) => interval(value) >= APP_SCHEDULE_MIN_INTERVAL && interval(value) <= 365 * 864e5,
|
|
717
896
|
"Use an interval from 5 minutes to 365 days, such as 5m, 1h or 1d"
|
|
718
897
|
);
|
|
719
|
-
var cronSchema =
|
|
898
|
+
var cronSchema = z10.string().max(120).refine((value) => {
|
|
720
899
|
const fields = value.trim().split(/\s+/);
|
|
721
900
|
if (fields.length !== 5 || fields.some((field) => !/^[\d*,/-]+$/.test(field))) {
|
|
722
901
|
return false;
|
|
@@ -741,15 +920,15 @@ var cronSchema = z9.string().max(120).refine((value) => {
|
|
|
741
920
|
var declaration = {
|
|
742
921
|
name: appScheduleNameSchema,
|
|
743
922
|
path: appSchedulePathSchema,
|
|
744
|
-
description:
|
|
923
|
+
description: z10.string().min(1).max(500)
|
|
745
924
|
};
|
|
746
|
-
var everySchedule =
|
|
747
|
-
var cronSchedule =
|
|
748
|
-
var appScheduleSchema =
|
|
925
|
+
var everySchedule = z10.object({ ...declaration, every: everySchema });
|
|
926
|
+
var cronSchedule = z10.object({ ...declaration, cron: cronSchema });
|
|
927
|
+
var appScheduleSchema = z10.union([
|
|
749
928
|
everySchedule.strict(),
|
|
750
929
|
cronSchedule.strict()
|
|
751
930
|
]);
|
|
752
|
-
var appSchedulesSchema =
|
|
931
|
+
var appSchedulesSchema = z10.array(appScheduleSchema).max(APP_SCHEDULE_LIMIT).refine(
|
|
753
932
|
(items) => new Set(items.map((item) => item.name)).size === items.length,
|
|
754
933
|
"Schedule names must be unique"
|
|
755
934
|
);
|
|
@@ -766,35 +945,35 @@ function nextScheduleRun(schedule, after) {
|
|
|
766
945
|
}
|
|
767
946
|
return next.getTime();
|
|
768
947
|
}
|
|
769
|
-
var appScheduleStateSchema =
|
|
770
|
-
var appScheduleRunSchema =
|
|
771
|
-
id:
|
|
772
|
-
build:
|
|
773
|
-
startedAt:
|
|
774
|
-
scheduledAt:
|
|
775
|
-
manual:
|
|
776
|
-
status:
|
|
777
|
-
duration:
|
|
778
|
-
error:
|
|
948
|
+
var appScheduleStateSchema = z10.enum(["active", "paused", "archived"]);
|
|
949
|
+
var appScheduleRunSchema = z10.object({
|
|
950
|
+
id: z10.string().uuid(),
|
|
951
|
+
build: z10.string().uuid(),
|
|
952
|
+
startedAt: z10.number(),
|
|
953
|
+
scheduledAt: z10.number(),
|
|
954
|
+
manual: z10.boolean(),
|
|
955
|
+
status: z10.enum(["queued", "running", "succeeded", "failed", "uncertain"]),
|
|
956
|
+
duration: z10.number().nullable(),
|
|
957
|
+
error: z10.string().nullable()
|
|
779
958
|
});
|
|
780
|
-
var appScheduleListSchema =
|
|
959
|
+
var appScheduleListSchema = z10.object({
|
|
781
960
|
state: appScheduleStateSchema,
|
|
782
|
-
schedules:
|
|
783
|
-
|
|
784
|
-
declaration:
|
|
785
|
-
nextRun:
|
|
786
|
-
blocked:
|
|
961
|
+
schedules: z10.array(
|
|
962
|
+
z10.object({
|
|
963
|
+
declaration: z10.union([everySchedule, cronSchedule]),
|
|
964
|
+
nextRun: z10.number().nullable(),
|
|
965
|
+
blocked: z10.boolean(),
|
|
787
966
|
lastRun: appScheduleRunSchema.nullable()
|
|
788
967
|
})
|
|
789
968
|
)
|
|
790
969
|
});
|
|
791
|
-
var scheduledInvocationSchema =
|
|
792
|
-
id:
|
|
793
|
-
build:
|
|
970
|
+
var scheduledInvocationSchema = z10.object({
|
|
971
|
+
id: z10.string().uuid(),
|
|
972
|
+
build: z10.string().uuid(),
|
|
794
973
|
name: appScheduleNameSchema,
|
|
795
|
-
scheduledAt:
|
|
796
|
-
startedAt:
|
|
797
|
-
manual:
|
|
974
|
+
scheduledAt: z10.number().int(),
|
|
975
|
+
startedAt: z10.number().int(),
|
|
976
|
+
manual: z10.boolean()
|
|
798
977
|
}).strict();
|
|
799
978
|
async function verifyScheduledRequest(request, key) {
|
|
800
979
|
const signature = request.headers.get("X-Domino-Schedule-Signature");
|
|
@@ -859,7 +1038,7 @@ ${body}`)
|
|
|
859
1038
|
}
|
|
860
1039
|
|
|
861
1040
|
// src/server/starters.ts
|
|
862
|
-
import * as
|
|
1041
|
+
import * as z11 from "zod";
|
|
863
1042
|
var starterTemplates = [
|
|
864
1043
|
{
|
|
865
1044
|
id: "campaign",
|
|
@@ -892,63 +1071,63 @@ var starterTemplates = [
|
|
|
892
1071
|
summary: "A headless Worker with typed routes and interactive API docs, for plugging Domino into your own product."
|
|
893
1072
|
}
|
|
894
1073
|
];
|
|
895
|
-
var starterIdSchema =
|
|
1074
|
+
var starterIdSchema = z11.enum(
|
|
896
1075
|
starterTemplates.map((template) => template.id)
|
|
897
1076
|
);
|
|
898
1077
|
|
|
899
1078
|
// src/server/hosting.ts
|
|
900
|
-
var outputPathSchema =
|
|
1079
|
+
var outputPathSchema = z12.string().min(1).max(512).refine(
|
|
901
1080
|
(path) => path.split("/").every(
|
|
902
1081
|
(part) => /^[\w-][\w.-]*$/.test(part) && part !== "node_modules"
|
|
903
1082
|
),
|
|
904
1083
|
"Expected a relative build output path without hidden segments"
|
|
905
1084
|
);
|
|
906
|
-
var appRoutingSchema =
|
|
1085
|
+
var appRoutingSchema = z12.enum(["legacy", "transparent"]).default("legacy");
|
|
907
1086
|
var APP_SECRET_LIMIT = 50;
|
|
908
1087
|
var APP_KV_LIMIT = 5;
|
|
909
1088
|
var APP_SQL_LIMIT = 5;
|
|
910
1089
|
var APP_MIGRATION_LIMIT = 100;
|
|
911
1090
|
var APP_MIGRATION_FILE_BYTES = 9e4;
|
|
912
1091
|
var APP_MIGRATION_TOTAL_BYTES = 1e6;
|
|
913
|
-
var appSecretNameSchema =
|
|
1092
|
+
var appSecretNameSchema = z12.string().regex(
|
|
914
1093
|
/^[A-Z_][A-Z0-9_]{0,63}$/,
|
|
915
1094
|
"Use 1-64 uppercase letters, digits, and underscores, not starting with a digit"
|
|
916
1095
|
).refine(
|
|
917
1096
|
(name) => !name.startsWith("DOMINO_") && name !== "ASSETS",
|
|
918
1097
|
"DOMINO_ names and ASSETS are reserved for Domino's own bindings"
|
|
919
1098
|
);
|
|
920
|
-
var appSecretValueSchema =
|
|
1099
|
+
var appSecretValueSchema = z12.string().min(1).refine(
|
|
921
1100
|
(value) => new TextEncoder().encode(value).length <= 5120,
|
|
922
1101
|
"Secret values can be at most 5 KiB"
|
|
923
1102
|
);
|
|
924
|
-
var appSecretInputSchema =
|
|
925
|
-
var appSecretSchema =
|
|
1103
|
+
var appSecretInputSchema = z12.object({ value: appSecretValueSchema }).strict();
|
|
1104
|
+
var appSecretSchema = z12.object({
|
|
926
1105
|
name: appSecretNameSchema,
|
|
927
|
-
updatedAt:
|
|
928
|
-
updatedBy:
|
|
1106
|
+
updatedAt: z12.number(),
|
|
1107
|
+
updatedBy: z12.string()
|
|
929
1108
|
});
|
|
930
|
-
var appSecretDeclarationSchema =
|
|
931
|
-
description:
|
|
932
|
-
required:
|
|
1109
|
+
var appSecretDeclarationSchema = z12.object({
|
|
1110
|
+
description: z12.string().trim().min(1).max(500),
|
|
1111
|
+
required: z12.boolean().default(true)
|
|
933
1112
|
}).strict();
|
|
934
|
-
var appSecretDeclarationsSchema =
|
|
1113
|
+
var appSecretDeclarationsSchema = z12.record(appSecretNameSchema, appSecretDeclarationSchema).refine(
|
|
935
1114
|
(secrets) => Object.keys(secrets).length <= APP_SECRET_LIMIT,
|
|
936
1115
|
`Declare at most ${APP_SECRET_LIMIT} app secrets`
|
|
937
1116
|
);
|
|
938
|
-
var appSecretListSchema =
|
|
939
|
-
secrets:
|
|
940
|
-
declared:
|
|
1117
|
+
var appSecretListSchema = z12.object({
|
|
1118
|
+
secrets: z12.array(appSecretSchema),
|
|
1119
|
+
declared: z12.array(appSecretDeclarationSchema.extend({ name: appSecretNameSchema })).default([])
|
|
941
1120
|
});
|
|
942
|
-
var hostedAppSecretsSchema =
|
|
943
|
-
var storageDescription =
|
|
944
|
-
description:
|
|
1121
|
+
var hostedAppSecretsSchema = z12.object({ secrets: z12.record(appSecretNameSchema, appSecretValueSchema) }).strict();
|
|
1122
|
+
var storageDescription = z12.object({
|
|
1123
|
+
description: z12.string().trim().min(1).max(500)
|
|
945
1124
|
}).strict();
|
|
946
|
-
var appStorageSchema =
|
|
947
|
-
kv:
|
|
1125
|
+
var appStorageSchema = z12.object({
|
|
1126
|
+
kv: z12.record(appSecretNameSchema, storageDescription).refine(
|
|
948
1127
|
(stores) => Object.keys(stores).length <= APP_KV_LIMIT,
|
|
949
1128
|
`Declare at most ${APP_KV_LIMIT} KV stores`
|
|
950
1129
|
).default({}),
|
|
951
|
-
sql:
|
|
1130
|
+
sql: z12.record(
|
|
952
1131
|
appSecretNameSchema,
|
|
953
1132
|
storageDescription.extend({
|
|
954
1133
|
migrations: outputPathSchema.optional()
|
|
@@ -958,60 +1137,60 @@ var appStorageSchema = z11.object({
|
|
|
958
1137
|
`Declare at most ${APP_SQL_LIMIT} SQL stores`
|
|
959
1138
|
).default({})
|
|
960
1139
|
}).strict();
|
|
961
|
-
var appStorageKindSchema =
|
|
962
|
-
var appStorageListSchema =
|
|
963
|
-
stores:
|
|
964
|
-
|
|
965
|
-
kind:
|
|
1140
|
+
var appStorageKindSchema = z12.enum(["kv", "sql"]);
|
|
1141
|
+
var appStorageListSchema = z12.object({
|
|
1142
|
+
stores: z12.array(
|
|
1143
|
+
z12.object({
|
|
1144
|
+
kind: z12.string(),
|
|
966
1145
|
name: appSecretNameSchema,
|
|
967
|
-
createdAt:
|
|
968
|
-
declared:
|
|
969
|
-
description:
|
|
1146
|
+
createdAt: z12.number().nullable(),
|
|
1147
|
+
declared: z12.boolean(),
|
|
1148
|
+
description: z12.string().optional()
|
|
970
1149
|
})
|
|
971
1150
|
)
|
|
972
1151
|
});
|
|
973
1152
|
var APP_STORAGE_ROW_LIMIT = 50;
|
|
974
1153
|
var APP_STORAGE_PREVIEW_CHARACTERS = 2e3;
|
|
975
|
-
var appStorageCellSchema =
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
1154
|
+
var appStorageCellSchema = z12.union([
|
|
1155
|
+
z12.string(),
|
|
1156
|
+
z12.number(),
|
|
1157
|
+
z12.null(),
|
|
1158
|
+
z12.object({ text: z12.string(), truncated: z12.literal(true) }),
|
|
1159
|
+
z12.object({ blob: z12.number().int().min(0) })
|
|
981
1160
|
]);
|
|
982
|
-
var appStorageTablesSchema =
|
|
983
|
-
tables:
|
|
1161
|
+
var appStorageTablesSchema = z12.object({
|
|
1162
|
+
tables: z12.array(
|
|
984
1163
|
/** `kind` is SQLite's: `table` or `view`. */
|
|
985
|
-
|
|
1164
|
+
z12.object({ name: z12.string(), kind: z12.string() })
|
|
986
1165
|
)
|
|
987
1166
|
});
|
|
988
|
-
var appStorageRowsSchema =
|
|
989
|
-
table:
|
|
990
|
-
columns:
|
|
991
|
-
rows:
|
|
1167
|
+
var appStorageRowsSchema = z12.object({
|
|
1168
|
+
table: z12.string(),
|
|
1169
|
+
columns: z12.array(z12.string()),
|
|
1170
|
+
rows: z12.array(z12.array(appStorageCellSchema)),
|
|
992
1171
|
/** How many rows come before this page in storage order. */
|
|
993
|
-
offset:
|
|
994
|
-
total:
|
|
1172
|
+
offset: z12.number().int().min(0),
|
|
1173
|
+
total: z12.number().int().min(0),
|
|
995
1174
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
996
1175
|
nextCursor: pageCursorSchema.nullable().default(null)
|
|
997
1176
|
});
|
|
998
|
-
var appStorageKeysSchema =
|
|
999
|
-
keys:
|
|
1000
|
-
|
|
1177
|
+
var appStorageKeysSchema = z12.object({
|
|
1178
|
+
keys: z12.array(
|
|
1179
|
+
z12.object({ name: z12.string(), expiration: z12.number().nullable() })
|
|
1001
1180
|
),
|
|
1002
1181
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
1003
1182
|
nextCursor: pageCursorSchema.nullable().default(null),
|
|
1004
1183
|
/** @deprecated Use `nextCursor`. Removed in 2.0.0. */
|
|
1005
|
-
cursor:
|
|
1184
|
+
cursor: z12.string().nullable()
|
|
1006
1185
|
});
|
|
1007
|
-
var appStorageValueSchema =
|
|
1008
|
-
key:
|
|
1009
|
-
size:
|
|
1186
|
+
var appStorageValueSchema = z12.object({
|
|
1187
|
+
key: z12.string(),
|
|
1188
|
+
size: z12.number().int().min(0),
|
|
1010
1189
|
/** Null when the value is not UTF-8 text. */
|
|
1011
|
-
text:
|
|
1012
|
-
truncated:
|
|
1190
|
+
text: z12.string().nullable(),
|
|
1191
|
+
truncated: z12.boolean()
|
|
1013
1192
|
});
|
|
1014
|
-
var appMigrationNameSchema =
|
|
1193
|
+
var appMigrationNameSchema = z12.string().max(255).regex(/^[\w-][\w.-]*\.sql$/);
|
|
1015
1194
|
function compareAppMigrations(a, b) {
|
|
1016
1195
|
const left = Number.parseInt(a.split("_")[0], 10);
|
|
1017
1196
|
const right = Number.parseInt(b.split("_")[0], 10);
|
|
@@ -1028,12 +1207,12 @@ function compareAppMigrations(a, b) {
|
|
|
1028
1207
|
}
|
|
1029
1208
|
return a < b ? -1 : a > b ? 1 : 0;
|
|
1030
1209
|
}
|
|
1031
|
-
var appMigrationsSchema =
|
|
1210
|
+
var appMigrationsSchema = z12.record(
|
|
1032
1211
|
appSecretNameSchema,
|
|
1033
|
-
|
|
1034
|
-
|
|
1212
|
+
z12.array(
|
|
1213
|
+
z12.object({
|
|
1035
1214
|
name: appMigrationNameSchema,
|
|
1036
|
-
sql:
|
|
1215
|
+
sql: z12.string().min(1).refine(
|
|
1037
1216
|
(sql) => new TextEncoder().encode(sql).length <= APP_MIGRATION_FILE_BYTES,
|
|
1038
1217
|
`A migration file must not exceed ${APP_MIGRATION_FILE_BYTES} bytes`
|
|
1039
1218
|
)
|
|
@@ -1051,21 +1230,21 @@ var appMigrationsSchema = z11.record(
|
|
|
1051
1230
|
);
|
|
1052
1231
|
var appScripts = {
|
|
1053
1232
|
routing: appRoutingSchema,
|
|
1054
|
-
devScript:
|
|
1055
|
-
checkScript:
|
|
1056
|
-
buildScript:
|
|
1233
|
+
devScript: z12.string().regex(/^[\w:-]+$/),
|
|
1234
|
+
checkScript: z12.string().regex(/^[\w:-]+$/),
|
|
1235
|
+
buildScript: z12.string().regex(/^[\w:-]+$/)
|
|
1057
1236
|
};
|
|
1058
1237
|
var workerSettings = {
|
|
1059
|
-
runWorkerFirst:
|
|
1238
|
+
runWorkerFirst: z12.boolean().default(false),
|
|
1060
1239
|
main: outputPathSchema.refine(
|
|
1061
1240
|
(path) => /\.m?js$/.test(path),
|
|
1062
1241
|
"Expected a compiled JavaScript entry"
|
|
1063
1242
|
),
|
|
1064
|
-
compatibilityDate:
|
|
1065
|
-
compatibilityFlags:
|
|
1066
|
-
vars:
|
|
1067
|
-
|
|
1068
|
-
|
|
1243
|
+
compatibilityDate: z12.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
1244
|
+
compatibilityFlags: z12.array(z12.string().min(1)).max(50).default([]),
|
|
1245
|
+
vars: z12.record(
|
|
1246
|
+
z12.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).refine((name) => name !== "ASSETS"),
|
|
1247
|
+
z12.string()
|
|
1069
1248
|
).default({}),
|
|
1070
1249
|
secrets: appSecretDeclarationsSchema.default({}),
|
|
1071
1250
|
storage: appStorageSchema.optional(),
|
|
@@ -1094,62 +1273,62 @@ var distinctBindings = (worker, ctx) => {
|
|
|
1094
1273
|
}
|
|
1095
1274
|
}
|
|
1096
1275
|
};
|
|
1097
|
-
var hostedAppSchema =
|
|
1098
|
-
|
|
1099
|
-
kind:
|
|
1276
|
+
var hostedAppSchema = z12.discriminatedUnion("kind", [
|
|
1277
|
+
z12.object({
|
|
1278
|
+
kind: z12.literal("static"),
|
|
1100
1279
|
directory: outputPathSchema,
|
|
1101
1280
|
...appScripts
|
|
1102
1281
|
}).strict(),
|
|
1103
|
-
|
|
1104
|
-
kind:
|
|
1282
|
+
z12.object({
|
|
1283
|
+
kind: z12.literal("worker"),
|
|
1105
1284
|
directory: outputPathSchema,
|
|
1106
1285
|
assetsDirectory: outputPathSchema.optional(),
|
|
1107
1286
|
...appScripts,
|
|
1108
1287
|
...workerSettings
|
|
1109
1288
|
}).strict().superRefine(distinctBindings)
|
|
1110
1289
|
]);
|
|
1111
|
-
var repositorySchema =
|
|
1112
|
-
id:
|
|
1290
|
+
var repositorySchema = z12.object({
|
|
1291
|
+
id: z12.string().uuid(),
|
|
1113
1292
|
organization: identifier,
|
|
1114
1293
|
project: identifier,
|
|
1115
|
-
remote:
|
|
1116
|
-
defaultBranch:
|
|
1117
|
-
status:
|
|
1294
|
+
remote: z12.string().url(),
|
|
1295
|
+
defaultBranch: z12.string(),
|
|
1296
|
+
status: z12.enum(["provisioning", "ready"])
|
|
1118
1297
|
});
|
|
1119
|
-
var createRepositorySchema =
|
|
1298
|
+
var createRepositorySchema = z12.object({
|
|
1120
1299
|
/** Omitted: the starter chosen at project setup, else `campaign`. */
|
|
1121
1300
|
starter: starterIdSchema.optional()
|
|
1122
1301
|
}).strict();
|
|
1123
|
-
var deviceStartSchema =
|
|
1124
|
-
challenge:
|
|
1302
|
+
var deviceStartSchema = z12.object({
|
|
1303
|
+
challenge: z12.string().regex(/^[a-f0-9]{64}$/)
|
|
1125
1304
|
}).strict();
|
|
1126
|
-
var deviceRedeemSchema =
|
|
1127
|
-
id:
|
|
1128
|
-
verifier:
|
|
1305
|
+
var deviceRedeemSchema = z12.object({
|
|
1306
|
+
id: z12.string().uuid(),
|
|
1307
|
+
verifier: z12.string().min(43).max(128)
|
|
1129
1308
|
}).strict();
|
|
1130
|
-
var deviceApproveSchema =
|
|
1131
|
-
id:
|
|
1132
|
-
code:
|
|
1309
|
+
var deviceApproveSchema = z12.object({
|
|
1310
|
+
id: z12.string().uuid(),
|
|
1311
|
+
code: z12.string().regex(/^[A-F0-9]{4}-[A-F0-9]{4}$/)
|
|
1133
1312
|
}).strict();
|
|
1134
|
-
var commitSchema =
|
|
1135
|
-
var stageRequestSchema =
|
|
1313
|
+
var commitSchema = z12.string().regex(/^[a-f0-9]{40}$/);
|
|
1314
|
+
var stageRequestSchema = z12.object({
|
|
1136
1315
|
commit: commitSchema,
|
|
1137
|
-
requestId:
|
|
1316
|
+
requestId: z12.string().uuid()
|
|
1138
1317
|
}).strict();
|
|
1139
|
-
var buildIdentitySchema =
|
|
1318
|
+
var buildIdentitySchema = z12.object({
|
|
1140
1319
|
routing: appRoutingSchema,
|
|
1141
|
-
slug:
|
|
1142
|
-
runtime:
|
|
1143
|
-
id:
|
|
1144
|
-
repository:
|
|
1320
|
+
slug: z12.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional(),
|
|
1321
|
+
runtime: z12.enum(["simulation", "hosted-test"]).default("simulation"),
|
|
1322
|
+
id: z12.string().uuid(),
|
|
1323
|
+
repository: z12.string().uuid(),
|
|
1145
1324
|
organization: identifier,
|
|
1146
1325
|
project: identifier,
|
|
1147
1326
|
commit: commitSchema,
|
|
1148
|
-
createdAt:
|
|
1149
|
-
actor:
|
|
1150
|
-
commitMessage:
|
|
1327
|
+
createdAt: z12.number(),
|
|
1328
|
+
actor: z12.string(),
|
|
1329
|
+
commitMessage: z12.string().max(500).optional()
|
|
1151
1330
|
});
|
|
1152
|
-
var buildPhaseSchema =
|
|
1331
|
+
var buildPhaseSchema = z12.enum([
|
|
1153
1332
|
"queued",
|
|
1154
1333
|
"source",
|
|
1155
1334
|
"install",
|
|
@@ -1159,72 +1338,72 @@ var buildPhaseSchema = z11.enum([
|
|
|
1159
1338
|
"ready",
|
|
1160
1339
|
"failed"
|
|
1161
1340
|
]);
|
|
1162
|
-
var buildStatusSchema =
|
|
1341
|
+
var buildStatusSchema = z12.object({
|
|
1163
1342
|
phase: buildPhaseSchema,
|
|
1164
1343
|
failedPhase: buildPhaseSchema.optional(),
|
|
1165
|
-
updatedAt:
|
|
1166
|
-
message:
|
|
1344
|
+
updatedAt: z12.number(),
|
|
1345
|
+
message: z12.string()
|
|
1167
1346
|
});
|
|
1168
1347
|
var hostedBuildSchema = buildIdentitySchema.extend({
|
|
1169
1348
|
...buildStatusSchema.shape,
|
|
1170
|
-
finished:
|
|
1171
|
-
current:
|
|
1172
|
-
stagingUrl:
|
|
1349
|
+
finished: z12.boolean(),
|
|
1350
|
+
current: z12.boolean(),
|
|
1351
|
+
stagingUrl: z12.string().url()
|
|
1173
1352
|
});
|
|
1174
|
-
var stagingAccessModeSchema =
|
|
1175
|
-
var stagingAccessSchema =
|
|
1176
|
-
var stagingAccessInputSchema =
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
mode:
|
|
1180
|
-
password:
|
|
1353
|
+
var stagingAccessModeSchema = z12.enum(["console", "password"]);
|
|
1354
|
+
var stagingAccessSchema = z12.object({ mode: stagingAccessModeSchema });
|
|
1355
|
+
var stagingAccessInputSchema = z12.discriminatedUnion("mode", [
|
|
1356
|
+
z12.object({ mode: z12.literal("console") }).strict(),
|
|
1357
|
+
z12.object({
|
|
1358
|
+
mode: z12.literal("password"),
|
|
1359
|
+
password: z12.string().min(8).max(128)
|
|
1181
1360
|
}).strict()
|
|
1182
1361
|
]);
|
|
1183
|
-
var stagingPathSchema =
|
|
1362
|
+
var stagingPathSchema = z12.string().max(2048).refine(
|
|
1184
1363
|
(path) => path.startsWith("/") && !path.startsWith("//") && !path.includes("\\"),
|
|
1185
1364
|
"Expected a path on the staging host"
|
|
1186
1365
|
);
|
|
1187
|
-
var stagingLinkSchema =
|
|
1188
|
-
url:
|
|
1189
|
-
expiresAt:
|
|
1366
|
+
var stagingLinkSchema = z12.object({
|
|
1367
|
+
url: z12.string().url(),
|
|
1368
|
+
expiresAt: z12.number()
|
|
1190
1369
|
});
|
|
1191
|
-
var buildSnapshotSchema =
|
|
1192
|
-
builds:
|
|
1370
|
+
var buildSnapshotSchema = z12.object({
|
|
1371
|
+
builds: z12.array(hostedBuildSchema),
|
|
1193
1372
|
current: hostedBuildSchema.nullable(),
|
|
1194
1373
|
selected: hostedBuildSchema.nullable(),
|
|
1195
|
-
logs:
|
|
1374
|
+
logs: z12.string()
|
|
1196
1375
|
});
|
|
1197
|
-
var assetPathSchema =
|
|
1376
|
+
var assetPathSchema = z12.string().max(512).refine(
|
|
1198
1377
|
(path) => path.startsWith("/") && // oxlint-disable-next-line no-control-regex -- Asset paths must reject control characters.
|
|
1199
1378
|
!/[\\\u0000-\u001f?#%]/.test(path) && path.slice(1).split("/").every((part) => part.length > 0 && !part.startsWith(".")),
|
|
1200
1379
|
"Expected a public asset path without hidden segments"
|
|
1201
1380
|
);
|
|
1202
|
-
var base64Schema =
|
|
1381
|
+
var base64Schema = z12.string().regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
|
|
1203
1382
|
var stagedDeploymentLimits = {
|
|
1204
1383
|
/** Bytes of JSON, uncompressed. */
|
|
1205
1384
|
size: 64e6,
|
|
1206
1385
|
/** Bytes of the Brotli-compressed object. */
|
|
1207
1386
|
compressedSize: 1e7
|
|
1208
1387
|
};
|
|
1209
|
-
var stagedDeploymentSchema =
|
|
1210
|
-
encoding:
|
|
1211
|
-
sha256:
|
|
1212
|
-
compressedSize:
|
|
1213
|
-
size:
|
|
1388
|
+
var stagedDeploymentSchema = z12.object({
|
|
1389
|
+
encoding: z12.literal("br"),
|
|
1390
|
+
sha256: z12.string().regex(/^[0-9a-f]{64}$/),
|
|
1391
|
+
compressedSize: z12.number().int().positive().max(stagedDeploymentLimits.compressedSize),
|
|
1392
|
+
size: z12.number().int().positive().max(stagedDeploymentLimits.size)
|
|
1214
1393
|
}).strict();
|
|
1215
1394
|
var stagedDeploymentContentSchema = stagedDeploymentSchema.extend({
|
|
1216
|
-
content:
|
|
1395
|
+
content: z12.string().max(Math.ceil(stagedDeploymentLimits.compressedSize / 3) * 4)
|
|
1217
1396
|
}).strict();
|
|
1218
1397
|
var stagedDeploymentKey = (build, sha256) => `builds/${build}/deployment/${sha256}.br`;
|
|
1219
1398
|
var artifactFields = {
|
|
1220
1399
|
routing: appRoutingSchema,
|
|
1221
|
-
worker:
|
|
1400
|
+
worker: z12.object({
|
|
1222
1401
|
...workerSettings,
|
|
1223
1402
|
migrations: appMigrationsSchema.optional(),
|
|
1224
|
-
modules:
|
|
1225
|
-
|
|
1403
|
+
modules: z12.array(
|
|
1404
|
+
z12.object({
|
|
1226
1405
|
path: outputPathSchema.refine((path) => path !== "metadata"),
|
|
1227
|
-
type:
|
|
1406
|
+
type: z12.enum([
|
|
1228
1407
|
"application/javascript+module",
|
|
1229
1408
|
"application/wasm",
|
|
1230
1409
|
"text/plain",
|
|
@@ -1234,26 +1413,26 @@ var artifactFields = {
|
|
|
1234
1413
|
}).strict()
|
|
1235
1414
|
).min(1).max(500)
|
|
1236
1415
|
}).strict().superRefine(distinctBindings).optional(),
|
|
1237
|
-
assets:
|
|
1238
|
-
|
|
1416
|
+
assets: z12.array(
|
|
1417
|
+
z12.object({
|
|
1239
1418
|
path: assetPathSchema,
|
|
1240
1419
|
content: base64Schema.max(14e6),
|
|
1241
|
-
size:
|
|
1420
|
+
size: z12.number().int().min(0).max(1e7)
|
|
1242
1421
|
}).strict()
|
|
1243
1422
|
).max(500)
|
|
1244
1423
|
};
|
|
1245
|
-
var buildArtifactsSchema =
|
|
1246
|
-
|
|
1247
|
-
format:
|
|
1424
|
+
var buildArtifactsSchema = z12.discriminatedUnion("format", [
|
|
1425
|
+
z12.object({
|
|
1426
|
+
format: z12.literal(1),
|
|
1248
1427
|
...artifactFields,
|
|
1249
|
-
quests:
|
|
1250
|
-
catalog:
|
|
1428
|
+
quests: z12.unknown(),
|
|
1429
|
+
catalog: z12.unknown()
|
|
1251
1430
|
}).strict(),
|
|
1252
|
-
|
|
1253
|
-
format:
|
|
1431
|
+
z12.object({
|
|
1432
|
+
format: z12.literal(2),
|
|
1254
1433
|
...artifactFields,
|
|
1255
1434
|
deployment: stagedDeploymentSchema,
|
|
1256
|
-
images:
|
|
1435
|
+
images: z12.array(imageAssetArtifactSchema).max(10)
|
|
1257
1436
|
}).strict()
|
|
1258
1437
|
]).superRefine((value, ctx) => {
|
|
1259
1438
|
if (value.worker) {
|
|
@@ -1305,39 +1484,39 @@ var buildArtifactsSchema = z11.discriminatedUnion("format", [
|
|
|
1305
1484
|
});
|
|
1306
1485
|
|
|
1307
1486
|
// src/server/development.ts
|
|
1308
|
-
import * as
|
|
1309
|
-
var developmentPreflightSchema =
|
|
1310
|
-
organization:
|
|
1311
|
-
project:
|
|
1312
|
-
environment:
|
|
1313
|
-
identity:
|
|
1314
|
-
exchange:
|
|
1315
|
-
activeIntegrations:
|
|
1487
|
+
import * as z13 from "zod";
|
|
1488
|
+
var developmentPreflightSchema = z13.object({
|
|
1489
|
+
organization: z13.string(),
|
|
1490
|
+
project: z13.string(),
|
|
1491
|
+
environment: z13.enum(["test", "live"]),
|
|
1492
|
+
identity: z13.object({
|
|
1493
|
+
exchange: z13.literal("supported"),
|
|
1494
|
+
activeIntegrations: z13.number().int().nonnegative()
|
|
1316
1495
|
}).optional(),
|
|
1317
|
-
staging:
|
|
1318
|
-
development:
|
|
1319
|
-
status:
|
|
1496
|
+
staging: z13.enum(["configured", "blocked"]),
|
|
1497
|
+
development: z13.object({
|
|
1498
|
+
status: z13.enum(["configured", "blocked"]),
|
|
1320
1499
|
// How `domino dev` reaches the preview origin: a Cloudflare tunnel, or a direct route on a
|
|
1321
1500
|
// local development stack. APIs that predate the field use tunnels.
|
|
1322
|
-
transport:
|
|
1323
|
-
missing:
|
|
1324
|
-
authentication:
|
|
1501
|
+
transport: z13.enum(["tunnel", "direct"]).default("tunnel"),
|
|
1502
|
+
missing: z13.array(z13.string()),
|
|
1503
|
+
authentication: z13.array(z13.string())
|
|
1325
1504
|
}),
|
|
1326
|
-
checks:
|
|
1327
|
-
|
|
1328
|
-
id:
|
|
1329
|
-
status:
|
|
1330
|
-
message:
|
|
1331
|
-
missing:
|
|
1332
|
-
issues:
|
|
1505
|
+
checks: z13.array(
|
|
1506
|
+
z13.object({
|
|
1507
|
+
id: z13.string(),
|
|
1508
|
+
status: z13.enum(["ok", "error"]),
|
|
1509
|
+
message: z13.string(),
|
|
1510
|
+
missing: z13.array(z13.string()).optional(),
|
|
1511
|
+
issues: z13.array(z13.string()).optional()
|
|
1333
1512
|
})
|
|
1334
1513
|
)
|
|
1335
1514
|
});
|
|
1336
1515
|
|
|
1337
1516
|
// src/server/hosted.ts
|
|
1338
|
-
import * as
|
|
1517
|
+
import * as z14 from "zod";
|
|
1339
1518
|
var hostedKeyPermissions = ["read", "points", "ingest"];
|
|
1340
|
-
var hostedKeyPermissionList =
|
|
1519
|
+
var hostedKeyPermissionList = z14.array(z14.string()).transform(
|
|
1341
1520
|
(values) => values.filter(
|
|
1342
1521
|
(value) => hostedKeyPermissions.includes(value)
|
|
1343
1522
|
)
|
|
@@ -1349,17 +1528,17 @@ var hostedManagementBindings = [
|
|
|
1349
1528
|
"DOMINO_PROJECT",
|
|
1350
1529
|
"DOMINO_ENVIRONMENT"
|
|
1351
1530
|
];
|
|
1352
|
-
var hostedKeySecretSchema =
|
|
1353
|
-
var hostedKeySchema =
|
|
1354
|
-
id:
|
|
1531
|
+
var hostedKeySecretSchema = z14.string().regex(/^dhk_[A-Za-z0-9_-]{43}$/, "Expected a hosted app key");
|
|
1532
|
+
var hostedKeySchema = z14.object({
|
|
1533
|
+
id: z14.string().uuid(),
|
|
1355
1534
|
token: hostedKeySecretSchema,
|
|
1356
1535
|
organization: identifier,
|
|
1357
1536
|
project: identifier,
|
|
1358
|
-
environment:
|
|
1537
|
+
environment: z14.enum(["test", "live"]),
|
|
1359
1538
|
permissions: hostedKeyPermissionList,
|
|
1360
|
-
expiresAt:
|
|
1539
|
+
expiresAt: z14.number().nullable()
|
|
1361
1540
|
}).strict();
|
|
1362
|
-
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl:
|
|
1541
|
+
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl: z14.string().url() }).strict();
|
|
1363
1542
|
function hostedManagementClient(env) {
|
|
1364
1543
|
const missing = hostedManagementBindings.filter((name) => !env[name]);
|
|
1365
1544
|
if (missing.length) {
|
|
@@ -1367,7 +1546,7 @@ function hostedManagementClient(env) {
|
|
|
1367
1546
|
`Missing ${missing.join(", ")}. Domino sets these for hosted apps and domino dev; update the project's vite.config.ts to forward them in development.`
|
|
1368
1547
|
);
|
|
1369
1548
|
}
|
|
1370
|
-
const environment =
|
|
1549
|
+
const environment = z14.enum(["test", "live"]).parse(env.DOMINO_ENVIRONMENT);
|
|
1371
1550
|
const token = env.DOMINO_MANAGEMENT_KEY;
|
|
1372
1551
|
return createManagementClient({
|
|
1373
1552
|
baseUrl: env.DOMINO_API_URL.replace(/\/+$/, ""),
|
|
@@ -1379,9 +1558,9 @@ function hostedManagementClient(env) {
|
|
|
1379
1558
|
}
|
|
1380
1559
|
|
|
1381
1560
|
// src/server/index.ts
|
|
1382
|
-
var environmentSchema =
|
|
1383
|
-
var roleSchema =
|
|
1384
|
-
var permissionSchema =
|
|
1561
|
+
var environmentSchema = z15.enum(["test", "live"]);
|
|
1562
|
+
var roleSchema = z15.enum(["editor", "reviewer", "staff"]);
|
|
1563
|
+
var permissionSchema = z15.enum([
|
|
1385
1564
|
"read",
|
|
1386
1565
|
"publish",
|
|
1387
1566
|
"review",
|
|
@@ -1401,7 +1580,7 @@ var permissionSchema = z14.enum([
|
|
|
1401
1580
|
*/
|
|
1402
1581
|
"enroll"
|
|
1403
1582
|
]);
|
|
1404
|
-
var permissionListSchema =
|
|
1583
|
+
var permissionListSchema = z15.array(z15.string()).transform(
|
|
1405
1584
|
(values) => values.filter(
|
|
1406
1585
|
(value) => permissionSchema.safeParse(value).success
|
|
1407
1586
|
)
|
|
@@ -1411,38 +1590,38 @@ var rolePermissions = {
|
|
|
1411
1590
|
reviewer: ["read", "review"],
|
|
1412
1591
|
staff: ["read", "confirm", "handover"]
|
|
1413
1592
|
};
|
|
1414
|
-
var projectSetupSchema =
|
|
1415
|
-
mode:
|
|
1416
|
-
brief:
|
|
1593
|
+
var projectSetupSchema = z15.object({
|
|
1594
|
+
mode: z15.enum(["new", "existing"]),
|
|
1595
|
+
brief: z15.string().trim().min(1).max(4e3)
|
|
1417
1596
|
}).strict();
|
|
1418
|
-
var operatorUserSchema =
|
|
1419
|
-
id:
|
|
1420
|
-
name:
|
|
1421
|
-
email:
|
|
1422
|
-
avatar:
|
|
1597
|
+
var operatorUserSchema = z15.object({
|
|
1598
|
+
id: z15.string(),
|
|
1599
|
+
name: z15.string().nullable(),
|
|
1600
|
+
email: z15.string().nullable(),
|
|
1601
|
+
avatar: z15.string().nullable()
|
|
1423
1602
|
});
|
|
1424
|
-
var projectSchema =
|
|
1603
|
+
var projectSchema = z15.object({
|
|
1425
1604
|
/**
|
|
1426
1605
|
* Names the project's hosted addresses. The server gives a new project, and accepts in a
|
|
1427
1606
|
* slug change, only slugs of at least 3 characters that Domino does not reserve. This schema
|
|
1428
1607
|
* checks only the format, so it parses every slug that exists.
|
|
1429
1608
|
*/
|
|
1430
|
-
slug:
|
|
1431
|
-
createdBy:
|
|
1609
|
+
slug: z15.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
1610
|
+
createdBy: z15.string().nullable().optional(),
|
|
1432
1611
|
creator: operatorUserSchema.nullable().optional(),
|
|
1433
1612
|
/** A response, so fields a newer server adds to the setup are dropped, not rejected. */
|
|
1434
|
-
setup:
|
|
1613
|
+
setup: z15.object(projectSetupSchema.shape).optional(),
|
|
1435
1614
|
/** The starter chosen at setup. A plain string, so later starters still parse. */
|
|
1436
|
-
starter:
|
|
1437
|
-
id:
|
|
1615
|
+
starter: z15.string().optional(),
|
|
1616
|
+
id: z15.string().min(1),
|
|
1438
1617
|
organization: identifier,
|
|
1439
1618
|
project: identifier,
|
|
1440
|
-
name:
|
|
1441
|
-
subtitle:
|
|
1442
|
-
initials:
|
|
1443
|
-
color:
|
|
1619
|
+
name: z15.string(),
|
|
1620
|
+
subtitle: z15.string(),
|
|
1621
|
+
initials: z15.string(),
|
|
1622
|
+
color: z15.string(),
|
|
1444
1623
|
permissions: permissionListSchema,
|
|
1445
|
-
environments:
|
|
1624
|
+
environments: z15.array(environmentSchema)
|
|
1446
1625
|
}).refine(
|
|
1447
1626
|
(project) => !project.creator || project.creator.id === project.createdBy,
|
|
1448
1627
|
{
|
|
@@ -1450,45 +1629,45 @@ var projectSchema = z14.object({
|
|
|
1450
1629
|
path: ["creator"]
|
|
1451
1630
|
}
|
|
1452
1631
|
);
|
|
1453
|
-
var projectInputSchema =
|
|
1632
|
+
var projectInputSchema = z15.object({
|
|
1454
1633
|
actionId: identifier,
|
|
1455
|
-
name:
|
|
1634
|
+
name: z15.string().trim().min(1).max(80),
|
|
1456
1635
|
setup: projectSetupSchema.optional(),
|
|
1457
1636
|
/** The starter a new hosted app begins from, with `setup.mode` "new". */
|
|
1458
1637
|
starter: starterIdSchema.optional()
|
|
1459
1638
|
}).strict();
|
|
1460
|
-
var projectUpdateInputSchema =
|
|
1461
|
-
|
|
1462
|
-
|
|
1639
|
+
var projectUpdateInputSchema = z15.union([
|
|
1640
|
+
z15.object({ name: projectInputSchema.shape.name }).strict(),
|
|
1641
|
+
z15.object({
|
|
1463
1642
|
slug: projectSchema.shape.slug,
|
|
1464
|
-
confirm:
|
|
1643
|
+
confirm: z15.string().min(1).max(80)
|
|
1465
1644
|
}).strict()
|
|
1466
1645
|
]);
|
|
1467
|
-
var projectDeletionInputSchema =
|
|
1468
|
-
var projectDeletionSchema =
|
|
1646
|
+
var projectDeletionInputSchema = z15.object({ confirm: z15.string().min(1).max(80) }).strict();
|
|
1647
|
+
var projectDeletionSchema = z15.object({
|
|
1469
1648
|
project: identifier,
|
|
1470
|
-
purgeAfter:
|
|
1649
|
+
purgeAfter: z15.number().int()
|
|
1471
1650
|
});
|
|
1472
|
-
var projectTransferInputSchema =
|
|
1473
|
-
var projectTransferSchema =
|
|
1651
|
+
var projectTransferInputSchema = z15.object({ organization: identifier, confirm: z15.string().min(1).max(80) }).strict();
|
|
1652
|
+
var projectTransferSchema = z15.object({
|
|
1474
1653
|
organization: identifier,
|
|
1475
1654
|
project: identifier
|
|
1476
1655
|
});
|
|
1477
|
-
var grantSchema =
|
|
1478
|
-
subject:
|
|
1479
|
-
roles:
|
|
1480
|
-
environments:
|
|
1656
|
+
var grantSchema = z15.object({
|
|
1657
|
+
subject: z15.string().min(1).max(200),
|
|
1658
|
+
roles: z15.array(roleSchema),
|
|
1659
|
+
environments: z15.array(environmentSchema)
|
|
1481
1660
|
}).strict();
|
|
1482
|
-
var grantRecordSchema =
|
|
1483
|
-
var stockAdditionSchema =
|
|
1661
|
+
var grantRecordSchema = z15.object(grantSchema.shape);
|
|
1662
|
+
var stockAdditionSchema = z15.object({
|
|
1484
1663
|
item: identifier,
|
|
1485
|
-
quantity:
|
|
1664
|
+
quantity: z15.number().int(),
|
|
1486
1665
|
actionId: identifier
|
|
1487
1666
|
});
|
|
1488
|
-
var completionRevokeSchema =
|
|
1667
|
+
var completionRevokeSchema = z15.object({
|
|
1489
1668
|
actionId: identifier,
|
|
1490
|
-
reason:
|
|
1491
|
-
freeOccurrence:
|
|
1669
|
+
reason: z15.string().trim().min(1).max(500),
|
|
1670
|
+
freeOccurrence: z15.boolean().default(false)
|
|
1492
1671
|
}).strict();
|
|
1493
1672
|
var RevokedEntitlementOutcome = {
|
|
1494
1673
|
/** No other completion grants the reward: it is void, after cancelling a handover in progress. */
|
|
@@ -1516,234 +1695,249 @@ var RevokedReferralOutcome = {
|
|
|
1516
1695
|
/** Qualified on another accepted completion of the program's quest instead. */
|
|
1517
1696
|
Requalified: "requalified"
|
|
1518
1697
|
};
|
|
1519
|
-
var entitlementOutcomeSchema =
|
|
1520
|
-
var deliveryOutcomeSchema =
|
|
1521
|
-
var referralOutcomeSchema =
|
|
1522
|
-
var completionRevocationSchema =
|
|
1698
|
+
var entitlementOutcomeSchema = z15.string().min(1).max(64);
|
|
1699
|
+
var deliveryOutcomeSchema = z15.string().min(1).max(64);
|
|
1700
|
+
var referralOutcomeSchema = z15.string().min(1).max(64);
|
|
1701
|
+
var completionRevocationSchema = z15.object({
|
|
1523
1702
|
completion: identifier,
|
|
1524
1703
|
/** The quest ID, or the board ID when `source.kind` is `leaderboard`. */
|
|
1525
1704
|
quest: identifier,
|
|
1526
1705
|
member: identifier,
|
|
1527
1706
|
/** What paid the revoked completion. `source.id` repeats `quest`. */
|
|
1528
1707
|
source: completionSourceSchema.optional(),
|
|
1529
|
-
revokedAt:
|
|
1530
|
-
occurrenceFreed:
|
|
1531
|
-
badges:
|
|
1532
|
-
points:
|
|
1533
|
-
|
|
1708
|
+
revokedAt: z15.number(),
|
|
1709
|
+
occurrenceFreed: z15.boolean(),
|
|
1710
|
+
badges: z15.array(z15.object({ badge: identifier, stillAwarded: z15.boolean() })).optional(),
|
|
1711
|
+
points: z15.array(
|
|
1712
|
+
z15.object({
|
|
1534
1713
|
entry: identifier,
|
|
1535
1714
|
balance: identifier,
|
|
1536
1715
|
reversal: identifier.nullable(),
|
|
1537
|
-
reversed:
|
|
1538
|
-
unreversed:
|
|
1716
|
+
reversed: z15.number().int(),
|
|
1717
|
+
unreversed: z15.number().int()
|
|
1539
1718
|
})
|
|
1540
1719
|
),
|
|
1541
|
-
entitlements:
|
|
1542
|
-
|
|
1720
|
+
entitlements: z15.array(
|
|
1721
|
+
z15.object({
|
|
1543
1722
|
entitlement: identifier,
|
|
1544
1723
|
reward: identifier,
|
|
1545
1724
|
outcome: entitlementOutcomeSchema,
|
|
1546
|
-
status:
|
|
1725
|
+
status: z15.string()
|
|
1547
1726
|
})
|
|
1548
1727
|
),
|
|
1549
|
-
deliveries:
|
|
1550
|
-
|
|
1551
|
-
delivery:
|
|
1552
|
-
roleId:
|
|
1728
|
+
deliveries: z15.array(
|
|
1729
|
+
z15.object({
|
|
1730
|
+
delivery: z15.string(),
|
|
1731
|
+
roleId: z15.string(),
|
|
1553
1732
|
outcome: deliveryOutcomeSchema,
|
|
1554
1733
|
/**
|
|
1555
1734
|
* By Relay's records, another accepted, unrevoked completion of the member also granted this
|
|
1556
1735
|
* role to the same Discord account and server. Relay does not read Discord's membership.
|
|
1557
1736
|
*/
|
|
1558
|
-
stillGranted:
|
|
1737
|
+
stillGranted: z15.boolean()
|
|
1559
1738
|
})
|
|
1560
1739
|
),
|
|
1561
|
-
referrals:
|
|
1562
|
-
|
|
1740
|
+
referrals: z15.array(
|
|
1741
|
+
z15.object({
|
|
1563
1742
|
program: identifier,
|
|
1564
1743
|
outcome: referralOutcomeSchema
|
|
1565
1744
|
})
|
|
1566
1745
|
),
|
|
1567
|
-
streakMilestone:
|
|
1746
|
+
streakMilestone: z15.boolean()
|
|
1568
1747
|
});
|
|
1569
|
-
var accessSchema =
|
|
1570
|
-
actor:
|
|
1571
|
-
organization:
|
|
1572
|
-
admin:
|
|
1573
|
-
local:
|
|
1574
|
-
projects:
|
|
1748
|
+
var accessSchema = z15.object({
|
|
1749
|
+
actor: z15.string(),
|
|
1750
|
+
organization: z15.string(),
|
|
1751
|
+
admin: z15.boolean(),
|
|
1752
|
+
local: z15.boolean(),
|
|
1753
|
+
projects: z15.array(projectSchema)
|
|
1575
1754
|
});
|
|
1576
|
-
var querySchema =
|
|
1577
|
-
q:
|
|
1578
|
-
filter:
|
|
1579
|
-
offset:
|
|
1580
|
-
limit:
|
|
1755
|
+
var querySchema = z15.object({
|
|
1756
|
+
q: z15.string().max(200).default(""),
|
|
1757
|
+
filter: z15.string().max(50).default("all"),
|
|
1758
|
+
offset: z15.coerce.number().int().min(0).max(1e6).default(0),
|
|
1759
|
+
limit: z15.coerce.number().int().min(1).max(100).default(25)
|
|
1581
1760
|
});
|
|
1582
|
-
var accountProfileSchema =
|
|
1583
|
-
name:
|
|
1761
|
+
var accountProfileSchema = z15.object({
|
|
1762
|
+
name: z15.string().optional(),
|
|
1584
1763
|
/** The account's handle, where the provider has one (X and Discord). */
|
|
1585
|
-
username:
|
|
1586
|
-
email:
|
|
1587
|
-
emailVerified:
|
|
1588
|
-
imageUrl:
|
|
1764
|
+
username: z15.string().optional(),
|
|
1765
|
+
email: z15.string().optional(),
|
|
1766
|
+
emailVerified: z15.boolean().default(false),
|
|
1767
|
+
imageUrl: z15.string().url().optional()
|
|
1589
1768
|
});
|
|
1590
|
-
var memberAccountSchema =
|
|
1769
|
+
var memberAccountSchema = z15.object({
|
|
1591
1770
|
/** `wallet` for wallet sign-in, `account` for every other connected account. */
|
|
1592
|
-
kind:
|
|
1593
|
-
provider:
|
|
1594
|
-
subject:
|
|
1595
|
-
signInEnabled:
|
|
1771
|
+
kind: z15.enum(["account", "wallet"]),
|
|
1772
|
+
provider: z15.string(),
|
|
1773
|
+
subject: z15.string(),
|
|
1774
|
+
signInEnabled: z15.boolean(),
|
|
1596
1775
|
profile: accountProfileSchema.optional()
|
|
1597
1776
|
});
|
|
1598
|
-
var operationSchema =
|
|
1599
|
-
target:
|
|
1600
|
-
paused:
|
|
1601
|
-
revision:
|
|
1602
|
-
reason:
|
|
1603
|
-
actor:
|
|
1604
|
-
changedAt:
|
|
1777
|
+
var operationSchema = z15.object({
|
|
1778
|
+
target: z15.string(),
|
|
1779
|
+
paused: z15.boolean(),
|
|
1780
|
+
revision: z15.number().int(),
|
|
1781
|
+
reason: z15.string(),
|
|
1782
|
+
actor: z15.string().nullable(),
|
|
1783
|
+
changedAt: z15.number()
|
|
1605
1784
|
});
|
|
1606
|
-
var operationInputSchema =
|
|
1607
|
-
target:
|
|
1608
|
-
|
|
1609
|
-
|
|
1785
|
+
var operationInputSchema = z15.object({
|
|
1786
|
+
target: z15.union([
|
|
1787
|
+
z15.literal("redemptions"),
|
|
1788
|
+
z15.string().regex(/^quest:[\w-]+$/)
|
|
1610
1789
|
]),
|
|
1611
|
-
paused:
|
|
1612
|
-
revision:
|
|
1613
|
-
reason:
|
|
1790
|
+
paused: z15.boolean(),
|
|
1791
|
+
revision: z15.number().int().nonnegative(),
|
|
1792
|
+
reason: z15.string().trim().min(1).max(500),
|
|
1614
1793
|
actionId: identifier
|
|
1615
1794
|
}).strict();
|
|
1616
|
-
var questLifecycleInputSchema =
|
|
1795
|
+
var questLifecycleInputSchema = z15.object({
|
|
1617
1796
|
quest: identifier,
|
|
1618
1797
|
expectedRelease: identifier.optional(),
|
|
1619
|
-
archived:
|
|
1620
|
-
reason:
|
|
1798
|
+
archived: z15.boolean(),
|
|
1799
|
+
reason: z15.string().trim().min(1).max(500),
|
|
1621
1800
|
actionId: identifier
|
|
1622
1801
|
}).strict();
|
|
1623
|
-
var questLifecycleSchema =
|
|
1802
|
+
var questLifecycleSchema = z15.object({
|
|
1624
1803
|
quest: identifier,
|
|
1625
1804
|
key: identifier.nullable(),
|
|
1626
|
-
title:
|
|
1805
|
+
title: z15.string(),
|
|
1627
1806
|
release: identifier,
|
|
1628
|
-
lifecycle:
|
|
1629
|
-
changed:
|
|
1807
|
+
lifecycle: z15.enum(["active", "paused", "archived"]),
|
|
1808
|
+
changed: z15.boolean()
|
|
1630
1809
|
});
|
|
1631
|
-
var memberSchema =
|
|
1632
|
-
id:
|
|
1633
|
-
test:
|
|
1634
|
-
name:
|
|
1635
|
-
accounts:
|
|
1636
|
-
attempts:
|
|
1637
|
-
completions:
|
|
1638
|
-
rewards:
|
|
1639
|
-
lastActivity:
|
|
1810
|
+
var memberSchema = z15.object({
|
|
1811
|
+
id: z15.string(),
|
|
1812
|
+
test: z15.boolean().optional(),
|
|
1813
|
+
name: z15.string().nullable().optional(),
|
|
1814
|
+
accounts: z15.array(memberAccountSchema).default([]),
|
|
1815
|
+
attempts: z15.number(),
|
|
1816
|
+
completions: z15.number(),
|
|
1817
|
+
rewards: z15.number(),
|
|
1818
|
+
lastActivity: z15.number().nullable()
|
|
1640
1819
|
});
|
|
1641
|
-
var personSchema =
|
|
1642
|
-
id:
|
|
1643
|
-
test:
|
|
1644
|
-
name:
|
|
1645
|
-
accounts:
|
|
1820
|
+
var personSchema = z15.object({
|
|
1821
|
+
id: z15.string(),
|
|
1822
|
+
test: z15.boolean().optional(),
|
|
1823
|
+
name: z15.string().nullable().optional(),
|
|
1824
|
+
accounts: z15.array(memberAccountSchema).default([])
|
|
1646
1825
|
});
|
|
1647
|
-
var metricsSchema =
|
|
1648
|
-
quests:
|
|
1649
|
-
members:
|
|
1650
|
-
attempts:
|
|
1651
|
-
completions:
|
|
1652
|
-
review:
|
|
1653
|
-
failed:
|
|
1654
|
-
entitlements:
|
|
1826
|
+
var metricsSchema = z15.object({
|
|
1827
|
+
quests: z15.number(),
|
|
1828
|
+
members: z15.number(),
|
|
1829
|
+
attempts: z15.number(),
|
|
1830
|
+
completions: z15.number(),
|
|
1831
|
+
review: z15.number(),
|
|
1832
|
+
failed: z15.number(),
|
|
1833
|
+
entitlements: z15.number()
|
|
1655
1834
|
});
|
|
1656
|
-
var readinessSchema =
|
|
1657
|
-
checks:
|
|
1658
|
-
|
|
1659
|
-
id:
|
|
1660
|
-
status:
|
|
1661
|
-
title:
|
|
1662
|
-
detail:
|
|
1835
|
+
var readinessSchema = z15.object({
|
|
1836
|
+
checks: z15.array(
|
|
1837
|
+
z15.object({
|
|
1838
|
+
id: z15.string(),
|
|
1839
|
+
status: z15.enum(["ready", "blocked"]),
|
|
1840
|
+
title: z15.string(),
|
|
1841
|
+
detail: z15.string()
|
|
1663
1842
|
})
|
|
1664
1843
|
)
|
|
1665
1844
|
});
|
|
1666
|
-
var inventorySchema =
|
|
1667
|
-
item:
|
|
1668
|
-
name:
|
|
1669
|
-
available:
|
|
1670
|
-
reserved:
|
|
1671
|
-
allocated:
|
|
1845
|
+
var inventorySchema = z15.object({
|
|
1846
|
+
item: z15.string(),
|
|
1847
|
+
name: z15.string().nullable().default(null),
|
|
1848
|
+
available: z15.number(),
|
|
1849
|
+
reserved: z15.number(),
|
|
1850
|
+
allocated: z15.number().default(0)
|
|
1672
1851
|
});
|
|
1673
|
-
var auditRecordSchema =
|
|
1674
|
-
id:
|
|
1675
|
-
action:
|
|
1676
|
-
actor:
|
|
1852
|
+
var auditRecordSchema = z15.object({
|
|
1853
|
+
id: z15.string(),
|
|
1854
|
+
action: z15.string(),
|
|
1855
|
+
actor: z15.string().nullable(),
|
|
1677
1856
|
user: operatorUserSchema.nullable().optional(),
|
|
1678
|
-
detail:
|
|
1679
|
-
at:
|
|
1680
|
-
attempt:
|
|
1857
|
+
detail: z15.string(),
|
|
1858
|
+
at: z15.number(),
|
|
1859
|
+
attempt: z15.string().nullable()
|
|
1681
1860
|
}).refine((record4) => !record4.user || record4.user.id === record4.actor, {
|
|
1682
1861
|
message: "User profile must match the recorded actor",
|
|
1683
1862
|
path: ["user"]
|
|
1684
1863
|
});
|
|
1685
|
-
var pageSchema =
|
|
1864
|
+
var pageSchema = z15.object({
|
|
1686
1865
|
snapshot: snapshotSchema,
|
|
1687
|
-
members:
|
|
1688
|
-
people:
|
|
1866
|
+
members: z15.array(memberSchema),
|
|
1867
|
+
people: z15.array(personSchema).default([]),
|
|
1689
1868
|
metrics: metricsSchema,
|
|
1690
|
-
total:
|
|
1691
|
-
offset:
|
|
1692
|
-
limit:
|
|
1693
|
-
inventory:
|
|
1694
|
-
operations:
|
|
1695
|
-
audit:
|
|
1696
|
-
questCounts:
|
|
1869
|
+
total: z15.number(),
|
|
1870
|
+
offset: z15.number(),
|
|
1871
|
+
limit: z15.number(),
|
|
1872
|
+
inventory: z15.array(inventorySchema),
|
|
1873
|
+
operations: z15.array(operationSchema).default([]),
|
|
1874
|
+
audit: z15.array(auditRecordSchema).default([]),
|
|
1875
|
+
questCounts: z15.record(z15.string(), z15.number())
|
|
1697
1876
|
});
|
|
1698
|
-
var managedOAuthAccountBaseSchema =
|
|
1699
|
-
provider:
|
|
1700
|
-
revision:
|
|
1877
|
+
var managedOAuthAccountBaseSchema = z15.object({
|
|
1878
|
+
provider: z15.enum(["x", "discord"]),
|
|
1879
|
+
revision: z15.number().int().nonnegative()
|
|
1701
1880
|
});
|
|
1702
|
-
var managedOAuthAccountSchema =
|
|
1881
|
+
var managedOAuthAccountSchema = z15.discriminatedUnion("status", [
|
|
1703
1882
|
managedOAuthAccountBaseSchema.extend({
|
|
1704
|
-
status:
|
|
1705
|
-
subject:
|
|
1706
|
-
linkedAt:
|
|
1883
|
+
status: z15.literal("connected"),
|
|
1884
|
+
subject: z15.string().min(1),
|
|
1885
|
+
linkedAt: z15.number(),
|
|
1886
|
+
/**
|
|
1887
|
+
* True when a member import attached the account with the organization's word for it, not the
|
|
1888
|
+
* member's proof. Absent from Relay versions without imports.
|
|
1889
|
+
*/
|
|
1890
|
+
imported: z15.boolean().optional()
|
|
1707
1891
|
}),
|
|
1708
|
-
managedOAuthAccountBaseSchema.extend({ status:
|
|
1892
|
+
managedOAuthAccountBaseSchema.extend({ status: z15.literal("disconnected") })
|
|
1709
1893
|
]);
|
|
1710
1894
|
var managedTelegramAccountBaseSchema = managedOAuthAccountBaseSchema.extend({
|
|
1711
|
-
provider:
|
|
1895
|
+
provider: z15.literal("telegram")
|
|
1712
1896
|
});
|
|
1713
|
-
var managedTelegramAccountSchema =
|
|
1897
|
+
var managedTelegramAccountSchema = z15.discriminatedUnion("status", [
|
|
1714
1898
|
managedTelegramAccountBaseSchema.extend({
|
|
1715
|
-
status:
|
|
1899
|
+
status: z15.literal("connected"),
|
|
1716
1900
|
/** The numeric Telegram user ID. */
|
|
1717
|
-
subject:
|
|
1718
|
-
linkedAt:
|
|
1901
|
+
subject: z15.string().min(1),
|
|
1902
|
+
linkedAt: z15.number()
|
|
1719
1903
|
}),
|
|
1720
1904
|
managedTelegramAccountBaseSchema.extend({
|
|
1721
|
-
status:
|
|
1905
|
+
status: z15.literal("disconnected")
|
|
1722
1906
|
})
|
|
1723
1907
|
]);
|
|
1724
|
-
var memberOAuthUnlinkInputSchema =
|
|
1725
|
-
provider:
|
|
1726
|
-
subject:
|
|
1727
|
-
revision:
|
|
1728
|
-
reason:
|
|
1908
|
+
var memberOAuthUnlinkInputSchema = z15.object({
|
|
1909
|
+
provider: z15.enum(["x", "discord"]),
|
|
1910
|
+
subject: z15.string().min(1).max(4096),
|
|
1911
|
+
revision: z15.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER - 1),
|
|
1912
|
+
reason: z15.string().trim().min(1).max(500)
|
|
1729
1913
|
}).strict();
|
|
1730
1914
|
var memberTelegramUnlinkInputSchema = memberOAuthUnlinkInputSchema.omit({ provider: true }).strict();
|
|
1731
1915
|
var managedWalletSchema = linkedWalletSchema.extend({
|
|
1732
|
-
|
|
1733
|
-
|
|
1916
|
+
/**
|
|
1917
|
+
* True when a member import attached the wallet with the organization's word for it, and the
|
|
1918
|
+
* member has not proved it since. Absent from Relay versions without imports.
|
|
1919
|
+
*/
|
|
1920
|
+
imported: z15.boolean().optional(),
|
|
1921
|
+
status: z15.enum(["linked", "unlinked"]),
|
|
1922
|
+
unlinkedAt: z15.number().int().nullable(),
|
|
1734
1923
|
/** "member", or the operator or key that unlinked it. */
|
|
1735
|
-
unlinkedBy:
|
|
1924
|
+
unlinkedBy: z15.string().nullable()
|
|
1736
1925
|
});
|
|
1737
1926
|
var managedMemberIdentitySchema = memberIdentitySchema.extend({
|
|
1738
|
-
|
|
1739
|
-
|
|
1927
|
+
/**
|
|
1928
|
+
* True for an X account a member import attached, until the member links or signs in with it
|
|
1929
|
+
* through X. Absent from Relay versions without imports.
|
|
1930
|
+
*/
|
|
1931
|
+
imported: z15.boolean().optional(),
|
|
1932
|
+
status: z15.enum(["linked", "unlinked"]),
|
|
1933
|
+
unlinkedAt: z15.number().int().nullable(),
|
|
1740
1934
|
/** The operator or key that unlinked it. */
|
|
1741
|
-
unlinkedBy:
|
|
1935
|
+
unlinkedBy: z15.string().nullable()
|
|
1742
1936
|
});
|
|
1743
|
-
var memberIdentityChangeInputSchema =
|
|
1937
|
+
var memberIdentityChangeInputSchema = z15.object({
|
|
1744
1938
|
kind: appIdentityKindSchema,
|
|
1745
|
-
subject:
|
|
1746
|
-
reason:
|
|
1939
|
+
subject: z15.string().min(1).max(256),
|
|
1940
|
+
reason: z15.string().trim().min(1).max(500)
|
|
1747
1941
|
}).strict();
|
|
1748
1942
|
var balanceCheckSchema = walletBalanceSchema.pick({
|
|
1749
1943
|
chain: true,
|
|
@@ -1753,76 +1947,76 @@ var balanceCheckSchema = walletBalanceSchema.pick({
|
|
|
1753
1947
|
wallets: true,
|
|
1754
1948
|
observedAt: true
|
|
1755
1949
|
}).extend({ attempt: identifier });
|
|
1756
|
-
var walletBalanceChainsSchema =
|
|
1757
|
-
chains:
|
|
1758
|
-
|
|
1759
|
-
chain:
|
|
1760
|
-
|
|
1950
|
+
var walletBalanceChainsSchema = z15.object({
|
|
1951
|
+
chains: z15.array(
|
|
1952
|
+
z15.object({
|
|
1953
|
+
chain: z15.union([
|
|
1954
|
+
z15.literal(solanaMainnet),
|
|
1761
1955
|
cosmosNetworkSchema,
|
|
1762
1956
|
evmChainIdSchema
|
|
1763
1957
|
]),
|
|
1764
|
-
name:
|
|
1765
|
-
testnet:
|
|
1958
|
+
name: z15.string(),
|
|
1959
|
+
testnet: z15.boolean()
|
|
1766
1960
|
})
|
|
1767
1961
|
)
|
|
1768
1962
|
});
|
|
1769
|
-
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason:
|
|
1963
|
+
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason: z15.string().trim().min(1).max(500) }).strict();
|
|
1770
1964
|
var memberWalletSignInInputSchema = walletUnlinkInputSchema.extend({
|
|
1771
|
-
enabled:
|
|
1772
|
-
reason:
|
|
1965
|
+
enabled: z15.boolean(),
|
|
1966
|
+
reason: z15.string().trim().min(1).max(500)
|
|
1773
1967
|
}).strict();
|
|
1774
|
-
var telegramBotIdSchema =
|
|
1775
|
-
var participantSignInSchema =
|
|
1776
|
-
providers:
|
|
1777
|
-
|
|
1968
|
+
var telegramBotIdSchema = z15.string().regex(/^[1-9][0-9]{0,19}$/, "Enter the bot's numeric ID, such as 123456789");
|
|
1969
|
+
var participantSignInSchema = z15.object({
|
|
1970
|
+
providers: z15.array(
|
|
1971
|
+
z15.object({ provider: authProviderSchema, configured: z15.boolean() })
|
|
1778
1972
|
),
|
|
1779
|
-
email:
|
|
1973
|
+
email: z15.boolean(),
|
|
1780
1974
|
/** Wallet families: `"solana"`, `"eip155"`, `"cosmos"`. */
|
|
1781
1975
|
wallets: walletSignInNetworksSchema,
|
|
1782
1976
|
/** Why participants cannot sign in to this project, or null. */
|
|
1783
|
-
issue:
|
|
1977
|
+
issue: z15.string().nullable(),
|
|
1784
1978
|
/**
|
|
1785
1979
|
* Telegram, outside `providers` in SDK 1.x: whether Domino configured Telegram Login, and the
|
|
1786
1980
|
* bot whose Mini App participants sign in from, or null when Mini App sign-in is off. Absent
|
|
1787
1981
|
* from Relay versions without Telegram.
|
|
1788
1982
|
*/
|
|
1789
|
-
telegram:
|
|
1790
|
-
login:
|
|
1983
|
+
telegram: z15.object({
|
|
1984
|
+
login: z15.boolean(),
|
|
1791
1985
|
miniAppBotId: telegramBotIdSchema.nullable()
|
|
1792
1986
|
}).optional(),
|
|
1793
|
-
updatedAt:
|
|
1794
|
-
updatedBy:
|
|
1987
|
+
updatedAt: z15.number().nullable(),
|
|
1988
|
+
updatedBy: z15.string().nullable()
|
|
1795
1989
|
});
|
|
1796
|
-
var participantSignInInputSchema =
|
|
1990
|
+
var participantSignInInputSchema = z15.object({
|
|
1797
1991
|
wallets: walletSignInNetworksSchema,
|
|
1798
|
-
telegram:
|
|
1992
|
+
telegram: z15.object({ miniAppBotId: telegramBotIdSchema.nullable() }).strict().optional()
|
|
1799
1993
|
}).strict();
|
|
1800
|
-
var completionRevocationShortfallSchema =
|
|
1994
|
+
var completionRevocationShortfallSchema = z15.object({
|
|
1801
1995
|
completion: identifier,
|
|
1802
1996
|
quest: identifier,
|
|
1803
|
-
revokedAt:
|
|
1804
|
-
unreversedPoints:
|
|
1997
|
+
revokedAt: z15.number().int().nonnegative().safe(),
|
|
1998
|
+
unreversedPoints: z15.record(identifier, z15.number().int().positive().safe())
|
|
1805
1999
|
});
|
|
1806
|
-
var memberDetailSchema =
|
|
2000
|
+
var memberDetailSchema = z15.object({
|
|
1807
2001
|
snapshot: snapshotSchema,
|
|
1808
2002
|
member: memberSchema,
|
|
1809
2003
|
progress: memberProgressSchema,
|
|
1810
2004
|
/** Up to 25 revoked completions with an unreversed point remainder, newest first. */
|
|
1811
|
-
revocationShortfalls:
|
|
2005
|
+
revocationShortfalls: z15.array(completionRevocationShortfallSchema).default([]),
|
|
1812
2006
|
/** Current and historical campaign enrollment state, including inactive enrollments. */
|
|
1813
|
-
campaignEnrollments:
|
|
1814
|
-
passes:
|
|
1815
|
-
|
|
1816
|
-
provider:
|
|
1817
|
-
event:
|
|
1818
|
-
subject:
|
|
2007
|
+
campaignEnrollments: z15.array(campaignEnrollmentSchema).default([]),
|
|
2008
|
+
passes: z15.array(
|
|
2009
|
+
z15.object({
|
|
2010
|
+
provider: z15.string(),
|
|
2011
|
+
event: z15.string(),
|
|
2012
|
+
subject: z15.string(),
|
|
1819
2013
|
attempt: identifier.nullable()
|
|
1820
2014
|
})
|
|
1821
2015
|
).default([]),
|
|
1822
2016
|
/** Linked and unlinked wallets. */
|
|
1823
|
-
wallets:
|
|
2017
|
+
wallets: z15.array(managedWalletSchema),
|
|
1824
2018
|
/** The member's 10 most recent recorded balance reads, newest first. */
|
|
1825
|
-
balanceChecks:
|
|
2019
|
+
balanceChecks: z15.array(balanceCheckSchema),
|
|
1826
2020
|
/** The member's participant profile in this project. */
|
|
1827
2021
|
profile: managedProfileSchema.nullable(),
|
|
1828
2022
|
/**
|
|
@@ -1830,11 +2024,11 @@ var memberDetailSchema = z14.object({
|
|
|
1830
2024
|
* member ID: their selected X and Discord accounts and their `app:<name>` identities in this
|
|
1831
2025
|
* project, including app identities an operator unlinked, by kind.
|
|
1832
2026
|
*/
|
|
1833
|
-
identities:
|
|
2027
|
+
identities: z15.array(managedMemberIdentitySchema)
|
|
1834
2028
|
});
|
|
1835
|
-
var managedMemberProgressSchema =
|
|
2029
|
+
var managedMemberProgressSchema = z15.object({
|
|
1836
2030
|
member: identifier,
|
|
1837
|
-
quests:
|
|
2031
|
+
quests: z15.array(
|
|
1838
2032
|
memberProgressSchema.shape.quests.element.extend({
|
|
1839
2033
|
/** The streak as `members.get` reports it, without the list of qualifying days. */
|
|
1840
2034
|
streak: streakProgressSchema.omit({ days: true }).nullable().optional()
|
|
@@ -1845,124 +2039,152 @@ var managedMemberProgressSchema = z14.object({
|
|
|
1845
2039
|
/** Each point balance the member has, by balance ID. */
|
|
1846
2040
|
balances: snapshotSchema.shape.balances
|
|
1847
2041
|
});
|
|
1848
|
-
var stockInputSchema =
|
|
2042
|
+
var stockInputSchema = z15.object({
|
|
1849
2043
|
item: identifier,
|
|
1850
|
-
quantity:
|
|
2044
|
+
quantity: z15.number().int().positive().max(1e6),
|
|
1851
2045
|
actionId: identifier
|
|
1852
2046
|
}).strict();
|
|
1853
|
-
var ingestTrackerScopeSchema =
|
|
1854
|
-
var tokenScopeInputSchema =
|
|
1855
|
-
var tokenInputSchema =
|
|
1856
|
-
name:
|
|
2047
|
+
var ingestTrackerScopeSchema = z15.array(identifier).min(1).max(100).nullable();
|
|
2048
|
+
var tokenScopeInputSchema = z15.object({ ingestTrackers: ingestTrackerScopeSchema }).strict();
|
|
2049
|
+
var tokenInputSchema = z15.object({
|
|
2050
|
+
name: z15.string().trim().min(1).max(80),
|
|
1857
2051
|
project: identifier,
|
|
1858
2052
|
environment: environmentSchema,
|
|
1859
|
-
permissions:
|
|
2053
|
+
permissions: z15.array(permissionSchema).min(1),
|
|
1860
2054
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
1861
|
-
days:
|
|
2055
|
+
days: z15.number().int().min(1).max(90).default(30)
|
|
1862
2056
|
}).strict();
|
|
1863
|
-
var tokenSchema =
|
|
1864
|
-
id:
|
|
1865
|
-
name:
|
|
1866
|
-
project:
|
|
2057
|
+
var tokenSchema = z15.object({
|
|
2058
|
+
id: z15.string(),
|
|
2059
|
+
name: z15.string(),
|
|
2060
|
+
project: z15.string(),
|
|
1867
2061
|
environment: environmentSchema,
|
|
1868
2062
|
permissions: permissionListSchema,
|
|
1869
2063
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
1870
|
-
expiresAt:
|
|
2064
|
+
expiresAt: z15.number()
|
|
2065
|
+
});
|
|
2066
|
+
var issuedTokenSchema = tokenSchema.extend({ token: z15.string() });
|
|
2067
|
+
var serviceKeyInputSchema = z15.object({
|
|
2068
|
+
name: z15.string().trim().min(1).max(80),
|
|
2069
|
+
permissions: z15.array(permissionSchema).min(1).refine(
|
|
2070
|
+
(permissions) => !permissions.includes("access"),
|
|
2071
|
+
"Service keys cannot hold the access permission"
|
|
2072
|
+
),
|
|
2073
|
+
/** Days until the first secret expires. Omit it for a key that never expires. */
|
|
2074
|
+
expiresInDays: z15.number().int().min(1).max(3650).optional()
|
|
2075
|
+
}).strict();
|
|
2076
|
+
var serviceKeySchema = z15.object({
|
|
2077
|
+
id: z15.string().uuid(),
|
|
2078
|
+
organization: z15.string(),
|
|
2079
|
+
project: z15.string(),
|
|
2080
|
+
environment: environmentSchema,
|
|
2081
|
+
name: z15.string(),
|
|
2082
|
+
permissions: permissionListSchema,
|
|
2083
|
+
/** The Clerk user ID of the administrator who created it. */
|
|
2084
|
+
createdBy: z15.string(),
|
|
2085
|
+
createdAt: z15.number(),
|
|
2086
|
+
/** The latest use of any of its secrets, revoked ones included; null when none was used. */
|
|
2087
|
+
lastUsedAt: z15.number().nullable(),
|
|
2088
|
+
/** Its working secrets, oldest first. Any of them authenticates the key. */
|
|
2089
|
+
secrets: z15.array(credentialSecretSchema)
|
|
2090
|
+
});
|
|
2091
|
+
var issuedServiceKeySchema = serviceKeySchema.extend({
|
|
2092
|
+
secret: z15.string().uuid(),
|
|
2093
|
+
token: z15.string()
|
|
1871
2094
|
});
|
|
1872
|
-
var
|
|
1873
|
-
|
|
1874
|
-
z14.object({ id: z14.string(), label: z14.string() })
|
|
2095
|
+
var teamSchema = z15.array(
|
|
2096
|
+
z15.object({ id: z15.string(), label: z15.string() })
|
|
1875
2097
|
);
|
|
1876
|
-
var memberLookupSchema =
|
|
1877
|
-
provider:
|
|
1878
|
-
subject:
|
|
2098
|
+
var memberLookupSchema = z15.object({
|
|
2099
|
+
provider: z15.string().min(1).max(200),
|
|
2100
|
+
subject: z15.string().min(1).max(2048)
|
|
1879
2101
|
}).strict();
|
|
1880
|
-
var booleanQuery =
|
|
1881
|
-
|
|
1882
|
-
|
|
2102
|
+
var booleanQuery = z15.union([
|
|
2103
|
+
z15.boolean(),
|
|
2104
|
+
z15.enum(["true", "false"]).transform((v) => v === "true")
|
|
1883
2105
|
]);
|
|
1884
|
-
var managedMemberQuerySchema =
|
|
1885
|
-
q:
|
|
2106
|
+
var managedMemberQuerySchema = z15.strictObject({
|
|
2107
|
+
q: z15.string().max(200).optional(),
|
|
1886
2108
|
needsReview: booleanQuery.optional(),
|
|
1887
|
-
limit:
|
|
2109
|
+
limit: z15.coerce.number().int().min(1).max(100).optional(),
|
|
1888
2110
|
cursor: pageCursorSchema.optional()
|
|
1889
2111
|
});
|
|
1890
|
-
var managedMemberPageSchema =
|
|
1891
|
-
items:
|
|
1892
|
-
total:
|
|
1893
|
-
nextCursor:
|
|
2112
|
+
var managedMemberPageSchema = z15.object({
|
|
2113
|
+
items: z15.array(memberSchema),
|
|
2114
|
+
total: z15.number().int().nonnegative(),
|
|
2115
|
+
nextCursor: z15.string().nullable()
|
|
1894
2116
|
});
|
|
1895
2117
|
var projectMetricsSchema = metricsSchema.extend({
|
|
1896
|
-
completionsByQuest:
|
|
1897
|
-
|
|
2118
|
+
completionsByQuest: z15.array(
|
|
2119
|
+
z15.object({ quest: identifier, completions: z15.number() })
|
|
1898
2120
|
)
|
|
1899
2121
|
});
|
|
1900
|
-
var pageLimit =
|
|
1901
|
-
var managedAttemptQuerySchema =
|
|
1902
|
-
q:
|
|
1903
|
-
status:
|
|
2122
|
+
var pageLimit = z15.coerce.number().int().min(1).max(100).optional();
|
|
2123
|
+
var managedAttemptQuerySchema = z15.strictObject({
|
|
2124
|
+
q: z15.string().max(200).optional(),
|
|
2125
|
+
status: z15.string().min(1).max(50).optional(),
|
|
1904
2126
|
limit: pageLimit,
|
|
1905
2127
|
cursor: pageCursorSchema.optional()
|
|
1906
2128
|
});
|
|
1907
|
-
var managedAttemptPageSchema =
|
|
1908
|
-
items:
|
|
1909
|
-
releases:
|
|
1910
|
-
people:
|
|
1911
|
-
total:
|
|
1912
|
-
nextCursor:
|
|
2129
|
+
var managedAttemptPageSchema = z15.object({
|
|
2130
|
+
items: z15.array(attemptSchema),
|
|
2131
|
+
releases: z15.array(publishedReleaseSchema),
|
|
2132
|
+
people: z15.array(personSchema),
|
|
2133
|
+
total: z15.number().int().nonnegative(),
|
|
2134
|
+
nextCursor: z15.string().nullable()
|
|
1913
2135
|
});
|
|
1914
|
-
var managedReleaseQuerySchema =
|
|
2136
|
+
var managedReleaseQuerySchema = z15.strictObject({
|
|
1915
2137
|
quest: identifier.optional(),
|
|
1916
2138
|
limit: pageLimit,
|
|
1917
2139
|
cursor: pageCursorSchema.optional()
|
|
1918
2140
|
});
|
|
1919
|
-
var managedReleasePageSchema =
|
|
1920
|
-
items:
|
|
1921
|
-
nextCursor:
|
|
2141
|
+
var managedReleasePageSchema = z15.object({
|
|
2142
|
+
items: z15.array(publishedReleaseSchema),
|
|
2143
|
+
nextCursor: z15.string().nullable()
|
|
1922
2144
|
});
|
|
1923
|
-
var managedAttemptSchema =
|
|
2145
|
+
var managedAttemptSchema = z15.object({
|
|
1924
2146
|
attempt: attemptSchema,
|
|
1925
2147
|
release: publishedReleaseSchema.nullable(),
|
|
1926
|
-
events:
|
|
2148
|
+
events: z15.array(eventSchema),
|
|
1927
2149
|
person: personSchema
|
|
1928
2150
|
});
|
|
1929
|
-
var managedEntitlementQuerySchema =
|
|
1930
|
-
q:
|
|
1931
|
-
status:
|
|
2151
|
+
var managedEntitlementQuerySchema = z15.strictObject({
|
|
2152
|
+
q: z15.string().max(200).optional(),
|
|
2153
|
+
status: z15.string().min(1).max(50).optional(),
|
|
1932
2154
|
limit: pageLimit,
|
|
1933
2155
|
cursor: pageCursorSchema.optional()
|
|
1934
2156
|
});
|
|
1935
|
-
var managedEntitlementPageSchema =
|
|
1936
|
-
items:
|
|
1937
|
-
people:
|
|
1938
|
-
total:
|
|
1939
|
-
nextCursor:
|
|
2157
|
+
var managedEntitlementPageSchema = z15.object({
|
|
2158
|
+
items: z15.array(entitlementSchema),
|
|
2159
|
+
people: z15.array(personSchema),
|
|
2160
|
+
total: z15.number().int().nonnegative(),
|
|
2161
|
+
nextCursor: z15.string().nullable()
|
|
1940
2162
|
});
|
|
1941
|
-
var managedEntitlementSchema =
|
|
2163
|
+
var managedEntitlementSchema = z15.object({
|
|
1942
2164
|
entitlement: entitlementSchema,
|
|
1943
2165
|
person: personSchema
|
|
1944
2166
|
});
|
|
1945
2167
|
var managedStockItemSchema = inventorySchema.extend({
|
|
1946
|
-
offers:
|
|
2168
|
+
offers: z15.array(identifier)
|
|
1947
2169
|
});
|
|
1948
|
-
var auditQuerySchema =
|
|
1949
|
-
category:
|
|
1950
|
-
q:
|
|
2170
|
+
var auditQuerySchema = z15.strictObject({
|
|
2171
|
+
category: z15.enum(["reviews", "rewards", "configuration"]).optional(),
|
|
2172
|
+
q: z15.string().max(200).optional(),
|
|
1951
2173
|
limit: pageLimit,
|
|
1952
2174
|
cursor: pageCursorSchema.optional()
|
|
1953
2175
|
});
|
|
1954
2176
|
var accessHistoryQuerySchema = auditQuerySchema.omit({
|
|
1955
2177
|
category: true
|
|
1956
2178
|
});
|
|
1957
|
-
var auditPageSchema =
|
|
1958
|
-
items:
|
|
1959
|
-
total:
|
|
1960
|
-
nextCursor:
|
|
2179
|
+
var auditPageSchema = z15.object({
|
|
2180
|
+
items: z15.array(auditRecordSchema),
|
|
2181
|
+
total: z15.number().int().nonnegative(),
|
|
2182
|
+
nextCursor: z15.string().nullable()
|
|
1961
2183
|
});
|
|
1962
|
-
var verifiedPassSchema =
|
|
2184
|
+
var verifiedPassSchema = z15.object({
|
|
1963
2185
|
provider: identifier,
|
|
1964
2186
|
event: identifier,
|
|
1965
|
-
subject:
|
|
2187
|
+
subject: z15.string().min(1).max(2048),
|
|
1966
2188
|
member: identifier,
|
|
1967
2189
|
quest: identifier
|
|
1968
2190
|
}).strict();
|
|
@@ -1986,7 +2208,7 @@ function clientFailure(error) {
|
|
|
1986
2208
|
return new ManagementError({
|
|
1987
2209
|
kind: "client",
|
|
1988
2210
|
code: ManagementErrorCode.InvalidInput,
|
|
1989
|
-
message: error instanceof
|
|
2211
|
+
message: error instanceof z15.ZodError ? `Invalid management request: ${z15.prettifyError(error)}` : error instanceof Error ? error.message : "Invalid management request",
|
|
1990
2212
|
cause: error
|
|
1991
2213
|
});
|
|
1992
2214
|
}
|
|
@@ -2024,7 +2246,7 @@ function managementClient(options) {
|
|
|
2024
2246
|
call
|
|
2025
2247
|
);
|
|
2026
2248
|
}
|
|
2027
|
-
const ok =
|
|
2249
|
+
const ok = z15.object({ ok: z15.literal(true) });
|
|
2028
2250
|
function pointHistory(member, ledger, query = {}, call) {
|
|
2029
2251
|
return get(
|
|
2030
2252
|
`/points/${identifier.parse(member)}/${identifier.parse(ledger)}/history${queryString(typeof query === "number" ? { before: query } : pageQuerySchema.parse(query))}`,
|
|
@@ -2109,7 +2331,7 @@ function managementClient(options) {
|
|
|
2109
2331
|
const input = isInput ? inputOrCall ?? {} : {};
|
|
2110
2332
|
const options2 = isInput ? call : inputOrCall;
|
|
2111
2333
|
return post(
|
|
2112
|
-
`/webhooks/${
|
|
2334
|
+
`/webhooks/${z15.string().uuid().parse(id)}/rotate-secret`,
|
|
2113
2335
|
webhookSecretSchema,
|
|
2114
2336
|
webhookRotateInputSchema.parse(withActionId(input)),
|
|
2115
2337
|
options2
|
|
@@ -2157,8 +2379,8 @@ function managementClient(options) {
|
|
|
2157
2379
|
}
|
|
2158
2380
|
return exchange(
|
|
2159
2381
|
path,
|
|
2160
|
-
|
|
2161
|
-
status:
|
|
2382
|
+
z15.object({
|
|
2383
|
+
status: z15.number(),
|
|
2162
2384
|
operationId: identifier.optional(),
|
|
2163
2385
|
result: schema
|
|
2164
2386
|
}),
|
|
@@ -2189,7 +2411,7 @@ function managementClient(options) {
|
|
|
2189
2411
|
call
|
|
2190
2412
|
),
|
|
2191
2413
|
...resourceArchiveMethods("tracker"),
|
|
2192
|
-
list: (call) => get("/trackers",
|
|
2414
|
+
list: (call) => get("/trackers", z15.array(trackerStatusSchema), call),
|
|
2193
2415
|
get: (reference, call) => get(
|
|
2194
2416
|
`/trackers/${identifier.parse(reference)}`,
|
|
2195
2417
|
trackerStatusSchema,
|
|
@@ -2305,7 +2527,7 @@ function managementClient(options) {
|
|
|
2305
2527
|
engagementPublishSchema.parse(withActionId(input)),
|
|
2306
2528
|
call
|
|
2307
2529
|
),
|
|
2308
|
-
list: (call) => get("/engagement",
|
|
2530
|
+
list: (call) => get("/engagement", z15.array(engagementRuleSchema), call),
|
|
2309
2531
|
page: (input, call) => get(
|
|
2310
2532
|
"/engagement/history" + queryString(engagementPageQuerySchema.parse(input)),
|
|
2311
2533
|
engagementPageSchema,
|
|
@@ -2325,7 +2547,7 @@ function managementClient(options) {
|
|
|
2325
2547
|
)
|
|
2326
2548
|
},
|
|
2327
2549
|
badges: {
|
|
2328
|
-
list: (call) => get("/badges",
|
|
2550
|
+
list: (call) => get("/badges", z15.array(managedBadgeSchema), call),
|
|
2329
2551
|
create: (input, call) => create("/badges", managedBadgeSchema, createBadgeSchema, input, call),
|
|
2330
2552
|
update: (badge, input, call) => {
|
|
2331
2553
|
const body = badgePropertiesSchema.extend(badgeMutationSchema.shape).parse(withActionId(input));
|
|
@@ -2368,7 +2590,7 @@ function managementClient(options) {
|
|
|
2368
2590
|
},
|
|
2369
2591
|
pointLedgers: {
|
|
2370
2592
|
unarchive: (ledger, input, call) => archiveResource("point-ledger", ledger, false, input, call),
|
|
2371
|
-
list: (call) => get("/point-ledgers",
|
|
2593
|
+
list: (call) => get("/point-ledgers", z15.array(managedPointLedgerSchema), call),
|
|
2372
2594
|
/**
|
|
2373
2595
|
* Creates a point ledger, with a stable `key` when code refers to it; requires `publish`. In
|
|
2374
2596
|
* live, only a person in Console can create one.
|
|
@@ -2398,7 +2620,7 @@ function managementClient(options) {
|
|
|
2398
2620
|
},
|
|
2399
2621
|
points: {
|
|
2400
2622
|
/** @deprecated Use `pointLedgers.list()`, which reads the same ledgers. Removed in 2.0.0. */
|
|
2401
|
-
ledgers: (call) => get("/point-ledgers",
|
|
2623
|
+
ledgers: (call) => get("/point-ledgers", z15.array(managedPointLedgerSchema), call),
|
|
2402
2624
|
/** @deprecated Use `pointLedgers.create(input)`. Removed in 2.0.0. */
|
|
2403
2625
|
createLedger: createPointLedger,
|
|
2404
2626
|
/**
|
|
@@ -2436,7 +2658,7 @@ function managementClient(options) {
|
|
|
2436
2658
|
referralHistorySchema,
|
|
2437
2659
|
call
|
|
2438
2660
|
),
|
|
2439
|
-
list: (call) => get("/referrals",
|
|
2661
|
+
list: (call) => get("/referrals", z15.array(publishedReferralSchema), call),
|
|
2440
2662
|
participants: referralParticipants,
|
|
2441
2663
|
/**
|
|
2442
2664
|
* Suspends or restores a member's referral relationship, with a reason; requires `publish`.
|
|
@@ -2499,7 +2721,7 @@ function managementClient(options) {
|
|
|
2499
2721
|
},
|
|
2500
2722
|
leaderboards: {
|
|
2501
2723
|
...resourceArchiveMethods("leaderboard"),
|
|
2502
|
-
list: (call) => get("/leaderboards",
|
|
2724
|
+
list: (call) => get("/leaderboards", z15.array(publishedLeaderboardSchema), call),
|
|
2503
2725
|
standings: (board, input = {}, call) => {
|
|
2504
2726
|
const query = leaderboardQuerySchema.parse(input);
|
|
2505
2727
|
return get(
|
|
@@ -2513,13 +2735,13 @@ function managementClient(options) {
|
|
|
2513
2735
|
},
|
|
2514
2736
|
history: (board, call) => get(
|
|
2515
2737
|
`/leaderboards/${identifier.parse(board)}/history`,
|
|
2516
|
-
|
|
2738
|
+
z15.array(publishedLeaderboardSchema),
|
|
2517
2739
|
call
|
|
2518
2740
|
),
|
|
2519
2741
|
/** Current members of the board's exclusion group (`exclusionGroup`), by member ID. */
|
|
2520
2742
|
exclusions: (board, call) => get(
|
|
2521
2743
|
`/leaderboards/${identifier.parse(board)}/exclusions`,
|
|
2522
|
-
|
|
2744
|
+
z15.array(z15.object({ member: identifier })),
|
|
2523
2745
|
call
|
|
2524
2746
|
),
|
|
2525
2747
|
/**
|
|
@@ -2584,7 +2806,7 @@ function managementClient(options) {
|
|
|
2584
2806
|
),
|
|
2585
2807
|
settlements: (board, call) => get(
|
|
2586
2808
|
`/leaderboards/${identifier.parse(board)}/settlements`,
|
|
2587
|
-
|
|
2809
|
+
z15.array(leaderboardSettlementSummarySchema),
|
|
2588
2810
|
call
|
|
2589
2811
|
),
|
|
2590
2812
|
settlement: (settlement, call) => get(
|
|
@@ -2669,7 +2891,7 @@ function managementClient(options) {
|
|
|
2669
2891
|
*
|
|
2670
2892
|
* @deprecated Use `history`, which pages by `cursor` and `nextCursor`. Removed in 2.0.0.
|
|
2671
2893
|
*/
|
|
2672
|
-
list: (call) => get("/deployments",
|
|
2894
|
+
list: (call) => get("/deployments", z15.array(deploymentRecordSchema), call),
|
|
2673
2895
|
/**
|
|
2674
2896
|
* The project environment's deployments, newest first, one page at a time, with the two
|
|
2675
2897
|
* newest published deployments beside every page. Pass a page's `nextCursor` back as
|
|
@@ -2948,7 +3170,7 @@ function managementClient(options) {
|
|
|
2948
3170
|
},
|
|
2949
3171
|
operations: {
|
|
2950
3172
|
/** Every paused or resumed operation: redemptions and each quest's participation; requires `read`. */
|
|
2951
|
-
list: (call) => get("/operations",
|
|
3173
|
+
list: (call) => get("/operations", z15.array(operationSchema), call),
|
|
2952
3174
|
/**
|
|
2953
3175
|
* Pauses or resumes redemptions or one quest's participation, against the `revision` the
|
|
2954
3176
|
* operator saw, with a reason; requires `publish` permission.
|
|
@@ -3006,7 +3228,7 @@ function managementClient(options) {
|
|
|
3006
3228
|
call
|
|
3007
3229
|
),
|
|
3008
3230
|
/** Every stock item with its counts and the offers that sell it; requires `read` permission. */
|
|
3009
|
-
list: (call) => get("/stock-items",
|
|
3231
|
+
list: (call) => get("/stock-items", z15.array(managedStockItemSchema), call),
|
|
3010
3232
|
createItem: (input, call) => create(
|
|
3011
3233
|
"/stock-items",
|
|
3012
3234
|
stockItemSchema,
|
|
@@ -3021,7 +3243,7 @@ function managementClient(options) {
|
|
|
3021
3243
|
stockInputSchema.parse(withActionId(input)),
|
|
3022
3244
|
call
|
|
3023
3245
|
),
|
|
3024
|
-
catalog: (call) => get("/pickup-inventory",
|
|
3246
|
+
catalog: (call) => get("/pickup-inventory", z15.array(pickupCatalogSchema), call),
|
|
3025
3247
|
configure: (input, call) => post(
|
|
3026
3248
|
"/pickup-inventory",
|
|
3027
3249
|
pickupCatalogSchema,
|
|
@@ -3047,7 +3269,7 @@ function managementClient(options) {
|
|
|
3047
3269
|
offerControlSchema.omit({ enabled: true }).parse(withActionId(input)),
|
|
3048
3270
|
call
|
|
3049
3271
|
),
|
|
3050
|
-
list: (call) => get("/offers",
|
|
3272
|
+
list: (call) => get("/offers", z15.array(offerSchema), call),
|
|
3051
3273
|
/**
|
|
3052
3274
|
* Every redemption, or one member's, newest first, in one unbounded response.
|
|
3053
3275
|
*
|
|
@@ -3055,7 +3277,7 @@ function managementClient(options) {
|
|
|
3055
3277
|
*/
|
|
3056
3278
|
redemptions: (input = {}, call) => get(
|
|
3057
3279
|
`/redemptions${queryString({ member: input.member })}`,
|
|
3058
|
-
|
|
3280
|
+
z15.array(redemptionSchema),
|
|
3059
3281
|
call
|
|
3060
3282
|
),
|
|
3061
3283
|
/** Pauses or resumes an offer at the revision the operator saw. */
|
|
@@ -3104,7 +3326,7 @@ function managementClient(options) {
|
|
|
3104
3326
|
* them; API keys and project-scoped playground sessions cannot.
|
|
3105
3327
|
*/
|
|
3106
3328
|
tokens: {
|
|
3107
|
-
list: (call) => get("/tokens",
|
|
3329
|
+
list: (call) => get("/tokens", z15.array(tokenSchema), call),
|
|
3108
3330
|
/**
|
|
3109
3331
|
* Issues a key for one project and environment, limited to permissions the caller holds
|
|
3110
3332
|
* there. The secret `token` is in this response only.
|
|
@@ -3112,23 +3334,63 @@ function managementClient(options) {
|
|
|
3112
3334
|
create: (input, call) => post("/tokens", issuedTokenSchema, tokenInputSchema.parse(input), call),
|
|
3113
3335
|
/** Replace a personal key's ingestion restriction without changing its secret. */
|
|
3114
3336
|
scope: (id, input, call) => request(
|
|
3115
|
-
`/tokens/${encodeURIComponent(
|
|
3337
|
+
`/tokens/${encodeURIComponent(z15.string().min(1).parse(id))}/scope`,
|
|
3116
3338
|
tokenSchema,
|
|
3117
3339
|
tokenScopeInputSchema.parse(input),
|
|
3118
3340
|
"PUT",
|
|
3119
3341
|
call
|
|
3120
3342
|
),
|
|
3121
3343
|
revoke: (id, call) => request(
|
|
3122
|
-
`/tokens/${encodeURIComponent(
|
|
3344
|
+
`/tokens/${encodeURIComponent(z15.string().min(1).parse(id))}`,
|
|
3123
3345
|
ok,
|
|
3124
3346
|
void 0,
|
|
3125
3347
|
"DELETE",
|
|
3126
3348
|
call
|
|
3127
3349
|
)
|
|
3128
3350
|
},
|
|
3351
|
+
/**
|
|
3352
|
+
* Service keys (`dsk_`): credentials for an app's own backend in the selected project and
|
|
3353
|
+
* environment, owned by no person. Only an organization administrator in Console manages them.
|
|
3354
|
+
*/
|
|
3355
|
+
serviceKeys: {
|
|
3356
|
+
list: (call) => get("/service-keys", z15.array(serviceKeySchema), call),
|
|
3357
|
+
/** The secret `token` is in this response only. */
|
|
3358
|
+
create: (input, call) => post(
|
|
3359
|
+
"/service-keys",
|
|
3360
|
+
issuedServiceKeySchema,
|
|
3361
|
+
serviceKeyInputSchema.parse(input),
|
|
3362
|
+
call
|
|
3363
|
+
),
|
|
3364
|
+
/**
|
|
3365
|
+
* Rotation: issues another secret. The key's other secrets keep working until you revoke
|
|
3366
|
+
* them with `revokeSecret`. The new `token` is in this response only.
|
|
3367
|
+
*/
|
|
3368
|
+
addSecret: (id, input = {}, call) => post(
|
|
3369
|
+
`/service-keys/${z15.string().uuid().parse(id)}/secrets`,
|
|
3370
|
+
issuedServiceKeySchema,
|
|
3371
|
+
credentialSecretInputSchema.parse(input),
|
|
3372
|
+
call
|
|
3373
|
+
),
|
|
3374
|
+
/** Stops one secret working. A key's last secret cannot be revoked; revoke the key instead. */
|
|
3375
|
+
revokeSecret: (id, secret, call) => request(
|
|
3376
|
+
`/service-keys/${z15.string().uuid().parse(id)}/secrets/${z15.string().uuid().parse(secret)}`,
|
|
3377
|
+
serviceKeySchema,
|
|
3378
|
+
void 0,
|
|
3379
|
+
"DELETE",
|
|
3380
|
+
call
|
|
3381
|
+
),
|
|
3382
|
+
/** Deletes the key; every secret stops working. */
|
|
3383
|
+
revoke: (id, call) => request(
|
|
3384
|
+
`/service-keys/${z15.string().uuid().parse(id)}`,
|
|
3385
|
+
z15.null(),
|
|
3386
|
+
void 0,
|
|
3387
|
+
"DELETE",
|
|
3388
|
+
call
|
|
3389
|
+
)
|
|
3390
|
+
},
|
|
3129
3391
|
/** Who holds which roles on the client's project; organization administrators only. */
|
|
3130
3392
|
grants: {
|
|
3131
|
-
list: (call) => get("/grants",
|
|
3393
|
+
list: (call) => get("/grants", z15.array(grantRecordSchema), call),
|
|
3132
3394
|
/** Replaces one person's roles and environments on the project. The audit log records it. */
|
|
3133
3395
|
set: (input, call) => request(
|
|
3134
3396
|
"/grants",
|
|
@@ -3145,7 +3407,7 @@ function managementClient(options) {
|
|
|
3145
3407
|
/** Signed activity notifications for one project/environment; writes require publish permission. */
|
|
3146
3408
|
webhooks: {
|
|
3147
3409
|
state: (id, call) => get(
|
|
3148
|
-
`/webhooks/${
|
|
3410
|
+
`/webhooks/${z15.string().uuid().parse(id)}/state`,
|
|
3149
3411
|
webhookEndpointStateSchema,
|
|
3150
3412
|
call
|
|
3151
3413
|
),
|
|
@@ -3156,24 +3418,24 @@ function managementClient(options) {
|
|
|
3156
3418
|
call
|
|
3157
3419
|
),
|
|
3158
3420
|
delete: (id, input, call) => post(
|
|
3159
|
-
`/webhooks/${
|
|
3421
|
+
`/webhooks/${z15.string().uuid().parse(id)}/delete`,
|
|
3160
3422
|
webhookEndpointStateSchema,
|
|
3161
3423
|
webhookDeleteInputSchema.parse(withActionId(input)),
|
|
3162
3424
|
call
|
|
3163
3425
|
),
|
|
3164
3426
|
pause: (id, input = {}, call) => post(
|
|
3165
|
-
`/webhooks/${
|
|
3427
|
+
`/webhooks/${z15.string().uuid().parse(id)}/pause`,
|
|
3166
3428
|
webhookEndpointSchema,
|
|
3167
3429
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
3168
3430
|
call
|
|
3169
3431
|
),
|
|
3170
3432
|
resume: (id, input = {}, call) => post(
|
|
3171
|
-
`/webhooks/${
|
|
3433
|
+
`/webhooks/${z15.string().uuid().parse(id)}/resume`,
|
|
3172
3434
|
webhookEndpointSchema,
|
|
3173
3435
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
3174
3436
|
call
|
|
3175
3437
|
),
|
|
3176
|
-
list: (call) => get("/webhooks",
|
|
3438
|
+
list: (call) => get("/webhooks", z15.array(webhookEndpointSchema), call),
|
|
3177
3439
|
/** Pass an `actionId` to recover the endpoint and its secret after a lost answer. */
|
|
3178
3440
|
create: (input, call) => post(
|
|
3179
3441
|
"/webhooks",
|
|
@@ -3182,7 +3444,7 @@ function managementClient(options) {
|
|
|
3182
3444
|
call
|
|
3183
3445
|
),
|
|
3184
3446
|
update: (id, input, call) => request(
|
|
3185
|
-
`/webhooks/${
|
|
3447
|
+
`/webhooks/${z15.string().uuid().parse(id)}`,
|
|
3186
3448
|
webhookEndpointSchema,
|
|
3187
3449
|
webhookUpdateSchema.parse(input),
|
|
3188
3450
|
"PUT",
|
|
@@ -3190,19 +3452,19 @@ function managementClient(options) {
|
|
|
3190
3452
|
),
|
|
3191
3453
|
/** @deprecated Use pause. Removed in 2.0.0. */
|
|
3192
3454
|
disable: (id, call) => post(
|
|
3193
|
-
`/webhooks/${
|
|
3455
|
+
`/webhooks/${z15.string().uuid().parse(id)}/disable`,
|
|
3194
3456
|
webhookEndpointSchema,
|
|
3195
3457
|
{},
|
|
3196
3458
|
call
|
|
3197
3459
|
),
|
|
3198
3460
|
rotateSecret: rotateWebhookSecret,
|
|
3199
3461
|
deliveries: (id, query = {}, call) => get(
|
|
3200
|
-
`/webhooks/${
|
|
3462
|
+
`/webhooks/${z15.string().uuid().parse(id)}/deliveries${queryString(webhookQuerySchema.parse(query))}`,
|
|
3201
3463
|
webhookDeliveryPageSchema,
|
|
3202
3464
|
call
|
|
3203
3465
|
),
|
|
3204
3466
|
replay: (id, delivery, call) => post(
|
|
3205
|
-
`/webhooks/${
|
|
3467
|
+
`/webhooks/${z15.string().uuid().parse(id)}/deliveries/${z15.string().uuid().parse(delivery)}/replay`,
|
|
3206
3468
|
webhookDeliverySchema,
|
|
3207
3469
|
{},
|
|
3208
3470
|
call
|
|
@@ -3213,7 +3475,7 @@ function managementClient(options) {
|
|
|
3213
3475
|
* environment. Organization administrators, from a Console session only.
|
|
3214
3476
|
*/
|
|
3215
3477
|
identityIntegrations: {
|
|
3216
|
-
list: (call) => get("/identity-integrations",
|
|
3478
|
+
list: (call) => get("/identity-integrations", z15.array(identityIntegrationSchema), call),
|
|
3217
3479
|
/** The secret `token` is in this response only. */
|
|
3218
3480
|
create: (input, call) => post(
|
|
3219
3481
|
"/identity-integrations",
|
|
@@ -3221,13 +3483,47 @@ function managementClient(options) {
|
|
|
3221
3483
|
identityIntegrationInputSchema.parse(input),
|
|
3222
3484
|
call
|
|
3223
3485
|
),
|
|
3224
|
-
/**
|
|
3486
|
+
/**
|
|
3487
|
+
* Replaces every secret with one new secret that never expires; the old secrets stop working
|
|
3488
|
+
* at once.
|
|
3489
|
+
*
|
|
3490
|
+
* @deprecated Use `addSecret`, then `revokeSecret` the old secret once your app uses the new one.
|
|
3491
|
+
*/
|
|
3225
3492
|
rotate: (id, call) => post(
|
|
3226
|
-
`/identity-integrations/${
|
|
3493
|
+
`/identity-integrations/${z15.string().uuid().parse(id)}/rotate`,
|
|
3227
3494
|
identityIntegrationSecretSchema,
|
|
3228
3495
|
{},
|
|
3229
3496
|
call
|
|
3230
3497
|
),
|
|
3498
|
+
/**
|
|
3499
|
+
* Rotation: issues another secret. The integration's other secrets keep working until you
|
|
3500
|
+
* revoke them with `revokeSecret`. The new `token` is in this response only.
|
|
3501
|
+
*/
|
|
3502
|
+
addSecret: (id, input = {}, call) => post(
|
|
3503
|
+
`/identity-integrations/${z15.string().uuid().parse(id)}/secrets`,
|
|
3504
|
+
identityIntegrationSecretSchema,
|
|
3505
|
+
credentialSecretInputSchema.parse(input),
|
|
3506
|
+
call
|
|
3507
|
+
),
|
|
3508
|
+
/**
|
|
3509
|
+
* Stops one secret working; member sessions stay signed in. The last secret cannot be
|
|
3510
|
+
* revoked; disconnect the integration with `revoke` instead.
|
|
3511
|
+
*/
|
|
3512
|
+
revokeSecret: (id, secret, call) => request(
|
|
3513
|
+
`/identity-integrations/${z15.string().uuid().parse(id)}/secrets/${z15.string().uuid().parse(secret)}`,
|
|
3514
|
+
identityIntegrationSchema,
|
|
3515
|
+
void 0,
|
|
3516
|
+
"DELETE",
|
|
3517
|
+
call
|
|
3518
|
+
),
|
|
3519
|
+
/** Makes one secret never expire. */
|
|
3520
|
+
removeSecretExpiry: (id, secret, call) => request(
|
|
3521
|
+
`/identity-integrations/${z15.string().uuid().parse(id)}/secrets/${z15.string().uuid().parse(secret)}/expiry`,
|
|
3522
|
+
identityIntegrationSchema,
|
|
3523
|
+
void 0,
|
|
3524
|
+
"DELETE",
|
|
3525
|
+
call
|
|
3526
|
+
),
|
|
3231
3527
|
/**
|
|
3232
3528
|
* The `app:<name>` kinds claimed in the project and environment, each with the integration
|
|
3233
3529
|
* that owns its identities, connected or not, and how many it has. A new integration reusing
|
|
@@ -3235,7 +3531,7 @@ function managementClient(options) {
|
|
|
3235
3531
|
*/
|
|
3236
3532
|
kinds: (call) => get(
|
|
3237
3533
|
"/identity-integrations/kinds",
|
|
3238
|
-
|
|
3534
|
+
z15.array(identityKindClaimSchema),
|
|
3239
3535
|
call
|
|
3240
3536
|
),
|
|
3241
3537
|
/**
|
|
@@ -3243,8 +3539,8 @@ function managementClient(options) {
|
|
|
3243
3539
|
* and keep attributing tracker records; unlink them on the member to stop that.
|
|
3244
3540
|
*/
|
|
3245
3541
|
revoke: (id, call) => request(
|
|
3246
|
-
`/identity-integrations/${
|
|
3247
|
-
|
|
3542
|
+
`/identity-integrations/${z15.string().uuid().parse(id)}`,
|
|
3543
|
+
z15.null(),
|
|
3248
3544
|
void 0,
|
|
3249
3545
|
"DELETE",
|
|
3250
3546
|
call
|
|
@@ -3295,7 +3591,7 @@ function managementClient(options) {
|
|
|
3295
3591
|
resources: {
|
|
3296
3592
|
list: (call) => get(
|
|
3297
3593
|
"/resources",
|
|
3298
|
-
|
|
3594
|
+
z15.object({ resources: z15.array(managedResourceSchema) }),
|
|
3299
3595
|
call
|
|
3300
3596
|
),
|
|
3301
3597
|
/** @deprecated Use the resource archive/unarchive methods. Removed in 2.0.0. */
|
|
@@ -3365,7 +3661,7 @@ function managementClient(options) {
|
|
|
3365
3661
|
testMemberCreateSchema.parse(withActionId(input)),
|
|
3366
3662
|
call
|
|
3367
3663
|
),
|
|
3368
|
-
list: (call) => get("/test-members",
|
|
3664
|
+
list: (call) => get("/test-members", z15.array(testMemberSchema), call),
|
|
3369
3665
|
history: (member, query = {}, call) => get(
|
|
3370
3666
|
`/test-members/${identifier.parse(member)}/history${queryString(testMemberHistoryQuerySchema.parse(query))}`,
|
|
3371
3667
|
testMemberHistorySchema,
|
|
@@ -3408,6 +3704,68 @@ function managementClient(options) {
|
|
|
3408
3704
|
call
|
|
3409
3705
|
)
|
|
3410
3706
|
},
|
|
3707
|
+
/**
|
|
3708
|
+
* Imports of members, opening point balances and quest progress from another platform into
|
|
3709
|
+
* this project and environment. Add rows, `check` them (the dry run), read the summary and the
|
|
3710
|
+
* refused rows, then `apply`. Checking and applying run in the background: read the import
|
|
3711
|
+
* until its status is `checked` or `applied`. Needs `publish` permission. In live, only a
|
|
3712
|
+
* person signed in to Console applies an import; keys and CLI sessions prepare and check it.
|
|
3713
|
+
*/
|
|
3714
|
+
memberImports: {
|
|
3715
|
+
create: (input, call) => post(
|
|
3716
|
+
"/member-imports",
|
|
3717
|
+
memberImportSchema,
|
|
3718
|
+
memberImportCreateSchema.parse(withActionId(input)),
|
|
3719
|
+
call
|
|
3720
|
+
),
|
|
3721
|
+
list: (query = {}, call) => get(
|
|
3722
|
+
`/member-imports${queryString(memberImportListQuerySchema.parse(query))}`,
|
|
3723
|
+
memberImportPageSchema,
|
|
3724
|
+
call
|
|
3725
|
+
),
|
|
3726
|
+
get: (id, call) => get(
|
|
3727
|
+
`/member-imports/${identifier.parse(id)}`,
|
|
3728
|
+
memberImportSchema,
|
|
3729
|
+
call
|
|
3730
|
+
),
|
|
3731
|
+
/** The import's rows in file order, each with its latest check or apply outcome. */
|
|
3732
|
+
rows: (id, query = {}, call) => get(
|
|
3733
|
+
`/member-imports/${identifier.parse(id)}/rows${queryString(memberImportRowQuerySchema.parse(query))}`,
|
|
3734
|
+
memberImportRowPageSchema,
|
|
3735
|
+
call
|
|
3736
|
+
),
|
|
3737
|
+
/**
|
|
3738
|
+
* Adds up to 500 rows. A row replaces the import's row with the same `ref`, so sending a
|
|
3739
|
+
* batch again changes nothing; a changed row sends a checked import back to `open`.
|
|
3740
|
+
*/
|
|
3741
|
+
addRows: (id, rows, call) => post(
|
|
3742
|
+
`/member-imports/${identifier.parse(id)}/rows`,
|
|
3743
|
+
memberImportSchema,
|
|
3744
|
+
memberImportRowsInputSchema.parse({ rows }),
|
|
3745
|
+
call
|
|
3746
|
+
),
|
|
3747
|
+
/** Starts the dry run: every row is checked against the project, and nothing changes. */
|
|
3748
|
+
check: (id, call) => post(
|
|
3749
|
+
`/member-imports/${identifier.parse(id)}/check`,
|
|
3750
|
+
memberImportSchema,
|
|
3751
|
+
{},
|
|
3752
|
+
call
|
|
3753
|
+
),
|
|
3754
|
+
/** Applies a checked import's ready rows. Live imports are applied from Console. */
|
|
3755
|
+
apply: (id, call) => post(
|
|
3756
|
+
`/member-imports/${identifier.parse(id)}/apply`,
|
|
3757
|
+
memberImportSchema,
|
|
3758
|
+
{},
|
|
3759
|
+
call
|
|
3760
|
+
),
|
|
3761
|
+
/** Cancels an open or checked import; nothing it checked is applied. */
|
|
3762
|
+
cancel: (id, call) => post(
|
|
3763
|
+
`/member-imports/${identifier.parse(id)}/cancel`,
|
|
3764
|
+
memberImportSchema,
|
|
3765
|
+
{},
|
|
3766
|
+
call
|
|
3767
|
+
)
|
|
3768
|
+
},
|
|
3411
3769
|
/** The project's members, as operators see them. */
|
|
3412
3770
|
members: {
|
|
3413
3771
|
/**
|
|
@@ -3521,7 +3879,7 @@ function managementClient(options) {
|
|
|
3521
3879
|
/** Who each member is: up to 100 distinct IDs; unknown IDs come back without accounts. */
|
|
3522
3880
|
people: (members, call) => get(
|
|
3523
3881
|
`/people${queryString({ ids: members.join(",") })}`,
|
|
3524
|
-
|
|
3882
|
+
z15.array(personSchema),
|
|
3525
3883
|
call
|
|
3526
3884
|
),
|
|
3527
3885
|
/**
|
|
@@ -3531,7 +3889,7 @@ function managementClient(options) {
|
|
|
3531
3889
|
*/
|
|
3532
3890
|
oauthAccounts: (member, call) => get(
|
|
3533
3891
|
`/members/${encodeURIComponent(member)}/oauth-accounts`,
|
|
3534
|
-
|
|
3892
|
+
z15.array(managedOAuthAccountSchema),
|
|
3535
3893
|
call
|
|
3536
3894
|
),
|
|
3537
3895
|
/**
|
|
@@ -3541,7 +3899,7 @@ function managementClient(options) {
|
|
|
3541
3899
|
*/
|
|
3542
3900
|
unlinkOAuthAccount: (member, input, call) => post(
|
|
3543
3901
|
`/members/${encodeURIComponent(member)}/oauth-accounts/unlink`,
|
|
3544
|
-
|
|
3902
|
+
z15.array(managedOAuthAccountSchema),
|
|
3545
3903
|
memberOAuthUnlinkInputSchema.parse(input),
|
|
3546
3904
|
call
|
|
3547
3905
|
),
|
|
@@ -3574,7 +3932,7 @@ function managementClient(options) {
|
|
|
3574
3932
|
*/
|
|
3575
3933
|
unlinkWallet: (member, input, call) => post(
|
|
3576
3934
|
`/members/${encodeURIComponent(member)}/wallets/unlink`,
|
|
3577
|
-
|
|
3935
|
+
z15.array(managedWalletSchema),
|
|
3578
3936
|
memberWalletUnlinkInputSchema.parse(input),
|
|
3579
3937
|
call
|
|
3580
3938
|
),
|
|
@@ -3587,7 +3945,7 @@ function managementClient(options) {
|
|
|
3587
3945
|
*/
|
|
3588
3946
|
unlinkIdentity: (member, input, call) => post(
|
|
3589
3947
|
`/members/${encodeURIComponent(member)}/identities/unlink`,
|
|
3590
|
-
|
|
3948
|
+
z15.array(managedMemberIdentitySchema),
|
|
3591
3949
|
memberIdentityChangeInputSchema.parse(input),
|
|
3592
3950
|
call
|
|
3593
3951
|
),
|
|
@@ -3598,7 +3956,7 @@ function managementClient(options) {
|
|
|
3598
3956
|
*/
|
|
3599
3957
|
relinkIdentity: (member, input, call) => post(
|
|
3600
3958
|
`/members/${encodeURIComponent(member)}/identities/relink`,
|
|
3601
|
-
|
|
3959
|
+
z15.array(managedMemberIdentitySchema),
|
|
3602
3960
|
memberIdentityChangeInputSchema.parse(input),
|
|
3603
3961
|
call
|
|
3604
3962
|
),
|
|
@@ -3610,7 +3968,7 @@ function managementClient(options) {
|
|
|
3610
3968
|
*/
|
|
3611
3969
|
setWalletSignIn: (member, input, call) => post(
|
|
3612
3970
|
`/members/${encodeURIComponent(member)}/wallets/sign-in`,
|
|
3613
|
-
|
|
3971
|
+
z15.array(managedWalletSchema),
|
|
3614
3972
|
memberWalletSignInInputSchema.parse(input),
|
|
3615
3973
|
call
|
|
3616
3974
|
)
|
|
@@ -3782,7 +4140,7 @@ function managementClient(options) {
|
|
|
3782
4140
|
* Each quest's current release, the most recently published first, archived quests
|
|
3783
4141
|
* included; requires `read` permission.
|
|
3784
4142
|
*/
|
|
3785
|
-
list: (call) => get("/quests/list",
|
|
4143
|
+
list: (call) => get("/quests/list", z15.array(publishedReleaseSchema), call),
|
|
3786
4144
|
/** Pending and exhausted asynchronous balance checks. Requires read. */
|
|
3787
4145
|
automaticScheduling: (query = {}, call) => get(
|
|
3788
4146
|
`/quests/automatic-scheduling${queryString(automaticSchedulingQuerySchema.parse(query))}`,
|
|
@@ -3827,7 +4185,7 @@ function managementClient(options) {
|
|
|
3827
4185
|
*/
|
|
3828
4186
|
submissions: (member, call) => get(
|
|
3829
4187
|
`/members/${encodeURIComponent(member)}/quest-submissions`,
|
|
3830
|
-
|
|
4188
|
+
z15.object({ items: z15.array(questSubmissionSchema) }),
|
|
3831
4189
|
call
|
|
3832
4190
|
),
|
|
3833
4191
|
/**
|
|
@@ -4131,6 +4489,12 @@ var managementResponseSchemas = lazyResponseReaders({
|
|
|
4131
4489
|
get issuedTokenSchema() {
|
|
4132
4490
|
return knownResponse(issuedTokenSchema);
|
|
4133
4491
|
},
|
|
4492
|
+
get serviceKeySchema() {
|
|
4493
|
+
return knownResponse(serviceKeySchema);
|
|
4494
|
+
},
|
|
4495
|
+
get issuedServiceKeySchema() {
|
|
4496
|
+
return knownResponse(issuedServiceKeySchema);
|
|
4497
|
+
},
|
|
4134
4498
|
get leaderboardPageSchema() {
|
|
4135
4499
|
return knownResponse(leaderboardPageSchema);
|
|
4136
4500
|
},
|
|
@@ -4167,6 +4531,15 @@ var managementResponseSchemas = lazyResponseReaders({
|
|
|
4167
4531
|
get managedMemberProgressSchema() {
|
|
4168
4532
|
return knownResponse(managedMemberProgressSchema);
|
|
4169
4533
|
},
|
|
4534
|
+
get memberImportPageSchema() {
|
|
4535
|
+
return knownResponse(memberImportPageSchema);
|
|
4536
|
+
},
|
|
4537
|
+
get memberImportRowPageSchema() {
|
|
4538
|
+
return knownResponse(memberImportRowPageSchema);
|
|
4539
|
+
},
|
|
4540
|
+
get memberImportSchema() {
|
|
4541
|
+
return knownResponse(memberImportSchema);
|
|
4542
|
+
},
|
|
4170
4543
|
get managedOAuthAccountSchema() {
|
|
4171
4544
|
return knownResponse(managedOAuthAccountSchema);
|
|
4172
4545
|
},
|
|
@@ -4440,6 +4813,8 @@ var managementResponses = {
|
|
|
4440
4813
|
),
|
|
4441
4814
|
identityKindClaimSchema: responseSchema(identityKindClaimSchema),
|
|
4442
4815
|
issuedTokenSchema: responseSchema(issuedTokenSchema),
|
|
4816
|
+
serviceKeySchema: responseSchema(serviceKeySchema),
|
|
4817
|
+
issuedServiceKeySchema: responseSchema(issuedServiceKeySchema),
|
|
4443
4818
|
leaderboardPageSchema: responseSchema(leaderboardPageSchema),
|
|
4444
4819
|
leaderboardSettlementSchema: responseSchema(leaderboardSettlementSchema),
|
|
4445
4820
|
leaderboardSettlementSummarySchema: responseSchema(
|
|
@@ -4454,6 +4829,9 @@ var managementResponses = {
|
|
|
4454
4829
|
managedMemberIdentitySchema: responseSchema(managedMemberIdentitySchema),
|
|
4455
4830
|
managedMemberPageSchema: responseSchema(managedMemberPageSchema),
|
|
4456
4831
|
managedMemberProgressSchema: responseSchema(managedMemberProgressSchema),
|
|
4832
|
+
memberImportPageSchema: responseSchema(memberImportPageSchema),
|
|
4833
|
+
memberImportRowPageSchema: responseSchema(memberImportRowPageSchema),
|
|
4834
|
+
memberImportSchema: responseSchema(memberImportSchema),
|
|
4457
4835
|
managedOAuthAccountSchema: responseSchema(managedOAuthAccountSchema),
|
|
4458
4836
|
managedTelegramAccountSchema: responseSchema(managedTelegramAccountSchema),
|
|
4459
4837
|
telegramChatsSchema: responseSchema(telegramChatsSchema),
|
|
@@ -4538,6 +4916,7 @@ export {
|
|
|
4538
4916
|
DEFAULT_MANAGEMENT_TIMEOUT,
|
|
4539
4917
|
ManagementError,
|
|
4540
4918
|
ManagementErrorCode,
|
|
4919
|
+
MemberImportRefusalCode,
|
|
4541
4920
|
PayoutSourceKind,
|
|
4542
4921
|
REFERRAL_INTEGRATION_REWARD_ERROR,
|
|
4543
4922
|
RevokedDeliveryOutcome,
|
|
@@ -4596,6 +4975,8 @@ export {
|
|
|
4596
4975
|
createGroupSchema,
|
|
4597
4976
|
createManagementClient,
|
|
4598
4977
|
createRepositorySchema,
|
|
4978
|
+
credentialSecretInputSchema,
|
|
4979
|
+
credentialSecretSchema,
|
|
4599
4980
|
deploymentActionSchema,
|
|
4600
4981
|
deploymentRejectionSchema,
|
|
4601
4982
|
developmentPreflightSchema,
|
|
@@ -4636,6 +5017,7 @@ export {
|
|
|
4636
5017
|
isIntegrationParticipantPath,
|
|
4637
5018
|
isManagementError,
|
|
4638
5019
|
isParticipantRoute,
|
|
5020
|
+
issuedServiceKeySchema,
|
|
4639
5021
|
issuedTokenSchema,
|
|
4640
5022
|
leaderboardSettlementRejectionSchema,
|
|
4641
5023
|
leaderboardSettlementReviewPageSchema,
|
|
@@ -4678,6 +5060,20 @@ export {
|
|
|
4678
5060
|
memberIdentitySignInInputSchema,
|
|
4679
5061
|
memberIdentityStatePageSchema,
|
|
4680
5062
|
memberIdentityStateSchema,
|
|
5063
|
+
memberImportAccountSchema,
|
|
5064
|
+
memberImportActionSchema,
|
|
5065
|
+
memberImportCreateSchema,
|
|
5066
|
+
memberImportIdentitySchema,
|
|
5067
|
+
memberImportListQuerySchema,
|
|
5068
|
+
memberImportPageSchema,
|
|
5069
|
+
memberImportRefusalSchema,
|
|
5070
|
+
memberImportRowPageSchema,
|
|
5071
|
+
memberImportRowQuerySchema,
|
|
5072
|
+
memberImportRowResultSchema,
|
|
5073
|
+
memberImportRowSchema,
|
|
5074
|
+
memberImportRowsInputSchema,
|
|
5075
|
+
memberImportSchema,
|
|
5076
|
+
memberImportSummarySchema,
|
|
4681
5077
|
memberLookupSchema,
|
|
4682
5078
|
memberOAuthUnlinkInputSchema,
|
|
4683
5079
|
memberSchema,
|
|
@@ -4732,6 +5128,8 @@ export {
|
|
|
4732
5128
|
roleSchema,
|
|
4733
5129
|
scheduledInvocationSchema,
|
|
4734
5130
|
sequenceCursorSchema,
|
|
5131
|
+
serviceKeyInputSchema,
|
|
5132
|
+
serviceKeySchema,
|
|
4735
5133
|
sourceDataSchema,
|
|
4736
5134
|
sourceRoles,
|
|
4737
5135
|
stageRequestSchema,
|