Skip to content

Commit 8d9b5c0

Browse files
committed
SDK codegen + signature options
1 parent 56d7dd5 commit 8d9b5c0

File tree

5 files changed

+323
-310
lines changed

5 files changed

+323
-310
lines changed

packages/engine/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
],
2525
"devDependencies": {
2626
"@biomejs/biome": "2.0.4",
27-
"@hey-api/openapi-ts": "0.76.0",
27+
"@hey-api/openapi-ts": "0.77.0",
2828
"rimraf": "6.0.1",
2929
"tslib": "^2.8.1"
3030
},

packages/engine/src/client/client/client.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ export const createClient = (config: Config = {}): Client => {
4646
});
4747
}
4848

49+
if (opts.requestValidator) {
50+
await opts.requestValidator(opts);
51+
}
52+
4953
if (opts.body && opts.bodySerializer) {
5054
opts.body = opts.bodySerializer(opts.body);
5155
}

packages/engine/src/client/core/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ export interface Config {
8484
* {@link https://swagger.io/docs/specification/serialization/#query View examples}
8585
*/
8686
querySerializer?: QuerySerializer | QuerySerializerOptions;
87+
/**
88+
* A function validating request data. This is useful if you want to ensure
89+
* the request conforms to the desired shape, so it can be safely sent to
90+
* the server.
91+
*/
92+
requestValidator?: (data: unknown) => Promise<unknown>;
8793
/**
8894
* A function transforming response data before it's returned. This is useful
8995
* for post-processing data, e.g. converting ISO strings into Date objects.

packages/engine/src/client/types.gen.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,18 @@ export type SigningOptions =
819819
})
820820
| (Erc4337SigningOptions & {
821821
type: "ERC4337";
822-
});
822+
})
823+
| {
824+
type: "auto";
825+
/**
826+
* The address to sign from
827+
*/
828+
from: string;
829+
/**
830+
* The chain ID for the signing operation
831+
*/
832+
chainId: number;
833+
};
823834

824835
/**
825836
* Execution Option Variants

0 commit comments

Comments
 (0)