bandwidth-sdk 1.0.2 → 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 (116) 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 +543 -451
  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 +4 -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 +866 -637
  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/call-recording-metadata.d.ts +3 -3
  93. package/dist/models/call-transcription-metadata.d.ts +30 -0
  94. package/dist/models/call-transcription-metadata.js +15 -0
  95. package/dist/models/call-transcription-response.d.ts +43 -0
  96. package/dist/models/call-transcription-response.js +15 -0
  97. package/dist/models/call-transcription.d.ts +53 -0
  98. package/dist/models/call-transcription.js +25 -0
  99. package/dist/models/index.d.ts +5 -2
  100. package/dist/models/index.js +5 -2
  101. package/dist/models/recording-available-callback.d.ts +3 -3
  102. package/dist/models/recording-transcription-metadata.d.ts +42 -0
  103. package/dist/models/recording-transcription-metadata.js +15 -0
  104. package/dist/models/recording-transcriptions.d.ts +25 -0
  105. package/dist/models/recording-transcriptions.js +15 -0
  106. package/models/call-recording-metadata.ts +3 -3
  107. package/models/call-transcription-metadata.ts +36 -0
  108. package/models/call-transcription-response.ts +51 -0
  109. package/models/call-transcription.ts +63 -0
  110. package/models/index.ts +5 -2
  111. package/models/recording-available-callback.ts +3 -3
  112. package/models/recording-transcription-metadata.ts +48 -0
  113. package/models/recording-transcriptions.ts +33 -0
  114. package/package.json +1 -1
  115. package/tests/integration/recordings-api.test.js +6 -6
  116. package/tests/integration/transcriptions-api.test.js +85 -0
