@snowtop/ent 0.1.0-alpha53 → 0.1.0-alpha54
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Orchestrator } from "
|
|
1
|
+
import { Orchestrator } from "./orchestrator";
|
|
2
2
|
import { Viewer, Ent, Data } from "../core/base";
|
|
3
3
|
import { Action, WriteOperation, Builder, Trigger, Observer, Changeset, Validator } from "./action";
|
|
4
4
|
export interface ActionOptions<TEnt extends Ent<TViewer>, TViewer extends Viewer, TData extends Data, TExistingEnt extends TMaybleNullableEnt<TEnt> = MaybeNull<TEnt>> {
|
package/action/orchestrator.js
CHANGED
package/package.json
CHANGED
package/schema/field.js
CHANGED
|
@@ -25,6 +25,7 @@ const snake_case_1 = require("snake-case");
|
|
|
25
25
|
const db_1 = __importStar(require("../core/db"));
|
|
26
26
|
const schema_1 = require("./schema");
|
|
27
27
|
const util_1 = require("util");
|
|
28
|
+
const uuid_1 = require("uuid");
|
|
28
29
|
class BaseField {
|
|
29
30
|
logValue(val) {
|
|
30
31
|
if (this.sensitive) {
|
|
@@ -92,6 +93,9 @@ class UUIDField extends BaseField {
|
|
|
92
93
|
return val.placeholderID !== undefined;
|
|
93
94
|
}
|
|
94
95
|
async valid(val) {
|
|
96
|
+
if (typeof val === "string" && !(0, uuid_1.validate)(val)) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
95
99
|
if (!this.options?.fieldEdge?.enforceSchema) {
|
|
96
100
|
return true;
|
|
97
101
|
}
|