API: init op_key, improve seralisation & signature typing #1622

Merged
clan-bot merged 6 commits from hsjobeki/clan-core:hsjobeki-main into main 2024-06-15 09:38:29 +00:00
Showing only changes of commit 0cf86806b2 - Show all commits

View File

@ -11,15 +11,17 @@ faker.option({
const getFakeResponse = (method: OperationNames, data: any) => {
const fakeData = faker.generate(schema.properties[method].properties.return);
const { op_key } = data;
if (method === "open_file") {
return {
status: "success",
data: "/path/to/clan",
op_key,
};
}
return fakeData;
// @ts-expect-error: fakeData is guaranteed to always be some object
return { ...fakeData, op_key };
};
export { getFakeResponse };