@domino-sdk/relay 1.0.0-next.12 → 1.0.0-next.13

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 (34) hide show
  1. package/dist/authoring.d.ts +25 -25
  2. package/dist/authoring.js +10 -3
  3. package/dist/browser.d.ts +19 -26
  4. package/dist/browser.js +6 -6
  5. package/dist/{catalog-qrYne8qV.d.ts → catalog-C85V1NgW.d.ts} +73 -79
  6. package/dist/{chunk-YYD4QUBO.js → chunk-CRNQP7NV.js} +550 -470
  7. package/dist/{chunk-22J4K7ED.js → chunk-EZWNGI5B.js} +4 -4
  8. package/dist/{chunk-7Q4BGGT6.js → chunk-FXYJ4OMX.js} +1 -1
  9. package/dist/{chunk-4LBUTHD6.js → chunk-II7DRZSL.js} +1 -1
  10. package/dist/{chunk-NZA2TLBF.js → chunk-KS33GOUL.js} +23 -8
  11. package/dist/{chunk-LY7SXUNW.js → chunk-M64XHC42.js} +4 -4
  12. package/dist/{chunk-UW5CQHPQ.js → chunk-MNQI35OG.js} +3 -3
  13. package/dist/{chunk-5L7XZA4Y.js → chunk-OA2KMQVZ.js} +31 -25
  14. package/dist/{chunk-EWFB35JW.js → chunk-WQ24ILGO.js} +2 -2
  15. package/dist/{client-CW72TaAs.d.ts → client-Bf9PNUIi.d.ts} +18 -25
  16. package/dist/{deployments-Bc0dPSXN.d.ts → deployments-CNCP0JnD.d.ts} +269 -138
  17. package/dist/{images-D0Txfte6.d.ts → images-BG4pdO4y.d.ts} +1 -1
  18. package/dist/index.d.ts +5 -5
  19. package/dist/index.js +5 -5
  20. package/dist/internal.d.ts +3 -3
  21. package/dist/internal.js +4 -4
  22. package/dist/{observations-bFY4yv2K.d.ts → observations-CQ6IcNuQ.d.ts} +3 -3
  23. package/dist/portal-proxy.js +2 -2
  24. package/dist/react/index.d.ts +19 -27
  25. package/dist/react/index.js +7 -7
  26. package/dist/{referrals-CvSmxvjm.d.ts → referrals-KQfP4pBf.d.ts} +189 -102
  27. package/dist/{schema-ZfjL-d1N.d.ts → schema-BF_TQsmT.d.ts} +338 -47
  28. package/dist/schema.d.ts +8 -8
  29. package/dist/schema.js +28 -8
  30. package/dist/server/index.d.ts +542 -508
  31. package/dist/server/index.js +31 -7
  32. package/dist/{streaks-CwGReWGt.d.ts → streaks-CWyq8Px5.d.ts} +2 -4
  33. package/dist/{trackers-BsUh5Ky0.d.ts → trackers-W7nRdRr7.d.ts} +1 -1
  34. package/package.json +1 -1
@@ -6,7 +6,7 @@ import {
6
6
  pointLedgerReferenceSchema,
7
7
  questExperienceSchema,
8
8
  rewardDeliveriesSchema
9
- } from "./chunk-LY7SXUNW.js";
9
+ } from "./chunk-M64XHC42.js";
10
10
  import {
11
11
  AVATAR_UPLOAD_LIMIT,
12
12
  RelayError,
@@ -38,14 +38,14 @@ import {
38
38
  walletSignInNetworksSchema,
39
39
  walletSignatureSchema,
40
40
  walletUnlinkInputSchema
41
- } from "./chunk-5L7XZA4Y.js";
41
+ } from "./chunk-OA2KMQVZ.js";
42
42
  import {
43
43
  exchangeResultSchema,
44
44
  exchangeSchema,
45
45
  memberSummarySchema,
46
46
  participantSessionSchema,
47
47
  sessionMember
48
- } from "./chunk-7Q4BGGT6.js";
48
+ } from "./chunk-FXYJ4OMX.js";
49
49
  import {
50
50
  accountConnectionSchema,
51
51
  attemptSchema,
@@ -70,7 +70,7 @@ import {
70
70
  tieredRewardReferenceSchema,
71
71
  validateSubmissionValue,
72
72
  valueEvidenceSchema
73
- } from "./chunk-YYD4QUBO.js";
73
+ } from "./chunk-CRNQP7NV.js";
74
74
 
