@hilbras/keystone 1.5.0 → 1.9.0

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