@okta/okta-auth-js 5.5.0 → 5.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (424) hide show
  1. package/CHANGELOG.md +66 -4
  2. package/README.md +61 -15
  3. package/cjs/AuthStateManager.js +5 -0
  4. package/cjs/AuthStateManager.js.map +1 -1
  5. package/cjs/OktaAuth.js +78 -29
  6. package/cjs/OktaAuth.js.map +1 -1
  7. package/cjs/OktaUserAgent.js +2 -2
  8. package/cjs/StorageManager.js +16 -0
  9. package/cjs/StorageManager.js.map +1 -1
  10. package/cjs/TransactionManager.js +49 -9
  11. package/cjs/TransactionManager.js.map +1 -1
  12. package/cjs/builderUtil.js +6 -0
  13. package/cjs/builderUtil.js.map +1 -1
  14. package/cjs/constants.js +5 -1
  15. package/cjs/constants.js.map +1 -1
  16. package/cjs/features.js +1 -1
  17. package/cjs/features.js.map +1 -1
  18. package/cjs/idx/authenticate.js +3 -18
  19. package/cjs/idx/authenticate.js.map +1 -1
  20. package/cjs/idx/flow/AuthenticationFlow.js +30 -0
  21. package/cjs/idx/flow/AuthenticationFlow.js.map +1 -0
  22. package/cjs/idx/{flowMonitors → flow}/AuthenticationFlowMonitor.js +0 -0
  23. package/cjs/idx/flow/AuthenticationFlowMonitor.js.map +1 -0
  24. package/cjs/idx/{flowMonitors → flow}/FlowMonitor.js +0 -0
  25. package/cjs/idx/flow/FlowMonitor.js.map +1 -0
  26. package/cjs/idx/flow/FlowSpecification.js +49 -0
  27. package/cjs/idx/flow/FlowSpecification.js.map +1 -0
  28. package/cjs/idx/flow/PasswordRecoveryFlow.js +28 -0
  29. package/cjs/idx/flow/PasswordRecoveryFlow.js.map +1 -0
  30. package/cjs/idx/{flowMonitors → flow}/PasswordRecoveryFlowMonitor.js +0 -0
  31. package/cjs/idx/flow/PasswordRecoveryFlowMonitor.js.map +1 -0
  32. package/{esm/crypto/browser.js → cjs/idx/flow/RegistrationFlow.js} +15 -12
  33. package/cjs/idx/flow/RegistrationFlow.js.map +1 -0
  34. package/cjs/idx/{flowMonitors → flow}/RegistrationFlowMonitor.js +0 -0
  35. package/cjs/idx/flow/RegistrationFlowMonitor.js.map +1 -0
  36. package/cjs/idx/flow/RemediationFlow.js +2 -0
  37. package/{esm/types/Cookies.js.map → cjs/idx/flow/RemediationFlow.js.map} +1 -1
  38. package/cjs/idx/flow/index.js +119 -0
  39. package/cjs/idx/flow/index.js.map +1 -0
  40. package/cjs/idx/index.js +26 -0
  41. package/cjs/idx/index.js.map +1 -1
  42. package/cjs/idx/interact.js +5 -2
  43. package/cjs/idx/interact.js.map +1 -1
  44. package/cjs/idx/introspect.js +24 -7
  45. package/cjs/idx/introspect.js.map +1 -1
  46. package/cjs/idx/proceed.js +49 -0
  47. package/cjs/idx/proceed.js.map +1 -0
  48. package/cjs/idx/recoverPassword.js +3 -17
  49. package/cjs/idx/recoverPassword.js.map +1 -1
  50. package/cjs/idx/register.js +7 -16
  51. package/cjs/idx/register.js.map +1 -1
  52. package/cjs/idx/remediate.js +46 -52
  53. package/cjs/idx/remediate.js.map +1 -1
  54. package/cjs/idx/remediators/Base/AuthenticatorData.js +7 -7
  55. package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
  56. package/cjs/idx/remediators/Base/Remediator.js +13 -7
  57. package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
  58. package/cjs/idx/remediators/Base/SelectAuthenticator.js +6 -6
  59. package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
  60. package/cjs/idx/remediators/Base/VerifyAuthenticator.js +18 -14
  61. package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
  62. package/cjs/idx/remediators/EnrollProfile.js +14 -0
  63. package/cjs/idx/remediators/EnrollProfile.js.map +1 -1
  64. package/cjs/idx/remediators/Identify.js +7 -3
  65. package/cjs/idx/remediators/Identify.js.map +1 -1
  66. package/cjs/idx/remediators/ReEnrollAuthenticator.js +1 -1
  67. package/cjs/idx/remediators/ReEnrollAuthenticator.js.map +1 -1
  68. package/cjs/idx/run.js +36 -8
  69. package/cjs/idx/run.js.map +1 -1
  70. package/cjs/idx/startTransaction.js +2 -0
  71. package/cjs/idx/startTransaction.js.map +1 -1
  72. package/cjs/idx/transactionMeta.js +80 -40
  73. package/cjs/idx/transactionMeta.js.map +1 -1
  74. package/cjs/idx/types/FlowIdentifier.js +2 -0
  75. package/{esm/types/AuthState.js.map → cjs/idx/types/FlowIdentifier.js.map} +1 -1
  76. package/cjs/idx/types/idx-js.js +5 -0
  77. package/cjs/idx/types/idx-js.js.map +1 -1
  78. package/cjs/idx/types/index.js +33 -6
  79. package/cjs/idx/types/index.js.map +1 -1
  80. package/cjs/oidc/endpoints/authorize.js +4 -1
  81. package/cjs/oidc/endpoints/authorize.js.map +1 -1
  82. package/cjs/oidc/getToken.js +14 -9
  83. package/cjs/oidc/getToken.js.map +1 -1
  84. package/cjs/oidc/getWithPopup.js +9 -2
  85. package/cjs/oidc/getWithPopup.js.map +1 -1
  86. package/cjs/oidc/getWithRedirect.js.map +1 -1
  87. package/cjs/oidc/parseFromUrl.js +59 -20
  88. package/cjs/oidc/parseFromUrl.js.map +1 -1
  89. package/cjs/oidc/renewTokens.js +28 -5
  90. package/cjs/oidc/renewTokens.js.map +1 -1
  91. package/cjs/oidc/util/browser.js +1 -13
  92. package/cjs/oidc/util/browser.js.map +1 -1
  93. package/cjs/oidc/util/loginRedirect.js +9 -5
  94. package/cjs/oidc/util/loginRedirect.js.map +1 -1
  95. package/cjs/oidc/util/urlParams.js +1 -1
  96. package/cjs/oidc/util/urlParams.js.map +1 -1
  97. package/cjs/options.js +15 -2
  98. package/cjs/options.js.map +1 -1
  99. package/cjs/server/serverStorage.js +2 -1
  100. package/cjs/server/serverStorage.js.map +1 -1
  101. package/cjs/tx/AuthTransaction.js +1 -3
  102. package/cjs/tx/AuthTransaction.js.map +1 -1
  103. package/cjs/tx/api.js +3 -0
  104. package/cjs/tx/api.js.map +1 -1
  105. package/cjs/types/Transaction.js.map +1 -1
  106. package/{esm/clock.js → cjs/util/emailVerify.js} +14 -18
  107. package/cjs/util/emailVerify.js.map +1 -0
  108. package/cjs/util/index.js +13 -0
  109. package/cjs/util/index.js.map +1 -1
  110. package/cjs/util/sharedStorage.js +54 -0
  111. package/cjs/util/sharedStorage.js.map +1 -0
  112. package/dist/okta-auth-js.min.js +2 -74
  113. package/dist/okta-auth-js.min.js.LICENSE.txt +32 -0
  114. package/dist/okta-auth-js.min.js.map +1 -1
  115. package/dist/okta-auth-js.polyfill.js +2 -18
  116. package/{esm/crypto/webcrypto.js → dist/okta-auth-js.polyfill.js.LICENSE.txt} +8 -4
  117. package/dist/okta-auth-js.polyfill.js.map +1 -1
  118. package/dist/okta-auth-js.umd.js +2 -74
  119. package/dist/okta-auth-js.umd.js.LICENSE.txt +32 -0
  120. package/dist/okta-auth-js.umd.js.map +1 -1
  121. package/esm/index.js +8368 -16
  122. package/esm/index.js.map +1 -1
  123. package/lib/AuthStateManager.d.ts +4 -2
  124. package/lib/OktaAuth.d.ts +9 -5
  125. package/lib/StorageManager.d.ts +2 -0
  126. package/lib/TransactionManager.d.ts +6 -1
  127. package/lib/constants.d.ts +2 -0
  128. package/lib/crypto/base64.d.ts +2 -2
  129. package/lib/crypto/oidcHash.d.ts +1 -1
  130. package/lib/crypto/verifyToken.d.ts +1 -1
  131. package/{esm/oidc/endpoints/index.js → lib/idx/flow/AuthenticationFlow.d.ts} +3 -5
  132. package/lib/idx/{flowMonitors → flow}/AuthenticationFlowMonitor.d.ts +0 -0
  133. package/lib/idx/{flowMonitors → flow}/FlowMonitor.d.ts +0 -0
  134. package/lib/idx/flow/FlowSpecification.d.ts +10 -0
  135. package/{esm/crypto/index.js → lib/idx/flow/PasswordRecoveryFlow.d.ts} +3 -6
  136. package/lib/idx/{flowMonitors → flow}/PasswordRecoveryFlowMonitor.d.ts +0 -0
  137. package/{esm/tx/TransactionState.js → lib/idx/flow/RegistrationFlow.d.ts} +3 -3
  138. package/lib/idx/{flowMonitors → flow}/RegistrationFlowMonitor.d.ts +0 -0
  139. package/lib/idx/flow/RemediationFlow.d.ts +13 -0
  140. package/lib/idx/{flowMonitors → flow}/index.d.ts +7 -2
  141. package/lib/idx/index.d.ts +2 -0
  142. package/lib/idx/introspect.d.ts +2 -1
  143. package/{esm/errors/AuthApiError.js → lib/idx/proceed.d.ts} +9 -19
  144. package/lib/idx/remediators/Base/AuthenticatorData.d.ts +2 -5
  145. package/lib/idx/remediators/Base/Remediator.d.ts +3 -6
  146. package/lib/idx/remediators/Base/SelectAuthenticator.d.ts +3 -6
  147. package/lib/idx/remediators/Base/VerifyAuthenticator.d.ts +1 -1
  148. package/lib/idx/remediators/EnrollProfile.d.ts +1 -0
  149. package/lib/idx/remediators/Identify.d.ts +2 -5
  150. package/lib/idx/run.d.ts +9 -9
  151. package/lib/idx/transactionMeta.d.ts +28 -4
  152. package/lib/idx/types/FlowIdentifier.d.ts +1 -0
  153. package/lib/idx/types/idx-js.d.ts +5 -0
  154. package/lib/idx/types/index.d.ts +28 -10
  155. package/lib/oidc/getToken.d.ts +2 -2
  156. package/lib/oidc/parseFromUrl.d.ts +4 -1
  157. package/lib/oidc/renewTokens.d.ts +0 -12
  158. package/lib/oidc/util/loginRedirect.d.ts +1 -1
  159. package/lib/types/AuthState.d.ts +1 -0
  160. package/lib/types/OktaAuthOptions.d.ts +3 -1
  161. package/lib/types/Transaction.d.ts +7 -1
  162. package/lib/types/api.d.ts +21 -5
  163. package/{esm/errors/AuthPollStopError.js → lib/util/emailVerify.d.ts} +5 -8
  164. package/lib/util/index.d.ts +1 -0
  165. package/lib/util/sharedStorage.d.ts +6 -0
  166. package/package.json +26 -13
  167. package/cjs/idx/flowMonitors/AuthenticationFlowMonitor.js.map +0 -1
  168. package/cjs/idx/flowMonitors/FlowMonitor.js.map +0 -1
  169. package/cjs/idx/flowMonitors/PasswordRecoveryFlowMonitor.js.map +0 -1
  170. package/cjs/idx/flowMonitors/RegistrationFlowMonitor.js.map +0 -1
  171. package/cjs/idx/flowMonitors/index.js +0 -54
  172. package/cjs/idx/flowMonitors/index.js.map +0 -1
  173. package/esm/AuthStateManager.js +0 -209
  174. package/esm/AuthStateManager.js.map +0 -1
  175. package/esm/OktaAuth.js +0 -665
  176. package/esm/OktaAuth.js.map +0 -1
  177. package/esm/OktaUserAgent.js +0 -49
  178. package/esm/OktaUserAgent.js.map +0 -1
  179. package/esm/PromiseQueue.js +0 -71
  180. package/esm/PromiseQueue.js.map +0 -1
  181. package/esm/SavedObject.js +0 -91
  182. package/esm/SavedObject.js.map +0 -1
  183. package/esm/StorageManager.js +0 -174
  184. package/esm/StorageManager.js.map +0 -1
  185. package/esm/TokenManager.js +0 -455
  186. package/esm/TokenManager.js.map +0 -1
  187. package/esm/TransactionManager.js +0 -289
  188. package/esm/TransactionManager.js.map +0 -1
  189. package/esm/browser/browserStorage.js +0 -256
  190. package/esm/browser/browserStorage.js.map +0 -1
  191. package/esm/browser/fingerprint.js +0 -74
  192. package/esm/browser/fingerprint.js.map +0 -1
  193. package/esm/builderUtil.js +0 -50
  194. package/esm/builderUtil.js.map +0 -1
  195. package/esm/clock.js.map +0 -1
  196. package/esm/constants.js +0 -34
  197. package/esm/constants.js.map +0 -1
  198. package/esm/crypto/base64.js +0 -66
  199. package/esm/crypto/base64.js.map +0 -1
  200. package/esm/crypto/browser.js.map +0 -1
  201. package/esm/crypto/index.js.map +0 -1
  202. package/esm/crypto/node.js +0 -54
  203. package/esm/crypto/node.js.map +0 -1
  204. package/esm/crypto/oidcHash.js +0 -27
  205. package/esm/crypto/oidcHash.js.map +0 -1
  206. package/esm/crypto/verifyToken.js +0 -39
  207. package/esm/crypto/verifyToken.js.map +0 -1
  208. package/esm/crypto/webcrypto.js.map +0 -1
  209. package/esm/errors/AuthApiError.js.map +0 -1
  210. package/esm/errors/AuthPollStopError.js.map +0 -1
  211. package/esm/errors/AuthSdkError.js +0 -29
  212. package/esm/errors/AuthSdkError.js.map +0 -1
  213. package/esm/errors/CustomError.js +0 -21
  214. package/esm/errors/CustomError.js.map +0 -1
  215. package/esm/errors/OAuthError.js +0 -22
  216. package/esm/errors/OAuthError.js.map +0 -1
  217. package/esm/errors/index.js +0 -22
  218. package/esm/errors/index.js.map +0 -1
  219. package/esm/features.js +0 -64
  220. package/esm/features.js.map +0 -1
  221. package/esm/fetch/fetchRequest.js +0 -92
  222. package/esm/fetch/fetchRequest.js.map +0 -1
  223. package/esm/http/headers.js +0 -17
  224. package/esm/http/headers.js.map +0 -1
  225. package/esm/http/index.js +0 -3
  226. package/esm/http/index.js.map +0 -1
  227. package/esm/http/request.js +0 -145
  228. package/esm/http/request.js.map +0 -1
  229. package/esm/idx/authenticate.js +0 -47
  230. package/esm/idx/authenticate.js.map +0 -1
  231. package/esm/idx/cancel.js +0 -32
  232. package/esm/idx/cancel.js.map +0 -1
  233. package/esm/idx/flowMonitors/AuthenticationFlowMonitor.js +0 -41
  234. package/esm/idx/flowMonitors/AuthenticationFlowMonitor.js.map +0 -1
  235. package/esm/idx/flowMonitors/FlowMonitor.js +0 -73
  236. package/esm/idx/flowMonitors/FlowMonitor.js.map +0 -1
  237. package/esm/idx/flowMonitors/PasswordRecoveryFlowMonitor.js +0 -57
  238. package/esm/idx/flowMonitors/PasswordRecoveryFlowMonitor.js.map +0 -1
  239. package/esm/idx/flowMonitors/RegistrationFlowMonitor.js +0 -28
  240. package/esm/idx/flowMonitors/RegistrationFlowMonitor.js.map +0 -1
  241. package/esm/idx/flowMonitors/index.js +0 -16
  242. package/esm/idx/flowMonitors/index.js.map +0 -1
  243. package/esm/idx/handleInteractionCodeRedirect.js +0 -64
  244. package/esm/idx/handleInteractionCodeRedirect.js.map +0 -1
  245. package/esm/idx/headers.js +0 -39
  246. package/esm/idx/headers.js.map +0 -1
  247. package/esm/idx/index.js +0 -20
  248. package/esm/idx/index.js.map +0 -1
  249. package/esm/idx/interact.js +0 -83
  250. package/esm/idx/interact.js.map +0 -1
  251. package/esm/idx/introspect.js +0 -45
  252. package/esm/idx/introspect.js.map +0 -1
  253. package/esm/idx/recoverPassword.js +0 -46
  254. package/esm/idx/recoverPassword.js.map +0 -1
  255. package/esm/idx/register.js +0 -63
  256. package/esm/idx/register.js.map +0 -1
  257. package/esm/idx/remediate.js +0 -303
  258. package/esm/idx/remediate.js.map +0 -1
  259. package/esm/idx/remediators/AuthenticatorEnrollmentData.js +0 -68
  260. package/esm/idx/remediators/AuthenticatorEnrollmentData.js.map +0 -1
  261. package/esm/idx/remediators/AuthenticatorVerificationData.js +0 -66
  262. package/esm/idx/remediators/AuthenticatorVerificationData.js.map +0 -1
  263. package/esm/idx/remediators/Base/AuthenticatorData.js +0 -105
  264. package/esm/idx/remediators/Base/AuthenticatorData.js.map +0 -1
  265. package/esm/idx/remediators/Base/Remediator.js +0 -216
  266. package/esm/idx/remediators/Base/Remediator.js.map +0 -1
  267. package/esm/idx/remediators/Base/SelectAuthenticator.js +0 -140
  268. package/esm/idx/remediators/Base/SelectAuthenticator.js.map +0 -1
  269. package/esm/idx/remediators/Base/VerifyAuthenticator.js +0 -62
  270. package/esm/idx/remediators/Base/VerifyAuthenticator.js.map +0 -1
  271. package/esm/idx/remediators/ChallengeAuthenticator.js +0 -18
  272. package/esm/idx/remediators/ChallengeAuthenticator.js.map +0 -1
  273. package/esm/idx/remediators/EnrollAuthenticator.js +0 -18
  274. package/esm/idx/remediators/EnrollAuthenticator.js.map +0 -1
  275. package/esm/idx/remediators/EnrollProfile.js +0 -62
  276. package/esm/idx/remediators/EnrollProfile.js.map +0 -1
  277. package/esm/idx/remediators/Identify.js +0 -85
  278. package/esm/idx/remediators/Identify.js.map +0 -1
  279. package/esm/idx/remediators/ReEnrollAuthenticator.js +0 -45
  280. package/esm/idx/remediators/ReEnrollAuthenticator.js.map +0 -1
  281. package/esm/idx/remediators/RedirectIdp.js +0 -38
  282. package/esm/idx/remediators/RedirectIdp.js.map +0 -1
  283. package/esm/idx/remediators/ResetAuthenticator.js +0 -18
  284. package/esm/idx/remediators/ResetAuthenticator.js.map +0 -1
  285. package/esm/idx/remediators/SelectAuthenticatorAuthenticate.js +0 -18
  286. package/esm/idx/remediators/SelectAuthenticatorAuthenticate.js.map +0 -1
  287. package/esm/idx/remediators/SelectAuthenticatorEnroll.js +0 -18
  288. package/esm/idx/remediators/SelectAuthenticatorEnroll.js.map +0 -1
  289. package/esm/idx/remediators/SelectEnrollProfile.js +0 -24
  290. package/esm/idx/remediators/SelectEnrollProfile.js.map +0 -1
  291. package/esm/idx/remediators/Skip.js +0 -23
  292. package/esm/idx/remediators/Skip.js.map +0 -1
  293. package/esm/idx/remediators/index.js +0 -26
  294. package/esm/idx/remediators/index.js.map +0 -1
  295. package/esm/idx/remediators/util.js +0 -35
  296. package/esm/idx/remediators/util.js.map +0 -1
  297. package/esm/idx/run.js +0 -201
  298. package/esm/idx/run.js.map +0 -1
  299. package/esm/idx/startTransaction.js +0 -27
  300. package/esm/idx/startTransaction.js.map +0 -1
  301. package/esm/idx/transactionMeta.js +0 -112
  302. package/esm/idx/transactionMeta.js.map +0 -1
  303. package/esm/idx/types/idx-js.js +0 -17
  304. package/esm/idx/types/idx-js.js.map +0 -1
  305. package/esm/idx/types/index.js +0 -34
  306. package/esm/idx/types/index.js.map +0 -1
  307. package/esm/oidc/decodeToken.js +0 -31
  308. package/esm/oidc/decodeToken.js.map +0 -1
  309. package/esm/oidc/endpoints/authorize.js +0 -61
  310. package/esm/oidc/endpoints/authorize.js.map +0 -1
  311. package/esm/oidc/endpoints/index.js.map +0 -1
  312. package/esm/oidc/endpoints/token.js +0 -97
  313. package/esm/oidc/endpoints/token.js.map +0 -1
  314. package/esm/oidc/endpoints/well-known.js +0 -58
  315. package/esm/oidc/endpoints/well-known.js.map +0 -1
  316. package/esm/oidc/exchangeCodeForTokens.js +0 -69
  317. package/esm/oidc/exchangeCodeForTokens.js.map +0 -1
  318. package/esm/oidc/getToken.js +0 -175
  319. package/esm/oidc/getToken.js.map +0 -1
  320. package/esm/oidc/getUserInfo.js +0 -82
  321. package/esm/oidc/getUserInfo.js.map +0 -1
  322. package/esm/oidc/getWithPopup.js +0 -28
  323. package/esm/oidc/getWithPopup.js.map +0 -1
  324. package/esm/oidc/getWithRedirect.js +0 -61
  325. package/esm/oidc/getWithRedirect.js.map +0 -1
  326. package/esm/oidc/getWithoutPrompt.js +0 -29
  327. package/esm/oidc/getWithoutPrompt.js.map +0 -1
  328. package/esm/oidc/handleOAuthResponse.js +0 -148
  329. package/esm/oidc/handleOAuthResponse.js.map +0 -1
  330. package/esm/oidc/index.js +0 -29
  331. package/esm/oidc/index.js.map +0 -1
  332. package/esm/oidc/parseFromUrl.js +0 -102
  333. package/esm/oidc/parseFromUrl.js.map +0 -1
  334. package/esm/oidc/renewToken.js +0 -85
  335. package/esm/oidc/renewToken.js.map +0 -1
  336. package/esm/oidc/renewTokens.js +0 -52
  337. package/esm/oidc/renewTokens.js.map +0 -1
  338. package/esm/oidc/renewTokensWithRefresh.js +0 -55
  339. package/esm/oidc/renewTokensWithRefresh.js.map +0 -1
  340. package/esm/oidc/revokeToken.js +0 -57
  341. package/esm/oidc/revokeToken.js.map +0 -1
  342. package/esm/oidc/util/browser.js +0 -85
  343. package/esm/oidc/util/browser.js.map +0 -1
  344. package/esm/oidc/util/defaultTokenParams.js +0 -42
  345. package/esm/oidc/util/defaultTokenParams.js.map +0 -1
  346. package/esm/oidc/util/errors.js +0 -31
  347. package/esm/oidc/util/errors.js.map +0 -1
  348. package/esm/oidc/util/index.js +0 -25
  349. package/esm/oidc/util/index.js.map +0 -1
  350. package/esm/oidc/util/loginRedirect.js +0 -84
  351. package/esm/oidc/util/loginRedirect.js.map +0 -1
  352. package/esm/oidc/util/oauth.js +0 -70
  353. package/esm/oidc/util/oauth.js.map +0 -1
  354. package/esm/oidc/util/pkce.js +0 -55
  355. package/esm/oidc/util/pkce.js.map +0 -1
  356. package/esm/oidc/util/prepareTokenParams.js +0 -75
  357. package/esm/oidc/util/prepareTokenParams.js.map +0 -1
  358. package/esm/oidc/util/refreshToken.js +0 -24
  359. package/esm/oidc/util/refreshToken.js.map +0 -1
  360. package/esm/oidc/util/urlParams.js +0 -54
  361. package/esm/oidc/util/urlParams.js.map +0 -1
  362. package/esm/oidc/util/validateClaims.js +0 -53
  363. package/esm/oidc/util/validateClaims.js.map +0 -1
  364. package/esm/oidc/util/validateToken.js +0 -21
  365. package/esm/oidc/util/validateToken.js.map +0 -1
  366. package/esm/oidc/verifyToken.js +0 -78
  367. package/esm/oidc/verifyToken.js.map +0 -1
  368. package/esm/options.js +0 -131
  369. package/esm/options.js.map +0 -1
  370. package/esm/server/serverStorage.js +0 -110
  371. package/esm/server/serverStorage.js.map +0 -1
  372. package/esm/services/TokenService.js +0 -103
  373. package/esm/services/TokenService.js.map +0 -1
  374. package/esm/session.js +0 -81
  375. package/esm/session.js.map +0 -1
  376. package/esm/tx/AuthTransaction.js +0 -215
  377. package/esm/tx/AuthTransaction.js.map +0 -1
  378. package/esm/tx/TransactionState.js.map +0 -1
  379. package/esm/tx/api.js +0 -84
  380. package/esm/tx/api.js.map +0 -1
  381. package/esm/tx/index.js +0 -18
  382. package/esm/tx/index.js.map +0 -1
  383. package/esm/tx/poll.js +0 -124
  384. package/esm/tx/poll.js.map +0 -1
  385. package/esm/tx/util.js +0 -26
  386. package/esm/tx/util.js.map +0 -1
  387. package/esm/types/AuthState.js +0 -3
  388. package/esm/types/Cookies.js +0 -3
  389. package/esm/types/EventEmitter.js +0 -3
  390. package/esm/types/EventEmitter.js.map +0 -1
  391. package/esm/types/JWT.js +0 -3
  392. package/esm/types/JWT.js.map +0 -1
  393. package/esm/types/OAuth.js +0 -3
  394. package/esm/types/OAuth.js.map +0 -1
  395. package/esm/types/OktaAuthOptions.js +0 -3
  396. package/esm/types/OktaAuthOptions.js.map +0 -1
  397. package/esm/types/Storage.js +0 -3
  398. package/esm/types/Storage.js.map +0 -1
  399. package/esm/types/Token.js +0 -29
  400. package/esm/types/Token.js.map +0 -1
  401. package/esm/types/TokenManager.js +0 -3
  402. package/esm/types/TokenManager.js.map +0 -1
  403. package/esm/types/Transaction.js +0 -57
  404. package/esm/types/Transaction.js.map +0 -1
  405. package/esm/types/UserClaims.js +0 -3
  406. package/esm/types/UserClaims.js.map +0 -1
  407. package/esm/types/api.js +0 -3
  408. package/esm/types/api.js.map +0 -1
  409. package/esm/types/http.js +0 -3
  410. package/esm/types/http.js.map +0 -1
  411. package/esm/types/index.js +0 -27
  412. package/esm/types/index.js.map +0 -1
  413. package/esm/util/console.js +0 -53
  414. package/esm/util/console.js.map +0 -1
  415. package/esm/util/index.js +0 -17
  416. package/esm/util/index.js.map +0 -1
  417. package/esm/util/misc.js +0 -33
  418. package/esm/util/misc.js.map +0 -1
  419. package/esm/util/object.js +0 -117
  420. package/esm/util/object.js.map +0 -1
  421. package/esm/util/types.js +0 -27
  422. package/esm/util/types.js.map +0 -1
  423. package/esm/util/url.js +0 -64
  424. package/esm/util/url.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"TokenManager.js"}
