ibm-cloud-sdk-core 4.0.0 → 4.0.1

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 +9 -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 +25 -17
  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 +26 -18
  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
package/.secrets.baseline CHANGED
@@ -3,7 +3,7 @@
3
3
  "files": "package-lock.json|^.secrets.baseline$",
4
4
  "lines": null
5
5
  },
6
- "generated_at": "2022-04-04T16:42:23Z",
6
+ "generated_at": "2022-12-20T17:56:56Z",
7
7
  "plugins_used": [
8
8
  {
9
9
  "name": "AWSKeyDetector"
@@ -91,32 +91,32 @@
91
91
  "verified_result": null
92
92
  }
93
93
  ],
94
- "MIGRATION-V1.md": [
94
+ "README.md": [
95
95
  {
96
- "hashed_secret": "a00eada80f974d9446d54719567f67349cdc2d34",
96
+ "hashed_secret": "32e8612d8ca77c7ea8374aa7918db8e5df9252ed",
97
97
  "is_secret": false,
98
98
  "is_verified": false,
99
- "line_number": 19,
99
+ "line_number": 61,
100
100
  "type": "Secret Keyword",
101
101
  "verified_result": null
102
102
  }
103
103
  ],
104
- "README.md": [
104
+ "auth/authenticators/authenticator.ts": [
105
105
  {
106
- "hashed_secret": "32e8612d8ca77c7ea8374aa7918db8e5df9252ed",
106
+ "hashed_secret": "fdee05598fdd57ff8e9ae29e92c25a04f2c52fa6",
107
107
  "is_secret": false,
108
108
  "is_verified": false,
109
- "line_number": 61,
109
+ "line_number": 39,
110
110
  "type": "Secret Keyword",
111
111
  "verified_result": null
112
112
  }
113
113
  ],
114
- "auth/authenticators/authenticator.ts": [
114
+ "auth/authenticators/basic-authenticator.ts": [
115
115
  {
116
- "hashed_secret": "fdee05598fdd57ff8e9ae29e92c25a04f2c52fa6",
116
+ "hashed_secret": "bbccdf2efb33b52e6c9d0a14dd70b2d415fbea6e",
117
117
  "is_secret": false,
118
118
  "is_verified": false,
119
- "line_number": 39,
119
+ "line_number": 52,
120
120
  "type": "Secret Keyword",
121
121
  "verified_result": null
122
122
  }
@@ -162,7 +162,7 @@
162
162
  "hashed_secret": "45c43fe97e3a06ab078b0eeff6fbe622cc417a25",
163
163
  "is_secret": false,
164
164
  "is_verified": false,
165
- "line_number": 91,
165
+ "line_number": 89,
166
166
  "type": "Secret Keyword",
167
167
  "verified_result": null
168
168
  },
@@ -170,7 +170,7 @@
170
170
  "hashed_secret": "99833a8b234b57b886a9aef1dba187fdd7ceece8",
171
171
  "is_secret": false,
172
172
  "is_verified": false,
173
- "line_number": 93,
173
+ "line_number": 91,
174
174
  "type": "Secret Keyword",
175
175
  "verified_result": null
176
176
  }
@@ -224,7 +224,7 @@
224
224
  "hashed_secret": "f84f793e0af9ade37c8b927bc5091e98f35bf821",
225
225
  "is_secret": false,
226
226
  "is_verified": false,
227
- "line_number": 83,
227
+ "line_number": 84,
228
228
  "type": "Secret Keyword",
229
229
  "verified_result": null
230
230
  },
@@ -232,7 +232,7 @@
232
232
  "hashed_secret": "45c43fe97e3a06ab078b0eeff6fbe622cc417a25",
233
233
  "is_secret": false,
234
234
  "is_verified": false,
235
- "line_number": 120,
235
+ "line_number": 118,
236
236
  "type": "Secret Keyword",
237
237
  "verified_result": null
238
238
  },
@@ -240,7 +240,7 @@
240
240
  "hashed_secret": "99833a8b234b57b886a9aef1dba187fdd7ceece8",
241
241
  "is_secret": false,
242
242
  "is_verified": false,
243
- "line_number": 122,
243
+ "line_number": 120,
244
244
  "type": "Secret Keyword",
245
245
  "verified_result": null
246
246
  }
@@ -250,7 +250,7 @@
250
250
  "hashed_secret": "8f4bfc22c4fd7cb884f94ec175ff4a3284a174a1",
