pinia-orm-edge 1.9.2-28609152.ed747cb → 1.9.2-28634820.2bfcb33

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/dist/casts.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { a0 as CastAttribute, m as ModelFields } from './shared/pinia-orm.f37062c8.cjs';
1
+ import { a0 as CastAttribute, m as ModelFields } from './shared/pinia-orm.6811c38b.cjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
package/dist/casts.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a0 as CastAttribute, m as ModelFields } from './shared/pinia-orm.f37062c8.mjs';
1
+ import { a0 as CastAttribute, m as ModelFields } from './shared/pinia-orm.6811c38b.mjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
package/dist/casts.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a0 as CastAttribute, m as ModelFields } from './shared/pinia-orm.f37062c8.js';
1
+ import { a0 as CastAttribute, m as ModelFields } from './shared/pinia-orm.6811c38b.js';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -1,5 +1,5 @@
1
- import { a1 as TypeDefault, an as PropertyDecorator, ao as TypeOptions, ap as UidOptions, M as Model, s as PrimaryKey, H as deleteModes, a0 as CastAttribute, aj as Mutator } from './shared/pinia-orm.f37062c8.cjs';
2
- export { aq as NanoidOptions } from './shared/pinia-orm.f37062c8.cjs';
1
+ import { a1 as TypeDefault, an as PropertyDecorator, ao as TypeOptions, ap as UidOptions, M as Model, s as PrimaryKey, H as deleteModes, a0 as CastAttribute, aj as Mutator } from './shared/pinia-orm.6811c38b.cjs';
2
+ export { aq as NanoidOptions } from './shared/pinia-orm.6811c38b.cjs';
3
3
  import 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
@@ -1,5 +1,5 @@
1
- import { a1 as TypeDefault, an as PropertyDecorator, ao as TypeOptions, ap as UidOptions, M as Model, s as PrimaryKey, H as deleteModes, a0 as CastAttribute, aj as Mutator } from './shared/pinia-orm.f37062c8.mjs';
2
- export { aq as NanoidOptions } from './shared/pinia-orm.f37062c8.mjs';
1
+ import { a1 as TypeDefault, an as PropertyDecorator, ao as TypeOptions, ap as UidOptions, M as Model, s as PrimaryKey, H as deleteModes, a0 as CastAttribute, aj as Mutator } from './shared/pinia-orm.6811c38b.mjs';
2
+ export { aq as NanoidOptions } from './shared/pinia-orm.6811c38b.mjs';
3
3
  import 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
@@ -1,5 +1,5 @@
1
- import { a1 as TypeDefault, an as PropertyDecorator, ao as TypeOptions, ap as UidOptions, M as Model, s as PrimaryKey, H as deleteModes, a0 as CastAttribute, aj as Mutator } from './shared/pinia-orm.f37062c8.js';
2
- export { aq as NanoidOptions } from './shared/pinia-orm.f37062c8.js';
1
+ import { a1 as TypeDefault, an as PropertyDecorator, ao as TypeOptions, ap as UidOptions, M as Model, s as PrimaryKey, H as deleteModes, a0 as CastAttribute, aj as Mutator } from './shared/pinia-orm.6811c38b.js';
2
+ export { aq as NanoidOptions } from './shared/pinia-orm.6811c38b.js';
3
3
  import 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