75
75
  // src/submissions.ts
76
76
  import { z } from "zod";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  identifier
3
- } from "./chunk-YYD4QUBO.js";
3
+ } from "./chunk-CRNQP7NV.js";
4
4
 
5
5
  // src/auth.ts
6
6
  import { z } from "zod";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  identifier,
3
3
  xTweetSchema
4
- } from "./chunk-YYD4QUBO.js";
4
+ } from "./chunk-CRNQP7NV.js";
5
5
 
6
6
  // src/x.ts
7
7
  import { z } from "zod";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  imageAssetArtifactSchema,
3
3
  publishedImageSchema
4
- } from "./chunk-4LBUTHD6.js";
4
+ } from "./chunk-II7DRZSL.js";
5
5
  import {
6
6
  catalogDeploymentSchema,
7
7
  interactionSchema,
@@ -9,7 +9,7 @@ import {
9
9
  pointLedgerSchema,
10
10
  questCollectionSchema,
11
11
  questTypeVersionSchema
12
- } from "./chunk-LY7SXUNW.js";
12
+ } from "./chunk-M64XHC42.js";
13
13
  import {
14
14
  engagementArtifactSchema,
15
15
  engagementDeploymentEntrySchema,
@@ -17,14 +17,16 @@ import {
17
17
  leaderboardPreviewSchema,
18
18
  publishedReferralSchema,
19
19
  referralArtifactSchema
20
- } from "./chunk-5L7XZA4Y.js";
20
+ } from "./chunk-OA2KMQVZ.js";
21
21
  import {
22
22
  identifier,
23
+ projectCalendarDeclarationSchema,
23
24
  publishedReleaseSchema,
24
25
  publishedTrackerSchema,
25
26
  releaseSchema,
27
+ timeZoneNameSchema,
26
28
  trackerArtifactSchema
27
- } from "./chunk-YYD4QUBO.js";
29
+ } from "./chunk-CRNQP7NV.js";
28
30
 
29
31
  // src/deployments.ts
30
32
  import { z } from "zod";
@@ -34,11 +36,13 @@ var projectCatalogArtifactSchema = catalogDeploymentSchema.omit({ expectedRevisi
34
36
  pointLedgers: z.array(pointLedgerDeclarationSchema).max(50).default([]),
35
37
  referrals: z.array(referralArtifactSchema).max(50).default([]),
36
38
  leaderboards: z.array(leaderboardArtifactSchema).max(50).default([]),
37
- images: z.array(imageAssetArtifactSchema).max(10).default([])
39
+ images: z.array(imageAssetArtifactSchema).max(10).default([]),
40
+ /** relay.json `calendar`: the project timezone. Omitted, the deployment leaves it unchanged. */
41
+ calendar: projectCalendarDeclarationSchema.optional()
38
42
  });
39
43
  var projectDeploymentSchema = projectCatalogArtifactSchema.extend({ releases: z.array(releaseSchema).max(50).default([]) }).refine(
40
- (value) => value.engagement.length > 0 || value.trackers.length > 0 || value.pointLedgers.length > 0 || value.releases.length > 0 || value.leaderboards.length > 0 || value.referrals.length > 0 || value.images.length > 0 || value.types.length > 0 || value.collections.length > 0 || value.supportedInteractions !== void 0,
41
- "No resources configured. Add engagement, trackers, quests, questTypes, pointLedgers, leaderboards, referrals, images, collections, or supportedInteractions to relay.json."
44
+ (value) => value.engagement.length > 0 || value.trackers.length > 0 || value.pointLedgers.length > 0 || value.releases.length > 0 || value.leaderboards.length > 0 || value.referrals.length > 0 || value.images.length > 0 || value.types.length > 0 || value.collections.length > 0 || value.supportedInteractions !== void 0 || value.calendar !== void 0,
45
+ "No resources configured. Add engagement, trackers, quests, questTypes, pointLedgers, leaderboards, referrals, images, collections, supportedInteractions, or calendar to relay.json."
42
46
  );
