@pipedream/apify_oauth 0.0.1 → 0.1.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.
@@ -0,0 +1,22 @@
1
+ import app from "../../apify_oauth.app.mjs";
2
+ import common from "@pipedream/apify/actions/get-dataset-items/get-dataset-items.mjs";
3
+
4
+ import { adjustPropDefinitions } from "../../common/utils.mjs";
5
+
6
+ const {
7
+ name, description, type, ...others
8
+ } = common;
9
+ const props = adjustPropDefinitions(others.props, app);
10
+
11
+ export default {
12
+ ...others,
13
+ key: "apify_oauth-get-dataset-items",
14
+ version: "0.0.2",
15
+ name,
16
+ description,
17
+ type,
18
+ props: {
19
+ apify: app,
20
+ ...props,
21
+ },
22
+ };
@@ -0,0 +1,22 @@
1
+ import app from "../../apify_oauth.app.mjs";
2
+ import common from "@pipedream/apify/actions/run-actor/run-actor.mjs";
3
+
4
+ import { adjustPropDefinitions } from "../../common/utils.mjs";
5
+
6
+ const {
7
+ name, description, type, ...others
8
+ } = common;
9
+ const props = adjustPropDefinitions(others.props, app);
10
+
11
+ export default {
12
+ ...others,
13
+ key: "apify_oauth-run-actor",
14
+ version: "0.0.2",
15
+ name,
16
+ description,
17
+ type,
18
+ props: {
19
+ apify: app,
20
+ ...props,
21
+ },
22
+ };
@@ -0,0 +1,22 @@
1
+ import app from "../../apify_oauth.app.mjs";
2
+ import common from "@pipedream/apify/actions/run-task-synchronously/run-task-synchronously.mjs";
3
+
4
+ import { adjustPropDefinitions } from "../../common/utils.mjs";
5
+
6
+ const {
7
+ name, description, type, ...others
8
+ } = common;
9
+ const props = adjustPropDefinitions(others.props, app);
10
+
11
+ export default {
12
+ ...others,
13
+ key: "apify_oauth-run-task-synchronously",
14
+ version: "0.0.2",
15
+ name,
16
+ description,
17
+ type,
18
+ props: {
19
+ apify: app,
20
+ ...props,
21
+ },
22
+ };
@@ -0,0 +1,22 @@
1
+ import app from "../../apify_oauth.app.mjs";
2
+ import common from "@pipedream/apify/actions/scrape-single-url/scrape-single-url.mjs";
3
+
4
+ import { adjustPropDefinitions } from "../../common/utils.mjs";
5
+
6
+ const {
7
+ name, description, type, ...others
8
+ } = common;
9
+ const props = adjustPropDefinitions(others.props, app);
10
+
11
+ export default {
12
+ ...others,
13
+ key: "apify_oauth-scrape-single-url",
14
+ version: "0.0.2",
15
+ name,
16
+ description,
17
+ type,
18
+ props: {
19
+ apify: app,
20
+ ...props,
21
+ },
22
+ };
@@ -0,0 +1,22 @@
1
+ import app from "../../apify_oauth.app.mjs";
2
+ import common from "@pipedream/apify/actions/set-key-value-store-record/set-key-value-store-record.mjs";
3
+
4
+ import { adjustPropDefinitions } from "../../common/utils.mjs";
5
+
6
+ const {
7
+ name, description, type, ...others
8
+ } = common;
9
+ const props = adjustPropDefinitions(others.props, app);
10
+
11
+ export default {
12
+ ...others,
13
+ key: "apify_oauth-set-key-value-store-record",
14
+ version: "0.0.2",
15
+ name,
16
+ description,
17
+ type,
18
+ props: {
19
+ apify: app,
20
+ ...props,
21
+ },
22
+ };
@@ -1,11 +1,27 @@
1
+ import common from "@pipedream/apify";
2
+ import { ApifyClient } from "apify-client";
3
+
1
4
  export default {
2
5
  type: "app",
3
6
  app: "apify_oauth",
4
- propDefinitions: {},
7
+ propDefinitions: {
8
+ ...common.propDefinitions,
9
+ },
5
10
  methods: {
6
- // this.$auth contains connected account data
7
- authKeys() {
8
- console.log(Object.keys(this.$auth));
11
+ ...common.methods,
12
+ _client() {
13
+ return new ApifyClient({
14
+ token: this.$auth.oauth_access_token,
15
+ requestInterceptors: [
16
+ (config) => ({
17
+ ...config,
18
+ headers: {
19
+ ...(config.headers || {}),
20
+ "x-apify-integration-platform": "pipedream",
21
+ },
22
+ }),
23
+ ],
24
+ });
9
25
  },
10
26
  },
11
- };
27
+ };
@@ -0,0 +1,40 @@
1
+ export function adjustPropDefinitions(props, app) {
2
+ return Object.fromEntries(
3
+ Object.entries(props).map(([
4
+ key,
5
+ prop,
6
+ ]) => {
7
+ if (typeof prop === "string") return [
8
+ key,
9
+ prop,
10
+ ];
11
+ const {
12
+ propDefinition, ...otherValues
13
+ } = prop;
14
+ if (propDefinition) {
15
+ const [
16
+ , ...otherDefs
17
+ ] = propDefinition;
18
+ return [
19
+ key,
20
+ {
21
+ propDefinition: [
22
+ app,
23
+ ...otherDefs,
24
+ ],
25
+ ...otherValues,
26
+ },
27
+ ];
28
+ }
29
+ return [
30
+ key,
31
+ otherValues.type === "app"
32
+ ? null
33
+ : otherValues,
34
+ ];
35
+ })
36
+ .filter(([
37
+ , value,
38
+ ]) => value),
39
+ );
40
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/apify_oauth",
3
- "version": "0.0.1",
3
+ "version": "0.1.1",
4
4
  "description": "Pipedream Apify (OAuth) Components",
5
5
  "main": "apify_oauth.app.mjs",
6
6
  "keywords": [
@@ -11,5 +11,9 @@
11
11
  "author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
12
12
  "publishConfig": {
13
13
  "access": "public"
14
+ },
15
+ "dependencies": {
16
+ "@pipedream/apify": "^0.3.1",
17
+ "apify-client": "^2.17.0"
14
18
  }
15
19
  }
@@ -0,0 +1,22 @@
1
+ import app from "../../apify_oauth.app.mjs";
2
+ import common from "@pipedream/apify/sources/new-finished-actor-run-instant/new-finished-actor-run-instant.mjs";
3
+
4
+ import { adjustPropDefinitions } from "../../common/utils.mjs";
5
+
6
+ const {
7
+ name, description, type, ...others
8
+ } = common;
9
+ const props = adjustPropDefinitions(others.props, app);
10
+
11
+ export default {
12
+ ...others,
13
+ key: "apify_oauth-new-finished-actor-run-instant",
14
+ version: "0.0.2",
15
+ name,
16
+ description,
17
+ type,
18
+ props: {
19
+ apify: app,
20
+ ...props,
21
+ },
22
+ };
@@ -0,0 +1,22 @@
1
+ import app from "../../apify_oauth.app.mjs";
2
+ import common from "@pipedream/apify/sources/new-finished-task-run-instant/new-finished-task-run-instant.mjs";
3
+
4
+ import { adjustPropDefinitions } from "../../common/utils.mjs";
5
+
6
+ const {
7
+ name, description, type, ...others
8
+ } = common;
9
+ const props = adjustPropDefinitions(others.props, app);
10
+
11
+ export default {
12
+ ...others,
13
+ key: "apify_oauth-new-finished-task-run-instant",
14
+ version: "0.0.2",
15
+ name,
16
+ description,
17
+ type,
18
+ props: {
19
+ apify: app,
20
+ ...props,
21
+ },
22
+ };