@effect-dynamodb/schema 1.20.0 → 1.21.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/DynamoModel.js
CHANGED
|
@@ -216,7 +216,7 @@ export const DateEpoch = (options) => {
|
|
|
216
216
|
const encodeSchema = options.encode ?? DateEpochMs;
|
|
217
217
|
const encodeEncoding = getEncoding(encodeSchema);
|
|
218
218
|
return Schema.Number.pipe(Schema.decodeTo(Schema.DateTimeUtc, {
|
|
219
|
-
decode: SchemaGetter.
|
|
219
|
+
decode: SchemaGetter.transformEffect((n) => {
|
|
220
220
|
// Try milliseconds first
|
|
221
221
|
try {
|
|
222
222
|
const asMs = DateTime.makeUnsafe(n);
|
|
@@ -259,7 +259,7 @@ export const DateEpoch = (options) => {
|
|
|
259
259
|
* Cannot use epoch storage — timezone information would be lost (enforced at type level via storedAs).
|
|
260
260
|
*/
|
|
261
261
|
export const DateTimeZoned = Schema.String.pipe(Schema.decodeTo(Schema.DateTimeZoned, {
|
|
262
|
-
decode: SchemaGetter.
|
|
262
|
+
decode: SchemaGetter.transformEffect((s) => {
|
|
263
263
|
// Parse extended ISO format: "2024-01-01T15:00:00+09:00[Asia/Tokyo]"
|
|
264
264
|
const match = s.match(/^(.+)\[(.+)\]$/);
|
|
265
265
|
if (match) {
|
|
@@ -411,7 +411,7 @@ export const buildDateTransform = (encoding) => {
|
|
|
411
411
|
return value;
|
|
412
412
|
};
|
|
413
413
|
return Schema.Any.pipe(Schema.decodeTo(targetSchema, {
|
|
414
|
-
decode: SchemaGetter.
|
|
414
|
+
decode: SchemaGetter.transformEffect((value) => {
|
|
415
415
|
try {
|
|
416
416
|
return Effect.succeed(liftToDomain(value));
|
|
417
417
|
}
|
|
@@ -419,7 +419,7 @@ export const buildDateTransform = (encoding) => {
|
|
|
419
419
|
return Effect.fail(new SchemaIssue.InvalidType(Schema.Any.ast, value));
|
|
420
420
|
}
|
|
421
421
|
}),
|
|
422
|
-
encode: SchemaGetter.
|
|
422
|
+
encode: SchemaGetter.transformEffect((value) => {
|
|
423
423
|
try {
|
|
424
424
|
return Effect.succeed(toWirePrimitive(value, encoding));
|
|
425
425
|
}
|
|
@@ -511,7 +511,7 @@ const buildTolerantTransform = (schema) => {
|
|
|
511
511
|
const validateDomain = Schema.decodeUnknownOption(typeSide);
|
|
512
512
|
const encodeDomain = Schema.encodeUnknownOption(codec);
|
|
513
513
|
return Schema.Any.pipe(Schema.decodeTo(typeSide, {
|
|
514
|
-
decode: SchemaGetter.
|
|
514
|
+
decode: SchemaGetter.transformEffect((value) => {
|
|
515
515
|
const fromWire = decodeWire(value);
|
|
516
516
|
if (fromWire._tag === "Some")
|
|
517
517
|
return Effect.succeed(fromWire.value);
|
|
@@ -520,7 +520,7 @@ const buildTolerantTransform = (schema) => {
|
|
|
520
520
|
return Effect.succeed(alreadyDomain.value);
|
|
521
521
|
return Effect.fail(new SchemaIssue.InvalidType(schema.ast, value));
|
|
522
522
|
}),
|
|
523
|
-
encode: SchemaGetter.
|
|
523
|
+
encode: SchemaGetter.transformEffect((value) => {
|
|
524
524
|
const wire = encodeDomain(value);
|
|
525
525
|
if (wire._tag === "Some")
|
|
526
526
|
return Effect.succeed(wire.value);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-dynamodb/schema",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"description": "Pure Effect Schema-driven entity/aggregate modeling and relationship derivation for effect-dynamodb — importable without @aws-sdk",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
"LICENSE"
|
|
51
51
|
],
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"effect": "^4.0.0
|
|
53
|
+
"effect": "^4.0.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@effect/vitest": "4.0.0
|
|
56
|
+
"@effect/vitest": "4.0.0",
|
|
57
57
|
"@types/node": "^25.5.0",
|
|
58
|
-
"effect": "4.0.0
|
|
59
|
-
"typescript": "^
|
|
60
|
-
"vitest": "^
|
|
58
|
+
"effect": "4.0.0",
|
|
59
|
+
"typescript": "^6.0.3",
|
|
60
|
+
"vitest": "^5.0.3"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"build": "tsc",
|