@rebasepro/client-postgresql 0.0.1-canary.4d4fb3e → 0.0.1-canary.4f204c2

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 (52) hide show
  1. package/dist/client/src/admin.d.ts +94 -0
  2. package/dist/client/src/auth.d.ts +161 -0
  3. package/dist/client/src/collection.d.ts +19 -0
  4. package/dist/client/src/cron.d.ts +25 -0
  5. package/dist/client/src/index.d.ts +42 -0
  6. package/dist/client/src/query_builder.d.ts +53 -0
  7. package/dist/client/src/reviver.d.ts +1 -0
  8. package/dist/client/src/storage.d.ts +3 -0
  9. package/dist/client/src/transport.d.ts +33 -0
  10. package/dist/client/src/websocket.d.ts +99 -0
  11. package/dist/index.es.js +28 -17
  12. package/dist/index.es.js.map +1 -1
  13. package/dist/index.umd.js +28 -17
  14. package/dist/index.umd.js.map +1 -1
  15. package/dist/types/src/controllers/auth.d.ts +2 -0
  16. package/dist/types/src/controllers/client.d.ts +119 -7
  17. package/dist/types/src/controllers/collection_registry.d.ts +4 -3
  18. package/dist/types/src/controllers/customization_controller.d.ts +7 -1
  19. package/dist/types/src/controllers/data.d.ts +34 -7
  20. package/dist/types/src/controllers/data_driver.d.ts +20 -28
  21. package/dist/types/src/controllers/database_admin.d.ts +2 -2
  22. package/dist/types/src/controllers/email.d.ts +34 -0
  23. package/dist/types/src/controllers/index.d.ts +1 -0
  24. package/dist/types/src/controllers/local_config_persistence.d.ts +4 -4
  25. package/dist/types/src/controllers/navigation.d.ts +5 -5
  26. package/dist/types/src/controllers/registry.d.ts +6 -3
  27. package/dist/types/src/controllers/side_entity_controller.d.ts +7 -6
  28. package/dist/types/src/controllers/storage.d.ts +24 -26
  29. package/dist/types/src/rebase_context.d.ts +8 -4
  30. package/dist/types/src/types/backend.d.ts +4 -1
  31. package/dist/types/src/types/builders.d.ts +5 -4
  32. package/dist/types/src/types/chips.d.ts +1 -1
  33. package/dist/types/src/types/collections.d.ts +169 -125
  34. package/dist/types/src/types/cron.d.ts +102 -0
  35. package/dist/types/src/types/data_source.d.ts +1 -1
  36. package/dist/types/src/types/entity_actions.d.ts +8 -8
  37. package/dist/types/src/types/entity_callbacks.d.ts +15 -15
  38. package/dist/types/src/types/entity_link_builder.d.ts +1 -1
  39. package/dist/types/src/types/entity_overrides.d.ts +2 -1
  40. package/dist/types/src/types/entity_views.d.ts +8 -8
  41. package/dist/types/src/types/export_import.d.ts +3 -3
  42. package/dist/types/src/types/index.d.ts +1 -0
  43. package/dist/types/src/types/plugins.d.ts +72 -18
  44. package/dist/types/src/types/properties.d.ts +118 -33
  45. package/dist/types/src/types/relations.d.ts +1 -1
  46. package/dist/types/src/types/slots.d.ts +30 -6
  47. package/dist/types/src/types/translations.d.ts +44 -0
  48. package/dist/types/src/types/user_management_delegate.d.ts +1 -0
  49. package/package.json +83 -86
  50. package/src/usePostgresClientDriver.ts +57 -29
  51. package/tsconfig.json +1 -0
  52. package/vite.config.ts +4 -4
package/dist/index.umd.js CHANGED
@@ -124,23 +124,34 @@
124
124
  isFilterCombinationValid() {
125
125
  return true;
126
126
  },
127
- async executeSql(sql, options) {
128
- return client.executeSql(sql, options);
129
- },
130
- async fetchAvailableDatabases() {
131
- return client.fetchAvailableDatabases();
132
- },
133
- async fetchAvailableRoles() {
134
- return client.fetchAvailableRoles();
135
- },
136
- async fetchCurrentDatabase() {
137
- return client.fetchCurrentDatabase();
138
- },
139
- async fetchUnmappedTables(mappedPaths) {
140
- return client.fetchUnmappedTables(mappedPaths);
141
- },
142
- async fetchTableMetadata(tableName) {
143
- return client.fetchTableMetadata(tableName);
127
+ admin: {
128
+ executeSql(sql, options) {
129
+ return client.executeSql(sql, options);
130
+ },
131
+ fetchAvailableDatabases() {
132
+ return client.fetchAvailableDatabases();
133
+ },
134
+ fetchAvailableRoles() {
135
+ return client.fetchAvailableRoles();
136
+ },
137
+ fetchCurrentDatabase() {
138
+ return client.fetchCurrentDatabase();
139
+ },
140
+ fetchUnmappedTables(mappedPaths) {
141
+ return client.fetchUnmappedTables(mappedPaths);
142
+ },
143
+ fetchTableMetadata(tableName) {
144
+ return client.fetchTableMetadata(tableName);
145
+ },
146
+ createBranch(name_0, options_0) {
147
+ return client.createBranch(name_0, options_0);
148
+ },
149
+ deleteBranch(name_1) {
150
+ return client.deleteBranch(name_1);
151
+ },
152
+ listBranches() {
153
+ return client.listBranches();
154
+ }
144
155
  }
145
156
  };
