n8n-nodes-instantkom 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.
@@ -0,0 +1,22 @@
1
+ import { ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class InstantKomApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: INodeProperties[];
7
+ authenticate: {
8
+ type: "generic";
9
+ properties: {
10
+ headers: {
11
+ Authorization: string;
12
+ };
13
+ };
14
+ };
15
+ test: {
16
+ request: {
17
+ baseURL: string;
18
+ url: string;
19
+ };
20
+ };
21
+ }
22
+ //# sourceMappingURL=InstantKomApi.credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InstantKomApi.credentials.d.ts","sourceRoot":"","sources":["../../credentials/InstantKomApi.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEhE,qBAAa,aAAc,YAAW,eAAe;IACpD,IAAI,SAAmB;IACvB,WAAW,SAAoB;IAC/B,gBAAgB,SAAwC;IACxD,UAAU,EAAE,eAAe,EAAE,CAmB3B;IACF,YAAY;;;;;;;MAKV;IACF,IAAI;;;;;MAKF;CACF"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InstantKomApi = void 0;
4
+ class InstantKomApi {
5
+ constructor() {
6
+ this.name = 'instantKomApi';
7
+ this.displayName = 'instantKOM API';
8
+ this.documentationUrl = 'https://api.instantkom.app/v1/docs';
9
+ this.properties = [
10
+ {
11
+ displayName: 'API Key',
12
+ name: 'apiKey',
13
+ type: 'string',
14
+ typeOptions: { password: true },
15
+ default: '',
16
+ required: true,
17
+ description: 'Your instantKOM API key (64 characters). Find it under Settings -> API Keys.',
18
+ },
19
+ {
20
+ displayName: 'API Base URL',
21
+ name: 'apiBase',
22
+ type: 'string',
23
+ default: 'https://api.instantkom.app',
24
+ required: true,
25
+ description: 'Leave as default unless you use a self-hosted instance.',
26
+ },
27
+ ];
28
+ this.authenticate = {
29
+ type: 'generic',
30
+ properties: {
31
+ headers: { Authorization: '=Bearer {{$credentials.apiKey}}' },
32
+ },
33
+ };
34
+ this.test = {
35
+ request: {
36
+ baseURL: '={{$credentials.apiBase}}',
37
+ url: '/v1/webhooks/subscriptions',
38
+ },
39
+ };
40
+ }
41
+ }
42
+ exports.InstantKomApi = InstantKomApi;
43
+ //# sourceMappingURL=InstantKomApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InstantKomApi.credentials.js","sourceRoot":"","sources":["../../credentials/InstantKomApi.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,aAAa;IAA1B;QACC,SAAI,GAAG,eAAe,CAAC;QACvB,gBAAW,GAAG,gBAAgB,CAAC;QAC/B,qBAAgB,GAAG,oCAAoC,CAAC;QACxD,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EACV,8EAA8E;aAC/E;YACD;gBACC,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,4BAA4B;gBACrC,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,yDAAyD;aACtE;SACD,CAAC;QACF,iBAAY,GAAG;YACd,IAAI,EAAE,SAAkB;YACxB,UAAU,EAAE;gBACX,OAAO,EAAE,EAAE,aAAa,EAAE,iCAAiC,EAAE;aAC7D;SACD,CAAC;QACF,SAAI,GAAG;YACN,OAAO,EAAE;gBACR,OAAO,EAAE,2BAA2B;gBACpC,GAAG,EAAE,4BAA4B;aACjC;SACD,CAAC;IACH,CAAC;CAAA;AApCD,sCAoCC"}
@@ -0,0 +1,6 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class InstantKom implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
6
+ //# sourceMappingURL=InstantKom.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InstantKom.node.d.ts","sourceRoot":"","sources":["../../../nodes/InstantKom/InstantKom.node.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EAKpB,MAAM,cAAc,CAAC;AAEtB,qBAAa,UAAW,YAAW,SAAS;IAC3C,WAAW,EAAE,oBAAoB,CA+Q/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CA8GvE"}
@@ -0,0 +1,389 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InstantKom = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ class InstantKom {
6
+ constructor() {
7
+ this.description = {
8
+ displayName: 'instantKOM',
9
+ name: 'instantKom',
10
+ icon: 'file:instantKom.svg',
11
+ group: ['transform'],
12
+ version: 1,
13
+ subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
14
+ description: 'Send messages and manage contacts via instantKOM',
15
+ defaults: { name: 'instantKOM' },
16
+ inputs: ['main'],
17
+ outputs: ['main'],
18
+ credentials: [{ name: 'instantKomApi', required: true }],
19
+ properties: [
20
+ // ── Resource selector ──────────────────────────────────────────
21
+ {
22
+ displayName: 'Resource',
23
+ name: 'resource',
24
+ type: 'options',
25
+ noDataExpression: true,
26
+ options: [
27
+ { name: 'Channel', value: 'channel' },
28
+ { name: 'Contact', value: 'contact' },
29
+ { name: 'Message', value: 'message' },
30
+ ],
31
+ default: 'contact',
32
+ required: true,
33
+ },
34
+ // ── Contact operations ─────────────────────────────────────────
35
+ {
36
+ displayName: 'Operation',
37
+ name: 'operation',
38
+ type: 'options',
39
+ noDataExpression: true,
40
+ displayOptions: { show: { resource: ['contact'] } },
41
+ options: [
42
+ { name: 'Create', value: 'create', description: 'Create a new contact', action: 'Create a contact' },
43
+ { name: 'Get', value: 'get', description: 'Get a contact by ID', action: 'Get a contact' },
44
+ { name: 'Get Many', value: 'getAll', description: 'Get many contacts', action: 'Get many contacts' },
45
+ { name: 'Update', value: 'update', description: 'Update a contact', action: 'Update a contact' },
46
+ ],
47
+ default: 'getAll',
48
+ },
49
+ // ── Message operations ─────────────────────────────────────────
50
+ {
51
+ displayName: 'Operation',
52
+ name: 'operation',
53
+ type: 'options',
54
+ noDataExpression: true,
55
+ displayOptions: { show: { resource: ['message'] } },
56
+ options: [
57
+ { name: 'Send', value: 'send', description: 'Send a message to a contact', action: 'Send a message' },
58
+ ],
59
+ default: 'send',
60
+ },
61
+ // ── Channel operations ─────────────────────────────────────────
62
+ {
63
+ displayName: 'Operation',
64
+ name: 'operation',
65
+ type: 'options',
66
+ noDataExpression: true,
67
+ displayOptions: { show: { resource: ['channel'] } },
68
+ options: [
69
+ { name: 'Get Many', value: 'getAll', description: 'Get all channels', action: 'Get many channels' },
70
+ ],
71
+ default: 'getAll',
72
+ },
73
+ // ── Contact: Create fields ─────────────────────────────────────
74
+ {
75
+ displayName: 'Channel ID',
76
+ name: 'channelId',
77
+ type: 'number',
78
+ required: true,
79
+ default: 0,
80
+ displayOptions: { show: { resource: ['contact'], operation: ['create'] } },
81
+ description: 'The ID of the instantKOM channel (WhatsApp, SMS, etc.) to add the contact to',
82
+ },
83
+ {
84
+ displayName: 'Identifier',
85
+ name: 'identifier',
86
+ type: 'string',
87
+ required: true,
88
+ default: '',
89
+ displayOptions: { show: { resource: ['contact'], operation: ['create'] } },
90
+ description: 'Phone number in E.164 format (e.g. +491701234567) or channel-specific identifier',
91
+ },
92
+ {
93
+ displayName: 'Name',
94
+ name: 'name',
95
+ type: 'string',
96
+ default: '',
97
+ displayOptions: { show: { resource: ['contact'], operation: ['create'] } },
98
+ description: "Contact's display name",
99
+ },
100
+ {
101
+ displayName: 'Opt-In Status',
102
+ name: 'optinStatus',
103
+ type: 'options',
104
+ options: [
105
+ { name: 'Opted In', value: 1 },
106
+ { name: 'Opted Out', value: 0 },
107
+ { name: 'Signed In', value: 2 },
108
+ { name: 'Dialog', value: 3 },
109
+ ],
110
+ default: 1,
111
+ displayOptions: { show: { resource: ['contact'], operation: ['create'] } },
112
+ description: 'Initial opt-in status for the contact',
113
+ },
114
+ // ── Contact: Get / Update fields ───────────────────────────────
115
+ {
116
+ displayName: 'Contact ID',
117
+ name: 'contactId',
118
+ type: 'number',
119
+ required: true,
120
+ default: 0,
121
+ displayOptions: { show: { resource: ['contact'], operation: ['get', 'update'] } },
122
+ description: 'The ID of the contact',
123
+ },
124
+ // ── Contact: Update fields ─────────────────────────────────────
125
+ {
126
+ displayName: 'Update Fields',
127
+ name: 'updateFields',
128
+ type: 'collection',
129
+ placeholder: 'Add Field',
130
+ default: {},
131
+ displayOptions: { show: { resource: ['contact'], operation: ['update'] } },
132
+ options: [
133
+ {
134
+ displayName: 'Name',
135
+ name: 'name',
136
+ type: 'string',
137
+ default: '',
138
+ description: 'New display name for the contact',
139
+ },
140
+ {
141
+ displayName: 'Notes',
142
+ name: 'notes',
143
+ type: 'string',
144
+ typeOptions: { rows: 3 },
145
+ default: '',
146
+ description: 'Internal notes about the contact',
147
+ },
148
+ {
149
+ displayName: 'Opt-In Status',
150
+ name: 'optinStatus',
151
+ type: 'options',
152
+ options: [
153
+ { name: 'Opted In', value: 1 },
154
+ { name: 'Opted Out', value: 0 },
155
+ { name: 'Signed In', value: 2 },
156
+ { name: 'Dialog', value: 3 },
157
+ ],
158
+ default: 1,
159
+ description: 'New opt-in status for the contact',
160
+ },
161
+ {
162
+ displayName: 'Is Blocked',
163
+ name: 'isBlocked',
164
+ type: 'boolean',
165
+ default: false,
166
+ description: 'Whether to block the contact',
167
+ },
168
+ ],
169
+ },
170
+ // ── Contact: Get Many (filters) ────────────────────────────────
171
+ {
172
+ displayName: 'Return All',
173
+ name: 'returnAll',
174
+ type: 'boolean',
175
+ default: false,
176
+ displayOptions: { show: { resource: ['contact', 'channel'], operation: ['getAll'] } },
177
+ description: 'Whether to return all results or only up to a given limit',
178
+ },
179
+ {
180
+ displayName: 'Limit',
181
+ name: 'limit',
182
+ type: 'number',
183
+ typeOptions: { minValue: 1, maxValue: 100 },
184
+ default: 50,
185
+ displayOptions: {
186
+ show: {
187
+ resource: ['contact', 'channel'],
188
+ operation: ['getAll'],
189
+ returnAll: [false],
190
+ },
191
+ },
192
+ description: 'Max number of results to return',
193
+ },
194
+ {
195
+ displayName: 'Filters',
196
+ name: 'filters',
197
+ type: 'collection',
198
+ placeholder: 'Add Filter',
199
+ default: {},
200
+ displayOptions: { show: { resource: ['contact'], operation: ['getAll'] } },
201
+ options: [
202
+ {
203
+ displayName: 'Channel ID',
204
+ name: 'channelId',
205
+ type: 'number',
206
+ default: 0,
207
+ description: 'Filter contacts by channel ID',
208
+ },
209
+ {
210
+ displayName: 'Search',
211
+ name: 'search',
212
+ type: 'string',
213
+ default: '',
214
+ description: 'Search contacts by name or identifier',
215
+ },
216
+ ],
217
+ },
218
+ // ── Message: Send fields ───────────────────────────────────────
219
+ {
220
+ displayName: 'Contact ID',
221
+ name: 'recipientId',
222
+ type: 'number',
223
+ required: true,
224
+ default: 0,
225
+ displayOptions: { show: { resource: ['message'], operation: ['send'] } },
226
+ description: 'The ID of the instantKOM contact to send the message to',
227
+ },
228
+ {
229
+ displayName: 'Message Text',
230
+ name: 'message',
231
+ type: 'string',
232
+ typeOptions: { rows: 4 },
233
+ required: true,
234
+ default: '',
235
+ displayOptions: { show: { resource: ['message'], operation: ['send'] } },
236
+ description: 'The message text to send (max 4096 characters)',
237
+ },
238
+ {
239
+ displayName: 'Additional Fields',
240
+ name: 'additionalFields',
241
+ type: 'collection',
242
+ placeholder: 'Add Field',
243
+ default: {},
244
+ displayOptions: { show: { resource: ['message'], operation: ['send'] } },
245
+ options: [
246
+ {
247
+ displayName: 'Message Type',
248
+ name: 'messageType',
249
+ type: 'options',
250
+ options: [
251
+ { name: 'Audio', value: 'audio' },
252
+ { name: 'Document', value: 'document' },
253
+ { name: 'Image', value: 'image' },
254
+ { name: 'Text', value: 'text' },
255
+ { name: 'Video', value: 'video' },
256
+ ],
257
+ default: 'text',
258
+ description: 'Type of message to send',
259
+ },
260
+ {
261
+ displayName: 'Scheduled At (Unix Timestamp)',
262
+ name: 'scheduledAt',
263
+ type: 'number',
264
+ default: 0,
265
+ description: 'Unix timestamp to schedule the message for later delivery. Leave 0 for immediate.',
266
+ },
267
+ ],
268
+ },
269
+ ],
270
+ };
271
+ }
272
+ async execute() {
273
+ var _a, _b, _c;
274
+ const items = this.getInputData();
275
+ const credentials = await this.getCredentials('instantKomApi');
276
+ const resource = this.getNodeParameter('resource', 0);
277
+ const operation = this.getNodeParameter('operation', 0);
278
+ const returnData = [];
279
+ const apiBase = credentials.apiBase.replace(/\/$/, '');
280
+ const apiKey = credentials.apiKey;
281
+ const request = async (method, path, body, qs) => {
282
+ const options = {
283
+ method,
284
+ url: `${apiBase}${path}`,
285
+ headers: { Authorization: `Bearer ${apiKey}` },
286
+ json: true,
287
+ };
288
+ if (body)
289
+ options.body = body;
290
+ if (qs)
291
+ options.qs = qs;
292
+ return this.helpers.request(options);
293
+ };
294
+ for (let i = 0; i < items.length; i++) {
295
+ try {
296
+ let responseData;
297
+ if (resource === 'contact') {
298
+ if (operation === 'create') {
299
+ const channelId = this.getNodeParameter('channelId', i);
300
+ const identifier = this.getNodeParameter('identifier', i);
301
+ const name = this.getNodeParameter('name', i);
302
+ const optinStatus = this.getNodeParameter('optinStatus', i);
303
+ const body = { channelId, identifier, optinStatus };
304
+ if (name)
305
+ body.name = name;
306
+ responseData = await request('POST', '/v1/contacts', body);
307
+ }
308
+ else if (operation === 'get') {
309
+ const contactId = this.getNodeParameter('contactId', i);
310
+ responseData = await request('GET', `/v1/contacts/${contactId}`);
311
+ }
312
+ else if (operation === 'getAll') {
313
+ const returnAll = this.getNodeParameter('returnAll', i);
314
+ const filters = this.getNodeParameter('filters', i);
315
+ const qs = {};
316
+ if (!returnAll) {
317
+ qs.limit = this.getNodeParameter('limit', i);
318
+ }
319
+ if (filters.channelId)
320
+ qs.channelId = filters.channelId;
321
+ if (filters.search)
322
+ qs.search = filters.search;
323
+ const result = await request('GET', '/v1/contacts', undefined, qs);
324
+ responseData = (_a = result.data) !== null && _a !== void 0 ? _a : result;
325
+ }
326
+ else if (operation === 'update') {
327
+ const contactId = this.getNodeParameter('contactId', i);
328
+ const updateFields = this.getNodeParameter('updateFields', i);
329
+ const body = {};
330
+ if (updateFields.name !== undefined)
331
+ body.name = updateFields.name;
332
+ if (updateFields.optinStatus !== undefined)
333
+ body.optinStatus = updateFields.optinStatus;
334
+ if (updateFields.notes !== undefined)
335
+ body.notes = updateFields.notes;
336
+ if (updateFields.isBlocked !== undefined)
337
+ body.isBlocked = updateFields.isBlocked;
338
+ responseData = await request('PATCH', `/v1/contacts/${contactId}`, body);
339
+ }
340
+ }
341
+ else if (resource === 'message') {
342
+ if (operation === 'send') {
343
+ const recipientId = this.getNodeParameter('recipientId', i);
344
+ const message = this.getNodeParameter('message', i);
345
+ const additionalFields = this.getNodeParameter('additionalFields', i);
346
+ const body = {
347
+ recipientId,
348
+ message,
349
+ messageType: (_b = additionalFields.messageType) !== null && _b !== void 0 ? _b : 'text',
350
+ };
351
+ if (additionalFields.scheduledAt && additionalFields.scheduledAt > 0) {
352
+ body.scheduledAt = additionalFields.scheduledAt;
353
+ }
354
+ responseData = await request('POST', '/v1/messages', body);
355
+ }
356
+ }
357
+ else if (resource === 'channel') {
358
+ if (operation === 'getAll') {
359
+ const returnAll = this.getNodeParameter('returnAll', i);
360
+ const qs = {};
361
+ if (!returnAll) {
362
+ qs.limit = this.getNodeParameter('limit', i);
363
+ }
364
+ const result = await request('GET', '/v1/channels', undefined, qs);
365
+ responseData = (_c = result.data) !== null && _c !== void 0 ? _c : result;
366
+ }
367
+ }
368
+ if (Array.isArray(responseData)) {
369
+ for (const item of responseData) {
370
+ returnData.push({ json: item });
371
+ }
372
+ }
373
+ else if (responseData !== undefined) {
374
+ returnData.push({ json: responseData });
375
+ }
376
+ }
377
+ catch (error) {
378
+ if (this.continueOnFail()) {
379
+ returnData.push({ json: { error: error.message }, pairedItem: i });
380
+ continue;
381
+ }
382
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex: i });
383
+ }
384
+ }
385
+ return [returnData];
386
+ }
387
+ }
388
+ exports.InstantKom = InstantKom;
389
+ //# sourceMappingURL=InstantKom.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InstantKom.node.js","sourceRoot":"","sources":["../../../nodes/InstantKom/InstantKom.node.ts"],"names":[],"mappings":";;;AAAA,+CASsB;AAEtB,MAAa,UAAU;IAAvB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,YAAY;YACzB,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,qBAAqB;YAC3B,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,kDAAkD;YAC/D,QAAQ,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;YAChC,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YACxD,UAAU,EAAE;gBACX,kEAAkE;gBAClE;oBACC,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR,EAA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,EAAE,CAAC;wBACjC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAmB,EAAE,CAAC,CAAC;oBAChD,CAAC;gBACF,CAAC;qBAAM,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;oBACvC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,YAA2B,EAAE,CAAC,CAAC;gBACxD,CAAC;YAEF,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;oBAC9E,SAAS;gBACV,CAAC;gBACD,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAc,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;YAChF,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AAhYD,gCAgYC"}
@@ -0,0 +1,13 @@
1
+ import { IHookFunctions, IWebhookFunctions, INodeType, INodeTypeDescription, IWebhookResponseData } from 'n8n-workflow';
2
+ export declare class InstantKomTrigger implements INodeType {
3
+ description: INodeTypeDescription;
4
+ webhookMethods: {
5
+ default: {
6
+ checkExists(this: IHookFunctions): Promise<boolean>;
7
+ create(this: IHookFunctions): Promise<boolean>;
8
+ delete(this: IHookFunctions): Promise<boolean>;
9
+ };
10
+ };
11
+ webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
12
+ }
13
+ //# sourceMappingURL=InstantKomTrigger.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InstantKomTrigger.node.d.ts","sourceRoot":"","sources":["../../../nodes/InstantKom/InstantKomTrigger.node.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,oBAAoB,EACpB,oBAAoB,EAIpB,MAAM,cAAc,CAAC;AAEtB,qBAAa,iBAAkB,YAAW,SAAS;IAClD,WAAW,EAAE,oBAAoB,CAwD/B;IAEF,cAAc;;8BAEY,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;yBA2BtC,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;yBAwBjC,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;;MA0BpD;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAMrE"}
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InstantKomTrigger = void 0;
4
+ class InstantKomTrigger {
5
+ constructor() {
6
+ this.description = {
7
+ displayName: 'instantKOM Trigger',
8
+ name: 'instantKomTrigger',
9
+ icon: 'file:instantKom.svg',
10
+ group: ['trigger'],
11
+ version: 1,
12
+ description: 'Starts the workflow when instantKOM events occur',
13
+ defaults: { name: 'instantKOM Trigger' },
14
+ inputs: [],
15
+ outputs: ['main'],
16
+ credentials: [{ name: 'instantKomApi', required: true }],
17
+ webhooks: [
18
+ {
19
+ name: 'default',
20
+ httpMethod: 'POST',
21
+ responseMode: 'onReceived',
22
+ path: 'webhook',
23
+ },
24
+ ],
25
+ properties: [
26
+ {
27
+ displayName: 'Event',
28
+ name: 'event',
29
+ type: 'options',
30
+ options: [
31
+ {
32
+ name: 'Broadcast Sent',
33
+ value: 'broadcast_sent',
34
+ description: 'Triggers when a broadcast is sent',
35
+ },
36
+ {
37
+ name: 'Contact Opted Out',
38
+ value: 'contact_opted_out',
39
+ description: 'Triggers when a contact opts out',
40
+ },
41
+ {
42
+ name: 'Contact Updated',
43
+ value: 'contact_updated',
44
+ description: 'Triggers when a contact is updated',
45
+ },
46
+ {
47
+ name: 'New Contact',
48
+ value: 'new_contact',
49
+ description: 'Triggers when a new contact is created',
50
+ },
51
+ {
52
+ name: 'New Message',
53
+ value: 'new_message',
54
+ description: 'Triggers when a new inbound message is received',
55
+ },
56
+ ],
57
+ default: 'new_contact',
58
+ required: true,
59
+ description: 'The event to listen for',
60
+ },
61
+ ],
62
+ };
63
+ this.webhookMethods = {
64
+ default: {
65
+ async checkExists() {
66
+ var _a;
67
+ const webhookData = this.getWorkflowStaticData('node');
68
+ if (!webhookData.subscriptionId) {
69
+ return false;
70
+ }
71
+ const credentials = await this.getCredentials('instantKomApi');
72
+ const apiBase = credentials.apiBase.replace(/\/$/, '');
73
+ const apiKey = credentials.apiKey;
74
+ try {
75
+ const options = {
76
+ method: 'GET',
77
+ url: `${apiBase}/v1/webhooks/subscriptions`,
78
+ headers: { Authorization: `Bearer ${apiKey}` },
79
+ json: true,
80
+ };
81
+ const result = await this.helpers.request(options);
82
+ const subscriptions = Array.isArray(result) ? result : ((_a = result.data) !== null && _a !== void 0 ? _a : []);
83
+ return subscriptions.some((sub) => String(sub.id) === String(webhookData.subscriptionId));
84
+ }
85
+ catch {
86
+ return false;
87
+ }
88
+ },
89
+ async create() {
90
+ const webhookUrl = this.getNodeWebhookUrl('default');
91
+ const event = this.getNodeParameter('event');
92
+ const credentials = await this.getCredentials('instantKomApi');
93
+ const apiBase = credentials.apiBase.replace(/\/$/, '');
94
+ const apiKey = credentials.apiKey;
95
+ const options = {
96
+ method: 'POST',
97
+ url: `${apiBase}/v1/webhooks/subscribe`,
98
+ headers: { Authorization: `Bearer ${apiKey}` },
99
+ body: {
100
+ event,
101
+ target_url: webhookUrl,
102
+ },
103
+ json: true,
104
+ };
105
+ const result = await this.helpers.request(options);
106
+ const webhookData = this.getWorkflowStaticData('node');
107
+ webhookData.subscriptionId = result.id;
108
+ return true;
109
+ },
110
+ async delete() {
111
+ const webhookData = this.getWorkflowStaticData('node');
112
+ if (!webhookData.subscriptionId) {
113
+ return true;
114
+ }
115
+ const credentials = await this.getCredentials('instantKomApi');
116
+ const apiBase = credentials.apiBase.replace(/\/$/, '');
117
+ const apiKey = credentials.apiKey;
118
+ try {
119
+ const options = {
120
+ method: 'DELETE',
121
+ url: `${apiBase}/v1/webhooks/subscribe/${webhookData.subscriptionId}`,
122
+ headers: { Authorization: `Bearer ${apiKey}` },
123
+ json: true,
124
+ };
125
+ await this.helpers.request(options);
126
+ }
127
+ catch {
128
+ return false;
129
+ }
130
+ delete webhookData.subscriptionId;
131
+ return true;
132
+ },
133
+ },
134
+ };
135
+ }
136
+ async webhook() {
137
+ const body = this.getBodyData();
138
+ return {
139
+ workflowData: [this.helpers.returnJsonArray([body])],
140
+ };
141
+ }
142
+ }
143
+ exports.InstantKomTrigger = InstantKomTrigger;
144
+ //# sourceMappingURL=InstantKomTrigger.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InstantKomTrigger.node.js","sourceRoot":"","sources":["../../../nodes/InstantKom/InstantKomTrigger.node.ts"],"names":[],"mappings":";;;AAWA,MAAa,iBAAiB;IAA9B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,oBAAoB;YACjC,IAAI,EAAE,mBAAmB;YACzB,IAAI,EAAE,qBAAqB;YAC3B,KAAK,EAAE,CAAC,SAAS,CAAC;YAClB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,kDAAkD;YAC/D,QAAQ,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE;YACxC,MAAM,EAAE,EAAE;YACV,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YACxD,QAAQ,EAAE;gBACT;oBACC,IAAI,EAAE,SAAS;oBACf,UAAU,EAAE,MAAM;oBAClB,YAAY,EAAE,YAAY;oBAC1B,IAAI,EAAE,SAAS;iBACf;aACD;YACD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,OAAO;oBACpB,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACR;4BACC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0,0 +1,39 @@
1
+ {
2
+ "name": "n8n-nodes-instantkom",
3
+ "version": "0.1.0",
4
+ "description": "n8n community node for instantKOM messaging platform",
5
+ "license": "MIT",
6
+ "main": "index.js",
7
+ "files": [
8
+ "dist/**",
9
+ "package.json"
10
+ ],
11
+ "keywords": [
12
+ "n8n-community-node-package",
13
+ "instantkom",
14
+ "messaging",
15
+ "whatsapp",
16
+ "sms"
17
+ ],
18
+ "n8n": {
19
+ "n8nNodesApiVersion": 1,
20
+ "credentials": [
21
+ "dist/credentials/InstantKomApi.credentials.js"
22
+ ],
23
+ "nodes": [
24
+ "dist/nodes/InstantKom/InstantKom.node.js",
25
+ "dist/nodes/InstantKom/InstantKomTrigger.node.js"
26
+ ]
27
+ },
28
+ "scripts": {
29
+ "build": "tsc --project tsconfig.json",
30
+ "dev": "tsc --project tsconfig.json --watch"
31
+ },
32
+ "devDependencies": {
33
+ "n8n-workflow": "^2.16.0",
34
+ "typescript": "^6.0.3"
35
+ },
36
+ "overrides": {
37
+ "form-data": "^4.0.5"
38
+ }
39
+ }