diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 30b0159..91530c1 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -21,6 +21,7 @@ docs/AdditionalDenialReason.md docs/Address.md docs/AnswerCallback.md docs/AsyncLookupRequest.md +docs/AttestationLevelEnum.md docs/BlockedWebhook.md docs/BridgeCompleteCallback.md docs/BridgeTargetCompleteCallback.md @@ -237,6 +238,7 @@ models/additional-denial-reason.ts models/address.ts models/answer-callback.ts models/async-lookup-request.ts +models/attestation-level-enum.ts models/blocked-webhook.ts models/bridge-complete-callback.ts models/bridge-target-complete-callback.ts diff --git a/README.md b/README.md index 9c4b086..dbe766c 100644 --- a/README.md +++ b/README.md @@ -170,6 +170,7 @@ Class | Method | HTTP request | Description - [Address](docs/Address.md) - [AnswerCallback](docs/AnswerCallback.md) - [AsyncLookupRequest](docs/AsyncLookupRequest.md) + - [AttestationLevelEnum](docs/AttestationLevelEnum.md) - [BlockedWebhook](docs/BlockedWebhook.md) - [BridgeCompleteCallback](docs/BridgeCompleteCallback.md) - [BridgeTargetCompleteCallback](docs/BridgeTargetCompleteCallback.md) diff --git a/bandwidth.yml b/bandwidth.yml index bffc646..b88af84 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -3241,6 +3241,16 @@ components: - direction - to - from + attestationLevelEnum: + type: string + enum: + - A + - B + - C + description: >- + The STIR/SHAKEN attestation level Bandwidth signs the call with: `A` + (full), `B` (partial), or `C` (gateway). + example: B callbackMethodEnum: type: string nullable: true @@ -3419,6 +3429,52 @@ components: entire value cannot exceed 350 characters, including parameters and separators. + requestedAttestationLevel: + nullable: true + allOf: + - $ref: '#/components/schemas/attestationLevelEnum' + description: >- + The STIR/SHAKEN attestation level (`A`, `B`, or `C`) you request + Bandwidth sign this call with. + + Applies to outbound calls to US destinations only, and only to + accounts that use the + + Hosted + Signing Service; it is ignored + + for all other accounts. If omitted, the attestation policy + configured on your account is used. + + + Cannot be combined with `identity`. A request that includes both is + rejected with a `400`, as is + + any value other than `A`, `B`, or `C`. + identity: + nullable: true + type: string + minLength: 1 + maxLength: 2000 + pattern: ^ *[A-Za-z0-9\-_.+/=;:<>"][A-Za-z0-9\-_.+/=;:<>" ]*$ + description: >- + A complete SIP `Identity` header value that you signed yourself. It + must be a valid STIR/SHAKEN + + PASSporT and may not exceed 2000 characters. Bandwidth sends it + unmodified on the outbound call and + + does not sign the call. Bandwidth checks only the format and size of + the value, not the signature. + + Applies to outbound calls to US destinations only. + + + Cannot be combined with `requestedAttestationLevel`. A request that + includes both, or a value that is too long + + or not in the expected format, is rejected with a `400`. + example: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9jZXJ0LmV4YW1wbGUvY2VydC5wZW0ifQ.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTE5NTU1MTIzNCJdfSwiaWF0IjoxNzAwMDAwMDAwLCJvcmlnIjp7InRuIjoiMTU1NTU1NTEyMTIifSwib3JpZ2lkIjoiMTIzNCJ9.c2lnbmF0dXJl;info=;alg=ES256;ppt="shaken" applicationId: type: string description: The id of the application associated with the `from` number. @@ -3688,6 +3744,20 @@ components: type: integer example: 5 description: The priority of this call over other calls from your account. + requestedAttestationLevel: + nullable: true + allOf: + - $ref: '#/components/schemas/attestationLevelEnum' + description: >- + The `requestedAttestationLevel` provided in the Create Call request, + if any. This is the level you requested, + + which can differ from the level the call is ultimately signed with. + identity: + nullable: true + type: string + description: The `identity` value provided in the Create Call request, if any. + example: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9jZXJ0LmV4YW1wbGUvY2VydC5wZW0ifQ.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTE5NTU1MTIzNCJdfSwiaWF0IjoxNzAwMDAwMDAwLCJvcmlnIjp7InRuIjoiMTU1NTU1NTEyMTIifSwib3JpZ2lkIjoiMTIzNCJ9.c2lnbmF0dXJl;info=;alg=ES256;ppt="shaken" callState: type: object properties: diff --git a/docs/AttestationLevelEnum.md b/docs/AttestationLevelEnum.md new file mode 100644 index 0000000..c7663e9 --- /dev/null +++ b/docs/AttestationLevelEnum.md @@ -0,0 +1,13 @@ +# AttestationLevelEnum + +The STIR/SHAKEN attestation level Bandwidth signs the call with: `A` (full), `B` (partial), or `C` (gateway). + +## Enum + +* `A` (value: `'A'`) + +* `B` (value: `'B'`) + +* `C` (value: `'C'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateCall.md b/docs/CreateCall.md index c18ba9a..465b0a8 100644 --- a/docs/CreateCall.md +++ b/docs/CreateCall.md @@ -10,6 +10,8 @@ Name | Type | Description | Notes **privacy** | **boolean** | Hide the calling number. The `displayName` field can be used to customize the displayed name. | [optional] [default to undefined] **displayName** | **string** | The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`. | [optional] [default to undefined] **uui** | **string** | A comma-separated list of \'User-To-User\' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an \'encoding\' parameter as described in <a href=\'https://tools.ietf.org/html/rfc7433\'>RFC 7433</a>. Only \'jwt\', \'base64\' and \'hex\' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators. | [optional] [default to undefined] +**requestedAttestationLevel** | [**AttestationLevelEnum**](AttestationLevelEnum.md) | The STIR/SHAKEN attestation level (`A`, `B`, or `C`) you request Bandwidth sign this call with. Applies to outbound calls to US destinations only, and only to accounts that use the <a href=\'/docs/voice/stir-shaken/hosted-signing-service\'>Hosted Signing Service</a>; it is ignored for all other accounts. If omitted, the attestation policy configured on your account is used. Cannot be combined with `identity`. A request that includes both is rejected with a `400`, as is any value other than `A`, `B`, or `C`. | [optional] [default to undefined] +**identity** | **string** | A complete SIP `Identity` header value that you signed yourself. It must be a valid STIR/SHAKEN PASSporT and may not exceed 2000 characters. Bandwidth sends it unmodified on the outbound call and does not sign the call. Bandwidth checks only the format and size of the value, not the signature. Applies to outbound calls to US destinations only. Cannot be combined with `requestedAttestationLevel`. A request that includes both, or a value that is too long or not in the expected format, is rejected with a `400`. | [optional] [default to undefined] **applicationId** | **string** | The id of the application associated with the `from` number. | [default to undefined] **answerUrl** | **string** | The full URL to send the <a href=\'/docs/voice/webhooks/answer\'>Answer</a> event to when the called party answers. This endpoint should return the first <a href=\'/docs/voice/bxml\'>BXML document</a> to be executed in the call. Must use `https` if specifying `username` and `password`. | [default to undefined] **answerMethod** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] [default to undefined] @@ -38,6 +40,8 @@ const instance: CreateCall = { privacy, displayName, uui, + requestedAttestationLevel, + identity, applicationId, answerUrl, answerMethod, diff --git a/docs/CreateCallResponse.md b/docs/CreateCallResponse.md index 8f32138..b22516d 100644 --- a/docs/CreateCallResponse.md +++ b/docs/CreateCallResponse.md @@ -26,6 +26,8 @@ Name | Type | Description | Notes **fallbackUsername** | **string** | Basic auth username. | [optional] [default to undefined] **fallbackPassword** | **string** | Basic auth password. | [optional] [default to undefined] **priority** | **number** | The priority of this call over other calls from your account. | [optional] [default to undefined] +**requestedAttestationLevel** | [**AttestationLevelEnum**](AttestationLevelEnum.md) | The `requestedAttestationLevel` provided in the Create Call request, if any. This is the level you requested, which can differ from the level the call is ultimately signed with. | [optional] [default to undefined] +**identity** | **string** | The `identity` value provided in the Create Call request, if any. | [optional] [default to undefined] ## Example @@ -54,6 +56,8 @@ const instance: CreateCallResponse = { fallbackUsername, fallbackPassword, priority, + requestedAttestationLevel, + identity, }; ``` diff --git a/models/attestation-level-enum.ts b/models/attestation-level-enum.ts new file mode 100644 index 0000000..a974b7e --- /dev/null +++ b/models/attestation-level-enum.ts @@ -0,0 +1,30 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bandwidth + * Bandwidth\'s Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * The STIR/SHAKEN attestation level Bandwidth signs the call with: `A` (full), `B` (partial), or `C` (gateway). + */ + +export const AttestationLevelEnum = { + A: 'A', + B: 'B', + C: 'C', +} as const; + +export type AttestationLevelEnum = typeof AttestationLevelEnum[keyof typeof AttestationLevelEnum]; + + + diff --git a/models/create-call-response.ts b/models/create-call-response.ts index 173882d..27ddfba 100644 --- a/models/create-call-response.ts +++ b/models/create-call-response.ts @@ -13,6 +13,9 @@ */ +// May contain unused imports in some cases +// @ts-ignore +import type { AttestationLevelEnum } from './attestation-level-enum'; // May contain unused imports in some cases // @ts-ignore import type { CallbackMethodEnum } from './callback-method-enum'; @@ -93,6 +96,14 @@ export interface CreateCallResponse { * The priority of this call over other calls from your account. */ 'priority'?: number | null; + /** + * The `requestedAttestationLevel` provided in the Create Call request, if any. This is the level you requested, which can differ from the level the call is ultimately signed with. + */ + 'requestedAttestationLevel'?: AttestationLevelEnum | null; + /** + * The `identity` value provided in the Create Call request, if any. + */ + 'identity'?: string | null; } diff --git a/models/create-call.ts b/models/create-call.ts index 184c4f1..fef0f58 100644 --- a/models/create-call.ts +++ b/models/create-call.ts @@ -13,6 +13,9 @@ */ +// May contain unused imports in some cases +// @ts-ignore +import type { AttestationLevelEnum } from './attestation-level-enum'; // May contain unused imports in some cases // @ts-ignore import type { CallbackMethodEnum } from './callback-method-enum'; @@ -41,6 +44,14 @@ export interface CreateCall { * A comma-separated list of \'User-To-User\' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an \'encoding\' parameter as described in RFC 7433. Only \'jwt\', \'base64\' and \'hex\' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators. */ 'uui'?: string | null; + /** + * The STIR/SHAKEN attestation level (`A`, `B`, or `C`) you request Bandwidth sign this call with. Applies to outbound calls to US destinations only, and only to accounts that use the Hosted Signing Service; it is ignored for all other accounts. If omitted, the attestation policy configured on your account is used. Cannot be combined with `identity`. A request that includes both is rejected with a `400`, as is any value other than `A`, `B`, or `C`. + */ + 'requestedAttestationLevel'?: AttestationLevelEnum | null; + /** + * A complete SIP `Identity` header value that you signed yourself. It must be a valid STIR/SHAKEN PASSporT and may not exceed 2000 characters. Bandwidth sends it unmodified on the outbound call and does not sign the call. Bandwidth checks only the format and size of the value, not the signature. Applies to outbound calls to US destinations only. Cannot be combined with `requestedAttestationLevel`. A request that includes both, or a value that is too long or not in the expected format, is rejected with a `400`. + */ + 'identity'?: string | null; /** * The id of the application associated with the `from` number. */ diff --git a/models/index.ts b/models/index.ts index 5a68669..6e1bd24 100644 --- a/models/index.ts +++ b/models/index.ts @@ -3,6 +3,7 @@ export * from './additional-denial-reason'; export * from './address'; export * from './answer-callback'; export * from './async-lookup-request'; +export * from './attestation-level-enum'; export * from './blocked-webhook'; export * from './bridge-complete-callback'; export * from './bridge-target-complete-callback'; diff --git a/tests/unit/api/calls-api.test.ts b/tests/unit/api/calls-api.test.ts index 678750a..32f1bc9 100644 --- a/tests/unit/api/calls-api.test.ts +++ b/tests/unit/api/calls-api.test.ts @@ -3,6 +3,7 @@ import { CallsApi } from '../../../api'; import { Configuration } from '../../../configuration'; import { BW_ACCOUNT_ID, BW_NUMBER, USER_NUMBER, BW_VOICE_APPLICATION_ID, BASE_CALLBACK_URL } from '../constants'; import { + AttestationLevelEnum, CallbackMethodEnum, CallDirectionEnum, CallStateEnum, @@ -26,6 +27,7 @@ describe('CallsApi', () => { const disconnectUrl = `${BASE_CALLBACK_URL}/callbacks/disconnect`; const callTimeout = 30.0; const callbackTimeout = 15.0; + const identity = 'eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=;alg=ES256;ppt="shaken"'; describe('createCall', () => { test('should create a call', async () => { @@ -52,7 +54,9 @@ describe('CallsApi', () => { disconnectMethod: disconnectMethod, machineDetection: amdConfig, callTimeout: callTimeout, - callbackTimeout: callbackTimeout + callbackTimeout: callbackTimeout, + requestedAttestationLevel: AttestationLevelEnum.B, + identity: identity }; const { status, data } = await callsApi.createCall(BW_ACCOUNT_ID, callBody); diff --git a/tests/unit/models/attestation-level-enum.test.ts b/tests/unit/models/attestation-level-enum.test.ts new file mode 100644 index 0000000..ba9c009 --- /dev/null +++ b/tests/unit/models/attestation-level-enum.test.ts @@ -0,0 +1,14 @@ +import { AttestationLevelEnum } from '../../../models/attestation-level-enum'; + +describe('AttestationLevelEnum', () => { + test('should define the expected values', () => { + expect(AttestationLevelEnum.A).toBe('A'); + expect(AttestationLevelEnum.B).toBe('B'); + expect(AttestationLevelEnum.C).toBe('C'); + expect(Object.values(AttestationLevelEnum)).toEqual([ + 'A', + 'B', + 'C' + ]); + }); +}); diff --git a/tests/unit/models/create-call-response.test.ts b/tests/unit/models/create-call-response.test.ts index 09709b2..8d1620b 100644 --- a/tests/unit/models/create-call-response.test.ts +++ b/tests/unit/models/create-call-response.test.ts @@ -1,4 +1,5 @@ import { CreateCallResponse } from '../../../models/create-call-response'; +import { AttestationLevelEnum } from '../../../models/attestation-level-enum'; import { CallbackMethodEnum } from '../../../models/callback-method-enum'; describe('CreateCallResponse', () => { @@ -25,6 +26,8 @@ describe('CreateCallResponse', () => { fallbackUsername: 'test-fallbackUsername', fallbackPassword: 'test-fallbackPassword', priority: 1.5, + requestedAttestationLevel: AttestationLevelEnum.A, + identity: 'test-identity', }; expect(fixture.applicationId).toBe('test-applicationId'); @@ -48,5 +51,7 @@ describe('CreateCallResponse', () => { expect(fixture.fallbackUsername).toBe('test-fallbackUsername'); expect(fixture.fallbackPassword).toBe('test-fallbackPassword'); expect(fixture.priority).toBe(1.5); + expect(fixture.requestedAttestationLevel).toBe(AttestationLevelEnum.A); + expect(fixture.identity).toBe('test-identity'); }); }); diff --git a/tests/unit/models/create-call.test.ts b/tests/unit/models/create-call.test.ts index 91339f6..c44f702 100644 --- a/tests/unit/models/create-call.test.ts +++ b/tests/unit/models/create-call.test.ts @@ -1,4 +1,5 @@ import { CreateCall } from '../../../models/create-call'; +import { AttestationLevelEnum } from '../../../models/attestation-level-enum'; import { CallbackMethodEnum } from '../../../models/callback-method-enum'; import { MachineDetectionConfiguration } from '../../../models/machine-detection-configuration'; @@ -10,6 +11,8 @@ describe('CreateCall', () => { privacy: true, displayName: 'test-displayName', uui: 'test-uui', + requestedAttestationLevel: AttestationLevelEnum.A, + identity: 'test-identity', applicationId: 'test-applicationId', answerUrl: 'test-answerUrl', answerMethod: CallbackMethodEnum.Get, @@ -33,6 +36,8 @@ describe('CreateCall', () => { expect(fixture.privacy).toBe(true); expect(fixture.displayName).toBe('test-displayName'); expect(fixture.uui).toBe('test-uui'); + expect(fixture.requestedAttestationLevel).toBe(AttestationLevelEnum.A); + expect(fixture.identity).toBe('test-identity'); expect(fixture.applicationId).toBe('test-applicationId'); expect(fixture.answerUrl).toBe('test-answerUrl'); expect(fixture.answerMethod).toBe(CallbackMethodEnum.Get);