@dnax/core 0.69.24 → 0.70.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/define/index.ts CHANGED
@@ -135,6 +135,7 @@ const define = {
135
135
  Access,
136
136
  Route,
137
137
  Script,
138
+ TimeSeriesCollection,
138
139
  };
139
140
 
140
141
  export default define;
@@ -22,7 +22,7 @@ async function connectToMongo(t: Tenant) {
22
22
  })
23
23
  .catch((error) => {
24
24
  consola.error(
25
- `Tenant: ${t.id} ,Database connection failed ❌`,
25
+ `Tenant: ${t.id} ,Database connection failed ❌`.red,
26
26
  error?.message
27
27
  );
28
28
  t.database.isConnected = false;
@@ -115,6 +115,7 @@ type activityInput = {
115
115
  };
116
116
 
117
117
  class useRest {
118
+ #useValidator: boolean;
118
119
  #useHook: boolean;
119
120
  #c: Context | undefined;
120
121
  #tenant: Tenant;
@@ -142,6 +143,7 @@ class useRest {
142
143
  };
143
144
 
144
145
  constructor(options: options) {
146
+ this.#useValidator = true;
145
147
  this.#c = options?.c;
146
148
  this.#useCustomApi = options.useCustomApi ?? true;
147
149
  this.#tenant_id = options.tenant_id;
@@ -212,6 +214,8 @@ class useRest {
212
214
  partial: false,
213
215
  }
214
216
  ): { valid: boolean; output: any; error: any } {
217
+ if (!this.#useValidator) return { valid: true, output: data, error: null };
218
+
215
219
  let col = getCollection(collection, this.#tenant_id);
216
220
  let valid = true;
217
221
  let output = { ...data };
@@ -397,6 +401,10 @@ class useRest {
397
401
  });
398
402
  }
399
403
 
404
+ setValidator(value: boolean) {
405
+ this.#useValidator = value;
406
+ }
407
+
400
408
  async insertOne(
401
409
  collection: string,
402
410
  data: object,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.69.24",
3
+ "version": "0.70.0",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "bin": {},