Skip to content

Commit 4b530aa

Browse files
band-swi[bot]DX-Bandwidthckoegel
authored
SWI-5543 Update SDK Based on Recent Spec Changes (#35)
* Generate SDK with OpenAPI Generator Version 7.6.0 * formatting * update transcriptions tests * update smoke test wf * add unit tests for new enum models --------- Co-authored-by: DX-Bandwidth <[email protected]> Co-authored-by: ckoegel <[email protected]>
1 parent aa69a2d commit 4b530aa

11 files changed

+135
-44
lines changed

.github/workflows/test-nightly.yml renamed to .github/workflows/test-smoke.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
name: Nightly Smoke Tests
1+
name: Smoke Tests
22

33
on:
44
schedule:
55
- cron: "0 4 * * *"
6+
pull_request:
7+
paths:
8+
- "tests/smoke/**"
69

710
concurrency:
811
group: ${{ github.workflow }}-${{ github.head_ref }}
@@ -26,7 +29,7 @@ env:
2629

2730
jobs:
2831
test_main:
29-
name: Nightly Smoke Test
32+
name: Smoke Test
3033
runs-on: ubuntu-latest
3134
steps:
3235
- name: Checkout

.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ models/call-direction-enum.ts
2323
models/call-recording-metadata.ts
2424
models/call-state-enum.ts
2525
models/call-state.ts
26+
models/call-transcription-detected-language-enum.ts
2627
models/call-transcription-metadata.ts
2728
models/call-transcription-response.ts
29+
models/call-transcription-track-enum.ts
2830
models/call-transcription.ts
2931
models/callback-method-enum.ts
3032
models/code-request.ts

bandwidth.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2131,6 +2131,21 @@ components:
21312131
21322132
and will include its result.
21332133
example: async
2134+
callTranscriptionDetectedLanguageEnum:
2135+
type: string
2136+
enum:
2137+
- en-US
2138+
- es-US
2139+
- fr-FR
2140+
description: The detected language for this transcription.
2141+
example: en-US
2142+
callTranscriptionTrackEnum:
2143+
type: string
2144+
enum:
2145+
- inbound
2146+
- outbound
2147+
description: Which `track` this transcription is derived from.
2148+
example: inbound
21342149
createCall:
21352150
type: object
21362151
required:
@@ -3281,27 +3296,16 @@ components:
32813296
example:
32823297
- detectedLanguage: en-US
32833298
track: inbound
3284-
text: Hello World! This is an example.
3299+
transcript: Hello World! This is an example.
32853300
confidence: 0.9
32863301
callTranscription:
32873302
type: object
32883303
properties:
32893304
detectedLanguage:
3290-
type: string
3291-
enum:
3292-
- en-US
3293-
- es-US
3294-
- fr-FR
3295-
description: The detected language for this transcription.
3296-
example: en-US
3305+
$ref: '#/components/schemas/callTranscriptionDetectedLanguageEnum'
32973306
track:
3298-
type: string
3299-
enum:
3300-
- inbound
3301-
- outbound
3302-
description: Which `track` this transcription is derived from.
3303-
example: inbound
3304-
text:
3307+
$ref: '#/components/schemas/callTranscriptionTrackEnum'
3308+
transcript:
33053309
type: string
33063310
description: The transcription itself.
33073311
example: Hello World! This is an example.
@@ -3327,6 +3331,7 @@ components:
33273331
$ref: '#/components/schemas/status'
33283332
completedTime:
33293333
type: string
3334+
format: date-time
33303335
description: The time that the transcription was completed
33313336
example: '2022-06-13T18:46:29.715Z'
33323337
url:
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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: [email protected]
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+
/**
18+
* The detected language for this transcription.
19+
* @export
20+
* @enum {string}
21+
*/
22+
23+
export const CallTranscriptionDetectedLanguageEnum = {
24+
EnUs: 'en-US',
25+
EsUs: 'es-US',
26+
FrFr: 'fr-FR'
27+
} as const;
28+
29+
export type CallTranscriptionDetectedLanguageEnum = typeof CallTranscriptionDetectedLanguageEnum[keyof typeof CallTranscriptionDetectedLanguageEnum];
30+
31+
32+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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: [email protected]
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+
/**
18+
* Which `track` this transcription is derived from.
19+
* @export
20+
* @enum {string}
21+
*/
22+
23+
export const CallTranscriptionTrackEnum = {
24+
Inbound: 'inbound',
25+
Outbound: 'outbound'
26+
} as const;
27+
28+
export type CallTranscriptionTrackEnum = typeof CallTranscriptionTrackEnum[keyof typeof CallTranscriptionTrackEnum];
29+
30+
31+

models/call-transcription.ts

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
*/
1414

1515

16+
// May contain unused imports in some cases
17+
// @ts-ignore
18+
import type { CallTranscriptionDetectedLanguageEnum } from './call-transcription-detected-language-enum';
19+
// May contain unused imports in some cases
20+
// @ts-ignore
21+
import type { CallTranscriptionTrackEnum } from './call-transcription-track-enum';
1622

1723
/**
1824
*
@@ -21,14 +27,14 @@
2127
*/
2228
export interface CallTranscription {
2329
/**
24-
* The detected language for this transcription.
25-
* @type {string}
30+
*
31+
* @type {CallTranscriptionDetectedLanguageEnum}
2632
* @memberof CallTranscription
2733
*/
2834
'detectedLanguage'?: CallTranscriptionDetectedLanguageEnum;
2935
/**
30-
* Which `track` this transcription is derived from.
31-
* @type {string}
36+
*
37+
* @type {CallTranscriptionTrackEnum}
3238
* @memberof CallTranscription
3339
*/
3440
'track'?: CallTranscriptionTrackEnum;
@@ -37,7 +43,7 @@ export interface CallTranscription {
3743
* @type {string}
3844
* @memberof CallTranscription
3945
*/
40-
'text'?: string;
46+
'transcript'?: string;
4147
/**
4248
* How confident the transcription engine was in transcribing the associated audio (from `0` to `1`).
4349
* @type {number}
@@ -46,18 +52,5 @@ export interface CallTranscription {
4652
'confidence'?: number;
4753
}
4854

49-
export const CallTranscriptionDetectedLanguageEnum = {
50-
EnUs: 'en-US',
51-
EsUs: 'es-US',
52-
FrFr: 'fr-FR'
53-
} as const;
54-
55-
export type CallTranscriptionDetectedLanguageEnum = typeof CallTranscriptionDetectedLanguageEnum[keyof typeof CallTranscriptionDetectedLanguageEnum];
56-
export const CallTranscriptionTrackEnum = {
57-
Inbound: 'inbound',
58-
Outbound: 'outbound'
59-
} as const;
60-
61-
export type CallTranscriptionTrackEnum = typeof CallTranscriptionTrackEnum[keyof typeof CallTranscriptionTrackEnum];
6255

6356

models/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ export * from './call-recording-metadata';
77
export * from './call-state';
88
export * from './call-state-enum';
99
export * from './call-transcription';
10+
export * from './call-transcription-detected-language-enum';
1011
export * from './call-transcription-metadata';
1112
export * from './call-transcription-response';
13+
export * from './call-transcription-track-enum';
1214
export * from './callback-method-enum';
1315
export * from './code-request';
1416
export * from './conference';

tests/unit/api/messages-api.test.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
//@ts-nocheck
22
import { MessagesApi } from '../../../api';
33
import { Configuration } from '../../../configuration';
4-
import { ListMessageDirectionEnum, MessageDirectionEnum, MessageRequest, MessageStatusEnum, MessageTypeEnum, PriorityEnum } from '../../../models';
4+
import {
5+
ListMessageDirectionEnum,
6+
MessageDirectionEnum,
7+
MessageRequest,
8+
MessageStatusEnum,
9+
MessageTypeEnum,
10+
PriorityEnum
11+
} from '../../../models';
512

613
describe('MessagesApi', () => {
714
const config = new Configuration({
@@ -11,13 +18,9 @@ describe('MessagesApi', () => {
1118
});
1219
const messagesApi = new MessagesApi(config);
1320

14-
const mmsText = 'nodejs sdk test MMS';
1521
const smsText = 'nodejs sdk test SMS';
16-
const mmsTag = 'nodejs sdk test MMS tag';
1722
const smsTag = 'nodejs sdk test SMS tag';
18-
const mediaUrl = 'https://cdn2.thecatapi.com/images/MTY3ODk4Mg.jpg';
1923
const priority = PriorityEnum.High;
20-
const listMessageDirection = ListMessageDirectionEnum.Outbound;
2124
const expirationTime = Date.now() + 1000 * 60 * 60 * 24 + 60;
2225
const expiration = new Date(expirationTime).toISOString();
2326

tests/unit/api/transcriptions-api.test.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ts-nocheck
2-
import { CallsApi, TranscriptionsApi } from "../../../api";
2+
import { TranscriptionsApi } from "../../../api";
33
import { Configuration } from "../../../configuration";
4-
import { CallStateEnum, CallTranscriptionDetectedLanguageEnum, CallTranscriptionTrackEnum } from "../../../models";
4+
import { CallTranscriptionDetectedLanguageEnum, CallTranscriptionTrackEnum } from "../../../models";
55

66
describe('TranscriptionsApi', () => {
77
const config = new Configuration({
@@ -41,8 +41,11 @@ describe('TranscriptionsApi', () => {
4141
CallTranscriptionDetectedLanguageEnum.EsUs,
4242
CallTranscriptionDetectedLanguageEnum.FrFr
4343
]);
44-
expect(data.tracks![0].track).toBeOneOf([CallTranscriptionTrackEnum.Inbound, CallTranscriptionTrackEnum.Outbound])
45-
expect(data.tracks![0].text).toBeString();
44+
expect(data.tracks![0].track).toBeOneOf([
45+
CallTranscriptionTrackEnum.Inbound,
46+
CallTranscriptionTrackEnum.Outbound
47+
]);
48+
expect(data.tracks![0].transcript).toBeString();
4649
expect(data.tracks![0].confidence).toBeNumber();
4750
});
4851
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { CallTranscriptionDetectedLanguageEnum } from '../../../models/call-transcription-detected-language-enum';
2+
3+
describe('CallTranscriptionTrackEnum', () => {
4+
test('should define the expected values', () => {
5+
expect(CallTranscriptionDetectedLanguageEnum.EnUs).toBe('en-US');
6+
expect(CallTranscriptionDetectedLanguageEnum.EsUs).toBe('es-US');
7+
expect(CallTranscriptionDetectedLanguageEnum.FrFr).toBe('fr-FR');
8+
});
9+
});

0 commit comments

Comments
 (0)