@h3ravel/arquebus 0.7.0 → 0.7.2
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/bin/index.cjs +1 -1
- package/bin/index.js +1 -1
- package/dist/concerns/index.cjs +35 -72
- package/dist/concerns/index.d.ts +209 -235
- package/dist/concerns/index.js +41 -26
- package/dist/relations/index.cjs +47 -24
- package/dist/relations/index.d.ts +5072 -2
- package/dist/relations/index.js +39 -26
- package/package.json +1 -1
- package/dist/concerns/chunk-Bop6jNiL.js +0 -15
package/dist/concerns/index.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import "node:module";
|
|
2
1
|
import { Collection } from "collect.js";
|
|
3
2
|
import Knex$1, { Knex } from "knex";
|
|
4
3
|
import * as dayjs0 from "dayjs";
|
|
5
|
-
import dayjs from "dayjs";
|
|
6
4
|
|
|
7
|
-
//#region rolldown:runtime
|
|
8
|
-
//#endregion
|
|
9
5
|
//#region src/browser/collection.d.ts
|
|
10
6
|
declare class Collection$2<I$1 extends Model$2> extends Collection<I$1> {
|
|
11
7
|
mapThen(callback: TFunction): Promise<any[]>;
|
|
@@ -348,7 +344,7 @@ declare class Builder<M extends Model$1 = Model$1, R$1 = IModel | ICollection<M>
|
|
|
348
344
|
withAvg(relation: any, column: string): this;
|
|
349
345
|
withSum(relation: any, column: string): this;
|
|
350
346
|
withExists(relation: any): this;
|
|
351
|
-
parseWithRelations(relations: TGeneric): never[]
|
|
347
|
+
parseWithRelations(relations: TGeneric): TGeneric | never[];
|
|
352
348
|
addNestedWiths(name: string, results: TGeneric): TGeneric;
|
|
353
349
|
prepareNestedWithRelationships(relations: TGeneric, prefix?: string): TGeneric;
|
|
354
350
|
combineConstraints(constraints: TFunction[]): (builder: Builder<M>) => Builder<M, IModel | ICollection<M>>;
|
|
@@ -691,18 +687,6 @@ declare class CastsAttributes implements ICastsAttributes {
|
|
|
691
687
|
static get(_model: Model$1, _key: string, _value: string, _attributes: TGeneric): string | null | undefined;
|
|
692
688
|
static set(_model: Model$1, _key: string, _value: string, _attributes: TGeneric): string | null | undefined;
|
|
693
689
|
}
|
|
694
|
-
declare namespace has_unique_ids_d_exports {
|
|
695
|
-
export { HasUniqueIds as default };
|
|
696
|
-
}
|
|
697
|
-
declare const HasUniqueIds: <TBase extends MixinConstructor>(Model: TBase) => {
|
|
698
|
-
new (...args: any[]): {
|
|
699
|
-
[x: string]: any;
|
|
700
|
-
useUniqueIds: boolean;
|
|
701
|
-
uniqueIds(): any[];
|
|
702
|
-
getKeyType(): any;
|
|
703
|
-
getIncrementing(): any;
|
|
704
|
-
};
|
|
705
|
-
} & TBase;
|
|
706
690
|
//#endregion
|
|
707
691
|
//#region src/arquebus.d.ts
|
|
708
692
|
declare class arquebus<M extends Model$1 = Model$1> {
|
|
@@ -4746,74 +4730,6 @@ type CamelToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ? U e
|
|
|
4746
4730
|
type FunctionPropertyNames<T$1> = { [K in keyof T$1]: T$1[K] extends ((...args: any[]) => any) ? K : never }[keyof T$1];
|
|
4747
4731
|
type RelationNames<T$1> = FunctionPropertyNames<T$1> extends infer R ? R extends `relation${infer P}` ? P extends 'sToData' | 'loaded' ? never : CamelToSnakeCase<P> : never : never;
|
|
4748
4732
|
type MixinConstructor<T$1 = TGeneric> = new (...args: any[]) => T$1;
|
|
4749
|
-
declare namespace has_attributes_d_exports {
|
|
4750
|
-
export { HasAttributes as default };
|
|
4751
|
-
}
|
|
4752
|
-
declare const HasAttributes: <TBase extends MixinConstructor>(Model: TBase) => {
|
|
4753
|
-
new (...args: any[]): {
|
|
4754
|
-
[x: string]: any;
|
|
4755
|
-
attributes: TGeneric;
|
|
4756
|
-
original: TGeneric;
|
|
4757
|
-
casts: TGeneric<typeof CastsAttributes | "int" | "json" | "string" | "date" | "boolean" | "datetime" | "collection">;
|
|
4758
|
-
changes: TGeneric;
|
|
4759
|
-
appends: any[];
|
|
4760
|
-
setAppends(appends: any[]): /*elided*/any;
|
|
4761
|
-
append(...keys: any[]): /*elided*/any;
|
|
4762
|
-
normalizeCastClassResponse(key: string, value: string): TGeneric;
|
|
4763
|
-
syncOriginal(): /*elided*/any;
|
|
4764
|
-
syncChanges(): /*elided*/any;
|
|
4765
|
-
syncOriginalAttribute(attribute: string): void;
|
|
4766
|
-
syncOriginalAttributes(...attributes: string[]): /*elided*/any;
|
|
4767
|
-
isDirty(...attributes: string[]): boolean;
|
|
4768
|
-
getDirty(): TGeneric;
|
|
4769
|
-
originalIsEquivalent(key: string): boolean;
|
|
4770
|
-
setAttributes(attributes: TGeneric): void;
|
|
4771
|
-
setRawAttributes(attributes: TGeneric, sync?: boolean): /*elided*/any;
|
|
4772
|
-
getAttributes(): {
|
|
4773
|
-
[x: string]: any;
|
|
4774
|
-
};
|
|
4775
|
-
setAttribute(key: string, value: string): /*elided*/any;
|
|
4776
|
-
getAttribute(key: string): any;
|
|
4777
|
-
castAttribute(key: string, value: string): any;
|
|
4778
|
-
attributesToData(): {
|
|
4779
|
-
[x: string]: any;
|
|
4780
|
-
};
|
|
4781
|
-
mutateAttribute(key: string, value: string | null): any;
|
|
4782
|
-
mutateAttributeForArray(_key: string, _value: string): void;
|
|
4783
|
-
isDateAttribute(key: string): boolean;
|
|
4784
|
-
serializeDate(date?: Date | string | null): string | null;
|
|
4785
|
-
getDates(): any[];
|
|
4786
|
-
getCasts(): TGeneric<"string" | "boolean" | typeof CastsAttributes | "int" | "json" | "date" | "datetime" | "collection">;
|
|
4787
|
-
getCastType(key: string): any;
|
|
4788
|
-
hasCast(key: string, types?: readonly string[]): boolean;
|
|
4789
|
-
withDayjs(date: string): dayjs.Dayjs;
|
|
4790
|
-
isCustomCast(cast: any): boolean;
|
|
4791
|
-
isCustomDateTimeCast(cast: any): boolean;
|
|
4792
|
-
isDecimalCast(cast: any): boolean;
|
|
4793
|
-
isDateCastable(key: string): boolean;
|
|
4794
|
-
fromDateTime(value: string): string;
|
|
4795
|
-
getDateFormat(): any;
|
|
4796
|
-
asDecimal(value: string, decimals: number): string;
|
|
4797
|
-
asDateTime(value: any): Date | null;
|
|
4798
|
-
asDate(value: string): Date;
|
|
4799
|
-
};
|
|
4800
|
-
castTypeCache: TGeneric;
|
|
4801
|
-
} & TBase;
|
|
4802
|
-
declare namespace has_global_scopes_d_exports {
|
|
4803
|
-
export { HasGlobalScopes as default };
|
|
4804
|
-
}
|
|
4805
|
-
declare const HasGlobalScopes: <TBase extends MixinConstructor>(Model: TBase) => {
|
|
4806
|
-
new (...args: any[]): {
|
|
4807
|
-
[x: string]: any;
|
|
4808
|
-
getGlobalScopes(): {};
|
|
4809
|
-
};
|
|
4810
|
-
globalScopes?: TGeneric;
|
|
4811
|
-
addGlobalScope(scope: any, implementation?: any | null): Scope<any>;
|
|
4812
|
-
hasGlobalScope(scope: any): boolean;
|
|
4813
|
-
getGlobalScope(scope: any): unknown;
|
|
4814
|
-
getAllGlobalScopes(): TGeneric | undefined;
|
|
4815
|
-
setAllGlobalScopes(scopes: TGeneric): void;
|
|
4816
|
-
} & TBase;
|
|
4817
4733
|
//#endregion
|
|
4818
4734
|
//#region src/hooks.d.ts
|
|
4819
4735
|
type HookName = 'creating' | 'created' | 'updating' | 'updated' | 'saving' | 'saved' | 'deleting' | 'deleted' | 'restoring' | 'restored' | 'trashed' | 'forceDeleting' | 'forceDeleted';
|
|
@@ -4823,29 +4739,123 @@ declare class Hooks {
|
|
|
4823
4739
|
add(hook: HookName, callback: HookCallback): void;
|
|
4824
4740
|
exec(hook: HookName, data: any[]): Promise<boolean>;
|
|
4825
4741
|
}
|
|
4826
|
-
|
|
4827
|
-
|
|
4742
|
+
//#endregion
|
|
4743
|
+
//#region src/relations/has-one.d.ts
|
|
4744
|
+
declare const HasOne_base: (new (...args: any[]) => Relation & typeof Relation & {
|
|
4745
|
+
[x: string]: any;
|
|
4746
|
+
getRelationValue(dictionary: TGeneric, key: string, type: string): any;
|
|
4747
|
+
matchOneOrMany(models: Model$1[], results: any, relation: string, type: string): Model$1[];
|
|
4748
|
+
buildDictionary(results: any): any;
|
|
4749
|
+
save(model: Model$1): Promise<false | Model$1>;
|
|
4750
|
+
saveMany(models: Model$1[]): Promise<(Model$1[] & Collection$1<any>) | Collection$1<Model$1>>;
|
|
4751
|
+
create(attributes?: {}): Promise<any>;
|
|
4752
|
+
createMany(records: any[]): Promise<Collection$1<any>>;
|
|
4753
|
+
setForeignAttributesForCreate(model: Model$1): void;
|
|
4754
|
+
getForeignKeyName(): any;
|
|
4755
|
+
getParentKey(): any;
|
|
4756
|
+
getQualifiedForeignKeyName(): any;
|
|
4757
|
+
getExistenceCompareKey(): any;
|
|
4758
|
+
addConstraints(): void;
|
|
4759
|
+
} & TGeneric<any, string> & {
|
|
4760
|
+
[x: string]: any;
|
|
4761
|
+
_withDefault?: boolean | TFunction | TGeneric;
|
|
4762
|
+
withDefault(callback?: boolean): /*elided*/any;
|
|
4763
|
+
getDefaultFor<P$1>(parent: P$1): any;
|
|
4764
|
+
}) & {
|
|
4765
|
+
prototype: {
|
|
4766
|
+
[x: string]: any;
|
|
4767
|
+
getRelationValue(dictionary: TGeneric, key: string, type: string): any;
|
|
4768
|
+
matchOneOrMany(models: Model$1[], results: any, relation: string, type: string): Model$1[];
|
|
4769
|
+
buildDictionary(results: any): any;
|
|
4770
|
+
save(model: Model$1): Promise<false | Model$1>;
|
|
4771
|
+
saveMany(models: Model$1[]): Promise<(Model$1[] & Collection$1<any>) | Collection$1<Model$1>>;
|
|
4772
|
+
create(attributes?: {}): Promise<any>;
|
|
4773
|
+
createMany(records: any[]): Promise<Collection$1<any>>;
|
|
4774
|
+
setForeignAttributesForCreate(model: Model$1): void;
|
|
4775
|
+
getForeignKeyName(): any;
|
|
4776
|
+
getParentKey(): any;
|
|
4777
|
+
getQualifiedForeignKeyName(): any;
|
|
4778
|
+
getExistenceCompareKey(): any;
|
|
4779
|
+
addConstraints(): void;
|
|
4780
|
+
};
|
|
4781
|
+
} & {
|
|
4782
|
+
prototype: {
|
|
4783
|
+
[x: string]: any;
|
|
4784
|
+
_withDefault?: boolean | TFunction | TGeneric;
|
|
4785
|
+
withDefault(callback?: boolean): /*elided*/any;
|
|
4786
|
+
getDefaultFor<P$1>(parent: P$1): any;
|
|
4787
|
+
};
|
|
4788
|
+
} & {
|
|
4789
|
+
prototype: Relation;
|
|
4790
|
+
constraints: boolean;
|
|
4791
|
+
selfJoinCount: number;
|
|
4792
|
+
extend: typeof Relation.extend;
|
|
4793
|
+
noConstraints: typeof Relation.noConstraints;
|
|
4794
|
+
};
|
|
4795
|
+
declare class HasOne extends HasOne_base {
|
|
4796
|
+
foreignKey?: string | null;
|
|
4797
|
+
localKey?: string | null;
|
|
4798
|
+
constructor(query: Builder, parent: Builder, foreignKey?: string | null, localKey?: string | null);
|
|
4799
|
+
initRelation(models: Model$1[], relation: string): Model$1[];
|
|
4800
|
+
matchOne(models: Model$1[], results: any, relation: string): Model$1[];
|
|
4801
|
+
getForeignKeyName(): string | undefined;
|
|
4802
|
+
getResults(): Promise<any>;
|
|
4803
|
+
match(models: Model$1[], results: any, relation: string): Model$1[];
|
|
4804
|
+
addEagerConstraints(models: Model$1[]): void;
|
|
4805
|
+
newRelatedInstanceFor(parent: Model$1): any;
|
|
4828
4806
|
}
|
|
4829
|
-
|
|
4830
|
-
|
|
4807
|
+
//#endregion
|
|
4808
|
+
//#region src/relations/has-many.d.ts
|
|
4809
|
+
declare const HasMany_base: (new (...args: any[]) => Relation & typeof Relation & {
|
|
4810
|
+
[x: string]: any;
|
|
4811
|
+
getRelationValue(dictionary: TGeneric, key: string, type: string): any;
|
|
4812
|
+
matchOneOrMany(models: Model$1[], results: any, relation: string, type: string): Model$1[];
|
|
4813
|
+
buildDictionary(results: any): any;
|
|
4814
|
+
save(model: Model$1): Promise<false | Model$1>;
|
|
4815
|
+
saveMany(models: Model$1[]): Promise<(Model$1[] & Collection$1<any>) | Collection$1<Model$1>>;
|
|
4816
|
+
create(attributes?: {}): Promise<any>;
|
|
4817
|
+
createMany(records: any[]): Promise<Collection$1<any>>;
|
|
4818
|
+
setForeignAttributesForCreate(model: Model$1): void;
|
|
4819
|
+
getForeignKeyName(): any;
|
|
4820
|
+
getParentKey(): any;
|
|
4821
|
+
getQualifiedForeignKeyName(): any;
|
|
4822
|
+
getExistenceCompareKey(): any;
|
|
4823
|
+
addConstraints(): void;
|
|
4824
|
+
} & TGeneric<any, string>) & {
|
|
4825
|
+
prototype: {
|
|
4831
4826
|
[x: string]: any;
|
|
4832
|
-
|
|
4827
|
+
getRelationValue(dictionary: TGeneric, key: string, type: string): any;
|
|
4828
|
+
matchOneOrMany(models: Model$1[], results: any, relation: string, type: string): Model$1[];
|
|
4829
|
+
buildDictionary(results: any): any;
|
|
4830
|
+
save(model: Model$1): Promise<false | Model$1>;
|
|
4831
|
+
saveMany(models: Model$1[]): Promise<(Model$1[] & Collection$1<any>) | Collection$1<Model$1>>;
|
|
4832
|
+
create(attributes?: {}): Promise<any>;
|
|
4833
|
+
createMany(records: any[]): Promise<Collection$1<any>>;
|
|
4834
|
+
setForeignAttributesForCreate(model: Model$1): void;
|
|
4835
|
+
getForeignKeyName(): any;
|
|
4836
|
+
getParentKey(): any;
|
|
4837
|
+
getQualifiedForeignKeyName(): any;
|
|
4838
|
+
getExistenceCompareKey(): any;
|
|
4839
|
+
addConstraints(): void;
|
|
4833
4840
|
};
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4841
|
+
} & {
|
|
4842
|
+
prototype: Relation;
|
|
4843
|
+
constraints: boolean;
|
|
4844
|
+
selfJoinCount: number;
|
|
4845
|
+
extend: typeof Relation.extend;
|
|
4846
|
+
noConstraints: typeof Relation.noConstraints;
|
|
4847
|
+
};
|
|
4848
|
+
declare class HasMany extends HasMany_base {
|
|
4849
|
+
foreignKey?: string | null;
|
|
4850
|
+
localKey?: string | null;
|
|
4851
|
+
constructor(query: any, parent: any, foreignKey?: string | null, localKey?: string | null);
|
|
4852
|
+
initRelation(models: Model$1[], relation: string): Model$1[];
|
|
4853
|
+
getResults(): Promise<any>;
|
|
4854
|
+
getForeignKeyName(): string | undefined;
|
|
4855
|
+
buildDictionary(results: any): any;
|
|
4856
|
+
match(models: Model$1[], results: any, relation: string): Model$1[];
|
|
4857
|
+
addEagerConstraints(models: Model$1[]): void;
|
|
4858
|
+
}
|
|
4849
4859
|
//#endregion
|
|
4850
4860
|
//#region src/relations/belongs-to.d.ts
|
|
4851
4861
|
declare const BelongsTo_base: (new (...args: any[]) => Relation & typeof Relation & {
|
|
@@ -4959,58 +4969,6 @@ declare class BelongsToMany extends BelongsToMany_base {
|
|
|
4959
4969
|
getRelationExistenceQueryForSelfJoin(query: any, parentQuery: any, columns?: string[]): any;
|
|
4960
4970
|
}
|
|
4961
4971
|
//#endregion
|
|
4962
|
-
//#region src/relations/has-many.d.ts
|
|
4963
|
-
declare const HasMany_base: (new (...args: any[]) => Relation & typeof Relation & {
|
|
4964
|
-
[x: string]: any;
|
|
4965
|
-
getRelationValue(dictionary: TGeneric, key: string, type: string): any;
|
|
4966
|
-
matchOneOrMany(models: Model$1[], results: any, relation: string, type: string): Model$1[];
|
|
4967
|
-
buildDictionary(results: any): any;
|
|
4968
|
-
save(model: Model$1): Promise<false | Model$1>;
|
|
4969
|
-
saveMany(models: Model$1[]): Promise<(Model$1[] & Collection$1<any>) | Collection$1<Model$1>>;
|
|
4970
|
-
create(attributes?: {}): Promise<any>;
|
|
4971
|
-
createMany(records: any[]): Promise<Collection$1<any>>;
|
|
4972
|
-
setForeignAttributesForCreate(model: Model$1): void;
|
|
4973
|
-
getForeignKeyName(): any;
|
|
4974
|
-
getParentKey(): any;
|
|
4975
|
-
getQualifiedForeignKeyName(): any;
|
|
4976
|
-
getExistenceCompareKey(): any;
|
|
4977
|
-
addConstraints(): void;
|
|
4978
|
-
} & TGeneric<any, string>) & {
|
|
4979
|
-
prototype: {
|
|
4980
|
-
[x: string]: any;
|
|
4981
|
-
getRelationValue(dictionary: TGeneric, key: string, type: string): any;
|
|
4982
|
-
matchOneOrMany(models: Model$1[], results: any, relation: string, type: string): Model$1[];
|
|
4983
|
-
buildDictionary(results: any): any;
|
|
4984
|
-
save(model: Model$1): Promise<false | Model$1>;
|
|
4985
|
-
saveMany(models: Model$1[]): Promise<(Model$1[] & Collection$1<any>) | Collection$1<Model$1>>;
|
|
4986
|
-
create(attributes?: {}): Promise<any>;
|
|
4987
|
-
createMany(records: any[]): Promise<Collection$1<any>>;
|
|
4988
|
-
setForeignAttributesForCreate(model: Model$1): void;
|
|
4989
|
-
getForeignKeyName(): any;
|
|
4990
|
-
getParentKey(): any;
|
|
4991
|
-
getQualifiedForeignKeyName(): any;
|
|
4992
|
-
getExistenceCompareKey(): any;
|
|
4993
|
-
addConstraints(): void;
|
|
4994
|
-
};
|
|
4995
|
-
} & {
|
|
4996
|
-
prototype: Relation;
|
|
4997
|
-
constraints: boolean;
|
|
4998
|
-
selfJoinCount: number;
|
|
4999
|
-
extend: typeof Relation.extend;
|
|
5000
|
-
noConstraints: typeof Relation.noConstraints;
|
|
5001
|
-
};
|
|
5002
|
-
declare class HasMany extends HasMany_base {
|
|
5003
|
-
foreignKey?: string | null;
|
|
5004
|
-
localKey?: string | null;
|
|
5005
|
-
constructor(query: any, parent: any, foreignKey?: string | null, localKey?: string | null);
|
|
5006
|
-
initRelation(models: Model$1[], relation: string): Model$1[];
|
|
5007
|
-
getResults(): Promise<any>;
|
|
5008
|
-
getForeignKeyName(): string | undefined;
|
|
5009
|
-
buildDictionary(results: any): any;
|
|
5010
|
-
match(models: Model$1[], results: any, relation: string): Model$1[];
|
|
5011
|
-
addEagerConstraints(models: Model$1[]): void;
|
|
5012
|
-
}
|
|
5013
|
-
//#endregion
|
|
5014
4972
|
//#region src/relations/has-many-through.d.ts
|
|
5015
4973
|
declare class HasManyThrough extends Relation {
|
|
5016
4974
|
throughParent: any;
|
|
@@ -5057,71 +5015,6 @@ declare class HasManyThrough extends Relation {
|
|
|
5057
5015
|
getSecondLocalKeyName(): string | undefined;
|
|
5058
5016
|
}
|
|
5059
5017
|
//#endregion
|
|
5060
|
-
//#region src/relations/has-one.d.ts
|
|
5061
|
-
declare const HasOne_base: (new (...args: any[]) => Relation & typeof Relation & {
|
|
5062
|
-
[x: string]: any;
|
|
5063
|
-
getRelationValue(dictionary: TGeneric, key: string, type: string): any;
|
|
5064
|
-
matchOneOrMany(models: Model$1[], results: any, relation: string, type: string): Model$1[];
|
|
5065
|
-
buildDictionary(results: any): any;
|
|
5066
|
-
save(model: Model$1): Promise<false | Model$1>;
|
|
5067
|
-
saveMany(models: Model$1[]): Promise<(Model$1[] & Collection$1<any>) | Collection$1<Model$1>>;
|
|
5068
|
-
create(attributes?: {}): Promise<any>;
|
|
5069
|
-
createMany(records: any[]): Promise<Collection$1<any>>;
|
|
5070
|
-
setForeignAttributesForCreate(model: Model$1): void;
|
|
5071
|
-
getForeignKeyName(): any;
|
|
5072
|
-
getParentKey(): any;
|
|
5073
|
-
getQualifiedForeignKeyName(): any;
|
|
5074
|
-
getExistenceCompareKey(): any;
|
|
5075
|
-
addConstraints(): void;
|
|
5076
|
-
} & TGeneric<any, string> & {
|
|
5077
|
-
[x: string]: any;
|
|
5078
|
-
_withDefault?: boolean | TFunction | TGeneric;
|
|
5079
|
-
withDefault(callback?: boolean): /*elided*/any;
|
|
5080
|
-
getDefaultFor<P$1>(parent: P$1): any;
|
|
5081
|
-
}) & {
|
|
5082
|
-
prototype: {
|
|
5083
|
-
[x: string]: any;
|
|
5084
|
-
getRelationValue(dictionary: TGeneric, key: string, type: string): any;
|
|
5085
|
-
matchOneOrMany(models: Model$1[], results: any, relation: string, type: string): Model$1[];
|
|
5086
|
-
buildDictionary(results: any): any;
|
|
5087
|
-
save(model: Model$1): Promise<false | Model$1>;
|
|
5088
|
-
saveMany(models: Model$1[]): Promise<(Model$1[] & Collection$1<any>) | Collection$1<Model$1>>;
|
|
5089
|
-
create(attributes?: {}): Promise<any>;
|
|
5090
|
-
createMany(records: any[]): Promise<Collection$1<any>>;
|
|
5091
|
-
setForeignAttributesForCreate(model: Model$1): void;
|
|
5092
|
-
getForeignKeyName(): any;
|
|
5093
|
-
getParentKey(): any;
|
|
5094
|
-
getQualifiedForeignKeyName(): any;
|
|
5095
|
-
getExistenceCompareKey(): any;
|
|
5096
|
-
addConstraints(): void;
|
|
5097
|
-
};
|
|
5098
|
-
} & {
|
|
5099
|
-
prototype: {
|
|
5100
|
-
[x: string]: any;
|
|
5101
|
-
_withDefault?: boolean | TFunction | TGeneric;
|
|
5102
|
-
withDefault(callback?: boolean): /*elided*/any;
|
|
5103
|
-
getDefaultFor<P$1>(parent: P$1): any;
|
|
5104
|
-
};
|
|
5105
|
-
} & {
|
|
5106
|
-
prototype: Relation;
|
|
5107
|
-
constraints: boolean;
|
|
5108
|
-
selfJoinCount: number;
|
|
5109
|
-
extend: typeof Relation.extend;
|
|
5110
|
-
noConstraints: typeof Relation.noConstraints;
|
|
5111
|
-
};
|
|
5112
|
-
declare class HasOne extends HasOne_base {
|
|
5113
|
-
foreignKey?: string | null;
|
|
5114
|
-
localKey?: string | null;
|
|
5115
|
-
constructor(query: Builder, parent: Builder, foreignKey?: string | null, localKey?: string | null);
|
|
5116
|
-
initRelation(models: Model$1[], relation: string): Model$1[];
|
|
5117
|
-
matchOne(models: Model$1[], results: any, relation: string): Model$1[];
|
|
5118
|
-
getForeignKeyName(): string | undefined;
|
|
5119
|
-
getResults(): Promise<any>;
|
|
5120
|
-
match(models: Model$1[], results: any, relation: string): Model$1[];
|
|
5121
|
-
addEagerConstraints(models: Model$1[]): void;
|
|
5122
|
-
newRelatedInstanceFor(parent: Model$1): any;
|
|
5123
|
-
}
|
|
5124
|
-
//#endregion
|
|
5125
5018
|
//#region src/relations/has-one-through.d.ts
|
|
5126
5019
|
declare const HasOneThrough_base: (new (...args: any[]) => HasManyThrough & typeof HasManyThrough & {
|
|
5127
5020
|
[x: string]: any;
|
|
@@ -5148,9 +5041,90 @@ declare class HasOneThrough extends HasOneThrough_base {
|
|
|
5148
5041
|
match(models: Model$1[], results: any, relation: string): Model$1[];
|
|
5149
5042
|
newRelatedInstanceFor(_parent: Model$1): any;
|
|
5150
5043
|
}
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5044
|
+
//#endregion
|
|
5045
|
+
//#region src/concerns/index.d.ts
|
|
5046
|
+
declare const HasAttributes: <TBase extends MixinConstructor>(Model: TBase) => {
|
|
5047
|
+
new (...args: any[]): {
|
|
5048
|
+
[x: string]: any;
|
|
5049
|
+
attributes: TGeneric;
|
|
5050
|
+
original: TGeneric;
|
|
5051
|
+
casts: TGeneric<typeof CastsAttributes | "int" | "json" | "string" | "date" | "boolean" | "datetime" | "collection">;
|
|
5052
|
+
changes: TGeneric;
|
|
5053
|
+
appends: any[];
|
|
5054
|
+
setAppends(appends: any[]): /*elided*/any;
|
|
5055
|
+
append(...keys: any[]): /*elided*/any;
|
|
5056
|
+
normalizeCastClassResponse(key: string, value: string): TGeneric;
|
|
5057
|
+
syncOriginal(): /*elided*/any;
|
|
5058
|
+
syncChanges(): /*elided*/any;
|
|
5059
|
+
syncOriginalAttribute(attribute: string): void;
|
|
5060
|
+
syncOriginalAttributes(...attributes: string[]): /*elided*/any;
|
|
5061
|
+
isDirty(...attributes: string[]): boolean;
|
|
5062
|
+
getDirty(): TGeneric;
|
|
5063
|
+
originalIsEquivalent(key: string): boolean;
|
|
5064
|
+
setAttributes(attributes: TGeneric): void;
|
|
5065
|
+
setRawAttributes(attributes: TGeneric, sync?: boolean): /*elided*/any;
|
|
5066
|
+
getAttributes(): {
|
|
5067
|
+
[x: string]: any;
|
|
5068
|
+
};
|
|
5069
|
+
setAttribute(key: string, value: string): /*elided*/any;
|
|
5070
|
+
getAttribute(key: string): any;
|
|
5071
|
+
castAttribute(key: string, value: string): any;
|
|
5072
|
+
attributesToData(): {
|
|
5073
|
+
[x: string]: any;
|
|
5074
|
+
};
|
|
5075
|
+
mutateAttribute(key: string, value: string | null): any;
|
|
5076
|
+
mutateAttributeForArray(_key: string, _value: string): void;
|
|
5077
|
+
isDateAttribute(key: string): boolean;
|
|
5078
|
+
serializeDate(date?: Date | string | null): string | null;
|
|
5079
|
+
getDates(): any[];
|
|
5080
|
+
getCasts(): TGeneric<"string" | "boolean" | typeof CastsAttributes | "int" | "json" | "date" | "datetime" | "collection">;
|
|
5081
|
+
getCastType(key: string): any;
|
|
5082
|
+
hasCast(key: string, types?: readonly string[]): boolean;
|
|
5083
|
+
withDayjs(date: string): dayjs0.Dayjs;
|
|
5084
|
+
isCustomCast(cast: any): boolean;
|
|
5085
|
+
isCustomDateTimeCast(cast: any): boolean;
|
|
5086
|
+
isDecimalCast(cast: any): boolean;
|
|
5087
|
+
isDateCastable(key: string): boolean;
|
|
5088
|
+
fromDateTime(value: string): string;
|
|
5089
|
+
getDateFormat(): any;
|
|
5090
|
+
asDecimal(value: string, decimals: number): string;
|
|
5091
|
+
asDateTime(value: any): Date | null;
|
|
5092
|
+
asDate(value: string): Date;
|
|
5093
|
+
};
|
|
5094
|
+
castTypeCache: TGeneric;
|
|
5095
|
+
} & TBase;
|
|
5096
|
+
declare const HasGlobalScopes: <TBase extends MixinConstructor>(Model: TBase) => {
|
|
5097
|
+
new (...args: any[]): {
|
|
5098
|
+
[x: string]: any;
|
|
5099
|
+
getGlobalScopes(): {};
|
|
5100
|
+
};
|
|
5101
|
+
globalScopes?: TGeneric;
|
|
5102
|
+
addGlobalScope(scope: any, implementation?: any | null): Scope<any>;
|
|
5103
|
+
hasGlobalScope(scope: any): boolean;
|
|
5104
|
+
getGlobalScope(scope: any): unknown;
|
|
5105
|
+
getAllGlobalScopes(): TGeneric | undefined;
|
|
5106
|
+
setAllGlobalScopes(scopes: TGeneric): void;
|
|
5107
|
+
} & TBase;
|
|
5108
|
+
declare const HasHooks: <TBase extends MixinConstructor>(Model: TBase) => {
|
|
5109
|
+
new (...args: any[]): {
|
|
5110
|
+
[x: string]: any;
|
|
5111
|
+
execHooks(hook: any, options: TGeneric): Promise<any>;
|
|
5112
|
+
};
|
|
5113
|
+
hooks: Hooks | null;
|
|
5114
|
+
addHook(hook: any, callback: TFunction): void;
|
|
5115
|
+
creating(callback: TFunction): void;
|
|
5116
|
+
created(callback: TFunction): void;
|
|
5117
|
+
updating(callback: TFunction): void;
|
|
5118
|
+
updated(callback: TFunction): void;
|
|
5119
|
+
saving(callback: TFunction): void;
|
|
5120
|
+
saved(callback: TFunction): void;
|
|
5121
|
+
deleting(callback: TFunction): void;
|
|
5122
|
+
deleted(callback: TFunction): void;
|
|
5123
|
+
restoring(callback: TFunction): void;
|
|
5124
|
+
restored(callback: TFunction): void;
|
|
5125
|
+
trashed(callback: TFunction): void;
|
|
5126
|
+
forceDeleted(callback: TFunction): void;
|
|
5127
|
+
} & TBase;
|
|
5154
5128
|
declare const HasRelations: <TBase extends MixinConstructor>(Model: TBase) => {
|
|
5155
5129
|
new (...args: any[]): {
|
|
5156
5130
|
[x: string]: any;
|
|
@@ -5173,9 +5147,6 @@ declare const HasRelations: <TBase extends MixinConstructor>(Model: TBase) => {
|
|
|
5173
5147
|
hasManyThrough(related: any, through: any, firstKey?: string, secondKey?: string, localKey?: string, secondLocalKey?: string): HasManyThrough;
|
|
5174
5148
|
};
|
|
5175
5149
|
} & TBase;
|
|
5176
|
-
declare namespace has_timestamps_d_exports {
|
|
5177
|
-
export { HasTimestamps as default };
|
|
5178
|
-
}
|
|
5179
5150
|
declare const HasTimestamps: <TBase extends MixinConstructor>(Model: TBase) => {
|
|
5180
5151
|
new (...args: any[]): {
|
|
5181
5152
|
[x: string]: any;
|
|
@@ -5194,9 +5165,15 @@ declare const HasTimestamps: <TBase extends MixinConstructor>(Model: TBase) => {
|
|
|
5194
5165
|
UPDATED_AT: string;
|
|
5195
5166
|
DELETED_AT: string;
|
|
5196
5167
|
} & TBase;
|
|
5197
|
-
declare
|
|
5198
|
-
|
|
5199
|
-
|
|
5168
|
+
declare const HasUniqueIds: <TBase extends MixinConstructor>(Model: TBase) => {
|
|
5169
|
+
new (...args: any[]): {
|
|
5170
|
+
[x: string]: any;
|
|
5171
|
+
useUniqueIds: boolean;
|
|
5172
|
+
uniqueIds(): any[];
|
|
5173
|
+
getKeyType(): any;
|
|
5174
|
+
getIncrementing(): any;
|
|
5175
|
+
};
|
|
5176
|
+
} & TBase;
|
|
5200
5177
|
declare const HidesAttributes: <TBase extends MixinConstructor>(Model: TBase) => {
|
|
5201
5178
|
new (...args: any[]): {
|
|
5202
5179
|
[x: string]: any;
|
|
@@ -5210,9 +5187,6 @@ declare const HidesAttributes: <TBase extends MixinConstructor>(Model: TBase) =>
|
|
|
5210
5187
|
setVisible(visible: any[]): /*elided*/any;
|
|
5211
5188
|
};
|
|
5212
5189
|
} & TBase;
|
|
5213
|
-
declare namespace unique_ids_d_exports {
|
|
5214
|
-
export { UniqueIds as default };
|
|
5215
|
-
}
|
|
5216
5190
|
declare const UniqueIds: <TBase extends MixinConstructor>(Model: TBase) => {
|
|
5217
5191
|
new (...args: any[]): {
|
|
5218
5192
|
[x: string]: any;
|
|
@@ -5223,4 +5197,4 @@ declare const UniqueIds: <TBase extends MixinConstructor>(Model: TBase) => {
|
|
|
5223
5197
|
};
|
|
5224
5198
|
} & TBase;
|
|
5225
5199
|
//#endregion
|
|
5226
|
-
export {
|
|
5200
|
+
export { HasAttributes, HasGlobalScopes, HasHooks, HasRelations, HasTimestamps, HasUniqueIds, HidesAttributes, UniqueIds };
|