ibm-cloud-sdk-core 4.3.2-beta-1 → 4.3.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 (252) hide show
  1. package/.cra/.cveignore +2 -0
  2. package/.secrets.baseline +590 -0
  3. package/Authentication.md +600 -0
  4. package/CHANGELOG.md +879 -0
  5. package/LICENSE.md +201 -0
  6. package/MIGRATION-V4.md +54 -0
  7. package/README.md +118 -0
  8. package/api-extractor.json +39 -0
  9. package/appscan-config.xml +8 -0
  10. package/build/docs/ibm-cloud-sdk-core.atleastone.md +71 -0
  11. package/build/docs/ibm-cloud-sdk-core.atmostone.md +71 -0
  12. package/build/docs/ibm-cloud-sdk-core.authenticator._constructor_.md +18 -0
  13. package/build/docs/ibm-cloud-sdk-core.authenticator.authenticate.md +57 -0
  14. package/build/docs/ibm-cloud-sdk-core.authenticator.authenticationtype.md +19 -0
  15. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_basic.md +13 -0
  16. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_bearertoken.md +11 -0
  17. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_container.md +11 -0
  18. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_cp4d.md +11 -0
  19. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_iam.md +11 -0
  20. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_mcsp.md +11 -0
  21. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_noauth.md +11 -0
  22. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_unknown.md +11 -0
  23. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_vpc.md +11 -0
  24. package/build/docs/ibm-cloud-sdk-core.authenticator.md +294 -0
  25. package/build/docs/ibm-cloud-sdk-core.authenticatorinterface.authenticate.md +53 -0
  26. package/build/docs/ibm-cloud-sdk-core.authenticatorinterface.authenticationtype.md +17 -0
  27. package/build/docs/ibm-cloud-sdk-core.authenticatorinterface.md +50 -0
  28. package/build/docs/ibm-cloud-sdk-core.baseservice._constructor_.md +49 -0
  29. package/build/docs/ibm-cloud-sdk-core.baseservice.baseoptions.md +11 -0
  30. package/build/docs/ibm-cloud-sdk-core.baseservice.configureservice.md +53 -0
  31. package/build/docs/ibm-cloud-sdk-core.baseservice.convertmodel.md +85 -0
  32. package/build/docs/ibm-cloud-sdk-core.baseservice.createrequest.md +55 -0
  33. package/build/docs/ibm-cloud-sdk-core.baseservice.createrequestanddeserializeresponse.md +87 -0
  34. package/build/docs/ibm-cloud-sdk-core.baseservice.default_service_name.md +11 -0
  35. package/build/docs/ibm-cloud-sdk-core.baseservice.default_service_url.md +11 -0
  36. package/build/docs/ibm-cloud-sdk-core.baseservice.disableretries.md +17 -0
  37. package/build/docs/ibm-cloud-sdk-core.baseservice.enableretries.md +53 -0
  38. package/build/docs/ibm-cloud-sdk-core.baseservice.getauthenticator.md +19 -0
  39. package/build/docs/ibm-cloud-sdk-core.baseservice.gethttpclient.md +17 -0
  40. package/build/docs/ibm-cloud-sdk-core.baseservice.md +313 -0
  41. package/build/docs/ibm-cloud-sdk-core.baseservice.setdefaultheaders.md +53 -0
  42. package/build/docs/ibm-cloud-sdk-core.baseservice.setenablegzipcompression.md +53 -0
  43. package/build/docs/ibm-cloud-sdk-core.baseservice.setserviceurl.md +53 -0
  44. package/build/docs/ibm-cloud-sdk-core.basicauthenticator._constructor_.md +54 -0
  45. package/build/docs/ibm-cloud-sdk-core.basicauthenticator.authenticate.md +55 -0
  46. package/build/docs/ibm-cloud-sdk-core.basicauthenticator.authenticationtype.md +19 -0
  47. package/build/docs/ibm-cloud-sdk-core.basicauthenticator.authheader.md +13 -0
  48. package/build/docs/ibm-cloud-sdk-core.basicauthenticator.md +165 -0
  49. package/build/docs/ibm-cloud-sdk-core.basicauthenticator.requiredoptions.md +11 -0
  50. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator._constructor_.md +54 -0
  51. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.authenticate.md +55 -0
  52. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.authenticationtype.md +19 -0
  53. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.md +160 -0
  54. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.requiredoptions.md +11 -0
  55. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.setbearertoken.md +53 -0
  56. package/build/docs/ibm-cloud-sdk-core.buildrequestfileobject.md +55 -0
  57. package/build/docs/ibm-cloud-sdk-core.checkcredentials.md +71 -0
  58. package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator._constructor_.md +54 -0
  59. package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator.authenticationtype.md +19 -0
  60. package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator.md +149 -0
  61. package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator.requiredoptions.md +11 -0
  62. package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator.tokenmanager.md +11 -0
  63. package/build/docs/ibm-cloud-sdk-core.computebasicauthheader.md +71 -0
  64. package/build/docs/ibm-cloud-sdk-core.constructfilepath.md +49 -0
  65. package/build/docs/ibm-cloud-sdk-core.constructserviceurl.md +87 -0
  66. package/build/docs/ibm-cloud-sdk-core.containerauthenticator._constructor_.md +54 -0
  67. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.authenticationtype.md +19 -0
  68. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.md +172 -0
  69. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setcrtokenfilename.md +53 -0
  70. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setiamprofileid.md +53 -0
  71. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setiamprofilename.md +53 -0
  72. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.tokenmanager.md +11 -0
  73. package/build/docs/ibm-cloud-sdk-core.containertokenmanager._constructor_.md +54 -0
  74. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.getcrtoken.md +19 -0
  75. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.md +142 -0
  76. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.requesttoken.md +17 -0
  77. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.setcrtokenfilename.md +53 -0
  78. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.setiamprofileid.md +53 -0
  79. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.setiamprofilename.md +53 -0
  80. package/build/docs/ibm-cloud-sdk-core.contenttype.md +14 -0
  81. package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager._constructor_.md +54 -0
  82. package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager.md +128 -0
  83. package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager.requesttoken.md +15 -0
  84. package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager.requiredoptions.md +11 -0
  85. package/build/docs/ibm-cloud-sdk-core.fileexistsatpath.md +49 -0
  86. package/build/docs/ibm-cloud-sdk-core.fileobject.md +80 -0
  87. package/build/docs/ibm-cloud-sdk-core.fileobject.options.md +11 -0
  88. package/build/docs/ibm-cloud-sdk-core.fileobject.value.md +11 -0
  89. package/build/docs/ibm-cloud-sdk-core.fileoptions.contenttype.md +11 -0
  90. package/build/docs/ibm-cloud-sdk-core.fileoptions.filename.md +11 -0
  91. package/build/docs/ibm-cloud-sdk-core.fileoptions.md +74 -0
  92. package/build/docs/ibm-cloud-sdk-core.filestream.md +54 -0
  93. package/build/docs/ibm-cloud-sdk-core.filestream.path.md +11 -0
  94. package/build/docs/ibm-cloud-sdk-core.filewithmetadata.contenttype.md +11 -0
  95. package/build/docs/ibm-cloud-sdk-core.filewithmetadata.data.md +11 -0
  96. package/build/docs/ibm-cloud-sdk-core.filewithmetadata.filename.md +11 -0
  97. package/build/docs/ibm-cloud-sdk-core.filewithmetadata.md +87 -0
  98. package/build/docs/ibm-cloud-sdk-core.getauthenticatorfromenvironment.md +55 -0
  99. package/build/docs/ibm-cloud-sdk-core.getcontenttype.md +55 -0
  100. package/build/docs/ibm-cloud-sdk-core.getcurrenttime.md +19 -0
  101. package/build/docs/ibm-cloud-sdk-core.getformat.md +69 -0
  102. package/build/docs/ibm-cloud-sdk-core.getmissingparams.md +73 -0
  103. package/build/docs/ibm-cloud-sdk-core.getnewlogger.md +59 -0
  104. package/build/docs/ibm-cloud-sdk-core.getqueryparam.md +71 -0
  105. package/build/docs/ibm-cloud-sdk-core.iamauthenticator._constructor_.md +54 -0
  106. package/build/docs/ibm-cloud-sdk-core.iamauthenticator.authenticationtype.md +19 -0
  107. package/build/docs/ibm-cloud-sdk-core.iamauthenticator.md +149 -0
  108. package/build/docs/ibm-cloud-sdk-core.iamauthenticator.requiredoptions.md +11 -0
  109. package/build/docs/ibm-cloud-sdk-core.iamauthenticator.tokenmanager.md +11 -0
  110. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator._constructor_.md +54 -0
  111. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.clientid.md +11 -0
  112. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.clientsecret.md +11 -0
  113. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.getrefreshtoken.md +19 -0
  114. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.md +211 -0
  115. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.scope.md +11 -0
  116. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.setclientidandsecret.md +69 -0
  117. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.setscope.md +53 -0
  118. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.tokenmanager.md +11 -0
  119. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager._constructor_.md +54 -0
  120. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.formdata.md +11 -0
  121. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.getrefreshtoken.md +19 -0
  122. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.istokenexpired.md +19 -0
  123. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.md +221 -0
  124. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.refreshtoken.md +11 -0
  125. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.requesttoken.md +19 -0
  126. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.savetokeninfo.md +53 -0
  127. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.setclientidandsecret.md +69 -0
  128. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.setscope.md +53 -0
  129. package/build/docs/ibm-cloud-sdk-core.iamrequestoptions.clientid.md +11 -0
  130. package/build/docs/ibm-cloud-sdk-core.iamrequestoptions.clientsecret.md +11 -0
  131. package/build/docs/ibm-cloud-sdk-core.iamrequestoptions.md +96 -0
  132. package/build/docs/ibm-cloud-sdk-core.iamrequestoptions.scope.md +11 -0
  133. package/build/docs/ibm-cloud-sdk-core.iamtokenmanager._constructor_.md +54 -0
  134. package/build/docs/ibm-cloud-sdk-core.iamtokenmanager.md +92 -0
  135. package/build/docs/ibm-cloud-sdk-core.iamtokenmanager.requiredoptions.md +11 -0
  136. package/build/docs/ibm-cloud-sdk-core.isemptyobject.md +49 -0
  137. package/build/docs/ibm-cloud-sdk-core.isfiledata.md +49 -0
  138. package/build/docs/ibm-cloud-sdk-core.isfilewithmetadata.md +49 -0
  139. package/build/docs/ibm-cloud-sdk-core.ishtml.md +55 -0
  140. package/build/docs/ibm-cloud-sdk-core.isjsonmimetype.md +55 -0
  141. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager._constructor_.md +49 -0
  142. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.md +163 -0
  143. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.requesttoken.md +19 -0
  144. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.savetokeninfo.md +53 -0
  145. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.tokeninfo.md +11 -0
  146. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.tokenname.md +11 -0
  147. package/build/docs/ibm-cloud-sdk-core.jwttokenmanageroptions.md +15 -0
  148. package/build/docs/ibm-cloud-sdk-core.mcspauthenticator._constructor_.md +54 -0
  149. package/build/docs/ibm-cloud-sdk-core.mcspauthenticator.authenticationtype.md +19 -0
  150. package/build/docs/ibm-cloud-sdk-core.mcspauthenticator.md +145 -0
  151. package/build/docs/ibm-cloud-sdk-core.mcspauthenticator.requiredoptions.md +11 -0
  152. package/build/docs/ibm-cloud-sdk-core.mcspauthenticator.tokenmanager.md +11 -0
  153. package/build/docs/ibm-cloud-sdk-core.mcsptokenmanager._constructor_.md +54 -0
  154. package/build/docs/ibm-cloud-sdk-core.mcsptokenmanager.md +128 -0
  155. package/build/docs/ibm-cloud-sdk-core.mcsptokenmanager.requesttoken.md +15 -0
  156. package/build/docs/ibm-cloud-sdk-core.mcsptokenmanager.requiredoptions.md +11 -0
  157. package/build/docs/ibm-cloud-sdk-core.md +818 -0
  158. package/build/docs/ibm-cloud-sdk-core.noauthauthenticator.authenticate.md +49 -0
  159. package/build/docs/ibm-cloud-sdk-core.noauthauthenticator.authenticationtype.md +19 -0
  160. package/build/docs/ibm-cloud-sdk-core.noauthauthenticator.md +60 -0
  161. package/build/docs/ibm-cloud-sdk-core.onlyone.md +71 -0
  162. package/build/docs/ibm-cloud-sdk-core.qs.md +21 -0
  163. package/build/docs/ibm-cloud-sdk-core.readcredentialsfile.md +17 -0
  164. package/build/docs/ibm-cloud-sdk-core.readcrtokenfile.md +49 -0
  165. package/build/docs/ibm-cloud-sdk-core.readexternalsources.md +55 -0
  166. package/build/docs/ibm-cloud-sdk-core.removesuffix.md +71 -0
  167. package/build/docs/ibm-cloud-sdk-core.sdklogger.debug.md +11 -0
  168. package/build/docs/ibm-cloud-sdk-core.sdklogger.error.md +11 -0
  169. package/build/docs/ibm-cloud-sdk-core.sdklogger.info.md +11 -0
  170. package/build/docs/ibm-cloud-sdk-core.sdklogger.md +121 -0
  171. package/build/docs/ibm-cloud-sdk-core.sdklogger.verbose.md +11 -0
  172. package/build/docs/ibm-cloud-sdk-core.sdklogger.warn.md +11 -0
  173. package/build/docs/ibm-cloud-sdk-core.streamtopromise.md +55 -0
  174. package/build/docs/ibm-cloud-sdk-core.striptrailingslash.md +55 -0
  175. package/build/docs/ibm-cloud-sdk-core.tokenmanager._constructor_.md +49 -0
  176. package/build/docs/ibm-cloud-sdk-core.tokenmanager.accesstoken.md +11 -0
  177. package/build/docs/ibm-cloud-sdk-core.tokenmanager.disablesslverification.md +11 -0
  178. package/build/docs/ibm-cloud-sdk-core.tokenmanager.expiretime.md +11 -0
  179. package/build/docs/ibm-cloud-sdk-core.tokenmanager.gettoken.md +17 -0
  180. package/build/docs/ibm-cloud-sdk-core.tokenmanager.headers.md +11 -0
  181. package/build/docs/ibm-cloud-sdk-core.tokenmanager.istokenexpired.md +17 -0
  182. package/build/docs/ibm-cloud-sdk-core.tokenmanager.md +352 -0
  183. package/build/docs/ibm-cloud-sdk-core.tokenmanager.pacedrequesttoken.md +19 -0
  184. package/build/docs/ibm-cloud-sdk-core.tokenmanager.refreshtime.md +11 -0
  185. package/build/docs/ibm-cloud-sdk-core.tokenmanager.requesttoken.md +19 -0
  186. package/build/docs/ibm-cloud-sdk-core.tokenmanager.requestwrapperinstance.md +11 -0
  187. package/build/docs/ibm-cloud-sdk-core.tokenmanager.savetokeninfo.md +53 -0
  188. package/build/docs/ibm-cloud-sdk-core.tokenmanager.setdisablesslverification.md +53 -0
  189. package/build/docs/ibm-cloud-sdk-core.tokenmanager.setheaders.md +53 -0
  190. package/build/docs/ibm-cloud-sdk-core.tokenmanager.url.md +11 -0
  191. package/build/docs/ibm-cloud-sdk-core.tokenmanager.useragent.md +11 -0
  192. package/build/docs/ibm-cloud-sdk-core.tokenmanageroptions.md +18 -0
  193. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator._constructor_.md +49 -0
  194. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.authenticate.md +55 -0
  195. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.disablesslverification.md +11 -0
  196. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.headers.md +11 -0
  197. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.md +217 -0
  198. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.setdisablesslverification.md +53 -0
  199. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.setheaders.md +53 -0
  200. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.tokenmanager.md +11 -0
  201. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.url.md +11 -0
  202. package/build/docs/ibm-cloud-sdk-core.tolowerkeys.md +55 -0
  203. package/build/docs/ibm-cloud-sdk-core.unittestutils.checkforsuccessfulexecution.md +53 -0
  204. package/build/docs/ibm-cloud-sdk-core.unittestutils.checkmediaheaders.md +85 -0
  205. package/build/docs/ibm-cloud-sdk-core.unittestutils.checkurlandmethod.md +85 -0
  206. package/build/docs/ibm-cloud-sdk-core.unittestutils.checkuserheader.md +85 -0
  207. package/build/docs/ibm-cloud-sdk-core.unittestutils.expecttobepromise.md +53 -0
  208. package/build/docs/ibm-cloud-sdk-core.unittestutils.getoptions.md +55 -0
  209. package/build/docs/ibm-cloud-sdk-core.unittestutils.md +86 -0
  210. package/build/docs/ibm-cloud-sdk-core.useroptions.authenticator.md +13 -0
  211. package/build/docs/ibm-cloud-sdk-core.useroptions.disablesslverification.md +13 -0
  212. package/build/docs/ibm-cloud-sdk-core.useroptions.headers.md +13 -0
  213. package/build/docs/ibm-cloud-sdk-core.useroptions.jar.md +13 -0
  214. package/build/docs/ibm-cloud-sdk-core.useroptions.md +171 -0
  215. package/build/docs/ibm-cloud-sdk-core.useroptions.serviceurl.md +13 -0
  216. package/build/docs/ibm-cloud-sdk-core.useroptions.url.md +13 -0
  217. package/build/docs/ibm-cloud-sdk-core.useroptions.version.md +13 -0
  218. package/build/docs/ibm-cloud-sdk-core.validateinput.md +73 -0
  219. package/build/docs/ibm-cloud-sdk-core.validateparams.md +89 -0
  220. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator._constructor_.md +54 -0
  221. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.authenticationtype.md +19 -0
  222. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.md +158 -0
  223. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.setiamprofilecrn.md +53 -0
  224. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.setiamprofileid.md +53 -0
  225. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.tokenmanager.md +11 -0
  226. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager._constructor_.md +54 -0
  227. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.istokenexpired.md +19 -0
  228. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.md +126 -0
  229. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.requesttoken.md +15 -0
  230. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.setiamprofilecrn.md +53 -0
  231. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.setiamprofileid.md +53 -0
  232. package/build/docs/index.md +29 -0
  233. package/es/lib/sdk-test-helpers.js +1 -0
  234. package/es/tsdoc-metadata.json +11 -0
  235. package/etc/ibm-cloud-sdk-core.api.md +517 -0
  236. package/lib/sdk-test-helpers.js +1 -0
  237. package/package.json +88 -61
  238. package/temp/ibm-cloud-sdk-core.api.json +8641 -0
  239. package/temp/ibm-cloud-sdk-core.api.md +517 -0
  240. package/tsconfig-es6.json +9 -0
  241. package/auth/user-temp/get-authenticator-from-environment.d.ts +0 -28
  242. package/auth/user-temp/get-authenticator-from-environment.js +0 -95
  243. package/auth/user-temp/index.d.ts +0 -25
  244. package/auth/user-temp/index.js +0 -30
  245. package/auth/user-temp/read-external-sources.d.ts +0 -11
  246. package/auth/user-temp/read-external-sources.js +0 -154
  247. package/es/auth/user-temp/get-authenticator-from-environment.d.ts +0 -28
  248. package/es/auth/user-temp/get-authenticator-from-environment.js +0 -91
  249. package/es/auth/user-temp/index.d.ts +0 -25
  250. package/es/auth/user-temp/index.js +0 -25
  251. package/es/auth/user-temp/read-external-sources.d.ts +0 -11
  252. package/es/auth/user-temp/read-external-sources.js +0 -144
