mulguard 1.1.7 → 1.1.8

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 (546) hide show
  1. package/README.md +21 -582
  2. package/adapters.d.ts +2 -0
  3. package/adapters.d.ts.map +1 -0
  4. package/adapters.js +1 -0
  5. package/index.d.ts +329 -0
  6. package/index.d.ts.map +1 -0
  7. package/index.js +145 -0
  8. package/jwt.d.ts +9 -0
  9. package/jwt.d.ts.map +1 -0
  10. package/jwt.js +8 -0
  11. package/lib/actions.d.ts +13 -0
  12. package/lib/actions.d.ts.map +1 -0
  13. package/lib/actions.js +86 -0
  14. package/lib/client.d.ts +104 -0
  15. package/lib/client.d.ts.map +1 -0
  16. package/lib/client.js +95 -0
  17. package/lib/env.d.ts +12 -0
  18. package/lib/env.d.ts.map +1 -0
  19. package/lib/env.js +38 -0
  20. package/lib/index.d.ts +56 -0
  21. package/lib/index.d.ts.map +1 -0
  22. package/lib/index.js +187 -0
  23. package/lib/types.d.ts +24 -0
  24. package/lib/types.d.ts.map +1 -0
  25. package/lib/types.js +1 -0
  26. package/middleware.d.ts +9 -0
  27. package/middleware.d.ts.map +1 -0
  28. package/middleware.js +12 -0
  29. package/next.d.ts +9 -0
  30. package/next.d.ts.map +1 -0
  31. package/next.js +12 -0
  32. package/package.json +117 -126
  33. package/providers/42-school.d.ts +3 -0
  34. package/providers/42-school.d.ts.map +1 -0
  35. package/providers/42-school.js +2 -0
  36. package/providers/apple.d.ts +3 -0
  37. package/providers/apple.d.ts.map +1 -0
  38. package/providers/apple.js +2 -0
  39. package/providers/asgardeo.d.ts +3 -0
  40. package/providers/asgardeo.d.ts.map +1 -0
  41. package/providers/asgardeo.js +2 -0
  42. package/providers/atlassian.d.ts +3 -0
  43. package/providers/atlassian.d.ts.map +1 -0
  44. package/providers/atlassian.js +2 -0
  45. package/providers/auth0.d.ts +3 -0
  46. package/providers/auth0.d.ts.map +1 -0
  47. package/providers/auth0.js +2 -0
  48. package/providers/authentik.d.ts +3 -0
  49. package/providers/authentik.d.ts.map +1 -0
  50. package/providers/authentik.js +2 -0
  51. package/providers/azure-ad-b2c.d.ts +3 -0
  52. package/providers/azure-ad-b2c.d.ts.map +1 -0
  53. package/providers/azure-ad-b2c.js +2 -0
  54. package/providers/azure-ad.d.ts +3 -0
  55. package/providers/azure-ad.d.ts.map +1 -0
  56. package/providers/azure-ad.js +2 -0
  57. package/providers/azure-devops.d.ts +3 -0
  58. package/providers/azure-devops.d.ts.map +1 -0
  59. package/providers/azure-devops.js +2 -0
  60. package/providers/bankid-no.d.ts +3 -0
  61. package/providers/bankid-no.d.ts.map +1 -0
  62. package/providers/bankid-no.js +2 -0
  63. package/providers/battlenet.d.ts +3 -0
  64. package/providers/battlenet.d.ts.map +1 -0
  65. package/providers/battlenet.js +2 -0
  66. package/providers/beyondidentity.d.ts +3 -0
  67. package/providers/beyondidentity.d.ts.map +1 -0
  68. package/providers/beyondidentity.js +2 -0
  69. package/providers/bitbucket.d.ts +3 -0
  70. package/providers/bitbucket.d.ts.map +1 -0
  71. package/providers/bitbucket.js +2 -0
  72. package/providers/box.d.ts +3 -0
  73. package/providers/box.d.ts.map +1 -0
  74. package/providers/box.js +2 -0
  75. package/providers/boxyhq-saml.d.ts +3 -0
  76. package/providers/boxyhq-saml.d.ts.map +1 -0
  77. package/providers/boxyhq-saml.js +2 -0
  78. package/providers/bungie.d.ts +3 -0
  79. package/providers/bungie.d.ts.map +1 -0
  80. package/providers/bungie.js +2 -0
  81. package/providers/click-up.d.ts +3 -0
  82. package/providers/click-up.d.ts.map +1 -0
  83. package/providers/click-up.js +2 -0
  84. package/providers/cognito.d.ts +3 -0
  85. package/providers/cognito.d.ts.map +1 -0
  86. package/providers/cognito.js +2 -0
  87. package/providers/coinbase.d.ts +3 -0
  88. package/providers/coinbase.d.ts.map +1 -0
  89. package/providers/coinbase.js +2 -0
  90. package/providers/concept2.d.ts +3 -0
  91. package/providers/concept2.d.ts.map +1 -0
  92. package/providers/concept2.js +2 -0
  93. package/providers/credentials.d.ts +3 -0
  94. package/providers/credentials.d.ts.map +1 -0
  95. package/providers/credentials.js +2 -0
  96. package/providers/descope.d.ts +3 -0
  97. package/providers/descope.d.ts.map +1 -0
  98. package/providers/descope.js +2 -0
  99. package/providers/discord.d.ts +3 -0
  100. package/providers/discord.d.ts.map +1 -0
  101. package/providers/discord.js +2 -0
  102. package/providers/dribbble.d.ts +3 -0
  103. package/providers/dribbble.d.ts.map +1 -0
  104. package/providers/dribbble.js +2 -0
  105. package/providers/dropbox.d.ts +3 -0
  106. package/providers/dropbox.d.ts.map +1 -0
  107. package/providers/dropbox.js +2 -0
  108. package/providers/duende-identity-server6.d.ts +3 -0
  109. package/providers/duende-identity-server6.d.ts.map +1 -0
  110. package/providers/duende-identity-server6.js +2 -0
  111. package/providers/email.d.ts +3 -0
  112. package/providers/email.d.ts.map +1 -0
  113. package/providers/email.js +2 -0
  114. package/providers/eventbrite.d.ts +3 -0
  115. package/providers/eventbrite.d.ts.map +1 -0
  116. package/providers/eventbrite.js +2 -0
  117. package/providers/eveonline.d.ts +3 -0
  118. package/providers/eveonline.d.ts.map +1 -0
  119. package/providers/eveonline.js +2 -0
  120. package/providers/facebook.d.ts +3 -0
  121. package/providers/facebook.d.ts.map +1 -0
  122. package/providers/facebook.js +2 -0
  123. package/providers/faceit.d.ts +3 -0
  124. package/providers/faceit.d.ts.map +1 -0
  125. package/providers/faceit.js +2 -0
  126. package/providers/figma.d.ts +3 -0
  127. package/providers/figma.d.ts.map +1 -0
  128. package/providers/figma.js +2 -0
  129. package/providers/forwardemail.d.ts +3 -0
  130. package/providers/forwardemail.d.ts.map +1 -0
  131. package/providers/forwardemail.js +2 -0
  132. package/providers/foursquare.d.ts +3 -0
  133. package/providers/foursquare.d.ts.map +1 -0
  134. package/providers/foursquare.js +2 -0
  135. package/providers/freshbooks.d.ts +3 -0
  136. package/providers/freshbooks.d.ts.map +1 -0
  137. package/providers/freshbooks.js +2 -0
  138. package/providers/frontegg.d.ts +3 -0
  139. package/providers/frontegg.d.ts.map +1 -0
  140. package/providers/frontegg.js +2 -0
  141. package/providers/fusionauth.d.ts +3 -0
  142. package/providers/fusionauth.d.ts.map +1 -0
  143. package/providers/fusionauth.js +2 -0
  144. package/providers/github.d.ts +3 -0
  145. package/providers/github.d.ts.map +1 -0
  146. package/providers/github.js +2 -0
  147. package/providers/gitlab.d.ts +3 -0
  148. package/providers/gitlab.d.ts.map +1 -0
  149. package/providers/gitlab.js +2 -0
  150. package/providers/google.d.ts +3 -0
  151. package/providers/google.d.ts.map +1 -0
  152. package/providers/google.js +2 -0
  153. package/providers/hubspot.d.ts +3 -0
  154. package/providers/hubspot.d.ts.map +1 -0
  155. package/providers/hubspot.js +2 -0
  156. package/providers/huggingface.d.ts +3 -0
  157. package/providers/huggingface.d.ts.map +1 -0
  158. package/providers/huggingface.js +2 -0
  159. package/providers/identity-server4.d.ts +3 -0
  160. package/providers/identity-server4.d.ts.map +1 -0
  161. package/providers/identity-server4.js +2 -0
  162. package/providers/index.d.ts +2 -0
  163. package/providers/index.d.ts.map +1 -0
  164. package/providers/index.js +1 -0
  165. package/providers/instagram.d.ts +3 -0
  166. package/providers/instagram.d.ts.map +1 -0
  167. package/providers/instagram.js +2 -0
  168. package/providers/kakao.d.ts +3 -0
  169. package/providers/kakao.d.ts.map +1 -0
  170. package/providers/kakao.js +2 -0
  171. package/providers/keycloak.d.ts +3 -0
  172. package/providers/keycloak.d.ts.map +1 -0
  173. package/providers/keycloak.js +2 -0
  174. package/providers/kinde.d.ts +3 -0
  175. package/providers/kinde.d.ts.map +1 -0
  176. package/providers/kinde.js +2 -0
  177. package/providers/line.d.ts +3 -0
  178. package/providers/line.d.ts.map +1 -0
  179. package/providers/line.js +2 -0
  180. package/providers/linkedin.d.ts +3 -0
  181. package/providers/linkedin.d.ts.map +1 -0
  182. package/providers/linkedin.js +2 -0
  183. package/providers/logto.d.ts +3 -0
  184. package/providers/logto.d.ts.map +1 -0
  185. package/providers/logto.js +2 -0
  186. package/providers/loops.d.ts +3 -0
  187. package/providers/loops.d.ts.map +1 -0
  188. package/providers/loops.js +2 -0
  189. package/providers/mailchimp.d.ts +3 -0
  190. package/providers/mailchimp.d.ts.map +1 -0
  191. package/providers/mailchimp.js +2 -0
  192. package/providers/mailgun.d.ts +3 -0
  193. package/providers/mailgun.d.ts.map +1 -0
  194. package/providers/mailgun.js +2 -0
  195. package/providers/mailru.d.ts +3 -0
  196. package/providers/mailru.d.ts.map +1 -0
  197. package/providers/mailru.js +2 -0
  198. package/providers/mastodon.d.ts +3 -0
  199. package/providers/mastodon.d.ts.map +1 -0
  200. package/providers/mastodon.js +2 -0
  201. package/providers/mattermost.d.ts +3 -0
  202. package/providers/mattermost.d.ts.map +1 -0
  203. package/providers/mattermost.js +2 -0
  204. package/providers/medium.d.ts +3 -0
  205. package/providers/medium.d.ts.map +1 -0
  206. package/providers/medium.js +2 -0
  207. package/providers/microsoft-entra-id.d.ts +3 -0
  208. package/providers/microsoft-entra-id.d.ts.map +1 -0
  209. package/providers/microsoft-entra-id.js +2 -0
  210. package/providers/naver.d.ts +3 -0
  211. package/providers/naver.d.ts.map +1 -0
  212. package/providers/naver.js +2 -0
  213. package/providers/netlify.d.ts +3 -0
  214. package/providers/netlify.d.ts.map +1 -0
  215. package/providers/netlify.js +2 -0
  216. package/providers/netsuite.d.ts +3 -0
  217. package/providers/netsuite.d.ts.map +1 -0
  218. package/providers/netsuite.js +2 -0
  219. package/providers/nextcloud.d.ts +3 -0
  220. package/providers/nextcloud.d.ts.map +1 -0
  221. package/providers/nextcloud.js +2 -0
  222. package/providers/nodemailer.d.ts +3 -0
  223. package/providers/nodemailer.d.ts.map +1 -0
  224. package/providers/nodemailer.js +2 -0
  225. package/providers/notion.d.ts +3 -0
  226. package/providers/notion.d.ts.map +1 -0
  227. package/providers/notion.js +2 -0
  228. package/providers/okta.d.ts +3 -0
  229. package/providers/okta.d.ts.map +1 -0
  230. package/providers/okta.js +2 -0
  231. package/providers/onelogin.d.ts +3 -0
  232. package/providers/onelogin.d.ts.map +1 -0
  233. package/providers/onelogin.js +2 -0
  234. package/providers/ory-hydra.d.ts +3 -0
  235. package/providers/ory-hydra.d.ts.map +1 -0
  236. package/providers/ory-hydra.js +2 -0
  237. package/providers/osso.d.ts +3 -0
  238. package/providers/osso.d.ts.map +1 -0
  239. package/providers/osso.js +2 -0
  240. package/providers/osu.d.ts +3 -0
  241. package/providers/osu.d.ts.map +1 -0
  242. package/providers/osu.js +2 -0
  243. package/providers/passage.d.ts +3 -0
  244. package/providers/passage.d.ts.map +1 -0
  245. package/providers/passage.js +2 -0
  246. package/providers/passkey.d.ts +3 -0
  247. package/providers/passkey.d.ts.map +1 -0
  248. package/providers/passkey.js +2 -0
  249. package/providers/patreon.d.ts +3 -0
  250. package/providers/patreon.d.ts.map +1 -0
  251. package/providers/patreon.js +2 -0
  252. package/providers/ping-id.d.ts +3 -0
  253. package/providers/ping-id.d.ts.map +1 -0
  254. package/providers/ping-id.js +2 -0
  255. package/providers/pinterest.d.ts +3 -0
  256. package/providers/pinterest.d.ts.map +1 -0
  257. package/providers/pinterest.js +2 -0
  258. package/providers/pipedrive.d.ts +3 -0
  259. package/providers/pipedrive.d.ts.map +1 -0
  260. package/providers/pipedrive.js +2 -0
  261. package/providers/postmark.d.ts +3 -0
  262. package/providers/postmark.d.ts.map +1 -0
  263. package/providers/postmark.js +2 -0
  264. package/providers/reddit.d.ts +3 -0
  265. package/providers/reddit.d.ts.map +1 -0
  266. package/providers/reddit.js +2 -0
  267. package/providers/resend.d.ts +3 -0
  268. package/providers/resend.d.ts.map +1 -0
  269. package/providers/resend.js +2 -0
  270. package/providers/roblox.d.ts +3 -0
  271. package/providers/roblox.d.ts.map +1 -0
  272. package/providers/roblox.js +2 -0
  273. package/providers/salesforce.d.ts +3 -0
  274. package/providers/salesforce.d.ts.map +1 -0
  275. package/providers/salesforce.js +2 -0
  276. package/providers/sendgrid.d.ts +3 -0
  277. package/providers/sendgrid.d.ts.map +1 -0
  278. package/providers/sendgrid.js +2 -0
  279. package/providers/simplelogin.d.ts +3 -0
  280. package/providers/simplelogin.d.ts.map +1 -0
  281. package/providers/simplelogin.js +2 -0
  282. package/providers/slack.d.ts +3 -0
  283. package/providers/slack.d.ts.map +1 -0
  284. package/providers/slack.js +2 -0
  285. package/providers/spotify.d.ts +3 -0
  286. package/providers/spotify.d.ts.map +1 -0
  287. package/providers/spotify.js +2 -0
  288. package/providers/strava.d.ts +3 -0
  289. package/providers/strava.d.ts.map +1 -0
  290. package/providers/strava.js +2 -0
  291. package/providers/threads.d.ts +3 -0
  292. package/providers/threads.d.ts.map +1 -0
  293. package/providers/threads.js +2 -0
  294. package/providers/tiktok.d.ts +3 -0
  295. package/providers/tiktok.d.ts.map +1 -0
  296. package/providers/tiktok.js +2 -0
  297. package/providers/todoist.d.ts +3 -0
  298. package/providers/todoist.d.ts.map +1 -0
  299. package/providers/todoist.js +2 -0
  300. package/providers/trakt.d.ts +3 -0
  301. package/providers/trakt.d.ts.map +1 -0
  302. package/providers/trakt.js +2 -0
  303. package/providers/twitch.d.ts +3 -0
  304. package/providers/twitch.d.ts.map +1 -0
  305. package/providers/twitch.js +2 -0
  306. package/providers/twitter.d.ts +3 -0
  307. package/providers/twitter.d.ts.map +1 -0
  308. package/providers/twitter.js +2 -0
  309. package/providers/united-effects.d.ts +3 -0
  310. package/providers/united-effects.d.ts.map +1 -0
  311. package/providers/united-effects.js +2 -0
  312. package/providers/vipps.d.ts +3 -0
  313. package/providers/vipps.d.ts.map +1 -0
  314. package/providers/vipps.js +2 -0
  315. package/providers/vk.d.ts +3 -0
  316. package/providers/vk.d.ts.map +1 -0
  317. package/providers/vk.js +2 -0
  318. package/providers/webauthn.d.ts +3 -0
  319. package/providers/webauthn.d.ts.map +1 -0
  320. package/providers/webauthn.js +2 -0
  321. package/providers/webex.d.ts +3 -0
  322. package/providers/webex.d.ts.map +1 -0
  323. package/providers/webex.js +2 -0
  324. package/providers/wechat.d.ts +3 -0
  325. package/providers/wechat.d.ts.map +1 -0
  326. package/providers/wechat.js +2 -0
  327. package/providers/wikimedia.d.ts +3 -0
  328. package/providers/wikimedia.d.ts.map +1 -0
  329. package/providers/wikimedia.js +2 -0
  330. package/providers/wordpress.d.ts +3 -0
  331. package/providers/wordpress.d.ts.map +1 -0
  332. package/providers/wordpress.js +2 -0
  333. package/providers/workos.d.ts +3 -0
  334. package/providers/workos.d.ts.map +1 -0
  335. package/providers/workos.js +2 -0
  336. package/providers/yandex.d.ts +3 -0
  337. package/providers/yandex.d.ts.map +1 -0
  338. package/providers/yandex.js +2 -0
  339. package/providers/zitadel.d.ts +3 -0
  340. package/providers/zitadel.d.ts.map +1 -0
  341. package/providers/zitadel.js +2 -0
  342. package/providers/zoho.d.ts +3 -0
  343. package/providers/zoho.d.ts.map +1 -0
  344. package/providers/zoho.js +2 -0
  345. package/providers/zoom.d.ts +3 -0
  346. package/providers/zoom.d.ts.map +1 -0
  347. package/providers/zoom.js +2 -0
  348. package/react.d.ts +102 -0
  349. package/react.d.ts.map +1 -0
  350. package/react.js +361 -0
  351. package/src/adapters.ts +1 -0
  352. package/src/index.ts +430 -0
  353. package/src/jwt.ts +9 -0
  354. package/src/lib/actions.ts +144 -0
  355. package/src/lib/client.ts +245 -0
  356. package/src/lib/env.ts +36 -0
  357. package/src/lib/index.ts +313 -0
  358. package/src/lib/types.ts +30 -0
  359. package/src/middleware.ts +16 -0
  360. package/src/next.ts +16 -0
  361. package/src/providers/42-school.ts +2 -0
  362. package/src/providers/apple.ts +2 -0
  363. package/src/providers/asgardeo.ts +2 -0
  364. package/src/providers/atlassian.ts +2 -0
  365. package/src/providers/auth0.ts +2 -0
  366. package/src/providers/authentik.ts +2 -0
  367. package/src/providers/azure-ad-b2c.ts +2 -0
  368. package/src/providers/azure-ad.ts +2 -0
  369. package/src/providers/azure-devops.ts +2 -0
  370. package/src/providers/bankid-no.ts +2 -0
  371. package/src/providers/battlenet.ts +2 -0
  372. package/src/providers/beyondidentity.ts +2 -0
  373. package/src/providers/bitbucket.ts +2 -0
  374. package/src/providers/box.ts +2 -0
  375. package/src/providers/boxyhq-saml.ts +2 -0
  376. package/src/providers/bungie.ts +2 -0
  377. package/src/providers/click-up.ts +2 -0
  378. package/src/providers/cognito.ts +2 -0
  379. package/src/providers/coinbase.ts +2 -0
  380. package/src/providers/concept2.ts +2 -0
  381. package/src/providers/credentials.ts +2 -0
  382. package/src/providers/descope.ts +2 -0
  383. package/src/providers/discord.ts +2 -0
  384. package/src/providers/dribbble.ts +2 -0
  385. package/src/providers/dropbox.ts +2 -0
  386. package/src/providers/duende-identity-server6.ts +2 -0
  387. package/src/providers/email.ts +2 -0
  388. package/src/providers/eventbrite.ts +2 -0
  389. package/src/providers/eveonline.ts +2 -0
  390. package/src/providers/facebook.ts +2 -0
  391. package/src/providers/faceit.ts +2 -0
  392. package/src/providers/figma.ts +2 -0
  393. package/src/providers/forwardemail.ts +2 -0
  394. package/src/providers/foursquare.ts +2 -0
  395. package/src/providers/freshbooks.ts +2 -0
  396. package/src/providers/frontegg.ts +2 -0
  397. package/src/providers/fusionauth.ts +2 -0
  398. package/src/providers/github.ts +2 -0
  399. package/src/providers/gitlab.ts +2 -0
  400. package/src/providers/google.ts +2 -0
  401. package/src/providers/hubspot.ts +2 -0
  402. package/src/providers/huggingface.ts +2 -0
  403. package/src/providers/identity-server4.ts +2 -0
  404. package/src/providers/index.ts +1 -0
  405. package/src/providers/instagram.ts +2 -0
  406. package/src/providers/kakao.ts +2 -0
  407. package/src/providers/keycloak.ts +2 -0
  408. package/src/providers/kinde.ts +2 -0
  409. package/src/providers/line.ts +2 -0
  410. package/src/providers/linkedin.ts +2 -0
  411. package/src/providers/logto.ts +2 -0
  412. package/src/providers/loops.ts +2 -0
  413. package/src/providers/mailchimp.ts +2 -0
  414. package/src/providers/mailgun.ts +2 -0
  415. package/src/providers/mailru.ts +2 -0
  416. package/src/providers/mastodon.ts +2 -0
  417. package/src/providers/mattermost.ts +2 -0
  418. package/src/providers/medium.ts +2 -0
  419. package/src/providers/microsoft-entra-id.ts +2 -0
  420. package/src/providers/naver.ts +2 -0
  421. package/src/providers/netlify.ts +2 -0
  422. package/src/providers/netsuite.ts +2 -0
  423. package/src/providers/nextcloud.ts +2 -0
  424. package/src/providers/nodemailer.ts +2 -0
  425. package/src/providers/notion.ts +2 -0
  426. package/src/providers/okta.ts +2 -0
  427. package/src/providers/onelogin.ts +2 -0
  428. package/src/providers/ory-hydra.ts +2 -0
  429. package/src/providers/osso.ts +2 -0
  430. package/src/providers/osu.ts +2 -0
  431. package/src/providers/passage.ts +2 -0
  432. package/src/providers/passkey.ts +2 -0
  433. package/src/providers/patreon.ts +2 -0
  434. package/src/providers/ping-id.ts +2 -0
  435. package/src/providers/pinterest.ts +2 -0
  436. package/src/providers/pipedrive.ts +2 -0
  437. package/src/providers/postmark.ts +2 -0
  438. package/src/providers/reddit.ts +2 -0
  439. package/src/providers/resend.ts +2 -0
  440. package/src/providers/roblox.ts +2 -0
  441. package/src/providers/salesforce.ts +2 -0
  442. package/src/providers/sendgrid.ts +2 -0
  443. package/src/providers/simplelogin.ts +2 -0
  444. package/src/providers/slack.ts +2 -0
  445. package/src/providers/spotify.ts +2 -0
  446. package/src/providers/strava.ts +2 -0
  447. package/src/providers/threads.ts +2 -0
  448. package/src/providers/tiktok.ts +2 -0
  449. package/src/providers/todoist.ts +2 -0
  450. package/src/providers/trakt.ts +2 -0
  451. package/src/providers/twitch.ts +2 -0
  452. package/src/providers/twitter.ts +2 -0
  453. package/src/providers/united-effects.ts +2 -0
  454. package/src/providers/vipps.ts +2 -0
  455. package/src/providers/vk.ts +2 -0
  456. package/src/providers/webauthn.ts +2 -0
  457. package/src/providers/webex.ts +2 -0
  458. package/src/providers/wechat.ts +2 -0
  459. package/src/providers/wikimedia.ts +2 -0
  460. package/src/providers/wordpress.ts +2 -0
  461. package/src/providers/workos.ts +2 -0
  462. package/src/providers/yandex.ts +2 -0
  463. package/src/providers/zitadel.ts +2 -0
  464. package/src/providers/zoho.ts +2 -0
  465. package/src/providers/zoom.ts +2 -0
  466. package/src/react.tsx +546 -0
  467. package/src/webauthn.ts +152 -0
  468. package/webauthn.d.ts +9 -0
  469. package/webauthn.d.ts.map +1 -0
  470. package/webauthn.js +92 -0
  471. package/LICENSE +0 -70
  472. package/dist/actions-CMtg7FGv.js +0 -1
  473. package/dist/actions-CjQUKaXF.mjs +0 -200
  474. package/dist/client/index.js +0 -1
  475. package/dist/client/index.mjs +0 -484
  476. package/dist/components/AccountPicker.d.ts +0 -11
  477. package/dist/components/OAuthButton.d.ts +0 -11
  478. package/dist/components/PassKeyButton.d.ts +0 -11
  479. package/dist/components/PassKeyRegister.d.ts +0 -10
  480. package/dist/components/TwoFactorSetup.d.ts +0 -8
  481. package/dist/components/TwoFactorVerify.d.ts +0 -9
  482. package/dist/core/account-picker/encryption.d.ts +0 -22
  483. package/dist/core/account-picker/index.d.ts +0 -22
  484. package/dist/core/auth/email-password.d.ts +0 -145
  485. package/dist/core/auth/oauth/index.d.ts +0 -14
  486. package/dist/core/auth/oauth/oauth-handler.d.ts +0 -172
  487. package/dist/core/auth/oauth/pkce.d.ts +0 -168
  488. package/dist/core/auth/oauth/providers.d.ts +0 -198
  489. package/dist/core/auth/oauth/state-store-cookie.d.ts +0 -83
  490. package/dist/core/auth/oauth/state-store-redis.d.ts +0 -25
  491. package/dist/core/auth/oauth/state-store.d.ts +0 -48
  492. package/dist/core/auth/otp.d.ts +0 -184
  493. package/dist/core/auth/passkey.d.ts +0 -35
  494. package/dist/core/auth/password.d.ts +0 -22
  495. package/dist/core/auth/signin-unified.d.ts +0 -33
  496. package/dist/core/auth/two-factor.d.ts +0 -28
  497. package/dist/core/client/index.d.ts +0 -132
  498. package/dist/core/client/token-refresh-manager.d.ts +0 -48
  499. package/dist/core/errors/index.d.ts +0 -269
  500. package/dist/core/index.d.ts +0 -9
  501. package/dist/core/logger/index.d.ts +0 -147
  502. package/dist/core/mulguard/auth-handlers.d.ts +0 -100
  503. package/dist/core/mulguard/defaults.d.ts +0 -58
  504. package/dist/core/mulguard/index.d.ts +0 -9
  505. package/dist/core/mulguard/integration.d.ts +0 -104
  506. package/dist/core/mulguard/oauth-handler.d.ts +0 -93
  507. package/dist/core/mulguard/session-manager.d.ts +0 -94
  508. package/dist/core/security/csrf.d.ts +0 -46
  509. package/dist/core/security/headers.d.ts +0 -24
  510. package/dist/core/security/index.d.ts +0 -132
  511. package/dist/core/security/rate-limit.d.ts +0 -39
  512. package/dist/core/security/security-manager.d.ts +0 -236
  513. package/dist/core/security/validation.d.ts +0 -251
  514. package/dist/core/security/xss.d.ts +0 -20
  515. package/dist/core/session/index.d.ts +0 -35
  516. package/dist/core/session/session-manager.d.ts +0 -235
  517. package/dist/core/types/auth.d.ts +0 -290
  518. package/dist/core/types/errors.d.ts +0 -200
  519. package/dist/core/types/index.d.ts +0 -484
  520. package/dist/core/utils/auth-helpers.d.ts +0 -136
  521. package/dist/core/utils/logger.d.ts +0 -121
  522. package/dist/index/index.js +0 -1
  523. package/dist/index/index.mjs +0 -2736
  524. package/dist/index.d.ts +0 -18
  525. package/dist/mulguard.d.ts +0 -373
  526. package/dist/nextjs/client/hooks.d.ts +0 -122
  527. package/dist/nextjs/client/index.d.ts +0 -13
  528. package/dist/nextjs/client/provider.d.ts +0 -69
  529. package/dist/nextjs/client/server-actions-helper.d.ts +0 -22
  530. package/dist/nextjs/handlers/api.d.ts +0 -10
  531. package/dist/nextjs/handlers/index.d.ts +0 -9
  532. package/dist/nextjs/handlers/route.d.ts +0 -76
  533. package/dist/nextjs/index.d.ts +0 -15
  534. package/dist/nextjs/proxy/index.d.ts +0 -149
  535. package/dist/nextjs/proxy/security.d.ts +0 -9
  536. package/dist/nextjs/server/actions.d.ts +0 -30
  537. package/dist/nextjs/server/auth.d.ts +0 -65
  538. package/dist/nextjs/server/cookies.d.ts +0 -41
  539. package/dist/nextjs/server/index.d.ts +0 -18
  540. package/dist/nextjs/server/oauth-state.d.ts +0 -32
  541. package/dist/nextjs/server/session-helpers.d.ts +0 -24
  542. package/dist/nextjs/server/session.d.ts +0 -144
  543. package/dist/oauth-state-Drwz6fES.js +0 -1
  544. package/dist/oauth-state-pdypStuS.mjs +0 -210
  545. package/dist/server/index.js +0 -1
  546. package/dist/server/index.mjs +0 -29
