@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.
Files changed (50) hide show
  1. package/.prettierignore +6 -0
  2. package/CHANGELOG.md +14 -0
  3. package/app/components/access/DeleteRoleModal.vue +17 -4
  4. package/app/components/access/EditRolesSlideover.vue +11 -5
  5. package/app/components/access/InviteModal.vue +44 -19
  6. package/app/components/access/LinkField.vue +14 -3
  7. package/app/components/access/LinkModal.vue +5 -1
  8. package/app/components/access/RevokeModal.vue +17 -4
  9. package/app/components/access/RoleSlideover.vue +32 -11
  10. package/app/components/mail/AuthEmailsPanel.vue +87 -20
  11. package/app/components/migrations/MigrationsBanner.vue +5 -4
  12. package/app/composables/migrations.ts +13 -6
  13. package/app/pages/admin/(auth)/accept-invite.vue +21 -5
  14. package/app/pages/admin/(auth)/forgot-password.vue +11 -4
  15. package/app/pages/admin/(auth)/signup.vue +10 -9
  16. package/app/pages/admin/(auth)/update-password.vue +8 -3
  17. package/app/pages/admin/migrations.vue +8 -3
  18. package/app/pages/admin/settings/roles.vue +58 -15
  19. package/app/pages/admin/settings/users.vue +105 -30
  20. package/app/pages/admin/setup.vue +26 -7
  21. package/app/plugins/pluto-extension.ts +21 -8
  22. package/app/utils/access-ui.ts +29 -8
  23. package/app/utils/api-failure.ts +3 -1
  24. package/app/utils/auth-driver.ts +1 -3
  25. package/app/utils/auth-error.ts +1 -1
  26. package/app/utils/invite-link.ts +3 -3
  27. package/app/utils/supabase-project.ts +8 -3
  28. package/modules/pluto-migrations.ts +14 -3
  29. package/package.json +6 -4
  30. package/server/api/_pluto/supabase/access/users/[id]/resend.post.ts +15 -5
  31. package/server/api/_pluto/supabase/access/users/[id]/roles.put.ts +4 -1
  32. package/server/api/_pluto/supabase/access/users/invite-link.post.ts +12 -3
  33. package/server/api/_pluto/supabase/access/users/invite.post.ts +7 -2
  34. package/server/api/_pluto/supabase/auth/signup.post.ts +5 -1
  35. package/server/api/_pluto/supabase/me/capabilities.get.ts +4 -1
  36. package/server/api/_pluto/supabase/migrations/run.post.ts +9 -2
  37. package/server/api/_pluto/supabase/setup/index.post.ts +4 -1
  38. package/server/utils/access-errors.ts +2 -1
  39. package/server/utils/access-invite.ts +1 -1
  40. package/server/utils/access-mail.ts +72 -28
  41. package/server/utils/capability-guard.ts +5 -2
  42. package/server/utils/content-adapter.ts +75 -24
  43. package/server/utils/migrations.ts +0 -0
  44. package/server/utils/pending-migrations.ts +0 -0
  45. package/server/utils/service-client.ts +3 -1
  46. package/server/utils/sign-in-link.ts +25 -9
  47. package/server/utils/typegen.ts +6 -4
  48. package/server/utils/validate.ts +4 -1
  49. package/shared/types/supabase.ts +62 -65
  50. package/tailwind.lint.css +9 -0
@@ -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: "14.5"
13
+ PostgrestVersion: '14.5'
14
14
  }
15
15
  public: {
16
16
  Tables: {
17
17
  healthcheck: {
18
18
  Row: {
19
- config_name: Database["public"]["Enums"]["thealthcheck"]
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["public"]["Enums"]["thealthcheck"]
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["public"]["Enums"]["thealthcheck"]
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: "product_media_product_id_fkey"
168
- columns: ["product_id"]
167
+ foreignKeyName: 'product_media_product_id_fkey'
168
+ columns: ['product_id']
169
169
  isOneToOne: false
170
- referencedRelation: "products"
171
- referencedColumns: ["id"]
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: "products_availability_fkey"
215
- columns: ["availability"]
214
+ foreignKeyName: 'products_availability_fkey'
215
+ columns: ['availability']
216
216
  isOneToOne: false
217
- referencedRelation: "product_availability"
218
- referencedColumns: ["id"]
217
+ referencedRelation: 'product_availability'
218
+ referencedColumns: ['id']
219
219
  },
220
220
  {
221
- foreignKeyName: "products_category_fkey"
222
- columns: ["category"]
221
+ foreignKeyName: 'products_category_fkey'
222
+ columns: ['category']
223
223
  isOneToOne: false
224
- referencedRelation: "product_category"
225
- referencedColumns: ["id"]
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: "role_capabilities_role_key_fkey"
275
- columns: ["role_key"]
274
+ foreignKeyName: 'role_capabilities_role_key_fkey'
275
+ columns: ['role_key']
276
276
  isOneToOne: false
277
- referencedRelation: "roles"
278
- referencedColumns: ["key"]
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["public"]["Enums"]["tsettings"] | null
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["public"]["Enums"]["tsettings"] | null
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["public"]["Enums"]["tsettings"] | null
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: "user_roles_role_key_fkey"
346
- columns: ["role_key"]
345
+ foreignKeyName: 'user_roles_role_key_fkey'
346
+ columns: ['role_key']
347
347
  isOneToOne: false
348
- referencedRelation: "roles"
349
- referencedColumns: ["key"]
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: "first_setup"
418
- tsettings: "website_title" | "website_url" | "website_description"
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, "__InternalSupabase">
426
+ type DatabaseWithoutInternals = Omit<Database, '__InternalSupabase'>
427
427
 
428
- type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">]
428
+ type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, 'public'>]
429
429
 
430
430
  export type Tables<
431
431
  DefaultSchemaTableNameOrOptions extends
432
- | keyof (DefaultSchema["Tables"] & DefaultSchema["Views"])
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["schema"]]["Tables"] &
438
- DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])
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["schema"]]["Tables"] &
444
- DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
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["Tables"] &
450
- DefaultSchema["Views"])
451
- ? (DefaultSchema["Tables"] &
452
- DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends {
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
- | keyof DefaultSchema["Tables"]
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["schema"]]["Tables"]
465
+ ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables']
467
466
  : never) = never,
468
467
  > = DefaultSchemaTableNameOrOptions extends {
469
468
  schema: keyof DatabaseWithoutInternals
470
469
  }
471
- ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
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["Tables"]
477
- ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
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
- | keyof DefaultSchema["Tables"]
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["schema"]]["Tables"]
489
+ ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables']
492
490
  : never) = never,
493
491
  > = DefaultSchemaTableNameOrOptions extends {
494
492
  schema: keyof DatabaseWithoutInternals
495
493
  }
496
- ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
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["Tables"]
502
- ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
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
- | keyof DefaultSchema["Enums"]
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["schema"]]["Enums"]
513
+ ? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions['schema']]['Enums']
517
514
  : never) = never,
518
515
  > = DefaultSchemaEnumNameOrOptions extends {
519
516
  schema: keyof DatabaseWithoutInternals
520
517
  }
521
- ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName]
522
- : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"]
523
- ? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions]
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["CompositeTypes"]
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["schema"]]["CompositeTypes"]
530
+ ? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions['schema']]['CompositeTypes']
534
531
  : never) = never,
535
532
  > = PublicCompositeTypeNameOrOptions extends {
536
533
  schema: keyof DatabaseWithoutInternals
537
534
  }
538
- ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName]
539
- : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"]
540
- ? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions]
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: ["first_setup"],
547
- tsettings: ["website_title", "website_url", "website_description"],
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';