@@ -0,0 +1,320 @@
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
+ import type { Configuration } from '../configuration';
17
+ import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
18
+ import globalAxios from 'axios';
19
+ // Some imports not used depending on template conditions
20
+ // @ts-ignore
21
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
22
+ // @ts-ignore
23
+ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
24
+ // @ts-ignore
25
+ import { CallTranscriptionMetadata } from '../models';
26
+ // @ts-ignore
27
+ import { CallTranscriptionResponse } from '../models';
28
+ // @ts-ignore
29
+ import { VoiceApiError } from '../models';
30
+ /**
31
+ * TranscriptionsApi - axios parameter creator
32
+ * @export
33
+ */
34
+ export const TranscriptionsApiAxiosParamCreator = function (configuration?: Configuration) {
35
+ return {
36
+ /**
37
+ * Delete the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours.
38
+ * @summary Delete a specific transcription
39
+ * @param {string} accountId Your Bandwidth Account ID.
40
+ * @param {string} callId Programmable Voice API Call ID.
41
+ * @param {string} transcriptionId Programmable Voice API Transcription ID.
42
+ * @param {*} [options] Override http request option.
43
+ * @throws {RequiredError}
44
+ */
45
+ deleteRealTimeTranscription: async (accountId: string, callId: string, transcriptionId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
46
+ // verify required parameter 'accountId' is not null or undefined
47
+ assertParamExists('deleteRealTimeTranscription', 'accountId', accountId)
48
+ // verify required parameter 'callId' is not null or undefined
49
+ assertParamExists('deleteRealTimeTranscription', 'callId', callId)
50
+ // verify required parameter 'transcriptionId' is not null or undefined
51
+ assertParamExists('deleteRealTimeTranscription', 'transcriptionId', transcriptionId)
52
+ const localVarPath = `/accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId}`
53
+ .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId)))
54
+ .replace(`{${"callId"}}`, encodeURIComponent(String(callId)))
55
+ .replace(`{${"transcriptionId"}}`, encodeURIComponent(String(transcriptionId)));
56
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
57
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
58
+ let baseOptions;
59
+ if (configuration) {
60
+ baseOptions = configuration.baseOptions;
61
+ }
62
+
63
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
64
+ const localVarHeaderParameter = {} as any;
65
+ const localVarQueryParameter = {} as any;
66
+
67
+ // authentication Basic required
68
+ // http basic authentication required
69
+ setBasicAuthToObject(localVarRequestOptions, configuration)
70
+
71
+
72
+
73
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
74
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
75
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
76
+
77
+ return {
78
+ url: toPathString(localVarUrlObj),
79
+ options: localVarRequestOptions,
80
+ };
81
+ },
82
+ /**
83
+ * Retrieve the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription).
84
+ * @summary Retrieve a specific transcription
85
+ * @param {string} accountId Your Bandwidth Account ID.
86
+ * @param {string} callId Programmable Voice API Call ID.
87
+ * @param {string} transcriptionId Programmable Voice API Transcription ID.
88
+ * @param {*} [options] Override http request option.
89
+ * @throws {RequiredError}
90
+ */
91
+ getRealTimeTranscription: async (accountId: string, callId: string, transcriptionId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
92
+ // verify required parameter 'accountId' is not null or undefined
93
+ assertParamExists('getRealTimeTranscription', 'accountId', accountId)
94
+ // verify required parameter 'callId' is not null or undefined
95
+ assertParamExists('getRealTimeTranscription', 'callId', callId)
96
+ // verify required parameter 'transcriptionId' is not null or undefined
97
+ assertParamExists('getRealTimeTranscription', 'transcriptionId', transcriptionId)
98
+ const localVarPath = `/accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId}`
99
+ .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId)))
100
+ .replace(`{${"callId"}}`, encodeURIComponent(String(callId)))
101
+ .replace(`{${"transcriptionId"}}`, encodeURIComponent(String(transcriptionId)));
102
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
103
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
104
+ let baseOptions;
105
+ if (configuration) {
106
+ baseOptions = configuration.baseOptions;
107
+ }
108
+
109
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
110
+ const localVarHeaderParameter = {} as any;
111
+ const localVarQueryParameter = {} as any;
112
+
113
+ // authentication Basic required
114
+ // http basic authentication required
115
+ setBasicAuthToObject(localVarRequestOptions, configuration)
116
+
117
+
118
+
119
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
120
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
121
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
122
+
123
+ return {
124
+ url: toPathString(localVarUrlObj),
125
+ options: localVarRequestOptions,
126
+ };
127
+ },
128
+ /**
129
+ * Enumerates the transcriptions created on this call via [startTranscription](/docs/voice/bxml/startTranscription).
130
+ * @summary Enumerate transcriptions made with StartTranscription
131
+ * @param {string} accountId Your Bandwidth Account ID.
132
+ * @param {string} callId Programmable Voice API Call ID.
133
+ * @param {*} [options] Override http request option.
134
+ * @throws {RequiredError}
135
+ */
136
+ listRealTimeTranscriptions: async (accountId: string, callId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
137
+ // verify required parameter 'accountId' is not null or undefined
138
+ assertParamExists('listRealTimeTranscriptions', 'accountId', accountId)
139
+ // verify required parameter 'callId' is not null or undefined
140
+ assertParamExists('listRealTimeTranscriptions', 'callId', callId)
141
+ const localVarPath = `/accounts/{accountId}/calls/{callId}/transcriptions`
142
+ .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId)))
143
+ .replace(`{${"callId"}}`, encodeURIComponent(String(callId)));
144
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
145
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
146
+ let baseOptions;
147
+ if (configuration) {
148
+ baseOptions = configuration.baseOptions;
149
+ }
150
+
151
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
152
+ const localVarHeaderParameter = {} as any;
153
+ const localVarQueryParameter = {} as any;
154
+
155
+ // authentication Basic required
156
+ // http basic authentication required
157
+ setBasicAuthToObject(localVarRequestOptions, configuration)
158
+
159
+
160
+
161
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
162
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
163
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
164
+
165
+ return {
166
+ url: toPathString(localVarUrlObj),
167
+ options: localVarRequestOptions,
168
+ };
169
+ },
170
+ }
171
+ };
172
+
173
+ /**
174
+ * TranscriptionsApi - functional programming interface
175
+ * @export
176
+ */
177
+ export const TranscriptionsApiFp = function(configuration?: Configuration) {
178
+ const localVarAxiosParamCreator = TranscriptionsApiAxiosParamCreator(configuration)
179
+ return {
180
+ /**
181
+ * Delete the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours.
182
+ * @summary Delete a specific transcription
183
+ * @param {string} accountId Your Bandwidth Account ID.
184
+ * @param {string} callId Programmable Voice API Call ID.
185
+ * @param {string} transcriptionId Programmable Voice API Transcription ID.
186
+ * @param {*} [options] Override http request option.
187
+ * @throws {RequiredError}
188
+ */
189
+ async deleteRealTimeTranscription(accountId: string, callId: string, transcriptionId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
190
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRealTimeTranscription(accountId, callId, transcriptionId, options);
191
+ const index = configuration?.serverIndex ?? 0;
192
+ const operationBasePath = operationServerMap['TranscriptionsApi.deleteRealTimeTranscription']?.[index]?.url;
193
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
194
+ },
195
+ /**
196
+ * Retrieve the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription).
197
+ * @summary Retrieve a specific transcription
198
+ * @param {string} accountId Your Bandwidth Account ID.
199
+ * @param {string} callId Programmable Voice API Call ID.
200
+ * @param {string} transcriptionId Programmable Voice API Transcription ID.
201
+ * @param {*} [options] Override http request option.
202
+ * @throws {RequiredError}
203
+ */
204
+ async getRealTimeTranscription(accountId: string, callId: string, transcriptionId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CallTranscriptionResponse>> {
205
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getRealTimeTranscription(accountId, callId, transcriptionId, options);
206
+ const index = configuration?.serverIndex ?? 0;
207
+ const operationBasePath = operationServerMap['TranscriptionsApi.getRealTimeTranscription']?.[index]?.url;
208
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
209
+ },
210
+ /**
211
+ * Enumerates the transcriptions created on this call via [startTranscription](/docs/voice/bxml/startTranscription).
212
+ * @summary Enumerate transcriptions made with StartTranscription
213
+ * @param {string} accountId Your Bandwidth Account ID.
214
+ * @param {string} callId Programmable Voice API Call ID.
215
+ * @param {*} [options] Override http request option.
216
+ * @throws {RequiredError}
217
+ */
218
+ async listRealTimeTranscriptions(accountId: string, callId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<CallTranscriptionMetadata>>> {
219
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listRealTimeTranscriptions(accountId, callId, options);
220
+ const index = configuration?.serverIndex ?? 0;
221
+ const operationBasePath = operationServerMap['TranscriptionsApi.listRealTimeTranscriptions']?.[index]?.url;
222
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
223
+ },
224
+ }
225
+ };
226
+
227
+ /**
228
+ * TranscriptionsApi - factory interface
229
+ * @export
230
+ */
231
+ export const TranscriptionsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
232
+ const localVarFp = TranscriptionsApiFp(configuration)
233
+ return {
234
+ /**
235
+ * Delete the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours.
236
+ * @summary Delete a specific transcription
237
+ * @param {string} accountId Your Bandwidth Account ID.
238
+ * @param {string} callId Programmable Voice API Call ID.
239
+ * @param {string} transcriptionId Programmable Voice API Transcription ID.
240
+ * @param {*} [options] Override http request option.
241
+ * @throws {RequiredError}
242
+ */
243
+ deleteRealTimeTranscription(accountId: string, callId: string, transcriptionId: string, options?: any): AxiosPromise<void> {
244
+ return localVarFp.deleteRealTimeTranscription(accountId, callId, transcriptionId, options).then((request) => request(axios, basePath));
245
+ },
246
+ /**
247
+ * Retrieve the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription).
248
+ * @summary Retrieve a specific transcription
249
+ * @param {string} accountId Your Bandwidth Account ID.
250
+ * @param {string} callId Programmable Voice API Call ID.
251
+ * @param {string} transcriptionId Programmable Voice API Transcription ID.
252
+ * @param {*} [options] Override http request option.
253
+ * @throws {RequiredError}
254
+ */
255
+ getRealTimeTranscription(accountId: string, callId: string, transcriptionId: string, options?: any): AxiosPromise<CallTranscriptionResponse> {
256
+ return localVarFp.getRealTimeTranscription(accountId, callId, transcriptionId, options).then((request) => request(axios, basePath));
257
+ },
258
+ /**
259
+ * Enumerates the transcriptions created on this call via [startTranscription](/docs/voice/bxml/startTranscription).
260
+ * @summary Enumerate transcriptions made with StartTranscription
261
+ * @param {string} accountId Your Bandwidth Account ID.
262
+ * @param {string} callId Programmable Voice API Call ID.
263
+ * @param {*} [options] Override http request option.
264
+ * @throws {RequiredError}
265
+ */
266
+ listRealTimeTranscriptions(accountId: string, callId: string, options?: any): AxiosPromise<Array<CallTranscriptionMetadata>> {
267
+ return localVarFp.listRealTimeTranscriptions(accountId, callId, options).then((request) => request(axios, basePath));
268
+ },
269
+ };
270
+ };
271
+
272
+ /**
273
+ * TranscriptionsApi - object-oriented interface
274
+ * @export
275
+ * @class TranscriptionsApi
276
+ * @extends {BaseAPI}
277
+ */
278
+ export class TranscriptionsApi extends BaseAPI {
279
+ /**
280
+ * Delete the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours.
281
+ * @summary Delete a specific transcription
282
+ * @param {string} accountId Your Bandwidth Account ID.
283
+ * @param {string} callId Programmable Voice API Call ID.
284
+ * @param {string} transcriptionId Programmable Voice API Transcription ID.
285
+ * @param {*} [options] Override http request option.
286
+ * @throws {RequiredError}
287
+ * @memberof TranscriptionsApi
288
+ */
289
+ public deleteRealTimeTranscription(accountId: string, callId: string, transcriptionId: string, options?: AxiosRequestConfig) {
290
+ return TranscriptionsApiFp(this.configuration).deleteRealTimeTranscription(accountId, callId, transcriptionId, options).then((request) => request(this.axios, this.basePath));
291
+ }
292
+
293
+ /**
294
+ * Retrieve the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription).
295
+ * @summary Retrieve a specific transcription
296
+ * @param {string} accountId Your Bandwidth Account ID.
297
+ * @param {string} callId Programmable Voice API Call ID.
298
+ * @param {string} transcriptionId Programmable Voice API Transcription ID.
299
+ * @param {*} [options] Override http request option.
300
+ * @throws {RequiredError}
301
+ * @memberof TranscriptionsApi
302
+ */
303
+ public getRealTimeTranscription(accountId: string, callId: string, transcriptionId: string, options?: AxiosRequestConfig) {
304
+ return TranscriptionsApiFp(this.configuration).getRealTimeTranscription(accountId, callId, transcriptionId, options).then((request) => request(this.axios, this.basePath));
305
+ }
306
+
307
+ /**
308
+ * Enumerates the transcriptions created on this call via [startTranscription](/docs/voice/bxml/startTranscription).
309
+ * @summary Enumerate transcriptions made with StartTranscription
310
+ * @param {string} accountId Your Bandwidth Account ID.
311
+ * @param {string} callId Programmable Voice API Call ID.
312
+ * @param {*} [options] Override http request option.
313
+ * @throws {RequiredError}
314
+ * @memberof TranscriptionsApi
315
+ */
316
+ public listRealTimeTranscriptions(accountId: string, callId: string, options?: AxiosRequestConfig) {
317
+ return TranscriptionsApiFp(this.configuration).listRealTimeTranscriptions(accountId, callId, options).then((request) => request(this.axios, this.basePath));
318
+ }
319
+ }
320
+
package/api.ts CHANGED
@@ -22,4 +22,5 @@ export * from './api/messages-api';
22
22
  export * from './api/phone-number-lookup-api';
23
23
  export * from './api/recordings-api';
24
24
  export * from './api/statistics-api';
25
+ export * from './api/transcriptions-api';
25
26
 
package/bandwidth.yml CHANGED
@@ -16,6 +16,7 @@ tags:
16
16
  - name: Conferences
17
17
  - name: Recordings
18
18
  - name: Statistics
19
+ - name: Transcriptions
19
20
  - name: MFA
20
21
  - name: Phone Number Lookup
21
22
  paths:
@@ -962,9 +963,7 @@ paths:
962
963
  description: >-
963
964
  Downloads the specified transcription.
964
965
 
965
-
966
- If the transcribed recording was multi-channel, then there will be 2
967
- transcripts.
966
+ If the recording was multi-channel, then there will be 2 transcripts.
968
967
 
969
968
  The caller/called party transcript will be the first item while
970
969
  [`<PlayAudio>`](/docs/voice/bxml/playAudio) and
@@ -974,14 +973,14 @@ paths:
974
973
  During a [`<Transfer>`](/docs/voice/bxml/transfer) the A-leg transcript
975
974
  will be the first item while the B-leg transcript will be the second
976
975
  item.
977
- operationId: getCallTranscription
976
+ operationId: getRecordingTranscription
978
977
  parameters:
979
978
  - $ref: '#/components/parameters/accountId'
980
979
  - $ref: '#/components/parameters/callId'
981
980
  - $ref: '#/components/parameters/recordingId'
982
981
  responses:
983
982
  '200':
984
- $ref: '#/components/responses/getCallTranscriptionResponse'
983
+ $ref: '#/components/responses/getRecordingTranscriptionResponse'
985
984
  '400':
986
985
  $ref: '#/components/responses/voiceBadRequestError'
987
986
  '401':
@@ -1047,7 +1046,7 @@ paths:
1047
1046
  transcription will not be accessible anymore. However, it is not deleted
1048
1047
  immediately. This deletion process, while transparent and irreversible,
1049
1048
  can take an additional 24 to 48 hours.
1050
- operationId: deleteCallTranscription
1049
+ operationId: deleteRecordingTranscription
1051
1050
  parameters:
1052
1051
  - $ref: '#/components/parameters/accountId'
1053
1052
  - $ref: '#/components/parameters/callId'
@@ -1101,6 +1100,108 @@ paths:
1101
1100
  '500':
1102
1101
  $ref: '#/components/responses/voiceInternalServerError'
1103
1102
  servers: *ref_1
1103
+ /accounts/{accountId}/calls/{callId}/transcriptions:
1104
+ get:
1105
+ tags:
1106
+ - Transcriptions
1107
+ summary: Enumerate transcriptions made with StartTranscription
1108
+ description: >-
1109
+ Enumerates the transcriptions created on this call via
1110
+ [startTranscription](/docs/voice/bxml/startTranscription).
1111
+ operationId: listRealTimeTranscriptions
1112
+ parameters:
1113
+ - $ref: '#/components/parameters/accountId'
1114
+ - $ref: '#/components/parameters/callId'
1115
+ responses:
1116
+ '200':
1117
+ $ref: '#/components/responses/listTranscriptionsResponse'
1118
+ '400':
1119
+ $ref: '#/components/responses/voiceBadRequestError'
1120
+ '401':
1121
+ $ref: '#/components/responses/voiceUnauthorizedError'
1122
+ '403':
1123
+ $ref: '#/components/responses/voiceForbiddenError'
1124
+ '404':
1125
+ $ref: '#/components/responses/voiceNotFoundError'
1126
+ '405':
1127
+ $ref: '#/components/responses/voiceNotAllowedError'
1128
+ '415':
1129
+ $ref: '#/components/responses/voiceUnsupportedMediaTypeError'
1130
+ '429':
1131
+ $ref: '#/components/responses/voiceTooManyRequestsError'
1132
+ '500':
1133
+ $ref: '#/components/responses/voiceInternalServerError'
1134
+ servers: *ref_1
1135
+ /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId}:
1136
+ get:
1137
+ tags:
1138
+ - Transcriptions
1139
+ summary: Retrieve a specific transcription
1140
+ description: >-
1141
+ Retrieve the specified transcription that was created on this call via
1142
+ [startTranscription](/docs/voice/bxml/startTranscription).
1143
+ operationId: getRealTimeTranscription
1144
+ parameters:
1145
+ - $ref: '#/components/parameters/accountId'
1146
+ - $ref: '#/components/parameters/callId'
1147
+ - $ref: '#/components/parameters/transcriptionId'
1148
+ responses:
1149
+ '200':
1150
+ $ref: '#/components/responses/getCallTranscriptionResponse'
1151
+ '400':
1152
+ $ref: '#/components/responses/voiceBadRequestError'
1153
+ '401':
1154
+ $ref: '#/components/responses/voiceUnauthorizedError'
1155
+ '403':
1156
+ $ref: '#/components/responses/voiceForbiddenError'
1157
+ '404':
1158
+ $ref: '#/components/responses/voiceNotFoundError'
1159
+ '405':
1160
+ $ref: '#/components/responses/voiceNotAllowedError'
1161
+ '415':
1162
+ $ref: '#/components/responses/voiceUnsupportedMediaTypeError'
1163
+ '429':
1164
+ $ref: '#/components/responses/voiceTooManyRequestsError'
1165
+ '500':
1166
+ $ref: '#/components/responses/voiceInternalServerError'
1167
+ delete:
1168
+ tags:
1169
+ - Transcriptions
1170
+ summary: Delete a specific transcription
1171
+ description: >-
1172
+ Delete the specified transcription that was created on this call via
1173
+ [startTranscription](/docs/voice/bxml/startTranscription).
1174
+
1175
+
1176
+ Note: After the deletion is requested and a `204` is returned, the
1177
+ transcription will not be accessible anymore. However, it is not deleted
1178
+ immediately. This deletion process, while transparent and irreversible,
1179
+ can take an additional 24 to 48 hours.
1180
+ operationId: deleteRealTimeTranscription
1181
+ parameters:
1182
+ - $ref: '#/components/parameters/accountId'
1183
+ - $ref: '#/components/parameters/callId'
1184
+ - $ref: '#/components/parameters/transcriptionId'
1185
+ responses:
1186
+ '204':
1187
+ $ref: '#/components/responses/deleteCallTranscriptionResponse'
1188
+ '400':
1189
+ $ref: '#/components/responses/voiceBadRequestError'
1190
+ '401':
1191
+ $ref: '#/components/responses/voiceUnauthorizedError'
1192
+ '403':
1193
+ $ref: '#/components/responses/voiceForbiddenError'
1194
+ '404':
1195
+ $ref: '#/components/responses/voiceNotFoundError'
1196
+ '405':
1197
+ $ref: '#/components/responses/voiceNotAllowedError'
1198
+ '415':
1199
+ $ref: '#/components/responses/voiceUnsupportedMediaTypeError'
1200
+ '429':
1201
+ $ref: '#/components/responses/voiceTooManyRequestsError'
1202
+ '500':
1203
+ $ref: '#/components/responses/voiceInternalServerError'
1204
+ servers: *ref_1
1104
1205
  /accounts/{accountId}/code/voice:
