@domino-sdk/relay 1.52.1 → 1.54.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.
@@ -260,8 +260,8 @@ declare function defineLeaderboard(input: Omit<LeaderboardInput, "key" | "id" |
260
260
  kind: "earned";
261
261
  }> | ReturnType<typeof earned>;
262
262
  }): {
263
- balance: string;
264
263
  title: string;
264
+ balance: string;
265
265
  access: "participants" | "public";
266
266
  score: {
267
267
  kind: "balance";
@@ -450,7 +450,7 @@ declare const telegram: {
450
450
  reactions(): {
451
451
  kind: "custom";
452
452
  namespace: string;
453
- identities?: ("discord" | "wallet" | "x" | "member" | `app:${string}`)[] | undefined;
453
+ identities?: ("discord" | "member" | "wallet" | "x" | `app:${string}`)[] | undefined;
454
454
  accounts?: string[] | undefined;
455
455
  data?: TrackerDataSchema | undefined;
456
456
  content?: {
@@ -1148,15 +1148,15 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1148
1148
  group?: string | undefined;
1149
1149
  };
1150
1150
  tier: string;
1151
- } | {
1152
- kind: "points";
1153
- balance: string;
1154
- amount: number;
1155
1151
  } | {
1156
1152
  kind: "integration";
1157
1153
  provider: "discord";
1158
1154
  action: "grant-role";
1159
1155
  roleId: string;
1156
+ } | {
1157
+ kind: "points";
1158
+ balance: string;
1159
+ amount: number;
1160
1160
  })[] | ((ctx: {
1161
1161
  settings: z.core.$InferObjectOutput<T, {}>;
1162
1162
  }) => Reward[]);
@@ -1231,9 +1231,6 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1231
1231
  kind: "resource";
1232
1232
  default: string;
1233
1233
  source: {
1234
- provider: "domino";
1235
- resource: "point-ledger";
1236
- } | {
1237
1234
  provider: "discord";
1238
1235
  resource: "channel";
1239
1236
  types: ("text" | "announcement")[];
@@ -1241,6 +1238,9 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1241
1238
  provider: "discord";
1242
1239
  resource: "role";
1243
1240
  assignable: boolean;
1241
+ } | {
1242
+ provider: "domino";
1243
+ resource: "point-ledger";
1244
1244
  };
1245
1245
  label: string;
1246
1246
  description?: string | undefined;
@@ -1315,15 +1315,15 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1315
1315
  group?: string | undefined;
1316
1316
  };
1317
1317
  tier: string;
1318
- } | {
1319
- kind: "points";
1320
- balance: string;
1321
- amount: number;
1322
1318
  } | {
1323
1319
  kind: "integration";
1324
1320
  provider: "discord";
1325
1321
  action: "grant-role";
1326
1322
  roleId: string;
1323
+ } | {
1324
+ kind: "points";
1325
+ balance: string;
1326
+ amount: number;
1327
1327
  })[];
1328
1328
  humanReview: boolean;
1329
1329
  trigger: {
@@ -1345,7 +1345,7 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1345
1345
  actor?: "staff" | "member" | undefined;
1346
1346
  } | {
1347
1347
  kind: "manual";
1348
- input: "photo" | "quiz" | "none";
1348
+ input: "none" | "quiz" | "photo";
1349
1349
  actor?: "staff" | "member" | undefined;
1350
1350
  } | {
1351
1351
  kind: "automatic";
@@ -1389,9 +1389,9 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1389
1389
  path: string;
1390
1390
  equals: string | number | boolean;
1391
1391
  })[] | undefined;
1392
- enrollment?: "required" | "none" | undefined;
1392
+ enrollment?: "none" | "required" | undefined;
1393
1393
  since?: "activation" | "window" | "enrollment" | undefined;
1394
- historical?: "automatic" | "staff" | "claim" | undefined;
1394
+ historical?: "staff" | "claim" | "automatic" | undefined;
1395
1395
  content?: true | undefined;
1396
1396
  } | undefined;
1397
1397
  };
@@ -1414,9 +1414,6 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1414
1414
  title: string;
1415
1415
  })[];
