@strivacity/sdk-core 3.0.2 → 4.0.0-beta.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 (328) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +1873 -340
  3. package/dist/assets/oidc.cjs +2 -0
  4. package/dist/assets/oidc.cjs.map +1 -0
  5. package/dist/assets/oidc.mjs +2 -0
  6. package/dist/assets/oidc.mjs.map +1 -0
  7. package/dist/assets/server.cjs +2 -0
  8. package/dist/assets/server.cjs.map +1 -0
  9. package/dist/assets/server.mjs +2 -0
  10. package/dist/assets/server.mjs.map +1 -0
  11. package/dist/flows/base.cjs +2 -0
  12. package/dist/flows/base.cjs.map +1 -0
  13. package/dist/flows/base.d.ts +26 -0
  14. package/dist/flows/base.mjs +2 -0
  15. package/dist/flows/base.mjs.map +1 -0
  16. package/dist/flows/embedded.cjs +2 -0
  17. package/dist/flows/embedded.cjs.map +1 -0
  18. package/dist/flows/embedded.d.ts +9 -0
  19. package/dist/flows/embedded.mjs +2 -0
  20. package/dist/flows/embedded.mjs.map +1 -0
  21. package/dist/flows/index.cjs +1 -0
  22. package/dist/flows/index.d.ts +5 -0
  23. package/dist/flows/index.mjs +1 -0
  24. package/dist/flows/native.cjs +2 -0
  25. package/dist/flows/native.cjs.map +1 -0
  26. package/dist/flows/native.d.ts +9 -0
  27. package/dist/flows/native.mjs +2 -0
  28. package/dist/flows/native.mjs.map +1 -0
  29. package/dist/flows/popup.cjs +2 -0
  30. package/dist/flows/popup.cjs.map +1 -0
  31. package/dist/flows/popup.d.ts +9 -0
  32. package/dist/flows/popup.mjs +2 -0
  33. package/dist/flows/popup.mjs.map +1 -0
  34. package/dist/flows/redirect.cjs +2 -0
  35. package/dist/flows/redirect.cjs.map +1 -0
  36. package/dist/flows/redirect.d.ts +9 -0
  37. package/dist/flows/redirect.mjs +2 -0
  38. package/dist/flows/redirect.mjs.map +1 -0
  39. package/dist/handlers/embedded.cjs +2 -0
  40. package/dist/handlers/embedded.cjs.map +1 -0
  41. package/dist/handlers/embedded.d.ts +37 -0
  42. package/dist/handlers/embedded.mjs +2 -0
  43. package/dist/handlers/embedded.mjs.map +1 -0
  44. package/dist/handlers/index.cjs +1 -0
  45. package/dist/handlers/index.d.ts +2 -0
  46. package/dist/handlers/index.mjs +1 -0
  47. package/dist/handlers/native.cjs +2 -0
  48. package/dist/handlers/native.cjs.map +1 -0
  49. package/dist/handlers/native.d.ts +56 -0
  50. package/dist/handlers/native.mjs +2 -0
  51. package/dist/handlers/native.mjs.map +1 -0
  52. package/dist/handlers/popup.cjs +2 -0
  53. package/dist/handlers/popup.cjs.map +1 -0
  54. package/dist/handlers/popup.d.ts +21 -0
  55. package/dist/handlers/popup.mjs +2 -0
  56. package/dist/handlers/popup.mjs.map +1 -0
  57. package/dist/handlers/redirect.cjs +2 -0
  58. package/dist/handlers/redirect.cjs.map +1 -0
  59. package/dist/handlers/redirect.d.ts +18 -0
  60. package/dist/handlers/redirect.mjs +2 -0
  61. package/dist/handlers/redirect.mjs.map +1 -0
  62. package/dist/index.cjs +2 -2
  63. package/dist/index.cjs.map +1 -1
  64. package/dist/index.d.ts +16 -21
  65. package/dist/index.mjs +2 -2
  66. package/dist/index.mjs.map +1 -1
  67. package/dist/server/base.cjs +2 -0
  68. package/dist/server/base.cjs.map +1 -0
  69. package/dist/server/base.d.ts +15 -0
  70. package/dist/server/base.mjs +2 -0
  71. package/dist/server/base.mjs.map +1 -0
  72. package/dist/server/index.cjs +1 -0
  73. package/dist/server/index.d.ts +1 -0
  74. package/dist/server/index.mjs +1 -0
  75. package/dist/storages/cache.cjs +2 -0
  76. package/dist/storages/cache.cjs.map +1 -0
  77. package/dist/storages/cache.d.ts +11 -0
  78. package/dist/storages/cache.mjs +2 -0
  79. package/dist/storages/cache.mjs.map +1 -0
  80. package/dist/storages/index.cjs +1 -0
  81. package/dist/storages/index.d.ts +7 -0
  82. package/dist/storages/index.mjs +1 -0
  83. package/dist/storages/indexeddb.cjs +2 -0
  84. package/dist/storages/indexeddb.cjs.map +1 -0
  85. package/dist/storages/indexeddb.d.ts +10 -0
  86. package/dist/storages/indexeddb.mjs +2 -0
  87. package/dist/storages/indexeddb.mjs.map +1 -0
  88. package/dist/storages/local.cjs +2 -0
  89. package/dist/storages/local.cjs.map +1 -0
  90. package/dist/storages/local.d.ts +7 -0
  91. package/dist/storages/local.mjs +2 -0
  92. package/dist/storages/local.mjs.map +1 -0
  93. package/dist/storages/memory.cjs +2 -0
  94. package/dist/storages/memory.cjs.map +1 -0
  95. package/dist/storages/memory.d.ts +8 -0
  96. package/dist/storages/memory.mjs +2 -0
  97. package/dist/storages/memory.mjs.map +1 -0
  98. package/dist/storages/server.cjs +1 -0
  99. package/dist/storages/server.d.ts +39 -0
  100. package/dist/storages/server.mjs +1 -0
  101. package/dist/storages/session.cjs +2 -0
  102. package/dist/storages/session.cjs.map +1 -0
  103. package/dist/storages/session.d.ts +7 -0
  104. package/dist/storages/session.mjs +2 -0
  105. package/dist/storages/session.mjs.map +1 -0
  106. package/dist/storages/worker.cjs +2 -0
  107. package/dist/storages/worker.cjs.map +1 -0
  108. package/dist/storages/worker.d.ts +46 -0
  109. package/dist/storages/worker.mjs +2 -0
  110. package/dist/storages/worker.mjs.map +1 -0
  111. package/dist/types/common.cjs +0 -0
  112. package/dist/types/common.d.ts +145 -0
  113. package/dist/types/common.mjs +0 -0
  114. package/dist/types/embedded.cjs +0 -0
  115. package/dist/types/embedded.d.ts +103 -0
  116. package/dist/types/embedded.mjs +0 -0
  117. package/dist/types/index.cjs +1 -0
  118. package/dist/types/index.d.ts +7 -0
  119. package/dist/types/index.mjs +1 -0
  120. package/dist/types/native.cjs +0 -0
  121. package/dist/types/native.d.ts +385 -0
  122. package/dist/types/native.mjs +0 -0
  123. package/dist/types/oidc.cjs +2 -0
  124. package/dist/types/oidc.cjs.map +1 -0
  125. package/dist/types/oidc.d.ts +768 -0
  126. package/dist/types/oidc.mjs +2 -0
  127. package/dist/types/oidc.mjs.map +1 -0
  128. package/dist/types/popup.cjs +0 -0
  129. package/dist/types/popup.d.ts +69 -0
  130. package/dist/types/popup.mjs +0 -0
  131. package/dist/types/redirect.cjs +0 -0
  132. package/dist/types/redirect.d.ts +21 -0
  133. package/dist/types/redirect.mjs +0 -0
  134. package/dist/types/server.cjs +0 -0
  135. package/dist/types/server.d.ts +200 -0
  136. package/dist/types/server.mjs +0 -0
  137. package/dist/utils/base64url.cjs +2 -0
  138. package/dist/utils/base64url.cjs.map +1 -0
  139. package/dist/utils/base64url.d.ts +14 -0
  140. package/dist/utils/base64url.mjs +2 -0
  141. package/dist/utils/base64url.mjs.map +1 -0
  142. package/dist/utils/common.cjs +2 -0
  143. package/dist/utils/common.cjs.map +1 -0
  144. package/dist/utils/common.d.ts +23 -0
  145. package/dist/utils/common.mjs +2 -0
  146. package/dist/utils/common.mjs.map +1 -0
  147. package/dist/utils/credentials.cjs +2 -2
  148. package/dist/utils/credentials.cjs.map +1 -1
  149. package/dist/utils/credentials.d.ts +19 -3
  150. package/dist/utils/credentials.mjs +2 -2
  151. package/dist/utils/credentials.mjs.map +1 -1
  152. package/dist/utils/crypto.cjs +2 -2
  153. package/dist/utils/crypto.cjs.map +1 -1
  154. package/dist/utils/crypto.d.ts +16 -26
  155. package/dist/utils/crypto.mjs +2 -2
  156. package/dist/utils/crypto.mjs.map +1 -1
  157. package/dist/utils/dom.cjs +2 -0
  158. package/dist/utils/dom.cjs.map +1 -0
  159. package/dist/utils/dom.d.ts +7 -0
  160. package/dist/utils/dom.mjs +2 -0
  161. package/dist/utils/dom.mjs.map +1 -0
  162. package/dist/utils/errors.cjs +2 -2
  163. package/dist/utils/errors.cjs.map +1 -1
  164. package/dist/utils/errors.d.ts +62 -1
  165. package/dist/utils/errors.mjs +2 -2
  166. package/dist/utils/errors.mjs.map +1 -1
  167. package/dist/utils/httpClient.cjs +2 -0
  168. package/dist/utils/httpClient.cjs.map +1 -0
  169. package/dist/utils/httpClient.d.ts +2 -0
  170. package/dist/utils/httpClient.mjs +2 -0
  171. package/dist/utils/httpClient.mjs.map +1 -0
  172. package/dist/utils/index.cjs +1 -0
  173. package/dist/utils/index.d.ts +12 -0
  174. package/dist/utils/index.mjs +1 -0
  175. package/dist/utils/logging.cjs +2 -0
  176. package/dist/utils/logging.cjs.map +1 -0
  177. package/dist/utils/logging.d.ts +2 -0
  178. package/dist/utils/logging.mjs +2 -0
  179. package/dist/utils/logging.mjs.map +1 -0
  180. package/dist/utils/oidc.cjs +1 -0
  181. package/dist/utils/oidc.d.ts +264 -0
  182. package/dist/utils/oidc.mjs +1 -0
  183. package/dist/utils/server.cjs +1 -0
  184. package/dist/utils/server.d.ts +72 -0
  185. package/dist/utils/server.mjs +1 -0
  186. package/dist/utils/session.cjs +2 -0
  187. package/dist/utils/session.cjs.map +1 -0
  188. package/dist/utils/session.d.ts +29 -0
  189. package/dist/utils/session.mjs +2 -0
  190. package/dist/utils/session.mjs.map +1 -0
  191. package/dist/utils/state.cjs +1 -0
  192. package/dist/utils/state.d.ts +23 -0
  193. package/dist/utils/state.mjs +1 -0
  194. package/package.json +53 -1
  195. package/testing/tests/flows/base.spec.ts +1030 -0
  196. package/testing/tests/flows/embedded.spec.ts +443 -0
  197. package/testing/tests/flows/index.spec.ts +8 -0
  198. package/testing/tests/flows/native.spec.ts +487 -0
  199. package/testing/tests/flows/popup.spec.ts +400 -0
  200. package/testing/tests/flows/redirect.spec.ts +369 -0
  201. package/testing/tests/handlers/embedded.spec.ts +199 -0
  202. package/testing/tests/handlers/index.spec.ts +8 -0
  203. package/testing/tests/handlers/native.spec.ts +283 -0
  204. package/testing/tests/handlers/popup.spec.ts +206 -0
  205. package/testing/tests/handlers/redirect.spec.ts +70 -0
  206. package/testing/tests/index.spec.ts +78 -0
  207. package/testing/tests/server/base.spec.ts +846 -0
  208. package/testing/tests/server/index.spec.ts +15 -0
  209. package/testing/tests/storages/cache.spec.ts +107 -0
  210. package/testing/tests/storages/index.spec.ts +22 -0
  211. package/testing/tests/storages/indexeddb.spec.ts +113 -0
  212. package/testing/tests/storages/local.spec.ts +46 -0
  213. package/testing/tests/storages/memory.spec.ts +51 -0
  214. package/testing/tests/storages/server.spec.ts +435 -0
  215. package/testing/tests/storages/session.spec.ts +46 -0
  216. package/testing/tests/storages/worker.spec.ts +106 -0
  217. package/testing/tests/utils/common.spec.ts +77 -0
  218. package/testing/tests/utils/credentials.spec.ts +195 -0
  219. package/testing/tests/utils/dom.spec.ts +37 -0
  220. package/testing/tests/utils/index.spec.ts +71 -0
  221. package/testing/tests/utils/logging.spec.ts +82 -0
  222. package/testing/tests/utils/oidc.spec.ts +744 -0
  223. package/testing/tests/utils/server.spec.ts +235 -0
  224. package/dist/flows/BaseFlow.cjs +0 -2
  225. package/dist/flows/BaseFlow.cjs.map +0 -1
  226. package/dist/flows/BaseFlow.d.ts +0 -191
  227. package/dist/flows/BaseFlow.mjs +0 -2
  228. package/dist/flows/BaseFlow.mjs.map +0 -1
  229. package/dist/flows/EmbeddedFlow.cjs +0 -2
  230. package/dist/flows/EmbeddedFlow.cjs.map +0 -1
  231. package/dist/flows/EmbeddedFlow.d.ts +0 -26
  232. package/dist/flows/EmbeddedFlow.mjs +0 -2
  233. package/dist/flows/EmbeddedFlow.mjs.map +0 -1
  234. package/dist/flows/NativeFlow.cjs +0 -2
  235. package/dist/flows/NativeFlow.cjs.map +0 -1
  236. package/dist/flows/NativeFlow.d.ts +0 -34
  237. package/dist/flows/NativeFlow.mjs +0 -2
  238. package/dist/flows/NativeFlow.mjs.map +0 -1
  239. package/dist/flows/PopupFlow.cjs +0 -2
  240. package/dist/flows/PopupFlow.cjs.map +0 -1
  241. package/dist/flows/PopupFlow.d.ts +0 -36
  242. package/dist/flows/PopupFlow.mjs +0 -2
  243. package/dist/flows/PopupFlow.mjs.map +0 -1
  244. package/dist/flows/RedirectFlow.cjs +0 -2
  245. package/dist/flows/RedirectFlow.cjs.map +0 -1
  246. package/dist/flows/RedirectFlow.d.ts +0 -38
  247. package/dist/flows/RedirectFlow.mjs +0 -2
  248. package/dist/flows/RedirectFlow.mjs.map +0 -1
  249. package/dist/handlers/BaseFlowHandler.cjs +0 -2
  250. package/dist/handlers/BaseFlowHandler.cjs.map +0 -1
  251. package/dist/handlers/BaseFlowHandler.d.ts +0 -61
  252. package/dist/handlers/BaseFlowHandler.mjs +0 -2
  253. package/dist/handlers/BaseFlowHandler.mjs.map +0 -1
  254. package/dist/handlers/EmbeddedFlowHandler.cjs +0 -2
  255. package/dist/handlers/EmbeddedFlowHandler.cjs.map +0 -1
  256. package/dist/handlers/EmbeddedFlowHandler.d.ts +0 -28
  257. package/dist/handlers/EmbeddedFlowHandler.mjs +0 -2
  258. package/dist/handlers/EmbeddedFlowHandler.mjs.map +0 -1
  259. package/dist/handlers/NativeFlowHandler.cjs +0 -2
  260. package/dist/handlers/NativeFlowHandler.cjs.map +0 -1
  261. package/dist/handlers/NativeFlowHandler.d.ts +0 -31
  262. package/dist/handlers/NativeFlowHandler.mjs +0 -2
  263. package/dist/handlers/NativeFlowHandler.mjs.map +0 -1
  264. package/dist/storages/LocalStorage.cjs +0 -2
  265. package/dist/storages/LocalStorage.cjs.map +0 -1
  266. package/dist/storages/LocalStorage.d.ts +0 -23
  267. package/dist/storages/LocalStorage.mjs +0 -2
  268. package/dist/storages/LocalStorage.mjs.map +0 -1
  269. package/dist/storages/SessionStorage.cjs +0 -2
  270. package/dist/storages/SessionStorage.cjs.map +0 -1
  271. package/dist/storages/SessionStorage.d.ts +0 -23
  272. package/dist/storages/SessionStorage.mjs +0 -2
  273. package/dist/storages/SessionStorage.mjs.map +0 -1
  274. package/dist/types.cjs +0 -2
  275. package/dist/types.cjs.map +0 -1
  276. package/dist/types.d.ts +0 -1263
  277. package/dist/types.mjs +0 -2
  278. package/dist/types.mjs.map +0 -1
  279. package/dist/utils/HttpClient.cjs +0 -2
  280. package/dist/utils/HttpClient.cjs.map +0 -1
  281. package/dist/utils/HttpClient.d.ts +0 -4
  282. package/dist/utils/HttpClient.mjs +0 -2
  283. package/dist/utils/HttpClient.mjs.map +0 -1
  284. package/dist/utils/Logging.cjs +0 -2
  285. package/dist/utils/Logging.cjs.map +0 -1
  286. package/dist/utils/Logging.d.ts +0 -8
  287. package/dist/utils/Logging.mjs +0 -2
  288. package/dist/utils/Logging.mjs.map +0 -1
  289. package/dist/utils/Metadata.cjs +0 -2
  290. package/dist/utils/Metadata.cjs.map +0 -1
  291. package/dist/utils/Metadata.d.ts +0 -98
  292. package/dist/utils/Metadata.mjs +0 -2
  293. package/dist/utils/Metadata.mjs.map +0 -1
  294. package/dist/utils/Session.cjs +0 -2
  295. package/dist/utils/Session.cjs.map +0 -1
  296. package/dist/utils/Session.d.ts +0 -82
  297. package/dist/utils/Session.mjs +0 -2
  298. package/dist/utils/Session.mjs.map +0 -1
  299. package/dist/utils/State.cjs +0 -2
  300. package/dist/utils/State.cjs.map +0 -1
  301. package/dist/utils/State.d.ts +0 -43
  302. package/dist/utils/State.mjs +0 -2
  303. package/dist/utils/State.mjs.map +0 -1
  304. package/dist/utils/base64Url.cjs +0 -2
  305. package/dist/utils/base64Url.cjs.map +0 -1
  306. package/dist/utils/base64Url.d.ts +0 -27
  307. package/dist/utils/base64Url.mjs +0 -2
  308. package/dist/utils/base64Url.mjs.map +0 -1
  309. package/dist/utils/date.cjs +0 -2
  310. package/dist/utils/date.cjs.map +0 -1
  311. package/dist/utils/date.d.ts +0 -6
  312. package/dist/utils/date.mjs +0 -2
  313. package/dist/utils/date.mjs.map +0 -1
  314. package/dist/utils/handlers.cjs +0 -2
  315. package/dist/utils/handlers.cjs.map +0 -1
  316. package/dist/utils/handlers.d.ts +0 -35
  317. package/dist/utils/handlers.mjs +0 -2
  318. package/dist/utils/handlers.mjs.map +0 -1
  319. package/dist/utils/jwt.cjs +0 -2
  320. package/dist/utils/jwt.cjs.map +0 -1
  321. package/dist/utils/jwt.d.ts +0 -34
  322. package/dist/utils/jwt.mjs +0 -2
  323. package/dist/utils/jwt.mjs.map +0 -1
  324. package/dist/utils/object.cjs +0 -2
  325. package/dist/utils/object.cjs.map +0 -1
  326. package/dist/utils/object.d.ts +0 -1
  327. package/dist/utils/object.mjs +0 -2
  328. package/dist/utils/object.mjs.map +0 -1
