@domino-sdk/relay 1.0.0-next.2 → 1.0.0-next.34

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.
Files changed (61) hide show
  1. package/README.md +13 -1
  2. package/build.mjs +18 -1
  3. package/dist/activity-B8k9Sa_a.d.ts +9112 -0
  4. package/dist/authoring.d.ts +1355 -182
  5. package/dist/authoring.js +658 -225
  6. package/dist/automatic-outcomes-B1xrETxm.d.ts +758 -0
  7. package/dist/avatar.d.ts +29 -0
  8. package/dist/avatar.js +21 -0
  9. package/dist/browser-J7tUpXxy.d.ts +4154 -0
  10. package/dist/browser.d.ts +11 -4580
  11. package/dist/browser.js +8 -6
  12. package/dist/capability-error-DNMwKmlL.d.ts +458 -0
  13. package/dist/chunk-36HTX2BM.js +1223 -0
  14. package/dist/chunk-6QJ3LADK.js +112 -0
  15. package/dist/chunk-BGGKNIRP.js +171 -0
  16. package/dist/chunk-EYH5RDIE.js +496 -0
  17. package/dist/chunk-GQKYAQM6.js +84 -0
  18. package/dist/chunk-GUP7YRR4.js +42 -0
  19. package/dist/chunk-GZ6FJAXN.js +1659 -0
  20. package/dist/chunk-JON5SESL.js +2986 -0
  21. package/dist/chunk-MC6V6VMG.js +49 -0
  22. package/dist/chunk-NPGENI7K.js +37 -0
  23. package/dist/chunk-V7UKZLHA.js +35 -0
  24. package/dist/chunk-VFHHLN6A.js +284 -0
  25. package/dist/chunk-WJSSJ7AF.js +151 -0
  26. package/dist/{chunk-VH4OQ5VX.js → chunk-XFMSUPNS.js} +26 -5
  27. package/dist/{chunk-FDWRBMB3.js → chunk-ZVIRG24J.js} +150 -33
  28. package/dist/client-XiuFnug_.d.ts +4262 -0
  29. package/dist/groups-Ck-OxzjD.d.ts +2449 -0
  30. package/dist/identity-integration-GxAHdKR2.d.ts +58 -0
  31. package/dist/images-Dv-P5VBw.d.ts +234 -0
  32. package/dist/index.d.ts +15 -13115
  33. package/dist/index.js +30 -689
  34. package/dist/internal.d.ts +159 -0
  35. package/dist/internal.js +79 -0
  36. package/dist/offers-Cy-e4o5x.d.ts +431 -0
  37. package/dist/outcomes-kVB-Juzs.d.ts +4902 -0
  38. package/dist/pages-BBYD21IE.d.ts +359 -0
  39. package/dist/participant-rewards-3duLb8YJ.d.ts +668 -0
  40. package/dist/portal-proxy.js +26 -9
  41. package/dist/profiles-D2aFcOxu.d.ts +297 -0
  42. package/dist/react/index.d.ts +3378 -3318
  43. package/dist/react/index.js +1635 -783
  44. package/dist/request-error-DWduJCGV.d.ts +62 -0
  45. package/dist/schema-DfJzH2ci.d.ts +5644 -0
  46. package/dist/schema.d.ts +15 -3388
  47. package/dist/schema.js +790 -3
  48. package/dist/server/index.d.ts +81498 -0
  49. package/dist/server/index.js +2520 -0
  50. package/dist/streaks-CWyq8Px5.d.ts +71 -0
  51. package/dist/submission-input-BZkm6ohU.d.ts +290 -0
  52. package/dist/units-CwgsPB_r.d.ts +9 -0
  53. package/dist/vite.d.ts +1 -1
  54. package/dist/vite.js +1 -0
  55. package/dist/wallet-YssWxGg8.d.ts +228 -0
  56. package/package.json +24 -5
  57. package/dist/chunk-4KNTMNXA.js +0 -1847
  58. package/dist/chunk-B76BAJ25.js +0 -624
  59. package/dist/chunk-NKGJEYZM.js +0 -1833
  60. package/dist/chunk-ONDBQSMU.js +0 -373
  61. package/dist/submission-input-JDwq3EVK.d.ts +0 -4986
