ta_data_mas 0.0.2
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.
- package/README.md +42 -0
- package/apps/api/.prettierrc +4 -0
- package/apps/api/README.md +98 -0
- package/apps/api/drizzle/0000_right_drax.sql +87 -0
- package/apps/api/drizzle/meta/0000_snapshot.json +588 -0
- package/apps/api/drizzle/meta/_journal.json +13 -0
- package/apps/api/drizzle.config.ts +12 -0
- package/apps/api/eslint.config.mjs +35 -0
- package/apps/api/nest-cli.json +8 -0
- package/apps/api/package.json +99 -0
- package/apps/api/src/app.controller.spec.ts +25 -0
- package/apps/api/src/app.controller.ts +9 -0
- package/apps/api/src/app.module.ts +37 -0
- package/apps/api/src/app.service.ts +8 -0
- package/apps/api/src/auth/auth.controller.ts +113 -0
- package/apps/api/src/auth/auth.module.ts +15 -0
- package/apps/api/src/auth/auth.service.ts +309 -0
- package/apps/api/src/auth/decorators/current-user-decorator.ts +10 -0
- package/apps/api/src/auth/decorators/require-org-role-decorator.ts +7 -0
- package/apps/api/src/auth/dto/login.dto.ts +10 -0
- package/apps/api/src/auth/dto/register.dto.ts +14 -0
- package/apps/api/src/auth/guards/jwt-auth-guard.ts +40 -0
- package/apps/api/src/auth/guards/org-role.guards.ts +60 -0
- package/apps/api/src/db/db.module.ts +9 -0
- package/apps/api/src/db/drizzle.service.ts +16 -0
- package/apps/api/src/db/schema/index.ts +6 -0
- package/apps/api/src/db/schema/organizations.ts +30 -0
- package/apps/api/src/db/schema/projects.ts +26 -0
- package/apps/api/src/db/schema/query-history.ts +16 -0
- package/apps/api/src/db/schema/storage-buckets.ts +17 -0
- package/apps/api/src/db/schema/storage-objects.ts +18 -0
- package/apps/api/src/db/schema/users.ts +14 -0
- package/apps/api/src/main.ts +51 -0
- package/apps/api/src/members/dto/invite-member-dto.ts +6 -0
- package/apps/api/src/members/dto/update-role.dto.ts +8 -0
- package/apps/api/src/members/invite.service.ts +147 -0
- package/apps/api/src/members/members.controller.ts +56 -0
- package/apps/api/src/members/members.module.ts +13 -0
- package/apps/api/src/members/members.service.ts +85 -0
- package/apps/api/src/orgs/dto/create-org.dto.ts +8 -0
- package/apps/api/src/orgs/orgs.controller.ts +27 -0
- package/apps/api/src/orgs/orgs.module.ts +12 -0
- package/apps/api/src/orgs/orgs.service.ts +86 -0
- package/apps/api/src/project-api/project-api.controller.ts +95 -0
- package/apps/api/src/project-api/project-api.module.ts +12 -0
- package/apps/api/src/project-api/project-api.service.ts +196 -0
- package/apps/api/src/project-api/project-key.guard.ts +45 -0
- package/apps/api/src/project-api/query-parser.ts +129 -0
- package/apps/api/src/project-auth/dto/magic-link.dto.ts +7 -0
- package/apps/api/src/project-auth/dto/signin.dto.ts +10 -0
- package/apps/api/src/project-auth/dto/signup.dto.ts +11 -0
- package/apps/api/src/project-auth/project-auth-dashboard.controller.ts +35 -0
- package/apps/api/src/project-auth/project-auth.controller.ts +111 -0
- package/apps/api/src/project-auth/project-auth.module.ts +13 -0
- package/apps/api/src/project-auth/project-auth.service.ts +440 -0
- package/apps/api/src/projects/dto/create-project.dto.ts +9 -0
- package/apps/api/src/projects/projects.controller.ts +34 -0
- package/apps/api/src/projects/projects.module.ts +12 -0
- package/apps/api/src/projects/projects.service.ts +136 -0
- package/apps/api/src/realtime/realtime-socket.type.ts +14 -0
- package/apps/api/src/realtime/realtime.controller.ts +63 -0
- package/apps/api/src/realtime/realtime.gateway.ts +150 -0
- package/apps/api/src/realtime/realtime.module.ts +14 -0
- package/apps/api/src/realtime/realtime.service.ts +101 -0
- package/apps/api/src/realtime/trigger.service.ts +95 -0
- package/apps/api/src/sql-editor/dto/execute-query.dto.ts +7 -0
- package/apps/api/src/sql-editor/sql-editor.controller.ts +28 -0
- package/apps/api/src/sql-editor/sql-editor.module.ts +12 -0
- package/apps/api/src/sql-editor/sql-editor.service.ts +154 -0
- package/apps/api/src/storage/project-storage.controller.ts +140 -0
- package/apps/api/src/storage/storage.controller.ts +118 -0
- package/apps/api/src/storage/storage.module.ts +15 -0
- package/apps/api/src/storage/storage.service.ts +191 -0
- package/apps/api/src/storage/uploadthing.ts +23 -0
- package/apps/api/src/table-editor/dto/alter-table.dto.ts +15 -0
- package/apps/api/src/table-editor/dto/create-table.dto.ts +54 -0
- package/apps/api/src/table-editor/table-editor.controller.ts +117 -0
- package/apps/api/src/table-editor/table-editor.module.ts +12 -0
- package/apps/api/src/table-editor/table-editor.service.ts +366 -0
- package/apps/api/test/app.e2e-spec.ts +29 -0
- package/apps/api/test/jest-e2e.json +9 -0
- package/apps/api/tsconfig.build.json +4 -0
- package/apps/api/tsconfig.json +25 -0
- package/apps/web/.env.example +12 -0
- package/apps/web/AGENTS.md +9 -0
- package/apps/web/CLAUDE.md +1 -0
- package/apps/web/README.md +36 -0
- package/apps/web/components.json +25 -0
- package/apps/web/eslint.config.mjs +18 -0
- package/apps/web/next.config.ts +11 -0
- package/apps/web/package.json +48 -0
- package/apps/web/postcss.config.mjs +7 -0
- package/apps/web/public/file.svg +1 -0
- package/apps/web/public/globe.svg +1 -0
- package/apps/web/public/logo.svg +4 -0
- package/apps/web/public/next.svg +1 -0
- package/apps/web/public/vercel.svg +1 -0
- package/apps/web/public/window.svg +1 -0
- package/apps/web/src/app/(dashboard)/layout.tsx +33 -0
- package/apps/web/src/app/(dashboard)/organizations/(list)/layout.tsx +7 -0
- package/apps/web/src/app/(dashboard)/organizations/(list)/new/page.tsx +26 -0
- package/apps/web/src/app/(dashboard)/organizations/(list)/page.tsx +44 -0
- package/apps/web/src/app/(dashboard)/organizations/[slug]/[projectSlug]/api/page.tsx +13 -0
- package/apps/web/src/app/(dashboard)/organizations/[slug]/[projectSlug]/auth/layout.tsx +19 -0
- package/apps/web/src/app/(dashboard)/organizations/[slug]/[projectSlug]/auth/page.tsx +10 -0
- package/apps/web/src/app/(dashboard)/organizations/[slug]/[projectSlug]/auth/providers/page.tsx +19 -0
- package/apps/web/src/app/(dashboard)/organizations/[slug]/[projectSlug]/auth/url-configuration/page.tsx +24 -0
- package/apps/web/src/app/(dashboard)/organizations/[slug]/[projectSlug]/auth/users/page.tsx +13 -0
- package/apps/web/src/app/(dashboard)/organizations/[slug]/[projectSlug]/database/page.tsx +29 -0
- package/apps/web/src/app/(dashboard)/organizations/[slug]/[projectSlug]/realtime/page.tsx +28 -0
- package/apps/web/src/app/(dashboard)/organizations/[slug]/[projectSlug]/sql/page.tsx +21 -0
- package/apps/web/src/app/(dashboard)/organizations/[slug]/[projectSlug]/storage/page.tsx +28 -0
- package/apps/web/src/app/(dashboard)/organizations/[slug]/layout.tsx +20 -0
- package/apps/web/src/app/(dashboard)/organizations/[slug]/projects/page.tsx +62 -0
- package/apps/web/src/app/(dashboard)/organizations/[slug]/settings/members/page.tsx +28 -0
- package/apps/web/src/app/(dashboard)/organizations/[slug]/settings/page.tsx +10 -0
- package/apps/web/src/app/(dashboard)/settings/page.tsx +12 -0
- package/apps/web/src/app/dashboard/page.tsx +14 -0
- package/apps/web/src/app/favicon.ico +0 -0
- package/apps/web/src/app/globals.css +115 -0
- package/apps/web/src/app/layout.tsx +36 -0
- package/apps/web/src/app/login/page.tsx +199 -0
- package/apps/web/src/app/page.tsx +100 -0
- package/apps/web/src/app/register/page.tsx +218 -0
- package/apps/web/src/components/app-sidebar.tsx +301 -0
- package/apps/web/src/components/navbar.tsx +63 -0
- package/apps/web/src/components/topNav.tsx +68 -0
- package/apps/web/src/components/ui/avatar.tsx +112 -0
- package/apps/web/src/components/ui/badge.tsx +48 -0
- package/apps/web/src/components/ui/button.tsx +66 -0
- package/apps/web/src/components/ui/card.tsx +102 -0
- package/apps/web/src/components/ui/checkbox.tsx +32 -0
- package/apps/web/src/components/ui/dialog.tsx +168 -0
- package/apps/web/src/components/ui/dropdown-menu.tsx +269 -0
- package/apps/web/src/components/ui/field.tsx +238 -0
- package/apps/web/src/components/ui/input.tsx +19 -0
- package/apps/web/src/components/ui/label.tsx +24 -0
- package/apps/web/src/components/ui/resizable.tsx +50 -0
- package/apps/web/src/components/ui/scroll-area.tsx +55 -0
- package/apps/web/src/components/ui/select.tsx +192 -0
- package/apps/web/src/components/ui/separator.tsx +28 -0
- package/apps/web/src/components/ui/sheet.tsx +147 -0
- package/apps/web/src/components/ui/sidebar.tsx +703 -0
- package/apps/web/src/components/ui/skeleton.tsx +13 -0
- package/apps/web/src/components/ui/switch.tsx +33 -0
- package/apps/web/src/components/ui/table.tsx +116 -0
- package/apps/web/src/components/ui/tooltip.tsx +57 -0
- package/apps/web/src/features/api-docs/api-docs-client.tsx +227 -0
- package/apps/web/src/features/api-docs/api-docs-helpers.server.ts +86 -0
- package/apps/web/src/features/auth/action.ts +67 -0
- package/apps/web/src/features/auth/client.schema.ts +13 -0
- package/apps/web/src/features/auth/constants.ts +6 -0
- package/apps/web/src/features/auth/cookies.ts +86 -0
- package/apps/web/src/features/auth/server.schema.ts +11 -0
- package/apps/web/src/features/auth/sign-out.ts +17 -0
- package/apps/web/src/features/members/action.ts +66 -0
- package/apps/web/src/features/members/client.schema.ts +11 -0
- package/apps/web/src/features/members/constants.ts +8 -0
- package/apps/web/src/features/members/members-client.tsx +198 -0
- package/apps/web/src/features/members/members-helpers.server.ts +21 -0
- package/apps/web/src/features/members/server.schema.ts +19 -0
- package/apps/web/src/features/organization/action.ts +45 -0
- package/apps/web/src/features/organization/client.schema.ts +5 -0
- package/apps/web/src/features/organization/constants.tsx +3 -0
- package/apps/web/src/features/organization/create-org-form.tsx +66 -0
- package/apps/web/src/features/organization/organization-helpers.server.ts +35 -0
- package/apps/web/src/features/organization/server.schema.ts +10 -0
- package/apps/web/src/features/project-auth/project-auth-action.ts +78 -0
- package/apps/web/src/features/project-auth/project-auth-client.schema.ts +18 -0
- package/apps/web/src/features/project-auth/project-auth-constants.ts +8 -0
- package/apps/web/src/features/project-auth/project-auth-helpers.server.ts +39 -0
- package/apps/web/src/features/project-auth/project-auth-providers.tsx +222 -0
- package/apps/web/src/features/project-auth/project-auth-server.schema.ts +22 -0
- package/apps/web/src/features/project-auth/project-auth-shell.tsx +106 -0
- package/apps/web/src/features/project-auth/project-auth-url-config.tsx +151 -0
- package/apps/web/src/features/project-auth/project-auth-users.tsx +138 -0
- package/apps/web/src/features/projects/action.ts +46 -0
- package/apps/web/src/features/projects/client.schema.ts +9 -0
- package/apps/web/src/features/projects/constants.ts +6 -0
- package/apps/web/src/features/projects/create-project-modal.tsx +117 -0
- package/apps/web/src/features/projects/project-helpers.server.ts +38 -0
- package/apps/web/src/features/projects/server.schema.ts +10 -0
- package/apps/web/src/features/realtime/realtime-client.tsx +294 -0
- package/apps/web/src/features/realtime/realtime-helpers.server.ts +40 -0
- package/apps/web/src/features/sql-editor/sql-editor-client.tsx +324 -0
- package/apps/web/src/features/sql-editor/sql-editor-helpers.server.ts +22 -0
- package/apps/web/src/features/storage/storage-client.tsx +500 -0
- package/apps/web/src/features/storage/storage-helpers.server.ts +36 -0
- package/apps/web/src/features/table-editor/action.ts +97 -0
- package/apps/web/src/features/table-editor/add-column-dialog.tsx +184 -0
- package/apps/web/src/features/table-editor/client.schema.ts +36 -0
- package/apps/web/src/features/table-editor/create-table-drawer.tsx +542 -0
- package/apps/web/src/features/table-editor/server.schema.ts +41 -0
- package/apps/web/src/features/table-editor/table-editor-client.tsx +737 -0
- package/apps/web/src/features/table-editor/table-editor-helpers.server.ts +39 -0
- package/apps/web/src/hooks/use-mobile.ts +19 -0
- package/apps/web/src/lib/axios.ts +8 -0
- package/apps/web/src/lib/utils.ts +6 -0
- package/apps/web/src/proxy.ts +72 -0
- package/apps/web/src/server-utils/utils.ts +10 -0
- package/apps/web/tsconfig.json +34 -0
- package/package.json +22 -0
- package/packages/apiDatabase-js/package.json +39 -0
- package/packages/apiDatabase-js/src/auth/index.ts +121 -0
- package/packages/apiDatabase-js/src/client.ts +25 -0
- package/packages/apiDatabase-js/src/db/index.ts +15 -0
- package/packages/apiDatabase-js/src/db/query-builder.ts +194 -0
- package/packages/apiDatabase-js/src/index.ts +16 -0
- package/packages/apiDatabase-js/src/realtime/index.ts +84 -0
- package/packages/apiDatabase-js/src/storage/index.ts +130 -0
- package/packages/apiDatabase-js/tsconfig.json +13 -0
- package/packages/apiDatabase-js/tsdown.config.ts +20 -0
- package/packages/constants/package.json +6 -0
- package/packages/constants/src/index.ts +76 -0
- package/packages/tsconfig.json +13 -0
- package/packages/tsdown.config.ts +20 -0
- package/packages/types/package.json +6 -0
- package/packages/types/src/index.ts +254 -0
- package/pnpm-workspace.yaml +10 -0
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "28c911de-39f7-400e-8f5a-f72423faa897",
|
|
3
|
+
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
4
|
+
"version": "7",
|
|
5
|
+
"dialect": "postgresql",
|
|
6
|
+
"tables": {
|
|
7
|
+
"public.users": {
|
|
8
|
+
"name": "users",
|
|
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
|
+
"email": {
|
|
19
|
+
"name": "email",
|
|
20
|
+
"type": "text",
|
|
21
|
+
"primaryKey": false,
|
|
22
|
+
"notNull": true
|
|
23
|
+
},
|
|
24
|
+
"name": {
|
|
25
|
+
"name": "name",
|
|
26
|
+
"type": "text",
|
|
27
|
+
"primaryKey": false,
|
|
28
|
+
"notNull": false
|
|
29
|
+
},
|
|
30
|
+
"avatar_url": {
|
|
31
|
+
"name": "avatar_url",
|
|
32
|
+
"type": "text",
|
|
33
|
+
"primaryKey": false,
|
|
34
|
+
"notNull": false
|
|
35
|
+
},
|
|
36
|
+
"password_hash": {
|
|
37
|
+
"name": "password_hash",
|
|
38
|
+
"type": "text",
|
|
39
|
+
"primaryKey": false,
|
|
40
|
+
"notNull": false
|
|
41
|
+
},
|
|
42
|
+
"created_at": {
|
|
43
|
+
"name": "created_at",
|
|
44
|
+
"type": "timestamp",
|
|
45
|
+
"primaryKey": false,
|
|
46
|
+
"notNull": true,
|
|
47
|
+
"default": "now()"
|
|
48
|
+
},
|
|
49
|
+
"updated_at": {
|
|
50
|
+
"name": "updated_at",
|
|
51
|
+
"type": "timestamp",
|
|
52
|
+
"primaryKey": false,
|
|
53
|
+
"notNull": true,
|
|
54
|
+
"default": "now()"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"indexes": {},
|
|
58
|
+
"foreignKeys": {},
|
|
59
|
+
"compositePrimaryKeys": {},
|
|
60
|
+
"uniqueConstraints": {
|
|
61
|
+
"users_email_unique": {
|
|
62
|
+
"name": "users_email_unique",
|
|
63
|
+
"nullsNotDistinct": false,
|
|
64
|
+
"columns": [
|
|
65
|
+
"email"
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"policies": {},
|
|
70
|
+
"checkConstraints": {},
|
|
71
|
+
"isRLSEnabled": false
|
|
72
|
+
},
|
|
73
|
+
"public.org_members": {
|
|
74
|
+
"name": "org_members",
|
|
75
|
+
"schema": "",
|
|
76
|
+
"columns": {
|
|
77
|
+
"id": {
|
|
78
|
+
"name": "id",
|
|
79
|
+
"type": "uuid",
|
|
80
|
+
"primaryKey": true,
|
|
81
|
+
"notNull": true,
|
|
82
|
+
"default": "gen_random_uuid()"
|
|
83
|
+
},
|
|
84
|
+
"org_id": {
|
|
85
|
+
"name": "org_id",
|
|
86
|
+
"type": "uuid",
|
|
87
|
+
"primaryKey": false,
|
|
88
|
+
"notNull": true
|
|
89
|
+
},
|
|
90
|
+
"user_id": {
|
|
91
|
+
"name": "user_id",
|
|
92
|
+
"type": "uuid",
|
|
93
|
+
"primaryKey": false,
|
|
94
|
+
"notNull": true
|
|
95
|
+
},
|
|
96
|
+
"role": {
|
|
97
|
+
"name": "role",
|
|
98
|
+
"type": "org_role",
|
|
99
|
+
"typeSchema": "public",
|
|
100
|
+
"primaryKey": false,
|
|
101
|
+
"notNull": true,
|
|
102
|
+
"default": "'developer'"
|
|
103
|
+
},
|
|
104
|
+
"created_at": {
|
|
105
|
+
"name": "created_at",
|
|
106
|
+
"type": "timestamp",
|
|
107
|
+
"primaryKey": false,
|
|
108
|
+
"notNull": true,
|
|
109
|
+
"default": "now()"
|
|
110
|
+
},
|
|
111
|
+
"removed_at": {
|
|
112
|
+
"name": "removed_at",
|
|
113
|
+
"type": "timestamp",
|
|
114
|
+
"primaryKey": false,
|
|
115
|
+
"notNull": false
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"indexes": {},
|
|
119
|
+
"foreignKeys": {
|
|
120
|
+
"org_members_org_id_organizations_id_fk": {
|
|
121
|
+
"name": "org_members_org_id_organizations_id_fk",
|
|
122
|
+
"tableFrom": "org_members",
|
|
123
|
+
"tableTo": "organizations",
|
|
124
|
+
"columnsFrom": [
|
|
125
|
+
"org_id"
|
|
126
|
+
],
|
|
127
|
+
"columnsTo": [
|
|
128
|
+
"id"
|
|
129
|
+
],
|
|
130
|
+
"onDelete": "cascade",
|
|
131
|
+
"onUpdate": "no action"
|
|
132
|
+
},
|
|
133
|
+
"org_members_user_id_users_id_fk": {
|
|
134
|
+
"name": "org_members_user_id_users_id_fk",
|
|
135
|
+
"tableFrom": "org_members",
|
|
136
|
+
"tableTo": "users",
|
|
137
|
+
"columnsFrom": [
|
|
138
|
+
"user_id"
|
|
139
|
+
],
|
|
140
|
+
"columnsTo": [
|
|
141
|
+
"id"
|
|
142
|
+
],
|
|
143
|
+
"onDelete": "cascade",
|
|
144
|
+
"onUpdate": "no action"
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"compositePrimaryKeys": {},
|
|
148
|
+
"uniqueConstraints": {},
|
|
149
|
+
"policies": {},
|
|
150
|
+
"checkConstraints": {},
|
|
151
|
+
"isRLSEnabled": false
|
|
152
|
+
},
|
|
153
|
+
"public.organizations": {
|
|
154
|
+
"name": "organizations",
|
|
155
|
+
"schema": "",
|
|
156
|
+
"columns": {
|
|
157
|
+
"id": {
|
|
158
|
+
"name": "id",
|
|
159
|
+
"type": "uuid",
|
|
160
|
+
"primaryKey": true,
|
|
161
|
+
"notNull": true,
|
|
162
|
+
"default": "gen_random_uuid()"
|
|
163
|
+
},
|
|
164
|
+
"name": {
|
|
165
|
+
"name": "name",
|
|
166
|
+
"type": "text",
|
|
167
|
+
"primaryKey": false,
|
|
168
|
+
"notNull": true
|
|
169
|
+
},
|
|
170
|
+
"slug": {
|
|
171
|
+
"name": "slug",
|
|
172
|
+
"type": "text",
|
|
173
|
+
"primaryKey": false,
|
|
174
|
+
"notNull": true
|
|
175
|
+
},
|
|
176
|
+
"created_at": {
|
|
177
|
+
"name": "created_at",
|
|
178
|
+
"type": "timestamp",
|
|
179
|
+
"primaryKey": false,
|
|
180
|
+
"notNull": true,
|
|
181
|
+
"default": "now()"
|
|
182
|
+
},
|
|
183
|
+
"updated_at": {
|
|
184
|
+
"name": "updated_at",
|
|
185
|
+
"type": "timestamp",
|
|
186
|
+
"primaryKey": false,
|
|
187
|
+
"notNull": true,
|
|
188
|
+
"default": "now()"
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"indexes": {},
|
|
192
|
+
"foreignKeys": {},
|
|
193
|
+
"compositePrimaryKeys": {},
|
|
194
|
+
"uniqueConstraints": {
|
|
195
|
+
"organizations_slug_unique": {
|
|
196
|
+
"name": "organizations_slug_unique",
|
|
197
|
+
"nullsNotDistinct": false,
|
|
198
|
+
"columns": [
|
|
199
|
+
"slug"
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"policies": {},
|
|
204
|
+
"checkConstraints": {},
|
|
205
|
+
"isRLSEnabled": false
|
|
206
|
+
},
|
|
207
|
+
"public.projects": {
|
|
208
|
+
"name": "projects",
|
|
209
|
+
"schema": "",
|
|
210
|
+
"columns": {
|
|
211
|
+
"id": {
|
|
212
|
+
"name": "id",
|
|
213
|
+
"type": "uuid",
|
|
214
|
+
"primaryKey": true,
|
|
215
|
+
"notNull": true,
|
|
216
|
+
"default": "gen_random_uuid()"
|
|
217
|
+
},
|
|
218
|
+
"org_id": {
|
|
219
|
+
"name": "org_id",
|
|
220
|
+
"type": "uuid",
|
|
221
|
+
"primaryKey": false,
|
|
222
|
+
"notNull": true
|
|
223
|
+
},
|
|
224
|
+
"name": {
|
|
225
|
+
"name": "name",
|
|
226
|
+
"type": "text",
|
|
227
|
+
"primaryKey": false,
|
|
228
|
+
"notNull": true
|
|
229
|
+
},
|
|
230
|
+
"slug": {
|
|
231
|
+
"name": "slug",
|
|
232
|
+
"type": "text",
|
|
233
|
+
"primaryKey": false,
|
|
234
|
+
"notNull": true
|
|
235
|
+
},
|
|
236
|
+
"db_schema": {
|
|
237
|
+
"name": "db_schema",
|
|
238
|
+
"type": "text",
|
|
239
|
+
"primaryKey": false,
|
|
240
|
+
"notNull": true
|
|
241
|
+
},
|
|
242
|
+
"project_url": {
|
|
243
|
+
"name": "project_url",
|
|
244
|
+
"type": "text",
|
|
245
|
+
"primaryKey": false,
|
|
246
|
+
"notNull": true
|
|
247
|
+
},
|
|
248
|
+
"anon_key": {
|
|
249
|
+
"name": "anon_key",
|
|
250
|
+
"type": "text",
|
|
251
|
+
"primaryKey": false,
|
|
252
|
+
"notNull": true
|
|
253
|
+
},
|
|
254
|
+
"service_role_key": {
|
|
255
|
+
"name": "service_role_key",
|
|
256
|
+
"type": "text",
|
|
257
|
+
"primaryKey": false,
|
|
258
|
+
"notNull": true
|
|
259
|
+
},
|
|
260
|
+
"google_client_id": {
|
|
261
|
+
"name": "google_client_id",
|
|
262
|
+
"type": "text",
|
|
263
|
+
"primaryKey": false,
|
|
264
|
+
"notNull": false
|
|
265
|
+
},
|
|
266
|
+
"google_client_secret": {
|
|
267
|
+
"name": "google_client_secret",
|
|
268
|
+
"type": "text",
|
|
269
|
+
"primaryKey": false,
|
|
270
|
+
"notNull": false
|
|
271
|
+
},
|
|
272
|
+
"github_client_id": {
|
|
273
|
+
"name": "github_client_id",
|
|
274
|
+
"type": "text",
|
|
275
|
+
"primaryKey": false,
|
|
276
|
+
"notNull": false
|
|
277
|
+
},
|
|
278
|
+
"github_client_secret": {
|
|
279
|
+
"name": "github_client_secret",
|
|
280
|
+
"type": "text",
|
|
281
|
+
"primaryKey": false,
|
|
282
|
+
"notNull": false
|
|
283
|
+
},
|
|
284
|
+
"auth_jwt_secret": {
|
|
285
|
+
"name": "auth_jwt_secret",
|
|
286
|
+
"type": "text",
|
|
287
|
+
"primaryKey": false,
|
|
288
|
+
"notNull": true
|
|
289
|
+
},
|
|
290
|
+
"site_url": {
|
|
291
|
+
"name": "site_url",
|
|
292
|
+
"type": "text",
|
|
293
|
+
"primaryKey": false,
|
|
294
|
+
"notNull": false
|
|
295
|
+
},
|
|
296
|
+
"created_at": {
|
|
297
|
+
"name": "created_at",
|
|
298
|
+
"type": "timestamp",
|
|
299
|
+
"primaryKey": false,
|
|
300
|
+
"notNull": true,
|
|
301
|
+
"default": "now()"
|
|
302
|
+
},
|
|
303
|
+
"updated_at": {
|
|
304
|
+
"name": "updated_at",
|
|
305
|
+
"type": "timestamp",
|
|
306
|
+
"primaryKey": false,
|
|
307
|
+
"notNull": true,
|
|
308
|
+
"default": "now()"
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
"indexes": {},
|
|
312
|
+
"foreignKeys": {
|
|
313
|
+
"projects_org_id_organizations_id_fk": {
|
|
314
|
+
"name": "projects_org_id_organizations_id_fk",
|
|
315
|
+
"tableFrom": "projects",
|
|
316
|
+
"tableTo": "organizations",
|
|
317
|
+
"columnsFrom": [
|
|
318
|
+
"org_id"
|
|
319
|
+
],
|
|
320
|
+
"columnsTo": [
|
|
321
|
+
"id"
|
|
322
|
+
],
|
|
323
|
+
"onDelete": "cascade",
|
|
324
|
+
"onUpdate": "no action"
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
"compositePrimaryKeys": {},
|
|
328
|
+
"uniqueConstraints": {
|
|
329
|
+
"projects_slug_unique": {
|
|
330
|
+
"name": "projects_slug_unique",
|
|
331
|
+
"nullsNotDistinct": false,
|
|
332
|
+
"columns": [
|
|
333
|
+
"slug"
|
|
334
|
+
]
|
|
335
|
+
},
|
|
336
|
+
"projects_db_schema_unique": {
|
|
337
|
+
"name": "projects_db_schema_unique",
|
|
338
|
+
"nullsNotDistinct": false,
|
|
339
|
+
"columns": [
|
|
340
|
+
"db_schema"
|
|
341
|
+
]
|
|
342
|
+
},
|
|
343
|
+
"projects_project_url_unique": {
|
|
344
|
+
"name": "projects_project_url_unique",
|
|
345
|
+
"nullsNotDistinct": false,
|
|
346
|
+
"columns": [
|
|
347
|
+
"project_url"
|
|
348
|
+
]
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
"policies": {},
|
|
352
|
+
"checkConstraints": {},
|
|
353
|
+
"isRLSEnabled": false
|
|
354
|
+
},
|
|
355
|
+
"public.query_history": {
|
|
356
|
+
"name": "query_history",
|
|
357
|
+
"schema": "",
|
|
358
|
+
"columns": {
|
|
359
|
+
"id": {
|
|
360
|
+
"name": "id",
|
|
361
|
+
"type": "uuid",
|
|
362
|
+
"primaryKey": true,
|
|
363
|
+
"notNull": true,
|
|
364
|
+
"default": "gen_random_uuid()"
|
|
365
|
+
},
|
|
366
|
+
"project_id": {
|
|
367
|
+
"name": "project_id",
|
|
368
|
+
"type": "uuid",
|
|
369
|
+
"primaryKey": false,
|
|
370
|
+
"notNull": true
|
|
371
|
+
},
|
|
372
|
+
"sql": {
|
|
373
|
+
"name": "sql",
|
|
374
|
+
"type": "text",
|
|
375
|
+
"primaryKey": false,
|
|
376
|
+
"notNull": true
|
|
377
|
+
},
|
|
378
|
+
"execution_time_ms": {
|
|
379
|
+
"name": "execution_time_ms",
|
|
380
|
+
"type": "integer",
|
|
381
|
+
"primaryKey": false,
|
|
382
|
+
"notNull": true
|
|
383
|
+
},
|
|
384
|
+
"row_count": {
|
|
385
|
+
"name": "row_count",
|
|
386
|
+
"type": "integer",
|
|
387
|
+
"primaryKey": false,
|
|
388
|
+
"notNull": true
|
|
389
|
+
},
|
|
390
|
+
"created_at": {
|
|
391
|
+
"name": "created_at",
|
|
392
|
+
"type": "timestamp",
|
|
393
|
+
"primaryKey": false,
|
|
394
|
+
"notNull": true,
|
|
395
|
+
"default": "now()"
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
"indexes": {},
|
|
399
|
+
"foreignKeys": {
|
|
400
|
+
"query_history_project_id_projects_id_fk": {
|
|
401
|
+
"name": "query_history_project_id_projects_id_fk",
|
|
402
|
+
"tableFrom": "query_history",
|
|
403
|
+
"tableTo": "projects",
|
|
404
|
+
"columnsFrom": [
|
|
405
|
+
"project_id"
|
|
406
|
+
],
|
|
407
|
+
"columnsTo": [
|
|
408
|
+
"id"
|
|
409
|
+
],
|
|
410
|
+
"onDelete": "cascade",
|
|
411
|
+
"onUpdate": "no action"
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
"compositePrimaryKeys": {},
|
|
415
|
+
"uniqueConstraints": {},
|
|
416
|
+
"policies": {},
|
|
417
|
+
"checkConstraints": {},
|
|
418
|
+
"isRLSEnabled": false
|
|
419
|
+
},
|
|
420
|
+
"public.storage_buckets": {
|
|
421
|
+
"name": "storage_buckets",
|
|
422
|
+
"schema": "",
|
|
423
|
+
"columns": {
|
|
424
|
+
"id": {
|
|
425
|
+
"name": "id",
|
|
426
|
+
"type": "uuid",
|
|
427
|
+
"primaryKey": true,
|
|
428
|
+
"notNull": true,
|
|
429
|
+
"default": "gen_random_uuid()"
|
|
430
|
+
},
|
|
431
|
+
"project_id": {
|
|
432
|
+
"name": "project_id",
|
|
433
|
+
"type": "uuid",
|
|
434
|
+
"primaryKey": false,
|
|
435
|
+
"notNull": true
|
|
436
|
+
},
|
|
437
|
+
"name": {
|
|
438
|
+
"name": "name",
|
|
439
|
+
"type": "text",
|
|
440
|
+
"primaryKey": false,
|
|
441
|
+
"notNull": true
|
|
442
|
+
},
|
|
443
|
+
"access": {
|
|
444
|
+
"name": "access",
|
|
445
|
+
"type": "bucket_access",
|
|
446
|
+
"typeSchema": "public",
|
|
447
|
+
"primaryKey": false,
|
|
448
|
+
"notNull": true,
|
|
449
|
+
"default": "'public'"
|
|
450
|
+
},
|
|
451
|
+
"created_at": {
|
|
452
|
+
"name": "created_at",
|
|
453
|
+
"type": "timestamp",
|
|
454
|
+
"primaryKey": false,
|
|
455
|
+
"notNull": true,
|
|
456
|
+
"default": "now()"
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
"indexes": {},
|
|
460
|
+
"foreignKeys": {
|
|
461
|
+
"storage_buckets_project_id_projects_id_fk": {
|
|
462
|
+
"name": "storage_buckets_project_id_projects_id_fk",
|
|
463
|
+
"tableFrom": "storage_buckets",
|
|
464
|
+
"tableTo": "projects",
|
|
465
|
+
"columnsFrom": [
|
|
466
|
+
"project_id"
|
|
467
|
+
],
|
|
468
|
+
"columnsTo": [
|
|
469
|
+
"id"
|
|
470
|
+
],
|
|
471
|
+
"onDelete": "cascade",
|
|
472
|
+
"onUpdate": "no action"
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
"compositePrimaryKeys": {},
|
|
476
|
+
"uniqueConstraints": {},
|
|
477
|
+
"policies": {},
|
|
478
|
+
"checkConstraints": {},
|
|
479
|
+
"isRLSEnabled": false
|
|
480
|
+
},
|
|
481
|
+
"public.storage_objects": {
|
|
482
|
+
"name": "storage_objects",
|
|
483
|
+
"schema": "",
|
|
484
|
+
"columns": {
|
|
485
|
+
"id": {
|
|
486
|
+
"name": "id",
|
|
487
|
+
"type": "uuid",
|
|
488
|
+
"primaryKey": true,
|
|
489
|
+
"notNull": true,
|
|
490
|
+
"default": "gen_random_uuid()"
|
|
491
|
+
},
|
|
492
|
+
"bucket_id": {
|
|
493
|
+
"name": "bucket_id",
|
|
494
|
+
"type": "uuid",
|
|
495
|
+
"primaryKey": false,
|
|
496
|
+
"notNull": true
|
|
497
|
+
},
|
|
498
|
+
"name": {
|
|
499
|
+
"name": "name",
|
|
500
|
+
"type": "text",
|
|
501
|
+
"primaryKey": false,
|
|
502
|
+
"notNull": true
|
|
503
|
+
},
|
|
504
|
+
"size": {
|
|
505
|
+
"name": "size",
|
|
506
|
+
"type": "integer",
|
|
507
|
+
"primaryKey": false,
|
|
508
|
+
"notNull": true
|
|
509
|
+
},
|
|
510
|
+
"mime_type": {
|
|
511
|
+
"name": "mime_type",
|
|
512
|
+
"type": "text",
|
|
513
|
+
"primaryKey": false,
|
|
514
|
+
"notNull": true
|
|
515
|
+
},
|
|
516
|
+
"ut_key": {
|
|
517
|
+
"name": "ut_key",
|
|
518
|
+
"type": "text",
|
|
519
|
+
"primaryKey": false,
|
|
520
|
+
"notNull": true
|
|
521
|
+
},
|
|
522
|
+
"url": {
|
|
523
|
+
"name": "url",
|
|
524
|
+
"type": "text",
|
|
525
|
+
"primaryKey": false,
|
|
526
|
+
"notNull": true,
|
|
527
|
+
"default": "''"
|
|
528
|
+
},
|
|
529
|
+
"created_at": {
|
|
530
|
+
"name": "created_at",
|
|
531
|
+
"type": "timestamp",
|
|
532
|
+
"primaryKey": false,
|
|
533
|
+
"notNull": true,
|
|
534
|
+
"default": "now()"
|
|
535
|
+
}
|
|
536
|
+
},
|
|
537
|
+
"indexes": {},
|
|
538
|
+
"foreignKeys": {
|
|
539
|
+
"storage_objects_bucket_id_storage_buckets_id_fk": {
|
|
540
|
+
"name": "storage_objects_bucket_id_storage_buckets_id_fk",
|
|
541
|
+
"tableFrom": "storage_objects",
|
|
542
|
+
"tableTo": "storage_buckets",
|
|
543
|
+
"columnsFrom": [
|
|
544
|
+
"bucket_id"
|
|
545
|
+
],
|
|
546
|
+
"columnsTo": [
|
|
547
|
+
"id"
|
|
548
|
+
],
|
|
549
|
+
"onDelete": "cascade",
|
|
550
|
+
"onUpdate": "no action"
|
|
551
|
+
}
|
|
552
|
+
},
|
|
553
|
+
"compositePrimaryKeys": {},
|
|
554
|
+
"uniqueConstraints": {},
|
|
555
|
+
"policies": {},
|
|
556
|
+
"checkConstraints": {},
|
|
557
|
+
"isRLSEnabled": false
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
"enums": {
|
|
561
|
+
"public.org_role": {
|
|
562
|
+
"name": "org_role",
|
|
563
|
+
"schema": "public",
|
|
564
|
+
"values": [
|
|
565
|
+
"admin",
|
|
566
|
+
"developer"
|
|
567
|
+
]
|
|
568
|
+
},
|
|
569
|
+
"public.bucket_access": {
|
|
570
|
+
"name": "bucket_access",
|
|
571
|
+
"schema": "public",
|
|
572
|
+
"values": [
|
|
573
|
+
"public",
|
|
574
|
+
"private"
|
|
575
|
+
]
|
|
576
|
+
}
|
|
577
|
+
},
|
|
578
|
+
"schemas": {},
|
|
579
|
+
"sequences": {},
|
|
580
|
+
"roles": {},
|
|
581
|
+
"policies": {},
|
|
582
|
+
"views": {},
|
|
583
|
+
"_meta": {
|
|
584
|
+
"columns": {},
|
|
585
|
+
"schemas": {},
|
|
586
|
+
"tables": {}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import 'dotenv/config';
|
|
2
|
+
import { defineConfig } from 'drizzle-kit';
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
schema: './src/db/schema/index.ts',
|
|
6
|
+
out: './drizzle',
|
|
7
|
+
dialect: 'postgresql',
|
|
8
|
+
dbCredentials: {
|
|
9
|
+
url: process.env.DATABASE_URL!,
|
|
10
|
+
ssl: false,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import eslint from '@eslint/js';
|
|
3
|
+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
4
|
+
import globals from 'globals';
|
|
5
|
+
import tseslint from 'typescript-eslint';
|
|
6
|
+
|
|
7
|
+
export default tseslint.config(
|
|
8
|
+
{
|
|
9
|
+
ignores: ['eslint.config.mjs'],
|
|
10
|
+
},
|
|
11
|
+
eslint.configs.recommended,
|
|
12
|
+
...tseslint.configs.recommendedTypeChecked,
|
|
13
|
+
eslintPluginPrettierRecommended,
|
|
14
|
+
{
|
|
15
|
+
languageOptions: {
|
|
16
|
+
globals: {
|
|
17
|
+
...globals.node,
|
|
18
|
+
...globals.jest,
|
|
19
|
+
},
|
|
20
|
+
sourceType: 'commonjs',
|
|
21
|
+
parserOptions: {
|
|
22
|
+
projectService: true,
|
|
23
|
+
tsconfigRootDir: import.meta.dirname,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
rules: {
|
|
29
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
30
|
+
'@typescript-eslint/no-floating-promises': 'warn',
|
|
31
|
+
'@typescript-eslint/no-unsafe-argument': 'warn',
|
|
32
|
+
"prettier/prettier": ["error", { endOfLine: "auto" }],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
);
|