@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 "@snowtop/ent/action";
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>> {
@@ -651,7 +651,6 @@ class Orchestrator {
651
651
  async validWithErrors() {
652
652
  return this.validate();
653
653
  }
654
- // TODO validWithErrors
655
654
  async build() {
656
655
  // validate everything first
657
656
  await this.validX();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snowtop/ent",
3
- "version": "0.1.0-alpha53",
3
+ "version": "0.1.0-alpha54",
4
4
  "description": "snowtop ent framework",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
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
  }