effect-dynamodb 0.1.0 → 1.1.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/DynamoClient.d.ts +3 -3
- package/dist/DynamoClient.d.ts.map +1 -1
- package/dist/DynamoClient.js +1 -3
- package/dist/DynamoClient.js.map +1 -1
- package/dist/Entity.d.ts +69 -10
- package/dist/Entity.d.ts.map +1 -1
- package/dist/Entity.js +383 -2
- package/dist/Entity.js.map +1 -1
- package/dist/KeyComposer.d.ts +14 -0
- package/dist/KeyComposer.d.ts.map +1 -1
- package/dist/KeyComposer.js +22 -1
- package/dist/KeyComposer.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/EntityConfig.d.ts +33 -0
- package/dist/internal/EntityConfig.d.ts.map +1 -1
- package/dist/internal/EntitySchemas.d.ts +14 -3
- package/dist/internal/EntitySchemas.d.ts.map +1 -1
- package/dist/internal/EntitySchemas.js +41 -2
- package/dist/internal/EntitySchemas.js.map +1 -1
- package/dist/internal/EntityTypes.d.ts +35 -3
- package/dist/internal/EntityTypes.d.ts.map +1 -1
- package/dist/internal/TransactableOps.d.ts +1 -1
- package/dist/internal/TransactableOps.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/_AggregateCursor.d.ts +0 -44
- package/dist/_AggregateCursor.d.ts.map +0 -1
- package/dist/_AggregateCursor.js +0 -18
- package/dist/_AggregateCursor.js.map +0 -1
- package/dist/_AggregateEdges.d.ts +0 -77
- package/dist/_AggregateEdges.d.ts.map +0 -1
- package/dist/_AggregateEdges.js +0 -41
- package/dist/_AggregateEdges.js.map +0 -1
- package/dist/_AggregateSchemas.d.ts +0 -69
- package/dist/_AggregateSchemas.d.ts.map +0 -1
- package/dist/_AggregateSchemas.js +0 -194
- package/dist/_AggregateSchemas.js.map +0 -1
- package/dist/_AggregateTypes.d.ts +0 -94
- package/dist/_AggregateTypes.d.ts.map +0 -1
- package/dist/_AggregateTypes.js +0 -7
- package/dist/_AggregateTypes.js.map +0 -1
- package/dist/_EntityCombinators.d.ts +0 -155
- package/dist/_EntityCombinators.d.ts.map +0 -1
- package/dist/_EntityCombinators.js +0 -158
- package/dist/_EntityCombinators.js.map +0 -1
- package/dist/_EntityConfig.d.ts +0 -100
- package/dist/_EntityConfig.d.ts.map +0 -1
- package/dist/_EntityConfig.js +0 -7
- package/dist/_EntityConfig.js.map +0 -1
- package/dist/_EntityOps.d.ts +0 -205
- package/dist/_EntityOps.d.ts.map +0 -1
- package/dist/_EntityOps.js +0 -137
- package/dist/_EntityOps.js.map +0 -1
- package/dist/_EntitySchemas.d.ts +0 -57
- package/dist/_EntitySchemas.d.ts.map +0 -1
- package/dist/_EntitySchemas.js +0 -298
- package/dist/_EntitySchemas.js.map +0 -1
- package/dist/_EntityTypes.d.ts +0 -81
- package/dist/_EntityTypes.d.ts.map +0 -1
- package/dist/_EntityTypes.js +0 -7
- package/dist/_EntityTypes.js.map +0 -1
- package/dist/_sparse_check.d.ts +0 -2
- package/dist/_sparse_check.d.ts.map +0 -1
- package/dist/_sparse_check.js +0 -193
- package/dist/_sparse_check.js.map +0 -1
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal Entity operation combinators — terminal functions and update combinators.
|
|
3
|
-
*
|
|
4
|
-
* Extracted from Entity.ts for decomposition. Not part of the public API.
|
|
5
|
-
*/
|
|
6
|
-
import { Function as Fn } from "effect";
|
|
7
|
-
import { EntityDeleteImpl, EntityDeleteTypeId, EntityGetImpl, EntityOpTypeId, EntityPutImpl, EntityUpdateImpl, EntityUpdateTypeId, } from "./_EntityOps.js";
|
|
8
|
-
/** Decode through model schema (default for yield*). Returns clean model class instance. */
|
|
9
|
-
export const asModel = (self) => self._run("model");
|
|
10
|
-
/** Decode through record schema (model + system fields). */
|
|
11
|
-
export const asRecord = (self) => self._run("record");
|
|
12
|
-
/** Decode through item schema (model + system + keys + `__edd_e__`). Returns `Record<string, unknown>`. */
|
|
13
|
-
export const asItem = (self) => self._run("item");
|
|
14
|
-
/** Return raw marshalled DynamoDB format (`Record<string, AttributeValue>`). No decode. */
|
|
15
|
-
export const asNative = (self) => self._run("native");
|
|
16
|
-
// ---------------------------------------------------------------------------
|
|
17
|
-
// Update combinators — dual functions for pipe composition
|
|
18
|
-
//
|
|
19
|
-
// Cast rationale: Each combinator creates a new EntityUpdateImpl with updated
|
|
20
|
-
// state while preserving the phantom type parameters (A, Rec, U, E, R).
|
|
21
|
-
// The `_builder as any` is needed because the builder function's generic
|
|
22
|
-
// signature doesn't survive reconstruction — the runtime behavior is identical.
|
|
23
|
-
// The `as any` on the return bridges from the impl class to the interface type.
|
|
24
|
-
// ---------------------------------------------------------------------------
|
|
25
|
-
/**
|
|
26
|
-
* Set the fields to update.
|
|
27
|
-
*
|
|
28
|
-
* When updating GSI composite fields, the consumer is responsible for providing ALL
|
|
29
|
-
* composites for that GSI (fetch-merge pattern). If only some composites are provided,
|
|
30
|
-
* `extractComposites` in KeyComposer will throw during GSI key recomposition.
|
|
31
|
-
*
|
|
32
|
-
* When using `Entity.remove()` on a GSI composite attribute, the corresponding GSI
|
|
33
|
-
* key fields (pk/sk) are automatically removed so the item drops out of the sparse index.
|
|
34
|
-
*/
|
|
35
|
-
export const set = Fn.dual(2, (self, updates) => {
|
|
36
|
-
return new EntityUpdateImpl(self._builder, { ...self._updateState, updates }, self._entity, self._key);
|
|
37
|
-
});
|
|
38
|
-
/** Set the expected version for optimistic locking. */
|
|
39
|
-
export const expectedVersion = Fn.dual(2, (self, version) => {
|
|
40
|
-
return new EntityUpdateImpl(self._builder, { ...self._updateState, expectedVersion: version }, self._entity, self._key);
|
|
41
|
-
});
|
|
42
|
-
/**
|
|
43
|
-
* Enable consistent reads on an EntityGet operation.
|
|
44
|
-
* Call with no arguments to enable (defaults to true).
|
|
45
|
-
*/
|
|
46
|
-
export const consistentRead = Fn.dual((args) => args.length >= 1 &&
|
|
47
|
-
typeof args[0] === "object" &&
|
|
48
|
-
args[0] !== null &&
|
|
49
|
-
EntityOpTypeId in args[0], (self) => {
|
|
50
|
-
const impl = self;
|
|
51
|
-
return new EntityGetImpl(impl._builder, impl._entity, impl._key, true);
|
|
52
|
-
});
|
|
53
|
-
/**
|
|
54
|
-
* Select specific attributes to return (ProjectionExpression) on an EntityGet.
|
|
55
|
-
* When projection is active, the result is a raw `Record<string, unknown>`
|
|
56
|
-
* instead of a decoded schema instance, since projected items may be partial.
|
|
57
|
-
*/
|
|
58
|
-
export const project = Fn.dual(2, (self, attributes) => {
|
|
59
|
-
const impl = self;
|
|
60
|
-
return new EntityGetImpl(impl._builder, impl._entity, impl._key, impl._consistentRead, attributes);
|
|
61
|
-
});
|
|
62
|
-
/**
|
|
63
|
-
* Add a condition expression to a put, update, or delete operation.
|
|
64
|
-
* The condition is evaluated server-side by DynamoDB. If it fails,
|
|
65
|
-
* the operation returns a `ConditionalCheckFailed` error.
|
|
66
|
-
*
|
|
67
|
-
* For updates, the user condition is ANDed with any optimistic lock condition.
|
|
68
|
-
*/
|
|
69
|
-
export const condition = Fn.dual(2, (self, cond) => {
|
|
70
|
-
if (EntityDeleteTypeId in self) {
|
|
71
|
-
// EntityDelete
|
|
72
|
-
const impl = self;
|
|
73
|
-
return new EntityDeleteImpl(impl._builder, impl._entity, impl._key, cond, impl._returnValues);
|
|
74
|
-
}
|
|
75
|
-
if (EntityUpdateTypeId in self) {
|
|
76
|
-
// EntityUpdate
|
|
77
|
-
const impl = self;
|
|
78
|
-
return new EntityUpdateImpl(impl._builder, { ...impl._updateState, condition: cond }, impl._entity, impl._key);
|
|
79
|
-
}
|
|
80
|
-
// EntityPut
|
|
81
|
-
const impl = self;
|
|
82
|
-
return new EntityPutImpl(impl._builder, impl._entity, impl._input, cond);
|
|
83
|
-
});
|
|
84
|
-
/**
|
|
85
|
-
* Set the DynamoDB `ReturnValues` mode on an update or delete operation.
|
|
86
|
-
*
|
|
87
|
-
* Modes:
|
|
88
|
-
* - `"none"` — return nothing (default for delete)
|
|
89
|
-
* - `"allOld"` — return the item as it was before the operation
|
|
90
|
-
* - `"allNew"` — return the item as it is after the operation (default for update)
|
|
91
|
-
* - `"updatedOld"` — return only the updated attributes, with old values
|
|
92
|
-
* - `"updatedNew"` — return only the updated attributes, with new values
|
|
93
|
-
*
|
|
94
|
-
* For deletes, only `"none"` and `"allOld"` are valid DynamoDB modes.
|
|
95
|
-
*/
|
|
96
|
-
export const returnValues = Fn.dual(2, (self, mode) => {
|
|
97
|
-
if (EntityDeleteTypeId in self) {
|
|
98
|
-
const impl = self;
|
|
99
|
-
return new EntityDeleteImpl(impl._builder, impl._entity, impl._key, impl._condition, mode);
|
|
100
|
-
}
|
|
101
|
-
// EntityUpdate
|
|
102
|
-
const impl = self;
|
|
103
|
-
return new EntityUpdateImpl(impl._builder, { ...impl._updateState, returnValues: mode }, impl._entity, impl._key);
|
|
104
|
-
});
|
|
105
|
-
/**
|
|
106
|
-
* Remove one or more attributes from the item.
|
|
107
|
-
* Produces a DynamoDB `REMOVE` clause.
|
|
108
|
-
*/
|
|
109
|
-
export const remove = Fn.dual(2, (self, fields) => {
|
|
110
|
-
const existing = self._updateState.remove ?? [];
|
|
111
|
-
return new EntityUpdateImpl(self._builder, { ...self._updateState, remove: [...existing, ...fields] }, self._entity, self._key);
|
|
112
|
-
});
|
|
113
|
-
/**
|
|
114
|
-
* Atomically add numeric values to attributes.
|
|
115
|
-
* Produces a DynamoDB `ADD` clause. If the attribute doesn't exist,
|
|
116
|
-
* it is initialized to the provided value.
|
|
117
|
-
*/
|
|
118
|
-
export const add = Fn.dual(2, (self, values) => {
|
|
119
|
-
const existing = self._updateState.add ?? {};
|
|
120
|
-
return new EntityUpdateImpl(self._builder, { ...self._updateState, add: { ...existing, ...values } }, self._entity, self._key);
|
|
121
|
-
});
|
|
122
|
-
/**
|
|
123
|
-
* Subtract numeric values from attributes.
|
|
124
|
-
* Synthesizes `SET #field = #field - :val` (DynamoDB has no native SUBTRACT).
|
|
125
|
-
*/
|
|
126
|
-
export const subtract = Fn.dual(2, (self, values) => {
|
|
127
|
-
const existing = self._updateState.subtract ?? {};
|
|
128
|
-
return new EntityUpdateImpl(self._builder, { ...self._updateState, subtract: { ...existing, ...values } }, self._entity, self._key);
|
|
129
|
-
});
|
|
130
|
-
/**
|
|
131
|
-
* Append elements to list attributes.
|
|
132
|
-
* Synthesizes `SET #field = list_append(#field, :val)`.
|
|
133
|
-
*/
|
|
134
|
-
export const append = Fn.dual(2, (self, values) => {
|
|
135
|
-
const existing = self._updateState.append ?? {};
|
|
136
|
-
return new EntityUpdateImpl(self._builder, { ...self._updateState, append: { ...existing, ...values } }, self._entity, self._key);
|
|
137
|
-
});
|
|
138
|
-
/**
|
|
139
|
-
* Delete elements from a set attribute.
|
|
140
|
-
* Produces a DynamoDB `DELETE` clause.
|
|
141
|
-
* The value should be a set (e.g., `{ tags: new Set(["old"]) }`).
|
|
142
|
-
*/
|
|
143
|
-
export const deleteFromSet = Fn.dual(2, (self, values) => {
|
|
144
|
-
const existing = self._updateState.deleteFromSet ?? {};
|
|
145
|
-
return new EntityUpdateImpl(self._builder, { ...self._updateState, deleteFromSet: { ...existing, ...values } }, self._entity, self._key);
|
|
146
|
-
});
|
|
147
|
-
/**
|
|
148
|
-
* Configure cascade updates to propagate source entity changes to target entities
|
|
149
|
-
* that embed it via `DynamoModel.ref`. After the source update completes, all matching
|
|
150
|
-
* target items are queried via their cascade GSI and updated with the new domain data.
|
|
151
|
-
*
|
|
152
|
-
* Default mode is "eventual" (batch updates, no item limit).
|
|
153
|
-
* Use `mode: "transactional"` for atomic cascade (max 100 items).
|
|
154
|
-
*/
|
|
155
|
-
export const cascade = Fn.dual(2, (self, config) => {
|
|
156
|
-
return new EntityUpdateImpl(self._builder, { ...self._updateState, cascade: config }, self._entity, self._key);
|
|
157
|
-
});
|
|
158
|
-
//# sourceMappingURL=_EntityCombinators.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1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,IAAI,CAAC,QAAe,EACpB,EAAE,GAAG,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,EACzC,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,IAAI,CACH,CAAA;AACV,CAAC,CACF,CAAA"}
|
package/dist/_EntityConfig.d.ts
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal Entity configuration types — system field and constraint config.
|
|
3
|
-
*
|
|
4
|
-
* Extracted from Entity.ts for decomposition. Not part of the public API.
|
|
5
|
-
*/
|
|
6
|
-
import type { Duration, Schema } from "effect";
|
|
7
|
-
/**
|
|
8
|
-
* Per-timestamp field configuration.
|
|
9
|
-
*
|
|
10
|
-
* - `string` — override field name only (default DateString schema)
|
|
11
|
-
* - `Schema.Top` — override schema only (default field name)
|
|
12
|
-
* - `{ field?, schema? }` — override both field name and schema
|
|
13
|
-
*/
|
|
14
|
-
export type TimestampFieldConfig = string | Schema.Top | {
|
|
15
|
-
readonly field?: string | undefined;
|
|
16
|
-
readonly schema?: Schema.Top | undefined;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Timestamp configuration for automatic `createdAt` / `updatedAt` fields.
|
|
20
|
-
*
|
|
21
|
-
* - `true` — add `createdAt` and `updatedAt` with default names and ISO string storage
|
|
22
|
-
* - `{ created?, updated? }` — per-field configuration (string, schema, or object)
|
|
23
|
-
* - `false` / `undefined` — no timestamps
|
|
24
|
-
*/
|
|
25
|
-
export type TimestampsConfig = boolean | {
|
|
26
|
-
readonly created?: TimestampFieldConfig | undefined;
|
|
27
|
-
readonly updated?: TimestampFieldConfig | undefined;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Optimistic locking configuration via an auto-incrementing version field.
|
|
31
|
-
*
|
|
32
|
-
* - `true` — add a `version` field with default name
|
|
33
|
-
* - `{ field?, retain?, ttl? }` — override field name and retention behavior
|
|
34
|
-
* - `false` / `undefined` — no versioning
|
|
35
|
-
*/
|
|
36
|
-
export type VersionedConfig = boolean | {
|
|
37
|
-
readonly field?: string | undefined;
|
|
38
|
-
readonly retain?: boolean | undefined;
|
|
39
|
-
readonly ttl?: Duration.Duration | undefined;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Soft-delete configuration. When enabled, deletes mark items rather than removing them.
|
|
43
|
-
*
|
|
44
|
-
* - `true` — enable soft delete with defaults
|
|
45
|
-
* - `{ ttl?, preserveUnique? }` — configure TTL cleanup and unique constraint behavior
|
|
46
|
-
* - `false` / `undefined` — hard deletes
|
|
47
|
-
*/
|
|
48
|
-
export type SoftDeleteConfig = boolean | {
|
|
49
|
-
readonly ttl?: Duration.Duration | undefined;
|
|
50
|
-
readonly preserveUnique?: boolean | undefined;
|
|
51
|
-
};
|
|
52
|
-
/** An array of model field names that together form a unique constraint. */
|
|
53
|
-
export type UniqueFieldsDef = ReadonlyArray<string>;
|
|
54
|
-
/**
|
|
55
|
-
* A unique constraint definition — either a simple field list or an object
|
|
56
|
-
* with additional options like TTL for sentinel items.
|
|
57
|
-
*/
|
|
58
|
-
export type UniqueConstraintDef = UniqueFieldsDef | {
|
|
59
|
-
readonly fields: UniqueFieldsDef;
|
|
60
|
-
readonly ttl?: Duration.Duration | undefined;
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Map of named unique constraints. Each key is the constraint name,
|
|
64
|
-
* each value defines which fields must be globally unique together.
|
|
65
|
-
*
|
|
66
|
-
* Enforced via DynamoDB transaction sentinel items.
|
|
67
|
-
*/
|
|
68
|
-
export type UniqueConfig = globalThis.Record<string, UniqueConstraintDef>;
|
|
69
|
-
/**
|
|
70
|
-
* Per-ref cascade index configuration. Tells Entity.make() which physical GSI
|
|
71
|
-
* to use for auto-generated cascade indexes.
|
|
72
|
-
*
|
|
73
|
-
* The library fills in the PK/SK composites automatically from the resolved ref
|
|
74
|
-
* and primary key — the consumer only specifies physical GSI details.
|
|
75
|
-
*/
|
|
76
|
-
export interface CascadeIndexConfig {
|
|
77
|
-
/** Physical GSI name (e.g., "gsi3") */
|
|
78
|
-
readonly index: string;
|
|
79
|
-
/** PK field descriptor */
|
|
80
|
-
readonly pk: {
|
|
81
|
-
readonly field: string;
|
|
82
|
-
};
|
|
83
|
-
/** SK field descriptor */
|
|
84
|
-
readonly sk: {
|
|
85
|
-
readonly field: string;
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* A ref value in the `refs` config — an object with the entity and optional cascade index config.
|
|
90
|
-
*
|
|
91
|
-
* Simple: `refs: { player: { entity: Players } }`
|
|
92
|
-
* Cascade: `refs: { player: { entity: Players, cascade: { index: "gsi3", pk: { field: "gsi3pk" }, sk: { field: "gsi3sk" } } } }`
|
|
93
|
-
*/
|
|
94
|
-
export interface RefValue {
|
|
95
|
-
readonly entity: {
|
|
96
|
-
readonly _tag: "Entity";
|
|
97
|
-
};
|
|
98
|
-
readonly cascade?: CascadeIndexConfig;
|
|
99
|
-
}
|
|
100
|
-
//# sourceMappingURL=_EntityConfig.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_EntityConfig.d.ts","sourceRoot":"","sources":["../src/_EntityConfig.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAM9C;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAC5B,MAAM,GACN,MAAM,CAAC,GAAG,GACV;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG,GAAG,SAAS,CAAA;CAAE,CAAA;AAErF;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GACxB,OAAO,GACP;IACE,QAAQ,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAA;IACnD,QAAQ,CAAC,OAAO,CA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AM,WAAW,QAAQ;IACvB,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;KAAE,CAAA;IAC5C,QAAQ,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAA;CACtC"}
|
package/dist/_EntityConfig.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_EntityConfig.js","sourceRoot":"","sources":["../src/_EntityConfig.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
package/dist/_EntityOps.d.ts
DELETED
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal Entity operation intermediates — lazy, pipeable, effectable.
|
|
3
|
-
*
|
|
4
|
-
* Extracted from Entity.ts for decomposition. Not part of the public API.
|
|
5
|
-
*/
|
|
6
|
-
import type { ReturnValue } from "@aws-sdk/client-dynamodb";
|
|
7
|
-
import { Effect, Pipeable } from "effect";
|
|
8
|
-
import type { ConditionInput } from "./Expression.js";
|
|
9
|
-
import type { IndexDefinition } from "./KeyComposer.js";
|
|
10
|
-
import type { Table } from "./Table.js";
|
|
11
|
-
/** @internal */
|
|
12
|
-
export declare const EntityOpTypeId: unique symbol;
|
|
13
|
-
export type EntityOpTypeId = typeof EntityOpTypeId;
|
|
14
|
-
/** @internal */
|
|
15
|
-
export declare const EntityUpdateTypeId: unique symbol;
|
|
16
|
-
export type EntityUpdateTypeId = typeof EntityUpdateTypeId;
|
|
17
|
-
/** @internal */
|
|
18
|
-
export declare const EntityDeleteTypeId: unique symbol;
|
|
19
|
-
export type EntityDeleteTypeId = typeof EntityDeleteTypeId;
|
|
20
|
-
export type DecodeMode = "model" | "record" | "item" | "native" | "raw";
|
|
21
|
-
/** DynamoDB ReturnValues modes */
|
|
22
|
-
export type ReturnValuesMode = "none" | "allOld" | "allNew" | "updatedOld" | "updatedNew";
|
|
23
|
-
/** @internal Map from our mode names to DynamoDB ReturnValues strings */
|
|
24
|
-
export declare const returnValuesMap: globalThis.Record<ReturnValuesMode, ReturnValue>;
|
|
25
|
-
/** @internal Minimal shape needed from cascade target entities */
|
|
26
|
-
export interface CascadeTarget {
|
|
27
|
-
readonly entityType: string;
|
|
28
|
-
readonly indexes: globalThis.Record<string, IndexDefinition>;
|
|
29
|
-
readonly table: Table;
|
|
30
|
-
readonly _resolvedRefs: ReadonlyArray<{
|
|
31
|
-
readonly fieldName: string;
|
|
32
|
-
readonly idFieldName: string;
|
|
33
|
-
readonly identifierField: string;
|
|
34
|
-
readonly refEntityType: string;
|
|
35
|
-
}>;
|
|
36
|
-
}
|
|
37
|
-
/** @internal */
|
|
38
|
-
export interface CascadeConfig {
|
|
39
|
-
readonly targets: ReadonlyArray<CascadeTarget>;
|
|
40
|
-
readonly filter?: globalThis.Record<string, unknown> | undefined;
|
|
41
|
-
readonly mode?: "eventual" | "transactional" | undefined;
|
|
42
|
-
}
|
|
43
|
-
/** @internal */
|
|
44
|
-
export interface UpdateState {
|
|
45
|
-
readonly updates: unknown;
|
|
46
|
-
readonly expectedVersion: number | undefined;
|
|
47
|
-
readonly condition: ConditionInput | undefined;
|
|
48
|
-
readonly remove: ReadonlyArray<string> | undefined;
|
|
49
|
-
readonly add: globalThis.Record<string, number> | undefined;
|
|
50
|
-
readonly subtract: globalThis.Record<string, number> | undefined;
|
|
51
|
-
readonly append: globalThis.Record<string, ReadonlyArray<unknown>> | undefined;
|
|
52
|
-
readonly deleteFromSet: globalThis.Record<string, unknown> | undefined;
|
|
53
|
-
readonly returnValues: ReturnValuesMode | undefined;
|
|
54
|
-
readonly cascade: CascadeConfig | undefined;
|
|
55
|
-
}
|
|
56
|
-
export declare const emptyUpdateState: UpdateState;
|
|
57
|
-
/**
|
|
58
|
-
* Base interface for lazy Entity operation intermediates.
|
|
59
|
-
* Yieldable (`yield*` defaults to model decode mode) and Pipeable.
|
|
60
|
-
* NOT assignable to `Effect` — call `.asEffect()` to cross the boundary.
|
|
61
|
-
*
|
|
62
|
-
* @typeParam A - Decoded model type (e.g., `User`)
|
|
63
|
-
* @typeParam Rec - Record type — model fields plus system fields (timestamps, version)
|
|
64
|
-
* @typeParam E - Error channel
|
|
65
|
-
* @typeParam R - Required services
|
|
66
|
-
*/
|
|
67
|
-
export interface EntityOp<A, Rec, E, R> extends Effect.Yieldable<EntityOp<A, Rec, E, R>, A, E, R>, Pipeable.Pipeable {
|
|
68
|
-
readonly [EntityOpTypeId]: EntityOpTypeId;
|
|
69
|
-
/** @internal */
|
|
70
|
-
readonly _run: (mode: DecodeMode) => Effect.Effect<any, E, R>;
|
|
71
|
-
/** @internal */ readonly _Rec: (_: never) => Rec;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Lazy intermediate returned by `Entity.get()`.
|
|
75
|
-
* `yield*` returns the model type. Pipe to {@link asRecord}, {@link asItem}, or {@link asNative} for alternate decode modes.
|
|
76
|
-
*
|
|
77
|
-
* @typeParam A - Decoded model type
|
|
78
|
-
* @typeParam Rec - Record type (model + system fields)
|
|
79
|
-
* @typeParam E - Error channel
|
|
80
|
-
* @typeParam R - Required services
|
|
81
|
-
*/
|
|
82
|
-
export interface EntityGet<A, Rec, E, R> extends EntityOp<A, Rec, E, R> {
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Lazy intermediate returned by `Entity.put()`.
|
|
86
|
-
* `yield*` returns the model type. Pipe to {@link asRecord}, {@link asItem}, or {@link asNative} for alternate decode modes.
|
|
87
|
-
*
|
|
88
|
-
* @typeParam A - Decoded model type
|
|
89
|
-
* @typeParam Rec - Record type (model + system fields)
|
|
90
|
-
* @typeParam E - Error channel
|
|
91
|
-
* @typeParam R - Required services
|
|
92
|
-
*/
|
|
93
|
-
export interface EntityPut<A, Rec, E, R> extends EntityOp<A, Rec, E, R> {
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Lazy intermediate returned by `Entity.update()`.
|
|
97
|
-
* `yield*` returns the model type. Pipe to {@link asRecord}, {@link asItem}, or {@link asNative} for alternate decode modes.
|
|
98
|
-
* Supports {@link set} and {@link expectedVersion} combinators via pipe.
|
|
99
|
-
*
|
|
100
|
-
* @typeParam A - Decoded model type
|
|
101
|
-
* @typeParam Rec - Record type (model + system fields)
|
|
102
|
-
* @typeParam U - Update payload type (partial model minus keys, with GSI all-or-none constraints)
|
|
103
|
-
* @typeParam E - Error channel
|
|
104
|
-
* @typeParam R - Required services
|
|
105
|
-
*/
|
|
106
|
-
export interface EntityUpdate<A, Rec, U, E, R> extends EntityOp<A, Rec, E, R> {
|
|
107
|
-
readonly [EntityUpdateTypeId]: EntityUpdateTypeId;
|
|
108
|
-
/** @internal phantom */ readonly _U: (_: never) => U;
|
|
109
|
-
/** @internal */
|
|
110
|
-
readonly _updateState: UpdateState;
|
|
111
|
-
/** @internal */
|
|
112
|
-
readonly _builder: (mode: DecodeMode, state: UpdateState) => Effect.Effect<any, E, R>;
|
|
113
|
-
/** @internal */
|
|
114
|
-
readonly _entity: EntityBase;
|
|
115
|
-
/** @internal */
|
|
116
|
-
readonly _key: globalThis.Record<string, unknown>;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Lazy intermediate returned by Entity.delete().
|
|
120
|
-
* yield* returns void. Carries entity + key for Transaction/Batch extraction.
|
|
121
|
-
* Does NOT extend EntityOp (no decode mode — delete returns void).
|
|
122
|
-
* NOT assignable to `Effect` — call `.asEffect()` to cross the boundary.
|
|
123
|
-
*/
|
|
124
|
-
export interface EntityDelete<E, R> extends Effect.Yieldable<EntityDelete<E, R>, void, E, R>, Pipeable.Pipeable {
|
|
125
|
-
readonly [EntityDeleteTypeId]: EntityDeleteTypeId;
|
|
126
|
-
/** @internal */ readonly _opType: "delete";
|
|
127
|
-
/** @internal */ readonly _entity: EntityBase;
|
|
128
|
-
/** @internal */ readonly _key: globalThis.Record<string, unknown>;
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* @internal Minimal entity shape used by operation intermediates.
|
|
132
|
-
* Avoids circular dependency with the full Entity interface.
|
|
133
|
-
*/
|
|
134
|
-
export interface EntityBase {
|
|
135
|
-
readonly _tag: "Entity";
|
|
136
|
-
}
|
|
137
|
-
export interface EntityGetOpts {
|
|
138
|
-
readonly consistentRead: boolean;
|
|
139
|
-
readonly projection: ReadonlyArray<string> | undefined;
|
|
140
|
-
}
|
|
141
|
-
export declare class EntityGetImpl<A, Rec, E, R> extends Effect.YieldableClass<A, E, R> {
|
|
142
|
-
readonly _builder: (mode: DecodeMode, opts: EntityGetOpts) => Effect.Effect<any, E, R>;
|
|
143
|
-
readonly [EntityOpTypeId]: EntityOpTypeId;
|
|
144
|
-
readonly _opType: "get";
|
|
145
|
-
readonly _Rec: (_: never) => Rec;
|
|
146
|
-
readonly _entity: EntityBase;
|
|
147
|
-
readonly _key: globalThis.Record<string, unknown>;
|
|
148
|
-
readonly _consistentRead: boolean;
|
|
149
|
-
readonly _projection: ReadonlyArray<string> | undefined;
|
|
150
|
-
constructor(_builder: (mode: DecodeMode, opts: EntityGetOpts) => Effect.Effect<any, E, R>, entity: EntityBase, key: globalThis.Record<string, unknown>, consistentRead?: boolean, projection?: ReadonlyArray<string>);
|
|
151
|
-
get _run(): (mode: DecodeMode) => Effect.Effect<any, E, R>;
|
|
152
|
-
asEffect(): Effect.Effect<A, E, R>;
|
|
153
|
-
pipe(): unknown;
|
|
154
|
-
}
|
|
155
|
-
export declare class EntityPutImpl<A, Rec, E, R> extends Effect.YieldableClass<A, E, R> {
|
|
156
|
-
readonly _builder: (mode: DecodeMode, opts: {
|
|
157
|
-
readonly condition: ConditionInput | undefined;
|
|
158
|
-
}) => Effect.Effect<any, E, R>;
|
|
159
|
-
readonly [EntityOpTypeId]: EntityOpTypeId;
|
|
160
|
-
readonly _opType: "put";
|
|
161
|
-
readonly _Rec: (_: never) => Rec;
|
|
162
|
-
readonly _entity: EntityBase;
|
|
163
|
-
readonly _input: globalThis.Record<string, unknown>;
|
|
164
|
-
readonly _condition: ConditionInput | undefined;
|
|
165
|
-
constructor(_builder: (mode: DecodeMode, opts: {
|
|
166
|
-
readonly condition: ConditionInput | undefined;
|
|
167
|
-
}) => Effect.Effect<any, E, R>, entity: EntityBase, input: globalThis.Record<string, unknown>, condition?: ConditionInput | undefined);
|
|
168
|
-
get _run(): (mode: DecodeMode) => Effect.Effect<any, E, R>;
|
|
169
|
-
asEffect(): Effect.Effect<A, E, R>;
|
|
170
|
-
pipe(): unknown;
|
|
171
|
-
}
|
|
172
|
-
export declare class EntityUpdateImpl<A, Rec, U, E, R> extends Effect.YieldableClass<A, E, R> {
|
|
173
|
-
readonly _builder: (mode: DecodeMode, state: UpdateState) => Effect.Effect<any, E, R>;
|
|
174
|
-
readonly _updateState: UpdateState;
|
|
175
|
-
readonly [EntityOpTypeId]: EntityOpTypeId;
|
|
176
|
-
readonly [EntityUpdateTypeId]: EntityUpdateTypeId;
|
|
177
|
-
readonly _opType: "update";
|
|
178
|
-
readonly _Rec: (_: never) => Rec;
|
|
179
|
-
readonly _U: (_: never) => U;
|
|
180
|
-
readonly _entity: EntityBase;
|
|
181
|
-
readonly _key: globalThis.Record<string, unknown>;
|
|
182
|
-
constructor(_builder: (mode: DecodeMode, state: UpdateState) => Effect.Effect<any, E, R>, _updateState: UpdateState, entity: EntityBase, key: globalThis.Record<string, unknown>);
|
|
183
|
-
get _run(): (mode: DecodeMode) => Effect.Effect<any, E, R>;
|
|
184
|
-
asEffect(): Effect.Effect<A, E, R>;
|
|
185
|
-
pipe(): unknown;
|
|
186
|
-
}
|
|
187
|
-
export declare class EntityDeleteImpl<E, R> extends Effect.YieldableClass<void, E, R> {
|
|
188
|
-
readonly _builder: (opts: {
|
|
189
|
-
readonly condition: ConditionInput | undefined;
|
|
190
|
-
readonly returnValues: ReturnValuesMode | undefined;
|
|
191
|
-
}) => Effect.Effect<void, E, R>;
|
|
192
|
-
readonly [EntityDeleteTypeId]: EntityDeleteTypeId;
|
|
193
|
-
readonly _opType: "delete";
|
|
194
|
-
readonly _entity: EntityBase;
|
|
195
|
-
readonly _key: globalThis.Record<string, unknown>;
|
|
196
|
-
readonly _condition: ConditionInput | undefined;
|
|
197
|
-
readonly _returnValues: ReturnValuesMode | undefined;
|
|
198
|
-
constructor(_builder: (opts: {
|
|
199
|
-
readonly condition: ConditionInput | undefined;
|
|
200
|
-
readonly returnValues: ReturnValuesMode | undefined;
|
|
201
|
-
}) => Effect.Effect<void, E, R>, entity: EntityBase, key: globalThis.Record<string, unknown>, condition?: ConditionInput | undefined, returnValues?: ReturnValuesMode | undefined);
|
|
202
|
-
asEffect(): Effect.Effect<void, E, R>;
|
|
203
|
-
pipe(): unknown;
|
|
204
|
-
}
|
|
205
|
-
//# sourceMappingURL=_EntityOps.d.ts.map
|
package/dist/_EntityOps.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_EntityOps.d.ts","sourceRoot":"","sources":["../src/_EntityOps.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAMvC,gBAAgB;AAChB,eAAO,MAAM,cAAc,EAAE,OAAO,MAA+C,CAAA;AACnF,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAA;AAElD,gBAAgB;AAChB,eAAO,MAAM,kBAAkB,EAAE,OAAO,MAAmD,CAAA;AAC3F,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAA;AAE1D,gBAAgB;AAChB,eAAO,MAAM,kBAAkB,EAAE,OAAO,MAAmD,CAAA;AAC3F,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAA;AAM1D,MAA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GAAG,SAAS,CAAA;gBAEzC,QAAQ,EAAE,CAAC,IAAI,EAAE;QACxB,QAAQ,CAAC,SAAS,EAAE,cAAc,GAAG,SAAS,CAAA;QAC9C,QAAQ,CAAC,YAAY,EAAE,gBAAgB,GAAG,SAAS,CAAA;KACpD,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,EAC/B,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvC,SAAS,CAAC,EAAE,cAAc,GAAG,SAAS,EACtC,YAAY,CAAC,EAAE,gBAAgB,GAAG,SAAS;IAQ7C,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;IAIrC,IAAI;CAGL"}
|
package/dist/_EntityOps.js
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal Entity operation intermediates — lazy, pipeable, effectable.
|
|
3
|
-
*
|
|
4
|
-
* Extracted from Entity.ts for decomposition. Not part of the public API.
|
|
5
|
-
*/
|
|
6
|
-
import { Effect, Pipeable } from "effect";
|
|
7
|
-
// ---------------------------------------------------------------------------
|
|
8
|
-
// TypeId symbols
|
|
9
|
-
// ---------------------------------------------------------------------------
|
|
10
|
-
/** @internal */
|
|
11
|
-
export const EntityOpTypeId = Symbol.for("effect-dynamodb/EntityOp");
|
|
12
|
-
/** @internal */
|
|
13
|
-
export const EntityUpdateTypeId = Symbol.for("effect-dynamodb/EntityUpdate");
|
|
14
|
-
/** @internal */
|
|
15
|
-
export const EntityDeleteTypeId = Symbol.for("effect-dynamodb/EntityDelete");
|
|
16
|
-
/** @internal Map from our mode names to DynamoDB ReturnValues strings */
|
|
17
|
-
export const returnValuesMap = {
|
|
18
|
-
none: "NONE",
|
|
19
|
-
allOld: "ALL_OLD",
|
|
20
|
-
allNew: "ALL_NEW",
|
|
21
|
-
updatedOld: "UPDATED_OLD",
|
|
22
|
-
updatedNew: "UPDATED_NEW",
|
|
23
|
-
};
|
|
24
|
-
export const emptyUpdateState = {
|
|
25
|
-
updates: undefined,
|
|
26
|
-
expectedVersion: undefined,
|
|
27
|
-
condition: undefined,
|
|
28
|
-
remove: undefined,
|
|
29
|
-
add: undefined,
|
|
30
|
-
subtract: undefined,
|
|
31
|
-
append: undefined,
|
|
32
|
-
deleteFromSet: undefined,
|
|
33
|
-
returnValues: undefined,
|
|
34
|
-
cascade: undefined,
|
|
35
|
-
};
|
|
36
|
-
export class EntityGetImpl extends Effect.YieldableClass {
|
|
37
|
-
_builder;
|
|
38
|
-
[EntityOpTypeId] = EntityOpTypeId;
|
|
39
|
-
_opType = "get";
|
|
40
|
-
_entity;
|
|
41
|
-
_key;
|
|
42
|
-
_consistentRead;
|
|
43
|
-
_projection;
|
|
44
|
-
constructor(_builder, entity, key, consistentRead, projection) {
|
|
45
|
-
super();
|
|
46
|
-
this._builder = _builder;
|
|
47
|
-
this._entity = entity;
|
|
48
|
-
this._key = key;
|
|
49
|
-
this._consistentRead = consistentRead ?? false;
|
|
50
|
-
this._projection = projection;
|
|
51
|
-
}
|
|
52
|
-
get _run() {
|
|
53
|
-
return (mode) => this._builder(this._projection ? "raw" : mode, {
|
|
54
|
-
consistentRead: this._consistentRead,
|
|
55
|
-
projection: this._projection,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
asEffect() {
|
|
59
|
-
return this._run("model");
|
|
60
|
-
}
|
|
61
|
-
pipe() {
|
|
62
|
-
return Pipeable.pipeArguments(this, arguments);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
export class EntityPutImpl extends Effect.YieldableClass {
|
|
66
|
-
_builder;
|
|
67
|
-
[EntityOpTypeId] = EntityOpTypeId;
|
|
68
|
-
_opType = "put";
|
|
69
|
-
_entity;
|
|
70
|
-
_input;
|
|
71
|
-
_condition;
|
|
72
|
-
constructor(_builder, entity, input, condition) {
|
|
73
|
-
super();
|
|
74
|
-
this._builder = _builder;
|
|
75
|
-
this._entity = entity;
|
|
76
|
-
this._input = input;
|
|
77
|
-
this._condition = condition;
|
|
78
|
-
}
|
|
79
|
-
get _run() {
|
|
80
|
-
return (mode) => this._builder(mode, { condition: this._condition });
|
|
81
|
-
}
|
|
82
|
-
asEffect() {
|
|
83
|
-
return this._run("model");
|
|
84
|
-
}
|
|
85
|
-
pipe() {
|
|
86
|
-
return Pipeable.pipeArguments(this, arguments);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
export class EntityUpdateImpl extends Effect.YieldableClass {
|
|
90
|
-
_builder;
|
|
91
|
-
_updateState;
|
|
92
|
-
[EntityOpTypeId] = EntityOpTypeId;
|
|
93
|
-
[EntityUpdateTypeId] = EntityUpdateTypeId;
|
|
94
|
-
_opType = "update";
|
|
95
|
-
_entity;
|
|
96
|
-
_key;
|
|
97
|
-
constructor(_builder, _updateState, entity, key) {
|
|
98
|
-
super();
|
|
99
|
-
this._builder = _builder;
|
|
100
|
-
this._updateState = _updateState;
|
|
101
|
-
this._entity = entity;
|
|
102
|
-
this._key = key;
|
|
103
|
-
}
|
|
104
|
-
get _run() {
|
|
105
|
-
return (mode) => this._builder(mode, this._updateState);
|
|
106
|
-
}
|
|
107
|
-
asEffect() {
|
|
108
|
-
return this._run("model");
|
|
109
|
-
}
|
|
110
|
-
pipe() {
|
|
111
|
-
return Pipeable.pipeArguments(this, arguments);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
export class EntityDeleteImpl extends Effect.YieldableClass {
|
|
115
|
-
_builder;
|
|
116
|
-
[EntityDeleteTypeId] = EntityDeleteTypeId;
|
|
117
|
-
_opType = "delete";
|
|
118
|
-
_entity;
|
|
119
|
-
_key;
|
|
120
|
-
_condition;
|
|
121
|
-
_returnValues;
|
|
122
|
-
constructor(_builder, entity, key, condition, returnValues) {
|
|
123
|
-
super();
|
|
124
|
-
this._builder = _builder;
|
|
125
|
-
this._entity = entity;
|
|
126
|
-
this._key = key;
|
|
127
|
-
this._condition = condition;
|
|
128
|
-
this._returnValues = returnValues;
|
|
129
|
-
}
|
|
130
|
-
asEffect() {
|
|
131
|
-
return this._builder({ condition: this._condition, returnValues: this._returnValues });
|
|
132
|
-
}
|
|
133
|
-
pipe() {
|
|
134
|
-
return Pipeable.pipeArguments(this, arguments);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
//# sourceMappingURL=_EntityOps.js.map
|
package/dist/_EntityOps.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_EntityOps.js","sourceRoot":"","sources":["../src/_EntityOps.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAKzC,8EAA8E;AAC9E,iBAAiB;AACjB,8EAA8E;AAE9E,gBAAgB;AAChB,MAAM,CAAC,MAAM,cAAc,GAAkB,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;AAGnF,gBAAgB;AAChB,MAAM,CAAC,MAAM,kBAAkB,GAAkB,MAAM,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAA;AAG3F,gBAAgB;AAChB,MAAM,CAAC,MAAM,kBAAkB,GAAkB,MAAM,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAA;AAY3F,yEAAyE;AACzE,MAAM,CAAC,MAAM,eAAe,GAAqD;IAC/E,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,SAAS;IACjB,UAAU,EAAE,aAAa;IACzB,UAAU,EAAE,aAAa;CAC1B,CAAA;AAoCD,MAAM,CAAC,MAAM,gBAAgB,GAAgB;IAC3C,OAAO,EAAE,SAAS;IAClB,eAAe,EAAE,SAAS;IAC1B,SAAS,EAAE,SAAS;IACpB,MAAM,EAAE,SAAS;IACjB,GAAG,EAAE,SAAS;IACd,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,SAA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