bandwidth-sdk 4.0.0 → 4.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.
- package/.github/CODEOWNERS +1 -1
- package/.github/workflows/deploy.yml +8 -2
- package/.github/workflows/test-pr.yml +2 -2
- package/.github/workflows/test-smoke.yml +39 -10
- package/.openapi-generator/FILES +25 -0
- package/README.md +3 -4
- package/api/toll-free-verification-api.ts +715 -0
- package/api.ts +1 -0
- package/bandwidth.yml +1113 -0
- package/base.ts +48 -0
- package/configuration.ts +1 -1
- package/coverage/clover.xml +674 -438
- package/coverage/coverage-final.json +70 -66
- package/coverage/lcov-report/index.html +26 -26
- package/coverage/lcov-report/node-sdk/api/calls-api.ts.html +14 -14
- package/coverage/lcov-report/node-sdk/api/conferences-api.ts.html +18 -18
- package/coverage/lcov-report/node-sdk/api/index.html +24 -9
- package/coverage/lcov-report/node-sdk/api/media-api.ts.html +13 -13
- package/coverage/lcov-report/node-sdk/api/messages-api.ts.html +11 -11
- package/coverage/lcov-report/node-sdk/api/mfaapi.ts.html +12 -12
- package/coverage/lcov-report/node-sdk/api/phone-number-lookup-api.ts.html +11 -11
- package/coverage/lcov-report/node-sdk/api/recordings-api.ts.html +19 -19
- package/coverage/lcov-report/node-sdk/api/statistics-api.ts.html +10 -10
- package/coverage/lcov-report/node-sdk/api/toll-free-verification-api.ts.html +2230 -0
- package/coverage/lcov-report/node-sdk/api/transcriptions-api.ts.html +12 -12
- package/coverage/lcov-report/node-sdk/api.ts.html +16 -13
- package/coverage/lcov-report/node-sdk/base.ts.html +158 -14
- package/coverage/lcov-report/node-sdk/common.ts.html +32 -32
- package/coverage/lcov-report/node-sdk/configuration.ts.html +16 -16
- package/coverage/lcov-report/node-sdk/index.html +7 -7
- package/coverage/lcov-report/node-sdk/models/bxml/Bxml.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/NestableVerb.ts.html +6 -6
- package/coverage/lcov-report/node-sdk/models/bxml/Response.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/Root.ts.html +8 -8
- package/coverage/lcov-report/node-sdk/models/bxml/Verb.ts.html +6 -6
- package/coverage/lcov-report/node-sdk/models/bxml/index.html +1 -1
- package/coverage/lcov-report/node-sdk/models/bxml/index.ts.html +3 -3
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/Bridge.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/Conference.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/CustomParam.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/Forward.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/Gather.ts.html +7 -7
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/Hangup.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/Pause.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/PauseRecording.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/PhoneNumber.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/PlayAudio.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/Record.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/Redirect.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/ResumeRecording.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/Ring.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/SendDtmf.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/SipUri.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/SpeakSentence.ts.html +6 -6
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartGather.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartRecording.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartStream.ts.html +5 -5
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartTranscription.ts.html +5 -5
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopGather.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopRecording.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopStream.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopTranscription.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/StreamParam.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/Tag.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/Transfer.ts.html +5 -5
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/index.html +1 -1
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/index.ts.html +31 -31
- package/coverage/lcov-report/node-sdk/models/call-direction-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/call-state-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/call-transcription-detected-language-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/call-transcription-track-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/callback-method-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/callback-type-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/conference-state-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/file-format-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/index.html +50 -5
- package/coverage/lcov-report/node-sdk/models/index.ts.html +164 -92
- package/coverage/lcov-report/node-sdk/models/list-message-direction-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/lookup-status-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/machine-detection-mode-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/message-direction-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/message-status-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/message-type-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/priority-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/recording-state-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/redirect-method-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/tfv-callback-status-enum.ts.html +178 -0
- package/coverage/lcov-report/node-sdk/models/tfv-status-enum.ts.html +187 -0
- package/coverage/lcov-report/node-sdk/models/webhook-subscription-type-enum.ts.html +178 -0
- package/coverage/lcov.info +1106 -526
- package/custom_templates/README.mustache +3 -4
- package/dist/api/toll-free-verification-api.d.ts +338 -0
- package/dist/api/toll-free-verification-api.js +870 -0
- package/dist/api.d.ts +1 -0
- package/dist/api.js +1 -0
- package/dist/base.js +48 -0
- package/dist/common.d.ts +1 -1
- package/dist/configuration.js +1 -1
- package/dist/models/additional-denial-reason.d.ts +36 -0
- package/dist/models/additional-denial-reason.js +15 -0
- package/dist/models/address.d.ts +60 -0
- package/dist/models/address.js +15 -0
- package/dist/models/contact.d.ts +42 -0
- package/dist/models/contact.js +15 -0
- package/dist/models/failure-webhook.d.ts +54 -0
- package/dist/models/failure-webhook.js +15 -0
- package/dist/models/index.d.ts +24 -0
- package/dist/models/index.js +24 -0
- package/dist/models/initiate-callback.d.ts +6 -0
- package/dist/models/links-object.d.ts +42 -0
- package/dist/models/links-object.js +15 -0
- package/dist/models/model-error.d.ts +37 -0
- package/dist/models/model-error.js +15 -0
- package/dist/models/opt-in-workflow.d.ts +30 -0
- package/dist/models/opt-in-workflow.js +15 -0
- package/dist/models/telephone-number.d.ts +24 -0
- package/dist/models/telephone-number.js +15 -0
- package/dist/models/tfv-basic-authentication.d.ts +30 -0
- package/dist/models/tfv-basic-authentication.js +15 -0
- package/dist/models/tfv-callback-status-enum.d.ts +21 -0
- package/dist/models/tfv-callback-status-enum.js +25 -0
- package/dist/models/tfv-error.d.ts +36 -0
- package/dist/models/tfv-error.js +15 -0
- package/dist/models/tfv-status-enum.d.ts +24 -0
- package/dist/models/tfv-status-enum.js +28 -0
- package/dist/models/tfv-status.d.ts +68 -0
- package/dist/models/tfv-status.js +15 -0
- package/dist/models/tfv-submission-info.d.ts +75 -0
- package/dist/models/tfv-submission-info.js +15 -0
- package/dist/models/tfv-submission-wrapper.d.ts +25 -0
- package/dist/models/tfv-submission-wrapper.js +15 -0
- package/dist/models/verification-denial-webhook.d.ts +67 -0
- package/dist/models/verification-denial-webhook.js +15 -0
- package/dist/models/verification-request.d.ts +81 -0
- package/dist/models/verification-request.js +15 -0
- package/dist/models/verification-update-request.d.ts +75 -0
- package/dist/models/verification-update-request.js +15 -0
- package/dist/models/verification-webhook.d.ts +43 -0
- package/dist/models/verification-webhook.js +15 -0
- package/dist/models/webhook-subscription-basic-authentication.d.ts +30 -0
- package/dist/models/webhook-subscription-basic-authentication.js +15 -0
- package/dist/models/webhook-subscription-request-schema.d.ts +37 -0
- package/dist/models/webhook-subscription-request-schema.js +15 -0
- package/dist/models/webhook-subscription-type-enum.d.ts +21 -0
- package/dist/models/webhook-subscription-type-enum.js +25 -0
- package/dist/models/webhook-subscription.d.ts +62 -0
- package/dist/models/webhook-subscription.js +15 -0
- package/dist/models/webhook-subscriptions-list-body.d.ts +39 -0
- package/dist/models/webhook-subscriptions-list-body.js +15 -0
- package/models/additional-denial-reason.ts +42 -0
- package/models/address.ts +66 -0
- package/models/contact.ts +48 -0
- package/models/failure-webhook.ts +60 -0
- package/models/index.ts +24 -0
- package/models/initiate-callback.ts +6 -0
- package/models/links-object.ts +48 -0
- package/models/model-error.ts +45 -0
- package/models/opt-in-workflow.ts +36 -0
- package/models/telephone-number.ts +30 -0
- package/models/tfv-basic-authentication.ts +36 -0
- package/models/tfv-callback-status-enum.ts +31 -0
- package/models/tfv-error.ts +42 -0
- package/models/tfv-status-enum.ts +34 -0
- package/models/tfv-status.ts +80 -0
- package/models/tfv-submission-info.ts +87 -0
- package/models/tfv-submission-wrapper.ts +33 -0
- package/models/verification-denial-webhook.ts +75 -0
- package/models/verification-request.ts +93 -0
- package/models/verification-update-request.ts +87 -0
- package/models/verification-webhook.ts +53 -0
- package/models/webhook-subscription-basic-authentication.ts +36 -0
- package/models/webhook-subscription-request-schema.ts +45 -0
- package/models/webhook-subscription-type-enum.ts +31 -0
- package/models/webhook-subscription.ts +74 -0
- package/models/webhook-subscriptions-list-body.ts +51 -0
- package/openapi-config.yml +0 -1
- package/package.json +1 -1
- package/tests/callUtils.ts +0 -8
- package/tests/smoke/phone-number-lookup-api.test.ts +2 -12
- package/tests/smoke/toll-free-verification-api.test.ts +18 -0
- package/tests/unit/api/calls-api.test.ts +5 -5
- package/tests/unit/api/conferences-api.test.ts +4 -4
- package/tests/unit/api/messages-api.test.ts +5 -14
- package/tests/unit/api/phone-number-lookup-api.test.ts +2 -12
- package/tests/unit/api/recordings-api.test.ts +6 -6
- package/tests/unit/api/toll-free-verification-api.test.ts +159 -0
- package/tests/unit/models/tfv-callback-status-enum.test.ts +8 -0
- package/tests/unit/models/tfv-status-enum.test.ts +11 -0
- package/tests/unit/models/webhook-subscription-type-enum.test.ts +8 -0
|
@@ -23,12 +23,7 @@ describe('PhoneNumberLookupApi', () => {
|
|
|
23
23
|
|
|
24
24
|
expect(status).toEqual(202);
|
|
25
25
|
expect(data.requestId).toHaveLength(36);
|
|
26
|
-
expect(data.status).toBeOneOf(
|
|
27
|
-
LookupStatusEnum.Complete,
|
|
28
|
-
LookupStatusEnum.InProgress,
|
|
29
|
-
LookupStatusEnum.Failed,
|
|
30
|
-
LookupStatusEnum.PartialComplete
|
|
31
|
-
]);
|
|
26
|
+
expect(data.status).toBeOneOf(Object.values(LookupStatusEnum));
|
|
32
27
|
});
|
|
33
28
|
});
|
|
34
29
|
|
|
@@ -42,12 +37,7 @@ describe('PhoneNumberLookupApi', () => {
|
|
|
42
37
|
|
|
43
38
|
expect(status).toEqual(200);
|
|
44
39
|
expect(data.requestId).toHaveLength(36);
|
|
45
|
-
expect(data.status).toBeOneOf(
|
|
46
|
-
LookupStatusEnum.Complete,
|
|
47
|
-
LookupStatusEnum.InProgress,
|
|
48
|
-
LookupStatusEnum.Failed,
|
|
49
|
-
LookupStatusEnum.PartialComplete
|
|
50
|
-
]);
|
|
40
|
+
expect(data.status).toBeOneOf(Object.values(LookupStatusEnum));
|
|
51
41
|
expect(data.result).toBeInstanceOf(Array);
|
|
52
42
|
expect(data.result![0]).toContainAllKeys([
|
|
53
43
|
'Response Code',
|
|
@@ -40,11 +40,11 @@ describe('RecordingsApi', () => {
|
|
|
40
40
|
expect(data[0].transferCallerId).toHaveLength(12);
|
|
41
41
|
expect(data[0].transferTo).toHaveLength(12);
|
|
42
42
|
expect(data[0].duration).toStartWith('PT');
|
|
43
|
-
expect(data[0].direction).toBeOneOf(
|
|
43
|
+
expect(data[0].direction).toBeOneOf(Object.values(CallDirectionEnum));
|
|
44
44
|
expect(data[0].channels).toBeNumber();
|
|
45
45
|
expect(data[0].startTime).toBeDateString();
|
|
46
46
|
expect(data[0].endTime).toBeDateString();
|
|
47
|
-
expect(data[0].fileFormat).toBeOneOf(
|
|
47
|
+
expect(data[0].fileFormat).toBeOneOf(Object.values(FileFormatEnum));
|
|
48
48
|
expect(data[0].status).toBeString();
|
|
49
49
|
expect(data[0].mediaUrl).toStartWith('http');
|
|
50
50
|
expect(data[0].transcription).toContainAllKeys(['id', 'status', 'completedTime', 'url']);
|
|
@@ -72,11 +72,11 @@ describe('RecordingsApi', () => {
|
|
|
72
72
|
expect(data[0].transferCallerId).toHaveLength(12);
|
|
73
73
|
expect(data[0].transferTo).toHaveLength(12);
|
|
74
74
|
expect(data[0].duration).toStartWith('PT');
|
|
75
|
-
expect(data[0].direction).toBeOneOf(
|
|
75
|
+
expect(data[0].direction).toBeOneOf(Object.values(CallDirectionEnum));
|
|
76
76
|
expect(data[0].channels).toBeNumber();
|
|
77
77
|
expect(data[0].startTime).toBeDateString();
|
|
78
78
|
expect(data[0].endTime).toBeDateString();
|
|
79
|
-
expect(data[0].fileFormat).toBeOneOf(
|
|
79
|
+
expect(data[0].fileFormat).toBeOneOf(Object.values(FileFormatEnum));
|
|
80
80
|
expect(data[0].status).toBeString();
|
|
81
81
|
expect(data[0].mediaUrl).toStartWith('http');
|
|
82
82
|
expect(data[0].transcription).toContainAllKeys(['id', 'status', 'completedTime', 'url']);
|
|
@@ -103,11 +103,11 @@ describe('RecordingsApi', () => {
|
|
|
103
103
|
expect(data.transferCallerId).toHaveLength(12);
|
|
104
104
|
expect(data.transferTo).toHaveLength(12);
|
|
105
105
|
expect(data.duration).toStartWith('PT');
|
|
106
|
-
expect(data.direction).toBeOneOf(
|
|
106
|
+
expect(data.direction).toBeOneOf(Object.values(CallDirectionEnum));
|
|
107
107
|
expect(data.channels).toBeNumber();
|
|
108
108
|
expect(data.startTime).toBeDateString();
|
|
109
109
|
expect(data.endTime).toBeDateString();
|
|
110
|
-
expect(data.fileFormat).toBeOneOf(
|
|
110
|
+
expect(data.fileFormat).toBeOneOf(Object.values(FileFormatEnum));
|
|
111
111
|
expect(data.status).toBeString();
|
|
112
112
|
expect(data.mediaUrl).toStartWith('http');
|
|
113
113
|
expect(data.transcription).toContainAllKeys(['id', 'status', 'completedTime', 'url']);
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
//@ts-nocheck
|
|
2
|
+
import { TollFreeVerificationApi } from '../../../api';
|
|
3
|
+
import { Configuration } from '../../../configuration';
|
|
4
|
+
import { CallbackTypeEnum, TfvStatusEnum, WebhookSubscriptionTypeEnum } from '../../../models';
|
|
5
|
+
|
|
6
|
+
describe('TollFreeVerificationApi', () => {
|
|
7
|
+
const config = new Configuration({
|
|
8
|
+
username: BW_USERNAME,
|
|
9
|
+
password: BW_PASSWORD,
|
|
10
|
+
basePath: 'http://127.0.0.1:4010'
|
|
11
|
+
});
|
|
12
|
+
const tfvApi = new TollFreeVerificationApi(config);
|
|
13
|
+
|
|
14
|
+
const webhookSubscriptionRequestSchema = {
|
|
15
|
+
basicAuthentication: {
|
|
16
|
+
username: 'username',
|
|
17
|
+
password: 'password'
|
|
18
|
+
},
|
|
19
|
+
callbackUrl: 'https://example.com',
|
|
20
|
+
sharedSecretKey: 'shared-secret-key'
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
describe('createWebhookSubscription', () => {
|
|
24
|
+
test('should create a webhook subscription', async () => {
|
|
25
|
+
const { status, data } = await tfvApi.createWebhookSubscription(BW_ACCOUNT_ID, webhookSubscriptionRequestSchema);
|
|
26
|
+
|
|
27
|
+
expect(status).toEqual(201);
|
|
28
|
+
expect(data.id).toBeString();
|
|
29
|
+
expect(data.accountId).toHaveLength(7);
|
|
30
|
+
expect(data.callbackUrl).toStartWith('http');
|
|
31
|
+
expect(data.type).toBeOneOf(Object.values(WebhookSubscriptionTypeEnum));
|
|
32
|
+
expect(data.basicAuthentication!.username).toBeString();
|
|
33
|
+
expect(data.basicAuthentication!.password).toBeString();
|
|
34
|
+
expect(data.createdDate).toBeDateString();
|
|
35
|
+
expect(data.modifiedDate).toBeDateString();
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
describe('deleteWebhookSubscription', () => {
|
|
40
|
+
test('should delete a webhook subscription', async () => {
|
|
41
|
+
const { status } = await tfvApi.deleteWebhookSubscription(BW_ACCOUNT_ID, 'test-id-1234');
|
|
42
|
+
|
|
43
|
+
expect(status).toEqual(204);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
describe('getTollFreeVerificationStatus', () => {
|
|
48
|
+
test('should get toll-free verification status', async () => {
|
|
49
|
+
const { status, data } = await tfvApi.getTollFreeVerificationStatus(BW_ACCOUNT_ID, '+18005551234');
|
|
50
|
+
|
|
51
|
+
expect(status).toEqual(200);
|
|
52
|
+
expect(data.phoneNumber).toBeString();
|
|
53
|
+
expect(data.status).toBeOneOf(Object.values(TfvStatusEnum));
|
|
54
|
+
expect(data.internalTicketNumber).toBeString();
|
|
55
|
+
expect(data.declineReasonDescription).toBeString();
|
|
56
|
+
expect(data.resubmitAllowed).toBeBoolean();
|
|
57
|
+
expect(data.createdDateTime).toBeDateString();
|
|
58
|
+
expect(data.modifiedDateTime).toBeDateString();
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
describe('listTollFreeUseCases', () => {
|
|
63
|
+
test('should list toll-free use cases', async () => {
|
|
64
|
+
const { status, data } = await tfvApi.listTollFreeUseCases();
|
|
65
|
+
|
|
66
|
+
expect(status).toEqual(200);
|
|
67
|
+
expect(data).toBeInstanceOf(Array);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
describe('listWebhookSubscriptions', () => {
|
|
72
|
+
test('should list webhook subscriptions', async () => {
|
|
73
|
+
const { status, data } = await tfvApi.listWebhookSubscriptions(BW_ACCOUNT_ID);
|
|
74
|
+
|
|
75
|
+
expect(status).toEqual(200);
|
|
76
|
+
expect(data).toHaveProperty('links');
|
|
77
|
+
expect(data.links!.first).toBeString();
|
|
78
|
+
expect(data.links!.next).toBeString();
|
|
79
|
+
expect(data.links!.previous).toBeString();
|
|
80
|
+
expect(data.links!.last).toBeString();
|
|
81
|
+
expect(data.errors).toBeInstanceOf(Array);
|
|
82
|
+
expect(data.errors[0]!.code).toBeNumber();
|
|
83
|
+
expect(data.errors[0]!.description).toBeString();
|
|
84
|
+
expect(data.errors[0]!.telephoneNumbers).toBeInstanceOf(Array);
|
|
85
|
+
expect(data.errors[0]!.telephoneNumbers[0].telephoneNumber).toBeString();
|
|
86
|
+
expect(data.data).toBeInstanceOf(Array);
|
|
87
|
+
expect(data.data[0]!.id).toBeString();
|
|
88
|
+
expect(data.data[0]!.accountId).toBeString();
|
|
89
|
+
expect(data.data[0]!.callbackUrl).toBeString();
|
|
90
|
+
expect(data.data[0]!.type).toBeOneOf(Object.values(WebhookSubscriptionTypeEnum));
|
|
91
|
+
expect(data.data[0]!.basicAuthentication.username).toBeString();
|
|
92
|
+
expect(data.data[0]!.basicAuthentication.password).toBeString();
|
|
93
|
+
expect(data.data[0]!.createdDate).toBeDateString();
|
|
94
|
+
expect(data.data[0]!.modifiedDate).toBeDateString();
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
describe('requestTollFreeVerification', () => {
|
|
99
|
+
test('should request toll-free verification', async () => {
|
|
100
|
+
const verificationRequest = {
|
|
101
|
+
businessAddress: {
|
|
102
|
+
name: 'name',
|
|
103
|
+
addr1: 'addr1',
|
|
104
|
+
addr2: 'addr2',
|
|
105
|
+
city: 'city',
|
|
106
|
+
state: 'state',
|
|
107
|
+
zip: 'zip',
|
|
108
|
+
url: 'https://example.com'
|
|
109
|
+
},
|
|
110
|
+
businessContact: {
|
|
111
|
+
firstName: 'first-name',
|
|
112
|
+
lastName: 'last-name',
|
|
113
|
+
email: 'email@email.com',
|
|
114
|
+
phoneNumber: '+19195551234'
|
|
115
|
+
},
|
|
116
|
+
messageVolume: 12,
|
|
117
|
+
phoneNumbers: ['+18005551234'],
|
|
118
|
+
useCase: 'useCase',
|
|
119
|
+
useCaseSummary: 'useCaseSummary',
|
|
120
|
+
productionMessageContent: 'productionMessageContent',
|
|
121
|
+
optInWorkflow: {
|
|
122
|
+
description: 'description',
|
|
123
|
+
imageUrls: ['https://example.com']
|
|
124
|
+
},
|
|
125
|
+
additionalInformation: 'additionalInformation',
|
|
126
|
+
isvReseller: 'isvReseller'
|
|
127
|
+
};
|
|
128
|
+
const { status } = await tfvApi.requestTollFreeVerification(BW_ACCOUNT_ID, verificationRequest);
|
|
129
|
+
|
|
130
|
+
expect(status).toEqual(202);
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
describe('updateTollFreeVerificationRequest', () => {
|
|
135
|
+
test('should update toll-free verification request', async () => {
|
|
136
|
+
const tfvSubmissionWrapper = {
|
|
137
|
+
submission: undefined
|
|
138
|
+
};
|
|
139
|
+
const { status } = await tfvApi.updateTollFreeVerificationRequest(BW_ACCOUNT_ID, '+18005551234', tfvSubmissionWrapper);
|
|
140
|
+
expect(status).toEqual(202);
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
describe('updateWebhookSubscription', () => {
|
|
145
|
+
test('should update webhook subscription', async () => {
|
|
146
|
+
const { status, data } = await tfvApi.updateWebhookSubscription(BW_ACCOUNT_ID, 'test-id-1234', webhookSubscriptionRequestSchema);
|
|
147
|
+
|
|
148
|
+
expect(status).toEqual(200);
|
|
149
|
+
expect(data.id).toBeString();
|
|
150
|
+
expect(data.accountId).toHaveLength(7);
|
|
151
|
+
expect(data.callbackUrl).toStartWith('http');
|
|
152
|
+
expect(data.type).toBeOneOf(Object.values(WebhookSubscriptionTypeEnum));
|
|
153
|
+
expect(data.basicAuthentication!.username).toBeString();
|
|
154
|
+
expect(data.basicAuthentication!.password).toBeString();
|
|
155
|
+
expect(data.createdDate).toBeDateString();
|
|
156
|
+
expect(data.modifiedDate).toBeDateString();
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TfvCallbackStatusEnum } from '../../../models/tfv-callback-status-enum';
|
|
2
|
+
|
|
3
|
+
describe('TfvCallbackStatusEnum', () => {
|
|
4
|
+
test('should define the expected values', () => {
|
|
5
|
+
expect(TfvCallbackStatusEnum.Verified).toBe('VERIFIED');
|
|
6
|
+
expect(TfvCallbackStatusEnum.Unverified).toBe('UNVERIFIED');
|
|
7
|
+
});
|
|
8
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TfvStatusEnum } from '../../../models/tfv-status-enum';
|
|
2
|
+
|
|
3
|
+
describe('TfvStatusEnum', () => {
|
|
4
|
+
test('should define the expected values', () => {
|
|
5
|
+
expect(TfvStatusEnum.Verified).toBe('VERIFIED');
|
|
6
|
+
expect(TfvStatusEnum.Unverified).toBe('UNVERIFIED');
|
|
7
|
+
expect(TfvStatusEnum.Pending).toBe('PENDING');
|
|
8
|
+
expect(TfvStatusEnum.PartiallyVerified).toBe('PARTIALLY_VERIFIED');
|
|
9
|
+
expect(TfvStatusEnum.InvalidStatus).toBe('INVALID_STATUS');
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WebhookSubscriptionTypeEnum } from '../../../models/webhook-subscription-type-enum';
|
|
2
|
+
|
|
3
|
+
describe('WebhookSubscriptionTypeEnum', () => {
|
|
4
|
+
test('should define the expected values', () => {
|
|
5
|
+
expect(WebhookSubscriptionTypeEnum.TollfreeVerificationStatus).toBe('TOLLFREE_VERIFICATION_STATUS');
|
|
6
|
+
expect(WebhookSubscriptionTypeEnum.MessagingPortoutApprovalStatus).toBe('MESSAGING_PORTOUT_APPROVAL_STATUS');
|
|
7
|
+
});
|
|
8
|
+
});
|