@shipfox/api-auth 18.0.0 → 20.0.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 (151) hide show
  1. package/.turbo/turbo-build.log +17 -2
  2. package/CHANGELOG.md +47 -0
  3. package/README.md +24 -9
  4. package/dist/core/administration.d.ts +15 -0
  5. package/dist/core/administration.d.ts.map +1 -1
  6. package/dist/core/administration.js +44 -2
  7. package/dist/core/administration.js.map +1 -1
  8. package/dist/core/auth.d.ts.map +1 -1
  9. package/dist/core/auth.js +5 -3
  10. package/dist/core/auth.js.map +1 -1
  11. package/dist/core/cimd.d.ts +39 -0
  12. package/dist/core/cimd.d.ts.map +1 -0
  13. package/dist/core/cimd.js +392 -0
  14. package/dist/core/cimd.js.map +1 -0
  15. package/dist/core/entities/agent-access.d.ts +75 -0
  16. package/dist/core/entities/agent-access.d.ts.map +1 -0
  17. package/dist/core/entities/agent-access.js +3 -0
  18. package/dist/core/entities/agent-access.js.map +1 -0
  19. package/dist/core/errors.d.ts +17 -0
  20. package/dist/core/errors.d.ts.map +1 -1
  21. package/dist/core/errors.js +32 -0
  22. package/dist/core/errors.js.map +1 -1
  23. package/dist/core/oauth-client-resolver.d.ts +54 -0
  24. package/dist/core/oauth-client-resolver.d.ts.map +1 -0
  25. package/dist/core/oauth-client-resolver.js +154 -0
  26. package/dist/core/oauth-client-resolver.js.map +1 -0
  27. package/dist/core/oauth-client.d.ts +39 -0
  28. package/dist/core/oauth-client.d.ts.map +1 -0
  29. package/dist/core/oauth-client.js +236 -0
  30. package/dist/core/oauth-client.js.map +1 -0
  31. package/dist/db/admin-user-moderation.d.ts.map +1 -1
  32. package/dist/db/admin-user-moderation.js +30 -26
  33. package/dist/db/admin-user-moderation.js.map +1 -1
  34. package/dist/db/admin-user-summary.d.ts +22 -0
  35. package/dist/db/admin-user-summary.d.ts.map +1 -1
  36. package/dist/db/admin-user-summary.js +75 -1
  37. package/dist/db/admin-user-summary.js.map +1 -1
  38. package/dist/db/admin-users.d.ts +11 -0
  39. package/dist/db/admin-users.d.ts.map +1 -1
  40. package/dist/db/admin-users.js +4 -1
  41. package/dist/db/admin-users.js.map +1 -1
  42. package/dist/db/agent-access-retention.d.ts +10 -0
  43. package/dist/db/agent-access-retention.d.ts.map +1 -0
  44. package/dist/db/agent-access-retention.js +11 -0
  45. package/dist/db/agent-access-retention.js.map +1 -0
  46. package/dist/db/agent-access.d.ts +255 -0
  47. package/dist/db/agent-access.d.ts.map +1 -0
  48. package/dist/db/agent-access.js +705 -0
  49. package/dist/db/agent-access.js.map +1 -0
  50. package/dist/db/db.d.ts +2604 -238
  51. package/dist/db/db.d.ts.map +1 -1
  52. package/dist/db/db.js +7 -0
  53. package/dist/db/db.js.map +1 -1
  54. package/dist/db/schema/agent-access.d.ts +1204 -0
  55. package/dist/db/schema/agent-access.d.ts.map +1 -0
  56. package/dist/db/schema/agent-access.js +267 -0
  57. package/dist/db/schema/agent-access.js.map +1 -0
  58. package/dist/db/schema/users.d.ts.map +1 -1
  59. package/dist/db/schema/users.js +8 -3
  60. package/dist/db/schema/users.js.map +1 -1
  61. package/dist/index.d.ts +11 -2
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +26 -2
  64. package/dist/index.js.map +1 -1
  65. package/dist/metrics/instance.d.ts +1 -1
  66. package/dist/metrics/instance.d.ts.map +1 -1
  67. package/dist/metrics/instance.js.map +1 -1
  68. package/dist/presentation/routes/administration.d.ts.map +1 -1
  69. package/dist/presentation/routes/administration.js +123 -20
  70. package/dist/presentation/routes/administration.js.map +1 -1
  71. package/dist/presentation/routes/email-verification/verify-email-resend.d.ts.map +1 -1
  72. package/dist/presentation/routes/email-verification/verify-email-resend.js +6 -1
  73. package/dist/presentation/routes/email-verification/verify-email-resend.js.map +1 -1
  74. package/dist/presentation/routes/oauth.d.ts +9 -0
  75. package/dist/presentation/routes/oauth.d.ts.map +1 -0
  76. package/dist/presentation/routes/oauth.js +150 -0
  77. package/dist/presentation/routes/oauth.js.map +1 -0
  78. package/dist/presentation/routes/rate-limit.d.ts.map +1 -1
  79. package/dist/presentation/routes/rate-limit.js +34 -0
  80. package/dist/presentation/routes/rate-limit.js.map +1 -1
  81. package/dist/presentation/routes/registration/signup.d.ts.map +1 -1
  82. package/dist/presentation/routes/registration/signup.js +59 -50
  83. package/dist/presentation/routes/registration/signup.js.map +1 -1
  84. package/dist/temporal/activities/agent-access-retention.d.ts +13 -0
  85. package/dist/temporal/activities/agent-access-retention.d.ts.map +1 -0
  86. package/dist/temporal/activities/agent-access-retention.js +58 -0
  87. package/dist/temporal/activities/agent-access-retention.js.map +1 -0
  88. package/dist/temporal/activities/index.d.ts +5 -0
  89. package/dist/temporal/activities/index.d.ts.map +1 -0
  90. package/dist/temporal/activities/index.js +8 -0
  91. package/dist/temporal/activities/index.js.map +1 -0
  92. package/dist/temporal/constants.d.ts +2 -0
  93. package/dist/temporal/constants.d.ts.map +1 -0
  94. package/dist/temporal/constants.js +3 -0
  95. package/dist/temporal/constants.js.map +1 -0
  96. package/dist/temporal/workflows/agent-access-retention-cron.d.ts +2 -0
  97. package/dist/temporal/workflows/agent-access-retention-cron.d.ts.map +1 -0
  98. package/dist/temporal/workflows/agent-access-retention-cron.js +22 -0
  99. package/dist/temporal/workflows/agent-access-retention-cron.js.map +1 -0
  100. package/dist/temporal/workflows/index.bundle.js +25227 -0
  101. package/dist/temporal/workflows/index.bundle.meta.json +1 -0
  102. package/dist/temporal/workflows/index.d.ts +2 -0
  103. package/dist/temporal/workflows/index.d.ts.map +1 -0
  104. package/dist/temporal/workflows/index.js +3 -0
  105. package/dist/temporal/workflows/index.js.map +1 -0
  106. package/dist/tsconfig.test.tsbuildinfo +1 -1
  107. package/drizzle/0003_brainy_luckman.sql +6 -0
  108. package/drizzle/0004_yummy_runaways.sql +110 -0
  109. package/drizzle/meta/0003_snapshot.json +844 -0
  110. package/drizzle/meta/0004_snapshot.json +1751 -0
  111. package/drizzle/meta/_journal.json +14 -0
  112. package/package.json +11 -8
  113. package/src/core/admin-role.test.ts +70 -0
  114. package/src/core/administration.ts +78 -1
  115. package/src/core/auth.ts +3 -5
  116. package/src/core/cimd.test.ts +213 -0
  117. package/src/core/cimd.ts +532 -0
  118. package/src/core/entities/agent-access.ts +80 -0
  119. package/src/core/errors.ts +48 -0
  120. package/src/core/oauth-client-resolver.test.ts +198 -0
  121. package/src/core/oauth-client-resolver.ts +253 -0
  122. package/src/core/oauth-client.test.ts +157 -0
  123. package/src/core/oauth-client.ts +331 -0
  124. package/src/db/admin-user-moderation.ts +53 -45
  125. package/src/db/admin-user-summary.test.ts +228 -0
  126. package/src/db/admin-user-summary.ts +143 -1
  127. package/src/db/admin-users.ts +21 -1
  128. package/src/db/agent-access-retention.ts +10 -0
  129. package/src/db/agent-access.test.ts +1064 -0
  130. package/src/db/agent-access.ts +1491 -0
  131. package/src/db/db.ts +14 -0
  132. package/src/db/schema/agent-access.ts +273 -0
  133. package/src/db/schema/users.ts +9 -3
  134. package/src/index.test.ts +27 -0
  135. package/src/index.ts +82 -0
  136. package/src/metrics/instance.ts +6 -1
  137. package/src/presentation/routes/administration.test.ts +359 -2
  138. package/src/presentation/routes/administration.ts +142 -20
  139. package/src/presentation/routes/email-verification/verify-email-resend.ts +7 -1
  140. package/src/presentation/routes/oauth.test.ts +133 -0
  141. package/src/presentation/routes/oauth.ts +144 -0
  142. package/src/presentation/routes/rate-limit.ts +16 -0
  143. package/src/presentation/routes/registration/signup.ts +52 -41
  144. package/src/temporal/activities/agent-access-retention.ts +76 -0
  145. package/src/temporal/activities/index.ts +5 -0
  146. package/src/temporal/constants.ts +1 -0
  147. package/src/temporal/workflows/agent-access-retention-cron.ts +23 -0
  148. package/src/temporal/workflows/index.ts +1 -0
  149. package/test/globalSetup.ts +1 -1
  150. package/test/routes.ts +3 -1
  151. package/tsconfig.build.tsbuildinfo +1 -1
