bandwidth-sdk 1.0.1 → 2.0.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.
Files changed (118) hide show
  1. package/.github/workflows/test-nightly.yml +53 -53
  2. package/.github/workflows/test-pr.yml +40 -38
  3. package/.openapi-generator/FILES +6 -2
  4. package/README.md +40 -0
  5. package/api/recordings-api.ts +77 -77
  6. package/api/transcriptions-api.ts +320 -0
  7. package/api.ts +1 -0
  8. package/bandwidth.yml +223 -17
  9. package/base.ts +22 -4
  10. package/coverage/clover.xml +544 -452
  11. package/coverage/coverage-final.json +58 -56
  12. package/coverage/lcov-report/index.html +20 -20
  13. package/coverage/lcov-report/node-sdk/api/calls-api.ts.html +105 -105
  14. package/coverage/lcov-report/node-sdk/api/conferences-api.ts.html +1 -1
  15. package/coverage/lcov-report/node-sdk/api/index.html +24 -9
  16. package/coverage/lcov-report/node-sdk/api/media-api.ts.html +1 -1
  17. package/coverage/lcov-report/node-sdk/api/messages-api.ts.html +1 -1
  18. package/coverage/lcov-report/node-sdk/api/mfaapi.ts.html +1 -1
  19. package/coverage/lcov-report/node-sdk/api/phone-number-lookup-api.ts.html +1 -1
  20. package/coverage/lcov-report/node-sdk/api/recordings-api.ts.html +78 -78
  21. package/coverage/lcov-report/node-sdk/api/statistics-api.ts.html +1 -1
  22. package/coverage/lcov-report/node-sdk/api/transcriptions-api.ts.html +1045 -0
  23. package/coverage/lcov-report/node-sdk/base.ts.html +72 -18
  24. package/coverage/lcov-report/node-sdk/common.ts.html +32 -32
  25. package/coverage/lcov-report/node-sdk/configuration.ts.html +15 -15
  26. package/coverage/lcov-report/node-sdk/index.html +1 -1
  27. package/coverage/lcov-report/node-sdk/models/bxml/Bxml.ts.html +4 -4
  28. package/coverage/lcov-report/node-sdk/models/bxml/NestableVerb.ts.html +6 -6
  29. package/coverage/lcov-report/node-sdk/models/bxml/Response.ts.html +4 -4
  30. package/coverage/lcov-report/node-sdk/models/bxml/Root.ts.html +8 -8
  31. package/coverage/lcov-report/node-sdk/models/bxml/Verb.ts.html +6 -6
  32. package/coverage/lcov-report/node-sdk/models/bxml/index.html +1 -1
  33. package/coverage/lcov-report/node-sdk/models/bxml/index.ts.html +3 -3
  34. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Bridge.ts.html +10 -4
  35. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Conference.ts.html +4 -4
  36. package/coverage/lcov-report/node-sdk/models/bxml/verbs/CustomParam.ts.html +4 -4
  37. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Forward.ts.html +4 -4
  38. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Gather.ts.html +7 -7
  39. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Hangup.ts.html +4 -4
  40. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Pause.ts.html +4 -4
  41. package/coverage/lcov-report/node-sdk/models/bxml/verbs/PauseRecording.ts.html +4 -4
  42. package/coverage/lcov-report/node-sdk/models/bxml/verbs/PhoneNumber.ts.html +4 -4
  43. package/coverage/lcov-report/node-sdk/models/bxml/verbs/PlayAudio.ts.html +4 -4
  44. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Record.ts.html +4 -4
  45. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Redirect.ts.html +4 -4
  46. package/coverage/lcov-report/node-sdk/models/bxml/verbs/ResumeRecording.ts.html +4 -4
  47. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Ring.ts.html +4 -4
  48. package/coverage/lcov-report/node-sdk/models/bxml/verbs/SendDtmf.ts.html +4 -4
  49. package/coverage/lcov-report/node-sdk/models/bxml/verbs/SipUri.ts.html +4 -4
  50. package/coverage/lcov-report/node-sdk/models/bxml/verbs/SpeakSentence.ts.html +6 -6
  51. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartGather.ts.html +4 -4
  52. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartRecording.ts.html +4 -4
  53. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartStream.ts.html +5 -5
  54. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartTranscription.ts.html +5 -5
  55. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopGather.ts.html +4 -4
  56. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopRecording.ts.html +4 -4
  57. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopStream.ts.html +4 -4
  58. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopTranscription.ts.html +4 -4
  59. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StreamParam.ts.html +4 -4
  60. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Tag.ts.html +4 -4
  61. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Transfer.ts.html +5 -5
  62. package/coverage/lcov-report/node-sdk/models/bxml/verbs/index.html +1 -1
  63. package/coverage/lcov-report/node-sdk/models/bxml/verbs/index.ts.html +31 -31
  64. package/coverage/lcov-report/node-sdk/models/call-direction-enum.ts.html +2 -2
  65. package/coverage/lcov-report/node-sdk/models/call-state-enum.ts.html +2 -2
  66. package/coverage/lcov-report/node-sdk/models/call-transcription.ts.html +274 -0
  67. package/coverage/lcov-report/node-sdk/models/callback-method-enum.ts.html +2 -2
  68. package/coverage/lcov-report/node-sdk/models/conference-state-enum.ts.html +2 -2
  69. package/coverage/lcov-report/node-sdk/models/file-format-enum.ts.html +2 -2
  70. package/coverage/lcov-report/node-sdk/models/index.html +20 -5
  71. package/coverage/lcov-report/node-sdk/models/index.ts.html +103 -94
  72. package/coverage/lcov-report/node-sdk/models/list-message-direction-enum.ts.html +2 -2
  73. package/coverage/lcov-report/node-sdk/models/lookup-status-enum.ts.html +2 -2
  74. package/coverage/lcov-report/node-sdk/models/machine-detection-mode-enum.ts.html +2 -2
  75. package/coverage/lcov-report/node-sdk/models/message-direction-enum.ts.html +2 -2
  76. package/coverage/lcov-report/node-sdk/models/message-status-enum.ts.html +2 -2
  77. package/coverage/lcov-report/node-sdk/models/message-type-enum.ts.html +2 -2
  78. package/coverage/lcov-report/node-sdk/models/priority-enum.ts.html +2 -2
  79. package/coverage/lcov-report/node-sdk/models/recording-state-enum.ts.html +2 -2
  80. package/coverage/lcov-report/node-sdk/models/redirect-method-enum.ts.html +2 -2
  81. package/coverage/lcov-report/node-sdk/tests/callUtils.js.html +34 -34
  82. package/coverage/lcov-report/node-sdk/tests/index.html +1 -1
  83. package/coverage/lcov.info +871 -642
  84. package/custom_templates/README.mustache +40 -0
  85. package/dist/api/recordings-api.d.ts +45 -45
  86. package/dist/api/recordings-api.js +75 -75
  87. package/dist/api/transcriptions-api.d.ts +161 -0
  88. package/dist/api/transcriptions-api.js +406 -0
  89. package/dist/api.d.ts +1 -0
  90. package/dist/api.js +1 -0
  91. package/dist/base.js +22 -4
  92. package/dist/models/bxml/verbs/Bridge.d.ts +2 -0
  93. package/dist/models/call-recording-metadata.d.ts +3 -3
  94. package/dist/models/call-transcription-metadata.d.ts +30 -0
  95. package/dist/models/call-transcription-metadata.js +15 -0
  96. package/dist/models/call-transcription-response.d.ts +43 -0
  97. package/dist/models/call-transcription-response.js +15 -0
  98. package/dist/models/call-transcription.d.ts +53 -0
  99. package/dist/models/call-transcription.js +25 -0
  100. package/dist/models/index.d.ts +5 -2
  101. package/dist/models/index.js +5 -2
  102. package/dist/models/recording-available-callback.d.ts +3 -3
  103. package/dist/models/recording-transcription-metadata.d.ts +42 -0
  104. package/dist/models/recording-transcription-metadata.js +15 -0
  105. package/dist/models/recording-transcriptions.d.ts +25 -0
  106. package/dist/models/recording-transcriptions.js +15 -0
  107. package/models/bxml/verbs/Bridge.ts +2 -0
  108. package/models/call-recording-metadata.ts +3 -3
  109. package/models/call-transcription-metadata.ts +36 -0
  110. package/models/call-transcription-response.ts +51 -0
  111. package/models/call-transcription.ts +63 -0
  112. package/models/index.ts +5 -2
  113. package/models/recording-available-callback.ts +3 -3
  114. package/models/recording-transcription-metadata.ts +48 -0
  115. package/models/recording-transcriptions.ts +33 -0
  116. package/package.json +1 -1
  117. package/tests/integration/recordings-api.test.js +6 -6
  118. package/tests/integration/transcriptions-api.test.js +85 -0
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Bandwidth
6
+ * Bandwidth\'s Communication APIs
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: letstalk@bandwidth.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.CallTranscriptionTrackEnum = exports.CallTranscriptionDetectedLanguageEnum = void 0;
17
+ exports.CallTranscriptionDetectedLanguageEnum = {
18
+ EnUs: 'en-US',
19
+ EsUs: 'es-US',
20
+ FrFr: 'fr-FR'
21
+ };
22
+ exports.CallTranscriptionTrackEnum = {
23
+ Inbound: 'inbound',
24
+ Outbound: 'outbound'
25
+ };
@@ -6,6 +6,9 @@ export * from './call-direction-enum';
6
6
  export * from './call-recording-metadata';
