File tree Expand file tree Collapse file tree 15 files changed +35
-39
lines changed Expand file tree Collapse file tree 15 files changed +35
-39
lines changed Original file line number Diff line number Diff line change 1
1
import { Action } from '@stacksjs/actions'
2
- import { schema } from '@stacksjs/validation'
3
2
import { ask } from '@stacksjs/ai'
3
+ import { schema } from '@stacksjs/validation'
4
4
5
5
// TODO: this should have been auto-generated
6
6
type Request = {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export default new Action({
10
10
description : 'This action is used to setup the CLI.' ,
11
11
path : '/install' ,
12
12
13
- handle ( ) {
13
+ handle ( ) : string {
14
14
const setupScriptContents = `if [ -n "$1" ]; then
15
15
# Check if the directory exists
16
16
if [ -d "storage/framework/core" ]; then # this is our identifier whether it is a Stacks project
Original file line number Diff line number Diff line change @@ -14,21 +14,17 @@ export default new Action({
14
14
15
15
await request . validate ( {
16
16
email : {
17
- validation : {
18
- rule : schema . string ( ) . email ( ) ,
19
- message : {
20
- email : 'Email must be a valid email address' ,
21
- } ,
17
+ rule : schema . string ( ) . email ( ) ,
18
+ message : {
19
+ email : 'Email must be a valid email address' ,
22
20
} ,
23
21
} ,
24
22
25
23
password : {
26
- validation : {
27
- rule : schema . string ( ) . minLength ( 6 ) . maxLength ( 255 ) ,
28
- message : {
29
- minLength : 'Password must have a minimum of 6 characters' ,
30
- maxLength : 'Password must have a maximum of 255 characters' ,
31
- } ,
24
+ rule : schema . string ( ) . minLength ( 6 ) . maxLength ( 255 ) ,
25
+ message : {
26
+ minLength : 'Password must have a minimum of 6 characters' ,
27
+ maxLength : 'Password must have a maximum of 255 characters' ,
32
28
} ,
33
29
} ,
34
30
} )
Original file line number Diff line number Diff line change 349
349
" whenever"
350
350
]
351
351
}
352
- }
352
+ }
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ interface ActionOptions {
19
19
enabled ?: JobOptions [ 'enabled' ]
20
20
path ?: string
21
21
requestFile ?: string
22
- handle : ( options ?: Request ) => Promise < any >
22
+ handle : ( options ?: Request ) => Promise < any > | string | number | boolean
23
23
}
24
24
25
25
export class Action {
Original file line number Diff line number Diff line change @@ -1061,7 +1061,7 @@ export async function generateModelString(
1061
1061
1062
1062
if ( useSoftDeletes ) {
1063
1063
declareFields += `
1064
- public deleted_at: Date | undefined
1064
+ public deleted_at: string | undefined
1065
1065
`
1066
1066
1067
1067
constructorFields += `
@@ -1091,14 +1091,14 @@ export async function generateModelString(
1091
1091
1092
1092
if ( useTimestamps ) {
1093
1093
fieldString += `
1094
- created_at?: Date \n
1095
- updated_at?: Date
1094
+ created_at?: string \n
1095
+ updated_at?: string
1096
1096
`
1097
1097
}
1098
1098
1099
1099
if ( useSoftDeletes ) {
1100
1100
fieldString += `
1101
- deleted_at?: Date
1101
+ deleted_at?: string
1102
1102
`
1103
1103
}
1104
1104
Original file line number Diff line number Diff line change @@ -19,9 +19,9 @@ export interface PersonalAccessTokensTable {
19
19
abilities ?: string [ ]
20
20
team_id ?: number
21
21
22
- created_at ?: Date
22
+ created_at ?: string
23
23
24
- updated_at ?: Date
24
+ updated_at ?: string
25
25
}
26
26
27
27
interface AccessTokenResponse {
Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ export interface DeploymentsTable {
22
22
terminal_output ?: string
23
23
user_id ?: number
24
24
25
- created_at ?: Date
25
+ created_at ?: string
26
26
27
- updated_at ?: Date
27
+ updated_at ?: string
28
28
}
29
29
30
30
interface DeploymentResponse {
Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ export interface PostsTable {
17
17
body ?: string
18
18
user_id ?: number
19
19
20
- created_at ?: Date
20
+ created_at ?: string
21
21
22
- updated_at ?: Date
22
+ updated_at ?: string
23
23
}
24
24
25
25
interface PostResponse {
Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ export interface ProjectsTable {
17
17
url ?: string
18
18
status ?: string
19
19
20
- created_at ?: Date
20
+ created_at ?: string
21
21
22
- updated_at ?: Date
22
+ updated_at ?: string
23
23
}
24
24
25
25
interface ProjectResponse {
You can’t perform that action at this time.
0 commit comments