@domino-sdk/relay 1.54.0 → 1.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +1859 -0
  2. package/dist/analytics-URV-mxjH.d.ts +482 -0
  3. package/dist/{attempt-captures-QC4kTA44.d.ts → attempt-captures-CxxO7DeD.d.ts} +1 -1
  4. package/dist/authoring.d.ts +277 -40
  5. package/dist/authoring.js +142 -14
  6. package/dist/{automatic-outcomes-CVyZHxir.d.ts → automatic-outcomes-DxW_v5Wc.d.ts} +5 -2
  7. package/dist/avatar.d.ts +1 -1
  8. package/dist/browser.d.ts +7 -7
  9. package/dist/browser.js +10 -10
  10. package/dist/{capability-error-FQGGb5xS.d.ts → capability-error-DSd8EMQC.d.ts} +76 -2
  11. package/dist/{chunk-RP4LLEON.js → chunk-ABJ4G47X.js} +1 -1
  12. package/dist/{chunk-IELNFM3V.js → chunk-BHHUSBSD.js} +97 -8
  13. package/dist/chunk-BJYMTCWG.js +950 -0
  14. package/dist/{chunk-K6TVMNU4.js → chunk-CK7HO32Z.js} +1 -1
  15. package/dist/{chunk-GTQJSDBS.js → chunk-CXKXPB7K.js} +32 -16
  16. package/dist/{chunk-TL5TL5RD.js → chunk-G6XVBYH7.js} +4 -4
  17. package/dist/{chunk-S2PMKZSX.js → chunk-H2MD6E7Z.js} +21 -2
  18. package/dist/{chunk-YVC3B72P.js → chunk-INSWI2VZ.js} +1 -1
  19. package/dist/{chunk-XFAYQFRO.js → chunk-KBVH4XZC.js} +1 -1
  20. package/dist/{chunk-MLIXJPKL.js → chunk-MHPKEVEW.js} +1 -0
  21. package/dist/{chunk-7BNCLWAO.js → chunk-MNU6UPXY.js} +1 -1
  22. package/dist/{chunk-JL7J3EQQ.js → chunk-NK6EER33.js} +46 -16
  23. package/dist/{chunk-QIDQWXSF.js → chunk-OTITLABX.js} +2 -2
  24. package/dist/{chunk-53JMTUWG.js → chunk-QNQNKIAA.js} +1 -1
  25. package/dist/{chunk-ZJ3FVZRP.js → chunk-RBPMT53S.js} +132 -99
  26. package/dist/chunk-ULQU7KC4.js +704 -0
  27. package/dist/chunk-VSHV7FEA.js +344 -0
  28. package/dist/{chunk-LPHXTZDA.js → chunk-W5U2WXG3.js} +2 -2
  29. package/dist/{client-CzNtl8UO.d.ts → client-bX3oTpRu.d.ts} +111 -8
  30. package/dist/{deployments-ovtqtAcx.d.ts → deployments-D3lxfQMB.d.ts} +1436 -185
  31. package/dist/{groups-B5R1RCsl.d.ts → groups-DPE004_V.d.ts} +135 -139
  32. package/dist/index.d.ts +8 -8
  33. package/dist/index.js +9 -9
  34. package/dist/integrations-CcD5NPEA.d.ts +633 -0
  35. package/dist/internal.d.ts +11 -10
  36. package/dist/internal.js +9 -9
  37. package/dist/{offers-CH1RZekg.d.ts → offers-CtzMeB7O.d.ts} +207 -2
  38. package/dist/{pages-BTlOg8sl.d.ts → pages-BlLqB8ZQ.d.ts} +82 -2
  39. package/dist/portal-proxy.d.ts +11 -1
  40. package/dist/portal-proxy.js +27 -6
  41. package/dist/{profiles-Cdv4BSd_.d.ts → profiles-BoOK03cR.d.ts} +2 -0
  42. package/dist/react/index.d.ts +566 -13
  43. package/dist/react/index.js +105 -15
  44. package/dist/runtime/authoring.js +1 -1
  45. package/dist/runtime/chunks/NDB42VFF.js +1 -0
  46. package/dist/runtime/manifest.json +3 -3
  47. package/dist/runtime/schema.js +1 -1
  48. package/dist/{schema-BJ9bOgpN.d.ts → schema-C4m9RhCR.d.ts} +166 -6
  49. package/dist/schema.d.ts +383 -79
  50. package/dist/schema.js +105 -41
  51. package/dist/server/index.d.ts +11 -10
  52. package/dist/server/index.js +1590 -1175
  53. package/dist/{submission-input-BNah53go.d.ts → submission-input-wTiYGdgA.d.ts} +2 -2
  54. package/dist/{telegram-browser-C36j_6v-.d.ts → telegram-browser-Bh3i0HiH.d.ts} +1 -1
  55. package/dist/testing.d.ts +85 -12
  56. package/dist/testing.js +322 -37
  57. package/dist/{transport-C8BlCzmF.d.ts → transport-CnKA-_RL.d.ts} +7625 -1265
  58. package/dist/vite.d.ts +54 -1
  59. package/dist/vite.js +35 -0
  60. package/dist/{x-BfQcsDp0.d.ts → x-1czZFVUW.d.ts} +1 -1
  61. package/package.json +3 -2
  62. package/dist/chunk-2NUD237O.js +0 -102
  63. package/dist/chunk-CCE2JWES.js +0 -1083
  64. package/dist/integrations-CllF-kWg.d.ts +0 -314
  65. package/dist/runtime/chunks/AVRVSLHX.js +0 -1
