ibm-cloud-sdk-core 4.0.0 → 4.0.2

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 (233) hide show
  1. package/.secrets.baseline +20 -30
  2. package/CHANGELOG.md +16 -4
  3. package/MIGRATION-V4.md +54 -0
  4. package/auth/authenticators/authenticator-interface.d.ts +3 -4
  5. package/auth/authenticators/authenticator-interface.js +1 -1
  6. package/auth/authenticators/authenticator.d.ts +5 -9
  7. package/auth/authenticators/authenticator.js +4 -8
  8. package/auth/authenticators/basic-authenticator.d.ts +12 -12
  9. package/auth/authenticators/basic-authenticator.js +12 -12
  10. package/auth/authenticators/bearer-token-authenticator.d.ts +11 -14
  11. package/auth/authenticators/bearer-token-authenticator.js +11 -14
  12. package/auth/authenticators/cloud-pak-for-data-authenticator.d.ts +15 -15
  13. package/auth/authenticators/cloud-pak-for-data-authenticator.js +15 -15
  14. package/auth/authenticators/container-authenticator.d.ts +23 -23
  15. package/auth/authenticators/container-authenticator.js +23 -23
  16. package/auth/authenticators/iam-authenticator.d.ts +20 -20
  17. package/auth/authenticators/iam-authenticator.js +20 -20
  18. package/auth/authenticators/iam-request-based-authenticator.d.ts +23 -25
  19. package/auth/authenticators/iam-request-based-authenticator.js +23 -25
  20. package/auth/authenticators/token-request-based-authenticator.d.ts +19 -24
  21. package/auth/authenticators/token-request-based-authenticator.js +19 -24
  22. package/auth/authenticators/vpc-instance-authenticator.d.ts +17 -16
  23. package/auth/authenticators/vpc-instance-authenticator.js +17 -16
  24. package/auth/token-managers/container-token-manager.d.ts +23 -25
  25. package/auth/token-managers/container-token-manager.js +23 -25
  26. package/auth/token-managers/cp4d-token-manager.d.ts +13 -13
  27. package/auth/token-managers/cp4d-token-manager.js +13 -13
  28. package/auth/token-managers/iam-request-based-token-manager.d.ts +26 -31
  29. package/auth/token-managers/iam-request-based-token-manager.js +26 -31
  30. package/auth/token-managers/iam-token-manager.d.ts +17 -16
  31. package/auth/token-managers/iam-token-manager.js +17 -16
  32. package/auth/token-managers/jwt-token-manager.d.ts +10 -13
  33. package/auth/token-managers/jwt-token-manager.js +13 -16
  34. package/auth/token-managers/token-manager.d.ts +23 -35
  35. package/auth/token-managers/token-manager.js +22 -34
  36. package/auth/token-managers/vpc-instance-token-manager.d.ts +15 -15
  37. package/auth/token-managers/vpc-instance-token-manager.js +15 -15
  38. package/auth/utils/get-authenticator-from-environment.d.ts +2 -2
  39. package/auth/utils/get-authenticator-from-environment.js +2 -2
  40. package/auth/utils/helpers.d.ts +34 -32
  41. package/auth/utils/helpers.js +34 -32
  42. package/auth/utils/read-external-sources.d.ts +2 -1
  43. package/auth/utils/read-external-sources.js +5 -4
  44. package/build/docs/ibm-cloud-sdk-core.atleastone.md +4 -4
  45. package/build/docs/ibm-cloud-sdk-core.atmostone.md +2 -2
  46. package/build/docs/ibm-cloud-sdk-core.authenticator._constructor_.md +1 -1
  47. package/build/docs/ibm-cloud-sdk-core.authenticator.authenticate.md +1 -1
  48. package/build/docs/ibm-cloud-sdk-core.authenticator.authenticationtype.md +1 -1
  49. package/build/docs/ibm-cloud-sdk-core.authenticator.md +1 -1
  50. package/build/docs/ibm-cloud-sdk-core.authenticatorinterface.authenticate.md +1 -1
  51. package/build/docs/ibm-cloud-sdk-core.baseservice._constructor_.md +1 -1
  52. package/build/docs/ibm-cloud-sdk-core.baseservice.configureservice.md +1 -1
  53. package/build/docs/ibm-cloud-sdk-core.baseservice.createrequest.md +2 -2
  54. package/build/docs/ibm-cloud-sdk-core.baseservice.enableretries.md +1 -1
  55. package/build/docs/ibm-cloud-sdk-core.baseservice.getauthenticator.md +1 -1
  56. package/build/docs/ibm-cloud-sdk-core.baseservice.md +3 -3
  57. package/build/docs/ibm-cloud-sdk-core.baseservice.setdefaultheaders.md +1 -1
  58. package/build/docs/ibm-cloud-sdk-core.baseservice.setserviceurl.md +1 -1
  59. package/build/docs/ibm-cloud-sdk-core.basicauthenticator._constructor_.md +2 -2
  60. package/build/docs/ibm-cloud-sdk-core.basicauthenticator.authenticate.md +1 -1
  61. package/build/docs/ibm-cloud-sdk-core.basicauthenticator.md +3 -3
  62. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator._constructor_.md +2 -2
  63. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.authenticate.md +2 -2
  64. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.md +3 -3
  65. package/build/docs/ibm-cloud-sdk-core.buildrequestfileobject.md +2 -2
  66. package/build/docs/ibm-cloud-sdk-core.checkcredentials.md +3 -3
  67. package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator._constructor_.md +3 -3
  68. package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator.md +5 -5
  69. package/build/docs/ibm-cloud-sdk-core.computebasicauthheader.md +1 -1
  70. package/build/docs/ibm-cloud-sdk-core.constructserviceurl.md +4 -4
  71. package/build/docs/ibm-cloud-sdk-core.containerauthenticator._constructor_.md +3 -3
  72. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.md +4 -4
  73. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setcrtokenfilename.md +1 -1
  74. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setiamprofileid.md +1 -1
  75. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setiamprofilename.md +1 -1
  76. package/build/docs/ibm-cloud-sdk-core.containertokenmanager._constructor_.md +6 -2
  77. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.md +5 -5
  78. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.requesttoken.md +0 -2
  79. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.setcrtokenfilename.md +2 -2
  80. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.setiamprofileid.md +2 -2
  81. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.setiamprofilename.md +2 -2
  82. package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager._constructor_.md +6 -2
  83. package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager.md +3 -3
  84. package/build/docs/ibm-cloud-sdk-core.fileobject.md +5 -5
  85. package/build/docs/ibm-cloud-sdk-core.fileoptions.md +4 -4
  86. package/build/docs/ibm-cloud-sdk-core.filestream.md +3 -3
  87. package/build/docs/ibm-cloud-sdk-core.filewithmetadata.md +5 -5
  88. package/build/docs/ibm-cloud-sdk-core.getauthenticatorfromenvironment.md +1 -1
  89. package/build/docs/ibm-cloud-sdk-core.getcontenttype.md +1 -1
  90. package/build/docs/ibm-cloud-sdk-core.getcurrenttime.md +2 -2
  91. package/build/docs/ibm-cloud-sdk-core.getformat.md +0 -2
  92. package/build/docs/ibm-cloud-sdk-core.getmissingparams.md +1 -1
  93. package/build/docs/ibm-cloud-sdk-core.getnewlogger.md +1 -1
  94. package/build/docs/ibm-cloud-sdk-core.getqueryparam.md +1 -5
  95. package/build/docs/ibm-cloud-sdk-core.iamauthenticator._constructor_.md +3 -3
  96. package/build/docs/ibm-cloud-sdk-core.iamauthenticator.md +5 -5
  97. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator._constructor_.md +3 -3
  98. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.getrefreshtoken.md +1 -1
  99. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.md +7 -7
  100. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.setclientidandsecret.md +3 -3
  101. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.setscope.md +1 -1
  102. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager._constructor_.md +6 -2
  103. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.getrefreshtoken.md +2 -2
  104. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.md +8 -8
  105. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.requesttoken.md +2 -2
  106. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.savetokeninfo.md +1 -3
  107. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.setclientidandsecret.md +3 -5
  108. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.setscope.md +2 -4
  109. package/build/docs/ibm-cloud-sdk-core.iamrequestoptions.md +5 -5
  110. package/build/docs/ibm-cloud-sdk-core.iamtokenmanager._constructor_.md +6 -2
  111. package/build/docs/ibm-cloud-sdk-core.iamtokenmanager.md +3 -3
  112. package/build/docs/ibm-cloud-sdk-core.ishtml.md +1 -1
  113. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager._constructor_.md +2 -2
  114. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.md +5 -5
  115. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.requesttoken.md +1 -1
  116. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.savetokeninfo.md +1 -3
  117. package/build/docs/ibm-cloud-sdk-core.md +24 -24
  118. package/build/docs/ibm-cloud-sdk-core.onlyone.md +2 -2
  119. package/build/docs/ibm-cloud-sdk-core.qs.md +1 -1
  120. package/build/docs/ibm-cloud-sdk-core.readexternalsources.md +1 -1
  121. package/build/docs/ibm-cloud-sdk-core.removesuffix.md +4 -4
  122. package/build/docs/ibm-cloud-sdk-core.sdklogger.md +7 -7
  123. package/build/docs/ibm-cloud-sdk-core.streamtopromise.md +3 -1
  124. package/build/docs/ibm-cloud-sdk-core.striptrailingslash.md +4 -2
  125. package/build/docs/ibm-cloud-sdk-core.tokenmanager._constructor_.md +2 -2
  126. package/build/docs/ibm-cloud-sdk-core.tokenmanager.gettoken.md +1 -1
  127. package/build/docs/ibm-cloud-sdk-core.tokenmanager.md +15 -15
  128. package/build/docs/ibm-cloud-sdk-core.tokenmanager.pacedrequesttoken.md +1 -1
  129. package/build/docs/ibm-cloud-sdk-core.tokenmanager.requesttoken.md +1 -1
  130. package/build/docs/ibm-cloud-sdk-core.tokenmanager.savetokeninfo.md +1 -3
  131. package/build/docs/ibm-cloud-sdk-core.tokenmanager.setdisablesslverification.md +1 -3
  132. package/build/docs/ibm-cloud-sdk-core.tokenmanager.setheaders.md +2 -4
  133. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator._constructor_.md +2 -2
  134. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.authenticate.md +2 -2
  135. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.md +9 -9
  136. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.setdisablesslverification.md +1 -1
  137. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.setheaders.md +1 -1
  138. package/build/docs/ibm-cloud-sdk-core.tolowerkeys.md +1 -1
  139. package/build/docs/ibm-cloud-sdk-core.unittestutils.checkforsuccessfulexecution.md +0 -2
  140. package/build/docs/ibm-cloud-sdk-core.unittestutils.checkmediaheaders.md +0 -2
  141. package/build/docs/ibm-cloud-sdk-core.unittestutils.checkurlandmethod.md +1 -3
  142. package/build/docs/ibm-cloud-sdk-core.unittestutils.checkuserheader.md +0 -2
  143. package/build/docs/ibm-cloud-sdk-core.unittestutils.expecttobepromise.md +0 -2
  144. package/build/docs/ibm-cloud-sdk-core.unittestutils.getoptions.md +1 -1
  145. package/build/docs/ibm-cloud-sdk-core.useroptions.md +9 -9
  146. package/build/docs/ibm-cloud-sdk-core.validateinput.md +8 -2
  147. package/build/docs/ibm-cloud-sdk-core.validateparams.md +1 -1
  148. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator._constructor_.md +6 -2
  149. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.md +6 -6
  150. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.setiamprofilecrn.md +2 -2
  151. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.setiamprofileid.md +2 -2
  152. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager._constructor_.md +6 -2
  153. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.md +4 -4
  154. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.setiamprofilecrn.md +2 -2
  155. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.setiamprofileid.md +2 -2
  156. package/docs/ibm-cloud-sdk-core.api.json +516 -241
  157. package/es/auth/authenticators/authenticator-interface.d.ts +3 -4
  158. package/es/auth/authenticators/authenticator-interface.js +1 -1
  159. package/es/auth/authenticators/authenticator.d.ts +5 -9
  160. package/es/auth/authenticators/authenticator.js +4 -8
  161. package/es/auth/authenticators/basic-authenticator.d.ts +12 -12
  162. package/es/auth/authenticators/basic-authenticator.js +12 -12
  163. package/es/auth/authenticators/bearer-token-authenticator.d.ts +11 -14
  164. package/es/auth/authenticators/bearer-token-authenticator.js +11 -14
  165. package/es/auth/authenticators/cloud-pak-for-data-authenticator.d.ts +15 -15
  166. package/es/auth/authenticators/cloud-pak-for-data-authenticator.js +15 -15
  167. package/es/auth/authenticators/container-authenticator.d.ts +23 -23
  168. package/es/auth/authenticators/container-authenticator.js +23 -23
  169. package/es/auth/authenticators/iam-authenticator.d.ts +20 -20
  170. package/es/auth/authenticators/iam-authenticator.js +20 -20
  171. package/es/auth/authenticators/iam-request-based-authenticator.d.ts +23 -25
  172. package/es/auth/authenticators/iam-request-based-authenticator.js +23 -25
  173. package/es/auth/authenticators/token-request-based-authenticator.d.ts +19 -24
  174. package/es/auth/authenticators/token-request-based-authenticator.js +19 -24
  175. package/es/auth/authenticators/vpc-instance-authenticator.d.ts +17 -16
  176. package/es/auth/authenticators/vpc-instance-authenticator.js +17 -16
  177. package/es/auth/token-managers/container-token-manager.d.ts +23 -25
  178. package/es/auth/token-managers/container-token-manager.js +23 -25
  179. package/es/auth/token-managers/cp4d-token-manager.d.ts +13 -13
  180. package/es/auth/token-managers/cp4d-token-manager.js +13 -13
  181. package/es/auth/token-managers/iam-request-based-token-manager.d.ts +26 -31
  182. package/es/auth/token-managers/iam-request-based-token-manager.js +26 -31
  183. package/es/auth/token-managers/iam-token-manager.d.ts +17 -16
  184. package/es/auth/token-managers/iam-token-manager.js +17 -16
  185. package/es/auth/token-managers/jwt-token-manager.d.ts +10 -13
  186. package/es/auth/token-managers/jwt-token-manager.js +13 -16
  187. package/es/auth/token-managers/token-manager.d.ts +23 -35
  188. package/es/auth/token-managers/token-manager.js +22 -34
  189. package/es/auth/token-managers/vpc-instance-token-manager.d.ts +15 -15
  190. package/es/auth/token-managers/vpc-instance-token-manager.js +15 -15
  191. package/es/auth/utils/get-authenticator-from-environment.d.ts +2 -2
  192. package/es/auth/utils/get-authenticator-from-environment.js +2 -2
  193. package/es/auth/utils/helpers.d.ts +34 -32
  194. package/es/auth/utils/helpers.js +34 -32
  195. package/es/auth/utils/read-external-sources.d.ts +2 -1
  196. package/es/auth/utils/read-external-sources.js +5 -4
  197. package/es/lib/base-service.d.ts +31 -32
  198. package/es/lib/base-service.js +31 -32
  199. package/es/lib/content-type.js +5 -5
  200. package/es/lib/get-new-logger.d.ts +2 -2
  201. package/es/lib/get-new-logger.js +2 -2
  202. package/es/lib/helper.d.ts +24 -31
  203. package/es/lib/helper.js +25 -32
  204. package/es/lib/querystring.d.ts +1 -1
  205. package/es/lib/querystring.js +3 -3
  206. package/es/lib/request-wrapper.d.ts +4 -6
  207. package/es/lib/request-wrapper.js +17 -23
  208. package/es/lib/sdk-test-helpers.d.ts +14 -19
  209. package/es/lib/sdk-test-helpers.js +14 -19
  210. package/es/lib/stream-to-promise.d.ts +3 -3
  211. package/es/lib/stream-to-promise.js +3 -3
  212. package/es/tsdoc-metadata.json +1 -1
  213. package/etc/ibm-cloud-sdk-core.api.md +12 -12
  214. package/ibm-cloud-sdk-core.d.ts +1402 -1449
  215. package/lib/base-service.d.ts +31 -32
  216. package/lib/base-service.js +31 -32
  217. package/lib/content-type.js +5 -5
  218. package/lib/get-new-logger.d.ts +2 -2
  219. package/lib/get-new-logger.js +2 -2
  220. package/lib/helper.d.ts +24 -31
  221. package/lib/helper.js +25 -32
  222. package/lib/querystring.d.ts +1 -1
  223. package/lib/querystring.js +3 -3
  224. package/lib/request-wrapper.d.ts +4 -6
  225. package/lib/request-wrapper.js +17 -23
  226. package/lib/sdk-test-helpers.d.ts +14 -19
  227. package/lib/sdk-test-helpers.js +14 -19
  228. package/lib/stream-to-promise.d.ts +3 -3
  229. package/lib/stream-to-promise.js +3 -3
  230. package/package.json +2 -2
  231. package/temp/ibm-cloud-sdk-core.api.json +516 -241
  232. package/temp/ibm-cloud-sdk-core.api.md +12 -12
  233. package/MIGRATION-V1.md +0 -42
