@leemour/max-cli 0.12.0 → 0.14.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 (149) hide show
  1. package/README.md +92 -19
  2. package/dist/bot/auth.d.ts +23 -0
  3. package/dist/bot/auth.d.ts.map +1 -0
  4. package/dist/bot/auth.js +36 -0
  5. package/dist/bot/auth.js.map +1 -0
  6. package/dist/bot/client.d.ts +20 -0
  7. package/dist/bot/client.d.ts.map +1 -0
  8. package/dist/bot/client.js +91 -0
  9. package/dist/bot/client.js.map +1 -0
  10. package/dist/bot/generated/manifest.d.ts +3 -0
  11. package/dist/bot/generated/manifest.d.ts.map +1 -0
  12. package/dist/bot/generated/manifest.js +1232 -0
  13. package/dist/bot/generated/manifest.js.map +1 -0
  14. package/dist/bot/generated/schemas.d.ts +271 -0
  15. package/dist/bot/generated/schemas.d.ts.map +1 -0
  16. package/dist/bot/generated/schemas.js +869 -0
  17. package/dist/bot/generated/schemas.js.map +1 -0
  18. package/dist/bot/generated/types.d.ts +1088 -0
  19. package/dist/bot/generated/types.d.ts.map +1 -0
  20. package/dist/bot/generated/types.js +5 -0
  21. package/dist/bot/generated/types.js.map +1 -0
  22. package/dist/bot/input.d.ts +10 -0
  23. package/dist/bot/input.d.ts.map +1 -0
  24. package/dist/bot/input.js +88 -0
  25. package/dist/bot/input.js.map +1 -0
  26. package/dist/bot/map.d.ts +11 -0
  27. package/dist/bot/map.d.ts.map +1 -0
  28. package/dist/bot/map.js +76 -0
  29. package/dist/bot/map.js.map +1 -0
  30. package/dist/bot/permissions.d.ts +14 -0
  31. package/dist/bot/permissions.d.ts.map +1 -0
  32. package/dist/bot/permissions.js +53 -0
  33. package/dist/bot/permissions.js.map +1 -0
  34. package/dist/bot/registry.d.ts +27 -0
  35. package/dist/bot/registry.d.ts.map +1 -0
  36. package/dist/bot/registry.js +68 -0
  37. package/dist/bot/registry.js.map +1 -0
  38. package/dist/bot/russian-trusted-root.d.ts +8 -0
  39. package/dist/bot/russian-trusted-root.d.ts.map +1 -0
  40. package/dist/bot/russian-trusted-root.js +41 -0
  41. package/dist/bot/russian-trusted-root.js.map +1 -0
  42. package/dist/bot/transport.d.ts +41 -0
  43. package/dist/bot/transport.d.ts.map +1 -0
  44. package/dist/bot/transport.js +200 -0
  45. package/dist/bot/transport.js.map +1 -0
  46. package/dist/client.d.ts +32 -1
  47. package/dist/client.d.ts.map +1 -1
  48. package/dist/client.js +174 -18
  49. package/dist/client.js.map +1 -1
  50. package/dist/commands/bot-context.d.ts +21 -0
  51. package/dist/commands/bot-context.d.ts.map +1 -0
  52. package/dist/commands/bot-context.js +59 -0
  53. package/dist/commands/bot-context.js.map +1 -0
  54. package/dist/commands/bot-reads.d.ts +7 -0
  55. package/dist/commands/bot-reads.d.ts.map +1 -0
  56. package/dist/commands/bot-reads.js +103 -0
  57. package/dist/commands/bot-reads.js.map +1 -0
  58. package/dist/commands/bot-sends.d.ts +12 -0
  59. package/dist/commands/bot-sends.d.ts.map +1 -0
  60. package/dist/commands/bot-sends.js +225 -0
  61. package/dist/commands/bot-sends.js.map +1 -0
  62. package/dist/commands/bot.d.ts +3 -0
  63. package/dist/commands/bot.d.ts.map +1 -0
  64. package/dist/commands/bot.js +145 -0
  65. package/dist/commands/bot.js.map +1 -0
  66. package/dist/commands/chats.d.ts.map +1 -1
  67. package/dist/commands/chats.js +65 -1
  68. package/dist/commands/chats.js.map +1 -1
  69. package/dist/commands/context.d.ts +10 -1
  70. package/dist/commands/context.d.ts.map +1 -1
  71. package/dist/commands/context.js.map +1 -1
  72. package/dist/commands/doctor.d.ts +6 -0
  73. package/dist/commands/doctor.d.ts.map +1 -1
  74. package/dist/commands/doctor.js +57 -7
  75. package/dist/commands/doctor.js.map +1 -1
  76. package/dist/commands/mcp.d.ts +24 -0
  77. package/dist/commands/mcp.d.ts.map +1 -1
  78. package/dist/commands/mcp.js +80 -14
  79. package/dist/commands/mcp.js.map +1 -1
  80. package/dist/commands/models.d.ts.map +1 -1
  81. package/dist/commands/models.js +13 -2
  82. package/dist/commands/models.js.map +1 -1
  83. package/dist/commands/review.d.ts +8 -0
  84. package/dist/commands/review.d.ts.map +1 -0
  85. package/dist/commands/review.js +96 -0
  86. package/dist/commands/review.js.map +1 -0
  87. package/dist/commands/rules.d.ts +7 -0
  88. package/dist/commands/rules.d.ts.map +1 -0
  89. package/dist/commands/rules.js +69 -0
  90. package/dist/commands/rules.js.map +1 -0
  91. package/dist/diagnose.d.ts +19 -1
  92. package/dist/diagnose.d.ts.map +1 -1
  93. package/dist/diagnose.js +37 -1
  94. package/dist/diagnose.js.map +1 -1
  95. package/dist/domain/map.d.ts +6 -1
  96. package/dist/domain/map.d.ts.map +1 -1
  97. package/dist/domain/map.js +34 -1
  98. package/dist/domain/map.js.map +1 -1
  99. package/dist/domain/models.d.ts +79 -0
  100. package/dist/domain/models.d.ts.map +1 -1
  101. package/dist/domain/models.js.map +1 -1
  102. package/dist/generated/operations.generated.d.ts +3 -1
  103. package/dist/generated/operations.generated.d.ts.map +1 -1
  104. package/dist/install.d.ts +43 -0
  105. package/dist/install.d.ts.map +1 -0
  106. package/dist/install.js +142 -0
  107. package/dist/install.js.map +1 -0
  108. package/dist/mcp/prompts.d.ts.map +1 -1
  109. package/dist/mcp/prompts.js +28 -0
  110. package/dist/mcp/prompts.js.map +1 -1
  111. package/dist/mcp/tools.d.ts.map +1 -1
  112. package/dist/mcp/tools.js +39 -1
  113. package/dist/mcp/tools.js.map +1 -1
  114. package/dist/moderation/rules.d.ts +56 -0
  115. package/dist/moderation/rules.d.ts.map +1 -0
  116. package/dist/moderation/rules.js +138 -0
  117. package/dist/moderation/rules.js.map +1 -0
  118. package/dist/online.d.ts +23 -0
  119. package/dist/online.d.ts.map +1 -0
  120. package/dist/online.js +87 -0
  121. package/dist/online.js.map +1 -0
  122. package/dist/program.d.ts.map +1 -1
  123. package/dist/program.js +20 -3
  124. package/dist/program.js.map +1 -1
  125. package/dist/protocol/connection.d.ts.map +1 -1
  126. package/dist/protocol/connection.js +12 -1
  127. package/dist/protocol/connection.js.map +1 -1
  128. package/dist/report.d.ts.map +1 -1
  129. package/dist/report.js +13 -2
  130. package/dist/report.js.map +1 -1
  131. package/dist/review.d.ts +41 -0
  132. package/dist/review.d.ts.map +1 -0
  133. package/dist/review.js +111 -0
  134. package/dist/review.js.map +1 -0
  135. package/dist/spec/operations/chats.d.ts +4 -1
  136. package/dist/spec/operations/chats.d.ts.map +1 -1
  137. package/dist/spec/operations/chats.js +10 -4
  138. package/dist/spec/operations/chats.js.map +1 -1
  139. package/dist/transcribe/index.d.ts +1 -0
  140. package/dist/transcribe/index.d.ts.map +1 -1
  141. package/dist/transcribe/index.js +8 -4
  142. package/dist/transcribe/index.js.map +1 -1
  143. package/dist/transcribe/speech.d.ts.map +1 -1
  144. package/dist/transcribe/speech.js +2 -0
  145. package/dist/transcribe/speech.js.map +1 -1
  146. package/dist/version.d.ts +1 -1
  147. package/dist/version.js +1 -1
  148. package/package.json +14 -6
  149. package/skills/max-cli/SKILL.md +26 -1
