@textbee/n8n-nodes-textbee 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +22 -0
- package/NOTICE.md +20 -0
- package/README.md +109 -2
- package/dist/credentials/TextbeeApi.credentials.d.ts +10 -0
- package/dist/credentials/TextbeeApi.credentials.js +57 -0
- package/dist/credentials/TextbeeApi.credentials.js.map +1 -0
- package/dist/icons/textbee.dark.svg +1 -0
- package/dist/icons/textbee.svg +1 -0
- package/dist/nodes/Textbee/Textbee.node.d.ts +10 -0
- package/dist/nodes/Textbee/Textbee.node.js +80 -0
- package/dist/nodes/Textbee/Textbee.node.js.map +1 -0
- package/dist/nodes/Textbee/Textbee.node.json +19 -0
- package/dist/nodes/Textbee/listSearch/searchDevices.d.ts +2 -0
- package/dist/nodes/Textbee/listSearch/searchDevices.js +36 -0
- package/dist/nodes/Textbee/listSearch/searchDevices.js.map +1 -0
- package/dist/nodes/Textbee/resources/device/get.d.ts +19 -0
- package/dist/nodes/Textbee/resources/device/get.js +31 -0
- package/dist/nodes/Textbee/resources/device/get.js.map +1 -0
- package/dist/nodes/Textbee/resources/device/getAll.d.ts +16 -0
- package/dist/nodes/Textbee/resources/device/getAll.js +29 -0
- package/dist/nodes/Textbee/resources/device/getAll.js.map +1 -0
- package/dist/nodes/Textbee/resources/device/index.d.ts +2 -0
- package/dist/nodes/Textbee/resources/device/index.js +39 -0
- package/dist/nodes/Textbee/resources/device/index.js.map +1 -0
- package/dist/nodes/Textbee/resources/message/get.d.ts +19 -0
- package/dist/nodes/Textbee/resources/message/get.js +42 -0
- package/dist/nodes/Textbee/resources/message/get.js.map +1 -0
- package/dist/nodes/Textbee/resources/message/getAll.d.ts +16 -0
- package/dist/nodes/Textbee/resources/message/getAll.js +240 -0
- package/dist/nodes/Textbee/resources/message/getAll.js.map +1 -0
- package/dist/nodes/Textbee/resources/message/getBatch.d.ts +19 -0
- package/dist/nodes/Textbee/resources/message/getBatch.js +42 -0
- package/dist/nodes/Textbee/resources/message/getBatch.js.map +1 -0
- package/dist/nodes/Textbee/resources/message/index.d.ts +2 -0
- package/dist/nodes/Textbee/resources/message/index.js +66 -0
- package/dist/nodes/Textbee/resources/message/index.js.map +1 -0
- package/dist/nodes/Textbee/resources/message/send.d.ts +19 -0
- package/dist/nodes/Textbee/resources/message/send.js +124 -0
- package/dist/nodes/Textbee/resources/message/send.js.map +1 -0
- package/dist/nodes/Textbee/resources/message/sendBulk.d.ts +19 -0
- package/dist/nodes/Textbee/resources/message/sendBulk.js +110 -0
- package/dist/nodes/Textbee/resources/message/sendBulk.js.map +1 -0
- package/dist/nodes/Textbee/resources/stats/get.d.ts +16 -0
- package/dist/nodes/Textbee/resources/stats/get.js +29 -0
- package/dist/nodes/Textbee/resources/stats/get.js.map +1 -0
- package/dist/nodes/Textbee/resources/stats/index.d.ts +2 -0
- package/dist/nodes/Textbee/resources/stats/index.js +30 -0
- package/dist/nodes/Textbee/resources/stats/index.js.map +1 -0
- package/dist/nodes/Textbee/resources/webhook/create.d.ts +22 -0
- package/dist/nodes/Textbee/resources/webhook/create.js +98 -0
- package/dist/nodes/Textbee/resources/webhook/create.js.map +1 -0
- package/dist/nodes/Textbee/resources/webhook/delete.d.ts +19 -0
- package/dist/nodes/Textbee/resources/webhook/delete.js +35 -0
- package/dist/nodes/Textbee/resources/webhook/delete.js.map +1 -0
- package/dist/nodes/Textbee/resources/webhook/get.d.ts +20 -0
- package/dist/nodes/Textbee/resources/webhook/get.js +35 -0
- package/dist/nodes/Textbee/resources/webhook/get.js.map +1 -0
- package/dist/nodes/Textbee/resources/webhook/getAll.d.ts +17 -0
- package/dist/nodes/Textbee/resources/webhook/getAll.js +30 -0
- package/dist/nodes/Textbee/resources/webhook/getAll.js.map +1 -0
- package/dist/nodes/Textbee/resources/webhook/getNotifications.d.ts +20 -0
- package/dist/nodes/Textbee/resources/webhook/getNotifications.js +213 -0
- package/dist/nodes/Textbee/resources/webhook/getNotifications.js.map +1 -0
- package/dist/nodes/Textbee/resources/webhook/index.d.ts +2 -0
- package/dist/nodes/Textbee/resources/webhook/index.js +75 -0
- package/dist/nodes/Textbee/resources/webhook/index.js.map +1 -0
- package/dist/nodes/Textbee/resources/webhook/update.d.ts +20 -0
- package/dist/nodes/Textbee/resources/webhook/update.js +115 -0
- package/dist/nodes/Textbee/resources/webhook/update.js.map +1 -0
- package/dist/nodes/Textbee/shared/baseUrl.d.ts +2 -0
- package/dist/nodes/Textbee/shared/baseUrl.js +17 -0
- package/dist/nodes/Textbee/shared/baseUrl.js.map +1 -0
- package/dist/nodes/Textbee/shared/bulk.d.ts +20 -0
- package/dist/nodes/Textbee/shared/bulk.js +56 -0
- package/dist/nodes/Textbee/shared/bulk.js.map +1 -0
- package/dist/nodes/Textbee/shared/descriptions.d.ts +8 -0
- package/dist/nodes/Textbee/shared/descriptions.js +46 -0
- package/dist/nodes/Textbee/shared/descriptions.js.map +1 -0
- package/dist/nodes/Textbee/shared/signature.d.ts +2 -0
- package/dist/nodes/Textbee/shared/signature.js +16 -0
- package/dist/nodes/Textbee/shared/signature.js.map +1 -0
- package/dist/nodes/Textbee/shared/subscription.d.ts +15 -0
- package/dist/nodes/Textbee/shared/subscription.js +30 -0
- package/dist/nodes/Textbee/shared/subscription.js.map +1 -0
- package/dist/nodes/Textbee/shared/transport.d.ts +5 -0
- package/dist/nodes/Textbee/shared/transport.js +29 -0
- package/dist/nodes/Textbee/shared/transport.js.map +1 -0
- package/dist/nodes/Textbee/shared/validation.d.ts +5 -0
- package/dist/nodes/Textbee/shared/validation.js +52 -0
- package/dist/nodes/Textbee/shared/validation.js.map +1 -0
- package/dist/nodes/TextbeeTrigger/TextbeeTrigger.node.d.ts +12 -0
- package/dist/nodes/TextbeeTrigger/TextbeeTrigger.node.js +220 -0
- package/dist/nodes/TextbeeTrigger/TextbeeTrigger.node.js.map +1 -0
- package/dist/nodes/TextbeeTrigger/TextbeeTrigger.node.json +22 -0
- package/package.json +79 -5
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.webhookGetNotificationsRouting = exports.webhookGetNotificationsDescription = void 0;
|
|
4
|
+
const validation_1 = require("../../shared/validation");
|
|
5
|
+
const showOnlyForWebhookNotifications = {
|
|
6
|
+
operation: ['getNotifications'],
|
|
7
|
+
resource: ['webhook'],
|
|
8
|
+
};
|
|
9
|
+
exports.webhookGetNotificationsDescription = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Return All',
|
|
12
|
+
name: 'returnAll',
|
|
13
|
+
type: 'boolean',
|
|
14
|
+
default: false,
|
|
15
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
16
|
+
displayOptions: {
|
|
17
|
+
show: showOnlyForWebhookNotifications,
|
|
18
|
+
},
|
|
19
|
+
routing: {
|
|
20
|
+
send: {
|
|
21
|
+
paginate: '={{ $value }}',
|
|
22
|
+
type: 'query',
|
|
23
|
+
property: 'limit',
|
|
24
|
+
value: '100',
|
|
25
|
+
},
|
|
26
|
+
operations: {
|
|
27
|
+
pagination: {
|
|
28
|
+
type: 'generic',
|
|
29
|
+
properties: {
|
|
30
|
+
continue: '={{ Number($response.body?.data?.meta?.page ?? 0) < Number($response.body?.data?.meta?.totalPages ?? 0) }}',
|
|
31
|
+
request: {
|
|
32
|
+
qs: {
|
|
33
|
+
page: '={{ Number($response.body?.data?.meta?.page ?? 0) + 1 }}',
|
|
34
|
+
limit: 100,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
displayName: 'Limit',
|
|
44
|
+
name: 'limit',
|
|
45
|
+
type: 'number',
|
|
46
|
+
typeOptions: {
|
|
47
|
+
minValue: 1,
|
|
48
|
+
maxValue: 100,
|
|
49
|
+
},
|
|
50
|
+
default: 50,
|
|
51
|
+
description: 'Max number of results to return',
|
|
52
|
+
displayOptions: {
|
|
53
|
+
show: {
|
|
54
|
+
...showOnlyForWebhookNotifications,
|
|
55
|
+
returnAll: [false],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
routing: {
|
|
59
|
+
send: {
|
|
60
|
+
type: 'query',
|
|
61
|
+
property: 'limit',
|
|
62
|
+
},
|
|
63
|
+
output: {
|
|
64
|
+
maxResults: '={{$value}}',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
displayName: 'Filters',
|
|
70
|
+
name: 'filters',
|
|
71
|
+
type: 'collection',
|
|
72
|
+
placeholder: 'Add Filter',
|
|
73
|
+
default: {},
|
|
74
|
+
displayOptions: {
|
|
75
|
+
show: showOnlyForWebhookNotifications,
|
|
76
|
+
},
|
|
77
|
+
options: [
|
|
78
|
+
{
|
|
79
|
+
displayName: 'Device ID',
|
|
80
|
+
name: 'deviceId',
|
|
81
|
+
type: 'string',
|
|
82
|
+
default: '',
|
|
83
|
+
routing: {
|
|
84
|
+
send: {
|
|
85
|
+
type: 'query',
|
|
86
|
+
property: 'deviceId',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
displayName: 'End',
|
|
92
|
+
name: 'end',
|
|
93
|
+
type: 'dateTime',
|
|
94
|
+
default: '',
|
|
95
|
+
routing: {
|
|
96
|
+
send: {
|
|
97
|
+
type: 'query',
|
|
98
|
+
property: 'end',
|
|
99
|
+
value: '={{ $value ? new Date($value).toISOString() : undefined }}',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
displayName: 'Event Type',
|
|
105
|
+
name: 'eventType',
|
|
106
|
+
type: 'options',
|
|
107
|
+
options: [
|
|
108
|
+
{ name: 'Message Delivered', value: 'MESSAGE_DELIVERED' },
|
|
109
|
+
{ name: 'Message Failed', value: 'MESSAGE_FAILED' },
|
|
110
|
+
{ name: 'Message Received', value: 'MESSAGE_RECEIVED' },
|
|
111
|
+
{ name: 'Message Sent', value: 'MESSAGE_SENT' },
|
|
112
|
+
{ name: 'Unknown State', value: 'UNKNOWN_STATE' },
|
|
113
|
+
],
|
|
114
|
+
default: 'MESSAGE_RECEIVED',
|
|
115
|
+
routing: {
|
|
116
|
+
send: {
|
|
117
|
+
type: 'query',
|
|
118
|
+
property: 'eventType',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
displayName: 'Page',
|
|
124
|
+
name: 'page',
|
|
125
|
+
type: 'number',
|
|
126
|
+
default: 1,
|
|
127
|
+
description: 'Page to return. Ignored when Return All is on.',
|
|
128
|
+
displayOptions: {
|
|
129
|
+
show: {
|
|
130
|
+
'/returnAll': [false],
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
routing: {
|
|
134
|
+
send: {
|
|
135
|
+
type: 'query',
|
|
136
|
+
property: 'page',
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
displayName: 'Start',
|
|
142
|
+
name: 'start',
|
|
143
|
+
type: 'dateTime',
|
|
144
|
+
default: '',
|
|
145
|
+
description: 'Start of the time range. Applies only together with End.',
|
|
146
|
+
routing: {
|
|
147
|
+
send: {
|
|
148
|
+
type: 'query',
|
|
149
|
+
property: 'start',
|
|
150
|
+
value: '={{ $value ? new Date($value).toISOString() : undefined }}',
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
displayName: 'Status',
|
|
156
|
+
name: 'status',
|
|
157
|
+
type: 'options',
|
|
158
|
+
options: [
|
|
159
|
+
{ name: 'Delivered', value: 'delivered' },
|
|
160
|
+
{ name: 'Failed', value: 'failed' },
|
|
161
|
+
{ name: 'Pending', value: 'pending' },
|
|
162
|
+
{ name: 'Retrying', value: 'retrying' },
|
|
163
|
+
],
|
|
164
|
+
default: 'delivered',
|
|
165
|
+
routing: {
|
|
166
|
+
send: {
|
|
167
|
+
type: 'query',
|
|
168
|
+
property: 'status',
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
displayName: 'Webhook Subscription ID',
|
|
174
|
+
name: 'webhookSubscriptionId',
|
|
175
|
+
type: 'string',
|
|
176
|
+
default: '',
|
|
177
|
+
routing: {
|
|
178
|
+
send: {
|
|
179
|
+
type: 'query',
|
|
180
|
+
property: 'webhookSubscriptionId',
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
},
|
|
186
|
+
];
|
|
187
|
+
exports.webhookGetNotificationsRouting = {
|
|
188
|
+
send: {
|
|
189
|
+
preSend: [(0, validation_1.requireObjectIds)('filters.deviceId?', 'filters.webhookSubscriptionId?')],
|
|
190
|
+
},
|
|
191
|
+
request: {
|
|
192
|
+
method: 'GET',
|
|
193
|
+
url: '/webhooks/notifications',
|
|
194
|
+
},
|
|
195
|
+
output: {
|
|
196
|
+
postReceive: [
|
|
197
|
+
{
|
|
198
|
+
type: 'rootProperty',
|
|
199
|
+
properties: {
|
|
200
|
+
property: 'data',
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
type: 'rootProperty',
|
|
205
|
+
properties: {
|
|
206
|
+
property: 'data',
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
validation_1.stripSecretsPostReceive,
|
|
210
|
+
],
|
|
211
|
+
},
|
|
212
|
+
};
|
|
213
|
+
//# sourceMappingURL=getNotifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getNotifications.js","sourceRoot":"","sources":["../../../../../nodes/Textbee/resources/webhook/getNotifications.ts"],"names":[],"mappings":";;;AAEA,wDAAoF;AAEpF,MAAM,+BAA+B,GAAG;IACvC,SAAS,EAAE,CAAC,kBAAkB,CAAC;IAC/B,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EAAE;QACR,MAAM,EAAE,KAAc;QACtB,GAAG,EAAE,yBAAyB;KAC9B;IACD,MAAM,EAAE;QACP,WAAW,EAAE;YACZ;gBACC,IAAI,EAAE,cAAuB;gBAC7B,UAAU,EAAE;oBACX,QAAQ,EAAE,MAAM;iBAChB;aACD;YACD;gBACC,IAAI,EAAE,cAAuB;gBAC7B,UAAU,EAAE;oBACX,QAAQ,EAAE,MAAM;iBAChB;aACD;YACD,oCAAuB;SACvB;KACD;CACD,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.webhookDescription = void 0;
|
|
4
|
+
const create_1 = require("./create");
|
|
5
|
+
const delete_1 = require("./delete");
|
|
6
|
+
const get_1 = require("./get");
|
|
7
|
+
const getAll_1 = require("./getAll");
|
|
8
|
+
const getNotifications_1 = require("./getNotifications");
|
|
9
|
+
const update_1 = require("./update");
|
|
10
|
+
const showOnlyForWebhook = {
|
|
11
|
+
resource: ['webhook'],
|
|
12
|
+
};
|
|
13
|
+
exports.webhookDescription = [
|
|
14
|
+
{
|
|
15
|
+
displayName: 'Operation',
|
|
16
|
+
name: 'operation',
|
|
17
|
+
type: 'options',
|
|
18
|
+
noDataExpression: true,
|
|
19
|
+
displayOptions: {
|
|
20
|
+
show: showOnlyForWebhook,
|
|
21
|
+
},
|
|
22
|
+
options: [
|
|
23
|
+
{
|
|
24
|
+
name: 'Create',
|
|
25
|
+
value: 'create',
|
|
26
|
+
action: 'Create a webhook subscription',
|
|
27
|
+
description: 'Create a webhook subscription',
|
|
28
|
+
routing: create_1.webhookCreateRouting,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'Delete',
|
|
32
|
+
value: 'delete',
|
|
33
|
+
action: 'Delete a webhook subscription',
|
|
34
|
+
description: 'Delete a webhook subscription',
|
|
35
|
+
routing: delete_1.webhookDeleteRouting,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'Get',
|
|
39
|
+
value: 'get',
|
|
40
|
+
action: 'Get a webhook subscription',
|
|
41
|
+
description: 'Get one webhook subscription',
|
|
42
|
+
routing: get_1.webhookGetRouting,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'Get Many',
|
|
46
|
+
value: 'getAll',
|
|
47
|
+
action: 'Get many webhook subscriptions',
|
|
48
|
+
description: 'List webhook subscriptions',
|
|
49
|
+
routing: getAll_1.webhookGetManyRouting,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'Get Notifications',
|
|
53
|
+
value: 'getNotifications',
|
|
54
|
+
action: 'Get webhook delivery attempts',
|
|
55
|
+
description: 'List webhook delivery attempts',
|
|
56
|
+
routing: getNotifications_1.webhookGetNotificationsRouting,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'Update',
|
|
60
|
+
value: 'update',
|
|
61
|
+
action: 'Update a webhook subscription',
|
|
62
|
+
description: 'Update a webhook subscription',
|
|
63
|
+
routing: update_1.webhookUpdateRouting,
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
default: 'getAll',
|
|
67
|
+
},
|
|
68
|
+
...create_1.webhookCreateDescription,
|
|
69
|
+
...delete_1.webhookDeleteDescription,
|
|
70
|
+
...get_1.webhookGetDescription,
|
|
71
|
+
...getAll_1.webhookGetManyDescription,
|
|
72
|
+
...getNotifications_1.webhookGetNotificationsDescription,
|
|
73
|
+
...update_1.webhookUpdateDescription,
|
|
74
|
+
];
|
|
75
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Textbee/resources/webhook/index.ts"],"names":[],"mappings":";;;AAEA,qCAA0E;AAC1E,qCAA0E;AAC1E,+BAAiE;AACjE,qCAA4E;AAC5E,yDAG4B;AAC5B,qCAA0E;AAE1E,MAAM,kBAAkB,GAAG;IAC1B,QAA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5B,GAAG,qDAAkC;IACrC,GAAG,iCAAwB;CAC3B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
import { stripSecretsPostReceive } from '../../shared/validation';
|
|
3
|
+
export declare const webhookUpdateDescription: INodeProperties[];
|
|
4
|
+
export declare const webhookUpdateRouting: {
|
|
5
|
+
send: {
|
|
6
|
+
preSend: ((this: import("n8n-workflow").IExecuteSingleFunctions, requestOptions: import("n8n-workflow").IHttpRequestOptions) => Promise<import("n8n-workflow").IHttpRequestOptions>)[];
|
|
7
|
+
};
|
|
8
|
+
request: {
|
|
9
|
+
method: "PATCH";
|
|
10
|
+
url: string;
|
|
11
|
+
};
|
|
12
|
+
output: {
|
|
13
|
+
postReceive: ({
|
|
14
|
+
type: "rootProperty";
|
|
15
|
+
properties: {
|
|
16
|
+
property: string;
|
|
17
|
+
};
|
|
18
|
+
} | typeof stripSecretsPostReceive)[];
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.webhookUpdateRouting = exports.webhookUpdateDescription = void 0;
|
|
4
|
+
const validation_1 = require("../../shared/validation");
|
|
5
|
+
const descriptions_1 = require("../../shared/descriptions");
|
|
6
|
+
const create_1 = require("./create");
|
|
7
|
+
const showOnlyForWebhookUpdate = {
|
|
8
|
+
operation: ['update'],
|
|
9
|
+
resource: ['webhook'],
|
|
10
|
+
};
|
|
11
|
+
exports.webhookUpdateDescription = [
|
|
12
|
+
{
|
|
13
|
+
displayName: 'Webhook ID',
|
|
14
|
+
name: 'webhookId',
|
|
15
|
+
type: 'string',
|
|
16
|
+
default: '',
|
|
17
|
+
required: true,
|
|
18
|
+
description: 'Subscription ID to update',
|
|
19
|
+
displayOptions: {
|
|
20
|
+
show: showOnlyForWebhookUpdate,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
displayName: 'Update Fields',
|
|
25
|
+
name: 'updateFields',
|
|
26
|
+
type: 'collection',
|
|
27
|
+
placeholder: 'Add Field',
|
|
28
|
+
default: {},
|
|
29
|
+
displayOptions: {
|
|
30
|
+
show: showOnlyForWebhookUpdate,
|
|
31
|
+
},
|
|
32
|
+
options: [
|
|
33
|
+
{
|
|
34
|
+
displayName: 'Delivery URL',
|
|
35
|
+
name: 'deliveryUrl',
|
|
36
|
+
type: 'string',
|
|
37
|
+
default: '',
|
|
38
|
+
description: 'New delivery URL',
|
|
39
|
+
routing: {
|
|
40
|
+
send: {
|
|
41
|
+
type: 'body',
|
|
42
|
+
property: 'deliveryUrl',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
displayName: 'Events',
|
|
48
|
+
name: 'events',
|
|
49
|
+
type: 'multiOptions',
|
|
50
|
+
options: create_1.eventOptions,
|
|
51
|
+
default: [],
|
|
52
|
+
description: 'Replacement event list (cannot be empty when set)',
|
|
53
|
+
routing: {
|
|
54
|
+
send: {
|
|
55
|
+
type: 'body',
|
|
56
|
+
property: 'events',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
displayName: 'Is Active',
|
|
62
|
+
name: 'isActive',
|
|
63
|
+
type: 'boolean',
|
|
64
|
+
default: true,
|
|
65
|
+
description: 'Whether deliveries are attempted. Set true to re-enable a paused subscription.',
|
|
66
|
+
routing: {
|
|
67
|
+
send: {
|
|
68
|
+
type: 'body',
|
|
69
|
+
property: 'isActive',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
displayName: 'Name',
|
|
75
|
+
name: 'name',
|
|
76
|
+
type: 'string',
|
|
77
|
+
default: '',
|
|
78
|
+
description: 'Label shown in the dashboard',
|
|
79
|
+
routing: {
|
|
80
|
+
send: {
|
|
81
|
+
type: 'body',
|
|
82
|
+
property: 'name',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
displayName: 'Signing Secret',
|
|
88
|
+
name: 'signingSecret',
|
|
89
|
+
type: 'string',
|
|
90
|
+
typeOptions: { password: true },
|
|
91
|
+
default: '',
|
|
92
|
+
description: 'New signing secret (at least 20 characters)',
|
|
93
|
+
routing: {
|
|
94
|
+
send: {
|
|
95
|
+
type: 'body',
|
|
96
|
+
property: 'signingSecret',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
];
|
|
103
|
+
exports.webhookUpdateRouting = {
|
|
104
|
+
send: {
|
|
105
|
+
preSend: [(0, validation_1.requireObjectIds)('webhookId')],
|
|
106
|
+
},
|
|
107
|
+
request: {
|
|
108
|
+
method: 'PATCH',
|
|
109
|
+
url: '=/webhooks/{{$parameter.webhookId}}',
|
|
110
|
+
},
|
|
111
|
+
output: {
|
|
112
|
+
postReceive: [...descriptions_1.unwrapDataPostReceive, validation_1.stripSecretsPostReceive],
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../../nodes/Textbee/resources/webhook/update.ts"],"names":[],"mappings":";;;AAEA,wDAAoF;AACpF,4DAAkE;AAClE,qCAAwC;AAExC,MAAM,wBAAwB,GAAG;IAChC,SAAS,EAAE,CAAC,QAAQ,CAAC;IACrB,QAAQ,EAAE,CAAC,SAAS,CAAC;CACrB,CAAC;AAEW,QAAA,wBAAwB,GAAsB;IAC1D;QACC,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,2BAA2B;QACxC,cAAc,EAAE;YACf,IA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BAC7B,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,6CAA6C;gBAC1D,OAAO,EAAE;oBACR,IAAI,EAAE;wBACL,IAAI,EAAE,MAAM;wBACZ,QAAQ,EAAE,eAAe;qBACzB;iBACD;aACD;SACD;KACD;CACD,CAAC;AAEW,QAAA,oBAAoB,GAAG;IACnC,IAAI,EAAE;QACL,OAAO,EAAE,CAAC,IAAA,6BAAgB,EAAC,WAAW,CAAC,CAAC;KACxC;IACD,OAAO,EAAE;QACR,MAAM,EAAE,OAAgB;QACxB,GAAG,EAAE,qCAAqC;KAC1C;IACD,MAAM,EAAE;QACP,WAAW,EAAE,CAAC,GAAG,oCAAqB,EAAE,oCAAuB,CAAC;KAChE;CACD,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare function normalizeBaseUrl(baseUrl: string): string;
|
|
2
|
+
export declare const baseUrlExpression = "={{(() => { const u = String($credentials.baseUrl || '').trim().replace(/\\/+$/, ''); if (!u) return 'https://api.textbee.dev/api/v1'; if (/\\/api\\/v1(\\/|$)/.test(u)) { const i = u.indexOf('/api/v1'); return u.slice(0, i + 7); } return u + '/api/v1'; })()}}";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.baseUrlExpression = void 0;
|
|
4
|
+
exports.normalizeBaseUrl = normalizeBaseUrl;
|
|
5
|
+
function normalizeBaseUrl(baseUrl) {
|
|
6
|
+
const trimmed = baseUrl.trim().replace(/\/+$/, '');
|
|
7
|
+
if (!trimmed) {
|
|
8
|
+
return 'https://api.textbee.dev/api/v1';
|
|
9
|
+
}
|
|
10
|
+
if (/\/api\/v1(\/|$)/.test(trimmed)) {
|
|
11
|
+
const idx = trimmed.indexOf('/api/v1');
|
|
12
|
+
return trimmed.slice(0, idx + '/api/v1'.length);
|
|
13
|
+
}
|
|
14
|
+
return `${trimmed}/api/v1`;
|
|
15
|
+
}
|
|
16
|
+
exports.baseUrlExpression = "={{(() => { const u = String($credentials.baseUrl || '').trim().replace(/\\/+$/, ''); if (!u) return 'https://api.textbee.dev/api/v1'; if (/\\/api\\/v1(\\/|$)/.test(u)) { const i = u.indexOf('/api/v1'); return u.slice(0, i + 7); } return u + '/api/v1'; })()}}";
|
|
17
|
+
//# sourceMappingURL=baseUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseUrl.js","sourceRoot":"","sources":["../../../../nodes/Textbee/shared/baseUrl.ts"],"names":[],"mappings":";;;AAIA,4CAUC;AAVD,SAAgB,gBAAgB,CAAC,OAAe;IAC/C,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACnD,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,OAAO,gCAAgC,CAAC;IACzC,CAAC;IACD,IAAI,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACvC,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,GAAG,OAAO,SAAS,CAAC;AAC5B,CAAC;AAGY,QAAA,iBAAiB,GAC7B,qQAAqQ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type IExecuteSingleFunctions, type IHttpRequestOptions } from 'n8n-workflow';
|
|
2
|
+
export type BulkMessageInput = {
|
|
3
|
+
message?: string;
|
|
4
|
+
recipients?: string;
|
|
5
|
+
simSubscriptionId?: number;
|
|
6
|
+
scheduledAt?: string;
|
|
7
|
+
};
|
|
8
|
+
export type BulkMessage = {
|
|
9
|
+
message: string;
|
|
10
|
+
recipients: string[];
|
|
11
|
+
simSubscriptionId?: number;
|
|
12
|
+
scheduledAt?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function splitRecipients(value: unknown): string[];
|
|
15
|
+
export declare class InvalidScheduleError extends Error {
|
|
16
|
+
readonly entry: number;
|
|
17
|
+
constructor(entry: number, value: string);
|
|
18
|
+
}
|
|
19
|
+
export declare function buildBulkMessages(entries: BulkMessageInput[]): BulkMessage[];
|
|
20
|
+
export declare function bulkMessagesPreSend(this: IExecuteSingleFunctions, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InvalidScheduleError = void 0;
|
|
4
|
+
exports.splitRecipients = splitRecipients;
|
|
5
|
+
exports.buildBulkMessages = buildBulkMessages;
|
|
6
|
+
exports.bulkMessagesPreSend = bulkMessagesPreSend;
|
|
7
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
8
|
+
function splitRecipients(value) {
|
|
9
|
+
return String(value !== null && value !== void 0 ? value : '')
|
|
10
|
+
.split(/[,\n]/)
|
|
11
|
+
.map((recipient) => recipient.trim())
|
|
12
|
+
.filter(Boolean);
|
|
13
|
+
}
|
|
14
|
+
class InvalidScheduleError extends Error {
|
|
15
|
+
constructor(entry, value) {
|
|
16
|
+
super(`Message ${entry}: "${value}" is not a valid Scheduled At date`);
|
|
17
|
+
this.entry = entry;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.InvalidScheduleError = InvalidScheduleError;
|
|
21
|
+
function buildBulkMessages(entries) {
|
|
22
|
+
return entries.map((entry, index) => {
|
|
23
|
+
var _a;
|
|
24
|
+
const message = {
|
|
25
|
+
message: (_a = entry.message) !== null && _a !== void 0 ? _a : '',
|
|
26
|
+
recipients: splitRecipients(entry.recipients),
|
|
27
|
+
};
|
|
28
|
+
if (entry.simSubscriptionId)
|
|
29
|
+
message.simSubscriptionId = entry.simSubscriptionId;
|
|
30
|
+
if (entry.scheduledAt) {
|
|
31
|
+
const date = new Date(entry.scheduledAt);
|
|
32
|
+
if (Number.isNaN(date.getTime())) {
|
|
33
|
+
throw new InvalidScheduleError(index + 1, entry.scheduledAt);
|
|
34
|
+
}
|
|
35
|
+
message.scheduledAt = date.toISOString();
|
|
36
|
+
}
|
|
37
|
+
return message;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
async function bulkMessagesPreSend(requestOptions) {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
const collection = this.getNodeParameter('messages', {});
|
|
43
|
+
const body = ((_a = requestOptions.body) !== null && _a !== void 0 ? _a : {});
|
|
44
|
+
try {
|
|
45
|
+
body.messages = buildBulkMessages((_b = collection.messageValues) !== null && _b !== void 0 ? _b : []);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
if (error instanceof InvalidScheduleError) {
|
|
49
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error.message);
|
|
50
|
+
}
|
|
51
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), String(error));
|
|
52
|
+
}
|
|
53
|
+
requestOptions.body = body;
|
|
54
|
+
return requestOptions;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=bulk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulk.js","sourceRoot":"","sources":["../../../../nodes/Textbee/shared/bulk.ts"],"names":[],"mappings":";;;AAqBA,0CAKC;AAYD,8CAiBC;AAED,kDAkBC;AA3ED,+CAKsB;AAgBtB,SAAgB,eAAe,CAAC,KAAc;IAC7C,OAAO,MAAM,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;SACxB,KAAK,CAAC,OAAO,CAAC;SACd,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,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D,IAAI,CAAC;QACJ,IAAI,CAAC,QAAQ,GAAG,iBAAiB,CAAC,MAAA,UAAU,CAAC,aAAa,mCAAI,EAAE,CAAC,CAAC;IACnE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IAAI,KAAK,YAAY,oBAAoB,EAAE,CAAC;YAC3C,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAC7D,CAAC;QACD,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7D,CAAC;IACD,cAAc,CAAC,IAAI,GAAG,IAAI,CAAC;IAC3B,OAAO,cAAc,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unwrapDataPostReceive = exports.deviceIdProperty = void 0;
|
|
4
|
+
exports.deviceIdProperty = {
|
|
5
|
+
displayName: 'Device',
|
|
6
|
+
name: 'deviceId',
|
|
7
|
+
type: 'resourceLocator',
|
|
8
|
+
default: { mode: 'list', value: '' },
|
|
9
|
+
description: 'Device to use. When omitted on send, textbee uses the default device or the enabled device with the most recent heartbeat.',
|
|
10
|
+
modes: [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'From List',
|
|
13
|
+
name: 'list',
|
|
14
|
+
type: 'list',
|
|
15
|
+
placeholder: 'Select a device…',
|
|
16
|
+
typeOptions: {
|
|
17
|
+
searchListMethod: 'searchDevices',
|
|
18
|
+
searchable: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
displayName: 'ID',
|
|
23
|
+
name: 'id',
|
|
24
|
+
type: 'string',
|
|
25
|
+
placeholder: '664a9b8cd0e1f2a3b4c5d6e7',
|
|
26
|
+
validation: [
|
|
27
|
+
{
|
|
28
|
+
type: 'regex',
|
|
29
|
+
properties: {
|
|
30
|
+
regex: '^[a-fA-F0-9]{24}$',
|
|
31
|
+
errorMessage: 'Not a valid textbee device ID',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
exports.unwrapDataPostReceive = [
|
|
39
|
+
{
|
|
40
|
+
type: 'rootProperty',
|
|
41
|
+
properties: {
|
|
42
|
+
property: 'data',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
//# sourceMappingURL=descriptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptions.js","sourceRoot":"","sources":["../../../../nodes/Textbee/shared/descriptions.ts"],"names":[],"mappings":";;;AAEa,QAAA,gBAAgB,GAAoB;IAChD,WAAW,EAAE,QAAQ;IACrB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;IACpC,WAAW,EACV,4HAA4H;IAC7H,KAAK,EAAE;QACN;YACC,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EAAE;gBACZ,gBAAgB,EAAE,eAAe;gBACjC,UAAU,EAAE,IAAI;aAChB;SACD;QACD;YACC,WAAW,EAAE,IAAI;YACjB,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,0BAA0B;YACvC,UAAU,EAAE;gBACX;oBACC,IAAI,EAAE,OAAO;oBACb,UAAU,EAAE;wBACX,KAAK,EAAE,mBAAmB;wBAC1B,YAAY,EAAE,+BAA+B;qBAC7C;iBACD;aACD;SACD;KACD;CACD,CAAC;AAEW,QAAA,qBAAqB,GAAG;IACpC;QACC,IAAI,EAAE,cAAuB;QAC7B,UAAU,EAAE;YACX,QAAQ,EAAE,MAAM;SAChB;KACD;CACD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.computeSignature = computeSignature;
|
|
4
|
+
exports.verifySignature = verifySignature;
|
|
5
|
+
const crypto_1 = require("crypto");
|
|
6
|
+
function computeSignature(body, secret) {
|
|
7
|
+
return (0, crypto_1.createHmac)('sha256', secret).update(body).digest('hex');
|
|
8
|
+
}
|
|
9
|
+
function verifySignature(body, header, secret) {
|
|
10
|
+
if (!secret || !header)
|
|
11
|
+
return false;
|
|
12
|
+
const expected = Buffer.from(computeSignature(body, secret), 'utf8');
|
|
13
|
+
const provided = Buffer.from(header.trim().toLowerCase(), 'utf8');
|
|
14
|
+
return expected.length === provided.length && (0, crypto_1.timingSafeEqual)(expected, provided);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=signature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature.js","sourceRoot":"","sources":["../../../../nodes/Textbee/shared/signature.ts"],"names":[],"mappings":";;AAGA,4CAEC;AAGD,0CAWC;AAnBD,mCAAqD;AAGrD,SAAgB,gBAAgB,CAAC,IAAqB,EAAE,MAAc;IACrE,OAAO,IAAA,mBAAU,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AAGD,SAAgB,eAAe,CAC9B,IAAqB,EACrB,MAA0B,EAC1B,MAA0B;IAE1B,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAErC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IACrE,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,CAAC;IAElE,OAAO,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,IAAI,IAAA,wBAAe,EAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACnF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type WebhookSubscription = {
|
|
2
|
+
_id: string;
|
|
3
|
+
deliveryUrl: string;
|
|
4
|
+
events?: string[];
|
|
5
|
+
isActive?: boolean;
|
|
6
|
+
signingSecret?: string;
|
|
7
|
+
};
|
|
8
|
+
export type DesiredSubscription = {
|
|
9
|
+
deliveryUrl: string;
|
|
10
|
+
events: string[];
|
|
11
|
+
signingSecret: string;
|
|
12
|
+
};
|
|
13
|
+
export type SubscriptionPlan = 'keep' | 'update';
|
|
14
|
+
export declare function planSubscription(existing: WebhookSubscription, desired: DesiredSubscription): SubscriptionPlan;
|
|
15
|
+
export declare function isNotFoundError(error: unknown): boolean;
|