@snowtop/ent 0.1.0-alpha95 → 0.1.0-alpha96-2a5ea200-82e5-11ed-8c55-4da1cd949242

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snowtop/ent",
3
- "version": "0.1.0-alpha95",
3
+ "version": "0.1.0-alpha96-2a5ea200-82e5-11ed-8c55-4da1cd949242",
4
4
  "description": "snowtop ent framework",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -214,6 +214,7 @@ export interface FieldOptions {
214
214
  getDerivedFields?(name: string): FieldMap;
215
215
  convert?: ConvertType;
216
216
  fetchOnDemand?: boolean;
217
+ dbOnly?: boolean;
217
218
  [x: string]: any;
218
219
  }
219
220
  export interface PolymorphicOptions {
package/schema/schema.js CHANGED
@@ -58,6 +58,9 @@ function getFields(value) {
58
58
  function addFields(fields) {
59
59
  if (Array.isArray(fields)) {
60
60
  for (const field of fields) {
61
+ if (field.dbOnly) {
62
+ continue;
63
+ }
61
64
  const name = field.name;
62
65
  if (!name) {
63
66
  throw new Error(`name required`);
@@ -71,6 +74,9 @@ function getFields(value) {
71
74
  }
72
75
  for (const name in fields) {
73
76
  const field = fields[name];
77
+ if (field.dbOnly) {
78
+ continue;
79
+ }
74
80
  if (field.getDerivedFields !== undefined) {
75
81
  addFields(field.getDerivedFields(name));
76
82
  }