@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,90 @@
1
+ import { Entity, EntityCollection } from "../types";
2
+ /**
3
+ * Props used to open a side dialog
4
+ * @group Hooks and utilities
5
+ */
6
+ export interface EntitySidePanelProps<M extends Record<string, any> = any> {
7
+ /**
8
+ * Absolute path of the entity
9
+ */
10
+ path: string;
11
+ /**
12
+ * ID of the entity, if not set, it means we are creating a new entity
13
+ */
14
+ entityId?: string | number;
15
+ /**
16
+ * Set this flag to true if you want to make a copy of an existing entity
17
+ */
18
+ copy?: boolean;
19
+ /**
20
+ * Open the entity with a selected sub-collection view. If the panel for this
21
+ * entity was already open, it is replaced.
22
+ */
23
+ selectedTab?: string;
24
+ /**
25
+ * Use this prop to override the width of the form view.
26
+ * e.g. "600px"
27
+ */
28
+ width?: number | string;
29
+ /**
30
+ * Collection representing the entities of this view.
31
+ * If you leave it blank it will be induced by your navigation
32
+ */
33
+ collection?: EntityCollection<M>;
34
+ /**
35
+ * Should update the URL when opening the dialog.
36
+ * Consider that if the collection that you provide is not defined in the base
37
+ * config of your `Rebase` component, you will not be able to recreate
38
+ * the state if copying the URL to a different window.
39
+ */
40
+ updateUrl?: boolean;
41
+ /**
42
+ * Callback when the entity is updated
43
+ * @param params
44
+ */
45
+ onUpdate?: (params: {
46
+ entity: Entity<any>;
47
+ }) => void;
48
+ /**
49
+ * Callback when the dialog is closed
50
+ */
51
+ onClose?: () => void;
52
+ /**
53
+ * Should this panel close when saving
54
+ */
55
+ closeOnSave?: boolean;
56
+ /**
57
+ * Override some form properties
58
+ */
59
+ formProps?: any;
60
+ /**
61
+ * Allow the user to open the entity fullscreen
62
+ */
63
+ allowFullScreen?: boolean;
64
+ }
65
+ /**
66
+ * Controller to open the side dialog displaying entity forms
67
+ * @group Hooks and utilities
68
+ */
69
+ export interface SideEntityController {
70
+ /**
71
+ * Close the last panel
72
+ */
73
+ close: () => void;
74
+ /**
75
+ * Open a new entity sideDialog. By default, the collection and configuration
76
+ * of the view is fetched from the collections you have specified in the
77
+ * navigation.
78
+ * At least you need to pass the path of the entity you would like
79
+ * to edit. You can set an entityId if you would like to edit and existing one
80
+ * (or a new one with that id).
81
+ * @param props
82
+ */
83
+ open: <M extends Record<string, any> = any>(props: EntitySidePanelProps<M>) => void;
84
+ /**
85
+ * Replace the last open entity panel with the given one.
86
+ * @param props
87
+ */
88
+ replace: <M extends Record<string, any> = any>(props: EntitySidePanelProps<M>) => void;
89
+ }
90
+ //# sourceMappingURL=side_entity_controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"side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AGG;IACH,OAAO,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CAC1F"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Possible snackbar types
3
+ * @group Hooks and utilities
4
+ */
5
+ export type SnackbarMessageType = "success" | "info" | "warning" | "error";
6
+ /**
7
+ * Controller to display snackbars
8
+ * @group Hooks and utilities
9
+ */
10
+ export interface SnackbarController {
11
+ /**
12
+ * Close the currently open snackbar
13
+ */
14
+ close: () => void;
15
+ /**
16
+ * Display a new snackbar. You need to specify the type and message.
17
+ * You can optionally specify a title
18
+ */
19
+ open: (props: {
20
+ type: SnackbarMessageType;
21
+ message: React.ReactNode;
22
+ autoHideDuration?: number;
23
+ }) => void;
24
+ }
25
+ //# sourceMappingURL=snackbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snackbar.d.ts","sourceRoot":"","sources":["../../../../../types/src/controllers/snackbar.ts"],"names":[],"mappings":"AACA;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAE3E;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAE/B;;OAEG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;IAElB;;;OAGG;IACH,IAAI,EAAE,CAAC,KAAK,EAAE;QACV,IAAI,EAAE,mBAAmB,CAAC;QAC1B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;QACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC7B,KAAK,IAAI,CAAC;CAEd"}
@@ -0,0 +1,174 @@
1
+ /**
2
+ * @group Models
3
+ */
4
+ export interface UploadFileProps {
5
+ file: File;
6
+ fileName?: string;
7
+ path?: string;
8
+ metadata?: Record<string, unknown>;
9
+ bucket?: string;
10
+ }
11
+ /**
12
+ * @group Models
13
+ */
14
+ export interface UploadFileResult {
15
+ /**
16
+ * Storage path including the file name where the file was uploaded.
17
+ */
18
+ path: string;
19
+ /**
20
+ * Bucket where the file was uploaded
21
+ */
22
+ bucket: string;
23
+ /**
24
+ * Fully qualified storage URL for the uploaded file.
25
+ *
26
+ * For example: `gs://my-bucket/path/to/file.png`.
27
+ *
28
+ * This is optional for backwards compatibility.
29
+ */
30
+ storageUrl?: string;
31
+ }
32
+ /**
33
+ * @group Models
34
+ */
35
+ export interface DownloadConfig {
36
+ /**
37
+ * Temporal url that can be used to download the file
38
+ */
39
+ url: string | null;
40
+ metadata?: DownloadMetadata;
41
+ fileNotFound?: boolean;
42
+ }
43
+ /**
44
+ * The full set of object metadata, including read-only properties.
45
+ * @public
46
+ */
47
+ export declare interface DownloadMetadata {
48
+ /**
49
+ * The bucket this object is contained in.
50
+ */
51
+ bucket: string;
52
+ /**
53
+ * The full path of this object.
54
+ */
55
+ fullPath: string;
56
+ /**
57
+ * The short name of this object, which is the last component of the full path.
58
+ * For example, if path is 'full/path/image.png', name is 'image.png'.
59
+ */
60
+ name: string;
61
+ /**
62
+ * The size of this object, in bytes.
63
+ */
64
+ size: number;
65
+ /**
66
+ * Type of the uploaded file
67
+ * e.g. "image/jpeg"
68
+ */
69
+ contentType: string;
70
+ customMetadata: Record<string, unknown>;
71
+ }
72
+ /**
73
+ * @group Models
74
+ */
75
+ export interface StorageSource {
76
+ /**
77
+ * Upload a file, specifying a name and a path
78
+ * @param file
79
+ * @param fileName
80
+ * @param path
81
+ * @param metadata
82
+ * @param bucket
83
+ */
84
+ uploadFile: ({ file, fileName, path, metadata, bucket }: UploadFileProps) => Promise<UploadFileResult>;
85
+ /**
86
+ * Convert a storage path or URL into a download configuration
87
+ * @param path
88
+ * @param bucket
89
+ */
90
+ getDownloadURL: (pathOrUrl: string, bucket?: string) => Promise<DownloadConfig>;
91
+ /**
92
+ * Get a file from a storage path.
93
+ * It returns null if the file does not exist.
94
+ * @param props
95
+ * @param bucket
96
+ */
97
+ getFile: (path: string, bucket?: string) => Promise<File | null>;
98
+ /**
99
+ * Delete a file.
100
+ * @param path
101
+ * @param bucket
102
+ */
103
+ deleteFile: (path: string, bucket?: string) => Promise<void>;
104
+ /**
105
+ * List the contents of a path.
106
+ * @param path
107
+ * @param options
108
+ */
109
+ list: (path: string, options?: {
110
+ bucket?: string;
111
+ maxResults?: number;
112
+ pageToken?: string;
113
+ }) => Promise<StorageListResult>;
114
+ }
115
+ /**
116
+ * Result returned by list().
117
+ * @public
118
+ */
119
+ export declare interface StorageListResult {
120
+ /**
121
+ * References to prefixes (sub-folders). You can call list() on them to
122
+ * get its contents.
123
+ *
124
+ * Folders are implicit based on '/' in the object paths.
125
+ * For example, if a bucket has two objects '/a/b/1' and '/a/b/2', list('/a')
126
+ * will return '/a/b' as a prefix.
127
+ */
128
+ prefixes: StorageReference[];
129
+ /**
130
+ * Objects in this directory.
131
+ * You can call getMetadata() and getDownloadUrl() on them.
132
+ */
133
+ items: StorageReference[];
134
+ /**
135
+ * If set, there might be more results for this list. Use this token to resume the list.
136
+ */
137
+ nextPageToken?: string;
138
+ }
139
+ /**
140
+ * Represents a reference to a Google Cloud Storage object. Developers can
141
+ * upload, download, and delete objects, as well as get/set object metadata.
142
+ * @public
143
+ */
144
+ export declare interface StorageReference {
145
+ /**
146
+ * Returns a gs:// URL for this object in the form
147
+ * `gs://<bucket>/<path>/<to>/<object>`
148
+ * @returns The gs:// URL.
149
+ */
150
+ toString(): string;
151
+ /**
152
+ * A reference to the root of this object's bucket.
153
+ */
154
+ root: StorageReference;
155
+ /**
156
+ * The name of the bucket containing this reference's object.
157
+ */
158
+ bucket: string;
159
+ /**
160
+ * The full path of this object.
161
+ */
162
+ fullPath: string;
163
+ /**
164
+ * The short name of this object, which is the last component of the full path.
165
+ * For example, if path is 'full/path/image.png', name is 'image.png'.
166
+ */
167
+ name: string;
168
+ /**
169
+ * A reference pointing to the parent location of this reference, or null if
170
+ * this reference is the root.
171
+ */
172
+ parent: StorageReference | null;
173
+ }
174
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../../types/src/controllers/storage.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B;;OAEG;IACH,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAE5B,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,WAAW,gBAAgB;IACrC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B;;;;;;;OAOG;IACH,UAAU,EAAE,CAAC,EACI,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,MAAM,EACT,EAAE,eAAe,KAA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 @@
1
+ export * from "./rebase_context";
2
+ export * from "./types";
3
+ export * from "./controllers";
4
+ export * from "./users";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../types/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,102 @@
1
+ import { AnalyticsController, AuthController, StorageSource, UserConfigurationPersistence, DatabaseAdmin } from "./controllers";
2
+ import { RebaseData } from "./controllers/data";
3
+ import { User } from "./users";
4
+ import { UserManagementDelegate } from "./types/user_management_delegate";
5
+ /**
6
+ * Context that is provided to entity callbacks (hooks).
7
+ * It contains only the dependencies that are available in both the frontend and the backend.
8
+ * @group Hooks and utilities
9
+ */
10
+ export type RebaseCallContext<USER extends User = User> = {
11
+ /**
12
+ * Unified data access — `context.data.products.create(...)`.
13
+ * Access any collection as a dynamic property.
14
+ */
15
+ data: RebaseData;
16
+ /**
17
+ * Used storage implementation
18
+ */
19
+ storageSource: StorageSource;
20
+ /**
21
+ * Set by the backend when callbacks are executed on the server.
22
+ */
23
+ user?: USER;
24
+ };
25
+ /**
26
+ * Context that includes the internal controllers and contexts used by the app.
27
+ * Some controllers and context included in this context can be accessed
28
+ * directly from their respective hooks.
29
+ * @group Hooks and utilities
30
+ * @see useRebaseContext
31
+ */
32
+ export type RebaseContext<USER extends User = User, AuthControllerType extends AuthController<USER> = AuthController<USER>> = RebaseCallContext<USER> & {
33
+ authController: AuthControllerType;
34
+ /**
35
+ * Controller mapping strings to collections
36
+ */
37
+ collectionRegistryController?: import("./controllers/collection_registry").CollectionRegistryController;
38
+ /**
39
+ * Controller for navigation state
40
+ */
41
+ navigationStateController?: import("./controllers/navigation").NavigationStateController;
42
+ /**
43
+ * Controller for side dialogs (side sheets)
44
+ */
45
+ sideDialogsController?: import("./controllers/side_dialogs_controller").SideDialogsController;
46
+ /**
47
+ * Controller to open the side dialog displaying entity forms
48
+ */
49
+ sideEntityController?: import("./controllers/side_entity_controller").SideEntityController;
50
+ /**
51
+ * Controller resolving URLs in the CMS
52
+ */
53
+ urlController?: import("./controllers/navigation").UrlController;
54
+ /**
55
+ * Controller to handle simple confirmation and alert dialogs
56
+ */
57
+ dialogsController?: import("./controllers/dialogs_controller").DialogsController;
58
+ /**
59
+ * Controller for CMS customization
60
+ */
61
+ customizationController?: import("./controllers/customization_controller").CustomizationController;
62
+ /**
63
+ * Controller for effective role
64
+ */
65
+ effectiveRoleController?: {
66
+ effectiveRole: string | null;
67
+ setEffectiveRole: (role: string | null) => void;
68
+ };
69
+ /**
70
+ * Use this controller to access data stored in the browser for the user
71
+ */
72
+ userConfigPersistence?: UserConfigurationPersistence;
73
+ /**
74
+ * Callback to send analytics events
75
+ */
76
+ analyticsController?: AnalyticsController;
77
+ /**
78
+ * This section is used to manage users in the CMS.
79
+ * It is used to show user information in various places of the CMS,
80
+ * for example, to show who created or modified an entity,
81
+ * or to assign ownership of an entity.
82
+ *
83
+ * In the base CMS, this information is not used for access control.
84
+ * You can pass your own implementation of this section, to populate
85
+ * the dropdown of users when assigning ownership of an entity,
86
+ * or to show more information about the user.
87
+ *
88
+ * If you are using the Rebase user management plugin, this
89
+ * section will be implemented automatically.
90
+ */
91
+ userManagement?: UserManagementDelegate<USER>;
92
+ /**
93
+ * Administrative database operations (SQL, schema discovery).
94
+ * Only available in developer/admin contexts.
95
+ */
96
+ databaseAdmin?: DatabaseAdmin;
97
+ /**
98
+ * Controller for snackbars
99
+ */
100
+ snackbarController?: import("./controllers/snackbar").SnackbarController;
101
+ };
102
+ //# sourceMappingURL=rebase_context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rebase_context.d.ts","sourceRoot":"","sources":["../../../../types/src/rebase_context.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,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