@activepieces/piece-connections 0.3.4 → 0.4.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/package.json CHANGED
@@ -1,18 +1,28 @@
1
1
  {
2
2
  "name": "@activepieces/piece-connections",
3
- "version": "0.3.4",
3
+ "version": "0.4.1",
4
4
  "dependencies": {
5
- "@sinclair/typebox": "0.26.8",
6
- "axios": "^1.6.3",
5
+ "@sinclair/typebox": "0.33.18",
7
6
  "dayjs": "1.11.9",
8
- "is-base64": "1.1.0",
9
- "lodash": "4.17.21",
7
+ "deepmerge": "4.3.1",
10
8
  "nanoid": "3.3.6",
11
9
  "semver": "7.6.0",
12
- "@activepieces/pieces-framework": "0.7.24",
13
- "@activepieces/shared": "0.10.93",
14
- "tslib": "1.14.1"
10
+ "@activepieces/pieces-framework": "0.7.39",
11
+ "@activepieces/shared": "0.10.125",
12
+ "tslib": "2.6.2"
13
+ },
14
+ "overrides": {
15
+ "@tryfabric/martian": {
16
+ "@notionhq/client": "$@notionhq/client"
17
+ },
18
+ "vite": {
19
+ "rollup": "npm:@rollup/wasm-node"
20
+ }
21
+ },
22
+ "resolutions": {
23
+ "rollup": "npm:@rollup/wasm-node"
15
24
  },
16
25
  "main": "./src/index.js",
17
- "type": "commonjs"
26
+ "type": "commonjs",
27
+ "types": "./src/index.d.ts"
18
28
  }
@@ -1,4 +1,4 @@
1
1
  export declare const readConnection: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").PieceAuthProperty, {
2
- info: import("../../../../../../../dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
2
+ info: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
3
3
  connection_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
4
  }>;
@@ -3,12 +3,16 @@ 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 shared_1 = require("@activepieces/shared");
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 external ID is sent through a webhook message.
11
+
12
+ **Notes:**
13
+ - You can retrieve the external ID from the connection settings page by hovering over the connection name.
14
+ - Use this action to retrieve connection values by their external IDs from this project.
15
+ - After testing the step, you can use the dynamic value in the piece by clicking (X) and referring to this step.
12
16
  `;
13
17
  exports.readConnection = (0, pieces_framework_1.createAction)({
14
18
  name: 'read_connection',
@@ -19,14 +23,21 @@ exports.readConnection = (0, pieces_framework_1.createAction)({
19
23
  value: markdown,
20
24
  }),
21
25
  connection_name: pieces_framework_1.Property.ShortText({
22
- displayName: 'Connection Name',
26
+ displayName: 'Connection External ID',
23
27
  description: undefined,
24
28
  required: true,
25
29
  }),
26
30
  },
27
31
  run(ctx) {
28
32
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
29
- return yield ctx.connections.get(ctx.propsValue.connection_name);
33
+ const connection = yield ctx.connections.get(ctx.propsValue.connection_name);
34
+ if ((0, shared_1.isNil)(connection)) {
35
+ throw new Error(JSON.stringify({
36
+ message: 'Connection not found',
37
+ connectionName: ctx.propsValue.connection_name,
38
+ }));
39
+ }
40
+ return connection;
30
41
  });
31
42
  },
32
43
  });
@@ -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,iDAA6C;AAE7C,MAAM,QAAQ,GAAG;;;;;;;;;CAShB,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,wBAAwB;YACrC,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"}