@activepieces/piece-text-helper 0.0.1 → 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/package.json CHANGED
@@ -1,19 +1,18 @@
1
1
  {
2
2
  "name": "@activepieces/piece-text-helper",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
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"
5
+ "@sinclair/typebox": "0.26.8",
6
+ "axios": "^1.6.0",
7
+ "dayjs": "1.11.9",
8
+ "is-base64": "1.1.0",
9
+ "lodash": "4.17.21",
10
+ "nanoid": "3.3.6",
11
+ "semver": "7.5.4",
12
+ "@activepieces/pieces-framework": "0.7.4",
13
+ "@activepieces/shared": "0.10.44",
14
+ "tslib": "1.14.1"
16
15
  },
17
16
  "main": "./src/index.js",
18
- "types": "./src/index.d.ts"
17
+ "type": "commonjs"
19
18
  }
@@ -1,5 +1,5 @@
1
1
  export declare const replace: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").PieceAuthProperty, {
2
2
  text: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
3
  searchValue: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- replaceValue: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ replaceValue: import("@activepieces/pieces-framework").ShortTextProperty<false>;
5
5
  }>;
@@ -4,7 +4,7 @@ exports.replace = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const pieces_framework_1 = require("@activepieces/pieces-framework");
6
6
  exports.replace = (0, pieces_framework_1.createAction)({
7
- description: 'Replace a text with another (Regex or text).',
7
+ description: 'Replaces all instances of any word, character or phrase in text, with another.',
8
8
  displayName: 'Replace',
9
9
  name: 'replace',
10
10
  props: {
@@ -14,18 +14,19 @@ exports.replace = (0, pieces_framework_1.createAction)({
14
14
  }),
15
15
  searchValue: pieces_framework_1.Property.ShortText({
16
16
  displayName: 'Search Value',
17
- description: 'Regex or text.',
17
+ description: 'Can be regex expression or plain text.',
18
18
  required: true,
19
19
  validators: [],
20
20
  }),
21
21
  replaceValue: pieces_framework_1.Property.ShortText({
22
22
  displayName: 'Replace Value',
23
- required: true,
23
+ required: false,
24
+ description: 'Leave empty to delete found results.',
24
25
  }),
25
26
  },
26
27
  run: (ctx) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
27
28
  const expression = RegExp(ctx.propsValue.searchValue);
28
- return ctx.propsValue.text.replace(expression, ctx.propsValue.replaceValue);
29
+ return ctx.propsValue.text.replaceAll(expression, ctx.propsValue.replaceValue || '');
29
30
  }),
30
31
  });
31
32
  //# sourceMappingURL=replace.js.map
@@ -1 +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"}
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,gFAAgF;IAC7F,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,wCAAwC;YACrD,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,EAAE;SACf,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,eAAe;YAC5B,QAAQ,EAAE,KAAK;YACf,WAAW,EAAC,sCAAsC;SACnD,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,UAAU,CACnC,UAAU,EACV,GAAG,CAAC,UAAU,CAAC,YAAY,IAAI,EAAE,CAClC,CAAC;IACJ,CAAC,CAAA;CACF,CAAC,CAAC"}