@okta/okta-auth-js 7.0.0 → 7.1.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 (569) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +2 -0
  3. package/cjs/authn/AuthnTransactionImpl.js +6 -8
  4. package/cjs/authn/AuthnTransactionImpl.js.map +1 -1
  5. package/cjs/authn/api.js +3 -18
  6. package/cjs/authn/api.js.map +1 -1
  7. package/cjs/authn/factory.js +1 -7
  8. package/cjs/authn/factory.js.map +1 -1
  9. package/cjs/authn/index.js +0 -5
  10. package/cjs/authn/index.js.map +1 -1
  11. package/cjs/authn/mixin.js +14 -22
  12. package/cjs/authn/mixin.js.map +1 -1
  13. package/cjs/authn/util/flattenEmbedded.js +5 -12
  14. package/cjs/authn/util/flattenEmbedded.js.map +1 -1
  15. package/cjs/authn/util/link2fn.js +0 -22
  16. package/cjs/authn/util/link2fn.js.map +1 -1
  17. package/cjs/authn/util/links2fns.js +0 -12
  18. package/cjs/authn/util/links2fns.js.map +1 -1
  19. package/cjs/authn/util/poll.js +9 -27
  20. package/cjs/authn/util/poll.js.map +1 -1
  21. package/cjs/authn/util/stateToken.js +3 -4
  22. package/cjs/authn/util/stateToken.js.map +1 -1
  23. package/cjs/base/factory.js +6 -14
  24. package/cjs/base/factory.js.map +1 -1
  25. package/cjs/base/index.js +0 -5
  26. package/cjs/base/index.js.map +1 -1
  27. package/cjs/base/options.js +1 -2
  28. package/cjs/base/options.js.map +1 -1
  29. package/cjs/browser/browserStorage.js +15 -43
  30. package/cjs/browser/browserStorage.js.map +1 -1
  31. package/cjs/browser/fingerprint.js +3 -15
  32. package/cjs/browser/fingerprint.js.map +1 -1
  33. package/cjs/clock.js +5 -7
  34. package/cjs/clock.js.map +1 -1
  35. package/cjs/constants.js +4 -3
  36. package/cjs/constants.js.map +1 -1
  37. package/cjs/core/AuthStateManager.js +24 -48
  38. package/cjs/core/AuthStateManager.js.map +1 -1
  39. package/cjs/core/ServiceManager/browser.js +13 -33
  40. package/cjs/core/ServiceManager/browser.js.map +1 -1
  41. package/cjs/core/ServiceManager/index.js +0 -1
  42. package/cjs/core/ServiceManager/index.js.map +1 -1
  43. package/cjs/core/ServiceManager/node.js +3 -9
  44. package/cjs/core/ServiceManager/node.js.map +1 -1
  45. package/cjs/core/factory.js +0 -7
  46. package/cjs/core/factory.js.map +1 -1
  47. package/cjs/core/index.js +0 -13
  48. package/cjs/core/index.js.map +1 -1
  49. package/cjs/core/mixin.js +16 -20
  50. package/cjs/core/mixin.js.map +1 -1
  51. package/cjs/core/options.js +1 -3
  52. package/cjs/core/options.js.map +1 -1
  53. package/cjs/core/storage.js +0 -2
  54. package/cjs/core/storage.js.map +1 -1
  55. package/cjs/core/types/index.js +0 -5
  56. package/cjs/core/types/index.js.map +1 -1
  57. package/cjs/crypto/base64.js +9 -22
  58. package/cjs/crypto/base64.js.map +1 -1
  59. package/cjs/crypto/browser.js +0 -4
  60. package/cjs/crypto/browser.js.map +1 -1
  61. package/cjs/crypto/index.js +0 -9
  62. package/cjs/crypto/index.js.map +1 -1
  63. package/cjs/crypto/node.js +0 -13
  64. package/cjs/crypto/node.js.map +1 -1
  65. package/cjs/crypto/oidcHash.js +1 -4
  66. package/cjs/crypto/oidcHash.js.map +1 -1
  67. package/cjs/crypto/verifyToken.js +6 -7
  68. package/cjs/crypto/verifyToken.js.map +1 -1
  69. package/cjs/crypto/webcrypto.js +0 -1
  70. package/cjs/crypto/webcrypto.js.map +1 -1
  71. package/cjs/errors/AuthApiError.js +1 -7
  72. package/cjs/errors/AuthApiError.js.map +1 -1
  73. package/cjs/errors/AuthPollStopError.js +1 -5
  74. package/cjs/errors/AuthPollStopError.js.map +1 -1
  75. package/cjs/errors/AuthSdkError.js +1 -6
  76. package/cjs/errors/AuthSdkError.js.map +1 -1
  77. package/cjs/errors/CustomError.js +1 -4
  78. package/cjs/errors/CustomError.js.map +1 -1
  79. package/cjs/errors/OAuthError.js +4 -7
  80. package/cjs/errors/OAuthError.js.map +1 -1
  81. package/cjs/errors/index.js +1 -9
  82. package/cjs/errors/index.js.map +1 -1
  83. package/cjs/exports/authn.js +0 -9
  84. package/cjs/exports/authn.js.map +1 -1
  85. package/cjs/exports/cdn/authn.js +0 -2
  86. package/cjs/exports/cdn/authn.js.map +1 -1
  87. package/cjs/exports/cdn/core.js +0 -2
  88. package/cjs/exports/cdn/core.js.map +1 -1
  89. package/cjs/exports/cdn/default.js +0 -2
  90. package/cjs/exports/cdn/default.js.map +1 -1
  91. package/cjs/exports/cdn/idx.js +0 -2
  92. package/cjs/exports/cdn/idx.js.map +1 -1
  93. package/cjs/exports/cdn/myaccount.js +0 -2
  94. package/cjs/exports/cdn/myaccount.js.map +1 -1
  95. package/cjs/exports/common.js +0 -22
  96. package/cjs/exports/common.js.map +1 -1
  97. package/cjs/exports/core.js +0 -9
  98. package/cjs/exports/core.js.map +1 -1
  99. package/cjs/exports/default.js +2 -12
  100. package/cjs/exports/default.js.map +1 -1
  101. package/cjs/exports/idx.js +3 -7
  102. package/cjs/exports/idx.js.map +1 -1
  103. package/cjs/exports/myaccount.js +0 -9
  104. package/cjs/exports/myaccount.js.map +1 -1
  105. package/cjs/features.js +1 -18
  106. package/cjs/features.js.map +1 -1
  107. package/cjs/fetch/fetchRequest.js +6 -20
  108. package/cjs/fetch/fetchRequest.js.map +1 -1
  109. package/cjs/http/OktaUserAgent.js +3 -11
  110. package/cjs/http/OktaUserAgent.js.map +1 -1
  111. package/cjs/http/headers.js +1 -1
  112. package/cjs/http/headers.js.map +1 -1
  113. package/cjs/http/index.js +0 -11
  114. package/cjs/http/index.js.map +1 -1
  115. package/cjs/http/mixin.js +2 -10
  116. package/cjs/http/mixin.js.map +1 -1
  117. package/cjs/http/options.js +1 -5
  118. package/cjs/http/options.js.map +1 -1
  119. package/cjs/http/request.js +75 -57
  120. package/cjs/http/request.js.map +1 -1
  121. package/cjs/idx/IdxTransactionManager.js +2 -22
  122. package/cjs/idx/IdxTransactionManager.js.map +1 -1
  123. package/cjs/idx/authenticate.js +3 -5
  124. package/cjs/idx/authenticate.js.map +1 -1
  125. package/cjs/idx/authenticator/Authenticator.js +2 -4
  126. package/cjs/idx/authenticator/Authenticator.js.map +1 -1
  127. package/cjs/idx/authenticator/OktaPassword.js +2 -10
  128. package/cjs/idx/authenticator/OktaPassword.js.map +1 -1
  129. package/cjs/idx/authenticator/OktaVerifyTotp.js +0 -6
  130. package/cjs/idx/authenticator/OktaVerifyTotp.js.map +1 -1
  131. package/cjs/idx/authenticator/SecurityQuestionEnrollment.js +0 -10
  132. package/cjs/idx/authenticator/SecurityQuestionEnrollment.js.map +1 -1
  133. package/cjs/idx/authenticator/SecurityQuestionVerification.js +1 -10
  134. package/cjs/idx/authenticator/SecurityQuestionVerification.js.map +1 -1
  135. package/cjs/idx/authenticator/VerificationCodeAuthenticator.js +2 -10
  136. package/cjs/idx/authenticator/VerificationCodeAuthenticator.js.map +1 -1
  137. package/cjs/idx/authenticator/WebauthnEnrollment.js +0 -8
  138. package/cjs/idx/authenticator/WebauthnEnrollment.js.map +1 -1
  139. package/cjs/idx/authenticator/WebauthnVerification.js +0 -8
  140. package/cjs/idx/authenticator/WebauthnVerification.js.map +1 -1
  141. package/cjs/idx/authenticator/getAuthenticator.js +0 -15
  142. package/cjs/idx/authenticator/getAuthenticator.js.map +1 -1
  143. package/cjs/idx/authenticator/index.js +0 -15
  144. package/cjs/idx/authenticator/index.js.map +1 -1
  145. package/cjs/idx/authenticator/util.js +8 -18
  146. package/cjs/idx/authenticator/util.js.map +1 -1
  147. package/cjs/idx/cancel.js +3 -4
  148. package/cjs/idx/cancel.js.map +1 -1
  149. package/cjs/idx/emailVerify.js +5 -13
  150. package/cjs/idx/emailVerify.js.map +1 -1
  151. package/cjs/idx/factory/OktaAuthIdx.js +0 -3
  152. package/cjs/idx/factory/OktaAuthIdx.js.map +1 -1
  153. package/cjs/idx/factory/api.js +1 -17
  154. package/cjs/idx/factory/api.js.map +1 -1
  155. package/cjs/idx/factory/index.js +0 -3
  156. package/cjs/idx/factory/index.js.map +1 -1
  157. package/cjs/idx/flow/AccountUnlockFlow.js +1 -2
  158. package/cjs/idx/flow/AccountUnlockFlow.js.map +1 -1
  159. package/cjs/idx/flow/AuthenticationFlow.js +1 -2
  160. package/cjs/idx/flow/AuthenticationFlow.js.map +1 -1
  161. package/cjs/idx/flow/FlowSpecification.js +2 -13
  162. package/cjs/idx/flow/FlowSpecification.js.map +1 -1
  163. package/cjs/idx/flow/PasswordRecoveryFlow.js +1 -2
  164. package/cjs/idx/flow/PasswordRecoveryFlow.js.map +1 -1
  165. package/cjs/idx/flow/RegistrationFlow.js +1 -2
  166. package/cjs/idx/flow/RegistrationFlow.js.map +1 -1
  167. package/cjs/idx/flow/index.js +0 -11
  168. package/cjs/idx/flow/index.js.map +1 -1
  169. package/cjs/idx/handleInteractionCodeRedirect.js +7 -12
  170. package/cjs/idx/handleInteractionCodeRedirect.js.map +1 -1
  171. package/cjs/idx/idxState/index.js +1 -11
  172. package/cjs/idx/idxState/index.js.map +1 -1
  173. package/cjs/idx/idxState/v1/actionParser.js +1 -12
  174. package/cjs/idx/idxState/v1/actionParser.js.map +1 -1
  175. package/cjs/idx/idxState/v1/generateIdxAction.js +10 -15
  176. package/cjs/idx/idxState/v1/generateIdxAction.js.map +1 -1
  177. package/cjs/idx/idxState/v1/idxResponseParser.js +7 -23
  178. package/cjs/idx/idxState/v1/idxResponseParser.js.map +1 -1
  179. package/cjs/idx/idxState/v1/makeIdxState.js +2 -10
  180. package/cjs/idx/idxState/v1/makeIdxState.js.map +1 -1
  181. package/cjs/idx/idxState/v1/parsers.js +0 -2
  182. package/cjs/idx/idxState/v1/parsers.js.map +1 -1
  183. package/cjs/idx/idxState/v1/remediationParser.js +2 -4
  184. package/cjs/idx/idxState/v1/remediationParser.js.map +1 -1
  185. package/cjs/idx/index.js +0 -26
  186. package/cjs/idx/index.js.map +1 -1
  187. package/cjs/idx/interact.js +18 -18
  188. package/cjs/idx/interact.js.map +1 -1
  189. package/cjs/idx/introspect.js +5 -14
  190. package/cjs/idx/introspect.js.map +1 -1
  191. package/cjs/idx/mixin.js +0 -9
  192. package/cjs/idx/mixin.js.map +1 -1
  193. package/cjs/idx/options.js +2 -3
  194. package/cjs/idx/options.js.map +1 -1
  195. package/cjs/idx/poll.js +1 -10
  196. package/cjs/idx/poll.js.map +1 -1
  197. package/cjs/idx/proceed.js +3 -9
  198. package/cjs/idx/proceed.js.map +1 -1
  199. package/cjs/idx/recoverPassword.js +3 -4
  200. package/cjs/idx/recoverPassword.js.map +1 -1
  201. package/cjs/idx/register.js +5 -11
  202. package/cjs/idx/register.js.map +1 -1
  203. package/cjs/idx/remediate.js +24 -45
  204. package/cjs/idx/remediate.js.map +1 -1
  205. package/cjs/idx/remediators/AuthenticatorEnrollmentData.js +7 -16
  206. package/cjs/idx/remediators/AuthenticatorEnrollmentData.js.map +1 -1
  207. package/cjs/idx/remediators/AuthenticatorVerificationData.js +7 -15
  208. package/cjs/idx/remediators/AuthenticatorVerificationData.js.map +1 -1
  209. package/cjs/idx/remediators/Base/AuthenticatorData.js +7 -22
  210. package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
  211. package/cjs/idx/remediators/Base/Remediator.js +38 -67
  212. package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
  213. package/cjs/idx/remediators/Base/SelectAuthenticator.js +13 -30
  214. package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
  215. package/cjs/idx/remediators/Base/VerifyAuthenticator.js +5 -13
  216. package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
  217. package/cjs/idx/remediators/ChallengeAuthenticator.js +1 -5
  218. package/cjs/idx/remediators/ChallengeAuthenticator.js.map +1 -1
  219. package/cjs/idx/remediators/ChallengePoll.js +1 -6
  220. package/cjs/idx/remediators/ChallengePoll.js.map +1 -1
  221. package/cjs/idx/remediators/EnrollAuthenticator.js +1 -5
  222. package/cjs/idx/remediators/EnrollAuthenticator.js.map +1 -1
  223. package/cjs/idx/remediators/EnrollPoll.js +5 -12
  224. package/cjs/idx/remediators/EnrollPoll.js.map +1 -1
  225. package/cjs/idx/remediators/EnrollProfile.js +8 -30
  226. package/cjs/idx/remediators/EnrollProfile.js.map +1 -1
  227. package/cjs/idx/remediators/EnrollmentChannelData.js +5 -13
  228. package/cjs/idx/remediators/EnrollmentChannelData.js.map +1 -1
  229. package/cjs/idx/remediators/GenericRemediator/GenericRemediator.js +13 -19
  230. package/cjs/idx/remediators/GenericRemediator/GenericRemediator.js.map +1 -1
  231. package/cjs/idx/remediators/GenericRemediator/index.js +0 -1
  232. package/cjs/idx/remediators/GenericRemediator/index.js.map +1 -1
  233. package/cjs/idx/remediators/GenericRemediator/util.js +19 -31
  234. package/cjs/idx/remediators/GenericRemediator/util.js.map +1 -1
  235. package/cjs/idx/remediators/Identify.js +3 -12
  236. package/cjs/idx/remediators/Identify.js.map +1 -1
  237. package/cjs/idx/remediators/ReEnrollAuthenticator.js +3 -10
  238. package/cjs/idx/remediators/ReEnrollAuthenticator.js.map +1 -1
  239. package/cjs/idx/remediators/RedirectIdp.js +1 -7
  240. package/cjs/idx/remediators/RedirectIdp.js.map +1 -1
  241. package/cjs/idx/remediators/ResetAuthenticator.js +1 -5
  242. package/cjs/idx/remediators/ResetAuthenticator.js.map +1 -1
  243. package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js +3 -11
  244. package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js.map +1 -1
  245. package/cjs/idx/remediators/SelectAuthenticatorEnroll.js +1 -5
  246. package/cjs/idx/remediators/SelectAuthenticatorEnroll.js.map +1 -1
  247. package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js +6 -15
  248. package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js.map +1 -1
  249. package/cjs/idx/remediators/SelectEnrollProfile.js +1 -6
  250. package/cjs/idx/remediators/SelectEnrollProfile.js.map +1 -1
  251. package/cjs/idx/remediators/SelectEnrollmentChannel.js +5 -16
  252. package/cjs/idx/remediators/SelectEnrollmentChannel.js.map +1 -1
  253. package/cjs/idx/remediators/Skip.js +1 -6
  254. package/cjs/idx/remediators/Skip.js.map +1 -1
  255. package/cjs/idx/remediators/index.js +0 -39
  256. package/cjs/idx/remediators/index.js.map +1 -1
  257. package/cjs/idx/remediators/util.js +1 -7
  258. package/cjs/idx/remediators/util.js.map +1 -1
  259. package/cjs/idx/run.js +39 -54
  260. package/cjs/idx/run.js.map +1 -1
  261. package/cjs/idx/startTransaction.js +1 -2
  262. package/cjs/idx/startTransaction.js.map +1 -1
  263. package/cjs/idx/storage.js +3 -22
  264. package/cjs/idx/storage.js.map +1 -1
  265. package/cjs/idx/transactionMeta.js +24 -42
  266. package/cjs/idx/transactionMeta.js.map +1 -1
  267. package/cjs/idx/types/api.js +1 -9
  268. package/cjs/idx/types/api.js.map +1 -1
  269. package/cjs/idx/types/idx-js.js +3 -3
  270. package/cjs/idx/types/idx-js.js.map +1 -1
  271. package/cjs/idx/types/index.js +0 -7
  272. package/cjs/idx/types/index.js.map +1 -1
  273. package/cjs/idx/types/meta.js.map +1 -1
  274. package/cjs/idx/types/options.js.map +1 -1
  275. package/cjs/idx/unlockAccount.js +7 -11
  276. package/cjs/idx/unlockAccount.js.map +1 -1
  277. package/cjs/idx/util.js +24 -76
  278. package/cjs/idx/util.js.map +1 -1
  279. package/cjs/idx/webauthn.js +13 -18
  280. package/cjs/idx/webauthn.js.map +1 -1
  281. package/cjs/myaccount/api.js +0 -5
  282. package/cjs/myaccount/api.js.map +1 -1
  283. package/cjs/myaccount/emailApi.js +6 -21
  284. package/cjs/myaccount/emailApi.js.map +1 -1
  285. package/cjs/myaccount/factory.js +0 -3
  286. package/cjs/myaccount/factory.js.map +1 -1
  287. package/cjs/myaccount/index.js +0 -7
  288. package/cjs/myaccount/index.js.map +1 -1
  289. package/cjs/myaccount/mixin.js +0 -5
  290. package/cjs/myaccount/mixin.js.map +1 -1
  291. package/cjs/myaccount/phoneApi.js +5 -18
  292. package/cjs/myaccount/phoneApi.js.map +1 -1
  293. package/cjs/myaccount/profileApi.js +2 -9
  294. package/cjs/myaccount/profileApi.js.map +1 -1
  295. package/cjs/myaccount/request.js +12 -78
  296. package/cjs/myaccount/request.js.map +1 -1
  297. package/cjs/myaccount/transactions/Base.js +5 -7
  298. package/cjs/myaccount/transactions/Base.js.map +1 -1
  299. package/cjs/myaccount/transactions/EmailChallengeTransaction.js +5 -10
  300. package/cjs/myaccount/transactions/EmailChallengeTransaction.js.map +1 -1
  301. package/cjs/myaccount/transactions/EmailStatusTransaction.js +2 -7
  302. package/cjs/myaccount/transactions/EmailStatusTransaction.js.map +1 -1
  303. package/cjs/myaccount/transactions/EmailTransaction.js +5 -13
  304. package/cjs/myaccount/transactions/EmailTransaction.js.map +1 -1
  305. package/cjs/myaccount/transactions/PhoneTransaction.js +5 -12
  306. package/cjs/myaccount/transactions/PhoneTransaction.js.map +1 -1
  307. package/cjs/myaccount/transactions/ProfileSchemaTransaction.js +0 -5
  308. package/cjs/myaccount/transactions/ProfileSchemaTransaction.js.map +1 -1
  309. package/cjs/myaccount/transactions/ProfileTransaction.js +0 -5
  310. package/cjs/myaccount/transactions/ProfileTransaction.js.map +1 -1
  311. package/cjs/myaccount/transactions/index.js +0 -8
  312. package/cjs/myaccount/transactions/index.js.map +1 -1
  313. package/cjs/myaccount/types.js +0 -5
  314. package/cjs/myaccount/types.js.map +1 -1
  315. package/cjs/oidc/TokenManager.js +39 -100
  316. package/cjs/oidc/TokenManager.js.map +1 -1
  317. package/cjs/oidc/TransactionManager.js +19 -26
  318. package/cjs/oidc/TransactionManager.js.map +1 -1
  319. package/cjs/oidc/decodeToken.js +1 -5
  320. package/cjs/oidc/decodeToken.js.map +1 -1
  321. package/cjs/oidc/endpoints/authorize.js +9 -13
  322. package/cjs/oidc/endpoints/authorize.js.map +1 -1
  323. package/cjs/oidc/endpoints/index.js +0 -5
  324. package/cjs/oidc/endpoints/index.js.map +1 -1
  325. package/cjs/oidc/endpoints/token.js +5 -17
  326. package/cjs/oidc/endpoints/token.js.map +1 -1
  327. package/cjs/oidc/endpoints/well-known.js +7 -14
  328. package/cjs/oidc/endpoints/well-known.js.map +1 -1
  329. package/cjs/oidc/exchangeCodeForTokens.js +7 -12
  330. package/cjs/oidc/exchangeCodeForTokens.js.map +1 -1
  331. package/cjs/oidc/factory/OktaAuthOAuth.js +0 -6
  332. package/cjs/oidc/factory/OktaAuthOAuth.js.map +1 -1
  333. package/cjs/oidc/factory/api.js +6 -20
  334. package/cjs/oidc/factory/api.js.map +1 -1
  335. package/cjs/oidc/factory/index.js +0 -3
  336. package/cjs/oidc/factory/index.js.map +1 -1
  337. package/cjs/oidc/getToken.js +18 -30
  338. package/cjs/oidc/getToken.js.map +1 -1
  339. package/cjs/oidc/getUserInfo.js +1 -15
  340. package/cjs/oidc/getUserInfo.js.map +1 -1
  341. package/cjs/oidc/getWithPopup.js +4 -8
  342. package/cjs/oidc/getWithPopup.js.map +1 -1
  343. package/cjs/oidc/getWithRedirect.js +1 -8
  344. package/cjs/oidc/getWithRedirect.js.map +1 -1
  345. package/cjs/oidc/getWithoutPrompt.js +1 -5
  346. package/cjs/oidc/getWithoutPrompt.js.map +1 -1
  347. package/cjs/oidc/handleOAuthResponse.js +23 -40
  348. package/cjs/oidc/handleOAuthResponse.js.map +1 -1
  349. package/cjs/oidc/index.js +0 -32
  350. package/cjs/oidc/index.js.map +1 -1
  351. package/cjs/oidc/mixin/browser.js +6 -18
  352. package/cjs/oidc/mixin/browser.js.map +1 -1
  353. package/cjs/oidc/mixin/index.js +37 -89
  354. package/cjs/oidc/mixin/index.js.map +1 -1
  355. package/cjs/oidc/mixin/node.js +2 -9
  356. package/cjs/oidc/mixin/node.js.map +1 -1
  357. package/cjs/oidc/options/OAuthOptionsConstructor.js +17 -24
  358. package/cjs/oidc/options/OAuthOptionsConstructor.js.map +1 -1
  359. package/cjs/oidc/options/browser.js.map +1 -1
  360. package/cjs/oidc/options/index.js +0 -1
  361. package/cjs/oidc/options/index.js.map +1 -1
  362. package/cjs/oidc/options/node.js.map +1 -1
  363. package/cjs/oidc/parseFromUrl.js +1 -32
  364. package/cjs/oidc/parseFromUrl.js.map +1 -1
  365. package/cjs/oidc/renewToken.js +5 -16
  366. package/cjs/oidc/renewToken.js.map +1 -1
  367. package/cjs/oidc/renewTokens.js +3 -15
  368. package/cjs/oidc/renewTokens.js.map +1 -1
  369. package/cjs/oidc/renewTokensWithRefresh.js +3 -13
  370. package/cjs/oidc/renewTokensWithRefresh.js.map +1 -1
  371. package/cjs/oidc/revokeToken.js +3 -14
  372. package/cjs/oidc/revokeToken.js.map +1 -1
  373. package/cjs/oidc/storage.js +0 -8
  374. package/cjs/oidc/storage.js.map +1 -1
  375. package/cjs/oidc/types/Token.js +1 -5
  376. package/cjs/oidc/types/Token.js.map +1 -1
  377. package/cjs/oidc/types/TokenManager.js +1 -1
  378. package/cjs/oidc/types/TokenManager.js.map +1 -1
  379. package/cjs/oidc/types/Transaction.js +1 -12
  380. package/cjs/oidc/types/Transaction.js.map +1 -1
  381. package/cjs/oidc/types/UserClaims.js.map +1 -1
  382. package/cjs/oidc/types/api.js.map +1 -1
  383. package/cjs/oidc/types/index.js +0 -21
  384. package/cjs/oidc/types/index.js.map +1 -1
  385. package/cjs/oidc/types/meta.js.map +1 -1
  386. package/cjs/oidc/types/options.js.map +1 -1
  387. package/cjs/oidc/types/proto.js.map +1 -1
  388. package/cjs/oidc/util/browser.js +4 -13
  389. package/cjs/oidc/util/browser.js.map +1 -1
  390. package/cjs/oidc/util/defaultTokenParams.js +5 -5
  391. package/cjs/oidc/util/defaultTokenParams.js.map +1 -1
  392. package/cjs/oidc/util/errors.js +3 -8
  393. package/cjs/oidc/util/errors.js.map +1 -1
  394. package/cjs/oidc/util/index.js +0 -24
  395. package/cjs/oidc/util/index.js.map +1 -1
  396. package/cjs/oidc/util/loginRedirect.js +11 -25
  397. package/cjs/oidc/util/loginRedirect.js.map +1 -1
  398. package/cjs/oidc/util/oauth.js +3 -12
  399. package/cjs/oidc/util/oauth.js.map +1 -1
  400. package/cjs/oidc/util/oauthMeta.js +5 -6
  401. package/cjs/oidc/util/oauthMeta.js.map +1 -1
  402. package/cjs/oidc/util/pkce.js +1 -12
  403. package/cjs/oidc/util/pkce.js.map +1 -1
  404. package/cjs/oidc/util/prepareTokenParams.js +13 -26
  405. package/cjs/oidc/util/prepareTokenParams.js.map +1 -1
  406. package/cjs/oidc/util/refreshToken.js +0 -7
  407. package/cjs/oidc/util/refreshToken.js.map +1 -1
  408. package/cjs/oidc/util/sharedStorage.js +0 -8
  409. package/cjs/oidc/util/sharedStorage.js.map +1 -1
  410. package/cjs/oidc/util/urlParams.js +9 -12
  411. package/cjs/oidc/util/urlParams.js.map +1 -1
  412. package/cjs/oidc/util/validateClaims.js +9 -17
  413. package/cjs/oidc/util/validateClaims.js.map +1 -1
  414. package/cjs/oidc/util/validateToken.js +1 -6
  415. package/cjs/oidc/util/validateToken.js.map +1 -1
  416. package/cjs/oidc/verifyToken.js +13 -23
  417. package/cjs/oidc/verifyToken.js.map +1 -1
  418. package/cjs/server/serverStorage.js +9 -27
  419. package/cjs/server/serverStorage.js.map +1 -1
  420. package/cjs/services/AutoRenewService.js +1 -17
  421. package/cjs/services/AutoRenewService.js.map +1 -1
  422. package/cjs/services/LeaderElectionService.js +1 -23
  423. package/cjs/services/LeaderElectionService.js.map +1 -1
  424. package/cjs/services/SyncStorageService.js +3 -37
  425. package/cjs/services/SyncStorageService.js.map +1 -1
  426. package/cjs/services/index.js +0 -5
  427. package/cjs/services/index.js.map +1 -1
  428. package/cjs/session/api.js +1 -12
  429. package/cjs/session/api.js.map +1 -1
  430. package/cjs/session/factory.js +0 -2
  431. package/cjs/session/factory.js.map +1 -1
  432. package/cjs/session/index.js +0 -7
  433. package/cjs/session/index.js.map +1 -1
  434. package/cjs/session/mixin.js +2 -6
  435. package/cjs/session/mixin.js.map +1 -1
  436. package/cjs/storage/BaseStorageManager.js +13 -25
  437. package/cjs/storage/BaseStorageManager.js.map +1 -1
  438. package/cjs/storage/SavedObject.js +7 -19
  439. package/cjs/storage/SavedObject.js.map +1 -1
  440. package/cjs/storage/index.js +0 -9
  441. package/cjs/storage/index.js.map +1 -1
  442. package/cjs/storage/mixin.js +2 -4
  443. package/cjs/storage/mixin.js.map +1 -1
  444. package/cjs/storage/options/StorageOptionsConstructor.js +3 -6
  445. package/cjs/storage/options/StorageOptionsConstructor.js.map +1 -1
  446. package/cjs/storage/options/browser.js +7 -15
  447. package/cjs/storage/options/browser.js.map +1 -1
  448. package/cjs/storage/options/node.js +3 -6
  449. package/cjs/storage/options/node.js.map +1 -1
  450. package/cjs/util/PromiseQueue.js +7 -15
  451. package/cjs/util/PromiseQueue.js.map +1 -1
  452. package/cjs/util/console.js +3 -7
  453. package/cjs/util/console.js.map +1 -1
  454. package/cjs/util/index.js +0 -11
  455. package/cjs/util/index.js.map +1 -1
  456. package/cjs/util/misc.js +3 -8
  457. package/cjs/util/misc.js.map +1 -1
  458. package/cjs/util/object.js +9 -23
  459. package/cjs/util/object.js.map +1 -1
  460. package/cjs/util/types.js +1 -5
  461. package/cjs/util/types.js.map +1 -1
  462. package/cjs/util/url.js +5 -14
  463. package/cjs/util/url.js.map +1 -1
  464. package/dist/okta-auth-js.authn.min.analyzer.html +3 -3
  465. package/dist/okta-auth-js.authn.min.js +1 -1
  466. package/dist/okta-auth-js.authn.min.js.LICENSE.txt +2 -0
  467. package/dist/okta-auth-js.authn.min.js.map +1 -1
  468. package/dist/okta-auth-js.core.min.analyzer.html +3 -3
  469. package/dist/okta-auth-js.core.min.js +1 -1
  470. package/dist/okta-auth-js.core.min.js.LICENSE.txt +2 -0
  471. package/dist/okta-auth-js.core.min.js.map +1 -1
  472. package/dist/okta-auth-js.idx.min.analyzer.html +3 -3
  473. package/dist/okta-auth-js.idx.min.js +1 -1
  474. package/dist/okta-auth-js.idx.min.js.LICENSE.txt +2 -0
  475. package/dist/okta-auth-js.idx.min.js.map +1 -1
  476. package/dist/okta-auth-js.min.analyzer.html +3 -3
  477. package/dist/okta-auth-js.min.js +1 -1
  478. package/dist/okta-auth-js.min.js.LICENSE.txt +2 -0
  479. package/dist/okta-auth-js.min.js.map +1 -1
  480. package/dist/okta-auth-js.myaccount.min.analyzer.html +3 -3
  481. package/dist/okta-auth-js.myaccount.min.js +1 -1
  482. package/dist/okta-auth-js.myaccount.min.js.LICENSE.txt +2 -0
  483. package/dist/okta-auth-js.myaccount.min.js.map +1 -1
  484. package/dist/okta-auth-js.polyfill.js +1 -1
  485. package/dist/okta-auth-js.polyfill.js.map +1 -1
  486. package/esm/browser/http/OktaUserAgent.js +2 -2
  487. package/esm/browser/http/request.js +56 -23
  488. package/esm/browser/http/request.js.map +1 -1
  489. package/esm/browser/idx/interact.js +2 -2
  490. package/esm/browser/idx/interact.js.map +1 -1
  491. package/esm/browser/idx/run.js +3 -2
  492. package/esm/browser/idx/run.js.map +1 -1
  493. package/esm/browser/idx/transactionMeta.js +3 -2
  494. package/esm/browser/idx/transactionMeta.js.map +1 -1
  495. package/esm/browser/myaccount/request.js +2 -43
  496. package/esm/browser/myaccount/request.js.map +1 -1
  497. package/esm/browser/oidc/endpoints/authorize.js +1 -0
  498. package/esm/browser/oidc/endpoints/authorize.js.map +1 -1
  499. package/esm/browser/oidc/exchangeCodeForTokens.js +2 -1
  500. package/esm/browser/oidc/exchangeCodeForTokens.js.map +1 -1
  501. package/esm/browser/oidc/handleOAuthResponse.js +17 -16
  502. package/esm/browser/oidc/handleOAuthResponse.js.map +1 -1
  503. package/esm/browser/oidc/options/OAuthOptionsConstructor.js +2 -0
  504. package/esm/browser/oidc/options/OAuthOptionsConstructor.js.map +1 -1
  505. package/esm/browser/oidc/util/defaultTokenParams.js +3 -1
  506. package/esm/browser/oidc/util/defaultTokenParams.js.map +1 -1
  507. package/esm/browser/oidc/util/oauthMeta.js +1 -0
  508. package/esm/browser/oidc/util/oauthMeta.js.map +1 -1
  509. package/esm/browser/oidc/util/validateClaims.js +9 -4
  510. package/esm/browser/oidc/util/validateClaims.js.map +1 -1
  511. package/esm/browser/oidc/verifyToken.js +2 -2
  512. package/esm/browser/oidc/verifyToken.js.map +1 -1
  513. package/esm/browser/package.json +1 -1
  514. package/esm/node/http/OktaUserAgent.js +2 -2
  515. package/esm/node/http/request.js +56 -23
  516. package/esm/node/http/request.js.map +1 -1
  517. package/esm/node/idx/interact.js +2 -2
  518. package/esm/node/idx/interact.js.map +1 -1
  519. package/esm/node/idx/run.js +3 -2
  520. package/esm/node/idx/run.js.map +1 -1
  521. package/esm/node/idx/transactionMeta.js +3 -2
  522. package/esm/node/idx/transactionMeta.js.map +1 -1
  523. package/esm/node/myaccount/request.js +2 -43
  524. package/esm/node/myaccount/request.js.map +1 -1
  525. package/esm/node/oidc/endpoints/authorize.js +1 -0
  526. package/esm/node/oidc/endpoints/authorize.js.map +1 -1
  527. package/esm/node/oidc/exchangeCodeForTokens.js +2 -1
  528. package/esm/node/oidc/exchangeCodeForTokens.js.map +1 -1
  529. package/esm/node/oidc/handleOAuthResponse.js +17 -16
  530. package/esm/node/oidc/handleOAuthResponse.js.map +1 -1
  531. package/esm/node/oidc/options/OAuthOptionsConstructor.js +2 -0
  532. package/esm/node/oidc/options/OAuthOptionsConstructor.js.map +1 -1
  533. package/esm/node/oidc/util/defaultTokenParams.js +3 -1
  534. package/esm/node/oidc/util/defaultTokenParams.js.map +1 -1
  535. package/esm/node/oidc/util/oauthMeta.js +1 -0
  536. package/esm/node/oidc/util/oauthMeta.js.map +1 -1
  537. package/esm/node/oidc/util/validateClaims.js +9 -4
  538. package/esm/node/oidc/util/validateClaims.js.map +1 -1
  539. package/esm/node/oidc/verifyToken.js +2 -2
  540. package/esm/node/oidc/verifyToken.js.map +1 -1
  541. package/esm/node/package.json +1 -1
  542. package/package.json +12 -13
  543. package/polyfill/index.js +8 -5
  544. package/types/lib/core/options.d.ts +2 -0
  545. package/types/lib/idx/interact.d.ts +1 -0
  546. package/types/lib/idx/options.d.ts +2 -0
  547. package/types/lib/idx/types/meta.d.ts +1 -0
  548. package/types/lib/idx/types/options.d.ts +1 -0
  549. package/types/lib/oidc/options/OAuthOptionsConstructor.d.ts +2 -0
  550. package/types/lib/oidc/types/UserClaims.d.ts +1 -0
  551. package/types/lib/oidc/types/api.d.ts +1 -0
  552. package/types/lib/oidc/types/meta.d.ts +1 -1
  553. package/types/lib/oidc/types/options.d.ts +2 -1
  554. package/types/lib/oidc/types/proto.d.ts +1 -0
  555. package/umd/authn.js +1 -1
  556. package/umd/authn.js.LICENSE.txt +2 -0
  557. package/umd/authn.js.map +1 -1
  558. package/umd/core.js +1 -1
  559. package/umd/core.js.LICENSE.txt +2 -0
  560. package/umd/core.js.map +1 -1
  561. package/umd/default.js +1 -1
  562. package/umd/default.js.LICENSE.txt +2 -0
  563. package/umd/default.js.map +1 -1
  564. package/umd/idx.js +1 -1
  565. package/umd/idx.js.LICENSE.txt +2 -0
  566. package/umd/idx.js.map +1 -1
  567. package/umd/myaccount.js +1 -1
  568. package/umd/myaccount.js.LICENSE.txt +2 -0
  569. package/umd/myaccount.js.map +1 -1
