@dnax/core 0.8.11 → 0.8.12

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/lib/collection.ts CHANGED
@@ -234,6 +234,8 @@ function getKeyFields(col: Collection) {
234
234
  return keyFields;
235
235
  }
236
236
 
237
+
238
+
237
239
  export {
238
240
  loadAllCollections,
239
241
  getCollection,
package/lib/schema.ts CHANGED
@@ -4,6 +4,11 @@ import v, { type AnySchema } from "joi";
4
4
  function buildSchema(col: Collection) {
5
5
  let propertySchema = {} as { [key: string]: AnySchema };
6
6
 
7
+ if (col?.timestamps) {
8
+ propertySchema["createdAt"] = v.date();
9
+ propertySchema["updatedAt"] = v.date();
10
+ }
11
+
7
12
  if (col?.media) {
8
13
  propertySchema["_file"] = v.object();
9
14
  }
@@ -134,7 +139,7 @@ function buildSchema(col: Collection) {
134
139
  }
135
140
  });
136
141
 
137
- let buildSchema = v.object(propertySchema).unknown();
142
+ let buildSchema = v.object(propertySchema);
138
143
 
139
144
  return buildSchema;
140
145
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.8.11",
3
+ "version": "0.8.12",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "bin": {