@rebasepro/common 0.0.1-canary.0 → 0.0.1-canary.0e2f892
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 +3 -3
- package/dist/collections/CollectionRegistry.d.ts +10 -2
- package/dist/data/buildRebaseData.d.ts +14 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +635 -853
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +653 -871
- package/dist/index.umd.js.map +1 -1
- package/dist/util/builders.d.ts +6 -13
- package/dist/util/collections.d.ts +2 -2
- package/dist/util/entities.d.ts +38 -8
- package/dist/util/index.d.ts +1 -11
- package/dist/util/navigation_from_path.d.ts +10 -5
- package/dist/util/navigation_utils.d.ts +1 -12
- package/dist/util/permissions.d.ts +4 -4
- package/dist/util/references.d.ts +1 -1
- package/dist/util/relations.d.ts +10 -0
- package/dist/util/resolutions.d.ts +11 -13
- package/dist/util/storage.d.ts +4 -4
- package/package.json +106 -113
- package/src/collections/CollectionRegistry.ts +220 -48
- package/src/data/buildRebaseData.ts +285 -0
- package/src/index.ts +1 -0
- package/src/types/json-logic-js.d.ts +8 -0
- package/src/util/builders.ts +9 -19
- package/src/util/callbacks.ts +6 -6
- package/src/util/collections.ts +11 -8
- package/src/util/conditions.ts +6 -6
- package/src/util/entities.ts +74 -15
- package/src/util/index.ts +1 -11
- package/src/util/navigation_from_path.ts +9 -8
- package/src/util/navigation_utils.ts +4 -56
- package/src/util/parent_references_from_path.ts +4 -3
- package/src/util/permissions.test.ts +233 -115
- package/src/util/permissions.ts +26 -26
- package/src/util/references.ts +16 -2
- package/src/util/relations.ts +109 -29
- package/src/util/resolutions.ts +83 -83
- package/src/util/storage.ts +5 -5
- package/dist/util/arrays.d.ts +0 -1
- package/dist/util/dates.d.ts +0 -1
- package/dist/util/entity_actions.d.ts +0 -2
- package/dist/util/fields.d.ts +0 -2
- package/dist/util/flatten_object.d.ts +0 -5
- package/dist/util/hash.d.ts +0 -1
- package/dist/util/names.d.ts +0 -22
- package/dist/util/objects.d.ts +0 -26
- package/dist/util/os.d.ts +0 -2
- package/dist/util/plurals.d.ts +0 -16
- package/dist/util/regexp.d.ts +0 -7
- package/dist/util/strings.d.ts +0 -7
- package/src/util/arrays.ts +0 -3
- package/src/util/dates.ts +0 -1
- package/src/util/entity_actions.ts +0 -28
- package/src/util/fields.ts +0 -28
- package/src/util/flatten_object.ts +0 -45
- package/src/util/hash.ts +0 -11
- package/src/util/names.ts +0 -30
- package/src/util/objects.ts +0 -376
- package/src/util/os.ts +0 -13
- package/src/util/plurals.ts +0 -188
- package/src/util/regexp.ts +0 -32
- package/src/util/strings.ts +0 -84
package/README.md
CHANGED
|
@@ -69,9 +69,9 @@ Rebase has been meticulously crafted to make it incredibly easy for developers
|
|
|
69
69
|
to build a CMS/admin tool while offering an excellent data editing experience
|
|
70
70
|
and a user-friendly interface for marketers and content managers.
|
|
71
71
|
|
|
72
|
-
### 🏓 Exceptional
|
|
72
|
+
### 🏓 Exceptional Table View
|
|
73
73
|
|
|
74
|
-
We've developed a highly efficient windowed **
|
|
74
|
+
We've developed a highly efficient windowed **table view** for
|
|
75
75
|
collections, allowing inline editing for most common fields, as well as popup
|
|
76
76
|
views for other cases and your custom field implementations.
|
|
77
77
|
|
|
@@ -138,7 +138,7 @@ You can replace the Firebase Storage implementation with your own.
|
|
|
138
138
|
## Included example
|
|
139
139
|
|
|
140
140
|
You can access the code for the demo project under
|
|
141
|
-
[`example`](https://github.com/
|
|
141
|
+
[`example`](https://github.com/rebasepro/rebase/tree/master/example). It includes
|
|
142
142
|
every feature provided by this CMS.
|
|
143
143
|
|
|
144
144
|
Keep in mind you need to update the dependencies in that project if you want to
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { EntityCollection } from "@rebasepro/types";
|
|
2
2
|
export declare class CollectionRegistry {
|
|
3
|
-
private
|
|
3
|
+
private collectionsByTableName;
|
|
4
4
|
private collectionsBySlug;
|
|
5
5
|
private rootCollections;
|
|
6
|
-
private
|
|
6
|
+
private cachedCollectionsList;
|
|
7
|
+
private rawCollectionsByTableName;
|
|
7
8
|
private rawCollectionsBySlug;
|
|
8
9
|
private rawRootCollections;
|
|
10
|
+
private cachedRawCollectionsList;
|
|
9
11
|
private lastRawInputSnapshot;
|
|
10
12
|
constructor(collections?: EntityCollection[]);
|
|
11
13
|
reset(): void;
|
|
@@ -21,6 +23,12 @@ export declare class CollectionRegistry {
|
|
|
21
23
|
register(collection: EntityCollection, rawCollection?: EntityCollection): void;
|
|
22
24
|
private _registerRecursively;
|
|
23
25
|
normalizeCollection(collection: EntityCollection): EntityCollection;
|
|
26
|
+
/**
|
|
27
|
+
* Extract Relation[] from properties that have inline relation config (i.e. `target` is set).
|
|
28
|
+
* This allows developers to define relations directly on properties without a separate
|
|
29
|
+
* `relations[]` entry on the collection.
|
|
30
|
+
*/
|
|
31
|
+
private extractRelationsFromProperties;
|
|
24
32
|
private normalizeProperties;
|
|
25
33
|
private normalizeProperty;
|
|
26
34
|
get(path: string): EntityCollection | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DataDriver, RebaseData } from "@rebasepro/types";
|
|
2
|
+
/**
|
|
3
|
+
* Build a `RebaseData` object from a `DataDriver` using JavaScript Proxy.
|
|
4
|
+
*
|
|
5
|
+
* This is the key bridge: any property access like `data.products` returns
|
|
6
|
+
* a `CollectionAccessor` backed by the underlying DataDriver, without
|
|
7
|
+
* needing per-collection code generation.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const data = buildRebaseData(driver);
|
|
11
|
+
* await data.products.create({ name: "Camera", price: 299 });
|
|
12
|
+
* const { data: items } = await data.products.find({ where: { status: "eq.published" } });
|
|
13
|
+
*/
|
|
14
|
+
export declare function buildRebaseData(driver: DataDriver): RebaseData;
|
package/dist/index.d.ts
CHANGED