@hilbras/keystone 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (786) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/LICENSE +21 -0
  3. package/README.md +691 -0
  4. package/dist/cli.d.ts +3 -0
  5. package/dist/cli.d.ts.map +1 -0
  6. package/dist/cli.js +144 -0
  7. package/dist/cli.js.map +1 -0
  8. package/dist/config.d.ts +68 -0
  9. package/dist/config.d.ts.map +1 -0
  10. package/dist/config.js +118 -0
  11. package/dist/config.js.map +1 -0
  12. package/dist/container.d.ts +27 -0
  13. package/dist/container.d.ts.map +1 -0
  14. package/dist/container.js +14 -0
  15. package/dist/container.js.map +1 -0
  16. package/dist/db/index.d.ts +17 -0
  17. package/dist/db/index.d.ts.map +1 -0
  18. package/dist/db/index.js +46 -0
  19. package/dist/db/index.js.map +1 -0
  20. package/dist/db/migrations/0000_skinny_ben_parker.sql +553 -0
  21. package/dist/db/migrations/0001_brief_joseph.sql +10 -0
  22. package/dist/db/migrations/0002_add_account_lockout.sql +3 -0
  23. package/dist/db/migrations/0003_steep_rachel_grey.sql +1 -0
  24. package/dist/db/migrations/0004_clever_bill_hollister.sql +20 -0
  25. package/dist/db/migrations/0005_steep_the_call.sql +2 -0
  26. package/dist/db/migrations/0006_ambitious_boomer.sql +17 -0
  27. package/dist/db/migrations/0007_greedy_vindicator.sql +40 -0
  28. package/dist/db/migrations/meta/0000_snapshot.json +2964 -0
  29. package/dist/db/migrations/meta/0001_snapshot.json +3031 -0
  30. package/dist/db/migrations/meta/0003_snapshot.json +3051 -0
  31. package/dist/db/migrations/meta/0004_snapshot.json +3163 -0
  32. package/dist/db/migrations/meta/0005_snapshot.json +3177 -0
  33. package/dist/db/migrations/meta/0006_snapshot.json +3270 -0
  34. package/dist/db/migrations/meta/0007_snapshot.json +3489 -0
  35. package/dist/db/migrations/meta/_journal.json +62 -0
  36. package/dist/db/schema.d.ts +3671 -0
  37. package/dist/db/schema.d.ts.map +1 -0
  38. package/dist/db/schema.js +475 -0
  39. package/dist/db/schema.js.map +1 -0
  40. package/dist/db/seed.d.ts +2 -0
  41. package/dist/db/seed.d.ts.map +1 -0
  42. package/dist/db/seed.js +139 -0
  43. package/dist/db/seed.js.map +1 -0
  44. package/dist/di.d.ts +12 -0
  45. package/dist/di.d.ts.map +1 -0
  46. package/dist/di.js +56 -0
  47. package/dist/di.js.map +1 -0
  48. package/dist/index.d.ts +3 -0
  49. package/dist/index.d.ts.map +1 -0
  50. package/dist/index.js +295 -0
  51. package/dist/index.js.map +1 -0
  52. package/dist/lib/errors.d.ts +46 -0
  53. package/dist/lib/errors.d.ts.map +1 -0
  54. package/dist/lib/errors.js +78 -0
  55. package/dist/lib/errors.js.map +1 -0
  56. package/dist/lib/result.d.ts +21 -0
  57. package/dist/lib/result.d.ts.map +1 -0
  58. package/dist/lib/result.js +22 -0
  59. package/dist/lib/result.js.map +1 -0
  60. package/dist/lib/webhookSignature.d.ts +11 -0
  61. package/dist/lib/webhookSignature.d.ts.map +1 -0
  62. package/dist/lib/webhookSignature.js +35 -0
  63. package/dist/lib/webhookSignature.js.map +1 -0
  64. package/dist/plugins/appContext.d.ts +4 -0
  65. package/dist/plugins/appContext.d.ts.map +1 -0
  66. package/dist/plugins/appContext.js +63 -0
  67. package/dist/plugins/appContext.js.map +1 -0
  68. package/dist/plugins/audit.d.ts +11 -0
  69. package/dist/plugins/audit.d.ts.map +1 -0
  70. package/dist/plugins/audit.js +23 -0
  71. package/dist/plugins/audit.js.map +1 -0
  72. package/dist/plugins/auth.d.ts +21 -0
  73. package/dist/plugins/auth.d.ts.map +1 -0
  74. package/dist/plugins/auth.js +190 -0
  75. package/dist/plugins/auth.js.map +1 -0
  76. package/dist/plugins/metrics.d.ts +8 -0
  77. package/dist/plugins/metrics.d.ts.map +1 -0
  78. package/dist/plugins/metrics.js +36 -0
  79. package/dist/plugins/metrics.js.map +1 -0
  80. package/dist/plugins/mtls.d.ts +14 -0
  81. package/dist/plugins/mtls.d.ts.map +1 -0
  82. package/dist/plugins/mtls.js +76 -0
  83. package/dist/plugins/mtls.js.map +1 -0
  84. package/dist/plugins/permissions.d.ts +9 -0
  85. package/dist/plugins/permissions.d.ts.map +1 -0
  86. package/dist/plugins/permissions.js +20 -0
  87. package/dist/plugins/permissions.js.map +1 -0
  88. package/dist/plugins/rateLimit.d.ts +20 -0
  89. package/dist/plugins/rateLimit.d.ts.map +1 -0
  90. package/dist/plugins/rateLimit.js +101 -0
  91. package/dist/plugins/rateLimit.js.map +1 -0
  92. package/dist/plugins/requestLogger.d.ts +4 -0
  93. package/dist/plugins/requestLogger.d.ts.map +1 -0
  94. package/dist/plugins/requestLogger.js +20 -0
  95. package/dist/plugins/requestLogger.js.map +1 -0
  96. package/dist/plugins/tracing.d.ts +3 -0
  97. package/dist/plugins/tracing.d.ts.map +1 -0
  98. package/dist/plugins/tracing.js +21 -0
  99. package/dist/plugins/tracing.js.map +1 -0
  100. package/dist/repositories/apiKey.d.ts +40 -0
  101. package/dist/repositories/apiKey.d.ts.map +1 -0
  102. package/dist/repositories/apiKey.js +122 -0
  103. package/dist/repositories/apiKey.js.map +1 -0
  104. package/dist/repositories/application.d.ts +13 -0
  105. package/dist/repositories/application.d.ts.map +1 -0
  106. package/dist/repositories/application.js +57 -0
  107. package/dist/repositories/application.js.map +1 -0
  108. package/dist/repositories/audit.d.ts +13 -0
  109. package/dist/repositories/audit.d.ts.map +1 -0
  110. package/dist/repositories/audit.js +26 -0
  111. package/dist/repositories/audit.js.map +1 -0
  112. package/dist/repositories/index.d.ts +10 -0
  113. package/dist/repositories/index.d.ts.map +1 -0
  114. package/dist/repositories/index.js +10 -0
  115. package/dist/repositories/index.js.map +1 -0
  116. package/dist/repositories/oidcConnection.d.ts +131 -0
  117. package/dist/repositories/oidcConnection.d.ts.map +1 -0
  118. package/dist/repositories/oidcConnection.js +59 -0
  119. package/dist/repositories/oidcConnection.js.map +1 -0
  120. package/dist/repositories/organization.d.ts +44 -0
  121. package/dist/repositories/organization.d.ts.map +1 -0
  122. package/dist/repositories/organization.js +145 -0
  123. package/dist/repositories/organization.js.map +1 -0
  124. package/dist/repositories/permission.d.ts +24 -0
  125. package/dist/repositories/permission.d.ts.map +1 -0
  126. package/dist/repositories/permission.js +133 -0
  127. package/dist/repositories/permission.js.map +1 -0
  128. package/dist/repositories/samlConnection.d.ts +107 -0
  129. package/dist/repositories/samlConnection.d.ts.map +1 -0
  130. package/dist/repositories/samlConnection.js +53 -0
  131. package/dist/repositories/samlConnection.js.map +1 -0
  132. package/dist/repositories/session.d.ts +73 -0
  133. package/dist/repositories/session.d.ts.map +1 -0
  134. package/dist/repositories/session.js +68 -0
  135. package/dist/repositories/session.js.map +1 -0
  136. package/dist/repositories/types.d.ts +155 -0
  137. package/dist/repositories/types.d.ts.map +1 -0
  138. package/dist/repositories/types.js +2 -0
  139. package/dist/repositories/types.js.map +1 -0
  140. package/dist/repositories/user.d.ts +40 -0
  141. package/dist/repositories/user.d.ts.map +1 -0
  142. package/dist/repositories/user.js +135 -0
  143. package/dist/repositories/user.js.map +1 -0
  144. package/dist/routes/admin/billing.d.ts +3 -0
  145. package/dist/routes/admin/billing.d.ts.map +1 -0
  146. package/dist/routes/admin/billing.js +31 -0
  147. package/dist/routes/admin/billing.js.map +1 -0
  148. package/dist/routes/admin/helpers.d.ts +36 -0
  149. package/dist/routes/admin/helpers.d.ts.map +1 -0
  150. package/dist/routes/admin/helpers.js +45 -0
  151. package/dist/routes/admin/helpers.js.map +1 -0
  152. package/dist/routes/admin/index.d.ts +3 -0
  153. package/dist/routes/admin/index.d.ts.map +1 -0
  154. package/dist/routes/admin/index.js +15 -0
  155. package/dist/routes/admin/index.js.map +1 -0
  156. package/dist/routes/admin/organizations.d.ts +3 -0
  157. package/dist/routes/admin/organizations.d.ts.map +1 -0
  158. package/dist/routes/admin/organizations.js +222 -0
  159. package/dist/routes/admin/organizations.js.map +1 -0
  160. package/dist/routes/admin/permissions.d.ts +3 -0
  161. package/dist/routes/admin/permissions.d.ts.map +1 -0
  162. package/dist/routes/admin/permissions.js +63 -0
  163. package/dist/routes/admin/permissions.js.map +1 -0
  164. package/dist/routes/admin/platform.d.ts +3 -0
  165. package/dist/routes/admin/platform.d.ts.map +1 -0
  166. package/dist/routes/admin/platform.js +294 -0
  167. package/dist/routes/admin/platform.js.map +1 -0
  168. package/dist/routes/admin/sso.d.ts +3 -0
  169. package/dist/routes/admin/sso.d.ts.map +1 -0
  170. package/dist/routes/admin/sso.js +97 -0
  171. package/dist/routes/admin/sso.js.map +1 -0
  172. package/dist/routes/admin/webhooks.d.ts +3 -0
  173. package/dist/routes/admin/webhooks.d.ts.map +1 -0
  174. package/dist/routes/admin/webhooks.js +68 -0
  175. package/dist/routes/admin/webhooks.js.map +1 -0
  176. package/dist/routes/admin.d.ts +2 -0
  177. package/dist/routes/admin.d.ts.map +1 -0
  178. package/dist/routes/admin.js +2 -0
  179. package/dist/routes/admin.js.map +1 -0
  180. package/dist/routes/apiKeys.d.ts +3 -0
  181. package/dist/routes/apiKeys.d.ts.map +1 -0
  182. package/dist/routes/apiKeys.js +50 -0
  183. package/dist/routes/apiKeys.js.map +1 -0
  184. package/dist/routes/auth.d.ts +3 -0
  185. package/dist/routes/auth.d.ts.map +1 -0
  186. package/dist/routes/auth.js +174 -0
  187. package/dist/routes/auth.js.map +1 -0
  188. package/dist/routes/authz.d.ts +3 -0
  189. package/dist/routes/authz.d.ts.map +1 -0
  190. package/dist/routes/authz.js +28 -0
  191. package/dist/routes/authz.js.map +1 -0
  192. package/dist/routes/config.d.ts +3 -0
  193. package/dist/routes/config.d.ts.map +1 -0
  194. package/dist/routes/config.js +63 -0
  195. package/dist/routes/config.js.map +1 -0
  196. package/dist/routes/emailVerification.d.ts +3 -0
  197. package/dist/routes/emailVerification.d.ts.map +1 -0
  198. package/dist/routes/emailVerification.js +64 -0
  199. package/dist/routes/emailVerification.js.map +1 -0
  200. package/dist/routes/federation.d.ts +3 -0
  201. package/dist/routes/federation.d.ts.map +1 -0
  202. package/dist/routes/federation.js +133 -0
  203. package/dist/routes/federation.js.map +1 -0
  204. package/dist/routes/helpers.d.ts +14 -0
  205. package/dist/routes/helpers.d.ts.map +1 -0
  206. package/dist/routes/helpers.js +15 -0
  207. package/dist/routes/helpers.js.map +1 -0
  208. package/dist/routes/magicLinks.d.ts +3 -0
  209. package/dist/routes/magicLinks.d.ts.map +1 -0
  210. package/dist/routes/magicLinks.js +82 -0
  211. package/dist/routes/magicLinks.js.map +1 -0
  212. package/dist/routes/oauth.d.ts +3 -0
  213. package/dist/routes/oauth.d.ts.map +1 -0
  214. package/dist/routes/oauth.js +146 -0
  215. package/dist/routes/oauth.js.map +1 -0
  216. package/dist/routes/oauth2.d.ts +3 -0
  217. package/dist/routes/oauth2.d.ts.map +1 -0
  218. package/dist/routes/oauth2.js +219 -0
  219. package/dist/routes/oauth2.js.map +1 -0
  220. package/dist/routes/oidcEnterprise.d.ts +3 -0
  221. package/dist/routes/oidcEnterprise.d.ts.map +1 -0
  222. package/dist/routes/oidcEnterprise.js +119 -0
  223. package/dist/routes/oidcEnterprise.js.map +1 -0
  224. package/dist/routes/password.d.ts +3 -0
  225. package/dist/routes/password.d.ts.map +1 -0
  226. package/dist/routes/password.js +83 -0
  227. package/dist/routes/password.js.map +1 -0
  228. package/dist/routes/profile.d.ts +3 -0
  229. package/dist/routes/profile.d.ts.map +1 -0
  230. package/dist/routes/profile.js +43 -0
  231. package/dist/routes/profile.js.map +1 -0
  232. package/dist/routes/saml.d.ts +3 -0
  233. package/dist/routes/saml.d.ts.map +1 -0
  234. package/dist/routes/saml.js +164 -0
  235. package/dist/routes/saml.js.map +1 -0
  236. package/dist/routes/scim.d.ts +3 -0
  237. package/dist/routes/scim.d.ts.map +1 -0
  238. package/dist/routes/scim.js +175 -0
  239. package/dist/routes/scim.js.map +1 -0
  240. package/dist/routes/sdk.d.ts +3 -0
  241. package/dist/routes/sdk.d.ts.map +1 -0
  242. package/dist/routes/sdk.js +129 -0
  243. package/dist/routes/sdk.js.map +1 -0
  244. package/dist/routes/serviceAccounts.d.ts +3 -0
  245. package/dist/routes/serviceAccounts.d.ts.map +1 -0
  246. package/dist/routes/serviceAccounts.js +82 -0
  247. package/dist/routes/serviceAccounts.js.map +1 -0
  248. package/dist/routes/sessions.d.ts +3 -0
  249. package/dist/routes/sessions.d.ts.map +1 -0
  250. package/dist/routes/sessions.js +55 -0
  251. package/dist/routes/sessions.js.map +1 -0
  252. package/dist/routes/setup.d.ts +3 -0
  253. package/dist/routes/setup.d.ts.map +1 -0
  254. package/dist/routes/setup.js +304 -0
  255. package/dist/routes/setup.js.map +1 -0
  256. package/dist/routes/smsOtp.d.ts +3 -0
  257. package/dist/routes/smsOtp.d.ts.map +1 -0
  258. package/dist/routes/smsOtp.js +50 -0
  259. package/dist/routes/smsOtp.js.map +1 -0
  260. package/dist/routes/totp.d.ts +3 -0
  261. package/dist/routes/totp.d.ts.map +1 -0
  262. package/dist/routes/totp.js +78 -0
  263. package/dist/routes/totp.js.map +1 -0
  264. package/dist/routes/webauthn.d.ts +3 -0
  265. package/dist/routes/webauthn.d.ts.map +1 -0
  266. package/dist/routes/webauthn.js +100 -0
  267. package/dist/routes/webauthn.js.map +1 -0
  268. package/dist/routes/workflows.d.ts +3 -0
  269. package/dist/routes/workflows.d.ts.map +1 -0
  270. package/dist/routes/workflows.js +140 -0
  271. package/dist/routes/workflows.js.map +1 -0
  272. package/dist/sdk/index.d.ts +5 -0
  273. package/dist/sdk/index.d.ts.map +1 -0
  274. package/dist/sdk/index.js +125 -0
  275. package/dist/sdk/index.js.map +1 -0
  276. package/dist/sdk/types.d.ts +110 -0
  277. package/dist/sdk/types.d.ts.map +1 -0
  278. package/dist/sdk/types.js +2 -0
  279. package/dist/sdk/types.js.map +1 -0
  280. package/dist/services/anomalyDetection.d.ts +14 -0
  281. package/dist/services/anomalyDetection.d.ts.map +1 -0
  282. package/dist/services/anomalyDetection.js +68 -0
  283. package/dist/services/anomalyDetection.js.map +1 -0
  284. package/dist/services/application/authentication.d.ts +38 -0
  285. package/dist/services/application/authentication.d.ts.map +1 -0
  286. package/dist/services/application/authentication.js +48 -0
  287. package/dist/services/application/authentication.js.map +1 -0
  288. package/dist/services/application/identity.d.ts +34 -0
  289. package/dist/services/application/identity.d.ts.map +1 -0
  290. package/dist/services/application/identity.js +34 -0
  291. package/dist/services/application/identity.js.map +1 -0
  292. package/dist/services/application/index.d.ts +4 -0
  293. package/dist/services/application/index.d.ts.map +1 -0
  294. package/dist/services/application/index.js +4 -0
  295. package/dist/services/application/index.js.map +1 -0
  296. package/dist/services/application/organization.d.ts +44 -0
  297. package/dist/services/application/organization.d.ts.map +1 -0
  298. package/dist/services/application/organization.js +53 -0
  299. package/dist/services/application/organization.js.map +1 -0
  300. package/dist/services/applications.d.ts +25 -0
  301. package/dist/services/applications.d.ts.map +1 -0
  302. package/dist/services/applications.js +64 -0
  303. package/dist/services/applications.js.map +1 -0
  304. package/dist/services/audit.d.ts +16 -0
  305. package/dist/services/audit.d.ts.map +1 -0
  306. package/dist/services/audit.js +28 -0
  307. package/dist/services/audit.js.map +1 -0
  308. package/dist/services/auditExport.d.ts +17 -0
  309. package/dist/services/auditExport.d.ts.map +1 -0
  310. package/dist/services/auditExport.js +37 -0
  311. package/dist/services/auditExport.js.map +1 -0
  312. package/dist/services/billing.d.ts +23 -0
  313. package/dist/services/billing.d.ts.map +1 -0
  314. package/dist/services/billing.js +67 -0
  315. package/dist/services/billing.js.map +1 -0
  316. package/dist/services/cache.d.ts +23 -0
  317. package/dist/services/cache.d.ts.map +1 -0
  318. package/dist/services/cache.js +114 -0
  319. package/dist/services/cache.js.map +1 -0
  320. package/dist/services/configuration/profiles.d.ts +13 -0
  321. package/dist/services/configuration/profiles.d.ts.map +1 -0
  322. package/dist/services/configuration/profiles.js +108 -0
  323. package/dist/services/configuration/profiles.js.map +1 -0
  324. package/dist/services/configuration.d.ts +50 -0
  325. package/dist/services/configuration.d.ts.map +1 -0
  326. package/dist/services/configuration.js +74 -0
  327. package/dist/services/configuration.js.map +1 -0
  328. package/dist/services/connectors/google.d.ts +17 -0
  329. package/dist/services/connectors/google.d.ts.map +1 -0
  330. package/dist/services/connectors/google.js +81 -0
  331. package/dist/services/connectors/google.js.map +1 -0
  332. package/dist/services/connectors/oidc.d.ts +14 -0
  333. package/dist/services/connectors/oidc.d.ts.map +1 -0
  334. package/dist/services/connectors/oidc.js +100 -0
  335. package/dist/services/connectors/oidc.js.map +1 -0
  336. package/dist/services/connectors/registry.d.ts +13 -0
  337. package/dist/services/connectors/registry.d.ts.map +1 -0
  338. package/dist/services/connectors/registry.js +109 -0
  339. package/dist/services/connectors/registry.js.map +1 -0
  340. package/dist/services/connectors/types.d.ts +36 -0
  341. package/dist/services/connectors/types.d.ts.map +1 -0
  342. package/dist/services/connectors/types.js +2 -0
  343. package/dist/services/connectors/types.js.map +1 -0
  344. package/dist/services/connectors/zitadel.d.ts +14 -0
  345. package/dist/services/connectors/zitadel.d.ts.map +1 -0
  346. package/dist/services/connectors/zitadel.js +70 -0
  347. package/dist/services/connectors/zitadel.js.map +1 -0
  348. package/dist/services/devices.d.ts +4 -0
  349. package/dist/services/devices.d.ts.map +1 -0
  350. package/dist/services/devices.js +59 -0
  351. package/dist/services/devices.js.map +1 -0
  352. package/dist/services/domain/authentication.d.ts +51 -0
  353. package/dist/services/domain/authentication.d.ts.map +1 -0
  354. package/dist/services/domain/authentication.js +218 -0
  355. package/dist/services/domain/authentication.js.map +1 -0
  356. package/dist/services/domain/authorization.d.ts +20 -0
  357. package/dist/services/domain/authorization.d.ts.map +1 -0
  358. package/dist/services/domain/authorization.js +36 -0
  359. package/dist/services/domain/authorization.js.map +1 -0
  360. package/dist/services/domain/identity.d.ts +43 -0
  361. package/dist/services/domain/identity.d.ts.map +1 -0
  362. package/dist/services/domain/identity.js +75 -0
  363. package/dist/services/domain/identity.js.map +1 -0
  364. package/dist/services/domain/index.d.ts +5 -0
  365. package/dist/services/domain/index.d.ts.map +1 -0
  366. package/dist/services/domain/index.js +5 -0
  367. package/dist/services/domain/index.js.map +1 -0
  368. package/dist/services/domain/organization.d.ts +60 -0
  369. package/dist/services/domain/organization.d.ts.map +1 -0
  370. package/dist/services/domain/organization.js +87 -0
  371. package/dist/services/domain/organization.js.map +1 -0
  372. package/dist/services/email.d.ts +24 -0
  373. package/dist/services/email.d.ts.map +1 -0
  374. package/dist/services/email.js +127 -0
  375. package/dist/services/email.js.map +1 -0
  376. package/dist/services/emailVerification.d.ts +20 -0
  377. package/dist/services/emailVerification.d.ts.map +1 -0
  378. package/dist/services/emailVerification.js +58 -0
  379. package/dist/services/emailVerification.js.map +1 -0
  380. package/dist/services/enterpriseSso.d.ts +34 -0
  381. package/dist/services/enterpriseSso.d.ts.map +1 -0
  382. package/dist/services/enterpriseSso.js +40 -0
  383. package/dist/services/enterpriseSso.js.map +1 -0
  384. package/dist/services/events/bus.d.ts +9 -0
  385. package/dist/services/events/bus.d.ts.map +1 -0
  386. package/dist/services/events/bus.js +36 -0
  387. package/dist/services/events/bus.js.map +1 -0
  388. package/dist/services/events/subscribers/anomaly.d.ts +3 -0
  389. package/dist/services/events/subscribers/anomaly.d.ts.map +1 -0
  390. package/dist/services/events/subscribers/anomaly.js +13 -0
  391. package/dist/services/events/subscribers/anomaly.js.map +1 -0
  392. package/dist/services/events/subscribers/auditLog.d.ts +3 -0
  393. package/dist/services/events/subscribers/auditLog.d.ts.map +1 -0
  394. package/dist/services/events/subscribers/auditLog.js +21 -0
  395. package/dist/services/events/subscribers/auditLog.js.map +1 -0
  396. package/dist/services/events/subscribers/webhook.d.ts +3 -0
  397. package/dist/services/events/subscribers/webhook.d.ts.map +1 -0
  398. package/dist/services/events/subscribers/webhook.js +36 -0
  399. package/dist/services/events/subscribers/webhook.js.map +1 -0
  400. package/dist/services/events/subscribers/webhookDispatch.d.ts +7 -0
  401. package/dist/services/events/subscribers/webhookDispatch.d.ts.map +1 -0
  402. package/dist/services/events/subscribers/webhookDispatch.js +14 -0
  403. package/dist/services/events/subscribers/webhookDispatch.js.map +1 -0
  404. package/dist/services/events/types.d.ts +21 -0
  405. package/dist/services/events/types.d.ts.map +1 -0
  406. package/dist/services/events/types.js +8 -0
  407. package/dist/services/events/types.js.map +1 -0
  408. package/dist/services/events/validate.d.ts +9 -0
  409. package/dist/services/events/validate.d.ts.map +1 -0
  410. package/dist/services/events/validate.js +103 -0
  411. package/dist/services/events/validate.js.map +1 -0
  412. package/dist/services/featureFlags.d.ts +15 -0
  413. package/dist/services/featureFlags.d.ts.map +1 -0
  414. package/dist/services/featureFlags.js +74 -0
  415. package/dist/services/featureFlags.js.map +1 -0
  416. package/dist/services/features.d.ts +12 -0
  417. package/dist/services/features.d.ts.map +1 -0
  418. package/dist/services/features.js +17 -0
  419. package/dist/services/features.js.map +1 -0
  420. package/dist/services/federation.d.ts +12 -0
  421. package/dist/services/federation.d.ts.map +1 -0
  422. package/dist/services/federation.js +22 -0
  423. package/dist/services/federation.js.map +1 -0
  424. package/dist/services/hibp.d.ts +2 -0
  425. package/dist/services/hibp.d.ts.map +1 -0
  426. package/dist/services/hibp.js +29 -0
  427. package/dist/services/hibp.js.map +1 -0
  428. package/dist/services/ipControls.d.ts +7 -0
  429. package/dist/services/ipControls.d.ts.map +1 -0
  430. package/dist/services/ipControls.js +92 -0
  431. package/dist/services/ipControls.js.map +1 -0
  432. package/dist/services/magicLinks.d.ts +16 -0
  433. package/dist/services/magicLinks.d.ts.map +1 -0
  434. package/dist/services/magicLinks.js +39 -0
  435. package/dist/services/magicLinks.js.map +1 -0
  436. package/dist/services/oauth2.d.ts +58 -0
  437. package/dist/services/oauth2.d.ts.map +1 -0
  438. package/dist/services/oauth2.js +144 -0
  439. package/dist/services/oauth2.js.map +1 -0
  440. package/dist/services/organizations.d.ts +39 -0
  441. package/dist/services/organizations.d.ts.map +1 -0
  442. package/dist/services/organizations.js +135 -0
  443. package/dist/services/organizations.js.map +1 -0
  444. package/dist/services/permissions.d.ts +19 -0
  445. package/dist/services/permissions.d.ts.map +1 -0
  446. package/dist/services/permissions.js +119 -0
  447. package/dist/services/permissions.js.map +1 -0
  448. package/dist/services/plugins/registry.d.ts +17 -0
  449. package/dist/services/plugins/registry.d.ts.map +1 -0
  450. package/dist/services/plugins/registry.js +196 -0
  451. package/dist/services/plugins/registry.js.map +1 -0
  452. package/dist/services/plugins/types.d.ts +86 -0
  453. package/dist/services/plugins/types.d.ts.map +1 -0
  454. package/dist/services/plugins/types.js +2 -0
  455. package/dist/services/plugins/types.js.map +1 -0
  456. package/dist/services/queue/bullmq.d.ts +16 -0
  457. package/dist/services/queue/bullmq.d.ts.map +1 -0
  458. package/dist/services/queue/bullmq.js +89 -0
  459. package/dist/services/queue/bullmq.js.map +1 -0
  460. package/dist/services/queue/inProcess.d.ts +15 -0
  461. package/dist/services/queue/inProcess.d.ts.map +1 -0
  462. package/dist/services/queue/inProcess.js +63 -0
  463. package/dist/services/queue/inProcess.js.map +1 -0
  464. package/dist/services/queue/index.d.ts +7 -0
  465. package/dist/services/queue/index.d.ts.map +1 -0
  466. package/dist/services/queue/index.js +19 -0
  467. package/dist/services/queue/index.js.map +1 -0
  468. package/dist/services/queue/types.d.ts +24 -0
  469. package/dist/services/queue/types.d.ts.map +1 -0
  470. package/dist/services/queue/types.js +2 -0
  471. package/dist/services/queue/types.js.map +1 -0
  472. package/dist/services/redis.d.ts +9 -0
  473. package/dist/services/redis.d.ts.map +1 -0
  474. package/dist/services/redis.js +15 -0
  475. package/dist/services/redis.js.map +1 -0
  476. package/dist/services/secrets/awsKms.d.ts +41 -0
  477. package/dist/services/secrets/awsKms.d.ts.map +1 -0
  478. package/dist/services/secrets/awsKms.js +81 -0
  479. package/dist/services/secrets/awsKms.js.map +1 -0
  480. package/dist/services/secrets/azureKeyVault.d.ts +44 -0
  481. package/dist/services/secrets/azureKeyVault.d.ts.map +1 -0
  482. package/dist/services/secrets/azureKeyVault.js +152 -0
  483. package/dist/services/secrets/azureKeyVault.js.map +1 -0
  484. package/dist/services/secrets/database.d.ts +29 -0
  485. package/dist/services/secrets/database.d.ts.map +1 -0
  486. package/dist/services/secrets/database.js +138 -0
  487. package/dist/services/secrets/database.js.map +1 -0
  488. package/dist/services/secrets/environment.d.ts +27 -0
  489. package/dist/services/secrets/environment.d.ts.map +1 -0
  490. package/dist/services/secrets/environment.js +102 -0
  491. package/dist/services/secrets/environment.js.map +1 -0
  492. package/dist/services/secrets/index.d.ts +30 -0
  493. package/dist/services/secrets/index.d.ts.map +1 -0
  494. package/dist/services/secrets/index.js +46 -0
  495. package/dist/services/secrets/index.js.map +1 -0
  496. package/dist/services/secrets/password.d.ts +10 -0
  497. package/dist/services/secrets/password.d.ts.map +1 -0
  498. package/dist/services/secrets/password.js +62 -0
  499. package/dist/services/secrets/password.js.map +1 -0
  500. package/dist/services/secrets/provider.d.ts +36 -0
  501. package/dist/services/secrets/provider.d.ts.map +1 -0
  502. package/dist/services/secrets/provider.js +2 -0
  503. package/dist/services/secrets/provider.js.map +1 -0
  504. package/dist/services/secrets/vault.d.ts +41 -0
  505. package/dist/services/secrets/vault.d.ts.map +1 -0
  506. package/dist/services/secrets/vault.js +133 -0
  507. package/dist/services/secrets/vault.js.map +1 -0
  508. package/dist/services/secrets.d.ts +2 -0
  509. package/dist/services/secrets.d.ts.map +1 -0
  510. package/dist/services/secrets.js +3 -0
  511. package/dist/services/secrets.js.map +1 -0
  512. package/dist/services/serviceAccounts.d.ts +24 -0
  513. package/dist/services/serviceAccounts.d.ts.map +1 -0
  514. package/dist/services/serviceAccounts.js +53 -0
  515. package/dist/services/serviceAccounts.js.map +1 -0
  516. package/dist/services/setup/configWriter.d.ts +18 -0
  517. package/dist/services/setup/configWriter.d.ts.map +1 -0
  518. package/dist/services/setup/configWriter.js +192 -0
  519. package/dist/services/setup/configWriter.js.map +1 -0
  520. package/dist/services/setup/diagnostics.d.ts +7 -0
  521. package/dist/services/setup/diagnostics.d.ts.map +1 -0
  522. package/dist/services/setup/diagnostics.js +73 -0
  523. package/dist/services/setup/diagnostics.js.map +1 -0
  524. package/dist/services/setup/token.d.ts +5 -0
  525. package/dist/services/setup/token.d.ts.map +1 -0
  526. package/dist/services/setup/token.js +37 -0
  527. package/dist/services/setup/token.js.map +1 -0
  528. package/dist/services/setup/types.d.ts +35 -0
  529. package/dist/services/setup/types.d.ts.map +1 -0
  530. package/dist/services/setup/types.js +2 -0
  531. package/dist/services/setup/types.js.map +1 -0
  532. package/dist/services/setup/validation.d.ts +7 -0
  533. package/dist/services/setup/validation.d.ts.map +1 -0
  534. package/dist/services/setup/validation.js +198 -0
  535. package/dist/services/setup/validation.js.map +1 -0
  536. package/dist/services/sms.d.ts +10 -0
  537. package/dist/services/sms.d.ts.map +1 -0
  538. package/dist/services/sms.js +62 -0
  539. package/dist/services/sms.js.map +1 -0
  540. package/dist/services/smsOtp.d.ts +7 -0
  541. package/dist/services/smsOtp.d.ts.map +1 -0
  542. package/dist/services/smsOtp.js +56 -0
  543. package/dist/services/smsOtp.js.map +1 -0
  544. package/dist/services/tokens.d.ts +66 -0
  545. package/dist/services/tokens.d.ts.map +1 -0
  546. package/dist/services/tokens.js +205 -0
  547. package/dist/services/tokens.js.map +1 -0
  548. package/dist/services/totp.d.ts +16 -0
  549. package/dist/services/totp.d.ts.map +1 -0
  550. package/dist/services/totp.js +96 -0
  551. package/dist/services/totp.js.map +1 -0
  552. package/dist/services/users.d.ts +39 -0
  553. package/dist/services/users.d.ts.map +1 -0
  554. package/dist/services/users.js +181 -0
  555. package/dist/services/users.js.map +1 -0
  556. package/dist/services/webauthn.d.ts +45 -0
  557. package/dist/services/webauthn.d.ts.map +1 -0
  558. package/dist/services/webauthn.js +147 -0
  559. package/dist/services/webauthn.js.map +1 -0
  560. package/dist/services/webhooks.d.ts +86 -0
  561. package/dist/services/webhooks.d.ts.map +1 -0
  562. package/dist/services/webhooks.js +164 -0
  563. package/dist/services/webhooks.js.map +1 -0
  564. package/dist/services/workflows/engine.d.ts +18 -0
  565. package/dist/services/workflows/engine.d.ts.map +1 -0
  566. package/dist/services/workflows/engine.js +104 -0
  567. package/dist/services/workflows/engine.js.map +1 -0
  568. package/dist/services/workflows/steps.d.ts +17 -0
  569. package/dist/services/workflows/steps.d.ts.map +1 -0
  570. package/dist/services/workflows/steps.js +109 -0
  571. package/dist/services/workflows/steps.js.map +1 -0
  572. package/dist/services/zitadel.d.ts +21 -0
  573. package/dist/services/zitadel.d.ts.map +1 -0
  574. package/dist/services/zitadel.js +228 -0
  575. package/dist/services/zitadel.js.map +1 -0
  576. package/dist/setup-server.d.ts +2 -0
  577. package/dist/setup-server.d.ts.map +1 -0
  578. package/dist/setup-server.js +63 -0
  579. package/dist/setup-server.js.map +1 -0
  580. package/dist/tests/errors.test.d.ts +2 -0
  581. package/dist/tests/errors.test.d.ts.map +1 -0
  582. package/dist/tests/errors.test.js +64 -0
  583. package/dist/tests/errors.test.js.map +1 -0
  584. package/dist/tests/events.test.d.ts +2 -0
  585. package/dist/tests/events.test.d.ts.map +1 -0
  586. package/dist/tests/events.test.js +45 -0
  587. package/dist/tests/events.test.js.map +1 -0
  588. package/dist/tests/featureFlags.test.d.ts +2 -0
  589. package/dist/tests/featureFlags.test.d.ts.map +1 -0
  590. package/dist/tests/featureFlags.test.js +24 -0
  591. package/dist/tests/featureFlags.test.js.map +1 -0
  592. package/dist/tests/integration/queue.test.d.ts +2 -0
  593. package/dist/tests/integration/queue.test.d.ts.map +1 -0
  594. package/dist/tests/integration/queue.test.js +49 -0
  595. package/dist/tests/integration/queue.test.js.map +1 -0
  596. package/dist/tests/plugins.test.d.ts +2 -0
  597. package/dist/tests/plugins.test.d.ts.map +1 -0
  598. package/dist/tests/plugins.test.js +56 -0
  599. package/dist/tests/plugins.test.js.map +1 -0
  600. package/dist/tests/result.test.d.ts +2 -0
  601. package/dist/tests/result.test.d.ts.map +1 -0
  602. package/dist/tests/result.test.js +46 -0
  603. package/dist/tests/result.test.js.map +1 -0
  604. package/dist/tests/setup/configWriter.test.d.ts +2 -0
  605. package/dist/tests/setup/configWriter.test.d.ts.map +1 -0
  606. package/dist/tests/setup/configWriter.test.js +55 -0
  607. package/dist/tests/setup/configWriter.test.js.map +1 -0
  608. package/dist/tests/setup/validation.test.d.ts +2 -0
  609. package/dist/tests/setup/validation.test.d.ts.map +1 -0
  610. package/dist/tests/setup/validation.test.js +26 -0
  611. package/dist/tests/setup/validation.test.js.map +1 -0
  612. package/dist/tests/smoke.test.d.ts +2 -0
  613. package/dist/tests/smoke.test.d.ts.map +1 -0
  614. package/dist/tests/smoke.test.js +124 -0
  615. package/dist/tests/smoke.test.js.map +1 -0
  616. package/dist/types.d.ts +50 -0
  617. package/dist/types.d.ts.map +1 -0
  618. package/dist/types.js +17 -0
  619. package/dist/types.js.map +1 -0
  620. package/package.json +69 -0
  621. package/src/cli.ts +172 -0
  622. package/src/config.ts +143 -0
  623. package/src/container.ts +48 -0
  624. package/src/db/index.ts +53 -0
  625. package/src/db/migrations/0000_skinny_ben_parker.sql +553 -0
  626. package/src/db/migrations/0001_brief_joseph.sql +10 -0
  627. package/src/db/migrations/0002_add_account_lockout.sql +3 -0
  628. package/src/db/migrations/0003_steep_rachel_grey.sql +1 -0
  629. package/src/db/migrations/0004_clever_bill_hollister.sql +20 -0
  630. package/src/db/migrations/0005_steep_the_call.sql +2 -0
  631. package/src/db/migrations/0006_ambitious_boomer.sql +17 -0
  632. package/src/db/migrations/0007_greedy_vindicator.sql +40 -0
  633. package/src/db/migrations/meta/0000_snapshot.json +2964 -0
  634. package/src/db/migrations/meta/0001_snapshot.json +3031 -0
  635. package/src/db/migrations/meta/0003_snapshot.json +3051 -0
  636. package/src/db/migrations/meta/0004_snapshot.json +3163 -0
  637. package/src/db/migrations/meta/0005_snapshot.json +3177 -0
  638. package/src/db/migrations/meta/0006_snapshot.json +3270 -0
  639. package/src/db/migrations/meta/0007_snapshot.json +3489 -0
  640. package/src/db/migrations/meta/_journal.json +62 -0
  641. package/src/db/schema.ts +676 -0
  642. package/src/db/seed.ts +146 -0
  643. package/src/di.ts +81 -0
  644. package/src/index.ts +326 -0
  645. package/src/lib/errors.ts +139 -0
  646. package/src/lib/result.ts +44 -0
  647. package/src/lib/webhookSignature.ts +41 -0
  648. package/src/plugins/appContext.ts +76 -0
  649. package/src/plugins/audit.ts +42 -0
  650. package/src/plugins/auth.ts +230 -0
  651. package/src/plugins/metrics.ts +41 -0
  652. package/src/plugins/mtls.ts +94 -0
  653. package/src/plugins/permissions.ts +29 -0
  654. package/src/plugins/rateLimit.ts +133 -0
  655. package/src/plugins/requestLogger.ts +25 -0
  656. package/src/plugins/tracing.ts +22 -0
  657. package/src/repositories/apiKey.ts +158 -0
  658. package/src/repositories/application.ts +70 -0
  659. package/src/repositories/audit.ts +32 -0
  660. package/src/repositories/index.ts +9 -0
  661. package/src/repositories/oidcConnection.ts +111 -0
  662. package/src/repositories/organization.ts +167 -0
  663. package/src/repositories/permission.ts +153 -0
  664. package/src/repositories/samlConnection.ts +96 -0
  665. package/src/repositories/session.ts +86 -0
  666. package/src/repositories/types.ts +134 -0
  667. package/src/repositories/user.ts +161 -0
  668. package/src/routes/admin/billing.ts +48 -0
  669. package/src/routes/admin/helpers.ts +50 -0
  670. package/src/routes/admin/index.ts +16 -0
  671. package/src/routes/admin/organizations.ts +299 -0
  672. package/src/routes/admin/permissions.ts +80 -0
  673. package/src/routes/admin/platform.ts +335 -0
  674. package/src/routes/admin/sso.ts +138 -0
  675. package/src/routes/admin/webhooks.ts +73 -0
  676. package/src/routes/admin.ts +1 -0
  677. package/src/routes/apiKeys.ts +60 -0
  678. package/src/routes/auth.ts +214 -0
  679. package/src/routes/authz.ts +38 -0
  680. package/src/routes/config.ts +67 -0
  681. package/src/routes/emailVerification.ts +73 -0
  682. package/src/routes/federation.ts +156 -0
  683. package/src/routes/helpers.ts +17 -0
  684. package/src/routes/magicLinks.ts +107 -0
  685. package/src/routes/oauth.ts +167 -0
  686. package/src/routes/oauth2.ts +284 -0
  687. package/src/routes/oidcEnterprise.ts +166 -0
  688. package/src/routes/password.ts +90 -0
  689. package/src/routes/profile.ts +44 -0
  690. package/src/routes/saml.ts +209 -0
  691. package/src/routes/scim.ts +199 -0
  692. package/src/routes/sdk.ts +141 -0
  693. package/src/routes/serviceAccounts.ts +124 -0
  694. package/src/routes/sessions.ts +62 -0
  695. package/src/routes/setup.ts +315 -0
  696. package/src/routes/smsOtp.ts +67 -0
  697. package/src/routes/totp.ts +122 -0
  698. package/src/routes/webauthn.ts +147 -0
  699. package/src/routes/workflows.ts +157 -0
  700. package/src/sdk/index.ts +152 -0
  701. package/src/sdk/types.ts +54 -0
  702. package/src/services/anomalyDetection.ts +73 -0
  703. package/src/services/application/authentication.ts +75 -0
  704. package/src/services/application/identity.ts +56 -0
  705. package/src/services/application/index.ts +3 -0
  706. package/src/services/application/organization.ts +77 -0
  707. package/src/services/applications.ts +89 -0
  708. package/src/services/audit.ts +41 -0
  709. package/src/services/auditExport.ts +59 -0
  710. package/src/services/billing.ts +87 -0
  711. package/src/services/cache.ts +131 -0
  712. package/src/services/configuration/profiles.ts +115 -0
  713. package/src/services/configuration.ts +120 -0
  714. package/src/services/connectors/google.ts +92 -0
  715. package/src/services/connectors/oidc.ts +111 -0
  716. package/src/services/connectors/registry.ts +124 -0
  717. package/src/services/connectors/types.ts +38 -0
  718. package/src/services/connectors/zitadel.ts +77 -0
  719. package/src/services/devices.ts +76 -0
  720. package/src/services/domain/authentication.ts +279 -0
  721. package/src/services/domain/authorization.ts +49 -0
  722. package/src/services/domain/identity.ts +108 -0
  723. package/src/services/domain/index.ts +4 -0
  724. package/src/services/domain/organization.ts +114 -0
  725. package/src/services/email.ts +167 -0
  726. package/src/services/emailVerification.ts +75 -0
  727. package/src/services/enterpriseSso.ts +58 -0
  728. package/src/services/events/bus.ts +43 -0
  729. package/src/services/events/subscribers/anomaly.ts +13 -0
  730. package/src/services/events/subscribers/auditLog.ts +21 -0
  731. package/src/services/events/subscribers/webhook.ts +39 -0
  732. package/src/services/events/subscribers/webhookDispatch.ts +14 -0
  733. package/src/services/events/types.ts +106 -0
  734. package/src/services/events/validate.ts +118 -0
  735. package/src/services/featureFlags.ts +90 -0
  736. package/src/services/features.ts +22 -0
  737. package/src/services/federation.ts +30 -0
  738. package/src/services/hibp.ts +28 -0
  739. package/src/services/ipControls.ts +99 -0
  740. package/src/services/magicLinks.ts +51 -0
  741. package/src/services/oauth2.ts +216 -0
  742. package/src/services/organizations.ts +171 -0
  743. package/src/services/permissions.ts +146 -0
  744. package/src/services/plugins/registry.ts +242 -0
  745. package/src/services/plugins/types.ts +98 -0
  746. package/src/services/queue/bullmq.ts +104 -0
  747. package/src/services/queue/inProcess.ts +75 -0
  748. package/src/services/queue/index.ts +19 -0
  749. package/src/services/queue/types.ts +26 -0
  750. package/src/services/redis.ts +16 -0
  751. package/src/services/secrets/awsKms.ts +97 -0
  752. package/src/services/secrets/azureKeyVault.ts +171 -0
  753. package/src/services/secrets/database.ts +166 -0
  754. package/src/services/secrets/environment.ts +117 -0
  755. package/src/services/secrets/index.ts +50 -0
  756. package/src/services/secrets/password.ts +73 -0
  757. package/src/services/secrets/provider.ts +38 -0
  758. package/src/services/secrets/vault.ts +149 -0
  759. package/src/services/secrets.ts +2 -0
  760. package/src/services/serviceAccounts.ts +74 -0
  761. package/src/services/setup/configWriter.ts +200 -0
  762. package/src/services/setup/diagnostics.ts +76 -0
  763. package/src/services/setup/token.ts +42 -0
  764. package/src/services/setup/types.ts +40 -0
  765. package/src/services/setup/validation.ts +205 -0
  766. package/src/services/sms.ts +81 -0
  767. package/src/services/smsOtp.ts +74 -0
  768. package/src/services/tokens.ts +288 -0
  769. package/src/services/totp.ts +113 -0
  770. package/src/services/users.ts +239 -0
  771. package/src/services/webauthn.ts +193 -0
  772. package/src/services/webhooks.ts +190 -0
  773. package/src/services/workflows/engine.ts +125 -0
  774. package/src/services/workflows/steps.ts +129 -0
  775. package/src/services/zitadel.ts +277 -0
  776. package/src/setup-server.ts +71 -0
  777. package/src/tests/errors.test.ts +74 -0
  778. package/src/tests/events.test.ts +52 -0
  779. package/src/tests/featureFlags.test.ts +26 -0
  780. package/src/tests/integration/queue.test.ts +54 -0
  781. package/src/tests/plugins.test.ts +73 -0
  782. package/src/tests/result.test.ts +52 -0
  783. package/src/tests/setup/configWriter.test.ts +69 -0
  784. package/src/tests/setup/validation.test.ts +29 -0
  785. package/src/tests/smoke.test.ts +136 -0
  786. package/src/types.ts +70 -0
