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

feat: run.update() for generic run PUT requests #259

Merged
merged 5 commits into from
Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
2.6.0 / 2022/07/XX
==================
- Add `setStatusMessage` method for setting custom status messages on runs.
- Add `run.update()` method for setting fields on runs.

2.5.2 / 2022/06/27
===================
Expand Down
11 changes: 7 additions & 4 deletions src/resource_clients/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ export class RunClient extends ResourceClient {
return cast(parseDateFields(pluckData(response.data)));
}

async setStatusMessage(message: string) : Promise<ActorRun> {
return this._update({
statusMessage: message,
});
async update(newFields: RunUpdateOptions) : Promise<ActorRun> {
ow(newFields, ow.object);

return this._update(newFields);
}

/**
Expand Down Expand Up @@ -198,6 +198,9 @@ export interface RunMetamorphOptions {
contentType?: string;
build?: string;
}
export interface RunUpdateOptions {
statusMessage?: string;
}

export interface RunResurrectOptions {
build?: string;
Expand Down