@activepieces/piece-text-helper 0.0.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.
- package/README.md +7 -0
- package/package.json +19 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +17 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/concat.d.ts +4 -0
- package/src/lib/actions/concat.js +26 -0
- package/src/lib/actions/concat.js.map +1 -0
- package/src/lib/actions/find.d.ts +4 -0
- package/src/lib/actions/find.js +26 -0
- package/src/lib/actions/find.js.map +1 -0
- package/src/lib/actions/replace.d.ts +5 -0
- package/src/lib/actions/replace.js +31 -0
- package/src/lib/actions/replace.js.map +1 -0
- package/src/lib/actions/split.d.ts +4 -0
- package/src/lib/actions/split.js +24 -0
- package/src/lib/actions/split.js.map +1 -0
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@activepieces/piece-text-helper",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"@sinclair/typebox": "^0.26.3",
|
|
6
|
+
"axios": "1.4.0",
|
|
7
|
+
"dayjs": "^1.11.8",
|
|
8
|
+
"is-base64": "^1.1.0",
|
|
9
|
+
"nanoid": "^3.3.4",
|
|
10
|
+
"semver": "7.5.4"
|
|
11
|
+
},
|
|
12
|
+
"peerDependencies": {
|
|
13
|
+
"@activepieces/pieces-framework": "0.6.16",
|
|
14
|
+
"@activepieces/shared": "0.8.1",
|
|
15
|
+
"tslib": "2.6.1"
|
|
16
|
+
},
|
|
17
|
+
"main": "./src/index.js",
|
|
18
|
+
"types": "./src/index.d.ts"
|
|
19
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const textHelper: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").PieceAuthProperty>;
|
package/src/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.textHelper = void 0;
|
|
4
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
|
+
const concat_1 = require("./lib/actions/concat");
|
|
6
|
+
const replace_1 = require("./lib/actions/replace");
|
|
7
|
+
const split_1 = require("./lib/actions/split");
|
|
8
|
+
const find_1 = require("./lib/actions/find");
|
|
9
|
+
exports.textHelper = (0, pieces_framework_1.createPiece)({
|
|
10
|
+
displayName: 'Text Helper',
|
|
11
|
+
auth: pieces_framework_1.PieceAuth.None(),
|
|
12
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/text-helper.svg',
|
|
13
|
+
authors: ['abaza738'],
|
|
14
|
+
actions: [concat_1.concat, replace_1.replace, split_1.split, find_1.find],
|
|
15
|
+
triggers: [],
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/text-helper/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AACxE,iDAA8C;AAC9C,mDAAgD;AAChD,+CAA4C;AAC5C,6CAA0C;AAE7B,QAAA,UAAU,GAAG,IAAA,8BAAW,EAAC;IACpC,WAAW,EAAE,aAAa;IAC1B,IAAI,EAAE,4BAAS,CAAC,IAAI,EAAE;IACtB,OAAO,EAAE,qDAAqD;IAC9D,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,OAAO,EAAE,CAAC,eAAM,EAAE,iBAAO,EAAE,aAAK,EAAE,WAAI,CAAC;IACvC,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const concat: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
2
|
+
texts: import("@activepieces/pieces-framework").ArrayProperty<true>;
|
|
3
|
+
seperator: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
}>;
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
description: 'Concatenate two or more texts',
|
|
8
|
+
displayName: 'Concatenate',
|
|
9
|
+
name: 'concat',
|
|
10
|
+
props: {
|
|
11
|
+
texts: pieces_framework_1.Property.Array({
|
|
12
|
+
displayName: 'Texts',
|
|
13
|
+
required: true,
|
|
14
|
+
}),
|
|
15
|
+
seperator: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Seperator',
|
|
17
|
+
description: 'The text that seperates the texts you want to concatenate',
|
|
18
|
+
required: false,
|
|
19
|
+
}),
|
|
20
|
+
},
|
|
21
|
+
run: (ctx) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
+
var _a;
|
|
23
|
+
return ctx.propsValue.texts.join((_a = ctx.propsValue.seperator) !== null && _a !== void 0 ? _a : '');
|
|
24
|
+
}),
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=concat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concat.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/text-helper/src/lib/actions/concat.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AAE3D,QAAA,MAAM,GAAG,IAAA,+BAAY,EAAC;IACjC,WAAW,EAAE,+BAA+B;IAC5C,WAAW,EAAE,aAAa;IAC1B,IAAI,EAAE,QAAQ;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,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,MAAA,GAAG,CAAC,UAAU,CAAC,SAAS,mCAAI,EAAE,CAAC,CAAC;IACnE,CAAC,CAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
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
|
+
}>;
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
description: 'Find substring (Regex or Text).',
|
|
8
|
+
displayName: 'Find',
|
|
9
|
+
name: 'find',
|
|
10
|
+
props: {
|
|
11
|
+
text: pieces_framework_1.Property.ShortText({
|
|
12
|
+
displayName: 'text',
|
|
13
|
+
required: true,
|
|
14
|
+
}),
|
|
15
|
+
expression: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Expression',
|
|
17
|
+
description: 'Regex or text to search for.',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
},
|
|
21
|
+
run: (ctx) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
+
const expression = RegExp(ctx.propsValue.expression);
|
|
23
|
+
return ctx.propsValue.text.match(expression);
|
|
24
|
+
}),
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=find.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/text-helper/src/lib/actions/find.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AAE3D,QAAA,IAAI,GAAG,IAAA,+BAAY,EAAC;IAC/B,WAAW,EAAE,iCAAiC;IAC9C,WAAW,EAAE,MAAM;IACnB,IAAI,EAAE,MAAM;IACZ,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,8BAA8B;YAC3C,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACD,GAAG,EAAE,CAAO,GAAG,EAAoC,EAAE;QACnD,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACrD,OAAO,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC/C,CAAC,CAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const replace: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
2
|
+
text: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
searchValue: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
replaceValue: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
|
+
}>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.replace = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
exports.replace = (0, pieces_framework_1.createAction)({
|
|
7
|
+
description: 'Replace a text with another (Regex or text).',
|
|
8
|
+
displayName: 'Replace',
|
|
9
|
+
name: 'replace',
|
|
10
|
+
props: {
|
|
11
|
+
text: pieces_framework_1.Property.ShortText({
|
|
12
|
+
displayName: 'Text',
|
|
13
|
+
required: true,
|
|
14
|
+
}),
|
|
15
|
+
searchValue: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Search Value',
|
|
17
|
+
description: 'Regex or text.',
|
|
18
|
+
required: true,
|
|
19
|
+
validators: [],
|
|
20
|
+
}),
|
|
21
|
+
replaceValue: pieces_framework_1.Property.ShortText({
|
|
22
|
+
displayName: 'Replace Value',
|
|
23
|
+
required: true,
|
|
24
|
+
}),
|
|
25
|
+
},
|
|
26
|
+
run: (ctx) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
+
const expression = RegExp(ctx.propsValue.searchValue);
|
|
28
|
+
return ctx.propsValue.text.replace(expression, ctx.propsValue.replaceValue);
|
|
29
|
+
}),
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=replace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replace.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/text-helper/src/lib/actions/replace.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AAE3B,QAAA,OAAO,GAAG,IAAA,+BAAY,EAAC;IAClC,WAAW,EAAE,8CAA8C;IAC3D,WAAW,EAAE,SAAS;IACtB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,gBAAgB;YAC7B,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,EAAE;SACf,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,eAAe;YAC5B,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACD,GAAG,EAAE,CAAO,GAAG,EAAE,EAAE;QACjB,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACtD,OAAO,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAChC,UAAU,EACV,GAAG,CAAC,UAAU,CAAC,YAAY,CAC5B,CAAC;IACJ,CAAC,CAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const split: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
2
|
+
text: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
delimeter: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.split = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
exports.split = (0, pieces_framework_1.createAction)({
|
|
7
|
+
description: 'Split a text by a delimeter',
|
|
8
|
+
displayName: 'Split',
|
|
9
|
+
name: 'split',
|
|
10
|
+
props: {
|
|
11
|
+
text: pieces_framework_1.Property.ShortText({
|
|
12
|
+
displayName: 'Text',
|
|
13
|
+
required: true,
|
|
14
|
+
}),
|
|
15
|
+
delimeter: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Delimeter',
|
|
17
|
+
required: true,
|
|
18
|
+
}),
|
|
19
|
+
},
|
|
20
|
+
run: (ctx) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
+
return ctx.propsValue.text.split(ctx.propsValue.delimeter);
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=split.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/text-helper/src/lib/actions/split.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AAE3D,QAAA,KAAK,GAAG,IAAA,+BAAY,EAAC;IAChC,WAAW,EAAE,6BAA6B;IAC1C,WAAW,EAAE,OAAO;IACpB,IAAI,EAAE,OAAO;IACb,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACD,GAAG,EAAE,CAAO,GAAG,EAAE,EAAE;QACjB,OAAO,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC,CAAA;CACF,CAAC,CAAC"}
|