@xnkee/n8n-nodes-instagram 1.7.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/{LICENSE.md → LICENSE} +21 -21
  2. package/README.md +132 -437
  3. package/dist/credentials/InstagramApi.credentials.d.ts +10 -0
  4. package/dist/credentials/InstagramApi.credentials.js +55 -0
  5. package/dist/credentials/InstagramApi.credentials.js.map +1 -0
  6. package/dist/credentials/InstagramOAuth2Api.credentials.d.ts +2 -2
  7. package/dist/credentials/InstagramOAuth2Api.credentials.js +33 -113
  8. package/dist/credentials/InstagramOAuth2Api.credentials.js.map +1 -1
  9. package/dist/credentials/InstagramUnifiedLoginOAuth2Api.credentials.d.ts +17 -0
  10. package/dist/credentials/InstagramUnifiedLoginOAuth2Api.credentials.js +116 -0
  11. package/dist/credentials/InstagramUnifiedLoginOAuth2Api.credentials.js.map +1 -0
  12. package/dist/credentials/instagram.svg +1 -0
  13. package/dist/index.d.ts +4 -0
  14. package/dist/index.js +21 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/nodes/Instagram/GenericFunctions.d.ts +27 -23
  17. package/dist/nodes/Instagram/GenericFunctions.js +182 -223
  18. package/dist/nodes/Instagram/GenericFunctions.js.map +1 -1
  19. package/dist/nodes/Instagram/Instagram.node.d.ts +1 -1
  20. package/dist/nodes/Instagram/Instagram.node.js +109 -2353
  21. package/dist/nodes/Instagram/Instagram.node.js.map +1 -1
  22. package/dist/nodes/Instagram/Instagram.node.json +17 -0
  23. package/dist/nodes/Instagram/descriptions/comment/Comment.fields.d.ts +2 -0
  24. package/dist/nodes/Instagram/descriptions/comment/Comment.fields.js +161 -0
  25. package/dist/nodes/Instagram/descriptions/comment/Comment.fields.js.map +1 -0
  26. package/dist/nodes/Instagram/descriptions/comment/Comment.operations.d.ts +2 -0
  27. package/dist/nodes/Instagram/descriptions/comment/Comment.operations.js +62 -0
  28. package/dist/nodes/Instagram/descriptions/comment/Comment.operations.js.map +1 -0
  29. package/dist/nodes/Instagram/descriptions/comment/index.d.ts +2 -0
  30. package/dist/nodes/Instagram/descriptions/comment/index.js +8 -0
  31. package/dist/nodes/Instagram/descriptions/comment/index.js.map +1 -0
  32. package/dist/nodes/Instagram/descriptions/custom/Custom.fields.d.ts +2 -0
  33. package/dist/nodes/Instagram/descriptions/custom/Custom.fields.js +65 -0
  34. package/dist/nodes/Instagram/descriptions/custom/Custom.fields.js.map +1 -0
  35. package/dist/nodes/Instagram/descriptions/custom/Custom.operations.d.ts +2 -0
  36. package/dist/nodes/Instagram/descriptions/custom/Custom.operations.js +26 -0
  37. package/dist/nodes/Instagram/descriptions/custom/Custom.operations.js.map +1 -0
  38. package/dist/nodes/Instagram/descriptions/custom/index.d.ts +2 -0
  39. package/dist/nodes/Instagram/descriptions/custom/index.js +8 -0
  40. package/dist/nodes/Instagram/descriptions/custom/index.js.map +1 -0
  41. package/dist/nodes/Instagram/descriptions/index.d.ts +7 -0
  42. package/dist/nodes/Instagram/descriptions/index.js +24 -0
  43. package/dist/nodes/Instagram/descriptions/index.js.map +1 -0
  44. package/dist/nodes/Instagram/descriptions/insight/AccountInsight.fields.d.ts +2 -0
  45. package/dist/nodes/Instagram/descriptions/insight/AccountInsight.fields.js +164 -0
  46. package/dist/nodes/Instagram/descriptions/insight/AccountInsight.fields.js.map +1 -0
  47. package/dist/nodes/Instagram/descriptions/insight/Insight.operations.d.ts +2 -0
  48. package/dist/nodes/Instagram/descriptions/insight/Insight.operations.js +32 -0
  49. package/dist/nodes/Instagram/descriptions/insight/Insight.operations.js.map +1 -0
  50. package/dist/nodes/Instagram/descriptions/insight/MediaInsight.fields.d.ts +2 -0
  51. package/dist/nodes/Instagram/descriptions/insight/MediaInsight.fields.js +87 -0
  52. package/dist/nodes/Instagram/descriptions/insight/MediaInsight.fields.js.map +1 -0
  53. package/dist/nodes/Instagram/descriptions/insight/index.d.ts +4 -0
  54. package/dist/nodes/Instagram/descriptions/insight/index.js +12 -0
  55. package/dist/nodes/Instagram/descriptions/insight/index.js.map +1 -0
  56. package/dist/nodes/Instagram/descriptions/media/Media.operations.d.ts +2 -0
  57. package/dist/nodes/Instagram/descriptions/media/Media.operations.js +62 -0
  58. package/dist/nodes/Instagram/descriptions/media/Media.operations.js.map +1 -0
  59. package/dist/nodes/Instagram/descriptions/media/MediaGet.fields.d.ts +2 -0
  60. package/dist/nodes/Instagram/descriptions/media/MediaGet.fields.js +163 -0
  61. package/dist/nodes/Instagram/descriptions/media/MediaGet.fields.js.map +1 -0
  62. package/dist/nodes/Instagram/descriptions/media/MediaPublish.fields.d.ts +2 -0
  63. package/dist/nodes/Instagram/descriptions/media/MediaPublish.fields.js +285 -0
  64. package/dist/nodes/Instagram/descriptions/media/MediaPublish.fields.js.map +1 -0
  65. package/dist/nodes/Instagram/descriptions/media/index.d.ts +4 -0
  66. package/dist/nodes/Instagram/descriptions/media/index.js +12 -0
  67. package/dist/nodes/Instagram/descriptions/media/index.js.map +1 -0
  68. package/dist/nodes/Instagram/descriptions/mention/Mention.fields.d.ts +2 -0
  69. package/dist/nodes/Instagram/descriptions/mention/Mention.fields.js +122 -0
  70. package/dist/nodes/Instagram/descriptions/mention/Mention.fields.js.map +1 -0
  71. package/dist/nodes/Instagram/descriptions/mention/Mention.operations.d.ts +2 -0
  72. package/dist/nodes/Instagram/descriptions/mention/Mention.operations.js +38 -0
  73. package/dist/nodes/Instagram/descriptions/mention/Mention.operations.js.map +1 -0
  74. package/dist/nodes/Instagram/descriptions/mention/index.d.ts +2 -0
  75. package/dist/nodes/Instagram/descriptions/mention/index.js +8 -0
  76. package/dist/nodes/Instagram/descriptions/mention/index.js.map +1 -0
  77. package/dist/nodes/Instagram/descriptions/message/Message.fields.d.ts +2 -0
  78. package/dist/nodes/Instagram/descriptions/message/Message.fields.js +123 -0
  79. package/dist/nodes/Instagram/descriptions/message/Message.fields.js.map +1 -0
  80. package/dist/nodes/Instagram/descriptions/message/Message.operations.d.ts +2 -0
  81. package/dist/nodes/Instagram/descriptions/message/Message.operations.js +44 -0
  82. package/dist/nodes/Instagram/descriptions/message/Message.operations.js.map +1 -0
  83. package/dist/nodes/Instagram/descriptions/message/index.d.ts +2 -0
  84. package/dist/nodes/Instagram/descriptions/message/index.js +8 -0
  85. package/dist/nodes/Instagram/descriptions/message/index.js.map +1 -0
  86. package/dist/nodes/Instagram/descriptions/user/User.operations.d.ts +2 -0
  87. package/dist/nodes/Instagram/descriptions/user/User.operations.js +38 -0
  88. package/dist/nodes/Instagram/descriptions/user/User.operations.js.map +1 -0
  89. package/dist/nodes/Instagram/descriptions/user/UserInsights.fields.d.ts +2 -0
  90. package/dist/nodes/Instagram/descriptions/user/UserInsights.fields.js +164 -0
  91. package/dist/nodes/Instagram/descriptions/user/UserInsights.fields.js.map +1 -0
  92. package/dist/nodes/Instagram/descriptions/user/UserProfile.fields.d.ts +2 -0
  93. package/dist/nodes/Instagram/descriptions/user/UserProfile.fields.js +83 -0
  94. package/dist/nodes/Instagram/descriptions/user/UserProfile.fields.js.map +1 -0
  95. package/dist/nodes/Instagram/descriptions/user/index.d.ts +4 -0
  96. package/dist/nodes/Instagram/descriptions/user/index.js +12 -0
  97. package/dist/nodes/Instagram/descriptions/user/index.js.map +1 -0
  98. package/dist/nodes/Instagram/handlers/CommentHandler.d.ts +2 -0
  99. package/dist/nodes/Instagram/handlers/CommentHandler.js +63 -0
  100. package/dist/nodes/Instagram/handlers/CommentHandler.js.map +1 -0
  101. package/dist/nodes/Instagram/handlers/CustomHandler.d.ts +2 -0
  102. package/dist/nodes/Instagram/handlers/CustomHandler.js +28 -0
  103. package/dist/nodes/Instagram/handlers/CustomHandler.js.map +1 -0
  104. package/dist/nodes/Instagram/handlers/InsightHandler.d.ts +2 -0
  105. package/dist/nodes/Instagram/handlers/InsightHandler.js +42 -0
  106. package/dist/nodes/Instagram/handlers/InsightHandler.js.map +1 -0
  107. package/dist/nodes/Instagram/handlers/MediaHandler.d.ts +2 -0
  108. package/dist/nodes/Instagram/handlers/MediaHandler.js +172 -0
  109. package/dist/nodes/Instagram/handlers/MediaHandler.js.map +1 -0
  110. package/dist/nodes/Instagram/handlers/MentionHandler.d.ts +2 -0
  111. package/dist/nodes/Instagram/handlers/MentionHandler.js +48 -0
  112. package/dist/nodes/Instagram/handlers/MentionHandler.js.map +1 -0
  113. package/dist/nodes/Instagram/handlers/MessageHandler.d.ts +2 -0
  114. package/dist/nodes/Instagram/handlers/MessageHandler.js +57 -0
  115. package/dist/nodes/Instagram/handlers/MessageHandler.js.map +1 -0
  116. package/dist/nodes/Instagram/handlers/UserHandler.d.ts +2 -0
  117. package/dist/nodes/Instagram/handlers/UserHandler.js +48 -0
  118. package/dist/nodes/Instagram/handlers/UserHandler.js.map +1 -0
  119. package/dist/nodes/Instagram/instagram.svg +1 -0
  120. package/package.json +34 -47
  121. package/API_REFERENCE.md +0 -907
  122. package/AUTHENTICATION_GUIDE.md +0 -718
  123. package/CHANGELOG.md +0 -391
  124. package/dist/credentials/InstagramUnifiedLoginApi.credentials.d.ts +0 -9
  125. package/dist/credentials/InstagramUnifiedLoginApi.credentials.js +0 -481
  126. package/dist/credentials/InstagramUnifiedLoginApi.credentials.js.map +0 -1
  127. package/dist/nodes/Instagram/InstagramTrigger.node.d.ts +0 -17
  128. package/dist/nodes/Instagram/InstagramTrigger.node.js +0 -398
  129. package/dist/nodes/Instagram/InstagramTrigger.node.js.map +0 -1
  130. package/dist/nodes/Instagram/instagram-large.svg +0 -27
  131. package/dist/nodes/Instagram/instagram-small.svg +0 -14
  132. package/dist/nodes/Instagram/types.d.ts +0 -171
  133. package/dist/nodes/Instagram/types.js +0 -3
  134. package/dist/nodes/Instagram/types.js.map +0 -1
  135. package/dist/package.json +0 -76
  136. package/dist/tsconfig.tsbuildinfo +0 -1
  137. package/index.js +0 -0
