dyna-record 0.6.5 → 0.6.7
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/src/decorators/attributes/BooleanAttribute.d.ts.map +1 -1
- package/dist/src/decorators/attributes/BooleanAttribute.js +1 -0
- package/dist/src/decorators/attributes/DateAttribute.d.ts.map +1 -1
- package/dist/src/decorators/attributes/DateAttribute.js +1 -0
- package/dist/src/decorators/attributes/EnumAttribute.d.ts.map +1 -1
- package/dist/src/decorators/attributes/EnumAttribute.js +2 -0
- package/dist/src/decorators/attributes/ForeignKeyAttribute.d.ts.map +1 -1
- package/dist/src/decorators/attributes/ForeignKeyAttribute.js +1 -0
- package/dist/src/decorators/attributes/NumberAttribute.d.ts.map +1 -1
- package/dist/src/decorators/attributes/NumberAttribute.js +1 -0
- package/dist/src/decorators/attributes/ObjectAttribute.d.ts.map +1 -1
- package/dist/src/decorators/attributes/ObjectAttribute.js +1 -0
- package/dist/src/decorators/attributes/PartitionKeyAttribute.d.ts.map +1 -1
- package/dist/src/decorators/attributes/PartitionKeyAttribute.js +1 -0
- package/dist/src/decorators/attributes/SortKeyAttribute.d.ts.map +1 -1
- package/dist/src/decorators/attributes/SortKeyAttribute.js +1 -0
- package/dist/src/decorators/attributes/StringAttribute.d.ts.map +1 -1
- package/dist/src/decorators/attributes/StringAttribute.js +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/metadata/AttributeMetadata.d.ts +3 -1
- package/dist/src/metadata/AttributeMetadata.d.ts.map +1 -1
- package/dist/src/metadata/AttributeMetadata.js +4 -0
- package/dist/src/metadata/TableMetadata.d.ts.map +1 -1
- package/dist/src/metadata/TableMetadata.js +5 -1
- package/dist/src/metadata/schemas.d.ts +521 -34
- package/dist/src/metadata/schemas.d.ts.map +1 -1
- package/dist/src/metadata/schemas.js +51 -21
- package/dist/src/metadata/types.d.ts +13 -0
- package/dist/src/metadata/types.d.ts.map +1 -1
- package/dist/src/operations/FindById/FindById.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BooleanAttribute.d.ts","sourceRoot":"","sources":["../../../../src/decorators/attributes/BooleanAttribute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,iBAAS,gBAAgB,CACvB,CAAC,SAAS,UAAU,EACpB,CAAC,SAAS,OAAO,EACjB,CAAC,SAAS,gBAAgB,EAC1B,KAAK,CAAC,EAAE,CAAC,YAEC,SAAS,WACR,yBAAyB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"BooleanAttribute.d.ts","sourceRoot":"","sources":["../../../../src/decorators/attributes/BooleanAttribute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,iBAAS,gBAAgB,CACvB,CAAC,SAAS,UAAU,EACpB,CAAC,SAAS,OAAO,EACjB,CAAC,SAAS,gBAAgB,EAC1B,KAAK,CAAC,EAAE,CAAC,YAEC,SAAS,WACR,yBAAyB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,UAY9C;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -33,6 +33,7 @@ function BooleanAttribute(props) {
|
|
|
33
33
|
context.addInitializer(function () {
|
|
34
34
|
metadata_1.default.addEntityAttribute(this.constructor.name, {
|
|
35
35
|
attributeName: context.name.toString(),
|
|
36
|
+
kind: "boolean",
|
|
36
37
|
nullable: props?.nullable,
|
|
37
38
|
type: zod_1.z.boolean(),
|
|
38
39
|
...props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateAttribute.d.ts","sourceRoot":"","sources":["../../../../src/decorators/attributes/DateAttribute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,iBAAS,aAAa,CACpB,CAAC,SAAS,UAAU,EACpB,CAAC,SAAS,IAAI,EACd,CAAC,SAAS,gBAAgB,EAC1B,KAAK,CAAC,EAAE,CAAC,YAEC,SAAS,WACR,yBAAyB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"DateAttribute.d.ts","sourceRoot":"","sources":["../../../../src/decorators/attributes/DateAttribute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,iBAAS,aAAa,CACpB,CAAC,SAAS,UAAU,EACpB,CAAC,SAAS,IAAI,EACd,CAAC,SAAS,gBAAgB,EAC1B,KAAK,CAAC,EAAE,CAAC,YAEC,SAAS,WACR,yBAAyB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,UAa9C;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -36,6 +36,7 @@ function DateAttribute(props) {
|
|
|
36
36
|
context.addInitializer(function () {
|
|
37
37
|
metadata_1.default.addEntityAttribute(this.constructor.name, {
|
|
38
38
|
attributeName: context.name.toString(),
|
|
39
|
+
kind: "date",
|
|
39
40
|
nullable: props?.nullable,
|
|
40
41
|
serializers: serializers_1.dateSerializer,
|
|
41
42
|
type: zod_1.z.date(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnumAttribute.d.ts","sourceRoot":"","sources":["../../../../src/decorators/attributes/EnumAttribute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAG5D,MAAM,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,iBAAS,aAAa,CACpB,CAAC,SAAS,UAAU,EACpB,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,EACnC,KAAK,CAAC,CAAC,SAAS,oBAAoB,EACpC,KAAK,EAAE,CAAC,YAEE,SAAS,WACR,yBAAyB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"EnumAttribute.d.ts","sourceRoot":"","sources":["../../../../src/decorators/attributes/EnumAttribute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAG5D,MAAM,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,iBAAS,aAAa,CACpB,CAAC,SAAS,UAAU,EACpB,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,EACnC,KAAK,CAAC,CAAC,SAAS,oBAAoB,EACpC,KAAK,EAAE,CAAC,YAEE,SAAS,WACR,yBAAyB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,UAa9C;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -31,8 +31,10 @@ function EnumAttribute(props) {
|
|
|
31
31
|
context.addInitializer(function () {
|
|
32
32
|
metadata_1.default.addEntityAttribute(this.constructor.name, {
|
|
33
33
|
attributeName: context.name.toString(),
|
|
34
|
+
kind: "enum",
|
|
34
35
|
nullable: props.nullable,
|
|
35
36
|
type: zod_1.z.enum(props.values),
|
|
37
|
+
enumValues: props.values,
|
|
36
38
|
...props
|
|
37
39
|
});
|
|
38
40
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ForeignKeyAttribute.d.ts","sourceRoot":"","sources":["../../../../src/decorators/attributes/ForeignKeyAttribute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,KAAK,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,iBAAS,mBAAmB,CAC1B,YAAY,SAAS,UAAU,EAC/B,CAAC,SAAS,UAAU,EACpB,CAAC,SAAS,gBAAgB,EAC1B,SAAS,EAAE,MAAM,WAAW,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,YAE3C,SAAS,WACR,yBAAyB,CAChC,CAAC,EACD,CAAC,CAAC,UAAU,CAAC,SAAS,IAAI,GACtB,kBAAkB,CAAC,YAAY,CAAC,GAChC,UAAU,CAAC,YAAY,CAAC,EAC5B,CAAC,CACF,
|
|
1
|
+
{"version":3,"file":"ForeignKeyAttribute.d.ts","sourceRoot":"","sources":["../../../../src/decorators/attributes/ForeignKeyAttribute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,KAAK,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,iBAAS,mBAAmB,CAC1B,YAAY,SAAS,UAAU,EAC/B,CAAC,SAAS,UAAU,EACpB,CAAC,SAAS,gBAAgB,EAC1B,SAAS,EAAE,MAAM,WAAW,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,YAE3C,SAAS,WACR,yBAAyB,CAChC,CAAC,EACD,CAAC,CAAC,UAAU,CAAC,SAAS,IAAI,GACtB,kBAAkB,CAAC,YAAY,CAAC,GAChC,UAAU,CAAC,YAAY,CAAC,EAC5B,CAAC,CACF,UAeJ;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -45,6 +45,7 @@ function ForeignKeyAttribute(getTarget, props) {
|
|
|
45
45
|
const targetEntity = getTarget();
|
|
46
46
|
metadata_1.default.addEntityAttribute(this.constructor.name, {
|
|
47
47
|
attributeName: context.name.toString(),
|
|
48
|
+
kind: "foreignKey",
|
|
48
49
|
nullable: props?.nullable,
|
|
49
50
|
type: zod_1.z.string(),
|
|
50
51
|
foreignKeyTarget: targetEntity,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberAttribute.d.ts","sourceRoot":"","sources":["../../../../src/decorators/attributes/NumberAttribute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,iBAAS,eAAe,CACtB,CAAC,SAAS,UAAU,EACpB,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,gBAAgB,EAC1B,KAAK,CAAC,EAAE,CAAC,YAEC,SAAS,WACR,yBAAyB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"NumberAttribute.d.ts","sourceRoot":"","sources":["../../../../src/decorators/attributes/NumberAttribute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,iBAAS,eAAe,CACtB,CAAC,SAAS,UAAU,EACpB,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,gBAAgB,EAC1B,KAAK,CAAC,EAAE,CAAC,YAEC,SAAS,WACR,yBAAyB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,UAY9C;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -33,6 +33,7 @@ function NumberAttribute(props) {
|
|
|
33
33
|
context.addInitializer(function () {
|
|
34
34
|
metadata_1.default.addEntityAttribute(this.constructor.name, {
|
|
35
35
|
attributeName: context.name.toString(),
|
|
36
|
+
kind: "number",
|
|
36
37
|
nullable: props?.nullable,
|
|
37
38
|
type: zod_1.z.number(),
|
|
38
39
|
...props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectAttribute.d.ts","sourceRoot":"","sources":["../../../../src/decorators/attributes/ObjectAttribute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EACV,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EAGlB,MAAM,SAAS,CAAC;AAGjB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,YAAY,CAC5D,SAAQ,uBAAuB;IAC/B;;;;OAIG;IACH,MAAM,EAAE,CAAC,CAAC;CACX;AAkKD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0FG;AACH,iBAAS,eAAe,CAAC,CAAC,SAAS,UAAU,EAAE,KAAK,CAAC,CAAC,SAAS,YAAY,EACzE,KAAK,EAAE,sBAAsB,CAAC,CAAC,CAAC,YAGtB,SAAS,WACR,yBAAyB,CAChC,CAAC,EACD,iBAAiB,CAAC,CAAC,CAAC,EACpB,sBAAsB,CAAC,CAAC,CAAC,CAC1B,
|
|
1
|
+
{"version":3,"file":"ObjectAttribute.d.ts","sourceRoot":"","sources":["../../../../src/decorators/attributes/ObjectAttribute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EACV,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EAGlB,MAAM,SAAS,CAAC;AAGjB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,YAAY,CAC5D,SAAQ,uBAAuB;IAC/B;;;;OAIG;IACH,MAAM,EAAE,CAAC,CAAC;CACX;AAkKD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0FG;AACH,iBAAS,eAAe,CAAC,CAAC,SAAS,UAAU,EAAE,KAAK,CAAC,CAAC,SAAS,YAAY,EACzE,KAAK,EAAE,sBAAsB,CAAC,CAAC,CAAC,YAGtB,SAAS,WACR,yBAAyB,CAChC,CAAC,EACD,iBAAiB,CAAC,CAAC,CAAC,EACpB,sBAAsB,CAAC,CAAC,CAAC,CAC1B,UAqBJ;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -242,6 +242,7 @@ function ObjectAttribute(props) {
|
|
|
242
242
|
context.addInitializer(function () {
|
|
243
243
|
metadata_1.default.addEntityAttribute(this.constructor.name, {
|
|
244
244
|
attributeName: context.name.toString(),
|
|
245
|
+
kind: "object",
|
|
245
246
|
type: zodSchema,
|
|
246
247
|
partialType: partialZodSchema,
|
|
247
248
|
serializers,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PartitionKeyAttribute.d.ts","sourceRoot":"","sources":["../../../../src/decorators/attributes/PartitionKeyAttribute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,qBAAqB,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,YAAY,EACzE,KAAK,CAAC,EAAE,uBAAuB,YAGrB,SAAS,WACR,0BAA0B,CAAC,CAAC,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"PartitionKeyAttribute.d.ts","sourceRoot":"","sources":["../../../../src/decorators/attributes/PartitionKeyAttribute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,qBAAqB,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,YAAY,EACzE,KAAK,CAAC,EAAE,uBAAuB,YAGrB,SAAS,WACR,0BAA0B,CAAC,CAAC,EAAE,CAAC,CAAC,UAW5C;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortKeyAttribute.d.ts","sourceRoot":"","sources":["../../../../src/decorators/attributes/SortKeyAttribute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,gBAAgB,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,OAAO,EAC/D,KAAK,CAAC,EAAE,uBAAuB,YAGrB,SAAS,WACR,0BAA0B,CAAC,CAAC,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"SortKeyAttribute.d.ts","sourceRoot":"","sources":["../../../../src/decorators/attributes/SortKeyAttribute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,gBAAgB,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,OAAO,EAC/D,KAAK,CAAC,EAAE,uBAAuB,YAGrB,SAAS,WACR,0BAA0B,CAAC,CAAC,EAAE,CAAC,CAAC,UAW5C;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringAttribute.d.ts","sourceRoot":"","sources":["../../../../src/decorators/attributes/StringAttribute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EACV,yBAAyB,EACzB,gBAAgB,EAChB,aAAa,EACd,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,iBAAS,eAAe,CACtB,CAAC,SAAS,UAAU,EACpB,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,gBAAgB,EAC1B,KAAK,CAAC,EAAE,CAAC,YAEC,SAAS,WACR,yBAAyB,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"StringAttribute.d.ts","sourceRoot":"","sources":["../../../../src/decorators/attributes/StringAttribute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EACV,yBAAyB,EACzB,gBAAgB,EAChB,aAAa,EACd,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,iBAAS,eAAe,CACtB,CAAC,SAAS,UAAU,EACpB,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,gBAAgB,EAC1B,KAAK,CAAC,EAAE,CAAC,YAEC,SAAS,WACR,yBAAyB,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,UAY7D;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -33,6 +33,7 @@ function StringAttribute(props) {
|
|
|
33
33
|
context.addInitializer(function () {
|
|
34
34
|
metadata_1.default.addEntityAttribute(this.constructor.name, {
|
|
35
35
|
attributeName: context.name.toString(),
|
|
36
|
+
kind: "string",
|
|
36
37
|
nullable: props?.nullable,
|
|
37
38
|
type: zod_1.z.string(),
|
|
38
39
|
...props
|
package/dist/src/index.d.ts
CHANGED
|
@@ -4,4 +4,6 @@ export * from "./relationships";
|
|
|
4
4
|
export * from "./dynamo-utils/errors";
|
|
5
5
|
export type { EntityAttributesOnly, EntityAttributesInstance as EntityInstance, FindByIdIncludesRes, TypedFilterParams, TypedSortKeyCondition, SKScopedFilterParams, InferQueryResults, PartitionEntityNames } from "./operations";
|
|
6
6
|
export type { PartitionKey, SortKey, ForeignKey, NullableForeignKey } from "./types";
|
|
7
|
+
export type { AttributeKind } from "./metadata/types";
|
|
8
|
+
export type { SerializedTableMetadata } from "./metadata/schemas";
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AAEtC,YAAY,EACV,oBAAoB,EACpB,wBAAwB,IAAI,cAAc,EAC1C,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,YAAY,EACZ,OAAO,EACP,UAAU,EACV,kBAAkB,EACnB,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AAEtC,YAAY,EACV,oBAAoB,EACpB,wBAAwB,IAAI,cAAc,EAC1C,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,YAAY,EACZ,OAAO,EACP,UAAU,EACV,kBAAkB,EACnB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,YAAY,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ZodType } from "zod";
|
|
2
2
|
import type DynaRecord from "../DynaRecord";
|
|
3
|
-
import type { AttributeMetadataOptions, Serializers } from "./types";
|
|
3
|
+
import type { AttributeKind, AttributeMetadataOptions, Serializers } from "./types";
|
|
4
4
|
import type { EntityClass } from "../types";
|
|
5
5
|
import type { ObjectSchema } from "../decorators/attributes/types";
|
|
6
6
|
/**
|
|
@@ -20,12 +20,14 @@ import type { ObjectSchema } from "../decorators/attributes/types";
|
|
|
20
20
|
declare class AttributeMetadata {
|
|
21
21
|
readonly name: string;
|
|
22
22
|
readonly alias: string;
|
|
23
|
+
readonly kind: AttributeKind;
|
|
23
24
|
readonly nullable: boolean;
|
|
24
25
|
readonly serializers?: Serializers;
|
|
25
26
|
readonly type: ZodType;
|
|
26
27
|
readonly foreignKeyTarget?: EntityClass<DynaRecord>;
|
|
27
28
|
readonly objectSchema?: ObjectSchema;
|
|
28
29
|
readonly partialType?: ZodType;
|
|
30
|
+
readonly enumValues?: readonly [string, ...string[]];
|
|
29
31
|
constructor(options: AttributeMetadataOptions);
|
|
30
32
|
}
|
|
31
33
|
export default AttributeMetadata;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttributeMetadata.d.ts","sourceRoot":"","sources":["../../../src/metadata/AttributeMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"AttributeMetadata.d.ts","sourceRoot":"","sources":["../../../src/metadata/AttributeMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,EACxB,WAAW,EACZ,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEnE;;;;;;;;;;;;;GAaG;AACH,cAAM,iBAAiB;IACrB,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,SAAgB,IAAI,EAAE,aAAa,CAAC;IACpC,SAAgB,QAAQ,EAAE,OAAO,CAAC;IAClC,SAAgB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1C,SAAgB,IAAI,EAAE,OAAO,CAAC;IAC9B,SAAgB,gBAAgB,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IAC3D,SAAgB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5C,SAAgB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtC,SAAgB,UAAU,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;gBAEhD,OAAO,EAAE,wBAAwB;CAiB9C;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -17,19 +17,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
class AttributeMetadata {
|
|
18
18
|
name;
|
|
19
19
|
alias;
|
|
20
|
+
kind;
|
|
20
21
|
nullable;
|
|
21
22
|
serializers;
|
|
22
23
|
type;
|
|
23
24
|
foreignKeyTarget;
|
|
24
25
|
objectSchema;
|
|
25
26
|
partialType;
|
|
27
|
+
enumValues;
|
|
26
28
|
constructor(options) {
|
|
27
29
|
this.name = options.attributeName;
|
|
28
30
|
this.alias = options.alias ?? options.attributeName;
|
|
31
|
+
this.kind = options.kind;
|
|
29
32
|
this.nullable = options.nullable ?? false;
|
|
30
33
|
this.serializers = options.serializers;
|
|
31
34
|
this.foreignKeyTarget = options.foreignKeyTarget;
|
|
32
35
|
this.objectSchema = options.objectSchema;
|
|
36
|
+
this.enumValues = options.enumValues;
|
|
33
37
|
if (options.nullable === true) {
|
|
34
38
|
this.type = options.type.optional().nullable();
|
|
35
39
|
this.partialType = options.partialType?.optional().nullable();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableMetadata.d.ts","sourceRoot":"","sources":["../../../src/metadata/TableMetadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,GAAG,CAAC;AAEtC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"TableMetadata.d.ts","sourceRoot":"","sources":["../../../src/metadata/TableMetadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,GAAG,CAAC;AAEtC,OAAO,KAAK,EAEV,oBAAoB,EACpB,aAAa,EAGb,4BAA4B,EAC5B,qBAAqB,EACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,WAAW,CAAC;AAEnB,eAAO,MAAM,gBAAgB;;;CAAiD,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CACrC,aAAa,EACb;IAAE,KAAK,EAAE,aAAa,CAAA;CAAE,CAMhB,CAAC;AAEX;;;;;;;;;;;;;GAaG;AACH,cAAM,aAAa;IACjB,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,SAAS,EAAE,MAAM,CAAC;IAClC,SAAgB,iBAAiB,EAAE,MAAM,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;IAC5E,SAAgB,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACnE,qBAAqB,EAAE,iBAAiB,CAAC;IACzC,gBAAgB,EAAE,iBAAiB,CAAC;IAE3C;;;;;;;;;;;;;;;;OAgBG;IACI,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;gBAE9B,OAAO,EAAE,oBAAoB;IA8BzC;;;;OAIG;IACH,OAAO,CAAC,8BAA8B;IAkCtC;;;OAGG;IACI,wBAAwB,CAAC,OAAO,EAAE,4BAA4B,GAAG,IAAI;IAO5E;;;OAGG;IACI,mBAAmB,CAAC,OAAO,EAAE,4BAA4B,GAAG,IAAI;IAOvE;;;;;OAKG;IACI,MAAM,CAAC,QAAQ,EAAE,qBAAqB,GAAG,uBAAuB;CAYxE;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -64,12 +64,14 @@ class TableMetadata {
|
|
|
64
64
|
this.partitionKeyAttribute = {
|
|
65
65
|
name: "",
|
|
66
66
|
alias: exports.defaultTableKeys.partitionKey,
|
|
67
|
+
kind: "string",
|
|
67
68
|
nullable: false,
|
|
68
69
|
type: zod_1.z.string()
|
|
69
70
|
};
|
|
70
71
|
this.sortKeyAttribute = {
|
|
71
72
|
name: "",
|
|
72
73
|
alias: exports.defaultTableKeys.sortKey,
|
|
74
|
+
kind: "string",
|
|
73
75
|
nullable: false,
|
|
74
76
|
type: zod_1.z.string()
|
|
75
77
|
};
|
|
@@ -85,14 +87,16 @@ class TableMetadata {
|
|
|
85
87
|
buildDefaultAttributesMetadata(options) {
|
|
86
88
|
const defaultAttrsMeta = Object.entries(exports.tableDefaultFields);
|
|
87
89
|
const customDefaults = options.defaultFields ?? {};
|
|
90
|
+
const dateFields = ["createdAt", "updatedAt"];
|
|
88
91
|
return defaultAttrsMeta.reduce((acc, [entityKey, tableKeyAlias]) => {
|
|
89
92
|
const key = entityKey;
|
|
90
93
|
const { alias } = customDefaults[key] ?? tableKeyAlias;
|
|
91
|
-
const dateFields = ["createdAt", "updatedAt"];
|
|
92
94
|
const isDateField = dateFields.includes(entityKey);
|
|
95
|
+
const kind = isDateField ? "date" : "string";
|
|
93
96
|
const meta = {
|
|
94
97
|
name: entityKey,
|
|
95
98
|
alias,
|
|
99
|
+
kind,
|
|
96
100
|
nullable: false,
|
|
97
101
|
serializers: isDateField ? decorators_1.dateSerializer : undefined,
|
|
98
102
|
type: isDateField ? zod_1.z.date() : zod_1.z.string()
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { EntityClass } from "../types";
|
|
3
3
|
import type DynaRecord from "../DynaRecord";
|
|
4
|
+
import type { ObjectSchema } from "../decorators/attributes/types";
|
|
4
5
|
/**
|
|
5
6
|
* Zod schema that transforms table metadata to a serializable format.
|
|
6
7
|
* This is the main schema used to serialize {@link TableMetadata} instances,
|
|
@@ -25,104 +26,458 @@ import type DynaRecord from "../DynaRecord";
|
|
|
25
26
|
export declare const TableMetadataTransform: z.ZodObject<{
|
|
26
27
|
name: z.ZodString;
|
|
27
28
|
delimiter: z.ZodString;
|
|
28
|
-
defaultAttributes: z.ZodRecord<z.ZodString, z.
|
|
29
|
+
defaultAttributes: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
30
|
+
kind: z.ZodLiteral<"string">;
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
alias: z.ZodString;
|
|
33
|
+
nullable: z.ZodBoolean;
|
|
34
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
35
|
+
kind: z.ZodLiteral<"number">;
|
|
36
|
+
name: z.ZodString;
|
|
37
|
+
alias: z.ZodString;
|
|
38
|
+
nullable: z.ZodBoolean;
|
|
39
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
40
|
+
kind: z.ZodLiteral<"boolean">;
|
|
41
|
+
name: z.ZodString;
|
|
42
|
+
alias: z.ZodString;
|
|
43
|
+
nullable: z.ZodBoolean;
|
|
44
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
45
|
+
kind: z.ZodLiteral<"date">;
|
|
46
|
+
name: z.ZodString;
|
|
47
|
+
alias: z.ZodString;
|
|
48
|
+
nullable: z.ZodBoolean;
|
|
49
|
+
}, z.core.$strip>, z.ZodPipe<z.ZodObject<{
|
|
50
|
+
kind: z.ZodLiteral<"enum">;
|
|
51
|
+
enumValues: z.ZodArray<z.ZodString>;
|
|
29
52
|
name: z.ZodString;
|
|
30
53
|
alias: z.ZodString;
|
|
31
54
|
nullable: z.ZodBoolean;
|
|
32
|
-
foreignKeyTarget: z.ZodOptional<z.ZodCustom<EntityClass<DynaRecord>, EntityClass<DynaRecord>>>;
|
|
33
55
|
}, z.core.$strip>, z.ZodTransform<{
|
|
34
|
-
|
|
56
|
+
values: string[];
|
|
57
|
+
kind: "enum";
|
|
35
58
|
name: string;
|
|
36
59
|
alias: string;
|
|
37
60
|
nullable: boolean;
|
|
38
61
|
}, {
|
|
62
|
+
kind: "enum";
|
|
63
|
+
enumValues: string[];
|
|
39
64
|
name: string;
|
|
40
65
|
alias: string;
|
|
41
66
|
nullable: boolean;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
67
|
+
}>>, z.ZodPipe<z.ZodObject<{
|
|
68
|
+
kind: z.ZodLiteral<"object">;
|
|
69
|
+
objectSchema: z.ZodCustom<ObjectSchema, ObjectSchema>;
|
|
45
70
|
name: z.ZodString;
|
|
46
71
|
alias: z.ZodString;
|
|
47
72
|
nullable: z.ZodBoolean;
|
|
48
|
-
foreignKeyTarget: z.ZodOptional<z.ZodCustom<EntityClass<DynaRecord>, EntityClass<DynaRecord>>>;
|
|
49
73
|
}, z.core.$strip>, z.ZodTransform<{
|
|
50
|
-
|
|
74
|
+
schema: ObjectSchema;
|
|
75
|
+
kind: "object";
|
|
51
76
|
name: string;
|
|
52
77
|
alias: string;
|
|
53
78
|
nullable: boolean;
|
|
54
79
|
}, {
|
|
80
|
+
kind: "object";
|
|
81
|
+
objectSchema: ObjectSchema;
|
|
55
82
|
name: string;
|
|
56
83
|
alias: string;
|
|
57
84
|
nullable: boolean;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
85
|
+
}>>, z.ZodPipe<z.ZodObject<{
|
|
86
|
+
kind: z.ZodLiteral<"foreignKey">;
|
|
87
|
+
foreignKeyTarget: z.ZodCustom<EntityClass<DynaRecord>, EntityClass<DynaRecord>>;
|
|
88
|
+
name: z.ZodString;
|
|
89
|
+
alias: z.ZodString;
|
|
90
|
+
nullable: z.ZodBoolean;
|
|
91
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
92
|
+
foreignKeyTarget: string;
|
|
93
|
+
kind: "foreignKey";
|
|
94
|
+
name: string;
|
|
95
|
+
alias: string;
|
|
96
|
+
nullable: boolean;
|
|
97
|
+
}, {
|
|
98
|
+
kind: "foreignKey";
|
|
99
|
+
foreignKeyTarget: EntityClass<DynaRecord>;
|
|
100
|
+
name: string;
|
|
101
|
+
alias: string;
|
|
102
|
+
nullable: boolean;
|
|
103
|
+
}>>], "kind">>;
|
|
104
|
+
defaultTableAttributes: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
105
|
+
kind: z.ZodLiteral<"string">;
|
|
106
|
+
name: z.ZodString;
|
|
107
|
+
alias: z.ZodString;
|
|
108
|
+
nullable: z.ZodBoolean;
|
|
109
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
110
|
+
kind: z.ZodLiteral<"number">;
|
|
111
|
+
name: z.ZodString;
|
|
112
|
+
alias: z.ZodString;
|
|
113
|
+
nullable: z.ZodBoolean;
|
|
114
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
115
|
+
kind: z.ZodLiteral<"boolean">;
|
|
116
|
+
name: z.ZodString;
|
|
117
|
+
alias: z.ZodString;
|
|
118
|
+
nullable: z.ZodBoolean;
|
|
119
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
120
|
+
kind: z.ZodLiteral<"date">;
|
|
121
|
+
name: z.ZodString;
|
|
122
|
+
alias: z.ZodString;
|
|
123
|
+
nullable: z.ZodBoolean;
|
|
124
|
+
}, z.core.$strip>, z.ZodPipe<z.ZodObject<{
|
|
125
|
+
kind: z.ZodLiteral<"enum">;
|
|
126
|
+
enumValues: z.ZodArray<z.ZodString>;
|
|
127
|
+
name: z.ZodString;
|
|
128
|
+
alias: z.ZodString;
|
|
129
|
+
nullable: z.ZodBoolean;
|
|
130
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
131
|
+
values: string[];
|
|
132
|
+
kind: "enum";
|
|
133
|
+
name: string;
|
|
134
|
+
alias: string;
|
|
135
|
+
nullable: boolean;
|
|
136
|
+
}, {
|
|
137
|
+
kind: "enum";
|
|
138
|
+
enumValues: string[];
|
|
139
|
+
name: string;
|
|
140
|
+
alias: string;
|
|
141
|
+
nullable: boolean;
|
|
142
|
+
}>>, z.ZodPipe<z.ZodObject<{
|
|
143
|
+
kind: z.ZodLiteral<"object">;
|
|
144
|
+
objectSchema: z.ZodCustom<ObjectSchema, ObjectSchema>;
|
|
145
|
+
name: z.ZodString;
|
|
146
|
+
alias: z.ZodString;
|
|
147
|
+
nullable: z.ZodBoolean;
|
|
148
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
149
|
+
schema: ObjectSchema;
|
|
150
|
+
kind: "object";
|
|
151
|
+
name: string;
|
|
152
|
+
alias: string;
|
|
153
|
+
nullable: boolean;
|
|
154
|
+
}, {
|
|
155
|
+
kind: "object";
|
|
156
|
+
objectSchema: ObjectSchema;
|
|
157
|
+
name: string;
|
|
158
|
+
alias: string;
|
|
159
|
+
nullable: boolean;
|
|
160
|
+
}>>, z.ZodPipe<z.ZodObject<{
|
|
161
|
+
kind: z.ZodLiteral<"foreignKey">;
|
|
162
|
+
foreignKeyTarget: z.ZodCustom<EntityClass<DynaRecord>, EntityClass<DynaRecord>>;
|
|
163
|
+
name: z.ZodString;
|
|
164
|
+
alias: z.ZodString;
|
|
165
|
+
nullable: z.ZodBoolean;
|
|
166
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
167
|
+
foreignKeyTarget: string;
|
|
168
|
+
kind: "foreignKey";
|
|
169
|
+
name: string;
|
|
170
|
+
alias: string;
|
|
171
|
+
nullable: boolean;
|
|
172
|
+
}, {
|
|
173
|
+
kind: "foreignKey";
|
|
174
|
+
foreignKeyTarget: EntityClass<DynaRecord>;
|
|
175
|
+
name: string;
|
|
176
|
+
alias: string;
|
|
177
|
+
nullable: boolean;
|
|
178
|
+
}>>], "kind">>;
|
|
179
|
+
partitionKeyAttribute: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
180
|
+
kind: z.ZodLiteral<"string">;
|
|
181
|
+
name: z.ZodString;
|
|
182
|
+
alias: z.ZodString;
|
|
183
|
+
nullable: z.ZodBoolean;
|
|
184
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
185
|
+
kind: z.ZodLiteral<"number">;
|
|
186
|
+
name: z.ZodString;
|
|
187
|
+
alias: z.ZodString;
|
|
188
|
+
nullable: z.ZodBoolean;
|
|
189
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
190
|
+
kind: z.ZodLiteral<"boolean">;
|
|
191
|
+
name: z.ZodString;
|
|
192
|
+
alias: z.ZodString;
|
|
193
|
+
nullable: z.ZodBoolean;
|
|
194
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
195
|
+
kind: z.ZodLiteral<"date">;
|
|
196
|
+
name: z.ZodString;
|
|
197
|
+
alias: z.ZodString;
|
|
198
|
+
nullable: z.ZodBoolean;
|
|
199
|
+
}, z.core.$strip>, z.ZodPipe<z.ZodObject<{
|
|
200
|
+
kind: z.ZodLiteral<"enum">;
|
|
201
|
+
enumValues: z.ZodArray<z.ZodString>;
|
|
202
|
+
name: z.ZodString;
|
|
203
|
+
alias: z.ZodString;
|
|
204
|
+
nullable: z.ZodBoolean;
|
|
205
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
206
|
+
values: string[];
|
|
207
|
+
kind: "enum";
|
|
208
|
+
name: string;
|
|
209
|
+
alias: string;
|
|
210
|
+
nullable: boolean;
|
|
211
|
+
}, {
|
|
212
|
+
kind: "enum";
|
|
213
|
+
enumValues: string[];
|
|
214
|
+
name: string;
|
|
215
|
+
alias: string;
|
|
216
|
+
nullable: boolean;
|
|
217
|
+
}>>, z.ZodPipe<z.ZodObject<{
|
|
218
|
+
kind: z.ZodLiteral<"object">;
|
|
219
|
+
objectSchema: z.ZodCustom<ObjectSchema, ObjectSchema>;
|
|
220
|
+
name: z.ZodString;
|
|
221
|
+
alias: z.ZodString;
|
|
222
|
+
nullable: z.ZodBoolean;
|
|
223
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
224
|
+
schema: ObjectSchema;
|
|
225
|
+
kind: "object";
|
|
226
|
+
name: string;
|
|
227
|
+
alias: string;
|
|
228
|
+
nullable: boolean;
|
|
229
|
+
}, {
|
|
230
|
+
kind: "object";
|
|
231
|
+
objectSchema: ObjectSchema;
|
|
232
|
+
name: string;
|
|
233
|
+
alias: string;
|
|
234
|
+
nullable: boolean;
|
|
235
|
+
}>>, z.ZodPipe<z.ZodObject<{
|
|
236
|
+
kind: z.ZodLiteral<"foreignKey">;
|
|
237
|
+
foreignKeyTarget: z.ZodCustom<EntityClass<DynaRecord>, EntityClass<DynaRecord>>;
|
|
238
|
+
name: z.ZodString;
|
|
239
|
+
alias: z.ZodString;
|
|
240
|
+
nullable: z.ZodBoolean;
|
|
241
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
242
|
+
foreignKeyTarget: string;
|
|
243
|
+
kind: "foreignKey";
|
|
244
|
+
name: string;
|
|
245
|
+
alias: string;
|
|
246
|
+
nullable: boolean;
|
|
247
|
+
}, {
|
|
248
|
+
kind: "foreignKey";
|
|
249
|
+
foreignKeyTarget: EntityClass<DynaRecord>;
|
|
250
|
+
name: string;
|
|
251
|
+
alias: string;
|
|
252
|
+
nullable: boolean;
|
|
253
|
+
}>>], "kind">;
|
|
254
|
+
sortKeyAttribute: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
255
|
+
kind: z.ZodLiteral<"string">;
|
|
256
|
+
name: z.ZodString;
|
|
257
|
+
alias: z.ZodString;
|
|
258
|
+
nullable: z.ZodBoolean;
|
|
259
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
260
|
+
kind: z.ZodLiteral<"number">;
|
|
261
|
+
name: z.ZodString;
|
|
262
|
+
alias: z.ZodString;
|
|
263
|
+
nullable: z.ZodBoolean;
|
|
264
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
265
|
+
kind: z.ZodLiteral<"boolean">;
|
|
266
|
+
name: z.ZodString;
|
|
267
|
+
alias: z.ZodString;
|
|
268
|
+
nullable: z.ZodBoolean;
|
|
269
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
270
|
+
kind: z.ZodLiteral<"date">;
|
|
271
|
+
name: z.ZodString;
|
|
272
|
+
alias: z.ZodString;
|
|
273
|
+
nullable: z.ZodBoolean;
|
|
274
|
+
}, z.core.$strip>, z.ZodPipe<z.ZodObject<{
|
|
275
|
+
kind: z.ZodLiteral<"enum">;
|
|
276
|
+
enumValues: z.ZodArray<z.ZodString>;
|
|
61
277
|
name: z.ZodString;
|
|
62
278
|
alias: z.ZodString;
|
|
63
279
|
nullable: z.ZodBoolean;
|
|
64
|
-
foreignKeyTarget: z.ZodOptional<z.ZodCustom<EntityClass<DynaRecord>, EntityClass<DynaRecord>>>;
|
|
65
280
|
}, z.core.$strip>, z.ZodTransform<{
|
|
66
|
-
|
|
281
|
+
values: string[];
|
|
282
|
+
kind: "enum";
|
|
67
283
|
name: string;
|
|
68
284
|
alias: string;
|
|
69
285
|
nullable: boolean;
|
|
70
286
|
}, {
|
|
287
|
+
kind: "enum";
|
|
288
|
+
enumValues: string[];
|
|
71
289
|
name: string;
|
|
72
290
|
alias: string;
|
|
73
291
|
nullable: boolean;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
292
|
+
}>>, z.ZodPipe<z.ZodObject<{
|
|
293
|
+
kind: z.ZodLiteral<"object">;
|
|
294
|
+
objectSchema: z.ZodCustom<ObjectSchema, ObjectSchema>;
|
|
77
295
|
name: z.ZodString;
|
|
78
296
|
alias: z.ZodString;
|
|
79
297
|
nullable: z.ZodBoolean;
|
|
80
|
-
foreignKeyTarget: z.ZodOptional<z.ZodCustom<EntityClass<DynaRecord>, EntityClass<DynaRecord>>>;
|
|
81
298
|
}, z.core.$strip>, z.ZodTransform<{
|
|
82
|
-
|
|
299
|
+
schema: ObjectSchema;
|
|
300
|
+
kind: "object";
|
|
83
301
|
name: string;
|
|
84
302
|
alias: string;
|
|
85
303
|
nullable: boolean;
|
|
86
304
|
}, {
|
|
305
|
+
kind: "object";
|
|
306
|
+
objectSchema: ObjectSchema;
|
|
87
307
|
name: string;
|
|
88
308
|
alias: string;
|
|
89
309
|
nullable: boolean;
|
|
90
|
-
|
|
91
|
-
|
|
310
|
+
}>>, z.ZodPipe<z.ZodObject<{
|
|
311
|
+
kind: z.ZodLiteral<"foreignKey">;
|
|
312
|
+
foreignKeyTarget: z.ZodCustom<EntityClass<DynaRecord>, EntityClass<DynaRecord>>;
|
|
313
|
+
name: z.ZodString;
|
|
314
|
+
alias: z.ZodString;
|
|
315
|
+
nullable: z.ZodBoolean;
|
|
316
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
317
|
+
foreignKeyTarget: string;
|
|
318
|
+
kind: "foreignKey";
|
|
319
|
+
name: string;
|
|
320
|
+
alias: string;
|
|
321
|
+
nullable: boolean;
|
|
322
|
+
}, {
|
|
323
|
+
kind: "foreignKey";
|
|
324
|
+
foreignKeyTarget: EntityClass<DynaRecord>;
|
|
325
|
+
name: string;
|
|
326
|
+
alias: string;
|
|
327
|
+
nullable: boolean;
|
|
328
|
+
}>>], "kind">;
|
|
92
329
|
entities: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodObject<{
|
|
93
330
|
tableClassName: z.ZodString;
|
|
94
|
-
attributes: z.ZodRecord<z.ZodString, z.
|
|
331
|
+
attributes: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
332
|
+
kind: z.ZodLiteral<"string">;
|
|
333
|
+
name: z.ZodString;
|
|
334
|
+
alias: z.ZodString;
|
|
335
|
+
nullable: z.ZodBoolean;
|
|
336
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
337
|
+
kind: z.ZodLiteral<"number">;
|
|
338
|
+
name: z.ZodString;
|
|
339
|
+
alias: z.ZodString;
|
|
340
|
+
nullable: z.ZodBoolean;
|
|
341
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
342
|
+
kind: z.ZodLiteral<"boolean">;
|
|
343
|
+
name: z.ZodString;
|
|
344
|
+
alias: z.ZodString;
|
|
345
|
+
nullable: z.ZodBoolean;
|
|
346
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
347
|
+
kind: z.ZodLiteral<"date">;
|
|
348
|
+
name: z.ZodString;
|
|
349
|
+
alias: z.ZodString;
|
|
350
|
+
nullable: z.ZodBoolean;
|
|
351
|
+
}, z.core.$strip>, z.ZodPipe<z.ZodObject<{
|
|
352
|
+
kind: z.ZodLiteral<"enum">;
|
|
353
|
+
enumValues: z.ZodArray<z.ZodString>;
|
|
95
354
|
name: z.ZodString;
|
|
96
355
|
alias: z.ZodString;
|
|
97
356
|
nullable: z.ZodBoolean;
|
|
98
|
-
foreignKeyTarget: z.ZodOptional<z.ZodCustom<EntityClass<DynaRecord>, EntityClass<DynaRecord>>>;
|
|
99
357
|
}, z.core.$strip>, z.ZodTransform<{
|
|
100
|
-
|
|
358
|
+
values: string[];
|
|
359
|
+
kind: "enum";
|
|
101
360
|
name: string;
|
|
102
361
|
alias: string;
|
|
103
362
|
nullable: boolean;
|
|
104
363
|
}, {
|
|
364
|
+
kind: "enum";
|
|
365
|
+
enumValues: string[];
|
|
105
366
|
name: string;
|
|
106
367
|
alias: string;
|
|
107
368
|
nullable: boolean;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
369
|
+
}>>, z.ZodPipe<z.ZodObject<{
|
|
370
|
+
kind: z.ZodLiteral<"object">;
|
|
371
|
+
objectSchema: z.ZodCustom<ObjectSchema, ObjectSchema>;
|
|
111
372
|
name: z.ZodString;
|
|
112
373
|
alias: z.ZodString;
|
|
113
374
|
nullable: z.ZodBoolean;
|
|
114
|
-
foreignKeyTarget: z.ZodOptional<z.ZodCustom<EntityClass<DynaRecord>, EntityClass<DynaRecord>>>;
|
|
115
375
|
}, z.core.$strip>, z.ZodTransform<{
|
|
116
|
-
|
|
376
|
+
schema: ObjectSchema;
|
|
377
|
+
kind: "object";
|
|
117
378
|
name: string;
|
|
118
379
|
alias: string;
|
|
119
380
|
nullable: boolean;
|
|
120
381
|
}, {
|
|
382
|
+
kind: "object";
|
|
383
|
+
objectSchema: ObjectSchema;
|
|
121
384
|
name: string;
|
|
122
385
|
alias: string;
|
|
123
386
|
nullable: boolean;
|
|
124
|
-
|
|
125
|
-
|
|
387
|
+
}>>, z.ZodPipe<z.ZodObject<{
|
|
388
|
+
kind: z.ZodLiteral<"foreignKey">;
|
|
389
|
+
foreignKeyTarget: z.ZodCustom<EntityClass<DynaRecord>, EntityClass<DynaRecord>>;
|
|
390
|
+
name: z.ZodString;
|
|
391
|
+
alias: z.ZodString;
|
|
392
|
+
nullable: z.ZodBoolean;
|
|
393
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
394
|
+
foreignKeyTarget: string;
|
|
395
|
+
kind: "foreignKey";
|
|
396
|
+
name: string;
|
|
397
|
+
alias: string;
|
|
398
|
+
nullable: boolean;
|
|
399
|
+
}, {
|
|
400
|
+
kind: "foreignKey";
|
|
401
|
+
foreignKeyTarget: EntityClass<DynaRecord>;
|
|
402
|
+
name: string;
|
|
403
|
+
alias: string;
|
|
404
|
+
nullable: boolean;
|
|
405
|
+
}>>], "kind">>;
|
|
406
|
+
tableAttributes: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
407
|
+
kind: z.ZodLiteral<"string">;
|
|
408
|
+
name: z.ZodString;
|
|
409
|
+
alias: z.ZodString;
|
|
410
|
+
nullable: z.ZodBoolean;
|
|
411
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
412
|
+
kind: z.ZodLiteral<"number">;
|
|
413
|
+
name: z.ZodString;
|
|
414
|
+
alias: z.ZodString;
|
|
415
|
+
nullable: z.ZodBoolean;
|
|
416
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
417
|
+
kind: z.ZodLiteral<"boolean">;
|
|
418
|
+
name: z.ZodString;
|
|
419
|
+
alias: z.ZodString;
|
|
420
|
+
nullable: z.ZodBoolean;
|
|
421
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
422
|
+
kind: z.ZodLiteral<"date">;
|
|
423
|
+
name: z.ZodString;
|
|
424
|
+
alias: z.ZodString;
|
|
425
|
+
nullable: z.ZodBoolean;
|
|
426
|
+
}, z.core.$strip>, z.ZodPipe<z.ZodObject<{
|
|
427
|
+
kind: z.ZodLiteral<"enum">;
|
|
428
|
+
enumValues: z.ZodArray<z.ZodString>;
|
|
429
|
+
name: z.ZodString;
|
|
430
|
+
alias: z.ZodString;
|
|
431
|
+
nullable: z.ZodBoolean;
|
|
432
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
433
|
+
values: string[];
|
|
434
|
+
kind: "enum";
|
|
435
|
+
name: string;
|
|
436
|
+
alias: string;
|
|
437
|
+
nullable: boolean;
|
|
438
|
+
}, {
|
|
439
|
+
kind: "enum";
|
|
440
|
+
enumValues: string[];
|
|
441
|
+
name: string;
|
|
442
|
+
alias: string;
|
|
443
|
+
nullable: boolean;
|
|
444
|
+
}>>, z.ZodPipe<z.ZodObject<{
|
|
445
|
+
kind: z.ZodLiteral<"object">;
|
|
446
|
+
objectSchema: z.ZodCustom<ObjectSchema, ObjectSchema>;
|
|
447
|
+
name: z.ZodString;
|
|
448
|
+
alias: z.ZodString;
|
|
449
|
+
nullable: z.ZodBoolean;
|
|
450
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
451
|
+
schema: ObjectSchema;
|
|
452
|
+
kind: "object";
|
|
453
|
+
name: string;
|
|
454
|
+
alias: string;
|
|
455
|
+
nullable: boolean;
|
|
456
|
+
}, {
|
|
457
|
+
kind: "object";
|
|
458
|
+
objectSchema: ObjectSchema;
|
|
459
|
+
name: string;
|
|
460
|
+
alias: string;
|
|
461
|
+
nullable: boolean;
|
|
462
|
+
}>>, z.ZodPipe<z.ZodObject<{
|
|
463
|
+
kind: z.ZodLiteral<"foreignKey">;
|
|
464
|
+
foreignKeyTarget: z.ZodCustom<EntityClass<DynaRecord>, EntityClass<DynaRecord>>;
|
|
465
|
+
name: z.ZodString;
|
|
466
|
+
alias: z.ZodString;
|
|
467
|
+
nullable: z.ZodBoolean;
|
|
468
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
469
|
+
foreignKeyTarget: string;
|
|
470
|
+
kind: "foreignKey";
|
|
471
|
+
name: string;
|
|
472
|
+
alias: string;
|
|
473
|
+
nullable: boolean;
|
|
474
|
+
}, {
|
|
475
|
+
kind: "foreignKey";
|
|
476
|
+
foreignKeyTarget: EntityClass<DynaRecord>;
|
|
477
|
+
name: string;
|
|
478
|
+
alias: string;
|
|
479
|
+
nullable: boolean;
|
|
480
|
+
}>>], "kind">>;
|
|
126
481
|
relationships: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodObject<{
|
|
127
482
|
type: z.ZodString;
|
|
128
483
|
propertyName: z.ZodString;
|
|
@@ -150,13 +505,79 @@ export declare const TableMetadataTransform: z.ZodObject<{
|
|
|
150
505
|
idField?: string | undefined;
|
|
151
506
|
tableClassName: string;
|
|
152
507
|
attributes: Record<string, {
|
|
153
|
-
|
|
508
|
+
values: string[];
|
|
509
|
+
kind: "enum";
|
|
510
|
+
name: string;
|
|
511
|
+
alias: string;
|
|
512
|
+
nullable: boolean;
|
|
513
|
+
} | {
|
|
514
|
+
schema: ObjectSchema;
|
|
515
|
+
kind: "object";
|
|
516
|
+
name: string;
|
|
517
|
+
alias: string;
|
|
518
|
+
nullable: boolean;
|
|
519
|
+
} | {
|
|
520
|
+
foreignKeyTarget: string;
|
|
521
|
+
kind: "foreignKey";
|
|
522
|
+
name: string;
|
|
523
|
+
alias: string;
|
|
524
|
+
nullable: boolean;
|
|
525
|
+
} | {
|
|
526
|
+
kind: "string";
|
|
527
|
+
name: string;
|
|
528
|
+
alias: string;
|
|
529
|
+
nullable: boolean;
|
|
530
|
+
} | {
|
|
531
|
+
kind: "number";
|
|
532
|
+
name: string;
|
|
533
|
+
alias: string;
|
|
534
|
+
nullable: boolean;
|
|
535
|
+
} | {
|
|
536
|
+
kind: "boolean";
|
|
537
|
+
name: string;
|
|
538
|
+
alias: string;
|
|
539
|
+
nullable: boolean;
|
|
540
|
+
} | {
|
|
541
|
+
kind: "date";
|
|
154
542
|
name: string;
|
|
155
543
|
alias: string;
|
|
156
544
|
nullable: boolean;
|
|
157
545
|
}>;
|
|
158
546
|
tableAttributes: Record<string, {
|
|
159
|
-
|
|
547
|
+
values: string[];
|
|
548
|
+
kind: "enum";
|
|
549
|
+
name: string;
|
|
550
|
+
alias: string;
|
|
551
|
+
nullable: boolean;
|
|
552
|
+
} | {
|
|
553
|
+
schema: ObjectSchema;
|
|
554
|
+
kind: "object";
|
|
555
|
+
name: string;
|
|
556
|
+
alias: string;
|
|
557
|
+
nullable: boolean;
|
|
558
|
+
} | {
|
|
559
|
+
foreignKeyTarget: string;
|
|
560
|
+
kind: "foreignKey";
|
|
561
|
+
name: string;
|
|
562
|
+
alias: string;
|
|
563
|
+
nullable: boolean;
|
|
564
|
+
} | {
|
|
565
|
+
kind: "string";
|
|
566
|
+
name: string;
|
|
567
|
+
alias: string;
|
|
568
|
+
nullable: boolean;
|
|
569
|
+
} | {
|
|
570
|
+
kind: "number";
|
|
571
|
+
name: string;
|
|
572
|
+
alias: string;
|
|
573
|
+
nullable: boolean;
|
|
574
|
+
} | {
|
|
575
|
+
kind: "boolean";
|
|
576
|
+
name: string;
|
|
577
|
+
alias: string;
|
|
578
|
+
nullable: boolean;
|
|
579
|
+
} | {
|
|
580
|
+
kind: "date";
|
|
160
581
|
name: string;
|
|
161
582
|
alias: string;
|
|
162
583
|
nullable: boolean;
|
|
@@ -172,13 +593,79 @@ export declare const TableMetadataTransform: z.ZodObject<{
|
|
|
172
593
|
}, {
|
|
173
594
|
tableClassName: string;
|
|
174
595
|
attributes: Record<string, {
|
|
175
|
-
|
|
596
|
+
values: string[];
|
|
597
|
+
kind: "enum";
|
|
598
|
+
name: string;
|
|
599
|
+
alias: string;
|
|
600
|
+
nullable: boolean;
|
|
601
|
+
} | {
|
|
602
|
+
schema: ObjectSchema;
|
|
603
|
+
kind: "object";
|
|
604
|
+
name: string;
|
|
605
|
+
alias: string;
|
|
606
|
+
nullable: boolean;
|
|
607
|
+
} | {
|
|
608
|
+
foreignKeyTarget: string;
|
|
609
|
+
kind: "foreignKey";
|
|
610
|
+
name: string;
|
|
611
|
+
alias: string;
|
|
612
|
+
nullable: boolean;
|
|
613
|
+
} | {
|
|
614
|
+
kind: "string";
|
|
615
|
+
name: string;
|
|
616
|
+
alias: string;
|
|
617
|
+
nullable: boolean;
|
|
618
|
+
} | {
|
|
619
|
+
kind: "number";
|
|
620
|
+
name: string;
|
|
621
|
+
alias: string;
|
|
622
|
+
nullable: boolean;
|
|
623
|
+
} | {
|
|
624
|
+
kind: "boolean";
|
|
625
|
+
name: string;
|
|
626
|
+
alias: string;
|
|
627
|
+
nullable: boolean;
|
|
628
|
+
} | {
|
|
629
|
+
kind: "date";
|
|
176
630
|
name: string;
|
|
177
631
|
alias: string;
|
|
178
632
|
nullable: boolean;
|
|
179
633
|
}>;
|
|
180
634
|
tableAttributes: Record<string, {
|
|
181
|
-
|
|
635
|
+
values: string[];
|
|
636
|
+
kind: "enum";
|
|
637
|
+
name: string;
|
|
638
|
+
alias: string;
|
|
639
|
+
nullable: boolean;
|
|
640
|
+
} | {
|
|
641
|
+
schema: ObjectSchema;
|
|
642
|
+
kind: "object";
|
|
643
|
+
name: string;
|
|
644
|
+
alias: string;
|
|
645
|
+
nullable: boolean;
|
|
646
|
+
} | {
|
|
647
|
+
foreignKeyTarget: string;
|
|
648
|
+
kind: "foreignKey";
|
|
649
|
+
name: string;
|
|
650
|
+
alias: string;
|
|
651
|
+
nullable: boolean;
|
|
652
|
+
} | {
|
|
653
|
+
kind: "string";
|
|
654
|
+
name: string;
|
|
655
|
+
alias: string;
|
|
656
|
+
nullable: boolean;
|
|
657
|
+
} | {
|
|
658
|
+
kind: "number";
|
|
659
|
+
name: string;
|
|
660
|
+
alias: string;
|
|
661
|
+
nullable: boolean;
|
|
662
|
+
} | {
|
|
663
|
+
kind: "boolean";
|
|
664
|
+
name: string;
|
|
665
|
+
alias: string;
|
|
666
|
+
nullable: boolean;
|
|
667
|
+
} | {
|
|
668
|
+
kind: "date";
|
|
182
669
|
name: string;
|
|
183
670
|
alias: string;
|
|
184
671
|
nullable: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/metadata/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/metadata/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AA6HnE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQjC,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -2,33 +2,63 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TableMetadataTransform = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Common serialized fields shared by every attribute kind.
|
|
7
|
+
*/
|
|
8
|
+
const baseAttributeShape = {
|
|
9
|
+
name: zod_1.z.string(),
|
|
10
|
+
alias: zod_1.z.string(),
|
|
11
|
+
nullable: zod_1.z.boolean()
|
|
12
|
+
};
|
|
13
|
+
const simpleAttributeShape = (kind) => zod_1.z.object({ ...baseAttributeShape, kind: zod_1.z.literal(kind) });
|
|
5
14
|
/**
|
|
6
15
|
* Zod schema that transforms attribute metadata to a serializable format.
|
|
7
|
-
* Extracts only serializable properties (name, alias, nullable) and converts
|
|
8
|
-
* the foreignKeyTarget EntityClass reference to its class name string.
|
|
9
16
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
17
|
+
* Emits a discriminated union keyed on `kind`. Every attribute carries
|
|
18
|
+
* `{ name, alias, nullable, kind }`; some kinds carry an additional payload:
|
|
19
|
+
*
|
|
20
|
+
* - `kind: "enum"` → `values: readonly [string, ...string[]]`
|
|
21
|
+
* - `kind: "object"` → `schema: ObjectSchema` (the user-authored schema)
|
|
22
|
+
* - `kind: "foreignKey"` → `foreignKeyTarget: string` (target entity class name)
|
|
14
23
|
*
|
|
15
|
-
*
|
|
24
|
+
* Non-serializable internals (Zod types, serializers, partial types) are dropped.
|
|
16
25
|
*/
|
|
17
|
-
const AttributeMetadataTransform = zod_1.z
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
nullable: attr.nullable,
|
|
28
|
-
...(attr.foreignKeyTarget != null && {
|
|
29
|
-
foreignKeyTarget: attr.foreignKeyTarget.name
|
|
26
|
+
const AttributeMetadataTransform = zod_1.z.discriminatedUnion("kind", [
|
|
27
|
+
simpleAttributeShape("string"),
|
|
28
|
+
simpleAttributeShape("number"),
|
|
29
|
+
simpleAttributeShape("boolean"),
|
|
30
|
+
simpleAttributeShape("date"),
|
|
31
|
+
zod_1.z
|
|
32
|
+
.object({
|
|
33
|
+
...baseAttributeShape,
|
|
34
|
+
kind: zod_1.z.literal("enum"),
|
|
35
|
+
enumValues: zod_1.z.array(zod_1.z.string()).nonempty()
|
|
30
36
|
})
|
|
31
|
-
})
|
|
37
|
+
.transform(({ enumValues, ...rest }) => ({
|
|
38
|
+
...rest,
|
|
39
|
+
values: enumValues
|
|
40
|
+
})),
|
|
41
|
+
zod_1.z
|
|
42
|
+
.object({
|
|
43
|
+
...baseAttributeShape,
|
|
44
|
+
kind: zod_1.z.literal("object"),
|
|
45
|
+
objectSchema: zod_1.z.custom()
|
|
46
|
+
})
|
|
47
|
+
.transform(({ objectSchema, ...rest }) => ({
|
|
48
|
+
...rest,
|
|
49
|
+
schema: objectSchema
|
|
50
|
+
})),
|
|
51
|
+
zod_1.z
|
|
52
|
+
.object({
|
|
53
|
+
...baseAttributeShape,
|
|
54
|
+
kind: zod_1.z.literal("foreignKey"),
|
|
55
|
+
foreignKeyTarget: zod_1.z.custom()
|
|
56
|
+
})
|
|
57
|
+
.transform(({ foreignKeyTarget, ...rest }) => ({
|
|
58
|
+
...rest,
|
|
59
|
+
foreignKeyTarget: foreignKeyTarget.name
|
|
60
|
+
}))
|
|
61
|
+
]);
|
|
32
62
|
/**
|
|
33
63
|
* Zod schema that transforms relationship metadata to a serializable format.
|
|
34
64
|
* Extracts serializable properties and converts EntityClass references to their class name strings.
|
|
@@ -81,6 +81,13 @@ export interface Serializers {
|
|
|
81
81
|
*/
|
|
82
82
|
toTableAttribute: TableSerializer;
|
|
83
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Discriminator identifying which `@…Attribute` decorator produced an
|
|
86
|
+
* {@link AttributeMetadata} record. Exposed in the serialized metadata
|
|
87
|
+
* returned by `DynaRecord.metadata()` so consumers can switch on the
|
|
88
|
+
* attribute's logical type.
|
|
89
|
+
*/
|
|
90
|
+
export type AttributeKind = "string" | "number" | "boolean" | "date" | "enum" | "object" | "foreignKey";
|
|
84
91
|
/**
|
|
85
92
|
* Defines the options for configuring attribute metadata within the ORM system. This interface specifies the settings used to describe and manage an attribute's representation and behavior in both the entity model and the underlying database schema, particularly focusing on attributes' names, aliases, nullability, and serialization strategies.
|
|
86
93
|
*
|
|
@@ -91,10 +98,16 @@ export interface Serializers {
|
|
|
91
98
|
*/
|
|
92
99
|
export interface AttributeMetadataOptions {
|
|
93
100
|
attributeName: string;
|
|
101
|
+
kind: AttributeKind;
|
|
94
102
|
type: ZodType;
|
|
95
103
|
alias?: string;
|
|
96
104
|
nullable?: boolean;
|
|
97
105
|
serializers?: Serializers;
|
|
106
|
+
/**
|
|
107
|
+
* For `kind: "enum"` attributes, the allowed string values. Forwarded to
|
|
108
|
+
* the serialized metadata so consumers can introspect the enum domain.
|
|
109
|
+
*/
|
|
110
|
+
enumValues?: readonly [string, ...string[]];
|
|
98
111
|
/**
|
|
99
112
|
* When the attribute represents a foreign key, this references the target entity class.
|
|
100
113
|
* Used to enforce referential integrity even when a relationship decorator is not present.
|
|
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AQ,GACR,QAAQ,GACR,SAAS,GACT,MAAM,GACN,MAAM,GACN,QAAQ,GACR,YAAY,CAAC;AAEjB;;;;;;;GAOG;AACH,MAAM,WAAW,wBAAwB;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;IAC5C;;;OAGG;IACH,gBAAgB,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IAC3C;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,MAAM,8BAA8B,GACtC,qBAAqB,GACrB,mBAAmB,CAAC;AAExB;;;GAGG;AACH,MAAM,WAAW,2BAA4B,SAAQ,iBAAiB;IACpE,gBAAgB,EAAE,WAAW,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAC,CAAC;CACtE"}
|
|
@@ -89,7 +89,7 @@ class FindById extends OperationBase_1.default {
|
|
|
89
89
|
*/
|
|
90
90
|
filterQueryResults(entityId, queryResults) {
|
|
91
91
|
return queryResults.reduce((acc, res) => {
|
|
92
|
-
if (entityId === res.id) {
|
|
92
|
+
if (entityId === res.id && res.type === this.EntityClass.name) {
|
|
93
93
|
acc.entity = res;
|
|
94
94
|
}
|
|
95
95
|
else {
|