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