@@ -1,13 +1,9 @@
1
1
  "use strict";
2
2
 
3
3
  exports.createStorageOptionsConstructor = createStorageOptionsConstructor;
4
-
5
4
  var _base = require("../../base");
6
-
7
5
  var _node = require("./node");
8
-
9
6
  var _features = require("../../features");
10
-
11
7
  /*!
12
8
  * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
13
9
  * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
@@ -19,6 +15,7 @@ var _features = require("../../features");
19
15
  *
20
16
  * See the License for the specific language governing permissions and limitations under the License.
21
17
  */
18
+
22
19
  function createStorageOptionsConstructor() {
23
20
  const BaseOptionsConstructor = (0, _base.createBaseOptionsConstructor)();
24
21
  return class StorageOptionsConstructor extends BaseOptionsConstructor {
@@ -26,11 +23,11 @@ function createStorageOptionsConstructor() {
26
23
  super(args);
27
24
  this.cookies = (0, _node.getCookieSettings)(args, (0, _features.isHTTPS)());
28
25
  this.storageUtil = args.storageUtil || (0, _node.getStorage)();
29
- this.storageManager = { ..._node.STORAGE_MANAGER_OPTIONS,
26
+ this.storageManager = {
27
+ ..._node.STORAGE_MANAGER_OPTIONS,
30
28
  ...args.storageManager
31
29
  };
32
30
  }
33
-
34
31
  };
35
32
  }
36
33
  //# sourceMappingURL=StorageOptionsConstructor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StorageOptionsConstructor.js","names":["createStorageOptionsConstructor","BaseOptionsConstructor","createBaseOptionsConstructor","StorageOptionsConstructor","constructor","args","cookies","getCookieSettings","isHTTPS","storageUtil","getStorage","storageManager","STORAGE_MANAGER_OPTIONS"],"sources":["../../../../lib/storage/options/StorageOptionsConstructor.ts"],"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\nimport { createBaseOptionsConstructor } from '../../base';\nimport { CookieOptions, OktaAuthStorageOptions, StorageManagerOptions, StorageUtil } from '../types';\nimport { getStorage, STORAGE_MANAGER_OPTIONS, getCookieSettings } from './node';\nimport { isHTTPS } from '../../features';\n\nexport function createStorageOptionsConstructor() {\n\n const BaseOptionsConstructor = createBaseOptionsConstructor();\n return class StorageOptionsConstructor extends BaseOptionsConstructor implements Required<OktaAuthStorageOptions> {\n cookies: CookieOptions;\n storageUtil: StorageUtil;\n storageManager: StorageManagerOptions;\n \n constructor(args: any) {\n super(args);\n this.cookies = getCookieSettings(args, isHTTPS())!;\n this.storageUtil = args.storageUtil || getStorage();\n this.storageManager = { ...STORAGE_MANAGER_OPTIONS, ...args.storageManager };\n }\n };\n}\n"],"mappings":";;;;AAYA;;AAEA;;AACA;;AAfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOO,SAASA,+BAAT,GAA2C;EAEhD,MAAMC,sBAAsB,GAAG,IAAAC,kCAAA,GAA/B;EACA,OAAO,MAAMC,yBAAN,SAAwCF,sBAAxC,CAA2G;IAKhHG,WAAW,CAACC,IAAD,EAAY;MACrB,MAAMA,IAAN;MACA,KAAKC,OAAL,GAAe,IAAAC,uBAAA,EAAkBF,IAAlB,EAAwB,IAAAG,iBAAA,GAAxB,CAAf;MACA,KAAKC,WAAL,GAAmBJ,IAAI,CAACI,WAAL,IAAoB,IAAAC,gBAAA,GAAvC;MACA,KAAKC,cAAL,GAAsB,EAAE,GAAGC,6BAAL;QAA8B,GAAGP,IAAI,CAACM;MAAtC,CAAtB;IACD;;EAV+G,CAAlH;AAYD"}
1
+ {"version":3,"file":"StorageOptionsConstructor.js","names":["createStorageOptionsConstructor","BaseOptionsConstructor","createBaseOptionsConstructor","StorageOptionsConstructor","constructor","args","cookies","getCookieSettings","isHTTPS","storageUtil","getStorage","storageManager","STORAGE_MANAGER_OPTIONS"],"sources":["../../../../lib/storage/options/StorageOptionsConstructor.ts"],"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\nimport { createBaseOptionsConstructor } from '../../base';\nimport { CookieOptions, OktaAuthStorageOptions, StorageManagerOptions, StorageUtil } from '../types';\nimport { getStorage, STORAGE_MANAGER_OPTIONS, getCookieSettings } from './node';\nimport { isHTTPS } from '../../features';\n\nexport function createStorageOptionsConstructor() {\n\n const BaseOptionsConstructor = createBaseOptionsConstructor();\n return class StorageOptionsConstructor extends BaseOptionsConstructor implements Required<OktaAuthStorageOptions> {\n cookies: CookieOptions;\n storageUtil: StorageUtil;\n storageManager: StorageManagerOptions;\n \n constructor(args: any) {\n super(args);\n this.cookies = getCookieSettings(args, isHTTPS())!;\n this.storageUtil = args.storageUtil || getStorage();\n this.storageManager = { ...STORAGE_MANAGER_OPTIONS, ...args.storageManager };\n }\n };\n}\n"],"mappings":";;;AAYA;AAEA;AACA;AAfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOO,SAASA,+BAA+B,GAAG;EAEhD,MAAMC,sBAAsB,GAAG,IAAAC,kCAA4B,GAAE;EAC7D,OAAO,MAAMC,yBAAyB,SAASF,sBAAsB,CAA6C;IAKhHG,WAAW,CAACC,IAAS,EAAE;MACrB,KAAK,CAACA,IAAI,CAAC;MACX,IAAI,CAACC,OAAO,GAAG,IAAAC,uBAAiB,EAACF,IAAI,EAAE,IAAAG,iBAAO,GAAE,CAAE;MAClD,IAAI,CAACC,WAAW,GAAGJ,IAAI,CAACI,WAAW,IAAI,IAAAC,gBAAU,GAAE;MACnD,IAAI,CAACC,cAAc,GAAG;QAAE,GAAGC,6BAAuB;QAAE,GAAGP,IAAI,CAACM;MAAe,CAAC;IAC9E;EACF,CAAC;AACH"}
@@ -1,15 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  exports.STORAGE_MANAGER_OPTIONS = void 0;
6
5
  exports.getCookieSettings = getCookieSettings;
