@betterportal/zapier 0.0.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/index.js +43 -0
- package/package.json +20 -0
package/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { discover, actionChoices } = require("../shared/bp-client.js");
|
|
4
|
+
|
|
5
|
+
const listActions = async (z, bundle) => {
|
|
6
|
+
const catalog = await discover({
|
|
7
|
+
tenantUrl: bundle.authData.tenantUrl,
|
|
8
|
+
configManagerUrl: bundle.authData.configManagerUrl,
|
|
9
|
+
apiKey: bundle.authData.apiKey
|
|
10
|
+
});
|
|
11
|
+
return actionChoices(catalog);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
module.exports = {
|
|
15
|
+
version: "0.1.0",
|
|
16
|
+
platformVersion: "15.0.0",
|
|
17
|
+
authentication: {
|
|
18
|
+
type: "custom",
|
|
19
|
+
fields: [
|
|
20
|
+
{ key: "tenantUrl", label: "Tenant URL", required: true },
|
|
21
|
+
{ key: "configManagerUrl", label: "Config Manager URL", required: false },
|
|
22
|
+
{ key: "apiKey", label: "API Key", required: false, type: "password" }
|
|
23
|
+
],
|
|
24
|
+
test: async (z, bundle) => {
|
|
25
|
+
const catalog = await discover(bundle.authData);
|
|
26
|
+
return { tenantId: catalog.tenantId, appId: catalog.appId };
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
creates: {
|
|
30
|
+
action_catalog: {
|
|
31
|
+
key: "action_catalog",
|
|
32
|
+
noun: "BetterPortal Action",
|
|
33
|
+
display: {
|
|
34
|
+
label: "List BetterPortal Actions",
|
|
35
|
+
description: "Discovers BetterPortal services and callable actions."
|
|
36
|
+
},
|
|
37
|
+
operation: {
|
|
38
|
+
perform: listActions,
|
|
39
|
+
sample: { name: "Example: GET hello.index", value: "service:GET:hello.index" }
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@betterportal/zapier",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Zapier app scaffold for BetterPortal automation discovery.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"author": "BetterCorp",
|
|
7
|
+
"license": "(AGPL-3.0-only OR Commercial)",
|
|
8
|
+
"homepage": "https://github.com/BetterCorp/BetterPortal#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/BetterCorp/BetterPortal.git",
|
|
12
|
+
"directory": "automations/zapier"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/BetterCorp/BetterPortal/issues"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
}
|
|
20
|
+
}
|