@rebasepro/client-postgresql 0.5.0 → 0.6.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 (74) hide show
  1. package/dist/index.es.js +117 -163
  2. package/dist/index.es.js.map +1 -1
  3. package/dist/index.umd.js +121 -166
  4. package/dist/index.umd.js.map +1 -1
  5. package/package.json +12 -10
  6. package/test/usePostgresClientDriver.test.tsx +101 -0
  7. package/tsconfig.json +2 -0
  8. package/tsconfig.prod.json +4 -1
  9. package/vite.config.ts +0 -1
  10. package/dist/client/src/admin.d.ts +0 -61
  11. package/dist/client/src/auth.d.ts +0 -178
  12. package/dist/client/src/collection.d.ts +0 -21
  13. package/dist/client/src/cron.d.ts +0 -25
  14. package/dist/client/src/functions.d.ts +0 -49
  15. package/dist/client/src/index.d.ts +0 -48
  16. package/dist/client/src/query_builder.d.ts +0 -1
  17. package/dist/client/src/reviver.d.ts +0 -1
  18. package/dist/client/src/storage.d.ts +0 -3
  19. package/dist/client/src/transport.d.ts +0 -33
  20. package/dist/client/src/websocket.d.ts +0 -105
  21. package/dist/types/src/controllers/analytics_controller.d.ts +0 -7
  22. package/dist/types/src/controllers/auth.d.ts +0 -104
  23. package/dist/types/src/controllers/client.d.ts +0 -168
  24. package/dist/types/src/controllers/collection_registry.d.ts +0 -46
  25. package/dist/types/src/controllers/customization_controller.d.ts +0 -60
  26. package/dist/types/src/controllers/data.d.ts +0 -207
  27. package/dist/types/src/controllers/data_driver.d.ts +0 -218
  28. package/dist/types/src/controllers/database_admin.d.ts +0 -11
  29. package/dist/types/src/controllers/dialogs_controller.d.ts +0 -36
  30. package/dist/types/src/controllers/effective_role.d.ts +0 -4
  31. package/dist/types/src/controllers/email.d.ts +0 -36
  32. package/dist/types/src/controllers/index.d.ts +0 -18
  33. package/dist/types/src/controllers/local_config_persistence.d.ts +0 -20
  34. package/dist/types/src/controllers/navigation.d.ts +0 -225
  35. package/dist/types/src/controllers/registry.d.ts +0 -63
  36. package/dist/types/src/controllers/side_dialogs_controller.d.ts +0 -67
  37. package/dist/types/src/controllers/side_entity_controller.d.ts +0 -97
  38. package/dist/types/src/controllers/snackbar.d.ts +0 -24
  39. package/dist/types/src/controllers/storage.d.ts +0 -171
  40. package/dist/types/src/index.d.ts +0 -4
  41. package/dist/types/src/rebase_context.d.ts +0 -122
  42. package/dist/types/src/types/auth_adapter.d.ts +0 -301
  43. package/dist/types/src/types/backend.d.ts +0 -571
  44. package/dist/types/src/types/backend_hooks.d.ts +0 -172
  45. package/dist/types/src/types/builders.d.ts +0 -15
  46. package/dist/types/src/types/chips.d.ts +0 -5
  47. package/dist/types/src/types/collections.d.ts +0 -961
  48. package/dist/types/src/types/component_ref.d.ts +0 -47
  49. package/dist/types/src/types/cron.d.ts +0 -102
  50. package/dist/types/src/types/data_source.d.ts +0 -64
  51. package/dist/types/src/types/database_adapter.d.ts +0 -94
  52. package/dist/types/src/types/entities.d.ts +0 -145
  53. package/dist/types/src/types/entity_actions.d.ts +0 -104
  54. package/dist/types/src/types/entity_callbacks.d.ts +0 -173
  55. package/dist/types/src/types/entity_link_builder.d.ts +0 -7
  56. package/dist/types/src/types/entity_overrides.d.ts +0 -10
  57. package/dist/types/src/types/entity_views.d.ts +0 -87
  58. package/dist/types/src/types/export_import.d.ts +0 -21
  59. package/dist/types/src/types/formex.d.ts +0 -40
  60. package/dist/types/src/types/index.d.ts +0 -28
  61. package/dist/types/src/types/locales.d.ts +0 -4
  62. package/dist/types/src/types/modify_collections.d.ts +0 -5
  63. package/dist/types/src/types/plugins.d.ts +0 -282
  64. package/dist/types/src/types/properties.d.ts +0 -1173
  65. package/dist/types/src/types/property_config.d.ts +0 -74
  66. package/dist/types/src/types/relations.d.ts +0 -336
  67. package/dist/types/src/types/slots.d.ts +0 -262
  68. package/dist/types/src/types/translations.d.ts +0 -900
  69. package/dist/types/src/types/user_management_delegate.d.ts +0 -86
  70. package/dist/types/src/types/websockets.d.ts +0 -78
  71. package/dist/types/src/users/index.d.ts +0 -1
  72. package/dist/types/src/users/user.d.ts +0 -50
  73. /package/dist/{client-postgresql/src/index.d.ts → index.d.ts} +0 -0
  74. /package/dist/{client-postgresql/src/usePostgresClientDriver.d.ts → usePostgresClientDriver.d.ts} +0 -0
