pinia-orm-edge 1.9.0-28581943.45f87aa → 1.9.0-28582911.bbf7a93

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 { $ as CastAttribute, m as ModelFields } from './shared/pinia-orm.ed84a779.cjs';
1
+ import { $ as CastAttribute, m as ModelFields } from './shared/pinia-orm.677cd0bd.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 { $ as CastAttribute, m as ModelFields } from './shared/pinia-orm.ed84a779.mjs';
1
+ import { $ as CastAttribute, m as ModelFields } from './shared/pinia-orm.677cd0bd.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 { $ as CastAttribute, m as ModelFields } from './shared/pinia-orm.ed84a779.js';
1
+ import { $ as CastAttribute, m as ModelFields } from './shared/pinia-orm.677cd0bd.js';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -1,5 +1,5 @@
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.ed84a779.cjs';
2
- export { aj as NanoidOptions } from './shared/pinia-orm.ed84a779.cjs';
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';
3
3
  import 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
@@ -1,5 +1,5 @@
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.ed84a779.mjs';
2
- export { aj as NanoidOptions } from './shared/pinia-orm.ed84a779.mjs';
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';
3
3
  import 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
@@ -1,5 +1,5 @@
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.ed84a779.js';
2
- export { aj as NanoidOptions } from './shared/pinia-orm.ed84a779.js';
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';
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.ed84a779.cjs';
1
+ import { M as Model, b as Collection } from './shared/pinia-orm.677cd0bd.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.ed84a779.mjs';
1
+ import { M as Model, b as Collection } from './shared/pinia-orm.677cd0bd.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.ed84a779.js';
1
+ import { M as Model, b as Collection } from './shared/pinia-orm.677cd0bd.js';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
package/dist/index.cjs CHANGED
@@ -842,8 +842,34 @@ class Query {
842
842
  if (values instanceof Set) {
843
843
  values = Array.from(values);
844
844
  }
845
- this.wheres.push({ field, value: values, boolean: "and" });
846
- return this;
845
+ return this.where(field, values);
846
+ }
847
+ /**
848
+ * Add a "where not in" clause to the query.
849
+ */
850
+ whereNotIn(field, values) {
851
+ if (values instanceof Set) {
852
+ values = Array.from(values);
853
+ }
854
+ return this.where((query) => !values.includes(query[field]));
855
+ }
856
+ /**
857
+ * Add a "where not in" clause to the query.
858
+ */
859
+ orWhereIn(field, values) {
860
+ if (values instanceof Set) {
861
+ values = Array.from(values);
862
+ }
863
+ return this.orWhere(field, values);
864
+ }
865
+ /**
866
+ * Add a "where not in" clause to the query.
867
+ */
868
+ orWhereNotIn(field, values) {
869
+ if (values instanceof Set) {
870
+ values = Array.from(values);
871
+ }
872
+ return this.orWhere((query) => !values.includes(query[field]));
847
873
  }
848
874
  /**
849
875
  * Add a where clause on the primary key to the query.
@@ -858,6 +884,18 @@ class Query {
858
884
  this.wheres.push({ field, value, boolean: "or" });
859
885
  return this;
860
886
  }
887
+ /**
888
+ * Add a "whereNULL" clause to the query.
889
+ */
890
+ whereNull(field) {
891
+ return this.where(field, null);
892
+ }
893
+ /**
894
+ * Add a "whereNotNULL" clause to the query.
895
+ */
896
+ whereNotNull(field) {
897
+ return this.where((query) => query[field] != null);
898
+ }
861
899
  /**
862
900
  * Add a "where has" clause to the query.
863
901
  */
@@ -1052,13 +1090,13 @@ class Query {
1052
1090
  this.where(this.model.$typeKey(), this.model.$fields()[this.model.$typeKey()].make());
1053
1091
  }
1054
1092
  let models = this.select();