146
157
  $[0] = client;
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","sources":["../src/usePostgresClientDriver.ts"],"sourcesContent":["import { useMemo, useEffect } from \"react\";\nimport {\n DataDriver,\n DeleteEntityProps,\n Entity,\n EntityCollection,\n EntityReference, EntityRelation,\n FetchCollectionProps,\n FetchEntityProps,\n ListenCollectionProps,\n ListenEntityProps,\n SaveEntityProps,\n TableMetadata\n} from \"@rebasepro/types\";\nimport { RebaseWebSocketClient } from \"@rebasepro/client\";\n\nexport interface PostgresDataDriverConfig {\n wsClient?: RebaseWebSocketClient;\n}\n\nexport interface PostgresDataDriver extends DataDriver {\n client?: RebaseWebSocketClient;\n}\n\n\nexport function usePostgresClientDriver(config: PostgresDataDriverConfig): PostgresDataDriver {\n const client = config.wsClient;\n\n return useMemo(() => {\n if (!client) throw new Error(\"RebaseWebSocketClient must be provided in config.wsClient\");\n \n return {\n\n key: \"postgres\",\n\n name: \"PostgreSQL\",\n\n client,\n\n async fetchCollection<M extends Record<string, any>>(props: FetchCollectionProps<M>): Promise<Entity<M>[]> {\n // Pick only the fields the client needs, ignoring extra fields from the CMS layer\n const { path, filter, limit, startAfter, orderBy, searchString, order } = props;\n return client.fetchCollection({ path, filter, limit, startAfter, orderBy, searchString, order }) as Promise<Entity<M>[]>;\n },\n\n async fetchEntity<M extends Record<string, any>>(props: FetchEntityProps<M>): Promise<Entity<M> | undefined> {\n const { path, entityId, databaseId } = props;\n return client.fetchEntity({ path, entityId, databaseId }) as Promise<Entity<M> | undefined>;\n },\n\n async saveEntity<M extends Record<string, any>>(props: SaveEntityProps<M>): Promise<Entity<M>> {\n return client.saveEntity({\n path: props.path,\n values: props.values,\n entityId: props.entityId,\n previousValues: props.previousValues,\n status: props.status\n }) as Promise<Entity<M>>;\n },\n\n async deleteEntity<M extends Record<string, any>>(props: DeleteEntityProps<M>): Promise<void> {\n const { entity } = props;\n return client.deleteEntity({ entity });\n },\n\n async checkUniqueField(path: string, name: string, value: any, entityId?: string, collection?: EntityCollection): Promise<boolean> {\n return client.checkUniqueField(path, name, value, entityId, collection);\n },\n\n async countEntities<M extends Record<string, any>>(props: FetchCollectionProps<M>): Promise<number> {\n const { path, filter, limit, startAfter, orderBy, searchString, order } = props;\n return client.countEntities({ path, filter, limit, startAfter, orderBy, searchString, order });\n },\n\n listenCollection<M extends Record<string, any>>(props: ListenCollectionProps<M>): () => void {\n const { path, filter, limit, startAfter, orderBy, searchString, order, onUpdate, onError } = props;\n return client.listenCollection(\n { path, filter, limit, startAfter, orderBy, searchString, order },\n (entities: Entity[]) => props.onUpdate(entities as Entity<M>[]),\n props.onError\n );\n },\n\n listenEntity<M extends Record<string, any>>(props: ListenEntityProps<M>): () => void {\n const { path, entityId, databaseId, onUpdate, onError } = props;\n return client.listenEntity(\n { path, entityId, databaseId },\n (entity: Entity | null) => {\n props.onUpdate(entity as Entity<M> | null);\n },\n props.onError\n );\n },\n\n isFilterCombinationValid(): boolean {\n return true; // PostgreSQL supports complex filter combinations\n },\n\n async executeSql(sql: string, options?: { database?: string, role?: string }): Promise<any[]> {\n return client.executeSql(sql, options);\n },\n\n async fetchAvailableDatabases(): Promise<string[]> {\n return client.fetchAvailableDatabases();\n },\n\n async fetchAvailableRoles(): Promise<string[]> {\n return client.fetchAvailableRoles();\n },\n\n async fetchCurrentDatabase(): Promise<string | undefined> {\n return client.fetchCurrentDatabase();\n },\n\n async fetchUnmappedTables(mappedPaths?: string[]): Promise<string[]> {\n return client.fetchUnmappedTables(mappedPaths);\n },\n\n async fetchTableMetadata(tableName: string): Promise<TableMetadata> {\n return client.fetchTableMetadata(tableName);\n }\n } as PostgresDataDriver;\n }, [client]);\n\n}\n"],"names":["usePostgresClientDriver","config","$","_c","client","wsClient","t0","Error","t1","key","name","fetchCollection","props","path","filter","limit","startAfter","orderBy","searchString","order","fetchEntity","props_0","path_0","entityId","databaseId","saveEntity","props_1","values","previousValues","status","deleteEntity","props_2","entity","checkUniqueField","path_1","value","entityId_0","collection","countEntities","props_3","path_2","filter_0","limit_0","startAfter_0","orderBy_0","searchString_0","order_0","listenCollection","props_4","path_3","filter_1","limit_1","startAfter_1","orderBy_1","searchString_1","order_1","entities","onUpdate","onError","listenEntity","props_5","path_4","entityId_1","databaseId_0","entity_0","isFilterCombinationValid","executeSql","sql","options","fetchAvailableDatabases","fetchAvailableRoles","fetchCurrentDatabase","fetchUnmappedTables","mappedPaths","fetchTableMetadata","tableName"],"mappings":";;;;AAyBO,WAAAA,wBAAAC,QAAA;AAAA,UAAAC,IAAAC,qBAAAA,EAAA,CAAA;AACH,UAAAC,SAAeH,OAAMI;AAAU,QAAAC;AAAA,QAAA,CAGtBF,QAAM;AAAA,YAAA,IAAAG,MAAkB,2DAA2D;AAAA,IAAA;AAAA,QAAAC;AAAA,QAAAN,SAAAE,QAAA;AAEjFI,WAAA;AAAA,QAAAC,KAEF;AAAA,QAAUC,MAET;AAAA,QAAYN;AAAAA,QAAA,MAAAO,gBAAAC,OAAA;AAMd,gBAAA;AAAA,YAAAC;AAAAA,YAAAC;AAAAA,YAAAC;AAAAA,YAAAC;AAAAA,YAAAC;AAAAA,YAAAC;AAAAA,YAAAC;AAAAA,UAAAA,IAA0EP;AAAM,iBACzER,OAAMO,gBAAA;AAAA,YAAAE;AAAAA,YAAAC;AAAAA,YAAAC;AAAAA,YAAAC;AAAAA,YAAAC;AAAAA,YAAAC;AAAAA,YAAAC;AAAAA,UAAAA,CAAkF;AAAA,QAAyB;AAAA,QAAA,MAAAC,YAAAC,SAAA;AAIxH,gBAAA;AAAA,YAAAR,MAAAS;AAAAA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QAAC;AAAA,QAAA,MAAAC,mBAAAC,WAAA;AAAA,iBAIvCvE,OAAMsE,mBAAoBC,SAAS;AAAA,QAAC;AAAA,MAAA;AAElDzE,aAAAE;AAAAF,aAAAM;AAAAA,IAAA,OAAA;AAAAA,WAAAN,EAAA,CAAA;AAAA,IAAA;AA1FGI,SAAOE;AA0Fa,WA7FjBF;AAAAA,EA8FK;;;;"}
1
+ {"version":3,"file":"index.umd.js","sources":["../src/usePostgresClientDriver.ts"],"sourcesContent":["import { useMemo, useEffect } from \"react\";\nimport {\n DataDriver,\n DeleteEntityProps,\n Entity,\n EntityCollection,\n EntityReference, EntityRelation,\n FetchCollectionProps,\n FetchEntityProps,\n ListenCollectionProps,\n ListenEntityProps,\n SaveEntityProps,\n BranchInfo\n} from \"@rebasepro/types\";\nimport { RebaseWebSocketClient } from \"@rebasepro/client\";\n\nexport interface PostgresDataDriverConfig {\n wsClient?: RebaseWebSocketClient;\n}\n\nexport interface PostgresDataDriver extends DataDriver {\n client?: RebaseWebSocketClient;\n}\n\n\nexport function usePostgresClientDriver(config: PostgresDataDriverConfig): PostgresDataDriver {\n const client = config.wsClient;\n\n return useMemo(() => {\n if (!client) throw new Error(\"RebaseWebSocketClient must be provided in config.wsClient\");\n\n return {\n\n key: \"postgres\",\n\n name: \"PostgreSQL\",\n\n client,\n\n async fetchCollection<M extends Record<string, any>>(props: FetchCollectionProps<M>): Promise<Entity<M>[]> {\n // Pick only the fields the client needs, ignoring extra fields from the CMS layer\n const { path, filter, limit, startAfter, orderBy, searchString, order } = props;\n return client.fetchCollection({ path,\nfilter,\nlimit,\nstartAfter,\norderBy,\nsearchString,\norder }) as Promise<Entity<M>[]>;\n },\n\n async fetchEntity<M extends Record<string, any>>(props: FetchEntityProps<M>): Promise<Entity<M> | undefined> {\n const { path, entityId, databaseId } = props;\n return client.fetchEntity({ path,\nentityId,\ndatabaseId }) as Promise<Entity<M> | undefined>;\n },\n\n async saveEntity<M extends Record<string, any>>(props: SaveEntityProps<M>): Promise<Entity<M>> {\n return client.saveEntity({\n path: props.path,\n values: props.values,\n entityId: props.entityId,\n previousValues: props.previousValues,\n status: props.status\n }) as Promise<Entity<M>>;\n },\n\n async deleteEntity<M extends Record<string, any>>(props: DeleteEntityProps<M>): Promise<void> {\n const { entity } = props;\n return client.deleteEntity({ entity });\n },\n\n async checkUniqueField(path: string, name: string, value: any, entityId?: string, collection?: EntityCollection): Promise<boolean> {\n return client.checkUniqueField(path, name, value, entityId, collection);\n },\n\n async countEntities<M extends Record<string, any>>(props: FetchCollectionProps<M>): Promise<number> {\n const { path, filter, limit, startAfter, orderBy, searchString, order } = props;\n return client.countEntities({ path,\nfilter,\nlimit,\nstartAfter,\norderBy,\nsearchString,\norder });\n },\n\n listenCollection<M extends Record<string, any>>(props: ListenCollectionProps<M>): () => void {\n const { path, filter, limit, startAfter, orderBy, searchString, order, onUpdate, onError } = props;\n return client.listenCollection(\n { path,\nfilter,\nlimit,\nstartAfter,\norderBy,\nsearchString,\norder },\n (entities: Entity[]) => props.onUpdate(entities as Entity<M>[]),\n props.onError\n );\n },\n\n listenEntity<M extends Record<string, any>>(props: ListenEntityProps<M>): () => void {\n const { path, entityId, databaseId, onUpdate, onError } = props;\n return client.listenEntity(\n { path,\nentityId,\ndatabaseId },\n (entity: Entity | null) => {\n props.onUpdate(entity as Entity<M> | null);\n },\n props.onError\n );\n },\n\n isFilterCombinationValid(): boolean {\n return true; // PostgreSQL supports complex filter combinations\n },\n\n admin: {\n executeSql(sql: string, options?: { database?: string; role?: string }): Promise<Record<string, unknown>[]> {\n return client.executeSql(sql, options);\n },\n fetchAvailableDatabases(): Promise<string[]> {\n return client.fetchAvailableDatabases();\n },\n fetchAvailableRoles(): Promise<string[]> {\n return client.fetchAvailableRoles();\n },\n fetchCurrentDatabase(): Promise<string | undefined> {\n return client.fetchCurrentDatabase();\n },\n fetchUnmappedTables(mappedPaths?: string[]): Promise<string[]> {\n return client.fetchUnmappedTables(mappedPaths);\n },\n fetchTableMetadata(tableName: string): Promise<unknown> {\n return client.fetchTableMetadata(tableName);\n },\n createBranch(name: string, options?: { source?: string }): Promise<BranchInfo> {\n return client.createBranch(name, options);\n },\n deleteBranch(name: string): Promise<void> {\n return client.deleteBranch(name);\n },\n listBranches(): Promise<BranchInfo[]> {\n return client.listBranches();\n }\n }\n } as PostgresDataDriver;\n }, [client]);\n\n}\n"],"names":["usePostgresClientDriver","config","$","_c","client","wsClient","t0","Error","t1","key","name","fetchCollection","props","path","filter","limit","startAfter","orderBy","searchString","order","fetchEntity","props_0","path_0","entityId","databaseId","saveEntity","props_1","values","previousValues","status","deleteEntity","props_2","entity","checkUniqueField","path_1","value","entityId_0","collection","countEntities","props_3","path_2","filter_0","limit_0","startAfter_0","orderBy_0","searchString_0","order_0","listenCollection","props_4","path_3","filter_1","limit_1","startAfter_1","orderBy_1","searchString_1","order_1","entities","onUpdate","onError","listenEntity","props_5","path_4","entityId_1","databaseId_0","entity_0","isFilterCombinationValid","admin","executeSql","sql","options","fetchAvailableDatabases","fetchAvailableRoles","fetchCurrentDatabase","fetchUnmappedTables","mappedPaths","fetchTableMetadata","tableName","createBranch","name_0","options_0","deleteBranch","name_1","listBranches"],"mappings":";;;;AAyBO,WAAAA,wBAAAC,QAAA;AAAA,UAAAC,IAAAC,qBAAAA,EAAA,CAAA;AACH,UAAAC,SAAeH,OAAMI;AAAU,QAAAC;AAAA,QAAA,CAGtBF,QAAM;AAAA,YAAA,IAAAG,MAAkB,2DAA2D;AAAA,IAAA;AAAA,QAAAC;AAAA,QAAAN,SAAAE,QAAA;AAEjFI,WAAA;AAAA,QAAAC,KAEF;AAAA,QAAUC,MAET;AAAA,QAAYN;AAAAA,QAAA,MAAAO,gBAAAC,OAAA;AAMd,gBAAA;AAAA,YAAAC;AAAAA,YAAAC;AAAAA,YAAAC;AAAAA,YAAAC;AAAAA,YAAAC;AAAAA,YAAAC;AAAAA,YAAAC;AAAAA,UAAAA,IAA0EP;AAAM,iBACzER,OAAMO,gBAAA;A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GhCnE,OAAMmE,oBAAAA;AAAAA,UAAsB;AAAA,UAAAC,uBAAA;AAAA,mBAG5BpE,OAAMoE,qBAAAA;AAAAA,UAAuB;AAAA,UAAAC,oBAAAC,aAAA;AAAA,mBAG7BtE,OAAMqE,oBAAqBC,WAAW;AAAA,UAAC;AAAA,UAAAC,mBAAAC,WAAA;AAAA,mBAGvCxE,OAAMuE,mBAAoBC,SAAS;AAAA,UAAC;AAAA,UAAAC,aAAAC,QAAAC,WAAA;AAAA,mBAGpC3E,OAAMyE,aAAcnE,QAAM2D,SAAO;AAAA,UAAC;AAAA,UAAAW,aAAAC,QAAA;AAAA,mBAGlC7E,OAAM4E,aAActE,MAAI;AAAA,UAAC;AAAA,UAAAwE,eAAA;AAAA,mBAGzB9E,OAAM8E,aAAAA;AAAAA,UAAe;AAAA,QAAA;AAAA,MAAA;AAGvChF,aAAAE;AAAAF,aAAAM;AAAAA,IAAA,OAAA;AAAAA,WAAAN,EAAA,CAAA;AAAA,IAAA;AAtHGI,SAAOE;AAsHa,WAzHjBF;AAAAA,EA0HK;;;;"}
@@ -15,6 +15,8 @@ export interface AuthCapabilities {
15
15
  sessionManagement?: boolean;
16
16
  profileUpdate?: boolean;
17
17
  emailVerification?: boolean;
18
+ /** List of enabled OAuth provider IDs (e.g. ["google", "github", "discord"]) */
19
+ enabledProviders?: string[];
18
20
  }