@@ -1,398 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InstagramTrigger = void 0;
4
- const n8n_workflow_1 = require("n8n-workflow");
5
- const GenericFunctions_1 = require("./GenericFunctions");
6
- const UNIFIED_LOGIN_WEBHOOK_FIELDS = {
7
- messages: 'messages',
8
- messaging_postbacks: 'messaging_postbacks',
9
- comments: 'comments',
10
- mentions: 'mentions',
11
- };
12
- const MESSAGING_CHANGE_FIELDS = ['messages', 'messaging_postbacks', 'messaging_optins'];
13
- function getDesiredWebhookFields(events) {
14
- return [...new Set(events.map((event) => UNIFIED_LOGIN_WEBHOOK_FIELDS[event]).filter(Boolean))];
15
- }
16
- function shouldManageSubscription(context) {
17
- return (GenericFunctions_1.getAuthenticationMethod.call(context) === 'unifiedLogin' &&
18
- context.getNodeParameter('subscribeAccount', true));
19
- }
20
- async function getSubscribedFields(context, accountId) {
21
- var _a, _b, _c, _d;
22
- const response = await GenericFunctions_1.instagramApiRequest.call(context, 'GET', `/${accountId}/subscribed_apps`);
23
- const credentials = await context.getCredentials(GenericFunctions_1.UNIFIED_LOGIN_CREDENTIAL);
24
- const appId = String((_a = credentials.appId) !== null && _a !== void 0 ? _a : '').trim();
25
- const apps = ((_b = response === null || response === void 0 ? void 0 : response.data) !== null && _b !== void 0 ? _b : []);
26
- const ourApp = (_c = apps.find((app) => String(app.id) === appId)) !== null && _c !== void 0 ? _c : (apps.length === 1 ? apps[0] : undefined);
27
- return ((_d = ourApp === null || ourApp === void 0 ? void 0 : ourApp.subscribed_fields) !== null && _d !== void 0 ? _d : []).map(String);
28
- }
29
- const authenticationOptions = [
30
- {
31
- name: 'Unified Login (Recommended)',
32
- value: 'unifiedLogin',
33
- description: 'Instagram API with Unified Login (graph.facebook.com)',
34
- },
35
- {
36
- name: 'Instagram Login',
37
- value: 'instagramLogin',
38
- description: 'Instagram API with Instagram Login (graph.instagram.com)',
39
- },
40
- ];
41
- class InstagramTrigger {
42
- constructor() {
43
- this.description = {
44
- displayName: 'Instagram Trigger',
45
- name: 'instagramTrigger',
46
- icon: 'file:instagram-large.svg',
47
- group: ['trigger'],
48
- version: [1, 2],
49
- defaultVersion: 2,
50
- description: 'Triggers workflow on Instagram webhook events (messages, postbacks, etc.)',
51
- defaults: {
52
- name: 'Instagram Trigger',
53
- },
54
- inputs: [],
55
- outputs: [
56
- { type: 'main', displayName: 'Messages' },
57
- { type: 'main', displayName: 'Postbacks' },
58
- { type: 'main', displayName: 'Opt-ins' },
59
- { type: 'main', displayName: 'Comments' },
60
- { type: 'main', displayName: 'Mentions' },
61
- ],
62
- credentials: [
63
- {
64
- name: 'instagramUnifiedLoginApi',
65
- required: true,
66
- displayOptions: {
67
- show: {
68
- authentication: ['unifiedLogin'],
69
- },
70
- },
71
- },
72
- {
73
- name: 'instagramOAuth2Api',
74
- required: true,
75
- displayOptions: {
76
- show: {
77
- authentication: ['instagramLogin'],
78
- },
79
- },
80
- },
81
- ],
82
- webhooks: [
83
- {
84
- name: 'setup',
85
- httpMethod: 'GET',
86
- responseMode: 'onReceived',
87
- path: 'webhook',
88
- },
89
- {
90
- name: 'default',
91
- httpMethod: 'POST',
92
- responseMode: 'onReceived',
93
- path: 'webhook',
94
- },
95
- ],
96
- properties: [
97
- {
98
- displayName: 'Authentication',
99
- name: 'authentication',
100
- type: 'options',
101
- options: authenticationOptions,
102
- default: 'instagramLogin',
103
- displayOptions: {
104
- show: {
105
- '@version': [1],
106
- },
107
- },
108
- },
109
- {
110
- displayName: 'Authentication',
111
- name: 'authentication',
112
- type: 'options',
113
- options: authenticationOptions,
114
- default: 'unifiedLogin',
115
- displayOptions: {
116
- show: {
117
- '@version': [2],
118
- },
119
- },
120
- },
121
- {
122
- displayName: 'Events',
123
- name: 'events',
124
- type: 'multiOptions',
125
- options: [
126
- {
127
- name: 'Comments',
128
- value: 'comments',
129
- description: 'Trigger when someone comments on your media',
130
- },
131
- {
132
- name: 'Mentions',
133
- value: 'mentions',
134
- description: 'Trigger when someone mentions you in a comment or story',
135
- },
136
- {
137
- name: 'Messages',
138
- value: 'messages',
139
- description: 'Trigger on new messages received',
140
- },
141
- {
142
- name: 'Opt-Ins',
143
- value: 'messaging_optins',
144
- description: 'Trigger when user opts in (not available with Unified Login)',
145
- },
146
- {
147
- name: 'Postbacks',
148
- value: 'messaging_postbacks',
149
- description: 'Trigger when user clicks a button',
150
- },
151
- ],
152
- default: ['messages'],
153
- description: 'The events to listen to',
154
- },
155
- {
156
- displayName: 'Ignore Echo Messages',
157
- name: 'ignoreEcho',
158
- type: 'boolean',
159
- default: true,
160
- description: 'Whether to ignore echo messages (messages sent by your own bot)',
161
- displayOptions: {
162
- show: {
163
- events: ['messages'],
164
- },
165
- },
166
- },
167
- {
168
- displayName: 'Subscribe Account Automatically',
169
- name: 'subscribeAccount',
170
- type: 'boolean',
171
- default: true,
172
- description: 'Whether to subscribe the connected Instagram account to the selected webhook fields (POST /{ig-id}/subscribed_apps) when the workflow is activated. Unified Login requires this subscription for each account. Fields already subscribed are kept.',
173
- displayOptions: {
174
- show: {
175
- authentication: ['unifiedLogin'],
176
- },
177
- },
178
- },
179
- {
180
- displayName: 'Set this webhook URL as the Callback URL of the "Instagram" object in Webhooks of your Meta app (App Dashboard), with the Verify Token of the credential. The app must be Live to receive notifications from client accounts.',
181
- name: 'notice',
182
- type: 'notice',
183
- default: '',
184
- displayOptions: {
185
- show: {
186
- authentication: ['unifiedLogin'],
187
- },
188
- },
189
- },
190
- {
191
- displayName: 'To set up the webhook, you need to configure it in your Meta App Dashboard. Use this webhook URL in the callback URL field.',
192
- name: 'notice',
193
- type: 'notice',
194
- default: '',
195
- displayOptions: {
196
- show: {
197
- authentication: ['instagramLogin'],
198
- },
199
- },
200
- },
201
- ],
202
- };
203
- this.webhookMethods = {
204
- default: {
205
- async checkExists() {
206
- if (!shouldManageSubscription(this)) {
207
- return true;
208
- }
209
- const desired = getDesiredWebhookFields(this.getNodeParameter('events', []));
210
- if (desired.length === 0) {
211
- return true;
212
- }
213
- try {
214
- const accountId = await GenericFunctions_1.getInstagramAccountId.call(this);
215
- const subscribed = await getSubscribedFields(this, accountId);
216
- return desired.every((field) => subscribed.includes(field));
217
- }
218
- catch (error) {
219
- return false;
220
- }
221
- },
222
- async create() {
223
- if (!shouldManageSubscription(this)) {
224
- return true;
225
- }
226
- const desired = getDesiredWebhookFields(this.getNodeParameter('events', []));
227
- if (desired.length === 0) {
228
- return true;
229
- }
230
- const accountId = await GenericFunctions_1.getInstagramAccountId.call(this);
231
- let subscribed = [];
232
- try {
233
- subscribed = await getSubscribedFields(this, accountId);
234
- }
235
- catch (error) {
236
- }
237
- const fields = [...new Set([...subscribed, ...desired])];
238
- await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${accountId}/subscribed_apps`, {}, {
239
- subscribed_fields: fields.join(','),
240
- });
241
- return true;
242
- },
243
- async delete() {
244
- return true;
245
- },
246
- },
247
- setup: {
248
- async checkExists() {
249
- return true;
250
- },
251
- async create() {
252
- return true;
253
- },
254
- async delete() {
255
- return true;
256
- },
257
- },
258
- };
259
- }
260
- async webhook() {
261
- var _a, _b, _c, _d, _e, _f, _g, _h;
262
- const req = this.getRequestObject();
263
- const query = this.getQueryData();
264
- const headerData = this.getHeaderData();
265
- const bodyData = this.getBodyData();
266
- const isUnifiedLogin = GenericFunctions_1.getAuthenticationMethod.call(this) === 'unifiedLogin';
267
- const credentials = await this.getCredentials(GenericFunctions_1.getCredentialType.call(this));
268
- if (req.method === 'GET') {
269
- const mode = query['hub.mode'];
270
- const token = query['hub.verify_token'];
271
- const challenge = query['hub.challenge'];
272
- const verifyToken = credentials.webhookVerifyToken;
273
- if (mode === 'subscribe' && token === verifyToken) {
274
- return {
275
- webhookResponse: challenge,
276
- };
277
- }
278
- else {
279
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Webhook verification failed: Invalid verify token');
280
- }
281
- }
282
- if (req.method === 'POST') {
283
- const signature = headerData['x-hub-signature-256'];
284
- const appSecret = (isUnifiedLogin ? credentials.appSecret : credentials.clientSecret);
285
- if (!signature) {
286
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Webhook authentication failed: No signature provided');
287
- }
288
- const rawBody = req.rawBody;
289
- const isValid = (0, GenericFunctions_1.validateSignature)(rawBody !== null && rawBody !== void 0 ? rawBody : JSON.stringify(bodyData), signature, appSecret);
290
- if (!isValid) {
291
- console.warn('Invalid signature detected, but continuing for testing purposes.');
292
- }
293
- const webhookData = bodyData;
294
- const messagesData = [];
295
- const postbacksData = [];
296
- const optinsData = [];
297
- const commentsData = [];
298
- const mentionsData = [];
299
- const events = this.getNodeParameter('events', []);
300
- const ignoreEcho = this.getNodeParameter('ignoreEcho', true);
301
- const handleMessagingEvent = (messagingEvent, entryId) => {
302
- var _a, _b;
303
- const data = {
304
- senderId: (_a = messagingEvent.sender) === null || _a === void 0 ? void 0 : _a.id,
305
- recipientId: (_b = messagingEvent.recipient) === null || _b === void 0 ? void 0 : _b.id,
306
- timestamp: messagingEvent.timestamp,
307
- entryId,
308
- };
309
- if (messagingEvent.message && events.includes('messages')) {
310
- const isEcho = messagingEvent.message.is_echo || false;
311
- if (ignoreEcho && isEcho) {
312
- return;
313
- }
314
- data.eventType = 'message';
315
- data.messageId = messagingEvent.message.mid;
316
- data.text = messagingEvent.message.text;
317
- data.attachments = messagingEvent.message.attachments;
318
- if (messagingEvent.message.quick_reply) {
319
- data.quickReplyPayload = messagingEvent.message.quick_reply.payload;
320
- }
321
- data.isEcho = isEcho;
322
- messagesData.push({ json: data });
323
- }
324
- if (messagingEvent.postback && events.includes('messaging_postbacks')) {
325
- data.eventType = 'postback';
326
- data.payload = messagingEvent.postback.payload;
327
- data.title = messagingEvent.postback.title;
328
- postbacksData.push({ json: data });
329
- }
330
- if (messagingEvent.optin && events.includes('messaging_optins')) {
331
- data.eventType = 'optin';
332
- data.ref = messagingEvent.optin.ref;
333
- optinsData.push({ json: data });
334
- }
335
- };
336
- for (const entry of webhookData.entry || []) {
337
- for (const messagingEvent of ((_a = entry.messaging) !== null && _a !== void 0 ? _a : [])) {
338
- handleMessagingEvent(messagingEvent, entry.id);
339
- }
340
- for (const change of ((_b = entry.changes) !== null && _b !== void 0 ? _b : [])) {
341
- if (MESSAGING_CHANGE_FIELDS.includes(change.field) && ((_c = change.value) === null || _c === void 0 ? void 0 : _c.sender)) {
342
- handleMessagingEvent(change.value, entry.id);
343
- continue;
344
- }
345
- if (change.field === 'comments' && events.includes('comments')) {
346
- const commentValue = change.value;
347
- const data = {
348
- eventType: 'comment',
349
- commentId: (_d = commentValue.id) !== null && _d !== void 0 ? _d : commentValue.comment_id,
350
- text: commentValue.text,
351
- mediaId: (_e = commentValue.media) === null || _e === void 0 ? void 0 : _e.id,
352
- mediaProductType: (_f = commentValue.media) === null || _f === void 0 ? void 0 : _f.media_product_type,
353
- fromUserId: (_g = commentValue.from) === null || _g === void 0 ? void 0 : _g.id,
354
- fromUsername: (_h = commentValue.from) === null || _h === void 0 ? void 0 : _h.username,
355
- entryId: entry.id,
356
- timestamp: entry.time,
357
- };
358
- if (commentValue.parent_id) {
359
- data.parentCommentId = commentValue.parent_id;
360
- data.isReply = true;
361
- }
362
- else {
363
- data.isReply = false;
364
- }
365
- commentsData.push({ json: data });
366
- }
367
- if (change.field === 'mentions' && events.includes('mentions')) {
368
- const mentionValue = change.value;
369
- const data = {
370
- eventType: 'mention',
371
- mentionId: mentionValue.id,
372
- mediaId: mentionValue.media_id,
373
- entryId: entry.id,
374
- timestamp: entry.time,
375
- };
376
- if (mentionValue.comment_id) {
377
- data.commentId = mentionValue.comment_id;
378
- data.mentionType = 'comment';
379
- }
380
- else {
381
- data.mentionType = 'story';
382
- }
383
- if (mentionValue.text) {
384
- data.text = mentionValue.text;
385
- }
386
- mentionsData.push({ json: data });
387
- }
388
- }
389
- }
390
- return {
391
- workflowData: [messagesData, postbacksData, optinsData, commentsData, mentionsData],
392
- };
393
- }
394
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Method not allowed');
395
- }
396
- }
397
- exports.InstagramTrigger = InstagramTrigger;
398
- //# sourceMappingURL=InstagramTrigger.node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Instagram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AAM,CAAC,KAAsB,CAAC;wBACnD,MAAM,IAAI,GAAgB;4BACzB,SAAS,EAAE,SAAS;4BACpB,SAAS,EAAE,YAAY,CAAC,EAAE;4BAC1B,OAAO,EAAE,YAAY,CAAC,QAAQ;4BAC9B,OAAO,EAAE,KAAK,CAAC,EAAE;4BACjB,SAAS,EAAE,KAAK,CAAC,IAAI;yBACrB,CAAC;wBACF,IAAI,YAAY,CAAC,UAAU,EAAE,CAAC;4BAC7B,IAAI,CAAC,SAAS,GAAG,YAAY,CAAC,UAAU,CAAC;4BACzC,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;wBAC9B,CAAC;6BAAM,CAAC;4BACP,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;wBAC5B,CAAC;wBACD,IAAI,YAAY,CAAC,IAAI,EAAE,CAAC;4BACvB,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;wBAC/B,CAAC;wBACD,YAAY,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBACnC,CAAC;gBACF,CAAC;YACF,CAAC;YAED,OAAO;gBACN,YAAY,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,CAAC;aACnF,CAAC;QACH,CAAC;QAED,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,oBAAoB,CAAC,CAAC;IACpE,CAAC;CACD;AA9ZD,4CA8ZC"}
@@ -1,27 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
2
- <svg width="800px" height="800px" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
3
- <rect x="2" y="2" width="28" height="28" rx="6" fill="url(#paint0_radial_87_7153)"/>
4
- <rect x="2" y="2" width="28" height="28" rx="6" fill="url(#paint1_radial_87_7153)"/>
5
- <rect x="2" y="2" width="28" height="28" rx="6" fill="url(#paint2_radial_87_7153)"/>
6
- <path d="M23 10.5C23 11.3284 22.3284 12 21.5 12C20.6716 12 20 11.3284 20 10.5C20 9.67157 20.6716 9 21.5 9C22.3284 9 23 9.67157 23 10.5Z" fill="white"/>
7
- <path fill-rule="evenodd" clip-rule="evenodd" d="M16 21C18.7614 21 21 18.7614 21 16C21 13.2386 18.7614 11 16 11C13.2386 11 11 13.2386 11 16C11 18.7614 13.2386 21 16 21ZM16 19C17.6569 19 19 17.6569 19 16C19 14.3431 17.6569 13 16 13C14.3431 13 13 14.3431 13 16C13 17.6569 14.3431 19 16 19Z" fill="white"/>
8
- <path fill-rule="evenodd" clip-rule="evenodd" d="M6 15.6C6 12.2397 6 10.5595 6.65396 9.27606C7.2292 8.14708 8.14708 7.2292 9.27606 6.65396C10.5595 6 12.2397 6 15.6 6H16.4C19.7603 6 21.4405 6 22.7239 6.65396C23.8529 7.2292 24.7708 8.14708 25.346 9.27606C26 10.5595 26 12.2397 26 15.6V16.4C26 19.7603 26 21.4405 25.346 22.7239C24.7708 23.8529 23.8529 24.7708 22.7239 25.346C21.4405 26 19.7603 26 16.4 26H15.6C12.2397 26 10.5595 26 9.27606 25.346C8.14708 24.7708 7.2292 23.8529 6.65396 22.7239C6 21.4405 6 19.7603 6 16.4V15.6ZM15.6 8H16.4C18.1132 8 19.2777 8.00156 20.1779 8.0751C21.0548 8.14674 21.5032 8.27659 21.816 8.43597C22.5686 8.81947 23.1805 9.43139 23.564 10.184C23.7234 10.4968 23.8533 10.9452 23.9249 11.8221C23.9984 12.7223 24 13.8868 24 15.6V16.4C24 18.1132 23.9984 19.2777 23.9249 20.1779C23.8533 21.0548 23.7234 21.5032 23.564 21.816C23.1805 22.5686 22.5686 23.1805 21.816 23.564C21.5032 23.7234 21.0548 23.8533 20.1779 23.9249C19.2777 23.9984 18.1132 24 16.4 24H15.6C13.8868 24 12.7223 23.9984 11.8221 23.9249C10.9452 23.8533 10.4968 23.7234 10.184 23.564C9.43139 23.1805 8.81947 22.5686 8.43597 21.816C8.27659 21.5032 8.14674 21.0548 8.0751 20.1779C8.00156 19.2777 8 18.1132 8 16.4V15.6C8 13.8868 8.00156 12.7223 8.0751 11.8221C8.14674 10.9452 8.27659 10.4968 8.43597 10.184C8.81947 9.43139 9.43139 8.81947 10.184 8.43597C10.4968 8.27659 10.9452 8.14674 11.8221 8.0751C12.7223 8.00156 13.8868 8 15.6 8Z" fill="white"/>
9
- <defs>
10
- <radialGradient id="paint0_radial_87_7153" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(12 23) rotate(-55.3758) scale(25.5196)">
11
- <stop stop-color="#B13589"/>
12
- <stop offset="0.79309" stop-color="#C62F94"/>
13
- <stop offset="1" stop-color="#8A3AC8"/>
14
- </radialGradient>
15
- <radialGradient id="paint1_radial_87_7153" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(11 31) rotate(-65.1363) scale(22.5942)">
16
- <stop stop-color="#E0E8B7"/>
17
- <stop offset="0.444662" stop-color="#FB8A2E"/>
18
- <stop offset="0.71474" stop-color="#E2425C"/>
19
- <stop offset="1" stop-color="#E2425C" stop-opacity="0"/>
20
- </radialGradient>
21
- <radialGradient id="paint2_radial_87_7153" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(0.500002 3) rotate(-8.1301) scale(38.8909 8.31836)">
22
- <stop offset="0.156701" stop-color="#406ADC"/>
23
- <stop offset="0.467799" stop-color="#6A45BE"/>
24
- <stop offset="1" stop-color="#6A45BE" stop-opacity="0"/>
25
- </radialGradient>
26
- </defs>
27
- </svg>
@@ -1,14 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
2
- <defs>
3
- <linearGradient id="instagram-gradient" x1="0%" y1="100%" x2="100%" y2="0%">
4
- <stop offset="0%" style="stop-color:#FCAF45;stop-opacity:1" />
5
- <stop offset="25%" style="stop-color:#F77737;stop-opacity:1" />
6
- <stop offset="50%" style="stop-color:#E1306C;stop-opacity:1" />
7
- <stop offset="75%" style="stop-color:#C13584;stop-opacity:1" />
8
- <stop offset="100%" style="stop-color:#833AB4;stop-opacity:1" />
9
- </linearGradient>
10
- </defs>
11
- <rect x="2" y="2" width="20" height="20" rx="5" ry="5" fill="url(#instagram-gradient)"/>
12
- <circle cx="12" cy="12" r="4" fill="none" stroke="white" stroke-width="2"/>
13
- <circle cx="18" cy="6" r="1.5" fill="white"/>
14
- </svg>
@@ -1,171 +0,0 @@
1
- export interface IInstagramCredentials {
2
- appId: string;
3
- appSecret: string;
4
- accessToken: string;
5
- igUserId: string;
6
- webhookVerifyToken?: string;
7
- }
8
- export interface IInstagramMessage {
9
- recipient: {
10
- id: string;
11
- };
12
- message: {
13
- text?: string;
14
- attachment?: IAttachment;
15
- quick_replies?: IQuickReply[];
16
- };
17
- messaging_type?: 'RESPONSE' | 'UPDATE' | 'MESSAGE_TAG';
18
- tag?: string;
19
- }
20
- export interface IAttachment {
21
- type: 'image' | 'video' | 'audio' | 'file' | 'template';
22
- payload: IAttachmentPayload;
23
- }
24
- export interface IAttachmentPayload {
25
- url?: string;
26
- is_reusable?: boolean;
27
- template_type?: 'button' | 'generic' | 'media';
28
- text?: string;
29
- elements?: IGenericElement[];
30
- buttons?: IButton[];
31
- }
32
- export interface IButton {
33
- type: 'web_url' | 'postback';
34
- title: string;
35
- url?: string;
36
- payload?: string;
37
- }
38
- export interface IGenericElement {
39
- title: string;
40
- subtitle?: string;
41
- image_url?: string;
42
- default_action?: IDefaultAction;
43
- buttons?: IButton[];
44
- }
45
- export interface IDefaultAction {
46
- type: 'web_url';
47
- url: string;
48
- }
49
- export interface IQuickReply {
50
- content_type: 'text';
51
- title: string;
52
- payload: string;
53
- }
54
- export interface IInstagramWebhook {
55
- object: string;
56
- entry: IWebhookEntry[];
57
- }
58
- export interface IWebhookEntry {
59
- id: string;
60
- time: number;
61
- messaging?: IMessagingEvent[];
62
- changes?: IWebhookChange[];
63
- }
64
- export interface IWebhookChange {
65
- field: string;
66
- value: ICommentValue | IMentionValue | any;
67
- }
68
- export interface ICommentValue {
69
- id?: string;
70
- comment_id?: string;
71
- media: {
72
- id: string;
73
- media_product_type: string;
74
- };
75
- text: string;
76
- from: {
77
- id: string;
78
- username: string;
79
- };
80
- parent_id?: string;
81
- }
82
- export interface IMentionValue {
83
- id: string;
84
- media_id: string;
85
- comment_id?: string;
86
- text?: string;
87
- }
88
- export interface IMessagingEvent {
89
- sender: {
90
- id: string;
91
- };
92
- recipient: {
93
- id: string;
94
- };
95
- timestamp: number;
96
- message?: {
97
- mid: string;
98
- text?: string;
99
- attachments?: any[];
100
- quick_reply?: {
101
- payload: string;
102
- };
103
- is_echo?: boolean;
104
- };
105
- postback?: {
106
- title: string;
107
- payload: string;
108
- };
109
- optin?: {
110
- ref: string;
111
- };
112
- }
113
- export interface IMediaUploadResponse {
114
- id: string;
115
- }
116
- export interface IUserProfile {
117
- id: string;
118
- name?: string;
119
- username?: string;
120
- profile_pic?: string;
121
- }
122
- export interface IMediaObject {
123
- id: string;
124
- media_type?: 'IMAGE' | 'VIDEO' | 'CAROUSEL_ALBUM';
125
- media_url?: string;
126
- permalink?: string;
127
- caption?: string;
128
- timestamp?: string;
129
- like_count?: number;
130
- comments_count?: number;
131
- owner?: {
132
- id: string;
133
- username?: string;
134
- };
135
- thumbnail_url?: string;
136
- children?: {
137
- data: IMediaObject[];
138
- };
139
- }
140
- export interface IPostContainer {
141
- id: string;
142
- status_code?: string;
143
- }
144
- export interface IUserTag {
145
- username: string;
146
- x: number;
147
- y: number;
148
- }
149
- export interface IProductTag {
150
- product_id: string;
151
- x: number;
152
- y: number;
153
- }
154
- export interface ICarouselChild {
155
- media_type: 'IMAGE' | 'VIDEO';
156
- image_url?: string;
157
- video_url?: string;
158
- user_tags?: string;
159
- }
160
- export interface IStoryOptions {
161
- location_id?: string;
162
- collaborators?: string;
163
- }
164
- export interface IPostOptions extends IStoryOptions {
165
- user_tags?: string;
166
- product_tags?: string;
167
- thumb_offset?: number;
168
- share_to_feed?: boolean;
169
- cover_url?: string;
170
- audio_name?: string;
171
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../nodes/Instagram/types.ts"],"names":[],"mappings":""}