@domino-sdk/relay 1.53.1 → 1.55.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.
- package/CHANGELOG.md +1848 -0
- package/dist/analytics-URV-mxjH.d.ts +482 -0
- package/dist/{attempt-captures-QC4kTA44.d.ts → attempt-captures-CxxO7DeD.d.ts} +1 -1
- package/dist/authoring.d.ts +233 -78
- package/dist/authoring.js +112 -14
- package/dist/{automatic-outcomes-CVyZHxir.d.ts → automatic-outcomes-DxW_v5Wc.d.ts} +5 -2
- package/dist/avatar.d.ts +1 -1
- package/dist/browser.d.ts +8 -7
- package/dist/browser.js +14 -10
- package/dist/{capability-error-FQGGb5xS.d.ts → capability-error-DSd8EMQC.d.ts} +76 -2
- package/dist/{chunk-53JMTUWG.js → chunk-56DBFNR2.js} +1 -1
- package/dist/chunk-C7QZ4UBB.js +937 -0
- package/dist/chunk-F6HECAXA.js +661 -0
- package/dist/{chunk-VKHSC5MD.js → chunk-GL43VQ5D.js} +16 -16
- package/dist/{chunk-GTQJSDBS.js → chunk-IUF7DW76.js} +27 -16
- package/dist/{chunk-YBR4BUFK.js → chunk-IZRITLVV.js} +2 -2
- package/dist/chunk-KDR2VAJP.js +34 -0
- package/dist/{chunk-S2PMKZSX.js → chunk-SABMNPF2.js} +21 -2
- package/dist/{chunk-XFAYQFRO.js → chunk-TLK2MD4S.js} +1 -1
- package/dist/{chunk-ZJ3FVZRP.js → chunk-UY6KMLQG.js} +10 -3
- package/dist/{chunk-JYJAS4E3.js → chunk-VFBQVY4X.js} +1 -1
- package/dist/{chunk-YVC3B72P.js → chunk-WHG5WE43.js} +1 -1
- package/dist/chunk-WHMXXHPX.js +344 -0
- package/dist/{chunk-MP2ZF5U6.js → chunk-WUEQOKJH.js} +4 -4
- package/dist/{chunk-7BNCLWAO.js → chunk-XALIFNMD.js} +1 -1
- package/dist/{chunk-IELNFM3V.js → chunk-YCOKTQ4E.js} +96 -7
- package/dist/{chunk-LPHXTZDA.js → chunk-YE3XYB2F.js} +2 -2
- package/dist/{chunk-K6TVMNU4.js → chunk-YEVD4A5X.js} +1 -1
- package/dist/{client-CzNtl8UO.d.ts → client-C4zUZKpj.d.ts} +35 -7
- package/dist/{deployments-ovtqtAcx.d.ts → deployments-B32QS1CI.d.ts} +1060 -233
- package/dist/{groups-B5R1RCsl.d.ts → groups-O6onGPmC.d.ts} +131 -137
- package/dist/host-environment-FN4zg3hw.d.ts +30 -0
- package/dist/index.d.ts +8 -8
- package/dist/index.js +9 -9
- package/dist/integrations-C6_uUh-s.d.ts +584 -0
- package/dist/internal.d.ts +12 -10
- package/dist/internal.js +14 -8
- package/dist/{offers-CH1RZekg.d.ts → offers-BMDNcvwB.d.ts} +2 -2
- package/dist/{pages-BTlOg8sl.d.ts → pages-BFloMpyQ.d.ts} +25 -1
- package/dist/portal-proxy.d.ts +11 -1
- package/dist/portal-proxy.js +26 -5
- package/dist/{profiles-Cdv4BSd_.d.ts → profiles-BoOK03cR.d.ts} +2 -0
- package/dist/react/index.d.ts +488 -13
- package/dist/react/index.js +51 -15
- package/dist/runtime/authoring.js +1 -1
- package/dist/runtime/chunks/WKATKZXE.js +1 -0
- package/dist/runtime/manifest.json +3 -3
- package/dist/runtime/schema.js +1 -1
- package/dist/{schema-BJ9bOgpN.d.ts → schema-C4m9RhCR.d.ts} +166 -6
- package/dist/schema.d.ts +392 -334
- package/dist/schema.js +84 -40
- package/dist/server/index.d.ts +11 -10
- package/dist/server/index.js +1604 -838
- package/dist/{submission-input-BNah53go.d.ts → submission-input-BbdawqVy.d.ts} +2 -2
- package/dist/{telegram-browser-C36j_6v-.d.ts → telegram-browser-CwaxROAZ.d.ts} +1 -1
- package/dist/testing.d.ts +85 -12
- package/dist/testing.js +322 -37
- package/dist/{transport-DuB_fiA2.d.ts → transport-CZJOW5Sr.d.ts} +8018 -3150
- package/dist/vite.d.ts +54 -1
- package/dist/vite.js +35 -0
- package/dist/{x-BfQcsDp0.d.ts → x-1czZFVUW.d.ts} +1 -1
- package/package.json +3 -2
- package/dist/chunk-2NUD237O.js +0 -102
- package/dist/chunk-CCE2JWES.js +0 -1083
- package/dist/integrations-CllF-kWg.d.ts +0 -314
- 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
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domino-sdk/relay",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.55.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": {
|
package/dist/chunk-2NUD237O.js
DELETED
|
@@ -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
|
-
};
|