@effect-dynamodb/schema 1.39.0 → 1.41.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/Aggregate.d.ts +11 -4
- package/dist/Aggregate.d.ts.map +1 -1
- package/dist/Aggregate.js +12 -2
- package/dist/Aggregate.js.map +1 -1
- package/dist/DynamoModel.d.ts +48 -7
- package/dist/DynamoModel.d.ts.map +1 -1
- package/dist/DynamoModel.js +34 -16
- package/dist/DynamoModel.js.map +1 -1
- package/dist/DynamoSchema.d.ts +25 -0
- package/dist/DynamoSchema.d.ts.map +1 -1
- package/dist/DynamoSchema.js.map +1 -1
- package/dist/Entity.d.ts +66 -11
- package/dist/Entity.d.ts.map +1 -1
- package/dist/Entity.js +261 -34
- package/dist/Entity.js.map +1 -1
- package/dist/Errors.d.ts +61 -4
- package/dist/Errors.d.ts.map +1 -1
- package/dist/Errors.js +83 -6
- package/dist/Errors.js.map +1 -1
- package/dist/KeyComposer.d.ts +196 -5
- package/dist/KeyComposer.d.ts.map +1 -1
- package/dist/KeyComposer.js +490 -54
- package/dist/KeyComposer.js.map +1 -1
- package/dist/VectorIndex.d.ts.map +1 -1
- package/dist/VectorIndex.js +5 -4
- package/dist/VectorIndex.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/AggregateEdges.d.ts +3 -3
- package/dist/internal/AggregateSchemas.d.ts +306 -14
- package/dist/internal/AggregateSchemas.d.ts.map +1 -1
- package/dist/internal/AggregateSchemas.js +733 -54
- package/dist/internal/AggregateSchemas.js.map +1 -1
- package/dist/internal/AggregateTypes.d.ts +396 -36
- package/dist/internal/AggregateTypes.d.ts.map +1 -1
- package/dist/internal/CompositeCodec.d.ts +298 -8
- package/dist/internal/CompositeCodec.d.ts.map +1 -1
- package/dist/internal/CompositeCodec.js +940 -34
- package/dist/internal/CompositeCodec.js.map +1 -1
- package/dist/internal/EffectInstances.d.ts +87 -0
- package/dist/internal/EffectInstances.d.ts.map +1 -0
- package/dist/internal/EffectInstances.js +662 -0
- package/dist/internal/EffectInstances.js.map +1 -0
- package/dist/internal/EntityPacked.d.ts.map +1 -1
- package/dist/internal/EntityPacked.js +5 -4
- package/dist/internal/EntityPacked.js.map +1 -1
- package/dist/internal/EntitySchemas.d.ts +239 -30
- package/dist/internal/EntitySchemas.d.ts.map +1 -1
- package/dist/internal/EntitySchemas.js +1600 -197
- package/dist/internal/EntitySchemas.js.map +1 -1
- package/dist/internal/EntityTypes.d.ts +114 -25
- package/dist/internal/EntityTypes.d.ts.map +1 -1
- package/dist/internal/FailingAsBefore.d.ts +25 -0
- package/dist/internal/FailingAsBefore.d.ts.map +1 -0
- package/dist/internal/FailingAsBefore.js +42 -0
- package/dist/internal/FailingAsBefore.js.map +1 -0
- package/dist/internal/InstanceReads.d.ts +40 -0
- package/dist/internal/InstanceReads.d.ts.map +1 -0
- package/dist/internal/InstanceReads.js +183 -0
- package/dist/internal/InstanceReads.js.map +1 -0
- package/dist/internal/KeyReadings.d.ts +30 -0
- package/dist/internal/KeyReadings.d.ts.map +1 -0
- package/dist/internal/KeyReadings.js +99 -0
- package/dist/internal/KeyReadings.js.map +1 -0
- package/dist/internal/KeyText136.d.ts +4 -2
- package/dist/internal/KeyText136.d.ts.map +1 -1
- package/dist/internal/KeyText136.js +46 -13
- package/dist/internal/KeyText136.js.map +1 -1
- package/dist/internal/LostValues.d.ts +50 -0
- package/dist/internal/LostValues.d.ts.map +1 -0
- package/dist/internal/LostValues.js +465 -0
- package/dist/internal/LostValues.js.map +1 -0
- package/dist/internal/NumericKey.d.ts +21 -2
- package/dist/internal/NumericKey.d.ts.map +1 -1
- package/dist/internal/NumericKey.js +19 -1
- package/dist/internal/NumericKey.js.map +1 -1
- package/dist/internal/ObjectKeyText.d.ts +29 -0
- package/dist/internal/ObjectKeyText.d.ts.map +1 -0
- package/dist/internal/ObjectKeyText.js +50 -0
- package/dist/internal/ObjectKeyText.js.map +1 -0
- package/dist/internal/OwnNames.d.ts +205 -0
- package/dist/internal/OwnNames.d.ts.map +1 -0
- package/dist/internal/OwnNames.js +415 -0
- package/dist/internal/OwnNames.js.map +1 -0
- package/dist/internal/PackedCodec.d.ts +7 -1
- package/dist/internal/PackedCodec.d.ts.map +1 -1
- package/dist/internal/PackedCodec.js +83 -21
- package/dist/internal/PackedCodec.js.map +1 -1
- package/dist/internal/RestoredKeyText.d.ts +10 -0
- package/dist/internal/RestoredKeyText.d.ts.map +1 -0
- package/dist/internal/RestoredKeyText.js +50 -0
- package/dist/internal/RestoredKeyText.js.map +1 -0
- package/dist/internal/SchemaAccessors.d.ts +280 -1
- package/dist/internal/SchemaAccessors.d.ts.map +1 -1
- package/dist/internal/SchemaAccessors.js +1717 -1
- package/dist/internal/SchemaAccessors.js.map +1 -1
- package/dist/internal/SchemaIssue.d.ts +21 -0
- package/dist/internal/SchemaIssue.d.ts.map +1 -0
- package/dist/internal/SchemaIssue.js +34 -0
- package/dist/internal/SchemaIssue.js.map +1 -0
- package/dist/internal/SharedKeyAttribute.d.ts +60 -6
- package/dist/internal/SharedKeyAttribute.d.ts.map +1 -1
- package/dist/internal/SharedKeyAttribute.js +129 -13
- package/dist/internal/SharedKeyAttribute.js.map +1 -1
- package/dist/internal/SparseKey.d.ts +46 -0
- package/dist/internal/SparseKey.d.ts.map +1 -0
- package/dist/internal/SparseKey.js +69 -0
- package/dist/internal/SparseKey.js.map +1 -0
- package/dist/internal/StoredForm.d.ts +139 -0
- package/dist/internal/StoredForm.d.ts.map +1 -0
- package/dist/internal/StoredForm.js +503 -0
- package/dist/internal/StoredForm.js.map +1 -0
- package/dist/internal/ZOrderCurve.d.ts.map +1 -1
- package/dist/internal/ZOrderCurve.js +2 -1
- package/dist/internal/ZOrderCurve.js.map +1 -1
- package/dist/internal/ZoneKeyText.d.ts +55 -0
- package/dist/internal/ZoneKeyText.d.ts.map +1 -0
- package/dist/internal/ZoneKeyText.js +264 -0
- package/dist/internal/ZoneKeyText.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal The readings of a row's key values `rekey` looks for the row under (#242).
|
|
3
|
+
*
|
|
4
|
+
* Each earlier release composed a key composite's text its own way: 1.39.0 a codec's text encoded
|
|
5
|
+
* once more (`keyForm139`), 1.38.0 to 1.40.0 on Effect 4.1.3 a zone under the name it was given
|
|
6
|
+
* (`givenZoneReading`), 1.39.0's and 1.40.0's `restore` a look-alike stored as a map under the map's
|
|
7
|
+
* text (`restoredObjectReading`). One row can hold composites of more than one such kind: 1.39.0 on
|
|
8
|
+
* Effect 4.1.3 restored an item keyed by a `Duration` and a date zoned in `Etc/UTC` under
|
|
9
|
+
* `…#d_[object object]#at_…[etc/utc]`, each composite read its own way. So a reading is chosen
|
|
10
|
+
* composite by composite: each composite takes its value in the key form, or any other value an
|
|
11
|
+
* earlier reading gives it, and the readings are every combination of those ({@link keyReadings}).
|
|
12
|
+
* The key form's forms of text (1.36's, 1.37's, the escaped one) are tried for each reading, as
|
|
13
|
+
* every reading is.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* How many readings of one row's key values `rekey` tries at most: every combination of up to six
|
|
17
|
+
* composites read two ways each, or three composites read four ways. Past it, the combinations
|
|
18
|
+
* changing the most composites aren't tried, and a row stored under one of them is left where it
|
|
19
|
+
* is and counted `unrecognizedKey`. Each earlier reading by itself is always tried.
|
|
20
|
+
*/
|
|
21
|
+
export declare const READINGS_BOUND = 64;
|
|
22
|
+
/**
|
|
23
|
+
* The readings of a row's key values: `keyForm` (the key form's), then each of `others` (an
|
|
24
|
+
* earlier release's reading of them, or `undefined` for none) by itself, then every other
|
|
25
|
+
* combination of their values composite by composite, fewest composites changed first, up to
|
|
26
|
+
* {@link READINGS_BOUND} readings in all. No reading twice. A row with no other reading has the key
|
|
27
|
+
* form's alone, and costs nothing more.
|
|
28
|
+
*/
|
|
29
|
+
export declare const keyReadings: (keyForm: Record<string, unknown>, others: ReadonlyArray<Record<string, unknown> | undefined>) => ReadonlyArray<Record<string, unknown>>;
|
|
30
|
+
//# sourceMappingURL=KeyReadings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyReadings.d.ts","sourceRoot":"","sources":["../../src/internal/KeyReadings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,cAAc,KAAK,CAAA;AAehC;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GACtB,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,QAAQ,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC,KACzD,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAwDvC,CAAA"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal The readings of a row's key values `rekey` looks for the row under (#242).
|
|
3
|
+
*
|
|
4
|
+
* Each earlier release composed a key composite's text its own way: 1.39.0 a codec's text encoded
|
|
5
|
+
* once more (`keyForm139`), 1.38.0 to 1.40.0 on Effect 4.1.3 a zone under the name it was given
|
|
6
|
+
* (`givenZoneReading`), 1.39.0's and 1.40.0's `restore` a look-alike stored as a map under the map's
|
|
7
|
+
* text (`restoredObjectReading`). One row can hold composites of more than one such kind: 1.39.0 on
|
|
8
|
+
* Effect 4.1.3 restored an item keyed by a `Duration` and a date zoned in `Etc/UTC` under
|
|
9
|
+
* `…#d_[object object]#at_…[etc/utc]`, each composite read its own way. So a reading is chosen
|
|
10
|
+
* composite by composite: each composite takes its value in the key form, or any other value an
|
|
11
|
+
* earlier reading gives it, and the readings are every combination of those ({@link keyReadings}).
|
|
12
|
+
* The key form's forms of text (1.36's, 1.37's, the escaped one) are tried for each reading, as
|
|
13
|
+
* every reading is.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* How many readings of one row's key values `rekey` tries at most: every combination of up to six
|
|
17
|
+
* composites read two ways each, or three composites read four ways. Past it, the combinations
|
|
18
|
+
* changing the most composites aren't tried, and a row stored under one of them is left where it
|
|
19
|
+
* is and counted `unrecognizedKey`. Each earlier reading by itself is always tried.
|
|
20
|
+
*/
|
|
21
|
+
export const READINGS_BOUND = 64;
|
|
22
|
+
/** A composite a reading doesn't hold. */
|
|
23
|
+
const ABSENT = Symbol.for("effect-dynamodb/KeyReadings/absent");
|
|
24
|
+
const valueIn = (reading, attr) => Object.hasOwn(reading, attr) ? reading[attr] : ABSENT;
|
|
25
|
+
const sameReading = (a, b) => {
|
|
26
|
+
for (const attr of new Set([...Object.keys(a), ...Object.keys(b)])) {
|
|
27
|
+
if (!Object.is(valueIn(a, attr), valueIn(b, attr)))
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
return true;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The readings of a row's key values: `keyForm` (the key form's), then each of `others` (an
|
|
34
|
+
* earlier release's reading of them, or `undefined` for none) by itself, then every other
|
|
35
|
+
* combination of their values composite by composite, fewest composites changed first, up to
|
|
36
|
+
* {@link READINGS_BOUND} readings in all. No reading twice. A row with no other reading has the key
|
|
37
|
+
* form's alone, and costs nothing more.
|
|
38
|
+
*/
|
|
39
|
+
export const keyReadings = (keyForm, others) => {
|
|
40
|
+
const readings = [keyForm];
|
|
41
|
+
const add = (reading) => {
|
|
42
|
+
if (readings.length < READINGS_BOUND && !readings.some((had) => sameReading(had, reading))) {
|
|
43
|
+
readings.push(reading);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
// A composite an earlier reading leaves out is read as the key form reads it: a key holds them all.
|
|
47
|
+
const earlier = others.flatMap((other) => (other === undefined ? [] : [{ ...keyForm, ...other }]));
|
|
48
|
+
for (const other of earlier)
|
|
49
|
+
add(other);
|
|
50
|
+
// Each composite's values other than the key form's, from any earlier reading.
|
|
51
|
+
const choices = [];
|
|
52
|
+
const attrs = new Set([
|
|
53
|
+
...Object.keys(keyForm),
|
|
54
|
+
...earlier.flatMap((other) => Object.keys(other)),
|
|
55
|
+
]);
|
|
56
|
+
for (const attr of attrs) {
|
|
57
|
+
const now = valueIn(keyForm, attr);
|
|
58
|
+
const values = [];
|
|
59
|
+
for (const other of earlier) {
|
|
60
|
+
const value = valueIn(other, attr);
|
|
61
|
+
if (value === ABSENT || Object.is(value, now))
|
|
62
|
+
continue;
|
|
63
|
+
if (!values.some((had) => Object.is(had, value)))
|
|
64
|
+
values.push(value);
|
|
65
|
+
}
|
|
66
|
+
if (values.length > 0)
|
|
67
|
+
choices.push([attr, values]);
|
|
68
|
+
}
|
|
69
|
+
const readingWith = (changes) => {
|
|
70
|
+
const reading = { ...keyForm };
|
|
71
|
+
for (const [attr, value] of changes)
|
|
72
|
+
reading[attr] = value;
|
|
73
|
+
return reading;
|
|
74
|
+
};
|
|
75
|
+
// Changing `count` composites, from the `from`th choice on.
|
|
76
|
+
const combine = (count, from, changes) => {
|
|
77
|
+
if (readings.length >= READINGS_BOUND)
|
|
78
|
+
return;
|
|
79
|
+
if (changes.length === count) {
|
|
80
|
+
add(readingWith(changes));
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
for (let at = from; at < choices.length; at++) {
|
|
84
|
+
const [attr, values] = choices[at];
|
|
85
|
+
for (const value of values) {
|
|
86
|
+
changes.push([attr, value]);
|
|
87
|
+
combine(count, at + 1, changes);
|
|
88
|
+
changes.pop();
|
|
89
|
+
if (readings.length >= READINGS_BOUND)
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
for (let count = 1; count <= choices.length && readings.length < READINGS_BOUND; count++) {
|
|
95
|
+
combine(count, 0, []);
|
|
96
|
+
}
|
|
97
|
+
return readings;
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=KeyReadings.js.map
|
|
@@ -0,0 +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AAI,QAAQ,CAAC,MAAM,GAAG,cAAc,EAAE,KAAK,EAAE,EAAE,CAAC;QACzF,OAAO,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;IACvB,CAAC;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA"}
|
|
@@ -70,9 +70,11 @@ export declare const composeAt: (form: KeyForm, entityType: string, entityVersio
|
|
|
70
70
|
* composeAt} writes around it), turned back into a value by `kindOf` ({@link valueOf}); a reading
|
|
71
71
|
* counts only when {@link composeAt} composes exactly `stored` from it. `undefined` unless exactly
|
|
72
72
|
* one reading does: none, when `stored` is not `form`'s text of any values, and more than one when
|
|
73
|
-
* a string value holds the delimiter and the next composite's label.
|
|
73
|
+
* a string value holds the delimiter and the next composite's label. Given several kinds, a
|
|
74
|
+
* composite takes the first whose value composes its own text again: a field that stored both
|
|
75
|
+
* numeric kinds is read one composite at a time, never by trying each combination.
|
|
74
76
|
*
|
|
75
77
|
* A string comes back cased, which composes the same key text as the value it was cased from.
|
|
76
78
|
*/
|
|
77
|
-
export declare const readIndexKeys: (form: KeyForm, entityType: string, entityVersion: number, index: IndexDefinition, stored: Readonly<Record<string, unknown>>, kindOf: (attr: string) => ValueKind) => Record<string, unknown> | undefined;
|
|
79
|
+
export declare const readIndexKeys: (form: KeyForm, entityType: string, entityVersion: number, index: IndexDefinition, stored: Readonly<Record<string, unknown>>, kindOf: (attr: string) => ValueKind | ReadonlyArray<ValueKind>) => Record<string, unknown> | undefined;
|
|
78
80
|
//# sourceMappingURL=KeyText136.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyText136.d.ts","sourceRoot":"","sources":["../../src/internal/KeyText136.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAA;AAClD,OAAO,
|
|
1
|
+
{"version":3,"file":"KeyText136.d.ts","sourceRoot":"","sources":["../../src/intern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SAAS,GAAG,SAAS,CAAA;AAqC9E,8FAA8F;AAC9F,eAAO,MAAM,SAAS,GACpB,MAAM,OAAO,EACb,YAAY,MAAM,EAClB,eAAe,MAAM,EACrB,OAAO,eAAe,EACtB,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC9B,MAAM,CAAC,MAAM,EAAE,MAAM,CAGtB,CAAA;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,GACxB,MAAM,OAAO,EACb,YAAY,MAAM,EAClB,eAAe,MAAM,EACrB,OAAO,eAAe,EACtB,QAAQ,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,GAAG,aAAa,CAAC,SAAS,CAAC,KAC7D,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAkF5B,CAAA"}
|
|
@@ -24,21 +24,30 @@
|
|
|
24
24
|
* Not part of the public API.
|
|
25
25
|
*/
|
|
26
26
|
import * as DynamoSchema from "../DynamoSchema.js";
|
|
27
|
-
import { composePk, composeSk, unescapeKeyText } from "../KeyComposer.js";
|
|
27
|
+
import { composePk, composeSk, keyValueText, unescapeKeyText, } from "../KeyComposer.js";
|
|
28
28
|
import { decodeBigInt, decodeNumber } from "./NumericKey.js";
|
|
29
|
+
import { hasOwnName, ownValue, setOwn } from "./OwnNames.js";
|
|
29
30
|
/** The schema composing the key text 1.36 composed: what `escapeKeys` off composes. */
|
|
30
|
-
export const schema136 = (schema) =>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
export const schema136 = (schema) => ({
|
|
32
|
+
...DynamoSchema.make({
|
|
33
|
+
name: schema.name,
|
|
34
|
+
version: schema.version,
|
|
35
|
+
casing: schema.casing,
|
|
36
|
+
escapeKeys: false,
|
|
37
|
+
}),
|
|
38
|
+
text136: true,
|
|
35
39
|
});
|
|
36
40
|
/**
|
|
37
41
|
* The schema whose partition key text is what 1.37.0 and 1.38.0 stored: its numbers in numeric order, its
|
|
38
42
|
* strings unescaped.
|
|
39
43
|
*/
|
|
40
44
|
export const schema137 = (schema) => ({
|
|
41
|
-
...
|
|
45
|
+
...DynamoSchema.make({
|
|
46
|
+
name: schema.name,
|
|
47
|
+
version: schema.version,
|
|
48
|
+
casing: schema.casing,
|
|
49
|
+
escapeKeys: false,
|
|
50
|
+
}),
|
|
42
51
|
numericKeyText: true,
|
|
43
52
|
});
|
|
44
53
|
/** The schema composing the key text of `escapeKeys: true`. */
|
|
@@ -143,12 +152,35 @@ export const composeAt = (form, entityType, entityVersion, index, record) => ({
|
|
|
143
152
|
* composeAt} writes around it), turned back into a value by `kindOf` ({@link valueOf}); a reading
|
|
144
153
|
* counts only when {@link composeAt} composes exactly `stored` from it. `undefined` unless exactly
|
|
145
154
|
* one reading does: none, when `stored` is not `form`'s text of any values, and more than one when
|
|
146
|
-
* a string value holds the delimiter and the next composite's label.
|
|
155
|
+
* a string value holds the delimiter and the next composite's label. Given several kinds, a
|
|
156
|
+
* composite takes the first whose value composes its own text again: a field that stored both
|
|
157
|
+
* numeric kinds is read one composite at a time, never by trying each combination.
|
|
147
158
|
*
|
|
148
159
|
* A string comes back cased, which composes the same key text as the value it was cased from.
|
|
149
160
|
*/
|
|
150
161
|
export const readIndexKeys = (form, entityType, entityVersion, index, stored, kindOf) => {
|
|
151
162
|
const attrs = [...new Set([...index.pk.composite, ...index.sk.composite])];
|
|
163
|
+
/**
|
|
164
|
+
* A composite's text as the first of its kinds whose value composes that text again, each
|
|
165
|
+
* judged by itself; the first kind's value when none does, which the whole key then refuses.
|
|
166
|
+
*/
|
|
167
|
+
const slotValue = (under, text, attr) => {
|
|
168
|
+
const kinds = kindOf(attr);
|
|
169
|
+
if (!Array.isArray(kinds))
|
|
170
|
+
return valueOf(under, text, kinds);
|
|
171
|
+
const values = kinds.map((kind) => valueOf(under, text, kind));
|
|
172
|
+
const exact = values.find((value) => {
|
|
173
|
+
if (value === undefined)
|
|
174
|
+
return false;
|
|
175
|
+
try {
|
|
176
|
+
return keyValueText(under, value, index.casing ?? under.casing) === text;
|
|
177
|
+
}
|
|
178
|
+
catch {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
return exact ?? values[0];
|
|
183
|
+
};
|
|
152
184
|
// The fixed parts are the same under every form, and off leaves a placeholder as it is.
|
|
153
185
|
const off = schema136(form.pk);
|
|
154
186
|
const template = composeAt({ pk: off, sk: off }, entityType, entityVersion, index, Object.fromEntries(attrs.map((attr, i) => [attr, placeholder(i)])));
|
|
@@ -179,8 +211,8 @@ export const readIndexKeys = (form, entityType, entityVersion, index, stored, ki
|
|
|
179
211
|
walk(parts[0].length, 1, new Map());
|
|
180
212
|
return found;
|
|
181
213
|
};
|
|
182
|
-
const pk = stored
|
|
183
|
-
const sk = stored
|
|
214
|
+
const pk = ownValue(stored, index.pk.field);
|
|
215
|
+
const sk = ownValue(stored, index.sk.field);
|
|
184
216
|
if (typeof pk !== "string" || typeof sk !== "string")
|
|
185
217
|
return undefined;
|
|
186
218
|
const fits = [];
|
|
@@ -191,10 +223,11 @@ export const readIndexKeys = (form, entityType, entityVersion, index, stored, ki
|
|
|
191
223
|
const read = (halves, under) => {
|
|
192
224
|
for (const [slot, text] of halves) {
|
|
193
225
|
const attr = attrs[slot];
|
|
194
|
-
const value =
|
|
195
|
-
if (value === undefined || (attr
|
|
226
|
+
const value = slotValue(under, text, attr);
|
|
227
|
+
if (value === undefined || (hasOwnName(record, attr) && record[attr] !== value)) {
|
|
196
228
|
consistent = false;
|
|
197
|
-
|
|
229
|
+
}
|
|
230
|
+
setOwn(record, attr, value);
|
|
198
231
|
}
|
|
199
232
|
};
|
|
200
233
|
read(fromPk, form.pk);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyText136.js","sourceRoot":"","sources":["../../src/internal/KeyText136.ts"],"names":[],"mappings":"AAAA;;;;;;;;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,GAAG,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;gBACtE,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE;oBAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YACnF,CAAC;YAAC,MAAM,CAAC;gBACP,mDAAmD;YACrD,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AAChD,CAAC,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** What a value is, why DynamoDB doesn't store it, and what to store instead. */
|
|
2
|
+
export interface Lost {
|
|
3
|
+
readonly what: string;
|
|
4
|
+
readonly why: string;
|
|
5
|
+
readonly use: string;
|
|
6
|
+
}
|
|
7
|
+
/** A lost part of a value, and where it is in it. */
|
|
8
|
+
export interface LostAt extends Lost {
|
|
9
|
+
readonly _tag: "LostAt";
|
|
10
|
+
readonly path: ReadonlyArray<string | number>;
|
|
11
|
+
}
|
|
12
|
+
export declare const isLostAt: (value: unknown) => value is LostAt;
|
|
13
|
+
/**
|
|
14
|
+
* What of this value, by itself, DynamoDB doesn't store, or `undefined`. Its parts are judged where
|
|
15
|
+
* they are ({@link lostIn}).
|
|
16
|
+
*/
|
|
17
|
+
export declare const lostAs: (value: object) => Lost | undefined;
|
|
18
|
+
/** Whether {@link lostIn} found a part of this value behind a getter, which it didn't call. */
|
|
19
|
+
export declare const holdsGetters: (value: unknown) => value is object;
|
|
20
|
+
/**
|
|
21
|
+
* The first part of a value, depth first as the marshaller walks it, that DynamoDB doesn't store
|
|
22
|
+
* ({@link lostAs}), with its path; `undefined` when it stores all of it. A
|
|
23
|
+
* cycle isn't followed: the marshaller refuses one itself (`EDD-9124`). A part behind a getter isn't
|
|
24
|
+
* called for: the value is marked, and judged as the marshaller reads it ({@link readJudged}).
|
|
25
|
+
*/
|
|
26
|
+
export declare const lostIn: (value: unknown) => LostAt | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Whether a value is or holds a part {@link lostIn} marked ({@link holdsGetters}), read from
|
|
29
|
+
* descriptors: one whose getters the marshaller calls through {@link readJudged}.
|
|
30
|
+
*/
|
|
31
|
+
export declare const holdsMarked: (value: unknown) => boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The value as the marshaller is to read it. Where it holds a part {@link lostIn} marked
|
|
34
|
+
* ({@link holdsGetters}), a view whose getters, each called as the marshaller calls it and once for
|
|
35
|
+
* each time it does, have what they return judged by {@link lostIn} where it's stored. A lost part
|
|
36
|
+
* calls `refuse` with where it is, from `path`; any other is handed on, viewed in turn where it's
|
|
37
|
+
* marked. Any other value is itself, and until anything has been marked nothing is looked for.
|
|
38
|
+
*
|
|
39
|
+
* The view forwards every read to the value, so the marshaller takes the branch it always took and
|
|
40
|
+
* stores what it always stored: the same prototype, the same keys in the same order, the same
|
|
41
|
+
* values. Only a part that is or holds a marked one is a view; the rest is the value's own. A view's
|
|
42
|
+
* target is a stand-in (an empty list for a list), so a frozen value can be viewed: a proxy can only
|
|
43
|
+
* report another value of a property its own target lets it.
|
|
44
|
+
*/
|
|
45
|
+
export declare const readJudged: (value: unknown, path: ReadonlyArray<string | number>, refuse: (lost: LostAt) => never) => unknown;
|
|
46
|
+
/** A path into a value from `root`, as a refusal names it: `f.a[0]["b c"]`. */
|
|
47
|
+
export declare const lostPath: (root: string, path: ReadonlyArray<string | number>) => string;
|
|
48
|
+
/** The refusal in words: the value at `at` is lost (`EDD-9161`). */
|
|
49
|
+
export declare const lostRefusal: (at: string, lost: Lost) => string;
|
|
50
|
+
//# sourceMappingURL=LostValues.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"L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