@activepieces/piece-text-helper 0.3.0 → 0.4.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/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-text-helper",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@anthropic-ai/sdk": "0.
|
|
5
|
+
"@anthropic-ai/sdk": "0.33.1",
|
|
6
6
|
"@sinclair/typebox": "0.34.11",
|
|
7
7
|
"axios": "1.7.8",
|
|
8
8
|
"axios-retry": "4.4.1",
|
|
9
9
|
"deepmerge-ts": "7.1.0",
|
|
10
|
-
"jsdom": "23.0.1",
|
|
11
10
|
"mime-types": "2.1.35",
|
|
12
11
|
"nanoid": "3.3.8",
|
|
13
12
|
"openai": "4.67.1",
|
|
@@ -16,10 +15,11 @@
|
|
|
16
15
|
"showdown": "2.1.0",
|
|
17
16
|
"slugify": "1.6.6",
|
|
18
17
|
"string-strip-html": "8.5.0",
|
|
18
|
+
"turndown": "7.2.0",
|
|
19
19
|
"zod": "3.23.8",
|
|
20
20
|
"@activepieces/pieces-common": "0.3.0",
|
|
21
21
|
"@activepieces/pieces-framework": "0.7.42",
|
|
22
|
-
"@activepieces/shared": "0.10.
|
|
22
|
+
"@activepieces/shared": "0.10.141",
|
|
23
23
|
"tslib": "1.14.1"
|
|
24
24
|
},
|
|
25
25
|
"overrides": {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export declare const htmlToMarkdown: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
2
2
|
html: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
3
|
-
flavor: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
4
3
|
}>;
|
|
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.htmlToMarkdown = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const
|
|
7
|
-
const jsdom_1 = require("jsdom");
|
|
6
|
+
const turndown_1 = tslib_1.__importDefault(require("turndown"));
|
|
8
7
|
exports.htmlToMarkdown = (0, pieces_framework_1.createAction)({
|
|
9
8
|
name: 'html_to_markdown',
|
|
10
9
|
displayName: 'HTML to Markdown',
|
|
@@ -23,26 +22,12 @@ exports.htmlToMarkdown = (0, pieces_framework_1.createAction)({
|
|
|
23
22
|
description: 'The HTML to convert to markdown',
|
|
24
23
|
required: true,
|
|
25
24
|
}),
|
|
26
|
-
flavor: pieces_framework_1.Property.StaticDropdown({
|
|
27
|
-
displayName: 'Flavor of Markdown',
|
|
28
|
-
description: 'The flavor of markdown use during conversion',
|
|
29
|
-
required: true,
|
|
30
|
-
defaultValue: 'vanilla',
|
|
31
|
-
options: {
|
|
32
|
-
options: [
|
|
33
|
-
{ label: 'Default', value: 'vanilla' },
|
|
34
|
-
{ label: 'Original', value: 'original' },
|
|
35
|
-
{ label: 'GitHub', value: 'github' },
|
|
36
|
-
],
|
|
37
|
-
},
|
|
38
|
-
}),
|
|
39
25
|
},
|
|
40
26
|
run: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
41
27
|
const html = context.propsValue.html;
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return converter.makeMarkdown(html, doc.window.document);
|
|
28
|
+
const service = new turndown_1.default();
|
|
29
|
+
service.remove('script');
|
|
30
|
+
return service.turndown(html);
|
|
46
31
|
}),
|
|
47
32
|
});
|
|
48
33
|
//# sourceMappingURL=html-to-markdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-to-markdown.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/text-helper/src/lib/actions/html-to-markdown.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,
|
|
1
|
+
{"version":3,"file":"html-to-markdown.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/text-helper/src/lib/actions/html-to-markdown.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,gEAAuC;AAE1B,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,0BAA0B;IACvC,oBAAoB,EAAE;QACpB,iBAAiB,EAAE;YACjB,IAAI,EAAE,IAAI;SACX;QACD,cAAc,EAAE;YACd,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACD,GAAG,EAAE,CAAO,OAAO,EAAE,EAAE;QACrB,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC;QACrC,MAAM,OAAO,GAAG,IAAI,kBAAe,EAAE,CAAC;QACtC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACzB,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC,CAAA;CACF,CAAC,CAAC"}
|