7
7
  export * from './call-state';
8
8
  export * from './call-state-enum';
9
+ export * from './call-transcription';
10
+ export * from './call-transcription-metadata';
11
+ export * from './call-transcription-response';
9
12
  export * from './callback-method-enum';
10
13
  export * from './code-request';
11
14
  export * from './conference';
@@ -65,6 +68,8 @@ export * from './priority-enum';
65
68
  export * from './recording-available-callback';
66
69
  export * from './recording-complete-callback';
67
70
  export * from './recording-state-enum';
71
+ export * from './recording-transcription-metadata';
72
+ export * from './recording-transcriptions';
68
73
  export * from './redirect-callback';
69
74
  export * from './redirect-method-enum';
70
75
  export * from './stir-shaken';
@@ -73,8 +78,6 @@ export * from './tn-lookup-request-error';
73
78
  export * from './transcribe-recording';
74
79
  export * from './transcription';
75
80
  export * from './transcription-available-callback';
76
- export * from './transcription-list';
77
- export * from './transcription-metadata';
78
81
  export * from './transfer-answer-callback';
79
82
  export * from './transfer-complete-callback';
80
83
  export * from './transfer-disconnect-callback';
@@ -22,6 +22,9 @@ __exportStar(require("./call-direction-enum"), exports);
22
22
  __exportStar(require("./call-recording-metadata"), exports);