43
47
  var deploymentPreviewSchema = z.object({
44
48
  id: identifier,
@@ -52,7 +56,18 @@ var deploymentPreviewSchema = z.object({
52
56
  supportedInteractions: z.array(interactionSchema),
53
57
  referrals: z.array(publishedReferralSchema).default([]),
54
58
  leaderboards: z.array(leaderboardPreviewSchema).default([]),
55
- images: z.array(publishedImageSchema).default([])
59
+ images: z.array(publishedImageSchema).default([]),
60
+ /**
61
+ * The project timezone change this deployment makes, or null for none. A declared timezone
62
+ * applies only when relay.json changes it, so a change made in Console stays until relay.json
63
+ * changes. `effectiveAt` is when a scheduled change takes effect; null means the deployment keeps
64
+ * `timeZone` and cancels a pending change. Publishing makes exactly this change, or fails when the
65
+ * calendar moved since the preview (such as past a day boundary).
66
+ */
67
+ calendar: z.object({
68
+ timeZone: timeZoneNameSchema,
69
+ effectiveAt: z.number().int().nullable()
70
+ }).nullable().default(null)
56
71
  });
57
72
  var publishDeploymentSchema = z.object({ id: identifier }).strict();
58
73
  var deploymentResultSchema = deploymentPreviewSchema.extend({
@@ -2,7 +2,7 @@ import {
2
2
  authoringIdentityShape,
3
3
  normalizeAuthoringIdentity,
4
4
  validateAuthoringIdentity
5
- } from "./chunk-5L7XZA4Y.js";
5
+ } from "./chunk-OA2KMQVZ.js";
6
6
  import {
7
7
  entitlementSchema,
8
8
  identifier,
@@ -11,12 +11,12 @@ import {
11
11
  pickupAvailabilitySchema,
12
12
  pickupSelectionSchema,
13
13
  publishedReleaseSchema,
14
- questDescriptionSchema,
15
14
  reviewModeSchema,
16
15
  settingsValuesSchema,
16
+ storedQuestDescriptionSchema,
17
17
  storedReviewModeSchema,
18
18
  tieredRewardReferenceSchema
19
- } from "./chunk-YYD4QUBO.js";
19
+ } from "./chunk-CRNQP7NV.js";
20
20
 
21
21
  // src/point-ledgers.ts
22
22
  import { z } from "zod";
@@ -91,7 +91,7 @@ var questTypeVersionSchema = z2.object({
91
91
  id: identifier,
92
92
  version: identifier,
93
93
  code: z2.string(),
94
- definition: questDescriptionSchema,
94
+ definition: storedQuestDescriptionSchema,
95
95
  provider: storedReviewModeSchema,
96
96
  createdAt: z2.number()
97
97
  });
@@ -4,13 +4,13 @@ import {
4
4
  imageFieldsSchema,
5
5
  imageInspectionSchema,
6
6
  imageSightingsSchema
7
- } from "./chunk-4LBUTHD6.js";
7
+ } from "./chunk-II7DRZSL.js";
8
8
  import {
9
9
  authScopeSchema
10
- } from "./chunk-7Q4BGGT6.js";
10
+ } from "./chunk-FXYJ4OMX.js";
11
11
  import {
12
12
  photoResultSchema
13
- } from "./chunk-YYD4QUBO.js";
13
+ } from "./chunk-CRNQP7NV.js";
14
14
 
15
15
  // src/configuration.ts
16
16
  function questConfiguration(release) {
@@ -1,11 +1,13 @@
1
1
  import {
2
+ calendarPeriodSchema,
2
3
  contentMetricSchema,
3
4
  contentMetricsSchema,
4
5
  identifier,
5
6
  pageCursorSchema,
6
7
  pointsRewardSchema,
8
+ refuseWindowTimeZone,
7
9
  tierRewardSchema
8
- } from "./chunk-YYD4QUBO.js";
10
+ } from "./chunk-CRNQP7NV.js";
9
11
 
