Skip to content

Commit 9654b55

Browse files
committed
Added actions
1 parent adb9425 commit 9654b55

File tree

4 files changed

+98
-8
lines changed

4 files changed

+98
-8
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import app from "../../identitycheck.app.mjs";
2+
3+
export default {
4+
key: "identitycheck-create-verification",
5+
name: "Create Verification",
6+
description: "Create a identity check. [See the documentation](https://stackgo.notion.site/How-to-Generate-an-IdentityCheck-API-Key-38a12805b43249a480a96b346c491740)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
firstName: {
12+
propDefinition: [
13+
app,
14+
"firstName",
15+
],
16+
},
17+
lastName: {
18+
propDefinition: [
19+
app,
20+
"lastName",
21+
],
22+
},
23+
email: {
24+
propDefinition: [
25+
app,
26+
"email",
27+
],
28+
},
29+
},
30+
async run({ $ }) {
31+
const response = await this.app.createVerification({
32+
$,
33+
data: {
34+
firstName: this.firstName,
35+
lastName: this.lastName,
36+
email: this.email,
37+
},
38+
});
39+
40+
$.export("$summary", `Successfully created an identity check with the following URL: '${response.data.idUrl}'`);
41+
42+
return response;
43+
},
44+
};
Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,51 @@
1+
import { axios } from "@pipedream/platform";
2+
13
export default {
24
type: "app",
35
app: "identitycheck",
4-
propDefinitions: {},
6+
propDefinitions: {
7+
firstName: {
8+
type: "string",
9+
label: "First Name",
10+
description: "First Name for the identity check",
11+
},
12+
lastName: {
13+
type: "string",
14+
label: "Last Name",
15+
description: "Last Name for the identity check",
16+
},
17+
email: {
18+
type: "string",
19+
label: "Email",
20+
description: "Email address",
21+
},
22+
},
523
methods: {
6-
// this.$auth contains connected account data
7-
authKeys() {
8-
console.log(Object.keys(this.$auth));
24+
_baseUrl() {
25+
return "https://identity.stackgo.io/api";
26+
},
27+
async _makeRequest(opts = {}) {
28+
const {
29+
$ = this,
30+
path,
31+
headers,
32+
...otherOpts
33+
} = opts;
34+
return axios($, {
35+
...otherOpts,
36+
url: this._baseUrl() + path,
37+
headers: {
38+
...headers,
39+
"Authorization": `Basic ${this.$auth.api_key}`,
40+
},
41+
});
42+
},
43+
async createVerification(args = {}) {
44+
return this._makeRequest({
45+
method: "post",
46+
path: "/direct-verification",
47+
...args,
48+
});
949
},
1050
},
11-
};
51+
};

components/identitycheck/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/identitycheck",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Pipedream IdentityCheck Components",
55
"main": "identitycheck.app.mjs",
66
"keywords": [
@@ -11,5 +11,8 @@
1111
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
1212
"publishConfig": {
1313
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^2.0.0"
1417
}
15-
}
18+
}

pnpm-lock.yaml

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)