@go-mondo/identity-sdk 0.0.1-beta.2

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 (451) hide show
  1. package/.tsbuildinfo/cjs.json +1 -0
  2. package/.tsbuildinfo/esm.json +1 -0
  3. package/CHANGELOG.md +63 -0
  4. package/README.md +3 -0
  5. package/lib/cjs/action/index.d.ts +2 -0
  6. package/lib/cjs/action/index.d.ts.map +1 -0
  7. package/lib/cjs/action/index.js +17 -0
  8. package/lib/cjs/action/schema/base.d.ts +21 -0
  9. package/lib/cjs/action/schema/base.d.ts.map +1 -0
  10. package/lib/cjs/action/schema/base.js +19 -0
  11. package/lib/cjs/action/schema/operations/set-password.d.ts +31 -0
  12. package/lib/cjs/action/schema/operations/set-password.d.ts.map +1 -0
  13. package/lib/cjs/action/schema/operations/set-password.js +18 -0
  14. package/lib/cjs/action/schema/operations/sign-up-verification.d.ts +22 -0
  15. package/lib/cjs/action/schema/operations/sign-up-verification.d.ts.map +1 -0
  16. package/lib/cjs/action/schema/operations/sign-up-verification.js +15 -0
  17. package/lib/cjs/action/schema/operations/sign-up.d.ts +44 -0
  18. package/lib/cjs/action/schema/operations/sign-up.d.ts.map +1 -0
  19. package/lib/cjs/action/schema/operations/sign-up.js +21 -0
  20. package/lib/cjs/action/schema/operations/user-attribute-verification.d.ts +20 -0
  21. package/lib/cjs/action/schema/operations/user-attribute-verification.d.ts.map +1 -0
  22. package/lib/cjs/action/schema/operations/user-attribute-verification.js +13 -0
  23. package/lib/cjs/action/schema/schema.d.ts +92 -0
  24. package/lib/cjs/action/schema/schema.d.ts.map +1 -0
  25. package/lib/cjs/action/schema/schema.js +40 -0
  26. package/lib/cjs/activity/index.d.ts +2 -0
  27. package/lib/cjs/activity/index.d.ts.map +1 -0
  28. package/lib/cjs/activity/index.js +17 -0
  29. package/lib/cjs/activity/schema/base.d.ts +54 -0
  30. package/lib/cjs/activity/schema/base.d.ts.map +1 -0
  31. package/lib/cjs/activity/schema/base.js +34 -0
  32. package/lib/cjs/activity/schema/schema.d.ts +156 -0
  33. package/lib/cjs/activity/schema/schema.d.ts.map +1 -0
  34. package/lib/cjs/activity/schema/schema.js +54 -0
  35. package/lib/cjs/activity/schema/types/authentication.d.ts +29 -0
  36. package/lib/cjs/activity/schema/types/authentication.d.ts.map +1 -0
  37. package/lib/cjs/activity/schema/types/authentication.js +16 -0
  38. package/lib/cjs/activity/schema/types/authorization.d.ts +29 -0
  39. package/lib/cjs/activity/schema/types/authorization.d.ts.map +1 -0
  40. package/lib/cjs/activity/schema/types/authorization.js +17 -0
  41. package/lib/cjs/activity/schema/types/note.d.ts +51 -0
  42. package/lib/cjs/activity/schema/types/note.d.ts.map +1 -0
  43. package/lib/cjs/activity/schema/types/note.js +17 -0
  44. package/lib/cjs/activity/schema/types/operation.d.ts +31 -0
  45. package/lib/cjs/activity/schema/types/operation.d.ts.map +1 -0
  46. package/lib/cjs/activity/schema/types/operation.js +18 -0
  47. package/lib/cjs/activity/schema/types/unknown.d.ts +22 -0
  48. package/lib/cjs/activity/schema/types/unknown.d.ts.map +1 -0
  49. package/lib/cjs/activity/schema/types/unknown.js +9 -0
  50. package/lib/cjs/activity/schema/utils.d.ts +7 -0
  51. package/lib/cjs/activity/schema/utils.d.ts.map +1 -0
  52. package/lib/cjs/activity/schema/utils.js +16 -0
  53. package/lib/cjs/app/index.d.ts +2 -0
  54. package/lib/cjs/app/index.d.ts.map +1 -0
  55. package/lib/cjs/app/index.js +17 -0
  56. package/lib/cjs/app/schema/app.d.ts +58 -0
  57. package/lib/cjs/app/schema/app.d.ts.map +1 -0
  58. package/lib/cjs/app/schema/app.js +43 -0
  59. package/lib/cjs/app/schema/authorization.d.ts +37 -0
  60. package/lib/cjs/app/schema/authorization.d.ts.map +1 -0
  61. package/lib/cjs/app/schema/authorization.js +44 -0
  62. package/lib/cjs/app/schema/oauth.d.ts +30 -0
  63. package/lib/cjs/app/schema/oauth.d.ts.map +1 -0
  64. package/lib/cjs/app/schema/oauth.js +21 -0
  65. package/lib/cjs/app/schema/oidc.d.ts +28 -0
  66. package/lib/cjs/app/schema/oidc.d.ts.map +1 -0
  67. package/lib/cjs/app/schema/oidc.js +13 -0
  68. package/lib/cjs/app/schema/registration.d.ts +22 -0
  69. package/lib/cjs/app/schema/registration.d.ts.map +1 -0
  70. package/lib/cjs/app/schema/registration.js +16 -0
  71. package/lib/cjs/app/schema/saml.d.ts +28 -0
  72. package/lib/cjs/app/schema/saml.d.ts.map +1 -0
  73. package/lib/cjs/app/schema/saml.js +13 -0
  74. package/lib/cjs/app/schema/schema.d.ts +8 -0
  75. package/lib/cjs/app/schema/schema.d.ts.map +1 -0
  76. package/lib/cjs/app/schema/schema.js +23 -0
  77. package/lib/cjs/app/schema/utils.d.ts +11 -0
  78. package/lib/cjs/app/schema/utils.d.ts.map +1 -0
  79. package/lib/cjs/app/schema/utils.js +23 -0
  80. package/lib/cjs/association/index.d.ts +2 -0
  81. package/lib/cjs/association/index.d.ts.map +1 -0
  82. package/lib/cjs/association/index.js +17 -0
  83. package/lib/cjs/association/schema/association.d.ts +79 -0
  84. package/lib/cjs/association/schema/association.d.ts.map +1 -0
  85. package/lib/cjs/association/schema/association.js +26 -0
  86. package/lib/cjs/association/schema/schema.d.ts +2 -0
  87. package/lib/cjs/association/schema/schema.d.ts.map +1 -0
  88. package/lib/cjs/association/schema/schema.js +17 -0
  89. package/lib/cjs/authentication/index.d.ts +2 -0
  90. package/lib/cjs/authentication/index.d.ts.map +1 -0
  91. package/lib/cjs/authentication/index.js +17 -0
  92. package/lib/cjs/authentication/schema/factors.d.ts +48 -0
  93. package/lib/cjs/authentication/schema/factors.d.ts.map +1 -0
  94. package/lib/cjs/authentication/schema/factors.js +28 -0
  95. package/lib/cjs/authentication/schema/factors.test.d.ts +2 -0
  96. package/lib/cjs/authentication/schema/factors.test.d.ts.map +1 -0
  97. package/lib/cjs/authentication/schema/factors.test.js +123 -0
  98. package/lib/cjs/authentication/schema/provider.d.ts +27 -0
  99. package/lib/cjs/authentication/schema/provider.d.ts.map +1 -0
  100. package/lib/cjs/authentication/schema/provider.js +24 -0
  101. package/lib/cjs/authentication/schema/schema.d.ts +6 -0
  102. package/lib/cjs/authentication/schema/schema.d.ts.map +1 -0
  103. package/lib/cjs/authentication/schema/schema.js +21 -0
  104. package/lib/cjs/authentication/schema/session.d.ts +59 -0
  105. package/lib/cjs/authentication/schema/session.d.ts.map +1 -0
  106. package/lib/cjs/authentication/schema/session.js +46 -0
  107. package/lib/cjs/authentication/schema/settings.d.ts +46 -0
  108. package/lib/cjs/authentication/schema/settings.d.ts.map +1 -0
  109. package/lib/cjs/authentication/schema/settings.js +16 -0
  110. package/lib/cjs/authentication/schema/strategy/base.d.ts +43 -0
  111. package/lib/cjs/authentication/schema/strategy/base.d.ts.map +1 -0
  112. package/lib/cjs/authentication/schema/strategy/base.js +31 -0
  113. package/lib/cjs/authentication/schema/strategy/schema.d.ts +169 -0
  114. package/lib/cjs/authentication/schema/strategy/schema.d.ts.map +1 -0
  115. package/lib/cjs/authentication/schema/strategy/schema.js +46 -0
  116. package/lib/cjs/authentication/schema/strategy/types/email.d.ts +44 -0
  117. package/lib/cjs/authentication/schema/strategy/types/email.d.ts.map +1 -0
  118. package/lib/cjs/authentication/schema/strategy/types/email.js +20 -0
  119. package/lib/cjs/authentication/schema/strategy/types/password.d.ts +99 -0
  120. package/lib/cjs/authentication/schema/strategy/types/password.d.ts.map +1 -0
  121. package/lib/cjs/authentication/schema/strategy/types/password.js +35 -0
  122. package/lib/cjs/authentication/schema/strategy/types/totp.d.ts +91 -0
  123. package/lib/cjs/authentication/schema/strategy/types/totp.d.ts.map +1 -0
  124. package/lib/cjs/authentication/schema/strategy/types/totp.js +48 -0
  125. package/lib/cjs/authorization/index.d.ts +2 -0
  126. package/lib/cjs/authorization/index.d.ts.map +1 -0
  127. package/lib/cjs/authorization/index.js +17 -0
  128. package/lib/cjs/authorization/schema/permission.d.ts +69 -0
  129. package/lib/cjs/authorization/schema/permission.d.ts.map +1 -0
  130. package/lib/cjs/authorization/schema/permission.js +50 -0
  131. package/lib/cjs/authorization/schema/role.d.ts +74 -0
  132. package/lib/cjs/authorization/schema/role.d.ts.map +1 -0
  133. package/lib/cjs/authorization/schema/role.js +52 -0
  134. package/lib/cjs/authorization/schema/schema.d.ts +4 -0
  135. package/lib/cjs/authorization/schema/schema.d.ts.map +1 -0
  136. package/lib/cjs/authorization/schema/schema.js +19 -0
  137. package/lib/cjs/authorization/schema/utils.d.ts +11 -0
  138. package/lib/cjs/authorization/schema/utils.d.ts.map +1 -0
  139. package/lib/cjs/authorization/schema/utils.js +23 -0
  140. package/lib/cjs/common/index.d.ts +2 -0
  141. package/lib/cjs/common/index.d.ts.map +1 -0
  142. package/lib/cjs/common/index.js +17 -0
  143. package/lib/cjs/common/schema/aggregate.d.ts +6 -0
  144. package/lib/cjs/common/schema/aggregate.d.ts.map +1 -0
  145. package/lib/cjs/common/schema/aggregate.js +8 -0
  146. package/lib/cjs/common/schema/dates.d.ts +39 -0
  147. package/lib/cjs/common/schema/dates.d.ts.map +1 -0
  148. package/lib/cjs/common/schema/dates.js +34 -0
  149. package/lib/cjs/common/schema/dates.test.d.ts +2 -0
  150. package/lib/cjs/common/schema/dates.test.d.ts.map +1 -0
  151. package/lib/cjs/common/schema/dates.test.js +33 -0
  152. package/lib/cjs/common/schema/jwt.d.ts +21 -0
  153. package/lib/cjs/common/schema/jwt.d.ts.map +1 -0
  154. package/lib/cjs/common/schema/jwt.js +24 -0
  155. package/lib/cjs/common/schema/metadata.d.ts +42 -0
  156. package/lib/cjs/common/schema/metadata.d.ts.map +1 -0
  157. package/lib/cjs/common/schema/metadata.js +88 -0
  158. package/lib/cjs/common/schema/metadata.test.d.ts +2 -0
  159. package/lib/cjs/common/schema/metadata.test.d.ts.map +1 -0
  160. package/lib/cjs/common/schema/metadata.test.js +62 -0
  161. package/lib/cjs/common/schema/schema.d.ts +5 -0
  162. package/lib/cjs/common/schema/schema.d.ts.map +1 -0
  163. package/lib/cjs/common/schema/schema.js +20 -0
  164. package/lib/cjs/customer/index.d.ts +2 -0
  165. package/lib/cjs/customer/index.d.ts.map +1 -0
  166. package/lib/cjs/customer/index.js +17 -0
  167. package/lib/cjs/customer/schema/organization.d.ts +54 -0
  168. package/lib/cjs/customer/schema/organization.d.ts.map +1 -0
  169. package/lib/cjs/customer/schema/organization.js +40 -0
  170. package/lib/cjs/customer/schema/schema.d.ts +4 -0
  171. package/lib/cjs/customer/schema/schema.d.ts.map +1 -0
  172. package/lib/cjs/customer/schema/schema.js +19 -0
  173. package/lib/cjs/customer/schema/user.d.ts +122 -0
  174. package/lib/cjs/customer/schema/user.d.ts.map +1 -0
  175. package/lib/cjs/customer/schema/user.js +83 -0
  176. package/lib/cjs/customer/schema/user.test.d.ts +2 -0
  177. package/lib/cjs/customer/schema/user.test.d.ts.map +1 -0
  178. package/lib/cjs/customer/schema/user.test.js +57 -0
  179. package/lib/cjs/customer/schema/utils.d.ts +11 -0
  180. package/lib/cjs/customer/schema/utils.d.ts.map +1 -0
  181. package/lib/cjs/customer/schema/utils.js +23 -0
  182. package/lib/cjs/identity/index.d.ts +2 -0
  183. package/lib/cjs/identity/index.d.ts.map +1 -0
  184. package/lib/cjs/identity/index.js +17 -0
  185. package/lib/cjs/identity/schema/schema.d.ts +7 -0
  186. package/lib/cjs/identity/schema/schema.d.ts.map +1 -0
  187. package/lib/cjs/identity/schema/schema.js +9 -0
  188. package/lib/cjs/oauth/index.d.ts +2 -0
  189. package/lib/cjs/oauth/index.d.ts.map +1 -0
  190. package/lib/cjs/oauth/index.js +17 -0
  191. package/lib/cjs/oauth/schema/schema.d.ts +8 -0
  192. package/lib/cjs/oauth/schema/schema.d.ts.map +1 -0
  193. package/lib/cjs/oauth/schema/schema.js +9 -0
  194. package/lib/cjs/package.json +1 -0
  195. package/lib/cjs/workspace/index.d.ts +2 -0
  196. package/lib/cjs/workspace/index.d.ts.map +1 -0
  197. package/lib/cjs/workspace/index.js +17 -0
  198. package/lib/cjs/workspace/schema/authorization.d.ts +31 -0
  199. package/lib/cjs/workspace/schema/authorization.d.ts.map +1 -0
  200. package/lib/cjs/workspace/schema/authorization.js +22 -0
  201. package/lib/cjs/workspace/schema/branding.d.ts +38 -0
  202. package/lib/cjs/workspace/schema/branding.d.ts.map +1 -0
  203. package/lib/cjs/workspace/schema/branding.js +25 -0
  204. package/lib/cjs/workspace/schema/membership.d.ts +25 -0
  205. package/lib/cjs/workspace/schema/membership.d.ts.map +1 -0
  206. package/lib/cjs/workspace/schema/membership.js +19 -0
  207. package/lib/cjs/workspace/schema/registration.d.ts +28 -0
  208. package/lib/cjs/workspace/schema/registration.d.ts.map +1 -0
  209. package/lib/cjs/workspace/schema/registration.js +22 -0
  210. package/lib/cjs/workspace/schema/schema.d.ts +10 -0
  211. package/lib/cjs/workspace/schema/schema.d.ts.map +1 -0
  212. package/lib/cjs/workspace/schema/schema.js +25 -0
  213. package/lib/cjs/workspace/schema/settings.d.ts +23 -0
  214. package/lib/cjs/workspace/schema/settings.d.ts.map +1 -0
  215. package/lib/cjs/workspace/schema/settings.js +15 -0
  216. package/lib/cjs/workspace/schema/tenant.d.ts +57 -0
  217. package/lib/cjs/workspace/schema/tenant.d.ts.map +1 -0
  218. package/lib/cjs/workspace/schema/tenant.js +26 -0
  219. package/lib/cjs/workspace/schema/user-notification.d.ts +62 -0
  220. package/lib/cjs/workspace/schema/user-notification.d.ts.map +1 -0
  221. package/lib/cjs/workspace/schema/user-notification.js +44 -0
  222. package/lib/cjs/workspace/schema/user-preferences.d.ts +26 -0
  223. package/lib/cjs/workspace/schema/user-preferences.d.ts.map +1 -0
  224. package/lib/cjs/workspace/schema/user-preferences.js +19 -0
  225. package/lib/cjs/workspace/schema/utils.d.ts +15 -0
  226. package/lib/cjs/workspace/schema/utils.d.ts.map +1 -0
  227. package/lib/cjs/workspace/schema/utils.js +64 -0
  228. package/lib/esm/action/index.d.ts +2 -0
  229. package/lib/esm/action/index.d.ts.map +1 -0
  230. package/lib/esm/action/index.js +1 -0
  231. package/lib/esm/action/schema/base.d.ts +21 -0
  232. package/lib/esm/action/schema/base.d.ts.map +1 -0
  233. package/lib/esm/action/schema/base.js +16 -0
  234. package/lib/esm/action/schema/operations/set-password.d.ts +31 -0
  235. package/lib/esm/action/schema/operations/set-password.d.ts.map +1 -0
  236. package/lib/esm/action/schema/operations/set-password.js +15 -0
  237. package/lib/esm/action/schema/operations/sign-up-verification.d.ts +22 -0
  238. package/lib/esm/action/schema/operations/sign-up-verification.d.ts.map +1 -0
  239. package/lib/esm/action/schema/operations/sign-up-verification.js +12 -0
  240. package/lib/esm/action/schema/operations/sign-up.d.ts +44 -0
  241. package/lib/esm/action/schema/operations/sign-up.d.ts.map +1 -0
  242. package/lib/esm/action/schema/operations/sign-up.js +18 -0
  243. package/lib/esm/action/schema/operations/user-attribute-verification.d.ts +20 -0
  244. package/lib/esm/action/schema/operations/user-attribute-verification.d.ts.map +1 -0
  245. package/lib/esm/action/schema/operations/user-attribute-verification.js +10 -0
  246. package/lib/esm/action/schema/schema.d.ts +92 -0
  247. package/lib/esm/action/schema/schema.d.ts.map +1 -0
  248. package/lib/esm/action/schema/schema.js +21 -0
  249. package/lib/esm/activity/index.d.ts +2 -0
  250. package/lib/esm/activity/index.d.ts.map +1 -0
  251. package/lib/esm/activity/index.js +1 -0
  252. package/lib/esm/activity/schema/base.d.ts +54 -0
  253. package/lib/esm/activity/schema/base.d.ts.map +1 -0
  254. package/lib/esm/activity/schema/base.js +31 -0
  255. package/lib/esm/activity/schema/schema.d.ts +156 -0
  256. package/lib/esm/activity/schema/schema.d.ts.map +1 -0
  257. package/lib/esm/activity/schema/schema.js +33 -0
  258. package/lib/esm/activity/schema/types/authentication.d.ts +29 -0
  259. package/lib/esm/activity/schema/types/authentication.d.ts.map +1 -0
  260. package/lib/esm/activity/schema/types/authentication.js +13 -0
  261. package/lib/esm/activity/schema/types/authorization.d.ts +29 -0
  262. package/lib/esm/activity/schema/types/authorization.d.ts.map +1 -0
  263. package/lib/esm/activity/schema/types/authorization.js +14 -0
  264. package/lib/esm/activity/schema/types/note.d.ts +51 -0
  265. package/lib/esm/activity/schema/types/note.d.ts.map +1 -0
  266. package/lib/esm/activity/schema/types/note.js +14 -0
  267. package/lib/esm/activity/schema/types/operation.d.ts +31 -0
  268. package/lib/esm/activity/schema/types/operation.d.ts.map +1 -0
  269. package/lib/esm/activity/schema/types/operation.js +15 -0
  270. package/lib/esm/activity/schema/types/unknown.d.ts +22 -0
  271. package/lib/esm/activity/schema/types/unknown.d.ts.map +1 -0
  272. package/lib/esm/activity/schema/types/unknown.js +6 -0
  273. package/lib/esm/activity/schema/utils.d.ts +7 -0
  274. package/lib/esm/activity/schema/utils.d.ts.map +1 -0
  275. package/lib/esm/activity/schema/utils.js +9 -0
  276. package/lib/esm/app/index.d.ts +2 -0
  277. package/lib/esm/app/index.d.ts.map +1 -0
  278. package/lib/esm/app/index.js +1 -0
  279. package/lib/esm/app/schema/app.d.ts +58 -0
  280. package/lib/esm/app/schema/app.d.ts.map +1 -0
  281. package/lib/esm/app/schema/app.js +40 -0
  282. package/lib/esm/app/schema/authorization.d.ts +37 -0
  283. package/lib/esm/app/schema/authorization.d.ts.map +1 -0
  284. package/lib/esm/app/schema/authorization.js +41 -0
  285. package/lib/esm/app/schema/oauth.d.ts +30 -0
  286. package/lib/esm/app/schema/oauth.d.ts.map +1 -0
  287. package/lib/esm/app/schema/oauth.js +18 -0
  288. package/lib/esm/app/schema/oidc.d.ts +28 -0
  289. package/lib/esm/app/schema/oidc.d.ts.map +1 -0
  290. package/lib/esm/app/schema/oidc.js +10 -0
  291. package/lib/esm/app/schema/registration.d.ts +22 -0
  292. package/lib/esm/app/schema/registration.d.ts.map +1 -0
  293. package/lib/esm/app/schema/registration.js +13 -0
  294. package/lib/esm/app/schema/saml.d.ts +28 -0
  295. package/lib/esm/app/schema/saml.d.ts.map +1 -0
  296. package/lib/esm/app/schema/saml.js +10 -0
  297. package/lib/esm/app/schema/schema.d.ts +8 -0
  298. package/lib/esm/app/schema/schema.d.ts.map +1 -0
  299. package/lib/esm/app/schema/schema.js +7 -0
  300. package/lib/esm/app/schema/utils.d.ts +11 -0
  301. package/lib/esm/app/schema/utils.d.ts.map +1 -0
  302. package/lib/esm/app/schema/utils.js +15 -0
  303. package/lib/esm/association/index.d.ts +2 -0
  304. package/lib/esm/association/index.d.ts.map +1 -0
  305. package/lib/esm/association/index.js +1 -0
  306. package/lib/esm/association/schema/association.d.ts +79 -0
  307. package/lib/esm/association/schema/association.d.ts.map +1 -0
  308. package/lib/esm/association/schema/association.js +23 -0
  309. package/lib/esm/association/schema/schema.d.ts +2 -0
  310. package/lib/esm/association/schema/schema.d.ts.map +1 -0
  311. package/lib/esm/association/schema/schema.js +1 -0
  312. package/lib/esm/authentication/index.d.ts +2 -0
  313. package/lib/esm/authentication/index.d.ts.map +1 -0
  314. package/lib/esm/authentication/index.js +1 -0
  315. package/lib/esm/authentication/schema/factors.d.ts +48 -0
  316. package/lib/esm/authentication/schema/factors.d.ts.map +1 -0
  317. package/lib/esm/authentication/schema/factors.js +25 -0
  318. package/lib/esm/authentication/schema/factors.test.d.ts +2 -0
  319. package/lib/esm/authentication/schema/factors.test.d.ts.map +1 -0
  320. package/lib/esm/authentication/schema/factors.test.js +121 -0
  321. package/lib/esm/authentication/schema/provider.d.ts +27 -0
  322. package/lib/esm/authentication/schema/provider.d.ts.map +1 -0
  323. package/lib/esm/authentication/schema/provider.js +21 -0
  324. package/lib/esm/authentication/schema/schema.d.ts +6 -0
  325. package/lib/esm/authentication/schema/schema.d.ts.map +1 -0
  326. package/lib/esm/authentication/schema/schema.js +5 -0
  327. package/lib/esm/authentication/schema/session.d.ts +59 -0
  328. package/lib/esm/authentication/schema/session.d.ts.map +1 -0
  329. package/lib/esm/authentication/schema/session.js +43 -0
  330. package/lib/esm/authentication/schema/settings.d.ts +46 -0
  331. package/lib/esm/authentication/schema/settings.d.ts.map +1 -0
  332. package/lib/esm/authentication/schema/settings.js +13 -0
  333. package/lib/esm/authentication/schema/strategy/base.d.ts +43 -0
  334. package/lib/esm/authentication/schema/strategy/base.d.ts.map +1 -0
  335. package/lib/esm/authentication/schema/strategy/base.js +28 -0
  336. package/lib/esm/authentication/schema/strategy/schema.d.ts +169 -0
  337. package/lib/esm/authentication/schema/strategy/schema.d.ts.map +1 -0
  338. package/lib/esm/authentication/schema/strategy/schema.js +22 -0
  339. package/lib/esm/authentication/schema/strategy/types/email.d.ts +44 -0
  340. package/lib/esm/authentication/schema/strategy/types/email.d.ts.map +1 -0
  341. package/lib/esm/authentication/schema/strategy/types/email.js +17 -0
  342. package/lib/esm/authentication/schema/strategy/types/password.d.ts +99 -0
  343. package/lib/esm/authentication/schema/strategy/types/password.d.ts.map +1 -0
  344. package/lib/esm/authentication/schema/strategy/types/password.js +32 -0
  345. package/lib/esm/authentication/schema/strategy/types/totp.d.ts +91 -0
  346. package/lib/esm/authentication/schema/strategy/types/totp.d.ts.map +1 -0
  347. package/lib/esm/authentication/schema/strategy/types/totp.js +45 -0
  348. package/lib/esm/authorization/index.d.ts +2 -0
  349. package/lib/esm/authorization/index.d.ts.map +1 -0
  350. package/lib/esm/authorization/index.js +1 -0
  351. package/lib/esm/authorization/schema/permission.d.ts +69 -0
  352. package/lib/esm/authorization/schema/permission.d.ts.map +1 -0
  353. package/lib/esm/authorization/schema/permission.js +47 -0
  354. package/lib/esm/authorization/schema/role.d.ts +74 -0
  355. package/lib/esm/authorization/schema/role.d.ts.map +1 -0
  356. package/lib/esm/authorization/schema/role.js +49 -0
  357. package/lib/esm/authorization/schema/schema.d.ts +4 -0
  358. package/lib/esm/authorization/schema/schema.d.ts.map +1 -0
  359. package/lib/esm/authorization/schema/schema.js +3 -0
  360. package/lib/esm/authorization/schema/utils.d.ts +11 -0
  361. package/lib/esm/authorization/schema/utils.d.ts.map +1 -0
  362. package/lib/esm/authorization/schema/utils.js +15 -0
  363. package/lib/esm/common/index.d.ts +2 -0
  364. package/lib/esm/common/index.d.ts.map +1 -0
  365. package/lib/esm/common/index.js +1 -0
  366. package/lib/esm/common/schema/aggregate.d.ts +6 -0
  367. package/lib/esm/common/schema/aggregate.d.ts.map +1 -0
  368. package/lib/esm/common/schema/aggregate.js +5 -0
  369. package/lib/esm/common/schema/dates.d.ts +39 -0
  370. package/lib/esm/common/schema/dates.d.ts.map +1 -0
  371. package/lib/esm/common/schema/dates.js +31 -0
  372. package/lib/esm/common/schema/dates.test.d.ts +2 -0
  373. package/lib/esm/common/schema/dates.test.d.ts.map +1 -0
  374. package/lib/esm/common/schema/dates.test.js +31 -0
  375. package/lib/esm/common/schema/jwt.d.ts +21 -0
  376. package/lib/esm/common/schema/jwt.d.ts.map +1 -0
  377. package/lib/esm/common/schema/jwt.js +21 -0
  378. package/lib/esm/common/schema/metadata.d.ts +42 -0
  379. package/lib/esm/common/schema/metadata.d.ts.map +1 -0
  380. package/lib/esm/common/schema/metadata.js +83 -0
  381. package/lib/esm/common/schema/metadata.test.d.ts +2 -0
  382. package/lib/esm/common/schema/metadata.test.d.ts.map +1 -0
  383. package/lib/esm/common/schema/metadata.test.js +60 -0
  384. package/lib/esm/common/schema/schema.d.ts +5 -0
  385. package/lib/esm/common/schema/schema.d.ts.map +1 -0
  386. package/lib/esm/common/schema/schema.js +4 -0
  387. package/lib/esm/customer/index.d.ts +2 -0
  388. package/lib/esm/customer/index.d.ts.map +1 -0
  389. package/lib/esm/customer/index.js +1 -0
  390. package/lib/esm/customer/schema/organization.d.ts +54 -0
  391. package/lib/esm/customer/schema/organization.d.ts.map +1 -0
  392. package/lib/esm/customer/schema/organization.js +37 -0
  393. package/lib/esm/customer/schema/schema.d.ts +4 -0
  394. package/lib/esm/customer/schema/schema.d.ts.map +1 -0
  395. package/lib/esm/customer/schema/schema.js +3 -0
  396. package/lib/esm/customer/schema/user.d.ts +122 -0
  397. package/lib/esm/customer/schema/user.d.ts.map +1 -0
  398. package/lib/esm/customer/schema/user.js +80 -0
  399. package/lib/esm/customer/schema/user.test.d.ts +2 -0
  400. package/lib/esm/customer/schema/user.test.d.ts.map +1 -0
  401. package/lib/esm/customer/schema/user.test.js +55 -0
  402. package/lib/esm/customer/schema/utils.d.ts +11 -0
  403. package/lib/esm/customer/schema/utils.d.ts.map +1 -0
  404. package/lib/esm/customer/schema/utils.js +15 -0
  405. package/lib/esm/identity/index.d.ts +2 -0
  406. package/lib/esm/identity/index.d.ts.map +1 -0
  407. package/lib/esm/identity/index.js +1 -0
  408. package/lib/esm/identity/schema/schema.d.ts +7 -0
  409. package/lib/esm/identity/schema/schema.d.ts.map +1 -0
  410. package/lib/esm/identity/schema/schema.js +6 -0
  411. package/lib/esm/oauth/index.d.ts +2 -0
  412. package/lib/esm/oauth/index.d.ts.map +1 -0
  413. package/lib/esm/oauth/index.js +1 -0
  414. package/lib/esm/oauth/schema/schema.d.ts +8 -0
  415. package/lib/esm/oauth/schema/schema.d.ts.map +1 -0
  416. package/lib/esm/oauth/schema/schema.js +6 -0
  417. package/lib/esm/package.json +1 -0
  418. package/lib/esm/workspace/index.d.ts +2 -0
  419. package/lib/esm/workspace/index.d.ts.map +1 -0
  420. package/lib/esm/workspace/index.js +1 -0
  421. package/lib/esm/workspace/schema/authorization.d.ts +31 -0
  422. package/lib/esm/workspace/schema/authorization.d.ts.map +1 -0
  423. package/lib/esm/workspace/schema/authorization.js +19 -0
  424. package/lib/esm/workspace/schema/branding.d.ts +38 -0
  425. package/lib/esm/workspace/schema/branding.d.ts.map +1 -0
  426. package/lib/esm/workspace/schema/branding.js +22 -0
  427. package/lib/esm/workspace/schema/membership.d.ts +25 -0
  428. package/lib/esm/workspace/schema/membership.d.ts.map +1 -0
  429. package/lib/esm/workspace/schema/membership.js +16 -0
  430. package/lib/esm/workspace/schema/registration.d.ts +28 -0
  431. package/lib/esm/workspace/schema/registration.d.ts.map +1 -0
  432. package/lib/esm/workspace/schema/registration.js +19 -0
  433. package/lib/esm/workspace/schema/schema.d.ts +10 -0
  434. package/lib/esm/workspace/schema/schema.d.ts.map +1 -0
  435. package/lib/esm/workspace/schema/schema.js +9 -0
  436. package/lib/esm/workspace/schema/settings.d.ts +23 -0
  437. package/lib/esm/workspace/schema/settings.d.ts.map +1 -0
  438. package/lib/esm/workspace/schema/settings.js +12 -0
  439. package/lib/esm/workspace/schema/tenant.d.ts +57 -0
  440. package/lib/esm/workspace/schema/tenant.d.ts.map +1 -0
  441. package/lib/esm/workspace/schema/tenant.js +23 -0
  442. package/lib/esm/workspace/schema/user-notification.d.ts +62 -0
  443. package/lib/esm/workspace/schema/user-notification.d.ts.map +1 -0
  444. package/lib/esm/workspace/schema/user-notification.js +41 -0
  445. package/lib/esm/workspace/schema/user-preferences.d.ts +26 -0
  446. package/lib/esm/workspace/schema/user-preferences.d.ts.map +1 -0
  447. package/lib/esm/workspace/schema/user-preferences.js +16 -0
  448. package/lib/esm/workspace/schema/utils.d.ts +15 -0
  449. package/lib/esm/workspace/schema/utils.d.ts.map +1 -0
  450. package/lib/esm/workspace/schema/utils.js +22 -0
  451. package/package.json +155 -0
