@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
package/dist/vite.d.ts CHANGED
@@ -28,5 +28,58 @@ declare function serverBoundary(options?: {
28
28
  }): void;
29
29
  resolveId(this: ResolveContext, source: string, importer: string | undefined, resolveOptions: Record<string, unknown>): Promise<null>;
30
30
  };
31
+ /** Options for the app's own `cloudflare()` call from `@cloudflare/vite-plugin`. */
32
+ type DominoCloudflareOptions = {
33
+ inspectorPort: false;
34
+ viteEnvironment: {
35
+ name: string;
36
+ };
37
+ /** Set only when serving: the `domino dev` variables, `""` when unset. */
38
+ config?: {
39
+ vars: Record<string, string>;
40
+ };
41
+ };
42
+ /** Vite's `server` settings for serving behind `domino dev`. */
43
+ type DominoServerOptions = {
44
+ strictPort: true;
45
+ port: number;
46
+ allowedHosts: string[];
47
+ /** Set only behind a preview origin: hot reload over its HTTPS host. */
48
+ hmr?: {
49
+ protocol: "wss";
50
+ host: string;
51
+ clientPort: number;
52
+ };
53
+ };
54
+ /**
55
+ * The Vite settings a Domino-hosted Worker app needs, so `vite.config.ts`
56
+ * holds only the app's own plugins:
57
+ *
58
+ * ```ts
59
+ * export default defineConfig(({ command }) => {
60
+ * const domino = dominoHosting({ command })
61
+ *
62
+ * return {
63
+ * plugins: [serverBoundary(), react(), cloudflare(domino.cloudflare)],
64
+ * server: domino.server,
65
+ * }
66
+ * })
67
+ * ```
68
+ *
69
+ * `cloudflare` builds the Worker in Vite's `server` environment and, when
70
+ * serving, forwards the variables `domino dev` sets to the local Worker. The
71
+ * app passes it to its own `cloudflare()` call, so the SDK does not depend on
72
+ * `@cloudflare/vite-plugin`; spread it to add options. `server` serves on
73
+ * `DOMINO_APP_PORT` (5173 by default) and, behind `DOMINO_PREVIEW_ORIGIN`,
74
+ * accepts that host and runs hot reload through it.
75
+ */
76
+ declare function dominoHosting(options: {
77
+ command: "serve" | "build";
78
+ /** Where to read the variables. Defaults to `process.env`. */
79
+ env?: Record<string, string | undefined>;
80
+ }): {
81
+ cloudflare: DominoCloudflareOptions;
82
+ server: DominoServerOptions;
83
+ };
31
84
 
32
- export { serverBoundary };
85
+ export { type DominoCloudflareOptions, type DominoServerOptions, dominoHosting, serverBoundary };
package/dist/vite.js CHANGED
@@ -38,6 +38,41 @@ function serverBoundary(options = {}) {
38
38
  }
39
39
  };
40
40
  }
41
+ var DEVELOPMENT_VARIABLES = [
42
+ "DOMINO_PARTICIPANT_API",
43
+ "DOMINO_PREVIEW_ORIGIN",
44
+ "DOMINO_LOCAL_API",
45
+ "DOMINO_DEV_CONTROL",
46
+ "DOMINO_MANAGEMENT_KEY",
47
+ "DOMINO_API_URL",
48
+ "DOMINO_ORGANIZATION",
49
+ "DOMINO_PROJECT",
50
+ "DOMINO_ENVIRONMENT"
51
+ ];
52
+ function dominoHosting(options) {
53
+ const env = options.env ?? globalThis.process?.env ?? {};
54
+ const previewHost = env.DOMINO_PREVIEW_ORIGIN ? new URL(env.DOMINO_PREVIEW_ORIGIN).hostname : void 0;
55
+ return {
56
+ cloudflare: {
57
+ inspectorPort: false,
58
+ viteEnvironment: { name: "server" },
59
+ ...options.command === "serve" ? {
60
+ config: {
61
+ vars: Object.fromEntries(
62
+ DEVELOPMENT_VARIABLES.map((name) => [name, env[name] ?? ""])
63
+ )
64
+ }
65
+ } : {}
66
+ },
67
+ server: {
68
+ strictPort: true,
69
+ port: Number(env.DOMINO_APP_PORT ?? 5173),
70
+ allowedHosts: previewHost ? [previewHost] : [],
71
+ ...previewHost ? { hmr: { protocol: "wss", host: previewHost, clientPort: 443 } } : {}
72
+ }
73
+ };
74
+ }
41
75
  export {
76
+ dominoHosting,
42
77
  serverBoundary
43
78
  };
@@ -1,5 +1,5 @@
1
1
  import * as z from 'zod';
2
- import { _ as PhotoResult } from './schema-BJ9bOgpN.js';
2
+ import { a8 as PhotoResult } from './schema-C4m9RhCR.js';
3
3
 
