@atscript/ui 0.1.177 → 0.1.179
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/form/diff.cjs +107 -105
- package/dist/form/diff.mjs +107 -105
- package/dist/shared/annotation-keys.cjs +2 -2
- package/dist/shared/annotation-keys.mjs +2 -2
- package/package.json +9 -9
package/dist/form/diff.cjs
CHANGED
|
@@ -4,6 +4,8 @@ const require_field_resolver = require("../shared/field-resolver.cjs");
|
|
|
4
4
|
const require_path_utils = require("./path-utils.cjs");
|
|
5
5
|
const require_skipped_nav = require("./skipped-nav.cjs");
|
|
6
6
|
const require_create_form_def = require("./create-form-def.cjs");
|
|
7
|
+
let _atscript_typescript_utils = require("@atscript/typescript/utils");
|
|
8
|
+
let _atscript_db_validator = require("@atscript/db/validator");
|
|
7
9
|
//#region src/form/diff.ts
|
|
8
10
|
/**
|
|
9
11
|
* Diffs a form's `current` data against its `baseline` snapshot, producing both
|
|
@@ -35,7 +37,10 @@ function buildFormDiff(def, baseline, current, opts) {
|
|
|
35
37
|
};
|
|
36
38
|
}
|
|
37
39
|
const versionColumn = require_create_form_def.findVersionColumn(def.flatMap);
|
|
38
|
-
|
|
40
|
+
if (def.type.type.kind === "object") {
|
|
41
|
+
const mergePaths = (0, _atscript_db_validator.mergeStrategyPaths)(def.type);
|
|
42
|
+
diffFields(def.fields, "", baseline, current, changes, patch, mergePaths, versionColumn);
|
|
43
|
+
} else diffLeafRoot(def, baseline, current, changes, patch);
|
|
39
44
|
if ((opts?.cas ?? true) && versionColumn && Object.keys(patch).length > 0) {
|
|
40
45
|
const baselineVersion = require_path_utils.getByPath(baseline, versionColumn);
|
|
41
46
|
if (typeof baselineVersion === "number" && Number.isInteger(baselineVersion)) patch.$cas = { [versionColumn]: baselineVersion };
|
|
@@ -52,44 +57,57 @@ function buildFormDiff(def, baseline, current, opts) {
|
|
|
52
57
|
* patch entries are written into the local `patch` object so callers can place
|
|
53
58
|
* the whole sub-object as a nested partial.
|
|
54
59
|
*
|
|
60
|
+
* `mergePaths` is `mergeStrategyPaths` of `@atscript/db` for the form's type:
|
|
61
|
+
* the form-root paths (a field's `fullPath`, no array indices) where the
|
|
62
|
+
* server applies the merge strategy (atscript-db "Where Merge Applies"). An
|
|
63
|
+
* object there may be sent in part, and a keyed array there merges its
|
|
64
|
+
* `$update` items; every other object is sent whole.
|
|
65
|
+
*
|
|
55
66
|
* `versionColumn` is the top-level `@db.column.version` field name (or
|
|
56
67
|
* undefined). When set, the matching top-level field is skipped entirely — it
|
|
57
68
|
* is server-managed and may only be round-tripped via `$cas`.
|
|
58
|
-
*
|
|
59
|
-
* `inlineFlatMap` is the form's `flatMap`, supplied only at the top-level walk.
|
|
60
|
-
* It lets {@link diffScalarField} read `@db.patch.strategy` off the object
|
|
61
|
-
* ancestors of an INLINED leaf (a dotted-path leaf with no `FormObjectFieldDef`
|
|
62
|
-
* node — `createFormDef` dissolves unlabelled objects into dot-paths). At a
|
|
63
|
-
* default (replace) ancestor the whole sub-object must be emitted. It is
|
|
64
|
-
* intentionally NOT propagated into `diffObjectField` recursion, where the
|
|
65
|
-
* strategy decision is already made per structured object.
|
|
66
69
|
*/
|
|
67
|
-
function diffFields(fields, prefix, baseline, current, changes, patch,
|
|
70
|
+
function diffFields(fields, prefix, baseline, current, changes, patch, mergePaths, versionColumn) {
|
|
68
71
|
for (const field of fields) {
|
|
69
|
-
if (field.path === "" && fields.length === 1) {
|
|
70
|
-
diffLeafRoot(field, baseline, current, changes, patch);
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
72
|
if (field.phantom || field.derived || versionColumn !== void 0 && !prefix && field.path === versionColumn) continue;
|
|
74
73
|
const fullPath = prefix ? `${prefix}.${field.path}` : field.path;
|
|
75
74
|
if (require_types.isArrayField(field)) {
|
|
76
|
-
diffArrayField(field, fullPath, baseline, current, changes, patch,
|
|
75
|
+
diffArrayField(field, fullPath, baseline, current, changes, patch, mergePaths);
|
|
77
76
|
continue;
|
|
78
77
|
}
|
|
79
78
|
if (require_types.isObjectField(field)) {
|
|
80
|
-
diffObjectField(field, fullPath, baseline, current, changes, patch);
|
|
79
|
+
diffObjectField(field, fullPath, baseline, current, changes, patch, mergePaths);
|
|
81
80
|
continue;
|
|
82
81
|
}
|
|
83
|
-
diffScalarField(field, fullPath, baseline, current, changes, patch,
|
|
82
|
+
diffScalarField(field, fullPath, baseline, current, changes, patch, mergePaths);
|
|
84
83
|
}
|
|
85
84
|
}
|
|
86
|
-
/**
|
|
87
|
-
|
|
85
|
+
/** The patch key of a single-leaf root form (non-object root): its patch is `{ value }`. */
|
|
86
|
+
const LEAF_ROOT_KEY = "value";
|
|
87
|
+
/** {@link leafRootMergePaths} per root type. */
|
|
88
|
+
const leafRootMergePathsByType = /* @__PURE__ */ new WeakMap();
|
|
89
|
+
/**
|
|
90
|
+
* `mergeStrategyPaths` of a single-leaf root form, read off the `{ value }`
|
|
91
|
+
* shape of its patch. Cached per root type: building a type invalidates the
|
|
92
|
+
* type caches of `@atscript/typescript`.
|
|
93
|
+
*/
|
|
94
|
+
function leafRootMergePaths(type) {
|
|
95
|
+
let paths = leafRootMergePathsByType.get(type);
|
|
96
|
+
if (!paths) {
|
|
97
|
+
paths = (0, _atscript_db_validator.mergeStrategyPaths)((0, _atscript_typescript_utils.defineAnnotatedType)("object").prop(LEAF_ROOT_KEY, type).$type);
|
|
98
|
+
leafRootMergePathsByType.set(type, paths);
|
|
99
|
+
}
|
|
100
|
+
return paths;
|
|
101
|
+
}
|
|
102
|
+
/** Single-leaf root form (non-object root): its whole value is the patch's `value`. */
|
|
103
|
+
function diffLeafRoot(def, baseline, current, changes, patch) {
|
|
104
|
+
const field = def.rootField;
|
|
88
105
|
const before = require_path_utils.getByPath(baseline, "");
|
|
89
106
|
const after = require_path_utils.getByPath(current, "");
|
|
90
107
|
if (deepEqual(before, after)) return;
|
|
108
|
+
const mergePaths = leafRootMergePaths(def.type);
|
|
91
109
|
if (require_types.isArrayField(field)) {
|
|
92
|
-
const arrayPatch = diffArray(field, before, after);
|
|
110
|
+
const arrayPatch = diffArray(field, before, after, mergePaths.has(LEAF_ROOT_KEY));
|
|
93
111
|
if (arrayPatch === void 0) return;
|
|
94
112
|
changes.push({
|
|
95
113
|
path: "",
|
|
@@ -97,7 +115,7 @@ function diffLeafRoot(field, baseline, current, changes, patch) {
|
|
|
97
115
|
before,
|
|
98
116
|
after
|
|
99
117
|
});
|
|
100
|
-
patch
|
|
118
|
+
patch[LEAF_ROOT_KEY] = arrayPatch;
|
|
101
119
|
} else {
|
|
102
120
|
changes.push({
|
|
103
121
|
path: "",
|
|
@@ -105,11 +123,11 @@ function diffLeafRoot(field, baseline, current, changes, patch) {
|
|
|
105
123
|
before,
|
|
106
124
|
after
|
|
107
125
|
});
|
|
108
|
-
patch
|
|
126
|
+
patch[LEAF_ROOT_KEY] = wholeValue(LEAF_ROOT_KEY, before, after, mergePaths) ?? null;
|
|
109
127
|
}
|
|
110
128
|
}
|
|
111
129
|
/** Scalar / union / tuple / ref field — whole-value compare; clear → null. */
|
|
112
|
-
function diffScalarField(field, fullPath, baseline, current, changes, patch,
|
|
130
|
+
function diffScalarField(field, fullPath, baseline, current, changes, patch, mergePaths) {
|
|
113
131
|
const before = require_path_utils.getByPath(baseline, fullPath);
|
|
114
132
|
const after = require_path_utils.getByPath(current, fullPath);
|
|
115
133
|
if (deepEqual(before, after)) return;
|
|
@@ -119,106 +137,89 @@ function diffScalarField(field, fullPath, baseline, current, changes, patch, inl
|
|
|
119
137
|
before,
|
|
120
138
|
after
|
|
121
139
|
});
|
|
122
|
-
|
|
123
|
-
setPatchLeaf(patch, field.path, after === void 0 ? null : after);
|
|
140
|
+
setFieldPatch(field, fullPath, wholeValue(fullPath, before, after, mergePaths) ?? null, baseline, current, patch, mergePaths);
|
|
124
141
|
}
|
|
125
142
|
/**
|
|
126
|
-
*
|
|
127
|
-
* `
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
* at the SHALLOWEST such ancestor.
|
|
131
|
-
* `@db.column.version` exclusion already happened. Returns whether it did.
|
|
143
|
+
* Writes a changed field's patch `value` at its `field.path` in the local
|
|
144
|
+
* `patch` (relative to the current context, so possibly dotted). A dotted
|
|
145
|
+
* path runs through objects `createFormDef` dissolved into dot-paths; where
|
|
146
|
+
* one of them is outside `mergePaths`, the patch may not carry part of it, so
|
|
147
|
+
* the whole current object goes out at the SHALLOWEST such ancestor instead.
|
|
132
148
|
*/
|
|
133
|
-
function
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
149
|
+
function setFieldPatch(field, fullPath, value, baseline, current, patch, mergePaths) {
|
|
150
|
+
const prefix = fullPath.slice(0, fullPath.length - field.path.length);
|
|
151
|
+
for (let dot = field.path.indexOf("."); dot !== -1; dot = field.path.indexOf(".", dot + 1)) {
|
|
152
|
+
const ancestor = field.path.slice(0, dot);
|
|
153
|
+
const path = prefix + ancestor;
|
|
154
|
+
if (mergePaths.has(path)) continue;
|
|
155
|
+
setPatchLeaf(patch, ancestor, wholeValue(path, require_path_utils.getByPath(baseline, path), require_path_utils.getByPath(current, path), mergePaths) ?? null);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
setPatchLeaf(patch, field.path, value);
|
|
141
159
|
}
|
|
142
160
|
/**
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
* Walks ancestor segments (`a`, `a.b`, … but not the leaf itself); the first
|
|
150
|
-
* one that is an object AND not merge is the cutoff. merge does NOT propagate,
|
|
151
|
-
* so a default-replace level below a merge level still cuts off there.
|
|
161
|
+
* `after`, the current value at `path`, to send whole. The server still
|
|
162
|
+
* merges every object inside it at a merge path — a merge object inside a
|
|
163
|
+
* replaced one, a merge `T | null` field — and keeps the children a patch
|
|
164
|
+
* leaves out there, so a child set in `before` and unset in `after` goes out
|
|
165
|
+
* as `null`. Copies only the objects it changes; the rest stays a live
|
|
166
|
+
* reference into `current`.
|
|
152
167
|
*/
|
|
153
|
-
function
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
if (
|
|
168
|
+
function wholeValue(path, before, after, mergePaths) {
|
|
169
|
+
if (mergePaths.size === 0 || !require_path_utils.isPlainObject(before) || !require_path_utils.isPlainObject(after)) return after;
|
|
170
|
+
const merge = mergePaths.has(path);
|
|
171
|
+
let out;
|
|
172
|
+
for (const k of Object.keys(before)) {
|
|
173
|
+
const value = after[k];
|
|
174
|
+
const sent = merge && value === void 0 && before[k] !== void 0 && before[k] !== null ? null : wholeValue(`${path}.${k}`, before[k], value, mergePaths);
|
|
175
|
+
if (sent !== value) (out ??= { ...after })[k] = sent;
|
|
161
176
|
}
|
|
177
|
+
return out ?? after;
|
|
162
178
|
}
|
|
163
179
|
/**
|
|
164
180
|
* Inlined-or-structured object field — recurse, emit a nested partial OR the
|
|
165
|
-
* whole sub-object
|
|
181
|
+
* whole sub-object.
|
|
166
182
|
*
|
|
167
183
|
* atscript-db's DEFAULT nested-object patch strategy is `replace` (strict —
|
|
168
184
|
* every required child must be present, else 400; omitted optionals are
|
|
169
|
-
* null-filled). A changed-leaves-only partial is a valid patch ONLY
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
* descendant object without its own `merge` again emits its full sub-object
|
|
174
|
-
* (handled by recursion — `diffFields` re-enters this function per child).
|
|
185
|
+
* null-filled). A changed-leaves-only partial is a valid patch ONLY where the
|
|
186
|
+
* merge strategy applies — the object's path is in `mergePaths`. Anywhere else
|
|
187
|
+
* we emit the WHOLE current sub-object so the validator passes and no optional
|
|
188
|
+
* leaf is silently nulled.
|
|
175
189
|
*
|
|
176
190
|
* Wholesale-clear: if the sub-object was a defined object in `baseline` but is
|
|
177
191
|
* now undefined/null, emit `field: null` (object removed) instead of a partial
|
|
178
192
|
* of nulled leaves.
|
|
179
193
|
*/
|
|
180
|
-
function diffObjectField(field, fullPath, baseline, current, changes, patch) {
|
|
194
|
+
function diffObjectField(field, fullPath, baseline, current, changes, patch, mergePaths) {
|
|
181
195
|
const beforeObj = require_path_utils.getByPath(baseline, fullPath);
|
|
182
196
|
const afterObj = require_path_utils.getByPath(current, fullPath);
|
|
183
197
|
if (!require_path_utils.isPlainObject(beforeObj) && !require_path_utils.isPlainObject(afterObj)) return;
|
|
184
198
|
const nested = {};
|
|
185
199
|
const changesBefore = changes.length;
|
|
186
|
-
diffFields(field.objectDef.fields, fullPath, baseline, current, changes, nested,
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
if (Object.keys(nested).length === 0) return;
|
|
198
|
-
if (isMergePatched(field.prop)) setPatchLeaf(patch, field.path, nested);
|
|
199
|
-
else setPatchLeaf(patch, field.path, afterObj === void 0 ? null : afterObj);
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Whether a field's patch may carry only its changed leaves: a
|
|
203
|
-
* `@db.patch.strategy 'merge'` field that is not `@db.json` (a JSON value is
|
|
204
|
-
* stored, and so replaced, whole). For an object field this decides the nested
|
|
205
|
-
* partial; for a keyed array field, the shape of its `$update` items.
|
|
206
|
-
*/
|
|
207
|
-
function isMergePatched(prop) {
|
|
208
|
-
return require_field_resolver.getFieldMeta(prop, "db.patch.strategy") === "merge" && require_field_resolver.getFieldMeta(prop, "db.json") === void 0;
|
|
200
|
+
diffFields(field.objectDef.fields, fullPath, baseline, current, changes, nested, mergePaths);
|
|
201
|
+
const cleared = (afterObj === void 0 || afterObj === null) && require_path_utils.isPlainObject(beforeObj);
|
|
202
|
+
if (!cleared && Object.keys(nested).length === 0) return;
|
|
203
|
+
if (cleared && changes.length === changesBefore) changes.push({
|
|
204
|
+
path: fullPath,
|
|
205
|
+
kind: "set",
|
|
206
|
+
before: beforeObj,
|
|
207
|
+
after: afterObj
|
|
208
|
+
});
|
|
209
|
+
setFieldPatch(field, fullPath, !cleared && mergePaths.has(fullPath) ? nested : wholeValue(fullPath, beforeObj, afterObj, mergePaths) ?? null, baseline, current, patch, mergePaths);
|
|
209
210
|
}
|
|
210
211
|
/**
|
|
211
212
|
* Array field — keyed → $update/$insert/$remove; unkeyed → $replace. A
|
|
212
|
-
* `@db.json` array is stored as one
|
|
213
|
-
* operations: it is sent whole (`null`
|
|
214
|
-
*
|
|
215
|
-
* any leaf there.
|
|
213
|
+
* `@db.json` or `@db.encrypted` array is stored as one value (JSON /
|
|
214
|
+
* ciphertext), which takes no array operations: it is sent whole (`null`
|
|
215
|
+
* when cleared). An array inside a dissolved object the merge strategy does
|
|
216
|
+
* not apply to is sent with that whole sub-object, like any leaf there.
|
|
216
217
|
*/
|
|
217
|
-
function diffArrayField(field, fullPath, baseline, current, changes, patch,
|
|
218
|
+
function diffArrayField(field, fullPath, baseline, current, changes, patch, mergePaths) {
|
|
218
219
|
const before = require_path_utils.getByPath(baseline, fullPath);
|
|
219
220
|
const after = require_path_utils.getByPath(current, fullPath);
|
|
220
221
|
if (deepEqual(before, after)) return;
|
|
221
|
-
const value = require_field_resolver.getFieldMeta(field.prop, "db.json") !== void 0 ? after ?? null : diffArray(field, before, after);
|
|
222
|
+
const value = require_field_resolver.getFieldMeta(field.prop, "db.json") !== void 0 || require_field_resolver.getFieldMeta(field.prop, "db.encrypted") !== void 0 ? after ?? null : diffArray(field, before, after, mergePaths.has(fullPath));
|
|
222
223
|
if (value === void 0) return;
|
|
223
224
|
changes.push({
|
|
224
225
|
path: fullPath,
|
|
@@ -226,8 +227,7 @@ function diffArrayField(field, fullPath, baseline, current, changes, patch, inli
|
|
|
226
227
|
before,
|
|
227
228
|
after
|
|
228
229
|
});
|
|
229
|
-
|
|
230
|
-
setPatchLeaf(patch, field.path, value);
|
|
230
|
+
setFieldPatch(field, fullPath, value, baseline, current, patch, mergePaths);
|
|
231
231
|
}
|
|
232
232
|
/**
|
|
233
233
|
* Produces a `TArrayPatch` value for one array field, or `undefined` when no
|
|
@@ -244,12 +244,14 @@ function diffArrayField(field, fullPath, baseline, current, changes, patch, inli
|
|
|
244
244
|
* (pure append) rather than `$upsert`. This is safe because `$insert` is only
|
|
245
245
|
* ever used for keys ABSENT from baseline; existing keys go through `$update`.
|
|
246
246
|
* `$upsert` would dedupe-by-key, which we don't need given that invariant.
|
|
247
|
+
*
|
|
248
|
+
* `merge`: the array's path is in `mergePaths` ({@link diffKeyedArray}).
|
|
247
249
|
*/
|
|
248
|
-
function diffArray(field, before, after) {
|
|
250
|
+
function diffArray(field, before, after, merge) {
|
|
249
251
|
const beforeArr = Array.isArray(before) ? before : [];
|
|
250
252
|
const afterArr = Array.isArray(after) ? after : [];
|
|
251
253
|
const keyProps = getArrayKeyProps(field.itemType);
|
|
252
|
-
if (keyProps.length > 0) return diffKeyedArray(beforeArr, afterArr, keyProps,
|
|
254
|
+
if (keyProps.length > 0) return diffKeyedArray(beforeArr, afterArr, keyProps, merge);
|
|
253
255
|
if (require_field_resolver.getFieldMeta(field.prop, "expect.array.uniqueItems") !== void 0 && isPrimitiveItem(field)) {
|
|
254
256
|
const setPatch = diffUniqueArray(beforeArr, afterArr);
|
|
255
257
|
if (setPatch) return setPatch;
|
|
@@ -272,14 +274,14 @@ function diffArray(field, before, after) {
|
|
|
272
274
|
* removed and re-added under the same key elsewhere. A new row appended at the
|
|
273
275
|
* end and an edited key on the last row stay key operators.
|
|
274
276
|
*
|
|
275
|
-
* A `$update` item follows the array field's
|
|
276
|
-
* whether
|
|
277
|
-
* the db replaces the matched element, so the item is
|
|
278
|
-
* element minus its `undefined`-valued props; under `merge`
|
|
279
|
-
* merges the item in, so it is the key + the changed top-level
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
* leaf changed.
|
|
277
|
+
* A `$update` item follows the array field's patch strategy (`merge` is
|
|
278
|
+
* whether the merge strategy applies to the array), which the db applies to
|
|
279
|
+
* it: by default (replace) the db replaces the matched element, so the item is
|
|
280
|
+
* the whole current element minus its `undefined`-valued props; under `merge`
|
|
281
|
+
* the db shallow-merges the item in, so it is the key + the changed top-level
|
|
282
|
+
* leaves, a cleared leaf as `null` ({@link buildKeyedUpdate}). A nested object
|
|
283
|
+
* of an element is sent whole either way: no merge strategy applies inside an
|
|
284
|
+
* array element. An item is emitted only when some leaf changed.
|
|
283
285
|
*
|
|
284
286
|
* Fallbacks to `{ $replace: after }`, the only faithful op, when:
|
|
285
287
|
* - key identity is ambiguous — an element that is not an object or lacks ALL
|
package/dist/form/diff.mjs
CHANGED
|
@@ -4,6 +4,8 @@ import { getFieldMeta } from "../shared/field-resolver.mjs";
|
|
|
4
4
|
import { getByPath, isPlainObject } from "./path-utils.mjs";
|
|
5
5
|
import { hasNestedSkippedNavFields, omitSkippedNavFields } from "./skipped-nav.mjs";
|
|
6
6
|
import { findVersionColumn } from "./create-form-def.mjs";
|
|
7
|
+
import { defineAnnotatedType } from "@atscript/typescript/utils";
|
|
8
|
+
import { mergeStrategyPaths } from "@atscript/db/validator";
|
|
7
9
|
//#region src/form/diff.ts
|
|
8
10
|
/**
|
|
9
11
|
* Diffs a form's `current` data against its `baseline` snapshot, producing both
|
|
@@ -35,7 +37,10 @@ function buildFormDiff(def, baseline, current, opts) {
|
|
|
35
37
|
};
|
|
36
38
|
}
|
|
37
39
|
const versionColumn = findVersionColumn(def.flatMap);
|
|
38
|
-
|
|
40
|
+
if (def.type.type.kind === "object") {
|
|
41
|
+
const mergePaths = mergeStrategyPaths(def.type);
|
|
42
|
+
diffFields(def.fields, "", baseline, current, changes, patch, mergePaths, versionColumn);
|
|
43
|
+
} else diffLeafRoot(def, baseline, current, changes, patch);
|
|
39
44
|
if ((opts?.cas ?? true) && versionColumn && Object.keys(patch).length > 0) {
|
|
40
45
|
const baselineVersion = getByPath(baseline, versionColumn);
|
|
41
46
|
if (typeof baselineVersion === "number" && Number.isInteger(baselineVersion)) patch.$cas = { [versionColumn]: baselineVersion };
|
|
@@ -52,44 +57,57 @@ function buildFormDiff(def, baseline, current, opts) {
|
|
|
52
57
|
* patch entries are written into the local `patch` object so callers can place
|
|
53
58
|
* the whole sub-object as a nested partial.
|
|
54
59
|
*
|
|
60
|
+
* `mergePaths` is `mergeStrategyPaths` of `@atscript/db` for the form's type:
|
|
61
|
+
* the form-root paths (a field's `fullPath`, no array indices) where the
|
|
62
|
+
* server applies the merge strategy (atscript-db "Where Merge Applies"). An
|
|
63
|
+
* object there may be sent in part, and a keyed array there merges its
|
|
64
|
+
* `$update` items; every other object is sent whole.
|
|
65
|
+
*
|
|
55
66
|
* `versionColumn` is the top-level `@db.column.version` field name (or
|
|
56
67
|
* undefined). When set, the matching top-level field is skipped entirely — it
|
|
57
68
|
* is server-managed and may only be round-tripped via `$cas`.
|
|
58
|
-
*
|
|
59
|
-
* `inlineFlatMap` is the form's `flatMap`, supplied only at the top-level walk.
|
|
60
|
-
* It lets {@link diffScalarField} read `@db.patch.strategy` off the object
|
|
61
|
-
* ancestors of an INLINED leaf (a dotted-path leaf with no `FormObjectFieldDef`
|
|
62
|
-
* node — `createFormDef` dissolves unlabelled objects into dot-paths). At a
|
|
63
|
-
* default (replace) ancestor the whole sub-object must be emitted. It is
|
|
64
|
-
* intentionally NOT propagated into `diffObjectField` recursion, where the
|
|
65
|
-
* strategy decision is already made per structured object.
|
|
66
69
|
*/
|
|
67
|
-
function diffFields(fields, prefix, baseline, current, changes, patch,
|
|
70
|
+
function diffFields(fields, prefix, baseline, current, changes, patch, mergePaths, versionColumn) {
|
|
68
71
|
for (const field of fields) {
|
|
69
|
-
if (field.path === "" && fields.length === 1) {
|
|
70
|
-
diffLeafRoot(field, baseline, current, changes, patch);
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
72
|
if (field.phantom || field.derived || versionColumn !== void 0 && !prefix && field.path === versionColumn) continue;
|
|
74
73
|
const fullPath = prefix ? `${prefix}.${field.path}` : field.path;
|
|
75
74
|
if (isArrayField(field)) {
|
|
76
|
-
diffArrayField(field, fullPath, baseline, current, changes, patch,
|
|
75
|
+
diffArrayField(field, fullPath, baseline, current, changes, patch, mergePaths);
|
|
77
76
|
continue;
|
|
78
77
|
}
|
|
79
78
|
if (isObjectField(field)) {
|
|
80
|
-
diffObjectField(field, fullPath, baseline, current, changes, patch);
|
|
79
|
+
diffObjectField(field, fullPath, baseline, current, changes, patch, mergePaths);
|
|
81
80
|
continue;
|
|
82
81
|
}
|
|
83
|
-
diffScalarField(field, fullPath, baseline, current, changes, patch,
|
|
82
|
+
diffScalarField(field, fullPath, baseline, current, changes, patch, mergePaths);
|
|
84
83
|
}
|
|
85
84
|
}
|
|
86
|
-
/**
|
|
87
|
-
|
|
85
|
+
/** The patch key of a single-leaf root form (non-object root): its patch is `{ value }`. */
|
|
86
|
+
const LEAF_ROOT_KEY = "value";
|
|
87
|
+
/** {@link leafRootMergePaths} per root type. */
|
|
88
|
+
const leafRootMergePathsByType = /* @__PURE__ */ new WeakMap();
|
|
89
|
+
/**
|
|
90
|
+
* `mergeStrategyPaths` of a single-leaf root form, read off the `{ value }`
|
|
91
|
+
* shape of its patch. Cached per root type: building a type invalidates the
|
|
92
|
+
* type caches of `@atscript/typescript`.
|
|
93
|
+
*/
|
|
94
|
+
function leafRootMergePaths(type) {
|
|
95
|
+
let paths = leafRootMergePathsByType.get(type);
|
|
96
|
+
if (!paths) {
|
|
97
|
+
paths = mergeStrategyPaths(defineAnnotatedType("object").prop(LEAF_ROOT_KEY, type).$type);
|
|
98
|
+
leafRootMergePathsByType.set(type, paths);
|
|
99
|
+
}
|
|
100
|
+
return paths;
|
|
101
|
+
}
|
|
102
|
+
/** Single-leaf root form (non-object root): its whole value is the patch's `value`. */
|
|
103
|
+
function diffLeafRoot(def, baseline, current, changes, patch) {
|
|
104
|
+
const field = def.rootField;
|
|
88
105
|
const before = getByPath(baseline, "");
|
|
89
106
|
const after = getByPath(current, "");
|
|
90
107
|
if (deepEqual(before, after)) return;
|
|
108
|
+
const mergePaths = leafRootMergePaths(def.type);
|
|
91
109
|
if (isArrayField(field)) {
|
|
92
|
-
const arrayPatch = diffArray(field, before, after);
|
|
110
|
+
const arrayPatch = diffArray(field, before, after, mergePaths.has(LEAF_ROOT_KEY));
|
|
93
111
|
if (arrayPatch === void 0) return;
|
|
94
112
|
changes.push({
|
|
95
113
|
path: "",
|
|
@@ -97,7 +115,7 @@ function diffLeafRoot(field, baseline, current, changes, patch) {
|
|
|
97
115
|
before,
|
|
98
116
|
after
|
|
99
117
|
});
|
|
100
|
-
patch
|
|
118
|
+
patch[LEAF_ROOT_KEY] = arrayPatch;
|
|
101
119
|
} else {
|
|
102
120
|
changes.push({
|
|
103
121
|
path: "",
|
|
@@ -105,11 +123,11 @@ function diffLeafRoot(field, baseline, current, changes, patch) {
|
|
|
105
123
|
before,
|
|
106
124
|
after
|
|
107
125
|
});
|
|
108
|
-
patch
|
|
126
|
+
patch[LEAF_ROOT_KEY] = wholeValue(LEAF_ROOT_KEY, before, after, mergePaths) ?? null;
|
|
109
127
|
}
|
|
110
128
|
}
|
|
111
129
|
/** Scalar / union / tuple / ref field — whole-value compare; clear → null. */
|
|
112
|
-
function diffScalarField(field, fullPath, baseline, current, changes, patch,
|
|
130
|
+
function diffScalarField(field, fullPath, baseline, current, changes, patch, mergePaths) {
|
|
113
131
|
const before = getByPath(baseline, fullPath);
|
|
114
132
|
const after = getByPath(current, fullPath);
|
|
115
133
|
if (deepEqual(before, after)) return;
|
|
@@ -119,106 +137,89 @@ function diffScalarField(field, fullPath, baseline, current, changes, patch, inl
|
|
|
119
137
|
before,
|
|
120
138
|
after
|
|
121
139
|
});
|
|
122
|
-
|
|
123
|
-
setPatchLeaf(patch, field.path, after === void 0 ? null : after);
|
|
140
|
+
setFieldPatch(field, fullPath, wholeValue(fullPath, before, after, mergePaths) ?? null, baseline, current, patch, mergePaths);
|
|
124
141
|
}
|
|
125
142
|
/**
|
|
126
|
-
*
|
|
127
|
-
* `
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
* at the SHALLOWEST such ancestor.
|
|
131
|
-
* `@db.column.version` exclusion already happened. Returns whether it did.
|
|
143
|
+
* Writes a changed field's patch `value` at its `field.path` in the local
|
|
144
|
+
* `patch` (relative to the current context, so possibly dotted). A dotted
|
|
145
|
+
* path runs through objects `createFormDef` dissolved into dot-paths; where
|
|
146
|
+
* one of them is outside `mergePaths`, the patch may not carry part of it, so
|
|
147
|
+
* the whole current object goes out at the SHALLOWEST such ancestor instead.
|
|
132
148
|
*/
|
|
133
|
-
function
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
149
|
+
function setFieldPatch(field, fullPath, value, baseline, current, patch, mergePaths) {
|
|
150
|
+
const prefix = fullPath.slice(0, fullPath.length - field.path.length);
|
|
151
|
+
for (let dot = field.path.indexOf("."); dot !== -1; dot = field.path.indexOf(".", dot + 1)) {
|
|
152
|
+
const ancestor = field.path.slice(0, dot);
|
|
153
|
+
const path = prefix + ancestor;
|
|
154
|
+
if (mergePaths.has(path)) continue;
|
|
155
|
+
setPatchLeaf(patch, ancestor, wholeValue(path, getByPath(baseline, path), getByPath(current, path), mergePaths) ?? null);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
setPatchLeaf(patch, field.path, value);
|
|
141
159
|
}
|
|
142
160
|
/**
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
* Walks ancestor segments (`a`, `a.b`, … but not the leaf itself); the first
|
|
150
|
-
* one that is an object AND not merge is the cutoff. merge does NOT propagate,
|
|
151
|
-
* so a default-replace level below a merge level still cuts off there.
|
|
161
|
+
* `after`, the current value at `path`, to send whole. The server still
|
|
162
|
+
* merges every object inside it at a merge path — a merge object inside a
|
|
163
|
+
* replaced one, a merge `T | null` field — and keeps the children a patch
|
|
164
|
+
* leaves out there, so a child set in `before` and unset in `after` goes out
|
|
165
|
+
* as `null`. Copies only the objects it changes; the rest stays a live
|
|
166
|
+
* reference into `current`.
|
|
152
167
|
*/
|
|
153
|
-
function
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
if (
|
|
168
|
+
function wholeValue(path, before, after, mergePaths) {
|
|
169
|
+
if (mergePaths.size === 0 || !isPlainObject(before) || !isPlainObject(after)) return after;
|
|
170
|
+
const merge = mergePaths.has(path);
|
|
171
|
+
let out;
|
|
172
|
+
for (const k of Object.keys(before)) {
|
|
173
|
+
const value = after[k];
|
|
174
|
+
const sent = merge && value === void 0 && before[k] !== void 0 && before[k] !== null ? null : wholeValue(`${path}.${k}`, before[k], value, mergePaths);
|
|
175
|
+
if (sent !== value) (out ??= { ...after })[k] = sent;
|
|
161
176
|
}
|
|
177
|
+
return out ?? after;
|
|
162
178
|
}
|
|
163
179
|
/**
|
|
164
180
|
* Inlined-or-structured object field — recurse, emit a nested partial OR the
|
|
165
|
-
* whole sub-object
|
|
181
|
+
* whole sub-object.
|
|
166
182
|
*
|
|
167
183
|
* atscript-db's DEFAULT nested-object patch strategy is `replace` (strict —
|
|
168
184
|
* every required child must be present, else 400; omitted optionals are
|
|
169
|
-
* null-filled). A changed-leaves-only partial is a valid patch ONLY
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
* descendant object without its own `merge` again emits its full sub-object
|
|
174
|
-
* (handled by recursion — `diffFields` re-enters this function per child).
|
|
185
|
+
* null-filled). A changed-leaves-only partial is a valid patch ONLY where the
|
|
186
|
+
* merge strategy applies — the object's path is in `mergePaths`. Anywhere else
|
|
187
|
+
* we emit the WHOLE current sub-object so the validator passes and no optional
|
|
188
|
+
* leaf is silently nulled.
|
|
175
189
|
*
|
|
176
190
|
* Wholesale-clear: if the sub-object was a defined object in `baseline` but is
|
|
177
191
|
* now undefined/null, emit `field: null` (object removed) instead of a partial
|
|
178
192
|
* of nulled leaves.
|
|
179
193
|
*/
|
|
180
|
-
function diffObjectField(field, fullPath, baseline, current, changes, patch) {
|
|
194
|
+
function diffObjectField(field, fullPath, baseline, current, changes, patch, mergePaths) {
|
|
181
195
|
const beforeObj = getByPath(baseline, fullPath);
|
|
182
196
|
const afterObj = getByPath(current, fullPath);
|
|
183
197
|
if (!isPlainObject(beforeObj) && !isPlainObject(afterObj)) return;
|
|
184
198
|
const nested = {};
|
|
185
199
|
const changesBefore = changes.length;
|
|
186
|
-
diffFields(field.objectDef.fields, fullPath, baseline, current, changes, nested,
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
if (Object.keys(nested).length === 0) return;
|
|
198
|
-
if (isMergePatched(field.prop)) setPatchLeaf(patch, field.path, nested);
|
|
199
|
-
else setPatchLeaf(patch, field.path, afterObj === void 0 ? null : afterObj);
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Whether a field's patch may carry only its changed leaves: a
|
|
203
|
-
* `@db.patch.strategy 'merge'` field that is not `@db.json` (a JSON value is
|
|
204
|
-
* stored, and so replaced, whole). For an object field this decides the nested
|
|
205
|
-
* partial; for a keyed array field, the shape of its `$update` items.
|
|
206
|
-
*/
|
|
207
|
-
function isMergePatched(prop) {
|
|
208
|
-
return getFieldMeta(prop, "db.patch.strategy") === "merge" && getFieldMeta(prop, "db.json") === void 0;
|
|
200
|
+
diffFields(field.objectDef.fields, fullPath, baseline, current, changes, nested, mergePaths);
|
|
201
|
+
const cleared = (afterObj === void 0 || afterObj === null) && isPlainObject(beforeObj);
|
|
202
|
+
if (!cleared && Object.keys(nested).length === 0) return;
|
|
203
|
+
if (cleared && changes.length === changesBefore) changes.push({
|
|
204
|
+
path: fullPath,
|
|
205
|
+
kind: "set",
|
|
206
|
+
before: beforeObj,
|
|
207
|
+
after: afterObj
|
|
208
|
+
});
|
|
209
|
+
setFieldPatch(field, fullPath, !cleared && mergePaths.has(fullPath) ? nested : wholeValue(fullPath, beforeObj, afterObj, mergePaths) ?? null, baseline, current, patch, mergePaths);
|
|
209
210
|
}
|
|
210
211
|
/**
|
|
211
212
|
* Array field — keyed → $update/$insert/$remove; unkeyed → $replace. A
|
|
212
|
-
* `@db.json` array is stored as one
|
|
213
|
-
* operations: it is sent whole (`null`
|
|
214
|
-
*
|
|
215
|
-
* any leaf there.
|
|
213
|
+
* `@db.json` or `@db.encrypted` array is stored as one value (JSON /
|
|
214
|
+
* ciphertext), which takes no array operations: it is sent whole (`null`
|
|
215
|
+
* when cleared). An array inside a dissolved object the merge strategy does
|
|
216
|
+
* not apply to is sent with that whole sub-object, like any leaf there.
|
|
216
217
|
*/
|
|
217
|
-
function diffArrayField(field, fullPath, baseline, current, changes, patch,
|
|
218
|
+
function diffArrayField(field, fullPath, baseline, current, changes, patch, mergePaths) {
|
|
218
219
|
const before = getByPath(baseline, fullPath);
|
|
219
220
|
const after = getByPath(current, fullPath);
|
|
220
221
|
if (deepEqual(before, after)) return;
|
|
221
|
-
const value = getFieldMeta(field.prop, "db.json") !== void 0 ? after ?? null : diffArray(field, before, after);
|
|
222
|
+
const value = getFieldMeta(field.prop, "db.json") !== void 0 || getFieldMeta(field.prop, "db.encrypted") !== void 0 ? after ?? null : diffArray(field, before, after, mergePaths.has(fullPath));
|
|
222
223
|
if (value === void 0) return;
|
|
223
224
|
changes.push({
|
|
224
225
|
path: fullPath,
|
|
@@ -226,8 +227,7 @@ function diffArrayField(field, fullPath, baseline, current, changes, patch, inli
|
|
|
226
227
|
before,
|
|
227
228
|
after
|
|
228
229
|
});
|
|
229
|
-
|
|
230
|
-
setPatchLeaf(patch, field.path, value);
|
|
230
|
+
setFieldPatch(field, fullPath, value, baseline, current, patch, mergePaths);
|
|
231
231
|
}
|
|
232
232
|
/**
|
|
233
233
|
* Produces a `TArrayPatch` value for one array field, or `undefined` when no
|
|
@@ -244,12 +244,14 @@ function diffArrayField(field, fullPath, baseline, current, changes, patch, inli
|
|
|
244
244
|
* (pure append) rather than `$upsert`. This is safe because `$insert` is only
|
|
245
245
|
* ever used for keys ABSENT from baseline; existing keys go through `$update`.
|
|
246
246
|
* `$upsert` would dedupe-by-key, which we don't need given that invariant.
|
|
247
|
+
*
|
|
248
|
+
* `merge`: the array's path is in `mergePaths` ({@link diffKeyedArray}).
|
|
247
249
|
*/
|
|
248
|
-
function diffArray(field, before, after) {
|
|
250
|
+
function diffArray(field, before, after, merge) {
|
|
249
251
|
const beforeArr = Array.isArray(before) ? before : [];
|
|
250
252
|
const afterArr = Array.isArray(after) ? after : [];
|
|
251
253
|
const keyProps = getArrayKeyProps(field.itemType);
|
|
252
|
-
if (keyProps.length > 0) return diffKeyedArray(beforeArr, afterArr, keyProps,
|
|
254
|
+
if (keyProps.length > 0) return diffKeyedArray(beforeArr, afterArr, keyProps, merge);
|
|
253
255
|
if (getFieldMeta(field.prop, "expect.array.uniqueItems") !== void 0 && isPrimitiveItem(field)) {
|
|
254
256
|
const setPatch = diffUniqueArray(beforeArr, afterArr);
|
|
255
257
|
if (setPatch) return setPatch;
|
|
@@ -272,14 +274,14 @@ function diffArray(field, before, after) {
|
|
|
272
274
|
* removed and re-added under the same key elsewhere. A new row appended at the
|
|
273
275
|
* end and an edited key on the last row stay key operators.
|
|
274
276
|
*
|
|
275
|
-
* A `$update` item follows the array field's
|
|
276
|
-
* whether
|
|
277
|
-
* the db replaces the matched element, so the item is
|
|
278
|
-
* element minus its `undefined`-valued props; under `merge`
|
|
279
|
-
* merges the item in, so it is the key + the changed top-level
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
* leaf changed.
|
|
277
|
+
* A `$update` item follows the array field's patch strategy (`merge` is
|
|
278
|
+
* whether the merge strategy applies to the array), which the db applies to
|
|
279
|
+
* it: by default (replace) the db replaces the matched element, so the item is
|
|
280
|
+
* the whole current element minus its `undefined`-valued props; under `merge`
|
|
281
|
+
* the db shallow-merges the item in, so it is the key + the changed top-level
|
|
282
|
+
* leaves, a cleared leaf as `null` ({@link buildKeyedUpdate}). A nested object
|
|
283
|
+
* of an element is sent whole either way: no merge strategy applies inside an
|
|
284
|
+
* array element. An item is emitted only when some leaf changed.
|
|
283
285
|
*
|
|
284
286
|
* Fallbacks to `{ $replace: after }`, the only faithful op, when:
|
|
285
287
|
* - key identity is ambiguous — an element that is not an object or lacks ALL
|
|
@@ -53,6 +53,7 @@ const DB_VIEW = "db.view";
|
|
|
53
53
|
const DB_VIEW_FOR = "db.view.for";
|
|
54
54
|
const DB_HTTP_PATH = "db.http.path";
|
|
55
55
|
const DB_JSON = "db.json";
|
|
56
|
+
const DB_ENCRYPTED = "db.encrypted";
|
|
56
57
|
const DB_AMOUNT_CURRENCY = "db.amount.currency";
|
|
57
58
|
const DB_AMOUNT_CURRENCY_REF = "db.amount.currency.ref";
|
|
58
59
|
const DB_UNIT = "db.unit";
|
|
@@ -60,7 +61,6 @@ const DB_UNIT_REF = "db.unit.ref";
|
|
|
60
61
|
const DB_COLUMN_PRECISION = "db.column.precision";
|
|
61
62
|
const DB_COLUMN_VERSION = "db.column.version";
|
|
62
63
|
const DB_COLUMN_DERIVED = "db.column.derived";
|
|
63
|
-
const DB_PATCH_STRATEGY = "db.patch.strategy";
|
|
64
64
|
const WF_ACTION_WITH_DATA = "wf.action.withData";
|
|
65
65
|
const META_LABEL = "meta.label";
|
|
66
66
|
const META_ID = "meta.id";
|
|
@@ -99,9 +99,9 @@ exports.DB_AMOUNT_CURRENCY_REF = DB_AMOUNT_CURRENCY_REF;
|
|
|
99
99
|
exports.DB_COLUMN_DERIVED = DB_COLUMN_DERIVED;
|
|
100
100
|
exports.DB_COLUMN_PRECISION = DB_COLUMN_PRECISION;
|
|
101
101
|
exports.DB_COLUMN_VERSION = DB_COLUMN_VERSION;
|
|
102
|
+
exports.DB_ENCRYPTED = DB_ENCRYPTED;
|
|
102
103
|
exports.DB_HTTP_PATH = DB_HTTP_PATH;
|
|
103
104
|
exports.DB_JSON = DB_JSON;
|
|
104
|
-
exports.DB_PATCH_STRATEGY = DB_PATCH_STRATEGY;
|
|
105
105
|
exports.DB_REL_FK = DB_REL_FK;
|
|
106
106
|
exports.DB_TABLE = DB_TABLE;
|
|
107
107
|
exports.DB_UNIT = DB_UNIT;
|
|
@@ -53,6 +53,7 @@ const DB_VIEW = "db.view";
|
|
|
53
53
|
const DB_VIEW_FOR = "db.view.for";
|
|
54
54
|
const DB_HTTP_PATH = "db.http.path";
|
|
55
55
|
const DB_JSON = "db.json";
|
|
56
|
+
const DB_ENCRYPTED = "db.encrypted";
|
|
56
57
|
const DB_AMOUNT_CURRENCY = "db.amount.currency";
|
|
57
58
|
const DB_AMOUNT_CURRENCY_REF = "db.amount.currency.ref";
|
|
58
59
|
const DB_UNIT = "db.unit";
|
|
@@ -60,7 +61,6 @@ const DB_UNIT_REF = "db.unit.ref";
|
|
|
60
61
|
const DB_COLUMN_PRECISION = "db.column.precision";
|
|
61
62
|
const DB_COLUMN_VERSION = "db.column.version";
|
|
62
63
|
const DB_COLUMN_DERIVED = "db.column.derived";
|
|
63
|
-
const DB_PATCH_STRATEGY = "db.patch.strategy";
|
|
64
64
|
const WF_ACTION_WITH_DATA = "wf.action.withData";
|
|
65
65
|
const META_LABEL = "meta.label";
|
|
66
66
|
const META_ID = "meta.id";
|
|
@@ -94,4 +94,4 @@ const UI_TABLE_FN_CLASSES = "ui.table.fn.classes";
|
|
|
94
94
|
const UI_TABLE_FN_STYLES = "ui.table.fn.styles";
|
|
95
95
|
const UI_FORM_VALIDATE = "ui.form.validate";
|
|
96
96
|
//#endregion
|
|
97
|
-
export { DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_DERIVED, DB_COLUMN_PRECISION, DB_COLUMN_VERSION, DB_HTTP_PATH, DB_JSON,
|
|
97
|
+
export { DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_DERIVED, DB_COLUMN_PRECISION, DB_COLUMN_VERSION, DB_ENCRYPTED, DB_HTTP_PATH, DB_JSON, DB_REL_FK, DB_TABLE, DB_UNIT, DB_UNIT_REF, DB_VIEW, DB_VIEW_FOR, EXPECT_ARRAY_KEY, EXPECT_ARRAY_UNIQUE_ITEMS, EXPECT_MAX_LENGTH, META_DEFAULT, META_DESCRIPTION, META_ID, META_LABEL, META_READONLY, META_REQUIRED, META_SENSITIVE, UI_DICT_ATTR, UI_DICT_DESCR, UI_DICT_FILTERABLE, UI_DICT_LABEL, UI_DICT_SEARCHABLE, UI_DICT_SORTABLE, UI_FORM_ACTION, UI_FORM_ATTR, UI_FORM_AUTOCOMPLETE, UI_FORM_CLASSES, UI_FORM_COMPONENT, UI_FORM_DISABLED, UI_FORM_FN_ATTR, UI_FORM_FN_CLASSES, UI_FORM_FN_DESCRIPTION, UI_FORM_FN_DISABLED, UI_FORM_FN_HIDDEN, UI_FORM_FN_HINT, UI_FORM_FN_LABEL, UI_FORM_FN_OPTIONS, UI_FORM_FN_PLACEHOLDER, UI_FORM_FN_PREFIX, UI_FORM_FN_READONLY, UI_FORM_FN_STYLES, UI_FORM_FN_SUBMIT_DISABLED, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_FN_TITLE, UI_FORM_FN_VALUE, UI_FORM_GRID_COL_SPAN, UI_FORM_GRID_ROW_SPAN, UI_FORM_HIDDEN, UI_FORM_HINT, UI_FORM_LABEL_SINGULAR, UI_FORM_NS, UI_FORM_OPTIONS, UI_FORM_ORDER, UI_FORM_PLACEHOLDER, UI_FORM_PREFIX, UI_FORM_PREFIX_ICON, UI_FORM_PREFIX_REF, UI_FORM_PUSH_DOWN, UI_FORM_STYLES, UI_FORM_SUBMIT_TEXT, UI_FORM_SUFFIX, UI_FORM_SUFFIX_ICON, UI_FORM_SUFFIX_REF, UI_FORM_TYPE, UI_FORM_VALIDATE, UI_LITERAL_LABEL, UI_NAV_GROUP, UI_NAV_HIDDEN, UI_NAV_ORDER, UI_TABLE_ATTR, UI_TABLE_CLASSES, UI_TABLE_COMPONENT, UI_TABLE_EXCLUDE, UI_TABLE_FN_ATTR, UI_TABLE_FN_CLASSES, UI_TABLE_FN_PREFIX, UI_TABLE_FN_STYLES, UI_TABLE_ORDER, UI_TABLE_SELECT_WITH, UI_TABLE_STYLES, UI_TABLE_TYPE, UI_TABLE_WIDTH, UI_TYPE, UI_VALUE_HELP, UI_VALUE_HELP_DISTINCT, WF_ACTION_WITH_DATA };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.179",
|
|
4
4
|
"description": "Framework-agnostic runtime for form and table definitions from atscript annotated types",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"annotations",
|
|
@@ -52,20 +52,20 @@
|
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@atscript/db-client": "^0.1.
|
|
55
|
+
"@atscript/db-client": "^0.1.185"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@atscript/core": "^0.2.
|
|
59
|
-
"@atscript/db": "^0.1.
|
|
60
|
-
"@atscript/typescript": "^0.2.
|
|
58
|
+
"@atscript/core": "^0.2.14",
|
|
59
|
+
"@atscript/db": "^0.1.185",
|
|
60
|
+
"@atscript/typescript": "^0.2.14",
|
|
61
61
|
"@uniqu/core": "^0.2.2",
|
|
62
|
-
"unplugin-atscript": "^0.2.
|
|
62
|
+
"unplugin-atscript": "^0.2.14",
|
|
63
63
|
"vitest": "npm:@voidzero-dev/vite-plus-test@0.1.14"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@atscript/core": "^0.2.
|
|
67
|
-
"@atscript/db": "^0.1.
|
|
68
|
-
"@atscript/typescript": "^0.2.
|
|
66
|
+
"@atscript/core": "^0.2.14",
|
|
67
|
+
"@atscript/db": "^0.1.185",
|
|
68
|
+
"@atscript/typescript": "^0.2.14"
|
|
69
69
|
},
|
|
70
70
|
"scripts": {
|
|
71
71
|
"build": "vp pack",
|