23
23
  __exportStar(require("./call-state"), exports);
24
24
  __exportStar(require("./call-state-enum"), exports);
25
+ __exportStar(require("./call-transcription"), exports);
26
+ __exportStar(require("./call-transcription-metadata"), exports);
27
+ __exportStar(require("./call-transcription-response"), exports);
25
28
  __exportStar(require("./callback-method-enum"), exports);
26
29
  __exportStar(require("./code-request"), exports);
27
30
  __exportStar(require("./conference"), exports);
@@ -81,6 +84,8 @@ __exportStar(require("./priority-enum"), exports);
81
84
  __exportStar(require("./recording-available-callback"), exports);
82
85
  __exportStar(require("./recording-complete-callback"), exports);
83
86
  __exportStar(require("./recording-state-enum"), exports);
87
+ __exportStar(require("./recording-transcription-metadata"), exports);
88
+ __exportStar(require("./recording-transcriptions"), exports);
84
89
  __exportStar(require("./redirect-callback"), exports);
85
90
  __exportStar(require("./redirect-method-enum"), exports);
86
91
  __exportStar(require("./stir-shaken"), exports);
@@ -89,8 +94,6 @@ __exportStar(require("./tn-lookup-request-error"), exports);
89
94
  __exportStar(require("./transcribe-recording"), exports);
90
95
  __exportStar(require("./transcription"), exports);
91
96
  __exportStar(require("./transcription-available-callback"), exports);
92
- __exportStar(require("./transcription-list"), exports);
93
- __exportStar(require("./transcription-metadata"), exports);
94
97
  __exportStar(require("./transfer-answer-callback"), exports);
95
98
  __exportStar(require("./transfer-complete-callback"), exports);
96
99
  __exportStar(require("./transfer-disconnect-callback"), exports);
