@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,3891 @@
1
+ {
2
+ "id": "c7f8384e-434b-4829-92c5-b72f0daeab31",
3
+ "prevId": "fc6875a6-31ab-4607-bda7-9b5666a28860",
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
+ "expires_at": {
1192
+ "name": "expires_at",
1193
+ "type": "timestamp with time zone",
1194
+ "primaryKey": false,
1195
+ "notNull": true
1196
+ },
1197
+ "used_at": {
1198
+ "name": "used_at",
1199
+ "type": "timestamp with time zone",
1200
+ "primaryKey": false,
1201
+ "notNull": false
1202
+ },
1203
+ "created_at": {
1204
+ "name": "created_at",
1205
+ "type": "timestamp with time zone",
1206
+ "primaryKey": false,
1207
+ "notNull": true,
1208
+ "default": "now()"
1209
+ }
1210
+ },
1211
+ "indexes": {
1212
+ "oauth2_authorization_codes_app_idx": {
1213
+ "name": "oauth2_authorization_codes_app_idx",
1214
+ "columns": [
1215
+ {
1216
+ "expression": "app_id",
1217
+ "isExpression": false,
1218
+ "asc": true,
1219
+ "nulls": "last"
1220
+ }
1221
+ ],
1222
+ "isUnique": false,
1223
+ "concurrently": false,
1224
+ "method": "btree",
1225
+ "with": {}
1226
+ },
1227
+ "oauth2_authorization_codes_user_idx": {
1228
+ "name": "oauth2_authorization_codes_user_idx",
1229
+ "columns": [
1230
+ {
1231
+ "expression": "user_id",
1232
+ "isExpression": false,
1233
+ "asc": true,
1234
+ "nulls": "last"
1235
+ }
1236
+ ],
1237
+ "isUnique": false,
1238
+ "concurrently": false,
1239
+ "method": "btree",
1240
+ "with": {}
1241
+ },
1242
+ "oauth2_authorization_codes_hash_idx": {
1243
+ "name": "oauth2_authorization_codes_hash_idx",
1244
+ "columns": [
1245
+ {
1246
+ "expression": "code_hash",
1247
+ "isExpression": false,
1248
+ "asc": true,
1249
+ "nulls": "last"
1250
+ }
1251
+ ],
1252
+ "isUnique": false,
1253
+ "concurrently": false,
1254
+ "method": "btree",
1255
+ "with": {}
1256
+ }
1257
+ },
1258
+ "foreignKeys": {
1259
+ "oauth2_authorization_codes_app_id_applications_id_fk": {
1260
+ "name": "oauth2_authorization_codes_app_id_applications_id_fk",
1261
+ "tableFrom": "oauth2_authorization_codes",
1262
+ "tableTo": "applications",
1263
+ "columnsFrom": [
1264
+ "app_id"
1265
+ ],
1266
+ "columnsTo": [
1267
+ "id"
1268
+ ],
1269
+ "onDelete": "cascade",
1270
+ "onUpdate": "no action"
1271
+ },
1272
+ "oauth2_authorization_codes_user_id_users_id_fk": {
1273
+ "name": "oauth2_authorization_codes_user_id_users_id_fk",
1274
+ "tableFrom": "oauth2_authorization_codes",
1275
+ "tableTo": "users",
1276
+ "columnsFrom": [
1277
+ "user_id"
1278
+ ],
1279
+ "columnsTo": [
1280
+ "id"
1281
+ ],
1282
+ "onDelete": "cascade",
1283
+ "onUpdate": "no action"
1284
+ }
1285
+ },
1286
+ "compositePrimaryKeys": {},
1287
+ "uniqueConstraints": {},
1288
+ "policies": {},
1289
+ "checkConstraints": {},
1290
+ "isRLSEnabled": false
1291
+ },
1292
+ "public.oauth2_consents": {
1293
+ "name": "oauth2_consents",
1294
+ "schema": "",
1295
+ "columns": {
1296
+ "id": {
1297
+ "name": "id",
1298
+ "type": "uuid",
1299
+ "primaryKey": true,
1300
+ "notNull": true,
1301
+ "default": "gen_random_uuid()"
1302
+ },
1303
+ "app_id": {
1304
+ "name": "app_id",
1305
+ "type": "uuid",
1306
+ "primaryKey": false,
1307
+ "notNull": true
1308
+ },
1309
+ "user_id": {
1310
+ "name": "user_id",
1311
+ "type": "uuid",
1312
+ "primaryKey": false,
1313
+ "notNull": true
1314
+ },
1315
+ "scopes": {
1316
+ "name": "scopes",
1317
+ "type": "text[]",
1318
+ "primaryKey": false,
1319
+ "notNull": true,
1320
+ "default": "'{}'::text[]"
1321
+ },
1322
+ "granted_at": {
1323
+ "name": "granted_at",
1324
+ "type": "timestamp with time zone",
1325
+ "primaryKey": false,
1326
+ "notNull": true,
1327
+ "default": "now()"
1328
+ },
1329
+ "revoked_at": {
1330
+ "name": "revoked_at",
1331
+ "type": "timestamp with time zone",
1332
+ "primaryKey": false,
1333
+ "notNull": false
1334
+ }
1335
+ },
1336
+ "indexes": {
1337
+ "oauth2_consents_app_idx": {
1338
+ "name": "oauth2_consents_app_idx",
1339
+ "columns": [
1340
+ {
1341
+ "expression": "app_id",
1342
+ "isExpression": false,
1343
+ "asc": true,
1344
+ "nulls": "last"
1345
+ }
1346
+ ],
1347
+ "isUnique": false,
1348
+ "concurrently": false,
1349
+ "method": "btree",
1350
+ "with": {}
1351
+ },
1352
+ "oauth2_consents_user_idx": {
1353
+ "name": "oauth2_consents_user_idx",
1354
+ "columns": [
1355
+ {
1356
+ "expression": "user_id",
1357
+ "isExpression": false,
1358
+ "asc": true,
1359
+ "nulls": "last"
1360
+ }
1361
+ ],
1362
+ "isUnique": false,
1363
+ "concurrently": false,
1364
+ "method": "btree",
1365
+ "with": {}
1366
+ }
1367
+ },
1368
+ "foreignKeys": {
1369
+ "oauth2_consents_app_id_applications_id_fk": {
1370
+ "name": "oauth2_consents_app_id_applications_id_fk",
1371
+ "tableFrom": "oauth2_consents",
1372
+ "tableTo": "applications",
1373
+ "columnsFrom": [
1374
+ "app_id"
1375
+ ],
1376
+ "columnsTo": [
1377
+ "id"
1378
+ ],
1379
+ "onDelete": "cascade",
1380
+ "onUpdate": "no action"
1381
+ },
1382
+ "oauth2_consents_user_id_users_id_fk": {
1383
+ "name": "oauth2_consents_user_id_users_id_fk",
1384
+ "tableFrom": "oauth2_consents",
1385
+ "tableTo": "users",
1386
+ "columnsFrom": [
1387
+ "user_id"
1388
+ ],
1389
+ "columnsTo": [
1390
+ "id"
1391
+ ],
1392
+ "onDelete": "cascade",
1393
+ "onUpdate": "no action"
1394
+ }
1395
+ },
1396
+ "compositePrimaryKeys": {},
1397
+ "uniqueConstraints": {
1398
+ "oauth2_consents_unique": {
1399
+ "name": "oauth2_consents_unique",
1400
+ "nullsNotDistinct": false,
1401
+ "columns": [
1402
+ "app_id",
1403
+ "user_id"
1404
+ ]
1405
+ }
1406
+ },
1407
+ "policies": {},
1408
+ "checkConstraints": {},
1409
+ "isRLSEnabled": false
1410
+ },
1411
+ "public.oidc_connections": {
1412
+ "name": "oidc_connections",
1413
+ "schema": "",
1414
+ "columns": {
1415
+ "id": {
1416
+ "name": "id",
1417
+ "type": "uuid",
1418
+ "primaryKey": true,
1419
+ "notNull": true,
1420
+ "default": "gen_random_uuid()"
1421
+ },
1422
+ "org_id": {
1423
+ "name": "org_id",
1424
+ "type": "uuid",
1425
+ "primaryKey": false,
1426
+ "notNull": true
1427
+ },
1428
+ "name": {
1429
+ "name": "name",
1430
+ "type": "text",
1431
+ "primaryKey": false,
1432
+ "notNull": true
1433
+ },
1434
+ "issuer": {
1435
+ "name": "issuer",
1436
+ "type": "text",
1437
+ "primaryKey": false,
1438
+ "notNull": true
1439
+ },
1440
+ "authorization_endpoint": {
1441
+ "name": "authorization_endpoint",
1442
+ "type": "text",
1443
+ "primaryKey": false,
1444
+ "notNull": true
1445
+ },
1446
+ "token_endpoint": {
1447
+ "name": "token_endpoint",
1448
+ "type": "text",
1449
+ "primaryKey": false,
1450
+ "notNull": true
1451
+ },
1452
+ "userinfo_endpoint": {
1453
+ "name": "userinfo_endpoint",
1454
+ "type": "text",
1455
+ "primaryKey": false,
1456
+ "notNull": false
1457
+ },
1458
+ "jwks_uri": {
1459
+ "name": "jwks_uri",
1460
+ "type": "text",
1461
+ "primaryKey": false,
1462
+ "notNull": false
1463
+ },
1464
+ "client_id": {
1465
+ "name": "client_id",
1466
+ "type": "text",
1467
+ "primaryKey": false,
1468
+ "notNull": true
1469
+ },
1470
+ "client_secret": {
1471
+ "name": "client_secret",
1472
+ "type": "text",
1473
+ "primaryKey": false,
1474
+ "notNull": true
1475
+ },
1476
+ "scopes": {
1477
+ "name": "scopes",
1478
+ "type": "text[]",
1479
+ "primaryKey": false,
1480
+ "notNull": true,
1481
+ "default": "'{\"openid\",\"profile\",\"email\"}'::text[]"
1482
+ },
1483
+ "attribute_mapping": {
1484
+ "name": "attribute_mapping",
1485
+ "type": "jsonb",
1486
+ "primaryKey": false,
1487
+ "notNull": true,
1488
+ "default": "'{}'::jsonb"
1489
+ },
1490
+ "is_active": {
1491
+ "name": "is_active",
1492
+ "type": "boolean",
1493
+ "primaryKey": false,
1494
+ "notNull": true,
1495
+ "default": true
1496
+ },
1497
+ "created_at": {
1498
+ "name": "created_at",
1499
+ "type": "timestamp with time zone",
1500
+ "primaryKey": false,
1501
+ "notNull": true,
1502
+ "default": "now()"
1503
+ },
1504
+ "updated_at": {
1505
+ "name": "updated_at",
1506
+ "type": "timestamp with time zone",
1507
+ "primaryKey": false,
1508
+ "notNull": true,
1509
+ "default": "now()"
1510
+ }
1511
+ },
1512
+ "indexes": {
1513
+ "oidc_connections_org_idx": {
1514
+ "name": "oidc_connections_org_idx",
1515
+ "columns": [
1516
+ {
1517
+ "expression": "org_id",
1518
+ "isExpression": false,
1519
+ "asc": true,
1520
+ "nulls": "last"
1521
+ }
1522
+ ],
1523
+ "isUnique": false,
1524
+ "concurrently": false,
1525
+ "method": "btree",
1526
+ "with": {}
1527
+ }
1528
+ },
1529
+ "foreignKeys": {
1530
+ "oidc_connections_org_id_organizations_id_fk": {
1531
+ "name": "oidc_connections_org_id_organizations_id_fk",
1532
+ "tableFrom": "oidc_connections",
1533
+ "tableTo": "organizations",
1534
+ "columnsFrom": [
1535
+ "org_id"
1536
+ ],
1537
+ "columnsTo": [
1538
+ "id"
1539
+ ],
1540
+ "onDelete": "cascade",
1541
+ "onUpdate": "no action"
1542
+ }
1543
+ },
1544
+ "compositePrimaryKeys": {},
1545
+ "uniqueConstraints": {},
1546
+ "policies": {},
1547
+ "checkConstraints": {},
1548
+ "isRLSEnabled": false
1549
+ },
1550
+ "public.org_memberships": {
1551
+ "name": "org_memberships",
1552
+ "schema": "",
1553
+ "columns": {
1554
+ "id": {
1555
+ "name": "id",
1556
+ "type": "uuid",
1557
+ "primaryKey": true,
1558
+ "notNull": true,
1559
+ "default": "gen_random_uuid()"
1560
+ },
1561
+ "org_id": {
1562
+ "name": "org_id",
1563
+ "type": "uuid",
1564
+ "primaryKey": false,
1565
+ "notNull": true
1566
+ },
1567
+ "user_id": {
1568
+ "name": "user_id",
1569
+ "type": "uuid",
1570
+ "primaryKey": false,
1571
+ "notNull": true
1572
+ },
1573
+ "role": {
1574
+ "name": "role",
1575
+ "type": "text",
1576
+ "primaryKey": false,
1577
+ "notNull": true,
1578
+ "default": "'member'"
1579
+ },
1580
+ "created_at": {
1581
+ "name": "created_at",
1582
+ "type": "timestamp with time zone",
1583
+ "primaryKey": false,
1584
+ "notNull": true,
1585
+ "default": "now()"
1586
+ },
1587
+ "updated_at": {
1588
+ "name": "updated_at",
1589
+ "type": "timestamp with time zone",
1590
+ "primaryKey": false,
1591
+ "notNull": true,
1592
+ "default": "now()"
1593
+ }
1594
+ },
1595
+ "indexes": {
1596
+ "org_memberships_org_idx": {
1597
+ "name": "org_memberships_org_idx",
1598
+ "columns": [
1599
+ {
1600
+ "expression": "org_id",
1601
+ "isExpression": false,
1602
+ "asc": true,
1603
+ "nulls": "last"
1604
+ }
1605
+ ],
1606
+ "isUnique": false,
1607
+ "concurrently": false,
1608
+ "method": "btree",
1609
+ "with": {}
1610
+ },
1611
+ "org_memberships_user_idx": {
1612
+ "name": "org_memberships_user_idx",
1613
+ "columns": [
1614
+ {
1615
+ "expression": "user_id",
1616
+ "isExpression": false,
1617
+ "asc": true,
1618
+ "nulls": "last"
1619
+ }
1620
+ ],
1621
+ "isUnique": false,
1622
+ "concurrently": false,
1623
+ "method": "btree",
1624
+ "with": {}
1625
+ }
1626
+ },
1627
+ "foreignKeys": {
1628
+ "org_memberships_org_id_organizations_id_fk": {
1629
+ "name": "org_memberships_org_id_organizations_id_fk",
1630
+ "tableFrom": "org_memberships",
1631
+ "tableTo": "organizations",
1632
+ "columnsFrom": [
1633
+ "org_id"
1634
+ ],
1635
+ "columnsTo": [
1636
+ "id"
1637
+ ],
1638
+ "onDelete": "cascade",
1639
+ "onUpdate": "no action"
1640
+ },
1641
+ "org_memberships_user_id_users_id_fk": {
1642
+ "name": "org_memberships_user_id_users_id_fk",
1643
+ "tableFrom": "org_memberships",
1644
+ "tableTo": "users",
1645
+ "columnsFrom": [
1646
+ "user_id"
1647
+ ],
1648
+ "columnsTo": [
1649
+ "id"
1650
+ ],
1651
+ "onDelete": "cascade",
1652
+ "onUpdate": "no action"
1653
+ }
1654
+ },
1655
+ "compositePrimaryKeys": {},
1656
+ "uniqueConstraints": {
1657
+ "org_memberships_unique": {
1658
+ "name": "org_memberships_unique",
1659
+ "nullsNotDistinct": false,
1660
+ "columns": [
1661
+ "org_id",
1662
+ "user_id"
1663
+ ]
1664
+ }
1665
+ },
1666
+ "policies": {},
1667
+ "checkConstraints": {
1668
+ "org_memberships_role_check": {
1669
+ "name": "org_memberships_role_check",
1670
+ "value": "role in ('owner', 'admin', 'member')"
1671
+ }
1672
+ },
1673
+ "isRLSEnabled": false
1674
+ },
1675
+ "public.organizations": {
1676
+ "name": "organizations",
1677
+ "schema": "",
1678
+ "columns": {
1679
+ "id": {
1680
+ "name": "id",
1681
+ "type": "uuid",
1682
+ "primaryKey": true,
1683
+ "notNull": true,
1684
+ "default": "gen_random_uuid()"
1685
+ },
1686
+ "name": {
1687
+ "name": "name",
1688
+ "type": "text",
1689
+ "primaryKey": false,
1690
+ "notNull": true
1691
+ },
1692
+ "slug": {
1693
+ "name": "slug",
1694
+ "type": "text",
1695
+ "primaryKey": false,
1696
+ "notNull": true
1697
+ },
1698
+ "plan": {
1699
+ "name": "plan",
1700
+ "type": "text",
1701
+ "primaryKey": false,
1702
+ "notNull": true,
1703
+ "default": "'free'"
1704
+ },
1705
+ "branding": {
1706
+ "name": "branding",
1707
+ "type": "jsonb",
1708
+ "primaryKey": false,
1709
+ "notNull": true,
1710
+ "default": "'{}'::jsonb"
1711
+ },
1712
+ "created_at": {
1713
+ "name": "created_at",
1714
+ "type": "timestamp with time zone",
1715
+ "primaryKey": false,
1716
+ "notNull": true,
1717
+ "default": "now()"
1718
+ },
1719
+ "updated_at": {
1720
+ "name": "updated_at",
1721
+ "type": "timestamp with time zone",
1722
+ "primaryKey": false,
1723
+ "notNull": true,
1724
+ "default": "now()"
1725
+ }
1726
+ },
1727
+ "indexes": {
1728
+ "organizations_slug_idx": {
1729
+ "name": "organizations_slug_idx",
1730
+ "columns": [
1731
+ {
1732
+ "expression": "slug",
1733
+ "isExpression": false,
1734
+ "asc": true,
1735
+ "nulls": "last"
1736
+ }
1737
+ ],
1738
+ "isUnique": false,
1739
+ "concurrently": false,
1740
+ "method": "btree",
1741
+ "with": {}
1742
+ }
1743
+ },
1744
+ "foreignKeys": {},
1745
+ "compositePrimaryKeys": {},
1746
+ "uniqueConstraints": {
1747
+ "organizations_slug_unique": {
1748
+ "name": "organizations_slug_unique",
1749
+ "nullsNotDistinct": false,
1750
+ "columns": [
1751
+ "slug"
1752
+ ]
1753
+ }
1754
+ },
1755
+ "policies": {},
1756
+ "checkConstraints": {},
1757
+ "isRLSEnabled": false
1758
+ },
1759
+ "public.password_reset_tokens": {
1760
+ "name": "password_reset_tokens",
1761
+ "schema": "",
1762
+ "columns": {
1763
+ "id": {
1764
+ "name": "id",
1765
+ "type": "uuid",
1766
+ "primaryKey": true,
1767
+ "notNull": true,
1768
+ "default": "gen_random_uuid()"
1769
+ },
1770
+ "user_id": {
1771
+ "name": "user_id",
1772
+ "type": "uuid",
1773
+ "primaryKey": false,
1774
+ "notNull": true
1775
+ },
1776
+ "token_hash": {
1777
+ "name": "token_hash",
1778
+ "type": "text",
1779
+ "primaryKey": false,
1780
+ "notNull": true
1781
+ },
1782
+ "used_at": {
1783
+ "name": "used_at",
1784
+ "type": "timestamp with time zone",
1785
+ "primaryKey": false,
1786
+ "notNull": false
1787
+ },
1788
+ "expires_at": {
1789
+ "name": "expires_at",
1790
+ "type": "timestamp with time zone",
1791
+ "primaryKey": false,
1792
+ "notNull": true
1793
+ },
1794
+ "created_at": {
1795
+ "name": "created_at",
1796
+ "type": "timestamp with time zone",
1797
+ "primaryKey": false,
1798
+ "notNull": true,
1799
+ "default": "now()"
1800
+ }
1801
+ },
1802
+ "indexes": {
1803
+ "password_reset_tokens_user_idx": {
1804
+ "name": "password_reset_tokens_user_idx",
1805
+ "columns": [
1806
+ {
1807
+ "expression": "user_id",
1808
+ "isExpression": false,
1809
+ "asc": true,
1810
+ "nulls": "last"
1811
+ }
1812
+ ],
1813
+ "isUnique": false,
1814
+ "concurrently": false,
1815
+ "method": "btree",
1816
+ "with": {}
1817
+ },
1818
+ "password_reset_tokens_hash_idx": {
1819
+ "name": "password_reset_tokens_hash_idx",
1820
+ "columns": [
1821
+ {
1822
+ "expression": "token_hash",
1823
+ "isExpression": false,
1824
+ "asc": true,
1825
+ "nulls": "last"
1826
+ }
1827
+ ],
1828
+ "isUnique": false,
1829
+ "concurrently": false,
1830
+ "method": "btree",
1831
+ "with": {}
1832
+ }
1833
+ },
1834
+ "foreignKeys": {
1835
+ "password_reset_tokens_user_id_users_id_fk": {
1836
+ "name": "password_reset_tokens_user_id_users_id_fk",
1837
+ "tableFrom": "password_reset_tokens",
1838
+ "tableTo": "users",
1839
+ "columnsFrom": [
1840
+ "user_id"
1841
+ ],
1842
+ "columnsTo": [
1843
+ "id"
1844
+ ],
1845
+ "onDelete": "cascade",
1846
+ "onUpdate": "no action"
1847
+ }
1848
+ },
1849
+ "compositePrimaryKeys": {},
1850
+ "uniqueConstraints": {},
1851
+ "policies": {},
1852
+ "checkConstraints": {},
1853
+ "isRLSEnabled": false
1854
+ },
1855
+ "public.permissions": {
1856
+ "name": "permissions",
1857
+ "schema": "",
1858
+ "columns": {
1859
+ "id": {
1860
+ "name": "id",
1861
+ "type": "uuid",
1862
+ "primaryKey": true,
1863
+ "notNull": true,
1864
+ "default": "gen_random_uuid()"
1865
+ },
1866
+ "resource": {
1867
+ "name": "resource",
1868
+ "type": "text",
1869
+ "primaryKey": false,
1870
+ "notNull": true
1871
+ },
1872
+ "action": {
1873
+ "name": "action",
1874
+ "type": "text",
1875
+ "primaryKey": false,
1876
+ "notNull": true
1877
+ },
1878
+ "description": {
1879
+ "name": "description",
1880
+ "type": "text",
1881
+ "primaryKey": false,
1882
+ "notNull": false
1883
+ },
1884
+ "created_at": {
1885
+ "name": "created_at",
1886
+ "type": "timestamp with time zone",
1887
+ "primaryKey": false,
1888
+ "notNull": true,
1889
+ "default": "now()"
1890
+ }
1891
+ },
1892
+ "indexes": {},
1893
+ "foreignKeys": {},
1894
+ "compositePrimaryKeys": {},
1895
+ "uniqueConstraints": {
1896
+ "permissions_resource_action_idx": {
1897
+ "name": "permissions_resource_action_idx",
1898
+ "nullsNotDistinct": false,
1899
+ "columns": [
1900
+ "resource",
1901
+ "action"
1902
+ ]
1903
+ }
1904
+ },
1905
+ "policies": {},
1906
+ "checkConstraints": {},
1907
+ "isRLSEnabled": false
1908
+ },
1909
+ "public.refresh_tokens": {
1910
+ "name": "refresh_tokens",
1911
+ "schema": "",
1912
+ "columns": {
1913
+ "id": {
1914
+ "name": "id",
1915
+ "type": "uuid",
1916
+ "primaryKey": true,
1917
+ "notNull": true,
1918
+ "default": "gen_random_uuid()"
1919
+ },
1920
+ "user_id": {
1921
+ "name": "user_id",
1922
+ "type": "uuid",
1923
+ "primaryKey": false,
1924
+ "notNull": true
1925
+ },
1926
+ "app_id": {
1927
+ "name": "app_id",
1928
+ "type": "uuid",
1929
+ "primaryKey": false,
1930
+ "notNull": false
1931
+ },
1932
+ "token_hash": {
1933
+ "name": "token_hash",
1934
+ "type": "text",
1935
+ "primaryKey": false,
1936
+ "notNull": true
1937
+ },
1938
+ "expires_at": {
1939
+ "name": "expires_at",
1940
+ "type": "timestamp with time zone",
1941
+ "primaryKey": false,
1942
+ "notNull": true
1943
+ },
1944
+ "revoked_at": {
1945
+ "name": "revoked_at",
1946
+ "type": "timestamp with time zone",
1947
+ "primaryKey": false,
1948
+ "notNull": false
1949
+ },
1950
+ "created_at": {
1951
+ "name": "created_at",
1952
+ "type": "timestamp with time zone",
1953
+ "primaryKey": false,
1954
+ "notNull": true,
1955
+ "default": "now()"
1956
+ },
1957
+ "ip_address": {
1958
+ "name": "ip_address",
1959
+ "type": "text",
1960
+ "primaryKey": false,
1961
+ "notNull": false
1962
+ },
1963
+ "user_agent": {
1964
+ "name": "user_agent",
1965
+ "type": "text",
1966
+ "primaryKey": false,
1967
+ "notNull": false
1968
+ },
1969
+ "device_fingerprint": {
1970
+ "name": "device_fingerprint",
1971
+ "type": "text",
1972
+ "primaryKey": false,
1973
+ "notNull": false
1974
+ }
1975
+ },
1976
+ "indexes": {
1977
+ "refresh_tokens_user_idx": {
1978
+ "name": "refresh_tokens_user_idx",
1979
+ "columns": [
1980
+ {
1981
+ "expression": "user_id",
1982
+ "isExpression": false,
1983
+ "asc": true,
1984
+ "nulls": "last"
1985
+ }
1986
+ ],
1987
+ "isUnique": false,
1988
+ "concurrently": false,
1989
+ "method": "btree",
1990
+ "with": {}
1991
+ },
1992
+ "refresh_tokens_app_idx": {
1993
+ "name": "refresh_tokens_app_idx",
1994
+ "columns": [
1995
+ {
1996
+ "expression": "app_id",
1997
+ "isExpression": false,
1998
+ "asc": true,
1999
+ "nulls": "last"
2000
+ }
2001
+ ],
2002
+ "isUnique": false,
2003
+ "concurrently": false,
2004
+ "method": "btree",
2005
+ "with": {}
2006
+ },
2007
+ "refresh_tokens_hash_idx": {
2008
+ "name": "refresh_tokens_hash_idx",
2009
+ "columns": [
2010
+ {
2011
+ "expression": "token_hash",
2012
+ "isExpression": false,
2013
+ "asc": true,
2014
+ "nulls": "last"
2015
+ }
2016
+ ],
2017
+ "isUnique": false,
2018
+ "concurrently": false,
2019
+ "method": "btree",
2020
+ "with": {}
2021
+ }
2022
+ },
2023
+ "foreignKeys": {
2024
+ "refresh_tokens_user_id_users_id_fk": {
2025
+ "name": "refresh_tokens_user_id_users_id_fk",
2026
+ "tableFrom": "refresh_tokens",
2027
+ "tableTo": "users",
2028
+ "columnsFrom": [
2029
+ "user_id"
2030
+ ],
2031
+ "columnsTo": [
2032
+ "id"
2033
+ ],
2034
+ "onDelete": "cascade",
2035
+ "onUpdate": "no action"
2036
+ },
2037
+ "refresh_tokens_app_id_applications_id_fk": {
2038
+ "name": "refresh_tokens_app_id_applications_id_fk",
2039
+ "tableFrom": "refresh_tokens",
2040
+ "tableTo": "applications",
2041
+ "columnsFrom": [
2042
+ "app_id"
2043
+ ],
2044
+ "columnsTo": [
2045
+ "id"
2046
+ ],
2047
+ "onDelete": "restrict",
2048
+ "onUpdate": "no action"
2049
+ }
2050
+ },
2051
+ "compositePrimaryKeys": {},
2052
+ "uniqueConstraints": {},
2053
+ "policies": {},
2054
+ "checkConstraints": {},
2055
+ "isRLSEnabled": false
2056
+ },
2057
+ "public.role_permissions": {
2058
+ "name": "role_permissions",
2059
+ "schema": "",
2060
+ "columns": {
2061
+ "id": {
2062
+ "name": "id",
2063
+ "type": "uuid",
2064
+ "primaryKey": true,
2065
+ "notNull": true,
2066
+ "default": "gen_random_uuid()"
2067
+ },
2068
+ "role": {
2069
+ "name": "role",
2070
+ "type": "text",
2071
+ "primaryKey": false,
2072
+ "notNull": true
2073
+ },
2074
+ "permission_id": {
2075
+ "name": "permission_id",
2076
+ "type": "uuid",
2077
+ "primaryKey": false,
2078
+ "notNull": true
2079
+ },
2080
+ "created_at": {
2081
+ "name": "created_at",
2082
+ "type": "timestamp with time zone",
2083
+ "primaryKey": false,
2084
+ "notNull": true,
2085
+ "default": "now()"
2086
+ }
2087
+ },
2088
+ "indexes": {},
2089
+ "foreignKeys": {
2090
+ "role_permissions_permission_id_permissions_id_fk": {
2091
+ "name": "role_permissions_permission_id_permissions_id_fk",
2092
+ "tableFrom": "role_permissions",
2093
+ "tableTo": "permissions",
2094
+ "columnsFrom": [
2095
+ "permission_id"
2096
+ ],
2097
+ "columnsTo": [
2098
+ "id"
2099
+ ],
2100
+ "onDelete": "cascade",
2101
+ "onUpdate": "no action"
2102
+ }
2103
+ },
2104
+ "compositePrimaryKeys": {},
2105
+ "uniqueConstraints": {
2106
+ "role_permissions_idx": {
2107
+ "name": "role_permissions_idx",
2108
+ "nullsNotDistinct": false,
2109
+ "columns": [
2110
+ "role",
2111
+ "permission_id"
2112
+ ]
2113
+ }
2114
+ },
2115
+ "policies": {},
2116
+ "checkConstraints": {},
2117
+ "isRLSEnabled": false
2118
+ },
2119
+ "public.saml_connections": {
2120
+ "name": "saml_connections",
2121
+ "schema": "",
2122
+ "columns": {
2123
+ "id": {
2124
+ "name": "id",
2125
+ "type": "uuid",
2126
+ "primaryKey": true,
2127
+ "notNull": true,
2128
+ "default": "gen_random_uuid()"
2129
+ },
2130
+ "org_id": {
2131
+ "name": "org_id",
2132
+ "type": "uuid",
2133
+ "primaryKey": false,
2134
+ "notNull": true
2135
+ },
2136
+ "name": {
2137
+ "name": "name",
2138
+ "type": "text",
2139
+ "primaryKey": false,
2140
+ "notNull": true
2141
+ },
2142
+ "idp_entity_id": {
2143
+ "name": "idp_entity_id",
2144
+ "type": "text",
2145
+ "primaryKey": false,
2146
+ "notNull": false
2147
+ },
2148
+ "idp_sso_url": {
2149
+ "name": "idp_sso_url",
2150
+ "type": "text",
2151
+ "primaryKey": false,
2152
+ "notNull": false
2153
+ },
2154
+ "idp_certificate": {
2155
+ "name": "idp_certificate",
2156
+ "type": "text",
2157
+ "primaryKey": false,
2158
+ "notNull": false
2159
+ },
2160
+ "sp_entity_id": {
2161
+ "name": "sp_entity_id",
2162
+ "type": "text",
2163
+ "primaryKey": false,
2164
+ "notNull": true
2165
+ },
2166
+ "sp_acs_url": {
2167
+ "name": "sp_acs_url",
2168
+ "type": "text",
2169
+ "primaryKey": false,
2170
+ "notNull": true
2171
+ },
2172
+ "attribute_mapping": {
2173
+ "name": "attribute_mapping",
2174
+ "type": "jsonb",
2175
+ "primaryKey": false,
2176
+ "notNull": true,
2177
+ "default": "'{}'::jsonb"
2178
+ },
2179
+ "is_active": {
2180
+ "name": "is_active",
2181
+ "type": "boolean",
2182
+ "primaryKey": false,
2183
+ "notNull": true,
2184
+ "default": true
2185
+ },
2186
+ "created_at": {
2187
+ "name": "created_at",
2188
+ "type": "timestamp with time zone",
2189
+ "primaryKey": false,
2190
+ "notNull": true,
2191
+ "default": "now()"
2192
+ },
2193
+ "updated_at": {
2194
+ "name": "updated_at",
2195
+ "type": "timestamp with time zone",
2196
+ "primaryKey": false,
2197
+ "notNull": true,
2198
+ "default": "now()"
2199
+ }
2200
+ },
2201
+ "indexes": {
2202
+ "saml_connections_org_idx": {
2203
+ "name": "saml_connections_org_idx",
2204
+ "columns": [
2205
+ {
2206
+ "expression": "org_id",
2207
+ "isExpression": false,
2208
+ "asc": true,
2209
+ "nulls": "last"
2210
+ }
2211
+ ],
2212
+ "isUnique": false,
2213
+ "concurrently": false,
2214
+ "method": "btree",
2215
+ "with": {}
2216
+ }
2217
+ },
2218
+ "foreignKeys": {
2219
+ "saml_connections_org_id_organizations_id_fk": {
2220
+ "name": "saml_connections_org_id_organizations_id_fk",
2221
+ "tableFrom": "saml_connections",
2222
+ "tableTo": "organizations",
2223
+ "columnsFrom": [
2224
+ "org_id"
2225
+ ],
2226
+ "columnsTo": [
2227
+ "id"
2228
+ ],
2229
+ "onDelete": "cascade",
2230
+ "onUpdate": "no action"
2231
+ }
2232
+ },
2233
+ "compositePrimaryKeys": {},
2234
+ "uniqueConstraints": {},
2235
+ "policies": {},
2236
+ "checkConstraints": {},
2237
+ "isRLSEnabled": false
2238
+ },
2239
+ "public.secrets": {
2240
+ "name": "secrets",
2241
+ "schema": "",
2242
+ "columns": {
2243
+ "id": {
2244
+ "name": "id",
2245
+ "type": "uuid",
2246
+ "primaryKey": true,
2247
+ "notNull": true,
2248
+ "default": "gen_random_uuid()"
2249
+ },
2250
+ "key_id": {
2251
+ "name": "key_id",
2252
+ "type": "text",
2253
+ "primaryKey": false,
2254
+ "notNull": true
2255
+ },
2256
+ "type": {
2257
+ "name": "type",
2258
+ "type": "text",
2259
+ "primaryKey": false,
2260
+ "notNull": true
2261
+ },
2262
+ "value": {
2263
+ "name": "value",
2264
+ "type": "text",
2265
+ "primaryKey": false,
2266
+ "notNull": true
2267
+ },
2268
+ "algorithm": {
2269
+ "name": "algorithm",
2270
+ "type": "text",
2271
+ "primaryKey": false,
2272
+ "notNull": false
2273
+ },
2274
+ "is_active": {
2275
+ "name": "is_active",
2276
+ "type": "boolean",
2277
+ "primaryKey": false,
2278
+ "notNull": true,
2279
+ "default": true
2280
+ },
2281
+ "rotated_at": {
2282
+ "name": "rotated_at",
2283
+ "type": "timestamp with time zone",
2284
+ "primaryKey": false,
2285
+ "notNull": false
2286
+ },
2287
+ "expires_at": {
2288
+ "name": "expires_at",
2289
+ "type": "timestamp with time zone",
2290
+ "primaryKey": false,
2291
+ "notNull": false
2292
+ },
2293
+ "created_at": {
2294
+ "name": "created_at",
2295
+ "type": "timestamp with time zone",
2296
+ "primaryKey": false,
2297
+ "notNull": true,
2298
+ "default": "now()"
2299
+ }
2300
+ },
2301
+ "indexes": {
2302
+ "secrets_type_active_idx": {
2303
+ "name": "secrets_type_active_idx",
2304
+ "columns": [
2305
+ {
2306
+ "expression": "type",
2307
+ "isExpression": false,
2308
+ "asc": true,
2309
+ "nulls": "last"
2310
+ },
2311
+ {
2312
+ "expression": "is_active",
2313
+ "isExpression": false,
2314
+ "asc": true,
2315
+ "nulls": "last"
2316
+ }
2317
+ ],
2318
+ "isUnique": false,
2319
+ "concurrently": false,
2320
+ "method": "btree",
2321
+ "with": {}
2322
+ }
2323
+ },
2324
+ "foreignKeys": {},
2325
+ "compositePrimaryKeys": {},
2326
+ "uniqueConstraints": {
2327
+ "secrets_key_id_unique": {
2328
+ "name": "secrets_key_id_unique",
2329
+ "nullsNotDistinct": false,
2330
+ "columns": [
2331
+ "key_id"
2332
+ ]
2333
+ }
2334
+ },
2335
+ "policies": {},
2336
+ "checkConstraints": {},
2337
+ "isRLSEnabled": false
2338
+ },
2339
+ "public.service_accounts": {
2340
+ "name": "service_accounts",
2341
+ "schema": "",
2342
+ "columns": {
2343
+ "id": {
2344
+ "name": "id",
2345
+ "type": "uuid",
2346
+ "primaryKey": true,
2347
+ "notNull": true,
2348
+ "default": "gen_random_uuid()"
2349
+ },
2350
+ "org_id": {
2351
+ "name": "org_id",
2352
+ "type": "uuid",
2353
+ "primaryKey": false,
2354
+ "notNull": true
2355
+ },
2356
+ "name": {
2357
+ "name": "name",
2358
+ "type": "text",
2359
+ "primaryKey": false,
2360
+ "notNull": true
2361
+ },
2362
+ "description": {
2363
+ "name": "description",
2364
+ "type": "text",
2365
+ "primaryKey": false,
2366
+ "notNull": false
2367
+ },
2368
+ "is_active": {
2369
+ "name": "is_active",
2370
+ "type": "boolean",
2371
+ "primaryKey": false,
2372
+ "notNull": true,
2373
+ "default": true
2374
+ },
2375
+ "created_at": {
2376
+ "name": "created_at",
2377
+ "type": "timestamp with time zone",
2378
+ "primaryKey": false,
2379
+ "notNull": true,
2380
+ "default": "now()"
2381
+ },
2382
+ "updated_at": {
2383
+ "name": "updated_at",
2384
+ "type": "timestamp with time zone",
2385
+ "primaryKey": false,
2386
+ "notNull": true,
2387
+ "default": "now()"
2388
+ }
2389
+ },
2390
+ "indexes": {
2391
+ "service_accounts_org_idx": {
2392
+ "name": "service_accounts_org_idx",
2393
+ "columns": [
2394
+ {
2395
+ "expression": "org_id",
2396
+ "isExpression": false,
2397
+ "asc": true,
2398
+ "nulls": "last"
2399
+ }
2400
+ ],
2401
+ "isUnique": false,
2402
+ "concurrently": false,
2403
+ "method": "btree",
2404
+ "with": {}
2405
+ }
2406
+ },
2407
+ "foreignKeys": {
2408
+ "service_accounts_org_id_organizations_id_fk": {
2409
+ "name": "service_accounts_org_id_organizations_id_fk",
2410
+ "tableFrom": "service_accounts",
2411
+ "tableTo": "organizations",
2412
+ "columnsFrom": [
2413
+ "org_id"
2414
+ ],
2415
+ "columnsTo": [
2416
+ "id"
2417
+ ],
2418
+ "onDelete": "cascade",
2419
+ "onUpdate": "no action"
2420
+ }
2421
+ },
2422
+ "compositePrimaryKeys": {},
2423
+ "uniqueConstraints": {},
2424
+ "policies": {},
2425
+ "checkConstraints": {},
2426
+ "isRLSEnabled": false
2427
+ },
2428
+ "public.sms_otp_codes": {
2429
+ "name": "sms_otp_codes",
2430
+ "schema": "",
2431
+ "columns": {
2432
+ "id": {
2433
+ "name": "id",
2434
+ "type": "uuid",
2435
+ "primaryKey": true,
2436
+ "notNull": true,
2437
+ "default": "gen_random_uuid()"
2438
+ },
2439
+ "user_id": {
2440
+ "name": "user_id",
2441
+ "type": "uuid",
2442
+ "primaryKey": false,
2443
+ "notNull": true
2444
+ },
2445
+ "phone_number": {
2446
+ "name": "phone_number",
2447
+ "type": "text",
2448
+ "primaryKey": false,
2449
+ "notNull": true
2450
+ },
2451
+ "code_hash": {
2452
+ "name": "code_hash",
2453
+ "type": "text",
2454
+ "primaryKey": false,
2455
+ "notNull": true
2456
+ },
2457
+ "used_at": {
2458
+ "name": "used_at",
2459
+ "type": "timestamp with time zone",
2460
+ "primaryKey": false,
2461
+ "notNull": false
2462
+ },
2463
+ "expires_at": {
2464
+ "name": "expires_at",
2465
+ "type": "timestamp with time zone",
2466
+ "primaryKey": false,
2467
+ "notNull": true
2468
+ },
2469
+ "created_at": {
2470
+ "name": "created_at",
2471
+ "type": "timestamp with time zone",
2472
+ "primaryKey": false,
2473
+ "notNull": true,
2474
+ "default": "now()"
2475
+ }
2476
+ },
2477
+ "indexes": {
2478
+ "sms_otp_codes_user_idx": {
2479
+ "name": "sms_otp_codes_user_idx",
2480
+ "columns": [
2481
+ {
2482
+ "expression": "user_id",
2483
+ "isExpression": false,
2484
+ "asc": true,
2485
+ "nulls": "last"
2486
+ }
2487
+ ],
2488
+ "isUnique": false,
2489
+ "concurrently": false,
2490
+ "method": "btree",
2491
+ "with": {}
2492
+ }
2493
+ },
2494
+ "foreignKeys": {
2495
+ "sms_otp_codes_user_id_users_id_fk": {
2496
+ "name": "sms_otp_codes_user_id_users_id_fk",
2497
+ "tableFrom": "sms_otp_codes",
2498
+ "tableTo": "users",
2499
+ "columnsFrom": [
2500
+ "user_id"
2501
+ ],
2502
+ "columnsTo": [
2503
+ "id"
2504
+ ],
2505
+ "onDelete": "cascade",
2506
+ "onUpdate": "no action"
2507
+ }
2508
+ },
2509
+ "compositePrimaryKeys": {},
2510
+ "uniqueConstraints": {},
2511
+ "policies": {},
2512
+ "checkConstraints": {},
2513
+ "isRLSEnabled": false
2514
+ },
2515
+ "public.sso_identity_links": {
2516
+ "name": "sso_identity_links",
2517
+ "schema": "",
2518
+ "columns": {
2519
+ "id": {
2520
+ "name": "id",
2521
+ "type": "uuid",
2522
+ "primaryKey": true,
2523
+ "notNull": true,
2524
+ "default": "gen_random_uuid()"
2525
+ },
2526
+ "connection_type": {
2527
+ "name": "connection_type",
2528
+ "type": "text",
2529
+ "primaryKey": false,
2530
+ "notNull": true
2531
+ },
2532
+ "connection_id": {
2533
+ "name": "connection_id",
2534
+ "type": "uuid",
2535
+ "primaryKey": false,
2536
+ "notNull": true
2537
+ },
2538
+ "org_id": {
2539
+ "name": "org_id",
2540
+ "type": "uuid",
2541
+ "primaryKey": false,
2542
+ "notNull": true
2543
+ },
2544
+ "user_id": {
2545
+ "name": "user_id",
2546
+ "type": "uuid",
2547
+ "primaryKey": false,
2548
+ "notNull": true
2549
+ },
2550
+ "external_sub": {
2551
+ "name": "external_sub",
2552
+ "type": "text",
2553
+ "primaryKey": false,
2554
+ "notNull": true
2555
+ },
2556
+ "created_at": {
2557
+ "name": "created_at",
2558
+ "type": "timestamp with time zone",
2559
+ "primaryKey": false,
2560
+ "notNull": true,
2561
+ "default": "now()"
2562
+ }
2563
+ },
2564
+ "indexes": {
2565
+ "sso_identity_links_user_idx": {
2566
+ "name": "sso_identity_links_user_idx",
2567
+ "columns": [
2568
+ {
2569
+ "expression": "user_id",
2570
+ "isExpression": false,
2571
+ "asc": true,
2572
+ "nulls": "last"
2573
+ }
2574
+ ],
2575
+ "isUnique": false,
2576
+ "concurrently": false,
2577
+ "method": "btree",
2578
+ "with": {}
2579
+ }
2580
+ },
2581
+ "foreignKeys": {
2582
+ "sso_identity_links_org_id_organizations_id_fk": {
2583
+ "name": "sso_identity_links_org_id_organizations_id_fk",
2584
+ "tableFrom": "sso_identity_links",
2585
+ "tableTo": "organizations",
2586
+ "columnsFrom": [
2587
+ "org_id"
2588
+ ],
2589
+ "columnsTo": [
2590
+ "id"
2591
+ ],
2592
+ "onDelete": "cascade",
2593
+ "onUpdate": "no action"
2594
+ },
2595
+ "sso_identity_links_user_id_users_id_fk": {
2596
+ "name": "sso_identity_links_user_id_users_id_fk",
2597
+ "tableFrom": "sso_identity_links",
2598
+ "tableTo": "users",
2599
+ "columnsFrom": [
2600
+ "user_id"
2601
+ ],
2602
+ "columnsTo": [
2603
+ "id"
2604
+ ],
2605
+ "onDelete": "cascade",
2606
+ "onUpdate": "no action"
2607
+ }
2608
+ },
2609
+ "compositePrimaryKeys": {},
2610
+ "uniqueConstraints": {
2611
+ "sso_identity_links_connection_sub_unique": {
2612
+ "name": "sso_identity_links_connection_sub_unique",
2613
+ "nullsNotDistinct": false,
2614
+ "columns": [
2615
+ "connection_type",
2616
+ "connection_id",
2617
+ "external_sub"
2618
+ ]
2619
+ },
2620
+ "sso_identity_links_user_connection_unique": {
2621
+ "name": "sso_identity_links_user_connection_unique",
2622
+ "nullsNotDistinct": false,
2623
+ "columns": [
2624
+ "org_id",
2625
+ "user_id",
2626
+ "connection_type",
2627
+ "connection_id"
2628
+ ]
2629
+ }
2630
+ },
2631
+ "policies": {},
2632
+ "checkConstraints": {},
2633
+ "isRLSEnabled": false
2634
+ },
2635
+ "public.totp_backup_codes": {
2636
+ "name": "totp_backup_codes",
2637
+ "schema": "",
2638
+ "columns": {
2639
+ "id": {
2640
+ "name": "id",
2641
+ "type": "uuid",
2642
+ "primaryKey": true,
2643
+ "notNull": true,
2644
+ "default": "gen_random_uuid()"
2645
+ },
2646
+ "user_id": {
2647
+ "name": "user_id",
2648
+ "type": "uuid",
2649
+ "primaryKey": false,
2650
+ "notNull": true
2651
+ },
2652
+ "code_hash": {
2653
+ "name": "code_hash",
2654
+ "type": "text",
2655
+ "primaryKey": false,
2656
+ "notNull": true
2657
+ },
2658
+ "used_at": {
2659
+ "name": "used_at",
2660
+ "type": "timestamp with time zone",
2661
+ "primaryKey": false,
2662
+ "notNull": false
2663
+ },
2664
+ "expires_at": {
2665
+ "name": "expires_at",
2666
+ "type": "timestamp with time zone",
2667
+ "primaryKey": false,
2668
+ "notNull": true
2669
+ },
2670
+ "created_at": {
2671
+ "name": "created_at",
2672
+ "type": "timestamp with time zone",
2673
+ "primaryKey": false,
2674
+ "notNull": true,
2675
+ "default": "now()"
2676
+ }
2677
+ },
2678
+ "indexes": {
2679
+ "totp_backup_codes_user_idx": {
2680
+ "name": "totp_backup_codes_user_idx",
2681
+ "columns": [
2682
+ {
2683
+ "expression": "user_id",
2684
+ "isExpression": false,
2685
+ "asc": true,
2686
+ "nulls": "last"
2687
+ }
2688
+ ],
2689
+ "isUnique": false,
2690
+ "concurrently": false,
2691
+ "method": "btree",
2692
+ "with": {}
2693
+ }
2694
+ },
2695
+ "foreignKeys": {
2696
+ "totp_backup_codes_user_id_users_id_fk": {
2697
+ "name": "totp_backup_codes_user_id_users_id_fk",
2698
+ "tableFrom": "totp_backup_codes",
2699
+ "tableTo": "users",
2700
+ "columnsFrom": [
2701
+ "user_id"
2702
+ ],
2703
+ "columnsTo": [
2704
+ "id"
2705
+ ],
2706
+ "onDelete": "cascade",
2707
+ "onUpdate": "no action"
2708
+ }
2709
+ },
2710
+ "compositePrimaryKeys": {},
2711
+ "uniqueConstraints": {
2712
+ "totp_backup_codes_user_code_unique": {
2713
+ "name": "totp_backup_codes_user_code_unique",
2714
+ "nullsNotDistinct": false,
2715
+ "columns": [
2716
+ "user_id",
2717
+ "code_hash"
2718
+ ]
2719
+ }
2720
+ },
2721
+ "policies": {},
2722
+ "checkConstraints": {},
2723
+ "isRLSEnabled": false
2724
+ },
2725
+ "public.user_devices": {
2726
+ "name": "user_devices",
2727
+ "schema": "",
2728
+ "columns": {
2729
+ "id": {
2730
+ "name": "id",
2731
+ "type": "uuid",
2732
+ "primaryKey": true,
2733
+ "notNull": true,
2734
+ "default": "gen_random_uuid()"
2735
+ },
2736
+ "user_id": {
2737
+ "name": "user_id",
2738
+ "type": "uuid",
2739
+ "primaryKey": false,
2740
+ "notNull": true
2741
+ },
2742
+ "fingerprint_hash": {
2743
+ "name": "fingerprint_hash",
2744
+ "type": "text",
2745
+ "primaryKey": false,
2746
+ "notNull": true
2747
+ },
2748
+ "ip_address": {
2749
+ "name": "ip_address",
2750
+ "type": "text",
2751
+ "primaryKey": false,
2752
+ "notNull": false
2753
+ },
2754
+ "user_agent": {
2755
+ "name": "user_agent",
2756
+ "type": "text",
2757
+ "primaryKey": false,
2758
+ "notNull": false
2759
+ },
2760
+ "first_seen_at": {
2761
+ "name": "first_seen_at",
2762
+ "type": "timestamp with time zone",
2763
+ "primaryKey": false,
2764
+ "notNull": true,
2765
+ "default": "now()"
2766
+ },
2767
+ "last_seen_at": {
2768
+ "name": "last_seen_at",
2769
+ "type": "timestamp with time zone",
2770
+ "primaryKey": false,
2771
+ "notNull": true,
2772
+ "default": "now()"
2773
+ },
2774
+ "trust_score": {
2775
+ "name": "trust_score",
2776
+ "type": "smallint",
2777
+ "primaryKey": false,
2778
+ "notNull": true,
2779
+ "default": 50
2780
+ },
2781
+ "new_device_alert_sent": {
2782
+ "name": "new_device_alert_sent",
2783
+ "type": "boolean",
2784
+ "primaryKey": false,
2785
+ "notNull": true,
2786
+ "default": false
2787
+ }
2788
+ },
2789
+ "indexes": {
2790
+ "user_devices_user_idx": {
2791
+ "name": "user_devices_user_idx",
2792
+ "columns": [
2793
+ {
2794
+ "expression": "user_id",
2795
+ "isExpression": false,
2796
+ "asc": true,
2797
+ "nulls": "last"
2798
+ }
2799
+ ],
2800
+ "isUnique": false,
2801
+ "concurrently": false,
2802
+ "method": "btree",
2803
+ "with": {}
2804
+ }
2805
+ },
2806
+ "foreignKeys": {
2807
+ "user_devices_user_id_users_id_fk": {
2808
+ "name": "user_devices_user_id_users_id_fk",
2809
+ "tableFrom": "user_devices",
2810
+ "tableTo": "users",
2811
+ "columnsFrom": [
2812
+ "user_id"
2813
+ ],
2814
+ "columnsTo": [
2815
+ "id"
2816
+ ],
2817
+ "onDelete": "cascade",
2818
+ "onUpdate": "no action"
2819
+ }
2820
+ },
2821
+ "compositePrimaryKeys": {},
2822
+ "uniqueConstraints": {
2823
+ "user_devices_unique": {
2824
+ "name": "user_devices_unique",
2825
+ "nullsNotDistinct": false,
2826
+ "columns": [
2827
+ "user_id",
2828
+ "fingerprint_hash"
2829
+ ]
2830
+ }
2831
+ },
2832
+ "policies": {},
2833
+ "checkConstraints": {},
2834
+ "isRLSEnabled": false
2835
+ },
2836
+ "public.user_identities": {
2837
+ "name": "user_identities",
2838
+ "schema": "",
2839
+ "columns": {
2840
+ "id": {
2841
+ "name": "id",
2842
+ "type": "uuid",
2843
+ "primaryKey": true,
2844
+ "notNull": true,
2845
+ "default": "gen_random_uuid()"
2846
+ },
2847
+ "user_id": {
2848
+ "name": "user_id",
2849
+ "type": "uuid",
2850
+ "primaryKey": false,
2851
+ "notNull": true
2852
+ },
2853
+ "provider_id": {
2854
+ "name": "provider_id",
2855
+ "type": "uuid",
2856
+ "primaryKey": false,
2857
+ "notNull": true
2858
+ },
2859
+ "provider_type": {
2860
+ "name": "provider_type",
2861
+ "type": "text",
2862
+ "primaryKey": false,
2863
+ "notNull": true
2864
+ },
2865
+ "external_sub": {
2866
+ "name": "external_sub",
2867
+ "type": "text",
2868
+ "primaryKey": false,
2869
+ "notNull": true
2870
+ },
2871
+ "email": {
2872
+ "name": "email",
2873
+ "type": "text",
2874
+ "primaryKey": false,
2875
+ "notNull": false
2876
+ },
2877
+ "profile": {
2878
+ "name": "profile",
2879
+ "type": "jsonb",
2880
+ "primaryKey": false,
2881
+ "notNull": true,
2882
+ "default": "'{}'::jsonb"
2883
+ },
2884
+ "linked_at": {
2885
+ "name": "linked_at",
2886
+ "type": "timestamp with time zone",
2887
+ "primaryKey": false,
2888
+ "notNull": true,
2889
+ "default": "now()"
2890
+ }
2891
+ },
2892
+ "indexes": {
2893
+ "user_identities_user_idx": {
2894
+ "name": "user_identities_user_idx",
2895
+ "columns": [
2896
+ {
2897
+ "expression": "user_id",
2898
+ "isExpression": false,
2899
+ "asc": true,
2900
+ "nulls": "last"
2901
+ }
2902
+ ],
2903
+ "isUnique": false,
2904
+ "concurrently": false,
2905
+ "method": "btree",
2906
+ "with": {}
2907
+ },
2908
+ "user_identities_provider_sub_idx": {
2909
+ "name": "user_identities_provider_sub_idx",
2910
+ "columns": [
2911
+ {
2912
+ "expression": "provider_id",
2913
+ "isExpression": false,
2914
+ "asc": true,
2915
+ "nulls": "last"
2916
+ },
2917
+ {
2918
+ "expression": "external_sub",
2919
+ "isExpression": false,
2920
+ "asc": true,
2921
+ "nulls": "last"
2922
+ }
2923
+ ],
2924
+ "isUnique": false,
2925
+ "concurrently": false,
2926
+ "method": "btree",
2927
+ "with": {}
2928
+ }
2929
+ },
2930
+ "foreignKeys": {
2931
+ "user_identities_user_id_users_id_fk": {
2932
+ "name": "user_identities_user_id_users_id_fk",
2933
+ "tableFrom": "user_identities",
2934
+ "tableTo": "users",
2935
+ "columnsFrom": [
2936
+ "user_id"
2937
+ ],
2938
+ "columnsTo": [
2939
+ "id"
2940
+ ],
2941
+ "onDelete": "cascade",
2942
+ "onUpdate": "no action"
2943
+ },
2944
+ "user_identities_provider_id_identity_providers_id_fk": {
2945
+ "name": "user_identities_provider_id_identity_providers_id_fk",
2946
+ "tableFrom": "user_identities",
2947
+ "tableTo": "identity_providers",
2948
+ "columnsFrom": [
2949
+ "provider_id"
2950
+ ],
2951
+ "columnsTo": [
2952
+ "id"
2953
+ ],
2954
+ "onDelete": "cascade",
2955
+ "onUpdate": "no action"
2956
+ }
2957
+ },
2958
+ "compositePrimaryKeys": {},
2959
+ "uniqueConstraints": {},
2960
+ "policies": {},
2961
+ "checkConstraints": {},
2962
+ "isRLSEnabled": false
2963
+ },
2964
+ "public.user_sessions": {
2965
+ "name": "user_sessions",
2966
+ "schema": "",
2967
+ "columns": {
2968
+ "id": {
2969
+ "name": "id",
2970
+ "type": "uuid",
2971
+ "primaryKey": true,
2972
+ "notNull": true,
2973
+ "default": "gen_random_uuid()"
2974
+ },
2975
+ "user_id": {
2976
+ "name": "user_id",
2977
+ "type": "uuid",
2978
+ "primaryKey": false,
2979
+ "notNull": true
2980
+ },
2981
+ "refresh_token_id": {
2982
+ "name": "refresh_token_id",
2983
+ "type": "text",
2984
+ "primaryKey": false,
2985
+ "notNull": true
2986
+ },
2987
+ "device_fingerprint": {
2988
+ "name": "device_fingerprint",
2989
+ "type": "text",
2990
+ "primaryKey": false,
2991
+ "notNull": false
2992
+ },
2993
+ "ip_address": {
2994
+ "name": "ip_address",
2995
+ "type": "text",
2996
+ "primaryKey": false,
2997
+ "notNull": false
2998
+ },
2999
+ "user_agent": {
3000
+ "name": "user_agent",
3001
+ "type": "text",
3002
+ "primaryKey": false,
3003
+ "notNull": false
3004
+ },
3005
+ "last_seen_at": {
3006
+ "name": "last_seen_at",
3007
+ "type": "timestamp with time zone",
3008
+ "primaryKey": false,
3009
+ "notNull": true,
3010
+ "default": "now()"
3011
+ },
3012
+ "expires_at": {
3013
+ "name": "expires_at",
3014
+ "type": "timestamp with time zone",
3015
+ "primaryKey": false,
3016
+ "notNull": true
3017
+ },
3018
+ "created_at": {
3019
+ "name": "created_at",
3020
+ "type": "timestamp with time zone",
3021
+ "primaryKey": false,
3022
+ "notNull": true,
3023
+ "default": "now()"
3024
+ }
3025
+ },
3026
+ "indexes": {
3027
+ "user_sessions_user_idx": {
3028
+ "name": "user_sessions_user_idx",
3029
+ "columns": [
3030
+ {
3031
+ "expression": "user_id",
3032
+ "isExpression": false,
3033
+ "asc": true,
3034
+ "nulls": "last"
3035
+ }
3036
+ ],
3037
+ "isUnique": false,
3038
+ "concurrently": false,
3039
+ "method": "btree",
3040
+ "with": {}
3041
+ },
3042
+ "user_sessions_refresh_token_idx": {
3043
+ "name": "user_sessions_refresh_token_idx",
3044
+ "columns": [
3045
+ {
3046
+ "expression": "refresh_token_id",
3047
+ "isExpression": false,
3048
+ "asc": true,
3049
+ "nulls": "last"
3050
+ }
3051
+ ],
3052
+ "isUnique": false,
3053
+ "concurrently": false,
3054
+ "method": "btree",
3055
+ "with": {}
3056
+ }
3057
+ },
3058
+ "foreignKeys": {
3059
+ "user_sessions_user_id_users_id_fk": {
3060
+ "name": "user_sessions_user_id_users_id_fk",
3061
+ "tableFrom": "user_sessions",
3062
+ "tableTo": "users",
3063
+ "columnsFrom": [
3064
+ "user_id"
3065
+ ],
3066
+ "columnsTo": [
3067
+ "id"
3068
+ ],
3069
+ "onDelete": "cascade",
3070
+ "onUpdate": "no action"
3071
+ }
3072
+ },
3073
+ "compositePrimaryKeys": {},
3074
+ "uniqueConstraints": {},
3075
+ "policies": {},
3076
+ "checkConstraints": {},
3077
+ "isRLSEnabled": false
3078
+ },
3079
+ "public.users": {
3080
+ "name": "users",
3081
+ "schema": "",
3082
+ "columns": {
3083
+ "id": {
3084
+ "name": "id",
3085
+ "type": "uuid",
3086
+ "primaryKey": true,
3087
+ "notNull": true,
3088
+ "default": "gen_random_uuid()"
3089
+ },
3090
+ "zitadel_user_id": {
3091
+ "name": "zitadel_user_id",
3092
+ "type": "text",
3093
+ "primaryKey": false,
3094
+ "notNull": false
3095
+ },
3096
+ "email": {
3097
+ "name": "email",
3098
+ "type": "text",
3099
+ "primaryKey": false,
3100
+ "notNull": true
3101
+ },
3102
+ "username": {
3103
+ "name": "username",
3104
+ "type": "text",
3105
+ "primaryKey": false,
3106
+ "notNull": true
3107
+ },
3108
+ "name": {
3109
+ "name": "name",
3110
+ "type": "text",
3111
+ "primaryKey": false,
3112
+ "notNull": false
3113
+ },
3114
+ "avatar_url": {
3115
+ "name": "avatar_url",
3116
+ "type": "text",
3117
+ "primaryKey": false,
3118
+ "notNull": false
3119
+ },
3120
+ "email_verified": {
3121
+ "name": "email_verified",
3122
+ "type": "boolean",
3123
+ "primaryKey": false,
3124
+ "notNull": true,
3125
+ "default": false
3126
+ },
3127
+ "email_verified_token": {
3128
+ "name": "email_verified_token",
3129
+ "type": "text",
3130
+ "primaryKey": false,
3131
+ "notNull": false
3132
+ },
3133
+ "provider": {
3134
+ "name": "provider",
3135
+ "type": "text",
3136
+ "primaryKey": false,
3137
+ "notNull": true,
3138
+ "default": "'password'"
3139
+ },
3140
+ "plan": {
3141
+ "name": "plan",
3142
+ "type": "text",
3143
+ "primaryKey": false,
3144
+ "notNull": true,
3145
+ "default": "'free'"
3146
+ },
3147
+ "role": {
3148
+ "name": "role",
3149
+ "type": "text",
3150
+ "primaryKey": false,
3151
+ "notNull": true,
3152
+ "default": "'user'"
3153
+ },
3154
+ "is_active": {
3155
+ "name": "is_active",
3156
+ "type": "boolean",
3157
+ "primaryKey": false,
3158
+ "notNull": true,
3159
+ "default": true
3160
+ },
3161
+ "account_review_required": {
3162
+ "name": "account_review_required",
3163
+ "type": "boolean",
3164
+ "primaryKey": false,
3165
+ "notNull": true,
3166
+ "default": false
3167
+ },
3168
+ "default_org_id": {
3169
+ "name": "default_org_id",
3170
+ "type": "uuid",
3171
+ "primaryKey": false,
3172
+ "notNull": false
3173
+ },
3174
+ "phone_number": {
3175
+ "name": "phone_number",
3176
+ "type": "text",
3177
+ "primaryKey": false,
3178
+ "notNull": false
3179
+ },
3180
+ "phone_verified": {
3181
+ "name": "phone_verified",
3182
+ "type": "boolean",
3183
+ "primaryKey": false,
3184
+ "notNull": true,
3185
+ "default": false
3186
+ },
3187
+ "metadata": {
3188
+ "name": "metadata",
3189
+ "type": "jsonb",
3190
+ "primaryKey": false,
3191
+ "notNull": true,
3192
+ "default": "'{}'::jsonb"
3193
+ },
3194
+ "password_hash": {
3195
+ "name": "password_hash",
3196
+ "type": "text",
3197
+ "primaryKey": false,
3198
+ "notNull": false
3199
+ },
3200
+ "totp_secret": {
3201
+ "name": "totp_secret",
3202
+ "type": "text",
3203
+ "primaryKey": false,
3204
+ "notNull": false
3205
+ },
3206
+ "totp_enabled": {
3207
+ "name": "totp_enabled",
3208
+ "type": "boolean",
3209
+ "primaryKey": false,
3210
+ "notNull": true,
3211
+ "default": false
3212
+ },
3213
+ "totp_verified_at": {
3214
+ "name": "totp_verified_at",
3215
+ "type": "timestamp with time zone",
3216
+ "primaryKey": false,
3217
+ "notNull": false
3218
+ },
3219
+ "totp_last_step": {
3220
+ "name": "totp_last_step",
3221
+ "type": "bigint",
3222
+ "primaryKey": false,
3223
+ "notNull": false
3224
+ },
3225
+ "failed_login_attempts": {
3226
+ "name": "failed_login_attempts",
3227
+ "type": "integer",
3228
+ "primaryKey": false,
3229
+ "notNull": true,
3230
+ "default": 0
3231
+ },
3232
+ "locked_until": {
3233
+ "name": "locked_until",
3234
+ "type": "timestamp with time zone",
3235
+ "primaryKey": false,
3236
+ "notNull": false
3237
+ },
3238
+ "created_at": {
3239
+ "name": "created_at",
3240
+ "type": "timestamp with time zone",
3241
+ "primaryKey": false,
3242
+ "notNull": true,
3243
+ "default": "now()"
3244
+ },
3245
+ "updated_at": {
3246
+ "name": "updated_at",
3247
+ "type": "timestamp with time zone",
3248
+ "primaryKey": false,
3249
+ "notNull": true,
3250
+ "default": "now()"
3251
+ }
3252
+ },
3253
+ "indexes": {
3254
+ "users_email_idx": {
3255
+ "name": "users_email_idx",
3256
+ "columns": [
3257
+ {
3258
+ "expression": "email",
3259
+ "isExpression": false,
3260
+ "asc": true,
3261
+ "nulls": "last"
3262
+ }
3263
+ ],
3264
+ "isUnique": false,
3265
+ "concurrently": false,
3266
+ "method": "btree",
3267
+ "with": {}
3268
+ },
3269
+ "users_zitadel_idx": {
3270
+ "name": "users_zitadel_idx",
3271
+ "columns": [
3272
+ {
3273
+ "expression": "zitadel_user_id",
3274
+ "isExpression": false,
3275
+ "asc": true,
3276
+ "nulls": "last"
3277
+ }
3278
+ ],
3279
+ "isUnique": false,
3280
+ "concurrently": false,
3281
+ "method": "btree",
3282
+ "with": {}
3283
+ },
3284
+ "users_default_org_idx": {
3285
+ "name": "users_default_org_idx",
3286
+ "columns": [
3287
+ {
3288
+ "expression": "default_org_id",
3289
+ "isExpression": false,
3290
+ "asc": true,
3291
+ "nulls": "last"
3292
+ }
3293
+ ],
3294
+ "isUnique": false,
3295
+ "concurrently": false,
3296
+ "method": "btree",
3297
+ "with": {}
3298
+ }
3299
+ },
3300
+ "foreignKeys": {
3301
+ "users_default_org_id_organizations_id_fk": {
3302
+ "name": "users_default_org_id_organizations_id_fk",
3303
+ "tableFrom": "users",
3304
+ "tableTo": "organizations",
3305
+ "columnsFrom": [
3306
+ "default_org_id"
3307
+ ],
3308
+ "columnsTo": [
3309
+ "id"
3310
+ ],
3311
+ "onDelete": "set null",
3312
+ "onUpdate": "no action"
3313
+ }
3314
+ },
3315
+ "compositePrimaryKeys": {},
3316
+ "uniqueConstraints": {
3317
+ "users_zitadel_user_id_unique": {
3318
+ "name": "users_zitadel_user_id_unique",
3319
+ "nullsNotDistinct": false,
3320
+ "columns": [
3321
+ "zitadel_user_id"
3322
+ ]
3323
+ },
3324
+ "users_email_unique": {
3325
+ "name": "users_email_unique",
3326
+ "nullsNotDistinct": false,
3327
+ "columns": [
3328
+ "email"
3329
+ ]
3330
+ },
3331
+ "users_username_unique": {
3332
+ "name": "users_username_unique",
3333
+ "nullsNotDistinct": false,
3334
+ "columns": [
3335
+ "username"
3336
+ ]
3337
+ }
3338
+ },
3339
+ "policies": {},
3340
+ "checkConstraints": {
3341
+ "users_platform_role_check": {
3342
+ "name": "users_platform_role_check",
3343
+ "value": "role in ('owner', 'user')"
3344
+ }
3345
+ },
3346
+ "isRLSEnabled": false
3347
+ },
3348
+ "public.webauthn_credentials": {
3349
+ "name": "webauthn_credentials",
3350
+ "schema": "",
3351
+ "columns": {
3352
+ "id": {
3353
+ "name": "id",
3354
+ "type": "uuid",
3355
+ "primaryKey": true,
3356
+ "notNull": true,
3357
+ "default": "gen_random_uuid()"
3358
+ },
3359
+ "user_id": {
3360
+ "name": "user_id",
3361
+ "type": "uuid",
3362
+ "primaryKey": false,
3363
+ "notNull": true
3364
+ },
3365
+ "credential_id": {
3366
+ "name": "credential_id",
3367
+ "type": "text",
3368
+ "primaryKey": false,
3369
+ "notNull": true
3370
+ },
3371
+ "public_key": {
3372
+ "name": "public_key",
3373
+ "type": "text",
3374
+ "primaryKey": false,
3375
+ "notNull": true
3376
+ },
3377
+ "counter": {
3378
+ "name": "counter",
3379
+ "type": "integer",
3380
+ "primaryKey": false,
3381
+ "notNull": true,
3382
+ "default": 0
3383
+ },
3384
+ "transports": {
3385
+ "name": "transports",
3386
+ "type": "text[]",
3387
+ "primaryKey": false,
3388
+ "notNull": true,
3389
+ "default": "'{}'::text[]"
3390
+ },
3391
+ "aaguid": {
3392
+ "name": "aaguid",
3393
+ "type": "text",
3394
+ "primaryKey": false,
3395
+ "notNull": false
3396
+ },
3397
+ "device_name": {
3398
+ "name": "device_name",
3399
+ "type": "text",
3400
+ "primaryKey": false,
3401
+ "notNull": false
3402
+ },
3403
+ "last_used_at": {
3404
+ "name": "last_used_at",
3405
+ "type": "timestamp with time zone",
3406
+ "primaryKey": false,
3407
+ "notNull": false
3408
+ },
3409
+ "created_at": {
3410
+ "name": "created_at",
3411
+ "type": "timestamp with time zone",
3412
+ "primaryKey": false,
3413
+ "notNull": true,
3414
+ "default": "now()"
3415
+ }
3416
+ },
3417
+ "indexes": {
3418
+ "webauthn_credentials_user_idx": {
3419
+ "name": "webauthn_credentials_user_idx",
3420
+ "columns": [
3421
+ {
3422
+ "expression": "user_id",
3423
+ "isExpression": false,
3424
+ "asc": true,
3425
+ "nulls": "last"
3426
+ }
3427
+ ],
3428
+ "isUnique": false,
3429
+ "concurrently": false,
3430
+ "method": "btree",
3431
+ "with": {}
3432
+ }
3433
+ },
3434
+ "foreignKeys": {
3435
+ "webauthn_credentials_user_id_users_id_fk": {
3436
+ "name": "webauthn_credentials_user_id_users_id_fk",
3437
+ "tableFrom": "webauthn_credentials",
3438
+ "tableTo": "users",
3439
+ "columnsFrom": [
3440
+ "user_id"
3441
+ ],
3442
+ "columnsTo": [
3443
+ "id"
3444
+ ],
3445
+ "onDelete": "cascade",
3446
+ "onUpdate": "no action"
3447
+ }
3448
+ },
3449
+ "compositePrimaryKeys": {},
3450
+ "uniqueConstraints": {
3451
+ "webauthn_credentials_credential_id_unique": {
3452
+ "name": "webauthn_credentials_credential_id_unique",
3453
+ "nullsNotDistinct": false,
3454
+ "columns": [
3455
+ "credential_id"
3456
+ ]
3457
+ }
3458
+ },
3459
+ "policies": {},
3460
+ "checkConstraints": {},
3461
+ "isRLSEnabled": false
3462
+ },
3463
+ "public.webhook_deliveries": {
3464
+ "name": "webhook_deliveries",
3465
+ "schema": "",
3466
+ "columns": {
3467
+ "id": {
3468
+ "name": "id",
3469
+ "type": "uuid",
3470
+ "primaryKey": true,
3471
+ "notNull": true,
3472
+ "default": "gen_random_uuid()"
3473
+ },
3474
+ "endpoint_id": {
3475
+ "name": "endpoint_id",
3476
+ "type": "uuid",
3477
+ "primaryKey": false,
3478
+ "notNull": true
3479
+ },
3480
+ "event_type": {
3481
+ "name": "event_type",
3482
+ "type": "text",
3483
+ "primaryKey": false,
3484
+ "notNull": true
3485
+ },
3486
+ "payload": {
3487
+ "name": "payload",
3488
+ "type": "jsonb",
3489
+ "primaryKey": false,
3490
+ "notNull": true,
3491
+ "default": "'{}'::jsonb"
3492
+ },
3493
+ "status": {
3494
+ "name": "status",
3495
+ "type": "text",
3496
+ "primaryKey": false,
3497
+ "notNull": true,
3498
+ "default": "'pending'"
3499
+ },
3500
+ "attempts": {
3501
+ "name": "attempts",
3502
+ "type": "integer",
3503
+ "primaryKey": false,
3504
+ "notNull": true,
3505
+ "default": 0
3506
+ },
3507
+ "response_status": {
3508
+ "name": "response_status",
3509
+ "type": "integer",
3510
+ "primaryKey": false,
3511
+ "notNull": false
3512
+ },
3513
+ "response_body": {
3514
+ "name": "response_body",
3515
+ "type": "text",
3516
+ "primaryKey": false,
3517
+ "notNull": false
3518
+ },
3519
+ "last_attempt_at": {
3520
+ "name": "last_attempt_at",
3521
+ "type": "timestamp with time zone",
3522
+ "primaryKey": false,
3523
+ "notNull": false
3524
+ },
3525
+ "created_at": {
3526
+ "name": "created_at",
3527
+ "type": "timestamp with time zone",
3528
+ "primaryKey": false,
3529
+ "notNull": true,
3530
+ "default": "now()"
3531
+ }
3532
+ },
3533
+ "indexes": {
3534
+ "webhook_deliveries_endpoint_idx": {
3535
+ "name": "webhook_deliveries_endpoint_idx",
3536
+ "columns": [
3537
+ {
3538
+ "expression": "endpoint_id",
3539
+ "isExpression": false,
3540
+ "asc": true,
3541
+ "nulls": "last"
3542
+ }
3543
+ ],
3544
+ "isUnique": false,
3545
+ "concurrently": false,
3546
+ "method": "btree",
3547
+ "with": {}
3548
+ },
3549
+ "webhook_deliveries_status_idx": {
3550
+ "name": "webhook_deliveries_status_idx",
3551
+ "columns": [
3552
+ {
3553
+ "expression": "status",
3554
+ "isExpression": false,
3555
+ "asc": true,
3556
+ "nulls": "last"
3557
+ }
3558
+ ],
3559
+ "isUnique": false,
3560
+ "concurrently": false,
3561
+ "method": "btree",
3562
+ "with": {}
3563
+ }
3564
+ },
3565
+ "foreignKeys": {
3566
+ "webhook_deliveries_endpoint_id_webhook_endpoints_id_fk": {
3567
+ "name": "webhook_deliveries_endpoint_id_webhook_endpoints_id_fk",
3568
+ "tableFrom": "webhook_deliveries",
3569
+ "tableTo": "webhook_endpoints",
3570
+ "columnsFrom": [
3571
+ "endpoint_id"
3572
+ ],
3573
+ "columnsTo": [
3574
+ "id"
3575
+ ],
3576
+ "onDelete": "cascade",
3577
+ "onUpdate": "no action"
3578
+ }
3579
+ },
3580
+ "compositePrimaryKeys": {},
3581
+ "uniqueConstraints": {},
3582
+ "policies": {},
3583
+ "checkConstraints": {},
3584
+ "isRLSEnabled": false
3585
+ },
3586
+ "public.webhook_endpoints": {
3587
+ "name": "webhook_endpoints",
3588
+ "schema": "",
3589
+ "columns": {
3590
+ "id": {
3591
+ "name": "id",
3592
+ "type": "uuid",
3593
+ "primaryKey": true,
3594
+ "notNull": true,
3595
+ "default": "gen_random_uuid()"
3596
+ },
3597
+ "app_id": {
3598
+ "name": "app_id",
3599
+ "type": "uuid",
3600
+ "primaryKey": false,
3601
+ "notNull": false
3602
+ },
3603
+ "url": {
3604
+ "name": "url",
3605
+ "type": "text",
3606
+ "primaryKey": false,
3607
+ "notNull": true
3608
+ },
3609
+ "description": {
3610
+ "name": "description",
3611
+ "type": "text",
3612
+ "primaryKey": false,
3613
+ "notNull": false
3614
+ },
3615
+ "events": {
3616
+ "name": "events",
3617
+ "type": "text[]",
3618
+ "primaryKey": false,
3619
+ "notNull": true,
3620
+ "default": "'{}'::text[]"
3621
+ },
3622
+ "secret": {
3623
+ "name": "secret",
3624
+ "type": "text",
3625
+ "primaryKey": false,
3626
+ "notNull": true
3627
+ },
3628
+ "is_active": {
3629
+ "name": "is_active",
3630
+ "type": "boolean",
3631
+ "primaryKey": false,
3632
+ "notNull": true,
3633
+ "default": true
3634
+ },
3635
+ "created_at": {
3636
+ "name": "created_at",
3637
+ "type": "timestamp with time zone",
3638
+ "primaryKey": false,
3639
+ "notNull": true,
3640
+ "default": "now()"
3641
+ },
3642
+ "updated_at": {
3643
+ "name": "updated_at",
3644
+ "type": "timestamp with time zone",
3645
+ "primaryKey": false,
3646
+ "notNull": true,
3647
+ "default": "now()"
3648
+ }
3649
+ },
3650
+ "indexes": {
3651
+ "webhook_endpoints_app_idx": {
3652
+ "name": "webhook_endpoints_app_idx",
3653
+ "columns": [
3654
+ {
3655
+ "expression": "app_id",
3656
+ "isExpression": false,
3657
+ "asc": true,
3658
+ "nulls": "last"
3659
+ }
3660
+ ],
3661
+ "isUnique": false,
3662
+ "concurrently": false,
3663
+ "method": "btree",
3664
+ "with": {}
3665
+ }
3666
+ },
3667
+ "foreignKeys": {
3668
+ "webhook_endpoints_app_id_applications_id_fk": {
3669
+ "name": "webhook_endpoints_app_id_applications_id_fk",
3670
+ "tableFrom": "webhook_endpoints",
3671
+ "tableTo": "applications",
3672
+ "columnsFrom": [
3673
+ "app_id"
3674
+ ],
3675
+ "columnsTo": [
3676
+ "id"
3677
+ ],
3678
+ "onDelete": "cascade",
3679
+ "onUpdate": "no action"
3680
+ }
3681
+ },
3682
+ "compositePrimaryKeys": {},
3683
+ "uniqueConstraints": {},
3684
+ "policies": {},
3685
+ "checkConstraints": {},
3686
+ "isRLSEnabled": false
3687
+ },
3688
+ "public.workflow_runs": {
3689
+ "name": "workflow_runs",
3690
+ "schema": "",
3691
+ "columns": {
3692
+ "id": {
3693
+ "name": "id",
3694
+ "type": "uuid",
3695
+ "primaryKey": true,
3696
+ "notNull": true,
3697
+ "default": "gen_random_uuid()"
3698
+ },
3699
+ "workflow_id": {
3700
+ "name": "workflow_id",
3701
+ "type": "uuid",
3702
+ "primaryKey": false,
3703
+ "notNull": true
3704
+ },
3705
+ "trigger_event": {
3706
+ "name": "trigger_event",
3707
+ "type": "text",
3708
+ "primaryKey": false,
3709
+ "notNull": true
3710
+ },
3711
+ "payload": {
3712
+ "name": "payload",
3713
+ "type": "jsonb",
3714
+ "primaryKey": false,
3715
+ "notNull": true,
3716
+ "default": "'{}'::jsonb"
3717
+ },
3718
+ "status": {
3719
+ "name": "status",
3720
+ "type": "text",
3721
+ "primaryKey": false,
3722
+ "notNull": true,
3723
+ "default": "'pending'"
3724
+ },
3725
+ "started_at": {
3726
+ "name": "started_at",
3727
+ "type": "timestamp with time zone",
3728
+ "primaryKey": false,
3729
+ "notNull": false
3730
+ },
3731
+ "finished_at": {
3732
+ "name": "finished_at",
3733
+ "type": "timestamp with time zone",
3734
+ "primaryKey": false,
3735
+ "notNull": false
3736
+ },
3737
+ "log": {
3738
+ "name": "log",
3739
+ "type": "jsonb",
3740
+ "primaryKey": false,
3741
+ "notNull": true,
3742
+ "default": "'[]'::jsonb"
3743
+ }
3744
+ },
3745
+ "indexes": {
3746
+ "workflow_runs_workflow_idx": {
3747
+ "name": "workflow_runs_workflow_idx",
3748
+ "columns": [
3749
+ {
3750
+ "expression": "workflow_id",
3751
+ "isExpression": false,
3752
+ "asc": true,
3753
+ "nulls": "last"
3754
+ }
3755
+ ],
3756
+ "isUnique": false,
3757
+ "concurrently": false,
3758
+ "method": "btree",
3759
+ "with": {}
3760
+ }
3761
+ },
3762
+ "foreignKeys": {
3763
+ "workflow_runs_workflow_id_workflows_id_fk": {
3764
+ "name": "workflow_runs_workflow_id_workflows_id_fk",
3765
+ "tableFrom": "workflow_runs",
3766
+ "tableTo": "workflows",
3767
+ "columnsFrom": [
3768
+ "workflow_id"
3769
+ ],
3770
+ "columnsTo": [
3771
+ "id"
3772
+ ],
3773
+ "onDelete": "cascade",
3774
+ "onUpdate": "no action"
3775
+ }
3776
+ },
3777
+ "compositePrimaryKeys": {},
3778
+ "uniqueConstraints": {},
3779
+ "policies": {},
3780
+ "checkConstraints": {},
3781
+ "isRLSEnabled": false
3782
+ },
3783
+ "public.workflows": {
3784
+ "name": "workflows",
3785
+ "schema": "",
3786
+ "columns": {
3787
+ "id": {
3788
+ "name": "id",
3789
+ "type": "uuid",
3790
+ "primaryKey": true,
3791
+ "notNull": true,
3792
+ "default": "gen_random_uuid()"
3793
+ },
3794
+ "org_id": {
3795
+ "name": "org_id",
3796
+ "type": "uuid",
3797
+ "primaryKey": false,
3798
+ "notNull": false
3799
+ },
3800
+ "name": {
3801
+ "name": "name",
3802
+ "type": "text",
3803
+ "primaryKey": false,
3804
+ "notNull": true
3805
+ },
3806
+ "trigger": {
3807
+ "name": "trigger",
3808
+ "type": "text",
3809
+ "primaryKey": false,
3810
+ "notNull": true
3811
+ },
3812
+ "definition": {
3813
+ "name": "definition",
3814
+ "type": "jsonb",
3815
+ "primaryKey": false,
3816
+ "notNull": true,
3817
+ "default": "'{}'::jsonb"
3818
+ },
3819
+ "is_active": {
3820
+ "name": "is_active",
3821
+ "type": "boolean",
3822
+ "primaryKey": false,
3823
+ "notNull": true,
3824
+ "default": true
3825
+ },
3826
+ "created_at": {
3827
+ "name": "created_at",
3828
+ "type": "timestamp with time zone",
3829
+ "primaryKey": false,
3830
+ "notNull": true,
3831
+ "default": "now()"
3832
+ },
3833
+ "updated_at": {
3834
+ "name": "updated_at",
3835
+ "type": "timestamp with time zone",
3836
+ "primaryKey": false,
3837
+ "notNull": true,
3838
+ "default": "now()"
3839
+ }
3840
+ },
3841
+ "indexes": {
3842
+ "workflows_trigger_idx": {
3843
+ "name": "workflows_trigger_idx",
3844
+ "columns": [
3845
+ {
3846
+ "expression": "trigger",
3847
+ "isExpression": false,
3848
+ "asc": true,
3849
+ "nulls": "last"
3850
+ }
3851
+ ],
3852
+ "isUnique": false,
3853
+ "concurrently": false,
3854
+ "method": "btree",
3855
+ "with": {}
3856
+ }
3857
+ },
3858
+ "foreignKeys": {
3859
+ "workflows_org_id_organizations_id_fk": {
3860
+ "name": "workflows_org_id_organizations_id_fk",
3861
+ "tableFrom": "workflows",
3862
+ "tableTo": "organizations",
3863
+ "columnsFrom": [
3864
+ "org_id"
3865
+ ],
3866
+ "columnsTo": [
3867
+ "id"
3868
+ ],
3869
+ "onDelete": "cascade",
3870
+ "onUpdate": "no action"
3871
+ }
3872
+ },
3873
+ "compositePrimaryKeys": {},
3874
+ "uniqueConstraints": {},
3875
+ "policies": {},
3876
+ "checkConstraints": {},
3877
+ "isRLSEnabled": false
3878
+ }
3879
+ },
3880
+ "enums": {},
3881
+ "schemas": {},
3882
+ "sequences": {},
3883
+ "roles": {},
3884
+ "policies": {},
3885
+ "views": {},
3886
+ "_meta": {
3887
+ "columns": {},
3888
+ "schemas": {},
3889
+ "tables": {}
3890
+ }
3891
+ }