7
6
  exports.getStorage = getStorage;
8
-
9
7
  var _util = require("../../util");
10
-
11
8
  var _browserStorage = _interopRequireDefault(require("../../browser/browserStorage"));
12
-
13
9
  /*!
14
10
  * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
15
11
  * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
@@ -23,14 +19,14 @@ var _browserStorage = _interopRequireDefault(require("../../browser/browserStora
23
19
  */
24
20
 
25
21
  /* eslint-disable complexity */
22
+
26
23
  function getStorage() {
27
24
  const storageUtil = Object.assign({}, _browserStorage.default, {
28
25
  inMemoryStore: {} // create unique storage for this instance
29
-
30
26
  });
27
+
31
28
  return storageUtil;
32
29
  }
33
-
34
30
  const STORAGE_MANAGER_OPTIONS = {
35
31
  token: {
36
32
  storageTypes: ['localStorage', 'sessionStorage', 'cookie']
@@ -49,34 +45,30 @@ const STORAGE_MANAGER_OPTIONS = {
49
45
  }
50
46
  };
51
47
  exports.STORAGE_MANAGER_OPTIONS = STORAGE_MANAGER_OPTIONS;
52
-
53
48
  function getCookieSettings(args = {}, isHTTPS) {
54
49
  // Secure cookies will be automatically used on a HTTPS connection
55
50
  // Non-secure cookies will be automatically used on a HTTP connection
56
51
  // secure option can override the automatic behavior
57
52
  var cookieSettings = args.cookies || {};
58
-
59
53
  if (typeof cookieSettings.secure === 'undefined') {
60
54
  cookieSettings.secure = isHTTPS;
61
55
  }
62
-
63
56
  if (typeof cookieSettings.sameSite === 'undefined') {
64
57
  cookieSettings.sameSite = cookieSettings.secure ? 'none' : 'lax';
65
- } // If secure=true, but the connection is not HTTPS, set secure=false.
66
-
58
+ }
67
59
 
60
+ // If secure=true, but the connection is not HTTPS, set secure=false.
68
61
  if (cookieSettings.secure && !isHTTPS) {
69
62
  // eslint-disable-next-line no-console
70
63
  (0, _util.warn)('The current page is not being served with the HTTPS protocol.\n' + 'For security reasons, we strongly recommend using HTTPS.\n' + 'If you cannot use HTTPS, set "cookies.secure" option to false.');
71
64
  cookieSettings.secure = false;
72
- } // Chrome >= 80 will block cookies with SameSite=None unless they are also Secure
73
- // If sameSite=none, but the connection is not HTTPS, set sameSite=lax.
74
-
65
+ }
75
66
 