10
12
  // src/authoring-identity.ts
11
13
  import { z } from "zod";
@@ -39,6 +41,11 @@ var authoringKey = (input) => identitySchema.parse(input).key;
39
41
  // src/engagement.ts
40
42
  import { z as z2 } from "zod";
41
43
  var amount = z2.number().int().safe().nonnegative();
44
+ var engagementBudgetSchema = z2.strictObject({
45
+ scope: z2.enum(["member", "project"]),
46
+ period: calendarPeriodSchema,
47
+ limit: amount
48
+ });
42
49
  var engagementDefinitionSchema = z2.strictObject({
43
50
  key: identifier,
44
51
  qualifiedBy: identifier,
@@ -49,11 +56,10 @@ var engagementDefinitionSchema = z2.strictObject({
49
56
  ),
50
57
  baseline: z2.literal("historical"),
51
58
  maxAgeMs: z2.number().int().positive().max(864e5).default(36e5),
52
- budget: z2.strictObject({
53
- projectDaily: amount.optional(),
54
- memberDaily: amount.optional(),
55
- projectLifetime: amount.optional()
56
- }).default({})
59
+ budgets: z2.array(engagementBudgetSchema).max(8).default([]).refine(
60
+ (budgets) => new Set(budgets.map((b) => b.scope + ":" + b.period)).size === budgets.length,
61
+ "Give each scope and period one budget"
62
+ )
57
63
  });
58
64
  var engagementScoreInputSchema = z2.strictObject({
59
65
  metrics: contentMetricsSchema,
@@ -418,40 +424,39 @@ var leaderboardWindowSchema = z5.discriminatedUnion("kind", [
418
424
  z5.object({ kind: z5.literal("all-time") }).strict(),
419
425
  z5.object({ kind: z5.literal("fixed"), start: timestamp, end: timestamp }).strict().refine((w) => w.end > w.start, "Window end must follow its start"),
420
426
  z5.object({ kind: z5.literal("rolling"), days: integer.min(1).max(3660) }).strict(),
427
+ // Not strict: boards published while a calendar window named its own `timeZone` keep reading,
428
+ // and the field drops on parse. The authoring schema refuses it.
421
429
  z5.object({
422
430
  kind: z5.literal("calendar"),
423
- period: z5.enum(["day", "week", "month"]),
424
- timeZone: z5.string().min(1).max(100).refine((zone) => {
425
- try {
426
- new Intl.DateTimeFormat("en", { timeZone: zone });
427
- return true;
428
- } catch {
429
- return false;
430
- }
431
- }, "Use an IANA timezone")
432
- }).strict()
431
+ /** The current day, week (ISO, starting on Monday) or month of the project calendar. */
432
+ period: calendarPeriodSchema.exclude(["lifetime"])
433
+ })
433
434
  ]);
434
435
  var periodScore = {
435
436
  window: leaderboardWindowSchema.default({ kind: "all-time" }),
436
437
  quests: z5.array(identifier).min(1).max(100).optional()
437
438
  };
439
+ var scoreSchema = z5.discriminatedUnion("kind", [
440
+ z5.object({ kind: z5.literal("balance") }).strict(),
441
+ z5.object({ kind: z5.literal("earned"), ...periodScore }).strict(),
442
+ z5.object({
443
+ kind: z5.literal("net"),
444
+ window: leaderboardWindowSchema.default({ kind: "all-time" })
445
+ }).strict()
446
+ ]).default({ kind: "balance" });
438
447
  var leaderboardDefinitionSchema = z5.object({
439
448
  id: identifier,
440
449
  key: identifier.optional(),
441
450
  title: z5.string().trim().min(1).max(120),
442
451
  balance: identifier,
443
- score: z5.discriminatedUnion("kind", [
444
- z5.object({ kind: z5.literal("balance") }).strict(),
445
- z5.object({ kind: z5.literal("earned"), ...periodScore }).strict(),
446
- z5.object({
447
- kind: z5.literal("net"),
448
- window: leaderboardWindowSchema.default({ kind: "all-time" })
449
- }).strict()
450
- ]).default({ kind: "balance" }),
452
+ score: scoreSchema,
451
453
  access: z5.enum(["participants", "public"]).default("participants"),
452
454
  group: identifier.optional()
453
455
  }).strict();
454
- var leaderboardAuthoringSchema = leaderboardDefinitionSchema.omit({ id: true }).extend(authoringIdentityShape).strict().superRefine(validateAuthoringIdentity).transform(normalizeAuthoringIdentity);
456
+ var leaderboardAuthoringSchema = leaderboardDefinitionSchema.omit({ id: true }).extend({
457
+ ...authoringIdentityShape,
458
+ score: z5.preprocess(refuseWindowTimeZone, scoreSchema)
459
+ }).strict().superRefine(validateAuthoringIdentity).transform(normalizeAuthoringIdentity);
455
460
  var leaderboardArtifactSchema = z5.union([
456
461
  leaderboardAuthoringSchema,
457
462
  z5.object({ code: z5.string().min(1).max(2e6) }).strict()
@@ -912,6 +917,7 @@ export {
912
917
  validateAuthoringIdentity,
913
918
  normalizeAuthoringIdentity,
914
919
  authoringKey,
920
+ engagementBudgetSchema,
915
921
  engagementDefinitionSchema,
916
922
  engagementScoreInputSchema,
917
923
  engagementScoreSchema,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createRelayClient
3
- } from "./chunk-22J4K7ED.js";
3
+ } from "./chunk-EZWNGI5B.js";
4
4
  import {
5
5
  RelayErrorCode,
6
6
  clientError,
7
7
  cosmosChain
8
- } from "./chunk-5L7XZA4Y.js";
8
+ } from "./chunk-OA2KMQVZ.js";
9
9
 
10
10
  // src/base58.ts
11
11
  var alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
@@ -1,10 +1,10 @@
1
- import { h as QuestView, J as questExperienceSchema, e as PointHistoryQuery, c as PointEntryKind } from './catalog-qrYne8qV.js';
1
+ import { h as QuestView, J as questExperienceSchema, e as PointHistoryQuery, c as PointEntryKind } from './catalog-C85V1NgW.js';
2
2
  import { V as ValueEvidence, a as AuthProvider } from './submission-input-CccwAl5Z.js';
3
3
  import { R as RequestError, a as RequestErrorDetails, b as RequestErrorKind } from './request-error-VnTiMXc3.js';
4
- import { b as QuizEvidence, A as Attempt, M as MemberProgress, an as submitSchema, x as contentPerformanceQuerySchema } from './schema-ZfjL-d1N.js';
4
+ import { b as QuizEvidence, A as Attempt, M as MemberProgress, ao as submitSchema, x as contentPerformanceQuerySchema } from './schema-BF_TQsmT.js';
5
5
  import { z } from 'zod';
6
6
  import { c as ParticipantSession, a as PageQuery, f as exchangeSchema } from './pages-KYK1L60W.js';
7
- import { a4 as referralAcceptSchema, c as LeaderboardQuery, D as engagementPageQuerySchema, r as contentQualificationQuerySchema, h as contentAdmissionQuerySchema, j as contentEnrollmentInputSchema, t as contentReleaseInputSchema } from './referrals-CvSmxvjm.js';
7
+ import { a6 as referralAcceptSchema, c as LeaderboardQuery, G as engagementPageQuerySchema, s as contentQualificationQuerySchema, i as contentAdmissionQuerySchema, k as contentEnrollmentInputSchema, u as contentReleaseInputSchema } from './referrals-KQfP4pBf.js';
8
8
  import { F as profileUpdateSchema, c as ProfileCompletionQuery } from './profiles-BtOXMGcC.js';
9
9
  import { x as walletAddressInputSchema, M as walletSignatureSchema, L as LinkedWallet, f as WalletSigner } from './wallet-BtiG0Xhr.js';
10
10
 
@@ -478,7 +478,6 @@ declare function createRelayClient(options: RelayClientOptions): {
478
478
  } | {
479
479
  kind: "calendar";
480
480
  period: "day" | "week" | "month";
481
- timeZone: string;
482
481
  };
483
482
  kind: "earned";
484
483
  quests?: string[] | undefined;
@@ -496,7 +495,6 @@ declare function createRelayClient(options: RelayClientOptions): {
496
495
  } | {
497
496
  kind: "calendar";
498
497
  period: "day" | "week" | "month";
499
- timeZone: string;
500
498
  };
501
499
  };
