@prajwalshete/telegram-plugin 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/LICENSE +21 -0
  3. package/README.md +109 -2
  4. package/dist/adapters/clock.d.ts +3 -0
  5. package/dist/adapters/clock.js +4 -0
  6. package/dist/adapters/console-log.d.ts +13 -0
  7. package/dist/adapters/console-log.js +41 -0
  8. package/dist/adapters/d1-db.d.ts +5 -0
  9. package/dist/adapters/d1-db.js +37 -0
  10. package/dist/adapters/ids.d.ts +5 -0
  11. package/dist/adapters/ids.js +25 -0
  12. package/dist/adapters/index.d.ts +7 -0
  13. package/dist/adapters/keyring.d.ts +50 -0
  14. package/dist/adapters/keyring.js +174 -0
  15. package/dist/adapters/metrics.d.ts +28 -0
  16. package/dist/adapters/metrics.js +48 -0
  17. package/dist/adapters/r2-files.d.ts +20 -0
  18. package/dist/adapters/r2-files.js +53 -0
  19. package/dist/bin/cli.d.ts +1 -0
  20. package/dist/bin/cli.js +45 -0
  21. package/dist/client/broadcasts.d.ts +35 -0
  22. package/dist/client/commands.d.ts +23 -0
  23. package/dist/client/endpoint.d.ts +34 -0
  24. package/dist/client/events.d.ts +33 -0
  25. package/dist/client/index.d.ts +11 -0
  26. package/dist/client/index.js +3 -0
  27. package/dist/client/schedules.d.ts +42 -0
  28. package/dist/client/schema.d.ts +181 -0
  29. package/dist/client/send.d.ts +15 -0
  30. package/dist/client/templates.d.ts +47 -0
  31. package/dist/contracts/bots.d.ts +129 -0
  32. package/dist/contracts/bots.js +70 -0
  33. package/dist/contracts/broadcasts.d.ts +116 -0
  34. package/dist/contracts/broadcasts.js +63 -0
  35. package/dist/contracts/chats.d.ts +97 -0
  36. package/dist/contracts/chats.js +66 -0
  37. package/dist/contracts/commands.d.ts +52 -0
  38. package/dist/contracts/commands.js +53 -0
  39. package/dist/contracts/common.d.ts +38 -0
  40. package/dist/contracts/common.js +41 -0
  41. package/dist/contracts/deliveries.d.ts +103 -0
  42. package/dist/contracts/deliveries.js +74 -0
  43. package/dist/contracts/destinations.d.ts +24 -0
  44. package/dist/contracts/destinations.js +28 -0
  45. package/dist/contracts/events.d.ts +165 -0
  46. package/dist/contracts/events.js +98 -0
  47. package/dist/contracts/features.d.ts +20 -0
  48. package/dist/contracts/features.js +21 -0
  49. package/dist/contracts/health.d.ts +55 -0
  50. package/dist/contracts/health.js +58 -0
  51. package/dist/contracts/index.d.ts +22 -0
  52. package/dist/contracts/index.js +22 -0
  53. package/dist/contracts/labels.d.ts +38 -0
  54. package/dist/contracts/labels.js +52 -0
  55. package/dist/contracts/links.d.ts +51 -0
  56. package/dist/contracts/links.js +50 -0
  57. package/dist/contracts/meta.d.ts +132 -0
  58. package/dist/contracts/meta.js +85 -0
  59. package/dist/contracts/permissions.d.ts +24 -0
  60. package/dist/contracts/permissions.js +27 -0
  61. package/dist/contracts/problems.d.ts +106 -0
  62. package/dist/contracts/problems.js +101 -0
  63. package/dist/contracts/recipients.d.ts +36 -0
  64. package/dist/contracts/recipients.js +22 -0
  65. package/dist/contracts/schedules.d.ts +276 -0
  66. package/dist/contracts/schedules.js +143 -0
  67. package/dist/contracts/send.d.ts +126 -0
  68. package/dist/contracts/send.js +69 -0
  69. package/dist/contracts/subscriptions.d.ts +38 -0
  70. package/dist/contracts/subscriptions.js +31 -0
  71. package/dist/contracts/templates.d.ts +358 -0
  72. package/dist/contracts/templates.js +174 -0
  73. package/dist/contracts/users.d.ts +15 -0
  74. package/dist/contracts/users.js +19 -0
  75. package/dist/core/guards.d.ts +22 -0
  76. package/dist/core/guards.js +47 -0
  77. package/dist/core/html/escape.d.ts +2 -0
  78. package/dist/core/html/escape.js +36 -0
  79. package/dist/core/html/tokenize.js +65 -0
  80. package/dist/core/index.d.ts +18 -0
  81. package/dist/core/pacing.d.ts +1 -0
  82. package/dist/core/pacing.js +86 -0
  83. package/dist/core/random.d.ts +2 -0
  84. package/dist/core/random.js +38 -0
  85. package/dist/core/recipients.d.ts +1 -0
  86. package/dist/core/recipients.js +86 -0
  87. package/dist/core/schedule/describe.d.ts +3 -0
  88. package/dist/core/schedule/describe.js +74 -0
  89. package/dist/core/schedule/index.d.ts +4 -0
  90. package/dist/core/schedule/policy.d.ts +1 -0
  91. package/dist/core/schedule/policy.js +37 -0
  92. package/dist/core/schedule/rule.d.ts +25 -0
  93. package/dist/core/schedule/rule.js +142 -0
  94. package/dist/core/schedule/tz.d.ts +2 -0
  95. package/dist/core/schedule/tz.js +59 -0
  96. package/dist/core/split/plain.d.ts +2 -0
  97. package/dist/core/split/plain.js +23 -0
  98. package/dist/core/split/split.d.ts +15 -0
  99. package/dist/core/split/split.js +158 -0
  100. package/dist/core/template/ast.d.ts +58 -0
  101. package/dist/core/template/ast.js +5 -0
  102. package/dist/core/template/expr.js +108 -0
  103. package/dist/core/template/filters.d.ts +20 -0
  104. package/dist/core/template/filters.js +127 -0
  105. package/dist/core/template/format.d.ts +17 -0
  106. package/dist/core/template/format.js +88 -0
  107. package/dist/core/template/index.d.ts +20 -0
  108. package/dist/core/template/index.js +29 -0
  109. package/dist/core/template/parse.d.ts +8 -0
  110. package/dist/core/template/parse.js +369 -0
  111. package/dist/core/template/render.d.ts +17 -0
  112. package/dist/core/template/render.js +118 -0
  113. package/dist/core/template/shape.d.ts +28 -0
  114. package/dist/core/template/shape.js +151 -0
  115. package/dist/core/template/tags.js +105 -0
  116. package/dist/core/template/validate.d.ts +10 -0
  117. package/dist/core/template/validate.js +144 -0
  118. package/dist/core/template/variables.d.ts +15 -0
  119. package/dist/core/template/variables.js +41 -0
  120. package/dist/do/index.d.ts +3 -0
  121. package/dist/do/index.js +3 -0
  122. package/dist/do/telegram-bot-do.d.ts +45 -0
  123. package/dist/do/telegram-bot-do.js +219 -0
  124. package/dist/engine/actions/callback.js +256 -0
  125. package/dist/engine/actions/tokens.d.ts +2 -0
  126. package/dist/engine/actions/tokens.js +51 -0
  127. package/dist/engine/bot-api.js +20 -0
  128. package/dist/engine/bot-features.js +39 -0
  129. package/dist/engine/chat-state.js +66 -0
  130. package/dist/engine/content/audience.js +54 -0
  131. package/dist/engine/content/buttons.d.ts +1 -0
  132. package/dist/engine/content/buttons.js +113 -0
  133. package/dist/engine/content/fanout.js +284 -0
  134. package/dist/engine/content/intersect.d.ts +6 -0
  135. package/dist/engine/content/intersect.js +26 -0
  136. package/dist/engine/content/providers.d.ts +6 -0
  137. package/dist/engine/content/providers.js +142 -0
  138. package/dist/engine/content/recipients.js +128 -0
  139. package/dist/engine/content/render.js +138 -0
  140. package/dist/engine/content/reply.js +156 -0
  141. package/dist/engine/content/report-files.js +78 -0
  142. package/dist/engine/content/template-rows.js +74 -0
  143. package/dist/engine/dialogs/dialog.d.ts +2 -0
  144. package/dist/engine/dialogs/dialog.js +375 -0
  145. package/dist/engine/dispatch/builtins.js +198 -0
  146. package/dist/engine/dispatch/commands.js +194 -0
  147. package/dist/engine/dispatch/context.d.ts +2 -0
  148. package/dist/engine/dispatch/context.js +194 -0
  149. package/dist/engine/dispatch/dispatcher.js +66 -0
  150. package/dist/engine/dispatch/handlers.d.ts +1 -0
  151. package/dist/engine/dispatch/handlers.js +103 -0
  152. package/dist/engine/dispatch/lifecycle.js +85 -0
  153. package/dist/engine/dispatch/link-chat.js +31 -0
  154. package/dist/engine/dispatch/linking.js +273 -0
  155. package/dist/engine/errors.d.ts +60 -0
  156. package/dist/engine/errors.js +72 -0
  157. package/dist/engine/events/filters.d.ts +5 -0
  158. package/dist/engine/events/filters.js +82 -0
  159. package/dist/engine/events/kick.js +30 -0
  160. package/dist/engine/events/payload.d.ts +3 -0
  161. package/dist/engine/events/payload.js +16 -0
  162. package/dist/engine/events/tick.js +208 -0
  163. package/dist/engine/i18n.d.ts +12 -0
  164. package/dist/engine/i18n.js +55 -0
  165. package/dist/engine/inbound/files.js +121 -0
  166. package/dist/engine/inbound/handler.js +46 -0
  167. package/dist/engine/jobs.d.ts +32 -0
  168. package/dist/engine/jobs.js +85 -0
  169. package/dist/engine/link-codes.js +46 -0
  170. package/dist/engine/metrics.js +12 -0
  171. package/dist/engine/options.d.ts +369 -0
  172. package/dist/engine/options.js +81 -0
  173. package/dist/engine/outbox/dead-letter.js +78 -0
  174. package/dist/engine/outbox/do-registry.d.ts +10 -0
  175. package/dist/engine/outbox/do-registry.js +10 -0
  176. package/dist/engine/outbox/do-transport.d.ts +33 -0
  177. package/dist/engine/outbox/do-transport.js +73 -0
  178. package/dist/engine/outbox/drain.d.ts +13 -0
  179. package/dist/engine/outbox/drain.js +381 -0
  180. package/dist/engine/outbox/enqueue.d.ts +1 -0
  181. package/dist/engine/outbox/enqueue.js +63 -0
  182. package/dist/engine/outbox/select.js +24 -0
  183. package/dist/engine/outbox/send.js +362 -0
  184. package/dist/engine/outbox/transport.d.ts +35 -0
  185. package/dist/engine/outbox/transport.js +175 -0
  186. package/dist/engine/outbox/wake.js +28 -0
  187. package/dist/engine/registry.d.ts +502 -0
  188. package/dist/engine/registry.js +258 -0
  189. package/dist/engine/rows.d.ts +25 -0
  190. package/dist/engine/rows.js +131 -0
  191. package/dist/engine/runtime.d.ts +95 -0
  192. package/dist/engine/runtime.js +149 -0
  193. package/dist/engine/schedules/fire.js +208 -0
  194. package/dist/engine/schedules/resume.js +75 -0
  195. package/dist/engine/schedules/rows.js +69 -0
  196. package/dist/engine/schedules/tick.js +30 -0
  197. package/dist/engine/schedules/wake.js +50 -0
  198. package/dist/engine/state.d.ts +11 -0
  199. package/dist/engine/state.js +78 -0
  200. package/dist/locales/en.js +339 -0
  201. package/dist/locales/en.json +341 -0
  202. package/dist/locales/mr.js +339 -0
  203. package/dist/locales/mr.json +341 -0
  204. package/dist/ports/db.d.ts +22 -0
  205. package/dist/ports/index.d.ts +4 -0
  206. package/dist/ports/ports.d.ts +257 -0
  207. package/dist/ports/sql.d.ts +39 -0
  208. package/dist/ports/sql.js +76 -0
  209. package/dist/renderers/csv.d.ts +14 -0
  210. package/dist/renderers/csv.js +51 -0
  211. package/dist/renderers/html.d.ts +44 -0
  212. package/dist/renderers/html.js +81 -0
  213. package/dist/renderers/index.d.ts +5 -0
  214. package/dist/renderers/index.js +4 -0
  215. package/dist/renderers/table.d.ts +30 -0
  216. package/dist/renderers/table.js +114 -0
  217. package/dist/routes/admin.js +146 -0
  218. package/dist/routes/app.d.ts +3111 -0
  219. package/dist/routes/app.js +9 -0
  220. package/dist/routes/broadcasts.js +37 -0
  221. package/dist/routes/commands.js +35 -0
  222. package/dist/routes/content.js +12 -0
  223. package/dist/routes/events.js +36 -0
  224. package/dist/routes/http.d.ts +30 -0
  225. package/dist/routes/http.js +223 -0
  226. package/dist/routes/me.js +59 -0
  227. package/dist/routes/schedules.js +62 -0
  228. package/dist/routes/send.js +24 -0
  229. package/dist/routes/templates.js +70 -0
  230. package/dist/routes/webhook.js +147 -0
  231. package/dist/schema/columns.js +307 -0
  232. package/dist/schema/ddl.d.ts +7 -0
  233. package/dist/schema/ddl.js +45 -0
  234. package/dist/schema/index.d.ts +4255 -0
  235. package/dist/schema/index.js +44 -0
  236. package/dist/schema/reference.sql +359 -0
  237. package/dist/schema/tables.d.ts +4243 -0
  238. package/dist/schema/tables.js +327 -0
  239. package/dist/schema/version.d.ts +5 -0
  240. package/dist/schema/version.js +7 -0
  241. package/dist/server/index.d.ts +55 -0
  242. package/dist/server/index.js +46 -0
  243. package/dist/server/plugin.d.ts +81 -0
  244. package/dist/server/plugin.js +247 -0
  245. package/dist/server/version.d.ts +2 -0
  246. package/dist/server/version.js +4 -0
  247. package/dist/services/ai-tool.d.ts +26 -0
  248. package/dist/services/ai-tool.js +148 -0
  249. package/dist/services/bots.js +300 -0
  250. package/dist/services/broadcasts.js +390 -0
  251. package/dist/services/chats.js +83 -0
  252. package/dist/services/cleanup.js +83 -0
  253. package/dist/services/commands.js +140 -0
  254. package/dist/services/deliveries.js +53 -0
  255. package/dist/services/destinations.js +91 -0
  256. package/dist/services/event-rules.js +229 -0
  257. package/dist/services/events.js +20 -0
  258. package/dist/services/idempotency.js +64 -0
  259. package/dist/services/links.js +200 -0
  260. package/dist/services/menu.js +95 -0
  261. package/dist/services/ops.js +90 -0
  262. package/dist/services/rekey.js +63 -0
  263. package/dist/services/reports.js +87 -0
  264. package/dist/services/schedules.js +214 -0
  265. package/dist/services/send.d.ts +14 -0
  266. package/dist/services/send.js +421 -0
  267. package/dist/services/subscriptions.js +28 -0
  268. package/dist/services/templates.js +259 -0
  269. package/dist/telegram/classify.d.ts +30 -0
  270. package/dist/telegram/classify.js +164 -0
  271. package/dist/telegram/client.d.ts +73 -0
  272. package/dist/telegram/client.js +135 -0
  273. package/dist/telegram/errors.d.ts +37 -0
  274. package/dist/telegram/errors.js +62 -0
  275. package/dist/telegram/inbound.d.ts +40 -0
  276. package/dist/telegram/inbound.js +72 -0
  277. package/dist/telegram/index.d.ts +8 -0
  278. package/dist/telegram/multipart.d.ts +5 -0
  279. package/dist/telegram/multipart.js +47 -0
  280. package/dist/telegram/types.d.ts +271 -0
  281. package/dist/telegram/update.d.ts +833 -0
  282. package/dist/telegram/update.js +129 -0
  283. package/dist/testing/fake-html.d.ts +9 -0
  284. package/dist/testing/fake-html.js +83 -0
  285. package/dist/testing/fake-telegram.d.ts +206 -0
  286. package/dist/testing/fake-telegram.js +856 -0
  287. package/dist/testing/index.d.ts +7 -0
  288. package/dist/testing/index.js +7 -0
  289. package/dist/testing/reference-sql.d.ts +4 -0
  290. package/dist/testing/reference-sql.js +8 -0
  291. package/dist/testing/test-plugin.d.ts +126 -0
  292. package/dist/testing/test-plugin.js +182 -0
  293. package/dist/testing/updates.d.ts +100 -0
  294. package/dist/testing/updates.js +212 -0
  295. package/package.json +113 -3
