@rebasepro/server-mongodb 0.0.1-canary.4d4fb3e

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 (125) hide show
  1. package/LICENSE +6 -0
  2. package/dist/index.es.js +875 -0
  3. package/dist/index.es.js.map +1 -0
  4. package/dist/index.umd.js +878 -0
  5. package/dist/index.umd.js.map +1 -0
  6. package/dist/server-mongodb/src/connection.d.ts +35 -0
  7. package/dist/server-mongodb/src/connection.d.ts.map +1 -0
  8. package/dist/server-mongodb/src/db/MongoConditionBuilder.d.ts +64 -0
  9. package/dist/server-mongodb/src/db/MongoConditionBuilder.d.ts.map +1 -0
  10. package/dist/server-mongodb/src/db/MongoEntityService.d.ts +98 -0
  11. package/dist/server-mongodb/src/db/MongoEntityService.d.ts.map +1 -0
  12. package/dist/server-mongodb/src/factory.d.ts +139 -0
  13. package/dist/server-mongodb/src/factory.d.ts.map +1 -0
  14. package/dist/server-mongodb/src/index.d.ts +17 -0
  15. package/dist/server-mongodb/src/index.d.ts.map +1 -0
  16. package/dist/server-mongodb/src/services/MongoDriver.d.ts +81 -0
  17. package/dist/server-mongodb/src/services/MongoDriver.d.ts.map +1 -0
  18. package/dist/server-mongodb/src/services/MongoRealtimeService.d.ts +65 -0
  19. package/dist/server-mongodb/src/services/MongoRealtimeService.d.ts.map +1 -0
  20. package/dist/server-mongodb/src/useMongoDriver.d.ts +18 -0
  21. package/dist/server-mongodb/src/useMongoDriver.d.ts.map +1 -0
  22. package/dist/server-mongodb/src/utils.d.ts +10 -0
  23. package/dist/server-mongodb/src/utils.d.ts.map +1 -0
  24. package/dist/types/src/controllers/analytics_controller.d.ts +8 -0
  25. package/dist/types/src/controllers/analytics_controller.d.ts.map +1 -0
  26. package/dist/types/src/controllers/auth.d.ts +118 -0
  27. package/dist/types/src/controllers/auth.d.ts.map +1 -0
  28. package/dist/types/src/controllers/client.d.ts +59 -0
  29. package/dist/types/src/controllers/client.d.ts.map +1 -0
  30. package/dist/types/src/controllers/collection_registry.d.ts +45 -0
  31. package/dist/types/src/controllers/collection_registry.d.ts.map +1 -0
  32. package/dist/types/src/controllers/customization_controller.d.ts +55 -0
  33. package/dist/types/src/controllers/customization_controller.d.ts.map +1 -0
  34. package/dist/types/src/controllers/data.d.ts +142 -0
  35. package/dist/types/src/controllers/data.d.ts.map +1 -0
  36. package/dist/types/src/controllers/data_driver.d.ts +169 -0
  37. package/dist/types/src/controllers/data_driver.d.ts.map +1 -0
  38. package/dist/types/src/controllers/database_admin.d.ts +12 -0
  39. package/dist/types/src/controllers/database_admin.d.ts.map +1 -0
  40. package/dist/types/src/controllers/dialogs_controller.d.ts +37 -0
  41. package/dist/types/src/controllers/dialogs_controller.d.ts.map +1 -0
  42. package/dist/types/src/controllers/effective_role.d.ts +5 -0
  43. package/dist/types/src/controllers/effective_role.d.ts.map +1 -0
  44. package/dist/types/src/controllers/index.d.ts +18 -0
  45. package/dist/types/src/controllers/index.d.ts.map +1 -0
  46. package/dist/types/src/controllers/local_config_persistence.d.ts +21 -0
  47. package/dist/types/src/controllers/local_config_persistence.d.ts.map +1 -0
  48. package/dist/types/src/controllers/navigation.d.ts +214 -0
  49. package/dist/types/src/controllers/navigation.d.ts.map +1 -0
  50. package/dist/types/src/controllers/registry.d.ts +52 -0
  51. package/dist/types/src/controllers/registry.d.ts.map +1 -0
  52. package/dist/types/src/controllers/side_dialogs_controller.d.ts +68 -0
  53. package/dist/types/src/controllers/side_dialogs_controller.d.ts.map +1 -0
  54. package/dist/types/src/controllers/side_entity_controller.d.ts +90 -0
  55. package/dist/types/src/controllers/side_entity_controller.d.ts.map +1 -0
  56. package/dist/types/src/controllers/snackbar.d.ts +25 -0
  57. package/dist/types/src/controllers/snackbar.d.ts.map +1 -0
  58. package/dist/types/src/controllers/storage.d.ts +174 -0
  59. package/dist/types/src/controllers/storage.d.ts.map +1 -0
  60. package/dist/types/src/index.d.ts +5 -0
  61. package/dist/types/src/index.d.ts.map +1 -0
  62. package/dist/types/src/rebase_context.d.ts +102 -0
  63. package/dist/types/src/rebase_context.d.ts.map +1 -0
  64. package/dist/types/src/types/backend.d.ts +534 -0
  65. package/dist/types/src/types/backend.d.ts.map +1 -0
  66. package/dist/types/src/types/builders.d.ts +15 -0
  67. package/dist/types/src/types/builders.d.ts.map +1 -0
  68. package/dist/types/src/types/chips.d.ts +6 -0
  69. package/dist/types/src/types/chips.d.ts.map +1 -0
  70. package/dist/types/src/types/collections.d.ts +813 -0
  71. package/dist/types/src/types/collections.d.ts.map +1 -0
  72. package/dist/types/src/types/data_source.d.ts +65 -0
  73. package/dist/types/src/types/data_source.d.ts.map +1 -0
  74. package/dist/types/src/types/entities.d.ts +146 -0
  75. package/dist/types/src/types/entities.d.ts.map +1 -0
  76. package/dist/types/src/types/entity_actions.d.ts +99 -0
  77. package/dist/types/src/types/entity_actions.d.ts.map +1 -0
  78. package/dist/types/src/types/entity_callbacks.d.ts +174 -0
  79. package/dist/types/src/types/entity_callbacks.d.ts.map +1 -0
  80. package/dist/types/src/types/entity_link_builder.d.ts +8 -0
  81. package/dist/types/src/types/entity_link_builder.d.ts.map +1 -0
  82. package/dist/types/src/types/entity_overrides.d.ts +10 -0
  83. package/dist/types/src/types/entity_overrides.d.ts.map +1 -0
  84. package/dist/types/src/types/entity_views.d.ts +62 -0
  85. package/dist/types/src/types/entity_views.d.ts.map +1 -0
  86. package/dist/types/src/types/export_import.d.ts +22 -0
  87. package/dist/types/src/types/export_import.d.ts.map +1 -0
  88. package/dist/types/src/types/index.d.ts +23 -0
  89. package/dist/types/src/types/index.d.ts.map +1 -0
  90. package/dist/types/src/types/locales.d.ts +5 -0
  91. package/dist/types/src/types/locales.d.ts.map +1 -0
  92. package/dist/types/src/types/modify_collections.d.ts +6 -0
  93. package/dist/types/src/types/modify_collections.d.ts.map +1 -0
  94. package/dist/types/src/types/plugins.d.ts +226 -0
  95. package/dist/types/src/types/plugins.d.ts.map +1 -0
  96. package/dist/types/src/types/properties.d.ts +1092 -0
  97. package/dist/types/src/types/properties.d.ts.map +1 -0
  98. package/dist/types/src/types/property_config.d.ts +71 -0
  99. package/dist/types/src/types/property_config.d.ts.map +1 -0
  100. package/dist/types/src/types/relations.d.ts +337 -0
  101. package/dist/types/src/types/relations.d.ts.map +1 -0
  102. package/dist/types/src/types/slots.d.ts +229 -0
  103. package/dist/types/src/types/slots.d.ts.map +1 -0
  104. package/dist/types/src/types/translations.d.ts +827 -0
  105. package/dist/types/src/types/translations.d.ts.map +1 -0
  106. package/dist/types/src/types/user_management_delegate.d.ts +121 -0
  107. package/dist/types/src/types/user_management_delegate.d.ts.map +1 -0
  108. package/dist/types/src/types/websockets.d.ts +79 -0
  109. package/dist/types/src/types/websockets.d.ts.map +1 -0
  110. package/dist/types/src/users/index.d.ts +3 -0
  111. package/dist/types/src/users/index.d.ts.map +1 -0
  112. package/dist/types/src/users/roles.d.ts +23 -0
  113. package/dist/types/src/users/roles.d.ts.map +1 -0
  114. package/dist/types/src/users/user.d.ts +47 -0
  115. package/dist/types/src/users/user.d.ts.map +1 -0
  116. package/package.json +81 -0
  117. package/src/connection.ts +60 -0
  118. package/src/db/MongoConditionBuilder.ts +181 -0
  119. package/src/db/MongoEntityService.ts +350 -0
  120. package/src/factory.ts +274 -0
  121. package/src/index.ts +24 -0
  122. package/src/services/MongoDriver.ts +267 -0
  123. package/src/services/MongoRealtimeService.ts +295 -0
  124. package/src/useMongoDriver.ts +516 -0
  125. package/src/utils.ts +28 -0