19
21
  /**
20
22
  * Controller for retrieving the logged user or performing auth related operations.
@@ -1,9 +1,10 @@
1
1
  import { User } from "../users";
2
2
  import { RebaseData } from "./data";
3
+ import { EmailService } from "./email";
3
4
  /**
4
5
  * Event type for authentication state changes
5
6
  */
6
- export type AuthChangeEvent = 'SIGNED_IN' | 'SIGNED_OUT' | 'TOKEN_REFRESHED' | 'USER_UPDATED';
7
+ export type AuthChangeEvent = "SIGNED_IN" | "SIGNED_OUT" | "TOKEN_REFRESHED" | "USER_UPDATED";
7
8
  /**
8
9
  * Standard session interface representing an authenticated state
9
10
  */
@@ -39,20 +40,131 @@ export interface AuthClient {
39
40
  * Manually refresh the session token
40
41
  */
41
42
  refreshSession(): Promise<RebaseSession>;
42
- [key: string]: any;
43
43
  }
44
44
  /**
45
- * Overarching abstraction that unites Data, Auth, and Storage.
45
+ * User record as returned by the Admin API.
46
+ * @group Admin
47
+ */
48
+ export interface AdminUser {
49
+ uid: string;
50
+ email: string;
51
+ displayName: string | null;
52
+ photoURL: string | null;
53
+ provider: string;
54
+ roles: string[];
55
+ createdAt: string;
56
+ updatedAt: string;
57
+ }
58
+ /**
59
+ * Role record as returned by the Admin API.
60
+ * @group Admin
61
+ */
62
+ export interface AdminRole {
63
+ id: string;
64
+ name: string;
65
+ isAdmin: boolean;
66
+ defaultPermissions: Record<string, unknown> | null;
67
+ config: Record<string, unknown> | null;
68
+ }
69
+ /**
70
+ * Client-side Admin API interface.
71
+ * Provides user and role management operations.
72
+ * @group Admin
73
+ */
74
+ export interface AdminAPI {
75
+ listUsers(): Promise<{
76
+ users: AdminUser[];
77
+ }>;
78
+ listUsersPaginated(options?: {
79
+ search?: string;
80
+ limit?: number;
81
+ offset?: number;
82
+ orderBy?: string;
83
+ orderDir?: "asc" | "desc";
84
+ }): Promise<{
85
+ users: AdminUser[];
86
+ total: number;
87
+ limit: number;
88
+ offset: number;
89
+ }>;
90
+ getUser(userId: string): Promise<{
91
+ user: AdminUser;
92
+ }>;
93
+ createUser(data: {
94
+ email: string;
95
+ displayName?: string;
96
+ password?: string;
97
+ roles?: string[];
98
+ }): Promise<{
99
+ user: AdminUser;
100
+ }>;
101
+ updateUser(userId: string, data: {
102
+ email?: string;
103
+ displayName?: string;
104
+ password?: string;
105
+ roles?: string[];
106
+ }): Promise<{
107
+ user: AdminUser;
108
+ }>;
109
+ deleteUser(userId: string): Promise<{
110
+ success: boolean;
111
+ }>;
112
+ listRoles(): Promise<{
113
+ roles: AdminRole[];
114
+ }>;
115
+ getRole(roleId: string): Promise<{
116
+ role: AdminRole;
117
+ }>;
118
+ createRole(data: {
119
+ id: string;
120
+ name: string;
121
+ isAdmin?: boolean;
122
+ defaultPermissions?: Record<string, unknown>;
123
+ config?: Record<string, unknown>;
124
+ }): Promise<{
125
+ role: AdminRole;
126
+ }>;
127
+ updateRole(roleId: string, data: {
128
+ name?: string;
129
+ isAdmin?: boolean;
130
+ defaultPermissions?: Record<string, unknown>;
131
+ config?: Record<string, unknown>;
132
+ }): Promise<{
133
+ role: AdminRole;
134
+ }>;
135
+ deleteRole(roleId: string): Promise<{
136
+ success: boolean;
137
+ }>;
138
+ bootstrap(): Promise<{
139
+ success: boolean;
140
+ message: string;
141
+ user: {
142
+ uid: string;
143
+ roles: string[];
144
+ };
145
+ }>;
146
+ }
147
+ /**
148
+ * Overarching abstraction that unites Data, Auth, Storage, and Email.
46
149
  * Adapters for Supabase or Firebase simply need to implement this interface.
47
150
  */
