n8n-nodes-redreplier 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 +39 -0
- package/dist/credentials/RedReplierApi.credentials.d.ts +10 -0
- package/dist/credentials/RedReplierApi.credentials.js +38 -0
- package/dist/credentials/RedReplierApi.credentials.js.map +1 -0
- package/dist/icons/redreplier.dark.svg +6 -0
- package/dist/icons/redreplier.svg +6 -0
- package/dist/nodes/RedReplier/RedReplier.node.d.ts +10 -0
- package/dist/nodes/RedReplier/RedReplier.node.js +63 -0
- package/dist/nodes/RedReplier/RedReplier.node.js.map +1 -0
- package/dist/nodes/RedReplier/RedReplier.node.json +18 -0
- package/dist/nodes/RedReplier/RedReplierTrigger.node.d.ts +11 -0
- package/dist/nodes/RedReplier/RedReplierTrigger.node.js +103 -0
- package/dist/nodes/RedReplier/RedReplierTrigger.node.js.map +1 -0
- package/dist/nodes/RedReplier/RedReplierTrigger.node.json +18 -0
- package/dist/nodes/RedReplier/alert.properties.d.ts +2 -0
- package/dist/nodes/RedReplier/alert.properties.js +62 -0
- package/dist/nodes/RedReplier/alert.properties.js.map +1 -0
- package/dist/nodes/RedReplier/keyword.properties.d.ts +2 -0
- package/dist/nodes/RedReplier/keyword.properties.js +95 -0
- package/dist/nodes/RedReplier/keyword.properties.js.map +1 -0
- package/dist/nodes/RedReplier/mention.properties.d.ts +2 -0
- package/dist/nodes/RedReplier/mention.properties.js +151 -0
- package/dist/nodes/RedReplier/mention.properties.js.map +1 -0
- package/dist/nodes/RedReplier/shared.d.ts +14 -0
- package/dist/nodes/RedReplier/shared.js +38 -0
- package/dist/nodes/RedReplier/shared.js.map +1 -0
- package/dist/nodes/RedReplier/transport.d.ts +6 -0
- package/dist/nodes/RedReplier/transport.js +17 -0
- package/dist/nodes/RedReplier/transport.js.map +1 -0
- package/dist/nodes/RedReplier/website.properties.d.ts +2 -0
- package/dist/nodes/RedReplier/website.properties.js +107 -0
- package/dist/nodes/RedReplier/website.properties.js.map +1 -0
- package/dist/package.json +54 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mentionProperties = void 0;
|
|
4
|
+
const shared_1 = require("./shared");
|
|
5
|
+
const onlyMentions = { resource: ['mention'] };
|
|
6
|
+
const listOrCount = { resource: ['mention'], operation: ['count', 'getAll'] };
|
|
7
|
+
exports.mentionProperties = [
|
|
8
|
+
{
|
|
9
|
+
displayName: 'Operation',
|
|
10
|
+
name: 'operation',
|
|
11
|
+
type: 'options',
|
|
12
|
+
noDataExpression: true,
|
|
13
|
+
displayOptions: { show: onlyMentions },
|
|
14
|
+
options: [
|
|
15
|
+
{
|
|
16
|
+
name: 'Count',
|
|
17
|
+
value: 'count',
|
|
18
|
+
action: 'Count mentions',
|
|
19
|
+
description: 'Count matched conversations for a set of filters',
|
|
20
|
+
routing: {
|
|
21
|
+
request: { method: 'GET', url: '/mentions/count' },
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'Explain',
|
|
26
|
+
value: 'explain',
|
|
27
|
+
action: 'Explain a mention',
|
|
28
|
+
description: 'Ask why a mention scored the way it did and draft a reply',
|
|
29
|
+
routing: {
|
|
30
|
+
request: { method: 'POST', url: '=/mentions/{{$parameter.mentionId}}/explain' },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'Get Many',
|
|
35
|
+
value: 'getAll',
|
|
36
|
+
action: 'Get many mentions',
|
|
37
|
+
description: 'List matched conversations, newest first',
|
|
38
|
+
routing: {
|
|
39
|
+
request: { method: 'GET', url: '/mentions', qs: { sort: 'RECENT' } },
|
|
40
|
+
output: { postReceive: [{ type: 'rootProperty', properties: { property: 'mentions' } }] },
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'Update Status',
|
|
45
|
+
value: 'updateStatus',
|
|
46
|
+
action: 'Approve or reject a mention',
|
|
47
|
+
routing: {
|
|
48
|
+
request: { method: 'PATCH', url: '=/mentions/{{$parameter.mentionId}}/status' },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
default: 'getAll',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
displayName: 'Mention ID',
|
|
56
|
+
name: 'mentionId',
|
|
57
|
+
type: 'string',
|
|
58
|
+
required: true,
|
|
59
|
+
default: '',
|
|
60
|
+
displayOptions: { show: { resource: ['mention'], operation: ['explain', 'updateStatus'] } },
|
|
61
|
+
description: 'Usually mapped from the RedReplier Trigger',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
displayName: 'Status',
|
|
65
|
+
name: 'status',
|
|
66
|
+
type: 'options',
|
|
67
|
+
options: shared_1.MENTION_STATUS_OPTIONS,
|
|
68
|
+
default: 'APPROVED',
|
|
69
|
+
displayOptions: { show: { resource: ['mention'], operation: ['updateStatus'] } },
|
|
70
|
+
routing: { send: { type: 'body', property: 'status' } },
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
displayName: 'Limit',
|
|
74
|
+
name: 'limit',
|
|
75
|
+
type: 'number',
|
|
76
|
+
typeOptions: { minValue: 1, maxValue: 500 },
|
|
77
|
+
default: 50,
|
|
78
|
+
displayOptions: { show: { resource: ['mention'], operation: ['getAll'] } },
|
|
79
|
+
description: 'Max number of results to return',
|
|
80
|
+
routing: { send: { type: 'query', property: 'limit' } },
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
displayName: 'Filters',
|
|
84
|
+
name: 'filters',
|
|
85
|
+
type: 'collection',
|
|
86
|
+
placeholder: 'Add Filter',
|
|
87
|
+
default: {},
|
|
88
|
+
displayOptions: { show: listOrCount },
|
|
89
|
+
options: [
|
|
90
|
+
{
|
|
91
|
+
displayName: 'From',
|
|
92
|
+
name: 'from',
|
|
93
|
+
type: 'dateTime',
|
|
94
|
+
default: '',
|
|
95
|
+
description: 'Only mentions published at or after this time',
|
|
96
|
+
routing: { send: { type: 'query', property: 'from' } },
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
displayName: 'Include Low Relevance',
|
|
100
|
+
name: 'includeLowRelevance',
|
|
101
|
+
type: 'boolean',
|
|
102
|
+
default: false,
|
|
103
|
+
description: 'Whether to include mentions RedReplier scored as low relevance',
|
|
104
|
+
routing: { send: { type: 'query', property: 'includeLowRelevance' } },
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
displayName: 'Keywords',
|
|
108
|
+
name: 'keywords',
|
|
109
|
+
type: 'string',
|
|
110
|
+
default: '',
|
|
111
|
+
description: 'Comma-separated monitored keywords the mention must have matched',
|
|
112
|
+
routing: {
|
|
113
|
+
send: {
|
|
114
|
+
type: 'query',
|
|
115
|
+
property: 'keywords',
|
|
116
|
+
value: '={{ $value.split(",").map((k) => k.trim()).filter(Boolean) }}',
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
displayName: 'Sources',
|
|
122
|
+
name: 'sources',
|
|
123
|
+
type: 'multiOptions',
|
|
124
|
+
options: shared_1.MENTION_SOURCE_OPTIONS,
|
|
125
|
+
default: [],
|
|
126
|
+
routing: { send: { type: 'query', property: 'sources' } },
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
displayName: 'Statuses',
|
|
130
|
+
name: 'statuses',
|
|
131
|
+
type: 'multiOptions',
|
|
132
|
+
options: shared_1.MENTION_STATUS_OPTIONS,
|
|
133
|
+
default: [],
|
|
134
|
+
routing: { send: { type: 'query', property: 'statuses' } },
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
displayName: 'To',
|
|
138
|
+
name: 'to',
|
|
139
|
+
type: 'dateTime',
|
|
140
|
+
default: '',
|
|
141
|
+
description: 'Only mentions published at or before this time',
|
|
142
|
+
routing: { send: { type: 'query', property: 'to' } },
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
...(0, shared_1.websiteSelect)('websiteId', undefined, false),
|
|
146
|
+
routing: { send: { type: 'query', property: 'websiteId' } },
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
},
|
|
150
|
+
];
|
|
151
|
+
//# sourceMappingURL=mention.properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mention.properties.js","sourceRoot":"","sources":["../../../nodes/RedReplier/mention.properties.ts"],"names":[],"mappings":";;;AAEA,qCAAyF;AAEzF,MAAM,YAAY,GAAG,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC;AAC/C,MAAM,WAAW,GAAG,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC;AAEjE,QAAA,iBAAiB,GAAsB;IACnD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;QACtC,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,OAAO;gBACd,MAAM,EAAE,gBAAgB;gBACxB,WAAW,EAAE,kDAAkD;gBAC/D,OAAO,EAAE;oBACR,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,iBAAiB,EAAE;iBAClD;aACD;YACD;gBACC,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,SAAS;gBAChB,MAAM,EAAE,mBAAmB;gBAC3B,WAAW,EAAE,2DAA2D;gBACxE,OAAO,EAAE;oBACR,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,6CAA6C,EAAE;iBAC/E;aACD;YACD;gBACC,IAAI,EAAE,UAAU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E;gBAC/E,OAAO,EAAE;oBACR,IAAI,EAAE;wBACL,IAAI,EAAE,OAAO;wBACb,QAAQ,EAAE,UAAU;wBACpB,KAAK,EAAE,+DAA+D;qBACtE;iBACD;aACD;YACD;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE,+BAAsB;gBAC/B,OAAO,EAAE,EAAE;gBACX,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE;aACzD;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE,+BAAsB;gBAC/B,OAAO,EAAE,EAAE;gBACX,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE;aAC1D;YACD;gBACC,WAAW,EAAE,IAAI;gBACjB,IAAI,EAAE,IAAI;gBACV,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,gDAAgD;gBAC7D,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;aACpD;YACD;gBACC,GAAG,IAAA,sBAAa,EAAC,WAAW,EAAE,SAAS,EAAE,KAAK,CAAC;gBAC/C,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE;aAC3D;SACD;KACD;CACD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ILoadOptionsFunctions, INodeProperties, INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
export declare const MENTION_SOURCE_OPTIONS: INodePropertyOptions[];
|
|
3
|
+
export declare const MENTION_STATUS_OPTIONS: INodePropertyOptions[];
|
|
4
|
+
export interface Website {
|
|
5
|
+
id: string;
|
|
6
|
+
domain: string;
|
|
7
|
+
}
|
|
8
|
+
export interface Mention {
|
|
9
|
+
id: string;
|
|
10
|
+
relevanceScore?: number | null;
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
}
|
|
13
|
+
export declare function getWebsites(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
14
|
+
export declare const websiteSelect: (name: string, displayOptions: INodeProperties["displayOptions"], required?: boolean) => INodeProperties;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.websiteSelect = exports.MENTION_STATUS_OPTIONS = exports.MENTION_SOURCE_OPTIONS = void 0;
|
|
4
|
+
exports.getWebsites = getWebsites;
|
|
5
|
+
const transport_1 = require("./transport");
|
|
6
|
+
exports.MENTION_SOURCE_OPTIONS = [
|
|
7
|
+
{ name: 'Bluesky', value: 'BLUESKY' },
|
|
8
|
+
{ name: 'Facebook', value: 'FACEBOOK' },
|
|
9
|
+
{ name: 'Facebook Group', value: 'FACEBOOK_GROUP' },
|
|
10
|
+
{ name: 'Hacker News', value: 'HACKERNEWS' },
|
|
11
|
+
{ name: 'Reddit Comment', value: 'REDDIT_COMMENT' },
|
|
12
|
+
{ name: 'Reddit Post', value: 'REDDIT_POST' },
|
|
13
|
+
{ name: 'X (Twitter)', value: 'TWITTER' },
|
|
14
|
+
];
|
|
15
|
+
exports.MENTION_STATUS_OPTIONS = [
|
|
16
|
+
{ name: 'Approved', value: 'APPROVED' },
|
|
17
|
+
{ name: 'New', value: 'NEW' },
|
|
18
|
+
{ name: 'Rejected', value: 'REJECTED' },
|
|
19
|
+
];
|
|
20
|
+
async function getWebsites() {
|
|
21
|
+
const { websites } = await transport_1.redReplierApiRequest.call(this, 'GET', '/websites');
|
|
22
|
+
return websites.map((website) => ({
|
|
23
|
+
name: website.domain,
|
|
24
|
+
value: website.id,
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
const websiteSelect = (name, displayOptions, required = true) => ({
|
|
28
|
+
displayName: 'Website Name or ID',
|
|
29
|
+
name,
|
|
30
|
+
type: 'options',
|
|
31
|
+
typeOptions: { loadOptionsMethod: 'getWebsites' },
|
|
32
|
+
required,
|
|
33
|
+
default: '',
|
|
34
|
+
displayOptions,
|
|
35
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
36
|
+
});
|
|
37
|
+
exports.websiteSelect = websiteSelect;
|
|
38
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../nodes/RedReplier/shared.ts"],"names":[],"mappings":";;;AA+BA,kCAMC;AAnCD,2CAAmD;AAEtC,QAAA,sBAAsB,GAA2B;IAC7D,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;IACrC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IACvC,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE;IACnD,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,YAAY,EAAE;IAC5C,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE;IACnD,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;IAC7C,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE;CACzC,CAAC;AAEW,QAAA,sBAAsB,GAA2B;IAC7D,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IACvC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;IAC7B,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;CACvC,CAAC;AAaK,KAAK,UAAU,WAAW;IAChC,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,gCAAoB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;IAC/E,OAAQ,QAAsB,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAChD,IAAI,EAAE,OAAO,CAAC,MAAM;QACpB,KAAK,EAAE,OAAO,CAAC,EAAE;KACjB,CAAC,CAAC,CAAC;AACL,CAAC;AAEM,MAAM,aAAa,GAAG,CAC5B,IAAY,EACZ,cAAiD,EACjD,QAAQ,GAAG,IAAI,EACG,EAAE,CAAC,CAAC;IACtB,WAAW,EAAE,oBAAoB;IACjC,IAAI;IACJ,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,EAAE,iBAAiB,EAAE,aAAa,EAAE;IACjD,QAAQ;IACR,OAAO,EAAE,EAAE;IACX,cAAc;IACd,WAAW,EACV,gHAAgH;CACjH,CAAC,CAAC;AAdU,QAAA,aAAa,iBAcvB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IDataObject, IExecuteFunctions, IHookFunctions, IHttpRequestMethods, ILoadOptionsFunctions, IPollFunctions } from 'n8n-workflow';
|
|
2
|
+
export declare const API_BASE_URL = "https://ai.redreplier.com/ai-app/api/v1";
|
|
3
|
+
export declare const CREDENTIAL_NAME = "redReplierApi";
|
|
4
|
+
type ApiContext = IExecuteFunctions | IHookFunctions | ILoadOptionsFunctions | IPollFunctions;
|
|
5
|
+
export declare function redReplierApiRequest(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.redReplierApiRequest = redReplierApiRequest;
|
|
5
|
+
exports.API_BASE_URL = 'https://ai.redreplier.com/ai-app/api/v1';
|
|
6
|
+
exports.CREDENTIAL_NAME = 'redReplierApi';
|
|
7
|
+
async function redReplierApiRequest(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/RedReplier/transport.ts"],"names":[],"mappings":";;;AAgBA,oDAmBC;AAzBY,QAAA,YAAY,GAAG,yCAAyC,CAAC;AAEzD,QAAA,eAAe,GAAG,eAAe,CAAC;AAIxC,KAAK,UAAU,oBAAoB,CAEzC,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"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.websiteProperties = void 0;
|
|
4
|
+
const shared_1 = require("./shared");
|
|
5
|
+
const onlyWebsites = { resource: ['website'] };
|
|
6
|
+
exports.websiteProperties = [
|
|
7
|
+
{
|
|
8
|
+
displayName: 'Operation',
|
|
9
|
+
name: 'operation',
|
|
10
|
+
type: 'options',
|
|
11
|
+
noDataExpression: true,
|
|
12
|
+
displayOptions: { show: onlyWebsites },
|
|
13
|
+
options: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Analyze Description',
|
|
16
|
+
value: 'analyze',
|
|
17
|
+
action: 'Draft a product description from a URL',
|
|
18
|
+
description: 'Scrape a URL and draft a product description without saving anything',
|
|
19
|
+
routing: {
|
|
20
|
+
request: { method: 'POST', url: '/websites/analyze-description' },
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'Create',
|
|
25
|
+
value: 'create',
|
|
26
|
+
action: 'Start monitoring a website',
|
|
27
|
+
description: 'Start monitoring a website, optionally with a first set of keywords',
|
|
28
|
+
routing: {
|
|
29
|
+
request: { method: 'POST', url: '/websites' },
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Delete',
|
|
34
|
+
value: 'delete',
|
|
35
|
+
action: 'Stop monitoring a website',
|
|
36
|
+
routing: {
|
|
37
|
+
request: { method: 'DELETE', url: '=/websites/{{$parameter.websiteId}}' },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'Get',
|
|
42
|
+
value: 'get',
|
|
43
|
+
action: 'Get a website',
|
|
44
|
+
description: 'Get one monitored website with its keywords',
|
|
45
|
+
routing: {
|
|
46
|
+
request: { method: 'GET', url: '=/websites/{{$parameter.websiteId}}' },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'Get Many',
|
|
51
|
+
value: 'getAll',
|
|
52
|
+
action: 'Get many websites',
|
|
53
|
+
description: 'List monitored websites with their keywords',
|
|
54
|
+
routing: {
|
|
55
|
+
request: { method: 'GET', url: '/websites' },
|
|
56
|
+
output: { postReceive: [{ type: 'rootProperty', properties: { property: 'websites' } }] },
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'Update',
|
|
61
|
+
value: 'update',
|
|
62
|
+
action: 'Rename a website',
|
|
63
|
+
routing: {
|
|
64
|
+
request: { method: 'PATCH', url: '=/websites/{{$parameter.websiteId}}' },
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
default: 'getAll',
|
|
69
|
+
},
|
|
70
|
+
(0, shared_1.websiteSelect)('websiteId', { show: { resource: ['website'], operation: ['delete', 'get', 'update'] } }),
|
|
71
|
+
{
|
|
72
|
+
displayName: 'URL',
|
|
73
|
+
name: 'url',
|
|
74
|
+
type: 'string',
|
|
75
|
+
required: true,
|
|
76
|
+
default: '',
|
|
77
|
+
placeholder: 'https://example.com',
|
|
78
|
+
displayOptions: { show: { resource: ['website'], operation: ['analyze', 'create'] } },
|
|
79
|
+
description: 'Full address of the site, including https',
|
|
80
|
+
routing: { send: { type: 'body', property: 'url' } },
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
displayName: 'Name',
|
|
84
|
+
name: 'name',
|
|
85
|
+
type: 'string',
|
|
86
|
+
default: '',
|
|
87
|
+
displayOptions: { show: { resource: ['website'], operation: ['create', 'update'] } },
|
|
88
|
+
routing: { send: { type: 'body', property: 'name' } },
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
displayName: 'Keywords',
|
|
92
|
+
name: 'keywords',
|
|
93
|
+
type: 'string',
|
|
94
|
+
default: '',
|
|
95
|
+
placeholder: 'social media scheduler, buffer alternative',
|
|
96
|
+
displayOptions: { show: { resource: ['website'], operation: ['create'] } },
|
|
97
|
+
description: 'Comma-separated phrases to watch for. Keywords beyond the plan quota wait as pending.',
|
|
98
|
+
routing: {
|
|
99
|
+
send: {
|
|
100
|
+
type: 'body',
|
|
101
|
+
property: 'keywords',
|
|
102
|
+
value: '={{ $value ? $value.split(",").map((k) => k.trim()).filter(Boolean) : undefined }}',
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
];
|
|
107
|
+
//# sourceMappingURL=website.properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"website.properties.js","sourceRoot":"","sources":["../../../nodes/RedReplier/website.properties.ts"],"names":[],"mappings":";;;AAEA,qCAAyC;AAEzC,MAAM,YAAY,GAAG,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC;AAElC,QAAA,iBAAiB,GAAsB;IACnD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;QACtC,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,qBAAqB;gBAC3B,KAAK,EAAE,SAAS;gBAChB,MAAM,EAAE,wCAAwC;gBAChD,WAAW,EAAE,sEAAsE;gBACnF,OAAO,EAAE;oBACR,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,+BAA+B,EAAE;iBACjE;aACD;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,4BAA4B;gBACpC,WAAW,EAAE,qEAAqE;gBAClF,OAAO,EAAE;oBACR,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE;iBAC7C;aACD;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,2BAA2B;gBACnC,OAAO,EAAE;oBACR,OAAO,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,qCAAqC,EAAE;iBACzE;aACD;YACD;gBACC,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,eAAe;gBACvB,WAAW,EAAE,6CAA6C;gBAC1D,OAAO,EAAE;oBACR,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,qCAAqC,EAAE;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AAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE;QACpF,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE;KACrD;IACD;QACC,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,4CAA4C;QACzD,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;QAC1E,WAAW,EAAE,uFAAuF;QACpG,OAAO,EAAE;YACR,IAAI,EAAE;gBACL,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,UAAU;gBACpB,KAAK,EAAE,oFAAoF;aAC3F;SACD;KACD;CACD,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-redreplier",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "n8n community node for RedReplier: react to new Reddit, X, Bluesky and Hacker News mentions and manage monitored websites",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://redreplier.com",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"n8n-community-node-package",
|
|
9
|
+
"redreplier",
|
|
10
|
+
"reddit",
|
|
11
|
+
"social listening"
|
|
12
|
+
],
|
|
13
|
+
"author": {
|
|
14
|
+
"name": "RedReplier",
|
|
15
|
+
"email": "contact@redreplier.com"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/RedReplier/n8n-nodes-redreplier.git"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "n8n-node build",
|
|
23
|
+
"build:watch": "tsc --watch",
|
|
24
|
+
"dev": "n8n-node dev",
|
|
25
|
+
"lint": "n8n-node lint",
|
|
26
|
+
"lint:fix": "n8n-node lint --fix",
|
|
27
|
+
"release": "n8n-node release",
|
|
28
|
+
"prepublishOnly": "n8n-node prerelease"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"n8n": {
|
|
34
|
+
"n8nNodesApiVersion": 1,
|
|
35
|
+
"strict": true,
|
|
36
|
+
"credentials": [
|
|
37
|
+
"dist/credentials/RedReplierApi.credentials.js"
|
|
38
|
+
],
|
|
39
|
+
"nodes": [
|
|
40
|
+
"dist/nodes/RedReplier/RedReplier.node.js",
|
|
41
|
+
"dist/nodes/RedReplier/RedReplierTrigger.node.js"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@n8n/node-cli": "^0.47.2",
|
|
46
|
+
"eslint": "9.32.0",
|
|
47
|
+
"prettier": "3.6.2",
|
|
48
|
+
"release-it": "^19.0.4",
|
|
49
|
+
"typescript": "5.9.2"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"n8n-workflow": "*"
|
|
53
|
+
}
|
|
54
|
+
}
|