1055
- if (!this.orders) {
1093
+ if (this.orders.length === 0) {
1056
1094
  models = this.filterLimit(models);
1057
1095
  }
1058
1096
  if (!Utils.isEmpty(models)) {
1059
1097
  this.eagerLoadRelations(models);
1060
1098
  }
1061
- if (this.orders) {
1099
+ if (this.orders.length > 0) {
1062
1100
  models = this.filterOrder(models);
1063
1101
  models = this.filterLimit(models);
1064
1102
  }
@@ -1651,6 +1689,22 @@ class Repository {
1651
1689
  this.database = database;
1652
1690
  this.pinia = pinia;
1653
1691
  this.hydratedDataCache = cache;
1692
+ return new Proxy(this, {
1693
+ get(repository, field) {
1694
+ if (typeof field === "symbol") {
1695
+ return;
1696
+ }
1697
+ if (field in repository) {
1698
+ return repository[field];
1699
+ }
1700
+ if (field === "use" || field === "model" || field === "queryCache") {
1701
+ return;
1702
+ }
1703
+ return function(...args) {
1704
+ return repository.query()[field](...args);
1705
+ };
1706
+ }
1707
+ });
1654
1708
  }
1655
1709
  /**
1656
1710
  * Set the model
@@ -1858,9 +1912,6 @@ class Repository {
1858
1912
  all() {
1859
1913
  return this.query().get();
1860
1914
  }
1861
- find(ids) {
1862
- return this.query().find(ids);
1863
- }
1864
1915
  revive(schema) {
1865
1916
  return this.query().revive(schema);
1866
1917
  }
@@ -1996,13 +2047,15 @@ function mapRepos(modelsOrRepositories) {
1996
2047
  function createORM(options) {
1997
2048
  config.model = { ...CONFIG_DEFAULTS.model, ...options?.model };
1998
2049
  config.cache = options?.cache === false ? false : { ...CONFIG_DEFAULTS.cache, ...options?.cache !== true && options?.cache };
1999
- const orm = {
2000
- use(plugin) {
2050
+ const orm = () => {
2051
+ function use(plugin) {
2001
2052
  plugins.push(plugin);
2002
- return this;
2003
2053
  }
2054
+ return {
2055
+ use
2056
+ };
2004
2057
  };
2005
- return () => orm;
2058
+ return orm;
2006
2059
  }
2007
2060
 
2008
2061
  class Attr extends Type {
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.ed84a779.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.ed84a779.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.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';
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.ed84a779.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.ed84a779.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.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';
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.ed84a779.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.ed84a779.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.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';
3
3
  import { Pinia } from 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
package/dist/index.mjs CHANGED
@@ -840,8 +840,34 @@ class Query {
840
840
  if (values instanceof Set) {
841
841
  values = Array.from(values);
842
842
  }
843
- this.wheres.push({ field, value: values, boolean: "and" });
844
- return this;
843
+ return this.where(field, values);
844
+ }
845
+ /**
846
+ * Add a "where not in" clause to the query.
847
+ */
848
+ whereNotIn(field, values) {
849
+ if (values instanceof Set) {
850
+ values = Array.from(values);
851
+ }
852
+ return this.where((query) => !values.includes(query[field]));
853
+ }
854
+ /**
855
+ * Add a "where not in" clause to the query.
856
+ */
857
+ orWhereIn(field, values) {
858
+ if (values instanceof Set) {
859
+ values = Array.from(values);
860
+ }
861
+ return this.orWhere(field, values);
862
+ }
863
+ /**
864
+ * Add a "where not in" clause to the query.
865
+ */
866
+ orWhereNotIn(field, values) {
867
+ if (values instanceof Set) {
868
+ values = Array.from(values);
869
+ }
870
+ return this.orWhere((query) => !values.includes(query[field]));
845
871
  }
846
872
  /**
847
873
  * Add a where clause on the primary key to the query.
@@ -856,6 +882,18 @@ class Query {
856
882
  this.wheres.push({ field, value, boolean: "or" });
857
883
  return this;
858
884
  }
885
+ /**
886
+ * Add a "whereNULL" clause to the query.
887
+ */
888
+ whereNull(field) {
889
+ return this.where(field, null);
890
+ }
891
+ /**
892
+ * Add a "whereNotNULL" clause to the query.
893
+ */
894
+ whereNotNull(field) {
895
+ return this.where((query) => query[field] != null);
896
+ }
859
897
  /**
860
898
  * Add a "where has" clause to the query.
861
899
  */
@@ -1050,13 +1088,13 @@ class Query {
1050
1088
  this.where(this.model.$typeKey(), this.model.$fields()[this.model.$typeKey()].make());
1051
1089
  }
1052
1090
  let models = this.select();
1053
- if (!this.orders) {
1091
+ if (this.orders.length === 0) {
1054
1092
  models = this.filterLimit(models);
1055
1093
  }
1056
1094
  if (!isEmpty(models)) {
1057
1095
  this.eagerLoadRelations(models);
1058
1096
  }
1059
- if (this.orders) {
1097
+ if (this.orders.length > 0) {
1060
1098
  models = this.filterOrder(models);
1061
1099
  models = this.filterLimit(models);
1062
1100
  }
@@ -1649,6 +1687,22 @@ class Repository {
1649
1687
  this.database = database;
1650
1688
  this.pinia = pinia;
1651
1689
  this.hydratedDataCache = cache;
1690
+ return new Proxy(this, {
1691
+ get(repository, field) {
1692
+ if (typeof field === "symbol") {
1693
+ return;
1694
+ }
1695
+ if (field in repository) {
1696
+ return repository[field];
1697
+ }
1698
+ if (field === "use" || field === "model" || field === "queryCache") {
1699
+ return;
1700
+ }
1701
+ return function(...args) {
1702
+ return repository.query()[field](...args);
1703
+ };
1704
+ }
1705
+ });
1652
1706
  }
1653
1707
  /**
1654
1708
  * Set the model
@@ -1856,9 +1910,6 @@ class Repository {
1856
1910
  all() {
1857
1911
  return this.query().get();
1858
1912
  }
1859
- find(ids) {
1860
- return this.query().find(ids);
1861
- }
1862
1913
  revive(schema) {
1863
1914
  return this.query().revive(schema);
1864
1915
  }
@@ -1994,13 +2045,15 @@ function mapRepos(modelsOrRepositories) {
1994
2045
  function createORM(options) {
1995
2046
  config.model = { ...CONFIG_DEFAULTS.model, ...options?.model };
1996
2047
  config.cache = options?.cache === false ? false : { ...CONFIG_DEFAULTS.cache, ...options?.cache !== true && options?.cache };
1997
- const orm = {
1998
- use(plugin) {
2048
+ const orm = () => {
2049
+ function use(plugin) {
1999
2050
  plugins.push(plugin);
2000
- return this;
2001
2051
  }
2052
+ return {
2053
+ use
2054
+ };
2002
2055
  };
2003
- return () => orm;
2056
+ return orm;
2004
2057
  }
2005
2058
 
2006
2059
  class Attr extends Type {
@@ -1,4 +1,4 @@
1
- import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.ed84a779.cjs';
1
+ import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.cjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -1,4 +1,4 @@
1
- import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.ed84a779.mjs';
1
+ import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.mjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -1,4 +1,4 @@
1
- import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.ed84a779.js';
1
+ import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.js';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -1,4 +1,4 @@
1
- import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.ed84a779.cjs';
1
+ import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.cjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -1,4 +1,4 @@
1
- import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.ed84a779.mjs';
1
+ import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.mjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -1,4 +1,4 @@
1
- import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.ed84a779.js';
1
+ import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.js';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -1,4 +1,4 @@
1
- import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.ed84a779.cjs';
1
+ import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.cjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -1,4 +1,4 @@
1
- import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.ed84a779.mjs';
1
+ import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.mjs';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -1,4 +1,4 @@
1
- import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.ed84a779.js';
1
+ import { $ as CastAttribute, aj as NanoidOptions, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.js';
2
2
  import 'pinia';
3
3
  import '@pinia-orm/normalizr';
4
4
  import '@/composables';
@@ -1,5 +1,5 @@
1
1
  import * as pinia from 'pinia';
2
- import { Pinia, DefineStoreOptionsBase } from 'pinia';
2
+ import { PiniaPlugin, Pinia, DefineStoreOptionsBase } from 'pinia';
3
3
  import { schema, Schema as Schema$1 } from '@pinia-orm/normalizr';
4
4
  import * as __composables from '@/composables';
5
5
 
@@ -73,9 +73,7 @@ interface CreatePiniaOrm {
73
73
  /**
74
74
  * Install Pinia ORM to the store.
75
75
  */
76
- declare function createORM(options?: InstallOptions): () => {
77
- use(plugin: PiniaOrmPlugin): any;
78
- };
76
+ declare function createORM(options?: InstallOptions): PiniaPlugin;
79
77
 
80
78
  declare abstract class Attribute {
81
79
  /**
@@ -419,6 +417,18 @@ declare class Query<M extends Model = Model> {
419
417
  * Add a "where in" clause to the query.
420
418
  */
421
419
  whereIn(field: string, values: any[] | Set<any>): this;
420
+ /**
421
+ * Add a "where not in" clause to the query.
422
+ */
423
+ whereNotIn(field: string, values: any[] | Set<any>): this;
424
+ /**
425
+ * Add a "where not in" clause to the query.
426
+ */
427
+ orWhereIn(field: string, values: any[] | Set<any>): this;
428
+ /**
429
+ * Add a "where not in" clause to the query.
430
+ */
431
+ orWhereNotIn(field: string, values: any[] | Set<any>): this;
422
432
  /**
423
433
  * Add a where clause on the primary key to the query.
424
434
  */
@@ -427,6 +437,14 @@ declare class Query<M extends Model = Model> {
427
437
  * Add an "or where" clause to the query.
428
438
  */
429
439
  orWhere(field: WherePrimaryClosure | string, value?: WhereSecondaryClosure | any): this;
440
+ /**
441
+ * Add a "whereNULL" clause to the query.
442
+ */
443
+ whereNull(field: string): this;
444
+ /**
445
+ * Add a "whereNotNULL" clause to the query.
446
+ */
447
+ whereNotNull(field: string): this;
430
448
  /**
431
449
  * Add a "where has" clause to the query.
432
450
  */
@@ -1931,11 +1949,6 @@ declare class Repository<M extends Model = Model> {
1931
1949
  * Get all models from the store.
1932
1950
  */
1933
1951
  all(): Collection<M>;
1934
- /**
1935
- * Find the model with the given id.
1936
- */
1937
- find(id: string | number): Item<M>;
1938
- find(ids: (string | number)[]): Collection<M>;
1939
1952
  /**
1940
1953
  * Retrieves the models from the store by following the given
1941
1954
  * normalized schema.
@@ -1,5 +1,5 @@
1
1
  import * as pinia from 'pinia';
2
- import { Pinia, DefineStoreOptionsBase } from 'pinia';
2
+ import { PiniaPlugin, Pinia, DefineStoreOptionsBase } from 'pinia';
3
3
  import { schema, Schema as Schema$1 } from '@pinia-orm/normalizr';
4
4
  import * as __composables from '@/composables';
5
5
 
@@ -73,9 +73,7 @@ interface CreatePiniaOrm {
73
73
  /**
74
74
  * Install Pinia ORM to the store.
75
75
  */
76
- declare function createORM(options?: InstallOptions): () => {
77
- use(plugin: PiniaOrmPlugin): any;
78
- };
76
+ declare function createORM(options?: InstallOptions): PiniaPlugin;
79
77
 
80
78
  declare abstract class Attribute {
81
79
  /**
@@ -419,6 +417,18 @@ declare class Query<M extends Model = Model> {
419
417
  * Add a "where in" clause to the query.
420
418
  */
421
419
  whereIn(field: string, values: any[] | Set<any>): this;
420
+ /**
421
+ * Add a "where not in" clause to the query.
422
+ */
423
+ whereNotIn(field: string, values: any[] | Set<any>): this;
424
+ /**
425
+ * Add a "where not in" clause to the query.
426
+ */
427
+ orWhereIn(field: string, values: any[] | Set<any>): this;
428
+ /**
429
+ * Add a "where not in" clause to the query.
430
+ */
431
+ orWhereNotIn(field: string, values: any[] | Set<any>): this;
422
432
  /**
423
433
  * Add a where clause on the primary key to the query.
424
434
  */
@@ -427,6 +437,14 @@ declare class Query<M extends Model = Model> {
427
437
  * Add an "or where" clause to the query.
428
438
  */
429
439
  orWhere(field: WherePrimaryClosure | string, value?: WhereSecondaryClosure | any): this;
440
+ /**
441
+ * Add a "whereNULL" clause to the query.
442
+ */
443
+ whereNull(field: string): this;
444
+ /**
445
+ * Add a "whereNotNULL" clause to the query.
446
+ */
447
+ whereNotNull(field: string): this;
430
448
  /**
431
449
  * Add a "where has" clause to the query.
432
450
  */
@@ -1931,11 +1949,6 @@ declare class Repository<M extends Model = Model> {
1931
1949
  * Get all models from the store.
1932
1950
  */
1933
1951
  all(): Collection<M>;
1934
- /**
1935
- * Find the model with the given id.
1936
- */
1937
- find(id: string | number): Item<M>;
1938
- find(ids: (string | number)[]): Collection<M>;
1939
1952
  /**
1940
1953
  * Retrieves the models from the store by following the given
1941
1954
  * normalized schema.
@@ -1,5 +1,5 @@
1
1
  import * as pinia from 'pinia';
2
- import { Pinia, DefineStoreOptionsBase } from 'pinia';
2
+ import { PiniaPlugin, Pinia, DefineStoreOptionsBase } from 'pinia';
3
3
  import { schema, Schema as Schema$1 } from '@pinia-orm/normalizr';
4
4
  import * as __composables from '@/composables';
5
5
 
@@ -73,9 +73,7 @@ interface CreatePiniaOrm {
73
73
  /**
74
74
  * Install Pinia ORM to the store.
75
75
  */
76
- declare function createORM(options?: InstallOptions): () => {
77
- use(plugin: PiniaOrmPlugin): any;
78
- };
76
+ declare function createORM(options?: InstallOptions): PiniaPlugin;
79
77
 
80
78
  declare abstract class Attribute {
81
79
  /**
@@ -419,6 +417,18 @@ declare class Query<M extends Model = Model> {
419
417
  * Add a "where in" clause to the query.
420
418
  */
421
419
  whereIn(field: string, values: any[] | Set<any>): this;
420
+ /**
421
+ * Add a "where not in" clause to the query.
422
+ */
423
+ whereNotIn(field: string, values: any[] | Set<any>): this;
424
+ /**
425
+ * Add a "where not in" clause to the query.
426
+ */
427
+ orWhereIn(field: string, values: any[] | Set<any>): this;
428
+ /**
429
+ * Add a "where not in" clause to the query.
430
+ */
431
+ orWhereNotIn(field: string, values: any[] | Set<any>): this;
422
432
  /**
423
433
  * Add a where clause on the primary key to the query.
424
434
  */
@@ -427,6 +437,14 @@ declare class Query<M extends Model = Model> {
427
437
  * Add an "or where" clause to the query.
428
438
  */
429
439
  orWhere(field: WherePrimaryClosure | string, value?: WhereSecondaryClosure | any): this;
440
+ /**
441
+ * Add a "whereNULL" clause to the query.
442
+ */
443
+ whereNull(field: string): this;
444
+ /**
445
+ * Add a "whereNotNULL" clause to the query.
446
+ */
447
+ whereNotNull(field: string): this;
430
448
  /**
431
449
  * Add a "where has" clause to the query.
432
450
  */
@@ -1931,11 +1949,6 @@ declare class Repository<M extends Model = Model> {
1931
1949
  * Get all models from the store.
1932
1950
  */
1933
1951
  all(): Collection<M>;
1934
- /**
1935
- * Find the model with the given id.
1936
- */
1937
- find(id: string | number): Item<M>;
1938
- find(ids: (string | number)[]): Collection<M>;
1939
1952
  /**
1940
1953
  * Retrieves the models from the store by following the given
1941
1954
  * normalized schema.
@@ -1,5 +1,5 @@
1
1
  import { V1Options } from 'uuid';
2
- import { $ as CastAttribute, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.ed84a779.cjs';
2
+ import { $ as CastAttribute, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.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 { $ as CastAttribute, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.ed84a779.mjs';
2
+ import { $ as CastAttribute, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.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 { $ as CastAttribute, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.ed84a779.js';
2
+ import { $ as CastAttribute, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.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 { $ as CastAttribute, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.ed84a779.cjs';
2
+ import { $ as CastAttribute, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.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 { $ as CastAttribute, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.ed84a779.mjs';
2
+ import { $ as CastAttribute, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.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 { $ as CastAttribute, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.ed84a779.js';
2
+ import { $ as CastAttribute, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.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.0-28581943.45f87aa",
3
+ "version": "1.9.0-28582911.bbf7a93",
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.0-28581943.45f87aa"
49
+ "@pinia-orm/normalizr": "npm:@pinia-orm/normalizr-edge@1.9.0-28582911.bbf7a93"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@nuxt/eslint-config": "^0.3.10",