@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,60 @@
1
+ import { type } from 'arktype';
2
+ import { describe, expect, test } from 'vitest';
3
+ import { MetadataMapPropertySchema, MetadataPayloadPropertySchema, } from './metadata.js';
4
+ describe('Common - Metadata', () => {
5
+ describe('Map Property Schema', () => {
6
+ test('should parse a record to a map', async () => {
7
+ const result = MetadataMapPropertySchema({
8
+ metadata: { foo: 'bar' },
9
+ });
10
+ expect(result).not.toBeInstanceOf(type.errors);
11
+ expect(result?.metadata).toBeInstanceOf(Map);
12
+ });
13
+ test('should parse undefined property to a map', async () => {
14
+ const result = MetadataMapPropertySchema({
15
+ metadata: undefined,
16
+ });
17
+ expect(result).not.toBeInstanceOf(type.errors);
18
+ expect(result?.metadata).toBeInstanceOf(Map);
19
+ });
20
+ test('should parse undefined to a map', async () => {
21
+ const result = MetadataMapPropertySchema({});
22
+ expect(result).not.toBeInstanceOf(type.errors);
23
+ expect(result?.metadata).toBeInstanceOf(Map);
24
+ });
25
+ test('should parse map to a map', async () => {
26
+ const result = MetadataMapPropertySchema({
27
+ metadata: new Map([['foo', 'bar']]),
28
+ });
29
+ expect(result).not.toBeInstanceOf(type.errors);
30
+ expect(result?.metadata).toBeInstanceOf(Map);
31
+ });
32
+ test('should parse null to a map', async () => {
33
+ const result = MetadataMapPropertySchema({
34
+ metadata: null,
35
+ });
36
+ expect(result).not.toBeInstanceOf(type.errors);
37
+ expect(result?.metadata).toBeInstanceOf(Map);
38
+ });
39
+ });
40
+ describe('Payload', () => {
41
+ test('should parse map to record', async () => {
42
+ const result = MetadataPayloadPropertySchema({
43
+ metadata: new Map([
44
+ ['foo', 'bar'],
45
+ ['baz', 0],
46
+ ]),
47
+ });
48
+ expect(result).not.toBeInstanceOf(type.errors);
49
+ expect(result?.metadata?.foo).to.equal('bar');
50
+ expect(result?.metadata?.baz).to.equal(0);
51
+ });
52
+ test('should return undefined if map is empty', async () => {
53
+ const result = MetadataPayloadPropertySchema({
54
+ metadata: new Map(),
55
+ });
56
+ expect(result).not.toBeInstanceOf(type.errors);
57
+ expect(result?.metadata).is.undefined;
58
+ });
59
+ });
60
+ });
@@ -0,0 +1,5 @@
1
+ export * from './aggregate.js';
2
+ export * from './dates.js';
3
+ export * from './jwt.js';
4
+ export * from './metadata.js';
5
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/schema.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './aggregate.js';
2
+ export * from './dates.js';
3
+ export * from './jwt.js';
4
+ export * from './metadata.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/customer/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './schema/schema.js';
@@ -0,0 +1,54 @@
1
+ export declare const OrganizationStatus: {
2
+ readonly ACTIVE: "active";
3
+ readonly SUSPENDED: "suspended";
4
+ };
5
+ export type AnyOrganizationStatus = (typeof OrganizationStatus)[keyof typeof OrganizationStatus];
6
+ export declare const OrganizationIdSchema: import("arktype/internal/methods/string.ts").StringType<string, {}>;
7
+ export type OrganizationId = typeof OrganizationIdSchema.inferOut;
8
+ export declare const OrganizationIdPropertySchema: import("arktype/internal/methods/object.ts").ObjectType<{
9
+ id: string;
10
+ }, {}>;
11
+ export type OrganizationIdProperty = typeof OrganizationIdPropertySchema.inferOut;
12
+ export declare const OrganizationPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
13
+ status: import("arktype/internal/attributes.ts").Default<"active" | "suspended", "active">;
14
+ name: string;
15
+ createdAt: (In: string | Date) => import("arktype/internal/attributes.ts").Out<string>;
16
+ updatedAt: (In: string | Date) => import("arktype/internal/attributes.ts").Out<string>;
17
+ deletedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
18
+ deactivatedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
19
+ id: string;
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 OrganizationPayload = typeof OrganizationPayloadSchema.inferOut;
27
+ export declare const InsertOrganizationPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
28
+ id: import("arktype/internal/attributes.ts").Default<string, string>;
29
+ name: string;
30
+ status?: "active" | "suspended" | undefined;
31
+ metadata?: ((In: {
32
+ [x: string]: string | number | boolean;
33
+ } | Map<string, string | number | boolean> | null | undefined) => import("arktype/internal/attributes.ts").Out<{
34
+ [x: string]: string | number | boolean;
35
+ } | null>) | undefined;
36
+ }, {}>;
37
+ export type InsertOrganizationPayload = typeof InsertOrganizationPayloadSchema.inferOut;
38
+ export declare const UpdateOrganizationPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
39
+ status?: "active" | "suspended" | null | undefined;
40
+ name?: string | null | 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
+ } | null>) | undefined;
46
+ }, {}>;
47
+ export type UpdateOrganizationPayload = typeof UpdateOrganizationPayloadSchema.inferOut;
48
+ export declare const OrganizationAssociationReferenceSchema: import("arktype/internal/methods/object.ts").ObjectType<{
49
+ id: string;
50
+ name: string;
51
+ model: "Organization";
52
+ }, {}>;
53
+ export type OrganizationAssociationReference = typeof OrganizationAssociationReferenceSchema.inferOut;
54
+ //# sourceMappingURL=organization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../../../../src/customer/schema/organization.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC;AACX,MAAM,MAAM,qBAAqB,GAC/B,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAE/D,eAAO,MAAM,oBAAoB,qEAAc,CAAC;AAChD,MAAM,MAAM,cAAc,GAAG,OAAO,oBAAoB,CAAC,QAAQ,CAAC;AAElE,eAAO,MAAM,4BAA4B;;MAEvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAChC,OAAO,4BAA4B,CAAC,QAAQ,CAAC;AAS/C,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;MASD,CAAC;AACtC,MAAM,MAAM,mBAAmB,GAAG,OAAO,yBAAyB,CAAC,QAAQ,CAAC;AAE5E,eAAO,MAAM,+BAA+B;;;;;;;;;MAID,CAAC;AAC5C,MAAM,MAAM,yBAAyB,GACnC,OAAO,+BAA+B,CAAC,QAAQ,CAAC;AAElD,eAAO,MAAM,+BAA+B;;;;;;;;MAGD,CAAC;AAC5C,MAAM,MAAM,yBAAyB,GACnC,OAAO,+BAA+B,CAAC,QAAQ,CAAC;AAElD,eAAO,MAAM,sCAAsC;;;;MAMhD,CAAC;AACJ,MAAM,MAAM,gCAAgC,GAC1C,OAAO,sCAAsC,CAAC,QAAQ,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { type } from 'arktype';
2
+ import { OptionalDatePayloadSchema, RequiredDatePayloadSchema, } from '../../common/index.js';
3
+ import { MetadataPayloadPropertySchema, UpsertMetadataPayloadPropertySchema, } from '../../common/schema/metadata.js';
4
+ import { generateOrganizationId } from './utils.js';
5
+ export const OrganizationStatus = {
6
+ ACTIVE: 'active',
7
+ SUSPENDED: 'suspended',
8
+ };
9
+ export const OrganizationIdSchema = type.string;
10
+ export const OrganizationIdPropertySchema = type({
11
+ id: OrganizationIdSchema,
12
+ });
13
+ const OrganizationNameSchema = type.string;
14
+ const StatusSchema = type.enumerated(OrganizationStatus.ACTIVE, OrganizationStatus.SUSPENDED);
15
+ export const OrganizationPayloadSchema = type({
16
+ status: StatusSchema.default(OrganizationStatus.ACTIVE),
17
+ name: OrganizationNameSchema,
18
+ createdAt: RequiredDatePayloadSchema,
19
+ updatedAt: RequiredDatePayloadSchema,
20
+ 'deletedAt?': OptionalDatePayloadSchema,
21
+ 'deactivatedAt?': OptionalDatePayloadSchema,
22
+ })
23
+ .and(OrganizationIdPropertySchema)
24
+ .and(MetadataPayloadPropertySchema);
25
+ export const InsertOrganizationPayloadSchema = type({
26
+ id: OrganizationIdSchema.default(() => generateOrganizationId()),
27
+ status: StatusSchema.optional(),
28
+ name: OrganizationNameSchema,
29
+ }).and(UpsertMetadataPayloadPropertySchema);
30
+ export const UpdateOrganizationPayloadSchema = type({
31
+ status: StatusSchema.or(type.null).optional(),
32
+ name: OrganizationNameSchema.or(type.null).optional(),
33
+ }).and(UpsertMetadataPayloadPropertySchema);
34
+ export const OrganizationAssociationReferenceSchema = OrganizationIdPropertySchema.and(type({
35
+ name: type.string,
36
+ model: "'Organization'",
37
+ }));
@@ -0,0 +1,4 @@
1
+ export * from './organization.js';
2
+ export * from './user.js';
3
+ export * from './utils.js';
4
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/customer/schema/schema.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAE1B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './organization.js';
2
+ export * from './user.js';
3
+ export * from './utils.js';
@@ -0,0 +1,122 @@
1
+ export declare const VerifiableAttribute: {
2
+ readonly EMAIL: "email";
3
+ readonly PHONE_NUMBER: "phoneNumber";
4
+ };
5
+ export type AnyVerifiableAttribute = (typeof VerifiableAttribute)[keyof typeof VerifiableAttribute];
6
+ export declare const UserStatus: {
7
+ readonly ACTIVE: "active";
8
+ readonly SUSPENDED: "suspended";
9
+ readonly UNVERIFIED: "unverified";
10
+ };
11
+ export type AnyUserStatus = (typeof UserStatus)[keyof typeof UserStatus];
12
+ export declare const UserNamePropertiesSchema: import("arktype/internal/methods/object.ts").ObjectType<{
13
+ givenName?: string | undefined;
14
+ middleName?: string | undefined;
15
+ familyName?: string | undefined;
16
+ honorificPrefix?: string | undefined;
17
+ honorificSuffix?: string | undefined;
18
+ }, {}>;
19
+ export type UserNameProperties = typeof UserNamePropertiesSchema.inferOut;
20
+ export declare const UpsertUserNamePropertiesSchema: import("arktype/internal/methods/object.ts").ObjectType<{
21
+ givenName?: string | null | undefined;
22
+ middleName?: string | null | undefined;
23
+ familyName?: string | null | undefined;
24
+ honorificPrefix?: string | null | undefined;
25
+ honorificSuffix?: string | null | undefined;
26
+ }, {}>;
27
+ export declare const UserIdSchema: import("arktype/internal/methods/string.ts").StringType<string, {}>;
28
+ export type UserId = typeof UserIdSchema.inferOut;
29
+ export declare const UserIdPropertySchema: import("arktype/internal/methods/object.ts").ObjectType<{
30
+ id: string;
31
+ }, {}>;
32
+ export type UserIdProperty = typeof UserIdPropertySchema.inferOut;
33
+ export declare const RequiredEmailSchema: import("arktype/internal/methods/string.ts").StringType<string, {}>;
34
+ export declare const RequiredPhoneNumberSchema: import("arktype/internal/methods/string.ts").StringType<string, {}>;
35
+ export declare const VerifiedEmailOrPhonePropertiesSchema: import("arktype/internal/methods/object.ts").ObjectType<{
36
+ email?: ((In: string | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
37
+ verifiedEmail?: boolean | undefined;
38
+ phoneNumber?: string | undefined;
39
+ verifiedPhoneNumber?: boolean | undefined;
40
+ }, {}>;
41
+ export declare const EmailOrPhonePropertiesSchema: import("arktype/internal/methods/object.ts").ObjectType<{
42
+ email?: ((In: string | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
43
+ phoneNumber?: string | undefined;
44
+ }, {}>;
45
+ export declare const UserPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
46
+ status: "active" | "suspended" | "unverified";
47
+ createdAt: (In: string | Date) => import("arktype/internal/attributes.ts").Out<string>;
48
+ updatedAt: (In: string | Date) => import("arktype/internal/attributes.ts").Out<string>;
49
+ roles?: {
50
+ ids?: string[] | undefined;
51
+ count?: number[] | undefined;
52
+ } | undefined;
53
+ lastLogin?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
54
+ deletedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
55
+ deactivatedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
56
+ id: string;
57
+ givenName?: string | undefined;
58
+ middleName?: string | undefined;
59
+ familyName?: string | undefined;
60
+ honorificPrefix?: string | undefined;
61
+ honorificSuffix?: string | undefined;
62
+ email?: ((In: string | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
63
+ verifiedEmail?: boolean | undefined;
64
+ phoneNumber?: string | undefined;
65
+ verifiedPhoneNumber?: boolean | undefined;
66
+ metadata?: ((In: {
67
+ [x: string]: string | number | boolean;
68
+ } | Map<string, string | number | boolean> | null | undefined) => import("arktype/internal/attributes.ts").Out<{
69
+ [x: string]: string | number | boolean;
70
+ } | undefined>) | undefined;
71
+ }, {}>;
72
+ export type UserPayload = typeof UserPayloadSchema.inferOut;
73
+ export declare const InsertUserPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
74
+ id: import("arktype/internal/attributes.ts").Default<string, string>;
75
+ suspended?: boolean | undefined;
76
+ givenName?: string | undefined;
77
+ middleName?: string | undefined;
78
+ familyName?: string | undefined;
79
+ honorificPrefix?: string | undefined;
80
+ honorificSuffix?: string | undefined;
81
+ email?: ((In: string | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
82
+ verifiedEmail?: boolean | undefined;
83
+ phoneNumber?: string | undefined;
84
+ verifiedPhoneNumber?: boolean | undefined;
85
+ metadata?: ((In: {
86
+ [x: string]: string | number | boolean;
87
+ } | Map<string, string | number | boolean> | null | undefined) => import("arktype/internal/attributes.ts").Out<{
88
+ [x: string]: string | number | boolean;
89
+ } | null>) | undefined;
90
+ }, {}>;
91
+ export type InsertUserPayload = typeof InsertUserPayloadSchema.inferOut;
92
+ export declare const UpdateUserPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
93
+ suspended?: boolean | undefined;
94
+ givenName?: string | null | undefined;
95
+ middleName?: string | null | undefined;
96
+ familyName?: string | null | undefined;
97
+ honorificPrefix?: string | null | undefined;
98
+ honorificSuffix?: string | null | undefined;
99
+ metadata?: ((In: {
100
+ [x: string]: string | number | boolean;
101
+ } | Map<string, string | number | boolean> | null | undefined) => import("arktype/internal/attributes.ts").Out<{
102
+ [x: string]: string | number | boolean;
103
+ } | null>) | undefined;
104
+ }, {}>;
105
+ export type UpdateUserPayload = typeof UpdateUserPayloadSchema.inferOut;
106
+ export declare const UserAssociationsSchema: import("arktype/internal/methods/object.ts").ObjectType<{
107
+ roles?: string[] | undefined;
108
+ }, {}>;
109
+ export type UserAssociations = typeof UserAssociationsSchema.inferOut;
110
+ export declare const UserAssociationReferenceSchema: import("arktype/internal/methods/object.ts").ObjectType<{
111
+ id: string;
112
+ givenName?: string | undefined;
113
+ middleName?: string | undefined;
114
+ familyName?: string | undefined;
115
+ honorificPrefix?: string | undefined;
116
+ honorificSuffix?: string | undefined;
117
+ email?: ((In: string | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
118
+ phoneNumber?: string | undefined;
119
+ model: "User";
120
+ }, {}>;
121
+ export type UserAssociationReference = typeof UserAssociationReferenceSchema.inferOut;
122
+ //# sourceMappingURL=user.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../src/customer/schema/user.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAChC,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEjE,eAAO,MAAM,UAAU;;;;CAIb,CAAC;AACX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAQzE,eAAO,MAAM,wBAAwB;;;;;;MAMnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,wBAAwB,CAAC,QAAQ,CAAC;AAE1E,eAAO,MAAM,8BAA8B;;;;;;MAMzC,CAAC;AAEH,eAAO,MAAM,YAAY,qEAAc,CAAC;AACxC,MAAM,MAAM,MAAM,GAAG,OAAO,YAAY,CAAC,QAAQ,CAAC;AAElD,eAAO,MAAM,oBAAoB;;MAE/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,oBAAoB,CAAC,QAAQ,CAAC;AAElE,eAAO,MAAM,mBAAmB,qEAAuB,CAAC;AACxD,eAAO,MAAM,yBAAyB,qEAAiB,CAAC;AAOxD,eAAO,MAAM,oCAAoC;;;;;MAK/C,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;MAGvC,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;MAYO,CAAC;AACtC,MAAM,MAAM,WAAW,GAAG,OAAO,iBAAiB,CAAC,QAAQ,CAAC;AAE5D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;MAMO,CAAC;AAC5C,MAAM,MAAM,iBAAiB,GAAG,OAAO,uBAAuB,CAAC,QAAQ,CAAC;AAExE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;MAIO,CAAC;AAC5C,MAAM,MAAM,iBAAiB,GAAG,OAAO,uBAAuB,CAAC,QAAQ,CAAC;AAIxE,eAAO,MAAM,sBAAsB;;MAGjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,sBAAsB,CAAC,QAAQ,CAAC;AAEtE,eAAO,MAAM,8BAA8B;;;;;;;;;;MAQ1C,CAAC;AACF,MAAM,MAAM,wBAAwB,GAClC,OAAO,8BAA8B,CAAC,QAAQ,CAAC"}
@@ -0,0 +1,80 @@
1
+ import { type } from 'arktype';
2
+ import { AggregateSchema } from '../../common/schema/aggregate.js';
3
+ import { OptionalDatePayloadSchema, RequiredDatePayloadSchema, } from '../../common/schema/dates.js';
4
+ import { MetadataPayloadPropertySchema, UpsertMetadataPayloadPropertySchema, } from '../../common/schema/metadata.js';
5
+ import { generateUserId } from './utils.js';
6
+ export const VerifiableAttribute = {
7
+ EMAIL: 'email',
8
+ PHONE_NUMBER: 'phoneNumber',
9
+ };
10
+ export const UserStatus = {
11
+ ACTIVE: 'active',
12
+ SUSPENDED: 'suspended',
13
+ UNVERIFIED: 'unverified',
14
+ };
15
+ const StatusSchema = type.enumerated(UserStatus.ACTIVE, UserStatus.SUSPENDED, UserStatus.UNVERIFIED);
16
+ export const UserNamePropertiesSchema = type({
17
+ givenName: type('string | undefined').or('undefined').optional(),
18
+ middleName: type('string | undefined').optional(),
19
+ familyName: type('string | undefined').optional(),
20
+ honorificPrefix: type('string | undefined').optional(),
21
+ honorificSuffix: type('string | undefined').optional(),
22
+ });
23
+ export const UpsertUserNamePropertiesSchema = type({
24
+ givenName: type('string | undefined | null').optional(),
25
+ middleName: type('string | undefined | null').optional(),
26
+ familyName: type('string | undefined | null').optional(),
27
+ honorificPrefix: type('string | undefined | null').optional(),
28
+ honorificSuffix: type('string | undefined | null').optional(),
29
+ });
30
+ export const UserIdSchema = type.string;
31
+ export const UserIdPropertySchema = type({
32
+ id: UserIdSchema,
33
+ });
34
+ export const RequiredEmailSchema = type('string.email');
35
+ export const RequiredPhoneNumberSchema = type('string');
36
+ const EmailSchema = RequiredEmailSchema.or('undefined').pipe((v) => v != null ? v : undefined);
37
+ const PhoneNumberSchema = RequiredPhoneNumberSchema.or('undefined');
38
+ export const VerifiedEmailOrPhonePropertiesSchema = type({
39
+ email: EmailSchema.optional(),
40
+ verifiedEmail: type('boolean').or('undefined').optional(),
41
+ phoneNumber: PhoneNumberSchema.optional(),
42
+ verifiedPhoneNumber: type('boolean').or('undefined').optional(),
43
+ });
44
+ export const EmailOrPhonePropertiesSchema = type({
45
+ email: EmailSchema.optional(),
46
+ phoneNumber: PhoneNumberSchema.optional(),
47
+ });
48
+ export const UserPayloadSchema = type({
49
+ status: StatusSchema,
50
+ roles: AggregateSchema.or(type.undefined).optional(),
51
+ lastLogin: OptionalDatePayloadSchema.optional(),
52
+ createdAt: RequiredDatePayloadSchema,
53
+ updatedAt: RequiredDatePayloadSchema,
54
+ 'deletedAt?': OptionalDatePayloadSchema,
55
+ 'deactivatedAt?': OptionalDatePayloadSchema,
56
+ })
57
+ .and(UserIdPropertySchema)
58
+ .and(UserNamePropertiesSchema)
59
+ .and(VerifiedEmailOrPhonePropertiesSchema)
60
+ .and(MetadataPayloadPropertySchema);
61
+ export const InsertUserPayloadSchema = type({
62
+ suspended: type.boolean.optional(),
63
+ id: UserIdSchema.default(() => generateUserId()),
64
+ })
65
+ .and(UserNamePropertiesSchema)
66
+ .and(VerifiedEmailOrPhonePropertiesSchema)
67
+ .and(UpsertMetadataPayloadPropertySchema);
68
+ export const UpdateUserPayloadSchema = type({
69
+ suspended: type.boolean.optional(),
70
+ })
71
+ .and(UpsertUserNamePropertiesSchema)
72
+ .and(UpsertMetadataPayloadPropertySchema);
73
+ const UserRoleAssociationSchema = type('string[] | undefined');
74
+ export const UserAssociationsSchema = type({
75
+ '+': 'delete',
76
+ roles: UserRoleAssociationSchema.optional(),
77
+ });
78
+ export const UserAssociationReferenceSchema = UserIdPropertySchema.and(UserNamePropertiesSchema).and(EmailOrPhonePropertiesSchema.and(type({
79
+ model: "'User'",
80
+ })));
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=user.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.test.d.ts","sourceRoot":"","sources":["../../../../src/customer/schema/user.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,55 @@
1
+ import { type } from 'arktype';
2
+ import { describe, expect, test } from 'vitest';
3
+ import { InsertUserPayloadSchema, UserPayloadSchema, UserStatus, } from './user.js';
4
+ describe('Customer - User', () => {
5
+ describe('User Payload', () => {
6
+ test('should parse attributes successfully', async () => {
7
+ const item = {
8
+ foo: 'bar',
9
+ id: '123',
10
+ phoneNumber: '123',
11
+ status: UserStatus.ACTIVE,
12
+ createdAt: new Date(),
13
+ updatedAt: new Date(),
14
+ };
15
+ const result = UserPayloadSchema(item);
16
+ if (result instanceof type.errors) {
17
+ console.log(result.summary);
18
+ }
19
+ expect(result).not.toBeInstanceOf(type.errors);
20
+ expect(result?.metadata).to.undefined;
21
+ });
22
+ });
23
+ describe('Insert User Payload', () => {
24
+ test('should parse attributes successfully', async () => {
25
+ const item = {
26
+ foo: 'bar',
27
+ id: '123',
28
+ phoneNumber: '123',
29
+ };
30
+ const result = InsertUserPayloadSchema(item);
31
+ if (result instanceof type.errors) {
32
+ console.log(result.summary);
33
+ }
34
+ expect(result).not.toBeInstanceOf(type.errors);
35
+ expect(result?.metadata).to.undefined;
36
+ });
37
+ test('should serialize successfully', async () => {
38
+ const item = {
39
+ foo: 'bar',
40
+ id: '123',
41
+ phoneNumber: '123',
42
+ metadata: new Map(),
43
+ // status: UserStatus.ACTIVE,
44
+ // createdAt: new Date(),
45
+ // updatedAt: new Date(),
46
+ };
47
+ const result = InsertUserPayloadSchema(item);
48
+ if (result instanceof type.errors) {
49
+ console.log(result.summary);
50
+ }
51
+ expect(result).not.toBeInstanceOf(type.errors);
52
+ expect(result?.metadata).to.null;
53
+ });
54
+ });
55
+ });
@@ -0,0 +1,11 @@
1
+ export declare const Model: {
2
+ readonly Organization: {
3
+ readonly UIDPrefix: "org";
4
+ };
5
+ readonly User: {
6
+ readonly UIDPrefix: "usr";
7
+ };
8
+ };
9
+ export declare function generateUserId(): string;
10
+ export declare function generateOrganizationId(): string;
11
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/customer/schema/utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK;;;;;;;CAOR,CAAC;AAEX,wBAAgB,cAAc,WAE7B;AAED,wBAAgB,sBAAsB,WAErC"}
@@ -0,0 +1,15 @@
1
+ import KSUID from 'ksuid';
2
+ export const Model = {
3
+ Organization: {
4
+ UIDPrefix: 'org',
5
+ },
6
+ User: {
7
+ UIDPrefix: 'usr',
8
+ },
9
+ };
10
+ export function generateUserId() {
11
+ return `${Model.User.UIDPrefix}_${KSUID.randomSync().string}`;
12
+ }
13
+ export function generateOrganizationId() {
14
+ return `${Model.Organization.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/identity/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './schema/schema.js';
@@ -0,0 +1,7 @@
1
+ export declare const IdentityIdentifier: {
2
+ readonly EMAIL: "email";
3
+ readonly PHONE_NUMBER: "phoneNumber";
4
+ };
5
+ export type AnyIdentityIdentifier = (typeof IdentityIdentifier)[keyof typeof IdentityIdentifier];
6
+ export declare const IdentityIdentifierSchema: import("arktype/internal/methods/string.ts").StringType<"email" | "phoneNumber", {}>;
7
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/identity/schema/schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAC/B,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAE/D,eAAO,MAAM,wBAAwB,sFAGpC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { type } from 'arktype';
2
+ export const IdentityIdentifier = {
3
+ EMAIL: 'email',
4
+ PHONE_NUMBER: 'phoneNumber',
5
+ };
6
+ export const IdentityIdentifierSchema = type.enumerated(IdentityIdentifier.EMAIL, IdentityIdentifier.PHONE_NUMBER);
@@ -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/oauth/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './schema/schema.js';
@@ -0,0 +1,8 @@
1
+ export declare const GrantType: {
2
+ readonly CLIENT_CREDENTIALS: "client_credentials";
3
+ readonly AUTHORIZATION_CODE: "authorization_code";
4
+ readonly IMPLICIT: "implicit";
5
+ readonly REFRESH_TOKEN: "refresh_token";
6
+ };
7
+ export type AnyGrantType = (typeof GrantType)[keyof typeof GrantType];
8
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/oauth/schema/schema.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;CAKZ,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export const GrantType = {
2
+ CLIENT_CREDENTIALS: 'client_credentials',
3
+ AUTHORIZATION_CODE: 'authorization_code',
4
+ IMPLICIT: 'implicit',
5
+ REFRESH_TOKEN: 'refresh_token',
6
+ };
@@ -0,0 +1 @@
1
+ { "type": "module" }
@@ -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/workspace/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './schema/schema.js';
@@ -0,0 +1,31 @@
1
+ export declare const DEFAULT_SESSION_DURATION: number;
2
+ export declare const DEFAULT_REFRESH_TOKEN_DURATION: number;
3
+ export declare const DEFAULT_ACCESS_TOKEN_DURATION: number;
4
+ export declare const AuthorizationPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
5
+ sessionDuration: import("arktype/internal/attributes.ts").Default<number, number>;
6
+ refreshTokenDuration: import("arktype/internal/attributes.ts").Default<number, number>;
7
+ accessTokenDuration: import("arktype/internal/attributes.ts").Default<number, number>;
8
+ accessTokenSignatureAlgorithm: import("arktype/internal/attributes.ts").Default<string, string>;
9
+ updatedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
10
+ deletedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
11
+ deactivatedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
12
+ metadata?: ((In: {
13
+ [x: string]: string | number | boolean;
14
+ } | Map<string, string | number | boolean> | null | undefined) => import("arktype/internal/attributes.ts").Out<{
15
+ [x: string]: string | number | boolean;
16
+ } | undefined>) | undefined;
17
+ }, {}>;
18
+ export type AuthorizationPayload = typeof AuthorizationPayloadSchema.inferOut;
19
+ export declare const UpsertAuthorizationPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
20
+ sessionDuration: import("arktype/internal/attributes.ts").Default<number, number>;
21
+ refreshTokenDuration: import("arktype/internal/attributes.ts").Default<number, number>;
22
+ accessTokenDuration: import("arktype/internal/attributes.ts").Default<number, number>;
23
+ accessTokenSignatureAlgorithm: import("arktype/internal/attributes.ts").Default<string, string>;
24
+ metadata?: ((In: {
25
+ [x: string]: string | number | boolean;
26
+ } | Map<string, string | number | boolean> | null | undefined) => import("arktype/internal/attributes.ts").Out<{
27
+ [x: string]: string | number | boolean;
28
+ } | undefined>) | undefined;
29
+ }, {}>;
30
+ export type UpsertAuthorizationPayload = typeof UpsertAuthorizationPayloadSchema.inferOut;
31
+ //# sourceMappingURL=authorization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authorization.d.ts","sourceRoot":"","sources":["../../../../src/workspace/schema/authorization.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,wBAAwB,QAAc,CAAC;AACpD,eAAO,MAAM,8BAA8B,QAAoB,CAAC;AAChE,eAAO,MAAM,6BAA6B,QAAc,CAAC;AASzD,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;MAIF,CAAC;AACtC,MAAM,MAAM,oBAAoB,GAAG,OAAO,0BAA0B,CAAC,QAAQ,CAAC;AAE9E,eAAO,MAAM,gCAAgC;;;;;;;;;;MAE5C,CAAC;AACF,MAAM,MAAM,0BAA0B,GACpC,OAAO,gCAAgC,CAAC,QAAQ,CAAC"}