251
251
  "is_secret": false,
252
252
  "is_verified": false,
253
- "line_number": 58,
253
+ "line_number": 59,
254
254
  "type": "Secret Keyword",
255
255
  "verified_result": null
256
256
  },
@@ -258,7 +258,7 @@
258
258
  "hashed_secret": "0358c67856fb6a21c4767daf02fcb8fe4dc0a318",
259
259
  "is_secret": false,
260
260
  "is_verified": false,
261
- "line_number": 61,
261
+ "line_number": 62,
262
262
  "type": "Secret Keyword",
263
263
  "verified_result": null
264
264
  },
@@ -266,7 +266,7 @@
266
266
  "hashed_secret": "dbb19b8ae3b78f908e1467721fe4c9f0b0529d9b",
267
267
  "is_secret": false,
268
268
  "is_verified": false,
269
- "line_number": 62,
269
+ "line_number": 63,
270
270
  "type": "Secret Keyword",
271
271
  "verified_result": null
272
272
  }
@@ -296,21 +296,11 @@
296
296
  "hashed_secret": "45c43fe97e3a06ab078b0eeff6fbe622cc417a25",
297
297
  "is_secret": false,
298
298
  "is_verified": false,
299
- "line_number": 273,
299
+ "line_number": 278,
300
300
  "type": "Secret Keyword",
301
301
  "verified_result": null
302
302
  }
303
303
  ],
304
- "scripts/jsdoc/generate_index_html.sh": [
305
- {
306
- "hashed_secret": "973f71aa51bf4dcef6aa10f52089747a85c64a73",
307
- "is_secret": false,
308
- "is_verified": false,
309
- "line_number": 19,
310
- "type": "Base64 High Entropy String",
311
- "verified_result": null
312
- }
313
- ],
314
304
  "test/resources/ibm-credentials.env": [
315
305
  {
316
306
  "hashed_secret": "5c5a15a8b0b3e154d77746945e563ba40100681b",
@@ -534,7 +524,7 @@
534
524
  }
535
525
  ]
536
526
  },
