@hilbras/keystone 1.6.0 → 1.9.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 (559) hide show
  1. package/CHANGELOG.md +239 -0
  2. package/README.md +55 -25
  3. package/dist/cli.js +25 -27
  4. package/dist/cli.js.map +1 -1
  5. package/dist/config.d.ts +15 -1
  6. package/dist/config.d.ts.map +1 -1
  7. package/dist/config.js +45 -8
  8. package/dist/config.js.map +1 -1
  9. package/dist/container.d.ts +4 -1
  10. package/dist/container.d.ts.map +1 -1
  11. package/dist/container.js.map +1 -1
  12. package/dist/db/migrations/0008_flashy_firestar.sql +5 -0
  13. package/dist/db/migrations/0009_daffy_changeling.sql +1 -0
  14. package/dist/db/migrations/0010_wealthy_shadow_king.sql +37 -0
  15. package/dist/db/migrations/0011_overrated_vector.sql +18 -0
  16. package/dist/db/migrations/0012_brave_darkhawk.sql +28 -0
  17. package/dist/db/migrations/0013_wonderful_chimera.sql +5 -0
  18. package/dist/db/migrations/0014_magical_morph.sql +48 -0
  19. package/{src/db/migrations/meta/0007_snapshot.json → dist/db/migrations/meta/0008_snapshot.json} +136 -32
  20. package/{src/db/migrations/meta/0006_snapshot.json → dist/db/migrations/meta/0009_snapshot.json} +359 -30
  21. package/{src/db/migrations/meta/0005_snapshot.json → dist/db/migrations/meta/0010_snapshot.json} +459 -29
  22. package/{src/db/migrations/meta/0004_snapshot.json → dist/db/migrations/meta/0011_snapshot.json} +594 -30
  23. package/dist/db/migrations/meta/0012_snapshot.json +3891 -0
  24. package/dist/db/migrations/meta/0013_snapshot.json +3919 -0
  25. package/dist/db/migrations/meta/0014_snapshot.json +4311 -0
  26. package/dist/db/migrations/meta/_journal.json +49 -0
  27. package/dist/db/reencryptOidcSecrets.d.ts +2 -0
  28. package/dist/db/reencryptOidcSecrets.d.ts.map +1 -0
  29. package/dist/db/reencryptOidcSecrets.js +41 -0
  30. package/dist/db/reencryptOidcSecrets.js.map +1 -0
  31. package/dist/db/schema.d.ts +2521 -53
  32. package/dist/db/schema.d.ts.map +1 -1
  33. package/dist/db/schema.js +118 -3
  34. package/dist/db/schema.js.map +1 -1
  35. package/dist/db/seed.js +67 -40
  36. package/dist/db/seed.js.map +1 -1
  37. package/dist/di.d.ts.map +1 -1
  38. package/dist/di.js +11 -3
  39. package/dist/di.js.map +1 -1
  40. package/dist/index.d.ts +2 -2
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +26 -2
  43. package/dist/index.js.map +1 -1
  44. package/dist/lib/errors.d.ts +2 -1
  45. package/dist/lib/errors.d.ts.map +1 -1
  46. package/dist/lib/errors.js +10 -0
  47. package/dist/lib/errors.js.map +1 -1
  48. package/dist/plugins/appContext.d.ts.map +1 -1
  49. package/dist/plugins/appContext.js +3 -12
  50. package/dist/plugins/appContext.js.map +1 -1
  51. package/dist/plugins/audit.d.ts.map +1 -1
  52. package/dist/plugins/audit.js +26 -6
  53. package/dist/plugins/audit.js.map +1 -1
  54. package/dist/plugins/auth.d.ts.map +1 -1
  55. package/dist/plugins/auth.js +32 -7
  56. package/dist/plugins/auth.js.map +1 -1
  57. package/dist/plugins/metrics.d.ts.map +1 -1
  58. package/dist/plugins/mtls.d.ts.map +1 -1
  59. package/dist/plugins/permissions.d.ts.map +1 -1
  60. package/dist/plugins/permissions.js +29 -9
  61. package/dist/plugins/permissions.js.map +1 -1
  62. package/dist/plugins/rateLimit.d.ts +15 -0
  63. package/dist/plugins/rateLimit.d.ts.map +1 -1
  64. package/dist/plugins/rateLimit.js +11 -1
  65. package/dist/plugins/rateLimit.js.map +1 -1
  66. package/dist/plugins/requestLogger.d.ts.map +1 -1
  67. package/dist/repositories/apiKey.d.ts.map +1 -1
  68. package/dist/repositories/application.d.ts.map +1 -1
  69. package/dist/repositories/application.js +1 -1
  70. package/dist/repositories/application.js.map +1 -1
  71. package/dist/repositories/audit.d.ts.map +1 -1
  72. package/dist/repositories/index.d.ts +3 -0
  73. package/dist/repositories/index.d.ts.map +1 -1
  74. package/dist/repositories/index.js +3 -0
  75. package/dist/repositories/index.js.map +1 -1
  76. package/dist/repositories/mfaChallenge.d.ts +23 -0
  77. package/dist/repositories/mfaChallenge.d.ts.map +1 -0
  78. package/dist/repositories/mfaChallenge.js +71 -0
  79. package/dist/repositories/mfaChallenge.js.map +1 -0
  80. package/dist/repositories/oidcConnection.d.ts +27 -43
  81. package/dist/repositories/oidcConnection.d.ts.map +1 -1
  82. package/dist/repositories/oidcConnection.js +15 -6
  83. package/dist/repositories/oidcConnection.js.map +1 -1
  84. package/dist/repositories/organization.d.ts +9 -9
  85. package/dist/repositories/organization.d.ts.map +1 -1
  86. package/dist/repositories/organization.js +91 -37
  87. package/dist/repositories/organization.js.map +1 -1
  88. package/dist/repositories/permission.d.ts.map +1 -1
  89. package/dist/repositories/permission.js +27 -5
  90. package/dist/repositories/permission.js.map +1 -1
  91. package/dist/repositories/samlConnection.d.ts +28 -28
  92. package/dist/repositories/samlConnection.d.ts.map +1 -1
  93. package/dist/repositories/samlConnection.js +12 -4
  94. package/dist/repositories/samlConnection.js.map +1 -1
  95. package/dist/repositories/scimConnection.d.ts +38 -0
  96. package/dist/repositories/scimConnection.d.ts.map +1 -0
  97. package/dist/repositories/scimConnection.js +123 -0
  98. package/dist/repositories/scimConnection.js.map +1 -0
  99. package/dist/repositories/scimGroup.d.ts +36 -0
  100. package/dist/repositories/scimGroup.d.ts.map +1 -0
  101. package/dist/repositories/scimGroup.js +113 -0
  102. package/dist/repositories/scimGroup.js.map +1 -0
  103. package/dist/repositories/session.d.ts +23 -13
  104. package/dist/repositories/session.d.ts.map +1 -1
  105. package/dist/repositories/session.js +13 -1
  106. package/dist/repositories/session.js.map +1 -1
  107. package/dist/repositories/types.d.ts +112 -5
  108. package/dist/repositories/types.d.ts.map +1 -1
  109. package/dist/repositories/types.js +7 -1
  110. package/dist/repositories/types.js.map +1 -1
  111. package/dist/repositories/user.d.ts +23 -1
  112. package/dist/repositories/user.d.ts.map +1 -1
  113. package/dist/repositories/user.js +180 -4
  114. package/dist/repositories/user.js.map +1 -1
  115. package/dist/routes/admin/billing.js +4 -4
  116. package/dist/routes/admin/billing.js.map +1 -1
  117. package/dist/routes/admin/helpers.d.ts +16 -20
  118. package/dist/routes/admin/helpers.d.ts.map +1 -1
  119. package/dist/routes/admin/helpers.js +53 -10
  120. package/dist/routes/admin/helpers.js.map +1 -1
  121. package/dist/routes/admin/organizations.d.ts.map +1 -1
  122. package/dist/routes/admin/organizations.js +76 -69
  123. package/dist/routes/admin/organizations.js.map +1 -1
  124. package/dist/routes/admin/permissions.d.ts.map +1 -1
  125. package/dist/routes/admin/permissions.js +48 -14
  126. package/dist/routes/admin/permissions.js.map +1 -1
  127. package/dist/routes/admin/platform.d.ts.map +1 -1
  128. package/dist/routes/admin/platform.js +86 -35
  129. package/dist/routes/admin/platform.js.map +1 -1
  130. package/dist/routes/admin/sso.d.ts.map +1 -1
  131. package/dist/routes/admin/sso.js +143 -12
  132. package/dist/routes/admin/sso.js.map +1 -1
  133. package/dist/routes/admin/webhooks.js +8 -8
  134. package/dist/routes/admin/webhooks.js.map +1 -1
  135. package/dist/routes/apiKeys.d.ts.map +1 -1
  136. package/dist/routes/apiKeys.js +23 -5
  137. package/dist/routes/apiKeys.js.map +1 -1
  138. package/dist/routes/auth.d.ts.map +1 -1
  139. package/dist/routes/auth.js +112 -22
  140. package/dist/routes/auth.js.map +1 -1
  141. package/dist/routes/authz.d.ts.map +1 -1
  142. package/dist/routes/authz.js +16 -4
  143. package/dist/routes/authz.js.map +1 -1
  144. package/dist/routes/config.d.ts.map +1 -1
  145. package/dist/routes/config.js +16 -14
  146. package/dist/routes/config.js.map +1 -1
  147. package/dist/routes/federation.d.ts.map +1 -1
  148. package/dist/routes/federation.js +17 -3
  149. package/dist/routes/federation.js.map +1 -1
  150. package/dist/routes/magicLinks.d.ts.map +1 -1
  151. package/dist/routes/magicLinks.js +15 -3
  152. package/dist/routes/magicLinks.js.map +1 -1
  153. package/dist/routes/oauth.d.ts.map +1 -1
  154. package/dist/routes/oauth.js +22 -3
  155. package/dist/routes/oauth.js.map +1 -1
  156. package/dist/routes/oauth2.d.ts.map +1 -1
  157. package/dist/routes/oauth2.js +104 -11
  158. package/dist/routes/oauth2.js.map +1 -1
  159. package/dist/routes/oidcEnterprise.d.ts.map +1 -1
  160. package/dist/routes/oidcEnterprise.js +67 -21
  161. package/dist/routes/oidcEnterprise.js.map +1 -1
  162. package/dist/routes/password.d.ts.map +1 -1
  163. package/dist/routes/password.js.map +1 -1
  164. package/dist/routes/profile.js +4 -4
  165. package/dist/routes/profile.js.map +1 -1
  166. package/dist/routes/saml.d.ts +9 -0
  167. package/dist/routes/saml.d.ts.map +1 -1
  168. package/dist/routes/saml.js +187 -11
  169. package/dist/routes/saml.js.map +1 -1
  170. package/dist/routes/scim.d.ts +13 -0
  171. package/dist/routes/scim.d.ts.map +1 -1
  172. package/dist/routes/scim.js +885 -110
  173. package/dist/routes/scim.js.map +1 -1
  174. package/dist/routes/sdk.d.ts.map +1 -1
  175. package/dist/routes/sdk.js +24 -8
  176. package/dist/routes/sdk.js.map +1 -1
  177. package/dist/routes/serviceAccounts.d.ts.map +1 -1
  178. package/dist/routes/serviceAccounts.js +2 -1
  179. package/dist/routes/serviceAccounts.js.map +1 -1
  180. package/dist/routes/setup.d.ts.map +1 -1
  181. package/dist/routes/setup.js +15 -16
  182. package/dist/routes/setup.js.map +1 -1
  183. package/dist/routes/smsOtp.js +1 -1
  184. package/dist/routes/smsOtp.js.map +1 -1
  185. package/dist/routes/totp.d.ts.map +1 -1
  186. package/dist/routes/totp.js +113 -23
  187. package/dist/routes/totp.js.map +1 -1
  188. package/dist/routes/webauthn.d.ts.map +1 -1
  189. package/dist/routes/webauthn.js +44 -8
  190. package/dist/routes/webauthn.js.map +1 -1
  191. package/dist/routes/workflows.d.ts.map +1 -1
  192. package/dist/routes/workflows.js +58 -25
  193. package/dist/routes/workflows.js.map +1 -1
  194. package/dist/sdk/index.d.ts.map +1 -1
  195. package/dist/sdk/index.js +141 -40
  196. package/dist/sdk/index.js.map +1 -1
  197. package/dist/sdk/types.d.ts +60 -29
  198. package/dist/sdk/types.d.ts.map +1 -1
  199. package/dist/services/application/authentication.d.ts +39 -1
  200. package/dist/services/application/authentication.d.ts.map +1 -1
  201. package/dist/services/application/authentication.js +43 -1
  202. package/dist/services/application/authentication.js.map +1 -1
  203. package/dist/services/application/identity.d.ts +10 -7
  204. package/dist/services/application/identity.d.ts.map +1 -1
  205. package/dist/services/application/identity.js +13 -10
  206. package/dist/services/application/identity.js.map +1 -1
  207. package/dist/services/application/organization.d.ts +11 -7
  208. package/dist/services/application/organization.d.ts.map +1 -1
  209. package/dist/services/application/organization.js +160 -12
  210. package/dist/services/application/organization.js.map +1 -1
  211. package/dist/services/applications.js +2 -2
  212. package/dist/services/applications.js.map +1 -1
  213. package/dist/services/audit.d.ts +1 -0
  214. package/dist/services/audit.d.ts.map +1 -1
  215. package/dist/services/audit.js +13 -0
  216. package/dist/services/audit.js.map +1 -1
  217. package/dist/services/cache.d.ts.map +1 -1
  218. package/dist/services/configuration/profiles.d.ts +4 -0
  219. package/dist/services/configuration/profiles.d.ts.map +1 -1
  220. package/dist/services/configuration/profiles.js +50 -0
  221. package/dist/services/configuration/profiles.js.map +1 -1
  222. package/dist/services/configuration.d.ts.map +1 -1
  223. package/dist/services/configuration.js.map +1 -1
  224. package/dist/services/connectors/google.d.ts.map +1 -1
  225. package/dist/services/connectors/google.js +3 -2
  226. package/dist/services/connectors/google.js.map +1 -1
  227. package/dist/services/connectors/oidc.d.ts.map +1 -1
  228. package/dist/services/connectors/oidc.js +6 -3
  229. package/dist/services/connectors/oidc.js.map +1 -1
  230. package/dist/services/connectors/zitadel.d.ts.map +1 -1
  231. package/dist/services/connectors/zitadel.js +4 -3
  232. package/dist/services/connectors/zitadel.js.map +1 -1
  233. package/dist/services/domain/authentication.d.ts +43 -4
  234. package/dist/services/domain/authentication.d.ts.map +1 -1
  235. package/dist/services/domain/authentication.js +82 -20
  236. package/dist/services/domain/authentication.js.map +1 -1
  237. package/dist/services/domain/authorization.d.ts +11 -0
  238. package/dist/services/domain/authorization.d.ts.map +1 -1
  239. package/dist/services/domain/authorization.js +36 -1
  240. package/dist/services/domain/authorization.js.map +1 -1
  241. package/dist/services/domain/identity.d.ts +21 -9
  242. package/dist/services/domain/identity.d.ts.map +1 -1
  243. package/dist/services/domain/identity.js +187 -10
  244. package/dist/services/domain/identity.js.map +1 -1
  245. package/dist/services/domain/organization.d.ts +6 -9
  246. package/dist/services/domain/organization.d.ts.map +1 -1
  247. package/dist/services/domain/organization.js +48 -30
  248. package/dist/services/domain/organization.js.map +1 -1
  249. package/dist/services/emailVerification.d.ts +2 -2
  250. package/dist/services/enterpriseSso.d.ts +13 -6
  251. package/dist/services/enterpriseSso.d.ts.map +1 -1
  252. package/dist/services/enterpriseSso.js +75 -6
  253. package/dist/services/enterpriseSso.js.map +1 -1
  254. package/dist/services/events/subscribers/auditLog.js +1 -1
  255. package/dist/services/events/subscribers/auditLog.js.map +1 -1
  256. package/dist/services/events/types.d.ts +7 -1
  257. package/dist/services/events/types.d.ts.map +1 -1
  258. package/dist/services/events/types.js.map +1 -1
  259. package/dist/services/events/validate.d.ts.map +1 -1
  260. package/dist/services/events/validate.js +27 -0
  261. package/dist/services/events/validate.js.map +1 -1
  262. package/dist/services/features.d.ts.map +1 -1
  263. package/dist/services/features.js.map +1 -1
  264. package/dist/services/federation.d.ts +6 -1
  265. package/dist/services/federation.d.ts.map +1 -1
  266. package/dist/services/federation.js +31 -4
  267. package/dist/services/federation.js.map +1 -1
  268. package/dist/services/ipControls.js +2 -2
  269. package/dist/services/ipControls.js.map +1 -1
  270. package/dist/services/magicLinks.d.ts +2 -2
  271. package/dist/services/mfa.d.ts +53 -0
  272. package/dist/services/mfa.d.ts.map +1 -0
  273. package/dist/services/mfa.js +157 -0
  274. package/dist/services/mfa.js.map +1 -0
  275. package/dist/services/oauth2.d.ts +16 -12
  276. package/dist/services/oauth2.d.ts.map +1 -1
  277. package/dist/services/oauth2.js +22 -13
  278. package/dist/services/oauth2.js.map +1 -1
  279. package/dist/services/oidcSecretFormat.d.ts +3 -0
  280. package/dist/services/oidcSecretFormat.d.ts.map +1 -0
  281. package/dist/services/oidcSecretFormat.js +5 -0
  282. package/dist/services/oidcSecretFormat.js.map +1 -0
  283. package/dist/services/organizations.d.ts +4 -16
  284. package/dist/services/organizations.d.ts.map +1 -1
  285. package/dist/services/organizations.js +0 -62
  286. package/dist/services/organizations.js.map +1 -1
  287. package/dist/services/permissions.d.ts.map +1 -1
  288. package/dist/services/permissions.js +9 -1
  289. package/dist/services/permissions.js.map +1 -1
  290. package/dist/services/plugins/registry.d.ts.map +1 -1
  291. package/dist/services/plugins/registry.js.map +1 -1
  292. package/dist/services/plugins/types.d.ts.map +1 -1
  293. package/dist/services/queue/bullmq.d.ts.map +1 -1
  294. package/dist/services/queue/inProcess.d.ts.map +1 -1
  295. package/dist/services/redis.d.ts +1 -1
  296. package/dist/services/redis.d.ts.map +1 -1
  297. package/dist/services/scimCredentials.d.ts +46 -0
  298. package/dist/services/scimCredentials.d.ts.map +1 -0
  299. package/dist/services/scimCredentials.js +123 -0
  300. package/dist/services/scimCredentials.js.map +1 -0
  301. package/dist/services/scimLegacyMigration.d.ts +12 -0
  302. package/dist/services/scimLegacyMigration.d.ts.map +1 -0
  303. package/dist/services/scimLegacyMigration.js +44 -0
  304. package/dist/services/scimLegacyMigration.js.map +1 -0
  305. package/dist/services/secrets/awsKms.d.ts +2 -2
  306. package/dist/services/secrets/awsKms.d.ts.map +1 -1
  307. package/dist/services/secrets/awsKms.js +3 -5
  308. package/dist/services/secrets/awsKms.js.map +1 -1
  309. package/dist/services/secrets/azureKeyVault.d.ts.map +1 -1
  310. package/dist/services/secrets/database.d.ts.map +1 -1
  311. package/dist/services/secrets/database.js.map +1 -1
  312. package/dist/services/secrets/environment.d.ts.map +1 -1
  313. package/dist/services/secrets/environment.js.map +1 -1
  314. package/dist/services/secrets/index.d.ts.map +1 -1
  315. package/dist/services/secrets/password.d.ts.map +1 -1
  316. package/dist/services/secrets/password.js +0 -4
  317. package/dist/services/secrets/password.js.map +1 -1
  318. package/dist/services/secrets/provider.d.ts +2 -3
  319. package/dist/services/secrets/provider.d.ts.map +1 -1
  320. package/dist/services/secrets/vault.d.ts.map +1 -1
  321. package/dist/services/setup/configWriter.d.ts.map +1 -1
  322. package/dist/services/setup/configWriter.js.map +1 -1
  323. package/dist/services/ssoEndpointPolicy.d.ts +8 -0
  324. package/dist/services/ssoEndpointPolicy.d.ts.map +1 -0
  325. package/dist/services/ssoEndpointPolicy.js +136 -0
  326. package/dist/services/ssoEndpointPolicy.js.map +1 -0
  327. package/dist/services/stepUp.d.ts +35 -0
  328. package/dist/services/stepUp.d.ts.map +1 -0
  329. package/dist/services/stepUp.js +65 -0
  330. package/dist/services/stepUp.js.map +1 -0
  331. package/dist/services/tokens.d.ts +37 -11
  332. package/dist/services/tokens.d.ts.map +1 -1
  333. package/dist/services/tokens.js +75 -14
  334. package/dist/services/tokens.js.map +1 -1
  335. package/dist/services/totp.d.ts +46 -0
  336. package/dist/services/totp.d.ts.map +1 -1
  337. package/dist/services/totp.js +178 -41
  338. package/dist/services/totp.js.map +1 -1
  339. package/dist/services/users.d.ts +20 -12
  340. package/dist/services/users.d.ts.map +1 -1
  341. package/dist/services/users.js +24 -51
  342. package/dist/services/users.js.map +1 -1
  343. package/dist/services/webauthn.d.ts +8 -4
  344. package/dist/services/webauthn.d.ts.map +1 -1
  345. package/dist/services/webauthn.js +4 -4
  346. package/dist/services/webauthn.js.map +1 -1
  347. package/dist/services/webhooks.d.ts +20 -20
  348. package/dist/services/workflows/engine.d.ts +4 -2
  349. package/dist/services/workflows/engine.d.ts.map +1 -1
  350. package/dist/services/workflows/engine.js +181 -12
  351. package/dist/services/workflows/engine.js.map +1 -1
  352. package/dist/services/workflows/steps.d.ts +2 -0
  353. package/dist/services/workflows/steps.d.ts.map +1 -1
  354. package/dist/services/workflows/steps.js +8 -75
  355. package/dist/services/workflows/steps.js.map +1 -1
  356. package/dist/setup-server.js.map +1 -1
  357. package/dist/types.d.ts +33 -4
  358. package/dist/types.d.ts.map +1 -1
  359. package/dist/types.js +26 -2
  360. package/dist/types.js.map +1 -1
  361. package/package.json +26 -3
  362. package/dist/tests/errors.test.d.ts +0 -2
  363. package/dist/tests/errors.test.d.ts.map +0 -1
  364. package/dist/tests/errors.test.js +0 -64
  365. package/dist/tests/errors.test.js.map +0 -1
  366. package/dist/tests/events.test.d.ts +0 -2
  367. package/dist/tests/events.test.d.ts.map +0 -1
  368. package/dist/tests/events.test.js +0 -45
  369. package/dist/tests/events.test.js.map +0 -1
  370. package/dist/tests/featureFlags.test.d.ts +0 -2
  371. package/dist/tests/featureFlags.test.d.ts.map +0 -1
  372. package/dist/tests/featureFlags.test.js +0 -24
  373. package/dist/tests/featureFlags.test.js.map +0 -1
  374. package/dist/tests/integration/queue.test.d.ts +0 -2
  375. package/dist/tests/integration/queue.test.d.ts.map +0 -1
  376. package/dist/tests/integration/queue.test.js +0 -49
  377. package/dist/tests/integration/queue.test.js.map +0 -1
  378. package/dist/tests/plugins.test.d.ts +0 -2
  379. package/dist/tests/plugins.test.d.ts.map +0 -1
  380. package/dist/tests/plugins.test.js +0 -56
  381. package/dist/tests/plugins.test.js.map +0 -1
  382. package/dist/tests/result.test.d.ts +0 -2
  383. package/dist/tests/result.test.d.ts.map +0 -1
  384. package/dist/tests/result.test.js +0 -46
  385. package/dist/tests/result.test.js.map +0 -1
  386. package/dist/tests/setup/configWriter.test.d.ts +0 -2
  387. package/dist/tests/setup/configWriter.test.d.ts.map +0 -1
  388. package/dist/tests/setup/configWriter.test.js +0 -55
  389. package/dist/tests/setup/configWriter.test.js.map +0 -1
  390. package/dist/tests/setup/validation.test.d.ts +0 -2
  391. package/dist/tests/setup/validation.test.d.ts.map +0 -1
  392. package/dist/tests/setup/validation.test.js +0 -26
  393. package/dist/tests/setup/validation.test.js.map +0 -1
  394. package/dist/tests/smoke.test.d.ts +0 -2
  395. package/dist/tests/smoke.test.d.ts.map +0 -1
  396. package/dist/tests/smoke.test.js +0 -124
  397. package/dist/tests/smoke.test.js.map +0 -1
  398. package/src/cli.ts +0 -172
  399. package/src/config.ts +0 -143
  400. package/src/container.ts +0 -48
  401. package/src/db/index.ts +0 -53
  402. package/src/db/migrations/0000_skinny_ben_parker.sql +0 -553
  403. package/src/db/migrations/0001_brief_joseph.sql +0 -10
  404. package/src/db/migrations/0002_add_account_lockout.sql +0 -3
  405. package/src/db/migrations/0003_steep_rachel_grey.sql +0 -1
  406. package/src/db/migrations/0004_clever_bill_hollister.sql +0 -20
  407. package/src/db/migrations/0005_steep_the_call.sql +0 -2
  408. package/src/db/migrations/0006_ambitious_boomer.sql +0 -17
  409. package/src/db/migrations/0007_greedy_vindicator.sql +0 -40
  410. package/src/db/migrations/meta/0000_snapshot.json +0 -2964
  411. package/src/db/migrations/meta/0001_snapshot.json +0 -3031
  412. package/src/db/migrations/meta/0003_snapshot.json +0 -3051
  413. package/src/db/migrations/meta/_journal.json +0 -62
  414. package/src/db/schema.ts +0 -676
  415. package/src/db/seed.ts +0 -146
  416. package/src/di.ts +0 -81
  417. package/src/index.ts +0 -326
  418. package/src/lib/errors.ts +0 -139
  419. package/src/lib/result.ts +0 -44
  420. package/src/lib/webhookSignature.ts +0 -41
  421. package/src/plugins/appContext.ts +0 -76
  422. package/src/plugins/audit.ts +0 -42
  423. package/src/plugins/auth.ts +0 -230
  424. package/src/plugins/metrics.ts +0 -41
  425. package/src/plugins/mtls.ts +0 -94
  426. package/src/plugins/permissions.ts +0 -29
  427. package/src/plugins/rateLimit.ts +0 -133
  428. package/src/plugins/requestLogger.ts +0 -25
  429. package/src/plugins/tracing.ts +0 -22
  430. package/src/repositories/apiKey.ts +0 -158
  431. package/src/repositories/application.ts +0 -70
  432. package/src/repositories/audit.ts +0 -32
  433. package/src/repositories/index.ts +0 -9
  434. package/src/repositories/oidcConnection.ts +0 -111
  435. package/src/repositories/organization.ts +0 -167
  436. package/src/repositories/permission.ts +0 -153
  437. package/src/repositories/samlConnection.ts +0 -96
  438. package/src/repositories/session.ts +0 -86
  439. package/src/repositories/types.ts +0 -134
  440. package/src/repositories/user.ts +0 -161
  441. package/src/routes/admin/billing.ts +0 -48
  442. package/src/routes/admin/helpers.ts +0 -50
  443. package/src/routes/admin/index.ts +0 -16
  444. package/src/routes/admin/organizations.ts +0 -299
  445. package/src/routes/admin/permissions.ts +0 -80
  446. package/src/routes/admin/platform.ts +0 -335
  447. package/src/routes/admin/sso.ts +0 -138
  448. package/src/routes/admin/webhooks.ts +0 -73
  449. package/src/routes/admin.ts +0 -1
  450. package/src/routes/apiKeys.ts +0 -60
  451. package/src/routes/auth.ts +0 -214
  452. package/src/routes/authz.ts +0 -38
  453. package/src/routes/config.ts +0 -67
  454. package/src/routes/emailVerification.ts +0 -73
  455. package/src/routes/federation.ts +0 -156
  456. package/src/routes/helpers.ts +0 -17
  457. package/src/routes/magicLinks.ts +0 -107
  458. package/src/routes/oauth.ts +0 -167
  459. package/src/routes/oauth2.ts +0 -284
  460. package/src/routes/oidcEnterprise.ts +0 -166
  461. package/src/routes/password.ts +0 -90
  462. package/src/routes/profile.ts +0 -44
  463. package/src/routes/saml.ts +0 -209
  464. package/src/routes/scim.ts +0 -199
  465. package/src/routes/sdk.ts +0 -141
  466. package/src/routes/serviceAccounts.ts +0 -124
  467. package/src/routes/sessions.ts +0 -62
  468. package/src/routes/setup.ts +0 -315
  469. package/src/routes/smsOtp.ts +0 -67
  470. package/src/routes/totp.ts +0 -122
  471. package/src/routes/webauthn.ts +0 -147
  472. package/src/routes/workflows.ts +0 -157
  473. package/src/sdk/index.ts +0 -152
  474. package/src/sdk/types.ts +0 -54
  475. package/src/services/anomalyDetection.ts +0 -73
  476. package/src/services/application/authentication.ts +0 -75
  477. package/src/services/application/identity.ts +0 -56
  478. package/src/services/application/index.ts +0 -3
  479. package/src/services/application/organization.ts +0 -77
  480. package/src/services/applications.ts +0 -89
  481. package/src/services/audit.ts +0 -41
  482. package/src/services/auditExport.ts +0 -59
  483. package/src/services/billing.ts +0 -87
  484. package/src/services/cache.ts +0 -131
  485. package/src/services/configuration/profiles.ts +0 -115
  486. package/src/services/configuration.ts +0 -120
  487. package/src/services/connectors/google.ts +0 -92
  488. package/src/services/connectors/oidc.ts +0 -111
  489. package/src/services/connectors/registry.ts +0 -124
  490. package/src/services/connectors/types.ts +0 -38
  491. package/src/services/connectors/zitadel.ts +0 -77
  492. package/src/services/devices.ts +0 -76
  493. package/src/services/domain/authentication.ts +0 -279
  494. package/src/services/domain/authorization.ts +0 -49
  495. package/src/services/domain/identity.ts +0 -108
  496. package/src/services/domain/index.ts +0 -4
  497. package/src/services/domain/organization.ts +0 -114
  498. package/src/services/email.ts +0 -167
  499. package/src/services/emailVerification.ts +0 -75
  500. package/src/services/enterpriseSso.ts +0 -58
  501. package/src/services/events/bus.ts +0 -43
  502. package/src/services/events/subscribers/anomaly.ts +0 -13
  503. package/src/services/events/subscribers/auditLog.ts +0 -21
  504. package/src/services/events/subscribers/webhook.ts +0 -39
  505. package/src/services/events/subscribers/webhookDispatch.ts +0 -14
  506. package/src/services/events/types.ts +0 -106
  507. package/src/services/events/validate.ts +0 -118
  508. package/src/services/featureFlags.ts +0 -90
  509. package/src/services/features.ts +0 -22
  510. package/src/services/federation.ts +0 -30
  511. package/src/services/hibp.ts +0 -28
  512. package/src/services/ipControls.ts +0 -99
  513. package/src/services/magicLinks.ts +0 -51
  514. package/src/services/oauth2.ts +0 -216
  515. package/src/services/organizations.ts +0 -171
  516. package/src/services/permissions.ts +0 -146
  517. package/src/services/plugins/registry.ts +0 -242
  518. package/src/services/plugins/types.ts +0 -98
  519. package/src/services/queue/bullmq.ts +0 -104
  520. package/src/services/queue/inProcess.ts +0 -75
  521. package/src/services/queue/index.ts +0 -19
  522. package/src/services/queue/types.ts +0 -26
  523. package/src/services/redis.ts +0 -16
  524. package/src/services/secrets/awsKms.ts +0 -97
  525. package/src/services/secrets/azureKeyVault.ts +0 -171
  526. package/src/services/secrets/database.ts +0 -166
  527. package/src/services/secrets/environment.ts +0 -117
  528. package/src/services/secrets/index.ts +0 -50
  529. package/src/services/secrets/password.ts +0 -73
  530. package/src/services/secrets/provider.ts +0 -36
  531. package/src/services/secrets/vault.ts +0 -149
  532. package/src/services/secrets.ts +0 -2
  533. package/src/services/serviceAccounts.ts +0 -74
  534. package/src/services/setup/configWriter.ts +0 -200
  535. package/src/services/setup/diagnostics.ts +0 -76
  536. package/src/services/setup/token.ts +0 -42
  537. package/src/services/setup/types.ts +0 -40
  538. package/src/services/setup/validation.ts +0 -205
  539. package/src/services/sms.ts +0 -81
  540. package/src/services/smsOtp.ts +0 -74
  541. package/src/services/tokens.ts +0 -287
  542. package/src/services/totp.ts +0 -113
  543. package/src/services/users.ts +0 -239
  544. package/src/services/webauthn.ts +0 -193
  545. package/src/services/webhooks.ts +0 -190
  546. package/src/services/workflows/engine.ts +0 -125
  547. package/src/services/workflows/steps.ts +0 -129
  548. package/src/services/zitadel.ts +0 -277
  549. package/src/setup-server.ts +0 -71
  550. package/src/tests/errors.test.ts +0 -74
  551. package/src/tests/events.test.ts +0 -52
  552. package/src/tests/featureFlags.test.ts +0 -26
  553. package/src/tests/integration/queue.test.ts +0 -54
  554. package/src/tests/plugins.test.ts +0 -73
  555. package/src/tests/result.test.ts +0 -52
  556. package/src/tests/setup/configWriter.test.ts +0 -69
  557. package/src/tests/setup/validation.test.ts +0 -29
  558. package/src/tests/smoke.test.ts +0 -136
  559. package/src/types.ts +0 -70