@@ -0,0 +1,2964 @@
1
+ {
2
+ "id": "7dbcd237-b616-4cf3-83a2-e63a39fcbd35",
3
+ "prevId": "00000000-0000-0000-0000-000000000000",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.api_keys": {
8
+ "name": "api_keys",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true,
16
+ "default": "gen_random_uuid()"
17
+ },
18
+ "user_id": {
19
+ "name": "user_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": false
23
+ },
24
+ "service_account_id": {
25
+ "name": "service_account_id",
26
+ "type": "uuid",
27
+ "primaryKey": false,
28
+ "notNull": false
29
+ },
30
+ "org_id": {
31
+ "name": "org_id",
32
+ "type": "uuid",
33
+ "primaryKey": false,
34
+ "notNull": false
35
+ },
36
+ "app_id": {
37
+ "name": "app_id",
38
+ "type": "uuid",
39
+ "primaryKey": false,
40
+ "notNull": false
41
+ },
42
+ "name": {
43
+ "name": "name",
44
+ "type": "text",
45
+ "primaryKey": false,
46
+ "notNull": false
47
+ },
48
+ "prefix": {
49
+ "name": "prefix",
50
+ "type": "text",
51
+ "primaryKey": false,
52
+ "notNull": true
53
+ },
54
+ "key_hash": {
55
+ "name": "key_hash",
56
+ "type": "text",
57
+ "primaryKey": false,
58
+ "notNull": true
59
+ },
60
+ "scopes": {
61
+ "name": "scopes",
62
+ "type": "text[]",
63
+ "primaryKey": false,
64
+ "notNull": true,
65
+ "default": "'{\"api:read\"}'::text[]"
66
+ },
67
+ "last_used_at": {
68
+ "name": "last_used_at",
69
+ "type": "timestamp with time zone",
70
+ "primaryKey": false,
71
+ "notNull": false
72
+ },
73
+ "expires_at": {
74
+ "name": "expires_at",
75
+ "type": "timestamp with time zone",
76
+ "primaryKey": false,
77
+ "notNull": false
78
+ },
79
+ "revoked_at": {
80
+ "name": "revoked_at",
81
+ "type": "timestamp with time zone",
82
+ "primaryKey": false,
83
+ "notNull": false
84
+ },
85
+ "created_at": {
86
+ "name": "created_at",
87
+ "type": "timestamp with time zone",
88
+ "primaryKey": false,
89
+ "notNull": true,
90
+ "default": "now()"
91
+ }
92
+ },
93
+ "indexes": {
94
+ "api_keys_user_idx": {
95
+ "name": "api_keys_user_idx",
96
+ "columns": [
97
+ {
98
+ "expression": "user_id",
99
+ "isExpression": false,
100
+ "asc": true,
101
+ "nulls": "last"
102
+ }
103
+ ],
104
+ "isUnique": false,
105
+ "concurrently": false,
106
+ "method": "btree",
107
+ "with": {}
108
+ },
109
+ "api_keys_service_account_idx": {
110
+ "name": "api_keys_service_account_idx",
111
+ "columns": [
112
+ {
113
+ "expression": "service_account_id",
114
+ "isExpression": false,
115
+ "asc": true,
116
+ "nulls": "last"
117
+ }
118
+ ],
119
+ "isUnique": false,
120
+ "concurrently": false,
121
+ "method": "btree",
122
+ "with": {}
123
+ },
124
+ "api_keys_prefix_idx": {
125
+ "name": "api_keys_prefix_idx",
126
+ "columns": [
127
+ {
128
+ "expression": "prefix",
129
+ "isExpression": false,
130
+ "asc": true,
131
+ "nulls": "last"
132
+ }
133
+ ],
134
+ "isUnique": false,
135
+ "concurrently": false,
136
+ "method": "btree",
137
+ "with": {}
138
+ }
139
+ },
140
+ "foreignKeys": {
141
+ "api_keys_user_id_users_id_fk": {
142
+ "name": "api_keys_user_id_users_id_fk",
143
+ "tableFrom": "api_keys",
144
+ "tableTo": "users",
145
+ "columnsFrom": [
146
+ "user_id"
147
+ ],
148
+ "columnsTo": [
149
+ "id"
150
+ ],
151
+ "onDelete": "cascade",
152
+ "onUpdate": "no action"
153
+ },
154
+ "api_keys_service_account_id_service_accounts_id_fk": {
155
+ "name": "api_keys_service_account_id_service_accounts_id_fk",
156
+ "tableFrom": "api_keys",
157
+ "tableTo": "service_accounts",
158
+ "columnsFrom": [
159
+ "service_account_id"
160
+ ],
161
+ "columnsTo": [
162
+ "id"
163
+ ],
164
+ "onDelete": "cascade",
165
+ "onUpdate": "no action"
166
+ },
167
+ "api_keys_org_id_organizations_id_fk": {
168
+ "name": "api_keys_org_id_organizations_id_fk",
169
+ "tableFrom": "api_keys",
170
+ "tableTo": "organizations",
171
+ "columnsFrom": [
172
+ "org_id"
173
+ ],
174
+ "columnsTo": [
175
+ "id"
176
+ ],
177
+ "onDelete": "set null",
178
+ "onUpdate": "no action"
179
+ },
180
+ "api_keys_app_id_applications_id_fk": {
181
+ "name": "api_keys_app_id_applications_id_fk",
182
+ "tableFrom": "api_keys",
183
+ "tableTo": "applications",
184
+ "columnsFrom": [
185
+ "app_id"
186
+ ],
187
+ "columnsTo": [
188
+ "id"
189
+ ],
190
+ "onDelete": "set null",
191
+ "onUpdate": "no action"
192
+ }
193
+ },
194
+ "compositePrimaryKeys": {},
195
+ "uniqueConstraints": {}
196
+ },
197
+ "public.applications": {
198
+ "name": "applications",
199
+ "schema": "",
200
+ "columns": {
201
+ "id": {
202
+ "name": "id",
203
+ "type": "uuid",
204
+ "primaryKey": true,
205
+ "notNull": true,
206
+ "default": "gen_random_uuid()"
207
+ },
208
+ "org_id": {
209
+ "name": "org_id",
210
+ "type": "uuid",
211
+ "primaryKey": false,
212
+ "notNull": true
213
+ },
214
+ "client_id": {
215
+ "name": "client_id",
216
+ "type": "text",
217
+ "primaryKey": false,
218
+ "notNull": true
219
+ },
220
+ "client_secret_hash": {
221
+ "name": "client_secret_hash",
222
+ "type": "text",
223
+ "primaryKey": false,
224
+ "notNull": true
225
+ },
226
+ "name": {
227
+ "name": "name",
228
+ "type": "text",
229
+ "primaryKey": false,
230
+ "notNull": true
231
+ },
232
+ "redirect_uris": {
233
+ "name": "redirect_uris",
234
+ "type": "text[]",
235
+ "primaryKey": false,
236
+ "notNull": true,
237
+ "default": "'{}'::text[]"
238
+ },
239
+ "allowed_origins": {
240
+ "name": "allowed_origins",
241
+ "type": "text[]",
242
+ "primaryKey": false,
243
+ "notNull": true,
244
+ "default": "'{}'::text[]"
245
+ },
246
+ "branding": {
247
+ "name": "branding",
248
+ "type": "jsonb",
249
+ "primaryKey": false,
250
+ "notNull": true,
251
+ "default": "'{}'::jsonb"
252
+ },
253
+ "is_active": {
254
+ "name": "is_active",
255
+ "type": "boolean",
256
+ "primaryKey": false,
257
+ "notNull": true,
258
+ "default": true
259
+ },
260
+ "created_at": {
261
+ "name": "created_at",
262
+ "type": "timestamp with time zone",
263
+ "primaryKey": false,
264
+ "notNull": true,
265
+ "default": "now()"
266
+ },
267
+ "updated_at": {
268
+ "name": "updated_at",
269
+ "type": "timestamp with time zone",
270
+ "primaryKey": false,
271
+ "notNull": true,
272
+ "default": "now()"
273
+ }
274
+ },
275
+ "indexes": {
276
+ "applications_org_idx": {
277
+ "name": "applications_org_idx",
278
+ "columns": [
279
+ {
280
+ "expression": "org_id",
281
+ "isExpression": false,
282
+ "asc": true,
283
+ "nulls": "last"
284
+ }
285
+ ],
286
+ "isUnique": false,
287
+ "concurrently": false,
288
+ "method": "btree",
289
+ "with": {}
290
+ },
291
+ "applications_client_id_idx": {
292
+ "name": "applications_client_id_idx",
293
+ "columns": [
294
+ {
295
+ "expression": "client_id",
296
+ "isExpression": false,
297
+ "asc": true,
298
+ "nulls": "last"
299
+ }
300
+ ],
301
+ "isUnique": false,
302
+ "concurrently": false,
303
+ "method": "btree",
304
+ "with": {}
305
+ }
306
+ },
307
+ "foreignKeys": {
308
+ "applications_org_id_organizations_id_fk": {
309
+ "name": "applications_org_id_organizations_id_fk",
310
+ "tableFrom": "applications",
311
+ "tableTo": "organizations",
312
+ "columnsFrom": [
313
+ "org_id"
314
+ ],
315
+ "columnsTo": [
316
+ "id"
317
+ ],
318
+ "onDelete": "cascade",
319
+ "onUpdate": "no action"
320
+ }
321
+ },
322
+ "compositePrimaryKeys": {},
323
+ "uniqueConstraints": {
324
+ "applications_client_id_unique": {
325
+ "name": "applications_client_id_unique",
326
+ "nullsNotDistinct": false,
327
+ "columns": [
328
+ "client_id"
329
+ ]
330
+ }
331
+ }
332
+ },
333
+ "public.audit_log": {
334
+ "name": "audit_log",
335
+ "schema": "",
336
+ "columns": {
337
+ "id": {
338
+ "name": "id",
339
+ "type": "uuid",
340
+ "primaryKey": true,
341
+ "notNull": true,
342
+ "default": "gen_random_uuid()"
343
+ },
344
+ "user_id": {
345
+ "name": "user_id",
346
+ "type": "uuid",
347
+ "primaryKey": false,
348
+ "notNull": false
349
+ },
350
+ "org_id": {
351
+ "name": "org_id",
352
+ "type": "uuid",
353
+ "primaryKey": false,
354
+ "notNull": false
355
+ },
356
+ "app_id": {
357
+ "name": "app_id",
358
+ "type": "uuid",
359
+ "primaryKey": false,
360
+ "notNull": false
361
+ },
362
+ "request_id": {
363
+ "name": "request_id",
364
+ "type": "text",
365
+ "primaryKey": false,
366
+ "notNull": false
367
+ },
368
+ "event": {
369
+ "name": "event",
370
+ "type": "varchar(64)",
371
+ "primaryKey": false,
372
+ "notNull": true
373
+ },
374
+ "ip_address": {
375
+ "name": "ip_address",
376
+ "type": "text",
377
+ "primaryKey": false,
378
+ "notNull": false
379
+ },
380
+ "user_agent": {
381
+ "name": "user_agent",
382
+ "type": "text",
383
+ "primaryKey": false,
384
+ "notNull": false
385
+ },
386
+ "metadata": {
387
+ "name": "metadata",
388
+ "type": "jsonb",
389
+ "primaryKey": false,
390
+ "notNull": false
391
+ },
392
+ "created_at": {
393
+ "name": "created_at",
394
+ "type": "timestamp with time zone",
395
+ "primaryKey": false,
396
+ "notNull": true,
397
+ "default": "now()"
398
+ }
399
+ },
400
+ "indexes": {
401
+ "audit_log_user_idx": {
402
+ "name": "audit_log_user_idx",
403
+ "columns": [
404
+ {
405
+ "expression": "user_id",
406
+ "isExpression": false,
407
+ "asc": true,
408
+ "nulls": "last"
409
+ }
410
+ ],
411
+ "isUnique": false,
412
+ "concurrently": false,
413
+ "method": "btree",
414
+ "with": {}
415
+ },
416
+ "audit_log_event_idx": {
417
+ "name": "audit_log_event_idx",
418
+ "columns": [
419
+ {
420
+ "expression": "event",
421
+ "isExpression": false,
422
+ "asc": true,
423
+ "nulls": "last"
424
+ }
425
+ ],
426
+ "isUnique": false,
427
+ "concurrently": false,
428
+ "method": "btree",
429
+ "with": {}
430
+ },
431
+ "audit_log_created_at_idx": {
432
+ "name": "audit_log_created_at_idx",
433
+ "columns": [
434
+ {
435
+ "expression": "created_at",
436
+ "isExpression": false,
437
+ "asc": true,
438
+ "nulls": "last"
439
+ }
440
+ ],
441
+ "isUnique": false,
442
+ "concurrently": false,
443
+ "method": "btree",
444
+ "with": {}
445
+ },
446
+ "audit_log_org_idx": {
447
+ "name": "audit_log_org_idx",
448
+ "columns": [
449
+ {
450
+ "expression": "org_id",
451
+ "isExpression": false,
452
+ "asc": true,
453
+ "nulls": "last"
454
+ }
455
+ ],
456
+ "isUnique": false,
457
+ "concurrently": false,
458
+ "method": "btree",
459
+ "with": {}
460
+ },
461
+ "audit_log_app_idx": {
462
+ "name": "audit_log_app_idx",
463
+ "columns": [
464
+ {
465
+ "expression": "app_id",
466
+ "isExpression": false,
467
+ "asc": true,
468
+ "nulls": "last"
469
+ }
470
+ ],
471
+ "isUnique": false,
472
+ "concurrently": false,
473
+ "method": "btree",
474
+ "with": {}
475
+ }
476
+ },
477
+ "foreignKeys": {
478
+ "audit_log_user_id_users_id_fk": {
479
+ "name": "audit_log_user_id_users_id_fk",
480
+ "tableFrom": "audit_log",
481
+ "tableTo": "users",
482
+ "columnsFrom": [
483
+ "user_id"
484
+ ],
485
+ "columnsTo": [
486
+ "id"
487
+ ],
488
+ "onDelete": "set null",
489
+ "onUpdate": "no action"
490
+ },
491
+ "audit_log_org_id_organizations_id_fk": {
492
+ "name": "audit_log_org_id_organizations_id_fk",
493
+ "tableFrom": "audit_log",
494
+ "tableTo": "organizations",
495
+ "columnsFrom": [
496
+ "org_id"
497
+ ],
498
+ "columnsTo": [
499
+ "id"
500
+ ],
501
+ "onDelete": "set null",
502
+ "onUpdate": "no action"
503
+ },
504
+ "audit_log_app_id_applications_id_fk": {
505
+ "name": "audit_log_app_id_applications_id_fk",
506
+ "tableFrom": "audit_log",
507
+ "tableTo": "applications",
508
+ "columnsFrom": [
509
+ "app_id"
510
+ ],
511
+ "columnsTo": [
512
+ "id"
513
+ ],
514
+ "onDelete": "set null",
515
+ "onUpdate": "no action"
516
+ }
517
+ },
518
+ "compositePrimaryKeys": {},
519
+ "uniqueConstraints": {}
520
+ },
521
+ "public.identity_providers": {
522
+ "name": "identity_providers",
523
+ "schema": "",
524
+ "columns": {
525
+ "id": {
526
+ "name": "id",
527
+ "type": "uuid",
528
+ "primaryKey": true,
529
+ "notNull": true,
530
+ "default": "gen_random_uuid()"
531
+ },
532
+ "org_id": {
533
+ "name": "org_id",
534
+ "type": "uuid",
535
+ "primaryKey": false,
536
+ "notNull": true
537
+ },
538
+ "provider_type": {
539
+ "name": "provider_type",
540
+ "type": "text",
541
+ "primaryKey": false,
542
+ "notNull": true
543
+ },
544
+ "name": {
545
+ "name": "name",
546
+ "type": "text",
547
+ "primaryKey": false,
548
+ "notNull": true
549
+ },
550
+ "issuer": {
551
+ "name": "issuer",
552
+ "type": "text",
553
+ "primaryKey": false,
554
+ "notNull": false
555
+ },
556
+ "authorization_endpoint": {
557
+ "name": "authorization_endpoint",
558
+ "type": "text",
559
+ "primaryKey": false,
560
+ "notNull": false
561
+ },
562
+ "token_endpoint": {
563
+ "name": "token_endpoint",
564
+ "type": "text",
565
+ "primaryKey": false,
566
+ "notNull": false
567
+ },
568
+ "userinfo_endpoint": {
569
+ "name": "userinfo_endpoint",
570
+ "type": "text",
571
+ "primaryKey": false,
572
+ "notNull": false
573
+ },
574
+ "jwks_uri": {
575
+ "name": "jwks_uri",
576
+ "type": "text",
577
+ "primaryKey": false,
578
+ "notNull": false
579
+ },
580
+ "client_id": {
581
+ "name": "client_id",
582
+ "type": "text",
583
+ "primaryKey": false,
584
+ "notNull": false
585
+ },
586
+ "client_secret_encrypted": {
587
+ "name": "client_secret_encrypted",
588
+ "type": "text",
589
+ "primaryKey": false,
590
+ "notNull": false
591
+ },
592
+ "scopes": {
593
+ "name": "scopes",
594
+ "type": "text[]",
595
+ "primaryKey": false,
596
+ "notNull": true,
597
+ "default": "'{\"openid\",\"profile\",\"email\"}'::text[]"
598
+ },
599
+ "attribute_mapping": {
600
+ "name": "attribute_mapping",
601
+ "type": "jsonb",
602
+ "primaryKey": false,
603
+ "notNull": true,
604
+ "default": "'{}'::jsonb"
605
+ },
606
+ "is_active": {
607
+ "name": "is_active",
608
+ "type": "boolean",
609
+ "primaryKey": false,
610
+ "notNull": true,
611
+ "default": true
612
+ },
613
+ "is_federation": {
614
+ "name": "is_federation",
615
+ "type": "boolean",
616
+ "primaryKey": false,
617
+ "notNull": true,
618
+ "default": true
619
+ },
620
+ "created_at": {
621
+ "name": "created_at",
622
+ "type": "timestamp with time zone",
623
+ "primaryKey": false,
624
+ "notNull": true,
625
+ "default": "now()"
626
+ },
627
+ "updated_at": {
628
+ "name": "updated_at",
629
+ "type": "timestamp with time zone",
630
+ "primaryKey": false,
631
+ "notNull": true,
632
+ "default": "now()"
633
+ }
634
+ },
635
+ "indexes": {
636
+ "identity_providers_org_idx": {
637
+ "name": "identity_providers_org_idx",
638
+ "columns": [
639
+ {
640
+ "expression": "org_id",
641
+ "isExpression": false,
642
+ "asc": true,
643
+ "nulls": "last"
644
+ }
645
+ ],
646
+ "isUnique": false,
647
+ "concurrently": false,
648
+ "method": "btree",
649
+ "with": {}
650
+ },
651
+ "identity_providers_type_idx": {
652
+ "name": "identity_providers_type_idx",
653
+ "columns": [
654
+ {
655
+ "expression": "provider_type",
656
+ "isExpression": false,
657
+ "asc": true,
658
+ "nulls": "last"
659
+ }
660
+ ],
661
+ "isUnique": false,
662
+ "concurrently": false,
663
+ "method": "btree",
664
+ "with": {}
665
+ }
666
+ },
667
+ "foreignKeys": {
668
+ "identity_providers_org_id_organizations_id_fk": {
669
+ "name": "identity_providers_org_id_organizations_id_fk",
670
+ "tableFrom": "identity_providers",
671
+ "tableTo": "organizations",
672
+ "columnsFrom": [
673
+ "org_id"
674
+ ],
675
+ "columnsTo": [
676
+ "id"
677
+ ],
678
+ "onDelete": "cascade",
679
+ "onUpdate": "no action"
680
+ }
681
+ },
682
+ "compositePrimaryKeys": {},
683
+ "uniqueConstraints": {}
684
+ },
685
+ "public.magic_links": {
686
+ "name": "magic_links",
687
+ "schema": "",
688
+ "columns": {
689
+ "id": {
690
+ "name": "id",
691
+ "type": "uuid",
692
+ "primaryKey": true,
693
+ "notNull": true,
694
+ "default": "gen_random_uuid()"
695
+ },
696
+ "user_id": {
697
+ "name": "user_id",
698
+ "type": "uuid",
699
+ "primaryKey": false,
700
+ "notNull": true
701
+ },
702
+ "token_hash": {
703
+ "name": "token_hash",
704
+ "type": "text",
705
+ "primaryKey": false,
706
+ "notNull": true
707
+ },
708
+ "used_at": {
709
+ "name": "used_at",
710
+ "type": "timestamp with time zone",
711
+ "primaryKey": false,
712
+ "notNull": false
713
+ },
714
+ "expires_at": {
715
+ "name": "expires_at",
716
+ "type": "timestamp with time zone",
717
+ "primaryKey": false,
718
+ "notNull": true
719
+ },
720
+ "created_at": {
721
+ "name": "created_at",
722
+ "type": "timestamp with time zone",
723
+ "primaryKey": false,
724
+ "notNull": true,
725
+ "default": "now()"
726
+ }
727
+ },
728
+ "indexes": {
729
+ "magic_links_user_idx": {
730
+ "name": "magic_links_user_idx",
731
+ "columns": [
732
+ {
733
+ "expression": "user_id",
734
+ "isExpression": false,
735
+ "asc": true,
736
+ "nulls": "last"
737
+ }
738
+ ],
739
+ "isUnique": false,
740
+ "concurrently": false,
741
+ "method": "btree",
742
+ "with": {}
743
+ },
744
+ "magic_links_hash_idx": {
745
+ "name": "magic_links_hash_idx",
746
+ "columns": [
747
+ {
748
+ "expression": "token_hash",
749
+ "isExpression": false,
750
+ "asc": true,
751
+ "nulls": "last"
752
+ }
753
+ ],
754
+ "isUnique": false,
755
+ "concurrently": false,
756
+ "method": "btree",
757
+ "with": {}
758
+ }
759
+ },
760
+ "foreignKeys": {
761
+ "magic_links_user_id_users_id_fk": {
762
+ "name": "magic_links_user_id_users_id_fk",
763
+ "tableFrom": "magic_links",
764
+ "tableTo": "users",
765
+ "columnsFrom": [
766
+ "user_id"
767
+ ],
768
+ "columnsTo": [
769
+ "id"
770
+ ],
771
+ "onDelete": "cascade",
772
+ "onUpdate": "no action"
773
+ }
774
+ },
775
+ "compositePrimaryKeys": {},
776
+ "uniqueConstraints": {}
777
+ },
778
+ "public.oauth2_authorization_codes": {
779
+ "name": "oauth2_authorization_codes",
780
+ "schema": "",
781
+ "columns": {
782
+ "id": {
783
+ "name": "id",
784
+ "type": "uuid",
785
+ "primaryKey": true,
786
+ "notNull": true,
787
+ "default": "gen_random_uuid()"
788
+ },
789
+ "app_id": {
790
+ "name": "app_id",
791
+ "type": "uuid",
792
+ "primaryKey": false,
793
+ "notNull": true
794
+ },
795
+ "user_id": {
796
+ "name": "user_id",
797
+ "type": "uuid",
798
+ "primaryKey": false,
799
+ "notNull": true
800
+ },
801
+ "code_hash": {
802
+ "name": "code_hash",
803
+ "type": "text",
804
+ "primaryKey": false,
805
+ "notNull": true
806
+ },
807
+ "challenge": {
808
+ "name": "challenge",
809
+ "type": "text",
810
+ "primaryKey": false,
811
+ "notNull": false
812
+ },
813
+ "challenge_method": {
814
+ "name": "challenge_method",
815
+ "type": "text",
816
+ "primaryKey": false,
817
+ "notNull": false
818
+ },
819
+ "redirect_uri": {
820
+ "name": "redirect_uri",
821
+ "type": "text",
822
+ "primaryKey": false,
823
+ "notNull": false
824
+ },
825
+ "scopes": {
826
+ "name": "scopes",
827
+ "type": "text[]",
828
+ "primaryKey": false,
829
+ "notNull": true,
830
+ "default": "'{}'::text[]"
831
+ },
832
+ "nonce": {
833
+ "name": "nonce",
834
+ "type": "text",
835
+ "primaryKey": false,
836
+ "notNull": false
837
+ },
838
+ "expires_at": {
839
+ "name": "expires_at",
840
+ "type": "timestamp with time zone",
841
+ "primaryKey": false,
842
+ "notNull": true
843
+ },
844
+ "used_at": {
845
+ "name": "used_at",
846
+ "type": "timestamp with time zone",
847
+ "primaryKey": false,
848
+ "notNull": false
849
+ },
850
+ "created_at": {
851
+ "name": "created_at",
852
+ "type": "timestamp with time zone",
853
+ "primaryKey": false,
854
+ "notNull": true,
855
+ "default": "now()"
856
+ }
857
+ },
858
+ "indexes": {
859
+ "oauth2_authorization_codes_app_idx": {
860
+ "name": "oauth2_authorization_codes_app_idx",
861
+ "columns": [
862
+ {
863
+ "expression": "app_id",
864
+ "isExpression": false,
865
+ "asc": true,
866
+ "nulls": "last"
867
+ }
868
+ ],
869
+ "isUnique": false,
870
+ "concurrently": false,
871
+ "method": "btree",
872
+ "with": {}
873
+ },
874
+ "oauth2_authorization_codes_user_idx": {
875
+ "name": "oauth2_authorization_codes_user_idx",
876
+ "columns": [
877
+ {
878
+ "expression": "user_id",
879
+ "isExpression": false,
880
+ "asc": true,
881
+ "nulls": "last"
882
+ }
883
+ ],
884
+ "isUnique": false,
885
+ "concurrently": false,
886
+ "method": "btree",
887
+ "with": {}
888
+ },
889
+ "oauth2_authorization_codes_hash_idx": {
890
+ "name": "oauth2_authorization_codes_hash_idx",
891
+ "columns": [
892
+ {
893
+ "expression": "code_hash",
894
+ "isExpression": false,
895
+ "asc": true,
896
+ "nulls": "last"
897
+ }
898
+ ],
899
+ "isUnique": false,
900
+ "concurrently": false,
901
+ "method": "btree",
902
+ "with": {}
903
+ }
904
+ },
905
+ "foreignKeys": {
906
+ "oauth2_authorization_codes_app_id_applications_id_fk": {
907
+ "name": "oauth2_authorization_codes_app_id_applications_id_fk",
908
+ "tableFrom": "oauth2_authorization_codes",
909
+ "tableTo": "applications",
910
+ "columnsFrom": [
911
+ "app_id"
912
+ ],
913
+ "columnsTo": [
914
+ "id"
915
+ ],
916
+ "onDelete": "cascade",
917
+ "onUpdate": "no action"
918
+ },
919
+ "oauth2_authorization_codes_user_id_users_id_fk": {
920
+ "name": "oauth2_authorization_codes_user_id_users_id_fk",
921
+ "tableFrom": "oauth2_authorization_codes",
922
+ "tableTo": "users",
923
+ "columnsFrom": [
924
+ "user_id"
925
+ ],
926
+ "columnsTo": [
927
+ "id"
928
+ ],
929
+ "onDelete": "cascade",
930
+ "onUpdate": "no action"
931
+ }
932
+ },
933
+ "compositePrimaryKeys": {},
934
+ "uniqueConstraints": {}
935
+ },
936
+ "public.oauth2_consents": {
937
+ "name": "oauth2_consents",
938
+ "schema": "",
939
+ "columns": {
940
+ "id": {
941
+ "name": "id",
942
+ "type": "uuid",
943
+ "primaryKey": true,
944
+ "notNull": true,
945
+ "default": "gen_random_uuid()"
946
+ },
947
+ "app_id": {
948
+ "name": "app_id",
949
+ "type": "uuid",
950
+ "primaryKey": false,
951
+ "notNull": true
952
+ },
953
+ "user_id": {
954
+ "name": "user_id",
955
+ "type": "uuid",
956
+ "primaryKey": false,
957
+ "notNull": true
958
+ },
959
+ "scopes": {
960
+ "name": "scopes",
961
+ "type": "text[]",
962
+ "primaryKey": false,
963
+ "notNull": true,
964
+ "default": "'{}'::text[]"
965
+ },
966
+ "granted_at": {
967
+ "name": "granted_at",
968
+ "type": "timestamp with time zone",
969
+ "primaryKey": false,
970
+ "notNull": true,
971
+ "default": "now()"
972
+ },
973
+ "revoked_at": {
974
+ "name": "revoked_at",
975
+ "type": "timestamp with time zone",
976
+ "primaryKey": false,
977
+ "notNull": false
978
+ }
979
+ },
980
+ "indexes": {
981
+ "oauth2_consents_app_idx": {
982
+ "name": "oauth2_consents_app_idx",
983
+ "columns": [
984
+ {
985
+ "expression": "app_id",
986
+ "isExpression": false,
987
+ "asc": true,
988
+ "nulls": "last"
989
+ }
990
+ ],
991
+ "isUnique": false,
992
+ "concurrently": false,
993
+ "method": "btree",
994
+ "with": {}
995
+ },
996
+ "oauth2_consents_user_idx": {
997
+ "name": "oauth2_consents_user_idx",
998
+ "columns": [
999
+ {
1000
+ "expression": "user_id",
1001
+ "isExpression": false,
1002
+ "asc": true,
1003
+ "nulls": "last"
1004
+ }
1005
+ ],
1006
+ "isUnique": false,
1007
+ "concurrently": false,
1008
+ "method": "btree",
1009
+ "with": {}
1010
+ }
1011
+ },
1012
+ "foreignKeys": {
1013
+ "oauth2_consents_app_id_applications_id_fk": {
1014
+ "name": "oauth2_consents_app_id_applications_id_fk",
1015
+ "tableFrom": "oauth2_consents",
1016
+ "tableTo": "applications",
1017
+ "columnsFrom": [
1018
+ "app_id"
1019
+ ],
1020
+ "columnsTo": [
1021
+ "id"
1022
+ ],
1023
+ "onDelete": "cascade",
1024
+ "onUpdate": "no action"
1025
+ },
1026
+ "oauth2_consents_user_id_users_id_fk": {
1027
+ "name": "oauth2_consents_user_id_users_id_fk",
1028
+ "tableFrom": "oauth2_consents",
1029
+ "tableTo": "users",
1030
+ "columnsFrom": [
1031
+ "user_id"
1032
+ ],
1033
+ "columnsTo": [
1034
+ "id"
1035
+ ],
1036
+ "onDelete": "cascade",
1037
+ "onUpdate": "no action"
1038
+ }
1039
+ },
1040
+ "compositePrimaryKeys": {},
1041
+ "uniqueConstraints": {
1042
+ "oauth2_consents_unique": {
1043
+ "name": "oauth2_consents_unique",
1044
+ "nullsNotDistinct": false,
1045
+ "columns": [
1046
+ "app_id",
1047
+ "user_id"
1048
+ ]
1049
+ }
1050
+ }
1051
+ },
1052
+ "public.oidc_connections": {
1053
+ "name": "oidc_connections",
1054
+ "schema": "",
1055
+ "columns": {
1056
+ "id": {
1057
+ "name": "id",
1058
+ "type": "uuid",
1059
+ "primaryKey": true,
1060
+ "notNull": true,
1061
+ "default": "gen_random_uuid()"
1062
+ },
1063
+ "org_id": {
1064
+ "name": "org_id",
1065
+ "type": "uuid",
1066
+ "primaryKey": false,
1067
+ "notNull": true
1068
+ },
1069
+ "name": {
1070
+ "name": "name",
1071
+ "type": "text",
1072
+ "primaryKey": false,
1073
+ "notNull": true
1074
+ },
1075
+ "issuer": {
1076
+ "name": "issuer",
1077
+ "type": "text",
1078
+ "primaryKey": false,
1079
+ "notNull": true
1080
+ },
1081
+ "authorization_endpoint": {
1082
+ "name": "authorization_endpoint",
1083
+ "type": "text",
1084
+ "primaryKey": false,
1085
+ "notNull": true
1086
+ },
1087
+ "token_endpoint": {
1088
+ "name": "token_endpoint",
1089
+ "type": "text",
1090
+ "primaryKey": false,
1091
+ "notNull": true
1092
+ },
1093
+ "userinfo_endpoint": {
1094
+ "name": "userinfo_endpoint",
1095
+ "type": "text",
1096
+ "primaryKey": false,
1097
+ "notNull": false
1098
+ },
1099
+ "jwks_uri": {
1100
+ "name": "jwks_uri",
1101
+ "type": "text",
1102
+ "primaryKey": false,
1103
+ "notNull": false
1104
+ },
1105
+ "client_id": {
1106
+ "name": "client_id",
1107
+ "type": "text",
1108
+ "primaryKey": false,
1109
+ "notNull": true
1110
+ },
1111
+ "client_secret": {
1112
+ "name": "client_secret",
1113
+ "type": "text",
1114
+ "primaryKey": false,
1115
+ "notNull": true
1116
+ },
1117
+ "scopes": {
1118
+ "name": "scopes",
1119
+ "type": "text[]",
1120
+ "primaryKey": false,
1121
+ "notNull": true,
1122
+ "default": "'{\"openid\",\"profile\",\"email\"}'::text[]"
1123
+ },
1124
+ "attribute_mapping": {
1125
+ "name": "attribute_mapping",
1126
+ "type": "jsonb",
1127
+ "primaryKey": false,
1128
+ "notNull": true,
1129
+ "default": "'{}'::jsonb"
1130
+ },
1131
+ "is_active": {
1132
+ "name": "is_active",
1133
+ "type": "boolean",
1134
+ "primaryKey": false,
1135
+ "notNull": true,
1136
+ "default": true
1137
+ },
1138
+ "created_at": {
1139
+ "name": "created_at",
1140
+ "type": "timestamp with time zone",
1141
+ "primaryKey": false,
1142
+ "notNull": true,
1143
+ "default": "now()"
1144
+ },
1145
+ "updated_at": {
1146
+ "name": "updated_at",
1147
+ "type": "timestamp with time zone",
1148
+ "primaryKey": false,
1149
+ "notNull": true,
1150
+ "default": "now()"
1151
+ }
1152
+ },
1153
+ "indexes": {
1154
+ "oidc_connections_org_idx": {
1155
+ "name": "oidc_connections_org_idx",
1156
+ "columns": [
1157
+ {
1158
+ "expression": "org_id",
1159
+ "isExpression": false,
1160
+ "asc": true,
1161
+ "nulls": "last"
1162
+ }
1163
+ ],
1164
+ "isUnique": false,
1165
+ "concurrently": false,
1166
+ "method": "btree",
1167
+ "with": {}
1168
+ }
1169
+ },
1170
+ "foreignKeys": {
1171
+ "oidc_connections_org_id_organizations_id_fk": {
1172
+ "name": "oidc_connections_org_id_organizations_id_fk",
1173
+ "tableFrom": "oidc_connections",
1174
+ "tableTo": "organizations",
1175
+ "columnsFrom": [
1176
+ "org_id"
1177
+ ],
1178
+ "columnsTo": [
1179
+ "id"
1180
+ ],
1181
+ "onDelete": "cascade",
1182
+ "onUpdate": "no action"
1183
+ }
1184
+ },
1185
+ "compositePrimaryKeys": {},
1186
+ "uniqueConstraints": {}
1187
+ },
1188
+ "public.org_memberships": {
1189
+ "name": "org_memberships",
1190
+ "schema": "",
1191
+ "columns": {
1192
+ "id": {
1193
+ "name": "id",
1194
+ "type": "uuid",
1195
+ "primaryKey": true,
1196
+ "notNull": true,
1197
+ "default": "gen_random_uuid()"
1198
+ },
1199
+ "org_id": {
1200
+ "name": "org_id",
1201
+ "type": "uuid",
1202
+ "primaryKey": false,
1203
+ "notNull": true
1204
+ },
1205
+ "user_id": {
1206
+ "name": "user_id",
1207
+ "type": "uuid",
1208
+ "primaryKey": false,
1209
+ "notNull": true
1210
+ },
1211
+ "role": {
1212
+ "name": "role",
1213
+ "type": "text",
1214
+ "primaryKey": false,
1215
+ "notNull": true,
1216
+ "default": "'member'"
1217
+ },
1218
+ "created_at": {
1219
+ "name": "created_at",
1220
+ "type": "timestamp with time zone",
1221
+ "primaryKey": false,
1222
+ "notNull": true,
1223
+ "default": "now()"
1224
+ },
1225
+ "updated_at": {
1226
+ "name": "updated_at",
1227
+ "type": "timestamp with time zone",
1228
+ "primaryKey": false,
1229
+ "notNull": true,
1230
+ "default": "now()"
1231
+ }
1232
+ },
1233
+ "indexes": {
1234
+ "org_memberships_org_idx": {
1235
+ "name": "org_memberships_org_idx",
1236
+ "columns": [
1237
+ {
1238
+ "expression": "org_id",
1239
+ "isExpression": false,
1240
+ "asc": true,
1241
+ "nulls": "last"
1242
+ }
1243
+ ],
1244
+ "isUnique": false,
1245
+ "concurrently": false,
1246
+ "method": "btree",
1247
+ "with": {}
1248
+ },
1249
+ "org_memberships_user_idx": {
1250
+ "name": "org_memberships_user_idx",
1251
+ "columns": [
1252
+ {
1253
+ "expression": "user_id",
1254
+ "isExpression": false,
1255
+ "asc": true,
1256
+ "nulls": "last"
1257
+ }
1258
+ ],
1259
+ "isUnique": false,
1260
+ "concurrently": false,
1261
+ "method": "btree",
1262
+ "with": {}
1263
+ }
1264
+ },
1265
+ "foreignKeys": {
1266
+ "org_memberships_org_id_organizations_id_fk": {
1267
+ "name": "org_memberships_org_id_organizations_id_fk",
1268
+ "tableFrom": "org_memberships",
1269
+ "tableTo": "organizations",
1270
+ "columnsFrom": [
1271
+ "org_id"
1272
+ ],
1273
+ "columnsTo": [
1274
+ "id"
1275
+ ],
1276
+ "onDelete": "cascade",
1277
+ "onUpdate": "no action"
1278
+ },
1279
+ "org_memberships_user_id_users_id_fk": {
1280
+ "name": "org_memberships_user_id_users_id_fk",
1281
+ "tableFrom": "org_memberships",
1282
+ "tableTo": "users",
1283
+ "columnsFrom": [
1284
+ "user_id"
1285
+ ],
1286
+ "columnsTo": [
1287
+ "id"
1288
+ ],
1289
+ "onDelete": "cascade",
1290
+ "onUpdate": "no action"
1291
+ }
1292
+ },
1293
+ "compositePrimaryKeys": {},
1294
+ "uniqueConstraints": {
1295
+ "org_memberships_unique": {
1296
+ "name": "org_memberships_unique",
1297
+ "nullsNotDistinct": false,
1298
+ "columns": [
1299
+ "org_id",
1300
+ "user_id"
1301
+ ]
1302
+ }
1303
+ }
1304
+ },
1305
+ "public.organizations": {
1306
+ "name": "organizations",
1307
+ "schema": "",
1308
+ "columns": {
1309
+ "id": {
1310
+ "name": "id",
1311
+ "type": "uuid",
1312
+ "primaryKey": true,
1313
+ "notNull": true,
1314
+ "default": "gen_random_uuid()"
1315
+ },
1316
+ "name": {
1317
+ "name": "name",
1318
+ "type": "text",
1319
+ "primaryKey": false,
1320
+ "notNull": true
1321
+ },
1322
+ "slug": {
1323
+ "name": "slug",
1324
+ "type": "text",
1325
+ "primaryKey": false,
1326
+ "notNull": true
1327
+ },
1328
+ "plan": {
1329
+ "name": "plan",
1330
+ "type": "text",
1331
+ "primaryKey": false,
1332
+ "notNull": true,
1333
+ "default": "'free'"
1334
+ },
1335
+ "branding": {
1336
+ "name": "branding",
1337
+ "type": "jsonb",
1338
+ "primaryKey": false,
1339
+ "notNull": true,
1340
+ "default": "'{}'::jsonb"
1341
+ },
1342
+ "created_at": {
1343
+ "name": "created_at",
1344
+ "type": "timestamp with time zone",
1345
+ "primaryKey": false,
1346
+ "notNull": true,
1347
+ "default": "now()"
1348
+ },
1349
+ "updated_at": {
1350
+ "name": "updated_at",
1351
+ "type": "timestamp with time zone",
1352
+ "primaryKey": false,
1353
+ "notNull": true,
1354
+ "default": "now()"
1355
+ }
1356
+ },
1357
+ "indexes": {
1358
+ "organizations_slug_idx": {
1359
+ "name": "organizations_slug_idx",
1360
+ "columns": [
1361
+ {
1362
+ "expression": "slug",
1363
+ "isExpression": false,
1364
+ "asc": true,
1365
+ "nulls": "last"
1366
+ }
1367
+ ],
1368
+ "isUnique": false,
1369
+ "concurrently": false,
1370
+ "method": "btree",
1371
+ "with": {}
1372
+ }
1373
+ },
1374
+ "foreignKeys": {},
1375
+ "compositePrimaryKeys": {},
1376
+ "uniqueConstraints": {
1377
+ "organizations_slug_unique": {
1378
+ "name": "organizations_slug_unique",
1379
+ "nullsNotDistinct": false,
1380
+ "columns": [
1381
+ "slug"
1382
+ ]
1383
+ }
1384
+ }
1385
+ },
1386
+ "public.password_reset_tokens": {
1387
+ "name": "password_reset_tokens",
1388
+ "schema": "",
1389
+ "columns": {
1390
+ "id": {
1391
+ "name": "id",
1392
+ "type": "uuid",
1393
+ "primaryKey": true,
1394
+ "notNull": true,
1395
+ "default": "gen_random_uuid()"
1396
+ },
1397
+ "user_id": {
1398
+ "name": "user_id",
1399
+ "type": "uuid",
1400
+ "primaryKey": false,
1401
+ "notNull": true
1402
+ },
1403
+ "token_hash": {
1404
+ "name": "token_hash",
1405
+ "type": "text",
1406
+ "primaryKey": false,
1407
+ "notNull": true
1408
+ },
1409
+ "used_at": {
1410
+ "name": "used_at",
1411
+ "type": "timestamp with time zone",
1412
+ "primaryKey": false,
1413
+ "notNull": false
1414
+ },
1415
+ "expires_at": {
1416
+ "name": "expires_at",
1417
+ "type": "timestamp with time zone",
1418
+ "primaryKey": false,
1419
+ "notNull": true
1420
+ },
1421
+ "created_at": {
1422
+ "name": "created_at",
1423
+ "type": "timestamp with time zone",
1424
+ "primaryKey": false,
1425
+ "notNull": true,
1426
+ "default": "now()"
1427
+ }
1428
+ },
1429
+ "indexes": {
1430
+ "password_reset_tokens_user_idx": {
1431
+ "name": "password_reset_tokens_user_idx",
1432
+ "columns": [
1433
+ {
1434
+ "expression": "user_id",
1435
+ "isExpression": false,
1436
+ "asc": true,
1437
+ "nulls": "last"
1438
+ }
1439
+ ],
1440
+ "isUnique": false,
1441
+ "concurrently": false,
1442
+ "method": "btree",
1443
+ "with": {}
1444
+ },
1445
+ "password_reset_tokens_hash_idx": {
1446
+ "name": "password_reset_tokens_hash_idx",
1447
+ "columns": [
1448
+ {
1449
+ "expression": "token_hash",
1450
+ "isExpression": false,
1451
+ "asc": true,
1452
+ "nulls": "last"
1453
+ }
1454
+ ],
1455
+ "isUnique": false,
1456
+ "concurrently": false,
1457
+ "method": "btree",
1458
+ "with": {}
1459
+ }
1460
+ },
1461
+ "foreignKeys": {
1462
+ "password_reset_tokens_user_id_users_id_fk": {
1463
+ "name": "password_reset_tokens_user_id_users_id_fk",
1464
+ "tableFrom": "password_reset_tokens",
1465
+ "tableTo": "users",
1466
+ "columnsFrom": [
1467
+ "user_id"
1468
+ ],
1469
+ "columnsTo": [
1470
+ "id"
1471
+ ],
1472
+ "onDelete": "cascade",
1473
+ "onUpdate": "no action"
1474
+ }
1475
+ },
1476
+ "compositePrimaryKeys": {},
1477
+ "uniqueConstraints": {}
1478
+ },
1479
+ "public.permissions": {
1480
+ "name": "permissions",
1481
+ "schema": "",
1482
+ "columns": {
1483
+ "id": {
1484
+ "name": "id",
1485
+ "type": "uuid",
1486
+ "primaryKey": true,
1487
+ "notNull": true,
1488
+ "default": "gen_random_uuid()"
1489
+ },
1490
+ "resource": {
1491
+ "name": "resource",
1492
+ "type": "text",
1493
+ "primaryKey": false,
1494
+ "notNull": true
1495
+ },
1496
+ "action": {
1497
+ "name": "action",
1498
+ "type": "text",
1499
+ "primaryKey": false,
1500
+ "notNull": true
1501
+ },
1502
+ "description": {
1503
+ "name": "description",
1504
+ "type": "text",
1505
+ "primaryKey": false,
1506
+ "notNull": false
1507
+ },
1508
+ "created_at": {
1509
+ "name": "created_at",
1510
+ "type": "timestamp with time zone",
1511
+ "primaryKey": false,
1512
+ "notNull": true,
1513
+ "default": "now()"
1514
+ }
1515
+ },
1516
+ "indexes": {},
1517
+ "foreignKeys": {},
1518
+ "compositePrimaryKeys": {},
1519
+ "uniqueConstraints": {
1520
+ "permissions_resource_action_idx": {
1521
+ "name": "permissions_resource_action_idx",
1522
+ "nullsNotDistinct": false,
1523
+ "columns": [
1524
+ "resource",
1525
+ "action"
1526
+ ]
1527
+ }
1528
+ }
1529
+ },
1530
+ "public.refresh_tokens": {
1531
+ "name": "refresh_tokens",
1532
+ "schema": "",
1533
+ "columns": {
1534
+ "id": {
1535
+ "name": "id",
1536
+ "type": "uuid",
1537
+ "primaryKey": true,
1538
+ "notNull": true,
1539
+ "default": "gen_random_uuid()"
1540
+ },
1541
+ "user_id": {
1542
+ "name": "user_id",
1543
+ "type": "uuid",
1544
+ "primaryKey": false,
1545
+ "notNull": true
1546
+ },
1547
+ "app_id": {
1548
+ "name": "app_id",
1549
+ "type": "uuid",
1550
+ "primaryKey": false,
1551
+ "notNull": false
1552
+ },
1553
+ "token_hash": {
1554
+ "name": "token_hash",
1555
+ "type": "text",
1556
+ "primaryKey": false,
1557
+ "notNull": true
1558
+ },
1559
+ "expires_at": {
1560
+ "name": "expires_at",
1561
+ "type": "timestamp with time zone",
1562
+ "primaryKey": false,
1563
+ "notNull": true
1564
+ },
1565
+ "revoked_at": {
1566
+ "name": "revoked_at",
1567
+ "type": "timestamp with time zone",
1568
+ "primaryKey": false,
1569
+ "notNull": false
1570
+ },
1571
+ "created_at": {
1572
+ "name": "created_at",
1573
+ "type": "timestamp with time zone",
1574
+ "primaryKey": false,
1575
+ "notNull": true,
1576
+ "default": "now()"
1577
+ },
1578
+ "ip_address": {
1579
+ "name": "ip_address",
1580
+ "type": "text",
1581
+ "primaryKey": false,
1582
+ "notNull": false
1583
+ },
1584
+ "user_agent": {
1585
+ "name": "user_agent",
1586
+ "type": "text",
1587
+ "primaryKey": false,
1588
+ "notNull": false
1589
+ },
1590
+ "device_fingerprint": {
1591
+ "name": "device_fingerprint",
1592
+ "type": "text",
1593
+ "primaryKey": false,
1594
+ "notNull": false
1595
+ }
1596
+ },
1597
+ "indexes": {
1598
+ "refresh_tokens_user_idx": {
1599
+ "name": "refresh_tokens_user_idx",
1600
+ "columns": [
1601
+ {
1602
+ "expression": "user_id",
1603
+ "isExpression": false,
1604
+ "asc": true,
1605
+ "nulls": "last"
1606
+ }
1607
+ ],
1608
+ "isUnique": false,
1609
+ "concurrently": false,
1610
+ "method": "btree",
1611
+ "with": {}
1612
+ },
1613
+ "refresh_tokens_app_idx": {
1614
+ "name": "refresh_tokens_app_idx",
1615
+ "columns": [
1616
+ {
1617
+ "expression": "app_id",
1618
+ "isExpression": false,
1619
+ "asc": true,
1620
+ "nulls": "last"
1621
+ }
1622
+ ],
1623
+ "isUnique": false,
1624
+ "concurrently": false,
1625
+ "method": "btree",
1626
+ "with": {}
1627
+ },
1628
+ "refresh_tokens_hash_idx": {
1629
+ "name": "refresh_tokens_hash_idx",
1630
+ "columns": [
1631
+ {
1632
+ "expression": "token_hash",
1633
+ "isExpression": false,
1634
+ "asc": true,
1635
+ "nulls": "last"
1636
+ }
1637
+ ],
1638
+ "isUnique": false,
1639
+ "concurrently": false,
1640
+ "method": "btree",
1641
+ "with": {}
1642
+ }
1643
+ },
1644
+ "foreignKeys": {
1645
+ "refresh_tokens_user_id_users_id_fk": {
1646
+ "name": "refresh_tokens_user_id_users_id_fk",
1647
+ "tableFrom": "refresh_tokens",
1648
+ "tableTo": "users",
1649
+ "columnsFrom": [
1650
+ "user_id"
1651
+ ],
1652
+ "columnsTo": [
1653
+ "id"
1654
+ ],
1655
+ "onDelete": "cascade",
1656
+ "onUpdate": "no action"
1657
+ },
1658
+ "refresh_tokens_app_id_applications_id_fk": {
1659
+ "name": "refresh_tokens_app_id_applications_id_fk",
1660
+ "tableFrom": "refresh_tokens",
1661
+ "tableTo": "applications",
1662
+ "columnsFrom": [
1663
+ "app_id"
1664
+ ],
1665
+ "columnsTo": [
1666
+ "id"
1667
+ ],
1668
+ "onDelete": "set null",
1669
+ "onUpdate": "no action"
1670
+ }
1671
+ },
1672
+ "compositePrimaryKeys": {},
1673
+ "uniqueConstraints": {}
1674
+ },
1675
+ "public.role_permissions": {
1676
+ "name": "role_permissions",
1677
+ "schema": "",
1678
+ "columns": {
1679
+ "id": {
1680
+ "name": "id",
1681
+ "type": "uuid",
1682
+ "primaryKey": true,
1683
+ "notNull": true,
1684
+ "default": "gen_random_uuid()"
1685
+ },
1686
+ "role": {
1687
+ "name": "role",
1688
+ "type": "text",
1689
+ "primaryKey": false,
1690
+ "notNull": true
1691
+ },
1692
+ "permission_id": {
1693
+ "name": "permission_id",
1694
+ "type": "uuid",
1695
+ "primaryKey": false,
1696
+ "notNull": true
1697
+ },
1698
+ "created_at": {
1699
+ "name": "created_at",
1700
+ "type": "timestamp with time zone",
1701
+ "primaryKey": false,
1702
+ "notNull": true,
1703
+ "default": "now()"
1704
+ }
1705
+ },
1706
+ "indexes": {},
1707
+ "foreignKeys": {
1708
+ "role_permissions_permission_id_permissions_id_fk": {
1709
+ "name": "role_permissions_permission_id_permissions_id_fk",
1710
+ "tableFrom": "role_permissions",
1711
+ "tableTo": "permissions",
1712
+ "columnsFrom": [
1713
+ "permission_id"
1714
+ ],
1715
+ "columnsTo": [
1716
+ "id"
1717
+ ],
1718
+ "onDelete": "cascade",
1719
+ "onUpdate": "no action"
1720
+ }
1721
+ },
1722
+ "compositePrimaryKeys": {},
1723
+ "uniqueConstraints": {
1724
+ "role_permissions_idx": {
1725
+ "name": "role_permissions_idx",
1726
+ "nullsNotDistinct": false,
1727
+ "columns": [
1728
+ "role",
1729
+ "permission_id"
1730
+ ]
1731
+ }
1732
+ }
1733
+ },
1734
+ "public.saml_connections": {
1735
+ "name": "saml_connections",
1736
+ "schema": "",
1737
+ "columns": {
1738
+ "id": {
1739
+ "name": "id",
1740
+ "type": "uuid",
1741
+ "primaryKey": true,
1742
+ "notNull": true,
1743
+ "default": "gen_random_uuid()"
1744
+ },
1745
+ "org_id": {
1746
+ "name": "org_id",
1747
+ "type": "uuid",
1748
+ "primaryKey": false,
1749
+ "notNull": true
1750
+ },
1751
+ "name": {
1752
+ "name": "name",
1753
+ "type": "text",
1754
+ "primaryKey": false,
1755
+ "notNull": true
1756
+ },
1757
+ "idp_entity_id": {
1758
+ "name": "idp_entity_id",
1759
+ "type": "text",
1760
+ "primaryKey": false,
1761
+ "notNull": false
1762
+ },
1763
+ "idp_sso_url": {
1764
+ "name": "idp_sso_url",
1765
+ "type": "text",
1766
+ "primaryKey": false,
1767
+ "notNull": false
1768
+ },
1769
+ "idp_certificate": {
1770
+ "name": "idp_certificate",
1771
+ "type": "text",
1772
+ "primaryKey": false,
1773
+ "notNull": false
1774
+ },
1775
+ "sp_entity_id": {
1776
+ "name": "sp_entity_id",
1777
+ "type": "text",
1778
+ "primaryKey": false,
1779
+ "notNull": true
1780
+ },
1781
+ "sp_acs_url": {
1782
+ "name": "sp_acs_url",
1783
+ "type": "text",
1784
+ "primaryKey": false,
1785
+ "notNull": true
1786
+ },
1787
+ "attribute_mapping": {
1788
+ "name": "attribute_mapping",
1789
+ "type": "jsonb",
1790
+ "primaryKey": false,
1791
+ "notNull": true,
1792
+ "default": "'{}'::jsonb"
1793
+ },
1794
+ "is_active": {
1795
+ "name": "is_active",
1796
+ "type": "boolean",
1797
+ "primaryKey": false,
1798
+ "notNull": true,
1799
+ "default": true
1800
+ },
1801
+ "created_at": {
1802
+ "name": "created_at",
1803
+ "type": "timestamp with time zone",
1804
+ "primaryKey": false,
1805
+ "notNull": true,
1806
+ "default": "now()"
1807
+ },
1808
+ "updated_at": {
1809
+ "name": "updated_at",
1810
+ "type": "timestamp with time zone",
1811
+ "primaryKey": false,
1812
+ "notNull": true,
1813
+ "default": "now()"
1814
+ }
1815
+ },
1816
+ "indexes": {
1817
+ "saml_connections_org_idx": {
1818
+ "name": "saml_connections_org_idx",
1819
+ "columns": [
1820
+ {
1821
+ "expression": "org_id",
1822
+ "isExpression": false,
1823
+ "asc": true,
1824
+ "nulls": "last"
1825
+ }
1826
+ ],
1827
+ "isUnique": false,
1828
+ "concurrently": false,
1829
+ "method": "btree",
1830
+ "with": {}
1831
+ }
1832
+ },
1833
+ "foreignKeys": {
1834
+ "saml_connections_org_id_organizations_id_fk": {
1835
+ "name": "saml_connections_org_id_organizations_id_fk",
1836
+ "tableFrom": "saml_connections",
1837
+ "tableTo": "organizations",
1838
+ "columnsFrom": [
1839
+ "org_id"
1840
+ ],
1841
+ "columnsTo": [
1842
+ "id"
1843
+ ],
1844
+ "onDelete": "cascade",
1845
+ "onUpdate": "no action"
1846
+ }
1847
+ },
1848
+ "compositePrimaryKeys": {},
1849
+ "uniqueConstraints": {}
1850
+ },
1851
+ "public.secrets": {
1852
+ "name": "secrets",
1853
+ "schema": "",
1854
+ "columns": {
1855
+ "id": {
1856
+ "name": "id",
1857
+ "type": "uuid",
1858
+ "primaryKey": true,
1859
+ "notNull": true,
1860
+ "default": "gen_random_uuid()"
1861
+ },
1862
+ "key_id": {
1863
+ "name": "key_id",
1864
+ "type": "text",
1865
+ "primaryKey": false,
1866
+ "notNull": true
1867
+ },
1868
+ "type": {
1869
+ "name": "type",
1870
+ "type": "text",
1871
+ "primaryKey": false,
1872
+ "notNull": true
1873
+ },
1874
+ "value": {
1875
+ "name": "value",
1876
+ "type": "text",
1877
+ "primaryKey": false,
1878
+ "notNull": true
1879
+ },
1880
+ "algorithm": {
1881
+ "name": "algorithm",
1882
+ "type": "text",
1883
+ "primaryKey": false,
1884
+ "notNull": false
1885
+ },
1886
+ "is_active": {
1887
+ "name": "is_active",
1888
+ "type": "boolean",
1889
+ "primaryKey": false,
1890
+ "notNull": true,
1891
+ "default": true
1892
+ },
1893
+ "rotated_at": {
1894
+ "name": "rotated_at",
1895
+ "type": "timestamp with time zone",
1896
+ "primaryKey": false,
1897
+ "notNull": false
1898
+ },
1899
+ "expires_at": {
1900
+ "name": "expires_at",
1901
+ "type": "timestamp with time zone",
1902
+ "primaryKey": false,
1903
+ "notNull": false
1904
+ },
1905
+ "created_at": {
1906
+ "name": "created_at",
1907
+ "type": "timestamp with time zone",
1908
+ "primaryKey": false,
1909
+ "notNull": true,
1910
+ "default": "now()"
1911
+ }
1912
+ },
1913
+ "indexes": {
1914
+ "secrets_type_active_idx": {
1915
+ "name": "secrets_type_active_idx",
1916
+ "columns": [
1917
+ {
1918
+ "expression": "type",
1919
+ "isExpression": false,
1920
+ "asc": true,
1921
+ "nulls": "last"
1922
+ },
1923
+ {
1924
+ "expression": "is_active",
1925
+ "isExpression": false,
1926
+ "asc": true,
1927
+ "nulls": "last"
1928
+ }
1929
+ ],
1930
+ "isUnique": false,
1931
+ "concurrently": false,
1932
+ "method": "btree",
1933
+ "with": {}
1934
+ }
1935
+ },
1936
+ "foreignKeys": {},
1937
+ "compositePrimaryKeys": {},
1938
+ "uniqueConstraints": {
1939
+ "secrets_key_id_unique": {
1940
+ "name": "secrets_key_id_unique",
1941
+ "nullsNotDistinct": false,
1942
+ "columns": [
1943
+ "key_id"
1944
+ ]
1945
+ }
1946
+ }
1947
+ },
1948
+ "public.service_accounts": {
1949
+ "name": "service_accounts",
1950
+ "schema": "",
1951
+ "columns": {
1952
+ "id": {
1953
+ "name": "id",
1954
+ "type": "uuid",
1955
+ "primaryKey": true,
1956
+ "notNull": true,
1957
+ "default": "gen_random_uuid()"
1958
+ },
1959
+ "org_id": {
1960
+ "name": "org_id",
1961
+ "type": "uuid",
1962
+ "primaryKey": false,
1963
+ "notNull": true
1964
+ },
1965
+ "name": {
1966
+ "name": "name",
1967
+ "type": "text",
1968
+ "primaryKey": false,
1969
+ "notNull": true
1970
+ },
1971
+ "description": {
1972
+ "name": "description",
1973
+ "type": "text",
1974
+ "primaryKey": false,
1975
+ "notNull": false
1976
+ },
1977
+ "is_active": {
1978
+ "name": "is_active",
1979
+ "type": "boolean",
1980
+ "primaryKey": false,
1981
+ "notNull": true,
1982
+ "default": true
1983
+ },
1984
+ "created_at": {
1985
+ "name": "created_at",
1986
+ "type": "timestamp with time zone",
1987
+ "primaryKey": false,
1988
+ "notNull": true,
1989
+ "default": "now()"
1990
+ },
1991
+ "updated_at": {
1992
+ "name": "updated_at",
1993
+ "type": "timestamp with time zone",
1994
+ "primaryKey": false,
1995
+ "notNull": true,
1996
+ "default": "now()"
1997
+ }
1998
+ },
1999
+ "indexes": {
2000
+ "service_accounts_org_idx": {
2001
+ "name": "service_accounts_org_idx",
2002
+ "columns": [
2003
+ {
2004
+ "expression": "org_id",
2005
+ "isExpression": false,
2006
+ "asc": true,
2007
+ "nulls": "last"
2008
+ }
2009
+ ],
2010
+ "isUnique": false,
2011
+ "concurrently": false,
2012
+ "method": "btree",
2013
+ "with": {}
2014
+ }
2015
+ },
2016
+ "foreignKeys": {
2017
+ "service_accounts_org_id_organizations_id_fk": {
2018
+ "name": "service_accounts_org_id_organizations_id_fk",
2019
+ "tableFrom": "service_accounts",
2020
+ "tableTo": "organizations",
2021
+ "columnsFrom": [
2022
+ "org_id"
2023
+ ],
2024
+ "columnsTo": [
2025
+ "id"
2026
+ ],
2027
+ "onDelete": "cascade",
2028
+ "onUpdate": "no action"
2029
+ }
2030
+ },
2031
+ "compositePrimaryKeys": {},
2032
+ "uniqueConstraints": {}
2033
+ },
2034
+ "public.sms_otp_codes": {
2035
+ "name": "sms_otp_codes",
2036
+ "schema": "",
2037
+ "columns": {
2038
+ "id": {
2039
+ "name": "id",
2040
+ "type": "uuid",
2041
+ "primaryKey": true,
2042
+ "notNull": true,
2043
+ "default": "gen_random_uuid()"
2044
+ },
2045
+ "user_id": {
2046
+ "name": "user_id",
2047
+ "type": "uuid",
2048
+ "primaryKey": false,
2049
+ "notNull": true
2050
+ },
2051
+ "phone_number": {
2052
+ "name": "phone_number",
2053
+ "type": "text",
2054
+ "primaryKey": false,
2055
+ "notNull": true
2056
+ },
2057
+ "code_hash": {
2058
+ "name": "code_hash",
2059
+ "type": "text",
2060
+ "primaryKey": false,
2061
+ "notNull": true
2062
+ },
2063
+ "used_at": {
2064
+ "name": "used_at",
2065
+ "type": "timestamp with time zone",
2066
+ "primaryKey": false,
2067
+ "notNull": false
2068
+ },
2069
+ "expires_at": {
2070
+ "name": "expires_at",
2071
+ "type": "timestamp with time zone",
2072
+ "primaryKey": false,
2073
+ "notNull": true
2074
+ },
2075
+ "created_at": {
2076
+ "name": "created_at",
2077
+ "type": "timestamp with time zone",
2078
+ "primaryKey": false,
2079
+ "notNull": true,
2080
+ "default": "now()"
2081
+ }
2082
+ },
2083
+ "indexes": {
2084
+ "sms_otp_codes_user_idx": {
2085
+ "name": "sms_otp_codes_user_idx",
2086
+ "columns": [
2087
+ {
2088
+ "expression": "user_id",
2089
+ "isExpression": false,
2090
+ "asc": true,
2091
+ "nulls": "last"
2092
+ }
2093
+ ],
2094
+ "isUnique": false,
2095
+ "concurrently": false,
2096
+ "method": "btree",
2097
+ "with": {}
2098
+ }
2099
+ },
2100
+ "foreignKeys": {
2101
+ "sms_otp_codes_user_id_users_id_fk": {
2102
+ "name": "sms_otp_codes_user_id_users_id_fk",
2103
+ "tableFrom": "sms_otp_codes",
2104
+ "tableTo": "users",
2105
+ "columnsFrom": [
2106
+ "user_id"
2107
+ ],
2108
+ "columnsTo": [
2109
+ "id"
2110
+ ],
2111
+ "onDelete": "cascade",
2112
+ "onUpdate": "no action"
2113
+ }
2114
+ },
2115
+ "compositePrimaryKeys": {},
2116
+ "uniqueConstraints": {}
2117
+ },
2118
+ "public.totp_backup_codes": {
2119
+ "name": "totp_backup_codes",
2120
+ "schema": "",
2121
+ "columns": {
2122
+ "id": {
2123
+ "name": "id",
2124
+ "type": "uuid",
2125
+ "primaryKey": true,
2126
+ "notNull": true,
2127
+ "default": "gen_random_uuid()"
2128
+ },
2129
+ "user_id": {
2130
+ "name": "user_id",
2131
+ "type": "uuid",
2132
+ "primaryKey": false,
2133
+ "notNull": true
2134
+ },
2135
+ "code_hash": {
2136
+ "name": "code_hash",
2137
+ "type": "text",
2138
+ "primaryKey": false,
2139
+ "notNull": true
2140
+ },
2141
+ "used_at": {
2142
+ "name": "used_at",
2143
+ "type": "timestamp with time zone",
2144
+ "primaryKey": false,
2145
+ "notNull": false
2146
+ },
2147
+ "created_at": {
2148
+ "name": "created_at",
2149
+ "type": "timestamp with time zone",
2150
+ "primaryKey": false,
2151
+ "notNull": true,
2152
+ "default": "now()"
2153
+ }
2154
+ },
2155
+ "indexes": {
2156
+ "totp_backup_codes_user_idx": {
2157
+ "name": "totp_backup_codes_user_idx",
2158
+ "columns": [
2159
+ {
2160
+ "expression": "user_id",
2161
+ "isExpression": false,
2162
+ "asc": true,
2163
+ "nulls": "last"
2164
+ }
2165
+ ],
2166
+ "isUnique": false,
2167
+ "concurrently": false,
2168
+ "method": "btree",
2169
+ "with": {}
2170
+ },
2171
+ "totp_backup_codes_hash_idx": {
2172
+ "name": "totp_backup_codes_hash_idx",
2173
+ "columns": [
2174
+ {
2175
+ "expression": "code_hash",
2176
+ "isExpression": false,
2177
+ "asc": true,
2178
+ "nulls": "last"
2179
+ }
2180
+ ],
2181
+ "isUnique": false,
2182
+ "concurrently": false,
2183
+ "method": "btree",
2184
+ "with": {}
2185
+ }
2186
+ },
2187
+ "foreignKeys": {
2188
+ "totp_backup_codes_user_id_users_id_fk": {
2189
+ "name": "totp_backup_codes_user_id_users_id_fk",
2190
+ "tableFrom": "totp_backup_codes",
2191
+ "tableTo": "users",
2192
+ "columnsFrom": [
2193
+ "user_id"
2194
+ ],
2195
+ "columnsTo": [
2196
+ "id"
2197
+ ],
2198
+ "onDelete": "cascade",
2199
+ "onUpdate": "no action"
2200
+ }
2201
+ },
2202
+ "compositePrimaryKeys": {},
2203
+ "uniqueConstraints": {}
2204
+ },
2205
+ "public.user_devices": {
2206
+ "name": "user_devices",
2207
+ "schema": "",
2208
+ "columns": {
2209
+ "id": {
2210
+ "name": "id",
2211
+ "type": "uuid",
2212
+ "primaryKey": true,
2213
+ "notNull": true,
2214
+ "default": "gen_random_uuid()"
2215
+ },
2216
+ "user_id": {
2217
+ "name": "user_id",
2218
+ "type": "uuid",
2219
+ "primaryKey": false,
2220
+ "notNull": true
2221
+ },
2222
+ "fingerprint_hash": {
2223
+ "name": "fingerprint_hash",
2224
+ "type": "text",
2225
+ "primaryKey": false,
2226
+ "notNull": true
2227
+ },
2228
+ "ip_address": {
2229
+ "name": "ip_address",
2230
+ "type": "text",
2231
+ "primaryKey": false,
2232
+ "notNull": false
2233
+ },
2234
+ "user_agent": {
2235
+ "name": "user_agent",
2236
+ "type": "text",
2237
+ "primaryKey": false,
2238
+ "notNull": false
2239
+ },
2240
+ "first_seen_at": {
2241
+ "name": "first_seen_at",
2242
+ "type": "timestamp with time zone",
2243
+ "primaryKey": false,
2244
+ "notNull": true,
2245
+ "default": "now()"
2246
+ },
2247
+ "last_seen_at": {
2248
+ "name": "last_seen_at",
2249
+ "type": "timestamp with time zone",
2250
+ "primaryKey": false,
2251
+ "notNull": true,
2252
+ "default": "now()"
2253
+ },
2254
+ "trust_score": {
2255
+ "name": "trust_score",
2256
+ "type": "smallint",
2257
+ "primaryKey": false,
2258
+ "notNull": true,
2259
+ "default": 50
2260
+ },
2261
+ "new_device_alert_sent": {
2262
+ "name": "new_device_alert_sent",
2263
+ "type": "boolean",
2264
+ "primaryKey": false,
2265
+ "notNull": true,
2266
+ "default": false
2267
+ }
2268
+ },
2269
+ "indexes": {
2270
+ "user_devices_user_idx": {
2271
+ "name": "user_devices_user_idx",
2272
+ "columns": [
2273
+ {
2274
+ "expression": "user_id",
2275
+ "isExpression": false,
2276
+ "asc": true,
2277
+ "nulls": "last"
2278
+ }
2279
+ ],
2280
+ "isUnique": false,
2281
+ "concurrently": false,
2282
+ "method": "btree",
2283
+ "with": {}
2284
+ }
2285
+ },
2286
+ "foreignKeys": {
2287
+ "user_devices_user_id_users_id_fk": {
2288
+ "name": "user_devices_user_id_users_id_fk",
2289
+ "tableFrom": "user_devices",
2290
+ "tableTo": "users",
2291
+ "columnsFrom": [
2292
+ "user_id"
2293
+ ],
2294
+ "columnsTo": [
2295
+ "id"
2296
+ ],
2297
+ "onDelete": "cascade",
2298
+ "onUpdate": "no action"
2299
+ }
2300
+ },
2301
+ "compositePrimaryKeys": {},
2302
+ "uniqueConstraints": {
2303
+ "user_devices_unique": {
2304
+ "name": "user_devices_unique",
2305
+ "nullsNotDistinct": false,
2306
+ "columns": [
2307
+ "user_id",
2308
+ "fingerprint_hash"
2309
+ ]
2310
+ }
2311
+ }
2312
+ },
2313
+ "public.user_identities": {
2314
+ "name": "user_identities",
2315
+ "schema": "",
2316
+ "columns": {
2317
+ "id": {
2318
+ "name": "id",
2319
+ "type": "uuid",
2320
+ "primaryKey": true,
2321
+ "notNull": true,
2322
+ "default": "gen_random_uuid()"
2323
+ },
2324
+ "user_id": {
2325
+ "name": "user_id",
2326
+ "type": "uuid",
2327
+ "primaryKey": false,
2328
+ "notNull": true
2329
+ },
2330
+ "provider_id": {
2331
+ "name": "provider_id",
2332
+ "type": "uuid",
2333
+ "primaryKey": false,
2334
+ "notNull": true
2335
+ },
2336
+ "provider_type": {
2337
+ "name": "provider_type",
2338
+ "type": "text",
2339
+ "primaryKey": false,
2340
+ "notNull": true
2341
+ },
2342
+ "external_sub": {
2343
+ "name": "external_sub",
2344
+ "type": "text",
2345
+ "primaryKey": false,
2346
+ "notNull": true
2347
+ },
2348
+ "email": {
2349
+ "name": "email",
2350
+ "type": "text",
2351
+ "primaryKey": false,
2352
+ "notNull": false
2353
+ },
2354
+ "profile": {
2355
+ "name": "profile",
2356
+ "type": "jsonb",
2357
+ "primaryKey": false,
2358
+ "notNull": true,
2359
+ "default": "'{}'::jsonb"
2360
+ },
2361
+ "linked_at": {
2362
+ "name": "linked_at",
2363
+ "type": "timestamp with time zone",
2364
+ "primaryKey": false,
2365
+ "notNull": true,
2366
+ "default": "now()"
2367
+ }
2368
+ },
2369
+ "indexes": {
2370
+ "user_identities_user_idx": {
2371
+ "name": "user_identities_user_idx",
2372
+ "columns": [
2373
+ {
2374
+ "expression": "user_id",
2375
+ "isExpression": false,
2376
+ "asc": true,
2377
+ "nulls": "last"
2378
+ }
2379
+ ],
2380
+ "isUnique": false,
2381
+ "concurrently": false,
2382
+ "method": "btree",
2383
+ "with": {}
2384
+ },
2385
+ "user_identities_provider_sub_idx": {
2386
+ "name": "user_identities_provider_sub_idx",
2387
+ "columns": [
2388
+ {
2389
+ "expression": "provider_id",
2390
+ "isExpression": false,
2391
+ "asc": true,
2392
+ "nulls": "last"
2393
+ },
2394
+ {
2395
+ "expression": "external_sub",
2396
+ "isExpression": false,
2397
+ "asc": true,
2398
+ "nulls": "last"
2399
+ }
2400
+ ],
2401
+ "isUnique": false,
2402
+ "concurrently": false,
2403
+ "method": "btree",
2404
+ "with": {}
2405
+ }
2406
+ },
2407
+ "foreignKeys": {
2408
+ "user_identities_user_id_users_id_fk": {
2409
+ "name": "user_identities_user_id_users_id_fk",
2410
+ "tableFrom": "user_identities",
2411
+ "tableTo": "users",
2412
+ "columnsFrom": [
2413
+ "user_id"
2414
+ ],
2415
+ "columnsTo": [
2416
+ "id"
2417
+ ],
2418
+ "onDelete": "cascade",
2419
+ "onUpdate": "no action"
2420
+ },
2421
+ "user_identities_provider_id_identity_providers_id_fk": {
2422
+ "name": "user_identities_provider_id_identity_providers_id_fk",
2423
+ "tableFrom": "user_identities",
2424
+ "tableTo": "identity_providers",
2425
+ "columnsFrom": [
2426
+ "provider_id"
2427
+ ],
2428
+ "columnsTo": [
2429
+ "id"
2430
+ ],
2431
+ "onDelete": "cascade",
2432
+ "onUpdate": "no action"
2433
+ }
2434
+ },
2435
+ "compositePrimaryKeys": {},
2436
+ "uniqueConstraints": {}
2437
+ },
2438
+ "public.users": {
2439
+ "name": "users",
2440
+ "schema": "",
2441
+ "columns": {
2442
+ "id": {
2443
+ "name": "id",
2444
+ "type": "uuid",
2445
+ "primaryKey": true,
2446
+ "notNull": true,
2447
+ "default": "gen_random_uuid()"
2448
+ },
2449
+ "zitadel_user_id": {
2450
+ "name": "zitadel_user_id",
2451
+ "type": "text",
2452
+ "primaryKey": false,
2453
+ "notNull": false
2454
+ },
2455
+ "email": {
2456
+ "name": "email",
2457
+ "type": "text",
2458
+ "primaryKey": false,
2459
+ "notNull": true
2460
+ },
2461
+ "username": {
2462
+ "name": "username",
2463
+ "type": "text",
2464
+ "primaryKey": false,
2465
+ "notNull": true
2466
+ },
2467
+ "name": {
2468
+ "name": "name",
2469
+ "type": "text",
2470
+ "primaryKey": false,
2471
+ "notNull": false
2472
+ },
2473
+ "avatar_url": {
2474
+ "name": "avatar_url",
2475
+ "type": "text",
2476
+ "primaryKey": false,
2477
+ "notNull": false
2478
+ },
2479
+ "email_verified": {
2480
+ "name": "email_verified",
2481
+ "type": "boolean",
2482
+ "primaryKey": false,
2483
+ "notNull": true,
2484
+ "default": false
2485
+ },
2486
+ "email_verified_token": {
2487
+ "name": "email_verified_token",
2488
+ "type": "text",
2489
+ "primaryKey": false,
2490
+ "notNull": false
2491
+ },
2492
+ "provider": {
2493
+ "name": "provider",
2494
+ "type": "text",
2495
+ "primaryKey": false,
2496
+ "notNull": true,
2497
+ "default": "'password'"
2498
+ },
2499
+ "plan": {
2500
+ "name": "plan",
2501
+ "type": "text",
2502
+ "primaryKey": false,
2503
+ "notNull": true,
2504
+ "default": "'free'"
2505
+ },
2506
+ "role": {
2507
+ "name": "role",
2508
+ "type": "text",
2509
+ "primaryKey": false,
2510
+ "notNull": true,
2511
+ "default": "'user'"
2512
+ },
2513
+ "default_org_id": {
2514
+ "name": "default_org_id",
2515
+ "type": "uuid",
2516
+ "primaryKey": false,
2517
+ "notNull": false
2518
+ },
2519
+ "phone_number": {
2520
+ "name": "phone_number",
2521
+ "type": "text",
2522
+ "primaryKey": false,
2523
+ "notNull": false
2524
+ },
2525
+ "phone_verified": {
2526
+ "name": "phone_verified",
2527
+ "type": "boolean",
2528
+ "primaryKey": false,
2529
+ "notNull": true,
2530
+ "default": false
2531
+ },
2532
+ "password_hash": {
2533
+ "name": "password_hash",
2534
+ "type": "text",
2535
+ "primaryKey": false,
2536
+ "notNull": false
2537
+ },
2538
+ "totp_secret": {
2539
+ "name": "totp_secret",
2540
+ "type": "text",
2541
+ "primaryKey": false,
2542
+ "notNull": false
2543
+ },
2544
+ "totp_enabled": {
2545
+ "name": "totp_enabled",
2546
+ "type": "boolean",
2547
+ "primaryKey": false,
2548
+ "notNull": true,
2549
+ "default": false
2550
+ },
2551
+ "totp_verified_at": {
2552
+ "name": "totp_verified_at",
2553
+ "type": "timestamp with time zone",
2554
+ "primaryKey": false,
2555
+ "notNull": false
2556
+ },
2557
+ "created_at": {
2558
+ "name": "created_at",
2559
+ "type": "timestamp with time zone",
2560
+ "primaryKey": false,
2561
+ "notNull": true,
2562
+ "default": "now()"
2563
+ },
2564
+ "updated_at": {
2565
+ "name": "updated_at",
2566
+ "type": "timestamp with time zone",
2567
+ "primaryKey": false,
2568
+ "notNull": true,
2569
+ "default": "now()"
2570
+ }
2571
+ },
2572
+ "indexes": {
2573
+ "users_email_idx": {
2574
+ "name": "users_email_idx",
2575
+ "columns": [
2576
+ {
2577
+ "expression": "email",
2578
+ "isExpression": false,
2579
+ "asc": true,
2580
+ "nulls": "last"
2581
+ }
2582
+ ],
2583
+ "isUnique": false,
2584
+ "concurrently": false,
2585
+ "method": "btree",
2586
+ "with": {}
2587
+ },
2588
+ "users_zitadel_idx": {
2589
+ "name": "users_zitadel_idx",
2590
+ "columns": [
2591
+ {
2592
+ "expression": "zitadel_user_id",
2593
+ "isExpression": false,
2594
+ "asc": true,
2595
+ "nulls": "last"
2596
+ }
2597
+ ],
2598
+ "isUnique": false,
2599
+ "concurrently": false,
2600
+ "method": "btree",
2601
+ "with": {}
2602
+ },
2603
+ "users_default_org_idx": {
2604
+ "name": "users_default_org_idx",
2605
+ "columns": [
2606
+ {
2607
+ "expression": "default_org_id",
2608
+ "isExpression": false,
2609
+ "asc": true,
2610
+ "nulls": "last"
2611
+ }
2612
+ ],
2613
+ "isUnique": false,
2614
+ "concurrently": false,
2615
+ "method": "btree",
2616
+ "with": {}
2617
+ }
2618
+ },
2619
+ "foreignKeys": {
2620
+ "users_default_org_id_organizations_id_fk": {
2621
+ "name": "users_default_org_id_organizations_id_fk",
2622
+ "tableFrom": "users",
2623
+ "tableTo": "organizations",
2624
+ "columnsFrom": [
2625
+ "default_org_id"
2626
+ ],
2627
+ "columnsTo": [
2628
+ "id"
2629
+ ],
2630
+ "onDelete": "set null",
2631
+ "onUpdate": "no action"
2632
+ }
2633
+ },
2634
+ "compositePrimaryKeys": {},
2635
+ "uniqueConstraints": {
2636
+ "users_zitadel_user_id_unique": {
2637
+ "name": "users_zitadel_user_id_unique",
2638
+ "nullsNotDistinct": false,
2639
+ "columns": [
2640
+ "zitadel_user_id"
2641
+ ]
2642
+ },
2643
+ "users_email_unique": {
2644
+ "name": "users_email_unique",
2645
+ "nullsNotDistinct": false,
2646
+ "columns": [
2647
+ "email"
2648
+ ]
2649
+ },
2650
+ "users_username_unique": {
2651
+ "name": "users_username_unique",
2652
+ "nullsNotDistinct": false,
2653
+ "columns": [
2654
+ "username"
2655
+ ]
2656
+ }
2657
+ }
2658
+ },
2659
+ "public.webauthn_credentials": {
2660
+ "name": "webauthn_credentials",
2661
+ "schema": "",
2662
+ "columns": {
2663
+ "id": {
2664
+ "name": "id",
2665
+ "type": "uuid",
2666
+ "primaryKey": true,
2667
+ "notNull": true,
2668
+ "default": "gen_random_uuid()"
2669
+ },
2670
+ "user_id": {
2671
+ "name": "user_id",
2672
+ "type": "uuid",
2673
+ "primaryKey": false,
2674
+ "notNull": true
2675
+ },
2676
+ "credential_id": {
2677
+ "name": "credential_id",
2678
+ "type": "text",
2679
+ "primaryKey": false,
2680
+ "notNull": true
2681
+ },
2682
+ "public_key": {
2683
+ "name": "public_key",
2684
+ "type": "text",
2685
+ "primaryKey": false,
2686
+ "notNull": true
2687
+ },
2688
+ "counter": {
2689
+ "name": "counter",
2690
+ "type": "integer",
2691
+ "primaryKey": false,
2692
+ "notNull": true,
2693
+ "default": 0
2694
+ },
2695
+ "transports": {
2696
+ "name": "transports",
2697
+ "type": "text[]",
2698
+ "primaryKey": false,
2699
+ "notNull": true,
2700
+ "default": "'{}'::text[]"
2701
+ },
2702
+ "aaguid": {
2703
+ "name": "aaguid",
2704
+ "type": "text",
2705
+ "primaryKey": false,
2706
+ "notNull": false
2707
+ },
2708
+ "device_name": {
2709
+ "name": "device_name",
2710
+ "type": "text",
2711
+ "primaryKey": false,
2712
+ "notNull": false
2713
+ },
2714
+ "last_used_at": {
2715
+ "name": "last_used_at",
2716
+ "type": "timestamp with time zone",
2717
+ "primaryKey": false,
2718
+ "notNull": false
2719
+ },
2720
+ "created_at": {
2721
+ "name": "created_at",
2722
+ "type": "timestamp with time zone",
2723
+ "primaryKey": false,
2724
+ "notNull": true,
2725
+ "default": "now()"
2726
+ }
2727
+ },
2728
+ "indexes": {
2729
+ "webauthn_credentials_user_idx": {
2730
+ "name": "webauthn_credentials_user_idx",
2731
+ "columns": [
2732
+ {
2733
+ "expression": "user_id",
2734
+ "isExpression": false,
2735
+ "asc": true,
2736
+ "nulls": "last"
2737
+ }
2738
+ ],
2739
+ "isUnique": false,
2740
+ "concurrently": false,
2741
+ "method": "btree",
2742
+ "with": {}
2743
+ }
2744
+ },
2745
+ "foreignKeys": {
2746
+ "webauthn_credentials_user_id_users_id_fk": {
2747
+ "name": "webauthn_credentials_user_id_users_id_fk",
2748
+ "tableFrom": "webauthn_credentials",
2749
+ "tableTo": "users",
2750
+ "columnsFrom": [
2751
+ "user_id"
2752
+ ],
2753
+ "columnsTo": [
2754
+ "id"
2755
+ ],
2756
+ "onDelete": "cascade",
2757
+ "onUpdate": "no action"
2758
+ }
2759
+ },
2760
+ "compositePrimaryKeys": {},
2761
+ "uniqueConstraints": {
2762
+ "webauthn_credentials_credential_id_unique": {
2763
+ "name": "webauthn_credentials_credential_id_unique",
2764
+ "nullsNotDistinct": false,
2765
+ "columns": [
2766
+ "credential_id"
2767
+ ]
2768
+ }
2769
+ }
2770
+ },
2771
+ "public.workflow_runs": {
2772
+ "name": "workflow_runs",
2773
+ "schema": "",
2774
+ "columns": {
2775
+ "id": {
2776
+ "name": "id",
2777
+ "type": "uuid",
2778
+ "primaryKey": true,
2779
+ "notNull": true,
2780
+ "default": "gen_random_uuid()"
2781
+ },
2782
+ "workflow_id": {
2783
+ "name": "workflow_id",
2784
+ "type": "uuid",
2785
+ "primaryKey": false,
2786
+ "notNull": true
2787
+ },
2788
+ "trigger_event": {
2789
+ "name": "trigger_event",
2790
+ "type": "text",
2791
+ "primaryKey": false,
2792
+ "notNull": true
2793
+ },
2794
+ "payload": {
2795
+ "name": "payload",
2796
+ "type": "jsonb",
2797
+ "primaryKey": false,
2798
+ "notNull": true,
2799
+ "default": "'{}'::jsonb"
2800
+ },
2801
+ "status": {
2802
+ "name": "status",
2803
+ "type": "text",
2804
+ "primaryKey": false,
2805
+ "notNull": true,
2806
+ "default": "'pending'"
2807
+ },
2808
+ "started_at": {
2809
+ "name": "started_at",
2810
+ "type": "timestamp with time zone",
2811
+ "primaryKey": false,
2812
+ "notNull": false
2813
+ },
2814
+ "finished_at": {
2815
+ "name": "finished_at",
2816
+ "type": "timestamp with time zone",
2817
+ "primaryKey": false,
2818
+ "notNull": false
2819
+ },
2820
+ "log": {
2821
+ "name": "log",
2822
+ "type": "jsonb",
2823
+ "primaryKey": false,
2824
+ "notNull": true,
2825
+ "default": "'[]'::jsonb"
2826
+ }
2827
+ },
2828
+ "indexes": {
2829
+ "workflow_runs_workflow_idx": {
2830
+ "name": "workflow_runs_workflow_idx",
2831
+ "columns": [
2832
+ {
2833
+ "expression": "workflow_id",
2834
+ "isExpression": false,
2835
+ "asc": true,
2836
+ "nulls": "last"
2837
+ }
2838
+ ],
2839
+ "isUnique": false,
2840
+ "concurrently": false,
2841
+ "method": "btree",
2842
+ "with": {}
2843
+ }
2844
+ },
2845
+ "foreignKeys": {
2846
+ "workflow_runs_workflow_id_workflows_id_fk": {
2847
+ "name": "workflow_runs_workflow_id_workflows_id_fk",
2848
+ "tableFrom": "workflow_runs",
2849
+ "tableTo": "workflows",
2850
+ "columnsFrom": [
2851
+ "workflow_id"
2852
+ ],
2853
+ "columnsTo": [
2854
+ "id"
2855
+ ],
2856
+ "onDelete": "cascade",
2857
+ "onUpdate": "no action"
2858
+ }
2859
+ },
2860
+ "compositePrimaryKeys": {},
2861
+ "uniqueConstraints": {}
2862
+ },
2863
+ "public.workflows": {
2864
+ "name": "workflows",
2865
+ "schema": "",
2866
+ "columns": {
2867
+ "id": {
2868
+ "name": "id",
2869
+ "type": "uuid",
2870
+ "primaryKey": true,
2871
+ "notNull": true,
2872
+ "default": "gen_random_uuid()"
2873
+ },
2874
+ "org_id": {
2875
+ "name": "org_id",
2876
+ "type": "uuid",
2877
+ "primaryKey": false,
2878
+ "notNull": false
2879
+ },
2880
+ "name": {
2881
+ "name": "name",
2882
+ "type": "text",
2883
+ "primaryKey": false,
2884
+ "notNull": true
2885
+ },
2886
+ "trigger": {
2887
+ "name": "trigger",
2888
+ "type": "text",
2889
+ "primaryKey": false,
2890
+ "notNull": true
2891
+ },
2892
+ "definition": {
2893
+ "name": "definition",
2894
+ "type": "jsonb",
2895
+ "primaryKey": false,
2896
+ "notNull": true,
2897
+ "default": "'{}'::jsonb"
2898
+ },
2899
+ "is_active": {
2900
+ "name": "is_active",
2901
+ "type": "boolean",
2902
+ "primaryKey": false,
2903
+ "notNull": true,
2904
+ "default": true
2905
+ },
2906
+ "created_at": {
2907
+ "name": "created_at",
2908
+ "type": "timestamp with time zone",
2909
+ "primaryKey": false,
2910
+ "notNull": true,
2911
+ "default": "now()"
2912
+ },
2913
+ "updated_at": {
2914
+ "name": "updated_at",
2915
+ "type": "timestamp with time zone",
2916
+ "primaryKey": false,
2917
+ "notNull": true,
2918
+ "default": "now()"
2919
+ }
2920
+ },
2921
+ "indexes": {
2922
+ "workflows_trigger_idx": {
2923
+ "name": "workflows_trigger_idx",
2924
+ "columns": [
2925
+ {
2926
+ "expression": "trigger",
2927
+ "isExpression": false,
2928
+ "asc": true,
2929
+ "nulls": "last"
2930
+ }
2931
+ ],
2932
+ "isUnique": false,
2933
+ "concurrently": false,
2934
+ "method": "btree",
2935
+ "with": {}
2936
+ }
2937
+ },
2938
+ "foreignKeys": {
2939
+ "workflows_org_id_organizations_id_fk": {
2940
+ "name": "workflows_org_id_organizations_id_fk",
2941
+ "tableFrom": "workflows",
2942
+ "tableTo": "organizations",
2943
+ "columnsFrom": [
2944
+ "org_id"
2945
+ ],
2946
+ "columnsTo": [
2947
+ "id"
2948
+ ],
2949
+ "onDelete": "cascade",
2950
+ "onUpdate": "no action"
2951
+ }
2952
+ },
2953
+ "compositePrimaryKeys": {},
2954
+ "uniqueConstraints": {}
2955
+ }
2956
+ },
2957
+ "enums": {},
2958
+ "schemas": {},
2959
+ "_meta": {
2960
+ "columns": {},
2961
+ "schemas": {},
2962
+ "tables": {}
2963
+ }
2964
+ }