@domino-sdk/relay 1.32.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-HSH7OBUX.js → chunk-E5OYFYO3.js} +3 -3
- package/dist/{chunk-CUT62B37.js → chunk-KWNSYWVH.js} +1 -1
- package/dist/{chunk-5QZGXYH7.js → chunk-ON7RDKQ3.js} +13 -2
- package/dist/{chunk-BSOXLXQO.js → chunk-PM3265GG.js} +1 -1
- package/dist/{chunk-CCUJ4UJG.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 +923 -642
- 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-VyYo2pIQ.d.ts → transport-DVdbwmrB.d.ts} +1381 -364
- 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,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
participantExchangeSchema,
|
|
49
49
|
questConfiguration,
|
|
50
50
|
sequenceCursorSchema
|
|
51
|
-
} from "../chunk-
|
|
51
|
+
} from "../chunk-PM3265GG.js";
|
|
52
52
|
import {
|
|
53
53
|
parseImageExtraction,
|
|
54
54
|
parseImageResult
|
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
rewardDeliveryQuerySchema,
|
|
91
91
|
rewardDeliverySchema,
|
|
92
92
|
saveQuestDraftSchema
|
|
93
|
-
} from "../chunk-
|
|
93
|
+
} from "../chunk-BDWZ2BZP.js";
|
|
94
94
|
import {
|
|
95
95
|
badgeMutationResultSchema,
|
|
96
96
|
badgeMutationSchema,
|
|
@@ -144,14 +144,14 @@ import {
|
|
|
144
144
|
referralQualificationSchema,
|
|
145
145
|
referralRewardResolutionSchema,
|
|
146
146
|
referralSuspensionSchema
|
|
147
|
-
} from "../chunk-
|
|
147
|
+
} from "../chunk-ON7RDKQ3.js";
|
|
148
148
|
import {
|
|
149
149
|
telegramChatConnectionSchema,
|
|
150
150
|
telegramChatIdSchema,
|
|
151
151
|
telegramChatsSchema
|
|
152
152
|
} from "../chunk-BUHGXKPY.js";
|
|
153
153
|
import "../chunk-V7K7XXFB.js";
|
|
154
|
-
import "../chunk-
|
|
154
|
+
import "../chunk-YPI5SGXB.js";
|
|
155
155
|
import "../chunk-466IRAJP.js";
|
|
156
156
|
import {
|
|
157
157
|
CompletionSourceKind,
|
|
@@ -517,90 +517,267 @@ var testMemberHistorySchema = z6.object({
|
|
|
517
517
|
complete: z6.boolean()
|
|
518
518
|
});
|
|
519
519
|
|
|
520
|
-
// src/server/
|
|
520
|
+
// src/server/member-imports.ts
|
|
521
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";
|
|
522
699
|
var PayoutSourceKind = {
|
|
523
700
|
Quest: "quest",
|
|
524
701
|
Leaderboard: "leaderboard",
|
|
525
702
|
Engagement: "engagement",
|
|
526
703
|
Manual: "manual"
|
|
527
704
|
};
|
|
528
|
-
var webhookEventSchema =
|
|
529
|
-
id:
|
|
530
|
-
version:
|
|
705
|
+
var webhookEventSchema = z8.object({
|
|
706
|
+
id: z8.string().uuid(),
|
|
707
|
+
version: z8.literal(1),
|
|
531
708
|
type: activityTypeSchema,
|
|
532
|
-
createdAt:
|
|
533
|
-
organization:
|
|
534
|
-
project:
|
|
535
|
-
environment:
|
|
536
|
-
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())
|
|
537
714
|
});
|
|
538
|
-
var webhookControlInputSchema =
|
|
539
|
-
var webhookInputSchema =
|
|
540
|
-
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) => {
|
|
541
718
|
const url2 = new URL(value);
|
|
542
719
|
return url2.protocol === "https:" && !url2.username && !url2.password && !url2.hash;
|
|
543
720
|
}, "Use an HTTPS URL without credentials or a fragment"),
|
|
544
|
-
types:
|
|
721
|
+
types: z8.array(activityTypeSchema).min(1).max(100).refine((v) => new Set(v).size === v.length)
|
|
545
722
|
}).strict();
|
|
546
|
-
var webhookCreateInputSchema = webhookInputSchema.extend({ actionId:
|
|
547
|
-
var webhookRotateInputSchema =
|
|
548
|
-
var webhookUpdateSchema = webhookInputSchema.partial().extend({ enabled:
|
|
549
|
-
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({
|
|
550
727
|
...webhookInputSchema.shape,
|
|
551
|
-
id:
|
|
552
|
-
enabled:
|
|
553
|
-
disabledReason:
|
|
554
|
-
consecutiveFailures:
|
|
555
|
-
createdAt:
|
|
556
|
-
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()
|
|
557
734
|
});
|
|
558
735
|
var webhookEndpointStateSchema = webhookEndpointSchema.extend({
|
|
559
|
-
revision:
|
|
560
|
-
deletedAt:
|
|
736
|
+
revision: z8.number().int().nonnegative(),
|
|
737
|
+
deletedAt: z8.number().int().safe().nonnegative().nullable()
|
|
561
738
|
});
|
|
562
|
-
var webhookDeleteInputSchema =
|
|
563
|
-
actionId:
|
|
564
|
-
expectedRevision:
|
|
565
|
-
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)
|
|
566
743
|
});
|
|
567
|
-
var webhookStateQuerySchema =
|
|
744
|
+
var webhookStateQuerySchema = z8.strictObject({
|
|
568
745
|
cursor: pageCursorSchema.optional(),
|
|
569
|
-
limit:
|
|
746
|
+
limit: z8.coerce.number().int().min(1).max(100).default(50)
|
|
570
747
|
});
|
|
571
|
-
var webhookStatePageSchema =
|
|
572
|
-
items:
|
|
748
|
+
var webhookStatePageSchema = z8.object({
|
|
749
|
+
items: z8.array(webhookEndpointStateSchema),
|
|
573
750
|
nextCursor: pageCursorSchema.nullable()
|
|
574
751
|
});
|
|
575
|
-
var webhookSecretSchema =
|
|
752
|
+
var webhookSecretSchema = z8.object({
|
|
576
753
|
endpoint: webhookEndpointSchema,
|
|
577
|
-
secret:
|
|
578
|
-
previousValidUntil:
|
|
754
|
+
secret: z8.string(),
|
|
755
|
+
previousValidUntil: z8.number().nullable()
|
|
579
756
|
});
|
|
580
|
-
var webhookDeliverySchema =
|
|
581
|
-
id:
|
|
582
|
-
endpoint:
|
|
757
|
+
var webhookDeliverySchema = z8.object({
|
|
758
|
+
id: z8.string().uuid(),
|
|
759
|
+
endpoint: z8.string().uuid(),
|
|
583
760
|
event: webhookEventSchema,
|
|
584
|
-
status:
|
|
585
|
-
attempts:
|
|
586
|
-
responseStatus:
|
|
587
|
-
lastError:
|
|
588
|
-
createdAt:
|
|
589
|
-
deliveredAt:
|
|
590
|
-
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()
|
|
591
768
|
});
|
|
592
|
-
var webhookQuerySchema =
|
|
769
|
+
var webhookQuerySchema = z8.object({
|
|
593
770
|
/** A page's `nextCursor`: the deliveries after it, newest first. */
|
|
594
771
|
cursor: pageCursorSchema.optional(),
|
|
595
772
|
/** @deprecated Use `cursor`. Removed in 2.0.0. */
|
|
596
|
-
before:
|
|
597
|
-
limit:
|
|
773
|
+
before: z8.string().uuid().optional(),
|
|
774
|
+
limit: z8.coerce.number().int().min(1).max(100).default(50)
|
|
598
775
|
}).strict();
|
|
599
|
-
var webhookDeliveryPageSchema =
|
|
600
|
-
items:
|
|
776
|
+
var webhookDeliveryPageSchema = z8.object({
|
|
777
|
+
items: z8.array(webhookDeliverySchema),
|
|
601
778
|
nextCursor: pageCursorSchema.nullable().default(null),
|
|
602
779
|
/** @deprecated Use `nextCursor`, passed back as `cursor`. Removed in 2.0.0. */
|
|
603
|
-
next:
|
|
780
|
+
next: z8.string().uuid().nullable()
|
|
604
781
|
});
|
|
605
782
|
var WEBHOOK_MAX_BYTES = 64 * 1024;
|
|
606
783
|
async function verifyWebhook(input) {
|
|
@@ -644,8 +821,8 @@ async function verifyWebhook(input) {
|
|
|
644
821
|
}
|
|
645
822
|
|
|
646
823
|
// src/server/resource-lifecycle.ts
|
|
647
|
-
import * as
|
|
648
|
-
var resourceLifecycleKindSchema =
|
|
824
|
+
import * as z9 from "zod";
|
|
825
|
+
var resourceLifecycleKindSchema = z9.enum([
|
|
649
826
|
"tracker",
|
|
650
827
|
"referral",
|
|
651
828
|
"leaderboard",
|
|
@@ -655,24 +832,24 @@ var resourceLifecycleKindSchema = z8.enum([
|
|
|
655
832
|
"image",
|
|
656
833
|
"point-ledger"
|
|
657
834
|
]);
|
|
658
|
-
var managedResourceSchema =
|
|
835
|
+
var managedResourceSchema = z9.object({
|
|
659
836
|
kind: resourceLifecycleKindSchema,
|
|
660
837
|
id: identifier,
|
|
661
838
|
key: identifier.nullable(),
|
|
662
|
-
title:
|
|
663
|
-
archivedAt:
|
|
839
|
+
title: z9.string(),
|
|
840
|
+
archivedAt: z9.number().int().nonnegative().nullable()
|
|
664
841
|
});
|
|
665
|
-
var resourceLifecycleInputSchema =
|
|
666
|
-
actionId:
|
|
842
|
+
var resourceLifecycleInputSchema = z9.object({
|
|
843
|
+
actionId: z9.string().uuid(),
|
|
667
844
|
kind: resourceLifecycleKindSchema,
|
|
668
845
|
resource: identifier,
|
|
669
|
-
archived:
|
|
670
|
-
reason:
|
|
671
|
-
expectedArchivedAt:
|
|
846
|
+
archived: z9.boolean(),
|
|
847
|
+
reason: z9.string().trim().min(1).max(500),
|
|
848
|
+
expectedArchivedAt: z9.number().int().nonnegative().nullable().optional()
|
|
672
849
|
}).strict();
|
|
673
|
-
var resourceLifecycleResultSchema =
|
|
850
|
+
var resourceLifecycleResultSchema = z9.object({
|
|
674
851
|
resource: managedResourceSchema,
|
|
675
|
-
changed:
|
|
852
|
+
changed: z9.boolean()
|
|
676
853
|
});
|
|
677
854
|
var resourceLifecyclePaths = {
|
|
678
855
|
tracker: "/trackers",
|
|
@@ -691,19 +868,19 @@ var resourceArchiveInputSchema = resourceLifecycleInputSchema.omit({
|
|
|
691
868
|
});
|
|
692
869
|
|
|
693
870
|
// src/server/index.ts
|
|
694
|
-
import * as
|
|
871
|
+
import * as z15 from "zod";
|
|
695
872
|
|
|
696
873
|
// src/server/hosting.ts
|
|
697
|
-
import * as
|
|
874
|
+
import * as z12 from "zod";
|
|
698
875
|
|
|
699
876
|
// src/server/schedules.ts
|
|
700
|
-
import * as
|
|
877
|
+
import * as z10 from "zod";
|
|
701
878
|
import { Cron } from "croner";
|
|
702
879
|
var APP_SCHEDULE_LIMIT = 10;
|
|
703
880
|
var APP_SCHEDULE_MIN_INTERVAL = 3e5;
|
|
704
881
|
var APP_SCHEDULE_TIMEOUT = 3e4;
|
|
705
|
-
var appScheduleNameSchema =
|
|
706
|
-
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) => {
|
|
707
884
|
if (!/^\/[a-zA-Z0-9_/-]+$/.test(path) || path.startsWith("//")) {
|
|
708
885
|
return false;
|
|
709
886
|
}
|
|
@@ -714,11 +891,11 @@ function interval(value) {
|
|
|
714
891
|
const unit = value.slice(-1);
|
|
715
892
|
return amount * (unit === "m" ? 6e4 : unit === "h" ? 36e5 : 864e5);
|
|
716
893
|
}
|
|
717
|
-
var everySchema =
|
|
894
|
+
var everySchema = z10.string().regex(/^[1-9]\d{0,3}[mhd]$/).refine(
|
|
718
895
|
(value) => interval(value) >= APP_SCHEDULE_MIN_INTERVAL && interval(value) <= 365 * 864e5,
|
|
719
896
|
"Use an interval from 5 minutes to 365 days, such as 5m, 1h or 1d"
|
|
720
897
|
);
|
|
721
|
-
var cronSchema =
|
|
898
|
+
var cronSchema = z10.string().max(120).refine((value) => {
|
|
722
899
|
const fields = value.trim().split(/\s+/);
|
|
723
900
|
if (fields.length !== 5 || fields.some((field) => !/^[\d*,/-]+$/.test(field))) {
|
|
724
901
|
return false;
|
|
@@ -743,15 +920,15 @@ var cronSchema = z9.string().max(120).refine((value) => {
|
|
|
743
920
|
var declaration = {
|
|
744
921
|
name: appScheduleNameSchema,
|
|
745
922
|
path: appSchedulePathSchema,
|
|
746
|
-
description:
|
|
923
|
+
description: z10.string().min(1).max(500)
|
|
747
924
|
};
|
|
748
|
-
var everySchedule =
|
|
749
|
-
var cronSchedule =
|
|
750
|
-
var appScheduleSchema =
|
|
925
|
+
var everySchedule = z10.object({ ...declaration, every: everySchema });
|
|
926
|
+
var cronSchedule = z10.object({ ...declaration, cron: cronSchema });
|
|
927
|
+
var appScheduleSchema = z10.union([
|
|
751
928
|
everySchedule.strict(),
|
|
752
929
|
cronSchedule.strict()
|
|
753
930
|
]);
|
|
754
|
-
var appSchedulesSchema =
|
|
931
|
+
var appSchedulesSchema = z10.array(appScheduleSchema).max(APP_SCHEDULE_LIMIT).refine(
|
|
755
932
|
(items) => new Set(items.map((item) => item.name)).size === items.length,
|
|
756
933
|
"Schedule names must be unique"
|
|
757
934
|
);
|
|
@@ -768,35 +945,35 @@ function nextScheduleRun(schedule, after) {
|
|
|
768
945
|
}
|
|
769
946
|
return next.getTime();
|
|
770
947
|
}
|
|
771
|
-
var appScheduleStateSchema =
|
|
772
|
-
var appScheduleRunSchema =
|
|
773
|
-
id:
|
|
774
|
-
build:
|
|
775
|
-
startedAt:
|
|
776
|
-
scheduledAt:
|
|
777
|
-
manual:
|
|
778
|
-
status:
|
|
779
|
-
duration:
|
|
780
|
-
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()
|
|
781
958
|
});
|
|
782
|
-
var appScheduleListSchema =
|
|
959
|
+
var appScheduleListSchema = z10.object({
|
|
783
960
|
state: appScheduleStateSchema,
|
|
784
|
-
schedules:
|
|
785
|
-
|
|
786
|
-
declaration:
|
|
787
|
-
nextRun:
|
|
788
|
-
blocked:
|
|
961
|
+
schedules: z10.array(
|
|
962
|
+
z10.object({
|
|
963
|
+
declaration: z10.union([everySchedule, cronSchedule]),
|
|
964
|
+
nextRun: z10.number().nullable(),
|
|
965
|
+
blocked: z10.boolean(),
|
|
789
966
|
lastRun: appScheduleRunSchema.nullable()
|
|
790
967
|
})
|
|
791
968
|
)
|
|
792
969
|
});
|
|
793
|
-
var scheduledInvocationSchema =
|
|
794
|
-
id:
|
|
795
|
-
build:
|
|
970
|
+
var scheduledInvocationSchema = z10.object({
|
|
971
|
+
id: z10.string().uuid(),
|
|
972
|
+
build: z10.string().uuid(),
|
|
796
973
|
name: appScheduleNameSchema,
|
|
797
|
-
scheduledAt:
|
|
798
|
-
startedAt:
|
|
799
|
-
manual:
|
|
974
|
+
scheduledAt: z10.number().int(),
|
|
975
|
+
startedAt: z10.number().int(),
|
|
976
|
+
manual: z10.boolean()
|
|
800
977
|
}).strict();
|
|
801
978
|
async function verifyScheduledRequest(request, key) {
|
|
802
979
|
const signature = request.headers.get("X-Domino-Schedule-Signature");
|
|
@@ -861,7 +1038,7 @@ ${body}`)
|
|
|
861
1038
|
}
|
|
862
1039
|
|
|
863
1040
|
// src/server/starters.ts
|
|
864
|
-
import * as
|
|
1041
|
+
import * as z11 from "zod";
|
|
865
1042
|
var starterTemplates = [
|
|
866
1043
|
{
|
|
867
1044
|
id: "campaign",
|
|
@@ -894,63 +1071,63 @@ var starterTemplates = [
|
|
|
894
1071
|
summary: "A headless Worker with typed routes and interactive API docs, for plugging Domino into your own product."
|
|
895
1072
|
}
|
|
896
1073
|
];
|
|
897
|
-
var starterIdSchema =
|
|
1074
|
+
var starterIdSchema = z11.enum(
|
|
898
1075
|
starterTemplates.map((template) => template.id)
|
|
899
1076
|
);
|
|
900
1077
|
|
|
901
1078
|
// src/server/hosting.ts
|
|
902
|
-
var outputPathSchema =
|
|
1079
|
+
var outputPathSchema = z12.string().min(1).max(512).refine(
|
|
903
1080
|
(path) => path.split("/").every(
|
|
904
1081
|
(part) => /^[\w-][\w.-]*$/.test(part) && part !== "node_modules"
|
|
905
1082
|
),
|
|
906
1083
|
"Expected a relative build output path without hidden segments"
|
|
907
1084
|
);
|
|
908
|
-
var appRoutingSchema =
|
|
1085
|
+
var appRoutingSchema = z12.enum(["legacy", "transparent"]).default("legacy");
|
|
909
1086
|
var APP_SECRET_LIMIT = 50;
|
|
910
1087
|
var APP_KV_LIMIT = 5;
|
|
911
1088
|
var APP_SQL_LIMIT = 5;
|
|
912
1089
|
var APP_MIGRATION_LIMIT = 100;
|
|
913
1090
|
var APP_MIGRATION_FILE_BYTES = 9e4;
|
|
914
1091
|
var APP_MIGRATION_TOTAL_BYTES = 1e6;
|
|
915
|
-
var appSecretNameSchema =
|
|
1092
|
+
var appSecretNameSchema = z12.string().regex(
|
|
916
1093
|
/^[A-Z_][A-Z0-9_]{0,63}$/,
|
|
917
1094
|
"Use 1-64 uppercase letters, digits, and underscores, not starting with a digit"
|
|
918
1095
|
).refine(
|
|
919
1096
|
(name) => !name.startsWith("DOMINO_") && name !== "ASSETS",
|
|
920
1097
|
"DOMINO_ names and ASSETS are reserved for Domino's own bindings"
|
|
921
1098
|
);
|
|
922
|
-
var appSecretValueSchema =
|
|
1099
|
+
var appSecretValueSchema = z12.string().min(1).refine(
|
|
923
1100
|
(value) => new TextEncoder().encode(value).length <= 5120,
|
|
924
1101
|
"Secret values can be at most 5 KiB"
|
|
925
1102
|
);
|
|
926
|
-
var appSecretInputSchema =
|
|
927
|
-
var appSecretSchema =
|
|
1103
|
+
var appSecretInputSchema = z12.object({ value: appSecretValueSchema }).strict();
|
|
1104
|
+
var appSecretSchema = z12.object({
|
|
928
1105
|
name: appSecretNameSchema,
|
|
929
|
-
updatedAt:
|
|
930
|
-
updatedBy:
|
|
1106
|
+
updatedAt: z12.number(),
|
|
1107
|
+
updatedBy: z12.string()
|
|
931
1108
|
});
|
|
932
|
-
var appSecretDeclarationSchema =
|
|
933
|
-
description:
|
|
934
|
-
required:
|
|
1109
|
+
var appSecretDeclarationSchema = z12.object({
|
|
1110
|
+
description: z12.string().trim().min(1).max(500),
|
|
1111
|
+
required: z12.boolean().default(true)
|
|
935
1112
|
}).strict();
|
|
936
|
-
var appSecretDeclarationsSchema =
|
|
1113
|
+
var appSecretDeclarationsSchema = z12.record(appSecretNameSchema, appSecretDeclarationSchema).refine(
|
|
937
1114
|
(secrets) => Object.keys(secrets).length <= APP_SECRET_LIMIT,
|
|
938
1115
|
`Declare at most ${APP_SECRET_LIMIT} app secrets`
|
|
939
1116
|
);
|
|
940
|
-
var appSecretListSchema =
|
|
941
|
-
secrets:
|
|
942
|
-
declared:
|
|
1117
|
+
var appSecretListSchema = z12.object({
|
|
1118
|
+
secrets: z12.array(appSecretSchema),
|
|
1119
|
+
declared: z12.array(appSecretDeclarationSchema.extend({ name: appSecretNameSchema })).default([])
|
|
943
1120
|
});
|
|
944
|
-
var hostedAppSecretsSchema =
|
|
945
|
-
var storageDescription =
|
|
946
|
-
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)
|
|
947
1124
|
}).strict();
|
|
948
|
-
var appStorageSchema =
|
|
949
|
-
kv:
|
|
1125
|
+
var appStorageSchema = z12.object({
|
|
1126
|
+
kv: z12.record(appSecretNameSchema, storageDescription).refine(
|
|
950
1127
|
(stores) => Object.keys(stores).length <= APP_KV_LIMIT,
|
|
951
1128
|
`Declare at most ${APP_KV_LIMIT} KV stores`
|
|
952
1129
|
).default({}),
|
|
953
|
-
sql:
|
|
1130
|
+
sql: z12.record(
|
|
954
1131
|
appSecretNameSchema,
|
|
955
1132
|
storageDescription.extend({
|
|
956
1133
|
migrations: outputPathSchema.optional()
|
|
@@ -960,60 +1137,60 @@ var appStorageSchema = z11.object({
|
|
|
960
1137
|
`Declare at most ${APP_SQL_LIMIT} SQL stores`
|
|
961
1138
|
).default({})
|
|
962
1139
|
}).strict();
|
|
963
|
-
var appStorageKindSchema =
|
|
964
|
-
var appStorageListSchema =
|
|
965
|
-
stores:
|
|
966
|
-
|
|
967
|
-
kind:
|
|
1140
|
+
var appStorageKindSchema = z12.enum(["kv", "sql"]);
|
|
1141
|
+
var appStorageListSchema = z12.object({
|
|
1142
|
+
stores: z12.array(
|
|
1143
|
+
z12.object({
|
|
1144
|
+
kind: z12.string(),
|
|
968
1145
|
name: appSecretNameSchema,
|
|
969
|
-
createdAt:
|
|
970
|
-
declared:
|
|
971
|
-
description:
|
|
1146
|
+
createdAt: z12.number().nullable(),
|
|
1147
|
+
declared: z12.boolean(),
|
|
1148
|
+
description: z12.string().optional()
|
|
972
1149
|
})
|
|
973
1150
|
)
|
|
974
1151
|
});
|
|
975
1152
|
var APP_STORAGE_ROW_LIMIT = 50;
|
|
976
1153
|
var APP_STORAGE_PREVIEW_CHARACTERS = 2e3;
|
|
977
|
-
var appStorageCellSchema =
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
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) })
|
|
983
1160
|
]);
|
|
984
|
-
var appStorageTablesSchema =
|
|
985
|
-
tables:
|
|
1161
|
+
var appStorageTablesSchema = z12.object({
|
|
1162
|
+
tables: z12.array(
|
|
986
1163
|
/** `kind` is SQLite's: `table` or `view`. */
|
|
987
|
-
|
|
1164
|
+
z12.object({ name: z12.string(), kind: z12.string() })
|
|
988
1165
|
)
|
|
989
1166
|
});
|
|
990
|
-
var appStorageRowsSchema =
|
|
991
|
-
table:
|
|
992
|
-
columns:
|
|
993
|
-
rows:
|
|
1167
|
+
var appStorageRowsSchema = z12.object({
|
|
1168
|
+
table: z12.string(),
|
|
1169
|
+
columns: z12.array(z12.string()),
|
|
1170
|
+
rows: z12.array(z12.array(appStorageCellSchema)),
|
|
994
1171
|
/** How many rows come before this page in storage order. */
|
|
995
|
-
offset:
|
|
996
|
-
total:
|
|
1172
|
+
offset: z12.number().int().min(0),
|
|
1173
|
+
total: z12.number().int().min(0),
|
|
997
1174
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
998
1175
|
nextCursor: pageCursorSchema.nullable().default(null)
|
|
999
1176
|
});
|
|
1000
|
-
var appStorageKeysSchema =
|
|
1001
|
-
keys:
|
|
1002
|
-
|
|
1177
|
+
var appStorageKeysSchema = z12.object({
|
|
1178
|
+
keys: z12.array(
|
|
1179
|
+
z12.object({ name: z12.string(), expiration: z12.number().nullable() })
|
|
1003
1180
|
),
|
|
1004
1181
|
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
1005
1182
|
nextCursor: pageCursorSchema.nullable().default(null),
|
|
1006
1183
|
/** @deprecated Use `nextCursor`. Removed in 2.0.0. */
|
|
1007
|
-
cursor:
|
|
1184
|
+
cursor: z12.string().nullable()
|
|
1008
1185
|
});
|
|
1009
|
-
var appStorageValueSchema =
|
|
1010
|
-
key:
|
|
1011
|
-
size:
|
|
1186
|
+
var appStorageValueSchema = z12.object({
|
|
1187
|
+
key: z12.string(),
|
|
1188
|
+
size: z12.number().int().min(0),
|
|
1012
1189
|
/** Null when the value is not UTF-8 text. */
|
|
1013
|
-
text:
|
|
1014
|
-
truncated:
|
|
1190
|
+
text: z12.string().nullable(),
|
|
1191
|
+
truncated: z12.boolean()
|
|
1015
1192
|
});
|
|
1016
|
-
var appMigrationNameSchema =
|
|
1193
|
+
var appMigrationNameSchema = z12.string().max(255).regex(/^[\w-][\w.-]*\.sql$/);
|
|
1017
1194
|
function compareAppMigrations(a, b) {
|
|
1018
1195
|
const left = Number.parseInt(a.split("_")[0], 10);
|
|
1019
1196
|
const right = Number.parseInt(b.split("_")[0], 10);
|
|
@@ -1030,12 +1207,12 @@ function compareAppMigrations(a, b) {
|
|
|
1030
1207
|
}
|
|
1031
1208
|
return a < b ? -1 : a > b ? 1 : 0;
|
|
1032
1209
|
}
|
|
1033
|
-
var appMigrationsSchema =
|
|
1210
|
+
var appMigrationsSchema = z12.record(
|
|
1034
1211
|
appSecretNameSchema,
|
|
1035
|
-
|
|
1036
|
-
|
|
1212
|
+
z12.array(
|
|
1213
|
+
z12.object({
|
|
1037
1214
|
name: appMigrationNameSchema,
|
|
1038
|
-
sql:
|
|
1215
|
+
sql: z12.string().min(1).refine(
|
|
1039
1216
|
(sql) => new TextEncoder().encode(sql).length <= APP_MIGRATION_FILE_BYTES,
|
|
1040
1217
|
`A migration file must not exceed ${APP_MIGRATION_FILE_BYTES} bytes`
|
|
1041
1218
|
)
|
|
@@ -1053,21 +1230,21 @@ var appMigrationsSchema = z11.record(
|
|
|
1053
1230
|
);
|
|
1054
1231
|
var appScripts = {
|
|
1055
1232
|
routing: appRoutingSchema,
|
|
1056
|
-
devScript:
|
|
1057
|
-
checkScript:
|
|
1058
|
-
buildScript:
|
|
1233
|
+
devScript: z12.string().regex(/^[\w:-]+$/),
|
|
1234
|
+
checkScript: z12.string().regex(/^[\w:-]+$/),
|
|
1235
|
+
buildScript: z12.string().regex(/^[\w:-]+$/)
|
|
1059
1236
|
};
|
|
1060
1237
|
var workerSettings = {
|
|
1061
|
-
runWorkerFirst:
|
|
1238
|
+
runWorkerFirst: z12.boolean().default(false),
|
|
1062
1239
|
main: outputPathSchema.refine(
|
|
1063
1240
|
(path) => /\.m?js$/.test(path),
|
|
1064
1241
|
"Expected a compiled JavaScript entry"
|
|
1065
1242
|
),
|
|
1066
|
-
compatibilityDate:
|
|
1067
|
-
compatibilityFlags:
|
|
1068
|
-
vars:
|
|
1069
|
-
|
|
1070
|
-
|
|
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()
|
|
1071
1248
|
).default({}),
|
|
1072
1249
|
secrets: appSecretDeclarationsSchema.default({}),
|
|
1073
1250
|
storage: appStorageSchema.optional(),
|
|
@@ -1096,62 +1273,62 @@ var distinctBindings = (worker, ctx) => {
|
|
|
1096
1273
|
}
|
|
1097
1274
|
}
|
|
1098
1275
|
};
|
|
1099
|
-
var hostedAppSchema =
|
|
1100
|
-
|
|
1101
|
-
kind:
|
|
1276
|
+
var hostedAppSchema = z12.discriminatedUnion("kind", [
|
|
1277
|
+
z12.object({
|
|
1278
|
+
kind: z12.literal("static"),
|
|
1102
1279
|
directory: outputPathSchema,
|
|
1103
1280
|
...appScripts
|
|
1104
1281
|
}).strict(),
|
|
1105
|
-
|
|
1106
|
-
kind:
|
|
1282
|
+
z12.object({
|
|
1283
|
+
kind: z12.literal("worker"),
|
|
1107
1284
|
directory: outputPathSchema,
|
|
1108
1285
|
assetsDirectory: outputPathSchema.optional(),
|
|
1109
1286
|
...appScripts,
|
|
1110
1287
|
...workerSettings
|
|
1111
1288
|
}).strict().superRefine(distinctBindings)
|
|
1112
1289
|
]);
|
|
1113
|
-
var repositorySchema =
|
|
1114
|
-
id:
|
|
1290
|
+
var repositorySchema = z12.object({
|
|
1291
|
+
id: z12.string().uuid(),
|
|
1115
1292
|
organization: identifier,
|
|
1116
1293
|
project: identifier,
|
|
1117
|
-
remote:
|
|
1118
|
-
defaultBranch:
|
|
1119
|
-
status:
|
|
1294
|
+
remote: z12.string().url(),
|
|
1295
|
+
defaultBranch: z12.string(),
|
|
1296
|
+
status: z12.enum(["provisioning", "ready"])
|
|
1120
1297
|
});
|
|
1121
|
-
var createRepositorySchema =
|
|
1298
|
+
var createRepositorySchema = z12.object({
|
|
1122
1299
|
/** Omitted: the starter chosen at project setup, else `campaign`. */
|
|
1123
1300
|
starter: starterIdSchema.optional()
|
|
1124
1301
|
}).strict();
|
|
1125
|
-
var deviceStartSchema =
|
|
1126
|
-
challenge:
|
|
1302
|
+
var deviceStartSchema = z12.object({
|
|
1303
|
+
challenge: z12.string().regex(/^[a-f0-9]{64}$/)
|
|
1127
1304
|
}).strict();
|
|
1128
|
-
var deviceRedeemSchema =
|
|
1129
|
-
id:
|
|
1130
|
-
verifier:
|
|
1305
|
+
var deviceRedeemSchema = z12.object({
|
|
1306
|
+
id: z12.string().uuid(),
|
|
1307
|
+
verifier: z12.string().min(43).max(128)
|
|
1131
1308
|
}).strict();
|
|
1132
|
-
var deviceApproveSchema =
|
|
1133
|
-
id:
|
|
1134
|
-
code:
|
|
1309
|
+
var deviceApproveSchema = z12.object({
|
|
1310
|
+
id: z12.string().uuid(),
|
|
1311
|
+
code: z12.string().regex(/^[A-F0-9]{4}-[A-F0-9]{4}$/)
|
|
1135
1312
|
}).strict();
|
|
1136
|
-
var commitSchema =
|
|
1137
|
-
var stageRequestSchema =
|
|
1313
|
+
var commitSchema = z12.string().regex(/^[a-f0-9]{40}$/);
|
|
1314
|
+
var stageRequestSchema = z12.object({
|
|
1138
1315
|
commit: commitSchema,
|
|
1139
|
-
requestId:
|
|
1316
|
+
requestId: z12.string().uuid()
|
|
1140
1317
|
}).strict();
|
|
1141
|
-
var buildIdentitySchema =
|
|
1318
|
+
var buildIdentitySchema = z12.object({
|
|
1142
1319
|
routing: appRoutingSchema,
|
|
1143
|
-
slug:
|
|
1144
|
-
runtime:
|
|
1145
|
-
id:
|
|
1146
|
-
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(),
|
|
1147
1324
|
organization: identifier,
|
|
1148
1325
|
project: identifier,
|
|
1149
1326
|
commit: commitSchema,
|
|
1150
|
-
createdAt:
|
|
1151
|
-
actor:
|
|
1152
|
-
commitMessage:
|
|
1327
|
+
createdAt: z12.number(),
|
|
1328
|
+
actor: z12.string(),
|
|
1329
|
+
commitMessage: z12.string().max(500).optional()
|
|
1153
1330
|
});
|
|
1154
|
-
var buildPhaseSchema =
|
|
1331
|
+
var buildPhaseSchema = z12.enum([
|
|
1155
1332
|
"queued",
|
|
1156
1333
|
"source",
|
|
1157
1334
|
"install",
|
|
@@ -1161,72 +1338,72 @@ var buildPhaseSchema = z11.enum([
|
|
|
1161
1338
|
"ready",
|
|
1162
1339
|
"failed"
|
|
1163
1340
|
]);
|
|
1164
|
-
var buildStatusSchema =
|
|
1341
|
+
var buildStatusSchema = z12.object({
|
|
1165
1342
|
phase: buildPhaseSchema,
|
|
1166
1343
|
failedPhase: buildPhaseSchema.optional(),
|
|
1167
|
-
updatedAt:
|
|
1168
|
-
message:
|
|
1344
|
+
updatedAt: z12.number(),
|
|
1345
|
+
message: z12.string()
|
|
1169
1346
|
});
|
|
1170
1347
|
var hostedBuildSchema = buildIdentitySchema.extend({
|
|
1171
1348
|
...buildStatusSchema.shape,
|
|
1172
|
-
finished:
|
|
1173
|
-
current:
|
|
1174
|
-
stagingUrl:
|
|
1349
|
+
finished: z12.boolean(),
|
|
1350
|
+
current: z12.boolean(),
|
|
1351
|
+
stagingUrl: z12.string().url()
|
|
1175
1352
|
});
|
|
1176
|
-
var stagingAccessModeSchema =
|
|
1177
|
-
var stagingAccessSchema =
|
|
1178
|
-
var stagingAccessInputSchema =
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
mode:
|
|
1182
|
-
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)
|
|
1183
1360
|
}).strict()
|
|
1184
1361
|
]);
|
|
1185
|
-
var stagingPathSchema =
|
|
1362
|
+
var stagingPathSchema = z12.string().max(2048).refine(
|
|
1186
1363
|
(path) => path.startsWith("/") && !path.startsWith("//") && !path.includes("\\"),
|
|
1187
1364
|
"Expected a path on the staging host"
|
|
1188
1365
|
);
|
|
1189
|
-
var stagingLinkSchema =
|
|
1190
|
-
url:
|
|
1191
|
-
expiresAt:
|
|
1366
|
+
var stagingLinkSchema = z12.object({
|
|
1367
|
+
url: z12.string().url(),
|
|
1368
|
+
expiresAt: z12.number()
|
|
1192
1369
|
});
|
|
1193
|
-
var buildSnapshotSchema =
|
|
1194
|
-
builds:
|
|
1370
|
+
var buildSnapshotSchema = z12.object({
|
|
1371
|
+
builds: z12.array(hostedBuildSchema),
|
|
1195
1372
|
current: hostedBuildSchema.nullable(),
|
|
1196
1373
|
selected: hostedBuildSchema.nullable(),
|
|
1197
|
-
logs:
|
|
1374
|
+
logs: z12.string()
|
|
1198
1375
|
});
|
|
1199
|
-
var assetPathSchema =
|
|
1376
|
+
var assetPathSchema = z12.string().max(512).refine(
|
|
1200
1377
|
(path) => path.startsWith("/") && // oxlint-disable-next-line no-control-regex -- Asset paths must reject control characters.
|
|
1201
1378
|
!/[\\\u0000-\u001f?#%]/.test(path) && path.slice(1).split("/").every((part) => part.length > 0 && !part.startsWith(".")),
|
|
1202
1379
|
"Expected a public asset path without hidden segments"
|
|
1203
1380
|
);
|
|
1204
|
-
var base64Schema =
|
|
1381
|
+
var base64Schema = z12.string().regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
|
|
1205
1382
|
var stagedDeploymentLimits = {
|
|
1206
1383
|
/** Bytes of JSON, uncompressed. */
|
|
1207
1384
|
size: 64e6,
|
|
1208
1385
|
/** Bytes of the Brotli-compressed object. */
|
|
1209
1386
|
compressedSize: 1e7
|
|
1210
1387
|
};
|
|
1211
|
-
var stagedDeploymentSchema =
|
|
1212
|
-
encoding:
|
|
1213
|
-
sha256:
|
|
1214
|
-
compressedSize:
|
|
1215
|
-
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)
|
|
1216
1393
|
}).strict();
|
|
1217
1394
|
var stagedDeploymentContentSchema = stagedDeploymentSchema.extend({
|
|
1218
|
-
content:
|
|
1395
|
+
content: z12.string().max(Math.ceil(stagedDeploymentLimits.compressedSize / 3) * 4)
|
|
1219
1396
|
}).strict();
|
|
1220
1397
|
var stagedDeploymentKey = (build, sha256) => `builds/${build}/deployment/${sha256}.br`;
|
|
1221
1398
|
var artifactFields = {
|
|
1222
1399
|
routing: appRoutingSchema,
|
|
1223
|
-
worker:
|
|
1400
|
+
worker: z12.object({
|
|
1224
1401
|
...workerSettings,
|
|
1225
1402
|
migrations: appMigrationsSchema.optional(),
|
|
1226
|
-
modules:
|
|
1227
|
-
|
|
1403
|
+
modules: z12.array(
|
|
1404
|
+
z12.object({
|
|
1228
1405
|
path: outputPathSchema.refine((path) => path !== "metadata"),
|
|
1229
|
-
type:
|
|
1406
|
+
type: z12.enum([
|
|
1230
1407
|
"application/javascript+module",
|
|
1231
1408
|
"application/wasm",
|
|
1232
1409
|
"text/plain",
|
|
@@ -1236,26 +1413,26 @@ var artifactFields = {
|
|
|
1236
1413
|
}).strict()
|
|
1237
1414
|
).min(1).max(500)
|
|
1238
1415
|
}).strict().superRefine(distinctBindings).optional(),
|
|
1239
|
-
assets:
|
|
1240
|
-
|
|
1416
|
+
assets: z12.array(
|
|
1417
|
+
z12.object({
|
|
1241
1418
|
path: assetPathSchema,
|
|
1242
1419
|
content: base64Schema.max(14e6),
|
|
1243
|
-
size:
|
|
1420
|
+
size: z12.number().int().min(0).max(1e7)
|
|
1244
1421
|
}).strict()
|
|
1245
1422
|
).max(500)
|
|
1246
1423
|
};
|
|
1247
|
-
var buildArtifactsSchema =
|
|
1248
|
-
|
|
1249
|
-
format:
|
|
1424
|
+
var buildArtifactsSchema = z12.discriminatedUnion("format", [
|
|
1425
|
+
z12.object({
|
|
1426
|
+
format: z12.literal(1),
|
|
1250
1427
|
...artifactFields,
|
|
1251
|
-
quests:
|
|
1252
|
-
catalog:
|
|
1428
|
+
quests: z12.unknown(),
|
|
1429
|
+
catalog: z12.unknown()
|
|
1253
1430
|
}).strict(),
|
|
1254
|
-
|
|
1255
|
-
format:
|
|
1431
|
+
z12.object({
|
|
1432
|
+
format: z12.literal(2),
|
|
1256
1433
|
...artifactFields,
|
|
1257
1434
|
deployment: stagedDeploymentSchema,
|
|
1258
|
-
images:
|
|
1435
|
+
images: z12.array(imageAssetArtifactSchema).max(10)
|
|
1259
1436
|
}).strict()
|
|
1260
1437
|
]).superRefine((value, ctx) => {
|
|
1261
1438
|
if (value.worker) {
|
|
@@ -1307,39 +1484,39 @@ var buildArtifactsSchema = z11.discriminatedUnion("format", [
|
|
|
1307
1484
|
});
|
|
1308
1485
|
|
|
1309
1486
|
// src/server/development.ts
|
|
1310
|
-
import * as
|
|
1311
|
-
var developmentPreflightSchema =
|
|
1312
|
-
organization:
|
|
1313
|
-
project:
|
|
1314
|
-
environment:
|
|
1315
|
-
identity:
|
|
1316
|
-
exchange:
|
|
1317
|
-
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()
|
|
1318
1495
|
}).optional(),
|
|
1319
|
-
staging:
|
|
1320
|
-
development:
|
|
1321
|
-
status:
|
|
1496
|
+
staging: z13.enum(["configured", "blocked"]),
|
|
1497
|
+
development: z13.object({
|
|
1498
|
+
status: z13.enum(["configured", "blocked"]),
|
|
1322
1499
|
// How `domino dev` reaches the preview origin: a Cloudflare tunnel, or a direct route on a
|
|
1323
1500
|
// local development stack. APIs that predate the field use tunnels.
|
|
1324
|
-
transport:
|
|
1325
|
-
missing:
|
|
1326
|
-
authentication:
|
|
1501
|
+
transport: z13.enum(["tunnel", "direct"]).default("tunnel"),
|
|
1502
|
+
missing: z13.array(z13.string()),
|
|
1503
|
+
authentication: z13.array(z13.string())
|
|
1327
1504
|
}),
|
|
1328
|
-
checks:
|
|
1329
|
-
|
|
1330
|
-
id:
|
|
1331
|
-
status:
|
|
1332
|
-
message:
|
|
1333
|
-
missing:
|
|
1334
|
-
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()
|
|
1335
1512
|
})
|
|
1336
1513
|
)
|
|
1337
1514
|
});
|
|
1338
1515
|
|
|
1339
1516
|
// src/server/hosted.ts
|
|
1340
|
-
import * as
|
|
1517
|
+
import * as z14 from "zod";
|
|
1341
1518
|
var hostedKeyPermissions = ["read", "points", "ingest"];
|
|
1342
|
-
var hostedKeyPermissionList =
|
|
1519
|
+
var hostedKeyPermissionList = z14.array(z14.string()).transform(
|
|
1343
1520
|
(values) => values.filter(
|
|
1344
1521
|
(value) => hostedKeyPermissions.includes(value)
|
|
1345
1522
|
)
|
|
@@ -1351,17 +1528,17 @@ var hostedManagementBindings = [
|
|
|
1351
1528
|
"DOMINO_PROJECT",
|
|
1352
1529
|
"DOMINO_ENVIRONMENT"
|
|
1353
1530
|
];
|
|
1354
|
-
var hostedKeySecretSchema =
|
|
1355
|
-
var hostedKeySchema =
|
|
1356
|
-
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(),
|
|
1357
1534
|
token: hostedKeySecretSchema,
|
|
1358
1535
|
organization: identifier,
|
|
1359
1536
|
project: identifier,
|
|
1360
|
-
environment:
|
|
1537
|
+
environment: z14.enum(["test", "live"]),
|
|
1361
1538
|
permissions: hostedKeyPermissionList,
|
|
1362
|
-
expiresAt:
|
|
1539
|
+
expiresAt: z14.number().nullable()
|
|
1363
1540
|
}).strict();
|
|
1364
|
-
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl:
|
|
1541
|
+
var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl: z14.string().url() }).strict();
|
|
1365
1542
|
function hostedManagementClient(env) {
|
|
1366
1543
|
const missing = hostedManagementBindings.filter((name) => !env[name]);
|
|
1367
1544
|
if (missing.length) {
|
|
@@ -1369,7 +1546,7 @@ function hostedManagementClient(env) {
|
|
|
1369
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.`
|
|
1370
1547
|
);
|
|
1371
1548
|
}
|
|
1372
|
-
const environment =
|
|
1549
|
+
const environment = z14.enum(["test", "live"]).parse(env.DOMINO_ENVIRONMENT);
|
|
1373
1550
|
const token = env.DOMINO_MANAGEMENT_KEY;
|
|
1374
1551
|
return createManagementClient({
|
|
1375
1552
|
baseUrl: env.DOMINO_API_URL.replace(/\/+$/, ""),
|
|
@@ -1381,9 +1558,9 @@ function hostedManagementClient(env) {
|
|
|
1381
1558
|
}
|
|
1382
1559
|
|
|
1383
1560
|
// src/server/index.ts
|
|
1384
|
-
var environmentSchema =
|
|
1385
|
-
var roleSchema =
|
|
1386
|
-
var permissionSchema =
|
|
1561
|
+
var environmentSchema = z15.enum(["test", "live"]);
|
|
1562
|
+
var roleSchema = z15.enum(["editor", "reviewer", "staff"]);
|
|
1563
|
+
var permissionSchema = z15.enum([
|
|
1387
1564
|
"read",
|
|
1388
1565
|
"publish",
|
|
1389
1566
|
"review",
|
|
@@ -1403,7 +1580,7 @@ var permissionSchema = z14.enum([
|
|
|
1403
1580
|
*/
|
|
1404
1581
|
"enroll"
|
|
1405
1582
|
]);
|
|
1406
|
-
var permissionListSchema =
|
|
1583
|
+
var permissionListSchema = z15.array(z15.string()).transform(
|
|
1407
1584
|
(values) => values.filter(
|
|
1408
1585
|
(value) => permissionSchema.safeParse(value).success
|
|
1409
1586
|
)
|
|
@@ -1413,38 +1590,38 @@ var rolePermissions = {
|
|
|
1413
1590
|
reviewer: ["read", "review"],
|
|
1414
1591
|
staff: ["read", "confirm", "handover"]
|
|
1415
1592
|
};
|
|
1416
|
-
var projectSetupSchema =
|
|
1417
|
-
mode:
|
|
1418
|
-
brief:
|
|
1593
|
+
var projectSetupSchema = z15.object({
|
|
1594
|
+
mode: z15.enum(["new", "existing"]),
|
|
1595
|
+
brief: z15.string().trim().min(1).max(4e3)
|
|
1419
1596
|
}).strict();
|
|
1420
|
-
var operatorUserSchema =
|
|
1421
|
-
id:
|
|
1422
|
-
name:
|
|
1423
|
-
email:
|
|
1424
|
-
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()
|
|
1425
1602
|
});
|
|
1426
|
-
var projectSchema =
|
|
1603
|
+
var projectSchema = z15.object({
|
|
1427
1604
|
/**
|
|
1428
1605
|
* Names the project's hosted addresses. The server gives a new project, and accepts in a
|
|
1429
1606
|
* slug change, only slugs of at least 3 characters that Domino does not reserve. This schema
|
|
1430
1607
|
* checks only the format, so it parses every slug that exists.
|
|
1431
1608
|
*/
|
|
1432
|
-
slug:
|
|
1433
|
-
createdBy:
|
|
1609
|
+
slug: z15.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
1610
|
+
createdBy: z15.string().nullable().optional(),
|
|
1434
1611
|
creator: operatorUserSchema.nullable().optional(),
|
|
1435
1612
|
/** A response, so fields a newer server adds to the setup are dropped, not rejected. */
|
|
1436
|
-
setup:
|
|
1613
|
+
setup: z15.object(projectSetupSchema.shape).optional(),
|
|
1437
1614
|
/** The starter chosen at setup. A plain string, so later starters still parse. */
|
|
1438
|
-
starter:
|
|
1439
|
-
id:
|
|
1615
|
+
starter: z15.string().optional(),
|
|
1616
|
+
id: z15.string().min(1),
|
|
1440
1617
|
organization: identifier,
|
|
1441
1618
|
project: identifier,
|
|
1442
|
-
name:
|
|
1443
|
-
subtitle:
|
|
1444
|
-
initials:
|
|
1445
|
-
color:
|
|
1619
|
+
name: z15.string(),
|
|
1620
|
+
subtitle: z15.string(),
|
|
1621
|
+
initials: z15.string(),
|
|
1622
|
+
color: z15.string(),
|
|
1446
1623
|
permissions: permissionListSchema,
|
|
1447
|
-
environments:
|
|
1624
|
+
environments: z15.array(environmentSchema)
|
|
1448
1625
|
}).refine(
|
|
1449
1626
|
(project) => !project.creator || project.creator.id === project.createdBy,
|
|
1450
1627
|
{
|
|
@@ -1452,45 +1629,45 @@ var projectSchema = z14.object({
|
|
|
1452
1629
|
path: ["creator"]
|
|
1453
1630
|
}
|
|
1454
1631
|
);
|
|
1455
|
-
var projectInputSchema =
|
|
1632
|
+
var projectInputSchema = z15.object({
|
|
1456
1633
|
actionId: identifier,
|
|
1457
|
-
name:
|
|
1634
|
+
name: z15.string().trim().min(1).max(80),
|
|
1458
1635
|
setup: projectSetupSchema.optional(),
|
|
1459
1636
|
/** The starter a new hosted app begins from, with `setup.mode` "new". */
|
|
1460
1637
|
starter: starterIdSchema.optional()
|
|
1461
1638
|
}).strict();
|
|
1462
|
-
var projectUpdateInputSchema =
|
|
1463
|
-
|
|
1464
|
-
|
|
1639
|
+
var projectUpdateInputSchema = z15.union([
|
|
1640
|
+
z15.object({ name: projectInputSchema.shape.name }).strict(),
|
|
1641
|
+
z15.object({
|
|
1465
1642
|
slug: projectSchema.shape.slug,
|
|
1466
|
-
confirm:
|
|
1643
|
+
confirm: z15.string().min(1).max(80)
|
|
1467
1644
|
}).strict()
|
|
1468
1645
|
]);
|
|
1469
|
-
var projectDeletionInputSchema =
|
|
1470
|
-
var projectDeletionSchema =
|
|
1646
|
+
var projectDeletionInputSchema = z15.object({ confirm: z15.string().min(1).max(80) }).strict();
|
|
1647
|
+
var projectDeletionSchema = z15.object({
|
|
1471
1648
|
project: identifier,
|
|
1472
|
-
purgeAfter:
|
|
1649
|
+
purgeAfter: z15.number().int()
|
|
1473
1650
|
});
|
|
1474
|
-
var projectTransferInputSchema =
|
|
1475
|
-
var projectTransferSchema =
|
|
1651
|
+
var projectTransferInputSchema = z15.object({ organization: identifier, confirm: z15.string().min(1).max(80) }).strict();
|
|
1652
|
+
var projectTransferSchema = z15.object({
|
|
1476
1653
|
organization: identifier,
|
|
1477
1654
|
project: identifier
|
|
1478
1655
|
});
|
|
1479
|
-
var grantSchema =
|
|
1480
|
-
subject:
|
|
1481
|
-
roles:
|
|
1482
|
-
environments:
|
|
1656
|
+
var grantSchema = z15.object({
|
|
1657
|
+
subject: z15.string().min(1).max(200),
|
|
1658
|
+
roles: z15.array(roleSchema),
|
|
1659
|
+
environments: z15.array(environmentSchema)
|
|
1483
1660
|
}).strict();
|
|
1484
|
-
var grantRecordSchema =
|
|
1485
|
-
var stockAdditionSchema =
|
|
1661
|
+
var grantRecordSchema = z15.object(grantSchema.shape);
|
|
1662
|
+
var stockAdditionSchema = z15.object({
|
|
1486
1663
|
item: identifier,
|
|
1487
|
-
quantity:
|
|
1664
|
+
quantity: z15.number().int(),
|
|
1488
1665
|
actionId: identifier
|
|
1489
1666
|
});
|
|
1490
|
-
var completionRevokeSchema =
|
|
1667
|
+
var completionRevokeSchema = z15.object({
|
|
1491
1668
|
actionId: identifier,
|
|
1492
|
-
reason:
|
|
1493
|
-
freeOccurrence:
|
|
1669
|
+
reason: z15.string().trim().min(1).max(500),
|
|
1670
|
+
freeOccurrence: z15.boolean().default(false)
|
|
1494
1671
|
}).strict();
|
|
1495
1672
|
var RevokedEntitlementOutcome = {
|
|
1496
1673
|
/** No other completion grants the reward: it is void, after cancelling a handover in progress. */
|
|
@@ -1518,234 +1695,249 @@ var RevokedReferralOutcome = {
|
|
|
1518
1695
|
/** Qualified on another accepted completion of the program's quest instead. */
|
|
1519
1696
|
Requalified: "requalified"
|
|
1520
1697
|
};
|
|
1521
|
-
var entitlementOutcomeSchema =
|
|
1522
|
-
var deliveryOutcomeSchema =
|
|
1523
|
-
var referralOutcomeSchema =
|
|
1524
|
-
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({
|
|
1525
1702
|
completion: identifier,
|
|
1526
1703
|
/** The quest ID, or the board ID when `source.kind` is `leaderboard`. */
|
|
1527
1704
|
quest: identifier,
|
|
1528
1705
|
member: identifier,
|
|
1529
1706
|
/** What paid the revoked completion. `source.id` repeats `quest`. */
|
|
1530
1707
|
source: completionSourceSchema.optional(),
|
|
1531
|
-
revokedAt:
|
|
1532
|
-
occurrenceFreed:
|
|
1533
|
-
badges:
|
|
1534
|
-
points:
|
|
1535
|
-
|
|
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({
|
|
1536
1713
|
entry: identifier,
|
|
1537
1714
|
balance: identifier,
|
|
1538
1715
|
reversal: identifier.nullable(),
|
|
1539
|
-
reversed:
|
|
1540
|
-
unreversed:
|
|
1716
|
+
reversed: z15.number().int(),
|
|
1717
|
+
unreversed: z15.number().int()
|
|
1541
1718
|
})
|
|
1542
1719
|
),
|
|
1543
|
-
entitlements:
|
|
1544
|
-
|
|
1720
|
+
entitlements: z15.array(
|
|
1721
|
+
z15.object({
|
|
1545
1722
|
entitlement: identifier,
|
|
1546
1723
|
reward: identifier,
|
|
1547
1724
|
outcome: entitlementOutcomeSchema,
|
|
1548
|
-
status:
|
|
1725
|
+
status: z15.string()
|
|
1549
1726
|
})
|
|
1550
1727
|
),
|
|
1551
|
-
deliveries:
|
|
1552
|
-
|
|
1553
|
-
delivery:
|
|
1554
|
-
roleId:
|
|
1728
|
+
deliveries: z15.array(
|
|
1729
|
+
z15.object({
|
|
1730
|
+
delivery: z15.string(),
|
|
1731
|
+
roleId: z15.string(),
|
|
1555
1732
|
outcome: deliveryOutcomeSchema,
|
|
1556
1733
|
/**
|
|
1557
1734
|
* By Relay's records, another accepted, unrevoked completion of the member also granted this
|
|
1558
1735
|
* role to the same Discord account and server. Relay does not read Discord's membership.
|
|
1559
1736
|
*/
|
|
1560
|
-
stillGranted:
|
|
1737
|
+
stillGranted: z15.boolean()
|
|
1561
1738
|
})
|
|
1562
1739
|
),
|
|
1563
|
-
referrals:
|
|
1564
|
-
|
|
1740
|
+
referrals: z15.array(
|
|
1741
|
+
z15.object({
|
|
1565
1742
|
program: identifier,
|
|
1566
1743
|
outcome: referralOutcomeSchema
|
|
1567
1744
|
})
|
|
1568
1745
|
),
|
|
1569
|
-
streakMilestone:
|
|
1746
|
+
streakMilestone: z15.boolean()
|
|
1570
1747
|
});
|
|
1571
|
-
var accessSchema =
|
|
1572
|
-
actor:
|
|
1573
|
-
organization:
|
|
1574
|
-
admin:
|
|
1575
|
-
local:
|
|
1576
|
-
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)
|
|
1577
1754
|
});
|
|
1578
|
-
var querySchema =
|
|
1579
|
-
q:
|
|
1580
|
-
filter:
|
|
1581
|
-
offset:
|
|
1582
|
-
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)
|
|
1583
1760
|
});
|
|
1584
|
-
var accountProfileSchema =
|
|
1585
|
-
name:
|
|
1761
|
+
var accountProfileSchema = z15.object({
|
|
1762
|
+
name: z15.string().optional(),
|
|
1586
1763
|
/** The account's handle, where the provider has one (X and Discord). */
|
|
1587
|
-
username:
|
|
1588
|
-
email:
|
|
1589
|
-
emailVerified:
|
|
1590
|
-
imageUrl:
|
|
1764
|
+
username: z15.string().optional(),
|
|
1765
|
+
email: z15.string().optional(),
|
|
1766
|
+
emailVerified: z15.boolean().default(false),
|
|
1767
|
+
imageUrl: z15.string().url().optional()
|
|
1591
1768
|
});
|
|
1592
|
-
var memberAccountSchema =
|
|
1769
|
+
var memberAccountSchema = z15.object({
|
|
1593
1770
|
/** `wallet` for wallet sign-in, `account` for every other connected account. */
|
|
1594
|
-
kind:
|
|
1595
|
-
provider:
|
|
1596
|
-
subject:
|
|
1597
|
-
signInEnabled:
|
|
1771
|
+
kind: z15.enum(["account", "wallet"]),
|
|
1772
|
+
provider: z15.string(),
|
|
1773
|
+
subject: z15.string(),
|
|
1774
|
+
signInEnabled: z15.boolean(),
|
|
1598
1775
|
profile: accountProfileSchema.optional()
|
|
1599
1776
|
});
|
|
1600
|
-
var operationSchema =
|
|
1601
|
-
target:
|
|
1602
|
-
paused:
|
|
1603
|
-
revision:
|
|
1604
|
-
reason:
|
|
1605
|
-
actor:
|
|
1606
|
-
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()
|
|
1607
1784
|
});
|
|
1608
|
-
var operationInputSchema =
|
|
1609
|
-
target:
|
|
1610
|
-
|
|
1611
|
-
|
|
1785
|
+
var operationInputSchema = z15.object({
|
|
1786
|
+
target: z15.union([
|
|
1787
|
+
z15.literal("redemptions"),
|
|
1788
|
+
z15.string().regex(/^quest:[\w-]+$/)
|
|
1612
1789
|
]),
|
|
1613
|
-
paused:
|
|
1614
|
-
revision:
|
|
1615
|
-
reason:
|
|
1790
|
+
paused: z15.boolean(),
|
|
1791
|
+
revision: z15.number().int().nonnegative(),
|
|
1792
|
+
reason: z15.string().trim().min(1).max(500),
|
|
1616
1793
|
actionId: identifier
|
|
1617
1794
|
}).strict();
|
|
1618
|
-
var questLifecycleInputSchema =
|
|
1795
|
+
var questLifecycleInputSchema = z15.object({
|
|
1619
1796
|
quest: identifier,
|
|
1620
1797
|
expectedRelease: identifier.optional(),
|
|
1621
|
-
archived:
|
|
1622
|
-
reason:
|
|
1798
|
+
archived: z15.boolean(),
|
|
1799
|
+
reason: z15.string().trim().min(1).max(500),
|
|
1623
1800
|
actionId: identifier
|
|
1624
1801
|
}).strict();
|
|
1625
|
-
var questLifecycleSchema =
|
|
1802
|
+
var questLifecycleSchema = z15.object({
|
|
1626
1803
|
quest: identifier,
|
|
1627
1804
|
key: identifier.nullable(),
|
|
1628
|
-
title:
|
|
1805
|
+
title: z15.string(),
|
|
1629
1806
|
release: identifier,
|
|
1630
|
-
lifecycle:
|
|
1631
|
-
changed:
|
|
1807
|
+
lifecycle: z15.enum(["active", "paused", "archived"]),
|
|
1808
|
+
changed: z15.boolean()
|
|
1632
1809
|
});
|
|
1633
|
-
var memberSchema =
|
|
1634
|
-
id:
|
|
1635
|
-
test:
|
|
1636
|
-
name:
|
|
1637
|
-
accounts:
|
|
1638
|
-
attempts:
|
|
1639
|
-
completions:
|
|
1640
|
-
rewards:
|
|
1641
|
-
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()
|
|
1642
1819
|
});
|
|
1643
|
-
var personSchema =
|
|
1644
|
-
id:
|
|
1645
|
-
test:
|
|
1646
|
-
name:
|
|
1647
|
-
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([])
|
|
1648
1825
|
});
|
|
1649
|
-
var metricsSchema =
|
|
1650
|
-
quests:
|
|
1651
|
-
members:
|
|
1652
|
-
attempts:
|
|
1653
|
-
completions:
|
|
1654
|
-
review:
|
|
1655
|
-
failed:
|
|
1656
|
-
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()
|
|
1657
1834
|
});
|
|
1658
|
-
var readinessSchema =
|
|
1659
|
-
checks:
|
|
1660
|
-
|
|
1661
|
-
id:
|
|
1662
|
-
status:
|
|
1663
|
-
title:
|
|
1664
|
-
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()
|
|
1665
1842
|
})
|
|
1666
1843
|
)
|
|
1667
1844
|
});
|
|
1668
|
-
var inventorySchema =
|
|
1669
|
-
item:
|
|
1670
|
-
name:
|
|
1671
|
-
available:
|
|
1672
|
-
reserved:
|
|
1673
|
-
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)
|
|
1674
1851
|
});
|
|
1675
|
-
var auditRecordSchema =
|
|
1676
|
-
id:
|
|
1677
|
-
action:
|
|
1678
|
-
actor:
|
|
1852
|
+
var auditRecordSchema = z15.object({
|
|
1853
|
+
id: z15.string(),
|
|
1854
|
+
action: z15.string(),
|
|
1855
|
+
actor: z15.string().nullable(),
|
|
1679
1856
|
user: operatorUserSchema.nullable().optional(),
|
|
1680
|
-
detail:
|
|
1681
|
-
at:
|
|
1682
|
-
attempt:
|
|
1857
|
+
detail: z15.string(),
|
|
1858
|
+
at: z15.number(),
|
|
1859
|
+
attempt: z15.string().nullable()
|
|
1683
1860
|
}).refine((record4) => !record4.user || record4.user.id === record4.actor, {
|
|
1684
1861
|
message: "User profile must match the recorded actor",
|
|
1685
1862
|
path: ["user"]
|
|
1686
1863
|
});
|
|
1687
|
-
var pageSchema =
|
|
1864
|
+
var pageSchema = z15.object({
|
|
1688
1865
|
snapshot: snapshotSchema,
|
|
1689
|
-
members:
|
|
1690
|
-
people:
|
|
1866
|
+
members: z15.array(memberSchema),
|
|
1867
|
+
people: z15.array(personSchema).default([]),
|
|
1691
1868
|
metrics: metricsSchema,
|
|
1692
|
-
total:
|
|
1693
|
-
offset:
|
|
1694
|
-
limit:
|
|
1695
|
-
inventory:
|
|
1696
|
-
operations:
|
|
1697
|
-
audit:
|
|
1698
|
-
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())
|
|
1699
1876
|
});
|
|
1700
|
-
var managedOAuthAccountBaseSchema =
|
|
1701
|
-
provider:
|
|
1702
|
-
revision:
|
|
1877
|
+
var managedOAuthAccountBaseSchema = z15.object({
|
|
1878
|
+
provider: z15.enum(["x", "discord"]),
|
|
1879
|
+
revision: z15.number().int().nonnegative()
|
|
1703
1880
|
});
|
|
1704
|
-
var managedOAuthAccountSchema =
|
|
1881
|
+
var managedOAuthAccountSchema = z15.discriminatedUnion("status", [
|
|
1705
1882
|
managedOAuthAccountBaseSchema.extend({
|
|
1706
|
-
status:
|
|
1707
|
-
subject:
|
|
1708
|
-
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()
|
|
1709
1891
|
}),
|
|
1710
|
-
managedOAuthAccountBaseSchema.extend({ status:
|
|
1892
|
+
managedOAuthAccountBaseSchema.extend({ status: z15.literal("disconnected") })
|
|
1711
1893
|
]);
|
|
1712
1894
|
var managedTelegramAccountBaseSchema = managedOAuthAccountBaseSchema.extend({
|
|
1713
|
-
provider:
|
|
1895
|
+
provider: z15.literal("telegram")
|
|
1714
1896
|
});
|
|
1715
|
-
var managedTelegramAccountSchema =
|
|
1897
|
+
var managedTelegramAccountSchema = z15.discriminatedUnion("status", [
|
|
1716
1898
|
managedTelegramAccountBaseSchema.extend({
|
|
1717
|
-
status:
|
|
1899
|
+
status: z15.literal("connected"),
|
|
1718
1900
|
/** The numeric Telegram user ID. */
|
|
1719
|
-
subject:
|
|
1720
|
-
linkedAt:
|
|
1901
|
+
subject: z15.string().min(1),
|
|
1902
|
+
linkedAt: z15.number()
|
|
1721
1903
|
}),
|
|
1722
1904
|
managedTelegramAccountBaseSchema.extend({
|
|
1723
|
-
status:
|
|
1905
|
+
status: z15.literal("disconnected")
|
|
1724
1906
|
})
|
|
1725
1907
|
]);
|
|
1726
|
-
var memberOAuthUnlinkInputSchema =
|
|
1727
|
-
provider:
|
|
1728
|
-
subject:
|
|
1729
|
-
revision:
|
|
1730
|
-
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)
|
|
1731
1913
|
}).strict();
|
|
1732
1914
|
var memberTelegramUnlinkInputSchema = memberOAuthUnlinkInputSchema.omit({ provider: true }).strict();
|
|
1733
1915
|
var managedWalletSchema = linkedWalletSchema.extend({
|
|
1734
|
-
|
|
1735
|
-
|
|
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(),
|
|
1736
1923
|
/** "member", or the operator or key that unlinked it. */
|
|
1737
|
-
unlinkedBy:
|
|
1924
|
+
unlinkedBy: z15.string().nullable()
|
|
1738
1925
|
});
|
|
1739
1926
|
var managedMemberIdentitySchema = memberIdentitySchema.extend({
|
|
1740
|
-
|
|
1741
|
-
|
|
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(),
|
|
1742
1934
|
/** The operator or key that unlinked it. */
|
|
1743
|
-
unlinkedBy:
|
|
1935
|
+
unlinkedBy: z15.string().nullable()
|
|
1744
1936
|
});
|
|
1745
|
-
var memberIdentityChangeInputSchema =
|
|
1937
|
+
var memberIdentityChangeInputSchema = z15.object({
|
|
1746
1938
|
kind: appIdentityKindSchema,
|
|
1747
|
-
subject:
|
|
1748
|
-
reason:
|
|
1939
|
+
subject: z15.string().min(1).max(256),
|
|
1940
|
+
reason: z15.string().trim().min(1).max(500)
|
|
1749
1941
|
}).strict();
|
|
1750
1942
|
var balanceCheckSchema = walletBalanceSchema.pick({
|
|
1751
1943
|
chain: true,
|
|
@@ -1755,76 +1947,76 @@ var balanceCheckSchema = walletBalanceSchema.pick({
|
|
|
1755
1947
|
wallets: true,
|
|
1756
1948
|
observedAt: true
|
|
1757
1949
|
}).extend({ attempt: identifier });
|
|
1758
|
-
var walletBalanceChainsSchema =
|
|
1759
|
-
chains:
|
|
1760
|
-
|
|
1761
|
-
chain:
|
|
1762
|
-
|
|
1950
|
+
var walletBalanceChainsSchema = z15.object({
|
|
1951
|
+
chains: z15.array(
|
|
1952
|
+
z15.object({
|
|
1953
|
+
chain: z15.union([
|
|
1954
|
+
z15.literal(solanaMainnet),
|
|
1763
1955
|
cosmosNetworkSchema,
|
|
1764
1956
|
evmChainIdSchema
|
|
1765
1957
|
]),
|
|
1766
|
-
name:
|
|
1767
|
-
testnet:
|
|
1958
|
+
name: z15.string(),
|
|
1959
|
+
testnet: z15.boolean()
|
|
1768
1960
|
})
|
|
1769
1961
|
)
|
|
1770
1962
|
});
|
|
1771
|
-
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason:
|
|
1963
|
+
var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason: z15.string().trim().min(1).max(500) }).strict();
|
|
1772
1964
|
var memberWalletSignInInputSchema = walletUnlinkInputSchema.extend({
|
|
1773
|
-
enabled:
|
|
1774
|
-
reason:
|
|
1965
|
+
enabled: z15.boolean(),
|
|
1966
|
+
reason: z15.string().trim().min(1).max(500)
|
|
1775
1967
|
}).strict();
|
|
1776
|
-
var telegramBotIdSchema =
|
|
1777
|
-
var participantSignInSchema =
|
|
1778
|
-
providers:
|
|
1779
|
-
|
|
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() })
|
|
1780
1972
|
),
|
|
1781
|
-
email:
|
|
1973
|
+
email: z15.boolean(),
|
|
1782
1974
|
/** Wallet families: `"solana"`, `"eip155"`, `"cosmos"`. */
|
|
1783
1975
|
wallets: walletSignInNetworksSchema,
|
|
1784
1976
|
/** Why participants cannot sign in to this project, or null. */
|
|
1785
|
-
issue:
|
|
1977
|
+
issue: z15.string().nullable(),
|
|
1786
1978
|
/**
|
|
1787
1979
|
* Telegram, outside `providers` in SDK 1.x: whether Domino configured Telegram Login, and the
|
|
1788
1980
|
* bot whose Mini App participants sign in from, or null when Mini App sign-in is off. Absent
|
|
1789
1981
|
* from Relay versions without Telegram.
|
|
1790
1982
|
*/
|
|
1791
|
-
telegram:
|
|
1792
|
-
login:
|
|
1983
|
+
telegram: z15.object({
|
|
1984
|
+
login: z15.boolean(),
|
|
1793
1985
|
miniAppBotId: telegramBotIdSchema.nullable()
|
|
1794
1986
|
}).optional(),
|
|
1795
|
-
updatedAt:
|
|
1796
|
-
updatedBy:
|
|
1987
|
+
updatedAt: z15.number().nullable(),
|
|
1988
|
+
updatedBy: z15.string().nullable()
|
|
1797
1989
|
});
|
|
1798
|
-
var participantSignInInputSchema =
|
|
1990
|
+
var participantSignInInputSchema = z15.object({
|
|
1799
1991
|
wallets: walletSignInNetworksSchema,
|
|
1800
|
-
telegram:
|
|
1992
|
+
telegram: z15.object({ miniAppBotId: telegramBotIdSchema.nullable() }).strict().optional()
|
|
1801
1993
|
}).strict();
|
|
1802
|
-
var completionRevocationShortfallSchema =
|
|
1994
|
+
var completionRevocationShortfallSchema = z15.object({
|
|
1803
1995
|
completion: identifier,
|
|
1804
1996
|
quest: identifier,
|
|
1805
|
-
revokedAt:
|
|
1806
|
-
unreversedPoints:
|
|
1997
|
+
revokedAt: z15.number().int().nonnegative().safe(),
|
|
1998
|
+
unreversedPoints: z15.record(identifier, z15.number().int().positive().safe())
|
|
1807
1999
|
});
|
|
1808
|
-
var memberDetailSchema =
|
|
2000
|
+
var memberDetailSchema = z15.object({
|
|
1809
2001
|
snapshot: snapshotSchema,
|
|
1810
2002
|
member: memberSchema,
|
|
1811
2003
|
progress: memberProgressSchema,
|
|
1812
2004
|
/** Up to 25 revoked completions with an unreversed point remainder, newest first. */
|
|
1813
|
-
revocationShortfalls:
|
|
2005
|
+
revocationShortfalls: z15.array(completionRevocationShortfallSchema).default([]),
|
|
1814
2006
|
/** Current and historical campaign enrollment state, including inactive enrollments. */
|
|
1815
|
-
campaignEnrollments:
|
|
1816
|
-
passes:
|
|
1817
|
-
|
|
1818
|
-
provider:
|
|
1819
|
-
event:
|
|
1820
|
-
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(),
|
|
1821
2013
|
attempt: identifier.nullable()
|
|
1822
2014
|
})
|
|
1823
2015
|
).default([]),
|
|
1824
2016
|
/** Linked and unlinked wallets. */
|
|
1825
|
-
wallets:
|
|
2017
|
+
wallets: z15.array(managedWalletSchema),
|
|
1826
2018
|
/** The member's 10 most recent recorded balance reads, newest first. */
|
|
1827
|
-
balanceChecks:
|
|
2019
|
+
balanceChecks: z15.array(balanceCheckSchema),
|
|
1828
2020
|
/** The member's participant profile in this project. */
|
|
1829
2021
|
profile: managedProfileSchema.nullable(),
|
|
1830
2022
|
/**
|
|
@@ -1832,11 +2024,11 @@ var memberDetailSchema = z14.object({
|
|
|
1832
2024
|
* member ID: their selected X and Discord accounts and their `app:<name>` identities in this
|
|
1833
2025
|
* project, including app identities an operator unlinked, by kind.
|
|
1834
2026
|
*/
|
|
1835
|
-
identities:
|
|
2027
|
+
identities: z15.array(managedMemberIdentitySchema)
|
|
1836
2028
|
});
|
|
1837
|
-
var managedMemberProgressSchema =
|
|
2029
|
+
var managedMemberProgressSchema = z15.object({
|
|
1838
2030
|
member: identifier,
|
|
1839
|
-
quests:
|
|
2031
|
+
quests: z15.array(
|
|
1840
2032
|
memberProgressSchema.shape.quests.element.extend({
|
|
1841
2033
|
/** The streak as `members.get` reports it, without the list of qualifying days. */
|
|
1842
2034
|
streak: streakProgressSchema.omit({ days: true }).nullable().optional()
|
|
@@ -1847,152 +2039,152 @@ var managedMemberProgressSchema = z14.object({
|
|
|
1847
2039
|
/** Each point balance the member has, by balance ID. */
|
|
1848
2040
|
balances: snapshotSchema.shape.balances
|
|
1849
2041
|
});
|
|
1850
|
-
var stockInputSchema =
|
|
2042
|
+
var stockInputSchema = z15.object({
|
|
1851
2043
|
item: identifier,
|
|
1852
|
-
quantity:
|
|
2044
|
+
quantity: z15.number().int().positive().max(1e6),
|
|
1853
2045
|
actionId: identifier
|
|
1854
2046
|
}).strict();
|
|
1855
|
-
var ingestTrackerScopeSchema =
|
|
1856
|
-
var tokenScopeInputSchema =
|
|
1857
|
-
var tokenInputSchema =
|
|
1858
|
-
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),
|
|
1859
2051
|
project: identifier,
|
|
1860
2052
|
environment: environmentSchema,
|
|
1861
|
-
permissions:
|
|
2053
|
+
permissions: z15.array(permissionSchema).min(1),
|
|
1862
2054
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
1863
|
-
days:
|
|
2055
|
+
days: z15.number().int().min(1).max(90).default(30)
|
|
1864
2056
|
}).strict();
|
|
1865
|
-
var tokenSchema =
|
|
1866
|
-
id:
|
|
1867
|
-
name:
|
|
1868
|
-
project:
|
|
2057
|
+
var tokenSchema = z15.object({
|
|
2058
|
+
id: z15.string(),
|
|
2059
|
+
name: z15.string(),
|
|
2060
|
+
project: z15.string(),
|
|
1869
2061
|
environment: environmentSchema,
|
|
1870
2062
|
permissions: permissionListSchema,
|
|
1871
2063
|
ingestTrackers: ingestTrackerScopeSchema.optional(),
|
|
1872
|
-
expiresAt:
|
|
2064
|
+
expiresAt: z15.number()
|
|
1873
2065
|
});
|
|
1874
|
-
var issuedTokenSchema = tokenSchema.extend({ token:
|
|
1875
|
-
var serviceKeyInputSchema =
|
|
1876
|
-
name:
|
|
1877
|
-
permissions:
|
|
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(
|
|
1878
2070
|
(permissions) => !permissions.includes("access"),
|
|
1879
2071
|
"Service keys cannot hold the access permission"
|
|
1880
2072
|
),
|
|
1881
2073
|
/** Days until the first secret expires. Omit it for a key that never expires. */
|
|
1882
|
-
expiresInDays:
|
|
2074
|
+
expiresInDays: z15.number().int().min(1).max(3650).optional()
|
|
1883
2075
|
}).strict();
|
|
1884
|
-
var serviceKeySchema =
|
|
1885
|
-
id:
|
|
1886
|
-
organization:
|
|
1887
|
-
project:
|
|
2076
|
+
var serviceKeySchema = z15.object({
|
|
2077
|
+
id: z15.string().uuid(),
|
|
2078
|
+
organization: z15.string(),
|
|
2079
|
+
project: z15.string(),
|
|
1888
2080
|
environment: environmentSchema,
|
|
1889
|
-
name:
|
|
2081
|
+
name: z15.string(),
|
|
1890
2082
|
permissions: permissionListSchema,
|
|
1891
2083
|
/** The Clerk user ID of the administrator who created it. */
|
|
1892
|
-
createdBy:
|
|
1893
|
-
createdAt:
|
|
2084
|
+
createdBy: z15.string(),
|
|
2085
|
+
createdAt: z15.number(),
|
|
1894
2086
|
/** The latest use of any of its secrets, revoked ones included; null when none was used. */
|
|
1895
|
-
lastUsedAt:
|
|
2087
|
+
lastUsedAt: z15.number().nullable(),
|
|
1896
2088
|
/** Its working secrets, oldest first. Any of them authenticates the key. */
|
|
1897
|
-
secrets:
|
|
2089
|
+
secrets: z15.array(credentialSecretSchema)
|
|
1898
2090
|
});
|
|
1899
2091
|
var issuedServiceKeySchema = serviceKeySchema.extend({
|
|
1900
|
-
secret:
|
|
1901
|
-
token:
|
|
2092
|
+
secret: z15.string().uuid(),
|
|
2093
|
+
token: z15.string()
|
|
1902
2094
|
});
|
|
1903
|
-
var teamSchema =
|
|
1904
|
-
|
|
2095
|
+
var teamSchema = z15.array(
|
|
2096
|
+
z15.object({ id: z15.string(), label: z15.string() })
|
|
1905
2097
|
);
|
|
1906
|
-
var memberLookupSchema =
|
|
1907
|
-
provider:
|
|
1908
|
-
subject:
|
|
2098
|
+
var memberLookupSchema = z15.object({
|
|
2099
|
+
provider: z15.string().min(1).max(200),
|
|
2100
|
+
subject: z15.string().min(1).max(2048)
|
|
1909
2101
|
}).strict();
|
|
1910
|
-
var booleanQuery =
|
|
1911
|
-
|
|
1912
|
-
|
|
2102
|
+
var booleanQuery = z15.union([
|
|
2103
|
+
z15.boolean(),
|
|
2104
|
+
z15.enum(["true", "false"]).transform((v) => v === "true")
|
|
1913
2105
|
]);
|
|
1914
|
-
var managedMemberQuerySchema =
|
|
1915
|
-
q:
|
|
2106
|
+
var managedMemberQuerySchema = z15.strictObject({
|
|
2107
|
+
q: z15.string().max(200).optional(),
|
|
1916
2108
|
needsReview: booleanQuery.optional(),
|
|
1917
|
-
limit:
|
|
2109
|
+
limit: z15.coerce.number().int().min(1).max(100).optional(),
|
|
1918
2110
|
cursor: pageCursorSchema.optional()
|
|
1919
2111
|
});
|
|
1920
|
-
var managedMemberPageSchema =
|
|
1921
|
-
items:
|
|
1922
|
-
total:
|
|
1923
|
-
nextCursor:
|
|
2112
|
+
var managedMemberPageSchema = z15.object({
|
|
2113
|
+
items: z15.array(memberSchema),
|
|
2114
|
+
total: z15.number().int().nonnegative(),
|
|
2115
|
+
nextCursor: z15.string().nullable()
|
|
1924
2116
|
});
|
|
1925
2117
|
var projectMetricsSchema = metricsSchema.extend({
|
|
1926
|
-
completionsByQuest:
|
|
1927
|
-
|
|
2118
|
+
completionsByQuest: z15.array(
|
|
2119
|
+
z15.object({ quest: identifier, completions: z15.number() })
|
|
1928
2120
|
)
|
|
1929
2121
|
});
|
|
1930
|
-
var pageLimit =
|
|
1931
|
-
var managedAttemptQuerySchema =
|
|
1932
|
-
q:
|
|
1933
|
-
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(),
|
|
1934
2126
|
limit: pageLimit,
|
|
1935
2127
|
cursor: pageCursorSchema.optional()
|
|
1936
2128
|
});
|
|
1937
|
-
var managedAttemptPageSchema =
|
|
1938
|
-
items:
|
|
1939
|
-
releases:
|
|
1940
|
-
people:
|
|
1941
|
-
total:
|
|
1942
|
-
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()
|
|
1943
2135
|
});
|
|
1944
|
-
var managedReleaseQuerySchema =
|
|
2136
|
+
var managedReleaseQuerySchema = z15.strictObject({
|
|
1945
2137
|
quest: identifier.optional(),
|
|
1946
2138
|
limit: pageLimit,
|
|
1947
2139
|
cursor: pageCursorSchema.optional()
|
|
1948
2140
|
});
|
|
1949
|
-
var managedReleasePageSchema =
|
|
1950
|
-
items:
|
|
1951
|
-
nextCursor:
|
|
2141
|
+
var managedReleasePageSchema = z15.object({
|
|
2142
|
+
items: z15.array(publishedReleaseSchema),
|
|
2143
|
+
nextCursor: z15.string().nullable()
|
|
1952
2144
|
});
|
|
1953
|
-
var managedAttemptSchema =
|
|
2145
|
+
var managedAttemptSchema = z15.object({
|
|
1954
2146
|
attempt: attemptSchema,
|
|
1955
2147
|
release: publishedReleaseSchema.nullable(),
|
|
1956
|
-
events:
|
|
2148
|
+
events: z15.array(eventSchema),
|
|
1957
2149
|
person: personSchema
|
|
1958
2150
|
});
|
|
1959
|
-
var managedEntitlementQuerySchema =
|
|
1960
|
-
q:
|
|
1961
|
-
status:
|
|
2151
|
+
var managedEntitlementQuerySchema = z15.strictObject({
|
|
2152
|
+
q: z15.string().max(200).optional(),
|
|
2153
|
+
status: z15.string().min(1).max(50).optional(),
|
|
1962
2154
|
limit: pageLimit,
|
|
1963
2155
|
cursor: pageCursorSchema.optional()
|
|
1964
2156
|
});
|
|
1965
|
-
var managedEntitlementPageSchema =
|
|
1966
|
-
items:
|
|
1967
|
-
people:
|
|
1968
|
-
total:
|
|
1969
|
-
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()
|
|
1970
2162
|
});
|
|
1971
|
-
var managedEntitlementSchema =
|
|
2163
|
+
var managedEntitlementSchema = z15.object({
|
|
1972
2164
|
entitlement: entitlementSchema,
|
|
1973
2165
|
person: personSchema
|
|
1974
2166
|
});
|
|
1975
2167
|
var managedStockItemSchema = inventorySchema.extend({
|
|
1976
|
-
offers:
|
|
2168
|
+
offers: z15.array(identifier)
|
|
1977
2169
|
});
|
|
1978
|
-
var auditQuerySchema =
|
|
1979
|
-
category:
|
|
1980
|
-
q:
|
|
2170
|
+
var auditQuerySchema = z15.strictObject({
|
|
2171
|
+
category: z15.enum(["reviews", "rewards", "configuration"]).optional(),
|
|
2172
|
+
q: z15.string().max(200).optional(),
|
|
1981
2173
|
limit: pageLimit,
|
|
1982
2174
|
cursor: pageCursorSchema.optional()
|
|
1983
2175
|
});
|
|
1984
2176
|
var accessHistoryQuerySchema = auditQuerySchema.omit({
|
|
1985
2177
|
category: true
|
|
1986
2178
|
});
|
|
1987
|
-
var auditPageSchema =
|
|
1988
|
-
items:
|
|
1989
|
-
total:
|
|
1990
|
-
nextCursor:
|
|
2179
|
+
var auditPageSchema = z15.object({
|
|
2180
|
+
items: z15.array(auditRecordSchema),
|
|
2181
|
+
total: z15.number().int().nonnegative(),
|
|
2182
|
+
nextCursor: z15.string().nullable()
|
|
1991
2183
|
});
|
|
1992
|
-
var verifiedPassSchema =
|
|
2184
|
+
var verifiedPassSchema = z15.object({
|
|
1993
2185
|
provider: identifier,
|
|
1994
2186
|
event: identifier,
|
|
1995
|
-
subject:
|
|
2187
|
+
subject: z15.string().min(1).max(2048),
|
|
1996
2188
|
member: identifier,
|
|
1997
2189
|
quest: identifier
|
|
1998
2190
|
}).strict();
|
|
@@ -2016,7 +2208,7 @@ function clientFailure(error) {
|
|
|
2016
2208
|
return new ManagementError({
|
|
2017
2209
|
kind: "client",
|
|
2018
2210
|
code: ManagementErrorCode.InvalidInput,
|
|
2019
|
-
message: error instanceof
|
|
2211
|
+
message: error instanceof z15.ZodError ? `Invalid management request: ${z15.prettifyError(error)}` : error instanceof Error ? error.message : "Invalid management request",
|
|
2020
2212
|
cause: error
|
|
2021
2213
|
});
|
|
2022
2214
|
}
|
|
@@ -2054,7 +2246,7 @@ function managementClient(options) {
|
|
|
2054
2246
|
call
|
|
2055
2247
|
);
|
|
2056
2248
|
}
|
|
2057
|
-
const ok =
|
|
2249
|
+
const ok = z15.object({ ok: z15.literal(true) });
|
|
2058
2250
|
function pointHistory(member, ledger, query = {}, call) {
|
|
2059
2251
|
return get(
|
|
2060
2252
|
`/points/${identifier.parse(member)}/${identifier.parse(ledger)}/history${queryString(typeof query === "number" ? { before: query } : pageQuerySchema.parse(query))}`,
|
|
@@ -2139,7 +2331,7 @@ function managementClient(options) {
|
|
|
2139
2331
|
const input = isInput ? inputOrCall ?? {} : {};
|
|
2140
2332
|
const options2 = isInput ? call : inputOrCall;
|
|
2141
2333
|
return post(
|
|
2142
|
-
`/webhooks/${
|
|
2334
|
+
`/webhooks/${z15.string().uuid().parse(id)}/rotate-secret`,
|
|
2143
2335
|
webhookSecretSchema,
|
|
2144
2336
|
webhookRotateInputSchema.parse(withActionId(input)),
|
|
2145
2337
|
options2
|
|
@@ -2187,8 +2379,8 @@ function managementClient(options) {
|
|
|
2187
2379
|
}
|
|
2188
2380
|
return exchange(
|
|
2189
2381
|
path,
|
|
2190
|
-
|
|
2191
|
-
status:
|
|
2382
|
+
z15.object({
|
|
2383
|
+
status: z15.number(),
|
|
2192
2384
|
operationId: identifier.optional(),
|
|
2193
2385
|
result: schema
|
|
2194
2386
|
}),
|
|
@@ -2219,7 +2411,7 @@ function managementClient(options) {
|
|
|
2219
2411
|
call
|
|
2220
2412
|
),
|
|
2221
2413
|
...resourceArchiveMethods("tracker"),
|
|
2222
|
-
list: (call) => get("/trackers",
|
|
2414
|
+
list: (call) => get("/trackers", z15.array(trackerStatusSchema), call),
|
|
2223
2415
|
get: (reference, call) => get(
|
|
2224
2416
|
`/trackers/${identifier.parse(reference)}`,
|
|
2225
2417
|
trackerStatusSchema,
|
|
@@ -2335,7 +2527,7 @@ function managementClient(options) {
|
|
|
2335
2527
|
engagementPublishSchema.parse(withActionId(input)),
|
|
2336
2528
|
call
|
|
2337
2529
|
),
|
|
2338
|
-
list: (call) => get("/engagement",
|
|
2530
|
+
list: (call) => get("/engagement", z15.array(engagementRuleSchema), call),
|
|
2339
2531
|
page: (input, call) => get(
|
|
2340
2532
|
"/engagement/history" + queryString(engagementPageQuerySchema.parse(input)),
|
|
2341
2533
|
engagementPageSchema,
|
|
@@ -2355,7 +2547,7 @@ function managementClient(options) {
|
|
|
2355
2547
|
)
|
|
2356
2548
|
},
|
|
2357
2549
|
badges: {
|
|
2358
|
-
list: (call) => get("/badges",
|
|
2550
|
+
list: (call) => get("/badges", z15.array(managedBadgeSchema), call),
|
|
2359
2551
|
create: (input, call) => create("/badges", managedBadgeSchema, createBadgeSchema, input, call),
|
|
2360
2552
|
update: (badge, input, call) => {
|
|
2361
2553
|
const body = badgePropertiesSchema.extend(badgeMutationSchema.shape).parse(withActionId(input));
|
|
@@ -2398,7 +2590,7 @@ function managementClient(options) {
|
|
|
2398
2590
|
},
|
|
2399
2591
|
pointLedgers: {
|
|
2400
2592
|
unarchive: (ledger, input, call) => archiveResource("point-ledger", ledger, false, input, call),
|
|
2401
|
-
list: (call) => get("/point-ledgers",
|
|
2593
|
+
list: (call) => get("/point-ledgers", z15.array(managedPointLedgerSchema), call),
|
|
2402
2594
|
/**
|
|
2403
2595
|
* Creates a point ledger, with a stable `key` when code refers to it; requires `publish`. In
|
|
2404
2596
|
* live, only a person in Console can create one.
|
|
@@ -2428,7 +2620,7 @@ function managementClient(options) {
|
|
|
2428
2620
|
},
|
|
2429
2621
|
points: {
|
|
2430
2622
|
/** @deprecated Use `pointLedgers.list()`, which reads the same ledgers. Removed in 2.0.0. */
|
|
2431
|
-
ledgers: (call) => get("/point-ledgers",
|
|
2623
|
+
ledgers: (call) => get("/point-ledgers", z15.array(managedPointLedgerSchema), call),
|
|
2432
2624
|
/** @deprecated Use `pointLedgers.create(input)`. Removed in 2.0.0. */
|
|
2433
2625
|
createLedger: createPointLedger,
|
|
2434
2626
|
/**
|
|
@@ -2466,7 +2658,7 @@ function managementClient(options) {
|
|
|
2466
2658
|
referralHistorySchema,
|
|
2467
2659
|
call
|
|
2468
2660
|
),
|
|
2469
|
-
list: (call) => get("/referrals",
|
|
2661
|
+
list: (call) => get("/referrals", z15.array(publishedReferralSchema), call),
|
|
2470
2662
|
participants: referralParticipants,
|
|
2471
2663
|
/**
|
|
2472
2664
|
* Suspends or restores a member's referral relationship, with a reason; requires `publish`.
|
|
@@ -2529,7 +2721,7 @@ function managementClient(options) {
|
|
|
2529
2721
|
},
|
|
2530
2722
|
leaderboards: {
|
|
2531
2723
|
...resourceArchiveMethods("leaderboard"),
|
|
2532
|
-
list: (call) => get("/leaderboards",
|
|
2724
|
+
list: (call) => get("/leaderboards", z15.array(publishedLeaderboardSchema), call),
|
|
2533
2725
|
standings: (board, input = {}, call) => {
|
|
2534
2726
|
const query = leaderboardQuerySchema.parse(input);
|
|
2535
2727
|
return get(
|
|
@@ -2543,13 +2735,13 @@ function managementClient(options) {
|
|
|
2543
2735
|
},
|
|
2544
2736
|
history: (board, call) => get(
|
|
2545
2737
|
`/leaderboards/${identifier.parse(board)}/history`,
|
|
2546
|
-
|
|
2738
|
+
z15.array(publishedLeaderboardSchema),
|
|
2547
2739
|
call
|
|
2548
2740
|
),
|
|
2549
2741
|
/** Current members of the board's exclusion group (`exclusionGroup`), by member ID. */
|
|
2550
2742
|
exclusions: (board, call) => get(
|
|
2551
2743
|
`/leaderboards/${identifier.parse(board)}/exclusions`,
|
|
2552
|
-
|
|
2744
|
+
z15.array(z15.object({ member: identifier })),
|
|
2553
2745
|
call
|
|
2554
2746
|
),
|
|
2555
2747
|
/**
|
|
@@ -2614,7 +2806,7 @@ function managementClient(options) {
|
|
|
2614
2806
|
),
|
|
2615
2807
|
settlements: (board, call) => get(
|
|
2616
2808
|
`/leaderboards/${identifier.parse(board)}/settlements`,
|
|
2617
|
-
|
|
2809
|
+
z15.array(leaderboardSettlementSummarySchema),
|
|
2618
2810
|
call
|
|
2619
2811
|
),
|
|
2620
2812
|
settlement: (settlement, call) => get(
|
|
@@ -2699,7 +2891,7 @@ function managementClient(options) {
|
|
|
2699
2891
|
*
|
|
2700
2892
|
* @deprecated Use `history`, which pages by `cursor` and `nextCursor`. Removed in 2.0.0.
|
|
2701
2893
|
*/
|
|
2702
|
-
list: (call) => get("/deployments",
|
|
2894
|
+
list: (call) => get("/deployments", z15.array(deploymentRecordSchema), call),
|
|
2703
2895
|
/**
|
|
2704
2896
|
* The project environment's deployments, newest first, one page at a time, with the two
|
|
2705
2897
|
* newest published deployments beside every page. Pass a page's `nextCursor` back as
|
|
@@ -2978,7 +3170,7 @@ function managementClient(options) {
|
|
|
2978
3170
|
},
|
|
2979
3171
|
operations: {
|
|
2980
3172
|
/** Every paused or resumed operation: redemptions and each quest's participation; requires `read`. */
|
|
2981
|
-
list: (call) => get("/operations",
|
|
3173
|
+
list: (call) => get("/operations", z15.array(operationSchema), call),
|
|
2982
3174
|
/**
|
|
2983
3175
|
* Pauses or resumes redemptions or one quest's participation, against the `revision` the
|
|
2984
3176
|
* operator saw, with a reason; requires `publish` permission.
|
|
@@ -3036,7 +3228,7 @@ function managementClient(options) {
|
|
|
3036
3228
|
call
|
|
3037
3229
|
),
|
|
3038
3230
|
/** Every stock item with its counts and the offers that sell it; requires `read` permission. */
|
|
3039
|
-
list: (call) => get("/stock-items",
|
|
3231
|
+
list: (call) => get("/stock-items", z15.array(managedStockItemSchema), call),
|
|
3040
3232
|
createItem: (input, call) => create(
|
|
3041
3233
|
"/stock-items",
|
|
3042
3234
|
stockItemSchema,
|
|
@@ -3051,7 +3243,7 @@ function managementClient(options) {
|
|
|
3051
3243
|
stockInputSchema.parse(withActionId(input)),
|
|
3052
3244
|
call
|
|
3053
3245
|
),
|
|
3054
|
-
catalog: (call) => get("/pickup-inventory",
|
|
3246
|
+
catalog: (call) => get("/pickup-inventory", z15.array(pickupCatalogSchema), call),
|
|
3055
3247
|
configure: (input, call) => post(
|
|
3056
3248
|
"/pickup-inventory",
|
|
3057
3249
|
pickupCatalogSchema,
|
|
@@ -3077,7 +3269,7 @@ function managementClient(options) {
|
|
|
3077
3269
|
offerControlSchema.omit({ enabled: true }).parse(withActionId(input)),
|
|
3078
3270
|
call
|
|
3079
3271
|
),
|
|
3080
|
-
list: (call) => get("/offers",
|
|
3272
|
+
list: (call) => get("/offers", z15.array(offerSchema), call),
|
|
3081
3273
|
/**
|
|
3082
3274
|
* Every redemption, or one member's, newest first, in one unbounded response.
|
|
3083
3275
|
*
|
|
@@ -3085,7 +3277,7 @@ function managementClient(options) {
|
|
|
3085
3277
|
*/
|
|
3086
3278
|
redemptions: (input = {}, call) => get(
|
|
3087
3279
|
`/redemptions${queryString({ member: input.member })}`,
|
|
3088
|
-
|
|
3280
|
+
z15.array(redemptionSchema),
|
|
3089
3281
|
call
|
|
3090
3282
|
),
|
|
3091
3283
|
/** Pauses or resumes an offer at the revision the operator saw. */
|
|
@@ -3134,7 +3326,7 @@ function managementClient(options) {
|
|
|
3134
3326
|
* them; API keys and project-scoped playground sessions cannot.
|
|
3135
3327
|
*/
|
|
3136
3328
|
tokens: {
|
|
3137
|
-
list: (call) => get("/tokens",
|
|
3329
|
+
list: (call) => get("/tokens", z15.array(tokenSchema), call),
|
|
3138
3330
|
/**
|
|
3139
3331
|
* Issues a key for one project and environment, limited to permissions the caller holds
|
|
3140
3332
|
* there. The secret `token` is in this response only.
|
|
@@ -3142,14 +3334,14 @@ function managementClient(options) {
|
|
|
3142
3334
|
create: (input, call) => post("/tokens", issuedTokenSchema, tokenInputSchema.parse(input), call),
|
|
3143
3335
|
/** Replace a personal key's ingestion restriction without changing its secret. */
|
|
3144
3336
|
scope: (id, input, call) => request(
|
|
3145
|
-
`/tokens/${encodeURIComponent(
|
|
3337
|
+
`/tokens/${encodeURIComponent(z15.string().min(1).parse(id))}/scope`,
|
|
3146
3338
|
tokenSchema,
|
|
3147
3339
|
tokenScopeInputSchema.parse(input),
|
|
3148
3340
|
"PUT",
|
|
3149
3341
|
call
|
|
3150
3342
|
),
|
|
3151
3343
|
revoke: (id, call) => request(
|
|
3152
|
-
`/tokens/${encodeURIComponent(
|
|
3344
|
+
`/tokens/${encodeURIComponent(z15.string().min(1).parse(id))}`,
|
|
3153
3345
|
ok,
|
|
3154
3346
|
void 0,
|
|
3155
3347
|
"DELETE",
|
|
@@ -3161,7 +3353,7 @@ function managementClient(options) {
|
|
|
3161
3353
|
* environment, owned by no person. Only an organization administrator in Console manages them.
|
|
3162
3354
|
*/
|
|
3163
3355
|
serviceKeys: {
|
|
3164
|
-
list: (call) => get("/service-keys",
|
|
3356
|
+
list: (call) => get("/service-keys", z15.array(serviceKeySchema), call),
|
|
3165
3357
|
/** The secret `token` is in this response only. */
|
|
3166
3358
|
create: (input, call) => post(
|
|
3167
3359
|
"/service-keys",
|
|
@@ -3174,14 +3366,14 @@ function managementClient(options) {
|
|
|
3174
3366
|
* them with `revokeSecret`. The new `token` is in this response only.
|
|
3175
3367
|
*/
|
|
3176
3368
|
addSecret: (id, input = {}, call) => post(
|
|
3177
|
-
`/service-keys/${
|
|
3369
|
+
`/service-keys/${z15.string().uuid().parse(id)}/secrets`,
|
|
3178
3370
|
issuedServiceKeySchema,
|
|
3179
3371
|
credentialSecretInputSchema.parse(input),
|
|
3180
3372
|
call
|
|
3181
3373
|
),
|
|
3182
3374
|
/** Stops one secret working. A key's last secret cannot be revoked; revoke the key instead. */
|
|
3183
3375
|
revokeSecret: (id, secret, call) => request(
|
|
3184
|
-
`/service-keys/${
|
|
3376
|
+
`/service-keys/${z15.string().uuid().parse(id)}/secrets/${z15.string().uuid().parse(secret)}`,
|
|
3185
3377
|
serviceKeySchema,
|
|
3186
3378
|
void 0,
|
|
3187
3379
|
"DELETE",
|
|
@@ -3189,8 +3381,8 @@ function managementClient(options) {
|
|
|
3189
3381
|
),
|
|
3190
3382
|
/** Deletes the key; every secret stops working. */
|
|
3191
3383
|
revoke: (id, call) => request(
|
|
3192
|
-
`/service-keys/${
|
|
3193
|
-
|
|
3384
|
+
`/service-keys/${z15.string().uuid().parse(id)}`,
|
|
3385
|
+
z15.null(),
|
|
3194
3386
|
void 0,
|
|
3195
3387
|
"DELETE",
|
|
3196
3388
|
call
|
|
@@ -3198,7 +3390,7 @@ function managementClient(options) {
|
|
|
3198
3390
|
},
|
|
3199
3391
|
/** Who holds which roles on the client's project; organization administrators only. */
|
|
3200
3392
|
grants: {
|
|
3201
|
-
list: (call) => get("/grants",
|
|
3393
|
+
list: (call) => get("/grants", z15.array(grantRecordSchema), call),
|
|
3202
3394
|
/** Replaces one person's roles and environments on the project. The audit log records it. */
|
|
3203
3395
|
set: (input, call) => request(
|
|
3204
3396
|
"/grants",
|
|
@@ -3215,7 +3407,7 @@ function managementClient(options) {
|
|
|
3215
3407
|
/** Signed activity notifications for one project/environment; writes require publish permission. */
|
|
3216
3408
|
webhooks: {
|
|
3217
3409
|
state: (id, call) => get(
|
|
3218
|
-
`/webhooks/${
|
|
3410
|
+
`/webhooks/${z15.string().uuid().parse(id)}/state`,
|
|
3219
3411
|
webhookEndpointStateSchema,
|
|
3220
3412
|
call
|
|
3221
3413
|
),
|
|
@@ -3226,24 +3418,24 @@ function managementClient(options) {
|
|
|
3226
3418
|
call
|
|
3227
3419
|
),
|
|
3228
3420
|
delete: (id, input, call) => post(
|
|
3229
|
-
`/webhooks/${
|
|
3421
|
+
`/webhooks/${z15.string().uuid().parse(id)}/delete`,
|
|
3230
3422
|
webhookEndpointStateSchema,
|
|
3231
3423
|
webhookDeleteInputSchema.parse(withActionId(input)),
|
|
3232
3424
|
call
|
|
3233
3425
|
),
|
|
3234
3426
|
pause: (id, input = {}, call) => post(
|
|
3235
|
-
`/webhooks/${
|
|
3427
|
+
`/webhooks/${z15.string().uuid().parse(id)}/pause`,
|
|
3236
3428
|
webhookEndpointSchema,
|
|
3237
3429
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
3238
3430
|
call
|
|
3239
3431
|
),
|
|
3240
3432
|
resume: (id, input = {}, call) => post(
|
|
3241
|
-
`/webhooks/${
|
|
3433
|
+
`/webhooks/${z15.string().uuid().parse(id)}/resume`,
|
|
3242
3434
|
webhookEndpointSchema,
|
|
3243
3435
|
webhookControlInputSchema.parse(withActionId(input)),
|
|
3244
3436
|
call
|
|
3245
3437
|
),
|
|
3246
|
-
list: (call) => get("/webhooks",
|
|
3438
|
+
list: (call) => get("/webhooks", z15.array(webhookEndpointSchema), call),
|
|
3247
3439
|
/** Pass an `actionId` to recover the endpoint and its secret after a lost answer. */
|
|
3248
3440
|
create: (input, call) => post(
|
|
3249
3441
|
"/webhooks",
|
|
@@ -3252,7 +3444,7 @@ function managementClient(options) {
|
|
|
3252
3444
|
call
|
|
3253
3445
|
),
|
|
3254
3446
|
update: (id, input, call) => request(
|
|
3255
|
-
`/webhooks/${
|
|
3447
|
+
`/webhooks/${z15.string().uuid().parse(id)}`,
|
|
3256
3448
|
webhookEndpointSchema,
|
|
3257
3449
|
webhookUpdateSchema.parse(input),
|
|
3258
3450
|
"PUT",
|
|
@@ -3260,19 +3452,19 @@ function managementClient(options) {
|
|
|
3260
3452
|
),
|
|
3261
3453
|
/** @deprecated Use pause. Removed in 2.0.0. */
|
|
3262
3454
|
disable: (id, call) => post(
|
|
3263
|
-
`/webhooks/${
|
|
3455
|
+
`/webhooks/${z15.string().uuid().parse(id)}/disable`,
|
|
3264
3456
|
webhookEndpointSchema,
|
|
3265
3457
|
{},
|
|
3266
3458
|
call
|
|
3267
3459
|
),
|
|
3268
3460
|
rotateSecret: rotateWebhookSecret,
|
|
3269
3461
|
deliveries: (id, query = {}, call) => get(
|
|
3270
|
-
`/webhooks/${
|
|
3462
|
+
`/webhooks/${z15.string().uuid().parse(id)}/deliveries${queryString(webhookQuerySchema.parse(query))}`,
|
|
3271
3463
|
webhookDeliveryPageSchema,
|
|
3272
3464
|
call
|
|
3273
3465
|
),
|
|
3274
3466
|
replay: (id, delivery, call) => post(
|
|
3275
|
-
`/webhooks/${
|
|
3467
|
+
`/webhooks/${z15.string().uuid().parse(id)}/deliveries/${z15.string().uuid().parse(delivery)}/replay`,
|
|
3276
3468
|
webhookDeliverySchema,
|
|
3277
3469
|
{},
|
|
3278
3470
|
call
|
|
@@ -3283,7 +3475,7 @@ function managementClient(options) {
|
|
|
3283
3475
|
* environment. Organization administrators, from a Console session only.
|
|
3284
3476
|
*/
|
|
3285
3477
|
identityIntegrations: {
|
|
3286
|
-
list: (call) => get("/identity-integrations",
|
|
3478
|
+
list: (call) => get("/identity-integrations", z15.array(identityIntegrationSchema), call),
|
|
3287
3479
|
/** The secret `token` is in this response only. */
|
|
3288
3480
|
create: (input, call) => post(
|
|
3289
3481
|
"/identity-integrations",
|
|
@@ -3298,7 +3490,7 @@ function managementClient(options) {
|
|
|
3298
3490
|
* @deprecated Use `addSecret`, then `revokeSecret` the old secret once your app uses the new one.
|
|
3299
3491
|
*/
|
|
3300
3492
|
rotate: (id, call) => post(
|
|
3301
|
-
`/identity-integrations/${
|
|
3493
|
+
`/identity-integrations/${z15.string().uuid().parse(id)}/rotate`,
|
|
3302
3494
|
identityIntegrationSecretSchema,
|
|
3303
3495
|
{},
|
|
3304
3496
|
call
|
|
@@ -3308,7 +3500,7 @@ function managementClient(options) {
|
|
|
3308
3500
|
* revoke them with `revokeSecret`. The new `token` is in this response only.
|
|
3309
3501
|
*/
|
|
3310
3502
|
addSecret: (id, input = {}, call) => post(
|
|
3311
|
-
`/identity-integrations/${
|
|
3503
|
+
`/identity-integrations/${z15.string().uuid().parse(id)}/secrets`,
|
|
3312
3504
|
identityIntegrationSecretSchema,
|
|
3313
3505
|
credentialSecretInputSchema.parse(input),
|
|
3314
3506
|
call
|
|
@@ -3318,7 +3510,7 @@ function managementClient(options) {
|
|
|
3318
3510
|
* revoked; disconnect the integration with `revoke` instead.
|
|
3319
3511
|
*/
|
|
3320
3512
|
revokeSecret: (id, secret, call) => request(
|
|
3321
|
-
`/identity-integrations/${
|
|
3513
|
+
`/identity-integrations/${z15.string().uuid().parse(id)}/secrets/${z15.string().uuid().parse(secret)}`,
|
|
3322
3514
|
identityIntegrationSchema,
|
|
3323
3515
|
void 0,
|
|
3324
3516
|
"DELETE",
|
|
@@ -3326,7 +3518,7 @@ function managementClient(options) {
|
|
|
3326
3518
|
),
|
|
3327
3519
|
/** Makes one secret never expire. */
|
|
3328
3520
|
removeSecretExpiry: (id, secret, call) => request(
|
|
3329
|
-
`/identity-integrations/${
|
|
3521
|
+
`/identity-integrations/${z15.string().uuid().parse(id)}/secrets/${z15.string().uuid().parse(secret)}/expiry`,
|
|
3330
3522
|
identityIntegrationSchema,
|
|
3331
3523
|
void 0,
|
|
3332
3524
|
"DELETE",
|
|
@@ -3339,7 +3531,7 @@ function managementClient(options) {
|
|
|
3339
3531
|
*/
|
|
3340
3532
|
kinds: (call) => get(
|
|
3341
3533
|
"/identity-integrations/kinds",
|
|
3342
|
-
|
|
3534
|
+
z15.array(identityKindClaimSchema),
|
|
3343
3535
|
call
|
|
3344
3536
|
),
|
|
3345
3537
|
/**
|
|
@@ -3347,8 +3539,8 @@ function managementClient(options) {
|
|
|
3347
3539
|
* and keep attributing tracker records; unlink them on the member to stop that.
|
|
3348
3540
|
*/
|
|
3349
3541
|
revoke: (id, call) => request(
|
|
3350
|
-
`/identity-integrations/${
|
|
3351
|
-
|
|
3542
|
+
`/identity-integrations/${z15.string().uuid().parse(id)}`,
|
|
3543
|
+
z15.null(),
|
|
3352
3544
|
void 0,
|
|
3353
3545
|
"DELETE",
|
|
3354
3546
|
call
|
|
@@ -3399,7 +3591,7 @@ function managementClient(options) {
|
|
|
3399
3591
|
resources: {
|
|
3400
3592
|
list: (call) => get(
|
|
3401
3593
|
"/resources",
|
|
3402
|
-
|
|
3594
|
+
z15.object({ resources: z15.array(managedResourceSchema) }),
|
|
3403
3595
|
call
|
|
3404
3596
|
),
|
|
3405
3597
|
/** @deprecated Use the resource archive/unarchive methods. Removed in 2.0.0. */
|
|
@@ -3469,7 +3661,7 @@ function managementClient(options) {
|
|
|
3469
3661
|
testMemberCreateSchema.parse(withActionId(input)),
|
|
3470
3662
|
call
|
|
3471
3663
|
),
|
|
3472
|
-
list: (call) => get("/test-members",
|
|
3664
|
+
list: (call) => get("/test-members", z15.array(testMemberSchema), call),
|
|
3473
3665
|
history: (member, query = {}, call) => get(
|
|
3474
3666
|
`/test-members/${identifier.parse(member)}/history${queryString(testMemberHistoryQuerySchema.parse(query))}`,
|
|
3475
3667
|
testMemberHistorySchema,
|
|
@@ -3512,6 +3704,68 @@ function managementClient(options) {
|
|
|
3512
3704
|
call
|
|
3513
3705
|
)
|
|
3514
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
|
+
},
|
|
3515
3769
|
/** The project's members, as operators see them. */
|
|
3516
3770
|
members: {
|
|
3517
3771
|
/**
|
|
@@ -3625,7 +3879,7 @@ function managementClient(options) {
|
|
|
3625
3879
|
/** Who each member is: up to 100 distinct IDs; unknown IDs come back without accounts. */
|
|
3626
3880
|
people: (members, call) => get(
|
|
3627
3881
|
`/people${queryString({ ids: members.join(",") })}`,
|
|
3628
|
-
|
|
3882
|
+
z15.array(personSchema),
|
|
3629
3883
|
call
|
|
3630
3884
|
),
|
|
3631
3885
|
/**
|
|
@@ -3635,7 +3889,7 @@ function managementClient(options) {
|
|
|
3635
3889
|
*/
|
|
3636
3890
|
oauthAccounts: (member, call) => get(
|
|
3637
3891
|
`/members/${encodeURIComponent(member)}/oauth-accounts`,
|
|
3638
|
-
|
|
3892
|
+
z15.array(managedOAuthAccountSchema),
|
|
3639
3893
|
call
|
|
3640
3894
|
),
|
|
3641
3895
|
/**
|
|
@@ -3645,7 +3899,7 @@ function managementClient(options) {
|
|
|
3645
3899
|
*/
|
|
3646
3900
|
unlinkOAuthAccount: (member, input, call) => post(
|
|
3647
3901
|
`/members/${encodeURIComponent(member)}/oauth-accounts/unlink`,
|
|
3648
|
-
|
|
3902
|
+
z15.array(managedOAuthAccountSchema),
|
|
3649
3903
|
memberOAuthUnlinkInputSchema.parse(input),
|
|
3650
3904
|
call
|
|
3651
3905
|
),
|
|
@@ -3678,7 +3932,7 @@ function managementClient(options) {
|
|
|
3678
3932
|
*/
|
|
3679
3933
|
unlinkWallet: (member, input, call) => post(
|
|
3680
3934
|
`/members/${encodeURIComponent(member)}/wallets/unlink`,
|
|
3681
|
-
|
|
3935
|
+
z15.array(managedWalletSchema),
|
|
3682
3936
|
memberWalletUnlinkInputSchema.parse(input),
|
|
3683
3937
|
call
|
|
3684
3938
|
),
|
|
@@ -3691,7 +3945,7 @@ function managementClient(options) {
|
|
|
3691
3945
|
*/
|
|
3692
3946
|
unlinkIdentity: (member, input, call) => post(
|
|
3693
3947
|
`/members/${encodeURIComponent(member)}/identities/unlink`,
|
|
3694
|
-
|
|
3948
|
+
z15.array(managedMemberIdentitySchema),
|
|
3695
3949
|
memberIdentityChangeInputSchema.parse(input),
|
|
3696
3950
|
call
|
|
3697
3951
|
),
|
|
@@ -3702,7 +3956,7 @@ function managementClient(options) {
|
|
|
3702
3956
|
*/
|
|
3703
3957
|
relinkIdentity: (member, input, call) => post(
|
|
3704
3958
|
`/members/${encodeURIComponent(member)}/identities/relink`,
|
|
3705
|
-
|
|
3959
|
+
z15.array(managedMemberIdentitySchema),
|
|
3706
3960
|
memberIdentityChangeInputSchema.parse(input),
|
|
3707
3961
|
call
|
|
3708
3962
|
),
|
|
@@ -3714,7 +3968,7 @@ function managementClient(options) {
|
|
|
3714
3968
|
*/
|
|
3715
3969
|
setWalletSignIn: (member, input, call) => post(
|
|
3716
3970
|
`/members/${encodeURIComponent(member)}/wallets/sign-in`,
|
|
3717
|
-
|
|
3971
|
+
z15.array(managedWalletSchema),
|
|
3718
3972
|
memberWalletSignInInputSchema.parse(input),
|
|
3719
3973
|
call
|
|
3720
3974
|
)
|
|
@@ -3886,7 +4140,7 @@ function managementClient(options) {
|
|
|
3886
4140
|
* Each quest's current release, the most recently published first, archived quests
|
|
3887
4141
|
* included; requires `read` permission.
|
|
3888
4142
|
*/
|
|
3889
|
-
list: (call) => get("/quests/list",
|
|
4143
|
+
list: (call) => get("/quests/list", z15.array(publishedReleaseSchema), call),
|
|
3890
4144
|
/** Pending and exhausted asynchronous balance checks. Requires read. */
|
|
3891
4145
|
automaticScheduling: (query = {}, call) => get(
|
|
3892
4146
|
`/quests/automatic-scheduling${queryString(automaticSchedulingQuerySchema.parse(query))}`,
|
|
@@ -3931,7 +4185,7 @@ function managementClient(options) {
|
|
|
3931
4185
|
*/
|
|
3932
4186
|
submissions: (member, call) => get(
|
|
3933
4187
|
`/members/${encodeURIComponent(member)}/quest-submissions`,
|
|
3934
|
-
|
|
4188
|
+
z15.object({ items: z15.array(questSubmissionSchema) }),
|
|
3935
4189
|
call
|
|
3936
4190
|
),
|
|
3937
4191
|
/**
|
|
@@ -4277,6 +4531,15 @@ var managementResponseSchemas = lazyResponseReaders({
|
|
|
4277
4531
|
get managedMemberProgressSchema() {
|
|
4278
4532
|
return knownResponse(managedMemberProgressSchema);
|
|
4279
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
|
+
},
|
|
4280
4543
|
get managedOAuthAccountSchema() {
|
|
4281
4544
|
return knownResponse(managedOAuthAccountSchema);
|
|
4282
4545
|
},
|
|
@@ -4566,6 +4829,9 @@ var managementResponses = {
|
|
|
4566
4829
|
managedMemberIdentitySchema: responseSchema(managedMemberIdentitySchema),
|
|
4567
4830
|
managedMemberPageSchema: responseSchema(managedMemberPageSchema),
|
|
4568
4831
|
managedMemberProgressSchema: responseSchema(managedMemberProgressSchema),
|
|
4832
|
+
memberImportPageSchema: responseSchema(memberImportPageSchema),
|
|
4833
|
+
memberImportRowPageSchema: responseSchema(memberImportRowPageSchema),
|
|
4834
|
+
memberImportSchema: responseSchema(memberImportSchema),
|
|
4569
4835
|
managedOAuthAccountSchema: responseSchema(managedOAuthAccountSchema),
|
|
4570
4836
|
managedTelegramAccountSchema: responseSchema(managedTelegramAccountSchema),
|
|
4571
4837
|
telegramChatsSchema: responseSchema(telegramChatsSchema),
|
|
@@ -4650,6 +4916,7 @@ export {
|
|
|
4650
4916
|
DEFAULT_MANAGEMENT_TIMEOUT,
|
|
4651
4917
|
ManagementError,
|
|
4652
4918
|
ManagementErrorCode,
|
|
4919
|
+
MemberImportRefusalCode,
|
|
4653
4920
|
PayoutSourceKind,
|
|
4654
4921
|
REFERRAL_INTEGRATION_REWARD_ERROR,
|
|
4655
4922
|
RevokedDeliveryOutcome,
|
|
@@ -4793,6 +5060,20 @@ export {
|
|
|
4793
5060
|
memberIdentitySignInInputSchema,
|
|
4794
5061
|
memberIdentityStatePageSchema,
|
|
4795
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,
|
|
4796
5077
|
memberLookupSchema,
|
|
4797
5078
|
memberOAuthUnlinkInputSchema,
|
|
4798
5079
|
memberSchema,
|