1105
1206
  post:
1106
1207
  tags:
@@ -2677,7 +2778,7 @@ components:
2677
2778
  mediaUrl:
2678
2779
  $ref: '#/components/schemas/mediaUrl'
2679
2780
  transcription:
2680
- $ref: '#/components/schemas/transcriptionMetadata'
2781
+ $ref: '#/components/schemas/recordingTranscriptionMetadata'
2681
2782
  conference:
2682
2783
  type: object
2683
2784
  properties:
@@ -3114,14 +3215,95 @@ components:
3114
3215
  Current supported languages are English, French, and Spanish.
3115
3216
  default: false
3116
3217
  example: true
3117
- transcriptionList:
3218
+ recordingTranscriptions:
3118
3219
  type: object
3119
3220
  properties:
3120
3221
  transcripts:
3121
3222
  type: array
3122
3223
  items:
3123
3224
  $ref: '#/components/schemas/transcription'
3124
- transcriptionMetadata:
3225
+ callTranscriptionMetadataList:
3226
+ type: array
3227
+ items:
3228
+ $ref: '#/components/schemas/callTranscriptionMetadata'
3229
+ example:
3230
+ - transcriptionId: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b
3231
+ transcriptionUrl: >-
3232
+ https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b
3233
+ callTranscriptionMetadata:
3234
+ type: object
3235
+ properties:
3236
+ transcriptionId:
3237
+ type: string
3238
+ description: The programmable voice API transcription ID.
3239
+ example: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b
3240
+ transcriptionUrl:
3241
+ type: string
3242
+ description: >-
3243
+ A URL that may be used to retrieve the transcription itself. This
3244
+ points to the
3245
+
3246
+ [Get Call
3247
+ Transcription](/apis/voice/#operation/getCallTranscription)
3248
+ endpoint.
3249
+ example: >-
3250
+ https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b
3251
+ callTranscriptionResponse:
3252
+ type: object
3253
+ properties:
3254
+ accountId:
3255
+ type: string
3256
+ description: The user account associated with the call.
3257
+ example: '920012'
3258
+ callId:
3259
+ type: string
3260
+ description: The call id associated with the event.
3261
+ example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85
3262
+ transcriptionId:
3263
+ type: string
3264
+ description: The programmable voice API transcription ID.
3265
+ example: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b
3266
+ tracks:
3267
+ type: array
3268
+ items:
3269
+ $ref: '#/components/schemas/callTranscription'
3270
+ example:
3271
+ - detectedLanguage: en-US
3272
+ track: inbound
3273
+ text: Hello World! This is an example.
3274
+ confidence: 0.9
3275
+ callTranscription:
3276
+ type: object
3277
+ properties:
3278
+ detectedLanguage:
3279
+ type: string
3280
+ enum:
3281
+ - en-US
3282
+ - es-US
3283
+ - fr-FR
3284
+ description: The detected language for this transcription.
3285
+ example: en-US
3286
+ track:
3287
+ type: string
3288
+ enum:
3289
+ - inbound
3290
+ - outbound
3291
+ description: Which `track` this transcription is derived from.
3292
+ example: inbound
3293
+ text:
3294
+ type: string
3295
+ description: The transcription itself.
3296
+ example: Hello World! This is an example.
3297
+ confidence:
3298
+ type: number
3299
+ format: double
3300
+ minimum: 0
3301
+ maximum: 1
3302
+ description: >-
3303
+ How confident the transcription engine was in transcribing the
3304
+ associated audio (from `0` to `1`).
3305
+ example: 0.9
3306
+ recordingTranscriptionMetadata:
3125
3307
  nullable: true
3126
3308
  type: object
3127
3309
  description: If the recording was transcribed, metadata about the transcription
@@ -3693,7 +3875,7 @@ components:
3693
3875
  fileFormat:
3694
3876
  $ref: '#/components/schemas/fileFormatEnum'
3695
3877
  channels:
3696
- $ref: '#/components/schemas/status'
3878
+ $ref: '#/components/schemas/channels'
3697
3879
  tag:
3698
3880
  $ref: '#/components/schemas/tag1'
3699
3881
  status:
@@ -4582,12 +4764,26 @@ components:
4582
4764
  schema:
4583
4765
  type: string
4584
4766
  format: binary
4767
+ getRecordingTranscriptionResponse:
4768
+ description: Transcription found.
4769
+ content:
4770
+ application/json:
4771
+ schema:
4772
+ $ref: '#/components/schemas/recordingTranscriptions'
4773
+ listTranscriptionsResponse:
4774
+ description: Transcription found.
4775
+ content:
4776
+ application/json:
4777
+ schema:
4778
+ $ref: '#/components/schemas/callTranscriptionMetadataList'
4585
4779
  getCallTranscriptionResponse:
4586
- description: Transcription found
4780
+ description: Transcription found.
4587
4781
  content:
4588
4782
  application/json:
4589
4783
  schema:
4590
- $ref: '#/components/schemas/transcriptionList'
4784
+ $ref: '#/components/schemas/callTranscriptionResponse'
4785
+ deleteCallTranscriptionResponse:
4786
+ description: Transcription data was deleted.
4591
4787
  listConferencesResponse:
4592
4788
  description: Conferences retrieved successfully
4593
4789
  content:
@@ -5090,6 +5286,14 @@ components:
5090
5286
  type: string
5091
5287
  description: Programmable Voice API Conference Member ID.
5092
5288
  example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85
5289
+ transcriptionId:
5290
+ name: transcriptionId
5291
+ in: path
5292
+ required: true
5293
+ schema:
5294
+ type: string
5295
+ description: Programmable Voice API Transcription ID.
5296
+ example: t-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85
5093
5297
  to:
5094
5298
  name: to
5095
5299
  in: query
@@ -5517,12 +5721,14 @@ components:
5517
5721
  Basic:
5518
5722
  type: http
5519
5723
  scheme: basic
5520
- description: |-
5724
+ description: >-
5521
5725
  Basic authentication is a simple authentication scheme built into the
5522
- HTTP protocol. To use it, send your HTTP requests with an Authorization
5523
- header that contains the word Basic followed by a space and a
5524
- base64-encoded string `username:password`Example: `Authorization: Basic
5525
- ZGVtbZpwQDU1dzByZA==`
5726
+ HTTP protocol. To use it, send your HTTP requests with an
5727
+ `Authorization` header that contains the word `Basic` followed by a
5728
+ space and a Base64-encoded string `username:password`.
5729
+
5730
+
5731
+ - Example: `Authorization: Basic ZGVtbZpwQDU1dzByZA==`
5526
5732
  callbacks:
5527
5733
  inboundCallback:
5528
5734
  '{inboundCallbackUrl}':