@rebasepro/types 0.8.0 → 0.9.0
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/README.md +10 -10
- package/dist/controllers/auth.d.ts +1 -1
- package/dist/controllers/client.d.ts +184 -6
- package/dist/controllers/collection_registry.d.ts +3 -3
- package/dist/controllers/customization_controller.d.ts +1 -1
- package/dist/controllers/data.d.ts +267 -35
- package/dist/controllers/data_driver.d.ts +50 -37
- package/dist/controllers/index.d.ts +1 -1
- package/dist/controllers/local_config_persistence.d.ts +4 -4
- package/dist/controllers/navigation.d.ts +2 -2
- package/dist/controllers/registry.d.ts +17 -4
- package/dist/controllers/{side_entity_controller.d.ts → side_panel_controller.d.ts} +7 -7
- package/dist/controllers/storage.d.ts +39 -0
- package/dist/errors.d.ts +64 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +142 -15
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +150 -17
- package/dist/index.umd.js.map +1 -1
- package/dist/rebase_context.d.ts +8 -4
- package/dist/types/auth_adapter.d.ts +4 -1
- package/dist/types/backend.d.ts +26 -26
- package/dist/types/builders.d.ts +2 -2
- package/dist/types/collections.d.ts +62 -63
- package/dist/types/component_overrides.d.ts +61 -3
- package/dist/types/cron.d.ts +10 -1
- package/dist/types/data_source.d.ts +15 -2
- package/dist/types/database_adapter.d.ts +4 -3
- package/dist/types/entities.d.ts +7 -7
- package/dist/types/entity_actions.d.ts +7 -7
- package/dist/types/entity_callbacks.d.ts +39 -39
- package/dist/types/entity_views.d.ts +3 -3
- package/dist/types/filter-operators.d.ts +62 -17
- package/dist/types/modify_collections.d.ts +2 -2
- package/dist/types/plugins.d.ts +9 -9
- package/dist/types/policy.d.ts +64 -10
- package/dist/types/properties.d.ts +41 -9
- package/dist/types/relations.d.ts +3 -3
- package/dist/types/slots.d.ts +14 -14
- package/dist/types/websockets.d.ts +12 -13
- package/dist/users/user.d.ts +21 -9
- package/package.json +1 -1
- package/src/controllers/auth.tsx +1 -1
- package/src/controllers/client.ts +214 -6
- package/src/controllers/collection_registry.ts +3 -3
- package/src/controllers/customization_controller.tsx +1 -1
- package/src/controllers/data.ts +290 -39
- package/src/controllers/data_driver.ts +49 -40
- package/src/controllers/index.ts +1 -1
- package/src/controllers/local_config_persistence.tsx +4 -4
- package/src/controllers/navigation.ts +2 -2
- package/src/controllers/registry.ts +18 -4
- package/src/controllers/{side_entity_controller.tsx → side_panel_controller.tsx} +7 -7
- package/src/controllers/storage.ts +60 -1
- package/src/errors.ts +80 -0
- package/src/index.ts +1 -0
- package/src/rebase_context.tsx +8 -4
- package/src/types/auth_adapter.ts +4 -1
- package/src/types/backend.ts +36 -36
- package/src/types/builders.ts +2 -2
- package/src/types/collections.ts +78 -79
- package/src/types/component_overrides.ts +72 -5
- package/src/types/cron.ts +10 -1
- package/src/types/data_source.ts +24 -2
- package/src/types/database_adapter.ts +4 -3
- package/src/types/entities.ts +7 -7
- package/src/types/entity_actions.tsx +7 -7
- package/src/types/entity_callbacks.ts +42 -42
- package/src/types/entity_views.tsx +3 -3
- package/src/types/filter-operators.ts +96 -23
- package/src/types/modify_collections.tsx +2 -2
- package/src/types/plugins.tsx +9 -9
- package/src/types/policy.ts +64 -8
- package/src/types/properties.ts +44 -9
- package/src/types/relations.ts +3 -3
- package/src/types/slots.tsx +14 -14
- package/src/types/websockets.ts +12 -14
- package/src/users/user.ts +22 -9
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Entity } from "../types/entities";
|
|
2
|
-
import type {
|
|
2
|
+
import type { CollectionConfig } from "../types/collections";
|
|
3
3
|
/**
|
|
4
4
|
* Props used to open a side dialog
|
|
5
5
|
* @group Hooks and utilities
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
7
|
+
export interface SidePanelBindingProps<M extends Record<string, unknown> = Record<string, unknown>> {
|
|
8
8
|
/**
|
|
9
9
|
* Absolute path of the entity
|
|
10
10
|
*/
|
|
@@ -31,7 +31,7 @@ export interface EntitySidePanelProps<M extends Record<string, unknown> = Record
|
|
|
31
31
|
* Collection representing the entities of this view.
|
|
32
32
|
* If you leave it blank it will be induced by your navigation
|
|
33
33
|
*/
|
|
34
|
-
collection?:
|
|
34
|
+
collection?: CollectionConfig<M>;
|
|
35
35
|
/**
|
|
36
36
|
* Should update the URL when opening the dialog.
|
|
37
37
|
* Consider that if the collection that you provide is not defined in the base
|
|
@@ -74,7 +74,7 @@ export interface EntitySidePanelProps<M extends Record<string, unknown> = Record
|
|
|
74
74
|
* Controller to open the side dialog displaying entity forms
|
|
75
75
|
* @group Hooks and utilities
|
|
76
76
|
*/
|
|
77
|
-
export interface
|
|
77
|
+
export interface SidePanelController {
|
|
78
78
|
/**
|
|
79
79
|
* Close the last panel
|
|
80
80
|
*/
|
|
@@ -84,14 +84,14 @@ export interface SideEntityController {
|
|
|
84
84
|
* of the view is fetched from the collections you have specified in the
|
|
85
85
|
* navigation.
|
|
86
86
|
* At least you need to pass the path of the entity you would like
|
|
87
|
-
* to edit. You can set
|
|
87
|
+
* to edit. You can set a entityId if you would like to edit and existing one
|
|
88
88
|
* (or a new one with that id).
|
|
89
89
|
* @param props
|
|
90
90
|
*/
|
|
91
|
-
open: <M extends Record<string, unknown> = Record<string, unknown>>(props:
|
|
91
|
+
open: <M extends Record<string, unknown> = Record<string, unknown>>(props: SidePanelBindingProps<M>) => void;
|
|
92
92
|
/**
|
|
93
93
|
* Replace the last open entity panel with the given one.
|
|
94
94
|
* @param props
|
|
95
95
|
*/
|
|
96
|
-
replace: <M extends Record<string, unknown> = Record<string, unknown>>(props:
|
|
96
|
+
replace: <M extends Record<string, unknown> = Record<string, unknown>>(props: SidePanelBindingProps<M>) => void;
|
|
97
97
|
}
|
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path prefix that marks an object as **public**. Files stored under this
|
|
3
|
+
* prefix are served without any auth token via a stable, permanent,
|
|
4
|
+
* CDN-cacheable URL (see {@link StorageSource.getSignedUrl}). Shared by the
|
|
5
|
+
* client SDK and the backend so both agree on which objects are public.
|
|
6
|
+
*
|
|
7
|
+
* @group Models
|
|
8
|
+
*/
|
|
9
|
+
export declare const PUBLIC_STORAGE_PREFIX = "public/";
|
|
10
|
+
/**
|
|
11
|
+
* True when a storage key/path points at a public object (lives under
|
|
12
|
+
* {@link PUBLIC_STORAGE_PREFIX}). The check is applied to the key *within the
|
|
13
|
+
* bucket* — strip any `bucket/` and `scheme://` prefixes first.
|
|
14
|
+
*
|
|
15
|
+
* @group Models
|
|
16
|
+
*/
|
|
17
|
+
export declare function isPublicStoragePath(path: string | null | undefined): boolean;
|
|
1
18
|
/**
|
|
2
19
|
* @group Models
|
|
3
20
|
*/
|
|
@@ -6,6 +23,13 @@ export interface UploadFileProps {
|
|
|
6
23
|
key: string;
|
|
7
24
|
metadata?: Record<string, unknown>;
|
|
8
25
|
bucket?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Store this object as **public**: it is placed under
|
|
28
|
+
* {@link PUBLIC_STORAGE_PREFIX} and served via a stable, token-less,
|
|
29
|
+
* permanent URL (safe to persist in a database and cache on a CDN).
|
|
30
|
+
* Defaults to `false` (private, short-lived signed URLs).
|
|
31
|
+
*/
|
|
32
|
+
public?: boolean;
|
|
9
33
|
}
|
|
10
34
|
/**
|
|
11
35
|
* @group Models
|
|
@@ -67,6 +91,21 @@ export declare interface DownloadMetadata {
|
|
|
67
91
|
*/
|
|
68
92
|
contentType: string;
|
|
69
93
|
customMetadata: Record<string, unknown>;
|
|
94
|
+
/**
|
|
95
|
+
* Optional short-lived download token (for local/server-mediated storage).
|
|
96
|
+
* Absent for public objects, which need no token.
|
|
97
|
+
*/
|
|
98
|
+
token?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Optional remaining lifetime of the token, in seconds.
|
|
101
|
+
*/
|
|
102
|
+
tokenExpiresIn?: number;
|
|
103
|
+
/**
|
|
104
|
+
* True when this object is public: it is served without a token via a
|
|
105
|
+
* stable, permanent, CDN-cacheable URL. When set, the client builds a
|
|
106
|
+
* token-less URL and caches it indefinitely.
|
|
107
|
+
*/
|
|
108
|
+
public?: boolean;
|
|
70
109
|
}
|
|
71
110
|
/**
|
|
72
111
|
* @group Models
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured initializer for {@link RebaseApiError}.
|
|
3
|
+
*
|
|
4
|
+
* @group Errors
|
|
5
|
+
*/
|
|
6
|
+
export interface RebaseErrorInit {
|
|
7
|
+
/**
|
|
8
|
+
* HTTP status code, when the error originated from an HTTP response.
|
|
9
|
+
* Left `undefined` for realtime/WebSocket, network, and client-side
|
|
10
|
+
* logic errors that have no HTTP status.
|
|
11
|
+
*/
|
|
12
|
+
status?: number;
|
|
13
|
+
/** Stable, machine-readable error code (e.g. `"NOT_FOUND"`, `"BAD_REQUEST"`). */
|
|
14
|
+
code?: string;
|
|
15
|
+
/** Structured error payload returned by the server, when present. */
|
|
16
|
+
details?: unknown;
|
|
17
|
+
/** The underlying error this one wraps, if any. */
|
|
18
|
+
cause?: unknown;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The single error type thrown across the entire Rebase client surface —
|
|
22
|
+
* HTTP data/control-plane calls, realtime/WebSocket operations, and
|
|
23
|
+
* client-side logic errors (e.g. an unknown collection accessor). A `catch`
|
|
24
|
+
* block only ever needs to check for this one class:
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* import { RebaseApiError } from "@rebasepro/client"; // re-exported
|
|
28
|
+
*
|
|
29
|
+
* try {
|
|
30
|
+
* await client.data.products.update(id, { price: 9 });
|
|
31
|
+
* } catch (e) {
|
|
32
|
+
* if (e instanceof RebaseApiError) {
|
|
33
|
+
* if (e.status === 404) { ... } // HTTP failures carry a status
|
|
34
|
+
* console.error(e.code, e.details);
|
|
35
|
+
* }
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* `status` is present for HTTP failures and `undefined` otherwise, so its
|
|
40
|
+
* presence distinguishes transport-level errors from realtime/logic errors.
|
|
41
|
+
*
|
|
42
|
+
* @group Errors
|
|
43
|
+
*/
|
|
44
|
+
export declare class RebaseApiError extends Error {
|
|
45
|
+
/** HTTP status code, or `undefined` for non-HTTP errors. */
|
|
46
|
+
readonly status?: number;
|
|
47
|
+
/** Stable machine-readable error code, when the server supplied one. */
|
|
48
|
+
readonly code?: string;
|
|
49
|
+
/** Structured error payload from the server, when present. */
|
|
50
|
+
readonly details?: unknown;
|
|
51
|
+
constructor(message: string, init?: RebaseErrorInit);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Client-side logic error — raised before any request is made (e.g. accessing
|
|
55
|
+
* an unknown collection accessor when a typed dictionary is configured).
|
|
56
|
+
*
|
|
57
|
+
* A subclass of {@link RebaseApiError} (with no `status`), so a single
|
|
58
|
+
* `catch (e) { if (e instanceof RebaseApiError) ... }` handles it too.
|
|
59
|
+
*
|
|
60
|
+
* @group Errors
|
|
61
|
+
*/
|
|
62
|
+
export declare class RebaseClientError extends RebaseApiError {
|
|
63
|
+
constructor(message: string);
|
|
64
|
+
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,63 @@
|
|
|
1
|
+
//#region src/errors.ts
|
|
2
|
+
/**
|
|
3
|
+
* The single error type thrown across the entire Rebase client surface —
|
|
4
|
+
* HTTP data/control-plane calls, realtime/WebSocket operations, and
|
|
5
|
+
* client-side logic errors (e.g. an unknown collection accessor). A `catch`
|
|
6
|
+
* block only ever needs to check for this one class:
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { RebaseApiError } from "@rebasepro/client"; // re-exported
|
|
10
|
+
*
|
|
11
|
+
* try {
|
|
12
|
+
* await client.data.products.update(id, { price: 9 });
|
|
13
|
+
* } catch (e) {
|
|
14
|
+
* if (e instanceof RebaseApiError) {
|
|
15
|
+
* if (e.status === 404) { ... } // HTTP failures carry a status
|
|
16
|
+
* console.error(e.code, e.details);
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* `status` is present for HTTP failures and `undefined` otherwise, so its
|
|
22
|
+
* presence distinguishes transport-level errors from realtime/logic errors.
|
|
23
|
+
*
|
|
24
|
+
* @group Errors
|
|
25
|
+
*/
|
|
26
|
+
var RebaseApiError = class extends Error {
|
|
27
|
+
/** HTTP status code, or `undefined` for non-HTTP errors. */
|
|
28
|
+
status;
|
|
29
|
+
/** Stable machine-readable error code, when the server supplied one. */
|
|
30
|
+
code;
|
|
31
|
+
/** Structured error payload from the server, when present. */
|
|
32
|
+
details;
|
|
33
|
+
constructor(message, init = {}) {
|
|
34
|
+
super(message);
|
|
35
|
+
this.name = "RebaseApiError";
|
|
36
|
+
this.status = init.status;
|
|
37
|
+
this.code = init.code;
|
|
38
|
+
this.details = init.details;
|
|
39
|
+
if (init.cause !== void 0) this.cause = init.cause;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Client-side logic error — raised before any request is made (e.g. accessing
|
|
44
|
+
* an unknown collection accessor when a typed dictionary is configured).
|
|
45
|
+
*
|
|
46
|
+
* A subclass of {@link RebaseApiError} (with no `status`), so a single
|
|
47
|
+
* `catch (e) { if (e instanceof RebaseApiError) ... }` handles it too.
|
|
48
|
+
*
|
|
49
|
+
* @group Errors
|
|
50
|
+
*/
|
|
51
|
+
var RebaseClientError = class extends RebaseApiError {
|
|
52
|
+
constructor(message) {
|
|
53
|
+
super(message);
|
|
54
|
+
this.name = "RebaseClientError";
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
1
58
|
//#region src/types/entities.ts
|
|
2
59
|
/**
|
|
3
|
-
* Class used to create a reference to
|
|
60
|
+
* Class used to create a reference to a entity in a different path.
|
|
4
61
|
*
|
|
5
62
|
* @example
|
|
6
63
|
* // Simple reference (most common case - single driver, single db)
|
|
@@ -34,7 +91,7 @@ var EntityReference = class {
|
|
|
34
91
|
*/
|
|
35
92
|
databaseId;
|
|
36
93
|
/**
|
|
37
|
-
* Create a reference to
|
|
94
|
+
* Create a reference to a entity.
|
|
38
95
|
*
|
|
39
96
|
* @example
|
|
40
97
|
* // Simple reference (most common case)
|
|
@@ -68,7 +125,7 @@ var EntityReference = class {
|
|
|
68
125
|
}
|
|
69
126
|
};
|
|
70
127
|
/**
|
|
71
|
-
* Class used to create a reference to
|
|
128
|
+
* Class used to create a reference to a entity in a different path
|
|
72
129
|
*/
|
|
73
130
|
var EntityRelation = class {
|
|
74
131
|
__type = "relation";
|
|
@@ -134,7 +191,13 @@ var CANONICAL_TO_REST = {
|
|
|
134
191
|
"in": "in",
|
|
135
192
|
"not-in": "nin",
|
|
136
193
|
"array-contains": "cs",
|
|
137
|
-
"array-contains-any": "csa"
|
|
194
|
+
"array-contains-any": "csa",
|
|
195
|
+
"like": "like",
|
|
196
|
+
"ilike": "ilike",
|
|
197
|
+
"not-like": "nlike",
|
|
198
|
+
"not-ilike": "nilike",
|
|
199
|
+
"is-null": "isnull",
|
|
200
|
+
"is-not-null": "notnull"
|
|
138
201
|
};
|
|
139
202
|
/** Maps REST short-code operators to their canonical equivalents. */
|
|
140
203
|
var REST_TO_CANONICAL = {
|
|
@@ -147,10 +210,26 @@ var REST_TO_CANONICAL = {
|
|
|
147
210
|
"in": "in",
|
|
148
211
|
"nin": "not-in",
|
|
149
212
|
"cs": "array-contains",
|
|
150
|
-
"csa": "array-contains-any"
|
|
213
|
+
"csa": "array-contains-any",
|
|
214
|
+
"like": "like",
|
|
215
|
+
"ilike": "ilike",
|
|
216
|
+
"nlike": "not-like",
|
|
217
|
+
"nilike": "not-ilike",
|
|
218
|
+
"isnull": "is-null",
|
|
219
|
+
"notnull": "is-not-null"
|
|
151
220
|
};
|
|
152
|
-
/**
|
|
153
|
-
|
|
221
|
+
/**
|
|
222
|
+
* Operators that test for null/not-null and therefore ignore their value.
|
|
223
|
+
* Codecs normalize the value of these conditions to `null`.
|
|
224
|
+
*/
|
|
225
|
+
var NULL_OPS = new Set(["is-null", "is-not-null"]);
|
|
226
|
+
/**
|
|
227
|
+
* Every canonical operator, in a stable order. Useful for engine capability
|
|
228
|
+
* declarations ({@link DataSourceCapabilities.filterOperators}) and for
|
|
229
|
+
* building operator subsets.
|
|
230
|
+
* @group Models
|
|
231
|
+
*/
|
|
232
|
+
var ALL_WHERE_FILTER_OPS = [
|
|
154
233
|
"<",
|
|
155
234
|
"<=",
|
|
156
235
|
"==",
|
|
@@ -160,8 +239,16 @@ var CANONICAL_OPS = new Set([
|
|
|
160
239
|
"in",
|
|
161
240
|
"not-in",
|
|
162
241
|
"array-contains",
|
|
163
|
-
"array-contains-any"
|
|
164
|
-
|
|
242
|
+
"array-contains-any",
|
|
243
|
+
"like",
|
|
244
|
+
"ilike",
|
|
245
|
+
"not-like",
|
|
246
|
+
"not-ilike",
|
|
247
|
+
"is-null",
|
|
248
|
+
"is-not-null"
|
|
249
|
+
];
|
|
250
|
+
/** All canonical operator strings for runtime validation. */
|
|
251
|
+
var CANONICAL_OPS = new Set(ALL_WHERE_FILTER_OPS);
|
|
165
252
|
/**
|
|
166
253
|
* Resolve any operator string (canonical or REST short-code) to its
|
|
167
254
|
* canonical `WhereFilterOp` form. Returns `undefined` for unknown operators.
|
|
@@ -183,21 +270,21 @@ function toCanonicalOp(op) {
|
|
|
183
270
|
* Returns true if the collection uses the Postgres engine (or the default engine).
|
|
184
271
|
* @group Models
|
|
185
272
|
*/
|
|
186
|
-
function
|
|
273
|
+
function isPostgresCollectionConfig(collection) {
|
|
187
274
|
return !collection.engine || collection.engine === "postgres";
|
|
188
275
|
}
|
|
189
276
|
/**
|
|
190
277
|
* Type guard for Firebase / Firestore collections.
|
|
191
278
|
* @group Models
|
|
192
279
|
*/
|
|
193
|
-
function
|
|
280
|
+
function isFirebaseCollectionConfig(collection) {
|
|
194
281
|
return collection.engine === "firestore";
|
|
195
282
|
}
|
|
196
283
|
/**
|
|
197
284
|
* Type guard for MongoDB collections.
|
|
198
285
|
* @group Models
|
|
199
286
|
*/
|
|
200
|
-
function
|
|
287
|
+
function isMongoDBCollectionConfig(collection) {
|
|
201
288
|
return collection.engine === "mongodb";
|
|
202
289
|
}
|
|
203
290
|
/**
|
|
@@ -206,8 +293,8 @@ function isMongoDBCollection(collection) {
|
|
|
206
293
|
* otherwise falls back to `slug`.
|
|
207
294
|
*/
|
|
208
295
|
function getCollectionDataPath(collection) {
|
|
209
|
-
if (
|
|
210
|
-
if (
|
|
296
|
+
if (isFirebaseCollectionConfig(collection) && collection.path) return collection.path;
|
|
297
|
+
if (isMongoDBCollectionConfig(collection) && collection.path) return collection.path;
|
|
211
298
|
return collection.slug;
|
|
212
299
|
}
|
|
213
300
|
/**
|
|
@@ -256,6 +343,11 @@ var policy = {
|
|
|
256
343
|
roles
|
|
257
344
|
}),
|
|
258
345
|
authenticated: () => ({ kind: "authenticated" }),
|
|
346
|
+
existsIn: (args) => ({
|
|
347
|
+
kind: "existsIn",
|
|
348
|
+
collection: args.collection,
|
|
349
|
+
where: args.where
|
|
350
|
+
}),
|
|
259
351
|
raw: (sql) => ({
|
|
260
352
|
kind: "raw",
|
|
261
353
|
sql
|
|
@@ -264,6 +356,10 @@ var policy = {
|
|
|
264
356
|
kind: "field",
|
|
265
357
|
name
|
|
266
358
|
}),
|
|
359
|
+
outerField: (name) => ({
|
|
360
|
+
kind: "outerField",
|
|
361
|
+
name
|
|
362
|
+
}),
|
|
267
363
|
literal: (value) => ({
|
|
268
364
|
kind: "literal",
|
|
269
365
|
value
|
|
@@ -320,6 +416,7 @@ var POSTGRES_CAPABILITIES = {
|
|
|
320
416
|
supportsReferences: false,
|
|
321
417
|
supportsColumnTypes: true,
|
|
322
418
|
supportsRealtime: true,
|
|
419
|
+
filterOperators: ALL_WHERE_FILTER_OPS,
|
|
323
420
|
supportsSQLAdmin: true,
|
|
324
421
|
supportsDocumentAdmin: false,
|
|
325
422
|
supportsSchemaAdmin: true
|
|
@@ -334,6 +431,7 @@ var FIREBASE_CAPABILITIES = {
|
|
|
334
431
|
supportsReferences: true,
|
|
335
432
|
supportsColumnTypes: false,
|
|
336
433
|
supportsRealtime: true,
|
|
434
|
+
filterOperators: ALL_WHERE_FILTER_OPS.filter((op) => op !== "like" && op !== "ilike" && op !== "not-like" && op !== "not-ilike"),
|
|
337
435
|
supportsSQLAdmin: false,
|
|
338
436
|
supportsDocumentAdmin: false,
|
|
339
437
|
supportsSchemaAdmin: false
|
|
@@ -348,6 +446,7 @@ var MONGODB_CAPABILITIES = {
|
|
|
348
446
|
supportsReferences: true,
|
|
349
447
|
supportsColumnTypes: false,
|
|
350
448
|
supportsRealtime: false,
|
|
449
|
+
filterOperators: ALL_WHERE_FILTER_OPS,
|
|
351
450
|
supportsSQLAdmin: false,
|
|
352
451
|
supportsDocumentAdmin: true,
|
|
353
452
|
supportsSchemaAdmin: true
|
|
@@ -366,6 +465,7 @@ var DEFAULT_CAPABILITIES = {
|
|
|
366
465
|
supportsReferences: true,
|
|
367
466
|
supportsColumnTypes: true,
|
|
368
467
|
supportsRealtime: true,
|
|
468
|
+
filterOperators: ALL_WHERE_FILTER_OPS,
|
|
369
469
|
supportsSQLAdmin: true,
|
|
370
470
|
supportsDocumentAdmin: true,
|
|
371
471
|
supportsSchemaAdmin: true
|
|
@@ -423,6 +523,33 @@ function isLazyComponentRef(ref) {
|
|
|
423
523
|
return typeof ref === "object" && ref !== null && "__rebaseLazy" in ref && ref.__rebaseLazy === true;
|
|
424
524
|
}
|
|
425
525
|
//#endregion
|
|
426
|
-
|
|
526
|
+
//#region src/controllers/storage.ts
|
|
527
|
+
/**
|
|
528
|
+
* Path prefix that marks an object as **public**. Files stored under this
|
|
529
|
+
* prefix are served without any auth token via a stable, permanent,
|
|
530
|
+
* CDN-cacheable URL (see {@link StorageSource.getSignedUrl}). Shared by the
|
|
531
|
+
* client SDK and the backend so both agree on which objects are public.
|
|
532
|
+
*
|
|
533
|
+
* @group Models
|
|
534
|
+
*/
|
|
535
|
+
var PUBLIC_STORAGE_PREFIX = "public/";
|
|
536
|
+
/**
|
|
537
|
+
* True when a storage key/path points at a public object (lives under
|
|
538
|
+
* {@link PUBLIC_STORAGE_PREFIX}). The check is applied to the key *within the
|
|
539
|
+
* bucket* — strip any `bucket/` and `scheme://` prefixes first.
|
|
540
|
+
*
|
|
541
|
+
* @group Models
|
|
542
|
+
*/
|
|
543
|
+
function isPublicStoragePath(path) {
|
|
544
|
+
if (!path) return false;
|
|
545
|
+
let p = path;
|
|
546
|
+
const scheme = p.indexOf("://");
|
|
547
|
+
if (scheme !== -1) p = p.substring(scheme + 3);
|
|
548
|
+
p = p.replace(/^\/+/, "");
|
|
549
|
+
if (p.split("/").some((seg) => seg === "..")) return false;
|
|
550
|
+
return p.startsWith("public/") || p.startsWith(`default/public/`);
|
|
551
|
+
}
|
|
552
|
+
//#endregion
|
|
553
|
+
export { ALL_WHERE_FILTER_OPS, CANONICAL_TO_REST, DEFAULT_CAPABILITIES, DEFAULT_DATA_SOURCE_KEY, DEFAULT_STORAGE_SOURCE_KEY, EntityReference, EntityRelation, FIREBASE_CAPABILITIES, GeoPoint, MONGODB_CAPABILITIES, NULL_OPS, POSTGRES_CAPABILITIES, PUBLIC_STORAGE_PREFIX, REST_TO_CANONICAL, RebaseApiError, RebaseClientError, Vector, getCollectionDataPath, getDataSourceCapabilities, getDeclaredSubcollections, isBranchAdmin, isDocumentAdmin, isFirebaseCollectionConfig, isLazyComponentRef, isMongoDBCollectionConfig, isPostgresCollectionConfig, isPublicStoragePath, isSQLAdmin, isSchemaAdmin, policy, registerDataSourceCapabilities, toCanonicalOp };
|
|
427
554
|
|
|
428
555
|
//# sourceMappingURL=index.es.js.map
|