@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,69 @@
1
+ export declare const PermissionStatus: {
2
+ readonly ENABLED: "enabled";
3
+ readonly DISABLED: "disabled";
4
+ };
5
+ export type AnyPermissionStatus = (typeof PermissionStatus)[keyof typeof PermissionStatus];
6
+ export declare const PermissionIdPropertySchema: import("arktype/internal/methods/object.ts").ObjectType<{
7
+ id: string;
8
+ }, {}>;
9
+ export type PermissionIdProperty = typeof PermissionIdPropertySchema.inferOut;
10
+ export declare const PermissionPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
11
+ id: string;
12
+ name: string;
13
+ status: "enabled" | "disabled";
14
+ createdAt: (In: string | Date) => import("arktype/internal/attributes.ts").Out<string>;
15
+ updatedAt: (In: string | Date) => import("arktype/internal/attributes.ts").Out<string>;
16
+ description?: string | undefined;
17
+ apps?: {
18
+ ids?: string[] | undefined;
19
+ count?: number[] | undefined;
20
+ } | undefined;
21
+ roles?: {
22
+ ids?: string[] | undefined;
23
+ count?: number[] | undefined;
24
+ } | undefined;
25
+ deletedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
26
+ deactivatedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
27
+ metadata?: ((In: {
28
+ [x: string]: string | number | boolean;
29
+ } | Map<string, string | number | boolean> | null | undefined) => import("arktype/internal/attributes.ts").Out<{
30
+ [x: string]: string | number | boolean;
31
+ } | undefined>) | undefined;
32
+ }, {}>;
33
+ export type PermissionPayload = typeof PermissionPayloadSchema.inferOut;
34
+ export declare const InsertPermissionPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
35
+ id: import("arktype/internal/attributes.ts").Default<string, string>;
36
+ name: string;
37
+ status: import("arktype/internal/attributes.ts").Default<"enabled" | "disabled", "enabled">;
38
+ description?: string | 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
+ } | undefined>) | undefined;
44
+ }, {}>;
45
+ export type InsertPermissionPayload = typeof InsertPermissionPayloadSchema.inferOut;
46
+ export declare const UpdatePermissionPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
47
+ name?: string | undefined;
48
+ status?: "enabled" | "disabled" | undefined;
49
+ description?: string | undefined;
50
+ metadata?: ((In: {
51
+ [x: string]: string | number | boolean;
52
+ } | Map<string, string | number | boolean> | null | undefined) => import("arktype/internal/attributes.ts").Out<{
53
+ [x: string]: string | number | boolean;
54
+ } | undefined>) | undefined;
55
+ }, {}>;
56
+ export type UpdatePermissionPayload = typeof UpdatePermissionPayloadSchema.inferOut;
57
+ export declare const PermissionAssociationsSchema: import("arktype/internal/methods/object.ts").ObjectType<{
58
+ apps?: string[] | undefined;
59
+ roles?: string[] | undefined;
60
+ }, {}>;
61
+ export type PermissionAssociations = typeof PermissionAssociationsSchema.inferOut;
62
+ export declare const PermissionAssociationReferenceSchema: import("arktype/internal/methods/object.ts").ObjectType<{
63
+ id: string;
64
+ name: string;
65
+ status: "enabled" | "disabled";
66
+ model: "Permission";
67
+ }, {}>;
68
+ export type PermissionAssociationReference = typeof PermissionAssociationReferenceSchema.inferOut;
69
+ //# sourceMappingURL=permission.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permission.d.ts","sourceRoot":"","sources":["../../../../src/authorization/schema/permission.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,gBAAgB;;;CAGnB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAC7B,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAI3D,eAAO,MAAM,0BAA0B;;MAErC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,0BAA0B,CAAC,QAAQ,CAAC;AAO9E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;MAYC,CAAC;AACtC,MAAM,MAAM,iBAAiB,GAAG,OAAO,uBAAuB,CAAC,QAAQ,CAAC;AAExE,eAAO,MAAM,6BAA6B;;;;;;;;;;MAKL,CAAC;AACtC,MAAM,MAAM,uBAAuB,GACjC,OAAO,6BAA6B,CAAC,QAAQ,CAAC;AAEhD,eAAO,MAAM,6BAA6B;;;;;;;;;MAIL,CAAC;AACtC,MAAM,MAAM,uBAAuB,GACjC,OAAO,6BAA6B,CAAC,QAAQ,CAAC;AAIhD,eAAO,MAAM,4BAA4B;;;MAIvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAChC,OAAO,4BAA4B,CAAC,QAAQ,CAAC;AAE/C,eAAO,MAAM,oCAAoC;;;;;MAG7C,CAAC;AACL,MAAM,MAAM,8BAA8B,GACxC,OAAO,oCAAoC,CAAC,QAAQ,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { type } from 'arktype';
2
+ import { OptionalDatePayloadSchema, RequiredDatePayloadSchema, } from '../../common/index.js';
3
+ import { AggregateSchema } from '../../common/schema/aggregate.js';
4
+ import { MetadataPayloadPropertySchema } from '../../common/schema/metadata.js';
5
+ import { generatePermissionId } from './utils.js';
6
+ export const PermissionStatus = {
7
+ ENABLED: 'enabled',
8
+ DISABLED: 'disabled',
9
+ };
10
+ const PermissionIdSchema = type.string;
11
+ export const PermissionIdPropertySchema = type({
12
+ id: PermissionIdSchema,
13
+ });
14
+ const StatusSchema = type.enumerated(PermissionStatus.ENABLED, PermissionStatus.DISABLED);
15
+ export const PermissionPayloadSchema = PermissionIdPropertySchema.and({
16
+ name: type('string'),
17
+ status: StatusSchema,
18
+ description: type('string').optional(),
19
+ apps: AggregateSchema.optional(),
20
+ roles: AggregateSchema.optional(),
21
+ createdAt: RequiredDatePayloadSchema,
22
+ updatedAt: RequiredDatePayloadSchema,
23
+ 'deletedAt?': OptionalDatePayloadSchema,
24
+ 'deactivatedAt?': OptionalDatePayloadSchema,
25
+ })
26
+ .and(PermissionIdPropertySchema)
27
+ .and(MetadataPayloadPropertySchema);
28
+ export const InsertPermissionPayloadSchema = type({
29
+ id: PermissionIdSchema.default(() => generatePermissionId()),
30
+ name: type('string'),
31
+ status: StatusSchema.default(PermissionStatus.ENABLED),
32
+ description: type('string').optional(),
33
+ }).and(MetadataPayloadPropertySchema);
34
+ export const UpdatePermissionPayloadSchema = type({
35
+ name: type('string').optional(),
36
+ status: StatusSchema.optional(),
37
+ description: type('string').optional(),
38
+ }).and(MetadataPayloadPropertySchema);
39
+ const AssociationSchema = type('string[] | undefined');
40
+ export const PermissionAssociationsSchema = type({
41
+ '+': 'delete',
42
+ apps: AssociationSchema.optional(),
43
+ roles: AssociationSchema.optional(),
44
+ });
45
+ export const PermissionAssociationReferenceSchema = PermissionPayloadSchema.pick('id', 'name', 'status').and({
46
+ model: "'Permission'",
47
+ });
@@ -0,0 +1,74 @@
1
+ export declare const RoleStatus: {
2
+ readonly ENABLED: "enabled";
3
+ readonly DISABLED: "disabled";
4
+ };
5
+ export type AnyRoleStatus = (typeof RoleStatus)[keyof typeof RoleStatus];
6
+ export declare const RoleIdPropertySchema: import("arktype/internal/methods/object.ts").ObjectType<{
7
+ id: string;
8
+ }, {}>;
9
+ export type RoleIdProperty = typeof RoleIdPropertySchema.inferOut;
10
+ export declare const RolePayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
11
+ id: string;
12
+ name: string;
13
+ status: "enabled" | "disabled";
14
+ createdAt: (In: string | Date) => import("arktype/internal/attributes.ts").Out<string>;
15
+ updatedAt: (In: string | Date) => import("arktype/internal/attributes.ts").Out<string>;
16
+ description?: string | undefined;
17
+ apps?: {
18
+ ids?: string[] | undefined;
19
+ count?: number[] | undefined;
20
+ } | undefined;
21
+ users?: {
22
+ ids?: string[] | undefined;
23
+ count?: number[] | undefined;
24
+ } | undefined;
25
+ permissions?: {
26
+ ids?: string[] | undefined;
27
+ count?: number[] | undefined;
28
+ } | undefined;
29
+ deletedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
30
+ deactivatedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | 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
+ } | undefined>) | undefined;
36
+ }, {}>;
37
+ export type RolePayload = typeof RolePayloadSchema.inferOut;
38
+ export declare const InsertRolePayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
39
+ id: import("arktype/internal/attributes.ts").Default<string, string>;
40
+ name: string;
41
+ status: import("arktype/internal/attributes.ts").Default<"enabled" | "disabled", "enabled">;
42
+ description?: string | undefined;
43
+ metadata?: ((In: {
44
+ [x: string]: string | number | boolean;
45
+ } | Map<string, string | number | boolean> | null | undefined) => import("arktype/internal/attributes.ts").Out<{
46
+ [x: string]: string | number | boolean;
47
+ } | undefined>) | undefined;
48
+ }, {}>;
49
+ export type InsertRolePayload = typeof InsertRolePayloadSchema.inferOut;
50
+ export declare const UpdateRolePayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
51
+ name?: string | undefined;
52
+ status?: "enabled" | "disabled" | undefined;
53
+ description?: string | undefined;
54
+ metadata?: ((In: {
55
+ [x: string]: string | number | boolean;
56
+ } | Map<string, string | number | boolean> | null | undefined) => import("arktype/internal/attributes.ts").Out<{
57
+ [x: string]: string | number | boolean;
58
+ } | undefined>) | undefined;
59
+ }, {}>;
60
+ export type UpdateRolePayload = typeof UpdateRolePayloadSchema.inferOut;
61
+ export declare const RoleAssociationsSchema: import("arktype/internal/methods/object.ts").ObjectType<{
62
+ apps?: string[] | undefined;
63
+ permissions?: string[] | undefined;
64
+ users?: string[] | undefined;
65
+ }, {}>;
66
+ export type RoleAssociations = typeof RoleAssociationsSchema.inferOut;
67
+ export declare const RoleAssociationReferenceSchema: import("arktype/internal/methods/object.ts").ObjectType<{
68
+ id: string;
69
+ name: string;
70
+ status: "enabled" | "disabled";
71
+ model: "Role";
72
+ }, {}>;
73
+ export type RoleAssociationReference = typeof RoleAssociationReferenceSchema.inferOut;
74
+ //# sourceMappingURL=role.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role.d.ts","sourceRoot":"","sources":["../../../../src/authorization/schema/role.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,UAAU;;;CAGb,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAIzE,eAAO,MAAM,oBAAoB;;MAE/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,oBAAoB,CAAC,QAAQ,CAAC;AAIlE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;MAaO,CAAC;AACtC,MAAM,MAAM,WAAW,GAAG,OAAO,iBAAiB,CAAC,QAAQ,CAAC;AAE5D,eAAO,MAAM,uBAAuB;;;;;;;;;;MAKC,CAAC;AACtC,MAAM,MAAM,iBAAiB,GAAG,OAAO,uBAAuB,CAAC,QAAQ,CAAC;AAExE,eAAO,MAAM,uBAAuB;;;;;;;;;MAIC,CAAC;AACtC,MAAM,MAAM,iBAAiB,GAAG,OAAO,uBAAuB,CAAC,QAAQ,CAAC;AAIxE,eAAO,MAAM,sBAAsB;;;;MAKjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,sBAAsB,CAAC,QAAQ,CAAC;AAEtE,eAAO,MAAM,8BAA8B;;;;;MAMzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAClC,OAAO,8BAA8B,CAAC,QAAQ,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { type } from 'arktype';
2
+ import { OptionalDatePayloadSchema, RequiredDatePayloadSchema, } from '../../common/index.js';
3
+ import { AggregateSchema } from '../../common/schema/aggregate.js';
4
+ import { MetadataPayloadPropertySchema } from '../../common/schema/metadata.js';
5
+ import { generateRoleId } from './utils.js';
6
+ export const RoleStatus = {
7
+ ENABLED: 'enabled',
8
+ DISABLED: 'disabled',
9
+ };
10
+ const RoleIdSchema = type.string;
11
+ export const RoleIdPropertySchema = type({
12
+ id: RoleIdSchema,
13
+ });
14
+ const StatusSchema = type.enumerated(RoleStatus.ENABLED, RoleStatus.DISABLED);
15
+ export const RolePayloadSchema = RoleIdPropertySchema.and({
16
+ name: type('string'),
17
+ status: StatusSchema,
18
+ description: type('string').optional(),
19
+ apps: AggregateSchema.optional(),
20
+ users: AggregateSchema.optional(),
21
+ permissions: AggregateSchema.optional(),
22
+ createdAt: RequiredDatePayloadSchema,
23
+ updatedAt: RequiredDatePayloadSchema,
24
+ 'deletedAt?': OptionalDatePayloadSchema,
25
+ 'deactivatedAt?': OptionalDatePayloadSchema,
26
+ })
27
+ .and(RoleIdPropertySchema)
28
+ .and(MetadataPayloadPropertySchema);
29
+ export const InsertRolePayloadSchema = type({
30
+ id: RoleIdSchema.default(() => generateRoleId()),
31
+ name: type('string'),
32
+ status: StatusSchema.default(RoleStatus.ENABLED),
33
+ description: type('string').optional(),
34
+ }).and(MetadataPayloadPropertySchema);
35
+ export const UpdateRolePayloadSchema = type({
36
+ name: type('string').optional(),
37
+ status: StatusSchema.optional(),
38
+ description: type('string').optional(),
39
+ }).and(MetadataPayloadPropertySchema);
40
+ const AssociationSchema = type('string[] | undefined');
41
+ export const RoleAssociationsSchema = type({
42
+ '+': 'delete',
43
+ apps: AssociationSchema.optional(),
44
+ permissions: AssociationSchema.optional(),
45
+ users: AssociationSchema.optional(),
46
+ });
47
+ export const RoleAssociationReferenceSchema = RolePayloadSchema.pick('id', 'name', 'status').and({
48
+ model: "'Role'",
49
+ });
@@ -0,0 +1,4 @@
1
+ export * from './permission.js';
2
+ export * from './role.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/authorization/schema/schema.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAE1B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './permission.js';
2
+ export * from './role.js';
3
+ export * from './utils.js';
@@ -0,0 +1,11 @@
1
+ export declare const Model: {
2
+ readonly Permission: {
3
+ readonly UIDPrefix: "per";
4
+ };
5
+ readonly Role: {
6
+ readonly UIDPrefix: "rol";
7
+ };
8
+ };
9
+ export declare function generatePermissionId(): string;
10
+ export declare function generateRoleId(): string;
11
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/authorization/schema/utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK;;;;;;;CAOR,CAAC;AAEX,wBAAgB,oBAAoB,WAEnC;AAED,wBAAgB,cAAc,WAE7B"}
@@ -0,0 +1,15 @@
1
+ import KSUID from 'ksuid';
2
+ export const Model = {
3
+ Permission: {
4
+ UIDPrefix: 'per',
5
+ },
6
+ Role: {
7
+ UIDPrefix: 'rol',
8
+ },
9
+ };
10
+ export function generatePermissionId() {
11
+ return `${Model.Permission.UIDPrefix}_${KSUID.randomSync().string}`;
12
+ }
13
+ export function generateRoleId() {
14
+ return `${Model.Role.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/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './schema/schema.js';
@@ -0,0 +1,6 @@
1
+ export declare const AggregateSchema: import("arktype/internal/methods/object.ts").ObjectType<{
2
+ ids?: string[] | undefined;
3
+ count?: number[] | undefined;
4
+ }, {}>;
5
+ export type Aggregate = typeof AggregateSchema.inferOut;
6
+ //# sourceMappingURL=aggregate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregate.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/aggregate.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;;;MAG1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,eAAe,CAAC,QAAQ,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { type } from 'arktype';
2
+ export const AggregateSchema = type({
3
+ ids: type('string[]').optional(),
4
+ count: type('number[]').optional(),
5
+ });
@@ -0,0 +1,39 @@
1
+ export declare const RequiredDateSchema: import("arktype/internal/methods/object.ts").ObjectType<Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>), {}>;
2
+ export declare const OptionalDateSchema: import("arktype/internal/methods/base.ts").BaseType<Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>) | undefined, {}>;
3
+ export type AnyRequiredDateType = typeof RequiredDateSchema.inferIn;
4
+ export type RequiredDate = typeof RequiredDateSchema.inferOut;
5
+ export type AnyOptionalDate = typeof OptionalDateSchema.inferIn;
6
+ export type OptionalDate = typeof OptionalDateSchema.inferOut;
7
+ export declare const RequiredDatePayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<(In: string | Date) => import("arktype/internal/attributes.ts").Out<string>, {}>;
8
+ export declare const OptionalDatePayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<(In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>, {}>;
9
+ export type RequiredDatePayload = typeof RequiredDatePayloadSchema.inferOut;
10
+ export type OptionalDatePayload = typeof OptionalDatePayloadSchema.inferOut;
11
+ /**
12
+ * Created At
13
+ */
14
+ export declare const CreatedAtPropertyPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
15
+ createdAt: (In: string | Date) => import("arktype/internal/attributes.ts").Out<string>;
16
+ }, {}>;
17
+ export type CreatedAtPropertyPayload = typeof CreatedAtPropertyPayloadSchema.inferOut;
18
+ /**
19
+ * Updated At
20
+ */
21
+ export declare const UpdatedAtPropertyPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
22
+ updatedAt: (In: string | Date) => import("arktype/internal/attributes.ts").Out<string>;
23
+ }, {}>;
24
+ export type UpdatedAtPropertyPayload = typeof UpdatedAtPropertyPayloadSchema.inferOut;
25
+ /**
26
+ * Deleted At
27
+ */
28
+ export declare const DeletedAtPropertyPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
29
+ deletedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
30
+ }, {}>;
31
+ export type DeletedAtPropertyPayload = typeof DeletedAtPropertyPayloadSchema.inferOut;
32
+ /**
33
+ * Deactivated At
34
+ */
35
+ export declare const DeactivatedAtPropertyPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<{
36
+ deactivatedAt?: ((In: string | Date | undefined) => import("arktype/internal/attributes.ts").Out<string | undefined>) | undefined;
37
+ }, {}>;
38
+ export type DeactivatedAtPropertyPayload = typeof DeactivatedAtPropertyPayloadSchema.inferOut;
39
+ //# sourceMappingURL=dates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/dates.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,yIAA2C,CAAC;AAC3E,eAAO,MAAM,kBAAkB,iJAAqC,CAAC;AAErE,MAAM,MAAM,mBAAmB,GAAG,OAAO,kBAAkB,CAAC,OAAO,CAAC;AACpE,MAAM,MAAM,YAAY,GAAG,OAAO,kBAAkB,CAAC,QAAQ,CAAC;AAE9D,MAAM,MAAM,eAAe,GAAG,OAAO,kBAAkB,CAAC,OAAO,CAAC;AAChE,MAAM,MAAM,YAAY,GAAG,OAAO,kBAAkB,CAAC,QAAQ,CAAC;AAG9D,eAAO,MAAM,yBAAyB,0IAErC,CAAC;AACF,eAAO,MAAM,yBAAyB,kKAErC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,OAAO,yBAAyB,CAAC,QAAQ,CAAC;AAC5E,MAAM,MAAM,mBAAmB,GAAG,OAAO,yBAAyB,CAAC,QAAQ,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,8BAA8B;;MAEzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAClC,OAAO,8BAA8B,CAAC,QAAQ,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,8BAA8B;;MAEzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAClC,OAAO,8BAA8B,CAAC,QAAQ,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,8BAA8B;;MAEzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAClC,OAAO,8BAA8B,CAAC,QAAQ,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,kCAAkC;;MAE7C,CAAC;AACH,MAAM,MAAM,4BAA4B,GACtC,OAAO,kCAAkC,CAAC,QAAQ,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { type } from 'arktype';
2
+ // Normalizing to a Date object
3
+ export const RequiredDateSchema = type('Date').or('string.date.iso.parse');
4
+ export const OptionalDateSchema = RequiredDateSchema.or('undefined');
5
+ // What the class property is serialized to
6
+ export const RequiredDatePayloadSchema = RequiredDateSchema.pipe.try((d) => d.toISOString());
7
+ export const OptionalDatePayloadSchema = OptionalDateSchema.pipe.try((d) => d?.toISOString());
8
+ /**
9
+ * Created At
10
+ */
11
+ export const CreatedAtPropertyPayloadSchema = type({
12
+ createdAt: RequiredDatePayloadSchema,
13
+ });
14
+ /**
15
+ * Updated At
16
+ */
17
+ export const UpdatedAtPropertyPayloadSchema = type({
18
+ updatedAt: RequiredDatePayloadSchema,
19
+ });
20
+ /**
21
+ * Deleted At
22
+ */
23
+ export const DeletedAtPropertyPayloadSchema = type({
24
+ 'deletedAt?': OptionalDatePayloadSchema,
25
+ });
26
+ /**
27
+ * Deactivated At
28
+ */
29
+ export const DeactivatedAtPropertyPayloadSchema = type({
30
+ 'deactivatedAt?': OptionalDatePayloadSchema,
31
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dates.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dates.test.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/dates.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,31 @@
1
+ import { type } from 'arktype';
2
+ import { describe, expect, test } from 'vitest';
3
+ import { RequiredDatePayloadSchema, RequiredDateSchema } from './dates.js';
4
+ describe('Common - Dates', () => {
5
+ describe('Date Schema', () => {
6
+ test('should accept an iso string', async () => {
7
+ const result = RequiredDateSchema(new Date().toISOString());
8
+ expect(result).not.toBeInstanceOf(type.errors);
9
+ expect(result).toBeInstanceOf(Date);
10
+ });
11
+ test('should accept a Date object', async () => {
12
+ const result = RequiredDateSchema(new Date());
13
+ expect(result).not.toBeInstanceOf(type.errors);
14
+ expect(result).toBeInstanceOf(Date);
15
+ });
16
+ });
17
+ describe('Payload Schema', () => {
18
+ test('should parse a Date to an ISO string', async () => {
19
+ const iso = new Date().toISOString();
20
+ const result = RequiredDatePayloadSchema(new Date(iso));
21
+ expect(result).not.toBeInstanceOf(type.errors);
22
+ expect(result).to.equal(iso);
23
+ });
24
+ test('should parse an ISO to an ISO string', async () => {
25
+ const iso = new Date().toISOString();
26
+ const result = RequiredDatePayloadSchema(iso);
27
+ expect(result).not.toBeInstanceOf(type.errors);
28
+ expect(result).to.equal(iso);
29
+ });
30
+ });
31
+ });
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Ref: https://datatracker.ietf.org/doc/html/rfc7518#section-3.1
3
+ */
4
+ export declare const Algorithm: {
5
+ DEFAULT: string;
6
+ HS256: string;
7
+ HS384: string;
8
+ HS512: string;
9
+ RS256: string;
10
+ RS384: string;
11
+ RS512: string;
12
+ ES256: string;
13
+ ES384: string;
14
+ ES512: string;
15
+ PS256: string;
16
+ PS384: string;
17
+ PS512: string;
18
+ };
19
+ export type AnyAlgorithm = (typeof Algorithm)[keyof typeof Algorithm];
20
+ export declare const AlgorithmSchema: import("arktype/internal/methods/string.ts").StringType<string, {}>;
21
+ //# sourceMappingURL=jwt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jwt.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/jwt.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;CAerB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAEtE,eAAO,MAAM,eAAe,qEAY3B,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { type } from 'arktype';
2
+ /**
3
+ * Ref: https://datatracker.ietf.org/doc/html/rfc7518#section-3.1
4
+ */
5
+ export const Algorithm = {
6
+ // DEFAULT: 'ES256',
7
+ DEFAULT: 'RS256',
8
+ HS256: 'HS256',
9
+ HS384: 'HS384',
10
+ HS512: 'HS512',
11
+ RS256: 'RS256',
12
+ RS384: 'RS384',
13
+ RS512: 'RS512',
14
+ ES256: 'ES256',
15
+ ES384: 'ES384',
16
+ ES512: 'ES512',
17
+ PS256: 'PS256',
18
+ PS384: 'PS384',
19
+ PS512: 'PS512',
20
+ };
21
+ export const AlgorithmSchema = type.enumerated(Algorithm.HS256, Algorithm.HS384, Algorithm.HS512, Algorithm.RS256, Algorithm.RS384, Algorithm.RS512, Algorithm.ES256, Algorithm.ES384, Algorithm.PS256, Algorithm.PS384, Algorithm.PS512);
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Record
3
+ */
4
+ declare const MetadataRecordSchema: import("arktype/internal/methods/object.ts").ObjectType<{
5
+ [x: string]: string | number | boolean;
6
+ }, {}>;
7
+ type MetadataRecord = typeof MetadataRecordSchema.inferOut;
8
+ /**
9
+ * Map
10
+ */
11
+ declare const MetadataMapSchema: import("arktype/internal/methods/object.ts").ObjectType<Map<string, string | number | boolean>, {}>;
12
+ export type MetadataMap = typeof MetadataMapSchema.inferOut;
13
+ export declare const MetadataPayloadSchema: import("arktype/internal/methods/object.ts").ObjectType<(In: {
14
+ [x: string]: string | number | boolean;
15
+ } | Map<string, string | number | boolean> | null | undefined) => import("arktype/internal/attributes.ts").Out<{
16
+ [x: string]: string | number | boolean;
17
+ } | undefined>, {}>;
18
+ export type MetadataPayload = typeof MetadataPayloadSchema.inferOut;
19
+ export declare const MetadataPayloadPropertySchema: import("arktype/internal/methods/object.ts").ObjectType<{
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 MetadataPayloadProperty = typeof MetadataPayloadPropertySchema.inferOut;
27
+ export declare const UpsertMetadataPayloadPropertySchema: import("arktype/internal/methods/object.ts").ObjectType<{
28
+ metadata?: ((In: {
29
+ [x: string]: string | number | boolean;
30
+ } | Map<string, string | number | boolean> | null | undefined) => import("arktype/internal/attributes.ts").Out<{
31
+ [x: string]: string | number | boolean;
32
+ } | null>) | undefined;
33
+ }, {}>;
34
+ export type UpsertMetadataPayloadProperty = typeof UpsertMetadataPayloadPropertySchema.inferOut;
35
+ export declare function buildMetadataPayload(map: MetadataMap | MetadataRecord): MetadataRecord | undefined;
36
+ export declare function buildUpsertMetadataPayload(map: MetadataMap | MetadataRecord): MetadataRecord | null;
37
+ export declare const MetadataMapPropertySchema: import("arktype/internal/methods/object.ts").ObjectType<{
38
+ metadata: (In: import("arktype/internal/attributes.ts").Default<unknown, Map<string, string | number | boolean>>) => import("arktype/internal/attributes.ts").Out<Map<string, string | number | boolean> | Map<string, any>>;
39
+ }, {}>;
40
+ export type MetadataMapProperty = typeof MetadataMapPropertySchema.inferOut;
41
+ export {};
42
+ //# sourceMappingURL=metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/metadata.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,QAAA,MAAM,oBAAoB;;MAA4C,CAAC;AACvE,KAAK,cAAc,GAAG,OAAO,oBAAoB,CAAC,QAAQ,CAAC;AAE3D;;GAEG;AACH,QAAA,MAAM,iBAAiB,qGAEtB,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,OAAO,iBAAiB,CAAC,QAAQ,CAAC;AAoB5D,eAAO,MAAM,qBAAqB;;;;mBAG6B,CAAC;AAChE,MAAM,MAAM,eAAe,GAAG,OAAO,qBAAqB,CAAC,QAAQ,CAAC;AAEpE,eAAO,MAAM,6BAA6B;;;;;;MAExC,CAAC;AACH,MAAM,MAAM,uBAAuB,GACjC,OAAO,6BAA6B,CAAC,QAAQ,CAAC;AAOhD,eAAO,MAAM,mCAAmC;;;;;;MAE9C,CAAC;AACH,MAAM,MAAM,6BAA6B,GACvC,OAAO,mCAAmC,CAAC,QAAQ,CAAC;AAEtD,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,WAAW,GAAG,cAAc,GAChC,cAAc,GAAG,SAAS,CAgB5B;AAED,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,WAAW,GAAG,cAAc,GAChC,cAAc,GAAG,IAAI,CAgBvB;AAQD,eAAO,MAAM,yBAAyB;;MAEpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,yBAAyB,CAAC,QAAQ,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { match, type } from 'arktype';
2
+ /**
3
+ * Value
4
+ */
5
+ const MetadataValueSchema = type('string | number | boolean');
6
+ /**
7
+ * Record
8
+ */
9
+ const MetadataRecordSchema = type({ '[string]': MetadataValueSchema });
10
+ /**
11
+ * Map
12
+ */
13
+ const MetadataMapSchema = type.instanceOf((Map));
14
+ /**
15
+ * Record To Map
16
+ */
17
+ const MetadataMapMatch = match({
18
+ undefined: () => new Map(),
19
+ })
20
+ .case(MetadataMapSchema, (s) => new Map(s))
21
+ .case(MetadataMapSchema, (s) => new Map(Object.entries(s || {}).map(([key, value]) => [key, value])))
22
+ .default(() => new Map());
23
+ export const MetadataPayloadSchema = type('undefined | null')
24
+ .or(MetadataMapSchema)
25
+ .or(MetadataRecordSchema)
26
+ .pipe((map) => (map ? buildMetadataPayload(map) : undefined));
27
+ export const MetadataPayloadPropertySchema = type({
28
+ 'metadata?': MetadataPayloadSchema,
29
+ });
30
+ const UpsertMetadataPayloadSchema = type('undefined | null')
31
+ .or(MetadataMapSchema)
32
+ .or(MetadataRecordSchema)
33
+ .pipe((map) => (map ? buildUpsertMetadataPayload(map) || null : null));
34
+ export const UpsertMetadataPayloadPropertySchema = type({
35
+ 'metadata?': UpsertMetadataPayloadSchema,
36
+ });
37
+ export function buildMetadataPayload(map) {
38
+ if (!(map instanceof Map)) {
39
+ return map;
40
+ }
41
+ const result = Array.from(map.entries()).reduce((result, [key, value]) => {
42
+ if (value == null || value === '') {
43
+ return result;
44
+ }
45
+ Object.assign(result, { [key]: value });
46
+ return result;
47
+ }, {});
48
+ return Object.keys(result).length ? result : undefined;
49
+ }
50
+ export function buildUpsertMetadataPayload(map) {
51
+ if (!(map instanceof Map)) {
52
+ return map;
53
+ }
54
+ const result = Array.from(map.entries()).reduce((result, [key, value]) => {
55
+ if (value == null || value === '') {
56
+ return result;
57
+ }
58
+ Object.assign(result, { [key]: value });
59
+ return result;
60
+ }, {});
61
+ return Object.keys(result).length ? result : null;
62
+ }
63
+ /**
64
+ * Map
65
+ */
66
+ const ToMetadataMapSchema = MetadataMapMatch.default(() => new Map());
67
+ export const MetadataMapPropertySchema = type({
68
+ metadata: ToMetadataMapSchema,
69
+ });
70
+ // export const metadataAttributeScope = scope({
71
+ // metadata: MetadataAttributeMatch.default(
72
+ // () => new Map<string, typeof MetadataAttributeValueSchema.inferOut>(),
73
+ // ),
74
+ // });
75
+ // export const metadataPropertyScope = scope({
76
+ // 'metadata?': MetadataPropertyItemSchema,
77
+ // });
78
+ // export const serializedMetadataScope = scope({
79
+ // metadata: SerializedMetadataSchema,
80
+ // });
81
+ // export const storageMetadataScope = scope({
82
+ // metadata: StorageMetadataSchema,
83
+ // });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=metadata.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.test.d.ts","sourceRoot":"","sources":["../../../../src/common/schema/metadata.test.ts"],"names":[],"mappings":""}