@rebasepro/common 0.19.2-canary.gef769df → 0.20.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/dist/data/buildRebaseData.d.ts +2 -12
- package/dist/index.es.js +153 -30
- package/dist/index.es.js.map +1 -1
- package/dist/util/entities.d.ts +17 -0
- package/package.json +3 -3
package/dist/util/entities.d.ts
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import { DataType, Entity, EntityReference, EntityRelation, EntityStatus, EntityValues, Properties, Property } from "@rebasepro/types";
|
|
2
2
|
export declare function isPropertyBuilder(property?: Property): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* What a form opens with: a value for every property it can write.
|
|
5
|
+
*
|
|
6
|
+
* `excludeFromApi` columns are left out, and that is the whole of the rule —
|
|
7
|
+
* they are not part of the API surface in either direction, so there is nothing
|
|
8
|
+
* for a form to open showing and nothing it may send back. Including them was
|
|
9
|
+
* not cosmetic: the baseline is what gets submitted, so a new record carried
|
|
10
|
+
* `passwordHash: null` and `emailVerificationToken: null` into the create, and
|
|
11
|
+
* the server refused the whole write with "these columns are the server's to
|
|
12
|
+
* set" — the users collection could not be added to from the panel at all. The
|
|
13
|
+
* fields were invisible on screen (`admin.disabled.hidden`), which is what made
|
|
14
|
+
* the error read as being about the roles the operator *had* just edited.
|
|
15
|
+
*
|
|
16
|
+
* Server-side defaulting does not come through here: `applyDefaultValuesOnCreate`
|
|
17
|
+
* asks each property for its own default, so an excluded column with a declared
|
|
18
|
+
* `defaultValue` is still filled in on an in-process write.
|
|
19
|
+
*/
|
|
3
20
|
export declare function getDefaultValuesFor<M extends Record<string, unknown>>(properties: Properties): Partial<EntityValues<M>>;
|
|
4
21
|
export declare function getDefaultValueFor(property?: Property): unknown;
|
|
5
22
|
export declare function getDefaultValueFortype(type: DataType): unknown;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebasepro/common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "Rebase shared core — collection registry, data driver adapter and fluent query builder. No React dependency.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rebase",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"fast-equals": "6.0.2",
|
|
46
46
|
"json-logic-js": "^2.0.5",
|
|
47
|
-
"@rebasepro/types": "0.
|
|
48
|
-
"@rebasepro/utils": "0.
|
|
47
|
+
"@rebasepro/types": "0.20.0",
|
|
48
|
+
"@rebasepro/utils": "0.20.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@jest/globals": "^30.4.1",
|