@@ -0,0 +1,3919 @@
1
+ {
2
+ "id": "7c6eb295-2d68-4bd9-b3f7-ebae1f4229b6",
3
+ "prevId": "c7f8384e-434b-4829-92c5-b72f0daeab31",
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
+ "policies": {},
197
+ "checkConstraints": {},
198
+ "isRLSEnabled": false
199
+ },
200
+ "public.applications": {
201
+ "name": "applications",
202
+ "schema": "",
203
+ "columns": {
204
+ "id": {
205
+ "name": "id",
206
+ "type": "uuid",
207
+ "primaryKey": true,
208
+ "notNull": true,
209
+ "default": "gen_random_uuid()"
210
+ },
211
+ "org_id": {
212
+ "name": "org_id",
213
+ "type": "uuid",
214
+ "primaryKey": false,
215
+ "notNull": true
216
+ },
217
+ "client_id": {
218
+ "name": "client_id",
219
+ "type": "text",
220
+ "primaryKey": false,
221
+ "notNull": true
222
+ },
223
+ "client_secret_hash": {
224
+ "name": "client_secret_hash",
225
+ "type": "text",
226
+ "primaryKey": false,
227
+ "notNull": true
228
+ },
229
+ "name": {
230
+ "name": "name",
231
+ "type": "text",
232
+ "primaryKey": false,
233
+ "notNull": true
234
+ },
235
+ "redirect_uris": {
236
+ "name": "redirect_uris",
237
+ "type": "text[]",
238
+ "primaryKey": false,
239
+ "notNull": true,
240
+ "default": "'{}'::text[]"
241
+ },
242
+ "allowed_origins": {
243
+ "name": "allowed_origins",
244
+ "type": "text[]",
245
+ "primaryKey": false,
246
+ "notNull": true,
247
+ "default": "'{}'::text[]"
248
+ },
249
+ "allowed_ips": {
250
+ "name": "allowed_ips",
251
+ "type": "text[]",
252
+ "primaryKey": false,
253
+ "notNull": true,
254
+ "default": "'{}'::text[]"
255
+ },
256
+ "blocked_ips": {
257
+ "name": "blocked_ips",
258
+ "type": "text[]",
259
+ "primaryKey": false,
260
+ "notNull": true,
261
+ "default": "'{}'::text[]"
262
+ },
263
+ "branding": {
264
+ "name": "branding",
265
+ "type": "jsonb",
266
+ "primaryKey": false,
267
+ "notNull": true,
268
+ "default": "'{}'::jsonb"
269
+ },
270
+ "is_active": {
271
+ "name": "is_active",
272
+ "type": "boolean",
273
+ "primaryKey": false,
274
+ "notNull": true,
275
+ "default": true
276
+ },
277
+ "created_at": {
278
+ "name": "created_at",
279
+ "type": "timestamp with time zone",
280
+ "primaryKey": false,
281
+ "notNull": true,
282
+ "default": "now()"
283
+ },
284
+ "updated_at": {
285
+ "name": "updated_at",
286
+ "type": "timestamp with time zone",
287
+ "primaryKey": false,
288
+ "notNull": true,
289
+ "default": "now()"
290
+ }
291
+ },
292
+ "indexes": {
293
+ "applications_org_idx": {
294
+ "name": "applications_org_idx",
295
+ "columns": [
296
+ {
297
+ "expression": "org_id",
298
+ "isExpression": false,
299
+ "asc": true,
300
+ "nulls": "last"
301
+ }
302
+ ],
303
+ "isUnique": false,
304
+ "concurrently": false,
305
+ "method": "btree",
306
+ "with": {}
307
+ },
308
+ "applications_client_id_idx": {
309
+ "name": "applications_client_id_idx",
310
+ "columns": [
311
+ {
312
+ "expression": "client_id",
313
+ "isExpression": false,
314
+ "asc": true,
315
+ "nulls": "last"
316
+ }
317
+ ],
318
+ "isUnique": false,
319
+ "concurrently": false,
320
+ "method": "btree",
321
+ "with": {}
322
+ }
323
+ },
324
+ "foreignKeys": {
325
+ "applications_org_id_organizations_id_fk": {
326
+ "name": "applications_org_id_organizations_id_fk",
327
+ "tableFrom": "applications",
328
+ "tableTo": "organizations",
329
+ "columnsFrom": [
330
+ "org_id"
331
+ ],
332
+ "columnsTo": [
333
+ "id"
334
+ ],
335
+ "onDelete": "cascade",
336
+ "onUpdate": "no action"
337
+ }
338
+ },
339
+ "compositePrimaryKeys": {},
340
+ "uniqueConstraints": {
341
+ "applications_client_id_unique": {
342
+ "name": "applications_client_id_unique",
343
+ "nullsNotDistinct": false,
344
+ "columns": [
345
+ "client_id"
346
+ ]
347
+ }
348
+ },
349
+ "policies": {},
350
+ "checkConstraints": {},
351
+ "isRLSEnabled": false
352
+ },
353
+ "public.audit_log": {
354
+ "name": "audit_log",
355
+ "schema": "",
356
+ "columns": {
357
+ "id": {
358
+ "name": "id",
359
+ "type": "uuid",
360
+ "primaryKey": true,
361
+ "notNull": true,
362
+ "default": "gen_random_uuid()"
363
+ },
364
+ "user_id": {
365
+ "name": "user_id",
366
+ "type": "uuid",
367
+ "primaryKey": false,
368
+ "notNull": false
369
+ },
370
+ "org_id": {
371
+ "name": "org_id",
372
+ "type": "uuid",
373
+ "primaryKey": false,
374
+ "notNull": false
375
+ },
376
+ "app_id": {
377
+ "name": "app_id",
378
+ "type": "uuid",
379
+ "primaryKey": false,
380
+ "notNull": false
381
+ },
382
+ "request_id": {
383
+ "name": "request_id",
384
+ "type": "text",
385
+ "primaryKey": false,
386
+ "notNull": false
387
+ },
388
+ "event": {
389
+ "name": "event",
390
+ "type": "varchar(64)",
391
+ "primaryKey": false,
392
+ "notNull": true
393
+ },
394
+ "ip_address": {
395
+ "name": "ip_address",
396
+ "type": "text",
397
+ "primaryKey": false,
398
+ "notNull": false
399
+ },
400
+ "user_agent": {
401
+ "name": "user_agent",
402
+ "type": "text",
403
+ "primaryKey": false,
404
+ "notNull": false
405
+ },
406
+ "metadata": {
407
+ "name": "metadata",
408
+ "type": "jsonb",
409
+ "primaryKey": false,
410
+ "notNull": false
411
+ },
412
+ "created_at": {
413
+ "name": "created_at",
414
+ "type": "timestamp with time zone",
415
+ "primaryKey": false,
416
+ "notNull": true,
417
+ "default": "now()"
418
+ }
419
+ },
420
+ "indexes": {
421
+ "audit_log_user_idx": {
422
+ "name": "audit_log_user_idx",
423
+ "columns": [
424
+ {
425
+ "expression": "user_id",
426
+ "isExpression": false,
427
+ "asc": true,
428
+ "nulls": "last"
429
+ }
430
+ ],
431
+ "isUnique": false,
432
+ "concurrently": false,
433
+ "method": "btree",
434
+ "with": {}
435
+ },
436
+ "audit_log_event_idx": {
437
+ "name": "audit_log_event_idx",
438
+ "columns": [
439
+ {
440
+ "expression": "event",
441
+ "isExpression": false,
442
+ "asc": true,
443
+ "nulls": "last"
444
+ }
445
+ ],
446
+ "isUnique": false,
447
+ "concurrently": false,
448
+ "method": "btree",
449
+ "with": {}
450
+ },
451
+ "audit_log_created_at_idx": {
452
+ "name": "audit_log_created_at_idx",
453
+ "columns": [
454
+ {
455
+ "expression": "created_at",
456
+ "isExpression": false,
457
+ "asc": true,
458
+ "nulls": "last"
459
+ }
460
+ ],
461
+ "isUnique": false,
462
+ "concurrently": false,
463
+ "method": "btree",
464
+ "with": {}
465
+ },
466
+ "audit_log_org_idx": {
467
+ "name": "audit_log_org_idx",
468
+ "columns": [
469
+ {
470
+ "expression": "org_id",
471
+ "isExpression": false,
472
+ "asc": true,
473
+ "nulls": "last"
474
+ }
475
+ ],
476
+ "isUnique": false,
477
+ "concurrently": false,
478
+ "method": "btree",
479
+ "with": {}
480
+ },
481
+ "audit_log_app_idx": {
482
+ "name": "audit_log_app_idx",
483
+ "columns": [
484
+ {
485
+ "expression": "app_id",
486
+ "isExpression": false,
487
+ "asc": true,
488
+ "nulls": "last"
489
+ }
490
+ ],
491
+ "isUnique": false,
492
+ "concurrently": false,
493
+ "method": "btree",
494
+ "with": {}
495
+ }
496
+ },
497
+ "foreignKeys": {
498
+ "audit_log_user_id_users_id_fk": {
499
+ "name": "audit_log_user_id_users_id_fk",
500
+ "tableFrom": "audit_log",
501
+ "tableTo": "users",
502
+ "columnsFrom": [
503
+ "user_id"
504
+ ],
505
+ "columnsTo": [
506
+ "id"
507
+ ],
508
+ "onDelete": "set null",
509
+ "onUpdate": "no action"
510
+ },
511
+ "audit_log_org_id_organizations_id_fk": {
512
+ "name": "audit_log_org_id_organizations_id_fk",
513
+ "tableFrom": "audit_log",
514
+ "tableTo": "organizations",
515
+ "columnsFrom": [
516
+ "org_id"
517
+ ],
518
+ "columnsTo": [
519
+ "id"
520
+ ],
521
+ "onDelete": "set null",
522
+ "onUpdate": "no action"
523
+ },
524
+ "audit_log_app_id_applications_id_fk": {
525
+ "name": "audit_log_app_id_applications_id_fk",
526
+ "tableFrom": "audit_log",
527
+ "tableTo": "applications",
528
+ "columnsFrom": [
529
+ "app_id"
530
+ ],
531
+ "columnsTo": [
532
+ "id"
533
+ ],
534
+ "onDelete": "set null",
535
+ "onUpdate": "no action"
536
+ }
537
+ },
538
+ "compositePrimaryKeys": {},
539
+ "uniqueConstraints": {},
540
+ "policies": {},
541
+ "checkConstraints": {},
542
+ "isRLSEnabled": false
543
+ },
544
+ "public.email_verification_tokens": {
545
+ "name": "email_verification_tokens",
546
+ "schema": "",
547
+ "columns": {
548
+ "id": {
549
+ "name": "id",
550
+ "type": "uuid",
551
+ "primaryKey": true,
552
+ "notNull": true,
553
+ "default": "gen_random_uuid()"
554
+ },
555
+ "user_id": {
556
+ "name": "user_id",
557
+ "type": "uuid",
558
+ "primaryKey": false,
559
+ "notNull": true
560
+ },
561
+ "token_hash": {
562
+ "name": "token_hash",
563
+ "type": "text",
564
+ "primaryKey": false,
565
+ "notNull": true
566
+ },
567
+ "used_at": {
568
+ "name": "used_at",
569
+ "type": "timestamp with time zone",
570
+ "primaryKey": false,
571
+ "notNull": false
572
+ },
573
+ "expires_at": {
574
+ "name": "expires_at",
575
+ "type": "timestamp with time zone",
576
+ "primaryKey": false,
577
+ "notNull": true
578
+ },
579
+ "created_at": {
580
+ "name": "created_at",
581
+ "type": "timestamp with time zone",
582
+ "primaryKey": false,
583
+ "notNull": true,
584
+ "default": "now()"
585
+ }
586
+ },
587
+ "indexes": {
588
+ "email_verification_user_idx": {
589
+ "name": "email_verification_user_idx",
590
+ "columns": [
591
+ {
592
+ "expression": "user_id",
593
+ "isExpression": false,
594
+ "asc": true,
595
+ "nulls": "last"
596
+ }
597
+ ],
598
+ "isUnique": false,
599
+ "concurrently": false,
600
+ "method": "btree",
601
+ "with": {}
602
+ },
603
+ "email_verification_hash_idx": {
604
+ "name": "email_verification_hash_idx",
605
+ "columns": [
606
+ {
607
+ "expression": "token_hash",
608
+ "isExpression": false,
609
+ "asc": true,
610
+ "nulls": "last"
611
+ }
612
+ ],
613
+ "isUnique": false,
614
+ "concurrently": false,
615
+ "method": "btree",
616
+ "with": {}
617
+ }
618
+ },
619
+ "foreignKeys": {
620
+ "email_verification_tokens_user_id_users_id_fk": {
621
+ "name": "email_verification_tokens_user_id_users_id_fk",
622
+ "tableFrom": "email_verification_tokens",
623
+ "tableTo": "users",
624
+ "columnsFrom": [
625
+ "user_id"
626
+ ],
627
+ "columnsTo": [
628
+ "id"
629
+ ],
630
+ "onDelete": "cascade",
631
+ "onUpdate": "no action"
632
+ }
633
+ },
634
+ "compositePrimaryKeys": {},
635
+ "uniqueConstraints": {},
636
+ "policies": {},
637
+ "checkConstraints": {},
638
+ "isRLSEnabled": false
639
+ },
640
+ "public.feature_flags": {
641
+ "name": "feature_flags",
642
+ "schema": "",
643
+ "columns": {
644
+ "id": {
645
+ "name": "id",
646
+ "type": "uuid",
647
+ "primaryKey": true,
648
+ "notNull": true,
649
+ "default": "gen_random_uuid()"
650
+ },
651
+ "key": {
652
+ "name": "key",
653
+ "type": "text",
654
+ "primaryKey": false,
655
+ "notNull": true
656
+ },
657
+ "enabled": {
658
+ "name": "enabled",
659
+ "type": "boolean",
660
+ "primaryKey": false,
661
+ "notNull": true,
662
+ "default": false
663
+ },
664
+ "description": {
665
+ "name": "description",
666
+ "type": "text",
667
+ "primaryKey": false,
668
+ "notNull": false
669
+ },
670
+ "updated_at": {
671
+ "name": "updated_at",
672
+ "type": "timestamp with time zone",
673
+ "primaryKey": false,
674
+ "notNull": true,
675
+ "default": "now()"
676
+ }
677
+ },
678
+ "indexes": {
679
+ "feature_flags_key_idx": {
680
+ "name": "feature_flags_key_idx",
681
+ "columns": [
682
+ {
683
+ "expression": "key",
684
+ "isExpression": false,
685
+ "asc": true,
686
+ "nulls": "last"
687
+ }
688
+ ],
689
+ "isUnique": false,
690
+ "concurrently": false,
691
+ "method": "btree",
692
+ "with": {}
693
+ }
694
+ },
695
+ "foreignKeys": {},
696
+ "compositePrimaryKeys": {},
697
+ "uniqueConstraints": {
698
+ "feature_flags_key_unique": {
699
+ "name": "feature_flags_key_unique",
700
+ "nullsNotDistinct": false,
701
+ "columns": [
702
+ "key"
703
+ ]
704
+ }
705
+ },
706
+ "policies": {},
707
+ "checkConstraints": {},
708
+ "isRLSEnabled": false
709
+ },
710
+ "public.identity_providers": {
711
+ "name": "identity_providers",
712
+ "schema": "",
713
+ "columns": {
714
+ "id": {
715
+ "name": "id",
716
+ "type": "uuid",
717
+ "primaryKey": true,
718
+ "notNull": true,
719
+ "default": "gen_random_uuid()"
720
+ },
721
+ "org_id": {
722
+ "name": "org_id",
723
+ "type": "uuid",
724
+ "primaryKey": false,
725
+ "notNull": true
726
+ },
727
+ "provider_type": {
728
+ "name": "provider_type",
729
+ "type": "text",
730
+ "primaryKey": false,
731
+ "notNull": true
732
+ },
733
+ "name": {
734
+ "name": "name",
735
+ "type": "text",
736
+ "primaryKey": false,
737
+ "notNull": true
738
+ },
739
+ "issuer": {
740
+ "name": "issuer",
741
+ "type": "text",
742
+ "primaryKey": false,
743
+ "notNull": false
744
+ },
745
+ "authorization_endpoint": {
746
+ "name": "authorization_endpoint",
747
+ "type": "text",
748
+ "primaryKey": false,
749
+ "notNull": false
750
+ },
751
+ "token_endpoint": {
752
+ "name": "token_endpoint",
753
+ "type": "text",
754
+ "primaryKey": false,
755
+ "notNull": false
756
+ },
757
+ "userinfo_endpoint": {
758
+ "name": "userinfo_endpoint",
759
+ "type": "text",
760
+ "primaryKey": false,
761
+ "notNull": false
762
+ },
763
+ "jwks_uri": {
764
+ "name": "jwks_uri",
765
+ "type": "text",
766
+ "primaryKey": false,
767
+ "notNull": false
768
+ },
769
+ "client_id": {
770
+ "name": "client_id",
771
+ "type": "text",
772
+ "primaryKey": false,
773
+ "notNull": false
774
+ },
775
+ "client_secret_encrypted": {
776
+ "name": "client_secret_encrypted",
777
+ "type": "text",
778
+ "primaryKey": false,
779
+ "notNull": false
780
+ },
781
+ "scopes": {
782
+ "name": "scopes",
783
+ "type": "text[]",
784
+ "primaryKey": false,
785
+ "notNull": true,
786
+ "default": "'{\"openid\",\"profile\",\"email\"}'::text[]"
787
+ },
788
+ "attribute_mapping": {
789
+ "name": "attribute_mapping",
790
+ "type": "jsonb",
791
+ "primaryKey": false,
792
+ "notNull": true,
793
+ "default": "'{}'::jsonb"
794
+ },
795
+ "is_active": {
796
+ "name": "is_active",
797
+ "type": "boolean",
798
+ "primaryKey": false,
799
+ "notNull": true,
800
+ "default": true
801
+ },
802
+ "is_federation": {
803
+ "name": "is_federation",
804
+ "type": "boolean",
805
+ "primaryKey": false,
806
+ "notNull": true,
807
+ "default": true
808
+ },
809
+ "created_at": {
810
+ "name": "created_at",
811
+ "type": "timestamp with time zone",
812
+ "primaryKey": false,
813
+ "notNull": true,
814
+ "default": "now()"
815
+ },
816
+ "updated_at": {
817
+ "name": "updated_at",
818
+ "type": "timestamp with time zone",
819
+ "primaryKey": false,
820
+ "notNull": true,
821
+ "default": "now()"
822
+ }
823
+ },
824
+ "indexes": {
825
+ "identity_providers_org_idx": {
826
+ "name": "identity_providers_org_idx",
827
+ "columns": [
828
+ {
829
+ "expression": "org_id",
830
+ "isExpression": false,
831
+ "asc": true,
832
+ "nulls": "last"
833
+ }
834
+ ],
835
+ "isUnique": false,
836
+ "concurrently": false,
837
+ "method": "btree",
838
+ "with": {}
839
+ },
840
+ "identity_providers_type_idx": {
841
+ "name": "identity_providers_type_idx",
842
+ "columns": [
843
+ {
844
+ "expression": "provider_type",
845
+ "isExpression": false,
846
+ "asc": true,
847
+ "nulls": "last"
848
+ }
849
+ ],
850
+ "isUnique": false,
851
+ "concurrently": false,
852
+ "method": "btree",
853
+ "with": {}
854
+ }
855
+ },
856
+ "foreignKeys": {
857
+ "identity_providers_org_id_organizations_id_fk": {
858
+ "name": "identity_providers_org_id_organizations_id_fk",
859
+ "tableFrom": "identity_providers",
860
+ "tableTo": "organizations",
861
+ "columnsFrom": [
862
+ "org_id"
863
+ ],
864
+ "columnsTo": [
865
+ "id"
866
+ ],
867
+ "onDelete": "cascade",
868
+ "onUpdate": "no action"
869
+ }
870
+ },
871
+ "compositePrimaryKeys": {},
872
+ "uniqueConstraints": {},
873
+ "policies": {},
874
+ "checkConstraints": {},
875
+ "isRLSEnabled": false
876
+ },
877
+ "public.magic_links": {
878
+ "name": "magic_links",
879
+ "schema": "",
880
+ "columns": {
881
+ "id": {
882
+ "name": "id",
883
+ "type": "uuid",
884
+ "primaryKey": true,
885
+ "notNull": true,
886
+ "default": "gen_random_uuid()"
887
+ },
888
+ "user_id": {
889
+ "name": "user_id",
890
+ "type": "uuid",
891
+ "primaryKey": false,
892
+ "notNull": true
893
+ },
894
+ "token_hash": {
895
+ "name": "token_hash",
896
+ "type": "text",
897
+ "primaryKey": false,
898
+ "notNull": true
899
+ },
900
+ "used_at": {
901
+ "name": "used_at",
902
+ "type": "timestamp with time zone",
903
+ "primaryKey": false,
904
+ "notNull": false
905
+ },
906
+ "expires_at": {
907
+ "name": "expires_at",
908
+ "type": "timestamp with time zone",
909
+ "primaryKey": false,
910
+ "notNull": true
911
+ },
912
+ "created_at": {
913
+ "name": "created_at",
914
+ "type": "timestamp with time zone",
915
+ "primaryKey": false,
916
+ "notNull": true,
917
+ "default": "now()"
918
+ }
919
+ },
920
+ "indexes": {
921
+ "magic_links_user_idx": {
922
+ "name": "magic_links_user_idx",
923
+ "columns": [
924
+ {
925
+ "expression": "user_id",
926
+ "isExpression": false,
927
+ "asc": true,
928
+ "nulls": "last"
929
+ }
930
+ ],
931
+ "isUnique": false,
932
+ "concurrently": false,
933
+ "method": "btree",
934
+ "with": {}
935
+ },
936
+ "magic_links_hash_idx": {
937
+ "name": "magic_links_hash_idx",
938
+ "columns": [
939
+ {
940
+ "expression": "token_hash",
941
+ "isExpression": false,
942
+ "asc": true,
943
+ "nulls": "last"
944
+ }
945
+ ],
946
+ "isUnique": false,
947
+ "concurrently": false,
948
+ "method": "btree",
949
+ "with": {}
950
+ }
951
+ },
952
+ "foreignKeys": {
953
+ "magic_links_user_id_users_id_fk": {
954
+ "name": "magic_links_user_id_users_id_fk",
955
+ "tableFrom": "magic_links",
956
+ "tableTo": "users",
957
+ "columnsFrom": [
958
+ "user_id"
959
+ ],
960
+ "columnsTo": [
961
+ "id"
962
+ ],
963
+ "onDelete": "cascade",
964
+ "onUpdate": "no action"
965
+ }
966
+ },
967
+ "compositePrimaryKeys": {},
968
+ "uniqueConstraints": {},
969
+ "policies": {},
970
+ "checkConstraints": {},
971
+ "isRLSEnabled": false
972
+ },
973
+ "public.mfa_challenges": {
974
+ "name": "mfa_challenges",
975
+ "schema": "",
976
+ "columns": {
977
+ "id": {
978
+ "name": "id",
979
+ "type": "uuid",
980
+ "primaryKey": true,
981
+ "notNull": true,
982
+ "default": "gen_random_uuid()"
983
+ },
984
+ "challenge_hash": {
985
+ "name": "challenge_hash",
986
+ "type": "text",
987
+ "primaryKey": false,
988
+ "notNull": true
989
+ },
990
+ "user_id": {
991
+ "name": "user_id",
992
+ "type": "uuid",
993
+ "primaryKey": false,
994
+ "notNull": true
995
+ },
996
+ "flow": {
997
+ "name": "flow",
998
+ "type": "text",
999
+ "primaryKey": false,
1000
+ "notNull": true
1001
+ },
1002
+ "client_id": {
1003
+ "name": "client_id",
1004
+ "type": "text",
1005
+ "primaryKey": false,
1006
+ "notNull": false
1007
+ },
1008
+ "status": {
1009
+ "name": "status",
1010
+ "type": "text",
1011
+ "primaryKey": false,
1012
+ "notNull": true,
1013
+ "default": "'requires_mfa'"
1014
+ },
1015
+ "attempts": {
1016
+ "name": "attempts",
1017
+ "type": "integer",
1018
+ "primaryKey": false,
1019
+ "notNull": true,
1020
+ "default": 0
1021
+ },
1022
+ "max_attempts": {
1023
+ "name": "max_attempts",
1024
+ "type": "integer",
1025
+ "primaryKey": false,
1026
+ "notNull": true,
1027
+ "default": 5
1028
+ },
1029
+ "ip_address": {
1030
+ "name": "ip_address",
1031
+ "type": "text",
1032
+ "primaryKey": false,
1033
+ "notNull": false
1034
+ },
1035
+ "user_agent": {
1036
+ "name": "user_agent",
1037
+ "type": "text",
1038
+ "primaryKey": false,
1039
+ "notNull": false
1040
+ },
1041
+ "expires_at": {
1042
+ "name": "expires_at",
1043
+ "type": "timestamp with time zone",
1044
+ "primaryKey": false,
1045
+ "notNull": true
1046
+ },
1047
+ "consumed_at": {
1048
+ "name": "consumed_at",
1049
+ "type": "timestamp with time zone",
1050
+ "primaryKey": false,
1051
+ "notNull": false
1052
+ },
1053
+ "created_at": {
1054
+ "name": "created_at",
1055
+ "type": "timestamp with time zone",
1056
+ "primaryKey": false,
1057
+ "notNull": true,
1058
+ "default": "now()"
1059
+ }
1060
+ },
1061
+ "indexes": {
1062
+ "mfa_challenges_user_idx": {
1063
+ "name": "mfa_challenges_user_idx",
1064
+ "columns": [
1065
+ {
1066
+ "expression": "user_id",
1067
+ "isExpression": false,
1068
+ "asc": true,
1069
+ "nulls": "last"
1070
+ }
1071
+ ],
1072
+ "isUnique": false,
1073
+ "concurrently": false,
1074
+ "method": "btree",
1075
+ "with": {}
1076
+ },
1077
+ "mfa_challenges_status_idx": {
1078
+ "name": "mfa_challenges_status_idx",
1079
+ "columns": [
1080
+ {
1081
+ "expression": "status",
1082
+ "isExpression": false,
1083
+ "asc": true,
1084
+ "nulls": "last"
1085
+ }
1086
+ ],
1087
+ "isUnique": false,
1088
+ "concurrently": false,
1089
+ "method": "btree",
1090
+ "with": {}
1091
+ }
1092
+ },
1093
+ "foreignKeys": {
1094
+ "mfa_challenges_user_id_users_id_fk": {
1095
+ "name": "mfa_challenges_user_id_users_id_fk",
1096
+ "tableFrom": "mfa_challenges",
1097
+ "tableTo": "users",
1098
+ "columnsFrom": [
1099
+ "user_id"
1100
+ ],
1101
+ "columnsTo": [
1102
+ "id"
1103
+ ],
1104
+ "onDelete": "cascade",
1105
+ "onUpdate": "no action"
1106
+ }
1107
+ },
1108
+ "compositePrimaryKeys": {},
1109
+ "uniqueConstraints": {
1110
+ "mfa_challenges_challenge_hash_unique": {
1111
+ "name": "mfa_challenges_challenge_hash_unique",
1112
+ "nullsNotDistinct": false,
1113
+ "columns": [
1114
+ "challenge_hash"
1115
+ ]
1116
+ }
1117
+ },
1118
+ "policies": {},
1119
+ "checkConstraints": {
1120
+ "mfa_challenges_flow_check": {
1121
+ "name": "mfa_challenges_flow_check",
1122
+ "value": "flow in ('login', 'token_login')"
1123
+ },
1124
+ "mfa_challenges_status_check": {
1125
+ "name": "mfa_challenges_status_check",
1126
+ "value": "status in ('requires_mfa', 'consumed', 'failed', 'expired')"
1127
+ }
1128
+ },
1129
+ "isRLSEnabled": false
1130
+ },
1131
+ "public.oauth2_authorization_codes": {
1132
+ "name": "oauth2_authorization_codes",
1133
+ "schema": "",
1134
+ "columns": {
1135
+ "id": {
1136
+ "name": "id",
1137
+ "type": "uuid",
1138
+ "primaryKey": true,
1139
+ "notNull": true,
1140
+ "default": "gen_random_uuid()"
1141
+ },
1142
+ "app_id": {
1143
+ "name": "app_id",
1144
+ "type": "uuid",
1145
+ "primaryKey": false,
1146
+ "notNull": true
1147
+ },
1148
+ "user_id": {
1149
+ "name": "user_id",
1150
+ "type": "uuid",
1151
+ "primaryKey": false,
1152
+ "notNull": true
1153
+ },
1154
+ "code_hash": {
1155
+ "name": "code_hash",
1156
+ "type": "text",
1157
+ "primaryKey": false,
1158
+ "notNull": true
1159
+ },
1160
+ "challenge": {
1161
+ "name": "challenge",
1162
+ "type": "text",
1163
+ "primaryKey": false,
1164
+ "notNull": false
1165
+ },
1166
+ "challenge_method": {
1167
+ "name": "challenge_method",
1168
+ "type": "text",
1169
+ "primaryKey": false,
1170
+ "notNull": false
1171
+ },
1172
+ "redirect_uri": {
1173
+ "name": "redirect_uri",
1174
+ "type": "text",
1175
+ "primaryKey": false,
1176
+ "notNull": false
1177
+ },
1178
+ "scopes": {
1179
+ "name": "scopes",
1180
+ "type": "text[]",
1181
+ "primaryKey": false,
1182
+ "notNull": true,
1183
+ "default": "'{}'::text[]"
1184
+ },
1185
+ "nonce": {
1186
+ "name": "nonce",
1187
+ "type": "text",
1188
+ "primaryKey": false,
1189
+ "notNull": false
1190
+ },
1191
+ "mfa_factor": {
1192
+ "name": "mfa_factor",
1193
+ "type": "text",
1194
+ "primaryKey": false,
1195
+ "notNull": false
1196
+ },
1197
+ "expires_at": {
1198
+ "name": "expires_at",
1199
+ "type": "timestamp with time zone",
1200
+ "primaryKey": false,
1201
+ "notNull": true
1202
+ },
1203
+ "used_at": {
1204
+ "name": "used_at",
1205
+ "type": "timestamp with time zone",
1206
+ "primaryKey": false,
1207
+ "notNull": false
1208
+ },
1209
+ "created_at": {
1210
+ "name": "created_at",
1211
+ "type": "timestamp with time zone",
1212
+ "primaryKey": false,
1213
+ "notNull": true,
1214
+ "default": "now()"
1215
+ }
1216
+ },
1217
+ "indexes": {
1218
+ "oauth2_authorization_codes_app_idx": {
1219
+ "name": "oauth2_authorization_codes_app_idx",
1220
+ "columns": [
1221
+ {
1222
+ "expression": "app_id",
1223
+ "isExpression": false,
1224
+ "asc": true,
1225
+ "nulls": "last"
1226
+ }
1227
+ ],
1228
+ "isUnique": false,
1229
+ "concurrently": false,
1230
+ "method": "btree",
1231
+ "with": {}
1232
+ },
1233
+ "oauth2_authorization_codes_user_idx": {
1234
+ "name": "oauth2_authorization_codes_user_idx",
1235
+ "columns": [
1236
+ {
1237
+ "expression": "user_id",
1238
+ "isExpression": false,
1239
+ "asc": true,
1240
+ "nulls": "last"
1241
+ }
1242
+ ],
1243
+ "isUnique": false,
1244
+ "concurrently": false,
1245
+ "method": "btree",
1246
+ "with": {}
1247
+ },
1248
+ "oauth2_authorization_codes_hash_idx": {
1249
+ "name": "oauth2_authorization_codes_hash_idx",
1250
+ "columns": [
1251
+ {
1252
+ "expression": "code_hash",
1253
+ "isExpression": false,
1254
+ "asc": true,
1255
+ "nulls": "last"
1256
+ }
1257
+ ],
1258
+ "isUnique": false,
1259
+ "concurrently": false,
1260
+ "method": "btree",
1261
+ "with": {}
1262
+ }
1263
+ },
1264
+ "foreignKeys": {
1265
+ "oauth2_authorization_codes_app_id_applications_id_fk": {
1266
+ "name": "oauth2_authorization_codes_app_id_applications_id_fk",
1267
+ "tableFrom": "oauth2_authorization_codes",
1268
+ "tableTo": "applications",
1269
+ "columnsFrom": [
1270
+ "app_id"
1271
+ ],
1272
+ "columnsTo": [
1273
+ "id"
1274
+ ],
1275
+ "onDelete": "cascade",
1276
+ "onUpdate": "no action"
1277
+ },
1278
+ "oauth2_authorization_codes_user_id_users_id_fk": {
1279
+ "name": "oauth2_authorization_codes_user_id_users_id_fk",
1280
+ "tableFrom": "oauth2_authorization_codes",
1281
+ "tableTo": "users",
1282
+ "columnsFrom": [
1283
+ "user_id"
1284
+ ],
1285
+ "columnsTo": [
1286
+ "id"
1287
+ ],
1288
+ "onDelete": "cascade",
1289
+ "onUpdate": "no action"
1290
+ }
1291
+ },
1292
+ "compositePrimaryKeys": {},
1293
+ "uniqueConstraints": {},
1294
+ "policies": {},
1295
+ "checkConstraints": {
1296
+ "oauth2_authorization_codes_mfa_factor_check": {
1297
+ "name": "oauth2_authorization_codes_mfa_factor_check",
1298
+ "value": "mfa_factor is null or mfa_factor in ('totp', 'backup_code', 'webauthn', 'session')"
1299
+ }
1300
+ },
1301
+ "isRLSEnabled": false
1302
+ },
1303
+ "public.oauth2_consents": {
1304
+ "name": "oauth2_consents",
1305
+ "schema": "",
1306
+ "columns": {
1307
+ "id": {
1308
+ "name": "id",
1309
+ "type": "uuid",
1310
+ "primaryKey": true,
1311
+ "notNull": true,
1312
+ "default": "gen_random_uuid()"
1313
+ },
1314
+ "app_id": {
1315
+ "name": "app_id",
1316
+ "type": "uuid",
1317
+ "primaryKey": false,
1318
+ "notNull": true
1319
+ },
1320
+ "user_id": {
1321
+ "name": "user_id",
1322
+ "type": "uuid",
1323
+ "primaryKey": false,
1324
+ "notNull": true
1325
+ },
1326
+ "scopes": {
1327
+ "name": "scopes",
1328
+ "type": "text[]",
1329
+ "primaryKey": false,
1330
+ "notNull": true,
1331
+ "default": "'{}'::text[]"
1332
+ },
1333
+ "granted_at": {
1334
+ "name": "granted_at",
1335
+ "type": "timestamp with time zone",
1336
+ "primaryKey": false,
1337
+ "notNull": true,
1338
+ "default": "now()"
1339
+ },
1340
+ "revoked_at": {
1341
+ "name": "revoked_at",
1342
+ "type": "timestamp with time zone",
1343
+ "primaryKey": false,
1344
+ "notNull": false
1345
+ }
1346
+ },
1347
+ "indexes": {
1348
+ "oauth2_consents_app_idx": {
1349
+ "name": "oauth2_consents_app_idx",
1350
+ "columns": [
1351
+ {
1352
+ "expression": "app_id",
1353
+ "isExpression": false,
1354
+ "asc": true,
1355
+ "nulls": "last"
1356
+ }
1357
+ ],
1358
+ "isUnique": false,
1359
+ "concurrently": false,
1360
+ "method": "btree",
1361
+ "with": {}
1362
+ },
1363
+ "oauth2_consents_user_idx": {
1364
+ "name": "oauth2_consents_user_idx",
1365
+ "columns": [
1366
+ {
1367
+ "expression": "user_id",
1368
+ "isExpression": false,
1369
+ "asc": true,
1370
+ "nulls": "last"
1371
+ }
1372
+ ],
1373
+ "isUnique": false,
1374
+ "concurrently": false,
1375
+ "method": "btree",
1376
+ "with": {}
1377
+ }
1378
+ },
1379
+ "foreignKeys": {
1380
+ "oauth2_consents_app_id_applications_id_fk": {
1381
+ "name": "oauth2_consents_app_id_applications_id_fk",
1382
+ "tableFrom": "oauth2_consents",
1383
+ "tableTo": "applications",
1384
+ "columnsFrom": [
1385
+ "app_id"
1386
+ ],
1387
+ "columnsTo": [
1388
+ "id"
1389
+ ],
1390
+ "onDelete": "cascade",
1391
+ "onUpdate": "no action"
1392
+ },
1393
+ "oauth2_consents_user_id_users_id_fk": {
1394
+ "name": "oauth2_consents_user_id_users_id_fk",
1395
+ "tableFrom": "oauth2_consents",
1396
+ "tableTo": "users",
1397
+ "columnsFrom": [
1398
+ "user_id"
1399
+ ],
1400
+ "columnsTo": [
1401
+ "id"
1402
+ ],
1403
+ "onDelete": "cascade",
1404
+ "onUpdate": "no action"
1405
+ }
1406
+ },
1407
+ "compositePrimaryKeys": {},
1408
+ "uniqueConstraints": {
1409
+ "oauth2_consents_unique": {
1410
+ "name": "oauth2_consents_unique",
1411
+ "nullsNotDistinct": false,
1412
+ "columns": [
1413
+ "app_id",
1414
+ "user_id"
1415
+ ]
1416
+ }
1417
+ },
1418
+ "policies": {},
1419
+ "checkConstraints": {},
1420
+ "isRLSEnabled": false
1421
+ },
1422
+ "public.oidc_connections": {
1423
+ "name": "oidc_connections",
1424
+ "schema": "",
1425
+ "columns": {
1426
+ "id": {
1427
+ "name": "id",
1428
+ "type": "uuid",
1429
+ "primaryKey": true,
1430
+ "notNull": true,
1431
+ "default": "gen_random_uuid()"
1432
+ },
1433
+ "org_id": {
1434
+ "name": "org_id",
1435
+ "type": "uuid",
1436
+ "primaryKey": false,
1437
+ "notNull": true
1438
+ },
1439
+ "name": {
1440
+ "name": "name",
1441
+ "type": "text",
1442
+ "primaryKey": false,
1443
+ "notNull": true
1444
+ },
1445
+ "issuer": {
1446
+ "name": "issuer",
1447
+ "type": "text",
1448
+ "primaryKey": false,
1449
+ "notNull": true
1450
+ },
1451
+ "authorization_endpoint": {
1452
+ "name": "authorization_endpoint",
1453
+ "type": "text",
1454
+ "primaryKey": false,
1455
+ "notNull": true
1456
+ },
1457
+ "token_endpoint": {
1458
+ "name": "token_endpoint",
1459
+ "type": "text",
1460
+ "primaryKey": false,
1461
+ "notNull": true
1462
+ },
1463
+ "userinfo_endpoint": {
1464
+ "name": "userinfo_endpoint",
1465
+ "type": "text",
1466
+ "primaryKey": false,
1467
+ "notNull": false
1468
+ },
1469
+ "jwks_uri": {
1470
+ "name": "jwks_uri",
1471
+ "type": "text",
1472
+ "primaryKey": false,
1473
+ "notNull": false
1474
+ },
1475
+ "client_id": {
1476
+ "name": "client_id",
1477
+ "type": "text",
1478
+ "primaryKey": false,
1479
+ "notNull": true
1480
+ },
1481
+ "client_secret": {
1482
+ "name": "client_secret",
1483
+ "type": "text",
1484
+ "primaryKey": false,
1485
+ "notNull": true
1486
+ },
1487
+ "scopes": {
1488
+ "name": "scopes",
1489
+ "type": "text[]",
1490
+ "primaryKey": false,
1491
+ "notNull": true,
1492
+ "default": "'{\"openid\",\"profile\",\"email\"}'::text[]"
1493
+ },
1494
+ "attribute_mapping": {
1495
+ "name": "attribute_mapping",
1496
+ "type": "jsonb",
1497
+ "primaryKey": false,
1498
+ "notNull": true,
1499
+ "default": "'{}'::jsonb"
1500
+ },
1501
+ "is_active": {
1502
+ "name": "is_active",
1503
+ "type": "boolean",
1504
+ "primaryKey": false,
1505
+ "notNull": true,
1506
+ "default": true
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
+ "updated_at": {
1516
+ "name": "updated_at",
1517
+ "type": "timestamp with time zone",
1518
+ "primaryKey": false,
1519
+ "notNull": true,
1520
+ "default": "now()"
1521
+ }
1522
+ },
1523
+ "indexes": {
1524
+ "oidc_connections_org_idx": {
1525
+ "name": "oidc_connections_org_idx",
1526
+ "columns": [
1527
+ {
1528
+ "expression": "org_id",
1529
+ "isExpression": false,
1530
+ "asc": true,
1531
+ "nulls": "last"
1532
+ }
1533
+ ],
1534
+ "isUnique": false,
1535
+ "concurrently": false,
1536
+ "method": "btree",
1537
+ "with": {}
1538
+ }
1539
+ },
1540
+ "foreignKeys": {
1541
+ "oidc_connections_org_id_organizations_id_fk": {
1542
+ "name": "oidc_connections_org_id_organizations_id_fk",
1543
+ "tableFrom": "oidc_connections",
1544
+ "tableTo": "organizations",
1545
+ "columnsFrom": [
1546
+ "org_id"
1547
+ ],
1548
+ "columnsTo": [
1549
+ "id"
1550
+ ],
1551
+ "onDelete": "cascade",
1552
+ "onUpdate": "no action"
1553
+ }
1554
+ },
1555
+ "compositePrimaryKeys": {},
1556
+ "uniqueConstraints": {},
1557
+ "policies": {},
1558
+ "checkConstraints": {},
1559
+ "isRLSEnabled": false
1560
+ },
1561
+ "public.org_memberships": {
1562
+ "name": "org_memberships",
1563
+ "schema": "",
1564
+ "columns": {
1565
+ "id": {
1566
+ "name": "id",
1567
+ "type": "uuid",
1568
+ "primaryKey": true,
1569
+ "notNull": true,
1570
+ "default": "gen_random_uuid()"
1571
+ },
1572
+ "org_id": {
1573
+ "name": "org_id",
1574
+ "type": "uuid",
1575
+ "primaryKey": false,
1576
+ "notNull": true
1577
+ },
1578
+ "user_id": {
1579
+ "name": "user_id",
1580
+ "type": "uuid",
1581
+ "primaryKey": false,
1582
+ "notNull": true
1583
+ },
1584
+ "role": {
1585
+ "name": "role",
1586
+ "type": "text",
1587
+ "primaryKey": false,
1588
+ "notNull": true,
1589
+ "default": "'member'"
1590
+ },
1591
+ "created_at": {
1592
+ "name": "created_at",
1593
+ "type": "timestamp with time zone",
1594
+ "primaryKey": false,
1595
+ "notNull": true,
1596
+ "default": "now()"
1597
+ },
1598
+ "updated_at": {
1599
+ "name": "updated_at",
1600
+ "type": "timestamp with time zone",
1601
+ "primaryKey": false,
1602
+ "notNull": true,
1603
+ "default": "now()"
1604
+ }
1605
+ },
1606
+ "indexes": {
1607
+ "org_memberships_org_idx": {
1608
+ "name": "org_memberships_org_idx",
1609
+ "columns": [
1610
+ {
1611
+ "expression": "org_id",
1612
+ "isExpression": false,
1613
+ "asc": true,
1614
+ "nulls": "last"
1615
+ }
1616
+ ],
1617
+ "isUnique": false,
1618
+ "concurrently": false,
1619
+ "method": "btree",
1620
+ "with": {}
1621
+ },
1622
+ "org_memberships_user_idx": {
1623
+ "name": "org_memberships_user_idx",
1624
+ "columns": [
1625
+ {
1626
+ "expression": "user_id",
1627
+ "isExpression": false,
1628
+ "asc": true,
1629
+ "nulls": "last"
1630
+ }
1631
+ ],
1632
+ "isUnique": false,
1633
+ "concurrently": false,
1634
+ "method": "btree",
1635
+ "with": {}
1636
+ }
1637
+ },
1638
+ "foreignKeys": {
1639
+ "org_memberships_org_id_organizations_id_fk": {
1640
+ "name": "org_memberships_org_id_organizations_id_fk",
1641
+ "tableFrom": "org_memberships",
1642
+ "tableTo": "organizations",
1643
+ "columnsFrom": [
1644
+ "org_id"
1645
+ ],
1646
+ "columnsTo": [
1647
+ "id"
1648
+ ],
1649
+ "onDelete": "cascade",
1650
+ "onUpdate": "no action"
1651
+ },
1652
+ "org_memberships_user_id_users_id_fk": {
1653
+ "name": "org_memberships_user_id_users_id_fk",
1654
+ "tableFrom": "org_memberships",
1655
+ "tableTo": "users",
1656
+ "columnsFrom": [
1657
+ "user_id"
1658
+ ],
1659
+ "columnsTo": [
1660
+ "id"
1661
+ ],
1662
+ "onDelete": "cascade",
1663
+ "onUpdate": "no action"
1664
+ }
1665
+ },
1666
+ "compositePrimaryKeys": {},
1667
+ "uniqueConstraints": {
1668
+ "org_memberships_unique": {
1669
+ "name": "org_memberships_unique",
1670
+ "nullsNotDistinct": false,
1671
+ "columns": [
1672
+ "org_id",
1673
+ "user_id"
1674
+ ]
1675
+ }
1676
+ },
1677
+ "policies": {},
1678
+ "checkConstraints": {
1679
+ "org_memberships_role_check": {
1680
+ "name": "org_memberships_role_check",
1681
+ "value": "role in ('owner', 'admin', 'member')"
1682
+ }
1683
+ },
1684
+ "isRLSEnabled": false
1685
+ },
1686
+ "public.organizations": {
1687
+ "name": "organizations",
1688
+ "schema": "",
1689
+ "columns": {
1690
+ "id": {
1691
+ "name": "id",
1692
+ "type": "uuid",
1693
+ "primaryKey": true,
1694
+ "notNull": true,
1695
+ "default": "gen_random_uuid()"
1696
+ },
1697
+ "name": {
1698
+ "name": "name",
1699
+ "type": "text",
1700
+ "primaryKey": false,
1701
+ "notNull": true
1702
+ },
1703
+ "slug": {
1704
+ "name": "slug",
1705
+ "type": "text",
1706
+ "primaryKey": false,
1707
+ "notNull": true
1708
+ },
1709
+ "plan": {
1710
+ "name": "plan",
1711
+ "type": "text",
1712
+ "primaryKey": false,
1713
+ "notNull": true,
1714
+ "default": "'free'"
1715
+ },
1716
+ "branding": {
1717
+ "name": "branding",
1718
+ "type": "jsonb",
1719
+ "primaryKey": false,
1720
+ "notNull": true,
1721
+ "default": "'{}'::jsonb"
1722
+ },
1723
+ "created_at": {
1724
+ "name": "created_at",
1725
+ "type": "timestamp with time zone",
1726
+ "primaryKey": false,
1727
+ "notNull": true,
1728
+ "default": "now()"
1729
+ },
1730
+ "updated_at": {
1731
+ "name": "updated_at",
1732
+ "type": "timestamp with time zone",
1733
+ "primaryKey": false,
1734
+ "notNull": true,
1735
+ "default": "now()"
1736
+ }
1737
+ },
1738
+ "indexes": {
1739
+ "organizations_slug_idx": {
1740
+ "name": "organizations_slug_idx",
1741
+ "columns": [
1742
+ {
1743
+ "expression": "slug",
1744
+ "isExpression": false,
1745
+ "asc": true,
1746
+ "nulls": "last"
1747
+ }
1748
+ ],
1749
+ "isUnique": false,
1750
+ "concurrently": false,
1751
+ "method": "btree",
1752
+ "with": {}
1753
+ }
1754
+ },
1755
+ "foreignKeys": {},
1756
+ "compositePrimaryKeys": {},
1757
+ "uniqueConstraints": {
1758
+ "organizations_slug_unique": {
1759
+ "name": "organizations_slug_unique",
1760
+ "nullsNotDistinct": false,
1761
+ "columns": [
1762
+ "slug"
1763
+ ]
1764
+ }
1765
+ },
1766
+ "policies": {},
1767
+ "checkConstraints": {},
1768
+ "isRLSEnabled": false
1769
+ },
1770
+ "public.password_reset_tokens": {
1771
+ "name": "password_reset_tokens",
1772
+ "schema": "",
1773
+ "columns": {
1774
+ "id": {
1775
+ "name": "id",
1776
+ "type": "uuid",
1777
+ "primaryKey": true,
1778
+ "notNull": true,
1779
+ "default": "gen_random_uuid()"
1780
+ },
1781
+ "user_id": {
1782
+ "name": "user_id",
1783
+ "type": "uuid",
1784
+ "primaryKey": false,
1785
+ "notNull": true
1786
+ },
1787
+ "token_hash": {
1788
+ "name": "token_hash",
1789
+ "type": "text",
1790
+ "primaryKey": false,
1791
+ "notNull": true
1792
+ },
1793
+ "used_at": {
1794
+ "name": "used_at",
1795
+ "type": "timestamp with time zone",
1796
+ "primaryKey": false,
1797
+ "notNull": false
1798
+ },
1799
+ "expires_at": {
1800
+ "name": "expires_at",
1801
+ "type": "timestamp with time zone",
1802
+ "primaryKey": false,
1803
+ "notNull": true
1804
+ },
1805
+ "created_at": {
1806
+ "name": "created_at",
1807
+ "type": "timestamp with time zone",
1808
+ "primaryKey": false,
1809
+ "notNull": true,
1810
+ "default": "now()"
1811
+ }
1812
+ },
1813
+ "indexes": {
1814
+ "password_reset_tokens_user_idx": {
1815
+ "name": "password_reset_tokens_user_idx",
1816
+ "columns": [
1817
+ {
1818
+ "expression": "user_id",
1819
+ "isExpression": false,
1820
+ "asc": true,
1821
+ "nulls": "last"
1822
+ }
1823
+ ],
1824
+ "isUnique": false,
1825
+ "concurrently": false,
1826
+ "method": "btree",
1827
+ "with": {}
1828
+ },
1829
+ "password_reset_tokens_hash_idx": {
1830
+ "name": "password_reset_tokens_hash_idx",
1831
+ "columns": [
1832
+ {
1833
+ "expression": "token_hash",
1834
+ "isExpression": false,
1835
+ "asc": true,
1836
+ "nulls": "last"
1837
+ }
1838
+ ],
1839
+ "isUnique": false,
1840
+ "concurrently": false,
1841
+ "method": "btree",
1842
+ "with": {}
1843
+ }
1844
+ },
1845
+ "foreignKeys": {
1846
+ "password_reset_tokens_user_id_users_id_fk": {
1847
+ "name": "password_reset_tokens_user_id_users_id_fk",
1848
+ "tableFrom": "password_reset_tokens",
1849
+ "tableTo": "users",
1850
+ "columnsFrom": [
1851
+ "user_id"
1852
+ ],
1853
+ "columnsTo": [
1854
+ "id"
1855
+ ],
1856
+ "onDelete": "cascade",
1857
+ "onUpdate": "no action"
1858
+ }
1859
+ },
1860
+ "compositePrimaryKeys": {},
1861
+ "uniqueConstraints": {},
1862
+ "policies": {},
1863
+ "checkConstraints": {},
1864
+ "isRLSEnabled": false
1865
+ },
1866
+ "public.permissions": {
1867
+ "name": "permissions",
1868
+ "schema": "",
1869
+ "columns": {
1870
+ "id": {
1871
+ "name": "id",
1872
+ "type": "uuid",
1873
+ "primaryKey": true,
1874
+ "notNull": true,
1875
+ "default": "gen_random_uuid()"
1876
+ },
1877
+ "resource": {
1878
+ "name": "resource",
1879
+ "type": "text",
1880
+ "primaryKey": false,
1881
+ "notNull": true
1882
+ },
1883
+ "action": {
1884
+ "name": "action",
1885
+ "type": "text",
1886
+ "primaryKey": false,
1887
+ "notNull": true
1888
+ },
1889
+ "description": {
1890
+ "name": "description",
1891
+ "type": "text",
1892
+ "primaryKey": false,
1893
+ "notNull": false
1894
+ },
1895
+ "created_at": {
1896
+ "name": "created_at",
1897
+ "type": "timestamp with time zone",
1898
+ "primaryKey": false,
1899
+ "notNull": true,
1900
+ "default": "now()"
1901
+ }
1902
+ },
1903
+ "indexes": {},
1904
+ "foreignKeys": {},
1905
+ "compositePrimaryKeys": {},
1906
+ "uniqueConstraints": {
1907
+ "permissions_resource_action_idx": {
1908
+ "name": "permissions_resource_action_idx",
1909
+ "nullsNotDistinct": false,
1910
+ "columns": [
1911
+ "resource",
1912
+ "action"
1913
+ ]
1914
+ }
1915
+ },
1916
+ "policies": {},
1917
+ "checkConstraints": {},
1918
+ "isRLSEnabled": false
1919
+ },
1920
+ "public.refresh_tokens": {
1921
+ "name": "refresh_tokens",
1922
+ "schema": "",
1923
+ "columns": {
1924
+ "id": {
1925
+ "name": "id",
1926
+ "type": "uuid",
1927
+ "primaryKey": true,
1928
+ "notNull": true,
1929
+ "default": "gen_random_uuid()"
1930
+ },
1931
+ "user_id": {
1932
+ "name": "user_id",
1933
+ "type": "uuid",
1934
+ "primaryKey": false,
1935
+ "notNull": true
1936
+ },
1937
+ "app_id": {
1938
+ "name": "app_id",
1939
+ "type": "uuid",
1940
+ "primaryKey": false,
1941
+ "notNull": false
1942
+ },
1943
+ "token_hash": {
1944
+ "name": "token_hash",
1945
+ "type": "text",
1946
+ "primaryKey": false,
1947
+ "notNull": true
1948
+ },
1949
+ "expires_at": {
1950
+ "name": "expires_at",
1951
+ "type": "timestamp with time zone",
1952
+ "primaryKey": false,
1953
+ "notNull": true
1954
+ },
1955
+ "revoked_at": {
1956
+ "name": "revoked_at",
1957
+ "type": "timestamp with time zone",
1958
+ "primaryKey": false,
1959
+ "notNull": false
1960
+ },
1961
+ "created_at": {
1962
+ "name": "created_at",
1963
+ "type": "timestamp with time zone",
1964
+ "primaryKey": false,
1965
+ "notNull": true,
1966
+ "default": "now()"
1967
+ },
1968
+ "ip_address": {
1969
+ "name": "ip_address",
1970
+ "type": "text",
1971
+ "primaryKey": false,
1972
+ "notNull": false
1973
+ },
1974
+ "user_agent": {
1975
+ "name": "user_agent",
1976
+ "type": "text",
1977
+ "primaryKey": false,
1978
+ "notNull": false
1979
+ },
1980
+ "device_fingerprint": {
1981
+ "name": "device_fingerprint",
1982
+ "type": "text",
1983
+ "primaryKey": false,
1984
+ "notNull": false
1985
+ },
1986
+ "mfa_factor": {
1987
+ "name": "mfa_factor",
1988
+ "type": "text",
1989
+ "primaryKey": false,
1990
+ "notNull": false
1991
+ }
1992
+ },
1993
+ "indexes": {
1994
+ "refresh_tokens_user_idx": {
1995
+ "name": "refresh_tokens_user_idx",
1996
+ "columns": [
1997
+ {
1998
+ "expression": "user_id",
1999
+ "isExpression": false,
2000
+ "asc": true,
2001
+ "nulls": "last"
2002
+ }
2003
+ ],
2004
+ "isUnique": false,
2005
+ "concurrently": false,
2006
+ "method": "btree",
2007
+ "with": {}
2008
+ },
2009
+ "refresh_tokens_app_idx": {
2010
+ "name": "refresh_tokens_app_idx",
2011
+ "columns": [
2012
+ {
2013
+ "expression": "app_id",
2014
+ "isExpression": false,
2015
+ "asc": true,
2016
+ "nulls": "last"
2017
+ }
2018
+ ],
2019
+ "isUnique": false,
2020
+ "concurrently": false,
2021
+ "method": "btree",
2022
+ "with": {}
2023
+ },
2024
+ "refresh_tokens_hash_idx": {
2025
+ "name": "refresh_tokens_hash_idx",
2026
+ "columns": [
2027
+ {
2028
+ "expression": "token_hash",
2029
+ "isExpression": false,
2030
+ "asc": true,
2031
+ "nulls": "last"
2032
+ }
2033
+ ],
2034
+ "isUnique": false,
2035
+ "concurrently": false,
2036
+ "method": "btree",
2037
+ "with": {}
2038
+ }
2039
+ },
2040
+ "foreignKeys": {
2041
+ "refresh_tokens_user_id_users_id_fk": {
2042
+ "name": "refresh_tokens_user_id_users_id_fk",
2043
+ "tableFrom": "refresh_tokens",
2044
+ "tableTo": "users",
2045
+ "columnsFrom": [
2046
+ "user_id"
2047
+ ],
2048
+ "columnsTo": [
2049
+ "id"
2050
+ ],
2051
+ "onDelete": "cascade",
2052
+ "onUpdate": "no action"
2053
+ },
2054
+ "refresh_tokens_app_id_applications_id_fk": {
2055
+ "name": "refresh_tokens_app_id_applications_id_fk",
2056
+ "tableFrom": "refresh_tokens",
2057
+ "tableTo": "applications",
2058
+ "columnsFrom": [
2059
+ "app_id"
2060
+ ],
2061
+ "columnsTo": [
2062
+ "id"
2063
+ ],
2064
+ "onDelete": "restrict",
2065
+ "onUpdate": "no action"
2066
+ }
2067
+ },
2068
+ "compositePrimaryKeys": {},
2069
+ "uniqueConstraints": {},
2070
+ "policies": {},
2071
+ "checkConstraints": {
2072
+ "refresh_tokens_mfa_factor_check": {
2073
+ "name": "refresh_tokens_mfa_factor_check",
2074
+ "value": "mfa_factor is null or mfa_factor in ('totp', 'backup_code', 'webauthn', 'session')"
2075
+ }
2076
+ },
2077
+ "isRLSEnabled": false
2078
+ },
2079
+ "public.role_permissions": {
2080
+ "name": "role_permissions",
2081
+ "schema": "",
2082
+ "columns": {
2083
+ "id": {
2084
+ "name": "id",
2085
+ "type": "uuid",
2086
+ "primaryKey": true,
2087
+ "notNull": true,
2088
+ "default": "gen_random_uuid()"
2089
+ },
2090
+ "role": {
2091
+ "name": "role",
2092
+ "type": "text",
2093
+ "primaryKey": false,
2094
+ "notNull": true
2095
+ },
2096
+ "permission_id": {
2097
+ "name": "permission_id",
2098
+ "type": "uuid",
2099
+ "primaryKey": false,
2100
+ "notNull": true
2101
+ },
2102
+ "created_at": {
2103
+ "name": "created_at",
2104
+ "type": "timestamp with time zone",
2105
+ "primaryKey": false,
2106
+ "notNull": true,
2107
+ "default": "now()"
2108
+ }
2109
+ },
2110
+ "indexes": {},
2111
+ "foreignKeys": {
2112
+ "role_permissions_permission_id_permissions_id_fk": {
2113
+ "name": "role_permissions_permission_id_permissions_id_fk",
2114
+ "tableFrom": "role_permissions",
2115
+ "tableTo": "permissions",
2116
+ "columnsFrom": [
2117
+ "permission_id"
2118
+ ],
2119
+ "columnsTo": [
2120
+ "id"
2121
+ ],
2122
+ "onDelete": "cascade",
2123
+ "onUpdate": "no action"
2124
+ }
2125
+ },
2126
+ "compositePrimaryKeys": {},
2127
+ "uniqueConstraints": {
2128
+ "role_permissions_idx": {
2129
+ "name": "role_permissions_idx",
2130
+ "nullsNotDistinct": false,
2131
+ "columns": [
2132
+ "role",
2133
+ "permission_id"
2134
+ ]
2135
+ }
2136
+ },
2137
+ "policies": {},
2138
+ "checkConstraints": {},
2139
+ "isRLSEnabled": false
2140
+ },
2141
+ "public.saml_connections": {
2142
+ "name": "saml_connections",
2143
+ "schema": "",
2144
+ "columns": {
2145
+ "id": {
2146
+ "name": "id",
2147
+ "type": "uuid",
2148
+ "primaryKey": true,
2149
+ "notNull": true,
2150
+ "default": "gen_random_uuid()"
2151
+ },
2152
+ "org_id": {
2153
+ "name": "org_id",
2154
+ "type": "uuid",
2155
+ "primaryKey": false,
2156
+ "notNull": true
2157
+ },
2158
+ "name": {
2159
+ "name": "name",
2160
+ "type": "text",
2161
+ "primaryKey": false,
2162
+ "notNull": true
2163
+ },
2164
+ "idp_entity_id": {
2165
+ "name": "idp_entity_id",
2166
+ "type": "text",
2167
+ "primaryKey": false,
2168
+ "notNull": false
2169
+ },
2170
+ "idp_sso_url": {
2171
+ "name": "idp_sso_url",
2172
+ "type": "text",
2173
+ "primaryKey": false,
2174
+ "notNull": false
2175
+ },
2176
+ "idp_certificate": {
2177
+ "name": "idp_certificate",
2178
+ "type": "text",
2179
+ "primaryKey": false,
2180
+ "notNull": false
2181
+ },
2182
+ "sp_entity_id": {
2183
+ "name": "sp_entity_id",
2184
+ "type": "text",
2185
+ "primaryKey": false,
2186
+ "notNull": true
2187
+ },
2188
+ "sp_acs_url": {
2189
+ "name": "sp_acs_url",
2190
+ "type": "text",
2191
+ "primaryKey": false,
2192
+ "notNull": true
2193
+ },
2194
+ "attribute_mapping": {
2195
+ "name": "attribute_mapping",
2196
+ "type": "jsonb",
2197
+ "primaryKey": false,
2198
+ "notNull": true,
2199
+ "default": "'{}'::jsonb"
2200
+ },
2201
+ "is_active": {
2202
+ "name": "is_active",
2203
+ "type": "boolean",
2204
+ "primaryKey": false,
2205
+ "notNull": true,
2206
+ "default": true
2207
+ },
2208
+ "created_at": {
2209
+ "name": "created_at",
2210
+ "type": "timestamp with time zone",
2211
+ "primaryKey": false,
2212
+ "notNull": true,
2213
+ "default": "now()"
2214
+ },
2215
+ "updated_at": {
2216
+ "name": "updated_at",
2217
+ "type": "timestamp with time zone",
2218
+ "primaryKey": false,
2219
+ "notNull": true,
2220
+ "default": "now()"
2221
+ }
2222
+ },
2223
+ "indexes": {
2224
+ "saml_connections_org_idx": {
2225
+ "name": "saml_connections_org_idx",
2226
+ "columns": [
2227
+ {
2228
+ "expression": "org_id",
2229
+ "isExpression": false,
2230
+ "asc": true,
2231
+ "nulls": "last"
2232
+ }
2233
+ ],
2234
+ "isUnique": false,
2235
+ "concurrently": false,
2236
+ "method": "btree",
2237
+ "with": {}
2238
+ }
2239
+ },
2240
+ "foreignKeys": {
2241
+ "saml_connections_org_id_organizations_id_fk": {
2242
+ "name": "saml_connections_org_id_organizations_id_fk",
2243
+ "tableFrom": "saml_connections",
2244
+ "tableTo": "organizations",
2245
+ "columnsFrom": [
2246
+ "org_id"
2247
+ ],
2248
+ "columnsTo": [
2249
+ "id"
2250
+ ],
2251
+ "onDelete": "cascade",
2252
+ "onUpdate": "no action"
2253
+ }
2254
+ },
2255
+ "compositePrimaryKeys": {},
2256
+ "uniqueConstraints": {},
2257
+ "policies": {},
2258
+ "checkConstraints": {},
2259
+ "isRLSEnabled": false
2260
+ },
2261
+ "public.secrets": {
2262
+ "name": "secrets",
2263
+ "schema": "",
2264
+ "columns": {
2265
+ "id": {
2266
+ "name": "id",
2267
+ "type": "uuid",
2268
+ "primaryKey": true,
2269
+ "notNull": true,
2270
+ "default": "gen_random_uuid()"
2271
+ },
2272
+ "key_id": {
2273
+ "name": "key_id",
2274
+ "type": "text",
2275
+ "primaryKey": false,
2276
+ "notNull": true
2277
+ },
2278
+ "type": {
2279
+ "name": "type",
2280
+ "type": "text",
2281
+ "primaryKey": false,
2282
+ "notNull": true
2283
+ },
2284
+ "value": {
2285
+ "name": "value",
2286
+ "type": "text",
2287
+ "primaryKey": false,
2288
+ "notNull": true
2289
+ },
2290
+ "algorithm": {
2291
+ "name": "algorithm",
2292
+ "type": "text",
2293
+ "primaryKey": false,
2294
+ "notNull": false
2295
+ },
2296
+ "is_active": {
2297
+ "name": "is_active",
2298
+ "type": "boolean",
2299
+ "primaryKey": false,
2300
+ "notNull": true,
2301
+ "default": true
2302
+ },
2303
+ "rotated_at": {
2304
+ "name": "rotated_at",
2305
+ "type": "timestamp with time zone",
2306
+ "primaryKey": false,
2307
+ "notNull": false
2308
+ },
2309
+ "expires_at": {
2310
+ "name": "expires_at",
2311
+ "type": "timestamp with time zone",
2312
+ "primaryKey": false,
2313
+ "notNull": false
2314
+ },
2315
+ "created_at": {
2316
+ "name": "created_at",
2317
+ "type": "timestamp with time zone",
2318
+ "primaryKey": false,
2319
+ "notNull": true,
2320
+ "default": "now()"
2321
+ }
2322
+ },
2323
+ "indexes": {
2324
+ "secrets_type_active_idx": {
2325
+ "name": "secrets_type_active_idx",
2326
+ "columns": [
2327
+ {
2328
+ "expression": "type",
2329
+ "isExpression": false,
2330
+ "asc": true,
2331
+ "nulls": "last"
2332
+ },
2333
+ {
2334
+ "expression": "is_active",
2335
+ "isExpression": false,
2336
+ "asc": true,
2337
+ "nulls": "last"
2338
+ }
2339
+ ],
2340
+ "isUnique": false,
2341
+ "concurrently": false,
2342
+ "method": "btree",
2343
+ "with": {}
2344
+ }
2345
+ },
2346
+ "foreignKeys": {},
2347
+ "compositePrimaryKeys": {},
2348
+ "uniqueConstraints": {
2349
+ "secrets_key_id_unique": {
2350
+ "name": "secrets_key_id_unique",
2351
+ "nullsNotDistinct": false,
2352
+ "columns": [
2353
+ "key_id"
2354
+ ]
2355
+ }
2356
+ },
2357
+ "policies": {},
2358
+ "checkConstraints": {},
2359
+ "isRLSEnabled": false
2360
+ },
2361
+ "public.service_accounts": {
2362
+ "name": "service_accounts",
2363
+ "schema": "",
2364
+ "columns": {
2365
+ "id": {
2366
+ "name": "id",
2367
+ "type": "uuid",
2368
+ "primaryKey": true,
2369
+ "notNull": true,
2370
+ "default": "gen_random_uuid()"
2371
+ },
2372
+ "org_id": {
2373
+ "name": "org_id",
2374
+ "type": "uuid",
2375
+ "primaryKey": false,
2376
+ "notNull": true
2377
+ },
2378
+ "name": {
2379
+ "name": "name",
2380
+ "type": "text",
2381
+ "primaryKey": false,
2382
+ "notNull": true
2383
+ },
2384
+ "description": {
2385
+ "name": "description",
2386
+ "type": "text",
2387
+ "primaryKey": false,
2388
+ "notNull": false
2389
+ },
2390
+ "is_active": {
2391
+ "name": "is_active",
2392
+ "type": "boolean",
2393
+ "primaryKey": false,
2394
+ "notNull": true,
2395
+ "default": true
2396
+ },
2397
+ "created_at": {
2398
+ "name": "created_at",
2399
+ "type": "timestamp with time zone",
2400
+ "primaryKey": false,
2401
+ "notNull": true,
2402
+ "default": "now()"
2403
+ },
2404
+ "updated_at": {
2405
+ "name": "updated_at",
2406
+ "type": "timestamp with time zone",
2407
+ "primaryKey": false,
2408
+ "notNull": true,
2409
+ "default": "now()"
2410
+ }
2411
+ },
2412
+ "indexes": {
2413
+ "service_accounts_org_idx": {
2414
+ "name": "service_accounts_org_idx",
2415
+ "columns": [
2416
+ {
2417
+ "expression": "org_id",
2418
+ "isExpression": false,
2419
+ "asc": true,
2420
+ "nulls": "last"
2421
+ }
2422
+ ],
2423
+ "isUnique": false,
2424
+ "concurrently": false,
2425
+ "method": "btree",
2426
+ "with": {}
2427
+ }
2428
+ },
2429
+ "foreignKeys": {
2430
+ "service_accounts_org_id_organizations_id_fk": {
2431
+ "name": "service_accounts_org_id_organizations_id_fk",
2432
+ "tableFrom": "service_accounts",
2433
+ "tableTo": "organizations",
2434
+ "columnsFrom": [
2435
+ "org_id"
2436
+ ],
2437
+ "columnsTo": [
2438
+ "id"
2439
+ ],
2440
+ "onDelete": "cascade",
2441
+ "onUpdate": "no action"
2442
+ }
2443
+ },
2444
+ "compositePrimaryKeys": {},
2445
+ "uniqueConstraints": {},
2446
+ "policies": {},
2447
+ "checkConstraints": {},
2448
+ "isRLSEnabled": false
2449
+ },
2450
+ "public.sms_otp_codes": {
2451
+ "name": "sms_otp_codes",
2452
+ "schema": "",
2453
+ "columns": {
2454
+ "id": {
2455
+ "name": "id",
2456
+ "type": "uuid",
2457
+ "primaryKey": true,
2458
+ "notNull": true,
2459
+ "default": "gen_random_uuid()"
2460
+ },
2461
+ "user_id": {
2462
+ "name": "user_id",
2463
+ "type": "uuid",
2464
+ "primaryKey": false,
2465
+ "notNull": true
2466
+ },
2467
+ "phone_number": {
2468
+ "name": "phone_number",
2469
+ "type": "text",
2470
+ "primaryKey": false,
2471
+ "notNull": true
2472
+ },
2473
+ "code_hash": {
2474
+ "name": "code_hash",
2475
+ "type": "text",
2476
+ "primaryKey": false,
2477
+ "notNull": true
2478
+ },
2479
+ "used_at": {
2480
+ "name": "used_at",
2481
+ "type": "timestamp with time zone",
2482
+ "primaryKey": false,
2483
+ "notNull": false
2484
+ },
2485
+ "expires_at": {
2486
+ "name": "expires_at",
2487
+ "type": "timestamp with time zone",
2488
+ "primaryKey": false,
2489
+ "notNull": true
2490
+ },
2491
+ "created_at": {
2492
+ "name": "created_at",
2493
+ "type": "timestamp with time zone",
2494
+ "primaryKey": false,
2495
+ "notNull": true,
2496
+ "default": "now()"
2497
+ }
2498
+ },
2499
+ "indexes": {
2500
+ "sms_otp_codes_user_idx": {
2501
+ "name": "sms_otp_codes_user_idx",
2502
+ "columns": [
2503
+ {
2504
+ "expression": "user_id",
2505
+ "isExpression": false,
2506
+ "asc": true,
2507
+ "nulls": "last"
2508
+ }
2509
+ ],
2510
+ "isUnique": false,
2511
+ "concurrently": false,
2512
+ "method": "btree",
2513
+ "with": {}
2514
+ }
2515
+ },
2516
+ "foreignKeys": {
2517
+ "sms_otp_codes_user_id_users_id_fk": {
2518
+ "name": "sms_otp_codes_user_id_users_id_fk",
2519
+ "tableFrom": "sms_otp_codes",
2520
+ "tableTo": "users",
2521
+ "columnsFrom": [
2522
+ "user_id"
2523
+ ],
2524
+ "columnsTo": [
2525
+ "id"
2526
+ ],
2527
+ "onDelete": "cascade",
2528
+ "onUpdate": "no action"
2529
+ }
2530
+ },
2531
+ "compositePrimaryKeys": {},
2532
+ "uniqueConstraints": {},
2533
+ "policies": {},
2534
+ "checkConstraints": {},
2535
+ "isRLSEnabled": false
2536
+ },
2537
+ "public.sso_identity_links": {
2538
+ "name": "sso_identity_links",
2539
+ "schema": "",
2540
+ "columns": {
2541
+ "id": {
2542
+ "name": "id",
2543
+ "type": "uuid",
2544
+ "primaryKey": true,
2545
+ "notNull": true,
2546
+ "default": "gen_random_uuid()"
2547
+ },
2548
+ "connection_type": {
2549
+ "name": "connection_type",
2550
+ "type": "text",
2551
+ "primaryKey": false,
2552
+ "notNull": true
2553
+ },
2554
+ "connection_id": {
2555
+ "name": "connection_id",
2556
+ "type": "uuid",
2557
+ "primaryKey": false,
2558
+ "notNull": true
2559
+ },
2560
+ "org_id": {
2561
+ "name": "org_id",
2562
+ "type": "uuid",
2563
+ "primaryKey": false,
2564
+ "notNull": true
2565
+ },
2566
+ "user_id": {
2567
+ "name": "user_id",
2568
+ "type": "uuid",
2569
+ "primaryKey": false,
2570
+ "notNull": true
2571
+ },
2572
+ "external_sub": {
2573
+ "name": "external_sub",
2574
+ "type": "text",
2575
+ "primaryKey": false,
2576
+ "notNull": true
2577
+ },
2578
+ "created_at": {
2579
+ "name": "created_at",
2580
+ "type": "timestamp with time zone",
2581
+ "primaryKey": false,
2582
+ "notNull": true,
2583
+ "default": "now()"
2584
+ }
2585
+ },
2586
+ "indexes": {
2587
+ "sso_identity_links_user_idx": {
2588
+ "name": "sso_identity_links_user_idx",
2589
+ "columns": [
2590
+ {
2591
+ "expression": "user_id",
2592
+ "isExpression": false,
2593
+ "asc": true,
2594
+ "nulls": "last"
2595
+ }
2596
+ ],
2597
+ "isUnique": false,
2598
+ "concurrently": false,
2599
+ "method": "btree",
2600
+ "with": {}
2601
+ }
2602
+ },
2603
+ "foreignKeys": {
2604
+ "sso_identity_links_org_id_organizations_id_fk": {
2605
+ "name": "sso_identity_links_org_id_organizations_id_fk",
2606
+ "tableFrom": "sso_identity_links",
2607
+ "tableTo": "organizations",
2608
+ "columnsFrom": [
2609
+ "org_id"
2610
+ ],
2611
+ "columnsTo": [
2612
+ "id"
2613
+ ],
2614
+ "onDelete": "cascade",
2615
+ "onUpdate": "no action"
2616
+ },
2617
+ "sso_identity_links_user_id_users_id_fk": {
2618
+ "name": "sso_identity_links_user_id_users_id_fk",
2619
+ "tableFrom": "sso_identity_links",
2620
+ "tableTo": "users",
2621
+ "columnsFrom": [
2622
+ "user_id"
2623
+ ],
2624
+ "columnsTo": [
2625
+ "id"
2626
+ ],
2627
+ "onDelete": "cascade",
2628
+ "onUpdate": "no action"
2629
+ }
2630
+ },
2631
+ "compositePrimaryKeys": {},
2632
+ "uniqueConstraints": {
2633
+ "sso_identity_links_connection_sub_unique": {
2634
+ "name": "sso_identity_links_connection_sub_unique",
2635
+ "nullsNotDistinct": false,
2636
+ "columns": [
2637
+ "connection_type",
2638
+ "connection_id",
2639
+ "external_sub"
2640
+ ]
2641
+ },
2642
+ "sso_identity_links_user_connection_unique": {
2643
+ "name": "sso_identity_links_user_connection_unique",
2644
+ "nullsNotDistinct": false,
2645
+ "columns": [
2646
+ "org_id",
2647
+ "user_id",
2648
+ "connection_type",
2649
+ "connection_id"
2650
+ ]
2651
+ }
2652
+ },
2653
+ "policies": {},
2654
+ "checkConstraints": {},
2655
+ "isRLSEnabled": false
2656
+ },
2657
+ "public.totp_backup_codes": {
2658
+ "name": "totp_backup_codes",
2659
+ "schema": "",
2660
+ "columns": {
2661
+ "id": {
2662
+ "name": "id",
2663
+ "type": "uuid",
2664
+ "primaryKey": true,
2665
+ "notNull": true,
2666
+ "default": "gen_random_uuid()"
2667
+ },
2668
+ "user_id": {
2669
+ "name": "user_id",
2670
+ "type": "uuid",
2671
+ "primaryKey": false,
2672
+ "notNull": true
2673
+ },
2674
+ "code_hash": {
2675
+ "name": "code_hash",
2676
+ "type": "text",
2677
+ "primaryKey": false,
2678
+ "notNull": true
2679
+ },
2680
+ "used_at": {
2681
+ "name": "used_at",
2682
+ "type": "timestamp with time zone",
2683
+ "primaryKey": false,
2684
+ "notNull": false
2685
+ },
2686
+ "expires_at": {
2687
+ "name": "expires_at",
2688
+ "type": "timestamp with time zone",
2689
+ "primaryKey": false,
2690
+ "notNull": true
2691
+ },
2692
+ "created_at": {
2693
+ "name": "created_at",
2694
+ "type": "timestamp with time zone",
2695
+ "primaryKey": false,
2696
+ "notNull": true,
2697
+ "default": "now()"
2698
+ }
2699
+ },
2700
+ "indexes": {
2701
+ "totp_backup_codes_user_idx": {
2702
+ "name": "totp_backup_codes_user_idx",
2703
+ "columns": [
2704
+ {
2705
+ "expression": "user_id",
2706
+ "isExpression": false,
2707
+ "asc": true,
2708
+ "nulls": "last"
2709
+ }
2710
+ ],
2711
+ "isUnique": false,
2712
+ "concurrently": false,
2713
+ "method": "btree",
2714
+ "with": {}
2715
+ }
2716
+ },
2717
+ "foreignKeys": {
2718
+ "totp_backup_codes_user_id_users_id_fk": {
2719
+ "name": "totp_backup_codes_user_id_users_id_fk",
2720
+ "tableFrom": "totp_backup_codes",
2721
+ "tableTo": "users",
2722
+ "columnsFrom": [
2723
+ "user_id"
2724
+ ],
2725
+ "columnsTo": [
2726
+ "id"
2727
+ ],
2728
+ "onDelete": "cascade",
2729
+ "onUpdate": "no action"
2730
+ }
2731
+ },
2732
+ "compositePrimaryKeys": {},
2733
+ "uniqueConstraints": {
2734
+ "totp_backup_codes_user_code_unique": {
2735
+ "name": "totp_backup_codes_user_code_unique",
2736
+ "nullsNotDistinct": false,
2737
+ "columns": [
2738
+ "user_id",
2739
+ "code_hash"
2740
+ ]
2741
+ }
2742
+ },
2743
+ "policies": {},
2744
+ "checkConstraints": {},
2745
+ "isRLSEnabled": false
2746
+ },
2747
+ "public.user_devices": {
2748
+ "name": "user_devices",
2749
+ "schema": "",
2750
+ "columns": {
2751
+ "id": {
2752
+ "name": "id",
2753
+ "type": "uuid",
2754
+ "primaryKey": true,
2755
+ "notNull": true,
2756
+ "default": "gen_random_uuid()"
2757
+ },
2758
+ "user_id": {
2759
+ "name": "user_id",
2760
+ "type": "uuid",
2761
+ "primaryKey": false,
2762
+ "notNull": true
2763
+ },
2764
+ "fingerprint_hash": {
2765
+ "name": "fingerprint_hash",
2766
+ "type": "text",
2767
+ "primaryKey": false,
2768
+ "notNull": true
2769
+ },
2770
+ "ip_address": {
2771
+ "name": "ip_address",
2772
+ "type": "text",
2773
+ "primaryKey": false,
2774
+ "notNull": false
2775
+ },
2776
+ "user_agent": {
2777
+ "name": "user_agent",
2778
+ "type": "text",
2779
+ "primaryKey": false,
2780
+ "notNull": false
2781
+ },
2782
+ "first_seen_at": {
2783
+ "name": "first_seen_at",
2784
+ "type": "timestamp with time zone",
2785
+ "primaryKey": false,
2786
+ "notNull": true,
2787
+ "default": "now()"
2788
+ },
2789
+ "last_seen_at": {
2790
+ "name": "last_seen_at",
2791
+ "type": "timestamp with time zone",
2792
+ "primaryKey": false,
2793
+ "notNull": true,
2794
+ "default": "now()"
2795
+ },
2796
+ "trust_score": {
2797
+ "name": "trust_score",
2798
+ "type": "smallint",
2799
+ "primaryKey": false,
2800
+ "notNull": true,
2801
+ "default": 50
2802
+ },
2803
+ "new_device_alert_sent": {
2804
+ "name": "new_device_alert_sent",
2805
+ "type": "boolean",
2806
+ "primaryKey": false,
2807
+ "notNull": true,
2808
+ "default": false
2809
+ }
2810
+ },
2811
+ "indexes": {
2812
+ "user_devices_user_idx": {
2813
+ "name": "user_devices_user_idx",
2814
+ "columns": [
2815
+ {
2816
+ "expression": "user_id",
2817
+ "isExpression": false,
2818
+ "asc": true,
2819
+ "nulls": "last"
2820
+ }
2821
+ ],
2822
+ "isUnique": false,
2823
+ "concurrently": false,
2824
+ "method": "btree",
2825
+ "with": {}
2826
+ }
2827
+ },
2828
+ "foreignKeys": {
2829
+ "user_devices_user_id_users_id_fk": {
2830
+ "name": "user_devices_user_id_users_id_fk",
2831
+ "tableFrom": "user_devices",
2832
+ "tableTo": "users",
2833
+ "columnsFrom": [
2834
+ "user_id"
2835
+ ],
2836
+ "columnsTo": [
2837
+ "id"
2838
+ ],
2839
+ "onDelete": "cascade",
2840
+ "onUpdate": "no action"
2841
+ }
2842
+ },
2843
+ "compositePrimaryKeys": {},
2844
+ "uniqueConstraints": {
2845
+ "user_devices_unique": {
2846
+ "name": "user_devices_unique",
2847
+ "nullsNotDistinct": false,
2848
+ "columns": [
2849
+ "user_id",
2850
+ "fingerprint_hash"
2851
+ ]
2852
+ }
2853
+ },
2854
+ "policies": {},
2855
+ "checkConstraints": {},
2856
+ "isRLSEnabled": false
2857
+ },
2858
+ "public.user_identities": {
2859
+ "name": "user_identities",
2860
+ "schema": "",
2861
+ "columns": {
2862
+ "id": {
2863
+ "name": "id",
2864
+ "type": "uuid",
2865
+ "primaryKey": true,
2866
+ "notNull": true,
2867
+ "default": "gen_random_uuid()"
2868
+ },
2869
+ "user_id": {
2870
+ "name": "user_id",
2871
+ "type": "uuid",
2872
+ "primaryKey": false,
2873
+ "notNull": true
2874
+ },
2875
+ "provider_id": {
2876
+ "name": "provider_id",
2877
+ "type": "uuid",
2878
+ "primaryKey": false,
2879
+ "notNull": true
2880
+ },
2881
+ "provider_type": {
2882
+ "name": "provider_type",
2883
+ "type": "text",
2884
+ "primaryKey": false,
2885
+ "notNull": true
2886
+ },
2887
+ "external_sub": {
2888
+ "name": "external_sub",
2889
+ "type": "text",
2890
+ "primaryKey": false,
2891
+ "notNull": true
2892
+ },
2893
+ "email": {
2894
+ "name": "email",
2895
+ "type": "text",
2896
+ "primaryKey": false,
2897
+ "notNull": false
2898
+ },
2899
+ "profile": {
2900
+ "name": "profile",
2901
+ "type": "jsonb",
2902
+ "primaryKey": false,
2903
+ "notNull": true,
2904
+ "default": "'{}'::jsonb"
2905
+ },
2906
+ "linked_at": {
2907
+ "name": "linked_at",
2908
+ "type": "timestamp with time zone",
2909
+ "primaryKey": false,
2910
+ "notNull": true,
2911
+ "default": "now()"
2912
+ }
2913
+ },
2914
+ "indexes": {
2915
+ "user_identities_user_idx": {
2916
+ "name": "user_identities_user_idx",
2917
+ "columns": [
2918
+ {
2919
+ "expression": "user_id",
2920
+ "isExpression": false,
2921
+ "asc": true,
2922
+ "nulls": "last"
2923
+ }
2924
+ ],
2925
+ "isUnique": false,
2926
+ "concurrently": false,
2927
+ "method": "btree",
2928
+ "with": {}
2929
+ },
2930
+ "user_identities_provider_sub_idx": {
2931
+ "name": "user_identities_provider_sub_idx",
2932
+ "columns": [
2933
+ {
2934
+ "expression": "provider_id",
2935
+ "isExpression": false,
2936
+ "asc": true,
2937
+ "nulls": "last"
2938
+ },
2939
+ {
2940
+ "expression": "external_sub",
2941
+ "isExpression": false,
2942
+ "asc": true,
2943
+ "nulls": "last"
2944
+ }
2945
+ ],
2946
+ "isUnique": false,
2947
+ "concurrently": false,
2948
+ "method": "btree",
2949
+ "with": {}
2950
+ }
2951
+ },
2952
+ "foreignKeys": {
2953
+ "user_identities_user_id_users_id_fk": {
2954
+ "name": "user_identities_user_id_users_id_fk",
2955
+ "tableFrom": "user_identities",
2956
+ "tableTo": "users",
2957
+ "columnsFrom": [
2958
+ "user_id"
2959
+ ],
2960
+ "columnsTo": [
2961
+ "id"
2962
+ ],
2963
+ "onDelete": "cascade",
2964
+ "onUpdate": "no action"
2965
+ },
2966
+ "user_identities_provider_id_identity_providers_id_fk": {
2967
+ "name": "user_identities_provider_id_identity_providers_id_fk",
2968
+ "tableFrom": "user_identities",
2969
+ "tableTo": "identity_providers",
2970
+ "columnsFrom": [
2971
+ "provider_id"
2972
+ ],
2973
+ "columnsTo": [
2974
+ "id"
2975
+ ],
2976
+ "onDelete": "cascade",
2977
+ "onUpdate": "no action"
2978
+ }
2979
+ },
2980
+ "compositePrimaryKeys": {},
2981
+ "uniqueConstraints": {},
2982
+ "policies": {},
2983
+ "checkConstraints": {},
2984
+ "isRLSEnabled": false
2985
+ },
2986
+ "public.user_sessions": {
2987
+ "name": "user_sessions",
2988
+ "schema": "",
2989
+ "columns": {
2990
+ "id": {
2991
+ "name": "id",
2992
+ "type": "uuid",
2993
+ "primaryKey": true,
2994
+ "notNull": true,
2995
+ "default": "gen_random_uuid()"
2996
+ },
2997
+ "user_id": {
2998
+ "name": "user_id",
2999
+ "type": "uuid",
3000
+ "primaryKey": false,
3001
+ "notNull": true
3002
+ },
3003
+ "refresh_token_id": {
3004
+ "name": "refresh_token_id",
3005
+ "type": "text",
3006
+ "primaryKey": false,
3007
+ "notNull": true
3008
+ },
3009
+ "device_fingerprint": {
3010
+ "name": "device_fingerprint",
3011
+ "type": "text",
3012
+ "primaryKey": false,
3013
+ "notNull": false
3014
+ },
3015
+ "ip_address": {
3016
+ "name": "ip_address",
3017
+ "type": "text",
3018
+ "primaryKey": false,
3019
+ "notNull": false
3020
+ },
3021
+ "user_agent": {
3022
+ "name": "user_agent",
3023
+ "type": "text",
3024
+ "primaryKey": false,
3025
+ "notNull": false
3026
+ },
3027
+ "last_seen_at": {
3028
+ "name": "last_seen_at",
3029
+ "type": "timestamp with time zone",
3030
+ "primaryKey": false,
3031
+ "notNull": true,
3032
+ "default": "now()"
3033
+ },
3034
+ "expires_at": {
3035
+ "name": "expires_at",
3036
+ "type": "timestamp with time zone",
3037
+ "primaryKey": false,
3038
+ "notNull": true
3039
+ },
3040
+ "revoked_at": {
3041
+ "name": "revoked_at",
3042
+ "type": "timestamp with time zone",
3043
+ "primaryKey": false,
3044
+ "notNull": false
3045
+ },
3046
+ "created_at": {
3047
+ "name": "created_at",
3048
+ "type": "timestamp with time zone",
3049
+ "primaryKey": false,
3050
+ "notNull": true,
3051
+ "default": "now()"
3052
+ }
3053
+ },
3054
+ "indexes": {
3055
+ "user_sessions_user_idx": {
3056
+ "name": "user_sessions_user_idx",
3057
+ "columns": [
3058
+ {
3059
+ "expression": "user_id",
3060
+ "isExpression": false,
3061
+ "asc": true,
3062
+ "nulls": "last"
3063
+ }
3064
+ ],
3065
+ "isUnique": false,
3066
+ "concurrently": false,
3067
+ "method": "btree",
3068
+ "with": {}
3069
+ },
3070
+ "user_sessions_refresh_token_idx": {
3071
+ "name": "user_sessions_refresh_token_idx",
3072
+ "columns": [
3073
+ {
3074
+ "expression": "refresh_token_id",
3075
+ "isExpression": false,
3076
+ "asc": true,
3077
+ "nulls": "last"
3078
+ }
3079
+ ],
3080
+ "isUnique": false,
3081
+ "concurrently": false,
3082
+ "method": "btree",
3083
+ "with": {}
3084
+ }
3085
+ },
3086
+ "foreignKeys": {
3087
+ "user_sessions_user_id_users_id_fk": {
3088
+ "name": "user_sessions_user_id_users_id_fk",
3089
+ "tableFrom": "user_sessions",
3090
+ "tableTo": "users",
3091
+ "columnsFrom": [
3092
+ "user_id"
3093
+ ],
3094
+ "columnsTo": [
3095
+ "id"
3096
+ ],
3097
+ "onDelete": "cascade",
3098
+ "onUpdate": "no action"
3099
+ }
3100
+ },
3101
+ "compositePrimaryKeys": {},
3102
+ "uniqueConstraints": {},
3103
+ "policies": {},
3104
+ "checkConstraints": {},
3105
+ "isRLSEnabled": false
3106
+ },
3107
+ "public.users": {
3108
+ "name": "users",
3109
+ "schema": "",
3110
+ "columns": {
3111
+ "id": {
3112
+ "name": "id",
3113
+ "type": "uuid",
3114
+ "primaryKey": true,
3115
+ "notNull": true,
3116
+ "default": "gen_random_uuid()"
3117
+ },
3118
+ "zitadel_user_id": {
3119
+ "name": "zitadel_user_id",
3120
+ "type": "text",
3121
+ "primaryKey": false,
3122
+ "notNull": false
3123
+ },
3124
+ "email": {
3125
+ "name": "email",
3126
+ "type": "text",
3127
+ "primaryKey": false,
3128
+ "notNull": true
3129
+ },
3130
+ "username": {
3131
+ "name": "username",
3132
+ "type": "text",
3133
+ "primaryKey": false,
3134
+ "notNull": true
3135
+ },
3136
+ "name": {
3137
+ "name": "name",
3138
+ "type": "text",
3139
+ "primaryKey": false,
3140
+ "notNull": false
3141
+ },
3142
+ "avatar_url": {
3143
+ "name": "avatar_url",
3144
+ "type": "text",
3145
+ "primaryKey": false,
3146
+ "notNull": false
3147
+ },
3148
+ "email_verified": {
3149
+ "name": "email_verified",
3150
+ "type": "boolean",
3151
+ "primaryKey": false,
3152
+ "notNull": true,
3153
+ "default": false
3154
+ },
3155
+ "email_verified_token": {
3156
+ "name": "email_verified_token",
3157
+ "type": "text",
3158
+ "primaryKey": false,
3159
+ "notNull": false
3160
+ },
3161
+ "provider": {
3162
+ "name": "provider",
3163
+ "type": "text",
3164
+ "primaryKey": false,
3165
+ "notNull": true,
3166
+ "default": "'password'"
3167
+ },
3168
+ "plan": {
3169
+ "name": "plan",
3170
+ "type": "text",
3171
+ "primaryKey": false,
3172
+ "notNull": true,
3173
+ "default": "'free'"
3174
+ },
3175
+ "role": {
3176
+ "name": "role",
3177
+ "type": "text",
3178
+ "primaryKey": false,
3179
+ "notNull": true,
3180
+ "default": "'user'"
3181
+ },
3182
+ "is_active": {
3183
+ "name": "is_active",
3184
+ "type": "boolean",
3185
+ "primaryKey": false,
3186
+ "notNull": true,
3187
+ "default": true
3188
+ },
3189
+ "account_review_required": {
3190
+ "name": "account_review_required",
3191
+ "type": "boolean",
3192
+ "primaryKey": false,
3193
+ "notNull": true,
3194
+ "default": false
3195
+ },
3196
+ "default_org_id": {
3197
+ "name": "default_org_id",
3198
+ "type": "uuid",
3199
+ "primaryKey": false,
3200
+ "notNull": false
3201
+ },
3202
+ "phone_number": {
3203
+ "name": "phone_number",
3204
+ "type": "text",
3205
+ "primaryKey": false,
3206
+ "notNull": false
3207
+ },
3208
+ "phone_verified": {
3209
+ "name": "phone_verified",
3210
+ "type": "boolean",
3211
+ "primaryKey": false,
3212
+ "notNull": true,
3213
+ "default": false
3214
+ },
3215
+ "metadata": {
3216
+ "name": "metadata",
3217
+ "type": "jsonb",
3218
+ "primaryKey": false,
3219
+ "notNull": true,
3220
+ "default": "'{}'::jsonb"
3221
+ },
3222
+ "password_hash": {
3223
+ "name": "password_hash",
3224
+ "type": "text",
3225
+ "primaryKey": false,
3226
+ "notNull": false
3227
+ },
3228
+ "totp_secret": {
3229
+ "name": "totp_secret",
3230
+ "type": "text",
3231
+ "primaryKey": false,
3232
+ "notNull": false
3233
+ },
3234
+ "totp_enabled": {
3235
+ "name": "totp_enabled",
3236
+ "type": "boolean",
3237
+ "primaryKey": false,
3238
+ "notNull": true,
3239
+ "default": false
3240
+ },
3241
+ "totp_verified_at": {
3242
+ "name": "totp_verified_at",
3243
+ "type": "timestamp with time zone",
3244
+ "primaryKey": false,
3245
+ "notNull": false
3246
+ },
3247
+ "totp_last_step": {
3248
+ "name": "totp_last_step",
3249
+ "type": "bigint",
3250
+ "primaryKey": false,
3251
+ "notNull": false
3252
+ },
3253
+ "failed_login_attempts": {
3254
+ "name": "failed_login_attempts",
3255
+ "type": "integer",
3256
+ "primaryKey": false,
3257
+ "notNull": true,
3258
+ "default": 0
3259
+ },
3260
+ "locked_until": {
3261
+ "name": "locked_until",
3262
+ "type": "timestamp with time zone",
3263
+ "primaryKey": false,
3264
+ "notNull": false
3265
+ },
3266
+ "created_at": {
3267
+ "name": "created_at",
3268
+ "type": "timestamp with time zone",
3269
+ "primaryKey": false,
3270
+ "notNull": true,
3271
+ "default": "now()"
3272
+ },
3273
+ "updated_at": {
3274
+ "name": "updated_at",
3275
+ "type": "timestamp with time zone",
3276
+ "primaryKey": false,
3277
+ "notNull": true,
3278
+ "default": "now()"
3279
+ }
3280
+ },
3281
+ "indexes": {
3282
+ "users_email_idx": {
3283
+ "name": "users_email_idx",
3284
+ "columns": [
3285
+ {
3286
+ "expression": "email",
3287
+ "isExpression": false,
3288
+ "asc": true,
3289
+ "nulls": "last"
3290
+ }
3291
+ ],
3292
+ "isUnique": false,
3293
+ "concurrently": false,
3294
+ "method": "btree",
3295
+ "with": {}
3296
+ },
3297
+ "users_zitadel_idx": {
3298
+ "name": "users_zitadel_idx",
3299
+ "columns": [
3300
+ {
3301
+ "expression": "zitadel_user_id",
3302
+ "isExpression": false,
3303
+ "asc": true,
3304
+ "nulls": "last"
3305
+ }
3306
+ ],
3307
+ "isUnique": false,
3308
+ "concurrently": false,
3309
+ "method": "btree",
3310
+ "with": {}
3311
+ },
3312
+ "users_default_org_idx": {
3313
+ "name": "users_default_org_idx",
3314
+ "columns": [
3315
+ {
3316
+ "expression": "default_org_id",
3317
+ "isExpression": false,
3318
+ "asc": true,
3319
+ "nulls": "last"
3320
+ }
3321
+ ],
3322
+ "isUnique": false,
3323
+ "concurrently": false,
3324
+ "method": "btree",
3325
+ "with": {}
3326
+ }
3327
+ },
3328
+ "foreignKeys": {
3329
+ "users_default_org_id_organizations_id_fk": {
3330
+ "name": "users_default_org_id_organizations_id_fk",
3331
+ "tableFrom": "users",
3332
+ "tableTo": "organizations",
3333
+ "columnsFrom": [
3334
+ "default_org_id"
3335
+ ],
3336
+ "columnsTo": [
3337
+ "id"
3338
+ ],
3339
+ "onDelete": "set null",
3340
+ "onUpdate": "no action"
3341
+ }
3342
+ },
3343
+ "compositePrimaryKeys": {},
3344
+ "uniqueConstraints": {
3345
+ "users_zitadel_user_id_unique": {
3346
+ "name": "users_zitadel_user_id_unique",
3347
+ "nullsNotDistinct": false,
3348
+ "columns": [
3349
+ "zitadel_user_id"
3350
+ ]
3351
+ },
3352
+ "users_email_unique": {
3353
+ "name": "users_email_unique",
3354
+ "nullsNotDistinct": false,
3355
+ "columns": [
3356
+ "email"
3357
+ ]
3358
+ },
3359
+ "users_username_unique": {
3360
+ "name": "users_username_unique",
3361
+ "nullsNotDistinct": false,
3362
+ "columns": [
3363
+ "username"
3364
+ ]
3365
+ }
3366
+ },
3367
+ "policies": {},
3368
+ "checkConstraints": {
3369
+ "users_platform_role_check": {
3370
+ "name": "users_platform_role_check",
3371
+ "value": "role in ('owner', 'user')"
3372
+ }
3373
+ },
3374
+ "isRLSEnabled": false
3375
+ },
3376
+ "public.webauthn_credentials": {
3377
+ "name": "webauthn_credentials",
3378
+ "schema": "",
3379
+ "columns": {
3380
+ "id": {
3381
+ "name": "id",
3382
+ "type": "uuid",
3383
+ "primaryKey": true,
3384
+ "notNull": true,
3385
+ "default": "gen_random_uuid()"
3386
+ },
3387
+ "user_id": {
3388
+ "name": "user_id",
3389
+ "type": "uuid",
3390
+ "primaryKey": false,
3391
+ "notNull": true
3392
+ },
3393
+ "credential_id": {
3394
+ "name": "credential_id",
3395
+ "type": "text",
3396
+ "primaryKey": false,
3397
+ "notNull": true
3398
+ },
3399
+ "public_key": {
3400
+ "name": "public_key",
3401
+ "type": "text",
3402
+ "primaryKey": false,
3403
+ "notNull": true
3404
+ },
3405
+ "counter": {
3406
+ "name": "counter",
3407
+ "type": "integer",
3408
+ "primaryKey": false,
3409
+ "notNull": true,
3410
+ "default": 0
3411
+ },
3412
+ "transports": {
3413
+ "name": "transports",
3414
+ "type": "text[]",
3415
+ "primaryKey": false,
3416
+ "notNull": true,
3417
+ "default": "'{}'::text[]"
3418
+ },
3419
+ "aaguid": {
3420
+ "name": "aaguid",
3421
+ "type": "text",
3422
+ "primaryKey": false,
3423
+ "notNull": false
3424
+ },
3425
+ "device_name": {
3426
+ "name": "device_name",
3427
+ "type": "text",
3428
+ "primaryKey": false,
3429
+ "notNull": false
3430
+ },
3431
+ "last_used_at": {
3432
+ "name": "last_used_at",
3433
+ "type": "timestamp with time zone",
3434
+ "primaryKey": false,
3435
+ "notNull": false
3436
+ },
3437
+ "created_at": {
3438
+ "name": "created_at",
3439
+ "type": "timestamp with time zone",
3440
+ "primaryKey": false,
3441
+ "notNull": true,
3442
+ "default": "now()"
3443
+ }
3444
+ },
3445
+ "indexes": {
3446
+ "webauthn_credentials_user_idx": {
3447
+ "name": "webauthn_credentials_user_idx",
3448
+ "columns": [
3449
+ {
3450
+ "expression": "user_id",
3451
+ "isExpression": false,
3452
+ "asc": true,
3453
+ "nulls": "last"
3454
+ }
3455
+ ],
3456
+ "isUnique": false,
3457
+ "concurrently": false,
3458
+ "method": "btree",
3459
+ "with": {}
3460
+ }
3461
+ },
3462
+ "foreignKeys": {
3463
+ "webauthn_credentials_user_id_users_id_fk": {
3464
+ "name": "webauthn_credentials_user_id_users_id_fk",
3465
+ "tableFrom": "webauthn_credentials",
3466
+ "tableTo": "users",
3467
+ "columnsFrom": [
3468
+ "user_id"
3469
+ ],
3470
+ "columnsTo": [
3471
+ "id"
3472
+ ],
3473
+ "onDelete": "cascade",
3474
+ "onUpdate": "no action"
3475
+ }
3476
+ },
3477
+ "compositePrimaryKeys": {},
3478
+ "uniqueConstraints": {
3479
+ "webauthn_credentials_credential_id_unique": {
3480
+ "name": "webauthn_credentials_credential_id_unique",
3481
+ "nullsNotDistinct": false,
3482
+ "columns": [
3483
+ "credential_id"
3484
+ ]
3485
+ }
3486
+ },
3487
+ "policies": {},
3488
+ "checkConstraints": {},
3489
+ "isRLSEnabled": false
3490
+ },
3491
+ "public.webhook_deliveries": {
3492
+ "name": "webhook_deliveries",
3493
+ "schema": "",
3494
+ "columns": {
3495
+ "id": {
3496
+ "name": "id",
3497
+ "type": "uuid",
3498
+ "primaryKey": true,
3499
+ "notNull": true,
3500
+ "default": "gen_random_uuid()"
3501
+ },
3502
+ "endpoint_id": {
3503
+ "name": "endpoint_id",
3504
+ "type": "uuid",
3505
+ "primaryKey": false,
3506
+ "notNull": true
3507
+ },
3508
+ "event_type": {
3509
+ "name": "event_type",
3510
+ "type": "text",
3511
+ "primaryKey": false,
3512
+ "notNull": true
3513
+ },
3514
+ "payload": {
3515
+ "name": "payload",
3516
+ "type": "jsonb",
3517
+ "primaryKey": false,
3518
+ "notNull": true,
3519
+ "default": "'{}'::jsonb"
3520
+ },
3521
+ "status": {
3522
+ "name": "status",
3523
+ "type": "text",
3524
+ "primaryKey": false,
3525
+ "notNull": true,
3526
+ "default": "'pending'"
3527
+ },
3528
+ "attempts": {
3529
+ "name": "attempts",
3530
+ "type": "integer",
3531
+ "primaryKey": false,
3532
+ "notNull": true,
3533
+ "default": 0
3534
+ },
3535
+ "response_status": {
3536
+ "name": "response_status",
3537
+ "type": "integer",
3538
+ "primaryKey": false,
3539
+ "notNull": false
3540
+ },
3541
+ "response_body": {
3542
+ "name": "response_body",
3543
+ "type": "text",
3544
+ "primaryKey": false,
3545
+ "notNull": false
3546
+ },
3547
+ "last_attempt_at": {
3548
+ "name": "last_attempt_at",
3549
+ "type": "timestamp with time zone",
3550
+ "primaryKey": false,
3551
+ "notNull": false
3552
+ },
3553
+ "created_at": {
3554
+ "name": "created_at",
3555
+ "type": "timestamp with time zone",
3556
+ "primaryKey": false,
3557
+ "notNull": true,
3558
+ "default": "now()"
3559
+ }
3560
+ },
3561
+ "indexes": {
3562
+ "webhook_deliveries_endpoint_idx": {
3563
+ "name": "webhook_deliveries_endpoint_idx",
3564
+ "columns": [
3565
+ {
3566
+ "expression": "endpoint_id",
3567
+ "isExpression": false,
3568
+ "asc": true,
3569
+ "nulls": "last"
3570
+ }
3571
+ ],
3572
+ "isUnique": false,
3573
+ "concurrently": false,
3574
+ "method": "btree",
3575
+ "with": {}
3576
+ },
3577
+ "webhook_deliveries_status_idx": {
3578
+ "name": "webhook_deliveries_status_idx",
3579
+ "columns": [
3580
+ {
3581
+ "expression": "status",
3582
+ "isExpression": false,
3583
+ "asc": true,
3584
+ "nulls": "last"
3585
+ }
3586
+ ],
3587
+ "isUnique": false,
3588
+ "concurrently": false,
3589
+ "method": "btree",
3590
+ "with": {}
3591
+ }
3592
+ },
3593
+ "foreignKeys": {
3594
+ "webhook_deliveries_endpoint_id_webhook_endpoints_id_fk": {
3595
+ "name": "webhook_deliveries_endpoint_id_webhook_endpoints_id_fk",
3596
+ "tableFrom": "webhook_deliveries",
3597
+ "tableTo": "webhook_endpoints",
3598
+ "columnsFrom": [
3599
+ "endpoint_id"
3600
+ ],
3601
+ "columnsTo": [
3602
+ "id"
3603
+ ],
3604
+ "onDelete": "cascade",
3605
+ "onUpdate": "no action"
3606
+ }
3607
+ },
3608
+ "compositePrimaryKeys": {},
3609
+ "uniqueConstraints": {},
3610
+ "policies": {},
3611
+ "checkConstraints": {},
3612
+ "isRLSEnabled": false
3613
+ },
3614
+ "public.webhook_endpoints": {
3615
+ "name": "webhook_endpoints",
3616
+ "schema": "",
3617
+ "columns": {
3618
+ "id": {
3619
+ "name": "id",
3620
+ "type": "uuid",
3621
+ "primaryKey": true,
3622
+ "notNull": true,
3623
+ "default": "gen_random_uuid()"
3624
+ },
3625
+ "app_id": {
3626
+ "name": "app_id",
3627
+ "type": "uuid",
3628
+ "primaryKey": false,
3629
+ "notNull": false
3630
+ },
3631
+ "url": {
3632
+ "name": "url",
3633
+ "type": "text",
3634
+ "primaryKey": false,
3635
+ "notNull": true
3636
+ },
3637
+ "description": {
3638
+ "name": "description",
3639
+ "type": "text",
3640
+ "primaryKey": false,
3641
+ "notNull": false
3642
+ },
3643
+ "events": {
3644
+ "name": "events",
3645
+ "type": "text[]",
3646
+ "primaryKey": false,
3647
+ "notNull": true,
3648
+ "default": "'{}'::text[]"
3649
+ },
3650
+ "secret": {
3651
+ "name": "secret",
3652
+ "type": "text",
3653
+ "primaryKey": false,
3654
+ "notNull": true
3655
+ },
3656
+ "is_active": {
3657
+ "name": "is_active",
3658
+ "type": "boolean",
3659
+ "primaryKey": false,
3660
+ "notNull": true,
3661
+ "default": true
3662
+ },
3663
+ "created_at": {
3664
+ "name": "created_at",
3665
+ "type": "timestamp with time zone",
3666
+ "primaryKey": false,
3667
+ "notNull": true,
3668
+ "default": "now()"
3669
+ },
3670
+ "updated_at": {
3671
+ "name": "updated_at",
3672
+ "type": "timestamp with time zone",
3673
+ "primaryKey": false,
3674
+ "notNull": true,
3675
+ "default": "now()"
3676
+ }
3677
+ },
3678
+ "indexes": {
3679
+ "webhook_endpoints_app_idx": {
3680
+ "name": "webhook_endpoints_app_idx",
3681
+ "columns": [
3682
+ {
3683
+ "expression": "app_id",
3684
+ "isExpression": false,
3685
+ "asc": true,
3686
+ "nulls": "last"
3687
+ }
3688
+ ],
3689
+ "isUnique": false,
3690
+ "concurrently": false,
3691
+ "method": "btree",
3692
+ "with": {}
3693
+ }
3694
+ },
3695
+ "foreignKeys": {
3696
+ "webhook_endpoints_app_id_applications_id_fk": {
3697
+ "name": "webhook_endpoints_app_id_applications_id_fk",
3698
+ "tableFrom": "webhook_endpoints",
3699
+ "tableTo": "applications",
3700
+ "columnsFrom": [
3701
+ "app_id"
3702
+ ],
3703
+ "columnsTo": [
3704
+ "id"
3705
+ ],
3706
+ "onDelete": "cascade",
3707
+ "onUpdate": "no action"
3708
+ }
3709
+ },
3710
+ "compositePrimaryKeys": {},
3711
+ "uniqueConstraints": {},
3712
+ "policies": {},
3713
+ "checkConstraints": {},
3714
+ "isRLSEnabled": false
3715
+ },
3716
+ "public.workflow_runs": {
3717
+ "name": "workflow_runs",
3718
+ "schema": "",
3719
+ "columns": {
3720
+ "id": {
3721
+ "name": "id",
3722
+ "type": "uuid",
3723
+ "primaryKey": true,
3724
+ "notNull": true,
3725
+ "default": "gen_random_uuid()"
3726
+ },
3727
+ "workflow_id": {
3728
+ "name": "workflow_id",
3729
+ "type": "uuid",
3730
+ "primaryKey": false,
3731
+ "notNull": true
3732
+ },
3733
+ "trigger_event": {
3734
+ "name": "trigger_event",
3735
+ "type": "text",
3736
+ "primaryKey": false,
3737
+ "notNull": true
3738
+ },
3739
+ "payload": {
3740
+ "name": "payload",
3741
+ "type": "jsonb",
3742
+ "primaryKey": false,
3743
+ "notNull": true,
3744
+ "default": "'{}'::jsonb"
3745
+ },
3746
+ "status": {
3747
+ "name": "status",
3748
+ "type": "text",
3749
+ "primaryKey": false,
3750
+ "notNull": true,
3751
+ "default": "'pending'"
3752
+ },
3753
+ "started_at": {
3754
+ "name": "started_at",
3755
+ "type": "timestamp with time zone",
3756
+ "primaryKey": false,
3757
+ "notNull": false
3758
+ },
3759
+ "finished_at": {
3760
+ "name": "finished_at",
3761
+ "type": "timestamp with time zone",
3762
+ "primaryKey": false,
3763
+ "notNull": false
3764
+ },
3765
+ "log": {
3766
+ "name": "log",
3767
+ "type": "jsonb",
3768
+ "primaryKey": false,
3769
+ "notNull": true,
3770
+ "default": "'[]'::jsonb"
3771
+ }
3772
+ },
3773
+ "indexes": {
3774
+ "workflow_runs_workflow_idx": {
3775
+ "name": "workflow_runs_workflow_idx",
3776
+ "columns": [
3777
+ {
3778
+ "expression": "workflow_id",
3779
+ "isExpression": false,
3780
+ "asc": true,
3781
+ "nulls": "last"
3782
+ }
3783
+ ],
3784
+ "isUnique": false,
3785
+ "concurrently": false,
3786
+ "method": "btree",
3787
+ "with": {}
3788
+ }
3789
+ },
3790
+ "foreignKeys": {
3791
+ "workflow_runs_workflow_id_workflows_id_fk": {
3792
+ "name": "workflow_runs_workflow_id_workflows_id_fk",
3793
+ "tableFrom": "workflow_runs",
3794
+ "tableTo": "workflows",
3795
+ "columnsFrom": [
3796
+ "workflow_id"
3797
+ ],
3798
+ "columnsTo": [
3799
+ "id"
3800
+ ],
3801
+ "onDelete": "cascade",
3802
+ "onUpdate": "no action"
3803
+ }
3804
+ },
3805
+ "compositePrimaryKeys": {},
3806
+ "uniqueConstraints": {},
3807
+ "policies": {},
3808
+ "checkConstraints": {},
3809
+ "isRLSEnabled": false
3810
+ },
3811
+ "public.workflows": {
3812
+ "name": "workflows",
3813
+ "schema": "",
3814
+ "columns": {
3815
+ "id": {
3816
+ "name": "id",
3817
+ "type": "uuid",
3818
+ "primaryKey": true,
3819
+ "notNull": true,
3820
+ "default": "gen_random_uuid()"
3821
+ },
3822
+ "org_id": {
3823
+ "name": "org_id",
3824
+ "type": "uuid",
3825
+ "primaryKey": false,
3826
+ "notNull": false
3827
+ },
3828
+ "name": {
3829
+ "name": "name",
3830
+ "type": "text",
3831
+ "primaryKey": false,
3832
+ "notNull": true
3833
+ },
3834
+ "trigger": {
3835
+ "name": "trigger",
3836
+ "type": "text",
3837
+ "primaryKey": false,
3838
+ "notNull": true
3839
+ },
3840
+ "definition": {
3841
+ "name": "definition",
3842
+ "type": "jsonb",
3843
+ "primaryKey": false,
3844
+ "notNull": true,
3845
+ "default": "'{}'::jsonb"
3846
+ },
3847
+ "is_active": {
3848
+ "name": "is_active",
3849
+ "type": "boolean",
3850
+ "primaryKey": false,
3851
+ "notNull": true,
3852
+ "default": true
3853
+ },
3854
+ "created_at": {
3855
+ "name": "created_at",
3856
+ "type": "timestamp with time zone",
3857
+ "primaryKey": false,
3858
+ "notNull": true,
3859
+ "default": "now()"
3860
+ },
3861
+ "updated_at": {
3862
+ "name": "updated_at",
3863
+ "type": "timestamp with time zone",
3864
+ "primaryKey": false,
3865
+ "notNull": true,
3866
+ "default": "now()"
3867
+ }
3868
+ },
3869
+ "indexes": {
3870
+ "workflows_trigger_idx": {
3871
+ "name": "workflows_trigger_idx",
3872
+ "columns": [
3873
+ {
3874
+ "expression": "trigger",
3875
+ "isExpression": false,
3876
+ "asc": true,
3877
+ "nulls": "last"
3878
+ }
3879
+ ],
3880
+ "isUnique": false,
3881
+ "concurrently": false,
3882
+ "method": "btree",
3883
+ "with": {}
3884
+ }
3885
+ },
3886
+ "foreignKeys": {
3887
+ "workflows_org_id_organizations_id_fk": {
3888
+ "name": "workflows_org_id_organizations_id_fk",
3889
+ "tableFrom": "workflows",
3890
+ "tableTo": "organizations",
3891
+ "columnsFrom": [
3892
+ "org_id"
3893
+ ],
3894
+ "columnsTo": [
3895
+ "id"
3896
+ ],
3897
+ "onDelete": "cascade",
3898
+ "onUpdate": "no action"
3899
+ }
3900
+ },
3901
+ "compositePrimaryKeys": {},
3902
+ "uniqueConstraints": {},
3903
+ "policies": {},
3904
+ "checkConstraints": {},
3905
+ "isRLSEnabled": false
3906
+ }
3907
+ },
3908
+ "enums": {},
3909
+ "schemas": {},
3910
+ "sequences": {},
3911
+ "roles": {},
3912
+ "policies": {},
3913
+ "views": {},
3914
+ "_meta": {
3915
+ "columns": {},
3916
+ "schemas": {},
3917
+ "tables": {}
3918
+ }
3919
+ }