@activepieces/piece-text-helper 0.5.1 → 0.6.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 +7 -23
- package/src/index.js +442 -53
- package/src/index.d.ts +0 -2
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/concat.d.ts +0 -5
- package/src/lib/actions/concat.d.ts.map +0 -1
- package/src/lib/actions/concat.js +0 -35
- package/src/lib/actions/concat.js.map +0 -1
- package/src/lib/actions/default-value.d.ts +0 -5
- package/src/lib/actions/default-value.d.ts.map +0 -1
- package/src/lib/actions/default-value.js +0 -43
- package/src/lib/actions/default-value.js.map +0 -1
- package/src/lib/actions/extract-from-html.d.ts +0 -9
- package/src/lib/actions/extract-from-html.d.ts.map +0 -1
- package/src/lib/actions/extract-from-html.js +0 -138
- package/src/lib/actions/extract-from-html.js.map +0 -1
- package/src/lib/actions/find-all.d.ts +0 -6
- package/src/lib/actions/find-all.d.ts.map +0 -1
- package/src/lib/actions/find-all.js +0 -48
- package/src/lib/actions/find-all.js.map +0 -1
- package/src/lib/actions/find.d.ts +0 -6
- package/src/lib/actions/find.d.ts.map +0 -1
- package/src/lib/actions/find.js +0 -48
- package/src/lib/actions/find.js.map +0 -1
- package/src/lib/actions/html-to-markdown.d.ts +0 -4
- package/src/lib/actions/html-to-markdown.d.ts.map +0 -1
- package/src/lib/actions/html-to-markdown.js +0 -34
- package/src/lib/actions/html-to-markdown.js.map +0 -1
- package/src/lib/actions/json-to-ascii-table.d.ts +0 -4
- package/src/lib/actions/json-to-ascii-table.d.ts.map +0 -1
- package/src/lib/actions/json-to-ascii-table.js +0 -64
- package/src/lib/actions/json-to-ascii-table.js.map +0 -1
- package/src/lib/actions/markdown-to-html.d.ts +0 -10
- package/src/lib/actions/markdown-to-html.d.ts.map +0 -1
- package/src/lib/actions/markdown-to-html.js +0 -88
- package/src/lib/actions/markdown-to-html.js.map +0 -1
- package/src/lib/actions/replace.d.ts +0 -7
- package/src/lib/actions/replace.d.ts.map +0 -1
- package/src/lib/actions/replace.js +0 -49
- package/src/lib/actions/replace.js.map +0 -1
- package/src/lib/actions/slugify.d.ts +0 -4
- package/src/lib/actions/slugify.d.ts.map +0 -1
- package/src/lib/actions/slugify.js +0 -22
- package/src/lib/actions/slugify.js.map +0 -1
- package/src/lib/actions/split.d.ts +0 -5
- package/src/lib/actions/split.d.ts.map +0 -1
- package/src/lib/actions/split.js +0 -33
- package/src/lib/actions/split.js.map +0 -1
- package/src/lib/actions/strip-html.d.ts +0 -4
- package/src/lib/actions/strip-html.d.ts.map +0 -1
- package/src/lib/actions/strip-html.js +0 -24
- package/src/lib/actions/strip-html.js.map +0 -1
package/src/index.d.ts
DELETED
package/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,UAAU,2DAkCrB,CAAC"}
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AACxE,iDAAqD;AACrD,iDAA8C;AAC9C,6CAA0C;AAC1C,qDAAiD;AACjD,qEAAgE;AAChE,qEAAgE;AAChE,mDAAgD;AAChD,+CAA4C;AAC5C,yDAA4D;AAC5D,mDAAsD;AACtD,+DAA2D;AAC3D,2EAAqE;AACrE,uEAAkE;AAErD,QAAA,UAAU,GAAG,IAAA,8BAAW,EAAC;IACpC,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,2BAA2B;IACxC,IAAI,EAAE,4BAAS,CAAC,IAAI,EAAE;IACtB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,8DAA8D;IACvE,OAAO,EAAE;QACP,YAAY;QACZ,YAAY;QACZ,WAAW;QACX,sBAAsB;QACtB,UAAU;QACV,YAAY;QACZ,WAAW;QACX,SAAS;QACT,aAAa;QACb,mBAAmB;KACpB;IACD,UAAU,EAAE,CAAC,sBAAa,CAAC,IAAI,CAAC;IAChC,OAAO,EAAE;QACP,eAAM;QACN,iBAAO;QACP,aAAK;QACL,WAAI;QACJ,kBAAO;QACP,iCAAc;QACd,iCAAc;QACd,6BAAgB;QAChB,uBAAa;QACb,4BAAY;QACZ,sCAAgB;QAChB,mCAAe;KAChB;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const concat: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
2
|
-
texts: import("@activepieces/pieces-framework").ArrayProperty<true>;
|
|
3
|
-
separator: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
-
}>;
|
|
5
|
-
//# sourceMappingURL=concat.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"concat.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/concat.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;;;EA2BjB,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.concat = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
exports.concat = (0, pieces_framework_1.createAction)({
|
|
7
|
-
audience: 'human',
|
|
8
|
-
description: 'Concatenate two or more texts',
|
|
9
|
-
displayName: 'Concatenate',
|
|
10
|
-
name: 'concat',
|
|
11
|
-
errorHandlingOptions: {
|
|
12
|
-
continueOnFailure: {
|
|
13
|
-
hide: true,
|
|
14
|
-
},
|
|
15
|
-
retryOnFailure: {
|
|
16
|
-
hide: true,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
texts: pieces_framework_1.Property.Array({
|
|
21
|
-
displayName: 'Texts',
|
|
22
|
-
required: true,
|
|
23
|
-
}),
|
|
24
|
-
separator: pieces_framework_1.Property.ShortText({
|
|
25
|
-
displayName: 'Separator',
|
|
26
|
-
description: 'The text that separates the texts you want to concatenate',
|
|
27
|
-
required: false,
|
|
28
|
-
}),
|
|
29
|
-
},
|
|
30
|
-
run: (ctx) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
-
var _a, _b;
|
|
32
|
-
return ((_a = ctx.propsValue.texts) !== null && _a !== void 0 ? _a : []).join((_b = ctx.propsValue.separator) !== null && _b !== void 0 ? _b : '');
|
|
33
|
-
}),
|
|
34
|
-
});
|
|
35
|
-
//# sourceMappingURL=concat.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"concat.js","sourceRoot":"","sources":["../../../../src/lib/actions/concat.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AAE3D,QAAA,MAAM,GAAG,IAAA,+BAAY,EAAC;IACjC,QAAQ,EAAE,OAAO;IACjB,WAAW,EAAE,+BAA+B;IAC5C,WAAW,EAAE,aAAa;IAC1B,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE;QACpB,iBAAiB,EAAE;YACjB,IAAI,EAAE,IAAI;SACX;QACD,cAAc,EAAE;YACd,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACpB,WAAW,EAAE,OAAO;YACpB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,2DAA2D;YACxE,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACD,GAAG,EAAE,CAAO,GAAG,EAAE,EAAE;;QACjB,OAAO,CAAC,MAAA,GAAG,CAAC,UAAU,CAAC,KAAK,mCAAI,EAAE,CAAC,CAAC,IAAI,CAAC,MAAA,GAAG,CAAC,UAAU,CAAC,SAAS,mCAAI,EAAE,CAAC,CAAC;IAC3E,CAAC,CAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const defaultValue: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
2
|
-
value: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
3
|
-
defaultString: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
}>;
|
|
5
|
-
//# sourceMappingURL=default-value.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-value.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/default-value.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY;;;EAkCvB,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultValue = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const shared_1 = require("@activepieces/shared");
|
|
7
|
-
exports.defaultValue = (0, pieces_framework_1.createAction)({
|
|
8
|
-
audience: 'human',
|
|
9
|
-
// auth: check https://www.activepieces.com/docs/developers/piece-reference/authentication,
|
|
10
|
-
name: 'defaultValue',
|
|
11
|
-
errorHandlingOptions: {
|
|
12
|
-
continueOnFailure: {
|
|
13
|
-
hide: true,
|
|
14
|
-
},
|
|
15
|
-
retryOnFailure: {
|
|
16
|
-
hide: true,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
displayName: 'Use Default Value if Input is Empty',
|
|
20
|
-
description: 'Checks your input and returns the default value, if the input is an empty text or list',
|
|
21
|
-
props: {
|
|
22
|
-
value: pieces_framework_1.Property.ShortText({
|
|
23
|
-
displayName: 'Enter value',
|
|
24
|
-
description: 'Enter value',
|
|
25
|
-
required: false,
|
|
26
|
-
}),
|
|
27
|
-
defaultString: pieces_framework_1.Property.ShortText({
|
|
28
|
-
displayName: 'Default Value',
|
|
29
|
-
required: true,
|
|
30
|
-
}),
|
|
31
|
-
},
|
|
32
|
-
run(context) {
|
|
33
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
// Action logic here
|
|
35
|
-
const { value, defaultString } = context.propsValue;
|
|
36
|
-
if ((0, shared_1.isEmpty)(value)) {
|
|
37
|
-
return defaultString;
|
|
38
|
-
}
|
|
39
|
-
return value;
|
|
40
|
-
});
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
//# sourceMappingURL=default-value.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-value.js","sourceRoot":"","sources":["../../../../src/lib/actions/default-value.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,iDAA+C;AAElC,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,QAAQ,EAAE,OAAO;IACjB,2FAA2F;IAC3F,IAAI,EAAE,cAAc;IACpB,oBAAoB,EAAE;QACpB,iBAAiB,EAAE;YACjB,IAAI,EAAE,IAAI;SACX;QACD,cAAc,EAAE;YACd,IAAI,EAAE,IAAI;SACX;KACF;IACD,WAAW,EAAE,qCAAqC;IAClD,WAAW,EACT,wFAAwF;IAC1F,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,aAAa;YAC1B,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,aAAa,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAChC,WAAW,EAAE,eAAe;YAC5B,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,oBAAoB;YACpB,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACpD,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC,EAAE,CAAC;gBACnB,OAAO,aAAa,CAAC;YACvB,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const extractFromHtml: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
2
|
-
html: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
3
|
-
target: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
4
|
-
selector: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
|
-
extractionType: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
6
|
-
attributeName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
7
|
-
returnMultiple: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
8
|
-
}>;
|
|
9
|
-
//# sourceMappingURL=extract-from-html.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extract-from-html.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/extract-from-html.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe;;;;;;;EAoJ1B,CAAC"}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extractFromHtml = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const jsdom_1 = require("jsdom");
|
|
7
|
-
exports.extractFromHtml = (0, pieces_framework_1.createAction)({
|
|
8
|
-
audience: 'human',
|
|
9
|
-
name: 'extract_from_html',
|
|
10
|
-
displayName: 'Extract from HTML',
|
|
11
|
-
description: 'Extract specific elements or data from an HTML document.',
|
|
12
|
-
props: {
|
|
13
|
-
html: pieces_framework_1.Property.LongText({
|
|
14
|
-
displayName: 'HTML Content',
|
|
15
|
-
description: 'The raw HTML string to extract data from.',
|
|
16
|
-
required: true,
|
|
17
|
-
}),
|
|
18
|
-
target: pieces_framework_1.Property.StaticDropdown({
|
|
19
|
-
displayName: 'Extraction Target',
|
|
20
|
-
description: 'What do you want to extract from the page?',
|
|
21
|
-
required: true,
|
|
22
|
-
options: {
|
|
23
|
-
disabled: false,
|
|
24
|
-
options: [
|
|
25
|
-
{ label: 'Page Title', value: 'title' },
|
|
26
|
-
{ label: 'All Links (<a> elements)', value: 'links' },
|
|
27
|
-
{ label: 'All Images', value: 'images' },
|
|
28
|
-
{ label: 'Main Headings (H1, H2, H3)', value: 'headings' },
|
|
29
|
-
{ label: 'Paragraphs / Text Blocks', value: 'paragraphs' },
|
|
30
|
-
{ label: 'Custom CSS Selector (Advanced)', value: 'custom' },
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
defaultValue: 'title',
|
|
34
|
-
}),
|
|
35
|
-
selector: pieces_framework_1.Property.ShortText({
|
|
36
|
-
displayName: 'Custom CSS Selector',
|
|
37
|
-
description: 'ONLY required if "Extraction Target" is set to "Custom CSS Selector". (e.g., .price, #main-title)',
|
|
38
|
-
required: false,
|
|
39
|
-
}),
|
|
40
|
-
extractionType: pieces_framework_1.Property.StaticDropdown({
|
|
41
|
-
displayName: 'Extraction Type',
|
|
42
|
-
description: 'What part of the element do you want to extract?',
|
|
43
|
-
required: true,
|
|
44
|
-
options: {
|
|
45
|
-
disabled: false,
|
|
46
|
-
options: [
|
|
47
|
-
{ label: 'Text Content (Clean Text)', value: 'textContent' },
|
|
48
|
-
{ label: 'Inner HTML', value: 'innerHtml' },
|
|
49
|
-
{ label: 'Outer HTML', value: 'outerHtml' },
|
|
50
|
-
{ label: 'Attribute (e.g., href, src)', value: 'attribute' },
|
|
51
|
-
],
|
|
52
|
-
},
|
|
53
|
-
defaultValue: 'textContent',
|
|
54
|
-
}),
|
|
55
|
-
attributeName: pieces_framework_1.Property.ShortText({
|
|
56
|
-
displayName: 'Attribute Name',
|
|
57
|
-
description: 'ONLY required if "Extraction Type" is set to "Attribute". (e.g., href, src, data-id)',
|
|
58
|
-
required: false,
|
|
59
|
-
}),
|
|
60
|
-
returnMultiple: pieces_framework_1.Property.Checkbox({
|
|
61
|
-
displayName: 'Return Multiple Elements',
|
|
62
|
-
description: 'If checked, returns a list of all matching elements. If unchecked, returns only the first match.',
|
|
63
|
-
required: true,
|
|
64
|
-
defaultValue: false,
|
|
65
|
-
}),
|
|
66
|
-
},
|
|
67
|
-
run(context) {
|
|
68
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
69
|
-
const { html, target, selector, extractionType, attributeName, returnMultiple, } = context.propsValue;
|
|
70
|
-
let finalSelector = '';
|
|
71
|
-
if (target === 'custom') {
|
|
72
|
-
if (!selector) {
|
|
73
|
-
throw new Error('You must provide a "Custom CSS Selector" when the target is set to Custom.');
|
|
74
|
-
}
|
|
75
|
-
finalSelector = selector;
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
const predefinedSelectors = {
|
|
79
|
-
title: 'title',
|
|
80
|
-
links: 'a[href]',
|
|
81
|
-
images: 'img[src]',
|
|
82
|
-
headings: 'h1, h2, h3',
|
|
83
|
-
paragraphs: 'p',
|
|
84
|
-
};
|
|
85
|
-
finalSelector = predefinedSelectors[target];
|
|
86
|
-
}
|
|
87
|
-
// Create an empty virtual console to swallow spam/errors from malicious HTML
|
|
88
|
-
const virtualConsole = new jsdom_1.VirtualConsole();
|
|
89
|
-
const dom = new jsdom_1.JSDOM(html, {
|
|
90
|
-
includeNodeLocations: false, // Performance: We don't need line numbers
|
|
91
|
-
runScripts: undefined, // Security: Explicitly disable JS execution (Default, but good to be explicit)
|
|
92
|
-
virtualConsole, // Security: Prevent log spoofing
|
|
93
|
-
});
|
|
94
|
-
try {
|
|
95
|
-
const document = dom.window.document;
|
|
96
|
-
let elements;
|
|
97
|
-
try {
|
|
98
|
-
elements = document.querySelectorAll(finalSelector);
|
|
99
|
-
}
|
|
100
|
-
catch (error) {
|
|
101
|
-
throw new Error(`Invalid CSS selector: "${finalSelector}". Error: ${error.message}`);
|
|
102
|
-
}
|
|
103
|
-
if (elements.length === 0) {
|
|
104
|
-
return returnMultiple ? [] : null;
|
|
105
|
-
}
|
|
106
|
-
const extractValue = (el) => {
|
|
107
|
-
var _a, _b;
|
|
108
|
-
switch (extractionType) {
|
|
109
|
-
case 'textContent':
|
|
110
|
-
return ((_a = el.textContent) === null || _a === void 0 ? void 0 : _a.trim()) || '';
|
|
111
|
-
case 'innerHtml':
|
|
112
|
-
return el.innerHTML;
|
|
113
|
-
case 'outerHtml':
|
|
114
|
-
return el.outerHTML;
|
|
115
|
-
case 'attribute':
|
|
116
|
-
if (!attributeName) {
|
|
117
|
-
throw new Error('You must provide an "Attribute Name" when the extraction type is Attribute.');
|
|
118
|
-
}
|
|
119
|
-
return (_b = el.getAttribute(attributeName)) !== null && _b !== void 0 ? _b : '';
|
|
120
|
-
default:
|
|
121
|
-
return '';
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
if (returnMultiple) {
|
|
125
|
-
return Array.from(elements).map((el) => extractValue(el));
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
return extractValue(elements[0]);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
finally {
|
|
132
|
-
// Always close the virtual window to prevent memory leaks in the Node environment,
|
|
133
|
-
dom.window.close();
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
},
|
|
137
|
-
});
|
|
138
|
-
//# sourceMappingURL=extract-from-html.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extract-from-html.js","sourceRoot":"","sources":["../../../../src/lib/actions/extract-from-html.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,iCAA8C;AAEjC,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,QAAQ,E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AAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC5D,CAAC;qBAAM,CAAC;oBACN,OAAO,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;gBACnC,CAAC;YACH,CAAC;oBAAS,CAAC;gBACT,mFAAmF;gBACnF,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YACrB,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const findAll: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
2
|
-
text: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
expression: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
ignoreCase: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
5
|
-
}>;
|
|
6
|
-
//# sourceMappingURL=find-all.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find-all.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-all.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO;;;;EA0ClB,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findAll = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
exports.findAll = (0, pieces_framework_1.createAction)({
|
|
7
|
-
audience: 'human',
|
|
8
|
-
description: 'Find all substrings matching a regex or text pattern.',
|
|
9
|
-
displayName: 'Find All',
|
|
10
|
-
name: 'find_all',
|
|
11
|
-
errorHandlingOptions: {
|
|
12
|
-
continueOnFailure: {
|
|
13
|
-
hide: true,
|
|
14
|
-
},
|
|
15
|
-
retryOnFailure: {
|
|
16
|
-
hide: true,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
text: pieces_framework_1.Property.ShortText({
|
|
21
|
-
displayName: 'Text',
|
|
22
|
-
required: true,
|
|
23
|
-
}),
|
|
24
|
-
expression: pieces_framework_1.Property.ShortText({
|
|
25
|
-
displayName: 'Expression',
|
|
26
|
-
description: 'Regex or text to search for. Returns every occurrence.',
|
|
27
|
-
required: true,
|
|
28
|
-
}),
|
|
29
|
-
ignoreCase: pieces_framework_1.Property.Checkbox({
|
|
30
|
-
displayName: 'Ignore Case',
|
|
31
|
-
description: 'When enabled, matching is case-insensitive.',
|
|
32
|
-
required: false,
|
|
33
|
-
defaultValue: false,
|
|
34
|
-
}),
|
|
35
|
-
},
|
|
36
|
-
run: (ctx) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
-
const flags = ctx.propsValue.ignoreCase ? 'gi' : 'g';
|
|
38
|
-
let regex;
|
|
39
|
-
try {
|
|
40
|
-
regex = new RegExp(ctx.propsValue.expression, flags);
|
|
41
|
-
}
|
|
42
|
-
catch (_a) {
|
|
43
|
-
throw new Error(`Invalid regular expression: ${ctx.propsValue.expression}`);
|
|
44
|
-
}
|
|
45
|
-
return [...ctx.propsValue.text.matchAll(regex)].map((m) => m[0]);
|
|
46
|
-
}),
|
|
47
|
-
});
|
|
48
|
-
//# sourceMappingURL=find-all.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find-all.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-all.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AAE3D,QAAA,OAAO,GAAG,IAAA,+BAAY,EAAC;IAClC,QAAQ,EAAE,OAAO;IACjB,WAAW,EAAE,uDAAuD;IACpE,WAAW,EAAE,UAAU;IACvB,IAAI,EAAE,UAAU;IAChB,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,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,wDAAwD;YACrE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC5B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,6CAA6C;YAC1D,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,KAAK;SACpB,CAAC;KACH;IACD,GAAG,EAAE,CAAO,GAAG,EAAqB,EAAE;QACpC,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;QACrD,IAAI,KAAa,CAAC;QAClB,IAAI,CAAC;YACH,KAAK,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QACvD,CAAC;QAAC,WAAM,CAAC;YACP,MAAM,IAAI,KAAK,CACb,+BAA+B,GAAG,CAAC,UAAU,CAAC,UAAU,EAAE,CAC3D,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,CAAC,CAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const find: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
2
|
-
text: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
expression: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
ignoreCase: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
5
|
-
}>;
|
|
6
|
-
//# sourceMappingURL=find.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI;;;;EA2Cf,CAAC"}
|
package/src/lib/actions/find.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.find = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
exports.find = (0, pieces_framework_1.createAction)({
|
|
7
|
-
audience: 'human',
|
|
8
|
-
description: 'Find substring (Regex or Text).',
|
|
9
|
-
displayName: 'Find',
|
|
10
|
-
name: 'find',
|
|
11
|
-
errorHandlingOptions: {
|
|
12
|
-
continueOnFailure: {
|
|
13
|
-
hide: true,
|
|
14
|
-
},
|
|
15
|
-
retryOnFailure: {
|
|
16
|
-
hide: true,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
text: pieces_framework_1.Property.ShortText({
|
|
21
|
-
displayName: 'Text',
|
|
22
|
-
required: true,
|
|
23
|
-
}),
|
|
24
|
-
expression: pieces_framework_1.Property.ShortText({
|
|
25
|
-
displayName: 'Expression',
|
|
26
|
-
description: 'Regex or text to search for. Returns the first match and its capture groups.',
|
|
27
|
-
required: true,
|
|
28
|
-
}),
|
|
29
|
-
ignoreCase: pieces_framework_1.Property.Checkbox({
|
|
30
|
-
displayName: 'Ignore Case',
|
|
31
|
-
description: 'When enabled, matching is case-insensitive.',
|
|
32
|
-
required: false,
|
|
33
|
-
defaultValue: false,
|
|
34
|
-
}),
|
|
35
|
-
},
|
|
36
|
-
run: (ctx) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
-
const flags = ctx.propsValue.ignoreCase ? 'i' : '';
|
|
38
|
-
let expression;
|
|
39
|
-
try {
|
|
40
|
-
expression = new RegExp(ctx.propsValue.expression, flags);
|
|
41
|
-
}
|
|
42
|
-
catch (_a) {
|
|
43
|
-
throw new Error(`Invalid regular expression: ${ctx.propsValue.expression}`);
|
|
44
|
-
}
|
|
45
|
-
return ctx.propsValue.text.match(expression);
|
|
46
|
-
}),
|
|
47
|
-
});
|
|
48
|
-
//# sourceMappingURL=find.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../../src/lib/actions/find.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AAE3D,QAAA,IAAI,GAAG,IAAA,+BAAY,EAAC;IAC/B,QAAQ,EAAE,OAAO;IACjB,WAAW,EAAE,iCAAiC;IAC9C,WAAW,EAAE,MAAM;IACnB,IAAI,EAAE,MAAM;IACZ,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,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,YAAY;YACzB,WAAW,EACT,8EAA8E;YAChF,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC5B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,6CAA6C;YAC1D,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,KAAK;SACpB,CAAC;KACH;IACD,GAAG,EAAE,CAAO,GAAG,EAAoC,EAAE;QACnD,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACnD,IAAI,UAAkB,CAAC;QACvB,IAAI,CAAC;YACH,UAAU,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QAC5D,CAAC;QAAC,WAAM,CAAC;YACP,MAAM,IAAI,KAAK,CACb,+BAA+B,GAAG,CAAC,UAAU,CAAC,UAAU,EAAE,CAC3D,CAAC;QACJ,CAAC;QACD,OAAO,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC/C,CAAC,CAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const htmlToMarkdown: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
2
|
-
html: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
3
|
-
}>;
|
|
4
|
-
//# sourceMappingURL=html-to-markdown.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"html-to-markdown.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/html-to-markdown.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc;;EA0BzB,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.htmlToMarkdown = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const turndown_1 = tslib_1.__importDefault(require("turndown"));
|
|
7
|
-
exports.htmlToMarkdown = (0, pieces_framework_1.createAction)({
|
|
8
|
-
audience: 'human',
|
|
9
|
-
name: 'html_to_markdown',
|
|
10
|
-
displayName: 'HTML to Markdown',
|
|
11
|
-
description: 'Convert HTML to Markdown',
|
|
12
|
-
errorHandlingOptions: {
|
|
13
|
-
continueOnFailure: {
|
|
14
|
-
hide: true,
|
|
15
|
-
},
|
|
16
|
-
retryOnFailure: {
|
|
17
|
-
hide: true,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
props: {
|
|
21
|
-
html: pieces_framework_1.Property.LongText({
|
|
22
|
-
displayName: 'HTML Content',
|
|
23
|
-
description: 'The HTML to convert to markdown',
|
|
24
|
-
required: true,
|
|
25
|
-
}),
|
|
26
|
-
},
|
|
27
|
-
run: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
-
const html = context.propsValue.html;
|
|
29
|
-
const service = new turndown_1.default();
|
|
30
|
-
service.remove('script');
|
|
31
|
-
return service.turndown(html);
|
|
32
|
-
}),
|
|
33
|
-
});
|
|
34
|
-
//# sourceMappingURL=html-to-markdown.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"html-to-markdown.js","sourceRoot":"","sources":["../../../../src/lib/actions/html-to-markdown.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,gEAAuC;AAE1B,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,QAAQ,EAAE,OAAO;IACjB,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"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const jsonToAsciiTable: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
2
|
-
data: import("@activepieces/pieces-framework").JsonProperty<true>;
|
|
3
|
-
}>;
|
|
4
|
-
//# sourceMappingURL=json-to-ascii-table.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-to-ascii-table.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/json-to-ascii-table.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;;EAsE3B,CAAC"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.jsonToAsciiTable = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
exports.jsonToAsciiTable = (0, pieces_framework_1.createAction)({
|
|
7
|
-
audience: 'human',
|
|
8
|
-
description: 'Convert a list of items to a text table',
|
|
9
|
-
displayName: 'List to Text Table',
|
|
10
|
-
name: 'json_to_ascii_table',
|
|
11
|
-
errorHandlingOptions: {
|
|
12
|
-
continueOnFailure: {
|
|
13
|
-
hide: true,
|
|
14
|
-
},
|
|
15
|
-
retryOnFailure: {
|
|
16
|
-
hide: true,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
data: pieces_framework_1.Property.Json({
|
|
21
|
-
displayName: 'List',
|
|
22
|
-
description: 'List of items to convert to a text table',
|
|
23
|
-
required: true,
|
|
24
|
-
}),
|
|
25
|
-
},
|
|
26
|
-
run: (ctx) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
-
const data = ctx.propsValue.data;
|
|
28
|
-
// Validate input is an array
|
|
29
|
-
if (!Array.isArray(data)) {
|
|
30
|
-
throw new Error('Input must be an array of objects');
|
|
31
|
-
}
|
|
32
|
-
if (data.length === 0) {
|
|
33
|
-
return '';
|
|
34
|
-
}
|
|
35
|
-
// Get all unique keys from all objects
|
|
36
|
-
const keys = Array.from(new Set(data.flatMap((obj) => Object.keys(obj))));
|
|
37
|
-
// Calculate column widths
|
|
38
|
-
const columnWidths = keys.map((key) => {
|
|
39
|
-
const maxDataWidth = Math.max(...data.map((row) => { var _a; return String((_a = row[key]) !== null && _a !== void 0 ? _a : '').length; }));
|
|
40
|
-
return Math.max(key.length, maxDataWidth);
|
|
41
|
-
});
|
|
42
|
-
// Create separator line
|
|
43
|
-
const separator = '+' + columnWidths.map((width) => '-'.repeat(width + 2)).join('+') + '+';
|
|
44
|
-
// Create header row
|
|
45
|
-
const header = '|' +
|
|
46
|
-
keys.map((key, i) => ' ' + key.padEnd(columnWidths[i]) + ' ').join('|') +
|
|
47
|
-
'|';
|
|
48
|
-
// Create data rows
|
|
49
|
-
const rows = data.map((row) => {
|
|
50
|
-
return ('|' +
|
|
51
|
-
keys
|
|
52
|
-
.map((key, i) => {
|
|
53
|
-
var _a;
|
|
54
|
-
const value = String((_a = row[key]) !== null && _a !== void 0 ? _a : '');
|
|
55
|
-
return ' ' + value.padEnd(columnWidths[i]) + ' ';
|
|
56
|
-
})
|
|
57
|
-
.join('|') +
|
|
58
|
-
'|');
|
|
59
|
-
});
|
|
60
|
-
// Combine all parts
|
|
61
|
-
return [separator, header, separator, ...rows, separator].join('\n');
|
|
62
|
-
}),
|
|
63
|
-
});
|
|
64
|
-
//# sourceMappingURL=json-to-ascii-table.js.map
|
|
@@ -1 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AAE,SAAS,EAAE,GAAG,IAAI,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvE,CAAC,CAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const markdownToHTML: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
2
|
-
markdown: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
3
|
-
flavor: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
4
|
-
headerLevelStart: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
5
|
-
tables: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
6
|
-
noHeaderId: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
7
|
-
simpleLineBreaks: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
8
|
-
openLinksInNewWindow: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
9
|
-
}>;
|
|
10
|
-
//# sourceMappingURL=markdown-to-html.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-to-html.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/markdown-to-html.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,cAAc;;;;;;;;EAgFzB,CAAC"}
|