pinia-orm-edge 1.10.2-28995616.71fb0dc → 1.10.2-28996937.7b8d6d1

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,6 @@
1
- import { a2 as CastAttribute, q as ModelFields } from './shared/pinia-orm.Bzthh6rU.cjs';
1
+ import { a2 as CastAttribute, q as ModelFields } from './shared/pinia-orm.eiCLbQIe.cjs';
2
2
  import 'pinia';
3
- import 'vue-demi';
3
+ import 'vue';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
6
6
 
package/dist/casts.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { a2 as CastAttribute, q as ModelFields } from './shared/pinia-orm.Bzthh6rU.mjs';
1
+ import { a2 as CastAttribute, q as ModelFields } from './shared/pinia-orm.eiCLbQIe.mjs';
2
2
  import 'pinia';
3
- import 'vue-demi';
3
+ import 'vue';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
6
6
 
package/dist/casts.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { a2 as CastAttribute, q as ModelFields } from './shared/pinia-orm.Bzthh6rU.js';
1
+ import { a2 as CastAttribute, q as ModelFields } from './shared/pinia-orm.eiCLbQIe.js';
2
2
  import 'pinia';
3
- import 'vue-demi';
3
+ import 'vue';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
6
6
 
@@ -1,7 +1,7 @@
1
- import { a3 as TypeDefault, aq as PropertyDecorator, ar as TypeOptions, as as UidOptions, M as Model, w as PrimaryKey, L as deleteModes, a2 as CastAttribute, am as Mutator } from './shared/pinia-orm.Bzthh6rU.cjs';
2
- export { at as NanoidOptions } from './shared/pinia-orm.Bzthh6rU.cjs';
1
+ import { a3 as TypeDefault, aq as PropertyDecorator, ar as TypeOptions, as as UidOptions, M as Model, w as PrimaryKey, L as deleteModes, a2 as CastAttribute, am as Mutator } from './shared/pinia-orm.eiCLbQIe.cjs';
2
+ export { at as NanoidOptions } from './shared/pinia-orm.eiCLbQIe.cjs';
3
3
  import 'pinia';
4
- import 'vue-demi';
4
+ import 'vue';
5
5
  import '@pinia-orm/normalizr';
6
6
  import '@/composables';
7
7
 
@@ -1,7 +1,7 @@
1
- import { a3 as TypeDefault, aq as PropertyDecorator, ar as TypeOptions, as as UidOptions, M as Model, w as PrimaryKey, L as deleteModes, a2 as CastAttribute, am as Mutator } from './shared/pinia-orm.Bzthh6rU.mjs';
2
- export { at as NanoidOptions } from './shared/pinia-orm.Bzthh6rU.mjs';
1
+ import { a3 as TypeDefault, aq as PropertyDecorator, ar as TypeOptions, as as UidOptions, M as Model, w as PrimaryKey, L as deleteModes, a2 as CastAttribute, am as Mutator } from './shared/pinia-orm.eiCLbQIe.mjs';
2
+ export { at as NanoidOptions } from './shared/pinia-orm.eiCLbQIe.mjs';
3
3
  import 'pinia';
4
- import 'vue-demi';
4
+ import 'vue';
5
5
  import '@pinia-orm/normalizr';
6
6
  import '@/composables';
7
7
 
@@ -1,7 +1,7 @@
1
- import { a3 as TypeDefault, aq as PropertyDecorator, ar as TypeOptions, as as UidOptions, M as Model, w as PrimaryKey, L as deleteModes, a2 as CastAttribute, am as Mutator } from './shared/pinia-orm.Bzthh6rU.js';
2
- export { at as NanoidOptions } from './shared/pinia-orm.Bzthh6rU.js';
1
+ import { a3 as TypeDefault, aq as PropertyDecorator, ar as TypeOptions, as as UidOptions, M as Model, w as PrimaryKey, L as deleteModes, a2 as CastAttribute, am as Mutator } from './shared/pinia-orm.eiCLbQIe.js';
2
+ export { at as NanoidOptions } from './shared/pinia-orm.eiCLbQIe.js';
3
3
  import 'pinia';
4
- import 'vue-demi';
4
+ import 'vue';
5
5
  import '@pinia-orm/normalizr';
6
6
  import '@/composables';
7
7
 
@@ -1,6 +1,6 @@
1
- import { M as Model, b as Collection } from './shared/pinia-orm.Bzthh6rU.cjs';
1
+ import { M as Model, b as Collection } from './shared/pinia-orm.eiCLbQIe.cjs';
2
2
  import 'pinia';
3
- import 'vue-demi';
3
+ import 'vue';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
6
6
 
@@ -1,6 +1,6 @@
1
- import { M as Model, b as Collection } from './shared/pinia-orm.Bzthh6rU.mjs';
1
+ import { M as Model, b as Collection } from './shared/pinia-orm.eiCLbQIe.mjs';
2
2
  import 'pinia';
3
- import 'vue-demi';
3
+ import 'vue';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
6
6
 
package/dist/helpers.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { M as Model, b as Collection } from './shared/pinia-orm.Bzthh6rU.js';
1
+ import { M as Model, b as Collection } from './shared/pinia-orm.eiCLbQIe.js';
2
2
  import 'pinia';
3
- import 'vue-demi';
3
+ import 'vue';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
6
6
 
package/dist/index.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  const Utils = require('./shared/pinia-orm.CO4kZz81.cjs');
4
4
  const pinia = require('pinia');
5
5
  const normalizr = require('@pinia-orm/normalizr');
6
- const vueDemi = require('vue-demi');
6
+ const vue = require('vue');
7
7
  const CastAttribute = require('./shared/pinia-orm.DWjxIbAJ.cjs');
8
8
 
9
9
  class Attribute {
@@ -554,7 +554,7 @@ function useDataStore(id, options, customOptions, query) {
554
554
  });
555
555
  }
556
556
  return pinia.defineStore(id, () => ({
557
- data: vueDemi.ref({}),
557
+ data: vue.ref({}),
558
558
  ...useStoreActions(query),
559
559
  ...options
560
560
  }), customOptions);
@@ -1973,16 +1973,6 @@ function useRepo(ModelOrRepository, pinia) {
1973
1973
  return registerPlugins(repository);
1974
1974
  }
1975
1975
 
