@rebasepro/server-postgresql 0.5.0 → 0.6.1

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 (169) hide show
  1. package/dist/{server-postgresql/src/PostgresAdapter.d.ts → PostgresAdapter.d.ts} +1 -1
  2. package/dist/{server-postgresql/src/PostgresBackendDriver.d.ts → PostgresBackendDriver.d.ts} +2 -2
  3. package/dist/{server-postgresql/src/PostgresBootstrapper.d.ts → PostgresBootstrapper.d.ts} +11 -1
  4. package/dist/{server-postgresql/src/collections → collections}/PostgresCollectionRegistry.d.ts +4 -0
  5. package/dist/index.es.js +10207 -11145
  6. package/dist/index.es.js.map +1 -1
  7. package/dist/{server-postgresql/src/services → services}/EntityPersistService.d.ts +0 -14
  8. package/dist/utils/pg-array-null-patch.d.ts +16 -0
  9. package/dist/utils/pg-error-utils.d.ts +55 -0
  10. package/package.json +24 -21
  11. package/src/PostgresAdapter.ts +9 -10
  12. package/src/PostgresBackendDriver.ts +134 -121
  13. package/src/PostgresBootstrapper.ts +100 -30
  14. package/src/auth/ensure-tables.ts +28 -5
  15. package/src/auth/services.ts +28 -18
  16. package/src/cli.ts +99 -96
  17. package/src/collections/PostgresCollectionRegistry.ts +7 -0
  18. package/src/connection.ts +11 -6
  19. package/src/data-transformer.ts +25 -15
  20. package/src/databasePoolManager.ts +3 -2
  21. package/src/history/HistoryService.ts +3 -2
  22. package/src/history/ensure-history-table.ts +5 -4
  23. package/src/schema/auth-schema.ts +1 -2
  24. package/src/schema/doctor-cli.ts +2 -1
  25. package/src/schema/doctor.ts +40 -37
  26. package/src/schema/generate-drizzle-schema-logic.ts +56 -18
  27. package/src/schema/generate-drizzle-schema.ts +11 -11
  28. package/src/schema/introspect-db-inference.ts +25 -25
  29. package/src/schema/introspect-db-logic.ts +38 -38
  30. package/src/schema/introspect-db.ts +28 -27
  31. package/src/services/BranchService.ts +14 -0
  32. package/src/services/EntityFetchService.ts +28 -25
  33. package/src/services/EntityPersistService.ts +19 -149
  34. package/src/services/RelationService.ts +57 -37
  35. package/src/services/entity-helpers.ts +6 -2
  36. package/src/services/realtimeService.ts +45 -32
  37. package/src/utils/drizzle-conditions.ts +31 -15
  38. package/src/utils/pg-array-null-patch.ts +42 -0
  39. package/src/utils/pg-error-utils.ts +211 -0
  40. package/src/websocket.ts +15 -12
  41. package/test/array-null-safety.test.ts +335 -0
  42. package/test/auth-services.test.ts +36 -19
  43. package/test/batch-many-to-many-regression.test.ts +119 -39
  44. package/test/data-transformer-hardening.test.ts +67 -33
  45. package/test/data-transformer.test.ts +57 -4
  46. package/test/doctor.test.ts +10 -5
  47. package/test/drizzle-conditions.test.ts +59 -6
  48. package/test/generate-drizzle-schema.test.ts +65 -40
  49. package/test/introspect-db-generation.test.ts +179 -81
  50. package/test/introspect-db-utils.test.ts +92 -37
  51. package/test/mocks/chalk.cjs +7 -0
  52. package/test/pg-array-null-patch.test.ts +65 -0
  53. package/test/pg-error-utils.test.ts +221 -0
  54. package/test/postgresDataDriver.test.ts +14 -5
  55. package/test/property-ordering.test.ts +126 -79
  56. package/test/realtimeService.test.ts +6 -2
  57. package/test/relation-pipeline-gaps.test.ts +84 -36
  58. package/test/relations.test.ts +247 -0
  59. package/test/unmapped-tables-safety.test.ts +14 -6
  60. package/test/websocket.test.ts +1 -1
  61. package/tsconfig.json +5 -0
  62. package/tsconfig.prod.json +3 -0
  63. package/vite.config.ts +12 -10
  64. package/dist/common/src/collections/CollectionRegistry.d.ts +0 -56
  65. package/dist/common/src/collections/default-collections.d.ts +0 -9
  66. package/dist/common/src/collections/index.d.ts +0 -2
  67. package/dist/common/src/data/buildRebaseData.d.ts +0 -14
  68. package/dist/common/src/data/query_builder.d.ts +0 -55
  69. package/dist/common/src/index.d.ts +0 -4
  70. package/dist/common/src/util/builders.d.ts +0 -57
  71. package/dist/common/src/util/callbacks.d.ts +0 -6
  72. package/dist/common/src/util/collections.d.ts +0 -11
  73. package/dist/common/src/util/common.d.ts +0 -2
  74. package/dist/common/src/util/conditions.d.ts +0 -26
  75. package/dist/common/src/util/entities.d.ts +0 -58
  76. package/dist/common/src/util/enums.d.ts +0 -3
  77. package/dist/common/src/util/index.d.ts +0 -16
  78. package/dist/common/src/util/navigation_from_path.d.ts +0 -34
  79. package/dist/common/src/util/navigation_utils.d.ts +0 -20
  80. package/dist/common/src/util/parent_references_from_path.d.ts +0 -6
  81. package/dist/common/src/util/paths.d.ts +0 -14
  82. package/dist/common/src/util/permissions.d.ts +0 -14
  83. package/dist/common/src/util/references.d.ts +0 -2
  84. package/dist/common/src/util/relations.d.ts +0 -22
  85. package/dist/common/src/util/resolutions.d.ts +0 -72
  86. package/dist/common/src/util/storage.d.ts +0 -24
  87. package/dist/index.umd.js +0 -11749
  88. package/dist/index.umd.js.map +0 -1
  89. package/dist/types/src/controllers/analytics_controller.d.ts +0 -7
  90. package/dist/types/src/controllers/auth.d.ts +0 -104
  91. package/dist/types/src/controllers/client.d.ts +0 -168
  92. package/dist/types/src/controllers/collection_registry.d.ts +0 -46
  93. package/dist/types/src/controllers/customization_controller.d.ts +0 -60
  94. package/dist/types/src/controllers/data.d.ts +0 -207
  95. package/dist/types/src/controllers/data_driver.d.ts +0 -218
  96. package/dist/types/src/controllers/database_admin.d.ts +0 -11
  97. package/dist/types/src/controllers/dialogs_controller.d.ts +0 -36
  98. package/dist/types/src/controllers/effective_role.d.ts +0 -4
  99. package/dist/types/src/controllers/email.d.ts +0 -36
  100. package/dist/types/src/controllers/index.d.ts +0 -18
  101. package/dist/types/src/controllers/local_config_persistence.d.ts +0 -20
  102. package/dist/types/src/controllers/navigation.d.ts +0 -225
  103. package/dist/types/src/controllers/registry.d.ts +0 -63
  104. package/dist/types/src/controllers/side_dialogs_controller.d.ts +0 -67
  105. package/dist/types/src/controllers/side_entity_controller.d.ts +0 -97
  106. package/dist/types/src/controllers/snackbar.d.ts +0 -24
  107. package/dist/types/src/controllers/storage.d.ts +0 -171
  108. package/dist/types/src/index.d.ts +0 -4
  109. package/dist/types/src/rebase_context.d.ts +0 -122
  110. package/dist/types/src/types/auth_adapter.d.ts +0 -301
  111. package/dist/types/src/types/backend.d.ts +0 -571
  112. package/dist/types/src/types/backend_hooks.d.ts +0 -172
  113. package/dist/types/src/types/builders.d.ts +0 -15
  114. package/dist/types/src/types/chips.d.ts +0 -5
  115. package/dist/types/src/types/collections.d.ts +0 -961
  116. package/dist/types/src/types/component_ref.d.ts +0 -47
  117. package/dist/types/src/types/cron.d.ts +0 -102
  118. package/dist/types/src/types/data_source.d.ts +0 -64
  119. package/dist/types/src/types/database_adapter.d.ts +0 -94
  120. package/dist/types/src/types/entities.d.ts +0 -145
  121. package/dist/types/src/types/entity_actions.d.ts +0 -104
  122. package/dist/types/src/types/entity_callbacks.d.ts +0 -173
  123. package/dist/types/src/types/entity_link_builder.d.ts +0 -7
  124. package/dist/types/src/types/entity_overrides.d.ts +0 -10
  125. package/dist/types/src/types/entity_views.d.ts +0 -87
  126. package/dist/types/src/types/export_import.d.ts +0 -21
  127. package/dist/types/src/types/formex.d.ts +0 -40
  128. package/dist/types/src/types/index.d.ts +0 -28
  129. package/dist/types/src/types/locales.d.ts +0 -4
  130. package/dist/types/src/types/modify_collections.d.ts +0 -5
  131. package/dist/types/src/types/plugins.d.ts +0 -282
  132. package/dist/types/src/types/properties.d.ts +0 -1173
  133. package/dist/types/src/types/property_config.d.ts +0 -74
  134. package/dist/types/src/types/relations.d.ts +0 -336
  135. package/dist/types/src/types/slots.d.ts +0 -262
  136. package/dist/types/src/types/translations.d.ts +0 -900
  137. package/dist/types/src/types/user_management_delegate.d.ts +0 -86
  138. package/dist/types/src/types/websockets.d.ts +0 -78
  139. package/dist/types/src/users/index.d.ts +0 -1
  140. package/dist/types/src/users/user.d.ts +0 -50
  141. /package/dist/{server-postgresql/src/auth → auth}/ensure-tables.d.ts +0 -0
  142. /package/dist/{server-postgresql/src/auth → auth}/services.d.ts +0 -0
  143. /package/dist/{server-postgresql/src/cli.d.ts → cli.d.ts} +0 -0
  144. /package/dist/{server-postgresql/src/connection.d.ts → connection.d.ts} +0 -0
  145. /package/dist/{server-postgresql/src/data-transformer.d.ts → data-transformer.d.ts} +0 -0
  146. /package/dist/{server-postgresql/src/databasePoolManager.d.ts → databasePoolManager.d.ts} +0 -0
  147. /package/dist/{server-postgresql/src/history → history}/HistoryService.d.ts +0 -0
  148. /package/dist/{server-postgresql/src/history → history}/ensure-history-table.d.ts +0 -0
  149. /package/dist/{server-postgresql/src/index.d.ts → index.d.ts} +0 -0
  150. /package/dist/{server-postgresql/src/interfaces.d.ts → interfaces.d.ts} +0 -0
  151. /package/dist/{server-postgresql/src/schema → schema}/auth-schema.d.ts +0 -0
  152. /package/dist/{server-postgresql/src/schema → schema}/doctor-cli.d.ts +0 -0
  153. /package/dist/{server-postgresql/src/schema → schema}/doctor.d.ts +0 -0
  154. /package/dist/{server-postgresql/src/schema → schema}/generate-drizzle-schema-logic.d.ts +0 -0
  155. /package/dist/{server-postgresql/src/schema → schema}/generate-drizzle-schema.d.ts +0 -0
  156. /package/dist/{server-postgresql/src/schema → schema}/introspect-db-inference.d.ts +0 -0
  157. /package/dist/{server-postgresql/src/schema → schema}/introspect-db-logic.d.ts +0 -0
  158. /package/dist/{server-postgresql/src/schema → schema}/introspect-db.d.ts +0 -0
  159. /package/dist/{server-postgresql/src/schema → schema}/test-schema.d.ts +0 -0
  160. /package/dist/{server-postgresql/src/services → services}/BranchService.d.ts +0 -0
  161. /package/dist/{server-postgresql/src/services → services}/EntityFetchService.d.ts +0 -0
  162. /package/dist/{server-postgresql/src/services → services}/RelationService.d.ts +0 -0
  163. /package/dist/{server-postgresql/src/services → services}/entity-helpers.d.ts +0 -0
  164. /package/dist/{server-postgresql/src/services → services}/entityService.d.ts +0 -0
  165. /package/dist/{server-postgresql/src/services → services}/index.d.ts +0 -0
  166. /package/dist/{server-postgresql/src/services → services}/realtimeService.d.ts +0 -0
  167. /package/dist/{server-postgresql/src/types.d.ts → types.d.ts} +0 -0
  168. /package/dist/{server-postgresql/src/utils → utils}/drizzle-conditions.d.ts +0 -0
  169. /package/dist/{server-postgresql/src/websocket.d.ts → websocket.d.ts} +0 -0