@@ -1,57 +0,0 @@
1
- /*!
2
- * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
- * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
- *
5
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
- * Unless required by applicable law or agreed to in writing, software
7
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
- *
10
- * See the License for the specific language governing permissions and limitations under the License.
11
- */
12
- // formerly known as "Redirect OAuth Params"
13
- function isObjectWithProperties(obj) {
14
- if (!obj || typeof obj !== 'object' || Object.values(obj).length === 0) {
15
- return false;
16
- }
17
-
18
- return true;
19
- }
20
-
21
- export function isOAuthTransactionMeta(obj) {
22
- if (!isObjectWithProperties(obj)) {
23
- return false;
24
- }
25
-
26
- return !!obj.redirectUri || !!obj.responseType;
27
- }
28
- export function isPKCETransactionMeta(obj) {
29
- if (!isOAuthTransactionMeta(obj)) {
30
- return false;
31
- }
32
-
33
- return !!obj.codeVerifier;
34
- }
35
- export function isIdxTransactionMeta(obj) {
36
- if (!isPKCETransactionMeta(obj)) {
37
- return false;
38
- }
39
-
40
- return !!obj.interactionHandle;
41
- }
42
- export function isCustomAuthTransactionMeta(obj) {
43
- if (!isObjectWithProperties(obj)) {
44
- return false;
45
- }
46
-
47
- var isAllStringValues = Object.values(obj).find(value => typeof value !== 'string') === undefined;
48
- return isAllStringValues;
49
- }
50
- export function isTransactionMeta(obj) {
51
- if (isOAuthTransactionMeta(obj) || isCustomAuthTransactionMeta(obj)) {
52
- return true;
53
- }
54
-
55
- return false;
56
- }
57
- //# sourceMappingURL=Transaction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/types/Transaction.ts"],"names":["isObjectWithProperties","obj","Object","values","length","isOAuthTransactionMeta","redirectUri","responseType","isPKCETransactionMeta","codeVerifier","isIdxTransactionMeta","interactionHandle","isCustomAuthTransactionMeta","isAllStringValues","find","value","undefined","isTransactionMeta"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAmBA;AAgCA,SAASA,sBAAT,CAAgCC,GAAhC,EAAqC;AACnC,MAAI,CAACA,GAAD,IAAQ,OAAOA,GAAP,KAAe,QAAvB,IAAmCC,MAAM,CAACC,MAAP,CAAcF,GAAd,EAAmBG,MAAnB,KAA8B,CAArE,EAAwE;AACtE,WAAO,KAAP;AACD;;AACD,SAAO,IAAP;AACD;;AAED,OAAO,SAASC,sBAAT,CAAgCJ,GAAhC,EAAuE;AAC5E,MAAI,CAACD,sBAAsB,CAACC,GAAD,CAA3B,EAAkC;AAChC,WAAO,KAAP;AACD;;AACD,SAAO,CAAC,CAACA,GAAG,CAACK,WAAN,IAAqB,CAAC,CAACL,GAAG,CAACM,YAAlC;AACD;AAED,OAAO,SAASC,qBAAT,CAA+BP,GAA/B,EAAqE;AAC1E,MAAI,CAACI,sBAAsB,CAACJ,GAAD,CAA3B,EAAkC;AAChC,WAAO,KAAP;AACD;;AACD,SAAO,CAAC,CAAEA,GAAD,CAAaQ,YAAtB;AACD;AAED,OAAO,SAASC,oBAAT,CAA8BT,GAA9B,EAAmE;AACxE,MAAI,CAACO,qBAAqB,CAACP,GAAD,CAA1B,EAAiC;AAC/B,WAAO,KAAP;AACD;;AACD,SAAO,CAAC,CAAEA,GAAD,CAAaU,iBAAtB;AACD;AAED,OAAO,SAASC,2BAAT,CAAqCX,GAArC,EAAiF;AACtF,MAAI,CAACD,sBAAsB,CAACC,GAAD,CAA3B,EAAkC;AAChC,WAAO,KAAP;AACD;;AACD,MAAMY,iBAAiB,GAAGX,MAAM,CAACC,MAAP,CAAcF,GAAd,EAAmBa,IAAnB,CAAyBC,KAAD,IAAY,OAAOA,KAAP,KAAiB,QAArD,MAAoEC,SAA9F;AACA,SAAOH,iBAAP;AACD;AAED,OAAO,SAASI,iBAAT,CAA2BhB,GAA3B,EAA6D;AAClE,MAAII,sBAAsB,CAACJ,GAAD,CAAtB,IAA+BW,2BAA2B,CAACX,GAAD,CAA9D,EAAqE;AACnE,WAAO,IAAP;AACD;;AACD,SAAO,KAAP;AACD","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport StorageManager from '../StorageManager';\nimport { CustomUrls } from './OktaAuthOptions';\n\nexport interface TransactionManagerOptions {\n storageManager: StorageManager;\n legacyWidgetSupport?: boolean; // default true\n saveNonceCookie?: boolean; // default true\n saveStateCookie?: boolean; // default true\n saveParamsCookie?: boolean; // default true\n}\n\nexport interface TransactionMetaOptions {\n pkce?: boolean;\n oauth?: boolean;\n}\n\n// formerly known as \"Redirect OAuth Params\"\nexport interface OAuthTransactionMeta {\n issuer: string;\n redirectUri: string;\n state: string;\n nonce: string;\n responseType: string | string [];\n scopes: string[];\n clientId: string;\n urls: CustomUrls;\n ignoreSignature: boolean;\n}\n\nexport interface PKCETransactionMeta extends OAuthTransactionMeta {\n codeVerifier: string;\n codeChallengeMethod: string;\n codeChallenge: string;\n}\n\nexport interface IdxTransactionMeta extends PKCETransactionMeta {\n interactionHandle?: string;\n remediations?: string[];\n}\n\nexport type CustomAuthTransactionMeta = Record<string, string | undefined>;\n\nexport type TransactionMeta =\n IdxTransactionMeta |\n PKCETransactionMeta |\n OAuthTransactionMeta |\n CustomAuthTransactionMeta;\n\nfunction isObjectWithProperties(obj) {\n if (!obj || typeof obj !== 'object' || Object.values(obj).length === 0) {\n return false;\n }\n return true;\n}\n\nexport function isOAuthTransactionMeta(obj: any): obj is OAuthTransactionMeta {\n if (!isObjectWithProperties(obj)) {\n return false;\n }\n return !!obj.redirectUri || !!obj.responseType;\n}\n\nexport function isPKCETransactionMeta(obj: any): obj is PKCETransactionMeta {\n if (!isOAuthTransactionMeta(obj)) {\n return false;\n }\n return !!(obj as any).codeVerifier;\n}\n\nexport function isIdxTransactionMeta(obj: any): obj is IdxTransactionMeta {\n if (!isPKCETransactionMeta(obj)) {\n return false;\n }\n return !!(obj as any).interactionHandle;\n}\n\nexport function isCustomAuthTransactionMeta(obj: any): obj is CustomAuthTransactionMeta {\n if (!isObjectWithProperties(obj)) {\n return false;\n }\n const isAllStringValues = Object.values(obj).find((value) => (typeof value !== 'string')) === undefined;\n return isAllStringValues;\n}\n\nexport function isTransactionMeta(obj: any): obj is TransactionMeta {\n if (isOAuthTransactionMeta(obj) || isCustomAuthTransactionMeta(obj)) {\n return true;\n }\n return false;\n}\n"],"file":"Transaction.js"}
@@ -1,3 +0,0 @@
1
- export {};
2
- export {};
3
- //# sourceMappingURL=UserClaims.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"UserClaims.js"}
package/esm/types/api.js DELETED
@@ -1,3 +0,0 @@
1
- export {};
2
- export {};
3
- //# sourceMappingURL=api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"api.js"}
package/esm/types/http.js DELETED
@@ -1,3 +0,0 @@
1
- export {};
2
- export {};
3
- //# sourceMappingURL=http.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"http.js"}
@@ -1,27 +0,0 @@
1
- /*!
2
- * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
- * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
- *
5
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
- * Unless required by applicable law or agreed to in writing, software
7
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
- *
10
- * See the License for the specific language governing permissions and limitations under the License.
11
- */
12
- export * from './api';
13
- export * from './AuthState';
14
- export * from './EventEmitter';
15
- export * from './Transaction';
16
- export * from './Cookies';
17
- export * from './http';
18
- export * from '../idx/types';
19
- export * from './JWT';
20
- export * from './OAuth';
21
- export * from './OktaAuthOptions';
22
- export * from './Storage';
23
- export * from './Token';
24
- export * from './TokenManager';
25
- export * from './UserClaims';
26
- export * from './AuthState';
27
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/types/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,cAAc,OAAd;AACA,cAAc,aAAd;AACA,cAAc,gBAAd;AACA,cAAc,eAAd;AACA,cAAc,WAAd;AACA,cAAc,QAAd;AACA,cAAc,cAAd;AACA,cAAc,OAAd;AACA,cAAc,SAAd;AACA,cAAc,mBAAd;AACA,cAAc,WAAd;AACA,cAAc,SAAd;AACA,cAAc,gBAAd;AACA,cAAc,cAAd;AACA,cAAc,aAAd","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport * from './api';\nexport * from './AuthState';\nexport * from './EventEmitter';\nexport * from './Transaction';\nexport * from './Cookies';\nexport * from './http';\nexport * from '../idx/types';\nexport * from './JWT';\nexport * from './OAuth';\nexport * from './OktaAuthOptions';\nexport * from './Storage';\nexport * from './Token';\nexport * from './TokenManager';\nexport * from './UserClaims';\nexport * from './AuthState';\n"],"file":"index.js"}
@@ -1,53 +0,0 @@
1
- /*!
2
- * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
- * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
- *
5
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
- * Unless required by applicable law or agreed to in writing, software
7
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
- *
10
- * See the License for the specific language governing permissions and limitations under the License.
11
- */
12
-
13
- /* global window */
14
- export function getNativeConsole() {
15
- if (typeof window !== 'undefined') {
16
- return window.console;
17
- } else if (typeof console !== 'undefined') {
18
- return console;
19
- } else {
20
- return undefined;
21
- }
22
- }
23
- export function getConsole() {
24
- var nativeConsole = getNativeConsole();
25
-
26
- if (nativeConsole && nativeConsole.log) {
27
- return nativeConsole;
28
- }
29
-
30
- return {
31
- log: function log() {},
32
- warn: function warn() {},
33
- group: function group() {},
34
- groupEnd: function groupEnd() {}
35
- };
36
- }
37
- export function warn(text) {
38
- /* eslint-disable no-console */
39
- getConsole().warn('[okta-auth-sdk] WARN: ' + text);
40
- /* eslint-enable */
41
- }
42
- export function deprecate(text) {
43
- /* eslint-disable no-console */
44
- getConsole().warn('[okta-auth-sdk] DEPRECATION: ' + text);
45
- /* eslint-enable */
46
- }
47
- export function deprecateWrap(text, fn) {
48
- return function () {
49
- deprecate(text);
50
- return fn.apply(null, arguments);
51
- };
52
- }
53
- //# sourceMappingURL=console.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/util/console.ts"],"names":["getNativeConsole","window","console","undefined","getConsole","nativeConsole","log","warn","group","groupEnd","text","deprecate","deprecateWrap","fn","apply","arguments"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AAEA,OAAO,SAASA,gBAAT,GAA4B;AACjC,MAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;AACjC,WAAOA,MAAM,CAACC,OAAd;AACD,GAFD,MAEO,IAAI,OAAOA,OAAP,KAAmB,WAAvB,EAAoC;AACzC,WAAOA,OAAP;AACD,GAFM,MAEA;AACL,WAAOC,SAAP;AACD;AACF;AAED,OAAO,SAASC,UAAT,GAAsB;AAC3B,MAAIC,aAAa,GAAGL,gBAAgB,EAApC;;AACA,MAAIK,aAAa,IAAIA,aAAa,CAACC,GAAnC,EAAwC;AACtC,WAAOD,aAAP;AACD;;AACD,SAAO;AACLC,IAAAA,GAAG,EAAE,eAAW,CAAE,CADb;AAELC,IAAAA,IAAI,EAAE,gBAAW,CAAE,CAFd;AAGLC,IAAAA,KAAK,EAAE,iBAAW,CAAE,CAHf;AAILC,IAAAA,QAAQ,EAAE,oBAAW,CAAE;AAJlB,GAAP;AAMD;AAED,OAAO,SAASF,IAAT,CAAcG,IAAd,EAAoB;AACzB;AACAN,EAAAA,UAAU,GAAGG,IAAb,CAAkB,2BAA2BG,IAA7C;AACA;AACD;AAED,OAAO,SAASC,SAAT,CAAmBD,IAAnB,EAAyB;AAC9B;AACAN,EAAAA,UAAU,GAAGG,IAAb,CAAkB,kCAAkCG,IAApD;AACA;AACD;AAED,OAAO,SAASE,aAAT,CAAuBF,IAAvB,EAA6BG,EAA7B,EAAiC;AACtC,SAAO,YAAW;AAChBF,IAAAA,SAAS,CAACD,IAAD,CAAT;AACA,WAAOG,EAAE,CAACC,KAAH,CAAS,IAAT,EAAeC,SAAf,CAAP;AACD,GAHD;AAID","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n/* global window */\n\nexport function getNativeConsole() {\n if (typeof window !== 'undefined') {\n return window.console;\n } else if (typeof console !== 'undefined') {\n return console;\n } else {\n return undefined;\n }\n}\n\nexport function getConsole() {\n var nativeConsole = getNativeConsole();\n if (nativeConsole && nativeConsole.log) {\n return nativeConsole;\n }\n return {\n log: function() {},\n warn: function() {},\n group: function() {},\n groupEnd: function() {}\n };\n}\n\nexport function warn(text) {\n /* eslint-disable no-console */\n getConsole().warn('[okta-auth-sdk] WARN: ' + text);\n /* eslint-enable */\n}\n\nexport function deprecate(text) {\n /* eslint-disable no-console */\n getConsole().warn('[okta-auth-sdk] DEPRECATION: ' + text);\n /* eslint-enable */\n}\n\nexport function deprecateWrap(text, fn) {\n return function() {\n deprecate(text);\n return fn.apply(null, arguments);\n };\n}\n\n"],"file":"console.js"}
package/esm/util/index.js DELETED
@@ -1,17 +0,0 @@
1
- /*!
2
- * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
- * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
- *
5
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
- * Unless required by applicable law or agreed to in writing, software
7
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
- *
10
- * See the License for the specific language governing permissions and limitations under the License.
11
- */
12
- export * from './console';
13
- export * from './misc';
14
- export * from './object';
15
- export * from './types';
16
- export * from './url';
17
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/util/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,cAAc,WAAd;AACA,cAAc,QAAd;AACA,cAAc,UAAd;AACA,cAAc,SAAd;AACA,cAAc,OAAd","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nexport * from './console';\nexport * from './misc';\nexport * from './object';\nexport * from './types';\nexport * from './url';\n"],"file":"index.js"}
package/esm/util/misc.js DELETED
@@ -1,33 +0,0 @@
1
- /*!
2
- * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
- * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
- *
5
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
- * Unless required by applicable law or agreed to in writing, software
7
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
- *
10
- * See the License for the specific language governing permissions and limitations under the License.
11
- */
12
- export function isoToUTCString(str) {
13
- var parts = str.match(/\d+/g),
14
- isoTime = Date.UTC(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]),
15
- isoDate = new Date(isoTime);
16
- return isoDate.toUTCString();
17
- }
18
- export function genRandomString(length) {
19
- var randomCharset = 'abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
20
- var random = '';
21
-
22
- for (var c = 0, cl = randomCharset.length; c < length; ++c) {
23
- random += randomCharset[Math.floor(Math.random() * cl)];
24
- }
25
-
26
- return random;
27
- }
28
- export function delay(ms) {
29
- return new Promise(function (resolve) {
30
- setTimeout(resolve, ms);
31
- });
32
- }
33
- //# sourceMappingURL=misc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/util/misc.ts"],"names":["isoToUTCString","str","parts","match","isoTime","Date","UTC","isoDate","toUTCString","genRandomString","length","randomCharset","random","c","cl","Math","floor","delay","ms","Promise","resolve","setTimeout"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,SAASA,cAAT,CAAwBC,GAAxB,EAA6B;AAClC,MAAIC,KAAK,GAAGD,GAAG,CAACE,KAAJ,CAAU,MAAV,CAAZ;AAAA,MACIC,OAAO,GAAGC,IAAI,CAACC,GAAL,CAASJ,KAAK,CAAC,CAAD,CAAd,EAAmBA,KAAK,CAAC,CAAD,CAAL,GAAW,CAA9B,EAAiCA,KAAK,CAAC,CAAD,CAAtC,EAA2CA,KAAK,CAAC,CAAD,CAAhD,EAAqDA,KAAK,CAAC,CAAD,CAA1D,EAA+DA,KAAK,CAAC,CAAD,CAApE,CADd;AAAA,MAEIK,OAAO,GAAG,IAAIF,IAAJ,CAASD,OAAT,CAFd;AAIA,SAAOG,OAAO,CAACC,WAAR,EAAP;AACD;AAED,OAAO,SAASC,eAAT,CAAyBC,MAAzB,EAAiC;AACtC,MAAIC,aAAa,GAAG,+DAApB;AACA,MAAIC,MAAM,GAAG,EAAb;;AACA,OAAK,IAAIC,CAAC,GAAG,CAAR,EAAWC,EAAE,GAAGH,aAAa,CAACD,MAAnC,EAA2CG,CAAC,GAAGH,MAA/C,EAAuD,EAAEG,CAAzD,EAA4D;AAC1DD,IAAAA,MAAM,IAAID,aAAa,CAACI,IAAI,CAACC,KAAL,CAAWD,IAAI,CAACH,MAAL,KAAgBE,EAA3B,CAAD,CAAvB;AACD;;AACD,SAAOF,MAAP;AACD;AAED,OAAO,SAASK,KAAT,CAAeC,EAAf,EAAmB;AACxB,SAAO,IAAIC,OAAJ,CAAY,UAASC,OAAT,EAAkB;AACnCC,IAAAA,UAAU,CAACD,OAAD,EAAUF,EAAV,CAAV;AACD,GAFM,CAAP;AAGD","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport function isoToUTCString(str) {\n var parts = str.match(/\\d+/g),\n isoTime = Date.UTC(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]),\n isoDate = new Date(isoTime);\n\n return isoDate.toUTCString();\n}\n\nexport function genRandomString(length) {\n var randomCharset = 'abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n var random = '';\n for (var c = 0, cl = randomCharset.length; c < length; ++c) {\n random += randomCharset[Math.floor(Math.random() * cl)];\n }\n return random;\n}\n\nexport function delay(ms) {\n return new Promise(function(resolve) {\n setTimeout(resolve, ms);\n });\n}\n"],"file":"misc.js"}
@@ -1,117 +0,0 @@
1
- /*!
2
- * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
- * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
- *
5
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
- * Unless required by applicable law or agreed to in writing, software
7
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
- *
10
- * See the License for the specific language governing permissions and limitations under the License.
11
- */
12
- export function bind(fn, ctx) {
13
- var additionalArgs = Array.prototype.slice.call(arguments, 2);
14
- return function () {
15
- var args = Array.prototype.slice.call(arguments);
16
- args = additionalArgs.concat(args);
17
- return fn.apply(ctx, args);
18
- };
19
- } // TODO: replace all references with `Object.assign` then remove this function
20
-
21
- export function extend() {
22
- // First object will be modified!
23
- var obj1 = arguments[0]; // Properties from other objects will be copied over
24
-
25
- var objArray = [].slice.call(arguments, 1);
26
- objArray.forEach(function (obj) {
27
- for (var prop in obj) {
28
- // copy over all properties with defined values
29
- if (Object.prototype.hasOwnProperty.call(obj, prop) && obj[prop] !== undefined) {
30
- obj1[prop] = obj[prop];
31
- }
32
- }
33
- });
34
- return obj1; // return the modified object
35
- }
36
- export function removeNils(obj) {
37
- var cleaned = {};
38
-
39
- for (var prop in obj) {
40
- if (Object.prototype.hasOwnProperty.call(obj, prop)) {
41
- var value = obj[prop];
42
-
43
- if (value !== null && value !== undefined) {
44
- cleaned[prop] = value;
45
- }
46
- }
47
- }
48
-
49
- return cleaned;
50
- }
51
- export function clone(obj) {
52
- if (obj) {
53
- var str = JSON.stringify(obj);
54
-
55
- if (str) {
56
- return JSON.parse(str);
57
- }
58
- }
59
-
60
- return obj;
61
- } // Analogous to _.omit
62
-
63
- export function omit(obj) {
64
- // var props = Array.prototype.slice.call(arguments, 1);
65
- var newobj = {};
66
-
67
- for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
68
- props[_key - 1] = arguments[_key];
69
- }
70
-
71
- for (var p in obj) {
72
- if (Object.prototype.hasOwnProperty.call(obj, p) && props.indexOf(p) == -1) {
73
- newobj[p] = obj[p];
74
- }
75
- }
76
-
77
- return clone(newobj);
78
- }
79
- export function find(collection, searchParams) {
80
- var c = collection.length;
81
-
82
- while (c--) {
83
- var item = collection[c];
84
- var found = true;
85
-
86
- for (var prop in searchParams) {
87
- if (!Object.prototype.hasOwnProperty.call(searchParams, prop)) {
88
- continue;
89
- }
90
-
91
- if (item[prop] !== searchParams[prop]) {
92
- found = false;
93
- break;
94
- }
95
- }
96
-
97
- if (found) {
98
- return item;
99
- }
100
- }
101
- }
102
- export function getLink(obj, linkName, altName) {
103
- if (!obj || !obj._links) {
104
- return;
105
- }
106
-
107
- var link = clone(obj._links[linkName]); // If a link has a name and we have an altName, return if they match
108
-
109
- if (link && link.name && altName) {
110
- if (link.name === altName) {
111
- return link;
112
- }
113
- } else {
114
- return link;
115
- }
116
- }
117
- //# sourceMappingURL=object.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/util/object.ts"],"names":["bind","fn","ctx","additionalArgs","Array","prototype","slice","call","arguments","args","concat","apply","extend","obj1","objArray","forEach","obj","prop","Object","hasOwnProperty","undefined","removeNils","cleaned","value","clone","str","JSON","stringify","parse","omit","newobj","props","p","indexOf","find","collection","searchParams","c","length","item","found","getLink","linkName","altName","_links","link","name"],"mappings":"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","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport function bind(fn, ctx) {\n var additionalArgs = Array.prototype.slice.call(arguments, 2);\n return function() {\n var args = Array.prototype.slice.call(arguments);\n args = additionalArgs.concat(args);\n return fn.apply(ctx, args);\n };\n}\n\n// TODO: replace all references with `Object.assign` then remove this function\nexport function extend() {\n // First object will be modified!\n var obj1 = arguments[0];\n // Properties from other objects will be copied over\n var objArray = [].slice.call(arguments, 1);\n objArray.forEach(function(obj) {\n for (var prop in obj) {\n // copy over all properties with defined values\n if (Object.prototype.hasOwnProperty.call(obj, prop) && obj[prop] !== undefined) {\n obj1[prop] = obj[prop];\n }\n }\n });\n return obj1; // return the modified object\n}\n\nexport function removeNils(obj) {\n var cleaned = {};\n for (var prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n var value = obj[prop];\n if (value !== null && value !== undefined) {\n cleaned[prop] = value;\n }\n }\n }\n return cleaned;\n}\n\nexport function clone(obj) {\n if (obj) {\n var str = JSON.stringify(obj);\n if (str) {\n return JSON.parse(str);\n }\n }\n return obj;\n}\n\n// Analogous to _.omit\nexport function omit(obj, ...props: any[]) {\n // var props = Array.prototype.slice.call(arguments, 1);\n var newobj = {};\n for (var p in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, p) && props.indexOf(p) == -1) {\n newobj[p] = obj[p];\n }\n }\n return clone(newobj);\n}\n\nexport function find(collection, searchParams) {\n var c = collection.length;\n while (c--) {\n var item = collection[c];\n var found = true;\n for (var prop in searchParams) {\n if (!Object.prototype.hasOwnProperty.call(searchParams, prop)) {\n continue;\n }\n if (item[prop] !== searchParams[prop]) {\n found = false;\n break;\n }\n }\n if (found) {\n return item;\n }\n }\n}\n\nexport function getLink(obj, linkName, altName?) {\n if (!obj || !obj._links) {\n return;\n }\n\n var link = clone(obj._links[linkName]);\n\n // If a link has a name and we have an altName, return if they match\n if (link && link.name && altName) {\n if (link.name === altName) {\n return link;\n }\n } else {\n return link;\n }\n}\n\n\n\n"],"file":"object.js"}
package/esm/util/types.js DELETED
@@ -1,27 +0,0 @@
1
- /*!
2
- * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
- * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
- *
5
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
- * Unless required by applicable law or agreed to in writing, software
7
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
- *
10
- * See the License for the specific language governing permissions and limitations under the License.
11
- */
12
- export function isString(obj) {
13
- return Object.prototype.toString.call(obj) === '[object String]';
14
- }
15
- export function isObject(obj) {
16
- return Object.prototype.toString.call(obj) === '[object Object]';
17
- }
18
- export function isNumber(obj) {
19
- return Object.prototype.toString.call(obj) === '[object Number]';
20
- }
21
- export function isFunction(fn) {
22
- return !!fn && {}.toString.call(fn) === '[object Function]';
23
- }
24
- export function isPromise(obj) {
25
- return obj && obj.finally && typeof obj.finally === 'function';
26
- }
27
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/util/types.ts"],"names":["isString","obj","Object","prototype","toString","call","isObject","isNumber","isFunction","fn","isPromise","finally"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,SAASA,QAAT,CAAkBC,GAAlB,EAA2C;AAChD,SAAOC,MAAM,CAACC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BJ,GAA/B,MAAwC,iBAA/C;AACD;AAED,OAAO,SAASK,QAAT,CAAkBL,GAAlB,EAA2C;AAChD,SAAOC,MAAM,CAACC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BJ,GAA/B,MAAwC,iBAA/C;AACD;AAED,OAAO,SAASM,QAAT,CAAkBN,GAAlB,EAA2C;AAChD,SAAOC,MAAM,CAACC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BJ,GAA/B,MAAwC,iBAA/C;AACD;AAED,OAAO,SAASO,UAAT,CAAoBC,EAApB,EAA6C;AAClD,SAAO,CAAC,CAACA,EAAF,IAAQ,GAAGL,QAAH,CAAYC,IAAZ,CAAiBI,EAAjB,MAAyB,mBAAxC;AACD;AAED,OAAO,SAASC,SAAT,CAAmBT,GAAnB,EAAwB;AAC7B,SAAOA,GAAG,IAAIA,GAAG,CAACU,OAAX,IAAuB,OAAOV,GAAG,CAACU,OAAX,KAAuB,UAArD;AACD","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport function isString(obj: any): obj is string {\n return Object.prototype.toString.call(obj) === '[object String]';\n}\n\nexport function isObject(obj: any): obj is object {\n return Object.prototype.toString.call(obj) === '[object Object]';\n}\n\nexport function isNumber(obj: any): obj is number {\n return Object.prototype.toString.call(obj) === '[object Number]';\n}\n\nexport function isFunction(fn: any): fn is Function {\n return !!fn && {}.toString.call(fn) === '[object Function]';\n}\n\nexport function isPromise(obj) {\n return obj && obj.finally && (typeof obj.finally === 'function');\n}\n"],"file":"types.js"}
package/esm/util/url.js DELETED
@@ -1,64 +0,0 @@
1
- /*!
2
- * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
- * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
- *
5
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
- * Unless required by applicable law or agreed to in writing, software
7
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
- *
10
- * See the License for the specific language governing permissions and limitations under the License.
11
- */
12
- export function isAbsoluteUrl(url) {
13
- return /^(?:[a-z]+:)?\/\//i.test(url);
14
- }
15
- export function toAbsoluteUrl() {
16
- var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
17
- var baseUrl = arguments.length > 1 ? arguments[1] : undefined;
18
-
19
- if (isAbsoluteUrl(url)) {
20
- return url;
21
- }
22
-
23
- baseUrl = removeTrailingSlash(baseUrl);
24
- return url[0] === '/' ? "".concat(baseUrl).concat(url) : "".concat(baseUrl, "/").concat(url);
25
- }
26
- export function toRelativeUrl() {
27
- var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
28
- var baseUrl = arguments.length > 1 ? arguments[1] : undefined;
29
-
30
- if (isAbsoluteUrl(url)) {
31
- url = url.substring(baseUrl.length);
32
- }
33
-
34
- return url[0] === '/' ? url : "/".concat(url);
35
- }
36
- export function toQueryString(obj) {
37
- var str = [];
38
-
39
- if (obj !== null) {
40
- for (var key in obj) {
41
- if (Object.prototype.hasOwnProperty.call(obj, key) && obj[key] !== undefined && obj[key] !== null) {
42
- str.push(key + '=' + encodeURIComponent(obj[key]));
43
- }
44
- }
45
- }
46
-
47
- if (str.length) {
48
- return '?' + str.join('&');
49
- } else {
50
- return '';
51
- }
52
- }
53
- export function removeTrailingSlash(path) {
54
- if (!path) {
55
- return;
56
- } // Remove any whitespace before or after string
57
-
58
-
59
- var trimmed = path.replace(/^\s+|\s+$/gm, ''); // Remove trailing slash(es)
60
-
61
- trimmed = trimmed.replace(/\/+$/, '');
62
- return trimmed;
63
- }
64
- //# sourceMappingURL=url.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/util/url.ts"],"names":["isAbsoluteUrl","url","test","toAbsoluteUrl","baseUrl","removeTrailingSlash","toRelativeUrl","substring","length","toQueryString","obj","str","key","Object","prototype","hasOwnProperty","call","undefined","push","encodeURIComponent","join","path","trimmed","replace"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,SAASA,aAAT,CAAuBC,GAAvB,EAA4B;AACjC,SAAO,qBAAqBC,IAArB,CAA0BD,GAA1B,CAAP;AACD;AAED,OAAO,SAASE,aAAT,GAA0C;AAAA,MAAnBF,GAAmB,uEAAb,EAAa;AAAA,MAATG,OAAS;;AAC/C,MAAIJ,aAAa,CAACC,GAAD,CAAjB,EAAwB;AACtB,WAAOA,GAAP;AACD;;AACDG,EAAAA,OAAO,GAAGC,mBAAmB,CAACD,OAAD,CAA7B;AACA,SAAOH,GAAG,CAAC,CAAD,CAAH,KAAW,GAAX,aAAoBG,OAApB,SAA8BH,GAA9B,cAAyCG,OAAzC,cAAoDH,GAApD,CAAP;AACD;AAED,OAAO,SAASK,aAAT,GAA0C;AAAA,MAAnBL,GAAmB,uEAAb,EAAa;AAAA,MAATG,OAAS;;AAC/C,MAAIJ,aAAa,CAACC,GAAD,CAAjB,EAAwB;AACtBA,IAAAA,GAAG,GAAGA,GAAG,CAACM,SAAJ,CAAcH,OAAO,CAACI,MAAtB,CAAN;AACD;;AAED,SAAOP,GAAG,CAAC,CAAD,CAAH,KAAW,GAAX,GAAiBA,GAAjB,cAA2BA,GAA3B,CAAP;AACD;AAED,OAAO,SAASQ,aAAT,CAAuBC,GAAvB,EAA4B;AACjC,MAAIC,GAAG,GAAG,EAAV;;AACA,MAAID,GAAG,KAAK,IAAZ,EAAkB;AAChB,SAAK,IAAIE,GAAT,IAAgBF,GAAhB,EAAqB;AACnB,UAAIG,MAAM,CAACC,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCN,GAArC,EAA0CE,GAA1C,KACAF,GAAG,CAACE,GAAD,CAAH,KAAaK,SADb,IAEAP,GAAG,CAACE,GAAD,CAAH,KAAa,IAFjB,EAEuB;AACrBD,QAAAA,GAAG,CAACO,IAAJ,CAASN,GAAG,GAAG,GAAN,GAAYO,kBAAkB,CAACT,GAAG,CAACE,GAAD,CAAJ,CAAvC;AACD;AACF;AACF;;AACD,MAAID,GAAG,CAACH,MAAR,EAAgB;AACd,WAAO,MAAMG,GAAG,CAACS,IAAJ,CAAS,GAAT,CAAb;AACD,GAFD,MAEO;AACL,WAAO,EAAP;AACD;AACF;AAED,OAAO,SAASf,mBAAT,CAA6BgB,IAA7B,EAAmC;AACxC,MAAI,CAACA,IAAL,EAAW;AACT;AACD,GAHuC,CAIxC;;;AACA,MAAIC,OAAO,GAAGD,IAAI,CAACE,OAAL,CAAa,aAAb,EAA2B,EAA3B,CAAd,CALwC,CAMxC;;AACAD,EAAAA,OAAO,GAAGA,OAAO,CAACC,OAAR,CAAgB,MAAhB,EAAwB,EAAxB,CAAV;AAEA,SAAOD,OAAP;AACD","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport function isAbsoluteUrl(url) {\n return /^(?:[a-z]+:)?\\/\\//i.test(url);\n}\n\nexport function toAbsoluteUrl(url = '', baseUrl) {\n if (isAbsoluteUrl(url)) {\n return url;\n }\n baseUrl = removeTrailingSlash(baseUrl);\n return url[0] === '/' ? `${baseUrl}${url}` : `${baseUrl}/${url}`;\n}\n\nexport function toRelativeUrl(url = '', baseUrl) {\n if (isAbsoluteUrl(url)) {\n url = url.substring(baseUrl.length);\n }\n\n return url[0] === '/' ? url : `/${url}`;\n}\n\nexport function toQueryString(obj) {\n var str = [];\n if (obj !== null) {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key) &&\n obj[key] !== undefined &&\n obj[key] !== null) {\n str.push(key + '=' + encodeURIComponent(obj[key]));\n }\n }\n }\n if (str.length) {\n return '?' + str.join('&');\n } else {\n return '';\n }\n}\n\nexport function removeTrailingSlash(path) {\n if (!path) {\n return;\n }\n // Remove any whitespace before or after string\n var trimmed = path.replace(/^\\s+|\\s+$/gm,'');\n // Remove trailing slash(es)\n trimmed = trimmed.replace(/\\/+$/, '');\n\n return trimmed;\n}\n"],"file":"url.js"}