67
+ // Chrome >= 80 will block cookies with SameSite=None unless they are also Secure
68
+ // If sameSite=none, but the connection is not HTTPS, set sameSite=lax.
76
69
  if (cookieSettings.sameSite === 'none' && !cookieSettings.secure) {
77
70
  cookieSettings.sameSite = 'lax';
78
71
  }
79
-
80
72
  return cookieSettings;
81
73
  }
82
74
  //# sourceMappingURL=browser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","names":["getStorage","storageUtil","Object","assign","browserStorage","inMemoryStore","STORAGE_MANAGER_OPTIONS","token","storageTypes","cache","transaction","getCookieSettings","args","isHTTPS","cookieSettings","cookies","secure","sameSite","warn"],"sources":["../../../../lib/storage/options/browser.ts"],"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/* eslint-disable complexity */\nimport { StorageManagerOptions, StorageUtil, OktaAuthStorageOptions } from '../types';\nimport { warn } from '../../util';\n\nimport { default as browserStorage } from '../../browser/browserStorage';\n\nexport function getStorage(): StorageUtil {\n const storageUtil = Object.assign({}, browserStorage, {\n inMemoryStore: {} // create unique storage for this instance\n });\n return storageUtil;\n}\n\nexport const STORAGE_MANAGER_OPTIONS: StorageManagerOptions = {\n token: {\n storageTypes: [\n 'localStorage',\n 'sessionStorage',\n 'cookie'\n ]\n },\n cache: {\n storageTypes: [\n 'localStorage',\n 'sessionStorage',\n 'cookie'\n ]\n },\n transaction: {\n storageTypes: [\n 'sessionStorage',\n 'localStorage',\n 'cookie'\n ]\n },\n 'shared-transaction': {\n storageTypes: [\n 'localStorage'\n ]\n },\n 'original-uri': {\n storageTypes: [\n 'localStorage'\n ]\n }\n};\n\nexport function getCookieSettings(args: OktaAuthStorageOptions = {}, isHTTPS: boolean) {\n // Secure cookies will be automatically used on a HTTPS connection\n // Non-secure cookies will be automatically used on a HTTP connection\n // secure option can override the automatic behavior\n var cookieSettings = args.cookies || {};\n if (typeof cookieSettings.secure === 'undefined') {\n cookieSettings.secure = isHTTPS;\n }\n if (typeof cookieSettings.sameSite === 'undefined') {\n cookieSettings.sameSite = cookieSettings.secure ? 'none' : 'lax';\n }\n\n // If secure=true, but the connection is not HTTPS, set secure=false.\n if (cookieSettings.secure && !isHTTPS) {\n // eslint-disable-next-line no-console\n warn(\n 'The current page is not being served with the HTTPS protocol.\\n' +\n 'For security reasons, we strongly recommend using HTTPS.\\n' +\n 'If you cannot use HTTPS, set \"cookies.secure\" option to false.'\n );\n cookieSettings.secure = false;\n }\n\n // Chrome >= 80 will block cookies with SameSite=None unless they are also Secure\n // If sameSite=none, but the connection is not HTTPS, set sameSite=lax.\n if (cookieSettings.sameSite === 'none' && !cookieSettings.secure) {\n cookieSettings.sameSite = 'lax';\n }\n\n return cookieSettings;\n}\n"],"mappings":";;;;;;;;AAcA;;AAEA;;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AAMO,SAASA,UAAT,GAAmC;EACxC,MAAMC,WAAW,GAAGC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBC,uBAAlB,EAAkC;IACpDC,aAAa,EAAE,EADqC,CAClC;;EADkC,CAAlC,CAApB;EAGA,OAAOJ,WAAP;AACD;;AAEM,MAAMK,uBAA8C,GAAG;EAC5DC,KAAK,EAAE;IACLC,YAAY,EAAE,CACZ,cADY,EAEZ,gBAFY,EAGZ,QAHY;EADT,CADqD;EAQ5DC,KAAK,EAAE;IACLD,YAAY,EAAE,CACZ,cADY,EAEZ,gBAFY,EAGZ,QAHY;EADT,CARqD;EAe5DE,WAAW,EAAE;IACXF,YAAY,EAAE,CACZ,gBADY,EAEZ,cAFY,EAGZ,QAHY;EADH,CAf+C;EAsB5D,sBAAsB;IACpBA,YAAY,EAAE,CACZ,cADY;EADM,CAtBsC;EA2B5D,gBAAgB;IACdA,YAAY,EAAE,CACZ,cADY;EADA;AA3B4C,CAAvD;;;AAkCA,SAASG,iBAAT,CAA2BC,IAA4B,GAAG,EAA1D,EAA8DC,OAA9D,EAAgF;EACrF;EACA;EACA;EACA,IAAIC,cAAc,GAAGF,IAAI,CAACG,OAAL,IAAgB,EAArC;;EACA,IAAI,OAAOD,cAAc,CAACE,MAAtB,KAAiC,WAArC,EAAkD;IAChDF,cAAc,CAACE,MAAf,GAAwBH,OAAxB;EACD;;EACD,IAAI,OAAOC,cAAc,CAACG,QAAtB,KAAmC,WAAvC,EAAoD;IAClDH,cAAc,CAACG,QAAf,GAA0BH,cAAc,CAACE,MAAf,GAAwB,MAAxB,GAAiC,KAA3D;EACD,CAVoF,CAYrF;;;EACA,IAAIF,cAAc,CAACE,MAAf,IAAyB,CAACH,OAA9B,EAAuC;IACrC;IACA,IAAAK,UAAA,EACE,oEACA,4DADA,GAEA,gEAHF;IAKAJ,cAAc,CAACE,MAAf,GAAwB,KAAxB;EACD,CArBoF,CAuBrF;EACA;;;EACA,IAAIF,cAAc,CAACG,QAAf,KAA4B,MAA5B,IAAsC,CAACH,cAAc,CAACE,MAA1D,EAAkE;IAChEF,cAAc,CAACG,QAAf,GAA0B,KAA1B;EACD;;EAED,OAAOH,cAAP;AACD"}