@@ -0,0 +1,3111 @@
1
+ import { PluginMeta } from "../contracts/meta.js";
2
+ import { RouteDeps, TgEnv } from "./http.js";
3
+ export declare function buildRoutes(deps: RouteDeps, meta: () => PluginMeta): import("hono/hono-base").HonoBase<TgEnv, import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<import("hono/types").BlankSchema, "/"> | import("hono/types").MergeSchemaPath<({
4
+ "/admin/meta": {
5
+ $get: {
6
+ input: {};
7
+ output: {
8
+ permissions: string[];
9
+ pluginVersion: string;
10
+ schemaVersion: number;
11
+ features: {
12
+ core: {
13
+ enabled: boolean;
14
+ };
15
+ commands: {
16
+ enabled: boolean;
17
+ };
18
+ templates: {
19
+ enabled: boolean;
20
+ };
21
+ schedules: {
22
+ enabled: boolean;
23
+ };
24
+ reports: {
25
+ enabled: boolean;
26
+ };
27
+ events: {
28
+ enabled: boolean;
29
+ };
30
+ broadcasts: {
31
+ enabled: boolean;
32
+ };
33
+ actions: {
34
+ enabled: boolean;
35
+ };
36
+ dialogs: {
37
+ enabled: boolean;
38
+ };
39
+ inbound: {
40
+ enabled: boolean;
41
+ };
42
+ subscriptions: {
43
+ enabled: boolean;
44
+ };
45
+ ai: {
46
+ enabled: boolean;
47
+ };
48
+ ops: {
49
+ enabled: boolean;
50
+ };
51
+ };
52
+ locales: string[];
53
+ defaultLocale: string;
54
+ timezone: string;
55
+ providers: {
56
+ key: string;
57
+ label: {
58
+ [x: string]: string;
59
+ };
60
+ permission: string | null;
61
+ params: {
62
+ [x: string]: import("hono/utils/types").JSONValue;
63
+ };
64
+ variables: {
65
+ [x: string]: import("hono/utils/types").JSONValue;
66
+ };
67
+ hasSample: boolean;
68
+ }[];
69
+ commands: {
70
+ command: string;
71
+ description: {
72
+ [x: string]: string;
73
+ };
74
+ builtin: boolean;
75
+ permission: string | null;
76
+ scope: ("private" | "group" | "supergroup" | "channel")[];
77
+ }[];
78
+ events: {
79
+ key: string;
80
+ label: {
81
+ [x: string]: string;
82
+ };
83
+ payload: {
84
+ [x: string]: import("hono/utils/types").JSONValue;
85
+ };
86
+ filterable: string[];
87
+ }[];
88
+ actions: {
89
+ key: string;
90
+ permission: string | null;
91
+ confirm: boolean;
92
+ }[];
93
+ dialogs: {
94
+ key: string;
95
+ permission: string | null;
96
+ steps: string[];
97
+ }[];
98
+ audiences: {
99
+ key: string;
100
+ label: {
101
+ [x: string]: string;
102
+ };
103
+ }[];
104
+ fileSources: string[];
105
+ renderers: string[];
106
+ filters: {
107
+ name: string;
108
+ builtin: boolean;
109
+ minArgs: number;
110
+ maxArgs: number | null;
111
+ }[];
112
+ userSearch: boolean;
113
+ };
114
+ outputFormat: "json";
115
+ status: import("hono/utils/http-status").ContentfulStatusCode;
116
+ };
117
+ };
118
+ } & {
119
+ "/admin/bots": {
120
+ $get: {
121
+ input: {
122
+ query: {
123
+ limit: string | string[];
124
+ cursor?: string | undefined;
125
+ };
126
+ };
127
+ output: {
128
+ items: {
129
+ id: string;
130
+ name: string;
131
+ username: string;
132
+ tgBotId: string;
133
+ mode: "webhook" | "polling";
134
+ status: "active" | "disabled" | "invalid_token" | "webhook_error";
135
+ statusDetail: string | null;
136
+ checkedAt: number | null;
137
+ defaultLocale: string;
138
+ features: {
139
+ core?: boolean | undefined;
140
+ commands?: boolean | undefined;
141
+ templates?: boolean | undefined;
142
+ schedules?: boolean | undefined;
143
+ reports?: boolean | undefined;
144
+ events?: boolean | undefined;
145
+ broadcasts?: boolean | undefined;
146
+ actions?: boolean | undefined;
147
+ dialogs?: boolean | undefined;
148
+ inbound?: boolean | undefined;
149
+ subscriptions?: boolean | undefined;
150
+ ai?: boolean | undefined;
151
+ ops?: boolean | undefined;
152
+ };
153
+ ratePerSec: number;
154
+ pausedUntil: number | null;
155
+ createdAt: number;
156
+ updatedAt: number;
157
+ }[];
158
+ next: string | null;
159
+ };
160
+ outputFormat: "json";
161
+ status: import("hono/utils/http-status").ContentfulStatusCode;
162
+ };
163
+ };
164
+ } & {
165
+ "/admin/bots": {
166
+ $post: {
167
+ input: {
168
+ json: {
169
+ name: string;
170
+ token: string;
171
+ defaultLocale?: string | undefined;
172
+ };
173
+ };
174
+ output: {
175
+ id: string;
176
+ name: string;
177
+ username: string;
178
+ tgBotId: string;
179
+ mode: "webhook" | "polling";
180
+ status: "active" | "disabled" | "invalid_token" | "webhook_error";
181
+ statusDetail: string | null;
182
+ checkedAt: number | null;
183
+ defaultLocale: string;
184
+ features: {
185
+ core?: boolean | undefined;
186
+ commands?: boolean | undefined;
187
+ templates?: boolean | undefined;
188
+ schedules?: boolean | undefined;
189
+ reports?: boolean | undefined;
190
+ events?: boolean | undefined;
191
+ broadcasts?: boolean | undefined;
192
+ actions?: boolean | undefined;
193
+ dialogs?: boolean | undefined;
194
+ inbound?: boolean | undefined;
195
+ subscriptions?: boolean | undefined;
196
+ ai?: boolean | undefined;
197
+ ops?: boolean | undefined;
198
+ };
199
+ ratePerSec: number;
200
+ pausedUntil: number | null;
201
+ createdAt: number;
202
+ updatedAt: number;
203
+ };
204
+ outputFormat: "json";
205
+ status: 201;
206
+ };
207
+ };
208
+ } & {
209
+ "/admin/bots/:id": {
210
+ $get: {
211
+ input: {
212
+ param: {
213
+ id: string;
214
+ };
215
+ };
216
+ output: {
217
+ id: string;
218
+ name: string;
219
+ username: string;
220
+ tgBotId: string;
221
+ mode: "webhook" | "polling";
222
+ status: "active" | "disabled" | "invalid_token" | "webhook_error";
223
+ statusDetail: string | null;
224
+ checkedAt: number | null;
225
+ defaultLocale: string;
226
+ features: {
227
+ core?: boolean | undefined;
228
+ commands?: boolean | undefined;
229
+ templates?: boolean | undefined;
230
+ schedules?: boolean | undefined;
231
+ reports?: boolean | undefined;
232
+ events?: boolean | undefined;
233
+ broadcasts?: boolean | undefined;
234
+ actions?: boolean | undefined;
235
+ dialogs?: boolean | undefined;
236
+ inbound?: boolean | undefined;
237
+ subscriptions?: boolean | undefined;
238
+ ai?: boolean | undefined;
239
+ ops?: boolean | undefined;
240
+ };
241
+ ratePerSec: number;
242
+ pausedUntil: number | null;
243
+ createdAt: number;
244
+ updatedAt: number;
245
+ };
246
+ outputFormat: "json";
247
+ status: import("hono/utils/http-status").ContentfulStatusCode;
248
+ };
249
+ };
250
+ } & {
251
+ "/admin/bots/:id": {
252
+ $patch: {
253
+ input: {
254
+ json: {
255
+ name?: string | undefined;
256
+ defaultLocale?: string | undefined;
257
+ features?: Partial<Record<"core" | "commands" | "templates" | "schedules" | "reports" | "events" | "broadcasts" | "actions" | "dialogs" | "inbound" | "subscriptions" | "ai" | "ops", boolean>> | undefined;
258
+ ratePerSec?: number | undefined;
259
+ enabled?: boolean | undefined;
260
+ };
261
+ } & {
262
+ param: {
263
+ id: string;
264
+ };
265
+ };
266
+ output: {
267
+ id: string;
268
+ name: string;
269
+ username: string;
270
+ tgBotId: string;
271
+ mode: "webhook" | "polling";
272
+ status: "active" | "disabled" | "invalid_token" | "webhook_error";
273
+ statusDetail: string | null;
274
+ checkedAt: number | null;
275
+ defaultLocale: string;
276
+ features: {
277
+ core?: boolean | undefined;
278
+ commands?: boolean | undefined;
279
+ templates?: boolean | undefined;
280
+ schedules?: boolean | undefined;
281
+ reports?: boolean | undefined;
282
+ events?: boolean | undefined;
283
+ broadcasts?: boolean | undefined;
284
+ actions?: boolean | undefined;
285
+ dialogs?: boolean | undefined;
286
+ inbound?: boolean | undefined;
287
+ subscriptions?: boolean | undefined;
288
+ ai?: boolean | undefined;
289
+ ops?: boolean | undefined;
290
+ };
291
+ ratePerSec: number;
292
+ pausedUntil: number | null;
293
+ createdAt: number;
294
+ updatedAt: number;
295
+ };
296
+ outputFormat: "json";
297
+ status: import("hono/utils/http-status").ContentfulStatusCode;
298
+ };
299
+ };
300
+ } & {
301
+ "/admin/bots/:id": {
302
+ $delete: {
303
+ input: {
304
+ param: {
305
+ id: string;
306
+ };
307
+ };
308
+ output: {
309
+ ok: true;
310
+ };
311
+ outputFormat: "json";
312
+ status: import("hono/utils/http-status").ContentfulStatusCode;
313
+ };
314
+ };
315
+ } & {
316
+ "/admin/bots/:id/test": {
317
+ $post: {
318
+ input: {
319
+ param: {
320
+ id: string;
321
+ };
322
+ };
323
+ output: {
324
+ ok: boolean;
325
+ status: "active" | "disabled" | "invalid_token" | "webhook_error";
326
+ username: string | null;
327
+ webhookUrlSet: boolean;
328
+ pendingUpdateCount: number | null;
329
+ lastErrorAt: number | null;
330
+ lastErrorMessage: string | null;
331
+ };
332
+ outputFormat: "json";
333
+ status: import("hono/utils/http-status").ContentfulStatusCode;
334
+ };
335
+ };
336
+ } & {
337
+ "/admin/bots/:id/rotate-token": {
338
+ $post: {
339
+ input: {
340
+ json: {
341
+ token: string;
342
+ };
343
+ } & {
344
+ param: {
345
+ id: string;
346
+ };
347
+ };
348
+ output: {
349
+ id: string;
350
+ name: string;
351
+ username: string;
352
+ tgBotId: string;
353
+ mode: "webhook" | "polling";
354
+ status: "active" | "disabled" | "invalid_token" | "webhook_error";
355
+ statusDetail: string | null;
356
+ checkedAt: number | null;
357
+ defaultLocale: string;
358
+ features: {
359
+ core?: boolean | undefined;
360
+ commands?: boolean | undefined;
361
+ templates?: boolean | undefined;
362
+ schedules?: boolean | undefined;
363
+ reports?: boolean | undefined;
364
+ events?: boolean | undefined;
365
+ broadcasts?: boolean | undefined;
366
+ actions?: boolean | undefined;
367
+ dialogs?: boolean | undefined;
368
+ inbound?: boolean | undefined;
369
+ subscriptions?: boolean | undefined;
370
+ ai?: boolean | undefined;
371
+ ops?: boolean | undefined;
372
+ };
373
+ ratePerSec: number;
374
+ pausedUntil: number | null;
375
+ createdAt: number;
376
+ updatedAt: number;
377
+ };
378
+ outputFormat: "json";
379
+ status: import("hono/utils/http-status").ContentfulStatusCode;
380
+ };
381
+ };
382
+ } & {
383
+ "/admin/bots/:id/webhook/reset": {
384
+ $post: {
385
+ input: {
386
+ param: {
387
+ id: string;
388
+ };
389
+ };
390
+ output: {
391
+ id: string;
392
+ name: string;
393
+ username: string;
394
+ tgBotId: string;
395
+ mode: "webhook" | "polling";
396
+ status: "active" | "disabled" | "invalid_token" | "webhook_error";
397
+ statusDetail: string | null;
398
+ checkedAt: number | null;
399
+ defaultLocale: string;
400
+ features: {
401
+ core?: boolean | undefined;
402
+ commands?: boolean | undefined;
403
+ templates?: boolean | undefined;
404
+ schedules?: boolean | undefined;
405
+ reports?: boolean | undefined;
406
+ events?: boolean | undefined;
407
+ broadcasts?: boolean | undefined;
408
+ actions?: boolean | undefined;
409
+ dialogs?: boolean | undefined;
410
+ inbound?: boolean | undefined;
411
+ subscriptions?: boolean | undefined;
412
+ ai?: boolean | undefined;
413
+ ops?: boolean | undefined;
414
+ };
415
+ ratePerSec: number;
416
+ pausedUntil: number | null;
417
+ createdAt: number;
418
+ updatedAt: number;
419
+ };
420
+ outputFormat: "json";
421
+ status: import("hono/utils/http-status").ContentfulStatusCode;
422
+ };
423
+ };
424
+ } & {
425
+ "/admin/chats": {
426
+ $get: {
427
+ input: {
428
+ query: {
429
+ limit: string | string[];
430
+ bot?: string | undefined;
431
+ kind?: "private" | "group" | "supergroup" | "channel" | undefined;
432
+ status?: "active" | "pending" | "blocked" | "left" | "migrated" | undefined;
433
+ user?: string | undefined;
434
+ cursor?: string | undefined;
435
+ };
436
+ };
437
+ output: {
438
+ items: {
439
+ id: string;
440
+ botId: string;
441
+ chatId: string;
442
+ kind: "private" | "group" | "supergroup" | "channel";
443
+ title: string | null;
444
+ username: string | null;
445
+ userId: string | null;
446
+ audience: {
447
+ role: string;
448
+ } | {
449
+ users: string[];
450
+ } | null;
451
+ status: "active" | "pending" | "blocked" | "left" | "migrated";
452
+ locale: string | null;
453
+ timezone: string | null;
454
+ topics: {
455
+ [x: string]: number;
456
+ };
457
+ linkedBy: string | null;
458
+ linkedAt: number | null;
459
+ updatedAt: number;
460
+ }[];
461
+ next: string | null;
462
+ };
463
+ outputFormat: "json";
464
+ status: import("hono/utils/http-status").ContentfulStatusCode;
465
+ };
466
+ };
467
+ } & {
468
+ "/admin/chats/:id": {
469
+ $get: {
470
+ input: {
471
+ param: {
472
+ id: string;
473
+ };
474
+ };
475
+ output: {
476
+ id: string;
477
+ botId: string;
478
+ chatId: string;
479
+ kind: "private" | "group" | "supergroup" | "channel";
480
+ title: string | null;
481
+ username: string | null;
482
+ userId: string | null;
483
+ audience: {
484
+ role: string;
485
+ } | {
486
+ users: string[];
487
+ } | null;
488
+ status: "active" | "pending" | "blocked" | "left" | "migrated";
489
+ locale: string | null;
490
+ timezone: string | null;
491
+ topics: {
492
+ [x: string]: number;
493
+ };
494
+ linkedBy: string | null;
495
+ linkedAt: number | null;
496
+ updatedAt: number;
497
+ };
498
+ outputFormat: "json";
499
+ status: import("hono/utils/http-status").ContentfulStatusCode;
500
+ };
501
+ };
502
+ } & {
503
+ "/admin/chats/:id": {
504
+ $patch: {
505
+ input: {
506
+ json: {
507
+ audience?: {
508
+ role: string;
509
+ } | {
510
+ users: string[];
511
+ } | null | undefined;
512
+ locale?: string | null | undefined;
513
+ timezone?: string | null | undefined;
514
+ topics?: Record<string, number> | undefined;
515
+ };
516
+ } & {
517
+ param: {
518
+ id: string;
519
+ };
520
+ };
521
+ output: {
522
+ id: string;
523
+ botId: string;
524
+ chatId: string;
525
+ kind: "private" | "group" | "supergroup" | "channel";
526
+ title: string | null;
527
+ username: string | null;
528
+ userId: string | null;
529
+ audience: {
530
+ role: string;
531
+ } | {
532
+ users: string[];
533
+ } | null;
534
+ status: "active" | "pending" | "blocked" | "left" | "migrated";
535
+ locale: string | null;
536
+ timezone: string | null;
537
+ topics: {
538
+ [x: string]: number;
539
+ };
540
+ linkedBy: string | null;
541
+ linkedAt: number | null;
542
+ updatedAt: number;
543
+ };
544
+ outputFormat: "json";
545
+ status: import("hono/utils/http-status").ContentfulStatusCode;
546
+ };
547
+ };
548
+ } & {
549
+ "/admin/chats/:id": {
550
+ $delete: {
551
+ input: {
552
+ param: {
553
+ id: string;
554
+ };
555
+ };
556
+ output: {
557
+ ok: true;
558
+ };
559
+ outputFormat: "json";
560
+ status: import("hono/utils/http-status").ContentfulStatusCode;
561
+ };
562
+ };
563
+ } & {
564
+ "/admin/chats/:id/subscriptions": {
565
+ $get: {
566
+ input: {
567
+ param: {
568
+ id: string;
569
+ };
570
+ };
571
+ output: {
572
+ items: {
573
+ chatRef: string;
574
+ topic: string;
575
+ muted: boolean;
576
+ quiet: {
577
+ from: string;
578
+ to: string;
579
+ tz?: string | undefined;
580
+ } | null;
581
+ updatedAt: number;
582
+ }[];
583
+ };
584
+ outputFormat: "json";
585
+ status: import("hono/utils/http-status").ContentfulStatusCode;
586
+ };
587
+ };
588
+ } & {
589
+ "/admin/chats/:id/subscriptions": {
590
+ $put: {
591
+ input: {
592
+ json: {
593
+ chatRef: string;
594
+ items: {
595
+ topic: string;
596
+ muted: boolean;
597
+ quiet: {
598
+ from: string;
599
+ to: string;
600
+ tz?: string | undefined;
601
+ } | null;
602
+ }[];
603
+ };
604
+ } & {
605
+ param: {
606
+ id: string;
607
+ };
608
+ };
609
+ output: {
610
+ items: {
611
+ chatRef: string;
612
+ topic: string;
613
+ muted: boolean;
614
+ quiet: {
615
+ from: string;
616
+ to: string;
617
+ tz?: string | undefined;
618
+ } | null;
619
+ updatedAt: number;
620
+ }[];
621
+ };
622
+ outputFormat: "json";
623
+ status: import("hono/utils/http-status").ContentfulStatusCode;
624
+ };
625
+ };
626
+ } & {
627
+ "/admin/users": {
628
+ $get: {
629
+ input: {
630
+ query: {
631
+ q: string | string[];
632
+ limit: string | string[];
633
+ };
634
+ };
635
+ output: {
636
+ items: {
637
+ locale?: string | undefined;
638
+ id: string;
639
+ name: string;
640
+ role: string | null;
641
+ }[];
642
+ };
643
+ outputFormat: "json";
644
+ status: import("hono/utils/http-status").ContentfulStatusCode;
645
+ };
646
+ };
647
+ } & {
648
+ "/admin/links": {
649
+ $post: {
650
+ input: {
651
+ json: {
652
+ bot: string;
653
+ purpose: "user";
654
+ userId: string;
655
+ } | {
656
+ bot: string;
657
+ purpose: "group";
658
+ audience: {
659
+ role: string;
660
+ } | {
661
+ users: string[];
662
+ };
663
+ };
664
+ };
665
+ output: {
666
+ url: string;
667
+ qrPayload: string;
668
+ expiresAt: number;
669
+ requiresConfirmation: boolean;
670
+ };
671
+ outputFormat: "json";
672
+ status: 201;
673
+ };
674
+ };
675
+ } & {
676
+ "/admin/destinations": {
677
+ $get: {
678
+ input: {
679
+ query: {
680
+ limit: string | string[];
681
+ cursor?: string | undefined;
682
+ };
683
+ };
684
+ output: {
685
+ items: {
686
+ id: string;
687
+ name: string;
688
+ slug: string;
689
+ botId: string;
690
+ chatRef: string;
691
+ messageThreadId: number | null;
692
+ aiAllowed: boolean;
693
+ createdAt: number;
694
+ }[];
695
+ next: string | null;
696
+ };
697
+ outputFormat: "json";
698
+ status: import("hono/utils/http-status").ContentfulStatusCode;
699
+ };
700
+ };
701
+ } & {
702
+ "/admin/destinations": {
703
+ $post: {
704
+ input: {
705
+ json: {
706
+ name: string;
707
+ slug: string;
708
+ chatRef: string;
709
+ messageThreadId: number | null;
710
+ aiAllowed: boolean;
711
+ };
712
+ };
713
+ output: {
714
+ id: string;
715
+ name: string;
716
+ slug: string;
717
+ botId: string;
718
+ chatRef: string;
719
+ messageThreadId: number | null;
720
+ aiAllowed: boolean;
721
+ createdAt: number;
722
+ };
723
+ outputFormat: "json";
724
+ status: 201;
725
+ };
726
+ };
727
+ } & {
728
+ "/admin/destinations/:id": {
729
+ $get: {
730
+ input: {
731
+ param: {
732
+ id: string;
733
+ };
734
+ };
735
+ output: {
736
+ id: string;
737
+ name: string;
738
+ slug: string;
739
+ botId: string;
740
+ chatRef: string;
741
+ messageThreadId: number | null;
742
+ aiAllowed: boolean;
743
+ createdAt: number;
744
+ };
745
+ outputFormat: "json";
746
+ status: import("hono/utils/http-status").ContentfulStatusCode;
747
+ };
748
+ };
749
+ } & {
750
+ "/admin/destinations/:id": {
751
+ $put: {
752
+ input: {
753
+ json: {
754
+ name: string;
755
+ slug: string;
756
+ chatRef: string;
757
+ messageThreadId: number | null;
758
+ aiAllowed: boolean;
759
+ };
760
+ } & {
761
+ param: {
762
+ id: string;
763
+ };
764
+ };
765
+ output: {
766
+ id: string;
767
+ name: string;
768
+ slug: string;
769
+ botId: string;
770
+ chatRef: string;
771
+ messageThreadId: number | null;
772
+ aiAllowed: boolean;
773
+ createdAt: number;
774
+ };
775
+ outputFormat: "json";
776
+ status: import("hono/utils/http-status").ContentfulStatusCode;
777
+ };
778
+ };
779
+ } & {
780
+ "/admin/destinations/:id": {
781
+ $delete: {
782
+ input: {
783
+ param: {
784
+ id: string;
785
+ };
786
+ };
787
+ output: {
788
+ ok: true;
789
+ };
790
+ outputFormat: "json";
791
+ status: import("hono/utils/http-status").ContentfulStatusCode;
792
+ };
793
+ };
794
+ } & {
795
+ "/admin/deliveries": {
796
+ $get: {
797
+ input: {
798
+ query: {
799
+ limit: string | string[];
800
+ status?: "queued" | "sending" | "sent" | "failed" | "dropped" | "cancelled" | undefined;
801
+ source?: "command" | "schedule" | "event" | "broadcast" | "ai" | "api" | "system" | undefined;
802
+ bot?: string | undefined;
803
+ cursor?: string | undefined;
804
+ };
805
+ };
806
+ output: {
807
+ items: {
808
+ id: string;
809
+ botId: string;
810
+ chatRef: string;
811
+ messageThreadId: number | null;
812
+ source: "command" | "schedule" | "event" | "broadcast" | "ai" | "api" | "system";
813
+ sourceId: string | null;
814
+ kind: "text" | "document" | "photo" | "edit" | "delete";
815
+ bodyHtml: string | null;
816
+ part: number;
817
+ parts: number;
818
+ fileName: string | null;
819
+ status: "queued" | "sending" | "sent" | "failed" | "dropped" | "cancelled";
820
+ attempts: number;
821
+ nextAttemptAt: number | null;
822
+ tgMessageId: number | null;
823
+ errorCode: string | null;
824
+ errorDetail: string | null;
825
+ createdAt: number;
826
+ sentAt: number | null;
827
+ }[];
828
+ next: string | null;
829
+ };
830
+ outputFormat: "json";
831
+ status: import("hono/utils/http-status").ContentfulStatusCode;
832
+ };
833
+ };
834
+ } & {
835
+ "/admin/deliveries/:id": {
836
+ $get: {
837
+ input: {
838
+ param: {
839
+ id: string;
840
+ };
841
+ };
842
+ output: {
843
+ id: string;
844
+ botId: string;
845
+ chatRef: string;
846
+ messageThreadId: number | null;
847
+ source: "command" | "schedule" | "event" | "broadcast" | "ai" | "api" | "system";
848
+ sourceId: string | null;
849
+ kind: "text" | "document" | "photo" | "edit" | "delete";
850
+ bodyHtml: string | null;
851
+ part: number;
852
+ parts: number;
853
+ fileName: string | null;
854
+ status: "queued" | "sending" | "sent" | "failed" | "dropped" | "cancelled";
855
+ attempts: number;
856
+ nextAttemptAt: number | null;
857
+ tgMessageId: number | null;
858
+ errorCode: string | null;
859
+ errorDetail: string | null;
860
+ createdAt: number;
861
+ sentAt: number | null;
862
+ };
863
+ outputFormat: "json";
864
+ status: import("hono/utils/http-status").ContentfulStatusCode;
865
+ };
866
+ };
867
+ } & {
868
+ "/admin/deliveries/:id/retry": {
869
+ $post: {
870
+ input: {
871
+ param: {
872
+ id: string;
873
+ };
874
+ };
875
+ output: {
876
+ id: string;
877
+ botId: string;
878
+ chatRef: string;
879
+ messageThreadId: number | null;
880
+ source: "command" | "schedule" | "event" | "broadcast" | "ai" | "api" | "system";
881
+ sourceId: string | null;
882
+ kind: "text" | "document" | "photo" | "edit" | "delete";
883
+ bodyHtml: string | null;
884
+ part: number;
885
+ parts: number;
886
+ fileName: string | null;
887
+ status: "queued" | "sending" | "sent" | "failed" | "dropped" | "cancelled";
888
+ attempts: number;
889
+ nextAttemptAt: number | null;
890
+ tgMessageId: number | null;
891
+ errorCode: string | null;
892
+ errorDetail: string | null;
893
+ createdAt: number;
894
+ sentAt: number | null;
895
+ };
896
+ outputFormat: "json";
897
+ status: import("hono/utils/http-status").ContentfulStatusCode;
898
+ };
899
+ };
900
+ } & {
901
+ "/admin/deliveries/:id/cancel": {
902
+ $post: {
903
+ input: {
904
+ param: {
905
+ id: string;
906
+ };
907
+ };
908
+ output: {
909
+ id: string;
910
+ botId: string;
911
+ chatRef: string;
912
+ messageThreadId: number | null;
913
+ source: "command" | "schedule" | "event" | "broadcast" | "ai" | "api" | "system";
914
+ sourceId: string | null;
915
+ kind: "text" | "document" | "photo" | "edit" | "delete";
916
+ bodyHtml: string | null;
917
+ part: number;
918
+ parts: number;
919
+ fileName: string | null;
920
+ status: "queued" | "sending" | "sent" | "failed" | "dropped" | "cancelled";
921
+ attempts: number;
922
+ nextAttemptAt: number | null;
923
+ tgMessageId: number | null;
924
+ errorCode: string | null;
925
+ errorDetail: string | null;
926
+ createdAt: number;
927
+ sentAt: number | null;
928
+ };
929
+ outputFormat: "json";
930
+ status: import("hono/utils/http-status").ContentfulStatusCode;
931
+ };
932
+ };
933
+ } & {
934
+ "/admin/health": {
935
+ $get: {
936
+ input: {};
937
+ output: {
938
+ ok: boolean;
939
+ lastTickAt: number | null;
940
+ tickStale: boolean;
941
+ deliveries: {
942
+ queued: number;
943
+ failed24h: number;
944
+ oldestQueuedAgeMs: number | null;
945
+ };
946
+ schedules: {
947
+ stuckRuns: number;
948
+ runStuckFailed24h: number;
949
+ };
950
+ bots: {
951
+ id: string;
952
+ username: string;
953
+ status: "active" | "disabled" | "invalid_token" | "webhook_error";
954
+ pendingUpdateCount: number | null;
955
+ }[];
956
+ keyring: {
957
+ activeKid: string | null;
958
+ rowsByKid: {
959
+ [x: string]: number;
960
+ };
961
+ };
962
+ schema: {
963
+ required: number;
964
+ current: number | null;
965
+ ok: boolean;
966
+ };
967
+ };
968
+ outputFormat: "json";
969
+ status: import("hono/utils/http-status").ContentfulStatusCode;
970
+ };
971
+ };
972
+ } & {
973
+ "/admin/stats": {
974
+ $get: {
975
+ input: {
976
+ query: {
977
+ from: string | string[];
978
+ to: string | string[];
979
+ };
980
+ };
981
+ output: {
982
+ from: number;
983
+ to: number;
984
+ sent: number;
985
+ failed: number;
986
+ dropped: number;
987
+ rateLimited: number;
988
+ bySource: {
989
+ [x: string]: number;
990
+ };
991
+ updates: number;
992
+ };
993
+ outputFormat: "json";
994
+ status: import("hono/utils/http-status").ContentfulStatusCode;
995
+ };
996
+ };
997
+ }) | import("hono/types").MergeSchemaPath<import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<{
998
+ "/admin/templates": {
999
+ $get: {
1000
+ input: {
1001
+ query: {
1002
+ limit: string | string[];
1003
+ kind?: "message" | "report" | undefined;
1004
+ cursor?: string | undefined;
1005
+ };
1006
+ };
1007
+ output: {
1008
+ items: {
1009
+ id: string;
1010
+ key: string;
1011
+ name: string;
1012
+ kind: "message" | "report";
1013
+ provider: string | null;
1014
+ providerParams: {
1015
+ [x: string]: import("hono/utils/types").JSONValue;
1016
+ } | null;
1017
+ body: {
1018
+ [x: string]: string;
1019
+ };
1020
+ format: "text" | "html";
1021
+ report: {
1022
+ renderer: "pdf" | "csv";
1023
+ fileName: string;
1024
+ layout?: {
1025
+ [x: string]: import("hono/utils/types").JSONValue;
1026
+ } | undefined;
1027
+ } | null;
1028
+ buttons: {
1029
+ text: {
1030
+ [x: string]: string;
1031
+ };
1032
+ action?: string | undefined;
1033
+ params?: {
1034
+ [x: string]: import("hono/utils/types").JSONValue;
1035
+ } | undefined;
1036
+ url?: string | undefined;
1037
+ style?: "success" | "primary" | "danger" | undefined;
1038
+ disabled?: boolean | undefined;
1039
+ }[][] | null;
1040
+ options: {
1041
+ silent?: boolean | undefined;
1042
+ protectContent?: boolean | undefined;
1043
+ linkPreview?: boolean | undefined;
1044
+ };
1045
+ version: number;
1046
+ updatedBy: string | null;
1047
+ updatedAt: number;
1048
+ }[];
1049
+ next: string | null;
1050
+ };
1051
+ outputFormat: "json";
1052
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1053
+ };
1054
+ };
1055
+ } & {
1056
+ "/admin/templates": {
1057
+ $post: {
1058
+ input: {
1059
+ json: {
1060
+ key: string;
1061
+ name: string;
1062
+ kind: "message" | "report";
1063
+ provider: string | null;
1064
+ providerParams: Record<string, unknown> | null;
1065
+ body: Record<string, string>;
1066
+ format: "text" | "html";
1067
+ report: {
1068
+ renderer: "pdf" | "csv";
1069
+ fileName: string;
1070
+ layout?: Record<string, unknown> | undefined;
1071
+ } | null;
1072
+ buttons: {
1073
+ text: Record<string, string>;
1074
+ action?: string | undefined;
1075
+ params?: Record<string, unknown> | undefined;
1076
+ url?: string | undefined;
1077
+ style?: "success" | "primary" | "danger" | undefined;
1078
+ disabled?: boolean | undefined;
1079
+ }[][] | null;
1080
+ options: {
1081
+ silent?: boolean | undefined;
1082
+ protectContent?: boolean | undefined;
1083
+ linkPreview?: boolean | undefined;
1084
+ };
1085
+ };
1086
+ };
1087
+ output: {
1088
+ id: string;
1089
+ key: string;
1090
+ name: string;
1091
+ kind: "message" | "report";
1092
+ provider: string | null;
1093
+ providerParams: {
1094
+ [x: string]: import("hono/utils/types").JSONValue;
1095
+ } | null;
1096
+ body: {
1097
+ [x: string]: string;
1098
+ };
1099
+ format: "text" | "html";
1100
+ report: {
1101
+ renderer: "pdf" | "csv";
1102
+ fileName: string;
1103
+ layout?: {
1104
+ [x: string]: import("hono/utils/types").JSONValue;
1105
+ } | undefined;
1106
+ } | null;
1107
+ buttons: {
1108
+ text: {
1109
+ [x: string]: string;
1110
+ };
1111
+ action?: string | undefined;
1112
+ params?: {
1113
+ [x: string]: import("hono/utils/types").JSONValue;
1114
+ } | undefined;
1115
+ url?: string | undefined;
1116
+ style?: "success" | "primary" | "danger" | undefined;
1117
+ disabled?: boolean | undefined;
1118
+ }[][] | null;
1119
+ options: {
1120
+ silent?: boolean | undefined;
1121
+ protectContent?: boolean | undefined;
1122
+ linkPreview?: boolean | undefined;
1123
+ };
1124
+ version: number;
1125
+ updatedBy: string | null;
1126
+ updatedAt: number;
1127
+ };
1128
+ outputFormat: "json";
1129
+ status: 201;
1130
+ };
1131
+ };
1132
+ } & {
1133
+ "/admin/templates/preview": {
1134
+ $post: {
1135
+ input: {
1136
+ json: {
1137
+ as: {
1138
+ role: string;
1139
+ } | {
1140
+ userId: string;
1141
+ };
1142
+ locale: string;
1143
+ templateId?: string | undefined;
1144
+ source?: string | undefined;
1145
+ buttons?: {
1146
+ text: Record<string, string>;
1147
+ action?: string | undefined;
1148
+ params?: Record<string, unknown> | undefined;
1149
+ url?: string | undefined;
1150
+ style?: "success" | "primary" | "danger" | undefined;
1151
+ disabled?: boolean | undefined;
1152
+ }[][] | undefined;
1153
+ format?: "text" | "html" | undefined;
1154
+ provider?: string | undefined;
1155
+ params?: Record<string, unknown> | undefined;
1156
+ sample?: boolean | undefined;
1157
+ };
1158
+ };
1159
+ output: {
1160
+ parts: string[];
1161
+ buttons: {
1162
+ text: string;
1163
+ kind: "action" | "url";
1164
+ url: string | null;
1165
+ style: "success" | "primary" | "danger" | null;
1166
+ disabled: boolean;
1167
+ }[][] | null;
1168
+ file: {
1169
+ name: string;
1170
+ mime: string;
1171
+ size: number | null;
1172
+ } | null;
1173
+ warnings: {
1174
+ line: number;
1175
+ column: number;
1176
+ message: string;
1177
+ locale?: string | undefined;
1178
+ }[];
1179
+ };
1180
+ outputFormat: "json";
1181
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1182
+ };
1183
+ };
1184
+ } & {
1185
+ "/admin/templates/:id": {
1186
+ $get: {
1187
+ input: {
1188
+ param: {
1189
+ id: string;
1190
+ };
1191
+ };
1192
+ output: {
1193
+ id: string;
1194
+ key: string;
1195
+ name: string;
1196
+ kind: "message" | "report";
1197
+ provider: string | null;
1198
+ providerParams: {
1199
+ [x: string]: import("hono/utils/types").JSONValue;
1200
+ } | null;
1201
+ body: {
1202
+ [x: string]: string;
1203
+ };
1204
+ format: "text" | "html";
1205
+ report: {
1206
+ renderer: "pdf" | "csv";
1207
+ fileName: string;
1208
+ layout?: {
1209
+ [x: string]: import("hono/utils/types").JSONValue;
1210
+ } | undefined;
1211
+ } | null;
1212
+ buttons: {
1213
+ text: {
1214
+ [x: string]: string;
1215
+ };
1216
+ action?: string | undefined;
1217
+ params?: {
1218
+ [x: string]: import("hono/utils/types").JSONValue;
1219
+ } | undefined;
1220
+ url?: string | undefined;
1221
+ style?: "success" | "primary" | "danger" | undefined;
1222
+ disabled?: boolean | undefined;
1223
+ }[][] | null;
1224
+ options: {
1225
+ silent?: boolean | undefined;
1226
+ protectContent?: boolean | undefined;
1227
+ linkPreview?: boolean | undefined;
1228
+ };
1229
+ version: number;
1230
+ updatedBy: string | null;
1231
+ updatedAt: number;
1232
+ };
1233
+ outputFormat: "json";
1234
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1235
+ };
1236
+ };
1237
+ } & {
1238
+ "/admin/templates/:id": {
1239
+ $put: {
1240
+ input: {
1241
+ json: {
1242
+ key: string;
1243
+ name: string;
1244
+ kind: "message" | "report";
1245
+ provider: string | null;
1246
+ providerParams: Record<string, unknown> | null;
1247
+ body: Record<string, string>;
1248
+ format: "text" | "html";
1249
+ report: {
1250
+ renderer: "pdf" | "csv";
1251
+ fileName: string;
1252
+ layout?: Record<string, unknown> | undefined;
1253
+ } | null;
1254
+ buttons: {
1255
+ text: Record<string, string>;
1256
+ action?: string | undefined;
1257
+ params?: Record<string, unknown> | undefined;
1258
+ url?: string | undefined;
1259
+ style?: "success" | "primary" | "danger" | undefined;
1260
+ disabled?: boolean | undefined;
1261
+ }[][] | null;
1262
+ options: {
1263
+ silent?: boolean | undefined;
1264
+ protectContent?: boolean | undefined;
1265
+ linkPreview?: boolean | undefined;
1266
+ };
1267
+ };
1268
+ } & {
1269
+ param: {
1270
+ id: string;
1271
+ };
1272
+ };
1273
+ output: {
1274
+ id: string;
1275
+ key: string;
1276
+ name: string;
1277
+ kind: "message" | "report";
1278
+ provider: string | null;
1279
+ providerParams: {
1280
+ [x: string]: import("hono/utils/types").JSONValue;
1281
+ } | null;
1282
+ body: {
1283
+ [x: string]: string;
1284
+ };
1285
+ format: "text" | "html";
1286
+ report: {
1287
+ renderer: "pdf" | "csv";
1288
+ fileName: string;
1289
+ layout?: {
1290
+ [x: string]: import("hono/utils/types").JSONValue;
1291
+ } | undefined;
1292
+ } | null;
1293
+ buttons: {
1294
+ text: {
1295
+ [x: string]: string;
1296
+ };
1297
+ action?: string | undefined;
1298
+ params?: {
1299
+ [x: string]: import("hono/utils/types").JSONValue;
1300
+ } | undefined;
1301
+ url?: string | undefined;
1302
+ style?: "success" | "primary" | "danger" | undefined;
1303
+ disabled?: boolean | undefined;
1304
+ }[][] | null;
1305
+ options: {
1306
+ silent?: boolean | undefined;
1307
+ protectContent?: boolean | undefined;
1308
+ linkPreview?: boolean | undefined;
1309
+ };
1310
+ version: number;
1311
+ updatedBy: string | null;
1312
+ updatedAt: number;
1313
+ };
1314
+ outputFormat: "json";
1315
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1316
+ };
1317
+ };
1318
+ } & {
1319
+ "/admin/templates/:id": {
1320
+ $delete: {
1321
+ input: {
1322
+ param: {
1323
+ id: string;
1324
+ };
1325
+ };
1326
+ output: {
1327
+ ok: true;
1328
+ };
1329
+ outputFormat: "json";
1330
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1331
+ };
1332
+ };
1333
+ } & {
1334
+ "/admin/templates/:id/versions": {
1335
+ $get: {
1336
+ input: {
1337
+ param: {
1338
+ id: string;
1339
+ };
1340
+ };
1341
+ output: {
1342
+ items: {
1343
+ templateId: string;
1344
+ version: number;
1345
+ body: {
1346
+ [x: string]: string;
1347
+ };
1348
+ report: {
1349
+ renderer: "pdf" | "csv";
1350
+ fileName: string;
1351
+ layout?: {
1352
+ [x: string]: import("hono/utils/types").JSONValue;
1353
+ } | undefined;
1354
+ } | null;
1355
+ buttons: {
1356
+ text: {
1357
+ [x: string]: string;
1358
+ };
1359
+ action?: string | undefined;
1360
+ params?: {
1361
+ [x: string]: import("hono/utils/types").JSONValue;
1362
+ } | undefined;
1363
+ url?: string | undefined;
1364
+ style?: "success" | "primary" | "danger" | undefined;
1365
+ disabled?: boolean | undefined;
1366
+ }[][] | null;
1367
+ savedBy: string | null;
1368
+ savedAt: number;
1369
+ }[];
1370
+ };
1371
+ outputFormat: "json";
1372
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1373
+ };
1374
+ };
1375
+ } & {
1376
+ "/admin/templates/:id/restore/:version": {
1377
+ $post: {
1378
+ input: {
1379
+ param: {
1380
+ id: string;
1381
+ } & {
1382
+ version: string;
1383
+ };
1384
+ };
1385
+ output: {
1386
+ id: string;
1387
+ key: string;
1388
+ name: string;
1389
+ kind: "message" | "report";
1390
+ provider: string | null;
1391
+ providerParams: {
1392
+ [x: string]: import("hono/utils/types").JSONValue;
1393
+ } | null;
1394
+ body: {
1395
+ [x: string]: string;
1396
+ };
1397
+ format: "text" | "html";
1398
+ report: {
1399
+ renderer: "pdf" | "csv";
1400
+ fileName: string;
1401
+ layout?: {
1402
+ [x: string]: import("hono/utils/types").JSONValue;
1403
+ } | undefined;
1404
+ } | null;
1405
+ buttons: {
1406
+ text: {
1407
+ [x: string]: string;
1408
+ };
1409
+ action?: string | undefined;
1410
+ params?: {
1411
+ [x: string]: import("hono/utils/types").JSONValue;
1412
+ } | undefined;
1413
+ url?: string | undefined;
1414
+ style?: "success" | "primary" | "danger" | undefined;
1415
+ disabled?: boolean | undefined;
1416
+ }[][] | null;
1417
+ options: {
1418
+ silent?: boolean | undefined;
1419
+ protectContent?: boolean | undefined;
1420
+ linkPreview?: boolean | undefined;
1421
+ };
1422
+ version: number;
1423
+ updatedBy: string | null;
1424
+ updatedAt: number;
1425
+ };
1426
+ outputFormat: "json";
1427
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1428
+ };
1429
+ };
1430
+ } & {
1431
+ "/admin/reports/render": {
1432
+ $post: {
1433
+ input: {
1434
+ json: {
1435
+ template: string;
1436
+ as: {
1437
+ role: string;
1438
+ } | {
1439
+ userId: string;
1440
+ };
1441
+ params?: Record<string, unknown> | undefined;
1442
+ format?: "pdf" | "csv" | undefined;
1443
+ locale?: string | undefined;
1444
+ };
1445
+ };
1446
+ output: {};
1447
+ outputFormat: string;
1448
+ status: import("hono/utils/http-status").StatusCode;
1449
+ };
1450
+ };
1451
+ }, "/"> | import("hono/types").MergeSchemaPath<{
1452
+ "/admin/bots/:id/commands": {
1453
+ $get: {
1454
+ input: {
1455
+ param: {
1456
+ id: string;
1457
+ };
1458
+ };
1459
+ output: {
1460
+ items: {
1461
+ command: string;
1462
+ builtin: boolean;
1463
+ enabled: boolean;
1464
+ roles: string[] | null;
1465
+ defaultRoles: string[];
1466
+ aliases: string[];
1467
+ description: {
1468
+ [x: string]: string;
1469
+ };
1470
+ showInMenu: boolean;
1471
+ sort: number;
1472
+ scope: ("private" | "group" | "supergroup" | "channel")[];
1473
+ permission: string | null;
1474
+ }[];
1475
+ };
1476
+ outputFormat: "json";
1477
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1478
+ };
1479
+ };
1480
+ } & {
1481
+ "/admin/bots/:id/commands/sync": {
1482
+ $post: {
1483
+ input: {
1484
+ param: {
1485
+ id: string;
1486
+ };
1487
+ };
1488
+ output: {
1489
+ synced: boolean;
1490
+ calls: number;
1491
+ failed: number;
1492
+ };
1493
+ outputFormat: "json";
1494
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1495
+ };
1496
+ };
1497
+ } & {
1498
+ "/admin/bots/:id/commands/:command": {
1499
+ $put: {
1500
+ input: {
1501
+ json: {
1502
+ enabled?: boolean | undefined;
1503
+ roles?: string[] | null | undefined;
1504
+ aliases?: string[] | undefined;
1505
+ description?: Record<string, string> | null | undefined;
1506
+ showInMenu?: boolean | undefined;
1507
+ sort?: number | undefined;
1508
+ };
1509
+ } & {
1510
+ param: {
1511
+ id: string;
1512
+ } & {
1513
+ command: string;
1514
+ };
1515
+ };
1516
+ output: {
1517
+ command: string;
1518
+ builtin: boolean;
1519
+ enabled: boolean;
1520
+ roles: string[] | null;
1521
+ defaultRoles: string[];
1522
+ aliases: string[];
1523
+ description: {
1524
+ [x: string]: string;
1525
+ };
1526
+ showInMenu: boolean;
1527
+ sort: number;
1528
+ scope: ("private" | "group" | "supergroup" | "channel")[];
1529
+ permission: string | null;
1530
+ };
1531
+ outputFormat: "json";
1532
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1533
+ };
1534
+ };
1535
+ }, "/"> | import("hono/types").MergeSchemaPath<{
1536
+ "/admin/schedules": {
1537
+ $get: {
1538
+ input: {
1539
+ query: {
1540
+ limit: string | string[];
1541
+ cursor?: string | undefined;
1542
+ };
1543
+ };
1544
+ output: {
1545
+ items: {
1546
+ id: string;
1547
+ name: string;
1548
+ rule: {
1549
+ kind: "daily";
1550
+ at: string;
1551
+ } | {
1552
+ kind: "weekly";
1553
+ days: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[];
1554
+ at: string;
1555
+ } | {
1556
+ kind: "monthly";
1557
+ day: number | "last";
1558
+ at: string;
1559
+ } | {
1560
+ kind: "cron";
1561
+ expr: string;
1562
+ } | {
1563
+ kind: "once";
1564
+ at: string;
1565
+ };
1566
+ timezone: string;
1567
+ templateId: string;
1568
+ params: {
1569
+ [x: string]: import("hono/utils/types").JSONValue;
1570
+ } | null;
1571
+ recipients: ({
1572
+ destination: string;
1573
+ } | {
1574
+ chat: string;
1575
+ } | {
1576
+ user: string;
1577
+ } | {
1578
+ role: string;
1579
+ } | {
1580
+ allLinked: true;
1581
+ } | {
1582
+ audience: string;
1583
+ ref: string;
1584
+ })[];
1585
+ personalize: boolean;
1586
+ missedPolicy: "run_once" | "skip";
1587
+ missedGraceMin: number;
1588
+ enabled: boolean;
1589
+ pausedUntil: number | null;
1590
+ nextRunAt: number | null;
1591
+ lastRunAt: number | null;
1592
+ lastStatus: "running" | "failed" | "done" | "partial" | "skipped" | null;
1593
+ createdBy: string | null;
1594
+ createdAt: number;
1595
+ updatedAt: number;
1596
+ }[];
1597
+ next: string | null;
1598
+ };
1599
+ outputFormat: "json";
1600
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1601
+ };
1602
+ };
1603
+ } & {
1604
+ "/admin/schedules": {
1605
+ $post: {
1606
+ input: {
1607
+ json: {
1608
+ name: string;
1609
+ rule: {
1610
+ kind: "daily";
1611
+ at: string;
1612
+ } | {
1613
+ kind: "weekly";
1614
+ days: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[];
1615
+ at: string;
1616
+ } | {
1617
+ kind: "monthly";
1618
+ day: number | "last";
1619
+ at: string;
1620
+ } | {
1621
+ kind: "cron";
1622
+ expr: string;
1623
+ } | {
1624
+ kind: "once";
1625
+ at: string;
1626
+ };
1627
+ templateId: string;
1628
+ params: Record<string, unknown> | null;
1629
+ personalize: boolean;
1630
+ missedPolicy: "run_once" | "skip";
1631
+ missedGraceMin: number;
1632
+ enabled: boolean;
1633
+ recipients: ({
1634
+ destination: string;
1635
+ } | {
1636
+ chat: string;
1637
+ } | {
1638
+ user: string;
1639
+ } | {
1640
+ role: string;
1641
+ } | {
1642
+ allLinked: true;
1643
+ } | {
1644
+ audience: string;
1645
+ ref: string;
1646
+ })[];
1647
+ timezone?: string | undefined;
1648
+ };
1649
+ };
1650
+ output: {
1651
+ id: string;
1652
+ name: string;
1653
+ rule: {
1654
+ kind: "daily";
1655
+ at: string;
1656
+ } | {
1657
+ kind: "weekly";
1658
+ days: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[];
1659
+ at: string;
1660
+ } | {
1661
+ kind: "monthly";
1662
+ day: number | "last";
1663
+ at: string;
1664
+ } | {
1665
+ kind: "cron";
1666
+ expr: string;
1667
+ } | {
1668
+ kind: "once";
1669
+ at: string;
1670
+ };
1671
+ timezone: string;
1672
+ templateId: string;
1673
+ params: {
1674
+ [x: string]: import("hono/utils/types").JSONValue;
1675
+ } | null;
1676
+ recipients: ({
1677
+ destination: string;
1678
+ } | {
1679
+ chat: string;
1680
+ } | {
1681
+ user: string;
1682
+ } | {
1683
+ role: string;
1684
+ } | {
1685
+ allLinked: true;
1686
+ } | {
1687
+ audience: string;
1688
+ ref: string;
1689
+ })[];
1690
+ personalize: boolean;
1691
+ missedPolicy: "run_once" | "skip";
1692
+ missedGraceMin: number;
1693
+ enabled: boolean;
1694
+ pausedUntil: number | null;
1695
+ nextRunAt: number | null;
1696
+ lastRunAt: number | null;
1697
+ lastStatus: "running" | "failed" | "done" | "partial" | "skipped" | null;
1698
+ createdBy: string | null;
1699
+ createdAt: number;
1700
+ updatedAt: number;
1701
+ };
1702
+ outputFormat: "json";
1703
+ status: 201;
1704
+ };
1705
+ };
1706
+ } & {
1707
+ "/admin/schedules/next-runs": {
1708
+ $post: {
1709
+ input: {
1710
+ json: {
1711
+ rule: {
1712
+ kind: "daily";
1713
+ at: string;
1714
+ } | {
1715
+ kind: "weekly";
1716
+ days: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[];
1717
+ at: string;
1718
+ } | {
1719
+ kind: "monthly";
1720
+ day: number | "last";
1721
+ at: string;
1722
+ } | {
1723
+ kind: "cron";
1724
+ expr: string;
1725
+ } | {
1726
+ kind: "once";
1727
+ at: string;
1728
+ };
1729
+ tz: string;
1730
+ count: number;
1731
+ from?: number | undefined;
1732
+ };
1733
+ };
1734
+ output: {
1735
+ runs: number[];
1736
+ };
1737
+ outputFormat: "json";
1738
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1739
+ };
1740
+ };
1741
+ } & {
1742
+ "/admin/schedules/:id": {
1743
+ $get: {
1744
+ input: {
1745
+ param: {
1746
+ id: string;
1747
+ };
1748
+ };
1749
+ output: {
1750
+ id: string;
1751
+ name: string;
1752
+ rule: {
1753
+ kind: "daily";
1754
+ at: string;
1755
+ } | {
1756
+ kind: "weekly";
1757
+ days: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[];
1758
+ at: string;
1759
+ } | {
1760
+ kind: "monthly";
1761
+ day: number | "last";
1762
+ at: string;
1763
+ } | {
1764
+ kind: "cron";
1765
+ expr: string;
1766
+ } | {
1767
+ kind: "once";
1768
+ at: string;
1769
+ };
1770
+ timezone: string;
1771
+ templateId: string;
1772
+ params: {
1773
+ [x: string]: import("hono/utils/types").JSONValue;
1774
+ } | null;
1775
+ recipients: ({
1776
+ destination: string;
1777
+ } | {
1778
+ chat: string;
1779
+ } | {
1780
+ user: string;
1781
+ } | {
1782
+ role: string;
1783
+ } | {
1784
+ allLinked: true;
1785
+ } | {
1786
+ audience: string;
1787
+ ref: string;
1788
+ })[];
1789
+ personalize: boolean;
1790
+ missedPolicy: "run_once" | "skip";
1791
+ missedGraceMin: number;
1792
+ enabled: boolean;
1793
+ pausedUntil: number | null;
1794
+ nextRunAt: number | null;
1795
+ lastRunAt: number | null;
1796
+ lastStatus: "running" | "failed" | "done" | "partial" | "skipped" | null;
1797
+ createdBy: string | null;
1798
+ createdAt: number;
1799
+ updatedAt: number;
1800
+ };
1801
+ outputFormat: "json";
1802
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1803
+ };
1804
+ };
1805
+ } & {
1806
+ "/admin/schedules/:id": {
1807
+ $put: {
1808
+ input: {
1809
+ json: {
1810
+ name: string;
1811
+ rule: {
1812
+ kind: "daily";
1813
+ at: string;
1814
+ } | {
1815
+ kind: "weekly";
1816
+ days: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[];
1817
+ at: string;
1818
+ } | {
1819
+ kind: "monthly";
1820
+ day: number | "last";
1821
+ at: string;
1822
+ } | {
1823
+ kind: "cron";
1824
+ expr: string;
1825
+ } | {
1826
+ kind: "once";
1827
+ at: string;
1828
+ };
1829
+ templateId: string;
1830
+ params: Record<string, unknown> | null;
1831
+ personalize: boolean;
1832
+ missedPolicy: "run_once" | "skip";
1833
+ missedGraceMin: number;
1834
+ enabled: boolean;
1835
+ recipients: ({
1836
+ destination: string;
1837
+ } | {
1838
+ chat: string;
1839
+ } | {
1840
+ user: string;
1841
+ } | {
1842
+ role: string;
1843
+ } | {
1844
+ allLinked: true;
1845
+ } | {
1846
+ audience: string;
1847
+ ref: string;
1848
+ })[];
1849
+ timezone?: string | undefined;
1850
+ };
1851
+ } & {
1852
+ param: {
1853
+ id: string;
1854
+ };
1855
+ };
1856
+ output: {
1857
+ id: string;
1858
+ name: string;
1859
+ rule: {
1860
+ kind: "daily";
1861
+ at: string;
1862
+ } | {
1863
+ kind: "weekly";
1864
+ days: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[];
1865
+ at: string;
1866
+ } | {
1867
+ kind: "monthly";
1868
+ day: number | "last";
1869
+ at: string;
1870
+ } | {
1871
+ kind: "cron";
1872
+ expr: string;
1873
+ } | {
1874
+ kind: "once";
1875
+ at: string;
1876
+ };
1877
+ timezone: string;
1878
+ templateId: string;
1879
+ params: {
1880
+ [x: string]: import("hono/utils/types").JSONValue;
1881
+ } | null;
1882
+ recipients: ({
1883
+ destination: string;
1884
+ } | {
1885
+ chat: string;
1886
+ } | {
1887
+ user: string;
1888
+ } | {
1889
+ role: string;
1890
+ } | {
1891
+ allLinked: true;
1892
+ } | {
1893
+ audience: string;
1894
+ ref: string;
1895
+ })[];
1896
+ personalize: boolean;
1897
+ missedPolicy: "run_once" | "skip";
1898
+ missedGraceMin: number;
1899
+ enabled: boolean;
1900
+ pausedUntil: number | null;
1901
+ nextRunAt: number | null;
1902
+ lastRunAt: number | null;
1903
+ lastStatus: "running" | "failed" | "done" | "partial" | "skipped" | null;
1904
+ createdBy: string | null;
1905
+ createdAt: number;
1906
+ updatedAt: number;
1907
+ };
1908
+ outputFormat: "json";
1909
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1910
+ };
1911
+ };
1912
+ } & {
1913
+ "/admin/schedules/:id": {
1914
+ $delete: {
1915
+ input: {
1916
+ param: {
1917
+ id: string;
1918
+ };
1919
+ };
1920
+ output: {
1921
+ ok: true;
1922
+ };
1923
+ outputFormat: "json";
1924
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1925
+ };
1926
+ };
1927
+ } & {
1928
+ "/admin/schedules/:id/pause": {
1929
+ $post: {
1930
+ input: {
1931
+ param: {
1932
+ id: string;
1933
+ };
1934
+ };
1935
+ output: {
1936
+ id: string;
1937
+ name: string;
1938
+ rule: {
1939
+ kind: "daily";
1940
+ at: string;
1941
+ } | {
1942
+ kind: "weekly";
1943
+ days: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[];
1944
+ at: string;
1945
+ } | {
1946
+ kind: "monthly";
1947
+ day: number | "last";
1948
+ at: string;
1949
+ } | {
1950
+ kind: "cron";
1951
+ expr: string;
1952
+ } | {
1953
+ kind: "once";
1954
+ at: string;
1955
+ };
1956
+ timezone: string;
1957
+ templateId: string;
1958
+ params: {
1959
+ [x: string]: import("hono/utils/types").JSONValue;
1960
+ } | null;
1961
+ recipients: ({
1962
+ destination: string;
1963
+ } | {
1964
+ chat: string;
1965
+ } | {
1966
+ user: string;
1967
+ } | {
1968
+ role: string;
1969
+ } | {
1970
+ allLinked: true;
1971
+ } | {
1972
+ audience: string;
1973
+ ref: string;
1974
+ })[];
1975
+ personalize: boolean;
1976
+ missedPolicy: "run_once" | "skip";
1977
+ missedGraceMin: number;
1978
+ enabled: boolean;
1979
+ pausedUntil: number | null;
1980
+ nextRunAt: number | null;
1981
+ lastRunAt: number | null;
1982
+ lastStatus: "running" | "failed" | "done" | "partial" | "skipped" | null;
1983
+ createdBy: string | null;
1984
+ createdAt: number;
1985
+ updatedAt: number;
1986
+ };
1987
+ outputFormat: "json";
1988
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1989
+ };
1990
+ };
1991
+ } & {
1992
+ "/admin/schedules/:id/resume": {
1993
+ $post: {
1994
+ input: {
1995
+ param: {
1996
+ id: string;
1997
+ };
1998
+ };
1999
+ output: {
2000
+ id: string;
2001
+ name: string;
2002
+ rule: {
2003
+ kind: "daily";
2004
+ at: string;
2005
+ } | {
2006
+ kind: "weekly";
2007
+ days: ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[];
2008
+ at: string;
2009
+ } | {
2010
+ kind: "monthly";
2011
+ day: number | "last";
2012
+ at: string;
2013
+ } | {
2014
+ kind: "cron";
2015
+ expr: string;
2016
+ } | {
2017
+ kind: "once";
2018
+ at: string;
2019
+ };
2020
+ timezone: string;
2021
+ templateId: string;
2022
+ params: {
2023
+ [x: string]: import("hono/utils/types").JSONValue;
2024
+ } | null;
2025
+ recipients: ({
2026
+ destination: string;
2027
+ } | {
2028
+ chat: string;
2029
+ } | {
2030
+ user: string;
2031
+ } | {
2032
+ role: string;
2033
+ } | {
2034
+ allLinked: true;
2035
+ } | {
2036
+ audience: string;
2037
+ ref: string;
2038
+ })[];
2039
+ personalize: boolean;
2040
+ missedPolicy: "run_once" | "skip";
2041
+ missedGraceMin: number;
2042
+ enabled: boolean;
2043
+ pausedUntil: number | null;
2044
+ nextRunAt: number | null;
2045
+ lastRunAt: number | null;
2046
+ lastStatus: "running" | "failed" | "done" | "partial" | "skipped" | null;
2047
+ createdBy: string | null;
2048
+ createdAt: number;
2049
+ updatedAt: number;
2050
+ };
2051
+ outputFormat: "json";
2052
+ status: import("hono/utils/http-status").ContentfulStatusCode;
2053
+ };
2054
+ };
2055
+ } & {
2056
+ "/admin/schedules/:id/run-now": {
2057
+ $post: {
2058
+ input: {
2059
+ param: {
2060
+ id: string;
2061
+ };
2062
+ };
2063
+ output: {
2064
+ id: string;
2065
+ scheduleId: string;
2066
+ slotAt: number;
2067
+ trigger: "schedule" | "manual";
2068
+ startedAt: number;
2069
+ finishedAt: number | null;
2070
+ status: "running" | "failed" | "done" | "partial" | "skipped";
2071
+ deliveries: number;
2072
+ error: string | null;
2073
+ templateVersion: number | null;
2074
+ };
2075
+ outputFormat: "json";
2076
+ status: import("hono/utils/http-status").ContentfulStatusCode;
2077
+ };
2078
+ };
2079
+ } & {
2080
+ "/admin/schedules/:id/runs": {
2081
+ $get: {
2082
+ input: {
2083
+ query: {
2084
+ limit: string | string[];
2085
+ cursor?: string | undefined;
2086
+ };
2087
+ } & {
2088
+ param: {
2089
+ id: string;
2090
+ };
2091
+ };
2092
+ output: {
2093
+ items: {
2094
+ id: string;
2095
+ scheduleId: string;
2096
+ slotAt: number;
2097
+ trigger: "schedule" | "manual";
2098
+ startedAt: number;
2099
+ finishedAt: number | null;
2100
+ status: "running" | "failed" | "done" | "partial" | "skipped";
2101
+ deliveries: number;
2102
+ error: string | null;
2103
+ templateVersion: number | null;
2104
+ }[];
2105
+ next: string | null;
2106
+ };
2107
+ outputFormat: "json";
2108
+ status: import("hono/utils/http-status").ContentfulStatusCode;
2109
+ };
2110
+ };
2111
+ }, "/"> | import("hono/types").MergeSchemaPath<{
2112
+ "/admin/events": {
2113
+ $get: {
2114
+ input: {};
2115
+ output: {
2116
+ items: {
2117
+ key: string;
2118
+ label: {
2119
+ [x: string]: string;
2120
+ };
2121
+ filterable: string[];
2122
+ sensitive: string[];
2123
+ provider: string | null;
2124
+ payloadSchema: {
2125
+ [x: string]: import("hono/utils/types").JSONValue;
2126
+ };
2127
+ }[];
2128
+ };
2129
+ outputFormat: "json";
2130
+ status: import("hono/utils/http-status").ContentfulStatusCode;
2131
+ };
2132
+ };
2133
+ } & {
2134
+ "/admin/event-rules": {
2135
+ $get: {
2136
+ input: {
2137
+ query: {
2138
+ limit: string | string[];
2139
+ event?: string | undefined;
2140
+ cursor?: string | undefined;
2141
+ };
2142
+ };
2143
+ output: {
2144
+ items: {
2145
+ id: string;
2146
+ event: string;
2147
+ name: string;
2148
+ filters: {
2149
+ field: string;
2150
+ op: "in" | "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "contains";
2151
+ value: string | number | boolean | (string | number)[];
2152
+ }[];
2153
+ templateId: string;
2154
+ recipients: ({
2155
+ destination: string;
2156
+ } | {
2157
+ chat: string;
2158
+ } | {
2159
+ user: string;
2160
+ } | {
2161
+ role: string;
2162
+ } | {
2163
+ allLinked: true;
2164
+ } | {
2165
+ audience: string;
2166
+ ref: string;
2167
+ })[];
2168
+ throttle: {
2169
+ perMinutes: number;
2170
+ key?: string | undefined;
2171
+ } | null;
2172
+ enabled: boolean;
2173
+ createdBy: string | null;
2174
+ updatedAt: number;
2175
+ }[];
2176
+ next: string | null;
2177
+ };
2178
+ outputFormat: "json";
2179
+ status: import("hono/utils/http-status").ContentfulStatusCode;
2180
+ };
2181
+ };
2182
+ } & {
2183
+ "/admin/event-rules": {
2184
+ $post: {
2185
+ input: {
2186
+ json: {
2187
+ event: string;
2188
+ name: string;
2189
+ filters: {
2190
+ field: string;
2191
+ op: "in" | "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "contains";
2192
+ value: string | number | boolean | (string | number)[];
2193
+ }[];
2194
+ templateId: string;
2195
+ recipients: ({
2196
+ destination: string;
2197
+ } | {
2198
+ chat: string;
2199
+ } | {
2200
+ user: string;
2201
+ } | {
2202
+ role: string;
2203
+ } | {
2204
+ allLinked: true;
2205
+ } | {
2206
+ audience: string;
2207
+ ref: string;
2208
+ })[];
2209
+ throttle: {
2210
+ perMinutes: number;
2211
+ key?: string | undefined;
2212
+ } | null;
2213
+ enabled: boolean;
2214
+ };
2215
+ };
2216
+ output: {
2217
+ id: string;
2218
+ event: string;
2219
+ name: string;
2220
+ filters: {
2221
+ field: string;
2222
+ op: "in" | "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "contains";
2223
+ value: string | number | boolean | (string | number)[];
2224
+ }[];
2225
+ templateId: string;
2226
+ recipients: ({
2227
+ destination: string;
2228
+ } | {
2229
+ chat: string;
2230
+ } | {
2231
+ user: string;
2232
+ } | {
2233
+ role: string;
2234
+ } | {
2235
+ allLinked: true;
2236
+ } | {
2237
+ audience: string;
2238
+ ref: string;
2239
+ })[];
2240
+ throttle: {
2241
+ perMinutes: number;
2242
+ key?: string | undefined;
2243
+ } | null;
2244
+ enabled: boolean;
2245
+ createdBy: string | null;
2246
+ updatedAt: number;
2247
+ };
2248
+ outputFormat: "json";
2249
+ status: 201;
2250
+ };
2251
+ };
2252
+ } & {
2253
+ "/admin/event-rules/:id": {
2254
+ $get: {
2255
+ input: {
2256
+ param: {
2257
+ id: string;
2258
+ };
2259
+ };
2260
+ output: {
2261
+ id: string;
2262
+ event: string;
2263
+ name: string;
2264
+ filters: {
2265
+ field: string;
2266
+ op: "in" | "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "contains";
2267
+ value: string | number | boolean | (string | number)[];
2268
+ }[];
2269
+ templateId: string;
2270
+ recipients: ({
2271
+ destination: string;
2272
+ } | {
2273
+ chat: string;
2274
+ } | {
2275
+ user: string;
2276
+ } | {
2277
+ role: string;
2278
+ } | {
2279
+ allLinked: true;
2280
+ } | {
2281
+ audience: string;
2282
+ ref: string;
2283
+ })[];
2284
+ throttle: {
2285
+ perMinutes: number;
2286
+ key?: string | undefined;
2287
+ } | null;
2288
+ enabled: boolean;
2289
+ createdBy: string | null;
2290
+ updatedAt: number;
2291
+ };
2292
+ outputFormat: "json";
2293
+ status: import("hono/utils/http-status").ContentfulStatusCode;
2294
+ };
2295
+ };
2296
+ } & {
2297
+ "/admin/event-rules/:id": {
2298
+ $put: {
2299
+ input: {
2300
+ json: {
2301
+ event: string;
2302
+ name: string;
2303
+ filters: {
2304
+ field: string;
2305
+ op: "in" | "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "contains";
2306
+ value: string | number | boolean | (string | number)[];
2307
+ }[];
2308
+ templateId: string;
2309
+ recipients: ({
2310
+ destination: string;
2311
+ } | {
2312
+ chat: string;
2313
+ } | {
2314
+ user: string;
2315
+ } | {
2316
+ role: string;
2317
+ } | {
2318
+ allLinked: true;
2319
+ } | {
2320
+ audience: string;
2321
+ ref: string;
2322
+ })[];
2323
+ throttle: {
2324
+ perMinutes: number;
2325
+ key?: string | undefined;
2326
+ } | null;
2327
+ enabled: boolean;
2328
+ };
2329
+ } & {
2330
+ param: {
2331
+ id: string;
2332
+ };
2333
+ };
2334
+ output: {
2335
+ id: string;
2336
+ event: string;
2337
+ name: string;
2338
+ filters: {
2339
+ field: string;
2340
+ op: "in" | "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "contains";
2341
+ value: string | number | boolean | (string | number)[];
2342
+ }[];
2343
+ templateId: string;
2344
+ recipients: ({
2345
+ destination: string;
2346
+ } | {
2347
+ chat: string;
2348
+ } | {
2349
+ user: string;
2350
+ } | {
2351
+ role: string;
2352
+ } | {
2353
+ allLinked: true;
2354
+ } | {
2355
+ audience: string;
2356
+ ref: string;
2357
+ })[];
2358
+ throttle: {
2359
+ perMinutes: number;
2360
+ key?: string | undefined;
2361
+ } | null;
2362
+ enabled: boolean;
2363
+ createdBy: string | null;
2364
+ updatedAt: number;
2365
+ };
2366
+ outputFormat: "json";
2367
+ status: import("hono/utils/http-status").ContentfulStatusCode;
2368
+ };
2369
+ };
2370
+ } & {
2371
+ "/admin/event-rules/:id": {
2372
+ $delete: {
2373
+ input: {
2374
+ param: {
2375
+ id: string;
2376
+ };
2377
+ };
2378
+ output: {
2379
+ ok: true;
2380
+ };
2381
+ outputFormat: "json";
2382
+ status: import("hono/utils/http-status").ContentfulStatusCode;
2383
+ };
2384
+ };
2385
+ } & {
2386
+ "/admin/event-rules/:id/test": {
2387
+ $post: {
2388
+ input: {
2389
+ json: {
2390
+ payload: unknown;
2391
+ };
2392
+ } & {
2393
+ param: {
2394
+ id: string;
2395
+ };
2396
+ };
2397
+ output: {
2398
+ filtersMatch: boolean;
2399
+ chats: number;
2400
+ deliveries: number;
2401
+ parts: string[];
2402
+ warnings: {
2403
+ line: number;
2404
+ column: number;
2405
+ message: string;
2406
+ locale?: string | undefined;
2407
+ }[];
2408
+ };
2409
+ outputFormat: "json";
2410
+ status: import("hono/utils/http-status").ContentfulStatusCode;
2411
+ };
2412
+ };
2413
+ }, "/"> | import("hono/types").MergeSchemaPath<{
2414
+ "/admin/broadcasts": {
2415
+ $get: {
2416
+ input: {
2417
+ query: {
2418
+ limit: string | string[];
2419
+ status?: "draft" | "queued" | "sending" | "done" | undefined;
2420
+ cursor?: string | undefined;
2421
+ };
2422
+ };
2423
+ output: {
2424
+ items: {
2425
+ id: string;
2426
+ title: string;
2427
+ templateId: string | null;
2428
+ body: {
2429
+ [x: string]: string;
2430
+ } | null;
2431
+ params: {
2432
+ [x: string]: import("hono/utils/types").JSONValue;
2433
+ } | null;
2434
+ file: {
2435
+ source: string;
2436
+ ref: string;
2437
+ } | null;
2438
+ recipients: ({
2439
+ destination: string;
2440
+ } | {
2441
+ chat: string;
2442
+ } | {
2443
+ user: string;
2444
+ } | {
2445
+ role: string;
2446
+ } | {
2447
+ allLinked: true;
2448
+ } | {
2449
+ audience: string;
2450
+ ref: string;
2451
+ })[];
2452
+ status: "draft" | "queued" | "sending" | "done";
2453
+ stats: {
2454
+ total: number;
2455
+ queued: number;
2456
+ sent: number;
2457
+ failed: number;
2458
+ dropped: number;
2459
+ } | null;
2460
+ createdBy: string | null;
2461
+ createdAt: number;
2462
+ sentAt: number | null;
2463
+ }[];
2464
+ next: string | null;
2465
+ };
2466
+ outputFormat: "json";
2467
+ status: import("hono/utils/http-status").ContentfulStatusCode;
2468
+ };
2469
+ };
2470
+ } & {
2471
+ "/admin/broadcasts": {
2472
+ $post: {
2473
+ input: {
2474
+ json: {
2475
+ title: string;
2476
+ templateId: string | null;
2477
+ body: Record<string, string> | null;
2478
+ params: Record<string, unknown> | null;
2479
+ file: {
2480
+ source: string;
2481
+ ref: string;
2482
+ } | null;
2483
+ recipients: ({
2484
+ destination: string;
2485
+ } | {
2486
+ chat: string;
2487
+ } | {
2488
+ user: string;
2489
+ } | {
2490
+ role: string;
2491
+ } | {
2492
+ allLinked: true;
2493
+ } | {
2494
+ audience: string;
2495
+ ref: string;
2496
+ })[];
2497
+ };
2498
+ };
2499
+ output: {
2500
+ id: string;
2501
+ title: string;
2502
+ templateId: string | null;
2503
+ body: {
2504
+ [x: string]: string;
2505
+ } | null;
2506
+ params: {
2507
+ [x: string]: import("hono/utils/types").JSONValue;
2508
+ } | null;
2509
+ file: {
2510
+ source: string;
2511
+ ref: string;
2512
+ } | null;
2513
+ recipients: ({
2514
+ destination: string;
2515
+ } | {
2516
+ chat: string;
2517
+ } | {
2518
+ user: string;
2519
+ } | {
2520
+ role: string;
2521
+ } | {
2522
+ allLinked: true;
2523
+ } | {
2524
+ audience: string;
2525
+ ref: string;
2526
+ })[];
2527
+ status: "draft" | "queued" | "sending" | "done";
2528
+ stats: {
2529
+ total: number;
2530
+ queued: number;
2531
+ sent: number;
2532
+ failed: number;
2533
+ dropped: number;
2534
+ } | null;
2535
+ createdBy: string | null;
2536
+ createdAt: number;
2537
+ sentAt: number | null;
2538
+ };
2539
+ outputFormat: "json";
2540
+ status: 201;
2541
+ };
2542
+ };
2543
+ } & {
2544
+ "/admin/broadcasts/:id": {
2545
+ $get: {
2546
+ input: {
2547
+ param: {
2548
+ id: string;
2549
+ };
2550
+ };
2551
+ output: {
2552
+ id: string;
2553
+ title: string;
2554
+ templateId: string | null;
2555
+ body: {
2556
+ [x: string]: string;
2557
+ } | null;
2558
+ params: {
2559
+ [x: string]: import("hono/utils/types").JSONValue;
2560
+ } | null;
2561
+ file: {
2562
+ source: string;
2563
+ ref: string;
2564
+ } | null;
2565
+ recipients: ({
2566
+ destination: string;
2567
+ } | {
2568
+ chat: string;
2569
+ } | {
2570
+ user: string;
2571
+ } | {
2572
+ role: string;
2573
+ } | {
2574
+ allLinked: true;
2575
+ } | {
2576
+ audience: string;
2577
+ ref: string;
2578
+ })[];
2579
+ status: "draft" | "queued" | "sending" | "done";
2580
+ stats: {
2581
+ total: number;
2582
+ queued: number;
2583
+ sent: number;
2584
+ failed: number;
2585
+ dropped: number;
2586
+ } | null;
2587
+ createdBy: string | null;
2588
+ createdAt: number;
2589
+ sentAt: number | null;
2590
+ };
2591
+ outputFormat: "json";
2592
+ status: import("hono/utils/http-status").ContentfulStatusCode;
2593
+ };
2594
+ };
2595
+ } & {
2596
+ "/admin/broadcasts/:id": {
2597
+ $put: {
2598
+ input: {
2599
+ json: {
2600
+ title: string;
2601
+ templateId: string | null;
2602
+ body: Record<string, string> | null;
2603
+ params: Record<string, unknown> | null;
2604
+ file: {
2605
+ source: string;
2606
+ ref: string;
2607
+ } | null;
2608
+ recipients: ({
2609
+ destination: string;
2610
+ } | {
2611
+ chat: string;
2612
+ } | {
2613
+ user: string;
2614
+ } | {
2615
+ role: string;
2616
+ } | {
2617
+ allLinked: true;
2618
+ } | {
2619
+ audience: string;
2620
+ ref: string;
2621
+ })[];
2622
+ };
2623
+ } & {
2624
+ param: {
2625
+ id: string;
2626
+ };
2627
+ };
2628
+ output: {
2629
+ id: string;
2630
+ title: string;
2631
+ templateId: string | null;
2632
+ body: {
2633
+ [x: string]: string;
2634
+ } | null;
2635
+ params: {
2636
+ [x: string]: import("hono/utils/types").JSONValue;
2637
+ } | null;
2638
+ file: {
2639
+ source: string;
2640
+ ref: string;
2641
+ } | null;
2642
+ recipients: ({
2643
+ destination: string;
2644
+ } | {
2645
+ chat: string;
2646
+ } | {
2647
+ user: string;
2648
+ } | {
2649
+ role: string;
2650
+ } | {
2651
+ allLinked: true;
2652
+ } | {
2653
+ audience: string;
2654
+ ref: string;
2655
+ })[];
2656
+ status: "draft" | "queued" | "sending" | "done";
2657
+ stats: {
2658
+ total: number;
2659
+ queued: number;
2660
+ sent: number;
2661
+ failed: number;
2662
+ dropped: number;
2663
+ } | null;
2664
+ createdBy: string | null;
2665
+ createdAt: number;
2666
+ sentAt: number | null;
2667
+ };
2668
+ outputFormat: "json";
2669
+ status: import("hono/utils/http-status").ContentfulStatusCode;
2670
+ };
2671
+ };
2672
+ } & {
2673
+ "/admin/broadcasts/:id": {
2674
+ $delete: {
2675
+ input: {
2676
+ param: {
2677
+ id: string;
2678
+ };
2679
+ };
2680
+ output: {
2681
+ ok: true;
2682
+ };
2683
+ outputFormat: "json";
2684
+ status: import("hono/utils/http-status").ContentfulStatusCode;
2685
+ };
2686
+ };
2687
+ } & {
2688
+ "/admin/broadcasts/:id/preview": {
2689
+ $post: {
2690
+ input: {
2691
+ json: {
2692
+ as: {
2693
+ role: string;
2694
+ } | {
2695
+ userId: string;
2696
+ };
2697
+ locale: string;
2698
+ sample?: boolean | undefined;
2699
+ };
2700
+ } & {
2701
+ param: {
2702
+ id: string;
2703
+ };
2704
+ };
2705
+ output: {
2706
+ parts: string[];
2707
+ buttons: {
2708
+ text: string;
2709
+ kind: "action" | "url";
2710
+ url: string | null;
2711
+ style: "success" | "primary" | "danger" | null;
2712
+ disabled: boolean;
2713
+ }[][] | null;
2714
+ file: {
2715
+ name: string;
2716
+ mime: string;
2717
+ size: number | null;
2718
+ } | null;
2719
+ warnings: {
2720
+ line: number;
2721
+ column: number;
2722
+ message: string;
2723
+ locale?: string | undefined;
2724
+ }[];
2725
+ };
2726
+ outputFormat: "json";
2727
+ status: import("hono/utils/http-status").ContentfulStatusCode;
2728
+ };
2729
+ };
2730
+ } & {
2731
+ "/admin/broadcasts/:id/send": {
2732
+ $post: {
2733
+ input: {
2734
+ param: {
2735
+ id: string;
2736
+ };
2737
+ };
2738
+ output: {
2739
+ id: string;
2740
+ title: string;
2741
+ templateId: string | null;
2742
+ body: {
2743
+ [x: string]: string;
2744
+ } | null;
2745
+ params: {
2746
+ [x: string]: import("hono/utils/types").JSONValue;
2747
+ } | null;
2748
+ file: {
2749
+ source: string;
2750
+ ref: string;
2751
+ } | null;
2752
+ recipients: ({
2753
+ destination: string;
2754
+ } | {
2755
+ chat: string;
2756
+ } | {
2757
+ user: string;
2758
+ } | {
2759
+ role: string;
2760
+ } | {
2761
+ allLinked: true;
2762
+ } | {
2763
+ audience: string;
2764
+ ref: string;
2765
+ })[];
2766
+ status: "draft" | "queued" | "sending" | "done";
2767
+ stats: {
2768
+ total: number;
2769
+ queued: number;
2770
+ sent: number;
2771
+ failed: number;
2772
+ dropped: number;
2773
+ } | null;
2774
+ createdBy: string | null;
2775
+ createdAt: number;
2776
+ sentAt: number | null;
2777
+ };
2778
+ outputFormat: "json";
2779
+ status: import("hono/utils/http-status").ContentfulStatusCode;
2780
+ };
2781
+ };
2782
+ } & {
2783
+ "/admin/broadcasts/:id/report": {
2784
+ $get: {
2785
+ input: {
2786
+ param: {
2787
+ id: string;
2788
+ };
2789
+ };
2790
+ output: {
2791
+ total: number;
2792
+ queued: number;
2793
+ sent: number;
2794
+ failed: number;
2795
+ dropped: number;
2796
+ };
2797
+ outputFormat: "json";
2798
+ status: import("hono/utils/http-status").ContentfulStatusCode;
2799
+ };
2800
+ };
2801
+ }, "/"> | import("hono/types").MergeSchemaPath<{
2802
+ "/admin/send/preview": {
2803
+ $post: {
2804
+ input: {
2805
+ json: {
2806
+ to: {
2807
+ destination: string;
2808
+ } | {
2809
+ user: string;
2810
+ } | {
2811
+ me: true;
2812
+ };
2813
+ what: {
2814
+ record: {
2815
+ type: string;
2816
+ key: string;
2817
+ fields?: string[] | undefined;
2818
+ };
2819
+ } | {
2820
+ template: string;
2821
+ params?: Record<string, unknown> | undefined;
2822
+ } | {
2823
+ report: string;
2824
+ format: "pdf" | "csv";
2825
+ params?: Record<string, unknown> | undefined;
2826
+ } | {
2827
+ file: {
2828
+ source: string;
2829
+ ref: string;
2830
+ };
2831
+ } | {
2832
+ text: string;
2833
+ };
2834
+ note?: string | undefined;
2835
+ };
2836
+ };
2837
+ output: {
2838
+ to: {
2839
+ name: string;
2840
+ kind: "private" | "group" | "supergroup" | "channel";
2841
+ botUsername: string;
2842
+ destination: string | null;
2843
+ };
2844
+ audience: string;
2845
+ parts: string[];
2846
+ buttons: {
2847
+ text: string;
2848
+ kind: "action" | "url";
2849
+ url: string | null;
2850
+ style: "success" | "primary" | "danger" | null;
2851
+ disabled: boolean;
2852
+ }[][] | null;
2853
+ file: {
2854
+ name: string;
2855
+ mime: string;
2856
+ size: number | null;
2857
+ } | null;
2858
+ attachments: {
2859
+ name: string;
2860
+ mime: string;
2861
+ size: number | null;
2862
+ }[];
2863
+ consequence: string;
2864
+ chats: number;
2865
+ source: "ai" | "api";
2866
+ warnings: string[];
2867
+ };
2868
+ outputFormat: "json";
2869
+ status: import("hono/utils/http-status").ContentfulStatusCode;
2870
+ };
2871
+ };
2872
+ } & {
2873
+ "/admin/send": {
2874
+ $post: {
2875
+ input: {
2876
+ json: {
2877
+ to: {
2878
+ destination: string;
2879
+ } | {
2880
+ user: string;
2881
+ } | {
2882
+ me: true;
2883
+ };
2884
+ what: {
2885
+ record: {
2886
+ type: string;
2887
+ key: string;
2888
+ fields?: string[] | undefined;
2889
+ };
2890
+ } | {
2891
+ template: string;
2892
+ params?: Record<string, unknown> | undefined;
2893
+ } | {
2894
+ report: string;
2895
+ format: "pdf" | "csv";
2896
+ params?: Record<string, unknown> | undefined;
2897
+ } | {
2898
+ file: {
2899
+ source: string;
2900
+ ref: string;
2901
+ };
2902
+ } | {
2903
+ text: string;
2904
+ };
2905
+ note?: string | undefined;
2906
+ };
2907
+ };
2908
+ output: {
2909
+ queued: number;
2910
+ dedupeKey: string;
2911
+ };
2912
+ outputFormat: "json";
2913
+ status: import("hono/utils/http-status").ContentfulStatusCode;
2914
+ };
2915
+ };
2916
+ }, "/">, "/">, "/"> | import("hono/types").MergeSchemaPath<{
2917
+ "/me/link": {
2918
+ $post: {
2919
+ input: {
2920
+ json: {
2921
+ bot: string;
2922
+ };
2923
+ };
2924
+ output: {
2925
+ url: string;
2926
+ qrPayload: string;
2927
+ expiresAt: number;
2928
+ requiresConfirmation: boolean;
2929
+ };
2930
+ outputFormat: "json";
2931
+ status: 201;
2932
+ };
2933
+ };
2934
+ } & {
2935
+ "/me/links/pending": {
2936
+ $get: {
2937
+ input: {};
2938
+ output: {
2939
+ items: {
2940
+ id: string;
2941
+ bot: string;
2942
+ telegramName: string | null;
2943
+ telegramUsername: string | null;
2944
+ invitedBy: string | null;
2945
+ createdAt: number;
2946
+ expiresAt: number;
2947
+ }[];
2948
+ };
2949
+ outputFormat: "json";
2950
+ status: import("hono/utils/http-status").ContentfulStatusCode;
2951
+ };
2952
+ };
2953
+ } & {
2954
+ "/me/links/pending/:id/confirm": {
2955
+ $post: {
2956
+ input: {
2957
+ param: {
2958
+ id: string;
2959
+ };
2960
+ };
2961
+ output: {
2962
+ chat: {
2963
+ id: string;
2964
+ botId: string;
2965
+ chatId: string;
2966
+ kind: "private" | "group" | "supergroup" | "channel";
2967
+ title: string | null;
2968
+ username: string | null;
2969
+ userId: string | null;
2970
+ audience: {
2971
+ role: string;
2972
+ } | {
2973
+ users: string[];
2974
+ } | null;
2975
+ status: "active" | "pending" | "blocked" | "left" | "migrated";
2976
+ locale: string | null;
2977
+ timezone: string | null;
2978
+ topics: {
2979
+ [x: string]: number;
2980
+ };
2981
+ linkedBy: string | null;
2982
+ linkedAt: number | null;
2983
+ updatedAt: number;
2984
+ };
2985
+ };
2986
+ outputFormat: "json";
2987
+ status: import("hono/utils/http-status").ContentfulStatusCode;
2988
+ };
2989
+ };
2990
+ } & {
2991
+ "/me/links/pending/:id/decline": {
2992
+ $post: {
2993
+ input: {
2994
+ param: {
2995
+ id: string;
2996
+ };
2997
+ };
2998
+ output: {
2999
+ ok: true;
3000
+ };
3001
+ outputFormat: "json";
3002
+ status: import("hono/utils/http-status").ContentfulStatusCode;
3003
+ };
3004
+ };
3005
+ } & {
3006
+ "/me/chats": {
3007
+ $get: {
3008
+ input: {};
3009
+ output: {
3010
+ items: {
3011
+ id: string;
3012
+ botId: string;
3013
+ chatId: string;
3014
+ kind: "private" | "group" | "supergroup" | "channel";
3015
+ title: string | null;
3016
+ username: string | null;
3017
+ userId: string | null;
3018
+ audience: {
3019
+ role: string;
3020
+ } | {
3021
+ users: string[];
3022
+ } | null;
3023
+ status: "active" | "pending" | "blocked" | "left" | "migrated";
3024
+ locale: string | null;
3025
+ timezone: string | null;
3026
+ topics: {
3027
+ [x: string]: number;
3028
+ };
3029
+ linkedBy: string | null;
3030
+ linkedAt: number | null;
3031
+ updatedAt: number;
3032
+ }[];
3033
+ next: string | null;
3034
+ };
3035
+ outputFormat: "json";
3036
+ status: import("hono/utils/http-status").ContentfulStatusCode;
3037
+ };
3038
+ };
3039
+ } & {
3040
+ "/me/chats/:id": {
3041
+ $delete: {
3042
+ input: {
3043
+ param: {
3044
+ id: string;
3045
+ };
3046
+ };
3047
+ output: {
3048
+ ok: true;
3049
+ };
3050
+ outputFormat: "json";
3051
+ status: import("hono/utils/http-status").ContentfulStatusCode;
3052
+ };
3053
+ };
3054
+ } & {
3055
+ "/me/subscriptions": {
3056
+ $get: {
3057
+ input: {};
3058
+ output: {
3059
+ items: {
3060
+ chatRef: string;
3061
+ topic: string;
3062
+ muted: boolean;
3063
+ quiet: {
3064
+ from: string;
3065
+ to: string;
3066
+ tz?: string | undefined;
3067
+ } | null;
3068
+ updatedAt: number;
3069
+ }[];
3070
+ };
3071
+ outputFormat: "json";
3072
+ status: import("hono/utils/http-status").ContentfulStatusCode;
3073
+ };
3074
+ };
3075
+ } & {
3076
+ "/me/subscriptions": {
3077
+ $put: {
3078
+ input: {
3079
+ json: {
3080
+ chatRef: string;
3081
+ items: {
3082
+ topic: string;
3083
+ muted: boolean;
3084
+ quiet: {
3085
+ from: string;
3086
+ to: string;
3087
+ tz?: string | undefined;
3088
+ } | null;
3089
+ }[];
3090
+ };
3091
+ };
3092
+ output: {
3093
+ items: {
3094
+ chatRef: string;
3095
+ topic: string;
3096
+ muted: boolean;
3097
+ quiet: {
3098
+ from: string;
3099
+ to: string;
3100
+ tz?: string | undefined;
3101
+ } | null;
3102
+ updatedAt: number;
3103
+ }[];
3104
+ };
3105
+ outputFormat: "json";
3106
+ status: import("hono/utils/http-status").ContentfulStatusCode;
3107
+ };
3108
+ };
3109
+ }, "/">, "/", "/">;
3110
+ /** The admin API app type (for `hc`); the typed client lives in `@prajwalshete/telegram-plugin/client`. */
3111
+ export type TelegramRoutesApp = ReturnType<typeof buildRoutes>;