bandwidth-sdk 7.4.2 → 8.1.0
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/workflows/deploy.yml +1 -1
- package/.github/workflows/test-pr.yml +1 -1
- package/.github/workflows/test-smoke.yml +1 -1
- package/.openapi-generator/FILES +48 -4
- package/README.md +28 -2
- package/api/endpoints-api.ts +519 -0
- package/api/media-api.ts +4 -4
- package/api.ts +1 -0
- package/bandwidth.yml +972 -60
- package/base.ts +30 -0
- package/configuration.ts +1 -1
- package/coverage/clover.xml +815 -616
- package/coverage/coverage-final.json +95 -88
- package/coverage/lcov-report/index.html +38 -38
- 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/endpoints-api.ts.html +1642 -0
- package/coverage/lcov-report/node-sdk/api/index.html +24 -9
- package/coverage/lcov-report/node-sdk/api/media-api.ts.html +17 -17
- 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/multi-channel-api.ts.html +10 -10
- package/coverage/lcov-report/node-sdk/api/phone-number-lookup-api.ts.html +12 -12
- 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 +18 -18
- package/coverage/lcov-report/node-sdk/api/transcriptions-api.ts.html +12 -12
- package/coverage/lcov-report/node-sdk/api.ts.html +18 -15
- package/coverage/lcov-report/node-sdk/base.ts.html +104 -14
- package/coverage/lcov-report/node-sdk/common.ts.html +39 -39
- package/coverage/lcov-report/node-sdk/configuration.ts.html +26 -26
- package/coverage/lcov-report/node-sdk/index.html +7 -7
- package/coverage/lcov-report/node-sdk/models/business-entity-type-enum.ts.html +3 -3
- package/coverage/lcov-report/node-sdk/models/business-registration-type-enum.ts.html +3 -3
- package/coverage/lcov-report/node-sdk/models/bxml/Bxml.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/NestableVerb.ts.html +23 -23
- 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 +13 -13
- package/coverage/lcov-report/node-sdk/models/bxml/index.html +15 -15
- 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/Connect.ts.html +184 -0
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/CustomParam.ts.html +4 -4
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/Endpoint.ts.html +142 -0
- 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 +38 -8
- package/coverage/lcov-report/node-sdk/models/bxml/verbs/index.ts.html +39 -33
- 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/card-width-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/completed-lookup-status-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/deactivation-event-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/device-status-enum.ts.html +163 -0
- package/coverage/lcov-report/node-sdk/models/{business-registration-issuing-country-enum.ts.html → endpoint-direction-enum.ts.html} +10 -61
- package/coverage/lcov-report/node-sdk/models/endpoint-event-type-enum.ts.html +163 -0
- package/coverage/lcov-report/node-sdk/models/endpoint-status-enum.ts.html +163 -0
- package/coverage/lcov-report/node-sdk/models/endpoint-type-enum.ts.html +160 -0
- package/coverage/lcov-report/node-sdk/models/file-format-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/in-progress-lookup-status-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/inbound-callback-type-enum.ts.html +3 -3
- package/coverage/lcov-report/node-sdk/models/index.html +76 -16
- package/coverage/lcov-report/node-sdk/models/index.ts.html +246 -183
- package/coverage/lcov-report/node-sdk/models/latest-message-delivery-status-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/line-type-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/list-message-direction-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/multi-channel-message-channel-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/product-type-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/rbm-action-type-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/rbm-media-height-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/rbm-open-url-enum.ts.html +3 -3
- package/coverage/lcov-report/node-sdk/models/rbm-web-view-enum.ts.html +3 -3
- 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/standalone-card-orientation-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/status-callback-type-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/tfv-callback-status-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/tfv-status-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/thumbnail-alignment-enum.ts.html +2 -2
- package/coverage/lcov-report/node-sdk/models/webhook-subscription-type-enum.ts.html +2 -2
- package/coverage/lcov.info +1226 -764
- package/custom_templates/modelAllOf.mustache +14 -0
- package/dist/api/endpoints-api.d.ts +236 -0
- package/dist/api/endpoints-api.js +666 -0
- package/dist/api/media-api.d.ts +4 -4
- package/dist/api/media-api.js +4 -4
- package/dist/api.d.ts +1 -0
- package/dist/api.js +1 -0
- package/dist/base.js +30 -0
- package/dist/configuration.js +1 -1
- package/dist/models/brtc-error-response.d.ts +18 -0
- package/dist/models/brtc-error-source.d.ts +29 -0
- package/dist/models/brtc-error-source.js +15 -0
- package/dist/models/brtc-error.d.ts +31 -0
- package/dist/models/brtc-error.js +15 -0
- package/dist/models/brtc-link.d.ts +25 -0
- package/dist/models/brtc-link.js +15 -0
- package/dist/models/business-entity-type-enum.d.ts +1 -1
- package/dist/models/business-entity-type-enum.js +1 -1
- package/dist/models/business-registration-type-enum.d.ts +1 -1
- package/dist/models/business-registration-type-enum.js +1 -1
- package/dist/models/bxml/verbs/Connect.d.ts +25 -0
- package/dist/models/bxml/verbs/Connect.js +45 -0
- package/dist/models/bxml/verbs/Endpoint.d.ts +15 -0
- package/dist/models/bxml/verbs/Endpoint.js +37 -0
- package/dist/models/bxml/verbs/index.d.ts +2 -0
- package/dist/models/bxml/verbs/index.js +2 -0
- package/dist/models/create-call.d.ts +2 -2
- package/dist/models/create-endpoint-request-base.d.ts +29 -0
- package/dist/models/create-endpoint-request-base.js +15 -0
- package/dist/models/create-endpoint-response-data.d.ts +42 -0
- package/dist/models/create-endpoint-response-data.js +15 -0
- package/dist/models/create-endpoint-response.d.ts +19 -0
- package/dist/models/create-endpoint-response.js +15 -0
- package/dist/models/create-web-rtc-connection-request.d.ts +33 -0
- package/dist/models/create-web-rtc-connection-request.js +15 -0
- package/dist/models/device-status-enum.d.ts +16 -0
- package/dist/models/device-status-enum.js +20 -0
- package/dist/models/device.d.ts +27 -0
- package/dist/models/device.js +15 -0
- package/dist/models/endpoint-direction-enum.d.ts +17 -0
- package/dist/models/endpoint-direction-enum.js +21 -0
- package/dist/models/endpoint-event-type-enum.d.ts +16 -0
- package/dist/models/endpoint-event-type-enum.js +20 -0
- package/dist/models/endpoint-event.d.ts +45 -0
- package/dist/models/endpoint-event.js +15 -0
- package/dist/models/endpoint-response.d.ts +19 -0
- package/dist/models/endpoint-response.js +15 -0
- package/dist/models/endpoint-status-enum.d.ts +16 -0
- package/dist/models/endpoint-status-enum.js +20 -0
- package/dist/models/endpoint-type-enum.d.ts +15 -0
- package/dist/models/endpoint-type-enum.js +19 -0
- package/dist/models/endpoint.d.ts +38 -0
- package/dist/models/endpoint.js +15 -0
- package/dist/models/endpoints.d.ts +33 -0
- package/dist/models/endpoints.js +15 -0
- package/dist/models/inbound-callback-message.d.ts +48 -2
- package/dist/models/inbound-callback-type-enum.d.ts +1 -1
- package/dist/models/inbound-callback-type-enum.js +1 -1
- package/dist/models/inbound-callback.d.ts +2 -2
- package/dist/models/index.d.ts +23 -2
- package/dist/models/index.js +23 -2
- package/dist/models/list-endpoints-response.d.ts +21 -0
- package/dist/models/list-endpoints-response.js +15 -0
- package/dist/models/lookup-result.d.ts +1 -1
- package/dist/models/machine-detection-configuration.d.ts +1 -1
- package/dist/models/message-request.d.ts +1 -1
- package/dist/models/mms-message-content-file.d.ts +1 -1
- package/dist/models/multi-channel-action-calendar-event.d.ts +28 -2
- package/dist/models/multi-channel-channel-list-mmsobject.d.ts +14 -2
- package/dist/models/multi-channel-channel-list-mmsresponse-object.d.ts +18 -3
- package/dist/models/multi-channel-channel-list-rbmobject.d.ts +14 -2
- package/dist/models/multi-channel-channel-list-rbmresponse-object.d.ts +18 -3
- package/dist/models/multi-channel-channel-list-smsobject.d.ts +14 -2
- package/dist/models/multi-channel-channel-list-smsresponse-object.d.ts +18 -3
- package/dist/models/page.d.ts +29 -0
- package/dist/models/page.js +15 -0
- package/dist/models/rbm-action-dial.d.ts +16 -2
- package/dist/models/rbm-action-open-url.d.ts +20 -2
- package/dist/models/rbm-action-view-location.d.ts +24 -2
- package/dist/models/rbm-card-content-media.d.ts +12 -2
- package/dist/models/rbm-open-url-enum.d.ts +1 -1
- package/dist/models/rbm-open-url-enum.js +1 -1
- package/dist/models/rbm-web-view-enum.d.ts +1 -1
- package/dist/models/rbm-web-view-enum.js +1 -1
- package/dist/models/sip-connection-metadata.d.ts +27 -0
- package/dist/models/sip-connection-metadata.js +15 -0
- package/dist/models/sip-credentials.d.ts +21 -0
- package/dist/models/sip-credentials.js +15 -0
- package/dist/models/status-callback.d.ts +1 -1
- package/dist/models/tfv-submission-info.d.ts +5 -3
- package/dist/models/update-call.d.ts +1 -1
- package/dist/models/verification-request.d.ts +5 -3
- package/dist/models/verification-update-request.d.ts +5 -3
- package/dist/models/{model-error.d.ts → webhook-subscription-error.d.ts} +1 -1
- package/dist/models/webhook-subscription-error.js +15 -0
- package/dist/models/webhook-subscriptions-list-body.d.ts +2 -2
- package/docs/BrtcError.md +28 -0
- package/docs/BrtcErrorResponse.md +24 -0
- package/docs/BrtcErrorSource.md +26 -0
- package/docs/BrtcLink.md +24 -0
- package/docs/BusinessEntityTypeEnum.md +1 -1
- package/docs/BusinessRegistrationTypeEnum.md +1 -1
- package/docs/Callback.md +2 -2
- package/docs/CreateCall.md +2 -2
- package/docs/CreateEndpointRequestBase.md +28 -0
- package/docs/CreateEndpointResponse.md +24 -0
- package/docs/CreateEndpointResponseData.md +34 -0
- package/docs/CreateWebRtcConnectionRequest.md +30 -0
- package/docs/Device.md +26 -0
- package/docs/DeviceStatusEnum.md +10 -0
- package/docs/Endpoint.md +32 -0
- package/docs/EndpointDirectionEnum.md +12 -0
- package/docs/EndpointEvent.md +37 -0
- package/docs/EndpointEventTypeEnum.md +10 -0
- package/docs/EndpointResponse.md +24 -0
- package/docs/EndpointStatusEnum.md +10 -0
- package/docs/EndpointTypeEnum.md +8 -0
- package/docs/Endpoints.md +30 -0
- package/docs/EndpointsApi.md +334 -0
- package/docs/InboundCallback.md +2 -2
- package/docs/InboundCallbackTypeEnum.md +1 -1
- package/docs/ListEndpointsResponse.md +26 -0
- package/docs/LookupResult.md +1 -1
- package/docs/MachineDetectionConfiguration.md +1 -1
- package/docs/MediaApi.md +1 -1
- package/docs/MessageRequest.md +1 -1
- package/docs/MmsMessageContentFile.md +1 -1
- package/docs/Page.md +26 -0
- package/docs/RbmOpenUrlEnum.md +1 -1
- package/docs/RbmWebViewEnum.md +1 -1
- package/docs/SipConnectionMetadata.md +26 -0
- package/docs/SipCredentials.md +22 -0
- package/docs/StatusCallback.md +1 -1
- package/docs/TfvSubmissionInfo.md +2 -2
- package/docs/UpdateCall.md +1 -1
- package/docs/VerificationRequest.md +2 -2
- package/docs/VerificationUpdateRequest.md +2 -2
- package/docs/{Error.md → WebhookSubscriptionError.md} +3 -3
- package/docs/WebhookSubscriptionsListBody.md +1 -1
- package/models/brtc-error-response.ts +28 -0
- package/models/brtc-error-source.ts +35 -0
- package/models/brtc-error.ts +39 -0
- package/models/brtc-link.ts +31 -0
- package/models/business-entity-type-enum.ts +1 -1
- package/models/business-registration-type-enum.ts +1 -1
- package/models/bxml/verbs/Connect.ts +33 -0
- package/models/bxml/verbs/Endpoint.ts +19 -0
- package/models/bxml/verbs/index.ts +2 -0
- package/models/create-call.ts +2 -2
- package/models/create-endpoint-request-base.ts +41 -0
- package/models/create-endpoint-response-data.ts +58 -0
- package/models/create-endpoint-response.ts +31 -0
- package/models/create-web-rtc-connection-request.ts +47 -0
- package/models/device-status-enum.ts +26 -0
- package/models/device.ts +37 -0
- package/models/endpoint-direction-enum.ts +27 -0
- package/models/endpoint-event-type-enum.ts +26 -0
- package/models/endpoint-event.ts +63 -0
- package/models/endpoint-response.ts +31 -0
- package/models/endpoint-status-enum.ts +26 -0
- package/models/endpoint-type-enum.ts +25 -0
- package/models/endpoint.ts +54 -0
- package/models/endpoints.ts +45 -0
- package/models/inbound-callback-message.ts +42 -1
- package/models/inbound-callback-type-enum.ts +1 -1
- package/models/inbound-callback.ts +2 -2
- package/models/index.ts +23 -2
- package/models/list-endpoints-response.ts +35 -0
- package/models/lookup-result.ts +1 -1
- package/models/machine-detection-configuration.ts +1 -1
- package/models/message-request.ts +1 -1
- package/models/mms-message-content-file.ts +1 -1
- package/models/multi-channel-action-calendar-event.ts +27 -1
- package/models/multi-channel-channel-list-mmsobject.ts +12 -1
- package/models/multi-channel-channel-list-mmsresponse-object.ts +16 -1
- package/models/multi-channel-channel-list-rbmobject.ts +12 -1
- package/models/multi-channel-channel-list-rbmresponse-object.ts +16 -1
- package/models/multi-channel-channel-list-smsobject.ts +12 -1
- package/models/multi-channel-channel-list-smsresponse-object.ts +16 -1
- package/models/page.ts +35 -0
- package/models/rbm-action-dial.ts +15 -1
- package/models/rbm-action-open-url.ts +17 -1
- package/models/rbm-action-view-location.ts +23 -1
- package/models/rbm-card-content-media.ts +11 -1
- package/models/rbm-open-url-enum.ts +1 -1
- package/models/rbm-web-view-enum.ts +1 -1
- package/models/sip-connection-metadata.ts +35 -0
- package/models/sip-credentials.ts +27 -0
- package/models/status-callback.ts +1 -1
- package/models/tfv-submission-info.ts +5 -5
- package/models/update-call.ts +1 -1
- package/models/verification-request.ts +5 -5
- package/models/verification-update-request.ts +5 -5
- package/models/{model-error.ts → webhook-subscription-error.ts} +1 -1
- package/models/webhook-subscriptions-list-body.ts +3 -3
- package/package.json +1 -1
- package/tests/smoke/endpoints-api.test.ts +141 -0
- package/tests/smoke/phone-number-lookup-api.test.ts +2 -10
- package/tests/unit/api/endpoints-api.test.ts +106 -0
- package/tests/unit/api/toll-free-verification-api.test.ts +1 -1
- package/tests/unit/models/brtc-error-response.test.ts +50 -0
- package/tests/unit/models/brtc-error-source.test.ts +17 -0
- package/tests/unit/models/brtc-error.test.ts +30 -0
- package/tests/unit/models/brtc-link.test.ts +15 -0
- package/tests/unit/models/bxml/verbs/Connect.test.ts +47 -0
- package/tests/unit/models/bxml/verbs/Endpoint.test.ts +12 -0
- package/tests/unit/models/create-endpoint-request-base.test.ts +21 -0
- package/tests/unit/models/create-endpoint-response-data.test.ts +44 -0
- package/tests/unit/models/create-endpoint-response.test.ts +86 -0
- package/tests/unit/models/create-web-rtc-connection-request.test.ts +21 -0
- package/tests/unit/models/device-status-enum.test.ts +12 -0
- package/tests/unit/models/device.test.ts +19 -0
- package/tests/unit/models/endpoint-direction-enum.test.ts +14 -0
- package/tests/unit/models/endpoint-event-type-enum.test.ts +12 -0
- package/tests/unit/models/endpoint-event.test.ts +44 -0
- package/tests/unit/models/endpoint-response.test.ts +84 -0
- package/tests/unit/models/endpoint-status-enum.test.ts +12 -0
- package/tests/unit/models/endpoint-type-enum.test.ts +10 -0
- package/tests/unit/models/endpoint.test.ts +50 -0
- package/tests/unit/models/endpoints.test.ts +25 -0
- package/tests/unit/models/list-endpoints-response.test.ts +94 -0
- package/tests/unit/models/page.test.ts +17 -0
- package/tests/unit/models/sip-connection-metadata.test.ts +25 -0
- package/tests/unit/models/sip-credentials.test.ts +13 -0
- package/dist/models/business-registration-issuing-country-enum.d.ts +0 -34
- package/dist/models/business-registration-issuing-country-enum.js +0 -38
- package/docs/BusinessRegistrationIssuingCountryEnum.md +0 -41
- package/models/business-registration-issuing-country-enum.ts +0 -44
- package/tests/unit/models/business-registration-issuing-country-enum.test.ts +0 -23
- /package/dist/models/{model-error.js → brtc-error-response.js} +0 -0
package/models/page.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Bandwidth
|
|
5
|
+
* Bandwidth\'s Communication APIs
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
* Contact: letstalk@bandwidth.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
export interface Page {
|
|
18
|
+
/**
|
|
19
|
+
* The number of items per page.
|
|
20
|
+
*/
|
|
21
|
+
'pageSize': number;
|
|
22
|
+
/**
|
|
23
|
+
* The total number of items.
|
|
24
|
+
*/
|
|
25
|
+
'totalElements'?: number;
|
|
26
|
+
/**
|
|
27
|
+
* The total number of pages.
|
|
28
|
+
*/
|
|
29
|
+
'totalPages'?: number;
|
|
30
|
+
/**
|
|
31
|
+
* The current page number.
|
|
32
|
+
*/
|
|
33
|
+
'pageNumber'?: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
@@ -23,6 +23,20 @@ import type { RbmActionTypeEnum } from './rbm-action-type-enum';
|
|
|
23
23
|
/**
|
|
24
24
|
* @type RbmActionDial
|
|
25
25
|
*/
|
|
26
|
-
export
|
|
26
|
+
export interface RbmActionDial {
|
|
27
|
+
'type': RbmActionTypeEnum;
|
|
28
|
+
/**
|
|
29
|
+
* Displayed text for user to click
|
|
30
|
+
*/
|
|
31
|
+
'text': string;
|
|
32
|
+
/**
|
|
33
|
+
* Base64 payload the customer receives when the reply is clicked.
|
|
34
|
+
*/
|
|
35
|
+
'postbackData': string;
|
|
36
|
+
/**
|
|
37
|
+
* The phone number to dial. Must be E164 format.
|
|
38
|
+
*/
|
|
39
|
+
'phoneNumber': string;
|
|
40
|
+
}
|
|
27
41
|
|
|
28
42
|
|
|
@@ -29,6 +29,22 @@ import type { RbmWebViewEnum } from './rbm-web-view-enum';
|
|
|
29
29
|
/**
|
|
30
30
|
* @type RbmActionOpenUrl
|
|
31
31
|
*/
|
|
32
|
-
export
|
|
32
|
+
export interface RbmActionOpenUrl {
|
|
33
|
+
'type': RbmActionTypeEnum;
|
|
34
|
+
/**
|
|
35
|
+
* Displayed text for user to click
|
|
36
|
+
*/
|
|
37
|
+
'text': string;
|
|
38
|
+
/**
|
|
39
|
+
* Base64 payload the customer receives when the reply is clicked.
|
|
40
|
+
*/
|
|
41
|
+
'postbackData': string;
|
|
42
|
+
/**
|
|
43
|
+
* The URL to open in browser.
|
|
44
|
+
*/
|
|
45
|
+
'url': string;
|
|
46
|
+
'application'?: RbmOpenUrlEnum;
|
|
47
|
+
'webviewViewMode'?: RbmWebViewEnum;
|
|
48
|
+
}
|
|
33
49
|
|
|
34
50
|
|
|
@@ -23,6 +23,28 @@ import type { RbmActionTypeEnum } from './rbm-action-type-enum';
|
|
|
23
23
|
/**
|
|
24
24
|
* @type RbmActionViewLocation
|
|
25
25
|
*/
|
|
26
|
-
export
|
|
26
|
+
export interface RbmActionViewLocation {
|
|
27
|
+
'type': RbmActionTypeEnum;
|
|
28
|
+
/**
|
|
29
|
+
* Displayed text for user to click
|
|
30
|
+
*/
|
|
31
|
+
'text': string;
|
|
32
|
+
/**
|
|
33
|
+
* Base64 payload the customer receives when the reply is clicked.
|
|
34
|
+
*/
|
|
35
|
+
'postbackData': string;
|
|
36
|
+
/**
|
|
37
|
+
* The latitude of the location.
|
|
38
|
+
*/
|
|
39
|
+
'latitude': number;
|
|
40
|
+
/**
|
|
41
|
+
* The longitude of the location.
|
|
42
|
+
*/
|
|
43
|
+
'longitude': number;
|
|
44
|
+
/**
|
|
45
|
+
* The label of the location.
|
|
46
|
+
*/
|
|
47
|
+
'label'?: string;
|
|
48
|
+
}
|
|
27
49
|
|
|
28
50
|
|
|
@@ -23,6 +23,16 @@ import type { RbmMessageContentFile } from './rbm-message-content-file';
|
|
|
23
23
|
/**
|
|
24
24
|
* @type RbmCardContentMedia
|
|
25
25
|
*/
|
|
26
|
-
export
|
|
26
|
+
export interface RbmCardContentMedia {
|
|
27
|
+
/**
|
|
28
|
+
* The URL of the media file. 100MB is the maximum file size.
|
|
29
|
+
*/
|
|
30
|
+
'fileUrl': string;
|
|
31
|
+
/**
|
|
32
|
+
* The URL of the thumbnail image. Applies only to video file media.
|
|
33
|
+
*/
|
|
34
|
+
'thumbnailUrl'?: string;
|
|
35
|
+
'height': RbmMediaHeightEnum;
|
|
36
|
+
}
|
|
27
37
|
|
|
28
38
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* Specifies how the URL should be opened on a mobile device. - `BROWSER` Opens the URL in the device\'s default browser. If application is not set or the device doesn
|
|
18
|
+
* Specifies how the URL should be opened on a mobile device. - `BROWSER` Opens the URL in the device\'s default browser. If application is not set or the device doesn\'t support WebView, this option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
export const RbmOpenUrlEnum = {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen.
|
|
18
|
+
* Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
export const RbmWebViewEnum = {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Bandwidth
|
|
5
|
+
* Bandwidth\'s Communication APIs
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
* Contact: letstalk@bandwidth.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
// May contain unused imports in some cases
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
import type { SipCredentials } from './sip-credentials';
|
|
19
|
+
|
|
20
|
+
export interface SipConnectionMetadata {
|
|
21
|
+
/**
|
|
22
|
+
* The IP address of the SIP connection.
|
|
23
|
+
*/
|
|
24
|
+
'ipAddress'?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The port of the SIP connection.
|
|
27
|
+
*/
|
|
28
|
+
'port'?: number;
|
|
29
|
+
'credentials'?: SipCredentials;
|
|
30
|
+
/**
|
|
31
|
+
* The User-to-User Information header for the SIP connection.
|
|
32
|
+
*/
|
|
33
|
+
'uuiHeader'?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Bandwidth
|
|
5
|
+
* Bandwidth\'s Communication APIs
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
* Contact: letstalk@bandwidth.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
export interface SipCredentials {
|
|
18
|
+
/**
|
|
19
|
+
* The username for the SIP connection.
|
|
20
|
+
*/
|
|
21
|
+
'username'?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The password for the SIP connection.
|
|
24
|
+
*/
|
|
25
|
+
'password'?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
@@ -44,7 +44,7 @@ export interface StatusCallback {
|
|
|
44
44
|
*/
|
|
45
45
|
'errorCode'?: number;
|
|
46
46
|
/**
|
|
47
|
-
* The name of the Authorized Message Provider (AMP) that handled this message.
|
|
47
|
+
* The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled.
|
|
48
48
|
*/
|
|
49
49
|
'carrierName'?: string;
|
|
50
50
|
}
|
|
@@ -21,9 +21,6 @@ import type { Address } from './address';
|
|
|
21
21
|
import type { BusinessEntityTypeEnum } from './business-entity-type-enum';
|
|
22
22
|
// May contain unused imports in some cases
|
|
23
23
|
// @ts-ignore
|
|
24
|
-
import type { BusinessRegistrationIssuingCountryEnum } from './business-registration-issuing-country-enum';
|
|
25
|
-
// May contain unused imports in some cases
|
|
26
|
-
// @ts-ignore
|
|
27
24
|
import type { BusinessRegistrationTypeEnum } from './business-registration-type-enum';
|
|
28
25
|
// May contain unused imports in some cases
|
|
29
26
|
// @ts-ignore
|
|
@@ -73,11 +70,14 @@ export interface TfvSubmissionInfo {
|
|
|
73
70
|
*/
|
|
74
71
|
'businessDba'?: string;
|
|
75
72
|
/**
|
|
76
|
-
* Government-issued business identifying number. **Note
|
|
73
|
+
* Government-issued business identifying number. **Note: As of October 19th, 2026 this field will be required when `businessEntityType` is _not_ `SOLE_PROPRIETOR`. If this field is provided, `businessRegistrationType` and `businessRegistrationIssuingCountry` are also required.**
|
|
77
74
|
*/
|
|
78
75
|
'businessRegistrationNumber'?: string | null;
|
|
79
76
|
'businessRegistrationType'?: BusinessRegistrationTypeEnum | null;
|
|
80
|
-
|
|
77
|
+
/**
|
|
78
|
+
* The country issuing the business registration in ISO-3166-1 alpha-3 format. Alpha-2 format is accepted by the API, but alpha-3 is highly encouraged. **Note: As of October 19th, 2026 this field will be required when `businessRegistrationNumber` is provided.** | Registration Type | Supported Countries | |----------------------|------------------------------------| | EIN | USA | | CBN | CAN | | NEQ | CAN | | PROVINCIAL_NUMBER | CAN | | CRN | GBR, HKG | | VAT | GBR, IRL, BRA, NLD | | ACN | AUS | | ABN | AUS | | BRN | HKG | | SIREN | FRA | | SIRET | FRA | | NZBN | NZL | | UST_IDNR | DEU | | CIF | ESP | | NIF | ESP | | CNPJ | BRA | | UID | CHE | | OTHER | Must Provide Country Code |
|
|
79
|
+
*/
|
|
80
|
+
'businessRegistrationIssuingCountry'?: string | null;
|
|
81
81
|
'businessEntityType'?: BusinessEntityTypeEnum;
|
|
82
82
|
}
|
|
83
83
|
|
package/models/update-call.ts
CHANGED
|
@@ -49,7 +49,7 @@ export interface UpdateCall {
|
|
|
49
49
|
*/
|
|
50
50
|
'fallbackPassword'?: string | null;
|
|
51
51
|
/**
|
|
52
|
-
* A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [`<Tag>`](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length
|
|
52
|
+
* A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [`<Tag>`](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 4096 characters. Not allowed if `state` is `completed`.
|
|
53
53
|
*/
|
|
54
54
|
'tag'?: string | null;
|
|
55
55
|
}
|
|
@@ -21,9 +21,6 @@ import type { Address } from './address';
|
|
|
21
21
|
import type { BusinessEntityTypeEnum } from './business-entity-type-enum';
|
|
22
22
|
// May contain unused imports in some cases
|
|
23
23
|
// @ts-ignore
|
|
24
|
-
import type { BusinessRegistrationIssuingCountryEnum } from './business-registration-issuing-country-enum';
|
|
25
|
-
// May contain unused imports in some cases
|
|
26
|
-
// @ts-ignore
|
|
27
24
|
import type { BusinessRegistrationTypeEnum } from './business-registration-type-enum';
|
|
28
25
|
// May contain unused imports in some cases
|
|
29
26
|
// @ts-ignore
|
|
@@ -74,11 +71,14 @@ export interface VerificationRequest {
|
|
|
74
71
|
*/
|
|
75
72
|
'businessDba'?: string;
|
|
76
73
|
/**
|
|
77
|
-
* Government-issued business identifying number. **Note
|
|
74
|
+
* Government-issued business identifying number. **Note: As of October 19th, 2026 this field will be required when `businessEntityType` is _not_ `SOLE_PROPRIETOR`. If this field is provided, `businessRegistrationType` and `businessRegistrationIssuingCountry` are also required.**
|
|
78
75
|
*/
|
|
79
76
|
'businessRegistrationNumber'?: string | null;
|
|
80
77
|
'businessRegistrationType'?: BusinessRegistrationTypeEnum | null;
|
|
81
|
-
|
|
78
|
+
/**
|
|
79
|
+
* The country issuing the business registration in ISO-3166-1 alpha-3 format. Alpha-2 format is accepted by the API, but alpha-3 is highly encouraged. **Note: As of October 19th, 2026 this field will be required when `businessRegistrationNumber` is provided.** | Registration Type | Supported Countries | |----------------------|------------------------------------| | EIN | USA | | CBN | CAN | | NEQ | CAN | | PROVINCIAL_NUMBER | CAN | | CRN | GBR, HKG | | VAT | GBR, IRL, BRA, NLD | | ACN | AUS | | ABN | AUS | | BRN | HKG | | SIREN | FRA | | SIRET | FRA | | NZBN | NZL | | UST_IDNR | DEU | | CIF | ESP | | NIF | ESP | | CNPJ | BRA | | UID | CHE | | OTHER | Must Provide Country Code |
|
|
80
|
+
*/
|
|
81
|
+
'businessRegistrationIssuingCountry'?: string | null;
|
|
82
82
|
'businessEntityType': BusinessEntityTypeEnum;
|
|
83
83
|
/**
|
|
84
84
|
* A message that gets sent to users requesting help.
|
|
@@ -21,9 +21,6 @@ import type { Address } from './address';
|
|
|
21
21
|
import type { BusinessEntityTypeEnum } from './business-entity-type-enum';
|
|
22
22
|
// May contain unused imports in some cases
|
|
23
23
|
// @ts-ignore
|
|
24
|
-
import type { BusinessRegistrationIssuingCountryEnum } from './business-registration-issuing-country-enum';
|
|
25
|
-
// May contain unused imports in some cases
|
|
26
|
-
// @ts-ignore
|
|
27
24
|
import type { BusinessRegistrationTypeEnum } from './business-registration-type-enum';
|
|
28
25
|
// May contain unused imports in some cases
|
|
29
26
|
// @ts-ignore
|
|
@@ -73,12 +70,15 @@ export interface VerificationUpdateRequest {
|
|
|
73
70
|
*/
|
|
74
71
|
'businessDba'?: string;
|
|
75
72
|
/**
|
|
76
|
-
* Government-issued business identifying number. **Note
|
|
73
|
+
* Government-issued business identifying number. **Note: As of October 19th, 2026 this field will be required when `businessEntityType` is _not_ `SOLE_PROPRIETOR`. If this field is provided, `businessRegistrationType` and `businessRegistrationIssuingCountry` are also required.**
|
|
77
74
|
*/
|
|
78
75
|
'businessRegistrationNumber'?: string | null;
|
|
79
76
|
'businessRegistrationType'?: BusinessRegistrationTypeEnum | null;
|
|
80
77
|
'businessEntityType'?: BusinessEntityTypeEnum;
|
|
81
|
-
|
|
78
|
+
/**
|
|
79
|
+
* The country issuing the business registration in ISO-3166-1 alpha-3 format. Alpha-2 format is accepted by the API, but alpha-3 is highly encouraged. **Note: As of October 19th, 2026 this field will be required when `businessRegistrationNumber` is provided.** | Registration Type | Supported Countries | |----------------------|------------------------------------| | EIN | USA | | CBN | CAN | | NEQ | CAN | | PROVINCIAL_NUMBER | CAN | | CRN | GBR, HKG | | VAT | GBR, IRL, BRA, NLD | | ACN | AUS | | ABN | AUS | | BRN | HKG | | SIREN | FRA | | SIRET | FRA | | NZBN | NZL | | UST_IDNR | DEU | | CIF | ESP | | NIF | ESP | | CNPJ | BRA | | UID | CHE | | OTHER | Must Provide Country Code |
|
|
80
|
+
*/
|
|
81
|
+
'businessRegistrationIssuingCountry'?: string | null;
|
|
82
82
|
/**
|
|
83
83
|
* A message that gets sent to users requesting help.
|
|
84
84
|
*/
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
import type { LinksObject } from './links-object';
|
|
19
19
|
// May contain unused imports in some cases
|
|
20
20
|
// @ts-ignore
|
|
21
|
-
import type {
|
|
21
|
+
import type { WebhookSubscription } from './webhook-subscription';
|
|
22
22
|
// May contain unused imports in some cases
|
|
23
23
|
// @ts-ignore
|
|
24
|
-
import type {
|
|
24
|
+
import type { WebhookSubscriptionError } from './webhook-subscription-error';
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* A list of all webhook subscriptions registered for this account ID for this particular feature (unpaginated).
|
|
28
28
|
*/
|
|
29
29
|
export interface WebhookSubscriptionsListBody {
|
|
30
30
|
'links'?: LinksObject;
|
|
31
|
-
'errors'?: Array<
|
|
31
|
+
'errors'?: Array<WebhookSubscriptionError>;
|
|
32
32
|
'data': Array<WebhookSubscription>;
|
|
33
33
|
}
|
|
34
34
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
//@ts-nocheck
|
|
2
|
+
import { EndpointsApi } from '../../api';
|
|
3
|
+
import { Configuration } from '../../configuration';
|
|
4
|
+
import { CreateWebRtcConnectionRequest, EndpointDirectionEnum, EndpointStatusEnum, EndpointTypeEnum } from '../../models';
|
|
5
|
+
|
|
6
|
+
describe('EndpointsApi', () => {
|
|
7
|
+
const config = new Configuration({
|
|
8
|
+
clientId: BW_CLIENT_ID,
|
|
9
|
+
clientSecret: BW_CLIENT_SECRET
|
|
10
|
+
});
|
|
11
|
+
const endpointsApi = new EndpointsApi(config);
|
|
12
|
+
|
|
13
|
+
let endpointId: string;
|
|
14
|
+
|
|
15
|
+
describe('endpoint lifecycle', () => {
|
|
16
|
+
test('should create endpoint', async () => {
|
|
17
|
+
const endpointBody: CreateWebRtcConnectionRequest = {
|
|
18
|
+
type: EndpointTypeEnum.Webrtc,
|
|
19
|
+
direction: EndpointDirectionEnum.Bidirectional
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const { status, data } = await endpointsApi.createEndpoint(BW_ACCOUNT_ID, endpointBody);
|
|
23
|
+
|
|
24
|
+
expect(status).toEqual(201);
|
|
25
|
+
expect(data.links).toBeInstanceOf(Array);
|
|
26
|
+
|
|
27
|
+
expect(data.data).toBeDefined();
|
|
28
|
+
expect(data.data.endpointId).toBeDefined();
|
|
29
|
+
expect(data.data.endpointId).toBeString();
|
|
30
|
+
expect(data.data.token).toBeDefined();
|
|
31
|
+
expect(data.data.token).toBeString();
|
|
32
|
+
expect(data.data.type).toEqual(EndpointTypeEnum.Webrtc);
|
|
33
|
+
expect(data.data.status).toBeDefined();
|
|
34
|
+
expect(data.data.status).toBeOneOf(Object.values(EndpointStatusEnum));
|
|
35
|
+
expect(data.data.creationTimestamp).toBeDefined();
|
|
36
|
+
expect(data.data.creationTimestamp).toBeDateString();
|
|
37
|
+
expect(data.data.expirationTimestamp).toBeDefined();
|
|
38
|
+
expect(data.data.expirationTimestamp).toBeDateString();
|
|
39
|
+
expect(data.errors).toBeInstanceOf(Array);
|
|
40
|
+
expect(data.errors).toHaveLength(0);
|
|
41
|
+
|
|
42
|
+
endpointId = data.data.endpointId;
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test('should list endpoints', async () => {
|
|
46
|
+
const { status, data } = await endpointsApi.listEndpoints(BW_ACCOUNT_ID);
|
|
47
|
+
|
|
48
|
+
expect(status).toEqual(200);
|
|
49
|
+
expect(data.links).toBeInstanceOf(Array);
|
|
50
|
+
expect(data.data).toBeDefined();
|
|
51
|
+
expect(data.data).toBeInstanceOf(Array);
|
|
52
|
+
expect(data.page).toBeDefined();
|
|
53
|
+
expect(data.page.totalElements).toBeDefined();
|
|
54
|
+
expect(data.errors).toBeInstanceOf(Array);
|
|
55
|
+
|
|
56
|
+
const createdEndpoint = data.data.find((item) => item.endpointId === endpointId);
|
|
57
|
+
expect(createdEndpoint).toBeDefined();
|
|
58
|
+
expect(createdEndpoint!.type).toEqual(EndpointTypeEnum.Webrtc);
|
|
59
|
+
expect(createdEndpoint!.status).toBeOneOf(Object.values(EndpointStatusEnum));
|
|
60
|
+
expect(createdEndpoint!.creationTimestamp).toBeDateString();
|
|
61
|
+
expect(createdEndpoint!.expirationTimestamp).toBeDateString();
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
test('should get endpoint', async () => {
|
|
65
|
+
const { status, data } = await endpointsApi.getEndpoint(BW_ACCOUNT_ID, endpointId);
|
|
66
|
+
|
|
67
|
+
expect(status).toEqual(200);
|
|
68
|
+
expect(data.links).toBeInstanceOf(Array);
|
|
69
|
+
expect(data.errors).toBeInstanceOf(Array);
|
|
70
|
+
expect(data.errors).toHaveLength(0);
|
|
71
|
+
expect(data.data.endpointId).toEqual(endpointId);
|
|
72
|
+
expect(data.data.type).toEqual(EndpointTypeEnum.Webrtc);
|
|
73
|
+
expect(data.data.status).toBeDefined();
|
|
74
|
+
expect(data.data.status).toBeOneOf(Object.values(EndpointStatusEnum));
|
|
75
|
+
expect(data.data.creationTimestamp).toBeDefined();
|
|
76
|
+
expect(data.data.creationTimestamp).toBeDateString();
|
|
77
|
+
expect(data.data.expirationTimestamp).toBeDefined();
|
|
78
|
+
expect(data.data.expirationTimestamp).toBeDateString();
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// TODO: Re-enable once we implement the updateEndpointBxml endpoint in the endpoint service
|
|
82
|
+
// test('should update endpoint BXML', async () => {
|
|
83
|
+
// const bxml = '<?xml version="1.0" encoding="UTF-8"?><Bxml><SpeakSentence>Test endpoint BXML</SpeakSentence></Bxml>';
|
|
84
|
+
// const { status } = await endpointsApi.updateEndpointBxml(BW_ACCOUNT_ID, endpointId, bxml);
|
|
85
|
+
// expect(status).toEqual(204);
|
|
86
|
+
// });
|
|
87
|
+
|
|
88
|
+
// test('should update endpoint BXML with different content', async () => {
|
|
89
|
+
// const bxml = '<?xml version="1.0" encoding="UTF-8"?><Bxml><Pause duration="2"/></Bxml>';
|
|
90
|
+
// const { status } = await endpointsApi.updateEndpointBxml(BW_ACCOUNT_ID, endpointId, bxml);
|
|
91
|
+
// expect(status).toEqual(204);
|
|
92
|
+
// });
|
|
93
|
+
|
|
94
|
+
test('should delete an endpoint', async () => {
|
|
95
|
+
const { status } = await endpointsApi.deleteEndpoint(BW_ACCOUNT_ID, endpointId);
|
|
96
|
+
|
|
97
|
+
expect(status).toEqual(204);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
describe('HTTP Errors', () => {
|
|
102
|
+
test('401 - Unauthorized with invalid credentials', async () => {
|
|
103
|
+
const configBad = new Configuration({
|
|
104
|
+
clientId: 'invalid-client-id',
|
|
105
|
+
clientSecret: 'invalid-client-secret'
|
|
106
|
+
});
|
|
107
|
+
const endpointsApiBad = new EndpointsApi(configBad);
|
|
108
|
+
|
|
109
|
+
try {
|
|
110
|
+
await endpointsApiBad.listEndpoints(BW_ACCOUNT_ID);
|
|
111
|
+
fail('Expected error to be thrown');
|
|
112
|
+
} catch (e) {
|
|
113
|
+
expect(e.response.status).toEqual(401);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
test('404 - Not Found with invalid account', async () => {
|
|
118
|
+
const configBad = new Configuration({
|
|
119
|
+
clientId: BW_CLIENT_ID,
|
|
120
|
+
clientSecret: BW_CLIENT_SECRET
|
|
121
|
+
});
|
|
122
|
+
const endpointsApiBad = new EndpointsApi(configBad);
|
|
123
|
+
|
|
124
|
+
try {
|
|
125
|
+
await endpointsApiBad.listEndpoints('invalid-account-id');
|
|
126
|
+
fail('Expected error to be thrown');
|
|
127
|
+
} catch (e) {
|
|
128
|
+
expect(e.response.status).toEqual(404);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
test('404 - Not Found for non-existent endpoint', async () => {
|
|
133
|
+
try {
|
|
134
|
+
await endpointsApi.getEndpoint(BW_ACCOUNT_ID, 'does-not-exist');
|
|
135
|
+
fail('Expected error to be thrown');
|
|
136
|
+
} catch (e) {
|
|
137
|
+
expect(e.response.status).toEqual(404);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
});
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import { sleep } from '../callUtils';
|
|
13
13
|
|
|
14
14
|
describe('PhoneNumberLookupApi', () => {
|
|
15
|
-
jest.setTimeout(
|
|
15
|
+
jest.setTimeout(70000);
|
|
16
16
|
const config = new Configuration({
|
|
17
17
|
clientId: BW_CLIENT_ID,
|
|
18
18
|
clientSecret: BW_CLIENT_SECRET
|
|
@@ -38,16 +38,12 @@ describe('PhoneNumberLookupApi', () => {
|
|
|
38
38
|
expect(createData.errors).toBeInstanceOf(Array);
|
|
39
39
|
|
|
40
40
|
const requestId = createData.data.requestId;
|
|
41
|
-
await sleep(
|
|
41
|
+
await sleep(60);
|
|
42
42
|
|
|
43
43
|
const { status: getStatus, data: getData }
|
|
44
44
|
= await phoneNumberLookupApi.getAsyncBulkLookup(BW_ACCOUNT_ID, requestId);
|
|
45
45
|
|
|
46
46
|
expect(getStatus).toEqual(200);
|
|
47
|
-
expect(getData.links[0]).toBeDefined();
|
|
48
|
-
expect(getData.links[0].rel).toBeString();
|
|
49
|
-
expect(getData.links[0].href).toBeString();
|
|
50
|
-
expect(getData.links[0].method).toBeString();
|
|
51
47
|
expect(getData.data.requestId).toEqual(requestId);
|
|
52
48
|
expect(getData.data.status).toBeOneOf(Object.values(InProgressLookupStatusEnum));
|
|
53
49
|
expect(getData.data.results).toBeInstanceOf(Array);
|
|
@@ -66,10 +62,6 @@ describe('PhoneNumberLookupApi', () => {
|
|
|
66
62
|
const { status, data } = await phoneNumberLookupApi.createSyncLookup(BW_ACCOUNT_ID, request);
|
|
67
63
|
|
|
68
64
|
expect(status).toEqual(200);
|
|
69
|
-
expect(data.links[0]).toBeDefined();
|
|
70
|
-
expect(data.links[0].rel).toBeString();
|
|
71
|
-
expect(data.links[0].href).toBeString();
|
|
72
|
-
expect(data.links[0].method).toBeString();
|
|
73
65
|
expect(data.data.requestId).toBeString();
|
|
74
66
|
expect(data.data.status).toBeOneOf(Object.values(CompletedLookupStatusEnum));
|
|
75
67
|
expect(data.data.results).toBeInstanceOf(Array);
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
//@ts-nocheck
|
|
2
|
+
import { EndpointsApi } from '../../../api';
|
|
3
|
+
import { Configuration } from '../../../configuration';
|
|
4
|
+
import { CreateWebRtcConnectionRequest, EndpointDirectionEnum, EndpointStatusEnum, EndpointTypeEnum } from '../../../models';
|
|
5
|
+
|
|
6
|
+
describe('EndpointsApi', () => {
|
|
7
|
+
const config = new Configuration({
|
|
8
|
+
username: BW_USERNAME,
|
|
9
|
+
password: BW_PASSWORD,
|
|
10
|
+
basePath: 'http://127.0.0.1:4010'
|
|
11
|
+
});
|
|
12
|
+
const endpointsApi = new EndpointsApi(config);
|
|
13
|
+
|
|
14
|
+
const accountId = '9900000';
|
|
15
|
+
const endpointId = 'ep-123456';
|
|
16
|
+
const createEndpointBody: CreateWebRtcConnectionRequest = {
|
|
17
|
+
type: EndpointTypeEnum.Webrtc,
|
|
18
|
+
direction: EndpointDirectionEnum.Bidirectional
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
describe('createEndpoint', () => {
|
|
22
|
+
test('should create endpoint', async () => {
|
|
23
|
+
const { status, data } = await endpointsApi.createEndpoint(accountId, createEndpointBody);
|
|
24
|
+
|
|
25
|
+
expect(status).toEqual(201);
|
|
26
|
+
expect(data.links).toBeInstanceOf(Array);
|
|
27
|
+
expect(data.links.length).toBeGreaterThan(0);
|
|
28
|
+
expect(data.links[0].rel).toBeString();
|
|
29
|
+
expect(data.links[0].href).toBeString();
|
|
30
|
+
|
|
31
|
+
expect(data.data.endpointId).toBeString();
|
|
32
|
+
expect(data.data.type).toBeOneOf(Object.values(EndpointTypeEnum));
|
|
33
|
+
expect(data.data.status).toBeOneOf(Object.values(EndpointStatusEnum));
|
|
34
|
+
expect(data.data.creationTimestamp).toBeDateString();
|
|
35
|
+
expect(data.data.expirationTimestamp).toBeDateString();
|
|
36
|
+
expect(data.data.token).toBeString();
|
|
37
|
+
|
|
38
|
+
expect(data.errors).toBeInstanceOf(Array);
|
|
39
|
+
expect(data.errors).toHaveLength(0);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe('listEndpoints', () => {
|
|
44
|
+
test('should list endpoints', async () => {
|
|
45
|
+
const { status, data } = await endpointsApi.listEndpoints(accountId, EndpointTypeEnum.Webrtc, EndpointStatusEnum.Connected, undefined, 10);
|
|
46
|
+
|
|
47
|
+
expect(status).toEqual(200);
|
|
48
|
+
expect(data.links).toBeInstanceOf(Array);
|
|
49
|
+
expect(data.links.length).toBeGreaterThan(0);
|
|
50
|
+
expect(data.links[0].rel).toBeString();
|
|
51
|
+
expect(data.links[0].href).toBeString();
|
|
52
|
+
expect(data.data).toBeInstanceOf(Array);
|
|
53
|
+
expect(data.page).toBeDefined();
|
|
54
|
+
expect(data.page.pageSize).toBeNumber();
|
|
55
|
+
expect(data.page.pageNumber).toBeNumber();
|
|
56
|
+
expect(data.page.totalPages).toBeNumber();
|
|
57
|
+
expect(data.page.totalElements).toBeNumber();
|
|
58
|
+
expect(data.errors).toBeInstanceOf(Array);
|
|
59
|
+
|
|
60
|
+
expect(data.data.length).toBeGreaterThan(0);
|
|
61
|
+
expect(data.data[0].endpointId).toBeString();
|
|
62
|
+
expect(data.data[0].type).toBeOneOf(Object.values(EndpointTypeEnum));
|
|
63
|
+
expect(data.data[0].status).toBeOneOf(Object.values(EndpointStatusEnum));
|
|
64
|
+
expect(data.data[0].creationTimestamp).toBeDateString();
|
|
65
|
+
expect(data.data[0].expirationTimestamp).toBeDateString();
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
describe('getEndpoint', () => {
|
|
70
|
+
test('should get endpoint', async () => {
|
|
71
|
+
const { status, data } = await endpointsApi.getEndpoint(accountId, endpointId);
|
|
72
|
+
|
|
73
|
+
expect(status).toEqual(200);
|
|
74
|
+
expect(data.links).toBeInstanceOf(Array);
|
|
75
|
+
expect(data.links.length).toBeGreaterThan(0);
|
|
76
|
+
expect(data.links[0].rel).toBeString();
|
|
77
|
+
expect(data.links[0].href).toBeString();
|
|
78
|
+
|
|
79
|
+
expect(data.data.endpointId).toBeString();
|
|
80
|
+
expect(data.data.type).toBeOneOf(Object.values(EndpointTypeEnum));
|
|
81
|
+
expect(data.data.status).toBeOneOf(Object.values(EndpointStatusEnum));
|
|
82
|
+
expect(data.data.creationTimestamp).toBeDateString();
|
|
83
|
+
expect(data.data.expirationTimestamp).toBeDateString();
|
|
84
|
+
|
|
85
|
+
expect(data.errors).toBeInstanceOf(Array);
|
|
86
|
+
expect(data.errors).toHaveLength(0);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
describe('deleteEndpoint', () => {
|
|
91
|
+
test('should delete endpoint', async () => {
|
|
92
|
+
const { status } = await endpointsApi.deleteEndpoint(accountId, endpointId);
|
|
93
|
+
|
|
94
|
+
expect(status).toEqual(204);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
describe('updateEndpointBxml', () => {
|
|
99
|
+
test('should update endpoint bxml', async () => {
|
|
100
|
+
const bxml = '<?xml version="1.0" encoding="UTF-8"?><Bxml><SpeakSentence>Hello</SpeakSentence></Bxml>';
|
|
101
|
+
const { status } = await endpointsApi.updateEndpointBxml(accountId, endpointId, bxml);
|
|
102
|
+
|
|
103
|
+
expect(status).toEqual(204);
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
});
|