1416
1416
  completion: {
1417
- kind: "streak";
1418
- days: number;
1419
- } | {
1420
1417
  kind: "progress";
1421
1418
  goal: {
1422
1419
  kind: "count";
@@ -1433,6 +1430,9 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1433
1430
  durationMs: number;
1434
1431
  };
1435
1432
  repeat: "repeat" | "once";
1433
+ } | {
1434
+ kind: "streak";
1435
+ days: number;
1436
1436
  } | {
1437
1437
  kind: "once";
1438
1438
  } | {
@@ -1458,7 +1458,7 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1458
1458
  campaign?: {
1459
1459
  key: string;
1460
1460
  title: string;
1461
- enrollment: "required" | "none";
1461
+ enrollment: "none" | "required";
1462
1462
  window?: {
1463
1463
  from: number;
1464
1464
  until: number;
@@ -1581,15 +1581,15 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1581
1581
  group?: string | undefined;
1582
1582
  };
1583
1583
  tier: string;
1584
- } | {
1585
- kind: "points";
1586
- balance: string;
1587
- amount: number;
1588
1584
  } | {
1589
1585
  kind: "integration";
1590
1586
  provider: "discord";
1591
1587
  action: "grant-role";
1592
1588
  roleId: string;
1589
+ } | {
1590
+ kind: "points";
1591
+ balance: string;
1592
+ amount: number;
1593
1593
  })[] | ((ctx: {
1594
1594
  settings: z.core.$InferObjectOutput<T, {}>;
1595
1595
  }) => Reward[]);
@@ -1664,9 +1664,6 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1664
1664
  kind: "resource";
1665
1665
  default: string;
1666
1666
  source: {
1667
- provider: "domino";
1668
- resource: "point-ledger";
1669
- } | {
1670
1667
  provider: "discord";
1671
1668
  resource: "channel";
1672
1669
  types: ("text" | "announcement")[];
@@ -1674,6 +1671,9 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1674
1671
  provider: "discord";
1675
1672
  resource: "role";
1676
1673
  assignable: boolean;
1674
+ } | {
1675
+ provider: "domino";
1676
+ resource: "point-ledger";
1677
1677
  };
1678
1678
  label: string;
1679
1679
  description?: string | undefined;
@@ -1748,15 +1748,15 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1748
1748
  group?: string | undefined;
1749
1749
  };
1750
1750
  tier: string;
1751
- } | {
1752
- kind: "points";
1753
- balance: string;
1754
- amount: number;
1755
1751
  } | {
1756
1752
  kind: "integration";
1757
1753
  provider: "discord";
1758
1754
  action: "grant-role";
1759
1755
  roleId: string;
1756
+ } | {
1757
+ kind: "points";
1758
+ balance: string;
1759
+ amount: number;
1760
1760
  })[];
1761
1761
  humanReview: boolean;
1762
1762
  trigger: {
@@ -1778,7 +1778,7 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1778
1778
  actor?: "staff" | "member" | undefined;
1779
1779
  } | {
1780
1780
  kind: "manual";
1781
- input: "photo" | "quiz" | "none";
1781
+ input: "none" | "quiz" | "photo";
1782
1782
  actor?: "staff" | "member" | undefined;
1783
1783
  } | {
1784
1784
  kind: "automatic";
@@ -1822,9 +1822,9 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1822
1822
  path: string;
1823
1823
  equals: string | number | boolean;
1824
1824
  })[] | undefined;
1825
- enrollment?: "required" | "none" | undefined;
1825
+ enrollment?: "none" | "required" | undefined;
1826
1826
  since?: "activation" | "window" | "enrollment" | undefined;
1827
- historical?: "automatic" | "staff" | "claim" | undefined;
1827
+ historical?: "staff" | "claim" | "automatic" | undefined;
1828
1828
  content?: true | undefined;
1829
1829
  } | undefined;
1830
1830
  };
@@ -1847,9 +1847,6 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1847
1847
  title: string;
1848
1848
  })[];