@@ -1,4 +1,4 @@
1
- import { M as Model, b as Collection } from './shared/pinia-orm.f37062c8.cjs';
1
+ import { M as Model, b as Collection } from './shared/pinia-orm.6811c38b.cjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -1,4 +1,4 @@
1
- import { M as Model, b as Collection } from './shared/pinia-orm.f37062c8.mjs';
1
+ import { M as Model, b as Collection } from './shared/pinia-orm.6811c38b.mjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
package/dist/helpers.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { M as Model, b as Collection } from './shared/pinia-orm.f37062c8.js';
1
+ import { M as Model, b as Collection } from './shared/pinia-orm.6811c38b.js';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
package/dist/index.cjs CHANGED
@@ -277,17 +277,23 @@ class Type extends Attribute {
277
277
  /**
278
278
  * Create a new Type attribute instance.
279
279
  */
280
- constructor(model, value = null) {
280
+ constructor(model, defaultValue = null) {
281
281
  super(model);
282
282
  /**
283
- * The default value for the attribute.
283
+ * The raw default value for the attribute (can be a function).
284
284
  */
285
- __publicField$h(this, "value");
285
+ __publicField$h(this, "rawDefaultValue");
286
286
  /**
287
287
  * Whether the attribute accepts `null` value or not.
288
288
  */
289
289
  __publicField$h(this, "isNullable", true);
290
- this.value = typeof value === "function" ? value() : value;
290
+ this.rawDefaultValue = defaultValue;
291
+ }
292
+ /**
293
+ * The computed default value of the attribute.
294
+ */
295
+ get defaultValue() {
296
+ return typeof this.rawDefaultValue === "function" ? this.rawDefaultValue() : this.rawDefaultValue;
291
297
  }
292
298
  /**
293
299
  * Set the nullable option to false.
@@ -298,7 +304,7 @@ class Type extends Attribute {
298
304
  }
299
305
  makeReturn(type, value) {
300
306
  if (value === void 0) {
301
- return this.value;
307
+ return this.defaultValue;
302
308
  }
303
309
  if (value === null) {
304
310
  if (!this.isNullable) {
@@ -1314,7 +1320,7 @@ class Query {
1314
1320
  const recordsByTypes = {};
1315
1321
  records = Utils.isArray(records) ? records : [records];
1316
1322
  records.forEach((record) => {
1317
- const recordType = modelTypesKeys.includes(`${record[this.model.$typeKey()]}`) || isChildEntity ? record[this.model.$typeKey()] ?? this.model.$fields()[this.model.$typeKey()].value : modelTypesKeys[0];
1323
+ const recordType = modelTypesKeys.includes(`${record[this.model.$typeKey()]}`) || isChildEntity ? record[this.model.$typeKey()] ?? this.model.$fields()[this.model.$typeKey()].defaultValue : modelTypesKeys[0];
1318
1324
  if (!recordsByTypes[recordType]) {
1319
1325
  recordsByTypes[recordType] = [];
1320
1326
  }
@@ -2067,7 +2073,7 @@ class Attr extends Type {
2067
2073
  * Make the value for the attribute.
2068
2074
  */
2069
2075
  make(value) {
2070
- return value === void 0 ? this.value : value;
2076
+ return value === void 0 ? this.defaultValue : value;
2071
2077
  }
2072
2078
  }
2073
2079
 
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as Repository, C as Constructor, M as Model, Q as Query, D as DataStore, E as Elements, W as WeakCache, F as FilledInstallOptions } from './shared/pinia-orm.f37062c8.cjs';
2
- export { A as AfterHook, y as Attribute, B as BeforeHook, K as BelongsTo, L as BelongsToMany, am as CacheConfig, g as CacheConfigOptions, a0 as CastAttribute, $ as Casts, b as Collection, i as CreatePiniaOrm, c as DataStoreState, k as Database, z as Dictionary, ah as EagerLoad, ai as EagerLoadConstraint, a as Element, a6 as GetElementType, ac as Group, ae as GroupBy, af as GroupByFields, G as GroupedCollection, O as HasMany, U as HasManyBy, V as HasManyThrough, T as HasOne, w as InheritanceTypes, h as InstallOptions, a3 as Interpreter, I as Item, v as MetaValues, f as ModelConfigOptions, m as ModelFields, t as ModelOptions, o as ModelRegistries, q as ModelRegistry, n as ModelSchemas, X as MorphMany, _ as MorphOne, Y as MorphTo, Z as MorphToMany, aj as Mutator, ak as MutatorFunctions, al as Mutators, a5 as NonMethodKeys, N as NormalizedData, ab as Order, ad as OrderBy, ag as OrderDirection, d as PiniaOrmPlugin, P as PiniaOrmPluginContext, s as PrimaryKey, J as Relation, l as Schema, S as Schemas, a2 as Type, a1 as TypeDefault, a7 as UltimateKeys, a4 as Where, aa as WhereGroup, a8 as WherePrimaryClosure, a9 as WhereSecondaryClosure, x as WithKeys, j as createORM, e as definePiniaOrmPlugin, H as deleteModes, p as plugins, r as registerPlugins, u as useDataStore } from './shared/pinia-orm.f37062c8.cjs';
1
+ import { R as Repository, C as Constructor, M as Model, Q as Query, D as DataStore, E as Elements, W as WeakCache, F as FilledInstallOptions } from './shared/pinia-orm.6811c38b.cjs';
2
+ export { A as AfterHook, y as Attribute, B as BeforeHook, K as BelongsTo, L as BelongsToMany, am as CacheConfig, g as CacheConfigOptions, a0 as CastAttribute, $ as Casts, b as Collection, i as CreatePiniaOrm, c as DataStoreState, k as Database, z as Dictionary, ah as EagerLoad, ai as EagerLoadConstraint, a as Element, a6 as GetElementType, ac as Group, ae as GroupBy, af as GroupByFields, G as GroupedCollection, O as HasMany, U as HasManyBy, V as HasManyThrough, T as HasOne, w as InheritanceTypes, h as InstallOptions, a3 as Interpreter, I as Item, v as MetaValues, f as ModelConfigOptions, m as ModelFields, t as ModelOptions, o as ModelRegistries, q as ModelRegistry, n as ModelSchemas, X as MorphMany, _ as MorphOne, Y as MorphTo, Z as MorphToMany, aj as Mutator, ak as MutatorFunctions, al as Mutators, a5 as NonMethodKeys, N as NormalizedData, ab as Order, ad as OrderBy, ag as OrderDirection, d as PiniaOrmPlugin, P as PiniaOrmPluginContext, s as PrimaryKey, J as Relation, l as Schema, S as Schemas, a2 as Type, a1 as TypeDefault, a7 as UltimateKeys, a4 as Where, aa as WhereGroup, a8 as WherePrimaryClosure, a9 as WhereSecondaryClosure, x as WithKeys, j as createORM, e as definePiniaOrmPlugin, H as deleteModes, p as plugins, r as registerPlugins, u as useDataStore } from './shared/pinia-orm.6811c38b.cjs';
3
3
  import { Pinia } from 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as Repository, C as Constructor, M as Model, Q as Query, D as DataStore, E as Elements, W as WeakCache, F as FilledInstallOptions } from './shared/pinia-orm.f37062c8.mjs';