48
- export interface RebaseClient<DB = any> {
151
+ export interface RebaseClient<DB = unknown> {
49
152
  /** Unified Data access layer */
50
153
  data: RebaseData;
51
154
  /** Unified Authentication layer */
52
155
  auth: AuthClient;
53
156
  /** Unified Storage layer */
54
157
  storage?: StorageSource;
55
- /** Optional admin panel specific tasks */
56
- admin?: any;
57
- [key: string]: any;
158
+ /**
159
+ * Server-side email service.
160
+ *
161
+ * Available when SMTP (or a custom `sendEmail` function) is configured
162
+ * in the backend auth config. `undefined` when email is not configured.
163
+ *
164
+ * > **Note:** This is only available on the server-side `rebase` singleton.
165
+ * > The client-side SDK does not include an email service.
166
+ */
167
+ email?: EmailService;
168
+ /** Admin API for user and role management */
169
+ admin?: AdminAPI;
58
170
  }
@@ -1,9 +1,10 @@
1
- import { EntityCollection, EntityReference } from "../types";
1
+ import type { EntityCollection } from "../types/collections";
2
+ import type { EntityReference } from "../types/entities";
2
3
  /**
3
4
  * Controller that provides access to the registered entity collections.
4
5
  * @group Models
5
6
  */
6
- export type CollectionRegistryController<EC extends EntityCollection = EntityCollection<any>> = {
7
+ export type CollectionRegistryController<DB = Record<string, unknown>, EC extends EntityCollection = EntityCollection<any>> = {
7
8
  /**
8
9
  * List of the mapped collections in the CMS.
9
10
  * Each entry relates to a collection in the root database.
@@ -19,7 +20,7 @@ export type CollectionRegistryController<EC extends EntityCollection = EntityCol
19
20
  * Get the collection configuration for a given path.
20
21
  * The collection is resolved from the given path or alias.
21
22
  */
22
- getCollection: (slugOrPath: string, includeUserOverride?: boolean) => EC | undefined;
23
+ getCollection: <K extends keyof DB>(slugOrPath: Extract<K, string>, includeUserOverride?: boolean) => EC | undefined;
23
24
  /**
24
25
  * Get the raw, un-normalized collection configuration.
25
26
  * This bypasses the `CollectionRegistry` normalization (such as injecting `relation` instances).
@@ -1,5 +1,11 @@
1
1
  import React from "react";
2
- import { EntityLinkBuilder, Locale, EntityAction, EntityCustomView, RebasePlugin, PropertyConfig, SlotContribution } from "../types";
2
+ import type { EntityLinkBuilder } from "../types/entity_link_builder";
3
+ import type { Locale } from "../types/locales";
4
+ import type { EntityAction } from "../types/entity_actions";
5
+ import type { EntityCustomView } from "../types/entity_views";
6
+ import type { RebasePlugin } from "../types/plugins";
7
+ import type { PropertyConfig } from "../types/property_config";
8
+ import type { SlotContribution } from "../types/slots";
3
9
  export type CustomizationController = {
4
10
  /**
5
11
  * Builder for generating utility links for entities
@@ -6,6 +6,19 @@ import { Entity, EntityValues } from "../types/entities";
6
6
  *
7
7
  * @group Data
8
8
  */
9
+ /**
10
+ * A where-clause value for a single field.
11
+ *
12
+ * Supports three syntaxes:
13
+ * 1. **Equality shorthand**: raw JS values — `null`, `"active"`, `42`, `true`
14
+ * 2. **Tuple syntax**: `[operator, value]` — `[">", 18]`, `["in", ["a","b"]]`
15
+ * 3. **PostgREST string**: `"eq.published"`, `"gte.18"`, `"in.(a,b)"`
16
+ *
17
+ * @group Data
18
+ */
19
+ export type WhereFieldValue = string | number | boolean | null | [WhereFilterOpShort, any];
20
+ /** Short operator strings accepted in the tuple syntax. */
21
+ export type WhereFilterOpShort = "==" | "!=" | ">" | ">=" | "<" | "<=" | "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "in" | "nin" | "not-in" | "array-contains" | "array-contains-any" | "cs" | "csa";
9
22
  export interface FindParams {
10
23
  /** Maximum number of items to return (default: 20) */
11
24
  limit?: number;
@@ -14,16 +27,30 @@ export interface FindParams {
14
27
  /** Page number (1-indexed), alternative to offset */
15
28
  page?: number;
16
29
  /**
17
- * PostgREST-style filter object.
18
- * Keys are field names, values use "operator.value" format.
19
- * Operators: eq, neq, gt, gte, lt, lte, in, nin, cs (array-contains), csa (array-contains-any)
30
+ * Filter object. Supports multiple syntaxes per field:
20
31
  *
21
- * @example
32
+ * **Equality shorthand** — raw JS values (null, string, number, boolean):
33
+ * ```ts
34
+ * { company_profile_id: null }
35
+ * { status: "active" }
36
+ * { age: 18 }
37
+ * ```
38
+ *
39
+ * **Tuple syntax** — `[operator, value]`:
40
+ * ```ts
41
+ * { age: [">=", 18] }
42
+ * { role: ["in", ["admin", "editor"]] }
43
+ * { deleted_at: ["!=", null] }
44
+ * ```
45
+ *
46
+ * **PostgREST string syntax** (original format):
47
+ * ```ts
22
48
  * { status: "eq.published" }
23
49
  * { age: "gte.18" }
24
50
  * { role: "in.(admin,editor)" }
51
+ * ```
25
52
  */
26
- where?: Record<string, string>;
53
+ where?: Record<string, WhereFieldValue>;
27
54
  /**
28
55
  * Sort order. Format: "field:direction".
29
56
  * @example "created_at:desc", "name:asc"
@@ -38,7 +65,7 @@ export interface FindParams {
38
65
  * Paginated response from a collection query.
39
66
  * @group Data
40
67
  */
41
- export interface FindResponse<M extends Record<string, any> = any> {
68
+ export interface FindResponse<M extends Record<string, unknown> = Record<string, unknown>> {
42
69
  /** Array of entities matching the query */
43
70
  data: Entity<M>[];
44
71
  /** Pagination metadata */
@@ -58,7 +85,7 @@ export interface FindResponse<M extends Record<string, any> = any> {
58
85
  *
59
86
  * @group Data
60
87
  */
61
- export interface CollectionAccessor<M extends Record<string, any> = any> {
88
+ export interface CollectionAccessor<M extends Record<string, unknown> = Record<string, unknown>> {
62
89
  /**
63
90
  * Find multiple records with optional filtering, pagination, and sorting.
64
91
  */
@@ -1,30 +1,31 @@
1
- import { Entity, EntityCollection, EntityStatus, EntityValues, FilterValues } from "../types";
2
- import { RebaseContext } from "../rebase_context";
3
- import { TableMetadata } from "../types/websockets";
1
+ import type { Entity, EntityStatus, EntityValues } from "../types/entities";
2
+ import type { EntityCollection, FilterValues } from "../types/collections";
3
+ import type { RebaseContext } from "../rebase_context";
4
4
  /**
5
5
  * @internal
6
6
  */
7
- export interface FetchEntityProps<M extends Record<string, any> = any> {
7
+ export interface FetchEntityProps<M extends Record<string, unknown> = Record<string, unknown>> {
8
8
  path: string;
9
9
  entityId: string | number;
10
10
  databaseId?: string;
11
- collection?: EntityCollection<M, any>;
11
+ collection?: EntityCollection<M>;
12
12
  }
13
13
  /**
14
14
  * @internal
15
15
  */
16
- export type ListenEntityProps<M extends Record<string, any> = any> = FetchEntityProps<M> & {
16
+ export type ListenEntityProps<M extends Record<string, unknown> = Record<string, unknown>> = FetchEntityProps<M> & {
17
17
  onUpdate: (entity: Entity<M> | null) => void;
18
18
  onError?: (error: Error) => void;
19
19
  };
20
20
  /**
21
21
  * @internal
22
22
  */
23
- export interface FetchCollectionProps<M extends Record<string, any> = any> {
23
+ export interface FetchCollectionProps<M extends Record<string, unknown> = Record<string, unknown>> {
24
24
  path: string;
25
25
  collection?: EntityCollection<M>;
26
26
  filter?: FilterValues<Extract<keyof M, string>>;
27
27
  limit?: number;
28
+ offset?: number;
28
29
  startAfter?: unknown;
29
30
  orderBy?: string;
30
31
  searchString?: string;
@@ -33,14 +34,14 @@ export interface FetchCollectionProps<M extends Record<string, any> = any> {
33
34
  /**
34
35
  * @internal
35
36
  */
36
- export type ListenCollectionProps<M extends Record<string, any> = any> = FetchCollectionProps<M> & {
37
+ export type ListenCollectionProps<M extends Record<string, unknown> = Record<string, unknown>> = FetchCollectionProps<M> & {
37
38
  onUpdate: (entities: Entity<M>[]) => void;
38
39
  onError?: (error: Error) => void;
39
40
  };
40
41
  /**
41
42
  * @internal
42
43
  */
43
- export interface SaveEntityProps<M extends Record<string, any> = any> {
44
+ export interface SaveEntityProps<M extends Record<string, unknown> = Record<string, unknown>> {
44
45
  path: string;
45
46
  values: Partial<EntityValues<M>>;
46
47
  entityId?: string | number;
@@ -51,15 +52,15 @@ export interface SaveEntityProps<M extends Record<string, any> = any> {
51
52
  /**
52
53
  * @internal
53
54
  */
54
- export interface DeleteEntityProps<M extends Record<string, any> = any> {
55
+ export interface DeleteEntityProps<M extends Record<string, unknown> = Record<string, unknown>> {
55
56
  entity: Entity<M>;
56
57
  collection?: EntityCollection<M>;
57
58
  }
58
59
  export type FilterCombinationValidProps = {
59
60
  path: string;
60
61
  databaseId?: string;
61
- collection: EntityCollection<any>;
62
- filterValues: FilterValues<any>;
62
+ collection: EntityCollection;
63
+ filterValues: FilterValues<string>;
63
64
  sortBy?: [string, "asc" | "desc"];
64
65
  };
65
66
  /**
@@ -81,36 +82,36 @@ export interface DataDriver {
81
82
  * @param props
82
83
  * @return Promise of entities
83
84
  */
84
- fetchCollection<M extends Record<string, any> = any>(props: FetchCollectionProps<M>): Promise<Entity<M>[]>;
85
+ fetchCollection<M extends Record<string, unknown> = Record<string, unknown>>(props: FetchCollectionProps<M>): Promise<Entity<M>[]>;
85
86
  /**
86
87
  * Listen to a collection in a given path. If you don't implement this method
87
88
  * `fetchCollection` will be used instead, with no real time updates.
88
89
  * @param props
89
90
  * @return Function to cancel subscription
90
91
  */
91
- listenCollection?<M extends Record<string, any> = any>(props: ListenCollectionProps<M>): () => void;
92
+ listenCollection?<M extends Record<string, unknown> = Record<string, unknown>>(props: ListenCollectionProps<M>): () => void;
92
93
  /**
93
94
  * Retrieve an entity given a path and a collection
94
95
  * @param props
95
96
  */
96
- fetchEntity<M extends Record<string, any> = any>(props: FetchEntityProps<M>): Promise<Entity<M> | undefined>;
97
+ fetchEntity<M extends Record<string, unknown> = Record<string, unknown>>(props: FetchEntityProps<M>): Promise<Entity<M> | undefined>;
97
98
  /**
98
99
  * Get realtime updates on one entity.
99
100
  * @param props
100
101
  * @return Function to cancel subscription
101
102
  */
102
- listenEntity?<M extends Record<string, any> = any>(props: ListenEntityProps<M>): () => void;
103
+ listenEntity?<M extends Record<string, unknown> = Record<string, unknown>>(props: ListenEntityProps<M>): () => void;
103
104
  /**
104
105
  * Save entity to the specified path
105
106
  * @param props
106
107
  */
107
- saveEntity<M extends Record<string, any> = any>(props: SaveEntityProps<M>): Promise<Entity<M>>;
108
+ saveEntity<M extends Record<string, unknown> = Record<string, unknown>>(props: SaveEntityProps<M>): Promise<Entity<M>>;
108
109
  /**
109
110
  * Delete an entity
110
111
  * @param props
111
112
  * @return was the whole deletion flow successful
112
113
  */
113
- deleteEntity<M extends Record<string, any> = any>(props: DeleteEntityProps<M>): Promise<void>;
114
+ deleteEntity<M extends Record<string, unknown> = Record<string, unknown>>(props: DeleteEntityProps<M>): Promise<void>;
114
115
  /**
115
116
  * Check if the given property is unique in the given collection
116
117
  * @param path Collection path
@@ -124,7 +125,7 @@ export interface DataDriver {
124
125
  /**
125
126
  * Count the number of entities in a collection
126
127
  */
127
- countEntities?<M extends Record<string, any> = any>(props: FetchCollectionProps<M>): Promise<number>;
128
+ countEntities?<M extends Record<string, unknown> = Record<string, unknown>>(props: FetchCollectionProps<M>): Promise<number>;
128
129
  /**
129
130
  * Check if the given filter combination is valid
130
131
  * @param props
@@ -156,13 +157,4 @@ export interface DataDriver {
156
157
  * @see SchemaAdmin
157
158
  */
158
159
  admin?: import("../types/backend").DatabaseAdmin;
159
- executeSql?(sql: string, options?: {
160
- database?: string;
161
- role?: string;
162
- }): Promise<Record<string, unknown>[]>;
163
- fetchAvailableDatabases?(): Promise<string[]>;
164
- fetchAvailableRoles?(): Promise<string[]>;
165
- fetchCurrentDatabase?(): Promise<string | undefined>;
166
- fetchUnmappedTables?(mappedPaths?: string[]): Promise<string[]>;
167
- fetchTableMetadata?(tableName: string): Promise<TableMetadata>;
168
160
  }
@@ -7,5 +7,5 @@
7
7
  *
8
8
  * @group Admin
9
9
  */
10
- export type { SQLAdmin, DocumentAdmin, SchemaAdmin, DatabaseAdmin, HealthCheckResult, } from "../types/backend";
11
- export { isSQLAdmin, isDocumentAdmin, isSchemaAdmin, } from "../types/backend";
10
+ export type { SQLAdmin, DocumentAdmin, SchemaAdmin, DatabaseAdmin, HealthCheckResult } from "../types/backend";
11
+ export { isSQLAdmin, isDocumentAdmin, isSchemaAdmin } from "../types/backend";
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Email service types — portable interface shared by RebaseClient and server-core.
3
+ *
4
+ * The concrete SMTP implementation lives in `@rebasepro/server-core/email`.
5
+ * This file provides only the consumer-facing contract so that it can be
6
+ * referenced from `RebaseClient` without dragging in nodemailer.
7
+ */
8
+ /**
9
+ * Options for sending an email via the Rebase email service.
10
+ */
11
+ export interface EmailSendOptions {
12
+ /** Recipient email address(es). */
13
+ to: string | string[];
14
+ /** Email subject line. */
15
+ subject: string;
16
+ /** HTML body content. */
17
+ html: string;
18
+ /** Optional plain-text fallback. */
19
+ text?: string;
20
+ /** Optional reply-to address. */
21
+ replyTo?: string;
22
+ }
23
+ /**
24
+ * Abstraction over an email delivery backend.
25
+ *
26
+ * Implementations may use SMTP, AWS SES, Resend, Postmark, or any other
27
+ * provider — consumers only interact through this interface.
28
+ */
29
+ export interface EmailService {
30
+ /** Send a single email. */
31
+ send(options: EmailSendOptions): Promise<void>;
32
+ /** Returns `true` when the service has valid credentials / is ready to send. */
33
+ isConfigured(): boolean;
34
+ }
@@ -8,6 +8,7 @@ export * from "./local_config_persistence";
8
8
  export * from "./navigation";
9
9
  export * from "./effective_role";
10
10
  export * from "./storage";
11
+ export * from "./email";
11
12
  export * from "./client";
12
13
  export * from "./customization_controller";
13
14
  export * from "./side_entity_controller";
@@ -1,16 +1,16 @@
1
- import { EntityCollection } from "../types";
1
+ import type { EntityCollection } from "../types/collections";
2
2
  /**
3
3
  * @group Models
4
4
  */
5
- export type PartialEntityCollection<M extends Record<string, any> = any> = Partial<EntityCollection<M>>;
5
+ export type PartialEntityCollection<M extends Record<string, unknown> = Record<string, unknown>> = Partial<EntityCollection<M>>;
6
6
  /**
7
7
  * This interface is in charge of defining the controller that persists
8
8
  * modifications to a collection or collection, and retrieves them back from
9
9
  * a data source, such as local storage or Firestore.
10
10
  */
11
11
  export interface UserConfigurationPersistence {
12
- onCollectionModified: <M extends Record<string, any> = any>(path: string, partialCollection: PartialEntityCollection<M>) => void;
13
- getCollectionConfig: <M extends Record<string, any> = any>(path: string) => PartialEntityCollection<M>;
12
+ onCollectionModified: <M extends Record<string, unknown> = Record<string, unknown>>(path: string, partialCollection: PartialEntityCollection<M>) => void;
13
+ getCollectionConfig: <M extends Record<string, unknown> = Record<string, unknown>>(path: string) => PartialEntityCollection<M>;
14
14
  recentlyVisitedPaths: string[];
15
15
  setRecentlyVisitedPaths: (paths: string[]) => void;
16
16
  favouritePaths: string[];
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import { EntityCollection } from "../types/collections";
3
- import { RebasePlugin } from "../types/plugins";
2
+ import type { EntityCollection } from "../types/collections";
3
+ import type { RebasePlugin } from "../types/plugins";
4
4
  /**
5
5
  * Controller that handles URL path building and resolution.
6
6
  * @group Models
@@ -133,9 +133,9 @@ export interface AppView {
133
133
  description?: string;
134
134
  /**
135
135
  * Icon key to use in this view.
136
- * You can use any of the icons in the Material specs:
137
- * https://fonts.google.com/icons
138
- * e.g. 'account_tree' or 'person'
136
+ * You can use any of the icons in the Lucide specs:
137
+ * https://lucide.dev/icons/
138
+ * e.g. 'ShoppingCart' or 'User'
139
139
  * Find all the icons in https://rebase.pro/docs/icons
140
140
  */
141
141
  icon?: string | React.ReactNode;
@@ -1,6 +1,9 @@
1
1
  import { ReactNode } from "react";
2
- import { EntityCollection, EntityCollectionsBuilder, EntityCustomView, EntityAction } from "../types";
3
- import { AppView } from "./navigation";
2
+ import type { EntityCollection } from "../types/collections";
3
+ import type { EntityCollectionsBuilder } from "../types/builders";
4
+ import type { EntityCustomView } from "../types/entity_views";
5
+ import type { EntityAction } from "../types/entity_actions";
6
+ import type { AppView } from "./navigation";
4
7
  /**
5
8
  * Options to enable the built-in collection editor.
6
9
  * When provided to `<RebaseCMS>`, the editor is auto-wired as a native feature.
@@ -31,7 +34,7 @@ export interface RebaseCMSConfig<EC extends EntityCollection = any> {
31
34
  collectionEditor?: boolean | CollectionEditorOptions;
32
35
  }
33
36
  export interface RebaseStudioConfig {
34
- tools?: ("sql" | "js" | "rls" | "schema" | "storage")[];
37
+ tools?: ("sql" | "js" | "rls" | "schema" | "storage" | "cron" | "schema-visualizer" | "branches" | "api")[];
35
38
  homePage?: ReactNode;
36
39
  devViews?: AppView[];
37
40
  }