Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Correct HTTP status code for blob upload #116

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions sdk-node/src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export class Service {
body: blob,
})
.then(async (res) => {
if (res.status === 204) {
if (res.status === 201) {
log("Uploaded blob", call.id, call.function);
} else {
throw new InferableError(`Failed to upload blob: ${res.status}`, {
Expand Down Expand Up @@ -269,24 +269,26 @@ export class Service {
});
}

const result = await executeFn(
registration.func,
[args, {
const result = await executeFn(registration.func, [
args,
{
authContext: call.authContext,
runContext: call.runContext,
approved: call.approved,
}],
);
},
]);

await onComplete(result);
}
}

export const registerMachine = async (client: ReturnType<typeof createApiClient>,
export const registerMachine = async (
client: ReturnType<typeof createApiClient>,
service?: {
name: string;
functions: FunctionRegistration[];
}) => {
},
) => {
log("registering machine", {
service: service?.name,
functions: service?.functions.map((f) => f.name),
Expand Down Expand Up @@ -319,5 +321,4 @@ export const registerMachine = async (client: ReturnType<typeof createApiClient>
return {
clusterId: registerResult.body.clusterId,
};
}

};