502
500
  access: "participants" | "public";
@@ -894,7 +892,6 @@ declare function createRelayClient(options: RelayClientOptions): {
894
892
  completion: {
895
893
  kind: "streak";
896
894
  days: number;
897
- timeZone: string;
898
895
  } | {
899
896
  kind: "once";
900
897
  } | {
@@ -1210,7 +1207,6 @@ declare function createRelayClient(options: RelayClientOptions): {
1210
1207
  completion: {
1211
1208
  kind: "streak";
1212
1209
  days: number;
1213
- timeZone: string;
1214
1210
  } | {
1215
1211
  kind: "once";
1216
1212
  } | {
@@ -1472,7 +1468,6 @@ declare function createRelayClient(options: RelayClientOptions): {
1472
1468
  completion: {
1473
1469
  kind: "streak";
1474
1470
  days: number;
1475
- timeZone: string;
1476
1471
  } | {
1477
1472
  kind: "once";
1478
1473
  } | {
@@ -1737,7 +1732,6 @@ declare function createRelayClient(options: RelayClientOptions): {
1737
1732
  completion: {
1738
1733
  kind: "streak";
1739
1734
  days: number;
1740
- timeZone: string;
1741
1735
  } | {
1742
1736
  kind: "once";
1743
1737
  } | {
@@ -2237,7 +2231,6 @@ declare function createRelayClient(options: RelayClientOptions): {
2237
2231
  completion: {
2238
2232
  kind: "streak";
2239
2233
  days: number;
2240
- timeZone: string;
2241
2234
  } | {
2242
2235
  kind: "once";
2243
2236
  } | {
@@ -2536,11 +2529,11 @@ declare function createRelayClient(options: RelayClientOptions): {
2536
2529
  metrics: ("likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks")[];
2537
2530
  baseline: "historical";
2538
2531
  maxAgeMs: number;
2539
- budget: {
2540
- projectDaily?: number | undefined;
2541
- memberDaily?: number | undefined;
2542
- projectLifetime?: number | undefined;
2543
- };
2532
+ budgets: {
2533
+ scope: "member" | "project";
2534
+ period: "lifetime" | "day" | "week" | "month";
2535
+ limit: number;
2536
+ }[];
2544
2537
  };
2545
2538
  publishedAt: number;
2546
2539
  };
@@ -2582,11 +2575,11 @@ declare function createRelayClient(options: RelayClientOptions): {
2582
2575
  metrics: ("likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks")[];
2583
2576
  baseline: "historical";
2584
2577
  maxAgeMs: number;
2585
- budget: {
2586
- projectDaily?: number | undefined;
2587
- memberDaily?: number | undefined;
2588
- projectLifetime?: number | undefined;
2589
- };
2578
+ budgets: {
2579
+ scope: "member" | "project";
2580
+ period: "lifetime" | "day" | "week" | "month";
2581
+ limit: number;
2582
+ }[];
2590
2583
  };
2591
2584
  publishedAt: number;
2592
2585
  } | null;
@@ -2599,11 +2592,11 @@ declare function createRelayClient(options: RelayClientOptions): {
2599
2592
  metrics: ("likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks")[];
2600
2593
  baseline: "historical";
2601
2594
  maxAgeMs: number;
2602
- budget: {
2603
- projectDaily?: number | undefined;
2604
- memberDaily?: number | undefined;
2605
- projectLifetime?: number | undefined;
2606
- };
2595
+ budgets: {
2596
+ scope: "member" | "project";
2597
+ period: "lifetime" | "day" | "week" | "month";
2598
+ limit: number;
2599
+ }[];
2607
2600
  };
2608
2601
  publishedAt: number;
2609
2602
  };