pinia-orm-edge 1.7.3-28257628.bbb8bab

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.
Files changed (55) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +96 -0
  3. package/dist/casts.cjs +124 -0
  4. package/dist/casts.d.cts +66 -0
  5. package/dist/casts.d.mts +66 -0
  6. package/dist/casts.d.ts +66 -0
  7. package/dist/casts.mjs +118 -0
  8. package/dist/decorators.cjs +219 -0
  9. package/dist/decorators.d.cts +107 -0
  10. package/dist/decorators.d.mts +107 -0
  11. package/dist/decorators.d.ts +107 -0
  12. package/dist/decorators.mjs +198 -0
  13. package/dist/helpers.cjs +69 -0
  14. package/dist/helpers.d.cts +54 -0
  15. package/dist/helpers.d.mts +54 -0
  16. package/dist/helpers.d.ts +54 -0
  17. package/dist/helpers.mjs +61 -0
  18. package/dist/index.cjs +3592 -0
  19. package/dist/index.d.cts +49 -0
  20. package/dist/index.d.mts +49 -0
  21. package/dist/index.d.ts +49 -0
  22. package/dist/index.mjs +3561 -0
  23. package/dist/nanoid/async.cjs +42 -0
  24. package/dist/nanoid/async.d.cts +29 -0
  25. package/dist/nanoid/async.d.mts +29 -0
  26. package/dist/nanoid/async.d.ts +29 -0
  27. package/dist/nanoid/async.mjs +39 -0
  28. package/dist/nanoid/index.cjs +42 -0
  29. package/dist/nanoid/index.d.cts +24 -0
  30. package/dist/nanoid/index.d.mts +24 -0
  31. package/dist/nanoid/index.d.ts +24 -0
  32. package/dist/nanoid/index.mjs +39 -0
  33. package/dist/nanoid/non-secure.cjs +42 -0
  34. package/dist/nanoid/non-secure.d.cts +24 -0
  35. package/dist/nanoid/non-secure.d.mts +24 -0
  36. package/dist/nanoid/non-secure.d.ts +24 -0
  37. package/dist/nanoid/non-secure.mjs +39 -0
  38. package/dist/shared/pinia-orm.1bd7d299.mjs +153 -0
  39. package/dist/shared/pinia-orm.4ff2e12f.mjs +66 -0
  40. package/dist/shared/pinia-orm.876a7cdc.d.cts +1981 -0
  41. package/dist/shared/pinia-orm.876a7cdc.d.mts +1981 -0
  42. package/dist/shared/pinia-orm.876a7cdc.d.ts +1981 -0
  43. package/dist/shared/pinia-orm.a62c4fc4.cjs +167 -0
  44. package/dist/shared/pinia-orm.a7e3e0f3.cjs +68 -0
  45. package/dist/uuid/v1.cjs +41 -0
  46. package/dist/uuid/v1.d.cts +25 -0
  47. package/dist/uuid/v1.d.mts +25 -0
  48. package/dist/uuid/v1.d.ts +25 -0
  49. package/dist/uuid/v1.mjs +38 -0
  50. package/dist/uuid/v4.cjs +41 -0
  51. package/dist/uuid/v4.d.cts +25 -0
  52. package/dist/uuid/v4.d.mts +25 -0
  53. package/dist/uuid/v4.d.ts +25 -0
  54. package/dist/uuid/v4.mjs +38 -0
  55. package/package.json +126 -0
