@pipedream/numverify 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,40 @@
1
+ import numverify from "../../numverify.app.mjs";
2
+
3
+ export default {
4
+ key: "numverify-validate-phone",
5
+ name: "Validate Phone",
6
+ description: "Validates a phone number. [See the documentation](https://numverify.com/documentation)",
7
+ version: "0.0.3",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: true,
12
+ },
13
+ type: "action",
14
+ ai: "optimized",
15
+ props: {
16
+ numverify,
17
+ number: {
18
+ type: "string",
19
+ label: "Number",
20
+ description: "It is most efficient to provide phone numbers in a strictly numeric format (e.g. `441179287870`), but NumVerify is also capable of processing numbers containing special characters (e.g. `+44 (0) 117 928 7870`).",
21
+ },
22
+ countryCode: {
23
+ type: "string",
24
+ label: "Country Code",
25
+ description: "Specify only if working with national (local) phone numbers. 2-digit country code, such as `US`",
26
+ optional: true,
27
+ },
28
+ },
29
+ async run({ $ }) {
30
+ const response = await this.numverify.validatePhone({
31
+ $,
32
+ params: {
33
+ number: this.number,
34
+ country_code: this.countryCode,
35
+ },
36
+ });
37
+ $.export("$summary", `Successfully validated phone number ${this.number}`);
38
+ return response;
39
+ },
40
+ };
package/numverify.app.mjs CHANGED
@@ -1,11 +1,26 @@
1
+ import { axios } from "@pipedream/platform";
2
+
1
3
  export default {
2
4
  type: "app",
3
5
  app: "numverify",
4
- propDefinitions: {},
5
6
  methods: {
6
- // this.$auth contains connected account data
7
- authKeys() {
8
- console.log(Object.keys(this.$auth));
7
+ async _makeRequest({
8
+ $ = this, params, ...args
9
+ }) {
10
+ return axios($, {
11
+ baseURL: "http://apilayer.net/api",
12
+ params: {
13
+ ...params,
14
+ access_key: `${this.$auth.api_key}`,
15
+ },
16
+ ...args,
17
+ });
18
+ },
19
+ async validatePhone(args) {
20
+ return this._makeRequest({
21
+ url: "/validate",
22
+ ...args,
23
+ });
9
24
  },
10
25
  },
11
- };
26
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/numverify",
3
- "version": "0.0.1",
3
+ "version": "0.1.1",
4
4
  "description": "Pipedream numverify Components",
5
5
  "main": "numverify.app.mjs",
6
6
  "keywords": [
@@ -11,5 +11,8 @@
11
11
  "author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
12
12
  "publishConfig": {
13
13
  "access": "public"
14
+ },
15
+ "dependencies": {
16
+ "@pipedream/platform": "^3.1.1"
14
17
  }
15
18
  }