@hilbras/keystone 1.1.0

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