@@ -2,7 +2,7 @@ import {
2
2
  identifier,
3
3
  responseShape,
4
4
  xTweetSchema
5
- } from "./chunk-IELNFM3V.js";
5
+ } from "./chunk-BHHUSBSD.js";
6
6
 
7
7
  // src/x.ts
8
8
  import * as z from "zod";
@@ -1,3 +1,7 @@
1
+ import {
2
+ dashboardArtifactSchema,
3
+ dashboardPreviewSchema
4
+ } from "./chunk-ULQU7KC4.js";
1
5
  import {
2
6
  imageAssetArtifactSchema,
3
7
  imageComparisonSchema,
@@ -6,11 +10,12 @@ import {
6
10
  imageSightingsSchema,
7
11
  imageUploadsSchema,
8
12
  publishedImageSchema
9
- } from "./chunk-K6TVMNU4.js";
13
+ } from "./chunk-CK7HO32Z.js";
10
14
  import {
11
15
  catalogDeploymentSchema,
12
16
  collectionPassSchema,
13
17
  collectionViewSchema,
18
+ creatorAccountsSchema,
14
19
  interactionSchema,
15
20
  participantActivitySchema,
16
21
  participantDeliveriesSchema,
@@ -24,7 +29,7 @@ import {
24
29
  questTypeVersionSchema,
25
30
  questViewSchema,
26
31
  rewardDeliveriesSchema
27
- } from "./chunk-ZJ3FVZRP.js";
32
+ } from "./chunk-RBPMT53S.js";
28
33
  import {
29
34
  badgeArtifactSchema,
30
35
  badgeSchema,
@@ -43,6 +48,14 @@ import {
43
48
  offerArtifactSchema,
44
49
  offerDefinitionSchema,
45
50
  offerSchema,
51
+ publishedReferralSchema,
52
+ redemptionSchema,
53
+ referralArtifactSchema,
54
+ referralDefinitionSchema,
55
+ referralHistorySchema,
56
+ referralSummarySchema
57
+ } from "./chunk-BJYMTCWG.js";
58
+ import {
46
59
  ownProfileSchema,
47
60
  pointBalancesSchema,
48
61
  pointHistoryPageSchema,
@@ -52,21 +65,13 @@ import {
52
65
  profileCompletionPageSchema,
53
66
  profileReferralSchema,
54
67
  profileSummarySchema,
55
- publishedReferralSchema,
56
- redemptionSchema,
57
- referralArtifactSchema,
58
- referralDefinitionSchema,
59
- referralHistorySchema,
60
- referralSummarySchema
61
- } from "./chunk-CCE2JWES.js";
62
- import {
63
68
  telegramAccountConnectionSchema
64
- } from "./chunk-2NUD237O.js";
69
+ } from "./chunk-VSHV7FEA.js";
65
70
  import {
66
71
  exchangeResultSchema,
67
72
  memberSummarySchema,
68
73
  participantSessionSchema
69
- } from "./chunk-53JMTUWG.js";
74
+ } from "./chunk-QNQNKIAA.js";
70
75
  import {
71
76
  accountConnectionSchema,
72
77
  attemptSchema,
@@ -99,7 +104,7 @@ import {
99
104
  walletBalanceSchema,
100
105
  walletMessageChallengeSchema,
101
106
  walletSignInNetworksSchema
102
- } from "./chunk-IELNFM3V.js";
107
+ } from "./chunk-BHHUSBSD.js";
103
108
 
