@hilbras/keystone 1.6.0 → 1.9.0

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