@@ -1,30 +0,0 @@
1
- "use strict";
2
- /**
3
- * (C) Copyright IBM Corp. 2019, 2021.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.readExternalSources = exports.getAuthenticatorFromEnvironment = void 0;
19
- /**
20
- * @module utils
21
- * Helper functions used by generated SDKs.
22
- *
23
- * functions:
24
- * getAuthenticatorFromEnvironment: Get authenticator from external sources.
25
- * readExternalSources: Get config object from external sources.
26
- */
27
- var get_authenticator_from_environment_1 = require("./get-authenticator-from-environment");
28
- Object.defineProperty(exports, "getAuthenticatorFromEnvironment", { enumerable: true, get: function () { return get_authenticator_from_environment_1.getAuthenticatorFromEnvironment; } });
29
- var read_external_sources_1 = require("./read-external-sources");
30
- Object.defineProperty(exports, "readExternalSources", { enumerable: true, get: function () { return read_external_sources_1.readExternalSources; } });
@@ -1,11 +0,0 @@
1
- /**
2
- * Read properties stored in external sources like Environment Variables,
3
- * the credentials file, VCAP services, etc. and return them as an
4
- * object. The keys of this object will have the service name prefix removed
5
- * and will be converted to lower camel case.
6
- *
7
- * Only one source will be used at a time.
8
- *
9
- * @param serviceName - the service name prefix
10
- */
11
- export declare function readExternalSources(serviceName: string): any;
@@ -1,154 +0,0 @@
1
- "use strict";
2
- /* eslint-disable no-restricted-syntax */
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.readExternalSources = void 0;
8
- /**
9
- * (C) Copyright IBM Corp. 2019, 2022.
10
- *
11
- * Licensed under the Apache License, Version 2.0 (the "License");
12
- * you may not use this file except in compliance with the License.
13
- * You may obtain a copy of the License at
14
- *
15
- * http://www.apache.org/licenses/LICENSE-2.0
16
- *
17
- * Unless required by applicable law or agreed to in writing, software
18
- * distributed under the License is distributed on an "AS IS" BASIS,
19
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
- * See the License for the specific language governing permissions and
21
- * limitations under the License.
22
- */
23
- var camelcase_1 = __importDefault(require("camelcase"));
24
- var lodash_isempty_1 = __importDefault(require("lodash.isempty"));
25
- var logger_1 = __importDefault(require("../../lib/logger"));
26
- var utils_1 = require("../utils");
27
- /**
28
- * Read properties stored in external sources like Environment Variables,
29
- * the credentials file, VCAP services, etc. and return them as an
30
- * object. The keys of this object will have the service name prefix removed
31
- * and will be converted to lower camel case.
32
- *
33
- * Only one source will be used at a time.
34
- *
35
- * @param serviceName - the service name prefix
36
- */
37
- function readExternalSources(serviceName) {
38
- if (!serviceName) {
39
- throw new Error('Service name is required.');
40
- }
41
- return getProperties(serviceName);
42
- }
43
- exports.readExternalSources = readExternalSources;
44
- function getProperties(serviceName) {
45
- // Try to get properties from external sources, with the following priority:
46
- // 1. Credentials file (ibm-credentials.env)
47
- // 2. Environment variables
48
- // 3. VCAP Services (Cloud Foundry)
49
- // only get properties from one source, return null if none found
50
- var properties = null;
51
- properties = filterPropertiesByServiceName((0, utils_1.readCredentialsFile)(), serviceName);
52
- if ((0, lodash_isempty_1.default)(properties)) {
53
- properties = filterPropertiesByServiceName(process.env, serviceName);
54
- }
55
- if ((0, lodash_isempty_1.default)(properties)) {
56
- properties = getPropertiesFromVCAP(serviceName);
57
- }
58
- return properties;
59
- }
60
- /**
61
- * Pulls credentials from env properties
62
- *
63
- * Property checked is uppercase service.name suffixed by _USERNAME and _PASSWORD
64
- *
65
- * For example, if service.name is speech_to_text,
66
- * env properties are SPEECH_TO_TEXT_USERNAME and SPEECH_TO_TEXT_PASSWORD
67
- *
68
- * @param envObj - the object containing the credentials keyed by environment variables
69
- * @returns the set of credentials
70
- */
71
- function filterPropertiesByServiceName(envObj, serviceName) {
72
- var credentials = {};
73
- var name = "".concat(serviceName.toUpperCase().replace(/-/g, '_'), "_"); // append the underscore that must follow the service name
74
- // filter out properties that don't begin with the service name
75
- Object.keys(envObj).forEach(function (key) {
76
- if (key.startsWith(name)) {
77
- var propName = (0, camelcase_1.default)(key.substring(name.length)); // remove the name from the front of the string and make camelcase
78
- credentials[propName] = envObj[key];
79
- }
80
- });
81
- // all env variables are parsed as strings, convert boolean vars as needed
82
- if (typeof credentials.disableSsl === 'string') {
83
- credentials.disableSsl = credentials.disableSsl === 'true';
84
- }
85
- if (typeof credentials.authDisableSsl === 'string') {
86
- credentials.authDisableSsl = credentials.authDisableSsl === 'true';
87
- }
88
- if (typeof credentials.enableGzip === 'string') {
89
- credentials.enableGzip = credentials.enableGzip === 'true';
90
- }
91
- if (typeof credentials.enableRetries === 'string') {
92
- credentials.enableRetries = credentials.enableRetries === 'true';
93
- }
94
- if (typeof credentials.maxRetries === 'string') {
95
- credentials.maxRetries = parseInt(credentials.maxRetries, 10);
96
- }
97
- if (typeof credentials.retryInterval === 'string') {
98
- credentials.retryInterval = parseInt(credentials.retryInterval, 10);
99
- }
100
- return credentials;
101
- }
102
- /**
103
- * Pulls credentials from VCAP_SERVICES env property that IBM Cloud sets
104
- *
105
- * The function will first look for a service entry whose "name" field matches
106
- * the serviceKey value. If found, return its credentials.
107
- *
108
- * If no match against the service entry's "name" field is found, then find the
109
- * service list with a key matching the serviceKey value. If found, return the
110
- * credentials of the first service in the service list.
111
- */
112
- function getVCAPCredentialsForService(name) {
113
- if (process.env.VCAP_SERVICES) {
114
- var services = JSON.parse(process.env.VCAP_SERVICES);
115
- for (var _i = 0, _a = Object.keys(services); _i < _a.length; _i++) {
116
- var serviceName = _a[_i];
117
- for (var _b = 0, _c = services[serviceName]; _b < _c.length; _b++) {
118
- var instance = _c[_b];
119
- if (instance.name === name) {
120
- if (Object.prototype.hasOwnProperty.call(instance, 'credentials')) {
121
- return instance.credentials;
122
- }
123
- logger_1.default.debug('no data read from VCAP_SERVICES');
124
- return {};
125
- }
126
- }
127
- }
128
- for (var _d = 0, _e = Object.keys(services); _d < _e.length; _d++) {
129
- var serviceName = _e[_d];
130
- if (serviceName === name) {
131
- if (services[serviceName].length > 0) {
132
- if (Object.prototype.hasOwnProperty.call(services[serviceName][0], 'credentials')) {
133
- return services[serviceName][0].credentials;
134
- }
135
- logger_1.default.debug('no data read from VCAP_SERVICES');
136
- return {};
137
- }
138
- logger_1.default.debug('no data read from VCAP_SERVICES');
139
- return {};
140
- }
141
- }
142
- }
143
- logger_1.default.debug('no data read from VCAP_SERVICES');
144
- return {};
145
- }
146
- function getPropertiesFromVCAP(serviceName) {
147
- var credentials = getVCAPCredentialsForService(serviceName);
148
- // infer authentication type from credentials in a simple manner
149
- // iam is used as the default later
150
- if (credentials.username || credentials.password) {
151
- credentials.authType = 'basic';
152
- }
153
- return credentials;
154
- }
@@ -1,28 +0,0 @@
1
- /**
2
- * (C) Copyright IBM Corp. 2019, 2022.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { Authenticator } from '../authenticators';
17
- /**
18
- * Look for external configuration of authenticator.
19
- *
20
- * Try to get authenticator from external sources, with the following priority:
21
- * 1. Credentials file (ibm-credentials.env)
22
- * 2. Environment variables
23
- * 3. VCAP Services (Cloud Foundry)
24
- *
25
- * @param serviceName - the service name prefix.
26
- *
27
- */
28
- export declare function getAuthenticatorFromEnvironment(serviceName: string): Authenticator;
@@ -1,91 +0,0 @@
1
- /**
2
- * (C) Copyright IBM Corp. 2019, 2022.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { Authenticator, BasicAuthenticator, BearerTokenAuthenticator, CloudPakForDataAuthenticator, IamAuthenticator, ContainerAuthenticator, NoAuthAuthenticator, VpcInstanceAuthenticator, } from '../authenticators';
17
- import { readExternalSources } from './read-external-sources';
18
- /**
19
- * Look for external configuration of authenticator.
20
- *
21
- * Try to get authenticator from external sources, with the following priority:
22
- * 1. Credentials file (ibm-credentials.env)
23
- * 2. Environment variables
24
- * 3. VCAP Services (Cloud Foundry)
25
- *
26
- * @param serviceName - the service name prefix.
27
- *
28
- */
29
- export function getAuthenticatorFromEnvironment(serviceName) {
30
- if (!serviceName) {
31
- throw new Error('Service name is required.');
32
- }
33
- // construct the credentials object from the environment
34
- const credentials = readExternalSources(serviceName);
35
- if (credentials === null) {
36
- throw new Error('Unable to create an authenticator from the environment.');
37
- }
38
- // remove client-level properties
39
- delete credentials.url;
40
- delete credentials.disableSsl;
41
- // convert "auth" properties to their proper keys
42
- if (credentials.authUrl) {
43
- credentials.url = credentials.authUrl;
44
- delete credentials.authUrl;
45
- }
46
- if (credentials.authDisableSsl) {
47
- credentials.disableSslVerification = credentials.authDisableSsl;
48
- delete credentials.authDisableSsl;
49
- }
50
- // in the situation where the auth type is not provided:
51
- // if an apikey is provided, default to IAM
52
- // if not, default to container auth
53
- let { authType } = credentials;
54
- if (!authType) {
55
- // Support the alternate "AUTHTYPE" config property.
56
- authType = credentials.authtype;
57
- }
58
- if (!authType || typeof authType !== 'string') {
59
- authType = credentials.apikey ? Authenticator.AUTHTYPE_IAM : Authenticator.AUTHTYPE_CONTAINER;
60
- }
61
- // Create and return the appropriate authenticator.
62
- let authenticator;
63
- // Compare the authType against our constants case-insensitively to
64
- // determine which authenticator type needs to be constructed.
65
- authType = authType.toLowerCase();
66
- if (authType === Authenticator.AUTHTYPE_NOAUTH.toLowerCase()) {
67
- authenticator = new NoAuthAuthenticator();
68
- }
69
- else if (authType === Authenticator.AUTHTYPE_BASIC.toLowerCase()) {
70
- authenticator = new BasicAuthenticator(credentials);
71
- }
72
- else if (authType === Authenticator.AUTHTYPE_BEARERTOKEN.toLowerCase()) {
73
- authenticator = new BearerTokenAuthenticator(credentials);
74
- }
75
- else if (authType === Authenticator.AUTHTYPE_CP4D.toLowerCase()) {
76
- authenticator = new CloudPakForDataAuthenticator(credentials);
77
- }
78
- else if (authType === Authenticator.AUTHTYPE_IAM.toLowerCase()) {
79
- authenticator = new IamAuthenticator(credentials);
80
- }
81
- else if (authType === Authenticator.AUTHTYPE_CONTAINER.toLowerCase()) {
82
- authenticator = new ContainerAuthenticator(credentials);
83
- }
84
- else if (authType === Authenticator.AUTHTYPE_VPC.toLowerCase()) {
85
- authenticator = new VpcInstanceAuthenticator(credentials);
86
- }
87
- else {
88
- throw new Error(`Invalid value for AUTH_TYPE: ${authType}`);
89
- }
90
- return authenticator;
91
- }
@@ -1,25 +0,0 @@
1
- /**
2
- * (C) Copyright IBM Corp. 2019, 2021.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- /**
17
- * @module utils
18
- * Helper functions used by generated SDKs.
19
- *
20
- * functions:
21
- * getAuthenticatorFromEnvironment: Get authenticator from external sources.
22
- * readExternalSources: Get config object from external sources.
23
- */
24
- export { getAuthenticatorFromEnvironment } from './get-authenticator-from-environment';
25
- export { readExternalSources } from './read-external-sources';
@@ -1,25 +0,0 @@
1
- /**
2
- * (C) Copyright IBM Corp. 2019, 2021.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- /**
17
- * @module utils
18
- * Helper functions used by generated SDKs.
19
- *
20
- * functions:
21
- * getAuthenticatorFromEnvironment: Get authenticator from external sources.
22
- * readExternalSources: Get config object from external sources.
23
- */
24
- export { getAuthenticatorFromEnvironment } from './get-authenticator-from-environment';
25
- export { readExternalSources } from './read-external-sources';
@@ -1,11 +0,0 @@
1
- /**
2
- * Read properties stored in external sources like Environment Variables,
3
- * the credentials file, VCAP services, etc. and return them as an
4
- * object. The keys of this object will have the service name prefix removed
5
- * and will be converted to lower camel case.
6
- *
7
- * Only one source will be used at a time.
8
- *
9
- * @param serviceName - the service name prefix
10
- */
11
- export declare function readExternalSources(serviceName: string): any;
@@ -1,144 +0,0 @@
1
- /* eslint-disable no-restricted-syntax */
2
- /**
3
- * (C) Copyright IBM Corp. 2019, 2022.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import camelcase from 'camelcase';
18
- import isEmpty from 'lodash.isempty';
19
- import logger from '../../lib/logger';
20
- import { readCredentialsFile } from '../utils';
21
- /**
22
- * Read properties stored in external sources like Environment Variables,
23
- * the credentials file, VCAP services, etc. and return them as an
24
- * object. The keys of this object will have the service name prefix removed
25
- * and will be converted to lower camel case.
26
- *
27
- * Only one source will be used at a time.
28
- *
29
- * @param serviceName - the service name prefix
30
- */
31
- export function readExternalSources(serviceName) {
32
- if (!serviceName) {
33
- throw new Error('Service name is required.');
34
- }
35
- return getProperties(serviceName);
36
- }
37
- function getProperties(serviceName) {
38
- // Try to get properties from external sources, with the following priority:
39
- // 1. Credentials file (ibm-credentials.env)
40
- // 2. Environment variables
41
- // 3. VCAP Services (Cloud Foundry)
42
- // only get properties from one source, return null if none found
43
- let properties = null;
44
- properties = filterPropertiesByServiceName(readCredentialsFile(), serviceName);
45
- if (isEmpty(properties)) {
46
- properties = filterPropertiesByServiceName(process.env, serviceName);
47
- }
48
- if (isEmpty(properties)) {
49
- properties = getPropertiesFromVCAP(serviceName);
50
- }
51
- return properties;
52
- }
53
- /**
54
- * Pulls credentials from env properties
55
- *
56
- * Property checked is uppercase service.name suffixed by _USERNAME and _PASSWORD
57
- *
58
- * For example, if service.name is speech_to_text,
59
- * env properties are SPEECH_TO_TEXT_USERNAME and SPEECH_TO_TEXT_PASSWORD
60
- *
61
- * @param envObj - the object containing the credentials keyed by environment variables
62
- * @returns the set of credentials
63
- */
64
- function filterPropertiesByServiceName(envObj, serviceName) {
65
- const credentials = {};
66
- const name = `${serviceName.toUpperCase().replace(/-/g, '_')}_`; // append the underscore that must follow the service name
67
- // filter out properties that don't begin with the service name
68
- Object.keys(envObj).forEach((key) => {
69
- if (key.startsWith(name)) {
70
- const propName = camelcase(key.substring(name.length)); // remove the name from the front of the string and make camelcase
71
- credentials[propName] = envObj[key];
72
- }
73
- });
74
- // all env variables are parsed as strings, convert boolean vars as needed
75
- if (typeof credentials.disableSsl === 'string') {
76
- credentials.disableSsl = credentials.disableSsl === 'true';
77
- }
78
- if (typeof credentials.authDisableSsl === 'string') {
79
- credentials.authDisableSsl = credentials.authDisableSsl === 'true';
80
- }
81
- if (typeof credentials.enableGzip === 'string') {
82
- credentials.enableGzip = credentials.enableGzip === 'true';
83
- }
84
- if (typeof credentials.enableRetries === 'string') {
85
- credentials.enableRetries = credentials.enableRetries === 'true';
86
- }
87
- if (typeof credentials.maxRetries === 'string') {
88
- credentials.maxRetries = parseInt(credentials.maxRetries, 10);
89
- }
90
- if (typeof credentials.retryInterval === 'string') {
91
- credentials.retryInterval = parseInt(credentials.retryInterval, 10);
92
- }
93
- return credentials;
94
- }
95
- /**
96
- * Pulls credentials from VCAP_SERVICES env property that IBM Cloud sets
97
- *
98
- * The function will first look for a service entry whose "name" field matches
99
- * the serviceKey value. If found, return its credentials.
100
- *
101
- * If no match against the service entry's "name" field is found, then find the
102
- * service list with a key matching the serviceKey value. If found, return the
103
- * credentials of the first service in the service list.
104
- */
105
- function getVCAPCredentialsForService(name) {
106
- if (process.env.VCAP_SERVICES) {
107
- const services = JSON.parse(process.env.VCAP_SERVICES);
108
- for (const serviceName of Object.keys(services)) {
109
- for (const instance of services[serviceName]) {
110
- if (instance.name === name) {
111
- if (Object.prototype.hasOwnProperty.call(instance, 'credentials')) {
112
- return instance.credentials;
113
- }
114
- logger.debug('no data read from VCAP_SERVICES');
115
- return {};
116
- }
117
- }
118
- }
119
- for (const serviceName of Object.keys(services)) {
120
- if (serviceName === name) {
121
- if (services[serviceName].length > 0) {
122
- if (Object.prototype.hasOwnProperty.call(services[serviceName][0], 'credentials')) {
123
- return services[serviceName][0].credentials;
124
- }
125
- logger.debug('no data read from VCAP_SERVICES');
126
- return {};
127
- }
128
- logger.debug('no data read from VCAP_SERVICES');
129
- return {};
130
- }
131
- }
132
- }
133
- logger.debug('no data read from VCAP_SERVICES');
134
- return {};
135
- }
136
- function getPropertiesFromVCAP(serviceName) {
137
- const credentials = getVCAPCredentialsForService(serviceName);
138
- // infer authentication type from credentials in a simple manner
139
- // iam is used as the default later
140
- if (credentials.username || credentials.password) {
141
- credentials.authType = 'basic';
142
- }
143
- return credentials;
144
- }