pinia-orm-edge 2.0.0-28996302.535a43b → 2.0.0-28996311.a613861

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/index.cjs CHANGED
@@ -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
@@ -8,16 +8,6 @@ import '@/composables';
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
@@ -8,16 +8,6 @@ import '@/composables';
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
@@ -8,16 +8,6 @@ import '@/composables';
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
@@ -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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinia-orm-edge",
3
- "version": "2.0.0-28996302.535a43b",
3
+ "version": "2.0.0-28996311.a613861",
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": "^3.0.1"
47
47
  },
48
48
  "dependencies": {
49
- "@pinia-orm/normalizr": "npm:@pinia-orm/normalizr-edge@2.0.0-28996302.535a43b"
49
+ "@pinia-orm/normalizr": "npm:@pinia-orm/normalizr-edge@2.0.0-28996311.a613861"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@nuxt/eslint-config": "^0.3.13",