104
109
  // src/deployments.ts
105
110
  import * as z from "zod";
@@ -112,6 +117,8 @@ var projectCatalogArtifactSchema = catalogDeploymentSchema.omit({ expectedRevisi
112
117
  referrals: z.array(referralArtifactSchema).max(50).default([]),
113
118
  leaderboards: z.array(leaderboardArtifactSchema).max(50).default([]),
114
119
  images: z.array(imageAssetArtifactSchema).max(10).default([]),
120
+ // A generous bound: the deployment answers too-many-dashboards past dashboardLimits.dashboards.
121
+ dashboards: z.array(dashboardArtifactSchema).max(100).default([]),
115
122
  /** relay.json `calendar`: the project timezone. Omitted, the deployment leaves it unchanged. */
116
123
  calendar: projectCalendarDeclarationSchema.optional(),
117
124
  /**
@@ -123,8 +130,8 @@ var projectCatalogArtifactSchema = catalogDeploymentSchema.omit({ expectedRevisi
123
130
  var projectDeploymentSchema = projectCatalogArtifactSchema.extend({
124
131
  releases: z.array(releaseSchema).max(questScaleLimits.quests).default([])
125
132
  }).refine(
126
- (value) => value.engagement.length > 0 || value.trackers.length > 0 || value.pointLedgers.length > 0 || value.badges.length > 0 || value.offers.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,
127
- "No resources configured. Add engagement, trackers, quests, questTypes, badges, pointLedgers, offers, leaderboards, referrals, images, collections, supportedInteractions, or calendar to relay.json."
133
+ (value) => value.engagement.length > 0 || value.trackers.length > 0 || value.pointLedgers.length > 0 || value.badges.length > 0 || value.offers.length > 0 || value.releases.length > 0 || value.leaderboards.length > 0 || value.referrals.length > 0 || value.images.length > 0 || value.dashboards.length > 0 || value.types.length > 0 || value.collections.length > 0 || value.supportedInteractions !== void 0 || value.calendar !== void 0,
134
+ "No resources configured. Add engagement, trackers, quests, questTypes, badges, pointLedgers, offers, leaderboards, referrals, images, dashboards, collections, supportedInteractions, or calendar to relay.json."
128
135
  );
129
136
  var deploymentWarningSchema = z.object({
130
137
  code: z.string(),
@@ -147,6 +154,11 @@ var deploymentPreviewSchema = z.object({
147
154
  referrals: z.array(publishedReferralSchema).default([]),
148
155
  leaderboards: z.array(leaderboardPreviewSchema).default([]),
149
156
  images: z.array(publishedImageSchema).default([]),
157
+ /**
158
+ * The deployment's dashboards; `change` says whether each publishes a new version. Relay sends an
159
+ * empty list when there is none; optional so values built for older SDKs still fit.
160
+ */
161
+ dashboards: z.array(dashboardPreviewSchema).optional(),
150
162
  /**
151
163
  * The project timezone change this deployment makes, or null for none. A declared timezone
152
164
  * applies only when relay.json changes it, so a change made in Console stays until relay.json
@@ -351,7 +363,7 @@ var automaticOutcomeSchema = z3.union([
351
363
  automaticOutcomeWithoutAttemptSchema,
352
364
  automaticOutcomeWithAttemptSchema
353
365
  ]);
354
- var isRetryableAutomaticOutcome = (outcome) => outcome.linkedAttempt?.status === "rejected" && outcome.linkedAttempt.code === "budget-exhausted";
366
+ var isRetryableAutomaticOutcome = (outcome) => outcome.linkedAttempt?.status === "rejected" && outcome.linkedAttempt.code === "budget-exhausted" || outcome.linkedAttempt?.status === "failed" && outcome.linkedAttempt.code === "integration-required";
355
367
  var automaticOutcomeQuerySchema = z3.strictObject({
356
368
  quest: identifier.optional(),
357
369
  member: identifier.optional(),
@@ -437,6 +449,9 @@ var participantResponseSchemas = lazyResponseReaders({
437
449
  get telegramAccountConnectionSchema() {
438
450
  return knownResponse(telegramAccountConnectionSchema);
439
451
  },
452
+ get creatorAccountsSchema() {
453
+ return knownResponse(creatorAccountsSchema);
454
+ },
440
455
  get accountConnectionSchema() {
441
456
  return knownResponse(accountConnectionSchema);
442
457
  },
@@ -570,6 +585,7 @@ var participantResponses = {
570
585
  telegramAccountConnectionSchema: responseSchema(
571
586
  telegramAccountConnectionSchema
572
587
  ),
588
+ creatorAccountsSchema: responseSchema(creatorAccountsSchema),
573
589
  accountConnectionSchema: responseSchema(accountConnectionSchema),
574
590
  attemptSchema: responseSchema(attemptSchema),
575
591
  authProviderSchema: responseSchema(authProviderSchema),
@@ -4,20 +4,20 @@ import {
4
4
  retryAfter,
5
5
  retrying,
6
6
  validTimeout
7
- } from "./chunk-XFAYQFRO.js";
7
+ } from "./chunk-KBVH4XZC.js";
8
8
  import {
9
9
  clientIdentity
10
- } from "./chunk-RP4LLEON.js";
10
+ } from "./chunk-ABJ4G47X.js";
11
11
  import {
12
12
  authScopeSchema
13
- } from "./chunk-53JMTUWG.js";
13
+ } from "./chunk-QNQNKIAA.js";
14
14
  import {
15
15
  RequestError,
16
16
  appIdentityKindSchema,
17
17
  isRequestError,
18
18
  knownResponse,
19
19
  openIdentityKindSchema
20
- } from "./chunk-IELNFM3V.js";
20
+ } from "./chunk-BHHUSBSD.js";
21
21
 
22
22
  // src/configuration.ts
23
23
  function questConfiguration(release) {
@@ -5,11 +5,18 @@ import {
5
5
  isKnownTrackerSource,
6
6
  trackerDataSchema,
7
7
  xAccountRoles
8
- } from "./chunk-IELNFM3V.js";
8
+ } from "./chunk-BHHUSBSD.js";
9
9
 
10
10
  // src/quest-shape.ts
11
11
  function validateQuestShape(description, options = {}) {
12
- const { trigger, completion, requires, performance, retryCooldownMs } = description;
12
+ const {
13
+ trigger,
14
+ completion,
15
+ requires,
16
+ performance,
17
+ retryCooldownMs,
18
+ completionCooldownMs
19
+ } = description;
13
20
  const tracker = trigger.kind === "automatic" ? trigger.tracker : void 0;
14
21
  const content = tracker?.content === true;
15
22
  if (performance && !content) {
@@ -30,6 +37,18 @@ function validateQuestShape(description, options = {}) {
30
37
  "A retry cooldown applies only to quests members submit themselves"
31
38
  );
32
39
  }
40
+ if (completionCooldownMs !== void 0) {
41
+ if (trigger.kind !== "manual" || trigger.actor === "staff") {
42
+ throw new Error(
43
+ "A completion cooldown applies only to quests members submit themselves"
44
+ );
45
+ }
46
+ if (completion.kind === "once") {
47
+ throw new Error(
48
+ "A completion cooldown needs a quest members can complete more than once: this one completes once per member"
49
+ );
50
+ }
51
+ }
33
52
  if (trigger.kind === "automatic" && !tracker) {
34
53
  if (!options.template && requires.length === 0) {
35
54
  throw new Error("Automatic quests need at least one prerequisite");
@@ -2,7 +2,7 @@ import {
2
2
  RelayErrorCode,
3
3
  clientError,
4
4
  isRequestError
5
- } from "./chunk-IELNFM3V.js";
5
+ } from "./chunk-BHHUSBSD.js";
6
6
 
7
7
  // src/action.ts
8
8
  function withActionId(value) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isRequestError
3
- } from "./chunk-IELNFM3V.js";
3
+ } from "./chunk-BHHUSBSD.js";
4
4
 
5
5
  // src/request-lifetime.ts
6
6
  var PARTICIPANT_TIMEOUT = 15e3;
@@ -20,6 +20,7 @@ var participantRoutes = [
20
20
  { method: "POST", path: "/v1/auth/logout" },
21
21
  { method: "GET", path: "/v1/auth/accounts" },
22
22
  { method: "GET", path: "/v1/auth/accounts/telegram" },
23
+ { method: "GET", path: "/v1/auth/creator-accounts" },
23
24
  { method: "POST", path: "/v1/auth/accounts/disconnect" },
24
25
  { method: "POST", path: "/v1/auth/telegram/mini-app" },
25
26
  // The signed-in member: progress, submissions, rewards, points, activity and linked wallets.
@@ -8,7 +8,7 @@ import {
8
8
  rewardBundleSchema,
9
9
  settingsValuesSchema,
10
10
  trackerTriggerContextSchema
11
- } from "./chunk-IELNFM3V.js";
11
+ } from "./chunk-BHHUSBSD.js";
12
12
 
13
13
  // src/server/attempt-captures.ts
14
14
  import * as z from "zod";
@@ -1,9 +1,11 @@
1
1
  import {
2
2
  createRelayAction,
3
3
  withActionId
4
- } from "./chunk-YVC3B72P.js";
4
+ } from "./chunk-INSWI2VZ.js";
5
5
  import {
6
6
  collectionPassSchema,
7
+ creatorAccountProviderSchema,
8
+ creatorAccountsSchema,
7
9
  participantActivityQuerySchema,
8
10
  participantActivitySchema,
9
11
  participantDeliveriesSchema,
@@ -17,10 +19,8 @@ import {
17
19
  questOutcomeSchema,
18
20
  rewardDeliveriesSchema,
19
21
  rewardDeliveryQuerySchema
20
- } from "./chunk-ZJ3FVZRP.js";
22
+ } from "./chunk-RBPMT53S.js";
21
23
  import {
22
- AVATAR_UPLOAD_LIMIT,
23
- avatarUploadTypes,
24
24
  badgeSchema,
25
25
  engagementBoundaryPageSchema,
26
26
  engagementPageQuerySchema,
@@ -33,6 +33,15 @@ import {
33
33
  leaderboardQuerySchema,
34
34
  memberBadgesSchema,
35
35
  offerSchema,
36
+ redemptionSchema,
37
+ referralAcceptSchema,
38
+ referralDefinitionSchema,
39
+ referralHistorySchema,
40
+ referralSummarySchema
41
+ } from "./chunk-BJYMTCWG.js";
42
+ import {
43
+ AVATAR_UPLOAD_LIMIT,
44
+ avatarUploadTypes,
36
45
  ownProfileSchema,
37
46
  pointBalancesSchema,
38
47
  pointHistoryPageSchema,
@@ -43,34 +52,27 @@ import {
43
52
  profileReferralSchema,
44
53
  profileSummarySchema,
45
54
  profileUpdateSchema,
46
- redemptionSchema,
47
- referralAcceptSchema,
48
- referralDefinitionSchema,
49
- referralHistorySchema,
50
- referralSummarySchema
51
- } from "./chunk-CCE2JWES.js";
52
- import {
53
55
  telegramAccountConnectionSchema,
54
56
  telegramMiniAppSignInSchema,
55
57
  telegramSignInMethodsSchema
56
- } from "./chunk-2NUD237O.js";
58
+ } from "./chunk-VSHV7FEA.js";
57
59
  import {
58
60
  PARTICIPANT_TIMEOUT,
59
61
  lifetime,
60
62
  retryAfter,
61
63
  retrying,
62
64
  validTimeout
63
- } from "./chunk-XFAYQFRO.js";
65
+ } from "./chunk-KBVH4XZC.js";
64
66
  import {
65
67
  clientIdentity
66
- } from "./chunk-RP4LLEON.js";
68
+ } from "./chunk-ABJ4G47X.js";
67
69
  import {
68
70
  exchangeResultSchema,
69
71
  exchangeSchema,
70
72
  memberSummarySchema,
71
73
  participantSessionSchema,
72
74
  sessionMember
73
- } from "./chunk-53JMTUWG.js";
75
+ } from "./chunk-QNQNKIAA.js";
74
76
  import {
75
77
  RelayError,
76
78
  RelayErrorCode,
@@ -109,7 +111,7 @@ import {
109
111
  walletSignInNetworksSchema,
110
112
  walletSignatureSchema,
111
113
  walletUnlinkInputSchema
112
- } from "./chunk-IELNFM3V.js";
114
+ } from "./chunk-BHHUSBSD.js";
113
115
 
114
116
  // src/legacy-submissions.ts
115
117
  import * as z from "zod";
@@ -2114,6 +2116,34 @@ function relayClient(options) {
2114
2116
  })
2115
2117
  }
2116
2118
  },
2119
+ /**
2120
+ * The member's creator accounts: the platform accounts they publish from, such as a YouTube
2121
+ * channel, which managed tracker sources read. A creator account is linked only to a
2122
+ * signed-in member, never used to sign in, and linking another one on the same platform
2123
+ * replaces it.
2124
+ */
2125
+ creatorAccounts: {
2126
+ /** One entry per creator-account provider the platform configured. */
2127
+ list: (requestOptions) => request("/v1/auth/creator-accounts", creatorAccountsSchema, {
2128
+ options: requestOptions
2129
+ }),
2130
+ /**
2131
+ * Leaves for the provider's consent screen to link an account to the signed-in member.
2132
+ * Answers the URL to open; the browser comes back to the app linked.
2133
+ */
2134
+ connect: async (provider, requestOptions) => request("/v1/auth/start", z2.object({ url: z2.string() }), {
2135
+ json: {
2136
+ provider: parseInput(creatorAccountProviderSchema, provider),
2137
+ mode: "connect"
2138
+ },
2139
+ options: requestOptions
2140
+ }),
2141
+ /** Unlinks the member's account on `provider`. Records it authored stay. */
2142
+ disconnect: async (provider, requestOptions) => request("/v1/auth/accounts/disconnect", acknowledged, {
2143
+ json: { provider: parseInput(creatorAccountProviderSchema, provider) },
2144
+ options: requestOptions
2145
+ })
2146
+ },
2117
2147
  /** The member's connected sign-in accounts, one per provider. */
2118
2148
  accounts: (requestOptions) => request("/v1/auth/accounts", z2.array(accountConnectionSchema), {
2119
2149
  options: requestOptions
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createRelayClient
3
- } from "./chunk-JL7J3EQQ.js";
3
+ } from "./chunk-NK6EER33.js";
4
4
  import {
5
5
  RelayErrorCode,
6
6
  asRelayError,
7
7
  clientError,
8
8
  cosmosChain
9
- } from "./chunk-IELNFM3V.js";
9
+ } from "./chunk-BHHUSBSD.js";
10
10
 
11
11
  // src/base58.ts
12
12
  var alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  identifier
3
- } from "./chunk-IELNFM3V.js";
3
+ } from "./chunk-BHHUSBSD.js";
4
4
 
5
5
  // src/auth.ts
6
6
  import * as z from "zod";