@shipfox/api-workspaces 2.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 (284) hide show
  1. package/.turbo/turbo-build.log +2 -0
  2. package/.turbo/turbo-type$colon$emit.log +1 -0
  3. package/.turbo/turbo-type.log +1 -0
  4. package/CHANGELOG.md +97 -0
  5. package/LICENSE +21 -0
  6. package/README.md +87 -0
  7. package/dist/config.d.ts +12 -0
  8. package/dist/config.d.ts.map +1 -0
  9. package/dist/config.js +58 -0
  10. package/dist/config.js.map +1 -0
  11. package/dist/core/entities/index.d.ts +4 -0
  12. package/dist/core/entities/index.d.ts.map +1 -0
  13. package/dist/core/entities/index.js +3 -0
  14. package/dist/core/entities/index.js.map +1 -0
  15. package/dist/core/entities/invitation.d.ts +14 -0
  16. package/dist/core/entities/invitation.d.ts.map +1 -0
  17. package/dist/core/entities/invitation.js +3 -0
  18. package/dist/core/entities/invitation.js.map +1 -0
  19. package/dist/core/entities/membership.d.ts +10 -0
  20. package/dist/core/entities/membership.d.ts.map +1 -0
  21. package/dist/core/entities/membership.js +3 -0
  22. package/dist/core/entities/membership.js.map +1 -0
  23. package/dist/core/entities/workspace.d.ts +10 -0
  24. package/dist/core/entities/workspace.d.ts.map +1 -0
  25. package/dist/core/entities/workspace.js +3 -0
  26. package/dist/core/entities/workspace.js.map +1 -0
  27. package/dist/core/errors.d.ts +52 -0
  28. package/dist/core/errors.d.ts.map +1 -0
  29. package/dist/core/errors.js +104 -0
  30. package/dist/core/errors.js.map +1 -0
  31. package/dist/core/index.d.ts +8 -0
  32. package/dist/core/index.d.ts.map +1 -0
  33. package/dist/core/index.js +6 -0
  34. package/dist/core/index.js.map +1 -0
  35. package/dist/core/invitations.d.ts +51 -0
  36. package/dist/core/invitations.d.ts.map +1 -0
  37. package/dist/core/invitations.js +136 -0
  38. package/dist/core/invitations.js.map +1 -0
  39. package/dist/core/memberships.d.ts +9 -0
  40. package/dist/core/memberships.d.ts.map +1 -0
  41. package/dist/core/memberships.js +13 -0
  42. package/dist/core/memberships.js.map +1 -0
  43. package/dist/core/workspaces.d.ts +40 -0
  44. package/dist/core/workspaces.d.ts.map +1 -0
  45. package/dist/core/workspaces.js +85 -0
  46. package/dist/core/workspaces.js.map +1 -0
  47. package/dist/db/db.d.ts +1253 -0
  48. package/dist/db/db.d.ts.map +1 -0
  49. package/dist/db/db.js +24 -0
  50. package/dist/db/db.js.map +1 -0
  51. package/dist/db/index.d.ts +10 -0
  52. package/dist/db/index.d.ts.map +1 -0
  53. package/dist/db/index.js +10 -0
  54. package/dist/db/index.js.map +1 -0
  55. package/dist/db/invitations.d.ts +47 -0
  56. package/dist/db/invitations.d.ts.map +1 -0
  57. package/dist/db/invitations.js +107 -0
  58. package/dist/db/invitations.js.map +1 -0
  59. package/dist/db/memberships.d.ts +44 -0
  60. package/dist/db/memberships.d.ts.map +1 -0
  61. package/dist/db/memberships.js +75 -0
  62. package/dist/db/memberships.js.map +1 -0
  63. package/dist/db/schema/common.d.ts +2 -0
  64. package/dist/db/schema/common.d.ts.map +1 -0
  65. package/dist/db/schema/common.js +4 -0
  66. package/dist/db/schema/common.js.map +1 -0
  67. package/dist/db/schema/invitations.d.ts +199 -0
  68. package/dist/db/schema/invitations.d.ts.map +1 -0
  69. package/dist/db/schema/invitations.js +47 -0
  70. package/dist/db/schema/invitations.js.map +1 -0
  71. package/dist/db/schema/memberships.d.ts +131 -0
  72. package/dist/db/schema/memberships.d.ts.map +1 -0
  73. package/dist/db/schema/memberships.js +35 -0
  74. package/dist/db/schema/memberships.js.map +1 -0
  75. package/dist/db/schema/outbox.d.ts +195 -0
  76. package/dist/db/schema/outbox.d.ts.map +1 -0
  77. package/dist/db/schema/outbox.js +5 -0
  78. package/dist/db/schema/outbox.js.map +1 -0
  79. package/dist/db/schema/workspaces.d.ts +115 -0
  80. package/dist/db/schema/workspaces.d.ts.map +1 -0
  81. package/dist/db/schema/workspaces.js +32 -0
  82. package/dist/db/schema/workspaces.js.map +1 -0
  83. package/dist/db/workspaces.d.ts +20 -0
  84. package/dist/db/workspaces.d.ts.map +1 -0
  85. package/dist/db/workspaces.js +53 -0
  86. package/dist/db/workspaces.js.map +1 -0
  87. package/dist/index.d.ts +13 -0
  88. package/dist/index.d.ts.map +1 -0
  89. package/dist/index.js +40 -0
  90. package/dist/index.js.map +1 -0
  91. package/dist/metrics/index.d.ts +2 -0
  92. package/dist/metrics/index.d.ts.map +1 -0
  93. package/dist/metrics/index.js +3 -0
  94. package/dist/metrics/index.js.map +1 -0
  95. package/dist/metrics/instance.d.ts +8 -0
  96. package/dist/metrics/instance.d.ts.map +1 -0
  97. package/dist/metrics/instance.js +41 -0
  98. package/dist/metrics/instance.js.map +1 -0
  99. package/dist/metrics/service.d.ts +2 -0
  100. package/dist/metrics/service.d.ts.map +1 -0
  101. package/dist/metrics/service.js +26 -0
  102. package/dist/metrics/service.js.map +1 -0
  103. package/dist/presentation/dto/index.d.ts +4 -0
  104. package/dist/presentation/dto/index.d.ts.map +1 -0
  105. package/dist/presentation/dto/index.js +5 -0
  106. package/dist/presentation/dto/index.js.map +1 -0
  107. package/dist/presentation/dto/invitation.d.ts +4 -0
  108. package/dist/presentation/dto/invitation.d.ts.map +1 -0
  109. package/dist/presentation/dto/invitation.js +15 -0
  110. package/dist/presentation/dto/invitation.js.map +1 -0
  111. package/dist/presentation/dto/membership.d.ts +5 -0
  112. package/dist/presentation/dto/membership.d.ts.map +1 -0
  113. package/dist/presentation/dto/membership.js +23 -0
  114. package/dist/presentation/dto/membership.js.map +1 -0
  115. package/dist/presentation/dto/workspace.d.ts +4 -0
  116. package/dist/presentation/dto/workspace.d.ts.map +1 -0
  117. package/dist/presentation/dto/workspace.js +12 -0
  118. package/dist/presentation/dto/workspace.js.map +1 -0
  119. package/dist/presentation/e2eRoutes/create-invitation.d.ts +2 -0
  120. package/dist/presentation/e2eRoutes/create-invitation.d.ts.map +1 -0
  121. package/dist/presentation/e2eRoutes/create-invitation.js +39 -0
  122. package/dist/presentation/e2eRoutes/create-invitation.js.map +1 -0
  123. package/dist/presentation/e2eRoutes/create-workspace.d.ts +2 -0
  124. package/dist/presentation/e2eRoutes/create-workspace.d.ts.map +1 -0
  125. package/dist/presentation/e2eRoutes/create-workspace.js +27 -0
  126. package/dist/presentation/e2eRoutes/create-workspace.js.map +1 -0
  127. package/dist/presentation/e2eRoutes/index.d.ts +3 -0
  128. package/dist/presentation/e2eRoutes/index.d.ts.map +1 -0
  129. package/dist/presentation/e2eRoutes/index.js +11 -0
  130. package/dist/presentation/e2eRoutes/index.js.map +1 -0
  131. package/dist/presentation/index.d.ts +2 -0
  132. package/dist/presentation/index.d.ts.map +1 -0
  133. package/dist/presentation/index.js +3 -0
  134. package/dist/presentation/index.js.map +1 -0
  135. package/dist/presentation/routes/index.d.ts +3 -0
  136. package/dist/presentation/routes/index.d.ts.map +1 -0
  137. package/dist/presentation/routes/index.js +23 -0
  138. package/dist/presentation/routes/index.js.map +1 -0
  139. package/dist/presentation/routes/invitations/accept.d.ts +2 -0
  140. package/dist/presentation/routes/invitations/accept.d.ts.map +1 -0
  141. package/dist/presentation/routes/invitations/accept.js +67 -0
  142. package/dist/presentation/routes/invitations/accept.js.map +1 -0
  143. package/dist/presentation/routes/invitations/create.d.ts +2 -0
  144. package/dist/presentation/routes/invitations/create.d.ts.map +1 -0
  145. package/dist/presentation/routes/invitations/create.js +66 -0
  146. package/dist/presentation/routes/invitations/create.js.map +1 -0
  147. package/dist/presentation/routes/invitations/index.d.ts +4 -0
  148. package/dist/presentation/routes/invitations/index.d.ts.map +1 -0
  149. package/dist/presentation/routes/invitations/index.js +19 -0
  150. package/dist/presentation/routes/invitations/index.js.map +1 -0
  151. package/dist/presentation/routes/invitations/list.d.ts +2 -0
  152. package/dist/presentation/routes/invitations/list.d.ts.map +1 -0
  153. package/dist/presentation/routes/invitations/list.js +58 -0
  154. package/dist/presentation/routes/invitations/list.js.map +1 -0
  155. package/dist/presentation/routes/invitations/preview.d.ts +2 -0
  156. package/dist/presentation/routes/invitations/preview.d.ts.map +1 -0
  157. package/dist/presentation/routes/invitations/preview.js +47 -0
  158. package/dist/presentation/routes/invitations/preview.js.map +1 -0
  159. package/dist/presentation/routes/invitations/revoke.d.ts +2 -0
  160. package/dist/presentation/routes/invitations/revoke.d.ts.map +1 -0
  161. package/dist/presentation/routes/invitations/revoke.js +66 -0
  162. package/dist/presentation/routes/invitations/revoke.js.map +1 -0
  163. package/dist/presentation/routes/members/index.d.ts +3 -0
  164. package/dist/presentation/routes/members/index.d.ts.map +1 -0
  165. package/dist/presentation/routes/members/index.js +8 -0
  166. package/dist/presentation/routes/members/index.js.map +1 -0
  167. package/dist/presentation/routes/members/list.d.ts +2 -0
  168. package/dist/presentation/routes/members/list.d.ts.map +1 -0
  169. package/dist/presentation/routes/members/list.js +58 -0
  170. package/dist/presentation/routes/members/list.js.map +1 -0
  171. package/dist/presentation/routes/members/remove.d.ts +2 -0
  172. package/dist/presentation/routes/members/remove.d.ts.map +1 -0
  173. package/dist/presentation/routes/members/remove.js +71 -0
  174. package/dist/presentation/routes/members/remove.js.map +1 -0
  175. package/dist/presentation/routes/workspaces/create.d.ts +2 -0
  176. package/dist/presentation/routes/workspaces/create.d.ts.map +1 -0
  177. package/dist/presentation/routes/workspaces/create.js +36 -0
  178. package/dist/presentation/routes/workspaces/create.js.map +1 -0
  179. package/dist/presentation/routes/workspaces/index.d.ts +3 -0
  180. package/dist/presentation/routes/workspaces/index.d.ts.map +1 -0
  181. package/dist/presentation/routes/workspaces/index.js +4 -0
  182. package/dist/presentation/routes/workspaces/index.js.map +1 -0
  183. package/dist/presentation/routes/workspaces/list.d.ts +2 -0
  184. package/dist/presentation/routes/workspaces/list.d.ts.map +1 -0
  185. package/dist/presentation/routes/workspaces/list.js +32 -0
  186. package/dist/presentation/routes/workspaces/list.js.map +1 -0
  187. package/dist/presentation/subscribers/index.d.ts +2 -0
  188. package/dist/presentation/subscribers/index.d.ts.map +1 -0
  189. package/dist/presentation/subscribers/index.js +3 -0
  190. package/dist/presentation/subscribers/index.js.map +1 -0
  191. package/dist/presentation/subscribers/on-invitation-send-requested.d.ts +3 -0
  192. package/dist/presentation/subscribers/on-invitation-send-requested.d.ts.map +1 -0
  193. package/dist/presentation/subscribers/on-invitation-send-requested.js +16 -0
  194. package/dist/presentation/subscribers/on-invitation-send-requested.js.map +1 -0
  195. package/dist/tsconfig.test.tsbuildinfo +1 -0
  196. package/drizzle/0000_initial.sql +9 -0
  197. package/drizzle/0001_memberships_invitations.sql +30 -0
  198. package/drizzle/0002_membership_user_snapshots.sql +40 -0
  199. package/drizzle/0003_outgoing_enchantress.sql +16 -0
  200. package/drizzle/meta/0000_snapshot.json +80 -0
  201. package/drizzle/meta/0001_snapshot.json +705 -0
  202. package/drizzle/meta/0003_snapshot.json +442 -0
  203. package/drizzle/meta/_journal.json +34 -0
  204. package/drizzle.config.ts +7 -0
  205. package/package.json +71 -0
  206. package/src/config.ts +51 -0
  207. package/src/core/entities/index.ts +3 -0
  208. package/src/core/entities/invitation.ts +13 -0
  209. package/src/core/entities/membership.ts +9 -0
  210. package/src/core/entities/workspace.ts +10 -0
  211. package/src/core/errors.ts +118 -0
  212. package/src/core/index.ts +35 -0
  213. package/src/core/invitations.test.ts +251 -0
  214. package/src/core/invitations.ts +191 -0
  215. package/src/core/memberships.test.ts +77 -0
  216. package/src/core/memberships.ts +17 -0
  217. package/src/core/workspaces.test.ts +72 -0
  218. package/src/core/workspaces.ts +126 -0
  219. package/src/db/db.ts +24 -0
  220. package/src/db/index.ts +43 -0
  221. package/src/db/invitations.test.ts +204 -0
  222. package/src/db/invitations.ts +235 -0
  223. package/src/db/memberships.test.ts +107 -0
  224. package/src/db/memberships.ts +139 -0
  225. package/src/db/schema/common.ts +5 -0
  226. package/src/db/schema/invitations.ts +47 -0
  227. package/src/db/schema/memberships.ts +39 -0
  228. package/src/db/schema/outbox.ts +4 -0
  229. package/src/db/schema/workspaces.ts +33 -0
  230. package/src/db/workspaces.test.ts +114 -0
  231. package/src/db/workspaces.ts +81 -0
  232. package/src/index.test.ts +25 -0
  233. package/src/index.ts +43 -0
  234. package/src/metrics/index.ts +1 -0
  235. package/src/metrics/instance.test.ts +74 -0
  236. package/src/metrics/instance.ts +57 -0
  237. package/src/metrics/service.ts +26 -0
  238. package/src/presentation/dto/index.ts +3 -0
  239. package/src/presentation/dto/invitation.ts +16 -0
  240. package/src/presentation/dto/membership.ts +27 -0
  241. package/src/presentation/dto/workspace.ts +13 -0
  242. package/src/presentation/e2eRoutes/create-invitation.ts +44 -0
  243. package/src/presentation/e2eRoutes/create-workspace.ts +30 -0
  244. package/src/presentation/e2eRoutes/index.ts +8 -0
  245. package/src/presentation/index.ts +1 -0
  246. package/src/presentation/routes/index.ts +23 -0
  247. package/src/presentation/routes/invitations/accept.test.ts +154 -0
  248. package/src/presentation/routes/invitations/accept.ts +70 -0
  249. package/src/presentation/routes/invitations/create.test.ts +99 -0
  250. package/src/presentation/routes/invitations/create.ts +60 -0
  251. package/src/presentation/routes/invitations/index.ts +17 -0
  252. package/src/presentation/routes/invitations/list.test.ts +94 -0
  253. package/src/presentation/routes/invitations/list.ts +53 -0
  254. package/src/presentation/routes/invitations/preview.test.ts +140 -0
  255. package/src/presentation/routes/invitations/preview.ts +46 -0
  256. package/src/presentation/routes/invitations/revoke.test.ts +99 -0
  257. package/src/presentation/routes/invitations/revoke.ts +64 -0
  258. package/src/presentation/routes/members/index.ts +5 -0
  259. package/src/presentation/routes/members/list.test.ts +95 -0
  260. package/src/presentation/routes/members/list.ts +53 -0
  261. package/src/presentation/routes/members/remove.test.ts +110 -0
  262. package/src/presentation/routes/members/remove.ts +66 -0
  263. package/src/presentation/routes/workspaces/create.test.ts +87 -0
  264. package/src/presentation/routes/workspaces/create.ts +36 -0
  265. package/src/presentation/routes/workspaces/index.ts +2 -0
  266. package/src/presentation/routes/workspaces/list.test.ts +56 -0
  267. package/src/presentation/routes/workspaces/list.ts +29 -0
  268. package/src/presentation/subscribers/index.ts +1 -0
  269. package/src/presentation/subscribers/invitation-send-requested.test.ts +64 -0
  270. package/src/presentation/subscribers/on-invitation-send-requested.ts +15 -0
  271. package/test/env.ts +8 -0
  272. package/test/factories/index.ts +3 -0
  273. package/test/factories/membership.ts +24 -0
  274. package/test/factories/user.ts +15 -0
  275. package/test/factories/workspace.ts +18 -0
  276. package/test/globalSetup.ts +15 -0
  277. package/test/index.ts +3 -0
  278. package/test/routes.ts +255 -0
  279. package/test/setup.ts +17 -0
  280. package/tsconfig.build.json +9 -0
  281. package/tsconfig.build.tsbuildinfo +1 -0
  282. package/tsconfig.json +3 -0
  283. package/tsconfig.test.json +8 -0
  284. package/vitest.config.ts +11 -0