@@ -0,0 +1,49 @@
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.876a7cdc.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.876a7cdc.cjs';
3
+ import { Pinia } from 'pinia';
4
+ import '@pinia-orm/normalizr';
5
+ import '@/composables';
6
+
7
+ declare function useRepo<R extends Repository>(repository: R | Constructor<R>, pinia?: Pinia): R;
8
+ declare function useRepo<M extends Model>(model: Constructor<M>, pinia?: Pinia): Repository<M>;
9
+
10
+ declare function useStoreActions(query?: Query): {
11
+ save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
12
+ insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
13
+ update(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
14
+ fresh(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
15
+ destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
16
+ /**
17
+ * Commit `delete` change to the store.
18
+ */
19
+ delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
20
+ flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
21
+ };
22
+
23
+ type ModelOrRepository<M extends typeof Model, R extends typeof Repository> = M | R;
24
+ type ModelsOrRepositories<M extends typeof Model = any, R extends typeof Repository = any> = Record<string, ModelOrRepository<M, R>>;
25
+ type MappedRepositories<MR extends ModelsOrRepositories> = {
26
+ [K in keyof MR]: MR[K] extends typeof Model ? () => Repository<InstanceType<MR[K]>> : () => InstanceType<MR[K]>;
27
+ };
28
+ /**
29
+ * Map given models or repositories to the Vue Component.
30
+ */
31
+ declare function mapRepos<MR extends ModelsOrRepositories>(modelsOrRepositories: MR): MappedRepositories<MR>;
32
+
33
+ declare const CONFIG_DEFAULTS: {
34
+ model: {
35
+ namespace: string;
36
+ withMeta: boolean;
37
+ hidden: string[];
38
+ visible: string[];
39
+ };
40
+ cache: {
41
+ shared: boolean;
42
+ provider: typeof WeakCache;
43
+ };
44
+ };
45
+ declare const config: FilledInstallOptions & {
46
+ [key: string]: any;
47
+ };
48
+
49
+ export { CONFIG_DEFAULTS, DataStore, Elements, FilledInstallOptions, type MappedRepositories, Model, type ModelOrRepository, type ModelsOrRepositories, Query, Repository, config, mapRepos, useRepo, useStoreActions };
@@ -0,0 +1,49 @@
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.876a7cdc.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.876a7cdc.mjs';
3
+ import { Pinia } from 'pinia';
4
+ import '@pinia-orm/normalizr';
5
+ import '@/composables';
6
+
7
+ declare function useRepo<R extends Repository>(repository: R | Constructor<R>, pinia?: Pinia): R;
8
+ declare function useRepo<M extends Model>(model: Constructor<M>, pinia?: Pinia): Repository<M>;
9
+
10
+ declare function useStoreActions(query?: Query): {
11
+ save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
12
+ insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
13
+ update(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
14
+ fresh(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
15
+ destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
16
+ /**
17
+ * Commit `delete` change to the store.
18
+ */
19
+ delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
20
+ flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
21
+ };
22
+
23
+ type ModelOrRepository<M extends typeof Model, R extends typeof Repository> = M | R;
24
+ type ModelsOrRepositories<M extends typeof Model = any, R extends typeof Repository = any> = Record<string, ModelOrRepository<M, R>>;
25
+ type MappedRepositories<MR extends ModelsOrRepositories> = {
26
+ [K in keyof MR]: MR[K] extends typeof Model ? () => Repository<InstanceType<MR[K]>> : () => InstanceType<MR[K]>;
27
+ };
28
+ /**
29
+ * Map given models or repositories to the Vue Component.
30
+ */
31
+ declare function mapRepos<MR extends ModelsOrRepositories>(modelsOrRepositories: MR): MappedRepositories<MR>;
32
+
33
+ declare const CONFIG_DEFAULTS: {
34
+ model: {
35
+ namespace: string;
36
+ withMeta: boolean;
37
+ hidden: string[];
38
+ visible: string[];
39
+ };
40
+ cache: {
41
+ shared: boolean;
42
+ provider: typeof WeakCache;
43
+ };
44
+ };
45
+ declare const config: FilledInstallOptions & {
46
+ [key: string]: any;
47
+ };
48
+
49
+ export { CONFIG_DEFAULTS, DataStore, Elements, FilledInstallOptions, type MappedRepositories, Model, type ModelOrRepository, type ModelsOrRepositories, Query, Repository, config, mapRepos, useRepo, useStoreActions };
@@ -0,0 +1,49 @@
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.876a7cdc.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.876a7cdc.js';
3
+ import { Pinia } from 'pinia';
4
+ import '@pinia-orm/normalizr';
5
+ import '@/composables';
6
+
7
+ declare function useRepo<R extends Repository>(repository: R | Constructor<R>, pinia?: Pinia): R;
8
+ declare function useRepo<M extends Model>(model: Constructor<M>, pinia?: Pinia): Repository<M>;
9
+
10
+ declare function useStoreActions(query?: Query): {
11
+ save(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
12
+ insert(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
13
+ update(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
14
+ fresh(this: DataStore, records: Elements, triggerQueryAction?: boolean): void;
15
+ destroy(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
16
+ /**
17
+ * Commit `delete` change to the store.
18
+ */
19
+ delete(this: DataStore, ids: (string | number)[], triggerQueryAction?: boolean): void;
20
+ flush(this: DataStore, _records?: Elements, triggerQueryAction?: boolean): void;
21
+ };
22
+
23
+ type ModelOrRepository<M extends typeof Model, R extends typeof Repository> = M | R;
24
+ type ModelsOrRepositories<M extends typeof Model = any, R extends typeof Repository = any> = Record<string, ModelOrRepository<M, R>>;
25
+ type MappedRepositories<MR extends ModelsOrRepositories> = {
26
+ [K in keyof MR]: MR[K] extends typeof Model ? () => Repository<InstanceType<MR[K]>> : () => InstanceType<MR[K]>;
27
+ };
28
+ /**
29
+ * Map given models or repositories to the Vue Component.
30
+ */
31
+ declare function mapRepos<MR extends ModelsOrRepositories>(modelsOrRepositories: MR): MappedRepositories<MR>;
32
+
33
+ declare const CONFIG_DEFAULTS: {
34
+ model: {
35
+ namespace: string;
36
+ withMeta: boolean;
37
+ hidden: string[];
38
+ visible: string[];
39
+ };
40
+ cache: {
41
+ shared: boolean;
42
+ provider: typeof WeakCache;
43
+ };
44
+ };
45
+ declare const config: FilledInstallOptions & {
46
+ [key: string]: any;
47
+ };
48
+
49
+ export { CONFIG_DEFAULTS, DataStore, Elements, FilledInstallOptions, type MappedRepositories, Model, type ModelOrRepository, type ModelsOrRepositories, Query, Repository, config, mapRepos, useRepo, useStoreActions };