2
- export { A as AfterHook, y as Attribute, B as BeforeHook, K as BelongsTo, L as BelongsToMany, am as CacheConfig, g as CacheConfigOptions, a0 as CastAttribute, $ as Casts, b as Collection, i as CreatePiniaOrm, c as DataStoreState, k as Database, z as Dictionary, ah as EagerLoad, ai as EagerLoadConstraint, a as Element, a6 as GetElementType, ac as Group, ae as GroupBy, af as GroupByFields, G as GroupedCollection, O as HasMany, U as HasManyBy, V as HasManyThrough, T as HasOne, w as InheritanceTypes, h as InstallOptions, a3 as Interpreter, I as Item, v as MetaValues, f as ModelConfigOptions, m as ModelFields, t as ModelOptions, o as ModelRegistries, q as ModelRegistry, n as ModelSchemas, X as MorphMany, _ as MorphOne, Y as MorphTo, Z as MorphToMany, aj as Mutator, ak as MutatorFunctions, al as Mutators, a5 as NonMethodKeys, N as NormalizedData, ab as Order, ad as OrderBy, ag as OrderDirection, d as PiniaOrmPlugin, P as PiniaOrmPluginContext, s as PrimaryKey, J as Relation, l as Schema, S as Schemas, a2 as Type, a1 as TypeDefault, a7 as UltimateKeys, a4 as Where, aa as WhereGroup, a8 as WherePrimaryClosure, a9 as WhereSecondaryClosure, x as WithKeys, j as createORM, e as definePiniaOrmPlugin, H as deleteModes, p as plugins, r as registerPlugins, u as useDataStore } from './shared/pinia-orm.f37062c8.mjs';
1
+ import { R as Repository, C as Constructor, M as Model, Q as Query, D as DataStore, E as Elements, W as WeakCache, F as FilledInstallOptions } from './shared/pinia-orm.6811c38b.mjs';
2
+ export { A as AfterHook, y as Attribute, B as BeforeHook, K as BelongsTo, L as BelongsToMany, am as CacheConfig, g as CacheConfigOptions, a0 as CastAttribute, $ as Casts, b as Collection, i as CreatePiniaOrm, c as DataStoreState, k as Database, z as Dictionary, ah as EagerLoad, ai as EagerLoadConstraint, a as Element, a6 as GetElementType, ac as Group, ae as GroupBy, af as GroupByFields, G as GroupedCollection, O as HasMany, U as HasManyBy, V as HasManyThrough, T as HasOne, w as InheritanceTypes, h as InstallOptions, a3 as Interpreter, I as Item, v as MetaValues, f as ModelConfigOptions, m as ModelFields, t as ModelOptions, o as ModelRegistries, q as ModelRegistry, n as ModelSchemas, X as MorphMany, _ as MorphOne, Y as MorphTo, Z as MorphToMany, aj as Mutator, ak as MutatorFunctions, al as Mutators, a5 as NonMethodKeys, N as NormalizedData, ab as Order, ad as OrderBy, ag as OrderDirection, d as PiniaOrmPlugin, P as PiniaOrmPluginContext, s as PrimaryKey, J as Relation, l as Schema, S as Schemas, a2 as Type, a1 as TypeDefault, a7 as UltimateKeys, a4 as Where, aa as WhereGroup, a8 as WherePrimaryClosure, a9 as WhereSecondaryClosure, x as WithKeys, j as createORM, e as definePiniaOrmPlugin, H as deleteModes, p as plugins, r as registerPlugins, u as useDataStore } from './shared/pinia-orm.6811c38b.mjs';
3
3
  import { Pinia } from 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as Repository, C as Constructor, M as Model, Q as Query, D as DataStore, E as Elements, W as WeakCache, F as FilledInstallOptions } from './shared/pinia-orm.f37062c8.js';
