pinia-orm-edge 1.10.0-28586201.60fc813 → 1.10.0-28683029.86bd359
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 +2 -2
- package/dist/casts.d.mts +2 -2
- package/dist/casts.d.ts +2 -2
- package/dist/decorators.cjs +11 -0
- package/dist/decorators.d.cts +9 -4
- package/dist/decorators.d.mts +9 -4
- package/dist/decorators.d.ts +9 -4
- package/dist/decorators.mjs +11 -1
- package/dist/helpers.cjs +1 -0
- package/dist/helpers.d.cts +8 -3
- package/dist/helpers.d.mts +8 -3
- package/dist/helpers.d.ts +8 -3
- package/dist/helpers.mjs +1 -1
- package/dist/index.cjs +306 -173
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +306 -173
- package/dist/nanoid/async.d.cts +2 -2
- package/dist/nanoid/async.d.mts +2 -2
- package/dist/nanoid/async.d.ts +2 -2
- package/dist/nanoid/index.d.cts +2 -2
- package/dist/nanoid/index.d.mts +2 -2
- package/dist/nanoid/index.d.ts +2 -2
- package/dist/nanoid/non-secure.d.cts +2 -2
- package/dist/nanoid/non-secure.d.mts +2 -2
- package/dist/nanoid/non-secure.d.ts +2 -2
- package/dist/shared/{pinia-orm.f37062c8.d.cts → pinia-orm.52557866.d.cts} +62 -25
- package/dist/shared/{pinia-orm.f37062c8.d.mts → pinia-orm.52557866.d.mts} +62 -25
- package/dist/shared/{pinia-orm.f37062c8.d.ts → pinia-orm.52557866.d.ts} +62 -25
- package/dist/uuid/v1.d.cts +2 -2
- package/dist/uuid/v1.d.mts +2 -2
- package/dist/uuid/v1.d.ts +2 -2
- package/dist/uuid/v4.d.cts +2 -2
- package/dist/uuid/v4.d.mts +2 -2
- package/dist/uuid/v4.d.ts +2 -2
- package/package.json +21 -21
package/dist/casts.d.cts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import { a0 as CastAttribute, m as ModelFields } from './shared/pinia-orm.
|
1
|
+
import { a0 as CastAttribute, m as ModelFields } from './shared/pinia-orm.52557866.cjs';
|
2
2
|
import 'pinia';
|
3
|
-
import '@pinia-orm/normalizr';
|
4
3
|
import '@/composables';
|
4
|
+
import '@pinia-orm/normalizr';
|
5
5
|
|
6
6
|
declare class ArrayCast extends CastAttribute {
|
7
7
|
/**
|
package/dist/casts.d.mts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import { a0 as CastAttribute, m as ModelFields } from './shared/pinia-orm.
|
1
|
+
import { a0 as CastAttribute, m as ModelFields } from './shared/pinia-orm.52557866.mjs';
|
2
2
|
import 'pinia';
|
3
|
-
import '@pinia-orm/normalizr';
|
4
3
|
import '@/composables';
|
4
|
+
import '@pinia-orm/normalizr';
|
5
5
|
|
6
6
|
declare class ArrayCast extends CastAttribute {
|
7
7
|
/**
|
package/dist/casts.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import { a0 as CastAttribute, m as ModelFields } from './shared/pinia-orm.
|
1
|
+
import { a0 as CastAttribute, m as ModelFields } from './shared/pinia-orm.52557866.js';
|
2
2
|
import 'pinia';
|
3
|
-
import '@pinia-orm/normalizr';
|
4
3
|
import '@/composables';
|
4
|
+
import '@pinia-orm/normalizr';
|
5
5
|
|
6
6
|
declare class ArrayCast extends CastAttribute {
|
7
7
|
/**
|
package/dist/decorators.cjs
CHANGED
@@ -143,6 +143,16 @@ function MorphToMany(related, pivot, relatedId, id, type, parentKey, relatedKey)
|
|
143
143
|
};
|
144
144
|
}
|
145
145
|
|
146
|
+
function MorphedByMany(related, pivot, relatedId, id, type, parentKey, relatedKey) {
|
147
|
+
return (target, propertyKey) => {
|
148
|
+
const self = target.$self();
|
149
|
+
self.setRegistry(
|
150
|
+
propertyKey,
|
151
|
+
() => self.morphedByMany(related(), pivot(), relatedId, id, type, parentKey, relatedKey)
|
152
|
+
);
|
153
|
+
};
|
154
|
+
}
|
155
|
+
|
146
156
|
function MorphMany(related, id, type, localKey) {
|
147
157
|
return (target, propertyKey) => {
|
148
158
|
const self = target.$self();
|
@@ -211,6 +221,7 @@ exports.MorphMany = MorphMany;
|
|
211
221
|
exports.MorphOne = MorphOne;
|
212
222
|
exports.MorphTo = MorphTo;
|
213
223
|
exports.MorphToMany = MorphToMany;
|
224
|
+
exports.MorphedByMany = MorphedByMany;
|
214
225
|
exports.Mutate = Mutate;
|
215
226
|
exports.NonEnumerable = NonEnumerable;
|
216
227
|
exports.Num = Num;
|
package/dist/decorators.d.cts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { a1 as TypeDefault, an as PropertyDecorator, ao as TypeOptions, ap as UidOptions, M as Model, s as PrimaryKey, H as deleteModes, a0 as CastAttribute, aj as Mutator } from './shared/pinia-orm.
|
2
|
-
export { aq as NanoidOptions } from './shared/pinia-orm.
|
1
|
+
import { a1 as TypeDefault, an as PropertyDecorator, ao as TypeOptions, ap as UidOptions, M as Model, s as PrimaryKey, H as deleteModes, a0 as CastAttribute, aj as Mutator } from './shared/pinia-orm.52557866.cjs';
|
2
|
+
export { aq as NanoidOptions } from './shared/pinia-orm.52557866.cjs';
|
3
3
|
import 'pinia';
|
4
|
-
import '@pinia-orm/normalizr';
|
5
4
|
import '@/composables';
|
5
|
+
import '@pinia-orm/normalizr';
|
6
6
|
|
7
7
|
/**
|
8
8
|
* Create an Attr attribute property decorator.
|
@@ -74,6 +74,11 @@ declare function MorphTo(related: () => typeof Model[], id: string, type: string
|
|
74
74
|
*/
|
75
75
|
declare function MorphToMany(related: () => typeof Model, pivot: () => typeof Model, relatedId: string, id: string, type: string, parentKey?: string, relatedKey?: string): PropertyDecorator;
|
76
76
|
|
77
|
+
/**
|
78
|
+
* Create a morph-to-many attribute property decorator.
|
79
|
+
*/
|
80
|
+
declare function MorphedByMany(related: () => typeof Model, pivot: () => typeof Model, relatedId: string, id: string, type: string, parentKey?: string, relatedKey?: string): PropertyDecorator;
|
81
|
+
|
77
82
|
/**
|
78
83
|
* Create a morph-many attribute property decorator.
|
79
84
|
*/
|
@@ -104,4 +109,4 @@ declare function Hidden(): PropertyDecorator;
|
|
104
109
|
*/
|
105
110
|
declare function NonEnumerable(target: any, propertyKey: string): void;
|
106
111
|
|
107
|
-
export { Attr, BelongsTo, BelongsToMany, Bool, Cast, HasMany, HasManyBy, HasManyThrough, HasOne, Hidden, MorphMany, MorphOne, MorphTo, MorphToMany, Mutate, NonEnumerable, Num, OnDelete, PropertyDecorator, Str, TypeOptions, Uid, UidOptions };
|
112
|
+
export { Attr, BelongsTo, BelongsToMany, Bool, Cast, HasMany, HasManyBy, HasManyThrough, HasOne, Hidden, MorphMany, MorphOne, MorphTo, MorphToMany, MorphedByMany, Mutate, NonEnumerable, Num, OnDelete, PropertyDecorator, Str, TypeOptions, Uid, UidOptions };
|
package/dist/decorators.d.mts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { a1 as TypeDefault, an as PropertyDecorator, ao as TypeOptions, ap as UidOptions, M as Model, s as PrimaryKey, H as deleteModes, a0 as CastAttribute, aj as Mutator } from './shared/pinia-orm.
|
2
|
-
export { aq as NanoidOptions } from './shared/pinia-orm.
|
1
|
+
import { a1 as TypeDefault, an as PropertyDecorator, ao as TypeOptions, ap as UidOptions, M as Model, s as PrimaryKey, H as deleteModes, a0 as CastAttribute, aj as Mutator } from './shared/pinia-orm.52557866.mjs';
|
2
|
+
export { aq as NanoidOptions } from './shared/pinia-orm.52557866.mjs';
|
3
3
|
import 'pinia';
|
4
|
-
import '@pinia-orm/normalizr';
|
5
4
|
import '@/composables';
|
5
|
+
import '@pinia-orm/normalizr';
|
6
6
|
|
7
7
|
/**
|
8
8
|
* Create an Attr attribute property decorator.
|
@@ -74,6 +74,11 @@ declare function MorphTo(related: () => typeof Model[], id: string, type: string
|
|
74
74
|
*/
|
75
75
|
declare function MorphToMany(related: () => typeof Model, pivot: () => typeof Model, relatedId: string, id: string, type: string, parentKey?: string, relatedKey?: string): PropertyDecorator;
|
76
76
|
|
77
|
+
/**
|
78
|
+
* Create a morph-to-many attribute property decorator.
|
79
|
+
*/
|
80
|
+
declare function MorphedByMany(related: () => typeof Model, pivot: () => typeof Model, relatedId: string, id: string, type: string, parentKey?: string, relatedKey?: string): PropertyDecorator;
|
81
|
+
|
77
82
|
/**
|
78
83
|
* Create a morph-many attribute property decorator.
|
79
84
|
*/
|
@@ -104,4 +109,4 @@ declare function Hidden(): PropertyDecorator;
|
|
104
109
|
*/
|
105
110
|
declare function NonEnumerable(target: any, propertyKey: string): void;
|
106
111
|
|
107
|
-
export { Attr, BelongsTo, BelongsToMany, Bool, Cast, HasMany, HasManyBy, HasManyThrough, HasOne, Hidden, MorphMany, MorphOne, MorphTo, MorphToMany, Mutate, NonEnumerable, Num, OnDelete, PropertyDecorator, Str, TypeOptions, Uid, UidOptions };
|
112
|
+
export { Attr, BelongsTo, BelongsToMany, Bool, Cast, HasMany, HasManyBy, HasManyThrough, HasOne, Hidden, MorphMany, MorphOne, MorphTo, MorphToMany, MorphedByMany, Mutate, NonEnumerable, Num, OnDelete, PropertyDecorator, Str, TypeOptions, Uid, UidOptions };
|
package/dist/decorators.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { a1 as TypeDefault, an as PropertyDecorator, ao as TypeOptions, ap as UidOptions, M as Model, s as PrimaryKey, H as deleteModes, a0 as CastAttribute, aj as Mutator } from './shared/pinia-orm.
|
2
|
-
export { aq as NanoidOptions } from './shared/pinia-orm.
|
1
|
+
import { a1 as TypeDefault, an as PropertyDecorator, ao as TypeOptions, ap as UidOptions, M as Model, s as PrimaryKey, H as deleteModes, a0 as CastAttribute, aj as Mutator } from './shared/pinia-orm.52557866.js';
|
2
|
+
export { aq as NanoidOptions } from './shared/pinia-orm.52557866.js';
|
3
3
|
import 'pinia';
|
4
|
-
import '@pinia-orm/normalizr';
|
5
4
|
import '@/composables';
|
5
|
+
import '@pinia-orm/normalizr';
|
6
6
|
|
7
7
|
/**
|
8
8
|
* Create an Attr attribute property decorator.
|
@@ -74,6 +74,11 @@ declare function MorphTo(related: () => typeof Model[], id: string, type: string
|
|
74
74
|
*/
|
75
75
|
declare function MorphToMany(related: () => typeof Model, pivot: () => typeof Model, relatedId: string, id: string, type: string, parentKey?: string, relatedKey?: string): PropertyDecorator;
|
76
76
|
|
77
|
+
/**
|
78
|
+
* Create a morph-to-many attribute property decorator.
|
79
|
+
*/
|
80
|
+
declare function MorphedByMany(related: () => typeof Model, pivot: () => typeof Model, relatedId: string, id: string, type: string, parentKey?: string, relatedKey?: string): PropertyDecorator;
|
81
|
+
|
77
82
|
/**
|
78
83
|
* Create a morph-many attribute property decorator.
|
79
84
|
*/
|
@@ -104,4 +109,4 @@ declare function Hidden(): PropertyDecorator;
|
|
104
109
|
*/
|
105
110
|
declare function NonEnumerable(target: any, propertyKey: string): void;
|
106
111
|
|
107
|
-
export { Attr, BelongsTo, BelongsToMany, Bool, Cast, HasMany, HasManyBy, HasManyThrough, HasOne, Hidden, MorphMany, MorphOne, MorphTo, MorphToMany, Mutate, NonEnumerable, Num, OnDelete, PropertyDecorator, Str, TypeOptions, Uid, UidOptions };
|
112
|
+
export { Attr, BelongsTo, BelongsToMany, Bool, Cast, HasMany, HasManyBy, HasManyThrough, HasOne, Hidden, MorphMany, MorphOne, MorphTo, MorphToMany, MorphedByMany, Mutate, NonEnumerable, Num, OnDelete, PropertyDecorator, Str, TypeOptions, Uid, UidOptions };
|
package/dist/decorators.mjs
CHANGED
@@ -141,6 +141,16 @@ function MorphToMany(related, pivot, relatedId, id, type, parentKey, relatedKey)
|
|
141
141
|
};
|
142
142
|
}
|
143
143
|
|
144
|
+
function MorphedByMany(related, pivot, relatedId, id, type, parentKey, relatedKey) {
|
145
|
+
return (target, propertyKey) => {
|
146
|
+
const self = target.$self();
|
147
|
+
self.setRegistry(
|
148
|
+
propertyKey,
|
149
|
+
() => self.morphedByMany(related(), pivot(), relatedId, id, type, parentKey, relatedKey)
|
150
|
+
);
|
151
|
+
};
|
152
|
+
}
|
153
|
+
|
144
154
|
function MorphMany(related, id, type, localKey) {
|
145
155
|
return (target, propertyKey) => {
|
146
156
|
const self = target.$self();
|
@@ -195,4 +205,4 @@ function NonEnumerable(target, propertyKey) {
|
|
195
205
|
}
|
196
206
|
}
|
197
207
|
|
198
|
-
export { Attr, BelongsTo, BelongsToMany, Bool, Cast, HasMany, HasManyBy, HasManyThrough, HasOne, Hidden, MorphMany, MorphOne, MorphTo, MorphToMany, Mutate, NonEnumerable, Num, OnDelete, Str, Uid };
|
208
|
+
export { Attr, BelongsTo, BelongsToMany, Bool, Cast, HasMany, HasManyBy, HasManyThrough, HasOne, Hidden, MorphMany, MorphOne, MorphTo, MorphToMany, MorphedByMany, Mutate, NonEnumerable, Num, OnDelete, Str, Uid };
|
package/dist/helpers.cjs
CHANGED
package/dist/helpers.d.cts
CHANGED
@@ -1,11 +1,16 @@
|
|
1
|
-
import { M as Model, b as Collection } from './shared/pinia-orm.
|
1
|
+
import { M as Model, b as Collection } from './shared/pinia-orm.52557866.cjs';
|
2
2
|
import 'pinia';
|
3
|
-
import '@pinia-orm/normalizr';
|
4
3
|
import '@/composables';
|
4
|
+
import '@pinia-orm/normalizr';
|
5
5
|
|
6
6
|
type SortFlags = 'SORT_REGULAR' | 'SORT_FLAG_CASE';
|
7
7
|
|
8
8
|
type sorting<T> = ((record: T) => any) | string | [string, 'asc' | 'desc'][];
|
9
|
+
/**
|
10
|
+
* Creates an array of elements, sorted in specified order by the results
|
11
|
+
* of running each element in a collection thru each iteratee.
|
12
|
+
*/
|
13
|
+
declare function useSortBy<T extends Record<string, any>>(collection: T[], sort: sorting<T>, flags?: SortFlags): T[];
|
9
14
|
|
10
15
|
interface UseCollect<M extends Model = Model> {
|
11
16
|
sum: (field: string) => number;
|
@@ -51,4 +56,4 @@ declare function useMax(models: Collection, field: string): number;
|
|
51
56
|
*/
|
52
57
|
declare function usePluck(models: Collection, field: string): any[];
|
53
58
|
|
54
|
-
export { type UseCollect, useCollect, useGroupBy, useKeys, useMax, useMin, usePluck, useSum };
|
59
|
+
export { type UseCollect, type sorting, useCollect, useGroupBy, useKeys, useMax, useMin, usePluck, useSortBy, useSum };
|
package/dist/helpers.d.mts
CHANGED
@@ -1,11 +1,16 @@
|
|
1
|
-
import { M as Model, b as Collection } from './shared/pinia-orm.
|
1
|
+
import { M as Model, b as Collection } from './shared/pinia-orm.52557866.mjs';
|
2
2
|
import 'pinia';
|
3
|
-
import '@pinia-orm/normalizr';
|
4
3
|
import '@/composables';
|
4
|
+
import '@pinia-orm/normalizr';
|
5
5
|
|
6
6
|
type SortFlags = 'SORT_REGULAR' | 'SORT_FLAG_CASE';
|
7
7
|
|
8
8
|
type sorting<T> = ((record: T) => any) | string | [string, 'asc' | 'desc'][];
|
9
|
+
/**
|
10
|
+
* Creates an array of elements, sorted in specified order by the results
|
11
|
+
* of running each element in a collection thru each iteratee.
|
12
|
+
*/
|
13
|
+
declare function useSortBy<T extends Record<string, any>>(collection: T[], sort: sorting<T>, flags?: SortFlags): T[];
|
9
14
|
|
10
15
|
interface UseCollect<M extends Model = Model> {
|
11
16
|
sum: (field: string) => number;
|
@@ -51,4 +56,4 @@ declare function useMax(models: Collection, field: string): number;
|
|
51
56
|
*/
|
52
57
|
declare function usePluck(models: Collection, field: string): any[];
|
53
58
|
|
54
|
-
export { type UseCollect, useCollect, useGroupBy, useKeys, useMax, useMin, usePluck, useSum };
|
59
|
+
export { type UseCollect, type sorting, useCollect, useGroupBy, useKeys, useMax, useMin, usePluck, useSortBy, useSum };
|
package/dist/helpers.d.ts
CHANGED
@@ -1,11 +1,16 @@
|
|
1
|
-
import { M as Model, b as Collection } from './shared/pinia-orm.
|
1
|
+
import { M as Model, b as Collection } from './shared/pinia-orm.52557866.js';
|
2
2
|
import 'pinia';
|
3
|
-
import '@pinia-orm/normalizr';
|
4
3
|
import '@/composables';
|
4
|
+
import '@pinia-orm/normalizr';
|
5
5
|
|
6
6
|
type SortFlags = 'SORT_REGULAR' | 'SORT_FLAG_CASE';
|
7
7
|
|
8
8
|
type sorting<T> = ((record: T) => any) | string | [string, 'asc' | 'desc'][];
|
9
|
+
/**
|
10
|
+
* Creates an array of elements, sorted in specified order by the results
|
11
|
+
* of running each element in a collection thru each iteratee.
|
12
|
+
*/
|
13
|
+
declare function useSortBy<T extends Record<string, any>>(collection: T[], sort: sorting<T>, flags?: SortFlags): T[];
|
9
14
|
|
10
15
|
interface UseCollect<M extends Model = Model> {
|
11
16
|
sum: (field: string) => number;
|
@@ -51,4 +56,4 @@ declare function useMax(models: Collection, field: string): number;
|
|
51
56
|
*/
|
52
57
|
declare function usePluck(models: Collection, field: string): any[];
|
53
58
|
|
54
|
-
export { type UseCollect, useCollect, useGroupBy, useKeys, useMax, useMin, usePluck, useSum };
|
59
|
+
export { type UseCollect, type sorting, useCollect, useGroupBy, useKeys, useMax, useMin, usePluck, useSortBy, useSum };
|
package/dist/helpers.mjs
CHANGED