Skip to content

Commit de00bf5

Browse files
committed
chore(cleanup): types in lib and coverage threshold
Increases coverage threshold based on updated test suite Updates the types used in lib/users to match updated API types Generated updated Swagger
1 parent d565422 commit de00bf5

File tree

7 files changed

+170
-13
lines changed

7 files changed

+170
-13
lines changed

src/__generated__/routes/routes.ts

Lines changed: 47 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/__generated__/swagger.json

Lines changed: 110 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/users/EOAUpsertStrategy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { verifyAuthSignedData } from "../../utils/verifyAuthSignedData.js";
22
import { SupabaseDataService } from "../../services/SupabaseDataService.js";
3-
import type { AddOrUpdateUserResponse } from "../../types/api.js";
3+
import type { UserResponse } from "../../types/api.js";
44

55
import type { EOAUpdateRequest } from "./schemas.js";
66
import type { UserUpsertStrategy } from "./UserUpsertStrategy.js";
@@ -16,7 +16,7 @@ export default class EOAUpdateStrategy implements UserUpsertStrategy {
1616
this.dataService = new SupabaseDataService();
1717
}
1818

19-
async execute(): Promise<AddOrUpdateUserResponse> {
19+
async execute(): Promise<UserResponse> {
2020
await this.throwIfInvalidSignature();
2121
const user = await this.upsertUser();
2222
return {

src/lib/users/MultisigUpsertStrategy.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import SafeApiKit, { type SafeApiKitConfig } from "@safe-global/api-kit";
33

44
import { SignatureRequestPurpose } from "../../graphql/schemas/typeDefs/signatureRequestTypeDefs.js";
55
import { SupabaseDataService } from "../../services/SupabaseDataService.js";
6-
import { AddOrUpdateUserResponse } from "../../types/api.js";
6+
import { UserResponse } from "../../types/api.js";
77
import { isTypedMessage } from "../../utils/signatures.js";
88

99
import type { UserUpsertStrategy } from "./UserUpsertStrategy.js";
@@ -45,7 +45,7 @@ export default class MultisigUpdateStrategy implements UserUpsertStrategy {
4545
}
4646

4747
// We could check if it's a 1 of 1 and execute right away
48-
async execute(): Promise<AddOrUpdateUserResponse> {
48+
async execute(): Promise<UserResponse> {
4949
const { message } = await this.safeApiKit.getMessage(
5050
this.request.messageHash,
5151
);
@@ -76,7 +76,6 @@ export default class MultisigUpdateStrategy implements UserUpsertStrategy {
7676
return {
7777
success: true,
7878
message: "Signature request created successfully",
79-
data: null,
8079
};
8180
}
8281
}

src/lib/users/UserUpsertStrategy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { AddOrUpdateUserResponse } from "../../types/api.js";
1+
import { UserResponse } from "../../types/api.js";
22

33
import MultisigUpsertStrategy from "./MultisigUpsertStrategy.js";
44
import EOAUpsertStrategy from "./EOAUpsertStrategy.js";
55
import { EOAUpdateRequest, MultisigUpdateRequest } from "./schemas.js";
66

77
export interface UserUpsertStrategy {
8-
execute(): Promise<AddOrUpdateUserResponse>;
8+
execute(): Promise<UserResponse>;
99
}
1010

1111
export function createStrategy(

src/lib/users/errors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { AddOrUpdateUserResponse } from "../../types/api.js";
1+
import { UserResponse } from "../../types/api.js";
22

33
export class UserUpsertError extends Error {
44
code: number;
5-
public errors: AddOrUpdateUserResponse["errors"];
5+
public errors: UserResponse["errors"];
66
constructor(code: number, message: string) {
77
super(message);
88
this.name = "UserUpdateError";

vitest.config.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ export default defineConfig({
1111
// If you want a coverage reports even if your tests are failing, include the reportOnFailure option
1212
reportOnFailure: true,
1313
thresholds: {
14-
lines: 15,
15-
branches: 54,
16-
functions: 49,
17-
statements: 15,
14+
lines: 17,
15+
branches: 60,
16+
functions: 54,
17+
statements: 17,
1818
},
1919
include: ["src/**/*.ts"],
2020
exclude: [
@@ -24,6 +24,7 @@ export default defineConfig({
2424
"src/__generated__/**/*",
2525
"src/graphql/**/*",
2626
"src/types/**/*",
27+
"src/abis/**/*",
2728
"./lib/**/*",
2829
],
2930
},

0 commit comments

Comments
 (0)