@xnkee/n8n-nodes-instagram 0.0.0-stage → 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 (120) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +178 -2
  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 +10 -0
  7. package/dist/credentials/InstagramOAuth2Api.credentials.js +93 -0
  8. package/dist/credentials/InstagramOAuth2Api.credentials.js.map +1 -0
  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 +28 -0
  17. package/dist/nodes/Instagram/GenericFunctions.js +231 -0
  18. package/dist/nodes/Instagram/GenericFunctions.js.map +1 -0
  19. package/dist/nodes/Instagram/Instagram.node.d.ts +5 -0
  20. package/dist/nodes/Instagram/Instagram.node.js +187 -0
  21. package/dist/nodes/Instagram/Instagram.node.js.map +1 -0
  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 +61 -4
@@ -0,0 +1,231 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UNIFIED_LOGIN_CREDENTIAL = void 0;
4
+ exports.getCredentialType = getCredentialType;
5
+ exports.isUnifiedLogin = isUnifiedLogin;
6
+ exports.getUnifiedLoginAccountId = getUnifiedLoginAccountId;
7
+ exports.instagramApiRequest = instagramApiRequest;
8
+ exports.instagramApiRequestAllItems = instagramApiRequestAllItems;
9
+ exports.pollMediaContainerStatus = pollMediaContainerStatus;
10
+ exports.getResolvedUserId = getResolvedUserId;
11
+ exports.resolveParameterList = resolveParameterList;
12
+ const n8n_workflow_1 = require("n8n-workflow");
13
+ exports.UNIFIED_LOGIN_CREDENTIAL = 'instagramUnifiedLoginOAuth2Api';
14
+ // Maps the node's "Authentication" parameter value to its credential type name
15
+ const CREDENTIAL_BY_AUTHENTICATION = new Map([
16
+ ['oAuth2', 'instagramOAuth2Api'],
17
+ ['accessToken', 'instagramApi'],
18
+ ['unifiedLogin', exports.UNIFIED_LOGIN_CREDENTIAL],
19
+ ]);
20
+ const DEFAULT_BASE_URL = {
21
+ instagramOAuth2Api: 'https://graph.instagram.com',
22
+ instagramApi: 'https://graph.instagram.com',
23
+ [exports.UNIFIED_LOGIN_CREDENTIAL]: 'https://graph.facebook.com',
24
+ };
25
+ const DEFAULT_API_VERSION = {
26
+ instagramOAuth2Api: 'v26.0',
27
+ instagramApi: 'v26.0',
28
+ [exports.UNIFIED_LOGIN_CREDENTIAL]: 'v27.0',
29
+ };
30
+ // Matches "/me" as a whole path segment: "/me", "/me/media", "/me?fields=id"
31
+ const ME_SEGMENT = /^\/me(?=$|[/?])/;
32
+ const unifiedAccountIdCache = new WeakMap();
33
+ /**
34
+ * Resolves which credential type the node is configured to use, based on the
35
+ * "Authentication" parameter. Falls back to probing when the parameter is unavailable.
36
+ */
37
+ async function getCredentialType() {
38
+ let authentication;
39
+ try {
40
+ authentication = this.getNodeParameter('authentication', 0);
41
+ }
42
+ catch {
43
+ authentication = undefined;
44
+ }
45
+ const mappedCredentialType = authentication
46
+ ? CREDENTIAL_BY_AUTHENTICATION.get(authentication)
47
+ : undefined;
48
+ if (mappedCredentialType) {
49
+ return mappedCredentialType;
50
+ }
51
+ try {
52
+ await this.getCredentials('instagramOAuth2Api');
53
+ return 'instagramOAuth2Api';
54
+ }
55
+ catch {
56
+ return 'instagramApi';
57
+ }
58
+ }
59
+ async function isUnifiedLogin() {
60
+ return (await getCredentialType.call(this)) === exports.UNIFIED_LOGIN_CREDENTIAL;
61
+ }
62
+ function buildUrl(credentialType, credentials, endpoint) {
63
+ if (endpoint.startsWith('http://') || endpoint.startsWith('https://')) {
64
+ return endpoint;
65
+ }
66
+ const baseUrl = credentials?.baseUrl || DEFAULT_BASE_URL[credentialType];
67
+ const apiVersion = credentials?.apiVersion || DEFAULT_API_VERSION[credentialType];
68
+ const cleanEndpoint = endpoint.startsWith('/') ? endpoint : `/${endpoint}`;
69
+ return `${baseUrl.replace(/\/$/, '')}/${apiVersion.replace(/^\/|\/$/g, '')}${cleanEndpoint}`;
70
+ }
71
+ function toNodeApiError(context, error) {
72
+ if (error.response?.body?.error) {
73
+ const metaError = error.response.body.error;
74
+ const message = metaError.message || error.message;
75
+ const errorSubcode = metaError.error_subcode ? ` (Subcode: ${metaError.error_subcode})` : '';
76
+ const errorUserMsg = metaError.error_user_msg ? ` Details: ${metaError.error_user_msg}` : '';
77
+ const formattedMessage = `[Meta Instagram API] ${message}${errorSubcode}${errorUserMsg}`;
78
+ return new n8n_workflow_1.NodeApiError(context.getNode(), error, {
79
+ message: formattedMessage,
80
+ description: `Code: ${metaError.code || metaError.type || 'Unknown'}, fbtrace_id: ${metaError.fbtrace_id || 'N/A'}`,
81
+ });
82
+ }
83
+ return new n8n_workflow_1.NodeApiError(context.getNode(), error);
84
+ }
85
+ /**
86
+ * Unified Login only: returns the Instagram professional account ID to use in request paths.
87
+ * Uses the ID set on the credential, otherwise auto-detects it when exactly one account
88
+ * was shared with the app.
89
+ */
90
+ async function getUnifiedLoginAccountId() {
91
+ const cached = unifiedAccountIdCache.get(this);
92
+ if (cached) {
93
+ return await cached;
94
+ }
95
+ const lookup = (async () => {
96
+ const credentials = await this.getCredentials(exports.UNIFIED_LOGIN_CREDENTIAL);
97
+ const configuredId = (credentials.instagramAccountId || '').trim();
98
+ if (configuredId) {
99
+ return configuredId;
100
+ }
101
+ let response;
102
+ try {
103
+ response = await this.helpers.httpRequestWithAuthentication.call(this, exports.UNIFIED_LOGIN_CREDENTIAL, {
104
+ method: 'GET',
105
+ url: buildUrl(exports.UNIFIED_LOGIN_CREDENTIAL, credentials, '/me/assigned_instagram_accounts'),
106
+ qs: { fields: 'id,username' },
107
+ json: true,
108
+ });
109
+ }
110
+ catch (error) {
111
+ throw toNodeApiError(this, error);
112
+ }
113
+ const accounts = response?.data || [];
114
+ if (accounts.length === 0) {
115
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No Instagram account is shared with this app. Reconnect the credential and select an Instagram account during login (the instagram_basic permission is required).');
116
+ }
117
+ if (accounts.length > 1) {
118
+ const list = accounts
119
+ .map((account) => `${account.username || 'unknown'} (${account.id})`)
120
+ .join(', ');
121
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Several Instagram accounts are shared with this app: ${list}. Set "Instagram Account ID" on the credential to choose one.`);
122
+ }
123
+ return accounts[0].id;
124
+ })();
125
+ unifiedAccountIdCache.set(this, lookup);
126
+ // Do not keep a failed lookup cached, so the next call can retry
127
+ lookup.catch(() => unifiedAccountIdCache.delete(this));
128
+ return await lookup;
129
+ }
130
+ /**
131
+ * Performs an authenticated Graph API request.
132
+ *
133
+ * With Unified Login, "/me" refers to the business integration system user rather than
134
+ * the Instagram account, so a leading "/me" segment is replaced with the Instagram
135
+ * account ID. Pass `rawEndpoint: true` in `options` to send the endpoint untouched.
136
+ */
137
+ async function instagramApiRequest(method, endpoint, body = {}, qs = {}, options = {}) {
138
+ const { rawEndpoint, ...requestOverrides } = options;
139
+ const credentialType = await getCredentialType.call(this);
140
+ const credentials = await this.getCredentials(credentialType);
141
+ let resolvedEndpoint = endpoint;
142
+ if (credentialType === exports.UNIFIED_LOGIN_CREDENTIAL && !rawEndpoint) {
143
+ const normalized = endpoint.startsWith('/') ? endpoint : `/${endpoint}`;
144
+ if (ME_SEGMENT.test(normalized)) {
145
+ const accountId = await getUnifiedLoginAccountId.call(this);
146
+ resolvedEndpoint = normalized.replace(ME_SEGMENT, `/${accountId}`);
147
+ }
148
+ }
149
+ const requestOptions = {
150
+ method,
151
+ url: buildUrl(credentialType, credentials, resolvedEndpoint),
152
+ qs,
153
+ body,
154
+ json: true,
155
+ ...requestOverrides,
156
+ };
157
+ // If body is empty for GET or DELETE, remove it to avoid unexpected payloads
158
+ if (['GET', 'HEAD', 'DELETE'].includes(method) && Object.keys(body).length === 0) {
159
+ delete requestOptions.body;
160
+ }
161
+ try {
162
+ return await this.helpers.httpRequestWithAuthentication.call(this, credentialType, requestOptions);
163
+ }
164
+ catch (error) {
165
+ throw toNodeApiError(this, error);
166
+ }
167
+ }
168
+ async function instagramApiRequestAllItems(propertyName, method, endpoint, body = {}, qs = {}, limit) {
169
+ const returnData = [];
170
+ let responseData;
171
+ const query = { ...qs };
172
+ let nextUrl = undefined;
173
+ do {
174
+ if (nextUrl) {
175
+ responseData = await instagramApiRequest.call(this, 'GET', nextUrl, {}, {});
176
+ }
177
+ else {
178
+ responseData = await instagramApiRequest.call(this, method, endpoint, body, query);
179
+ }
180
+ const items = propertyName ? responseData[propertyName] : responseData.data;
181
+ if (Array.isArray(items)) {
182
+ returnData.push(...items);
183
+ }
184
+ else if (items) {
185
+ returnData.push(items);
186
+ }
187
+ if (limit && returnData.length >= limit) {
188
+ return returnData.slice(0, limit);
189
+ }
190
+ nextUrl = responseData.paging?.next;
191
+ } while (nextUrl);
192
+ return returnData;
193
+ }
194
+ async function pollMediaContainerStatus(containerId, maxAttempts = 30, delayMs = 4000) {
195
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
196
+ const statusResponse = await instagramApiRequest.call(this, 'GET', `/${containerId}`, {}, { fields: 'id,status_code,status' });
197
+ const statusCode = statusResponse.status_code;
198
+ if (statusCode === 'FINISHED') {
199
+ return;
200
+ }
201
+ if (statusCode === 'ERROR' || statusCode === 'EXPIRED') {
202
+ const errorMessage = statusResponse.status || `Container upload failed with status ${statusCode}`;
203
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Instagram Media Container Processing Error: ${errorMessage}`);
204
+ }
205
+ // Still IN_PROGRESS or PUBLISHED
206
+ if (attempt < maxAttempts) {
207
+ await (0, n8n_workflow_1.sleep)(delayMs);
208
+ }
209
+ }
210
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Instagram media container ${containerId} did not finish processing within ${(maxAttempts * delayMs) / 1000} seconds. Try publishing again or check media URL.`);
211
+ }
212
+ async function getResolvedUserId(specifiedUserId) {
213
+ if (specifiedUserId && specifiedUserId.trim() !== '' && specifiedUserId.trim().toLowerCase() !== 'me') {
214
+ return specifiedUserId.trim();
215
+ }
216
+ if (await isUnifiedLogin.call(this)) {
217
+ return await getUnifiedLoginAccountId.call(this);
218
+ }
219
+ // Fetch current user id via /me
220
+ const meResponse = await instagramApiRequest.call(this, 'GET', '/me', {}, { fields: 'id,user_id,username' });
221
+ return meResponse.id || meResponse.user_id || 'me';
222
+ }
223
+ function resolveParameterList(itemIndex, allDefaultValue, paramName = 'fields', modeParamName = 'fieldsMode') {
224
+ const mode = this.getNodeParameter(modeParamName, itemIndex, 'all');
225
+ if (mode === 'all') {
226
+ return allDefaultValue;
227
+ }
228
+ const selected = this.getNodeParameter(paramName, itemIndex, []).join(',');
229
+ return selected || allDefaultValue;
230
+ }
231
+ //# sourceMappingURL=GenericFunctions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/Instagram/GenericFunctions.ts"],"names":[],"mappings":";;;AA4CA,8CAqBC;AAED,wCAEC;AAkCD,4DAuDC;AASD,kDA4CC;AAED,kEAsCC;AAED,4DAuCC;AAED,8CAeC;AAED,oDAaC;AApUD,+CAUsB;AAIT,QAAA,wBAAwB,GAAG,gCAAgC,CAAC;AAEzE,+EAA+E;AAC/E,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAiB;IAC3D,CAAC,QAAQ,EAAE,oBAAoB,CAAC;IAChC,CAAC,aAAa,EAAE,cAAc,CAAC;IAC/B,CAAC,cAAc,EAAE,gCAAwB,CAAC;CAC3C,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAA2B;IAC/C,kBAAkB,EAAE,6BAA6B;IACjD,YAAY,EAAE,6BAA6B;IAC3C,CAAC,gCAAwB,CAAC,EAAE,4BAA4B;CACzD,CAAC;AAEF,MAAM,mBAAmB,GAA2B;IAClD,kBAAkB,EAAE,OAAO;IAC3B,YAAY,EAAE,OAAO;IACrB,CAAC,gCAAwB,CAAC,EAAE,OAAO;CACpC,CAAC;AAEF,6EAA6E;AAC7E,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAErC,MAAM,qBAAqB,GAAG,IAAI,OAAO,EAA2B,CAAC;AAErE;;;GAGG;AACI,KA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AC,SAAS,EAAE,SAAS,EAAE,EAAE,CAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzF,OAAO,QAAQ,IAAI,eAAe,CAAC;AACrC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class Instagram implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
@@ -0,0 +1,187 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Instagram = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const descriptions_1 = require("./descriptions");
6
+ const UserHandler_1 = require("./handlers/UserHandler");
7
+ const MediaHandler_1 = require("./handlers/MediaHandler");
8
+ const CommentHandler_1 = require("./handlers/CommentHandler");
9
+ const MessageHandler_1 = require("./handlers/MessageHandler");
10
+ const InsightHandler_1 = require("./handlers/InsightHandler");
11
+ const MentionHandler_1 = require("./handlers/MentionHandler");
12
+ const CustomHandler_1 = require("./handlers/CustomHandler");
13
+ const resourceHandlers = {
14
+ user: UserHandler_1.handleUser,
15
+ media: MediaHandler_1.handleMedia,
16
+ comment: CommentHandler_1.handleComment,
17
+ message: MessageHandler_1.handleMessage,
18
+ insight: InsightHandler_1.handleInsight,
19
+ mention: MentionHandler_1.handleMention,
20
+ custom: CustomHandler_1.handleCustom,
21
+ };
22
+ class Instagram {
23
+ constructor() {
24
+ this.description = {
25
+ displayName: 'Instagram (Business Login)',
26
+ name: 'instagram',
27
+ icon: 'file:instagram.svg',
28
+ group: ['transform'],
29
+ version: 1,
30
+ subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
31
+ description: 'Interact with Instagram Graph API using Instagram Login (Publish Posts/Reels/Stories/Carousels, Manage Comments, Send DMs, Read Insights, and Mentions)',
32
+ defaults: {
33
+ name: 'Instagram (Business Login)',
34
+ },
35
+ usableAsTool: true,
36
+ inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
37
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
38
+ credentials: [
39
+ {
40
+ name: 'instagramOAuth2Api',
41
+ required: true,
42
+ displayOptions: {
43
+ show: {
44
+ authentication: ['oAuth2'],
45
+ },
46
+ },
47
+ },
48
+ {
49
+ name: 'instagramApi',
50
+ required: true,
51
+ displayOptions: {
52
+ show: {
53
+ authentication: ['accessToken'],
54
+ },
55
+ },
56
+ },
57
+ {
58
+ name: 'instagramUnifiedLoginOAuth2Api',
59
+ required: true,
60
+ displayOptions: {
61
+ show: {
62
+ authentication: ['unifiedLogin'],
63
+ },
64
+ },
65
+ },
66
+ ],
67
+ properties: [
68
+ {
69
+ displayName: 'Authentication',
70
+ name: 'authentication',
71
+ type: 'options',
72
+ options: [
73
+ {
74
+ name: 'OAuth2 (Business Login - Recommended)',
75
+ value: 'oAuth2',
76
+ },
77
+ {
78
+ name: 'Access Token (Long-Lived User Token)',
79
+ value: 'accessToken',
80
+ },
81
+ {
82
+ name: 'Unified Login (Instagram or Facebook Login)',
83
+ value: 'unifiedLogin',
84
+ },
85
+ ],
86
+ default: 'oAuth2',
87
+ },
88
+ {
89
+ displayName: 'Resource',
90
+ name: 'resource',
91
+ type: 'options',
92
+ noDataExpression: true,
93
+ options: [
94
+ {
95
+ name: 'Comment',
96
+ value: 'comment',
97
+ description: 'Manage comments, replies, hide/unhide, and delete comments on media posts',
98
+ },
99
+ {
100
+ name: 'Custom API Request',
101
+ value: 'custom',
102
+ description: 'Execute arbitrary Graph API HTTP requests',
103
+ },
104
+ {
105
+ name: 'Direct Message',
106
+ value: 'message',
107
+ description: 'Send text & media direct messages, read conversations and chat history',
108
+ },
109
+ {
110
+ name: 'Insight',
111
+ value: 'insight',
112
+ description: 'Retrieve detailed metrics and statistics for accounts and media items',
113
+ },
114
+ {
115
+ name: 'Media / Post',
116
+ value: 'media',
117
+ description: 'Publish photos, videos, reels, stories, carousels, and manage posts',
118
+ },
119
+ {
120
+ name: 'Mention',
121
+ value: 'mention',
122
+ description: 'Handle mentions in captions/comments and reply to tagged media',
123
+ },
124
+ {
125
+ name: 'User / Profile',
126
+ value: 'user',
127
+ description: 'Get authenticated user or target user profile details and insights',
128
+ },
129
+ ],
130
+ default: 'user',
131
+ },
132
+ // Operations & Fields definitions
133
+ ...descriptions_1.userOperations,
134
+ ...descriptions_1.userFields,
135
+ ...descriptions_1.mediaOperations,
136
+ ...descriptions_1.mediaFields,
137
+ ...descriptions_1.commentOperations,
138
+ ...descriptions_1.commentFields,
139
+ ...descriptions_1.messageOperations,
140
+ ...descriptions_1.messageFields,
141
+ ...descriptions_1.insightOperations,
142
+ ...descriptions_1.insightFields,
143
+ ...descriptions_1.mentionOperations,
144
+ ...descriptions_1.mentionFields,
145
+ ...descriptions_1.customOperations,
146
+ ...descriptions_1.customFields,
147
+ ],
148
+ };
149
+ }
150
+ async execute() {
151
+ const items = this.getInputData();
152
+ const returnData = [];
153
+ const resource = this.getNodeParameter('resource', 0);
154
+ const operation = this.getNodeParameter('operation', 0, '');
155
+ const handler = resourceHandlers[resource];
156
+ if (!handler) {
157
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported resource: ${resource}`);
158
+ }
159
+ for (let i = 0; i < items.length; i++) {
160
+ try {
161
+ const responseData = await handler.call(this, operation, i);
162
+ const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
163
+ returnData.push(...executionData);
164
+ }
165
+ catch (error) {
166
+ if (this.continueOnFail()) {
167
+ returnData.push({
168
+ json: {
169
+ error: error.message,
170
+ details: error.description || error.context || undefined,
171
+ },
172
+ pairedItem: {
173
+ item: i,
174
+ },
175
+ });
176
+ continue;
177
+ }
178
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, {
179
+ itemIndex: i,
180
+ });
181
+ }
182
+ }
183
+ return [returnData];
184
+ }
185
+ }
186
+ exports.Instagram = Instagram;
187
+ //# sourceMappingURL=Instagram.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Instagram.node.js","sourceRoot":"","sources":["../../../nodes/Instagram/Instagram.node.ts"],"names":[],"mappings":";;;AAAA,+CAOsB;AAEtB,iDAewB;AAExB,wDAAoD;AACpD,0DAAsD;AACtD,8DAA0D;AAC1D,8DAA0D;AAC1D,8DAA0D;AAC1D,8DAA0D;AAC1D,4DAAwD;AAExD,MAAM,gBAAgB,GAGlB;IACF,IAAI,EAAE,wBAAU;IAChB,KAAK,EAAE,0BAAW;IAClB,OAAO,EAAE,8BAAa;IACtB,OAAO,EAAE,8BAAa;IACtB,OAAO,EAAE,8BAAa;IACtB,OAAO,EAAE,8BAAa;IACtB,MAAM,EAAE,4BAAY;CACrB,CAAC;AAEF,MAAa,SAAS;IAAtB;QACE,gBAAW,GAAyB;YAClC,WAAW,EAAE,4BAA4B;YACzC,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EACT,yJAAyJ;YAC3J,QAAQ,EAAE;gBACR,IAAI,EAAE,4BAA4B;aACnC;YACD,YAAY,EAAE,IAAI;YAClB,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,WAAW,EAAE;gBACX;oBACE,IAAI,EAAE,oBAAoB;oBAC1B,QAAQ,EAAE,IAAI;oBACd,cAAc,EAAE;wBACd,IAAI,EAAE;4BACJ,cAAc,EAAE,CAAC,QAAQ,CAAC;yBAC3B;qBACF;iBACF;gBACD;oBACE,IAAI,EAAE,cAAc;oBACpB,QAAQ,EAAE,IAAI;oBACd,cAAc,EAAE;wBACd,IAAI,EAAE;4BACJ,cAAc,EAAE,CAAC,aAAa,CAAC;yBAChC;qBACF;iBACF;gBACD;oBACE,IAAI,E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E,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,CAC1B,CAAC;gBAEF,UAAU,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC;YACpC,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC1B,UAAU,CAAC,IAAI,CAAC;wBACd,IAAI,EAAE;4BACJ,KAAK,EAAE,KAAK,CAAC,OAAO;4BACpB,OAAO,EAAE,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,OAAO,IAAI,SAAS;yBACzD;wBACD,UAAU,EAAE;4BACV,IAAI,EAAE,CAAC;yBACR;qBACF,CAAC,CAAC;oBACH,SAAS;gBACX,CAAC;gBAED,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAc,EAAE;oBAC3D,SAAS,EAAE,CAAC;iBACb,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACtB,CAAC;CACF;AA7KD,8BA6KC"}
@@ -0,0 +1,17 @@
1
+ {
2
+ "node": "@xnkee/n8n-nodes-instagram.instagram",
3
+ "nodeVersion": "1.0",
4
+ "codexVersion": "1.0",
5
+ "categories": [
6
+ "Social Media",
7
+ "Marketing",
8
+ "Communication"
9
+ ],
10
+ "resources": {
11
+ "primaryDocumentation": [
12
+ {
13
+ "url": "https://developers.facebook.com/documentation/instagram-platform/instagram-api-with-instagram-login"
14
+ }
15
+ ]
16
+ }
17
+ }
@@ -0,0 +1,2 @@
1
+ import { INodeProperties } from 'n8n-workflow';
2
+ export declare const commentFields: INodeProperties[];
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.commentFields = void 0;
4
+ exports.commentFields = [
5
+ // ----------------------------------
6
+ // comment: get / delete / hide / reply / getReplies
7
+ // ----------------------------------
8
+ {
9
+ displayName: 'Comment ID',
10
+ name: 'commentId',
11
+ type: 'string',
12
+ required: true,
13
+ default: '',
14
+ displayOptions: {
15
+ show: {
16
+ resource: ['comment'],
17
+ operation: ['get', 'delete', 'hide', 'reply', 'getReplies'],
18
+ },
19
+ },
20
+ description: 'The ID of the Instagram comment',
21
+ },
22
+ // ----------------------------------
23
+ // comment: getAll / create
24
+ // ----------------------------------
25
+ {
26
+ displayName: 'Media ID',
27
+ name: 'mediaId',
28
+ type: 'string',
29
+ required: true,
30
+ default: '',
31
+ displayOptions: {
32
+ show: {
33
+ resource: ['comment'],
34
+ operation: ['getAll', 'create'],
35
+ },
36
+ },
37
+ description: 'The ID of the media post',
38
+ },
39
+ // ----------------------------------
40
+ // comment: create / reply message
41
+ // ----------------------------------
42
+ {
43
+ displayName: 'Message',
44
+ name: 'message',
45
+ type: 'string',
46
+ typeOptions: {
47
+ rows: 3,
48
+ },
49
+ required: true,
50
+ default: '',
51
+ displayOptions: {
52
+ show: {
53
+ resource: ['comment'],
54
+ operation: ['create', 'reply'],
55
+ },
56
+ },
57
+ description: 'The text of the comment or reply',
58
+ },
59
+ // ----------------------------------
60
+ // comment: hide boolean
61
+ // ----------------------------------
62
+ {
63
+ displayName: 'Hide Comment',
64
+ name: 'hide',
65
+ type: 'boolean',
66
+ default: true,
67
+ displayOptions: {
68
+ show: {
69
+ resource: ['comment'],
70
+ operation: ['hide'],
71
+ },
72
+ },
73
+ description: 'Whether to hide the comment (true) or unhide it (false)',
74
+ },
75
+ // ----------------------------------
76
+ // comment: getAll pagination
77
+ // ----------------------------------
78
+ {
79
+ displayName: 'Return All',
80
+ name: 'returnAll',
81
+ type: 'boolean',
82
+ default: false,
83
+ displayOptions: {
84
+ show: {
85
+ resource: ['comment'],
86
+ operation: ['getAll', 'getReplies'],
87
+ },
88
+ },
89
+ description: 'Whether to return all results or only up to a given limit',
90
+ },
91
+ {
92
+ displayName: 'Limit',
93
+ name: 'limit',
94
+ type: 'number',
95
+ typeOptions: {
96
+ minValue: 1,
97
+ },
98
+ default: 50,
99
+ displayOptions: {
100
+ show: {
101
+ resource: ['comment'],
102
+ operation: ['getAll', 'getReplies'],
103
+ returnAll: [false],
104
+ },
105
+ },
106
+ description: 'Max number of results to return',
107
+ },
108
+ // ----------------------------------
109
+ // comment: fields selection
110
+ // ----------------------------------
111
+ {
112
+ displayName: 'Fields to Retrieve',
113
+ name: 'fieldsMode',
114
+ type: 'options',
115
+ options: [
116
+ {
117
+ name: 'All Fields (Recommended)',
118
+ value: 'all',
119
+ description: 'Retrieve all available comment fields',
120
+ },
121
+ {
122
+ name: 'Selected Fields',
123
+ value: 'selected',
124
+ description: 'Choose specific fields to retrieve',
125
+ },
126
+ ],
127
+ default: 'all',
128
+ displayOptions: {
129
+ show: {
130
+ resource: ['comment'],
131
+ operation: ['get', 'getAll', 'getReplies'],
132
+ },
133
+ },
134
+ description: 'Whether to retrieve all available fields or pick specific fields',
135
+ },
136
+ {
137
+ displayName: 'Fields',
138
+ name: 'fields',
139
+ type: 'multiOptions',
140
+ options: [
141
+ { name: 'From / User', value: 'from{id,username}' },
142
+ { name: 'Hidden', value: 'hidden' },
143
+ { name: 'ID', value: 'id' },
144
+ { name: 'Like Count', value: 'like_count' },
145
+ { name: 'Replies Count', value: 'replies_count' },
146
+ { name: 'Text', value: 'text' },
147
+ { name: 'Timestamp', value: 'timestamp' },
148
+ { name: 'Username', value: 'username' },
149
+ ],
150
+ default: ['id', 'text', 'timestamp', 'like_count', 'hidden', 'from{id,username}'],
151
+ displayOptions: {
152
+ show: {
153
+ resource: ['comment'],
154
+ operation: ['get', 'getAll', 'getReplies'],
155
+ fieldsMode: ['selected'],
156
+ },
157
+ },
158
+ description: 'Specific fields to return for each comment',
159
+ },
160
+ ];
161
+ //# sourceMappingURL=Comment.fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Comment.fields.js","sourceRoot":"","sources":["../../../../../nodes/Instagram/descriptions/comment/Comment.fields.ts"],"names":[],"mappings":";;;AAEa,QAAA,aAAa,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