2
- export { A as AfterHook, y as Attribute, B as BeforeHook, K as BelongsTo, L as BelongsToMany, am as CacheConfig, g as CacheConfigOptions, a0 as CastAttribute, $ as Casts, b as Collection, i as CreatePiniaOrm, c as DataStoreState, k as Database, z as Dictionary, ah as EagerLoad, ai as EagerLoadConstraint, a as Element, a6 as GetElementType, ac as Group, ae as GroupBy, af as GroupByFields, G as GroupedCollection, O as HasMany, U as HasManyBy, V as HasManyThrough, T as HasOne, w as InheritanceTypes, h as InstallOptions, a3 as Interpreter, I as Item, v as MetaValues, f as ModelConfigOptions, m as ModelFields, t as ModelOptions, o as ModelRegistries, q as ModelRegistry, n as ModelSchemas, X as MorphMany, _ as MorphOne, Y as MorphTo, Z as MorphToMany, aj as Mutator, ak as MutatorFunctions, al as Mutators, a5 as NonMethodKeys, N as NormalizedData, ab as Order, ad as OrderBy, ag as OrderDirection, d as PiniaOrmPlugin, P as PiniaOrmPluginContext, s as PrimaryKey, J as Relation, l as Schema, S as Schemas, a2 as Type, a1 as TypeDefault, a7 as UltimateKeys, a4 as Where, aa as WhereGroup, a8 as WherePrimaryClosure, a9 as WhereSecondaryClosure, x as WithKeys, j as createORM, e as definePiniaOrmPlugin, H as deleteModes, p as plugins, r as registerPlugins, u as useDataStore } from './shared/pinia-orm.f37062c8.js';
1
+ import { R as Repository, C as Constructor, M as Model, Q as Query, D as DataStore, E as Elements, W as WeakCache, F as FilledInstallOptions } from './shared/pinia-orm.6811c38b.js';
2
+ export { A as AfterHook, y as Attribute, B as BeforeHook, K as BelongsTo, L as BelongsToMany, am as CacheConfig, g as CacheConfigOptions, a0 as CastAttribute, $ as Casts, b as Collection, i as CreatePiniaOrm, c as DataStoreState, k as Database, z as Dictionary, ah as EagerLoad, ai as EagerLoadConstraint, a as Element, a6 as GetElementType, ac as Group, ae as GroupBy, af as GroupByFields, G as GroupedCollection, O as HasMany, U as HasManyBy, V as HasManyThrough, T as HasOne, w as InheritanceTypes, h as InstallOptions, a3 as Interpreter, I as Item, v as MetaValues, f as ModelConfigOptions, m as ModelFields, t as ModelOptions, o as ModelRegistries, q as ModelRegistry, n as ModelSchemas, X as MorphMany, _ as MorphOne, Y as MorphTo, Z as MorphToMany, aj as Mutator, ak as MutatorFunctions, al as Mutators, a5 as NonMethodKeys, N as NormalizedData, ab as Order, ad as OrderBy, ag as OrderDirection, d as PiniaOrmPlugin, P as PiniaOrmPluginContext, s as PrimaryKey, J as Relation, l as Schema, S as Schemas, a2 as Type, a1 as TypeDefault, a7 as UltimateKeys, a4 as Where, aa as WhereGroup, a8 as WherePrimaryClosure, a9 as WhereSecondaryClosure, x as WithKeys, j as createORM, e as definePiniaOrmPlugin, H as deleteModes, p as plugins, r as registerPlugins, u as useDataStore } from './shared/pinia-orm.6811c38b.js';
3
3
  import { Pinia } from 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
