bandwidth-sdk 7.0.1 → 7.2.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 (182) hide show
  1. package/.github/workflows/deploy.yml +11 -4
  2. package/.github/workflows/test-pr.yml +3 -1
  3. package/.github/workflows/test-smoke.yml +4 -2
  4. package/.openapi-generator/FILES +4 -0
  5. package/README.md +12 -2
  6. package/api/calls-api.ts +20 -0
  7. package/api/conferences-api.ts +36 -0
  8. package/api/media-api.ts +16 -0
  9. package/api/messages-api.ts +8 -0
  10. package/api/mfaapi.ts +12 -0
  11. package/api/multi-channel-api.ts +4 -0
  12. package/api/phone-number-lookup-api.ts +12 -0
  13. package/api/recordings-api.ts +40 -0
  14. package/api/statistics-api.ts +4 -0
  15. package/api/toll-free-verification-api.ts +36 -0
  16. package/api/transcriptions-api.ts +12 -0
  17. package/bandwidth.yml +58 -0
  18. package/common.ts +3 -1
  19. package/configuration.ts +44 -2
  20. package/coverage/clover.xml +1126 -1050
  21. package/coverage/coverage-final.json +16 -14
  22. package/coverage/lcov-report/index.html +28 -28
  23. package/coverage/lcov-report/node-sdk/api/calls-api.ts.html +66 -6
  24. package/coverage/lcov-report/node-sdk/api/conferences-api.ts.html +114 -6
  25. package/coverage/lcov-report/node-sdk/api/index.html +60 -60
  26. package/coverage/lcov-report/node-sdk/api/media-api.ts.html +54 -6
  27. package/coverage/lcov-report/node-sdk/api/messages-api.ts.html +30 -6
  28. package/coverage/lcov-report/node-sdk/api/mfaapi.ts.html +42 -6
  29. package/coverage/lcov-report/node-sdk/api/multi-channel-api.ts.html +18 -6
  30. package/coverage/lcov-report/node-sdk/api/phone-number-lookup-api.ts.html +42 -6
  31. package/coverage/lcov-report/node-sdk/api/recordings-api.ts.html +126 -6
  32. package/coverage/lcov-report/node-sdk/api/statistics-api.ts.html +18 -6
  33. package/coverage/lcov-report/node-sdk/api/toll-free-verification-api.ts.html +114 -6
  34. package/coverage/lcov-report/node-sdk/api/transcriptions-api.ts.html +42 -6
  35. package/coverage/lcov-report/node-sdk/api.ts.html +1 -1
  36. package/coverage/lcov-report/node-sdk/base.ts.html +1 -1
  37. package/coverage/lcov-report/node-sdk/common.ts.html +25 -19
  38. package/coverage/lcov-report/node-sdk/configuration.ts.html +138 -12
  39. package/coverage/lcov-report/node-sdk/index.html +30 -30
  40. package/coverage/lcov-report/node-sdk/models/business-entity-type-enum.ts.html +1 -1
  41. package/coverage/lcov-report/node-sdk/models/business-registration-type-enum.ts.html +1 -1
  42. package/coverage/lcov-report/node-sdk/models/bxml/Bxml.ts.html +1 -1
  43. package/coverage/lcov-report/node-sdk/models/bxml/NestableVerb.ts.html +1 -1
  44. package/coverage/lcov-report/node-sdk/models/bxml/Response.ts.html +1 -1
  45. package/coverage/lcov-report/node-sdk/models/bxml/Root.ts.html +1 -1
  46. package/coverage/lcov-report/node-sdk/models/bxml/Verb.ts.html +1 -1
  47. package/coverage/lcov-report/node-sdk/models/bxml/index.html +1 -1
  48. package/coverage/lcov-report/node-sdk/models/bxml/index.ts.html +1 -1
  49. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Bridge.ts.html +1 -1
  50. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Conference.ts.html +1 -1
  51. package/coverage/lcov-report/node-sdk/models/bxml/verbs/CustomParam.ts.html +1 -1
  52. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Forward.ts.html +1 -1
  53. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Gather.ts.html +1 -1
  54. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Hangup.ts.html +1 -1
  55. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Pause.ts.html +1 -1
  56. package/coverage/lcov-report/node-sdk/models/bxml/verbs/PauseRecording.ts.html +1 -1
  57. package/coverage/lcov-report/node-sdk/models/bxml/verbs/PhoneNumber.ts.html +1 -1
  58. package/coverage/lcov-report/node-sdk/models/bxml/verbs/PlayAudio.ts.html +1 -1
  59. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Record.ts.html +1 -1
  60. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Redirect.ts.html +1 -1
  61. package/coverage/lcov-report/node-sdk/models/bxml/verbs/ResumeRecording.ts.html +1 -1
  62. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Ring.ts.html +1 -1
  63. package/coverage/lcov-report/node-sdk/models/bxml/verbs/SendDtmf.ts.html +1 -1
  64. package/coverage/lcov-report/node-sdk/models/bxml/verbs/SipUri.ts.html +1 -1
  65. package/coverage/lcov-report/node-sdk/models/bxml/verbs/SpeakSentence.ts.html +1 -1
  66. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartGather.ts.html +1 -1
  67. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartRecording.ts.html +1 -1
  68. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartStream.ts.html +1 -1
  69. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartTranscription.ts.html +1 -1
  70. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopGather.ts.html +1 -1
  71. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopRecording.ts.html +1 -1
  72. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopStream.ts.html +1 -1
  73. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopTranscription.ts.html +1 -1
  74. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StreamParam.ts.html +1 -1
  75. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Tag.ts.html +1 -1
  76. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Transfer.ts.html +1 -1
  77. package/coverage/lcov-report/node-sdk/models/bxml/verbs/index.html +1 -1
  78. package/coverage/lcov-report/node-sdk/models/bxml/verbs/index.ts.html +1 -1
  79. package/coverage/lcov-report/node-sdk/models/call-direction-enum.ts.html +1 -1
  80. package/coverage/lcov-report/node-sdk/models/call-state-enum.ts.html +1 -1
  81. package/coverage/lcov-report/node-sdk/models/call-transcription-detected-language-enum.ts.html +1 -1
  82. package/coverage/lcov-report/node-sdk/models/call-transcription-track-enum.ts.html +1 -1
  83. package/coverage/lcov-report/node-sdk/models/callback-method-enum.ts.html +1 -1
  84. package/coverage/lcov-report/node-sdk/models/card-width-enum.ts.html +1 -1
  85. package/coverage/lcov-report/node-sdk/models/completed-lookup-status-enum.ts.html +1 -1
  86. package/coverage/lcov-report/node-sdk/models/conference-state-enum.ts.html +1 -1
  87. package/coverage/lcov-report/node-sdk/models/deactivation-event-enum.ts.html +1 -1
  88. package/coverage/lcov-report/node-sdk/models/file-format-enum.ts.html +1 -1
  89. package/coverage/lcov-report/node-sdk/models/in-progress-lookup-status-enum.ts.html +1 -1
  90. package/coverage/lcov-report/node-sdk/models/inbound-callback-type-enum.ts.html +1 -1
  91. package/coverage/lcov-report/node-sdk/models/index.html +35 -5
  92. package/coverage/lcov-report/node-sdk/models/index.ts.html +10 -4
  93. package/coverage/lcov-report/node-sdk/models/latest-message-delivery-status-enum.ts.html +1 -1
  94. package/coverage/lcov-report/node-sdk/models/line-type-enum.ts.html +1 -1
  95. package/coverage/lcov-report/node-sdk/models/list-message-direction-enum.ts.html +1 -1
  96. package/coverage/lcov-report/node-sdk/models/machine-detection-mode-enum.ts.html +1 -1
  97. package/coverage/lcov-report/node-sdk/models/message-direction-enum.ts.html +1 -1
  98. package/coverage/lcov-report/node-sdk/models/message-status-enum.ts.html +1 -1
  99. package/coverage/lcov-report/node-sdk/models/message-type-enum.ts.html +1 -1
  100. package/coverage/lcov-report/node-sdk/models/multi-channel-message-channel-enum.ts.html +1 -1
  101. package/coverage/lcov-report/node-sdk/models/priority-enum.ts.html +1 -1
  102. package/coverage/lcov-report/node-sdk/models/product-type-enum.ts.html +1 -1
  103. package/coverage/lcov-report/node-sdk/models/rbm-action-type-enum.ts.html +1 -1
  104. package/coverage/lcov-report/node-sdk/models/rbm-media-height-enum.ts.html +1 -1
  105. package/coverage/lcov-report/node-sdk/models/rbm-open-url-enum.ts.html +172 -0
  106. package/coverage/lcov-report/node-sdk/models/rbm-web-view-enum.ts.html +175 -0
  107. package/coverage/lcov-report/node-sdk/models/recording-state-enum.ts.html +1 -1
  108. package/coverage/lcov-report/node-sdk/models/redirect-method-enum.ts.html +1 -1
  109. package/coverage/lcov-report/node-sdk/models/standalone-card-orientation-enum.ts.html +1 -1
  110. package/coverage/lcov-report/node-sdk/models/status-callback-type-enum.ts.html +1 -1
  111. package/coverage/lcov-report/node-sdk/models/tfv-callback-status-enum.ts.html +1 -1
  112. package/coverage/lcov-report/node-sdk/models/tfv-status-enum.ts.html +1 -1
  113. package/coverage/lcov-report/node-sdk/models/thumbnail-alignment-enum.ts.html +1 -1
  114. package/coverage/lcov-report/node-sdk/models/webhook-subscription-type-enum.ts.html +1 -1
  115. package/coverage/lcov.info +2804 -2695
  116. package/custom_templates/README.mustache +2 -2
  117. package/custom_templates/common.mustache +3 -1
  118. package/custom_templates/configuration.mustache +43 -1
  119. package/custom_templates/package.mustache +11 -9
  120. package/dist/api/calls-api.js +192 -142
  121. package/dist/api/conferences-api.js +333 -243
  122. package/dist/api/media-api.js +142 -102
  123. package/dist/api/messages-api.js +145 -125
  124. package/dist/api/mfaapi.js +102 -72
  125. package/dist/api/multi-channel-api.js +34 -24
  126. package/dist/api/phone-number-lookup-api.js +101 -71
  127. package/dist/api/recordings-api.js +368 -268
  128. package/dist/api/statistics-api.js +30 -20
  129. package/dist/api/toll-free-verification-api.js +298 -208
  130. package/dist/api/transcriptions-api.js +105 -75
  131. package/dist/common.js +3 -1
  132. package/dist/configuration.d.ts +18 -0
  133. package/dist/configuration.js +71 -3
  134. package/dist/models/index.d.ts +2 -0
  135. package/dist/models/index.js +2 -0
  136. package/dist/models/multi-channel-action.d.ts +4 -0
  137. package/dist/models/rbm-open-url-enum.d.ts +19 -0
  138. package/dist/models/rbm-open-url-enum.js +23 -0
  139. package/dist/models/rbm-web-view-enum.d.ts +20 -0
  140. package/dist/models/rbm-web-view-enum.js +24 -0
  141. package/dist/models/tfv-status.d.ts +4 -0
  142. package/dist/models/verification-request.d.ts +4 -0
  143. package/dist/models/verification-update-request.d.ts +4 -0
  144. package/docs/CallsApi.md +5 -5
  145. package/docs/ConferencesApi.md +9 -9
  146. package/docs/MFAApi.md +3 -3
  147. package/docs/MediaApi.md +4 -4
  148. package/docs/MessagesApi.md +2 -2
  149. package/docs/MultiChannelAction.md +4 -0
  150. package/docs/MultiChannelApi.md +1 -1
  151. package/docs/PhoneNumberLookupApi.md +3 -3
  152. package/docs/RbmActionOpenUrl.md +4 -0
  153. package/docs/RbmOpenUrlEnum.md +11 -0
  154. package/docs/RbmWebViewEnum.md +13 -0
  155. package/docs/RecordingsApi.md +10 -10
  156. package/docs/StatisticsApi.md +1 -1
  157. package/docs/TfvStatus.md +2 -0
  158. package/docs/TollFreeVerificationApi.md +9 -9
  159. package/docs/TranscriptionsApi.md +3 -3
  160. package/docs/VerificationRequest.md +2 -0
  161. package/docs/VerificationUpdateRequest.md +2 -0
  162. package/jest.config.js +2 -0
  163. package/models/index.ts +2 -0
  164. package/models/multi-channel-action.ts +8 -0
  165. package/models/rbm-action-open-url.ts +6 -0
  166. package/models/rbm-open-url-enum.ts +29 -0
  167. package/models/rbm-web-view-enum.ts +30 -0
  168. package/models/tfv-status.ts +4 -0
  169. package/models/verification-request.ts +4 -0
  170. package/models/verification-update-request.ts +4 -0
  171. package/package.json +12 -5
  172. package/tests/smoke/bxml.test.ts +4 -1
  173. package/tests/smoke/calls-api.test.ts +4 -1
  174. package/tests/smoke/conferences-api.test.ts +4 -1
  175. package/tests/smoke/phone-number-lookup-api.test.ts +2 -2
  176. package/tests/smoke/recordings-api.test.ts +4 -1
  177. package/tests/smoke/statistics-api.test.ts +4 -1
  178. package/tests/smoke/toll-free-verification-api.test.ts +4 -1
  179. package/tests/smoke/transcriptions-api.test.ts +4 -1
  180. package/tests/unit/api/toll-free-verification-api.test.ts +15 -2
  181. package/tests/unit/models/rbm-open-url-enum.test.ts +8 -0
  182. package/tests/unit/models/rbm-veb-view-enum.test.ts +9 -0
