@pipedream/wordpress_org 0.3.4 → 0.3.5

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.
@@ -4,7 +4,7 @@ export default {
4
4
  key: "wordpress_org-create-user",
5
5
  name: "Create User",
6
6
  description: "Creates a user. [See the docs here](https://developer.wordpress.org/rest-api/reference/users/#create-a-user)",
7
- version: "0.0.1",
7
+ version: "0.0.2",
8
8
  type: "action",
9
9
  props: {
10
10
  wordpress,
@@ -72,14 +72,17 @@ export default {
72
72
  email: this.email,
73
73
  url: this.url,
74
74
  description: this.description,
75
- roles: this.roles,
75
+ roles: this.roles && [
76
+ this.roles,
77
+ ],
76
78
  password: this.password,
77
79
  };
78
-
79
- const resp = await this.wordpress.createUser(params);
80
-
81
- $.export("$summary", "Successfully created new user.");
82
-
83
- return resp;
80
+ try {
81
+ const resp = await this.wordpress.createUser(params);
82
+ $.export("$summary", "Successfully created new user.");
83
+ return resp;
84
+ } catch (e) {
85
+ throw new Error(JSON.stringify(e));
86
+ }
84
87
  },
85
88
  };
@@ -0,0 +1,9 @@
1
+ export default {
2
+ ROLES: [
3
+ "subscriber",
4
+ "contributor",
5
+ "author",
6
+ "editor",
7
+ "administrator",
8
+ ],
9
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/wordpress_org",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Pipedream Wordpress.org Components",
5
5
  "main": "wordpress_org.app.mjs",
6
6
  "keywords": [
@@ -1,4 +1,5 @@
1
1
  import WPAPI from "wpapi";
2
+ import constants from "./common/constants.mjs";
2
3
  const PER_PAGE = 100;
3
4
 
4
5
  export default {
@@ -74,10 +75,11 @@ export default {
74
75
  optional: true,
75
76
  },
76
77
  roles: {
77
- type: "string[]",
78
+ type: "string",
78
79
  label: "Roles",
79
80
  description: "Roles assigned to the user",
80
81
  optional: true,
82
+ options: constants.ROLES,
81
83
  },
82
84
  password: {
83
85
  type: "string",