@effect-dynamodb/schema 1.40.0 → 1.42.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.
Files changed (104) hide show
  1. package/dist/Aggregate.d.ts.map +1 -1
  2. package/dist/Aggregate.js +4 -1
  3. package/dist/Aggregate.js.map +1 -1
  4. package/dist/DynamoModel.d.ts +35 -7
  5. package/dist/DynamoModel.d.ts.map +1 -1
  6. package/dist/DynamoModel.js +34 -16
  7. package/dist/DynamoModel.js.map +1 -1
  8. package/dist/DynamoSchema.d.ts +20 -0
  9. package/dist/DynamoSchema.d.ts.map +1 -1
  10. package/dist/DynamoSchema.js.map +1 -1
  11. package/dist/Entity.d.ts +18 -6
  12. package/dist/Entity.d.ts.map +1 -1
  13. package/dist/Entity.js +97 -34
  14. package/dist/Entity.js.map +1 -1
  15. package/dist/Errors.d.ts +61 -4
  16. package/dist/Errors.d.ts.map +1 -1
  17. package/dist/Errors.js +83 -6
  18. package/dist/Errors.js.map +1 -1
  19. package/dist/KeyComposer.d.ts +55 -9
  20. package/dist/KeyComposer.d.ts.map +1 -1
  21. package/dist/KeyComposer.js +157 -58
  22. package/dist/KeyComposer.js.map +1 -1
  23. package/dist/VectorIndex.d.ts.map +1 -1
  24. package/dist/VectorIndex.js +5 -4
  25. package/dist/VectorIndex.js.map +1 -1
  26. package/dist/index.d.ts +1 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +1 -1
  29. package/dist/index.js.map +1 -1
  30. package/dist/internal/AggregateSchemas.d.ts +131 -6
  31. package/dist/internal/AggregateSchemas.d.ts.map +1 -1
  32. package/dist/internal/AggregateSchemas.js +250 -31
  33. package/dist/internal/AggregateSchemas.js.map +1 -1
  34. package/dist/internal/CompositeCodec.d.ts +26 -4
  35. package/dist/internal/CompositeCodec.d.ts.map +1 -1
  36. package/dist/internal/CompositeCodec.js +127 -25
  37. package/dist/internal/CompositeCodec.js.map +1 -1
  38. package/dist/internal/EffectInstances.d.ts +8 -2
  39. package/dist/internal/EffectInstances.d.ts.map +1 -1
  40. package/dist/internal/EffectInstances.js +33 -27
  41. package/dist/internal/EffectInstances.js.map +1 -1
  42. package/dist/internal/EntityPacked.d.ts.map +1 -1
  43. package/dist/internal/EntityPacked.js +5 -4
  44. package/dist/internal/EntityPacked.js.map +1 -1
  45. package/dist/internal/EntitySchemas.d.ts +163 -3
  46. package/dist/internal/EntitySchemas.d.ts.map +1 -1
  47. package/dist/internal/EntitySchemas.js +972 -85
  48. package/dist/internal/EntitySchemas.js.map +1 -1
  49. package/dist/internal/EntityTypes.d.ts +53 -20
  50. package/dist/internal/EntityTypes.d.ts.map +1 -1
  51. package/dist/internal/InstanceReads.d.ts +7 -0
  52. package/dist/internal/InstanceReads.d.ts.map +1 -1
  53. package/dist/internal/InstanceReads.js +47 -29
  54. package/dist/internal/InstanceReads.js.map +1 -1
  55. package/dist/internal/KeyReadings.d.ts +30 -0
  56. package/dist/internal/KeyReadings.d.ts.map +1 -0
  57. package/dist/internal/KeyReadings.js +99 -0
  58. package/dist/internal/KeyReadings.js.map +1 -0
  59. package/dist/internal/KeyText136.d.ts.map +1 -1
  60. package/dist/internal/KeyText136.js +6 -4
  61. package/dist/internal/KeyText136.js.map +1 -1
  62. package/dist/internal/LostValues.d.ts +50 -0
  63. package/dist/internal/LostValues.d.ts.map +1 -0
  64. package/dist/internal/LostValues.js +465 -0
  65. package/dist/internal/LostValues.js.map +1 -0
  66. package/dist/internal/ObjectKeyText.d.ts +29 -0
  67. package/dist/internal/ObjectKeyText.d.ts.map +1 -0
  68. package/dist/internal/ObjectKeyText.js +50 -0
  69. package/dist/internal/ObjectKeyText.js.map +1 -0
  70. package/dist/internal/OwnNames.d.ts +205 -0
  71. package/dist/internal/OwnNames.d.ts.map +1 -0
  72. package/dist/internal/OwnNames.js +415 -0
  73. package/dist/internal/OwnNames.js.map +1 -0
  74. package/dist/internal/PackedCodec.d.ts +7 -8
  75. package/dist/internal/PackedCodec.d.ts.map +1 -1
  76. package/dist/internal/PackedCodec.js +81 -55
  77. package/dist/internal/PackedCodec.js.map +1 -1
  78. package/dist/internal/RestoredKeyText.d.ts +10 -0
  79. package/dist/internal/RestoredKeyText.d.ts.map +1 -0
  80. package/dist/internal/RestoredKeyText.js +50 -0
  81. package/dist/internal/RestoredKeyText.js.map +1 -0
  82. package/dist/internal/SchemaAccessors.d.ts +132 -12
  83. package/dist/internal/SchemaAccessors.d.ts.map +1 -1
  84. package/dist/internal/SchemaAccessors.js +779 -56
  85. package/dist/internal/SchemaAccessors.js.map +1 -1
  86. package/dist/internal/SchemaIssue.d.ts +21 -0
  87. package/dist/internal/SchemaIssue.d.ts.map +1 -0
  88. package/dist/internal/SchemaIssue.js +34 -0
  89. package/dist/internal/SchemaIssue.js.map +1 -0
  90. package/dist/internal/SharedKeyAttribute.d.ts.map +1 -1
  91. package/dist/internal/SharedKeyAttribute.js +2 -1
  92. package/dist/internal/SharedKeyAttribute.js.map +1 -1
  93. package/dist/internal/StoredForm.d.ts +139 -0
  94. package/dist/internal/StoredForm.d.ts.map +1 -0
  95. package/dist/internal/StoredForm.js +503 -0
  96. package/dist/internal/StoredForm.js.map +1 -0
  97. package/dist/internal/ZOrderCurve.d.ts.map +1 -1
  98. package/dist/internal/ZOrderCurve.js +2 -1
  99. package/dist/internal/ZOrderCurve.js.map +1 -1
  100. package/dist/internal/ZoneKeyText.d.ts +55 -0
  101. package/dist/internal/ZoneKeyText.d.ts.map +1 -0
  102. package/dist/internal/ZoneKeyText.js +264 -0
  103. package/dist/internal/ZoneKeyText.js.map +1 -0
  104. package/package.json +4 -4