@@ -0,0 +1,15 @@
1
+ import KSUID from 'ksuid';
2
+ export const Model = {
3
+ App: {
4
+ UIDPrefix: 'app',
5
+ },
6
+ OAuth: {
7
+ UIDPrefix: 'aoa',
8
+ },
9
+ };
10
+ export function generateAppId() {
11
+ return `${Model.App.UIDPrefix}_${KSUID.randomSync().string}`;
12
+ }
13
+ export function generateOAuthId() {
14
+ return `${Model.OAuth.UIDPrefix}_${KSUID.randomSync().string}`;
15
+ }
@@ -0,0 +1,2 @@
1
+ export * from './schema/schema.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/association/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './schema/schema.js';
@@ -0,0 +1,79 @@
1
+ export declare const AssociationIdReferenceSchema: import("arktype/internal/methods/object.ts").ObjectType<{
2
+ id: string;
3
+ }, {}>;
4
+ export type AssociationIdReference = typeof AssociationIdReferenceSchema.inferOut;
5
+ export declare const AssociationAttributesReferenceSchema: import("arktype/internal/methods/object.ts").ObjectType<{
6
+ [x: string]: unknown;
7
+ id: string;
8
+ }, {}>;
9
+ export type AssociationAttributesReference = typeof AssociationAttributesReferenceSchema.inferOut;
10
+ export type AssociationReference = AssociationIdReference | AssociationAttributesReference;
11
+ export declare const AssociationObjectSchema: import("arktype/internal/methods/object.ts").ObjectType<import("arktype/internal/methods/object.ts").ObjectType<{
12
+ id: string;
13
+ givenName?: string | undefined;
14
+ middleName?: string | undefined;
15
+ familyName?: string | undefined;
16
+ honorificPrefix?: string | undefined;
17
+ honorificSuffix?: string | undefined;
18
+ email?: ((In: string | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
19
+ phoneNumber?: string | undefined;
20
+ model: "User";
21
+ }, {}> | import("arktype/internal/methods/object.ts").ObjectType<{
22
+ id: string;
23
+ name: string;
24
+ model: "Organization";
25
+ }, {}>, {}>;
26
+ export type AssociationObject = typeof AssociationObjectSchema.inferOut;
27
+ export declare const ObjectPropertySchema: import("arktype/internal/methods/object.ts").ObjectType<{
28
+ object: import("arktype/internal/methods/object.ts").ObjectType<{
29
+ id: string;
30
+ givenName?: string | undefined;
31
+ middleName?: string | undefined;
32
+ familyName?: string | undefined;
33
+ honorificPrefix?: string | undefined;
34
+ honorificSuffix?: string | undefined;
35
+ email?: ((In: string | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
36
+ phoneNumber?: string | undefined;
37
+ model: "User";
38
+ }, {}> | import("arktype/internal/methods/object.ts").ObjectType<{
39
+ id: string;
40
+ name: string;
41
+ model: "Organization";
42
+ }, {}>;
43
+ }, {}>;
44
+ export declare const AssociationPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
45
+ updatedAt: (In: string | Date) => import("arktype/internal/attributes.ts").Out<string>;
46
+ deletedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
47
+ deactivatedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
48
+ object: import("arktype/internal/methods/object.ts").ObjectType<{
49
+ id: string;
50
+ givenName?: string | undefined;
51
+ middleName?: string | undefined;
52
+ familyName?: string | undefined;
53
+ honorificPrefix?: string | undefined;
54
+ honorificSuffix?: string | undefined;
55
+ email?: ((In: string | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
56
+ phoneNumber?: string | undefined;
57
+ model: "User";
58
+ }, {}> | import("arktype/internal/methods/object.ts").ObjectType<{
59
+ id: string;
60
+ name: string;
61
+ model: "Organization";
62
+ }, {}>;
63
+ metadata?: ((In: {
64
+ [x: string]: string | number | boolean;
65
+ } | Map<string, string | number | boolean> | null | undefined) => import("arktype/internal/attributes.ts").Out<{
66
+ [x: string]: string | number | boolean;
67
+ } | undefined>) | undefined;
68
+ }, {}>;
69
+ export type AssociationPayload = typeof AssociationPayloadSchema.inferOut;
70
+ export declare const UpsertAssociationPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
71
+ expiresAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
72
+ metadata?: ((In: {
73
+ [x: string]: string | number | boolean;
74
+ } | Map<string, string | number | boolean> | null | undefined) => import("arktype/internal/attributes.ts").Out<{
75
+ [x: string]: string | number | boolean;
76
+ } | undefined>) | undefined;
77
+ }, {}>;
78
+ export type UpsertAssociationPayload = typeof UpsertAssociationPayloadSchema.inferOut;
79
+ //# sourceMappingURL=association.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"association.d.ts","sourceRoot":"","sources":["../../../../src/association/schema/association.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,4BAA4B;;MAEvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAChC,OAAO,4BAA4B,CAAC,QAAQ,CAAC;AAE/C,eAAO,MAAM,oCAAoC;;;MACY,CAAC;AAC9D,MAAM,MAAM,8BAA8B,GACxC,OAAO,oCAAoC,CAAC,QAAQ,CAAC;AAEvD,MAAM,MAAM,oBAAoB,GAC5B,sBAAsB,GACtB,8BAA8B,CAAC;AAEnC,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;WAGnC,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG,OAAO,uBAAuB,CAAC,QAAQ,CAAC;AAExE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;MAE/B,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;MAMA,CAAC;AACtC,MAAM,MAAM,kBAAkB,GAAG,OAAO,wBAAwB,CAAC,QAAQ,CAAC;AAE1E,eAAO,MAAM,8BAA8B;;;;;;;MAEN,CAAC;AACtC,MAAM,MAAM,wBAAwB,GAClC,OAAO,8BAA8B,CAAC,QAAQ,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { type } from 'arktype';
2
+ import { OptionalDatePayloadSchema, RequiredDatePayloadSchema, } from '../../common/schema/dates.js';
3
+ import { MetadataPayloadPropertySchema } from '../../common/schema/metadata.js';
4
+ import { OrganizationAssociationReferenceSchema } from '../../customer/schema/organization.js';
5
+ import { UserAssociationReferenceSchema } from '../../customer/schema/user.js';
6
+ export const AssociationIdReferenceSchema = type({
7
+ id: type('string'),
8
+ });
9
+ export const AssociationAttributesReferenceSchema = AssociationIdReferenceSchema.and('Record<string, unknown>');
10
+ export const AssociationObjectSchema = type.enumerated(UserAssociationReferenceSchema, OrganizationAssociationReferenceSchema);
11
+ export const ObjectPropertySchema = type({
12
+ object: AssociationObjectSchema,
13
+ });
14
+ export const AssociationPayloadSchema = type({
15
+ updatedAt: RequiredDatePayloadSchema,
16
+ 'deletedAt?': OptionalDatePayloadSchema,
17
+ 'deactivatedAt?': OptionalDatePayloadSchema,
18
+ })
19
+ .and(ObjectPropertySchema)
20
+ .and(MetadataPayloadPropertySchema);
21
+ export const UpsertAssociationPayloadSchema = type({
22
+ expiresAt: OptionalDatePayloadSchema.optional(),
23
+ }).and(MetadataPayloadPropertySchema);
@@ -0,0 +1,2 @@
1
+ export * from './association.js';
2
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/association/schema/schema.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './association.js';
@@ -0,0 +1,2 @@
1
+ export * from './schema/schema.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/authentication/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './schema/schema.js';
@@ -0,0 +1,48 @@
1
+ export declare const AuthenticationFactorPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
2
+ id: string;
3
+ nextFactors?: {
4
+ id: string;
5
+ nextFactors?: /*elided*/ any[] | null | undefined;
6
+ }[] | null | undefined;
7
+ }, {}>;
8
+ export type AuthenticationFactorPayload = typeof AuthenticationFactorPayloadSchema.inferOut;
9
+ export declare const AuthenticationFactorsSchema: import("arktype/internal/methods/object.ts").ObjectType<(In: {
10
+ id: string;
11
+ nextFactors?: {
12
+ id: string;
13
+ nextFactors?: /*elided*/ any[] | null | undefined;
14
+ }[] | null | undefined;
15
+ }[] | null | undefined) => import("arktype/internal/attributes.ts").Out<{
16
+ id: string;
17
+ nextFactors?: {
18
+ id: string;
19
+ nextFactors?: /*elided*/ any[] | null | undefined;
20
+ }[] | null | undefined;
21
+ }[] | undefined>, {}>;
22
+ export type AuthenticationFactors = typeof AuthenticationFactorsSchema.inferOut;
23
+ export declare const AuthenticationFactorsPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
24
+ factors: (In: {
25
+ id: string;
26
+ nextFactors?: {
27
+ id: string;
28
+ nextFactors?: /*elided*/ any[] | null | undefined;
29
+ }[] | null | undefined;
30
+ }[] | null | undefined) => import("arktype/internal/attributes.ts").Out<{
31
+ id: string;
32
+ nextFactors?: {
33
+ id: string;
34
+ nextFactors?: /*elided*/ any[] | null | undefined;
35
+ }[] | null | undefined;
36
+ }[] | undefined>;
37
+ }, {}>;
38
+ export type AuthenticationFactorsPayload = typeof AuthenticationFactorsPayloadSchema.inferOut;
39
+ export declare const UpsertAuthenticationFactorsPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
40
+ factors?: {
41
+ id: string;
42
+ nextFactors?: {
43
+ id: string;
44
+ nextFactors?: /*elided*/ any[] | null | undefined;
45
+ }[] | null | undefined;
46
+ }[] | null | undefined;
47
+ }, {}>;
48
+ //# sourceMappingURL=factors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factors.d.ts","sourceRoot":"","sources":["../../../../src/authentication/schema/factors.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,iCAAiC;;;;;;MAG5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GACrC,OAAO,iCAAiC,CAAC,QAAQ,CAAC;AAEpD,eAAO,MAAM,2BAA2B;;;;;;;;;;;;qBAGK,CAAC;AAC9C,MAAM,MAAM,qBAAqB,GAAG,OAAO,2BAA2B,CAAC,QAAQ,CAAC;AAEhF,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;MAE7C,CAAC;AACH,MAAM,MAAM,4BAA4B,GACtC,OAAO,kCAAkC,CAAC,QAAQ,CAAC;AAErD,eAAO,MAAM,wCAAwC;;;;;;;;MAInD,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { scope, type } from 'arktype';
2
+ import { StrategyIdSchema } from './strategy/base.js';
3
+ const factorScope = scope({
4
+ factor: {
5
+ id: StrategyIdSchema,
6
+ 'nextFactors?': 'childFactors',
7
+ },
8
+ childFactors: 'factor[] | undefined | null',
9
+ 'nextFactors?': 'factor[] | undefined | null',
10
+ });
11
+ export const AuthenticationFactorPayloadSchema = type({
12
+ id: StrategyIdSchema,
13
+ ...factorScope.export('nextFactors?'),
14
+ });
15
+ export const AuthenticationFactorsSchema = AuthenticationFactorPayloadSchema.array()
16
+ .or('undefined | null')
17
+ .pipe((f) => (f == null ? undefined : f));
18
+ export const AuthenticationFactorsPayloadSchema = type({
19
+ factors: AuthenticationFactorsSchema,
20
+ });
21
+ export const UpsertAuthenticationFactorsPayloadSchema = type({
22
+ factors: AuthenticationFactorPayloadSchema.array()
23
+ .or('undefined | null')
24
+ .optional(),
25
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=factors.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factors.test.d.ts","sourceRoot":"","sources":["../../../../src/authentication/schema/factors.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,121 @@
1
+ import { type } from 'arktype';
2
+ import { describe, expect, test } from 'vitest';
3
+ import { AuthenticationFactorPayloadSchema, AuthenticationFactorsPayloadSchema, UpsertAuthenticationFactorsPayloadSchema, } from './factors.js';
4
+ describe('Authentication - Factors', () => {
5
+ describe('Schema', () => {
6
+ test('should parse response payload successfully', async () => {
7
+ expect(AuthenticationFactorsPayloadSchema({
8
+ createdAt: new Date(),
9
+ updatedAt: new Date(),
10
+ factors: [
11
+ {
12
+ id: '123',
13
+ },
14
+ ],
15
+ })).not.toBeInstanceOf(type.errors);
16
+ // Undefined factors
17
+ expect(AuthenticationFactorsPayloadSchema({
18
+ createdAt: new Date(),
19
+ updatedAt: new Date(),
20
+ factors: undefined,
21
+ })).not.toBeInstanceOf(type.errors);
22
+ });
23
+ test('should parse upsert payload successfully', async () => {
24
+ expect(UpsertAuthenticationFactorsPayloadSchema({
25
+ factors: [
26
+ {
27
+ id: '123',
28
+ },
29
+ ],
30
+ })).not.toBeInstanceOf(type.errors);
31
+ // Null factors
32
+ expect(UpsertAuthenticationFactorsPayloadSchema({
33
+ factors: null,
34
+ })).not.toBeInstanceOf(type.errors);
35
+ // Undefined factors
36
+ expect(UpsertAuthenticationFactorsPayloadSchema({
37
+ factors: undefined,
38
+ })).not.toBeInstanceOf(type.errors);
39
+ });
40
+ test('should throw error for invalid factors', async () => {
41
+ // Factor object
42
+ expect(AuthenticationFactorsPayloadSchema({
43
+ createdAt: new Date(),
44
+ updatedAt: new Date(),
45
+ factors: { id: '123' },
46
+ })).toBeInstanceOf(type.errors);
47
+ // Factor array of string
48
+ expect(AuthenticationFactorsPayloadSchema({
49
+ createdAt: new Date(),
50
+ updatedAt: new Date(),
51
+ factors: ['123'],
52
+ })).toBeInstanceOf(type.errors);
53
+ });
54
+ test('should accept various next factors types', async () => {
55
+ // Undefined
56
+ expect(AuthenticationFactorPayloadSchema({
57
+ id: '123',
58
+ nextFactors: undefined,
59
+ })).not.toBeInstanceOf(type.errors);
60
+ // Array
61
+ expect(AuthenticationFactorPayloadSchema({
62
+ id: '123',
63
+ nextFactors: [
64
+ {
65
+ id: '456',
66
+ },
67
+ ],
68
+ })).not.toBeInstanceOf(type.errors);
69
+ // Deeply nested array
70
+ expect(AuthenticationFactorPayloadSchema({
71
+ id: '123',
72
+ nextFactors: [
73
+ {
74
+ id: '456',
75
+ nextFactors: [
76
+ {
77
+ id: '456',
78
+ nextFactors: [
79
+ {
80
+ id: '456',
81
+ },
82
+ ],
83
+ },
84
+ ],
85
+ },
86
+ ],
87
+ })).not.toBeInstanceOf(type.errors);
88
+ });
89
+ test('should throw error for invalid factor id', async () => {
90
+ // Number
91
+ expect(AuthenticationFactorsPayloadSchema({
92
+ id: 123,
93
+ })).toBeInstanceOf(type.errors);
94
+ // Null
95
+ expect(AuthenticationFactorsPayloadSchema({
96
+ id: null,
97
+ })).toBeInstanceOf(type.errors);
98
+ // Undefined
99
+ expect(AuthenticationFactorsPayloadSchema({
100
+ id: undefined,
101
+ })).toBeInstanceOf(type.errors);
102
+ });
103
+ test('should throw error for invalid next factors', async () => {
104
+ // String
105
+ expect(AuthenticationFactorsPayloadSchema({
106
+ id: '123',
107
+ nextFactors: '123',
108
+ })).toBeInstanceOf(type.errors);
109
+ // Object
110
+ expect(AuthenticationFactorsPayloadSchema({
111
+ id: '123',
112
+ nextFactors: { id: '123' },
113
+ })).toBeInstanceOf(type.errors);
114
+ // Array
115
+ expect(AuthenticationFactorsPayloadSchema({
116
+ id: '123',
117
+ nextFactors: ['123'],
118
+ })).toBeInstanceOf(type.errors);
119
+ });
120
+ });
121
+ });
@@ -0,0 +1,27 @@
1
+ export declare const ProviderType: {
2
+ readonly MONDO: "mondo";
3
+ };
4
+ export type AnyProviderType = (typeof ProviderType)[keyof typeof ProviderType];
5
+ export declare const ProviderIdSchema: import("arktype/internal/methods/string.ts").StringType<string, {}>;
6
+ export type ProviderId = typeof ProviderIdSchema.inferOut;
7
+ export declare const ProviderIdPropertySchema: import("arktype/internal/methods/object.ts").ObjectType<{
8
+ id: string;
9
+ }, {}>;
10
+ export type ProviderIdProperty = typeof ProviderIdPropertySchema.inferOut;
11
+ export declare const ProviderTypeSchema: import("arktype/internal/methods/string.ts").StringType<"mondo", {}>;
12
+ export declare const ProviderPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
13
+ id: string;
14
+ type: "mondo";
15
+ user: string;
16
+ strategy: string;
17
+ updatedAt: (In: string | Date) => import("arktype/internal/attributes.ts").Out<string>;
18
+ deletedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
19
+ deactivatedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
20
+ metadata?: ((In: {
21
+ [x: string]: string | number | boolean;
22
+ } | Map<string, string | number | boolean> | null | undefined) => import("arktype/internal/attributes.ts").Out<{
23
+ [x: string]: string | number | boolean;
24
+ } | undefined>) | undefined;
25
+ }, {}>;
26
+ export type ProviderPayload = typeof ProviderPayloadSchema.inferOut;
27
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../src/authentication/schema/provider.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,YAAY;;CAEf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE/E,eAAO,MAAM,gBAAgB,qEAAc,CAAC;AAC5C,MAAM,MAAM,UAAU,GAAG,OAAO,gBAAgB,CAAC,QAAQ,CAAC;AAE1D,eAAO,MAAM,wBAAwB;;MAEnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,wBAAwB,CAAC,QAAQ,CAAC;AAE1E,eAAO,MAAM,kBAAkB,sEAAsC,CAAC;AAEtE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;MAOG,CAAC;AACtC,MAAM,MAAM,eAAe,GAAG,OAAO,qBAAqB,CAAC,QAAQ,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { type } from 'arktype';
2
+ import { OptionalDatePayloadSchema, RequiredDatePayloadSchema, } from '../../common/schema/dates.js';
3
+ import { MetadataPayloadPropertySchema } from '../../common/schema/metadata.js';
4
+ import { UserIdSchema } from '../../customer/schema/user.js';
5
+ import { StrategyIdSchema } from './strategy/base.js';
6
+ export const ProviderType = {
7
+ MONDO: 'mondo',
8
+ };
9
+ export const ProviderIdSchema = type.string;
10
+ export const ProviderIdPropertySchema = type({
11
+ id: ProviderIdSchema,
12
+ });
13
+ export const ProviderTypeSchema = type.enumerated(ProviderType.MONDO);
14
+ export const ProviderPayloadSchema = ProviderIdPropertySchema.and({
15
+ type: ProviderTypeSchema,
16
+ user: UserIdSchema,
17
+ strategy: StrategyIdSchema,
18
+ updatedAt: RequiredDatePayloadSchema,
19
+ 'deletedAt?': OptionalDatePayloadSchema,
20
+ 'deactivatedAt?': OptionalDatePayloadSchema,
21
+ }).and(MetadataPayloadPropertySchema);
@@ -0,0 +1,6 @@
1
+ export * from './factors.js';
2
+ export * from './provider.js';
3
+ export * from './session.js';
4
+ export * from './settings.js';
5
+ export * from './strategy/schema.js';
6
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/authentication/schema/schema.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './factors.js';
2
+ export * from './provider.js';
3
+ export * from './session.js';
4
+ export * from './settings.js';
5
+ export * from './strategy/schema.js';
@@ -0,0 +1,59 @@
1
+ export declare const SessionStatus: {
2
+ readonly INITIATED: "initiated";
3
+ readonly AUTHENTICATED: "authenticated";
4
+ readonly PENDING: "pending";
5
+ };
6
+ export type AnySessionStatus = (typeof SessionStatus)[keyof typeof SessionStatus];
7
+ export declare const SessionIdSchema: import("arktype/internal/methods/string.ts").StringType<string, {}>;
8
+ export type SessionId = typeof SessionIdSchema.inferOut;
9
+ export declare const SessionIdPropertySchema: import("arktype/internal/methods/object.ts").ObjectType<{
10
+ id: string;
11
+ }, {}>;
12
+ export type SessionIdProperty = typeof SessionIdPropertySchema.inferOut;
13
+ export declare const SessionStatusSchema: import("arktype/internal/methods/string.ts").StringType<"initiated" | "authenticated" | "pending", {}>;
14
+ export declare const AuthenticationFactorSchema: import("arktype/internal/methods/object.ts").ObjectType<{
15
+ id: string;
16
+ type: "email" | "password" | "totp";
17
+ settings?: Record<string, unknown> | undefined;
18
+ state?: string | undefined;
19
+ }, {}>;
20
+ export type AuthenticationFactor = typeof AuthenticationFactorSchema.inferOut;
21
+ export declare const AuthenticationFactorHistorySchema: import("arktype/internal/methods/object.ts").ObjectType<(In: string[] | Set<string> | undefined) => import("arktype/internal/attributes.ts").Out<string[] | Set<string> | undefined>, {}>;
22
+ export type AuthenticationFactorHistory = typeof AuthenticationFactorHistorySchema.inferOut;
23
+ export declare const SessionPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
24
+ id: string;
25
+ status: "initiated" | "authenticated" | "pending";
26
+ expiresAt: (In: string | Date) => import("arktype/internal/attributes.ts").Out<string>;
27
+ createdAt: (In: string | Date) => import("arktype/internal/attributes.ts").Out<string>;
28
+ updatedAt: (In: string | Date) => import("arktype/internal/attributes.ts").Out<string>;
29
+ user?: string | undefined;
30
+ userAgent?: string | undefined;
31
+ sourceIp?: string | undefined;
32
+ factors?: {
33
+ id: string;
34
+ type: "email" | "password" | "totp";
35
+ settings?: Record<string, unknown> | undefined;
36
+ state?: string | undefined;
37
+ }[] | undefined;
38
+ factorHistory?: ((In: string[] | Set<string> | undefined) => import("arktype/internal/attributes.ts").Out<string[] | Set<string> | undefined>) | undefined;
39
+ deletedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
40
+ deactivatedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
41
+ metadata?: ((In: {
42
+ [x: string]: string | number | boolean;
43
+ } | Map<string, string | number | boolean> | null | undefined) => import("arktype/internal/attributes.ts").Out<{
44
+ [x: string]: string | number | boolean;
45
+ } | undefined>) | undefined;
46
+ }, {}>;
47
+ export type SessionPayload = typeof SessionPayloadSchema.inferOut;
48
+ export declare const SessionAssociationReferenceSchema: import("arktype/internal/methods/object.ts").ObjectType<{
49
+ id: string;
50
+ status: "initiated" | "authenticated" | "pending";
51
+ expiresAt: (In: string | Date) => import("arktype/internal/attributes.ts").Out<string>;
52
+ createdAt: (In: string | Date) => import("arktype/internal/attributes.ts").Out<string>;
53
+ user?: string | undefined;
54
+ userAgent?: string | undefined;
55
+ sourceIp?: string | undefined;
56
+ model: "Session";
57
+ }, {}>;
58
+ export type SessionAssociationReference = typeof SessionAssociationReferenceSchema.inferOut;
59
+ //# sourceMappingURL=session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../src/authentication/schema/session.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAErD,eAAO,MAAM,eAAe,qEAAc,CAAC;AAC3C,MAAM,MAAM,SAAS,GAAG,OAAO,eAAe,CAAC,QAAQ,CAAC;AAExD,eAAO,MAAM,uBAAuB;;MAElC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,uBAAuB,CAAC,QAAQ,CAAC;AAExE,eAAO,MAAM,mBAAmB,wGAI/B,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;MAKrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,0BAA0B,CAAC,QAAQ,CAAC;AAM9E,eAAO,MAAM,iCAAiC,2LAK3C,CAAC;AACJ,MAAM,MAAM,2BAA2B,GACrC,OAAO,iCAAiC,CAAC,QAAQ,CAAC;AAEpD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;MAYI,CAAC;AACtC,MAAM,MAAM,cAAc,GAAG,OAAO,oBAAoB,CAAC,QAAQ,CAAC;AAElE,eAAO,MAAM,iCAAiC;;;;;;;;;MAU5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GACrC,OAAO,iCAAiC,CAAC,QAAQ,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { type } from 'arktype';
2
+ import { OptionalDatePayloadSchema, RequiredDatePayloadSchema, } from '../../common/schema/dates.js';
3
+ import { MetadataPayloadPropertySchema } from '../../common/schema/metadata.js';
4
+ import { UserIdSchema } from '../../customer/schema/user.js';
5
+ import { StrategyIdSchema, StrategyTypeSchema } from './strategy/base.js';
6
+ export const SessionStatus = {
7
+ INITIATED: 'initiated', // Session was created, but no activity has been taken
8
+ AUTHENTICATED: 'authenticated', // Session is authenticated
9
+ PENDING: 'pending', // Session is in the process of authenticating
10
+ };
11
+ export const SessionIdSchema = type.string;
12
+ export const SessionIdPropertySchema = type({
13
+ id: SessionIdSchema,
14
+ });
15
+ export const SessionStatusSchema = type.enumerated(SessionStatus.INITIATED, SessionStatus.AUTHENTICATED, SessionStatus.PENDING);
16
+ export const AuthenticationFactorSchema = type({
17
+ id: StrategyIdSchema,
18
+ type: StrategyTypeSchema,
19
+ settings: type('Record<string, unknown> | undefined').optional(),
20
+ state: type('string | undefined').optional(),
21
+ });
22
+ const AuthenticationFactorHistoryArraySchema = StrategyIdSchema.array();
23
+ const AuthenticationFactorHistorySetSchema = type.instanceOf((Set));
24
+ export const AuthenticationFactorHistorySchema = type('undefined')
25
+ .or(AuthenticationFactorHistoryArraySchema)
26
+ .or(AuthenticationFactorHistorySetSchema)
27
+ .pipe((s) => (s instanceof Set ? Array.from(s) : s)?.length ? s : undefined);
28
+ export const SessionPayloadSchema = SessionIdPropertySchema.and({
29
+ status: SessionStatusSchema,
30
+ user: UserIdSchema.or('undefined').optional(),
31
+ userAgent: type('string | undefined').optional(),
32
+ sourceIp: type('string.ip.v4 | string.ip.v6 | undefined').optional(),
33
+ factors: AuthenticationFactorSchema.array().or('undefined').optional(),
34
+ factorHistory: AuthenticationFactorHistorySchema.optional(),
35
+ expiresAt: RequiredDatePayloadSchema,
36
+ createdAt: RequiredDatePayloadSchema,
37
+ updatedAt: RequiredDatePayloadSchema,
38
+ 'deletedAt?': OptionalDatePayloadSchema,
39
+ 'deactivatedAt?': OptionalDatePayloadSchema,
40
+ }).and(MetadataPayloadPropertySchema);
41
+ export const SessionAssociationReferenceSchema = SessionPayloadSchema.pick('id', 'status', 'user', 'userAgent', 'sourceIp', 'createdAt', 'expiresAt').and({
42
+ model: "'Session'",
43
+ });
@@ -0,0 +1,46 @@
1
+ export declare const SettingsPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
2
+ factors?: ((In: {
3
+ id: string;
4
+ nextFactors?: {
5
+ id: string;
6
+ nextFactors?: /*elided*/ any[] | null | undefined;
7
+ }[] | null | undefined;
8
+ }[] | null | undefined) => import("arktype/internal/attributes.ts").Out<{
9
+ id: string;
10
+ nextFactors?: {
11
+ id: string;
12
+ nextFactors?: /*elided*/ any[] | null | undefined;
13
+ }[] | null | undefined;
14
+ }[] | undefined>) | undefined;
15
+ updatedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
16
+ deletedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
17
+ deactivatedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
18
+ metadata?: ((In: {
19
+ [x: string]: string | number | boolean;
20
+ } | Map<string, string | number | boolean> | null | undefined) => import("arktype/internal/attributes.ts").Out<{
21
+ [x: string]: string | number | boolean;
22
+ } | undefined>) | undefined;
23
+ }, {}>;
24
+ export type SettingsPayload = typeof SettingsPayloadSchema.inferOut;
25
+ export declare const UpsertSettingsPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
26
+ factors?: ((In: {
27
+ id: string;
28
+ nextFactors?: {
29
+ id: string;
30
+ nextFactors?: /*elided*/ any[] | null | undefined;
31
+ }[] | null | undefined;
32
+ }[] | null | undefined) => import("arktype/internal/attributes.ts").Out<{
33
+ id: string;
34
+ nextFactors?: {
35
+ id: string;
36
+ nextFactors?: /*elided*/ any[] | null | undefined;
37
+ }[] | null | undefined;
38
+ }[] | undefined>) | undefined;
39
+ metadata?: ((In: {
40
+ [x: string]: string | number | boolean;
41
+ } | Map<string, string | number | boolean> | null | undefined) => import("arktype/internal/attributes.ts").Out<{
42
+ [x: string]: string | number | boolean;
43
+ } | null>) | undefined;
44
+ }, {}>;
45
+ export type UpsertSettingsPayload = typeof UpsertSettingsPayloadSchema.inferOut;
46
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../src/authentication/schema/settings.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;MAMG,CAAC;AACtC,MAAM,MAAM,eAAe,GAAG,OAAO,qBAAqB,CAAC,QAAQ,CAAC;AAEpE,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;MAEG,CAAC;AAC5C,MAAM,MAAM,qBAAqB,GAAG,OAAO,2BAA2B,CAAC,QAAQ,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { type } from 'arktype';
2
+ import { OptionalDatePayloadSchema } from '../../common/schema/dates.js';
3
+ import { MetadataPayloadPropertySchema, UpsertMetadataPayloadPropertySchema, } from '../../common/schema/metadata.js';
4
+ import { AuthenticationFactorsSchema } from './factors.js';
5
+ export const SettingsPayloadSchema = type({
6
+ factors: AuthenticationFactorsSchema.optional(),
7
+ 'updatedAt?': OptionalDatePayloadSchema,
8
+ 'deletedAt?': OptionalDatePayloadSchema,
9
+ 'deactivatedAt?': OptionalDatePayloadSchema,
10
+ }).and(MetadataPayloadPropertySchema);
11
+ export const UpsertSettingsPayloadSchema = type({
12
+ factors: AuthenticationFactorsSchema.optional(),
13
+ }).and(UpsertMetadataPayloadPropertySchema);