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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  import * as pinia from 'pinia';
2
2
  import { PiniaPlugin, Pinia, DefineStoreOptionsBase } from 'pinia';
3
3
  import { schema, Schema as Schema$1 } from '@pinia-orm/normalizr';
4
+ import { Model as Model$1, WithKeys as WithKeys$1 } from '@/model/Model';
4
5
  import * as __composables from '@/composables';
5
6
 
6
7
  interface Constructor<T> {
@@ -290,13 +291,20 @@ declare class Interpreter {
290
291
  private getSchema;
291
292
  }
292
293
 
293
- interface Where {
294
- field: WherePrimaryClosure | string;
295
- value: WhereSecondaryClosure | any;
294
+ interface Where<T = Model$1> {
295
+ field: WherePrimaryClosure<T> | NonMethodKeys<T> | string | string[];
296
+ value: WhereSecondaryClosure<T> | any;
296
297
  boolean: 'and' | 'or';
297
298
  }
298
- type WherePrimaryClosure = (model: any) => boolean;
299
- type WhereSecondaryClosure = (value: any) => boolean;
299
+ type NonMethodKeys<T> = {
300
+ [P in keyof T]: T[P] extends Function ? never : P;
301
+ }[keyof T];
302
+ type GetElementType<T extends unknown[] | unknown> = T extends (infer U)[] ? U : T;
303
+ type UltimateKeys<M> = {
304
+ [T in keyof M]: M[T] extends Model$1 | Model$1[] | null ? GetElementType<NonNullable<M[T]>> : never;
305
+ };
306
+ type WherePrimaryClosure<T> = (model: T) => boolean;
307
+ type WhereSecondaryClosure<T> = (value: T) => boolean;
300
308
  interface WhereGroup {
301
309
  and?: Where[];
302
310
  or?: Where[];
@@ -312,10 +320,10 @@ type OrderBy = string | ((model: any) => any);
312
320
  type GroupBy = string;
313
321
  type GroupByFields = string[];
314
322
  type OrderDirection = 'asc' | 'desc';
315
- interface EagerLoad {
316
- [name: string]: EagerLoadConstraint;
317
- }
318
- type EagerLoadConstraint = (query: Query) => void;
323
+ type EagerLoad<M extends Model$1> = {
324
+ [K in keyof M]: EagerLoadConstraint<GetElementType<M[WithKeys$1<M>] extends Model$1 ? M[WithKeys$1<M>] : never>>;
325
+ };
326
+ type EagerLoadConstraint<M extends Model$1> = (query: Query<M>) => void;
319
327
 
320
328
  declare class Query<M extends Model = Model> {
321
329
  /**
@@ -329,7 +337,7 @@ declare class Query<M extends Model = Model> {
329
337
  /**
330
338
  * The where constraints for the query.
331
339
  */
332
- protected wheres: Where[];
340
+ protected wheres: Where<M>[];
333
341
  /**
334
342
  * The orderings for the query.
335
343
  */
@@ -361,7 +369,7 @@ declare class Query<M extends Model = Model> {
361
369
  /**
362
370
  * The relationships that should be eager loaded.
363
371
  */
364
- protected eagerLoad: EagerLoad;
372
+ protected eagerLoad: EagerLoad<M> | {};
365
373
  /**
366
374
  * The pinia store.
367
375
  */
@@ -380,15 +388,15 @@ declare class Query<M extends Model = Model> {
380
388
  /**
381
389
  * Create a new query instance for the given model.
382
390
  */
383
- newQuery(model: string): Query;
391
+ newQuery(model: string): Query<M>;
384
392
  /**
385
393
  * Create a new query instance with constraints for the given model.
386
394
  */
387
- newQueryWithConstraints(model: string): Query;
395
+ newQueryWithConstraints(model: string): Query<M>;
388
396
  /**
389
397
  * Create a new query instance from the given relation.
390
398
  */
391
- newQueryForRelation(relation: Relation): Query;
399
+ newQueryForRelation(relation: Relation): Query<M>;
392
400
  /**
393
401
  * Create a new interpreter instance.
394
402
  */
@@ -412,11 +420,11 @@ declare class Query<M extends Model = Model> {
412
420
  /**
413
421
  * Add a basic where clause to the query.
414
422
  */
415
- where(field: WherePrimaryClosure | string, value?: WhereSecondaryClosure | any): this;
423
+ where<T extends WherePrimaryClosure<M> | NonMethodKeys<M> | string[] | (string & {})>(field: T, value?: T extends string[] ? string | number | (string | number)[] : WhereSecondaryClosure<M[T extends keyof M ? T : never]> | M[T extends keyof M ? T : never] | null): this;
416
424
  /**
417
425
  * Add a "where in" clause to the query.
418
426
  */
419
- whereIn(field: string, values: any[] | Set<any>): this;
427
+ whereIn<T extends NonMethodKeys<M>>(field: T | string & {}, values: any[] | Set<any>): this;
420
428
  /**
421
429
  * Add a "where not in" clause to the query.
422
430
  */
@@ -436,7 +444,7 @@ declare class Query<M extends Model = Model> {
436
444
  /**
437
445
  * Add an "or where" clause to the query.
438
446
  */
439
- orWhere(field: WherePrimaryClosure | string, value?: WhereSecondaryClosure | any): this;
447
+ orWhere<T extends WherePrimaryClosure<M> | NonMethodKeys<M> | string & {}>(field: T, value?: WhereSecondaryClosure<M[T extends keyof M ? T : never]> | M[T extends keyof M ? T : never]): this;
440
448
  /**
441
449
  * Add a "whereNULL" clause to the query.
442
450
  */
@@ -448,11 +456,11 @@ declare class Query<M extends Model = Model> {
448
456
  /**
449
457
  * Add a "where has" clause to the query.
450
458
  */
451
- whereHas(relation: string, callback?: EagerLoadConstraint, operator?: string | number, count?: number): this;
459
+ whereHas<T extends WithKeys<M>>(relation: T | string & {}, callback?: M[T] extends Model | Model[] | null ? EagerLoadConstraint<GetElementType<NonNullable<M[T]>>> : () => void, operator?: string | number, count?: number): this;
452
460
  /**
453
461
  * Add an "or where has" clause to the query.
454
462
  */
455
- orWhereHas(relation: string, callback?: EagerLoadConstraint, operator?: string | number, count?: number): this;
463
+ orWhereHas<T extends WithKeys<M>>(relation: T | string & {}, callback?: M[T] extends Model | Model[] | null ? EagerLoadConstraint<GetElementType<NonNullable<M[T]>>> : () => void, operator?: string | number, count?: number): this;
456
464
  /**
457
465
  * Add a "has" clause to the query.
458
466
  */
@@ -472,11 +480,11 @@ declare class Query<M extends Model = Model> {
472
480
  /**
473
481
  * Add a "where doesn't have" clause to the query.
474
482
  */
475
- whereDoesntHave(relation: string, callback?: EagerLoadConstraint): this;
483
+ whereDoesntHave<T extends WithKeys<M>>(relation: T | string & {}, callback?: M[T] extends Model | Model[] | null ? EagerLoadConstraint<GetElementType<NonNullable<M[T]>>> : () => void): this;
476
484
  /**
477
485
  * Add an "or where doesn't have" clause to the query.
478
486
  */
479
- orWhereDoesntHave(relation: string, callback?: EagerLoadConstraint): this;
487
+ orWhereDoesntHave<T extends WithKeys<M>>(relation: T | string & {}, callback?: M[T] extends Model | Model[] | null ? EagerLoadConstraint<GetElementType<NonNullable<M[T]>>> : () => void): this;
480
488
  /**
481
489
  * Add a "group by" clause to the query.
482
490
  */
@@ -496,11 +504,11 @@ declare class Query<M extends Model = Model> {
496
504
  /**
497
505
  * Set the relationships that should be eager loaded.
498
506
  */
499
- with(name: string, callback?: EagerLoadConstraint): this;
507
+ with<T extends WithKeys<M>>(name: T | string & {}, callback?: M[T] extends Model | Model[] | null ? EagerLoadConstraint<GetElementType<NonNullable<M[T]>>> : () => void): this;
500
508
  /**
501
509
  * Set to eager load all top-level relationships. Constraint is set for all relationships.
502
510
  */
503
- withAll(callback?: EagerLoadConstraint): this;
511
+ withAll(callback?: EagerLoadConstraint<any>): this;
504
512
  /**
505
513
  * Set to eager load all relationships recursively.
506
514
  */
@@ -512,7 +520,7 @@ declare class Query<M extends Model = Model> {
512
520
  /**
513
521
  * Get where closure for relations
514
522
  */
515
- protected getFieldWhereForRelations(relation: string, callback?: EagerLoadConstraint, operator?: string | number, count?: number): WherePrimaryClosure;
523
+ protected getFieldWhereForRelations<T extends WithKeys<M>>(relation: T | (string & {}), callback?: M[T] extends Model | Model[] | null ? EagerLoadConstraint<GetElementType<NonNullable<M[T]>>> : () => void, operator?: string | number, count?: number): WherePrimaryClosure<M>;
516
524
  /**
517
525
  * Get all models by id from the store. The difference with the `get` is that this
518
526
  * method will not process any query chain.
@@ -548,11 +556,11 @@ declare class Query<M extends Model = Model> {
548
556
  /**
549
557
  * Get comparator for the where clause.
550
558
  */
551
- protected getWhereComparator(): (model: any) => boolean;
559
+ protected getWhereComparator(): (model: M) => boolean;
552
560
  /**
553
561
  * The function to compare where clause to the given model.
554
562
  */
555
- protected whereComparator(model: M, where: Where): boolean;
563
+ protected whereComparator(model: M, where: Where<M>): boolean;
556
564
  /**
557
565
  * Filter the given collection by the registered order conditions.
558
566
  */
@@ -576,7 +584,7 @@ declare class Query<M extends Model = Model> {
576
584
  /**
577
585
  * Eagerly load the relationship on a set of models.
578
586
  */
579
- protected eagerLoadRelation(models: Collection<M>, name: string, constraints: EagerLoadConstraint): void;
587
+ protected eagerLoadRelation<T extends WithKeys<M>>(models: Collection<M>, name: T | string & {}, constraints: EagerLoadConstraint<M>): void;
580
588
  /**
581
589
  * Get the relation instance for the given relation name.
582
590
  */
@@ -702,15 +710,15 @@ declare abstract class Relation extends Attribute {
702
710
  /**
703
711
  * Set the constraints for an eager loading relation.
704
712
  */
705
- abstract addEagerConstraints(query: Query, models: Collection): void;
713
+ abstract addEagerConstraints(query: Query<any>, models: Collection): void;
706
714
  /**
707
715
  * Match the eagerly loaded results to their parents.
708
716
  */
709
- abstract match(relation: string, models: Collection, query: Query): void;
717
+ abstract match(relation: string, models: Collection, query: Query<any>): void;
710
718
  /**
711
719
  * Get all of the primary keys for an array of models.
712
720
  */
713
- protected getKeys(models: Collection, key: string): (string | number)[];
721
+ protected getKeys<M extends Model = Model>(models: Collection<any>, key: string): (string | number)[];
714
722
  /**
715
723
  * Specify how this model should behave on delete
716
724
  */
@@ -718,7 +726,7 @@ declare abstract class Relation extends Attribute {
718
726
  /**
719
727
  * Run a dictionary map over the items.
720
728
  */
721
- protected mapToDictionary(models: Collection, callback: (model: Model) => [string, Model]): Dictionary;
729
+ protected mapToDictionary(models: Collection<any>, callback: (model: Model) => [string, Model]): Dictionary;
722
730
  /**
723
731
  * Call a function for a current key match
724
732
  */
@@ -761,11 +769,11 @@ declare class HasOne extends Relation {
761
769
  /**
762
770
  * Match the eagerly loaded results to their parents.
763
771
  */
764
- match(relation: string, models: Collection, query: Query): void;
772
+ match(relation: string, models: Collection<any>, query: Query<any>): void;
765
773
  /**
766
774
  * Build model dictionary keyed by the relation's foreign key.
767
775
  */
768
- protected buildDictionary(results: Collection): Dictionary;
776
+ protected buildDictionary(results: Collection<any>): Dictionary;
769
777
  /**
770
778
  * Make a related model.
771
779
  */
@@ -808,15 +816,15 @@ declare class BelongsTo extends Relation {
808
816
  /**
809
817
  * Gather the keys from a collection of related models.
810
818
  */
811
- protected getEagerModelKeys(models: Collection, foreignKey: string): (string | number)[];
819
+ protected getEagerModelKeys(models: Collection<any>, foreignKey: string): (string | number)[];
812
820
  /**
813
821
  * Match the eagerly loaded results to their respective parents.
814
822
  */
815
- match(relation: string, models: Collection, query: Query): void;
823
+ match(relation: string, models: Collection<any>, query: Query): void;
816
824
  /**
817
825
  * Build model dictionary keyed by relation's parent key.
818
826
  */
819
- protected buildDictionary(models: Collection): Record<string, Model>;
827
+ protected buildDictionary(models: Collection<any>): Record<string, Model>;
820
828
  /**
821
829
  * Make a related model.
822
830
  */
@@ -871,7 +879,7 @@ declare class BelongsToMany extends Relation {
871
879
  /**
872
880
  * Match the eagerly loaded results to their parents.
873
881
  */
874
- match(relation: string, models: Collection, query: Query): void;
882
+ match(relation: string, models: Collection<any>, query: Query<any>): void;
875
883
  /**
876
884
  * Set the constraints for the related relation.
877
885
  */
@@ -910,11 +918,11 @@ declare class HasMany extends Relation {
910
918
  /**
911
919
  * Match the eagerly loaded results to their parents.
912
920
  */
913
- match(relation: string, models: Collection, query: Query): void;
921
+ match(relation: string, models: Collection<any>, query: Query<any>): void;
914
922
  /**
915
923
  * Build model dictionary keyed by the relation's foreign key.
916
924
  */
917
- protected buildDictionary(results: Collection): Dictionary;
925
+ protected buildDictionary(results: Collection<any>): Dictionary;
918
926
  /**
919
927
  * Make related models.
920
928
  */
@@ -962,15 +970,15 @@ declare class HasManyBy extends Relation {
962
970
  /**
963
971
  * Gather the keys from a collection of related models.
964
972
  */
965
- protected getEagerModelKeys(models: Collection): (string | number)[];
973
+ protected getEagerModelKeys(models: Collection<any>): (string | number)[];
966
974
  /**
967
975
  * Match the eagerly loaded results to their parents.
968
976
  */
969
- match(relation: string, models: Collection, query: Query): void;
977
+ match(relation: string, models: Collection<any>, query: Query<any>): void;
970
978
  /**
971
979
  * Build model dictionary keyed by the relation's foreign key.
972
980
  */
973
- protected buildDictionary(models: Collection): Record<string, Model>;
981
+ protected buildDictionary(models: Collection<any>): Record<string, Model>;
974
982
  /**
975
983
  * Get all related models from the given dictionary.
976
984
  */
@@ -1013,15 +1021,15 @@ declare class MorphOne extends Relation {
1013
1021
  /**
1014
1022
  * Set the constraints for an eager load of the relation.
1015
1023
  */
1016
- addEagerConstraints(query: Query, models: Collection): void;
1024
+ addEagerConstraints(query: Query<any>, models: Collection<any>): void;
1017
1025
  /**
1018
1026
  * Match the eagerly loaded results to their parents.
1019
1027
  */
1020
- match(relation: string, models: Collection, query: Query): void;
1028
+ match(relation: string, models: Collection<any>, query: Query<any>): void;
1021
1029
  /**
1022
1030
  * Build model dictionary keyed by the relation's foreign key.
1023
1031
  */
1024
- protected buildDictionary(models: Collection): Record<string, Model>;
1032
+ protected buildDictionary(models: Collection<any>): Record<string, Model>;
1025
1033
  /**
1026
1034
  * Make a related model.
1027
1035
  */
@@ -1095,11 +1103,11 @@ declare class MorphTo extends Relation {
1095
1103
  /**
1096
1104
  * Build model dictionary keyed by the owner key for each entity.
1097
1105
  */
1098
- protected buildDictionary(query: Query, models: Collection): DictionaryByEntities;
1106
+ protected buildDictionary(query: Query<any>, models: Collection<any>): DictionaryByEntities;
1099
1107
  /**
1100
1108
  * Get the relation's primary keys grouped by its entity.
1101
1109
  */
1102
- protected getKeysByEntity(models: Collection): Record<string, (string | number)[]>;
1110
+ protected getKeysByEntity(models: Collection<any>): Record<string, (string | number)[]>;
1103
1111
  }
1104
1112
 
1105
1113
  declare class MorphMany extends Relation {
@@ -1134,15 +1142,15 @@ declare class MorphMany extends Relation {
1134
1142
  /**
1135
1143
  * Set the constraints for an eager load of the relation.
1136
1144
  */
1137
- addEagerConstraints(query: Query, models: Collection): void;
1145
+ addEagerConstraints(query: Query<any>, models: Collection<any>): void;
1138
1146
  /**
1139
1147
  * Match the eagerly loaded results to their parents.
1140
1148
  */
1141
- match(relation: string, models: Collection, query: Query): void;
1149
+ match(relation: string, models: Collection<any>, query: Query<any>): void;
1142
1150
  /**
1143
1151
  * Build model dictionary keyed by the relation's foreign key.
1144
1152
  */
1145
- protected buildDictionary(results: Collection): Dictionary;
1153
+ protected buildDictionary(results: Collection<any>): Dictionary;
1146
1154
  /**
1147
1155
  * Make related models.
1148
1156
  */
@@ -1237,11 +1245,11 @@ declare class HasManyThrough extends Relation {
1237
1245
  /**
1238
1246
  * Match the eagerly loaded results to their parents.
1239
1247
  */
1240
- match(relation: string, models: Collection, query: Query): void;
1248
+ match(relation: string, models: Collection<any>, query: Query<any>): void;
1241
1249
  /**
1242
1250
  * Build model dictionary keyed by the relation's foreign key.
1243
1251
  */
1244
- protected buildDictionary(throughResults: Collection, results: Collection): Dictionary;
1252
+ protected buildDictionary(throughResults: Collection<any>, results: Collection<any>): Dictionary;
1245
1253
  /**
1246
1254
  * Make related models.
1247
1255
  */
@@ -1300,7 +1308,7 @@ declare class MorphToMany extends Relation {
1300
1308
  /**
1301
1309
  * Match the eagerly loaded results to their parents.
1302
1310
  */
1303
- match(relation: string, models: Collection, query: Query): void;
1311
+ match(relation: string, models: Collection<any>, query: Query<any>): void;
1304
1312
  /**
1305
1313
  * Set the constraints for the related relation.
1306
1314
  */
@@ -1334,8 +1342,11 @@ interface AfterHook {
1334
1342
  interface InheritanceTypes {
1335
1343
  [key: string]: typeof Model;
1336
1344
  }
1345
+ type WithKeys<T> = {
1346
+ [P in keyof T]: T[P] extends (Model | null) | Model[] ? P & string : never;
1347
+ }[keyof T];
1337
1348
  declare class Model {
1338
- [s: keyof ModelFields]: any;
1349
+ pivot?: any;
1339
1350
  _meta: undefined | MetaValues;
1340
1351
  /**
1341
1352
  * The name of the model.
@@ -1753,7 +1764,7 @@ interface ModelConstructor<M extends Model> extends Constructor<M> {
1753
1764
  newRawInstance(): M;
1754
1765
  }
1755
1766
 
1756
- declare function useDataStore<S extends DataStoreState, T extends DataStore = DataStore>(id: string, options: DefineStoreOptionsBase<S, T>, query?: Query): pinia.StoreDefinition<string, S, {}, {
1767
+ declare function useDataStore<S extends DataStoreState, T extends DataStore = DataStore>(id: string, options: DefineStoreOptionsBase<S, T>, query?: Query<any>): pinia.StoreDefinition<string, S, {}, {
1757
1768
  save(this: any, records: Elements, triggerQueryAction?: boolean): void;
1758
1769
  insert(this: any, records: Elements, triggerQueryAction?: boolean): void;
1759
1770
  update(this: any, records: Elements, triggerQueryAction?: boolean): void;
@@ -1803,7 +1814,7 @@ declare class Repository<M extends Model = Model> {
1803
1814
  /**
1804
1815
  * The model object to be used for the custom repository.
1805
1816
  */
1806
- static useModel?: Model;
1817
+ static useModel?: typeof Model;
1807
1818
  /**
1808
1819
  * Global config
1809
1820
  */
@@ -1817,7 +1828,7 @@ declare class Repository<M extends Model = Model> {
1817
1828
  /**
1818
1829
  * Set the model
1819
1830
  */
1820
- static setModel(model: Model): typeof Repository;
1831
+ static setModel(model: typeof Model): typeof Repository;
1821
1832
  /**
1822
1833
  * Set the global config
1823
1834
  */
@@ -1864,19 +1875,19 @@ declare class Repository<M extends Model = Model> {
1864
1875
  /**
1865
1876
  * Add a basic where clause to the query.
1866
1877
  */
1867
- where(field: WherePrimaryClosure | string, value?: WhereSecondaryClosure | any): Query<M>;
1878
+ where<T extends WherePrimaryClosure<M> | NonMethodKeys<M> | string & {}>(field: T, value?: T extends string[] ? string | number | (string | number)[] : WhereSecondaryClosure<M[T extends keyof M ? T : never]> | M[T extends keyof M ? T : never]): Query<M>;
1868
1879
  /**
1869
1880
  * Add an "or where" clause to the query.
1870
1881
  */
1871
- orWhere(field: WherePrimaryClosure | string, value?: WhereSecondaryClosure | any): Query<M>;
1882
+ orWhere<T extends WherePrimaryClosure<M> | NonMethodKeys<M> | string & {}>(field: T, value?: WhereSecondaryClosure<M[T extends keyof M ? T : never]> | M[T extends keyof M ? T : never]): Query<M>;
1872
1883
  /**
1873
1884
  * Add a "where has" clause to the query.
1874
1885
  */
1875
- whereHas(relation: string, callback?: EagerLoadConstraint, operator?: string | number, count?: number): Query<M>;
1886
+ whereHas<T extends WithKeys<M>>(relation: T | string & {}, callback?: M[T] extends Model | Model[] | null ? EagerLoadConstraint<GetElementType<NonNullable<M[T]>>> : () => void, operator?: string | number, count?: number): Query<M>;
1876
1887
  /**
1877
1888
  * Add an "or where has" clause to the query.
1878
1889
  */
1879
- orWhereHas(relation: string, callback?: EagerLoadConstraint, operator?: string | number, count?: number): Query<M>;
1890
+ orWhereHas<T extends WithKeys<M>>(relation: T | string & {}, callback?: M[T] extends Model | Model[] | null ? EagerLoadConstraint<GetElementType<NonNullable<M[T]>>> : () => void, operator?: string | number, count?: number): Query<M>;
1880
1891
  /**
1881
1892
  * Add a "has" clause to the query.
1882
1893
  */
@@ -1896,11 +1907,11 @@ declare class Repository<M extends Model = Model> {
1896
1907
  /**
1897
1908
  * Add a "where doesn't have" clause to the query.
1898
1909
  */
1899
- whereDoesntHave(relation: string, callback?: EagerLoadConstraint): Query<M>;
1910
+ whereDoesntHave<T extends WithKeys<M>>(relation: T | string & {}, callback?: M[T] extends Model | Model[] | null ? EagerLoadConstraint<GetElementType<NonNullable<M[T]>>> : () => void): Query<M>;
1900
1911
  /**
1901
1912
  * Add an "or where doesn't have" clause to the query.
1902
1913
  */
1903
- orWhereDoesntHave(relation: string, callback?: EagerLoadConstraint): Query<M>;
1914
+ orWhereDoesntHave<T extends WithKeys<M>>(relation: T | string & {}, callback?: M[T] extends Model | Model[] | null ? EagerLoadConstraint<GetElementType<NonNullable<M[T]>>> : () => void): Query<M>;
1904
1915
  /**
1905
1916
  * Make meta field visible
1906
1917
  */
@@ -1932,11 +1943,11 @@ declare class Repository<M extends Model = Model> {
1932
1943
  /**
1933
1944
  * Set the relationships that should be eager loaded.
1934
1945
  */
1935
- with(name: string, callback?: EagerLoadConstraint): Query<M>;
1946
+ with<T extends WithKeys<M>>(name: string & {} | T, callback?: M[T] extends Model | Model[] | null ? EagerLoadConstraint<GetElementType<NonNullable<M[T]>>> : never): Query<M>;
1936
1947
  /**
1937
1948
  * Set to eager load all top-level relationships. Constraint is set for all relationships.
1938
1949
  */
1939
- withAll(callback?: EagerLoadConstraint): Query<M>;
1950
+ withAll(callback?: EagerLoadConstraint<M>): Query<M>;
1940
1951
  /**
1941
1952
  * Set to eager load all top-level relationships. Constraint is set for all relationships.
1942
1953
  */
@@ -1989,4 +2000,4 @@ declare class Repository<M extends Model = Model> {
1989
2000
  flush(): M[];
1990
2001
  }
1991
2002
 
1992
- export { CastAttribute as $, type AfterHook as A, type BeforeHook as B, type Constructor as C, type DataStore as D, type Elements as E, type FilledInstallOptions as F, type GroupedCollection as G, Relation as H, type Item as I, BelongsTo as J, BelongsToMany as K, HasMany as L, Model as M, type NormalizedData as N, HasOne as O, type PiniaOrmPluginContext as P, Query as Q, Repository as R, type Schemas as S, HasManyBy as T, HasManyThrough as U, MorphMany as V, WeakCache as W, MorphTo as X, MorphToMany as Y, MorphOne as Z, type Casts as _, type Element as a, type TypeDefault as a0, Type as a1, Interpreter as a2, type Where as a3, type WherePrimaryClosure as a4, type WhereSecondaryClosure as a5, type WhereGroup as a6, type Order as a7, type Group as a8, type OrderBy as a9, type GroupBy as aa, type GroupByFields as ab, type OrderDirection as ac, type EagerLoad as ad, type EagerLoadConstraint as ae, type PropertyDecorator as af, type TypeOptions as ag, type UidOptions as ah, type Mutator as ai, type NanoidOptions as aj, type Collection as b, type DataStoreState as c, type PiniaOrmPlugin as d, definePiniaOrmPlugin as e, type ModelConfigOptions as f, type CacheConfigOptions as g, type InstallOptions as h, type CreatePiniaOrm as i, createORM as j, Database as k, Schema as l, type ModelFields as m, type ModelSchemas as n, type ModelRegistries as o, plugins as p, type ModelRegistry as q, registerPlugins as r, type PrimaryKey as s, type ModelOptions as t, useDataStore as u, type MetaValues as v, type InheritanceTypes as w, Attribute as x, type Dictionary as y, type deleteModes as z };
2003
+ export { type Casts as $, type AfterHook as A, type BeforeHook as B, type Constructor as C, type DataStore as D, type Elements as E, type FilledInstallOptions as F, type GroupedCollection as G, type deleteModes as H, type Item as I, Relation as J, BelongsTo as K, BelongsToMany as L, Model as M, type NormalizedData as N, HasMany as O, type PiniaOrmPluginContext as P, Query as Q, Repository as R, type Schemas as S, HasOne as T, HasManyBy as U, HasManyThrough as V, WeakCache as W, MorphMany as X, MorphTo as Y, MorphToMany as Z, MorphOne as _, type Element as a, CastAttribute as a0, type TypeDefault as a1, Type as a2, Interpreter as a3, type Where as a4, type NonMethodKeys as a5, type GetElementType as a6, type UltimateKeys as a7, type WherePrimaryClosure as a8, type WhereSecondaryClosure as a9, type WhereGroup as aa, type Order as ab, type Group as ac, type OrderBy as ad, type GroupBy as ae, type GroupByFields as af, type OrderDirection as ag, type EagerLoad as ah, type EagerLoadConstraint as ai, type Mutator as aj, type MutatorFunctions as ak, type Mutators as al, type CacheConfig as am, type PropertyDecorator as an, type TypeOptions as ao, type UidOptions as ap, type NanoidOptions as aq, type Collection as b, type DataStoreState as c, type PiniaOrmPlugin as d, definePiniaOrmPlugin as e, type ModelConfigOptions as f, type CacheConfigOptions as g, type InstallOptions as h, type CreatePiniaOrm as i, createORM as j, Database as k, Schema as l, type ModelFields as m, type ModelSchemas as n, type ModelRegistries as o, plugins as p, type ModelRegistry as q, registerPlugins as r, type PrimaryKey as s, type ModelOptions as t, useDataStore as u, type MetaValues as v, type InheritanceTypes as w, type WithKeys as x, Attribute as y, type Dictionary as z };
@@ -1,7 +1,8 @@
1
1
  import { V1Options } from 'uuid';
2
- import { $ as CastAttribute, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.cjs';
2
+ import { a0 as CastAttribute, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.b86abeaa.cjs';
3
3
  import 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
+ import '@/model/Model';
5
6
  import '@/composables';
6
7
 
7
8
  declare class UidCast extends CastAttribute {
@@ -1,7 +1,8 @@
1
1
  import { V1Options } from 'uuid';
2
- import { $ as CastAttribute, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.mjs';
2
+ import { a0 as CastAttribute, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.b86abeaa.mjs';
3
3
  import 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
+ import '@/model/Model';
5
6
  import '@/composables';
6
7
 
7
8
  declare class UidCast extends CastAttribute {
package/dist/uuid/v1.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { V1Options } from 'uuid';
2
- import { $ as CastAttribute, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.js';
2
+ import { a0 as CastAttribute, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.b86abeaa.js';
3
3
  import 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
+ import '@/model/Model';
5
6
  import '@/composables';
6
7
 
7
8
  declare class UidCast extends CastAttribute {
@@ -1,7 +1,8 @@
1
1
  import { V4Options } from 'uuid';
2
- import { $ as CastAttribute, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.cjs';
2
+ import { a0 as CastAttribute, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.b86abeaa.cjs';
3
3
  import 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
+ import '@/model/Model';
5
6
  import '@/composables';
6
7
 
7
8
  declare class UidCast extends CastAttribute {
@@ -1,7 +1,8 @@
1
1
  import { V4Options } from 'uuid';
2
- import { $ as CastAttribute, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.mjs';
2
+ import { a0 as CastAttribute, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.b86abeaa.mjs';
3
3
  import 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
+ import '@/model/Model';
5
6
  import '@/composables';
6
7
 
7
8
  declare class UidCast extends CastAttribute {
package/dist/uuid/v4.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { V4Options } from 'uuid';
2
- import { $ as CastAttribute, m as ModelFields, af as PropertyDecorator } from '../shared/pinia-orm.677cd0bd.js';
2
+ import { a0 as CastAttribute, m as ModelFields, an as PropertyDecorator } from '../shared/pinia-orm.b86abeaa.js';
3
3
  import 'pinia';
4
4
  import '@pinia-orm/normalizr';
5
+ import '@/model/Model';
5
6
  import '@/composables';
6
7
 
7
8
  declare class UidCast extends CastAttribute {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinia-orm-edge",
3
- "version": "1.9.0-28582911.bbf7a93",
3
+ "version": "1.9.0-28583149.676ad48",
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-28582911.bbf7a93"
49
+ "@pinia-orm/normalizr": "npm:@pinia-orm/normalizr-edge@1.9.0-28583149.676ad48"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@nuxt/eslint-config": "^0.3.10",