@sinch/verification 0.0.0 → 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 +3 -3
- package/dist/models/v1/identity/identity.d.ts +2 -0
- package/dist/models/v1/index.d.ts +1 -1
- package/dist/models/v1/index.js +1 -1
- package/dist/models/v1/index.js.map +1 -1
- package/dist/models/v1/verification-error/index.d.ts +1 -0
- package/dist/models/v1/verification-error/index.js.map +1 -0
- package/dist/models/v1/{error/error.d.ts → verification-error/verification-error.d.ts} +2 -2
- package/dist/models/v1/{error/error.js → verification-error/verification-error.js} +2 -2
- package/dist/models/v1/verification-error/verification-error.js.map +1 -0
- package/dist/models/v1/verification-request-event/verification-request-event.d.ts +4 -2
- package/dist/models/v1/verification-result-event/verification-result-event.d.ts +4 -3
- package/dist/rest/v1/callbacks/callbacks-webhook.d.ts +3 -0
- package/dist/rest/v1/callbacks/callbacks-webhook.js +19 -0
- package/dist/rest/v1/callbacks/callbacks-webhook.js.map +1 -0
- package/dist/rest/v1/callbacks/index.d.ts +1 -0
- package/dist/rest/v1/callbacks/index.js +18 -0
- package/dist/rest/v1/callbacks/index.js.map +1 -0
- package/dist/rest/v1/index.d.ts +1 -0
- package/dist/rest/v1/index.js +1 -0
- package/dist/rest/v1/index.js.map +1 -1
- package/dist/rest/v1/verifications/verifications-api.jest.fixture.d.ts +1 -1
- package/dist/rest/v1/verifications/verifications-api.jest.fixture.js.map +1 -1
- package/package.json +2 -2
- package/dist/models/v1/error/error.js.map +0 -1
- package/dist/models/v1/error/index.d.ts +0 -1
- package/dist/models/v1/error/index.js.map +0 -1
- /package/dist/models/v1/{error → verification-error}/index.js +0 -0
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ const credentials: SinchClientParameters = {
|
|
|
51
51
|
const sinch = new SinchClient(credentials);
|
|
52
52
|
|
|
53
53
|
const requestData: StartVerificationRequestData = {
|
|
54
|
-
|
|
54
|
+
initiateVerificationRequestBody: {
|
|
55
55
|
identity: {
|
|
56
56
|
type: 'number',
|
|
57
57
|
endpoint: '+17813334444',
|
|
@@ -67,7 +67,7 @@ const verificationInitResponse: InitiateVerificationResponse
|
|
|
67
67
|
|
|
68
68
|
### Standalone
|
|
69
69
|
|
|
70
|
-
The SDK can be used standalone if you need to use only the Verification APIs.
|
|
70
|
+
The SDK can be used standalone if you need to use only the Verification APIs.
|
|
71
71
|
|
|
72
72
|
```typescript
|
|
73
73
|
import {
|
|
@@ -88,7 +88,7 @@ const credentials: SinchClientParameters = {
|
|
|
88
88
|
const verification = new Verification(credentials);
|
|
89
89
|
|
|
90
90
|
const requestData: StartVerificationRequestData = {
|
|
91
|
-
|
|
91
|
+
initiateVerificationRequestBody: {
|
|
92
92
|
identity: {
|
|
93
93
|
type: 'number',
|
|
94
94
|
endpoint: '+17813334444',
|
|
@@ -12,5 +12,7 @@ export interface Identity {
|
|
|
12
12
|
type: TypeEnum;
|
|
13
13
|
/** For type `number` use an [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537)-compatible phone number. */
|
|
14
14
|
endpoint: string;
|
|
15
|
+
/** */
|
|
16
|
+
verified?: boolean;
|
|
15
17
|
}
|
|
16
18
|
export type TypeEnum = 'number';
|
|
@@ -7,7 +7,7 @@ export * from './callout-verification-report-request-callout';
|
|
|
7
7
|
export * from './callout-verification-report-response';
|
|
8
8
|
export * from './data-initiate-verification-response';
|
|
9
9
|
export * from './data-initiate-verification-response-seamless';
|
|
10
|
-
export * from './error';
|
|
10
|
+
export * from './verification-error';
|
|
11
11
|
export * from './flash-call-initiate-verification-response';
|
|
12
12
|
export * from './flash-call-initiate-verification-response-flash-call';
|
|
13
13
|
export * from './flash-call-request-event-response';
|
package/dist/models/v1/index.js
CHANGED
|
@@ -23,7 +23,7 @@ __exportStar(require("./callout-verification-report-request-callout"), exports);
|
|
|
23
23
|
__exportStar(require("./callout-verification-report-response"), exports);
|
|
24
24
|
__exportStar(require("./data-initiate-verification-response"), exports);
|
|
25
25
|
__exportStar(require("./data-initiate-verification-response-seamless"), exports);
|
|
26
|
-
__exportStar(require("./error"), exports);
|
|
26
|
+
__exportStar(require("./verification-error"), exports);
|
|
27
27
|
__exportStar(require("./flash-call-initiate-verification-response"), exports);
|
|
28
28
|
__exportStar(require("./flash-call-initiate-verification-response-flash-call"), exports);
|
|
29
29
|
__exportStar(require("./flash-call-request-event-response"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/v1/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2EAAyD;AACzD,mEAAiD;AACjD,2EAAyD;AACzD,kFAAgE;AAChE,wEAAsD;AACtD,gFAA8D;AAC9D,yEAAuD;AACvD,wEAAsD;AACtD,iFAA+D;AAC/D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/v1/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2EAAyD;AACzD,mEAAiD;AACjD,2EAAyD;AACzD,kFAAgE;AAChE,wEAAsD;AACtD,gFAA8D;AAC9D,yEAAuD;AACvD,wEAAsD;AACtD,iFAA+D;AAC/D,uDAAqC;AACrC,8EAA4D;AAC5D,yFAAuE;AACvE,sEAAoD;AACpD,iFAA+D;AAC/D,0EAAwD;AACxD,qFAAmE;AACnE,2EAAyD;AACzD,iFAA+D;AAC/D,6CAA2B;AAC3B,mEAAiD;AACjD,sFAAoE;AACpE,mEAAiD;AACjD,iDAA+B;AAC/B,0CAAwB;AACxB,uEAAqD;AACrD,2EAAyD;AACzD,+DAA6C;AAC7C,mEAAiD;AACjD,qEAAmD;AACnD,2EAAyD;AACzD,oEAAkD;AAClD,wEAAsD;AACtD,gEAA8C;AAC9C,iEAA+C;AAC/C,+DAA6C;AAC7C,qEAAmD;AACnD,wEAAsD;AACtD,0DAAwC;AACxC,8DAA4C;AAC5C,uEAAqD;AACrD,0CAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { VerificationError } from './verification-error';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/v1/verification-error/index.ts"],"names":[],"mappings":""}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Model:
|
|
2
|
+
* Model: VerificationError
|
|
3
3
|
*
|
|
4
4
|
* THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
7
|
+
export interface VerificationError {
|
|
8
8
|
/** A summary of the HTTP error code and error type. */
|
|
9
9
|
status?: string;
|
|
10
10
|
/** The HTTP error code. */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Model:
|
|
3
|
+
* Model: VerificationError
|
|
4
4
|
*
|
|
5
5
|
* THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
//# sourceMappingURL=error.js.map
|
|
9
|
+
//# sourceMappingURL=verification-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verification-error.js","sourceRoot":"","sources":["../../../../src/models/v1/verification-error/verification-error.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|
|
@@ -10,13 +10,15 @@ export interface VerificationRequestEvent {
|
|
|
10
10
|
/** The ID of the verification request. */
|
|
11
11
|
id: string;
|
|
12
12
|
/** The type of the event. */
|
|
13
|
-
event:
|
|
13
|
+
event: 'VerificationRequestEvent';
|
|
14
14
|
/** The verification method. */
|
|
15
15
|
method: MethodEnum;
|
|
16
16
|
/** @see Identity */
|
|
17
17
|
identity: Identity;
|
|
18
18
|
/** @see VerificationRequestEventPrice */
|
|
19
19
|
price?: VerificationRequestEventPrice;
|
|
20
|
+
/** */
|
|
21
|
+
rate?: VerificationRequestEventPrice;
|
|
20
22
|
/** Used to pass your own reference in the request for tracking purposes. */
|
|
21
23
|
reference?: string;
|
|
22
24
|
/** Can be used to pass custom data in the request. */
|
|
@@ -24,4 +26,4 @@ export interface VerificationRequestEvent {
|
|
|
24
26
|
/** List of strings */
|
|
25
27
|
acceptLanguage?: string[];
|
|
26
28
|
}
|
|
27
|
-
export type MethodEnum = 'sms' | '
|
|
29
|
+
export type MethodEnum = 'sms' | 'flashcall' | 'callout';
|
|
@@ -5,17 +5,18 @@
|
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
7
7
|
import { Identity } from '../identity';
|
|
8
|
+
import { VerificationStatusEnum } from '../enums';
|
|
8
9
|
export interface VerificationResultEvent {
|
|
9
10
|
/** The ID of the verification request. */
|
|
10
11
|
id: string;
|
|
11
12
|
/** The type of the event. */
|
|
12
|
-
event:
|
|
13
|
+
event: 'VerificationResultEvent';
|
|
13
14
|
/** The verification method. */
|
|
14
15
|
method: MethodEnum;
|
|
15
16
|
/** @see Identity */
|
|
16
17
|
identity: Identity;
|
|
17
18
|
/** The status of the verification request. */
|
|
18
|
-
status:
|
|
19
|
+
status: VerificationStatusEnum;
|
|
19
20
|
/** Displays the reason why a verification has `FAILED`, was `DENIED`, or was `ABORTED`. */
|
|
20
21
|
reason?: ReasonEnum;
|
|
21
22
|
/** The reference ID that was optionally passed together with the verification request. */
|
|
@@ -25,6 +26,6 @@ export interface VerificationResultEvent {
|
|
|
25
26
|
/** A custom string that can be provided during a verification request. */
|
|
26
27
|
custom?: string;
|
|
27
28
|
}
|
|
28
|
-
export type MethodEnum = 'sms' | '
|
|
29
|
+
export type MethodEnum = 'sms' | 'flashcall' | 'callout' | 'seamless';
|
|
29
30
|
export type ReasonEnum = 'Fraud' | 'Not enough credit' | 'Blocked' | 'Denied by callback' | 'Invalid callback' | 'Internal error' | 'Destination denied' | 'Network error or number unreachable' | 'Failed pending' | 'SMS delivery failure' | 'Invalid CLI' | 'Invalid code' | 'Expired' | 'Hung up without entering valid code';
|
|
30
31
|
export type SourceEnum = 'intercepted' | 'manual';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseVerificationEventNotification = void 0;
|
|
4
|
+
const parseVerificationEventNotification = (eventBody) => {
|
|
5
|
+
if (eventBody.event) {
|
|
6
|
+
switch (eventBody.event) {
|
|
7
|
+
case 'VerificationRequestEvent':
|
|
8
|
+
return eventBody;
|
|
9
|
+
case 'VerificationResultEvent':
|
|
10
|
+
return eventBody;
|
|
11
|
+
default:
|
|
12
|
+
throw new Error(`Unknown Verification event type: ${eventBody.event}`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
console.log(eventBody);
|
|
16
|
+
throw new Error('Unknown Verification event');
|
|
17
|
+
};
|
|
18
|
+
exports.parseVerificationEventNotification = parseVerificationEventNotification;
|
|
19
|
+
//# sourceMappingURL=callbacks-webhook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callbacks-webhook.js","sourceRoot":"","sources":["../../../../src/rest/v1/callbacks/callbacks-webhook.ts"],"names":[],"mappings":";;;AAIO,MAAM,kCAAkC,GAAG,CAAC,SAAc,EAAwB,EAAE;IACzF,IAAI,SAAS,CAAC,KAAK,EAAE,CAAC;QACpB,QAAQ,SAAS,CAAC,KAAK,EAAE,CAAC;YAC1B,KAAK,0BAA0B;gBAC7B,OAAO,SAAqC,CAAC;YAC/C,KAAK,yBAAyB;gBAC5B,OAAO,SAAoC,CAAC;YAC9C;gBACE,MAAM,IAAI,KAAK,CAAC,oCAAoC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACvB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;AAChD,CAAC,CAAC;AAbW,QAAA,kCAAkC,sCAa7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './callbacks-webhook';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./callbacks-webhook"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rest/v1/callbacks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC"}
|
package/dist/rest/v1/index.d.ts
CHANGED
package/dist/rest/v1/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./callbacks"), exports);
|
|
17
18
|
__exportStar(require("./verification-status"), exports);
|
|
18
19
|
__exportStar(require("./verifications"), exports);
|
|
19
20
|
__exportStar(require("./enums"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rest/v1/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,kDAAgC;AAChC,0CAAwB;AACxB,iDAA+B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rest/v1/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,wDAAsC;AACtC,kDAAgC;AAChC,0CAAwB;AACxB,iDAA+B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="jest" />
|
|
2
|
-
import { VerificationsApi, ReportVerificationByIdRequestData, ReportVerificationByIdentityRequestData, StartVerificationRequestData } from './verifications-api';
|
|
3
2
|
import { InitiateVerificationResponse, VerificationResponse } from '../../../models';
|
|
3
|
+
import { VerificationsApi, ReportVerificationByIdRequestData, ReportVerificationByIdentityRequestData, StartVerificationRequestData } from './verifications-api';
|
|
4
4
|
export declare class VerificationsApiFixture implements Partial<Readonly<VerificationsApi>> {
|
|
5
5
|
/**
|
|
6
6
|
* Fixture associated to function reportVerificationById
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifications-api.jest.fixture.js","sourceRoot":"","sources":["../../../../src/rest/v1/verifications/verifications-api.jest.fixture.ts"],"names":[],"mappings":";;;AAGA,MAAa,uBAAuB;IAApC;QAEE;;WAEG;QACI,eAAU,
|
|
1
|
+
{"version":3,"file":"verifications-api.jest.fixture.js","sourceRoot":"","sources":["../../../../src/rest/v1/verifications/verifications-api.jest.fixture.ts"],"names":[],"mappings":";;;AAGA,MAAa,uBAAuB;IAApC;QAEE;;WAEG;QACI,eAAU,GAAkF,IAAI,CAAC,EAAE,EAAE,CAAC;QAC7G;;WAEG;QACI,qBAAgB,GACiE,IAAI,CAAC,EAAE,EAAE,CAAC;QAClG;;WAEG;QACI,UAAK,GAAqF,IAAI,CAAC,EAAE,EAAE,CAAC;IAC7G,CAAC;CAAA;AAfD,0DAeC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sinch/verification",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1",
|
|
4
4
|
"description": "Sinch Verification API",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"compile": "tsc -p tsconfig.build.json && tsc -p tsconfig.tests.json && rimraf dist/tests tsconfig.build.tsbuildinfo"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@sinch/sdk-client": "^0.0.
|
|
31
|
+
"@sinch/sdk-client": "^0.0.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {},
|
|
34
34
|
"publishConfig": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../../src/models/v1/error/error.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { Error } from './error';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/v1/error/index.ts"],"names":[],"mappings":""}
|
|
File without changes
|