@xnkee/n8n-nodes-instagram 1.7.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{LICENSE.md → LICENSE} +21 -21
- package/README.md +132 -437
- package/dist/credentials/InstagramApi.credentials.d.ts +10 -0
- package/dist/credentials/InstagramApi.credentials.js +55 -0
- package/dist/credentials/InstagramApi.credentials.js.map +1 -0
- package/dist/credentials/InstagramOAuth2Api.credentials.d.ts +2 -2
- package/dist/credentials/InstagramOAuth2Api.credentials.js +33 -113
- package/dist/credentials/InstagramOAuth2Api.credentials.js.map +1 -1
- package/dist/credentials/InstagramUnifiedLoginOAuth2Api.credentials.d.ts +17 -0
- package/dist/credentials/InstagramUnifiedLoginOAuth2Api.credentials.js +116 -0
- package/dist/credentials/InstagramUnifiedLoginOAuth2Api.credentials.js.map +1 -0
- package/dist/credentials/instagram.svg +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes/Instagram/GenericFunctions.d.ts +27 -23
- package/dist/nodes/Instagram/GenericFunctions.js +182 -223
- package/dist/nodes/Instagram/GenericFunctions.js.map +1 -1
- package/dist/nodes/Instagram/Instagram.node.d.ts +1 -1
- package/dist/nodes/Instagram/Instagram.node.js +109 -2353
- package/dist/nodes/Instagram/Instagram.node.js.map +1 -1
- package/dist/nodes/Instagram/Instagram.node.json +17 -0
- package/dist/nodes/Instagram/InstagramChatTrigger.node.d.ts +17 -0
- package/dist/nodes/Instagram/InstagramChatTrigger.node.js +415 -0
- package/dist/nodes/Instagram/InstagramChatTrigger.node.js.map +1 -0
- package/dist/nodes/Instagram/InstagramChatTrigger.node.json +16 -0
- package/dist/nodes/Instagram/descriptions/comment/Comment.fields.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/comment/Comment.fields.js +161 -0
- package/dist/nodes/Instagram/descriptions/comment/Comment.fields.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/comment/Comment.operations.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/comment/Comment.operations.js +62 -0
- package/dist/nodes/Instagram/descriptions/comment/Comment.operations.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/comment/index.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/comment/index.js +8 -0
- package/dist/nodes/Instagram/descriptions/comment/index.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/custom/Custom.fields.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/custom/Custom.fields.js +65 -0
- package/dist/nodes/Instagram/descriptions/custom/Custom.fields.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/custom/Custom.operations.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/custom/Custom.operations.js +26 -0
- package/dist/nodes/Instagram/descriptions/custom/Custom.operations.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/custom/index.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/custom/index.js +8 -0
- package/dist/nodes/Instagram/descriptions/custom/index.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/index.d.ts +7 -0
- package/dist/nodes/Instagram/descriptions/index.js +24 -0
- package/dist/nodes/Instagram/descriptions/index.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/insight/AccountInsight.fields.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/insight/AccountInsight.fields.js +164 -0
- package/dist/nodes/Instagram/descriptions/insight/AccountInsight.fields.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/insight/Insight.operations.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/insight/Insight.operations.js +32 -0
- package/dist/nodes/Instagram/descriptions/insight/Insight.operations.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/insight/MediaInsight.fields.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/insight/MediaInsight.fields.js +87 -0
- package/dist/nodes/Instagram/descriptions/insight/MediaInsight.fields.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/insight/index.d.ts +4 -0
- package/dist/nodes/Instagram/descriptions/insight/index.js +12 -0
- package/dist/nodes/Instagram/descriptions/insight/index.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/media/Media.operations.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/media/Media.operations.js +62 -0
- package/dist/nodes/Instagram/descriptions/media/Media.operations.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/media/MediaGet.fields.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/media/MediaGet.fields.js +163 -0
- package/dist/nodes/Instagram/descriptions/media/MediaGet.fields.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/media/MediaPublish.fields.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/media/MediaPublish.fields.js +285 -0
- package/dist/nodes/Instagram/descriptions/media/MediaPublish.fields.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/media/index.d.ts +4 -0
- package/dist/nodes/Instagram/descriptions/media/index.js +12 -0
- package/dist/nodes/Instagram/descriptions/media/index.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/mention/Mention.fields.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/mention/Mention.fields.js +122 -0
- package/dist/nodes/Instagram/descriptions/mention/Mention.fields.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/mention/Mention.operations.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/mention/Mention.operations.js +38 -0
- package/dist/nodes/Instagram/descriptions/mention/Mention.operations.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/mention/index.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/mention/index.js +8 -0
- package/dist/nodes/Instagram/descriptions/mention/index.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/message/Message.fields.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/message/Message.fields.js +123 -0
- package/dist/nodes/Instagram/descriptions/message/Message.fields.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/message/Message.operations.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/message/Message.operations.js +44 -0
- package/dist/nodes/Instagram/descriptions/message/Message.operations.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/message/index.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/message/index.js +8 -0
- package/dist/nodes/Instagram/descriptions/message/index.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/user/User.operations.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/user/User.operations.js +38 -0
- package/dist/nodes/Instagram/descriptions/user/User.operations.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/user/UserInsights.fields.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/user/UserInsights.fields.js +164 -0
- package/dist/nodes/Instagram/descriptions/user/UserInsights.fields.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/user/UserProfile.fields.d.ts +2 -0
- package/dist/nodes/Instagram/descriptions/user/UserProfile.fields.js +83 -0
- package/dist/nodes/Instagram/descriptions/user/UserProfile.fields.js.map +1 -0
- package/dist/nodes/Instagram/descriptions/user/index.d.ts +4 -0
- package/dist/nodes/Instagram/descriptions/user/index.js +12 -0
- package/dist/nodes/Instagram/descriptions/user/index.js.map +1 -0
- package/dist/nodes/Instagram/handlers/CommentHandler.d.ts +2 -0
- package/dist/nodes/Instagram/handlers/CommentHandler.js +63 -0
- package/dist/nodes/Instagram/handlers/CommentHandler.js.map +1 -0
- package/dist/nodes/Instagram/handlers/CustomHandler.d.ts +2 -0
- package/dist/nodes/Instagram/handlers/CustomHandler.js +28 -0
- package/dist/nodes/Instagram/handlers/CustomHandler.js.map +1 -0
- package/dist/nodes/Instagram/handlers/InsightHandler.d.ts +2 -0
- package/dist/nodes/Instagram/handlers/InsightHandler.js +42 -0
- package/dist/nodes/Instagram/handlers/InsightHandler.js.map +1 -0
- package/dist/nodes/Instagram/handlers/MediaHandler.d.ts +2 -0
- package/dist/nodes/Instagram/handlers/MediaHandler.js +172 -0
- package/dist/nodes/Instagram/handlers/MediaHandler.js.map +1 -0
- package/dist/nodes/Instagram/handlers/MentionHandler.d.ts +2 -0
- package/dist/nodes/Instagram/handlers/MentionHandler.js +48 -0
- package/dist/nodes/Instagram/handlers/MentionHandler.js.map +1 -0
- package/dist/nodes/Instagram/handlers/MessageHandler.d.ts +2 -0
- package/dist/nodes/Instagram/handlers/MessageHandler.js +57 -0
- package/dist/nodes/Instagram/handlers/MessageHandler.js.map +1 -0
- package/dist/nodes/Instagram/handlers/UserHandler.d.ts +2 -0
- package/dist/nodes/Instagram/handlers/UserHandler.js +48 -0
- package/dist/nodes/Instagram/handlers/UserHandler.js.map +1 -0
- package/dist/nodes/Instagram/instagram.svg +1 -0
- package/package.json +34 -46
- package/API_REFERENCE.md +0 -907
- package/AUTHENTICATION_GUIDE.md +0 -718
- package/CHANGELOG.md +0 -391
- package/dist/credentials/InstagramUnifiedLoginApi.credentials.d.ts +0 -9
- package/dist/credentials/InstagramUnifiedLoginApi.credentials.js +0 -481
- package/dist/credentials/InstagramUnifiedLoginApi.credentials.js.map +0 -1
- package/dist/nodes/Instagram/InstagramTrigger.node.d.ts +0 -17
- package/dist/nodes/Instagram/InstagramTrigger.node.js +0 -398
- package/dist/nodes/Instagram/InstagramTrigger.node.js.map +0 -1
- package/dist/nodes/Instagram/instagram-large.svg +0 -27
- package/dist/nodes/Instagram/instagram-small.svg +0 -14
- package/dist/nodes/Instagram/types.d.ts +0 -171
- package/dist/nodes/Instagram/types.js +0 -3
- package/dist/nodes/Instagram/types.js.map +0 -1
- package/dist/package.json +0 -76
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/index.js +0 -0
|
@@ -1,272 +1,231 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.
|
|
37
|
-
exports.getAuthenticationMethod = getAuthenticationMethod;
|
|
3
|
+
exports.UNIFIED_LOGIN_CREDENTIAL = void 0;
|
|
38
4
|
exports.getCredentialType = getCredentialType;
|
|
39
|
-
exports.
|
|
40
|
-
exports.
|
|
5
|
+
exports.isUnifiedLogin = isUnifiedLogin;
|
|
6
|
+
exports.getUnifiedLoginAccountId = getUnifiedLoginAccountId;
|
|
41
7
|
exports.instagramApiRequest = instagramApiRequest;
|
|
42
8
|
exports.instagramApiRequestAllItems = instagramApiRequestAllItems;
|
|
43
|
-
exports.
|
|
44
|
-
exports.
|
|
45
|
-
exports.
|
|
46
|
-
exports.getMyProfileEndpoint = getMyProfileEndpoint;
|
|
47
|
-
exports.validateSignature = validateSignature;
|
|
9
|
+
exports.pollMediaContainerStatus = pollMediaContainerStatus;
|
|
10
|
+
exports.getResolvedUserId = getResolvedUserId;
|
|
11
|
+
exports.resolveParameterList = resolveParameterList;
|
|
48
12
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
exports.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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);
|
|
76
41
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if (!accessToken) {
|
|
80
|
-
throw new Error('No access token found. Please reconnect your Instagram account.');
|
|
42
|
+
catch {
|
|
43
|
+
authentication = undefined;
|
|
81
44
|
}
|
|
82
|
-
|
|
83
|
-
|
|
45
|
+
const mappedCredentialType = authentication
|
|
46
|
+
? CREDENTIAL_BY_AUTHENTICATION.get(authentication)
|
|
47
|
+
: undefined;
|
|
48
|
+
if (mappedCredentialType) {
|
|
49
|
+
return mappedCredentialType;
|
|
84
50
|
}
|
|
85
|
-
return accessToken;
|
|
86
|
-
}
|
|
87
|
-
async function getInstagramBusinessAccountId() {
|
|
88
51
|
try {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
method: 'GET',
|
|
92
|
-
url: `${exports.INSTAGRAM_GRAPH_API_URL}/me`,
|
|
93
|
-
qs: {
|
|
94
|
-
access_token: accessToken,
|
|
95
|
-
fields: 'id,name,account_type,media_count,user_id,username',
|
|
96
|
-
},
|
|
97
|
-
json: true,
|
|
98
|
-
};
|
|
99
|
-
const response = await this.helpers.request(options);
|
|
100
|
-
if (response && response.id) {
|
|
101
|
-
return response.id;
|
|
102
|
-
}
|
|
103
|
-
throw new Error('No Instagram Business Account found. Make sure your Facebook Page is connected to an Instagram Business Account.');
|
|
52
|
+
await this.getCredentials('instagramOAuth2Api');
|
|
53
|
+
return 'instagramOAuth2Api';
|
|
104
54
|
}
|
|
105
|
-
catch
|
|
106
|
-
|
|
107
|
-
message: 'Failed to fetch Instagram Business Account ID, Error: ' + error.message,
|
|
108
|
-
});
|
|
55
|
+
catch {
|
|
56
|
+
return 'instagramApi';
|
|
109
57
|
}
|
|
110
58
|
}
|
|
111
|
-
function
|
|
112
|
-
|
|
113
|
-
return undefined;
|
|
114
|
-
}
|
|
115
|
-
const candidate = value;
|
|
116
|
-
const nested = candidate.error;
|
|
117
|
-
if (nested && typeof nested === 'object' && typeof nested.code === 'number') {
|
|
118
|
-
return nested;
|
|
119
|
-
}
|
|
120
|
-
for (const key of ['cause', 'response', 'data', 'error', 'errorResponse', 'context']) {
|
|
121
|
-
const found = findGraphError(candidate[key], depth + 1);
|
|
122
|
-
if (found) {
|
|
123
|
-
return found;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return undefined;
|
|
59
|
+
async function isUnifiedLogin() {
|
|
60
|
+
return (await getCredentialType.call(this)) === exports.UNIFIED_LOGIN_CREDENTIAL;
|
|
127
61
|
}
|
|
128
|
-
function
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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'}`,
|
|
144
81
|
});
|
|
145
82
|
}
|
|
146
|
-
|
|
147
|
-
return error;
|
|
148
|
-
}
|
|
149
|
-
return new n8n_workflow_1.NodeApiError(node, error);
|
|
83
|
+
return new n8n_workflow_1.NodeApiError(context.getNode(), error);
|
|
150
84
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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;
|
|
161
100
|
}
|
|
101
|
+
let response;
|
|
162
102
|
try {
|
|
163
|
-
|
|
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
|
+
});
|
|
164
109
|
}
|
|
165
110
|
catch (error) {
|
|
166
|
-
throw
|
|
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}`);
|
|
167
147
|
}
|
|
168
148
|
}
|
|
169
|
-
const
|
|
170
|
-
const options = {
|
|
149
|
+
const requestOptions = {
|
|
171
150
|
method,
|
|
151
|
+
url: buildUrl(credentialType, credentials, resolvedEndpoint),
|
|
152
|
+
qs,
|
|
172
153
|
body,
|
|
173
|
-
qs: {
|
|
174
|
-
...qs,
|
|
175
|
-
access_token: accessToken,
|
|
176
|
-
},
|
|
177
|
-
url: `${exports.INSTAGRAM_GRAPH_API_URL}${endpoint}`,
|
|
178
154
|
json: true,
|
|
155
|
+
...requestOverrides,
|
|
179
156
|
};
|
|
180
|
-
|
|
181
|
-
|
|
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;
|
|
182
160
|
}
|
|
183
161
|
try {
|
|
184
|
-
return await this.helpers.
|
|
162
|
+
return await this.helpers.httpRequestWithAuthentication.call(this, credentialType, requestOptions);
|
|
185
163
|
}
|
|
186
164
|
catch (error) {
|
|
187
|
-
throw
|
|
165
|
+
throw toNodeApiError(this, error);
|
|
188
166
|
}
|
|
189
167
|
}
|
|
190
|
-
async function instagramApiRequestAllItems(method, endpoint, body = {}, qs = {}) {
|
|
191
|
-
var _a, _b;
|
|
168
|
+
async function instagramApiRequestAllItems(propertyName, method, endpoint, body = {}, qs = {}, limit) {
|
|
192
169
|
const returnData = [];
|
|
193
170
|
let responseData;
|
|
194
|
-
|
|
171
|
+
const query = { ...qs };
|
|
172
|
+
let nextUrl = undefined;
|
|
195
173
|
do {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
returnData.push(...responseData.data);
|
|
199
|
-
}
|
|
200
|
-
if ((_a = responseData.paging) === null || _a === void 0 ? void 0 : _a.next) {
|
|
201
|
-
const url = new URL(responseData.paging.next);
|
|
202
|
-
qs.after = url.searchParams.get('after');
|
|
174
|
+
if (nextUrl) {
|
|
175
|
+
responseData = await instagramApiRequest.call(this, 'GET', nextUrl, {}, {});
|
|
203
176
|
}
|
|
204
177
|
else {
|
|
205
|
-
|
|
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);
|
|
206
186
|
}
|
|
207
|
-
|
|
187
|
+
if (limit && returnData.length >= limit) {
|
|
188
|
+
return returnData.slice(0, limit);
|
|
189
|
+
}
|
|
190
|
+
nextUrl = responseData.paging?.next;
|
|
191
|
+
} while (nextUrl);
|
|
208
192
|
return returnData;
|
|
209
193
|
}
|
|
210
|
-
async function
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}
|
|
226
|
-
const credentials = await this.getCredentials(exports.UNIFIED_LOGIN_CREDENTIAL);
|
|
227
|
-
const configured = String((_a = credentials.instagramAccountId) !== null && _a !== void 0 ? _a : '').trim();
|
|
228
|
-
if (configured) {
|
|
229
|
-
return configured;
|
|
230
|
-
}
|
|
231
|
-
const resolved = String((_b = credentials.resolvedInstagramAccountId) !== null && _b !== void 0 ? _b : '').trim();
|
|
232
|
-
if (resolved) {
|
|
233
|
-
return resolved;
|
|
234
|
-
}
|
|
235
|
-
const accounts = await getAssignedInstagramAccounts.call(this);
|
|
236
|
-
if (accounts.length === 1) {
|
|
237
|
-
return accounts[0].id;
|
|
238
|
-
}
|
|
239
|
-
if (accounts.length === 0) {
|
|
240
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No Instagram account is shared with this Unified Login connection', {
|
|
241
|
-
description: 'Ask the client to connect again and select an Instagram professional account. Personal accounts cannot connect.',
|
|
242
|
-
});
|
|
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
|
+
}
|
|
243
209
|
}
|
|
244
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(),
|
|
245
|
-
description: `Set "Instagram Account ID" in the credential to one of: ${accounts
|
|
246
|
-
.map((account) => (account.username ? `${account.id} (@${account.username})` : account.id))
|
|
247
|
-
.join(', ')}`,
|
|
248
|
-
});
|
|
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.`);
|
|
249
211
|
}
|
|
250
|
-
async function
|
|
251
|
-
if (
|
|
252
|
-
return
|
|
212
|
+
async function getResolvedUserId(specifiedUserId) {
|
|
213
|
+
if (specifiedUserId && specifiedUserId.trim() !== '' && specifiedUserId.trim().toLowerCase() !== 'me') {
|
|
214
|
+
return specifiedUserId.trim();
|
|
253
215
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
async function getMyProfileEndpoint() {
|
|
257
|
-
if (getAuthenticationMethod.call(this) === 'unifiedLogin') {
|
|
258
|
-
return `/${await getInstagramAccountId.call(this)}`;
|
|
216
|
+
if (await isUnifiedLogin.call(this)) {
|
|
217
|
+
return await getUnifiedLoginAccountId.call(this);
|
|
259
218
|
}
|
|
260
|
-
|
|
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';
|
|
261
222
|
}
|
|
262
|
-
function
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expectedSignature));
|
|
267
|
-
}
|
|
268
|
-
catch (error) {
|
|
269
|
-
return false;
|
|
223
|
+
function resolveParameterList(itemIndex, allDefaultValue, paramName = 'fields', modeParamName = 'fieldsMode') {
|
|
224
|
+
const mode = this.getNodeParameter(modeParamName, itemIndex, 'all');
|
|
225
|
+
if (mode === 'all') {
|
|
226
|
+
return allDefaultValue;
|
|
270
227
|
}
|
|
228
|
+
const selected = this.getNodeParameter(paramName, itemIndex, []).join(',');
|
|
229
|
+
return selected || allDefaultValue;
|
|
271
230
|
}
|
|
272
231
|
//# sourceMappingURL=GenericFunctions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/Instagram/GenericFunctions.ts"],"names":[],"mappings":"
|
|
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,KAAK,UAAU,iBAAiB;IACrC,IAAI,cAAkC,CAAC;IACvC,IAAI,CAAC;QACH,cAAc,GAAI,IAA0B,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,CAAC,CAAW,CAAC;IAC/F,CAAC;IAAC,MAAM,CAAC;QACP,cAAc,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,MAAM,oBAAoB,GAAG,cAAc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
2
2
|
export declare class Instagram implements INodeType {
|
|
3
3
|
description: INodeTypeDescription;
|
|
4
4
|
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|