@rebasepro/server-mongodb 0.0.1-canary.09e5ec5
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.
- package/LICENSE +6 -0
- package/dist/ensure-collections-CNrcwVgY.js +74 -0
- package/dist/ensure-collections-CNrcwVgY.js.map +1 -0
- package/dist/ensure-history-collection-DBIiwmCm.js +15 -0
- package/dist/ensure-history-collection-DBIiwmCm.js.map +1 -0
- package/dist/index.es.js +1734 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +2043 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/server-core/src/api/ast-schema-editor.d.ts +22 -0
- package/dist/server-core/src/api/ast-schema-editor.d.ts.map +1 -0
- package/dist/server-core/src/api/errors.d.ts +36 -0
- package/dist/server-core/src/api/errors.d.ts.map +1 -0
- package/dist/server-core/src/api/graphql/graphql-schema-generator.d.ts +36 -0
- package/dist/server-core/src/api/graphql/graphql-schema-generator.d.ts.map +1 -0
- package/dist/server-core/src/api/graphql/index.d.ts +2 -0
- package/dist/server-core/src/api/graphql/index.d.ts.map +1 -0
- package/dist/server-core/src/api/index.d.ts +10 -0
- package/dist/server-core/src/api/index.d.ts.map +1 -0
- package/dist/server-core/src/api/openapi-generator.d.ts +17 -0
- package/dist/server-core/src/api/openapi-generator.d.ts.map +1 -0
- package/dist/server-core/src/api/rest/api-generator.d.ts +65 -0
- package/dist/server-core/src/api/rest/api-generator.d.ts.map +1 -0
- package/dist/server-core/src/api/rest/index.d.ts +2 -0
- package/dist/server-core/src/api/rest/index.d.ts.map +1 -0
- package/dist/server-core/src/api/rest/query-parser.d.ts +10 -0
- package/dist/server-core/src/api/rest/query-parser.d.ts.map +1 -0
- package/dist/server-core/src/api/schema-editor-routes.d.ts +4 -0
- package/dist/server-core/src/api/schema-editor-routes.d.ts.map +1 -0
- package/dist/server-core/src/api/server.d.ts +41 -0
- package/dist/server-core/src/api/server.d.ts.map +1 -0
- package/dist/server-core/src/api/types.d.ts +91 -0
- package/dist/server-core/src/api/types.d.ts.map +1 -0
- package/dist/server-core/src/auth/admin-routes.d.ts +17 -0
- package/dist/server-core/src/auth/admin-routes.d.ts.map +1 -0
- package/dist/server-core/src/auth/apple-oauth.d.ts +31 -0
- package/dist/server-core/src/auth/apple-oauth.d.ts.map +1 -0
- package/dist/server-core/src/auth/bitbucket-oauth.d.ts +12 -0
- package/dist/server-core/src/auth/bitbucket-oauth.d.ts.map +1 -0
- package/dist/server-core/src/auth/discord-oauth.d.ts +15 -0
- package/dist/server-core/src/auth/discord-oauth.d.ts.map +1 -0
- package/dist/server-core/src/auth/facebook-oauth.d.ts +15 -0
- package/dist/server-core/src/auth/facebook-oauth.d.ts.map +1 -0
- package/dist/server-core/src/auth/github-oauth.d.ts +16 -0
- package/dist/server-core/src/auth/github-oauth.d.ts.map +1 -0
- package/dist/server-core/src/auth/gitlab-oauth.d.ts +14 -0
- package/dist/server-core/src/auth/gitlab-oauth.d.ts.map +1 -0
- package/dist/server-core/src/auth/google-oauth.d.ts +15 -0
- package/dist/server-core/src/auth/google-oauth.d.ts.map +1 -0
- package/dist/server-core/src/auth/index.d.ts +24 -0
- package/dist/server-core/src/auth/index.d.ts.map +1 -0
- package/dist/server-core/src/auth/interfaces.d.ts +310 -0
- package/dist/server-core/src/auth/interfaces.d.ts.map +1 -0
- package/dist/server-core/src/auth/jwt.d.ts +44 -0
- package/dist/server-core/src/auth/jwt.d.ts.map +1 -0
- package/dist/server-core/src/auth/linkedin-oauth.d.ts +19 -0
- package/dist/server-core/src/auth/linkedin-oauth.d.ts.map +1 -0
- package/dist/server-core/src/auth/microsoft-oauth.d.ts +17 -0
- package/dist/server-core/src/auth/microsoft-oauth.d.ts.map +1 -0
- package/dist/server-core/src/auth/middleware.d.ts +82 -0
- package/dist/server-core/src/auth/middleware.d.ts.map +1 -0
- package/dist/server-core/src/auth/password.d.ts +23 -0
- package/dist/server-core/src/auth/password.d.ts.map +1 -0
- package/dist/server-core/src/auth/rate-limiter.d.ts +32 -0
- package/dist/server-core/src/auth/rate-limiter.d.ts.map +1 -0
- package/dist/server-core/src/auth/routes.d.ts +28 -0
- package/dist/server-core/src/auth/routes.d.ts.map +1 -0
- package/dist/server-core/src/auth/slack-oauth.d.ts +13 -0
- package/dist/server-core/src/auth/slack-oauth.d.ts.map +1 -0
- package/dist/server-core/src/auth/spotify-oauth.d.ts +13 -0
- package/dist/server-core/src/auth/spotify-oauth.d.ts.map +1 -0
- package/dist/server-core/src/auth/twitter-oauth.d.ts +19 -0
- package/dist/server-core/src/auth/twitter-oauth.d.ts.map +1 -0
- package/dist/server-core/src/collections/BackendCollectionRegistry.d.ts +14 -0
- package/dist/server-core/src/collections/BackendCollectionRegistry.d.ts.map +1 -0
- package/dist/server-core/src/collections/loader.d.ts +6 -0
- package/dist/server-core/src/collections/loader.d.ts.map +1 -0
- package/dist/server-core/src/cron/cron-loader.d.ts +18 -0
- package/dist/server-core/src/cron/cron-loader.d.ts.map +1 -0
- package/dist/server-core/src/cron/cron-routes.d.ts +15 -0
- package/dist/server-core/src/cron/cron-routes.d.ts.map +1 -0
- package/dist/server-core/src/cron/cron-scheduler.d.ts +62 -0
- package/dist/server-core/src/cron/cron-scheduler.d.ts.map +1 -0
- package/dist/server-core/src/cron/cron-store.d.ts +33 -0
- package/dist/server-core/src/cron/cron-store.d.ts.map +1 -0
- package/dist/server-core/src/cron/index.d.ts +7 -0
- package/dist/server-core/src/cron/index.d.ts.map +1 -0
- package/dist/server-core/src/db/interfaces.d.ts +19 -0
- package/dist/server-core/src/db/interfaces.d.ts.map +1 -0
- package/dist/server-core/src/email/index.d.ts +7 -0
- package/dist/server-core/src/email/index.d.ts.map +1 -0
- package/dist/server-core/src/email/smtp-email-service.d.ts +26 -0
- package/dist/server-core/src/email/smtp-email-service.d.ts.map +1 -0
- package/dist/server-core/src/email/templates.d.ts +43 -0
- package/dist/server-core/src/email/templates.d.ts.map +1 -0
- package/dist/server-core/src/email/types.d.ts +108 -0
- package/dist/server-core/src/email/types.d.ts.map +1 -0
- package/dist/server-core/src/functions/function-loader.d.ts +18 -0
- package/dist/server-core/src/functions/function-loader.d.ts.map +1 -0
- package/dist/server-core/src/functions/function-routes.d.ts +11 -0
- package/dist/server-core/src/functions/function-routes.d.ts.map +1 -0
- package/dist/server-core/src/functions/index.d.ts +4 -0
- package/dist/server-core/src/functions/index.d.ts.map +1 -0
- package/dist/server-core/src/history/history-routes.d.ts +24 -0
- package/dist/server-core/src/history/history-routes.d.ts.map +1 -0
- package/dist/server-core/src/history/index.d.ts +2 -0
- package/dist/server-core/src/history/index.d.ts.map +1 -0
- package/dist/server-core/src/index.d.ts +30 -0
- package/dist/server-core/src/index.d.ts.map +1 -0
- package/dist/server-core/src/init.d.ts +160 -0
- package/dist/server-core/src/init.d.ts.map +1 -0
- package/dist/server-core/src/serve-spa.d.ts +31 -0
- package/dist/server-core/src/serve-spa.d.ts.map +1 -0
- package/dist/server-core/src/services/driver-registry.d.ts +79 -0
- package/dist/server-core/src/services/driver-registry.d.ts.map +1 -0
- package/dist/server-core/src/singleton.d.ts +36 -0
- package/dist/server-core/src/singleton.d.ts.map +1 -0
- package/dist/server-core/src/storage/LocalStorageController.d.ts +47 -0
- package/dist/server-core/src/storage/LocalStorageController.d.ts.map +1 -0
- package/dist/server-core/src/storage/S3StorageController.d.ts +37 -0
- package/dist/server-core/src/storage/S3StorageController.d.ts.map +1 -0
- package/dist/server-core/src/storage/index.d.ts +26 -0
- package/dist/server-core/src/storage/index.d.ts.map +1 -0
- package/dist/server-core/src/storage/routes.d.ts +39 -0
- package/dist/server-core/src/storage/routes.d.ts.map +1 -0
- package/dist/server-core/src/storage/storage-registry.d.ts +79 -0
- package/dist/server-core/src/storage/storage-registry.d.ts.map +1 -0
- package/dist/server-core/src/storage/types.d.ts +104 -0
- package/dist/server-core/src/storage/types.d.ts.map +1 -0
- package/dist/server-core/src/types/index.d.ts +12 -0
- package/dist/server-core/src/types/index.d.ts.map +1 -0
- package/dist/server-core/src/utils/dev-port.d.ts +36 -0
- package/dist/server-core/src/utils/dev-port.d.ts.map +1 -0
- package/dist/server-core/src/utils/logger.d.ts +32 -0
- package/dist/server-core/src/utils/logger.d.ts.map +1 -0
- package/dist/server-core/src/utils/logging.d.ts +10 -0
- package/dist/server-core/src/utils/logging.d.ts.map +1 -0
- package/dist/server-core/src/utils/request-logger.d.ts +20 -0
- package/dist/server-core/src/utils/request-logger.d.ts.map +1 -0
- package/dist/server-core/src/utils/sql.d.ts +28 -0
- package/dist/server-core/src/utils/sql.d.ts.map +1 -0
- package/dist/server-mongodb/src/MongoBootstrapper.d.ts +18 -0
- package/dist/server-mongodb/src/MongoBootstrapper.d.ts.map +1 -0
- package/dist/server-mongodb/src/auth/ensure-collections.d.ts +3 -0
- package/dist/server-mongodb/src/auth/ensure-collections.d.ts.map +1 -0
- package/dist/server-mongodb/src/auth/services.d.ts +135 -0
- package/dist/server-mongodb/src/auth/services.d.ts.map +1 -0
- package/dist/server-mongodb/src/connection.d.ts +35 -0
- package/dist/server-mongodb/src/connection.d.ts.map +1 -0
- package/dist/server-mongodb/src/db/MongoConditionBuilder.d.ts +64 -0
- package/dist/server-mongodb/src/db/MongoConditionBuilder.d.ts.map +1 -0
- package/dist/server-mongodb/src/db/MongoEntityService.d.ts +98 -0
- package/dist/server-mongodb/src/db/MongoEntityService.d.ts.map +1 -0
- package/dist/server-mongodb/src/factory.d.ts +142 -0
- package/dist/server-mongodb/src/factory.d.ts.map +1 -0
- package/dist/server-mongodb/src/history/ensure-history-collection.d.ts +3 -0
- package/dist/server-mongodb/src/history/ensure-history-collection.d.ts.map +1 -0
- package/dist/server-mongodb/src/index.d.ts +18 -0
- package/dist/server-mongodb/src/index.d.ts.map +1 -0
- package/dist/server-mongodb/src/services/MongoDriver.d.ts +83 -0
- package/dist/server-mongodb/src/services/MongoDriver.d.ts.map +1 -0
- package/dist/server-mongodb/src/services/MongoHistoryService.d.ts +37 -0
- package/dist/server-mongodb/src/services/MongoHistoryService.d.ts.map +1 -0
- package/dist/server-mongodb/src/services/MongoRealtimeService.d.ts +86 -0
- package/dist/server-mongodb/src/services/MongoRealtimeService.d.ts.map +1 -0
- package/dist/server-mongodb/src/useMongoDriver.d.ts +18 -0
- package/dist/server-mongodb/src/useMongoDriver.d.ts.map +1 -0
- package/dist/server-mongodb/src/utils.d.ts +10 -0
- package/dist/server-mongodb/src/utils.d.ts.map +1 -0
- package/dist/server-mongodb/src/websocket.d.ts +7 -0
- package/dist/server-mongodb/src/websocket.d.ts.map +1 -0
- package/dist/types/src/controllers/analytics_controller.d.ts +8 -0
- package/dist/types/src/controllers/analytics_controller.d.ts.map +1 -0
- package/dist/types/src/controllers/auth.d.ts +120 -0
- package/dist/types/src/controllers/auth.d.ts.map +1 -0
- package/dist/types/src/controllers/client.d.ts +171 -0
- package/dist/types/src/controllers/client.d.ts.map +1 -0
- package/dist/types/src/controllers/collection_registry.d.ts +46 -0
- package/dist/types/src/controllers/collection_registry.d.ts.map +1 -0
- package/dist/types/src/controllers/customization_controller.d.ts +61 -0
- package/dist/types/src/controllers/customization_controller.d.ts.map +1 -0
- package/dist/types/src/controllers/data.d.ts +169 -0
- package/dist/types/src/controllers/data.d.ts.map +1 -0
- package/dist/types/src/controllers/data_driver.d.ts +161 -0
- package/dist/types/src/controllers/data_driver.d.ts.map +1 -0
- package/dist/types/src/controllers/database_admin.d.ts +12 -0
- package/dist/types/src/controllers/database_admin.d.ts.map +1 -0
- package/dist/types/src/controllers/dialogs_controller.d.ts +37 -0
- package/dist/types/src/controllers/dialogs_controller.d.ts.map +1 -0
- package/dist/types/src/controllers/effective_role.d.ts +5 -0
- package/dist/types/src/controllers/effective_role.d.ts.map +1 -0
- package/dist/types/src/controllers/email.d.ts +35 -0
- package/dist/types/src/controllers/email.d.ts.map +1 -0
- package/dist/types/src/controllers/index.d.ts +19 -0
- package/dist/types/src/controllers/index.d.ts.map +1 -0
- package/dist/types/src/controllers/local_config_persistence.d.ts +21 -0
- package/dist/types/src/controllers/local_config_persistence.d.ts.map +1 -0
- package/dist/types/src/controllers/navigation.d.ts +214 -0
- package/dist/types/src/controllers/navigation.d.ts.map +1 -0
- package/dist/types/src/controllers/registry.d.ts +55 -0
- package/dist/types/src/controllers/registry.d.ts.map +1 -0
- package/dist/types/src/controllers/side_dialogs_controller.d.ts +68 -0
- package/dist/types/src/controllers/side_dialogs_controller.d.ts.map +1 -0
- package/dist/types/src/controllers/side_entity_controller.d.ts +91 -0
- package/dist/types/src/controllers/side_entity_controller.d.ts.map +1 -0
- package/dist/types/src/controllers/snackbar.d.ts +25 -0
- package/dist/types/src/controllers/snackbar.d.ts.map +1 -0
- package/dist/types/src/controllers/storage.d.ts +172 -0
- package/dist/types/src/controllers/storage.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +5 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/rebase_context.d.ts +106 -0
- package/dist/types/src/rebase_context.d.ts.map +1 -0
- package/dist/types/src/types/backend.d.ts +537 -0
- package/dist/types/src/types/backend.d.ts.map +1 -0
- package/dist/types/src/types/builders.d.ts +16 -0
- package/dist/types/src/types/builders.d.ts.map +1 -0
- package/dist/types/src/types/chips.d.ts +6 -0
- package/dist/types/src/types/chips.d.ts.map +1 -0
- package/dist/types/src/types/collections.d.ts +857 -0
- package/dist/types/src/types/collections.d.ts.map +1 -0
- package/dist/types/src/types/cron.d.ts +103 -0
- package/dist/types/src/types/cron.d.ts.map +1 -0
- package/dist/types/src/types/data_source.d.ts +65 -0
- package/dist/types/src/types/data_source.d.ts.map +1 -0
- package/dist/types/src/types/entities.d.ts +146 -0
- package/dist/types/src/types/entities.d.ts.map +1 -0
- package/dist/types/src/types/entity_actions.d.ts +99 -0
- package/dist/types/src/types/entity_actions.d.ts.map +1 -0
- package/dist/types/src/types/entity_callbacks.d.ts +174 -0
- package/dist/types/src/types/entity_callbacks.d.ts.map +1 -0
- package/dist/types/src/types/entity_link_builder.d.ts +8 -0
- package/dist/types/src/types/entity_link_builder.d.ts.map +1 -0
- package/dist/types/src/types/entity_overrides.d.ts +11 -0
- package/dist/types/src/types/entity_overrides.d.ts.map +1 -0
- package/dist/types/src/types/entity_views.d.ts +62 -0
- package/dist/types/src/types/entity_views.d.ts.map +1 -0
- package/dist/types/src/types/export_import.d.ts +22 -0
- package/dist/types/src/types/export_import.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +24 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/types/locales.d.ts +5 -0
- package/dist/types/src/types/locales.d.ts.map +1 -0
- package/dist/types/src/types/modify_collections.d.ts +6 -0
- package/dist/types/src/types/modify_collections.d.ts.map +1 -0
- package/dist/types/src/types/plugins.d.ts +280 -0
- package/dist/types/src/types/plugins.d.ts.map +1 -0
- package/dist/types/src/types/properties.d.ts +1177 -0
- package/dist/types/src/types/properties.d.ts.map +1 -0
- package/dist/types/src/types/property_config.d.ts +71 -0
- package/dist/types/src/types/property_config.d.ts.map +1 -0
- package/dist/types/src/types/relations.d.ts +337 -0
- package/dist/types/src/types/relations.d.ts.map +1 -0
- package/dist/types/src/types/slots.d.ts +253 -0
- package/dist/types/src/types/slots.d.ts.map +1 -0
- package/dist/types/src/types/translations.d.ts +871 -0
- package/dist/types/src/types/translations.d.ts.map +1 -0
- package/dist/types/src/types/user_management_delegate.d.ts +122 -0
- package/dist/types/src/types/user_management_delegate.d.ts.map +1 -0
- package/dist/types/src/types/websockets.d.ts +79 -0
- package/dist/types/src/types/websockets.d.ts.map +1 -0
- package/dist/types/src/users/index.d.ts +3 -0
- package/dist/types/src/users/index.d.ts.map +1 -0
- package/dist/types/src/users/roles.d.ts +23 -0
- package/dist/types/src/users/roles.d.ts.map +1 -0
- package/dist/types/src/users/user.d.ts +47 -0
- package/dist/types/src/users/user.d.ts.map +1 -0
- package/dist/websocket-BZlPuJrt.js +220 -0
- package/dist/websocket-BZlPuJrt.js.map +1 -0
- package/package.json +79 -0
- package/src/MongoBootstrapper.ts +177 -0
- package/src/auth/ensure-collections.ts +94 -0
- package/src/auth/services.ts +638 -0
- package/src/connection.ts +60 -0
- package/src/db/MongoConditionBuilder.ts +181 -0
- package/src/db/MongoEntityService.ts +350 -0
- package/src/factory.ts +289 -0
- package/src/history/ensure-history-collection.ts +19 -0
- package/src/index.ts +25 -0
- package/src/services/MongoDriver.ts +297 -0
- package/src/services/MongoDriver.ts.backup +266 -0
- package/src/services/MongoHistoryService.ts +154 -0
- package/src/services/MongoRealtimeService.ts +394 -0
- package/src/useMongoDriver.ts +519 -0
- package/src/utils.ts +28 -0
- package/src/websocket.ts +257 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { Entity, EntityValues } from "../types/entities";
|
|
2
|
+
/**
|
|
3
|
+
* Parameters for querying a collection.
|
|
4
|
+
* Uses PostgREST-style filter syntax for consistency between
|
|
5
|
+
* the SDK (HTTP) and framework (in-process) contexts.
|
|
6
|
+
*
|
|
7
|
+
* @group Data
|
|
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";
|
|
22
|
+
export interface FindParams {
|
|
23
|
+
/** Maximum number of items to return (default: 20) */
|
|
24
|
+
limit?: number;
|
|
25
|
+
/** Number of items to skip */
|
|
26
|
+
offset?: number;
|
|
27
|
+
/** Page number (1-indexed), alternative to offset */
|
|
28
|
+
page?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Filter object. Supports multiple syntaxes per field:
|
|
31
|
+
*
|
|
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
|
|
48
|
+
* { status: "eq.published" }
|
|
49
|
+
* { age: "gte.18" }
|
|
50
|
+
* { role: "in.(admin,editor)" }
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
where?: Record<string, WhereFieldValue>;
|
|
54
|
+
/**
|
|
55
|
+
* Sort order. Format: "field:direction".
|
|
56
|
+
* @example "created_at:desc", "name:asc"
|
|
57
|
+
*/
|
|
58
|
+
orderBy?: string;
|
|
59
|
+
/** Relations to include in the response */
|
|
60
|
+
include?: string[];
|
|
61
|
+
/** Full-text search string */
|
|
62
|
+
searchString?: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Paginated response from a collection query.
|
|
66
|
+
* @group Data
|
|
67
|
+
*/
|
|
68
|
+
export interface FindResponse<M extends Record<string, unknown> = Record<string, unknown>> {
|
|
69
|
+
/** Array of entities matching the query */
|
|
70
|
+
data: Entity<M>[];
|
|
71
|
+
/** Pagination metadata */
|
|
72
|
+
meta: {
|
|
73
|
+
total: number;
|
|
74
|
+
limit: number;
|
|
75
|
+
offset: number;
|
|
76
|
+
hasMore: boolean;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* A single collection's CRUD accessor.
|
|
81
|
+
*
|
|
82
|
+
* This is the unified API surface used in both:
|
|
83
|
+
* - The generated SDK (`client.data.products.create(...)`)
|
|
84
|
+
* - Framework callbacks (`context.data.products.create(...)`)
|
|
85
|
+
*
|
|
86
|
+
* @group Data
|
|
87
|
+
*/
|
|
88
|
+
export interface CollectionAccessor<M extends Record<string, unknown> = Record<string, unknown>> {
|
|
89
|
+
/**
|
|
90
|
+
* Find multiple records with optional filtering, pagination, and sorting.
|
|
91
|
+
*/
|
|
92
|
+
find(params?: FindParams): Promise<FindResponse<M>>;
|
|
93
|
+
/**
|
|
94
|
+
* Find a single record by its ID.
|
|
95
|
+
*/
|
|
96
|
+
findById(id: string | number): Promise<Entity<M> | undefined>;
|
|
97
|
+
/**
|
|
98
|
+
* Create a new record.
|
|
99
|
+
* @param data The entity data to create.
|
|
100
|
+
* @param id Optional specific ID to use for the new record.
|
|
101
|
+
* @returns The created entity
|
|
102
|
+
*/
|
|
103
|
+
create(data: Partial<EntityValues<M>>, id?: string | number): Promise<Entity<M>>;
|
|
104
|
+
/**
|
|
105
|
+
* Update an existing record by ID.
|
|
106
|
+
* @returns The updated entity
|
|
107
|
+
*/
|
|
108
|
+
update(id: string | number, data: Partial<EntityValues<M>>): Promise<Entity<M>>;
|
|
109
|
+
/**
|
|
110
|
+
* Delete a record by ID.
|
|
111
|
+
*/
|
|
112
|
+
delete(id: string | number): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* Subscribe to a collection for real-time updates.
|
|
115
|
+
* Optional method, may not be supported by all implementations (like stateless HTTP clients).
|
|
116
|
+
*/
|
|
117
|
+
listen?(params: FindParams | undefined, onUpdate: (response: FindResponse<M>) => void, onError?: (error: Error) => void): () => void;
|
|
118
|
+
/**
|
|
119
|
+
* Subscribe to a single record for real-time updates.
|
|
120
|
+
* Optional method.
|
|
121
|
+
*/
|
|
122
|
+
listenById?(id: string | number, onUpdate: (entity: Entity<M> | undefined) => void, onError?: (error: Error) => void): () => void;
|
|
123
|
+
/**
|
|
124
|
+
* Count the number of records matching the given filter.
|
|
125
|
+
*/
|
|
126
|
+
count?(params?: FindParams): Promise<number>;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The unified data access object.
|
|
130
|
+
*
|
|
131
|
+
* Access collections as dynamic properties: `data.products.find(...)`.
|
|
132
|
+
* In the SDK this is backed by HTTP transport (typed, generated per-project).
|
|
133
|
+
* In the framework this is backed by a Proxy + in-process database driver (dynamic).
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* // SDK
|
|
137
|
+
* const client = createRebaseClient({ baseUrl: "..." });
|
|
138
|
+
* await client.data.products.create({ name: "Camera", price: 299 });
|
|
139
|
+
*
|
|
140
|
+
* // Framework callback
|
|
141
|
+
* callbacks: {
|
|
142
|
+
* afterSave({ context }) {
|
|
143
|
+
* await context.data.logs.create({ action: "saved", timestamp: new Date() });
|
|
144
|
+
* }
|
|
145
|
+
* }
|
|
146
|
+
*
|
|
147
|
+
* @group Data
|
|
148
|
+
*/
|
|
149
|
+
export interface RebaseData {
|
|
150
|
+
/**
|
|
151
|
+
* Get a collection accessor by slug.
|
|
152
|
+
* Alternative to dynamic property access for cases where
|
|
153
|
+
* the collection name is a variable.
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* const accessor = data.collection("products");
|
|
157
|
+
* await accessor.find({ limit: 10 });
|
|
158
|
+
*/
|
|
159
|
+
collection(slug: string): CollectionAccessor;
|
|
160
|
+
/**
|
|
161
|
+
* Dynamic collection accessor.
|
|
162
|
+
* Access any collection by its slug as a property.
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* data.products.find({ where: { status: "eq.published" } })
|
|
166
|
+
*/
|
|
167
|
+
[collectionSlug: string]: CollectionAccessor | ((slug: string) => CollectionAccessor);
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../../types/src/controllers/data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;;;;GAMG;AACH;;;;;;;;;GASG;AACH,MAAM,MAAM,eAAe,GACrB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;AAEhC,2DAA2D;AAC3D,MAAM,MAAM,kBAAkB,GACxB,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GACrC,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAC1C,IAAI,GAAG,KAAK,GAAG,QAAQ,GACvB,gBAAgB,GAAG,oBAAoB,GAAG,IAAI,GAAG,KAAK,CAAC;AAE7D,MAAM,WAAW,UAAU;IACvB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACxC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,8BAA8B;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACrF,2CA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CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAErI;;;OAGG;IACH,UAAU,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,SAAS,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAElI;;OAEG;IACH,KAAK,CAAC,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAChD;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,UAAU;IACvB;;;;;;;;OAQG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAAC;IAE7C;;;;;;OAMG;IACH,CAAC,cAAc,EAAE,MAAM,GAAG,kBAAkB,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,kBAAkB,CAAC,CAAC;CACzF"}
|
|
@@ -0,0 +1,161 @@
|
|
|
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
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export interface FetchEntityProps<M extends Record<string, unknown> = Record<string, unknown>> {
|
|
8
|
+
path: string;
|
|
9
|
+
entityId: string | number;
|
|
10
|
+
databaseId?: string;
|
|
11
|
+
collection?: EntityCollection<M>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export type ListenEntityProps<M extends Record<string, unknown> = Record<string, unknown>> = 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, unknown> = Record<string, unknown>> {
|
|
24
|
+
path: string;
|
|
25
|
+
collection?: EntityCollection<M>;
|
|
26
|
+
filter?: FilterValues<Extract<keyof M, string>>;
|
|
27
|
+
limit?: number;
|
|
28
|
+
offset?: number;
|
|
29
|
+
startAfter?: unknown;
|
|
30
|
+
orderBy?: string;
|
|
31
|
+
searchString?: string;
|
|
32
|
+
order?: "desc" | "asc";
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
export type ListenCollectionProps<M extends Record<string, unknown> = Record<string, unknown>> = FetchCollectionProps<M> & {
|
|
38
|
+
onUpdate: (entities: Entity<M>[]) => void;
|
|
39
|
+
onError?: (error: Error) => void;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
export interface SaveEntityProps<M extends Record<string, unknown> = Record<string, unknown>> {
|
|
45
|
+
path: string;
|
|
46
|
+
values: Partial<EntityValues<M>>;
|
|
47
|
+
entityId?: string | number;
|
|
48
|
+
previousValues?: Partial<EntityValues<M>>;
|
|
49
|
+
collection?: EntityCollection<M>;
|
|
50
|
+
status: EntityStatus;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
export interface DeleteEntityProps<M extends Record<string, unknown> = Record<string, unknown>> {
|
|
56
|
+
entity: Entity<M>;
|
|
57
|
+
collection?: EntityCollection<M>;
|
|
58
|
+
}
|
|
59
|
+
export type FilterCombinationValidProps = {
|
|
60
|
+
path: string;
|
|
61
|
+
databaseId?: string;
|
|
62
|
+
collection: EntityCollection;
|
|
63
|
+
filterValues: FilterValues<string>;
|
|
64
|
+
sortBy?: [string, "asc" | "desc"];
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Internal driver interface for communicating with the data layer.
|
|
68
|
+
* This is NOT the public API — use `RebaseData` / `context.data` instead.
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
export interface DataDriver {
|
|
72
|
+
/**
|
|
73
|
+
* Key that identifies this driver
|
|
74
|
+
*/
|
|
75
|
+
key?: string;
|
|
76
|
+
/**
|
|
77
|
+
* If the driver has been initialised
|
|
78
|
+
*/
|
|
79
|
+
initialised?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Fetch data from a collection
|
|
82
|
+
* @param props
|
|
83
|
+
* @return Promise of entities
|
|
84
|
+
*/
|
|
85
|
+
fetchCollection<M extends Record<string, unknown> = Record<string, unknown>>(props: FetchCollectionProps<M>): Promise<Entity<M>[]>;
|
|
86
|
+
/**
|
|
87
|
+
* Listen to a collection in a given path. If you don't implement this method
|
|
88
|
+
* `fetchCollection` will be used instead, with no real time updates.
|
|
89
|
+
* @param props
|
|
90
|
+
* @return Function to cancel subscription
|
|
91
|
+
*/
|
|
92
|
+
listenCollection?<M extends Record<string, unknown> = Record<string, unknown>>(props: ListenCollectionProps<M>): () => void;
|
|
93
|
+
/**
|
|
94
|
+
* Retrieve an entity given a path and a collection
|
|
95
|
+
* @param props
|
|
96
|
+
*/
|
|
97
|
+
fetchEntity<M extends Record<string, unknown> = Record<string, unknown>>(props: FetchEntityProps<M>): Promise<Entity<M> | undefined>;
|
|
98
|
+
/**
|
|
99
|
+
* Get realtime updates on one entity.
|
|
100
|
+
* @param props
|
|
101
|
+
* @return Function to cancel subscription
|
|
102
|
+
*/
|
|
103
|
+
listenEntity?<M extends Record<string, unknown> = Record<string, unknown>>(props: ListenEntityProps<M>): () => void;
|
|
104
|
+
/**
|
|
105
|
+
* Save entity to the specified path
|
|
106
|
+
* @param props
|
|
107
|
+
*/
|
|
108
|
+
saveEntity<M extends Record<string, unknown> = Record<string, unknown>>(props: SaveEntityProps<M>): Promise<Entity<M>>;
|
|
109
|
+
/**
|
|
110
|
+
* Delete an entity
|
|
111
|
+
* @param props
|
|
112
|
+
* @return was the whole deletion flow successful
|
|
113
|
+
*/
|
|
114
|
+
deleteEntity<M extends Record<string, unknown> = Record<string, unknown>>(props: DeleteEntityProps<M>): Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Check if the given property is unique in the given collection
|
|
117
|
+
* @param path Collection path
|
|
118
|
+
* @param name of the property
|
|
119
|
+
* @param value
|
|
120
|
+
* @param entityId
|
|
121
|
+
* @param collection
|
|
122
|
+
* @return `true` if there are no other fields besides the given entity
|
|
123
|
+
*/
|
|
124
|
+
checkUniqueField(path: string, name: string, value: unknown, entityId?: string | number, collection?: EntityCollection): Promise<boolean>;
|
|
125
|
+
/**
|
|
126
|
+
* Count the number of entities in a collection
|
|
127
|
+
*/
|
|
128
|
+
countEntities?<M extends Record<string, unknown> = Record<string, unknown>>(props: FetchCollectionProps<M>): Promise<number>;
|
|
129
|
+
/**
|
|
130
|
+
* Check if the given filter combination is valid
|
|
131
|
+
* @param props
|
|
132
|
+
*/
|
|
133
|
+
isFilterCombinationValid?(props: Omit<FilterCombinationValidProps, "collection"> & {
|
|
134
|
+
databaseId?: string;
|
|
135
|
+
}): boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Get the object to generate the current time in the driver
|
|
138
|
+
*/
|
|
139
|
+
currentTime?: () => unknown;
|
|
140
|
+
delegateToCMSModel?: (data: unknown) => unknown;
|
|
141
|
+
cmsToDelegateModel?: (data: unknown) => unknown;
|
|
142
|
+
initTextSearch?: (props: {
|
|
143
|
+
context: RebaseContext;
|
|
144
|
+
path: string;
|
|
145
|
+
databaseId?: string;
|
|
146
|
+
collection: EntityCollection;
|
|
147
|
+
parentCollectionIds?: string[];
|
|
148
|
+
}) => Promise<boolean>;
|
|
149
|
+
/**
|
|
150
|
+
* Flag to indicate if the driver has requested the initialization of the text search index
|
|
151
|
+
*/
|
|
152
|
+
needsInitTextSearch?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Return the admin capabilities of this driver.
|
|
155
|
+
* @see SQLAdmin
|
|
156
|
+
* @see DocumentAdmin
|
|
157
|
+
* @see SchemaAdmin
|
|
158
|
+
*/
|
|
159
|
+
admin?: import("../types/backend").DatabaseAdmin;
|
|
160
|
+
}
|
|
161
|
+
//# 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,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGvD;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACzF,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAA;CACnC;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IACrF,gBAAgB,CAAC,CAAC,CAAC,GACjB;IACE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACpC,CAAA;AAEL;;GAEG;AACH,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,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AAC,GAAG;QAC/E,UAAU,CAAC,EAAE,MAAM,CAAA;KACtB,GAAG,OAAO,CAAC;IAEZ;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC;IAE5B,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC;IAEhD,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC;IAEhD,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE;QACrB,OAAO,EAAE,aAAa,CAAC;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,gBAAgB,CAAC;QAC7B,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;KACjC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAEvB;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAW9B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,kBAAkB,EAAE,aAAa,CAAC;CAEpD"}
|
|
@@ -0,0 +1,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,EACpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACH,UAAU,EACV,eAAe,EACf,aAAa,EAChB,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 @@
|
|
|
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,35 @@
|
|
|
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
|
+
}
|
|
35
|
+
//# sourceMappingURL=email.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../../../../types/src/controllers/email.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,mCAAmC;IACnC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACtB,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IACzB,2BAA2B;IAC3B,IAAI,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,gFAAgF;IAChF,YAAY,IAAI,OAAO,CAAC;CAC3B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 "./email";
|
|
12
|
+
export * from "./client";
|
|
13
|
+
export * from "./customization_controller";
|
|
14
|
+
export * from "./side_entity_controller";
|
|
15
|
+
export * from "./side_dialogs_controller";
|
|
16
|
+
export * from "./dialogs_controller";
|
|
17
|
+
export * from "./snackbar";
|
|
18
|
+
export * from "./registry";
|
|
19
|
+
//# 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,SAAS,CAAC;AACxB,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 type { EntityCollection } from "../types/collections";
|
|
2
|
+
/**
|
|
3
|
+
* @group Models
|
|
4
|
+
*/
|
|
5
|
+
export type PartialEntityCollection<M extends Record<string, unknown> = Record<string, unknown>> = 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, 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
|
+
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,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEhI;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IACzC,oBAAoB,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,uBAAuB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IACzJ,mBAAmB,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,KAAK,uBAAuB,CAAC,CAAC,CAAC,CAAC;IAC/H,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"}
|