Skip to content

Commit dbef7c4

Browse files
chore: wip
1 parent f024a93 commit dbef7c4

File tree

15 files changed

+19
-2152
lines changed

15 files changed

+19
-2152
lines changed

app/Models/Request.ts

Lines changed: 0 additions & 115 deletions
This file was deleted.

app/Models/User.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import type { Faker } from '@stacksjs/faker'
12
import type { Attributes, Model } from '@stacksjs/types'
23
// soon, these will be auto-imported
3-
import { faker } from '@stacksjs/faker'
44
import { schema } from '@stacksjs/validation'
55

66
export default {
@@ -58,7 +58,7 @@ export default {
5858
},
5959
},
6060

61-
factory: () => faker.person.fullName(),
61+
factory: (faker: Faker) => faker.person.fullName(),
6262
},
6363

6464
email: {
@@ -73,7 +73,7 @@ export default {
7373
},
7474
},
7575

76-
factory: () => faker.internet.email(),
76+
factory: (faker: Faker) => faker.internet.email(),
7777
},
7878

7979
jobTitle: {
@@ -88,7 +88,7 @@ export default {
8888
},
8989
},
9090

91-
factory: () => faker.person.jobTitle(),
91+
factory: (faker: Faker) => faker.person.jobTitle(),
9292
},
9393
password: {
9494
required: true,
@@ -103,7 +103,7 @@ export default {
103103
},
104104
},
105105

106-
factory: () => faker.internet.password(),
106+
factory: (faker: Faker) => faker.internet.password(),
107107
},
108108
},
109109
get: {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export { faker } from '@faker-js/faker'
2+
export type { Faker } from '@faker-js/faker'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export type ModelNames = 'Project' | 'SubscriberEmail' | 'AccessToken' | 'Team' | 'Request' | 'Activity' | 'Subscriber' | 'Deployment' | 'Release' | 'User' | 'Post' | 'FailedJob' | 'PaymentMethod' | 'PaymentTransaction' | 'Request' | 'Job' | 'Subscription' | 'PaymentProduct' | 'Error'
1+
export type ModelNames = 'Project' | 'SubscriberEmail' | 'AccessToken' | 'Team' | 'Subscriber' | 'Deployment' | 'Release' | 'User' | 'Post' | 'FailedJob' | 'PaymentMethod' | 'PaymentTransaction' | 'Request' | 'Job' | 'Subscription' | 'PaymentProduct' | 'Error'

storage/framework/core/types/src/model.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { Faker } from '@stacksjs/faker'
12
import type { ModelNames, TableNames } from '@stacksjs/types'
23
import type { VineBoolean, VineNumber, VineString } from '@vinejs/vine'
34
import type { DeepPartial, Nullable } from '.'
@@ -186,7 +187,7 @@ export interface Attribute {
186187
hidden?: boolean
187188
fillable?: boolean
188189
guarded?: boolean
189-
factory?: () => any
190+
factory?: (faker?: Faker) => any
190191
validation?: {
191192
rule: VineType
192193
message?: ValidatorMessage
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export type TableNames = 'projects' | 'subscriber_emails' | 'personal_access_tokens' | 'team_users' | 'teams' | 'requests' | 'activities' | 'subscribers' | 'deployments' | 'releases' | 'team_users' | 'users' | 'posts' | 'failed_jobs' | 'payment_methods' | 'payment_transactions' | 'requests' | 'jobs' | 'subscriptions' | 'payment_products' | 'errors'
1+
export type TableNames = 'projects' | 'subscriber_emails' | 'personal_access_tokens' | 'team_users' | 'teams' | 'subscribers' | 'deployments' | 'releases' | 'team_users' | 'users' | 'posts' | 'failed_jobs' | 'payment_methods' | 'payment_transactions' | 'requests' | 'jobs' | 'subscriptions' | 'payment_products' | 'errors'

storage/framework/orm/routes.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,3 @@ route.post('requests', 'storage/framework/actions/src/RequestStoreOrmAction.ts')
99
route.patch('requests/{id}', 'storage/framework/actions/src/RequestUpdateOrmAction.ts')
1010

1111
route.delete('requests/{id}', 'storage/framework/actions/src/RequestDestroyOrmAction.ts')
12-
13-
route.get('activities', 'storage/framework/actions/src/ActivityIndexOrmAction.ts')
14-
15-
route.get('activities/{id}', 'storage/framework/actions/src/ActivityShowOrmAction.ts')
16-
17-
route.post('activities', 'storage/framework/actions/src/ActivityStoreOrmAction.ts')
18-
19-
route.patch('activities/{id}', 'storage/framework/actions/src/ActivityUpdateOrmAction.ts')
20-
21-
route.delete('activities/{id}', 'storage/framework/actions/src/ActivityDestroyOrmAction.ts')
22-
23-
route.get('users', 'UserIndexOrmAction')
24-
25-
route.post('users', 'UserStoreOrmAction')
26-
27-
route.get('users/{id}', 'UserShowOrmAction')

0 commit comments

Comments
 (0)