@@ -190,9 +190,8 @@ var RequestWrapper = /** @class */ (function () {
190
190
  * 2. Checks for missing parameters
191
191
  * 3. Encode path and query parameters
192
192
  * 4. Call the api
193
- * @private
194
- * @returns {ReadableStream|undefined}
195
- * @throws {Error}
193
+ * @returns ReadableStream|undefined
194
+ * @throws Error
196
195
  */
197
196
  RequestWrapper.prototype.sendRequest = function (parameters) {
198
197
  return __awaiter(this, void 0, void 0, function () {
@@ -310,9 +309,8 @@ var RequestWrapper = /** @class */ (function () {
310
309
  };
311
310
  /**
312
311
  * Format error returned by axios
313
- * @param {object} the object returned by axios via rejection
314
- * @private
315
- * @returns {Error}
312
+ * @param axiosError - the object returned by axios via rejection
313
+ * @returns the Error object
316
314
  */
317
315
  RequestWrapper.prototype.formatError = function (axiosError) {
318
316
  // return an actual error object,
@@ -476,10 +474,10 @@ var RequestWrapper = /** @class */ (function () {
476
474
  }());
477
475
  exports.RequestWrapper = RequestWrapper;
478
476
  /**
479
- * @private
480
- * @param {string} path
481
- * @param {Object} params
482
- * @returns {string}
477
+ * Parses the path.
478
+ * @param path - the path
479
+ * @param params - the params
480
+ * @returns the parsed path
483
481
  */
484
482
  function parsePath(path, params) {
485
483
  if (!path || !params) {
@@ -492,9 +490,8 @@ function parsePath(path, params) {
492
490
  }
493
491
  /**
494
492
  * Determine if the error is due to bad credentials
495
- * @private
496
- * @param {Object} error - error object returned from axios
497
- * @returns {boolean} true if error is due to authentication
493
+ * @param error - error object returned from axios
494
+ * @returns true if error is due to authentication
498
495
  */
499
496
  function isAuthenticationError(error) {
500
497
  var isAuthErr = false;
@@ -509,9 +506,8 @@ function isAuthenticationError(error) {
509
506
  }
510
507
  /**
511
508
  * Determine if the error is due to a bad self signed certificate
512
- * @private
513
- * @param {Object} error - error object returned from axios
514
- * @returns {boolean} true if error is due to an SSL error
509
+ * @param error - error object returned from axios
510
+ * @returnstrue if error is due to an SSL error
515
511
  */
516
512
  function isSelfSignedCertificateError(error) {
517
513
  var result = false;
@@ -526,10 +522,9 @@ function isSelfSignedCertificateError(error) {
526
522
  }
527
523
  /**
528
524
  * Return true if object has a specified property that is a string
529
- * @private
530
- * @param {Object} obj - object to look for property in
531
- * @param {string} property - name of the property to look for
532
- * @returns {boolean} true if property exists and is string
525
+ * @param obj - object to look for property in
526
+ * @param property - name of the property to look for
527
+ * @returns true if property exists and is string
533
528
  */
534
529
  function hasStringProperty(obj, property) {
535
530
  return Boolean(obj[property] && typeof obj[property] === 'string');
@@ -538,9 +533,8 @@ function hasStringProperty(obj, property) {
538
533
  * Look for service error message in common places, by priority
539
534
  * first look in `errors[0].message`, then in `error`, then in
540
535
  * `message`, then in `errorMessage`
541
- * @private
542
- * @param {Object} response - error response body received from service
543
- * @returns {string | undefined} the error message if is was found, undefined otherwise
536
+ * @param response - error response body received from service
537
+ * @returns the error message if is was found, undefined otherwise
544
538
  */
545
539
  function parseServiceErrorMessage(response) {
546
540
  var message;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2019, 2021.
2
+ * (C) Copyright IBM Corp. 2019, 2022.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -22,10 +22,9 @@
22
22
  * Takes the request options constructed by the SDK and checks that the `url` and `method` properties
23
23
  * were set to their correct values.
24
24
  *
25
- * @param {Object} options - the options object put together by the SDK, retrieved from the createRequest mock
26
- * @param {String} url - The URL path of the service endpoint, from the paths section of the API definition
27
- * @param {String} string - The HTTP method for the request, from the API definition
28
- * @returns {void}
25
+ * @param options - the options object put together by the SDK, retrieved from the createRequest mock
26
+ * @param url - The URL path of the service endpoint, from the paths section of the API definition
27
+ * @param method - The HTTP method for the request, from the API definition
29
28
  */
30
29
  export declare function checkUrlAndMethod(options: any, url: string, method: any): void;
31
30
  /**
@@ -33,10 +32,9 @@ export declare function checkUrlAndMethod(options: any, url: string, method: any
33
32
  * and checks for the expected values for `Accept` and `Content-Type`. This to verify that the SDK sets
34
33
  * the correct values in the code.
35
34
  *
36
- * @param {Object} createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class
37
- * @param {String} accept - the expected value for the `Accept` header
38
- * @param {String} contentType - the expected value for the `Content-Type` header
39
- * @returns {void}
35
+ * @param createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class
36
+ * @param accept - the expected value for the `Accept` header
37
+ * @param contentType - the expected value for the `Content-Type` header
40
38
  */
41
39
  export declare function checkMediaHeaders(createRequestMock: any, accept: string, contentType: string): void;
42
40
  /**
@@ -44,18 +42,16 @@ export declare function checkMediaHeaders(createRequestMock: any, accept: string
44
42
  * and checks for the expected value for a user-defined header. This is verify that the SDK accepts header
45
43
  * parameters and sends them as headers in the request.
46
44
  *
47
- * @param {Object} createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class
48
- * @param {String} userHeaderName - the name of the header passed by the user, e.g. `Contained-Content-Type`
49
- * @param {String} userHeaderValue - the expected value for the header passed by the user
50
- * @returns {void}
45
+ * @param createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class
46
+ * @param userHeaderName - the name of the header passed by the user, e.g. `Contained-Content-Type`
47
+ * @param userHeaderValue - the expected value for the header passed by the user
51
48
  */
52
49
  export declare function checkUserHeader(createRequestMock: any, userHeaderName: string, userHeaderValue: string): void;
53
50
  /**
54
51
  * This method simply ensures that the method executed without any issues by extracting
55
52
  * the argument from the mock object for the `createRequest` method and verifying that it is an object.
56
53
  *
57
- * @param {Object} createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class
58
- * @returns {void}
54
+ * @param createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class
59
55
  */
60
56
  export declare function checkForSuccessfulExecution(createRequestMock: any): void;
61
57
  /**
@@ -63,15 +59,14 @@ export declare function checkForSuccessfulExecution(createRequestMock: any): voi
63
59
  * an object containing all of the SDK method-specific information (like `path` and `body`) used to build a request.
64
60
  * This method is just a convenience method for the unit tests to be able to make assertions on the items in the request.
65
61
  *
66
- * @param {Object} createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class
67
- * @returns {Object}
62
+ * @param createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class
63
+ * @returns Object
68
64
  */
69
65
  export declare function getOptions(createRequestMock: any): any;
70
66
  /**
71
67
  * This method simply ensures that the SDK methods return Promises by checking for
72
68
  * the `then` function - common way to assess whether or not an object is a Promise.
73
69
  *
74
- * @param {Promise<any>} sdkPromise - the Promise returned by an SDK method
75
- * @returns {void}
70
+ * @param sdkPromise - the Promise returned by an SDK method
76
71
  */
77
72
  export declare function expectToBePromise(sdkPromise: any): void;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * (C) Copyright IBM Corp. 2019, 2021.
3
+ * (C) Copyright IBM Corp. 2019, 2022.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -29,10 +29,9 @@ var expect_1 = __importDefault(require("expect"));
29
29
  * Takes the request options constructed by the SDK and checks that the `url` and `method` properties
30
30
  * were set to their correct values.
31
31
  *
32
- * @param {Object} options - the options object put together by the SDK, retrieved from the createRequest mock
33
- * @param {String} url - The URL path of the service endpoint, from the paths section of the API definition
34
- * @param {String} string - The HTTP method for the request, from the API definition
35
- * @returns {void}
32
+ * @param options - the options object put together by the SDK, retrieved from the createRequest mock
33
+ * @param url - The URL path of the service endpoint, from the paths section of the API definition
34
+ * @param method - The HTTP method for the request, from the API definition
36
35
  */
37
36
  function checkUrlAndMethod(options, url, method) {
38
37
  (0, expect_1.default)(options.url).toEqual(url);
@@ -44,10 +43,9 @@ exports.checkUrlAndMethod = checkUrlAndMethod;
44
43
  * and checks for the expected values for `Accept` and `Content-Type`. This to verify that the SDK sets
45
44
  * the correct values in the code.
46
45
  *
47
- * @param {Object} createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class
48
- * @param {String} accept - the expected value for the `Accept` header
49
- * @param {String} contentType - the expected value for the `Content-Type` header
50
- * @returns {void}
46
+ * @param createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class
47
+ * @param accept - the expected value for the `Accept` header
48
+ * @param contentType - the expected value for the `Content-Type` header
51
49
  */
52
50
  function checkMediaHeaders(createRequestMock, accept, contentType) {
53
51
  var headers = createRequestMock.mock.calls[0][0].defaultOptions.headers;
@@ -60,10 +58,9 @@ exports.checkMediaHeaders = checkMediaHeaders;
60
58
  * and checks for the expected value for a user-defined header. This is verify that the SDK accepts header
61
59
  * parameters and sends them as headers in the request.
62
60
  *
63
- * @param {Object} createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class
64
- * @param {String} userHeaderName - the name of the header passed by the user, e.g. `Contained-Content-Type`
65
- * @param {String} userHeaderValue - the expected value for the header passed by the user
66
- * @returns {void}
61
+ * @param createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class
62
+ * @param userHeaderName - the name of the header passed by the user, e.g. `Contained-Content-Type`
63
+ * @param userHeaderValue - the expected value for the header passed by the user
67
64
  */
68
65
  function checkUserHeader(createRequestMock, userHeaderName, userHeaderValue) {
69
66
  var headers = createRequestMock.mock.calls[0][0].defaultOptions.headers;
@@ -74,8 +71,7 @@ exports.checkUserHeader = checkUserHeader;
74
71
  * This method simply ensures that the method executed without any issues by extracting
75
72
  * the argument from the mock object for the `createRequest` method and verifying that it is an object.
76
73
  *
77
- * @param {Object} createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class
78
- * @returns {void}
74
+ * @param createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class
79
75
  */
80
76
  function checkForSuccessfulExecution(createRequestMock) {
81
77
  var sdkParams = createRequestMock.mock.calls[0][0];
@@ -87,8 +83,8 @@ exports.checkForSuccessfulExecution = checkForSuccessfulExecution;
87
83
  * an object containing all of the SDK method-specific information (like `path` and `body`) used to build a request.
88
84
  * This method is just a convenience method for the unit tests to be able to make assertions on the items in the request.
89
85
  *
90
- * @param {Object} createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class
91
- * @returns {Object}
86
+ * @param createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class
87
+ * @returns Object
92
88
  */
93
89
  function getOptions(createRequestMock) {
94
90
  return createRequestMock.mock.calls[0][0].options;
@@ -98,8 +94,7 @@ exports.getOptions = getOptions;
98
94
  * This method simply ensures that the SDK methods return Promises by checking for
99
95
  * the `then` function - common way to assess whether or not an object is a Promise.
100
96
  *
101
- * @param {Promise<any>} sdkPromise - the Promise returned by an SDK method
102
- * @returns {void}
97
+ * @param sdkPromise - the Promise returned by an SDK method
103
98
  */
104
99
  function expectToBePromise(sdkPromise) {
105
100
  (0, expect_1.default)(typeof sdkPromise.then).toBe('function');
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2019, 2021.
2
+ * (C) Copyright IBM Corp. 2019, 2022.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@ import { Stream } from 'stream';
20
20
  * or array of text chunks
21
21
  * Essentially a smaller version of concat-stream wrapped in a promise
22
22
  *
23
- * @param {Stream} stream Optional stream param for when not bound to an existing stream instance.
24
- * @return {Promise}
23
+ * @param stream - optional stream param for when not bound to an existing stream instance.
24
+ * @returns Promise
25
25
  */
26
26
  export declare function streamToPromise(stream: Stream): Promise<any>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * (C) Copyright IBM Corp. 2019, 2021.
3
+ * (C) Copyright IBM Corp. 2019, 2022.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -21,8 +21,8 @@ exports.streamToPromise = void 0;
21
21
  * or array of text chunks
22
22
  * Essentially a smaller version of concat-stream wrapped in a promise
23
23
  *
24
- * @param {Stream} stream Optional stream param for when not bound to an existing stream instance.
25
- * @return {Promise}
24
+ * @param stream - optional stream param for when not bound to an existing stream instance.
25
+ * @returns Promise
26
26
  */
27
27
  function streamToPromise(stream) {
28
28
  stream = stream || this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ibm-cloud-sdk-core",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "description": "Core functionality to support SDKs generated with IBM's OpenAPI SDK Generator.",
5
5
  "main": "index.js",
6
6
  "typings": "./es/index.d.ts",
@@ -51,7 +51,7 @@
51
51
  "file-type": "16.5.4",
52
52
  "form-data": "^2.3.3",
53
53
  "isstream": "~0.1.2",
54
- "jsonwebtoken": "^8.5.1",
54
+ "jsonwebtoken": "^9.0.0",
55
55
  "lodash.isempty": "^4.4.0",
56
56
  "mime-types": "~2.1.18",
57
57
  "object.omit": "~3.0.0",