@fragno-dev/telegram-fragment 0.0.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.
Files changed (60) hide show
  1. package/LICENSE.md +16 -0
  2. package/README.md +87 -0
  3. package/dist/browser/client/react.d.ts +226 -0
  4. package/dist/browser/client/react.d.ts.map +1 -0
  5. package/dist/browser/client/react.js +166 -0
  6. package/dist/browser/client/react.js.map +1 -0
  7. package/dist/browser/client/solid.d.ts +228 -0
  8. package/dist/browser/client/solid.d.ts.map +1 -0
  9. package/dist/browser/client/solid.js +136 -0
  10. package/dist/browser/client/solid.js.map +1 -0
  11. package/dist/browser/client/svelte.d.ts +223 -0
  12. package/dist/browser/client/svelte.d.ts.map +1 -0
  13. package/dist/browser/client/svelte.js +134 -0
  14. package/dist/browser/client/svelte.js.map +1 -0
  15. package/dist/browser/client/vanilla.d.ts +252 -0
  16. package/dist/browser/client/vanilla.d.ts.map +1 -0
  17. package/dist/browser/client/vanilla.js +160 -0
  18. package/dist/browser/client/vanilla.js.map +1 -0
  19. package/dist/browser/client/vue.d.ts +226 -0
  20. package/dist/browser/client/vue.d.ts.map +1 -0
  21. package/dist/browser/client/vue.js +133 -0
  22. package/dist/browser/client/vue.js.map +1 -0
  23. package/dist/browser/client-Bk-J98pf.d.ts +679 -0
  24. package/dist/browser/client-Bk-J98pf.d.ts.map +1 -0
  25. package/dist/browser/index.d.ts +1392 -0
  26. package/dist/browser/index.d.ts.map +1 -0
  27. package/dist/browser/index.js +24 -0
  28. package/dist/browser/index.js.map +1 -0
  29. package/dist/browser/schema-QDMf15Vn.js +2343 -0
  30. package/dist/browser/schema-QDMf15Vn.js.map +1 -0
  31. package/dist/node/command-handler-api.js +42 -0
  32. package/dist/node/command-handler-api.js.map +1 -0
  33. package/dist/node/definition.d.ts +194 -0
  34. package/dist/node/definition.d.ts.map +1 -0
  35. package/dist/node/definition.js +90 -0
  36. package/dist/node/definition.js.map +1 -0
  37. package/dist/node/index.d.ts +587 -0
  38. package/dist/node/index.d.ts.map +1 -0
  39. package/dist/node/index.js +29 -0
  40. package/dist/node/index.js.map +1 -0
  41. package/dist/node/routes.d.ts +385 -0
  42. package/dist/node/routes.d.ts.map +1 -0
  43. package/dist/node/routes.js +392 -0
  44. package/dist/node/routes.js.map +1 -0
  45. package/dist/node/schema.d.ts +13 -0
  46. package/dist/node/schema.d.ts.map +1 -0
  47. package/dist/node/schema.js +78 -0
  48. package/dist/node/schema.js.map +1 -0
  49. package/dist/node/services.js +589 -0
  50. package/dist/node/services.js.map +1 -0
  51. package/dist/node/telegram-api.js +41 -0
  52. package/dist/node/telegram-api.js.map +1 -0
  53. package/dist/node/telegram-utils.js +61 -0
  54. package/dist/node/telegram-utils.js.map +1 -0
  55. package/dist/node/types.d.ts +245 -0
  56. package/dist/node/types.d.ts.map +1 -0
  57. package/dist/node/types.js +92 -0
  58. package/dist/node/types.js.map +1 -0
  59. package/dist/tsconfig.tsbuildinfo +1 -0
  60. package/package.json +96 -0
