@divyacon/piece-telegram-bot 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.
- package/LICENSE.MIT-AP +24 -0
- package/README.md +8 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +122 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/action/answer-callback-query.action.d.ts +8 -0
- package/dist/lib/action/answer-callback-query.action.d.ts.map +1 -0
- package/dist/lib/action/answer-callback-query.action.js +63 -0
- package/dist/lib/action/answer-callback-query.action.js.map +1 -0
- package/dist/lib/action/create-invite-link.d.ts +9 -0
- package/dist/lib/action/create-invite-link.d.ts.map +1 -0
- package/dist/lib/action/create-invite-link.js +66 -0
- package/dist/lib/action/create-invite-link.js.map +1 -0
- package/dist/lib/action/delete-message.action.d.ts +6 -0
- package/dist/lib/action/delete-message.action.d.ts.map +1 -0
- package/dist/lib/action/delete-message.action.js +42 -0
- package/dist/lib/action/delete-message.action.js.map +1 -0
- package/dist/lib/action/edit-message-text.action.d.ts +12 -0
- package/dist/lib/action/edit-message-text.action.d.ts.map +1 -0
- package/dist/lib/action/edit-message-text.action.js +76 -0
- package/dist/lib/action/edit-message-text.action.js.map +1 -0
- package/dist/lib/action/forward-message.action.d.ts +10 -0
- package/dist/lib/action/forward-message.action.d.ts.map +1 -0
- package/dist/lib/action/forward-message.action.js +59 -0
- package/dist/lib/action/forward-message.action.js.map +1 -0
- package/dist/lib/action/get-chat-member.d.ts +6 -0
- package/dist/lib/action/get-chat-member.d.ts.map +1 -0
- package/dist/lib/action/get-chat-member.js +49 -0
- package/dist/lib/action/get-chat-member.js.map +1 -0
- package/dist/lib/action/get-chat.action.d.ts +5 -0
- package/dist/lib/action/get-chat.action.d.ts.map +1 -0
- package/dist/lib/action/get-chat.action.js +42 -0
- package/dist/lib/action/get-chat.action.js.map +1 -0
- package/dist/lib/action/get-file.action.d.ts +5 -0
- package/dist/lib/action/get-file.action.d.ts.map +1 -0
- package/dist/lib/action/get-file.action.js +69 -0
- package/dist/lib/action/get-file.action.js.map +1 -0
- package/dist/lib/action/pin-message.action.d.ts +7 -0
- package/dist/lib/action/pin-message.action.d.ts.map +1 -0
- package/dist/lib/action/pin-message.action.js +50 -0
- package/dist/lib/action/pin-message.action.js.map +1 -0
- package/dist/lib/action/request-approval-message.d.ts +7 -0
- package/dist/lib/action/request-approval-message.d.ts.map +1 -0
- package/dist/lib/action/request-approval-message.js +84 -0
- package/dist/lib/action/request-approval-message.js.map +1 -0
- package/dist/lib/action/send-audio.action.d.ts +18 -0
- package/dist/lib/action/send-audio.action.d.ts.map +1 -0
- package/dist/lib/action/send-audio.action.js +128 -0
- package/dist/lib/action/send-audio.action.js.map +1 -0
- package/dist/lib/action/send-chat-action.action.d.ts +7 -0
- package/dist/lib/action/send-chat-action.action.d.ts.map +1 -0
- package/dist/lib/action/send-chat-action.action.js +61 -0
- package/dist/lib/action/send-chat-action.action.js.map +1 -0
- package/dist/lib/action/send-document.action.d.ts +15 -0
- package/dist/lib/action/send-document.action.d.ts.map +1 -0
- package/dist/lib/action/send-document.action.js +104 -0
- package/dist/lib/action/send-document.action.js.map +1 -0
- package/dist/lib/action/send-location.action.d.ts +16 -0
- package/dist/lib/action/send-location.action.d.ts.map +1 -0
- package/dist/lib/action/send-location.action.js +83 -0
- package/dist/lib/action/send-location.action.js.map +1 -0
- package/dist/lib/action/send-media-group.action.d.ts +11 -0
- package/dist/lib/action/send-media-group.action.d.ts.map +1 -0
- package/dist/lib/action/send-media-group.action.js +97 -0
- package/dist/lib/action/send-media-group.action.js.map +1 -0
- package/dist/lib/action/send-media.action.d.ts +14 -0
- package/dist/lib/action/send-media.action.d.ts.map +1 -0
- package/dist/lib/action/send-media.action.js +198 -0
- package/dist/lib/action/send-media.action.js.map +1 -0
- package/dist/lib/action/send-poll.action.d.ts +21 -0
- package/dist/lib/action/send-poll.action.d.ts.map +1 -0
- package/dist/lib/action/send-poll.action.js +145 -0
- package/dist/lib/action/send-poll.action.js.map +1 -0
- package/dist/lib/action/send-text-message.action.d.ts +14 -0
- package/dist/lib/action/send-text-message.action.d.ts.map +1 -0
- package/dist/lib/action/send-text-message.action.js +63 -0
- package/dist/lib/action/send-text-message.action.js.map +1 -0
- package/dist/lib/action/telegram-answer-callback-query.d.ts +8 -0
- package/dist/lib/action/telegram-answer-callback-query.d.ts.map +1 -0
- package/dist/lib/action/telegram-answer-callback-query.js +68 -0
- package/dist/lib/action/telegram-answer-callback-query.js.map +1 -0
- package/dist/lib/action/telegram-create-invite-link.d.ts +8 -0
- package/dist/lib/action/telegram-create-invite-link.d.ts.map +1 -0
- package/dist/lib/action/telegram-create-invite-link.js +68 -0
- package/dist/lib/action/telegram-create-invite-link.js.map +1 -0
- package/dist/lib/action/telegram-delete-message.d.ts +5 -0
- package/dist/lib/action/telegram-delete-message.d.ts.map +1 -0
- package/dist/lib/action/telegram-delete-message.js +44 -0
- package/dist/lib/action/telegram-delete-message.js.map +1 -0
- package/dist/lib/action/telegram-edit-message-text.d.ts +10 -0
- package/dist/lib/action/telegram-edit-message-text.d.ts.map +1 -0
- package/dist/lib/action/telegram-edit-message-text.js +93 -0
- package/dist/lib/action/telegram-edit-message-text.js.map +1 -0
- package/dist/lib/action/telegram-forward-message.d.ts +9 -0
- package/dist/lib/action/telegram-forward-message.d.ts.map +1 -0
- package/dist/lib/action/telegram-forward-message.js +61 -0
- package/dist/lib/action/telegram-forward-message.js.map +1 -0
- package/dist/lib/action/telegram-get-bot-info.d.ts +2 -0
- package/dist/lib/action/telegram-get-bot-info.d.ts.map +1 -0
- package/dist/lib/action/telegram-get-bot-info.js +39 -0
- package/dist/lib/action/telegram-get-bot-info.js.map +1 -0
- package/dist/lib/action/telegram-get-chat-administrators.d.ts +4 -0
- package/dist/lib/action/telegram-get-chat-administrators.d.ts.map +1 -0
- package/dist/lib/action/telegram-get-chat-administrators.js +44 -0
- package/dist/lib/action/telegram-get-chat-administrators.js.map +1 -0
- package/dist/lib/action/telegram-get-chat-member-count.d.ts +4 -0
- package/dist/lib/action/telegram-get-chat-member-count.d.ts.map +1 -0
- package/dist/lib/action/telegram-get-chat-member-count.js +44 -0
- package/dist/lib/action/telegram-get-chat-member-count.js.map +1 -0
- package/dist/lib/action/telegram-get-chat-member.d.ts +5 -0
- package/dist/lib/action/telegram-get-chat-member.d.ts.map +1 -0
- package/dist/lib/action/telegram-get-chat-member.js +51 -0
- package/dist/lib/action/telegram-get-chat-member.js.map +1 -0
- package/dist/lib/action/telegram-get-chat.d.ts +4 -0
- package/dist/lib/action/telegram-get-chat.d.ts.map +1 -0
- package/dist/lib/action/telegram-get-chat.js +44 -0
- package/dist/lib/action/telegram-get-chat.js.map +1 -0
- package/dist/lib/action/telegram-get-file.d.ts +5 -0
- package/dist/lib/action/telegram-get-file.d.ts.map +1 -0
- package/dist/lib/action/telegram-get-file.js +72 -0
- package/dist/lib/action/telegram-get-file.js.map +1 -0
- package/dist/lib/action/telegram-pin-message.d.ts +6 -0
- package/dist/lib/action/telegram-pin-message.d.ts.map +1 -0
- package/dist/lib/action/telegram-pin-message.js +52 -0
- package/dist/lib/action/telegram-pin-message.js.map +1 -0
- package/dist/lib/action/telegram-send-audio.d.ts +16 -0
- package/dist/lib/action/telegram-send-audio.d.ts.map +1 -0
- package/dist/lib/action/telegram-send-audio.js +149 -0
- package/dist/lib/action/telegram-send-audio.js.map +1 -0
- package/dist/lib/action/telegram-send-chat-action.d.ts +6 -0
- package/dist/lib/action/telegram-send-chat-action.d.ts.map +1 -0
- package/dist/lib/action/telegram-send-chat-action.js +67 -0
- package/dist/lib/action/telegram-send-chat-action.js.map +1 -0
- package/dist/lib/action/telegram-send-document.d.ts +13 -0
- package/dist/lib/action/telegram-send-document.d.ts.map +1 -0
- package/dist/lib/action/telegram-send-document.js +125 -0
- package/dist/lib/action/telegram-send-document.js.map +1 -0
- package/dist/lib/action/telegram-send-location.d.ts +15 -0
- package/dist/lib/action/telegram-send-location.d.ts.map +1 -0
- package/dist/lib/action/telegram-send-location.js +93 -0
- package/dist/lib/action/telegram-send-location.js.map +1 -0
- package/dist/lib/action/telegram-send-media-group.d.ts +10 -0
- package/dist/lib/action/telegram-send-media-group.d.ts.map +1 -0
- package/dist/lib/action/telegram-send-media-group.js +115 -0
- package/dist/lib/action/telegram-send-media-group.js.map +1 -0
- package/dist/lib/action/telegram-send-message.d.ts +12 -0
- package/dist/lib/action/telegram-send-message.d.ts.map +1 -0
- package/dist/lib/action/telegram-send-message.js +84 -0
- package/dist/lib/action/telegram-send-message.js.map +1 -0
- package/dist/lib/action/telegram-send-photo-or-video.d.ts +12 -0
- package/dist/lib/action/telegram-send-photo-or-video.d.ts.map +1 -0
- package/dist/lib/action/telegram-send-photo-or-video.js +219 -0
- package/dist/lib/action/telegram-send-photo-or-video.js.map +1 -0
- package/dist/lib/action/telegram-send-poll.d.ts +20 -0
- package/dist/lib/action/telegram-send-poll.d.ts.map +1 -0
- package/dist/lib/action/telegram-send-poll.js +167 -0
- package/dist/lib/action/telegram-send-poll.js.map +1 -0
- package/dist/lib/action/telegram-unpin-message.d.ts +5 -0
- package/dist/lib/action/telegram-unpin-message.d.ts.map +1 -0
- package/dist/lib/action/telegram-unpin-message.js +45 -0
- package/dist/lib/action/telegram-unpin-message.js.map +1 -0
- package/dist/lib/action/unpin-message.action.d.ts +6 -0
- package/dist/lib/action/unpin-message.action.d.ts.map +1 -0
- package/dist/lib/action/unpin-message.action.js +43 -0
- package/dist/lib/action/unpin-message.action.js.map +1 -0
- package/dist/lib/common/index.d.ts +25 -0
- package/dist/lib/common/index.d.ts.map +1 -0
- package/dist/lib/common/index.js +104 -0
- package/dist/lib/common/index.js.map +1 -0
- package/dist/lib/output-schemas.d.ts +41 -0
- package/dist/lib/output-schemas.d.ts.map +1 -0
- package/dist/lib/output-schemas.js +1853 -0
- package/dist/lib/output-schemas.js.map +1 -0
- package/dist/lib/trigger/new-message.d.ts +15 -0
- package/dist/lib/trigger/new-message.d.ts.map +1 -0
- package/dist/lib/trigger/new-message.js +121 -0
- package/dist/lib/trigger/new-message.js.map +1 -0
- package/package.json +44 -3
- package/src/index.ts +119 -0
- package/src/lib/action/answer-callback-query.action.ts +58 -0
- package/src/lib/action/create-invite-link.ts +59 -0
- package/src/lib/action/delete-message.action.ts +34 -0
- package/src/lib/action/edit-message-text.action.ts +71 -0
- package/src/lib/action/forward-message.action.ts +50 -0
- package/src/lib/action/get-chat-member.ts +40 -0
- package/src/lib/action/get-chat.action.ts +33 -0
- package/src/lib/action/get-file.action.ts +79 -0
- package/src/lib/action/pin-message.action.ts +41 -0
- package/src/lib/action/request-approval-message.ts +85 -0
- package/src/lib/action/send-audio.action.ts +123 -0
- package/src/lib/action/send-chat-action.action.ts +53 -0
- package/src/lib/action/send-document.action.ts +105 -0
- package/src/lib/action/send-location.action.ts +76 -0
- package/src/lib/action/send-media-group.action.ts +98 -0
- package/src/lib/action/send-media.action.ts +209 -0
- package/src/lib/action/send-poll.action.ts +140 -0
- package/src/lib/action/send-text-message.action.ts +54 -0
- package/src/lib/action/telegram-answer-callback-query.ts +64 -0
- package/src/lib/action/telegram-create-invite-link.ts +62 -0
- package/src/lib/action/telegram-delete-message.ts +37 -0
- package/src/lib/action/telegram-edit-message-text.ts +92 -0
- package/src/lib/action/telegram-forward-message.ts +54 -0
- package/src/lib/action/telegram-get-bot-info.ts +31 -0
- package/src/lib/action/telegram-get-chat-administrators.ts +36 -0
- package/src/lib/action/telegram-get-chat-member-count.ts +36 -0
- package/src/lib/action/telegram-get-chat-member.ts +43 -0
- package/src/lib/action/telegram-get-chat.ts +36 -0
- package/src/lib/action/telegram-get-file.ts +83 -0
- package/src/lib/action/telegram-pin-message.ts +45 -0
- package/src/lib/action/telegram-send-audio.ts +157 -0
- package/src/lib/action/telegram-send-chat-action.ts +61 -0
- package/src/lib/action/telegram-send-document.ts +136 -0
- package/src/lib/action/telegram-send-location.ts +89 -0
- package/src/lib/action/telegram-send-media-group.ts +119 -0
- package/src/lib/action/telegram-send-message.ts +79 -0
- package/src/lib/action/telegram-send-photo-or-video.ts +238 -0
- package/src/lib/action/telegram-send-poll.ts +170 -0
- package/src/lib/action/telegram-unpin-message.ts +38 -0
- package/src/lib/action/unpin-message.action.ts +36 -0
- package/src/lib/common/index.ts +147 -0
- package/src/lib/output-schemas.ts +1909 -0
- package/src/lib/trigger/new-message.ts +127 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const telegramSendDocumentAction: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
instructions: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
|
|
3
|
+
chat_id: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
message_thread_id: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
5
|
+
document: import("@agnocon/pieces-framework").FileProperty<false, false>;
|
|
6
|
+
document_id: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
7
|
+
caption: import("@agnocon/pieces-framework").LongTextProperty<false>;
|
|
8
|
+
format: import("@agnocon/pieces-framework").StaticDropdownProperty<string, false>;
|
|
9
|
+
instructions_format: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
|
|
10
|
+
disable_notification: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
11
|
+
protect_content: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
12
|
+
reply_to_message_id: import("@agnocon/pieces-framework").NumberProperty<false>;
|
|
13
|
+
reply_markup: import("@agnocon/pieces-framework").JsonProperty<false>;
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=send-document.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-document.action.d.ts","sourceRoot":"","sources":["../../../src/lib/action/send-document.action.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;EAyFrC,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.telegramSendDocumentAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/telegram-bot/src/lib/action/send-document.action.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const pieces_common_1 = require("@agnocon/pieces-common");
|
|
9
|
+
const form_data_1 = tslib_1.__importDefault(require("form-data"));
|
|
10
|
+
const common_1 = require("../common");
|
|
11
|
+
const __1 = require("../..");
|
|
12
|
+
const output_schemas_1 = require("../output-schemas");
|
|
13
|
+
exports.telegramSendDocumentAction = (0, pieces_framework_1.createAction)({
|
|
14
|
+
auth: __1.telegramBotAuth,
|
|
15
|
+
name: 'send_document',
|
|
16
|
+
displayName: 'Send Document',
|
|
17
|
+
description: 'Send a generic file (document) to a Telegram chat',
|
|
18
|
+
audience: 'human',
|
|
19
|
+
aiMetadata: { description: 'Uploads and sends a generic file (up to 50 MB) as a document to a Telegram chat, supplied as a file or a previously uploaded Telegram file_id. Use for arbitrary attachments (PDFs, archives, spreadsheets) rather than media shown inline. Not idempotent: each call sends a new document.', idempotent: false },
|
|
20
|
+
props: {
|
|
21
|
+
instructions: common_1.telegramCommons.chatIdInstructions(),
|
|
22
|
+
chat_id: common_1.telegramCommons.chatIdProp(),
|
|
23
|
+
message_thread_id: common_1.telegramCommons.messageThreadIdProp(),
|
|
24
|
+
document: pieces_framework_1.Property.File({
|
|
25
|
+
displayName: 'Document',
|
|
26
|
+
description: 'The document file to send. Telegram supports any file up to 50 MB.',
|
|
27
|
+
required: false,
|
|
28
|
+
}),
|
|
29
|
+
document_id: pieces_framework_1.Property.ShortText({
|
|
30
|
+
displayName: 'Document Id',
|
|
31
|
+
description: 'Reuse a document previously uploaded to Telegram by passing its file_id. Either provide a document or a document id.',
|
|
32
|
+
required: false,
|
|
33
|
+
}),
|
|
34
|
+
caption: pieces_framework_1.Property.LongText({
|
|
35
|
+
displayName: 'Caption',
|
|
36
|
+
description: 'Optional caption to display below the document (0–1024 chars).',
|
|
37
|
+
required: false,
|
|
38
|
+
}),
|
|
39
|
+
format: common_1.telegramCommons.parseModeProp(),
|
|
40
|
+
instructions_format: common_1.telegramCommons.formatLinkInstructions(),
|
|
41
|
+
disable_notification: common_1.telegramCommons.disableNotificationProp(),
|
|
42
|
+
protect_content: common_1.telegramCommons.protectContentProp(),
|
|
43
|
+
reply_to_message_id: common_1.telegramCommons.replyToMessageIdProp(),
|
|
44
|
+
reply_markup: common_1.telegramCommons.replyMarkupProp(),
|
|
45
|
+
},
|
|
46
|
+
outputSchema: output_schemas_1.sendDocumentActionOutputSchema,
|
|
47
|
+
run(ctx) {
|
|
48
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
var _a, _b, _c, _d, _e, _f;
|
|
50
|
+
const file = ctx.propsValue.document;
|
|
51
|
+
const documentId = ctx.propsValue.document_id;
|
|
52
|
+
const parseMode = common_1.telegramCommons.resolveParseMode(ctx.propsValue.format);
|
|
53
|
+
if (!file && !documentId) {
|
|
54
|
+
throw new Error('Either a document file or a document id must be provided.');
|
|
55
|
+
}
|
|
56
|
+
const headers = {};
|
|
57
|
+
let body;
|
|
58
|
+
if (file && file.data && file.filename) {
|
|
59
|
+
const form = new form_data_1.default();
|
|
60
|
+
form.append('document', file.data, file.filename);
|
|
61
|
+
form.append('chat_id', ctx.propsValue.chat_id);
|
|
62
|
+
if (ctx.propsValue.caption)
|
|
63
|
+
form.append('caption', ctx.propsValue.caption);
|
|
64
|
+
if (ctx.propsValue.message_thread_id) {
|
|
65
|
+
form.append('message_thread_id', ctx.propsValue.message_thread_id);
|
|
66
|
+
}
|
|
67
|
+
if (parseMode)
|
|
68
|
+
form.append('parse_mode', parseMode);
|
|
69
|
+
if (ctx.propsValue.disable_notification)
|
|
70
|
+
form.append('disable_notification', 'true');
|
|
71
|
+
if (ctx.propsValue.protect_content)
|
|
72
|
+
form.append('protect_content', 'true');
|
|
73
|
+
if (ctx.propsValue.reply_to_message_id) {
|
|
74
|
+
form.append('reply_to_message_id', String(ctx.propsValue.reply_to_message_id));
|
|
75
|
+
}
|
|
76
|
+
if (ctx.propsValue.reply_markup) {
|
|
77
|
+
form.append('reply_markup', JSON.stringify(ctx.propsValue.reply_markup));
|
|
78
|
+
}
|
|
79
|
+
body = form;
|
|
80
|
+
Object.assign(headers, form.getHeaders());
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
body = {
|
|
84
|
+
chat_id: ctx.propsValue.chat_id,
|
|
85
|
+
document: documentId,
|
|
86
|
+
caption: (_a = ctx.propsValue.caption) !== null && _a !== void 0 ? _a : undefined,
|
|
87
|
+
message_thread_id: (_b = ctx.propsValue.message_thread_id) !== null && _b !== void 0 ? _b : undefined,
|
|
88
|
+
parse_mode: parseMode,
|
|
89
|
+
disable_notification: (_c = ctx.propsValue.disable_notification) !== null && _c !== void 0 ? _c : false,
|
|
90
|
+
protect_content: (_d = ctx.propsValue.protect_content) !== null && _d !== void 0 ? _d : false,
|
|
91
|
+
reply_to_message_id: (_e = ctx.propsValue.reply_to_message_id) !== null && _e !== void 0 ? _e : undefined,
|
|
92
|
+
reply_markup: (_f = ctx.propsValue.reply_markup) !== null && _f !== void 0 ? _f : undefined,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
return yield pieces_common_1.httpClient.sendRequest({
|
|
96
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
97
|
+
url: common_1.telegramCommons.getApiUrl(ctx.auth, 'sendDocument'),
|
|
98
|
+
headers,
|
|
99
|
+
body,
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
//# sourceMappingURL=send-document.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-document.action.js","sourceRoot":"","sources":["../../../src/lib/action/send-document.action.ts"],"names":[],"mappings":";;;;AAAA,kHAAkH;AAClH,qEAAqE;AACrE,gEAImC;AACnC,0DAIgC;AAChC,kEAAiC;AACjC,sCAA4C;AAC5C,6BAAwC;AACxC,sDAAmE;AAEtD,QAAA,0BAA0B,GAAG,IAAA,+BAAY,EAAC;IACrD,IAAI,EAAE,mBAAe;IACrB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,mDAAmD;IAChE,QAAQ,EAAE,OAAO;IACjB,UAAU,EAAE,EAAE,WAAW,EAAE,6RAA6R,EAAE,UAAU,EAAE,KAAK,EAAE;IAC7U,KAAK,EAAE;QACL,YAAY,EAAE,wBAAe,CAAC,kBAAkB,EAAE;QAClD,OAAO,EAAE,wBAAe,CAAC,UAAU,EAAE;QACrC,iBAAiB,EAAE,wBAAe,CAAC,mBAAmB,EAAE;QACxD,QAAQ,EAAE,2BAAQ,CAAC,IAAI,CAAC;YACtB,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,oEAAoE;YACjF,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,aAAa;YAC1B,WAAW,EACT,sHAAsH;YACxH,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACzB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,gEAAgE;YAC7E,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,MAAM,EAAE,wBAAe,CAAC,aAAa,EAAE;QACvC,mBAAmB,EAAE,wBAAe,CAAC,sBAAsB,EAAE;QAC7D,oBAAoB,EAAE,wBAAe,CAAC,uBAAuB,EAAE;QAC/D,eAAe,EAAE,wBAAe,CAAC,kBAAkB,EAAE;QACrD,mBAAmB,EAAE,wBAAe,CAAC,oB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;iBACvD,CAAC;YACJ,CAAC;YAED,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAQ;gBACzC,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,wBAAe,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,cAAc,CAAC;gBACxD,OAAO;gBACP,IAAI;aACL,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const telegramSendLocationAction: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
instructions: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
|
|
3
|
+
chat_id: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
message_thread_id: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
5
|
+
latitude: import("@agnocon/pieces-framework").NumberProperty<true>;
|
|
6
|
+
longitude: import("@agnocon/pieces-framework").NumberProperty<true>;
|
|
7
|
+
horizontal_accuracy: import("@agnocon/pieces-framework").NumberProperty<false>;
|
|
8
|
+
live_period: import("@agnocon/pieces-framework").NumberProperty<false>;
|
|
9
|
+
heading: import("@agnocon/pieces-framework").NumberProperty<false>;
|
|
10
|
+
proximity_alert_radius: import("@agnocon/pieces-framework").NumberProperty<false>;
|
|
11
|
+
disable_notification: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
12
|
+
protect_content: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
13
|
+
reply_to_message_id: import("@agnocon/pieces-framework").NumberProperty<false>;
|
|
14
|
+
reply_markup: import("@agnocon/pieces-framework").JsonProperty<false>;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=send-location.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-location.action.d.ts","sourceRoot":"","sources":["../../../src/lib/action/send-location.action.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;EAqErC,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.telegramSendLocationAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/telegram-bot/src/lib/action/send-location.action.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const pieces_common_1 = require("@agnocon/pieces-common");
|
|
9
|
+
const common_1 = require("../common");
|
|
10
|
+
const __1 = require("../..");
|
|
11
|
+
const output_schemas_1 = require("../output-schemas");
|
|
12
|
+
exports.telegramSendLocationAction = (0, pieces_framework_1.createAction)({
|
|
13
|
+
auth: __1.telegramBotAuth,
|
|
14
|
+
name: 'send_location',
|
|
15
|
+
displayName: 'Send Location',
|
|
16
|
+
description: 'Send a geographic location (latitude/longitude) to a Telegram chat',
|
|
17
|
+
audience: 'human',
|
|
18
|
+
aiMetadata: { description: 'Sends a point location given as latitude and longitude to a Telegram chat, optionally as a live location that updates for a set period. Use to share a place or track a moving position; both coordinates are required. Not idempotent: each call posts a new location message.', idempotent: false },
|
|
19
|
+
props: {
|
|
20
|
+
instructions: common_1.telegramCommons.chatIdInstructions(),
|
|
21
|
+
chat_id: common_1.telegramCommons.chatIdProp(),
|
|
22
|
+
message_thread_id: common_1.telegramCommons.messageThreadIdProp(),
|
|
23
|
+
latitude: pieces_framework_1.Property.Number({
|
|
24
|
+
displayName: 'Latitude',
|
|
25
|
+
description: 'Latitude of the location.',
|
|
26
|
+
required: true,
|
|
27
|
+
}),
|
|
28
|
+
longitude: pieces_framework_1.Property.Number({
|
|
29
|
+
displayName: 'Longitude',
|
|
30
|
+
description: 'Longitude of the location.',
|
|
31
|
+
required: true,
|
|
32
|
+
}),
|
|
33
|
+
horizontal_accuracy: pieces_framework_1.Property.Number({
|
|
34
|
+
displayName: 'Horizontal Accuracy',
|
|
35
|
+
description: 'Radius of uncertainty for the location, in meters (0–1500).',
|
|
36
|
+
required: false,
|
|
37
|
+
}),
|
|
38
|
+
live_period: pieces_framework_1.Property.Number({
|
|
39
|
+
displayName: 'Live Period',
|
|
40
|
+
description: 'Number of seconds the location will be updated (60–86400). Use for live locations.',
|
|
41
|
+
required: false,
|
|
42
|
+
}),
|
|
43
|
+
heading: pieces_framework_1.Property.Number({
|
|
44
|
+
displayName: 'Heading',
|
|
45
|
+
description: 'For live locations, direction the user is moving in degrees (1–360).',
|
|
46
|
+
required: false,
|
|
47
|
+
}),
|
|
48
|
+
proximity_alert_radius: pieces_framework_1.Property.Number({
|
|
49
|
+
displayName: 'Proximity Alert Radius',
|
|
50
|
+
description: 'For live locations, the max distance (1–100000 m) for proximity alerts about approaching another chat member.',
|
|
51
|
+
required: false,
|
|
52
|
+
}),
|
|
53
|
+
disable_notification: common_1.telegramCommons.disableNotificationProp(),
|
|
54
|
+
protect_content: common_1.telegramCommons.protectContentProp(),
|
|
55
|
+
reply_to_message_id: common_1.telegramCommons.replyToMessageIdProp(),
|
|
56
|
+
reply_markup: common_1.telegramCommons.replyMarkupProp(),
|
|
57
|
+
},
|
|
58
|
+
outputSchema: output_schemas_1.sendLocationActionOutputSchema,
|
|
59
|
+
run(ctx) {
|
|
60
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
62
|
+
return yield pieces_common_1.httpClient.sendRequest({
|
|
63
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
64
|
+
url: common_1.telegramCommons.getApiUrl(ctx.auth, 'sendLocation'),
|
|
65
|
+
body: {
|
|
66
|
+
chat_id: ctx.propsValue.chat_id,
|
|
67
|
+
latitude: ctx.propsValue.latitude,
|
|
68
|
+
longitude: ctx.propsValue.longitude,
|
|
69
|
+
message_thread_id: (_a = ctx.propsValue.message_thread_id) !== null && _a !== void 0 ? _a : undefined,
|
|
70
|
+
horizontal_accuracy: (_b = ctx.propsValue.horizontal_accuracy) !== null && _b !== void 0 ? _b : undefined,
|
|
71
|
+
live_period: (_c = ctx.propsValue.live_period) !== null && _c !== void 0 ? _c : undefined,
|
|
72
|
+
heading: (_d = ctx.propsValue.heading) !== null && _d !== void 0 ? _d : undefined,
|
|
73
|
+
proximity_alert_radius: (_e = ctx.propsValue.proximity_alert_radius) !== null && _e !== void 0 ? _e : undefined,
|
|
74
|
+
disable_notification: (_f = ctx.propsValue.disable_notification) !== null && _f !== void 0 ? _f : false,
|
|
75
|
+
protect_content: (_g = ctx.propsValue.protect_content) !== null && _g !== void 0 ? _g : false,
|
|
76
|
+
reply_to_message_id: (_h = ctx.propsValue.reply_to_message_id) !== null && _h !== void 0 ? _h : undefined,
|
|
77
|
+
reply_markup: (_j = ctx.propsValue.reply_markup) !== null && _j !== void 0 ? _j : undefined,
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
//# sourceMappingURL=send-location.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-location.action.js","sourceRoot":"","sources":["../../../src/lib/action/send-location.action.ts"],"names":[],"mappings":";;;;AAAA,kHAAkH;AAClH,qEAAqE;AACrE,gEAAmE;AACnE,0DAAgE;AAChE,sCAA4C;AAC5C,6BAAwC;AACxC,sDAAmE;AAEtD,QAAA,0BAA0B,GAAG,IAAA,+BAAY,EAAC;IACrD,IAAI,EAAE,mBAAe;IACrB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,oEAAoE;IACjF,QAAQ,EAAE,OAAO;IACjB,UAAU,EAAE,EAAE,WAAW,EAAE,iRAAiR,EAAE,UAAU,EAAE,KAAK,EAAE;IACjU,KAAK,EAAE;QACL,YAAY,EA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U,CAAC,IAAI;gBACvB,GAAG,EAAE,wBAAe,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,cAAc,CAAC;gBACxD,IAAI,EAAE;oBACJ,OAAO,EAAE,GAAG,CAAC,UAAU,CAAC,OAAO;oBAC/B,QAAQ,EAAE,GAAG,CAAC,UAAU,CAAC,QAAQ;oBACjC,SAAS,EAAE,GAAG,CAAC,UAAU,CAAC,SAAS;oBACnC,iBAAiB,EAAE,MAAA,GAAG,CAAC,UAAU,CAAC,iBAAiB,mCAAI,SAAS;oBAChE,mBAAmB,EAAE,MAAA,GAAG,CAAC,UAAU,CAAC,mBAAmB,mCAAI,SAAS;oBACpE,WAAW,EAAE,MAAA,GAAG,CAAC,UAAU,CAAC,WAAW,mCAAI,SAAS;oBACpD,OAAO,EAAE,MAAA,GAAG,CAAC,UAAU,CAAC,OAAO,mCAAI,SAAS;oBAC5C,sBAAsB,EAAE,MAAA,GAAG,CAAC,UAAU,CAAC,sBAAsB,mCAAI,SAAS;oBAC1E,oBAAoB,EAAE,MAAA,GAAG,CAAC,UAAU,CAAC,oBAAoB,mCAAI,KAAK;oBAClE,eAAe,EAAE,MAAA,GAAG,CAAC,UAAU,CAAC,eAAe,mCAAI,KAAK;oBACxD,mBAAmB,EAAE,MAAA,GAAG,CAAC,UAAU,CAAC,mBAAmB,mCAAI,SAAS;oBACpE,YAAY,EAAE,MAAA,GAAG,CAAC,UAAU,CAAC,YAAY,mCAAI,SAAS;iBACvD;aACF,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const telegramSendMediaGroupAction: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
instructions: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
|
|
3
|
+
chat_id: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
message_thread_id: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
5
|
+
media: import("@agnocon/pieces-framework").ArrayProperty<true> | import("@agnocon/pieces-framework").ArrayProperty<false>;
|
|
6
|
+
parse_mode: import("@agnocon/pieces-framework").StaticDropdownProperty<string, false>;
|
|
7
|
+
disable_notification: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
8
|
+
protect_content: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
9
|
+
reply_to_message_id: import("@agnocon/pieces-framework").NumberProperty<false>;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=send-media-group.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-media-group.action.d.ts","sourceRoot":"","sources":["../../../src/lib/action/send-media-group.action.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,4BAA4B;;;;;;;;;EAkFvC,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.telegramSendMediaGroupAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/telegram-bot/src/lib/action/send-media-group.action.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const pieces_common_1 = require("@agnocon/pieces-common");
|
|
9
|
+
const common_1 = require("../common");
|
|
10
|
+
const __1 = require("../..");
|
|
11
|
+
const output_schemas_1 = require("../output-schemas");
|
|
12
|
+
const MEDIA_GROUP_LIMIT = 10;
|
|
13
|
+
exports.telegramSendMediaGroupAction = (0, pieces_framework_1.createAction)({
|
|
14
|
+
auth: __1.telegramBotAuth,
|
|
15
|
+
name: 'send_media_group',
|
|
16
|
+
displayName: 'Send Media Group',
|
|
17
|
+
description: 'Send a group of 2–10 photos, videos, documents or audios as an album to a chat',
|
|
18
|
+
audience: 'human',
|
|
19
|
+
aiMetadata: { description: 'Sends 2–10 media items (each a public URL or a Telegram file_id) as a single grouped album to a chat. Use to post several photos/videos together; photo and video may be mixed, but audio-only and document-only groups cannot be combined with other types. Not idempotent: each call posts a new album.', idempotent: false },
|
|
20
|
+
props: {
|
|
21
|
+
instructions: common_1.telegramCommons.chatIdInstructions(),
|
|
22
|
+
chat_id: common_1.telegramCommons.chatIdProp(),
|
|
23
|
+
message_thread_id: common_1.telegramCommons.messageThreadIdProp(),
|
|
24
|
+
media: pieces_framework_1.Property.Array({
|
|
25
|
+
displayName: 'Media',
|
|
26
|
+
description: 'Media items to send. Each must be a URL or a Telegram file_id. Mixing photo/video is allowed; audio and document groups cannot be mixed with other types.',
|
|
27
|
+
required: true,
|
|
28
|
+
properties: {
|
|
29
|
+
type: pieces_framework_1.Property.StaticDropdown({
|
|
30
|
+
displayName: 'Type',
|
|
31
|
+
required: true,
|
|
32
|
+
options: {
|
|
33
|
+
options: [
|
|
34
|
+
{ label: 'Photo', value: 'photo' },
|
|
35
|
+
{ label: 'Video', value: 'video' },
|
|
36
|
+
{ label: 'Audio', value: 'audio' },
|
|
37
|
+
{ label: 'Document', value: 'document' },
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
defaultValue: 'photo',
|
|
41
|
+
}),
|
|
42
|
+
media: pieces_framework_1.Property.ShortText({
|
|
43
|
+
displayName: 'Media URL or File Id',
|
|
44
|
+
description: 'Public URL or a Telegram file_id of an already uploaded media item.',
|
|
45
|
+
required: true,
|
|
46
|
+
}),
|
|
47
|
+
caption: pieces_framework_1.Property.LongText({
|
|
48
|
+
displayName: 'Caption',
|
|
49
|
+
required: false,
|
|
50
|
+
}),
|
|
51
|
+
},
|
|
52
|
+
}),
|
|
53
|
+
parse_mode: common_1.telegramCommons.parseModeProp(),
|
|
54
|
+
disable_notification: common_1.telegramCommons.disableNotificationProp(),
|
|
55
|
+
protect_content: common_1.telegramCommons.protectContentProp(),
|
|
56
|
+
reply_to_message_id: common_1.telegramCommons.replyToMessageIdProp(),
|
|
57
|
+
},
|
|
58
|
+
outputSchema: output_schemas_1.sendMediaGroupActionOutputSchema,
|
|
59
|
+
run(ctx) {
|
|
60
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
var _a, _b, _c, _d, _e;
|
|
62
|
+
const items = ((_a = ctx.propsValue.media) !== null && _a !== void 0 ? _a : []);
|
|
63
|
+
if (items.length < 2 || items.length > MEDIA_GROUP_LIMIT) {
|
|
64
|
+
throw new Error('A media group must contain 2–10 media items.');
|
|
65
|
+
}
|
|
66
|
+
const parseMode = common_1.telegramCommons.resolveParseMode(ctx.propsValue.parse_mode);
|
|
67
|
+
const media = items.map((item) => {
|
|
68
|
+
var _a, _b;
|
|
69
|
+
const type = String((_a = item['type']) !== null && _a !== void 0 ? _a : 'photo');
|
|
70
|
+
const value = String((_b = item['media']) !== null && _b !== void 0 ? _b : '');
|
|
71
|
+
if (!value) {
|
|
72
|
+
throw new Error('Each media item must define a URL or file_id.');
|
|
73
|
+
}
|
|
74
|
+
const caption = item['caption'] ? String(item['caption']) : undefined;
|
|
75
|
+
const mediaItem = { type, media: value };
|
|
76
|
+
if (caption)
|
|
77
|
+
mediaItem.caption = caption;
|
|
78
|
+
if (caption && parseMode)
|
|
79
|
+
mediaItem.parse_mode = parseMode;
|
|
80
|
+
return mediaItem;
|
|
81
|
+
});
|
|
82
|
+
return yield pieces_common_1.httpClient.sendRequest({
|
|
83
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
84
|
+
url: common_1.telegramCommons.getApiUrl(ctx.auth, 'sendMediaGroup'),
|
|
85
|
+
body: {
|
|
86
|
+
chat_id: ctx.propsValue.chat_id,
|
|
87
|
+
message_thread_id: (_b = ctx.propsValue.message_thread_id) !== null && _b !== void 0 ? _b : undefined,
|
|
88
|
+
media,
|
|
89
|
+
disable_notification: (_c = ctx.propsValue.disable_notification) !== null && _c !== void 0 ? _c : false,
|
|
90
|
+
protect_content: (_d = ctx.propsValue.protect_content) !== null && _d !== void 0 ? _d : false,
|
|
91
|
+
reply_to_message_id: (_e = ctx.propsValue.reply_to_message_id) !== null && _e !== void 0 ? _e : undefined,
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
//# sourceMappingURL=send-media-group.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-media-group.action.js","sourceRoot":"","sources":["../../../src/lib/action/send-media-group.action.ts"],"names":[],"mappings":";;;;AAAA,qHAAqH;AACrH,qEAAqE;AACrE,gEAAmE;AACnE,0DAAgE;AAChE,sCAA4C;AAC5C,6BAAwC;AACxC,sDAAqE;AAErE,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAShB,QAAA,4BAA4B,GAAG,IAAA,+BAAY,EAAC;IACvD,IAAI,EAAE,mBAAe;IACrB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EACT,gFAAgF;IAClF,QAAQ,EAAE,OAAO;IACjB,UAAU,EAAE,EAAE,WAAW,EAAE,2SAA2S,EAAE,UAAU,EAAE,KAAK,EAAE;IAC3V,KAAK,EAAE;QACL,YAAY,EAAE,wBAAe,CAAC,kBAAkB,EAAE;QAClD,OAAO,EAAE,wBAAe,CAAC,UAAU,EAAE;QACrC,iBAAiB,EAAE,wBAAe,CAAC,mBAAmB,EAAE;QACxD,KAAK,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACpB,WAAW,EAAE,OAAO;YACpB,WAAW,EACT,2JAA2J;YAC7J,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE;gBACV,IAAI,EAAE,2BAAQ,CAAC,cAAc,CAAC;oBAC5B,WAAW,EAAE,MAAM;oBACnB,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE;wBACP,OAAO,EAAE;4BACP,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAA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
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const telegramSendMediaAction: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
instructions: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
|
|
3
|
+
chat_id: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
message_thread_id: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
5
|
+
media_type: import("@agnocon/pieces-framework").StaticDropdownProperty<string, true>;
|
|
6
|
+
media: import("@agnocon/pieces-framework").DynamicProperties<false, import("@agnocon/pieces-framework").SecretTextProperty<true>>;
|
|
7
|
+
format: import("@agnocon/pieces-framework").StaticDropdownProperty<string, false>;
|
|
8
|
+
instructions_format: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
|
|
9
|
+
message: import("@agnocon/pieces-framework").LongTextProperty<false>;
|
|
10
|
+
disable_notification: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
11
|
+
protect_content: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
12
|
+
reply_markup: import("@agnocon/pieces-framework").JsonProperty<false>;
|
|
13
|
+
}>;
|
|
14
|
+
//# sourceMappingURL=send-media.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-media.action.d.ts","sourceRoot":"","sources":["../../../src/lib/action/send-media.action.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;EA+LlC,CAAC"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.telegramSendMediaAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/telegram-bot/src/lib/action/send-media.action.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const pieces_common_1 = require("@agnocon/pieces-common");
|
|
9
|
+
const common_1 = require("../common");
|
|
10
|
+
const __1 = require("../..");
|
|
11
|
+
const form_data_1 = tslib_1.__importDefault(require("form-data"));
|
|
12
|
+
const output_schemas_1 = require("../output-schemas");
|
|
13
|
+
exports.telegramSendMediaAction = (0, pieces_framework_1.createAction)({
|
|
14
|
+
auth: __1.telegramBotAuth,
|
|
15
|
+
name: 'send_media',
|
|
16
|
+
description: 'Send a media message (photo, video, sticker, GIF) through a Telegram bot',
|
|
17
|
+
audience: 'human',
|
|
18
|
+
aiMetadata: { description: 'Sends a single photo, video, sticker, or animated GIF to a Telegram chat, supplied either as an uploaded file or a previously uploaded Telegram file_id. Use when delivering one rich-media item with an optional caption; for multiple items in one album use Send Media Group. Not idempotent: each call posts a new message.', idempotent: false },
|
|
19
|
+
displayName: 'Send Media',
|
|
20
|
+
props: {
|
|
21
|
+
instructions: common_1.telegramCommons.chatIdInstructions(),
|
|
22
|
+
chat_id: common_1.telegramCommons.chatIdProp(),
|
|
23
|
+
message_thread_id: common_1.telegramCommons.messageThreadIdProp(),
|
|
24
|
+
media_type: pieces_framework_1.Property.StaticDropdown({
|
|
25
|
+
displayName: 'Media Type',
|
|
26
|
+
required: true,
|
|
27
|
+
options: {
|
|
28
|
+
disabled: false,
|
|
29
|
+
placeholder: 'Select media type',
|
|
30
|
+
options: [
|
|
31
|
+
{ label: 'Image', value: 'photo' },
|
|
32
|
+
{ label: 'Video', value: 'video' },
|
|
33
|
+
{ label: 'Sticker', value: 'sticker' },
|
|
34
|
+
{ label: 'GIF', value: 'animation' },
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
}),
|
|
38
|
+
media: pieces_framework_1.Property.DynamicProperties({
|
|
39
|
+
auth: __1.telegramBotAuth,
|
|
40
|
+
displayName: 'Media Properties',
|
|
41
|
+
required: false,
|
|
42
|
+
refreshers: ['media_type'],
|
|
43
|
+
props(_a) {
|
|
44
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ media_type }) {
|
|
45
|
+
const propsBuilders = {
|
|
46
|
+
photo: () => ({
|
|
47
|
+
photo: pieces_framework_1.Property.File({
|
|
48
|
+
displayName: 'Image',
|
|
49
|
+
description: 'The image to be uploaded as a file',
|
|
50
|
+
required: false,
|
|
51
|
+
}),
|
|
52
|
+
photoId: pieces_framework_1.Property.ShortText({
|
|
53
|
+
displayName: 'Image Id',
|
|
54
|
+
description: "The image id previously uploaded to Telegram's servers",
|
|
55
|
+
required: false,
|
|
56
|
+
}),
|
|
57
|
+
}),
|
|
58
|
+
video: () => ({
|
|
59
|
+
video: pieces_framework_1.Property.File({
|
|
60
|
+
displayName: 'Video',
|
|
61
|
+
description: 'The video to be uploaded as a file',
|
|
62
|
+
required: false,
|
|
63
|
+
}),
|
|
64
|
+
videoId: pieces_framework_1.Property.ShortText({
|
|
65
|
+
displayName: 'Video Id',
|
|
66
|
+
description: "The video id previously uploaded to Telegram's servers",
|
|
67
|
+
required: false,
|
|
68
|
+
}),
|
|
69
|
+
}),
|
|
70
|
+
sticker: () => ({
|
|
71
|
+
sticker: pieces_framework_1.Property.File({
|
|
72
|
+
displayName: 'Sticker',
|
|
73
|
+
description: 'The sticker to be uploaded as a file (supports .WEBP files for static and .TGS for animated)',
|
|
74
|
+
required: false,
|
|
75
|
+
}),
|
|
76
|
+
emoji: pieces_framework_1.Property.ShortText({
|
|
77
|
+
displayName: 'Emoji',
|
|
78
|
+
description: 'Emoji associated with the sticker. Only for just uploaded stickers',
|
|
79
|
+
required: false,
|
|
80
|
+
}),
|
|
81
|
+
stickerId: pieces_framework_1.Property.ShortText({
|
|
82
|
+
displayName: 'Sticker Id',
|
|
83
|
+
description: "The sticker id previously uploaded to Telegram's servers",
|
|
84
|
+
required: false,
|
|
85
|
+
}),
|
|
86
|
+
}),
|
|
87
|
+
animation: () => ({
|
|
88
|
+
animation: pieces_framework_1.Property.File({
|
|
89
|
+
displayName: 'GIF',
|
|
90
|
+
description: 'The GIF or MPEG-4 without sound file to be uploaded as a auto-playing animation',
|
|
91
|
+
required: false,
|
|
92
|
+
}),
|
|
93
|
+
animationId: pieces_framework_1.Property.ShortText({
|
|
94
|
+
displayName: 'GIF Id',
|
|
95
|
+
description: "The GIF or MPEG-4 without sound id previously uploaded to Telegram's servers",
|
|
96
|
+
required: false,
|
|
97
|
+
}),
|
|
98
|
+
duration: pieces_framework_1.Property.Number({
|
|
99
|
+
displayName: 'Duration',
|
|
100
|
+
description: 'Duration of sent video in seconds',
|
|
101
|
+
required: false,
|
|
102
|
+
}),
|
|
103
|
+
}),
|
|
104
|
+
};
|
|
105
|
+
const builder = propsBuilders[media_type];
|
|
106
|
+
if (!builder) {
|
|
107
|
+
return {};
|
|
108
|
+
}
|
|
109
|
+
return builder();
|
|
110
|
+
});
|
|
111
|
+
},
|
|
112
|
+
}),
|
|
113
|
+
format: common_1.telegramCommons.parseModeProp(),
|
|
114
|
+
instructions_format: common_1.telegramCommons.formatLinkInstructions(),
|
|
115
|
+
message: pieces_framework_1.Property.LongText({
|
|
116
|
+
displayName: 'Caption',
|
|
117
|
+
description: 'The caption to send with the media',
|
|
118
|
+
required: false,
|
|
119
|
+
}),
|
|
120
|
+
disable_notification: common_1.telegramCommons.disableNotificationProp(),
|
|
121
|
+
protect_content: common_1.telegramCommons.protectContentProp(),
|
|
122
|
+
reply_markup: common_1.telegramCommons.replyMarkupProp(),
|
|
123
|
+
},
|
|
124
|
+
outputSchema: output_schemas_1.sendMediaActionOutputSchema,
|
|
125
|
+
run(ctx) {
|
|
126
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
128
|
+
const mediaType = ctx.propsValue['media_type'];
|
|
129
|
+
if (!mediaType) {
|
|
130
|
+
throw new Error('media_type is required');
|
|
131
|
+
}
|
|
132
|
+
const methods = {
|
|
133
|
+
photo: 'sendPhoto',
|
|
134
|
+
video: 'sendVideo',
|
|
135
|
+
sticker: 'sendSticker',
|
|
136
|
+
animation: 'sendAnimation',
|
|
137
|
+
};
|
|
138
|
+
const method = methods[mediaType];
|
|
139
|
+
if (!method) {
|
|
140
|
+
throw new Error('Unknown media type method (' + mediaType + ')');
|
|
141
|
+
}
|
|
142
|
+
const headers = {};
|
|
143
|
+
const queryParams = {};
|
|
144
|
+
let body = undefined;
|
|
145
|
+
const file = (_a = ctx.propsValue.media) === null || _a === void 0 ? void 0 : _a[mediaType];
|
|
146
|
+
const id = (_b = ctx.propsValue.media) === null || _b === void 0 ? void 0 : _b[mediaType + 'Id'];
|
|
147
|
+
const parseMode = common_1.telegramCommons.resolveParseMode(ctx.propsValue['format']);
|
|
148
|
+
if (file && file.data && file.filename) {
|
|
149
|
+
const form = new form_data_1.default();
|
|
150
|
+
form.append(mediaType, file.data, file.filename);
|
|
151
|
+
form.append('chat_id', ctx.propsValue['chat_id']);
|
|
152
|
+
if (ctx.propsValue['message']) {
|
|
153
|
+
form.append('caption', ctx.propsValue['message']);
|
|
154
|
+
}
|
|
155
|
+
if (ctx.propsValue['message_thread_id']) {
|
|
156
|
+
form.append('message_thread_id', ctx.propsValue['message_thread_id']);
|
|
157
|
+
}
|
|
158
|
+
if (parseMode) {
|
|
159
|
+
form.append('parse_mode', parseMode);
|
|
160
|
+
}
|
|
161
|
+
if (ctx.propsValue['disable_notification']) {
|
|
162
|
+
form.append('disable_notification', 'true');
|
|
163
|
+
}
|
|
164
|
+
if (ctx.propsValue['protect_content']) {
|
|
165
|
+
form.append('protect_content', 'true');
|
|
166
|
+
}
|
|
167
|
+
if (ctx.propsValue['reply_markup']) {
|
|
168
|
+
form.append('reply_markup', JSON.stringify(ctx.propsValue['reply_markup']));
|
|
169
|
+
}
|
|
170
|
+
body = form;
|
|
171
|
+
Object.assign(headers, form.getHeaders());
|
|
172
|
+
}
|
|
173
|
+
else if (typeof id !== 'undefined' && id !== '') {
|
|
174
|
+
body = {
|
|
175
|
+
[mediaType]: id,
|
|
176
|
+
chat_id: ctx.propsValue['chat_id'],
|
|
177
|
+
caption: (_c = ctx.propsValue['message']) !== null && _c !== void 0 ? _c : undefined,
|
|
178
|
+
message_thread_id: (_d = ctx.propsValue['message_thread_id']) !== null && _d !== void 0 ? _d : undefined,
|
|
179
|
+
parse_mode: parseMode,
|
|
180
|
+
disable_notification: (_e = ctx.propsValue['disable_notification']) !== null && _e !== void 0 ? _e : false,
|
|
181
|
+
protect_content: (_f = ctx.propsValue['protect_content']) !== null && _f !== void 0 ? _f : false,
|
|
182
|
+
reply_markup: (_g = ctx.propsValue['reply_markup']) !== null && _g !== void 0 ? _g : undefined,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
throw new Error('No media defined. Provide either a file or an id.');
|
|
187
|
+
}
|
|
188
|
+
return yield pieces_common_1.httpClient.sendRequest({
|
|
189
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
190
|
+
url: common_1.telegramCommons.getApiUrl(ctx.auth, method),
|
|
191
|
+
headers,
|
|
192
|
+
body,
|
|
193
|
+
queryParams,
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
|
+
//# sourceMappingURL=send-media.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-media.action.js","sourceRoot":"","sources":["../../../src/lib/action/send-media.action.ts"],"names":[],"mappings":";;;;AAAA,+GAA+G;AAC/G,qEAAqE;AACrE,gEAKmC;AACnC,0DAKgC;AAChC,sCAA4C;AAC5C,6BAAwC;AACxC,kEAAiC;AACjC,sDAAgE;AAEnD,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,mBAAe;IACrB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,0EAA0E;IACvF,QAAQ,EAAE,OAAO;IACjB,UAAU,EAAE,EAAE,WAAW,EAAE,iUAAiU,E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SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC;gBAChD,OAAO;gBACP,IAAI;gBACJ,WAAW;aACZ,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const telegramSendPollAction: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
instructions: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
|
|
3
|
+
chat_id: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
message_thread_id: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
5
|
+
question: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
6
|
+
options: import("@agnocon/pieces-framework").ArrayProperty<true>;
|
|
7
|
+
is_anonymous: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
8
|
+
type: import("@agnocon/pieces-framework").StaticDropdownProperty<string, false>;
|
|
9
|
+
allows_multiple_answers: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
10
|
+
correct_option_id: import("@agnocon/pieces-framework").NumberProperty<false>;
|
|
11
|
+
explanation: import("@agnocon/pieces-framework").LongTextProperty<false>;
|
|
12
|
+
explanation_parse_mode: import("@agnocon/pieces-framework").StaticDropdownProperty<string, false>;
|
|
13
|
+
open_period: import("@agnocon/pieces-framework").NumberProperty<false>;
|
|
14
|
+
close_date: import("@agnocon/pieces-framework").DateTimeProperty<false>;
|
|
15
|
+
is_closed: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
16
|
+
disable_notification: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
17
|
+
protect_content: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
18
|
+
reply_to_message_id: import("@agnocon/pieces-framework").NumberProperty<false>;
|
|
19
|
+
reply_markup: import("@agnocon/pieces-framework").JsonProperty<false>;
|
|
20
|
+
}>;
|
|
21
|
+
//# sourceMappingURL=send-poll.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-poll.action.d.ts","sourceRoot":"","sources":["../../../src/lib/action/send-poll.action.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;EAqIjC,CAAC"}
|