@okta/okta-auth-js 7.4.3 → 7.5.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 (287) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/cjs/http/OktaUserAgent.js +2 -2
  3. package/cjs/http/types.js.map +1 -1
  4. package/cjs/idx/factory/MinimalOktaAuthIdx.js +20 -0
  5. package/cjs/idx/factory/MinimalOktaAuthIdx.js.map +1 -0
  6. package/cjs/idx/factory/api.js +9 -0
  7. package/cjs/idx/factory/api.js.map +1 -1
  8. package/cjs/idx/factory/index.js +11 -0
  9. package/cjs/idx/factory/index.js.map +1 -1
  10. package/cjs/idx/factory/minimalApi.js +41 -0
  11. package/cjs/idx/factory/minimalApi.js.map +1 -0
  12. package/cjs/idx/flow/AccountUnlockFlow.js +2 -1
  13. package/cjs/idx/flow/AccountUnlockFlow.js.map +1 -1
  14. package/cjs/idx/flow/AuthenticationFlow.js +1 -0
  15. package/cjs/idx/flow/AuthenticationFlow.js.map +1 -1
  16. package/cjs/idx/flow/FlowSpecification.js.map +1 -1
  17. package/cjs/idx/flow/PasswordRecoveryFlow.js +1 -0
  18. package/cjs/idx/flow/PasswordRecoveryFlow.js.map +1 -1
  19. package/cjs/idx/idxState/v1/idxResponseParser.js +9 -6
  20. package/cjs/idx/idxState/v1/idxResponseParser.js.map +1 -1
  21. package/cjs/idx/idxState/v1/makeIdxState.js.map +1 -1
  22. package/cjs/idx/idxState/v1/parsers.js +1 -4
  23. package/cjs/idx/idxState/v1/parsers.js.map +1 -1
  24. package/cjs/idx/idxState/v1/remediationParser.js +4 -5
  25. package/cjs/idx/idxState/v1/remediationParser.js.map +1 -1
  26. package/cjs/idx/mixinMinimal.js +19 -0
  27. package/cjs/idx/mixinMinimal.js.map +1 -0
  28. package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
  29. package/cjs/idx/remediators/Identify.js.map +1 -1
  30. package/cjs/idx/remediators/ReEnrollAuthenticatorWarning.js +22 -0
  31. package/cjs/idx/remediators/ReEnrollAuthenticatorWarning.js.map +1 -0
  32. package/cjs/idx/remediators/index.js +11 -0
  33. package/cjs/idx/remediators/index.js.map +1 -1
  34. package/cjs/idx/run.js +5 -4
  35. package/cjs/idx/run.js.map +1 -1
  36. package/cjs/idx/types/FlowSpecification.js +2 -0
  37. package/cjs/idx/types/FlowSpecification.js.map +1 -0
  38. package/cjs/idx/types/api.js.map +1 -1
  39. package/cjs/idx/types/index.js.map +1 -1
  40. package/cjs/idx/util.js +20 -4
  41. package/cjs/idx/util.js.map +1 -1
  42. package/cjs/myaccount/emailApi.js +11 -15
  43. package/cjs/myaccount/emailApi.js.map +1 -1
  44. package/cjs/myaccount/passwordApi.js +7 -9
  45. package/cjs/myaccount/passwordApi.js.map +1 -1
  46. package/cjs/myaccount/phoneApi.js +7 -9
  47. package/cjs/myaccount/phoneApi.js.map +1 -1
  48. package/cjs/myaccount/profileApi.js +7 -9
  49. package/cjs/myaccount/profileApi.js.map +1 -1
  50. package/cjs/myaccount/request.js +17 -26
  51. package/cjs/myaccount/request.js.map +1 -1
  52. package/cjs/myaccount/transactions/Base.js.map +1 -1
  53. package/cjs/myaccount/transactions/EmailChallengeTransaction.js +4 -4
  54. package/cjs/myaccount/transactions/EmailChallengeTransaction.js.map +1 -1
  55. package/cjs/myaccount/transactions/EmailTransaction.js +8 -9
  56. package/cjs/myaccount/transactions/EmailTransaction.js.map +1 -1
  57. package/cjs/myaccount/transactions/PasswordTransaction.js +6 -9
  58. package/cjs/myaccount/transactions/PasswordTransaction.js.map +1 -1
  59. package/cjs/myaccount/transactions/PhoneTransaction.js +2 -3
  60. package/cjs/myaccount/transactions/PhoneTransaction.js.map +1 -1
  61. package/cjs/myaccount/types.js +1 -52
  62. package/cjs/myaccount/types.js.map +1 -1
  63. package/cjs/oidc/TokenManager.js +3 -2
  64. package/cjs/oidc/TokenManager.js.map +1 -1
  65. package/cjs/oidc/factory/baseApi.js +29 -0
  66. package/cjs/oidc/factory/baseApi.js.map +1 -0
  67. package/cjs/oidc/mixin/index.js +4 -10
  68. package/cjs/oidc/mixin/index.js.map +1 -1
  69. package/cjs/oidc/mixin/minimal.js +29 -0
  70. package/cjs/oidc/mixin/minimal.js.map +1 -0
  71. package/cjs/oidc/types/api.js.map +1 -1
  72. package/cjs/oidc/util/loginRedirect.js +10 -0
  73. package/cjs/oidc/util/loginRedirect.js.map +1 -1
  74. package/dist/okta-auth-js.authn.min.analyzer.html +2 -2
  75. package/dist/okta-auth-js.authn.min.js +1 -1
  76. package/dist/okta-auth-js.authn.min.js.map +1 -1
  77. package/dist/okta-auth-js.core.min.analyzer.html +2 -2
  78. package/dist/okta-auth-js.core.min.js +1 -1
  79. package/dist/okta-auth-js.core.min.js.map +1 -1
  80. package/dist/okta-auth-js.idx.min.analyzer.html +2 -2
  81. package/dist/okta-auth-js.idx.min.js +1 -1
  82. package/dist/okta-auth-js.idx.min.js.map +1 -1
  83. package/dist/okta-auth-js.min.analyzer.html +2 -2
  84. package/dist/okta-auth-js.min.js +1 -1
  85. package/dist/okta-auth-js.min.js.map +1 -1
  86. package/dist/okta-auth-js.myaccount.min.analyzer.html +2 -2
  87. package/dist/okta-auth-js.myaccount.min.js +1 -1
  88. package/dist/okta-auth-js.myaccount.min.js.map +1 -1
  89. package/esm/browser/exports/exports/authn.js +1 -1
  90. package/esm/browser/exports/exports/core.js +1 -1
  91. package/esm/browser/exports/exports/default.js +2 -9
  92. package/esm/browser/exports/exports/default.js.map +1 -1
  93. package/esm/browser/exports/exports/idx.js +2 -1
  94. package/esm/browser/exports/exports/idx.js.map +1 -1
  95. package/esm/browser/exports/exports/myaccount.js +1 -9
  96. package/esm/browser/exports/exports/myaccount.js.map +1 -1
  97. package/esm/browser/http/OktaUserAgent.js +2 -2
  98. package/esm/browser/idx/cancel.js +1 -0
  99. package/esm/browser/idx/cancel.js.map +1 -1
  100. package/esm/browser/idx/factory/MinimalOktaAuthIdx.js +31 -0
  101. package/esm/browser/idx/factory/MinimalOktaAuthIdx.js.map +1 -0
  102. package/esm/browser/idx/factory/api.js +7 -0
  103. package/esm/browser/idx/factory/api.js.map +1 -1
  104. package/esm/browser/idx/factory/minimalApi.js +38 -0
  105. package/esm/browser/idx/factory/minimalApi.js.map +1 -0
  106. package/esm/browser/idx/flow/AccountUnlockFlow.js +2 -0
  107. package/esm/browser/idx/flow/AccountUnlockFlow.js.map +1 -1
  108. package/esm/browser/idx/flow/AuthenticationFlow.js +2 -0
  109. package/esm/browser/idx/flow/AuthenticationFlow.js.map +1 -1
  110. package/esm/browser/idx/flow/FlowSpecification.js.map +1 -1
  111. package/esm/browser/idx/flow/PasswordRecoveryFlow.js +2 -0
  112. package/esm/browser/idx/flow/PasswordRecoveryFlow.js.map +1 -1
  113. package/esm/browser/idx/flow/RegistrationFlow.js +1 -0
  114. package/esm/browser/idx/flow/RegistrationFlow.js.map +1 -1
  115. package/esm/browser/idx/idxState/v1/idxResponseParser.js +4 -4
  116. package/esm/browser/idx/idxState/v1/idxResponseParser.js.map +1 -1
  117. package/esm/browser/idx/idxState/v1/makeIdxState.js.map +1 -1
  118. package/esm/browser/idx/idxState/v1/parsers.js.map +1 -1
  119. package/esm/browser/idx/idxState/v1/remediationParser.js +1 -6
  120. package/esm/browser/idx/idxState/v1/remediationParser.js.map +1 -1
  121. package/esm/browser/idx/mixinMinimal.js +29 -0
  122. package/esm/browser/idx/mixinMinimal.js.map +1 -0
  123. package/esm/browser/idx/recoverPassword.js +1 -0
  124. package/esm/browser/idx/recoverPassword.js.map +1 -1
  125. package/esm/browser/idx/remediators/Base/Remediator.js.map +1 -1
  126. package/esm/browser/idx/remediators/Identify.js.map +1 -1
  127. package/esm/browser/idx/remediators/ReEnrollAuthenticatorWarning.js +20 -0
  128. package/esm/browser/idx/remediators/ReEnrollAuthenticatorWarning.js.map +1 -0
  129. package/esm/browser/idx/remediators/index.js +1 -0
  130. package/esm/browser/idx/remediators/index.js.map +1 -1
  131. package/esm/browser/idx/run.js +4 -22
  132. package/esm/browser/idx/run.js.map +1 -1
  133. package/esm/browser/idx/types/api.js.map +1 -1
  134. package/esm/browser/idx/util.js +16 -3
  135. package/esm/browser/idx/util.js.map +1 -1
  136. package/esm/browser/myaccount/emailApi.js +9 -11
  137. package/esm/browser/myaccount/emailApi.js.map +1 -1
  138. package/esm/browser/myaccount/passwordApi.js +4 -6
  139. package/esm/browser/myaccount/passwordApi.js.map +1 -1
  140. package/esm/browser/myaccount/phoneApi.js +5 -6
  141. package/esm/browser/myaccount/phoneApi.js.map +1 -1
  142. package/esm/browser/myaccount/profileApi.js +6 -6
  143. package/esm/browser/myaccount/profileApi.js.map +1 -1
  144. package/esm/browser/myaccount/request.js +13 -28
  145. package/esm/browser/myaccount/request.js.map +1 -1
  146. package/esm/browser/myaccount/transactions/Base.js.map +1 -1
  147. package/esm/browser/myaccount/transactions/EmailChallengeTransaction.js +3 -3
  148. package/esm/browser/myaccount/transactions/EmailChallengeTransaction.js.map +1 -1
  149. package/esm/browser/myaccount/transactions/EmailTransaction.js +5 -6
  150. package/esm/browser/myaccount/transactions/EmailTransaction.js.map +1 -1
  151. package/esm/browser/myaccount/transactions/PasswordTransaction.js +3 -6
  152. package/esm/browser/myaccount/transactions/PasswordTransaction.js.map +1 -1
  153. package/esm/browser/myaccount/transactions/PhoneTransaction.js +1 -2
  154. package/esm/browser/myaccount/transactions/PhoneTransaction.js.map +1 -1
  155. package/esm/browser/myaccount/types.js +0 -4
  156. package/esm/browser/myaccount/types.js.map +1 -1
  157. package/esm/browser/oidc/TokenManager.js +3 -2
  158. package/esm/browser/oidc/TokenManager.js.map +1 -1
  159. package/esm/browser/oidc/factory/baseApi.js +28 -0
  160. package/esm/browser/oidc/factory/baseApi.js.map +1 -0
  161. package/esm/browser/oidc/mixin/index.js +2 -9
  162. package/esm/browser/oidc/mixin/index.js.map +1 -1
  163. package/esm/browser/oidc/mixin/minimal.js +45 -0
  164. package/esm/browser/oidc/mixin/minimal.js.map +1 -0
  165. package/esm/browser/oidc/util/loginRedirect.js +11 -1
  166. package/esm/browser/oidc/util/loginRedirect.js.map +1 -1
  167. package/esm/browser/package.json +1 -1
  168. package/esm/node/exports/exports/authn.js +1 -1
  169. package/esm/node/exports/exports/core.js +1 -1
  170. package/esm/node/exports/exports/default.js +2 -9
  171. package/esm/node/exports/exports/default.js.map +1 -1
  172. package/esm/node/exports/exports/idx.js +2 -1
  173. package/esm/node/exports/exports/idx.js.map +1 -1
  174. package/esm/node/exports/exports/myaccount.js +1 -9
  175. package/esm/node/exports/exports/myaccount.js.map +1 -1
  176. package/esm/node/fetch/fetchRequest.js +1 -1
  177. package/esm/node/fetch/fetchRequest.js.map +1 -1
  178. package/esm/node/http/OktaUserAgent.js +2 -2
  179. package/esm/node/idx/cancel.js +1 -0
  180. package/esm/node/idx/cancel.js.map +1 -1
  181. package/esm/node/idx/factory/MinimalOktaAuthIdx.js +31 -0
  182. package/esm/node/idx/factory/MinimalOktaAuthIdx.js.map +1 -0
  183. package/esm/node/idx/factory/api.js +7 -0
  184. package/esm/node/idx/factory/api.js.map +1 -1
  185. package/esm/node/idx/factory/minimalApi.js +38 -0
  186. package/esm/node/idx/factory/minimalApi.js.map +1 -0
  187. package/esm/node/idx/flow/AccountUnlockFlow.js +2 -0
  188. package/esm/node/idx/flow/AccountUnlockFlow.js.map +1 -1
  189. package/esm/node/idx/flow/AuthenticationFlow.js +2 -0
  190. package/esm/node/idx/flow/AuthenticationFlow.js.map +1 -1
  191. package/esm/node/idx/flow/FlowSpecification.js.map +1 -1
  192. package/esm/node/idx/flow/PasswordRecoveryFlow.js +2 -0
  193. package/esm/node/idx/flow/PasswordRecoveryFlow.js.map +1 -1
  194. package/esm/node/idx/flow/RegistrationFlow.js +1 -0
  195. package/esm/node/idx/flow/RegistrationFlow.js.map +1 -1
  196. package/esm/node/idx/idxState/v1/idxResponseParser.js +4 -4
  197. package/esm/node/idx/idxState/v1/idxResponseParser.js.map +1 -1
  198. package/esm/node/idx/idxState/v1/makeIdxState.js.map +1 -1
  199. package/esm/node/idx/idxState/v1/parsers.js.map +1 -1
  200. package/esm/node/idx/idxState/v1/remediationParser.js +1 -6
  201. package/esm/node/idx/idxState/v1/remediationParser.js.map +1 -1
  202. package/esm/node/idx/mixinMinimal.js +29 -0
  203. package/esm/node/idx/mixinMinimal.js.map +1 -0
  204. package/esm/node/idx/recoverPassword.js +1 -0
  205. package/esm/node/idx/recoverPassword.js.map +1 -1
  206. package/esm/node/idx/remediators/Base/Remediator.js.map +1 -1
  207. package/esm/node/idx/remediators/Identify.js.map +1 -1
  208. package/esm/node/idx/remediators/ReEnrollAuthenticatorWarning.js +20 -0
  209. package/esm/node/idx/remediators/ReEnrollAuthenticatorWarning.js.map +1 -0
  210. package/esm/node/idx/remediators/index.js +1 -0
  211. package/esm/node/idx/remediators/index.js.map +1 -1
  212. package/esm/node/idx/run.js +4 -22
  213. package/esm/node/idx/run.js.map +1 -1
  214. package/esm/node/idx/types/api.js.map +1 -1
  215. package/esm/node/idx/util.js +16 -3
  216. package/esm/node/idx/util.js.map +1 -1
  217. package/esm/node/myaccount/emailApi.js +9 -11
  218. package/esm/node/myaccount/emailApi.js.map +1 -1
  219. package/esm/node/myaccount/passwordApi.js +4 -6
  220. package/esm/node/myaccount/passwordApi.js.map +1 -1
  221. package/esm/node/myaccount/phoneApi.js +5 -6
  222. package/esm/node/myaccount/phoneApi.js.map +1 -1
  223. package/esm/node/myaccount/profileApi.js +6 -6
  224. package/esm/node/myaccount/profileApi.js.map +1 -1
  225. package/esm/node/myaccount/request.js +13 -28
  226. package/esm/node/myaccount/request.js.map +1 -1
  227. package/esm/node/myaccount/transactions/Base.js.map +1 -1
  228. package/esm/node/myaccount/transactions/EmailChallengeTransaction.js +3 -3
  229. package/esm/node/myaccount/transactions/EmailChallengeTransaction.js.map +1 -1
  230. package/esm/node/myaccount/transactions/EmailTransaction.js +5 -6
  231. package/esm/node/myaccount/transactions/EmailTransaction.js.map +1 -1
  232. package/esm/node/myaccount/transactions/PasswordTransaction.js +3 -6
  233. package/esm/node/myaccount/transactions/PasswordTransaction.js.map +1 -1
  234. package/esm/node/myaccount/transactions/PhoneTransaction.js +1 -2
  235. package/esm/node/myaccount/transactions/PhoneTransaction.js.map +1 -1
  236. package/esm/node/myaccount/types.js +0 -5
  237. package/esm/node/myaccount/types.js.map +1 -1
  238. package/esm/node/oidc/TokenManager.js +3 -2
  239. package/esm/node/oidc/TokenManager.js.map +1 -1
  240. package/esm/node/oidc/factory/baseApi.js +29 -0
  241. package/esm/node/oidc/factory/baseApi.js.map +1 -0
  242. package/esm/node/oidc/mixin/index.js +2 -9
  243. package/esm/node/oidc/mixin/index.js.map +1 -1
  244. package/esm/node/oidc/mixin/minimal.js +46 -0
  245. package/esm/node/oidc/mixin/minimal.js.map +1 -0
  246. package/esm/node/oidc/util/loginRedirect.js +11 -1
  247. package/esm/node/oidc/util/loginRedirect.js.map +1 -1
  248. package/esm/node/package.json +1 -1
  249. package/package.json +4 -4
  250. package/types/lib/http/types.d.ts +1 -1
  251. package/types/lib/idx/factory/MinimalOktaAuthIdx.d.ts +8 -0
  252. package/types/lib/idx/factory/index.d.ts +1 -0
  253. package/types/lib/idx/factory/minimalApi.d.ts +14 -0
  254. package/types/lib/idx/flow/FlowSpecification.d.ts +1 -8
  255. package/types/lib/idx/idxState/v1/idxResponseParser.d.ts +4 -3
  256. package/types/lib/idx/idxState/v1/remediationParser.d.ts +2 -2
  257. package/types/lib/idx/mixinMinimal.d.ts +6 -0
  258. package/types/lib/idx/remediators/Base/Remediator.d.ts +1 -0
  259. package/types/lib/idx/remediators/Identify.d.ts +1 -0
  260. package/types/lib/idx/remediators/ReEnrollAuthenticatorWarning.d.ts +15 -0
  261. package/types/lib/idx/remediators/index.d.ts +1 -0
  262. package/types/lib/idx/types/FlowSpecification.d.ts +8 -0
  263. package/types/lib/idx/types/api.d.ts +18 -2
  264. package/types/lib/idx/types/index.d.ts +1 -0
  265. package/types/lib/idx/util.d.ts +10 -2
  266. package/types/lib/myaccount/emailApi.d.ts +2 -1
  267. package/types/lib/myaccount/passwordApi.d.ts +2 -1
  268. package/types/lib/myaccount/phoneApi.d.ts +2 -1
  269. package/types/lib/myaccount/profileApi.d.ts +2 -1
  270. package/types/lib/myaccount/request.d.ts +4 -16
  271. package/types/lib/myaccount/transactions/Base.d.ts +14 -1
  272. package/types/lib/myaccount/transactions/EmailTransaction.d.ts +2 -1
  273. package/types/lib/myaccount/types.d.ts +1 -1
  274. package/types/lib/oidc/factory/baseApi.d.ts +14 -0
  275. package/types/lib/oidc/mixin/minimal.d.ts +4 -0
  276. package/types/lib/oidc/types/api.d.ts +8 -0
  277. package/types/lib/oidc/util/loginRedirect.d.ts +2 -1
  278. package/umd/authn.js +1 -1
  279. package/umd/authn.js.map +1 -1
  280. package/umd/core.js +1 -1
  281. package/umd/core.js.map +1 -1
  282. package/umd/default.js +1 -1
  283. package/umd/default.js.map +1 -1
  284. package/umd/idx.js +1 -1
  285. package/umd/idx.js.map +1 -1
  286. package/umd/myaccount.js +1 -1
  287. package/umd/myaccount.js.map +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 7.5.0