1
+ {"version":3,"file":"browser.js","names":["getStorage","storageUtil","Object","assign","browserStorage","inMemoryStore","STORAGE_MANAGER_OPTIONS","token","storageTypes","cache","transaction","getCookieSettings","args","isHTTPS","cookieSettings","cookies","secure","sameSite","warn"],"sources":["../../../../lib/storage/options/browser.ts"],"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/* eslint-disable complexity */\nimport { StorageManagerOptions, StorageUtil, OktaAuthStorageOptions } from '../types';\nimport { warn } from '../../util';\n\nimport { default as browserStorage } from '../../browser/browserStorage';\n\nexport function getStorage(): StorageUtil {\n const storageUtil = Object.assign({}, browserStorage, {\n inMemoryStore: {} // create unique storage for this instance\n });\n return storageUtil;\n}\n\nexport const STORAGE_MANAGER_OPTIONS: StorageManagerOptions = {\n token: {\n storageTypes: [\n 'localStorage',\n 'sessionStorage',\n 'cookie'\n ]\n },\n cache: {\n storageTypes: [\n 'localStorage',\n 'sessionStorage',\n 'cookie'\n ]\n },\n transaction: {\n storageTypes: [\n 'sessionStorage',\n 'localStorage',\n 'cookie'\n ]\n },\n 'shared-transaction': {\n storageTypes: [\n 'localStorage'\n ]\n },\n 'original-uri': {\n storageTypes: [\n 'localStorage'\n ]\n }\n};\n\nexport function getCookieSettings(args: OktaAuthStorageOptions = {}, isHTTPS: boolean) {\n // Secure cookies will be automatically used on a HTTPS connection\n // Non-secure cookies will be automatically used on a HTTP connection\n // secure option can override the automatic behavior\n var cookieSettings = args.cookies || {};\n if (typeof cookieSettings.secure === 'undefined') {\n cookieSettings.secure = isHTTPS;\n }\n if (typeof cookieSettings.sameSite === 'undefined') {\n cookieSettings.sameSite = cookieSettings.secure ? 'none' : 'lax';\n }\n\n // If secure=true, but the connection is not HTTPS, set secure=false.\n if (cookieSettings.secure && !isHTTPS) {\n // eslint-disable-next-line no-console\n warn(\n 'The current page is not being served with the HTTPS protocol.\\n' +\n 'For security reasons, we strongly recommend using HTTPS.\\n' +\n 'If you cannot use HTTPS, set \"cookies.secure\" option to false.'\n );\n cookieSettings.secure = false;\n }\n\n // Chrome >= 80 will block cookies with SameSite=None unless they are also Secure\n // If sameSite=none, but the connection is not HTTPS, set sameSite=lax.\n if (cookieSettings.sameSite === 'none' && !cookieSettings.secure) {\n cookieSettings.sameSite = 'lax';\n }\n\n return cookieSettings;\n}\n"],"mappings":";;;;;;AAcA;AAEA;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAMO,SAASA,UAAU,GAAgB;EACxC,MAAMC,WAAW,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEC,uBAAc,EAAE;IACpDC,aAAa,EAAE,CAAC,CAAC,CAAC;EACpB,CAAC,CAAC;;EACF,OAAOJ,WAAW;AACpB;AAEO,MAAMK,uBAA8C,GAAG;EAC5DC,KAAK,EAAE;IACLC,YAAY,EAAE,CACZ,cAAc,EACd,gBAAgB,EAChB,QAAQ;EAEZ,CAAC;EACDC,KAAK,EAAE;IACLD,YAAY,EAAE,CACZ,cAAc,EACd,gBAAgB,EAChB,QAAQ;EAEZ,CAAC;EACDE,WAAW,EAAE;IACXF,YAAY,EAAE,CACZ,gBAAgB,EAChB,cAAc,EACd,QAAQ;EAEZ,CAAC;EACD,oBAAoB,EAAE;IACpBA,YAAY,EAAE,CACZ,cAAc;EAElB,CAAC;EACD,cAAc,EAAE;IACdA,YAAY,EAAE,CACZ,cAAc;EAElB;AACF,CAAC;AAAC;AAEK,SAASG,iBAAiB,CAACC,IAA4B,GAAG,CAAC,CAAC,EAAEC,OAAgB,EAAE;EACrF;EACA;EACA;EACA,IAAIC,cAAc,GAAGF,IAAI,CAACG,OAAO,IAAI,CAAC,CAAC;EACvC,IAAI,OAAOD,cAAc,CAACE,MAAM,KAAK,WAAW,EAAE;IAChDF,cAAc,CAACE,MAAM,GAAGH,OAAO;EACjC;EACA,IAAI,OAAOC,cAAc,CAACG,QAAQ,KAAK,WAAW,EAAE;IAClDH,cAAc,CAACG,QAAQ,GAAGH,cAAc,CAACE,MAAM,GAAG,MAAM,GAAG,KAAK;EAClE;;EAEA;EACA,IAAIF,cAAc,CAACE,MAAM,IAAI,CAACH,OAAO,EAAE;IACrC;IACA,IAAAK,UAAI,EACF,iEAAiE,GACjE,4DAA4D,GAC5D,gEAAgE,CACjE;IACDJ,cAAc,CAACE,MAAM,GAAG,KAAK;EAC/B;;EAEA;EACA;EACA,IAAIF,cAAc,CAACG,QAAQ,KAAK,MAAM,IAAI,CAACH,cAAc,CAACE,MAAM,EAAE;IAChEF,cAAc,CAACG,QAAQ,GAAG,KAAK;EACjC;EAEA,OAAOH,cAAc;AACvB"}
@@ -1,13 +1,10 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  exports.STORAGE_MANAGER_OPTIONS = void 0;
6
5
  exports.getCookieSettings = getCookieSettings;
7
6
  exports.getStorage = getStorage;
8
-
9
7
  var _serverStorage = _interopRequireDefault(require("../../server/serverStorage"));
10
-
11
8
  /*!
12
9
  * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
13
10
  * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
@@ -19,10 +16,10 @@ var _serverStorage = _interopRequireDefault(require("../../server/serverStorage"
19
16
  *
20
17
  * See the License for the specific language governing permissions and limitations under the License.
21
18
  */
19
+
22
20
  function getStorage() {
23
21
  return _serverStorage.default;
24
22
  }
