Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
glennmichael123 committed Jan 30, 2025
1 parent 0ffe4d9 commit bb18d38
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 41 deletions.
6 changes: 3 additions & 3 deletions storage/framework/core/orm/src/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export async function generateModelString(
.selectAll()
.execute()
return results.map((modelItem) => new ${modelRelation}(modelItem))
return results.map((modelItem: ${modelName}Model) => new ${modelRelation}(modelItem))
}\n\n`
}

Expand Down Expand Up @@ -1751,7 +1751,7 @@ export async function generateModelString(
}
static async rawQuery(rawQuery: string): Promise<any> {
return await sql\`\${rawQuery}\`\.execute(db)
return await sql\`\${rawQuery}\`\.execute(DB.instance)
}
toJSON(): Partial<${modelName}JsonResponse> {
Expand Down Expand Up @@ -1797,7 +1797,7 @@ export async function generateModelString(
}
export async function rawQuery(rawQuery: string): Promise<any> {
return await sql\`\${rawQuery}\`\.execute(db)
return await sql\`\${rawQuery}\`\.execute(DB.instance)
}
export async function remove(id: number): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions storage/framework/orm/src/models/AccessToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ export class AccessTokenModel {
}

static async rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

toJSON(): Partial<AccessTokenJsonResponse> {
Expand Down Expand Up @@ -1171,7 +1171,7 @@ export async function create(newAccessToken: NewAccessToken): Promise<AccessToke
}

export async function rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

export async function remove(id: number): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions storage/framework/orm/src/models/Deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ export class DeploymentModel {
}

static async rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

toJSON(): Partial<DeploymentJsonResponse> {
Expand Down Expand Up @@ -1212,7 +1212,7 @@ export async function create(newDeployment: NewDeployment): Promise<DeploymentMo
}

export async function rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

export async function remove(id: number): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions storage/framework/orm/src/models/Error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ export class ErrorModel {
}

static async rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

toJSON(): Partial<ErrorJsonResponse> {
Expand Down Expand Up @@ -1154,7 +1154,7 @@ export async function create(newError: NewError): Promise<ErrorModel> {
}

export async function rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

export async function remove(id: number): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions storage/framework/orm/src/models/FailedJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ export class FailedJobModel {
}

static async rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

toJSON(): Partial<FailedJobJsonResponse> {
Expand Down Expand Up @@ -1154,7 +1154,7 @@ export async function create(newFailedJob: NewFailedJob): Promise<FailedJobModel
}

export async function rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

export async function remove(id: number): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions storage/framework/orm/src/models/Job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ export class JobModel {
}

static async rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

toJSON(): Partial<JobJsonResponse> {
Expand Down Expand Up @@ -1154,7 +1154,7 @@ export async function create(newJob: NewJob): Promise<JobModel> {
}

export async function rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

export async function remove(id: number): Promise<void> {
Expand Down
6 changes: 3 additions & 3 deletions storage/framework/orm/src/models/PaymentMethod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@ export class PaymentMethodModel {
.selectAll()
.execute()

return results.map(modelItem => new Transaction(modelItem))
return results.map((modelItem: PaymentMethodModel) => new Transaction(modelItem))
}

distinct(column: keyof PaymentMethodType): PaymentMethodModel {
Expand Down Expand Up @@ -1174,7 +1174,7 @@ export class PaymentMethodModel {
}

static async rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

toJSON(): Partial<PaymentMethodJsonResponse> {
Expand Down Expand Up @@ -1237,7 +1237,7 @@ export async function create(newPaymentMethod: NewPaymentMethod): Promise<Paymen
}

export async function rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

export async function remove(id: number): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions storage/framework/orm/src/models/Post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ export class PostModel {
}

static async rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

toJSON(): Partial<PostJsonResponse> {
Expand Down Expand Up @@ -1147,7 +1147,7 @@ export async function create(newPost: NewPost): Promise<PostModel> {
}

export async function rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

export async function remove(id: number): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions storage/framework/orm/src/models/Product.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ export class ProductModel {
}

static async rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

toJSON(): Partial<ProductJsonResponse> {
Expand Down Expand Up @@ -1183,7 +1183,7 @@ export async function create(newProduct: NewProduct): Promise<ProductModel> {
}

export async function rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

export async function remove(id: number): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions storage/framework/orm/src/models/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ export class ProjectModel {
}

static async rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

toJSON(): Partial<ProjectJsonResponse> {
Expand Down Expand Up @@ -1142,7 +1142,7 @@ export async function create(newProject: NewProject): Promise<ProjectModel> {
}

export async function rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

export async function remove(id: number): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions storage/framework/orm/src/models/Release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ export class ReleaseModel {
}

static async rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

toJSON(): Partial<ReleaseJsonResponse> {
Expand Down Expand Up @@ -1106,7 +1106,7 @@ export async function create(newRelease: NewRelease): Promise<ReleaseModel> {
}

export async function rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

export async function remove(id: number): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions storage/framework/orm/src/models/Subscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ export class SubscriberModel {
}

static async rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

toJSON(): Partial<SubscriberJsonResponse> {
Expand Down Expand Up @@ -1106,7 +1106,7 @@ export async function create(newSubscriber: NewSubscriber): Promise<SubscriberMo
}

export async function rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

export async function remove(id: number): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions storage/framework/orm/src/models/SubscriberEmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ export class SubscriberEmailModel {
}

static async rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

toJSON(): Partial<SubscriberEmailJsonResponse> {
Expand Down Expand Up @@ -1150,7 +1150,7 @@ export async function create(newSubscriberEmail: NewSubscriberEmail): Promise<Su
}

export async function rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

export async function remove(id: number): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions storage/framework/orm/src/models/Subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ export class SubscriptionModel {
}

static async rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

toJSON(): Partial<SubscriptionJsonResponse> {
Expand Down Expand Up @@ -1248,7 +1248,7 @@ export async function create(newSubscription: NewSubscription): Promise<Subscrip
}

export async function rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

export async function remove(id: number): Promise<void> {
Expand Down
6 changes: 3 additions & 3 deletions storage/framework/orm/src/models/Team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ export class TeamModel {
.selectAll()
.execute()

return results.map(modelItem => new AccessToken(modelItem))
return results.map((modelItem: TeamModel) => new AccessToken(modelItem))
}

async teamUsers() {
Expand Down Expand Up @@ -1173,7 +1173,7 @@ export class TeamModel {
}

static async rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

toJSON(): Partial<TeamJsonResponse> {
Expand Down Expand Up @@ -1235,7 +1235,7 @@ export async function create(newTeam: NewTeam): Promise<TeamModel> {
}

export async function rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

export async function remove(id: number): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions storage/framework/orm/src/models/Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ export class TransactionModel {
}

static async rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

toJSON(): Partial<TransactionJsonResponse> {
Expand Down Expand Up @@ -1218,7 +1218,7 @@ export async function create(newTransaction: NewTransaction): Promise<Transactio
}

export async function rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

export async function remove(id: number): Promise<void> {
Expand Down
12 changes: 6 additions & 6 deletions storage/framework/orm/src/models/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,7 @@ export class UserModel {
.selectAll()
.execute()

return results.map(modelItem => new Deployment(modelItem))
return results.map((modelItem: UserModel) => new Deployment(modelItem))
}

async subscriptionsHasMany(): Promise<SubscriptionModel[]> {
Expand All @@ -1190,7 +1190,7 @@ export class UserModel {
.selectAll()
.execute()

return results.map(modelItem => new Subscription(modelItem))
return results.map((modelItem: UserModel) => new Subscription(modelItem))
}

async paymentMethodsHasMany(): Promise<PaymentMethodModel[]> {
Expand All @@ -1203,7 +1203,7 @@ export class UserModel {
.selectAll()
.execute()

return results.map(modelItem => new PaymentMethod(modelItem))
return results.map((modelItem: UserModel) => new PaymentMethod(modelItem))
}

async transactionsHasMany(): Promise<TransactionModel[]> {
Expand All @@ -1216,7 +1216,7 @@ export class UserModel {
.selectAll()
.execute()

return results.map(modelItem => new Transaction(modelItem))
return results.map((modelItem: UserModel) => new Transaction(modelItem))
}

async userTeams() {
Expand Down Expand Up @@ -1517,7 +1517,7 @@ export class UserModel {
}

static async rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

toJSON(): Partial<UserJsonResponse> {
Expand Down Expand Up @@ -1578,7 +1578,7 @@ export async function create(newUser: NewUser): Promise<UserModel> {
}

export async function rawQuery(rawQuery: string): Promise<any> {
return await sql`${rawQuery}`.execute(db)
return await sql`${rawQuery}`.execute(DB.instance)
}

export async function remove(id: number): Promise<void> {
Expand Down

0 comments on commit bb18d38

Please sign in to comment.