@effect-dynamodb/schema 1.9.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/LICENSE +21 -0
- package/README.md +53 -0
- package/dist/Aggregate.d.ts +128 -0
- package/dist/Aggregate.d.ts.map +1 -0
- package/dist/Aggregate.js +69 -0
- package/dist/Aggregate.js.map +1 -0
- package/dist/DynamoModel.d.ts +370 -0
- package/dist/DynamoModel.d.ts.map +1 -0
- package/dist/DynamoModel.js +541 -0
- package/dist/DynamoModel.js.map +1 -0
- package/dist/DynamoSchema.d.ts +137 -0
- package/dist/DynamoSchema.d.ts.map +1 -0
- package/dist/DynamoSchema.js +188 -0
- package/dist/DynamoSchema.js.map +1 -0
- package/dist/Entity.d.ts +239 -0
- package/dist/Entity.d.ts.map +1 -0
- package/dist/Entity.js +558 -0
- package/dist/Entity.js.map +1 -0
- package/dist/Errors.d.ts +387 -0
- package/dist/Errors.d.ts.map +1 -0
- package/dist/Errors.js +218 -0
- package/dist/Errors.js.map +1 -0
- package/dist/KeyComposer.d.ts +264 -0
- package/dist/KeyComposer.d.ts.map +1 -0
- package/dist/KeyComposer.js +516 -0
- package/dist/KeyComposer.js.map +1 -0
- package/dist/Projection.d.ts +28 -0
- package/dist/Projection.d.ts.map +1 -0
- package/dist/Projection.js +39 -0
- package/dist/Projection.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/AggregateCursor.d.ts +44 -0
- package/dist/internal/AggregateCursor.d.ts.map +1 -0
- package/dist/internal/AggregateCursor.js +18 -0
- package/dist/internal/AggregateCursor.js.map +1 -0
- package/dist/internal/AggregateEdges.d.ts +117 -0
- package/dist/internal/AggregateEdges.d.ts.map +1 -0
- package/dist/internal/AggregateEdges.js +51 -0
- package/dist/internal/AggregateEdges.js.map +1 -0
- package/dist/internal/AggregateSchemas.d.ts +76 -0
- package/dist/internal/AggregateSchemas.d.ts.map +1 -0
- package/dist/internal/AggregateSchemas.js +164 -0
- package/dist/internal/AggregateSchemas.js.map +1 -0
- package/dist/internal/AggregateTypes.d.ts +132 -0
- package/dist/internal/AggregateTypes.d.ts.map +1 -0
- package/dist/internal/AggregateTypes.js +7 -0
- package/dist/internal/AggregateTypes.js.map +1 -0
- package/dist/internal/DefaultCrypto.d.ts +26 -0
- package/dist/internal/DefaultCrypto.d.ts.map +1 -0
- package/dist/internal/DefaultCrypto.js +40 -0
- package/dist/internal/DefaultCrypto.js.map +1 -0
- package/dist/internal/EntityConfig.d.ts +152 -0
- package/dist/internal/EntityConfig.d.ts.map +1 -0
- package/dist/internal/EntityConfig.js +7 -0
- package/dist/internal/EntityConfig.js.map +1 -0
- package/dist/internal/EntitySchemas.d.ts +198 -0
- package/dist/internal/EntitySchemas.d.ts.map +1 -0
- package/dist/internal/EntitySchemas.js +798 -0
- package/dist/internal/EntitySchemas.js.map +1 -0
- package/dist/internal/EntityTypes.d.ts +233 -0
- package/dist/internal/EntityTypes.d.ts.map +1 -0
- package/dist/internal/EntityTypes.js +7 -0
- package/dist/internal/EntityTypes.js.map +1 -0
- package/dist/internal/SchemaAccessors.d.ts +90 -0
- package/dist/internal/SchemaAccessors.d.ts.map +1 -0
- package/dist/internal/SchemaAccessors.js +171 -0
- package/dist/internal/SchemaAccessors.js.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DynamoSchema — Application namespace for key prefixing.
|
|
3
|
+
*
|
|
4
|
+
* Every generated DynamoDB key starts with `$<schema>#v<version>#` followed by
|
|
5
|
+
* entity-specific parts. The `$` sentinel identifies ORM-managed keys.
|
|
6
|
+
*/
|
|
7
|
+
export type Casing = "lowercase" | "uppercase" | "preserve";
|
|
8
|
+
export interface DynamoSchema {
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly version: number;
|
|
11
|
+
readonly casing: Casing;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Create a DynamoSchema instance.
|
|
15
|
+
*/
|
|
16
|
+
export declare const make: (config: {
|
|
17
|
+
readonly name: string;
|
|
18
|
+
readonly version: number;
|
|
19
|
+
readonly casing?: Casing | undefined;
|
|
20
|
+
}) => DynamoSchema;
|
|
21
|
+
/**
|
|
22
|
+
* Apply casing to a key part (structural or composite value).
|
|
23
|
+
*
|
|
24
|
+
* Matches ElectroDB behavior: casing is applied to the entire composed key,
|
|
25
|
+
* including composite attribute values. With the default `"lowercase"` casing,
|
|
26
|
+
* `"Male"` becomes `"male"` in the key, ensuring case-insensitive key matching.
|
|
27
|
+
*/
|
|
28
|
+
export declare const applyCasing: (value: string, casing: Casing) => string;
|
|
29
|
+
/**
|
|
30
|
+
* Build the schema prefix: `$<schema>#v<version>`
|
|
31
|
+
* This is prepended to every generated key.
|
|
32
|
+
*/
|
|
33
|
+
export declare const prefix: (schema: DynamoSchema) => string;
|
|
34
|
+
/**
|
|
35
|
+
* Compose a full key from schema, entity type, and composite attribute values.
|
|
36
|
+
*
|
|
37
|
+
* Format: `$<schema>#v<version>#<entityType>#<attr1>#<attr2>`
|
|
38
|
+
*
|
|
39
|
+
* Both the entityType and composite values are cased according to the schema's casing setting.
|
|
40
|
+
* This matches ElectroDB behavior where the entire key is uniformly cased.
|
|
41
|
+
*/
|
|
42
|
+
export declare const composeKey: (schema: DynamoSchema, entityType: string, composites: ReadonlyArray<string>, options?: {
|
|
43
|
+
readonly casing?: Casing | undefined;
|
|
44
|
+
readonly names?: ReadonlyArray<string> | undefined;
|
|
45
|
+
} | undefined) => string;
|
|
46
|
+
/**
|
|
47
|
+
* Compose a collection key prefix (for clustered collections).
|
|
48
|
+
*
|
|
49
|
+
* Format: `$<schema>#v<version>#<collectionName>#<attr1>#<attr2>`
|
|
50
|
+
*/
|
|
51
|
+
export declare const composeCollectionKey: (schema: DynamoSchema, collectionName: string, composites: ReadonlyArray<string>, options?: {
|
|
52
|
+
readonly casing?: Casing | undefined;
|
|
53
|
+
readonly names?: ReadonlyArray<string> | undefined;
|
|
54
|
+
} | undefined) => string;
|
|
55
|
+
/**
|
|
56
|
+
* Compose a sort key for clustered collection indexes.
|
|
57
|
+
*
|
|
58
|
+
* Format (single collection):
|
|
59
|
+
* `$<schema>#v<version>#<collectionName>#<entityType>_<entityVersion>#<attr1>#<attr2>`
|
|
60
|
+
*
|
|
61
|
+
* Format (sub-collection — when `collectionName` is an array):
|
|
62
|
+
* `$<schema>#v<version>#<parent>#<child>#<entityType>_<entityVersion>#<attr1>#<attr2>`
|
|
63
|
+
*
|
|
64
|
+
* The hierarchy elements are joined with `#` so a `begins_with` query at any level
|
|
65
|
+
* matches every entity in that subtree.
|
|
66
|
+
*
|
|
67
|
+
* The entityVersion is the schema version for the entity type within the collection.
|
|
68
|
+
* This allows different entity types in a collection to have their own sort key namespace.
|
|
69
|
+
*/
|
|
70
|
+
export declare const composeClusteredSortKey: (schema: DynamoSchema, collectionName: string | ReadonlyArray<string>, entityType: string, entityVersion: number, composites: ReadonlyArray<string>, options?: {
|
|
71
|
+
readonly casing?: Casing | undefined;
|
|
72
|
+
readonly names?: ReadonlyArray<string> | undefined;
|
|
73
|
+
} | undefined) => string;
|
|
74
|
+
/**
|
|
75
|
+
* Compose a sort key for isolated indexes.
|
|
76
|
+
*
|
|
77
|
+
* Format: `$<schema>#v<version>#<entityType>_<entityVersion>#<attr1>#<attr2>`
|
|
78
|
+
*/
|
|
79
|
+
export declare const composeIsolatedSortKey: (schema: DynamoSchema, entityType: string, entityVersion: number, composites: ReadonlyArray<string>, options?: {
|
|
80
|
+
readonly casing?: Casing | undefined;
|
|
81
|
+
readonly names?: ReadonlyArray<string> | undefined;
|
|
82
|
+
} | undefined) => string;
|
|
83
|
+
/**
|
|
84
|
+
* Compose a unique constraint sentinel key.
|
|
85
|
+
*
|
|
86
|
+
* PK format: `$<schema>#v<version>#<entityType>.<constraintName>#<fieldValues>`
|
|
87
|
+
* SK format: `$<schema>#v<version>#<entityType>.<constraintName>`
|
|
88
|
+
*/
|
|
89
|
+
export declare const composeUniqueKey: (schema: DynamoSchema, entityType: string, constraintName: string, fieldValues: ReadonlyArray<string>, options?: {
|
|
90
|
+
readonly casing?: Casing | undefined;
|
|
91
|
+
} | undefined) => {
|
|
92
|
+
readonly pk: string;
|
|
93
|
+
readonly sk: string;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Compose a version snapshot sort key.
|
|
97
|
+
*
|
|
98
|
+
* Format: `$<schema>#v<version>#<entityType>#v#<zeroPaddedVersion>`
|
|
99
|
+
*/
|
|
100
|
+
export declare const composeVersionKey: (schema: DynamoSchema, entityType: string, version: number, options?: {
|
|
101
|
+
readonly casing?: Casing | undefined;
|
|
102
|
+
} | undefined) => string;
|
|
103
|
+
/**
|
|
104
|
+
* Compose a soft-deleted item sort key.
|
|
105
|
+
*
|
|
106
|
+
* Format: `$<schema>#v<version>#<entityType>#deleted#<isoTimestamp>`
|
|
107
|
+
*/
|
|
108
|
+
export declare const composeDeletedKey: (schema: DynamoSchema, entityType: string, timestamp: string, options?: {
|
|
109
|
+
readonly casing?: Casing | undefined;
|
|
110
|
+
} | undefined) => string;
|
|
111
|
+
/**
|
|
112
|
+
* Compose the version key prefix for `begins_with` queries.
|
|
113
|
+
*
|
|
114
|
+
* Format: `$<schema>#v<version>#<entityType>#v#`
|
|
115
|
+
*/
|
|
116
|
+
export declare const composeVersionKeyPrefix: (schema: DynamoSchema, entityType: string, options?: {
|
|
117
|
+
readonly casing?: Casing | undefined;
|
|
118
|
+
} | undefined) => string;
|
|
119
|
+
/**
|
|
120
|
+
* Compose the deleted key prefix for `begins_with` queries.
|
|
121
|
+
*
|
|
122
|
+
* Format: `$<schema>#v<version>#<entityType>#deleted#`
|
|
123
|
+
*/
|
|
124
|
+
export declare const composeDeletedKeyPrefix: (schema: DynamoSchema, entityType: string, options?: {
|
|
125
|
+
readonly casing?: Casing | undefined;
|
|
126
|
+
} | undefined) => string;
|
|
127
|
+
/**
|
|
128
|
+
* Compose an event version sort key (10-digit zero-padded).
|
|
129
|
+
*
|
|
130
|
+
* Format: `$<schema>#v<version>#<entityType>_1#<zeroPaddedVersion>`
|
|
131
|
+
*
|
|
132
|
+
* Uses isolated sort key format with 10-digit padding (supports ~10B events per stream).
|
|
133
|
+
*/
|
|
134
|
+
export declare const composeEventVersionKey: (schema: DynamoSchema, entityType: string, version: number, options?: {
|
|
135
|
+
readonly casing?: Casing | undefined;
|
|
136
|
+
} | undefined) => string;
|
|
137
|
+
//# sourceMappingURL=DynamoSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamoSchema.d.ts","sourceRoot":"","sources":["../src/DynamoSchema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,MAAM,GAAG,WAAW,GAAG,WAAW,GAAG,UAAU,CAAA;AAE3D,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,QAAQ;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACrC,KAAG,YAIF,CAAA;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAG,MAS3D,CAAA;AAyBD;;;GAGG;AACH,eAAO,MAAM,MAAM,GAAI,QAAQ,YAAY,KAAG,MAG7C,CAAA;AAcD;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GACrB,QAAQ,YAAY,EACpB,YAAY,MAAM,EAClB,YAAY,aAAa,CAAC,MAAM,CAAC,EACjC,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M,GAAG,SAAS,CAAA;CAAE,GAAG,SAAS,KAC7D,MAGF,CAAA"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DynamoSchema — Application namespace for key prefixing.
|
|
3
|
+
*
|
|
4
|
+
* Every generated DynamoDB key starts with `$<schema>#v<version>#` followed by
|
|
5
|
+
* entity-specific parts. The `$` sentinel identifies ORM-managed keys.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Create a DynamoSchema instance.
|
|
9
|
+
*/
|
|
10
|
+
export const make = (config) => ({
|
|
11
|
+
name: config.name,
|
|
12
|
+
version: config.version,
|
|
13
|
+
casing: config.casing ?? "lowercase",
|
|
14
|
+
});
|
|
15
|
+
/**
|
|
16
|
+
* Apply casing to a key part (structural or composite value).
|
|
17
|
+
*
|
|
18
|
+
* Matches ElectroDB behavior: casing is applied to the entire composed key,
|
|
19
|
+
* including composite attribute values. With the default `"lowercase"` casing,
|
|
20
|
+
* `"Male"` becomes `"male"` in the key, ensuring case-insensitive key matching.
|
|
21
|
+
*/
|
|
22
|
+
export const applyCasing = (value, casing) => {
|
|
23
|
+
switch (casing) {
|
|
24
|
+
case "lowercase":
|
|
25
|
+
return value.toLowerCase();
|
|
26
|
+
case "uppercase":
|
|
27
|
+
return value.toUpperCase();
|
|
28
|
+
case "preserve":
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Format composite values with optional field name prefixes.
|
|
34
|
+
* With names: `fieldname_value1#fieldname_value2`
|
|
35
|
+
* Without names: `value1#value2`
|
|
36
|
+
*/
|
|
37
|
+
const formatComposites = (composites, casing, names) => formatCompositeParts(composites, casing, names).join("#");
|
|
38
|
+
/** Format composite values as individual parts (for use in array spreading). */
|
|
39
|
+
const formatCompositeParts = (composites, casing, names) => composites.map((v, i) => {
|
|
40
|
+
const casedValue = applyCasing(v, casing);
|
|
41
|
+
const name = names?.[i];
|
|
42
|
+
return name ? `${applyCasing(name, casing)}_${casedValue}` : casedValue;
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* Build the schema prefix: `$<schema>#v<version>`
|
|
46
|
+
* This is prepended to every generated key.
|
|
47
|
+
*/
|
|
48
|
+
export const prefix = (schema) => {
|
|
49
|
+
const name = applyCasing(schema.name, schema.casing);
|
|
50
|
+
return `$${name}#v${schema.version}`;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* @internal Resolve casing and build the common key prefix parts.
|
|
54
|
+
*/
|
|
55
|
+
const resolveKeyPrefix = (schema, label, options) => {
|
|
56
|
+
const casing = options?.casing ?? schema.casing;
|
|
57
|
+
return { casing, pre: prefix(schema), label: applyCasing(label, casing) };
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Compose a full key from schema, entity type, and composite attribute values.
|
|
61
|
+
*
|
|
62
|
+
* Format: `$<schema>#v<version>#<entityType>#<attr1>#<attr2>`
|
|
63
|
+
*
|
|
64
|
+
* Both the entityType and composite values are cased according to the schema's casing setting.
|
|
65
|
+
* This matches ElectroDB behavior where the entire key is uniformly cased.
|
|
66
|
+
*/
|
|
67
|
+
export const composeKey = (schema, entityType, composites, options) => {
|
|
68
|
+
const { casing: effectiveCasing, pre, label: type, } = resolveKeyPrefix(schema, entityType, options);
|
|
69
|
+
if (composites.length === 0) {
|
|
70
|
+
return `${pre}#${type}`;
|
|
71
|
+
}
|
|
72
|
+
const formatted = formatComposites(composites, effectiveCasing, options?.names);
|
|
73
|
+
return `${pre}#${type}#${formatted}`;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Compose a collection key prefix (for clustered collections).
|
|
77
|
+
*
|
|
78
|
+
* Format: `$<schema>#v<version>#<collectionName>#<attr1>#<attr2>`
|
|
79
|
+
*/
|
|
80
|
+
export const composeCollectionKey = (schema, collectionName, composites, options) => {
|
|
81
|
+
const { casing: effectiveCasing, pre, label: collection, } = resolveKeyPrefix(schema, collectionName, options);
|
|
82
|
+
if (composites.length === 0) {
|
|
83
|
+
return `${pre}#${collection}`;
|
|
84
|
+
}
|
|
85
|
+
const formatted = formatComposites(composites, effectiveCasing, options?.names);
|
|
86
|
+
return `${pre}#${collection}#${formatted}`;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Compose a sort key for clustered collection indexes.
|
|
90
|
+
*
|
|
91
|
+
* Format (single collection):
|
|
92
|
+
* `$<schema>#v<version>#<collectionName>#<entityType>_<entityVersion>#<attr1>#<attr2>`
|
|
93
|
+
*
|
|
94
|
+
* Format (sub-collection — when `collectionName` is an array):
|
|
95
|
+
* `$<schema>#v<version>#<parent>#<child>#<entityType>_<entityVersion>#<attr1>#<attr2>`
|
|
96
|
+
*
|
|
97
|
+
* The hierarchy elements are joined with `#` so a `begins_with` query at any level
|
|
98
|
+
* matches every entity in that subtree.
|
|
99
|
+
*
|
|
100
|
+
* The entityVersion is the schema version for the entity type within the collection.
|
|
101
|
+
* This allows different entity types in a collection to have their own sort key namespace.
|
|
102
|
+
*/
|
|
103
|
+
export const composeClusteredSortKey = (schema, collectionName, entityType, entityVersion, composites, options) => {
|
|
104
|
+
const effectiveCasing = options?.casing ?? schema.casing;
|
|
105
|
+
const pre = prefix(schema);
|
|
106
|
+
const namesArray = Array.isArray(collectionName) ? collectionName : [collectionName];
|
|
107
|
+
const collectionParts = namesArray.map((n) => applyCasing(n, effectiveCasing));
|
|
108
|
+
const type = applyCasing(entityType, effectiveCasing);
|
|
109
|
+
const entityPrefix = `${type}_${entityVersion}`;
|
|
110
|
+
const formattedComposites = formatCompositeParts(composites, effectiveCasing, options?.names);
|
|
111
|
+
const parts = [pre, ...collectionParts, entityPrefix, ...formattedComposites].filter((p) => p.length > 0);
|
|
112
|
+
return parts.join("#");
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Compose a sort key for isolated indexes.
|
|
116
|
+
*
|
|
117
|
+
* Format: `$<schema>#v<version>#<entityType>_<entityVersion>#<attr1>#<attr2>`
|
|
118
|
+
*/
|
|
119
|
+
export const composeIsolatedSortKey = (schema, entityType, entityVersion, composites, options) => {
|
|
120
|
+
const { casing: effectiveCasing, pre, label: type, } = resolveKeyPrefix(schema, entityType, options);
|
|
121
|
+
const entityPrefix = `${type}_${entityVersion}`;
|
|
122
|
+
const formattedComposites = formatCompositeParts(composites, effectiveCasing, options?.names);
|
|
123
|
+
const parts = [pre, entityPrefix, ...formattedComposites].filter((p) => p.length > 0);
|
|
124
|
+
return parts.join("#");
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Compose a unique constraint sentinel key.
|
|
128
|
+
*
|
|
129
|
+
* PK format: `$<schema>#v<version>#<entityType>.<constraintName>#<fieldValues>`
|
|
130
|
+
* SK format: `$<schema>#v<version>#<entityType>.<constraintName>`
|
|
131
|
+
*/
|
|
132
|
+
export const composeUniqueKey = (schema, entityType, constraintName, fieldValues, options) => {
|
|
133
|
+
const { casing: effectiveCasing, pre, label: type, } = resolveKeyPrefix(schema, entityType, options);
|
|
134
|
+
const casedConstraintName = applyCasing(constraintName, effectiveCasing);
|
|
135
|
+
const constraint = `${type}.${casedConstraintName}`;
|
|
136
|
+
return {
|
|
137
|
+
pk: `${pre}#${constraint}#${fieldValues.map((v) => applyCasing(v, effectiveCasing)).join("#")}`,
|
|
138
|
+
sk: `${pre}#${constraint}`,
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Compose a version snapshot sort key.
|
|
143
|
+
*
|
|
144
|
+
* Format: `$<schema>#v<version>#<entityType>#v#<zeroPaddedVersion>`
|
|
145
|
+
*/
|
|
146
|
+
export const composeVersionKey = (schema, entityType, version, options) => {
|
|
147
|
+
const { pre, label: type } = resolveKeyPrefix(schema, entityType, options);
|
|
148
|
+
return `${pre}#${type}#v#${String(version).padStart(7, "0")}`;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Compose a soft-deleted item sort key.
|
|
152
|
+
*
|
|
153
|
+
* Format: `$<schema>#v<version>#<entityType>#deleted#<isoTimestamp>`
|
|
154
|
+
*/
|
|
155
|
+
export const composeDeletedKey = (schema, entityType, timestamp, options) => {
|
|
156
|
+
const { pre, label: type } = resolveKeyPrefix(schema, entityType, options);
|
|
157
|
+
return `${pre}#${type}#deleted#${timestamp}`;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Compose the version key prefix for `begins_with` queries.
|
|
161
|
+
*
|
|
162
|
+
* Format: `$<schema>#v<version>#<entityType>#v#`
|
|
163
|
+
*/
|
|
164
|
+
export const composeVersionKeyPrefix = (schema, entityType, options) => {
|
|
165
|
+
const { pre, label: type } = resolveKeyPrefix(schema, entityType, options);
|
|
166
|
+
return `${pre}#${type}#v#`;
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Compose the deleted key prefix for `begins_with` queries.
|
|
170
|
+
*
|
|
171
|
+
* Format: `$<schema>#v<version>#<entityType>#deleted#`
|
|
172
|
+
*/
|
|
173
|
+
export const composeDeletedKeyPrefix = (schema, entityType, options) => {
|
|
174
|
+
const { pre, label: type } = resolveKeyPrefix(schema, entityType, options);
|
|
175
|
+
return `${pre}#${type}#deleted#`;
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* Compose an event version sort key (10-digit zero-padded).
|
|
179
|
+
*
|
|
180
|
+
* Format: `$<schema>#v<version>#<entityType>_1#<zeroPaddedVersion>`
|
|
181
|
+
*
|
|
182
|
+
* Uses isolated sort key format with 10-digit padding (supports ~10B events per stream).
|
|
183
|
+
*/
|
|
184
|
+
export const composeEventVersionKey = (schema, entityType, version, options) => {
|
|
185
|
+
const { pre, label: type } = resolveKeyPrefix(schema, entityType, options);
|
|
186
|
+
return `${pre}#${type}_1#${String(version).padStart(10, "0")}`;
|
|
187
|
+
};
|
|
188
|
+
//# sourceMappingURL=DynamoSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamoSchema.js","sourceRoot":"","sources":["../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AED;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,MAAoB,EACpB,UAAkB,EAClB,OAA8D,EACtD,EAAE;IACV,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IAC1E,OAAO,GAAG,GAAG,IAAI,IAAI,WAAW,CAAA;AAClC,CAAC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,MAAoB,EACpB,UAAkB,EAClB,OAAe,EACf,OAA8D,EACtD,EAAE;IACV,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IAC1E,OAAO,GAAG,GAAG,IAAI,IAAI,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,CAAA;AAChE,CAAC,CAAA"}
|
package/dist/Entity.d.ts
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entity (pure definition layer) — builds the AWS-free half of an Entity:
|
|
3
|
+
* the domain model binding, primary key + index definitions, system-field
|
|
4
|
+
* configuration, unique constraints, and the derived schemas (`inputSchema`,
|
|
5
|
+
* `updateSchema`, `createSchema`).
|
|
6
|
+
*
|
|
7
|
+
* This module is AWS-SDK-free in BOTH its runtime import graph and its
|
|
8
|
+
* emitted `.d.ts` surface. The full `effect-dynamodb` package extends the
|
|
9
|
+
* {@link EntityDefinition} produced here with the AWS-coupled CRUD/query
|
|
10
|
+
* operations (DynamoClient, Marshaller, expression compilation), reusing
|
|
11
|
+
* {@link buildEntityDefinition} so the derivation has a single source of truth.
|
|
12
|
+
*
|
|
13
|
+
* `Entity.make()` here returns a pure {@link EntityDefinition}. Consumers who
|
|
14
|
+
* only need the derived schemas (e.g. HttpApi payloads, validation) can import
|
|
15
|
+
* it from `@effect-dynamodb/schema` without pulling the AWS SDK into their
|
|
16
|
+
* dependency graph or type surface.
|
|
17
|
+
*/
|
|
18
|
+
import { Duration, type Schema } from "effect";
|
|
19
|
+
import { type ConfiguredModel, type DynamoEncoding, type ExtractIdentifier, type SparseConfig } from "./DynamoModel.js";
|
|
20
|
+
import type * as DynamoSchema from "./DynamoSchema.js";
|
|
21
|
+
import type { CascadeIndexConfig, GeneratedIdConfig, SoftDeleteConfig, TimeSeriesConfig, TimestampsConfig, UniqueConfig, UniqueConstraintDef, VersionedConfig } from "./internal/EntityConfig.js";
|
|
22
|
+
import { type DerivedSchemas, type ResolvedSystemFields } from "./internal/EntitySchemas.js";
|
|
23
|
+
import type { EntityRefCreateType, EntityRefInputType, EntityRefUpdateType } from "./internal/EntityTypes.js";
|
|
24
|
+
import type { GsiConfig, IndexDefinition, KeyPart } from "./KeyComposer.js";
|
|
25
|
+
export type { IndexDefinition, KeyPart };
|
|
26
|
+
/** A ref config object: the entity and optional cascade index config. */
|
|
27
|
+
export interface AnyRefValue {
|
|
28
|
+
readonly entity: EntityDefinition<any, any, any, any, any, any, any, any, any, any>;
|
|
29
|
+
readonly cascade?: CascadeIndexConfig;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Normalize a TTL config value to whole seconds.
|
|
33
|
+
*
|
|
34
|
+
* Accepts a `Duration.Duration` or a humanized string (e.g. `"7 days"`,
|
|
35
|
+
* `"24 hours"`), parsed via Effect's `Duration` input grammar. A bare `number`
|
|
36
|
+
* is intentionally NOT accepted at the type level — `Duration.fromInput` treats
|
|
37
|
+
* a number as **milliseconds**, so `3600` would silently mean 3.6 s (a 1000×
|
|
38
|
+
* footgun); callers must pass `Duration.seconds(3600)` or `"3600 seconds"`.
|
|
39
|
+
*
|
|
40
|
+
* Throws `[EDD-9005]` for a non-finite (infinite) duration — an infinite TTL
|
|
41
|
+
* epoch is nonsensical. {@link make} validates every configured TTL eagerly via
|
|
42
|
+
* this helper, so the write path never observes an invalid value.
|
|
43
|
+
*/
|
|
44
|
+
export declare const normalizeTtlSeconds: (input: Duration.Duration | string) => number;
|
|
45
|
+
/**
|
|
46
|
+
* Extract the optional TTL from a unique-constraint definition. Only the object
|
|
47
|
+
* form (`{ fields, ttl }`) carries a TTL; the bare-array form never does.
|
|
48
|
+
*
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
export declare const resolveUniqueTtl: (def: UniqueConstraintDef) => Duration.Duration | string | undefined;
|
|
52
|
+
type NormalizedIndexes<TPrimaryKey extends PrimaryKeyDef, TGsiIndexes extends globalThis.Record<string, GsiConfig>> = keyof TGsiIndexes extends never ? {
|
|
53
|
+
readonly primary: TPrimaryKey;
|
|
54
|
+
} : {
|
|
55
|
+
readonly primary: TPrimaryKey;
|
|
56
|
+
} & {
|
|
57
|
+
readonly [K in keyof TGsiIndexes & string]: IndexDefinition & {
|
|
58
|
+
readonly collection: TGsiIndexes[K]["collection"];
|
|
59
|
+
readonly pk: {
|
|
60
|
+
readonly composite: TGsiIndexes[K]["pk"]["composite"];
|
|
61
|
+
};
|
|
62
|
+
readonly sk: {
|
|
63
|
+
readonly composite: TGsiIndexes[K]["sk"]["composite"];
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
/** Primary key definition — used in the `primaryKey` config form. */
|
|
68
|
+
type PrimaryKeyDef = IndexDefinition & ({
|
|
69
|
+
readonly pk: {
|
|
70
|
+
readonly composite: readonly [string, ...string[]];
|
|
71
|
+
};
|
|
72
|
+
} | {
|
|
73
|
+
readonly sk: {
|
|
74
|
+
readonly composite: readonly [string, ...string[]];
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
interface ResolvedRef {
|
|
78
|
+
readonly fieldName: string;
|
|
79
|
+
readonly idFieldName: string;
|
|
80
|
+
readonly identifierField: string;
|
|
81
|
+
readonly identifierSchema: Schema.Top;
|
|
82
|
+
readonly refEntity: EntityDefinition;
|
|
83
|
+
readonly refEntityType: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* @internal The full bundle of pure locals produced by
|
|
87
|
+
* {@link buildEntityDefinition}. The runtime `effect-dynamodb` package consumes
|
|
88
|
+
* this bundle to attach CRUD/query operations without re-running derivation.
|
|
89
|
+
*/
|
|
90
|
+
export interface EntityDefinitionData {
|
|
91
|
+
readonly configuredAttributes: globalThis.Record<string, {
|
|
92
|
+
readonly immutable?: boolean;
|
|
93
|
+
readonly field?: string;
|
|
94
|
+
}>;
|
|
95
|
+
readonly rawModel: Schema.Top;
|
|
96
|
+
readonly isSchemaClass: boolean;
|
|
97
|
+
readonly modelFields: globalThis.Record<string, Schema.Top>;
|
|
98
|
+
readonly hasHiddenFields: boolean;
|
|
99
|
+
readonly systemFields: ResolvedSystemFields;
|
|
100
|
+
readonly validCompositeFields: ReadonlySet<string>;
|
|
101
|
+
readonly resolvedRefs: ReadonlyArray<ResolvedRef>;
|
|
102
|
+
readonly hasRefs: boolean;
|
|
103
|
+
readonly cascadeIndexes: globalThis.Record<string, IndexDefinition>;
|
|
104
|
+
readonly initialIndexes: globalThis.Record<string, IndexDefinition>;
|
|
105
|
+
readonly immutableFields: ReadonlySet<string>;
|
|
106
|
+
readonly resolvedIdentifier: string | undefined;
|
|
107
|
+
readonly fieldEncodings: globalThis.Record<string, DynamoEncoding>;
|
|
108
|
+
readonly schemas: DerivedSchemas;
|
|
109
|
+
readonly entityType: string;
|
|
110
|
+
readonly entityVersion: number;
|
|
111
|
+
readonly sparseFields: globalThis.Record<string, SparseConfig>;
|
|
112
|
+
readonly hasSparseFields: boolean;
|
|
113
|
+
readonly fieldRenames: globalThis.Record<string, string>;
|
|
114
|
+
readonly hasRenames: boolean;
|
|
115
|
+
readonly renameToDynamo: (item: globalThis.Record<string, unknown>) => void;
|
|
116
|
+
readonly renameFromDynamo: (item: globalThis.Record<string, unknown>) => void;
|
|
117
|
+
readonly resolveDbName: (domainName: string) => string;
|
|
118
|
+
readonly generatedIdField: string | undefined;
|
|
119
|
+
readonly generatedIdVersion: string | undefined;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The pure definition produced by {@link make}. Carries the model binding,
|
|
123
|
+
* index definitions, system-field configuration, derived schemas, and the
|
|
124
|
+
* `_configure` / `_injectIndex` hooks used by the runtime binding layer. Does
|
|
125
|
+
* NOT carry AWS-coupled CRUD/query operations — those live on the runtime
|
|
126
|
+
* `effect-dynamodb` `Entity` type, which extends this.
|
|
127
|
+
*/
|
|
128
|
+
export interface EntityDefinition<TModel extends Schema.Top = Schema.Top, TEntityType extends string = string, TIndexes extends globalThis.Record<string, IndexDefinition> = globalThis.Record<string, IndexDefinition>, TTimestamps extends TimestampsConfig | undefined = TimestampsConfig | undefined, TVersioned extends VersionedConfig | undefined = VersionedConfig | undefined, TSoftDelete extends SoftDeleteConfig | undefined = SoftDeleteConfig | undefined, TUnique extends UniqueConfig | undefined = UniqueConfig | undefined, TRefs extends globalThis.Record<string, AnyRefValue> | undefined = undefined, TIdentifier extends string | undefined = undefined, TTimeSeries extends TimeSeriesConfig<any> | undefined = undefined, TGeneratedId extends GeneratedIdConfig | undefined = undefined> {
|
|
129
|
+
readonly _tag: "Entity";
|
|
130
|
+
readonly model: TModel;
|
|
131
|
+
readonly entityType: TEntityType;
|
|
132
|
+
readonly indexes: TIndexes;
|
|
133
|
+
readonly timestamps: TTimestamps;
|
|
134
|
+
readonly versioned: TVersioned;
|
|
135
|
+
readonly softDelete: TSoftDelete;
|
|
136
|
+
readonly unique: TUnique;
|
|
137
|
+
readonly identifier: TIdentifier;
|
|
138
|
+
readonly timeSeries: TTimeSeries;
|
|
139
|
+
readonly generatedId: TGeneratedId;
|
|
140
|
+
/** @internal Resolved ref metadata — used by cascade to inspect target entities */
|
|
141
|
+
readonly _resolvedRefs: ReadonlyArray<{
|
|
142
|
+
readonly fieldName: string;
|
|
143
|
+
readonly idFieldName: string;
|
|
144
|
+
readonly identifierField: string;
|
|
145
|
+
readonly refEntityType: string;
|
|
146
|
+
}>;
|
|
147
|
+
/** @internal Attach model class prototype to a decoded plain object (no-op for Schema.Struct models). */
|
|
148
|
+
readonly _attachPrototype: (decoded: any) => any;
|
|
149
|
+
/**
|
|
150
|
+
* @internal Configure the entity with table schema and tag.
|
|
151
|
+
* Called by DynamoClient.make() when binding entities to a table.
|
|
152
|
+
*/
|
|
153
|
+
readonly _configure: (schema: DynamoSchema.DynamoSchema, tableTag: unknown) => void;
|
|
154
|
+
/**
|
|
155
|
+
* @internal Inject a GSI index definition into this entity.
|
|
156
|
+
*/
|
|
157
|
+
readonly _injectIndex: (name: string, def: IndexDefinition) => void;
|
|
158
|
+
/** @internal Injected DynamoSchema — available after _configure(). */
|
|
159
|
+
readonly _schema: DynamoSchema.DynamoSchema;
|
|
160
|
+
/** @internal Injected TableConfig tag — available after _configure(). */
|
|
161
|
+
readonly _tableTag: unknown;
|
|
162
|
+
/** Resolved system field names */
|
|
163
|
+
readonly systemFields: ResolvedSystemFields;
|
|
164
|
+
/** Derived schemas for type extraction */
|
|
165
|
+
readonly schemas: DerivedSchemas;
|
|
166
|
+
/**
|
|
167
|
+
* Typed input schema. Ref-aware: ref fields are replaced with branded ID fields.
|
|
168
|
+
* Use in HttpApiEndpoint payloads or for validation.
|
|
169
|
+
*/
|
|
170
|
+
readonly inputSchema: Schema.Codec<EntityRefInputType<TModel, TRefs, TTimestamps, TVersioned, TTimeSeries>>;
|
|
171
|
+
/**
|
|
172
|
+
* Typed create schema. Input fields minus primary key composites — the common
|
|
173
|
+
* "create" payload where IDs are auto-generated.
|
|
174
|
+
*/
|
|
175
|
+
readonly createSchema: Schema.Codec<EntityRefCreateType<TModel, TIndexes, TRefs, TIdentifier, TTimestamps, TVersioned, TTimeSeries>>;
|
|
176
|
+
/**
|
|
177
|
+
* Typed update schema. Partial fields minus primary key composites and immutable fields.
|
|
178
|
+
* Ref fields are replaced with optional branded ID fields.
|
|
179
|
+
*/
|
|
180
|
+
readonly updateSchema: Schema.Codec<EntityRefUpdateType<TModel, TIndexes, TRefs, TTimestamps, TVersioned>>;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* @internal Run all `make()`-time validation and derivation for an entity and
|
|
184
|
+
* return the bundle of pure locals. Shared by the schema-package {@link make}
|
|
185
|
+
* and the runtime `effect-dynamodb` `Entity.make` so derivation has a single
|
|
186
|
+
* source of truth.
|
|
187
|
+
*
|
|
188
|
+
* @throws on invalid configuration (EDD-90xx).
|
|
189
|
+
*/
|
|
190
|
+
export declare const buildEntityDefinition: (config: {
|
|
191
|
+
readonly model: Schema.Top | ConfiguredModel<Schema.Top, any>;
|
|
192
|
+
readonly entityType: string;
|
|
193
|
+
readonly indexes: globalThis.Record<string, IndexDefinition> & {
|
|
194
|
+
readonly primary: IndexDefinition;
|
|
195
|
+
};
|
|
196
|
+
readonly timestamps?: TimestampsConfig | undefined;
|
|
197
|
+
readonly versioned?: VersionedConfig | undefined;
|
|
198
|
+
readonly softDelete?: SoftDeleteConfig | undefined;
|
|
199
|
+
readonly unique?: UniqueConfig | undefined;
|
|
200
|
+
readonly refs?: globalThis.Record<string, AnyRefValue> | undefined;
|
|
201
|
+
readonly timeSeries?: TimeSeriesConfig<any> | undefined;
|
|
202
|
+
readonly generatedId?: GeneratedIdConfig | undefined;
|
|
203
|
+
}) => EntityDefinitionData;
|
|
204
|
+
/**
|
|
205
|
+
* Create a pure Entity definition.
|
|
206
|
+
*
|
|
207
|
+
* Returns an {@link EntityDefinition} carrying the model binding, index
|
|
208
|
+
* definitions, system-field configuration, and the derived `inputSchema` /
|
|
209
|
+
* `updateSchema` / `createSchema`. This pure form is AWS-SDK-free — import it
|
|
210
|
+
* from `@effect-dynamodb/schema` when you only need the derived schemas (e.g.
|
|
211
|
+
* for HttpApi payloads or validation).
|
|
212
|
+
*
|
|
213
|
+
* The full operational `Entity.make` (with CRUD/query operations) is exported
|
|
214
|
+
* from `effect-dynamodb`; its return type extends {@link EntityDefinition}.
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* ```typescript
|
|
218
|
+
* const Tasks = Entity.make({
|
|
219
|
+
* model: Task,
|
|
220
|
+
* entityType: "Task",
|
|
221
|
+
* primaryKey: { pk: { field: "pk", composite: ["taskId"] }, sk: { field: "sk", composite: [] } },
|
|
222
|
+
* })
|
|
223
|
+
* // typeof Tasks.inputSchema.Type → the typed input payload
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
226
|
+
export declare const make: <TModel extends Schema.Top, const TEntityType extends string, const TPrimaryKey extends PrimaryKeyDef, const TGsiIndexes extends globalThis.Record<string, GsiConfig> = {}, const TTimestamps extends TimestampsConfig | undefined = undefined, const TVersioned extends VersionedConfig | undefined = undefined, const TSoftDelete extends SoftDeleteConfig | undefined = undefined, const TUnique extends UniqueConfig | undefined = undefined, const TRefs extends globalThis.Record<string, AnyRefValue> | undefined = undefined, const TTimeSeries extends TimeSeriesConfig<any> | undefined = undefined, const TGeneratedId extends GeneratedIdConfig | undefined = undefined, const TAttrs extends {} = {}>(config: {
|
|
227
|
+
readonly model: TModel | ConfiguredModel<TModel, TAttrs>;
|
|
228
|
+
readonly entityType: TEntityType;
|
|
229
|
+
readonly primaryKey: TPrimaryKey;
|
|
230
|
+
readonly indexes?: TGsiIndexes;
|
|
231
|
+
readonly timestamps?: TTimestamps;
|
|
232
|
+
readonly versioned?: TVersioned;
|
|
233
|
+
readonly softDelete?: TSoftDelete;
|
|
234
|
+
readonly unique?: TUnique;
|
|
235
|
+
readonly refs?: TRefs;
|
|
236
|
+
readonly timeSeries?: TTimeSeries;
|
|
237
|
+
readonly generatedId?: TGeneratedId;
|
|
238
|
+
}) => EntityDefinition<TModel, TEntityType, NormalizedIndexes<TPrimaryKey, TGsiIndexes>, TTimestamps, TVersioned, TSoftDelete, TUnique, TRefs, ExtractIdentifier<ConfiguredModel<TModel, TAttrs>>, TTimeSeries, TGeneratedId>;
|
|
239
|
+
//# sourceMappingURL=Entity.d.ts.map
|
|
@@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