@@ -0,0 +1,705 @@
1
+ {
2
+ "id": "71580355-da9f-475d-ab24-8d5e8cb5bb47",
3
+ "prevId": "0d727c74-5924-496b-94b6-df0c8943fcc4",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.workspaces_email_verifications": {
8
+ "name": "workspaces_email_verifications",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true,
16
+ "default": "uuidv7()"
17
+ },
18
+ "user_id": {
19
+ "name": "user_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "hashed_token": {
25
+ "name": "hashed_token",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true
29
+ },
30
+ "expires_at": {
31
+ "name": "expires_at",
32
+ "type": "timestamp with time zone",
33
+ "primaryKey": false,
34
+ "notNull": true
35
+ },
36
+ "used_at": {
37
+ "name": "used_at",
38
+ "type": "timestamp with time zone",
39
+ "primaryKey": false,
40
+ "notNull": false
41
+ },
42
+ "created_at": {
43
+ "name": "created_at",
44
+ "type": "timestamp with time zone",
45
+ "primaryKey": false,
46
+ "notNull": true,
47
+ "default": "now()"
48
+ }
49
+ },
50
+ "indexes": {
51
+ "workspaces_email_verifications_hashed_token_unique": {
52
+ "name": "workspaces_email_verifications_hashed_token_unique",
53
+ "columns": [
54
+ {
55
+ "expression": "hashed_token",
56
+ "isExpression": false,
57
+ "asc": true,
58
+ "nulls": "last"
59
+ }
60
+ ],
61
+ "isUnique": true,
62
+ "concurrently": false,
63
+ "method": "btree",
64
+ "with": {}
65
+ },
66
+ "workspaces_email_verifications_user_id_idx": {
67
+ "name": "workspaces_email_verifications_user_id_idx",
68
+ "columns": [
69
+ {
70
+ "expression": "user_id",
71
+ "isExpression": false,
72
+ "asc": true,
73
+ "nulls": "last"
74
+ }
75
+ ],
76
+ "isUnique": false,
77
+ "concurrently": false,
78
+ "method": "btree",
79
+ "with": {}
80
+ }
81
+ },
82
+ "foreignKeys": {
83
+ "workspaces_email_verifications_user_id_workspaces_users_id_fk": {
84
+ "name": "workspaces_email_verifications_user_id_workspaces_users_id_fk",
85
+ "tableFrom": "workspaces_email_verifications",
86
+ "tableTo": "workspaces_users",
87
+ "columnsFrom": ["user_id"],
88
+ "columnsTo": ["id"],
89
+ "onDelete": "cascade",
90
+ "onUpdate": "no action"
91
+ }
92
+ },
93
+ "compositePrimaryKeys": {},
94
+ "uniqueConstraints": {},
95
+ "policies": {},
96
+ "checkConstraints": {},
97
+ "isRLSEnabled": false
98
+ },
99
+ "public.workspaces_invitations": {
100
+ "name": "workspaces_invitations",
101
+ "schema": "",
102
+ "columns": {
103
+ "id": {
104
+ "name": "id",
105
+ "type": "uuid",
106
+ "primaryKey": true,
107
+ "notNull": true,
108
+ "default": "uuidv7()"
109
+ },
110
+ "workspace_id": {
111
+ "name": "workspace_id",
112
+ "type": "uuid",
113
+ "primaryKey": false,
114
+ "notNull": true
115
+ },
116
+ "email": {
117
+ "name": "email",
118
+ "type": "text",
119
+ "primaryKey": false,
120
+ "notNull": true
121
+ },
122
+ "hashed_token": {
123
+ "name": "hashed_token",
124
+ "type": "text",
125
+ "primaryKey": false,
126
+ "notNull": true
127
+ },
128
+ "expires_at": {
129
+ "name": "expires_at",
130
+ "type": "timestamp with time zone",
131
+ "primaryKey": false,
132
+ "notNull": true
133
+ },
134
+ "accepted_at": {
135
+ "name": "accepted_at",
136
+ "type": "timestamp with time zone",
137
+ "primaryKey": false,
138
+ "notNull": false
139
+ },
140
+ "accepted_by_user_id": {
141
+ "name": "accepted_by_user_id",
142
+ "type": "uuid",
143
+ "primaryKey": false,
144
+ "notNull": false
145
+ },
146
+ "invited_by_user_id": {
147
+ "name": "invited_by_user_id",
148
+ "type": "uuid",
149
+ "primaryKey": false,
150
+ "notNull": true
151
+ },
152
+ "invited_by_display": {
153
+ "name": "invited_by_display",
154
+ "type": "text",
155
+ "primaryKey": false,
156
+ "notNull": false
157
+ },
158
+ "created_at": {
159
+ "name": "created_at",
160
+ "type": "timestamp with time zone",
161
+ "primaryKey": false,
162
+ "notNull": true,
163
+ "default": "now()"
164
+ },
165
+ "updated_at": {
166
+ "name": "updated_at",
167
+ "type": "timestamp with time zone",
168
+ "primaryKey": false,
169
+ "notNull": true,
170
+ "default": "now()"
171
+ }
172
+ },
173
+ "indexes": {
174
+ "workspaces_invitations_hashed_token_unique": {
175
+ "name": "workspaces_invitations_hashed_token_unique",
176
+ "columns": [
177
+ {
178
+ "expression": "hashed_token",
179
+ "isExpression": false,
180
+ "asc": true,
181
+ "nulls": "last"
182
+ }
183
+ ],
184
+ "isUnique": true,
185
+ "concurrently": false,
186
+ "method": "btree",
187
+ "with": {}
188
+ },
189
+ "workspaces_invitations_workspace_email_idx": {
190
+ "name": "workspaces_invitations_workspace_email_idx",
191
+ "columns": [
192
+ {
193
+ "expression": "workspace_id",
194
+ "isExpression": false,
195
+ "asc": true,
196
+ "nulls": "last"
197
+ },
198
+ {
199
+ "expression": "email",
200
+ "isExpression": false,
201
+ "asc": true,
202
+ "nulls": "last"
203
+ }
204
+ ],
205
+ "isUnique": false,
206
+ "concurrently": false,
207
+ "method": "btree",
208
+ "with": {}
209
+ }
210
+ },
211
+ "foreignKeys": {
212
+ "workspaces_invitations_workspace_id_workspaces_id_fk": {
213
+ "name": "workspaces_invitations_workspace_id_workspaces_id_fk",
214
+ "tableFrom": "workspaces_invitations",
215
+ "tableTo": "workspaces",
216
+ "columnsFrom": ["workspace_id"],
217
+ "columnsTo": ["id"],
218
+ "onDelete": "cascade",
219
+ "onUpdate": "no action"
220
+ },
221
+ "workspaces_invitations_accepted_by_user_id_workspaces_users_id_fk": {
222
+ "name": "workspaces_invitations_accepted_by_user_id_workspaces_users_id_fk",
223
+ "tableFrom": "workspaces_invitations",
224
+ "tableTo": "workspaces_users",
225
+ "columnsFrom": ["accepted_by_user_id"],
226
+ "columnsTo": ["id"],
227
+ "onDelete": "set null",
228
+ "onUpdate": "no action"
229
+ },
230
+ "workspaces_invitations_invited_by_user_id_workspaces_users_id_fk": {
231
+ "name": "workspaces_invitations_invited_by_user_id_workspaces_users_id_fk",
232
+ "tableFrom": "workspaces_invitations",
233
+ "tableTo": "workspaces_users",
234
+ "columnsFrom": ["invited_by_user_id"],
235
+ "columnsTo": ["id"],
236
+ "onDelete": "restrict",
237
+ "onUpdate": "no action"
238
+ }
239
+ },
240
+ "compositePrimaryKeys": {},
241
+ "uniqueConstraints": {},
242
+ "policies": {},
243
+ "checkConstraints": {},
244
+ "isRLSEnabled": false
245
+ },
246
+ "public.workspaces_memberships": {
247
+ "name": "workspaces_memberships",
248
+ "schema": "",
249
+ "columns": {
250
+ "id": {
251
+ "name": "id",
252
+ "type": "uuid",
253
+ "primaryKey": true,
254
+ "notNull": true,
255
+ "default": "uuidv7()"
256
+ },
257
+ "user_id": {
258
+ "name": "user_id",
259
+ "type": "uuid",
260
+ "primaryKey": false,
261
+ "notNull": true
262
+ },
263
+ "workspace_id": {
264
+ "name": "workspace_id",
265
+ "type": "uuid",
266
+ "primaryKey": false,
267
+ "notNull": true
268
+ },
269
+ "created_at": {
270
+ "name": "created_at",
271
+ "type": "timestamp with time zone",
272
+ "primaryKey": false,
273
+ "notNull": true,
274
+ "default": "now()"
275
+ },
276
+ "updated_at": {
277
+ "name": "updated_at",
278
+ "type": "timestamp with time zone",
279
+ "primaryKey": false,
280
+ "notNull": true,
281
+ "default": "now()"
282
+ }
283
+ },
284
+ "indexes": {
285
+ "workspaces_memberships_user_workspace_unique": {
286
+ "name": "workspaces_memberships_user_workspace_unique",
287
+ "columns": [
288
+ {
289
+ "expression": "user_id",
290
+ "isExpression": false,
291
+ "asc": true,
292
+ "nulls": "last"
293
+ },
294
+ {
295
+ "expression": "workspace_id",
296
+ "isExpression": false,
297
+ "asc": true,
298
+ "nulls": "last"
299
+ }
300
+ ],
301
+ "isUnique": true,
302
+ "concurrently": false,
303
+ "method": "btree",
304
+ "with": {}
305
+ },
306
+ "workspaces_memberships_workspace_id_idx": {
307
+ "name": "workspaces_memberships_workspace_id_idx",
308
+ "columns": [
309
+ {
310
+ "expression": "workspace_id",
311
+ "isExpression": false,
312
+ "asc": true,
313
+ "nulls": "last"
314
+ }
315
+ ],
316
+ "isUnique": false,
317
+ "concurrently": false,
318
+ "method": "btree",
319
+ "with": {}
320
+ }
321
+ },
322
+ "foreignKeys": {
323
+ "workspaces_memberships_user_id_workspaces_users_id_fk": {
324
+ "name": "workspaces_memberships_user_id_workspaces_users_id_fk",
325
+ "tableFrom": "workspaces_memberships",
326
+ "tableTo": "workspaces_users",
327
+ "columnsFrom": ["user_id"],
328
+ "columnsTo": ["id"],
329
+ "onDelete": "cascade",
330
+ "onUpdate": "no action"
331
+ },
332
+ "workspaces_memberships_workspace_id_workspaces_id_fk": {
333
+ "name": "workspaces_memberships_workspace_id_workspaces_id_fk",
334
+ "tableFrom": "workspaces_memberships",
335
+ "tableTo": "workspaces",
336
+ "columnsFrom": ["workspace_id"],
337
+ "columnsTo": ["id"],
338
+ "onDelete": "cascade",
339
+ "onUpdate": "no action"
340
+ }
341
+ },
342
+ "compositePrimaryKeys": {},
343
+ "uniqueConstraints": {},
344
+ "policies": {},
345
+ "checkConstraints": {},
346
+ "isRLSEnabled": false
347
+ },
348
+ "public.workspaces_password_resets": {
349
+ "name": "workspaces_password_resets",
350
+ "schema": "",
351
+ "columns": {
352
+ "id": {
353
+ "name": "id",
354
+ "type": "uuid",
355
+ "primaryKey": true,
356
+ "notNull": true,
357
+ "default": "uuidv7()"
358
+ },
359
+ "user_id": {
360
+ "name": "user_id",
361
+ "type": "uuid",
362
+ "primaryKey": false,
363
+ "notNull": true
364
+ },
365
+ "hashed_token": {
366
+ "name": "hashed_token",
367
+ "type": "text",
368
+ "primaryKey": false,
369
+ "notNull": true
370
+ },
371
+ "expires_at": {
372
+ "name": "expires_at",
373
+ "type": "timestamp with time zone",
374
+ "primaryKey": false,
375
+ "notNull": true
376
+ },
377
+ "used_at": {
378
+ "name": "used_at",
379
+ "type": "timestamp with time zone",
380
+ "primaryKey": false,
381
+ "notNull": false
382
+ },
383
+ "created_at": {
384
+ "name": "created_at",
385
+ "type": "timestamp with time zone",
386
+ "primaryKey": false,
387
+ "notNull": true,
388
+ "default": "now()"
389
+ }
390
+ },
391
+ "indexes": {
392
+ "workspaces_password_resets_hashed_token_unique": {
393
+ "name": "workspaces_password_resets_hashed_token_unique",
394
+ "columns": [
395
+ {
396
+ "expression": "hashed_token",
397
+ "isExpression": false,
398
+ "asc": true,
399
+ "nulls": "last"
400
+ }
401
+ ],
402
+ "isUnique": true,
403
+ "concurrently": false,
404
+ "method": "btree",
405
+ "with": {}
406
+ },
407
+ "workspaces_password_resets_user_id_idx": {
408
+ "name": "workspaces_password_resets_user_id_idx",
409
+ "columns": [
410
+ {
411
+ "expression": "user_id",
412
+ "isExpression": false,
413
+ "asc": true,
414
+ "nulls": "last"
415
+ }
416
+ ],
417
+ "isUnique": false,
418
+ "concurrently": false,
419
+ "method": "btree",
420
+ "with": {}
421
+ }
422
+ },
423
+ "foreignKeys": {
424
+ "workspaces_password_resets_user_id_workspaces_users_id_fk": {
425
+ "name": "workspaces_password_resets_user_id_workspaces_users_id_fk",
426
+ "tableFrom": "workspaces_password_resets",
427
+ "tableTo": "workspaces_users",
428
+ "columnsFrom": ["user_id"],
429
+ "columnsTo": ["id"],
430
+ "onDelete": "cascade",
431
+ "onUpdate": "no action"
432
+ }
433
+ },
434
+ "compositePrimaryKeys": {},
435
+ "uniqueConstraints": {},
436
+ "policies": {},
437
+ "checkConstraints": {},
438
+ "isRLSEnabled": false
439
+ },
440
+ "public.workspaces_refresh_tokens": {
441
+ "name": "workspaces_refresh_tokens",
442
+ "schema": "",
443
+ "columns": {
444
+ "id": {
445
+ "name": "id",
446
+ "type": "uuid",
447
+ "primaryKey": true,
448
+ "notNull": true,
449
+ "default": "uuidv7()"
450
+ },
451
+ "user_id": {
452
+ "name": "user_id",
453
+ "type": "uuid",
454
+ "primaryKey": false,
455
+ "notNull": true
456
+ },
457
+ "hashed_token": {
458
+ "name": "hashed_token",
459
+ "type": "text",
460
+ "primaryKey": false,
461
+ "notNull": true
462
+ },
463
+ "expires_at": {
464
+ "name": "expires_at",
465
+ "type": "timestamp with time zone",
466
+ "primaryKey": false,
467
+ "notNull": true
468
+ },
469
+ "revoked_at": {
470
+ "name": "revoked_at",
471
+ "type": "timestamp with time zone",
472
+ "primaryKey": false,
473
+ "notNull": false
474
+ },
475
+ "last_used_at": {
476
+ "name": "last_used_at",
477
+ "type": "timestamp with time zone",
478
+ "primaryKey": false,
479
+ "notNull": false
480
+ },
481
+ "created_at": {
482
+ "name": "created_at",
483
+ "type": "timestamp with time zone",
484
+ "primaryKey": false,
485
+ "notNull": true,
486
+ "default": "now()"
487
+ },
488
+ "updated_at": {
489
+ "name": "updated_at",
490
+ "type": "timestamp with time zone",
491
+ "primaryKey": false,
492
+ "notNull": true,
493
+ "default": "now()"
494
+ }
495
+ },
496
+ "indexes": {
497
+ "workspaces_refresh_tokens_hashed_token_unique": {
498
+ "name": "workspaces_refresh_tokens_hashed_token_unique",
499
+ "columns": [
500
+ {
501
+ "expression": "hashed_token",
502
+ "isExpression": false,
503
+ "asc": true,
504
+ "nulls": "last"
505
+ }
506
+ ],
507
+ "isUnique": true,
508
+ "concurrently": false,
509
+ "method": "btree",
510
+ "with": {}
511
+ },
512
+ "workspaces_refresh_tokens_user_id_idx": {
513
+ "name": "workspaces_refresh_tokens_user_id_idx",
514
+ "columns": [
515
+ {
516
+ "expression": "user_id",
517
+ "isExpression": false,
518
+ "asc": true,
519
+ "nulls": "last"
520
+ }
521
+ ],
522
+ "isUnique": false,
523
+ "concurrently": false,
524
+ "method": "btree",
525
+ "with": {}
526
+ }
527
+ },
528
+ "foreignKeys": {
529
+ "workspaces_refresh_tokens_user_id_workspaces_users_id_fk": {
530
+ "name": "workspaces_refresh_tokens_user_id_workspaces_users_id_fk",
531
+ "tableFrom": "workspaces_refresh_tokens",
532
+ "tableTo": "workspaces_users",
533
+ "columnsFrom": ["user_id"],
534
+ "columnsTo": ["id"],
535
+ "onDelete": "cascade",
536
+ "onUpdate": "no action"
537
+ }
538
+ },
539
+ "compositePrimaryKeys": {},
540
+ "uniqueConstraints": {},
541
+ "policies": {},
542
+ "checkConstraints": {},
543
+ "isRLSEnabled": false
544
+ },
545
+ "public.workspaces": {
546
+ "name": "workspaces",
547
+ "schema": "",
548
+ "columns": {
549
+ "id": {
550
+ "name": "id",
551
+ "type": "uuid",
552
+ "primaryKey": true,
553
+ "notNull": true,
554
+ "default": "uuidv7()"
555
+ },
556
+ "name": {
557
+ "name": "name",
558
+ "type": "text",
559
+ "primaryKey": false,
560
+ "notNull": true
561
+ },
562
+ "status": {
563
+ "name": "status",
564
+ "type": "workspaces_workspace_status",
565
+ "typeSchema": "public",
566
+ "primaryKey": false,
567
+ "notNull": true,
568
+ "default": "'active'"
569
+ },
570
+ "settings": {
571
+ "name": "settings",
572
+ "type": "jsonb",
573
+ "primaryKey": false,
574
+ "notNull": true,
575
+ "default": "'{}'::jsonb"
576
+ },
577
+ "created_at": {
578
+ "name": "created_at",
579
+ "type": "timestamp with time zone",
580
+ "primaryKey": false,
581
+ "notNull": true,
582
+ "default": "now()"
583
+ },
584
+ "updated_at": {
585
+ "name": "updated_at",
586
+ "type": "timestamp with time zone",
587
+ "primaryKey": false,
588
+ "notNull": true,
589
+ "default": "now()"
590
+ }
591
+ },
592
+ "indexes": {},
593
+ "foreignKeys": {},
594
+ "compositePrimaryKeys": {},
595
+ "uniqueConstraints": {},
596
+ "policies": {},
597
+ "checkConstraints": {},
598
+ "isRLSEnabled": false
599
+ },
600
+ "public.workspaces_users": {
601
+ "name": "workspaces_users",
602
+ "schema": "",
603
+ "columns": {
604
+ "id": {
605
+ "name": "id",
606
+ "type": "uuid",
607
+ "primaryKey": true,
608
+ "notNull": true,
609
+ "default": "uuidv7()"
610
+ },
611
+ "email": {
612
+ "name": "email",
613
+ "type": "text",
614
+ "primaryKey": false,
615
+ "notNull": true
616
+ },
617
+ "hashed_password": {
618
+ "name": "hashed_password",
619
+ "type": "text",
620
+ "primaryKey": false,
621
+ "notNull": true
622
+ },
623
+ "name": {
624
+ "name": "name",
625
+ "type": "text",
626
+ "primaryKey": false,
627
+ "notNull": false
628
+ },
629
+ "email_verified_at": {
630
+ "name": "email_verified_at",
631
+ "type": "timestamp with time zone",
632
+ "primaryKey": false,
633
+ "notNull": false
634
+ },
635
+ "status": {
636
+ "name": "status",
637
+ "type": "workspaces_user_status",
638
+ "typeSchema": "public",
639
+ "primaryKey": false,
640
+ "notNull": true,
641
+ "default": "'active'"
642
+ },
643
+ "created_at": {
644
+ "name": "created_at",
645
+ "type": "timestamp with time zone",
646
+ "primaryKey": false,
647
+ "notNull": true,
648
+ "default": "now()"
649
+ },
650
+ "updated_at": {
651
+ "name": "updated_at",
652
+ "type": "timestamp with time zone",
653
+ "primaryKey": false,
654
+ "notNull": true,
655
+ "default": "now()"
656
+ }
657
+ },
658
+ "indexes": {
659
+ "workspaces_users_email_unique": {
660
+ "name": "workspaces_users_email_unique",
661
+ "columns": [
662
+ {
663
+ "expression": "email",
664
+ "isExpression": false,
665
+ "asc": true,
666
+ "nulls": "last"
667
+ }
668
+ ],
669
+ "isUnique": true,
670
+ "concurrently": false,
671
+ "method": "btree",
672
+ "with": {}
673
+ }
674
+ },
675
+ "foreignKeys": {},
676
+ "compositePrimaryKeys": {},
677
+ "uniqueConstraints": {},
678
+ "policies": {},
679
+ "checkConstraints": {},
680
+ "isRLSEnabled": false
681
+ }
682
+ },
683
+ "enums": {
684
+ "public.workspaces_workspace_status": {
685
+ "name": "workspaces_workspace_status",
686
+ "schema": "public",
687
+ "values": ["active", "suspended", "deleted"]
688
+ },
689
+ "public.workspaces_user_status": {
690
+ "name": "workspaces_user_status",
691
+ "schema": "public",
692
+ "values": ["active", "suspended", "deleted"]
693
+ }
694
+ },
695
+ "schemas": {},
696
+ "sequences": {},
697
+ "roles": {},
698
+ "policies": {},
699
+ "views": {},
700
+ "_meta": {
701
+ "columns": {},
702
+ "schemas": {},
703
+ "tables": {}
704
+ }
705
+ }