pinia-orm-edge 1.9.0-28582911.bbf7a93 → 1.9.0-28583149.676ad48

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,6 +1,7 @@
1
- import { $ as CastAttribute, m as ModelFields } from './shared/pinia-orm.677cd0bd.cjs';
1
+ import { a0 as CastAttribute, m as ModelFields } from './shared/pinia-orm.b86abeaa.cjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
+ import '@/model/Model';
4
5
  import '@/composables';
5
6
 
6
7
  declare class ArrayCast extends CastAttribute {
package/dist/casts.d.mts CHANGED
@@ -1,6 +1,7 @@
1
- import { $ as CastAttribute, m as ModelFields } from './shared/pinia-orm.677cd0bd.mjs';
1
+ import { a0 as CastAttribute, m as ModelFields } from './shared/pinia-orm.b86abeaa.mjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
+ import '@/model/Model';
4
5
  import '@/composables';
5
6
 
6
7
  declare class ArrayCast extends CastAttribute {
package/dist/casts.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { $ as CastAttribute, m as ModelFields } from './shared/pinia-orm.677cd0bd.js';
1
+ import { a0 as CastAttribute, m as ModelFields } from './shared/pinia-orm.b86abeaa.js';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
+ import '@/model/Model';
4
5
  import '@/composables';
5
6
 
6
7
  declare class ArrayCast extends CastAttribute {
@@ -1,7 +1,8 @@
1
- import { a0 as TypeDefault, af as PropertyDecorator, ag as TypeOptions, ah as UidOptions, M as Model, s as PrimaryKey, z as deleteModes, $ as CastAttribute, ai as Mutator } from './shared/pinia-orm.677cd0bd.cjs';
2
- export { aj as NanoidOptions } from './shared/pinia-orm.677cd0bd.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.b86abeaa.cjs';
2
+ export { aq as NanoidOptions } from './shared/pinia-orm.b86abeaa.cjs';
3
3
  import 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
+ import '@/model/Model';
5
6
  import '@/composables';
6
7
 
7
8
  /**
@@ -1,7 +1,8 @@
1
- import { a0 as TypeDefault, af as PropertyDecorator, ag as TypeOptions, ah as UidOptions, M as Model, s as PrimaryKey, z as deleteModes, $ as CastAttribute, ai as Mutator } from './shared/pinia-orm.677cd0bd.mjs';
2
- export { aj as NanoidOptions } from './shared/pinia-orm.677cd0bd.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.b86abeaa.mjs';
2
+ export { aq as NanoidOptions } from './shared/pinia-orm.b86abeaa.mjs';
3
3
  import 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
+ import '@/model/Model';
5
6
  import '@/composables';
6
7
 
7
8
  /**
@@ -1,7 +1,8 @@
1
- import { a0 as TypeDefault, af as PropertyDecorator, ag as TypeOptions, ah as UidOptions, M as Model, s as PrimaryKey, z as deleteModes, $ as CastAttribute, ai as Mutator } from './shared/pinia-orm.677cd0bd.js';
2
- export { aj as NanoidOptions } from './shared/pinia-orm.677cd0bd.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.b86abeaa.js';
2
+ export { aq as NanoidOptions } from './shared/pinia-orm.b86abeaa.js';
3
3
  import 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
+ import '@/model/Model';
5
6
  import '@/composables';
6
7
 
7
8
  /**
@@ -1,6 +1,7 @@
1
- import { M as Model, b as Collection } from './shared/pinia-orm.677cd0bd.cjs';
1
+ import { M as Model, b as Collection } from './shared/pinia-orm.b86abeaa.cjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
+ import '@/model/Model';
4
5
  import '@/composables';
5
6
 
6
7
  type SortFlags = 'SORT_REGULAR' | 'SORT_FLAG_CASE';
@@ -24,7 +25,7 @@ declare function useCollect<M extends Model = Model>(models: Collection<M>): Use
24
25
  /**
25
26
  * Get the sum value of the specified filed.
26
27
  */
27
- declare function useSum(models: Collection, field: string): number;
28
+ declare function useSum(models: Collection<any>, field: string): number;
28
29
 
29
30
  /**
30
31
  * The useGroupBy method groups the collection's items by a given key.
@@ -34,7 +35,7 @@ declare function useGroupBy<T extends Record<string, any>>(models: T[], fields:
34
35
  /**
35
36
  * The keys method returns all of the collection's primary keys
36
37
  */
37
- declare function useKeys(models: Collection): string[];
38
+ declare function useKeys(models: Collection<any>): string[];
38
39
 
39
40
  /**
40
41
  * Get the min value of the specified filed.
@@ -1,6 +1,7 @@
1
- import { M as Model, b as Collection } from './shared/pinia-orm.677cd0bd.mjs';
1
+ import { M as Model, b as Collection } from './shared/pinia-orm.b86abeaa.mjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
+ import '@/model/Model';
4
5
  import '@/composables';
5
6
 
6
7
  type SortFlags = 'SORT_REGULAR' | 'SORT_FLAG_CASE';
@@ -24,7 +25,7 @@ declare function useCollect<M extends Model = Model>(models: Collection<M>): Use
24
25
  /**
25
26
  * Get the sum value of the specified filed.
26
27
  */
27
- declare function useSum(models: Collection, field: string): number;
28
+ declare function useSum(models: Collection<any>, field: string): number;
28
29
 
29
30
  /**
30
31
  * The useGroupBy method groups the collection's items by a given key.
@@ -34,7 +35,7 @@ declare function useGroupBy<T extends Record<string, any>>(models: T[], fields:
34
35
  /**
35
36
  * The keys method returns all of the collection's primary keys
36
37
  */
37
- declare function useKeys(models: Collection): string[];
38
+ declare function useKeys(models: Collection<any>): string[];
38
39
 
39
40
  /**
40
41
  * Get the min value of the specified filed.
package/dist/helpers.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { M as Model, b as Collection } from './shared/pinia-orm.677cd0bd.js';
1
+ import { M as Model, b as Collection } from './shared/pinia-orm.b86abeaa.js';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
+ import '@/model/Model';
4
5
  import '@/composables';
5
6
 
6
7
  type SortFlags = 'SORT_REGULAR' | 'SORT_FLAG_CASE';
@@ -24,7 +25,7 @@ declare function useCollect<M extends Model = Model>(models: Collection<M>): Use
24
25
  /**
25
26
  * Get the sum value of the specified filed.
26
27
  */
27
- declare function useSum(models: Collection, field: string): number;
28
+ declare function useSum(models: Collection<any>, field: string): number;
28
29
 
29
30
  /**
30
31
  * The useGroupBy method groups the collection's items by a given key.
@@ -34,7 +35,7 @@ declare function useGroupBy<T extends Record<string, any>>(models: T[], fields:
34
35
  /**
35
36
  * The keys method returns all of the collection's primary keys
36
37
  */
37
- declare function useKeys(models: Collection): string[];
38
+ declare function useKeys(models: Collection<any>): string[];
38
39
 
39
40
  /**
40
41
  * Get the min value of the specified filed.
package/dist/index.cjs CHANGED
@@ -828,6 +828,8 @@ class Query {
828
828
  this.getNewHydrated = true;
829
829
  return this;
830
830
  }
831
+ // where(field: T, value?: WhereSecondaryClosure<M[T]> | M[T]): this;
832
+ // where<T extends WherePrimaryClosure<M> | keyof M>(field: T, value?: WhereSecondaryClosure<M[T]> | M[T]): this;
831
833
  /**
832
834
  * Add a basic where clause to the query.
833
835
  */
@@ -1030,11 +1032,14 @@ class Query {
1030
1032
  */
1031
1033
  getFieldWhereForRelations(relation, callback = () => {
1032
1034
  }, operator, count) {
1033
- const modelIdsByRelation = this.newQuery(this.model.$entity()).with(relation, callback).get(false).filter((model) => Utils.compareWithOperator(
1034
- Utils.isArray(model[relation]) ? model[relation].length : model[relation] === null ? 0 : 1,
1035
- typeof operator === "number" ? operator : count ?? 1,
1036
- typeof operator === "number" || count === void 0 ? ">=" : operator
1037
- )).map((model) => model.$getIndexId());
1035
+ const modelIdsByRelation = this.newQuery(this.model.$entity()).with(relation, callback).get(false).filter((model) => {
1036
+ const modelRelation = model[relation];
1037
+ return Utils.compareWithOperator(
1038
+ Utils.isArray(modelRelation) ? modelRelation.length : modelRelation === null ? 0 : 1,
1039
+ typeof operator === "number" ? operator : count ?? 1,
1040
+ typeof operator === "number" || count === void 0 ? ">=" : operator
1041
+ );
1042
+ }).map((model) => model.$getIndexId());
1038
1043
  return (model) => modelIdsByRelation.includes(model.$getIndexId());
1039
1044
  }
1040
1045
  /**
@@ -2859,6 +2864,8 @@ class Model {
2859
2864
  * Create a new model instance.
2860
2865
  */
2861
2866
  constructor(attributes, options = { operation: "set" }) {
2867
+ // [s: keyof ModelFields]: any
2868
+ __publicField(this, "pivot");
2862
2869
  this.$boot();
2863
2870
  const fill = options.fill ?? true;
2864
2871
  fill && this.$fill(attributes, options);
package/dist/index.d.cts CHANGED
@@ -1,7 +1,8 @@
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.677cd0bd.cjs';
2
- export { A as AfterHook, x as Attribute, B as BeforeHook, J as BelongsTo, K as BelongsToMany, g as CacheConfigOptions, $ as CastAttribute, _ as Casts, b as Collection, i as CreatePiniaOrm, c as DataStoreState, k as Database, y as Dictionary, ad as EagerLoad, ae as EagerLoadConstraint, a as Element, a8 as Group, aa as GroupBy, ab as GroupByFields, G as GroupedCollection, L as HasMany, T as HasManyBy, U as HasManyThrough, O as HasOne, w as InheritanceTypes, h as InstallOptions, a2 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, V as MorphMany, Z as MorphOne, X as MorphTo, Y as MorphToMany, N as NormalizedData, a7 as Order, a9 as OrderBy, ac as OrderDirection, d as PiniaOrmPlugin, P as PiniaOrmPluginContext, s as PrimaryKey, H as Relation, l as Schema, S as Schemas, a1 as Type, a0 as TypeDefault, a3 as Where, a6 as WhereGroup, a4 as WherePrimaryClosure, a5 as WhereSecondaryClosure, j as createORM, e as definePiniaOrmPlugin, z as deleteModes, p as plugins, r as registerPlugins, u as useDataStore } from './shared/pinia-orm.677cd0bd.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.b86abeaa.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.b86abeaa.cjs';
3
3
  import { Pinia } from 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
+ import '@/model/Model';
5
6
  import '@/composables';
6
7
 
7
8
  declare function useRepo<R extends Repository>(repository: R | Constructor<R>, pinia?: Pinia): R;
@@ -46,4 +47,4 @@ declare const config: FilledInstallOptions & {
46
47
  [key: string]: any;
47
48
  };
48
49
 
49
- export { CONFIG_DEFAULTS, DataStore, Elements, FilledInstallOptions, type MappedRepositories, Model, type ModelOrRepository, type ModelsOrRepositories, Query, Repository, config, mapRepos, useRepo, useStoreActions };
50
+ export { CONFIG_DEFAULTS, Constructor, DataStore, Elements, FilledInstallOptions, type MappedRepositories, Model, type ModelOrRepository, type ModelsOrRepositories, Query, Repository, config, mapRepos, useRepo, useStoreActions };
package/dist/index.d.mts CHANGED
@@ -1,7 +1,8 @@
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.677cd0bd.mjs';
2
- export { A as AfterHook, x as Attribute, B as BeforeHook, J as BelongsTo, K as BelongsToMany, g as CacheConfigOptions, $ as CastAttribute, _ as Casts, b as Collection, i as CreatePiniaOrm, c as DataStoreState, k as Database, y as Dictionary, ad as EagerLoad, ae as EagerLoadConstraint, a as Element, a8 as Group, aa as GroupBy, ab as GroupByFields, G as GroupedCollection, L as HasMany, T as HasManyBy, U as HasManyThrough, O as HasOne, w as InheritanceTypes, h as InstallOptions, a2 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, V as MorphMany, Z as MorphOne, X as MorphTo, Y as MorphToMany, N as NormalizedData, a7 as Order, a9 as OrderBy, ac as OrderDirection, d as PiniaOrmPlugin, P as PiniaOrmPluginContext, s as PrimaryKey, H as Relation, l as Schema, S as Schemas, a1 as Type, a0 as TypeDefault, a3 as Where, a6 as WhereGroup, a4 as WherePrimaryClosure, a5 as WhereSecondaryClosure, j as createORM, e as definePiniaOrmPlugin, z as deleteModes, p as plugins, r as registerPlugins, u as useDataStore } from './shared/pinia-orm.677cd0bd.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.b86abeaa.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.b86abeaa.mjs';
3
3
  import { Pinia } from 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
+ import '@/model/Model';
5
6
  import '@/composables';
6
7
 
7
8
  declare function useRepo<R extends Repository>(repository: R | Constructor<R>, pinia?: Pinia): R;
@@ -46,4 +47,4 @@ declare const config: FilledInstallOptions & {
46
47
  [key: string]: any;
47
48
  };
48
49
 
49
- export { CONFIG_DEFAULTS, DataStore, Elements, FilledInstallOptions, type MappedRepositories, Model, type ModelOrRepository, type ModelsOrRepositories, Query, Repository, config, mapRepos, useRepo, useStoreActions };
50
+ export { CONFIG_DEFAULTS, Constructor, DataStore, Elements, FilledInstallOptions, type MappedRepositories, Model, type ModelOrRepository, type ModelsOrRepositories, Query, Repository, config, mapRepos, useRepo, useStoreActions };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
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.677cd0bd.js';
2
- export { A as AfterHook, x as Attribute, B as BeforeHook, J as BelongsTo, K as BelongsToMany, g as CacheConfigOptions, $ as CastAttribute, _ as Casts, b as Collection, i as CreatePiniaOrm, c as DataStoreState, k as Database, y as Dictionary, ad as EagerLoad, ae as EagerLoadConstraint, a as Element, a8 as Group, aa as GroupBy, ab as GroupByFields, G as GroupedCollection, L as HasMany, T as HasManyBy, U as HasManyThrough, O as HasOne, w as InheritanceTypes, h as InstallOptions, a2 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, V as MorphMany, Z as MorphOne, X as MorphTo, Y as MorphToMany, N as NormalizedData, a7 as Order, a9 as OrderBy, ac as OrderDirection, d as PiniaOrmPlugin, P as PiniaOrmPluginContext, s as PrimaryKey, H as Relation, l as Schema, S as Schemas, a1 as Type, a0 as TypeDefault, a3 as Where, a6 as WhereGroup, a4 as WherePrimaryClosure, a5 as WhereSecondaryClosure, j as createORM, e as definePiniaOrmPlugin, z as deleteModes, p as plugins, r as registerPlugins, u as useDataStore } from './shared/pinia-orm.677cd0bd.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.b86abeaa.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.b86abeaa.js';
3
3
  import { Pinia } from 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
+ import '@/model/Model';
5
6
  import '@/composables';
6
7
 
7
8
  declare function useRepo<R extends Repository>(repository: R | Constructor<R>, pinia?: Pinia): R;
@@ -46,4 +47,4 @@ declare const config: FilledInstallOptions & {
46
47
  [key: string]: any;
47
48
  };
48
49
 
49
- export { CONFIG_DEFAULTS, DataStore, Elements, FilledInstallOptions, type MappedRepositories, Model, type ModelOrRepository, type ModelsOrRepositories, Query, Repository, config, mapRepos, useRepo, useStoreActions };
50
+ export { CONFIG_DEFAULTS, Constructor, DataStore, Elements, FilledInstallOptions, type MappedRepositories, Model, type ModelOrRepository, type ModelsOrRepositories, Query, Repository, config, mapRepos, useRepo, useStoreActions };
package/dist/index.mjs CHANGED
@@ -826,6 +826,8 @@ class Query {
826
826
  this.getNewHydrated = true;
827
827
  return this;
828
828
  }
829
+ // where(field: T, value?: WhereSecondaryClosure<M[T]> | M[T]): this;
830
+ // where<T extends WherePrimaryClosure<M> | keyof M>(field: T, value?: WhereSecondaryClosure<M[T]> | M[T]): this;
829
831
  /**
830
832
  * Add a basic where clause to the query.
831
833
  */
@@ -1028,11 +1030,14 @@ class Query {
1028
1030
  */
1029
1031
  getFieldWhereForRelations(relation, callback = () => {
1030
1032
  }, operator, count) {
1031
- const modelIdsByRelation = this.newQuery(this.model.$entity()).with(relation, callback).get(false).filter((model) => compareWithOperator(
1032
- isArray(model[relation]) ? model[relation].length : model[relation] === null ? 0 : 1,
1033
- typeof operator === "number" ? operator : count ?? 1,
1034
- typeof operator === "number" || count === void 0 ? ">=" : operator
1035
- )).map((model) => model.$getIndexId());
1033
+ const modelIdsByRelation = this.newQuery(this.model.$entity()).with(relation, callback).get(false).filter((model) => {
1034
+ const modelRelation = model[relation];
1035
+ return compareWithOperator(
1036
+ isArray(modelRelation) ? modelRelation.length : modelRelation === null ? 0 : 1,
1037
+ typeof operator === "number" ? operator : count ?? 1,
1038
+ typeof operator === "number" || count === void 0 ? ">=" : operator
1039
+ );
1040
+ }).map((model) => model.$getIndexId());
1036
1041
  return (model) => modelIdsByRelation.includes(model.$getIndexId());
1037
1042
  }
1038
1043
  /**
@@ -2857,6 +2862,8 @@ class Model {
2857
2862
  * Create a new model instance.
2858
2863
  */
2859
2864
  constructor(attributes, options = { operation: "set" }) {
2865
+ // [s: keyof ModelFields]: any
2866
+ __publicField(this, "pivot");
2860
2867
  this.$boot();
2861
2868
  const fill = options.fill ?? true;
2862
2869
  fill && this.$fill(attributes, options);
@@ -1,6 +1,7 @@
1
- import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.cjs';
1
+ import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.b86abeaa.cjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
+ import '@/model/Model';
4
5
  import '@/composables';
5
6
 
6
7
  /**
@@ -1,6 +1,7 @@
1
- import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.mjs';
1
+ import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.b86abeaa.mjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
+ import '@/model/Model';
4
5
  import '@/composables';
5
6
 
6
7
  /**
@@ -1,6 +1,7 @@
1
- import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.js';
1
+ import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.b86abeaa.js';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
+ import '@/model/Model';
4
5
  import '@/composables';
5
6
 
6
7
  /**
@@ -1,6 +1,7 @@
1
- import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.cjs';
1
+ import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.b86abeaa.cjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
+ import '@/model/Model';
4
5
  import '@/composables';
5
6
 
6
7
  declare class UidCast extends CastAttribute {
@@ -1,6 +1,7 @@
1
- import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.mjs';
1
+ import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.b86abeaa.mjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
+ import '@/model/Model';
4
5
  import '@/composables';
5
6
 
6
7
  declare class UidCast extends CastAttribute {
@@ -1,6 +1,7 @@
1
- import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.js';
1
+ import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.b86abeaa.js';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
+ import '@/model/Model';
4
5
  import '@/composables';
5
6
 
6
7
  declare class UidCast extends CastAttribute {
@@ -1,6 +1,7 @@
1
- import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.cjs';
1
+ import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.b86abeaa.cjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
+ import '@/model/Model';
4
5
  import '@/composables';
5
6
 
6
7
  declare class UidCast extends CastAttribute {
@@ -1,6 +1,7 @@
1
- import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.mjs';
1
+ import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.b86abeaa.mjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
+ import '@/model/Model';
4
5
  import '@/composables';
5
6
 
6
7
  declare class UidCast extends CastAttribute {
@@ -1,6 +1,7 @@
1
- import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.js';
1
+ import { a0 as CastAttribute, aq as NanoidOptions, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.b86abeaa.js';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
+ import '@/model/Model';
4
5
  import '@/composables';
5
6
 
6
7
  declare class UidCast extends CastAttribute {