package/dist/types.mjs DELETED
@@ -1,2 +0,0 @@
1
- const e=["code","id_token"],o=["query","fragment"],n=["none"],s=["authorization_code","refresh_token"],i=["RS256"],c=["public"],p=["none","login","create"],r=["redirect","popup"];class a{}class g{xEventId}class l{logging}export{i as AlgorithmTypeList,r as FallbackModeTypeList,s as GrantTypeList,p as PromptTypeList,o as ResponseModeList,e as ResponseTypeList,l as SDKHttpClient,g as SDKLogging,a as SDKStorage,c as SubjectTypeList,n as TokenEndpointAuthMethodList};
2
- //# sourceMappingURL=types.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.mjs","sources":["../src/types.ts"],"sourcesContent":["import type { BaseFlow } from './flows/BaseFlow';\n\n/**\n * Makes properties of `T` required based on the keys provided in `K`.\n *\n * @template T - The type from which properties will be made required.\n * @template K - The keys of `T` that should be required.\n * @example\n * type MyType = { a?: string; b?: number; c?: boolean };\n * type RequiredAB = Mandatory<MyType, 'a' | 'b'>; // { a: string; b: number; c?: boolean }\n */\nexport type Mandatory<T, K extends keyof T> = Required<Pick<T, K>> & Omit<T, K>;\n\n/**\n * A type representing a partial record of key-value pairs where keys are of type `K` and values are of type `T`.\n *\n * @template K - The type of the keys in the record.\n * @template T - The type of the values in the record.\n * @example\n * type StringMap = PartialRecord<string, string>; // { [key: string]: string | undefined }\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PartialRecord<K extends keyof any, T> = {\n\t[P in K]?: T;\n};\n\n// region SDK\n\n/**\n * List of supported response types.\n */\nexport const ResponseTypeList = ['code', 'id_token'] as const;\n/**\n * Type representing valid response types.\n */\nexport type ResponseType = (typeof ResponseTypeList)[number];\n\n/**\n * List of supported response modes.\n */\nexport const ResponseModeList = ['query', 'fragment'] as const;\n/**\n * Type representing valid response modes.\n */\nexport type ResponseMode = (typeof ResponseModeList)[number];\n\n/**\n * List of supported token endpoint authentication methods.\n */\nexport const TokenEndpointAuthMethodList = ['none'] as const;\n/**\n * Type representing valid token endpoint authentication methods.\n */\nexport type TokenEndpointAuthMethod = (typeof TokenEndpointAuthMethodList)[number];\n\n/**\n * List of supported grant types.\n */\nexport const GrantTypeList = ['authorization_code', 'refresh_token'] as const;\n/**\n * Type representing valid grant types.\n */\nexport type GrantType = (typeof GrantTypeList)[number];\n\n/**\n * List of supported algorithm types.\n */\nexport const AlgorithmTypeList = ['RS256'] as const;\n/**\n * Type representing valid algorithm types.\n */\nexport type AlgorithmType = (typeof AlgorithmTypeList)[number];\n\n/**\n * List of supported subject types.\n */\nexport const SubjectTypeList = ['public'] as const;\n/**\n * Type representing valid subject types.\n */\nexport type SubjectType = (typeof SubjectTypeList)[number];\n\n/**\n * List of supported prompt types.\n */\nexport const PromptTypeList = ['none', 'login', 'create'] as const;\n/**\n * Type representing valid prompt types.\n */\nexport type PromptType = (typeof PromptTypeList)[number];\n\n/**\n * List of supported fallback modes.\n */\nexport const FallbackModeTypeList = ['redirect', 'popup'] as const;\n/**\n * Type representing valid fallback modes.\n */\nexport type FallbackMode = (typeof FallbackModeTypeList)[number];\n\n/**\n * Represents a signing key used in cryptographic operations, such as signing JSON Web Tokens (JWTs).\n *\n * This type defines the key's properties, including its usage, type, identifier, algorithm, and key material.\n */\nexport type SigningKey = {\n\t/**\n\t * The intended use of the key. Common values include \"sig\" for signature and \"enc\" for encryption.\n\t *\n\t * @type {string}\n\t * @example 'sig'\n\t */\n\tuse: string;\n\n\t/**\n\t * The key type. For example, \"RSA\" for RSA keys or \"EC\" for Elliptic Curve keys.\n\t *\n\t * @type {string}\n\t * @example 'RSA'\n\t */\n\tkty: string;\n\n\t/**\n\t * A unique identifier for the key. This is used to distinguish the key from others.\n\t *\n\t * @type {string}\n\t * @example 'key-id-1234'\n\t */\n\tkid: string;\n\n\t/**\n\t * The algorithm used with the key. For example, \"RS256\" for RSA SHA-256.\n\t *\n\t * @type {AlgorithmType}\n\t * @example 'RS256'\n\t */\n\talg: AlgorithmType;\n\n\t/**\n\t * The modulus of the RSA key, encoded in base64url format. For RSA keys, this is a required property.\n\t *\n\t * @type {string}\n\t * @example 'base64url-encoded-modulus'\n\t */\n\tn: string;\n\n\t/**\n\t * The exponent of the RSA key, encoded in base64url format. For RSA keys, this is a required property.\n\t *\n\t * @type {string}\n\t * @example 'base64url-encoded-exponent'\n\t */\n\te: string;\n};\n\n/**\n * Represents the metadata options provided by an authorization server.\n *\n * This metadata includes information about the server's endpoints, supported features, and supported claims.\n */\nexport type MetadataOptions = {\n\t/**\n\t * The issuer of the tokens. This is the authorization server or entity that issues the tokens.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com'\n\t */\n\tissuer: string;\n\n\t/**\n\t * The URL of the authorization endpoint where authentication requests are sent.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/oauth/authorize'\n\t */\n\tauthorization_endpoint: string;\n\n\t/**\n\t * The URL of the token endpoint where tokens are exchanged.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/oauth/token'\n\t */\n\ttoken_endpoint: string;\n\n\t/**\n\t * The URL of the JSON Web Key Set (JWKS) endpoint where public keys are available.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/oauth/jwks'\n\t */\n\tjwks_uri: string;\n\n\t/**\n\t * The types of subjects that are supported by the authorization server.\n\t *\n\t * @type {Array<SubjectType>}\n\t * @example ['public']\n\t */\n\tsubject_types_supported: Array<SubjectType>;\n\n\t/**\n\t * The types of responses supported by the authorization server.\n\t *\n\t * @type {Array<string>}\n\t * @example ['code', 'id_token']\n\t */\n\tresponse_types_supported: Array<string>;\n\n\t/**\n\t * The claims supported by the authorization server.\n\t *\n\t * @type {Array<string>}\n\t * @example ['sub', 'name', 'email']\n\t */\n\tclaims_supported: Array<string>;\n\n\t/**\n\t * The grant types supported by the authorization server.\n\t *\n\t * @type {Array<GrantType>}\n\t * @example ['authorization_code', 'refresh_token']\n\t */\n\tgrant_types_supported: Array<GrantType>;\n\n\t/**\n\t * The response modes supported by the authorization server.\n\t *\n\t * @type {Array<ResponseMode>}\n\t * @example ['query', 'fragment']\n\t */\n\tresponse_modes_supported: Array<ResponseMode>;\n\n\t/**\n\t * The URL of the user info endpoint where user information can be retrieved.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/userinfo'\n\t */\n\tuserinfo_endpoint: string;\n\n\t/**\n\t * The scopes supported by the authorization server.\n\t *\n\t * @type {Array<string>}\n\t * @example ['openid', 'profile', 'email']\n\t */\n\tscopes_supported: Array<string>;\n\n\t/**\n\t * The authentication methods supported for token endpoint authentication.\n\t *\n\t * @type {Array<TokenEndpointAuthMethod>}\n\t * @example ['none']\n\t */\n\ttoken_endpoint_auth_methods_supported: Array<TokenEndpointAuthMethod>;\n\n\t/**\n\t * The algorithms supported for signing tokens used in the user info endpoint.\n\t *\n\t * @type {Array<AlgorithmType>}\n\t * @example ['RS256']\n\t */\n\tuserinfo_signing_alg_values_supported: Array<AlgorithmType>;\n\n\t/**\n\t * The algorithms supported for signing ID tokens.\n\t *\n\t * @type {Array<AlgorithmType>}\n\t * @example ['RS256']\n\t */\n\tid_token_signing_alg_values_supported: Array<AlgorithmType>;\n\n\t/**\n\t * The algorithms used to sign ID tokens in response.\n\t *\n\t * @type {Array<AlgorithmType>}\n\t * @example ['RS256']\n\t */\n\tid_token_signed_response_alg: Array<AlgorithmType>;\n\n\t/**\n\t * The algorithms used to sign responses from the user info endpoint.\n\t *\n\t * @type {Array<AlgorithmType>}\n\t * @example ['RS256']\n\t */\n\tuserinfo_signed_response_alg: Array<AlgorithmType>;\n\n\t/**\n\t * Indicates whether the request parameter is supported in requests.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\trequest_parameter_supported: boolean;\n\n\t/**\n\t * Indicates whether the request URI parameter is supported in requests.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\trequest_uri_parameter_supported: boolean;\n\n\t/**\n\t * Indicates whether request URI registration is required.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\trequire_request_uri_registration: boolean;\n\n\t/**\n\t * Indicates whether the claims parameter is supported.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\tclaims_parameter_supported: boolean;\n\n\t/**\n\t * The URL of the revocation endpoint for revoking tokens.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/oauth/revoke'\n\t */\n\trevocation_endpoint: string;\n\n\t/**\n\t * Indicates whether backchannel logout is supported.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\tbackchannel_logout_supported: boolean;\n\n\t/**\n\t * Indicates whether backchannel logout session support is provided.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\tbackchannel_logout_session_supported: boolean;\n\n\t/**\n\t * Indicates whether frontchannel logout is supported.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\tfrontchannel_logout_supported: boolean;\n\n\t/**\n\t * Indicates whether frontchannel logout session support is provided.\n\t *\n\t * @type {boolean}\n\t * @example true\n\t */\n\tfrontchannel_logout_session_supported: boolean;\n\n\t/**\n\t * The URL of the endpoint where end-session requests can be sent.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/logout'\n\t */\n\tend_session_endpoint: string;\n\n\t/**\n\t * The algorithms supported for signing request objects.\n\t *\n\t * @type {Array<AlgorithmType>}\n\t * @example ['RS256']\n\t */\n\trequest_object_signing_alg_values_supported: Array<AlgorithmType>;\n\n\t/**\n\t * The code challenge methods supported by the authorization server.\n\t *\n\t * @type {Array<'S256'>}\n\t * @example ['S256']\n\t */\n\tcode_challenge_methods_supported: Array<'S256'>;\n};\n\n/**\n * Represents the standard claims in a JSON Web Token (JWT).\n *\n * These claims are part of the payload in a JWT and convey information about the token, such as its issuer, subject, and expiration.\n */\nexport type JwtClaims = {\n\t/**\n\t * The issuer of the token. This typically represents the authorization server or entity that issued the JWT.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com'\n\t */\n\tiss?: string;\n\n\t/**\n\t * The subject of the token. This is the identifier for the entity the token represents, such as a user ID.\n\t *\n\t * @type {string}\n\t * @example 'user123'\n\t */\n\tsub?: string;\n\n\t/**\n\t * The audience for which the token is intended. This can be a single identifier or an array of identifiers.\n\t *\n\t * @type {string | Array<string>}\n\t * @example 'your-client-id' | ['client1', 'client2']\n\t */\n\taud?: string | Array<string>;\n\n\t/**\n\t * The expiration time of the token, expressed as a Unix timestamp (number of seconds since January 1, 1970).\n\t *\n\t * @type {number}\n\t * @example 1633024800\n\t */\n\texp?: number;\n\n\t/**\n\t * The not-before time of the token, expressed as a Unix timestamp. The token must not be accepted before this time.\n\t *\n\t * @type {number}\n\t * @example 1633021200\n\t */\n\tnbf?: number;\n\n\t/**\n\t * The issued-at time of the token, expressed as a Unix timestamp (number of seconds since January 1, 1970).\n\t *\n\t * @type {number}\n\t * @example 1633022400\n\t */\n\tiat?: number;\n\n\t/**\n\t * A unique identifier for the token. This can be used to prevent token replay attacks.\n\t *\n\t * @type {string}\n\t * @example 'unique-jwt-id-1234'\n\t */\n\tjti?: string;\n};\n\n/**\n * Represents the claims included in an ID token, extending standard JWT claims with additional properties specific to identity tokens.\n *\n * ID tokens are used to authenticate and provide identity information about the user.\n */\nexport type IdTokenClaims = Mandatory<JwtClaims, 'iss' | 'sub' | 'aud' | 'exp' | 'iat'> & {\n\t/**\n\t * The authentication time, indicating when the user was authenticated.\n\t *\n\t * @type {number}\n\t * @example 1633022400\n\t */\n\tauth_time?: number;\n\n\t/**\n\t * A nonce value used to associate a client session with an ID token, preventing replay attacks.\n\t *\n\t * @type {string}\n\t * @example 'nonce-value-1234'\n\t */\n\tnonce?: string;\n\n\t/**\n\t * The Authentication Context Class Reference, indicating the authentication methods used.\n\t *\n\t * @type {string}\n\t * @example '2'\n\t */\n\tacr?: string;\n\n\t/**\n\t * The Authentication Methods References, providing information about the authentication methods used.\n\t *\n\t * @type {unknown}\n\t */\n\tamr?: unknown;\n\n\t/**\n\t * Authorized party, the client that the ID token is intended for.\n\t *\n\t * @type {string}\n\t * @example 'client-id'\n\t */\n\tazp?: string;\n\n\t/**\n\t * Session ID for the user, which can be used to manage user sessions.\n\t *\n\t * @type {string}\n\t * @example 'session-id-1234'\n\t */\n\tsid?: string;\n\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t[key: string]: any;\n};\n\n/**\n * Options for configuring the SDK.\n */\nexport type SDKOptions = {\n\t/**\n\t * Specifies the mode of the SDK operation, either 'popup' or 'redirect'.\n\t *\n\t * @type {'popup' | 'redirect' | 'native' | 'embedded' | 'custom'}\n\t * @default 'redirect'\n\t */\n\tmode?: 'popup' | 'redirect' | 'native' | 'embedded' | 'custom';\n\n\t/**\n\t * The issuer of the tokens, typically the URL of the authorization server.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com'\n\t */\n\tissuer: string;\n\n\t/**\n\t * The client ID issued by the authorization server, used to identify the application.\n\t *\n\t * @type {string}\n\t * @example 'your-client-id'\n\t */\n\tclientId: string;\n\n\t/**\n\t * The URI to which the user will be redirected after authentication or authorization.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/callback'\n\t */\n\tredirectUri: string;\n\n\t/**\n\t * A list of scopes requested by the application, defining the access levels for the tokens.\n\t *\n\t * @type {Array<string>}\n\t * @default ['openid']\n\t * @example ['openid', 'profile']\n\t */\n\tscopes?: Array<string>;\n\n\t/**\n\t * The type of response expected from the authorization server.\n\t *\n\t * @type {ResponseType}\n\t * @default 'code'\n\t */\n\tresponseType?: ResponseType;\n\n\t/**\n\t * The mode in which the response is returned from the authorization server.\n\t *\n\t * @type {ResponseMode}\n\t * @default 'query'\n\t */\n\tresponseMode?: ResponseMode;\n\n\t/**\n\t * The name of the token in storage used to persist authentication information.\n\t *\n\t * @type {string}\n\t * @default 'sty.session'\n\t * @example 'accessToken'\n\t */\n\tstorageTokenName?: string;\n\n\t/**\n\t * The storage mechanism used to save and retrieve authentication information.\n\t *\n\t * @type {SDKStorageType}\n\t * @default LocalStorage\n\t */\n\tstorage?: SDKStorageType;\n\n\t/**\n\t * The HTTP client used for making requests to the authorization server.\n\t *\n\t * @type {SDKHttpClientType}\n\t * @default HttpClient\n\t */\n\thttpClient?: SDKHttpClientType;\n\n\t/**\n\t * The logging mechanism used for logging messages and errors.\n\t *\n\t * @type {SDKLoggingType}\n\t */\n\tlogging?: SDKLoggingType;\n\n\t/**\n\t * A custom flow handler that extends the BaseFlow class. This allows you to implement a custom authentication flow by providing your own handler.\n\t *\n\t * @type {FlowType}\n\t */\n\tcustomFlow?: FlowType;\n\n\t/**\n\t * Handles the URL redirection to the specified target.\n\t * You can use this method to implement custom URL handling logic, such as opening a new window or navigating to a different page.\n\t *\n\t * @param {string} url - The URL to handle.\n\t * @param {Record<string, unknown>} params - Optional parameters for redirection.\n\t * @returns - A promise that resolves when the redirection is handled.\n\t */\n\turlHandler?: (url: string, params?: Record<string, unknown>) => Promise<unknown>;\n\n\t/**\n\t * Handles the callback from the authorization server after a successful authentication or authorization.\n\t * You can use this method to implement custom logic for processing the response from the authorization server.\n\t *\n\t * @param url - The URL containing the response from the authorization server.\n\t * @param responseMode - The mode in which the response is returned (e.g., 'query', 'fragment').\n\t * @returns - A promise that resolves when the callback is handled.\n\t */\n\tcallbackHandler?: (url: string, responseMode?: ResponseMode) => Promise<unknown>;\n};\n\n/**\n * Abstract class for SDK storage mechanisms.\n */\nexport abstract class SDKStorage {\n\t/**\n\t * Retrieves an item from the storage by key.\n\t *\n\t * @param {string} key - The key of the item to retrieve.\n\t * @returns {string | null} The value associated with the key, or `null` if not found.\n\t */\n\tabstract get(key: string): Promise<string | null>;\n\n\t/**\n\t * Deletes an item from the storage by key.\n\t *\n\t * @param {string} key - The key of the item to delete.\n\t */\n\tabstract delete(key: string): Promise<void>;\n\n\t/**\n\t * Sets an item in the storage with the specified key and value.\n\t *\n\t * @param {string} key - The key to associate with the value.\n\t * @param {string} value - The value to store.\n\t */\n\tabstract set(key: string, value: string): Promise<void>;\n}\n\nexport abstract class SDKLogging {\n\t/*\n\t * Identifier for the login session - can be used to provide additional context for log messages\n\t */\n\txEventId: string | undefined;\n\n\tabstract debug(message: string): void;\n\tabstract info(message: string): void;\n\tabstract warn(message: string): void;\n\tabstract error(message: string, error: Error): void;\n}\n\n/**\n * Abstract class for HTTP client used in the SDK.\n */\nexport abstract class SDKHttpClient {\n\tlogging?: SDKLogging;\n\n\t/**\n\t * Makes an HTTP request to the specified URL with optional options.\n\t * @param {string} url - The URL to which the request is sent.\n\t * @param {RequestInit} options - Optional request options, such as method, headers, body, etc.\n\t */\n\tabstract request<T>(url: string, options?: RequestInit): Promise<HttpClientResponse<T>>;\n}\n\n/**\n * Type representing a constructor function for SDKStorage.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type SDKStorageType = new (...args: Array<any>) => SDKStorage;\n\n/**\n * Type representing a constructor function for SDKHttpClient.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type SDKHttpClientType = new (...args: Array<any>) => SDKHttpClient;\n\n/**\n * Type representing a constructor function for SDKHttpClient.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type SDKLoggingType = new (...args: Array<any>) => SDKLogging;\n\n/**\n * Type representing a constructor function for a custom flow that extends BaseFlow.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type FlowType = new (...args: Array<any>) => BaseFlow;\n\n/**\n * Http client response type.\n */\nexport type HttpClientResponse<T> = {\n\treadonly headers: Headers;\n\treadonly ok: boolean;\n\treadonly status: number;\n\treadonly statusText: string;\n\treadonly url: string;\n\tjson(): Promise<T>;\n\ttext(): Promise<string>;\n};\n\n/**\n * A collection of functions used to handle various events that occur within the SDK.\n */\nexport type EventFunctions = {\n\t/**\n\t * Handler called when an access token has expired.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.accessToken - The expired access token.\n\t * @param {string | null} [params.refreshToken] - The refresh token associated with the access token, if available.\n\t * @returns {Promise<void> | void} A promise that resolves when the handler completes, or void if no asynchronous operation is needed.\n\t */\n\taccessTokenExpired: (params?: { accessToken?: string; refreshToken?: string | null }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when the SDK is initialized.\n\t *\n\t * @returns {Promise<void> | void} A promise that resolves when the initialization is complete, or void if no asynchronous operation is needed.\n\t */\n\tinit: () => Promise<void> | void;\n\n\t/**\n\t * Handler called when a user has successfully logged in.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.accessToken - The access token obtained after login.\n\t * @param {string | null} [params.refreshToken] - The refresh token obtained after login, if available.\n\t * @param {IdTokenClaims} params.claims - The claims extracted from the ID token.\n\t * @returns {Promise<void> | void} A promise that resolves when the handler completes, or void if no asynchronous operation is needed.\n\t */\n\tloggedIn: (params?: { accessToken?: string; refreshToken?: string | null; claims?: IdTokenClaims }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when login has been initiated.\n\t *\n\t * @returns {Promise<void> | void} A promise that resolves when the login initiation process is complete, or void if no asynchronous operation is needed.\n\t */\n\tloginInitiated: () => Promise<void> | void;\n\n\t/**\n\t * Handler called when a logout request has been initiated.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.idToken - The ID token associated with the logout request.\n\t * @param {IdTokenClaims} params.claims - The claims associated with the ID token.\n\t * @returns {Promise<void> | void} A promise that resolves when the logout initiation process is complete, or void if no asynchronous operation is needed.\n\t */\n\tlogoutInitiated: (params?: { idToken?: string; claims?: IdTokenClaims }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when a user session has been successfully loaded.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.accessToken - The access token associated with the loaded session.\n\t * @param {string | null} [params.refreshToken] - The refresh token associated with the session, if available.\n\t * @param {IdTokenClaims} params.claims - The claims associated with the ID token in the session.\n\t * @returns {Promise<void> | void} A promise that resolves when the session loading is complete, or void if no asynchronous operation is needed.\n\t */\n\tsessionLoaded: (params?: { accessToken?: string; refreshToken?: string | null; claims?: IdTokenClaims }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when an access token has been successfully refreshed.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.accessToken - The new access token obtained after the refresh.\n\t * @param {string} params.refreshToken - The refresh token used to obtain the new access token.\n\t * @param {IdTokenClaims} params.claims - The claims extracted from the new ID token.\n\t * @returns {Promise<void> | void} A promise that resolves when the token refresh is complete, or void if no asynchronous operation is needed.\n\t */\n\ttokenRefreshed: (params?: { accessToken?: string; refreshToken?: string; claims?: IdTokenClaims }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when a token refresh operation fails.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.refreshToken - The refresh token that was used in the failed refresh operation.\n\t * @returns {Promise<void> | void} A promise that resolves when the handler completes, or void if no asynchronous operation is needed.\n\t */\n\ttokenRefreshFailed: (params?: { refreshToken?: string }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when a token has been successfully revoked.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.token - The token that was revoked.\n\t * @param {'refresh_token' | 'access_token'} params.tokenTypeHint - The type of token that was revoked.\n\t * @returns {Promise<void> | void} A promise that resolves when the handler completes, or void if no asynchronous operation is needed.\n\t */\n\ttokenRevoked: (params?: { token?: string; tokenTypeHint?: 'refresh_token' | 'access_token' }) => Promise<void> | void;\n\n\t/**\n\t * Handler called when a token revocation operation fails.\n\t *\n\t * @param {Object} params - The parameters for the event.\n\t * @param {string} params.token - The token that was attempted to be revoked.\n\t * @param {'refresh_token' | 'access_token'} params.tokenTypeHint - The type of token that was attempted to be revoked.\n\t * @returns {Promise<void> | void} A promise that resolves when the handler completes, or void if no asynchronous operation is needed.\n\t */\n\ttokenRevokeFailed: (params?: { token?: string; tokenTypeHint?: 'refresh_token' | 'access_token' }) => Promise<void> | void;\n};\n\n// endregion\n\n// region Flows\n\n/**\n * Extra parameters that can be used in requests.\n */\n/**\n * Additional parameters that can be included in authentication or authorization requests.\n */\nexport type ExtraRequestArgs = {\n\t/**\n\t * Specifies the type of prompt to display to the user during authentication or authorization.\n\t *\n\t * @type {PromptType}\n\t * @example 'none' | 'login' | 'create'\n\t */\n\tprompt?: PromptType;\n\n\t/**\n\t * Provides a hint to the authorization server about the user's email or username.\n\t *\n\t * @type {string}\n\t * @example 'user@example.com'\n\t */\n\tloginHint?: string;\n\n\t/**\n\t * A list of values used to request specific authentication contexts or levels of assurance.\n\t *\n\t * This parameter allows requesting specific authentication contexts (e.g., multi-factor authentication)\n\t * or other criteria that the authorization server should consider when authenticating the user.\n\t *\n\t * @type {Array<string>}\n\t * @example ['urn:mace:incommon:iap:bronze', 'urn:mace:incommon:iap:silver']\n\t */\n\tacrValues?: Array<string>;\n\n\t/**\n\t * A list of locale codes to request specific language and regional preferences for the user interface.\n\t *\n\t * This parameter allows requesting the user interface to be presented in specific languages or regional formats.\n\t *\n\t * @type {Array<string>}\n\t * @example ['en-US', 'fr-CA']\n\t */\n\tuiLocales?: Array<string>;\n\n\t/**\n\t * A list of audience values to specify the intended recipients of the token.\n\t *\n\t * This parameter allows requesting that the issued token is intended for specific audiences.\n\t *\n\t * @type {Array<string>}\n\t * @example ['https://api.example.com', 'https://service.example.com']\n\t */\n\taudiences?: Array<string>;\n};\n\n/**\n * Params for configuring logout behavior.\n */\nexport type LogoutParams = {\n\t/**\n\t * The URI to redirect to after a successful logout.\n\t *\n\t * If specified, the user will be redirected to this URI upon completing the logout process.\n\t * This is often used to send users back to the main application or a custom post-logout page.\n\t *\n\t * @type {string}\n\t * @example 'https://example.com/home'\n\t */\n\tpostLogoutRedirectUri?: string;\n};\n\n/**\n * Parameters for redirect authentication flow.\n */\nexport type RedirectParams = ExtraRequestArgs & {\n\t/**\n\t * The method used to update the browser's location after authentication or authorization.\n\t *\n\t * Determines whether the new URL should replace the current URL in the history or be added to it.\n\t *\n\t * @type {'replace' | 'assign'}\n\t * @default 'assign'\n\t */\n\tlocationMethod?: 'replace' | 'assign';\n\n\t/**\n\t * The window in which the redirect should occur.\n\t *\n\t * Specifies whether the redirect should happen in the top-level window or the current window.\n\t *\n\t * @type {'top' | 'self'}\n\t * @default 'self'\n\t */\n\ttargetWindow?: 'top' | 'self';\n};\n\n/**\n * Features for customizing the popup window.\n */\nexport type PopupWindowFeatures = {\n\t/**\n\t * The horizontal position of the popup window relative to the left edge of the screen.\n\t *\n\t * @type {number}\n\t * @example 100\n\t */\n\tleft?: number;\n\n\t/**\n\t * The vertical position of the popup window relative to the top edge of the screen.\n\t *\n\t * @type {number}\n\t * @example 100\n\t */\n\ttop?: number;\n\n\t/**\n\t * The width of the popup window.\n\t *\n\t * @type {number}\n\t * @example 600\n\t */\n\twidth?: number;\n\n\t/**\n\t * The height of the popup window.\n\t *\n\t * @type {number}\n\t * @example 400\n\t */\n\theight?: number;\n\n\t/**\n\t * Whether the popup window should display a menubar.\n\t *\n\t * Can be a boolean value or a string ('yes' or 'no').\n\t *\n\t * @type {boolean | string}\n\t * @example true\n\t */\n\tmenubar?: boolean | string;\n\n\t/**\n\t * Whether the popup window should display a toolbar.\n\t *\n\t * Can be a boolean value or a string ('yes' or 'no').\n\t *\n\t * @type {boolean | string}\n\t * @example true\n\t */\n\ttoolbar?: boolean | string;\n\n\t/**\n\t * Whether the popup window should display the address/location bar.\n\t *\n\t * Can be a boolean value or a string ('yes' or 'no').\n\t *\n\t * @type {boolean | string}\n\t * @example true\n\t */\n\tlocation?: boolean | string;\n\n\t/**\n\t * Whether the popup window should display a status bar.\n\t *\n\t * Can be a boolean value or a string ('yes' or 'no').\n\t *\n\t * @type {boolean | string}\n\t * @example true\n\t */\n\tstatus?: boolean | string;\n\n\t/**\n\t * Whether the popup window should be resizable.\n\t *\n\t * Can be a boolean value or a string ('yes' or 'no').\n\t *\n\t * @type {boolean | string}\n\t * @example false\n\t */\n\tresizable?: boolean | string;\n\n\t/**\n\t * Whether the popup window should display scrollbars.\n\t *\n\t * Can be a boolean value or a string ('yes' or 'no').\n\t *\n\t * @type {boolean | string}\n\t * @example false\n\t */\n\tscrollbars?: boolean | string;\n\n\t[key: string]: boolean | string | number | undefined;\n};\n\n/**\n * Parameters for popup authentication flow.\n */\nexport type PopupParams = ExtraRequestArgs & {\n\t/**\n\t * Configuration options for the popup window, including size, position, and other features.\n\t *\n\t * @type {PopupWindowFeatures}\n\t */\n\tpopupWindowFeatures?: PopupWindowFeatures;\n\n\t/**\n\t * The target of the popup window, which specifies where the popup should be opened.\n\t *\n\t * @type {string}\n\t * @example '_blank' | '_self' | '_parent' | '_top'\n\t */\n\tpopupWindowTarget?: string;\n\n\t/**\n\t * Whether to check the origin of messages received from the popup window.\n\t *\n\t * If set to `true`, the SDK will verify that messages received from the popup window originate from the expected domain.\n\t * This is a security measure to prevent malicious scripts from sending unauthorized messages to the application.\n\t *\n\t * @type {boolean}\n\t * @default true\n\t */\n\tcheckOrigin?: boolean;\n};\n\n/**\n * Parameters for native authentication flow.\n */\nexport type NativeParams = RedirectParams & { sdk?: string };\n\nexport declare const WidgetTypeList: readonly [\n\t'layout',\n\t'submit',\n\t'close',\n\t'static',\n\t'input',\n\t'checkbox',\n\t'password',\n\t'select',\n\t'multiSelect',\n\t'passcode',\n\t'date',\n\t'phone',\n\t'loading',\n\t'passkeyLogin',\n\t'passkeyEnroll',\n\t'webauthnLogin',\n\t'webauthnEnroll',\n];\nexport type WidgetType = (typeof WidgetTypeList)[number];\nexport declare const SelectOptionTypeList: readonly ['item', 'group'];\nexport type SelectOptionType = (typeof SelectOptionTypeList)[number];\nexport type BrandingData = {\n\tlogoUrl: string | null;\n\tbrandName: string | null;\n\tcopyright: string | null;\n\tprivacyPolicyUrl: string | null;\n\tsiteTermsUrl: string | null;\n};\nexport type CheckboxWidget = {\n\tid: string;\n\ttype: 'checkbox';\n\tlabel?: string;\n\treadonly?: boolean;\n\tvalue?: boolean;\n\trender?: {\n\t\ttype: 'checkboxHidden' | 'checkboxShown';\n\t\tlabelType: 'text' | 'html';\n\t};\n\tvalidator?: {\n\t\trequired?: boolean;\n\t};\n};\nexport type DateWidget = {\n\tid: string;\n\ttype: 'date';\n\tlabel?: string;\n\treadonly?: boolean;\n\tvalue?: string;\n\trender?: {\n\t\ttype: 'native' | 'fieldSet';\n\t};\n\tvalidator?: {\n\t\tnotBefore?: string;\n\t\tnotAfter?: string;\n\t\trequired?: boolean;\n\t};\n};\nexport type InputWidget = {\n\tid: string;\n\ttype: 'input';\n\tlabel?: string;\n\tvalue?: string;\n\treadonly?: boolean;\n\tautocomplete?: string;\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tinputmode: any;\n\trender?: {\n\t\tautocompleteHint?: string;\n\t};\n\tvalidator?: {\n\t\trequired?: boolean;\n\t\tminLength?: number;\n\t\tmaxLength?: number;\n\t\tregex?: string;\n\t};\n};\nexport type PasscodeWidget = {\n\tid: string;\n\ttype: 'passcode';\n\tlabel?: string;\n\tvalidator?: {\n\t\tlength?: number;\n\t};\n};\nexport type PasswordWidget = {\n\tid: string;\n\ttype: 'password';\n\tlabel?: string;\n\tqualityIndicator?: boolean;\n\tvalidator?: {\n\t\tminLength?: number;\n\t\tmaxLength?: number;\n\t\tmaxNumericCharacterSequences?: number;\n\t\tmaxRepeatedCharacters?: number;\n\t\tmustContain?: Array<'UPPERCASE' | 'LOWERCASE' | 'NUMERIC' | 'SPECIAL'>;\n\t\trestrictedCharacters?: string;\n\t};\n};\nexport type PhoneWidget = {\n\tid: string;\n\ttype: 'phone';\n\tlabel?: string;\n\treadonly?: boolean;\n\tvalue?: string;\n\tvalidator?: {\n\t\trequired?: boolean;\n\t};\n};\nexport type SelectWidgetOption = {\n\ttype: 'item';\n\tlabel?: string;\n\tvalue: string;\n};\nexport type SelectWidgetOptionGroup = {\n\ttype: 'group';\n\tlabel?: string;\n\toptions: Array<SelectWidgetOption>;\n};\nexport type SelectWidget = {\n\tid: string;\n\ttype: 'select';\n\tlabel?: string;\n\treadonly?: boolean;\n\tvalue?: string;\n\trender?: {\n\t\ttype: 'dropdown' | 'radio';\n\t};\n\toptions: Array<SelectWidgetOptionGroup | SelectWidgetOption>;\n\tvalidator?: {\n\t\trequired?: boolean;\n\t};\n};\nexport type MultiSelectWidget = {\n\tid: string;\n\ttype: 'multiSelect';\n\tlabel?: string;\n\treadonly?: boolean;\n\tvalue?: Array<string>;\n\toptions: Array<SelectWidgetOptionGroup | SelectWidgetOption>;\n\tvalidator?: {\n\t\tminSelectable?: number;\n\t\tmaxSelectable?: number;\n\t};\n};\nexport type StaticWidget = {\n\tid: string;\n\ttype: 'static';\n\tvalue: string;\n\trender?: {\n\t\ttype: 'html' | 'text';\n\t};\n};\nexport type SubmitWidget = {\n\tid: string;\n\ttype: 'submit';\n\tlabel?: string;\n\trender?: {\n\t\ttype: 'button' | 'link';\n\t\ttextColor?: string;\n\t\tbgColor?: string;\n\t\thint?: {\n\t\t\ticon?: string;\n\t\t\tvariant?: string;\n\t\t};\n\t};\n};\nexport type CloseWidget = {\n\tid: string;\n\ttype: 'close';\n\tlabel?: string;\n\trender?: {\n\t\ttype: 'button' | 'link';\n\t\ttextColor?: string;\n\t\tbgColor?: string;\n\t\thint?: {\n\t\t\ticon?: string;\n\t\t\tvariant?: string;\n\t\t};\n\t};\n};\nexport type FormWidget = {\n\tid: string;\n\ttype: 'form';\n\twidgets: Array<\n\t\tCheckboxWidget | DateWidget | InputWidget | PasscodeWidget | PasswordWidget | PhoneWidget | SelectWidget | MultiSelectWidget | StaticWidget | SubmitWidget\n\t>;\n};\nexport type Widget = {\n\ttype: 'widget';\n\tformId: string;\n\twidgetId: string;\n};\nexport type LayoutWidget = {\n\ttype: 'vertical' | 'horizontal';\n\titems: Array<Widget | LayoutWidget>;\n};\nexport type PasskeyLoginWidget = {\n\tid: string;\n\tlabel?: string;\n\trender?: {\n\t\ttype: 'button';\n\t\thint?: {\n\t\t\tvariant?: string;\n\t\t};\n\t};\n\tassertionOptions: PublicKeyCredentialRequestOptions;\n};\nexport type PasskeyEnrollWidget = {\n\tid: string;\n\tlabel?: string;\n\trender?: {\n\t\ttype: 'button';\n\t\thint?: {\n\t\t\tvariant?: string;\n\t\t};\n\t};\n\tenrollOptions: PublicKeyCredentialCreationOptions;\n};\nexport type WebauthnLoginWidget = {\n\tid: string;\n\tlabel?: string;\n\tauthenticatorType: 'deviceBiometrics' | 'securityKey';\n\trender?: {\n\t\ttype: 'button';\n\t\thint?: {\n\t\t\tvariant?: string;\n\t\t};\n\t};\n\tassertionOptions: PublicKeyCredentialRequestOptions;\n};\nexport type WebauthnEnrollWidget = {\n\tid: string;\n\tlabel?: string;\n\tauthenticatorType: 'deviceBiometrics' | 'securityKey';\n\trender?: {\n\t\ttype: 'button';\n\t\thint?: {\n\t\t\tvariant?: string;\n\t\t};\n\t};\n\tenrollOptions: PublicKeyCredentialCreationOptions;\n};\nexport type LoginFlowMessage = {\n\ttype: string;\n\ttext: string;\n};\nexport type LoginFlowState = {\n\thostedUrl?: string;\n\tfinalizeUrl?: string;\n\tscreen?: string;\n\tbranding?: BrandingData;\n\tforms?: Array<FormWidget>;\n\tlayout?: LayoutWidget;\n\tmessages?: Record<string, Record<string, LoginFlowMessage>> & {\n\t\tglobal?: LoginFlowMessage;\n\t};\n};\nexport type AssertionPublicKeyCredential = PublicKeyCredential & {\n\tresponse: AuthenticatorAssertionResponse;\n};\nexport type AssertionCredentialData = {\n\tid: string;\n\ttype: string;\n\trawId: string;\n\tresponse: {\n\t\tclientDataJSON: string;\n\t\tauthenticatorData: string;\n\t\tsignature: string;\n\t\tuserHandle: string;\n\t};\n};\nexport type AttestationPublicKeyCredential = PublicKeyCredential & {\n\tresponse: AuthenticatorAttestationResponse;\n};\nexport type AttestationCredentialData = {\n\tid: string;\n\ttype: string;\n\trawId: string;\n\tauthenticatorAttachment: string | null;\n\tresponse: {\n\t\tclientDataJSON: string;\n\t\tattestationObject: string;\n\t\ttransports: Array<string>;\n\t};\n};\n\nexport declare class LanguageSelectorComponent extends HTMLElement {}\n\nexport declare class NotificationComponent extends HTMLElement {\n\tdevMode: boolean;\n}\n\nexport declare class LandingComponent extends HTMLElement {\n\tactiveBlock: string;\n\tbaseUrl: string;\n\tlazy: boolean;\n\tlang: string;\n\tdebug: boolean;\n\tinitialized?: boolean;\n}\n\nexport declare class LoginComponent extends HTMLElement {\n\tmode?: string;\n\tbaseUrl?: string;\n\tsessionId?: string;\n\tlazy: boolean;\n\tparams: ExtraRequestArgs;\n\tlang: string;\n\tdebug: boolean;\n\tinitialized?: boolean;\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sty-language-selector': LanguageSelectorComponent;\n\t\t'sty-notifications': NotificationComponent;\n\t\t'sty-landing': LandingComponent;\n\t\t'sty-login': LoginComponent;\n\t}\n}\n\n// endregion\n"],"names":["ResponseTypeList","ResponseModeList","TokenEndpointAuthMethodList","GrantTypeList","AlgorithmTypeList","SubjectTypeList","PromptTypeList","FallbackModeTypeList","SDKStorage","SDKLogging","SDKHttpClient"],"mappings":"AA+BO,MAAMA,EAAmB,CAAC,OAAQ,UAAU,EAStCC,EAAmB,CAAC,QAAS,UAAU,EASvCC,EAA8B,CAAC,MAAM,EASrCC,EAAgB,CAAC,qBAAsB,eAAe,EAStDC,EAAoB,CAAC,OAAO,EAS5BC,EAAkB,CAAC,QAAQ,EAS3BC,EAAiB,CAAC,OAAQ,QAAS,QAAQ,EAS3CC,EAAuB,CAAC,WAAY,OAAO,EAwhBjD,MAAeC,CAAW,CAuBjC,CAEO,MAAeC,CAAW,CAIhC,QAMD,CAKO,MAAeC,CAAc,CACnC,OAQD"}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../types.cjs");class a extends i.SDKHttpClient{async request(e,s){e=new URL(e),this.logging?.debug(`REQUEST [${s?.method||"GET"}]: ${e.origin}${e.pathname}`);const t=await fetch(e,s);if(this.logging&&t.headers.has("x-event-id")){const n=t.headers.get("x-event-id");this.logging.xEventId!==n&&(this.logging.xEventId=n,this.logging.debug(`X-Event-ID updated: ${this.logging.xEventId}`))}return{headers:t.headers,ok:t.ok,status:t.status,statusText:t.statusText,url:t.url,json:async()=>await t.json(),text:async()=>await t.text()}}}exports.HttpClient=a;
2
- //# sourceMappingURL=HttpClient.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HttpClient.cjs","sources":["../../src/utils/HttpClient.ts"],"sourcesContent":["import { SDKHttpClient, type HttpClientResponse } from '../types';\n\nexport class HttpClient extends SDKHttpClient {\n\tasync request<T>(url: string | URL, options?: RequestInit): Promise<HttpClientResponse<T>> {\n\t\turl = new URL(url);\n\n\t\tthis.logging?.debug(`REQUEST [${options?.method || 'GET'}]: ${url.origin}${url.pathname}`);\n\n\t\tconst response = await fetch(url, options);\n\n\t\tif (this.logging && response.headers.has('x-event-id')) {\n\t\t\tconst xEventId = response.headers.get('x-event-id') as string;\n\n\t\t\tif (this.logging.xEventId !== xEventId) {\n\t\t\t\tthis.logging.xEventId = xEventId;\n\t\t\t\tthis.logging.debug(`X-Event-ID updated: ${this.logging.xEventId}`);\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\theaders: response.headers,\n\t\t\tok: response.ok,\n\t\t\tstatus: response.status,\n\t\t\tstatusText: response.statusText,\n\t\t\turl: response.url,\n\t\t\tjson: async () => (await response.json()) as T,\n\t\t\ttext: async () => await response.text(),\n\t\t\t// NOTE: Only json and text methods are supported in native platforms.\n\t\t};\n\t}\n}\n"],"names":["HttpClient","SDKHttpClient","url","options","response","xEventId"],"mappings":"gHAEO,MAAMA,UAAmBC,EAAAA,aAAc,CAC7C,MAAM,QAAWC,EAAmBC,EAAuD,CAC1FD,EAAM,IAAI,IAAIA,CAAG,EAEjB,KAAK,SAAS,MAAM,YAAYC,GAAS,QAAU,KAAK,MAAMD,EAAI,MAAM,GAAGA,EAAI,QAAQ,EAAE,EAEzF,MAAME,EAAW,MAAM,MAAMF,EAAKC,CAAO,EAEzC,GAAI,KAAK,SAAWC,EAAS,QAAQ,IAAI,YAAY,EAAG,CACvD,MAAMC,EAAWD,EAAS,QAAQ,IAAI,YAAY,EAE9C,KAAK,QAAQ,WAAaC,IAC7B,KAAK,QAAQ,SAAWA,EACxB,KAAK,QAAQ,MAAM,uBAAuB,KAAK,QAAQ,QAAQ,EAAE,EAEnE,CAEA,MAAO,CACN,QAASD,EAAS,QAClB,GAAIA,EAAS,GACb,OAAQA,EAAS,OACjB,WAAYA,EAAS,WACrB,IAAKA,EAAS,IACd,KAAM,SAAa,MAAMA,EAAS,KAAA,EAClC,KAAM,SAAY,MAAMA,EAAS,KAAA,CAAK,CAGxC,CACD"}
@@ -1,4 +0,0 @@
1
- import { SDKHttpClient, HttpClientResponse } from '../types';
2
- export declare class HttpClient extends SDKHttpClient {
3
- request<T>(url: string | URL, options?: RequestInit): Promise<HttpClientResponse<T>>;
4
- }
@@ -1,2 +0,0 @@
1
- import{SDKHttpClient as i}from"../types.mjs";class d extends i{async request(e,s){e=new URL(e),this.logging?.debug(`REQUEST [${s?.method||"GET"}]: ${e.origin}${e.pathname}`);const t=await fetch(e,s);if(this.logging&&t.headers.has("x-event-id")){const n=t.headers.get("x-event-id");this.logging.xEventId!==n&&(this.logging.xEventId=n,this.logging.debug(`X-Event-ID updated: ${this.logging.xEventId}`))}return{headers:t.headers,ok:t.ok,status:t.status,statusText:t.statusText,url:t.url,json:async()=>await t.json(),text:async()=>await t.text()}}}export{d as HttpClient};
2
- //# sourceMappingURL=HttpClient.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HttpClient.mjs","sources":["../../src/utils/HttpClient.ts"],"sourcesContent":["import { SDKHttpClient, type HttpClientResponse } from '../types';\n\nexport class HttpClient extends SDKHttpClient {\n\tasync request<T>(url: string | URL, options?: RequestInit): Promise<HttpClientResponse<T>> {\n\t\turl = new URL(url);\n\n\t\tthis.logging?.debug(`REQUEST [${options?.method || 'GET'}]: ${url.origin}${url.pathname}`);\n\n\t\tconst response = await fetch(url, options);\n\n\t\tif (this.logging && response.headers.has('x-event-id')) {\n\t\t\tconst xEventId = response.headers.get('x-event-id') as string;\n\n\t\t\tif (this.logging.xEventId !== xEventId) {\n\t\t\t\tthis.logging.xEventId = xEventId;\n\t\t\t\tthis.logging.debug(`X-Event-ID updated: ${this.logging.xEventId}`);\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\theaders: response.headers,\n\t\t\tok: response.ok,\n\t\t\tstatus: response.status,\n\t\t\tstatusText: response.statusText,\n\t\t\turl: response.url,\n\t\t\tjson: async () => (await response.json()) as T,\n\t\t\ttext: async () => await response.text(),\n\t\t\t// NOTE: Only json and text methods are supported in native platforms.\n\t\t};\n\t}\n}\n"],"names":["HttpClient","SDKHttpClient","url","options","response","xEventId"],"mappings":"6CAEO,MAAMA,UAAmBC,CAAc,CAC7C,MAAM,QAAWC,EAAmBC,EAAuD,CAC1FD,EAAM,IAAI,IAAIA,CAAG,EAEjB,KAAK,SAAS,MAAM,YAAYC,GAAS,QAAU,KAAK,MAAMD,EAAI,MAAM,GAAGA,EAAI,QAAQ,EAAE,EAEzF,MAAME,EAAW,MAAM,MAAMF,EAAKC,CAAO,EAEzC,GAAI,KAAK,SAAWC,EAAS,QAAQ,IAAI,YAAY,EAAG,CACvD,MAAMC,EAAWD,EAAS,QAAQ,IAAI,YAAY,EAE9C,KAAK,QAAQ,WAAaC,IAC7B,KAAK,QAAQ,SAAWA,EACxB,KAAK,QAAQ,MAAM,uBAAuB,KAAK,QAAQ,QAAQ,EAAE,EAEnE,CAEA,MAAO,CACN,QAASD,EAAS,QAClB,GAAIA,EAAS,GACb,OAAQA,EAAS,OACjB,WAAYA,EAAS,WACrB,IAAKA,EAAS,IACd,KAAM,SAAa,MAAMA,EAAS,KAAA,EAClC,KAAM,SAAY,MAAMA,EAAS,KAAA,CAAK,CAGxC,CACD"}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class e{xEventId;debug(t){const n=this.xEventId?`(${this.xEventId}) ${t}`:t;console.log(n)}info(t){const n=this.xEventId?`(${this.xEventId}) ${t}`:t;console.info(n)}warn(t){const n=this.xEventId?`(${this.xEventId}) ${t}`:t;console.warn(n)}error(t,n){const o=this.xEventId?`(${this.xEventId}) ${t}`:t;console.error(`${o} - ${n}`)}}exports.DefaultLogging=e;
2
- //# sourceMappingURL=Logging.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Logging.cjs","sources":["../../src/utils/Logging.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport type { SDKLogging } from '../types';\n\nexport class DefaultLogging implements SDKLogging {\n\txEventId: string | undefined;\n\n\tdebug(message: string): void {\n\t\tconst msg = this.xEventId ? `(${this.xEventId}) ${message}` : message;\n\t\tconsole.log(msg);\n\t}\n\n\tinfo(message: string): void {\n\t\tconst msg = this.xEventId ? `(${this.xEventId}) ${message}` : message;\n\t\tconsole.info(msg);\n\t}\n\n\twarn(message: string): void {\n\t\tconst msg = this.xEventId ? `(${this.xEventId}) ${message}` : message;\n\t\tconsole.warn(msg);\n\t}\n\n\terror(message: string, error: Error): void {\n\t\tconst msg = this.xEventId ? `(${this.xEventId}) ${message}` : message;\n\t\tconsole.error(`${msg} - ${error}`);\n\t}\n}\n"],"names":["DefaultLogging","message","msg","error"],"mappings":"gFAGO,MAAMA,CAAqC,CACjD,SAEA,MAAMC,EAAuB,CAC5B,MAAMC,EAAM,KAAK,SAAW,IAAI,KAAK,QAAQ,KAAKD,CAAO,GAAKA,EAC9D,QAAQ,IAAIC,CAAG,CAChB,CAEA,KAAKD,EAAuB,CAC3B,MAAMC,EAAM,KAAK,SAAW,IAAI,KAAK,QAAQ,KAAKD,CAAO,GAAKA,EAC9D,QAAQ,KAAKC,CAAG,CACjB,CAEA,KAAKD,EAAuB,CAC3B,MAAMC,EAAM,KAAK,SAAW,IAAI,KAAK,QAAQ,KAAKD,CAAO,GAAKA,EAC9D,QAAQ,KAAKC,CAAG,CACjB,CAEA,MAAMD,EAAiBE,EAAoB,CAC1C,MAAMD,EAAM,KAAK,SAAW,IAAI,KAAK,QAAQ,KAAKD,CAAO,GAAKA,EAC9D,QAAQ,MAAM,GAAGC,CAAG,MAAMC,CAAK,EAAE,CAClC,CACD"}
@@ -1,8 +0,0 @@
1
- import { SDKLogging } from '../types';
2
- export declare class DefaultLogging implements SDKLogging {
3
- xEventId: string | undefined;
4
- debug(message: string): void;
5
- info(message: string): void;
6
- warn(message: string): void;
7
- error(message: string, error: Error): void;
8
- }
@@ -1,2 +0,0 @@
1
- class i{xEventId;debug(t){const n=this.xEventId?`(${this.xEventId}) ${t}`:t;console.log(n)}info(t){const n=this.xEventId?`(${this.xEventId}) ${t}`:t;console.info(n)}warn(t){const n=this.xEventId?`(${this.xEventId}) ${t}`:t;console.warn(n)}error(t,n){const o=this.xEventId?`(${this.xEventId}) ${t}`:t;console.error(`${o} - ${n}`)}}export{i as DefaultLogging};
2
- //# sourceMappingURL=Logging.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Logging.mjs","sources":["../../src/utils/Logging.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport type { SDKLogging } from '../types';\n\nexport class DefaultLogging implements SDKLogging {\n\txEventId: string | undefined;\n\n\tdebug(message: string): void {\n\t\tconst msg = this.xEventId ? `(${this.xEventId}) ${message}` : message;\n\t\tconsole.log(msg);\n\t}\n\n\tinfo(message: string): void {\n\t\tconst msg = this.xEventId ? `(${this.xEventId}) ${message}` : message;\n\t\tconsole.info(msg);\n\t}\n\n\twarn(message: string): void {\n\t\tconst msg = this.xEventId ? `(${this.xEventId}) ${message}` : message;\n\t\tconsole.warn(msg);\n\t}\n\n\terror(message: string, error: Error): void {\n\t\tconst msg = this.xEventId ? `(${this.xEventId}) ${message}` : message;\n\t\tconsole.error(`${msg} - ${error}`);\n\t}\n}\n"],"names":["DefaultLogging","message","msg","error"],"mappings":"AAGO,MAAMA,CAAqC,CACjD,SAEA,MAAMC,EAAuB,CAC5B,MAAMC,EAAM,KAAK,SAAW,IAAI,KAAK,QAAQ,KAAKD,CAAO,GAAKA,EAC9D,QAAQ,IAAIC,CAAG,CAChB,CAEA,KAAKD,EAAuB,CAC3B,MAAMC,EAAM,KAAK,SAAW,IAAI,KAAK,QAAQ,KAAKD,CAAO,GAAKA,EAC9D,QAAQ,KAAKC,CAAG,CACjB,CAEA,KAAKD,EAAuB,CAC3B,MAAMC,EAAM,KAAK,SAAW,IAAI,KAAK,QAAQ,KAAKD,CAAO,GAAKA,EAC9D,QAAQ,KAAKC,CAAG,CACjB,CAEA,MAAMD,EAAiBE,EAAoB,CAC1C,MAAMD,EAAM,KAAK,SAAW,IAAI,KAAK,QAAQ,KAAKD,CAAO,GAAKA,EAC9D,QAAQ,MAAM,GAAGC,CAAG,MAAMC,CAAK,EAAE,CAClC,CACD"}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class a{constructor(t,e){this.sdk=t,this.metadataUrl=e}data=null;get issuer(){return this.getMetadataProperty("issuer")}get authorizationEndpoint(){return this.getMetadataProperty("authorization_endpoint")}get tokenEndpoint(){return this.getMetadataProperty("token_endpoint")}get userinfoEndpoint(){return this.getMetadataProperty("userinfo_endpoint")}get endSessionEndpoint(){return this.getMetadataProperty("end_session_endpoint")}get revocationEndpoint(){return this.getMetadataProperty("revocation_endpoint")}get jwksUri(){return this.getMetadataProperty("jwks_uri")}async fetchMetadata(){try{const t=await this.sdk.httpClient.request(this.metadataUrl,{method:"GET"});this.data=await t.json()}catch(t){throw this.sdk.logging?.error("Failed to fetch metadata",t),t}}async getMetadataProperty(t){return this.data?.[t]?Promise.resolve(this.data[t]):(await this.fetchMetadata(),Promise.resolve(this.data[t]))}}exports.Metadata=a;
2
- //# sourceMappingURL=Metadata.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Metadata.cjs","sources":["../../src/utils/Metadata.ts"],"sourcesContent":["import type { BaseFlow } from '../flows/BaseFlow';\nimport type { MetadataOptions } from '../types';\n\n/**\n * Class responsible for fetching and handling metadata for authentication endpoints.\n */\nexport class Metadata {\n\t/**\n\t * Holds the metadata options once fetched, or null if not yet fetched.\n\t * @protected\n\t */\n\tprotected data: MetadataOptions | null = null;\n\n\t/**\n\t * Retrieves the issuer metadata.\n\t *\n\t * @returns {Promise<string>} A promise that resolves to the issuer string.\n\t */\n\tget issuer(): Promise<string> {\n\t\treturn this.getMetadataProperty('issuer');\n\t}\n\n\t/**\n\t * Retrieves the authorization endpoint metadata.\n\t *\n\t * @returns {Promise<string>} A promise that resolves to the authorization endpoint URL.\n\t */\n\tget authorizationEndpoint(): Promise<string> {\n\t\treturn this.getMetadataProperty('authorization_endpoint');\n\t}\n\n\t/**\n\t * Retrieves the token endpoint metadata.\n\t *\n\t * @returns {Promise<string>} A promise that resolves to the token endpoint URL.\n\t */\n\tget tokenEndpoint(): Promise<string> {\n\t\treturn this.getMetadataProperty('token_endpoint');\n\t}\n\n\t/**\n\t * Retrieves the user info endpoint metadata.\n\t *\n\t * @returns {Promise<string>} A promise that resolves to the user info endpoint URL.\n\t */\n\tget userinfoEndpoint(): Promise<string> {\n\t\treturn this.getMetadataProperty('userinfo_endpoint');\n\t}\n\n\t/**\n\t * Retrieves the end session endpoint metadata.\n\t *\n\t * @returns {Promise<string>} A promise that resolves to the end session endpoint URL.\n\t */\n\tget endSessionEndpoint(): Promise<string> {\n\t\treturn this.getMetadataProperty('end_session_endpoint');\n\t}\n\n\t/**\n\t * Retrieves the revocation endpoint metadata.\n\t *\n\t * @returns {Promise<string>} A promise that resolves to the revocation endpoint URL.\n\t */\n\tget revocationEndpoint(): Promise<string> {\n\t\treturn this.getMetadataProperty('revocation_endpoint');\n\t}\n\n\t/**\n\t * Retrieves the JWKS URI metadata.\n\t *\n\t * @returns {Promise<string>} A promise that resolves to the JWKS URI.\n\t */\n\tget jwksUri(): Promise<string> {\n\t\treturn this.getMetadataProperty('jwks_uri');\n\t}\n\n\t/**\n\t * Creates an instance of the Metadata class.\n\t *\n\t * @param {string} metadataUrl The URL to fetch metadata from.\n\t */\n\tconstructor(\n\t\t/**\n\t\t * The SDK instance.\n\t\t *\n\t\t * @type {SDKStorage}\n\t\t */\n\t\tprotected sdk: BaseFlow,\n\n\t\t/**\n\t\t * The URL to fetch metadata from.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tprotected metadataUrl: string,\n\t) {}\n\n\t/**\n\t * Fetches and updates the metadata from the specified URL.\n\t *\n\t * @returns {Promise<void>} A promise that resolves once the metadata is fetched.\n\t */\n\tasync fetchMetadata(): Promise<void> {\n\t\ttry {\n\t\t\tconst response = await this.sdk.httpClient.request<MetadataOptions>(this.metadataUrl, { method: 'GET' });\n\t\t\tthis.data = await response.json();\n\t\t} catch (error) {\n\t\t\tthis.sdk.logging?.error('Failed to fetch metadata', error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves a specific metadata property.\n\t *\n\t * @template K The key of the metadata property.\n\t * @param {K} key The metadata property key to retrieve.\n\t * @returns {Promise<MetadataOptions[K]>} A promise that resolves to the value of the specified metadata property.\n\t */\n\tasync getMetadataProperty<K extends keyof MetadataOptions>(key: K): Promise<MetadataOptions[K]> {\n\t\tif (this.data?.[key]) {\n\t\t\treturn Promise.resolve(this.data[key]);\n\t\t}\n\n\t\tawait this.fetchMetadata();\n\n\t\treturn Promise.resolve((this.data as MetadataOptions)[key]);\n\t}\n}\n"],"names":["Metadata","sdk","metadataUrl","response","error","key"],"mappings":"gFAMO,MAAMA,CAAS,CA2ErB,YAMWC,EAOAC,EACT,CARS,KAAA,IAAAD,EAOA,KAAA,YAAAC,CACR,CApFO,KAA+B,KAOzC,IAAI,QAA0B,CAC7B,OAAO,KAAK,oBAAoB,QAAQ,CACzC,CAOA,IAAI,uBAAyC,CAC5C,OAAO,KAAK,oBAAoB,wBAAwB,CACzD,CAOA,IAAI,eAAiC,CACpC,OAAO,KAAK,oBAAoB,gBAAgB,CACjD,CAOA,IAAI,kBAAoC,CACvC,OAAO,KAAK,oBAAoB,mBAAmB,CACpD,CAOA,IAAI,oBAAsC,CACzC,OAAO,KAAK,oBAAoB,sBAAsB,CACvD,CAOA,IAAI,oBAAsC,CACzC,OAAO,KAAK,oBAAoB,qBAAqB,CACtD,CAOA,IAAI,SAA2B,CAC9B,OAAO,KAAK,oBAAoB,UAAU,CAC3C,CA4BA,MAAM,eAA+B,CACpC,GAAI,CACH,MAAMC,EAAW,MAAM,KAAK,IAAI,WAAW,QAAyB,KAAK,YAAa,CAAE,OAAQ,KAAA,CAAO,EACvG,KAAK,KAAO,MAAMA,EAAS,KAAA,CAC5B,OAASC,EAAO,CACf,WAAK,IAAI,SAAS,MAAM,2BAA4BA,CAAK,EACnDA,CACP,CACD,CASA,MAAM,oBAAqDC,EAAqC,CAC/F,OAAI,KAAK,OAAOA,CAAG,EACX,QAAQ,QAAQ,KAAK,KAAKA,CAAG,CAAC,GAGtC,MAAM,KAAK,cAAA,EAEJ,QAAQ,QAAS,KAAK,KAAyBA,CAAG,CAAC,EAC3D,CACD"}
@@ -1,98 +0,0 @@
1
- import { BaseFlow } from '../flows/BaseFlow';
2
- import { MetadataOptions } from '../types';
3
- /**
4
- * Class responsible for fetching and handling metadata for authentication endpoints.
5
- */
6
- export declare class Metadata {
7
- /**
8
- * The SDK instance.
9
- *
10
- * @type {SDKStorage}
11
- */
12
- protected sdk: BaseFlow;
13
- /**
14
- * The URL to fetch metadata from.
15
- *
16
- * @type {string}
17
- */
18
- protected metadataUrl: string;
19
- /**
20
- * Holds the metadata options once fetched, or null if not yet fetched.
21
- * @protected
22
- */
23
- protected data: MetadataOptions | null;
24
- /**
25
- * Retrieves the issuer metadata.
26
- *
27
- * @returns {Promise<string>} A promise that resolves to the issuer string.
28
- */
29
- get issuer(): Promise<string>;
30
- /**
31
- * Retrieves the authorization endpoint metadata.
32
- *
33
- * @returns {Promise<string>} A promise that resolves to the authorization endpoint URL.
34
- */
35
- get authorizationEndpoint(): Promise<string>;
36
- /**
37
- * Retrieves the token endpoint metadata.
38
- *
39
- * @returns {Promise<string>} A promise that resolves to the token endpoint URL.
40
- */
41
- get tokenEndpoint(): Promise<string>;
42
- /**
43
- * Retrieves the user info endpoint metadata.
44
- *
45
- * @returns {Promise<string>} A promise that resolves to the user info endpoint URL.
46
- */
47
- get userinfoEndpoint(): Promise<string>;
48
- /**
49
- * Retrieves the end session endpoint metadata.
50
- *
51
- * @returns {Promise<string>} A promise that resolves to the end session endpoint URL.
52
- */
53
- get endSessionEndpoint(): Promise<string>;
54
- /**
55
- * Retrieves the revocation endpoint metadata.
56
- *
57
- * @returns {Promise<string>} A promise that resolves to the revocation endpoint URL.
58
- */
59
- get revocationEndpoint(): Promise<string>;
60
- /**
61
- * Retrieves the JWKS URI metadata.
62
- *
63
- * @returns {Promise<string>} A promise that resolves to the JWKS URI.
64
- */
65
- get jwksUri(): Promise<string>;
66
- /**
67
- * Creates an instance of the Metadata class.
68
- *
69
- * @param {string} metadataUrl The URL to fetch metadata from.
70
- */
71
- constructor(
72
- /**
73
- * The SDK instance.
74
- *
75
- * @type {SDKStorage}
76
- */
77
- sdk: BaseFlow,
78
- /**
79
- * The URL to fetch metadata from.
80
- *
81
- * @type {string}
82
- */
83
- metadataUrl: string);
84
- /**
85
- * Fetches and updates the metadata from the specified URL.
86
- *
87
- * @returns {Promise<void>} A promise that resolves once the metadata is fetched.
88
- */
89
- fetchMetadata(): Promise<void>;
90
- /**
91
- * Retrieves a specific metadata property.
92
- *
93
- * @template K The key of the metadata property.
94
- * @param {K} key The metadata property key to retrieve.
95
- * @returns {Promise<MetadataOptions[K]>} A promise that resolves to the value of the specified metadata property.
96
- */
97
- getMetadataProperty<K extends keyof MetadataOptions>(key: K): Promise<MetadataOptions[K]>;
98
- }
@@ -1,2 +0,0 @@
1
- class r{constructor(t,e){this.sdk=t,this.metadataUrl=e}data=null;get issuer(){return this.getMetadataProperty("issuer")}get authorizationEndpoint(){return this.getMetadataProperty("authorization_endpoint")}get tokenEndpoint(){return this.getMetadataProperty("token_endpoint")}get userinfoEndpoint(){return this.getMetadataProperty("userinfo_endpoint")}get endSessionEndpoint(){return this.getMetadataProperty("end_session_endpoint")}get revocationEndpoint(){return this.getMetadataProperty("revocation_endpoint")}get jwksUri(){return this.getMetadataProperty("jwks_uri")}async fetchMetadata(){try{const t=await this.sdk.httpClient.request(this.metadataUrl,{method:"GET"});this.data=await t.json()}catch(t){throw this.sdk.logging?.error("Failed to fetch metadata",t),t}}async getMetadataProperty(t){return this.data?.[t]?Promise.resolve(this.data[t]):(await this.fetchMetadata(),Promise.resolve(this.data[t]))}}export{r as Metadata};
2
- //# sourceMappingURL=Metadata.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Metadata.mjs","sources":["../../src/utils/Metadata.ts"],"sourcesContent":["import type { BaseFlow } from '../flows/BaseFlow';\nimport type { MetadataOptions } from '../types';\n\n/**\n * Class responsible for fetching and handling metadata for authentication endpoints.\n */\nexport class Metadata {\n\t/**\n\t * Holds the metadata options once fetched, or null if not yet fetched.\n\t * @protected\n\t */\n\tprotected data: MetadataOptions | null = null;\n\n\t/**\n\t * Retrieves the issuer metadata.\n\t *\n\t * @returns {Promise<string>} A promise that resolves to the issuer string.\n\t */\n\tget issuer(): Promise<string> {\n\t\treturn this.getMetadataProperty('issuer');\n\t}\n\n\t/**\n\t * Retrieves the authorization endpoint metadata.\n\t *\n\t * @returns {Promise<string>} A promise that resolves to the authorization endpoint URL.\n\t */\n\tget authorizationEndpoint(): Promise<string> {\n\t\treturn this.getMetadataProperty('authorization_endpoint');\n\t}\n\n\t/**\n\t * Retrieves the token endpoint metadata.\n\t *\n\t * @returns {Promise<string>} A promise that resolves to the token endpoint URL.\n\t */\n\tget tokenEndpoint(): Promise<string> {\n\t\treturn this.getMetadataProperty('token_endpoint');\n\t}\n\n\t/**\n\t * Retrieves the user info endpoint metadata.\n\t *\n\t * @returns {Promise<string>} A promise that resolves to the user info endpoint URL.\n\t */\n\tget userinfoEndpoint(): Promise<string> {\n\t\treturn this.getMetadataProperty('userinfo_endpoint');\n\t}\n\n\t/**\n\t * Retrieves the end session endpoint metadata.\n\t *\n\t * @returns {Promise<string>} A promise that resolves to the end session endpoint URL.\n\t */\n\tget endSessionEndpoint(): Promise<string> {\n\t\treturn this.getMetadataProperty('end_session_endpoint');\n\t}\n\n\t/**\n\t * Retrieves the revocation endpoint metadata.\n\t *\n\t * @returns {Promise<string>} A promise that resolves to the revocation endpoint URL.\n\t */\n\tget revocationEndpoint(): Promise<string> {\n\t\treturn this.getMetadataProperty('revocation_endpoint');\n\t}\n\n\t/**\n\t * Retrieves the JWKS URI metadata.\n\t *\n\t * @returns {Promise<string>} A promise that resolves to the JWKS URI.\n\t */\n\tget jwksUri(): Promise<string> {\n\t\treturn this.getMetadataProperty('jwks_uri');\n\t}\n\n\t/**\n\t * Creates an instance of the Metadata class.\n\t *\n\t * @param {string} metadataUrl The URL to fetch metadata from.\n\t */\n\tconstructor(\n\t\t/**\n\t\t * The SDK instance.\n\t\t *\n\t\t * @type {SDKStorage}\n\t\t */\n\t\tprotected sdk: BaseFlow,\n\n\t\t/**\n\t\t * The URL to fetch metadata from.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tprotected metadataUrl: string,\n\t) {}\n\n\t/**\n\t * Fetches and updates the metadata from the specified URL.\n\t *\n\t * @returns {Promise<void>} A promise that resolves once the metadata is fetched.\n\t */\n\tasync fetchMetadata(): Promise<void> {\n\t\ttry {\n\t\t\tconst response = await this.sdk.httpClient.request<MetadataOptions>(this.metadataUrl, { method: 'GET' });\n\t\t\tthis.data = await response.json();\n\t\t} catch (error) {\n\t\t\tthis.sdk.logging?.error('Failed to fetch metadata', error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves a specific metadata property.\n\t *\n\t * @template K The key of the metadata property.\n\t * @param {K} key The metadata property key to retrieve.\n\t * @returns {Promise<MetadataOptions[K]>} A promise that resolves to the value of the specified metadata property.\n\t */\n\tasync getMetadataProperty<K extends keyof MetadataOptions>(key: K): Promise<MetadataOptions[K]> {\n\t\tif (this.data?.[key]) {\n\t\t\treturn Promise.resolve(this.data[key]);\n\t\t}\n\n\t\tawait this.fetchMetadata();\n\n\t\treturn Promise.resolve((this.data as MetadataOptions)[key]);\n\t}\n}\n"],"names":["Metadata","sdk","metadataUrl","response","error","key"],"mappings":"AAMO,MAAMA,CAAS,CA2ErB,YAMWC,EAOAC,EACT,CARS,KAAA,IAAAD,EAOA,KAAA,YAAAC,CACR,CApFO,KAA+B,KAOzC,IAAI,QAA0B,CAC7B,OAAO,KAAK,oBAAoB,QAAQ,CACzC,CAOA,IAAI,uBAAyC,CAC5C,OAAO,KAAK,oBAAoB,wBAAwB,CACzD,CAOA,IAAI,eAAiC,CACpC,OAAO,KAAK,oBAAoB,gBAAgB,CACjD,CAOA,IAAI,kBAAoC,CACvC,OAAO,KAAK,oBAAoB,mBAAmB,CACpD,CAOA,IAAI,oBAAsC,CACzC,OAAO,KAAK,oBAAoB,sBAAsB,CACvD,CAOA,IAAI,oBAAsC,CACzC,OAAO,KAAK,oBAAoB,qBAAqB,CACtD,CAOA,IAAI,SAA2B,CAC9B,OAAO,KAAK,oBAAoB,UAAU,CAC3C,CA4BA,MAAM,eAA+B,CACpC,GAAI,CACH,MAAMC,EAAW,MAAM,KAAK,IAAI,WAAW,QAAyB,KAAK,YAAa,CAAE,OAAQ,KAAA,CAAO,EACvG,KAAK,KAAO,MAAMA,EAAS,KAAA,CAC5B,OAASC,EAAO,CACf,WAAK,IAAI,SAAS,MAAM,2BAA4BA,CAAK,EACnDA,CACP,CACD,CASA,MAAM,oBAAqDC,EAAqC,CAC/F,OAAI,KAAK,OAAOA,CAAG,EACX,QAAQ,QAAQ,KAAK,KAAKA,CAAG,CAAC,GAGtC,MAAM,KAAK,cAAA,EAEJ,QAAQ,QAAS,KAAK,KAAyBA,CAAG,CAAC,EAC3D,CACD"}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./date.cjs");class r{state=null;code=null;error=null;error_description=null;id_token=null;access_token=null;refresh_token=null;token_type="bearer";scope=null;expires_at=null;claims=null;get expires_in(){return this.expires_at?this.expires_at-l.timestamp():0}set expires_in(e){e!==null&&!isNaN(e)&&(this.expires_at=Math.floor(e)+l.timestamp())}static load(e){if(!e)return null;let t=new r;try{Object.assign(t,JSON.parse(e))}catch{t=null}return t}}exports.Session=r;
2
- //# sourceMappingURL=Session.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Session.cjs","sources":["../../src/utils/Session.ts"],"sourcesContent":["import type { IdTokenClaims } from '../types';\nimport { timestamp } from './date';\n\n/**\n * Class representing a user's authentication session, storing tokens and related information.\n */\nexport class Session {\n\t/**\n\t * The state parameter used in the authentication request.\n\t * @type {string | null}\n\t */\n\tstate: string | null = null;\n\n\t/**\n\t * The authorization code returned by the authorization server.\n\t * @type {string | null}\n\t */\n\tcode: string | null = null;\n\n\t/**\n\t * The error returned during the authentication process, if any.\n\t * @type {string | null}\n\t */\n\terror: string | null = null;\n\n\t/**\n\t * A description of the error returned during authentication.\n\t * @type {string | null}\n\t */\n\terror_description: string | null = null;\n\n\t/**\n\t * The ID token issued by the authorization server.\n\t * @type {string | null}\n\t */\n\tid_token: string | null = null;\n\n\t/**\n\t * The access token issued by the authorization server.\n\t * @type {string | null}\n\t */\n\taccess_token: string | null = null;\n\n\t/**\n\t * The refresh token issued by the authorization server.\n\t * @type {string | null}\n\t */\n\trefresh_token: string | null = null;\n\n\t/**\n\t * The type of token issued, defaulting to 'bearer'.\n\t * @type {string}\n\t */\n\ttoken_type = 'bearer';\n\n\t/**\n\t * The scope of the issued token.\n\t * @type {string | null}\n\t */\n\tscope: string | null = null;\n\n\t/**\n\t * The expiration timestamp of the access token, represented in seconds since the epoch.\n\t * @type {number | null}\n\t */\n\texpires_at: number | null = null;\n\n\t/**\n\t * The claims associated with the ID token.\n\t * @type {IdTokenClaims | null}\n\t */\n\tclaims: IdTokenClaims | null = null;\n\n\t/**\n\t * Returns the number of seconds until the access token expires.\n\t * If `expires_at` is not set, returns 0.\n\t *\n\t * @returns {number} The number of seconds until the token expires.\n\t */\n\tget expires_in(): number {\n\t\tif (!this.expires_at) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn this.expires_at - timestamp();\n\t}\n\n\t/**\n\t * Sets the expiration time based on a duration in seconds.\n\t * This also updates the `expires_at` timestamp.\n\t *\n\t * @param {number | null} value The number of seconds until the token expires.\n\t */\n\tset expires_in(value: number | null) {\n\t\tif (value !== null && !isNaN(value)) {\n\t\t\tthis.expires_at = Math.floor(value) + timestamp();\n\t\t}\n\t}\n\n\t/**\n\t * Loads a serialized session from a JSON string.\n\t *\n\t * @param {string | null} serializedSession The JSON string representing a session.\n\t * @returns {Session | null} A new session instance populated with the data from the string, or null if parsing fails.\n\t */\n\tstatic load(serializedSession: string | null): Session | null {\n\t\tif (!serializedSession) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet session: Session | null = new Session();\n\n\t\ttry {\n\t\t\tObject.assign(session, JSON.parse(serializedSession));\n\t\t} catch {\n\t\t\tsession = null;\n\t\t}\n\n\t\treturn session;\n\t}\n}\n"],"names":["Session","timestamp","value","serializedSession","session"],"mappings":"8GAMO,MAAMA,CAAQ,CAKpB,MAAuB,KAMvB,KAAsB,KAMtB,MAAuB,KAMvB,kBAAmC,KAMnC,SAA0B,KAM1B,aAA8B,KAM9B,cAA+B,KAM/B,WAAa,SAMb,MAAuB,KAMvB,WAA4B,KAM5B,OAA+B,KAQ/B,IAAI,YAAqB,CACxB,OAAK,KAAK,WAIH,KAAK,WAAaC,YAAA,EAHjB,CAIT,CAQA,IAAI,WAAWC,EAAsB,CAChCA,IAAU,MAAQ,CAAC,MAAMA,CAAK,IACjC,KAAK,WAAa,KAAK,MAAMA,CAAK,EAAID,EAAAA,UAAA,EAExC,CAQA,OAAO,KAAKE,EAAkD,CAC7D,GAAI,CAACA,EACJ,OAAO,KAGR,IAAIC,EAA0B,IAAIJ,EAElC,GAAI,CACH,OAAO,OAAOI,EAAS,KAAK,MAAMD,CAAiB,CAAC,CACrD,MAAQ,CACPC,EAAU,IACX,CAEA,OAAOA,CACR,CACD"}
@@ -1,82 +0,0 @@
1
- import { IdTokenClaims } from '../types';
2
- /**
3
- * Class representing a user's authentication session, storing tokens and related information.
4
- */
5
- export declare class Session {
6
- /**
7
- * The state parameter used in the authentication request.
8
- * @type {string | null}
9
- */
10
- state: string | null;
11
- /**
12
- * The authorization code returned by the authorization server.
13
- * @type {string | null}
14
- */
15
- code: string | null;
16
- /**
17
- * The error returned during the authentication process, if any.
18
- * @type {string | null}
19
- */
20
- error: string | null;
21
- /**
22
- * A description of the error returned during authentication.
23
- * @type {string | null}
24
- */
25
- error_description: string | null;
26
- /**
27
- * The ID token issued by the authorization server.
28
- * @type {string | null}
29
- */
30
- id_token: string | null;
31
- /**
32
- * The access token issued by the authorization server.
33
- * @type {string | null}
34
- */
35
- access_token: string | null;
36
- /**
37
- * The refresh token issued by the authorization server.
38
- * @type {string | null}
39
- */
40
- refresh_token: string | null;
41
- /**
42
- * The type of token issued, defaulting to 'bearer'.
43
- * @type {string}
44
- */
45
- token_type: string;
46
- /**
47
- * The scope of the issued token.
48
- * @type {string | null}
49
- */
50
- scope: string | null;
51
- /**
52
- * The expiration timestamp of the access token, represented in seconds since the epoch.
53
- * @type {number | null}
54
- */
55
- expires_at: number | null;
56
- /**
57
- * The claims associated with the ID token.
58
- * @type {IdTokenClaims | null}
59
- */
60
- claims: IdTokenClaims | null;
61
- /**
62
- * Returns the number of seconds until the access token expires.
63
- * If `expires_at` is not set, returns 0.
64
- *
65
- * @returns {number} The number of seconds until the token expires.
66
- */
67
- get expires_in(): number;
68
- /**
69
- * Sets the expiration time based on a duration in seconds.
70
- * This also updates the `expires_at` timestamp.
71
- *
72
- * @param {number | null} value The number of seconds until the token expires.
73
- */
74
- set expires_in(value: number | null);
75
- /**
76
- * Loads a serialized session from a JSON string.
77
- *
78
- * @param {string | null} serializedSession The JSON string representing a session.
79
- * @returns {Session | null} A new session instance populated with the data from the string, or null if parsing fails.
80
- */
81
- static load(serializedSession: string | null): Session | null;
82
- }
@@ -1,2 +0,0 @@
1
- import{timestamp as r}from"./date.mjs";class l{state=null;code=null;error=null;error_description=null;id_token=null;access_token=null;refresh_token=null;token_type="bearer";scope=null;expires_at=null;claims=null;get expires_in(){return this.expires_at?this.expires_at-r():0}set expires_in(e){e!==null&&!isNaN(e)&&(this.expires_at=Math.floor(e)+r())}static load(e){if(!e)return null;let t=new l;try{Object.assign(t,JSON.parse(e))}catch{t=null}return t}}export{l as Session};
2
- //# sourceMappingURL=Session.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Session.mjs","sources":["../../src/utils/Session.ts"],"sourcesContent":["import type { IdTokenClaims } from '../types';\nimport { timestamp } from './date';\n\n/**\n * Class representing a user's authentication session, storing tokens and related information.\n */\nexport class Session {\n\t/**\n\t * The state parameter used in the authentication request.\n\t * @type {string | null}\n\t */\n\tstate: string | null = null;\n\n\t/**\n\t * The authorization code returned by the authorization server.\n\t * @type {string | null}\n\t */\n\tcode: string | null = null;\n\n\t/**\n\t * The error returned during the authentication process, if any.\n\t * @type {string | null}\n\t */\n\terror: string | null = null;\n\n\t/**\n\t * A description of the error returned during authentication.\n\t * @type {string | null}\n\t */\n\terror_description: string | null = null;\n\n\t/**\n\t * The ID token issued by the authorization server.\n\t * @type {string | null}\n\t */\n\tid_token: string | null = null;\n\n\t/**\n\t * The access token issued by the authorization server.\n\t * @type {string | null}\n\t */\n\taccess_token: string | null = null;\n\n\t/**\n\t * The refresh token issued by the authorization server.\n\t * @type {string | null}\n\t */\n\trefresh_token: string | null = null;\n\n\t/**\n\t * The type of token issued, defaulting to 'bearer'.\n\t * @type {string}\n\t */\n\ttoken_type = 'bearer';\n\n\t/**\n\t * The scope of the issued token.\n\t * @type {string | null}\n\t */\n\tscope: string | null = null;\n\n\t/**\n\t * The expiration timestamp of the access token, represented in seconds since the epoch.\n\t * @type {number | null}\n\t */\n\texpires_at: number | null = null;\n\n\t/**\n\t * The claims associated with the ID token.\n\t * @type {IdTokenClaims | null}\n\t */\n\tclaims: IdTokenClaims | null = null;\n\n\t/**\n\t * Returns the number of seconds until the access token expires.\n\t * If `expires_at` is not set, returns 0.\n\t *\n\t * @returns {number} The number of seconds until the token expires.\n\t */\n\tget expires_in(): number {\n\t\tif (!this.expires_at) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn this.expires_at - timestamp();\n\t}\n\n\t/**\n\t * Sets the expiration time based on a duration in seconds.\n\t * This also updates the `expires_at` timestamp.\n\t *\n\t * @param {number | null} value The number of seconds until the token expires.\n\t */\n\tset expires_in(value: number | null) {\n\t\tif (value !== null && !isNaN(value)) {\n\t\t\tthis.expires_at = Math.floor(value) + timestamp();\n\t\t}\n\t}\n\n\t/**\n\t * Loads a serialized session from a JSON string.\n\t *\n\t * @param {string | null} serializedSession The JSON string representing a session.\n\t * @returns {Session | null} A new session instance populated with the data from the string, or null if parsing fails.\n\t */\n\tstatic load(serializedSession: string | null): Session | null {\n\t\tif (!serializedSession) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet session: Session | null = new Session();\n\n\t\ttry {\n\t\t\tObject.assign(session, JSON.parse(serializedSession));\n\t\t} catch {\n\t\t\tsession = null;\n\t\t}\n\n\t\treturn session;\n\t}\n}\n"],"names":["Session","timestamp","value","serializedSession","session"],"mappings":"uCAMO,MAAMA,CAAQ,CAKpB,MAAuB,KAMvB,KAAsB,KAMtB,MAAuB,KAMvB,kBAAmC,KAMnC,SAA0B,KAM1B,aAA8B,KAM9B,cAA+B,KAM/B,WAAa,SAMb,MAAuB,KAMvB,WAA4B,KAM5B,OAA+B,KAQ/B,IAAI,YAAqB,CACxB,OAAK,KAAK,WAIH,KAAK,WAAaC,EAAA,EAHjB,CAIT,CAQA,IAAI,WAAWC,EAAsB,CAChCA,IAAU,MAAQ,CAAC,MAAMA,CAAK,IACjC,KAAK,WAAa,KAAK,MAAMA,CAAK,EAAID,EAAA,EAExC,CAQA,OAAO,KAAKE,EAAkD,CAC7D,GAAI,CAACA,EACJ,OAAO,KAGR,IAAIC,EAA0B,IAAIJ,EAElC,GAAI,CACH,OAAO,OAAOI,EAAS,KAAK,MAAMD,CAAiB,CAAC,CACrD,MAAQ,CACPC,EAAU,IACX,CAEA,OAAOA,CACR,CACD"}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./crypto.cjs"),c=require("./date.cjs");require("./base64Url.cjs");class a{id;createdAt;codeVerifier;codeChallenge;nonce;static async create(){const e=new a;return e.id=n.Crypto.generateState(),e.createdAt=c.timestamp(),e.codeVerifier=n.Crypto.generateCodeVerifier(),e.codeChallenge=await n.Crypto.generateCodeChallenge(e.codeVerifier),e.nonce=n.Crypto.generateNonce(),e}static fromSerializedData(e){const t=new a,r=JSON.parse(e);return t.id=r.id,t.createdAt=r.createdAt,t.codeVerifier=r.codeVerifier,t.codeChallenge=r.codeChallenge,t.nonce=r.nonce,t}}exports.State=a;
2
- //# sourceMappingURL=State.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"State.cjs","sources":["../../src/utils/State.ts"],"sourcesContent":["import { Crypto } from './crypto';\nimport { timestamp } from './date';\n\n/**\n * Class representing an OAuth state, including code verifier and nonce for PKCE flows.\n */\nexport class State {\n\t/**\n\t * The unique identifier for the state.\n\t * @type {string}\n\t */\n\tid!: string;\n\n\t/**\n\t * The timestamp when the state was created, represented in seconds since the epoch.\n\t * @type {number}\n\t */\n\tcreatedAt!: number;\n\n\t/**\n\t * The code verifier used in the PKCE (Proof Key for Code Exchange) flow.\n\t * @type {string}\n\t */\n\tcodeVerifier!: string;\n\n\t/**\n\t * The code challenge derived from the code verifier for the PKCE flow.\n\t * @type {string}\n\t */\n\tcodeChallenge!: string;\n\n\t/**\n\t * The nonce value used to associate a client session with an ID token for replay protection.\n\t * @type {string}\n\t */\n\tnonce!: string;\n\n\t/**\n\t * Creates a new instance of `State` with generated values for PKCE and nonce.\n\t *\n\t * @returns {Promise<State>} A promise that resolves to a new `State` instance.\n\t */\n\tstatic async create(): Promise<State> {\n\t\tconst instance = new State();\n\n\t\tinstance.id = Crypto.generateState();\n\t\tinstance.createdAt = timestamp();\n\t\tinstance.codeVerifier = Crypto.generateCodeVerifier();\n\t\tinstance.codeChallenge = await Crypto.generateCodeChallenge(instance.codeVerifier);\n\t\tinstance.nonce = Crypto.generateNonce();\n\n\t\treturn instance;\n\t}\n\n\t/**\n\t * Deserializes a `State` instance from a JSON string.\n\t *\n\t * @param {string} serializedData The serialized state data as a JSON string.\n\t * @returns {State} A new `State` instance populated with the deserialized data.\n\t */\n\tstatic fromSerializedData(serializedData: string): State {\n\t\tconst instance = new State();\n\t\tconst data = JSON.parse(serializedData);\n\n\t\tinstance.id = data.id;\n\t\tinstance.createdAt = data.createdAt;\n\t\tinstance.codeVerifier = data.codeVerifier;\n\t\tinstance.codeChallenge = data.codeChallenge;\n\t\tinstance.nonce = data.nonce;\n\n\t\treturn instance;\n\t}\n}\n"],"names":["State","instance","Crypto","timestamp","serializedData","data"],"mappings":"mKAMO,MAAMA,CAAM,CAKlB,GAMA,UAMA,aAMA,cAMA,MAOA,aAAa,QAAyB,CACrC,MAAMC,EAAW,IAAID,EAErB,OAAAC,EAAS,GAAKC,EAAAA,OAAO,cAAA,EACrBD,EAAS,UAAYE,YAAA,EACrBF,EAAS,aAAeC,EAAAA,OAAO,qBAAA,EAC/BD,EAAS,cAAgB,MAAMC,EAAAA,OAAO,sBAAsBD,EAAS,YAAY,EACjFA,EAAS,MAAQC,EAAAA,OAAO,cAAA,EAEjBD,CACR,CAQA,OAAO,mBAAmBG,EAA+B,CACxD,MAAMH,EAAW,IAAID,EACfK,EAAO,KAAK,MAAMD,CAAc,EAEtC,OAAAH,EAAS,GAAKI,EAAK,GACnBJ,EAAS,UAAYI,EAAK,UAC1BJ,EAAS,aAAeI,EAAK,aAC7BJ,EAAS,cAAgBI,EAAK,cAC9BJ,EAAS,MAAQI,EAAK,MAEfJ,CACR,CACD"}
@@ -1,43 +0,0 @@
1
- /**
2
- * Class representing an OAuth state, including code verifier and nonce for PKCE flows.
3
- */
4
- export declare class State {
5
- /**
6
- * The unique identifier for the state.
7
- * @type {string}
8
- */
9
- id: string;
10
- /**
11
- * The timestamp when the state was created, represented in seconds since the epoch.
12
- * @type {number}
13
- */
14
- createdAt: number;
15
- /**
16
- * The code verifier used in the PKCE (Proof Key for Code Exchange) flow.
17
- * @type {string}
18
- */
19
- codeVerifier: string;
20
- /**
21
- * The code challenge derived from the code verifier for the PKCE flow.
22
- * @type {string}
23
- */
24
- codeChallenge: string;
25
- /**
26
- * The nonce value used to associate a client session with an ID token for replay protection.
27
- * @type {string}
28
- */
29
- nonce: string;
30
- /**
31
- * Creates a new instance of `State` with generated values for PKCE and nonce.
32
- *
33
- * @returns {Promise<State>} A promise that resolves to a new `State` instance.
34
- */
35
- static create(): Promise<State>;
36
- /**
37
- * Deserializes a `State` instance from a JSON string.
38
- *
39
- * @param {string} serializedData The serialized state data as a JSON string.
40
- * @returns {State} A new `State` instance populated with the deserialized data.
41
- */
42
- static fromSerializedData(serializedData: string): State;
43
- }
@@ -1,2 +0,0 @@
1
- import{Crypto as n}from"./crypto.mjs";import{timestamp as c}from"./date.mjs";import"./base64Url.mjs";class a{id;createdAt;codeVerifier;codeChallenge;nonce;static async create(){const e=new a;return e.id=n.generateState(),e.createdAt=c(),e.codeVerifier=n.generateCodeVerifier(),e.codeChallenge=await n.generateCodeChallenge(e.codeVerifier),e.nonce=n.generateNonce(),e}static fromSerializedData(e){const r=new a,t=JSON.parse(e);return r.id=t.id,r.createdAt=t.createdAt,r.codeVerifier=t.codeVerifier,r.codeChallenge=t.codeChallenge,r.nonce=t.nonce,r}}export{a as State};
2
- //# sourceMappingURL=State.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"State.mjs","sources":["../../src/utils/State.ts"],"sourcesContent":["import { Crypto } from './crypto';\nimport { timestamp } from './date';\n\n/**\n * Class representing an OAuth state, including code verifier and nonce for PKCE flows.\n */\nexport class State {\n\t/**\n\t * The unique identifier for the state.\n\t * @type {string}\n\t */\n\tid!: string;\n\n\t/**\n\t * The timestamp when the state was created, represented in seconds since the epoch.\n\t * @type {number}\n\t */\n\tcreatedAt!: number;\n\n\t/**\n\t * The code verifier used in the PKCE (Proof Key for Code Exchange) flow.\n\t * @type {string}\n\t */\n\tcodeVerifier!: string;\n\n\t/**\n\t * The code challenge derived from the code verifier for the PKCE flow.\n\t * @type {string}\n\t */\n\tcodeChallenge!: string;\n\n\t/**\n\t * The nonce value used to associate a client session with an ID token for replay protection.\n\t * @type {string}\n\t */\n\tnonce!: string;\n\n\t/**\n\t * Creates a new instance of `State` with generated values for PKCE and nonce.\n\t *\n\t * @returns {Promise<State>} A promise that resolves to a new `State` instance.\n\t */\n\tstatic async create(): Promise<State> {\n\t\tconst instance = new State();\n\n\t\tinstance.id = Crypto.generateState();\n\t\tinstance.createdAt = timestamp();\n\t\tinstance.codeVerifier = Crypto.generateCodeVerifier();\n\t\tinstance.codeChallenge = await Crypto.generateCodeChallenge(instance.codeVerifier);\n\t\tinstance.nonce = Crypto.generateNonce();\n\n\t\treturn instance;\n\t}\n\n\t/**\n\t * Deserializes a `State` instance from a JSON string.\n\t *\n\t * @param {string} serializedData The serialized state data as a JSON string.\n\t * @returns {State} A new `State` instance populated with the deserialized data.\n\t */\n\tstatic fromSerializedData(serializedData: string): State {\n\t\tconst instance = new State();\n\t\tconst data = JSON.parse(serializedData);\n\n\t\tinstance.id = data.id;\n\t\tinstance.createdAt = data.createdAt;\n\t\tinstance.codeVerifier = data.codeVerifier;\n\t\tinstance.codeChallenge = data.codeChallenge;\n\t\tinstance.nonce = data.nonce;\n\n\t\treturn instance;\n\t}\n}\n"],"names":["State","instance","Crypto","timestamp","serializedData","data"],"mappings":"qGAMO,MAAMA,CAAM,CAKlB,GAMA,UAMA,aAMA,cAMA,MAOA,aAAa,QAAyB,CACrC,MAAMC,EAAW,IAAID,EAErB,OAAAC,EAAS,GAAKC,EAAO,cAAA,EACrBD,EAAS,UAAYE,EAAA,EACrBF,EAAS,aAAeC,EAAO,qBAAA,EAC/BD,EAAS,cAAgB,MAAMC,EAAO,sBAAsBD,EAAS,YAAY,EACjFA,EAAS,MAAQC,EAAO,cAAA,EAEjBD,CACR,CAQA,OAAO,mBAAmBG,EAA+B,CACxD,MAAMH,EAAW,IAAID,EACfK,EAAO,KAAK,MAAMD,CAAc,EAEtC,OAAAH,EAAS,GAAKI,EAAK,GACnBJ,EAAS,UAAYI,EAAK,UAC1BJ,EAAS,aAAeI,EAAK,aAC7BJ,EAAS,cAAgBI,EAAK,cAC9BJ,EAAS,MAAQI,EAAK,MAEfJ,CACR,CACD"}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function c(e){if(typeof e=="string")return e;const n=String.fromCharCode.apply(null,[...new Uint8Array(e)]);return btoa(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function a(e){if(typeof e!="string")return e;const n=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,""),r=atob(n),t=new Uint8Array(r.length);for(let o=0;o<r.length;o++)t[o]=r.charCodeAt(o);return t.buffer}function i(e){return decodeURIComponent(atob(e).replace(/(.)/g,(n,r)=>{let t=r.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t}))}const l={encode:c,decode:a,decodeUnicode:i};exports.Base64Url=l;
2
- //# sourceMappingURL=base64Url.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base64Url.cjs","sources":["../../src/utils/base64Url.ts"],"sourcesContent":["/**\n * Encodes a buffer or string into a Base64 URL-safe string.\n *\n * @param {string | null | BufferSource | ArrayBuffer} buffer The buffer or string to encode.\n * @returns {string} The Base64 URL-encoded string.\n */\nfunction encode(buffer: string | null | BufferSource | ArrayBuffer): string {\n\tif (typeof buffer === 'string') {\n\t\treturn buffer;\n\t}\n\n\tconst str = String.fromCharCode.apply(null, [...new Uint8Array(buffer as ArrayBuffer)]);\n\n\treturn btoa(str).replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_');\n}\n\n/**\n * Decodes a Base64 URL-safe string into an ArrayBuffer.\n *\n * @param {string | BufferSource} base64Url The Base64 URL-safe string or BufferSource to decode.\n * @returns {ArrayBuffer} The decoded ArrayBuffer.\n */\nfunction decode(base64Url: string | BufferSource): ArrayBuffer {\n\tif (typeof base64Url !== 'string') {\n\t\treturn base64Url as ArrayBuffer;\n\t}\n\n\tconst base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/').replace(/\\s/g, '');\n\tconst binStr = atob(base64);\n\tconst binary = new Uint8Array(binStr.length);\n\n\tfor (let i = 0; i < binStr.length; i++) {\n\t\tbinary[i] = binStr.charCodeAt(i);\n\t}\n\n\treturn binary.buffer;\n}\n\n/**\n * Decodes a Base64 URL-safe string into a UTF-8 string.\n *\n * @param {string} base64Url The Base64 URL-safe string to decode.\n * @returns {string} The decoded Unicode string.\n */\nfunction decodeUnicode(base64Url: string): string {\n\treturn decodeURIComponent(\n\t\tatob(base64Url).replace(/(.)/g, (m, p) => {\n\t\t\tlet code = (p as string).charCodeAt(0).toString(16).toUpperCase();\n\t\t\tif (code.length < 2) {\n\t\t\t\tcode = '0' + code;\n\t\t\t}\n\t\t\treturn '%' + code;\n\t\t}),\n\t);\n}\n\nexport const Base64Url = {\n\tencode,\n\tdecode,\n\tdecodeUnicode,\n};\n"],"names":["encode","buffer","str","decode","base64Url","base64","binStr","binary","i","decodeUnicode","m","p","code","Base64Url"],"mappings":"gFAMA,SAASA,EAAOC,EAA4D,CAC3E,GAAI,OAAOA,GAAW,SACrB,OAAOA,EAGR,MAAMC,EAAM,OAAO,aAAa,MAAM,KAAM,CAAC,GAAG,IAAI,WAAWD,CAAqB,CAAC,CAAC,EAEtF,OAAO,KAAKC,CAAG,EAAE,QAAQ,KAAM,EAAE,EAAE,QAAQ,MAAO,GAAG,EAAE,QAAQ,MAAO,GAAG,CAC1E,CAQA,SAASC,EAAOC,EAA+C,CAC9D,GAAI,OAAOA,GAAc,SACxB,OAAOA,EAGR,MAAMC,EAASD,EAAU,QAAQ,KAAM,GAAG,EAAE,QAAQ,KAAM,GAAG,EAAE,QAAQ,MAAO,EAAE,EAC1EE,EAAS,KAAKD,CAAM,EACpBE,EAAS,IAAI,WAAWD,EAAO,MAAM,EAE3C,QAASE,EAAI,EAAGA,EAAIF,EAAO,OAAQE,IAClCD,EAAOC,CAAC,EAAIF,EAAO,WAAWE,CAAC,EAGhC,OAAOD,EAAO,MACf,CAQA,SAASE,EAAcL,EAA2B,CACjD,OAAO,mBACN,KAAKA,CAAS,EAAE,QAAQ,OAAQ,CAACM,EAAGC,IAAM,CACzC,IAAIC,EAAQD,EAAa,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE,YAAA,EACpD,OAAIC,EAAK,OAAS,IACjBA,EAAO,IAAMA,GAEP,IAAMA,CACd,CAAC,CAAA,CAEH,CAEO,MAAMC,EAAY,CACxB,OAAAb,EACA,OAAAG,EACA,cAAAM,CACD"}
@@ -1,27 +0,0 @@
1
- /**
2
- * Encodes a buffer or string into a Base64 URL-safe string.
3
- *
4
- * @param {string | null | BufferSource | ArrayBuffer} buffer The buffer or string to encode.
5
- * @returns {string} The Base64 URL-encoded string.
6
- */
7
- declare function encode(buffer: string | null | BufferSource | ArrayBuffer): string;
8
- /**
9
- * Decodes a Base64 URL-safe string into an ArrayBuffer.
10
- *
11
- * @param {string | BufferSource} base64Url The Base64 URL-safe string or BufferSource to decode.
12
- * @returns {ArrayBuffer} The decoded ArrayBuffer.
13
- */
14
- declare function decode(base64Url: string | BufferSource): ArrayBuffer;
15
- /**
16
- * Decodes a Base64 URL-safe string into a UTF-8 string.
17
- *
18
- * @param {string} base64Url The Base64 URL-safe string to decode.
19
- * @returns {string} The decoded Unicode string.
20
- */
21
- declare function decodeUnicode(base64Url: string): string;
22
- export declare const Base64Url: {
23
- encode: typeof encode;
24
- decode: typeof decode;
25
- decodeUnicode: typeof decodeUnicode;
26
- };
27
- export {};
@@ -1,2 +0,0 @@
1
- function c(e){if(typeof e=="string")return e;const r=String.fromCharCode.apply(null,[...new Uint8Array(e)]);return btoa(r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function a(e){if(typeof e!="string")return e;const r=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,""),n=atob(r),t=new Uint8Array(n.length);for(let o=0;o<n.length;o++)t[o]=n.charCodeAt(o);return t.buffer}function i(e){return decodeURIComponent(atob(e).replace(/(.)/g,(r,n)=>{let t=n.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t}))}const p={encode:c,decode:a,decodeUnicode:i};export{p as Base64Url};
2
- //# sourceMappingURL=base64Url.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base64Url.mjs","sources":["../../src/utils/base64Url.ts"],"sourcesContent":["/**\n * Encodes a buffer or string into a Base64 URL-safe string.\n *\n * @param {string | null | BufferSource | ArrayBuffer} buffer The buffer or string to encode.\n * @returns {string} The Base64 URL-encoded string.\n */\nfunction encode(buffer: string | null | BufferSource | ArrayBuffer): string {\n\tif (typeof buffer === 'string') {\n\t\treturn buffer;\n\t}\n\n\tconst str = String.fromCharCode.apply(null, [...new Uint8Array(buffer as ArrayBuffer)]);\n\n\treturn btoa(str).replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_');\n}\n\n/**\n * Decodes a Base64 URL-safe string into an ArrayBuffer.\n *\n * @param {string | BufferSource} base64Url The Base64 URL-safe string or BufferSource to decode.\n * @returns {ArrayBuffer} The decoded ArrayBuffer.\n */\nfunction decode(base64Url: string | BufferSource): ArrayBuffer {\n\tif (typeof base64Url !== 'string') {\n\t\treturn base64Url as ArrayBuffer;\n\t}\n\n\tconst base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/').replace(/\\s/g, '');\n\tconst binStr = atob(base64);\n\tconst binary = new Uint8Array(binStr.length);\n\n\tfor (let i = 0; i < binStr.length; i++) {\n\t\tbinary[i] = binStr.charCodeAt(i);\n\t}\n\n\treturn binary.buffer;\n}\n\n/**\n * Decodes a Base64 URL-safe string into a UTF-8 string.\n *\n * @param {string} base64Url The Base64 URL-safe string to decode.\n * @returns {string} The decoded Unicode string.\n */\nfunction decodeUnicode(base64Url: string): string {\n\treturn decodeURIComponent(\n\t\tatob(base64Url).replace(/(.)/g, (m, p) => {\n\t\t\tlet code = (p as string).charCodeAt(0).toString(16).toUpperCase();\n\t\t\tif (code.length < 2) {\n\t\t\t\tcode = '0' + code;\n\t\t\t}\n\t\t\treturn '%' + code;\n\t\t}),\n\t);\n}\n\nexport const Base64Url = {\n\tencode,\n\tdecode,\n\tdecodeUnicode,\n};\n"],"names":["encode","buffer","str","decode","base64Url","base64","binStr","binary","i","decodeUnicode","m","p","code","Base64Url"],"mappings":"AAMA,SAASA,EAAOC,EAA4D,CAC3E,GAAI,OAAOA,GAAW,SACrB,OAAOA,EAGR,MAAMC,EAAM,OAAO,aAAa,MAAM,KAAM,CAAC,GAAG,IAAI,WAAWD,CAAqB,CAAC,CAAC,EAEtF,OAAO,KAAKC,CAAG,EAAE,QAAQ,KAAM,EAAE,EAAE,QAAQ,MAAO,GAAG,EAAE,QAAQ,MAAO,GAAG,CAC1E,CAQA,SAASC,EAAOC,EAA+C,CAC9D,GAAI,OAAOA,GAAc,SACxB,OAAOA,EAGR,MAAMC,EAASD,EAAU,QAAQ,KAAM,GAAG,EAAE,QAAQ,KAAM,GAAG,EAAE,QAAQ,MAAO,EAAE,EAC1EE,EAAS,KAAKD,CAAM,EACpBE,EAAS,IAAI,WAAWD,EAAO,MAAM,EAE3C,QAASE,EAAI,EAAGA,EAAIF,EAAO,OAAQE,IAClCD,EAAOC,CAAC,EAAIF,EAAO,WAAWE,CAAC,EAGhC,OAAOD,EAAO,MACf,CAQA,SAASE,EAAcL,EAA2B,CACjD,OAAO,mBACN,KAAKA,CAAS,EAAE,QAAQ,OAAQ,CAACM,EAAGC,IAAM,CACzC,IAAIC,EAAQD,EAAa,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE,YAAA,EACpD,OAAIC,EAAK,OAAS,IACjBA,EAAO,IAAMA,GAEP,IAAMA,CACd,CAAC,CAAA,CAEH,CAEO,MAAMC,EAAY,CACxB,OAAAb,EACA,OAAAG,EACA,cAAAM,CACD"}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function t(){return Math.floor(Date.now()/1e3)}exports.timestamp=t;
2
- //# sourceMappingURL=date.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"date.cjs","sources":["../../src/utils/date.ts"],"sourcesContent":["/**\n * Returns the current Unix timestamp (seconds since the epoch).\n *\n * @returns {number} The current timestamp in seconds.\n */\nexport function timestamp(): number {\n\treturn Math.floor(Date.now() / 1000);\n}\n"],"names":["timestamp"],"mappings":"gFAKO,SAASA,GAAoB,CACnC,OAAO,KAAK,MAAM,KAAK,IAAA,EAAQ,GAAI,CACpC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Returns the current Unix timestamp (seconds since the epoch).
3
- *
4
- * @returns {number} The current timestamp in seconds.
5
- */
6
- export declare function timestamp(): number;
@@ -1,2 +0,0 @@
1
- function t(){return Math.floor(Date.now()/1e3)}export{t as timestamp};
2
- //# sourceMappingURL=date.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"date.mjs","sources":["../../src/utils/date.ts"],"sourcesContent":["/**\n * Returns the current Unix timestamp (seconds since the epoch).\n *\n * @returns {number} The current timestamp in seconds.\n */\nexport function timestamp(): number {\n\treturn Math.floor(Date.now() / 1000);\n}\n"],"names":["timestamp"],"mappings":"AAKO,SAASA,GAAoB,CACnC,OAAO,KAAK,MAAM,KAAK,IAAA,EAAQ,GAAI,CACpC"}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./errors.cjs");let n=null;async function u(r,i){const o=i?.targetWindow==="top"?window.top:window.self,a=i?.locationMethod||"assign";return o&&o.location[a](r),new Promise(e=>e())}function f(r=globalThis.window?.location.href,i){const o=new URL(r)[i==="query"?"search":"hash"].slice(1);return Promise.resolve(Object.fromEntries(new URLSearchParams(o)))}async function p(r,i){const o=new Set,a=()=>{n&&(n.closed||n.close(),n=null);for(const t of o)t();o.clear()};n&&a();const e={location:!1,toolbar:!1,height:640,...i?.popupWindowFeatures};if(e.width===void 0&&(e.width=[800,720,600,480].find(t=>t<=window.outerWidth/1.618)??360),e.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-e.width)/2)),e.height!==void 0&&(e.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-e.height)/2))),n=window.open(void 0,i?.popupWindowTarget||"_blank",Object.entries(e).filter(([,t])=>t!==null).map(([t,l])=>`${t}=${typeof l!="boolean"?l:l?"yes":"no"}`).join(",")),!n)throw new w.PopupBlockedError;n.focus(),typeof r=="function"?await r(n):n.location.replace(r);const h=await new Promise((t,l)=>{const d=s=>{(!i?.checkOrigin||s.origin===window.location.origin)&&s.source===n&&s.data&&t(s.data)},c=setInterval(()=>{n?.closed&&(clearInterval(c),l(new w.PopupClosedError))},500);window.addEventListener("message",d),o.add(()=>window.removeEventListener("message",d)),o.add(()=>clearInterval(c))});return a(),h}function g(r,i){const o={};return i==="fragment"?new URLSearchParams(globalThis.window?.location.hash.replace("#","?")).forEach((a,e)=>o[e]=a):new URLSearchParams(globalThis.window?.location.search).forEach((a,e)=>o[e]=a),globalThis.window?.opener?.postMessage(o,"*"),new Promise(()=>{})}exports.popupCallbackHandler=g;exports.popupUrlHandler=p;exports.redirectCallbackHandler=f;exports.redirectUrlHandler=u;
2
- //# sourceMappingURL=handlers.cjs.map