537
- "version": "0.13.1+ibm.47.dss",
527
+ "version": "0.13.1+ibm.55.dss",
538
528
  "word_list": {
539
529
  "file": null,
540
530
  "hash": null
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [4.0.1](https://github.com/IBM/node-sdk-core/compare/v4.0.0...v4.0.1) (2022-12-29)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **auth:** migrate to secure usage of jwt for token authentication ([#225](https://github.com/IBM/node-sdk-core/issues/225)) ([10e0728](https://github.com/IBM/node-sdk-core/commit/10e07283cec2205eb6bda5723e63e5403d9b23f6))
7
+
1
8
  # [4.0.0](https://github.com/IBM/node-sdk-core/compare/v3.2.1...v4.0.0) (2022-12-20)
2
9
 
3
10
 
@@ -19,15 +26,13 @@
19
26
  ### BREAKING CHANGES
20
27
 
21
28
  * **deps-dev:** Minimum typescript version is 4.
22
-
23
29
  Upgrade to typescript 4.x.
24
30
 
25
- Signed-off-by: Rich Ellis <ricellis@users.noreply.github.com>
26
31
  * Minimum Node.js version is 14.
27
-
28
32
  Upgrade to at least Node.js 14.
29
33
 
30
- Signed-off-by: Rich Ellis <ricellis@users.noreply.github.com>
34
+ * **For assistance migrating to v4** - see the [migration guide](https://github.com/IBM/node-sdk-core/blob/main/MIGRATION-V4.md).
35
+
31
36
 
32
37
  ## [3.2.1](https://github.com/IBM/node-sdk-core/compare/v3.2.0...v3.2.1) (2022-10-21)
33
38
 
@@ -0,0 +1,54 @@
1
+ # Migration Guide for v4
2
+
3
+ ## Breaking Changes
4
+
5
+ ### Node Version
6
+ Node versions 12 is longer supported - 14 is the minimum version supported.
7
+
8
+ ### TypeScript Version
9
+ The `typescript` development dependnecy is now required to be at least version 4.
10
+
11
+ Run `npm install -D typescript@4` to upgrade to version 4.
12
+
13
+ Code produced by the IBM OpenAPI SDK Generator should already be compliant with TypeScript v4.
14
+
15
+ Additionally, you may need to upgrade `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser` to
16
+ v5 to be compatible with the new version of TypeScript. This upgrade should be safe and compatible.
17
+
18
+ Run `npm i -D '@typescript-eslint/eslint-plugin@latest' '@typescript-eslint/parser@latest'` to upgrade.
19
+
20
+ ### Jest Version
21
+ The `jest` development dependency is now required to be at least version 29.
22
+
23
+ Run `npm install -D jest@29` to upgrade to version 29.
24
+
25
+ Code produced by the IBM OpenAPI Generator should already be compliant with Jest v29.
26
+
27
+ Note: Ensure your test code does not contain the anti-pattern of using a `done` callback with an `async` function.
28
+ This is no longer permitted in Jest 29, whereas it was discouraged but permitted in previous versions. An old version of the IBM OpenAPI SDK Generator included a bug that generated this pattern. If your generated test code has not been updated since then, you may run into this issue.
29
+
30
+ Example diff showing proper resolution:
31
+ ```
32
+ diff --git a/test/integration/example.v1.test.js b/test/integration/example.v1.test.js
33
+ index be0bec3..62f03f8 100644
34
+ --- a/test/integration/example.v1.test.js
35
+ +++ b/test/integration/example.v1.test.js
36
+ @@ -38,7 +38,7 @@ describe('ExampleV1_integration', () => {
37
+ jest.setTimeout(timeout);
38
+ let example;
39
+
40
+ - beforeAll(async (done) => {
41
+ + beforeAll(async () => {
42
+ example = ExampleV1.newInstance({});
43
+
44
+ const config = readExternalSources(ExampleV1.DEFAULT_SERVICE_NAME);
45
+ @@ -58,8 +58,6 @@ describe('ExampleV1_integration', () => {
46
+
47
+ log(`Service URL: ${example.baseOptions.serviceUrl}`);
48
+ log('Finished setup.');
49
+ -
50
+ - done();
51
+ });
52
+
53
+ test('getSomething()', async () => {
54
+ ```
@@ -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.
@@ -34,9 +34,8 @@ export interface AuthenticatorInterface {
34
34
  /**
35
35
  * Add authentication information to the specified request.
36
36
  *
37
- * @param {object} requestOptions The request to augment with authentication information.
38
- * @param {object.<string, string>} requestOptions.headers The headers the
39
- * authentication information will be added to.
37
+ * @param requestOptions - The request to which authentication information is added
38
+ * (in the headers field).
40
39
  */
41
40
  authenticate(requestOptions: AuthenticateOptions): Promise<void>;
42
41
  /**
@@ -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.
@@ -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.
@@ -33,25 +33,21 @@ export declare class Authenticator implements AuthenticatorInterface {
33
33
  /**
34
34
  * Create a new Authenticator instance.
35
35
  *
36
- * @throws {Error} The `new` keyword was not used to create construct the
37
- * authenticator.
36
+ * @throws Error: the "new" keyword was not used to construct the authenticator.
38
37
  */
39
38
  constructor();
40
39
  /**
41
40
  * Augment the request with authentication information.
42
41
  *
43
- * @param {object} requestOptions - The request to augment with authentication information.
44
- * @param {object.<string, string>} requestOptions.headers - The headers the
45
- * authentication information will be added too.
46
- * @throws {Error} - The authenticate method was not implemented by a
47
- * subclass.
42
+ * @param requestOptions - The request to augment with authentication information.
43
+ * @throws Error: The authenticate method was not implemented by a subclass.
48
44
  */
49
45
  authenticate(requestOptions: AuthenticateOptions): Promise<void>;
50
46
  /**
51
47
  * Retrieves the authenticator's type.
52
48
  * The returned value will be the same string that is used
53
49
  * when configuring an instance of the authenticator with the
54
- * "<service_name>_AUTH_TYPE" configuration property
50
+ * \<service_name\>_AUTH_TYPE configuration property
55
51
  * (e.g. "basic", "iam", etc.).
56
52
  * This function should be overridden in each authenticator
57
53
  * implementation class that extends this class.
@@ -10,8 +10,7 @@ var Authenticator = /** @class */ (function () {
10
10
  /**
11
11
  * Create a new Authenticator instance.
12
12
  *
13
- * @throws {Error} The `new` keyword was not used to create construct the
14
- * authenticator.
13
+ * @throws Error: the "new" keyword was not used to construct the authenticator.
15
14
  */
16
15
  function Authenticator() {
17
16
  if (!(this instanceof Authenticator)) {
@@ -21,11 +20,8 @@ var Authenticator = /** @class */ (function () {
21
20
  /**
22
21
  * Augment the request with authentication information.
23
22
  *
24
- * @param {object} requestOptions - The request to augment with authentication information.
25
- * @param {object.<string, string>} requestOptions.headers - The headers the
26
- * authentication information will be added too.
27
- * @throws {Error} - The authenticate method was not implemented by a
28
- * subclass.
23
+ * @param requestOptions - The request to augment with authentication information.
24
+ * @throws Error: The authenticate method was not implemented by a subclass.
29
25
  */
30
26
  Authenticator.prototype.authenticate = function (requestOptions) {
31
27
  var error = new Error('Should be implemented by subclass!');
@@ -35,7 +31,7 @@ var Authenticator = /** @class */ (function () {
35
31
  * Retrieves the authenticator's type.
36
32
  * The returned value will be the same string that is used
37
33
  * when configuring an instance of the authenticator with the
38
- * "<service_name>_AUTH_TYPE" configuration property
34
+ * \<service_name\>_AUTH_TYPE configuration property
39
35
  * (e.g. "basic", "iam", etc.).
40
36
  * This function should be overridden in each authenticator
41
37
  * implementation class that extends this class.
@@ -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.
@@ -28,7 +28,7 @@ export type Options = {
28
28
  *
29
29
  * Basic Authorization will be sent as an Authorization header in the form:
30
30
  *
31
- * Authorization: Basic <encoded username and password>
31
+ * Authorization: Basic \<encoded username and password\>
32
32
  *
33
33
  */
34
34
  export declare class BasicAuthenticator extends Authenticator {
@@ -39,21 +39,21 @@ export declare class BasicAuthenticator extends Authenticator {
39
39
  /**
40
40
  * Create a new BasicAuthenticator instance.
41
41
  *
42
- * @param {object} options Configuration options for basic authentication.
43
- * @param {string} options.username The username portion of basic authentication.
44
- * @param {string} options.password The password portion of basic authentication.
45
- * @throws {Error} The configuration options are not valid.
42
+ * @param options - Configuration options for basic authentication.
43
+ * This should be an object containing these fields:
44
+ * - username: the username portion of basic authentication
45
+ * - password: the password portion of basic authentication
46
+ *
47
+ * @throws Error: the configuration options are not valid.
46
48
  */
47
49
  constructor(options: Options);
48
50
  /**
49
- * Add basic authentication information to `request`. The basic authentication information
50
- * will be set in the Authorization property of`request.headers` in the form:
51
+ * Add basic authentication information to `requestOptions`. The basic authentication information
52
+ * will be set in the Authorization property of `requestOptions.headers` in the form:
51
53
  *
52
- * Authorization: Basic <encoded username and password>
54
+ * Authorization: Basic \<encoded username and password\>
53
55
  *
54
- * @param {object} requestOptions - The request to augment with authentication information.
55
- * @param {object.<string, string>} requestOptions.headers - The headers the
56
- * authentication information will be added too.
56
+ * @param requestOptions - The request to augment with authentication information.
57
57
  */
58
58
  authenticate(requestOptions: AuthenticateOptions): Promise<void>;
59
59
  /**
@@ -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.
@@ -43,7 +43,7 @@ var authenticator_1 = require("./authenticator");
43
43
  *
44
44
  * Basic Authorization will be sent as an Authorization header in the form:
45
45
  *
46
- * Authorization: Basic <encoded username and password>
46
+ * Authorization: Basic \<encoded username and password\>
47
47
  *
48
48
  */
49
49
  var BasicAuthenticator = /** @class */ (function (_super) {
@@ -51,10 +51,12 @@ var BasicAuthenticator = /** @class */ (function (_super) {
51
51
  /**
52
52
  * Create a new BasicAuthenticator instance.
53
53
  *
54
- * @param {object} options Configuration options for basic authentication.
55
- * @param {string} options.username The username portion of basic authentication.
56
- * @param {string} options.password The password portion of basic authentication.
57
- * @throws {Error} The configuration options are not valid.
54
+ * @param options - Configuration options for basic authentication.
55
+ * This should be an object containing these fields:
56
+ * - username: the username portion of basic authentication
57
+ * - password: the password portion of basic authentication
58
+ *
59
+ * @throws Error: the configuration options are not valid.
58
60
  */
59
61
  function BasicAuthenticator(options) {
60
62
  var _this = _super.call(this) || this;
@@ -66,14 +68,12 @@ var BasicAuthenticator = /** @class */ (function (_super) {
66
68
  return _this;
67
69
  }
68
70
  /**
69
- * Add basic authentication information to `request`. The basic authentication information
70
- * will be set in the Authorization property of`request.headers` in the form:
71
+ * Add basic authentication information to `requestOptions`. The basic authentication information
72
+ * will be set in the Authorization property of `requestOptions.headers` in the form:
71
73
  *
72
- * Authorization: Basic <encoded username and password>
74
+ * Authorization: Basic \<encoded username and password\>
73
75
  *
74
- * @param {object} requestOptions - The request to augment with authentication information.
75
- * @param {object.<string, string>} requestOptions.headers - The headers the
76
- * authentication information will be added too.
76
+ * @param requestOptions - The request to augment with authentication information.
77
77
  */
78
78
  BasicAuthenticator.prototype.authenticate = function (requestOptions) {
79
79
  var _this = this;
@@ -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.
@@ -26,7 +26,7 @@ export type Options = {
26
26
  *
27
27
  * The bearer token will be sent as an Authorization header in the form:
28
28
  *
29
- * Authorization: Bearer <bearer-token>
29
+ * Authorization: Bearer \<bearer-token\>
30
30
  */
31
31
  export declare class BearerTokenAuthenticator extends Authenticator {
32
32
  protected requiredOptions: string[];
@@ -34,29 +34,26 @@ export declare class BearerTokenAuthenticator extends Authenticator {
34
34
  /**
35
35
  * Create a new BearerTokenAuthenticator instance.
36
36
  *
37
- * @param {object} options Configuration options for bearer authentication.
38
- * @param {string} options.bearerToken The bearer token to be added
39
- * to requests.
40
- * @throws {Error} The configuration bearerToken is not valid, or unspecified.
37
+ * @param options - Configuration options for bearer authentication.
38
+ * This should be an object containing the "bearerToken" field.
39
+ *
40
+ * @throws Error: the options.bearerToken field is not valid, or unspecified
41
41
  */
42
42
  constructor(options: Options);
43
43
  /**
44
44
  * Set a new bearer token to be sent in subsequent requests.
45
45
  *
46
- * @param {string} bearerToken The bearer token that will be sent in service
46
+ * @param bearerToken - The bearer token that will be sent in service
47
47
  * requests.
48
48
  */
49
49
  setBearerToken(bearerToken: string): void;
50
50
  /**
51
- * Add a bearer token to the `request`. The bearer token information
52
- * will be set in the Authorization property of`request.headers` in the form:
51
+ * Add a bearer token to `requestOptions`. The bearer token information
52
+ * will be set in the Authorization property of "requestOptions.headers" in the form:
53
53
  *
54
- * Authorization: Bearer <bearer-token>
54
+ * Authorization: Bearer \<bearer-token\>
55
55
  *
56
- * @param {object} requestOptions - The request to augment with authentication
57
- * information.
58
- * @param {object.<string, string>} requestOptions.headers - The headers the
59
- * authentication information will be added to.
56
+ * @param requestOptions - The request to augment with authentication information.
60
57
  */
61
58
  authenticate(requestOptions: AuthenticateOptions): Promise<void>;
62
59
  /**
@@ -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.
@@ -43,17 +43,17 @@ var authenticator_1 = require("./authenticator");
43
43
  *
44
44
  * The bearer token will be sent as an Authorization header in the form:
45
45
  *
46
- * Authorization: Bearer <bearer-token>
46
+ * Authorization: Bearer \<bearer-token\>
47
47
  */
48
48
  var BearerTokenAuthenticator = /** @class */ (function (_super) {
49
49
  __extends(BearerTokenAuthenticator, _super);
50
50
  /**
51
51
  * Create a new BearerTokenAuthenticator instance.
52
52
  *
53
- * @param {object} options Configuration options for bearer authentication.
54
- * @param {string} options.bearerToken The bearer token to be added
55
- * to requests.
56
- * @throws {Error} The configuration bearerToken is not valid, or unspecified.
53
+ * @param options - Configuration options for bearer authentication.
54
+ * This should be an object containing the "bearerToken" field.
55
+ *
56
+ * @throws Error: the options.bearerToken field is not valid, or unspecified
57
57
  */
58
58
  function BearerTokenAuthenticator(options) {
59
59
  var _this = _super.call(this) || this;
@@ -65,22 +65,19 @@ var BearerTokenAuthenticator = /** @class */ (function (_super) {
65
65
  /**
66
66
  * Set a new bearer token to be sent in subsequent requests.
67
67
  *
68
- * @param {string} bearerToken The bearer token that will be sent in service
68
+ * @param bearerToken - The bearer token that will be sent in service
69
69
  * requests.
70
70
  */
71
71
  BearerTokenAuthenticator.prototype.setBearerToken = function (bearerToken) {
72
72
  this.bearerToken = bearerToken;
73
73
  };
74
74
  /**
75
- * Add a bearer token to the `request`. The bearer token information
76
- * will be set in the Authorization property of`request.headers` in the form:
75
+ * Add a bearer token to `requestOptions`. The bearer token information
76
+ * will be set in the Authorization property of "requestOptions.headers" in the form:
77
77
  *
78
- * Authorization: Bearer <bearer-token>
78
+ * Authorization: Bearer \<bearer-token\>
79
79
  *
80
- * @param {object} requestOptions - The request to augment with authentication
81
- * information.
82
- * @param {object.<string, string>} requestOptions.headers - The headers the
83
- * authentication information will be added to.
80
+ * @param requestOptions - The request to augment with authentication information.
84
81
  */
85
82
  BearerTokenAuthenticator.prototype.authenticate = function (requestOptions) {
86
83
  var _this = this;
@@ -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.
@@ -27,12 +27,12 @@ export interface Options extends BaseOptions {
27
27
  url: string;
28
28
  }
29
29
  /**
30
- * The [[CloudPakForDataAuthenticator]] will either use a username/password pair or a username/apikey pair to obtain
30
+ * The CloudPakForDataAuthenticator will either use a username/password pair or a username/apikey pair to obtain
31
31
  * a bearer token from a token server. When the bearer token expires, a new token is obtained from the token server.
32
32
  *
33
33
  * The bearer token will be sent as an Authorization header in the form:
34
34
  *
35
- * Authorization: Bearer <bearer-token>
35
+ * Authorization: Bearer \<bearer-token\>
36
36
  */
37
37
  export declare class CloudPakForDataAuthenticator extends TokenRequestBasedAuthenticator {
38
38
  protected requiredOptions: string[];
@@ -41,19 +41,19 @@ export declare class CloudPakForDataAuthenticator extends TokenRequestBasedAuthe
41
41
  private password;
42
42
  private apikey;
43
43
  /**
44
- * Create a new [[CloudPakForDataAuthenticator]] instance.
44
+ * Create a new CloudPakForDataAuthenticator instance.
45
45
  *
46
- * @param {object} options Configuration options for CloudPakForData authentication.
47
- * @param {string} options.url For HTTP token requests.
48
- * @param {string} options.username The username used to obtain a bearer token.
49
- * @param {string} [options.password] The password used to obtain a bearer token [required if apikey not specified].
50
- * @param {string} [options.apikey] The API key used to obtain a bearer token [required if password not specified].
51
- * @param {boolean} [options.disableSslVerification] A flag that indicates
52
- * whether verification of the token server's SSL certificate should be
53
- * disabled or not
54
- * @param {object<string, string>} [options.headers] to be sent with every.
55
- * @throws `Error` The username, password, and/or url are not valid, or unspecified, for Cloud Pak For Data token
56
- * requests.
46
+ * @param options - Configuration options for CloudPakForData authentication.
47
+ * This should be an object containing these fields:
48
+ * - url: (required) the endpoint URL for the CloudPakForData token service
49
+ * - username: (required) the username used to obtain a bearer token
50
+ * - password: (optional) the password used to obtain a bearer token (required if apikey is not specified)
51
+ * - apikey: (optional) the API key used to obtain a bearer token (required if password is not specified)
52
+ * - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
53
+ * should be disabled or not
54
+ * - headers: (optional) a set of HTTP headers to be sent with each request to the token service
55
+ *
56
+ * @throws Error: the username, password, and/or url are not valid, or unspecified, for Cloud Pak For Data token requests.
57
57
  */
58
58
  constructor(options: Options);
59
59
  /**