1849
1849
  completion: {
1850
- kind: "streak";
1851
- days: number;
1852
- } | {
1853
1850
  kind: "progress";
1854
1851
  goal: {
1855
1852
  kind: "count";
@@ -1866,6 +1863,9 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1866
1863
  durationMs: number;
1867
1864
  };
1868
1865
  repeat: "repeat" | "once";
1866
+ } | {
1867
+ kind: "streak";
1868
+ days: number;
1869
1869
  } | {
1870
1870
  kind: "once";
1871
1871
  } | {
@@ -1891,7 +1891,7 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1891
1891
  campaign?: {
1892
1892
  key: string;
1893
1893
  title: string;
1894
- enrollment: "required" | "none";
1894
+ enrollment: "none" | "required";
1895
1895
  window?: {
1896
1896
  from: number;
1897
1897
  until: number;
package/dist/browser.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { o as SubmissionStore, f as RelayClientOptions, R as RelayClient } from './client-CzNtl8UO.js';
2
2
  export { C as CosmosChains, D as DiscoveredWallet, E as Eip1193Provider, a as EmailSignInOption, K as KeplrLike, O as OAuthSignInOption, S as SignInClient, b as SignInIcon, c as SignInMethods, d as SignInOption, e as SignInOptions, f as SignInUnavailable, g as SignInWallet, h as SolanaInjectedProvider, i as StandardWallet, j as StandardWalletAccount, T as TelegramSignInOption, W as WalletSignInOption, k as cosmosChainList, l as cosmosSigner, m as discoverCosmosWallets, n as discoverEvmWallets, o as discoverSignInWallets, p as discoverSolanaWallets, q as evmSigner, s as signInOptions, r as solanaSigner, t as telegramMiniAppInitData, w as walletStandardSolanaSigner } from './telegram-browser-C36j_6v-.js';
3
+ export { H as HostEnvironment, g as getHostEnvironment } from './host-environment-FN4zg3hw.js';
3
4
  import './groups-B5R1RCsl.js';
4
5
  import 'zod';
5
6
  import './schema-BJ9bOgpN.js';
package/dist/browser.js CHANGED
@@ -12,14 +12,17 @@ import {
12
12
  solanaSigner,
13
13
  telegramMiniAppInitData,
14
14
  walletStandardSolanaSigner
15
- } from "./chunk-K74XFZGW.js";
16
- import "./chunk-BMZAYH65.js";
15
+ } from "./chunk-QIDQWXSF.js";
16
+ import "./chunk-JL7J3EQQ.js";
17
17
  import "./chunk-YVC3B72P.js";
18
18
  import "./chunk-ZJ3FVZRP.js";
19
19
  import "./chunk-CCE2JWES.js";
20
20
  import "./chunk-2NUD237O.js";
21
+ import {
22
+ getHostEnvironment
23
+ } from "./chunk-KDR2VAJP.js";
21
24
  import "./chunk-XFAYQFRO.js";
22
- import "./chunk-LAO3L4VS.js";
25
+ import "./chunk-RP4LLEON.js";
23
26
  import "./chunk-53JMTUWG.js";
24
27
  import "./chunk-IELNFM3V.js";
25
28
  export {
@@ -32,6 +35,7 @@ export {
32
35
  discoverSignInWallets,
33
36
  discoverSolanaWallets,
34
37
  evmSigner,
38
+ getHostEnvironment,
35
39
  signInOptions,
36
40
  solanaSigner,
37
41
  telegramMiniAppInitData,
@@ -63,7 +63,7 @@ import {
63
63
  } from "./chunk-XFAYQFRO.js";
64
64
  import {
65
65
  clientIdentity
66
- } from "./chunk-LAO3L4VS.js";
66
+ } from "./chunk-RP4LLEON.js";
67
67
  import {
68
68
  exchangeResultSchema,
69
69
  exchangeSchema,
@@ -0,0 +1,34 @@
1
+ // src/host-environment.ts
2
+ import * as z from "zod";
3
+ var hostEnvironmentPath = "/__domino/environment";
4
+ var hostEnvironmentSchema = z.object({
5
+ environment: z.enum(["test", "live"]),
6
+ kind: z.enum(["staging", "preview", "live"])
7
+ });
8
+ var pending;
9
+ async function readHostEnvironment() {
10
+ try {
11
+ const response = await fetch(hostEnvironmentPath, {
12
+ headers: { Accept: "application/json" }
13
+ });
14
+ if (response.status !== 200) {
15
+ return null;
16
+ }
17
+ const parsed = hostEnvironmentSchema.safeParse(await response.json());
18
+ return parsed.success ? parsed.data : null;
19
+ } catch {
20
+ return null;
21
+ }
22
+ }
23
+ function getHostEnvironment() {
24
+ if (!globalThis.location) {
25
+ return Promise.resolve(null);
26
+ }
27
+ return pending ??= readHostEnvironment();
28
+ }
29
+
30
+ export {
31
+ hostEnvironmentPath,
32
+ hostEnvironmentSchema,
33
+ getHostEnvironment
34
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createRelayClient
3
- } from "./chunk-BMZAYH65.js";
3
+ } from "./chunk-JL7J3EQQ.js";
4
4
  import {
5
5
  RelayErrorCode,
6
6
  asRelayError,
@@ -1,6 +1,6 @@
1
1
  // package.json
2
2
  var name = "@domino-sdk/relay";
3
- var version = "1.52.1";
3
+ var version = "1.54.0";
4
4
 
5
5
  // src/client-identity.ts
6
6
  function clientIdentity() {
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-XFAYQFRO.js";
8
8
  import {
9
9
  clientIdentity
10
- } from "./chunk-LAO3L4VS.js";
10
+ } from "./chunk-RP4LLEON.js";
11
11
  import {
12
12
  authScopeSchema
13
13
  } from "./chunk-53JMTUWG.js";
@@ -0,0 +1,30 @@
1
+ import * as z from 'zod';
2
+
3
+ /** Answered by Relay's gateway on every hosted app host, never by the app. */
4
+ declare const hostEnvironmentPath = "/__domino/environment";
5
+ /** What `hostEnvironmentPath` answers. */
6
+ declare const hostEnvironmentSchema: z.ZodObject<{
7
+ environment: z.ZodEnum<{
8
+ test: "test";
9
+ live: "live";
10
+ }>;
11
+ kind: z.ZodEnum<{
12
+ live: "live";
13
+ preview: "preview";
14
+ staging: "staging";
15
+ }>;
16
+ }, z.core.$strip>;
17
+ /**
18
+ * Where a hosted app is running: `test` data on its staging host or a development preview, or
19
+ * `live` on its live host or a custom domain.
20
+ */
21
+ type HostEnvironment = z.infer<typeof hostEnvironmentSchema>;
22
+ /**
23
+ * Where this page is hosted, from the gateway of the host that served it. Resolves to null when the
24
+ * host does not answer (local development, a host outside Domino), so the caller chooses the
25
+ * fallback, and to null outside a browser page. Asks once per page; every call shares the answer.
26
+ * Hostname patterns are not a supported signal.
27
+ */
28
+ declare function getHostEnvironment(): Promise<HostEnvironment | null>;
29
+
30
+ export { type HostEnvironment as H, hostEnvironmentSchema as a, getHostEnvironment as g, hostEnvironmentPath as h };
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  QuestUpdatedError,
7
7
  createRelayClient
8
- } from "./chunk-BMZAYH65.js";
8
+ } from "./chunk-JL7J3EQQ.js";
9
9
  import {
10
10
  createRelayAction
11
11
  } from "./chunk-YVC3B72P.js";
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-CCE2JWES.js";
18
18
  import "./chunk-2NUD237O.js";
19
19
  import "./chunk-XFAYQFRO.js";
20
- import "./chunk-LAO3L4VS.js";
20
+ import "./chunk-RP4LLEON.js";
21
21
  import {
22
22
  sessionMember
23
23
  } from "./chunk-53JMTUWG.js";
@@ -1,7 +1,8 @@
1
- export { I as IdentityKindClaim, M as ManagementTransportOptions, P as ParticipantRoute, R as REFERRAL_INTEGRATION_REWARD_ERROR, c as containsReferralIntegrationReward, i as identityIntegrationInputSchema, a as identityIntegrationSchema, b as identityIntegrationSecretSchema, d as identityKindClaimSchema, e as isIntegrationParticipantPath, f as isParticipantRoute, m as managementTransport, p as parseImageExtraction, g as parseImageResult, h as participantExchangeSchema, j as participantRoutePattern, k as participantRoutes, q as questConfiguration, s as sequenceCursorSchema, l as sourceDataSchema, n as sourceRoles, v as validateQuestShape } from './transport-B8w9oqCY.js';
1
+ export { I as IdentityKindClaim, M as ManagementTransportOptions, P as ParticipantRoute, R as REFERRAL_INTEGRATION_REWARD_ERROR, c as containsReferralIntegrationReward, i as identityIntegrationInputSchema, a as identityIntegrationSchema, b as identityIntegrationSecretSchema, d as identityKindClaimSchema, e as isIntegrationParticipantPath, f as isParticipantRoute, m as managementTransport, p as parseImageExtraction, g as parseImageResult, h as participantExchangeSchema, j as participantRoutePattern, k as participantRoutes, q as questConfiguration, s as sequenceCursorSchema, l as sourceDataSchema, n as sourceRoles, v as validateQuestShape } from './transport-C8BlCzmF.js';
2
2
  export { E as Extracted } from './x-BfQcsDp0.js';
3
3
  import { c as RequestErrorKind } from './action-DBzILFx9.js';
4
4
  export { i as TrackerDataBudget, s as schemaCheckedReader, t as trackerDataBatchSteps, j as trackerDataIssue, k as trackerDataIssues, l as trackerDataPathTypes, m as trackerDataRecordSteps, w as whereSchemaIssue } from './schema-BJ9bOgpN.js';
5
+ export { H as HostEnvironment, h as hostEnvironmentPath, a as hostEnvironmentSchema } from './host-environment-FN4zg3hw.js';
5
6
  import 'zod';
6
7
  import './pages-BTlOg8sl.js';
7
8
  import './offers-CH1RZekg.js';
@@ -9,7 +10,7 @@ import './groups-B5R1RCsl.js';
9
10
  import './profiles-Cdv4BSd_.js';
10
11
  import './automatic-outcomes-CVyZHxir.js';
11
12
  import './attempt-captures-QC4kTA44.js';
12
- import './deployments-DkoBtC5t.js';
13
+ import './deployments-ovtqtAcx.js';
13
14
 
14
15
  /** The management client's and the CLI's default deadline per call. */
15
16
  declare const MANAGEMENT_TIMEOUT = 30000;
package/dist/internal.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  participantExchangeSchema,
10
10
  questConfiguration,
11
11
  sequenceCursorSchema
12
- } from "./chunk-X6V5WY4M.js";
12
+ } from "./chunk-TL5TL5RD.js";
13
13
  import {
14
14
  parseImageExtraction,
15
15
  parseImageResult
@@ -26,13 +26,17 @@ import {
26
26
  participantRoutePattern,
27
27
  participantRoutes
28
28
  } from "./chunk-MLIXJPKL.js";
29
+ import {
30
+ hostEnvironmentPath,
31
+ hostEnvironmentSchema
32
+ } from "./chunk-KDR2VAJP.js";
29
33
  import {
30
34
  MANAGEMENT_TIMEOUT,
31
35
  lifetime,
32
36
  retryAfter,
33
37
  retrying
34
38
  } from "./chunk-XFAYQFRO.js";
35
- import "./chunk-LAO3L4VS.js";
39
+ import "./chunk-RP4LLEON.js";
36
40
  import "./chunk-53JMTUWG.js";
37
41
  import {
38
42
  schemaCheckedReader,
@@ -47,6 +51,8 @@ export {
47
51
  MANAGEMENT_TIMEOUT,
48
52
  REFERRAL_INTEGRATION_REWARD_ERROR,
49
53
  containsReferralIntegrationReward,
54
+ hostEnvironmentPath,
55
+ hostEnvironmentSchema,
50
56
  identityIntegrationInputSchema,
51
57
  identityIntegrationSchema,
52
58
  identityIntegrationSecretSchema,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-MLIXJPKL.js";
4
4
  import {
5
5
  clientIdentity
6
- } from "./chunk-LAO3L4VS.js";
6
+ } from "./chunk-RP4LLEON.js";
7
7
  import {
8
8
  exchangeResultSchema
9
9
  } from "./chunk-53JMTUWG.js";
@@ -9,16 +9,17 @@ import {
9
9
  readSignInMethods,
10
10
  signInOptionsFrom,
11
11
  telegramMiniAppInitData
12
- } from "../chunk-K74XFZGW.js";
13
- import "../chunk-BMZAYH65.js";
12
+ } from "../chunk-QIDQWXSF.js";
13
+ import "../chunk-JL7J3EQQ.js";
14
14
  import {
15
15
  createRelayAction
16
16
  } from "../chunk-YVC3B72P.js";
17
17
  import "../chunk-ZJ3FVZRP.js";
18
18
  import "../chunk-CCE2JWES.js";
19
19
  import "../chunk-2NUD237O.js";
20
+ import "../chunk-KDR2VAJP.js";
20
21
  import "../chunk-XFAYQFRO.js";
21
- import "../chunk-LAO3L4VS.js";
22
+ import "../chunk-RP4LLEON.js";
22
23
  import {
23
24
  sessionMember
24
25
  } from "../chunk-53JMTUWG.js";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "format": 1,
3
- "sdkVersion": "1.52.1",
3
+ "sdkVersion": "1.54.0",
4
4
  "zodVersion": "4.3.6",
5
5
  "entries": {
6
6
  "@domino-sdk/relay/authoring": "authoring.js",