@taskmagic/apps-phone-validator 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/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # Phone Validator
2
+
3
+ Validate phone numbers and retrieve line type, carrier, and location information.
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@taskmagic/apps-phone-validator",
3
+ "version": "0.0.1",
4
+ "dependencies": {
5
+ "@anthropic-ai/sdk": "0.33.1",
6
+ "@sinclair/typebox": "0.34.11",
7
+ "axios": "1.17.0",
8
+ "axios-retry": "4.4.1",
9
+ "deepmerge-ts": "7.1.0",
10
+ "mime-types": "2.1.35",
11
+ "nanoid": "3.3.8",
12
+ "openai": "4.67.1",
13
+ "replicate": "0.34.1",
14
+ "semver": "7.6.0",
15
+ "zod": "3.25.76",
16
+ "@taskmagic/pieces-common": "0.4.4",
17
+ "@taskmagic/pieces-framework": "0.7.46",
18
+ "@taskmagic/shared": "0.10.171",
19
+ "tslib": "1.14.1"
20
+ },
21
+ "overrides": {
22
+ "cross-spawn": "7.0.6",
23
+ "elliptic": "^6.6.1",
24
+ "fast-xml-parser": "^4.4.1",
25
+ "protobufjs": "^7.5.5",
26
+ "tmp": "^0.2.4",
27
+ "koa": "^2.16.4",
28
+ "picomatch": "^4.0.4",
29
+ "langsmith": "^0.6.0",
30
+ "serialize-javascript": "^6.0.2",
31
+ "elevenlabs": {
32
+ "form-data": "^4.0.4"
33
+ },
34
+ "@tryfabric/martian": {
35
+ "@notionhq/client": "$@notionhq/client"
36
+ },
37
+ "vite": {
38
+ "rollup": "npm:@rollup/wasm-node@^4.61.1"
39
+ }
40
+ },
41
+ "resolutions": {
42
+ "rollup": "npm:@rollup/wasm-node@^4.61.1"
43
+ },
44
+ "types": "./src/index.d.ts",
45
+ "main": "./src/index.js",
46
+ "type": "commonjs"
47
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare const phoneValidator: import("@taskmagic/pieces-framework").Piece<import("@taskmagic/pieces-framework").SecretTextProperty<true>>;
package/src/index.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.phoneValidator = void 0;
4
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
5
+ const shared_1 = require("@taskmagic/shared");
6
+ const auth_1 = require("./lib/common/auth");
7
+ const actions_1 = require("./lib/actions");
8
+ exports.phoneValidator = (0, pieces_framework_1.createPiece)({
9
+ displayName: 'Phone Validator',
10
+ description: 'Validate phone numbers and retrieve line type, carrier, and location information',
11
+ auth: auth_1.phoneValidatorAuth,
12
+ minimumSupportedRelease: '0.30.0',
13
+ logoUrl: 'https://cdn.activepieces.com/pieces/phone-validator.png',
14
+ categories: [shared_1.PieceCategory.COMMUNICATION],
15
+ authors: ['onyedikachi-david'],
16
+ actions: [actions_1.validatePhone],
17
+ triggers: [],
18
+ });
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/phone-validator/src/index.ts"],"names":[],"mappings":";;;AAAA,kEAA0D;AAC1D,8CAAkD;AAClD,4CAAuD;AACvD,2CAA8C;AAEjC,QAAA,cAAc,GAAG,IAAA,8BAAW,EAAC;IACxC,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EACT,kFAAkF;IACpF,IAAI,EAAE,yBAAkB;IACxB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,yDAAyD;IAClE,UAAU,EAAE,CAAC,sBAAa,CAAC,aAAa,CAAC;IACzC,OAAO,EAAE,CAAC,mBAAmB,CAAC;IAC9B,OAAO,EAAE,CAAC,uBAAa,CAAC;IACxB,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './validate-phone';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./validate-phone"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/phone-validator/src/lib/actions/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC"}
@@ -0,0 +1,4 @@
1
+ export declare const validatePhone: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ phoneNumber: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
3
+ searchType: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, true>;
4
+ }>;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validatePhone = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const auth_1 = require("../common/auth");
7
+ const client_1 = require("../common/client");
8
+ exports.validatePhone = (0, pieces_framework_1.createAction)({
9
+ auth: auth_1.phoneValidatorAuth,
10
+ name: 'validatePhone',
11
+ displayName: 'Validate Phone Number',
12
+ description: 'Validate a phone number and retrieve line type, carrier, and location information',
13
+ props: {
14
+ phoneNumber: pieces_framework_1.Property.ShortText({
15
+ displayName: 'Phone Number',
16
+ description: 'The phone number to validate (e.g., 7029270000, 1-702-927-0000)',
17
+ required: true,
18
+ }),
19
+ searchType: pieces_framework_1.Property.StaticDropdown({
20
+ displayName: 'Search Type',
21
+ description: 'Type of phone lookup to perform',
22
+ required: true,
23
+ options: {
24
+ options: [
25
+ {
26
+ label: 'Basic (Line Type + Carrier + Location + Fake Check)',
27
+ value: 'basic',
28
+ },
29
+ {
30
+ label: 'Fake Number Check Only',
31
+ value: 'fake',
32
+ },
33
+ ],
34
+ },
35
+ defaultValue: 'basic',
36
+ }),
37
+ },
38
+ run(_a) {
39
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
40
+ const client = new client_1.PhoneValidatorClient(auth);
41
+ const response = yield client.validatePhone(propsValue.phoneNumber, propsValue.searchType);
42
+ if (response.StatusCode === '200') {
43
+ const result = {
44
+ phoneNumber: response.PhoneNumber,
45
+ cost: response.Cost,
46
+ searchDate: response.SearchDate,
47
+ statusCode: response.StatusCode,
48
+ statusMessage: response.StatusMessage,
49
+ };
50
+ if (response.PhoneBasic) {
51
+ result['phoneBasic'] = {
52
+ phoneNumber: response.PhoneBasic.PhoneNumber,
53
+ reportDate: response.PhoneBasic.ReportDate,
54
+ lineType: response.PhoneBasic.LineType,
55
+ phoneCompany: response.PhoneBasic.PhoneCompany,
56
+ phoneLocation: response.PhoneBasic.PhoneLocation,
57
+ fakeNumber: response.PhoneBasic.FakeNumber,
58
+ fakeNumberReason: response.PhoneBasic.FakeNumberReason ||
59
+ response.PhoneBasic.FakeReason ||
60
+ '',
61
+ errorCode: response.PhoneBasic.ErrorCode,
62
+ errorDescription: response.PhoneBasic.ErrorDescription,
63
+ };
64
+ }
65
+ return result;
66
+ }
67
+ return response;
68
+ });
69
+ },
70
+ });
71
+ //# sourceMappingURL=validate-phone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-phone.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/phone-validator/src/lib/actions/validate-phone.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,yCAAoD;AACpD,6CAAwD;AAE3C,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,yBAAkB;IACxB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,uBAAuB;IACpC,WAAW,EACT,mFAAmF;IACrF,KAAK,EAAE;QACL,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,iEAAiE;YAC9E,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAClC,W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CAAC,gBAAgB;4BACpC,QAAQ,CAAC,UAAU,CAAC,UAAU;4BAC9B,EAAE;wBACJ,SAAS,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS;wBACxC,gBAAgB,EAAE,QAAQ,CAAC,UAAU,CAAC,gBAAgB;qBACvD,CAAC;gBACJ,CAAC;gBAED,OAAO,MAAM,CAAC;YAChB,CAAC;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const phoneValidatorAuth: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.phoneValidatorAuth = void 0;
4
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
5
+ exports.phoneValidatorAuth = pieces_framework_1.PieceAuth.SecretText({
6
+ displayName: 'API Key',
7
+ description: `
8
+ To get your API Key:
9
+
10
+ 1. Sign up and create an account at Phone Validator
11
+ 2. Visit your account information to obtain your API key
12
+ 3. Copy your API key and paste it here
13
+ `,
14
+ required: true,
15
+ });
16
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/phone-validator/src/lib/common/auth.ts"],"names":[],"mappings":";;;AAAA,kEAAwD;AAE3C,QAAA,kBAAkB,GAAG,4BAAS,CAAC,UAAU,CAAC;IACrD,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE;;;;;;CAMd;IACC,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const BASE_URL = "https://api.phonevalidator.com";
2
+ export declare class PhoneValidatorClient {
3
+ private apiKey;
4
+ constructor(apiKey: string);
5
+ validatePhone(phone: string, type?: 'basic' | 'fake'): Promise<any>;
6
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PhoneValidatorClient = exports.BASE_URL = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@taskmagic/pieces-common");
6
+ exports.BASE_URL = 'https://api.phonevalidator.com';
7
+ class PhoneValidatorClient {
8
+ constructor(apiKey) {
9
+ this.apiKey = apiKey;
10
+ }
11
+ validatePhone(phone_1) {
12
+ return tslib_1.__awaiter(this, arguments, void 0, function* (phone, type = 'basic') {
13
+ const response = yield pieces_common_1.httpClient.sendRequest({
14
+ method: pieces_common_1.HttpMethod.GET,
15
+ url: `${exports.BASE_URL}/api/v3/phonesearch`,
16
+ queryParams: {
17
+ apikey: this.apiKey,
18
+ phone,
19
+ type,
20
+ },
21
+ });
22
+ return response.body;
23
+ });
24
+ }
25
+ }
26
+ exports.PhoneValidatorClient = PhoneValidatorClient;
27
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/phone-validator/src/lib/common/client.ts"],"names":[],"mappings":";;;;AAAA,4DAAkE;AAErD,QAAA,QAAQ,GAAG,gCAAgC,CAAC;AAEzD,MAAa,oBAAoB;IAG/B,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAEK,aAAa;qEAAC,KAAa,EAAE,OAAyB,OAAO;YACjE,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,gBAAQ,qBAAqB;gBACrC,WAAW,EAAE;oBACX,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,KAAK;oBACL,IAAI;iBACL;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF;AApBD,oDAoBC"}
@@ -0,0 +1,2 @@
1
+ export * from './auth';
2
+ export * from './client';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./auth"), exports);
5
+ tslib_1.__exportStar(require("./client"), exports);
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/phone-validator/src/lib/common/index.ts"],"names":[],"mappings":";;;AAAA,iDAAuB;AACvB,mDAAyB"}