@@ -1,86 +0,0 @@
1
- import type { User } from "../users";
2
- /**
3
- * Result of creating a new user via admin flow.
4
- * Contains the created user plus information about how credentials were delivered.
5
- */
6
- export interface UserCreationResult<USER extends User = User> {
7
- /** The created user */
8
- user: USER;
9
- /** Whether an invitation email was sent to the user */
10
- invitationSent: boolean;
11
- /**
12
- * Temporary password (only present when email service is not configured).
13
- * This is returned one-time and should be shown to the admin to share manually.
14
- */
15
- temporaryPassword?: string;
16
- }
17
- /**
18
- * Delegate to manage auth-specific user operations.
19
- *
20
- * This interface allows the CMS to be agnostic of the underlying
21
- * authentication provider or backend. User/role CRUD is now handled
22
- * by the collection system; this delegate only exposes auth-specific
23
- * operations (password hashing, invitations, bootstrap).
24
- *
25
- * @group Models
26
- */
27
- export interface UserManagementDelegate<USER extends User = User> {
28
- /**
29
- * Are auth-related operations currently loading?
30
- */
31
- loading: boolean;
32
- /**
33
- * In-memory list of users (used for client-side filtering fallback).
34
- */
35
- users?: USER[];
36
- /**
37
- * Error from fetching the users list, if any.
38
- */
39
- usersError?: Error;
40
- /**
41
- * Look up a single user by UID from the in-memory cache.
42
- */
43
- getUser?: (uid: string) => USER | null;
44
- /**
45
- * Server-side user search with pagination.
46
- */
47
- searchUsers?: (params: {
48
- search?: string;
49
- limit?: number;
50
- offset?: number;
51
- }) => Promise<{
52
- users: USER[];
53
- total: number;
54
- }>;
55
- /**
56
- * Create a new user with invitation/password generation support.
57
- * Returns additional info about how the credentials were delivered.
58
- */
59
- createUser?: (user: USER) => Promise<UserCreationResult<USER>>;
60
- /**
61
- * Reset the password for an existing user.
62
- * Returns a temporary password if no email service is configured,
63
- * or a flag indicating an email invitation was sent.
64
- */
65
- resetPassword?: (user: USER) => Promise<UserCreationResult<USER>>;
66
- /**
67
- * Is the currently logged in user an admin?
68
- */
69
- isAdmin?: boolean;
70
- /**
71
- * Optionally define roles for a given user. This is useful when the roles
72
- * are coming from a separate provider than the one issuing the tokens.
73
- */
74
- defineRolesFor?: (user: USER) => Promise<string[] | undefined> | string[] | undefined;
75
- /**
76
- * Whether any admin users exist. Used by the bootstrap banner to decide
77
- * whether to prompt. Populated via a lightweight check (e.g. `limit=1`
78
- * query) instead of loading all users.
79
- */
80
- hasAdminUsers?: boolean;
81
- /**
82
- * Optional function to bootstrap an admin user.
83
- * Often used when the database is empty.
84
- */
85
- bootstrapAdmin?: () => Promise<void>;
86
- }
@@ -1,78 +0,0 @@
1
- import { Entity } from "./entities";
2
- export interface WebSocketErrorPayload {
3
- error?: string | {
4
- message: string;
5
- code?: string;
6
- };
7
- message?: string;
8
- code?: string;
9
- }
10
- export interface WebSocketMessage {
11
- type: string;
12
- payload?: unknown;
13
- subscriptionId?: string;
14
- requestId?: string;
15
- entities?: Entity<Record<string, unknown>>[];
16
- entity?: Entity<Record<string, unknown>> | null;
17
- error?: string;
18
- }
19
- export interface CollectionUpdateMessage extends WebSocketMessage {
20
- type: "collection_update";
21
- subscriptionId: string;
22
- entities: Entity<Record<string, unknown>>[];
23
- }
24
- export interface EntityUpdateMessage extends WebSocketMessage {
25
- type: "entity_update";
26
- subscriptionId: string;
27
- entity: Entity<Record<string, unknown>> | null;
28
- }
29
- /**
30
- * Lightweight patch message sent to collection subscribers when a single
31
- * entity is created, updated, or deleted. The client can merge this into
32
- * its cached collection data for near-instant cross-tab updates without
33
- * waiting for a full collection refetch.
34
- */
35
- export interface CollectionEntityPatchMessage extends WebSocketMessage {
36
- type: "collection_entity_patch";
37
- subscriptionId: string;
38
- entityId: string;
39
- /** The updated entity, or null if deleted */
40
- entity: Entity<Record<string, unknown>> | null;
41
- }
42
- /**
43
- * Column metadata returned by table introspection.
44
- */
45
- export interface TableColumnInfo {
46
- column_name: string;
47
- data_type: string;
48
- udt_name: string;
49
- is_nullable: string;
50
- column_default: string | null;
51
- character_maximum_length: number | null;
52
- /** Enum values, populated for USER-DEFINED (enum) columns */
53
- enum_values?: string[];
54
- }
55
- export interface TableForeignKeyInfo {
56
- column_name: string;
57
- foreign_table_name: string;
58
- foreign_column_name: string;
59
- }
60
- export interface TableJunctionInfo {
61
- junction_table_name: string;
62
- source_column_name: string;
63
- target_table_name: string;
64
- target_column_name: string;
65
- }
66
- export interface TablePolicyInfo {
67
- policy_name: string;
68
- roles: string[];
69
- cmd: string;
70
- qual?: string;
71
- with_check?: string;
72
- }
73
- export interface TableMetadata {
74
- columns: TableColumnInfo[];
75
- foreignKeys: TableForeignKeyInfo[];
76
- junctions: TableJunctionInfo[];
77
- policies: TablePolicyInfo[];
78
- }
@@ -1 +0,0 @@
1
- export * from "./user";
@@ -1,50 +0,0 @@
1
- /**
2
- * This interface represents a user.
3
- * It has some of the same fields as a Firebase User.
4
- * Note that in the default implementation, we simply take the Firebase user
5
- * and use it as a Rebase user, so that means that even if they are not mapped
6
- * in this interface, it contains all the methods of the former, such as `delete`,
7
- * `getIdToken`, etc.
8
- *
9
- * @group Models
10
- */
11
- export type User = {
12
- /**
13
- * The user's unique ID, scoped to the project.
14
- */
15
- readonly uid: string;
16
- /**
17
- * The display name of the user.
18
- */
19
- readonly displayName: string | null;
20
- /**
21
- * The email of the user.
22
- */
23
- readonly email: string | null;
24
- /**
25
- * The profile photo URL of the user.
26
- */
27
- readonly photoURL: string | null;
28
- /**
29
- * The provider used to authenticate the user.
30
- */
31
- readonly providerId: string;
32
- /**
33
- *
34
- */
35
- readonly isAnonymous: boolean;
36
- /**
37
- * Role IDs assigned to this user (e.g. ["admin", "editor"]).
38
- */
39
- roles?: string[];
40
- /**
41
- * The date and time when the user was created.
42
- */
43
- createdAt?: Date | string | null;
44
- /**
45
- * Additional metadata/custom claims associated with the user.
46
- * Accessible by the frontend, but only writable by the backend.
47
- */
48
- readonly metadata?: Record<string, any>;
49
- getIdToken?: (forceRefresh?: boolean) => Promise<string>;
50
- };