@domino-sdk/relay 1.0.0-next.13 → 1.0.0-next.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/authoring.d.ts +58 -44
- package/dist/authoring.js +58 -45
- package/dist/browser.d.ts +111 -151
- package/dist/browser.js +6 -6
- package/dist/{catalog-C85V1NgW.d.ts → catalog-CVXUHxiO.d.ts} +12 -99
- package/dist/{chunk-M64XHC42.js → chunk-76F4LSFP.js} +2 -2
- package/dist/{chunk-II7DRZSL.js → chunk-CYD6QMHU.js} +1 -1
- package/dist/{chunk-KS33GOUL.js → chunk-EJWDAF7I.js} +4 -4
- package/dist/chunk-FJ6O44NE.js +51 -0
- package/dist/{chunk-WQ24ILGO.js → chunk-G3YSBMJH.js} +7 -3
- package/dist/{chunk-MNQI35OG.js → chunk-HWRBLM7E.js} +3 -3
- package/dist/{chunk-CRNQP7NV.js → chunk-J4OYDYJE.js} +693 -676
- package/dist/{chunk-OA2KMQVZ.js → chunk-J52HD4AA.js} +11 -1
- package/dist/{chunk-EZWNGI5B.js → chunk-RCBJBFLC.js} +4 -4
- package/dist/{chunk-FXYJ4OMX.js → chunk-WMTROSYF.js} +1 -1
- package/dist/{client-Bf9PNUIi.d.ts → client-dfXT6hhq.d.ts} +7 -47
- package/dist/{deployments-CNCP0JnD.d.ts → deployments-C9wkQ06n.d.ts} +109 -125
- package/dist/{images-BG4pdO4y.d.ts → images-CRxHUuG5.d.ts} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +5 -5
- package/dist/{integrations-EjQzIApL.d.ts → integrations-C1vB6Ry6.d.ts} +93 -1
- package/dist/internal.d.ts +13 -4
- package/dist/internal.js +10 -4
- package/dist/portal-proxy.js +2 -2
- package/dist/react/index.d.ts +441 -655
- package/dist/react/index.js +1190 -810
- package/dist/{schema-BF_TQsmT.d.ts → schema-C4F2K9cm.d.ts} +9 -74
- package/dist/schema.d.ts +6 -7
- package/dist/schema.js +18 -16
- package/dist/server/index.d.ts +125 -233
- package/dist/server/index.js +16 -22
- package/dist/{trackers-W7nRdRr7.d.ts → trackers-7lxSWp2g.d.ts} +56 -14
- package/package.json +4 -2
- package/dist/observations-CQ6IcNuQ.d.ts +0 -90
|
@@ -34,19 +34,63 @@ var pageQuerySchema = z3.strictObject({
|
|
|
34
34
|
cursor: pageCursorSchema.optional()
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
// src/
|
|
37
|
+
// src/discord.ts
|
|
38
38
|
import { z as z4 } from "zod";
|
|
39
|
+
var discordMessageSchema = z4.object({
|
|
40
|
+
guildId: z4.string(),
|
|
41
|
+
channelId: z4.string(),
|
|
42
|
+
messageId: z4.string(),
|
|
43
|
+
userId: z4.string(),
|
|
44
|
+
content: z4.string().nullable(),
|
|
45
|
+
replyTo: z4.string().nullable(),
|
|
46
|
+
publishedAt: z4.number()
|
|
47
|
+
}).strict();
|
|
48
|
+
var discordMessagesSourceSchema = z4.strictObject({
|
|
49
|
+
kind: z4.literal("discord-messages"),
|
|
50
|
+
/** Store each message's text in `data.text`. Off unless set. */
|
|
51
|
+
text: z4.boolean().optional()
|
|
52
|
+
});
|
|
53
|
+
var discordReactionsSourceSchema = z4.strictObject({
|
|
54
|
+
kind: z4.literal("discord-reactions")
|
|
55
|
+
});
|
|
56
|
+
var discordMessageDataSchema = z4.object({
|
|
57
|
+
guildId: z4.string(),
|
|
58
|
+
channelId: z4.string(),
|
|
59
|
+
messageId: z4.string(),
|
|
60
|
+
/** The ID of the message this one replies to, or null. */
|
|
61
|
+
replyTo: z4.string().nullable(),
|
|
62
|
+
/** When Discord says the message was posted, in epoch milliseconds. */
|
|
63
|
+
publishedAt: z4.number()
|
|
64
|
+
});
|
|
65
|
+
var discordMessageTextDataSchema = discordMessageDataSchema.extend({
|
|
66
|
+
text: z4.string().nullable()
|
|
67
|
+
});
|
|
68
|
+
var discordReactionDataSchema = z4.object({
|
|
69
|
+
guildId: z4.string(),
|
|
70
|
+
channelId: z4.string(),
|
|
71
|
+
/** The message reacted to. */
|
|
72
|
+
messageId: z4.string(),
|
|
73
|
+
/** A custom emoji's ID, or null for a Unicode emoji, whose `name` is the emoji itself. */
|
|
74
|
+
emoji: z4.object({ id: z4.string().nullable(), name: z4.string() }),
|
|
75
|
+
/** The role IDs the reactor held in the server when reacting. */
|
|
76
|
+
reactorRoles: z4.array(z4.string()),
|
|
77
|
+
/** When the reacted-to message was posted, in epoch milliseconds. */
|
|
78
|
+
messagePublishedAt: z4.number()
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// src/tracker-data.ts
|
|
82
|
+
import { z as z5 } from "zod";
|
|
39
83
|
var maxDepth = 16;
|
|
40
84
|
var maxBytes = 32768;
|
|
41
85
|
var trackerDataMaxBranches = 16;
|
|
42
86
|
var trackerDataMaxEntries = 256;
|
|
43
|
-
var scalar =
|
|
44
|
-
var size =
|
|
45
|
-
var bound =
|
|
46
|
-
var branches = () =>
|
|
47
|
-
var node =
|
|
48
|
-
() =>
|
|
49
|
-
type:
|
|
87
|
+
var scalar = z5.union([z5.string(), z5.number().finite(), z5.boolean(), z5.null()]);
|
|
88
|
+
var size = z5.number().int().safe().nonnegative();
|
|
89
|
+
var bound = z5.number().finite();
|
|
90
|
+
var branches = () => z5.array(node).min(1).max(trackerDataMaxBranches);
|
|
91
|
+
var node = z5.lazy(
|
|
92
|
+
() => z5.strictObject({
|
|
93
|
+
type: z5.enum([
|
|
50
94
|
"object",
|
|
51
95
|
"array",
|
|
52
96
|
"string",
|
|
@@ -55,15 +99,15 @@ var node = z4.lazy(
|
|
|
55
99
|
"boolean",
|
|
56
100
|
"null"
|
|
57
101
|
]).optional(),
|
|
58
|
-
properties:
|
|
102
|
+
properties: z5.record(z5.string(), node).refine(
|
|
59
103
|
(properties) => Object.keys(properties).length <= trackerDataMaxEntries,
|
|
60
104
|
`An object schema lists at most ${trackerDataMaxEntries} properties`
|
|
61
105
|
).optional(),
|
|
62
|
-
required:
|
|
63
|
-
additionalProperties:
|
|
64
|
-
propertyNames:
|
|
65
|
-
type:
|
|
66
|
-
enum:
|
|
106
|
+
required: z5.array(z5.string()).max(trackerDataMaxEntries).optional(),
|
|
107
|
+
additionalProperties: z5.union([z5.boolean(), node]).optional(),
|
|
108
|
+
propertyNames: z5.strictObject({
|
|
109
|
+
type: z5.literal("string"),
|
|
110
|
+
enum: z5.array(z5.string()).max(trackerDataMaxEntries).optional()
|
|
67
111
|
}).optional(),
|
|
68
112
|
items: node.optional(),
|
|
69
113
|
minItems: size.optional(),
|
|
@@ -74,7 +118,7 @@ var node = z4.lazy(
|
|
|
74
118
|
maximum: bound.optional(),
|
|
75
119
|
exclusiveMinimum: bound.optional(),
|
|
76
120
|
exclusiveMaximum: bound.optional(),
|
|
77
|
-
enum:
|
|
121
|
+
enum: z5.array(scalar).min(1).max(trackerDataMaxEntries).optional(),
|
|
78
122
|
const: scalar.optional(),
|
|
79
123
|
anyOf: branches().optional(),
|
|
80
124
|
oneOf: branches().optional(),
|
|
@@ -136,7 +180,7 @@ function nestedUnionIssue(schema, path, insideUnion) {
|
|
|
136
180
|
}
|
|
137
181
|
return null;
|
|
138
182
|
}
|
|
139
|
-
var trackerDataSchemaSchema =
|
|
183
|
+
var trackerDataSchemaSchema = z5.unknown().superRefine((value, ctx) => {
|
|
140
184
|
const issue = shapeIssue(value);
|
|
141
185
|
if (issue) {
|
|
142
186
|
ctx.addIssue({ code: "custom", message: issue, abort: true });
|
|
@@ -243,7 +287,7 @@ function subset(schema, path) {
|
|
|
243
287
|
function trackerDataSchema(schema) {
|
|
244
288
|
let json;
|
|
245
289
|
try {
|
|
246
|
-
json =
|
|
290
|
+
json = z5.toJSONSchema(schema, {
|
|
247
291
|
target: "draft-2020-12",
|
|
248
292
|
io: "input",
|
|
249
293
|
unrepresentable: "throw",
|
|
@@ -611,21 +655,21 @@ function whereSchemaIssue(schema, where) {
|
|
|
611
655
|
}
|
|
612
656
|
|
|
613
657
|
// src/trackers.ts
|
|
614
|
-
import { z as
|
|
615
|
-
var timestamp =
|
|
616
|
-
var count =
|
|
617
|
-
var externalId =
|
|
658
|
+
import { z as z6 } from "zod";
|
|
659
|
+
var timestamp = z6.number().int().safe().nonnegative().max(864e13);
|
|
660
|
+
var count = z6.number().int().safe().nonnegative();
|
|
661
|
+
var externalId = z6.string().min(1).max(256);
|
|
618
662
|
var metric = count.nullable().default(null);
|
|
619
|
-
var xTweetSchema =
|
|
663
|
+
var xTweetSchema = z6.looseObject({
|
|
620
664
|
id: externalId,
|
|
621
665
|
userId: externalId,
|
|
622
|
-
content:
|
|
623
|
-
createdAt:
|
|
624
|
-
author:
|
|
666
|
+
content: z6.string(),
|
|
667
|
+
createdAt: z6.iso.datetime({ offset: true }),
|
|
668
|
+
author: z6.looseObject({
|
|
625
669
|
id: externalId,
|
|
626
|
-
username:
|
|
627
|
-
name:
|
|
628
|
-
verified:
|
|
670
|
+
username: z6.string(),
|
|
671
|
+
name: z6.string(),
|
|
672
|
+
verified: z6.boolean().nullable().default(null)
|
|
629
673
|
}),
|
|
630
674
|
likeCount: metric,
|
|
631
675
|
replyCount: metric,
|
|
@@ -633,90 +677,90 @@ var xTweetSchema = z5.looseObject({
|
|
|
633
677
|
quoteCount: metric,
|
|
634
678
|
viewCount: metric,
|
|
635
679
|
bookmarkCount: metric,
|
|
636
|
-
isReply:
|
|
637
|
-
isRetweet:
|
|
638
|
-
isQuoteTweet:
|
|
639
|
-
});
|
|
640
|
-
var xContentBodySchema =
|
|
641
|
-
version:
|
|
642
|
-
id:
|
|
643
|
-
authorId:
|
|
680
|
+
isReply: z6.boolean(),
|
|
681
|
+
isRetweet: z6.boolean(),
|
|
682
|
+
isQuoteTweet: z6.boolean()
|
|
683
|
+
});
|
|
684
|
+
var xContentBodySchema = z6.strictObject({
|
|
685
|
+
version: z6.literal(1),
|
|
686
|
+
id: z6.string().min(1),
|
|
687
|
+
authorId: z6.string().min(1),
|
|
644
688
|
publishedAt: timestamp,
|
|
645
|
-
text:
|
|
646
|
-
isReply:
|
|
647
|
-
isRetweet:
|
|
648
|
-
isQuoteTweet:
|
|
649
|
-
media:
|
|
650
|
-
mentionedAuthorIds:
|
|
651
|
-
videoLengthSeconds:
|
|
652
|
-
references:
|
|
653
|
-
replyId:
|
|
654
|
-
replyAuthorId:
|
|
655
|
-
quoteId:
|
|
656
|
-
quoteAuthorId:
|
|
657
|
-
repostId:
|
|
658
|
-
repostAuthorId:
|
|
689
|
+
text: z6.string(),
|
|
690
|
+
isReply: z6.boolean(),
|
|
691
|
+
isRetweet: z6.boolean(),
|
|
692
|
+
isQuoteTweet: z6.boolean(),
|
|
693
|
+
media: z6.array(z6.strictObject({ type: z6.string(), url: z6.string() })).nullable(),
|
|
694
|
+
mentionedAuthorIds: z6.array(z6.string().min(1)).nullable(),
|
|
695
|
+
videoLengthSeconds: z6.number().nonnegative().nullable(),
|
|
696
|
+
references: z6.strictObject({
|
|
697
|
+
replyId: z6.string().nullable(),
|
|
698
|
+
replyAuthorId: z6.string().nullable(),
|
|
699
|
+
quoteId: z6.string().nullable(),
|
|
700
|
+
quoteAuthorId: z6.string().nullable(),
|
|
701
|
+
repostId: z6.string().nullable(),
|
|
702
|
+
repostAuthorId: z6.string().nullable()
|
|
659
703
|
})
|
|
660
704
|
});
|
|
661
|
-
var trackerContentQuerySchema =
|
|
705
|
+
var trackerContentQuerySchema = z6.strictObject({
|
|
662
706
|
id: externalId,
|
|
663
|
-
observation:
|
|
707
|
+
observation: z6.string().regex(/^observation_[a-f0-9]{64}$/)
|
|
664
708
|
});
|
|
665
709
|
var trackerContentReadSchema = trackerContentQuerySchema.extend({
|
|
666
710
|
member: identifier
|
|
667
711
|
});
|
|
668
712
|
var attributionContext = { member: identifier, capturedAt: timestamp };
|
|
669
|
-
var trackerEvidenceSchema =
|
|
713
|
+
var trackerEvidenceSchema = z6.strictObject({
|
|
670
714
|
contentRevision: identifier,
|
|
671
715
|
observation: identifier
|
|
672
716
|
});
|
|
673
|
-
var trackerContentSchema =
|
|
717
|
+
var trackerContentSchema = z6.strictObject({
|
|
674
718
|
tracker: identifier,
|
|
675
|
-
source:
|
|
719
|
+
source: z6.literal("x"),
|
|
676
720
|
evidence: trackerEvidenceSchema,
|
|
677
721
|
content: xContentBodySchema,
|
|
678
722
|
observedAt: timestamp,
|
|
679
|
-
removed:
|
|
680
|
-
attribution:
|
|
681
|
-
|
|
723
|
+
removed: z6.boolean(),
|
|
724
|
+
attribution: z6.discriminatedUnion("kind", [
|
|
725
|
+
z6.strictObject({
|
|
682
726
|
...attributionContext,
|
|
683
|
-
kind:
|
|
684
|
-
account:
|
|
685
|
-
provider:
|
|
686
|
-
issuer:
|
|
727
|
+
kind: z6.literal("linked"),
|
|
728
|
+
account: z6.strictObject({
|
|
729
|
+
provider: z6.literal("x"),
|
|
730
|
+
issuer: z6.string().min(1),
|
|
687
731
|
subject: externalId,
|
|
688
732
|
revision: count,
|
|
689
733
|
linkedAt: timestamp.nullable()
|
|
690
734
|
})
|
|
691
735
|
}),
|
|
692
|
-
|
|
693
|
-
|
|
736
|
+
z6.strictObject({ ...attributionContext, kind: z6.literal("unlinked") }),
|
|
737
|
+
z6.strictObject({
|
|
694
738
|
...attributionContext,
|
|
695
|
-
kind:
|
|
739
|
+
kind: z6.literal("different-author")
|
|
696
740
|
})
|
|
697
741
|
])
|
|
698
742
|
});
|
|
699
|
-
var identityKindSchema =
|
|
700
|
-
var accountRoleSchema =
|
|
743
|
+
var identityKindSchema = z6.enum(["wallet", "x", "discord", "member"]);
|
|
744
|
+
var accountRoleSchema = z6.string().regex(
|
|
701
745
|
/^[a-zA-Z][a-zA-Z0-9_]{0,39}$/,
|
|
702
746
|
"Name roles like author or recipient: a letter, then letters, digits or underscores"
|
|
703
747
|
);
|
|
704
748
|
var xAccountRoles = ["author", "inReplyTo"];
|
|
705
749
|
var distinct = (values) => new Set(values).size === values.length;
|
|
706
|
-
var xSearchSourceSchema =
|
|
707
|
-
kind:
|
|
708
|
-
query:
|
|
750
|
+
var xSearchSourceSchema = z6.object({
|
|
751
|
+
kind: z6.literal("x-search"),
|
|
752
|
+
query: z6.string().trim().min(1).max(2e3)
|
|
709
753
|
}).strict();
|
|
710
|
-
var customSourceSchema =
|
|
711
|
-
kind:
|
|
754
|
+
var customSourceSchema = z6.object({
|
|
755
|
+
kind: z6.literal("custom"),
|
|
712
756
|
namespace: identifier,
|
|
713
757
|
/**
|
|
714
758
|
* The identity kinds a record's author and named accounts can be, attributed to members
|
|
715
759
|
* through verified links. Omitted when authors are opaque IDs, which no quest can pay.
|
|
716
760
|
*/
|
|
717
|
-
identities:
|
|
761
|
+
identities: z6.array(identityKindSchema).min(1).max(4).refine(distinct, "List each identity kind once").optional(),
|
|
718
762
|
/** Roles of the named accounts records can carry besides their author, such as `recipient`. */
|
|
719
|
-
accounts:
|
|
763
|
+
accounts: z6.array(accountRoleSchema).min(1).max(10).refine(distinct, "List each account role once").refine(
|
|
720
764
|
(roles) => !roles.includes("author"),
|
|
721
765
|
"author is every record's own role; name other accounts"
|
|
722
766
|
).optional(),
|
|
@@ -726,7 +770,7 @@ var customSourceSchema = z5.object({
|
|
|
726
770
|
*
|
|
727
771
|
* @deprecated Use `identities: ["wallet"]`.
|
|
728
772
|
*/
|
|
729
|
-
authors:
|
|
773
|
+
authors: z6.literal("wallet").optional(),
|
|
730
774
|
/**
|
|
731
775
|
* The schema every record's `data` matches, which ingestion enforces. `customSource()`
|
|
732
776
|
* requires it. Trackers published before typed data have none, and take no records until
|
|
@@ -740,93 +784,106 @@ var customSourceSchema = z5.object({
|
|
|
740
784
|
(source) => !source.accounts || source.identities,
|
|
741
785
|
"Named accounts need identities"
|
|
742
786
|
);
|
|
743
|
-
var trackerSourceSchema =
|
|
787
|
+
var trackerSourceSchema = z6.discriminatedUnion("kind", [
|
|
744
788
|
xSearchSourceSchema,
|
|
745
|
-
customSourceSchema
|
|
789
|
+
customSourceSchema,
|
|
790
|
+
discordMessagesSourceSchema,
|
|
791
|
+
discordReactionsSourceSchema
|
|
746
792
|
]);
|
|
793
|
+
var trackerSourceKinds = [
|
|
794
|
+
"x-search",
|
|
795
|
+
"custom",
|
|
796
|
+
"discord-messages",
|
|
797
|
+
"discord-reactions"
|
|
798
|
+
];
|
|
747
799
|
function sourceIdentities(source) {
|
|
748
|
-
|
|
749
|
-
|
|
800
|
+
switch (source.kind) {
|
|
801
|
+
case "x-search":
|
|
802
|
+
return ["x"];
|
|
803
|
+
case "discord-messages":
|
|
804
|
+
case "discord-reactions":
|
|
805
|
+
return ["discord"];
|
|
806
|
+
case "custom":
|
|
807
|
+
return source.identities ?? (source.authors === "wallet" ? ["wallet"] : void 0);
|
|
750
808
|
}
|
|
751
|
-
return source.identities ?? (source.authors === "wallet" ? ["wallet"] : void 0);
|
|
752
809
|
}
|
|
753
|
-
var windowSchema =
|
|
810
|
+
var windowSchema = z6.object({ start: timestamp, end: timestamp.optional() }).strict().refine(
|
|
754
811
|
(w) => w.end === void 0 || w.end > w.start,
|
|
755
812
|
"End must follow start"
|
|
756
813
|
);
|
|
757
|
-
var trackerDefinitionSchema =
|
|
814
|
+
var trackerDefinitionSchema = z6.object({
|
|
758
815
|
key: identifier,
|
|
759
|
-
title:
|
|
816
|
+
title: z6.string().trim().min(1).max(120),
|
|
760
817
|
source: trackerSourceSchema,
|
|
761
818
|
window: windowSchema,
|
|
762
|
-
refreshSeconds:
|
|
763
|
-
maxPages:
|
|
819
|
+
refreshSeconds: z6.number().int().min(300).max(86400).default(21600),
|
|
820
|
+
maxPages: z6.number().int().min(1).max(1e3).default(60)
|
|
764
821
|
}).strict();
|
|
765
|
-
var trackerArtifactSchema =
|
|
822
|
+
var trackerArtifactSchema = z6.union([
|
|
766
823
|
trackerDefinitionSchema,
|
|
767
|
-
|
|
824
|
+
z6.object({ code: z6.string().min(1).max(2e6) }).strict()
|
|
768
825
|
]);
|
|
769
|
-
var publishedTrackerSchema =
|
|
826
|
+
var publishedTrackerSchema = z6.object({
|
|
770
827
|
id: identifier,
|
|
771
828
|
version: identifier,
|
|
772
829
|
definition: trackerDefinitionSchema,
|
|
773
830
|
publishedAt: timestamp,
|
|
774
|
-
actor:
|
|
831
|
+
actor: z6.string().nullable()
|
|
775
832
|
});
|
|
776
|
-
var trackerStatusSchema =
|
|
833
|
+
var trackerStatusSchema = z6.object({
|
|
777
834
|
published: publishedTrackerSchema,
|
|
778
|
-
paused:
|
|
779
|
-
state:
|
|
835
|
+
paused: z6.boolean(),
|
|
836
|
+
state: z6.enum(["idle", "syncing", "error", "complete"]),
|
|
780
837
|
lastStartedAt: timestamp.nullable(),
|
|
781
838
|
lastCompletedAt: timestamp.nullable(),
|
|
782
839
|
nextSyncAt: timestamp.nullable(),
|
|
783
|
-
coverage:
|
|
784
|
-
error:
|
|
840
|
+
coverage: z6.enum(["unknown", "partial", "complete"]),
|
|
841
|
+
error: z6.string().nullable(),
|
|
785
842
|
records: count
|
|
786
843
|
});
|
|
787
|
-
var trackerControlSchema =
|
|
844
|
+
var trackerControlSchema = z6.object({
|
|
788
845
|
actionId: identifier,
|
|
789
|
-
action:
|
|
846
|
+
action: z6.enum(["pause", "resume", "refresh"])
|
|
790
847
|
}).strict();
|
|
791
|
-
var trackerAccountSchema =
|
|
848
|
+
var trackerAccountSchema = z6.strictObject({
|
|
792
849
|
kind: identityKindSchema.optional(),
|
|
793
850
|
id: externalId
|
|
794
851
|
});
|
|
795
|
-
var trackerRecordInputSchema =
|
|
852
|
+
var trackerRecordInputSchema = z6.object({
|
|
796
853
|
id: externalId,
|
|
797
854
|
occurredAt: timestamp,
|
|
798
855
|
observedAt: timestamp,
|
|
799
|
-
author:
|
|
856
|
+
author: z6.object({
|
|
800
857
|
id: externalId,
|
|
801
|
-
verified:
|
|
858
|
+
verified: z6.boolean().nullable().default(null),
|
|
802
859
|
/** The author's identity kind; needed when the source names more than one. */
|
|
803
860
|
kind: identityKindSchema.optional()
|
|
804
861
|
}).strict().nullable().default(null),
|
|
805
862
|
/** Named accounts besides the author, by the roles the custom source declares. */
|
|
806
|
-
accounts:
|
|
863
|
+
accounts: z6.record(accountRoleSchema, trackerAccountSchema).refine(
|
|
807
864
|
(accounts) => Object.keys(accounts).length <= 10,
|
|
808
865
|
"At most 10 accounts"
|
|
809
866
|
).optional(),
|
|
810
|
-
data:
|
|
811
|
-
removed:
|
|
867
|
+
data: z6.record(z6.string(), z6.json()),
|
|
868
|
+
removed: z6.boolean().default(false)
|
|
812
869
|
}).strict().refine(
|
|
813
870
|
(v) => new TextEncoder().encode(JSON.stringify(v.data)).byteLength <= 131072,
|
|
814
871
|
"Record exceeds 128 KB"
|
|
815
872
|
);
|
|
816
873
|
var trackerRecordSchema = trackerRecordInputSchema.safeExtend({
|
|
817
|
-
source:
|
|
874
|
+
source: z6.string(),
|
|
818
875
|
firstSeenAt: timestamp,
|
|
819
876
|
/** Present only when includeEvidence is true; custom sources have no X evidence. */
|
|
820
877
|
evidence: trackerEvidenceSchema.nullable().optional()
|
|
821
878
|
});
|
|
822
|
-
var trackerIngestSchema =
|
|
879
|
+
var trackerIngestSchema = z6.object({
|
|
823
880
|
actionId: identifier,
|
|
824
|
-
records:
|
|
881
|
+
records: z6.array(trackerRecordInputSchema).min(1).max(100)
|
|
825
882
|
}).strict();
|
|
826
|
-
var trackerIngestResultSchema =
|
|
883
|
+
var trackerIngestResultSchema = z6.object({
|
|
827
884
|
stored: count,
|
|
828
885
|
/** Tracker-trigger decisions this ingest caused. Absent from servers without tracker triggers. */
|
|
829
|
-
admissions:
|
|
886
|
+
admissions: z6.object({
|
|
830
887
|
admitted: count,
|
|
831
888
|
skipped: count,
|
|
832
889
|
/**
|
|
@@ -847,11 +904,11 @@ var trackerOutcomeFields = {
|
|
|
847
904
|
/** The release admitted, or the one active when the observation was skipped. */
|
|
848
905
|
release: identifier,
|
|
849
906
|
/** The account attribution resolved or failed to resolve, such as a CAIP-10 wallet ID. */
|
|
850
|
-
account:
|
|
907
|
+
account: z6.string().nullable(),
|
|
851
908
|
createdAt: timestamp,
|
|
852
909
|
updatedAt: timestamp,
|
|
853
910
|
/** Null for automatic decisions; the staff actor after a retry. */
|
|
854
|
-
actor:
|
|
911
|
+
actor: z6.string().nullable()
|
|
855
912
|
};
|
|
856
913
|
var trackerSkipCodes = [
|
|
857
914
|
/** The quest is paused or no longer active. */
|
|
@@ -884,84 +941,84 @@ var trackerSkipCodes = [
|
|
|
884
941
|
/** The attributed member has not completed the quest's prerequisites. */
|
|
885
942
|
"prerequisites-incomplete"
|
|
886
943
|
];
|
|
887
|
-
var trackerOutcomeSchema =
|
|
888
|
-
|
|
944
|
+
var trackerOutcomeSchema = z6.discriminatedUnion("state", [
|
|
945
|
+
z6.strictObject({
|
|
889
946
|
...trackerOutcomeFields,
|
|
890
|
-
state:
|
|
891
|
-
code:
|
|
892
|
-
reason:
|
|
947
|
+
state: z6.literal("admitted"),
|
|
948
|
+
code: z6.null(),
|
|
949
|
+
reason: z6.null(),
|
|
893
950
|
/** The attributed member. */
|
|
894
951
|
member: identifier,
|
|
895
952
|
/** The admitted attempt. Its evaluation, decision and rewards live on the attempt. */
|
|
896
953
|
attempt: identifier
|
|
897
954
|
}),
|
|
898
|
-
|
|
955
|
+
z6.strictObject({
|
|
899
956
|
...trackerOutcomeFields,
|
|
900
|
-
state:
|
|
957
|
+
state: z6.literal("skipped"),
|
|
901
958
|
/** Why the observation was skipped, as one of `trackerSkipCodes`. */
|
|
902
|
-
code:
|
|
959
|
+
code: z6.string().min(1),
|
|
903
960
|
/** Why the observation was skipped, for people. */
|
|
904
|
-
reason:
|
|
961
|
+
reason: z6.string(),
|
|
905
962
|
/** The attributed member, when attribution got that far. */
|
|
906
963
|
member: identifier.nullable(),
|
|
907
964
|
attempt: identifier.nullable()
|
|
908
965
|
})
|
|
909
966
|
]);
|
|
910
|
-
var trackerOutcomeQuerySchema =
|
|
967
|
+
var trackerOutcomeQuerySchema = z6.strictObject({
|
|
911
968
|
/** Quest key or ID. */
|
|
912
969
|
quest: identifier.optional(),
|
|
913
970
|
record: externalId.optional(),
|
|
914
971
|
member: identifier.optional(),
|
|
915
|
-
state:
|
|
972
|
+
state: z6.enum(["admitted", "skipped"]).optional(),
|
|
916
973
|
/** Only skips with this code, such as `unlinked-account`. */
|
|
917
|
-
code:
|
|
918
|
-
limit:
|
|
974
|
+
code: z6.string().min(1).max(100).optional(),
|
|
975
|
+
limit: z6.coerce.number().int().min(1).max(100).default(25),
|
|
919
976
|
/** Opaque cursor from `next`: older outcomes. */
|
|
920
|
-
before:
|
|
977
|
+
before: z6.string().max(512).optional()
|
|
921
978
|
});
|
|
922
|
-
var trackerOutcomePageSchema =
|
|
979
|
+
var trackerOutcomePageSchema = z6.strictObject({
|
|
923
980
|
/** Newest first. */
|
|
924
|
-
items:
|
|
925
|
-
next:
|
|
981
|
+
items: z6.array(trackerOutcomeSchema).max(100),
|
|
982
|
+
next: z6.string().nullable()
|
|
926
983
|
});
|
|
927
|
-
var trackerOutcomeRetrySchema =
|
|
984
|
+
var trackerOutcomeRetrySchema = z6.strictObject({
|
|
928
985
|
actionId: identifier,
|
|
929
986
|
/** Quest key or ID. */
|
|
930
987
|
quest: identifier,
|
|
931
988
|
record: externalId,
|
|
932
989
|
observedAt: timestamp
|
|
933
990
|
});
|
|
934
|
-
var booleanQuery =
|
|
935
|
-
|
|
936
|
-
|
|
991
|
+
var booleanQuery = z6.union([
|
|
992
|
+
z6.boolean(),
|
|
993
|
+
z6.enum(["true", "false"]).transform((v) => v === "true")
|
|
937
994
|
]);
|
|
938
|
-
var trackerQuerySchema =
|
|
995
|
+
var trackerQuerySchema = z6.object({
|
|
939
996
|
author: externalId.optional(),
|
|
940
997
|
member: identifier.optional(),
|
|
941
998
|
verified: booleanQuery.optional(),
|
|
942
|
-
since:
|
|
943
|
-
until:
|
|
999
|
+
since: z6.coerce.number().int().safe().nonnegative().optional(),
|
|
1000
|
+
until: z6.coerce.number().int().safe().nonnegative().optional(),
|
|
944
1001
|
removed: booleanQuery.default(false),
|
|
945
|
-
minLikes:
|
|
946
|
-
minViews:
|
|
947
|
-
limit:
|
|
948
|
-
cursor:
|
|
1002
|
+
minLikes: z6.coerce.number().int().safe().nonnegative().optional(),
|
|
1003
|
+
minViews: z6.coerce.number().int().safe().nonnegative().optional(),
|
|
1004
|
+
limit: z6.coerce.number().int().min(1).max(100).default(25),
|
|
1005
|
+
cursor: z6.string().max(2048).optional(),
|
|
949
1006
|
includeEvidence: booleanQuery.optional()
|
|
950
1007
|
}).strict().refine(
|
|
951
1008
|
(q) => q.since === void 0 || q.until === void 0 || q.until > q.since,
|
|
952
1009
|
"Until must follow since"
|
|
953
1010
|
);
|
|
954
|
-
var trackerPageSchema =
|
|
1011
|
+
var trackerPageSchema = z6.object({
|
|
955
1012
|
tracker: identifier,
|
|
956
|
-
items:
|
|
957
|
-
nextCursor:
|
|
1013
|
+
items: z6.array(trackerRecordSchema),
|
|
1014
|
+
nextCursor: z6.string().nullable(),
|
|
958
1015
|
total: count,
|
|
959
1016
|
status: trackerStatusSchema
|
|
960
1017
|
});
|
|
961
|
-
var trackerSummarySchema =
|
|
1018
|
+
var trackerSummarySchema = z6.object({
|
|
962
1019
|
records: count,
|
|
963
1020
|
authors: count,
|
|
964
|
-
metrics:
|
|
1021
|
+
metrics: z6.object({
|
|
965
1022
|
likes: count,
|
|
966
1023
|
replies: count,
|
|
967
1024
|
reposts: count,
|
|
@@ -977,31 +1034,31 @@ var trackerPreviewLimits = {
|
|
|
977
1034
|
posts: 100,
|
|
978
1035
|
days: 30
|
|
979
1036
|
};
|
|
980
|
-
var trackerPreviewInputSchema =
|
|
1037
|
+
var trackerPreviewInputSchema = z6.object({
|
|
981
1038
|
query: xSearchSourceSchema.shape.query,
|
|
982
1039
|
/** Start of the searched window. The window ends when the sample is fetched. */
|
|
983
1040
|
since: timestamp
|
|
984
1041
|
}).strict();
|
|
985
|
-
var trackerPreviewSchema =
|
|
986
|
-
query:
|
|
1042
|
+
var trackerPreviewSchema = z6.object({
|
|
1043
|
+
query: z6.string(),
|
|
987
1044
|
since: timestamp,
|
|
988
1045
|
fetchedAt: timestamp,
|
|
989
1046
|
pages: count,
|
|
990
1047
|
/** Every match in the sample, newest first, verified or not. */
|
|
991
|
-
posts:
|
|
1048
|
+
posts: z6.array(xTweetSchema).max(trackerPreviewLimits.posts),
|
|
992
1049
|
/** X had more matches than the sample holds. */
|
|
993
|
-
more:
|
|
1050
|
+
more: z6.boolean()
|
|
994
1051
|
});
|
|
995
1052
|
|
|
996
1053
|
// src/content.ts
|
|
997
|
-
import { z as
|
|
998
|
-
var timestamp2 =
|
|
999
|
-
var contentPolicySchema =
|
|
1054
|
+
import { z as z7 } from "zod";
|
|
1055
|
+
var timestamp2 = z7.number().int().safe().nonnegative().max(864e13);
|
|
1056
|
+
var contentPolicySchema = z7.strictObject({
|
|
1000
1057
|
tracker: identifier,
|
|
1001
1058
|
window: trackerDefinitionSchema.shape.window,
|
|
1002
|
-
enrollment:
|
|
1003
|
-
posts:
|
|
1004
|
-
historical:
|
|
1059
|
+
enrollment: z7.enum(["none", "required"]).default("none"),
|
|
1060
|
+
posts: z7.enum(["after-enrollment", "since-start"]).default("after-enrollment"),
|
|
1061
|
+
historical: z7.enum(["automatic", "claim", "staff"]).default("claim")
|
|
1005
1062
|
});
|
|
1006
1063
|
var admittedContentSchema = xContentBodySchema.extend({
|
|
1007
1064
|
tracker: identifier,
|
|
@@ -1009,59 +1066,59 @@ var admittedContentSchema = xContentBodySchema.extend({
|
|
|
1009
1066
|
observation: identifier,
|
|
1010
1067
|
attribution: trackerContentSchema.shape.attribution.options[0],
|
|
1011
1068
|
enrolledAt: timestamp2.nullable(),
|
|
1012
|
-
completionKey:
|
|
1069
|
+
completionKey: z7.string().min(1).max(200)
|
|
1013
1070
|
});
|
|
1014
|
-
var contentEnrollmentInputSchema =
|
|
1071
|
+
var contentEnrollmentInputSchema = z7.strictObject({
|
|
1015
1072
|
actionId: identifier,
|
|
1016
1073
|
quest: identifier,
|
|
1017
1074
|
member: identifier
|
|
1018
1075
|
});
|
|
1019
|
-
var contentEnrollmentSchema =
|
|
1076
|
+
var contentEnrollmentSchema = z7.strictObject({
|
|
1020
1077
|
quest: identifier,
|
|
1021
1078
|
member: identifier,
|
|
1022
1079
|
enrolledAt: timestamp2
|
|
1023
1080
|
});
|
|
1024
1081
|
var contentReleaseInputSchema = contentEnrollmentInputSchema.extend({
|
|
1025
|
-
content:
|
|
1082
|
+
content: z7.string().min(1).max(256)
|
|
1026
1083
|
});
|
|
1027
|
-
var contentAdmissionSchema =
|
|
1084
|
+
var contentAdmissionSchema = z7.strictObject({
|
|
1028
1085
|
quest: identifier,
|
|
1029
|
-
content:
|
|
1086
|
+
content: z7.string().min(1).max(256),
|
|
1030
1087
|
release: identifier,
|
|
1031
|
-
state:
|
|
1032
|
-
reason:
|
|
1088
|
+
state: z7.enum(["pending", "admitted", "excluded"]),
|
|
1089
|
+
reason: z7.string().nullable(),
|
|
1033
1090
|
attempt: identifier.nullable()
|
|
1034
1091
|
});
|
|
1035
|
-
var contentAdmissionQuerySchema =
|
|
1092
|
+
var contentAdmissionQuerySchema = z7.strictObject({
|
|
1036
1093
|
quest: identifier,
|
|
1037
1094
|
member: identifier.optional(),
|
|
1038
|
-
content:
|
|
1095
|
+
content: z7.string().min(1).max(256).optional(),
|
|
1039
1096
|
cursor: pageCursorSchema.optional()
|
|
1040
1097
|
});
|
|
1041
|
-
var contentAdmissionPageSchema =
|
|
1042
|
-
items:
|
|
1098
|
+
var contentAdmissionPageSchema = z7.strictObject({
|
|
1099
|
+
items: z7.array(contentAdmissionSchema),
|
|
1043
1100
|
nextCursor: pageCursorSchema.nullable()
|
|
1044
1101
|
});
|
|
1045
|
-
var contentQualificationDecisionSchema =
|
|
1046
|
-
kind:
|
|
1047
|
-
reason:
|
|
1102
|
+
var contentQualificationDecisionSchema = z7.strictObject({
|
|
1103
|
+
kind: z7.enum(["accept", "reject", "review", "superseded"]),
|
|
1104
|
+
reason: z7.string().nullable()
|
|
1048
1105
|
});
|
|
1049
|
-
var contentQualificationQuerySchema =
|
|
1106
|
+
var contentQualificationQuerySchema = z7.strictObject({
|
|
1050
1107
|
quest: identifier,
|
|
1051
1108
|
member: identifier.optional(),
|
|
1052
|
-
content:
|
|
1109
|
+
content: z7.string().min(1).max(256).optional(),
|
|
1053
1110
|
cursor: pageCursorSchema.optional()
|
|
1054
1111
|
});
|
|
1055
|
-
var contentQualificationSchema =
|
|
1112
|
+
var contentQualificationSchema = z7.strictObject({
|
|
1056
1113
|
quest: identifier,
|
|
1057
|
-
content:
|
|
1114
|
+
content: z7.string(),
|
|
1058
1115
|
member: identifier,
|
|
1059
1116
|
release: identifier,
|
|
1060
1117
|
attempt: identifier,
|
|
1061
1118
|
revision: identifier,
|
|
1062
1119
|
observation: identifier,
|
|
1063
|
-
current:
|
|
1064
|
-
state:
|
|
1120
|
+
current: z7.boolean(),
|
|
1121
|
+
state: z7.enum([
|
|
1065
1122
|
"pending",
|
|
1066
1123
|
"qualified",
|
|
1067
1124
|
"unqualified",
|
|
@@ -1072,18 +1129,18 @@ var contentQualificationSchema = z6.strictObject({
|
|
|
1072
1129
|
"blocked",
|
|
1073
1130
|
"unavailable"
|
|
1074
1131
|
]),
|
|
1075
|
-
reason:
|
|
1076
|
-
reward:
|
|
1132
|
+
reason: z7.string().nullable(),
|
|
1133
|
+
reward: z7.strictObject({
|
|
1077
1134
|
attempt: identifier.nullable(),
|
|
1078
1135
|
completion: identifier.nullable(),
|
|
1079
|
-
state:
|
|
1136
|
+
state: z7.enum(["unresolved", "awarded", "excluded"])
|
|
1080
1137
|
})
|
|
1081
1138
|
});
|
|
1082
|
-
var contentQualificationPageSchema =
|
|
1083
|
-
items:
|
|
1139
|
+
var contentQualificationPageSchema = z7.strictObject({
|
|
1140
|
+
items: z7.array(contentQualificationSchema),
|
|
1084
1141
|
nextCursor: pageCursorSchema.nullable()
|
|
1085
1142
|
});
|
|
1086
|
-
var contentMetricSchema =
|
|
1143
|
+
var contentMetricSchema = z7.enum([
|
|
1087
1144
|
"likes",
|
|
1088
1145
|
"replies",
|
|
1089
1146
|
"reposts",
|
|
@@ -1091,21 +1148,21 @@ var contentMetricSchema = z6.enum([
|
|
|
1091
1148
|
"views",
|
|
1092
1149
|
"bookmarks"
|
|
1093
1150
|
]);
|
|
1094
|
-
var contentMetricsSchema =
|
|
1151
|
+
var contentMetricsSchema = z7.partialRecord(
|
|
1095
1152
|
contentMetricSchema,
|
|
1096
|
-
|
|
1153
|
+
z7.number().int().safe().nonnegative()
|
|
1097
1154
|
);
|
|
1098
|
-
var contentPerformancePolicySchema =
|
|
1099
|
-
metrics:
|
|
1155
|
+
var contentPerformancePolicySchema = z7.strictObject({
|
|
1156
|
+
metrics: z7.array(contentMetricSchema).min(1).max(6).refine(
|
|
1100
1157
|
(values) => new Set(values).size === values.length,
|
|
1101
1158
|
"Metrics must be unique"
|
|
1102
1159
|
),
|
|
1103
|
-
maxAgeMs:
|
|
1160
|
+
maxAgeMs: z7.number().int().positive().max(864e5).default(36e5)
|
|
1104
1161
|
});
|
|
1105
1162
|
|
|
1106
1163
|
// src/calendar.ts
|
|
1107
|
-
import { z as
|
|
1108
|
-
var timestamp3 =
|
|
1164
|
+
import { z as z8 } from "zod";
|
|
1165
|
+
var timestamp3 = z8.number().int().safe();
|
|
1109
1166
|
var fixedOffset = /^(?:[+-]|(?:Etc\/)?GMT[+-]\d|(?:EST|MST|HST)$)/i;
|
|
1110
1167
|
function canonicalTimeZone(zone) {
|
|
1111
1168
|
let resolved;
|
|
@@ -1121,18 +1178,18 @@ function canonicalTimeZone(zone) {
|
|
|
1121
1178
|
}
|
|
1122
1179
|
return fixedOffset.test(zone) || fixedOffset.test(resolved) ? null : resolved;
|
|
1123
1180
|
}
|
|
1124
|
-
var timeZoneSchema =
|
|
1181
|
+
var timeZoneSchema = z8.string().min(1).max(100).transform((zone, ctx) => {
|
|
1125
1182
|
const canonical = canonicalTimeZone(zone);
|
|
1126
1183
|
if (canonical === null) {
|
|
1127
1184
|
ctx.addIssue({
|
|
1128
1185
|
code: "custom",
|
|
1129
1186
|
message: fixedOffset.test(zone) ? "Use a named IANA timezone, such as Europe/Budapest or UTC. Fixed offsets have no daylight-saving rules." : "Use an IANA timezone name, such as Europe/Budapest or UTC"
|
|
1130
1187
|
});
|
|
1131
|
-
return
|
|
1188
|
+
return z8.NEVER;
|
|
1132
1189
|
}
|
|
1133
1190
|
return canonical;
|
|
1134
1191
|
});
|
|
1135
|
-
var timeZoneNameSchema =
|
|
1192
|
+
var timeZoneNameSchema = z8.string().min(1).max(100);
|
|
1136
1193
|
var movedTimeZone = (what) => `${what} no longer take a timeZone: they follow the project calendar. Set calendar.timeZone in relay.json or in Console settings.`;
|
|
1137
1194
|
var record = (value) => typeof value === "object" && value !== null;
|
|
1138
1195
|
function refuseStreakTimeZone(value, ctx) {
|
|
@@ -1156,99 +1213,99 @@ function refuseWindowTimeZone(value, ctx) {
|
|
|
1156
1213
|
}
|
|
1157
1214
|
return value;
|
|
1158
1215
|
}
|
|
1159
|
-
var calendarPeriodSchema =
|
|
1160
|
-
var projectCalendarSchema =
|
|
1216
|
+
var calendarPeriodSchema = z8.enum(["lifetime", "day", "week", "month"]);
|
|
1217
|
+
var projectCalendarSchema = z8.object({
|
|
1161
1218
|
/** The timezone of the current calendar day. */
|
|
1162
1219
|
timeZone: timeZoneNameSchema,
|
|
1163
1220
|
/** The current calendar date, such as `2026-10-01`. */
|
|
1164
|
-
today:
|
|
1221
|
+
today: z8.string(),
|
|
1165
1222
|
/** When the current calendar day ends, in epoch milliseconds. */
|
|
1166
1223
|
nextBoundary: timestamp3,
|
|
1167
1224
|
/** A change that takes effect at the next day boundary, or null. */
|
|
1168
|
-
pending:
|
|
1225
|
+
pending: z8.object({ timeZone: timeZoneNameSchema, effectiveAt: timestamp3 }).nullable(),
|
|
1169
1226
|
/** The `calendar.timeZone` the last deployment that declared one set, or null. */
|
|
1170
1227
|
declared: timeZoneNameSchema.nullable(),
|
|
1171
1228
|
/**
|
|
1172
1229
|
* A stored timezone the calendar no longer accepts, such as a fixed offset a streak named before
|
|
1173
1230
|
* v1. The calendar reads it as UTC until an operator chooses a timezone. Null otherwise.
|
|
1174
1231
|
*/
|
|
1175
|
-
unsupported:
|
|
1232
|
+
unsupported: z8.string().nullable().default(null)
|
|
1176
1233
|
});
|
|
1177
|
-
var projectCalendarInputSchema =
|
|
1234
|
+
var projectCalendarInputSchema = z8.object({
|
|
1178
1235
|
actionId: identifier,
|
|
1179
1236
|
timeZone: timeZoneSchema,
|
|
1180
|
-
reason:
|
|
1237
|
+
reason: z8.string().trim().min(1).max(500)
|
|
1181
1238
|
}).strict();
|
|
1182
|
-
var projectCalendarDeclarationSchema =
|
|
1239
|
+
var projectCalendarDeclarationSchema = z8.object({ timeZone: timeZoneSchema }).strict();
|
|
1183
1240
|
|
|
1184
1241
|
// src/streaks.ts
|
|
1185
|
-
import { z as
|
|
1186
|
-
var streakPolicySchema =
|
|
1187
|
-
kind:
|
|
1188
|
-
days:
|
|
1189
|
-
});
|
|
1190
|
-
var streakProgressSchema =
|
|
1191
|
-
goal:
|
|
1192
|
-
current:
|
|
1193
|
-
best:
|
|
1194
|
-
today:
|
|
1195
|
-
todayQualified:
|
|
1242
|
+
import { z as z9 } from "zod";
|
|
1243
|
+
var streakPolicySchema = z9.object({
|
|
1244
|
+
kind: z9.literal("streak"),
|
|
1245
|
+
days: z9.number().int().min(1).max(3650)
|
|
1246
|
+
});
|
|
1247
|
+
var streakProgressSchema = z9.object({
|
|
1248
|
+
goal: z9.number().int().positive(),
|
|
1249
|
+
current: z9.number().int().nonnegative(),
|
|
1250
|
+
best: z9.number().int().nonnegative(),
|
|
1251
|
+
today: z9.string(),
|
|
1252
|
+
todayQualified: z9.boolean(),
|
|
1196
1253
|
timeZone: timeZoneNameSchema,
|
|
1197
|
-
nextBoundary:
|
|
1198
|
-
pendingTimeZone:
|
|
1254
|
+
nextBoundary: z9.number().int(),
|
|
1255
|
+
pendingTimeZone: z9.object({
|
|
1199
1256
|
timeZone: timeZoneNameSchema,
|
|
1200
|
-
effectiveAt:
|
|
1257
|
+
effectiveAt: z9.number().int()
|
|
1201
1258
|
}).nullable(),
|
|
1202
|
-
days:
|
|
1203
|
-
|
|
1204
|
-
day:
|
|
1205
|
-
date:
|
|
1259
|
+
days: z9.array(
|
|
1260
|
+
z9.object({
|
|
1261
|
+
day: z9.number().int(),
|
|
1262
|
+
date: z9.string(),
|
|
1206
1263
|
// The zone the day was recorded in, as stored: days from before v1 can name a fixed offset.
|
|
1207
|
-
timeZone:
|
|
1208
|
-
occurredAt:
|
|
1264
|
+
timeZone: z9.string(),
|
|
1265
|
+
occurredAt: z9.number().int()
|
|
1209
1266
|
})
|
|
1210
1267
|
),
|
|
1211
|
-
milestone:
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
status:
|
|
1215
|
-
completion:
|
|
1216
|
-
achievedAt:
|
|
1268
|
+
milestone: z9.discriminatedUnion("status", [
|
|
1269
|
+
z9.object({ status: z9.literal("pending") }),
|
|
1270
|
+
z9.object({
|
|
1271
|
+
status: z9.literal("awarded"),
|
|
1272
|
+
completion: z9.string(),
|
|
1273
|
+
achievedAt: z9.number().int()
|
|
1217
1274
|
}),
|
|
1218
|
-
|
|
1219
|
-
status:
|
|
1220
|
-
budget:
|
|
1221
|
-
achievedAt:
|
|
1275
|
+
z9.object({
|
|
1276
|
+
status: z9.literal("budget-exhausted"),
|
|
1277
|
+
budget: z9.string(),
|
|
1278
|
+
achievedAt: z9.number().int()
|
|
1222
1279
|
})
|
|
1223
1280
|
])
|
|
1224
1281
|
});
|
|
1225
1282
|
|
|
1226
1283
|
// src/tracker-triggers.ts
|
|
1227
|
-
import { z as
|
|
1228
|
-
var timestamp4 =
|
|
1229
|
-
var count2 =
|
|
1230
|
-
var trackerTriggerModeSchema =
|
|
1284
|
+
import { z as z10 } from "zod";
|
|
1285
|
+
var timestamp4 = z10.number().int().safe().nonnegative().max(864e13);
|
|
1286
|
+
var count2 = z10.number().int().safe().nonnegative();
|
|
1287
|
+
var trackerTriggerModeSchema = z10.enum([
|
|
1231
1288
|
"new-record",
|
|
1232
1289
|
"new-observation",
|
|
1233
1290
|
"data-changed"
|
|
1234
1291
|
]);
|
|
1235
1292
|
function defaultTriggerMode(source) {
|
|
1236
|
-
return source === "
|
|
1293
|
+
return source === "custom" ? "new-observation" : "new-record";
|
|
1237
1294
|
}
|
|
1238
|
-
var trackerBoundSchema =
|
|
1239
|
-
|
|
1240
|
-
|
|
1295
|
+
var trackerBoundSchema = z10.union([
|
|
1296
|
+
z10.number().finite(),
|
|
1297
|
+
z10.strictObject({ setting: z10.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/) })
|
|
1241
1298
|
]);
|
|
1242
|
-
var dataPath =
|
|
1299
|
+
var dataPath = z10.string().max(200).regex(
|
|
1243
1300
|
/^[^.\s]+(\.[^.\s]+)*$/,
|
|
1244
1301
|
"Use dot-separated keys, such as metrics.likes"
|
|
1245
1302
|
);
|
|
1246
|
-
var trackerConditionSchema =
|
|
1247
|
-
|
|
1303
|
+
var trackerConditionSchema = z10.union([
|
|
1304
|
+
z10.strictObject({
|
|
1248
1305
|
path: dataPath,
|
|
1249
|
-
equals:
|
|
1306
|
+
equals: z10.union([z10.string().max(1e3), z10.number().finite(), z10.boolean()])
|
|
1250
1307
|
}),
|
|
1251
|
-
|
|
1308
|
+
z10.strictObject({
|
|
1252
1309
|
path: dataPath,
|
|
1253
1310
|
gt: trackerBoundSchema.optional(),
|
|
1254
1311
|
gte: trackerBoundSchema.optional(),
|
|
@@ -1261,9 +1318,9 @@ var trackerConditionSchema = z9.union([
|
|
|
1261
1318
|
"Compare with equals, gt, gte, lt or lte"
|
|
1262
1319
|
)
|
|
1263
1320
|
]);
|
|
1264
|
-
var trackerWhereSchema =
|
|
1321
|
+
var trackerWhereSchema = z10.union([
|
|
1265
1322
|
trackerConditionSchema,
|
|
1266
|
-
|
|
1323
|
+
z10.array(trackerConditionSchema).min(1).max(10)
|
|
1267
1324
|
]);
|
|
1268
1325
|
function whereConditions(where) {
|
|
1269
1326
|
return where === void 0 ? [] : Array.isArray(where) ? where : [where];
|
|
@@ -1275,19 +1332,23 @@ function whereSettings(where) {
|
|
|
1275
1332
|
)
|
|
1276
1333
|
);
|
|
1277
1334
|
}
|
|
1278
|
-
var trackerTriggerPolicySchema =
|
|
1335
|
+
var trackerTriggerPolicySchema = z10.strictObject({
|
|
1279
1336
|
/** The tracker's authoring key; publication binds it to the tracker's stable ID. */
|
|
1280
1337
|
tracker: identifier,
|
|
1281
|
-
|
|
1338
|
+
/**
|
|
1339
|
+
* The tracker's source kind, one of `trackerSourceKinds` today. An open string, so readers of
|
|
1340
|
+
* releases keep parsing them when a later Relay adds a managed source.
|
|
1341
|
+
*/
|
|
1342
|
+
source: z10.string().min(1).max(100),
|
|
1282
1343
|
/** Which observations fire; absent means the source's default (`defaultTriggerMode`). */
|
|
1283
1344
|
on: trackerTriggerModeSchema.optional(),
|
|
1284
1345
|
where: trackerWhereSchema.optional(),
|
|
1285
1346
|
/**
|
|
1286
|
-
* The record account the quest pays: `author`, `inReplyTo` for an X post,
|
|
1287
|
-
* a custom record. Relay attributes it through verified links; evaluators cannot redirect it.
|
|
1347
|
+
* The record account the quest pays: `author`, `inReplyTo` for an X post, `messageAuthor` for a
|
|
1348
|
+
* Discord reaction, or a named account of a custom record. Relay attributes it through verified links; evaluators cannot redirect it.
|
|
1288
1349
|
* Releases published before account roles store `"replied-to"` for `inReplyTo`.
|
|
1289
1350
|
*/
|
|
1290
|
-
beneficiary:
|
|
1351
|
+
beneficiary: z10.union([accountRoleSchema, z10.literal("replied-to")])
|
|
1291
1352
|
});
|
|
1292
1353
|
function triggerMode(policy) {
|
|
1293
1354
|
return policy.on ?? defaultTriggerMode(policy.source);
|
|
@@ -1296,52 +1357,52 @@ function beneficiaryRole(policy) {
|
|
|
1296
1357
|
return policy.beneficiary === "replied-to" ? "inReplyTo" : policy.beneficiary;
|
|
1297
1358
|
}
|
|
1298
1359
|
var xLink = {
|
|
1299
|
-
issuer:
|
|
1360
|
+
issuer: z10.string().min(1),
|
|
1300
1361
|
/** The account's stable user ID. */
|
|
1301
|
-
subject:
|
|
1362
|
+
subject: z10.string().min(1).max(256),
|
|
1302
1363
|
/** The member's account selection revision. */
|
|
1303
1364
|
revision: count2,
|
|
1304
1365
|
/** When the member linked the account; null when unknown. */
|
|
1305
1366
|
linkedAt: timestamp4.nullable()
|
|
1306
1367
|
};
|
|
1307
|
-
var trackerAttributionSchema =
|
|
1368
|
+
var trackerAttributionSchema = z10.strictObject({
|
|
1308
1369
|
member: identifier,
|
|
1309
1370
|
capturedAt: timestamp4,
|
|
1310
|
-
account:
|
|
1311
|
-
|
|
1312
|
-
provider:
|
|
1371
|
+
account: z10.discriminatedUnion("provider", [
|
|
1372
|
+
z10.strictObject({
|
|
1373
|
+
provider: z10.literal("wallet"),
|
|
1313
1374
|
/** Canonical CAIP-10 account ID, as the record names it. */
|
|
1314
|
-
id:
|
|
1375
|
+
id: z10.string().min(5).max(256),
|
|
1315
1376
|
/** The wallet link's revision. */
|
|
1316
1377
|
revision: count2,
|
|
1317
1378
|
/** When the member verified the wallet. */
|
|
1318
1379
|
linkedAt: timestamp4.nullable()
|
|
1319
1380
|
}),
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
provider:
|
|
1381
|
+
z10.strictObject({ provider: z10.literal("x"), ...xLink }),
|
|
1382
|
+
z10.strictObject({ provider: z10.literal("discord"), ...xLink }),
|
|
1383
|
+
z10.strictObject({
|
|
1384
|
+
provider: z10.literal("member"),
|
|
1324
1385
|
/** The member ID the record names. */
|
|
1325
1386
|
id: identifier
|
|
1326
1387
|
})
|
|
1327
1388
|
])
|
|
1328
1389
|
});
|
|
1329
|
-
var trackerTriggerRecordSchema =
|
|
1330
|
-
id:
|
|
1331
|
-
source:
|
|
1390
|
+
var trackerTriggerRecordSchema = z10.strictObject({
|
|
1391
|
+
id: z10.string().min(1).max(256),
|
|
1392
|
+
source: z10.string(),
|
|
1332
1393
|
occurredAt: timestamp4,
|
|
1333
1394
|
observedAt: timestamp4,
|
|
1334
1395
|
firstSeenAt: timestamp4,
|
|
1335
|
-
author:
|
|
1336
|
-
id:
|
|
1337
|
-
verified:
|
|
1396
|
+
author: z10.strictObject({
|
|
1397
|
+
id: z10.string().min(1).max(256),
|
|
1398
|
+
verified: z10.boolean().nullable(),
|
|
1338
1399
|
kind: identityKindSchema.optional()
|
|
1339
1400
|
}).nullable(),
|
|
1340
|
-
accounts:
|
|
1341
|
-
data:
|
|
1342
|
-
removed:
|
|
1401
|
+
accounts: z10.record(accountRoleSchema, trackerAccountSchema).optional(),
|
|
1402
|
+
data: z10.record(z10.string(), z10.json()),
|
|
1403
|
+
removed: z10.boolean()
|
|
1343
1404
|
});
|
|
1344
|
-
var trackerTriggerContextSchema =
|
|
1405
|
+
var trackerTriggerContextSchema = z10.strictObject({
|
|
1345
1406
|
/** The tracker's stable ID. */
|
|
1346
1407
|
tracker: identifier,
|
|
1347
1408
|
/** The tracker's authoring key. */
|
|
@@ -1350,111 +1411,70 @@ var trackerTriggerContextSchema = z9.strictObject({
|
|
|
1350
1411
|
* The record account the attempt pays, as the quest's release names it. Releases published
|
|
1351
1412
|
* before account roles name `inReplyTo` `"replied-to"`, which their bundled evaluators expect.
|
|
1352
1413
|
*/
|
|
1353
|
-
beneficiary:
|
|
1414
|
+
beneficiary: z10.union([accountRoleSchema, z10.literal("replied-to")]),
|
|
1354
1415
|
record: trackerTriggerRecordSchema,
|
|
1355
|
-
/** The captured X post of this observation; null for
|
|
1356
|
-
x:
|
|
1416
|
+
/** The captured X post of this observation; null for other trackers. */
|
|
1417
|
+
x: z10.strictObject({
|
|
1357
1418
|
evidence: trackerEvidenceSchema,
|
|
1358
1419
|
content: xContentBodySchema
|
|
1359
1420
|
}).nullable(),
|
|
1360
1421
|
attribution: trackerAttributionSchema
|
|
1361
1422
|
});
|
|
1362
1423
|
|
|
1363
|
-
// src/
|
|
1364
|
-
import { z as
|
|
1365
|
-
var name =
|
|
1366
|
-
var
|
|
1367
|
-
id: name,
|
|
1368
|
-
source: name,
|
|
1369
|
-
type: name,
|
|
1370
|
-
member: identifier,
|
|
1371
|
-
actor: z10.object({ provider: identifier, subject: z10.string().min(1).max(200) }).strict().optional(),
|
|
1372
|
-
occurredAt: z10.number().int().nonnegative().max(864e13),
|
|
1373
|
-
data: z10.record(z10.string(), z10.json())
|
|
1374
|
-
}).strict().refine(
|
|
1375
|
-
(value) => JSON.stringify(value.data).length <= 32768,
|
|
1376
|
-
"Observation data exceeds 32 KB"
|
|
1377
|
-
);
|
|
1378
|
-
var observationSchema = observationInputSchema.safeExtend({
|
|
1379
|
-
receivedAt: z10.number().int().nonnegative()
|
|
1380
|
-
});
|
|
1381
|
-
var observationTriggerSchema = z10.object({ source: name, type: name }).strict();
|
|
1382
|
-
var completionPolicySchema = z10.discriminatedUnion("kind", [
|
|
1424
|
+
// src/completion.ts
|
|
1425
|
+
import { z as z11 } from "zod";
|
|
1426
|
+
var name = z11.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,199}$/);
|
|
1427
|
+
var completionPolicySchema = z11.discriminatedUnion("kind", [
|
|
1383
1428
|
streakPolicySchema,
|
|
1384
|
-
|
|
1385
|
-
|
|
1429
|
+
z11.object({ kind: z11.literal("once") }).strict(),
|
|
1430
|
+
z11.object({ kind: z11.literal("keyed") }).strict()
|
|
1386
1431
|
]);
|
|
1387
|
-
var completionKeySchema =
|
|
1388
|
-
var budgetSchema =
|
|
1432
|
+
var completionKeySchema = z11.string().min(1).max(500);
|
|
1433
|
+
var budgetSchema = z11.object({
|
|
1389
1434
|
id: name,
|
|
1390
|
-
scope:
|
|
1435
|
+
scope: z11.enum(["member", "project"]),
|
|
1391
1436
|
/**
|
|
1392
1437
|
* The project calendar period of the attempt's eligibility time that one bucket covers:
|
|
1393
1438
|
* `"day"`, `"week"` (ISO, starting on Monday) or `"month"` in the project timezone.
|
|
1394
1439
|
* `"lifetime"` never resets.
|
|
1395
1440
|
*/
|
|
1396
1441
|
period: calendarPeriodSchema,
|
|
1397
|
-
limit:
|
|
1398
|
-
cost:
|
|
1399
|
-
|
|
1400
|
-
|
|
1442
|
+
limit: z11.number().int().positive().max(Number.MAX_SAFE_INTEGER),
|
|
1443
|
+
cost: z11.union([
|
|
1444
|
+
z11.number().int().positive().max(Number.MAX_SAFE_INTEGER),
|
|
1445
|
+
z11.object({ balance: name }).strict()
|
|
1401
1446
|
])
|
|
1402
1447
|
}).strict();
|
|
1403
|
-
var observationReceiptSchema = z10.object({
|
|
1404
|
-
id: name,
|
|
1405
|
-
source: name,
|
|
1406
|
-
attempts: z10.array(z10.string()),
|
|
1407
|
-
receivedAt: z10.number()
|
|
1408
|
-
});
|
|
1409
|
-
var discordReactionSchema = z10.object({
|
|
1410
|
-
guildId: z10.string(),
|
|
1411
|
-
channelId: z10.string(),
|
|
1412
|
-
messageId: z10.string(),
|
|
1413
|
-
userId: z10.string(),
|
|
1414
|
-
messageAuthorId: z10.string().nullable().default(null),
|
|
1415
|
-
actorRoles: z10.array(z10.string()).default([]),
|
|
1416
|
-
emoji: z10.object({ id: z10.string().nullable(), name: z10.string() }),
|
|
1417
|
-
messagePublishedAt: z10.number()
|
|
1418
|
-
}).strict();
|
|
1419
|
-
var discordMessageSchema = z10.object({
|
|
1420
|
-
guildId: z10.string(),
|
|
1421
|
-
channelId: z10.string(),
|
|
1422
|
-
messageId: z10.string(),
|
|
1423
|
-
userId: z10.string(),
|
|
1424
|
-
content: z10.string().nullable(),
|
|
1425
|
-
replyTo: z10.string().nullable(),
|
|
1426
|
-
publishedAt: z10.number()
|
|
1427
|
-
}).strict();
|
|
1428
1448
|
|
|
1429
1449
|
// src/integrations.ts
|
|
1430
|
-
import { z as
|
|
1431
|
-
var integrationProviderSchema =
|
|
1432
|
-
var discordServerSchema =
|
|
1433
|
-
id:
|
|
1434
|
-
name:
|
|
1435
|
-
icon:
|
|
1450
|
+
import { z as z12 } from "zod";
|
|
1451
|
+
var integrationProviderSchema = z12.enum(["discord"]);
|
|
1452
|
+
var discordServerSchema = z12.object({
|
|
1453
|
+
id: z12.string().regex(/^[0-9]{1,20}$/),
|
|
1454
|
+
name: z12.string().min(1),
|
|
1455
|
+
icon: z12.string().nullable()
|
|
1436
1456
|
});
|
|
1437
|
-
var projectIntegrationSchema =
|
|
1457
|
+
var projectIntegrationSchema = z12.object({
|
|
1438
1458
|
provider: integrationProviderSchema,
|
|
1439
|
-
configured:
|
|
1440
|
-
status:
|
|
1441
|
-
revision:
|
|
1459
|
+
configured: z12.boolean(),
|
|
1460
|
+
status: z12.enum(["disconnected", "ready", "attention"]),
|
|
1461
|
+
revision: z12.number().int().nonnegative(),
|
|
1442
1462
|
server: discordServerSchema.nullable(),
|
|
1443
|
-
issue:
|
|
1444
|
-
connectedAt:
|
|
1463
|
+
issue: z12.string().nullable(),
|
|
1464
|
+
connectedAt: z12.number().default(0)
|
|
1445
1465
|
});
|
|
1446
1466
|
|
|
1447
1467
|
// src/submission-input.ts
|
|
1448
|
-
import { z as
|
|
1449
|
-
var textOptionsSchema =
|
|
1450
|
-
required:
|
|
1451
|
-
minLength:
|
|
1452
|
-
maxLength:
|
|
1468
|
+
import { z as z13 } from "zod";
|
|
1469
|
+
var textOptionsSchema = z13.object({
|
|
1470
|
+
required: z13.boolean().default(true),
|
|
1471
|
+
minLength: z13.number().int().min(0).max(1e4).default(1),
|
|
1472
|
+
maxLength: z13.number().int().min(1).max(1e4).default(1e4)
|
|
1453
1473
|
}).strict().refine(
|
|
1454
1474
|
(v) => v.minLength <= v.maxLength,
|
|
1455
1475
|
"minLength must not exceed maxLength"
|
|
1456
1476
|
);
|
|
1457
|
-
var hostSchema =
|
|
1477
|
+
var hostSchema = z13.string().min(1).max(253).refine((host) => {
|
|
1458
1478
|
if (!/^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/i.test(host) || host.includes("..")) {
|
|
1459
1479
|
return false;
|
|
1460
1480
|
}
|
|
@@ -1465,13 +1485,13 @@ var hostSchema = z12.string().min(1).max(253).refine((host) => {
|
|
|
1465
1485
|
return false;
|
|
1466
1486
|
}
|
|
1467
1487
|
}, "Use a hostname without a scheme, path, port, or wildcard");
|
|
1468
|
-
var urlOptionsSchema =
|
|
1469
|
-
required:
|
|
1470
|
-
allowedHosts:
|
|
1488
|
+
var urlOptionsSchema = z13.object({
|
|
1489
|
+
required: z13.boolean().default(true),
|
|
1490
|
+
allowedHosts: z13.array(hostSchema).min(1).max(100).optional()
|
|
1471
1491
|
}).strict();
|
|
1472
|
-
var textEvidenceSchema =
|
|
1473
|
-
var urlEvidenceSchema =
|
|
1474
|
-
var valueEvidenceSchema =
|
|
1492
|
+
var textEvidenceSchema = z13.object({ kind: z13.literal("text"), value: z13.string().max(1e4) }).strict();
|
|
1493
|
+
var urlEvidenceSchema = z13.object({ kind: z13.literal("url"), value: z13.string().max(2048) }).strict();
|
|
1494
|
+
var valueEvidenceSchema = z13.discriminatedUnion("kind", [
|
|
1475
1495
|
textEvidenceSchema,
|
|
1476
1496
|
urlEvidenceSchema
|
|
1477
1497
|
]);
|
|
@@ -1534,22 +1554,22 @@ function xPostId(value) {
|
|
|
1534
1554
|
}
|
|
1535
1555
|
|
|
1536
1556
|
// src/quiz.ts
|
|
1537
|
-
import { z as
|
|
1538
|
-
var quizId =
|
|
1539
|
-
var quizChoiceSchema =
|
|
1540
|
-
var quizQuestionSchema =
|
|
1557
|
+
import { z as z14 } from "zod";
|
|
1558
|
+
var quizId = z14.string().regex(/^[a-zA-Z0-9_-]+$/).max(100);
|
|
1559
|
+
var quizChoiceSchema = z14.object({ id: quizId, label: z14.string().trim().min(1).max(500) }).strict();
|
|
1560
|
+
var quizQuestionSchema = z14.object({
|
|
1541
1561
|
id: quizId,
|
|
1542
|
-
prompt:
|
|
1543
|
-
choices:
|
|
1562
|
+
prompt: z14.string().trim().min(1).max(1e3),
|
|
1563
|
+
choices: z14.array(quizChoiceSchema).min(2).max(8).refine(
|
|
1544
1564
|
(choices) => new Set(choices.map((choice) => choice.id)).size === choices.length,
|
|
1545
1565
|
"Choice IDs must be unique"
|
|
1546
1566
|
)
|
|
1547
1567
|
}).strict();
|
|
1548
|
-
var quizQuestionsSchema =
|
|
1568
|
+
var quizQuestionsSchema = z14.array(quizQuestionSchema).min(1).max(20).refine(
|
|
1549
1569
|
(questions) => new Set(questions.map((question) => question.id)).size === questions.length,
|
|
1550
1570
|
"Question IDs must be unique"
|
|
1551
1571
|
);
|
|
1552
|
-
var quizContentSchema =
|
|
1572
|
+
var quizContentSchema = z14.array(
|
|
1553
1573
|
quizQuestionSchema.extend({ correct: quizId }).refine(
|
|
1554
1574
|
(question) => question.choices.some((choice) => choice.id === question.correct),
|
|
1555
1575
|
"Choose a correct answer from the available choices"
|
|
@@ -1560,97 +1580,97 @@ var quizContentSchema = z13.array(
|
|
|
1560
1580
|
);
|
|
1561
1581
|
|
|
1562
1582
|
// src/resources.ts
|
|
1563
|
-
import { z as
|
|
1564
|
-
var channelSourceSchema =
|
|
1565
|
-
provider:
|
|
1566
|
-
resource:
|
|
1567
|
-
types:
|
|
1583
|
+
import { z as z15 } from "zod";
|
|
1584
|
+
var channelSourceSchema = z15.object({
|
|
1585
|
+
provider: z15.literal("discord"),
|
|
1586
|
+
resource: z15.literal("channel"),
|
|
1587
|
+
types: z15.array(z15.enum(["text", "announcement"])).min(1)
|
|
1568
1588
|
}).strict();
|
|
1569
|
-
var resourceSourceSchema =
|
|
1570
|
-
|
|
1571
|
-
provider:
|
|
1572
|
-
resource:
|
|
1589
|
+
var resourceSourceSchema = z15.union([
|
|
1590
|
+
z15.object({
|
|
1591
|
+
provider: z15.literal("domino"),
|
|
1592
|
+
resource: z15.literal("point-ledger")
|
|
1573
1593
|
}).strict(),
|
|
1574
1594
|
channelSourceSchema,
|
|
1575
|
-
|
|
1576
|
-
provider:
|
|
1577
|
-
resource:
|
|
1578
|
-
assignable:
|
|
1595
|
+
z15.object({
|
|
1596
|
+
provider: z15.literal("discord"),
|
|
1597
|
+
resource: z15.literal("role"),
|
|
1598
|
+
assignable: z15.boolean().default(false)
|
|
1579
1599
|
}).strict()
|
|
1580
1600
|
]);
|
|
1581
|
-
var resourceRequestSchema =
|
|
1601
|
+
var resourceRequestSchema = z15.object({
|
|
1582
1602
|
source: resourceSourceSchema,
|
|
1583
|
-
query:
|
|
1584
|
-
cursor:
|
|
1585
|
-
ids:
|
|
1603
|
+
query: z15.string().max(100).optional(),
|
|
1604
|
+
cursor: z15.string().regex(/^\d{1,6}$/).optional(),
|
|
1605
|
+
ids: z15.array(z15.string().min(1).max(100)).max(50).optional()
|
|
1586
1606
|
}).strict();
|
|
1587
|
-
var resourceOptionsSchema =
|
|
1588
|
-
revision:
|
|
1589
|
-
options:
|
|
1590
|
-
|
|
1591
|
-
id:
|
|
1592
|
-
label:
|
|
1593
|
-
description:
|
|
1594
|
-
group:
|
|
1595
|
-
disabledReason:
|
|
1607
|
+
var resourceOptionsSchema = z15.object({
|
|
1608
|
+
revision: z15.number().int(),
|
|
1609
|
+
options: z15.array(
|
|
1610
|
+
z15.object({
|
|
1611
|
+
id: z15.string(),
|
|
1612
|
+
label: z15.string(),
|
|
1613
|
+
description: z15.string().optional(),
|
|
1614
|
+
group: z15.string().optional(),
|
|
1615
|
+
disabledReason: z15.string().optional()
|
|
1596
1616
|
})
|
|
1597
1617
|
),
|
|
1598
|
-
cursor:
|
|
1618
|
+
cursor: z15.string().nullable()
|
|
1599
1619
|
});
|
|
1600
1620
|
|
|
1601
1621
|
// src/settings.ts
|
|
1602
|
-
import { z as
|
|
1622
|
+
import { z as z17 } from "zod";
|
|
1603
1623
|
|
|
1604
1624
|
// src/setting-values.ts
|
|
1605
|
-
import { z as
|
|
1606
|
-
var settingInstant =
|
|
1607
|
-
var settingResourceId =
|
|
1608
|
-
|
|
1609
|
-
|
|
1625
|
+
import { z as z16 } from "zod";
|
|
1626
|
+
var settingInstant = z16.iso.datetime({ offset: true }).transform((value) => new Date(value).toISOString());
|
|
1627
|
+
var settingResourceId = z16.union([
|
|
1628
|
+
z16.literal(""),
|
|
1629
|
+
z16.string().regex(/^\S{1,200}$/)
|
|
1610
1630
|
]);
|
|
1611
1631
|
|
|
1612
1632
|
// src/settings.ts
|
|
1613
|
-
var base = { label:
|
|
1614
|
-
var settingFieldSchema =
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1633
|
+
var base = { label: z17.string().min(1), description: z17.string().optional() };
|
|
1634
|
+
var settingFieldSchema = z17.discriminatedUnion("kind", [
|
|
1635
|
+
z17.object({ ...base, kind: z17.literal("point-ledger"), default: identifier }).strict(),
|
|
1636
|
+
z17.object({ ...base, kind: z17.literal("datetime"), default: settingInstant }).strict(),
|
|
1637
|
+
z17.object({
|
|
1618
1638
|
...base,
|
|
1619
|
-
kind:
|
|
1639
|
+
kind: z17.literal("resource"),
|
|
1620
1640
|
default: settingResourceId,
|
|
1621
1641
|
source: resourceSourceSchema
|
|
1622
1642
|
}).strict(),
|
|
1623
|
-
|
|
1624
|
-
|
|
1643
|
+
z17.object({ ...base, kind: z17.literal("quiz"), default: quizContentSchema }).strict(),
|
|
1644
|
+
z17.object({
|
|
1625
1645
|
...base,
|
|
1626
|
-
kind:
|
|
1627
|
-
default:
|
|
1628
|
-
minLength:
|
|
1629
|
-
maxLength:
|
|
1630
|
-
multiline:
|
|
1646
|
+
kind: z17.literal("text"),
|
|
1647
|
+
default: z17.string(),
|
|
1648
|
+
minLength: z17.number().int().nonnegative(),
|
|
1649
|
+
maxLength: z17.number().int().positive(),
|
|
1650
|
+
multiline: z17.boolean()
|
|
1631
1651
|
}).strict(),
|
|
1632
|
-
|
|
1652
|
+
z17.object({
|
|
1633
1653
|
...base,
|
|
1634
|
-
kind:
|
|
1635
|
-
default:
|
|
1636
|
-
min:
|
|
1637
|
-
max:
|
|
1654
|
+
kind: z17.literal("integer"),
|
|
1655
|
+
default: z17.number().int(),
|
|
1656
|
+
min: z17.number().int(),
|
|
1657
|
+
max: z17.number().int()
|
|
1638
1658
|
}).strict(),
|
|
1639
|
-
|
|
1640
|
-
|
|
1659
|
+
z17.object({ ...base, kind: z17.literal("boolean"), default: z17.boolean() }).strict(),
|
|
1660
|
+
z17.object({
|
|
1641
1661
|
...base,
|
|
1642
|
-
kind:
|
|
1643
|
-
default:
|
|
1644
|
-
options:
|
|
1662
|
+
kind: z17.literal("choice"),
|
|
1663
|
+
default: z17.string(),
|
|
1664
|
+
options: z17.array(z17.string().min(1)).min(1)
|
|
1645
1665
|
}).strict()
|
|
1646
1666
|
]);
|
|
1647
|
-
var settingsFieldsSchema =
|
|
1648
|
-
|
|
1667
|
+
var settingsFieldsSchema = z17.record(
|
|
1668
|
+
z17.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/),
|
|
1649
1669
|
settingFieldSchema
|
|
1650
1670
|
);
|
|
1651
|
-
var settingsValuesSchema =
|
|
1652
|
-
|
|
1653
|
-
|
|
1671
|
+
var settingsValuesSchema = z17.record(
|
|
1672
|
+
z17.string(),
|
|
1673
|
+
z17.union([z17.string(), z17.number().finite(), z17.boolean(), quizContentSchema])
|
|
1654
1674
|
);
|
|
1655
1675
|
function parseSettings(fields, input) {
|
|
1656
1676
|
const shape = {};
|
|
@@ -1669,20 +1689,20 @@ function parseSettings(fields, input) {
|
|
|
1669
1689
|
shape[key] = quizContentSchema.default(field.default);
|
|
1670
1690
|
break;
|
|
1671
1691
|
case "text":
|
|
1672
|
-
shape[key] =
|
|
1692
|
+
shape[key] = z17.string().min(field.minLength).max(field.maxLength).default(field.default);
|
|
1673
1693
|
break;
|
|
1674
1694
|
case "integer":
|
|
1675
|
-
shape[key] =
|
|
1695
|
+
shape[key] = z17.number().int().min(field.min).max(field.max).default(field.default);
|
|
1676
1696
|
break;
|
|
1677
1697
|
case "boolean":
|
|
1678
|
-
shape[key] =
|
|
1698
|
+
shape[key] = z17.boolean().default(field.default);
|
|
1679
1699
|
break;
|
|
1680
1700
|
case "choice":
|
|
1681
|
-
shape[key] =
|
|
1701
|
+
shape[key] = z17.enum(field.options).default(field.default);
|
|
1682
1702
|
break;
|
|
1683
1703
|
}
|
|
1684
1704
|
}
|
|
1685
|
-
return settingsValuesSchema.parse(
|
|
1705
|
+
return settingsValuesSchema.parse(z17.object(shape).strict().parse(input));
|
|
1686
1706
|
}
|
|
1687
1707
|
function missingResourceSettings(fields, values) {
|
|
1688
1708
|
return Object.entries(fields).filter(([key, field]) => field.kind === "resource" && !values[key]).map(([key]) => key);
|
|
@@ -1692,43 +1712,43 @@ function compatibleSettingKinds(previous, next) {
|
|
|
1692
1712
|
}
|
|
1693
1713
|
|
|
1694
1714
|
// src/schema.ts
|
|
1695
|
-
import { z as
|
|
1696
|
-
var pointsRewardSchema =
|
|
1697
|
-
kind:
|
|
1715
|
+
import { z as z18 } from "zod";
|
|
1716
|
+
var pointsRewardSchema = z18.object({
|
|
1717
|
+
kind: z18.literal("points").default("points"),
|
|
1698
1718
|
balance: identifier,
|
|
1699
|
-
amount:
|
|
1719
|
+
amount: z18.number().int().min(0).max(1e4)
|
|
1700
1720
|
}).strict();
|
|
1701
|
-
var tieredRewardDefinitionSchema =
|
|
1721
|
+
var tieredRewardDefinitionSchema = z18.object({
|
|
1702
1722
|
id: identifier,
|
|
1703
|
-
title:
|
|
1704
|
-
tiers:
|
|
1705
|
-
|
|
1723
|
+
title: z18.string().min(1).max(120),
|
|
1724
|
+
tiers: z18.array(
|
|
1725
|
+
z18.object({ id: identifier, title: z18.string().min(1).max(120) }).strict()
|
|
1706
1726
|
).min(1).max(20).refine(
|
|
1707
1727
|
(tiers) => new Set(tiers.map((t) => t.id)).size === tiers.length,
|
|
1708
1728
|
"Tier IDs must be unique"
|
|
1709
1729
|
),
|
|
1710
|
-
inventory:
|
|
1711
|
-
fulfillment:
|
|
1730
|
+
inventory: z18.object({ kind: z18.literal("untracked") }).strict(),
|
|
1731
|
+
fulfillment: z18.object({ kind: z18.literal("staff-handover") }).strict()
|
|
1712
1732
|
}).strict();
|
|
1713
|
-
var tieredRewardReferenceSchema =
|
|
1733
|
+
var tieredRewardReferenceSchema = z18.object({
|
|
1714
1734
|
id: identifier,
|
|
1715
1735
|
key: identifier.nullable()
|
|
1716
1736
|
});
|
|
1717
|
-
var tierRewardSchema =
|
|
1718
|
-
kind:
|
|
1737
|
+
var tierRewardSchema = z18.object({
|
|
1738
|
+
kind: z18.literal("tier"),
|
|
1719
1739
|
reward: tieredRewardDefinitionSchema,
|
|
1720
1740
|
tier: identifier
|
|
1721
1741
|
}).strict().refine(
|
|
1722
1742
|
(value) => value.reward.tiers.some((t) => t.id === value.tier),
|
|
1723
1743
|
"Unknown reward tier"
|
|
1724
1744
|
);
|
|
1725
|
-
var integrationRewardSchema =
|
|
1726
|
-
kind:
|
|
1727
|
-
provider:
|
|
1728
|
-
action:
|
|
1729
|
-
roleId:
|
|
1745
|
+
var integrationRewardSchema = z18.object({
|
|
1746
|
+
kind: z18.literal("integration"),
|
|
1747
|
+
provider: z18.literal("discord"),
|
|
1748
|
+
action: z18.literal("grant-role"),
|
|
1749
|
+
roleId: z18.string().regex(/^[0-9]{1,20}$/)
|
|
1730
1750
|
}).strict();
|
|
1731
|
-
var rewardSchema =
|
|
1751
|
+
var rewardSchema = z18.union([
|
|
1732
1752
|
pointsRewardSchema,
|
|
1733
1753
|
tierRewardSchema,
|
|
1734
1754
|
integrationRewardSchema
|
|
@@ -1739,76 +1759,75 @@ function rewardKey(reward) {
|
|
|
1739
1759
|
}
|
|
1740
1760
|
return reward.kind === "points" ? "points:" + reward.balance : "tier:" + reward.reward.id;
|
|
1741
1761
|
}
|
|
1742
|
-
var triggerSchema =
|
|
1743
|
-
|
|
1744
|
-
kind:
|
|
1745
|
-
input:
|
|
1762
|
+
var triggerSchema = z18.union([
|
|
1763
|
+
z18.object({
|
|
1764
|
+
kind: z18.literal("manual"),
|
|
1765
|
+
input: z18.literal("text"),
|
|
1746
1766
|
constraints: textOptionsSchema,
|
|
1747
|
-
actor:
|
|
1767
|
+
actor: z18.enum(["member", "staff"]).optional()
|
|
1748
1768
|
}).strict(),
|
|
1749
|
-
|
|
1750
|
-
kind:
|
|
1751
|
-
input:
|
|
1769
|
+
z18.object({
|
|
1770
|
+
kind: z18.literal("manual"),
|
|
1771
|
+
input: z18.literal("url"),
|
|
1752
1772
|
constraints: urlOptionsSchema,
|
|
1753
|
-
actor:
|
|
1773
|
+
actor: z18.enum(["member", "staff"]).optional()
|
|
1754
1774
|
}).strict(),
|
|
1755
|
-
|
|
1756
|
-
kind:
|
|
1757
|
-
input:
|
|
1758
|
-
actor:
|
|
1775
|
+
z18.object({
|
|
1776
|
+
kind: z18.literal("manual"),
|
|
1777
|
+
input: z18.enum(["photo", "quiz", "none"]),
|
|
1778
|
+
actor: z18.enum(["member", "staff"]).optional()
|
|
1759
1779
|
}).strict(),
|
|
1760
|
-
|
|
1761
|
-
kind:
|
|
1762
|
-
observation: observationTriggerSchema.optional(),
|
|
1780
|
+
z18.object({
|
|
1781
|
+
kind: z18.literal("automatic"),
|
|
1763
1782
|
content: contentPolicySchema.optional(),
|
|
1764
1783
|
tracker: trackerTriggerPolicySchema.optional()
|
|
1765
1784
|
}).strict().refine(
|
|
1766
|
-
(value) =>
|
|
1785
|
+
(value) => !(value.content && value.tracker),
|
|
1767
1786
|
"Choose one automatic trigger source"
|
|
1768
1787
|
)
|
|
1769
1788
|
]);
|
|
1770
|
-
var prerequisiteSchema =
|
|
1771
|
-
var photoResultSchema =
|
|
1772
|
-
kind:
|
|
1773
|
-
reason:
|
|
1789
|
+
var prerequisiteSchema = z18.object({ quest: identifier });
|
|
1790
|
+
var photoResultSchema = z18.object({
|
|
1791
|
+
kind: z18.enum(["pass", "fail", "unclear"]),
|
|
1792
|
+
reason: z18.string().min(1).max(2e3)
|
|
1774
1793
|
}).strict();
|
|
1775
|
-
var textReviewInputSchema =
|
|
1776
|
-
text:
|
|
1777
|
-
criteria:
|
|
1794
|
+
var textReviewInputSchema = z18.object({
|
|
1795
|
+
text: z18.string().min(1).max(16e3).refine((value) => value.trim().length > 0, "Text must not be blank"),
|
|
1796
|
+
criteria: z18.string().trim().min(1).max(2e3)
|
|
1778
1797
|
}).strict();
|
|
1779
1798
|
var textResultSchema = photoResultSchema;
|
|
1780
|
-
var decisionSchema =
|
|
1781
|
-
|
|
1782
|
-
kind:
|
|
1783
|
-
rewards:
|
|
1799
|
+
var decisionSchema = z18.discriminatedUnion("kind", [
|
|
1800
|
+
z18.object({
|
|
1801
|
+
kind: z18.literal("accept"),
|
|
1802
|
+
rewards: z18.array(rewardSchema).max(10),
|
|
1784
1803
|
completionKey: completionKeySchema.optional()
|
|
1785
1804
|
}).strict(),
|
|
1786
|
-
|
|
1787
|
-
kind:
|
|
1788
|
-
reason:
|
|
1805
|
+
z18.object({
|
|
1806
|
+
kind: z18.literal("reject"),
|
|
1807
|
+
reason: z18.string().min(1).max(2e3),
|
|
1789
1808
|
/** The evaluator asked for human review, but review is off for the quest, so this is a reject. */
|
|
1790
|
-
requestedReview:
|
|
1809
|
+
requestedReview: z18.literal(true).optional()
|
|
1791
1810
|
}).strict(),
|
|
1792
|
-
|
|
1793
|
-
kind:
|
|
1794
|
-
reason:
|
|
1795
|
-
rewards:
|
|
1811
|
+
z18.object({
|
|
1812
|
+
kind: z18.literal("review"),
|
|
1813
|
+
reason: z18.string().min(1).max(2e3),
|
|
1814
|
+
rewards: z18.array(rewardSchema).max(10).optional(),
|
|
1796
1815
|
completionKey: completionKeySchema.optional()
|
|
1797
1816
|
}).strict()
|
|
1798
1817
|
]);
|
|
1799
|
-
var reviewModeSchema =
|
|
1800
|
-
var storedReviewModeSchema =
|
|
1818
|
+
var reviewModeSchema = z18.enum(["workers-ai"]);
|
|
1819
|
+
var storedReviewModeSchema = z18.enum([
|
|
1801
1820
|
"fixture-pass",
|
|
1802
1821
|
"fixture-fail",
|
|
1803
1822
|
"fixture-unclear",
|
|
1804
1823
|
"fixture-error",
|
|
1805
1824
|
"workers-ai"
|
|
1806
1825
|
]);
|
|
1807
|
-
var rewardBundleSchema =
|
|
1826
|
+
var rewardBundleSchema = z18.array(rewardSchema).max(10).refine(
|
|
1808
1827
|
(rewards) => new Set(rewards.map(rewardKey)).size === rewards.length,
|
|
1809
1828
|
"Use one entry per balance or shared reward"
|
|
1810
1829
|
);
|
|
1811
|
-
var mediaUrlSchema =
|
|
1830
|
+
var mediaUrlSchema = z18.string().max(2e3).refine((value) => {
|
|
1812
1831
|
if (/^\/(?!\/)[^\\\s]*$/.test(value)) {
|
|
1813
1832
|
return true;
|
|
1814
1833
|
}
|
|
@@ -1818,85 +1837,85 @@ var mediaUrlSchema = z17.string().max(2e3).refine((value) => {
|
|
|
1818
1837
|
return false;
|
|
1819
1838
|
}
|
|
1820
1839
|
}, "Use an HTTPS URL or a same-site path beginning with /");
|
|
1821
|
-
var questPresentationSchema =
|
|
1840
|
+
var questPresentationSchema = z18.object({
|
|
1822
1841
|
quiz: quizQuestionsSchema.optional(),
|
|
1823
|
-
instructions:
|
|
1824
|
-
video:
|
|
1842
|
+
instructions: z18.string().max(4e3).optional(),
|
|
1843
|
+
video: z18.object({
|
|
1825
1844
|
url: mediaUrlSchema,
|
|
1826
1845
|
poster: mediaUrlSchema.optional(),
|
|
1827
|
-
captions:
|
|
1846
|
+
captions: z18.object({
|
|
1828
1847
|
url: mediaUrlSchema,
|
|
1829
|
-
language:
|
|
1830
|
-
label:
|
|
1848
|
+
language: z18.string().min(2).max(20),
|
|
1849
|
+
label: z18.string().min(1).max(80)
|
|
1831
1850
|
}).strict().optional()
|
|
1832
1851
|
}).strict().optional()
|
|
1833
1852
|
}).strict();
|
|
1834
|
-
var questProfileSchema =
|
|
1835
|
-
var questDescriptionSchema =
|
|
1853
|
+
var questProfileSchema = z18.object({ visible: z18.boolean() }).strict();
|
|
1854
|
+
var questDescriptionSchema = z18.object({
|
|
1836
1855
|
quest: identifier,
|
|
1837
|
-
runtimeVersion:
|
|
1838
|
-
title:
|
|
1856
|
+
runtimeVersion: z18.union([z18.literal(1), z18.literal(2)]).default(1),
|
|
1857
|
+
title: z18.string().min(1).max(120),
|
|
1839
1858
|
presentation: questPresentationSchema.default({}),
|
|
1840
|
-
integrations:
|
|
1859
|
+
integrations: z18.array(integrationProviderSchema).max(10).default([]),
|
|
1841
1860
|
fields: settingsFieldsSchema,
|
|
1842
1861
|
values: settingsValuesSchema,
|
|
1843
1862
|
rewards: rewardBundleSchema,
|
|
1844
|
-
humanReview:
|
|
1863
|
+
humanReview: z18.boolean(),
|
|
1845
1864
|
trigger: triggerSchema,
|
|
1846
1865
|
performance: contentPerformancePolicySchema.optional(),
|
|
1847
|
-
requires:
|
|
1848
|
-
completion:
|
|
1849
|
-
visibility:
|
|
1866
|
+
requires: z18.array(prerequisiteSchema).max(30).default([]),
|
|
1867
|
+
completion: z18.preprocess(refuseStreakTimeZone, completionPolicySchema),
|
|
1868
|
+
visibility: z18.enum(["visible", "hidden"]).default("visible"),
|
|
1850
1869
|
/**
|
|
1851
1870
|
* Whether completions show on participant profiles (`/v1/profiles/:id/completions`). Absent
|
|
1852
1871
|
* is hidden. Optional, not defaulted: releases carry the key only when the author sets it, so
|
|
1853
1872
|
* clients and pods that predate it (strict release schemas) still read every other release.
|
|
1854
1873
|
*/
|
|
1855
1874
|
profile: questProfileSchema.optional(),
|
|
1856
|
-
budgets:
|
|
1875
|
+
budgets: z18.array(budgetSchema).max(20).default([])
|
|
1857
1876
|
}).strict();
|
|
1858
|
-
var artifactSchema =
|
|
1877
|
+
var artifactSchema = z18.object({ code: z18.string().min(1).max(1e6) }).strict();
|
|
1859
1878
|
var releaseSchema = artifactSchema.extend({
|
|
1860
1879
|
settings: settingsValuesSchema,
|
|
1861
1880
|
provider: reviewModeSchema,
|
|
1862
1881
|
expectedRelease: identifier.nullable().optional(),
|
|
1863
|
-
settingRenames:
|
|
1882
|
+
settingRenames: z18.record(z18.string(), z18.string()).optional()
|
|
1864
1883
|
}).strict();
|
|
1865
|
-
var batchReleaseSchema =
|
|
1866
|
-
var questSettingsInputSchema =
|
|
1884
|
+
var batchReleaseSchema = z18.object({ releases: z18.array(releaseSchema).min(1).max(50) }).strict();
|
|
1885
|
+
var questSettingsInputSchema = z18.object({
|
|
1867
1886
|
quest: identifier,
|
|
1868
1887
|
expectedRelease: identifier,
|
|
1869
1888
|
set: settingsValuesSchema,
|
|
1870
|
-
reset:
|
|
1889
|
+
reset: z18.array(z18.string())
|
|
1871
1890
|
}).strict();
|
|
1872
1891
|
var storedQuestDescriptionSchema = questDescriptionSchema.extend({
|
|
1873
1892
|
completion: completionPolicySchema
|
|
1874
1893
|
});
|
|
1875
1894
|
var storedReleaseSchema = storedQuestDescriptionSchema.extend({
|
|
1876
1895
|
key: identifier.optional(),
|
|
1877
|
-
code:
|
|
1896
|
+
code: z18.string(),
|
|
1878
1897
|
provider: storedReviewModeSchema,
|
|
1879
1898
|
id: identifier,
|
|
1880
|
-
createdAt:
|
|
1881
|
-
legacy:
|
|
1882
|
-
origin:
|
|
1883
|
-
lifecycle:
|
|
1884
|
-
configuration:
|
|
1899
|
+
createdAt: z18.number(),
|
|
1900
|
+
legacy: z18.boolean().default(false),
|
|
1901
|
+
origin: z18.object({ typeVersion: identifier }).strict().optional(),
|
|
1902
|
+
lifecycle: z18.enum(["active", "paused", "archived"]).default("active"),
|
|
1903
|
+
configuration: z18.object({
|
|
1885
1904
|
defaults: settingsValuesSchema,
|
|
1886
1905
|
overrides: settingsValuesSchema,
|
|
1887
|
-
preserved:
|
|
1906
|
+
preserved: z18.array(z18.string())
|
|
1888
1907
|
}).strict().optional()
|
|
1889
1908
|
});
|
|
1890
|
-
var legacyReleaseSchema =
|
|
1909
|
+
var legacyReleaseSchema = z18.object({
|
|
1891
1910
|
quest: identifier,
|
|
1892
|
-
title:
|
|
1893
|
-
criteria:
|
|
1894
|
-
humanReview:
|
|
1911
|
+
title: z18.string(),
|
|
1912
|
+
criteria: z18.string(),
|
|
1913
|
+
humanReview: z18.boolean(),
|
|
1895
1914
|
rewards: rewardBundleSchema,
|
|
1896
|
-
code:
|
|
1915
|
+
code: z18.string(),
|
|
1897
1916
|
provider: storedReviewModeSchema,
|
|
1898
1917
|
id: identifier,
|
|
1899
|
-
createdAt:
|
|
1918
|
+
createdAt: z18.number()
|
|
1900
1919
|
}).transform((r) => {
|
|
1901
1920
|
const { criteria, ...stored } = r;
|
|
1902
1921
|
return storedReleaseSchema.parse({
|
|
@@ -1908,15 +1927,15 @@ var legacyReleaseSchema = z17.object({
|
|
|
1908
1927
|
legacy: true
|
|
1909
1928
|
});
|
|
1910
1929
|
});
|
|
1911
|
-
var publishedReleaseSchema =
|
|
1930
|
+
var publishedReleaseSchema = z18.union([
|
|
1912
1931
|
storedReleaseSchema,
|
|
1913
1932
|
legacyReleaseSchema
|
|
1914
1933
|
]);
|
|
1915
|
-
var templateSchema =
|
|
1916
|
-
code:
|
|
1934
|
+
var templateSchema = z18.object({
|
|
1935
|
+
code: z18.string(),
|
|
1917
1936
|
definition: questDescriptionSchema
|
|
1918
1937
|
});
|
|
1919
|
-
var quizAnswersSchema =
|
|
1938
|
+
var quizAnswersSchema = z18.record(identifier, identifier).refine(
|
|
1920
1939
|
(answers) => Object.keys(answers).length > 0 && Object.keys(answers).length <= 50,
|
|
1921
1940
|
"Provide between 1 and 50 answers"
|
|
1922
1941
|
).transform(
|
|
@@ -1924,33 +1943,33 @@ var quizAnswersSchema = z17.record(identifier, identifier).refine(
|
|
|
1924
1943
|
Object.entries(answers).sort(([a], [b]) => a.localeCompare(b))
|
|
1925
1944
|
)
|
|
1926
1945
|
);
|
|
1927
|
-
var quizEvidenceSchema =
|
|
1928
|
-
kind:
|
|
1946
|
+
var quizEvidenceSchema = z18.object({
|
|
1947
|
+
kind: z18.literal("quiz"),
|
|
1929
1948
|
release: identifier.optional(),
|
|
1930
1949
|
answers: quizAnswersSchema
|
|
1931
1950
|
}).strict();
|
|
1932
|
-
var submissionEvidenceSchema =
|
|
1951
|
+
var submissionEvidenceSchema = z18.union([
|
|
1933
1952
|
quizEvidenceSchema,
|
|
1934
1953
|
textEvidenceSchema,
|
|
1935
1954
|
urlEvidenceSchema
|
|
1936
1955
|
]);
|
|
1937
|
-
var submitSchema =
|
|
1956
|
+
var submitSchema = z18.object({
|
|
1938
1957
|
actionId: identifier,
|
|
1939
1958
|
quest: identifier,
|
|
1940
1959
|
member: identifier,
|
|
1941
1960
|
evidence: identifier.optional(),
|
|
1942
1961
|
input: submissionEvidenceSchema.optional(),
|
|
1943
1962
|
release: identifier.optional(),
|
|
1944
|
-
faultAfterReview:
|
|
1963
|
+
faultAfterReview: z18.boolean().optional()
|
|
1945
1964
|
}).strict();
|
|
1946
|
-
var attemptSchema =
|
|
1965
|
+
var attemptSchema = z18.object({
|
|
1947
1966
|
id: identifier,
|
|
1948
1967
|
release: identifier,
|
|
1949
1968
|
quest: identifier,
|
|
1950
1969
|
member: identifier,
|
|
1951
1970
|
evidence: identifier.nullable(),
|
|
1952
1971
|
input: submissionEvidenceSchema.optional(),
|
|
1953
|
-
status:
|
|
1972
|
+
status: z18.enum([
|
|
1954
1973
|
"queued",
|
|
1955
1974
|
"evaluating",
|
|
1956
1975
|
"accepted",
|
|
@@ -1959,75 +1978,75 @@ var attemptSchema = z17.object({
|
|
|
1959
1978
|
"needs-review",
|
|
1960
1979
|
"failed"
|
|
1961
1980
|
]),
|
|
1962
|
-
reason:
|
|
1963
|
-
retries:
|
|
1964
|
-
generation:
|
|
1965
|
-
completion:
|
|
1981
|
+
reason: z18.string().nullable(),
|
|
1982
|
+
retries: z18.number(),
|
|
1983
|
+
generation: z18.number(),
|
|
1984
|
+
completion: z18.string().nullable(),
|
|
1966
1985
|
reviewRewards: rewardBundleSchema.nullable().default(null),
|
|
1967
1986
|
/**
|
|
1968
1987
|
* The evaluator asked for human review of a quest with review off, so Domino rejected the attempt
|
|
1969
1988
|
* with the evaluator's reason. Only set on a rejected attempt.
|
|
1970
1989
|
*/
|
|
1971
|
-
requestedReview:
|
|
1972
|
-
createdAt:
|
|
1973
|
-
});
|
|
1974
|
-
var eventSchema =
|
|
1975
|
-
id:
|
|
1976
|
-
attempt:
|
|
1977
|
-
kind:
|
|
1978
|
-
detail:
|
|
1979
|
-
actor:
|
|
1980
|
-
at:
|
|
1981
|
-
});
|
|
1982
|
-
var pickupSelectionSchema =
|
|
1990
|
+
requestedReview: z18.boolean().default(false),
|
|
1991
|
+
createdAt: z18.number()
|
|
1992
|
+
});
|
|
1993
|
+
var eventSchema = z18.object({
|
|
1994
|
+
id: z18.number(),
|
|
1995
|
+
attempt: z18.string().nullable(),
|
|
1996
|
+
kind: z18.string(),
|
|
1997
|
+
detail: z18.string(),
|
|
1998
|
+
actor: z18.string().nullable().default(null),
|
|
1999
|
+
at: z18.number()
|
|
2000
|
+
});
|
|
2001
|
+
var pickupSelectionSchema = z18.object({
|
|
1983
2002
|
item: identifier,
|
|
1984
|
-
revision:
|
|
2003
|
+
revision: z18.number().int().nonnegative()
|
|
1985
2004
|
}).strict();
|
|
1986
|
-
var pickupAllocationSchema =
|
|
2005
|
+
var pickupAllocationSchema = z18.object({
|
|
1987
2006
|
item: identifier,
|
|
1988
|
-
label:
|
|
2007
|
+
label: z18.string().min(1).max(80)
|
|
1989
2008
|
}).strict();
|
|
1990
|
-
var pickupPolicySchema =
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
kind:
|
|
1994
|
-
tiers:
|
|
1995
|
-
|
|
2009
|
+
var pickupPolicySchema = z18.discriminatedUnion("kind", [
|
|
2010
|
+
z18.object({ kind: z18.literal("untracked") }).strict(),
|
|
2011
|
+
z18.object({
|
|
2012
|
+
kind: z18.literal("at-pickup"),
|
|
2013
|
+
tiers: z18.array(
|
|
2014
|
+
z18.object({
|
|
1996
2015
|
tier: identifier,
|
|
1997
|
-
variants:
|
|
2016
|
+
variants: z18.array(pickupAllocationSchema).min(1).max(100)
|
|
1998
2017
|
}).strict()
|
|
1999
2018
|
).min(1).max(100)
|
|
2000
2019
|
}).strict()
|
|
2001
2020
|
]);
|
|
2002
|
-
var pickupCatalogSchema =
|
|
2021
|
+
var pickupCatalogSchema = z18.object({
|
|
2003
2022
|
reward: tieredRewardDefinitionSchema,
|
|
2004
|
-
revision:
|
|
2023
|
+
revision: z18.number().int().nonnegative(),
|
|
2005
2024
|
policy: pickupPolicySchema
|
|
2006
2025
|
});
|
|
2007
|
-
var pickupAvailabilitySchema =
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
kind:
|
|
2011
|
-
revision:
|
|
2012
|
-
variants:
|
|
2026
|
+
var pickupAvailabilitySchema = z18.discriminatedUnion("kind", [
|
|
2027
|
+
z18.object({ kind: z18.literal("untracked") }).strict(),
|
|
2028
|
+
z18.object({
|
|
2029
|
+
kind: z18.literal("at-pickup"),
|
|
2030
|
+
revision: z18.number().int().nonnegative(),
|
|
2031
|
+
variants: z18.array(
|
|
2013
2032
|
pickupAllocationSchema.extend({
|
|
2014
|
-
available:
|
|
2033
|
+
available: z18.number().int().nonnegative()
|
|
2015
2034
|
})
|
|
2016
2035
|
)
|
|
2017
2036
|
}).strict()
|
|
2018
2037
|
]);
|
|
2019
|
-
var configurePickupSchema =
|
|
2038
|
+
var configurePickupSchema = z18.object({
|
|
2020
2039
|
reward: identifier,
|
|
2021
|
-
revision:
|
|
2040
|
+
revision: z18.number().int().nonnegative(),
|
|
2022
2041
|
actionId: identifier,
|
|
2023
|
-
policy:
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
kind:
|
|
2027
|
-
tiers:
|
|
2028
|
-
|
|
2042
|
+
policy: z18.discriminatedUnion("kind", [
|
|
2043
|
+
z18.object({ kind: z18.literal("untracked") }).strict(),
|
|
2044
|
+
z18.object({
|
|
2045
|
+
kind: z18.literal("at-pickup"),
|
|
2046
|
+
tiers: z18.array(
|
|
2047
|
+
z18.object({
|
|
2029
2048
|
tier: identifier,
|
|
2030
|
-
variants:
|
|
2049
|
+
variants: z18.array(
|
|
2031
2050
|
pickupAllocationSchema.extend({
|
|
2032
2051
|
item: identifier.optional()
|
|
2033
2052
|
})
|
|
@@ -2043,164 +2062,161 @@ var entitlementBase = {
|
|
|
2043
2062
|
reward: tieredRewardDefinitionSchema,
|
|
2044
2063
|
earnedTier: identifier,
|
|
2045
2064
|
tier: identifier,
|
|
2046
|
-
revision:
|
|
2065
|
+
revision: z18.number().int().positive()
|
|
2047
2066
|
};
|
|
2048
|
-
var entitlementSchema =
|
|
2049
|
-
|
|
2050
|
-
|
|
2067
|
+
var entitlementSchema = z18.discriminatedUnion("status", [
|
|
2068
|
+
z18.object({ ...entitlementBase, status: z18.literal("available") }).strict(),
|
|
2069
|
+
z18.object({
|
|
2051
2070
|
...entitlementBase,
|
|
2052
|
-
status:
|
|
2071
|
+
status: z18.literal("handing-over"),
|
|
2053
2072
|
handover: identifier,
|
|
2054
|
-
startedAt:
|
|
2073
|
+
startedAt: z18.number(),
|
|
2055
2074
|
allocation: pickupAllocationSchema.optional()
|
|
2056
2075
|
}).strict(),
|
|
2057
|
-
|
|
2076
|
+
z18.object({
|
|
2058
2077
|
...entitlementBase,
|
|
2059
|
-
status:
|
|
2078
|
+
status: z18.literal("collected"),
|
|
2060
2079
|
handover: identifier,
|
|
2061
|
-
startedAt:
|
|
2080
|
+
startedAt: z18.number(),
|
|
2062
2081
|
allocation: pickupAllocationSchema.optional(),
|
|
2063
|
-
collectedAt:
|
|
2082
|
+
collectedAt: z18.number()
|
|
2064
2083
|
}).strict()
|
|
2065
2084
|
]);
|
|
2066
|
-
var beginHandoverSchema =
|
|
2085
|
+
var beginHandoverSchema = z18.object({
|
|
2067
2086
|
actionId: identifier,
|
|
2068
|
-
revision:
|
|
2087
|
+
revision: z18.number().int().positive(),
|
|
2069
2088
|
selection: pickupSelectionSchema.optional()
|
|
2070
2089
|
}).strict();
|
|
2071
|
-
var confirmHandoverSchema =
|
|
2072
|
-
var completionRecordSchema =
|
|
2073
|
-
key:
|
|
2090
|
+
var confirmHandoverSchema = z18.object({ actionId: identifier, handover: identifier }).strict();
|
|
2091
|
+
var completionRecordSchema = z18.object({
|
|
2092
|
+
key: z18.string().default("once"),
|
|
2074
2093
|
id: identifier,
|
|
2075
2094
|
quest: identifier,
|
|
2076
2095
|
member: identifier
|
|
2077
2096
|
});
|
|
2078
|
-
var questAvailabilitySchema =
|
|
2079
|
-
|
|
2080
|
-
kind:
|
|
2081
|
-
input:
|
|
2082
|
-
}).strict(),
|
|
2083
|
-
z17.object({ kind: z17.literal("completed") }).strict(),
|
|
2084
|
-
z17.object({
|
|
2085
|
-
kind: z17.literal("locked"),
|
|
2086
|
-
missing: z17.array(z17.object({ quest: identifier, title: z17.string() })).min(1)
|
|
2097
|
+
var questAvailabilitySchema = z18.discriminatedUnion("kind", [
|
|
2098
|
+
z18.object({
|
|
2099
|
+
kind: z18.literal("available"),
|
|
2100
|
+
input: z18.enum(["photo", "quiz", "none", "text", "url"])
|
|
2087
2101
|
}).strict(),
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
kind:
|
|
2091
|
-
|
|
2102
|
+
z18.object({ kind: z18.literal("completed") }).strict(),
|
|
2103
|
+
z18.object({
|
|
2104
|
+
kind: z18.literal("locked"),
|
|
2105
|
+
missing: z18.array(z18.object({ quest: identifier, title: z18.string() })).min(1)
|
|
2092
2106
|
}).strict(),
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2107
|
+
z18.object({ kind: z18.literal("staff-required") }).strict(),
|
|
2108
|
+
z18.object({ kind: z18.literal("automatic") }).strict(),
|
|
2109
|
+
z18.object({ kind: z18.literal("checking"), attempt: identifier }).strict(),
|
|
2110
|
+
z18.object({ kind: z18.literal("needs-review"), attempt: identifier }).strict(),
|
|
2111
|
+
z18.object({ kind: z18.literal("retryable"), attempt: identifier }).strict()
|
|
2096
2112
|
]);
|
|
2097
|
-
var memberProgressSchema =
|
|
2113
|
+
var memberProgressSchema = z18.object({
|
|
2098
2114
|
member: identifier,
|
|
2099
|
-
quests:
|
|
2100
|
-
|
|
2115
|
+
quests: z18.array(
|
|
2116
|
+
z18.object({
|
|
2101
2117
|
quest: identifier,
|
|
2102
2118
|
key: identifier.optional(),
|
|
2103
2119
|
release: identifier.optional(),
|
|
2104
|
-
title:
|
|
2120
|
+
title: z18.string(),
|
|
2105
2121
|
presentation: questPresentationSchema.default({}),
|
|
2106
|
-
connections:
|
|
2122
|
+
connections: z18.array(authProviderSchema).default([]),
|
|
2107
2123
|
trigger: triggerSchema,
|
|
2108
2124
|
availability: questAvailabilitySchema,
|
|
2109
|
-
completed:
|
|
2125
|
+
completed: z18.boolean(),
|
|
2110
2126
|
completion: completionPolicySchema.default({ kind: "once" }),
|
|
2111
2127
|
streak: streakProgressSchema.nullable().optional(),
|
|
2112
|
-
completionCount:
|
|
2113
|
-
visibility:
|
|
2114
|
-
missing:
|
|
2128
|
+
completionCount: z18.number().int().nonnegative().default(0),
|
|
2129
|
+
visibility: z18.enum(["visible", "hidden"]).default("visible"),
|
|
2130
|
+
missing: z18.array(z18.object({ quest: identifier, title: z18.string() })),
|
|
2115
2131
|
attempt: attemptSchema.nullable()
|
|
2116
2132
|
})
|
|
2117
2133
|
),
|
|
2118
|
-
entitlements:
|
|
2119
|
-
});
|
|
2120
|
-
var snapshotSchema =
|
|
2121
|
-
releases:
|
|
2122
|
-
completions:
|
|
2123
|
-
entitlements:
|
|
2124
|
-
attempts:
|
|
2125
|
-
balances:
|
|
2126
|
-
|
|
2127
|
-
member:
|
|
2128
|
-
balance:
|
|
2129
|
-
earned:
|
|
2130
|
-
held:
|
|
2131
|
-
available:
|
|
2134
|
+
entitlements: z18.array(entitlementSchema)
|
|
2135
|
+
});
|
|
2136
|
+
var snapshotSchema = z18.object({
|
|
2137
|
+
releases: z18.array(publishedReleaseSchema),
|
|
2138
|
+
completions: z18.array(completionRecordSchema),
|
|
2139
|
+
entitlements: z18.array(entitlementSchema),
|
|
2140
|
+
attempts: z18.array(attemptSchema),
|
|
2141
|
+
balances: z18.array(
|
|
2142
|
+
z18.object({
|
|
2143
|
+
member: z18.string(),
|
|
2144
|
+
balance: z18.string(),
|
|
2145
|
+
earned: z18.number(),
|
|
2146
|
+
held: z18.number(),
|
|
2147
|
+
available: z18.number()
|
|
2132
2148
|
})
|
|
2133
2149
|
),
|
|
2134
|
-
events:
|
|
2150
|
+
events: z18.array(eventSchema)
|
|
2135
2151
|
});
|
|
2136
|
-
var evidenceSchema =
|
|
2152
|
+
var evidenceSchema = z18.object({
|
|
2137
2153
|
id: identifier,
|
|
2138
2154
|
member: identifier,
|
|
2139
|
-
type:
|
|
2140
|
-
size:
|
|
2155
|
+
type: z18.enum(["image/jpeg", "image/png"]),
|
|
2156
|
+
size: z18.number()
|
|
2141
2157
|
});
|
|
2142
|
-
var errorSchema =
|
|
2143
|
-
error:
|
|
2144
|
-
code:
|
|
2145
|
-
missing:
|
|
2158
|
+
var errorSchema = z18.object({
|
|
2159
|
+
error: z18.string(),
|
|
2160
|
+
code: z18.string().optional(),
|
|
2161
|
+
missing: z18.array(z18.object({ quest: identifier, title: z18.string() })).optional()
|
|
2146
2162
|
});
|
|
2147
|
-
var staffDecisionSchema =
|
|
2163
|
+
var staffDecisionSchema = z18.object({
|
|
2148
2164
|
actionId: identifier,
|
|
2149
|
-
generation:
|
|
2150
|
-
decision:
|
|
2151
|
-
reason:
|
|
2165
|
+
generation: z18.number().int().nonnegative(),
|
|
2166
|
+
decision: z18.enum(["accept", "reject"]),
|
|
2167
|
+
reason: z18.string().trim().min(1).max(2e3)
|
|
2152
2168
|
}).strict();
|
|
2153
|
-
var stockSchema =
|
|
2154
|
-
var reservationSchema =
|
|
2169
|
+
var stockSchema = z18.object({ item: identifier, quantity: z18.number().int().min(0).max(1e4) }).strict();
|
|
2170
|
+
var reservationSchema = z18.object({
|
|
2155
2171
|
actionId: identifier,
|
|
2156
2172
|
member: identifier,
|
|
2157
2173
|
item: identifier,
|
|
2158
2174
|
balance: identifier,
|
|
2159
|
-
price:
|
|
2175
|
+
price: z18.number().int().positive().max(1e4)
|
|
2160
2176
|
}).strict();
|
|
2161
2177
|
var pageOptions = {
|
|
2162
|
-
limit:
|
|
2163
|
-
cursor:
|
|
2178
|
+
limit: z18.number().int().min(1).max(100).default(25),
|
|
2179
|
+
cursor: z18.string().min(1).max(4096).optional()
|
|
2164
2180
|
};
|
|
2165
|
-
var reviewListSchema =
|
|
2181
|
+
var reviewListSchema = z18.object({
|
|
2166
2182
|
...pageOptions,
|
|
2167
2183
|
member: identifier.optional(),
|
|
2168
2184
|
quest: identifier.optional()
|
|
2169
2185
|
}).strict();
|
|
2170
|
-
var memberListSchema =
|
|
2186
|
+
var memberListSchema = z18.object({
|
|
2171
2187
|
...pageOptions,
|
|
2172
2188
|
prefix: identifier.optional()
|
|
2173
2189
|
}).strict();
|
|
2174
|
-
var reviewItemSchema =
|
|
2190
|
+
var reviewItemSchema = z18.object({
|
|
2175
2191
|
attempt: attemptSchema,
|
|
2176
|
-
title:
|
|
2177
|
-
checks:
|
|
2178
|
-
|
|
2192
|
+
title: z18.string(),
|
|
2193
|
+
checks: z18.array(
|
|
2194
|
+
z18.object({ criteria: z18.string(), result: photoResultSchema })
|
|
2179
2195
|
)
|
|
2180
2196
|
});
|
|
2181
|
-
var reviewPageSchema =
|
|
2182
|
-
items:
|
|
2183
|
-
nextCursor:
|
|
2197
|
+
var reviewPageSchema = z18.object({
|
|
2198
|
+
items: z18.array(reviewItemSchema).max(100),
|
|
2199
|
+
nextCursor: z18.string().nullable()
|
|
2184
2200
|
});
|
|
2185
|
-
var memberPageSchema =
|
|
2186
|
-
items:
|
|
2187
|
-
nextCursor:
|
|
2201
|
+
var memberPageSchema = z18.object({
|
|
2202
|
+
items: z18.array(z18.object({ member: identifier })).max(100),
|
|
2203
|
+
nextCursor: z18.string().nullable()
|
|
2188
2204
|
});
|
|
2189
|
-
var createStockItemSchema =
|
|
2190
|
-
var stockItemSchema =
|
|
2191
|
-
var contentPerformanceSnapshotSchema =
|
|
2205
|
+
var createStockItemSchema = z18.object({ actionId: identifier, name: z18.string().trim().min(1).max(80) }).strict();
|
|
2206
|
+
var stockItemSchema = z18.object({ id: identifier, name: z18.string() });
|
|
2207
|
+
var contentPerformanceSnapshotSchema = z18.strictObject({
|
|
2192
2208
|
contentAttempt: identifier,
|
|
2193
2209
|
observation: identifier,
|
|
2194
|
-
observedAt:
|
|
2210
|
+
observedAt: z18.number().int().safe().nonnegative(),
|
|
2195
2211
|
metrics: contentMetricsSchema,
|
|
2196
2212
|
rewards: rewardBundleSchema
|
|
2197
2213
|
});
|
|
2198
2214
|
var contentPerformanceQuerySchema = contentQualificationQuerySchema.extend({
|
|
2199
|
-
content:
|
|
2215
|
+
content: z18.string().min(1).max(256)
|
|
2200
2216
|
});
|
|
2201
|
-
var contentPerformancePageSchema =
|
|
2202
|
-
current:
|
|
2203
|
-
state:
|
|
2217
|
+
var contentPerformancePageSchema = z18.strictObject({
|
|
2218
|
+
current: z18.strictObject({
|
|
2219
|
+
state: z18.enum([
|
|
2204
2220
|
"content-pending",
|
|
2205
2221
|
"content-unqualified",
|
|
2206
2222
|
"waiting",
|
|
@@ -2211,19 +2227,19 @@ var contentPerformancePageSchema = z17.strictObject({
|
|
|
2211
2227
|
"failed",
|
|
2212
2228
|
"superseded"
|
|
2213
2229
|
]),
|
|
2214
|
-
reason:
|
|
2230
|
+
reason: z18.string().nullable(),
|
|
2215
2231
|
contentAttempt: identifier,
|
|
2216
2232
|
attempt: identifier.nullable(),
|
|
2217
2233
|
reward: contentQualificationSchema.shape.reward
|
|
2218
2234
|
}),
|
|
2219
|
-
items:
|
|
2220
|
-
|
|
2235
|
+
items: z18.array(
|
|
2236
|
+
z18.strictObject({
|
|
2221
2237
|
attempt: identifier,
|
|
2222
2238
|
contentAttempt: identifier,
|
|
2223
2239
|
observation: identifier,
|
|
2224
|
-
observedAt:
|
|
2240
|
+
observedAt: z18.number(),
|
|
2225
2241
|
metrics: contentMetricsSchema,
|
|
2226
|
-
state:
|
|
2242
|
+
state: z18.enum([
|
|
2227
2243
|
"pending",
|
|
2228
2244
|
"qualified",
|
|
2229
2245
|
"unqualified",
|
|
@@ -2231,7 +2247,7 @@ var contentPerformancePageSchema = z17.strictObject({
|
|
|
2231
2247
|
"failed",
|
|
2232
2248
|
"superseded"
|
|
2233
2249
|
]),
|
|
2234
|
-
reason:
|
|
2250
|
+
reason: z18.string().nullable()
|
|
2235
2251
|
})
|
|
2236
2252
|
),
|
|
2237
2253
|
nextCursor: pageCursorSchema.nullable()
|
|
@@ -2246,6 +2262,12 @@ export {
|
|
|
2246
2262
|
identifier,
|
|
2247
2263
|
pageCursorSchema,
|
|
2248
2264
|
pageQuerySchema,
|
|
2265
|
+
discordMessageSchema,
|
|
2266
|
+
discordMessagesSourceSchema,
|
|
2267
|
+
discordReactionsSourceSchema,
|
|
2268
|
+
discordMessageDataSchema,
|
|
2269
|
+
discordMessageTextDataSchema,
|
|
2270
|
+
discordReactionDataSchema,
|
|
2249
2271
|
trackerDataMaxBranches,
|
|
2250
2272
|
trackerDataMaxEntries,
|
|
2251
2273
|
trackerDataSchemaSchema,
|
|
@@ -2269,6 +2291,7 @@ export {
|
|
|
2269
2291
|
xSearchSourceSchema,
|
|
2270
2292
|
customSourceSchema,
|
|
2271
2293
|
trackerSourceSchema,
|
|
2294
|
+
trackerSourceKinds,
|
|
2272
2295
|
sourceIdentities,
|
|
2273
2296
|
trackerDefinitionSchema,
|
|
2274
2297
|
trackerArtifactSchema,
|
|
@@ -2330,15 +2353,9 @@ export {
|
|
|
2330
2353
|
trackerAttributionSchema,
|
|
2331
2354
|
trackerTriggerRecordSchema,
|
|
2332
2355
|
trackerTriggerContextSchema,
|
|
2333
|
-
observationInputSchema,
|
|
2334
|
-
observationSchema,
|
|
2335
|
-
observationTriggerSchema,
|
|
2336
2356
|
completionPolicySchema,
|
|
2337
2357
|
completionKeySchema,
|
|
2338
2358
|
budgetSchema,
|
|
2339
|
-
observationReceiptSchema,
|
|
2340
|
-
discordReactionSchema,
|
|
2341
|
-
discordMessageSchema,
|
|
2342
2359
|
integrationProviderSchema,
|
|
2343
2360
|
discordServerSchema,
|
|
2344
2361
|
projectIntegrationSchema,
|