@@ -1,67 +0,0 @@
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
- }
@@ -1,97 +0,0 @@
1
- import type { Entity } from "../types/entities";
2
- import type { EntityCollection } from "../types/collections";
3
- /**
4
- * Props used to open a side dialog
5
- * @group Hooks and utilities
6
- */
7
- export interface EntitySidePanelProps<M extends Record<string, unknown> = Record<string, unknown>> {
8
- /**
9
- * Absolute path of the entity
10
- */
11
- path: string;
12
- /**
13
- * ID of the entity, if not set, it means we are creating a new entity
14
- */
15
- entityId?: string | number;
16
- /**
17
- * Set this flag to true if you want to make a copy of an existing entity
18
- */
19
- copy?: boolean;
20
- /**
21
- * Open the entity with a selected sub-collection view. If the panel for this
22
- * entity was already open, it is replaced.
23
- */
24
- selectedTab?: string;
25
- /**
26
- * Use this prop to override the width of the form view.
27
- * e.g. "600px"
28
- */
29
- width?: number | string;
30
- /**
31
- * Collection representing the entities of this view.
32
- * If you leave it blank it will be induced by your navigation
33
- */
34
- collection?: EntityCollection<M>;
35
- /**
36
- * Should update the URL when opening the dialog.
37
- * Consider that if the collection that you provide is not defined in the base
38
- * config of your `Rebase` component, you will not be able to recreate
39
- * the state if copying the URL to a different window.
40
- */
41
- updateUrl?: boolean;
42
- /**
43
- * Callback when the entity is updated
44
- * @param params
45
- */
46
- onUpdate?: (params: {
47
- entity: Entity<M>;
48
- }) => void;
49
- /**
50
- * Callback when the dialog is closed
51
- */
52
- onClose?: () => void;
53
- /**
54
- * Should this panel close when saving
55
- */
56
- closeOnSave?: boolean;
57
- /**
58
- * Override some form properties
59
- */
60
- formProps?: Record<string, unknown>;
61
- /**
62
- * Allow the user to open the entity fullscreen
63
- */
64
- allowFullScreen?: boolean;
65
- /**
66
- * Pre-populate the form with these values when creating a new entity.
67
- * Only applied when `entityId` is not set (i.e. the form is in "new" mode).
68
- * Useful for actions that fetch data from an external source (e.g. a URL)
69
- * and want to pre-fill the document before the user saves.
70
- */
71
- defaultValues?: Partial<M>;
72
- }
73
- /**
74
- * Controller to open the side dialog displaying entity forms
75
- * @group Hooks and utilities
76
- */
77
- export interface SideEntityController {
78
- /**
79
- * Close the last panel
80
- */
81
- close: () => void;
82
- /**
83
- * Open a new entity sideDialog. By default, the collection and configuration
84
- * of the view is fetched from the collections you have specified in the
85
- * navigation.
86
- * At least you need to pass the path of the entity you would like
87
- * to edit. You can set an entityId if you would like to edit and existing one
88
- * (or a new one with that id).
89
- * @param props
90
- */
91
- open: <M extends Record<string, unknown> = Record<string, unknown>>(props: EntitySidePanelProps<M>) => void;
92
- /**
93
- * Replace the last open entity panel with the given one.
94
- * @param props
95
- */
96
- replace: <M extends Record<string, unknown> = Record<string, unknown>>(props: EntitySidePanelProps<M>) => void;
97
- }
@@ -1,24 +0,0 @@
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
- }
@@ -1,171 +0,0 @@
1
- /**
2
- * @group Models
3
- */
4
- export interface UploadFileProps {
5
- file: File;
6
- key: string;
7
- metadata?: Record<string, unknown>;
8
- bucket?: string;
9
- }
10
- /**
11
- * @group Models
12
- */
13
- export interface UploadFileResult {
14
- /**
15
- * Storage key including the file name where the file was uploaded.
16
- */
17
- key: string;
18
- /**
19
- * Bucket where the file was uploaded
20
- */
21
- bucket: string;
22
- /**
23
- * Fully qualified storage URL for the uploaded file.
24
- *
25
- * For example: `s3://my-bucket/path/to/file.png`.
26
- *
27
- * This is optional for backwards compatibility.
28
- */
29
- storageUrl?: string;
30
- }
31
- /**
32
- * @group Models
33
- */
34
- export interface DownloadConfig {
35
- /**
36
- * Temporal url that can be used to download the file
37
- */
38
- url: string | null;
39
- metadata?: DownloadMetadata;
40
- fileNotFound?: boolean;
41
- }
42
- /**
43
- * The full set of object metadata, including read-only properties.
44
- * @public
45
- */
46
- export declare interface DownloadMetadata {
47
- /**
48
- * The bucket this object is contained in.
49
- */
50
- bucket: string;
51
- /**
52
- * The full path of this object.
53
- */
54
- fullPath: string;
55
- /**
56
- * The short name of this object, which is the last component of the full path.
57
- * For example, if path is 'full/path/image.png', name is 'image.png'.
58
- */
59
- name: string;
60
- /**
61
- * The size of this object, in bytes.
62
- */
63
- size: number;
64
- /**
65
- * Type of the uploaded file
66
- * e.g. "image/jpeg"
67
- */
68
- contentType: string;
69
- customMetadata: Record<string, unknown>;
70
- }
71
- /**
72
- * @group Models
73
- */
74
- export interface StorageSource {
75
- /**
76
- * Upload an object, specifying a key
77
- * @param file
78
- * @param key
79
- * @param metadata
80
- * @param bucket
81
- */
82
- putObject: ({ file, key, metadata, bucket }: UploadFileProps) => Promise<UploadFileResult>;
83
- /**
84
- * Convert a storage key or URL into a download configuration (signed URL equivalent)
85
- * @param keyOrUrl
86
- * @param bucket
87
- */
88
- getSignedUrl: (keyOrUrl: string, bucket?: string) => Promise<DownloadConfig>;
89
- /**
90
- * Get an object from a storage key.
91
- * It returns null if the object does not exist.
92
- * @param key
93
- * @param bucket
94
- */
95
- getObject: (key: string, bucket?: string) => Promise<File | null>;
96
- /**
97
- * Delete an object.
98
- * @param key
99
- * @param bucket
100
- */
101
- deleteObject: (key: string, bucket?: string) => Promise<void>;
102
- /**
103
- * List the contents of a prefix.
104
- * @param prefix
105
- * @param options
106
- */
107
- listObjects: (prefix: string, options?: {
108
- bucket?: string;
109
- maxResults?: number;
110
- pageToken?: string;
111
- }) => Promise<StorageListResult>;
112
- }
113
- /**
114
- * Result returned by list().
115
- * @public
116
- */
117
- export declare interface StorageListResult {
118
- /**
119
- * References to prefixes (sub-folders). You can call list() on them to
120
- * get its contents.
121
- *
122
- * Folders are implicit based on '/' in the object paths.
123
- * For example, if a bucket has two objects '/a/b/1' and '/a/b/2', list('/a')
124
- * will return '/a/b' as a prefix.
125
- */
126
- prefixes: StorageReference[];
127
- /**
128
- * Objects in this directory.
129
- * You can call getMetadata() and getDownloadUrl() on them.
130
- */
131
- items: StorageReference[];
132
- /**
133
- * If set, there might be more results for this list. Use this token to resume the list.
134
- */
135
- nextPageToken?: string;
136
- }
137
- /**
138
- * Represents a reference to an S3-compatible storage object. Developers can
139
- * upload, download, and delete objects, as well as get/set object metadata.
140
- * @public
141
- */
142
- export declare interface StorageReference {
143
- /**
144
- * Returns a s3:// URL for this object in the form
145
- * `s3://<bucket>/<path>/<to>/<object>`
146
- * @returns The s3:// URL.
147
- */
148
- toString(): string;
149
- /**
150
- * A reference to the root of this object's bucket.
151
- */
152
- root: StorageReference;
153
- /**
154
- * The name of the bucket containing this reference's object.
155
- */
156
- bucket: string;
157
- /**
158
- * The full path of this object.
159
- */
160
- fullPath: string;
161
- /**
162
- * The short name of this object, which is the last component of the full path.
163
- * For example, if path is 'full/path/image.png', name is 'image.png'.
164
- */
165
- name: string;
166
- /**
167
- * A reference pointing to the parent location of this reference, or null if
168
- * this reference is the root.
169
- */
170
- parent: StorageReference | null;
171
- }
@@ -1,4 +0,0 @@
1
- export * from "./rebase_context";
2
- export * from "./types";
3
- export * from "./controllers";
4
- export * from "./users";
@@ -1,122 +0,0 @@
1
- import type { AnalyticsController } from "./controllers/analytics_controller";
2
- import type { AuthController } from "./controllers/auth";
3
- import type { StorageSource } from "./controllers/storage";
4
- import type { UserConfigurationPersistence } from "./controllers/local_config_persistence";
5
- import type { DatabaseAdmin } from "./types/backend";
6
- import type { RebaseClient } from "./controllers/client";
7
- import type { RebaseData } from "./controllers/data";
8
- import type { User } from "./users";
9
- import type { UserManagementDelegate } from "./types/user_management_delegate";
10
- /**
11
- * Context that is provided to entity callbacks (hooks).
12
- * It contains only the dependencies that are available in both the frontend and the backend.
13
- * @group Hooks and utilities
14
- */
15
- export type RebaseCallContext<USER extends User = User> = {
16
- /**
17
- * The Rebase client instance.
18
- * Available in all entity callbacks (beforeSave, afterSave, afterRead,
19
- * beforeDelete, afterDelete) and in CollectionActionsProps via context.
20
- * Use it to call backend functions, access data, storage, etc.
21
- *
22
- * @example
23
- * // In a beforeSave callback:
24
- * const result = await context.client.functions.invoke('my-function', { ... });
25
- *
26
- * @example
27
- * // In a CollectionAction component:
28
- * const { client } = props.context;
29
- * const result = await client.functions.invoke('extract-job', { url });
30
- */
31
- client: RebaseClient;
32
- /**
33
- * Unified data access — `context.data.products.create(...)`.
34
- * Access any collection as a dynamic property.
35
- */
36
- data: RebaseData;
37
- /**
38
- * Used storage implementation
39
- */
40
- storageSource: StorageSource;
41
- /**
42
- * Set by the backend when callbacks are executed on the server.
43
- */
44
- user?: USER;
45
- };
46
- /**
47
- * Context that includes the internal controllers and contexts used by the app.
48
- * Some controllers and context included in this context can be accessed
49
- * directly from their respective hooks.
50
- * @group Hooks and utilities
51
- * @see useRebaseContext
52
- */
53
- export type RebaseContext<USER extends User = User, AuthControllerType extends AuthController<USER> = AuthController<USER>> = RebaseCallContext<USER> & {
54
- authController: AuthControllerType;
55
- /**
56
- * Controller mapping strings to collections
57
- */
58
- collectionRegistryController?: import("./controllers/collection_registry").CollectionRegistryController;
59
- /**
60
- * Controller for navigation state
61
- */
62
- navigationStateController?: import("./controllers/navigation").NavigationStateController;
63
- /**
64
- * Controller for side dialogs (side sheets)
65
- */
66
- sideDialogsController?: import("./controllers/side_dialogs_controller").SideDialogsController;
67
- /**
68
- * Controller to open the side dialog displaying entity forms
69
- */
70
- sideEntityController?: import("./controllers/side_entity_controller").SideEntityController;
71
- /**
72
- * Controller resolving URLs in the CMS
73
- */
74
- urlController?: import("./controllers/navigation").UrlController;
75
- /**
76
- * Controller to handle simple confirmation and alert dialogs
77
- */
78
- dialogsController?: import("./controllers/dialogs_controller").DialogsController;
79
- /**
80
- * Controller for CMS customization
81
- */
82
- customizationController?: import("./controllers/customization_controller").CustomizationController;
83
- /**
84
- * Controller for effective role
85
- */
86
- effectiveRoleController?: {
87
- effectiveRole: string | null;
88
- setEffectiveRole: (role: string | null) => void;
89
- };
90
- /**
91
- * Use this controller to access data stored in the browser for the user
92
- */
93
- userConfigPersistence?: UserConfigurationPersistence;
94
- /**
95
- * Callback to send analytics events
96
- */
97
- analyticsController?: AnalyticsController;
98
- /**
99
- * This section is used to manage users in the CMS.
100
- * It is used to show user information in various places of the CMS,
101
- * for example, to show who created or modified an entity,
102
- * or to assign ownership of an entity.
103
- *
104
- * In the base CMS, this information is not used for access control.
105
- * You can pass your own implementation of this section, to populate
106
- * the dropdown of users when assigning ownership of an entity,
107
- * or to show more information about the user.
108
- *
109
- * If you are using the Rebase user management plugin, this
110
- * section will be implemented automatically.
111
- */
112
- userManagement?: UserManagementDelegate<USER>;
113
- /**
114
- * Administrative database operations (SQL, schema discovery).
115
- * Only available in developer/admin contexts.
116
- */
117
- databaseAdmin?: DatabaseAdmin;
118
- /**
119
- * Controller for snackbars
120
- */
121
- snackbarController?: import("./controllers/snackbar").SnackbarController;
122
- };