@plutocms/supabase 0.15.0 → 0.15.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/.prettierignore +6 -0
- package/CHANGELOG.md +14 -0
- package/app/components/access/DeleteRoleModal.vue +17 -4
- package/app/components/access/EditRolesSlideover.vue +11 -5
- package/app/components/access/InviteModal.vue +44 -19
- package/app/components/access/LinkField.vue +14 -3
- package/app/components/access/LinkModal.vue +5 -1
- package/app/components/access/RevokeModal.vue +17 -4
- package/app/components/access/RoleSlideover.vue +32 -11
- package/app/components/mail/AuthEmailsPanel.vue +87 -20
- package/app/components/migrations/MigrationsBanner.vue +5 -4
- package/app/composables/migrations.ts +13 -6
- package/app/pages/admin/(auth)/accept-invite.vue +21 -5
- package/app/pages/admin/(auth)/forgot-password.vue +11 -4
- package/app/pages/admin/(auth)/signup.vue +10 -9
- package/app/pages/admin/(auth)/update-password.vue +8 -3
- package/app/pages/admin/migrations.vue +8 -3
- package/app/pages/admin/settings/roles.vue +58 -15
- package/app/pages/admin/settings/users.vue +105 -30
- package/app/pages/admin/setup.vue +26 -7
- package/app/plugins/pluto-extension.ts +21 -8
- package/app/utils/access-ui.ts +29 -8
- package/app/utils/api-failure.ts +3 -1
- package/app/utils/auth-driver.ts +1 -3
- package/app/utils/auth-error.ts +1 -1
- package/app/utils/invite-link.ts +3 -3
- package/app/utils/supabase-project.ts +8 -3
- package/modules/pluto-migrations.ts +14 -3
- package/package.json +6 -4
- package/server/api/_pluto/supabase/access/users/[id]/resend.post.ts +15 -5
- package/server/api/_pluto/supabase/access/users/[id]/roles.put.ts +4 -1
- package/server/api/_pluto/supabase/access/users/invite-link.post.ts +12 -3
- package/server/api/_pluto/supabase/access/users/invite.post.ts +7 -2
- package/server/api/_pluto/supabase/auth/signup.post.ts +5 -1
- package/server/api/_pluto/supabase/me/capabilities.get.ts +4 -1
- package/server/api/_pluto/supabase/migrations/run.post.ts +9 -2
- package/server/api/_pluto/supabase/setup/index.post.ts +4 -1
- package/server/utils/access-errors.ts +2 -1
- package/server/utils/access-invite.ts +1 -1
- package/server/utils/access-mail.ts +72 -28
- package/server/utils/capability-guard.ts +5 -2
- package/server/utils/content-adapter.ts +75 -24
- package/server/utils/migrations.ts +0 -0
- package/server/utils/pending-migrations.ts +0 -0
- package/server/utils/service-client.ts +3 -1
- package/server/utils/sign-in-link.ts +25 -9
- package/server/utils/typegen.ts +6 -4
- package/server/utils/validate.ts +4 -1
- package/shared/types/supabase.ts +62 -65
- package/tailwind.lint.css +9 -0
package/shared/types/supabase.ts
CHANGED
|
@@ -10,23 +10,23 @@ export type Database = {
|
|
|
10
10
|
// Allows to automatically instantiate createClient with right options
|
|
11
11
|
// instead of createClient<Database, { PostgrestVersion: 'XX' }>(URL, KEY)
|
|
12
12
|
__InternalSupabase: {
|
|
13
|
-
PostgrestVersion:
|
|
13
|
+
PostgrestVersion: '14.5'
|
|
14
14
|
}
|
|
15
15
|
public: {
|
|
16
16
|
Tables: {
|
|
17
17
|
healthcheck: {
|
|
18
18
|
Row: {
|
|
19
|
-
config_name: Database[
|
|
19
|
+
config_name: Database['public']['Enums']['thealthcheck']
|
|
20
20
|
config_value: string
|
|
21
21
|
id: number
|
|
22
22
|
}
|
|
23
23
|
Insert: {
|
|
24
|
-
config_name: Database[
|
|
24
|
+
config_name: Database['public']['Enums']['thealthcheck']
|
|
25
25
|
config_value: string
|
|
26
26
|
id?: number
|
|
27
27
|
}
|
|
28
28
|
Update: {
|
|
29
|
-
config_name?: Database[
|
|
29
|
+
config_name?: Database['public']['Enums']['thealthcheck']
|
|
30
30
|
config_value?: string
|
|
31
31
|
id?: number
|
|
32
32
|
}
|
|
@@ -164,11 +164,11 @@ export type Database = {
|
|
|
164
164
|
}
|
|
165
165
|
Relationships: [
|
|
166
166
|
{
|
|
167
|
-
foreignKeyName:
|
|
168
|
-
columns: [
|
|
167
|
+
foreignKeyName: 'product_media_product_id_fkey'
|
|
168
|
+
columns: ['product_id']
|
|
169
169
|
isOneToOne: false
|
|
170
|
-
referencedRelation:
|
|
171
|
-
referencedColumns: [
|
|
170
|
+
referencedRelation: 'products'
|
|
171
|
+
referencedColumns: ['id']
|
|
172
172
|
},
|
|
173
173
|
]
|
|
174
174
|
}
|
|
@@ -211,18 +211,18 @@ export type Database = {
|
|
|
211
211
|
}
|
|
212
212
|
Relationships: [
|
|
213
213
|
{
|
|
214
|
-
foreignKeyName:
|
|
215
|
-
columns: [
|
|
214
|
+
foreignKeyName: 'products_availability_fkey'
|
|
215
|
+
columns: ['availability']
|
|
216
216
|
isOneToOne: false
|
|
217
|
-
referencedRelation:
|
|
218
|
-
referencedColumns: [
|
|
217
|
+
referencedRelation: 'product_availability'
|
|
218
|
+
referencedColumns: ['id']
|
|
219
219
|
},
|
|
220
220
|
{
|
|
221
|
-
foreignKeyName:
|
|
222
|
-
columns: [
|
|
221
|
+
foreignKeyName: 'products_category_fkey'
|
|
222
|
+
columns: ['category']
|
|
223
223
|
isOneToOne: false
|
|
224
|
-
referencedRelation:
|
|
225
|
-
referencedColumns: [
|
|
224
|
+
referencedRelation: 'product_category'
|
|
225
|
+
referencedColumns: ['id']
|
|
226
226
|
},
|
|
227
227
|
]
|
|
228
228
|
}
|
|
@@ -271,11 +271,11 @@ export type Database = {
|
|
|
271
271
|
}
|
|
272
272
|
Relationships: [
|
|
273
273
|
{
|
|
274
|
-
foreignKeyName:
|
|
275
|
-
columns: [
|
|
274
|
+
foreignKeyName: 'role_capabilities_role_key_fkey'
|
|
275
|
+
columns: ['role_key']
|
|
276
276
|
isOneToOne: false
|
|
277
|
-
referencedRelation:
|
|
278
|
-
referencedColumns: [
|
|
277
|
+
referencedRelation: 'roles'
|
|
278
|
+
referencedColumns: ['key']
|
|
279
279
|
},
|
|
280
280
|
]
|
|
281
281
|
}
|
|
@@ -307,19 +307,19 @@ export type Database = {
|
|
|
307
307
|
Row: {
|
|
308
308
|
id: number
|
|
309
309
|
setting_key: string | null
|
|
310
|
-
setting_name: Database[
|
|
310
|
+
setting_name: Database['public']['Enums']['tsettings'] | null
|
|
311
311
|
setting_value: string
|
|
312
312
|
}
|
|
313
313
|
Insert: {
|
|
314
314
|
id?: number
|
|
315
315
|
setting_key?: string | null
|
|
316
|
-
setting_name?: Database[
|
|
316
|
+
setting_name?: Database['public']['Enums']['tsettings'] | null
|
|
317
317
|
setting_value: string
|
|
318
318
|
}
|
|
319
319
|
Update: {
|
|
320
320
|
id?: number
|
|
321
321
|
setting_key?: string | null
|
|
322
|
-
setting_name?: Database[
|
|
322
|
+
setting_name?: Database['public']['Enums']['tsettings'] | null
|
|
323
323
|
setting_value?: string
|
|
324
324
|
}
|
|
325
325
|
Relationships: []
|
|
@@ -342,11 +342,11 @@ export type Database = {
|
|
|
342
342
|
}
|
|
343
343
|
Relationships: [
|
|
344
344
|
{
|
|
345
|
-
foreignKeyName:
|
|
346
|
-
columns: [
|
|
345
|
+
foreignKeyName: 'user_roles_role_key_fkey'
|
|
346
|
+
columns: ['role_key']
|
|
347
347
|
isOneToOne: false
|
|
348
|
-
referencedRelation:
|
|
349
|
-
referencedColumns: [
|
|
348
|
+
referencedRelation: 'roles'
|
|
349
|
+
referencedColumns: ['key']
|
|
350
350
|
},
|
|
351
351
|
]
|
|
352
352
|
}
|
|
@@ -414,8 +414,8 @@ export type Database = {
|
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
416
|
Enums: {
|
|
417
|
-
thealthcheck:
|
|
418
|
-
tsettings:
|
|
417
|
+
thealthcheck: 'first_setup'
|
|
418
|
+
tsettings: 'website_title' | 'website_url' | 'website_description'
|
|
419
419
|
}
|
|
420
420
|
CompositeTypes: {
|
|
421
421
|
[_ in never]: never
|
|
@@ -423,33 +423,33 @@ export type Database = {
|
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
425
|
|
|
426
|
-
type DatabaseWithoutInternals = Omit<Database,
|
|
426
|
+
type DatabaseWithoutInternals = Omit<Database, '__InternalSupabase'>
|
|
427
427
|
|
|
428
|
-
type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database,
|
|
428
|
+
type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, 'public'>]
|
|
429
429
|
|
|
430
430
|
export type Tables<
|
|
431
431
|
DefaultSchemaTableNameOrOptions extends
|
|
432
|
-
| keyof (DefaultSchema[
|
|
432
|
+
| keyof (DefaultSchema['Tables'] & DefaultSchema['Views'])
|
|
433
433
|
| { schema: keyof DatabaseWithoutInternals },
|
|
434
434
|
TableName extends (DefaultSchemaTableNameOrOptions extends {
|
|
435
435
|
schema: keyof DatabaseWithoutInternals
|
|
436
436
|
}
|
|
437
|
-
? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions[
|
|
438
|
-
DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions[
|
|
437
|
+
? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables'] &
|
|
438
|
+
DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Views'])
|
|
439
439
|
: never) = never,
|
|
440
440
|
> = DefaultSchemaTableNameOrOptions extends {
|
|
441
441
|
schema: keyof DatabaseWithoutInternals
|
|
442
442
|
}
|
|
443
|
-
? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions[
|
|
444
|
-
DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions[
|
|
443
|
+
? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables'] &
|
|
444
|
+
DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Views'])[TableName] extends {
|
|
445
445
|
Row: infer R
|
|
446
446
|
}
|
|
447
447
|
? R
|
|
448
448
|
: never
|
|
449
|
-
: DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema[
|
|
450
|
-
DefaultSchema[
|
|
451
|
-
? (DefaultSchema[
|
|
452
|
-
DefaultSchema[
|
|
449
|
+
: DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema['Tables'] &
|
|
450
|
+
DefaultSchema['Views'])
|
|
451
|
+
? (DefaultSchema['Tables'] &
|
|
452
|
+
DefaultSchema['Views'])[DefaultSchemaTableNameOrOptions] extends {
|
|
453
453
|
Row: infer R
|
|
454
454
|
}
|
|
455
455
|
? R
|
|
@@ -458,23 +458,22 @@ export type Tables<
|
|
|
458
458
|
|
|
459
459
|
export type TablesInsert<
|
|
460
460
|
DefaultSchemaTableNameOrOptions extends
|
|
461
|
-
|
|
462
|
-
| { schema: keyof DatabaseWithoutInternals },
|
|
461
|
+
keyof DefaultSchema['Tables'] | { schema: keyof DatabaseWithoutInternals },
|
|
463
462
|
TableName extends (DefaultSchemaTableNameOrOptions extends {
|
|
464
463
|
schema: keyof DatabaseWithoutInternals
|
|
465
464
|
}
|
|
466
|
-
? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions[
|
|
465
|
+
? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables']
|
|
467
466
|
: never) = never,
|
|
468
467
|
> = DefaultSchemaTableNameOrOptions extends {
|
|
469
468
|
schema: keyof DatabaseWithoutInternals
|
|
470
469
|
}
|
|
471
|
-
? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions[
|
|
470
|
+
? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables'][TableName] extends {
|
|
472
471
|
Insert: infer I
|
|
473
472
|
}
|
|
474
473
|
? I
|
|
475
474
|
: never
|
|
476
|
-
: DefaultSchemaTableNameOrOptions extends keyof DefaultSchema[
|
|
477
|
-
? DefaultSchema[
|
|
475
|
+
: DefaultSchemaTableNameOrOptions extends keyof DefaultSchema['Tables']
|
|
476
|
+
? DefaultSchema['Tables'][DefaultSchemaTableNameOrOptions] extends {
|
|
478
477
|
Insert: infer I
|
|
479
478
|
}
|
|
480
479
|
? I
|
|
@@ -483,23 +482,22 @@ export type TablesInsert<
|
|
|
483
482
|
|
|
484
483
|
export type TablesUpdate<
|
|
485
484
|
DefaultSchemaTableNameOrOptions extends
|
|
486
|
-
|
|
487
|
-
| { schema: keyof DatabaseWithoutInternals },
|
|
485
|
+
keyof DefaultSchema['Tables'] | { schema: keyof DatabaseWithoutInternals },
|
|
488
486
|
TableName extends (DefaultSchemaTableNameOrOptions extends {
|
|
489
487
|
schema: keyof DatabaseWithoutInternals
|
|
490
488
|
}
|
|
491
|
-
? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions[
|
|
489
|
+
? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables']
|
|
492
490
|
: never) = never,
|
|
493
491
|
> = DefaultSchemaTableNameOrOptions extends {
|
|
494
492
|
schema: keyof DatabaseWithoutInternals
|
|
495
493
|
}
|
|
496
|
-
? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions[
|
|
494
|
+
? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables'][TableName] extends {
|
|
497
495
|
Update: infer U
|
|
498
496
|
}
|
|
499
497
|
? U
|
|
500
498
|
: never
|
|
501
|
-
: DefaultSchemaTableNameOrOptions extends keyof DefaultSchema[
|
|
502
|
-
? DefaultSchema[
|
|
499
|
+
: DefaultSchemaTableNameOrOptions extends keyof DefaultSchema['Tables']
|
|
500
|
+
? DefaultSchema['Tables'][DefaultSchemaTableNameOrOptions] extends {
|
|
503
501
|
Update: infer U
|
|
504
502
|
}
|
|
505
503
|
? U
|
|
@@ -508,43 +506,42 @@ export type TablesUpdate<
|
|
|
508
506
|
|
|
509
507
|
export type Enums<
|
|
510
508
|
DefaultSchemaEnumNameOrOptions extends
|
|
511
|
-
|
|
512
|
-
| { schema: keyof DatabaseWithoutInternals },
|
|
509
|
+
keyof DefaultSchema['Enums'] | { schema: keyof DatabaseWithoutInternals },
|
|
513
510
|
EnumName extends (DefaultSchemaEnumNameOrOptions extends {
|
|
514
511
|
schema: keyof DatabaseWithoutInternals
|
|
515
512
|
}
|
|
516
|
-
? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions[
|
|
513
|
+
? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions['schema']]['Enums']
|
|
517
514
|
: never) = never,
|
|
518
515
|
> = DefaultSchemaEnumNameOrOptions extends {
|
|
519
516
|
schema: keyof DatabaseWithoutInternals
|
|
520
517
|
}
|
|
521
|
-
? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions[
|
|
522
|
-
: DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema[
|
|
523
|
-
? DefaultSchema[
|
|
518
|
+
? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions['schema']]['Enums'][EnumName]
|
|
519
|
+
: DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema['Enums']
|
|
520
|
+
? DefaultSchema['Enums'][DefaultSchemaEnumNameOrOptions]
|
|
524
521
|
: never
|
|
525
522
|
|
|
526
523
|
export type CompositeTypes<
|
|
527
524
|
PublicCompositeTypeNameOrOptions extends
|
|
528
|
-
| keyof DefaultSchema[
|
|
525
|
+
| keyof DefaultSchema['CompositeTypes']
|
|
529
526
|
| { schema: keyof DatabaseWithoutInternals },
|
|
530
527
|
CompositeTypeName extends (PublicCompositeTypeNameOrOptions extends {
|
|
531
528
|
schema: keyof DatabaseWithoutInternals
|
|
532
529
|
}
|
|
533
|
-
? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions[
|
|
530
|
+
? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions['schema']]['CompositeTypes']
|
|
534
531
|
: never) = never,
|
|
535
532
|
> = PublicCompositeTypeNameOrOptions extends {
|
|
536
533
|
schema: keyof DatabaseWithoutInternals
|
|
537
534
|
}
|
|
538
|
-
? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions[
|
|
539
|
-
: PublicCompositeTypeNameOrOptions extends keyof DefaultSchema[
|
|
540
|
-
? DefaultSchema[
|
|
535
|
+
? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions['schema']]['CompositeTypes'][CompositeTypeName]
|
|
536
|
+
: PublicCompositeTypeNameOrOptions extends keyof DefaultSchema['CompositeTypes']
|
|
537
|
+
? DefaultSchema['CompositeTypes'][PublicCompositeTypeNameOrOptions]
|
|
541
538
|
: never
|
|
542
539
|
|
|
543
540
|
export const Constants = {
|
|
544
541
|
public: {
|
|
545
542
|
Enums: {
|
|
546
|
-
thealthcheck: [
|
|
547
|
-
tsettings: [
|
|
543
|
+
thealthcheck: ['first_setup'],
|
|
544
|
+
tsettings: ['website_title', 'website_url', 'website_description'],
|
|
548
545
|
},
|
|
549
546
|
},
|
|
550
547
|
} as const
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The Tailwind design system for ESLint (better-tailwindcss) and the editor
|
|
3
|
+
* (Tailwind IntelliSense). It is not part of the build: a Pluto layer has no
|
|
4
|
+
* Tailwind entry, the app owns it (see the single-tailwind-build skill in pluto). This file gives the
|
|
5
|
+
* lint the theme of an app: Tailwind, Nuxt UI and the Pluto layer CSS.
|
|
6
|
+
*/
|
|
7
|
+
@import 'tailwindcss';
|
|
8
|
+
@import '@nuxt/ui';
|
|
9
|
+
@import '@plutocms/pluto/app/assets/css/pluto-layer.css';
|