1976
- function mapRepos(modelsOrRepositories) {
1977
- const repositories = {};
1978
- for (const name in modelsOrRepositories) {
1979
- repositories[name] = function() {
1980
- return useRepo(modelsOrRepositories[name]);
1981
- };
1982
- }
1983
- return repositories;
1984
- }
1985
-
1986
1976
  function createORM(options) {
1987
1977
  config.model = { ...CONFIG_DEFAULTS.model, ...options?.model };
1988
1978
  config.cache = options?.cache === false ? false : { ...CONFIG_DEFAULTS.cache, ...options?.cache !== true && options?.cache };
@@ -3693,7 +3683,6 @@ exports.Type = Type;
3693
3683
  exports.config = config;
3694
3684
  exports.createORM = createORM;
3695
3685
  exports.definePiniaOrmPlugin = definePiniaOrmPlugin;
3696
- exports.mapRepos = mapRepos;
3697
3686
  exports.plugins = plugins;
3698
3687
  exports.registerPlugins = registerPlugins;
3699
3688
  exports.useDataStore = useDataStore;
package/dist/index.d.cts CHANGED
@@ -1,23 +1,13 @@
1
- import { R as Repository, C as Constructor, M as Model, W as WeakCache, F as FilledInstallOptions } from './shared/pinia-orm.Bzthh6rU.cjs';
2
- export { A as AfterHook, J as Attribute, B as BeforeHook, Q as BelongsTo, T as BelongsToMany, ap as CacheConfig, h as CacheConfigOptions, a2 as CastAttribute, a1 as Casts, b as Collection, k as CreatePiniaOrm, d as DataStore, D as DataStoreState, m as Database, K as Dictionary, ak as EagerLoad, al as EagerLoadConstraint, E as Element, a as Elements, a9 as GetElementType, af as Group, ah as GroupBy, ai as GroupByFields, G as GroupedCollection, U as HasMany, X as HasManyBy, Y as HasManyThrough, V as HasOne, z as InheritanceTypes, j as InstallOptions, a5 as Interpreter, I as Item, y as MetaValues, g as ModelConfigOptions, q as ModelFields, x as ModelOptions, t as ModelRegistries, v as ModelRegistry, s as ModelSchemas, Z as MorphMany, a0 as MorphOne, _ as MorphTo, $ as MorphToMany, am as Mutator, an as MutatorFunctions, ao as Mutators, a8 as NonMethodKeys, N as NormalizedData, ae as Order, ag as OrderBy, aj as OrderDirection, i as PiniaConfigOptions, e as PiniaOrmPlugin, P as PiniaOrmPluginContext, w as PrimaryKey, a6 as Query, O as Relation, o as Schema, n as Schemas, S as StoreActions, a4 as Type, a3 as TypeDefault, aa as UltimateKeys, a7 as Where, ad as WhereGroup, ab as WherePrimaryClosure, ac as WhereSecondaryClosure, H as WithKeys, l as createORM, f as definePiniaOrmPlugin, L as deleteModes, p as plugins, r as registerPlugins, c as useDataStore, u as useStoreActions } from './shared/pinia-orm.Bzthh6rU.cjs';
1
+ import { R as Repository, C as Constructor, M as Model, W as WeakCache, F as FilledInstallOptions } from './shared/pinia-orm.eiCLbQIe.cjs';
2
+ export { A as AfterHook, J as Attribute, B as BeforeHook, Q as BelongsTo, T as BelongsToMany, ap as CacheConfig, h as CacheConfigOptions, a2 as CastAttribute, a1 as Casts, b as Collection, k as CreatePiniaOrm, d as DataStore, D as DataStoreState, m as Database, K as Dictionary, ak as EagerLoad, al as EagerLoadConstraint, E as Element, a as Elements, a9 as GetElementType, af as Group, ah as GroupBy, ai as GroupByFields, G as GroupedCollection, U as HasMany, X as HasManyBy, Y as HasManyThrough, V as HasOne, z as InheritanceTypes, j as InstallOptions, a5 as Interpreter, I as Item, y as MetaValues, g as ModelConfigOptions, q as ModelFields, x as ModelOptions, t as ModelRegistries, v as ModelRegistry, s as ModelSchemas, Z as MorphMany, a0 as MorphOne, _ as MorphTo, $ as MorphToMany, am as Mutator, an as MutatorFunctions, ao as Mutators, a8 as NonMethodKeys, N as NormalizedData, ae as Order, ag as OrderBy, aj as OrderDirection, i as PiniaConfigOptions, e as PiniaOrmPlugin, P as PiniaOrmPluginContext, w as PrimaryKey, a6 as Query, O as Relation, o as Schema, n as Schemas, S as StoreActions, a4 as Type, a3 as TypeDefault, aa as UltimateKeys, a7 as Where, ad as WhereGroup, ab as WherePrimaryClosure, ac as WhereSecondaryClosure, H as WithKeys, l as createORM, f as definePiniaOrmPlugin, L as deleteModes, p as plugins, r as registerPlugins, c as useDataStore, u as useStoreActions } from './shared/pinia-orm.eiCLbQIe.cjs';
3
3
  import { Pinia } from 'pinia';
4
- import 'vue-demi';
4
+ import 'vue';
5
5
  import '@pinia-orm/normalizr';
6
6
  import '@/composables';
7
7
 
8
8
  declare function useRepo<R extends Repository<any>>(repository: R | Constructor<R>, pinia?: Pinia): R;
9
9
  declare function useRepo<M extends Model>(model: Constructor<M>, pinia?: Pinia): Repository<M>;
10
10
 
11
- type ModelOrRepository<M extends typeof Model, R extends typeof Repository> = M | R;
12
- type ModelsOrRepositories<M extends typeof Model = any, R extends typeof Repository = any> = Record<string, ModelOrRepository<M, R>>;
13
- type MappedRepositories<MR extends ModelsOrRepositories> = {
14
- [K in keyof MR]: MR[K] extends typeof Model ? () => Repository<InstanceType<MR[K]>> : () => InstanceType<MR[K]>;
15
- };
16
- /**
17
- * Map given models or repositories to the Vue Component.
18
- */
19
- declare function mapRepos<MR extends ModelsOrRepositories>(modelsOrRepositories: MR): MappedRepositories<MR>;
20
-
21
11
  declare const CONFIG_DEFAULTS: {
22
12
  model: {
23
13
  namespace: string;
@@ -37,4 +27,4 @@ declare const config: FilledInstallOptions & {
37
27
  [key: string]: any;
38
28
  };
39
29
 
40
- export { CONFIG_DEFAULTS, Constructor, FilledInstallOptions, type MappedRepositories, Model, type ModelOrRepository, type ModelsOrRepositories, Repository, config, mapRepos, useRepo };
30
+ export { CONFIG_DEFAULTS, Constructor, FilledInstallOptions, Model, Repository, config, useRepo };
package/dist/index.d.mts CHANGED
@@ -1,23 +1,13 @@
1
- import { R as Repository, C as Constructor, M as Model, W as WeakCache, F as FilledInstallOptions } from './shared/pinia-orm.Bzthh6rU.mjs';
2
- export { A as AfterHook, J as Attribute, B as BeforeHook, Q as BelongsTo, T as BelongsToMany, ap as CacheConfig, h as CacheConfigOptions, a2 as CastAttribute, a1 as Casts, b as Collection, k as CreatePiniaOrm, d as DataStore, D as DataStoreState, m as Database, K as Dictionary, ak as EagerLoad, al as EagerLoadConstraint, E as Element, a as Elements, a9 as GetElementType, af as Group, ah as GroupBy, ai as GroupByFields, G as GroupedCollection, U as HasMany, X as HasManyBy, Y as HasManyThrough, V as HasOne, z as InheritanceTypes, j as InstallOptions, a5 as Interpreter, I as Item, y as MetaValues, g as ModelConfigOptions, q as ModelFields, x as ModelOptions, t as ModelRegistries, v as ModelRegistry, s as ModelSchemas, Z as MorphMany, a0 as MorphOne, _ as MorphTo, $ as MorphToMany, am as Mutator, an as MutatorFunctions, ao as Mutators, a8 as NonMethodKeys, N as NormalizedData, ae as Order, ag as OrderBy, aj as OrderDirection, i as PiniaConfigOptions, e as PiniaOrmPlugin, P as PiniaOrmPluginContext, w as PrimaryKey, a6 as Query, O as Relation, o as Schema, n as Schemas, S as StoreActions, a4 as Type, a3 as TypeDefault, aa as UltimateKeys, a7 as Where, ad as WhereGroup, ab as WherePrimaryClosure, ac as WhereSecondaryClosure, H as WithKeys, l as createORM, f as definePiniaOrmPlugin, L as deleteModes, p as plugins, r as registerPlugins, c as useDataStore, u as useStoreActions } from './shared/pinia-orm.Bzthh6rU.mjs';
1
+ import { R as Repository, C as Constructor, M as Model, W as WeakCache, F as FilledInstallOptions } from './shared/pinia-orm.eiCLbQIe.mjs';
2
+ export { A as AfterHook, J as Attribute, B as BeforeHook, Q as BelongsTo, T as BelongsToMany, ap as CacheConfig, h as CacheConfigOptions, a2 as CastAttribute, a1 as Casts, b as Collection, k as CreatePiniaOrm, d as DataStore, D as DataStoreState, m as Database, K as Dictionary, ak as EagerLoad, al as EagerLoadConstraint, E as Element, a as Elements, a9 as GetElementType, af as Group, ah as GroupBy, ai as GroupByFields, G as GroupedCollection, U as HasMany, X as HasManyBy, Y as HasManyThrough, V as HasOne, z as InheritanceTypes, j as InstallOptions, a5 as Interpreter, I as Item, y as MetaValues, g as ModelConfigOptions, q as ModelFields, x as ModelOptions, t as ModelRegistries, v as ModelRegistry, s as ModelSchemas, Z as MorphMany, a0 as MorphOne, _ as MorphTo, $ as MorphToMany, am as Mutator, an as MutatorFunctions, ao as Mutators, a8 as NonMethodKeys, N as NormalizedData, ae as Order, ag as OrderBy, aj as OrderDirection, i as PiniaConfigOptions, e as PiniaOrmPlugin, P as PiniaOrmPluginContext, w as PrimaryKey, a6 as Query, O as Relation, o as Schema, n as Schemas, S as StoreActions, a4 as Type, a3 as TypeDefault, aa as UltimateKeys, a7 as Where, ad as WhereGroup, ab as WherePrimaryClosure, ac as WhereSecondaryClosure, H as WithKeys, l as createORM, f as definePiniaOrmPlugin, L as deleteModes, p as plugins, r as registerPlugins, c as useDataStore, u as useStoreActions } from './shared/pinia-orm.eiCLbQIe.mjs';
3
3
  import { Pinia } from 'pinia';
4
- import 'vue-demi';
4
+ import 'vue';
5
5
  import '@pinia-orm/normalizr';
6
6
  import '@/composables';
7
7
 
8
8
  declare function useRepo<R extends Repository<any>>(repository: R | Constructor<R>, pinia?: Pinia): R;
9
9
  declare function useRepo<M extends Model>(model: Constructor<M>, pinia?: Pinia): Repository<M>;
10
10
 
11
- type ModelOrRepository<M extends typeof Model, R extends typeof Repository> = M | R;
12
- type ModelsOrRepositories<M extends typeof Model = any, R extends typeof Repository = any> = Record<string, ModelOrRepository<M, R>>;
13
- type MappedRepositories<MR extends ModelsOrRepositories> = {
14
- [K in keyof MR]: MR[K] extends typeof Model ? () => Repository<InstanceType<MR[K]>> : () => InstanceType<MR[K]>;
15
- };
16
- /**
17
- * Map given models or repositories to the Vue Component.
18
- */
19
- declare function mapRepos<MR extends ModelsOrRepositories>(modelsOrRepositories: MR): MappedRepositories<MR>;
20
-
21
11
  declare const CONFIG_DEFAULTS: {
22
12
  model: {
23
13
  namespace: string;
@@ -37,4 +27,4 @@ declare const config: FilledInstallOptions & {
37
27
  [key: string]: any;
38
28
  };
39
29
 
40
- export { CONFIG_DEFAULTS, Constructor, FilledInstallOptions, type MappedRepositories, Model, type ModelOrRepository, type ModelsOrRepositories, Repository, config, mapRepos, useRepo };
30
+ export { CONFIG_DEFAULTS, Constructor, FilledInstallOptions, Model, Repository, config, useRepo };
package/dist/index.d.ts CHANGED
@@ -1,23 +1,13 @@
1
- import { R as Repository, C as Constructor, M as Model, W as WeakCache, F as FilledInstallOptions } from './shared/pinia-orm.Bzthh6rU.js';
2
- export { A as AfterHook, J as Attribute, B as BeforeHook, Q as BelongsTo, T as BelongsToMany, ap as CacheConfig, h as CacheConfigOptions, a2 as CastAttribute, a1 as Casts, b as Collection, k as CreatePiniaOrm, d as DataStore, D as DataStoreState, m as Database, K as Dictionary, ak as EagerLoad, al as EagerLoadConstraint, E as Element, a as Elements, a9 as GetElementType, af as Group, ah as GroupBy, ai as GroupByFields, G as GroupedCollection, U as HasMany, X as HasManyBy, Y as HasManyThrough, V as HasOne, z as InheritanceTypes, j as InstallOptions, a5 as Interpreter, I as Item, y as MetaValues, g as ModelConfigOptions, q as ModelFields, x as ModelOptions, t as ModelRegistries, v as ModelRegistry, s as ModelSchemas, Z as MorphMany, a0 as MorphOne, _ as MorphTo, $ as MorphToMany, am as Mutator, an as MutatorFunctions, ao as Mutators, a8 as NonMethodKeys, N as NormalizedData, ae as Order, ag as OrderBy, aj as OrderDirection, i as PiniaConfigOptions, e as PiniaOrmPlugin, P as PiniaOrmPluginContext, w as PrimaryKey, a6 as Query, O as Relation, o as Schema, n as Schemas, S as StoreActions, a4 as Type, a3 as TypeDefault, aa as UltimateKeys, a7 as Where, ad as WhereGroup, ab as WherePrimaryClosure, ac as WhereSecondaryClosure, H as WithKeys, l as createORM, f as definePiniaOrmPlugin, L as deleteModes, p as plugins, r as registerPlugins, c as useDataStore, u as useStoreActions } from './shared/pinia-orm.Bzthh6rU.js';
1
+ import { R as Repository, C as Constructor, M as Model, W as WeakCache, F as FilledInstallOptions } from './shared/pinia-orm.eiCLbQIe.js';
2
+ export { A as AfterHook, J as Attribute, B as BeforeHook, Q as BelongsTo, T as BelongsToMany, ap as CacheConfig, h as CacheConfigOptions, a2 as CastAttribute, a1 as Casts, b as Collection, k as CreatePiniaOrm, d as DataStore, D as DataStoreState, m as Database, K as Dictionary, ak as EagerLoad, al as EagerLoadConstraint, E as Element, a as Elements, a9 as GetElementType, af as Group, ah as GroupBy, ai as GroupByFields, G as GroupedCollection, U as HasMany, X as HasManyBy, Y as HasManyThrough, V as HasOne, z as InheritanceTypes, j as InstallOptions, a5 as Interpreter, I as Item, y as MetaValues, g as ModelConfigOptions, q as ModelFields, x as ModelOptions, t as ModelRegistries, v as ModelRegistry, s as ModelSchemas, Z as MorphMany, a0 as MorphOne, _ as MorphTo, $ as MorphToMany, am as Mutator, an as MutatorFunctions, ao as Mutators, a8 as NonMethodKeys, N as NormalizedData, ae as Order, ag as OrderBy, aj as OrderDirection, i as PiniaConfigOptions, e as PiniaOrmPlugin, P as PiniaOrmPluginContext, w as PrimaryKey, a6 as Query, O as Relation, o as Schema, n as Schemas, S as StoreActions, a4 as Type, a3 as TypeDefault, aa as UltimateKeys, a7 as Where, ad as WhereGroup, ab as WherePrimaryClosure, ac as WhereSecondaryClosure, H as WithKeys, l as createORM, f as definePiniaOrmPlugin, L as deleteModes, p as plugins, r as registerPlugins, c as useDataStore, u as useStoreActions } from './shared/pinia-orm.eiCLbQIe.js';
3
3
  import { Pinia } from 'pinia';
4
- import 'vue-demi';
4
+ import 'vue';
5
5
  import '@pinia-orm/normalizr';
6
6
  import '@/composables';
7
7
 
8
8
  declare function useRepo<R extends Repository<any>>(repository: R | Constructor<R>, pinia?: Pinia): R;
9
9
  declare function useRepo<M extends Model>(model: Constructor<M>, pinia?: Pinia): Repository<M>;
10
10
 
11
- type ModelOrRepository<M extends typeof Model, R extends typeof Repository> = M | R;
12
- type ModelsOrRepositories<M extends typeof Model = any, R extends typeof Repository = any> = Record<string, ModelOrRepository<M, R>>;
13
- type MappedRepositories<MR extends ModelsOrRepositories> = {
14
- [K in keyof MR]: MR[K] extends typeof Model ? () => Repository<InstanceType<MR[K]>> : () => InstanceType<MR[K]>;
15
- };
16
- /**
17
- * Map given models or repositories to the Vue Component.
18
- */
19
- declare function mapRepos<MR extends ModelsOrRepositories>(modelsOrRepositories: MR): MappedRepositories<MR>;
20
-
21
11
  declare const CONFIG_DEFAULTS: {
22
12
  model: {
23
13
  namespace: string;
@@ -37,4 +27,4 @@ declare const config: FilledInstallOptions & {
37
27
  [key: string]: any;
38
28
  };
39
29
 
40
- export { CONFIG_DEFAULTS, Constructor, FilledInstallOptions, type MappedRepositories, Model, type ModelOrRepository, type ModelsOrRepositories, Repository, config, mapRepos, useRepo };
30
+ export { CONFIG_DEFAULTS, Constructor, FilledInstallOptions, Model, Repository, config, useRepo };
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { i as isArray, t as throwError, a as assert, g as generateId, b as isNullish, c as compareWithOperator, d as generateKey, e as isEmpty, f as isFunction, h as groupBy, o as orderBy, j as equals, k as isDate } from './shared/pinia-orm.DGc38JnV.mjs';
2
2
  import { defineStore, acceptHMRUpdate } from 'pinia';
3
3
  import { schema, normalize } from '@pinia-orm/normalizr';
4
- import { ref } from 'vue-demi';
4
+ import { ref } from 'vue';
5
5
  export { C as CastAttribute } from './shared/pinia-orm.C7bM_uXu.mjs';
6
6
 
7
7
  class Attribute {
@@ -1971,16 +1971,6 @@ function useRepo(ModelOrRepository, pinia) {
1971
1971
  return registerPlugins(repository);
1972
1972
  }
1973
1973
 
1974
- function mapRepos(modelsOrRepositories) {
1975
- const repositories = {};
1976
- for (const name in modelsOrRepositories) {
1977
- repositories[name] = function() {
1978
- return useRepo(modelsOrRepositories[name]);
1979
- };
1980
- }
1981
- return repositories;
1982
- }
1983
-
1984
1974
  function createORM(options) {
1985
1975
  config.model = { ...CONFIG_DEFAULTS.model, ...options?.model };
1986
1976
  config.cache = options?.cache === false ? false : { ...CONFIG_DEFAULTS.cache, ...options?.cache !== true && options?.cache };
@@ -3667,4 +3657,4 @@ class Model {
3667
3657
  }
3668
3658
  }
3669
3659
 
3670
- export { Attribute, BelongsTo, BelongsToMany, CONFIG_DEFAULTS, Database, HasMany, HasManyBy, HasManyThrough, HasOne, Interpreter, Model, MorphMany, MorphOne, MorphTo, MorphToMany, Query, Relation, Repository, Schema, Type, config, createORM, definePiniaOrmPlugin, mapRepos, plugins, registerPlugins, useDataStore, useRepo, useStoreActions };
3660
+ export { Attribute, BelongsTo, BelongsToMany, CONFIG_DEFAULTS, Database, HasMany, HasManyBy, HasManyThrough, HasOne, Interpreter, Model, MorphMany, MorphOne, MorphTo, MorphToMany, Query, Relation, Repository, Schema, Type, config, createORM, definePiniaOrmPlugin, plugins, registerPlugins, useDataStore, useRepo, useStoreActions };
@@ -1,6 +1,6 @@
1
- import { a2 as CastAttribute, at as NanoidOptions, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.Bzthh6rU.cjs';
1
+ import { a2 as CastAttribute, at as NanoidOptions, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.eiCLbQIe.cjs';
2
2
  import 'pinia';
3
- import 'vue-demi';
3
+ import 'vue';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
6
6
 
@@ -1,6 +1,6 @@
1
- import { a2 as CastAttribute, at as NanoidOptions, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.Bzthh6rU.mjs';
1
+ import { a2 as CastAttribute, at as NanoidOptions, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.eiCLbQIe.mjs';
2
2
  import 'pinia';
3
- import 'vue-demi';
3
+ import 'vue';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
6
6
 
@@ -1,6 +1,6 @@
1
- import { a2 as CastAttribute, at as NanoidOptions, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.Bzthh6rU.js';
1
+ import { a2 as CastAttribute, at as NanoidOptions, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.eiCLbQIe.js';
2
2
  import 'pinia';
3
- import 'vue-demi';
3
+ import 'vue';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
6
6
 
@@ -1,6 +1,6 @@
1
- import { a2 as CastAttribute, at as NanoidOptions, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.Bzthh6rU.cjs';
1
+ import { a2 as CastAttribute, at as NanoidOptions, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.eiCLbQIe.cjs';
2
2
  import 'pinia';
3
- import 'vue-demi';
3
+ import 'vue';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
6
6
 
@@ -1,6 +1,6 @@
1
- import { a2 as CastAttribute, at as NanoidOptions, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.Bzthh6rU.mjs';
1
+ import { a2 as CastAttribute, at as NanoidOptions, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.eiCLbQIe.mjs';
2
2
  import 'pinia';
3
- import 'vue-demi';
3
+ import 'vue';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
6
6
 
@@ -1,6 +1,6 @@
1
- import { a2 as CastAttribute, at as NanoidOptions, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.Bzthh6rU.js';
1
+ import { a2 as CastAttribute, at as NanoidOptions, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.eiCLbQIe.js';
2
2
  import 'pinia';
3
- import 'vue-demi';
3
+ import 'vue';
4
4
  import '@pinia-orm/normalizr';
5
5
  import '@/composables';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import * as pinia from 'pinia';
2
2
  import { PiniaPlugin, DefineStoreOptionsBase, DefineSetupStoreOptions, Pinia } from 'pinia';
3
- import * as vue_demi from 'vue-demi';
3
+ import * as vue from 'vue';
4
4
  import { schema, Schema as Schema$1 } from '@pinia-orm/normalizr';
5
5
  import * as __composables from '@/composables';
6
6
 
@@ -301,7 +301,7 @@ declare class Interpreter {
301
301
  private getSchema;
302
302
  }
303
303
 
304
- declare function useDataStore<S extends DataStoreState, T extends DataStore = DataStore>(id: string, options: DefineStoreOptionsBase<S, T>, customOptions?: DefineSetupStoreOptions<string, S, T, any>, query?: Query<any>): pinia.StoreDefinition<string, pinia._UnwrapAll<Pick<{
304
+ declare function useDataStore<S extends DataStoreState, T extends DataStore = DataStore>(id: string, options: DefineStoreOptionsBase<S, T>, customOptions?: DefineSetupStoreOptions<string, S, T, any>, query?: Query<any>): pinia.StoreDefinition<string, Pick<{
305
305
  save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
306
306
  insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
307
307
  update(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
@@ -309,8 +309,8 @@ declare function useDataStore<S extends DataStoreState, T extends DataStore = Da
309
309
  destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
310
310
  delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
311
311
  flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
312
- data: vue_demi.Ref<Record<string, any>>;
313
- }, "data">>, Pick<{
312
+ data: vue.Ref<Record<string, any>, Record<string, any>>;
313
+ }, "data">, Pick<{
314
314
  save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
315
315
  insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
316
316
  update(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
@@ -318,7 +318,7 @@ declare function useDataStore<S extends DataStoreState, T extends DataStore = Da
318
318
  destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
319
319
  delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
320
320
  flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
321
- data: vue_demi.Ref<Record<string, any>>;
321
+ data: vue.Ref<Record<string, any>, Record<string, any>>;
322
322
  }, never>, Pick<{
323
323
  save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
324
324
  insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
@@ -327,7 +327,7 @@ declare function useDataStore<S extends DataStoreState, T extends DataStore = Da
327
327
  destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
328
328
  delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
329
329
  flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
330
- data: vue_demi.Ref<Record<string, any>>;
330
+ data: vue.Ref<Record<string, any>, Record<string, any>>;
331
331
  }, "insert" | "flush" | "delete" | "update" | "destroy" | "save" | "fresh">>;
332
332
  interface DataStoreState {
333
333
  data: Record<string, any>;
@@ -1952,7 +1952,7 @@ declare class Repository<M extends Model = Model> {
1952
1952
  /**
1953
1953
  * Returns the pinia store used with this model
1954
1954
  */
1955
- piniaStore<S extends DataStoreState = DataStoreState>(): pinia.Store<string, pinia._UnwrapAll<Pick<{
1955
+ piniaStore<S extends DataStoreState = DataStoreState>(): pinia.Store<string, Pick<{
1956
1956
  save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
1957
1957
  insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
1958
1958
  update(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
@@ -1960,8 +1960,8 @@ declare class Repository<M extends Model = Model> {
1960
1960
  destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
1961
1961
  delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
1962
1962
  flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
1963
- data: vue_demi.Ref<Record<string, any>>;
1964
- }, "data">>, Pick<{
1963
+ data: vue.Ref<Record<string, any>, Record<string, any>>;
1964
+ }, "data">, Pick<{
1965
1965
  save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
1966
1966
  insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
1967
1967
  update(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
@@ -1969,7 +1969,7 @@ declare class Repository<M extends Model = Model> {
1969
1969
  destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
1970
1970
  delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
1971
1971
  flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
1972
- data: vue_demi.Ref<Record<string, any>>;
1972
+ data: vue.Ref<Record<string, any>, Record<string, any>>;
1973
1973
  }, never>, Pick<{
1974
1974
  save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
1975
1975
  insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
@@ -1978,7 +1978,7 @@ declare class Repository<M extends Model = Model> {
1978
1978
  destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
1979
1979
  delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
1980
1980
  flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
1981
- data: vue_demi.Ref<Record<string, any>>;
1981
+ data: vue.Ref<Record<string, any>, Record<string, any>>;
1982
1982
  }, "insert" | "flush" | "delete" | "update" | "destroy" | "save" | "fresh">>;
1983
1983
  /**
1984
1984
  * Create a new repository with the given model.
@@ -1,6 +1,6 @@
1
1
  import * as pinia from 'pinia';
2
2
  import { PiniaPlugin, DefineStoreOptionsBase, DefineSetupStoreOptions, Pinia } from 'pinia';
3
- import * as vue_demi from 'vue-demi';
3
+ import * as vue from 'vue';
4
4
  import { schema, Schema as Schema$1 } from '@pinia-orm/normalizr';
5
5
  import * as __composables from '@/composables';
6
6
 
@@ -301,7 +301,7 @@ declare class Interpreter {
301
301
  private getSchema;
302
302
  }
303
303
 
304
- declare function useDataStore<S extends DataStoreState, T extends DataStore = DataStore>(id: string, options: DefineStoreOptionsBase<S, T>, customOptions?: DefineSetupStoreOptions<string, S, T, any>, query?: Query<any>): pinia.StoreDefinition<string, pinia._UnwrapAll<Pick<{
304
+ declare function useDataStore<S extends DataStoreState, T extends DataStore = DataStore>(id: string, options: DefineStoreOptionsBase<S, T>, customOptions?: DefineSetupStoreOptions<string, S, T, any>, query?: Query<any>): pinia.StoreDefinition<string, Pick<{
305
305
  save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
306
306
  insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
307
307
  update(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
@@ -309,8 +309,8 @@ declare function useDataStore<S extends DataStoreState, T extends DataStore = Da
309
309
  destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
310
310
  delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
311
311
  flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
312
- data: vue_demi.Ref<Record<string, any>>;
313
- }, "data">>, Pick<{
312
+ data: vue.Ref<Record<string, any>, Record<string, any>>;
313
+ }, "data">, Pick<{
314
314
  save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
315
315
  insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
316
316
  update(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
@@ -318,7 +318,7 @@ declare function useDataStore<S extends DataStoreState, T extends DataStore = Da
318
318
  destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
319
319
  delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
320
320
  flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
321
- data: vue_demi.Ref<Record<string, any>>;
321
+ data: vue.Ref<Record<string, any>, Record<string, any>>;
322
322
  }, never>, Pick<{
323
323
  save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
324
324
  insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
@@ -327,7 +327,7 @@ declare function useDataStore<S extends DataStoreState, T extends DataStore = Da
327
327
  destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
328
328
  delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
329
329
  flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
330
- data: vue_demi.Ref<Record<string, any>>;
330
+ data: vue.Ref<Record<string, any>, Record<string, any>>;
331
331
  }, "insert" | "flush" | "delete" | "update" | "destroy" | "save" | "fresh">>;
332
332
  interface DataStoreState {
333
333
  data: Record<string, any>;
@@ -1952,7 +1952,7 @@ declare class Repository<M extends Model = Model> {
1952
1952
  /**
1953
1953
  * Returns the pinia store used with this model
1954
1954
  */
1955
- piniaStore<S extends DataStoreState = DataStoreState>(): pinia.Store<string, pinia._UnwrapAll<Pick<{
1955
+ piniaStore<S extends DataStoreState = DataStoreState>(): pinia.Store<string, Pick<{
1956
1956
  save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
1957
1957
  insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
1958
1958
  update(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
@@ -1960,8 +1960,8 @@ declare class Repository<M extends Model = Model> {
1960
1960
  destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
1961
1961
  delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
1962
1962
  flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
1963
- data: vue_demi.Ref<Record<string, any>>;
1964
- }, "data">>, Pick<{
1963
+ data: vue.Ref<Record<string, any>, Record<string, any>>;
1964
+ }, "data">, Pick<{
1965
1965
  save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
1966
1966
  insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
1967
1967
  update(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
@@ -1969,7 +1969,7 @@ declare class Repository<M extends Model = Model> {
1969
1969
  destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
1970
1970
  delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
1971
1971
  flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
1972
- data: vue_demi.Ref<Record<string, any>>;
1972
+ data: vue.Ref<Record<string, any>, Record<string, any>>;
1973
1973
  }, never>, Pick<{
1974
1974
  save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
1975
1975
  insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
@@ -1978,7 +1978,7 @@ declare class Repository<M extends Model = Model> {
1978
1978
  destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
1979
1979
  delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
1980
1980
  flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
1981
- data: vue_demi.Ref<Record<string, any>>;
1981
+ data: vue.Ref<Record<string, any>, Record<string, any>>;
1982
1982
  }, "insert" | "flush" | "delete" | "update" | "destroy" | "save" | "fresh">>;
1983
1983
  /**
1984
1984
  * Create a new repository with the given model.
@@ -1,6 +1,6 @@
1
1
  import * as pinia from 'pinia';
2
2
  import { PiniaPlugin, DefineStoreOptionsBase, DefineSetupStoreOptions, Pinia } from 'pinia';
3
- import * as vue_demi from 'vue-demi';
3
+ import * as vue from 'vue';
4
4
  import { schema, Schema as Schema$1 } from '@pinia-orm/normalizr';
5
5
  import * as __composables from '@/composables';
6
6
 
@@ -301,7 +301,7 @@ declare class Interpreter {
301
301
  private getSchema;
302
302
  }
303
303
 
304
- declare function useDataStore<S extends DataStoreState, T extends DataStore = DataStore>(id: string, options: DefineStoreOptionsBase<S, T>, customOptions?: DefineSetupStoreOptions<string, S, T, any>, query?: Query<any>): pinia.StoreDefinition<string, pinia._UnwrapAll<Pick<{
304
+ declare function useDataStore<S extends DataStoreState, T extends DataStore = DataStore>(id: string, options: DefineStoreOptionsBase<S, T>, customOptions?: DefineSetupStoreOptions<string, S, T, any>, query?: Query<any>): pinia.StoreDefinition<string, Pick<{
305
305
  save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
306
306
  insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
307
307
  update(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
@@ -309,8 +309,8 @@ declare function useDataStore<S extends DataStoreState, T extends DataStore = Da
309
309
  destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
310
310
  delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
311
311
  flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
312
- data: vue_demi.Ref<Record<string, any>>;
313
- }, "data">>, Pick<{
312
+ data: vue.Ref<Record<string, any>, Record<string, any>>;
313
+ }, "data">, Pick<{
314
314
  save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
315
315
  insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
316
316
  update(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
@@ -318,7 +318,7 @@ declare function useDataStore<S extends DataStoreState, T extends DataStore = Da
318
318
  destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
319
319
  delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
320
320
  flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
321
- data: vue_demi.Ref<Record<string, any>>;
321
+ data: vue.Ref<Record<string, any>, Record<string, any>>;
322
322
  }, never>, Pick<{
323
323
  save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
324
324
  insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
@@ -327,7 +327,7 @@ declare function useDataStore<S extends DataStoreState, T extends DataStore = Da
327
327
  destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
328
328
  delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
329
329
  flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
330
- data: vue_demi.Ref<Record<string, any>>;
330
+ data: vue.Ref<Record<string, any>, Record<string, any>>;
331
331
  }, "insert" | "flush" | "delete" | "update" | "destroy" | "save" | "fresh">>;
332
332
  interface DataStoreState {
333
333
  data: Record<string, any>;
@@ -1952,7 +1952,7 @@ declare class Repository<M extends Model = Model> {
1952
1952
  /**
1953
1953
  * Returns the pinia store used with this model
1954
1954
  */
1955
- piniaStore<S extends DataStoreState = DataStoreState>(): pinia.Store<string, pinia._UnwrapAll<Pick<{
1955
+ piniaStore<S extends DataStoreState = DataStoreState>(): pinia.Store<string, Pick<{
1956
1956
  save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
1957
1957
  insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
1958
1958
  update(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
@@ -1960,8 +1960,8 @@ declare class Repository<M extends Model = Model> {
1960
1960
  destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
1961
1961
  delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
1962
1962
  flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
1963
- data: vue_demi.Ref<Record<string, any>>;
1964
- }, "data">>, Pick<{
1963
+ data: vue.Ref<Record<string, any>, Record<string, any>>;
1964
+ }, "data">, Pick<{
1965
1965
  save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
1966
1966
  insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
1967
1967
  update(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
@@ -1969,7 +1969,7 @@ declare class Repository<M extends Model = Model> {
1969
1969
  destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
1970
1970
  delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
1971
1971
  flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
1972
- data: vue_demi.Ref<Record<string, any>>;
1972
+ data: vue.Ref<Record<string, any>, Record<string, any>>;
1973
1973
  }, never>, Pick<{
1974
1974
  save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
1975
1975
  insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
@@ -1978,7 +1978,7 @@ declare class Repository<M extends Model = Model> {
1978
1978
  destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
1979
1979
  delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
1980
1980
  flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
1981
- data: vue_demi.Ref<Record<string, any>>;
1981
+ data: vue.Ref<Record<string, any>, Record<string, any>>;
1982
1982
  }, "insert" | "flush" | "delete" | "update" | "destroy" | "save" | "fresh">>;
1983
1983
  /**
1984
1984
  * Create a new repository with the given model.
@@ -1,7 +1,7 @@
1
1
  import { V1Options } from 'uuid';
2
- import { a2 as CastAttribute, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.Bzthh6rU.cjs';
2
+ import { a2 as CastAttribute, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.eiCLbQIe.cjs';
3
3
  import 'pinia';
4
- import 'vue-demi';
4
+ import 'vue';
5
5
  import '@pinia-orm/normalizr';
6
6
  import '@/composables';
7
7
 
@@ -1,7 +1,7 @@
1
1
  import { V1Options } from 'uuid';
2
- import { a2 as CastAttribute, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.Bzthh6rU.mjs';
2
+ import { a2 as CastAttribute, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.eiCLbQIe.mjs';
3
3
  import 'pinia';
4
- import 'vue-demi';
4
+ import 'vue';
5
5
  import '@pinia-orm/normalizr';
6
6
  import '@/composables';
7
7
 
package/dist/uuid/v1.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { V1Options } from 'uuid';
2
- import { a2 as CastAttribute, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.Bzthh6rU.js';
2
+ import { a2 as CastAttribute, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.eiCLbQIe.js';
3
3
  import 'pinia';
4
- import 'vue-demi';
4
+ import 'vue';
5
5
  import '@pinia-orm/normalizr';
6
6
  import '@/composables';
7
7
 
@@ -1,7 +1,7 @@
1
1
  import { V4Options } from 'uuid';
2
- import { a2 as CastAttribute, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.Bzthh6rU.cjs';
2
+ import { a2 as CastAttribute, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.eiCLbQIe.cjs';
3
3
  import 'pinia';
4
- import 'vue-demi';
4
+ import 'vue';
5
5
  import '@pinia-orm/normalizr';
6
6
  import '@/composables';
7
7
 
@@ -1,7 +1,7 @@
1
1
  import { V4Options } from 'uuid';
2
- import { a2 as CastAttribute, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.Bzthh6rU.mjs';
2
+ import { a2 as CastAttribute, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.eiCLbQIe.mjs';
3
3
  import 'pinia';
4
- import 'vue-demi';
4
+ import 'vue';
5
5
  import '@pinia-orm/normalizr';
6
6
  import '@/composables';
7
7
 
package/dist/uuid/v4.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { V4Options } from 'uuid';
2
- import { a2 as CastAttribute, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.Bzthh6rU.js';
2
+ import { a2 as CastAttribute, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.eiCLbQIe.js';
3
3
  import 'pinia';
4
- import 'vue-demi';
4
+ import 'vue';
5
5
  import '@pinia-orm/normalizr';
6
6
  import '@/composables';
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinia-orm-edge",
3
- "version": "1.10.2-28995616.71fb0dc",
3
+ "version": "1.10.2-28996937.7b8d6d1",
4
4
  "description": "The Pinia plugin to enable Object-Relational Mapping access to the Pinia Store.",
5
5
  "keywords": [
6
6
  "vue",
@@ -43,11 +43,10 @@
43
43
  "README.md"
44
44
  ],
45
45
  "peerDependencies": {
46
- "pinia": "^2.1.7"
46
+ "pinia": "^3.0.1"
47
47
  },
48
48
  "dependencies": {
49
- "@pinia-orm/normalizr": "npm:@pinia-orm/normalizr-edge@1.10.2-28995616.71fb0dc",
50
- "vue-demi": "^0.14.10"
49
+ "@pinia-orm/normalizr": "npm:@pinia-orm/normalizr-edge@1.10.2-28996937.7b8d6d1"
51
50
  },
52
51
  "devDependencies": {
53
52
  "@nuxt/eslint-config": "^0.3.13",
@@ -67,8 +66,8 @@
67
66
  "eslint": "^9.6.0",
68
67
  "happy-dom": "^16.0.1",
69
68
  "mkdist": "^2.1.0",
70
- "nanoid": "4.0.2",
71
- "pinia": "^2.1.7",
69
+ "nanoid": "^5.1.0",
70
+ "pinia": "^3.0.1",
72
71
  "prettier": "^3.3.2",
73
72
  "size-limit": "^11.1.4",
74
73
  "std-env": "^3.7.0",
@@ -78,8 +77,7 @@
78
77
  "uuid": "^10.0.0",
79
78
  "vite": "^5.3.3",
80
79
  "vitest": "^3.0.5",
81
- "vue": "^3.4.31",
82
- "vue2": "npm:vue@^2.7.3"
80
+ "vue": "^3.5.13"
83
81
  },
84
82
  "size-limit": [
85
83
  {
@@ -114,14 +112,12 @@
114
112
  "scripts": {
115
113
  "build": "unbuild",
116
114
  "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --commit-path . -l pinia-orm -r 1",
117
- "coverage": "vue-demi-switch 3 && vitest --run --coverage",
115
+ "coverage": "vitest --run --coverage",
118
116
  "size": "size-limit",
119
117
  "lint": "eslint . --cache",
120
118
  "lint:fix": "eslint . --cache --fix",
121
- "test:ui": "vue-demi-switch 3 && vitest --ui --api 9527",
122
- "test:watch": "vue-demi-switch 3 && vitest --watch",
123
- "test:2": "vue-demi-switch 2 vue2 && vitest --run",
124
- "test:3": "vue-demi-switch 3 && vitest --run",
125
- "test": "pnpm run test:3"
119
+ "test:ui": "vitest --ui --api 9527",
120
+ "test:watch": "vitest --watch",
121
+ "test": "vitest --run"
126
122
  }
127
123
  }
@@ -1,36 +0,0 @@
1
- 'use strict';
2
-
3
- const async = require('nanoid/async');
4
- const CastAttribute = require('../shared/pinia-orm.DWjxIbAJ.cjs');
5
-
6
- class UidCast extends CastAttribute.CastAttribute {
7
- static parameters;
8
- /**
9
- * Create a new String attribute instance.
10
- */
11
- constructor(attributes) {
12
- super(attributes);
13
- }
14
- static withParameters(parameters) {
15
- this.parameters = parameters;
16
- return this;
17
- }
18
- /**
19
- * Make the value for the attribute.
20
- */
21
- async set(value) {
22
- const nanoid = this.$parameters?.alphabet ? async.customAlphabet(this.$parameters.alphabet) : async.nanoid;
23
- return value ?? await nanoid(this.$parameters?.size);
24
- }
25
- }
26
-
27
- function Uid(options) {
28
- return (target, propertyKey) => {
29
- const self = target.$self();
30
- self.setCast(propertyKey, UidCast.withParameters(options));
31
- self.setRegistry(propertyKey, () => self.uid());
32
- };
33
- }
34
-
35
- exports.Uid = Uid;
36
- exports.UidCast = UidCast;
@@ -1,30 +0,0 @@
1
- import { a2 as CastAttribute, at as NanoidOptions, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.Bzthh6rU.cjs';
2
- import 'pinia';
3
- import 'vue-demi';
4
- import '@pinia-orm/normalizr';
5
- import '@/composables';
6
-
7
- /**
8
- * Create a cast nanoid/async.
9
- * @deprecated will be removed in v2 because nanoid v5 dropped it
10
- */
11
- declare class UidCast extends CastAttribute {
12
- static parameters?: NanoidOptions;
13
- /**
14
- * Create a new String attribute instance.
15
- */
16
- constructor(attributes: ModelFields);
17
- static withParameters(parameters?: NanoidOptions): typeof CastAttribute;
18
- /**
19
- * Make the value for the attribute.
20
- */
21
- set(value: any): Promise<string | null>;
22
- }
23
-
24
- /**
25
- * Creates an uuid based on nanoid/async.
26
- * @deprecated will be removed in v2 because nanoid v5 dropped it
27
- */
28
- declare function Uid(options?: NanoidOptions): PropertyDecorator;
29
-
30
- export { Uid, UidCast };
@@ -1,30 +0,0 @@
1
- import { a2 as CastAttribute, at as NanoidOptions, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.Bzthh6rU.mjs';
2
- import 'pinia';
3
- import 'vue-demi';
4
- import '@pinia-orm/normalizr';
5
- import '@/composables';
6
-
7
- /**
8
- * Create a cast nanoid/async.
9
- * @deprecated will be removed in v2 because nanoid v5 dropped it
10
- */
11
- declare class UidCast extends CastAttribute {
12
- static parameters?: NanoidOptions;
13
- /**
14
- * Create a new String attribute instance.
15
- */
16
- constructor(attributes: ModelFields);
17
- static withParameters(parameters?: NanoidOptions): typeof CastAttribute;
18
- /**
19
- * Make the value for the attribute.
20
- */
21
- set(value: any): Promise<string | null>;
22
- }
23
-
24
- /**
25
- * Creates an uuid based on nanoid/async.
26
- * @deprecated will be removed in v2 because nanoid v5 dropped it
27
- */
28
- declare function Uid(options?: NanoidOptions): PropertyDecorator;
29
-
30
- export { Uid, UidCast };
@@ -1,30 +0,0 @@
1
- import { a2 as CastAttribute, at as NanoidOptions, q as ModelFields, aq as PropertyDecorator } from '../shared/pinia-orm.Bzthh6rU.js';
2
- import 'pinia';
3
- import 'vue-demi';
4
- import '@pinia-orm/normalizr';
5
- import '@/composables';
6
-
7
- /**
8
- * Create a cast nanoid/async.
9
- * @deprecated will be removed in v2 because nanoid v5 dropped it
10
- */
11
- declare class UidCast extends CastAttribute {
12
- static parameters?: NanoidOptions;
13
- /**
14
- * Create a new String attribute instance.
15
- */
16
- constructor(attributes: ModelFields);
17
- static withParameters(parameters?: NanoidOptions): typeof CastAttribute;
18
- /**
19
- * Make the value for the attribute.
20
- */
21
- set(value: any): Promise<string | null>;
22
- }
23
-
24
- /**
25
- * Creates an uuid based on nanoid/async.
26
- * @deprecated will be removed in v2 because nanoid v5 dropped it
27
- */
28
- declare function Uid(options?: NanoidOptions): PropertyDecorator;
29
-
30
- export { Uid, UidCast };
@@ -1,33 +0,0 @@
1
- import { customAlphabet, nanoid } from 'nanoid/async';
2
- import { C as CastAttribute } from '../shared/pinia-orm.C7bM_uXu.mjs';
3
-
4
- class UidCast extends CastAttribute {
5
- static parameters;
6
- /**
7
- * Create a new String attribute instance.
8
- */
9
- constructor(attributes) {
10
- super(attributes);
11
- }
12
- static withParameters(parameters) {
13
- this.parameters = parameters;
14
- return this;
15
- }
16
- /**
17
- * Make the value for the attribute.
18
- */
19
- async set(value) {
20
- const nanoid$1 = this.$parameters?.alphabet ? customAlphabet(this.$parameters.alphabet) : nanoid;
21
- return value ?? await nanoid$1(this.$parameters?.size);
22
- }
23
- }
24
-
25
- function Uid(options) {
26
- return (target, propertyKey) => {
27
- const self = target.$self();
28
- self.setCast(propertyKey, UidCast.withParameters(options));
29
- self.setRegistry(propertyKey, () => self.uid());
30
- };
31
- }
32
-
33
- export { Uid, UidCast };