@h3ravel/arquebus 0.6.6 → 0.6.8
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/README.md +5 -4
- package/bin/index.cjs +270 -425
- package/bin/{index.js → index.mjs} +230 -409
- package/bin/seeders-C0schOjT.mjs +3 -0
- package/bin/seeders-D-v59HCz.cjs +3 -0
- package/dist/browser/index.cjs +4 -12
- package/dist/browser/index.d.cts +203 -203
- package/dist/browser/{index.d.ts → index.d.mts} +203 -203
- package/dist/browser/{index.js → index.mjs} +4 -11
- package/dist/index.cjs +21 -59
- package/dist/index.d.cts +133 -133
- package/dist/{index.d.ts → index.d.mts} +133 -133
- package/dist/{index.js → index.mjs} +21 -54
- package/dist/inspector/index.cjs +15 -46
- package/dist/inspector/{index.js → index.mjs} +15 -43
- package/dist/migrations/{chunk-PECeCxCb.js → chunk-BD38OWEx.mjs} +1 -1
- package/dist/migrations/index.cjs +20 -57
- package/dist/migrations/index.d.cts +186 -186
- package/dist/migrations/{index.d.ts → index.d.mts} +186 -186
- package/dist/migrations/{index.js → index.mjs} +22 -54
- package/dist/seeders/index.cjs +1 -5
- package/dist/seeders/index.d.cts +184 -184
- package/dist/seeders/{index.d.ts → index.d.mts} +184 -184
- package/dist/seeders/{index.js → index.mjs} +2 -3
- package/dist/stubs/seeder-js.stub +4 -4
- package/dist/stubs/seeder-ts.stub +5 -0
- package/package.json +5 -4
- package/bin/seeders-8GJzfIIN.js +0 -3
- package/bin/seeders-ByeSoCAQ.cjs +0 -131
- package/bin/seeders-CltigymO.js +0 -79
- package/bin/seeders-_xJ6VGVS.cjs +0 -3
- /package/bin/{index.d.ts → index.d.mts} +0 -0
- /package/dist/inspector/{index.d.ts → index.d.mts} +0 -0
package/dist/browser/index.d.cts
CHANGED
|
@@ -3,32 +3,32 @@ import Knex$1, { Knex } from "knex";
|
|
|
3
3
|
import * as dayjs0 from "dayjs";
|
|
4
4
|
|
|
5
5
|
//#region src/browser/collection.d.ts
|
|
6
|
-
declare class Collection<I extends Model> extends Collection$1<I> {
|
|
6
|
+
declare class Collection<I$1 extends Model$1> extends Collection$1<I$1> {
|
|
7
7
|
mapThen(callback: TFunction): Promise<any[]>;
|
|
8
8
|
modelKeys(): any[];
|
|
9
|
-
contains<K, V>(key: keyof I | K | TFunction, value?: V): boolean;
|
|
9
|
+
contains<K$1, V>(key: keyof I$1 | K$1 | TFunction, value?: V): boolean;
|
|
10
10
|
diff(items: ICollection<any> | any[]): any;
|
|
11
11
|
except(keys: any[]): any;
|
|
12
|
-
intersect(items: I[]): any;
|
|
13
|
-
unique(key?: TFunction | keyof I, _strict?: boolean): any;
|
|
12
|
+
intersect(items: I$1[]): any;
|
|
13
|
+
unique(key?: TFunction | keyof I$1, _strict?: boolean): any;
|
|
14
14
|
find(key: any, defaultValue?: null): any;
|
|
15
15
|
makeVisible(attributes: any): this;
|
|
16
16
|
makeHidden(attributes: any): this;
|
|
17
17
|
append(attributes: any): this;
|
|
18
18
|
only(keys: any[]): any;
|
|
19
19
|
getDictionary(items?: ICollection<any> | any[]): TGeneric;
|
|
20
|
-
toData(): (I | {
|
|
20
|
+
toData(): (I$1 | {
|
|
21
21
|
[x: string]: any;
|
|
22
22
|
[x: number]: any;
|
|
23
23
|
[x: symbol]: any;
|
|
24
24
|
})[];
|
|
25
|
-
toJSON(): (I | {
|
|
25
|
+
toJSON(): (I$1 | {
|
|
26
26
|
[x: string]: any;
|
|
27
27
|
[x: number]: any;
|
|
28
28
|
[x: symbol]: any;
|
|
29
29
|
})[];
|
|
30
30
|
toJson(...args: any[]): string;
|
|
31
|
-
[Symbol.iterator]: () => Iterator<I>;
|
|
31
|
+
[Symbol.iterator]: () => Iterator<I$1>;
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region types/modeling.d.ts
|
|
@@ -42,25 +42,25 @@ interface Attribute$1 {
|
|
|
42
42
|
withCaching?: boolean;
|
|
43
43
|
withObjectCaching?: boolean;
|
|
44
44
|
}
|
|
45
|
-
type Relation$1<M extends Model$
|
|
46
|
-
interface HasOneOrMany<M extends Model$
|
|
45
|
+
type Relation$1<M extends Model$2> = IBuilder<M, any> & {};
|
|
46
|
+
interface HasOneOrMany<M extends Model$2> extends Relation$1<M> {
|
|
47
47
|
save(model: M): Promise<M>;
|
|
48
48
|
saveMany(models: M[] | ICollection<M>): Promise<ICollection<M>>;
|
|
49
49
|
create(attributes?: any): Promise<M>;
|
|
50
50
|
createMany(records: any[]): Promise<ICollection<M>>;
|
|
51
51
|
}
|
|
52
|
-
interface HasOne<M extends Model$
|
|
52
|
+
interface HasOne<M extends Model$2> extends HasOneOrMany<M> {
|
|
53
53
|
getResults(): Promise<M | null>;
|
|
54
54
|
withDefault(callback?: TFunction | object): this;
|
|
55
55
|
}
|
|
56
|
-
interface HasMany<M extends Model$
|
|
56
|
+
interface HasMany<M extends Model$2> extends HasOneOrMany<M> {
|
|
57
57
|
getResults(): Promise<ICollection<M>>;
|
|
58
58
|
}
|
|
59
|
-
interface BelongsTo<M extends Model$
|
|
59
|
+
interface BelongsTo<M extends Model$2> extends Relation$1<M> {
|
|
60
60
|
getResults(): Promise<M | null>;
|
|
61
61
|
withDefault(callback?: TFunction | object): this;
|
|
62
62
|
}
|
|
63
|
-
interface BelongsToMany<M extends Model$
|
|
63
|
+
interface BelongsToMany<M extends Model$2> extends Relation$1<M> {
|
|
64
64
|
getResults(): Promise<ICollection<M>>;
|
|
65
65
|
withTimestamps(): this;
|
|
66
66
|
wherePivot(column: any, operator?: any, value?: any, boolean?: string, ...args: any[]): this;
|
|
@@ -86,20 +86,20 @@ interface IModel {
|
|
|
86
86
|
exists: boolean;
|
|
87
87
|
connection?: TBaseConfig['client'] | null;
|
|
88
88
|
perPage: number;
|
|
89
|
-
with: string | string[] | TGeneric<(...args: any[]) => IBuilder<Model$
|
|
89
|
+
with: string | string[] | TGeneric<(...args: any[]) => IBuilder<Model$2>>;
|
|
90
90
|
trx: AnyQueryBuilder | null;
|
|
91
91
|
timestamps: boolean;
|
|
92
92
|
dateFormat: string;
|
|
93
93
|
visible: string[];
|
|
94
94
|
hidden: string[];
|
|
95
|
-
query<T extends {
|
|
95
|
+
query<T$1 extends {
|
|
96
96
|
prototype: unknown;
|
|
97
|
-
}>(this: T, client?: AnyQueryBuilder | null): IBuilder<Model$
|
|
98
|
-
on<T extends {
|
|
97
|
+
}>(this: T$1, client?: AnyQueryBuilder | null): IBuilder<Model$2>;
|
|
98
|
+
on<T$1 extends {
|
|
99
99
|
prototype: unknown;
|
|
100
|
-
}>(this: T, connection: string | null): IBuilder<Model$
|
|
100
|
+
}>(this: T$1, connection: string | null): IBuilder<Model$2>;
|
|
101
101
|
boot(): void;
|
|
102
|
-
make<T extends IModel>(this: new () => T, attributes?: TGeneric): T;
|
|
102
|
+
make<T$1 extends IModel>(this: new () => T$1, attributes?: TGeneric): T$1;
|
|
103
103
|
addHook(hook: Hook, callback: TFunction): void;
|
|
104
104
|
creating(callback: TFunction): void;
|
|
105
105
|
created(callback: TFunction): void;
|
|
@@ -139,13 +139,13 @@ interface IModel {
|
|
|
139
139
|
fill(attributes: any): this;
|
|
140
140
|
setAppends(appends: string[]): this;
|
|
141
141
|
append(key: string | string[]): this;
|
|
142
|
-
getRelation<T extends Model$
|
|
143
|
-
setRelation<T extends Model$
|
|
142
|
+
getRelation<T$1 extends Model$2>(relation: string): T$1 | ICollection<T$1> | null | undefined;
|
|
143
|
+
setRelation<T$1 extends Model$2>(relation: string, value: T$1 | ICollection<T$1> | null): this;
|
|
144
144
|
unsetRelation(relation: string): this;
|
|
145
145
|
relationLoaded(relation: string): boolean;
|
|
146
146
|
makeVisible(attributes: string | string[]): this;
|
|
147
147
|
makeHidden(attributes: string | string[]): this;
|
|
148
|
-
newCollection(models?: any[]): ICollection<Model$
|
|
148
|
+
newCollection(models?: any[]): ICollection<Model$2>;
|
|
149
149
|
load(relations: WithRelationType): Promise<this>;
|
|
150
150
|
load(...relations: WithRelationType[]): Promise<this>;
|
|
151
151
|
loadAggregate(relations: WithRelationType, column: any, callback?: any): Promise<this>;
|
|
@@ -187,32 +187,32 @@ interface IModel {
|
|
|
187
187
|
push(): Promise<boolean>;
|
|
188
188
|
is(model: this): boolean;
|
|
189
189
|
isNot(model: this): boolean;
|
|
190
|
-
related<T extends RelationNames<this>>(relation: T): ReturnTypeOfMethod<this, `relation${Capitalize<SnakeToCamelCase<T>>}`>;
|
|
191
|
-
getRelated<T extends RelationNames<this>>(relation: T): ReturnTypeOfMethod<ReturnTypeOfMethod<this, `relation${Capitalize<SnakeToCamelCase<T>>}`>, any>;
|
|
192
|
-
hasOne<T extends Model$
|
|
193
|
-
hasMany<T extends Model$
|
|
194
|
-
belongsTo<T extends Model$
|
|
195
|
-
belongsToMany<T extends Model$
|
|
190
|
+
related<T$1 extends RelationNames<this>>(relation: T$1): ReturnTypeOfMethod<this, `relation${Capitalize<SnakeToCamelCase<T$1>>}`>;
|
|
191
|
+
getRelated<T$1 extends RelationNames<this>>(relation: T$1): ReturnTypeOfMethod<ReturnTypeOfMethod<this, `relation${Capitalize<SnakeToCamelCase<T$1>>}`>, any>;
|
|
192
|
+
hasOne<T$1 extends Model$2>(model: new () => T$1, foreignKey?: string, localKey?: string): HasOne<T$1>;
|
|
193
|
+
hasMany<T$1 extends Model$2>(model: new () => T$1, foreignKey?: string, localKey?: string): HasMany<T$1>;
|
|
194
|
+
belongsTo<T$1 extends Model$2>(model: new () => T$1, foreignKey?: string, ownerKey?: string, relation?: string): BelongsTo<T$1>;
|
|
195
|
+
belongsToMany<T$1 extends Model$2>(model: new () => T$1, table?: string, foreignPivotKey?: string, relatedPivotKey?: string, parentKey?: string, relatedKey?: string): BelongsToMany<T$1>;
|
|
196
196
|
}
|
|
197
197
|
//#endregion
|
|
198
198
|
//#region src/collection.d.ts
|
|
199
|
-
declare class Collection$2<I extends Model$
|
|
199
|
+
declare class Collection$2<I$1 extends Model$2 | Model$1> extends Collection$1<I$1> implements ICollection<I$1> {
|
|
200
200
|
private newConstructor;
|
|
201
|
-
getConstructor<T extends typeof Collection$2<I>>(this: InstanceType<T>): T;
|
|
202
|
-
load(...relations: (string[] | I[] | string | I)[]): Promise<Collection$2<I>>;
|
|
203
|
-
loadAggregate<I>(relations: I, column: string, action?: string | null | TFunction): Promise<this>;
|
|
204
|
-
loadCount(relations: I): Promise<this>;
|
|
205
|
-
loadMax(relation: I, column: string): Promise<this>;
|
|
206
|
-
loadMin(relation: I, column: string): Promise<this>;
|
|
207
|
-
loadSum(relation: I, column: string): Promise<this>;
|
|
208
|
-
loadAvg(relation: I, column: string): Promise<this>;
|
|
201
|
+
getConstructor<T$1 extends typeof Collection$2<I$1>>(this: InstanceType<T$1>): T$1;
|
|
202
|
+
load(...relations: (string[] | I$1[] | string | I$1)[]): Promise<Collection$2<I$1>>;
|
|
203
|
+
loadAggregate<I$1>(relations: I$1, column: string, action?: string | null | TFunction): Promise<this>;
|
|
204
|
+
loadCount(relations: I$1): Promise<this>;
|
|
205
|
+
loadMax(relation: I$1, column: string): Promise<this>;
|
|
206
|
+
loadMin(relation: I$1, column: string): Promise<this>;
|
|
207
|
+
loadSum(relation: I$1, column: string): Promise<this>;
|
|
208
|
+
loadAvg(relation: I$1, column: string): Promise<this>;
|
|
209
209
|
mapThen(callback: () => void): Promise<void[]>;
|
|
210
210
|
modelKeys(): any[];
|
|
211
|
-
contains<K, V>(key: keyof I | K | TFunction, value?: V): boolean;
|
|
211
|
+
contains<K$1, V>(key: keyof I$1 | K$1 | TFunction, value?: V): boolean;
|
|
212
212
|
diff(items: ICollection<any> | any[]): any;
|
|
213
213
|
except(keys: any[]): any;
|
|
214
|
-
intersect(items: I[]): any;
|
|
215
|
-
unique(key?: TFunction | keyof I, _strict?: boolean): any;
|
|
214
|
+
intersect(items: I$1[]): any;
|
|
215
|
+
unique(key?: TFunction | keyof I$1, _strict?: boolean): any;
|
|
216
216
|
find(key: any, defaultValue?: null): any;
|
|
217
217
|
fresh(...args: any[]): Promise<any>;
|
|
218
218
|
makeVisible(attributes: any): this;
|
|
@@ -225,20 +225,20 @@ declare class Collection$2<I extends Model$1 | Model> extends Collection$1<I> im
|
|
|
225
225
|
[x: string]: any;
|
|
226
226
|
[x: number]: any;
|
|
227
227
|
[x: symbol]: any;
|
|
228
|
-
} | I)[];
|
|
228
|
+
} | I$1)[];
|
|
229
229
|
toJSON(): ({
|
|
230
230
|
[x: string]: any;
|
|
231
231
|
[x: number]: any;
|
|
232
232
|
[x: symbol]: any;
|
|
233
|
-
} | I)[];
|
|
233
|
+
} | I$1)[];
|
|
234
234
|
toJson(...args: any[]): string;
|
|
235
|
-
[Symbol.iterator]: () => Iterator<I>;
|
|
235
|
+
[Symbol.iterator]: () => Iterator<I$1>;
|
|
236
236
|
}
|
|
237
237
|
//#endregion
|
|
238
238
|
//#region src/paginator.d.ts
|
|
239
|
-
declare class Paginator$1<T extends Model$
|
|
239
|
+
declare class Paginator$1<T$1 extends Model$2, K$1 extends IPaginatorParams = IPaginatorParams> implements IPaginator<T$1, K$1> {
|
|
240
240
|
static formatter: (paginator: IPaginator<any>) => any | null;
|
|
241
|
-
_items: Collection$2<T>;
|
|
241
|
+
_items: Collection$2<T$1>;
|
|
242
242
|
_total: number;
|
|
243
243
|
_perPage: number;
|
|
244
244
|
_lastPage: number;
|
|
@@ -246,15 +246,15 @@ declare class Paginator$1<T extends Model$1, K extends IPaginatorParams = IPagin
|
|
|
246
246
|
hasMore: boolean;
|
|
247
247
|
options: TGeneric;
|
|
248
248
|
static setFormatter(formatter?: ((paginator: IPaginator<any> | null) => any) | null): void;
|
|
249
|
-
constructor(items: T[], total: number, perPage: number, currentPage?: number, options?: TGeneric);
|
|
250
|
-
setItems(items: T[]): void;
|
|
249
|
+
constructor(items: T$1[], total: number, perPage: number, currentPage?: number, options?: TGeneric);
|
|
250
|
+
setItems(items: T$1[]): void;
|
|
251
251
|
firstItem(): number | null;
|
|
252
252
|
lastItem(): number | null;
|
|
253
253
|
hasMorePages(): boolean;
|
|
254
|
-
get(index: number): T | null;
|
|
254
|
+
get(index: number): T$1 | null;
|
|
255
255
|
count(): number;
|
|
256
|
-
items(): Collection$2<T>;
|
|
257
|
-
map(callback: (value: T, index: number) => T): Collection$2<T>;
|
|
256
|
+
items(): Collection$2<T$1>;
|
|
257
|
+
map(callback: (value: T$1, index: number) => T$1): Collection$2<T$1>;
|
|
258
258
|
currentPage(): number;
|
|
259
259
|
onFirstPage(): boolean;
|
|
260
260
|
perPage(): number;
|
|
@@ -266,33 +266,33 @@ declare class Paginator$1<T extends Model$1, K extends IPaginatorParams = IPagin
|
|
|
266
266
|
}
|
|
267
267
|
//#endregion
|
|
268
268
|
//#region src/scope.d.ts
|
|
269
|
-
declare class Scope<M extends Model$
|
|
269
|
+
declare class Scope<M extends Model$2 = Model$2> implements IScope {
|
|
270
270
|
constructor();
|
|
271
271
|
apply(_builder: Builder<M>, _model: M): void;
|
|
272
272
|
}
|
|
273
273
|
//#endregion
|
|
274
274
|
//#region src/builder.d.ts
|
|
275
275
|
declare const Inference$1: {
|
|
276
|
-
new <M extends Model$
|
|
276
|
+
new <M extends Model$2 | Model$1 = Model$2, R$1 = IModel | ICollection<M>>(): IBuilder<M, R$1>;
|
|
277
277
|
};
|
|
278
|
-
declare class Builder<M extends Model$
|
|
279
|
-
query: IBuilder<M, R>;
|
|
278
|
+
declare class Builder<M extends Model$2 = Model$2, R$1 = IModel | ICollection<M>> extends Inference$1 {
|
|
279
|
+
query: IBuilder<M, R$1>;
|
|
280
280
|
connection: any;
|
|
281
281
|
model: M;
|
|
282
282
|
actions: any[];
|
|
283
|
-
localMacros: TGeneric<(...args: any[]) => any, keyof Omit<IBuilder<M, R>, number>>;
|
|
283
|
+
localMacros: TGeneric<(...args: any[]) => any, keyof Omit<IBuilder<M, R$1>, number>>;
|
|
284
284
|
eagerLoad: TGeneric<(...args: any[]) => any>;
|
|
285
|
-
globalScopes: TGeneric<Scope<M> | ((arg: Builder<M, R>) => Builder<M, R>)>;
|
|
286
|
-
onDeleteCallback?: (builder: Builder<M, R>) => Promise<boolean | number>;
|
|
287
|
-
constructor(query: IBuilder<M, R>);
|
|
288
|
-
asProxy(): Builder<M, R>;
|
|
285
|
+
globalScopes: TGeneric<Scope<M> | ((arg: Builder<M, R$1>) => Builder<M, R$1>)>;
|
|
286
|
+
onDeleteCallback?: (builder: Builder<M, R$1>) => Promise<boolean | number>;
|
|
287
|
+
constructor(query: IBuilder<M, R$1>);
|
|
288
|
+
asProxy(): Builder<M, R$1>;
|
|
289
289
|
orWhere(...args: any[]): this;
|
|
290
290
|
chunk<C extends TFunction>(count: number, callback: C): Promise<boolean>;
|
|
291
291
|
enforceOrderBy(this: any): void;
|
|
292
292
|
clone(this: any): any;
|
|
293
293
|
forPage(this: any, page: number, perPage?: number): any;
|
|
294
294
|
insert(...args: Parameters<typeof this.query.insert>): Promise<any>;
|
|
295
|
-
update<T extends TGeneric>(values: T): Promise<any>;
|
|
295
|
+
update<T$1 extends TGeneric>(values: T$1): Promise<any>;
|
|
296
296
|
increment(column: string, amount?: number, extra?: {}): Promise<any>;
|
|
297
297
|
decrement(column: string, amount?: number, extra?: {}): Promise<any>;
|
|
298
298
|
addUpdatedAtColumn(values: TGeneric<string>): TGeneric<string>;
|
|
@@ -301,9 +301,9 @@ declare class Builder<M extends Model$1 = Model$1, R = IModel | ICollection<M>>
|
|
|
301
301
|
forceDelete(): Promise<number | boolean>;
|
|
302
302
|
create(attributes?: {}): Promise<any>;
|
|
303
303
|
newModelInstance(attributes?: {}): any;
|
|
304
|
-
getQuery(): IBuilder<M, R>;
|
|
304
|
+
getQuery(): IBuilder<M, R$1>;
|
|
305
305
|
getModel(): M;
|
|
306
|
-
setModel<MO extends Model$
|
|
306
|
+
setModel<MO extends Model$2>(model: MO): this;
|
|
307
307
|
qualifyColumn(column: string): string;
|
|
308
308
|
setTable(table: string): this;
|
|
309
309
|
applyScopes(): this;
|
|
@@ -366,15 +366,15 @@ declare class Builder<M extends Model$1 = Model$1, R = IModel | ICollection<M>>
|
|
|
366
366
|
findMany(this: any, ids: string[] | number[] | ICollection<any>, columns?: string[]): Promise<any>;
|
|
367
367
|
pluck(column: string): Promise<any>;
|
|
368
368
|
destroy(this: any, ids?: string | number | string[] | number[] | TFunction | Collection$2<M>): Promise<number>;
|
|
369
|
-
get<M extends Model$
|
|
369
|
+
get<M extends Model$2>(columns?: string | string[]): Promise<Collection$2<M>>;
|
|
370
370
|
all(columns?: string[]): Promise<any>;
|
|
371
371
|
paginate(this: any, page?: number, perPage?: number): Promise<Paginator$1<any, IPaginatorParams>>;
|
|
372
372
|
getModels(...columns: any[]): Promise<any[]>;
|
|
373
373
|
getRelation(name: string): any;
|
|
374
374
|
relationsNestedUnder(relation: string): TGeneric;
|
|
375
375
|
isNestedUnder(relation: string, name: string): boolean;
|
|
376
|
-
eagerLoadRelation<M extends Model$
|
|
377
|
-
eagerLoadRelations<M extends Model$
|
|
376
|
+
eagerLoadRelation<M extends Model$2>(models: M[], name: string, constraints: any): Promise<any>;
|
|
377
|
+
eagerLoadRelations<M extends Model$2>(models: M[]): Promise<M[]>;
|
|
378
378
|
hydrate(items: any[] | ICollection<any>): Collection$2<any>;
|
|
379
379
|
}
|
|
380
380
|
//#endregion
|
|
@@ -477,11 +477,11 @@ interface IStatement {
|
|
|
477
477
|
nulls: boolean;
|
|
478
478
|
bool: 'and' | 'or' | 'not';
|
|
479
479
|
}
|
|
480
|
-
interface IQueryBuilder<M extends Model$
|
|
481
|
-
query: IBuilder<M, R>;
|
|
480
|
+
interface IQueryBuilder<M extends Model$2 | Model$1 = Model$2, R$1 = M[] | M> {
|
|
481
|
+
query: IBuilder<M, R$1>;
|
|
482
482
|
schema: SchemaBuilder;
|
|
483
483
|
_statements: IStatement[];
|
|
484
|
-
table(name: string): IQueryBuilder<M, R>;
|
|
484
|
+
table(name: string): IQueryBuilder<M, R$1>;
|
|
485
485
|
select: SelectMethod<this>;
|
|
486
486
|
addSelect: AddSelectMethod<this>;
|
|
487
487
|
columns: SelectMethod<this>;
|
|
@@ -490,7 +490,7 @@ interface IQueryBuilder<M extends Model$1 | Model = Model$1, R = M[] | M> {
|
|
|
490
490
|
returning: ReturningMethod<this>;
|
|
491
491
|
distinctOn: SelectMethod<this>;
|
|
492
492
|
as: AsMethod<this>;
|
|
493
|
-
asProxy(): IQueryBuilder<M, R>;
|
|
493
|
+
asProxy(): IQueryBuilder<M, R$1>;
|
|
494
494
|
where: WhereMethod<this>;
|
|
495
495
|
firstOrFail: FirstOrFailMethod<this>;
|
|
496
496
|
forceDelete: ForceDeleteMethod;
|
|
@@ -582,7 +582,7 @@ interface IQueryBuilder<M extends Model$1 | Model = Model$1, R = M[] | M> {
|
|
|
582
582
|
transaction(callback?: TFunction): Promise<Knex.Transaction> | undefined;
|
|
583
583
|
destroy(callback: TFunction): Promise<number>;
|
|
584
584
|
destroy(): Promise<number>;
|
|
585
|
-
clone(): IQueryBuilder<M, R>;
|
|
585
|
+
clone(): IQueryBuilder<M, R$1>;
|
|
586
586
|
raw: Knex.RawQueryBuilder<TGeneric, M>;
|
|
587
587
|
get(columns?: string[]): Promise<any>;
|
|
588
588
|
first(columns?: string[]): Promise<M | null | undefined>;
|
|
@@ -600,7 +600,7 @@ interface IQueryBuilder<M extends Model$1 | Model = Model$1, R = M[] | M> {
|
|
|
600
600
|
take(count: number): this;
|
|
601
601
|
limit(count: number): this;
|
|
602
602
|
offset(count: number): this;
|
|
603
|
-
pluck<X extends Model$
|
|
603
|
+
pluck<X extends Model$2 = any>(column: string): Promise<Array<X>>;
|
|
604
604
|
chunk(count: number, callback: (rows: M[]) => any): Promise<boolean>;
|
|
605
605
|
forPage(page: number, perPage?: number): this;
|
|
606
606
|
paginate<F extends IPaginatorParams>(page?: number, perPage?: number): Promise<IPaginator<M, F>>;
|
|
@@ -608,19 +608,19 @@ interface IQueryBuilder<M extends Model$1 | Model = Model$1, R = M[] | M> {
|
|
|
608
608
|
//#endregion
|
|
609
609
|
//#region src/query-builder.d.ts
|
|
610
610
|
declare const Inference: {
|
|
611
|
-
new <M extends Model$
|
|
611
|
+
new <M extends Model$2 = Model$2, R$1 = M[] | M>(): IQueryBuilder<M, R$1>;
|
|
612
612
|
};
|
|
613
|
-
declare class QueryBuilder<M extends Model$
|
|
613
|
+
declare class QueryBuilder<M extends Model$2 = Model$2, R$1 = M[] | M> extends Inference<M, R$1> {
|
|
614
614
|
model: M;
|
|
615
615
|
schema: SchemaBuilder;
|
|
616
|
-
connector: IQueryBuilder<M, R> & Knex.QueryBuilder & {
|
|
616
|
+
connector: IQueryBuilder<M, R$1> & Knex.QueryBuilder & {
|
|
617
617
|
_statements: any[];
|
|
618
618
|
_single: any;
|
|
619
619
|
} & Knex;
|
|
620
620
|
constructor(config: TConfig | null, connector: TFunction);
|
|
621
621
|
asProxy(): any;
|
|
622
622
|
beginTransaction(): Promise<Knex.Transaction<any, any[]>>;
|
|
623
|
-
table<X extends M>(table: string): IQueryBuilder<X, R>;
|
|
623
|
+
table<X extends M>(table: string): IQueryBuilder<X, R$1>;
|
|
624
624
|
transaction(callback?: TFunction): Promise<Knex.Transaction> | undefined;
|
|
625
625
|
find(id: string | number, columns?: string[]): Promise<any>;
|
|
626
626
|
get(_columns?: string[]): Promise<any>;
|
|
@@ -636,7 +636,7 @@ declare class QueryBuilder<M extends Model$1 = Model$1, R = M[] | M> extends Inf
|
|
|
636
636
|
max(column: string): Promise<number>;
|
|
637
637
|
sum(column: string): Promise<number>;
|
|
638
638
|
avg(column: string): Promise<number>;
|
|
639
|
-
clone(): IQueryBuilder<M, R>;
|
|
639
|
+
clone(): IQueryBuilder<M, R$1>;
|
|
640
640
|
delete(): Promise<number | boolean>;
|
|
641
641
|
insert(...args: Parameters<typeof this.connector.insert>): Promise<unknown>;
|
|
642
642
|
update(...args: Parameters<typeof this.connector.update>): Promise<number>;
|
|
@@ -703,13 +703,13 @@ declare class Attribute {
|
|
|
703
703
|
//#endregion
|
|
704
704
|
//#region src/casts-attributes.d.ts
|
|
705
705
|
interface ICastsAttributes {
|
|
706
|
-
get?(model: Model$
|
|
707
|
-
set?(model: Model$
|
|
706
|
+
get?(model: Model$2, key: string, value: string, attributes: TGeneric): string | null | undefined;
|
|
707
|
+
set?(model: Model$2, key: string, value: string, attributes: TGeneric): string | null | undefined;
|
|
708
708
|
}
|
|
709
709
|
declare class CastsAttributes implements ICastsAttributes {
|
|
710
710
|
constructor();
|
|
711
|
-
static get(_model: Model$
|
|
712
|
-
static set(_model: Model$
|
|
711
|
+
static get(_model: Model$2, _key: string, _value: string, _attributes: TGeneric): string | null | undefined;
|
|
712
|
+
static set(_model: Model$2, _key: string, _value: string, _attributes: TGeneric): string | null | undefined;
|
|
713
713
|
}
|
|
714
714
|
//#endregion
|
|
715
715
|
//#region src/concerns/has-unique-ids.d.ts
|
|
@@ -724,21 +724,21 @@ declare const HasUniqueIds: <TBase extends MixinConstructor>(Model: TBase) => {
|
|
|
724
724
|
} & TBase;
|
|
725
725
|
//#endregion
|
|
726
726
|
//#region src/arquebus.d.ts
|
|
727
|
-
declare class arquebus<M extends Model$
|
|
727
|
+
declare class arquebus<M extends Model$2 = Model$2> {
|
|
728
728
|
static connectorFactory: typeof Knex$1 | null;
|
|
729
729
|
static instance: arquebus | null;
|
|
730
730
|
manager: Record<string, QueryBuilder<M>>;
|
|
731
731
|
connections: Record<string, TConfig>;
|
|
732
|
-
models: Record<string, typeof Model$
|
|
732
|
+
models: Record<string, typeof Model$2>;
|
|
733
733
|
constructor();
|
|
734
|
-
getConstructor<T extends typeof arquebus>(this: InstanceType<T>): T;
|
|
735
|
-
static getInstance(): arquebus<Model$
|
|
734
|
+
getConstructor<T$1 extends typeof arquebus>(this: InstanceType<T$1>): T$1;
|
|
735
|
+
static getInstance(): arquebus<Model$2>;
|
|
736
736
|
/**
|
|
737
737
|
* Initialize a new database connection
|
|
738
738
|
*
|
|
739
739
|
* @returns
|
|
740
740
|
*/
|
|
741
|
-
static fire<C extends TBaseConfig['client']>(connection?: C | null): QueryBuilder<Model$
|
|
741
|
+
static fire<C extends TBaseConfig['client']>(connection?: C | null): QueryBuilder<Model$2>;
|
|
742
742
|
/**
|
|
743
743
|
* Initialize a new database connection
|
|
744
744
|
*
|
|
@@ -749,16 +749,16 @@ declare class arquebus<M extends Model$1 = Model$1> {
|
|
|
749
749
|
*
|
|
750
750
|
* @returns
|
|
751
751
|
*/
|
|
752
|
-
static connection<C extends TBaseConfig['client']>(connection?: C | null): QueryBuilder<Model$
|
|
752
|
+
static connection<C extends TBaseConfig['client']>(connection?: C | null): QueryBuilder<Model$2, Model$2 | Model$2[]>;
|
|
753
753
|
static setConnectorFactory(connectorFactory: typeof Knex$1): void;
|
|
754
754
|
static getConnectorFactory(): typeof Knex$1;
|
|
755
755
|
static addConnection(config: TConfig | TBaseConfig, name?: string): void;
|
|
756
756
|
static beginTransaction(connection?: null): Promise<Knex$1.Knex.Transaction<any, any[]>>;
|
|
757
|
-
static transaction<A, R>(callback: TFunction<A[], R>, connection?: null): Promise<Knex$1.Knex.Transaction<any, any[]>> | undefined;
|
|
758
|
-
static table(name: string, connection?: null): IQueryBuilder<Model$
|
|
757
|
+
static transaction<A, R$1>(callback: TFunction<A[], R$1>, connection?: null): Promise<Knex$1.Knex.Transaction<any, any[]>> | undefined;
|
|
758
|
+
static table(name: string, connection?: null): IQueryBuilder<Model$2, Model$2 | Model$2[]>;
|
|
759
759
|
static schema(connection?: null): SchemaBuilder;
|
|
760
760
|
static destroyAll(): Promise<void>;
|
|
761
|
-
static createModel<X extends TGeneric>(name: string, options: X): typeof Model$
|
|
761
|
+
static createModel<X extends TGeneric>(name: string, options: X): typeof Model$2;
|
|
762
762
|
connection(connection?: string | null): QueryBuilder<M, M | M[]>;
|
|
763
763
|
getConnection(name?: string | null): QueryBuilder<M, M | M[]>;
|
|
764
764
|
addConnection(config: TConfig | TBaseConfig, name?: string): void;
|
|
@@ -778,7 +778,7 @@ declare class arquebus<M extends Model$1 = Model$1> {
|
|
|
778
778
|
table(name: string, connection?: null): IQueryBuilder<M, M | M[]>;
|
|
779
779
|
schema(connection?: null): SchemaBuilder;
|
|
780
780
|
destroyAll(): Promise<void>;
|
|
781
|
-
createModel(name: string, options?: ModelOptions): typeof Model$
|
|
781
|
+
createModel(name: string, options?: ModelOptions): typeof Model$2;
|
|
782
782
|
}
|
|
783
783
|
//#endregion
|
|
784
784
|
//#region src/errors.d.ts
|
|
@@ -800,16 +800,16 @@ declare class InvalidArgumentError extends BaseError {}
|
|
|
800
800
|
/**
|
|
801
801
|
* Helper type to extract instance type from constructor or mixin function
|
|
802
802
|
*/
|
|
803
|
-
type Constructor<T = TGeneric> = MixinConstructor<T>;
|
|
803
|
+
type Constructor<T$1 = TGeneric> = MixinConstructor<T$1>;
|
|
804
804
|
type Mixin<TBase extends Constructor> = (Base: TBase) => Constructor;
|
|
805
805
|
/**
|
|
806
806
|
* Helper type to convert union to intersection
|
|
807
807
|
*/
|
|
808
|
-
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
|
808
|
+
type UnionToIntersection<U$1> = (U$1 extends any ? (k: U$1) => void : never) extends ((k: infer I) => void) ? I : never;
|
|
809
809
|
/**
|
|
810
810
|
* Helper type to get static side of a constructor
|
|
811
811
|
*/
|
|
812
|
-
type Static<T> = { [K in keyof T]: T[K] };
|
|
812
|
+
type Static<T$1> = { [K in keyof T$1]: T$1[K] };
|
|
813
813
|
/**
|
|
814
814
|
* Compose function that merges multiple classes and mixins
|
|
815
815
|
*
|
|
@@ -873,7 +873,7 @@ declare const getAttrName: (attrMethod: string) => string;
|
|
|
873
873
|
* @param callback
|
|
874
874
|
* @returns
|
|
875
875
|
*/
|
|
876
|
-
declare const tap: <I>(instance: I, callback: (ins: I) => Promise<I> | I) => Promise<I> | I;
|
|
876
|
+
declare const tap: <I$1>(instance: I$1, callback: (ins: I$1) => Promise<I$1> | I$1) => Promise<I$1> | I$1;
|
|
877
877
|
declare const compose: typeof compose$1;
|
|
878
878
|
declare const flatten: <A = any>(arr: A[]) => (A extends readonly (infer InnerArr)[] ? InnerArr : A)[];
|
|
879
879
|
declare const flattenDeep: (arr: any) => any;
|
|
@@ -927,7 +927,7 @@ type TConfig = TBaseConfig & ({
|
|
|
927
927
|
connection: Knex.MariaSqlConnectionConfig;
|
|
928
928
|
useNullAsDefault?: boolean;
|
|
929
929
|
});
|
|
930
|
-
interface ModelOptions<M extends Model$
|
|
930
|
+
interface ModelOptions<M extends Model$2 = Model$2> {
|
|
931
931
|
table?: string;
|
|
932
932
|
scopes?: TGeneric<(...args: any[]) => Builder<M>>;
|
|
933
933
|
plugins?: (<X extends MixinConstructor<M>>(Model: X) => MixinConstructor<M>)[];
|
|
@@ -941,8 +941,8 @@ interface ModelOptions<M extends Model$1 = Model$1> {
|
|
|
941
941
|
primaryKey?: string;
|
|
942
942
|
incrementing?: boolean;
|
|
943
943
|
keyType?: 'int' | 'string';
|
|
944
|
-
with?: Model$
|
|
945
|
-
casts?: Model$
|
|
944
|
+
with?: Model$2['with'];
|
|
945
|
+
casts?: Model$2['casts'];
|
|
946
946
|
}
|
|
947
947
|
interface TField {
|
|
948
948
|
type: 'VAR_STRING' | 'BLOB' | 'DATETIME' | 'TIMESTAMP' | 'LONG' | 'JSON';
|
|
@@ -959,7 +959,7 @@ interface TField {
|
|
|
959
959
|
declare const BaseModel$1: (new (...args: any[]) => any) & {
|
|
960
960
|
[x: string]: any;
|
|
961
961
|
};
|
|
962
|
-
declare class Model extends BaseModel$1 {
|
|
962
|
+
declare class Model$1 extends BaseModel$1 {
|
|
963
963
|
protected primaryKey: string;
|
|
964
964
|
protected perPage: number;
|
|
965
965
|
static globalScopes: {};
|
|
@@ -969,9 +969,9 @@ declare class Model extends BaseModel$1 {
|
|
|
969
969
|
static browser: boolean;
|
|
970
970
|
connection: TBaseConfig['client'] | null;
|
|
971
971
|
constructor(attributes?: {});
|
|
972
|
-
static init(attributes?: {}): Model;
|
|
972
|
+
static init(attributes?: {}): Model$1;
|
|
973
973
|
static extend(plugin: TFunction, options: TGeneric): void;
|
|
974
|
-
static make(attributes?: TGeneric): Model;
|
|
974
|
+
static make(attributes?: TGeneric): Model$1;
|
|
975
975
|
bootIfNotBooted(this: any): void;
|
|
976
976
|
static booting(): void;
|
|
977
977
|
static boot(): void;
|
|
@@ -1010,55 +1010,55 @@ declare class Model extends BaseModel$1 {
|
|
|
1010
1010
|
fill(attributes: TGeneric): this;
|
|
1011
1011
|
transacting(trx: any): this;
|
|
1012
1012
|
trashed(): boolean;
|
|
1013
|
-
newPivot<E extends Model>(parent: E, attributes: TGeneric, table: string, exists: boolean, using?: typeof Pivot | null): Pivot;
|
|
1013
|
+
newPivot<E extends Model$1>(parent: E, attributes: TGeneric, table: string, exists: boolean, using?: typeof Pivot | null): Pivot;
|
|
1014
1014
|
qualifyColumn(column: string): string;
|
|
1015
1015
|
getQualifiedKeyName(): string;
|
|
1016
1016
|
is(model: any): any;
|
|
1017
1017
|
isNot(model: any): boolean;
|
|
1018
1018
|
}
|
|
1019
|
-
declare class Pivot extends Model {
|
|
1019
|
+
declare class Pivot extends Model$1 {
|
|
1020
1020
|
incrementing: boolean;
|
|
1021
1021
|
guarded: never[];
|
|
1022
|
-
pivotParent: Model | null;
|
|
1022
|
+
pivotParent: Model$1 | null;
|
|
1023
1023
|
foreignKey: string | null;
|
|
1024
1024
|
relatedKey: string | null;
|
|
1025
1025
|
setPivotKeys(foreignKey: string, relatedKey: string): this;
|
|
1026
|
-
static fromRawAttributes<E extends Model>(parent: E, attributes: TGeneric, table: string, exists?: boolean): Pivot;
|
|
1027
|
-
static fromAttributes<E extends Model>(parent: E, attributes: TGeneric, table: string, exists?: boolean): Pivot;
|
|
1026
|
+
static fromRawAttributes<E extends Model$1>(parent: E, attributes: TGeneric, table: string, exists?: boolean): Pivot;
|
|
1027
|
+
static fromAttributes<E extends Model$1>(parent: E, attributes: TGeneric, table: string, exists?: boolean): Pivot;
|
|
1028
1028
|
hasTimestampAttributes(this: any, attributes?: TGeneric | null): boolean;
|
|
1029
1029
|
}
|
|
1030
1030
|
//#endregion
|
|
1031
1031
|
//#region types/utils.d.ts
|
|
1032
|
-
interface ICollection<T extends Model$
|
|
1033
|
-
items?: T[];
|
|
1034
|
-
load(...relations: T[]): Promise<ICollection<T>>;
|
|
1035
|
-
loadAggregate(relations: T | T[], column: string, action?: string | null): Promise<this>;
|
|
1036
|
-
loadCount(relation: T, column: string): Promise<this>;
|
|
1037
|
-
loadMax(relation: T, column: string): Promise<this>;
|
|
1038
|
-
loadMin(relation: T, column: string): Promise<this>;
|
|
1039
|
-
loadSum(relation: T, column: string): Promise<this>;
|
|
1040
|
-
loadAvg(relation: T, column: string): Promise<this>;
|
|
1032
|
+
interface ICollection<T$1 extends Model$2 | Model$1> extends Collection$1<T$1> {
|
|
1033
|
+
items?: T$1[];
|
|
1034
|
+
load(...relations: T$1[]): Promise<ICollection<T$1>>;
|
|
1035
|
+
loadAggregate(relations: T$1 | T$1[], column: string, action?: string | null): Promise<this>;
|
|
1036
|
+
loadCount(relation: T$1, column: string): Promise<this>;
|
|
1037
|
+
loadMax(relation: T$1, column: string): Promise<this>;
|
|
1038
|
+
loadMin(relation: T$1, column: string): Promise<this>;
|
|
1039
|
+
loadSum(relation: T$1, column: string): Promise<this>;
|
|
1040
|
+
loadAvg(relation: T$1, column: string): Promise<this>;
|
|
1041
1041
|
mapThen(callback: () => void): Promise<any>;
|
|
1042
1042
|
modelKeys(): string[] | number[];
|
|
1043
1043
|
contains(key: IModel | any, operator?: any, value?: any): boolean;
|
|
1044
|
-
diff(items: ICollection<T> | any[]): ICollection<T>;
|
|
1045
|
-
except(keys: any[]): ICollection<T>;
|
|
1046
|
-
intersect(items: T[]): ICollection<T>;
|
|
1047
|
-
unique(key?: any, strict?: boolean): ICollection<T>;
|
|
1044
|
+
diff(items: ICollection<T$1> | any[]): ICollection<T$1>;
|
|
1045
|
+
except(keys: any[]): ICollection<T$1>;
|
|
1046
|
+
intersect(items: T$1[]): ICollection<T$1>;
|
|
1047
|
+
unique(key?: any, strict?: boolean): ICollection<T$1>;
|
|
1048
1048
|
find(key: any, defaultValue?: any): any;
|
|
1049
|
-
fresh(withs?: any[]): Promise<ICollection<T>>;
|
|
1049
|
+
fresh(withs?: any[]): Promise<ICollection<T$1>>;
|
|
1050
1050
|
makeVisible(attributes: string | string[]): this;
|
|
1051
1051
|
makeHidden(attributes: string | string[]): this;
|
|
1052
1052
|
append(attributes: string[]): this;
|
|
1053
1053
|
only(keys: null | any[]): this;
|
|
1054
1054
|
getDictionary(items?: any[]): TGeneric;
|
|
1055
|
-
toQuery(): IBuilder<T, any>;
|
|
1055
|
+
toQuery(): IBuilder<T$1, any>;
|
|
1056
1056
|
toData(): any;
|
|
1057
1057
|
toJSON(): any;
|
|
1058
1058
|
toJson(): string;
|
|
1059
1059
|
toString(): string;
|
|
1060
1060
|
[key: string]: any;
|
|
1061
|
-
[Symbol.iterator]: () => Iterator<T>;
|
|
1061
|
+
[Symbol.iterator]: () => Iterator<T$1>;
|
|
1062
1062
|
}
|
|
1063
1063
|
interface IPaginatorParams {
|
|
1064
1064
|
current_page: number;
|
|
@@ -1069,47 +1069,47 @@ interface IPaginatorParams {
|
|
|
1069
1069
|
count: number;
|
|
1070
1070
|
paginated?: boolean;
|
|
1071
1071
|
}
|
|
1072
|
-
interface IPaginator<T extends Model$
|
|
1072
|
+
interface IPaginator<T$1 extends Model$2 | Model$1, K$1 extends IPaginatorParams = IPaginatorParams> {
|
|
1073
1073
|
formatter?(paginator: IPaginator<any>): any | null;
|
|
1074
1074
|
setFormatter?(formatter: (paginator: IPaginator<any>) => any | null): void;
|
|
1075
|
-
setItems(items: T[] | Collection$2<T>): void;
|
|
1075
|
+
setItems(items: T$1[] | Collection$2<T$1>): void;
|
|
1076
1076
|
hasMorePages(): boolean;
|
|
1077
|
-
get(index: number): T | null;
|
|
1077
|
+
get(index: number): T$1 | null;
|
|
1078
1078
|
count(): number;
|
|
1079
|
-
items(): Collection$2<T>;
|
|
1080
|
-
map(callback: (value: T, index: number) => T): Collection$2<T>;
|
|
1079
|
+
items(): Collection$2<T$1>;
|
|
1080
|
+
map(callback: (value: T$1, index: number) => T$1): Collection$2<T$1>;
|
|
1081
1081
|
currentPage(): number;
|
|
1082
1082
|
perPage(): number;
|
|
1083
1083
|
lastPage(): number;
|
|
1084
1084
|
firstItem(): number | null;
|
|
1085
1085
|
lastItem(): number | null;
|
|
1086
1086
|
total(): number;
|
|
1087
|
-
toData<U = K>(): U;
|
|
1088
|
-
toJSON<U = K>(): U;
|
|
1087
|
+
toData<U$1 = K$1>(): U$1;
|
|
1088
|
+
toJSON<U$1 = K$1>(): U$1;
|
|
1089
1089
|
toJson(): string;
|
|
1090
1090
|
[Symbol.iterator]?(): {
|
|
1091
1091
|
next: () => {
|
|
1092
|
-
value: T;
|
|
1092
|
+
value: T$1;
|
|
1093
1093
|
done: boolean;
|
|
1094
1094
|
};
|
|
1095
1095
|
};
|
|
1096
1096
|
}
|
|
1097
1097
|
//#endregion
|
|
1098
1098
|
//#region types/builder.d.ts
|
|
1099
|
-
type BaseBuilder<M extends Model$
|
|
1099
|
+
type BaseBuilder<M extends Model$2 | Model$1, R$1 = ICollection<M> | IModel> = Omit<IQueryBuilder<M, R$1>, 'destroy' | 'clone' | 'get' | 'skip' | 'limit' | 'take' | 'offset' | 'chunk' | 'forPage' | 'orWhere' | 'pluck'>;
|
|
1100
1100
|
interface IScope {
|
|
1101
|
-
apply(builder: Builder<any>, model: Model$
|
|
1101
|
+
apply(builder: Builder<any>, model: Model$2): void;
|
|
1102
1102
|
}
|
|
1103
|
-
interface IBuilder<M extends Model$
|
|
1104
|
-
connector: IQueryBuilder<M, R> & Knex.QueryBuilder & {
|
|
1103
|
+
interface IBuilder<M extends Model$2 | Model$1, R$1 = ICollection<M> | IModel> extends BaseBuilder<M, R$1> {
|
|
1104
|
+
connector: IQueryBuilder<M, R$1> & Knex.QueryBuilder & {
|
|
1105
1105
|
_statements: any[];
|
|
1106
1106
|
_single: any;
|
|
1107
1107
|
} & Knex;
|
|
1108
|
-
asProxy(): IQueryBuilder<M, R>;
|
|
1108
|
+
asProxy(): IQueryBuilder<M, R$1>;
|
|
1109
1109
|
chunk(count: number, callback: (rows: ICollection<M>) => any): Promise<boolean>;
|
|
1110
1110
|
enforceOrderBy(): void;
|
|
1111
1111
|
idOf(id: string | number): this;
|
|
1112
|
-
clone(): IBuilder<M, R>;
|
|
1112
|
+
clone(): IBuilder<M, R$1>;
|
|
1113
1113
|
forPage(page: number, perPage?: number): this;
|
|
1114
1114
|
insert(...attributes: any[]): Promise<any>;
|
|
1115
1115
|
update(attributes: any): Promise<any>;
|
|
@@ -1174,7 +1174,7 @@ interface IBuilder<M extends Model$1 | Model, R = ICollection<M> | IModel> exten
|
|
|
1174
1174
|
oldest(column?: string): this;
|
|
1175
1175
|
find(key: string | number, columns?: string[]): Promise<M | null | undefined>;
|
|
1176
1176
|
findMany(keys: string[] | number[] | ICollection<any>, columns?: string[]): Promise<ICollection<M>>;
|
|
1177
|
-
pluck<X extends Model$
|
|
1177
|
+
pluck<X extends Model$2 = any | M>(column: string): Promise<ICollection<X>>;
|
|
1178
1178
|
destroy(ids?: string | number | string[] | number[] | TFunction | ICollection<any>): Promise<number>;
|
|
1179
1179
|
get(columns?: string[]): Promise<ICollection<M>>;
|
|
1180
1180
|
all(columns?: string[]): Promise<ICollection<M>>;
|
|
@@ -1189,8 +1189,8 @@ type FieldExpression = string;
|
|
|
1189
1189
|
type TableRef<QB extends AnyQueryBuilder> = ColumnRef | AnyQueryBuilder | CallbackVoid<QB>;
|
|
1190
1190
|
type Selection<QB extends AnyQueryBuilder> = ColumnRef | AnyQueryBuilder | CallbackVoid<QB>;
|
|
1191
1191
|
type QBOrCallback<QB extends AnyQueryBuilder> = AnyQueryBuilder | CallbackVoid<QB>;
|
|
1192
|
-
interface CallbackVoid<T> {
|
|
1193
|
-
(this: T, arg: T): void;
|
|
1192
|
+
interface CallbackVoid<T$1> {
|
|
1193
|
+
(this: T$1, arg: T$1): void;
|
|
1194
1194
|
}
|
|
1195
1195
|
type Raw = Knex.Raw;
|
|
1196
1196
|
type OrderByDirection = 'asc' | 'desc' | 'ASC' | 'DESC';
|
|
@@ -1198,11 +1198,11 @@ interface OrderByDescriptor {
|
|
|
1198
1198
|
column: ColumnRef;
|
|
1199
1199
|
order?: OrderByDirection;
|
|
1200
1200
|
}
|
|
1201
|
-
type AnyQueryBuilder<M extends Model$
|
|
1202
|
-
type Expression<T> = T | Raw | AnyQueryBuilder;
|
|
1201
|
+
type AnyQueryBuilder<M extends Model$2 = any, R$1 = any> = IQueryBuilder<M, R$1> | IBuilder<M, R$1>;
|
|
1202
|
+
type Expression<T$1> = T$1 | Raw | AnyQueryBuilder;
|
|
1203
1203
|
type ColumnRefOrOrderByDescriptor = ColumnRef | OrderByDescriptor;
|
|
1204
|
-
interface RawInterface<R> {
|
|
1205
|
-
(sql: string, ...bindings: any[]): R;
|
|
1204
|
+
interface RawInterface<R$1> {
|
|
1205
|
+
(sql: string, ...bindings: any[]): R$1;
|
|
1206
1206
|
}
|
|
1207
1207
|
interface BaseSetOperations<QB extends AnyQueryBuilder> {
|
|
1208
1208
|
(callbackOrBuilder: QBOrCallback<QB>, wrap?: boolean): QB;
|
|
@@ -1216,7 +1216,7 @@ interface GroupByMethod<QB extends AnyQueryBuilder> {
|
|
|
1216
1216
|
(columns: ColumnRef[]): QB;
|
|
1217
1217
|
}
|
|
1218
1218
|
type WithRelationType = {
|
|
1219
|
-
[key: string]: <T extends IBuilder<any>>(builder: T) => T | void;
|
|
1219
|
+
[key: string]: <T$1 extends IBuilder<any>>(builder: T$1) => T$1 | void;
|
|
1220
1220
|
} | string | string[];
|
|
1221
1221
|
interface SetOperationsMethod<QB extends AnyQueryBuilder> extends BaseSetOperations<QB> {
|
|
1222
1222
|
(...callbacksOrBuilders: QBOrCallback<QB>[]): QB;
|
|
@@ -1318,20 +1318,20 @@ declare const BaseModel: (new (...args: any[]) => any) & {
|
|
|
1318
1318
|
exists: boolean;
|
|
1319
1319
|
connection?: (TBaseConfig["client"] | null) | undefined;
|
|
1320
1320
|
perPage: number;
|
|
1321
|
-
with: string | string[] | TGeneric<(...args: any[]) => IBuilder<Model$
|
|
1321
|
+
with: string | string[] | TGeneric<(...args: any[]) => IBuilder<Model$2>>;
|
|
1322
1322
|
trx: AnyQueryBuilder | null;
|
|
1323
1323
|
timestamps: boolean;
|
|
1324
1324
|
dateFormat: string;
|
|
1325
1325
|
visible: string[] & any[];
|
|
1326
1326
|
hidden: string[] & any[];
|
|
1327
|
-
query: <T extends {
|
|
1327
|
+
query: <T$1 extends {
|
|
1328
1328
|
prototype: unknown;
|
|
1329
|
-
}>(this: T, client?: AnyQueryBuilder | null) => IBuilder<Model$
|
|
1330
|
-
on: <T extends {
|
|
1329
|
+
}>(this: T$1, client?: AnyQueryBuilder | null) => IBuilder<Model$2>;
|
|
1330
|
+
on: <T$1 extends {
|
|
1331
1331
|
prototype: unknown;
|
|
1332
|
-
}>(this: T, connection: string | null) => IBuilder<Model$
|
|
1332
|
+
}>(this: T$1, connection: string | null) => IBuilder<Model$2>;
|
|
1333
1333
|
boot: () => void;
|
|
1334
|
-
make: <T extends IModel>(this: new () => T, attributes?: TGeneric) => T;
|
|
1334
|
+
make: <T$1 extends IModel>(this: new () => T$1, attributes?: TGeneric) => T$1;
|
|
1335
1335
|
addHook: (hook: Hook, callback: TFunction) => void;
|
|
1336
1336
|
creating: (callback: TFunction) => void;
|
|
1337
1337
|
created: (callback: TFunction) => void;
|
|
@@ -2176,8 +2176,8 @@ declare const BaseModel: (new (...args: any[]) => any) & {
|
|
|
2176
2176
|
uniqueIds(): never[];
|
|
2177
2177
|
setUniqueIds(): void;
|
|
2178
2178
|
});
|
|
2179
|
-
getRelation: <T extends Model$
|
|
2180
|
-
setRelation: <T extends Model$
|
|
2179
|
+
getRelation: <T$1 extends Model$2>(relation: string) => T$1 | ICollection<T$1> | null | undefined;
|
|
2180
|
+
setRelation: <T$1 extends Model$2>(relation: string, value: T$1 | ICollection<T$1> | null) => (new () => IModel) & IModel & {
|
|
2181
2181
|
[x: string]: any;
|
|
2182
2182
|
timestamps: boolean;
|
|
2183
2183
|
dateFormat: string;
|
|
@@ -2662,7 +2662,7 @@ declare const BaseModel: (new (...args: any[]) => any) & {
|
|
|
2662
2662
|
uniqueIds(): never[];
|
|
2663
2663
|
setUniqueIds(): void;
|
|
2664
2664
|
});
|
|
2665
|
-
newCollection: (models?: any[]) => ICollection<Model$
|
|
2665
|
+
newCollection: (models?: any[]) => ICollection<Model$2>;
|
|
2666
2666
|
load: {
|
|
2667
2667
|
(relations: WithRelationType): Promise<(new () => IModel) & IModel & {
|
|
2668
2668
|
[x: string]: any;
|
|
@@ -4067,7 +4067,7 @@ declare const BaseModel: (new (...args: any[]) => any) & {
|
|
|
4067
4067
|
uniqueIds(): never[];
|
|
4068
4068
|
setUniqueIds(): void;
|
|
4069
4069
|
}) => boolean;
|
|
4070
|
-
related: <T extends never>(relation: T) => ReturnTypeOfMethod<(new () => IModel) & IModel & {
|
|
4070
|
+
related: <T$1 extends never>(relation: T$1) => ReturnTypeOfMethod<(new () => IModel) & IModel & {
|
|
4071
4071
|
[x: string]: any;
|
|
4072
4072
|
timestamps: boolean;
|
|
4073
4073
|
dateFormat: string;
|
|
@@ -4147,8 +4147,8 @@ declare const BaseModel: (new (...args: any[]) => any) & {
|
|
|
4147
4147
|
usesUniqueIds(): boolean;
|
|
4148
4148
|
uniqueIds(): never[];
|
|
4149
4149
|
setUniqueIds(): void;
|
|
4150
|
-
}, `relation${Capitalize<SnakeToCamelCase<T>>}`>;
|
|
4151
|
-
getRelated: <T extends never>(relation: T) => ReturnTypeOfMethod<ReturnTypeOfMethod<(new () => IModel) & IModel & {
|
|
4150
|
+
}, `relation${Capitalize<SnakeToCamelCase<T$1>>}`>;
|
|
4151
|
+
getRelated: <T$1 extends never>(relation: T$1) => ReturnTypeOfMethod<ReturnTypeOfMethod<(new () => IModel) & IModel & {
|
|
4152
4152
|
[x: string]: any;
|
|
4153
4153
|
timestamps: boolean;
|
|
4154
4154
|
dateFormat: string;
|
|
@@ -4228,11 +4228,11 @@ declare const BaseModel: (new (...args: any[]) => any) & {
|
|
|
4228
4228
|
usesUniqueIds(): boolean;
|
|
4229
4229
|
uniqueIds(): never[];
|
|
4230
4230
|
setUniqueIds(): void;
|
|
4231
|
-
}, `relation${Capitalize<SnakeToCamelCase<T>>}`>, any>;
|
|
4232
|
-
hasOne: <T extends Model$
|
|
4233
|
-
hasMany: <T extends Model$
|
|
4234
|
-
belongsTo: <T extends Model$
|
|
4235
|
-
belongsToMany: <T extends Model$
|
|
4231
|
+
}, `relation${Capitalize<SnakeToCamelCase<T$1>>}`>, any>;
|
|
4232
|
+
hasOne: <T$1 extends Model$2>(model: new () => T$1, foreignKey?: string, localKey?: string) => HasOne<T$1>;
|
|
4233
|
+
hasMany: <T$1 extends Model$2>(model: new () => T$1, foreignKey?: string, localKey?: string) => HasMany<T$1>;
|
|
4234
|
+
belongsTo: <T$1 extends Model$2>(model: new () => T$1, foreignKey?: string, ownerKey?: string, relation?: string) => BelongsTo<T$1>;
|
|
4235
|
+
belongsToMany: <T$1 extends Model$2>(model: new () => T$1, table?: string, foreignPivotKey?: string, relatedPivotKey?: string, parentKey?: string, relatedKey?: string) => BelongsToMany<T$1>;
|
|
4236
4236
|
original: TGeneric;
|
|
4237
4237
|
casts: TGeneric<typeof CastsAttributes | "int" | "json" | "string" | "date" | "boolean" | "datetime" | "collection">;
|
|
4238
4238
|
changes: TGeneric;
|
|
@@ -4748,7 +4748,7 @@ declare const BaseModel: (new (...args: any[]) => any) & {
|
|
|
4748
4748
|
getGlobalScopes: () => {};
|
|
4749
4749
|
useUniqueIds: boolean;
|
|
4750
4750
|
};
|
|
4751
|
-
declare class Model$
|
|
4751
|
+
declare class Model$2 extends BaseModel {
|
|
4752
4752
|
[key: string]: any;
|
|
4753
4753
|
protected builder: IBuilder<any, any> | null;
|
|
4754
4754
|
protected table: string | null;
|
|
@@ -4764,16 +4764,16 @@ declare class Model$1 extends BaseModel {
|
|
|
4764
4764
|
connection: TBaseConfig['client'] | null;
|
|
4765
4765
|
eagerLoad: {};
|
|
4766
4766
|
exists: boolean;
|
|
4767
|
-
with: string | string[] | TGeneric<(...args: any[]) => IBuilder<Model$
|
|
4767
|
+
with: string | string[] | TGeneric<(...args: any[]) => IBuilder<Model$2>>;
|
|
4768
4768
|
name: any;
|
|
4769
4769
|
trx: null;
|
|
4770
4770
|
constructor(attributes?: {});
|
|
4771
|
-
static query(trx?: null): Builder<Model$
|
|
4772
|
-
static on(connection?: TBaseConfig['client'] | null): Builder<Model$
|
|
4773
|
-
static init(attributes?: {}): Model$
|
|
4771
|
+
static query(trx?: null): Builder<Model$2, IModel | ICollection<Model$2>>;
|
|
4772
|
+
static on(connection?: TBaseConfig['client'] | null): Builder<Model$2, IModel | ICollection<Model$2>>;
|
|
4773
|
+
static init(attributes?: {}): Model$2;
|
|
4774
4774
|
static extend(plugin: TFunction, options: TGeneric): void;
|
|
4775
|
-
static make(attributes?: TGeneric): Model$
|
|
4776
|
-
getConstructor<T extends typeof Model$
|
|
4775
|
+
static make(attributes?: TGeneric): Model$2;
|
|
4776
|
+
getConstructor<T$1 extends typeof Model$2>(this: InstanceType<T$1>): T$1;
|
|
4777
4777
|
bootIfNotBooted(this: any): void;
|
|
4778
4778
|
static booting(): void;
|
|
4779
4779
|
static boot(): void;
|
|
@@ -4793,20 +4793,20 @@ declare class Model$1 extends BaseModel {
|
|
|
4793
4793
|
getConnection(this: any): any;
|
|
4794
4794
|
setConnection(connection: TBaseConfig['client'] | null): this;
|
|
4795
4795
|
getKeyType(): string;
|
|
4796
|
-
newQuery(trx?: null): Builder<Model$
|
|
4797
|
-
newQueryWithoutScopes(trx?: null): Builder<Model$
|
|
4798
|
-
newModelQuery(trx?: null): Builder<Model$
|
|
4799
|
-
addGlobalScopes(this: any, builder: Builder<Model$
|
|
4796
|
+
newQuery(trx?: null): Builder<Model$2, IModel | ICollection<Model$2>>;
|
|
4797
|
+
newQueryWithoutScopes(trx?: null): Builder<Model$2, IModel | ICollection<Model$2>>;
|
|
4798
|
+
newModelQuery(trx?: null): Builder<Model$2, IModel | ICollection<Model$2>>;
|
|
4799
|
+
addGlobalScopes(this: any, builder: Builder<Model$2>): Builder<Model$2, IModel | ICollection<Model$2>>;
|
|
4800
4800
|
hasNamedScope(name: string): boolean;
|
|
4801
4801
|
callNamedScope(scope: string, parameters: any[]): any;
|
|
4802
4802
|
setTable(table: string): this;
|
|
4803
|
-
newCollection(this: any, models?: never[]): Collection$2<Model$
|
|
4804
|
-
load<R extends WithRelationType>(this: any, ...relations: R[]): Promise<any>;
|
|
4805
|
-
loadAggregate<R extends WithRelationType>(relations: R[], column: string, callback?: TFunction | string | null): Promise<this>;
|
|
4806
|
-
loadCount<R extends WithRelationType>(...relations: R[]): Promise<this>;
|
|
4807
|
-
loadMax<R extends WithRelationType>(relations: R[], column: string): Promise<this>;
|
|
4808
|
-
loadMin<R extends WithRelationType>(relations: R[], column: string): Promise<this>;
|
|
4809
|
-
loadSum<R extends WithRelationType>(relations: R[], column: string): Promise<this>;
|
|
4803
|
+
newCollection(this: any, models?: never[]): Collection$2<Model$2>;
|
|
4804
|
+
load<R$1 extends WithRelationType>(this: any, ...relations: R$1[]): Promise<any>;
|
|
4805
|
+
loadAggregate<R$1 extends WithRelationType>(relations: R$1[], column: string, callback?: TFunction | string | null): Promise<this>;
|
|
4806
|
+
loadCount<R$1 extends WithRelationType>(...relations: R$1[]): Promise<this>;
|
|
4807
|
+
loadMax<R$1 extends WithRelationType>(relations: R$1[], column: string): Promise<this>;
|
|
4808
|
+
loadMin<R$1 extends WithRelationType>(relations: R$1[], column: string): Promise<this>;
|
|
4809
|
+
loadSum<R$1 extends WithRelationType>(relations: R$1[], column: string): Promise<this>;
|
|
4810
4810
|
increment(column: string, amount?: number, extra?: TGeneric, options?: TGeneric): Promise<any>;
|
|
4811
4811
|
decrement(column: string, amount?: number, extra?: TGeneric, options?: TGeneric): Promise<any>;
|
|
4812
4812
|
incrementOrDecrement(column: string, amount: number, extra: TGeneric, method: string, options: TGeneric): Promise<any>;
|
|
@@ -4835,60 +4835,60 @@ declare class Model$1 extends BaseModel {
|
|
|
4835
4835
|
forceDelete(options?: {}): Promise<boolean>;
|
|
4836
4836
|
fresh(this: any): any;
|
|
4837
4837
|
refresh(this: any): Promise<any>;
|
|
4838
|
-
newPivot<E extends Model$
|
|
4838
|
+
newPivot<E extends Model$2>(parent: E, attributes: TGeneric, table: string, exists: boolean, using?: typeof Pivot$1 | null): Pivot$1;
|
|
4839
4839
|
qualifyColumn(column: string): string;
|
|
4840
4840
|
getQualifiedKeyName(): string;
|
|
4841
4841
|
push(options?: {}): Promise<boolean>;
|
|
4842
4842
|
is(model: any): any;
|
|
4843
4843
|
isNot(model: any): boolean;
|
|
4844
4844
|
}
|
|
4845
|
-
declare class Pivot$1 extends Model$
|
|
4845
|
+
declare class Pivot$1 extends Model$2 {
|
|
4846
4846
|
incrementing: boolean;
|
|
4847
4847
|
guarded: never[];
|
|
4848
|
-
pivotParent: Model$
|
|
4848
|
+
pivotParent: Model$2 | null;
|
|
4849
4849
|
foreignKey: string | null;
|
|
4850
4850
|
relatedKey: string | null;
|
|
4851
4851
|
setPivotKeys(foreignKey: string, relatedKey: string): this;
|
|
4852
|
-
static fromRawAttributes<E extends Model$
|
|
4853
|
-
static fromAttributes<E extends Model$
|
|
4852
|
+
static fromRawAttributes<E extends Model$2>(parent: E, attributes: TGeneric, table: string, exists?: boolean): Pivot$1;
|
|
4853
|
+
static fromAttributes<E extends Model$2>(parent: E, attributes: TGeneric, table: string, exists?: boolean): Pivot$1;
|
|
4854
4854
|
hasTimestampAttributes(this: any, attributes?: TGeneric | null): boolean;
|
|
4855
4855
|
}
|
|
4856
4856
|
//#endregion
|
|
4857
4857
|
//#region types/generics.d.ts
|
|
4858
|
-
type TGeneric<V = any, K extends string = string> = Record<K, V>;
|
|
4859
|
-
type XGeneric<V = TGeneric, T = any> = {
|
|
4860
|
-
[key: string]: T;
|
|
4858
|
+
type TGeneric<V = any, K$1 extends string = string> = Record<K$1, V>;
|
|
4859
|
+
type XGeneric<V = TGeneric, T$1 = any> = {
|
|
4860
|
+
[key: string]: T$1;
|
|
4861
4861
|
} & V;
|
|
4862
4862
|
type Hook = 'creating' | 'created' | 'updating' | 'updated' | 'saving' | 'saved' | 'deleting' | 'deleted' | 'restoring' | 'restored' | 'trashed' | 'forceDeleted';
|
|
4863
4863
|
type TFunction<TArgs extends any[] = any[], TReturn = any> = (...args: TArgs) => TReturn;
|
|
4864
4864
|
type PrimitiveValue = string | number | boolean | Date | string[] | number[] | boolean[] | Date[] | null | Buffer;
|
|
4865
|
-
type ReturnTypeOfMethod<T, K extends keyof T> = T[K] extends ((...args: any[]) => infer R) ? R : never;
|
|
4865
|
+
type ReturnTypeOfMethod<T$1, K$1 extends keyof T$1> = T$1[K$1] extends ((...args: any[]) => infer R) ? R : never;
|
|
4866
4866
|
type SnakeToCamelCase<S extends string> = S extends `${infer T}_${infer U}` ? `${T}${Capitalize<SnakeToCamelCase<U>>}` : S;
|
|
4867
4867
|
type CamelToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ? U extends Uncapitalize<U> ? `${Uncapitalize<T>}${CamelToSnakeCase<U>}` : `${Uncapitalize<T>}_${CamelToSnakeCase<U>}` : S;
|
|
4868
|
-
type FunctionPropertyNames<T> = { [K in keyof T]: T[K] extends ((...args: any[]) => any) ? K : never }[keyof T];
|
|
4869
|
-
type RelationNames<T> = FunctionPropertyNames<T> extends infer R ? R extends `relation${infer P}` ? P extends 'sToData' | 'loaded' ? never : CamelToSnakeCase<P> : never : never;
|
|
4870
|
-
type MixinConstructor<T = TGeneric> = new (...args: any[]) => T;
|
|
4868
|
+
type FunctionPropertyNames<T$1> = { [K in keyof T$1]: T$1[K] extends ((...args: any[]) => any) ? K : never }[keyof T$1];
|
|
4869
|
+
type RelationNames<T$1> = FunctionPropertyNames<T$1> extends infer R ? R extends `relation${infer P}` ? P extends 'sToData' | 'loaded' ? never : CamelToSnakeCase<P> : never : never;
|
|
4870
|
+
type MixinConstructor<T$1 = TGeneric> = new (...args: any[]) => T$1;
|
|
4871
4871
|
//#endregion
|
|
4872
4872
|
//#region src/browser/paginator.d.ts
|
|
4873
|
-
declare class Paginator<T extends Model, K extends IPaginatorParams = IPaginatorParams> implements IPaginator<T, K> {
|
|
4873
|
+
declare class Paginator<T$1 extends Model$1, K$1 extends IPaginatorParams = IPaginatorParams> implements IPaginator<T$1, K$1> {
|
|
4874
4874
|
static formatter: (paginator: IPaginator<any>) => any | null;
|
|
4875
|
-
_items: Collection<T>;
|
|
4875
|
+
_items: Collection<T$1>;
|
|
4876
4876
|
_total: number;
|
|
4877
4877
|
_perPage: number;
|
|
4878
4878
|
_lastPage: number;
|
|
4879
4879
|
_currentPage: number;
|
|
4880
4880
|
hasMore: boolean;
|
|
4881
4881
|
options: TGeneric;
|
|
4882
|
-
constructor(items: T[], total: number, perPage: number, currentPage?: number, options?: TGeneric);
|
|
4882
|
+
constructor(items: T$1[], total: number, perPage: number, currentPage?: number, options?: TGeneric);
|
|
4883
4883
|
static setFormatter(formatter: (paginator: IPaginator<any>) => any | null): void;
|
|
4884
|
-
setItems(items: T[]): void;
|
|
4884
|
+
setItems(items: T$1[]): void;
|
|
4885
4885
|
firstItem(): number | null;
|
|
4886
4886
|
lastItem(): number | null;
|
|
4887
4887
|
hasMorePages(): boolean;
|
|
4888
|
-
get(index: number): T | null;
|
|
4888
|
+
get(index: number): T$1 | null;
|
|
4889
4889
|
count(): number;
|
|
4890
4890
|
items(): any;
|
|
4891
|
-
map(callback: (value: T, index: number) => T): any;
|
|
4891
|
+
map(callback: (value: T$1, index: number) => T$1): any;
|
|
4892
4892
|
currentPage(): number;
|
|
4893
4893
|
onFirstPage(): boolean;
|
|
4894
4894
|
perPage(): number;
|
|
@@ -4900,16 +4900,16 @@ declare class Paginator<T extends Model, K extends IPaginatorParams = IPaginator
|
|
|
4900
4900
|
}
|
|
4901
4901
|
//#endregion
|
|
4902
4902
|
//#region src/browser/index.d.ts
|
|
4903
|
-
declare const make: (model: Model, data: TGeneric, options?: {
|
|
4903
|
+
declare const make: (model: Model$1, data: TGeneric, options?: {
|
|
4904
4904
|
paginated: IPaginatorParams;
|
|
4905
4905
|
}) => any;
|
|
4906
|
-
declare const makeCollection: (model: Model, data: TGeneric) => Collection<Model>;
|
|
4906
|
+
declare const makeCollection: (model: Model$1, data: TGeneric) => Collection<Model$1>;
|
|
4907
4907
|
declare const isBrowser = true;
|
|
4908
4908
|
declare const _default: {
|
|
4909
4909
|
isBrowser: boolean;
|
|
4910
4910
|
Paginator: typeof Paginator;
|
|
4911
4911
|
Collection: typeof Collection;
|
|
4912
|
-
Model: typeof Model;
|
|
4912
|
+
Model: typeof Model$1;
|
|
4913
4913
|
Pivot: typeof Pivot;
|
|
4914
4914
|
Attribute: typeof Attribute;
|
|
4915
4915
|
CastsAttributes: typeof CastsAttributes;
|
|
@@ -4922,11 +4922,11 @@ declare const _default: {
|
|
|
4922
4922
|
getIncrementing(): any;
|
|
4923
4923
|
};
|
|
4924
4924
|
} & TBase;
|
|
4925
|
-
make: (model: Model, data: TGeneric, options?: {
|
|
4925
|
+
make: (model: Model$1, data: TGeneric, options?: {
|
|
4926
4926
|
paginated: IPaginatorParams;
|
|
4927
4927
|
}) => any;
|
|
4928
|
-
makeCollection: (model: Model, data: TGeneric) => Collection<Model>;
|
|
4929
|
-
makePaginator: (model: Model, data: TGeneric) => Paginator<Model, IPaginatorParams>;
|
|
4928
|
+
makeCollection: (model: Model$1, data: TGeneric) => Collection<Model$1>;
|
|
4929
|
+
makePaginator: (model: Model$1, data: TGeneric) => Paginator<Model$1, IPaginatorParams>;
|
|
4930
4930
|
};
|
|
4931
4931
|
//#endregion
|
|
4932
|
-
export { Attribute, CastsAttributes, Collection, HasUniqueIds, InvalidArgumentError, Model, ModelNotFoundError, Paginator, Pivot, RelationNotFoundError, compose, _default as default, defineConfig, flatten, flattenDeep, getAttrMethod, getAttrName, getGetterMethod, getRelationMethod, getRelationName, getScopeMethod, getScopeName, getSetterMethod, isBrowser, kebabCase, make, makeCollection, now, snakeCase, tap };
|
|
4932
|
+
export { Attribute, CastsAttributes, Collection, HasUniqueIds, InvalidArgumentError, Model$1 as Model, ModelNotFoundError, Paginator, Pivot, RelationNotFoundError, compose, _default as default, defineConfig, flatten, flattenDeep, getAttrMethod, getAttrName, getGetterMethod, getRelationMethod, getRelationName, getScopeMethod, getScopeName, getSetterMethod, isBrowser, kebabCase, make, makeCollection, now, snakeCase, tap };
|