4
+
5
+ ### Bug Fix
6
+
7
+ - [#1462](https://github.com/okta/okta-auth-js/pull/1462) Fixes ESM build for Node.js
8
+ - [#1472](https://github.com/okta/okta-auth-js/pull/1472) Added missing remediator `ReEnrollAuthenticatorWarning`
9
+ - [#1473](https://github.com/okta/okta-auth-js/pull/1473) Resolves circular dependencies issue for ESM build
10
+
11
+ ### Other
12
+
13
+ - [#1449](https://github.com/okta/okta-auth-js/pull/1449) chore: bump `broadcast-channel` version to `5.3.0`
14
+ - [#1463](https://github.com/okta/okta-auth-js/pull/1463) chore: Updates type definitions for `HttpRequestClient` and `IdentifyValues`
15
+
3
16
  ## 7.4.3
4
17
 
5
18
  ### Bug Fix
@@ -20,7 +20,7 @@ var _features = require("../features");
20
20
  class OktaUserAgent {
21
21
  constructor() {
22
22
  // add base sdk env
23
- this.environments = [`okta-auth-js/${"7.4.3"}`];
23
+ this.environments = [`okta-auth-js/${"7.5.0"}`];
24
24
  this.maybeAddNodeEnvironment();
25
25
  }
26
26
  addEnvironment(env) {
@@ -32,7 +32,7 @@ class OktaUserAgent {
32
32
  };
33
33
  }
34
34
  getVersion() {
35
- return "7.4.3";
35
+ return "7.5.0";
36
36
  }
37
37
  maybeAddNodeEnvironment() {
38
38
  if ((0, _features.isBrowser)() || !process || !process.versions) {
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../lib/http/types.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\nimport { OktaUserAgent } from './OktaUserAgent';\nimport {\n OktaAuthStorageInterface,\n OktaAuthStorageOptions,\n StorageManagerInterface,\n StorageUtil\n} from '../storage/types';\n\nexport type RequestHeaders = Record<string, string>;\n\nexport type RequestData = Record<string, string> | string | object;\n\nexport interface RequestOptions {\n url?: string;\n method?: string;\n args?: RequestData;\n saveAuthnState?: boolean;\n accessToken?: string;\n withCredentials?: boolean;\n storageUtil?: StorageUtil;\n cacheResponse?: boolean;\n headers?: RequestHeaders;\n}\n\nexport interface FetchOptions {\n headers?: HeadersInit;\n data?: RequestData;\n withCredentials?: boolean;\n}\n\nexport interface FetchResponse {\n headers: {\n get(key: string): string;\n };\n json(): Promise<object>;\n text(): Promise<string>;\n}\n\nexport type HttpRequestClient = (method: string, url: string, options: FetchOptions) => Promise<any>;\n\nexport interface HttpResponse {\n responseText: string;\n status: number;\n responseType?: string;\n responseJSON?: {\n [propName: string]: any;\n };\n headers: HeadersInit;\n}\n\n// HTTP API\nexport interface HttpAPI {\n setRequestHeader(name: string, value: string): void;\n}\n\n// options that can be passed to AuthJS\nexport interface OktaAuthHttpOptions extends OktaAuthStorageOptions \n{\n issuer?: string;\n transformErrorXHR?: (xhr: object) => any;\n headers?: object;\n httpRequestClient?: HttpRequestClient;\n httpRequestInterceptors?: ((request: RequestOptions) => void)[];\n}\n\n// an instance of AuthJS with HTTP capabilities\nexport interface OktaAuthHttpInterface\n<\n S extends StorageManagerInterface = StorageManagerInterface,\n O extends OktaAuthHttpOptions = OktaAuthHttpOptions,\n> \n extends OktaAuthStorageInterface<S, O>\n{\n _oktaUserAgent: OktaUserAgent;\n http: HttpAPI;\n \n setHeaders(headers): void;\n getIssuerOrigin(): string;\n webfinger(opts): Promise<object>;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../lib/http/types.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\nimport { OktaUserAgent } from './OktaUserAgent';\nimport {\n OktaAuthStorageInterface,\n OktaAuthStorageOptions,\n StorageManagerInterface,\n StorageUtil\n} from '../storage/types';\n\nexport type RequestHeaders = Record<string, string>;\n\nexport type RequestData = Record<string, string> | string | object;\n\nexport interface RequestOptions {\n url?: string;\n method?: string;\n args?: RequestData;\n saveAuthnState?: boolean;\n accessToken?: string;\n withCredentials?: boolean;\n storageUtil?: StorageUtil;\n cacheResponse?: boolean;\n headers?: RequestHeaders;\n}\n\nexport interface FetchOptions {\n headers?: HeadersInit;\n data?: RequestData;\n withCredentials?: boolean;\n}\n\nexport interface FetchResponse {\n headers: {\n get(key: string): string;\n };\n json(): Promise<object>;\n text(): Promise<string>;\n}\n\nexport interface HttpResponse {\n responseText: string;\n status: number;\n responseType?: string;\n responseJSON?: {\n [propName: string]: any;\n };\n headers: HeadersInit;\n}\n\nexport type HttpRequestClient = (method: string, url: string, options: FetchOptions) => Promise<HttpResponse>;\n\n// HTTP API\nexport interface HttpAPI {\n setRequestHeader(name: string, value: string): void;\n}\n\n// options that can be passed to AuthJS\nexport interface OktaAuthHttpOptions extends OktaAuthStorageOptions \n{\n issuer?: string;\n transformErrorXHR?: (xhr: object) => any;\n headers?: object;\n httpRequestClient?: HttpRequestClient;\n httpRequestInterceptors?: ((request: RequestOptions) => void)[];\n}\n\n// an instance of AuthJS with HTTP capabilities\nexport interface OktaAuthHttpInterface\n<\n S extends StorageManagerInterface = StorageManagerInterface,\n O extends OktaAuthHttpOptions = OktaAuthHttpOptions,\n> \n extends OktaAuthStorageInterface<S, O>\n{\n _oktaUserAgent: OktaUserAgent;\n http: HttpAPI;\n \n setHeaders(headers): void;\n getIssuerOrigin(): string;\n webfinger(opts): Promise<object>;\n}\n"],"mappings":""}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ exports.createMinimalOktaAuthIdx = createMinimalOktaAuthIdx;
4
+ var _mixinMinimal = require("../mixinMinimal");
5
+ var _factory = require("../../base/factory");
6
+ var _mixin = require("../../storage/mixin");
7
+ var _mixin2 = require("../../http/mixin");
8
+ var _mixin3 = require("../../session/mixin");
9
+ var _minimal = require("../../oidc/mixin/minimal");
10
+ function createMinimalOktaAuthIdx(StorageManagerConstructor, OptionsConstructor, TransactionManagerConstructor) {
11
+ const Base = (0, _factory.createOktaAuthBase)(OptionsConstructor);
12
+ const WithStorage = (0, _mixin.mixinStorage)(Base, StorageManagerConstructor);
13
+ const WithHttp = (0, _mixin2.mixinHttp)(WithStorage);
14
+ const WithSession = (0, _mixin3.mixinSession)(WithHttp);
15
+ const WithOAuth = (0, _minimal.mixinMinimalOAuth)(WithSession, TransactionManagerConstructor);
16
+ // do not mixin core
17
+ const WithIdx = (0, _mixinMinimal.mixinMinimalIdx)(WithOAuth);
18
+ return WithIdx;
19
+ }
20
+ //# sourceMappingURL=MinimalOktaAuthIdx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MinimalOktaAuthIdx.js","names":["createMinimalOktaAuthIdx","StorageManagerConstructor","OptionsConstructor","TransactionManagerConstructor","Base","createOktaAuthBase","WithStorage","mixinStorage","WithHttp","mixinHttp","WithSession","mixinSession","WithOAuth","mixinMinimalOAuth","WithIdx","mixinMinimalIdx"],"sources":["../../../../lib/idx/factory/MinimalOktaAuthIdx.ts"],"sourcesContent":["import { OktaAuthOptionsConstructor } from '../../base/types';\nimport { StorageManagerConstructor } from '../../storage/types';\nimport { IdxTransactionManagerInterface, MinimalOktaAuthIdxInterface, OktaAuthIdxConstructor } from '../types/api';\nimport { IdxTransactionMeta } from '../types/meta';\nimport { IdxStorageManagerInterface } from '../types/storage';\nimport { OktaAuthIdxOptions } from '../types/options';\nimport { TransactionManagerConstructor, MinimalOktaOAuthInterface } from '../../oidc/types';\nimport { mixinMinimalIdx } from '../mixinMinimal';\nimport { createOktaAuthBase } from '../../base/factory';\nimport { mixinStorage } from '../../storage/mixin';\nimport { mixinHttp } from '../../http/mixin';\nimport { mixinSession } from '../../session/mixin';\nimport { mixinMinimalOAuth } from '../../oidc/mixin/minimal';\n\nexport function createMinimalOktaAuthIdx<\n M extends IdxTransactionMeta = IdxTransactionMeta,\n S extends IdxStorageManagerInterface<M> = IdxStorageManagerInterface<M>,\n O extends OktaAuthIdxOptions = OktaAuthIdxOptions,\n TM extends IdxTransactionManagerInterface = IdxTransactionManagerInterface\n>(\n StorageManagerConstructor: StorageManagerConstructor<S>,\n OptionsConstructor: OktaAuthOptionsConstructor<O>,\n TransactionManagerConstructor: TransactionManagerConstructor<TM>\n)\n: OktaAuthIdxConstructor<\n MinimalOktaAuthIdxInterface<M, S, O, TM> & MinimalOktaOAuthInterface<M, S, O, TM>\n>\n{\n const Base = createOktaAuthBase(OptionsConstructor);\n const WithStorage = mixinStorage<S, O>(Base, StorageManagerConstructor);\n const WithHttp = mixinHttp<S, O>(WithStorage);\n const WithSession = mixinSession<S, O>(WithHttp);\n const WithOAuth = mixinMinimalOAuth<M, S, O, TM>(WithSession, TransactionManagerConstructor);\n // do not mixin core\n const WithIdx = mixinMinimalIdx(WithOAuth);\n return WithIdx;\n}\n"],"mappings":";;;AAOA;AACA;AACA;AACA;AACA;AACA;AAEO,SAASA,wBAAwB,CAMtCC,yBAAuD,EACvDC,kBAAiD,EACjDC,6BAAgE,EAKlE;EACE,MAAMC,IAAI,GAAG,IAAAC,2BAAkB,EAACH,kBAAkB,CAAC;EACnD,MAAMI,WAAW,GAAG,IAAAC,mBAAY,EAAOH,IAAI,EAAEH,yBAAyB,CAAC;EACvE,MAAMO,QAAQ,GAAG,IAAAC,iBAAS,EAAOH,WAAW,CAAC;EAC7C,MAAMI,WAAW,GAAG,IAAAC,oBAAY,EAAOH,QAAQ,CAAC;EAChD,MAAMI,SAAS,GAAG,IAAAC,0BAAiB,EAAcH,WAAW,EAAEP,6BAA6B,CAAC;EAC5F;EACA,MAAMW,OAAO,GAAG,IAAAC,6BAAe,EAACH,SAAS,CAAC;EAC1C,OAAOE,OAAO;AAChB"}
@@ -16,6 +16,11 @@ var _register = require("../register");
16
16
  var _startTransaction = require("../startTransaction");
17
17
  var _transactionMeta = require("../transactionMeta");
18
18
  var _unlockAccount = require("../unlockAccount");
19
+ var remediators = _interopRequireWildcard(require("../remediators"));
20
+ var _FlowSpecification = require("../flow/FlowSpecification");
21
+ var _util = require("../util");
22
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
24
  /*!
20
25
  * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
21
26
  * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
@@ -31,6 +36,10 @@ var _unlockAccount = require("../unlockAccount");
31
36
 
32
37
  // Factory
33
38
  function createIdxAPI(sdk) {
39
+ (0, _util.setRemediatorsCtx)({
40
+ remediators,
41
+ getFlowSpecification: _FlowSpecification.getFlowSpecification
42
+ });
34
43
  const boundStartTransaction = _startTransaction.startTransaction.bind(null, sdk);
35
44
  const idx = {
36
45
  interact: _interact.interact.bind(null, sdk),
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","names":["createIdxAPI","sdk","boundStartTransaction","startTransaction","bind","idx","interact","introspect","makeIdxResponse","makeIdxState","authenticate","register","start","poll","proceed","cancel","recoverPassword","handleInteractionCodeRedirect","isInteractionRequired","isInteractionRequiredError","handleEmailVerifyCallback","isEmailVerifyCallback","parseEmailVerifyCallback","isEmailVerifyCallbackError","getSavedTransactionMeta","createTransactionMeta","getTransactionMeta","saveTransactionMeta","clearTransactionMeta","isTransactionMetaValid","setFlow","flow","options","getFlow","canProceed","unlockAccount"],"sources":["../../../../lib/idx/factory/api.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\nimport { isInteractionRequired, isInteractionRequiredError } from '../../oidc';\nimport { authenticate } from '../authenticate';\nimport { cancel } from '../cancel';\nimport {\n handleEmailVerifyCallback,\n isEmailVerifyCallback,\n isEmailVerifyCallbackError,\n parseEmailVerifyCallback\n} from '../emailVerify';\nimport { handleInteractionCodeRedirect } from '../handleInteractionCodeRedirect';\nimport { makeIdxState } from '../idxState';\nimport { interact } from '../interact';\nimport { introspect } from '../introspect';\nimport { poll } from '../poll';\nimport { canProceed, proceed } from '../proceed';\nimport { recoverPassword } from '../recoverPassword';\nimport { register } from '../register';\nimport { startTransaction } from '../startTransaction';\nimport {\n clearTransactionMeta,\n createTransactionMeta,\n getSavedTransactionMeta,\n getTransactionMeta,\n isTransactionMetaValid,\n saveTransactionMeta\n} from '../transactionMeta';\nimport { FlowIdentifier, IdxAPI, OktaAuthIdxInterface } from '../types';\nimport { unlockAccount } from '../unlockAccount';\n\n// Factory\nexport function createIdxAPI(sdk: OktaAuthIdxInterface): IdxAPI {\n const boundStartTransaction = startTransaction.bind(null, sdk);\n const idx = {\n interact: interact.bind(null, sdk),\n introspect: introspect.bind(null, sdk),\n makeIdxResponse: makeIdxState.bind(null, sdk),\n \n authenticate: authenticate.bind(null, sdk),\n register: register.bind(null, sdk),\n start: boundStartTransaction,\n startTransaction: boundStartTransaction, // Use `start` instead. `startTransaction` will be removed in 7.0\n poll: poll.bind(null, sdk),\n proceed: proceed.bind(null, sdk),\n cancel: cancel.bind(null, sdk),\n recoverPassword: recoverPassword.bind(null, sdk),\n\n // oauth redirect callback\n handleInteractionCodeRedirect: handleInteractionCodeRedirect.bind(null, sdk),\n\n // interaction required callback\n isInteractionRequired: isInteractionRequired.bind(null, sdk),\n isInteractionRequiredError,\n\n // email verify callback\n handleEmailVerifyCallback: handleEmailVerifyCallback.bind(null, sdk),\n isEmailVerifyCallback,\n parseEmailVerifyCallback,\n isEmailVerifyCallbackError,\n \n getSavedTransactionMeta: getSavedTransactionMeta.bind(null, sdk),\n createTransactionMeta: createTransactionMeta.bind(null, sdk),\n getTransactionMeta: getTransactionMeta.bind(null, sdk),\n saveTransactionMeta: saveTransactionMeta.bind(null, sdk),\n clearTransactionMeta: clearTransactionMeta.bind(null, sdk),\n isTransactionMetaValid,\n setFlow: (flow: FlowIdentifier) => {\n sdk.options.flow = flow;\n },\n getFlow: (): FlowIdentifier | undefined => {\n return sdk.options.flow;\n },\n canProceed: canProceed.bind(null, sdk),\n unlockAccount: unlockAccount.bind(null, sdk),\n };\n return idx;\n}\n\n"],"mappings":";;;AAaA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AAxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA+BA;AACO,SAASA,YAAY,CAACC,GAAyB,EAAU;EAC9D,MAAMC,qBAAqB,GAAGC,kCAAgB,CAACC,IAAI,CAAC,IAAI,EAAEH,GAAG,CAAC;EAC9D,MAAMI,GAAG,GAAG;IACVC,QAAQ,EAAEA,kBAAQ,CAACF,IAAI,CAAC,IAAI,EAAEH,GAAG,CAAC;IAClCM,UAAU,EAAEA,sBAAU,CAACH,IAAI,CAAC,IAAI,EAAEH,GAAG,CAAC;IACtCO,eAAe,EAAEC,sBAAY,CAACL,IAAI,CAAC,IAAI,EAAEH,GAAG,CAAC;IAE7CS,YAAY,EAAEA,0BAAY,CAACN,IAAI,CAAC,IAAI,EAAEH,GAAG,CAAC;IAC1CU,QAAQ,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AAoB,IAAK;MACjC9B,GAAG,CAAC+B,OAAO,CAACD,IAAI,GAAGA,IAAI;IACzB,CAAC;IACDE,OAAO,EAAE,MAAkC;MACzC,OAAOhC,GAAG,CAAC+B,OAAO,CAACD,IAAI;IACzB,CAAC;IACDG,UAAU,EAAEA,mBAAU,CAAC9B,IAAI,CAAC,IAAI,EAAEH,GAAG,CAAC;IACtCkC,aAAa,EAAEA,4BAAa,CAAC/B,IAAI,CAAC,IAAI,EAAEH,GAAG;EAC7C,CAAC;EACD,OAAOI,GAAG;AACZ"}
1
+ {"version":3,"file":"api.js","names":["createIdxAPI","sdk","setRemediatorsCtx","remediators","getFlowSpecification","boundStartTransaction","startTransaction","bind","idx","interact","introspect","makeIdxResponse","makeIdxState","authenticate","register","start","poll","proceed","cancel","recoverPassword","handleInteractionCodeRedirect","isInteractionRequired","isInteractionRequiredError","handleEmailVerifyCallback","isEmailVerifyCallback","parseEmailVerifyCallback","isEmailVerifyCallbackError","getSavedTransactionMeta","createTransactionMeta","getTransactionMeta","saveTransactionMeta","clearTransactionMeta","isTransactionMetaValid","setFlow","flow","options","getFlow","canProceed","unlockAccount"],"sources":["../../../../lib/idx/factory/api.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\nimport { isInteractionRequired, isInteractionRequiredError } from '../../oidc';\nimport { authenticate } from '../authenticate';\nimport { cancel } from '../cancel';\nimport {\n handleEmailVerifyCallback,\n isEmailVerifyCallback,\n isEmailVerifyCallbackError,\n parseEmailVerifyCallback\n} from '../emailVerify';\nimport { handleInteractionCodeRedirect } from '../handleInteractionCodeRedirect';\nimport { makeIdxState } from '../idxState';\nimport { interact } from '../interact';\nimport { introspect } from '../introspect';\nimport { poll } from '../poll';\nimport { canProceed, proceed } from '../proceed';\nimport { recoverPassword } from '../recoverPassword';\nimport { register } from '../register';\nimport { startTransaction } from '../startTransaction';\nimport {\n clearTransactionMeta,\n createTransactionMeta,\n getSavedTransactionMeta,\n getTransactionMeta,\n isTransactionMetaValid,\n saveTransactionMeta\n} from '../transactionMeta';\nimport { FlowIdentifier, IdxAPI, OktaAuthIdxInterface } from '../types';\nimport { unlockAccount } from '../unlockAccount';\nimport * as remediators from '../remediators';\nimport { getFlowSpecification } from '../flow/FlowSpecification';\nimport { setRemediatorsCtx } from '../util';\n\n// Factory\nexport function createIdxAPI(sdk: OktaAuthIdxInterface): IdxAPI {\n setRemediatorsCtx({\n remediators,\n getFlowSpecification,\n });\n const boundStartTransaction = startTransaction.bind(null, sdk);\n const idx = {\n interact: interact.bind(null, sdk),\n introspect: introspect.bind(null, sdk),\n makeIdxResponse: makeIdxState.bind(null, sdk),\n \n authenticate: authenticate.bind(null, sdk),\n register: register.bind(null, sdk),\n start: boundStartTransaction,\n startTransaction: boundStartTransaction, // Use `start` instead. `startTransaction` will be removed in 7.0\n poll: poll.bind(null, sdk),\n proceed: proceed.bind(null, sdk),\n cancel: cancel.bind(null, sdk),\n recoverPassword: recoverPassword.bind(null, sdk),\n\n // oauth redirect callback\n handleInteractionCodeRedirect: handleInteractionCodeRedirect.bind(null, sdk),\n\n // interaction required callback\n isInteractionRequired: isInteractionRequired.bind(null, sdk),\n isInteractionRequiredError,\n\n // email verify callback\n handleEmailVerifyCallback: handleEmailVerifyCallback.bind(null, sdk),\n isEmailVerifyCallback,\n parseEmailVerifyCallback,\n isEmailVerifyCallbackError,\n \n getSavedTransactionMeta: getSavedTransactionMeta.bind(null, sdk),\n createTransactionMeta: createTransactionMeta.bind(null, sdk),\n getTransactionMeta: getTransactionMeta.bind(null, sdk),\n saveTransactionMeta: saveTransactionMeta.bind(null, sdk),\n clearTransactionMeta: clearTransactionMeta.bind(null, sdk),\n isTransactionMetaValid,\n setFlow: (flow: FlowIdentifier) => {\n sdk.options.flow = flow;\n },\n getFlow: (): FlowIdentifier | undefined => {\n return sdk.options.flow;\n },\n canProceed: canProceed.bind(null, sdk),\n unlockAccount: unlockAccount.bind(null, sdk),\n };\n return idx;\n}\n\n"],"mappings":";;;AAaA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AACA;AAA4C;AAAA;AA3C5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkCA;AACO,SAASA,YAAY,CAACC,GAAyB,EAAU;EAC9D,IAAAC,uBAAiB,EAAC;IAChBC,WAAW;IACXC,oBAAoB,EAApBA;EACF,CAAC,CAAC;EACF,MAAMC,qBAAqB,GAAGC,kCAAgB,CAACC,IAAI,CAAC,IAAI,EAAEN,GAAG,CAAC;EAC9D,MAAMO,GAAG,GAAG;IACVC,QAAQ,EAAEA,kBAAQ,CAACF,IAAI,CAAC,IAAI,EAAEN,GAAG,CAAC;IAClCS,UAAU,EAAEA,sBAAU,CAACH,IAAI,CAAC,IAAI,EAAEN,GAAG,CAAC;IACtCU,eAAe,EAAEC,sBAAY,CAACL,IAAI,CAAC,IAAI,EAAEN,GAAG,CAAC;IAE7CY,YAAY,EAAEA,0BAAY,CAACN,IAAI,CAAC,IAAI,EAAEN,GAAG,CAAC;IAC1Ca,QAAQ,EAAEA,kBAAQ,CAACP,IAAI,CAAC,IAAI,EAAEN,GAAG,CAAC;IAClCc,KAAK,EAAEV,qBAAqB;IAC5BC,gBAAgB,EAAED,qBAAqB;IAAE;IACzCW,IAAI,EAAEA,UAAI,CAACT,IAAI,CAAC,IAAI,EAAEN,GAAG,CAAC;IAC1BgB,OAAO,EAAEA,gBAAO,CAACV,IAAI,CAAC,IAAI,EAAEN,GAAG,CA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AAC/B,IAAI,CAAC,IAAI,EAAEN,GAAG;EAC7C,CAAC;EACD,OAAOO,GAAG;AACZ"}
@@ -22,4 +22,15 @@ Object.keys(_OktaAuthIdx).forEach(function (key) {
22
22
  }
23
23
  });
24
24
  });
25
+ var _MinimalOktaAuthIdx = require("./MinimalOktaAuthIdx");
26
+ Object.keys(_MinimalOktaAuthIdx).forEach(function (key) {
27
+ if (key === "default" || key === "__esModule") return;
28
+ if (key in exports && exports[key] === _MinimalOktaAuthIdx[key]) return;
29
+ Object.defineProperty(exports, key, {
30
+ enumerable: true,
31
+ get: function () {
32
+ return _MinimalOktaAuthIdx[key];
33
+ }
34
+ });
35
+ });
25
36
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../lib/idx/factory/index.ts"],"sourcesContent":["export * from './api';\nexport * from './OktaAuthIdx';\n"],"mappings":";;AAAA;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/idx/factory/index.ts"],"sourcesContent":["export * from './api';\nexport * from './OktaAuthIdx';\nexport * from './MinimalOktaAuthIdx';\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"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ exports.createMinimalIdxAPI = createMinimalIdxAPI;
4
+ var _idxState = require("../idxState");
5
+ var _proceed = require("../proceed");
6
+ var _startTransaction = require("../startTransaction");
7
+ var _transactionMeta = require("../transactionMeta");
8
+ /*!
9
+ * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
10
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
11
+ *
12
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ *
17
+ * See the License for the specific language governing permissions and limitations under the License.
18
+ *
19
+ */
20
+
21
+ // Factory
22
+ function createMinimalIdxAPI(minimalSdk) {
23
+ const sdk = minimalSdk;
24
+ const boundStartTransaction = _startTransaction.startTransaction.bind(null, sdk);
25
+ const idx = {
26
+ makeIdxResponse: _idxState.makeIdxState.bind(null, sdk),
27
+ start: boundStartTransaction,
28
+ startTransaction: boundStartTransaction,
29
+ // Use `start` instead. `startTransaction` will be removed in 7.0
30
+ proceed: _proceed.proceed.bind(null, sdk),
31
+ canProceed: _proceed.canProceed.bind(null, sdk),
32
+ getSavedTransactionMeta: _transactionMeta.getSavedTransactionMeta.bind(null, sdk),
33
+ createTransactionMeta: _transactionMeta.createTransactionMeta.bind(null, sdk),
34
+ getTransactionMeta: _transactionMeta.getTransactionMeta.bind(null, sdk),
35
+ saveTransactionMeta: _transactionMeta.saveTransactionMeta.bind(null, sdk),
36
+ clearTransactionMeta: _transactionMeta.clearTransactionMeta.bind(null, sdk),
37
+ isTransactionMetaValid: _transactionMeta.isTransactionMetaValid
38
+ };
39
+ return idx;
40
+ }
41
+ //# sourceMappingURL=minimalApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"minimalApi.js","names":["createMinimalIdxAPI","minimalSdk","sdk","boundStartTransaction","startTransaction","bind","idx","makeIdxResponse","makeIdxState","start","proceed","canProceed","getSavedTransactionMeta","createTransactionMeta","getTransactionMeta","saveTransactionMeta","clearTransactionMeta","isTransactionMetaValid"],"sources":["../../../../lib/idx/factory/minimalApi.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\nimport { makeIdxState } from '../idxState';\nimport { canProceed, proceed } from '../proceed';\nimport { startTransaction } from '../startTransaction';\nimport {\n clearTransactionMeta,\n createTransactionMeta,\n getSavedTransactionMeta,\n getTransactionMeta,\n isTransactionMetaValid,\n saveTransactionMeta\n} from '../transactionMeta';\nimport { MinimalIdxAPI, MinimalOktaAuthIdxInterface, OktaAuthIdxInterface } from '../types';\n\n// Factory\nexport function createMinimalIdxAPI(minimalSdk: MinimalOktaAuthIdxInterface): MinimalIdxAPI {\n const sdk = minimalSdk as OktaAuthIdxInterface;\n const boundStartTransaction = startTransaction.bind(null, sdk);\n const idx = {\n makeIdxResponse: makeIdxState.bind(null, sdk),\n\n start: boundStartTransaction,\n startTransaction: boundStartTransaction, // Use `start` instead. `startTransaction` will be removed in 7.0\n proceed: proceed.bind(null, sdk),\n canProceed: canProceed.bind(null, sdk),\n \n getSavedTransactionMeta: getSavedTransactionMeta.bind(null, sdk),\n createTransactionMeta: createTransactionMeta.bind(null, sdk),\n getTransactionMeta: getTransactionMeta.bind(null, sdk),\n saveTransactionMeta: saveTransactionMeta.bind(null, sdk),\n clearTransactionMeta: clearTransactionMeta.bind(null, sdk),\n isTransactionMetaValid,\n };\n return idx;\n}\n\n"],"mappings":";;;AAaA;AACA;AACA;AACA;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACO,SAASA,mBAAmB,CAACC,UAAuC,EAAiB;EAC1F,MAAMC,GAAG,GAAGD,UAAkC;EAC9C,MAAME,qBAAqB,GAAGC,kCAAgB,CAACC,IAAI,CAAC,IAAI,EAAEH,GAAG,CAAC;EAC9D,MAAMI,GAAG,GAAG;IACVC,eAAe,EAAEC,sBAAY,CAACH,IAAI,CAAC,IAAI,EAAEH,GAAG,CAAC;IAE7CO,KAAK,EAAEN,qBAAqB;IAC5BC,gBAAgB,EAAED,qBAAqB;IAAE;IACzCO,OAAO,EAAEA,gBAAO,CAACL,IAAI,CAAC,IAAI,EAAEH,GAAG,CAAC;IAChCS,UAAU,EAAEA,mBAAU,CAACN,IAAI,CAAC,IAAI,EAAEH,GAAG,CAAC;IAEtCU,uBAAuB,EAAEA,wCAAuB,CAACP,IAAI,CAAC,IAAI,EAAEH,GAAG,CAAC;IAChEW,qBAAqB,EAAEA,sCAAqB,CAACR,IAAI,CAAC,IAAI,EAAEH,GAAG,CAAC;IAC5DY,kBAAkB,EAAEA,mCAAkB,CAACT,IAAI,CAAC,IAAI,EAAEH,GAAG,CAAC;IACtDa,mBAAmB,EAAEA,oCAAmB,CAACV,IAAI,CAAC,IAAI,EAAEH,GAAG,CAAC;IACxDc,oBAAoB,EAAEA,qCAAoB,CAACX,IAAI,CAAC,IAAI,EAAEH,GAAG,CAAC;IAC1De,sBAAsB,EAAtBA;EACF,CAAC;EACD,OAAOX,GAAG;AACZ"}
@@ -23,7 +23,8 @@ const AccountUnlockFlow = {
23
23
  'select-authenticator-authenticate': _remediators.SelectAuthenticatorAuthenticate,
24
24
  'challenge-authenticator': _remediators.ChallengeAuthenticator,
25
25
  'challenge-poll': _remediators.ChallengePoll,
26
- 'authenticator-verification-data': _remediators.AuthenticatorVerificationData
26
+ 'authenticator-verification-data': _remediators.AuthenticatorVerificationData,
27
+ 'reenroll-authenticator-warning': _remediators.ReEnrollAuthenticatorWarning
27
28
  };
28
29
  exports.AccountUnlockFlow = AccountUnlockFlow;
29
30
  //# sourceMappingURL=AccountUnlockFlow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccountUnlockFlow.js","names":["AccountUnlockFlow","Identify","SelectAuthenticatorUnlockAccount","SelectAuthenticatorAuthenticate","ChallengeAuthenticator","ChallengePoll","AuthenticatorVerificationData"],"sources":["../../../../lib/idx/flow/AccountUnlockFlow.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\nimport { RemediationFlow } from './RemediationFlow';\nimport {\n Identify,\n SelectAuthenticatorUnlockAccount,\n SelectAuthenticatorAuthenticate,\n ChallengeAuthenticator,\n ChallengePoll,\n AuthenticatorVerificationData\n} from '../remediators';\n\nexport const AccountUnlockFlow: RemediationFlow = {\n 'identify': Identify,\n // NOTE: unlock-account is purposely not included. Handled as action\n // because it's a rememdiation which requires no input\n // 'unlock-account': UnlockAccount,\n 'select-authenticator-unlock-account': SelectAuthenticatorUnlockAccount,\n 'select-authenticator-authenticate': SelectAuthenticatorAuthenticate,\n 'challenge-authenticator': ChallengeAuthenticator,\n 'challenge-poll': ChallengePoll,\n 'authenticator-verification-data': AuthenticatorVerificationData,\n};\n"],"mappings":";;;AAcA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaO,MAAMA,iBAAkC,GAAG;EAChD,UAAU,EAAEC,qBAAQ;EACpB;EACA;EACA;EACA,qCAAqC,EAAEC,6CAAgC;EACvE,mCAAmC,EAAEC,4CAA+B;EACpE,yBAAyB,EAAEC,mCAAsB;EACjD,gBAAgB,EAAEC,0BAAa;EAC/B,iCAAiC,EAAEC;AACrC,CAAC;AAAC"}
1
+ {"version":3,"file":"AccountUnlockFlow.js","names":["AccountUnlockFlow","Identify","SelectAuthenticatorUnlockAccount","SelectAuthenticatorAuthenticate","ChallengeAuthenticator","ChallengePoll","AuthenticatorVerificationData","ReEnrollAuthenticatorWarning"],"sources":["../../../../lib/idx/flow/AccountUnlockFlow.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\nimport { RemediationFlow } from './RemediationFlow';\nimport {\n Identify,\n SelectAuthenticatorUnlockAccount,\n SelectAuthenticatorAuthenticate,\n ChallengeAuthenticator,\n ChallengePoll,\n AuthenticatorVerificationData,\n ReEnrollAuthenticatorWarning\n} from '../remediators';\n\nexport const AccountUnlockFlow: RemediationFlow = {\n 'identify': Identify,\n // NOTE: unlock-account is purposely not included. Handled as action\n // because it's a rememdiation which requires no input\n // 'unlock-account': UnlockAccount,\n 'select-authenticator-unlock-account': SelectAuthenticatorUnlockAccount,\n 'select-authenticator-authenticate': SelectAuthenticatorAuthenticate,\n 'challenge-authenticator': ChallengeAuthenticator,\n 'challenge-poll': ChallengePoll,\n 'authenticator-verification-data': AuthenticatorVerificationData,\n 'reenroll-authenticator-warning': ReEnrollAuthenticatorWarning,\n};\n"],"mappings":";;;AAcA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcO,MAAMA,iBAAkC,GAAG;EAChD,UAAU,EAAEC,qBAAQ;EACpB;EACA;EACA;EACA,qCAAqC,EAAEC,6CAAgC;EACvE,mCAAmC,EAAEC,4CAA+B;EACpE,yBAAyB,EAAEC,mCAAsB;EACjD,gBAAgB,EAAEC,0BAAa;EAC/B,iCAAiC,EAAEC,0CAA6B;EAChE,gCAAgC,EAAEC;AACpC,CAAC;AAAC"}
@@ -24,6 +24,7 @@ const AuthenticationFlow = {
24
24
  'challenge-authenticator': _remediators.ChallengeAuthenticator,
25
25
  'challenge-poll': _remediators.ChallengePoll,
26
26
  'reenroll-authenticator': _remediators.ReEnrollAuthenticator,
27
+ 'reenroll-authenticator-warning': _remediators.ReEnrollAuthenticatorWarning,
27
28
  'enroll-poll': _remediators.EnrollPoll,
28
29
  'select-enrollment-channel': _remediators.SelectEnrollmentChannel,
29
30
  'enrollment-channel-data': _remediators.EnrollmentChannelData,
@@ -1 +1 @@
1
- {"version":3,"file":"AuthenticationFlow.js","names":["AuthenticationFlow","Identify","SelectAuthenticatorAuthenticate","SelectAuthenticatorEnroll","AuthenticatorEnrollmentData","AuthenticatorVerificationData","EnrollAuthenticator","ChallengeAuthenticator","ChallengePoll","ReEnrollAuthenticator","EnrollPoll","SelectEnrollmentChannel","EnrollmentChannelData","RedirectIdp","Skip"],"sources":["../../../../lib/idx/flow/AuthenticationFlow.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\nimport { RemediationFlow } from './RemediationFlow';\nimport { \n Identify,\n SelectAuthenticatorAuthenticate,\n ChallengeAuthenticator,\n ReEnrollAuthenticator,\n RedirectIdp,\n AuthenticatorEnrollmentData,\n SelectAuthenticatorEnroll,\n EnrollAuthenticator,\n AuthenticatorVerificationData,\n EnrollPoll,\n ChallengePoll,\n SelectEnrollmentChannel,\n EnrollmentChannelData,\n Skip\n} from '../remediators';\n\nexport const AuthenticationFlow: RemediationFlow = {\n 'identify': Identify,\n 'select-authenticator-authenticate': SelectAuthenticatorAuthenticate,\n 'select-authenticator-enroll': SelectAuthenticatorEnroll,\n 'authenticator-enrollment-data': AuthenticatorEnrollmentData,\n 'authenticator-verification-data': AuthenticatorVerificationData,\n 'enroll-authenticator': EnrollAuthenticator,\n 'challenge-authenticator': ChallengeAuthenticator,\n 'challenge-poll': ChallengePoll,\n 'reenroll-authenticator': ReEnrollAuthenticator,\n 'enroll-poll': EnrollPoll,\n 'select-enrollment-channel': SelectEnrollmentChannel,\n 'enrollment-channel-data': EnrollmentChannelData,\n 'redirect-idp': RedirectIdp,\n 'skip': Skip,\n};\n"],"mappings":";;;AAcA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqBO,MAAMA,kBAAmC,GAAG;EACjD,UAAU,EAAEC,qBAAQ;EACpB,mCAAmC,EAAEC,4CAA+B;EACpE,6BAA6B,EAAEC,sCAAyB;EACxD,+BAA+B,EAAEC,wCAA2B;EAC5D,iCAAiC,EAAEC,0CAA6B;EAChE,sBAAsB,EAAEC,gCAAmB;EAC3C,yBAAyB,EAAEC,mCAAsB;EACjD,gBAAgB,EAAEC,0BAAa;EAC/B,wBAAwB,EAAEC,kCAAqB;EAC/C,aAAa,EAAEC,uBAAU;EACzB,2BAA2B,EAAEC,oCAAuB;EACpD,yBAAyB,EAAEC,kCAAqB;EAChD,cAAc,EAAEC,wBAAW;EAC3B,MAAM,EAAEC;AACV,CAAC;AAAC"}
1
+ {"version":3,"file":"AuthenticationFlow.js","names":["AuthenticationFlow","Identify","SelectAuthenticatorAuthenticate","SelectAuthenticatorEnroll","AuthenticatorEnrollmentData","AuthenticatorVerificationData","EnrollAuthenticator","ChallengeAuthenticator","ChallengePoll","ReEnrollAuthenticator","ReEnrollAuthenticatorWarning","EnrollPoll","SelectEnrollmentChannel","EnrollmentChannelData","RedirectIdp","Skip"],"sources":["../../../../lib/idx/flow/AuthenticationFlow.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\nimport { RemediationFlow } from './RemediationFlow';\nimport { \n Identify,\n SelectAuthenticatorAuthenticate,\n ChallengeAuthenticator,\n ReEnrollAuthenticator,\n ReEnrollAuthenticatorWarning,\n RedirectIdp,\n AuthenticatorEnrollmentData,\n SelectAuthenticatorEnroll,\n EnrollAuthenticator,\n AuthenticatorVerificationData,\n EnrollPoll,\n ChallengePoll,\n SelectEnrollmentChannel,\n EnrollmentChannelData,\n Skip\n} from '../remediators';\n\nexport const AuthenticationFlow: RemediationFlow = {\n 'identify': Identify,\n 'select-authenticator-authenticate': SelectAuthenticatorAuthenticate,\n 'select-authenticator-enroll': SelectAuthenticatorEnroll,\n 'authenticator-enrollment-data': AuthenticatorEnrollmentData,\n 'authenticator-verification-data': AuthenticatorVerificationData,\n 'enroll-authenticator': EnrollAuthenticator,\n 'challenge-authenticator': ChallengeAuthenticator,\n 'challenge-poll': ChallengePoll,\n 'reenroll-authenticator': ReEnrollAuthenticator,\n 'reenroll-authenticator-warning': ReEnrollAuthenticatorWarning,\n 'enroll-poll': EnrollPoll,\n 'select-enrollment-channel': SelectEnrollmentChannel,\n 'enrollment-channel-data': EnrollmentChannelData,\n 'redirect-idp': RedirectIdp,\n 'skip': Skip,\n};\n"],"mappings":";;;AAcA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsBO,MAAMA,kBAAmC,GAAG;EACjD,UAAU,EAAEC,qBAAQ;EACpB,mCAAmC,EAAEC,4CAA+B;EACpE,6BAA6B,EAAEC,sCAAyB;EACxD,+BAA+B,EAAEC,wCAA2B;EAC5D,iCAAiC,EAAEC,0CAA6B;EAChE,sBAAsB,EAAEC,gCAAmB;EAC3C,yBAAyB,EAAEC,mCAAsB;EACjD,gBAAgB,EAAEC,0BAAa;EAC/B,wBAAwB,EAAEC,kCAAqB;EAC/C,gCAAgC,EAAEC,yCAA4B;EAC9D,aAAa,EAAEC,uBAAU;EACzB,2BAA2B,EAAEC,oCAAuB;EACpD,yBAAyB,EAAEC,kCAAqB;EAChD,cAAc,EAAEC,wBAAW;EAC3B,MAAM,EAAEC;AACV,CAAC;AAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"FlowSpecification.js","names":["getFlowSpecification","oktaAuth","flow","remediators","actions","withCredentials","RegistrationFlow","PasswordRecoveryFlow","AccountUnlockFlow","AuthenticationFlow"],"sources":["../../../../lib/idx/flow/FlowSpecification.ts"],"sourcesContent":["import { OktaAuthIdxInterface, FlowIdentifier } from '../types';\nimport { AuthenticationFlow } from './AuthenticationFlow';\nimport { PasswordRecoveryFlow } from './PasswordRecoveryFlow';\nimport { RegistrationFlow } from './RegistrationFlow';\nimport { AccountUnlockFlow } from './AccountUnlockFlow';\nimport { RemediationFlow } from './RemediationFlow';\n\nexport interface FlowSpecification {\n flow: FlowIdentifier;\n remediators: RemediationFlow;\n actions?: string[];\n withCredentials?: boolean;\n}\n\n// eslint-disable-next-line complexity\nexport function getFlowSpecification(\n oktaAuth: OktaAuthIdxInterface,\n flow: FlowIdentifier = 'default'\n): FlowSpecification {\n let remediators, actions, withCredentials = true;\n switch (flow) {\n case 'register':\n case 'signup':\n case 'enrollProfile':\n remediators = RegistrationFlow;\n withCredentials = false;\n break;\n case 'recoverPassword':\n case 'resetPassword':\n remediators = PasswordRecoveryFlow;\n actions = [\n 'currentAuthenticator-recover', \n 'currentAuthenticatorEnrollment-recover'\n ];\n withCredentials = false;\n break;\n case 'unlockAccount':\n remediators = AccountUnlockFlow;\n withCredentials = false;\n actions = [\n 'unlock-account'\n ];\n break;\n case 'authenticate':\n case 'login':\n case 'signin':\n remediators = AuthenticationFlow;\n break;\n default:\n // default case has no flow monitor\n remediators = AuthenticationFlow;\n break;\n }\n return { flow, remediators, actions, withCredentials };\n}\n"],"mappings":";;;AACA;AACA;AACA;AACA;AAUA;AACO,SAASA,oBAAoB,CAClCC,QAA8B,EAC9BC,IAAoB,GAAG,SAAS,EACb;EACnB,IAAIC,WAAW;IAAEC,OAAO;IAAEC,eAAe,GAAG,IAAI;EAChD,QAAQH,IAAI;IACV,KAAK,UAAU;IACf,KAAK,QAAQ;IACb,KAAK,eAAe;MAClBC,WAAW,GAAGG,kCAAgB;MAC9BD,eAAe,GAAG,KAAK;MACvB;IACF,KAAK,iBAAiB;IACtB,KAAK,eAAe;MAClBF,WAAW,GAAGI,0CAAoB;MAClCH,OAAO,GAAG,CACR,8BAA8B,EAC9B,wCAAwC,CACzC;MACDC,eAAe,GAAG,KAAK;MACvB;IACF,KAAK,eAAe;MAClBF,WAAW,GAAGK,oCAAiB;MAC/BH,eAAe,GAAG,KAAK;MACvBD,OAAO,GAAG,CACR,gBAAgB,CACjB;MACD;IACF,KAAK,cAAc;IACnB,KAAK,OAAO;IACZ,KAAK,QAAQ;MACXD,WAAW,GAAGM,sCAAkB;MAChC;IACF;MACE;MACAN,WAAW,GAAGM,sCAAkB;MAChC;EAAM;EAEV,OAAO;IAAEP,IAAI;IAAEC,WAAW;IAAEC,OAAO;IAAEC;EAAgB,CAAC;AACxD"}
1
+ {"version":3,"file":"FlowSpecification.js","names":["getFlowSpecification","oktaAuth","flow","remediators","actions","withCredentials","RegistrationFlow","PasswordRecoveryFlow","AccountUnlockFlow","AuthenticationFlow"],"sources":["../../../../lib/idx/flow/FlowSpecification.ts"],"sourcesContent":["import { OktaAuthIdxInterface, FlowIdentifier, FlowSpecification } from '../types';\nimport { AuthenticationFlow } from './AuthenticationFlow';\nimport { PasswordRecoveryFlow } from './PasswordRecoveryFlow';\nimport { RegistrationFlow } from './RegistrationFlow';\nimport { AccountUnlockFlow } from './AccountUnlockFlow';\n\n// eslint-disable-next-line complexity\nexport function getFlowSpecification(\n oktaAuth: OktaAuthIdxInterface,\n flow: FlowIdentifier = 'default'\n): FlowSpecification {\n let remediators, actions, withCredentials = true;\n switch (flow) {\n case 'register':\n case 'signup':\n case 'enrollProfile':\n remediators = RegistrationFlow;\n withCredentials = false;\n break;\n case 'recoverPassword':\n case 'resetPassword':\n remediators = PasswordRecoveryFlow;\n actions = [\n 'currentAuthenticator-recover', \n 'currentAuthenticatorEnrollment-recover'\n ];\n withCredentials = false;\n break;\n case 'unlockAccount':\n remediators = AccountUnlockFlow;\n withCredentials = false;\n actions = [\n 'unlock-account'\n ];\n break;\n case 'authenticate':\n case 'login':\n case 'signin':\n remediators = AuthenticationFlow;\n break;\n default:\n // default case has no flow monitor\n remediators = AuthenticationFlow;\n break;\n }\n return { flow, remediators, actions, withCredentials };\n}\n"],"mappings":";;;AACA;AACA;AACA;AACA;AAEA;AACO,SAASA,oBAAoB,CAClCC,QAA8B,EAC9BC,IAAoB,GAAG,SAAS,EACb;EACnB,IAAIC,WAAW;IAAEC,OAAO;IAAEC,eAAe,GAAG,IAAI;EAChD,QAAQH,IAAI;IACV,KAAK,UAAU;IACf,KAAK,QAAQ;IACb,KAAK,eAAe;MAClBC,WAAW,GAAGG,kCAAgB;MAC9BD,eAAe,GAAG,KAAK;MACvB;IACF,KAAK,iBAAiB;IACtB,KAAK,eAAe;MAClBF,WAAW,GAAGI,0CAAoB;MAClCH,OAAO,GAAG,CACR,8BAA8B,EAC9B,wCAAwC,CACzC;MACDC,eAAe,GAAG,KAAK;MACvB;IACF,KAAK,eAAe;MAClBF,WAAW,GAAGK,oCAAiB;MAC/BH,eAAe,GAAG,KAAK;MACvBD,OAAO,GAAG,CACR,gBAAgB,CACjB;MACD;IACF,KAAK,cAAc;IACnB,KAAK,OAAO;IACZ,KAAK,QAAQ;MACXD,WAAW,GAAGM,sCAAkB;MAChC;IACF;MACE;MACAN,WAAW,GAAGM,sCAAkB;MAChC;EAAM;EAEV,OAAO;IAAEP,IAAI;IAAEC,WAAW;IAAEC,OAAO;IAAEC;EAAgB,CAAC;AACxD"}
@@ -24,6 +24,7 @@ const PasswordRecoveryFlow = {
24
24
  'authenticator-enrollment-data': _remediators.AuthenticatorEnrollmentData,
25
25
  'reset-authenticator': _remediators.ResetAuthenticator,
26
26
  'reenroll-authenticator': _remediators.ReEnrollAuthenticator,
27
+ 'reenroll-authenticator-warning': _remediators.ReEnrollAuthenticatorWarning,
27
28
  'enroll-poll': _remediators.EnrollPoll
28
29
  };
29
30
  exports.PasswordRecoveryFlow = PasswordRecoveryFlow;
@@ -1 +1 @@
1
- {"version":3,"file":"PasswordRecoveryFlow.js","names":["PasswordRecoveryFlow","Identify","SelectAuthenticatorAuthenticate","SelectAuthenticatorEnroll","ChallengeAuthenticator","AuthenticatorVerificationData","AuthenticatorEnrollmentData","ResetAuthenticator","ReEnrollAuthenticator","EnrollPoll"],"sources":["../../../../lib/idx/flow/PasswordRecoveryFlow.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\nimport { RemediationFlow } from './RemediationFlow';\nimport {\n Identify,\n SelectAuthenticatorAuthenticate,\n ChallengeAuthenticator,\n AuthenticatorVerificationData,\n ResetAuthenticator,\n ReEnrollAuthenticator,\n SelectAuthenticatorEnroll,\n AuthenticatorEnrollmentData,\n EnrollPoll\n} from '../remediators';\n\nexport const PasswordRecoveryFlow: RemediationFlow = {\n 'identify': Identify,\n 'identify-recovery': Identify,\n 'select-authenticator-authenticate': SelectAuthenticatorAuthenticate,\n 'select-authenticator-enroll': SelectAuthenticatorEnroll,\n 'challenge-authenticator': ChallengeAuthenticator,\n 'authenticator-verification-data': AuthenticatorVerificationData,\n 'authenticator-enrollment-data': AuthenticatorEnrollmentData,\n 'reset-authenticator': ResetAuthenticator,\n 'reenroll-authenticator': ReEnrollAuthenticator,\n 'enroll-poll': EnrollPoll,\n};\n"],"mappings":";;;AAcA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBO,MAAMA,oBAAqC,GAAG;EACnD,UAAU,EAAEC,qBAAQ;EACpB,mBAAmB,EAAEA,qBAAQ;EAC7B,mCAAmC,EAAEC,4CAA+B;EACpE,6BAA6B,EAAEC,sCAAyB;EACxD,yBAAyB,EAAEC,mCAAsB;EACjD,iCAAiC,EAAEC,0CAA6B;EAChE,+BAA+B,EAAEC,wCAA2B;EAC5D,qBAAqB,EAAEC,+BAAkB;EACzC,wBAAwB,EAAEC,kCAAqB;EAC/C,aAAa,EAAEC;AACjB,CAAC;AAAC"}
1
+ {"version":3,"file":"PasswordRecoveryFlow.js","names":["PasswordRecoveryFlow","Identify","SelectAuthenticatorAuthenticate","SelectAuthenticatorEnroll","ChallengeAuthenticator","AuthenticatorVerificationData","AuthenticatorEnrollmentData","ResetAuthenticator","ReEnrollAuthenticator","ReEnrollAuthenticatorWarning","EnrollPoll"],"sources":["../../../../lib/idx/flow/PasswordRecoveryFlow.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\nimport { RemediationFlow } from './RemediationFlow';\nimport {\n Identify,\n SelectAuthenticatorAuthenticate,\n ChallengeAuthenticator,\n AuthenticatorVerificationData,\n ResetAuthenticator,\n ReEnrollAuthenticator,\n ReEnrollAuthenticatorWarning,\n SelectAuthenticatorEnroll,\n AuthenticatorEnrollmentData,\n EnrollPoll\n} from '../remediators';\n\nexport const PasswordRecoveryFlow: RemediationFlow = {\n 'identify': Identify,\n 'identify-recovery': Identify,\n 'select-authenticator-authenticate': SelectAuthenticatorAuthenticate,\n 'select-authenticator-enroll': SelectAuthenticatorEnroll,\n 'challenge-authenticator': ChallengeAuthenticator,\n 'authenticator-verification-data': AuthenticatorVerificationData,\n 'authenticator-enrollment-data': AuthenticatorEnrollmentData,\n 'reset-authenticator': ResetAuthenticator,\n 'reenroll-authenticator': ReEnrollAuthenticator,\n 'reenroll-authenticator-warning': ReEnrollAuthenticatorWarning,\n 'enroll-poll': EnrollPoll,\n};\n"],"mappings":";;;AAcA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBO,MAAMA,oBAAqC,GAAG;EACnD,UAAU,EAAEC,qBAAQ;EACpB,mBAAmB,EAAEA,qBAAQ;EAC7B,mCAAmC,EAAEC,4CAA+B;EACpE,6BAA6B,EAAEC,sCAAyB;EACxD,yBAAyB,EAAEC,mCAAsB;EACjD,iCAAiC,EAAEC,0CAA6B;EAChE,+BAA+B,EAAEC,wCAA2B;EAC5D,qBAAqB,EAAEC,+BAAkB;EACzC,wBAAwB,EAAEC,kCAAqB;EAC/C,gCAAgC,EAAEC,yCAA4B;EAC9D,aAAa,EAAEC;AACjB,CAAC;AAAC"}
@@ -19,14 +19,15 @@ var _errors = require("../../../errors");
19
19
  */
20
20
 
21
21
  /* eslint-disable max-len */
22
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
23
- // @ts-nocheck
22
+
24
23
  // auth-js/types
25
24
 
26
- const SKIP_FIELDS = Object.fromEntries(['remediation',
27
- // remediations are put into proceed/neededToProceed
28
- 'context' // the API response of 'context' isn't externally useful. We ignore it and put all non-action (contextual) info into idxState.context
29
- ].map(field => [field, !!'skip this field']));
25
+ const SKIP_FIELDS = {
26
+ 'remediation': true,
27
+ // remediations are put into proceed/neededToProceed
28
+ 'context': true // the API response of 'context' isn't externally useful. We ignore it and put all non-action (contextual) info into idxState.context
29
+ };
30
+
30
31
  const parseNonRemediations = function parseNonRemediations(authClient, idxResponse, toPersist = {}) {
31
32
  const actions = {};
32
33
  const context = {};
@@ -64,6 +65,8 @@ const parseNonRemediations = function parseNonRemediations(authClient, idxRespon
64
65
  if (value.rel) {
65
66
  // is [field].value[subField] an action?
66
67
  // add any "action" value subfields to actions
68
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
69
+ // @ts-ignore
67
70
  actions[`${field}-${subField.name || subField}`] = (0, _generateIdxAction.default)(authClient, value, toPersist);
68
71
  } else {
69
72
  // add non-action value subfields to context
@@ -1 +1 @@
1
- {"version":3,"file":"idxResponseParser.js","names":["SKIP_FIELDS","Object","fromEntries","map","field","parseNonRemediations","authClient","idxResponse","toPersist","actions","context","keys","filter","forEach","fieldIsObject","rel","name","generateIdxAction","value","fieldValue","type","info","entries","subField","expandRelatesTo","k","query","Array","isArray","result","jsonpath","path","json","AuthSdkError","innerValue","convertRemediationAction","remediation","remediationActions","generateRemediationFunctions","actionFn","action","parseIdxResponse","remediationData","relatesTo","authenticatorChallenge","remediations"],"sources":["../../../../../lib/idx/idxState/v1/idxResponseParser.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-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 max-len */\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { OktaAuthIdxInterface } from '../../types'; // auth-js/types\nimport { generateRemediationFunctions } from './remediationParser';\nimport generateIdxAction from './generateIdxAction';\nimport { jsonpath } from '../../../util/jsonpath';\nimport { AuthSdkError } from '../../../errors';\n\nconst SKIP_FIELDS = Object.fromEntries([\n 'remediation', // remediations are put into proceed/neededToProceed\n 'context', // the API response of 'context' isn't externally useful. We ignore it and put all non-action (contextual) info into idxState.context\n].map( (field) => [ field, !!'skip this field' ] ));\n\nexport const parseNonRemediations = function parseNonRemediations( authClient: OktaAuthIdxInterface, idxResponse, toPersist = {} ) {\n const actions = {};\n const context = {};\n\n Object.keys(idxResponse)\n .filter( field => !SKIP_FIELDS[field])\n .forEach( field => {\n const fieldIsObject = typeof idxResponse[field] === 'object' && !!idxResponse[field];\n\n if ( !fieldIsObject ) {\n // simple fields are contextual info\n context[field] = idxResponse[field];\n return;\n }\n\n if ( idxResponse[field].rel ) {\n // top level actions\n actions[idxResponse[field].name] = generateIdxAction(authClient, idxResponse[field], toPersist);\n return;\n }\n\n const { value: fieldValue, type, ...info} = idxResponse[field];\n context[field] = { type, ...info}; // add the non-action parts as context\n\n if ( type !== 'object' ) {\n // only object values hold actions\n context[field].value = fieldValue;\n return;\n }\n\n // We are an object field containing an object value\n context[field].value = {};\n Object.entries(fieldValue)\n .forEach( ([subField, value]) => {\n if (value.rel) { // is [field].value[subField] an action?\n // add any \"action\" value subfields to actions\n actions[`${field}-${subField.name || subField}`] = generateIdxAction(authClient, value, toPersist);\n } else {\n // add non-action value subfields to context\n context[field].value[subField] = value;\n }\n });\n });\n\n return { context, actions };\n};\n\nconst expandRelatesTo = (idxResponse, value) => {\n Object.keys(value).forEach(k => {\n if (k === 'relatesTo') {\n const query = Array.isArray(value[k]) ? value[k][0] : value[k];\n if (typeof query === 'string') {\n const result = jsonpath({ path: query, json: idxResponse })[0];\n if (result) {\n value[k] = result;\n return;\n } else {\n throw new AuthSdkError(`Cannot resolve relatesTo: ${query}`);\n }\n }\n }\n if (Array.isArray(value[k])) {\n value[k].forEach(innerValue => expandRelatesTo(idxResponse, innerValue));\n }\n });\n};\n\nconst convertRemediationAction = (authClient: OktaAuthIdxInterface, remediation, toPersist) => {\n // Only remediation that has `rel` field (indicator for form submission) can have http action\n if (remediation.rel) {\n const remediationActions = generateRemediationFunctions( authClient, [remediation], toPersist );\n const actionFn = remediationActions[remediation.name];\n return {\n ...remediation,\n action: actionFn,\n };\n }\n\n return remediation;\n};\n\nexport const parseIdxResponse = function parseIdxResponse( authClient: OktaAuthIdxInterface, idxResponse, toPersist = {} ): {\n remediations: IdxRemediation[];\n context: IdxContext;\n actions: IdxActions;\n} {\n const remediationData = idxResponse.remediation?.value || [];\n\n remediationData.forEach(\n remediation => {\n // TODO: remove once IDX is fixed - OKTA-659181\n if (remediation.name === 'launch-authenticator' &&\n remediation?.relatesTo?.[0] === 'authenticatorChallenge' &&\n !idxResponse?.authenticatorChallenge\n ) {\n delete remediation.relatesTo;\n return;\n }\n\n return expandRelatesTo(idxResponse, remediation);\n }\n );\n\n const remediations = remediationData.map(remediation => convertRemediationAction( authClient, remediation, toPersist ));\n\n const { context, actions } = parseNonRemediations( authClient, idxResponse, toPersist );\n\n return {\n remediations,\n context,\n actions,\n };\n};\n"],"mappings":";;;;AAgBA;AACA;AACA;AACA;AAnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACuD;;AAMvD,MAAMA,WAAW,GAAGC,MAAM,CAACC,WAAW,CAAC,CACrC,aAAa;AAAE;AACf,SAAS,CAAE;AAAA,CACZ,CAACC,GAAG,CAAGC,KAAK,IAAK,CAAEA,KAAK,EAAE,CAAC,CAAC,iBAAiB,CAAE,CA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H,MAAM;IAAEE,OAAO;IAAED;EAAQ,CAAC,GAAGJ,oBAAoB,CAAEC,UAAU,EAAEC,WAAW,EAAEC,SAAS,CAAE;EAEvF,OAAO;IACLqC,YAAY;IACZnC,OAAO;IACPD;EACF,CAAC;AACH,CAAC;AAAC"}
1
+ {"version":3,"file":"idxResponseParser.js","names":["SKIP_FIELDS","parseNonRemediations","authClient","idxResponse","toPersist","actions","context","Object","keys","filter","field","forEach","fieldIsObject","rel","name","generateIdxAction","value","fieldValue","type","info","entries","subField","expandRelatesTo","k","query","Array","isArray","result","jsonpath","path","json","AuthSdkError","innerValue","convertRemediationAction","remediation","remediationActions","generateRemediationFunctions","actionFn","action","parseIdxResponse","remediationData","relatesTo","authenticatorChallenge","remediations","map"],"sources":["../../../../../lib/idx/idxState/v1/idxResponseParser.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-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 max-len */\n\nimport { OktaAuthIdxInterface, IdxResponse, IdxRemediation, IdxContext } from '../../types'; // auth-js/types\nimport { IdxActions } from '../../types/idx-js';\nimport { generateRemediationFunctions } from './remediationParser';\nimport generateIdxAction from './generateIdxAction';\nimport { jsonpath } from '../../../util/jsonpath';\nimport { AuthSdkError } from '../../../errors';\n\nconst SKIP_FIELDS = {\n 'remediation': true, // remediations are put into proceed/neededToProceed\n 'context': true, // the API response of 'context' isn't externally useful. We ignore it and put all non-action (contextual) info into idxState.context\n};\n\nexport const parseNonRemediations = function parseNonRemediations( authClient: OktaAuthIdxInterface, idxResponse: IdxResponse, toPersist = {} ) {\n const actions = {};\n const context = {} as IdxContext;\n\n Object.keys(idxResponse)\n .filter( field => !SKIP_FIELDS[field])\n .forEach( field => {\n const fieldIsObject = typeof idxResponse[field] === 'object' && !!idxResponse[field];\n\n if ( !fieldIsObject ) {\n // simple fields are contextual info\n context[field] = idxResponse[field];\n return;\n }\n\n if ( idxResponse[field].rel ) {\n // top level actions\n actions[idxResponse[field].name] = generateIdxAction(authClient, idxResponse[field], toPersist);\n return;\n }\n\n const { value: fieldValue, type, ...info} = idxResponse[field];\n context[field] = { type, ...info}; // add the non-action parts as context\n\n if ( type !== 'object' ) {\n // only object values hold actions\n context[field].value = fieldValue;\n return;\n }\n\n // We are an object field containing an object value\n context[field].value = {};\n Object.entries<IdxRemediation>(fieldValue)\n .forEach( ([subField, value]) => {\n if (value.rel) { // is [field].value[subField] an action?\n // add any \"action\" value subfields to actions\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n actions[`${field}-${subField.name || subField}`] = generateIdxAction(authClient, value, toPersist);\n } else {\n // add non-action value subfields to context\n context[field].value[subField] = value;\n }\n });\n });\n\n return { context, actions };\n};\n\nconst expandRelatesTo = (idxResponse, value) => {\n Object.keys(value).forEach(k => {\n if (k === 'relatesTo') {\n const query = Array.isArray(value[k]) ? value[k][0] : value[k];\n if (typeof query === 'string') {\n const result = jsonpath({ path: query, json: idxResponse })[0];\n if (result) {\n value[k] = result;\n return;\n } else {\n throw new AuthSdkError(`Cannot resolve relatesTo: ${query}`);\n }\n }\n }\n if (Array.isArray(value[k])) {\n value[k].forEach(innerValue => expandRelatesTo(idxResponse, innerValue));\n }\n });\n};\n\nconst convertRemediationAction = (authClient: OktaAuthIdxInterface, remediation, toPersist) => {\n // Only remediation that has `rel` field (indicator for form submission) can have http action\n if (remediation.rel) {\n const remediationActions = generateRemediationFunctions( authClient, [remediation], toPersist );\n const actionFn = remediationActions[remediation.name];\n return {\n ...remediation,\n action: actionFn,\n };\n }\n\n return remediation;\n};\n\nexport const parseIdxResponse = function parseIdxResponse( authClient: OktaAuthIdxInterface, idxResponse, toPersist = {} ): {\n remediations: IdxRemediation[];\n context: IdxContext;\n actions: IdxActions;\n} {\n const remediationData = idxResponse.remediation?.value || [];\n\n remediationData.forEach(\n remediation => {\n // TODO: remove once IDX is fixed - OKTA-659181\n if (remediation.name === 'launch-authenticator' &&\n remediation?.relatesTo?.[0] === 'authenticatorChallenge' &&\n !idxResponse?.authenticatorChallenge\n ) {\n delete remediation.relatesTo;\n return;\n }\n\n return expandRelatesTo(idxResponse, remediation);\n }\n );\n\n const remediations = remediationData.map(remediation => convertRemediationAction( authClient, remediation, toPersist ));\n\n const { context, actions } = parseNonRemediations( authClient, idxResponse, toPersist );\n\n return {\n remediations,\n context,\n actions,\n };\n};\n"],"mappings":";;;;AAgBA;AACA;AACA;AACA;AAnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEgG;;AAOhG,MAAMA,WAAW,GAAG;EAClB,aAAa,EAAE,IAAI;EAAE;EACrB,SAAS,EAAE,IAAI,CAAE;AACnB,CAAC;;AAEM,MAAMC,oBAAoB,GAAG,SAASA,oBAAoB,CAAEC,UAAgC,EAAEC,WAAwB,EAAEC,SAAS,GAAG,CAAC,CAAC,EAAG;EAC9I,MAAMC,OAAO,GAAG,CAAC,CAAC;EAClB,MAAMC,OAAO,GAAG,CAAC,CAAe;EAEhCC,MAAM,CAACC,IAAI,CAACL,WAAW,CAAC,CACrBM,MAAM,CAAEC,KAAK,IAAI,CAACV,WAAW,CAACU,KAAK,CAAC,CAAC,CACrCC,OAAO,CAAED,KAAK,IAAI;IACjB,MAAME,aAAa,GAAG,OAAOT,WAAW,CAACO,KAAK,CAAC,KAAK,QAAQ,IAAI,CAAC,CAACP,WAAW,CAACO,KAAK,CAAC;IAEpF,IAAK,CAACE,aAAa,EAAG;MACpB;MACAN,OAAO,CAACI,KAAK,CAAC,GAAGP,WAAW,CAACO,KAAK,CAAC;MACnC;IACF;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,UAAgC,EAAEC,WAAW,EAAEC,SAAS,GAAG,CAAC,CAAC,EAItH;EAAA;EACA,MAAMoC,eAAe,GAAG,0BAAArC,WAAW,CAAC+B,WAAW,0DAAvB,sBAAyBlB,KAAK,KAAI,EAAE;EAE5DwB,eAAe,CAAC7B,OAAO,CACrBuB,WAAW,IAAI;IAAA;IACb;IACA,IAAIA,WAAW,CAACpB,IAAI,KAAK,sBAAsB,IAC7C,CAAAoB,WAAW,aAAXA,WAAW,gDAAXA,WAAW,CAAEO,SAAS,0DAAtB,sBAAyB,CAAC,CAAC,MAAK,wBAAwB,IACxD,EAACtC,WAAW,aAAXA,WAAW,eAAXA,WAAW,CAAEuC,sBAAsB,GACpC;MACA,OAAOR,WAAW,CAACO,SAAS;MAC5B;IACF;IAEA,OAAOnB,eAAe,CAACnB,WAAW,EAAE+B,WAAW,CAAC;EAClD,CAAC,CACF;EAED,MAAMS,YAAY,GAAGH,eAAe,CAACI,GAAG,CAACV,WAAW,IAAID,wBAAwB,CAAE/B,UAAU,EAAEgC,WAAW,EAAE9B,SAAS,CAAE,CAAC;EAEvH,MAAM;IAAEE,OAAO;IAAED;EAAQ,CAAC,GAAGJ,oBAAoB,CAAEC,UAAU,EAAEC,WAAW,EAAEC,SAAS,CAAE;EAEvF,OAAO;IACLuC,YAAY;IACZrC,OAAO;IACPD;EACF,CAAC;AACH,CAAC;AAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"makeIdxState.js","names":["makeIdxState","authClient","idxResponse","toPersist","requestDidSucceed","rawIdxResponse","remediations","context","actions","parseIdxResponse","neededToProceed","proceed","remediationChoice","paramsFromUser","remediationChoiceObject","find","remediation","name","Promise","reject","actionFn","action","findCode","item","interactionCode","successWithInteractionCode","value","rawIdxState"],"sources":["../../../../../lib/idx/idxState/v1/makeIdxState.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-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 { IdxResponse, IdxToPersist } from '../../types/idx-js';\nimport { OktaAuthIdxInterface, RawIdxResponse } from '../../types'; // auth-js/types\nimport { parseIdxResponse } from './idxResponseParser';\n\nexport function makeIdxState( \n authClient: OktaAuthIdxInterface,\n idxResponse: RawIdxResponse,\n toPersist: IdxToPersist,\n requestDidSucceed: boolean\n): IdxResponse {\n const rawIdxResponse = idxResponse;\n const { remediations, context, actions } = parseIdxResponse( authClient, idxResponse, toPersist );\n const neededToProceed = [...remediations];\n\n const proceed: IdxResponse['proceed'] = async function( remediationChoice, paramsFromUser = {} ) {\n /*\n remediationChoice is the name attribute on each form\n name should remain unique for items inside the remediation that are considered forms(identify, select-factor)\n name can be duplicate for items like redirect where its not considered a form(redirect)\n when names are not unique its a redirect to a href, so widget wont POST to idx-js layer.\n */\n const remediationChoiceObject = remediations.find((remediation) => remediation.name === remediationChoice);\n if ( !remediationChoiceObject ) {\n return Promise.reject(`Unknown remediation choice: [${remediationChoice}]`);\n }\n\n const actionFn = remediationChoiceObject.action;\n if (typeof actionFn !== 'function') {\n return Promise.reject(`Current remediation cannot make form submit action: [${remediationChoice}]`);\n }\n\n return remediationChoiceObject.action(paramsFromUser);\n };\n\n const findCode = item => item.name === 'interaction_code';\n const interactionCode = rawIdxResponse.successWithInteractionCode?.value?.find( findCode )?.value as string;\n\n return {\n proceed,\n neededToProceed,\n actions,\n context,\n rawIdxState: rawIdxResponse,\n interactionCode,\n toPersist,\n requestDidSucceed,\n };\n}\n"],"mappings":";;;AAcA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGuE;;AAGhE,SAASA,YAAY,CAC1B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State","authClient","idxResponse","toPersist","requestDidSucceed","rawIdxResponse","remediations","context","actions","parseIdxResponse","neededToProceed","proceed","remediationChoice","paramsFromUser","remediationChoiceObject","find","remediation","name","Promise","reject","actionFn","action","findCode","item","interactionCode","successWithInteractionCode","value","rawIdxState"],"sources":["../../../../../lib/idx/idxState/v1/makeIdxState.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-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 { IdxResponse, IdxToPersist, IdxActionParams } from '../../types/idx-js';\nimport { OktaAuthIdxInterface, RawIdxResponse } from '../../types'; // auth-js/types\nimport { parseIdxResponse } from './idxResponseParser';\n\nexport function makeIdxState( \n authClient: OktaAuthIdxInterface,\n idxResponse: RawIdxResponse,\n toPersist: IdxToPersist,\n requestDidSucceed: boolean\n): IdxResponse {\n const rawIdxResponse = idxResponse;\n const { remediations, context, actions } = parseIdxResponse( authClient, idxResponse, toPersist );\n const neededToProceed = [...remediations];\n\n const proceed: IdxResponse['proceed'] = async function( remediationChoice, paramsFromUser = {} ) {\n /*\n remediationChoice is the name attribute on each form\n name should remain unique for items inside the remediation that are considered forms(identify, select-factor)\n name can be duplicate for items like redirect where its not considered a form(redirect)\n when names are not unique its a redirect to a href, so widget wont POST to idx-js layer.\n */\n const remediationChoiceObject = remediations.find((remediation) => remediation.name === remediationChoice);\n if ( !remediationChoiceObject ) {\n return Promise.reject(`Unknown remediation choice: [${remediationChoice}]`);\n }\n\n const actionFn = remediationChoiceObject.action;\n if (typeof actionFn !== 'function') {\n return Promise.reject(`Current remediation cannot make form submit action: [${remediationChoice}]`);\n }\n\n return remediationChoiceObject.action!(paramsFromUser as IdxActionParams);\n };\n\n const findCode = item => item.name === 'interaction_code';\n const interactionCode = rawIdxResponse.successWithInteractionCode?.value?.find( findCode )?.value as string;\n\n return {\n proceed,\n neededToProceed,\n actions,\n context,\n rawIdxState: rawIdxResponse,\n interactionCode,\n toPersist,\n requestDidSucceed,\n };\n}\n"],"mappings":";;;AAcA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGuE;;AAGhE,SAASA,YAAY,CAC1BC,UAAgC,EAChCC,WAA2B,EAC3BC,SAAuB,EACvBC,iBAA0B,EACb;EAAA;EACb,MAAMC,cAAc,GAAIH,WAAW;EACnC,MAAM;IAAEI,YAAY;IAAEC,OAAO;IAAEC;EAAQ,CAAC,GAAG,IAAAC,mCAAgB,EAAER,UAAU,EAAEC,WAAW,EAAEC,SAAS,CAAE;EACjG,MAAMO,eAAe,GAAG,CAAC,GAAGJ,YAAY,CAAC;EAEzC,MAAMK,OAA+B,GAAG,gBAAgBC,iBAAiB,EAAEC,cAAc,GAAG,CAAC,CAAC,EAAG;IAC/F;AACJ;AACA;AACA;AACA;AACA;IACI,MAAMC,uBAAuB,GAAGR,YAAY,CAACS,IAAI,CAAEC,WAAW,IAAKA,WAAW,CAACC,IAAI,KAAKL,iBAAiB,CAAC;IAC1G,IAAK,CAACE,uBAAuB,EAAG;MAC9B,OAAOI,OAAO,CAACC,MAAM,CAAE,gCAA+BP,iBAAkB,GAAE,CAAC;IAC7E;IAEA,MAAMQ,QAAQ,GAAGN,uBAAuB,CAACO,MAAM;IAC/C,IAAI,OAAOD,QAAQ,KAAK,UAAU,EAAE;MAClC,OAAOF,OAAO,CAACC,MAAM,CAAE,wDAAuDP,iBAAkB,GAAE,CAAC;IACrG;IAEA,OAAOE,uBAAuB,CAACO,MAAM,CAAER,cAAc,CAAoB;EAC3E,CAAC;EAED,MAAMS,QAAQ,GAAGC,IAAI,IAAIA,IAAI,CAACN,IAAI,KAAK,kBAAkB;EACzD,MAAMO,eAAe,4BAAGnB,cAAc,CAACoB,0BAA0B,oFAAzC,sBAA2CC,KAAK,qFAAhD,uBAAkDX,IAAI,CAAEO,QAAQ,CAAE,2DAAlE,uBAAoEI,KAAe;EAE3G,OAAO;IACLf,OAAO;IACPD,eAAe;IACfF,OAAO;IACPD,OAAO;IACPoB,WAAW,EAAEtB,cAAc;IAC3BmB,eAAe;IACfrB,SAAS;IACTC;EACF,CAAC;AACH"}
@@ -12,10 +12,7 @@ var _makeIdxState = require("./makeIdxState");
12
12
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  *
14
14
  * See the License for the specific language governing permissions and limitations under the License.
15
- */
16
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
17
- // @ts-nocheck
18
- var _default = {
15
+ */var _default = {
19
16
  makeIdxState: _makeIdxState.makeIdxState
20
17
  };
21
18
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"parsers.js","names":["makeIdxState"],"sources":["../../../../../lib/idx/idxState/v1/parsers.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-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-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { makeIdxState } from './makeIdxState';\n\nexport default {\n makeIdxState,\n};\n"],"mappings":";;;AAcA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA,eAGe;EACbA,YAAY,EAAZA;AACF,CAAC;AAAA;AAAA"}
1
+ {"version":3,"file":"parsers.js","names":["makeIdxState"],"sources":["../../../../../lib/idx/idxState/v1/parsers.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-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 { makeIdxState } from './makeIdxState';\n\nexport default {\n makeIdxState,\n};\n"],"mappings":";;;AAYA;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAVA,eAce;EACbA,YAAY,EAAZA;AACF,CAAC;AAAA;AAAA"}
@@ -15,14 +15,13 @@ var _generateIdxAction = _interopRequireDefault(require("./generateIdxAction"));
15
15
  * See the License for the specific language governing permissions and limitations under the License.
16
16
  */
17
17
 
18
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
19
- // @ts-nocheck
20
18
  // auth-js/types
21
19
 
22
20
  const generateRemediationFunctions = function generateRemediationFunctions(authClient, remediationValue, toPersist = {}) {
23
- return Object.fromEntries(remediationValue.map(remediation => {
24
- return [remediation.name, (0, _generateIdxAction.default)(authClient, remediation, toPersist)];
25
- }));
21
+ return remediationValue.reduce((obj, remediation) => ({
22
+ ...obj,
23
+ [remediation.name]: (0, _generateIdxAction.default)(authClient, remediation, toPersist)
24
+ }), {});
26
25
  };
27
26
  exports.generateRemediationFunctions = generateRemediationFunctions;
28
27
  //# sourceMappingURL=remediationParser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"remediationParser.js","names":["generateRemediationFunctions","authClient","remediationValue","toPersist","Object","fromEntries","map","remediation","name","generateIdxAction"],"sources":["../../../../../lib/idx/idxState/v1/remediationParser.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-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-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { OktaAuthIdxInterface } from '../../types'; // auth-js/types\nimport generateIdxAction from './generateIdxAction';\n\nexport const generateRemediationFunctions = function generateRemediationFunctions(\n authClient: OktaAuthIdxInterface,\n remediationValue,\n toPersist = {}\n) {\n return Object.fromEntries( remediationValue.map( remediation => {\n return [\n remediation.name,\n generateIdxAction(authClient, remediation, toPersist),\n ];\n }) );\n};\n"],"mappings":";;;;AAeA;AAfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACuD;;AAGhD,MAAMA,4BAA4B,GAAG,SAASA,4BAA4B,CAC/EC,UAAgC,EAChCC,gBAAgB,EAChBC,SAAS,GAAG,CAAC,CAAC,EACd;EACA,OAAOC,MAAM,CAACC,WAAW,CAAEH,gBAAgB,CAACI,GAAG,CAAEC,WAAW,IAAI;IAC9D,OAAO,CACLA,WAAW,CAACC,IAAI,EAChB,IAAAC,0BAAiB,EAACR,UAAU,EAAEM,WAAW,EAAEJ,SAAS,CAAC,CACtD;EACH,CAAC,CAAC,CAAE;AACN,CAAC;AAAC"}
1
+ {"version":3,"file":"remediationParser.js","names":["generateRemediationFunctions","authClient","remediationValue","toPersist","reduce","obj","remediation","name","generateIdxAction"],"sources":["../../../../../lib/idx/idxState/v1/remediationParser.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-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 { OktaAuthIdxInterface, IdxRemediation } from '../../types'; // auth-js/types\nimport generateIdxAction from './generateIdxAction';\n\nexport const generateRemediationFunctions = function generateRemediationFunctions(\n authClient: OktaAuthIdxInterface,\n remediationValue: IdxRemediation[],\n toPersist = {}\n) {\n return remediationValue.reduce((obj, remediation) => ({\n ...obj,\n [remediation.name]: generateIdxAction(authClient, remediation, toPersist)\n }), {});\n};\n"],"mappings":";;;;AAaA;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEuE;;AAGhE,MAAMA,4BAA4B,GAAG,SAASA,4BAA4B,CAC/EC,UAAgC,EAChCC,gBAAkC,EAClCC,SAAS,GAAG,CAAC,CAAC,EACd;EACA,OAAOD,gBAAgB,CAACE,MAAM,CAAC,CAACC,GAAG,EAAEC,WAAW,MAAM;IACpD,GAAGD,GAAG;IACN,CAACC,WAAW,CAACC,IAAI,GAAG,IAAAC,0BAAiB,EAACP,UAAU,EAAEK,WAAW,EAAEH,SAAS;EAC1E,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACT,CAAC;AAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ exports.mixinMinimalIdx = mixinMinimalIdx;
5
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
6
+ var _minimalApi = require("../idx/factory/minimalApi");
7
+ var webauthn = _interopRequireWildcard(require("./webauthn"));
8
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
9
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
10
+ function mixinMinimalIdx(Base) {
11
+ var _class;
12
+ return _class = class OktaAuthIdx extends Base {
13
+ constructor(...args) {
14
+ super(...args);
15
+ this.idx = (0, _minimalApi.createMinimalIdxAPI)(this);
16
+ }
17
+ }, (0, _defineProperty2.default)(_class, "webauthn", webauthn), _class;
18
+ }
19
+ //# sourceMappingURL=mixinMinimal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mixinMinimal.js","names":["mixinMinimalIdx","Base","OktaAuthIdx","constructor","args","idx","createMinimalIdxAPI","webauthn"],"sources":["../../../lib/idx/mixinMinimal.ts"],"sourcesContent":["import { OktaAuthConstructor } from '../base/types';\nimport { MinimalOktaOAuthInterface } from '../oidc/types';\nimport {\n IdxTransactionManagerInterface,\n OktaAuthIdxConstructor,\n OktaAuthIdxOptions,\n MinimalIdxAPI,\n WebauthnAPI,\n MinimalOktaAuthIdxInterface\n} from './types';\nimport { IdxTransactionMeta } from './types/meta';\nimport { IdxStorageManagerInterface } from './types/storage';\nimport { createMinimalIdxAPI } from '../idx/factory/minimalApi';\nimport * as webauthn from './webauthn';\n\nexport function mixinMinimalIdx\n<\n M extends IdxTransactionMeta = IdxTransactionMeta,\n S extends IdxStorageManagerInterface<M> = IdxStorageManagerInterface<M>,\n O extends OktaAuthIdxOptions = OktaAuthIdxOptions,\n TM extends IdxTransactionManagerInterface = IdxTransactionManagerInterface,\n TBase extends OktaAuthConstructor<MinimalOktaOAuthInterface<M, S, O, TM>>\n = OktaAuthConstructor<MinimalOktaOAuthInterface<M, S, O, TM>>\n>\n(\n Base: TBase\n): TBase & OktaAuthIdxConstructor<MinimalOktaAuthIdxInterface<M, S, O, TM>>\n{\n return class OktaAuthIdx extends Base implements MinimalOktaAuthIdxInterface<M, S, O, TM>\n {\n idx: MinimalIdxAPI;\n static webauthn: WebauthnAPI = webauthn;\n \n constructor(...args: any[]) {\n super(...args);\n this.idx = createMinimalIdxAPI(this);\n }\n };\n}\n"],"mappings":";;;;;AAYA;AACA;AAAuC;AAAA;AAEhC,SAASA,eAAe,CAU7BC,IAAW,EAEb;EAAA;EACE,gBAAO,MAAMC,WAAW,SAASD,IAAI,CACrC;IAIEE,WAAW,CAAC,GAAGC,IAAW,EAAE;MAC1B,KAAK,CAAC,GAAGA,IAAI,CAAC;MACd,IAAI,CAACC,GAAG,GAAG,IAAAC,+BAAmB,EAAC,IAAI,CAAC;IACtC;EACF,CAAC,oDANgCC,QAAQ;AAO3C"}