25
-
26
23
  const STORAGE_MANAGER_OPTIONS = {
27
24
  token: {
28
25
  storageTypes: ['memory']
@@ -33,10 +30,10 @@ const STORAGE_MANAGER_OPTIONS = {
33
30
  transaction: {
34
31
  storageTypes: ['memory']
35
32
  }
36
- }; // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
33
+ };
37
34
 
35
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
38
36
  exports.STORAGE_MANAGER_OPTIONS = STORAGE_MANAGER_OPTIONS;
39
-
40
37
  function getCookieSettings(args = {}, isHTTPS) {
41
38
  return args.cookies;
42
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","names":["getStorage","storage","STORAGE_MANAGER_OPTIONS","token","storageTypes","cache","transaction","getCookieSettings","args","isHTTPS","cookies"],"sources":["../../../../lib/storage/options/node.ts"],"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\nimport { StorageManagerOptions, OktaAuthStorageOptions, StorageUtil } from '../types';\n\nimport { default as storage } from '../../server/serverStorage';\n\nexport function getStorage(): StorageUtil {\n return storage;\n}\n\nexport const STORAGE_MANAGER_OPTIONS: StorageManagerOptions = {\n token: {\n storageTypes: [\n 'memory'\n ]\n },\n cache: {\n storageTypes: [\n 'memory'\n ]\n },\n transaction: {\n storageTypes: [\n 'memory'\n ]\n }\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\nexport function getCookieSettings(args: OktaAuthStorageOptions = {}, isHTTPS?: boolean) {\n return args.cookies;\n}\n"],"mappings":";;;;;;;;AAcA;;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMO,SAASA,UAAT,GAAmC;EACxC,OAAOC,sBAAP;AACD;;AAEM,MAAMC,uBAA8C,GAAG;EAC5DC,KAAK,EAAE;IACLC,YAAY,EAAE,CACZ,QADY;EADT,CADqD;EAM5DC,KAAK,EAAE;IACLD,YAAY,EAAE,CACZ,QADY;EADT,CANqD;EAW5DE,WAAW,EAAE;IACXF,YAAY,EAAE,CACZ,QADY;EADH;AAX+C,CAAvD,C,CAkBP;;;;AACO,SAASG,iBAAT,CAA2BC,IAA4B,GAAG,EAA1D,EAA8DC,OAA9D,EAAiF;EACtF,OAAOD,IAAI,CAACE,OAAZ;AACD"}
1
+ {"version":3,"file":"node.js","names":["getStorage","storage","STORAGE_MANAGER_OPTIONS","token","storageTypes","cache","transaction","getCookieSettings","args","isHTTPS","cookies"],"sources":["../../../../lib/storage/options/node.ts"],"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\nimport { StorageManagerOptions, OktaAuthStorageOptions, StorageUtil } from '../types';\n\nimport { default as storage } from '../../server/serverStorage';\n\nexport function getStorage(): StorageUtil {\n return storage;\n}\n\nexport const STORAGE_MANAGER_OPTIONS: StorageManagerOptions = {\n token: {\n storageTypes: [\n 'memory'\n ]\n },\n cache: {\n storageTypes: [\n 'memory'\n ]\n },\n transaction: {\n storageTypes: [\n 'memory'\n ]\n }\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\nexport function getCookieSettings(args: OktaAuthStorageOptions = {}, isHTTPS?: boolean) {\n return args.cookies;\n}\n"],"mappings":";;;;;;AAcA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMO,SAASA,UAAU,GAAgB;EACxC,OAAOC,sBAAO;AAChB;AAEO,MAAMC,uBAA8C,GAAG;EAC5DC,KAAK,EAAE;IACLC,YAAY,EAAE,CACZ,QAAQ;EAEZ,CAAC;EACDC,KAAK,EAAE;IACLD,YAAY,EAAE,CACZ,QAAQ;EAEZ,CAAC;EACDE,WAAW,EAAE;IACXF,YAAY,EAAE,CACZ,QAAQ;EAEZ;AACF,CAAC;;AAED;AAAA;AACO,SAASG,iBAAiB,CAACC,IAA4B,GAAG,CAAC,CAAC,EAAEC,OAAiB,EAAE;EACtF,OAAOD,IAAI,CAACE,OAAO;AACrB"}
@@ -1,11 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  exports.PromiseQueue = void 0;
4
-
5
4
  var _types = require("./types");
6
-
7
5
  var _console = require("./console");
8
-
9
6
  /*!
10
7
  * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
11
8
  * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
@@ -17,9 +14,11 @@ var _console = require("./console");
17
14
  *
18
15
  * See the License for the specific language governing permissions and limitations under the License.
19
16
  */
17
+
20
18
  // Implements a queue for synchronous or asynchronous methods
21
19
  // Methods will be wrapped in a promise and execute sequentially
22
20
  // This can be used to prevent concurrent calls to a single method or a set of methods
21
+
23
22
  class PromiseQueue {
24
23
  constructor(options = {
25
24
  quiet: false
@@ -27,11 +26,11 @@ class PromiseQueue {
27
26
  this.queue = [];
28
27
  this.running = false;
29
28
  this.options = options;
30
- } // Returns a promise
29
+ }
30
+
31
+ // Returns a promise
31
32
  // If the method is synchronous, it will resolve when the method completes
32
33
  // If the method returns a promise, it will resolve (or reject) with the value from the method's promise
33
-
34
-
35
34
  push(method, thisObject, ...args) {
36
35
  return new Promise((resolve, reject) => {
37
36
  if (this.queue.length > 0) {
@@ -41,7 +40,6 @@ class PromiseQueue {
41
40
  (0, _console.warn)('Async method is being called but another async method is already running. ' + 'The new method will be delayed until the previous method completes.');
42
41
  }
43
42
  }
44
-
45
43
  this.queue.push({
46
44
  method,
47
45
  thisObject,
@@ -52,21 +50,17 @@ class PromiseQueue {
52
50
  this.run();
53
51
  });
54
52
  }
55
-
56
53
  run() {
57
54
  if (this.running) {
58
55
  return;
59
56
  }
60
-
61
57
  if (this.queue.length === 0) {
62
58
  return;
63
59
  }
64
-
65
- this.running = true; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
66
-
60
+ this.running = true;
61
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
67
62
  var queueItem = this.queue.shift();
68
63
  var res = queueItem.method.apply(queueItem.thisObject, queueItem.args);
69
-
70
64
  if ((0, _types.isPromise)(res)) {
71
65
  res.then(queueItem.resolve, queueItem.reject).finally(() => {
72
66
  this.running = false;
@@ -78,8 +72,6 @@ class PromiseQueue {
78
72
  this.run();
79
73
  }
80
74
  }
81
-
82
75
  }
83
-
84
76
  exports.PromiseQueue = PromiseQueue;
85
77
  //# sourceMappingURL=PromiseQueue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PromiseQueue.js","names":["PromiseQueue","constructor","options","quiet","queue","running","push","method","thisObject","args","Promise","resolve","reject","length","warn","run","queueItem","shift","res","apply","isPromise","then","finally"],"sources":["../../../lib/util/PromiseQueue.ts"],"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// Implements a queue for synchronous or asynchronous methods\n// Methods will be wrapped in a promise and execute sequentially\n// This can be used to prevent concurrent calls to a single method or a set of methods\n\nimport { isPromise } from './types';\nimport { warn } from './console';\n\ninterface QueueItem {\n method: () => void;\n thisObject: object;\n args: any[];\n resolve: (value?: unknown) => void;\n reject: (reason?: unknown) => void;\n}\n\ninterface PromiseQueueOptions {\n quiet?: boolean; // if false, concurrrency warnings will not be logged\n}\nexport class PromiseQueue {\n queue: QueueItem[];\n running: boolean;\n options: PromiseQueueOptions;\n\n constructor(options: PromiseQueueOptions = { quiet: false }) {\n this.queue = [];\n this.running = false;\n this.options = options;\n }\n\n // Returns a promise\n // If the method is synchronous, it will resolve when the method completes\n // If the method returns a promise, it will resolve (or reject) with the value from the method's promise\n push(method: (...args: any) => any, thisObject: any, ...args: any[]) {\n return new Promise((resolve, reject) => {\n if (this.queue.length > 0) {\n // There is at least one other pending call.\n // The PromiseQueue will prevent these methods from running concurrently.\n if (this.options.quiet !== false) {\n warn(\n 'Async method is being called but another async method is already running. ' +\n 'The new method will be delayed until the previous method completes.'\n );\n }\n }\n this.queue.push({\n method,\n thisObject,\n args,\n resolve,\n reject\n });\n this.run();\n });\n }\n\n run() {\n if (this.running) {\n return;\n }\n if (this.queue.length === 0) {\n return;\n }\n this.running = true;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n var queueItem = this.queue.shift()!;\n var res = queueItem.method.apply(queueItem.thisObject, queueItem.args as never) as unknown;\n if (isPromise(res)) {\n (res as Promise<unknown>).then(queueItem.resolve, queueItem.reject).finally(() => {\n this.running = false;\n this.run();\n });\n } else {\n queueItem.resolve(res);\n this.running = false;\n this.run();\n }\n }\n}\n"],"mappings":";;;;AAgBA;;AACA;;AAjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAgBO,MAAMA,YAAN,CAAmB;EAKxBC,WAAW,CAACC,OAA4B,GAAG;IAAEC,KAAK,EAAE;EAAT,CAAhC,EAAkD;IAC3D,KAAKC,KAAL,GAAa,EAAb;IACA,KAAKC,OAAL,GAAe,KAAf;IACA,KAAKH,OAAL,GAAeA,OAAf;EACD,CATuB,CAWxB;EACA;EACA;;;EACAI,IAAI,CAACC,MAAD,EAAgCC,UAAhC,EAAiD,GAAGC,IAApD,EAAiE;IACnE,OAAO,IAAIC,OAAJ,CAAY,CAACC,OAAD,EAAUC,MAAV,KAAqB;MACtC,IAAI,KAAKR,KAAL,CAAWS,MAAX,GAAoB,CAAxB,EAA2B;QACzB;QACA;QACA,IAAI,KAAKX,OAAL,CAAaC,KAAb,KAAuB,KAA3B,EAAkC;UAChC,IAAAW,aAAA,EACE,+EACA,qEAFF;QAID;MACF;;MACD,KAAKV,KAAL,CAAWE,IAAX,CAAgB;QACdC,MADc;QAEdC,UAFc;QAGdC,IAHc;QAIdE,OAJc;QAKdC;MALc,CAAhB;MAOA,KAAKG,GAAL;IACD,CAnBM,CAAP;EAoBD;;EAEDA,GAAG,GAAG;IACJ,IAAI,KAAKV,OAAT,EAAkB;MAChB;IACD;;IACD,IAAI,KAAKD,KAAL,CAAWS,MAAX,KAAsB,CAA1B,EAA6B;MAC3B;IACD;;IACD,KAAKR,OAAL,GAAe,IAAf,CAPI,CAQJ;;IACA,IAAIW,SAAS,GAAG,KAAKZ,KAAL,CAAWa,KAAX,EAAhB;IACA,IAAIC,GAAG,GAAGF,SAAS,CAACT,MAAV,CAAiBY,KAAjB,CAAuBH,SAAS,CAACR,UAAjC,EAA6CQ,SAAS,CAACP,IAAvD,CAAV;;IACA,IAAI,IAAAW,gBAAA,EAAUF,GAAV,CAAJ,EAAoB;MACjBA,GAAD,CAA0BG,IAA1B,CAA+BL,SAAS,CAACL,OAAzC,EAAkDK,SAAS,CAACJ,MAA5D,EAAoEU,OAApE,CAA4E,MAAM;QAChF,KAAKjB,OAAL,GAAe,KAAf;QACA,KAAKU,GAAL;MACD,CAHD;IAID,CALD,MAKO;MACLC,SAAS,CAACL,OAAV,CAAkBO,GAAlB;MACA,KAAKb,OAAL,GAAe,KAAf;MACA,KAAKU,GAAL;IACD;EACF;;AA1DuB"}
1
+ {"version":3,"file":"PromiseQueue.js","names":["PromiseQueue","constructor","options","quiet","queue","running","push","method","thisObject","args","Promise","resolve","reject","length","warn","run","queueItem","shift","res","apply","isPromise","then","finally"],"sources":["../../../lib/util/PromiseQueue.ts"],"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// Implements a queue for synchronous or asynchronous methods\n// Methods will be wrapped in a promise and execute sequentially\n// This can be used to prevent concurrent calls to a single method or a set of methods\n\nimport { isPromise } from './types';\nimport { warn } from './console';\n\ninterface QueueItem {\n method: () => void;\n thisObject: object;\n args: any[];\n resolve: (value?: unknown) => void;\n reject: (reason?: unknown) => void;\n}\n\ninterface PromiseQueueOptions {\n quiet?: boolean; // if false, concurrrency warnings will not be logged\n}\nexport class PromiseQueue {\n queue: QueueItem[];\n running: boolean;\n options: PromiseQueueOptions;\n\n constructor(options: PromiseQueueOptions = { quiet: false }) {\n this.queue = [];\n this.running = false;\n this.options = options;\n }\n\n // Returns a promise\n // If the method is synchronous, it will resolve when the method completes\n // If the method returns a promise, it will resolve (or reject) with the value from the method's promise\n push(method: (...args: any) => any, thisObject: any, ...args: any[]) {\n return new Promise((resolve, reject) => {\n if (this.queue.length > 0) {\n // There is at least one other pending call.\n // The PromiseQueue will prevent these methods from running concurrently.\n if (this.options.quiet !== false) {\n warn(\n 'Async method is being called but another async method is already running. ' +\n 'The new method will be delayed until the previous method completes.'\n );\n }\n }\n this.queue.push({\n method,\n thisObject,\n args,\n resolve,\n reject\n });\n this.run();\n });\n }\n\n run() {\n if (this.running) {\n return;\n }\n if (this.queue.length === 0) {\n return;\n }\n this.running = true;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n var queueItem = this.queue.shift()!;\n var res = queueItem.method.apply(queueItem.thisObject, queueItem.args as never) as unknown;\n if (isPromise(res)) {\n (res as Promise<unknown>).then(queueItem.resolve, queueItem.reject).finally(() => {\n this.running = false;\n this.run();\n });\n } else {\n queueItem.resolve(res);\n this.running = false;\n this.run();\n }\n }\n}\n"],"mappings":";;;AAgBA;AACA;AAjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAgBO,MAAMA,YAAY,CAAC;EAKxBC,WAAW,CAACC,OAA4B,GAAG;IAAEC,KAAK,EAAE;EAAM,CAAC,EAAE;IAC3D,IAAI,CAACC,KAAK,GAAG,EAAE;IACf,IAAI,CAACC,OAAO,GAAG,KAAK;IACpB,IAAI,CAACH,OAAO,GAAGA,OAAO;EACxB;;EAEA;EACA;EACA;EACAI,IAAI,CAACC,MAA6B,EAAEC,UAAe,EAAE,GAAGC,IAAW,EAAE;IACnE,OAAO,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;MACtC,IAAI,IAAI,CAACR,KAAK,CAACS,MAAM,GAAG,CAAC,EAAE;QACzB;QACA;QACA,IAAI,IAAI,CAACX,OAAO,CAACC,KAAK,KAAK,KAAK,EAAE;UAChC,IAAAW,aAAI,EACF,4EAA4E,GAC5E,qEAAqE,CACtE;QACH;MACF;MACA,IAAI,CAACV,KAAK,CAACE,IAAI,CAAC;QACdC,MAAM;QACNC,UAAU;QACVC,IAAI;QACJE,OAAO;QACPC;MACF,CAAC,CAAC;MACF,IAAI,CAACG,GAAG,EAAE;IACZ,CAAC,CAAC;EACJ;EAEAA,GAAG,GAAG;IACJ,IAAI,IAAI,CAACV,OAAO,EAAE;MAChB;IACF;IACA,IAAI,IAAI,CAACD,KAAK,CAACS,MAAM,KAAK,CAAC,EAAE;MAC3B;IACF;IACA,IAAI,CAACR,OAAO,GAAG,IAAI;IACnB;IACA,IAAIW,SAAS,GAAG,IAAI,CAACZ,KAAK,CAACa,KAAK,EAAG;IACnC,IAAIC,GAAG,GAAGF,SAAS,CAACT,MAAM,CAACY,KAAK,CAACH,SAAS,CAACR,UAAU,EAAEQ,SAAS,CAACP,IAAI,CAAqB;IAC1F,IAAI,IAAAW,gBAAS,EAACF,GAAG,CAAC,EAAE;MACjBA,GAAG,CAAsBG,IAAI,CAACL,SAAS,CAACL,OAAO,EAAEK,SAAS,CAACJ,MAAM,CAAC,CAACU,OAAO,CAAC,MAAM;QAChF,IAAI,CAACjB,OAAO,GAAG,KAAK;QACpB,IAAI,CAACU,GAAG,EAAE;MACZ,CAAC,CAAC;IACJ,CAAC,MAAM;MACLC,SAAS,CAACL,OAAO,CAACO,GAAG,CAAC;MACtB,IAAI,CAACb,OAAO,GAAG,KAAK;MACpB,IAAI,CAACU,GAAG,EAAE;IACZ;EACF;AACF;AAAC"}
@@ -5,7 +5,6 @@ exports.deprecateWrap = deprecateWrap;
5
5
  exports.getConsole = getConsole;
6
6
  exports.getNativeConsole = getNativeConsole;
7
7
  exports.warn = warn;
8
-
9
8
  /*!
10
9
  * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
11
10
  * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
@@ -17,8 +16,8 @@ exports.warn = warn;
17
16
  *
18
17
  * See the License for the specific language governing permissions and limitations under the License.
19
18
  */
20
-
21
19
  /* global window */
20
+
22
21
  function getNativeConsole() {
23
22
  if (typeof window !== 'undefined') {
24
23
  return window.console;
@@ -28,15 +27,13 @@ function getNativeConsole() {
28
27
  return undefined;
29
28
  }
30
29
  }
31
-
32
30
  function getConsole() {
33
- var nativeConsole = getNativeConsole(); // eslint-disable-next-line @typescript-eslint/ban-ts-comment
31
+ var nativeConsole = getNativeConsole();
32
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
34
33
  // @ts-ignore
35
-
36
34
  if (nativeConsole && nativeConsole.log) {
37
35
  return nativeConsole;
38
36
  }
39
-
40
37
  return {
41
38
  log: function () {},
42
39
  warn: function () {},
@@ -44,7 +41,6 @@ function getConsole() {
44
41
  groupEnd: function () {}
45
42
  };
46
43
  }
47
-
48
44
  function warn(text) {
49
45
  /* eslint-disable no-console */
50
46
  getConsole().warn('[okta-auth-sdk] WARN: ' + text);
@@ -1 +1 @@
1
- {"version":3,"file":"console.js","names":["getNativeConsole","window","console","undefined","getConsole","nativeConsole","log","warn","group","groupEnd","text","deprecate","deprecateWrap","fn","apply","arguments"],"sources":["../../../lib/util/console.ts"],"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 // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\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"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AAEO,SAASA,gBAAT,GAA4B;EACjC,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;IACjC,OAAOA,MAAM,CAACC,OAAd;EACD,CAFD,MAEO,IAAI,OAAOA,OAAP,KAAmB,WAAvB,EAAoC;IACzC,OAAOA,OAAP;EACD,CAFM,MAEA;IACL,OAAOC,SAAP;EACD;AACF;;AAEM,SAASC,UAAT,GAAsB;EAC3B,IAAIC,aAAa,GAAGL,gBAAgB,EAApC,CAD2B,CAE3B;EACA;;EACA,IAAIK,aAAa,IAAIA,aAAa,CAACC,GAAnC,EAAwC;IACtC,OAAOD,aAAP;EACD;;EACD,OAAO;IACLC,GAAG,EAAE,YAAW,CAAE,CADb;IAELC,IAAI,EAAE,YAAW,CAAE,CAFd;IAGLC,KAAK,EAAE,YAAW,CAAE,CAHf;IAILC,QAAQ,EAAE,YAAW,CAAE;EAJlB,CAAP;AAMD;;AAEM,SAASF,IAAT,CAAcG,IAAd,EAAoB;EACzB;EACAN,UAAU,GAAGG,IAAb,CAAkB,2BAA2BG,IAA7C;EACA;AACD;;AAEM,SAASC,SAAT,CAAmBD,IAAnB,EAAyB;EAC9B;EACAN,UAAU,GAAGG,IAAb,CAAkB,kCAAkCG,IAApD;EACA;AACD;;AAEM,SAASE,aAAT,CAAuBF,IAAvB,EAA6BG,EAA7B,EAAiC;EACtC,OAAO,YAAW;IAChBF,SAAS,CAACD,IAAD,CAAT;IACA,OAAOG,EAAE,CAACC,KAAH,CAAS,IAAT,EAAeC,SAAf,CAAP;EACD,CAHD;AAID"}
1
+ {"version":3,"file":"console.js","names":["getNativeConsole","window","console","undefined","getConsole","nativeConsole","log","warn","group","groupEnd","text","deprecate","deprecateWrap","fn","apply","arguments"],"sources":["../../../lib/util/console.ts"],"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 // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\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"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,SAASA,gBAAgB,GAAG;EACjC,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE;IACjC,OAAOA,MAAM,CAACC,OAAO;EACvB,CAAC,MAAM,IAAI,OAAOA,OAAO,KAAK,WAAW,EAAE;IACzC,OAAOA,OAAO;EAChB,CAAC,MAAM;IACL,OAAOC,SAAS;EAClB;AACF;AAEO,SAASC,UAAU,GAAG;EAC3B,IAAIC,aAAa,GAAGL,gBAAgB,EAAE;EACtC;EACA;EACA,IAAIK,aAAa,IAAIA,aAAa,CAACC,GAAG,EAAE;IACtC,OAAOD,aAAa;EACtB;EACA,OAAO;IACLC,GAAG,EAAE,YAAW,CAAC,CAAC;IAClBC,IAAI,EAAE,YAAW,CAAC,CAAC;IACnBC,KAAK,EAAE,YAAW,CAAC,CAAC;IACpBC,QAAQ,EAAE,YAAW,CAAC;EACxB,CAAC;AACH;AAEO,SAASF,IAAI,CAACG,IAAI,EAAE;EACzB;EACAN,UAAU,EAAE,CAACG,IAAI,CAAC,wBAAwB,GAAGG,IAAI,CAAC;EAClD;AACF;;AAEO,SAASC,SAAS,CAACD,IAAI,EAAE;EAC9B;EACAN,UAAU,EAAE,CAACG,IAAI,CAAC,+BAA+B,GAAGG,IAAI,CAAC;EACzD;AACF;;AAEO,SAASE,aAAa,CAACF,IAAI,EAAEG,EAAE,EAAE;EACtC,OAAO,YAAW;IAChBF,SAAS,CAACD,IAAI,CAAC;IACf,OAAOG,EAAE,CAACC,KAAK,CAAC,IAAI,EAAEC,SAAS,CAAC;EAClC,CAAC;AACH"}
package/cjs/util/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _console = require("./console");
4
-
5
4
  Object.keys(_console).forEach(function (key) {
6
5
  if (key === "default" || key === "__esModule") return;
7
6
  if (key in exports && exports[key] === _console[key]) return;
@@ -12,9 +11,7 @@ Object.keys(_console).forEach(function (key) {
12
11
  }
13
12
  });
14
13
  });
15
-
16
14
  var _misc = require("./misc");
17
-
18
15
  Object.keys(_misc).forEach(function (key) {
19
16
  if (key === "default" || key === "__esModule") return;
20
17
  if (key in exports && exports[key] === _misc[key]) return;
@@ -25,9 +22,7 @@ Object.keys(_misc).forEach(function (key) {
25
22
  }
26
23
  });
27
24
  });
28
-
29
25
  var _object = require("./object");
30
-
31
26
  Object.keys(_object).forEach(function (key) {
32
27
  if (key === "default" || key === "__esModule") return;
33
28
  if (key in exports && exports[key] === _object[key]) return;
@@ -38,9 +33,7 @@ Object.keys(_object).forEach(function (key) {
38
33
  }
39
34
  });
40
35
  });
41
-
42
36
  var _PromiseQueue = require("./PromiseQueue");
43
-
44
37
  Object.keys(_PromiseQueue).forEach(function (key) {
45
38
  if (key === "default" || key === "__esModule") return;
46
39
  if (key in exports && exports[key] === _PromiseQueue[key]) return;
@@ -51,9 +44,7 @@ Object.keys(_PromiseQueue).forEach(function (key) {
51
44
  }
52
45
  });
53
46
  });
54
-
55
47
  var _types = require("./types");
56
-
57
48
  Object.keys(_types).forEach(function (key) {
58
49
  if (key === "default" || key === "__esModule") return;
59
50
  if (key in exports && exports[key] === _types[key]) return;
@@ -64,9 +55,7 @@ Object.keys(_types).forEach(function (key) {
64
55
  }
65
56
  });
66
57
  });
67
-
68
58
  var _url = require("./url");
69
-
70
59
  Object.keys(_url).forEach(function (key) {
71
60
  if (key === "default" || key === "__esModule") return;
72
61
  if (key in exports && exports[key] === _url[key]) return;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../lib/util/index.ts"],"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 './PromiseQueue';\nexport * from './types';\nexport * from './url';\n"],"mappings":";;AAaA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../lib/util/index.ts"],"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 './PromiseQueue';\nexport * from './types';\nexport * from './url';\n"],"mappings":";;AAaA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
package/cjs/util/misc.js CHANGED
@@ -4,7 +4,6 @@ exports.delay = delay;
4
4
  exports.genRandomString = genRandomString;
5
5
  exports.isoToUTCString = isoToUTCString;
6
6
  exports.split2 = split2;
7
-
8
7
  /*!
9
8
  * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
10
9
  * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
@@ -16,30 +15,26 @@ exports.split2 = split2;
16
15
  *
17
16
  * See the License for the specific language governing permissions and limitations under the License.
18
17
  */
18
+
19
19
  function isoToUTCString(str) {
20
20
  var parts = str.match(/\d+/g),
21
- isoTime = Date.UTC(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]),
22
- isoDate = new Date(isoTime);
21
+ isoTime = Date.UTC(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]),
22
+ isoDate = new Date(isoTime);
23
23
  return isoDate.toUTCString();
24
24
  }
25
-
26
25
  function genRandomString(length) {
27
26
  var randomCharset = 'abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
28
27
  var random = '';
29
-
30
28
  for (var c = 0, cl = randomCharset.length; c < length; ++c) {
31
29
  random += randomCharset[Math.floor(Math.random() * cl)];
32
30
  }
33
-
34
31
  return random;
35
32
  }
36
-
37
33
  function delay(ms) {
38
34
  return new Promise(function (resolve) {
39
35
  setTimeout(resolve, ms);
40
36
  });
41
37
  }
42
-
43
38
  function split2(str, delim) {
44
39
  const parts = str.split(delim);
45
40
  return [parts[0], parts.splice(1, parts.length).join(delim)];
@@ -1 +1 @@
1
- {"version":3,"file":"misc.js","names":["isoToUTCString","str","parts","match","isoTime","Date","UTC","isoDate","toUTCString","genRandomString","length","randomCharset","random","c","cl","Math","floor","delay","ms","Promise","resolve","setTimeout","split2","delim","split","splice","join"],"sources":["../../../lib/util/misc.ts"],"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\nexport function split2(str, delim) {\n const parts = str.split(delim);\n return [\n parts[0], \n parts.splice(1, parts.length).join(delim),\n ];\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEO,SAASA,cAAT,CAAwBC,GAAxB,EAA6B;EAClC,IAAIC,KAAK,GAAGD,GAAG,CAACE,KAAJ,CAAU,MAAV,CAAZ;EAAA,IACIC,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;EAAA,IAEIK,OAAO,GAAG,IAAIF,IAAJ,CAASD,OAAT,CAFd;EAIA,OAAOG,OAAO,CAACC,WAAR,EAAP;AACD;;AAEM,SAASC,eAAT,CAAyBC,MAAzB,EAAiC;EACtC,IAAIC,aAAa,GAAG,+DAApB;EACA,IAAIC,MAAM,GAAG,EAAb;;EACA,KAAK,IAAIC,CAAC,GAAG,CAAR,EAAWC,EAAE,GAAGH,aAAa,CAACD,MAAnC,EAA2CG,CAAC,GAAGH,MAA/C,EAAuD,EAAEG,CAAzD,EAA4D;IAC1DD,MAAM,IAAID,aAAa,CAACI,IAAI,CAACC,KAAL,CAAWD,IAAI,CAACH,MAAL,KAAgBE,EAA3B,CAAD,CAAvB;EACD;;EACD,OAAOF,MAAP;AACD;;AAEM,SAASK,KAAT,CAAeC,EAAf,EAAmB;EACxB,OAAO,IAAIC,OAAJ,CAAY,UAASC,OAAT,EAAkB;IACnCC,UAAU,CAACD,OAAD,EAAUF,EAAV,CAAV;EACD,CAFM,CAAP;AAGD;;AAEM,SAASI,MAAT,CAAgBrB,GAAhB,EAAqBsB,KAArB,EAA4B;EACjC,MAAMrB,KAAK,GAAGD,GAAG,CAACuB,KAAJ,CAAUD,KAAV,CAAd;EACA,OAAO,CACLrB,KAAK,CAAC,CAAD,CADA,EAELA,KAAK,CAACuB,MAAN,CAAa,CAAb,EAAgBvB,KAAK,CAACQ,MAAtB,EAA8BgB,IAA9B,CAAmCH,KAAnC,CAFK,CAAP;AAID"}
1
+ {"version":3,"file":"misc.js","names":["isoToUTCString","str","parts","match","isoTime","Date","UTC","isoDate","toUTCString","genRandomString","length","randomCharset","random","c","cl","Math","floor","delay","ms","Promise","resolve","setTimeout","split2","delim","split","splice","join"],"sources":["../../../lib/util/misc.ts"],"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\nexport function split2(str, delim) {\n const parts = str.split(delim);\n return [\n parts[0], \n parts.splice(1, parts.length).join(delim),\n ];\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,SAASA,cAAc,CAACC,GAAG,EAAE;EAClC,IAAIC,KAAK,GAAGD,GAAG,CAACE,KAAK,CAAC,MAAM,CAAC;IACzBC,OAAO,GAAGC,IAAI,CAACC,GAAG,CAACJ,KAAK,CAAC,CAAC,CAAC,EAAEA,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,EAAEA,KAAK,CAAC,CAAC,CAAC,EAAEA,KAAK,CAAC,CAAC,CAAC,EAAEA,KAAK,CAAC,CAAC,CAAC,EAAEA,KAAK,CAAC,CAAC,CAAC,CAAC;IAClFK,OAAO,GAAG,IAAIF,IAAI,CAACD,OAAO,CAAC;EAE/B,OAAOG,OAAO,CAACC,WAAW,EAAE;AAC9B;AAEO,SAASC,eAAe,CAACC,MAAM,EAAE;EACtC,IAAIC,aAAa,GAAG,+DAA+D;EACnF,IAAIC,MAAM,GAAG,EAAE;EACf,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEC,EAAE,GAAGH,aAAa,CAACD,MAAM,EAAEG,CAAC,GAAGH,MAAM,EAAE,EAAEG,CAAC,EAAE;IAC1DD,MAAM,IAAID,aAAa,CAACI,IAAI,CAACC,KAAK,CAACD,IAAI,CAACH,MAAM,EAAE,GAAGE,EAAE,CAAC,CAAC;EACzD;EACA,OAAOF,MAAM;AACf;AAEO,SAASK,KAAK,CAACC,EAAE,EAAE;EACxB,OAAO,IAAIC,OAAO,CAAC,UAASC,OAAO,EAAE;IACnCC,UAAU,CAACD,OAAO,EAAEF,EAAE,CAAC;EACzB,CAAC,CAAC;AACJ;AAEO,SAASI,MAAM,CAACrB,GAAG,EAAEsB,KAAK,EAAE;EACjC,MAAMrB,KAAK,GAAGD,GAAG,CAACuB,KAAK,CAACD,KAAK,CAAC;EAC9B,OAAO,CACLrB,KAAK,CAAC,CAAC,CAAC,EACRA,KAAK,CAACuB,MAAM,CAAC,CAAC,EAAEvB,KAAK,CAACQ,MAAM,CAAC,CAACgB,IAAI,CAACH,KAAK,CAAC,CAC1C;AACH"}
@@ -7,7 +7,6 @@ exports.find = find;
7
7
  exports.getLink = getLink;
8
8
  exports.omit = omit;
9
9
  exports.removeNils = removeNils;
10
-
11
10
  /*!
12
11
  * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
13
12
  * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
@@ -19,6 +18,7 @@ exports.removeNils = removeNils;
19
18
  *
20
19
  * See the License for the specific language governing permissions and limitations under the License.
21
20
  */
21
+
22
22
  function bind(fn, ctx) {
23
23
  var additionalArgs = Array.prototype.slice.call(arguments, 2);
24
24
  return function () {
@@ -26,13 +26,13 @@ function bind(fn, ctx) {
26
26
  args = additionalArgs.concat(args);
27
27
  return fn.apply(ctx, args);
28
28
  };
29
- } // TODO: replace all references with `Object.assign` then remove this function
30
-
29
+ }
31
30
 
31
+ // TODO: replace all references with `Object.assign` then remove this function
32
32
  function extend() {
33
33
  // First object will be modified!
34
- var obj1 = arguments[0]; // Properties from other objects will be copied over
35
-
34
+ var obj1 = arguments[0];
35
+ // Properties from other objects will be copied over
36
36
  var objArray = [].slice.call(arguments, 1);
37
37
  objArray.forEach(function (obj) {
38
38
  for (var prop in obj) {
@@ -47,77 +47,63 @@ function extend() {
47
47
 
48
48
  function removeNils(obj) {
49
49
  var cleaned = {};
50
-
51
50
  for (var prop in obj) {
52
51
  if (Object.prototype.hasOwnProperty.call(obj, prop)) {
53
52
  var value = obj[prop];
54
-
55
53
  if (value !== null && value !== undefined) {
56
54
  cleaned[prop] = value;
57
55
  }
58
56
  }
59
57
  }
60
-
61
58
  return cleaned;
62
59
  }
63
-
64
60
  function clone(obj) {
65
61
  if (obj) {
66
62
  var str = JSON.stringify(obj);
67
-
68
63
  if (str) {
69
64
  return JSON.parse(str);
70
65
  }
71
66
  }
72
-
73
67
  return obj;
74
- } // Analogous to _.omit
75
-
68
+ }
76
69
 
70
+ // Analogous to _.omit
77
71
  function omit(obj, ...props) {
78
72
  // var props = Array.prototype.slice.call(arguments, 1);
79
73
  var newobj = {};
80
-
81
74
  for (var p in obj) {
82
75
  if (Object.prototype.hasOwnProperty.call(obj, p) && props.indexOf(p) == -1) {
83
76
  newobj[p] = obj[p];
84
77
  }
85
78
  }
86
-
87
79
  return clone(newobj);
88
80
  }
89
-
90
81
  function find(collection, searchParams) {
91
82
  var c = collection.length;
92
-
93
83
  while (c--) {
94
84
  var item = collection[c];
95
85
  var found = true;
96
-
97
86
  for (var prop in searchParams) {
98
87
  if (!Object.prototype.hasOwnProperty.call(searchParams, prop)) {
99
88
  continue;
100
89
  }
101
-
102
90
  if (item[prop] !== searchParams[prop]) {
103
91
  found = false;
104
92
  break;
105
93
  }
106
94
  }
107
-
108
95
  if (found) {
109
96
  return item;
110
97
  }
111
98
  }
112
99
  }
113
-
114
100
  function getLink(obj, linkName, altName) {
115
101
  if (!obj || !obj._links) {
116
102
  return;
117
103
  }
104
+ var link = clone(obj._links[linkName]);
118
105
 
119
- var link = clone(obj._links[linkName]); // If a link has a name and we have an altName, return if they match
120
-
106
+ // If a link has a name and we have an altName, return if they match
121
107
  if (link && link.name && altName) {
122
108
  if (link.name === altName) {
123
109
  return link;