@@ -0,0 +1,587 @@
1
+ import { TelegramApi, TelegramApiResult, TelegramChatMemberHookPayload, TelegramChatMemberSummary, TelegramChatSummary, TelegramChatType, TelegramCommandApi, TelegramCommandApiResult, TelegramCommandBinding, TelegramCommandBindings, TelegramCommandContext, TelegramCommandDefinition, TelegramCommandRegistry, TelegramCommandScope, TelegramConfigBuilder, TelegramFragmentConfig, TelegramHooks, TelegramHooksMap, TelegramMessage, TelegramMessageHookPayload, TelegramMessageSummary, TelegramQueuedResult, TelegramUpdate, TelegramUpdateType, TelegramUser, TelegramUserSummary, createTelegram, defineCommand } from "./types.js";
2
+ import { telegramFragmentDefinition } from "./definition.js";
3
+ import { telegramRoutesFactory } from "./routes.js";
4
+ import { telegramSchema } from "./schema.js";
5
+ import * as _fragno_dev_core_client0 from "@fragno-dev/core/client";
6
+ import { FragnoPublicClientConfig } from "@fragno-dev/core/client";
7
+ import * as _fragno_dev_core0 from "@fragno-dev/core";
8
+ import { FragnoRouteConfig } from "@fragno-dev/core";
9
+ import * as _fragno_dev_db0 from "@fragno-dev/db";
10
+ import { FragnoPublicConfigWithDatabase } from "@fragno-dev/db";
11
+ import * as _fragno_dev_db_schema0 from "@fragno-dev/db/schema";
12
+ import * as zod from "zod";
13
+ import * as zod_v4_core0 from "zod/v4/core";
14
+ import * as _standard_schema_spec0 from "@standard-schema/spec";
15
+ import * as _fragno_dev_db_fragment_definition_builder0 from "@fragno-dev/db/fragment-definition-builder";
16
+ import * as _fragno_dev_core_api0 from "@fragno-dev/core/api";
17
+
18
+ //#region src/index.d.ts
19
+ declare function createTelegramFragment(config: TelegramFragmentConfig, fragnoConfig: FragnoPublicConfigWithDatabase): _fragno_dev_core0.FragnoInstantiatedFragment<readonly [_fragno_dev_core0.FragnoRouteConfig<"POST", "/telegram/webhook", zod.ZodObject<{
20
+ update_id: zod.ZodNumber;
21
+ message: zod.ZodOptional<zod.ZodType<TelegramMessage, unknown, zod_v4_core0.$ZodTypeInternals<TelegramMessage, unknown>>>;
22
+ edited_message: zod.ZodOptional<zod.ZodType<TelegramMessage, unknown, zod_v4_core0.$ZodTypeInternals<TelegramMessage, unknown>>>;
23
+ channel_post: zod.ZodOptional<zod.ZodType<TelegramMessage, unknown, zod_v4_core0.$ZodTypeInternals<TelegramMessage, unknown>>>;
24
+ }, zod_v4_core0.$loose>, zod.ZodObject<{
25
+ ok: zod.ZodBoolean;
26
+ duplicate: zod.ZodOptional<zod.ZodBoolean>;
27
+ }, zod_v4_core0.$strip>, "UNAUTHORIZED", string, _fragno_dev_db0.DatabaseRequestContext<TelegramHooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"POST", "/commands/bind", zod.ZodObject<{
28
+ chatId: zod.ZodString;
29
+ commandName: zod.ZodString;
30
+ enabled: zod.ZodDefault<zod.ZodOptional<zod.ZodBoolean>>;
31
+ scopes: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
32
+ private: "private";
33
+ group: "group";
34
+ supergroup: "supergroup";
35
+ channel: "channel";
36
+ }>>>;
37
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
38
+ chatId: zod.ZodString;
39
+ commandName: zod.ZodString;
40
+ enabled: zod.ZodBoolean;
41
+ scopes: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
42
+ private: "private";
43
+ group: "group";
44
+ supergroup: "supergroup";
45
+ channel: "channel";
46
+ }>>>;
47
+ }, zod_v4_core0.$strip>, "chat_not_found" | "command_not_found" | "invalid_scopes", string, _fragno_dev_db0.DatabaseRequestContext<TelegramHooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"GET", "/commands", _standard_schema_spec0.StandardSchemaV1<unknown, unknown> | undefined, zod.ZodObject<{
48
+ commands: zod.ZodArray<zod.ZodObject<{
49
+ name: zod.ZodString;
50
+ description: zod.ZodOptional<zod.ZodString>;
51
+ scopes: zod.ZodArray<zod.ZodEnum<{
52
+ private: "private";
53
+ group: "group";
54
+ supergroup: "supergroup";
55
+ channel: "channel";
56
+ }>>;
57
+ enabled: zod.ZodOptional<zod.ZodBoolean>;
58
+ effectiveScopes: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
59
+ private: "private";
60
+ group: "group";
61
+ supergroup: "supergroup";
62
+ channel: "channel";
63
+ }>>>;
64
+ binding: zod.ZodOptional<zod.ZodNullable<zod.ZodObject<{
65
+ enabled: zod.ZodOptional<zod.ZodBoolean>;
66
+ scopes: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
67
+ private: "private";
68
+ group: "group";
69
+ supergroup: "supergroup";
70
+ channel: "channel";
71
+ }>>>;
72
+ }, zod_v4_core0.$strip>>>;
73
+ }, zod_v4_core0.$strip>>;
74
+ }, zod_v4_core0.$strip>, "chat_not_found", "chatId", _fragno_dev_db0.DatabaseRequestContext<TelegramHooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"GET", "/chats", _standard_schema_spec0.StandardSchemaV1<unknown, unknown> | undefined, zod.ZodArray<zod.ZodObject<{
75
+ id: zod.ZodString;
76
+ type: zod.ZodEnum<{
77
+ private: "private";
78
+ group: "group";
79
+ supergroup: "supergroup";
80
+ channel: "channel";
81
+ }>;
82
+ title: zod.ZodNullable<zod.ZodString>;
83
+ username: zod.ZodNullable<zod.ZodString>;
84
+ isForum: zod.ZodBoolean;
85
+ commandBindings: zod.ZodNullable<zod.ZodRecord<zod.ZodString, zod.ZodObject<{
86
+ enabled: zod.ZodOptional<zod.ZodBoolean>;
87
+ scopes: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
88
+ private: "private";
89
+ group: "group";
90
+ supergroup: "supergroup";
91
+ channel: "channel";
92
+ }>>>;
93
+ }, zod_v4_core0.$loose>>>;
94
+ createdAt: zod.ZodDate;
95
+ updatedAt: zod.ZodDate;
96
+ }, zod_v4_core0.$strip>>, string, "type", _fragno_dev_db0.DatabaseRequestContext<TelegramHooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"GET", "/chats/:chatId", _standard_schema_spec0.StandardSchemaV1<unknown, unknown> | undefined, zod.ZodObject<{
97
+ chat: zod.ZodObject<{
98
+ id: zod.ZodString;
99
+ type: zod.ZodEnum<{
100
+ private: "private";
101
+ group: "group";
102
+ supergroup: "supergroup";
103
+ channel: "channel";
104
+ }>;
105
+ title: zod.ZodNullable<zod.ZodString>;
106
+ username: zod.ZodNullable<zod.ZodString>;
107
+ isForum: zod.ZodBoolean;
108
+ commandBindings: zod.ZodNullable<zod.ZodRecord<zod.ZodString, zod.ZodObject<{
109
+ enabled: zod.ZodOptional<zod.ZodBoolean>;
110
+ scopes: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
111
+ private: "private";
112
+ group: "group";
113
+ supergroup: "supergroup";
114
+ channel: "channel";
115
+ }>>>;
116
+ }, zod_v4_core0.$loose>>>;
117
+ createdAt: zod.ZodDate;
118
+ updatedAt: zod.ZodDate;
119
+ }, zod_v4_core0.$strip>;
120
+ members: zod.ZodArray<zod.ZodObject<{
121
+ id: zod.ZodString;
122
+ chatId: zod.ZodString;
123
+ userId: zod.ZodString;
124
+ status: zod.ZodString;
125
+ joinedAt: zod.ZodNullable<zod.ZodDate>;
126
+ leftAt: zod.ZodNullable<zod.ZodDate>;
127
+ user: zod.ZodNullable<zod.ZodObject<{
128
+ id: zod.ZodString;
129
+ username: zod.ZodNullable<zod.ZodString>;
130
+ firstName: zod.ZodString;
131
+ lastName: zod.ZodNullable<zod.ZodString>;
132
+ isBot: zod.ZodBoolean;
133
+ languageCode: zod.ZodNullable<zod.ZodString>;
134
+ createdAt: zod.ZodDate;
135
+ updatedAt: zod.ZodDate;
136
+ }, zod_v4_core0.$strip>>;
137
+ createdAt: zod.ZodDate;
138
+ updatedAt: zod.ZodDate;
139
+ }, zod_v4_core0.$strip>>;
140
+ }, zod_v4_core0.$strip>, "chat_not_found", string, _fragno_dev_db0.DatabaseRequestContext<TelegramHooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"GET", "/chats/:chatId/messages", _standard_schema_spec0.StandardSchemaV1<unknown, unknown> | undefined, zod.ZodObject<{
141
+ messages: zod.ZodArray<zod.ZodObject<{
142
+ id: zod.ZodString;
143
+ chatId: zod.ZodString;
144
+ fromUserId: zod.ZodNullable<zod.ZodString>;
145
+ senderChatId: zod.ZodNullable<zod.ZodString>;
146
+ replyToMessageId: zod.ZodNullable<zod.ZodString>;
147
+ messageType: zod.ZodEnum<{
148
+ message: "message";
149
+ edited_message: "edited_message";
150
+ channel_post: "channel_post";
151
+ }>;
152
+ text: zod.ZodNullable<zod.ZodString>;
153
+ payload: zod.ZodNullable<zod.ZodUnknown>;
154
+ sentAt: zod.ZodDate;
155
+ editedAt: zod.ZodNullable<zod.ZodDate>;
156
+ commandName: zod.ZodNullable<zod.ZodString>;
157
+ fromUser: zod.ZodNullable<zod.ZodObject<{
158
+ id: zod.ZodString;
159
+ username: zod.ZodNullable<zod.ZodString>;
160
+ firstName: zod.ZodString;
161
+ lastName: zod.ZodNullable<zod.ZodString>;
162
+ isBot: zod.ZodBoolean;
163
+ languageCode: zod.ZodNullable<zod.ZodString>;
164
+ createdAt: zod.ZodDate;
165
+ updatedAt: zod.ZodDate;
166
+ }, zod_v4_core0.$strip>>;
167
+ }, zod_v4_core0.$strip>>;
168
+ cursor: zod.ZodOptional<zod.ZodString>;
169
+ hasNextPage: zod.ZodBoolean;
170
+ }, zod_v4_core0.$strip>, string, "pageSize" | "cursor" | "order", _fragno_dev_db0.DatabaseRequestContext<TelegramHooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"POST", "/chats/:chatId/actions", zod.ZodObject<{
171
+ action: zod.ZodEnum<{
172
+ typing: "typing";
173
+ upload_photo: "upload_photo";
174
+ record_video: "record_video";
175
+ upload_video: "upload_video";
176
+ record_voice: "record_voice";
177
+ upload_voice: "upload_voice";
178
+ upload_document: "upload_document";
179
+ choose_sticker: "choose_sticker";
180
+ find_location: "find_location";
181
+ record_video_note: "record_video_note";
182
+ upload_video_note: "upload_video_note";
183
+ }>;
184
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
185
+ ok: zod.ZodBoolean;
186
+ }, zod_v4_core0.$strip>, "TELEGRAM_API_ERROR", string, _fragno_dev_db0.DatabaseRequestContext<TelegramHooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"POST", "/chats/:chatId/send", zod.ZodObject<{
187
+ text: zod.ZodString;
188
+ parseMode: zod.ZodOptional<zod.ZodEnum<{
189
+ MarkdownV2: "MarkdownV2";
190
+ Markdown: "Markdown";
191
+ HTML: "HTML";
192
+ }>>;
193
+ disableWebPagePreview: zod.ZodOptional<zod.ZodBoolean>;
194
+ replyToMessageId: zod.ZodOptional<zod.ZodCoercedNumber<unknown>>;
195
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
196
+ ok: zod.ZodBoolean;
197
+ queued: zod.ZodBoolean;
198
+ }, zod_v4_core0.$strip>, string, string, _fragno_dev_db0.DatabaseRequestContext<TelegramHooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"POST", "/chats/:chatId/messages/:messageId/edit", zod.ZodObject<{
199
+ text: zod.ZodString;
200
+ parseMode: zod.ZodOptional<zod.ZodEnum<{
201
+ MarkdownV2: "MarkdownV2";
202
+ Markdown: "Markdown";
203
+ HTML: "HTML";
204
+ }>>;
205
+ disableWebPagePreview: zod.ZodOptional<zod.ZodBoolean>;
206
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
207
+ ok: zod.ZodBoolean;
208
+ queued: zod.ZodBoolean;
209
+ }, zod_v4_core0.$strip>, "INVALID_MESSAGE_ID", string, _fragno_dev_db0.DatabaseRequestContext<TelegramHooksMap>>], _fragno_dev_db0.ImplicitDatabaseDependencies<_fragno_dev_db_schema0.Schema<{
210
+ user: _fragno_dev_db_schema0.Table<Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(128)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"username", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"firstName", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"lastName", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"isBot", _fragno_dev_db_schema0.Column<"bool", boolean | null, boolean>> & Record<"languageCode", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>> & Record<"updatedAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>>, Record<string, _fragno_dev_db_schema0.AnyRelation>, Record<string, _fragno_dev_db_schema0.Index<_fragno_dev_db_schema0.AnyColumn[], readonly string[]>> & Record<"idx_user_username", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"string", string | null, string | null>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["username"]>>>;
211
+ chat: _fragno_dev_db_schema0.Table<Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(128)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"type", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"title", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"username", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"isForum", _fragno_dev_db_schema0.Column<"bool", boolean | null, boolean>> & Record<"commandBindings", _fragno_dev_db_schema0.Column<"json", unknown, unknown>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>> & Record<"updatedAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>>, Record<string, _fragno_dev_db_schema0.AnyRelation>, Record<string, _fragno_dev_db_schema0.Index<_fragno_dev_db_schema0.AnyColumn[], readonly string[]>> & Record<"idx_chat_type", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"string", string, string>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["type"]>>>;
212
+ chatMember: _fragno_dev_db_schema0.Table<Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(128)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"chatId", _fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference, _fragno_dev_db_schema0.FragnoReference>> & Record<"userId", _fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference, _fragno_dev_db_schema0.FragnoReference>> & Record<"status", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"joinedAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date | null>> & Record<"leftAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date | null>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>> & Record<"updatedAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>>, Record<string, _fragno_dev_db_schema0.AnyRelation> & Record<"chatMemberChat", _fragno_dev_db_schema0.Relation<"one", _fragno_dev_db_schema0.Table<Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(128)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"type", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"title", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"username", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"isForum", _fragno_dev_db_schema0.Column<"bool", boolean | null, boolean>> & Record<"commandBindings", _fragno_dev_db_schema0.Column<"json", unknown, unknown>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>> & Record<"updatedAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>>, Record<string, _fragno_dev_db_schema0.AnyRelation>, Record<string, _fragno_dev_db_schema0.Index<_fragno_dev_db_schema0.AnyColumn[], readonly string[]>> & Record<"idx_chat_type", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"string", string, string>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["type"]>>>>> & Record<"chatMemberUser", _fragno_dev_db_schema0.Relation<"one", _fragno_dev_db_schema0.Table<Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(128)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"username", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"firstName", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"lastName", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"isBot", _fragno_dev_db_schema0.Column<"bool", boolean | null, boolean>> & Record<"languageCode", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>> & Record<"updatedAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>>, Record<string, _fragno_dev_db_schema0.AnyRelation>, Record<string, _fragno_dev_db_schema0.Index<_fragno_dev_db_schema0.AnyColumn[], readonly string[]>> & Record<"idx_user_username", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"string", string | null, string | null>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["username"]>>>>>, Record<string, _fragno_dev_db_schema0.Index<_fragno_dev_db_schema0.AnyColumn[], readonly string[]>> & Record<"idx_chat_member_chat", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference, _fragno_dev_db_schema0.FragnoReference>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["chatId"]>> & Record<"idx_chat_member_user", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference, _fragno_dev_db_schema0.FragnoReference>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["userId"]>> & Record<"idx_chat_member_unique", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference, _fragno_dev_db_schema0.FragnoReference>, _fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference, _fragno_dev_db_schema0.FragnoReference>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["chatId", "userId"]>>>;
213
+ message: _fragno_dev_db_schema0.Table<Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(128)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"chatId", _fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference, _fragno_dev_db_schema0.FragnoReference>> & Record<"fromUserId", _fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference | null, _fragno_dev_db_schema0.FragnoReference | null>> & Record<"senderChatId", _fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference | null, _fragno_dev_db_schema0.FragnoReference | null>> & Record<"replyToMessageId", _fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference | null, _fragno_dev_db_schema0.FragnoReference | null>> & Record<"messageType", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"text", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"payload", _fragno_dev_db_schema0.Column<"json", unknown, unknown>> & Record<"sentAt", _fragno_dev_db_schema0.Column<"timestamp", Date | _fragno_dev_db0.DbNow, Date>> & Record<"editedAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date | null>> & Record<"commandName", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>>, Record<string, _fragno_dev_db_schema0.AnyRelation> & Record<"messageChat", _fragno_dev_db_schema0.Relation<"one", _fragno_dev_db_schema0.Table<Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(128)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"type", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"title", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"username", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"isForum", _fragno_dev_db_schema0.Column<"bool", boolean | null, boolean>> & Record<"commandBindings", _fragno_dev_db_schema0.Column<"json", unknown, unknown>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>> & Record<"updatedAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>>, Record<string, _fragno_dev_db_schema0.AnyRelation>, Record<string, _fragno_dev_db_schema0.Index<_fragno_dev_db_schema0.AnyColumn[], readonly string[]>> & Record<"idx_chat_type", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"string", string, string>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["type"]>>>>> & Record<"messageAuthor", _fragno_dev_db_schema0.Relation<"one", _fragno_dev_db_schema0.Table<Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(128)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"username", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"firstName", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"lastName", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"isBot", _fragno_dev_db_schema0.Column<"bool", boolean | null, boolean>> & Record<"languageCode", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>> & Record<"updatedAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>>, Record<string, _fragno_dev_db_schema0.AnyRelation>, Record<string, _fragno_dev_db_schema0.Index<_fragno_dev_db_schema0.AnyColumn[], readonly string[]>> & Record<"idx_user_username", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"string", string | null, string | null>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["username"]>>>>> & Record<"messageSenderChat", _fragno_dev_db_schema0.Relation<"one", _fragno_dev_db_schema0.Table<Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(128)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"type", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"title", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"username", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"isForum", _fragno_dev_db_schema0.Column<"bool", boolean | null, boolean>> & Record<"commandBindings", _fragno_dev_db_schema0.Column<"json", unknown, unknown>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>> & Record<"updatedAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>>, Record<string, _fragno_dev_db_schema0.AnyRelation>, Record<string, _fragno_dev_db_schema0.Index<_fragno_dev_db_schema0.AnyColumn[], readonly string[]>> & Record<"idx_chat_type", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"string", string, string>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["type"]>>>>> & Record<"messageReplyTo", _fragno_dev_db_schema0.Relation<"one", _fragno_dev_db_schema0.Table<Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(128)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"chatId", _fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference, _fragno_dev_db_schema0.FragnoReference>> & Record<"fromUserId", _fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference | null, _fragno_dev_db_schema0.FragnoReference | null>> & Record<"senderChatId", _fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference | null, _fragno_dev_db_schema0.FragnoReference | null>> & Record<"replyToMessageId", _fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference | null, _fragno_dev_db_schema0.FragnoReference | null>> & Record<"messageType", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"text", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"payload", _fragno_dev_db_schema0.Column<"json", unknown, unknown>> & Record<"sentAt", _fragno_dev_db_schema0.Column<"timestamp", Date | _fragno_dev_db0.DbNow, Date>> & Record<"editedAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date | null>> & Record<"commandName", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>>, Record<string, _fragno_dev_db_schema0.AnyRelation> & Record<"messageChat", _fragno_dev_db_schema0.Relation<"one", _fragno_dev_db_schema0.Table<Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(128)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"type", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"title", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"username", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"isForum", _fragno_dev_db_schema0.Column<"bool", boolean | null, boolean>> & Record<"commandBindings", _fragno_dev_db_schema0.Column<"json", unknown, unknown>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>> & Record<"updatedAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>>, Record<string, _fragno_dev_db_schema0.AnyRelation>, Record<string, _fragno_dev_db_schema0.Index<_fragno_dev_db_schema0.AnyColumn[], readonly string[]>> & Record<"idx_chat_type", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"string", string, string>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["type"]>>>>> & Record<"messageAuthor", _fragno_dev_db_schema0.Relation<"one", _fragno_dev_db_schema0.Table<Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(128)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"username", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"firstName", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"lastName", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"isBot", _fragno_dev_db_schema0.Column<"bool", boolean | null, boolean>> & Record<"languageCode", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>> & Record<"updatedAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>>, Record<string, _fragno_dev_db_schema0.AnyRelation>, Record<string, _fragno_dev_db_schema0.Index<_fragno_dev_db_schema0.AnyColumn[], readonly string[]>> & Record<"idx_user_username", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"string", string | null, string | null>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["username"]>>>>> & Record<"messageSenderChat", _fragno_dev_db_schema0.Relation<"one", _fragno_dev_db_schema0.Table<Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(128)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"type", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"title", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"username", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"isForum", _fragno_dev_db_schema0.Column<"bool", boolean | null, boolean>> & Record<"commandBindings", _fragno_dev_db_schema0.Column<"json", unknown, unknown>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>> & Record<"updatedAt", _fragno_dev_db_schema0.Column<"timestamp", (Date | _fragno_dev_db0.DbNow) | null, Date>>, Record<string, _fragno_dev_db_schema0.AnyRelation>, Record<string, _fragno_dev_db_schema0.Index<_fragno_dev_db_schema0.AnyColumn[], readonly string[]>> & Record<"idx_chat_type", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"string", string, string>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["type"]>>>>>, Record<string, _fragno_dev_db_schema0.Index<_fragno_dev_db_schema0.AnyColumn[], readonly string[]>> & Record<"idx_message_chat", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference, _fragno_dev_db_schema0.FragnoReference>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["chatId"]>> & Record<"idx_message_chat_sent", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference, _fragno_dev_db_schema0.FragnoReference>, _fragno_dev_db_schema0.Column<"timestamp", Date | _fragno_dev_db0.DbNow, Date>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["chatId", "sentAt"]>> & Record<"idx_message_from", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference | null, _fragno_dev_db_schema0.FragnoReference | null>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["fromUserId"]>> & Record<"idx_message_sent", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"timestamp", Date | _fragno_dev_db0.DbNow, Date>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["sentAt"]>>>>>, Record<string, _fragno_dev_db_schema0.Index<_fragno_dev_db_schema0.AnyColumn[], readonly string[]>> & Record<"idx_message_chat", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference, _fragno_dev_db_schema0.FragnoReference>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["chatId"]>> & Record<"idx_message_chat_sent", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference, _fragno_dev_db_schema0.FragnoReference>, _fragno_dev_db_schema0.Column<"timestamp", Date | _fragno_dev_db0.DbNow, Date>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["chatId", "sentAt"]>> & Record<"idx_message_from", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference | null, _fragno_dev_db_schema0.FragnoReference | null>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["fromUserId"]>> & Record<"idx_message_sent", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"timestamp", Date | _fragno_dev_db0.DbNow, Date>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["sentAt"]>>>;
214
+ }>>, _fragno_dev_core0.BoundServices<{
215
+ processIncomingUpdate: (this: _fragno_dev_db0.DatabaseServiceContext<TelegramHooksMap>, update: TelegramUpdate) => _fragno_dev_db0.TxResult<{
216
+ kind: "ignored";
217
+ updateId: number;
218
+ }, {
219
+ kind: "ignored";
220
+ updateId: number;
221
+ }> | _fragno_dev_db0.TxResult<{
222
+ kind: "ignored";
223
+ updateId: number;
224
+ } | {
225
+ kind: "message";
226
+ updateId: number;
227
+ updateType: TelegramMessageSummary["messageType"];
228
+ chat: TelegramChatSummary;
229
+ message: TelegramMessageSummary;
230
+ fromUser: TelegramUserSummary | null;
231
+ command: {
232
+ name: string;
233
+ args: string;
234
+ raw: string;
235
+ scopes: TelegramCommandScope[];
236
+ } | null;
237
+ }, [{
238
+ id: string | _fragno_dev_db_schema0.FragnoId;
239
+ type: string;
240
+ title: string | null;
241
+ username: string | null;
242
+ isForum: boolean;
243
+ commandBindings: unknown | null;
244
+ createdAt: Date;
245
+ updatedAt: Date;
246
+ }[], {
247
+ id: string | _fragno_dev_db_schema0.FragnoId;
248
+ username: string | null;
249
+ firstName: string;
250
+ lastName: string | null;
251
+ isBot: boolean;
252
+ languageCode: string | null;
253
+ createdAt: Date;
254
+ updatedAt: Date;
255
+ }[], {
256
+ id: string | _fragno_dev_db_schema0.FragnoId;
257
+ chatId: string | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference;
258
+ userId: string | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference;
259
+ status: string;
260
+ joinedAt: Date | null;
261
+ leftAt: Date | null;
262
+ createdAt: Date;
263
+ updatedAt: Date;
264
+ chatMemberUser?: {
265
+ id: string | _fragno_dev_db_schema0.FragnoId;
266
+ username: string | null;
267
+ firstName: string;
268
+ lastName: string | null;
269
+ isBot: boolean;
270
+ languageCode: string | null;
271
+ createdAt: Date;
272
+ updatedAt: Date;
273
+ } | null;
274
+ }[], {
275
+ id: string | _fragno_dev_db_schema0.FragnoId;
276
+ chatId: string | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference;
277
+ fromUserId: (string | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference) | null;
278
+ senderChatId: (string | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference) | null;
279
+ replyToMessageId: (string | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference) | null;
280
+ messageType: string;
281
+ text: string | null;
282
+ payload: unknown | null;
283
+ sentAt: Date;
284
+ editedAt: Date | null;
285
+ commandName: string | null;
286
+ messageAuthor?: {
287
+ id: string | _fragno_dev_db_schema0.FragnoId;
288
+ username: string | null;
289
+ firstName: string;
290
+ lastName: string | null;
291
+ isBot: boolean;
292
+ languageCode: string | null;
293
+ createdAt: Date;
294
+ updatedAt: Date;
295
+ } | null;
296
+ } | null]>;
297
+ bindCommand: (this: _fragno_dev_db0.DatabaseServiceContext<TelegramHooksMap>, input: {
298
+ chatId: string;
299
+ commandName: string;
300
+ enabled: boolean;
301
+ scopes?: TelegramCommandScope[];
302
+ }) => _fragno_dev_db0.TxResult<{
303
+ ok: false;
304
+ reason: "chat_not_found";
305
+ binding?: undefined;
306
+ } | {
307
+ ok: true;
308
+ binding: {
309
+ chatId: string;
310
+ commandName: string;
311
+ enabled: boolean;
312
+ scopes: ("private" | "group" | "supergroup" | "channel")[] | undefined;
313
+ };
314
+ reason?: undefined;
315
+ }, [{
316
+ id: _fragno_dev_db_schema0.FragnoId;
317
+ type: string;
318
+ title: string | null;
319
+ username: string | null;
320
+ isForum: boolean;
321
+ commandBindings: unknown;
322
+ createdAt: Date;
323
+ updatedAt: Date;
324
+ } | null]>;
325
+ listChats: (this: _fragno_dev_db0.DatabaseServiceContext<TelegramHooksMap>, type?: TelegramChatSummary["type"]) => _fragno_dev_db0.TxResult<TelegramChatSummary[], TelegramChatSummary[]>;
326
+ getChat: (this: _fragno_dev_db0.DatabaseServiceContext<TelegramHooksMap>, chatId: string) => _fragno_dev_db0.TxResult<TelegramChatSummary | null, TelegramChatSummary | null>;
327
+ getChatWithMembers: (this: _fragno_dev_db0.DatabaseServiceContext<TelegramHooksMap>, chatId: string) => _fragno_dev_db0.TxResult<{
328
+ chat: TelegramChatSummary | null;
329
+ members: TelegramChatMemberSummary[];
330
+ }, {
331
+ chat: TelegramChatSummary | null;
332
+ members: TelegramChatMemberSummary[];
333
+ }>;
334
+ listMessages: (this: _fragno_dev_db0.DatabaseServiceContext<TelegramHooksMap>, input: {
335
+ chatId: string;
336
+ pageSize: number;
337
+ order: "asc" | "desc";
338
+ cursor?: _fragno_dev_db0.Cursor;
339
+ }) => _fragno_dev_db0.TxResult<{
340
+ messages: TelegramMessageSummary[];
341
+ cursor: _fragno_dev_db0.Cursor | undefined;
342
+ hasNextPage: boolean;
343
+ }, {
344
+ messages: TelegramMessageSummary[];
345
+ cursor: _fragno_dev_db0.Cursor | undefined;
346
+ hasNextPage: boolean;
347
+ }>;
348
+ upsertOutgoingMessage: (this: _fragno_dev_db0.DatabaseServiceContext<TelegramHooksMap>, input: {
349
+ message: TelegramMessage;
350
+ messageType: TelegramUpdateType;
351
+ }) => _fragno_dev_db0.TxResult<void, [{
352
+ id: string | _fragno_dev_db_schema0.FragnoId;
353
+ type: string;
354
+ title: string | null;
355
+ username: string | null;
356
+ isForum: boolean;
357
+ commandBindings: unknown | null;
358
+ createdAt: Date;
359
+ updatedAt: Date;
360
+ }[], {
361
+ id: string | _fragno_dev_db_schema0.FragnoId;
362
+ username: string | null;
363
+ firstName: string;
364
+ lastName: string | null;
365
+ isBot: boolean;
366
+ languageCode: string | null;
367
+ createdAt: Date;
368
+ updatedAt: Date;
369
+ }[], {
370
+ id: string | _fragno_dev_db_schema0.FragnoId;
371
+ chatId: string | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference;
372
+ fromUserId: (string | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference) | null;
373
+ senderChatId: (string | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference) | null;
374
+ replyToMessageId: (string | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference) | null;
375
+ messageType: string;
376
+ text: string | null;
377
+ payload: unknown | null;
378
+ sentAt: Date;
379
+ editedAt: Date | null;
380
+ commandName: string | null;
381
+ messageAuthor?: {
382
+ id: string | _fragno_dev_db_schema0.FragnoId;
383
+ username: string | null;
384
+ firstName: string;
385
+ lastName: string | null;
386
+ isBot: boolean;
387
+ languageCode: string | null;
388
+ createdAt: Date;
389
+ updatedAt: Date;
390
+ } | null;
391
+ } | null]>;
392
+ }>, _fragno_dev_db0.DatabaseServiceContext<TelegramHooksMap>, _fragno_dev_db0.DatabaseRequestContext<TelegramHooksMap>, _fragno_dev_db_fragment_definition_builder0.DatabaseRequestStorage, FragnoPublicConfigWithDatabase>;
393
+ declare function createTelegramFragmentClients(fragnoConfig?: FragnoPublicClientConfig): {
394
+ useCommands: _fragno_dev_core_client0.FragnoClientHookData<"GET", "/commands", zod.ZodObject<{
395
+ commands: zod.ZodArray<zod.ZodObject<{
396
+ name: zod.ZodString;
397
+ description: zod.ZodOptional<zod.ZodString>;
398
+ scopes: zod.ZodArray<zod.ZodEnum<{
399
+ private: "private";
400
+ group: "group";
401
+ supergroup: "supergroup";
402
+ channel: "channel";
403
+ }>>;
404
+ enabled: zod.ZodOptional<zod.ZodBoolean>;
405
+ effectiveScopes: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
406
+ private: "private";
407
+ group: "group";
408
+ supergroup: "supergroup";
409
+ channel: "channel";
410
+ }>>>;
411
+ binding: zod.ZodOptional<zod.ZodNullable<zod.ZodObject<{
412
+ enabled: zod.ZodOptional<zod.ZodBoolean>;
413
+ scopes: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
414
+ private: "private";
415
+ group: "group";
416
+ supergroup: "supergroup";
417
+ channel: "channel";
418
+ }>>>;
419
+ }, zod_v4_core0.$strip>>>;
420
+ }, zod_v4_core0.$strip>>;
421
+ }, zod_v4_core0.$strip>, "chat_not_found", "chatId">;
422
+ useBindCommand: _fragno_dev_core_client0.FragnoClientMutatorData<_fragno_dev_core_api0.NonGetHTTPMethod, "/commands/bind", zod.ZodObject<{
423
+ chatId: zod.ZodString;
424
+ commandName: zod.ZodString;
425
+ enabled: zod.ZodDefault<zod.ZodOptional<zod.ZodBoolean>>;
426
+ scopes: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
427
+ private: "private";
428
+ group: "group";
429
+ supergroup: "supergroup";
430
+ channel: "channel";
431
+ }>>>;
432
+ }, zod_v4_core0.$strip> | undefined, zod.ZodObject<{
433
+ chatId: zod.ZodString;
434
+ commandName: zod.ZodString;
435
+ enabled: zod.ZodBoolean;
436
+ scopes: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
437
+ private: "private";
438
+ group: "group";
439
+ supergroup: "supergroup";
440
+ channel: "channel";
441
+ }>>>;
442
+ }, zod_v4_core0.$strip> | undefined, "chat_not_found" | "command_not_found" | "invalid_scopes", string>;
443
+ useChats: _fragno_dev_core_client0.FragnoClientHookData<"GET", "/chats", zod.ZodArray<zod.ZodObject<{
444
+ id: zod.ZodString;
445
+ type: zod.ZodEnum<{
446
+ private: "private";
447
+ group: "group";
448
+ supergroup: "supergroup";
449
+ channel: "channel";
450
+ }>;
451
+ title: zod.ZodNullable<zod.ZodString>;
452
+ username: zod.ZodNullable<zod.ZodString>;
453
+ isForum: zod.ZodBoolean;
454
+ commandBindings: zod.ZodNullable<zod.ZodRecord<zod.ZodString, zod.ZodObject<{
455
+ enabled: zod.ZodOptional<zod.ZodBoolean>;
456
+ scopes: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
457
+ private: "private";
458
+ group: "group";
459
+ supergroup: "supergroup";
460
+ channel: "channel";
461
+ }>>>;
462
+ }, zod_v4_core0.$loose>>>;
463
+ createdAt: zod.ZodDate;
464
+ updatedAt: zod.ZodDate;
465
+ }, zod_v4_core0.$strip>>, string, "type">;
466
+ useChat: _fragno_dev_core_client0.FragnoClientHookData<"GET", "/chats/:chatId", zod.ZodObject<{
467
+ chat: zod.ZodObject<{
468
+ id: zod.ZodString;
469
+ type: zod.ZodEnum<{
470
+ private: "private";
471
+ group: "group";
472
+ supergroup: "supergroup";
473
+ channel: "channel";
474
+ }>;
475
+ title: zod.ZodNullable<zod.ZodString>;
476
+ username: zod.ZodNullable<zod.ZodString>;
477
+ isForum: zod.ZodBoolean;
478
+ commandBindings: zod.ZodNullable<zod.ZodRecord<zod.ZodString, zod.ZodObject<{
479
+ enabled: zod.ZodOptional<zod.ZodBoolean>;
480
+ scopes: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
481
+ private: "private";
482
+ group: "group";
483
+ supergroup: "supergroup";
484
+ channel: "channel";
485
+ }>>>;
486
+ }, zod_v4_core0.$loose>>>;
487
+ createdAt: zod.ZodDate;
488
+ updatedAt: zod.ZodDate;
489
+ }, zod_v4_core0.$strip>;
490
+ members: zod.ZodArray<zod.ZodObject<{
491
+ id: zod.ZodString;
492
+ chatId: zod.ZodString;
493
+ userId: zod.ZodString;
494
+ status: zod.ZodString;
495
+ joinedAt: zod.ZodNullable<zod.ZodDate>;
496
+ leftAt: zod.ZodNullable<zod.ZodDate>;
497
+ user: zod.ZodNullable<zod.ZodObject<{
498
+ id: zod.ZodString;
499
+ username: zod.ZodNullable<zod.ZodString>;
500
+ firstName: zod.ZodString;
501
+ lastName: zod.ZodNullable<zod.ZodString>;
502
+ isBot: zod.ZodBoolean;
503
+ languageCode: zod.ZodNullable<zod.ZodString>;
504
+ createdAt: zod.ZodDate;
505
+ updatedAt: zod.ZodDate;
506
+ }, zod_v4_core0.$strip>>;
507
+ createdAt: zod.ZodDate;
508
+ updatedAt: zod.ZodDate;
509
+ }, zod_v4_core0.$strip>>;
510
+ }, zod_v4_core0.$strip>, "chat_not_found", string>;
511
+ useChatMessages: _fragno_dev_core_client0.FragnoClientHookData<"GET", "/chats/:chatId/messages", zod.ZodObject<{
512
+ messages: zod.ZodArray<zod.ZodObject<{
513
+ id: zod.ZodString;
514
+ chatId: zod.ZodString;
515
+ fromUserId: zod.ZodNullable<zod.ZodString>;
516
+ senderChatId: zod.ZodNullable<zod.ZodString>;
517
+ replyToMessageId: zod.ZodNullable<zod.ZodString>;
518
+ messageType: zod.ZodEnum<{
519
+ message: "message";
520
+ edited_message: "edited_message";
521
+ channel_post: "channel_post";
522
+ }>;
523
+ text: zod.ZodNullable<zod.ZodString>;
524
+ payload: zod.ZodNullable<zod.ZodUnknown>;
525
+ sentAt: zod.ZodDate;
526
+ editedAt: zod.ZodNullable<zod.ZodDate>;
527
+ commandName: zod.ZodNullable<zod.ZodString>;
528
+ fromUser: zod.ZodNullable<zod.ZodObject<{
529
+ id: zod.ZodString;
530
+ username: zod.ZodNullable<zod.ZodString>;
531
+ firstName: zod.ZodString;
532
+ lastName: zod.ZodNullable<zod.ZodString>;
533
+ isBot: zod.ZodBoolean;
534
+ languageCode: zod.ZodNullable<zod.ZodString>;
535
+ createdAt: zod.ZodDate;
536
+ updatedAt: zod.ZodDate;
537
+ }, zod_v4_core0.$strip>>;
538
+ }, zod_v4_core0.$strip>>;
539
+ cursor: zod.ZodOptional<zod.ZodString>;
540
+ hasNextPage: zod.ZodBoolean;
541
+ }, zod_v4_core0.$strip>, string, "pageSize" | "cursor" | "order">;
542
+ useChatAction: _fragno_dev_core_client0.FragnoClientMutatorData<_fragno_dev_core_api0.NonGetHTTPMethod, "/chats/:chatId/actions", zod.ZodObject<{
543
+ action: zod.ZodEnum<{
544
+ typing: "typing";
545
+ upload_photo: "upload_photo";
546
+ record_video: "record_video";
547
+ upload_video: "upload_video";
548
+ record_voice: "record_voice";
549
+ upload_voice: "upload_voice";
550
+ upload_document: "upload_document";
551
+ choose_sticker: "choose_sticker";
552
+ find_location: "find_location";
553
+ record_video_note: "record_video_note";
554
+ upload_video_note: "upload_video_note";
555
+ }>;
556
+ }, zod_v4_core0.$strip> | undefined, zod.ZodObject<{
557
+ ok: zod.ZodBoolean;
558
+ }, zod_v4_core0.$strip> | undefined, "TELEGRAM_API_ERROR", string>;
559
+ useSendMessage: _fragno_dev_core_client0.FragnoClientMutatorData<_fragno_dev_core_api0.NonGetHTTPMethod, "/chats/:chatId/send", zod.ZodObject<{
560
+ text: zod.ZodString;
561
+ parseMode: zod.ZodOptional<zod.ZodEnum<{
562
+ MarkdownV2: "MarkdownV2";
563
+ Markdown: "Markdown";
564
+ HTML: "HTML";
565
+ }>>;
566
+ disableWebPagePreview: zod.ZodOptional<zod.ZodBoolean>;
567
+ replyToMessageId: zod.ZodOptional<zod.ZodCoercedNumber<unknown>>;
568
+ }, zod_v4_core0.$strip> | undefined, zod.ZodObject<{
569
+ ok: zod.ZodBoolean;
570
+ queued: zod.ZodBoolean;
571
+ }, zod_v4_core0.$strip> | undefined, string, string>;
572
+ useEditMessage: _fragno_dev_core_client0.FragnoClientMutatorData<_fragno_dev_core_api0.NonGetHTTPMethod, "/chats/:chatId/messages/:messageId/edit", zod.ZodObject<{
573
+ text: zod.ZodString;
574
+ parseMode: zod.ZodOptional<zod.ZodEnum<{
575
+ MarkdownV2: "MarkdownV2";
576
+ Markdown: "Markdown";
577
+ HTML: "HTML";
578
+ }>>;
579
+ disableWebPagePreview: zod.ZodOptional<zod.ZodBoolean>;
580
+ }, zod_v4_core0.$strip> | undefined, zod.ZodObject<{
581
+ ok: zod.ZodBoolean;
582
+ queued: zod.ZodBoolean;
583
+ }, zod_v4_core0.$strip> | undefined, "INVALID_MESSAGE_ID", string>;
584
+ };
585
+ //#endregion
586
+ export { type FragnoRouteConfig, type TelegramApi, type TelegramApiResult, type TelegramChatMemberHookPayload, type TelegramChatMemberSummary, type TelegramChatSummary, type TelegramChatType, type TelegramCommandApi, type TelegramCommandApiResult, type TelegramCommandBinding, type TelegramCommandBindings, type TelegramCommandContext, type TelegramCommandDefinition, type TelegramCommandRegistry, type TelegramCommandScope, type TelegramConfigBuilder, type TelegramFragmentConfig, type TelegramHooks, type TelegramMessage, type TelegramMessageHookPayload, type TelegramMessageSummary, type TelegramQueuedResult, type TelegramUpdate, type TelegramUpdateType, type TelegramUser, type TelegramUserSummary, createTelegram, createTelegramFragment, createTelegramFragmentClients, defineCommand, telegramFragmentDefinition, telegramRoutesFactory, telegramSchema };
587
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;iBAYgB,sBAAA,CACd,MAAA,EAAQ,sBAAA,EACR,YAAA,EAAc,8BAAA,qBAA8B,0BAAA,6BAAA,iBAAA,kCAAA,SAAA;aAAA,GAAA,CAAA,SAAA;;;;;MAAA,GAAA,CAAA,UAAA;;;UAAA,GAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAwDmkxB,sBAAA,CAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;6BAAszF,MAAA;EAAA;cAAA,sBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA/Cv52B,6BAAA,CAA8B,YAAA,GAAc,wBAAA;;;YAA6B,GAAA,CAAA,SAAA"}