@dnax/core 0.69.24 → 0.69.25
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/driver/mongo/connect.ts +1 -1
- package/driver/mongo/rest.ts +8 -0
- package/package.json +1 -1
package/driver/mongo/connect.ts
CHANGED
package/driver/mongo/rest.ts
CHANGED
|
@@ -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,
|