4
4
  /**
5
5
  * Quest code names an image; the platform fetches, decodes and pins it. No bytes or URLs cross the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domino-sdk/relay",
3
- "version": "1.54.0",
3
+ "version": "1.56.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -93,7 +93,8 @@
93
93
  "files": [
94
94
  "dist",
95
95
  "build.mjs",
96
- "build.d.mts"
96
+ "build.d.mts",
97
+ "CHANGELOG.md"
97
98
  ],
98
99
  "description": "SDK for authoring quests and integrating Domino Relay",
99
100
  "scripts": {
@@ -1,102 +0,0 @@
1
- import {
2
- accountConnectionSchema
3
- } from "./chunk-IELNFM3V.js";
4
-
5
- // src/telegram.ts
6
- import * as z from "zod";
7
- var telegramSignInMethodsSchema = z.object({
8
- /** Telegram Login, the OpenID Connect sign-in Domino configures for the platform. */
9
- login: z.boolean(),
10
- /** Mini App sign-in, which the project enables in Console with its bot's ID. */
11
- miniApp: z.boolean()
12
- });
13
- var telegramAccountConnectionSchema = accountConnectionSchema.extend({
14
- provider: z.literal("telegram")
15
- });
16
- var telegramInitDataSchema = z.string().min(1, "Pass the Mini App's Telegram.WebApp.initData").max(8192);
17
- var telegramMiniAppSignInSchema = z.object({
18
- initData: telegramInitDataSchema,
19
- mode: z.enum(["sign-in", "connect"])
20
- }).strict();
21
- var telegramChatIdSchema = z.string().regex(
22
- /^-?[1-9][0-9]{0,19}$/,
23
- "Use the chat's numeric ID, such as -1001234567890"
24
- );
25
- var telegramChatSchema = z.object({
26
- /** The numeric chat ID, as a string. */
27
- id: telegramChatIdSchema,
28
- /** `group`, `supergroup` or `channel`; a later Telegram may add others. */
29
- type: z.string(),
30
- title: z.string(),
31
- /** The public @username, without the @, or null for a private chat. */
32
- username: z.string().nullable(),
33
- status: z.string(),
34
- issue: z.string().nullable(),
35
- connectedAt: z.number()
36
- });
37
- var telegramChatsSchema = z.object({
38
- configured: z.boolean(),
39
- /** Domino's bot, the one operators add to their chats. */
40
- bot: z.object({ username: z.string() }).nullable(),
41
- chats: z.array(telegramChatSchema)
42
- });
43
- var telegramChatConnectionSchema = z.object({
44
- url: z.string(),
45
- expiresAt: z.number()
46
- });
47
- var telegramMemberInputSchema = z.object({
48
- chat: z.string().regex(
49
- /^(-?[1-9][0-9]{0,19}|@[A-Za-z][A-Za-z0-9_]{3,31})$/,
50
- "Name a chat the project connected, by its numeric ID or @username"
51
- )
52
- }).strict();
53
- var telegramChatMemberSchema = z.object({
54
- /** The numeric Telegram user ID. */
55
- userId: z.string(),
56
- username: z.string().nullable(),
57
- status: z.custom(
58
- (value) => typeof value === "string"
59
- ),
60
- /** Whether they are in the chat now: a creator, administrator, member, or restricted member. */
61
- isMember: z.boolean(),
62
- /** Whether they are its creator or an administrator. */
63
- isAdmin: z.boolean(),
64
- /** When a paid subscription or a restriction ends, epoch milliseconds; null when it does not. */
65
- untilDate: z.number().nullable()
66
- });
67
- var telegramReactionsNamespace = "telegram-reactions";
68
- var telegramReactionDataSchema = z.object({
69
- /** The chat's numeric ID, as a string. */
70
- chatId: z.string(),
71
- /** `group` or `supergroup`: channel reactions are anonymous and never recorded. */
72
- chatType: z.string(),
73
- messageId: z.number(),
74
- /** `emoji`, `custom_emoji` or `paid`. */
75
- reactionType: z.string(),
76
- /** The emoji, such as "❤", for an `emoji` reaction; null otherwise. */
77
- emoji: z.string().nullable(),
78
- /** The custom emoji's ID for a `custom_emoji` reaction; null otherwise. */
79
- customEmojiId: z.string().nullable(),
80
- /**
81
- * `creator` or `administrator` for one of the chat's administrators, read at most ten minutes
82
- * before Relay recorded the reaction; `member` for anyone else.
83
- */
84
- reactorStatus: z.string(),
85
- /** Whether the reactor was the chat's creator or an administrator then. */
86
- reactorIsAdmin: z.boolean()
87
- });
88
-
89
- export {
90
- telegramSignInMethodsSchema,
91
- telegramAccountConnectionSchema,
92
- telegramInitDataSchema,
93
- telegramMiniAppSignInSchema,
94
- telegramChatIdSchema,
95
- telegramChatSchema,
96
- telegramChatsSchema,
97
- telegramChatConnectionSchema,
98
- telegramMemberInputSchema,
99
- telegramChatMemberSchema,
100
- telegramReactionsNamespace,
101
- telegramReactionDataSchema
102
- };