n8n-nodes-postwire 0.2.0 → 0.2.1
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.
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, Icon, INodeProperties } from 'n8n-workflow';
|
|
2
2
|
export declare class PostWireApi implements ICredentialType {
|
|
3
3
|
name: string;
|
|
4
4
|
displayName: string;
|
|
5
|
+
icon: Icon;
|
|
5
6
|
documentationUrl: string;
|
|
6
7
|
properties: INodeProperties[];
|
|
7
8
|
authenticate: IAuthenticateGeneric;
|
|
@@ -8,6 +8,8 @@ class PostWireApi {
|
|
|
8
8
|
constructor() {
|
|
9
9
|
this.name = 'postWireApi';
|
|
10
10
|
this.displayName = 'PostWire API';
|
|
11
|
+
// Both variants: the badge is a dark square, which disappears against n8n's dark theme.
|
|
12
|
+
this.icon = { light: 'file:postwire.svg', dark: 'file:postwire.dark.svg' };
|
|
11
13
|
this.documentationUrl = 'https://postwire.io/n8n-social-media-automation/';
|
|
12
14
|
this.properties = [
|
|
13
15
|
{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><rect width="24" height="24" rx="5" fill="#f2f5f9"/><path d="M6 17V7h4.6a3.2 3.2 0 0 1 0 6.4H8.4" stroke="#0f6fd1" stroke-width="2.1" fill="none" stroke-linecap="round" stroke-linejoin="round"/><circle cx="16.6" cy="15.4" r="1.7" fill="#0f6fd1"/></svg>
|
|
@@ -25,14 +25,16 @@ class PostWire {
|
|
|
25
25
|
this.description = {
|
|
26
26
|
displayName: 'PostWire',
|
|
27
27
|
name: 'postWire',
|
|
28
|
-
icon: 'file:postwire.svg',
|
|
28
|
+
icon: { light: 'file:postwire.svg', dark: 'file:postwire.dark.svg' },
|
|
29
29
|
group: ['output'],
|
|
30
30
|
version: 1,
|
|
31
31
|
subtitle: '={{$parameter["operation"]}}',
|
|
32
32
|
description: 'Publish one idea natively to every social network',
|
|
33
|
+
// An agent asking to post is exactly the use this node was built for.
|
|
34
|
+
usableAsTool: true,
|
|
33
35
|
defaults: { name: 'PostWire' },
|
|
34
|
-
inputs: [
|
|
35
|
-
outputs: [
|
|
36
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
37
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
36
38
|
credentials: [{ name: 'postWireApi', required: true }],
|
|
37
39
|
requestDefaults: {
|
|
38
40
|
baseURL: BASE,
|
|
@@ -46,10 +48,10 @@ class PostWire {
|
|
|
46
48
|
noDataExpression: true,
|
|
47
49
|
options: [
|
|
48
50
|
{
|
|
49
|
-
name: '
|
|
50
|
-
value: '
|
|
51
|
-
description: '
|
|
52
|
-
action: '
|
|
51
|
+
name: 'Get Account',
|
|
52
|
+
value: 'me',
|
|
53
|
+
description: 'Plan, usage this month and connected accounts',
|
|
54
|
+
action: 'Get the PostWire account',
|
|
53
55
|
},
|
|
54
56
|
{
|
|
55
57
|
name: 'Publish',
|
|
@@ -57,12 +59,6 @@ class PostWire {
|
|
|
57
59
|
description: 'Publish to one or more networks in a single call',
|
|
58
60
|
action: 'Publish to social networks',
|
|
59
61
|
},
|
|
60
|
-
{
|
|
61
|
-
name: 'Write and Publish',
|
|
62
|
-
value: 'generateAndPublish',
|
|
63
|
-
description: 'Write a native draft per network, then publish them',
|
|
64
|
-
action: 'Write and publish in one step',
|
|
65
|
-
},
|
|
66
62
|
{
|
|
67
63
|
name: 'Schedule',
|
|
68
64
|
value: 'schedule',
|
|
@@ -70,10 +66,16 @@ class PostWire {
|
|
|
70
66
|
action: 'Schedule a post',
|
|
71
67
|
},
|
|
72
68
|
{
|
|
73
|
-
name: '
|
|
74
|
-
value: '
|
|
75
|
-
description: '
|
|
76
|
-
action: '
|
|
69
|
+
name: 'Write a Post per Network',
|
|
70
|
+
value: 'generate',
|
|
71
|
+
description: 'One prompt in, a native draft out for each network — right length, hashtags and format per platform. Does not publish.',
|
|
72
|
+
action: 'Write a native post for each network',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'Write and Publish',
|
|
76
|
+
value: 'generateAndPublish',
|
|
77
|
+
description: 'Write a native draft per network, then publish them',
|
|
78
|
+
action: 'Write and publish in one step',
|
|
77
79
|
},
|
|
78
80
|
],
|
|
79
81
|
default: 'generateAndPublish',
|
|
@@ -288,7 +290,12 @@ class PostWire {
|
|
|
288
290
|
out.push({ json: { error: error.message }, pairedItem: { item: i } });
|
|
289
291
|
continue;
|
|
290
292
|
}
|
|
291
|
-
throw
|
|
293
|
+
// Our own checks already throw NodeOperationError with a message that names the fix;
|
|
294
|
+
// re-wrapping those would bury it. Anything else is an HTTP failure, and n8n renders
|
|
295
|
+
// a NodeApiError with the node's context instead of a bare fetch stack.
|
|
296
|
+
if (error instanceof n8n_workflow_1.NodeOperationError)
|
|
297
|
+
throw error;
|
|
298
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error, { itemIndex: i });
|
|
292
299
|
}
|
|
293
300
|
}
|
|
294
301
|
return [out];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><rect width="24" height="24" rx="5" fill="#f2f5f9"/><path d="M6 17V7h4.6a3.2 3.2 0 0 1 0 6.4H8.4" stroke="#0f6fd1" stroke-width="2.1" fill="none" stroke-linecap="round" stroke-linejoin="round"/><circle cx="16.6" cy="15.4" r="1.7" fill="#0f6fd1"/></svg>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-postwire",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Publish one idea natively to TikTok, Instagram, YouTube, LinkedIn, X, Bluesky, Mastodon, Telegram, Discord and Reddit from n8n — a different post written for each network, via PostWire.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package",
|