Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import app from "../../identitycheck.app.mjs";

export default {
key: "identitycheck-create-verification",
name: "Create Verification",
description: "Create a identity check. [See the documentation](https://stackgo.notion.site/How-to-Generate-an-IdentityCheck-API-Key-38a12805b43249a480a96b346c491740)",
version: "0.0.1",
type: "action",
props: {
app,
firstName: {
propDefinition: [
app,
"firstName",
],
},
lastName: {
propDefinition: [
app,
"lastName",
],
},
email: {
propDefinition: [
app,
"email",
],
},
},
async run({ $ }) {
const response = await this.app.createVerification({
$,
data: {
firstName: this.firstName,
lastName: this.lastName,
email: this.email,
},
});

$.export("$summary", `Successfully created an identity check with the following URL: '${response.data.idUrl}'`);

return response;
},
};
50 changes: 45 additions & 5 deletions components/identitycheck/identitycheck.app.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,51 @@
import { axios } from "@pipedream/platform";

export default {
type: "app",
app: "identitycheck",
propDefinitions: {},
propDefinitions: {
firstName: {
type: "string",
label: "First Name",
description: "First Name for the identity check",
},
lastName: {
type: "string",
label: "Last Name",
description: "Last Name for the identity check",
},
email: {
type: "string",
label: "Email",
description: "Email address",
},
},
methods: {
// this.$auth contains connected account data
authKeys() {
console.log(Object.keys(this.$auth));
_baseUrl() {
return "https://identity.stackgo.io/api";
},
async _makeRequest(opts = {}) {
const {
$ = this,
path,
headers,
...otherOpts
} = opts;
return axios($, {
...otherOpts,
url: this._baseUrl() + path,
headers: {
...headers,
"Authorization": `Basic ${this.$auth.api_key}`,
},
});
},
async createVerification(args = {}) {
return this._makeRequest({
method: "post",
path: "/direct-verification",
...args,
});
},
},
};
};
7 changes: 5 additions & 2 deletions components/identitycheck/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/identitycheck",
"version": "0.0.1",
"version": "0.1.0",
"description": "Pipedream IdentityCheck Components",
"main": "identitycheck.app.mjs",
"keywords": [
Expand All @@ -11,5 +11,8 @@
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^2.0.0"
}
}
}
5 changes: 4 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.