n8n-nodes-substack 1.7.3 → 3.0.2
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/README.md +33 -73
- package/dist/credentials/SubstackApi.credentials.js +1 -1
- package/dist/credentials/SubstackApi.credentials.js.map +1 -1
- package/dist/nodes/Substack/Comment.fields.js +14 -0
- package/dist/nodes/Substack/Comment.fields.js.map +1 -1
- package/dist/nodes/Substack/Comment.operations.d.ts +2 -1
- package/dist/nodes/Substack/Comment.operations.js +29 -2
- package/dist/nodes/Substack/Comment.operations.js.map +1 -1
- package/dist/nodes/Substack/MarkdownParser.d.ts +11 -0
- package/dist/nodes/Substack/MarkdownParser.js +228 -0
- package/dist/nodes/Substack/MarkdownParser.js.map +1 -0
- package/dist/nodes/Substack/Note.fields.js +57 -2
- package/dist/nodes/Substack/Note.fields.js.map +1 -1
- package/dist/nodes/Substack/Note.operations.d.ts +1 -0
- package/dist/nodes/Substack/Note.operations.js +107 -9
- package/dist/nodes/Substack/Note.operations.js.map +1 -1
- package/dist/nodes/Substack/Post.fields.js +30 -0
- package/dist/nodes/Substack/Post.fields.js.map +1 -1
- package/dist/nodes/Substack/Post.operations.d.ts +1 -0
- package/dist/nodes/Substack/Post.operations.js +32 -2
- package/dist/nodes/Substack/Post.operations.js.map +1 -1
- package/dist/nodes/Substack/Profile.fields.js +14 -0
- package/dist/nodes/Substack/Profile.fields.js.map +1 -1
- package/dist/nodes/Substack/Profile.operations.d.ts +1 -0
- package/dist/nodes/Substack/Profile.operations.js +30 -1
- package/dist/nodes/Substack/Profile.operations.js.map +1 -1
- package/dist/nodes/Substack/SubstackUtils.d.ts +8 -0
- package/dist/nodes/Substack/SubstackUtils.js +31 -1
- package/dist/nodes/Substack/SubstackUtils.js.map +1 -1
- package/dist/nodes/Substack/shared/DataFormatters.js +38 -20
- package/dist/nodes/Substack/shared/DataFormatters.js.map +1 -1
- package/dist/nodes/Substack/shared/ResourceOperations.d.ts +25 -0
- package/dist/nodes/Substack/shared/ResourceOperations.js +59 -0
- package/dist/nodes/Substack/shared/ResourceOperations.js.map +1 -0
- package/dist/nodes/Substack/types.d.ts +18 -3
- package/dist/package.json +9 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -5
|
@@ -1,50 +1,67 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.DataFormatters = void 0;
|
|
4
7
|
const SubstackUtils_1 = require("../SubstackUtils");
|
|
8
|
+
const turndown_1 = __importDefault(require("turndown"));
|
|
5
9
|
class DataFormatters {
|
|
6
10
|
static formatNote(note, publicationAddress) {
|
|
7
|
-
var _a, _b, _c;
|
|
11
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
8
12
|
return {
|
|
9
|
-
noteId: ((_a = note.
|
|
13
|
+
noteId: ((_c = (_b = (_a = note.rawData) === null || _a === void 0 ? void 0 : _a.comment) === null || _b === void 0 ? void 0 : _b.id) === null || _c === void 0 ? void 0 : _c.toString()) || ((_d = note.id) === null || _d === void 0 ? void 0 : _d.toString()) || 'unknown',
|
|
10
14
|
body: note.body || '',
|
|
11
|
-
url: SubstackUtils_1.SubstackUtils.formatUrl(publicationAddress, `/p/${note.id || 'unknown'}`),
|
|
12
|
-
date: DataFormatters.formatDate(note.publishedAt || new Date()),
|
|
15
|
+
url: SubstackUtils_1.SubstackUtils.formatUrl(publicationAddress, `/p/${((_f = (_e = note.rawData) === null || _e === void 0 ? void 0 : _e.comment) === null || _f === void 0 ? void 0 : _f.id) || note.id || 'unknown'}`),
|
|
16
|
+
date: DataFormatters.formatDate(((_h = (_g = note.rawData) === null || _g === void 0 ? void 0 : _g.context) === null || _h === void 0 ? void 0 : _h.timestamp) || note.publishedAt || new Date()),
|
|
13
17
|
status: 'published',
|
|
14
|
-
userId: ((
|
|
18
|
+
userId: ((_k = (_j = note.author) === null || _j === void 0 ? void 0 : _j.id) === null || _k === void 0 ? void 0 : _k.toString()) || 'unknown',
|
|
15
19
|
likes: note.likesCount || 0,
|
|
20
|
+
restacks: ((_m = (_l = note.rawData) === null || _l === void 0 ? void 0 : _l.comment) === null || _m === void 0 ? void 0 : _m.restacks) || 0,
|
|
16
21
|
type: 'note',
|
|
22
|
+
entityKey: ((_o = note.rawData) === null || _o === void 0 ? void 0 : _o.entity_key) || note.id,
|
|
17
23
|
};
|
|
18
24
|
}
|
|
19
25
|
static formatPost(post, publicationAddress) {
|
|
26
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
27
|
+
const htmlBody = post.htmlBody || '';
|
|
28
|
+
const turndownService = new turndown_1.default();
|
|
29
|
+
const markdown = htmlBody ? turndownService.turndown(htmlBody) : '';
|
|
20
30
|
return {
|
|
21
31
|
id: post.id,
|
|
22
32
|
title: post.title || '',
|
|
23
|
-
subtitle: post.subtitle || '',
|
|
24
|
-
slug: post.slug,
|
|
25
|
-
url:
|
|
26
|
-
postDate: DataFormatters.formatDate(post.publishedAt || new Date()),
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
subtitle: ((_a = post.rawData) === null || _a === void 0 ? void 0 : _a.subtitle) || '',
|
|
34
|
+
slug: ((_b = post.rawData) === null || _b === void 0 ? void 0 : _b.slug) || post.slug,
|
|
35
|
+
url: SubstackUtils_1.SubstackUtils.formatUrl(publicationAddress, `/p/${((_c = post.rawData) === null || _c === void 0 ? void 0 : _c.slug) || post.slug || post.id}`),
|
|
36
|
+
postDate: DataFormatters.formatDate(((_d = post.rawData) === null || _d === void 0 ? void 0 : _d.post_date) || post.publishedAt || new Date()),
|
|
37
|
+
type: ((_e = post.rawData) === null || _e === void 0 ? void 0 : _e.type) || 'newsletter',
|
|
38
|
+
published: (_g = (_f = post.rawData) === null || _f === void 0 ? void 0 : _f.published) !== null && _g !== void 0 ? _g : true,
|
|
39
|
+
paywalled: (_j = (_h = post.rawData) === null || _h === void 0 ? void 0 : _h.paywalled) !== null && _j !== void 0 ? _j : false,
|
|
40
|
+
description: ((_k = post.rawData) === null || _k === void 0 ? void 0 : _k.description) || post.body || '',
|
|
41
|
+
htmlBody: htmlBody,
|
|
42
|
+
markdown: markdown,
|
|
30
43
|
};
|
|
31
44
|
}
|
|
32
45
|
static formatComment(comment, parentPostId) {
|
|
46
|
+
var _a, _b;
|
|
33
47
|
return {
|
|
34
48
|
id: comment.id,
|
|
35
49
|
body: comment.body,
|
|
36
|
-
|
|
37
|
-
parentPostId: parentPostId || 0,
|
|
50
|
+
createdAt: ((_a = comment.rawData) === null || _a === void 0 ? void 0 : _a.created_at) || comment.createdAt.toISOString(),
|
|
51
|
+
parentPostId: parentPostId || ((_b = comment.rawData) === null || _b === void 0 ? void 0 : _b.parent_post_id) || 0,
|
|
52
|
+
author: {
|
|
53
|
+
id: comment.author.id,
|
|
54
|
+
name: comment.author.name,
|
|
55
|
+
isAdmin: comment.author.isAdmin || false,
|
|
56
|
+
},
|
|
38
57
|
};
|
|
39
58
|
}
|
|
40
59
|
static formatProfile(profile) {
|
|
41
60
|
return {
|
|
42
61
|
id: profile.id,
|
|
43
62
|
name: profile.name,
|
|
44
|
-
handle: profile.
|
|
63
|
+
handle: profile.slug,
|
|
45
64
|
bio: profile.bio,
|
|
46
|
-
url: profile.url,
|
|
47
|
-
avatarUrl: profile.avatarUrl,
|
|
48
65
|
};
|
|
49
66
|
}
|
|
50
67
|
static formatFollowing(followee, returnType) {
|
|
@@ -56,10 +73,11 @@ class DataFormatters {
|
|
|
56
73
|
return {
|
|
57
74
|
id: followee.id,
|
|
58
75
|
name: followee.name,
|
|
59
|
-
handle: followee.
|
|
76
|
+
handle: followee.slug,
|
|
60
77
|
bio: followee.bio,
|
|
61
|
-
|
|
62
|
-
|
|
78
|
+
subscriberCount: 0,
|
|
79
|
+
subscriberCountString: '',
|
|
80
|
+
primaryPublication: undefined,
|
|
63
81
|
};
|
|
64
82
|
}
|
|
65
83
|
static formatDate(date) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataFormatters.js","sourceRoot":"","sources":["../../../../nodes/Substack/shared/DataFormatters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataFormatters.js","sourceRoot":"","sources":["../../../../nodes/Substack/shared/DataFormatters.ts"],"names":[],"mappings":";;;;;;AACA,oDAAiD;AACjD,wDAAuC;AAEvC,MAAa,cAAc;IAI1B,MAAM,CAAC,UAAU,CAAC,IAAS,EAAE,kBAA0B;;QACtD,OAAO;YACN,MAAM,EAAE,CAAA,MAAA,MAAA,MAAC,IAAY,CAAC,OAAO,0CAAE,OAAO,0CAAE,EAAE,0CAAE,QAAQ,EAAE,MAAI,MAAA,IAAI,CAAC,EAAE,0CAAE,QAAQ,EAAE,CAAA,IAAI,SAAS;YAC1F,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE;YACrB,GAAG,EAAE,6BAAa,CAAC,SAAS,CAC3B,kBAAkB,EAClB,MAAM,CAAA,MAAA,MAAC,IAAY,CAAC,OAAO,0CAAE,OAAO,0CAAE,EAAE,KAAI,IAAI,CAAC,EAAE,IAAI,SAAS,EAAE,CAClE;YACD,IAAI,EAAE,cAAc,CAAC,UAAU,CAC9B,CAAA,MAAA,MAAC,IAAY,CAAC,OAAO,0CAAE,OAAO,0CAAE,SAAS,KAAI,IAAI,CAAC,WAAW,IAAI,IAAI,IAAI,EAAE,CAC3E;YACD,MAAM,EAAE,WAAW;YACnB,MAAM,EAAE,CAAA,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,EAAE,0CAAE,QAAQ,EAAE,KAAI,SAAS;YAChD,KAAK,EAAE,IAAI,CAAC,UAAU,IAAI,CAAC;YAC3B,QAAQ,EAAE,CAAA,MAAA,MAAC,IAAY,CAAC,OAAO,0CAAE,OAAO,0CAAE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B,eAAe,EAAE,CAAC;YAClB,qBAAqB,EAAE,EAAE;YACzB,kBAAkB,EAAE,SAAS;SAC7B,CAAC;IACH,CAAC;IAKD,MAAM,CAAC,UAAU,CAAC,IAAS;QAC1B,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;YAC9C,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;QACrC,CAAC;QACD,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACjC,CAAC;CACD;AA7GD,wCA6GC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
import { SubstackClient } from 'substack-api';
|
|
3
|
+
import { IStandardResponse } from '../types';
|
|
4
|
+
export declare class ResourceOperations {
|
|
5
|
+
static executeResourceList<T>(config: {
|
|
6
|
+
executeFunctions: IExecuteFunctions;
|
|
7
|
+
client: SubstackClient;
|
|
8
|
+
publicationAddress: string;
|
|
9
|
+
itemIndex: number;
|
|
10
|
+
getIterable: (client: SubstackClient, params: any) => Promise<AsyncIterable<T>>;
|
|
11
|
+
formatter: (item: T, publicationAddress: string, ...args: any[]) => any;
|
|
12
|
+
additionalParams?: Record<string, any>;
|
|
13
|
+
formatterArgs?: any[];
|
|
14
|
+
}): Promise<IStandardResponse>;
|
|
15
|
+
static executeSingleResource<T>(config: {
|
|
16
|
+
executeFunctions: IExecuteFunctions;
|
|
17
|
+
client: SubstackClient;
|
|
18
|
+
publicationAddress: string;
|
|
19
|
+
itemIndex: number;
|
|
20
|
+
getResource: (client: SubstackClient, params: any) => Promise<T>;
|
|
21
|
+
formatter: (item: T, publicationAddress: string, ...args: any[]) => any;
|
|
22
|
+
additionalParams?: Record<string, any>;
|
|
23
|
+
formatterArgs?: any[];
|
|
24
|
+
}): Promise<IStandardResponse>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResourceOperations = void 0;
|
|
4
|
+
const SubstackUtils_1 = require("../SubstackUtils");
|
|
5
|
+
const OperationUtils_1 = require("./OperationUtils");
|
|
6
|
+
class ResourceOperations {
|
|
7
|
+
static async executeResourceList(config) {
|
|
8
|
+
try {
|
|
9
|
+
const limitParam = config.executeFunctions.getNodeParameter('limit', config.itemIndex, '');
|
|
10
|
+
const limit = OperationUtils_1.OperationUtils.parseLimit(limitParam);
|
|
11
|
+
const params = {};
|
|
12
|
+
if (config.additionalParams) {
|
|
13
|
+
for (const [key, defaultValue] of Object.entries(config.additionalParams)) {
|
|
14
|
+
params[key] = config.executeFunctions.getNodeParameter(key, config.itemIndex, defaultValue);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const iterable = await config.getIterable(config.client, params);
|
|
18
|
+
const results = await OperationUtils_1.OperationUtils.executeAsyncIterable(iterable, limit, config.formatter, config.publicationAddress, ...(config.formatterArgs || []));
|
|
19
|
+
return {
|
|
20
|
+
success: true,
|
|
21
|
+
data: results,
|
|
22
|
+
metadata: { status: 'success' },
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
return SubstackUtils_1.SubstackUtils.formatErrorResponse({
|
|
27
|
+
message: error.message,
|
|
28
|
+
node: config.executeFunctions.getNode(),
|
|
29
|
+
itemIndex: config.itemIndex,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
static async executeSingleResource(config) {
|
|
34
|
+
try {
|
|
35
|
+
const params = {};
|
|
36
|
+
if (config.additionalParams) {
|
|
37
|
+
for (const [key, defaultValue] of Object.entries(config.additionalParams)) {
|
|
38
|
+
params[key] = config.executeFunctions.getNodeParameter(key, config.itemIndex, defaultValue);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const resource = await config.getResource(config.client, params);
|
|
42
|
+
const result = config.formatter(resource, config.publicationAddress, ...(config.formatterArgs || []));
|
|
43
|
+
return {
|
|
44
|
+
success: true,
|
|
45
|
+
data: result,
|
|
46
|
+
metadata: { status: 'success' },
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
return SubstackUtils_1.SubstackUtils.formatErrorResponse({
|
|
51
|
+
message: error.message,
|
|
52
|
+
node: config.executeFunctions.getNode(),
|
|
53
|
+
itemIndex: config.itemIndex,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.ResourceOperations = ResourceOperations;
|
|
59
|
+
//# sourceMappingURL=ResourceOperations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceOperations.js","sourceRoot":"","sources":["../../../../nodes/Substack/shared/ResourceOperations.ts"],"names":[],"mappings":";;;AAGA,oDAAiD;AACjD,qDAAkD;AAElD,MAAa,kBAAkB;IAI9B,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAI,MASnC;QACA,IAAI,CAAC;YACJ,MAAM,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;YAC3F,MAAM,KAAK,GAAG,+BAAc,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;YAGpD,MAAM,MAAM,GAAQ,EAAE,CAAC;YACvB,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;gBAC7B,KAAK,MAAM,CAAC,GAAG,EAAE,YAAY,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC;oBAC3E,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,gBAAgB,CAAC,gBAAgB,CACrD,GAAG,EACH,MAAM,CAAC,SAAS,EAChB,YAAY,CACZ,CAAC;gBACH,CAA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AAC,SAAS,CAC9B,QAAQ,EACR,MAAM,CAAC,kBAAkB,EACzB,GAAG,CAAC,MAAM,CAAC,aAAa,IAAI,EAAE,CAAC,CAC/B,CAAC;YAEF,OAAO;gBACN,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;aAC/B,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,6BAAa,CAAC,mBAAmB,CAAC;gBACxC,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,IAAI,EAAE,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE;gBACvC,SAAS,EAAE,MAAM,CAAC,SAAS;aAC3B,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;CACD;AAnGD,gDAmGC"}
|
|
@@ -17,7 +17,9 @@ export interface ISubstackNote {
|
|
|
17
17
|
status: string;
|
|
18
18
|
userId: string;
|
|
19
19
|
likes?: number;
|
|
20
|
+
restacks?: number;
|
|
20
21
|
type?: string;
|
|
22
|
+
entityKey?: string;
|
|
21
23
|
}
|
|
22
24
|
export interface ISubstackPost {
|
|
23
25
|
id: number;
|
|
@@ -26,6 +28,9 @@ export interface ISubstackPost {
|
|
|
26
28
|
slug?: string;
|
|
27
29
|
url: string;
|
|
28
30
|
postDate: string;
|
|
31
|
+
type: 'newsletter' | 'podcast' | 'thread';
|
|
32
|
+
published?: boolean;
|
|
33
|
+
paywalled?: boolean;
|
|
29
34
|
description?: string;
|
|
30
35
|
htmlBody?: string;
|
|
31
36
|
markdown?: string;
|
|
@@ -33,16 +38,26 @@ export interface ISubstackPost {
|
|
|
33
38
|
export interface ISubstackComment {
|
|
34
39
|
id: number;
|
|
35
40
|
body: string;
|
|
36
|
-
|
|
41
|
+
createdAt: string;
|
|
37
42
|
parentPostId: number;
|
|
43
|
+
author: {
|
|
44
|
+
id: number;
|
|
45
|
+
name: string;
|
|
46
|
+
isAdmin?: boolean;
|
|
47
|
+
};
|
|
38
48
|
}
|
|
39
49
|
export interface ISubstackFollowing {
|
|
40
50
|
id: number;
|
|
41
51
|
name?: string;
|
|
42
52
|
handle?: string;
|
|
43
53
|
bio?: string;
|
|
44
|
-
|
|
45
|
-
|
|
54
|
+
subscriberCount?: number;
|
|
55
|
+
subscriberCountString?: string;
|
|
56
|
+
primaryPublication?: {
|
|
57
|
+
id: number;
|
|
58
|
+
name: string;
|
|
59
|
+
subdomain: string;
|
|
60
|
+
};
|
|
46
61
|
}
|
|
47
62
|
export interface IErrorResponse {
|
|
48
63
|
message: string;
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-substack",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "n8n community node for Substack API integration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"format": "prettier nodes credentials --write",
|
|
26
26
|
"lint": "eslint nodes credentials package.json",
|
|
27
27
|
"lintfix": "eslint nodes credentials package.json --fix",
|
|
28
|
-
"prepublishOnly": "pnpm run build && eslint -c eslint.prepublish.config.js nodes credentials package.json",
|
|
28
|
+
"prepublishOnly": "pnpm run build && pnpm exec eslint -c eslint.prepublish.config.js nodes credentials package.json",
|
|
29
29
|
"test": "jest",
|
|
30
30
|
"test:watch": "jest --watch",
|
|
31
31
|
"test:unit": "jest",
|
|
@@ -45,8 +45,10 @@
|
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/jest": "^30.0.0",
|
|
48
|
-
"@
|
|
49
|
-
"
|
|
48
|
+
"@types/marked": "^4.3.2",
|
|
49
|
+
"@types/turndown": "^5.0.5",
|
|
50
|
+
"@typescript-eslint/parser": "~8.59.0",
|
|
51
|
+
"eslint": "^9.29.0",
|
|
50
52
|
"eslint-plugin-n8n-nodes-base": "^1.16.3",
|
|
51
53
|
"gulp": "^5.0.0",
|
|
52
54
|
"jest": "^30.0.3",
|
|
@@ -58,6 +60,8 @@
|
|
|
58
60
|
"n8n-workflow": "^1.82.0"
|
|
59
61
|
},
|
|
60
62
|
"dependencies": {
|
|
61
|
-
"
|
|
63
|
+
"marked": "^4.3.0",
|
|
64
|
+
"substack-api": "^4.0.0",
|
|
65
|
+
"turndown": "^7.2.0"
|
|
62
66
|
}
|
|
63
67
|
}
|