@@ -0,0 +1,1232 @@
1
+ // GENERATED. DO NOT EDIT.
2
+ // Source: spec/bot/schema.yaml
3
+ // Run: pnpm bot:generate
4
+ export const operations = [
5
+ {
6
+ id: "getMyInfo",
7
+ command: "get-my-info",
8
+ binding: {
9
+ kind: "http",
10
+ method: "GET",
11
+ path: "/me",
12
+ },
13
+ effect: "read",
14
+ summary: "Get current bot info",
15
+ description: "Returns info about current bot. Current bot can be identified by access token. Method returns bot identifier, name and avatar (if any)",
16
+ tags: ["bots"],
17
+ parameters: [],
18
+ response: {
19
+ confidence: "contract",
20
+ schema: "BotInfo",
21
+ },
22
+ },
23
+ {
24
+ id: "editMyCommands",
25
+ command: "edit-my-commands",
26
+ binding: {
27
+ kind: "http",
28
+ method: "PATCH",
29
+ path: "/me/commands",
30
+ },
31
+ effect: "write",
32
+ summary: "Edit current bot commands",
33
+ description: "Edits current bot Commands.",
34
+ tags: ["bots"],
35
+ parameters: [],
36
+ request: {
37
+ required: true,
38
+ confidence: "contract",
39
+ schema: "BotCommandsPatch",
40
+ },
41
+ response: {
42
+ confidence: "contract",
43
+ schema: "BotCommandsInfo",
44
+ },
45
+ },
46
+ {
47
+ id: "getChat",
48
+ command: "get-chat",
49
+ binding: {
50
+ kind: "http",
51
+ method: "GET",
52
+ path: "/chats/{chatId}",
53
+ },
54
+ effect: "read",
55
+ summary: "Get chat",
56
+ description: "Returns info about chat or channel.",
57
+ tags: ["chats"],
58
+ parameters: [
59
+ {
60
+ name: "chatId",
61
+ in: "path",
62
+ required: true,
63
+ schema: {
64
+ type: "ref",
65
+ ref: "ChatId",
66
+ },
67
+ description: "Requested chat or channel identifier",
68
+ },
69
+ ],
70
+ response: {
71
+ confidence: "contract",
72
+ schema: "Chat",
73
+ },
74
+ },
75
+ {
76
+ id: "editChat",
77
+ command: "edit-chat",
78
+ binding: {
79
+ kind: "http",
80
+ method: "PATCH",
81
+ path: "/chats/{chatId}",
82
+ },
83
+ effect: "write",
84
+ summary: "Edit chat or channel info",
85
+ description: "Edits chat or channel info: title, icon, etc…",
86
+ tags: ["chats"],
87
+ parameters: [
88
+ {
89
+ name: "chatId",
90
+ in: "path",
91
+ required: true,
92
+ schema: {
93
+ type: "ref",
94
+ ref: "ChatId",
95
+ },
96
+ description: "Chat or channel identifier",
97
+ },
98
+ ],
99
+ request: {
100
+ required: true,
101
+ confidence: "contract",
102
+ schema: "ChatPatch",
103
+ },
104
+ response: {
105
+ confidence: "contract",
106
+ schema: "Chat",
107
+ },
108
+ },
109
+ {
110
+ id: "sendAction",
111
+ command: "send-action",
112
+ binding: {
113
+ kind: "http",
114
+ method: "POST",
115
+ path: "/chats/{chatId}/actions",
116
+ },
117
+ effect: "write",
118
+ summary: "Send action",
119
+ description: "Send bot action to chat.",
120
+ tags: ["chats"],
121
+ parameters: [
122
+ {
123
+ name: "chatId",
124
+ in: "path",
125
+ required: true,
126
+ schema: {
127
+ type: "ref",
128
+ ref: "ChatId",
129
+ },
130
+ description: "Chat identifier",
131
+ },
132
+ ],
133
+ request: {
134
+ required: true,
135
+ confidence: "contract",
136
+ schema: "ActionRequestBody",
137
+ },
138
+ },
139
+ {
140
+ id: "getPinnedMessage",
141
+ command: "get-pinned-message",
142
+ binding: {
143
+ kind: "http",
144
+ method: "GET",
145
+ path: "/chats/{chatId}/pin",
146
+ },
147
+ effect: "read",
148
+ summary: "Get pinned message",
149
+ description: "Get pinned message in chat or channel.",
150
+ tags: ["chats"],
151
+ parameters: [
152
+ {
153
+ name: "chatId",
154
+ in: "path",
155
+ required: true,
156
+ schema: {
157
+ type: "ref",
158
+ ref: "ChatId",
159
+ },
160
+ description: "Chat identifier to get its pinned message",
161
+ },
162
+ ],
163
+ response: {
164
+ confidence: "contract",
165
+ schema: "GetPinnedMessageResult",
166
+ },
167
+ },
168
+ {
169
+ id: "pinMessage",
170
+ command: "pin-message",
171
+ binding: {
172
+ kind: "http",
173
+ method: "PUT",
174
+ path: "/chats/{chatId}/pin",
175
+ },
176
+ effect: "write",
177
+ summary: "Pin message",
178
+ description: "Pins message in chat or channel.",
179
+ tags: ["chats"],
180
+ parameters: [
181
+ {
182
+ name: "chatId",
183
+ in: "path",
184
+ required: true,
185
+ schema: {
186
+ type: "ref",
187
+ ref: "ChatId",
188
+ },
189
+ description: "Chat identifier where message should be pinned",
190
+ },
191
+ ],
192
+ request: {
193
+ required: true,
194
+ confidence: "contract",
195
+ schema: "PinMessageBody",
196
+ },
197
+ },
198
+ {
199
+ id: "unpinMessage",
200
+ command: "unpin-message",
201
+ binding: {
202
+ kind: "http",
203
+ method: "DELETE",
204
+ path: "/chats/{chatId}/pin",
205
+ },
206
+ effect: "write",
207
+ summary: "Unpin message",
208
+ description: "Unpins message in chat or channel.",
209
+ tags: ["chats"],
210
+ parameters: [
211
+ {
212
+ name: "chatId",
213
+ in: "path",
214
+ required: true,
215
+ schema: {
216
+ type: "ref",
217
+ ref: "ChatId",
218
+ },
219
+ description: "Chat identifier to remove pinned message",
220
+ },
221
+ ],
222
+ },
223
+ {
224
+ id: "getMembership",
225
+ command: "get-membership",
226
+ binding: {
227
+ kind: "http",
228
+ method: "GET",
229
+ path: "/chats/{chatId}/members/me",
230
+ },
231
+ effect: "read",
232
+ summary: "Get chat or channel membership",
233
+ description: "Returns chat or channel membership info for current bot",
234
+ tags: ["chats"],
235
+ parameters: [
236
+ {
237
+ name: "chatId",
238
+ in: "path",
239
+ required: true,
240
+ schema: {
241
+ type: "ref",
242
+ ref: "ChatId",
243
+ },
244
+ description: "Chat or channel identifier",
245
+ },
246
+ ],
247
+ response: {
248
+ confidence: "contract",
249
+ schema: "ChatMember",
250
+ },
251
+ },
252
+ {
253
+ id: "leaveChat",
254
+ command: "leave-chat",
255
+ binding: {
256
+ kind: "http",
257
+ method: "DELETE",
258
+ path: "/chats/{chatId}/members/me",
259
+ },
260
+ effect: "destructive",
261
+ summary: "Leave chat",
262
+ description: "Removes bot from chat or channel members.",
263
+ tags: ["chats"],
264
+ parameters: [
265
+ {
266
+ name: "chatId",
267
+ in: "path",
268
+ required: true,
269
+ schema: {
270
+ type: "ref",
271
+ ref: "ChatId",
272
+ },
273
+ description: "Chat or channel identifier",
274
+ },
275
+ ],
276
+ },
277
+ {
278
+ id: "getAdmins",
279
+ command: "get-admins",
280
+ binding: {
281
+ kind: "http",
282
+ method: "GET",
283
+ path: "/chats/{chatId}/members/admins",
284
+ },
285
+ effect: "read",
286
+ summary: "Get chat or channel admins",
287
+ description: "Returns all chat or channel administrators. Bot must be **administrator** in requested chat or channel.",
288
+ tags: ["chats"],
289
+ parameters: [
290
+ {
291
+ name: "chatId",
292
+ in: "path",
293
+ required: true,
294
+ schema: {
295
+ type: "ref",
296
+ ref: "ChatId",
297
+ },
298
+ description: "Chat or channel identifier",
299
+ },
300
+ ],
301
+ response: {
302
+ confidence: "contract",
303
+ schema: "ChatMembersList",
304
+ },
305
+ },
306
+ {
307
+ id: "postAdmins",
308
+ command: "post-admins",
309
+ binding: {
310
+ kind: "http",
311
+ method: "POST",
312
+ path: "/chats/{chatId}/members/admins",
313
+ },
314
+ effect: "write",
315
+ summary: "Set chat or channel admins",
316
+ description: "Returns true if all administrators added. Additional permissions may require",
317
+ tags: ["chats"],
318
+ parameters: [
319
+ {
320
+ name: "chatId",
321
+ in: "path",
322
+ required: true,
323
+ schema: {
324
+ type: "ref",
325
+ ref: "ChatId",
326
+ },
327
+ description: "Chat or channel identifier",
328
+ },
329
+ ],
330
+ request: {
331
+ required: true,
332
+ confidence: "contract",
333
+ schema: "ChatAdminsList",
334
+ },
335
+ },
336
+ {
337
+ id: "deleteAdmins",
338
+ command: "delete-admins",
339
+ binding: {
340
+ kind: "http",
341
+ method: "DELETE",
342
+ path: "/chats/{chatId}/members/admins/{userId}",
343
+ },
344
+ effect: "write",
345
+ summary: "Revoke admin rights",
346
+ description: "Revokes admin rights from a user in the chat or channel by removing their administrative privileges. Additional permissions may require.",
347
+ tags: ["chats"],
348
+ parameters: [
349
+ {
350
+ name: "chatId",
351
+ in: "path",
352
+ required: true,
353
+ schema: {
354
+ type: "ref",
355
+ ref: "ChatId",
356
+ },
357
+ description: "Chat or channel identifier",
358
+ },
359
+ {
360
+ name: "userId",
361
+ in: "path",
362
+ required: true,
363
+ schema: {
364
+ type: "ref",
365
+ ref: "UserId",
366
+ },
367
+ description: "User identifier",
368
+ },
369
+ ],
370
+ },
371
+ {
372
+ id: "getMembers",
373
+ command: "get-members",
374
+ binding: {
375
+ kind: "http",
376
+ method: "GET",
377
+ path: "/chats/{chatId}/members",
378
+ },
379
+ effect: "read",
380
+ summary: "Get members",
381
+ description: "Returns users participated in chat or channel.",
382
+ tags: ["chats"],
383
+ parameters: [
384
+ {
385
+ name: "chatId",
386
+ in: "path",
387
+ required: true,
388
+ schema: {
389
+ type: "ref",
390
+ ref: "ChatId",
391
+ },
392
+ description: "Chat or channel identifier",
393
+ },
394
+ {
395
+ name: "user_ids",
396
+ in: "query",
397
+ required: false,
398
+ schema: {
399
+ nullable: true,
400
+ type: "array",
401
+ items: {
402
+ type: "ref",
403
+ ref: "UserId",
404
+ },
405
+ uniqueItems: true,
406
+ },
407
+ description: "Comma-separated list of users identifiers to get their membership. When this parameter is passed, both `count` and `marker` are ignored",
408
+ },
409
+ {
410
+ name: "marker",
411
+ in: "query",
412
+ required: false,
413
+ schema: {
414
+ type: "integer",
415
+ format: "int64",
416
+ },
417
+ description: "Marker",
418
+ },
419
+ {
420
+ name: "count",
421
+ in: "query",
422
+ required: false,
423
+ schema: {
424
+ default: 20,
425
+ type: "integer",
426
+ minimum: 1,
427
+ maximum: 100,
428
+ },
429
+ description: "Count",
430
+ },
431
+ ],
432
+ response: {
433
+ confidence: "contract",
434
+ schema: "ChatMembersList",
435
+ },
436
+ },
437
+ {
438
+ id: "addMembers",
439
+ command: "add-members",
440
+ binding: {
441
+ kind: "http",
442
+ method: "POST",
443
+ path: "/chats/{chatId}/members",
444
+ },
445
+ effect: "write",
446
+ summary: "Add members",
447
+ description: "Adds members to chat. Additional permissions may require.",
448
+ tags: ["chats"],
449
+ parameters: [
450
+ {
451
+ name: "chatId",
452
+ in: "path",
453
+ required: true,
454
+ schema: {
455
+ type: "ref",
456
+ ref: "ChatId",
457
+ },
458
+ description: "Chat identifier",
459
+ },
460
+ ],
461
+ request: {
462
+ required: true,
463
+ confidence: "contract",
464
+ schema: "UserIdsList",
465
+ },
466
+ response: {
467
+ confidence: "contract",
468
+ schema: "ModifyMembersResult",
469
+ },
470
+ },
471
+ {
472
+ id: "removeMember",
473
+ command: "remove-member",
474
+ binding: {
475
+ kind: "http",
476
+ method: "DELETE",
477
+ path: "/chats/{chatId}/members",
478
+ },
479
+ effect: "write",
480
+ summary: "Remove member",
481
+ description: "Removes member from chat or channel. Additional permissions may require.",
482
+ tags: ["chats"],
483
+ parameters: [
484
+ {
485
+ name: "chatId",
486
+ in: "path",
487
+ required: true,
488
+ schema: {
489
+ type: "ref",
490
+ ref: "ChatId",
491
+ },
492
+ description: "Chat or channel identifier",
493
+ },
494
+ {
495
+ name: "user_id",
496
+ in: "query",
497
+ required: true,
498
+ schema: {
499
+ type: "ref",
500
+ ref: "UserId",
501
+ },
502
+ description: "User id to remove from chat or channel",
503
+ },
504
+ {
505
+ name: "block",
506
+ in: "query",
507
+ required: false,
508
+ schema: {
509
+ default: false,
510
+ type: "boolean",
511
+ },
512
+ description: "Set to `true` if user should be blocked in chat.\nApplicable only for chats that have public or private link. Ignored otherwise",
513
+ },
514
+ ],
515
+ },
516
+ {
517
+ id: "getSubscriptions",
518
+ command: "get-subscriptions",
519
+ binding: {
520
+ kind: "http",
521
+ method: "GET",
522
+ path: "/subscriptions",
523
+ },
524
+ effect: "read",
525
+ summary: "Get subscriptions",
526
+ description: "In case your bot gets data via WebHook, the method returns list of all subscriptions",
527
+ tags: ["subscriptions"],
528
+ parameters: [],
529
+ response: {
530
+ confidence: "contract",
531
+ schema: "GetSubscriptionsResult",
532
+ },
533
+ },
534
+ {
535
+ id: "subscribe",
536
+ command: "subscribe",
537
+ binding: {
538
+ kind: "http",
539
+ method: "POST",
540
+ path: "/subscriptions",
541
+ },
542
+ effect: "write",
543
+ summary: "Subscribe",
544
+ description: "Subscribes bot to receive updates via WebHook. After calling this method, the bot will receive notifications about new events in chat rooms at the specified URL.\n\nYour server **must** be listening on port **443**",
545
+ tags: ["subscriptions"],
546
+ parameters: [],
547
+ request: {
548
+ required: true,
549
+ confidence: "contract",
550
+ schema: "SubscriptionRequestBody",
551
+ },
552
+ },
553
+ {
554
+ id: "unsubscribe",
555
+ command: "unsubscribe",
556
+ binding: {
557
+ kind: "http",
558
+ method: "DELETE",
559
+ path: "/subscriptions",
560
+ },
561
+ effect: "write",
562
+ summary: "Unsubscribe",
563
+ description: "Unsubscribes bot from receiving updates via WebHook. After calling the method, the bot stops receiving notifications about new events. Notification via the long-poll API becomes available for the bot. Receiving updates via Long Polling is limited in speed and event retention time — this method is not suitable for production environments. We recommend using Webhook at all stages of work",
564
+ tags: ["subscriptions"],
565
+ parameters: [
566
+ {
567
+ name: "url",
568
+ in: "query",
569
+ required: true,
570
+ schema: {
571
+ type: "string",
572
+ },
573
+ description: "URL to remove from WebHook subscriptions",
574
+ },
575
+ ],
576
+ },
577
+ {
578
+ id: "getUploadUrl",
579
+ command: "get-upload-url",
580
+ binding: {
581
+ kind: "http",
582
+ method: "POST",
583
+ path: "/uploads",
584
+ },
585
+ effect: "write",
586
+ summary: "Get upload URL",
587
+ description: 'Returns the URL for the subsequent file upload.\n\nFor example, you can upload it via curl:\n\n```curl -i -X POST\n -H "Content-Type: multipart/form-data"\n -F "data=@movie.mp4" "%UPLOAD_URL%"```\n\nTwo types of an upload are supported:\n- single request upload (multipart request)\n- and resumable upload.\n\n##### Multipart upload\nThis type of upload is a simpler one but it is less\nreliable and agile. If a `Content-Type`: multipart/form-data header is passed in a request our service indicates\nupload type as a simple single request upload.\n\nThis type of an upload has some restrictions: \n\n- image — available formats: JPG, JPEG, PNG, GIF, TIFF, BMP, HEIC; maximum size for a single image: up to 50 MB AND no more than 7680 x 7680 px — both criteria must be met. For example, you cannot upload an image that is 55 MB and has dimensions of 7600 x 7600 px.\n- video — available formats: MP4, MOV, MKV, WEBM; maximum size for a single video: up to 250 MB\n- audio — available formats: MP3, WAV, M4A, and others, maximum size for a single audio file: up to 256 MB OR duration of no more than 60 minutes — both criteria must be met. For example, you cannot send an audio file that is 250 MB and 70 minutes long.\n- file — available formats: TXT, DOC, PDF, and other common formats, maximum size for a single file: up to 4 GB\n- type=photo parameter is no longer supported. If you used type=photo in previously created integrations, please replace it with type=image\n- Only one mediafile per request can be uploaded\n- No possibility to restart stopped / failed upload\n\n##### Resumable upload\nIf `Content-Type` header value is not equal to `multipart/form-data` our service indicated upload type\nas a resumable upload.\nWith a `Content-Range` header current file chunk range and complete file size\ncan be passed. If a network error has happened or upload was stopped you can continue to upload a file from\nthe last successfully uploaded file chunk. You can request the last known byte of uploaded file from server\nand continue to upload a file.\n\n##### Get upload status\nTo GET an upload status you simply need to perform HTTPS-GET request to a file upload URL.\nOur service will respond with current upload status,\ncomplete file size and last known uploaded byte. This data can be used to complete stopped upload\nif something went wrong. If `REQUESTED_RANGE_NOT_SATISFIABLE` or `INTERNAL_SERVER_ERROR` status was returned\nit is a good point to try to restart an upload',
588
+ tags: ["upload"],
589
+ parameters: [
590
+ {
591
+ name: "type",
592
+ in: "query",
593
+ required: true,
594
+ schema: {
595
+ type: "ref",
596
+ ref: "UploadType",
597
+ },
598
+ description: "Uploaded file type: image, audio, video, file",
599
+ },
600
+ ],
601
+ response: {
602
+ confidence: "contract",
603
+ schema: "UploadEndpoint",
604
+ },
605
+ },
606
+ {
607
+ id: "getMessages",
608
+ command: "get-messages",
609
+ binding: {
610
+ kind: "http",
611
+ method: "GET",
612
+ path: "/messages",
613
+ },
614
+ effect: "read",
615
+ summary: "Get messages",
616
+ description: "Returns messages in chat or channel: result page and marker referencing to the next page. Messages traversed in reverse direction so the latest message in chat will be first in result array. Therefore if you use `from` and `to` parameters, `to` must be **less than** `from`",
617
+ tags: ["messages"],
618
+ parameters: [
619
+ {
620
+ name: "chat_id",
621
+ in: "query",
622
+ required: false,
623
+ schema: {
624
+ type: "ref",
625
+ ref: "ChatId",
626
+ },
627
+ description: "Chat or channel identifier to get messages in chat or channel",
628
+ },
629
+ {
630
+ name: "message_ids",
631
+ in: "query",
632
+ required: false,
633
+ schema: {
634
+ nullable: true,
635
+ type: "array",
636
+ items: {
637
+ type: "string",
638
+ },
639
+ uniqueItems: true,
640
+ },
641
+ description: "Comma-separated list of message ids to get",
642
+ },
643
+ {
644
+ name: "from",
645
+ in: "query",
646
+ required: false,
647
+ schema: {
648
+ type: "ref",
649
+ ref: "bigint",
650
+ },
651
+ description: "Start time for requested messages - use after instead",
652
+ },
653
+ {
654
+ name: "to",
655
+ in: "query",
656
+ required: false,
657
+ schema: {
658
+ type: "ref",
659
+ ref: "bigint",
660
+ },
661
+ description: "End time for requested messages - use before instead",
662
+ },
663
+ {
664
+ name: "before",
665
+ in: "query",
666
+ required: false,
667
+ schema: {
668
+ type: "integer",
669
+ format: "int64",
670
+ minimum: 0,
671
+ },
672
+ description: "Messages before timestamp",
673
+ },
674
+ {
675
+ name: "after",
676
+ in: "query",
677
+ required: false,
678
+ schema: {
679
+ type: "integer",
680
+ format: "int64",
681
+ minimum: 0,
682
+ },
683
+ description: "Messages after timestamp",
684
+ },
685
+ {
686
+ name: "count",
687
+ in: "query",
688
+ required: false,
689
+ schema: {
690
+ default: 50,
691
+ type: "integer",
692
+ format: "int32",
693
+ minimum: 1,
694
+ maximum: 100,
695
+ },
696
+ description: "Maximum amount of messages in response",
697
+ },
698
+ ],
699
+ response: {
700
+ confidence: "contract",
701
+ schema: "MessageList",
702
+ },
703
+ },
704
+ {
705
+ id: "sendMessage",
706
+ command: "send-message",
707
+ binding: {
708
+ kind: "http",
709
+ method: "POST",
710
+ path: "/messages",
711
+ },
712
+ effect: "write",
713
+ summary: "Send message",
714
+ description: 'Sends a message to a chat, channel or dialog. \nAs a result for this method new message identifier returns.\nIn the case of a channel, it returns an error if you pass notify=false\n### Attaching media\nAttaching media to messages is a three-step process.\n\nAt first step, you should obtain a URL to upload your media files.\n\nAt the second, you should upload binary of appropriate format to URL you obtained at the previous step. See [upload section](https://dev.max.ru/docs-api/methods/POST/uploads) in docs for details.\n\nFinally, if the upload process was successful, you will receive JSON-object in a response body. Use this object to create attachment. Construct an object with two properties:\n- `type` with the value set to appropriate media type\n- and `payload` filled with the JSON you\'ve got.\n\nFor example, you can attach a video to message this way:\n\n1. Get URL to upload. Execute following:\n```shell\ncurl -X POST \'https://platform-api2.max.ru/uploads?type=video\' -H \'Authorization: %access_token%\' \n```\nAs the result it will return URL for the next step.\n```json\n{\n "url": "http://omub.okcdn.ru/upload.do…" \n}\n```\n\n2. Use this url to upload your binary:\n```shell\ncurl -i -X POST\n -H "Content-Type: multipart/form-data"\n -F "data=@movie.mp4" "http://omub.okcdn.ru/upload.do…" \n```\nAs the result it will return JSON you can attach to message:\n```json\n {\n "token": "_3Rarhcf1PtlMXy8jpgie8Ai_KARnVFYNQTtmIRWNh4"\n }\n```\n3. Send message with attach:\n```json\n{\n "text": "Message with video",\n "attachments": [\n {\n "type": "video",\n "payload": {\n "token": "_3Rarhcf1PtlMXy8jpgie8Ai_KARnVFYNQTtmIRWNh4"\n }\n }\n ]\n}\n```\n\n**Important notice**:\n\nIt may take time for the server to process your file (audio/video or any binary).\nWhile a file is not processed you can\'t attach it. It means the last step will fail with `400` error.\nTry to send a message again until you\'ll get a successful result.',
715
+ tags: ["messages"],
716
+ parameters: [
717
+ {
718
+ name: "user_id",
719
+ in: "query",
720
+ required: false,
721
+ schema: {
722
+ type: "ref",
723
+ ref: "UserId",
724
+ },
725
+ description: "Fill this parameter if you want to send message to user",
726
+ },
727
+ {
728
+ name: "chat_id",
729
+ in: "query",
730
+ required: false,
731
+ schema: {
732
+ type: "ref",
733
+ ref: "ChatId",
734
+ },
735
+ description: "Fill this if you send message to chat or channel",
736
+ },
737
+ {
738
+ name: "disable_link_preview",
739
+ in: "query",
740
+ required: false,
741
+ schema: {
742
+ default: false,
743
+ type: "boolean",
744
+ },
745
+ description: "If `false`, server will not generate media preview for links in text",
746
+ },
747
+ ],
748
+ request: {
749
+ required: true,
750
+ confidence: "contract",
751
+ schema: "NewMessageBody",
752
+ },
753
+ response: {
754
+ confidence: "contract",
755
+ schema: "SendMessageResult",
756
+ },
757
+ },
758
+ {
759
+ id: "editMessage",
760
+ command: "edit-message",
761
+ binding: {
762
+ kind: "http",
763
+ method: "PUT",
764
+ path: "/messages",
765
+ },
766
+ effect: "write",
767
+ summary: "Edit message",
768
+ description: "Updated message should be sent as `NewMessageBody` in a request body. In case `attachments` field is `null`, the current message attachments won’t be changed. In case of sending an empty list in this field, all attachments will be deleted.",
769
+ tags: ["messages"],
770
+ parameters: [
771
+ {
772
+ name: "message_id",
773
+ in: "query",
774
+ required: true,
775
+ schema: {
776
+ type: "ref",
777
+ ref: "MessageId",
778
+ },
779
+ description: "Editing message identifier",
780
+ },
781
+ ],
782
+ request: {
783
+ required: true,
784
+ confidence: "contract",
785
+ schema: "NewMessageBody",
786
+ },
787
+ },
788
+ {
789
+ id: "deleteMessage",
790
+ command: "delete-message",
791
+ binding: {
792
+ kind: "http",
793
+ method: "DELETE",
794
+ path: "/messages",
795
+ },
796
+ effect: "destructive",
797
+ summary: "Delete message",
798
+ description: "Deletes message in a dialog, chat or channel if bot has permission to delete messages.",
799
+ tags: ["messages"],
800
+ parameters: [
801
+ {
802
+ name: "message_id",
803
+ in: "query",
804
+ required: true,
805
+ schema: {
806
+ type: "ref",
807
+ ref: "MessageId",
808
+ },
809
+ description: "Deleting message identifier",
810
+ },
811
+ ],
812
+ },
813
+ {
814
+ id: "getMessageById",
815
+ command: "get-message-by-id",
816
+ binding: {
817
+ kind: "http",
818
+ method: "GET",
819
+ path: "/messages/{messageId}",
820
+ },
821
+ effect: "read",
822
+ summary: "Get message",
823
+ description: "Returns single message by its identifier.",
824
+ tags: ["messages"],
825
+ parameters: [
826
+ {
827
+ name: "messageId",
828
+ in: "path",
829
+ required: true,
830
+ schema: {
831
+ description: "Message identifier",
832
+ type: "string",
833
+ minLength: 1,
834
+ pattern: "(mid.)?[a-zA-Z0-9_\\-]+",
835
+ },
836
+ description: "Message identifier (`mid`) to get single message in chat or channel",
837
+ },
838
+ ],
839
+ response: {
840
+ confidence: "contract",
841
+ schema: "Message",
842
+ },
843
+ },
844
+ {
845
+ id: "getComments",
846
+ command: "get-comments",
847
+ binding: {
848
+ kind: "http",
849
+ method: "GET",
850
+ path: "/messages/{messageId}/comments",
851
+ },
852
+ effect: "read",
853
+ summary: "Get comments",
854
+ description: "Returns comments for a message in channel: result page and marker referencing to the next page. Comments traversed in reverse direction so the latest comment for the message will be first in result array. Additional permissions may require",
855
+ tags: ["comments"],
856
+ parameters: [
857
+ {
858
+ name: "messageId",
859
+ in: "path",
860
+ required: true,
861
+ schema: {
862
+ description: "Message identifier",
863
+ type: "string",
864
+ minLength: 1,
865
+ pattern: "(mid.)?[a-zA-Z0-9_\\-]+",
866
+ },
867
+ description: "Message identifier (`mid`) of the commented message",
868
+ },
869
+ {
870
+ name: "comment_ids",
871
+ in: "query",
872
+ required: false,
873
+ schema: {
874
+ nullable: true,
875
+ type: "array",
876
+ items: {
877
+ type: "ref",
878
+ ref: "MessageId",
879
+ },
880
+ uniqueItems: true,
881
+ },
882
+ description: "Comma-separated list of comment ids to get",
883
+ },
884
+ {
885
+ name: "before",
886
+ in: "query",
887
+ required: false,
888
+ schema: {
889
+ type: "integer",
890
+ format: "int64",
891
+ minimum: 0,
892
+ },
893
+ description: "Comments before timestamp",
894
+ },
895
+ {
896
+ name: "after",
897
+ in: "query",
898
+ required: false,
899
+ schema: {
900
+ type: "integer",
901
+ format: "int64",
902
+ minimum: 0,
903
+ },
904
+ description: "Comments after timestamp",
905
+ },
906
+ {
907
+ name: "count",
908
+ in: "query",
909
+ required: false,
910
+ schema: {
911
+ default: 50,
912
+ type: "integer",
913
+ format: "int32",
914
+ minimum: 1,
915
+ maximum: 100,
916
+ },
917
+ description: "Maximum amount of comments in response",
918
+ },
919
+ ],
920
+ response: {
921
+ confidence: "contract",
922
+ schema: "CommentMessageList",
923
+ },
924
+ },
925
+ {
926
+ id: "sendComment",
927
+ command: "send-comment",
928
+ binding: {
929
+ kind: "http",
930
+ method: "POST",
931
+ path: "/messages/{messageId}/comments",
932
+ },
933
+ effect: "write",
934
+ summary: "Send comment",
935
+ description: "Sends a comment to a message in channel. Attachments are not allowed in comments. Additional permissions may require",
936
+ tags: ["comments"],
937
+ parameters: [
938
+ {
939
+ name: "messageId",
940
+ in: "path",
941
+ required: true,
942
+ schema: {
943
+ description: "Message identifier",
944
+ type: "string",
945
+ minLength: 1,
946
+ pattern: "(mid.)?[a-zA-Z0-9_\\-]+",
947
+ },
948
+ description: "Message identifier (`mid`) of the commented message",
949
+ },
950
+ {
951
+ name: "disable_link_preview",
952
+ in: "query",
953
+ required: false,
954
+ schema: {
955
+ default: false,
956
+ type: "boolean",
957
+ },
958
+ description: "If `false`, server will not generate media preview for links in text",
959
+ },
960
+ ],
961
+ request: {
962
+ required: true,
963
+ confidence: "contract",
964
+ schema: "NewCommentBody",
965
+ },
966
+ response: {
967
+ confidence: "contract",
968
+ schema: "SendCommentResult",
969
+ },
970
+ },
971
+ {
972
+ id: "editComment",
973
+ command: "edit-comment",
974
+ binding: {
975
+ kind: "http",
976
+ method: "PUT",
977
+ path: "/messages/{messageId}/comments",
978
+ },
979
+ effect: "write",
980
+ summary: "Edit comment",
981
+ description: "Updated comment should be sent as `NewCommentBody` in a request body. Attachments are not allowed in comments. Additional permissions may require",
982
+ tags: ["comments"],
983
+ parameters: [
984
+ {
985
+ name: "messageId",
986
+ in: "path",
987
+ required: true,
988
+ schema: {
989
+ description: "Message identifier",
990
+ type: "string",
991
+ minLength: 1,
992
+ pattern: "(mid.)?[a-zA-Z0-9_\\-]+",
993
+ },
994
+ description: "Message identifier (`mid`) of the commented message",
995
+ },
996
+ {
997
+ name: "comment_id",
998
+ in: "query",
999
+ required: true,
1000
+ schema: {
1001
+ type: "ref",
1002
+ ref: "MessageId",
1003
+ },
1004
+ description: "Editing comment identifier",
1005
+ },
1006
+ ],
1007
+ request: {
1008
+ required: true,
1009
+ confidence: "contract",
1010
+ schema: "NewCommentBody",
1011
+ },
1012
+ },
1013
+ {
1014
+ id: "deleteComment",
1015
+ command: "delete-comment",
1016
+ binding: {
1017
+ kind: "http",
1018
+ method: "DELETE",
1019
+ path: "/messages/{messageId}/comments",
1020
+ },
1021
+ effect: "destructive",
1022
+ summary: "Delete comment",
1023
+ description: "Deletes comment for a message in channel if bot has permission to delete messages.",
1024
+ tags: ["comments"],
1025
+ parameters: [
1026
+ {
1027
+ name: "messageId",
1028
+ in: "path",
1029
+ required: true,
1030
+ schema: {
1031
+ description: "Message identifier",
1032
+ type: "string",
1033
+ minLength: 1,
1034
+ pattern: "(mid.)?[a-zA-Z0-9_\\-]+",
1035
+ },
1036
+ description: "Message identifier (`mid`) of the commented message",
1037
+ },
1038
+ {
1039
+ name: "comment_id",
1040
+ in: "query",
1041
+ required: true,
1042
+ schema: {
1043
+ type: "ref",
1044
+ ref: "MessageId",
1045
+ },
1046
+ description: "Deleting comment identifier",
1047
+ },
1048
+ ],
1049
+ },
1050
+ {
1051
+ id: "getCommentById",
1052
+ command: "get-comment-by-id",
1053
+ binding: {
1054
+ kind: "http",
1055
+ method: "GET",
1056
+ path: "/messages/{messageId}/comments/{commentId}",
1057
+ },
1058
+ effect: "read",
1059
+ summary: "Get comment",
1060
+ description: "Returns single comment by its identifier. Additional permissions may require",
1061
+ tags: ["comments"],
1062
+ parameters: [
1063
+ {
1064
+ name: "messageId",
1065
+ in: "path",
1066
+ required: true,
1067
+ schema: {
1068
+ description: "Message identifier",
1069
+ type: "string",
1070
+ minLength: 1,
1071
+ pattern: "(mid.)?[a-zA-Z0-9_\\-]+",
1072
+ },
1073
+ description: "Message identifier (`mid`) of the commented message",
1074
+ },
1075
+ {
1076
+ name: "commentId",
1077
+ in: "path",
1078
+ required: true,
1079
+ schema: {
1080
+ description: "Message identifier",
1081
+ type: "string",
1082
+ minLength: 1,
1083
+ pattern: "(mid.)?[a-zA-Z0-9_\\-]+",
1084
+ },
1085
+ description: "Comment identifier (`mid`) to get single comment in channel",
1086
+ },
1087
+ ],
1088
+ response: {
1089
+ confidence: "contract",
1090
+ schema: "CommentMessage",
1091
+ },
1092
+ },
1093
+ {
1094
+ id: "getVideoAttachmentDetails",
1095
+ command: "get-video-attachment-details",
1096
+ binding: {
1097
+ kind: "http",
1098
+ method: "GET",
1099
+ path: "/videos/{videoToken}",
1100
+ },
1101
+ effect: "read",
1102
+ summary: "Get video details",
1103
+ description: "Returns detailed information about video attachment: playback URLs and additional metadata.",
1104
+ tags: ["messages"],
1105
+ parameters: [
1106
+ {
1107
+ name: "videoToken",
1108
+ in: "path",
1109
+ required: true,
1110
+ schema: {
1111
+ type: "string",
1112
+ pattern: "[\\w-]+",
1113
+ },
1114
+ description: "Video attachment token",
1115
+ },
1116
+ ],
1117
+ response: {
1118
+ confidence: "contract",
1119
+ schema: "VideoAttachmentDetails",
1120
+ },
1121
+ },
1122
+ {
1123
+ id: "answerOnCallback",
1124
+ command: "answer-on-callback",
1125
+ binding: {
1126
+ kind: "http",
1127
+ method: "POST",
1128
+ path: "/answers",
1129
+ },
1130
+ effect: "write",
1131
+ summary: "Answer on callback",
1132
+ description: "This method should be called to send an answer after a user has clicked the button. The answer may be an updated message or/and a one-time user notification.",
1133
+ tags: ["messages"],
1134
+ parameters: [
1135
+ {
1136
+ name: "callback_id",
1137
+ in: "query",
1138
+ required: true,
1139
+ schema: {
1140
+ type: "string",
1141
+ minLength: 1,
1142
+ pattern: "^\\s*\\S[\\s\\S]*$",
1143
+ },
1144
+ description: "Identifies a button clicked by user. Bot receives this identifier after user pressed button as part of `MessageCallbackUpdate`",
1145
+ },
1146
+ {
1147
+ name: "disable_link_preview",
1148
+ in: "query",
1149
+ required: false,
1150
+ schema: {
1151
+ default: false,
1152
+ type: "boolean",
1153
+ },
1154
+ description: "If `true`, server will not generate media preview for links in updated message text",
1155
+ },
1156
+ ],
1157
+ request: {
1158
+ required: true,
1159
+ confidence: "contract",
1160
+ schema: "CallbackAnswer",
1161
+ },
1162
+ },
1163
+ {
1164
+ id: "getUpdates",
1165
+ command: "get-updates",
1166
+ binding: {
1167
+ kind: "http",
1168
+ method: "GET",
1169
+ path: "/updates",
1170
+ },
1171
+ effect: "write",
1172
+ summary: "Get updates",
1173
+ description: "Receiving updates via Long Polling is limited in speed and event retention time — this method is not suitable for production environments. We recommend using Webhook at all stages of work.\n\nYou can use this method for getting updates in case your bot is not subscribed to WebHook. The method is based on long polling.\n\nEvery update has its own sequence number. `marker` property in response points to the next upcoming update.\n\nAll previous updates are considered as *committed* after passing `marker` parameter.\nIf `marker` parameter is **not passed**, your bot will get all updates happened after the last commitment.",
1174
+ tags: ["subscriptions"],
1175
+ parameters: [
1176
+ {
1177
+ name: "limit",
1178
+ in: "query",
1179
+ required: false,
1180
+ schema: {
1181
+ default: 100,
1182
+ type: "integer",
1183
+ minimum: 1,
1184
+ maximum: 1000,
1185
+ },
1186
+ description: "Maximum number of updates to be retrieved",
1187
+ },
1188
+ {
1189
+ name: "timeout",
1190
+ in: "query",
1191
+ required: false,
1192
+ schema: {
1193
+ default: 30,
1194
+ type: "integer",
1195
+ minimum: 0,
1196
+ maximum: 90,
1197
+ },
1198
+ description: "Timeout in seconds for long polling",
1199
+ },
1200
+ {
1201
+ name: "marker",
1202
+ in: "query",
1203
+ required: false,
1204
+ schema: {
1205
+ nullable: true,
1206
+ type: "integer",
1207
+ format: "int64",
1208
+ },
1209
+ description: "Pass `null` to get updates you didn't get yet",
1210
+ },
1211
+ {
1212
+ name: "types",
1213
+ in: "query",
1214
+ required: false,
1215
+ schema: {
1216
+ nullable: true,
1217
+ type: "array",
1218
+ items: {
1219
+ type: "string",
1220
+ },
1221
+ uniqueItems: true,
1222
+ },
1223
+ description: "Comma separated list of update types your bot want to receive",
1224
+ },
1225
+ ],
1226
+ response: {
1227
+ confidence: "contract",
1228
+ schema: "UpdateList",
1229
+ },
1230
+ },
1231
+ ];
1232
+ //# sourceMappingURL=manifest.js.map