@@ -0,0 +1,169 @@
1
+ import { Entity, EntityCollection, EntityStatus, EntityValues, FilterValues } from "../types";
2
+ import { RebaseContext } from "../rebase_context";
3
+ import { TableMetadata } from "../types/websockets";
4
+ /**
5
+ * @internal
6
+ */
7
+ export interface FetchEntityProps<M extends Record<string, any> = any> {
8
+ path: string;
9
+ entityId: string | number;
10
+ databaseId?: string;
11
+ collection?: EntityCollection<M, any>;
12
+ }
13
+ /**
14
+ * @internal
15
+ */
16
+ export type ListenEntityProps<M extends Record<string, any> = any> = FetchEntityProps<M> & {
17
+ onUpdate: (entity: Entity<M> | null) => void;
18
+ onError?: (error: Error) => void;
19
+ };
20
+ /**
21
+ * @internal
22
+ */
23
+ export interface FetchCollectionProps<M extends Record<string, any> = any> {
24
+ path: string;
25
+ collection?: EntityCollection<M>;
26
+ filter?: FilterValues<Extract<keyof M, string>>;
27
+ limit?: number;
28
+ startAfter?: unknown;
29
+ orderBy?: string;
30
+ searchString?: string;
31
+ order?: "desc" | "asc";
32
+ }
33
+ /**
34
+ * @internal
35
+ */
36
+ export type ListenCollectionProps<M extends Record<string, any> = any> = FetchCollectionProps<M> & {
37
+ onUpdate: (entities: Entity<M>[]) => void;
38
+ onError?: (error: Error) => void;
39
+ };
40
+ /**
41
+ * @internal
42
+ */
43
+ export interface SaveEntityProps<M extends Record<string, any> = any> {
44
+ path: string;
45
+ values: Partial<EntityValues<M>>;
46
+ entityId?: string | number;
47
+ previousValues?: Partial<EntityValues<M>>;
48
+ collection?: EntityCollection<M>;
49
+ status: EntityStatus;
50
+ }
51
+ /**
52
+ * @internal
53
+ */
54
+ export interface DeleteEntityProps<M extends Record<string, any> = any> {
55
+ entity: Entity<M>;
56
+ collection?: EntityCollection<M>;
57
+ }
58
+ export type FilterCombinationValidProps = {
59
+ path: string;
60
+ databaseId?: string;
61
+ collection: EntityCollection<any>;
62
+ filterValues: FilterValues<any>;
63
+ sortBy?: [string, "asc" | "desc"];
64
+ };
65
+ /**
66
+ * Internal driver interface for communicating with the data layer.
67
+ * This is NOT the public API — use `RebaseData` / `context.data` instead.
68
+ * @internal
69
+ */
70
+ export interface DataDriver {
71
+ /**
72
+ * Key that identifies this driver
73
+ */
74
+ key?: string;
75
+ /**
76
+ * If the driver has been initialised
77
+ */
78
+ initialised?: boolean;
79
+ /**
80
+ * Fetch data from a collection
81
+ * @param props
82
+ * @return Promise of entities
83
+ */
84
+ fetchCollection<M extends Record<string, any> = any>(props: FetchCollectionProps<M>): Promise<Entity<M>[]>;
85
+ /**
86
+ * Listen to a collection in a given path. If you don't implement this method
87
+ * `fetchCollection` will be used instead, with no real time updates.
88
+ * @param props
89
+ * @return Function to cancel subscription
90
+ */
91
+ listenCollection?<M extends Record<string, any> = any>(props: ListenCollectionProps<M>): () => void;
92
+ /**
93
+ * Retrieve an entity given a path and a collection
94
+ * @param props
95
+ */
96
+ fetchEntity<M extends Record<string, any> = any>(props: FetchEntityProps<M>): Promise<Entity<M> | undefined>;
97
+ /**
98
+ * Get realtime updates on one entity.
99
+ * @param props
100
+ * @return Function to cancel subscription
101
+ */
102
+ listenEntity?<M extends Record<string, any> = any>(props: ListenEntityProps<M>): () => void;
103
+ /**
104
+ * Save entity to the specified path
105
+ * @param props
106
+ */
107
+ saveEntity<M extends Record<string, any> = any>(props: SaveEntityProps<M>): Promise<Entity<M>>;
108
+ /**
109
+ * Delete an entity
110
+ * @param props
111
+ * @return was the whole deletion flow successful
112
+ */
113
+ deleteEntity<M extends Record<string, any> = any>(props: DeleteEntityProps<M>): Promise<void>;
114
+ /**
115
+ * Check if the given property is unique in the given collection
116
+ * @param path Collection path
117
+ * @param name of the property
118
+ * @param value
119
+ * @param entityId
120
+ * @param collection
121
+ * @return `true` if there are no other fields besides the given entity
122
+ */
123
+ checkUniqueField(path: string, name: string, value: unknown, entityId?: string | number, collection?: EntityCollection): Promise<boolean>;
124
+ /**
125
+ * Count the number of entities in a collection
126
+ */
127
+ countEntities?<M extends Record<string, any> = any>(props: FetchCollectionProps<M>): Promise<number>;
128
+ /**
129
+ * Check if the given filter combination is valid
130
+ * @param props
131
+ */
132
+ isFilterCombinationValid?(props: Omit<FilterCombinationValidProps, "collection"> & {
133
+ databaseId?: string;
134
+ }): boolean;
135
+ /**
136
+ * Get the object to generate the current time in the driver
137
+ */
138
+ currentTime?: () => unknown;
139
+ delegateToCMSModel?: (data: unknown) => unknown;
140
+ cmsToDelegateModel?: (data: unknown) => unknown;
141
+ initTextSearch?: (props: {
142
+ context: RebaseContext;
143
+ path: string;
144
+ databaseId?: string;
145
+ collection: EntityCollection;
146
+ parentCollectionIds?: string[];
147
+ }) => Promise<boolean>;
148
+ /**
149
+ * Flag to indicate if the driver has requested the initialization of the text search index
150
+ */
151
+ needsInitTextSearch?: boolean;
152
+ /**
153
+ * Return the admin capabilities of this driver.
154
+ * @see SQLAdmin
155
+ * @see DocumentAdmin
156
+ * @see SchemaAdmin
157
+ */
158
+ 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
+ }
169
+ //# sourceMappingURL=data_driver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data_driver.d.ts","sourceRoot":"","sources":["../../../../../types/src/controllers/data_driver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC9F,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,gBAAgB,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;CACxC;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAA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,12 @@
1
+ /**
2
+ * @module database_admin
3
+ *
4
+ * Re-exports the capability-specific admin interfaces from `@rebasepro/types/backend`.
5
+ * This file is kept for backwards compatibility — new code should import from
6
+ * `@rebasepro/types` directly.
7
+ *
8
+ * @group Admin
9
+ */
10
+ export type { SQLAdmin, DocumentAdmin, SchemaAdmin, DatabaseAdmin, HealthCheckResult, } from "../types/backend";
11
+ export { isSQLAdmin, isDocumentAdmin, isSchemaAdmin, } from "../types/backend";
12
+ //# sourceMappingURL=database_admin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database_admin.d.ts","sourceRoot":"","sources":["../../../../../types/src/controllers/database_admin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,YAAY,EACR,QAAQ,EACR,aAAa,EACb,WAAW,EACX,aAAa,EACb,iBAAiB,GACpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACH,UAAU,EACV,eAAe,EACf,aAAa,GAChB,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,37 @@
1
+ import React from "react";
2
+ /**
3
+ * Controller to open the side dialog
4
+ * @group Hooks and utilities
5
+ */
6
+ export interface DialogsController {
7
+ /**
8
+ * Close the last dialog
9
+ */
10
+ close: () => void;
11
+ /**
12
+ * Open a dialog
13
+ * @param props
14
+ */
15
+ open: <T extends object = object>(props: DialogControllerEntryProps<T>) => {
16
+ closeDialog: () => void;
17
+ };
18
+ }
19
+ /**
20
+ * Props used to open a side dialog
21
+ * @group Hooks and utilities
22
+ */
23
+ export interface DialogControllerEntryProps<T extends object = object> {
24
+ key: string;
25
+ /**
26
+ * The component type that will be rendered
27
+ */
28
+ Component: React.ComponentType<{
29
+ open: boolean;
30
+ closeDialog: () => void;
31
+ } & T>;
32
+ /**
33
+ * Props to pass to the dialog component
34
+ */
35
+ props?: T;
36
+ }
37
+ //# sourceMappingURL=dialogs_controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialogs_controller.d.ts","sourceRoot":"","sources":["../../../../../types/src/controllers/dialogs_controller.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAE9B;;OAEG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;IAElB;;;OAGG;IACH,IAAI,EAAE,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,0BAA0B,CAAC,CAAC,CAAC,KAAK;QAAE,WAAW,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;CAC1G;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAEjE,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,MAAM,IAAI,CAAA;KAAE,GAAG,CAAC,CAAC,CAAC;IAC/E;;OAEG;IACH,KAAK,CAAC,EAAE,CAAC,CAAC;CAEb"}
@@ -0,0 +1,5 @@
1
+ export interface EffectiveRoleController {
2
+ effectiveRole: string | null;
3
+ setEffectiveRole: (role: string | null) => void;
4
+ }
5
+ //# sourceMappingURL=effective_role.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effective_role.d.ts","sourceRoot":"","sources":["../../../../../types/src/controllers/effective_role.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACpC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACnD"}
@@ -0,0 +1,18 @@
1
+ export * from "./collection_registry";
2
+ export * from "./analytics_controller";
3
+ export * from "./auth";
4
+ export * from "./data";
5
+ export * from "./database_admin";
6
+ export * from "./data_driver";
7
+ export * from "./local_config_persistence";
8
+ export * from "./navigation";
9
+ export * from "./effective_role";
10
+ export * from "./storage";
11
+ export * from "./client";
12
+ export * from "./customization_controller";
13
+ export * from "./side_entity_controller";
14
+ export * from "./side_dialogs_controller";
15
+ export * from "./dialogs_controller";
16
+ export * from "./snackbar";
17
+ export * from "./registry";
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../types/src/controllers/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,QAAQ,CAAC;AAEvB,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAE9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AAEjC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { EntityCollection } from "../types";
2
+ /**
3
+ * @group Models
4
+ */
5
+ export type PartialEntityCollection<M extends Record<string, any> = any> = Partial<EntityCollection<M>>;
6
+ /**
7
+ * This interface is in charge of defining the controller that persists
8
+ * modifications to a collection or collection, and retrieves them back from
9
+ * a data source, such as local storage or Firestore.
10
+ */
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>;
14
+ recentlyVisitedPaths: string[];
15
+ setRecentlyVisitedPaths: (paths: string[]) => void;
16
+ favouritePaths: string[];
17
+ setFavouritePaths: (paths: string[]) => void;
18
+ collapsedGroups: string[];
19
+ setCollapsedGroups: (paths: string[]) => void;
20
+ }
21
+ //# sourceMappingURL=local_config_persistence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local_config_persistence.d.ts","sourceRoot":"","sources":["../../../../../types/src/controllers/local_config_persistence.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;AAExG;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IACzC,oBAAoB,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,uBAAuB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IACjI,mBAAmB,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,uBAAuB,CAAC,CAAC,CAAC,CAAC;IACvG,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,uBAAuB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnD,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CACjD"}
@@ -0,0 +1,214 @@
1
+ import React from "react";
2
+ import { EntityCollection } from "../types/collections";
3
+ import { RebasePlugin } from "../types/plugins";
4
+ /**
5
+ * Controller that handles URL path building and resolution.
6
+ * @group Models
7
+ */
8
+ export type UrlController = {
9
+ /**
10
+ * Default path under the navigation routes of the CMS will be created.
11
+ * Defaults to '/'. You may want to change this `basepath` to 'admin' for example.
12
+ */
13
+ basePath: string;
14
+ /**
15
+ * Default path under the collection routes of the CMS will be created.
16
+ * It defaults to '/c'
17
+ */
18
+ baseCollectionPath: string;
19
+ /**
20
+ * Convert a URL path to a collection or entity path
21
+ * `/c/products` => `products`
22
+ * `/my_cms/c/products/B34SAP8Z` => `products/B34SAP8Z`
23
+ * `/my_cms/my_view` => `my_view`
24
+ * @param cmsPath
25
+ */
26
+ urlPathToDataPath: (cmsPath: string) => string;
27
+ /**
28
+ * Base url path for the home screen
29
+ */
30
+ homeUrl: string;
31
+ /**
32
+ * Check if a url path belongs to a collection
33
+ * @param path
34
+ */
35
+ isUrlCollectionPath: (urlPath: string) => boolean;
36
+ /**
37
+ * Build a URL collection path from a data path
38
+ * `products` => `/c/products`
39
+ * `products/B34SAP8Z` => `/c/products/B34SAP8Z`
40
+ * @param path
41
+ */
42
+ buildUrlCollectionPath: (path: string) => string;
43
+ /**
44
+ * Build a URL path for the CMS (e.g. for custom views)
45
+ * @param path
46
+ */
47
+ buildAppUrlPath: (path: string) => string;
48
+ /**
49
+ * Turn a path with collection ids into a resolved path.
50
+ * The ids (typically used in urls) will be replaced with relative paths (typically used in database paths)
51
+ * @param path
52
+ */
53
+ resolveDatabasePathsFrom: (path: string) => string;
54
+ /**
55
+ * A function to navigate to a specified route or URL.
56
+ *
57
+ * @param {string} to - The target route or URL to navigate to.
58
+ * @param {NavigateOptions} [options] - Optional configuration settings for navigation, such as replace behavior or state data.
59
+ */
60
+ navigate: (to: string, options?: NavigateOptions) => void;
61
+ };
62
+ /**
63
+ * Controller that manages the state of the navigation menu,
64
+ * including resolved views and top-level grouping.
65
+ * @group Models
66
+ */
67
+ export type NavigationStateController = {
68
+ /**
69
+ * Custom additional views created by the developer, added to the main
70
+ * navigation
71
+ */
72
+ views?: AppView[];
73
+ /**
74
+ * Custom additional views created by the developer, added to the admin
75
+ * navigation
76
+ */
77
+ adminViews?: AppView[];
78
+ /**
79
+ * Configuration for the views that should be displayed at the top
80
+ * level of the navigation (e.g. in the home page or the navigation
81
+ * drawer)
82
+ */
83
+ topLevelNavigation?: NavigationResult;
84
+ /**
85
+ * Is the navigation loading (the configuration persistence has not
86
+ * loaded yet, or a specified navigation builder has not completed)
87
+ */
88
+ loading: boolean;
89
+ /**
90
+ * Was there an error while loading the navigation data
91
+ */
92
+ navigationLoadingError?: unknown;
93
+ /**
94
+ * Call this method to recalculate the navigation
95
+ */
96
+ refreshNavigation: () => void;
97
+ /**
98
+ * Plugin system allowing to extend the CMS functionality.
99
+ */
100
+ plugins?: RebasePlugin[];
101
+ };
102
+ export interface NavigateOptions {
103
+ replace?: boolean;
104
+ state?: unknown;
105
+ preventScrollReset?: boolean;
106
+ relative?: "route" | "path";
107
+ flushSync?: boolean;
108
+ viewTransition?: boolean;
109
+ }
110
+ export type NavigationBlocker = {
111
+ updateBlockListener: (path: string, block: boolean, basePath?: string) => () => void;
112
+ isBlocked: (path: string) => boolean;
113
+ proceed?: () => void;
114
+ reset?: () => void;
115
+ };
116
+ /**
117
+ * Custom additional views created by the developer, added to the main
118
+ * navigation.
119
+ * @group Models
120
+ */
121
+ export interface AppView {
122
+ /**
123
+ * CMS Path you can reach this view from.
124
+ */
125
+ slug: string;
126
+ /**
127
+ * Name of this view
128
+ */
129
+ name: string;
130
+ /**
131
+ * Optional description of this view. You can use Markdown
132
+ */
133
+ description?: string;
134
+ /**
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'
139
+ * Find all the icons in https://rebase.pro/docs/icons
140
+ */
141
+ icon?: string | React.ReactNode;
142
+ /**
143
+ * Should this view be hidden from the main navigation panel.
144
+ * It will still be accessible if you reach the specified path
145
+ */
146
+ hideFromNavigation?: boolean;
147
+ /**
148
+ * Component to be rendered. This can be any React component, and can use
149
+ * any of the provided hooks
150
+ */
151
+ view: React.ReactNode;
152
+ /**
153
+ * Optional field used to group top level navigation entries under a
154
+ * navigation view.
155
+ * This prop is ignored for admin views.
156
+ */
157
+ group?: string;
158
+ /**
159
+ * If true, a wildcard route (slug/*) is automatically registered
160
+ * alongside the base route, enabling nested navigation within this view.
161
+ */
162
+ nestedRoutes?: boolean;
163
+ }
164
+ /**
165
+ * A composable section that can be rendered on the home page.
166
+ * Use this to add custom content alongside the auto-generated
167
+ * navigation groups.
168
+ * @group Models
169
+ */
170
+ export interface HomePageSection {
171
+ /**
172
+ * Unique key for this section.
173
+ */
174
+ key: string;
175
+ /**
176
+ * Title displayed as the section header.
177
+ */
178
+ title: string;
179
+ /**
180
+ * Arbitrary React content rendered inside the section.
181
+ */
182
+ children: React.ReactNode;
183
+ }
184
+ /**
185
+ * Used to group navigation entries in the main navigation.
186
+ */
187
+ export interface NavigationGroupMapping {
188
+ /**
189
+ * Name of the group, used to display the group header in the UI
190
+ */
191
+ name: string;
192
+ /**
193
+ * List of collection ids or view paths that belong to this group.
194
+ */
195
+ entries: string[];
196
+ }
197
+ export interface NavigationEntry {
198
+ id: string;
199
+ url: string;
200
+ name: string;
201
+ slug: string;
202
+ type: "collection" | "view" | "admin";
203
+ collection?: EntityCollection;
204
+ view?: AppView;
205
+ description?: string;
206
+ group: string;
207
+ }
208
+ export type NavigationResult = {
209
+ allowDragAndDrop: boolean;
210
+ navigationEntries: NavigationEntry[];
211
+ groups: string[];
212
+ onNavigationEntriesUpdate: (entries: NavigationGroupMapping[]) => void;
213
+ };
214
+ //# sourceMappingURL=navigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../../types/src/controllers/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC0B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;GAGG;A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;CACrB;AAED,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;IACtC,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,gBAAgB,GAAG;IAE3B,gBAAgB,EAAE,OAAO,CAAC;IAE1B,iBAAiB,EAAE,eAAe,EAAE,CAAC;IAErC,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB,yBAAyB,EAAE,CAAC,OAAO,EAAE,sBAAsB,EAAE,KAAK,IAAI,CAAC;CAC1E,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { ReactNode } from "react";
2
+ import { EntityCollection, EntityCollectionsBuilder, EntityCustomView, EntityAction } from "../types";
3
+ import { AppView } from "./navigation";
4
+ /**
5
+ * Options to enable the built-in collection editor.
6
+ * When provided to `<RebaseCMS>`, the editor is auto-wired as a native feature.
7
+ */
8
+ export interface CollectionEditorOptions {
9
+ /**
10
+ * Function that returns an auth token for schema-editor API calls.
11
+ * Falls back to `authController.getAuthToken` when omitted.
12
+ */
13
+ getAuthToken?: () => Promise<string | null>;
14
+ /** Mark the editor as read-only (disable mutations). */
15
+ readOnly?: boolean;
16
+ /** Suggested base paths shown when creating new collections. */
17
+ pathSuggestions?: string[];
18
+ }
19
+ export interface RebaseCMSConfig<EC extends EntityCollection = any> {
20
+ collections?: EC[] | EntityCollectionsBuilder<EC>;
21
+ homePage?: ReactNode;
22
+ entityViews?: EntityCustomView<any>[];
23
+ entityActions?: EntityAction[];
24
+ plugins?: any[];
25
+ /**
26
+ * Enable the built-in visual collection/schema editor.
27
+ * Pass `true` for zero-config, or an options object for fine-grained control.
28
+ * When enabled, the editor slots, provider, and Studio schema view
29
+ * are all auto-wired — no plugin or manual view injection needed.
30
+ */
31
+ collectionEditor?: boolean | CollectionEditorOptions;
32
+ }
33
+ export interface RebaseStudioConfig {
34
+ tools?: ("sql" | "js" | "rls" | "schema" | "storage")[];
35
+ homePage?: ReactNode;
36
+ devViews?: AppView[];
37
+ }
38
+ export interface RebaseAuthConfig {
39
+ loginView?: ReactNode;
40
+ }
41
+ export interface RebaseRegistryController {
42
+ cmsConfig: RebaseCMSConfig | null;
43
+ studioConfig: RebaseStudioConfig | null;
44
+ authConfig: RebaseAuthConfig | null;
45
+ registerCMS: (config: RebaseCMSConfig) => void;
46
+ unregisterCMS: () => void;
47
+ registerStudio: (config: RebaseStudioConfig) => void;
48
+ unregisterStudio: () => void;
49
+ registerAuth: (config: RebaseAuthConfig) => void;
50
+ unregisterAuth: () => void;
51
+ }
52
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../../types/src/controllers/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACtG,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACpC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC5C,wDAAwD;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gEAAgE;IAChE,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,eAAe,CAAC,EAAE,SAAS,gBAAgB,GAAG,GAAG;IAC9D,WAAW,CAAC,EAAE,EAAE,EAAE,GAAG,wBAAwB,CAAC,EAAE,CAAC,CAAC;IAClD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,WAAW,CAAC,EAAE,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC;IACtC,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;IAEhB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,GAAG,uBAAuB,CAAC;CACxD;AAED,MAAM,WAAW,kBAAkB;IAC/B,KAAK,CAAC,EAAE,CAAC,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC,EAAE,CAAC;IACxD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC7B,SAAS,CAAC,EAAE,SAAS,CAAC;CACzB;AAED,MAAM,WAAW,wBAAwB;IAErC,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;IAClC,YAAY,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACxC,UAAU,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAGpC,WAAW,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IAC/C,aAAa,EAAE,MAAM,IAAI,CAAC;IAE1B,cAAc,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACrD,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAE7B,YAAY,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACjD,cAAc,EAAE,MAAM,IAAI,CAAC;CAC9B"}
@@ -0,0 +1,68 @@
1
+ import React from "react";
2
+ /**
3
+ * Controller to open the side dialog
4
+ * @group Hooks and utilities
5
+ */
6
+ export interface SideDialogsController {
7
+ /**
8
+ * Close the last panel
9
+ */
10
+ close: () => void;
11
+ /**
12
+ * List of side panels currently open
13
+ */
14
+ sidePanels: SideDialogPanelProps[];
15
+ /**
16
+ * Override the current side panels
17
+ * @param panels
18
+ */
19
+ setSidePanels: (panels: SideDialogPanelProps[]) => void;
20
+ /**
21
+ * Open one or multiple side panels
22
+ * @param props
23
+ */
24
+ open: (panelProps: SideDialogPanelProps | SideDialogPanelProps[]) => void;
25
+ /**
26
+ * Replace the last open panel with the given one
27
+ * @param props
28
+ */
29
+ replace: (panelProps: SideDialogPanelProps | SideDialogPanelProps[]) => void;
30
+ }
31
+ /**
32
+ * Props used to open a side dialog
33
+ * @group Hooks and utilities
34
+ */
35
+ export interface SideDialogPanelProps {
36
+ /**
37
+ * A key that identifies this panel
38
+ */
39
+ key: string;
40
+ /**
41
+ * The component type that will be rendered
42
+ */
43
+ component: React.ReactNode;
44
+ /**
45
+ * Optional width of the panel
46
+ */
47
+ width?: string;
48
+ /**
49
+ * When open, change the URL to this path.
50
+ * Note that if you want to restore state from a URL you need to add the
51
+ * logic yourself by listening to URL updates, and probably call `open`.
52
+ */
53
+ urlPath?: string;
54
+ /**
55
+ * If the navigation stack is empty (you landed in the `urlPath` url), what
56
+ * url path to change to when the panel gets closed.
57
+ */
58
+ parentUrlPath?: string;
59
+ /**
60
+ * Callback when the panel is closed
61
+ */
62
+ onClose?: () => void;
63
+ /**
64
+ * Use this prop to store additional data in the panel
65
+ */
66
+ additional?: unknown;
67
+ }
68
+ //# sourceMappingURL=side_dialogs_controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"side_dialogs_controller.d.ts","sourceRoot":"","sources":["../../../../../types/src/controllers/side_dialogs_controller.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IAElC;;OAEG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;IAElB;;OAEG;IACH,UAAU,EAAE,oBAAoB,EAAE,CAAC;IAEnC;;;OAGG;IACH,aAAa,EAAE,CAAC,MAAM,EAAE,oBAAoB,EAAE,KAAK,IAAI,CAAC;IAExD;;;OAGG;IACH,IAAI,EAAE,CAAC,UAAU,EAAE,oBAAoB,GAAG,oBAAoB,EAAE,KAAK,IAAI,CAAC;IAE1E;;;OAGG;IACH,OAAO,EAAE,CAAC,UAAU,EAAE,oBAAoB,GAAG,oBAAoB,EAAE,KAAK,IAAI,CAAC;CAChF;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IAEjC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CAExB"}