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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AdaptlyPost
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# n8n-nodes-adaptlypost
|
|
2
|
+
|
|
3
|
+
n8n community node for [AdaptlyPost](https://adaptlypost.com). Publish and schedule posts to Instagram, TikTok, YouTube, X, Facebook, LinkedIn, Pinterest, Threads and Bluesky from a workflow, and start workflows when a post publishes or fails.
|
|
4
|
+
|
|
5
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation. The package name is `n8n-nodes-adaptlypost`.
|
|
10
|
+
|
|
11
|
+
## Nodes
|
|
12
|
+
|
|
13
|
+
### AdaptlyPost
|
|
14
|
+
|
|
15
|
+
| Resource | Operations |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| Post | Create, Get, Get Many, Get Results, Publish Draft, Retry Failed Platforms, Delete |
|
|
18
|
+
| Account | Get Many |
|
|
19
|
+
| Analytics | Get Overview, Get Timeseries, Get Platform Breakdown, Get Post Analytics |
|
|
20
|
+
|
|
21
|
+
Create takes the accounts to post from (a multi-select loaded from your workspace), the text, and media URLs. Media is copied from the URL you give into AdaptlyPost storage before the post is created, so any public JPEG, PNG, WebP, MP4 or QuickTime link works. TikTok privacy, Pinterest board, Instagram and Facebook post type, and YouTube title and privacy live under Additional Fields.
|
|
22
|
+
|
|
23
|
+
### AdaptlyPost Trigger
|
|
24
|
+
|
|
25
|
+
Registers a webhook with AdaptlyPost and fires on the events you pick:
|
|
26
|
+
|
|
27
|
+
- Post Published
|
|
28
|
+
- Post Partially Failed
|
|
29
|
+
- Post Failed
|
|
30
|
+
- Post Scheduled
|
|
31
|
+
- Account Disconnected
|
|
32
|
+
|
|
33
|
+
Every delivery is checked against the `x-adaptly-signature` header with the secret AdaptlyPost returned when the webhook was registered.
|
|
34
|
+
|
|
35
|
+
## Credentials
|
|
36
|
+
|
|
37
|
+
Create a workspace token at [app.adaptlypost.com/api-tokens](https://app.adaptlypost.com/api-tokens). It starts with `adaptly_` and is scoped to one workspace. Paste it into the AdaptlyPost API credential in n8n. n8n tests the credential with a request to `GET /social-accounts`.
|
|
38
|
+
|
|
39
|
+
## Compatibility
|
|
40
|
+
|
|
41
|
+
Tested with n8n 1.100 and later.
|
|
42
|
+
|
|
43
|
+
## Resources
|
|
44
|
+
|
|
45
|
+
- [AdaptlyPost API reference](https://adaptlypost.com/docs/api-introduction)
|
|
46
|
+
- [AdaptlyPost webhooks](https://adaptlypost.com/docs/webhooks)
|
|
47
|
+
- [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, Icon, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class AdaptlyPostApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
icon: Icon;
|
|
6
|
+
documentationUrl: string;
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
authenticate: IAuthenticateGeneric;
|
|
9
|
+
test: ICredentialTestRequest;
|
|
10
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AdaptlyPostApi = void 0;
|
|
4
|
+
class AdaptlyPostApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'adaptlyPostApi';
|
|
7
|
+
this.displayName = 'AdaptlyPost API';
|
|
8
|
+
this.icon = { light: 'file:../icons/adaptlypost.svg', dark: 'file:../icons/adaptlypost.dark.svg' };
|
|
9
|
+
this.documentationUrl = 'https://github.com/adaptlypost/n8n-nodes-adaptlypost?tab=readme-ov-file#credentials';
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'API Token',
|
|
13
|
+
name: 'apiToken',
|
|
14
|
+
type: 'string',
|
|
15
|
+
typeOptions: { password: true },
|
|
16
|
+
required: true,
|
|
17
|
+
default: '',
|
|
18
|
+
description: 'Workspace token from app.adaptlypost.com/api-tokens. It starts with adaptly_.',
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
this.authenticate = {
|
|
22
|
+
type: 'generic',
|
|
23
|
+
properties: {
|
|
24
|
+
headers: {
|
|
25
|
+
Authorization: '=Bearer {{$credentials.apiToken}}',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
this.test = {
|
|
30
|
+
request: {
|
|
31
|
+
baseURL: 'https://post.adaptlypost.com/post/api/v1',
|
|
32
|
+
url: '/social-accounts',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.AdaptlyPostApi = AdaptlyPostApi;
|
|
38
|
+
//# sourceMappingURL=AdaptlyPostApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdaptlyPostApi.credentials.js","sourceRoot":"","sources":["../../credentials/AdaptlyPostApi.credentials.ts"],"names":[],"mappings":";;;AAQA,MAAa,cAAc;IAA3B;QACC,SAAI,GAAG,gBAAgB,CAAC;QAExB,gBAAW,GAAG,iBAAiB,CAAC;QAEhC,SAAI,GAAS,EAAE,KAAK,EAAE,+BAA+B,EAAE,IAAI,EAAE,oCAAoC,EAAE,CAAC;QAEpG,qBAAgB,GACf,qFAAqF,CAAC;QAEvF,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EACV,+EAA+E;aAChF;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,mCAAmC;iBAClD;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,0CAA0C;gBACnD,GAAG,EAAE,kBAAkB;aACvB;SACD,CAAC;IACH,CAAC;CAAA;AAtCD,wCAsCC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" width="256" height="256">
|
|
2
|
+
<path fill="#f3f4f6" fill-rule="evenodd" d="M238.34 1.44L7.27 107.37A12.47 12.47 0 0 0 3.68 127.55L61.18 184.73L62.12 245.33A10.38 10.38 0 0 0 80.44 251.88L102.29 226.03L128.22 252.03A12.47 12.47 0 0 0 148.36 248.45L254.85 18.00A12.47 12.47 0 0 0 238.34 1.44ZM216.76 40.07L133.37 221.83L97.20 185.86L216.76 40.07ZM214.84 39.87L69.81 158.46L33.96 122.47L214.84 39.87Z"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" width="256" height="256">
|
|
2
|
+
<path fill="#1f2937" fill-rule="evenodd" d="M238.34 1.44L7.27 107.37A12.47 12.47 0 0 0 3.68 127.55L61.18 184.73L62.12 245.33A10.38 10.38 0 0 0 80.44 251.88L102.29 226.03L128.22 252.03A12.47 12.47 0 0 0 148.36 248.45L254.85 18.00A12.47 12.47 0 0 0 238.34 1.44ZM216.76 40.07L133.37 221.83L97.20 185.86L216.76 40.07ZM214.84 39.87L69.81 158.46L33.96 122.47L214.84 39.87Z"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
import { getAccounts } from './accounts';
|
|
3
|
+
export declare class AdaptlyPost implements INodeType {
|
|
4
|
+
description: INodeTypeDescription;
|
|
5
|
+
methods: {
|
|
6
|
+
loadOptions: {
|
|
7
|
+
getAccounts: typeof getAccounts;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AdaptlyPost = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const accounts_1 = require("./accounts");
|
|
6
|
+
const media_1 = require("./media");
|
|
7
|
+
const post_properties_1 = require("./post.properties");
|
|
8
|
+
const analytics_properties_1 = require("./analytics.properties");
|
|
9
|
+
const transport_1 = require("./transport");
|
|
10
|
+
const asList = (value) => Array.isArray(value)
|
|
11
|
+
? value.map(String)
|
|
12
|
+
: String(value !== null && value !== void 0 ? value : '')
|
|
13
|
+
.split(/[\n,]/)
|
|
14
|
+
.map((entry) => entry.trim())
|
|
15
|
+
.filter(Boolean);
|
|
16
|
+
class AdaptlyPost {
|
|
17
|
+
constructor() {
|
|
18
|
+
this.description = {
|
|
19
|
+
displayName: 'AdaptlyPost',
|
|
20
|
+
name: 'adaptlyPost',
|
|
21
|
+
icon: { light: 'file:../../icons/adaptlypost.svg', dark: 'file:../../icons/adaptlypost.dark.svg' },
|
|
22
|
+
group: ['output'],
|
|
23
|
+
version: 1,
|
|
24
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
25
|
+
description: 'Schedule and publish social posts with AdaptlyPost',
|
|
26
|
+
defaults: {
|
|
27
|
+
name: 'AdaptlyPost',
|
|
28
|
+
},
|
|
29
|
+
usableAsTool: true,
|
|
30
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
31
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
32
|
+
credentials: [{ name: 'adaptlyPostApi', required: true }],
|
|
33
|
+
properties: [
|
|
34
|
+
{
|
|
35
|
+
displayName: 'Resource',
|
|
36
|
+
name: 'resource',
|
|
37
|
+
type: 'options',
|
|
38
|
+
noDataExpression: true,
|
|
39
|
+
options: [
|
|
40
|
+
{ name: 'Account', value: 'account' },
|
|
41
|
+
{ name: 'Analytics', value: 'analytics' },
|
|
42
|
+
{ name: 'Post', value: 'post' },
|
|
43
|
+
],
|
|
44
|
+
default: 'post',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
displayName: 'Operation',
|
|
48
|
+
name: 'operation',
|
|
49
|
+
type: 'options',
|
|
50
|
+
noDataExpression: true,
|
|
51
|
+
displayOptions: { show: { resource: ['account'] } },
|
|
52
|
+
options: [
|
|
53
|
+
{
|
|
54
|
+
name: 'Get Many',
|
|
55
|
+
value: 'getAll',
|
|
56
|
+
action: 'Get many accounts',
|
|
57
|
+
description: 'List the social accounts connected to the workspace',
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
default: 'getAll',
|
|
61
|
+
},
|
|
62
|
+
...post_properties_1.postProperties,
|
|
63
|
+
...analytics_properties_1.analyticsProperties,
|
|
64
|
+
],
|
|
65
|
+
};
|
|
66
|
+
this.methods = {
|
|
67
|
+
loadOptions: {
|
|
68
|
+
getAccounts: accounts_1.getAccounts,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
async execute() {
|
|
73
|
+
const items = this.getInputData();
|
|
74
|
+
const returnData = [];
|
|
75
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
76
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
77
|
+
for (let i = 0; i < items.length; i++) {
|
|
78
|
+
try {
|
|
79
|
+
const result = await runOperation.call(this, resource, operation, i);
|
|
80
|
+
const rows = Array.isArray(result) ? result : [result];
|
|
81
|
+
returnData.push(...rows.map((json) => ({ json: json, pairedItem: { item: i } })));
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
if (this.continueOnFail()) {
|
|
85
|
+
returnData.push({
|
|
86
|
+
json: { error: error.message },
|
|
87
|
+
pairedItem: { item: i },
|
|
88
|
+
});
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
throw error instanceof n8n_workflow_1.NodeOperationError
|
|
92
|
+
? error
|
|
93
|
+
: new n8n_workflow_1.NodeApiError(this.getNode(), error, { itemIndex: i });
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return [returnData];
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.AdaptlyPost = AdaptlyPost;
|
|
100
|
+
async function runOperation(resource, operation, i) {
|
|
101
|
+
if (resource === 'account') {
|
|
102
|
+
const { accounts } = await transport_1.adaptlyPostApiRequest.call(this, 'GET', '/social-accounts');
|
|
103
|
+
return accounts;
|
|
104
|
+
}
|
|
105
|
+
if (resource === 'analytics') {
|
|
106
|
+
return runAnalytics.call(this, operation, i);
|
|
107
|
+
}
|
|
108
|
+
switch (operation) {
|
|
109
|
+
case 'create':
|
|
110
|
+
return createPost.call(this, i);
|
|
111
|
+
case 'get':
|
|
112
|
+
return transport_1.adaptlyPostApiRequest.call(this, 'GET', `/social-posts/${this.getNodeParameter('postId', i)}`);
|
|
113
|
+
case 'getAll': {
|
|
114
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
115
|
+
const filters = this.getNodeParameter('filters', i, {});
|
|
116
|
+
const limit = returnAll ? 100 : this.getNodeParameter('limit', i);
|
|
117
|
+
const posts = [];
|
|
118
|
+
let offset = 0;
|
|
119
|
+
while (true) {
|
|
120
|
+
const page = await transport_1.adaptlyPostApiRequest.call(this, 'GET', '/social-posts', undefined, {
|
|
121
|
+
...filters,
|
|
122
|
+
limit: Math.min(limit - posts.length, 100),
|
|
123
|
+
offset,
|
|
124
|
+
});
|
|
125
|
+
posts.push(...page.posts);
|
|
126
|
+
offset += page.posts.length;
|
|
127
|
+
if (!page.hasMore || (!returnAll && posts.length >= limit))
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
return posts;
|
|
131
|
+
}
|
|
132
|
+
case 'getResults':
|
|
133
|
+
return transport_1.adaptlyPostApiRequest.call(this, 'GET', `/social-posts/${this.getNodeParameter('postId', i)}/results`);
|
|
134
|
+
case 'publishDraft':
|
|
135
|
+
return transport_1.adaptlyPostApiRequest.call(this, 'POST', `/social-posts/${this.getNodeParameter('postId', i)}/publish`, {
|
|
136
|
+
scheduledAt: this.getNodeParameter('scheduledAt', i, '') || undefined,
|
|
137
|
+
timezone: this.getNodeParameter('timezone', i, 'UTC') || 'UTC',
|
|
138
|
+
});
|
|
139
|
+
case 'retry':
|
|
140
|
+
return transport_1.adaptlyPostApiRequest.call(this, 'POST', `/social-posts/${this.getNodeParameter('postId', i)}/retry`, {});
|
|
141
|
+
case 'delete':
|
|
142
|
+
return transport_1.adaptlyPostApiRequest.call(this, 'DELETE', `/social-posts/${this.getNodeParameter('postId', i)}`);
|
|
143
|
+
default:
|
|
144
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation "${operation}"`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
async function runAnalytics(operation, i) {
|
|
148
|
+
const qs = {
|
|
149
|
+
from: this.getNodeParameter('from', i),
|
|
150
|
+
to: this.getNodeParameter('to', i),
|
|
151
|
+
platforms: this.getNodeParameter('platforms', i, []),
|
|
152
|
+
};
|
|
153
|
+
switch (operation) {
|
|
154
|
+
case 'overview':
|
|
155
|
+
return transport_1.adaptlyPostApiRequest.call(this, 'GET', '/analytics/overview', undefined, qs);
|
|
156
|
+
case 'timeseries':
|
|
157
|
+
return transport_1.adaptlyPostApiRequest.call(this, 'GET', '/analytics/timeseries', undefined, {
|
|
158
|
+
...qs,
|
|
159
|
+
interval: this.getNodeParameter('interval', i),
|
|
160
|
+
});
|
|
161
|
+
case 'platformBreakdown':
|
|
162
|
+
return transport_1.adaptlyPostApiRequest.call(this, 'GET', '/analytics/platform-breakdown', undefined, qs);
|
|
163
|
+
case 'posts': {
|
|
164
|
+
const page = await transport_1.adaptlyPostApiRequest.call(this, 'GET', '/analytics/posts', undefined, {
|
|
165
|
+
...qs,
|
|
166
|
+
sortBy: this.getNodeParameter('sortBy', i),
|
|
167
|
+
limit: this.getNodeParameter('limit', i),
|
|
168
|
+
});
|
|
169
|
+
return page.posts;
|
|
170
|
+
}
|
|
171
|
+
default:
|
|
172
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation "${operation}"`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
async function createPost(i) {
|
|
176
|
+
const accountIds = asList(this.getNodeParameter('accountIds', i));
|
|
177
|
+
if (accountIds.length === 0) {
|
|
178
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Select at least one account', {
|
|
179
|
+
itemIndex: i,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
const { accounts } = await transport_1.adaptlyPostApiRequest.call(this, 'GET', '/social-accounts');
|
|
183
|
+
let targets;
|
|
184
|
+
try {
|
|
185
|
+
targets = (0, accounts_1.groupAccountsByPlatform)(accountIds, accounts);
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error.message, { itemIndex: i });
|
|
189
|
+
}
|
|
190
|
+
const ids = (platform) => { var _a; return (_a = targets[platform === 'FACEBOOK' ? 'pageIds' : `${platform.toLowerCase()}ConnectionIds`]) !== null && _a !== void 0 ? _a : []; };
|
|
191
|
+
const mediaUrls = [];
|
|
192
|
+
for (const sourceUrl of asList(this.getNodeParameter('mediaUrls', i, ''))) {
|
|
193
|
+
mediaUrls.push(await media_1.uploadMediaFromUrl.call(this, sourceUrl, i));
|
|
194
|
+
}
|
|
195
|
+
const options = this.getNodeParameter('additionalFields', i, {});
|
|
196
|
+
const body = {
|
|
197
|
+
...targets,
|
|
198
|
+
contentType: this.getNodeParameter('contentType', i),
|
|
199
|
+
text: this.getNodeParameter('text', i, '') || undefined,
|
|
200
|
+
mediaUrls: mediaUrls.length ? mediaUrls : undefined,
|
|
201
|
+
scheduledAt: options.scheduledAt || undefined,
|
|
202
|
+
timezone: options.timezone || 'UTC',
|
|
203
|
+
saveAsDraft: options.saveAsDraft === true,
|
|
204
|
+
};
|
|
205
|
+
if (targets.platforms.includes('TIKTOK')) {
|
|
206
|
+
body.tiktokConfigs = ids('TIKTOK').map((connectionId) => ({
|
|
207
|
+
connectionId,
|
|
208
|
+
privacyLevel: options.tiktokPrivacyLevel || 'PUBLIC_TO_EVERYONE',
|
|
209
|
+
}));
|
|
210
|
+
}
|
|
211
|
+
if (targets.platforms.includes('PINTEREST')) {
|
|
212
|
+
if (!options.pinterestBoard) {
|
|
213
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Pinterest posts need a board ID', {
|
|
214
|
+
itemIndex: i,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
body.pinterestConfigs = ids('PINTEREST').map((connectionId) => ({
|
|
218
|
+
connectionId,
|
|
219
|
+
boardId: options.pinterestBoard,
|
|
220
|
+
link: options.pinterestLink || undefined,
|
|
221
|
+
}));
|
|
222
|
+
}
|
|
223
|
+
if (targets.platforms.includes('INSTAGRAM') && options.instagramPostType) {
|
|
224
|
+
body.instagramConfigs = ids('INSTAGRAM').map((connectionId) => ({
|
|
225
|
+
connectionId,
|
|
226
|
+
postType: options.instagramPostType,
|
|
227
|
+
}));
|
|
228
|
+
}
|
|
229
|
+
if (targets.platforms.includes('FACEBOOK') && options.facebookPostType) {
|
|
230
|
+
body.facebookConfigs = ids('FACEBOOK').map((pageId) => ({
|
|
231
|
+
pageId,
|
|
232
|
+
postType: options.facebookPostType,
|
|
233
|
+
}));
|
|
234
|
+
}
|
|
235
|
+
if (targets.platforms.includes('YOUTUBE')) {
|
|
236
|
+
body.youtubeConfigs = ids('YOUTUBE').map((connectionId) => ({
|
|
237
|
+
connectionId,
|
|
238
|
+
videoTitle: options.youtubeTitle || undefined,
|
|
239
|
+
privacyStatus: options.youtubePrivacyStatus || undefined,
|
|
240
|
+
postType: options.youtubePostType || undefined,
|
|
241
|
+
}));
|
|
242
|
+
}
|
|
243
|
+
return transport_1.adaptlyPostApiRequest.call(this, 'POST', '/social-posts', body);
|
|
244
|
+
}
|
|
245
|
+
//# sourceMappingURL=AdaptlyPost.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdaptlyPost.node.js","sourceRoot":"","sources":["../../../nodes/AdaptlyPost/AdaptlyPost.node.ts"],"names":[],"mappings":";;;AAQA,+CAAqF;AAErF,yCAAsF;AACtF,mCAA6C;AAC7C,uDAAmD;AACnD,iEAA6D;AAC7D,2CAAoD;AAEpD,MAAM,MAAM,GAAG,CAAC,KAAc,EAAY,EAAE,CAC3C,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;IACnB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC;IACnB,CAAC,CAAC,MAAM,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;SAClB,KAAK,CAAC,OAAO,CAAC;SACd,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;SAC5B,MAAM,CAAC,OAAO,CAAC,CAAC;AAErB,MAAa,WAAW;IAAxB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,aAAa;YAC1B,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE,EAAE,KAAK,EAAE,kCAAkC,EAAE,IAAI,EAAE,uCAAuC,EAAE;YAClG,KAAK,EAAE,CAAC,QAAQ,CAAC;YACjB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,oDAAoD;YACjE,QAAQ,EAAE;gBACT,IAAI,EAAE,aAAa;aACnB;YACD,YAAY,EAAE,IAAI;YAClB,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YACzD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,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
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Marketing", "Communication"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://github.com/adaptlypost/n8n-nodes-adaptlypost?tab=readme-ov-file#credentials"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://github.com/adaptlypost/n8n-nodes-adaptlypost?tab=readme-ov-file"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IHookFunctions, INodeType, INodeTypeDescription, IWebhookFunctions, IWebhookResponseData } from 'n8n-workflow';
|
|
2
|
+
export declare class AdaptlyPostTrigger implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
webhookMethods: {
|
|
5
|
+
default: {
|
|
6
|
+
checkExists(this: IHookFunctions): Promise<boolean>;
|
|
7
|
+
create(this: IHookFunctions): Promise<boolean>;
|
|
8
|
+
delete(this: IHookFunctions): Promise<boolean>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AdaptlyPostTrigger = void 0;
|
|
4
|
+
const node_crypto_1 = require("node:crypto");
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const transport_1 = require("./transport");
|
|
7
|
+
const EVENTS = [
|
|
8
|
+
{ name: 'Account Disconnected', value: 'account.unauthorized' },
|
|
9
|
+
{ name: 'Post Failed', value: 'post.failed' },
|
|
10
|
+
{ name: 'Post Partially Failed', value: 'post.partially_failed' },
|
|
11
|
+
{ name: 'Post Published', value: 'post.published' },
|
|
12
|
+
{ name: 'Post Scheduled', value: 'post.scheduled' },
|
|
13
|
+
];
|
|
14
|
+
const signatureMatches = (secret, timestamp, rawBody, received) => {
|
|
15
|
+
const expected = 'sha256=' + (0, node_crypto_1.createHmac)('sha256', secret).update(`${timestamp}.${rawBody}`).digest('hex');
|
|
16
|
+
const a = Buffer.from(expected);
|
|
17
|
+
const b = Buffer.from(received);
|
|
18
|
+
return a.length === b.length && (0, node_crypto_1.timingSafeEqual)(a, b);
|
|
19
|
+
};
|
|
20
|
+
class AdaptlyPostTrigger {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.description = {
|
|
23
|
+
displayName: 'AdaptlyPost Trigger',
|
|
24
|
+
name: 'adaptlyPostTrigger',
|
|
25
|
+
icon: { light: 'file:../../icons/adaptlypost.svg', dark: 'file:../../icons/adaptlypost.dark.svg' },
|
|
26
|
+
group: ['trigger'],
|
|
27
|
+
version: 1,
|
|
28
|
+
subtitle: '={{$parameter["events"].join(", ")}}',
|
|
29
|
+
description: 'Starts the workflow when AdaptlyPost publishes, schedules or fails a post',
|
|
30
|
+
defaults: {
|
|
31
|
+
name: 'AdaptlyPost Trigger',
|
|
32
|
+
},
|
|
33
|
+
inputs: [],
|
|
34
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
35
|
+
credentials: [{ name: 'adaptlyPostApi', required: true }],
|
|
36
|
+
webhooks: [
|
|
37
|
+
{
|
|
38
|
+
name: 'default',
|
|
39
|
+
httpMethod: 'POST',
|
|
40
|
+
responseMode: 'onReceived',
|
|
41
|
+
path: 'webhook',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
properties: [
|
|
45
|
+
{
|
|
46
|
+
displayName: 'Events',
|
|
47
|
+
name: 'events',
|
|
48
|
+
type: 'multiOptions',
|
|
49
|
+
options: EVENTS,
|
|
50
|
+
required: true,
|
|
51
|
+
default: ['post.published'],
|
|
52
|
+
description: 'Which AdaptlyPost events start the workflow',
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
};
|
|
56
|
+
this.webhookMethods = {
|
|
57
|
+
default: {
|
|
58
|
+
async checkExists() {
|
|
59
|
+
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
60
|
+
const staticData = this.getWorkflowStaticData('node');
|
|
61
|
+
const { webhooks } = await transport_1.adaptlyPostApiRequest.call(this, 'GET', '/webhooks');
|
|
62
|
+
const existing = webhooks.find((webhook) => webhook.url === webhookUrl);
|
|
63
|
+
if (!existing) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
if (!staticData.webhookSecret || staticData.webhookId !== existing.id) {
|
|
67
|
+
await transport_1.adaptlyPostApiRequest.call(this, 'DELETE', `/webhooks/${existing.id}`);
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
return true;
|
|
71
|
+
},
|
|
72
|
+
async create() {
|
|
73
|
+
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
74
|
+
const staticData = this.getWorkflowStaticData('node');
|
|
75
|
+
const created = (await transport_1.adaptlyPostApiRequest.call(this, 'POST', '/webhooks', {
|
|
76
|
+
url: webhookUrl,
|
|
77
|
+
}));
|
|
78
|
+
staticData.webhookId = created.id;
|
|
79
|
+
staticData.webhookSecret = created.secret;
|
|
80
|
+
return true;
|
|
81
|
+
},
|
|
82
|
+
async delete() {
|
|
83
|
+
const staticData = this.getWorkflowStaticData('node');
|
|
84
|
+
if (staticData.webhookId) {
|
|
85
|
+
try {
|
|
86
|
+
await transport_1.adaptlyPostApiRequest.call(this, 'DELETE', `/webhooks/${staticData.webhookId}`);
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
this.logger.warn('AdaptlyPost webhook could not be deleted', {
|
|
90
|
+
webhookId: staticData.webhookId,
|
|
91
|
+
error: error.message,
|
|
92
|
+
});
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
delete staticData.webhookId;
|
|
97
|
+
delete staticData.webhookSecret;
|
|
98
|
+
return true;
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
async webhook() {
|
|
104
|
+
var _a, _b, _c;
|
|
105
|
+
const request = this.getRequestObject();
|
|
106
|
+
const headers = this.getHeaderData();
|
|
107
|
+
const body = this.getBodyData();
|
|
108
|
+
const staticData = this.getWorkflowStaticData('node');
|
|
109
|
+
const secret = staticData.webhookSecret;
|
|
110
|
+
const rawBody = request.rawBody ? request.rawBody.toString() : JSON.stringify(body);
|
|
111
|
+
const signature = headers['x-adaptly-signature'];
|
|
112
|
+
const timestamp = headers['x-adaptly-timestamp'];
|
|
113
|
+
if (secret && signature && timestamp && !signatureMatches(secret, timestamp, rawBody, signature)) {
|
|
114
|
+
const response = this.getResponseObject();
|
|
115
|
+
response.status(401).send('Invalid signature');
|
|
116
|
+
return { noWebhookResponse: true };
|
|
117
|
+
}
|
|
118
|
+
const events = this.getNodeParameter('events');
|
|
119
|
+
const event = String((_b = (_a = body.event) !== null && _a !== void 0 ? _a : headers['x-adaptly-event']) !== null && _b !== void 0 ? _b : '');
|
|
120
|
+
if (event === 'webhook.test' || !events.includes(event)) {
|
|
121
|
+
return { workflowData: [] };
|
|
122
|
+
}
|
|
123
|
+
const data = ((_c = body.data) !== null && _c !== void 0 ? _c : {});
|
|
124
|
+
return {
|
|
125
|
+
workflowData: [
|
|
126
|
+
this.helpers.returnJsonArray({
|
|
127
|
+
id: body.id,
|
|
128
|
+
event,
|
|
129
|
+
occurredAt: body.createdAt,
|
|
130
|
+
...data,
|
|
131
|
+
}),
|
|
132
|
+
],
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
exports.AdaptlyPostTrigger = AdaptlyPostTrigger;
|
|
137
|
+
//# sourceMappingURL=AdaptlyPostTrigger.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdaptlyPostTrigger.node.js","sourceRoot":"","sources":["../../../nodes/AdaptlyPost/AdaptlyPost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CAAC,EAAE,CAAC;YACzD,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;QAC7B,CAAC;QAED,MAAM,IAAI,GAAG,CAAC,MAAA,IAAI,CAAC,IAAI,mCAAI,EAAE,CAAgB,CAAC;QAC9C,OAAO;YACN,YAAY,EAAE;gBACb,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC;oBAC5B,EAAE,EAAE,IAAI,CAAC,EAAE;oBACX,KAAK;oBACL,UAAU,EAAE,IAAI,CAAC,SAAS;oBAC1B,GAAG,IAAI;iBACP,CAAC;aACF;SACD,CAAC;IACH,CAAC;CACD;AAxHD,gDAwHC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-adaptlypost.adaptlyPostTrigger",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Marketing", "Communication"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://github.com/adaptlypost/n8n-nodes-adaptlypost?tab=readme-ov-file#credentials"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://github.com/adaptlypost/n8n-nodes-adaptlypost?tab=readme-ov-file"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
export declare const PLATFORMS: readonly ["FACEBOOK", "INSTAGRAM", "THREADS", "TIKTOK", "TWITTER", "BLUESKY", "LINKEDIN", "PINTEREST", "YOUTUBE"];
|
|
3
|
+
export type Platform = (typeof PLATFORMS)[number];
|
|
4
|
+
export declare const PLATFORM_LABELS: Record<Platform, string>;
|
|
5
|
+
export interface SocialAccount {
|
|
6
|
+
id: string;
|
|
7
|
+
platform: Platform;
|
|
8
|
+
displayName: string;
|
|
9
|
+
username?: string;
|
|
10
|
+
status: 'active' | 'unauthorized';
|
|
11
|
+
pageId?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const connectionField: (platform: Platform) => string;
|
|
14
|
+
export interface PostTargets {
|
|
15
|
+
platforms: Platform[];
|
|
16
|
+
[connectionField: string]: string[];
|
|
17
|
+
}
|
|
18
|
+
export declare function groupAccountsByPlatform(selectedIds: string[], accounts: SocialAccount[]): PostTargets;
|
|
19
|
+
export declare function getAccounts(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|