Skip to content

Commit 27e4eb7

Browse files
chore: wip
1 parent f511647 commit 27e4eb7

28 files changed

+224
-224
lines changed

storage/framework/core/orm/src/generate.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ export async function generateModelString(
10181018
}
10191019
}
10201020
1021-
async mapCustomSetters(model: ${modelName}JsonResponse): Promise<void> {
1021+
async mapCustomSetters(model: New${modelName}): Promise<void> {
10221022
const customSetter = {
10231023
default: () => {
10241024
},
@@ -1237,7 +1237,7 @@ export async function generateModelString(
12371237
instance.mapCustomGetters(models)
12381238
await instance.loadRelations(models)
12391239
1240-
return models.map((modelItem: ${modelName}Model) => instance.parseResult(new ${modelName}Model(modelItem)))
1240+
return models.map((modelItem: ${modelName}JsonResponse) => instance.parseResult(new ${modelName}Model(modelItem)))
12411241
}
12421242
12431243
static async findMany(ids: number[]): Promise<${modelName}Model[]> {
@@ -1440,7 +1440,7 @@ export async function generateModelString(
14401440
this.mapCustomGetters(models)
14411441
await this.loadRelations(models)
14421442
1443-
const data = await Promise.all(models.map(async (model: ${modelName}Model) => {
1443+
const data = await Promise.all(models.map(async (model: ${modelName}JsonResponse) => {
14441444
return new ${modelName}Model(model)
14451445
}))
14461446
@@ -2075,7 +2075,7 @@ export async function generateModelString(
20752075
return model !== null && model !== undefined
20762076
}
20772077
2078-
static async latest(): Promise<${modelName}Type | undefined> {
2078+
static async latest(): Promise<${modelName}Model | undefined> {
20792079
const instance = new ${modelName}Model(undefined)
20802080
20812081
const model = await DB.instance.selectFrom('${tableName}')
@@ -2093,7 +2093,7 @@ export async function generateModelString(
20932093
return data
20942094
}
20952095
2096-
static async oldest(): Promise<${modelName}Type | undefined> {
2096+
static async oldest(): Promise<${modelName}Model | undefined> {
20972097
const instance = new ${modelName}Model(undefined)
20982098
20992099
const model = await DB.instance.selectFrom('${tableName}')
@@ -2235,8 +2235,8 @@ export async function generateModelString(
22352235
return instance
22362236
}
22372237
2238-
async last(): Promise<${modelName}Type | undefined> {
2239-
let model: ${modelName}Model | undefined
2238+
async last(): Promise<${modelName}Model | undefined> {
2239+
let model: ${modelName}JsonResponse | undefined
22402240
22412241
if (this.hasSelect) {
22422242
model = await this.selectFromQuery.executeTakeFirst()
@@ -2255,7 +2255,7 @@ export async function generateModelString(
22552255
return data
22562256
}
22572257
2258-
static async last(): Promise<${modelName}Type | undefined> {
2258+
static async last(): Promise<${modelName}Model | undefined> {
22592259
const model = await DB.instance.selectFrom('${tableName}').selectAll().orderBy('id', 'desc').executeTakeFirst()
22602260
22612261
if (!model)

storage/framework/orm/src/models/AccessToken.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export class AccessTokenModel {
131131
}
132132
}
133133

134-
async mapCustomSetters(model: AccessTokenJsonResponse): Promise<void> {
134+
async mapCustomSetters(model: NewAccessToken): Promise<void> {
135135
const customSetter = {
136136
default: () => {
137137
},
@@ -454,7 +454,7 @@ export class AccessTokenModel {
454454
instance.mapCustomGetters(models)
455455
await instance.loadRelations(models)
456456

457-
return models.map((modelItem: AccessTokenModel) => instance.parseResult(new AccessTokenModel(modelItem)))
457+
return models.map((modelItem: AccessTokenJsonResponse) => instance.parseResult(new AccessTokenModel(modelItem)))
458458
}
459459

460460
static async findMany(ids: number[]): Promise<AccessTokenModel[]> {
@@ -658,7 +658,7 @@ export class AccessTokenModel {
658658
this.mapCustomGetters(models)
659659
await this.loadRelations(models)
660660

661-
const data = await Promise.all(models.map(async (model: AccessTokenModel) => {
661+
const data = await Promise.all(models.map(async (model: AccessTokenJsonResponse) => {
662662
return new AccessTokenModel(model)
663663
}))
664664

@@ -1358,7 +1358,7 @@ export class AccessTokenModel {
13581358
return model !== null && model !== undefined
13591359
}
13601360

1361-
static async latest(): Promise<AccessTokenType | undefined> {
1361+
static async latest(): Promise<AccessTokenModel | undefined> {
13621362
const instance = new AccessTokenModel(undefined)
13631363

13641364
const model = await DB.instance.selectFrom('personal_access_tokens')
@@ -1376,7 +1376,7 @@ export class AccessTokenModel {
13761376
return data
13771377
}
13781378

1379-
static async oldest(): Promise<AccessTokenType | undefined> {
1379+
static async oldest(): Promise<AccessTokenModel | undefined> {
13801380
const instance = new AccessTokenModel(undefined)
13811381

13821382
const model = await DB.instance.selectFrom('personal_access_tokens')
@@ -1521,8 +1521,8 @@ export class AccessTokenModel {
15211521
return instance
15221522
}
15231523

1524-
async last(): Promise<AccessTokenType | undefined> {
1525-
let model: AccessTokenModel | undefined
1524+
async last(): Promise<AccessTokenModel | undefined> {
1525+
let model: AccessTokenJsonResponse | undefined
15261526

15271527
if (this.hasSelect) {
15281528
model = await this.selectFromQuery.executeTakeFirst()
@@ -1541,7 +1541,7 @@ export class AccessTokenModel {
15411541
return data
15421542
}
15431543

1544-
static async last(): Promise<AccessTokenType | undefined> {
1544+
static async last(): Promise<AccessTokenModel | undefined> {
15451545
const model = await DB.instance.selectFrom('personal_access_tokens').selectAll().orderBy('id', 'desc').executeTakeFirst()
15461546

15471547
if (!model)

storage/framework/orm/src/models/Coupon.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export class CouponModel {
135135
}
136136
}
137137

138-
async mapCustomSetters(model: CouponJsonResponse): Promise<void> {
138+
async mapCustomSetters(model: NewCoupon): Promise<void> {
139139
const customSetter = {
140140
default: () => {
141141
},
@@ -494,7 +494,7 @@ export class CouponModel {
494494
instance.mapCustomGetters(models)
495495
await instance.loadRelations(models)
496496

497-
return models.map((modelItem: CouponModel) => instance.parseResult(new CouponModel(modelItem)))
497+
return models.map((modelItem: CouponJsonResponse) => instance.parseResult(new CouponModel(modelItem)))
498498
}
499499

500500
static async findMany(ids: number[]): Promise<CouponModel[]> {
@@ -698,7 +698,7 @@ export class CouponModel {
698698
this.mapCustomGetters(models)
699699
await this.loadRelations(models)
700700

701-
const data = await Promise.all(models.map(async (model: CouponModel) => {
701+
const data = await Promise.all(models.map(async (model: CouponJsonResponse) => {
702702
return new CouponModel(model)
703703
}))
704704

@@ -1447,7 +1447,7 @@ export class CouponModel {
14471447
return model !== null && model !== undefined
14481448
}
14491449

1450-
static async latest(): Promise<CouponType | undefined> {
1450+
static async latest(): Promise<CouponModel | undefined> {
14511451
const instance = new CouponModel(undefined)
14521452

14531453
const model = await DB.instance.selectFrom('coupons')
@@ -1465,7 +1465,7 @@ export class CouponModel {
14651465
return data
14661466
}
14671467

1468-
static async oldest(): Promise<CouponType | undefined> {
1468+
static async oldest(): Promise<CouponModel | undefined> {
14691469
const instance = new CouponModel(undefined)
14701470

14711471
const model = await DB.instance.selectFrom('coupons')
@@ -1610,8 +1610,8 @@ export class CouponModel {
16101610
return instance
16111611
}
16121612

1613-
async last(): Promise<CouponType | undefined> {
1614-
let model: CouponModel | undefined
1613+
async last(): Promise<CouponModel | undefined> {
1614+
let model: CouponJsonResponse | undefined
16151615

16161616
if (this.hasSelect) {
16171617
model = await this.selectFromQuery.executeTakeFirst()
@@ -1630,7 +1630,7 @@ export class CouponModel {
16301630
return data
16311631
}
16321632

1633-
static async last(): Promise<CouponType | undefined> {
1633+
static async last(): Promise<CouponModel | undefined> {
16341634
const model = await DB.instance.selectFrom('coupons').selectAll().orderBy('id', 'desc').executeTakeFirst()
16351635

16361636
if (!model)

storage/framework/orm/src/models/Customer.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export class CustomerModel {
136136
}
137137
}
138138

139-
async mapCustomSetters(model: CustomerJsonResponse): Promise<void> {
139+
async mapCustomSetters(model: NewCustomer): Promise<void> {
140140
const customSetter = {
141141
default: () => {
142142
},
@@ -439,7 +439,7 @@ export class CustomerModel {
439439
instance.mapCustomGetters(models)
440440
await instance.loadRelations(models)
441441

442-
return models.map((modelItem: CustomerModel) => instance.parseResult(new CustomerModel(modelItem)))
442+
return models.map((modelItem: CustomerJsonResponse) => instance.parseResult(new CustomerModel(modelItem)))
443443
}
444444

445445
static async findMany(ids: number[]): Promise<CustomerModel[]> {
@@ -643,7 +643,7 @@ export class CustomerModel {
643643
this.mapCustomGetters(models)
644644
await this.loadRelations(models)
645645

646-
const data = await Promise.all(models.map(async (model: CustomerModel) => {
646+
const data = await Promise.all(models.map(async (model: CustomerJsonResponse) => {
647647
return new CustomerModel(model)
648648
}))
649649

@@ -1336,7 +1336,7 @@ export class CustomerModel {
13361336
return model !== null && model !== undefined
13371337
}
13381338

1339-
static async latest(): Promise<CustomerType | undefined> {
1339+
static async latest(): Promise<CustomerModel | undefined> {
13401340
const instance = new CustomerModel(undefined)
13411341

13421342
const model = await DB.instance.selectFrom('customers')
@@ -1354,7 +1354,7 @@ export class CustomerModel {
13541354
return data
13551355
}
13561356

1357-
static async oldest(): Promise<CustomerType | undefined> {
1357+
static async oldest(): Promise<CustomerModel | undefined> {
13581358
const instance = new CustomerModel(undefined)
13591359

13601360
const model = await DB.instance.selectFrom('customers')
@@ -1499,8 +1499,8 @@ export class CustomerModel {
14991499
return instance
15001500
}
15011501

1502-
async last(): Promise<CustomerType | undefined> {
1503-
let model: CustomerModel | undefined
1502+
async last(): Promise<CustomerModel | undefined> {
1503+
let model: CustomerJsonResponse | undefined
15041504

15051505
if (this.hasSelect) {
15061506
model = await this.selectFromQuery.executeTakeFirst()
@@ -1519,7 +1519,7 @@ export class CustomerModel {
15191519
return data
15201520
}
15211521

1522-
static async last(): Promise<CustomerType | undefined> {
1522+
static async last(): Promise<CustomerModel | undefined> {
15231523
const model = await DB.instance.selectFrom('customers').selectAll().orderBy('id', 'desc').executeTakeFirst()
15241524

15251525
if (!model)

storage/framework/orm/src/models/Deployment.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export class DeploymentModel {
124124
}
125125
}
126126

127-
async mapCustomSetters(model: DeploymentJsonResponse): Promise<void> {
127+
async mapCustomSetters(model: NewDeployment): Promise<void> {
128128
const customSetter = {
129129
default: () => {
130130
},
@@ -423,7 +423,7 @@ export class DeploymentModel {
423423
instance.mapCustomGetters(models)
424424
await instance.loadRelations(models)
425425

426-
return models.map((modelItem: DeploymentModel) => instance.parseResult(new DeploymentModel(modelItem)))
426+
return models.map((modelItem: DeploymentJsonResponse) => instance.parseResult(new DeploymentModel(modelItem)))
427427
}
428428

429429
static async findMany(ids: number[]): Promise<DeploymentModel[]> {
@@ -627,7 +627,7 @@ export class DeploymentModel {
627627
this.mapCustomGetters(models)
628628
await this.loadRelations(models)
629629

630-
const data = await Promise.all(models.map(async (model: DeploymentModel) => {
630+
const data = await Promise.all(models.map(async (model: DeploymentJsonResponse) => {
631631
return new DeploymentModel(model)
632632
}))
633633

@@ -1307,7 +1307,7 @@ export class DeploymentModel {
13071307
return model !== null && model !== undefined
13081308
}
13091309

1310-
static async latest(): Promise<DeploymentType | undefined> {
1310+
static async latest(): Promise<DeploymentModel | undefined> {
13111311
const instance = new DeploymentModel(undefined)
13121312

13131313
const model = await DB.instance.selectFrom('deployments')
@@ -1325,7 +1325,7 @@ export class DeploymentModel {
13251325
return data
13261326
}
13271327

1328-
static async oldest(): Promise<DeploymentType | undefined> {
1328+
static async oldest(): Promise<DeploymentModel | undefined> {
13291329
const instance = new DeploymentModel(undefined)
13301330

13311331
const model = await DB.instance.selectFrom('deployments')
@@ -1470,8 +1470,8 @@ export class DeploymentModel {
14701470
return instance
14711471
}
14721472

1473-
async last(): Promise<DeploymentType | undefined> {
1474-
let model: DeploymentModel | undefined
1473+
async last(): Promise<DeploymentModel | undefined> {
1474+
let model: DeploymentJsonResponse | undefined
14751475

14761476
if (this.hasSelect) {
14771477
model = await this.selectFromQuery.executeTakeFirst()
@@ -1490,7 +1490,7 @@ export class DeploymentModel {
14901490
return data
14911491
}
14921492

1493-
static async last(): Promise<DeploymentType | undefined> {
1493+
static async last(): Promise<DeploymentModel | undefined> {
14941494
const model = await DB.instance.selectFrom('deployments').selectAll().orderBy('id', 'desc').executeTakeFirst()
14951495

14961496
if (!model)

storage/framework/orm/src/models/Error.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export class ErrorModel {
115115
}
116116
}
117117

118-
async mapCustomSetters(model: ErrorJsonResponse): Promise<void> {
118+
async mapCustomSetters(model: NewError): Promise<void> {
119119
const customSetter = {
120120
default: () => {
121121
},
@@ -382,7 +382,7 @@ export class ErrorModel {
382382
instance.mapCustomGetters(models)
383383
await instance.loadRelations(models)
384384

385-
return models.map((modelItem: ErrorModel) => instance.parseResult(new ErrorModel(modelItem)))
385+
return models.map((modelItem: ErrorJsonResponse) => instance.parseResult(new ErrorModel(modelItem)))
386386
}
387387

388388
static async findMany(ids: number[]): Promise<ErrorModel[]> {
@@ -586,7 +586,7 @@ export class ErrorModel {
586586
this.mapCustomGetters(models)
587587
await this.loadRelations(models)
588588

589-
const data = await Promise.all(models.map(async (model: ErrorModel) => {
589+
const data = await Promise.all(models.map(async (model: ErrorJsonResponse) => {
590590
return new ErrorModel(model)
591591
}))
592592

@@ -1246,7 +1246,7 @@ export class ErrorModel {
12461246
return model !== null && model !== undefined
12471247
}
12481248

1249-
static async latest(): Promise<ErrorType | undefined> {
1249+
static async latest(): Promise<ErrorModel | undefined> {
12501250
const instance = new ErrorModel(undefined)
12511251

12521252
const model = await DB.instance.selectFrom('errors')
@@ -1264,7 +1264,7 @@ export class ErrorModel {
12641264
return data
12651265
}
12661266

1267-
static async oldest(): Promise<ErrorType | undefined> {
1267+
static async oldest(): Promise<ErrorModel | undefined> {
12681268
const instance = new ErrorModel(undefined)
12691269

12701270
const model = await DB.instance.selectFrom('errors')
@@ -1409,8 +1409,8 @@ export class ErrorModel {
14091409
return instance
14101410
}
14111411

1412-
async last(): Promise<ErrorType | undefined> {
1413-
let model: ErrorModel | undefined
1412+
async last(): Promise<ErrorModel | undefined> {
1413+
let model: ErrorJsonResponse | undefined
14141414

14151415
if (this.hasSelect) {
14161416
model = await this.selectFromQuery.executeTakeFirst()
@@ -1429,7 +1429,7 @@ export class ErrorModel {
14291429
return data
14301430
}
14311431

1432-
static async last(): Promise<ErrorType | undefined> {
1432+
static async last(): Promise<ErrorModel | undefined> {
14331433
const model = await DB.instance.selectFrom('errors').selectAll().orderBy('id', 'desc').executeTakeFirst()
14341434

14351435
if (!model)

0 commit comments

Comments
 (0)