@@ -120,11 +120,11 @@ export interface RecordingAvailableCallback {
120
120
  */
121
121
  'fileFormat'?: FileFormatEnum;
122
122
  /**
123
- * The current status of the process. For recording, current possible values are \'processing\', \'partial\', \'complete\', \'deleted\', and \'error\'. For transcriptions, current possible values are \'none\', \'processing\', \'available\', \'error\', \'timeout\', \'file-size-too-big\', and \'file-size-too-small\'. Additional states may be added in the future, so your application must be tolerant of unknown values.
124
- * @type {string}
123
+ * Always `1` for conference recordings; multi-channel recordings are not supported on conferences.
124
+ * @type {number}
125
125
  * @memberof RecordingAvailableCallback
126
126
  */
127
- 'channels'?: string;
127
+ 'channels'?: number;
128
128
  /**
129
129
  * (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
130
130
  * @type {string}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Bandwidth
3
+ * Bandwidth\'s Communication APIs
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: letstalk@bandwidth.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * If the recording was transcribed, metadata about the transcription
14
+ * @export
15
+ * @interface RecordingTranscriptionMetadata
16
+ */
17
+ export interface RecordingTranscriptionMetadata {
18
+ /**
19
+ * The unique transcription ID
20
+ * @type {string}
21
+ * @memberof RecordingTranscriptionMetadata
22
+ */
23
+ 'id'?: string;
24
+ /**
25
+ * The current status of the process. For recording, current possible values are \'processing\', \'partial\', \'complete\', \'deleted\', and \'error\'. For transcriptions, current possible values are \'none\', \'processing\', \'available\', \'error\', \'timeout\', \'file-size-too-big\', and \'file-size-too-small\'. Additional states may be added in the future, so your application must be tolerant of unknown values.
26
+ * @type {string}
27
+ * @memberof RecordingTranscriptionMetadata
28
+ */
29
+ 'status'?: string;
30
+ /**
31
+ * The time that the transcription was completed
32
+ * @type {string}
33
+ * @memberof RecordingTranscriptionMetadata
34
+ */
35
+ 'completedTime'?: string;
36
+ /**
37
+ * The URL of the [transcription](#operation/getCallTranscription)
38
+ * @type {string}
39
+ * @memberof RecordingTranscriptionMetadata
40
+ */
41
+ 'url'?: string;
42
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Bandwidth
6
+ * Bandwidth\'s Communication APIs
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: letstalk@bandwidth.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Bandwidth
3
+ * Bandwidth\'s Communication APIs
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: letstalk@bandwidth.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import { Transcription } from './transcription';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface RecordingTranscriptions
17
+ */
18
+ export interface RecordingTranscriptions {
19
+ /**
20
+ *
21
+ * @type {Array<Transcription>}
22
+ * @memberof RecordingTranscriptions
23
+ */
24
+ 'transcripts'?: Array<Transcription>;
25
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Bandwidth
6
+ * Bandwidth\'s Communication APIs
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: letstalk@bandwidth.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,8 @@
1
1
  import { Verb } from '../Verb';
2
2
 
3
3
  interface BridgeAttributes {
4
+ bridgeCompleteUrl?: string;
5
+ bridgeCompleteMethod?: string;
4
6
  bridgeCompleteFallbackUrl?: string;
5
7
  bridgeCompleteFallbackMethod?: string;
6
8
  bridgeTargetCompleteUrl?: string;
@@ -21,7 +21,7 @@ import { CallDirectionEnum } from './call-direction-enum';
21
21
  import { FileFormatEnum } from './file-format-enum';
22
22
  // May contain unused imports in some cases
23
23
  // @ts-ignore
24
- import { TranscriptionMetadata } from './transcription-metadata';
24
+ import { RecordingTranscriptionMetadata } from './recording-transcription-metadata';
25
25
 
26
26
  /**
27
27
  *
@@ -133,10 +133,10 @@ export interface CallRecordingMetadata {
133
133
  'mediaUrl'?: string | null;
134
134
  /**
135
135
  *
136
- * @type {TranscriptionMetadata}
136
+ * @type {RecordingTranscriptionMetadata}
137
137
  * @memberof CallRecordingMetadata
138
138
  */
139
- 'transcription'?: TranscriptionMetadata | null;
139
+ 'transcription'?: RecordingTranscriptionMetadata | null;
140
140
  }
141
141
 
142
142
 
@@ -0,0 +1,36 @@
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
+ /**
18
+ *
19
+ * @export
20
+ * @interface CallTranscriptionMetadata
21
+ */
22
+ export interface CallTranscriptionMetadata {
23
+ /**
24
+ * The programmable voice API transcription ID.
25
+ * @type {string}
26
+ * @memberof CallTranscriptionMetadata
27
+ */
28
+ 'transcriptionId'?: string;
29
+ /**
30
+ * A URL that may be used to retrieve the transcription itself. This points to the [Get Call Transcription](/apis/voice/#operation/getCallTranscription) endpoint.
31
+ * @type {string}
32
+ * @memberof CallTranscriptionMetadata
33
+ */
34
+ 'transcriptionUrl'?: string;
35
+ }
36
+
@@ -0,0 +1,51 @@
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 { CallTranscription } from './call-transcription';
19
+
20
+ /**
21
+ *
22
+ * @export
23
+ * @interface CallTranscriptionResponse
24
+ */
25
+ export interface CallTranscriptionResponse {
26
+ /**
27
+ * The user account associated with the call.
28
+ * @type {string}
29
+ * @memberof CallTranscriptionResponse
30
+ */
31
+ 'accountId'?: string;
32
+ /**
33
+ * The call id associated with the event.
34
+ * @type {string}
35
+ * @memberof CallTranscriptionResponse
36
+ */
37
+ 'callId'?: string;
38
+ /**
39
+ * The programmable voice API transcription ID.
40
+ * @type {string}
41
+ * @memberof CallTranscriptionResponse
42
+ */
43
+ 'transcriptionId'?: string;
44
+ /**
45
+ *
46
+ * @type {Array<CallTranscription>}
47
+ * @memberof CallTranscriptionResponse
48
+ */
49
+ 'tracks'?: Array<CallTranscription>;
50
+ }
51
+
@@ -0,0 +1,63 @@
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
+ /**
18
+ *
19
+ * @export
20
+ * @interface CallTranscription
21
+ */
22
+ export interface CallTranscription {
23
+ /**
24
+ * The detected language for this transcription.
25
+ * @type {string}
26
+ * @memberof CallTranscription
27
+ */
28
+ 'detectedLanguage'?: CallTranscriptionDetectedLanguageEnum;
29
+ /**
30
+ * Which `track` this transcription is derived from.
31
+ * @type {string}
32
+ * @memberof CallTranscription
33
+ */
34
+ 'track'?: CallTranscriptionTrackEnum;
35
+ /**
36
+ * The transcription itself.
37
+ * @type {string}
38
+ * @memberof CallTranscription
39
+ */
40
+ 'text'?: string;
41
+ /**
42
+ * How confident the transcription engine was in transcribing the associated audio (from `0` to `1`).
43
+ * @type {number}
44
+ * @memberof CallTranscription
45
+ */
46
+ 'confidence'?: number;
47
+ }
48
+
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];
62
+
63
+
package/models/index.ts CHANGED
@@ -6,6 +6,9 @@ export * from './call-direction-enum';
6
6
  export * from './call-recording-metadata';
7
7
  export * from './call-state';
8
8
  export * from './call-state-enum';
9
+ export * from './call-transcription';
10
+ export * from './call-transcription-metadata';
11
+ export * from './call-transcription-response';
9
12
  export * from './callback-method-enum';
10
13
  export * from './code-request';
11
14
  export * from './conference';
@@ -65,6 +68,8 @@ export * from './priority-enum';
65
68
  export * from './recording-available-callback';
66
69
  export * from './recording-complete-callback';
67
70
  export * from './recording-state-enum';
71
+ export * from './recording-transcription-metadata';
72
+ export * from './recording-transcriptions';
68
73
  export * from './redirect-callback';
69
74
  export * from './redirect-method-enum';
70
75
  export * from './stir-shaken';
@@ -73,8 +78,6 @@ export * from './tn-lookup-request-error';
73
78
  export * from './transcribe-recording';
74
79
  export * from './transcription';
75
80
  export * from './transcription-available-callback';
76
- export * from './transcription-list';
77
- export * from './transcription-metadata';
78
81
  export * from './transfer-answer-callback';
79
82
  export * from './transfer-complete-callback';
80
83
  export * from './transfer-disconnect-callback';
@@ -129,11 +129,11 @@ export interface RecordingAvailableCallback {
129
129
  */
130
130
  'fileFormat'?: FileFormatEnum;
131
131
  /**
132
- * The current status of the process. For recording, current possible values are \'processing\', \'partial\', \'complete\', \'deleted\', and \'error\'. For transcriptions, current possible values are \'none\', \'processing\', \'available\', \'error\', \'timeout\', \'file-size-too-big\', and \'file-size-too-small\'. Additional states may be added in the future, so your application must be tolerant of unknown values.
133
- * @type {string}
132
+ * Always `1` for conference recordings; multi-channel recordings are not supported on conferences.
133
+ * @type {number}
134
134
  * @memberof RecordingAvailableCallback
135
135
  */
136
- 'channels'?: string;
136
+ 'channels'?: number;
137
137
  /**
138
138
  * (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
139
139
  * @type {string}
@@ -0,0 +1,48 @@
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
+ /**
18
+ * If the recording was transcribed, metadata about the transcription
19
+ * @export
20
+ * @interface RecordingTranscriptionMetadata
21
+ */
22
+ export interface RecordingTranscriptionMetadata {
23
+ /**
24
+ * The unique transcription ID
25
+ * @type {string}
26
+ * @memberof RecordingTranscriptionMetadata
27
+ */
28
+ 'id'?: string;
29
+ /**
30
+ * The current status of the process. For recording, current possible values are \'processing\', \'partial\', \'complete\', \'deleted\', and \'error\'. For transcriptions, current possible values are \'none\', \'processing\', \'available\', \'error\', \'timeout\', \'file-size-too-big\', and \'file-size-too-small\'. Additional states may be added in the future, so your application must be tolerant of unknown values.
31
+ * @type {string}
32
+ * @memberof RecordingTranscriptionMetadata
33
+ */
34
+ 'status'?: string;
35
+ /**
36
+ * The time that the transcription was completed
37
+ * @type {string}
38
+ * @memberof RecordingTranscriptionMetadata
39
+ */
40
+ 'completedTime'?: string;
41
+ /**
42
+ * The URL of the [transcription](#operation/getCallTranscription)
43
+ * @type {string}
44
+ * @memberof RecordingTranscriptionMetadata
45
+ */
46
+ 'url'?: string;
47
+ }
48
+
@@ -0,0 +1,33 @@
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 { Transcription } from './transcription';
19
+
20
+ /**
21
+ *
22
+ * @export
23
+ * @interface RecordingTranscriptions
24
+ */
25
+ export interface RecordingTranscriptions {
26
+ /**
27
+ *
28
+ * @type {Array<Transcription>}
29
+ * @memberof RecordingTranscriptions
30
+ */
31
+ 'transcripts'?: Array<Transcription>;
32
+ }
33
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bandwidth-sdk",
3
- "version": "1.0.1",
3
+ "version": "2.0.0",
4
4
  "description": "OpenAPI client for bandwidth-sdk",
5
5
  "author": "OpenAPI-Generator Contributors",
6
6
  "repository": {
@@ -137,9 +137,9 @@ describe('RecordingsApi', () => {
137
137
  });
138
138
  });
139
139
 
140
- describe('getCallTranscription', () => {
141
- test('should get call transcription', async () => {
142
- const { status, data } = await recordingsApi.getCallTranscription(BW_ACCOUNT_ID, mantecaCallId, recordingId);
140
+ describe('getRecordingTranscription', () => {
141
+ test('should get recording transcription', async () => {
142
+ const { status, data } = await recordingsApi.getRecordingTranscription(BW_ACCOUNT_ID, mantecaCallId, recordingId);
143
143
 
144
144
  expect(status).toEqual(200);
145
145
  expect(data.transcripts).toBeInstanceOf(Array);
@@ -148,9 +148,9 @@ describe('RecordingsApi', () => {
148
148
  });
149
149
  });
150
150
 
151
- describe('deleteCallTranscription', () => {
152
- test('should delete call transcription', async () => {
153
- const { status } = await recordingsApi.deleteCallTranscription(BW_ACCOUNT_ID, mantecaCallId, recordingId);
151
+ describe('deleteRecordingTranscription', () => {
152
+ test('should delete recording transcription', async () => {
153
+ const { status } = await recordingsApi.deleteRecordingTranscription(BW_ACCOUNT_ID, mantecaCallId, recordingId);
154
154
 
155
155
  expect(status).toEqual(204);
156
156
  });
@@ -0,0 +1,85 @@
1
+ const { CallsApi } = require('../../api/calls-api');
2
+ const { TranscriptionsApi } = require('../../api/transcriptions-api');
3
+ const { Configuration } = require('../../configuration');
4
+ const { RecordingStateEnum, CallStateEnum } = require('../../models');
5
+ const { setupManteca, createMantecaCall, cleanupCalls, getMantecaTestStatus, sleep } = require('../callUtils');
6
+
7
+ describe('TranscriptionsApi', () => {
8
+ jest.setTimeout(240000);
9
+ const config = new Configuration({username: BW_USERNAME, password: BW_PASSWORD});
10
+ const callsApi = new CallsApi(config);
11
+ const transcriptionsApi = new TranscriptionsApi(config);
12
+
13
+ let transcriptionId, mantecaTestId, mantecaCallId;
14
+ let activeCalls = [];
15
+
16
+ beforeAll(async () => {
17
+ mantecaTestId = await setupManteca('CALL');
18
+ mantecaCallId = await createMantecaCall(callsApi, mantecaTestId, '/bxml/idle');
19
+ activeCalls.push(mantecaCallId);
20
+ });
21
+
22
+ afterAll(async () => {
23
+ await cleanupCalls(activeCalls, callsApi);
24
+ });
25
+
26
+ describe('createCallTranscription', () => {
27
+ test('should create call transcription', async () => {
28
+ await sleep(SLEEP_TIME_S);
29
+
30
+ const startTranscriptionBxml =
31
+ `<?xml version="1.0" encoding="UTF-8"?><Response><StartTranscription name="${mantecaCallId}" tracks="inbound"></StartTranscription><Pause duration="6"/></Response>`;
32
+ const { status: startStatus } =
33
+ await callsApi.updateCallBxml(BW_ACCOUNT_ID, mantecaCallId, startTranscriptionBxml);
34
+ expect(startStatus).toEqual(204);
35
+ await sleep(SLEEP_TIME_S);
36
+
37
+ const stopTranscriptionBxml =
38
+ `<?xml version="1.0" encoding="UTF-8"?><Response><StopTranscription name="${mantecaCallId}"></StopTranscription></Response>`;
39
+ const { status: stopStatus } =
40
+ await callsApi.updateCallBxml(BW_ACCOUNT_ID, mantecaCallId, stopTranscriptionBxml);
41
+ expect(stopStatus).toEqual(204);
42
+ await sleep(SLEEP_TIME_S);
43
+
44
+ const { status: completeStatus } =
45
+ await callsApi.updateCall(BW_ACCOUNT_ID, mantecaCallId, { state: CallStateEnum.Completed });
46
+ expect(completeStatus).toEqual(200);
47
+ });
48
+ });
49
+
50
+ describe('listCallTranscriptions', () => {
51
+ test('should list call transcriptions', async () => {
52
+ await sleep(SLEEP_TIME_S * 20);
53
+
54
+ const { status, data } =
55
+ await transcriptionsApi.listRealTimeTranscriptions(BW_ACCOUNT_ID, mantecaCallId);
56
+ expect(status).toEqual(200);
57
+ expect(data).toBeInstanceOf(Array);
58
+ expect(typeof data[0].transcriptionId).toBe('string');
59
+ expect(typeof data[0].transcriptionUrl).toBe('string');
60
+ transcriptionId = data[0].transcriptionId;
61
+ });
62
+ });
63
+
64
+ describe('getCallTranscription', () => {
65
+ test('should get call transcription', async () => {
66
+ const { status, data } =
67
+ await transcriptionsApi.getRealTimeTranscription(BW_ACCOUNT_ID, mantecaCallId, transcriptionId);
68
+ expect(status).toEqual(200);
69
+ expect(data.accountId).toEqual(BW_ACCOUNT_ID);
70
+ expect(data.callId).toEqual(mantecaCallId);
71
+ expect(data.transcriptionId).toEqual(transcriptionId);
72
+ expect(data.tracks).toBeInstanceOf(Array);
73
+ expect(data.tracks[0].track).toEqual('inbound');
74
+ expect(typeof data.tracks[0].confidence).toBe('number');
75
+ });
76
+ });
77
+
78
+ describe('deleteCallTranscription', () => {
79
+ test('should delete call transcription', async () => {
80
+ const { status } =
81
+ await transcriptionsApi.deleteRealTimeTranscription(BW_ACCOUNT_ID, mantecaCallId, transcriptionId);
82
+ expect(status).toEqual(200); // This is a bug in the API, it should return 204. VAPI-1863 should fix this.
83
+ });
84
+ });
85
+ });