@@ -1,269 +0,0 @@
1
- import { AuthErrorCode, AuthError as AuthErrorInterface, ErrorResult } from '../types/errors';
2
- /**
3
- * Base authentication error class.
4
- *
5
- * Extends native Error with authentication-specific properties.
6
- * All authentication errors should extend this class.
7
- *
8
- * @property code - Specific error code
9
- * @property statusCode - HTTP status code (if applicable)
10
- * @property details - Additional error details (optional)
11
- *
12
- * @example
13
- * ```typescript
14
- * throw new AuthError(
15
- * AuthErrorCode.INVALID_CREDENTIALS,
16
- * 'Invalid email or password'
17
- * )
18
- * ```
19
- */
20
- export declare class AuthError extends Error {
21
- readonly code: AuthErrorCode;
22
- readonly statusCode: number;
23
- readonly details?: unknown;
24
- constructor(code: AuthErrorCode, message: string, statusCode?: number, details?: unknown);
25
- /**
26
- * Converts error to plain object for serialization.
27
- *
28
- * @returns Plain error object
29
- */
30
- toJSON(): AuthErrorInterface;
31
- /**
32
- * Creates error result for failed operations.
33
- *
34
- * @returns ErrorResult object
35
- */
36
- toErrorResult(): ErrorResult;
37
- }
38
- /**
39
- * Invalid credentials error.
40
- *
41
- * Thrown when email/password authentication fails.
42
- */
43
- export declare class InvalidCredentialsError extends AuthError {
44
- constructor(message?: string, details?: unknown);
45
- }
46
- /**
47
- * Account locked error.
48
- *
49
- * Thrown when account is temporarily locked due to failed attempts.
50
- */
51
- export declare class AccountLockedError extends AuthError {
52
- constructor(message?: string, unlockAt?: Date, details?: unknown);
53
- }
54
- /**
55
- * Account inactive error.
56
- *
57
- * Thrown when account is inactive or disabled.
58
- */
59
- export declare class AccountInactiveError extends AuthError {
60
- constructor(message?: string, details?: unknown);
61
- }
62
- /**
63
- * Two-factor authentication required error.
64
- *
65
- * Thrown when 2FA verification is required after initial authentication.
66
- */
67
- export declare class TwoFactorRequiredError extends AuthError {
68
- readonly email: string;
69
- readonly userId: string;
70
- readonly twoFactorMethod?: 'totp' | 'sms' | 'email';
71
- readonly challengeToken?: string;
72
- constructor(email: string, userId: string, message?: string, twoFactorMethod?: 'totp' | 'sms' | 'email', challengeToken?: string, details?: unknown);
73
- }
74
- /**
75
- * Invalid two-factor authentication code error.
76
- *
77
- * Thrown when 2FA code verification fails.
78
- */
79
- export declare class InvalidTwoFactorCodeError extends AuthError {
80
- constructor(message?: string, details?: unknown);
81
- }
82
- /**
83
- * Session expired error.
84
- *
85
- * Thrown when session has expired.
86
- */
87
- export declare class SessionExpiredError extends AuthError {
88
- constructor(message?: string, details?: unknown);
89
- }
90
- /**
91
- * Unauthorized error.
92
- *
93
- * Thrown when user is not authorized for an operation.
94
- */
95
- export declare class UnauthorizedError extends AuthError {
96
- constructor(message?: string, details?: unknown);
97
- }
98
- /**
99
- * Network error.
100
- *
101
- * Thrown when network or API communication fails.
102
- */
103
- export declare class NetworkError extends AuthError {
104
- constructor(message?: string, details?: unknown);
105
- }
106
- /**
107
- * Validation error.
108
- *
109
- * Thrown when input validation fails.
110
- */
111
- export declare class ValidationError extends AuthError {
112
- readonly fields?: ReadonlyArray<{
113
- field: string;
114
- message: string;
115
- }>;
116
- constructor(message?: string, fields?: ReadonlyArray<{
117
- field: string;
118
- message: string;
119
- }>, details?: unknown);
120
- }
121
- /**
122
- * Rate limit error.
123
- *
124
- * Thrown when rate limit is exceeded.
125
- */
126
- export declare class RateLimitError extends AuthError {
127
- readonly retryAfter?: number;
128
- constructor(message?: string, retryAfter?: number, details?: unknown);
129
- }
130
- /**
131
- * Creates an authentication error from error code and message.
132
- *
133
- * @param code - Error code
134
- * @param message - Error message
135
- * @param details - Additional error details (optional)
136
- * @returns AuthError instance
137
- *
138
- * @example
139
- * ```typescript
140
- * const error = createError(
141
- * AuthErrorCode.INVALID_CREDENTIALS,
142
- * 'Invalid email or password'
143
- * )
144
- * ```
145
- */
146
- export declare function createError(code: AuthErrorCode, message: string, details?: unknown): AuthError;
147
- /**
148
- * Creates an error result for failed operations.
149
- *
150
- * @template TCode - Error code type
151
- * @param code - Error code
152
- * @param message - Error message
153
- * @param details - Additional error details (optional)
154
- * @returns ErrorResult object
155
- *
156
- * @example
157
- * ```typescript
158
- * const result = createErrorResult(
159
- * AuthErrorCode.INVALID_CREDENTIALS,
160
- * 'Invalid email or password'
161
- * )
162
- * ```
163
- */
164
- export declare function createErrorResult<TCode extends AuthErrorCode = AuthErrorCode>(code: TCode, message: string, details?: unknown): ErrorResult<TCode>;
165
- /**
166
- * Converts unknown error to AuthError.
167
- *
168
- * Handles various error types and converts them to AuthError.
169
- *
170
- * @param error - Unknown error value
171
- * @param defaultCode - Default error code (optional)
172
- * @param defaultMessage - Default error message (optional)
173
- * @returns AuthError instance
174
- *
175
- * @example
176
- * ```typescript
177
- * try {
178
- * // Some operation
179
- * } catch (error) {
180
- * const authError = toAuthError(error, AuthErrorCode.UNKNOWN_ERROR)
181
- * logger.error('Operation failed', authError)
182
- * }
183
- * ```
184
- */
185
- export declare function toAuthError(error: unknown, defaultCode?: AuthErrorCode, defaultMessage?: string): AuthError;
186
- /**
187
- * Checks if error is an authentication error.
188
- *
189
- * @param error - Error to check
190
- * @returns True if error is AuthError
191
- *
192
- * @example
193
- * ```typescript
194
- * if (isAuthError(error)) {
195
- * // Handle authentication error
196
- * console.error(error.code, error.message)
197
- * }
198
- * ```
199
- */
200
- export declare function isAuthError(error: unknown): error is AuthError;
201
- /**
202
- * Gets error message from unknown error.
203
- *
204
- * @param error - Error to extract message from
205
- * @param defaultMessage - Default message if extraction fails
206
- * @returns Error message string
207
- *
208
- * @example
209
- * ```typescript
210
- * const message = getErrorMessage(error, 'Unknown error')
211
- * ```
212
- */
213
- export declare function getErrorMessage(error: unknown, defaultMessage?: string): string;
214
- /**
215
- * Gets error code from unknown error.
216
- *
217
- * @param error - Error to extract code from
218
- * @param defaultCode - Default code if extraction fails
219
- * @returns Error code
220
- *
221
- * @example
222
- * ```typescript
223
- * const code = getErrorCode(error, AuthErrorCode.UNKNOWN_ERROR)
224
- * ```
225
- */
226
- export declare function getErrorCode(error: unknown, defaultCode?: AuthErrorCode): AuthErrorCode;
227
- export { AuthErrorCode, type AuthError as AuthErrorInterface, type ErrorResult, getErrorStatusCode, ERROR_STATUS_MAP, } from '../types/errors';
228
- /**
229
- * TODO: Performance
230
- * - [ ] Add error pooling for high-frequency error creation
231
- * - [ ] Implement error serialization caching
232
- * - [ ] Add error aggregation for batch operations
233
- * - [ ] Consider using Error.cause for error chaining (Node.js 16.9+)
234
- *
235
- * TODO: Features
236
- * - [ ] Add error recovery strategies
237
- * - [ ] Implement error code hierarchies/categories
238
- * - [ ] Add localized error messages support
239
- * - [ ] Create error code to user-friendly message mapping
240
- * - [ ] Add error code metadata (retryable, transient, etc.)
241
- * - [ ] Implement error reporting integration (Sentry, etc.)
242
- * - [ ] Add error context propagation
243
- *
244
- * TODO: Type Safety
245
- * - [ ] Add branded types for error codes
246
- * - [ ] Implement type-safe error code unions
247
- * - [ ] Add exhaustiveness checking for error handling
248
- * - [ ] Create type-safe error code validation
249
- * - [ ] Add type-level error code to status code mapping
250
- *
251
- * TODO: Testing
252
- * - [ ] Add unit tests for all error classes
253
- * - [ ] Test error factory functions
254
- * - [ ] Test error conversion utilities
255
- * - [ ] Test error serialization
256
- * - [ ] Add integration tests for error handling flow
257
- *
258
- * TODO: Documentation
259
- * - [ ] Add examples for each error class
260
- * - [ ] Document error handling best practices
261
- * - [ ] Create error code reference guide
262
- * - [ ] Add error handling patterns guide
263
- *
264
- * TODO: Limitations
265
- * - [ ] Error code enum may need extension for custom errors
266
- * - [ ] Status code mapping is fixed (consider configurable)
267
- * - [ ] Error details type is unknown (consider generic)
268
- * - [ ] Stack trace capture may have performance impact
269
- */
@@ -1,9 +0,0 @@
1
- /**
2
- * Core authentication library - framework agnostic
3
- * Part of mulguard package
4
- */
5
- export type { MulguardConfig, SessionConfig, SecurityConfig, CallbacksConfig, AuthActions, Session, User, AuthResult, EmailCredentials, RegisterData, RequestContext, } from './types';
6
- export * from './security';
7
- export * from './utils/auth-helpers';
8
- export * from './auth/signin-unified';
9
- export * from './auth/oauth';
@@ -1,147 +0,0 @@
1
- import { Logger, LoggerConfig, LogLevel } from '../utils/logger';
2
- /**
3
- * Enhanced logging system for Mulguard Authentication Library.
4
- *
5
- * Provides structured logging with multiple adapters (Console, Pino) and
6
- * comprehensive log sanitization for security.
7
- *
8
- * @module @mulguard/core/logger
9
- */
10
- /**
11
- * Logger adapter interface for different logging backends.
12
- */
13
- export interface LoggerAdapter {
14
- readonly debug: (message: string, data?: Readonly<Record<string, unknown>>) => void;
15
- readonly info: (message: string, data?: Readonly<Record<string, unknown>>) => void;
16
- readonly warn: (message: string, data?: Readonly<Record<string, unknown>>) => void;
17
- readonly error: (message: string, error?: Error | Readonly<Record<string, unknown>>) => void;
18
- }
19
- /**
20
- * Logger adapter type.
21
- */
22
- export type LoggerAdapterType = 'console' | 'pino' | 'custom';
23
- /**
24
- * Creates a console-based logger adapter.
25
- *
26
- * @param config - Logger configuration
27
- * @returns Console logger adapter
28
- */
29
- export declare function createConsoleAdapter(config?: LoggerConfig): LoggerAdapter;
30
- /**
31
- * Creates a Pino-based logger adapter.
32
- *
33
- * Requires 'pino' package to be installed.
34
- * Falls back to console adapter if Pino is not available.
35
- *
36
- * @param config - Logger configuration
37
- * @returns Pino logger adapter or console fallback
38
- *
39
- * @example
40
- * ```typescript
41
- * const logger = createPinoAdapter({
42
- * level: 'info',
43
- * context: 'Auth'
44
- * })
45
- * ```
46
- */
47
- export declare function createPinoAdapter(config?: LoggerConfig): LoggerAdapter;
48
- /**
49
- * Enhanced logger configuration with adapter support.
50
- */
51
- export interface EnhancedLoggerConfig {
52
- readonly adapter?: LoggerAdapterType | LoggerAdapter;
53
- readonly pinoOptions?: Record<string, unknown>;
54
- readonly level?: LogLevel;
55
- readonly context?: string;
56
- }
57
- /**
58
- * Creates an enhanced logger instance with adapter support.
59
- *
60
- * @param config - Enhanced logger configuration
61
- * @returns Logger instance
62
- *
63
- * @example
64
- * ```typescript
65
- * // Console adapter (default)
66
- * const logger1 = createEnhancedLogger({ level: LogLevel.INFO })
67
- *
68
- * // Pino adapter
69
- * const logger2 = createEnhancedLogger({ adapter: 'pino' })
70
- *
71
- * // Custom adapter
72
- * const logger3 = createEnhancedLogger({ adapter: customAdapter })
73
- * ```
74
- */
75
- export declare function createEnhancedLogger(config?: EnhancedLoggerConfig): Logger;
76
- /**
77
- * Default enhanced logger instance.
78
- *
79
- * Uses console adapter by default, can be configured via environment variables.
80
- */
81
- export declare const logger: Logger;
82
- /**
83
- * Creates a logger with context.
84
- *
85
- * @param context - Log context
86
- * @param baseLogger - Base logger instance (optional)
87
- * @returns Logger with context
88
- *
89
- * @example
90
- * ```typescript
91
- * const authLogger = createContextLogger('Auth', logger)
92
- * authLogger.info('User signed in', { userId: '123' })
93
- * // Output: [Auth] User signed in { userId: '123' }
94
- * ```
95
- */
96
- export declare function createContextLogger(context: string, baseLogger?: Logger): Logger;
97
- export type { Logger, LoggerConfig, LogEntry } from '../utils/logger';
98
- export { LogLevel, createLogger, isLogger } from '../utils/logger';
99
- /**
100
- * TODO: Performance
101
- * - [ ] Add log batching for high-frequency operations
102
- * - [ ] Implement async logging for non-blocking operations
103
- * - [ ] Add log rotation and cleanup
104
- * - [ ] Consider log sampling for high-volume scenarios
105
- * - [ ] Add log compression for file-based logging
106
- *
107
- * TODO: Features
108
- * - [ ] Add Winston adapter support
109
- * - [ ] Implement log transport abstraction (file, remote, etc.)
110
- * - [ ] Add log correlation IDs (request IDs)
111
- * - [ ] Create log aggregation support
112
- * - [ ] Add performance metrics logging
113
- * - [ ] Implement structured logging with schemas
114
- * - [ ] Add log filtering by context/level
115
- *
116
- * TODO: Type Safety
117
- * - [ ] Add type-safe log data validation
118
- * - [ ] Create log schema definitions
119
- * - [ ] Add compile-time log level checking
120
- * - [ ] Implement type-safe log context
121
- *
122
- * TODO: Security
123
- * - [ ] Enhance sensitive data detection
124
- * - [ ] Add PII (Personally Identifiable Information) masking
125
- * - [ ] Implement log encryption for sensitive logs
126
- * - [ ] Add audit log support
127
- * - [ ] Add log access control
128
- *
129
- * TODO: Testing
130
- * - [ ] Add logger adapter unit tests
131
- * - [ ] Test Pino adapter fallback
132
- * - [ ] Test log sanitization
133
- * - [ ] Test context logger
134
- * - [ ] Add performance tests
135
- *
136
- * TODO: Documentation
137
- * - [ ] Document adapter configuration
138
- * - [ ] Add logging best practices guide
139
- * - [ ] Document log levels and when to use them
140
- * - [ ] Create adapter migration guide
141
- *
142
- * TODO: Limitations
143
- * - [ ] Pino adapter requires 'pino' package (optional dependency)
144
- * - [ ] Dynamic import may have performance impact
145
- * - [ ] Log sanitization is basic (may need enhancement)
146
- * - [ ] No log persistence (consider file/remote logging)
147
- */
@@ -1,100 +0,0 @@
1
- import { AuthResult, EmailCredentials, RegisterData, User, Session, AuthActions, CallbacksConfig } from '../types';
2
- /**
3
- * Authentication handlers configuration.
4
- */
5
- export interface AuthHandlersConfig<TUser extends User = User, TSession extends Session<TUser> = Session<TUser>> {
6
- readonly actions: AuthActions<TUser, TSession>;
7
- readonly callbacks: CallbacksConfig;
8
- readonly saveSessionAfterAuth: (result: AuthResult<TUser, TSession>) => Promise<{
9
- success: boolean;
10
- error?: string;
11
- warning?: string;
12
- }>;
13
- readonly onError?: (error: Error, context: string) => Promise<void> | void;
14
- }
15
- /**
16
- * Sign-in handlers result.
17
- */
18
- export interface SignInHandlers<TUser extends User = User, TSession extends Session<TUser> = Session<TUser>> {
19
- readonly email: (credentials: EmailCredentials) => Promise<AuthResult<TUser, TSession>>;
20
- readonly oauth?: (provider: string) => Promise<{
21
- url: string;
22
- state: string;
23
- }>;
24
- readonly passkey?: (options?: {
25
- userId?: string;
26
- }) => Promise<AuthResult<TUser, TSession>>;
27
- readonly otp?: (email: string, code?: string) => Promise<AuthResult<TUser, TSession>>;
28
- }
29
- /**
30
- * Creates unified sign-in handler that supports both provider-based and direct method calls.
31
- *
32
- * @template TUser - User type
33
- * @template TSession - Session type
34
- * @param config - Handler configuration
35
- * @param storeOAuthState - Function to store OAuth state
36
- * @returns Unified sign-in handler
37
- */
38
- export declare function createUnifiedSignInHandler<TUser extends User = User, TSession extends Session<TUser> = Session<TUser>>(config: AuthHandlersConfig<TUser, TSession>, storeOAuthState: (state: string, provider: string) => Promise<void>): SignInHandlers<TUser, TSession> & {
39
- (provider: string): Promise<{
40
- url: string;
41
- state: string;
42
- }>;
43
- (provider: 'credentials', credentials: EmailCredentials): Promise<AuthResult<TUser, TSession>>;
44
- (provider: 'otp', options: {
45
- email: string;
46
- code?: string;
47
- }): Promise<AuthResult<TUser, TSession>>;
48
- (provider: 'passkey', options?: {
49
- userId?: string;
50
- }): Promise<AuthResult<TUser, TSession>>;
51
- };
52
- /**
53
- * Creates sign-up handler.
54
- *
55
- * @template TUser - User type
56
- * @template TSession - Session type
57
- * @param config - Handler configuration
58
- * @returns Sign-up handler
59
- */
60
- export declare function createSignUpHandler<TUser extends User = User, TSession extends Session<TUser> = Session<TUser>>(config: AuthHandlersConfig<TUser, TSession>): (data: RegisterData) => Promise<AuthResult<TUser, TSession>>;
61
- /**
62
- * TODO: Performance
63
- * - [ ] Add request deduplication for concurrent sign-in attempts
64
- * - [ ] Implement rate limiting per email/IP
65
- * - [ ] Add sign-in attempt caching
66
- * - [ ] Optimize validation logic
67
- *
68
- * TODO: Features
69
- * - [ ] Add social login account linking
70
- * - [ ] Implement sign-in with magic link
71
- * - [ ] Add biometric authentication support
72
- * - [ ] Create sign-in attempt tracking
73
- *
74
- * TODO: Type Safety
75
- * - [ ] Add runtime validation for all inputs
76
- * - [ ] Create type-safe credential builders
77
- * - [ ] Implement compile-time provider validation
78
- *
79
- * TODO: Security
80
- * - [ ] Add CAPTCHA support for repeated failures
81
- * - [ ] Implement account lockout after failed attempts
82
- * - [ ] Add device fingerprinting
83
- * - [ ] Create security event logging
84
- *
85
- * TODO: Testing
86
- * - [ ] Add comprehensive handler tests
87
- * - [ ] Test all validation scenarios
88
- * - [ ] Test error handling
89
- * - [ ] Add integration tests
90
- *
91
- * TODO: Documentation
92
- * - [ ] Document all sign-in methods
93
- * - [ ] Add usage examples
94
- * - [ ] Create troubleshooting guide
95
- *
96
- * TODO: Limitations
97
- * - [ ] Input validation is basic (consider schema validation)
98
- * - [ ] No support for custom validation rules
99
- * - [ ] Error messages may be too generic
100
- */
@@ -1,58 +0,0 @@
1
- import { SessionConfig } from '../types';
2
- import { TokenRefreshConfig } from '../client/token-refresh-manager';
3
- /**
4
- * Default session configuration.
5
- *
6
- * Auto-detects environment and applies secure defaults.
7
- *
8
- * @returns Default session configuration
9
- */
10
- export declare function getDefaultSessionConfig(): SessionConfig;
11
- /**
12
- * Default token refresh configuration.
13
- *
14
- * Optimized to prevent infinite loops and improve performance.
15
- *
16
- * @returns Default token refresh configuration
17
- */
18
- export declare function getDefaultTokenRefreshConfig(): TokenRefreshConfig;
19
- /**
20
- * Gets the base URL for OAuth redirects.
21
- *
22
- * Detects the base URL from environment variables or defaults to localhost.
23
- *
24
- * @returns Base URL string
25
- */
26
- export declare function getBaseUrl(): string;
27
- /**
28
- * TODO: Performance
29
- * - [ ] Cache base URL detection result
30
- * - [ ] Add configuration validation at startup
31
- * - [ ] Implement configuration hot-reload support
32
- *
33
- * TODO: Features
34
- * - [ ] Add environment-specific configuration presets
35
- * - [ ] Create configuration builder pattern
36
- * - [ ] Add configuration schema validation
37
- * - [ ] Implement configuration inheritance
38
- *
39
- * TODO: Type Safety
40
- * - [ ] Add type-level validation for configuration values
41
- * - [ ] Create branded types for configuration
42
- * - [ ] Implement compile-time configuration checking
43
- *
44
- * TODO: Testing
45
- * - [ ] Add tests for default configurations
46
- * - [ ] Test environment detection
47
- * - [ ] Test configuration merging
48
- *
49
- * TODO: Documentation
50
- * - [ ] Document all default values
51
- * - [ ] Add configuration examples
52
- * - [ ] Create configuration reference guide
53
- *
54
- * TODO: Limitations
55
- * - [ ] Base URL detection is basic (consider more sophisticated detection)
56
- * - [ ] No configuration validation at runtime
57
- * - [ ] Defaults are fixed (consider configurable defaults)
58
- */
@@ -1,9 +0,0 @@
1
- /**
2
- * Mulguard core modules.
3
- *
4
- * @module @mulguard/core/mulguard
5
- */
6
- export * from './defaults';
7
- export * from './session-manager';
8
- export * from './auth-handlers';
9
- export * from './oauth-handler';
@@ -1,104 +0,0 @@
1
- import { MulguardConfig, User, Session, EmailCredentials } from '../types';
2
- import { SecurityManager } from '../security/security-manager';
3
- import { SessionManager as CoreSessionManager } from '../session/session-manager';
4
- import { EmailPasswordAuth } from '../auth/email-password';
5
- import { OTPAuth } from '../auth/otp';
6
- import { OAuthHandler } from '../auth/oauth/oauth-handler';
7
- import { Logger } from '../logger';
8
- /**
9
- * Core modules integration configuration.
10
- */
11
- export interface CoreModulesIntegrationConfig<TUser extends User = User, TSession extends Session<TUser> = Session<TUser>> {
12
- readonly config: MulguardConfig<TUser, TSession>;
13
- readonly baseUrl: string;
14
- }
15
- /**
16
- * Integrated core modules instance.
17
- */
18
- export interface IntegratedCoreModules {
19
- readonly security: SecurityManager;
20
- readonly session: CoreSessionManager;
21
- readonly emailPassword: EmailPasswordAuth;
22
- readonly otp: OTPAuth;
23
- readonly oauth: OAuthHandler | null;
24
- readonly logger: Logger;
25
- }
26
- /**
27
- * Creates integrated core modules for Mulguard instance.
28
- *
29
- * Initializes and configures all core modules with proper dependencies.
30
- *
31
- * @template TUser - User type
32
- * @template TSession - Session type
33
- * @param integrationConfig - Integration configuration
34
- * @returns Integrated core modules
35
- *
36
- * @example
37
- * ```typescript
38
- * const modules = createCoreModulesIntegration({
39
- * config: mulguardConfig,
40
- * baseUrl: 'https://example.com',
41
- * })
42
- *
43
- * // Use modules.security, modules.session, etc.
44
- * ```
45
- */
46
- export declare function createCoreModulesIntegration<TUser extends User = User, TSession extends Session<TUser> = Session<TUser>>(integrationConfig: CoreModulesIntegrationConfig<TUser, TSession>): IntegratedCoreModules;
47
- /**
48
- * Creates a wrapper for custom email/password action that uses EmailPasswordAuth.
49
- *
50
- * @template TUser - User type
51
- * @template TSession - Session type
52
- * @param emailPassword - EmailPasswordAuth instance
53
- * @param customAction - Custom action from config
54
- * @returns Wrapped action that uses EmailPasswordAuth for validation
55
- */
56
- export declare function wrapEmailPasswordAction<TUser extends User = User, TSession extends Session<TUser> = Session<TUser>>(emailPassword: EmailPasswordAuth, customAction: (credentials: EmailCredentials) => Promise<import('../types').AuthResult<TUser, TSession>>): (credentials: EmailCredentials) => Promise<import('../types').AuthResult<TUser, TSession>>;
57
- /**
58
- * Creates a wrapper for custom OTP action that uses OTPAuth.
59
- *
60
- * @template TUser - User type
61
- * @template TSession - Session type
62
- * @param otp - OTPAuth instance
63
- * @param customAction - Custom action from config
64
- * @returns Wrapped action that uses OTPAuth for validation
65
- */
66
- export declare function wrapOTPAction<TUser extends User = User, TSession extends Session<TUser> = Session<TUser>>(otp: OTPAuth, customAction: (email: string, code?: string) => Promise<import('../types').AuthResult<TUser, TSession>>): (email: string, code?: string) => Promise<import('../types').AuthResult<TUser, TSession>>;
67
- export type { SecurityManager, SecurityConfig } from '../security/security-manager';
68
- export type { SessionManager, SessionManagerConfig } from '../session/session-manager';
69
- export type { EmailPasswordAuth, EmailPasswordConfig } from '../auth/email-password';
70
- export type { OTPAuth, OTPConfig } from '../auth/otp';
71
- export type { OAuthHandler, OAuthHandlerConfig } from '../auth/oauth/oauth-handler';
72
- /**
73
- * TODO: Performance
74
- * - [ ] Add module initialization caching
75
- * - [ ] Optimize module dependency resolution
76
- * - [ ] Add lazy module loading
77
- * - [ ] Implement module pooling
78
- *
79
- * TODO: Features
80
- * - [ ] Add module health checks
81
- * - [ ] Implement module reloading
82
- * - [ ] Create module dependency graph
83
- * - [ ] Add module metrics collection
84
- *
85
- * TODO: Type Safety
86
- * - [ ] Add type-safe module configuration
87
- * - [ ] Create compile-time module validation
88
- * - [ ] Implement type-level dependency checking
89
- *
90
- * TODO: Testing
91
- * - [ ] Add integration tests for module initialization
92
- * - [ ] Test module dependency resolution
93
- * - [ ] Test module error handling
94
- *
95
- * TODO: Documentation
96
- * - [ ] Document module integration flow
97
- * - [ ] Add module configuration guide
98
- * - [ ] Create module troubleshooting guide
99
- *
100
- * TODO: Limitations
101
- * - [ ] Module initialization is synchronous (consider async initialization)
102
- * - [ ] No module dependency validation at runtime
103
- * - [ ] Module configuration is fixed (consider dynamic configuration)
104
- */