@@ -0,0 +1,205 @@
1
+ /**
2
+ * Looking a name up on an object the library builds or reads a definition from (#239).
3
+ *
4
+ * A name a definition or a payload supplies (a field, a path segment, an edge, a timestamp, the
5
+ * version) can be one every object inherits: `constructor`, `toString`, `valueOf`,
6
+ * `hasOwnProperty`, `__proto__`. On a plain object, `record[name]` and `name in record` then find
7
+ * `Object.prototype`'s member, and `record[name] = value` under `__proto__` replaces the object's
8
+ * prototype instead of holding the value. So the library's own maps (definition maps, encoded
9
+ * payloads, unmarshalled rows, a schema's fields) are read with {@link ownValue} /
10
+ * {@link hasOwnName} and written with {@link setOwn}.
11
+ *
12
+ * A caller's object is not read this way. Where the library reads it itself (a key's composites, a
13
+ * condition's or an update operand's record, `.within()` bounds, an aggregate's ids) it is read as
14
+ * 1.40.0 read it, `value[name]`: a getter, a class property, a prototype or a proxy answers, and a
15
+ * function there is given as 1.40.0 read it, but for a member every object inherits under a name
16
+ * `Object.prototype` holds (`constructor`, `toString`), which is never a value given (see
17
+ * {@link given}). A read that throws for a name the object doesn't hold is no value. A payload a
18
+ * schema decodes goes to Effect's parser as given, or as 1.40.0 copied it where the library adds to
19
+ * it first (a decoding default, a stamp, a fetched ref, a geo index's cells), and what the parser
20
+ * reads of it is the parser's to decide: under Effect 4.1.3, a declared name `Object.prototype`
21
+ * holds too only as the payload's own property.
22
+ */
23
+ import { type Schema, SchemaAST } from "effect";
24
+ /** Whether `record` holds `name` itself, not by inheritance. */
25
+ export declare const hasOwnName: (record: object | undefined, name: PropertyKey) => boolean;
26
+ /**
27
+ * What `record` holds under `name` itself, `undefined` where it holds nothing there. Never a member
28
+ * every object inherits: a field named `constructor` that a map doesn't hold is not one.
29
+ */
30
+ export declare const ownValue: <A>(record: Readonly<Record<string, A>> | undefined, name: PropertyKey) => A | undefined;
31
+ /**
32
+ * Why an attribute or a map entry named `__proto__` is refused (`EDD-9165`). The AWS SDK's
33
+ * marshaller assigns each attribute and entry to a plain object, and an assignment to `__proto__`
34
+ * sets that object's prototype instead, so it was never sent; stored by an update, every read drops
35
+ * it the same way, as its unmarshaller assigns too.
36
+ */
37
+ export declare const PROTO_ENTRY: string;
38
+ /**
39
+ * Stores `value` under `name` as `record`'s own property. Assignment does that for every name but
40
+ * `__proto__`, where it would replace the prototype instead (or do nothing, for a value that isn't
41
+ * an object), so that one name is defined.
42
+ */
43
+ export declare const setOwn: <A>(record: Record<string, A>, name: string, value: A) => void;
44
+ declare const UnreadableName_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
45
+ readonly _tag: "UnreadableName";
46
+ } & Readonly<A>;
47
+ /**
48
+ * A caller's object threw when `field` was read from it, a name it doesn't hold itself but holds
49
+ * by inheritance (a getter of its class, say), read because the entity, aggregate or stream it was
50
+ * given to declares that name. Thrown where the read is, and failed with a `ValidationError` naming
51
+ * the field by the operation it was given to, never a defect (`Capacity.isRefusedValue`). Where the
52
+ * read is made for a key handed on (a geo search's filter), the error stands in the copy for the
53
+ * value, and the search fails with it when it reads it ({@link lackedByName}'s `keep`).
54
+ *
55
+ * Recognised by identity alone ({@link isUnreadableName}): only an error this module made is one.
56
+ * A caller's value carrying the same tag and fields (a stored map compared in a condition) is a
57
+ * value like any other.
58
+ */
59
+ export declare class UnreadableName extends UnreadableName_base<{
60
+ readonly field: string;
61
+ readonly thrown: unknown;
62
+ readonly message: string;
63
+ }> {
64
+ }
65
+ /** Is `u` an {@link UnreadableName} this module made? By identity, never by its tag or fields. */
66
+ export declare const isUnreadableName: (u: unknown) => u is UnreadableName;
67
+ /**
68
+ * What a caller's payload gives under `name`, where the library reads it itself (a key's
69
+ * composites, an aggregate's ids and edges, `.within()` bounds' operators), read as 1.40.0 read it
70
+ * (`payload[name]`, one read, one `get` of a proxy): its own property, one its class gives it (a
71
+ * getter, a property of a prototype, a method), or one a proxy answers for, a function as much as
72
+ * anything else. Reading its own property is as it always was (a throw from its own getter
73
+ * propagates). A throw for a name it doesn't hold at all (a strict proxy) is no value; a throw from
74
+ * a getter it inherits is an {@link UnreadableName}. The one value not given is what every plain
75
+ * object inherits under the name ({@link isObjectPrototypeMember}: `Object.prototype.toString`
76
+ * under `toString`, `Object.prototype` under `__proto__`), which 1.40.0 took for a value of a field
77
+ * so named: such a name reads as absent. Only where the value read is that member is the payload
78
+ * asked anything more, whether it holds the name itself (`Object.hasOwn`): where it does, the value
79
+ * is given.
80
+ */
81
+ export declare const given: (payload: object, name: PropertyKey) => unknown;
82
+ /**
83
+ * {@link given}, but never a function: where 1.40.0 took no function for a value (an aggregate's
84
+ * ids, `many` lists and sub-aggregates), and where the library reads a name 1.40.0 didn't read at
85
+ * all (a key composite its own entries lack, {@link keyEntries}), so a method of the payload's
86
+ * class is no value there.
87
+ */
88
+ export declare const givenData: (payload: object, name: PropertyKey) => unknown;
89
+ /**
90
+ * What a caller's payload gives under `name`, where 1.40.0 asked `name in payload` and then read
91
+ * `payload[name]`: `{ value }` where it holds the name (as it asked, but never what every plain
92
+ * object inherits under it, {@link given}), `undefined` where it doesn't. Asked and read as 1.40.0
93
+ * asked and read it, once each.
94
+ */
95
+ export declare const givenEntry: (payload: object, name: PropertyKey) => {
96
+ readonly value: unknown;
97
+ } | undefined;
98
+ /** Whether a caller's payload gives `name` ({@link givenEntry}), reading it once. */
99
+ export declare const givesName: (payload: object, name: PropertyKey) => boolean;
100
+ /** Whether `u` is an object a caller gives as a record of names: an object, not an array. */
101
+ export declare const isRecordObject: (u: unknown) => u is object;
102
+ /**
103
+ * A caller's key as a plain object, read as 1.40.0 read it (`Object.entries`): its own enumerable
104
+ * properties, and nothing else of it, wherever they hold every one of `required` (the composites
105
+ * the key can't be composed without). Only where they don't, where 1.40.0 failed ("Missing
106
+ * composite attribute"), is each of `required` and `optional` they lack read by name
107
+ * ({@link lackedByName}), so a key given by `Object.create`, a class with getters or a proxy is
108
+ * read for its composites. `map` makes each value read the value held (a composite's key form).
109
+ */
110
+ export declare const keyEntries: (payload: object, required: ReadonlyArray<string>, optional?: ReadonlyArray<string>, map?: (name: string, value: unknown) => unknown) => Record<string, unknown>;
111
+ /** Whether `copy` lacks any of `names` as its own property. */
112
+ export declare const lacksAny: (copy: object, names: ReadonlyArray<string>) => boolean;
113
+ /**
114
+ * `copy` (a copy of a caller's `payload`'s own properties), given each of `names` it lacks that the
115
+ * payload gives otherwise, read by name ({@link givenData}: from a prototype, a class's getter or a
116
+ * proxy, never a function there), `map`ped. Read only where 1.40.0 failed for the lack.
117
+ *
118
+ * With `keep`, a name whose read throws ({@link UnreadableName}) doesn't throw here: the copy holds a
119
+ * property of that name that throws it again when it's read (a key handed on to a search, whose read
120
+ * of it fails the search).
121
+ */
122
+ export declare const lackedByName: (payload: object, copy: Record<string, unknown>, names: ReadonlyArray<string>, map?: (name: string, value: unknown) => unknown, keep?: "getter") => Record<string, unknown>;
123
+ /**
124
+ * A plain object holding what a value the library decoded gives (an aggregate's node, as Effect's
125
+ * parser built it): its own enumerable properties, and each of `names` (the fields its schema
126
+ * declares) it gives otherwise ({@link givenData}). Never a caller's object: the parser built it.
127
+ */
128
+ export declare const declaredCopy: (value: object, names: Iterable<string>) => Record<string, unknown>;
129
+ /**
130
+ * The class `value` is an instance of: the nearest of its prototypes holding a function as its own
131
+ * `constructor` value, as `value.constructor` reads it for an instance. Never `value`'s own property
132
+ * of that name, nor a prototype's that is no function or is a getter: either is a field of a payload
133
+ * given by `Object.create` or by a class with getters, not the class, and is never read. `undefined`
134
+ * for an object without a prototype.
135
+ */
136
+ export declare const classOf: (value: object) => {
137
+ readonly name?: string;
138
+ } | undefined;
139
+ /**
140
+ * Whether every value of `ast` is certain to store something under its name: it is required, and
141
+ * its stored (encoded) form is one this code models exactly with no value that stores nothing
142
+ * ({@link storesAlways}). One that may be left out, may be `undefined` (`UndefinedOr`,
143
+ * `NullishOr`, a decoding default), or isn't modelled exactly (`Schema.declare`, `Option`, a
144
+ * union with such a member) lets a write store nothing there, as 1.40.0 stored it: a definition
145
+ * naming `__proto__` there loads, and a write giving it a value is refused when it's sent.
146
+ */
147
+ export declare const isRequiredStored: (ast: SchemaAST.AST) => boolean;
148
+ /**
149
+ * The stored form of `ast` where every value stored there is certain to be a map: `ast` is
150
+ * required, and its stored (encoded) form is a struct, a suspended one followed. `undefined` where
151
+ * a value stored there may be no map, or may be no value at all: an optional or an `optionalKey`
152
+ * position, a nullable one, a union (one alternative may be the struct, another not), a list or a
153
+ * tuple (an empty one holds none), a record, text (`Schema.fromJsonString`), a declaration with no
154
+ * encoding (`Schema.Option`).
155
+ */
156
+ export declare const certainStruct: (ast: SchemaAST.AST, seen?: Set<SchemaAST.AST>) => SchemaAST.Objects | undefined;
157
+ /**
158
+ * Where, below `path`, every stored value of `ast` holds a property named `__proto__` in a map: a
159
+ * required property of a struct, with no value that stores nothing ({@link isRequiredStored}),
160
+ * reached from `ast` through containers each certain to hold a map ({@link certainStruct}): `ast`
161
+ * itself required, and each property on the way a required struct.
162
+ * The walk is of the stored (encoded) form. Wherever a container on the way may hold no map, or
163
+ * nothing (an optional or `optionalKey` one, a nullable one, a union, a list or a tuple, a record,
164
+ * text, a declaration with no encoding), a value may or may not hold the name: the definition
165
+ * loads, and a write that gives the name is refused when it's sent (`EDD-9165`). `packed` names the
166
+ * properties of `ast`'s own struct that are stored as JSON text (`DynamoModel.Packed`), which hold
167
+ * any name: the walk doesn't enter them.
168
+ */
169
+ export declare const requiredProtoPropertyIn: (ast: SchemaAST.AST, path: string, packed?: ReadonlySet<string>, seen?: Set<SchemaAST.AST>) => string | undefined;
170
+ /**
171
+ * `[EDD-9152]`: an entity names `__proto__` where every item it writes would hold it, as an
172
+ * attribute or as a property of a stored map. A JavaScript object can't take that name by
173
+ * assignment (it replaces the prototype), and the AWS SDK's marshaller drops an attribute or a map
174
+ * entry so named, while its reader sets a prototype from one: no write could store the item whole.
175
+ * So: an attribute the library writes on every item ({@link names}: the created and updated
176
+ * timestamps, the version, the table's key attributes, an index's key attributes where every
177
+ * composite of both its halves always stores something, the attribute a field that always stores
178
+ * something is stored under), a required model field stored under its own name whose every value
179
+ * stores something ({@link isRequiredStored}), and such a property of one reached through required
180
+ * struct properties ({@link requiredProtoPropertyIn}). Anything else of that name loads (an
181
+ * optional field or property, one whose stored form admits `undefined` or isn't modelled exactly,
182
+ * an index's key attribute that some item may be without): a write that doesn't give it does what
183
+ * it did, and one that does is refused when it's sent (`EDD-9165`). Nothing stored as JSON text is
184
+ * looked into. Thrown at `make`, before anything else is derived.
185
+ *
186
+ * `fields` are the model's fields; `storage` says which are stored under another attribute and
187
+ * which are packed.
188
+ */
189
+ export declare const refuseProtoName: (entityType: string, fields: Readonly<Record<string, Schema.Top>>, storage: {
190
+ readonly renamed: ReadonlySet<string>;
191
+ readonly packed: ReadonlySet<string>;
192
+ }, names: ReadonlyArray<{
193
+ readonly name: string | null | undefined;
194
+ readonly what: string;
195
+ /** Whether every item written holds the attribute (`true` when not said). */
196
+ readonly always?: boolean;
197
+ }>) => void;
198
+ /**
199
+ * The refusal of a definition naming `__proto__` where every row it writes would hold it:
200
+ * `[EDD-9152]` for an entity ({@link refuseProtoName}), `[EDD-9153]` for an aggregate
201
+ * (`refuseAggregateProtoName`). `what` says where the name is.
202
+ */
203
+ export declare const protoRefusal: (code: "EDD-9152" | "EDD-9153", owner: string, what: string) => Error;
204
+ export {};
205
+ //# sourceMappingURL=OwnNames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OwnNames.d.ts","sourceRoot":"","sources":["../../src/internal/OwnNames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAQ,KAAK,MAAM,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAErD,gEAAgE;AAChE,eAAO,MAAM,UAAU,GAAI,QAAQ,MAAM,GAAG,SAAS,EAAE,MAAM,WAAW,KAAG,OACtB,CAAA;AAErD;;;GAGG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,EACxB,QAAQ,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG,SAAS,EAC/C,MAAM,WAAW,KAChB,CAAC,GAAG,SACmF,CAAA;AAE1F;;;;;GAKG;AACH,eAAO,MAAM,WAAW,QAIV,CAAA;AAEd;;;;GAIG;AACH,eAAO,MAAM,MAAM,GAAI,CAAC,EAAE,QAA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AAG,CAAC,CAAC,EAC5C,SAAS;IACP,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IACrC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CACrC,EACD,OAAO,aAAa,CAAC;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAC,KACD,IAaF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,UAAU,GAAG,UAAU,EAAE,OAAO,MAAM,EAAE,MAAM,MAAM,KAAG,KAMvF,CAAA"}
@@ -0,0 +1,415 @@
1
+ /**
2
+ * Looking a name up on an object the library builds or reads a definition from (#239).
3
+ *
4
+ * A name a definition or a payload supplies (a field, a path segment, an edge, a timestamp, the
5
+ * version) can be one every object inherits: `constructor`, `toString`, `valueOf`,
6
+ * `hasOwnProperty`, `__proto__`. On a plain object, `record[name]` and `name in record` then find
7
+ * `Object.prototype`'s member, and `record[name] = value` under `__proto__` replaces the object's
8
+ * prototype instead of holding the value. So the library's own maps (definition maps, encoded
9
+ * payloads, unmarshalled rows, a schema's fields) are read with {@link ownValue} /
10
+ * {@link hasOwnName} and written with {@link setOwn}.
11
+ *
12
+ * A caller's object is not read this way. Where the library reads it itself (a key's composites, a
13
+ * condition's or an update operand's record, `.within()` bounds, an aggregate's ids) it is read as
14
+ * 1.40.0 read it, `value[name]`: a getter, a class property, a prototype or a proxy answers, and a
15
+ * function there is given as 1.40.0 read it, but for a member every object inherits under a name
16
+ * `Object.prototype` holds (`constructor`, `toString`), which is never a value given (see
17
+ * {@link given}). A read that throws for a name the object doesn't hold is no value. A payload a
18
+ * schema decodes goes to Effect's parser as given, or as 1.40.0 copied it where the library adds to
19
+ * it first (a decoding default, a stamp, a fetched ref, a geo index's cells), and what the parser
20
+ * reads of it is the parser's to decide: under Effect 4.1.3, a declared name `Object.prototype`
21
+ * holds too only as the payload's own property.
22
+ */
23
+ import { Data, SchemaAST } from "effect";
24
+ /** Whether `record` holds `name` itself, not by inheritance. */
25
+ export const hasOwnName = (record, name) => record !== undefined && Object.hasOwn(record, name);
26
+ /**
27
+ * What `record` holds under `name` itself, `undefined` where it holds nothing there. Never a member
28
+ * every object inherits: a field named `constructor` that a map doesn't hold is not one.
29
+ */
30
+ export const ownValue = (record, name) => record !== undefined && Object.hasOwn(record, name) ? record[name] : undefined;
31
+ /**
32
+ * Why an attribute or a map entry named `__proto__` is refused (`EDD-9165`). The AWS SDK's
33
+ * marshaller assigns each attribute and entry to a plain object, and an assignment to `__proto__`
34
+ * sets that object's prototype instead, so it was never sent; stored by an update, every read drops
35
+ * it the same way, as its unmarshaller assigns too.
36
+ */
37
+ export const PROTO_ENTRY = 'an attribute or a map entry named "__proto__" is lost: the AWS SDK\'s marshaller and ' +
38
+ "unmarshaller assign each to a plain object, and assigning that name sets the object's " +
39
+ "prototype instead, so it is never sent, and one stored otherwise is never read back. Name it " +
40
+ "otherwise.";
41
+ /**
42
+ * Stores `value` under `name` as `record`'s own property. Assignment does that for every name but
43
+ * `__proto__`, where it would replace the prototype instead (or do nothing, for a value that isn't
44
+ * an object), so that one name is defined.
45
+ */
46
+ export const setOwn = (record, name, value) => {
47
+ if (name === "__proto__") {
48
+ Object.defineProperty(record, name, {
49
+ value,
50
+ writable: true,
51
+ enumerable: true,
52
+ configurable: true,
53
+ });
54
+ }
55
+ else
56
+ record[name] = value;
57
+ };
58
+ /**
59
+ * A caller's object threw when `field` was read from it, a name it doesn't hold itself but holds
60
+ * by inheritance (a getter of its class, say), read because the entity, aggregate or stream it was
61
+ * given to declares that name. Thrown where the read is, and failed with a `ValidationError` naming
62
+ * the field by the operation it was given to, never a defect (`Capacity.isRefusedValue`). Where the
63
+ * read is made for a key handed on (a geo search's filter), the error stands in the copy for the
64
+ * value, and the search fails with it when it reads it ({@link lackedByName}'s `keep`).
65
+ *
66
+ * Recognised by identity alone ({@link isUnreadableName}): only an error this module made is one.
67
+ * A caller's value carrying the same tag and fields (a stored map compared in a condition) is a
68
+ * value like any other.
69
+ */
70
+ export class UnreadableName extends Data.TaggedError("UnreadableName") {
71
+ }
72
+ /** Every {@link UnreadableName} this module made: what {@link isUnreadableName} recognises. */
73
+ const made = new WeakSet();
74
+ /** Is `u` an {@link UnreadableName} this module made? By identity, never by its tag or fields. */
75
+ export const isUnreadableName = (u) => typeof u === "object" && u !== null && made.has(u);
76
+ const unreadable = (field, thrown) => {
77
+ const error = new UnreadableName({
78
+ field: String(field),
79
+ thrown,
80
+ message: `Reading "${String(field)}" from the object given threw: ` +
81
+ `${thrown instanceof Error ? thrown.message : String(thrown)}. The object doesn't hold ` +
82
+ `"${String(field)}" itself but answers for it by inheritance (a getter of its class, a ` +
83
+ `prototype, a proxy), and it is a name the value is read for.`,
84
+ });
85
+ made.add(error);
86
+ return error;
87
+ };
88
+ /** Whether `u` is an object or a function: what `Object.hasOwn` and `in` take. */
89
+ const isObject = (u) => (typeof u === "object" && u !== null) || typeof u === "function";
90
+ /** Whether `name` is `in` `payload`, as 1.40.0 asked it; a proxy whose `has` trap throws holds nothing. */
91
+ const holds = (payload, name) => {
92
+ try {
93
+ return name in payload;
94
+ }
95
+ catch {
96
+ return false;
97
+ }
98
+ };
99
+ /**
100
+ * `payload[name]`, read as 1.40.0 read it: one read (one `get` of a proxy). A read that throws from
101
+ * the payload's own getter propagates, as on 1.40.0. One that throws for a name the payload doesn't
102
+ * hold at all (a strict proxy, throwing for every name it doesn't know) is no value, so such an
103
+ * object is read as a plain one; one that throws for a name it holds by inheritance (a getter of
104
+ * its class) is an {@link UnreadableName}.
105
+ */
106
+ const read = (payload, name) => {
107
+ try {
108
+ return payload[name];
109
+ }
110
+ catch (thrown) {
111
+ if (Object.hasOwn(payload, name))
112
+ throw thrown;
113
+ if (!holds(payload, name))
114
+ return undefined;
115
+ throw unreadable(name, thrown);
116
+ }
117
+ };
118
+ /**
119
+ * Whether `value`, read from a caller's object under `name`, is what every plain object inherits
120
+ * under that name: `Object.prototype`'s own member (`constructor`, `toString`, `valueOf`, …), or,
121
+ * under `__proto__`, `Object.prototype` itself. Judged on the value read alone, by identity: a
122
+ * class's `constructor` or its own `toString` is a value as 1.40.0 read it.
123
+ */
124
+ const isObjectPrototypeMember = (name, value) => name === "__proto__"
125
+ ? value === Object.prototype
126
+ : typeof value === "function" &&
127
+ Object.hasOwn(Object.prototype, name) &&
128
+ value === Object.prototype[name];
129
+ /**
130
+ * What a caller's payload gives under `name`, where the library reads it itself (a key's
131
+ * composites, an aggregate's ids and edges, `.within()` bounds' operators), read as 1.40.0 read it
132
+ * (`payload[name]`, one read, one `get` of a proxy): its own property, one its class gives it (a
133
+ * getter, a property of a prototype, a method), or one a proxy answers for, a function as much as
134
+ * anything else. Reading its own property is as it always was (a throw from its own getter
135
+ * propagates). A throw for a name it doesn't hold at all (a strict proxy) is no value; a throw from
136
+ * a getter it inherits is an {@link UnreadableName}. The one value not given is what every plain
137
+ * object inherits under the name ({@link isObjectPrototypeMember}: `Object.prototype.toString`
138
+ * under `toString`, `Object.prototype` under `__proto__`), which 1.40.0 took for a value of a field
139
+ * so named: such a name reads as absent. Only where the value read is that member is the payload
140
+ * asked anything more, whether it holds the name itself (`Object.hasOwn`): where it does, the value
141
+ * is given.
142
+ */
143
+ export const given = (payload, name) => {
144
+ // Anything but an object is read as 1.40.0 read it: `undefined` and `null` throw its TypeError.
145
+ if (!isObject(payload))
146
+ return payload[name];
147
+ const value = read(payload, name);
148
+ return isObjectPrototypeMember(name, value) && !Object.hasOwn(payload, name) ? undefined : value;
149
+ };
150
+ /**
151
+ * {@link given}, but never a function: where 1.40.0 took no function for a value (an aggregate's
152
+ * ids, `many` lists and sub-aggregates), and where the library reads a name 1.40.0 didn't read at
153
+ * all (a key composite its own entries lack, {@link keyEntries}), so a method of the payload's
154
+ * class is no value there.
155
+ */
156
+ export const givenData = (payload, name) => {
157
+ const value = given(payload, name);
158
+ return typeof value === "function" ? undefined : value;
159
+ };
160
+ /**
161
+ * What a caller's payload gives under `name`, where 1.40.0 asked `name in payload` and then read
162
+ * `payload[name]`: `{ value }` where it holds the name (as it asked, but never what every plain
163
+ * object inherits under it, {@link given}), `undefined` where it doesn't. Asked and read as 1.40.0
164
+ * asked and read it, once each.
165
+ */
166
+ export const givenEntry = (payload, name) => {
167
+ // Anything but an object is asked as 1.40.0 asked it, `name in payload`: a TypeError.
168
+ if (!isObject(payload)) {
169
+ const asked = payload;
170
+ return name in asked ? { value: asked[name] } : undefined;
171
+ }
172
+ if (!holds(payload, name))
173
+ return undefined;
174
+ const value = read(payload, name);
175
+ return isObjectPrototypeMember(name, value) && !Object.hasOwn(payload, name)
176
+ ? undefined
177
+ : { value };
178
+ };
179
+ /** Whether a caller's payload gives `name` ({@link givenEntry}), reading it once. */
180
+ export const givesName = (payload, name) => givenEntry(payload, name) !== undefined;
181
+ /** Whether `u` is an object a caller gives as a record of names: an object, not an array. */
182
+ export const isRecordObject = (u) => typeof u === "object" && u !== null && !Array.isArray(u);
183
+ /**
184
+ * A caller's key as a plain object, read as 1.40.0 read it (`Object.entries`): its own enumerable
185
+ * properties, and nothing else of it, wherever they hold every one of `required` (the composites
186
+ * the key can't be composed without). Only where they don't, where 1.40.0 failed ("Missing
187
+ * composite attribute"), is each of `required` and `optional` they lack read by name
188
+ * ({@link lackedByName}), so a key given by `Object.create`, a class with getters or a proxy is
189
+ * read for its composites. `map` makes each value read the value held (a composite's key form).
190
+ */
191
+ export const keyEntries = (payload, required, optional = [], map = (_name, value) => value) => {
192
+ const copy = {};
193
+ const entries = Object.entries(payload);
194
+ for (let index = 0; index < entries.length; index++) {
195
+ const [name, value] = entries[index];
196
+ setOwn(copy, name, map(name, value));
197
+ }
198
+ return lacksAny(copy, required)
199
+ ? lackedByName(payload, copy, [...required, ...optional], map)
200
+ : copy;
201
+ };
202
+ /** Whether `copy` lacks any of `names` as its own property. */
203
+ export const lacksAny = (copy, names) => names.some((name) => !Object.hasOwn(copy, name));
204
+ /**
205
+ * `copy` (a copy of a caller's `payload`'s own properties), given each of `names` it lacks that the
206
+ * payload gives otherwise, read by name ({@link givenData}: from a prototype, a class's getter or a
207
+ * proxy, never a function there), `map`ped. Read only where 1.40.0 failed for the lack.
208
+ *
209
+ * With `keep`, a name whose read throws ({@link UnreadableName}) doesn't throw here: the copy holds a
210
+ * property of that name that throws it again when it's read (a key handed on to a search, whose read
211
+ * of it fails the search).
212
+ */
213
+ export const lackedByName = (payload, copy, names, map = (_name, value) => value, keep) => {
214
+ for (const name of names) {
215
+ if (Object.hasOwn(copy, name))
216
+ continue;
217
+ let value;
218
+ try {
219
+ value = givenData(payload, name);
220
+ }
221
+ catch (error) {
222
+ if (keep === undefined || !isUnreadableName(error))
223
+ throw error;
224
+ Object.defineProperty(copy, name, {
225
+ get: () => {
226
+ throw error;
227
+ },
228
+ enumerable: true,
229
+ configurable: true,
230
+ });
231
+ continue;
232
+ }
233
+ if (value !== undefined)
234
+ setOwn(copy, name, map(name, value));
235
+ }
236
+ return copy;
237
+ };
238
+ /**
239
+ * A plain object holding what a value the library decoded gives (an aggregate's node, as Effect's
240
+ * parser built it): its own enumerable properties, and each of `names` (the fields its schema
241
+ * declares) it gives otherwise ({@link givenData}). Never a caller's object: the parser built it.
242
+ */
243
+ export const declaredCopy = (value, names) => {
244
+ const copy = {};
245
+ const entries = Object.entries(value);
246
+ for (let index = 0; index < entries.length; index++) {
247
+ const [name, held] = entries[index];
248
+ setOwn(copy, name, held);
249
+ }
250
+ for (const name of names) {
251
+ if (Object.hasOwn(copy, name))
252
+ continue;
253
+ const held = givenData(value, name);
254
+ if (held !== undefined)
255
+ setOwn(copy, name, held);
256
+ }
257
+ return copy;
258
+ };
259
+ /**
260
+ * The class `value` is an instance of: the nearest of its prototypes holding a function as its own
261
+ * `constructor` value, as `value.constructor` reads it for an instance. Never `value`'s own property
262
+ * of that name, nor a prototype's that is no function or is a getter: either is a field of a payload
263
+ * given by `Object.create` or by a class with getters, not the class, and is never read. `undefined`
264
+ * for an object without a prototype.
265
+ */
266
+ export const classOf = (value) => {
267
+ for (let prototype = Object.getPrototypeOf(value); prototype !== null && typeof prototype === "object"; prototype = Object.getPrototypeOf(prototype)) {
268
+ const made = Object.getOwnPropertyDescriptor(prototype, "constructor")?.value;
269
+ if (typeof made === "function")
270
+ return made;
271
+ }
272
+ return undefined;
273
+ };
274
+ /**
275
+ * Whether every value of `stored` (an encoded form) stores something under its name, by a form
276
+ * this code models exactly: text (`String`, a literal, a template literal, an enum), a number, a
277
+ * boolean, a `bigint`, `null`, a map (a struct or a record, a class's encoded side among them), a
278
+ * list (an array or a tuple), a suspended one followed, or a union of only such forms. A
279
+ * transformation is judged by its encoded side, which Effect validates every encoded value
280
+ * against. Anything else is not known to: `Schema.declare` and the declarations built on it
281
+ * (`Option`, `Date`, a set), `Unknown`, `Any`, `Undefined`, `Void`, `Never`, a symbol, an object
282
+ * keyword, a union with any of them, and a suspension that leads back to itself. A value of
283
+ * those may encode to `undefined`, which the marshaller stores as nothing
284
+ * (`removeUndefinedValues`).
285
+ */
286
+ const storesAlways = (stored, suspended) => {
287
+ if (SchemaAST.isOptional(stored))
288
+ return false;
289
+ if (SchemaAST.isString(stored) ||
290
+ SchemaAST.isNumber(stored) ||
291
+ SchemaAST.isBoolean(stored) ||
292
+ SchemaAST.isBigInt(stored) ||
293
+ SchemaAST.isLiteral(stored) ||
294
+ SchemaAST.isTemplateLiteral(stored) ||
295
+ SchemaAST.isEnum(stored) ||
296
+ SchemaAST.isNull(stored) ||
297
+ SchemaAST.isObjects(stored) ||
298
+ SchemaAST.isArrays(stored)) {
299
+ return true;
300
+ }
301
+ if (SchemaAST.isSuspend(stored)) {
302
+ if (suspended.has(stored))
303
+ return false;
304
+ return storesAlways(SchemaAST.toEncoded(stored.thunk()), new Set([...suspended, stored]));
305
+ }
306
+ if (SchemaAST.isUnion(stored)) {
307
+ return stored.types.every((member) => storesAlways(SchemaAST.toEncoded(member), suspended));
308
+ }
309
+ return false;
310
+ };
311
+ /**
312
+ * Whether every value of `ast` is certain to store something under its name: it is required, and
313
+ * its stored (encoded) form is one this code models exactly with no value that stores nothing
314
+ * ({@link storesAlways}). One that may be left out, may be `undefined` (`UndefinedOr`,
315
+ * `NullishOr`, a decoding default), or isn't modelled exactly (`Schema.declare`, `Option`, a
316
+ * union with such a member) lets a write store nothing there, as 1.40.0 stored it: a definition
317
+ * naming `__proto__` there loads, and a write giving it a value is refused when it's sent.
318
+ */
319
+ export const isRequiredStored = (ast) => storesAlways(SchemaAST.toEncoded(ast), new Set());
320
+ /**
321
+ * The stored form of `ast` where every value stored there is certain to be a map: `ast` is
322
+ * required, and its stored (encoded) form is a struct, a suspended one followed. `undefined` where
323
+ * a value stored there may be no map, or may be no value at all: an optional or an `optionalKey`
324
+ * position, a nullable one, a union (one alternative may be the struct, another not), a list or a
325
+ * tuple (an empty one holds none), a record, text (`Schema.fromJsonString`), a declaration with no
326
+ * encoding (`Schema.Option`).
327
+ */
328
+ export const certainStruct = (ast, seen = new Set()) => {
329
+ const stored = SchemaAST.toEncoded(ast);
330
+ if (SchemaAST.isOptional(stored) || seen.has(stored))
331
+ return undefined;
332
+ seen.add(stored);
333
+ if (SchemaAST.isSuspend(stored))
334
+ return certainStruct(stored.thunk(), seen);
335
+ return SchemaAST.isObjects(stored) ? stored : undefined;
336
+ };
337
+ /**
338
+ * Where, below `path`, every stored value of `ast` holds a property named `__proto__` in a map: a
339
+ * required property of a struct, with no value that stores nothing ({@link isRequiredStored}),
340
+ * reached from `ast` through containers each certain to hold a map ({@link certainStruct}): `ast`
341
+ * itself required, and each property on the way a required struct.
342
+ * The walk is of the stored (encoded) form. Wherever a container on the way may hold no map, or
343
+ * nothing (an optional or `optionalKey` one, a nullable one, a union, a list or a tuple, a record,
344
+ * text, a declaration with no encoding), a value may or may not hold the name: the definition
345
+ * loads, and a write that gives the name is refused when it's sent (`EDD-9165`). `packed` names the
346
+ * properties of `ast`'s own struct that are stored as JSON text (`DynamoModel.Packed`), which hold
347
+ * any name: the walk doesn't enter them.
348
+ */
349
+ export const requiredProtoPropertyIn = (ast, path, packed = new Set(), seen = new Set()) => {
350
+ const stored = certainStruct(ast, seen);
351
+ if (stored === undefined)
352
+ return undefined;
353
+ for (const property of stored.propertySignatures) {
354
+ if (typeof property.name !== "string" || SchemaAST.isOptional(property.type))
355
+ continue;
356
+ const at = path === "" ? property.name : `${path}.${property.name}`;
357
+ if (property.name === "__proto__") {
358
+ if (isRequiredStored(property.type))
359
+ return at;
360
+ continue;
361
+ }
362
+ if (packed.has(property.name))
363
+ continue;
364
+ const found = requiredProtoPropertyIn(property.type, at, undefined, seen);
365
+ if (found !== undefined)
366
+ return found;
367
+ }
368
+ return undefined;
369
+ };
370
+ /**
371
+ * `[EDD-9152]`: an entity names `__proto__` where every item it writes would hold it, as an
372
+ * attribute or as a property of a stored map. A JavaScript object can't take that name by
373
+ * assignment (it replaces the prototype), and the AWS SDK's marshaller drops an attribute or a map
374
+ * entry so named, while its reader sets a prototype from one: no write could store the item whole.
375
+ * So: an attribute the library writes on every item ({@link names}: the created and updated
376
+ * timestamps, the version, the table's key attributes, an index's key attributes where every
377
+ * composite of both its halves always stores something, the attribute a field that always stores
378
+ * something is stored under), a required model field stored under its own name whose every value
379
+ * stores something ({@link isRequiredStored}), and such a property of one reached through required
380
+ * struct properties ({@link requiredProtoPropertyIn}). Anything else of that name loads (an
381
+ * optional field or property, one whose stored form admits `undefined` or isn't modelled exactly,
382
+ * an index's key attribute that some item may be without): a write that doesn't give it does what
383
+ * it did, and one that does is refused when it's sent (`EDD-9165`). Nothing stored as JSON text is
384
+ * looked into. Thrown at `make`, before anything else is derived.
385
+ *
386
+ * `fields` are the model's fields; `storage` says which are stored under another attribute and
387
+ * which are packed.
388
+ */
389
+ export const refuseProtoName = (entityType, fields, storage, names) => {
390
+ const refuse = (what) => protoRefusal("EDD-9152", `Entity "${entityType}"`, what);
391
+ for (const { name, what, always } of names) {
392
+ if (name === "__proto__" && always !== false)
393
+ throw refuse(what);
394
+ }
395
+ for (const [name, field] of Object.entries(fields)) {
396
+ if (name === "__proto__" && !storage.renamed.has(name) && isRequiredStored(field.ast)) {
397
+ throw refuse("the model field");
398
+ }
399
+ if (storage.packed.has(name))
400
+ continue;
401
+ const property = requiredProtoPropertyIn(field.ast, name);
402
+ if (property !== undefined)
403
+ throw refuse(`the model's property at "${property}"`);
404
+ }
405
+ };
406
+ /**
407
+ * The refusal of a definition naming `__proto__` where every row it writes would hold it:
408
+ * `[EDD-9152]` for an entity ({@link refuseProtoName}), `[EDD-9153]` for an aggregate
409
+ * (`refuseAggregateProtoName`). `what` says where the name is.
410
+ */
411
+ export const protoRefusal = (code, owner, what) => new Error(`[${code}] ${owner}: ${what} is named "__proto__", and every row written would hold it. A ` +
412
+ `JavaScript object can't hold a property of that name by assignment, and the AWS SDK's ` +
413
+ `marshaller drops an attribute or a map entry so named, so the value would be lost when ` +
414
+ `it's written or read. Name it otherwise.`);
415
+ //# sourceMappingURL=OwnNames.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OwnNames.js","sourceRoot":"","sources":["../../src/internal/OwnNames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,IAAI,EAAe,SAAS,EAAE,MAAM,QAAQ,CAAA;AAErD,gEAAgE;AAChE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAA0B,EAAE,IAAiB,EAAW,EAAE,CACnF,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AAErD;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,MAA+C,EAC/C,IAAiB,EACF,EAAE,CACjB,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,EAA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