package/dist/index.mjs CHANGED
@@ -275,17 +275,23 @@ class Type extends Attribute {
275
275
  /**
276
276
  * Create a new Type attribute instance.
277
277
  */
278
- constructor(model, value = null) {
278
+ constructor(model, defaultValue = null) {
279
279
  super(model);
280
280
  /**
281
- * The default value for the attribute.
281
+ * The raw default value for the attribute (can be a function).
282
282
  */
283
- __publicField$h(this, "value");
283
+ __publicField$h(this, "rawDefaultValue");
284
284
  /**
285
285
  * Whether the attribute accepts `null` value or not.
286
286
  */
287
287
  __publicField$h(this, "isNullable", true);
288
- this.value = typeof value === "function" ? value() : value;
288
+ this.rawDefaultValue = defaultValue;
289
+ }
290
+ /**
291
+ * The computed default value of the attribute.
292
+ */
293
+ get defaultValue() {
294
+ return typeof this.rawDefaultValue === "function" ? this.rawDefaultValue() : this.rawDefaultValue;
289
295
  }
290
296
  /**
291
297
  * Set the nullable option to false.
@@ -296,7 +302,7 @@ class Type extends Attribute {
296
302
  }
297
303
  makeReturn(type, value) {
298
304
  if (value === void 0) {
299
- return this.value;
305
+ return this.defaultValue;
300
306
  }
301
307
  if (value === null) {
302
308
  if (!this.isNullable) {
@@ -1312,7 +1318,7 @@ class Query {
1312
1318
  const recordsByTypes = {};
1313
1319
  records = isArray(records) ? records : [records];
1314
1320
  records.forEach((record) => {
1315
- const recordType = modelTypesKeys.includes(`${record[this.model.$typeKey()]}`) || isChildEntity ? record[this.model.$typeKey()] ?? this.model.$fields()[this.model.$typeKey()].value : modelTypesKeys[0];
1321
+ const recordType = modelTypesKeys.includes(`${record[this.model.$typeKey()]}`) || isChildEntity ? record[this.model.$typeKey()] ?? this.model.$fields()[this.model.$typeKey()].defaultValue : modelTypesKeys[0];
1316
1322
  if (!recordsByTypes[recordType]) {
1317
1323
  recordsByTypes[recordType] = [];
1318
1324
  }
@@ -2065,7 +2071,7 @@ class Attr extends Type {
2065
2071
  * Make the value for the attribute.
2066
2072
  */
2067
2073
  make(value) {
2068
- return value === void 0 ? this.value : value;
2074
+ return value === void 0 ? this.defaultValue : value;
2069
2075
  }
2070
2076
  }
2071
2077
 
@@ -1,4 +1,4 @@
1
- import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.f37062c8.cjs';
1
+ import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.6811c38b.cjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -1,4 +1,4 @@
1
- import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.f37062c8.mjs';
1
+ import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.6811c38b.mjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -1,4 +1,4 @@
1
- import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.f37062c8.js';
1
+ import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.6811c38b.js';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -1,4 +1,4 @@
1
- import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.f37062c8.cjs';
1
+ import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.6811c38b.cjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -1,4 +1,4 @@
1
- import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.f37062c8.mjs';
1
+ import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.6811c38b.mjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -1,4 +1,4 @@
1
- import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.f37062c8.js';
1
+ import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.6811c38b.js';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -1,4 +1,4 @@
1
- import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.f37062c8.cjs';
1
+ import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.6811c38b.cjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -1,4 +1,4 @@
1
- import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.f37062c8.mjs';
1
+ import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.6811c38b.mjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -1,4 +1,4 @@
1
- import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.f37062c8.js';
1
+ import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.6811c38b.js';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -101,9 +101,9 @@ declare abstract class Attribute {
101
101
  type TypeDefault<T> = T | null | (() => T | null);
102
102
  declare abstract class Type extends Attribute {
103
103
  /**
104
- * The default value for the attribute.
104
+ * The raw default value for the attribute (can be a function).
105
105
  */
106
- value: any;
106
+ rawDefaultValue: any;
107
107
  /**
108
108
  * Whether the attribute accepts `null` value or not.
109
109
  */
@@ -111,7 +111,11 @@ declare abstract class Type extends Attribute {
111
111
  /**
112
112
  * Create a new Type attribute instance.
113
113
  */
114
- constructor(model: Model, value?: TypeDefault<any>);
114
+ constructor(model: Model, defaultValue?: TypeDefault<any>);
115
+ /**
116
+ * The computed default value of the attribute.
117
+ */
118
+ get defaultValue(): any;
115
119
  /**
116
120
  * Set the nullable option to false.
117
121
  */
@@ -101,9 +101,9 @@ declare abstract class Attribute {
101
101
  type TypeDefault<T> = T | null | (() => T | null);
102
102
  declare abstract class Type extends Attribute {
103
103
  /**
104
- * The default value for the attribute.
104
+ * The raw default value for the attribute (can be a function).
105
105
  */
106
- value: any;
106
+ rawDefaultValue: any;
107
107
  /**
108
108
  * Whether the attribute accepts `null` value or not.
109
109
  */
@@ -111,7 +111,11 @@ declare abstract class Type extends Attribute {
111
111
  /**
112
112
  * Create a new Type attribute instance.
113
113
  */
114
- constructor(model: Model, value?: TypeDefault<any>);
114
+ constructor(model: Model, defaultValue?: TypeDefault<any>);
115
+ /**
116
+ * The computed default value of the attribute.
117
+ */
118
+ get defaultValue(): any;
115
119
  /**
116
120
  * Set the nullable option to false.
117
121
  */
@@ -101,9 +101,9 @@ declare abstract class Attribute {
101
101
  type TypeDefault<T> = T | null | (() => T | null);
102
102
  declare abstract class Type extends Attribute {
103
103
  /**
104
- * The default value for the attribute.
104
+ * The raw default value for the attribute (can be a function).
105
105
  */
106
- value: any;
106
+ rawDefaultValue: any;
107
107
  /**
108
108
  * Whether the attribute accepts `null` value or not.
109
109
  */
@@ -111,7 +111,11 @@ declare abstract class Type extends Attribute {
111
111
  /**
112
112
  * Create a new Type attribute instance.
113
113
  */
114
- constructor(model: Model, value?: TypeDefault<any>);
114
+ constructor(model: Model, defaultValue?: TypeDefault<any>);
115
+ /**
116
+ * The computed default value of the attribute.
117
+ */
118
+ get defaultValue(): any;
115
119
  /**
116
120
  * Set the nullable option to false.
117
121
  */
@@ -1,5 +1,5 @@
1
1
  import { V1Options } from 'uuid';
2
- import { a0 as CastAttribute, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.f37062c8.cjs';
2
+ import { a0 as CastAttribute, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.6811c38b.cjs';
3
3
  import 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
@@ -1,5 +1,5 @@
1
1
  import { V1Options } from 'uuid';
2
- import { a0 as CastAttribute, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.f37062c8.mjs';
2
+ import { a0 as CastAttribute, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.6811c38b.mjs';
3
3
  import 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
package/dist/uuid/v1.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { V1Options } from 'uuid';
2
- import { a0 as CastAttribute, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.f37062c8.js';
2
+ import { a0 as CastAttribute, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.6811c38b.js';
3
3
  import 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
@@ -1,5 +1,5 @@
1
1
  import { V4Options } from 'uuid';
2
- import { a0 as CastAttribute, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.f37062c8.cjs';
2
+ import { a0 as CastAttribute, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.6811c38b.cjs';
3
3
  import 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
@@ -1,5 +1,5 @@
1
1
  import { V4Options } from 'uuid';
2
- import { a0 as CastAttribute, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.f37062c8.mjs';
2
+ import { a0 as CastAttribute, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.6811c38b.mjs';
3
3
  import 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
package/dist/uuid/v4.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { V4Options } from 'uuid';
2
- import { a0 as CastAttribute, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.f37062c8.js';
2
+ import { a0 as CastAttribute, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.6811c38b.js';
3
3
  import 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinia-orm-edge",
3
- "version": "1.9.2-28609152.ed747cb",
3
+ "version": "1.9.2-28634820.2bfcb33",
4
4
  "description": "The Pinia plugin to enable Object-Relational Mapping access to the Pinia Store.",
5
5
  "keywords": [
6
6
  "vue",
@@ -46,7 +46,7 @@
46
46
  "pinia": "^2.1.7"
47
47
  },
48
48
  "dependencies": {
49
- "@pinia-orm/normalizr": "npm:@pinia-orm/normalizr-edge@1.9.2-28609152.ed747cb"
49
+ "@pinia-orm/normalizr": "npm:@pinia-orm/normalizr-edge@1.9.2-28634820.2bfcb33"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@nuxt/eslint-config": "^0.3.12",