@prajwalshete/telegram-plugin 0.0.0-stage → 0.1.1
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 +91 -0
- package/LICENSE +21 -0
- package/README.md +109 -2
- package/dist/adapters/clock.d.ts +3 -0
- package/dist/adapters/clock.js +4 -0
- package/dist/adapters/console-log.d.ts +13 -0
- package/dist/adapters/console-log.js +41 -0
- package/dist/adapters/d1-db.d.ts +5 -0
- package/dist/adapters/d1-db.js +37 -0
- package/dist/adapters/ids.d.ts +5 -0
- package/dist/adapters/ids.js +25 -0
- package/dist/adapters/index.d.ts +7 -0
- package/dist/adapters/keyring.d.ts +50 -0
- package/dist/adapters/keyring.js +174 -0
- package/dist/adapters/metrics.d.ts +28 -0
- package/dist/adapters/metrics.js +48 -0
- package/dist/adapters/r2-files.d.ts +20 -0
- package/dist/adapters/r2-files.js +53 -0
- package/dist/bin/cli.d.ts +1 -0
- package/dist/bin/cli.js +45 -0
- package/dist/client/broadcasts.d.ts +35 -0
- package/dist/client/commands.d.ts +23 -0
- package/dist/client/endpoint.d.ts +34 -0
- package/dist/client/events.d.ts +33 -0
- package/dist/client/index.d.ts +11 -0
- package/dist/client/index.js +3 -0
- package/dist/client/schedules.d.ts +42 -0
- package/dist/client/schema.d.ts +181 -0
- package/dist/client/send.d.ts +15 -0
- package/dist/client/templates.d.ts +47 -0
- package/dist/contracts/bots.d.ts +129 -0
- package/dist/contracts/bots.js +70 -0
- package/dist/contracts/broadcasts.d.ts +116 -0
- package/dist/contracts/broadcasts.js +63 -0
- package/dist/contracts/chats.d.ts +97 -0
- package/dist/contracts/chats.js +66 -0
- package/dist/contracts/commands.d.ts +52 -0
- package/dist/contracts/commands.js +53 -0
- package/dist/contracts/common.d.ts +38 -0
- package/dist/contracts/common.js +41 -0
- package/dist/contracts/deliveries.d.ts +103 -0
- package/dist/contracts/deliveries.js +74 -0
- package/dist/contracts/destinations.d.ts +24 -0
- package/dist/contracts/destinations.js +28 -0
- package/dist/contracts/events.d.ts +165 -0
- package/dist/contracts/events.js +98 -0
- package/dist/contracts/features.d.ts +20 -0
- package/dist/contracts/features.js +21 -0
- package/dist/contracts/health.d.ts +55 -0
- package/dist/contracts/health.js +58 -0
- package/dist/contracts/index.d.ts +22 -0
- package/dist/contracts/index.js +22 -0
- package/dist/contracts/labels.d.ts +38 -0
- package/dist/contracts/labels.js +52 -0
- package/dist/contracts/links.d.ts +51 -0
- package/dist/contracts/links.js +50 -0
- package/dist/contracts/meta.d.ts +132 -0
- package/dist/contracts/meta.js +85 -0
- package/dist/contracts/permissions.d.ts +24 -0
- package/dist/contracts/permissions.js +27 -0
- package/dist/contracts/problems.d.ts +106 -0
- package/dist/contracts/problems.js +101 -0
- package/dist/contracts/recipients.d.ts +36 -0
- package/dist/contracts/recipients.js +22 -0
- package/dist/contracts/schedules.d.ts +276 -0
- package/dist/contracts/schedules.js +143 -0
- package/dist/contracts/send.d.ts +126 -0
- package/dist/contracts/send.js +69 -0
- package/dist/contracts/subscriptions.d.ts +38 -0
- package/dist/contracts/subscriptions.js +31 -0
- package/dist/contracts/templates.d.ts +358 -0
- package/dist/contracts/templates.js +174 -0
- package/dist/contracts/users.d.ts +15 -0
- package/dist/contracts/users.js +19 -0
- package/dist/core/guards.d.ts +22 -0
- package/dist/core/guards.js +47 -0
- package/dist/core/html/escape.d.ts +2 -0
- package/dist/core/html/escape.js +36 -0
- package/dist/core/html/tokenize.js +65 -0
- package/dist/core/index.d.ts +18 -0
- package/dist/core/pacing.d.ts +1 -0
- package/dist/core/pacing.js +86 -0
- package/dist/core/random.d.ts +2 -0
- package/dist/core/random.js +38 -0
- package/dist/core/recipients.d.ts +1 -0
- package/dist/core/recipients.js +86 -0
- package/dist/core/schedule/describe.d.ts +3 -0
- package/dist/core/schedule/describe.js +74 -0
- package/dist/core/schedule/index.d.ts +4 -0
- package/dist/core/schedule/policy.d.ts +1 -0
- package/dist/core/schedule/policy.js +37 -0
- package/dist/core/schedule/rule.d.ts +25 -0
- package/dist/core/schedule/rule.js +142 -0
- package/dist/core/schedule/tz.d.ts +2 -0
- package/dist/core/schedule/tz.js +59 -0
- package/dist/core/split/plain.d.ts +2 -0
- package/dist/core/split/plain.js +23 -0
- package/dist/core/split/split.d.ts +15 -0
- package/dist/core/split/split.js +158 -0
- package/dist/core/template/ast.d.ts +58 -0
- package/dist/core/template/ast.js +5 -0
- package/dist/core/template/expr.js +108 -0
- package/dist/core/template/filters.d.ts +20 -0
- package/dist/core/template/filters.js +127 -0
- package/dist/core/template/format.d.ts +17 -0
- package/dist/core/template/format.js +88 -0
- package/dist/core/template/index.d.ts +20 -0
- package/dist/core/template/index.js +29 -0
- package/dist/core/template/parse.d.ts +8 -0
- package/dist/core/template/parse.js +369 -0
- package/dist/core/template/render.d.ts +17 -0
- package/dist/core/template/render.js +118 -0
- package/dist/core/template/shape.d.ts +28 -0
- package/dist/core/template/shape.js +151 -0
- package/dist/core/template/tags.js +105 -0
- package/dist/core/template/validate.d.ts +10 -0
- package/dist/core/template/validate.js +144 -0
- package/dist/core/template/variables.d.ts +15 -0
- package/dist/core/template/variables.js +41 -0
- package/dist/do/index.d.ts +3 -0
- package/dist/do/index.js +3 -0
- package/dist/do/telegram-bot-do.d.ts +45 -0
- package/dist/do/telegram-bot-do.js +219 -0
- package/dist/engine/actions/callback.js +256 -0
- package/dist/engine/actions/tokens.d.ts +2 -0
- package/dist/engine/actions/tokens.js +51 -0
- package/dist/engine/bot-api.js +20 -0
- package/dist/engine/bot-features.js +39 -0
- package/dist/engine/chat-state.js +66 -0
- package/dist/engine/content/audience.js +54 -0
- package/dist/engine/content/buttons.d.ts +1 -0
- package/dist/engine/content/buttons.js +113 -0
- package/dist/engine/content/fanout.js +284 -0
- package/dist/engine/content/intersect.d.ts +6 -0
- package/dist/engine/content/intersect.js +26 -0
- package/dist/engine/content/providers.d.ts +6 -0
- package/dist/engine/content/providers.js +142 -0
- package/dist/engine/content/recipients.js +128 -0
- package/dist/engine/content/render.js +138 -0
- package/dist/engine/content/reply.js +156 -0
- package/dist/engine/content/report-files.js +78 -0
- package/dist/engine/content/template-rows.js +74 -0
- package/dist/engine/dialogs/dialog.d.ts +2 -0
- package/dist/engine/dialogs/dialog.js +375 -0
- package/dist/engine/dispatch/builtins.js +198 -0
- package/dist/engine/dispatch/commands.js +194 -0
- package/dist/engine/dispatch/context.d.ts +2 -0
- package/dist/engine/dispatch/context.js +194 -0
- package/dist/engine/dispatch/dispatcher.js +66 -0
- package/dist/engine/dispatch/handlers.d.ts +1 -0
- package/dist/engine/dispatch/handlers.js +103 -0
- package/dist/engine/dispatch/lifecycle.js +85 -0
- package/dist/engine/dispatch/link-chat.js +31 -0
- package/dist/engine/dispatch/linking.js +273 -0
- package/dist/engine/errors.d.ts +60 -0
- package/dist/engine/errors.js +72 -0
- package/dist/engine/events/filters.d.ts +5 -0
- package/dist/engine/events/filters.js +82 -0
- package/dist/engine/events/kick.js +30 -0
- package/dist/engine/events/payload.d.ts +3 -0
- package/dist/engine/events/payload.js +16 -0
- package/dist/engine/events/tick.js +208 -0
- package/dist/engine/i18n.d.ts +12 -0
- package/dist/engine/i18n.js +55 -0
- package/dist/engine/inbound/files.js +121 -0
- package/dist/engine/inbound/handler.js +46 -0
- package/dist/engine/jobs.d.ts +32 -0
- package/dist/engine/jobs.js +85 -0
- package/dist/engine/link-codes.js +46 -0
- package/dist/engine/metrics.js +12 -0
- package/dist/engine/options.d.ts +369 -0
- package/dist/engine/options.js +81 -0
- package/dist/engine/outbox/dead-letter.js +78 -0
- package/dist/engine/outbox/do-registry.d.ts +10 -0
- package/dist/engine/outbox/do-registry.js +10 -0
- package/dist/engine/outbox/do-transport.d.ts +33 -0
- package/dist/engine/outbox/do-transport.js +73 -0
- package/dist/engine/outbox/drain.d.ts +13 -0
- package/dist/engine/outbox/drain.js +381 -0
- package/dist/engine/outbox/enqueue.d.ts +1 -0
- package/dist/engine/outbox/enqueue.js +63 -0
- package/dist/engine/outbox/select.js +24 -0
- package/dist/engine/outbox/send.js +362 -0
- package/dist/engine/outbox/transport.d.ts +35 -0
- package/dist/engine/outbox/transport.js +175 -0
- package/dist/engine/outbox/wake.js +28 -0
- package/dist/engine/registry.d.ts +502 -0
- package/dist/engine/registry.js +258 -0
- package/dist/engine/rows.d.ts +25 -0
- package/dist/engine/rows.js +131 -0
- package/dist/engine/runtime.d.ts +95 -0
- package/dist/engine/runtime.js +149 -0
- package/dist/engine/schedules/fire.js +208 -0
- package/dist/engine/schedules/resume.js +75 -0
- package/dist/engine/schedules/rows.js +69 -0
- package/dist/engine/schedules/tick.js +30 -0
- package/dist/engine/schedules/wake.js +50 -0
- package/dist/engine/state.d.ts +11 -0
- package/dist/engine/state.js +78 -0
- package/dist/locales/en.js +339 -0
- package/dist/locales/en.json +341 -0
- package/dist/locales/mr.js +339 -0
- package/dist/locales/mr.json +341 -0
- package/dist/ports/db.d.ts +22 -0
- package/dist/ports/index.d.ts +4 -0
- package/dist/ports/ports.d.ts +257 -0
- package/dist/ports/sql.d.ts +39 -0
- package/dist/ports/sql.js +76 -0
- package/dist/renderers/csv.d.ts +14 -0
- package/dist/renderers/csv.js +51 -0
- package/dist/renderers/html.d.ts +44 -0
- package/dist/renderers/html.js +81 -0
- package/dist/renderers/index.d.ts +5 -0
- package/dist/renderers/index.js +4 -0
- package/dist/renderers/table.d.ts +30 -0
- package/dist/renderers/table.js +114 -0
- package/dist/routes/admin.js +146 -0
- package/dist/routes/app.d.ts +3111 -0
- package/dist/routes/app.js +9 -0
- package/dist/routes/broadcasts.js +37 -0
- package/dist/routes/commands.js +35 -0
- package/dist/routes/content.js +12 -0
- package/dist/routes/events.js +36 -0
- package/dist/routes/http.d.ts +30 -0
- package/dist/routes/http.js +223 -0
- package/dist/routes/me.js +59 -0
- package/dist/routes/schedules.js +62 -0
- package/dist/routes/send.js +24 -0
- package/dist/routes/templates.js +70 -0
- package/dist/routes/webhook.js +147 -0
- package/dist/schema/columns.js +307 -0
- package/dist/schema/ddl.d.ts +7 -0
- package/dist/schema/ddl.js +45 -0
- package/dist/schema/index.d.ts +4255 -0
- package/dist/schema/index.js +44 -0
- package/dist/schema/reference.sql +359 -0
- package/dist/schema/tables.d.ts +4243 -0
- package/dist/schema/tables.js +327 -0
- package/dist/schema/version.d.ts +5 -0
- package/dist/schema/version.js +7 -0
- package/dist/server/index.d.ts +55 -0
- package/dist/server/index.js +46 -0
- package/dist/server/plugin.d.ts +81 -0
- package/dist/server/plugin.js +247 -0
- package/dist/server/version.d.ts +2 -0
- package/dist/server/version.js +4 -0
- package/dist/services/ai-tool.d.ts +26 -0
- package/dist/services/ai-tool.js +148 -0
- package/dist/services/bots.js +300 -0
- package/dist/services/broadcasts.js +390 -0
- package/dist/services/chats.js +83 -0
- package/dist/services/cleanup.js +83 -0
- package/dist/services/commands.js +140 -0
- package/dist/services/deliveries.js +53 -0
- package/dist/services/destinations.js +91 -0
- package/dist/services/event-rules.js +229 -0
- package/dist/services/events.js +20 -0
- package/dist/services/idempotency.js +64 -0
- package/dist/services/links.js +200 -0
- package/dist/services/menu.js +95 -0
- package/dist/services/ops.js +90 -0
- package/dist/services/rekey.js +63 -0
- package/dist/services/reports.js +87 -0
- package/dist/services/schedules.js +214 -0
- package/dist/services/send.d.ts +14 -0
- package/dist/services/send.js +421 -0
- package/dist/services/subscriptions.js +28 -0
- package/dist/services/templates.js +259 -0
- package/dist/telegram/classify.d.ts +30 -0
- package/dist/telegram/classify.js +164 -0
- package/dist/telegram/client.d.ts +73 -0
- package/dist/telegram/client.js +135 -0
- package/dist/telegram/errors.d.ts +37 -0
- package/dist/telegram/errors.js +62 -0
- package/dist/telegram/inbound.d.ts +40 -0
- package/dist/telegram/inbound.js +72 -0
- package/dist/telegram/index.d.ts +8 -0
- package/dist/telegram/multipart.d.ts +5 -0
- package/dist/telegram/multipart.js +47 -0
- package/dist/telegram/types.d.ts +271 -0
- package/dist/telegram/update.d.ts +833 -0
- package/dist/telegram/update.js +129 -0
- package/dist/testing/fake-html.d.ts +9 -0
- package/dist/testing/fake-html.js +83 -0
- package/dist/testing/fake-telegram.d.ts +206 -0
- package/dist/testing/fake-telegram.js +856 -0
- package/dist/testing/index.d.ts +7 -0
- package/dist/testing/index.js +7 -0
- package/dist/testing/reference-sql.d.ts +4 -0
- package/dist/testing/reference-sql.js +8 -0
- package/dist/testing/test-plugin.d.ts +126 -0
- package/dist/testing/test-plugin.js +182 -0
- package/dist/testing/updates.d.ts +100 -0
- package/dist/testing/updates.js +212 -0
- package/package.json +113 -3
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
import { BotDto } from "../contracts/bots.js";
|
|
2
|
+
import { Audience, ChatDto, ChatKind } from "../contracts/chats.js";
|
|
3
|
+
import { LocalizedText } from "../contracts/common.js";
|
|
4
|
+
import { ButtonRows } from "../contracts/templates.js";
|
|
5
|
+
import { SqlFragment } from "../ports/sql.js";
|
|
6
|
+
import { DbPort } from "../ports/db.js";
|
|
7
|
+
import { OpenedFile, StoredFile } from "../ports/ports.js";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
10
|
+
/** What a provider's `run` receives. */
|
|
11
|
+
export interface ProviderContext<A, P, E = unknown> {
|
|
12
|
+
/** The audience actor (linked user, or the group's audience role). Read data only as this actor. */
|
|
13
|
+
actor: A;
|
|
14
|
+
/** Parameters, already parsed with the provider's `params` schema. */
|
|
15
|
+
params: P;
|
|
16
|
+
/** Epoch ms UTC of this run (the plugin clock). */
|
|
17
|
+
now: number;
|
|
18
|
+
/** IANA time zone of the run (schedule / bot zone). */
|
|
19
|
+
tz: string;
|
|
20
|
+
/** Locale of the recipient chat (`en`, `mr`, …). */
|
|
21
|
+
locale: string;
|
|
22
|
+
/** The plugin's database port, for the host's own read queries. */
|
|
23
|
+
db: DbPort;
|
|
24
|
+
/** The Worker env of this invocation (the value the plugin's `env` mapper received), for per-request bindings. */
|
|
25
|
+
env: E;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A host data provider (`defineProvider`): data for templates, reports and commands. The plugin runs it as each
|
|
29
|
+
* audience actor and keeps only the keys declared in `variables`.
|
|
30
|
+
*/
|
|
31
|
+
export interface ProviderDef<P = unknown, V = unknown, A = unknown, E = unknown> {
|
|
32
|
+
/** Unique provider key (`[a-z0-9._:-]`, ≤ 64), referenced by templates and events. */
|
|
33
|
+
readonly key: string;
|
|
34
|
+
/** Name shown in admin pickers. */
|
|
35
|
+
readonly label: LocalizedText;
|
|
36
|
+
/** Zod schema of the provider params; `undefined` = no params. */
|
|
37
|
+
readonly params: z.ZodType<P> | undefined;
|
|
38
|
+
/** Host data permission the audience must have. */
|
|
39
|
+
readonly permission: string | null;
|
|
40
|
+
/** Zod schema of the returned data; drives template validation and the variable picker. */
|
|
41
|
+
readonly variables: z.ZodType<V>;
|
|
42
|
+
/**
|
|
43
|
+
* Fan-out reuse of one result within a run: `"none"` = per audience, `"audience-role"` = per audience role,
|
|
44
|
+
* `"params"` = one result for everyone with the same params, locale and zone.
|
|
45
|
+
*/
|
|
46
|
+
readonly cacheFor: "none" | "audience-role" | "params";
|
|
47
|
+
/** Sample data for previews and template validation. */
|
|
48
|
+
sample?(): V;
|
|
49
|
+
/** Loads the data as `ctx.actor` (apply host redaction). Bounded by `limits.providerTimeoutMs`. */
|
|
50
|
+
run(ctx: ProviderContext<A, P, E>): Promise<V>;
|
|
51
|
+
}
|
|
52
|
+
/** Input of `defineProvider`; see `ProviderDef` for the meaning of each field. */
|
|
53
|
+
export interface ProviderInput<P, V, A, E = unknown> {
|
|
54
|
+
/** Unique key, `[a-z0-9._:-]`, ≤ 64. */
|
|
55
|
+
key: string;
|
|
56
|
+
/** Name shown in admin pickers (at least one locale). */
|
|
57
|
+
label: LocalizedText;
|
|
58
|
+
/** Zod schema of the params. Default: no params. */
|
|
59
|
+
params?: z.ZodType<P>;
|
|
60
|
+
/** Host data permission the audience must have. Default: none. */
|
|
61
|
+
permission?: string;
|
|
62
|
+
/** Zod schema of the returned data. */
|
|
63
|
+
variables: z.ZodType<V>;
|
|
64
|
+
/** Sample data for previews. */
|
|
65
|
+
sample?: () => V;
|
|
66
|
+
/** Fan-out reuse (see `ProviderDef.cacheFor`). Default `"none"`. */
|
|
67
|
+
cacheFor?: "none" | "audience-role" | "params";
|
|
68
|
+
/** Loads the data as `ctx.actor`. */
|
|
69
|
+
run(ctx: ProviderContext<A, P, E>): Promise<V>;
|
|
70
|
+
}
|
|
71
|
+
/** Options of a `ReplyApi` call. */
|
|
72
|
+
export interface ReplyOptions {
|
|
73
|
+
/** Inline keyboard rows (template button spec). */
|
|
74
|
+
buttons?: ButtonRows;
|
|
75
|
+
/** Send without notification sound (`disable_notification`). Default false. */
|
|
76
|
+
silent?: boolean;
|
|
77
|
+
/** Forbid forwarding and saving (`protect_content`). Default false. */
|
|
78
|
+
protectContent?: boolean;
|
|
79
|
+
/** Send as plain text (no HTML parse mode). */
|
|
80
|
+
plain?: boolean;
|
|
81
|
+
}
|
|
82
|
+
/** How a handler answers. Every reply goes through the outbox (pacing + retries). */
|
|
83
|
+
export interface ReplyApi {
|
|
84
|
+
/** Telegram HTML (escape dynamic values with `escapeHtml`). Long text is split into parts. */
|
|
85
|
+
text(html: string, opts?: ReplyOptions): Promise<void>;
|
|
86
|
+
/** Render a template as the chat's audience (Phase 3). */
|
|
87
|
+
template(key: string, params?: Record<string, unknown>, opts?: ReplyOptions): Promise<void>;
|
|
88
|
+
/** Send a stored file (host file ref through a file source or the files port). */
|
|
89
|
+
file(file: {
|
|
90
|
+
source?: string;
|
|
91
|
+
ref: string;
|
|
92
|
+
caption?: string;
|
|
93
|
+
}, opts?: ReplyOptions): Promise<void>;
|
|
94
|
+
}
|
|
95
|
+
/** What a command's `handle` receives. */
|
|
96
|
+
export interface CommandContext<A, Args, E = unknown> {
|
|
97
|
+
/** Live actor of the chat (linked user, or the group audience); null in unlinked chats. */
|
|
98
|
+
actor: A | null;
|
|
99
|
+
/** The chat the command came from; null when it is not stored yet. */
|
|
100
|
+
chat: ChatDto | null;
|
|
101
|
+
/** The bot that received the command. */
|
|
102
|
+
bot: BotDto;
|
|
103
|
+
/** Arguments parsed with `parseArgs` (or the default splitter) and validated with `args`. */
|
|
104
|
+
args: Args;
|
|
105
|
+
/** Raw text after the command name (and `@bot`), trimmed. */
|
|
106
|
+
argsText: string;
|
|
107
|
+
/** Locale of the chat. */
|
|
108
|
+
locale: string;
|
|
109
|
+
/** Translates a plugin or host i18n key for `locale`. */
|
|
110
|
+
t(key: string, vars?: Record<string, unknown>): string;
|
|
111
|
+
/** Replies in this chat through the outbox. */
|
|
112
|
+
reply: ReplyApi;
|
|
113
|
+
/** Start a registered dialog in this chat (Phase 4). */
|
|
114
|
+
startDialog(key: string, state?: Record<string, unknown>): Promise<void>;
|
|
115
|
+
/** The plugin's database port for this invocation (read host data as `actor`). */
|
|
116
|
+
db: DbPort;
|
|
117
|
+
/** Epoch ms of this update (the plugin clock). */
|
|
118
|
+
now: number;
|
|
119
|
+
/** The Worker env of this invocation (the value the plugin's `env` mapper received), for per-request bindings. */
|
|
120
|
+
env: E;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* A host bot command (`defineCommand`). Checked on every call: enabled → chat scope → linked audience → linked
|
|
124
|
+
* sender (groups, see `groupMembers`) → roles → host `permission` → Zod `args`. Admins can override roles, aliases, description, menu and sort per bot.
|
|
125
|
+
*/
|
|
126
|
+
export interface CommandDef<Args = unknown, A = unknown, E = unknown> {
|
|
127
|
+
/** Command name without the slash (`[a-z0-9_]{1,32}`, not a reserved name). */
|
|
128
|
+
readonly command: string;
|
|
129
|
+
/** Menu / help description. */
|
|
130
|
+
readonly description: LocalizedText;
|
|
131
|
+
/** Host permission the chat's actor must have; null = none. */
|
|
132
|
+
readonly permission: string | null;
|
|
133
|
+
/**
|
|
134
|
+
* Roles allowed by default: `["*"]` = any role (the default), `[]` = no role (nobody may run it until an admin
|
|
135
|
+
* sets roles per bot), otherwise the listed roles. Overridable per bot (`tg_command.roles_json`, same meaning;
|
|
136
|
+
* null = this default).
|
|
137
|
+
*/
|
|
138
|
+
readonly defaultRoles: readonly string[];
|
|
139
|
+
/**
|
|
140
|
+
* Who may run it in a linked group: `"linked"` = only members who linked their own Telegram on this bot,
|
|
141
|
+
* `"any"` = every member (as the group's audience). Undefined = `groups.requireLinkedSender` (default "linked").
|
|
142
|
+
* The role and permission checks always run against the group's audience.
|
|
143
|
+
*/
|
|
144
|
+
readonly groupMembers: "linked" | "any" | undefined;
|
|
145
|
+
/** Zod schema of the arguments; `undefined` = `{ text }` or `{}`. */
|
|
146
|
+
readonly args: z.ZodType<Args> | undefined;
|
|
147
|
+
/** Chat kinds where it works (`group` always implies `supergroup`). */
|
|
148
|
+
readonly scope: readonly ChatKind[];
|
|
149
|
+
/** Template rendered as the reply (args become its params); null when `handle` is used. */
|
|
150
|
+
readonly template: string | null;
|
|
151
|
+
/** Extra names that run the same command. */
|
|
152
|
+
readonly aliases: readonly string[];
|
|
153
|
+
/** Listed in the bot's command menu by default. */
|
|
154
|
+
readonly showInMenu: boolean;
|
|
155
|
+
/** Menu order (ascending, then by name). */
|
|
156
|
+
readonly sort: number;
|
|
157
|
+
/**
|
|
158
|
+
* Turns the raw argument text into the input of `args`. Default: one whitespace token per object key, the last
|
|
159
|
+
* key takes the rest.
|
|
160
|
+
*/
|
|
161
|
+
parseArgs?(text: string): unknown;
|
|
162
|
+
/** Code handler; absent when `template` is used. */
|
|
163
|
+
handle?(ctx: CommandContext<A, Args, E>): Promise<void>;
|
|
164
|
+
}
|
|
165
|
+
/** Input of `defineCommand`: give exactly one of `template` or `handle`. Throws `TelegramConfigError` if invalid. */
|
|
166
|
+
export interface CommandInput<Args, A, E = unknown> {
|
|
167
|
+
/** Name without the slash, `[a-z0-9_]{1,32}`, not in `RESERVED_COMMANDS`. */
|
|
168
|
+
command: string;
|
|
169
|
+
/** Menu / help description. */
|
|
170
|
+
description: LocalizedText;
|
|
171
|
+
/** Host permission checked on every call. Default: none. */
|
|
172
|
+
permission?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Roles allowed by default. Default `["*"]` (any role). `[]` = no role may run it (until an admin sets roles per
|
|
175
|
+
* bot); otherwise only the listed roles.
|
|
176
|
+
*/
|
|
177
|
+
defaultRoles?: string[];
|
|
178
|
+
/**
|
|
179
|
+
* In groups: `"linked"` = only members who linked their own Telegram, `"any"` = every member of a linked group
|
|
180
|
+
* runs it as the group's audience. Default: `groups.requireLinkedSender` (default "linked").
|
|
181
|
+
*/
|
|
182
|
+
groupMembers?: "linked" | "any";
|
|
183
|
+
/** Zod schema of the arguments. */
|
|
184
|
+
args?: z.ZodType<Args>;
|
|
185
|
+
/** Custom argument parser (see `CommandDef.parseArgs`). */
|
|
186
|
+
parseArgs?: (text: string) => unknown;
|
|
187
|
+
/** Chat kinds where it works. `group` also covers supergroups. Default private + groups. */
|
|
188
|
+
scope?: ChatKind[];
|
|
189
|
+
/** Template key to render as the reply. */
|
|
190
|
+
template?: string;
|
|
191
|
+
/** Code handler. */
|
|
192
|
+
handle?(ctx: CommandContext<A, Args, E>): Promise<void>;
|
|
193
|
+
/** Extra names. Default `[]`. */
|
|
194
|
+
aliases?: string[];
|
|
195
|
+
/** Listed in the command menu. Default true. */
|
|
196
|
+
showInMenu?: boolean;
|
|
197
|
+
/** Menu order. Default 0. */
|
|
198
|
+
sort?: number;
|
|
199
|
+
}
|
|
200
|
+
/** `defaultRoles` / per-bot roles entry meaning "any role". */
|
|
201
|
+
export declare const ANY_ROLE = "*";
|
|
202
|
+
/** Names the plugin answers itself; host commands may not reuse them. */
|
|
203
|
+
export declare const RESERVED_COMMANDS: readonly string[];
|
|
204
|
+
/** A host event (`defineEvent`) the host emits with `plugin.emit()`; event rules route it to destinations. */
|
|
205
|
+
export interface EventDef<P = unknown> {
|
|
206
|
+
/** Unique event key (`[a-z0-9._:-]`, ≤ 64). */
|
|
207
|
+
readonly key: string;
|
|
208
|
+
/** Name shown in admin pickers. */
|
|
209
|
+
readonly label: LocalizedText;
|
|
210
|
+
/** Zod schema of the payload, validated on emit. */
|
|
211
|
+
readonly payload: z.ZodType<P>;
|
|
212
|
+
/** Provider that re-reads data as each recipient's audience. */
|
|
213
|
+
readonly provider: string | null;
|
|
214
|
+
/** Payload fields admins may filter on in event rules. */
|
|
215
|
+
readonly filterable: readonly string[];
|
|
216
|
+
/** Removed for audiences without `sensitivePermission`. */
|
|
217
|
+
readonly sensitive: readonly string[];
|
|
218
|
+
/** Permission that may see `sensitive` fields; null = they are stripped for everyone. */
|
|
219
|
+
readonly sensitivePermission: string | null;
|
|
220
|
+
}
|
|
221
|
+
/** Input of `defineEvent`. Fields in `filterable` / `sensitive` must exist in an object `payload`. */
|
|
222
|
+
export interface EventInput<P> {
|
|
223
|
+
/** Unique key, `[a-z0-9._:-]`, ≤ 64. */
|
|
224
|
+
key: string;
|
|
225
|
+
/** Name shown in admin pickers. */
|
|
226
|
+
label: LocalizedText;
|
|
227
|
+
/** Zod schema of the payload. */
|
|
228
|
+
payload: z.ZodType<P>;
|
|
229
|
+
/** Registered provider key to re-read data per audience. Default: none. */
|
|
230
|
+
provider?: string;
|
|
231
|
+
/** Fields admins may filter on. Default `[]`. */
|
|
232
|
+
filterable?: string[];
|
|
233
|
+
/** Fields removed for audiences without `sensitivePermission`. Default `[]`. */
|
|
234
|
+
sensitive?: string[];
|
|
235
|
+
/** Permission that may see `sensitive` fields. Default: none (always stripped). */
|
|
236
|
+
sensitivePermission?: string;
|
|
237
|
+
}
|
|
238
|
+
/** What an action's `run` receives (after the actor, permission and token expiry were re-checked). */
|
|
239
|
+
export interface ActionContext<A, P, E = unknown> {
|
|
240
|
+
/** Live actor of the user who tapped the button. */
|
|
241
|
+
actor: A;
|
|
242
|
+
/** Params stored in the action token, parsed with the action's `params` schema. */
|
|
243
|
+
params: P;
|
|
244
|
+
/** The chat of the tapped message. */
|
|
245
|
+
chat: ChatDto;
|
|
246
|
+
/** The bot that received the tap. */
|
|
247
|
+
bot: BotDto;
|
|
248
|
+
/** Locale of the chat. */
|
|
249
|
+
locale: string;
|
|
250
|
+
/** Epoch ms UTC of the tap. */
|
|
251
|
+
now: number;
|
|
252
|
+
/** The plugin's database port. */
|
|
253
|
+
db: DbPort;
|
|
254
|
+
/** The Worker env of this invocation (the value the plugin's `env` mapper received), for per-request bindings. */
|
|
255
|
+
env: E;
|
|
256
|
+
}
|
|
257
|
+
/** What an action returns: a reply (HTML) and/or SQL committed with the token update in one batch. */
|
|
258
|
+
export interface ActionResult {
|
|
259
|
+
/** Telegram HTML shown as the result. */
|
|
260
|
+
text?: string;
|
|
261
|
+
/** Host writes committed in the same `db.batch()` as the token update. */
|
|
262
|
+
sql?: SqlFragment[];
|
|
263
|
+
}
|
|
264
|
+
/** A callback-button action (`defineAction`); buttons carry an opaque `a:<token>` callback. */
|
|
265
|
+
export interface ActionDef<P = unknown, A = unknown, E = unknown> {
|
|
266
|
+
/** Unique action key (`[a-z0-9._:-]`, ≤ 64), referenced by template buttons. */
|
|
267
|
+
readonly key: string;
|
|
268
|
+
/** Host permission re-checked on every tap; null = none. */
|
|
269
|
+
readonly permission: string | null;
|
|
270
|
+
/** Zod schema of the button params. */
|
|
271
|
+
readonly params: z.ZodType<P>;
|
|
272
|
+
/** Question for a second confirming tap ({{param}} placeholders); null = runs on the first tap. */
|
|
273
|
+
readonly confirm: LocalizedText | null;
|
|
274
|
+
/** Callback answer after success; null = the plugin's generic "done". */
|
|
275
|
+
readonly result: LocalizedText | null;
|
|
276
|
+
/** The token is consumed after one successful run. */
|
|
277
|
+
readonly singleUse: boolean;
|
|
278
|
+
/** Token lifetime in minutes. */
|
|
279
|
+
readonly ttlMinutes: number;
|
|
280
|
+
/** Resolves to an `ActionResult`, or nothing. */
|
|
281
|
+
run(ctx: ActionContext<A, P, E>): Promise<unknown>;
|
|
282
|
+
}
|
|
283
|
+
/** Input of `defineAction`. Throws `TelegramConfigError` if invalid. */
|
|
284
|
+
export interface ActionInput<P, A, E = unknown> {
|
|
285
|
+
/** Unique key, `[a-z0-9._:-]`, ≤ 64. */
|
|
286
|
+
key: string;
|
|
287
|
+
/** Host permission re-checked on every tap. Default: none. */
|
|
288
|
+
permission?: string;
|
|
289
|
+
/** Zod schema of the button params. */
|
|
290
|
+
params: z.ZodType<P>;
|
|
291
|
+
/** Confirmation question (second tap). Default: none. */
|
|
292
|
+
confirm?: LocalizedText;
|
|
293
|
+
/** Callback answer after success. Default: generic "done". */
|
|
294
|
+
result?: LocalizedText;
|
|
295
|
+
/** Consume the token after one run. Default true. */
|
|
296
|
+
singleUse?: boolean;
|
|
297
|
+
/** Token lifetime. Default 7 days. */
|
|
298
|
+
ttlMinutes?: number;
|
|
299
|
+
/** Resolves to an `ActionResult`, or nothing. */
|
|
300
|
+
run(ctx: ActionContext<A, P, E>): Promise<unknown>;
|
|
301
|
+
}
|
|
302
|
+
/** One choice of a dialog step, shown as an inline button. */
|
|
303
|
+
export interface DialogChoice {
|
|
304
|
+
/** Value stored in the dialog state when tapped. */
|
|
305
|
+
value: string;
|
|
306
|
+
/** Button text (a plain string or localized text). */
|
|
307
|
+
label: LocalizedText | string;
|
|
308
|
+
}
|
|
309
|
+
/** One question of a dialog. */
|
|
310
|
+
export interface DialogStepDef<A = unknown, E = unknown> {
|
|
311
|
+
/** Step id, also the state key of the answer (`[a-zA-Z][a-zA-Z0-9_]{0,31}`). */
|
|
312
|
+
readonly id: string;
|
|
313
|
+
/** The question sent to the user. */
|
|
314
|
+
readonly ask: LocalizedText;
|
|
315
|
+
/** Zod schema for text input, or a media kind. Default `"text"`. */
|
|
316
|
+
readonly input: z.ZodType | "text" | "photo" | "document";
|
|
317
|
+
/** The user may `/skip` this step. */
|
|
318
|
+
readonly optional: boolean;
|
|
319
|
+
/** Choices offered as buttons, computed from the answers so far. */
|
|
320
|
+
choices?(ctx: {
|
|
321
|
+
actor: A;
|
|
322
|
+
state: Record<string, unknown>;
|
|
323
|
+
env: E;
|
|
324
|
+
}): MaybePromise<DialogChoice[]>;
|
|
325
|
+
}
|
|
326
|
+
/** Input of one dialog step; see `DialogStepDef`. */
|
|
327
|
+
export interface DialogStepInput<A, E = unknown> {
|
|
328
|
+
/** Step id / state key, `[a-zA-Z][a-zA-Z0-9_]{0,31}`, unique in the dialog. */
|
|
329
|
+
id: string;
|
|
330
|
+
/** The question. */
|
|
331
|
+
ask: LocalizedText;
|
|
332
|
+
/** Zod schema or media kind. Default `"text"`. */
|
|
333
|
+
input?: z.ZodType | "text" | "photo" | "document";
|
|
334
|
+
/** May be skipped. Default false. */
|
|
335
|
+
optional?: boolean;
|
|
336
|
+
/** Choices offered as buttons. */
|
|
337
|
+
choices?(ctx: {
|
|
338
|
+
actor: A;
|
|
339
|
+
state: Record<string, unknown>;
|
|
340
|
+
env: E;
|
|
341
|
+
}): MaybePromise<DialogChoice[]>;
|
|
342
|
+
}
|
|
343
|
+
/** What a dialog's `finish` receives once every step is answered. */
|
|
344
|
+
export interface DialogFinishContext<A, E = unknown> {
|
|
345
|
+
/** Live actor of the user. */
|
|
346
|
+
actor: A;
|
|
347
|
+
/** Answers by step id. */
|
|
348
|
+
state: Record<string, unknown>;
|
|
349
|
+
/** Photos / documents received in media steps, already stored through the files port. */
|
|
350
|
+
files: StoredFile[];
|
|
351
|
+
/** The chat of the dialog. */
|
|
352
|
+
chat: ChatDto;
|
|
353
|
+
/** Locale of the chat. */
|
|
354
|
+
locale: string;
|
|
355
|
+
/** The plugin's database port, for the host's own write (Telegram replies go out after `finish` resolves). */
|
|
356
|
+
db: DbPort;
|
|
357
|
+
/** Epoch ms UTC of the final answer. */
|
|
358
|
+
now: number;
|
|
359
|
+
/** The Worker env of this invocation (the value the plugin's `env` mapper received), for per-request bindings. */
|
|
360
|
+
env: E;
|
|
361
|
+
}
|
|
362
|
+
/** A multi-step dialog (`defineDialog`), started by `ctx.startDialog()` or `startDialog()`; `/cancel` aborts it. */
|
|
363
|
+
export interface DialogDef<A = unknown, E = unknown> {
|
|
364
|
+
/** Unique dialog key (`[a-z0-9._:-]`, ≤ 64). */
|
|
365
|
+
readonly key: string;
|
|
366
|
+
/** Host permission checked when the dialog starts; null = none. */
|
|
367
|
+
readonly permission: string | null;
|
|
368
|
+
/** The questions, asked in order. */
|
|
369
|
+
readonly steps: readonly DialogStepDef<A, E>[];
|
|
370
|
+
/** Minutes of inactivity before the dialog expires. */
|
|
371
|
+
readonly timeoutMinutes: number;
|
|
372
|
+
/** Resolves to `{ text }` (the reply), or nothing. */
|
|
373
|
+
finish(ctx: DialogFinishContext<A, E>): Promise<unknown>;
|
|
374
|
+
}
|
|
375
|
+
/** Input of `defineDialog`. Throws `TelegramConfigError` if invalid. */
|
|
376
|
+
export interface DialogInput<A, E = unknown> {
|
|
377
|
+
/** Unique key, `[a-z0-9._:-]`, ≤ 64. */
|
|
378
|
+
key: string;
|
|
379
|
+
/** Host permission checked at start. Default: none. */
|
|
380
|
+
permission?: string;
|
|
381
|
+
/** At least one step. */
|
|
382
|
+
steps: DialogStepInput<A, E>[];
|
|
383
|
+
/** Inactivity timeout in minutes. Default 30. */
|
|
384
|
+
timeoutMinutes?: number;
|
|
385
|
+
/** Resolves to `{ text }` (the reply), or nothing. */
|
|
386
|
+
finish(ctx: DialogFinishContext<A, E>): Promise<unknown>;
|
|
387
|
+
}
|
|
388
|
+
/** A host recipient kind (`defineAudience`), resolved to user ids at send time. */
|
|
389
|
+
export interface AudienceDef<E = unknown> {
|
|
390
|
+
/** Recipient kind, used as `{ audience: key, ref }`. */
|
|
391
|
+
readonly key: string;
|
|
392
|
+
/** Name shown in admin pickers. */
|
|
393
|
+
readonly label: LocalizedText;
|
|
394
|
+
/** User ids for a ref (for example the members of a project team). */
|
|
395
|
+
resolve(ctx: {
|
|
396
|
+
ref: string;
|
|
397
|
+
db: DbPort;
|
|
398
|
+
now: number;
|
|
399
|
+
env: E;
|
|
400
|
+
}): MaybePromise<string[]>;
|
|
401
|
+
/** Optional group audience for chats bound to this kind. */
|
|
402
|
+
audienceFor?(ref: string): Audience | null;
|
|
403
|
+
}
|
|
404
|
+
/** Input of `defineAudience`; see `AudienceDef`. */
|
|
405
|
+
export interface AudienceInput<E = unknown> {
|
|
406
|
+
/** Kind key, `[a-zA-Z][a-zA-Z0-9_]{0,31}`. */
|
|
407
|
+
key: string;
|
|
408
|
+
/** Name shown in admin pickers. */
|
|
409
|
+
label: LocalizedText;
|
|
410
|
+
/** User ids for a ref. */
|
|
411
|
+
resolve(ctx: {
|
|
412
|
+
ref: string;
|
|
413
|
+
db: DbPort;
|
|
414
|
+
now: number;
|
|
415
|
+
env: E;
|
|
416
|
+
}): MaybePromise<string[]>;
|
|
417
|
+
/** Optional group audience for chats bound to this kind. */
|
|
418
|
+
audienceFor?(ref: string): Audience | null;
|
|
419
|
+
}
|
|
420
|
+
/** What `FileSourceDef.resolve` receives. */
|
|
421
|
+
export interface FileSourceContext<A, E = unknown> {
|
|
422
|
+
/**
|
|
423
|
+
* The requesting actor (check that it may read the file); null when the plugin re-opens the file at send time
|
|
424
|
+
* after that check passed.
|
|
425
|
+
*/
|
|
426
|
+
actor: A | null;
|
|
427
|
+
/** The host's file reference (as given in the send intent / broadcast). */
|
|
428
|
+
ref: string;
|
|
429
|
+
/** The Worker env of this invocation (the value the plugin's `env` mapper received), for per-request bindings. */
|
|
430
|
+
env: E;
|
|
431
|
+
}
|
|
432
|
+
/** A host file source (`defineFileSource`): opens files by ref for file sends. */
|
|
433
|
+
export interface FileSourceDef<A = unknown, E = unknown> {
|
|
434
|
+
/** Source key used in send intents. */
|
|
435
|
+
readonly key: string;
|
|
436
|
+
/** Name shown in admin pickers; null = the key. */
|
|
437
|
+
readonly label: LocalizedText | null;
|
|
438
|
+
/** Opens a file, or null when it does not exist or `actor` may not read it. */
|
|
439
|
+
resolve(ctx: FileSourceContext<A, E>): Promise<OpenedFile | null>;
|
|
440
|
+
}
|
|
441
|
+
/** Input of `defineFileSource`. */
|
|
442
|
+
export interface FileSourceInput<A, E = unknown> {
|
|
443
|
+
/** Source key used in send intents (`{ file: { source, ref } }`). */
|
|
444
|
+
key: string;
|
|
445
|
+
/** Name shown in admin pickers. */
|
|
446
|
+
label?: LocalizedText;
|
|
447
|
+
/** Opens a file, or null when it does not exist or `actor` may not read it. */
|
|
448
|
+
resolve(ctx: FileSourceContext<A, E>): Promise<OpenedFile | null>;
|
|
449
|
+
}
|
|
450
|
+
/** Validates and freezes a provider definition. Throws `TelegramConfigError` on an invalid key, label or schema. */
|
|
451
|
+
export declare function defineProvider<P = Record<string, never>, V = unknown, A = unknown, E = unknown>(def: ProviderInput<P, V, A, E>): ProviderDef<P, V, A, E>;
|
|
452
|
+
/**
|
|
453
|
+
* Validates and freezes a command definition. Throws `TelegramConfigError` on a bad or reserved name or alias, or
|
|
454
|
+
* when not exactly one of `template` / `handle` is given.
|
|
455
|
+
*/
|
|
456
|
+
export declare function defineCommand<Args = Record<string, never>, A = unknown, E = unknown>(def: CommandInput<Args, A, E>): CommandDef<Args, A, E>;
|
|
457
|
+
/**
|
|
458
|
+
* Validates and freezes an event definition. Throws `TelegramConfigError` on a bad key or label, or a
|
|
459
|
+
* filterable / sensitive field missing from an object payload.
|
|
460
|
+
*/
|
|
461
|
+
export declare function defineEvent<P = unknown>(def: EventInput<P>): EventDef<P>;
|
|
462
|
+
/** Validates and freezes an action definition. Throws `TelegramConfigError` if invalid. */
|
|
463
|
+
export declare function defineAction<P = unknown, A = unknown, E = unknown>(def: ActionInput<P, A, E>): ActionDef<P, A, E>;
|
|
464
|
+
/** Validates and freezes a dialog definition (unique step ids, positive timeout). Throws `TelegramConfigError`. */
|
|
465
|
+
export declare function defineDialog<A = unknown, E = unknown>(def: DialogInput<A, E>): DialogDef<A, E>;
|
|
466
|
+
/** Validates and freezes a recipient-kind definition. Throws `TelegramConfigError` if invalid. */
|
|
467
|
+
export declare function defineAudience<E = unknown>(def: AudienceInput<E>): AudienceDef<E>;
|
|
468
|
+
/** Validates and freezes a file-source definition. Throws `TelegramConfigError` if invalid. */
|
|
469
|
+
export declare function defineFileSource<A = unknown, E = unknown>(def: FileSourceInput<A, E>): FileSourceDef<A, E>;
|
|
470
|
+
/**
|
|
471
|
+
* All `define*` helpers typed for one host actor and (optionally) the Worker env type that every context's `env` has:
|
|
472
|
+
* `const d = definitions<HostActor, Env>(); d.command({…})`.
|
|
473
|
+
*/
|
|
474
|
+
export declare function definitions<A, E = unknown>(): {
|
|
475
|
+
provider: <P = Record<string, never>, V = unknown>(def: ProviderInput<P, V, A, E>) => ProviderDef<P, V, A, E>;
|
|
476
|
+
command: <Args = Record<string, never>>(def: CommandInput<Args, A, E>) => CommandDef<Args, A, E>;
|
|
477
|
+
event: <P = unknown>(def: EventInput<P>) => EventDef<P>;
|
|
478
|
+
action: <P = unknown>(def: ActionInput<P, A, E>) => ActionDef<P, A, E>;
|
|
479
|
+
dialog: (def: DialogInput<A, E>) => DialogDef<A, E>;
|
|
480
|
+
audience: (def: AudienceInput<E>) => AudienceDef<E>;
|
|
481
|
+
fileSource: (def: FileSourceInput<A, E>) => FileSourceDef<A, E>;
|
|
482
|
+
};
|
|
483
|
+
/** The host definitions indexed by key (read-only, built once by `createRegistry`). */
|
|
484
|
+
export interface Registry<A> {
|
|
485
|
+
/** Providers by key. */
|
|
486
|
+
readonly providers: ReadonlyMap<string, ProviderDef<unknown, unknown, A>>;
|
|
487
|
+
/** By command name and by alias. */
|
|
488
|
+
readonly commands: ReadonlyMap<string, CommandDef<unknown, A>>;
|
|
489
|
+
/** Commands in registration order (no alias duplicates). */
|
|
490
|
+
readonly commandList: readonly CommandDef<unknown, A>[];
|
|
491
|
+
/** Events by key. */
|
|
492
|
+
readonly events: ReadonlyMap<string, EventDef<unknown>>;
|
|
493
|
+
/** Actions by key. */
|
|
494
|
+
readonly actions: ReadonlyMap<string, ActionDef<unknown, A>>;
|
|
495
|
+
/** Dialogs by key. */
|
|
496
|
+
readonly dialogs: ReadonlyMap<string, DialogDef<A>>;
|
|
497
|
+
/** Recipient kinds by key. */
|
|
498
|
+
readonly audiences: ReadonlyMap<string, AudienceDef>;
|
|
499
|
+
/** File sources by key. */
|
|
500
|
+
readonly fileSources: ReadonlyMap<string, FileSourceDef<A>>;
|
|
501
|
+
}
|
|
502
|
+
export {};
|