@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
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class InstagramApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
icon: "file:instagram.svg";
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
authenticate: IAuthenticateGeneric;
|
|
9
|
+
test: ICredentialTestRequest;
|
|
10
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InstagramApi = void 0;
|
|
4
|
+
class InstagramApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'instagramApi';
|
|
7
|
+
this.displayName = 'Instagram Access Token API';
|
|
8
|
+
this.documentationUrl = 'https://developers.facebook.com/documentation/instagram-platform/instagram-api-with-instagram-login';
|
|
9
|
+
this.icon = 'file:instagram.svg';
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Access Token',
|
|
13
|
+
name: 'accessToken',
|
|
14
|
+
type: 'string',
|
|
15
|
+
typeOptions: { password: true },
|
|
16
|
+
default: '',
|
|
17
|
+
required: true,
|
|
18
|
+
description: 'Instagram User Access Token (Short-lived or Long-lived token) obtained via Instagram Login or Meta Developer Portal',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
displayName: 'API Version',
|
|
22
|
+
name: 'apiVersion',
|
|
23
|
+
type: 'string',
|
|
24
|
+
default: 'v26.0',
|
|
25
|
+
description: 'Meta Graph API version to use (e.g. v26.0)',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Base URL',
|
|
29
|
+
name: 'baseUrl',
|
|
30
|
+
type: 'string',
|
|
31
|
+
default: 'https://graph.instagram.com',
|
|
32
|
+
description: 'Instagram Graph API Base URL for Instagram Login',
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
this.authenticate = {
|
|
36
|
+
type: 'generic',
|
|
37
|
+
properties: {
|
|
38
|
+
headers: {
|
|
39
|
+
Authorization: '=Bearer {{$credentials.accessToken}}',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
this.test = {
|
|
44
|
+
request: {
|
|
45
|
+
baseURL: '={{$credentials.baseUrl || "https://graph.instagram.com"}}/{{$credentials.apiVersion || "v26.0"}}',
|
|
46
|
+
url: '/me',
|
|
47
|
+
qs: {
|
|
48
|
+
fields: 'id,username',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.InstagramApi = InstagramApi;
|
|
55
|
+
//# sourceMappingURL=InstagramApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstagramApi.credentials.js","sourceRoot":"","sources":["../../credentials/InstagramApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,YAAY;IAAzB;QACE,SAAI,GAAG,cAAc,CAAC;QACtB,gBAAW,GAAG,4BAA4B,CAAC;QAC3C,qBAAgB,GAAG,qGAAqG,CAAC;QACzH,SAAI,GAAG,oBAA6B,CAAC;QAErC,eAAU,GAAsB;YAC9B;gBACE,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,qHAAqH;aACnI;YACD;gBACE,WAAW,EAAE,aAAa;gBAC1B,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,OAAO;gBAChB,WAAW,EAAE,4CAA4C;aAC1D;YACD;gBACE,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,6BAA6B;gBACtC,WAAW,EAAE,kDAAkD;aAChE;SACF,CAAC;QAEF,iBAAY,GAAyB;YACnC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACV,OAAO,EAAE;oBACP,aAAa,EAAE,sCAAsC;iBACtD;aACF;SACF,CAAC;QAEF,SAAI,GAA2B;YAC7B,OAAO,EAAE;gBACP,OAAO,EAAE,mGAAmG;gBAC5G,GAAG,EAAE,KAAK;gBACV,EAAE,EAAE;oBACF,MAAM,EAAE,aAAa;iBACtB;aACF;SACF,CAAC;IACJ,CAAC;CAAA;AAlDD,oCAkDC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
2
|
export declare class InstagramOAuth2Api implements ICredentialType {
|
|
3
3
|
name: string;
|
|
4
4
|
extends: string[];
|
|
5
5
|
displayName: string;
|
|
6
6
|
documentationUrl: string;
|
|
7
|
+
icon: "file:instagram.svg";
|
|
7
8
|
properties: INodeProperties[];
|
|
8
|
-
preAuthentication(this: IHttpRequestHelper, credentials: ICredentialDataDecryptedObject): Promise<IDataObject>;
|
|
9
9
|
test: ICredentialTestRequest;
|
|
10
10
|
}
|
|
@@ -6,7 +6,8 @@ class InstagramOAuth2Api {
|
|
|
6
6
|
this.name = 'instagramOAuth2Api';
|
|
7
7
|
this.extends = ['oAuth2Api'];
|
|
8
8
|
this.displayName = 'Instagram OAuth2 API';
|
|
9
|
-
this.documentationUrl = 'https://developers.facebook.com/
|
|
9
|
+
this.documentationUrl = 'https://developers.facebook.com/documentation/instagram-platform/instagram-api-with-instagram-login';
|
|
10
|
+
this.icon = 'file:instagram.svg';
|
|
10
11
|
this.properties = [
|
|
11
12
|
{
|
|
12
13
|
displayName: 'Grant Type',
|
|
@@ -18,7 +19,7 @@ class InstagramOAuth2Api {
|
|
|
18
19
|
displayName: 'Authorization URL',
|
|
19
20
|
name: 'authUrl',
|
|
20
21
|
type: 'hidden',
|
|
21
|
-
default: 'https://
|
|
22
|
+
default: 'https://www.instagram.com/oauth/authorize',
|
|
22
23
|
},
|
|
23
24
|
{
|
|
24
25
|
displayName: 'Access Token URL',
|
|
@@ -27,147 +28,66 @@ class InstagramOAuth2Api {
|
|
|
27
28
|
default: 'https://api.instagram.com/oauth/access_token',
|
|
28
29
|
},
|
|
29
30
|
{
|
|
30
|
-
displayName: '
|
|
31
|
-
name: 'scope',
|
|
32
|
-
type: 'hidden',
|
|
33
|
-
default: 'instagram_business_basic,instagram_business_manage_messages,instagram_business_manage_comments,instagram_business_content_publish',
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
displayName: 'Auth URI Query Parameters',
|
|
37
|
-
name: 'authQueryParameters',
|
|
38
|
-
type: 'hidden',
|
|
39
|
-
default: '',
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
displayName: 'Authentication',
|
|
43
|
-
name: 'authentication',
|
|
44
|
-
type: 'hidden',
|
|
45
|
-
default: 'body',
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
displayName: 'Account Information',
|
|
49
|
-
name: 'accountInfoNotice',
|
|
50
|
-
type: 'notice',
|
|
51
|
-
default: '',
|
|
52
|
-
description: 'After connecting your account, your Instagram Business Account details (username, ID, profile) will be automatically available. You can access this information in your workflow nodes. The system will automatically exchange your OAuth token for a long-lived token (60 days) and persist it, ensuring it survives n8n restarts.',
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
displayName: 'Client ID',
|
|
31
|
+
displayName: 'Client ID (Instagram App ID)',
|
|
56
32
|
name: 'clientId',
|
|
57
33
|
type: 'string',
|
|
58
34
|
default: '',
|
|
59
35
|
required: true,
|
|
60
|
-
description: '
|
|
61
|
-
placeholder: '1234567890123456',
|
|
36
|
+
description: 'Your Instagram App ID (found in App Dashboard > Instagram > API setup with Instagram login > 3. Set up Instagram business login > Business login settings > Instagram App ID). Do NOT use the main Facebook App ID.',
|
|
62
37
|
},
|
|
63
38
|
{
|
|
64
|
-
displayName: 'Client Secret',
|
|
39
|
+
displayName: 'Client Secret (Instagram App Secret)',
|
|
65
40
|
name: 'clientSecret',
|
|
66
41
|
type: 'string',
|
|
67
|
-
typeOptions: {
|
|
68
|
-
password: true,
|
|
69
|
-
},
|
|
42
|
+
typeOptions: { password: true },
|
|
70
43
|
default: '',
|
|
71
44
|
required: true,
|
|
72
|
-
description: '
|
|
73
|
-
placeholder: 'abc123def456...',
|
|
45
|
+
description: 'Your Instagram App Secret (found in App Dashboard > Instagram > API setup with Instagram login > 3. Set up Instagram business login > Business login settings > Instagram App Secret).',
|
|
74
46
|
},
|
|
75
47
|
{
|
|
76
|
-
displayName: '
|
|
77
|
-
name: '
|
|
48
|
+
displayName: 'Scope',
|
|
49
|
+
name: 'scope',
|
|
78
50
|
type: 'string',
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
required: false,
|
|
82
|
-
description: 'Optional: Custom verification token for webhook setup (minimum 20 characters). Only needed if using Instagram Trigger node.',
|
|
83
|
-
placeholder: 'my_custom_verify_token_2024',
|
|
51
|
+
default: 'instagram_business_basic,instagram_business_content_publish,instagram_business_manage_messages,instagram_business_manage_comments',
|
|
52
|
+
description: 'Comma-separated OAuth scopes for Instagram Business Login (e.g. instagram_business_basic, instagram_business_content_publish, instagram_business_manage_messages, instagram_business_manage_comments)',
|
|
84
53
|
},
|
|
85
54
|
{
|
|
86
|
-
displayName: '
|
|
87
|
-
name: '
|
|
55
|
+
displayName: 'Auth URI Query Parameters',
|
|
56
|
+
name: 'authQueryParameters',
|
|
88
57
|
type: 'hidden',
|
|
89
|
-
|
|
90
|
-
expirable: true,
|
|
91
|
-
},
|
|
92
|
-
default: '',
|
|
58
|
+
default: 'response_type=code',
|
|
93
59
|
},
|
|
94
60
|
{
|
|
95
|
-
displayName: '
|
|
96
|
-
name: '
|
|
61
|
+
displayName: 'Authentication',
|
|
62
|
+
name: 'authentication',
|
|
97
63
|
type: 'hidden',
|
|
98
|
-
default:
|
|
64
|
+
default: 'body',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
displayName: 'API Version',
|
|
68
|
+
name: 'apiVersion',
|
|
69
|
+
type: 'string',
|
|
70
|
+
default: 'v26.0',
|
|
71
|
+
description: 'Meta Graph API version to use (e.g. v26.0)',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
displayName: 'Base URL',
|
|
75
|
+
name: 'baseUrl',
|
|
76
|
+
type: 'string',
|
|
77
|
+
default: 'https://graph.instagram.com',
|
|
78
|
+
description: 'Instagram Graph API Base URL for Instagram Login',
|
|
99
79
|
},
|
|
100
80
|
];
|
|
101
81
|
this.test = {
|
|
102
82
|
request: {
|
|
103
|
-
baseURL: 'https://graph.instagram.com/
|
|
83
|
+
baseURL: '={{$credentials.baseUrl || "https://graph.instagram.com"}}/{{$credentials.apiVersion || "v26.0"}}',
|
|
104
84
|
url: '/me',
|
|
105
|
-
method: 'GET',
|
|
106
85
|
qs: {
|
|
107
86
|
fields: 'id,username',
|
|
108
87
|
},
|
|
109
88
|
},
|
|
110
89
|
};
|
|
111
90
|
}
|
|
112
|
-
async preAuthentication(credentials) {
|
|
113
|
-
const now = Math.floor(Date.now() / 1000);
|
|
114
|
-
const longLivedToken = credentials.longLivedToken;
|
|
115
|
-
const tokenExpiresAt = credentials.tokenExpiresAt || 0;
|
|
116
|
-
const clientSecret = credentials.clientSecret;
|
|
117
|
-
const oauthTokenData = credentials.oauthTokenData;
|
|
118
|
-
const shortLivedToken = oauthTokenData === null || oauthTokenData === void 0 ? void 0 : oauthTokenData.access_token;
|
|
119
|
-
if (longLivedToken && tokenExpiresAt > 0) {
|
|
120
|
-
const sevenDaysInSeconds = 7 * 24 * 60 * 60;
|
|
121
|
-
if (tokenExpiresAt > now + sevenDaysInSeconds) {
|
|
122
|
-
return {};
|
|
123
|
-
}
|
|
124
|
-
const totalLifetime = 60 * 24 * 60 * 60;
|
|
125
|
-
const tokenAge = now - (tokenExpiresAt - totalLifetime);
|
|
126
|
-
if (tokenAge >= 24 * 60 * 60) {
|
|
127
|
-
try {
|
|
128
|
-
const refreshed = await this.helpers.httpRequest({
|
|
129
|
-
method: 'GET',
|
|
130
|
-
url: 'https://graph.instagram.com/refresh_access_token',
|
|
131
|
-
qs: {
|
|
132
|
-
grant_type: 'ig_refresh_token',
|
|
133
|
-
access_token: longLivedToken,
|
|
134
|
-
},
|
|
135
|
-
});
|
|
136
|
-
return {
|
|
137
|
-
longLivedToken: refreshed.access_token,
|
|
138
|
-
tokenExpiresAt: now + refreshed.expires_in,
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
catch (error) {
|
|
142
|
-
console.warn('Instagram: Failed to refresh long-lived token, continuing with current token', error);
|
|
143
|
-
return {};
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return {};
|
|
147
|
-
}
|
|
148
|
-
if (!shortLivedToken) {
|
|
149
|
-
return {};
|
|
150
|
-
}
|
|
151
|
-
try {
|
|
152
|
-
const exchanged = await this.helpers.httpRequest({
|
|
153
|
-
method: 'GET',
|
|
154
|
-
url: 'https://graph.instagram.com/access_token',
|
|
155
|
-
qs: {
|
|
156
|
-
grant_type: 'ig_exchange_token',
|
|
157
|
-
client_secret: clientSecret,
|
|
158
|
-
access_token: shortLivedToken,
|
|
159
|
-
},
|
|
160
|
-
});
|
|
161
|
-
return {
|
|
162
|
-
longLivedToken: exchanged.access_token,
|
|
163
|
-
tokenExpiresAt: now + exchanged.expires_in,
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
catch (error) {
|
|
167
|
-
console.error('Instagram: Failed to exchange OAuth token for long-lived token', error);
|
|
168
|
-
return {};
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
91
|
}
|
|
172
92
|
exports.InstagramOAuth2Api = InstagramOAuth2Api;
|
|
173
93
|
//# sourceMappingURL=InstagramOAuth2Api.credentials.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InstagramOAuth2Api.credentials.js","sourceRoot":"","sources":["../../credentials/InstagramOAuth2Api.credentials.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"InstagramOAuth2Api.credentials.js","sourceRoot":"","sources":["../../credentials/InstagramOAuth2Api.credentials.ts"],"names":[],"mappings":";;;AAMA,MAAa,kBAAkB;IAA/B;QACE,SAAI,GAAG,oBAAoB,CAAC;QAC5B,YAAO,GAAG,CAAC,WAAW,CAAC,CAAC;QACxB,gBAAW,GAAG,sBAAsB,CAAC;QACrC,qBAAgB,GAAG,qGAAqG,CAAC;QACzH,SAAI,GAAG,oBAA6B,CAAC;QAErC,eAAU,GAAsB;YAC9B;gBACE,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,mBAAmB;aAC7B;YACD;gBACE,WAAW,EAAE,mBAAmB;gBAChC,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,2CAA2C;aACrD;YACD;gBACE,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,8CAA8C;aACxD;YACD;gBACE,WAAW,EAAE,8BAA8B;gBAC3C,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EACT,qNAAqN;aACxN;YACD;gBACE,WAAW,EAAE,sCAAsC;gBACnD,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EACT,wLAAwL;aAC3L;YACD;gBACE,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EACL,mIAAmI;gBACrI,WAAW,EACT,uMAAuM;aAC1M;YACD;gBACE,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,qBAAqB;gBAC3B,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,oBAAoB;aAC9B;YACD;gBACE,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM;aAChB;YACD;gBACE,WAAW,EAAE,aAAa;gBAC1B,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,OAAO;gBAChB,WAAW,EAAE,4CAA4C;aAC1D;YACD;gBACE,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,6BAA6B;gBACtC,WAAW,EAAE,kDAAkD;aAChE;SACF,CAAC;QAEF,SAAI,GAA2B;YAC7B,OAAO,EAAE;gBACP,OAAO,EAAE,mGAAmG;gBAC5G,GAAG,EAAE,KAAK;gBACV,EAAE,EAAE;oBACF,MAAM,EAAE,aAAa;iBACtB;aACF;SACF,CAAC;IACJ,CAAC;CAAA;AA3FD,gDA2FC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
/**
|
|
3
|
+
* Instagram API with Unified Login.
|
|
4
|
+
*
|
|
5
|
+
* Clients log in with Instagram or Facebook through a login configuration (config_id)
|
|
6
|
+
* created in the Meta App Dashboard. The app receives a Business Integration System User
|
|
7
|
+
* Access Token and calls graph.facebook.com using the Instagram account ID in the path.
|
|
8
|
+
*/
|
|
9
|
+
export declare class InstagramUnifiedLoginOAuth2Api implements ICredentialType {
|
|
10
|
+
name: string;
|
|
11
|
+
extends: string[];
|
|
12
|
+
displayName: string;
|
|
13
|
+
documentationUrl: string;
|
|
14
|
+
icon: "file:instagram.svg";
|
|
15
|
+
properties: INodeProperties[];
|
|
16
|
+
test: ICredentialTestRequest;
|
|
17
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InstagramUnifiedLoginOAuth2Api = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Instagram API with Unified Login.
|
|
6
|
+
*
|
|
7
|
+
* Clients log in with Instagram or Facebook through a login configuration (config_id)
|
|
8
|
+
* created in the Meta App Dashboard. The app receives a Business Integration System User
|
|
9
|
+
* Access Token and calls graph.facebook.com using the Instagram account ID in the path.
|
|
10
|
+
*/
|
|
11
|
+
class InstagramUnifiedLoginOAuth2Api {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.name = 'instagramUnifiedLoginOAuth2Api';
|
|
14
|
+
this.extends = ['oAuth2Api'];
|
|
15
|
+
this.displayName = 'Instagram Unified Login OAuth2 API';
|
|
16
|
+
this.documentationUrl = 'https://developers.facebook.com/documentation/instagram-platform/instagram-api-with-unified-login';
|
|
17
|
+
this.icon = 'file:instagram.svg';
|
|
18
|
+
this.properties = [
|
|
19
|
+
{
|
|
20
|
+
displayName: 'Grant Type',
|
|
21
|
+
name: 'grantType',
|
|
22
|
+
type: 'hidden',
|
|
23
|
+
default: 'authorizationCode',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
displayName: 'Authorization URL',
|
|
27
|
+
name: 'authUrl',
|
|
28
|
+
type: 'hidden',
|
|
29
|
+
default: 'https://www.facebook.com/dialog/oauth',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
displayName: 'Access Token URL',
|
|
33
|
+
name: 'accessTokenUrl',
|
|
34
|
+
type: 'hidden',
|
|
35
|
+
default: '=https://graph.facebook.com/{{$self["apiVersion"] || "v27.0"}}/oauth/access_token',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
displayName: 'Client ID (Meta App ID)',
|
|
39
|
+
name: 'clientId',
|
|
40
|
+
type: 'string',
|
|
41
|
+
default: '',
|
|
42
|
+
required: true,
|
|
43
|
+
description: 'Your Meta App ID (App Dashboard > App settings > Basic). Do NOT use the Instagram App ID.',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
displayName: 'Client Secret (Meta App Secret)',
|
|
47
|
+
name: 'clientSecret',
|
|
48
|
+
type: 'string',
|
|
49
|
+
typeOptions: { password: true },
|
|
50
|
+
default: '',
|
|
51
|
+
required: true,
|
|
52
|
+
description: 'Your Meta App Secret (App Dashboard > App settings > Basic). Do NOT use the Instagram App Secret.',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
displayName: 'Configuration ID',
|
|
56
|
+
name: 'configId',
|
|
57
|
+
type: 'string',
|
|
58
|
+
default: '',
|
|
59
|
+
required: true,
|
|
60
|
+
description: 'The ID of the Unified Login configuration created in the App Dashboard. It defines the permissions and assets your app asks for. Its Redirect URL must match the OAuth Redirect URL shown above exactly.',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
displayName: 'Instagram Account ID',
|
|
64
|
+
name: 'instagramAccountId',
|
|
65
|
+
type: 'string',
|
|
66
|
+
default: '',
|
|
67
|
+
description: 'ID of the Instagram professional account to use. Leave empty to auto-detect it when exactly one account was shared during login (via /me/assigned_instagram_accounts).',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
// Permissions come from the configuration (config_id), not from a scope parameter.
|
|
71
|
+
displayName: 'Scope',
|
|
72
|
+
name: 'scope',
|
|
73
|
+
type: 'hidden',
|
|
74
|
+
default: '',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
displayName: 'Auth URI Query Parameters',
|
|
78
|
+
name: 'authQueryParameters',
|
|
79
|
+
type: 'hidden',
|
|
80
|
+
default: '=config_id={{$self["configId"]}}&response_type=code',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
displayName: 'Authentication',
|
|
84
|
+
name: 'authentication',
|
|
85
|
+
type: 'hidden',
|
|
86
|
+
default: 'body',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
displayName: 'API Version',
|
|
90
|
+
name: 'apiVersion',
|
|
91
|
+
type: 'string',
|
|
92
|
+
default: 'v27.0',
|
|
93
|
+
description: 'Meta Graph API version to use (e.g. v27.0)',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
displayName: 'Base URL',
|
|
97
|
+
name: 'baseUrl',
|
|
98
|
+
type: 'string',
|
|
99
|
+
default: 'https://graph.facebook.com',
|
|
100
|
+
description: 'Graph API Base URL for Unified Login',
|
|
101
|
+
},
|
|
102
|
+
];
|
|
103
|
+
// With this token, /me returns the business integration system user (not the Instagram account).
|
|
104
|
+
this.test = {
|
|
105
|
+
request: {
|
|
106
|
+
baseURL: '={{$credentials.baseUrl || "https://graph.facebook.com"}}/{{$credentials.apiVersion || "v27.0"}}',
|
|
107
|
+
url: '/me',
|
|
108
|
+
qs: {
|
|
109
|
+
fields: 'id,client_business_id',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
exports.InstagramUnifiedLoginOAuth2Api = InstagramUnifiedLoginOAuth2Api;
|
|
116
|
+
//# sourceMappingURL=InstagramUnifiedLoginOAuth2Api.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstagramUnifiedLoginOAuth2Api.credentials.js","sourceRoot":"","sources":["../../credentials/InstagramUnifiedLoginOAuth2Api.credentials.ts"],"names":[],"mappings":";;;AAMA;;;;;;GAMG;AACH,MAAa,8BAA8B;IAA3C;QACE,SAAI,GAAG,gCAAgC,CAAC;QACxC,YAAO,GAAG,CAAC,WAAW,CAAC,CAAC;QACxB,gBAAW,GAAG,oCAAoC,CAAC;QACnD,qBAAgB,GACd,mGAAmG,CAAC;QACtG,SAAI,GAAG,oBAA6B,CAAC;QAErC,eAAU,GAAsB;YAC9B;gBACE,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,mBAAmB;aAC7B;YACD;gBACE,WAAW,EAAE,mBAAmB;gBAChC,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,uCAAuC;aACjD;YACD;gBACE,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,mFAAmF;aAC7F;YACD;gBACE,WAAW,EAAE,yBAAyB;gBACtC,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EACT,2FAA2F;aAC9F;YACD;gBACE,WAAW,EAAE,iCAAiC;gBAC9C,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EACT,mGAAmG;aACtG;YACD;gBACE,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EACT,0MAA0M;aAC7M;YACD;gBACE,WAAW,EAAE,sBAAsB;gBACnC,IAAI,EAAE,oBAAoB;gBAC1B,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EACT,wKAAwK;aAC3K;YACD;gBACE,mFAAmF;gBACnF,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACZ;YACD;gBACE,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,qBAAqB;gBAC3B,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,qDAAqD;aAC/D;YACD;gBACE,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM;aAChB;YACD;gBACE,WAAW,EAAE,aAAa;gBAC1B,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,OAAO;gBAChB,WAAW,EAAE,4CAA4C;aAC1D;YACD;gBACE,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,4BAA4B;gBACrC,WAAW,EAAE,sCAAsC;aACpD;SACF,CAAC;QAEF,iGAAiG;QACjG,SAAI,GAA2B;YAC7B,OAAO,EAAE;gBACP,OAAO,EACL,kGAAkG;gBACpG,GAAG,EAAE,KAAK;gBACV,EAAE,EAAE;oBACF,MAAM,EAAE,uBAAuB;iBAChC;aACF;SACF,CAAC;IACJ,CAAC;CAAA;AA7GD,wEA6GC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="1000" height="1000" viewBox="0 0 264.5833 264.5833" inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)" sodipodi:docname="Instagram_(2022).svg"><defs><radialGradient id="f" cx="158.429" cy="578.088" r="52.3515" xlink:href="#a" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0 -4.03418 4.28018 0 -2332.2273 942.2356)" fx="158.429" fy="578.088"/><radialGradient inkscape:collect="always" xlink:href="#b" id="g" gradientUnits="userSpaceOnUse" gradientTransform="matrix(.67441 -1.16203 1.51283 .87801 -814.3657 -47.8354)" cx="172.6149" cy="600.6924" fx="172.6149" fy="600.6924" r="65"/><radialGradient inkscape:collect="always" xlink:href="#c" id="h" cx="144.012" cy="51.3367" fx="144.012" fy="51.3367" r="67.081" gradientTransform="matrix(-2.3989 .67549 -.23008 -.81732 464.9957 -26.4035)" gradientUnits="userSpaceOnUse"/><radialGradient inkscape:collect="always" xlink:href="#d" id="e" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-3.10797 .87652 -.6315 -2.23914 1345.6503 1374.1983)" cx="199.7884" cy="628.4379" fx="199.7884" fy="628.4379" r="52.3515"/><linearGradient inkscape:collect="always" id="d"><stop offset="0" stop-color="#ff005f"/><stop offset="1" stop-color="#fc01d8"/></linearGradient><linearGradient id="c"><stop offset="0" stop-color="#780cff"/><stop stop-color="#820bff" offset="1" stop-opacity="0"/></linearGradient><linearGradient inkscape:collect="always" id="b"><stop offset="0" stop-color="#fc0"/><stop offset="1" stop-color="#fc0" stop-opacity="0"/></linearGradient><linearGradient id="a"><stop offset="0" stop-color="#fc0"/><stop offset=".1242" stop-color="#fc0"/><stop offset=".5672" stop-color="#fe4a05"/><stop offset=".6942" stop-color="#ff0f3f"/><stop offset="1" stop-color="#fe0657" stop-opacity="0"/></linearGradient></defs><sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:zoom=".515" inkscape:cx="500" inkscape:cy="500" inkscape:document-units="mm" inkscape:current-layer="layer1" inkscape:document-rotation="0" showgrid="false" inkscape:window-width="1366" inkscape:window-height="705" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1"/><g inkscape:label="Layer 1" inkscape:groupmode="layer"><path d="M204.1503 18.1429c-55.2305 0-71.3834.057-74.5232.3175-11.3342.9424-18.387 2.7275-26.0708 6.554-5.9214 2.9413-10.5915 6.3506-15.2005 11.1298-8.3938 8.7157-13.481 19.4383-15.3226 32.1842-.8953 6.1877-1.1558 7.4496-1.2087 39.0558-.0203 10.5354 0 24.4007 0 42.9984 0 55.2008.061 71.3418.3256 74.4764.9157 11.032 2.6453 17.9728 6.3081 25.565 7 14.5329 20.369 25.4428 36.119 29.5137 5.4535 1.4044 11.4767 2.1779 19.2092 2.5442 3.2762.1425 36.6684.2443 70.081.2443 33.4127 0 66.8253-.0407 70.02-.2035 8.9535-.4214 14.1526-1.1195 19.9011-2.6054 15.8517-4.0912 28.9767-14.8383 36.119-29.5748 3.5916-7.409 5.4128-14.6144 6.237-25.0704.179-2.2796.2543-38.6263.2543-74.924 0-36.304-.0814-72.5835-.2605-74.8632-.8343-10.6249-2.6555-17.7692-6.363-25.3207-3.0421-6.1816-6.42-10.798-11.324-15.518-8.752-8.3616-19.4555-13.4502-32.2101-15.2902-6.18-.8936-7.411-1.1582-39.033-1.2131z" inkscape:connector-curvature="0" fill="url(#e)" transform="translate(-71.8155 -18.1429)"/><path d="M204.1503 18.1429c-55.2305 0-71.3834.057-74.5232.3175-11.3342.9424-18.387 2.7275-26.0708 6.554-5.9214 2.9413-10.5915 6.3506-15.2005 11.1298-8.3938 8.7157-13.481 19.4383-15.3226 32.1842-.8953 6.1877-1.1558 7.4496-1.2087 39.0558-.0203 10.5354 0 24.4007 0 42.9984 0 55.2008.061 71.3418.3256 74.4764.9157 11.032 2.6453 17.9728 6.3081 25.565 7 14.5329 20.369 25.4428 36.119 29.5137 5.4535 1.4044 11.4767 2.1779 19.2092 2.5442 3.2762.1425 36.6684.2443 70.081.2443 33.4127 0 66.8253-.0407 70.02-.2035 8.9535-.4214 14.1526-1.1195 19.9011-2.6054 15.8517-4.0912 28.9767-14.8383 36.119-29.5748 3.5916-7.409 5.4128-14.6144 6.237-25.0704.179-2.2796.2543-38.6263.2543-74.924 0-36.304-.0814-72.5835-.2605-74.8632-.8343-10.6249-2.6555-17.7692-6.363-25.3207-3.0421-6.1816-6.42-10.798-11.324-15.518-8.752-8.3616-19.4555-13.4502-32.2101-15.2902-6.18-.8936-7.411-1.1582-39.033-1.2131z" inkscape:connector-curvature="0" fill="url(#f)" transform="translate(-71.8155 -18.1429)"/><path d="M204.1503 18.1429c-55.2305 0-71.3834.057-74.5232.3175-11.3342.9424-18.387 2.7275-26.0708 6.554-5.9214 2.9413-10.5915 6.3506-15.2005 11.1298-8.3938 8.7157-13.481 19.4383-15.3226 32.1842-.8953 6.1877-1.1558 7.4496-1.2087 39.0558-.0203 10.5354 0 24.4007 0 42.9984 0 55.2008.061 71.3418.3256 74.4764.9157 11.032 2.6453 17.9728 6.3081 25.565 7 14.5329 20.369 25.4428 36.119 29.5137 5.4535 1.4044 11.4767 2.1779 19.2092 2.5442 3.2762.1425 36.6684.2443 70.081.2443 33.4127 0 66.8253-.0407 70.02-.2035 8.9535-.4214 14.1526-1.1195 19.9011-2.6054 15.8517-4.0912 28.9767-14.8383 36.119-29.5748 3.5916-7.409 5.4128-14.6144 6.237-25.0704.179-2.2796.2543-38.6263.2543-74.924 0-36.304-.0814-72.5835-.2605-74.8632-.8343-10.6249-2.6555-17.7692-6.363-25.3207-3.0421-6.1816-6.42-10.798-11.324-15.518-8.752-8.3616-19.4555-13.4502-32.2101-15.2902-6.18-.8936-7.411-1.1582-39.033-1.2131z" inkscape:connector-curvature="0" fill="url(#g)" transform="translate(-71.8155 -18.1429)"/><path d="M204.1503 18.1429c-55.2305 0-71.3834.057-74.5232.3175-11.3342.9424-18.387 2.7275-26.0708 6.554-5.9214 2.9413-10.5915 6.3506-15.2005 11.1298-8.3938 8.7157-13.481 19.4383-15.3226 32.1842-.8953 6.1877-1.1558 7.4496-1.2087 39.0558-.0203 10.5354 0 24.4007 0 42.9984 0 55.2008.061 71.3418.3256 74.4764.9157 11.032 2.6453 17.9728 6.3081 25.565 7 14.5329 20.369 25.4428 36.119 29.5137 5.4535 1.4044 11.4767 2.1779 19.2092 2.5442 3.2762.1425 36.6684.2443 70.081.2443 33.4127 0 66.8253-.0407 70.02-.2035 8.9535-.4214 14.1526-1.1195 19.9011-2.6054 15.8517-4.0912 28.9767-14.8383 36.119-29.5748 3.5916-7.409 5.4128-14.6144 6.237-25.0704.179-2.2796.2543-38.6263.2543-74.924 0-36.304-.0814-72.5835-.2605-74.8632-.8343-10.6249-2.6555-17.7692-6.363-25.3207-3.0421-6.1816-6.42-10.798-11.324-15.518-8.752-8.3616-19.4555-13.4502-32.2101-15.2902-6.18-.8936-7.411-1.1582-39.033-1.2131z" inkscape:connector-curvature="0" fill="url(#h)" transform="translate(-71.8155 -18.1429)"/><path d="M132.3452 33.973c-26.7167 0-30.0696.1167-40.5629.5939-10.4727.4792-17.6212 2.136-23.8762 4.567-6.4701 2.5107-11.9586 5.8693-17.4265 11.3352-5.472 5.464-8.8332 10.9483-11.354 17.4116-2.4389 6.2524-4.099 13.3976-4.5703 23.8585-.4693 10.4854-.5923 13.8379-.5923 40.5348 0 26.697.1189 30.0371.5943 40.5225.4817 10.465 2.1397 17.6082 4.5703 23.8585 2.5147 6.4654 5.8758 11.9497 11.3458 17.4136 5.466 5.468 10.9544 8.8349 17.4204 11.3456 6.259 2.4309 13.4097 4.0877 23.8803 4.567 10.4933.477 13.8441.5938 40.5588.5938 26.7188 0 30.0615-.1167 40.5547-.5939 10.4728-.4792 17.6295-2.136 23.8885-4.567 6.4681-2.5106 11.9484-5.8775 17.4143-11.3455 5.472-5.4639 8.8332-10.9482 11.354-17.4115 2.4183-6.2524 4.0784-13.3976 4.5703-23.8585.4713-10.4854.5943-13.8277.5943-40.5246 0-26.697-.123-30.0473-.5943-40.5328-.4919-10.465-2.152-17.6081-4.5703-23.8584-2.5208-6.4654-5.882-11.9498-11.354-17.4137-5.4721-5.468-10.9442-8.8266-17.4204-11.3353-6.2714-2.4309-13.424-4.0877-23.8967-4.5669-10.4933-.4772-13.8339-.5939-40.5588-.5939zm-8.825 17.7147c2.6193-.0041 5.5418 0 8.825 0 26.2659 0 29.379.0942 39.7513.5652 9.5915.4383 14.7971 2.0397 18.2648 3.3852 4.5908 1.7817 7.8638 3.9116 11.3048 7.3521 3.4431 3.4406 5.5745 6.7173 7.3617 11.3046 1.3465 3.461 2.9512 8.6628 3.3877 18.2472.4714 10.3625.5739 13.4754.5739 39.7095 0 26.234-.1025 29.347-.5739 39.7095-.4386 9.5843-2.0412 14.7861-3.3877 18.2471-1.783 4.5874-3.9186 7.8539-7.3617 11.2923-3.443 3.4406-6.712 5.5704-11.3048 7.3521-3.4636 1.3517-8.6733 2.949-18.2648 3.3873-10.3702.471-13.4854.5734-39.7513.5734-26.2679 0-29.381-.1024-39.7513-.5734-9.5914-.4423-14.797-2.0438-18.2668-3.3893-4.5908-1.7817-7.87-3.9116-11.313-7.3521-3.4431-3.4405-5.5745-6.709-7.3617-11.2985-1.3465-3.461-2.9512-8.6628-3.3877-18.2471-.4714-10.3626-.5657-13.4754-.5657-39.7259 0-26.2504.0943-29.347.5657-39.7095.4386-9.5844 2.0412-14.7861 3.3877-18.2512 1.783-4.5874 3.9186-7.8641 7.3617-11.3046 3.443-3.4406 6.7222-5.5704 11.313-7.3562 3.4677-1.3517 8.6754-2.949 18.2668-3.3894 9.075-.4096 12.5919-.5324 30.9264-.553zm61.3363 16.322c-6.5173 0-11.805 5.2776-11.805 11.792 0 6.5125 5.2877 11.7962 11.805 11.7962 6.5172 0 11.8049-5.2837 11.8049-11.7962 0-6.5124-5.2877-11.796-11.805-11.796zm-52.5113 13.7826c-27.8993 0-50.5191 22.6031-50.5191 50.4817 0 27.8786 22.6198 50.4714 50.5191 50.4714s50.511-22.5928 50.511-50.4714c0-27.8786-22.6137-50.4817-50.513-50.4817zm0 17.7147c18.109 0 32.7914 14.6694 32.7914 32.767 0 18.0956-14.6824 32.767-32.7914 32.767-18.111 0-32.7913-14.6714-32.7913-32.767 0-18.0976 14.6803-32.767 32.7913-32.767z" inkscape:connector-curvature="0" fill="#fff"/></g></svg>
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from './nodes/Instagram/Instagram.node';
|
|
2
|
+
export * from './nodes/Instagram/InstagramChatTrigger.node';
|
|
3
|
+
export * from './credentials/InstagramApi.credentials';
|
|
4
|
+
export * from './credentials/InstagramOAuth2Api.credentials';
|
|
5
|
+
export * from './credentials/InstagramUnifiedLoginOAuth2Api.credentials';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./nodes/Instagram/Instagram.node"), exports);
|
|
18
|
+
__exportStar(require("./nodes/Instagram/InstagramChatTrigger.node"), exports);
|
|
19
|
+
__exportStar(require("./credentials/InstagramApi.credentials"), exports);
|
|
20
|
+
__exportStar(require("./credentials/InstagramOAuth2Api.credentials"), exports);
|
|
21
|
+
__exportStar(require("./credentials/InstagramUnifiedLoginOAuth2Api.credentials"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAiD;AACjD,8EAA4D;AAC5D,yEAAuD;AACvD,+EAA6D;AAC7D,2FAAyE"}
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
type
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export declare function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export declare function
|
|
1
|
+
import { IDataObject, IExecuteFunctions, IHookFunctions, IHttpRequestMethods, ILoadOptionsFunctions } from 'n8n-workflow';
|
|
2
|
+
type InstagramRequestContext = IExecuteFunctions | ILoadOptionsFunctions | IHookFunctions;
|
|
3
|
+
export declare const UNIFIED_LOGIN_CREDENTIAL = "instagramUnifiedLoginOAuth2Api";
|
|
4
|
+
/**
|
|
5
|
+
* Resolves which credential type the node is configured to use, based on the
|
|
6
|
+
* "Authentication" parameter. Falls back to probing when the parameter is unavailable.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getCredentialType(this: InstagramRequestContext): Promise<string>;
|
|
9
|
+
export declare function isUnifiedLogin(this: InstagramRequestContext): Promise<boolean>;
|
|
10
|
+
/**
|
|
11
|
+
* Unified Login only: returns the Instagram professional account ID to use in request paths.
|
|
12
|
+
* Uses the ID set on the credential, otherwise auto-detects it when exactly one account
|
|
13
|
+
* was shared with the app.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getUnifiedLoginAccountId(this: InstagramRequestContext): Promise<string>;
|
|
16
|
+
/**
|
|
17
|
+
* Performs an authenticated Graph API request.
|
|
18
|
+
*
|
|
19
|
+
* With Unified Login, "/me" refers to the business integration system user rather than
|
|
20
|
+
* the Instagram account, so a leading "/me" segment is replaced with the Instagram
|
|
21
|
+
* account ID. Pass `rawEndpoint: true` in `options` to send the endpoint untouched.
|
|
22
|
+
*/
|
|
23
|
+
export declare function instagramApiRequest(this: InstagramRequestContext, method: IHttpRequestMethods, endpoint: string, body?: IDataObject, qs?: IDataObject, options?: IDataObject): Promise<any>;
|
|
24
|
+
export declare function instagramApiRequestAllItems(this: IExecuteFunctions | ILoadOptionsFunctions, propertyName: string, method: IHttpRequestMethods, endpoint: string, body?: IDataObject, qs?: IDataObject, limit?: number): Promise<any[]>;
|
|
25
|
+
export declare function pollMediaContainerStatus(this: IExecuteFunctions, containerId: string, maxAttempts?: number, delayMs?: number): Promise<void>;
|
|
26
|
+
export declare function getResolvedUserId(this: IExecuteFunctions, specifiedUserId?: string): Promise<string>;
|
|
27
|
+
export declare function resolveParameterList(this: IExecuteFunctions, itemIndex: number, allDefaultValue: string, paramName?: string, modeParamName?: string): string;
|
|
24
28
|
export {};
|