@rebasepro/common 0.11.0 → 0.11.1-canary.g8caabf3
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/dist/util/entities.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export interface RelationRefWithData extends RelationRef {
|
|
|
49
49
|
readonly data: Entity;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
* Create a lightweight relation stub for
|
|
52
|
+
* Create a lightweight relation stub for admin views.
|
|
53
53
|
* Replaces inline `{ id, path, __type: "relation" }` object literals.
|
|
54
54
|
*/
|
|
55
55
|
export declare function createRelationRef(id: string | number, path: string): RelationRef;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebasepro/common",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.1-canary.g8caabf3",
|
|
5
5
|
"description": "Awesome Firebase/Firestore-based headless open-source CMS",
|
|
6
6
|
"funding": {
|
|
7
7
|
"url": "https://github.com/sponsors/rebaseco"
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"fast-equals": "6.0.0",
|
|
42
42
|
"json-logic-js": "^2.0.5",
|
|
43
|
-
"@rebasepro/types": "0.11.
|
|
44
|
-
"@rebasepro/utils": "0.11.
|
|
43
|
+
"@rebasepro/types": "0.11.1-canary.g8caabf3",
|
|
44
|
+
"@rebasepro/utils": "0.11.1-canary.g8caabf3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@jest/globals": "^30.4.1",
|
|
@@ -453,7 +453,7 @@ function toSdkCollectionClient<M extends Record<string, unknown>>(
|
|
|
453
453
|
/**
|
|
454
454
|
* Wrap a flat {@link SDKCollectionClient} into a Entity-shaped
|
|
455
455
|
* {@link CollectionAccessor}. Every returned row is re-wrapped into the
|
|
456
|
-
* `{ id, path, values }` view-model the admin
|
|
456
|
+
* `{ id, path, values }` view-model the admin admin renders.
|
|
457
457
|
*/
|
|
458
458
|
function toEntityAccessor<M extends Record<string, unknown>>(
|
|
459
459
|
sdk: SDKCollectionClient<M>,
|
|
@@ -508,10 +508,10 @@ function toEntityAccessor<M extends Record<string, unknown>>(
|
|
|
508
508
|
/**
|
|
509
509
|
* Wrap a flat {@link RebaseSdkData} into a Entity-shaped {@link RebaseData}.
|
|
510
510
|
*
|
|
511
|
-
* This is the **
|
|
511
|
+
* This is the **admin boundary**: the SDK client (`client.data`) returns flat
|
|
512
512
|
* rows, but the admin renders the `Entity` view-model (`entity.values.*`).
|
|
513
513
|
* `core/Rebase.tsx` wraps `client.data` through this before handing it to the
|
|
514
|
-
*
|
|
514
|
+
* admin `RebaseDataContext` — without it the admin renders rows with only their
|
|
515
515
|
* `id`.
|
|
516
516
|
*/
|
|
517
517
|
export function wrapAsEntityData(sdkData: RebaseSdkData, options?: EntityDataOptions): RebaseData {
|
|
@@ -577,7 +577,7 @@ export function wrapAsSdkData(entityData: RebaseData): RebaseSdkData {
|
|
|
577
577
|
* This is the developer-facing SDK data layer used by backend framework
|
|
578
578
|
* callbacks & scripts (`context.data` / `rebase.data`). It returns flat rows —
|
|
579
579
|
* identical in shape to the frontend SDK client — so the API is symmetric
|
|
580
|
-
* across front and back. The admin
|
|
580
|
+
* across front and back. The admin uses {@link buildRebaseData} (Entity).
|
|
581
581
|
*/
|
|
582
582
|
export function buildSdkData(driver: DataDriver): RebaseSdkData {
|
|
583
583
|
return wrapAsSdkData(buildRebaseData(driver));
|
package/src/util/entities.ts
CHANGED
|
@@ -247,7 +247,7 @@ export interface RelationRefWithData extends RelationRef {
|
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
/**
|
|
250
|
-
* Create a lightweight relation stub for
|
|
250
|
+
* Create a lightweight relation stub for admin views.
|
|
251
251
|
* Replaces inline `{ id, path, __type: "relation" }` object literals.
|
|
252
252
|
*/
|
|
253
253
|
export function createRelationRef(id: string | number, path: string): RelationRef {
|