n8n-nodes-adaptlypost 0.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 +21 -0
- package/README.md +47 -0
- package/dist/credentials/AdaptlyPostApi.credentials.d.ts +10 -0
- package/dist/credentials/AdaptlyPostApi.credentials.js +38 -0
- package/dist/credentials/AdaptlyPostApi.credentials.js.map +1 -0
- package/dist/icons/adaptlypost.dark.svg +3 -0
- package/dist/icons/adaptlypost.svg +3 -0
- package/dist/nodes/AdaptlyPost/AdaptlyPost.node.d.ts +11 -0
- package/dist/nodes/AdaptlyPost/AdaptlyPost.node.js +245 -0
- package/dist/nodes/AdaptlyPost/AdaptlyPost.node.js.map +1 -0
- package/dist/nodes/AdaptlyPost/AdaptlyPost.node.json +18 -0
- package/dist/nodes/AdaptlyPost/AdaptlyPostTrigger.node.d.ts +12 -0
- package/dist/nodes/AdaptlyPost/AdaptlyPostTrigger.node.js +137 -0
- package/dist/nodes/AdaptlyPost/AdaptlyPostTrigger.node.js.map +1 -0
- package/dist/nodes/AdaptlyPost/AdaptlyPostTrigger.node.json +18 -0
- package/dist/nodes/AdaptlyPost/accounts.d.ts +19 -0
- package/dist/nodes/AdaptlyPost/accounts.js +65 -0
- package/dist/nodes/AdaptlyPost/accounts.js.map +1 -0
- package/dist/nodes/AdaptlyPost/analytics.properties.d.ts +2 -0
- package/dist/nodes/AdaptlyPost/analytics.properties.js +116 -0
- package/dist/nodes/AdaptlyPost/analytics.properties.js.map +1 -0
- package/dist/nodes/AdaptlyPost/media.d.ts +2 -0
- package/dist/nodes/AdaptlyPost/media.js +40 -0
- package/dist/nodes/AdaptlyPost/media.js.map +1 -0
- package/dist/nodes/AdaptlyPost/post.properties.d.ts +2 -0
- package/dist/nodes/AdaptlyPost/post.properties.js +316 -0
- package/dist/nodes/AdaptlyPost/post.properties.js.map +1 -0
- package/dist/nodes/AdaptlyPost/transport.d.ts +6 -0
- package/dist/nodes/AdaptlyPost/transport.js +17 -0
- package/dist/nodes/AdaptlyPost/transport.js.map +1 -0
- package/dist/package.json +54 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.connectionField = exports.PLATFORM_LABELS = exports.PLATFORMS = void 0;
|
|
4
|
+
exports.groupAccountsByPlatform = groupAccountsByPlatform;
|
|
5
|
+
exports.getAccounts = getAccounts;
|
|
6
|
+
const transport_1 = require("./transport");
|
|
7
|
+
exports.PLATFORMS = [
|
|
8
|
+
'FACEBOOK',
|
|
9
|
+
'INSTAGRAM',
|
|
10
|
+
'THREADS',
|
|
11
|
+
'TIKTOK',
|
|
12
|
+
'TWITTER',
|
|
13
|
+
'BLUESKY',
|
|
14
|
+
'LINKEDIN',
|
|
15
|
+
'PINTEREST',
|
|
16
|
+
'YOUTUBE',
|
|
17
|
+
];
|
|
18
|
+
exports.PLATFORM_LABELS = {
|
|
19
|
+
FACEBOOK: 'Facebook',
|
|
20
|
+
INSTAGRAM: 'Instagram',
|
|
21
|
+
THREADS: 'Threads',
|
|
22
|
+
TIKTOK: 'TikTok',
|
|
23
|
+
TWITTER: 'X (Twitter)',
|
|
24
|
+
BLUESKY: 'Bluesky',
|
|
25
|
+
LINKEDIN: 'LinkedIn',
|
|
26
|
+
PINTEREST: 'Pinterest',
|
|
27
|
+
YOUTUBE: 'YouTube',
|
|
28
|
+
};
|
|
29
|
+
const CONNECTION_ID_FIELD = {
|
|
30
|
+
INSTAGRAM: 'instagramConnectionIds',
|
|
31
|
+
THREADS: 'threadsConnectionIds',
|
|
32
|
+
TIKTOK: 'tiktokConnectionIds',
|
|
33
|
+
TWITTER: 'twitterConnectionIds',
|
|
34
|
+
BLUESKY: 'blueskyConnectionIds',
|
|
35
|
+
LINKEDIN: 'linkedinConnectionIds',
|
|
36
|
+
PINTEREST: 'pinterestConnectionIds',
|
|
37
|
+
YOUTUBE: 'youtubeConnectionIds',
|
|
38
|
+
};
|
|
39
|
+
const connectionField = (platform) => platform === 'FACEBOOK' ? 'pageIds' : CONNECTION_ID_FIELD[platform];
|
|
40
|
+
exports.connectionField = connectionField;
|
|
41
|
+
function groupAccountsByPlatform(selectedIds, accounts) {
|
|
42
|
+
var _a;
|
|
43
|
+
const byId = new Map(accounts.map((account) => [account.id, account]));
|
|
44
|
+
const targets = { platforms: [] };
|
|
45
|
+
for (const id of selectedIds) {
|
|
46
|
+
const account = byId.get(id);
|
|
47
|
+
if (!account) {
|
|
48
|
+
throw new Error(`Account ${id} is not connected to this AdaptlyPost workspace`);
|
|
49
|
+
}
|
|
50
|
+
if (!targets.platforms.includes(account.platform)) {
|
|
51
|
+
targets.platforms.push(account.platform);
|
|
52
|
+
}
|
|
53
|
+
const field = (0, exports.connectionField)(account.platform);
|
|
54
|
+
targets[field] = [...((_a = targets[field]) !== null && _a !== void 0 ? _a : []), account.id];
|
|
55
|
+
}
|
|
56
|
+
return targets;
|
|
57
|
+
}
|
|
58
|
+
async function getAccounts() {
|
|
59
|
+
const { accounts } = await transport_1.adaptlyPostApiRequest.call(this, 'GET', '/social-accounts');
|
|
60
|
+
return accounts.map((account) => ({
|
|
61
|
+
name: `${account.displayName} (${exports.PLATFORM_LABELS[account.platform]})`,
|
|
62
|
+
value: account.id,
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=accounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../../nodes/AdaptlyPost/accounts.ts"],"names":[],"mappings":";;;AA0DA,0DAoBC;AAED,kCAMC;AApFD,2CAAoD;AAEvC,QAAA,SAAS,GAAG;IACxB,UAAU;IACV,WAAW;IACX,SAAS;IACT,QAAQ;IACR,SAAS;IACT,SAAS;IACT,UAAU;IACV,WAAW;IACX,SAAS;CACA,CAAC;AAIE,QAAA,eAAe,GAA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AAC,QAAQ,CAAC,EAAE,CAAC;YACnD,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC1C,CAAC;QACD,MAAM,KAAK,GAAG,IAAA,uBAAe,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAChD,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,MAAA,OAAO,CAAC,KAAK,CAAC,mCAAI,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,OAAO,OAAO,CAAC;AAChB,CAAC;AAEM,KAAK,UAAU,WAAW;IAChC,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,iCAAqB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,kBAAkB,CAAC,CAAC;IACvF,OAAQ,QAA4B,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QACtD,IAAI,EAAE,GAAG,OAAO,CAAC,WAAW,KAAK,uBAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG;QACrE,KAAK,EAAE,OAAO,CAAC,EAAE;KACjB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.analyticsProperties = void 0;
|
|
4
|
+
const onlyAnalytics = { resource: ['analytics'] };
|
|
5
|
+
exports.analyticsProperties = [
|
|
6
|
+
{
|
|
7
|
+
displayName: 'Operation',
|
|
8
|
+
name: 'operation',
|
|
9
|
+
type: 'options',
|
|
10
|
+
noDataExpression: true,
|
|
11
|
+
displayOptions: { show: onlyAnalytics },
|
|
12
|
+
options: [
|
|
13
|
+
{
|
|
14
|
+
name: 'Get Overview',
|
|
15
|
+
value: 'overview',
|
|
16
|
+
action: 'Get an analytics overview',
|
|
17
|
+
description: 'Workspace totals for a date window with a comparison to the previous window',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'Get Platform Breakdown',
|
|
21
|
+
value: 'platformBreakdown',
|
|
22
|
+
action: 'Get a platform breakdown',
|
|
23
|
+
description: 'The overview metrics, one row per platform',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'Get Post Analytics',
|
|
27
|
+
value: 'posts',
|
|
28
|
+
action: 'Get per post analytics',
|
|
29
|
+
description: 'Metrics for every tracked post published in the window',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'Get Timeseries',
|
|
33
|
+
value: 'timeseries',
|
|
34
|
+
action: 'Get an analytics timeseries',
|
|
35
|
+
description: 'Metrics bucketed by day, week or month',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
default: 'overview',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
displayName: 'From',
|
|
42
|
+
name: 'from',
|
|
43
|
+
type: 'dateTime',
|
|
44
|
+
required: true,
|
|
45
|
+
default: '',
|
|
46
|
+
displayOptions: { show: onlyAnalytics },
|
|
47
|
+
description: 'Start of the reporting window',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
displayName: 'To',
|
|
51
|
+
name: 'to',
|
|
52
|
+
type: 'dateTime',
|
|
53
|
+
required: true,
|
|
54
|
+
default: '',
|
|
55
|
+
displayOptions: { show: onlyAnalytics },
|
|
56
|
+
description: 'End of the reporting window',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
displayName: 'Platforms',
|
|
60
|
+
name: 'platforms',
|
|
61
|
+
type: 'multiOptions',
|
|
62
|
+
options: [
|
|
63
|
+
{ name: 'Bluesky', value: 'BLUESKY' },
|
|
64
|
+
{ name: 'Facebook', value: 'FACEBOOK' },
|
|
65
|
+
{ name: 'Instagram', value: 'INSTAGRAM' },
|
|
66
|
+
{ name: 'LinkedIn', value: 'LINKEDIN' },
|
|
67
|
+
{ name: 'Pinterest', value: 'PINTEREST' },
|
|
68
|
+
{ name: 'Threads', value: 'THREADS' },
|
|
69
|
+
{ name: 'TikTok', value: 'TIKTOK' },
|
|
70
|
+
{ name: 'YouTube', value: 'YOUTUBE' },
|
|
71
|
+
],
|
|
72
|
+
default: [],
|
|
73
|
+
displayOptions: { show: onlyAnalytics },
|
|
74
|
+
description: 'Leave empty for every platform with analytics',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
displayName: 'Interval',
|
|
78
|
+
name: 'interval',
|
|
79
|
+
type: 'options',
|
|
80
|
+
options: [
|
|
81
|
+
{ name: 'Day', value: 'DAY' },
|
|
82
|
+
{ name: 'Month', value: 'MONTH' },
|
|
83
|
+
{ name: 'Week', value: 'WEEK' },
|
|
84
|
+
],
|
|
85
|
+
default: 'DAY',
|
|
86
|
+
displayOptions: { show: { resource: ['analytics'], operation: ['timeseries'] } },
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
displayName: 'Sort By',
|
|
90
|
+
name: 'sortBy',
|
|
91
|
+
type: 'options',
|
|
92
|
+
options: [
|
|
93
|
+
{ name: 'Clicks', value: 'CLICKS' },
|
|
94
|
+
{ name: 'Comments', value: 'COMMENTS' },
|
|
95
|
+
{ name: 'Engagement Rate', value: 'ENGAGEMENT_RATE' },
|
|
96
|
+
{ name: 'Impressions', value: 'IMPRESSIONS' },
|
|
97
|
+
{ name: 'Likes', value: 'LIKES' },
|
|
98
|
+
{ name: 'Published At', value: 'PUBLISHED_AT' },
|
|
99
|
+
{ name: 'Saves', value: 'SAVES' },
|
|
100
|
+
{ name: 'Shares', value: 'SHARES' },
|
|
101
|
+
{ name: 'Views', value: 'VIEWS' },
|
|
102
|
+
],
|
|
103
|
+
default: 'PUBLISHED_AT',
|
|
104
|
+
displayOptions: { show: { resource: ['analytics'], operation: ['posts'] } },
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
displayName: 'Limit',
|
|
108
|
+
name: 'limit',
|
|
109
|
+
type: 'number',
|
|
110
|
+
typeOptions: { minValue: 1 },
|
|
111
|
+
default: 50,
|
|
112
|
+
displayOptions: { show: { resource: ['analytics'], operation: ['posts'] } },
|
|
113
|
+
description: 'Max number of results to return',
|
|
114
|
+
},
|
|
115
|
+
];
|
|
116
|
+
//# sourceMappingURL=analytics.properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.properties.js","sourceRoot":"","sources":["../../../nodes/AdaptlyPost/analytics.properties.ts"],"names":[],"mappings":";;;AAEA,MAAM,aAAa,GAAG,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC;AAErC,QAAA,mBAAmB,GAAsB;IACrD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE;QACvC,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,UAAU;gBACjB,MAAM,EAAE,2BAA2B;gBACnC,WAAW,EAAE,6EAA6E;aAC1F;YACD;gBACC,IAAI,EAAE,wBAAwB;gBAC9B,KAAK,EAAE,mBAAmB;gBAC1B,MAAM,EAAE,0BAA0B;gBAClC,WAAW,EAAE,4CAA4C;aACzD;YACD;gBACC,IAAI,EAAE,oBAAoB;gBAC1B,KAAK,EAAE,OAAO;gBACd,MAAM,EAAE,wBAAwB;gBAChC,WAAW,EAAE,wDAAwD;aACrE;YACD;gBACC,IAAI,EAAE,gBAAgB;gBACtB,KAAK,EAAE,YAAY;gBACnB,MAAM,EAAE,6BAA6B;gBACrC,WAAW,EAAE,wCAAwC;aACrD;SACD;QACD,OAAO,EAAE,UAAU;KACnB;IACD;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE,EAAE,IAAI,EAAE,aAAa,E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CACD,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uploadMediaFromUrl = uploadMediaFromUrl;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const transport_1 = require("./transport");
|
|
6
|
+
const SUPPORTED_MEDIA_TYPES = {
|
|
7
|
+
'image/jpeg': '.jpg',
|
|
8
|
+
'image/png': '.png',
|
|
9
|
+
'image/webp': '.webp',
|
|
10
|
+
'video/mp4': '.mp4',
|
|
11
|
+
'video/quicktime': '.mov',
|
|
12
|
+
};
|
|
13
|
+
const isSupported = (value) => value in SUPPORTED_MEDIA_TYPES;
|
|
14
|
+
async function uploadMediaFromUrl(sourceUrl, itemIndex) {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
const source = await this.helpers.httpRequest({
|
|
17
|
+
url: sourceUrl,
|
|
18
|
+
encoding: 'arraybuffer',
|
|
19
|
+
returnFullResponse: true,
|
|
20
|
+
});
|
|
21
|
+
const headers = source.headers;
|
|
22
|
+
const mimeType = ((_a = headers['content-type']) !== null && _a !== void 0 ? _a : '').split(';')[0].trim().toLowerCase();
|
|
23
|
+
if (!isSupported(mimeType)) {
|
|
24
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `${sourceUrl} is served as "${mimeType || 'unknown'}". AdaptlyPost accepts JPEG, PNG, WebP, MP4 and QuickTime.`, { itemIndex });
|
|
25
|
+
}
|
|
26
|
+
const bytes = Buffer.from(source.body);
|
|
27
|
+
const stem = ((_b = new URL(sourceUrl).pathname.split('/').pop()) === null || _b === void 0 ? void 0 : _b.replace(/\.[^.]*$/, '')) || 'upload';
|
|
28
|
+
const { urls } = await transport_1.adaptlyPostApiRequest.call(this, 'POST', '/upload-urls', {
|
|
29
|
+
files: [{ fileName: `${stem}${SUPPORTED_MEDIA_TYPES[mimeType]}`, mimeType }],
|
|
30
|
+
});
|
|
31
|
+
const slot = urls[0];
|
|
32
|
+
await this.helpers.httpRequest({
|
|
33
|
+
method: 'PUT',
|
|
34
|
+
url: slot.uploadUrl,
|
|
35
|
+
body: bytes,
|
|
36
|
+
headers: { 'Content-Type': mimeType, 'Content-Length': String(bytes.length) },
|
|
37
|
+
});
|
|
38
|
+
return slot.publicUrl;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=media.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../../nodes/AdaptlyPost/media.ts"],"names":[],"mappings":";;AAsBA,gDAmCC;AAxDD,+CAAkD;AAElD,2CAAoD;AAEpD,MAAM,qBAAqB,GAAG;IAC7B,YAAY,EAAE,MAAM;IACpB,WAAW,EAAE,MAAM;IACnB,YAAY,EAAE,OAAO;IACrB,WAAW,EAAE,MAAM;IACnB,iBAAiB,EAAE,MAAM;CAChB,CAAC;AAIX,MAAM,WAAW,GAAG,CAAC,KAAa,EAAsB,EAAE,CAAC,KAAK,IAAI,qBAAqB,CAAC;AAOnF,KAAK,UAAU,kBAAkB,CAEvC,SAAiB,EACjB,SAAiB;;IAEjB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;QAC7C,GAAG,EAAE,SAAS;QACd,QAAQ,EAAE,aAAa;QACvB,kBAAkB,EAAE,IAAI;KACxB,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,MAAM,CAAC,OAA6C,CAAC;IACrE,MAAM,QAAQ,GAAG,CAAC,MAAA,OAAO,CAAC,cAAc,CAAC,mCAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACpF,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,GAAG,SAAS,kBAAkB,QAAQ,IAAI,SAAS,4DAA4D,EAC/G,EAAE,SAAS,EAAE,CACb,CAAC;IACH,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAmB,CAAC,CAAC;IACtD,MAAM,IAAI,GAAG,CAAA,MAAA,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,0CAAE,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,KAAI,QAAQ,CAAC;IAC/F,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,iCAAqB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE;QAC/E,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,GAAG,qBAAqB,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC;KAC5E,CAAC,CAAC;IACH,MAAM,IAAI,GAAI,IAAqB,CAAC,CAAC,CAAC,CAAC;IAEvC,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;QAC9B,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,IAAI,CAAC,SAAS;QACnB,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,EAAE,cAAc,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;KAC7E,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC,SAAS,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.postProperties = void 0;
|
|
4
|
+
const onlyPosts = { resource: ['post'] };
|
|
5
|
+
const withPostId = { resource: ['post'], operation: ['delete', 'get', 'getResults', 'publishDraft', 'retry'] };
|
|
6
|
+
exports.postProperties = [
|
|
7
|
+
{
|
|
8
|
+
displayName: 'Operation',
|
|
9
|
+
name: 'operation',
|
|
10
|
+
type: 'options',
|
|
11
|
+
noDataExpression: true,
|
|
12
|
+
displayOptions: { show: onlyPosts },
|
|
13
|
+
options: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Create',
|
|
16
|
+
value: 'create',
|
|
17
|
+
action: 'Create a post',
|
|
18
|
+
description: 'Publish now, schedule, or save a draft on one or more accounts',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Delete',
|
|
22
|
+
value: 'delete',
|
|
23
|
+
action: 'Delete a post',
|
|
24
|
+
description: 'Delete a draft or scheduled post',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Get',
|
|
28
|
+
value: 'get',
|
|
29
|
+
action: 'Get a post',
|
|
30
|
+
description: 'Get one post with its per-platform status',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Get Many',
|
|
34
|
+
value: 'getAll',
|
|
35
|
+
action: 'Get many posts',
|
|
36
|
+
description: 'List posts, newest first',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'Get Results',
|
|
40
|
+
value: 'getResults',
|
|
41
|
+
action: 'Get publishing results of a post',
|
|
42
|
+
description: 'Get the publishing outcome of a post on each platform',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'Publish Draft',
|
|
46
|
+
value: 'publishDraft',
|
|
47
|
+
action: 'Publish a draft post',
|
|
48
|
+
description: 'Publish a draft now or schedule it',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'Retry Failed Platforms',
|
|
52
|
+
value: 'retry',
|
|
53
|
+
action: 'Retry failed platforms of a post',
|
|
54
|
+
description: 'Re-queue publishing for every platform that failed',
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
default: 'create',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
displayName: 'Post ID',
|
|
61
|
+
name: 'postId',
|
|
62
|
+
type: 'string',
|
|
63
|
+
required: true,
|
|
64
|
+
default: '',
|
|
65
|
+
displayOptions: { show: withPostId },
|
|
66
|
+
description: 'ID returned when the post was created, or from Get Many',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
displayName: 'Account Names or IDs',
|
|
70
|
+
name: 'accountIds',
|
|
71
|
+
type: 'multiOptions',
|
|
72
|
+
required: true,
|
|
73
|
+
default: [],
|
|
74
|
+
typeOptions: { loadOptionsMethod: 'getAccounts' },
|
|
75
|
+
displayOptions: { show: { resource: ['post'], operation: ['create'] } },
|
|
76
|
+
description: 'Connected accounts to post from. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
displayName: 'Content Type',
|
|
80
|
+
name: 'contentType',
|
|
81
|
+
type: 'options',
|
|
82
|
+
options: [
|
|
83
|
+
{ name: 'Carousel', value: 'CAROUSEL' },
|
|
84
|
+
{ name: 'Image', value: 'IMAGE' },
|
|
85
|
+
{ name: 'Text', value: 'TEXT' },
|
|
86
|
+
{ name: 'Video', value: 'VIDEO' },
|
|
87
|
+
],
|
|
88
|
+
default: 'TEXT',
|
|
89
|
+
displayOptions: { show: { resource: ['post'], operation: ['create'] } },
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
displayName: 'Text',
|
|
93
|
+
name: 'text',
|
|
94
|
+
type: 'string',
|
|
95
|
+
typeOptions: { rows: 4 },
|
|
96
|
+
default: '',
|
|
97
|
+
displayOptions: { show: { resource: ['post'], operation: ['create'] } },
|
|
98
|
+
description: 'Caption shared across the selected platforms',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
displayName: 'Media URLs',
|
|
102
|
+
name: 'mediaUrls',
|
|
103
|
+
type: 'string',
|
|
104
|
+
default: '',
|
|
105
|
+
placeholder: 'https://example.com/photo.jpg, https://example.com/clip.mp4',
|
|
106
|
+
displayOptions: { show: { resource: ['post'], operation: ['create'] } },
|
|
107
|
+
description: 'Comma-separated public URLs of JPEG, PNG, WebP, MP4 or QuickTime files. Each file is copied into AdaptlyPost storage before posting.',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
displayName: 'Additional Fields',
|
|
111
|
+
name: 'additionalFields',
|
|
112
|
+
type: 'collection',
|
|
113
|
+
placeholder: 'Add Field',
|
|
114
|
+
default: {},
|
|
115
|
+
displayOptions: { show: { resource: ['post'], operation: ['create'] } },
|
|
116
|
+
options: [
|
|
117
|
+
{
|
|
118
|
+
displayName: 'Facebook Post Type',
|
|
119
|
+
name: 'facebookPostType',
|
|
120
|
+
type: 'options',
|
|
121
|
+
options: [
|
|
122
|
+
{ name: 'Feed', value: 'FEED' },
|
|
123
|
+
{ name: 'Reel', value: 'REEL' },
|
|
124
|
+
{ name: 'Story', value: 'STORY' },
|
|
125
|
+
],
|
|
126
|
+
default: 'FEED',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
displayName: 'Instagram Post Type',
|
|
130
|
+
name: 'instagramPostType',
|
|
131
|
+
type: 'options',
|
|
132
|
+
options: [
|
|
133
|
+
{ name: 'Feed', value: 'FEED' },
|
|
134
|
+
{ name: 'Reel', value: 'REEL' },
|
|
135
|
+
{ name: 'Story', value: 'STORY' },
|
|
136
|
+
],
|
|
137
|
+
default: 'FEED',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
displayName: 'Pinterest Board ID',
|
|
141
|
+
name: 'pinterestBoard',
|
|
142
|
+
type: 'string',
|
|
143
|
+
default: '',
|
|
144
|
+
description: 'Required when a Pinterest account is selected',
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
displayName: 'Pinterest Link',
|
|
148
|
+
name: 'pinterestLink',
|
|
149
|
+
type: 'string',
|
|
150
|
+
default: '',
|
|
151
|
+
description: 'Destination link for the pin',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
displayName: 'Save as Draft',
|
|
155
|
+
name: 'saveAsDraft',
|
|
156
|
+
type: 'boolean',
|
|
157
|
+
default: false,
|
|
158
|
+
description: 'Whether to store the post without publishing or scheduling it',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
displayName: 'Scheduled At',
|
|
162
|
+
name: 'scheduledAt',
|
|
163
|
+
type: 'dateTime',
|
|
164
|
+
default: '',
|
|
165
|
+
description: 'Leave empty to publish immediately',
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
displayName: 'TikTok Privacy',
|
|
169
|
+
name: 'tiktokPrivacyLevel',
|
|
170
|
+
type: 'options',
|
|
171
|
+
options: [
|
|
172
|
+
{ name: 'Followers', value: 'FOLLOWER_OF_CREATOR' },
|
|
173
|
+
{ name: 'Friends', value: 'MUTUAL_FOLLOW_FRIENDS' },
|
|
174
|
+
{ name: 'Only Me', value: 'SELF_ONLY' },
|
|
175
|
+
{ name: 'Public', value: 'PUBLIC_TO_EVERYONE' },
|
|
176
|
+
],
|
|
177
|
+
default: 'PUBLIC_TO_EVERYONE',
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
displayName: 'Timezone',
|
|
181
|
+
name: 'timezone',
|
|
182
|
+
type: 'string',
|
|
183
|
+
default: 'UTC',
|
|
184
|
+
description: 'IANA name such as America/New_York, stored with the post for display',
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
displayName: 'YouTube Format',
|
|
188
|
+
name: 'youtubePostType',
|
|
189
|
+
type: 'options',
|
|
190
|
+
options: [
|
|
191
|
+
{ name: 'Shorts', value: 'SHORTS' },
|
|
192
|
+
{ name: 'Video', value: 'VIDEO' },
|
|
193
|
+
],
|
|
194
|
+
default: 'VIDEO',
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
displayName: 'YouTube Privacy',
|
|
198
|
+
name: 'youtubePrivacyStatus',
|
|
199
|
+
type: 'options',
|
|
200
|
+
options: [
|
|
201
|
+
{ name: 'Private', value: 'private' },
|
|
202
|
+
{ name: 'Public', value: 'public' },
|
|
203
|
+
{ name: 'Unlisted', value: 'unlisted' },
|
|
204
|
+
],
|
|
205
|
+
default: 'public',
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
displayName: 'YouTube Video Title',
|
|
209
|
+
name: 'youtubeTitle',
|
|
210
|
+
type: 'string',
|
|
211
|
+
default: '',
|
|
212
|
+
},
|
|
213
|
+
],
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
displayName: 'Scheduled At',
|
|
217
|
+
name: 'scheduledAt',
|
|
218
|
+
type: 'dateTime',
|
|
219
|
+
default: '',
|
|
220
|
+
displayOptions: { show: { resource: ['post'], operation: ['publishDraft'] } },
|
|
221
|
+
description: 'Leave empty to publish immediately',
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
displayName: 'Timezone',
|
|
225
|
+
name: 'timezone',
|
|
226
|
+
type: 'string',
|
|
227
|
+
default: 'UTC',
|
|
228
|
+
displayOptions: { show: { resource: ['post'], operation: ['publishDraft'] } },
|
|
229
|
+
description: 'IANA name such as America/New_York',
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
displayName: 'Return All',
|
|
233
|
+
name: 'returnAll',
|
|
234
|
+
type: 'boolean',
|
|
235
|
+
default: false,
|
|
236
|
+
displayOptions: { show: { resource: ['post'], operation: ['getAll'] } },
|
|
237
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
displayName: 'Limit',
|
|
241
|
+
name: 'limit',
|
|
242
|
+
type: 'number',
|
|
243
|
+
typeOptions: { minValue: 1 },
|
|
244
|
+
default: 50,
|
|
245
|
+
displayOptions: { show: { resource: ['post'], operation: ['getAll'], returnAll: [false] } },
|
|
246
|
+
description: 'Max number of results to return',
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
displayName: 'Filters',
|
|
250
|
+
name: 'filters',
|
|
251
|
+
type: 'collection',
|
|
252
|
+
placeholder: 'Add Filter',
|
|
253
|
+
default: {},
|
|
254
|
+
displayOptions: { show: { resource: ['post'], operation: ['getAll'] } },
|
|
255
|
+
options: [
|
|
256
|
+
{
|
|
257
|
+
displayName: 'End Date',
|
|
258
|
+
name: 'endDate',
|
|
259
|
+
type: 'dateTime',
|
|
260
|
+
default: '',
|
|
261
|
+
description: 'Upper bound on the scheduled time, or creation time for posts never scheduled',
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
displayName: 'Platforms',
|
|
265
|
+
name: 'platforms',
|
|
266
|
+
type: 'multiOptions',
|
|
267
|
+
options: [
|
|
268
|
+
{ name: 'Bluesky', value: 'BLUESKY' },
|
|
269
|
+
{ name: 'Facebook', value: 'FACEBOOK' },
|
|
270
|
+
{ name: 'Instagram', value: 'INSTAGRAM' },
|
|
271
|
+
{ name: 'LinkedIn', value: 'LINKEDIN' },
|
|
272
|
+
{ name: 'Pinterest', value: 'PINTEREST' },
|
|
273
|
+
{ name: 'Threads', value: 'THREADS' },
|
|
274
|
+
{ name: 'TikTok', value: 'TIKTOK' },
|
|
275
|
+
{ name: 'X (Twitter)', value: 'TWITTER' },
|
|
276
|
+
{ name: 'YouTube', value: 'YOUTUBE' },
|
|
277
|
+
],
|
|
278
|
+
default: [],
|
|
279
|
+
description: 'Only posts targeting any of these platforms',
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
displayName: 'Sort Order',
|
|
283
|
+
name: 'sortOrder',
|
|
284
|
+
type: 'options',
|
|
285
|
+
options: [
|
|
286
|
+
{ name: 'Newest First', value: 'NEWEST' },
|
|
287
|
+
{ name: 'Oldest First', value: 'OLDEST' },
|
|
288
|
+
],
|
|
289
|
+
default: 'NEWEST',
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
displayName: 'Start Date',
|
|
293
|
+
name: 'startDate',
|
|
294
|
+
type: 'dateTime',
|
|
295
|
+
default: '',
|
|
296
|
+
description: 'Lower bound on the scheduled time, or creation time for posts never scheduled',
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
displayName: 'Statuses',
|
|
300
|
+
name: 'statuses',
|
|
301
|
+
type: 'multiOptions',
|
|
302
|
+
options: [
|
|
303
|
+
{ name: 'Completed', value: 'COMPLETED' },
|
|
304
|
+
{ name: 'Draft', value: 'DRAFT' },
|
|
305
|
+
{ name: 'Failed', value: 'FAILED' },
|
|
306
|
+
{ name: 'Partial Failure', value: 'PARTIAL_FAILURE' },
|
|
307
|
+
{ name: 'Pending', value: 'PENDING' },
|
|
308
|
+
{ name: 'Publishing', value: 'PUBLISHING' },
|
|
309
|
+
{ name: 'Scheduled', value: 'SCHEDULED' },
|
|
310
|
+
],
|
|
311
|
+
default: [],
|
|
312
|
+
},
|
|
313
|
+
],
|
|
314
|
+
},
|
|
315
|
+
];
|
|
316
|
+
//# sourceMappingURL=post.properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post.properties.js","sourceRoot":"","sources":["../../../nodes/AdaptlyPost/post.properties.ts"],"names":[],"mappings":";;;AAEA,MAAM,SAAS,GAAG,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;AACzC,MAAM,UAAU,GAAG,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,CAAC;AAElG,QAAA,cAAc,GAAsB;IAChD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QACnC,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,eAAe;gBACvB,WAAW,EAAE,gEAAgE;aAC7E;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,eAAe;gBACvB,WAAW,EAAE,kCAAkC;aAC/C;YACD;gBACC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gBACD,OAAO,EAAE,QAAQ;aACjB;YACD;gBACC,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,+EAA+E;aAC5F;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE;oBACR,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;oBACzC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;oBACjC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;oBACnC,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,EAAE;oBACrD,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;oBACrC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;oBAC3C,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;iBACzC;gBACD,OAAO,EAAE,EAAE;aACX;SACD;KACD;CACD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IDataObject, IExecuteFunctions, IHookFunctions, IHttpRequestMethods, ILoadOptionsFunctions, IWebhookFunctions } from 'n8n-workflow';
|
|
2
|
+
export declare const API_BASE_URL = "https://post.adaptlypost.com/post/api/v1";
|
|
3
|
+
export declare const CREDENTIAL_NAME = "adaptlyPostApi";
|
|
4
|
+
type ApiContext = IExecuteFunctions | IHookFunctions | ILoadOptionsFunctions | IWebhookFunctions;
|
|
5
|
+
export declare function adaptlyPostApiRequest(this: ApiContext, method: IHttpRequestMethods, path: string, body?: IDataObject, qs?: IDataObject): Promise<IDataObject>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CREDENTIAL_NAME = exports.API_BASE_URL = void 0;
|
|
4
|
+
exports.adaptlyPostApiRequest = adaptlyPostApiRequest;
|
|
5
|
+
exports.API_BASE_URL = 'https://post.adaptlypost.com/post/api/v1';
|
|
6
|
+
exports.CREDENTIAL_NAME = 'adaptlyPostApi';
|
|
7
|
+
async function adaptlyPostApiRequest(method, path, body, qs) {
|
|
8
|
+
const options = {
|
|
9
|
+
method,
|
|
10
|
+
url: `${exports.API_BASE_URL}${path}`,
|
|
11
|
+
qs,
|
|
12
|
+
body,
|
|
13
|
+
json: true,
|
|
14
|
+
};
|
|
15
|
+
return (await this.helpers.httpRequestWithAuthentication.call(this, exports.CREDENTIAL_NAME, options));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=transport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../nodes/AdaptlyPost/transport.ts"],"names":[],"mappings":";;;AAgBA,sDAmBC;AAzBY,QAAA,YAAY,GAAG,0CAA0C,CAAC;AAE1D,QAAA,eAAe,GAAG,gBAAgB,CAAC;AAIzC,KAAK,UAAU,qBAAqB,CAE1C,MAA2B,EAC3B,IAAY,EACZ,IAAkB,EAClB,EAAgB;IAEhB,MAAM,OAAO,GAAwB;QACpC,MAAM;QACN,GAAG,EAAE,GAAG,oBAAY,GAAG,IAAI,EAAE;QAC7B,EAAE;QACF,IAAI;QACJ,IAAI,EAAE,IAAI;KACV,CAAC;IACF,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,6BAA6B,CAAC,IAAI,CAC5D,IAAI,EACJ,uBAAe,EACf,OAAO,CACP,CAAgB,CAAC;AACnB,CAAC"}
|