@@ -1,1833 +0,0 @@
1
- // src/content.ts
2
- import { z as z3 } from "zod";
3
-
4
- // src/identifier.ts
5
- import { z } from "zod";
6
- var identifier = z.string().min(1).max(100).regex(/^[a-zA-Z0-9_-]+$/);
7
-
8
- // src/trackers.ts
9
- import { z as z2 } from "zod";
10
- var timestamp = z2.number().int().safe().nonnegative().max(864e13);
11
- var count = z2.number().int().safe().nonnegative();
12
- var externalId = z2.string().min(1).max(256);
13
- var metric = count.nullable().default(null);
14
- var xTweetSchema = z2.looseObject({
15
- id: externalId,
16
- userId: externalId,
17
- content: z2.string(),
18
- createdAt: z2.iso.datetime({ offset: true }),
19
- author: z2.looseObject({
20
- id: externalId,
21
- username: z2.string(),
22
- name: z2.string(),
23
- verified: z2.boolean().nullable().default(null)
24
- }),
25
- likeCount: metric,
26
- replyCount: metric,
27
- retweetCount: metric,
28
- quoteCount: metric,
29
- viewCount: metric,
30
- bookmarkCount: metric,
31
- isReply: z2.boolean(),
32
- isRetweet: z2.boolean(),
33
- isQuoteTweet: z2.boolean()
34
- });
35
- var xContentBodySchema = z2.strictObject({
36
- version: z2.literal(1),
37
- id: z2.string().min(1),
38
- authorId: z2.string().min(1),
39
- publishedAt: timestamp,
40
- text: z2.string(),
41
- isReply: z2.boolean(),
42
- isRetweet: z2.boolean(),
43
- isQuoteTweet: z2.boolean(),
44
- media: z2.array(z2.strictObject({ type: z2.string(), url: z2.string() })).nullable(),
45
- mentionedAuthorIds: z2.array(z2.string().min(1)).nullable(),
46
- videoLengthSeconds: z2.number().nonnegative().nullable(),
47
- references: z2.strictObject({
48
- replyId: z2.string().nullable(),
49
- replyAuthorId: z2.string().nullable(),
50
- quoteId: z2.string().nullable(),
51
- quoteAuthorId: z2.string().nullable(),
52
- repostId: z2.string().nullable(),
53
- repostAuthorId: z2.string().nullable()
54
- })
55
- });
56
- var trackerContentQuerySchema = z2.strictObject({
57
- id: externalId,
58
- observation: z2.string().regex(/^observation_[a-f0-9]{64}$/)
59
- });
60
- var trackerContentReadSchema = trackerContentQuerySchema.extend({
61
- member: identifier
62
- });
63
- var attributionContext = { member: identifier, capturedAt: timestamp };
64
- var trackerEvidenceSchema = z2.strictObject({
65
- contentRevision: identifier,
66
- observation: identifier
67
- });
68
- var trackerContentSchema = z2.strictObject({
69
- tracker: identifier,
70
- source: z2.literal("x"),
71
- evidence: trackerEvidenceSchema,
72
- content: xContentBodySchema,
73
- observedAt: timestamp,
74
- removed: z2.boolean(),
75
- attribution: z2.discriminatedUnion("kind", [
76
- z2.strictObject({
77
- ...attributionContext,
78
- kind: z2.literal("linked"),
79
- account: z2.strictObject({
80
- provider: z2.literal("x"),
81
- issuer: z2.string().min(1),
82
- subject: externalId,
83
- revision: count,
84
- linkedAt: timestamp.nullable()
85
- })
86
- }),
87
- z2.strictObject({ ...attributionContext, kind: z2.literal("unlinked") }),
88
- z2.strictObject({
89
- ...attributionContext,
90
- kind: z2.literal("different-author")
91
- })
92
- ])
93
- });
94
- var identityKindSchema = z2.enum(["wallet", "x", "discord", "member"]);
95
- var accountRoleSchema = z2.string().regex(
96
- /^[a-zA-Z][a-zA-Z0-9_]{0,39}$/,
97
- "Name roles like author or recipient: a letter, then letters, digits or underscores"
98
- );
99
- var xAccountRoles = ["author", "inReplyTo"];
100
- var distinct = (values) => new Set(values).size === values.length;
101
- var xSearchSourceSchema = z2.object({
102
- kind: z2.literal("x-search"),
103
- query: z2.string().trim().min(1).max(2e3)
104
- }).strict();
105
- var customSourceSchema = z2.object({
106
- kind: z2.literal("custom"),
107
- namespace: identifier,
108
- /**
109
- * The identity kinds a record's author and named accounts can be, attributed to members
110
- * through verified links. Omitted when authors are opaque IDs, which no quest can pay.
111
- */
112
- identities: z2.array(identityKindSchema).min(1).max(4).refine(distinct, "List each identity kind once").optional(),
113
- /** Roles of the named accounts records can carry besides their author, such as `recipient`. */
114
- accounts: z2.array(accountRoleSchema).min(1).max(10).refine(distinct, "List each account role once").refine(
115
- (roles) => !roles.includes("author"),
116
- "author is every record's own role; name other accounts"
117
- ).optional(),
118
- /**
119
- * How trackers published before identity kinds stored `identities: ["wallet"]`. Reads return
120
- * those definitions as stored; write `identities` instead.
121
- *
122
- * @deprecated Use `identities: ["wallet"]`.
123
- */
124
- authors: z2.literal("wallet").optional()
125
- }).strict().refine(
126
- (source) => !(source.authors && source.identities),
127
- "Use identities, not authors"
128
- ).refine(
129
- (source) => !source.accounts || source.identities,
130
- "Named accounts need identities"
131
- );
132
- var trackerSourceSchema = z2.discriminatedUnion("kind", [
133
- xSearchSourceSchema,
134
- customSourceSchema
135
- ]);
136
- function sourceIdentities(source) {
137
- if (source.kind === "x-search") {
138
- return ["x"];
139
- }
140
- return source.identities ?? (source.authors === "wallet" ? ["wallet"] : void 0);
141
- }
142
- var x = {
143
- search: (input) => xSearchSourceSchema.parse({ kind: "x-search", ...input })
144
- };
145
- var customSource = (namespace, options = {}) => customSourceSchema.parse({
146
- kind: "custom",
147
- namespace,
148
- ...options
149
- });
150
- var windowSchema = z2.object({ start: timestamp, end: timestamp.optional() }).strict().refine(
151
- (w) => w.end === void 0 || w.end > w.start,
152
- "End must follow start"
153
- );
154
- var trackerDefinitionSchema = z2.object({
155
- key: identifier,
156
- title: z2.string().trim().min(1).max(120),
157
- source: trackerSourceSchema,
158
- window: windowSchema,
159
- refreshSeconds: z2.number().int().min(300).max(86400).default(21600),
160
- maxPages: z2.number().int().min(1).max(1e3).default(60)
161
- }).strict();
162
- var trackerArtifactSchema = z2.union([
163
- trackerDefinitionSchema,
164
- z2.object({ code: z2.string().min(1).max(2e6) }).strict()
165
- ]);
166
- function defineTracker(input) {
167
- return trackerDefinitionSchema.parse(input);
168
- }
169
- var publishedTrackerSchema = z2.object({
170
- id: identifier,
171
- version: identifier,
172
- definition: trackerDefinitionSchema,
173
- publishedAt: timestamp,
174
- actor: z2.string().nullable()
175
- });
176
- var trackerStatusSchema = z2.object({
177
- published: publishedTrackerSchema,
178
- paused: z2.boolean(),
179
- state: z2.enum(["idle", "syncing", "error", "complete"]),
180
- lastStartedAt: timestamp.nullable(),
181
- lastCompletedAt: timestamp.nullable(),
182
- nextSyncAt: timestamp.nullable(),
183
- coverage: z2.enum(["unknown", "partial", "complete"]),
184
- error: z2.string().nullable(),
185
- records: count
186
- });
187
- var trackerControlSchema = z2.object({
188
- actionId: identifier,
189
- action: z2.enum(["pause", "resume", "refresh"])
190
- }).strict();
191
- var trackerAccountSchema = z2.strictObject({
192
- kind: identityKindSchema.optional(),
193
- id: externalId
194
- });
195
- var trackerRecordInputSchema = z2.object({
196
- id: externalId,
197
- occurredAt: timestamp,
198
- observedAt: timestamp,
199
- author: z2.object({
200
- id: externalId,
201
- verified: z2.boolean().nullable().default(null),
202
- /** The author's identity kind; needed when the source names more than one. */
203
- kind: identityKindSchema.optional()
204
- }).strict().nullable().default(null),
205
- /** Named accounts besides the author, by the roles the custom source declares. */
206
- accounts: z2.record(accountRoleSchema, trackerAccountSchema).refine(
207
- (accounts) => Object.keys(accounts).length <= 10,
208
- "At most 10 accounts"
209
- ).optional(),
210
- data: z2.record(z2.string(), z2.json()),
211
- removed: z2.boolean().default(false)
212
- }).strict().refine(
213
- (v) => new TextEncoder().encode(JSON.stringify(v.data)).byteLength <= 131072,
214
- "Record exceeds 128 KB"
215
- );
216
- var trackerRecordSchema = trackerRecordInputSchema.safeExtend({
217
- source: z2.string(),
218
- firstSeenAt: timestamp,
219
- /** Present only when includeEvidence is true; custom sources have no X evidence. */
220
- evidence: trackerEvidenceSchema.nullable().optional()
221
- });
222
- var trackerIngestSchema = z2.object({
223
- actionId: identifier,
224
- records: z2.array(trackerRecordInputSchema).min(1).max(100)
225
- }).strict();
226
- var trackerIngestResultSchema = z2.object({
227
- stored: count,
228
- /** Tracker-trigger decisions this ingest caused. Absent from servers without tracker triggers. */
229
- admissions: z2.object({
230
- admitted: count,
231
- skipped: count,
232
- /**
233
- * Observations a quest's firing mode selected but its `where` filter did not match, counted
234
- * per quest like `admitted` and `skipped`. They record no outcome. Present only when
235
- * nonzero.
236
- */
237
- filtered: count.optional()
238
- }).optional()
239
- });
240
- var trackerOutcomeFields = {
241
- /** Stable quest ID. */
242
- quest: identifier,
243
- /** Stable tracker ID. */
244
- tracker: identifier,
245
- record: externalId,
246
- observedAt: timestamp,
247
- /** The release admitted, or the one active when the observation was skipped. */
248
- release: identifier,
249
- /** The account attribution resolved or failed to resolve, such as a CAIP-10 wallet ID. */
250
- account: z2.string().nullable(),
251
- createdAt: timestamp,
252
- updatedAt: timestamp,
253
- /** Null for automatic decisions; the staff actor after a retry. */
254
- actor: z2.string().nullable()
255
- };
256
- var trackerSkipCodes = [
257
- /** The quest is paused or no longer active. */
258
- "quest-paused",
259
- /** The record occurred before the quest was published. */
260
- "before-activation",
261
- /** The record is marked removed. */
262
- "record-removed",
263
- /** The captured X post of this observation cannot be read. */
264
- "content-unavailable",
265
- /** The record has no account in the beneficiary role, such as a post that is not a reply. */
266
- "no-account",
267
- /**
268
- * The beneficiary account is the record's author account, such as a reply to oneself, or both
269
- * belong to the same member. A different account is judged once it resolves to a member, after
270
- * `unlinked-account` and `ambiguous-account`.
271
- */
272
- "beneficiary-is-author",
273
- /** No member has verified the beneficiary account. */
274
- "unlinked-account",
275
- /** More than one member has the beneficiary account. */
276
- "ambiguous-account",
277
- /** The attributed member has not joined the project. */
278
- "not-joined",
279
- /** The attributed member has not completed the quest's prerequisites. */
280
- "prerequisites-incomplete"
281
- ];
282
- var trackerOutcomeSchema = z2.discriminatedUnion("state", [
283
- z2.strictObject({
284
- ...trackerOutcomeFields,
285
- state: z2.literal("admitted"),
286
- code: z2.null(),
287
- reason: z2.null(),
288
- /** The attributed member. */
289
- member: identifier,
290
- /** The admitted attempt. Its evaluation, decision and rewards live on the attempt. */
291
- attempt: identifier
292
- }),
293
- z2.strictObject({
294
- ...trackerOutcomeFields,
295
- state: z2.literal("skipped"),
296
- /** Why the observation was skipped, as one of `trackerSkipCodes`. */
297
- code: z2.string().min(1),
298
- /** Why the observation was skipped, for people. */
299
- reason: z2.string(),
300
- /** The attributed member, when attribution got that far. */
301
- member: identifier.nullable(),
302
- attempt: identifier.nullable()
303
- })
304
- ]);
305
- var trackerOutcomeQuerySchema = z2.strictObject({
306
- /** Quest key or ID. */
307
- quest: identifier.optional(),
308
- record: externalId.optional(),
309
- member: identifier.optional(),
310
- state: z2.enum(["admitted", "skipped"]).optional(),
311
- /** Only skips with this code, such as `unlinked-account`. */
312
- code: z2.string().min(1).max(100).optional(),
313
- limit: z2.coerce.number().int().min(1).max(100).default(25),
314
- /** Opaque cursor from `next`: older outcomes. */
315
- before: z2.string().max(512).optional()
316
- });
317
- var trackerOutcomePageSchema = z2.strictObject({
318
- /** Newest first. */
319
- items: z2.array(trackerOutcomeSchema).max(100),
320
- next: z2.string().nullable()
321
- });
322
- var trackerOutcomeRetrySchema = z2.strictObject({
323
- actionId: identifier,
324
- /** Quest key or ID. */
325
- quest: identifier,
326
- record: externalId,
327
- observedAt: timestamp
328
- });
329
- var booleanQuery = z2.union([
330
- z2.boolean(),
331
- z2.enum(["true", "false"]).transform((v) => v === "true")
332
- ]);
333
- var trackerQuerySchema = z2.object({
334
- author: externalId.optional(),
335
- member: identifier.optional(),
336
- verified: booleanQuery.optional(),
337
- since: z2.coerce.number().int().safe().nonnegative().optional(),
338
- until: z2.coerce.number().int().safe().nonnegative().optional(),
339
- removed: booleanQuery.default(false),
340
- minLikes: z2.coerce.number().int().safe().nonnegative().optional(),
341
- minViews: z2.coerce.number().int().safe().nonnegative().optional(),
342
- limit: z2.coerce.number().int().min(1).max(100).default(25),
343
- cursor: z2.string().max(2048).optional(),
344
- includeEvidence: booleanQuery.optional()
345
- }).strict().refine(
346
- (q) => q.since === void 0 || q.until === void 0 || q.until > q.since,
347
- "Until must follow since"
348
- );
349
- var trackerPageSchema = z2.object({
350
- tracker: identifier,
351
- items: z2.array(trackerRecordSchema),
352
- nextCursor: z2.string().nullable(),
353
- total: count,
354
- status: trackerStatusSchema
355
- });
356
- var trackerSummarySchema = z2.object({
357
- records: count,
358
- authors: count,
359
- metrics: z2.object({
360
- likes: count,
361
- replies: count,
362
- reposts: count,
363
- quotes: count,
364
- views: count,
365
- bookmarks: count
366
- }),
367
- missingMetrics: count,
368
- status: trackerStatusSchema
369
- });
370
- var trackerPreviewLimits = {
371
- pages: 3,
372
- posts: 100,
373
- days: 30
374
- };
375
- var trackerPreviewInputSchema = z2.object({
376
- query: xSearchSourceSchema.shape.query,
377
- /** Start of the searched window. The window ends when the sample is fetched. */
378
- since: timestamp
379
- }).strict();
380
- var trackerPreviewSchema = z2.object({
381
- query: z2.string(),
382
- since: timestamp,
383
- fetchedAt: timestamp,
384
- pages: count,
385
- /** Every match in the sample, newest first, verified or not. */
386
- posts: z2.array(xTweetSchema).max(trackerPreviewLimits.posts),
387
- /** X had more matches than the sample holds. */
388
- more: z2.boolean()
389
- });
390
-
391
- // src/content.ts
392
- var timestamp2 = z3.number().int().safe().nonnegative().max(864e13);
393
- var contentPolicySchema = z3.strictObject({
394
- tracker: identifier,
395
- window: trackerDefinitionSchema.shape.window,
396
- enrollment: z3.enum(["none", "required"]).default("none"),
397
- posts: z3.enum(["after-enrollment", "since-start"]).default("after-enrollment"),
398
- historical: z3.enum(["automatic", "claim", "staff"]).default("claim")
399
- });
400
- function content(tracker, policy = {}) {
401
- if (tracker.source.kind !== "x-search") {
402
- throw new Error("Content quests require an X tracker");
403
- }
404
- return {
405
- kind: "automatic",
406
- content: contentPolicySchema.parse({
407
- tracker: tracker.key,
408
- window: tracker.window,
409
- ...policy
410
- })
411
- };
412
- }
413
- var admittedContentSchema = xContentBodySchema.extend({
414
- tracker: identifier,
415
- revision: identifier,
416
- observation: identifier,
417
- attribution: trackerContentSchema.shape.attribution.options[0],
418
- enrolledAt: timestamp2.nullable(),
419
- completionKey: z3.string().min(1).max(200)
420
- });
421
- function perContent() {
422
- return {
423
- kind: "keyed",
424
- perContent: true,
425
- key: (ctx) => {
426
- if (!ctx.content) {
427
- throw new Error("perContent requires an admitted content item");
428
- }
429
- return ctx.content.completionKey;
430
- }
431
- };
432
- }
433
- var contentEnrollmentInputSchema = z3.strictObject({
434
- actionId: identifier,
435
- quest: identifier,
436
- member: identifier
437
- });
438
- var contentEnrollmentSchema = z3.strictObject({
439
- quest: identifier,
440
- member: identifier,
441
- enrolledAt: timestamp2
442
- });
443
- var contentReleaseInputSchema = contentEnrollmentInputSchema.extend({
444
- content: z3.string().min(1).max(256)
445
- });
446
- var contentAdmissionSchema = z3.strictObject({
447
- quest: identifier,
448
- content: z3.string().min(1).max(256),
449
- release: identifier,
450
- state: z3.enum(["pending", "admitted", "excluded"]),
451
- reason: z3.string().nullable(),
452
- attempt: identifier.nullable()
453
- });
454
- var contentAdmissionQuerySchema = z3.strictObject({
455
- quest: identifier,
456
- member: identifier.optional(),
457
- content: z3.string().min(1).max(256).optional(),
458
- after: z3.string().min(1).max(256).optional()
459
- });
460
- var contentAdmissionPageSchema = z3.strictObject({
461
- items: z3.array(contentAdmissionSchema),
462
- next: z3.string().nullable()
463
- });
464
- function isContentParticipantRoute(path, method) {
465
- return method === "GET" && (path === "/v1/content/admissions" || path === "/v1/content/qualifications" || path === "/v1/content/performance" || path === "/v1/engagement/history" || path === "/v1/engagement/boundaries") || method === "POST" && (path === "/v1/content/enrollments" || path === "/v1/content/claims");
466
- }
467
- var contentQualificationDecisionSchema = z3.strictObject({
468
- kind: z3.enum(["accept", "reject", "review", "superseded"]),
469
- reason: z3.string().nullable()
470
- });
471
- var contentQualificationQuerySchema = z3.strictObject({
472
- quest: identifier,
473
- member: identifier.optional(),
474
- content: z3.string().min(1).max(256).optional(),
475
- before: z3.coerce.number().int().positive().safe().optional()
476
- });
477
- var contentQualificationSchema = z3.strictObject({
478
- quest: identifier,
479
- content: z3.string(),
480
- member: identifier,
481
- release: identifier,
482
- attempt: identifier,
483
- revision: identifier,
484
- observation: identifier,
485
- current: z3.boolean(),
486
- state: z3.enum([
487
- "pending",
488
- "qualified",
489
- "unqualified",
490
- "needs-review",
491
- "failed",
492
- "superseded",
493
- "stale",
494
- "blocked",
495
- "unavailable"
496
- ]),
497
- reason: z3.string().nullable(),
498
- reward: z3.strictObject({
499
- attempt: identifier.nullable(),
500
- completion: identifier.nullable(),
501
- state: z3.enum(["unresolved", "awarded", "excluded"])
502
- })
503
- });
504
- var contentQualificationPageSchema = z3.strictObject({
505
- items: z3.array(contentQualificationSchema),
506
- next: z3.number().int().positive().safe().nullable()
507
- });
508
- var contentMetricSchema = z3.enum([
509
- "likes",
510
- "replies",
511
- "reposts",
512
- "quotes",
513
- "views",
514
- "bookmarks"
515
- ]);
516
- var contentMetricsSchema = z3.partialRecord(
517
- contentMetricSchema,
518
- z3.number().int().safe().nonnegative()
519
- );
520
- var contentPerformancePolicySchema = z3.strictObject({
521
- metrics: z3.array(contentMetricSchema).min(1).max(6).refine(
522
- (values) => new Set(values).size === values.length,
523
- "Metrics must be unique"
524
- ),
525
- maxAgeMs: z3.number().int().positive().max(864e5).default(36e5)
526
- });
527
-
528
- // src/streaks.ts
529
- import { z as z4 } from "zod";
530
- var communityTimeZoneSchema = z4.string().min(1).max(100).refine((zone) => {
531
- try {
532
- if (/^[+-]/.test(zone)) {
533
- return false;
534
- }
535
- new Intl.DateTimeFormat("en", { timeZone: zone });
536
- return true;
537
- } catch {
538
- return false;
539
- }
540
- }, "Use an IANA community timezone, such as Europe/Budapest");
541
- var streakPolicySchema = z4.object({
542
- kind: z4.literal("streak"),
543
- days: z4.number().int().min(1).max(3650),
544
- timeZone: communityTimeZoneSchema
545
- }).strict();
546
- var streak = (options) => streakPolicySchema.parse({ kind: "streak", ...options });
547
- var streakProgressSchema = z4.object({
548
- goal: z4.number().int().positive(),
549
- current: z4.number().int().nonnegative(),
550
- best: z4.number().int().nonnegative(),
551
- today: z4.string(),
552
- todayQualified: z4.boolean(),
553
- timeZone: communityTimeZoneSchema,
554
- nextBoundary: z4.number().int(),
555
- pendingTimeZone: z4.object({
556
- timeZone: communityTimeZoneSchema,
557
- effectiveAt: z4.number().int()
558
- }).nullable(),
559
- days: z4.array(
560
- z4.object({
561
- day: z4.number().int(),
562
- date: z4.string(),
563
- timeZone: communityTimeZoneSchema,
564
- occurredAt: z4.number().int()
565
- })
566
- ),
567
- milestone: z4.discriminatedUnion("status", [
568
- z4.object({ status: z4.literal("pending") }),
569
- z4.object({
570
- status: z4.literal("awarded"),
571
- completion: z4.string(),
572
- achievedAt: z4.number().int()
573
- }),
574
- z4.object({
575
- status: z4.literal("budget-exhausted"),
576
- budget: z4.string(),
577
- achievedAt: z4.number().int()
578
- })
579
- ])
580
- });
581
-
582
- // src/tracker-triggers.ts
583
- import { z as z5 } from "zod";
584
- var timestamp3 = z5.number().int().safe().nonnegative().max(864e13);
585
- var count2 = z5.number().int().safe().nonnegative();
586
- var trackerTriggerModeSchema = z5.enum([
587
- "new-record",
588
- "new-observation",
589
- "data-changed"
590
- ]);
591
- function defaultTriggerMode(source) {
592
- return source === "x-search" ? "new-record" : "new-observation";
593
- }
594
- var trackerBoundSchema = z5.union([
595
- z5.number().finite(),
596
- z5.strictObject({ setting: z5.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/) })
597
- ]);
598
- var dataPath = z5.string().max(200).regex(
599
- /^[^.\s]+(\.[^.\s]+)*$/,
600
- "Use dot-separated keys, such as metrics.likes"
601
- );
602
- var trackerWhereSchema = z5.union([
603
- z5.strictObject({
604
- path: dataPath,
605
- equals: z5.union([z5.string().max(1e3), z5.number().finite(), z5.boolean()])
606
- }),
607
- z5.strictObject({
608
- path: dataPath,
609
- gt: trackerBoundSchema.optional(),
610
- gte: trackerBoundSchema.optional(),
611
- lt: trackerBoundSchema.optional(),
612
- lte: trackerBoundSchema.optional()
613
- }).refine(
614
- (where) => [where.gt, where.gte, where.lt, where.lte].some(
615
- (bound) => bound !== void 0
616
- ),
617
- "Compare with equals, gt, gte, lt or lte"
618
- )
619
- ]);
620
- var trackerTriggerPolicySchema = z5.strictObject({
621
- /** The tracker's authoring key; publication binds it to the tracker's stable ID. */
622
- tracker: identifier,
623
- source: z5.enum(["x-search", "custom"]),
624
- /** Which observations fire; absent means the source's default (`defaultTriggerMode`). */
625
- on: trackerTriggerModeSchema.optional(),
626
- where: trackerWhereSchema.optional(),
627
- /**
628
- * The record account the quest pays: `author`, `inReplyTo` for an X post, or a named account of
629
- * a custom record. Relay attributes it through verified links; evaluators cannot redirect it.
630
- * Releases published before account roles store `"replied-to"` for `inReplyTo`.
631
- */
632
- beneficiary: z5.union([accountRoleSchema, z5.literal("replied-to")])
633
- });
634
- function triggerMode(policy) {
635
- return policy.on ?? defaultTriggerMode(policy.source);
636
- }
637
- function beneficiaryRole(policy) {
638
- return policy.beneficiary === "replied-to" ? "inReplyTo" : policy.beneficiary;
639
- }
640
- var xLink = {
641
- issuer: z5.string().min(1),
642
- /** The account's stable user ID. */
643
- subject: z5.string().min(1).max(256),
644
- /** The member's account selection revision. */
645
- revision: count2,
646
- /** When the member linked the account; null when unknown. */
647
- linkedAt: timestamp3.nullable()
648
- };
649
- var trackerAttributionSchema = z5.strictObject({
650
- member: identifier,
651
- capturedAt: timestamp3,
652
- account: z5.discriminatedUnion("provider", [
653
- z5.strictObject({
654
- provider: z5.literal("wallet"),
655
- /** Canonical CAIP-10 account ID, as the record names it. */
656
- id: z5.string().min(5).max(256),
657
- /** The wallet link's revision. */
658
- revision: count2,
659
- /** When the member verified the wallet. */
660
- linkedAt: timestamp3.nullable()
661
- }),
662
- z5.strictObject({ provider: z5.literal("x"), ...xLink }),
663
- z5.strictObject({ provider: z5.literal("discord"), ...xLink }),
664
- z5.strictObject({
665
- provider: z5.literal("member"),
666
- /** The member ID the record names. */
667
- id: identifier
668
- })
669
- ])
670
- });
671
- var trackerTriggerRecordSchema = z5.strictObject({
672
- id: z5.string().min(1).max(256),
673
- source: z5.string(),
674
- occurredAt: timestamp3,
675
- observedAt: timestamp3,
676
- firstSeenAt: timestamp3,
677
- author: z5.strictObject({
678
- id: z5.string().min(1).max(256),
679
- verified: z5.boolean().nullable(),
680
- kind: identityKindSchema.optional()
681
- }).nullable(),
682
- accounts: z5.record(accountRoleSchema, trackerAccountSchema).optional(),
683
- data: z5.record(z5.string(), z5.json()),
684
- removed: z5.boolean()
685
- });
686
- var trackerTriggerContextSchema = z5.strictObject({
687
- /** The tracker's stable ID. */
688
- tracker: identifier,
689
- /** The tracker's authoring key. */
690
- key: identifier,
691
- /**
692
- * The record account the attempt pays, as the quest's release names it. Releases published
693
- * before account roles name `inReplyTo` `"replied-to"`, which their bundled evaluators expect.
694
- */
695
- beneficiary: z5.union([accountRoleSchema, z5.literal("replied-to")]),
696
- record: trackerTriggerRecordSchema,
697
- /** The captured X post of this observation; null for custom trackers. */
698
- x: z5.strictObject({
699
- evidence: trackerEvidenceSchema,
700
- content: xContentBodySchema
701
- }).nullable(),
702
- attribution: trackerAttributionSchema
703
- });
704
-
705
- // src/observations.ts
706
- import { z as z6 } from "zod";
707
- var name = z6.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,199}$/);
708
- var observationInputSchema = z6.object({
709
- id: name,
710
- source: name,
711
- type: name,
712
- member: identifier,
713
- actor: z6.object({ provider: identifier, subject: z6.string().min(1).max(200) }).strict().optional(),
714
- occurredAt: z6.number().int().nonnegative().max(864e13),
715
- data: z6.record(z6.string(), z6.json())
716
- }).strict().refine(
717
- (value) => JSON.stringify(value.data).length <= 32768,
718
- "Observation data exceeds 32 KB"
719
- );
720
- var observationSchema = observationInputSchema.safeExtend({
721
- receivedAt: z6.number().int().nonnegative()
722
- });
723
- var observationTriggerSchema = z6.object({ source: name, type: name }).strict();
724
- var completionPolicySchema = z6.discriminatedUnion("kind", [
725
- streakPolicySchema,
726
- z6.object({ kind: z6.literal("once") }).strict(),
727
- z6.object({ kind: z6.literal("keyed") }).strict()
728
- ]);
729
- var completionKeySchema = z6.string().min(1).max(500);
730
- var budgetSchema = z6.object({
731
- id: name,
732
- scope: z6.enum(["member", "project"]),
733
- /**
734
- * `"day"` buckets by UTC date and `"week"` by ISO week (UTC, weeks start on Monday), both of
735
- * the attempt's eligibility time; `"lifetime"` never resets.
736
- */
737
- period: z6.enum(["lifetime", "day", "week"]),
738
- limit: z6.number().int().positive().max(Number.MAX_SAFE_INTEGER),
739
- cost: z6.union([
740
- z6.number().int().positive().max(Number.MAX_SAFE_INTEGER),
741
- z6.object({ balance: name }).strict()
742
- ])
743
- }).strict();
744
- var observationReceiptSchema = z6.object({
745
- id: name,
746
- source: name,
747
- attempts: z6.array(z6.string()),
748
- receivedAt: z6.number()
749
- });
750
- var discordReactionSchema = z6.object({
751
- guildId: z6.string(),
752
- channelId: z6.string(),
753
- messageId: z6.string(),
754
- userId: z6.string(),
755
- messageAuthorId: z6.string().nullable().default(null),
756
- actorRoles: z6.array(z6.string()).default([]),
757
- emoji: z6.object({ id: z6.string().nullable(), name: z6.string() }),
758
- messagePublishedAt: z6.number()
759
- }).strict();
760
- var discordMessageSchema = z6.object({
761
- guildId: z6.string(),
762
- channelId: z6.string(),
763
- messageId: z6.string(),
764
- userId: z6.string(),
765
- content: z6.string().nullable(),
766
- replyTo: z6.string().nullable(),
767
- publishedAt: z6.number()
768
- }).strict();
769
-
770
- // src/integrations.ts
771
- import { z as z7 } from "zod";
772
- var integrationProviderSchema = z7.enum(["discord"]);
773
- var discordServerSchema = z7.object({
774
- id: z7.string().regex(/^[0-9]{1,20}$/),
775
- name: z7.string().min(1),
776
- icon: z7.string().nullable()
777
- });
778
- var projectIntegrationSchema = z7.object({
779
- provider: integrationProviderSchema,
780
- configured: z7.boolean(),
781
- status: z7.enum(["disconnected", "ready", "attention"]),
782
- revision: z7.number().int().nonnegative(),
783
- server: discordServerSchema.nullable(),
784
- issue: z7.string().nullable(),
785
- connectedAt: z7.number().default(0)
786
- });
787
-
788
- // src/accounts.ts
789
- import { z as z8 } from "zod";
790
- var authProviderSchema = z8.enum(["google", "apple", "x", "discord"]);
791
- var accountConnectionSchema = z8.object({
792
- provider: authProviderSchema,
793
- configured: z8.boolean(),
794
- status: z8.enum(["disconnected", "connected", "reconnect"]),
795
- subject: z8.string().nullable(),
796
- revision: z8.number().int().nonnegative()
797
- });
798
- var discordMemberInputSchema = z8.object({}).strict();
799
- var discordMessageInputSchema = z8.object({
800
- channelId: z8.string().regex(/^[0-9]{1,20}$/),
801
- messageId: z8.string().regex(/^[0-9]{1,20}$/)
802
- }).strict();
803
- var discordMemberSchema = z8.object({
804
- userId: z8.string().regex(/^[0-9]{1,20}$/).nullable().default(null),
805
- nickname: z8.string().nullable().default(null),
806
- displayName: z8.string().nullable().default(null),
807
- boostingSince: z8.string().datetime({ offset: true }).nullable().default(null),
808
- roles: z8.array(z8.string().regex(/^[0-9]{1,20}$/)),
809
- joinedAt: z8.string().datetime({ offset: true }).nullable(),
810
- pending: z8.boolean()
811
- });
812
-
813
- // src/submission-input.ts
814
- import { z as z9 } from "zod";
815
- var textOptionsSchema = z9.object({
816
- required: z9.boolean().default(true),
817
- minLength: z9.number().int().min(0).max(1e4).default(1),
818
- maxLength: z9.number().int().min(1).max(1e4).default(1e4)
819
- }).strict().refine(
820
- (v) => v.minLength <= v.maxLength,
821
- "minLength must not exceed maxLength"
822
- );
823
- var hostSchema = z9.string().min(1).max(253).refine((host) => {
824
- if (!/^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/i.test(host) || host.includes("..")) {
825
- return false;
826
- }
827
- try {
828
- const url = new URL(`https://${host}`);
829
- return url.hostname === host.toLowerCase() && !url.port && !url.username && !url.password && url.pathname === "/" && !url.search && !url.hash;
830
- } catch {
831
- return false;
832
- }
833
- }, "Use a hostname without a scheme, path, port, or wildcard");
834
- var urlOptionsSchema = z9.object({
835
- required: z9.boolean().default(true),
836
- allowedHosts: z9.array(hostSchema).min(1).max(100).optional()
837
- }).strict();
838
- var textEvidenceSchema = z9.object({ kind: z9.literal("text"), value: z9.string().max(1e4) }).strict();
839
- var urlEvidenceSchema = z9.object({ kind: z9.literal("url"), value: z9.string().max(2048) }).strict();
840
- var valueEvidenceSchema = z9.discriminatedUnion("kind", [
841
- textEvidenceSchema,
842
- urlEvidenceSchema
843
- ]);
844
- function validateSubmissionValue(input, contract) {
845
- const maximum = input.kind === "text" ? 1e4 : 2048;
846
- if (input.value.length > maximum) {
847
- return `Enter no more than ${maximum} characters`;
848
- }
849
- if (input.kind !== contract.input) {
850
- return `This quest requires ${contract.input} input`;
851
- }
852
- if (!input.value.trim()) {
853
- return contract.constraints.required ? "This field is required" : null;
854
- }
855
- if (contract.input === "text") {
856
- if (input.value.length < contract.constraints.minLength) {
857
- return `Enter at least ${contract.constraints.minLength} characters`;
858
- }
859
- if (input.value.length > contract.constraints.maxLength) {
860
- return `Enter no more than ${contract.constraints.maxLength} characters`;
861
- }
862
- return null;
863
- }
864
- const url = parseHttpUrl(input.value);
865
- if (!url) {
866
- return "Enter a valid HTTP or HTTPS URL without credentials";
867
- }
868
- if (contract.constraints.allowedHosts && !contract.constraints.allowedHosts.some(
869
- (host) => host.toLowerCase() === url.hostname.toLowerCase()
870
- )) {
871
- return `Use a URL hosted on: ${contract.constraints.allowedHosts.join(", ")}`;
872
- }
873
- return null;
874
- }
875
- function parseHttpUrl(value) {
876
- if (value !== value.trim() || /[\\\s]/.test(value) || !/^https?:\/\//i.test(value)) {
877
- return null;
878
- }
879
- try {
880
- const url = new URL(value);
881
- return ["http:", "https:"].includes(url.protocol) && !url.username && !url.password ? url : null;
882
- } catch {
883
- return null;
884
- }
885
- }
886
- function xPostId(value) {
887
- const url = parseHttpUrl(value);
888
- if (!url || url.port || ![
889
- "x.com",
890
- "www.x.com",
891
- "twitter.com",
892
- "www.twitter.com",
893
- "mobile.twitter.com"
894
- ].includes(url.hostname)) {
895
- return null;
896
- }
897
- return /^\/(?:[A-Za-z0-9_]+|i\/web)\/status\/([0-9]{1,20})\/?$/.exec(
898
- url.pathname
899
- )?.[1] ?? null;
900
- }
901
-
902
- // src/quiz.ts
903
- import { z as z10 } from "zod";
904
- var quizId = z10.string().regex(/^[a-zA-Z0-9_-]+$/).max(100);
905
- var quizChoiceSchema = z10.object({ id: quizId, label: z10.string().trim().min(1).max(500) }).strict();
906
- var quizQuestionSchema = z10.object({
907
- id: quizId,
908
- prompt: z10.string().trim().min(1).max(1e3),
909
- choices: z10.array(quizChoiceSchema).min(2).max(8).refine(
910
- (choices) => new Set(choices.map((choice) => choice.id)).size === choices.length,
911
- "Choice IDs must be unique"
912
- )
913
- }).strict();
914
- var quizQuestionsSchema = z10.array(quizQuestionSchema).min(1).max(20).refine(
915
- (questions) => new Set(questions.map((question) => question.id)).size === questions.length,
916
- "Question IDs must be unique"
917
- );
918
- var quizContentSchema = z10.array(
919
- quizQuestionSchema.extend({ correct: quizId }).refine(
920
- (question) => question.choices.some((choice) => choice.id === question.correct),
921
- "Choose a correct answer from the available choices"
922
- )
923
- ).min(1).max(20).refine(
924
- (questions) => new Set(questions.map((question) => question.id)).size === questions.length,
925
- "Question IDs must be unique"
926
- );
927
-
928
- // src/schema.ts
929
- import { z as z13 } from "zod";
930
-
931
- // src/settings.ts
932
- import { z as z12 } from "zod";
933
-
934
- // src/resources.ts
935
- import { z as z11 } from "zod";
936
- var channelSourceSchema = z11.object({
937
- provider: z11.literal("discord"),
938
- resource: z11.literal("channel"),
939
- types: z11.array(z11.enum(["text", "announcement"])).min(1)
940
- }).strict();
941
- var resourceSourceSchema = z11.union([
942
- z11.object({
943
- provider: z11.literal("domino"),
944
- resource: z11.literal("point-ledger")
945
- }).strict(),
946
- channelSourceSchema,
947
- z11.object({
948
- provider: z11.literal("discord"),
949
- resource: z11.literal("role"),
950
- assignable: z11.boolean().default(false)
951
- }).strict()
952
- ]);
953
- var resourceRequestSchema = z11.object({
954
- source: resourceSourceSchema,
955
- query: z11.string().max(100).optional(),
956
- cursor: z11.string().regex(/^\d{1,6}$/).optional(),
957
- ids: z11.array(z11.string().min(1).max(100)).max(50).optional()
958
- }).strict();
959
- var resourceOptionsSchema = z11.object({
960
- revision: z11.number().int(),
961
- options: z11.array(
962
- z11.object({
963
- id: z11.string(),
964
- label: z11.string(),
965
- description: z11.string().optional(),
966
- group: z11.string().optional(),
967
- disabledReason: z11.string().optional()
968
- })
969
- ),
970
- cursor: z11.string().nullable()
971
- });
972
- var discord = {
973
- roles(options = {}) {
974
- return resourceSourceSchema.parse({
975
- provider: "discord",
976
- resource: "role",
977
- assignable: options.assignable ?? false
978
- });
979
- },
980
- channels(options = {}) {
981
- return resourceSourceSchema.parse({
982
- provider: "discord",
983
- resource: "channel",
984
- types: options.types ?? ["text", "announcement"]
985
- });
986
- }
987
- };
988
- var pointLedgers = () => ({
989
- provider: "domino",
990
- resource: "point-ledger"
991
- });
992
-
993
- // src/settings.ts
994
- var instant = z12.iso.datetime({ offset: true }).transform((value) => new Date(value).toISOString());
995
- var resourceId = z12.union([z12.literal(""), z12.string().regex(/^\S{1,200}$/)]);
996
- var base = { label: z12.string().min(1), description: z12.string().optional() };
997
- var settingFieldSchema = z12.discriminatedUnion("kind", [
998
- z12.object({ ...base, kind: z12.literal("point-ledger"), default: identifier }).strict(),
999
- z12.object({ ...base, kind: z12.literal("datetime"), default: instant }).strict(),
1000
- z12.object({
1001
- ...base,
1002
- kind: z12.literal("resource"),
1003
- default: resourceId,
1004
- source: resourceSourceSchema
1005
- }).strict(),
1006
- z12.object({ ...base, kind: z12.literal("quiz"), default: quizContentSchema }).strict(),
1007
- z12.object({
1008
- ...base,
1009
- kind: z12.literal("text"),
1010
- default: z12.string(),
1011
- minLength: z12.number().int().nonnegative(),
1012
- maxLength: z12.number().int().positive(),
1013
- multiline: z12.boolean()
1014
- }).strict(),
1015
- z12.object({
1016
- ...base,
1017
- kind: z12.literal("integer"),
1018
- default: z12.number().int(),
1019
- min: z12.number().int(),
1020
- max: z12.number().int()
1021
- }).strict(),
1022
- z12.object({ ...base, kind: z12.literal("boolean"), default: z12.boolean() }).strict(),
1023
- z12.object({
1024
- ...base,
1025
- kind: z12.literal("choice"),
1026
- default: z12.string(),
1027
- options: z12.array(z12.string().min(1)).min(1)
1028
- }).strict()
1029
- ]);
1030
- var settingsFieldsSchema = z12.record(
1031
- z12.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/),
1032
- settingFieldSchema
1033
- );
1034
- var settingsValuesSchema = z12.record(
1035
- z12.string(),
1036
- z12.union([z12.string(), z12.number().finite(), z12.boolean(), quizContentSchema])
1037
- );
1038
- var settings = {
1039
- pointLedger(options) {
1040
- const field = {
1041
- ...options,
1042
- kind: "point-ledger",
1043
- default: identifier.parse(options.default)
1044
- };
1045
- return identifier.default(field.default).meta(field);
1046
- },
1047
- datetime(options) {
1048
- const field = {
1049
- ...options,
1050
- kind: "datetime",
1051
- default: instant.parse(options.default)
1052
- };
1053
- return instant.default(field.default).meta(field);
1054
- },
1055
- resource(options) {
1056
- const field = {
1057
- ...options,
1058
- source: resourceSourceSchema.parse(options.source),
1059
- kind: "resource",
1060
- default: resourceId.parse(options.default ?? "")
1061
- };
1062
- return resourceId.default(field.default).meta(field);
1063
- },
1064
- quiz(options) {
1065
- const value = quizContentSchema.parse(options.default);
1066
- return quizContentSchema.default(value).meta({ ...options, default: value, kind: "quiz" });
1067
- },
1068
- text(options) {
1069
- const field = {
1070
- ...options,
1071
- kind: "text",
1072
- minLength: options.minLength ?? 1,
1073
- maxLength: options.maxLength ?? 2e3,
1074
- multiline: options.multiline ?? false
1075
- };
1076
- return z12.string().min(field.minLength).max(field.maxLength).default(field.default).meta(field);
1077
- },
1078
- integer(options) {
1079
- return z12.number().int().min(options.min).max(options.max).default(options.default).meta({ ...options, kind: "integer" });
1080
- },
1081
- boolean(options) {
1082
- return z12.boolean().default(options.default).meta({ ...options, kind: "boolean" });
1083
- },
1084
- choice(options) {
1085
- return z12.enum(options.options).default(options.default).meta({ ...options, kind: "choice" });
1086
- },
1087
- object(shape) {
1088
- return z12.object(shape).strict();
1089
- }
1090
- };
1091
- function parseSettings(fields, input) {
1092
- const shape = {};
1093
- for (const [key, field] of Object.entries(fields)) {
1094
- switch (field.kind) {
1095
- case "point-ledger":
1096
- shape[key] = identifier.default(field.default);
1097
- break;
1098
- case "datetime":
1099
- shape[key] = instant.default(field.default);
1100
- break;
1101
- case "resource":
1102
- shape[key] = resourceId.default(field.default);
1103
- break;
1104
- case "quiz":
1105
- shape[key] = quizContentSchema.default(field.default);
1106
- break;
1107
- case "text":
1108
- shape[key] = z12.string().min(field.minLength).max(field.maxLength).default(field.default);
1109
- break;
1110
- case "integer":
1111
- shape[key] = z12.number().int().min(field.min).max(field.max).default(field.default);
1112
- break;
1113
- case "boolean":
1114
- shape[key] = z12.boolean().default(field.default);
1115
- break;
1116
- case "choice":
1117
- shape[key] = z12.enum(field.options).default(field.default);
1118
- break;
1119
- }
1120
- }
1121
- return settingsValuesSchema.parse(z12.object(shape).strict().parse(input));
1122
- }
1123
- function missingResourceSettings(fields, values) {
1124
- return Object.entries(fields).filter(([key, field]) => field.kind === "resource" && !values[key]).map(([key]) => key);
1125
- }
1126
- function compatibleSettingKinds(previous, next) {
1127
- return previous.kind === next.kind || previous.kind === "text" && (next.kind === "resource" || next.kind === "datetime" || next.kind === "point-ledger");
1128
- }
1129
-
1130
- // src/schema.ts
1131
- var pointsRewardSchema = z13.object({
1132
- kind: z13.literal("points").default("points"),
1133
- balance: identifier,
1134
- amount: z13.number().int().min(0).max(1e4)
1135
- }).strict();
1136
- var tieredRewardDefinitionSchema = z13.object({
1137
- id: identifier,
1138
- title: z13.string().min(1).max(120),
1139
- tiers: z13.array(
1140
- z13.object({ id: identifier, title: z13.string().min(1).max(120) }).strict()
1141
- ).min(1).max(20).refine(
1142
- (tiers) => new Set(tiers.map((t) => t.id)).size === tiers.length,
1143
- "Tier IDs must be unique"
1144
- ),
1145
- inventory: z13.object({ kind: z13.literal("untracked") }).strict(),
1146
- fulfillment: z13.object({ kind: z13.literal("staff-handover") }).strict()
1147
- }).strict();
1148
- var tieredRewardReferenceSchema = z13.object({
1149
- id: identifier,
1150
- key: identifier.nullable()
1151
- });
1152
- var tierRewardSchema = z13.object({
1153
- kind: z13.literal("tier"),
1154
- reward: tieredRewardDefinitionSchema,
1155
- tier: identifier
1156
- }).strict().refine(
1157
- (value) => value.reward.tiers.some((t) => t.id === value.tier),
1158
- "Unknown reward tier"
1159
- );
1160
- var integrationRewardSchema = z13.object({
1161
- kind: z13.literal("integration"),
1162
- provider: z13.literal("discord"),
1163
- action: z13.literal("grant-role"),
1164
- roleId: z13.string().regex(/^[0-9]{1,20}$/)
1165
- }).strict();
1166
- var rewardSchema = z13.union([
1167
- pointsRewardSchema,
1168
- tierRewardSchema,
1169
- integrationRewardSchema
1170
- ]);
1171
- function rewardKey(reward) {
1172
- if (reward.kind === "integration") {
1173
- return `integration:${reward.provider}:${reward.action}:${reward.roleId}`;
1174
- }
1175
- return reward.kind === "points" ? "points:" + reward.balance : "tier:" + reward.reward.id;
1176
- }
1177
- var triggerSchema = z13.union([
1178
- z13.object({
1179
- kind: z13.literal("manual"),
1180
- input: z13.literal("text"),
1181
- constraints: textOptionsSchema,
1182
- actor: z13.enum(["member", "staff"]).optional()
1183
- }).strict(),
1184
- z13.object({
1185
- kind: z13.literal("manual"),
1186
- input: z13.literal("url"),
1187
- constraints: urlOptionsSchema,
1188
- actor: z13.enum(["member", "staff"]).optional()
1189
- }).strict(),
1190
- z13.object({
1191
- kind: z13.literal("manual"),
1192
- input: z13.enum(["photo", "quiz", "none"]),
1193
- actor: z13.enum(["member", "staff"]).optional()
1194
- }).strict(),
1195
- z13.object({
1196
- kind: z13.literal("automatic"),
1197
- observation: observationTriggerSchema.optional(),
1198
- content: contentPolicySchema.optional(),
1199
- tracker: trackerTriggerPolicySchema.optional()
1200
- }).strict().refine(
1201
- (value) => [value.observation, value.content, value.tracker].filter(Boolean).length <= 1,
1202
- "Choose one automatic trigger source"
1203
- )
1204
- ]);
1205
- var prerequisiteSchema = z13.object({ quest: identifier });
1206
- var photoResultSchema = z13.object({
1207
- kind: z13.enum(["pass", "fail", "unclear"]),
1208
- reason: z13.string().min(1).max(2e3)
1209
- }).strict();
1210
- var textReviewInputSchema = z13.object({
1211
- text: z13.string().min(1).max(16e3).refine((value) => value.trim().length > 0, "Text must not be blank"),
1212
- criteria: z13.string().trim().min(1).max(2e3)
1213
- }).strict();
1214
- var textResultSchema = photoResultSchema;
1215
- var decisionSchema = z13.discriminatedUnion("kind", [
1216
- z13.object({
1217
- kind: z13.literal("accept"),
1218
- rewards: z13.array(rewardSchema).max(10),
1219
- completionKey: completionKeySchema.optional()
1220
- }).strict(),
1221
- z13.object({ kind: z13.literal("reject"), reason: z13.string().min(1).max(2e3) }).strict(),
1222
- z13.object({
1223
- kind: z13.literal("review"),
1224
- reason: z13.string().min(1).max(2e3),
1225
- rewards: z13.array(rewardSchema).max(10).optional(),
1226
- completionKey: completionKeySchema.optional()
1227
- }).strict()
1228
- ]);
1229
- var reviewModeSchema = z13.enum(["workers-ai"]);
1230
- var storedReviewModeSchema = z13.enum([
1231
- "fixture-pass",
1232
- "fixture-fail",
1233
- "fixture-unclear",
1234
- "fixture-error",
1235
- "workers-ai"
1236
- ]);
1237
- var rewardBundleSchema = z13.array(rewardSchema).max(10).refine(
1238
- (rewards) => new Set(rewards.map(rewardKey)).size === rewards.length,
1239
- "Use one entry per balance or shared reward"
1240
- );
1241
- var mediaUrlSchema = z13.string().max(2e3).refine((value) => {
1242
- if (/^\/(?!\/)[^\\\s]*$/.test(value)) {
1243
- return true;
1244
- }
1245
- try {
1246
- return new URL(value).protocol === "https:";
1247
- } catch {
1248
- return false;
1249
- }
1250
- }, "Use an HTTPS URL or a same-site path beginning with /");
1251
- var questPresentationSchema = z13.object({
1252
- quiz: quizQuestionsSchema.optional(),
1253
- instructions: z13.string().max(4e3).optional(),
1254
- video: z13.object({
1255
- url: mediaUrlSchema,
1256
- poster: mediaUrlSchema.optional(),
1257
- captions: z13.object({
1258
- url: mediaUrlSchema,
1259
- language: z13.string().min(2).max(20),
1260
- label: z13.string().min(1).max(80)
1261
- }).strict().optional()
1262
- }).strict().optional()
1263
- }).strict();
1264
- var questProfileSchema = z13.object({ visible: z13.boolean() }).strict();
1265
- var questDescriptionSchema = z13.object({
1266
- quest: identifier,
1267
- runtimeVersion: z13.union([z13.literal(1), z13.literal(2)]).default(1),
1268
- title: z13.string().min(1).max(120),
1269
- presentation: questPresentationSchema.default({}),
1270
- integrations: z13.array(integrationProviderSchema).max(10).default([]),
1271
- fields: settingsFieldsSchema,
1272
- values: settingsValuesSchema,
1273
- rewards: rewardBundleSchema,
1274
- humanReview: z13.boolean(),
1275
- trigger: triggerSchema,
1276
- performance: contentPerformancePolicySchema.optional(),
1277
- requires: z13.array(prerequisiteSchema).max(30).default([]),
1278
- completion: completionPolicySchema,
1279
- visibility: z13.enum(["visible", "hidden"]).default("visible"),
1280
- /**
1281
- * Whether completions show on participant profiles (`/v1/profiles/:id/completions`). Absent
1282
- * is hidden. Optional, not defaulted: releases carry the key only when the author sets it, so
1283
- * clients and pods that predate it (strict release schemas) still read every other release.
1284
- */
1285
- profile: questProfileSchema.optional(),
1286
- budgets: z13.array(budgetSchema).max(20).default([])
1287
- }).strict();
1288
- var artifactSchema = z13.object({ code: z13.string().min(1).max(1e6) }).strict();
1289
- var releaseSchema = artifactSchema.extend({
1290
- settings: settingsValuesSchema,
1291
- provider: reviewModeSchema,
1292
- expectedRelease: identifier.nullable().optional(),
1293
- settingRenames: z13.record(z13.string(), z13.string()).optional()
1294
- }).strict();
1295
- var batchReleaseSchema = z13.object({ releases: z13.array(releaseSchema).min(1).max(50) }).strict();
1296
- var questSettingsInputSchema = z13.object({
1297
- quest: identifier,
1298
- expectedRelease: identifier,
1299
- set: settingsValuesSchema,
1300
- reset: z13.array(z13.string())
1301
- }).strict();
1302
- var storedReleaseSchema = questDescriptionSchema.extend({
1303
- key: identifier.optional(),
1304
- code: z13.string(),
1305
- provider: storedReviewModeSchema,
1306
- id: identifier,
1307
- createdAt: z13.number(),
1308
- legacy: z13.boolean().default(false),
1309
- origin: z13.object({ typeVersion: identifier }).strict().optional(),
1310
- lifecycle: z13.enum(["active", "paused", "archived"]).default("active"),
1311
- configuration: z13.object({
1312
- defaults: settingsValuesSchema,
1313
- overrides: settingsValuesSchema,
1314
- preserved: z13.array(z13.string())
1315
- }).strict().optional()
1316
- });
1317
- var legacyReleaseSchema = z13.object({
1318
- quest: identifier,
1319
- title: z13.string(),
1320
- criteria: z13.string(),
1321
- humanReview: z13.boolean(),
1322
- rewards: rewardBundleSchema,
1323
- code: z13.string(),
1324
- provider: storedReviewModeSchema,
1325
- id: identifier,
1326
- createdAt: z13.number()
1327
- }).transform((r) => {
1328
- const { criteria, ...stored } = r;
1329
- return storedReleaseSchema.parse({
1330
- ...stored,
1331
- fields: {},
1332
- values: { criteria, humanReview: r.humanReview },
1333
- trigger: { kind: "manual", input: "photo" },
1334
- completion: { kind: "once" },
1335
- legacy: true
1336
- });
1337
- });
1338
- var publishedReleaseSchema = z13.union([
1339
- storedReleaseSchema,
1340
- legacyReleaseSchema
1341
- ]);
1342
- var templateSchema = z13.object({
1343
- code: z13.string(),
1344
- definition: questDescriptionSchema
1345
- });
1346
- var quizAnswersSchema = z13.record(identifier, identifier).refine(
1347
- (answers) => Object.keys(answers).length > 0 && Object.keys(answers).length <= 50,
1348
- "Provide between 1 and 50 answers"
1349
- ).transform(
1350
- (answers) => Object.fromEntries(
1351
- Object.entries(answers).sort(([a], [b]) => a.localeCompare(b))
1352
- )
1353
- );
1354
- var quizEvidenceSchema = z13.object({
1355
- kind: z13.literal("quiz"),
1356
- release: identifier.optional(),
1357
- answers: quizAnswersSchema
1358
- }).strict();
1359
- var submissionEvidenceSchema = z13.union([
1360
- quizEvidenceSchema,
1361
- textEvidenceSchema,
1362
- urlEvidenceSchema
1363
- ]);
1364
- var submitSchema = z13.object({
1365
- actionId: identifier,
1366
- quest: identifier,
1367
- member: identifier,
1368
- evidence: identifier.optional(),
1369
- input: submissionEvidenceSchema.optional(),
1370
- release: identifier.optional(),
1371
- faultAfterReview: z13.boolean().optional()
1372
- }).strict();
1373
- var attemptSchema = z13.object({
1374
- id: identifier,
1375
- release: identifier,
1376
- quest: identifier,
1377
- member: identifier,
1378
- evidence: identifier.nullable(),
1379
- input: submissionEvidenceSchema.optional(),
1380
- status: z13.enum([
1381
- "queued",
1382
- "evaluating",
1383
- "accepted",
1384
- "progressed",
1385
- "rejected",
1386
- "needs-review",
1387
- "failed"
1388
- ]),
1389
- reason: z13.string().nullable(),
1390
- retries: z13.number(),
1391
- generation: z13.number(),
1392
- completion: z13.string().nullable(),
1393
- reviewRewards: rewardBundleSchema.nullable().default(null),
1394
- createdAt: z13.number()
1395
- });
1396
- var eventSchema = z13.object({
1397
- id: z13.number(),
1398
- attempt: z13.string().nullable(),
1399
- kind: z13.string(),
1400
- detail: z13.string(),
1401
- actor: z13.string().nullable().default(null),
1402
- at: z13.number()
1403
- });
1404
- var pickupSelectionSchema = z13.object({
1405
- item: identifier,
1406
- revision: z13.number().int().nonnegative()
1407
- }).strict();
1408
- var pickupAllocationSchema = z13.object({
1409
- item: identifier,
1410
- label: z13.string().min(1).max(80)
1411
- }).strict();
1412
- var pickupPolicySchema = z13.discriminatedUnion("kind", [
1413
- z13.object({ kind: z13.literal("untracked") }).strict(),
1414
- z13.object({
1415
- kind: z13.literal("at-pickup"),
1416
- tiers: z13.array(
1417
- z13.object({
1418
- tier: identifier,
1419
- variants: z13.array(pickupAllocationSchema).min(1).max(100)
1420
- }).strict()
1421
- ).min(1).max(100)
1422
- }).strict()
1423
- ]);
1424
- var pickupCatalogSchema = z13.object({
1425
- reward: tieredRewardDefinitionSchema,
1426
- revision: z13.number().int().nonnegative(),
1427
- policy: pickupPolicySchema
1428
- });
1429
- var pickupAvailabilitySchema = z13.discriminatedUnion("kind", [
1430
- z13.object({ kind: z13.literal("untracked") }).strict(),
1431
- z13.object({
1432
- kind: z13.literal("at-pickup"),
1433
- revision: z13.number().int().nonnegative(),
1434
- variants: z13.array(
1435
- pickupAllocationSchema.extend({
1436
- available: z13.number().int().nonnegative()
1437
- })
1438
- )
1439
- }).strict()
1440
- ]);
1441
- var configurePickupSchema = z13.object({
1442
- reward: identifier,
1443
- revision: z13.number().int().nonnegative(),
1444
- actionId: identifier,
1445
- policy: z13.discriminatedUnion("kind", [
1446
- z13.object({ kind: z13.literal("untracked") }).strict(),
1447
- z13.object({
1448
- kind: z13.literal("at-pickup"),
1449
- tiers: z13.array(
1450
- z13.object({
1451
- tier: identifier,
1452
- variants: z13.array(
1453
- pickupAllocationSchema.extend({
1454
- item: identifier.optional()
1455
- })
1456
- ).min(1).max(100)
1457
- }).strict()
1458
- ).min(1).max(100)
1459
- }).strict()
1460
- ])
1461
- }).strict();
1462
- var entitlementBase = {
1463
- id: identifier,
1464
- member: identifier,
1465
- reward: tieredRewardDefinitionSchema,
1466
- earnedTier: identifier,
1467
- tier: identifier,
1468
- revision: z13.number().int().positive()
1469
- };
1470
- var entitlementSchema = z13.discriminatedUnion("status", [
1471
- z13.object({ ...entitlementBase, status: z13.literal("available") }).strict(),
1472
- z13.object({
1473
- ...entitlementBase,
1474
- status: z13.literal("handing-over"),
1475
- handover: identifier,
1476
- startedAt: z13.number(),
1477
- allocation: pickupAllocationSchema.optional()
1478
- }).strict(),
1479
- z13.object({
1480
- ...entitlementBase,
1481
- status: z13.literal("collected"),
1482
- handover: identifier,
1483
- startedAt: z13.number(),
1484
- allocation: pickupAllocationSchema.optional(),
1485
- collectedAt: z13.number()
1486
- }).strict()
1487
- ]);
1488
- var beginHandoverSchema = z13.object({
1489
- actionId: identifier,
1490
- revision: z13.number().int().positive(),
1491
- selection: pickupSelectionSchema.optional()
1492
- }).strict();
1493
- var confirmHandoverSchema = z13.object({ actionId: identifier, handover: identifier }).strict();
1494
- var completionRecordSchema = z13.object({
1495
- key: z13.string().default("once"),
1496
- id: identifier,
1497
- quest: identifier,
1498
- member: identifier
1499
- });
1500
- var questAvailabilitySchema = z13.discriminatedUnion("kind", [
1501
- z13.object({
1502
- kind: z13.literal("available"),
1503
- input: z13.enum(["photo", "quiz", "none", "text", "url"])
1504
- }).strict(),
1505
- z13.object({ kind: z13.literal("completed") }).strict(),
1506
- z13.object({
1507
- kind: z13.literal("locked"),
1508
- missing: z13.array(z13.object({ quest: identifier, title: z13.string() })).min(1)
1509
- }).strict(),
1510
- z13.object({ kind: z13.literal("staff-required") }).strict(),
1511
- z13.object({
1512
- kind: z13.literal("automatic"),
1513
- observation: observationTriggerSchema.optional()
1514
- }).strict(),
1515
- z13.object({ kind: z13.literal("checking"), attempt: identifier }).strict(),
1516
- z13.object({ kind: z13.literal("needs-review"), attempt: identifier }).strict(),
1517
- z13.object({ kind: z13.literal("retryable"), attempt: identifier }).strict()
1518
- ]);
1519
- var memberProgressSchema = z13.object({
1520
- member: identifier,
1521
- quests: z13.array(
1522
- z13.object({
1523
- quest: identifier,
1524
- key: identifier.optional(),
1525
- release: identifier.optional(),
1526
- title: z13.string(),
1527
- presentation: questPresentationSchema.default({}),
1528
- connections: z13.array(authProviderSchema).default([]),
1529
- trigger: triggerSchema,
1530
- availability: questAvailabilitySchema,
1531
- completed: z13.boolean(),
1532
- completion: completionPolicySchema.default({ kind: "once" }),
1533
- streak: streakProgressSchema.nullable().optional(),
1534
- completionCount: z13.number().int().nonnegative().default(0),
1535
- visibility: z13.enum(["visible", "hidden"]).default("visible"),
1536
- missing: z13.array(z13.object({ quest: identifier, title: z13.string() })),
1537
- attempt: attemptSchema.nullable()
1538
- })
1539
- ),
1540
- entitlements: z13.array(entitlementSchema)
1541
- });
1542
- var snapshotSchema = z13.object({
1543
- releases: z13.array(publishedReleaseSchema),
1544
- completions: z13.array(completionRecordSchema),
1545
- entitlements: z13.array(entitlementSchema),
1546
- attempts: z13.array(attemptSchema),
1547
- balances: z13.array(
1548
- z13.object({
1549
- member: z13.string(),
1550
- balance: z13.string(),
1551
- earned: z13.number(),
1552
- held: z13.number(),
1553
- available: z13.number()
1554
- })
1555
- ),
1556
- events: z13.array(eventSchema)
1557
- });
1558
- var evidenceSchema = z13.object({
1559
- id: identifier,
1560
- member: identifier,
1561
- type: z13.enum(["image/jpeg", "image/png"]),
1562
- size: z13.number()
1563
- });
1564
- var errorSchema = z13.object({
1565
- error: z13.string(),
1566
- code: z13.enum(["stale-quiz", "quest-updated", "invalid-submission"]).optional(),
1567
- missing: z13.array(z13.object({ quest: identifier, title: z13.string() })).optional()
1568
- });
1569
- var staffDecisionSchema = z13.object({
1570
- actionId: identifier,
1571
- generation: z13.number().int().nonnegative(),
1572
- decision: z13.enum(["accept", "reject"]),
1573
- reason: z13.string().trim().min(1).max(2e3)
1574
- }).strict();
1575
- var stockSchema = z13.object({ item: identifier, quantity: z13.number().int().min(0).max(1e4) }).strict();
1576
- var reservationSchema = z13.object({
1577
- actionId: identifier,
1578
- member: identifier,
1579
- item: identifier,
1580
- balance: identifier,
1581
- price: z13.number().int().positive().max(1e4)
1582
- }).strict();
1583
- var pageOptions = {
1584
- limit: z13.number().int().min(1).max(100).default(25),
1585
- cursor: z13.string().min(1).max(4096).optional()
1586
- };
1587
- var reviewListSchema = z13.object({
1588
- ...pageOptions,
1589
- member: identifier.optional(),
1590
- quest: identifier.optional()
1591
- }).strict();
1592
- var memberListSchema = z13.object({
1593
- ...pageOptions,
1594
- prefix: identifier.optional()
1595
- }).strict();
1596
- var reviewItemSchema = z13.object({
1597
- attempt: attemptSchema,
1598
- title: z13.string(),
1599
- checks: z13.array(
1600
- z13.object({ criteria: z13.string(), result: photoResultSchema })
1601
- )
1602
- });
1603
- var reviewPageSchema = z13.object({
1604
- items: z13.array(reviewItemSchema).max(100),
1605
- nextCursor: z13.string().nullable()
1606
- });
1607
- var memberPageSchema = z13.object({
1608
- items: z13.array(z13.object({ member: identifier })).max(100),
1609
- nextCursor: z13.string().nullable()
1610
- });
1611
- var createStockItemSchema = z13.object({ actionId: identifier, name: z13.string().trim().min(1).max(80) }).strict();
1612
- var stockItemSchema = z13.object({ id: identifier, name: z13.string() });
1613
- var contentPerformanceSnapshotSchema = z13.strictObject({
1614
- contentAttempt: identifier,
1615
- observation: identifier,
1616
- observedAt: z13.number().int().safe().nonnegative(),
1617
- metrics: contentMetricsSchema,
1618
- rewards: rewardBundleSchema
1619
- });
1620
- var contentPerformanceQuerySchema = contentQualificationQuerySchema.extend({
1621
- content: z13.string().min(1).max(256)
1622
- });
1623
- var contentPerformancePageSchema = z13.strictObject({
1624
- current: z13.strictObject({
1625
- state: z13.enum([
1626
- "content-pending",
1627
- "content-unqualified",
1628
- "waiting",
1629
- "pending",
1630
- "qualified",
1631
- "unqualified",
1632
- "needs-review",
1633
- "failed",
1634
- "superseded"
1635
- ]),
1636
- reason: z13.string().nullable(),
1637
- contentAttempt: identifier,
1638
- attempt: identifier.nullable(),
1639
- reward: contentQualificationSchema.shape.reward
1640
- }),
1641
- items: z13.array(
1642
- z13.strictObject({
1643
- attempt: identifier,
1644
- contentAttempt: identifier,
1645
- observation: identifier,
1646
- observedAt: z13.number(),
1647
- metrics: contentMetricsSchema,
1648
- state: z13.enum([
1649
- "pending",
1650
- "qualified",
1651
- "unqualified",
1652
- "needs-review",
1653
- "failed",
1654
- "superseded"
1655
- ]),
1656
- reason: z13.string().nullable()
1657
- })
1658
- ),
1659
- next: z13.number().int().positive().safe().nullable()
1660
- });
1661
-
1662
- export {
1663
- identifier,
1664
- xTweetSchema,
1665
- xContentBodySchema,
1666
- trackerContentQuerySchema,
1667
- trackerContentReadSchema,
1668
- trackerEvidenceSchema,
1669
- trackerContentSchema,
1670
- identityKindSchema,
1671
- accountRoleSchema,
1672
- xAccountRoles,
1673
- xSearchSourceSchema,
1674
- customSourceSchema,
1675
- trackerSourceSchema,
1676
- sourceIdentities,
1677
- x,
1678
- customSource,
1679
- trackerDefinitionSchema,
1680
- trackerArtifactSchema,
1681
- defineTracker,
1682
- publishedTrackerSchema,
1683
- trackerStatusSchema,
1684
- trackerControlSchema,
1685
- trackerAccountSchema,
1686
- trackerRecordInputSchema,
1687
- trackerRecordSchema,
1688
- trackerIngestSchema,
1689
- trackerIngestResultSchema,
1690
- trackerSkipCodes,
1691
- trackerOutcomeSchema,
1692
- trackerOutcomeQuerySchema,
1693
- trackerOutcomePageSchema,
1694
- trackerOutcomeRetrySchema,
1695
- trackerQuerySchema,
1696
- trackerPageSchema,
1697
- trackerSummarySchema,
1698
- trackerPreviewLimits,
1699
- trackerPreviewInputSchema,
1700
- trackerPreviewSchema,
1701
- contentPolicySchema,
1702
- content,
1703
- admittedContentSchema,
1704
- perContent,
1705
- contentEnrollmentInputSchema,
1706
- contentEnrollmentSchema,
1707
- contentReleaseInputSchema,
1708
- contentAdmissionSchema,
1709
- contentAdmissionQuerySchema,
1710
- contentAdmissionPageSchema,
1711
- isContentParticipantRoute,
1712
- contentQualificationDecisionSchema,
1713
- contentQualificationQuerySchema,
1714
- contentQualificationSchema,
1715
- contentQualificationPageSchema,
1716
- contentMetricSchema,
1717
- contentMetricsSchema,
1718
- contentPerformancePolicySchema,
1719
- communityTimeZoneSchema,
1720
- streakPolicySchema,
1721
- streak,
1722
- streakProgressSchema,
1723
- trackerTriggerModeSchema,
1724
- defaultTriggerMode,
1725
- trackerBoundSchema,
1726
- trackerWhereSchema,
1727
- trackerTriggerPolicySchema,
1728
- triggerMode,
1729
- beneficiaryRole,
1730
- trackerAttributionSchema,
1731
- trackerTriggerRecordSchema,
1732
- trackerTriggerContextSchema,
1733
- observationInputSchema,
1734
- observationSchema,
1735
- observationTriggerSchema,
1736
- completionPolicySchema,
1737
- completionKeySchema,
1738
- budgetSchema,
1739
- observationReceiptSchema,
1740
- discordReactionSchema,
1741
- discordMessageSchema,
1742
- integrationProviderSchema,
1743
- discordServerSchema,
1744
- projectIntegrationSchema,
1745
- authProviderSchema,
1746
- accountConnectionSchema,
1747
- discordMemberInputSchema,
1748
- discordMessageInputSchema,
1749
- discordMemberSchema,
1750
- textOptionsSchema,
1751
- urlOptionsSchema,
1752
- textEvidenceSchema,
1753
- urlEvidenceSchema,
1754
- valueEvidenceSchema,
1755
- validateSubmissionValue,
1756
- xPostId,
1757
- quizChoiceSchema,
1758
- quizQuestionSchema,
1759
- quizQuestionsSchema,
1760
- quizContentSchema,
1761
- resourceSourceSchema,
1762
- resourceRequestSchema,
1763
- resourceOptionsSchema,
1764
- discord,
1765
- pointLedgers,
1766
- settingFieldSchema,
1767
- settingsFieldsSchema,
1768
- settingsValuesSchema,
1769
- settings,
1770
- parseSettings,
1771
- missingResourceSettings,
1772
- compatibleSettingKinds,
1773
- pointsRewardSchema,
1774
- tieredRewardDefinitionSchema,
1775
- tieredRewardReferenceSchema,
1776
- tierRewardSchema,
1777
- integrationRewardSchema,
1778
- rewardSchema,
1779
- rewardKey,
1780
- triggerSchema,
1781
- prerequisiteSchema,
1782
- photoResultSchema,
1783
- textReviewInputSchema,
1784
- textResultSchema,
1785
- decisionSchema,
1786
- reviewModeSchema,
1787
- storedReviewModeSchema,
1788
- rewardBundleSchema,
1789
- mediaUrlSchema,
1790
- questPresentationSchema,
1791
- questProfileSchema,
1792
- questDescriptionSchema,
1793
- artifactSchema,
1794
- releaseSchema,
1795
- batchReleaseSchema,
1796
- questSettingsInputSchema,
1797
- publishedReleaseSchema,
1798
- templateSchema,
1799
- quizAnswersSchema,
1800
- quizEvidenceSchema,
1801
- submissionEvidenceSchema,
1802
- submitSchema,
1803
- attemptSchema,
1804
- eventSchema,
1805
- pickupSelectionSchema,
1806
- pickupAllocationSchema,
1807
- pickupPolicySchema,
1808
- pickupCatalogSchema,
1809
- pickupAvailabilitySchema,
1810
- configurePickupSchema,
1811
- entitlementSchema,
1812
- beginHandoverSchema,
1813
- confirmHandoverSchema,
1814
- completionRecordSchema,
1815
- questAvailabilitySchema,
1816
- memberProgressSchema,
1817
- snapshotSchema,
1818
- evidenceSchema,
1819
- errorSchema,
1820
- staffDecisionSchema,
1821
- stockSchema,
1822
- reservationSchema,
1823
- reviewListSchema,
1824
- memberListSchema,
1825
- reviewItemSchema,
1826
- reviewPageSchema,
1827
- memberPageSchema,
1828
- createStockItemSchema,
1829
- stockItemSchema,
1830
- contentPerformanceSnapshotSchema,
1831
- contentPerformanceQuerySchema,
1832
- contentPerformancePageSchema
1833
- };