@stacksjs/types 0.70.228 → 0.70.230
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/cli.d.ts +1 -0
- package/dist/model.d.ts +25 -3
- package/dist/search-engine.d.ts +1 -1
- package/package.json +3 -3
package/dist/cli.d.ts
CHANGED
package/dist/model.d.ts
CHANGED
|
@@ -62,7 +62,6 @@ export declare interface MorphOne<T = string> extends BaseRelation {
|
|
|
62
62
|
export declare interface MorphMany<T = string> extends MorphOne<T> {}
|
|
63
63
|
export declare interface HasMany<T = string> extends Array<Relation<T>> {}
|
|
64
64
|
export declare interface BelongsTo<T = string> extends Array<Relation<T>> {}
|
|
65
|
-
export declare interface BelongsToMany<T = string> extends Array<BaseBelongsToMany<T> | T> {}
|
|
66
65
|
export declare interface HasOneThrough<T = string> extends Array<BaseHasOneThrough<T> | T> {}
|
|
67
66
|
export declare interface BaseBelongsToMany<T = string> {
|
|
68
67
|
model: T
|
|
@@ -70,6 +69,27 @@ export declare interface BaseBelongsToMany<T = string> {
|
|
|
70
69
|
secondForeignKey?: string
|
|
71
70
|
pivotTable?: string
|
|
72
71
|
}
|
|
72
|
+
export declare interface PivotColumnAttribute {
|
|
73
|
+
default?: string | number | boolean | Date
|
|
74
|
+
nullable?: boolean
|
|
75
|
+
validation?: {
|
|
76
|
+
rule: ValidationType
|
|
77
|
+
message?: ValidatorMessage
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export declare interface PivotConfig {
|
|
81
|
+
columns?: Record<string, PivotColumnAttribute>
|
|
82
|
+
timestamps?: boolean
|
|
83
|
+
uniques?: string[][]
|
|
84
|
+
}
|
|
85
|
+
export declare interface BelongsToManyConfig<T = string> {
|
|
86
|
+
model: T
|
|
87
|
+
through?: T
|
|
88
|
+
table?: string
|
|
89
|
+
foreignKey?: string
|
|
90
|
+
relatedKey?: string
|
|
91
|
+
pivot?: PivotConfig
|
|
92
|
+
}
|
|
73
93
|
export declare interface BaseHasOneThrough<T = string> {
|
|
74
94
|
model: T
|
|
75
95
|
through: T
|
|
@@ -121,7 +141,7 @@ export declare interface Relations {
|
|
|
121
141
|
hasOne: HasOne<ModelNames> | ModelNames[]
|
|
122
142
|
hasMany: HasMany<ModelNames> | ModelNames[]
|
|
123
143
|
belongsTo: BelongsTo<ModelNames> | ModelNames[]
|
|
124
|
-
belongsToMany: BelongsToMany<ModelNames>
|
|
144
|
+
belongsToMany: BelongsToMany<ModelNames>
|
|
125
145
|
}
|
|
126
146
|
export declare interface ApiSettings {
|
|
127
147
|
uri: string
|
|
@@ -184,7 +204,7 @@ export declare interface ModelOptions extends Base {
|
|
|
184
204
|
hasOne?: HasOne<ModelNames> | ModelNames[]
|
|
185
205
|
hasMany?: HasMany<ModelNames> | ModelNames[]
|
|
186
206
|
belongsTo?: BelongsTo<ModelNames> | ModelNames[]
|
|
187
|
-
belongsToMany?: BelongsToMany<ModelNames>
|
|
207
|
+
belongsToMany?: BelongsToMany<ModelNames>
|
|
188
208
|
hasOneThrough?: HasOneThrough<ModelNames> | ModelNames[]
|
|
189
209
|
hasManyThrough?: HasManyThrough<ModelNames> | ModelNames[]
|
|
190
210
|
morphOne?: MorphOne<ModelNames> | ModelNames
|
|
@@ -252,6 +272,8 @@ export declare interface RelationConfig {
|
|
|
252
272
|
*/
|
|
253
273
|
export type Model = Partial<ModelOptions>;
|
|
254
274
|
export type OnForeignKeyAction = 'cascade' | 'set null' | 'restrict' | 'no action';
|
|
275
|
+
export type BelongsToMany<T = string> = Array<BaseBelongsToMany<T> | T>
|
|
276
|
+
| Record<string, T | BelongsToManyConfig<T>>;
|
|
255
277
|
declare type ActionPath = string;
|
|
256
278
|
declare type ActionName = string;
|
|
257
279
|
declare type Action = ActionPath | ActionName | undefined;
|
package/dist/search-engine.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/types",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.70.
|
|
4
|
+
"version": "0.70.230",
|
|
5
5
|
"description": "The Stacks framework types.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": [
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@stacksjs/bunpress": "^0.1.18",
|
|
55
55
|
"@stacksjs/clapp": "^0.2.12",
|
|
56
|
-
"@stacksjs/stx": "^0.2.
|
|
56
|
+
"@stacksjs/stx": "^0.2.148",
|
|
57
57
|
"@stacksjs/ts-validation": "^0.5.0",
|
|
58
58
|
"bun-query-builder": "^0.1.63"
|
|
59
59
|
},
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@stacksjs/validation": "0.70.
|
|
69
|
+
"@stacksjs/validation": "0.70.230",
|
|
70
70
|
"better-dx": "^0.2.17",
|
|
71
71
|
"meilisearch": "^0.59.0"
|
|
72
72
|
},
|