@@ -67,6 +67,10 @@ export const TranscriptionsApiAxiosParamCreator = function (configuration?: Conf
67
67
  // http basic authentication required
68
68
  setBasicAuthToObject(localVarRequestOptions, configuration)
69
69
 
70
+ // authentication OAuth2 required
71
+ // oauth required
72
+ await setOAuthToObject(localVarHeaderParameter, "OAuth2", [], configuration)
73
+
70
74
 
71
75
 
72
76
  setSearchParams(localVarUrlObj, localVarQueryParameter);
@@ -113,6 +117,10 @@ export const TranscriptionsApiAxiosParamCreator = function (configuration?: Conf
113
117
  // http basic authentication required
114
118
  setBasicAuthToObject(localVarRequestOptions, configuration)
115
119
 
120
+ // authentication OAuth2 required
121
+ // oauth required
122
+ await setOAuthToObject(localVarHeaderParameter, "OAuth2", [], configuration)
123
+
116
124
 
117
125
 
118
126
  setSearchParams(localVarUrlObj, localVarQueryParameter);
@@ -155,6 +163,10 @@ export const TranscriptionsApiAxiosParamCreator = function (configuration?: Conf
155
163
  // http basic authentication required
156
164
  setBasicAuthToObject(localVarRequestOptions, configuration)
157
165
 
166
+ // authentication OAuth2 required
167
+ // oauth required
168
+ await setOAuthToObject(localVarHeaderParameter, "OAuth2", [], configuration)
169
+
158
170
 
159
171
 
160
172
  setSearchParams(localVarUrlObj, localVarQueryParameter);
package/bandwidth.yml CHANGED
@@ -9,6 +9,7 @@ info:
9
9
  version: 1.0.0
10
10
  security:
11
11
  - Basic: []
12
+ - OAuth2: []
12
13
  tags:
13
14
  - name: Messages
14
15
  - name: Media
@@ -2377,6 +2378,35 @@ components:
2377
2378
  - OPEN_URL
2378
2379
  - REQUEST_LOCATION
2379
2380
  example: REPLY
2381
+ rbmOpenUrlEnum:
2382
+ type: string
2383
+ description: >-
2384
+ Specifies how the URL should be opened on a mobile device.
2385
+
2386
+ - `BROWSER` Opens the URL in the device's default browser. If
2387
+ application is not set or the device doesn’t support WebView, this
2388
+ option is used by default.
2389
+
2390
+ - `WEBVIEW` Opens the URL in an in-app WebView.
2391
+ enum:
2392
+ - BROWSER
2393
+ - WEBVIEW
2394
+ example: WEBVIEW
2395
+ rbmWebViewEnum:
2396
+ type: string
2397
+ description: >-
2398
+ Defines the layout of the WebView on a mobile device. It must be defined
2399
+ when application is set to `WEBVIEW`
2400
+
2401
+ - `FULL` WebView takes the full screen.
2402
+
2403
+ - `HALF` WebView takes half of the screen.
2404
+
2405
+ - `TALL` WebView takes three-quarters of the screen.
2406
+ enum:
2407
+ - FULL
2408
+ - HALF
2409
+ - TALL
2380
2410
  rbmActionText:
2381
2411
  title: Text
2382
2412
  type: string
@@ -2481,6 +2511,10 @@ components:
2481
2511
  description: The URL to open in browser.
2482
2512
  example: https://dev.bandwidth.com
2483
2513
  maxLength: 2048
2514
+ application:
2515
+ $ref: '#/components/schemas/rbmOpenUrlEnum'
2516
+ webviewViewMode:
2517
+ $ref: '#/components/schemas/rbmWebViewEnum'
2484
2518
  required:
2485
2519
  - url
2486
2520
  multiChannelFullActions:
@@ -5922,6 +5956,8 @@ components:
5922
5956
  $ref: '#/components/schemas/helpMessageResponse'
5923
5957
  ageGatedContent:
5924
5958
  $ref: '#/components/schemas/ageGatedContent'
5959
+ cvToken:
5960
+ $ref: '#/components/schemas/cvToken'
5925
5961
  verificationUpdateRequest:
5926
5962
  type: object
5927
5963
  required:
@@ -5971,6 +6007,8 @@ components:
5971
6007
  $ref: '#/components/schemas/helpMessageResponse'
5972
6008
  ageGatedContent:
5973
6009
  $ref: '#/components/schemas/ageGatedContent'
6010
+ cvToken:
6011
+ $ref: '#/components/schemas/cvToken'
5974
6012
  tfvBasicAuthentication:
5975
6013
  type: object
5976
6014
  properties:
@@ -6422,6 +6460,8 @@ components:
6422
6460
  $ref: '#/components/schemas/blocked'
6423
6461
  blockedReason:
6424
6462
  $ref: '#/components/schemas/blockedReason'
6463
+ cvToken:
6464
+ $ref: '#/components/schemas/cvToken'
6425
6465
  tfvSubmissionInfo:
6426
6466
  type: object
6427
6467
  properties:
@@ -6486,6 +6526,18 @@ components:
6486
6526
  nullable: true
6487
6527
  pattern: ^[ -~]{16,64}$
6488
6528
  type: string
6529
+ cvToken:
6530
+ type: string
6531
+ description: >-
6532
+ The token provided by Campaign Verify to validate your political use
6533
+ case. Only required for 527 political organizations. If you are not a
6534
+ 527 political organization, this field should be omitted. If you pass an
6535
+ empty string, it will be passed along and potentially rejected.
6536
+ minLength: 0
6537
+ maxLength: 500
6538
+ nullable: true
6539
+ example: >-
6540
+ cv.user123|sess456|mno|tfree|read_write|X7yZ9aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVw
6489
6541
  responses:
6490
6542
  createMessageResponse:
6491
6543
  description: Accepted
@@ -8427,6 +8479,12 @@ components:
8427
8479
 
8428
8480
 
8429
8481
  - Example: `Authorization: Basic ZGVtbZpwQDU1dzByZA==`
8482
+ OAuth2:
8483
+ type: oauth2
8484
+ flows:
8485
+ clientCredentials:
8486
+ tokenUrl: https://api.bandwidth.com/api/v1/oauth2/token
8487
+ scopes: {}
8430
8488
  callbacks:
8431
8489
  inboundCallback:
8432
8490
  '{inboundCallbackUrl}':
package/common.ts CHANGED
@@ -58,7 +58,9 @@ export const setOAuthToObject = async function (object: any, name: string, scope
58
58
  const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
59
59
  ? await configuration.accessToken(name, scopes)
60
60
  : await configuration.accessToken;
61
- object["Authorization"] = "Bearer " + localVarAccessTokenValue;
61
+ if (localVarAccessTokenValue) {
62
+ object["Authorization"] = "Bearer " + localVarAccessTokenValue;
63
+ }
62
64
  }
63
65
  }
64
66
 
package/configuration.ts CHANGED
@@ -11,6 +11,8 @@
11
11
  * Do not edit the class manually.
12
12
  */
13
13
 
14
+ import globalAxios from 'axios';
15
+
14
16
  interface AWSv4Configuration {
15
17
  options?: {
16
18
  region?: string
@@ -27,6 +29,8 @@ export interface ConfigurationParameters {
27
29
  apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
28
30
  username?: string;
29
31
  password?: string;
32
+ clientId?: string;
33
+ clientSecret?: string;
30
34
  accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
31
35
  awsv4?: AWSv4Configuration;
32
36
  basePath?: string;
@@ -49,12 +53,28 @@ export class Configuration {
49
53
  * parameter for basic security
50
54
  */
51
55
  password?: string;
56
+ /**
57
+ * parameter for client ID
58
+ */
59
+ clientId?: string;
60
+ /**
61
+ * parameter for client secret
62
+ */
63
+ clientSecret?: string;
52
64
  /**
53
65
  * parameter for oauth2 security
54
66
  * @param name security name
55
67
  * @param scopes oauth2 scope
56
68
  */
57
69
  accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
70
+ /**
71
+ * temporary access token storage
72
+ */
73
+ tempAccessToken?: string;
74
+ /**
75
+ * when the temporary access token expires
76
+ */
77
+ tempAccessTokenExpiration?: number;
58
78
  /**
59
79
  * parameter for aws4 signature security
60
80
  * @param {Object} AWS4Signature - AWS4 Signature security
@@ -91,7 +111,29 @@ export class Configuration {
91
111
  this.apiKey = param.apiKey;
92
112
  this.username = param.username;
93
113
  this.password = param.password;
94
- this.accessToken = param.accessToken;
114
+ this.clientId = param.clientId;
115
+ this.clientSecret = param.clientSecret;
116
+ this.tempAccessToken;
117
+ this.tempAccessTokenExpiration;
118
+ this.accessToken = param.accessToken ?? (async (name, scopes) => {
119
+ const now = Math.floor(Date.now() / 1000);
120
+ if (this.tempAccessToken && (!this.tempAccessTokenExpiration || this.tempAccessTokenExpiration > now + 60)) {
121
+ return this.tempAccessToken;
122
+ } else if (this.clientId && this.clientSecret) {
123
+ const tokenRequestArgs = {
124
+ method: 'POST',
125
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
126
+ auth: { username: this.clientId || '', password: this.clientSecret || '' },
127
+ data: 'grant_type=client_credentials',
128
+ url: 'https://api.bandwidth.com/api/v1/oauth2/token'
129
+ };
130
+ const response = await globalAxios.request(tokenRequestArgs);
131
+ this.tempAccessToken = response.data.access_token;
132
+ this.tempAccessTokenExpiration = now + response.data.expires_in;
133
+ return this.tempAccessToken!;
134
+ }
135
+ return undefined;
136
+ });
95
137
  this.awsv4 = param.awsv4;
96
138
  this.basePath = param.basePath;
97
139
  this.serverIndex = param.serverIndex;
@@ -99,7 +141,7 @@ export class Configuration {
99
141
  ...param.baseOptions,
100
142
  headers: {
101
143
  ...param.baseOptions?.headers,
102
- 'User-Agent': "OpenAPI-Generator/7.0.1/typescript-axios"
144
+ 'User-Agent': "OpenAPI-Generator/7.2.0/typescript-axios"
103
145
  },
104
146
  };
105
147
  this.formDataCtor = param.formDataCtor;