@@ -0,0 +1,1751 @@
1
+ {
2
+ "id": "c22b8dbd-5550-4d0f-b131-5e42a13e8cdc",
3
+ "prevId": "391db994-0ade-4426-b398-e47d8b4101cf",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.auth_admin_command_results": {
8
+ "name": "auth_admin_command_results",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true,
16
+ "default": "uuidv7()"
17
+ },
18
+ "actor_id": {
19
+ "name": "actor_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "idempotency_key_fingerprint": {
25
+ "name": "idempotency_key_fingerprint",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true
29
+ },
30
+ "command": {
31
+ "name": "command",
32
+ "type": "text",
33
+ "primaryKey": false,
34
+ "notNull": true
35
+ },
36
+ "request_fingerprint": {
37
+ "name": "request_fingerprint",
38
+ "type": "text",
39
+ "primaryKey": false,
40
+ "notNull": true
41
+ },
42
+ "result": {
43
+ "name": "result",
44
+ "type": "jsonb",
45
+ "primaryKey": false,
46
+ "notNull": true
47
+ },
48
+ "created_at": {
49
+ "name": "created_at",
50
+ "type": "timestamp with time zone",
51
+ "primaryKey": false,
52
+ "notNull": true,
53
+ "default": "now()"
54
+ }
55
+ },
56
+ "indexes": {
57
+ "auth_admin_command_results_actor_key_unique": {
58
+ "name": "auth_admin_command_results_actor_key_unique",
59
+ "columns": [
60
+ {
61
+ "expression": "actor_id",
62
+ "isExpression": false,
63
+ "asc": true,
64
+ "nulls": "last"
65
+ },
66
+ {
67
+ "expression": "idempotency_key_fingerprint",
68
+ "isExpression": false,
69
+ "asc": true,
70
+ "nulls": "last"
71
+ }
72
+ ],
73
+ "isUnique": true,
74
+ "concurrently": false,
75
+ "method": "btree",
76
+ "with": {}
77
+ }
78
+ },
79
+ "foreignKeys": {
80
+ "auth_admin_command_results_actor_id_auth_users_id_fk": {
81
+ "name": "auth_admin_command_results_actor_id_auth_users_id_fk",
82
+ "tableFrom": "auth_admin_command_results",
83
+ "tableTo": "auth_users",
84
+ "columnsFrom": ["actor_id"],
85
+ "columnsTo": ["id"],
86
+ "onDelete": "cascade",
87
+ "onUpdate": "no action"
88
+ }
89
+ },
90
+ "compositePrimaryKeys": {},
91
+ "uniqueConstraints": {},
92
+ "policies": {},
93
+ "checkConstraints": {},
94
+ "isRLSEnabled": false
95
+ },
96
+ "public.auth_admin_grants": {
97
+ "name": "auth_admin_grants",
98
+ "schema": "",
99
+ "columns": {
100
+ "id": {
101
+ "name": "id",
102
+ "type": "uuid",
103
+ "primaryKey": true,
104
+ "notNull": true,
105
+ "default": "uuidv7()"
106
+ },
107
+ "user_id": {
108
+ "name": "user_id",
109
+ "type": "uuid",
110
+ "primaryKey": false,
111
+ "notNull": true
112
+ },
113
+ "role": {
114
+ "name": "role",
115
+ "type": "auth_admin_role",
116
+ "typeSchema": "public",
117
+ "primaryKey": false,
118
+ "notNull": true
119
+ },
120
+ "revoked_at": {
121
+ "name": "revoked_at",
122
+ "type": "timestamp with time zone",
123
+ "primaryKey": false,
124
+ "notNull": false
125
+ },
126
+ "created_at": {
127
+ "name": "created_at",
128
+ "type": "timestamp with time zone",
129
+ "primaryKey": false,
130
+ "notNull": true,
131
+ "default": "now()"
132
+ },
133
+ "updated_at": {
134
+ "name": "updated_at",
135
+ "type": "timestamp with time zone",
136
+ "primaryKey": false,
137
+ "notNull": true,
138
+ "default": "now()"
139
+ }
140
+ },
141
+ "indexes": {
142
+ "auth_admin_grants_user_id_idx": {
143
+ "name": "auth_admin_grants_user_id_idx",
144
+ "columns": [
145
+ {
146
+ "expression": "user_id",
147
+ "isExpression": false,
148
+ "asc": true,
149
+ "nulls": "last"
150
+ }
151
+ ],
152
+ "isUnique": false,
153
+ "concurrently": false,
154
+ "method": "btree",
155
+ "with": {}
156
+ },
157
+ "auth_admin_grants_active_owners_idx": {
158
+ "name": "auth_admin_grants_active_owners_idx",
159
+ "columns": [
160
+ {
161
+ "expression": "user_id",
162
+ "isExpression": false,
163
+ "asc": true,
164
+ "nulls": "last"
165
+ }
166
+ ],
167
+ "isUnique": false,
168
+ "where": "\"auth_admin_grants\".\"role\" = 'admin-owner' AND \"auth_admin_grants\".\"revoked_at\" IS NULL",
169
+ "concurrently": false,
170
+ "method": "btree",
171
+ "with": {}
172
+ },
173
+ "auth_admin_grants_active_user_role_unique": {
174
+ "name": "auth_admin_grants_active_user_role_unique",
175
+ "columns": [
176
+ {
177
+ "expression": "user_id",
178
+ "isExpression": false,
179
+ "asc": true,
180
+ "nulls": "last"
181
+ },
182
+ {
183
+ "expression": "role",
184
+ "isExpression": false,
185
+ "asc": true,
186
+ "nulls": "last"
187
+ }
188
+ ],
189
+ "isUnique": true,
190
+ "where": "\"auth_admin_grants\".\"revoked_at\" IS NULL",
191
+ "concurrently": false,
192
+ "method": "btree",
193
+ "with": {}
194
+ }
195
+ },
196
+ "foreignKeys": {
197
+ "auth_admin_grants_user_id_auth_users_id_fk": {
198
+ "name": "auth_admin_grants_user_id_auth_users_id_fk",
199
+ "tableFrom": "auth_admin_grants",
200
+ "tableTo": "auth_users",
201
+ "columnsFrom": ["user_id"],
202
+ "columnsTo": ["id"],
203
+ "onDelete": "cascade",
204
+ "onUpdate": "no action"
205
+ }
206
+ },
207
+ "compositePrimaryKeys": {},
208
+ "uniqueConstraints": {},
209
+ "policies": {},
210
+ "checkConstraints": {},
211
+ "isRLSEnabled": false
212
+ },
213
+ "public.auth_agent_authorization_codes": {
214
+ "name": "auth_agent_authorization_codes",
215
+ "schema": "",
216
+ "columns": {
217
+ "id": {
218
+ "name": "id",
219
+ "type": "uuid",
220
+ "primaryKey": true,
221
+ "notNull": true,
222
+ "default": "uuidv7()"
223
+ },
224
+ "grant_id": {
225
+ "name": "grant_id",
226
+ "type": "uuid",
227
+ "primaryKey": false,
228
+ "notNull": true
229
+ },
230
+ "hashed_code": {
231
+ "name": "hashed_code",
232
+ "type": "text",
233
+ "primaryKey": false,
234
+ "notNull": true
235
+ },
236
+ "code_challenge": {
237
+ "name": "code_challenge",
238
+ "type": "text",
239
+ "primaryKey": false,
240
+ "notNull": true
241
+ },
242
+ "redirect_uri": {
243
+ "name": "redirect_uri",
244
+ "type": "text",
245
+ "primaryKey": false,
246
+ "notNull": true
247
+ },
248
+ "resource": {
249
+ "name": "resource",
250
+ "type": "text",
251
+ "primaryKey": false,
252
+ "notNull": true
253
+ },
254
+ "expires_at": {
255
+ "name": "expires_at",
256
+ "type": "timestamp with time zone",
257
+ "primaryKey": false,
258
+ "notNull": true
259
+ },
260
+ "consumed_at": {
261
+ "name": "consumed_at",
262
+ "type": "timestamp with time zone",
263
+ "primaryKey": false,
264
+ "notNull": false
265
+ },
266
+ "created_at": {
267
+ "name": "created_at",
268
+ "type": "timestamp with time zone",
269
+ "primaryKey": false,
270
+ "notNull": true,
271
+ "default": "now()"
272
+ },
273
+ "updated_at": {
274
+ "name": "updated_at",
275
+ "type": "timestamp with time zone",
276
+ "primaryKey": false,
277
+ "notNull": true,
278
+ "default": "now()"
279
+ }
280
+ },
281
+ "indexes": {
282
+ "auth_agent_authorization_codes_hashed_code_unique": {
283
+ "name": "auth_agent_authorization_codes_hashed_code_unique",
284
+ "columns": [
285
+ {
286
+ "expression": "hashed_code",
287
+ "isExpression": false,
288
+ "asc": true,
289
+ "nulls": "last"
290
+ }
291
+ ],
292
+ "isUnique": true,
293
+ "concurrently": false,
294
+ "method": "btree",
295
+ "with": {}
296
+ },
297
+ "auth_agent_authorization_codes_grant_id_idx": {
298
+ "name": "auth_agent_authorization_codes_grant_id_idx",
299
+ "columns": [
300
+ {
301
+ "expression": "grant_id",
302
+ "isExpression": false,
303
+ "asc": true,
304
+ "nulls": "last"
305
+ }
306
+ ],
307
+ "isUnique": false,
308
+ "concurrently": false,
309
+ "method": "btree",
310
+ "with": {}
311
+ },
312
+ "auth_agent_authorization_codes_expires_at_idx": {
313
+ "name": "auth_agent_authorization_codes_expires_at_idx",
314
+ "columns": [
315
+ {
316
+ "expression": "expires_at",
317
+ "isExpression": false,
318
+ "asc": true,
319
+ "nulls": "last"
320
+ }
321
+ ],
322
+ "isUnique": false,
323
+ "concurrently": false,
324
+ "method": "btree",
325
+ "with": {}
326
+ }
327
+ },
328
+ "foreignKeys": {
329
+ "auth_agent_authorization_codes_grant_id_auth_agent_grants_id_fk": {
330
+ "name": "auth_agent_authorization_codes_grant_id_auth_agent_grants_id_fk",
331
+ "tableFrom": "auth_agent_authorization_codes",
332
+ "tableTo": "auth_agent_grants",
333
+ "columnsFrom": ["grant_id"],
334
+ "columnsTo": ["id"],
335
+ "onDelete": "cascade",
336
+ "onUpdate": "no action"
337
+ }
338
+ },
339
+ "compositePrimaryKeys": {},
340
+ "uniqueConstraints": {},
341
+ "policies": {},
342
+ "checkConstraints": {},
343
+ "isRLSEnabled": false
344
+ },
345
+ "public.auth_agent_authorization_requests": {
346
+ "name": "auth_agent_authorization_requests",
347
+ "schema": "",
348
+ "columns": {
349
+ "id": {
350
+ "name": "id",
351
+ "type": "uuid",
352
+ "primaryKey": true,
353
+ "notNull": true,
354
+ "default": "uuidv7()"
355
+ },
356
+ "client_id": {
357
+ "name": "client_id",
358
+ "type": "uuid",
359
+ "primaryKey": false,
360
+ "notNull": true
361
+ },
362
+ "redirect_uri": {
363
+ "name": "redirect_uri",
364
+ "type": "text",
365
+ "primaryKey": false,
366
+ "notNull": true
367
+ },
368
+ "resource": {
369
+ "name": "resource",
370
+ "type": "text",
371
+ "primaryKey": false,
372
+ "notNull": true
373
+ },
374
+ "scopes": {
375
+ "name": "scopes",
376
+ "type": "text[]",
377
+ "primaryKey": false,
378
+ "notNull": true
379
+ },
380
+ "code_challenge": {
381
+ "name": "code_challenge",
382
+ "type": "text",
383
+ "primaryKey": false,
384
+ "notNull": true
385
+ },
386
+ "state": {
387
+ "name": "state",
388
+ "type": "text",
389
+ "primaryKey": false,
390
+ "notNull": false
391
+ },
392
+ "expires_at": {
393
+ "name": "expires_at",
394
+ "type": "timestamp with time zone",
395
+ "primaryKey": false,
396
+ "notNull": true
397
+ },
398
+ "consumed_at": {
399
+ "name": "consumed_at",
400
+ "type": "timestamp with time zone",
401
+ "primaryKey": false,
402
+ "notNull": false
403
+ },
404
+ "created_at": {
405
+ "name": "created_at",
406
+ "type": "timestamp with time zone",
407
+ "primaryKey": false,
408
+ "notNull": true,
409
+ "default": "now()"
410
+ },
411
+ "updated_at": {
412
+ "name": "updated_at",
413
+ "type": "timestamp with time zone",
414
+ "primaryKey": false,
415
+ "notNull": true,
416
+ "default": "now()"
417
+ }
418
+ },
419
+ "indexes": {
420
+ "auth_agent_authorization_requests_client_id_idx": {
421
+ "name": "auth_agent_authorization_requests_client_id_idx",
422
+ "columns": [
423
+ {
424
+ "expression": "client_id",
425
+ "isExpression": false,
426
+ "asc": true,
427
+ "nulls": "last"
428
+ }
429
+ ],
430
+ "isUnique": false,
431
+ "concurrently": false,
432
+ "method": "btree",
433
+ "with": {}
434
+ },
435
+ "auth_agent_authorization_requests_expires_at_idx": {
436
+ "name": "auth_agent_authorization_requests_expires_at_idx",
437
+ "columns": [
438
+ {
439
+ "expression": "expires_at",
440
+ "isExpression": false,
441
+ "asc": true,
442
+ "nulls": "last"
443
+ }
444
+ ],
445
+ "isUnique": false,
446
+ "concurrently": false,
447
+ "method": "btree",
448
+ "with": {}
449
+ }
450
+ },
451
+ "foreignKeys": {
452
+ "auth_agent_authorization_requests_client_id_auth_agent_clients_id_fk": {
453
+ "name": "auth_agent_authorization_requests_client_id_auth_agent_clients_id_fk",
454
+ "tableFrom": "auth_agent_authorization_requests",
455
+ "tableTo": "auth_agent_clients",
456
+ "columnsFrom": ["client_id"],
457
+ "columnsTo": ["id"],
458
+ "onDelete": "cascade",
459
+ "onUpdate": "no action"
460
+ }
461
+ },
462
+ "compositePrimaryKeys": {},
463
+ "uniqueConstraints": {},
464
+ "policies": {},
465
+ "checkConstraints": {},
466
+ "isRLSEnabled": false
467
+ },
468
+ "public.auth_agent_clients": {
469
+ "name": "auth_agent_clients",
470
+ "schema": "",
471
+ "columns": {
472
+ "id": {
473
+ "name": "id",
474
+ "type": "uuid",
475
+ "primaryKey": true,
476
+ "notNull": true,
477
+ "default": "uuidv7()"
478
+ },
479
+ "client_id": {
480
+ "name": "client_id",
481
+ "type": "text",
482
+ "primaryKey": false,
483
+ "notNull": true
484
+ },
485
+ "name": {
486
+ "name": "name",
487
+ "type": "text",
488
+ "primaryKey": false,
489
+ "notNull": true
490
+ },
491
+ "redirect_uris": {
492
+ "name": "redirect_uris",
493
+ "type": "text[]",
494
+ "primaryKey": false,
495
+ "notNull": true
496
+ },
497
+ "kind": {
498
+ "name": "kind",
499
+ "type": "auth_agent_client_kind",
500
+ "typeSchema": "public",
501
+ "primaryKey": false,
502
+ "notNull": true
503
+ },
504
+ "last_seen_at": {
505
+ "name": "last_seen_at",
506
+ "type": "timestamp with time zone",
507
+ "primaryKey": false,
508
+ "notNull": false
509
+ },
510
+ "unreferenced_at": {
511
+ "name": "unreferenced_at",
512
+ "type": "timestamp with time zone",
513
+ "primaryKey": false,
514
+ "notNull": false
515
+ },
516
+ "created_at": {
517
+ "name": "created_at",
518
+ "type": "timestamp with time zone",
519
+ "primaryKey": false,
520
+ "notNull": true,
521
+ "default": "now()"
522
+ },
523
+ "updated_at": {
524
+ "name": "updated_at",
525
+ "type": "timestamp with time zone",
526
+ "primaryKey": false,
527
+ "notNull": true,
528
+ "default": "now()"
529
+ }
530
+ },
531
+ "indexes": {
532
+ "auth_agent_clients_client_id_unique": {
533
+ "name": "auth_agent_clients_client_id_unique",
534
+ "columns": [
535
+ {
536
+ "expression": "client_id",
537
+ "isExpression": false,
538
+ "asc": true,
539
+ "nulls": "last"
540
+ }
541
+ ],
542
+ "isUnique": true,
543
+ "concurrently": false,
544
+ "method": "btree",
545
+ "with": {}
546
+ },
547
+ "auth_agent_clients_unreferenced_at_idx": {
548
+ "name": "auth_agent_clients_unreferenced_at_idx",
549
+ "columns": [
550
+ {
551
+ "expression": "unreferenced_at",
552
+ "isExpression": false,
553
+ "asc": true,
554
+ "nulls": "last"
555
+ }
556
+ ],
557
+ "isUnique": false,
558
+ "concurrently": false,
559
+ "method": "btree",
560
+ "with": {}
561
+ },
562
+ "auth_agent_clients_created_at_idx": {
563
+ "name": "auth_agent_clients_created_at_idx",
564
+ "columns": [
565
+ {
566
+ "expression": "created_at",
567
+ "isExpression": false,
568
+ "asc": true,
569
+ "nulls": "last"
570
+ }
571
+ ],
572
+ "isUnique": false,
573
+ "concurrently": false,
574
+ "method": "btree",
575
+ "with": {}
576
+ }
577
+ },
578
+ "foreignKeys": {},
579
+ "compositePrimaryKeys": {},
580
+ "uniqueConstraints": {},
581
+ "policies": {},
582
+ "checkConstraints": {},
583
+ "isRLSEnabled": false
584
+ },
585
+ "public.auth_agent_grants": {
586
+ "name": "auth_agent_grants",
587
+ "schema": "",
588
+ "columns": {
589
+ "id": {
590
+ "name": "id",
591
+ "type": "uuid",
592
+ "primaryKey": true,
593
+ "notNull": true,
594
+ "default": "uuidv7()"
595
+ },
596
+ "user_id": {
597
+ "name": "user_id",
598
+ "type": "uuid",
599
+ "primaryKey": false,
600
+ "notNull": true
601
+ },
602
+ "workspace_id": {
603
+ "name": "workspace_id",
604
+ "type": "uuid",
605
+ "primaryKey": false,
606
+ "notNull": true
607
+ },
608
+ "client_id": {
609
+ "name": "client_id",
610
+ "type": "uuid",
611
+ "primaryKey": false,
612
+ "notNull": true
613
+ },
614
+ "scopes": {
615
+ "name": "scopes",
616
+ "type": "text[]",
617
+ "primaryKey": false,
618
+ "notNull": true
619
+ },
620
+ "last_used_at": {
621
+ "name": "last_used_at",
622
+ "type": "timestamp with time zone",
623
+ "primaryKey": false,
624
+ "notNull": false
625
+ },
626
+ "revoked_at": {
627
+ "name": "revoked_at",
628
+ "type": "timestamp with time zone",
629
+ "primaryKey": false,
630
+ "notNull": false
631
+ },
632
+ "terminal_at": {
633
+ "name": "terminal_at",
634
+ "type": "timestamp with time zone",
635
+ "primaryKey": false,
636
+ "notNull": false
637
+ },
638
+ "created_at": {
639
+ "name": "created_at",
640
+ "type": "timestamp with time zone",
641
+ "primaryKey": false,
642
+ "notNull": true,
643
+ "default": "now()"
644
+ },
645
+ "updated_at": {
646
+ "name": "updated_at",
647
+ "type": "timestamp with time zone",
648
+ "primaryKey": false,
649
+ "notNull": true,
650
+ "default": "now()"
651
+ }
652
+ },
653
+ "indexes": {
654
+ "auth_agent_grants_user_id_idx": {
655
+ "name": "auth_agent_grants_user_id_idx",
656
+ "columns": [
657
+ {
658
+ "expression": "user_id",
659
+ "isExpression": false,
660
+ "asc": true,
661
+ "nulls": "last"
662
+ }
663
+ ],
664
+ "isUnique": false,
665
+ "concurrently": false,
666
+ "method": "btree",
667
+ "with": {}
668
+ },
669
+ "auth_agent_grants_workspace_id_idx": {
670
+ "name": "auth_agent_grants_workspace_id_idx",
671
+ "columns": [
672
+ {
673
+ "expression": "workspace_id",
674
+ "isExpression": false,
675
+ "asc": true,
676
+ "nulls": "last"
677
+ }
678
+ ],
679
+ "isUnique": false,
680
+ "concurrently": false,
681
+ "method": "btree",
682
+ "with": {}
683
+ },
684
+ "auth_agent_grants_client_id_idx": {
685
+ "name": "auth_agent_grants_client_id_idx",
686
+ "columns": [
687
+ {
688
+ "expression": "client_id",
689
+ "isExpression": false,
690
+ "asc": true,
691
+ "nulls": "last"
692
+ }
693
+ ],
694
+ "isUnique": false,
695
+ "concurrently": false,
696
+ "method": "btree",
697
+ "with": {}
698
+ },
699
+ "auth_agent_grants_terminal_at_idx": {
700
+ "name": "auth_agent_grants_terminal_at_idx",
701
+ "columns": [
702
+ {
703
+ "expression": "terminal_at",
704
+ "isExpression": false,
705
+ "asc": true,
706
+ "nulls": "last"
707
+ }
708
+ ],
709
+ "isUnique": false,
710
+ "concurrently": false,
711
+ "method": "btree",
712
+ "with": {}
713
+ },
714
+ "auth_agent_grants_active_user_workspace_client_unique": {
715
+ "name": "auth_agent_grants_active_user_workspace_client_unique",
716
+ "columns": [
717
+ {
718
+ "expression": "user_id",
719
+ "isExpression": false,
720
+ "asc": true,
721
+ "nulls": "last"
722
+ },
723
+ {
724
+ "expression": "workspace_id",
725
+ "isExpression": false,
726
+ "asc": true,
727
+ "nulls": "last"
728
+ },
729
+ {
730
+ "expression": "client_id",
731
+ "isExpression": false,
732
+ "asc": true,
733
+ "nulls": "last"
734
+ }
735
+ ],
736
+ "isUnique": true,
737
+ "where": "\"auth_agent_grants\".\"revoked_at\" IS NULL AND \"auth_agent_grants\".\"terminal_at\" IS NULL",
738
+ "concurrently": false,
739
+ "method": "btree",
740
+ "with": {}
741
+ }
742
+ },
743
+ "foreignKeys": {
744
+ "auth_agent_grants_user_id_auth_users_id_fk": {
745
+ "name": "auth_agent_grants_user_id_auth_users_id_fk",
746
+ "tableFrom": "auth_agent_grants",
747
+ "tableTo": "auth_users",
748
+ "columnsFrom": ["user_id"],
749
+ "columnsTo": ["id"],
750
+ "onDelete": "cascade",
751
+ "onUpdate": "no action"
752
+ },
753
+ "auth_agent_grants_client_id_auth_agent_clients_id_fk": {
754
+ "name": "auth_agent_grants_client_id_auth_agent_clients_id_fk",
755
+ "tableFrom": "auth_agent_grants",
756
+ "tableTo": "auth_agent_clients",
757
+ "columnsFrom": ["client_id"],
758
+ "columnsTo": ["id"],
759
+ "onDelete": "cascade",
760
+ "onUpdate": "no action"
761
+ }
762
+ },
763
+ "compositePrimaryKeys": {},
764
+ "uniqueConstraints": {},
765
+ "policies": {},
766
+ "checkConstraints": {},
767
+ "isRLSEnabled": false
768
+ },
769
+ "public.auth_agent_pats": {
770
+ "name": "auth_agent_pats",
771
+ "schema": "",
772
+ "columns": {
773
+ "id": {
774
+ "name": "id",
775
+ "type": "uuid",
776
+ "primaryKey": true,
777
+ "notNull": true,
778
+ "default": "uuidv7()"
779
+ },
780
+ "user_id": {
781
+ "name": "user_id",
782
+ "type": "uuid",
783
+ "primaryKey": false,
784
+ "notNull": true
785
+ },
786
+ "workspace_id": {
787
+ "name": "workspace_id",
788
+ "type": "uuid",
789
+ "primaryKey": false,
790
+ "notNull": true
791
+ },
792
+ "hashed_token": {
793
+ "name": "hashed_token",
794
+ "type": "text",
795
+ "primaryKey": false,
796
+ "notNull": true
797
+ },
798
+ "prefix": {
799
+ "name": "prefix",
800
+ "type": "text",
801
+ "primaryKey": false,
802
+ "notNull": true
803
+ },
804
+ "name": {
805
+ "name": "name",
806
+ "type": "text",
807
+ "primaryKey": false,
808
+ "notNull": true
809
+ },
810
+ "scopes": {
811
+ "name": "scopes",
812
+ "type": "text[]",
813
+ "primaryKey": false,
814
+ "notNull": true
815
+ },
816
+ "expires_at": {
817
+ "name": "expires_at",
818
+ "type": "timestamp with time zone",
819
+ "primaryKey": false,
820
+ "notNull": true
821
+ },
822
+ "last_used_at": {
823
+ "name": "last_used_at",
824
+ "type": "timestamp with time zone",
825
+ "primaryKey": false,
826
+ "notNull": false
827
+ },
828
+ "revoked_at": {
829
+ "name": "revoked_at",
830
+ "type": "timestamp with time zone",
831
+ "primaryKey": false,
832
+ "notNull": false
833
+ },
834
+ "created_at": {
835
+ "name": "created_at",
836
+ "type": "timestamp with time zone",
837
+ "primaryKey": false,
838
+ "notNull": true,
839
+ "default": "now()"
840
+ },
841
+ "updated_at": {
842
+ "name": "updated_at",
843
+ "type": "timestamp with time zone",
844
+ "primaryKey": false,
845
+ "notNull": true,
846
+ "default": "now()"
847
+ }
848
+ },
849
+ "indexes": {
850
+ "auth_agent_pats_hashed_token_unique": {
851
+ "name": "auth_agent_pats_hashed_token_unique",
852
+ "columns": [
853
+ {
854
+ "expression": "hashed_token",
855
+ "isExpression": false,
856
+ "asc": true,
857
+ "nulls": "last"
858
+ }
859
+ ],
860
+ "isUnique": true,
861
+ "concurrently": false,
862
+ "method": "btree",
863
+ "with": {}
864
+ },
865
+ "auth_agent_pats_user_id_idx": {
866
+ "name": "auth_agent_pats_user_id_idx",
867
+ "columns": [
868
+ {
869
+ "expression": "user_id",
870
+ "isExpression": false,
871
+ "asc": true,
872
+ "nulls": "last"
873
+ }
874
+ ],
875
+ "isUnique": false,
876
+ "concurrently": false,
877
+ "method": "btree",
878
+ "with": {}
879
+ },
880
+ "auth_agent_pats_workspace_id_idx": {
881
+ "name": "auth_agent_pats_workspace_id_idx",
882
+ "columns": [
883
+ {
884
+ "expression": "workspace_id",
885
+ "isExpression": false,
886
+ "asc": true,
887
+ "nulls": "last"
888
+ }
889
+ ],
890
+ "isUnique": false,
891
+ "concurrently": false,
892
+ "method": "btree",
893
+ "with": {}
894
+ },
895
+ "auth_agent_pats_expires_at_idx": {
896
+ "name": "auth_agent_pats_expires_at_idx",
897
+ "columns": [
898
+ {
899
+ "expression": "expires_at",
900
+ "isExpression": false,
901
+ "asc": true,
902
+ "nulls": "last"
903
+ }
904
+ ],
905
+ "isUnique": false,
906
+ "concurrently": false,
907
+ "method": "btree",
908
+ "with": {}
909
+ },
910
+ "auth_agent_pats_revoked_at_idx": {
911
+ "name": "auth_agent_pats_revoked_at_idx",
912
+ "columns": [
913
+ {
914
+ "expression": "revoked_at",
915
+ "isExpression": false,
916
+ "asc": true,
917
+ "nulls": "last"
918
+ }
919
+ ],
920
+ "isUnique": false,
921
+ "concurrently": false,
922
+ "method": "btree",
923
+ "with": {}
924
+ }
925
+ },
926
+ "foreignKeys": {
927
+ "auth_agent_pats_user_id_auth_users_id_fk": {
928
+ "name": "auth_agent_pats_user_id_auth_users_id_fk",
929
+ "tableFrom": "auth_agent_pats",
930
+ "tableTo": "auth_users",
931
+ "columnsFrom": ["user_id"],
932
+ "columnsTo": ["id"],
933
+ "onDelete": "cascade",
934
+ "onUpdate": "no action"
935
+ }
936
+ },
937
+ "compositePrimaryKeys": {},
938
+ "uniqueConstraints": {},
939
+ "policies": {},
940
+ "checkConstraints": {},
941
+ "isRLSEnabled": false
942
+ },
943
+ "public.auth_agent_refresh_tokens": {
944
+ "name": "auth_agent_refresh_tokens",
945
+ "schema": "",
946
+ "columns": {
947
+ "id": {
948
+ "name": "id",
949
+ "type": "uuid",
950
+ "primaryKey": true,
951
+ "notNull": true,
952
+ "default": "uuidv7()"
953
+ },
954
+ "grant_id": {
955
+ "name": "grant_id",
956
+ "type": "uuid",
957
+ "primaryKey": false,
958
+ "notNull": true
959
+ },
960
+ "hashed_token": {
961
+ "name": "hashed_token",
962
+ "type": "text",
963
+ "primaryKey": false,
964
+ "notNull": true
965
+ },
966
+ "expires_at": {
967
+ "name": "expires_at",
968
+ "type": "timestamp with time zone",
969
+ "primaryKey": false,
970
+ "notNull": true
971
+ },
972
+ "rotated_at": {
973
+ "name": "rotated_at",
974
+ "type": "timestamp with time zone",
975
+ "primaryKey": false,
976
+ "notNull": false
977
+ },
978
+ "revoked_at": {
979
+ "name": "revoked_at",
980
+ "type": "timestamp with time zone",
981
+ "primaryKey": false,
982
+ "notNull": false
983
+ },
984
+ "last_used_at": {
985
+ "name": "last_used_at",
986
+ "type": "timestamp with time zone",
987
+ "primaryKey": false,
988
+ "notNull": false
989
+ },
990
+ "created_at": {
991
+ "name": "created_at",
992
+ "type": "timestamp with time zone",
993
+ "primaryKey": false,
994
+ "notNull": true,
995
+ "default": "now()"
996
+ },
997
+ "updated_at": {
998
+ "name": "updated_at",
999
+ "type": "timestamp with time zone",
1000
+ "primaryKey": false,
1001
+ "notNull": true,
1002
+ "default": "now()"
1003
+ }
1004
+ },
1005
+ "indexes": {
1006
+ "auth_agent_refresh_tokens_hashed_token_unique": {
1007
+ "name": "auth_agent_refresh_tokens_hashed_token_unique",
1008
+ "columns": [
1009
+ {
1010
+ "expression": "hashed_token",
1011
+ "isExpression": false,
1012
+ "asc": true,
1013
+ "nulls": "last"
1014
+ }
1015
+ ],
1016
+ "isUnique": true,
1017
+ "concurrently": false,
1018
+ "method": "btree",
1019
+ "with": {}
1020
+ },
1021
+ "auth_agent_refresh_tokens_live_grant_unique": {
1022
+ "name": "auth_agent_refresh_tokens_live_grant_unique",
1023
+ "columns": [
1024
+ {
1025
+ "expression": "grant_id",
1026
+ "isExpression": false,
1027
+ "asc": true,
1028
+ "nulls": "last"
1029
+ }
1030
+ ],
1031
+ "isUnique": true,
1032
+ "where": "\"auth_agent_refresh_tokens\".\"rotated_at\" IS NULL AND \"auth_agent_refresh_tokens\".\"revoked_at\" IS NULL",
1033
+ "concurrently": false,
1034
+ "method": "btree",
1035
+ "with": {}
1036
+ },
1037
+ "auth_agent_refresh_tokens_grant_id_idx": {
1038
+ "name": "auth_agent_refresh_tokens_grant_id_idx",
1039
+ "columns": [
1040
+ {
1041
+ "expression": "grant_id",
1042
+ "isExpression": false,
1043
+ "asc": true,
1044
+ "nulls": "last"
1045
+ }
1046
+ ],
1047
+ "isUnique": false,
1048
+ "concurrently": false,
1049
+ "method": "btree",
1050
+ "with": {}
1051
+ },
1052
+ "auth_agent_refresh_tokens_expires_at_idx": {
1053
+ "name": "auth_agent_refresh_tokens_expires_at_idx",
1054
+ "columns": [
1055
+ {
1056
+ "expression": "expires_at",
1057
+ "isExpression": false,
1058
+ "asc": true,
1059
+ "nulls": "last"
1060
+ }
1061
+ ],
1062
+ "isUnique": false,
1063
+ "concurrently": false,
1064
+ "method": "btree",
1065
+ "with": {}
1066
+ },
1067
+ "auth_agent_refresh_tokens_rotated_at_idx": {
1068
+ "name": "auth_agent_refresh_tokens_rotated_at_idx",
1069
+ "columns": [
1070
+ {
1071
+ "expression": "rotated_at",
1072
+ "isExpression": false,
1073
+ "asc": true,
1074
+ "nulls": "last"
1075
+ }
1076
+ ],
1077
+ "isUnique": false,
1078
+ "concurrently": false,
1079
+ "method": "btree",
1080
+ "with": {}
1081
+ },
1082
+ "auth_agent_refresh_tokens_revoked_at_idx": {
1083
+ "name": "auth_agent_refresh_tokens_revoked_at_idx",
1084
+ "columns": [
1085
+ {
1086
+ "expression": "revoked_at",
1087
+ "isExpression": false,
1088
+ "asc": true,
1089
+ "nulls": "last"
1090
+ }
1091
+ ],
1092
+ "isUnique": false,
1093
+ "concurrently": false,
1094
+ "method": "btree",
1095
+ "with": {}
1096
+ }
1097
+ },
1098
+ "foreignKeys": {
1099
+ "auth_agent_refresh_tokens_grant_id_auth_agent_grants_id_fk": {
1100
+ "name": "auth_agent_refresh_tokens_grant_id_auth_agent_grants_id_fk",
1101
+ "tableFrom": "auth_agent_refresh_tokens",
1102
+ "tableTo": "auth_agent_grants",
1103
+ "columnsFrom": ["grant_id"],
1104
+ "columnsTo": ["id"],
1105
+ "onDelete": "cascade",
1106
+ "onUpdate": "no action"
1107
+ }
1108
+ },
1109
+ "compositePrimaryKeys": {},
1110
+ "uniqueConstraints": {},
1111
+ "policies": {},
1112
+ "checkConstraints": {},
1113
+ "isRLSEnabled": false
1114
+ },
1115
+ "public.auth_outbox": {
1116
+ "name": "auth_outbox",
1117
+ "schema": "",
1118
+ "columns": {
1119
+ "id": {
1120
+ "name": "id",
1121
+ "type": "uuid",
1122
+ "primaryKey": true,
1123
+ "notNull": true,
1124
+ "default": "uuidv7()"
1125
+ },
1126
+ "event_type": {
1127
+ "name": "event_type",
1128
+ "type": "text",
1129
+ "primaryKey": false,
1130
+ "notNull": true
1131
+ },
1132
+ "ordering_key": {
1133
+ "name": "ordering_key",
1134
+ "type": "text",
1135
+ "primaryKey": false,
1136
+ "notNull": false
1137
+ },
1138
+ "payload": {
1139
+ "name": "payload",
1140
+ "type": "jsonb",
1141
+ "primaryKey": false,
1142
+ "notNull": true
1143
+ },
1144
+ "created_at": {
1145
+ "name": "created_at",
1146
+ "type": "timestamp with time zone",
1147
+ "primaryKey": false,
1148
+ "notNull": true,
1149
+ "default": "now()"
1150
+ },
1151
+ "dispatched_at": {
1152
+ "name": "dispatched_at",
1153
+ "type": "timestamp with time zone",
1154
+ "primaryKey": false,
1155
+ "notNull": false
1156
+ },
1157
+ "dispatch_attempts": {
1158
+ "name": "dispatch_attempts",
1159
+ "type": "integer",
1160
+ "primaryKey": false,
1161
+ "notNull": true,
1162
+ "default": 0
1163
+ },
1164
+ "next_dispatch_at": {
1165
+ "name": "next_dispatch_at",
1166
+ "type": "timestamp with time zone",
1167
+ "primaryKey": false,
1168
+ "notNull": true,
1169
+ "default": "now()"
1170
+ },
1171
+ "last_dispatch_error": {
1172
+ "name": "last_dispatch_error",
1173
+ "type": "jsonb",
1174
+ "primaryKey": false,
1175
+ "notNull": false
1176
+ },
1177
+ "last_dispatch_failed_at": {
1178
+ "name": "last_dispatch_failed_at",
1179
+ "type": "timestamp with time zone",
1180
+ "primaryKey": false,
1181
+ "notNull": false
1182
+ },
1183
+ "dead_lettered_at": {
1184
+ "name": "dead_lettered_at",
1185
+ "type": "timestamp with time zone",
1186
+ "primaryKey": false,
1187
+ "notNull": false
1188
+ }
1189
+ },
1190
+ "indexes": {
1191
+ "auth_outbox_pending_idx": {
1192
+ "name": "auth_outbox_pending_idx",
1193
+ "columns": [
1194
+ {
1195
+ "expression": "next_dispatch_at",
1196
+ "isExpression": false,
1197
+ "asc": true,
1198
+ "nulls": "last"
1199
+ },
1200
+ {
1201
+ "expression": "created_at",
1202
+ "isExpression": false,
1203
+ "asc": true,
1204
+ "nulls": "last"
1205
+ }
1206
+ ],
1207
+ "isUnique": false,
1208
+ "where": "\"dispatched_at\" IS NULL AND \"dead_lettered_at\" IS NULL",
1209
+ "concurrently": false,
1210
+ "method": "btree",
1211
+ "with": {}
1212
+ },
1213
+ "auth_outbox_dispatched_retention_idx": {
1214
+ "name": "auth_outbox_dispatched_retention_idx",
1215
+ "columns": [
1216
+ {
1217
+ "expression": "dispatched_at",
1218
+ "isExpression": false,
1219
+ "asc": true,
1220
+ "nulls": "last"
1221
+ },
1222
+ {
1223
+ "expression": "id",
1224
+ "isExpression": false,
1225
+ "asc": true,
1226
+ "nulls": "last"
1227
+ }
1228
+ ],
1229
+ "isUnique": false,
1230
+ "where": "\"dispatched_at\" IS NOT NULL",
1231
+ "concurrently": false,
1232
+ "method": "btree",
1233
+ "with": {}
1234
+ }
1235
+ },
1236
+ "foreignKeys": {},
1237
+ "compositePrimaryKeys": {},
1238
+ "uniqueConstraints": {},
1239
+ "policies": {},
1240
+ "checkConstraints": {},
1241
+ "isRLSEnabled": false
1242
+ },
1243
+ "public.auth_password_resets": {
1244
+ "name": "auth_password_resets",
1245
+ "schema": "",
1246
+ "columns": {
1247
+ "id": {
1248
+ "name": "id",
1249
+ "type": "uuid",
1250
+ "primaryKey": true,
1251
+ "notNull": true,
1252
+ "default": "uuidv7()"
1253
+ },
1254
+ "user_id": {
1255
+ "name": "user_id",
1256
+ "type": "uuid",
1257
+ "primaryKey": false,
1258
+ "notNull": true
1259
+ },
1260
+ "hashed_token": {
1261
+ "name": "hashed_token",
1262
+ "type": "text",
1263
+ "primaryKey": false,
1264
+ "notNull": true
1265
+ },
1266
+ "expires_at": {
1267
+ "name": "expires_at",
1268
+ "type": "timestamp with time zone",
1269
+ "primaryKey": false,
1270
+ "notNull": true
1271
+ },
1272
+ "used_at": {
1273
+ "name": "used_at",
1274
+ "type": "timestamp with time zone",
1275
+ "primaryKey": false,
1276
+ "notNull": false
1277
+ },
1278
+ "created_at": {
1279
+ "name": "created_at",
1280
+ "type": "timestamp with time zone",
1281
+ "primaryKey": false,
1282
+ "notNull": true,
1283
+ "default": "now()"
1284
+ }
1285
+ },
1286
+ "indexes": {
1287
+ "auth_password_resets_hashed_token_unique": {
1288
+ "name": "auth_password_resets_hashed_token_unique",
1289
+ "columns": [
1290
+ {
1291
+ "expression": "hashed_token",
1292
+ "isExpression": false,
1293
+ "asc": true,
1294
+ "nulls": "last"
1295
+ }
1296
+ ],
1297
+ "isUnique": true,
1298
+ "concurrently": false,
1299
+ "method": "btree",
1300
+ "with": {}
1301
+ },
1302
+ "auth_password_resets_user_id_idx": {
1303
+ "name": "auth_password_resets_user_id_idx",
1304
+ "columns": [
1305
+ {
1306
+ "expression": "user_id",
1307
+ "isExpression": false,
1308
+ "asc": true,
1309
+ "nulls": "last"
1310
+ }
1311
+ ],
1312
+ "isUnique": false,
1313
+ "concurrently": false,
1314
+ "method": "btree",
1315
+ "with": {}
1316
+ }
1317
+ },
1318
+ "foreignKeys": {
1319
+ "auth_password_resets_user_id_auth_users_id_fk": {
1320
+ "name": "auth_password_resets_user_id_auth_users_id_fk",
1321
+ "tableFrom": "auth_password_resets",
1322
+ "tableTo": "auth_users",
1323
+ "columnsFrom": ["user_id"],
1324
+ "columnsTo": ["id"],
1325
+ "onDelete": "cascade",
1326
+ "onUpdate": "no action"
1327
+ }
1328
+ },
1329
+ "compositePrimaryKeys": {},
1330
+ "uniqueConstraints": {},
1331
+ "policies": {},
1332
+ "checkConstraints": {},
1333
+ "isRLSEnabled": false
1334
+ },
1335
+ "public.auth_rate_limits": {
1336
+ "name": "auth_rate_limits",
1337
+ "schema": "",
1338
+ "columns": {
1339
+ "action": {
1340
+ "name": "action",
1341
+ "type": "text",
1342
+ "primaryKey": false,
1343
+ "notNull": true
1344
+ },
1345
+ "scope": {
1346
+ "name": "scope",
1347
+ "type": "text",
1348
+ "primaryKey": false,
1349
+ "notNull": true
1350
+ },
1351
+ "identifier_hmac": {
1352
+ "name": "identifier_hmac",
1353
+ "type": "text",
1354
+ "primaryKey": false,
1355
+ "notNull": true
1356
+ },
1357
+ "window_start": {
1358
+ "name": "window_start",
1359
+ "type": "timestamp with time zone",
1360
+ "primaryKey": false,
1361
+ "notNull": true
1362
+ },
1363
+ "count": {
1364
+ "name": "count",
1365
+ "type": "integer",
1366
+ "primaryKey": false,
1367
+ "notNull": true,
1368
+ "default": 1
1369
+ },
1370
+ "expires_at": {
1371
+ "name": "expires_at",
1372
+ "type": "timestamp with time zone",
1373
+ "primaryKey": false,
1374
+ "notNull": true
1375
+ },
1376
+ "created_at": {
1377
+ "name": "created_at",
1378
+ "type": "timestamp with time zone",
1379
+ "primaryKey": false,
1380
+ "notNull": true,
1381
+ "default": "now()"
1382
+ },
1383
+ "updated_at": {
1384
+ "name": "updated_at",
1385
+ "type": "timestamp with time zone",
1386
+ "primaryKey": false,
1387
+ "notNull": true,
1388
+ "default": "now()"
1389
+ }
1390
+ },
1391
+ "indexes": {
1392
+ "auth_rate_limits_window_unique": {
1393
+ "name": "auth_rate_limits_window_unique",
1394
+ "columns": [
1395
+ {
1396
+ "expression": "action",
1397
+ "isExpression": false,
1398
+ "asc": true,
1399
+ "nulls": "last"
1400
+ },
1401
+ {
1402
+ "expression": "scope",
1403
+ "isExpression": false,
1404
+ "asc": true,
1405
+ "nulls": "last"
1406
+ },
1407
+ {
1408
+ "expression": "identifier_hmac",
1409
+ "isExpression": false,
1410
+ "asc": true,
1411
+ "nulls": "last"
1412
+ },
1413
+ {
1414
+ "expression": "window_start",
1415
+ "isExpression": false,
1416
+ "asc": true,
1417
+ "nulls": "last"
1418
+ }
1419
+ ],
1420
+ "isUnique": true,
1421
+ "concurrently": false,
1422
+ "method": "btree",
1423
+ "with": {}
1424
+ },
1425
+ "auth_rate_limits_expires_at_idx": {
1426
+ "name": "auth_rate_limits_expires_at_idx",
1427
+ "columns": [
1428
+ {
1429
+ "expression": "expires_at",
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
+ "policies": {},
1445
+ "checkConstraints": {},
1446
+ "isRLSEnabled": false
1447
+ },
1448
+ "public.auth_refresh_tokens": {
1449
+ "name": "auth_refresh_tokens",
1450
+ "schema": "",
1451
+ "columns": {
1452
+ "id": {
1453
+ "name": "id",
1454
+ "type": "uuid",
1455
+ "primaryKey": true,
1456
+ "notNull": true,
1457
+ "default": "uuidv7()"
1458
+ },
1459
+ "session_id": {
1460
+ "name": "session_id",
1461
+ "type": "uuid",
1462
+ "primaryKey": false,
1463
+ "notNull": true,
1464
+ "default": "uuidv7()"
1465
+ },
1466
+ "user_id": {
1467
+ "name": "user_id",
1468
+ "type": "uuid",
1469
+ "primaryKey": false,
1470
+ "notNull": true
1471
+ },
1472
+ "hashed_token": {
1473
+ "name": "hashed_token",
1474
+ "type": "text",
1475
+ "primaryKey": false,
1476
+ "notNull": true
1477
+ },
1478
+ "expires_at": {
1479
+ "name": "expires_at",
1480
+ "type": "timestamp with time zone",
1481
+ "primaryKey": false,
1482
+ "notNull": true
1483
+ },
1484
+ "revoked_at": {
1485
+ "name": "revoked_at",
1486
+ "type": "timestamp with time zone",
1487
+ "primaryKey": false,
1488
+ "notNull": false
1489
+ },
1490
+ "rotated_at": {
1491
+ "name": "rotated_at",
1492
+ "type": "timestamp with time zone",
1493
+ "primaryKey": false,
1494
+ "notNull": false
1495
+ },
1496
+ "last_used_at": {
1497
+ "name": "last_used_at",
1498
+ "type": "timestamp with time zone",
1499
+ "primaryKey": false,
1500
+ "notNull": false
1501
+ },
1502
+ "created_at": {
1503
+ "name": "created_at",
1504
+ "type": "timestamp with time zone",
1505
+ "primaryKey": false,
1506
+ "notNull": true,
1507
+ "default": "now()"
1508
+ },
1509
+ "updated_at": {
1510
+ "name": "updated_at",
1511
+ "type": "timestamp with time zone",
1512
+ "primaryKey": false,
1513
+ "notNull": true,
1514
+ "default": "now()"
1515
+ }
1516
+ },
1517
+ "indexes": {
1518
+ "auth_refresh_tokens_hashed_token_unique": {
1519
+ "name": "auth_refresh_tokens_hashed_token_unique",
1520
+ "columns": [
1521
+ {
1522
+ "expression": "hashed_token",
1523
+ "isExpression": false,
1524
+ "asc": true,
1525
+ "nulls": "last"
1526
+ }
1527
+ ],
1528
+ "isUnique": true,
1529
+ "concurrently": false,
1530
+ "method": "btree",
1531
+ "with": {}
1532
+ },
1533
+ "auth_refresh_tokens_active_session_unique": {
1534
+ "name": "auth_refresh_tokens_active_session_unique",
1535
+ "columns": [
1536
+ {
1537
+ "expression": "user_id",
1538
+ "isExpression": false,
1539
+ "asc": true,
1540
+ "nulls": "last"
1541
+ },
1542
+ {
1543
+ "expression": "session_id",
1544
+ "isExpression": false,
1545
+ "asc": true,
1546
+ "nulls": "last"
1547
+ }
1548
+ ],
1549
+ "isUnique": true,
1550
+ "where": "\"auth_refresh_tokens\".\"revoked_at\" IS NULL AND \"auth_refresh_tokens\".\"rotated_at\" IS NULL",
1551
+ "concurrently": false,
1552
+ "method": "btree",
1553
+ "with": {}
1554
+ },
1555
+ "auth_refresh_tokens_user_id_idx": {
1556
+ "name": "auth_refresh_tokens_user_id_idx",
1557
+ "columns": [
1558
+ {
1559
+ "expression": "user_id",
1560
+ "isExpression": false,
1561
+ "asc": true,
1562
+ "nulls": "last"
1563
+ }
1564
+ ],
1565
+ "isUnique": false,
1566
+ "concurrently": false,
1567
+ "method": "btree",
1568
+ "with": {}
1569
+ }
1570
+ },
1571
+ "foreignKeys": {
1572
+ "auth_refresh_tokens_user_id_auth_users_id_fk": {
1573
+ "name": "auth_refresh_tokens_user_id_auth_users_id_fk",
1574
+ "tableFrom": "auth_refresh_tokens",
1575
+ "tableTo": "auth_users",
1576
+ "columnsFrom": ["user_id"],
1577
+ "columnsTo": ["id"],
1578
+ "onDelete": "cascade",
1579
+ "onUpdate": "no action"
1580
+ }
1581
+ },
1582
+ "compositePrimaryKeys": {},
1583
+ "uniqueConstraints": {},
1584
+ "policies": {},
1585
+ "checkConstraints": {},
1586
+ "isRLSEnabled": false
1587
+ },
1588
+ "public.auth_users": {
1589
+ "name": "auth_users",
1590
+ "schema": "",
1591
+ "columns": {
1592
+ "id": {
1593
+ "name": "id",
1594
+ "type": "uuid",
1595
+ "primaryKey": true,
1596
+ "notNull": true,
1597
+ "default": "uuidv7()"
1598
+ },
1599
+ "email": {
1600
+ "name": "email",
1601
+ "type": "text",
1602
+ "primaryKey": false,
1603
+ "notNull": true
1604
+ },
1605
+ "hashed_password": {
1606
+ "name": "hashed_password",
1607
+ "type": "text",
1608
+ "primaryKey": false,
1609
+ "notNull": false
1610
+ },
1611
+ "name": {
1612
+ "name": "name",
1613
+ "type": "text",
1614
+ "primaryKey": false,
1615
+ "notNull": false
1616
+ },
1617
+ "email_verified_at": {
1618
+ "name": "email_verified_at",
1619
+ "type": "timestamp with time zone",
1620
+ "primaryKey": false,
1621
+ "notNull": false
1622
+ },
1623
+ "status": {
1624
+ "name": "status",
1625
+ "type": "auth_user_status",
1626
+ "typeSchema": "public",
1627
+ "primaryKey": false,
1628
+ "notNull": true,
1629
+ "default": "'active'"
1630
+ },
1631
+ "created_at": {
1632
+ "name": "created_at",
1633
+ "type": "timestamp (3) with time zone",
1634
+ "primaryKey": false,
1635
+ "notNull": true,
1636
+ "default": "now()"
1637
+ },
1638
+ "updated_at": {
1639
+ "name": "updated_at",
1640
+ "type": "timestamp with time zone",
1641
+ "primaryKey": false,
1642
+ "notNull": true,
1643
+ "default": "now()"
1644
+ }
1645
+ },
1646
+ "indexes": {
1647
+ "auth_users_email_unique": {
1648
+ "name": "auth_users_email_unique",
1649
+ "columns": [
1650
+ {
1651
+ "expression": "email",
1652
+ "isExpression": false,
1653
+ "asc": true,
1654
+ "nulls": "last"
1655
+ }
1656
+ ],
1657
+ "isUnique": true,
1658
+ "concurrently": false,
1659
+ "method": "btree",
1660
+ "with": {}
1661
+ },
1662
+ "auth_users_created_at_id_index": {
1663
+ "name": "auth_users_created_at_id_index",
1664
+ "columns": [
1665
+ {
1666
+ "expression": "\"created_at\" desc",
1667
+ "asc": true,
1668
+ "isExpression": true,
1669
+ "nulls": "last"
1670
+ },
1671
+ {
1672
+ "expression": "\"id\" desc",
1673
+ "asc": true,
1674
+ "isExpression": true,
1675
+ "nulls": "last"
1676
+ }
1677
+ ],
1678
+ "isUnique": false,
1679
+ "concurrently": false,
1680
+ "method": "btree",
1681
+ "with": {}
1682
+ },
1683
+ "auth_users_name_trgm_index": {
1684
+ "name": "auth_users_name_trgm_index",
1685
+ "columns": [
1686
+ {
1687
+ "expression": "name",
1688
+ "isExpression": false,
1689
+ "asc": true,
1690
+ "nulls": "last",
1691
+ "opclass": "gin_trgm_ops"
1692
+ }
1693
+ ],
1694
+ "isUnique": false,
1695
+ "concurrently": false,
1696
+ "method": "gin",
1697
+ "with": {}
1698
+ },
1699
+ "auth_users_email_trgm_index": {
1700
+ "name": "auth_users_email_trgm_index",
1701
+ "columns": [
1702
+ {
1703
+ "expression": "email",
1704
+ "isExpression": false,
1705
+ "asc": true,
1706
+ "nulls": "last",
1707
+ "opclass": "gin_trgm_ops"
1708
+ }
1709
+ ],
1710
+ "isUnique": false,
1711
+ "concurrently": false,
1712
+ "method": "gin",
1713
+ "with": {}
1714
+ }
1715
+ },
1716
+ "foreignKeys": {},
1717
+ "compositePrimaryKeys": {},
1718
+ "uniqueConstraints": {},
1719
+ "policies": {},
1720
+ "checkConstraints": {},
1721
+ "isRLSEnabled": false
1722
+ }
1723
+ },
1724
+ "enums": {
1725
+ "public.auth_admin_role": {
1726
+ "name": "auth_admin_role",
1727
+ "schema": "public",
1728
+ "values": ["admin-observer", "admin-operator", "admin-owner"]
1729
+ },
1730
+ "public.auth_agent_client_kind": {
1731
+ "name": "auth_agent_client_kind",
1732
+ "schema": "public",
1733
+ "values": ["registered", "cimd"]
1734
+ },
1735
+ "public.auth_user_status": {
1736
+ "name": "auth_user_status",
1737
+ "schema": "public",
1738
+ "values": ["active", "suspended", "deleted"]
1739
+ }
1740
+ },
1741
+ "schemas": {},
1742
+ "sequences": {},
1743
+ "roles": {},
1744
+ "policies": {},
1745
+ "views": {},
1746
+ "_meta": {
1747
+ "columns": {},
1748
+ "schemas": {},
1749
+ "tables": {}
1750
+ }
1751
+ }