@activepieces/piece-connections 0.3.4 → 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,16 +1,16 @@
1
1
  {
2
2
  "name": "@activepieces/piece-connections",
3
- "version": "0.3.4",
3
+ "version": "0.4.0",
4
4
  "dependencies": {
5
5
  "@sinclair/typebox": "0.26.8",
6
- "axios": "^1.6.3",
6
+ "axios": "1.6.7",
7
7
  "dayjs": "1.11.9",
8
8
  "is-base64": "1.1.0",
9
9
  "lodash": "4.17.21",
10
10
  "nanoid": "3.3.6",
11
11
  "semver": "7.6.0",
12
- "@activepieces/pieces-framework": "0.7.24",
13
- "@activepieces/shared": "0.10.93",
12
+ "@activepieces/pieces-framework": "0.7.30",
13
+ "@activepieces/shared": "0.10.105",
14
14
  "tslib": "1.14.1"
15
15
  },
16
16
  "main": "./src/index.js",
@@ -3,12 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.readConnection = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const lodash_1 = require("lodash");
6
7
  const markdown = `
7
8
  **Advanced Piece**
8
9
  <br>
9
- Use this action to get connections dynamically by their names from this project.
10
- <br>
11
- Only use this piece if you're unsure which connection to use beforehand, like when the link name is sent through a webhook message.
10
+ Use this piece If you are unsure which connection to use beforehand, such as when the connection name is sent through a webhook message.
11
+
12
+ **Notes:**
13
+ - Use this action to retrieve connection values by their names from this project.
14
+ - After testing the step, you can use the dynamic value in the piece by clicking (X) and referring to this step.
12
15
  `;
13
16
  exports.readConnection = (0, pieces_framework_1.createAction)({
14
17
  name: 'read_connection',
@@ -26,7 +29,14 @@ exports.readConnection = (0, pieces_framework_1.createAction)({
26
29
  },
27
30
  run(ctx) {
28
31
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
29
- return yield ctx.connections.get(ctx.propsValue.connection_name);
32
+ const connection = yield ctx.connections.get(ctx.propsValue.connection_name);
33
+ if ((0, lodash_1.isNil)(connection)) {
34
+ throw new Error(JSON.stringify({
35
+ message: 'Connection not found',
36
+ connectionName: ctx.propsValue.connection_name,
37
+ }));
38
+ }
39
+ return connection;
30
40
  });
31
41
  },
32
42
  });
@@ -1 +1 @@
1
- {"version":3,"file":"read-connection.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/connections/src/lib/actions/read-connection.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AAExE,MAAM,QAAQ,GAAG;;;;;;CAMhB,CAAC;AAEW,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,0BAA0B;IACvC,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,KAAK,EAAE,QAAQ;SAChB,CAAC;QACF,eAAe,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAClC,WAAW,EAAE,iBAAiB;YAC9B,WAAW,EAAE,SAAS;YACtB,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,GAAG;;YACX,OAAO,MAAM,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;QACnE,CAAC;KAAA;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"read-connection.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/connections/src/lib/actions/read-connection.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,mCAA+B;AAE/B,MAAM,QAAQ,GAAG;;;;;;;;CAQhB,CAAC;AAEW,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,0BAA0B;IACvC,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,KAAK,EAAE,QAAQ;SAChB,CAAC;QACF,eAAe,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAClC,WAAW,EAAE,iBAAiB;YAC9B,WAAW,EAAE,SAAS;YACtB,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,GAAG;;YACX,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;YAC7E,IAAI,IAAA,cAAK,EAAC,UAAU,CAAC,EAAE,CAAC;gBACtB,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;oBAC7B,OAAO,EAAE,sBAAsB;oBAC/B,cAAc,EAAE,GAAG,CAAC,UAAU,CAAC,eAAe;iBAC/C,CAAC,CAAC,CAAC;YACN,CAAC;YACD,OAAO,UAAU,CAAC;QACpB,CAAC;KAAA;CACF,CAAC,CAAC"}