@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,481 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InstagramUnifiedLoginApi = void 0;
4
- const crypto_1 = require("crypto");
5
- const GRAPH_API_VERSION = 'v27.0';
6
- const GRAPH_API_URL = `https://graph.facebook.com/${GRAPH_API_VERSION}`;
7
- const ONE_DAY = 24 * 60 * 60;
8
- const DEFAULT_RENEW_BEFORE_DAYS = 7;
9
- const MAX_RENEW_BEFORE_DAYS = 30;
10
- const RENEWED_TOKEN_LIFETIME = 60 * ONE_DAY;
11
- const RENEWAL_RETRY_DELAY = 6 * 60 * 60;
12
- const SHARED_RESULT_TTL_MS = 10 * 60 * 1000;
13
- const sharedResults = new Map();
14
- async function runOnce(key, task) {
15
- const now = Date.now();
16
- for (const [cachedKey, cached] of sharedResults) {
17
- if (cached.expiresAt <= now)
18
- sharedResults.delete(cachedKey);
19
- }
20
- const existing = sharedResults.get(key);
21
- if (existing) {
22
- return await existing.promise;
23
- }
24
- const promise = task();
25
- sharedResults.set(key, { promise, expiresAt: now + SHARED_RESULT_TTL_MS });
26
- promise.catch(() => sharedResults.delete(key));
27
- return await promise;
28
- }
29
- class TokenMaintenanceRequiredError extends Error {
30
- constructor() {
31
- super('Instagram Unified Login: the access token must be initialized or renewed before this request, ' +
32
- 'but n8n did not run the credential pre-authentication step. Check that the request uses ' +
33
- 'httpRequestWithAuthentication and that your n8n setup supports credentials with an expirable field.');
34
- this.response = { status: 401 };
35
- this.name = 'TokenMaintenanceRequiredError';
36
- }
37
- }
38
- function nowInSeconds() {
39
- return Math.floor(Date.now() / 1000);
40
- }
41
- function hashValue(value) {
42
- return (0, crypto_1.createHash)('sha256').update(value).digest('hex');
43
- }
44
- function appSecretProof(accessToken, appSecret) {
45
- return (0, crypto_1.createHmac)('sha256', appSecret).update(accessToken).digest('hex');
46
- }
47
- function stringValue(value) {
48
- return typeof value === 'string'
49
- ? value.trim()
50
- : value === undefined || value === null
51
- ? ''
52
- : String(value).trim();
53
- }
54
- function sourceFingerprint(credentials) {
55
- const method = stringValue(credentials.connectionMethod) || 'authorizationCode';
56
- const source = method === 'accessToken'
57
- ? stringValue(credentials.accessToken)
58
- : stringValue(credentials.authorizationCode);
59
- return hashValue([stringValue(credentials.appId), method, source].join('|'));
60
- }
61
- function renewWindowInSeconds(credentials) {
62
- const configured = Number(credentials.renewBeforeDays);
63
- const days = Number.isFinite(configured) && configured > 0 ? configured : DEFAULT_RENEW_BEFORE_DAYS;
64
- return Math.min(days, MAX_RENEW_BEFORE_DAYS) * ONE_DAY;
65
- }
66
- function isRenewalDue(credentials, now) {
67
- if (credentials.autoRenew === false || credentials.renewalSupported === false) {
68
- return false;
69
- }
70
- const expiresAt = Number(credentials.tokenExpiresAt) || 0;
71
- if (expiresAt <= 0) {
72
- return false;
73
- }
74
- if (expiresAt - now > renewWindowInSeconds(credentials)) {
75
- return false;
76
- }
77
- return now >= (Number(credentials.renewalRetryAfter) || 0);
78
- }
79
- function getMaintenanceReason(credentials, now) {
80
- if (!stringValue(credentials.sessionToken) ||
81
- credentials.sourceFingerprint !== sourceFingerprint(credentials)) {
82
- return 'initialize';
83
- }
84
- if (isRenewalDue(credentials, now)) {
85
- return 'renew';
86
- }
87
- return undefined;
88
- }
89
- function describeGraphError(error) {
90
- var _a, _b, _c, _d, _e, _f, _g;
91
- const candidate = error;
92
- const graphError = (_c = (_b = (_a = candidate === null || candidate === void 0 ? void 0 : candidate.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) !== null && _c !== void 0 ? _c : (_f = (_e = (_d = candidate === null || candidate === void 0 ? void 0 : candidate.cause) === null || _d === void 0 ? void 0 : _d.response) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.error;
93
- if (graphError === null || graphError === void 0 ? void 0 : graphError.message) {
94
- return graphError.code !== undefined
95
- ? `${graphError.message} (code ${graphError.code})`
96
- : graphError.message;
97
- }
98
- return (_g = candidate === null || candidate === void 0 ? void 0 : candidate.message) !== null && _g !== void 0 ? _g : String(error);
99
- }
100
- async function graphGet(helper, path, qs) {
101
- return (await helper.helpers.httpRequest({
102
- method: 'GET',
103
- url: `${GRAPH_API_URL}${path}`,
104
- qs,
105
- json: true,
106
- }));
107
- }
108
- async function inspectToken(helper, token, appId, appSecret) {
109
- var _a;
110
- const response = await graphGet(helper, '/debug_token', {
111
- input_token: token,
112
- access_token: `${appId}|${appSecret}`,
113
- });
114
- return ((_a = response.data) !== null && _a !== void 0 ? _a : {});
115
- }
116
- async function exchangeAuthorizationCode(helper, credentials) {
117
- const code = stringValue(credentials.authorizationCode);
118
- if (!code) {
119
- throw new Error('Paste the "code" parameter Meta adds to your Redirect URL after the client finishes the Unified Login.');
120
- }
121
- const qs = {
122
- client_id: stringValue(credentials.appId),
123
- client_secret: stringValue(credentials.appSecret),
124
- code,
125
- };
126
- const redirectUri = stringValue(credentials.redirectUri);
127
- if (redirectUri) {
128
- qs.redirect_uri = redirectUri;
129
- }
130
- try {
131
- const response = await graphGet(helper, '/oauth/access_token', qs);
132
- const accessToken = stringValue(response.access_token);
133
- if (!accessToken) {
134
- throw new Error('Meta returned no access_token');
135
- }
136
- return accessToken;
137
- }
138
- catch (error) {
139
- throw new Error(`Could not exchange the authorization code: ${describeGraphError(error)}. ` +
140
- 'Codes can be used only once and expire after a few minutes: open the Login URL again, ' +
141
- 'paste the new code and save the credential. The Redirect URL must match the one in your configuration.');
142
- }
143
- }
144
- async function getInitialAccessToken(helper, credentials) {
145
- if (credentials.connectionMethod === 'accessToken') {
146
- return stringValue(credentials.accessToken);
147
- }
148
- const key = hashValue(`exchange|${stringValue(credentials.appId)}|${stringValue(credentials.authorizationCode)}`);
149
- const result = await runOnce(key, async () => ({
150
- accessToken: await exchangeAuthorizationCode(helper, credentials),
151
- }));
152
- return stringValue(result.accessToken);
153
- }
154
- async function initializeConnection(helper, credentials) {
155
- var _a, _b;
156
- const appId = stringValue(credentials.appId);
157
- const appSecret = stringValue(credentials.appSecret);
158
- if (!appId || !appSecret) {
159
- throw new Error('Meta App ID and Meta App Secret are required.');
160
- }
161
- const accessToken = await getInitialAccessToken(helper, credentials);
162
- if (!accessToken) {
163
- throw new Error('Paste the Business Integration System User Access Token in "Access Token".');
164
- }
165
- let tokenInfo;
166
- try {
167
- tokenInfo = await inspectToken(helper, accessToken, appId, appSecret);
168
- }
169
- catch (error) {
170
- throw new Error(`Could not validate the access token with /debug_token: ${describeGraphError(error)}. ` +
171
- 'Use the App ID and App Secret of the Meta app (not the Instagram app ID/secret).');
172
- }
173
- if (tokenInfo.is_valid === false) {
174
- throw new Error(`The access token is not valid${((_a = tokenInfo.error) === null || _a === void 0 ? void 0 : _a.message) ? `: ${tokenInfo.error.message}` : ''}. ` +
175
- 'Ask the client to connect again through the Login URL.');
176
- }
177
- const proof = appSecretProof(accessToken, appSecret);
178
- let clientBusinessId = '';
179
- try {
180
- const me = await graphGet(helper, '/me', {
181
- fields: 'client_business_id',
182
- access_token: accessToken,
183
- appsecret_proof: proof,
184
- });
185
- clientBusinessId = stringValue(me.client_business_id);
186
- }
187
- catch {
188
- }
189
- let resolvedInstagramAccountId = '';
190
- let resolvedInstagramUsername = '';
191
- try {
192
- const accounts = await graphGet(helper, '/me/assigned_instagram_accounts', {
193
- fields: 'id,username',
194
- access_token: accessToken,
195
- appsecret_proof: proof,
196
- });
197
- const data = ((_b = accounts.data) !== null && _b !== void 0 ? _b : []);
198
- const configuredId = stringValue(credentials.instagramAccountId);
199
- const selected = configuredId
200
- ? data.find((account) => stringValue(account.id) === configuredId)
201
- : data.length === 1
202
- ? data[0]
203
- : undefined;
204
- if (selected) {
205
- resolvedInstagramAccountId = stringValue(selected.id);
206
- resolvedInstagramUsername = stringValue(selected.username);
207
- }
208
- }
209
- catch {
210
- }
211
- const scopes = Array.isArray(tokenInfo.scopes) ? tokenInfo.scopes : [];
212
- return {
213
- sessionToken: accessToken,
214
- tokenExpiresAt: Number(tokenInfo.expires_at) || 0,
215
- clientBusinessId,
216
- resolvedInstagramAccountId,
217
- resolvedInstagramUsername,
218
- renewalSupported: !!clientBusinessId && (scopes.length === 0 || scopes.includes('business_management')),
219
- renewalRetryAfter: 0,
220
- lastRenewalError: '',
221
- sourceFingerprint: sourceFingerprint(credentials),
222
- };
223
- }
224
- async function performRenewal(helper, credentials, now) {
225
- const currentToken = stringValue(credentials.sessionToken);
226
- const appId = stringValue(credentials.appId);
227
- const appSecret = stringValue(credentials.appSecret);
228
- const clientBusinessId = stringValue(credentials.clientBusinessId);
229
- try {
230
- const response = (await helper.helpers.httpRequest({
231
- method: 'POST',
232
- url: `${GRAPH_API_URL}/${clientBusinessId}/system_user_access_tokens`,
233
- qs: {
234
- access_token: currentToken,
235
- appsecret_proof: appSecretProof(currentToken, appSecret),
236
- set_token_expires_in_60_days: true,
237
- },
238
- json: true,
239
- }));
240
- const newToken = stringValue(response.access_token);
241
- if (!newToken) {
242
- throw new Error('Meta returned no access_token');
243
- }
244
- let expiresAt = now + RENEWED_TOKEN_LIFETIME;
245
- try {
246
- const info = await inspectToken(helper, newToken, appId, appSecret);
247
- if (info.expires_at !== undefined) {
248
- expiresAt = Number(info.expires_at) || 0;
249
- }
250
- }
251
- catch {
252
- }
253
- const stillInsideWindow = expiresAt > 0 && expiresAt - now <= renewWindowInSeconds(credentials);
254
- return {
255
- sessionToken: newToken,
256
- tokenExpiresAt: expiresAt,
257
- lastRenewedAt: now,
258
- renewalRetryAfter: stillInsideWindow ? now + ONE_DAY : 0,
259
- lastRenewalError: '',
260
- };
261
- }
262
- catch (error) {
263
- return {
264
- sessionToken: currentToken,
265
- renewalRetryAfter: now + RENEWAL_RETRY_DELAY,
266
- lastRenewalError: `${new Date(now * 1000).toISOString()} ${describeGraphError(error)}`,
267
- };
268
- }
269
- }
270
- async function renewToken(helper, credentials, now) {
271
- const key = hashValue(`renew|${stringValue(credentials.sessionToken)}`);
272
- return await runOnce(key, async () => await performRenewal(helper, credentials, now));
273
- }
274
- class InstagramUnifiedLoginApi {
275
- constructor() {
276
- this.name = 'instagramUnifiedLoginApi';
277
- this.displayName = 'Instagram Unified Login API';
278
- this.documentationUrl = 'https://developers.facebook.com/documentation/instagram-platform/instagram-api-with-unified-login';
279
- this.properties = [
280
- {
281
- displayName: 'Connect with the Instagram API with Unified Login: the client opens the Login URL of your Unified Login configuration (App Dashboard > Use cases > Manage messaging & content on Instagram > API setup with Unified login), logs in with Instagram or Facebook and is redirected to your Redirect URL with a "code". Paste that code below, save and run a node right away (codes expire in minutes): the first execution exchanges it and stores the token. The token is renewed automatically before it expires.',
282
- name: 'unifiedLoginNotice',
283
- type: 'notice',
284
- default: '',
285
- },
286
- {
287
- displayName: 'Meta App ID',
288
- name: 'appId',
289
- type: 'string',
290
- default: '',
291
- required: true,
292
- placeholder: '1234567890123456',
293
- description: 'ID of the Meta app (not the Instagram app ID shown in "API setup with Instagram login")',
294
- },
295
- {
296
- displayName: 'Meta App Secret',
297
- name: 'appSecret',
298
- type: 'string',
299
- typeOptions: { password: true },
300
- default: '',
301
- required: true,
302
- description: 'Secret of the Meta app (App settings > Basic). Also used to validate webhook signatures and to sign API calls (appsecret_proof).',
303
- },
304
- {
305
- displayName: 'Connection Method',
306
- name: 'connectionMethod',
307
- type: 'options',
308
- options: [
309
- {
310
- name: 'Authorization Code (Unified Login)',
311
- value: 'authorizationCode',
312
- description: 'Paste the code Meta sends to your Redirect URL after the client logs in',
313
- },
314
- {
315
- name: 'Access Token',
316
- value: 'accessToken',
317
- description: 'Paste a Business Integration System User Access Token you already have (e.g. "Generate token" in the App Dashboard)',
318
- },
319
- ],
320
- default: 'authorizationCode',
321
- },
322
- {
323
- displayName: 'Authorization Code',
324
- name: 'authorizationCode',
325
- type: 'string',
326
- typeOptions: { password: true },
327
- default: '',
328
- required: true,
329
- displayOptions: { show: { connectionMethod: ['authorizationCode'] } },
330
- description: 'Value of the "code" query parameter in the Redirect URL. It can be used only once and expires after a few minutes. To reconnect, paste a new code.',
331
- },
332
- {
333
- displayName: 'Redirect URL',
334
- name: 'redirectUri',
335
- type: 'string',
336
- default: '',
337
- displayOptions: { show: { connectionMethod: ['authorizationCode'] } },
338
- placeholder: 'https://example.com/instagram/callback',
339
- description: 'Exactly the same Redirect URL saved in your Unified Login configuration and used in the Login URL',
340
- },
341
- {
342
- displayName: 'Access Token',
343
- name: 'accessToken',
344
- type: 'string',
345
- typeOptions: { password: true },
346
- default: '',
347
- required: true,
348
- displayOptions: { show: { connectionMethod: ['accessToken'] } },
349
- description: 'Business Integration System User Access Token of the client business portfolio',
350
- },
351
- {
352
- displayName: 'Instagram Account ID',
353
- name: 'instagramAccountId',
354
- type: 'string',
355
- default: '',
356
- placeholder: '17841400000000000',
357
- description: 'Optional. Instagram professional account to use. Required only when the client shared more than one account with this connection (from /me/assigned_instagram_accounts).',
358
- },
359
- {
360
- displayName: 'Renew Token Automatically',
361
- name: 'autoRenew',
362
- type: 'boolean',
363
- default: true,
364
- description: 'Whether to renew expiring tokens (configurations with a 60-day expiration) through the Business Integration System User Access Token Management API. Requires the business_management permission in your configuration. Tokens that never expire are not renewed.',
365
- },
366
- {
367
- displayName: 'Renew Days Before Expiration',
368
- name: 'renewBeforeDays',
369
- type: 'number',
370
- typeOptions: { minValue: 1, maxValue: MAX_RENEW_BEFORE_DAYS },
371
- default: DEFAULT_RENEW_BEFORE_DAYS,
372
- displayOptions: { show: { autoRenew: [true] } },
373
- description: 'How many days before the expiration the token is renewed',
374
- },
375
- {
376
- displayName: 'Webhook Verify Token',
377
- name: 'webhookVerifyToken',
378
- type: 'string',
379
- typeOptions: { password: true },
380
- default: '',
381
- description: 'Optional. Verify Token set for the Instagram object in the Webhooks settings of your Meta app. Only needed for the Instagram Trigger node.',
382
- },
383
- {
384
- displayName: 'Session Token',
385
- name: 'sessionToken',
386
- type: 'hidden',
387
- typeOptions: { expirable: true, password: true },
388
- default: '',
389
- },
390
- {
391
- displayName: 'Token Expires At',
392
- name: 'tokenExpiresAt',
393
- type: 'hidden',
394
- default: 0,
395
- },
396
- {
397
- displayName: 'Client Business ID',
398
- name: 'clientBusinessId',
399
- type: 'hidden',
400
- default: '',
401
- },
402
- {
403
- displayName: 'Resolved Instagram Account ID',
404
- name: 'resolvedInstagramAccountId',
405
- type: 'hidden',
406
- default: '',
407
- },
408
- {
409
- displayName: 'Resolved Instagram Username',
410
- name: 'resolvedInstagramUsername',
411
- type: 'hidden',
412
- default: '',
413
- },
414
- {
415
- displayName: 'Renewal Supported',
416
- name: 'renewalSupported',
417
- type: 'hidden',
418
- default: true,
419
- },
420
- {
421
- displayName: 'Renewal Retry After',
422
- name: 'renewalRetryAfter',
423
- type: 'hidden',
424
- default: 0,
425
- },
426
- {
427
- displayName: 'Last Renewed At',
428
- name: 'lastRenewedAt',
429
- type: 'hidden',
430
- default: 0,
431
- },
432
- {
433
- displayName: 'Last Renewal Error',
434
- name: 'lastRenewalError',
435
- type: 'hidden',
436
- default: '',
437
- },
438
- {
439
- displayName: 'Source Fingerprint',
440
- name: 'sourceFingerprint',
441
- type: 'hidden',
442
- default: '',
443
- },
444
- ];
445
- this.authenticate = async (credentials, requestOptions) => {
446
- var _a, _b;
447
- if (getMaintenanceReason(credentials, nowInSeconds())) {
448
- throw new TokenMaintenanceRequiredError();
449
- }
450
- const token = stringValue(credentials.sessionToken);
451
- requestOptions.headers = {
452
- ...((_a = requestOptions.headers) !== null && _a !== void 0 ? _a : {}),
453
- Authorization: `Bearer ${token}`,
454
- };
455
- requestOptions.qs = {
456
- ...((_b = requestOptions.qs) !== null && _b !== void 0 ? _b : {}),
457
- appsecret_proof: appSecretProof(token, stringValue(credentials.appSecret)),
458
- };
459
- return requestOptions;
460
- };
461
- }
462
- async preAuthentication(credentials) {
463
- const now = nowInSeconds();
464
- const reason = getMaintenanceReason(credentials, now);
465
- if (!reason) {
466
- return {};
467
- }
468
- const update = {};
469
- let current = credentials;
470
- if (reason === 'initialize') {
471
- Object.assign(update, await initializeConnection(this, credentials));
472
- current = { ...credentials, ...update };
473
- }
474
- if (isRenewalDue(current, now)) {
475
- Object.assign(update, await renewToken(this, current, now));
476
- }
477
- return update;
478
- }
479
- }
480
- exports.InstagramUnifiedLoginApi = InstagramUnifiedLoginApi;
481
- //# sourceMappingURL=InstagramUnifiedLoginApi.credentials.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InstagramUnifiedLoginApi.credentials.js","sourceRoot":"","sources":["../../credentials/InstagramUnifiedLoginApi.credentials.ts"],"names":[],"mappings":";;;AAAA,mCAAgD;AAwChD,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAClC,MAAM,aAAa,GAAG,8BAA8B,iBAAiB,EAAE,CAAC;AAExE,MAAM,OAAO,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAC7B,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,sBAAsB,GAAG,EAAE,GAAG,OAAO,CAAC;AAC5C,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;AACxC,MAAM,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAgB5C,MAAM,aAAa,GAAG,IAAI,GAAG,EAAgE,CAAC;AAE9F,KAAK,UAAU,OAAO,CAAC,GAAW,EAAE,IAAgC;IACnE,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,KAAK,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,aAAa,EAAE,CAAC;QACjD,IAAI,MAAM,CAAC,SAAS,IAAI,GAAG;YAAE,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC9D,CAAC;IAED,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxC,IAAI,QAAQ,EAAE,CAAC;QACd,OAAO,MAAM,QAAQ,CAAC,OAAO,CAAC;IAC/B,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,EAAE,CAAC;IACvB,aAAa,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,GAAG,oBAAoB,EAAE,CAAC,CAAC;IAE3E,OAA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nB,GAAG,CAAC,MAAA,cAAc,CAAC,EAAE,mCAAI,EAAE,CAAC;gBAC5B,eAAe,EAAE,cAAc,CAAC,KAAK,EAAE,WAAW,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;aAC1E,CAAC;YACF,OAAO,cAAc,CAAC;QACvB,CAAC,CAAC;IAKH,CAAC;IA7CA,KAAK,CAAC,iBAAiB,CAEtB,WAA2C;QAE3C,MAAM,GAAG,GAAG,YAAY,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,oBAAoB,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;QACtD,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,OAAO,EAAE,CAAC;QACX,CAAC;QAED,MAAM,MAAM,GAAgB,EAAE,CAAC;QAC/B,IAAI,OAAO,GAAG,WAAW,CAAC;QAE1B,IAAI,MAAM,KAAK,YAAY,EAAE,CAAC;YAC7B,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,oBAAoB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;YACrE,OAAO,GAAG,EAAE,GAAG,WAAW,EAAE,GAAG,MAAM,EAAoC,CAAC;QAC3E,CAAC;QAED,IAAI,YAAY,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC;YAChC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;QAC7D,CAAC;QAED,OAAO,MAAM,CAAC;IACf,CAAC;CAsBD;AA1OD,4DA0OC"}
@@ -1,17 +0,0 @@
1
- import type { IHookFunctions, INodeType, INodeTypeDescription, IWebhookFunctions, IWebhookResponseData } from 'n8n-workflow';
2
- export declare class InstagramTrigger 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
- setup: {
11
- checkExists(this: IHookFunctions): Promise<boolean>;
12
- create(this: IHookFunctions): Promise<boolean>;
13
- delete(this: IHookFunctions): Promise<boolean>;
14
- };
15
- };
16
- webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
17
- }