@xnkee/n8n-nodes-instagram 1.7.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +4 -0
- package/dist/index.js +21 -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/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 -47
- 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,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleMedia = handleMedia;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const GenericFunctions_1 = require("../GenericFunctions");
|
|
6
|
+
const ALL_SINGLE_MEDIA_FIELDS = 'id,caption,media_type,media_url,permalink,shortcode,thumbnail_url,timestamp,username,like_count,comments_count,is_comment_enabled,children{id,media_type,media_url,thumbnail_url},alt_text';
|
|
7
|
+
const ALL_GET_ALL_MEDIA_FIELDS = 'id,caption,media_type,media_url,permalink,thumbnail_url,timestamp,like_count,comments_count,is_comment_enabled';
|
|
8
|
+
async function handleGetMedia(i) {
|
|
9
|
+
const mediaId = this.getNodeParameter('mediaId', i);
|
|
10
|
+
const fields = GenericFunctions_1.resolveParameterList.call(this, i, ALL_SINGLE_MEDIA_FIELDS);
|
|
11
|
+
return await GenericFunctions_1.instagramApiRequest.call(this, 'GET', `/${mediaId}`, {}, { fields });
|
|
12
|
+
}
|
|
13
|
+
async function handleGetAllMedia(i) {
|
|
14
|
+
const rawUserId = this.getNodeParameter('userId', i, 'me');
|
|
15
|
+
const resolvedUserId = await GenericFunctions_1.getResolvedUserId.call(this, rawUserId);
|
|
16
|
+
const returnAll = this.getNodeParameter('returnAll', i, false);
|
|
17
|
+
const limit = returnAll ? undefined : this.getNodeParameter('limit', i, 50);
|
|
18
|
+
const additionalFields = this.getNodeParameter('additionalFields', i, {});
|
|
19
|
+
const fields = GenericFunctions_1.resolveParameterList.call(this, i, ALL_GET_ALL_MEDIA_FIELDS);
|
|
20
|
+
const qs = { fields };
|
|
21
|
+
if (additionalFields.since)
|
|
22
|
+
qs.since = additionalFields.since;
|
|
23
|
+
if (additionalFields.until)
|
|
24
|
+
qs.until = additionalFields.until;
|
|
25
|
+
return await GenericFunctions_1.instagramApiRequestAllItems.call(this, 'data', 'GET', `/${resolvedUserId}/media`, {}, qs, limit);
|
|
26
|
+
}
|
|
27
|
+
function parseUserTags(rawTags, nodeContext) {
|
|
28
|
+
if (!rawTags)
|
|
29
|
+
return undefined;
|
|
30
|
+
if (typeof rawTags === 'object')
|
|
31
|
+
return rawTags;
|
|
32
|
+
try {
|
|
33
|
+
return JSON.parse(rawTags);
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
throw new n8n_workflow_1.NodeOperationError(nodeContext, 'User Tags must be a valid JSON array string');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async function handlePublishPhoto(i) {
|
|
40
|
+
const rawUserId = this.getNodeParameter('userId', i, 'me');
|
|
41
|
+
const resolvedUserId = await GenericFunctions_1.getResolvedUserId.call(this, rawUserId);
|
|
42
|
+
const imageUrl = this.getNodeParameter('imageUrl', i);
|
|
43
|
+
const caption = this.getNodeParameter('caption', i, '');
|
|
44
|
+
const additionalOptions = this.getNodeParameter('additionalOptions', i, {});
|
|
45
|
+
const containerBody = { image_url: imageUrl };
|
|
46
|
+
if (caption)
|
|
47
|
+
containerBody.caption = caption;
|
|
48
|
+
if (additionalOptions.alt_text_wrap)
|
|
49
|
+
containerBody.alt_text_wrap = additionalOptions.alt_text_wrap;
|
|
50
|
+
if (additionalOptions.location_id)
|
|
51
|
+
containerBody.location_id = additionalOptions.location_id;
|
|
52
|
+
const parsedTags = parseUserTags(additionalOptions.user_tags, this.getNode());
|
|
53
|
+
if (parsedTags)
|
|
54
|
+
containerBody.user_tags = parsedTags;
|
|
55
|
+
const container = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${resolvedUserId}/media`, containerBody);
|
|
56
|
+
return await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${resolvedUserId}/media_publish`, {
|
|
57
|
+
creation_id: container.id,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
async function handlePublishVideo(i) {
|
|
61
|
+
const rawUserId = this.getNodeParameter('userId', i, 'me');
|
|
62
|
+
const resolvedUserId = await GenericFunctions_1.getResolvedUserId.call(this, rawUserId);
|
|
63
|
+
const videoUrl = this.getNodeParameter('videoUrl', i);
|
|
64
|
+
const mediaType = this.getNodeParameter('mediaType', i, 'REELS');
|
|
65
|
+
const caption = this.getNodeParameter('caption', i, '');
|
|
66
|
+
const additionalOptions = this.getNodeParameter('additionalOptions', i, {});
|
|
67
|
+
const containerBody = {
|
|
68
|
+
media_type: mediaType,
|
|
69
|
+
video_url: videoUrl,
|
|
70
|
+
};
|
|
71
|
+
if (caption)
|
|
72
|
+
containerBody.caption = caption;
|
|
73
|
+
if (additionalOptions.cover_url)
|
|
74
|
+
containerBody.cover_url = additionalOptions.cover_url;
|
|
75
|
+
if (additionalOptions.thumb_offset)
|
|
76
|
+
containerBody.thumb_offset = additionalOptions.thumb_offset;
|
|
77
|
+
if (additionalOptions.location_id)
|
|
78
|
+
containerBody.location_id = additionalOptions.location_id;
|
|
79
|
+
if (additionalOptions.share_to_feed !== undefined) {
|
|
80
|
+
containerBody.share_to_feed = additionalOptions.share_to_feed;
|
|
81
|
+
}
|
|
82
|
+
if (additionalOptions.audio_name)
|
|
83
|
+
containerBody.audio_name = additionalOptions.audio_name;
|
|
84
|
+
const container = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${resolvedUserId}/media`, containerBody);
|
|
85
|
+
await GenericFunctions_1.pollMediaContainerStatus.call(this, container.id);
|
|
86
|
+
return await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${resolvedUserId}/media_publish`, {
|
|
87
|
+
creation_id: container.id,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
async function createSingleCarouselItem(resolvedUserId, item) {
|
|
91
|
+
const isImage = item.mediaType === 'IMAGE';
|
|
92
|
+
const itemBody = {
|
|
93
|
+
is_carousel_item: true,
|
|
94
|
+
...(isImage
|
|
95
|
+
? { image_url: item.url, ...(item.altText ? { alt_text_wrap: item.altText } : {}) }
|
|
96
|
+
: { media_type: 'VIDEO', video_url: item.url }),
|
|
97
|
+
};
|
|
98
|
+
const itemContainer = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${resolvedUserId}/media`, itemBody);
|
|
99
|
+
if (!isImage) {
|
|
100
|
+
await GenericFunctions_1.pollMediaContainerStatus.call(this, itemContainer.id);
|
|
101
|
+
}
|
|
102
|
+
return itemContainer.id;
|
|
103
|
+
}
|
|
104
|
+
async function handlePublishCarousel(i) {
|
|
105
|
+
const rawUserId = this.getNodeParameter('userId', i, 'me');
|
|
106
|
+
const resolvedUserId = await GenericFunctions_1.getResolvedUserId.call(this, rawUserId);
|
|
107
|
+
const caption = this.getNodeParameter('caption', i, '');
|
|
108
|
+
const carouselItems = this.getNodeParameter('carouselItems', i, {});
|
|
109
|
+
const additionalOptions = this.getNodeParameter('additionalOptions', i, {});
|
|
110
|
+
const itemsList = carouselItems.item || [];
|
|
111
|
+
if (itemsList.length < 2 || itemsList.length > 10) {
|
|
112
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Instagram Carousel requires between 2 and 10 media items.', { itemIndex: i });
|
|
113
|
+
}
|
|
114
|
+
const childrenIds = [];
|
|
115
|
+
for (const item of itemsList) {
|
|
116
|
+
const containerId = await createSingleCarouselItem.call(this, resolvedUserId, item);
|
|
117
|
+
childrenIds.push(containerId);
|
|
118
|
+
}
|
|
119
|
+
const carouselBody = {
|
|
120
|
+
media_type: 'CAROUSEL',
|
|
121
|
+
children: childrenIds.join(','),
|
|
122
|
+
};
|
|
123
|
+
if (caption)
|
|
124
|
+
carouselBody.caption = caption;
|
|
125
|
+
if (additionalOptions.location_id)
|
|
126
|
+
carouselBody.location_id = additionalOptions.location_id;
|
|
127
|
+
const carouselContainer = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${resolvedUserId}/media`, carouselBody);
|
|
128
|
+
return await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${resolvedUserId}/media_publish`, {
|
|
129
|
+
creation_id: carouselContainer.id,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
async function handlePublishStory(i) {
|
|
133
|
+
const rawUserId = this.getNodeParameter('userId', i, 'me');
|
|
134
|
+
const resolvedUserId = await GenericFunctions_1.getResolvedUserId.call(this, rawUserId);
|
|
135
|
+
const storyMediaType = this.getNodeParameter('storyMediaType', i, 'IMAGE');
|
|
136
|
+
const mediaUrl = this.getNodeParameter('mediaUrl', i);
|
|
137
|
+
const isImage = storyMediaType === 'IMAGE';
|
|
138
|
+
const storyBody = {
|
|
139
|
+
media_type: 'STORIES',
|
|
140
|
+
...(isImage ? { image_url: mediaUrl } : { video_url: mediaUrl }),
|
|
141
|
+
};
|
|
142
|
+
const container = await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${resolvedUserId}/media`, storyBody);
|
|
143
|
+
if (!isImage) {
|
|
144
|
+
await GenericFunctions_1.pollMediaContainerStatus.call(this, container.id);
|
|
145
|
+
}
|
|
146
|
+
return await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${resolvedUserId}/media_publish`, {
|
|
147
|
+
creation_id: container.id,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
async function handleDeleteMedia(i) {
|
|
151
|
+
const mediaId = this.getNodeParameter('mediaId', i);
|
|
152
|
+
return await GenericFunctions_1.instagramApiRequest.call(this, 'DELETE', `/${mediaId}`);
|
|
153
|
+
}
|
|
154
|
+
const mediaOperationHandlers = {
|
|
155
|
+
get: handleGetMedia,
|
|
156
|
+
getAll: handleGetAllMedia,
|
|
157
|
+
publishPhoto: handlePublishPhoto,
|
|
158
|
+
publishVideo: handlePublishVideo,
|
|
159
|
+
publishCarousel: handlePublishCarousel,
|
|
160
|
+
publishStory: handlePublishStory,
|
|
161
|
+
delete: handleDeleteMedia,
|
|
162
|
+
};
|
|
163
|
+
async function handleMedia(operation, i) {
|
|
164
|
+
const handler = mediaOperationHandlers[operation];
|
|
165
|
+
if (!handler) {
|
|
166
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported Media operation: ${operation}`, {
|
|
167
|
+
itemIndex: i,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
return await handler.call(this, i);
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=MediaHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MediaHandler.js","sourceRoot":"","sources":["../../../../nodes/Instagram/handlers/MediaHandler.ts"],"names":[],"mappings":";;AAoPA,kCAYC;AAhQD,+CAIsB;AACtB,0DAM6B;AAE7B,MAAM,uBAAuB,GAC3B,4LAA4L,CAAC;AAE/L,MAAM,wBAAwB,GAC5B,gHAAgH,CAAC;AAQnH,KAAK,UAAU,cAAc,CAA0B,CAAS;IAC9D,MAAM,OAAO,GAAG,IAAI,C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,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleMention = handleMention;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const GenericFunctions_1 = require("../GenericFunctions");
|
|
6
|
+
async function handleGetMentionedMedia(i) {
|
|
7
|
+
const rawUserId = this.getNodeParameter('userId', i, 'me');
|
|
8
|
+
const resolvedUserId = await GenericFunctions_1.getResolvedUserId.call(this, rawUserId);
|
|
9
|
+
const returnAll = this.getNodeParameter('returnAll', i, false);
|
|
10
|
+
const limit = returnAll ? undefined : this.getNodeParameter('limit', i, 50);
|
|
11
|
+
return await GenericFunctions_1.instagramApiRequestAllItems.call(this, 'data', 'GET', `/${resolvedUserId}/tags`, {}, { fields: 'id,caption,media_type,media_url,permalink,timestamp,username' }, limit);
|
|
12
|
+
}
|
|
13
|
+
async function handleGetMentionedComment(i) {
|
|
14
|
+
const rawUserId = this.getNodeParameter('userId', i, 'me');
|
|
15
|
+
const resolvedUserId = await GenericFunctions_1.getResolvedUserId.call(this, rawUserId);
|
|
16
|
+
const commentId = this.getNodeParameter('commentId', i);
|
|
17
|
+
return await GenericFunctions_1.instagramApiRequest.call(this, 'GET', `/${resolvedUserId}/mentioned_comment`, {}, {
|
|
18
|
+
comment_id: commentId,
|
|
19
|
+
fields: 'id,text,timestamp,media{id,permalink}',
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
async function handleReplyToMention(i) {
|
|
23
|
+
const rawUserId = this.getNodeParameter('userId', i, 'me');
|
|
24
|
+
const resolvedUserId = await GenericFunctions_1.getResolvedUserId.call(this, rawUserId);
|
|
25
|
+
const mentionTargetType = this.getNodeParameter('mentionTargetType', i);
|
|
26
|
+
const targetId = this.getNodeParameter('targetId', i);
|
|
27
|
+
const message = this.getNodeParameter('message', i);
|
|
28
|
+
const body = {
|
|
29
|
+
message,
|
|
30
|
+
...(mentionTargetType === 'media' ? { media_id: targetId } : { comment_id: targetId }),
|
|
31
|
+
};
|
|
32
|
+
return await GenericFunctions_1.instagramApiRequest.call(this, 'POST', `/${resolvedUserId}/mentions`, body);
|
|
33
|
+
}
|
|
34
|
+
const mentionOperationHandlers = {
|
|
35
|
+
getMentionedMedia: handleGetMentionedMedia,
|
|
36
|
+
getMentionedComment: handleGetMentionedComment,
|
|
37
|
+
replyToMention: handleReplyToMention,
|
|
38
|
+
};
|
|
39
|
+
async function handleMention(operation, i) {
|
|
40
|
+
const handler = mentionOperationHandlers[operation];
|
|
41
|
+
if (!handler) {
|
|
42
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported Mention operation: ${operation}`, {
|
|
43
|
+
itemIndex: i,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return await handler.call(this, i);
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=MentionHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MentionHandler.js","sourceRoot":"","sources":["../../../../nodes/Instagram/handlers/MentionHandler.ts"],"names":[],"mappings":";;AAsEA,sCAYC;AAlFD,+CAAkF;AAClF,0DAI6B;AAE7B,KAAK,UAAU,uBAAuB,CAA0B,CAAS;IACvE,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAW,CAAC;IACrE,MAAM,cAAc,GAAG,MAAM,oCAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACrE,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,EAAE,KAAK,CAAY,CAAC;IAC1E,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE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B,OAAO;QACP,GAAG,CAAC,iBAAiB,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;KACvF,CAAC;IAEF,OAAO,MAAM,sCAAmB,CAAC,IAAI,CACnC,IAAI,EACJ,MAAM,EACN,IAAI,cAAc,WAAW,EAC7B,IAAI,CACL,CAAC;AACJ,CAAC;AAED,MAAM,wBAAwB,GAG1B;IACF,iBAAiB,EAAE,uBAAuB;IAC1C,mBAAmB,EAAE,yBAAyB;IAC9C,cAAc,EAAE,oBAAoB;CACrC,CAAC;AAEK,KAAK,UAAU,aAAa,CAEjC,SAAiB,EACjB,CAAS;IAET,MAAM,OAAO,GAAG,wBAAwB,CAAC,SAAS,CAAC,CAAC;IACpD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,kCAAkC,SAAS,EAAE,EAAE;YAC1F,SAAS,EAAE,CAAC;SACb,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleMessage = handleMessage;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const GenericFunctions_1 = require("../GenericFunctions");
|
|
6
|
+
async function handleSendTextMessage(i) {
|
|
7
|
+
const recipientId = this.getNodeParameter('recipientId', i);
|
|
8
|
+
const text = this.getNodeParameter('text', i);
|
|
9
|
+
return await GenericFunctions_1.instagramApiRequest.call(this, 'POST', '/me/messages', {
|
|
10
|
+
recipient: { id: recipientId },
|
|
11
|
+
message: { text },
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
async function handleSendMediaMessage(i) {
|
|
15
|
+
const recipientId = this.getNodeParameter('recipientId', i);
|
|
16
|
+
const attachmentType = this.getNodeParameter('attachmentType', i);
|
|
17
|
+
const mediaUrl = this.getNodeParameter('mediaUrl', i);
|
|
18
|
+
return await GenericFunctions_1.instagramApiRequest.call(this, 'POST', '/me/messages', {
|
|
19
|
+
recipient: { id: recipientId },
|
|
20
|
+
message: {
|
|
21
|
+
attachment: {
|
|
22
|
+
type: attachmentType,
|
|
23
|
+
payload: {
|
|
24
|
+
url: mediaUrl,
|
|
25
|
+
is_reusable: true,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
async function handleGetConversations(i) {
|
|
32
|
+
const returnAll = this.getNodeParameter('returnAll', i, false);
|
|
33
|
+
const limit = returnAll ? undefined : this.getNodeParameter('limit', i, 50);
|
|
34
|
+
return await GenericFunctions_1.instagramApiRequestAllItems.call(this, 'data', 'GET', '/me/conversations', {}, { fields: 'id,updated_time,participants' }, limit);
|
|
35
|
+
}
|
|
36
|
+
async function handleGetMessages(i) {
|
|
37
|
+
const conversationId = this.getNodeParameter('conversationId', i);
|
|
38
|
+
const returnAll = this.getNodeParameter('returnAll', i, false);
|
|
39
|
+
const limit = returnAll ? undefined : this.getNodeParameter('limit', i, 50);
|
|
40
|
+
return await GenericFunctions_1.instagramApiRequestAllItems.call(this, 'data', 'GET', `/${conversationId}/messages`, {}, { fields: 'id,created_time,from,to,message,attachments' }, limit);
|
|
41
|
+
}
|
|
42
|
+
const messageOperationHandlers = {
|
|
43
|
+
sendText: handleSendTextMessage,
|
|
44
|
+
sendMedia: handleSendMediaMessage,
|
|
45
|
+
getConversations: handleGetConversations,
|
|
46
|
+
getMessages: handleGetMessages,
|
|
47
|
+
};
|
|
48
|
+
async function handleMessage(operation, i) {
|
|
49
|
+
const handler = messageOperationHandlers[operation];
|
|
50
|
+
if (!handler) {
|
|
51
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported Message operation: ${operation}`, {
|
|
52
|
+
itemIndex: i,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return await handler.call(this, i);
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=MessageHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageHandler.js","sourceRoot":"","sources":["../../../../nodes/Instagram/handlers/MessageHandler.ts"],"names":[],"mappings":";;AA4EA,sCAYC;AAxFD,+CAAqE;AACrE,0DAG6B;AAE7B,KAAK,UAAU,qBAAqB,CAA0B,CAAS;IACrE,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,CAAC,CAAW,CAAC;IACtE,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAW,CAAC;IAExD,OAAO,MAAM,sCAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE;QAClE,SAAS,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE;QAC9B,OAAO,EAAE,EAAE,IAAI,EAAE;KAClB,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,sBAAsB,CAA0B,CAAS;IACtE,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,CAAC,CAAW,CAAC;IACtE,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,CAAC,CAAW,CAAC;IAC5E,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC,CAAW,CAAC;IAEhE,OAAO,MAAM,sCAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE;QAClE,SAAS,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE;QAC9B,OAAO,EAAE;YACP,UAAU,EAAE;gBACV,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE;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EK,KAAK,UAAU,aAAa,CAEjC,SAAiB,EACjB,CAAS;IAET,MAAM,OAAO,GAAG,wBAAwB,CAAC,SAAS,CAAC,CAAC;IACpD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,kCAAkC,SAAS,EAAE,EAAE;YAC1F,SAAS,EAAE,CAAC;SACb,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleUser = handleUser;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const GenericFunctions_1 = require("../GenericFunctions");
|
|
6
|
+
const ALL_USER_FIELDS = 'id,user_id,username,name,account_type,profile_picture_url,followers_count,follows_count,media_count,biography,website';
|
|
7
|
+
// graph.facebook.com (Unified Login) does not expose the Instagram Login-only fields user_id and account_type
|
|
8
|
+
const ALL_USER_FIELDS_UNIFIED_LOGIN = 'id,username,name,profile_picture_url,followers_count,follows_count,media_count,biography,website';
|
|
9
|
+
const ALL_USER_INSIGHTS_METRICS = 'reach,views,accounts_engaged,total_interactions,likes,comments,shares,saves,replies,profile_views,website_clicks,content_views';
|
|
10
|
+
async function handleGetUserProfile(operation, i) {
|
|
11
|
+
const allFields = (await GenericFunctions_1.isUnifiedLogin.call(this))
|
|
12
|
+
? ALL_USER_FIELDS_UNIFIED_LOGIN
|
|
13
|
+
: ALL_USER_FIELDS;
|
|
14
|
+
const fields = GenericFunctions_1.resolveParameterList.call(this, i, allFields, 'fields', 'fieldsMode');
|
|
15
|
+
const endpoint = operation === 'getMe' ? '/me' : `/${this.getNodeParameter('userId', i)}`;
|
|
16
|
+
return await GenericFunctions_1.instagramApiRequest.call(this, 'GET', endpoint, {}, { fields });
|
|
17
|
+
}
|
|
18
|
+
async function handleGetUserInsights(_operation, i) {
|
|
19
|
+
const rawUserId = this.getNodeParameter('userId', i, 'me');
|
|
20
|
+
const resolvedUserId = await GenericFunctions_1.getResolvedUserId.call(this, rawUserId);
|
|
21
|
+
const metric = GenericFunctions_1.resolveParameterList.call(this, i, ALL_USER_INSIGHTS_METRICS, 'metrics', 'metricsMode');
|
|
22
|
+
const period = this.getNodeParameter('period', i, 'day');
|
|
23
|
+
const additionalFields = this.getNodeParameter('additionalFields', i, {});
|
|
24
|
+
const qs = { metric, period };
|
|
25
|
+
if (additionalFields.since)
|
|
26
|
+
qs.since = additionalFields.since;
|
|
27
|
+
if (additionalFields.until)
|
|
28
|
+
qs.until = additionalFields.until;
|
|
29
|
+
if (additionalFields.metric_type && additionalFields.metric_type !== 'default') {
|
|
30
|
+
qs.metric_type = additionalFields.metric_type;
|
|
31
|
+
}
|
|
32
|
+
return await GenericFunctions_1.instagramApiRequest.call(this, 'GET', `/${resolvedUserId}/insights`, {}, qs);
|
|
33
|
+
}
|
|
34
|
+
const userOperationHandlers = {
|
|
35
|
+
getMe: handleGetUserProfile,
|
|
36
|
+
get: handleGetUserProfile,
|
|
37
|
+
getInsights: handleGetUserInsights,
|
|
38
|
+
};
|
|
39
|
+
async function handleUser(operation, i) {
|
|
40
|
+
const handler = userOperationHandlers[operation];
|
|
41
|
+
if (!handler) {
|
|
42
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported User operation: ${operation}`, {
|
|
43
|
+
itemIndex: i,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return await handler.call(this, operation, i);
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=UserHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserHandler.js","sourceRoot":"","sources":["../../../../nodes/Instagram/handlers/UserHandler.ts"],"names":[],"mappings":";;AA6DA,gCAYC;AAzED,+CAAkF;A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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/package.json
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xnkee/n8n-nodes-instagram",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "n8n community node for the Instagram API with Unified Login (Instagram or Facebook), Instagram Login (Business Login for Instagram) & AI Agent Tool",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
5
8
|
"keywords": [
|
|
6
9
|
"n8n-community-node-package",
|
|
10
|
+
"n8n",
|
|
7
11
|
"instagram",
|
|
8
|
-
"messaging",
|
|
9
12
|
"instagram-api",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
13
|
+
"instagram-login",
|
|
14
|
+
"unified-login",
|
|
15
|
+
"meta",
|
|
16
|
+
"business-login",
|
|
17
|
+
"ai-tool",
|
|
18
|
+
"ai-agent"
|
|
12
19
|
],
|
|
13
20
|
"license": "MIT",
|
|
14
21
|
"author": {
|
|
@@ -16,61 +23,41 @@
|
|
|
16
23
|
},
|
|
17
24
|
"contributors": [
|
|
18
25
|
{
|
|
19
|
-
"name": "
|
|
20
|
-
"email": "
|
|
21
|
-
"url": "https://github.com/
|
|
26
|
+
"name": "Rizki Firmansyah",
|
|
27
|
+
"email": "firmansyah720.fs@gmail.com",
|
|
28
|
+
"url": "https://github.com/legenhand/n8n-nodes-instagram-api"
|
|
22
29
|
}
|
|
23
30
|
],
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
"engines": {
|
|
28
|
-
"node": ">=20.15"
|
|
29
|
-
},
|
|
30
|
-
"main": "index.js",
|
|
31
|
-
"scripts": {
|
|
32
|
-
"build": "n8n-node build",
|
|
33
|
-
"build:watch": "tsc --watch",
|
|
34
|
-
"dev": "n8n-node dev",
|
|
35
|
-
"dev:manual": "npm run build && npm link && N8N_CUSTOM_EXTENSIONS=$(pwd) n8n start",
|
|
36
|
-
"link": "npm link",
|
|
37
|
-
"unlink": "npm unlink",
|
|
38
|
-
"format": "prettier nodes credentials --write",
|
|
39
|
-
"lint": "n8n-node lint",
|
|
40
|
-
"lintfix": "n8n-node lint --fix",
|
|
41
|
-
"test": "n8n-node test",
|
|
42
|
-
"release": "n8n-node release",
|
|
43
|
-
"prepublishOnly": "n8n-node prerelease"
|
|
44
|
-
},
|
|
31
|
+
"homepage": "https://www.npmjs.com/package/@xnkee/n8n-nodes-instagram",
|
|
32
|
+
"main": "dist/index.js",
|
|
45
33
|
"files": [
|
|
46
|
-
"dist"
|
|
47
|
-
"CHANGELOG.md",
|
|
48
|
-
"AUTHENTICATION_GUIDE.md",
|
|
49
|
-
"API_REFERENCE.md",
|
|
50
|
-
"CONTRIBUTING.md"
|
|
34
|
+
"dist"
|
|
51
35
|
],
|
|
52
36
|
"n8n": {
|
|
53
37
|
"n8nNodesApiVersion": 1,
|
|
54
38
|
"credentials": [
|
|
55
|
-
"dist/credentials/
|
|
56
|
-
"dist/credentials/InstagramOAuth2Api.credentials.js"
|
|
39
|
+
"dist/credentials/InstagramApi.credentials.js",
|
|
40
|
+
"dist/credentials/InstagramOAuth2Api.credentials.js",
|
|
41
|
+
"dist/credentials/InstagramUnifiedLoginOAuth2Api.credentials.js"
|
|
57
42
|
],
|
|
58
43
|
"nodes": [
|
|
59
|
-
"dist/nodes/Instagram/Instagram.node.js"
|
|
60
|
-
"dist/nodes/Instagram/InstagramTrigger.node.js"
|
|
44
|
+
"dist/nodes/Instagram/Instagram.node.js"
|
|
61
45
|
]
|
|
62
46
|
},
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"gulp": "^5.0.0",
|
|
70
|
-
"prettier": "^3.5.3",
|
|
71
|
-
"typescript": "^5.8.2"
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc && node scripts/copy-assets.mjs",
|
|
49
|
+
"dev": "tsc --watch",
|
|
50
|
+
"docs:dev": "bun --cwd docs dev",
|
|
51
|
+
"docs:build": "bun --cwd docs build",
|
|
52
|
+
"docs:preview": "bun --cwd docs preview"
|
|
72
53
|
},
|
|
73
54
|
"peerDependencies": {
|
|
74
55
|
"n8n-workflow": "*"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@n8n/node-cli": "^0.45.4",
|
|
59
|
+
"@types/node": "^20.17.19",
|
|
60
|
+
"n8n-workflow": "^1.78.0",
|
|
61
|
+
"typescript": "^5.7.3"
|
|
75
62
|
}
|
|
76
63
|
}
|