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