anbaric-impl-cloud 1.12.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anbaric-impl-cloud",
3
- "version": "1.12.0",
3
+ "version": "1.14.0",
4
4
  "description": "Public client library for the Anbaric Cloud hosting API, providing JobPersistence and Queue implementations backed by the cloud service",
5
5
  "license": "MIT",
6
6
  "author": "chris@anbaric.ai",
@@ -11,7 +11,7 @@
11
11
  "test": "vitest run"
12
12
  },
13
13
  "dependencies": {
14
- "anbaric-tsapi": "^1.12.0"
14
+ "anbaric-tsapi": "^1.14.0"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@types/node": "^26.2.0",
@@ -28,6 +28,20 @@ class CloudJobPersistence extends JobPersistence {
28
28
  return serialized.map(deserializeJob);
29
29
  }
30
30
 
31
+ protected async killInternal(id : string) : Promise<void> {
32
+ await this.client.request("POST", `/jobs/${encodeURIComponent(id)}/kill`, {});
33
+ }
34
+
35
+ protected async killOlderThanInternal(lastUpdatedBefore : Date) : Promise<number> {
36
+ const result = await this.client.request("POST", "/jobs/kill-old", { before: lastUpdatedBefore.toISOString() });
37
+ return result.killed;
38
+ }
39
+
40
+ protected async countByStateInternal() : Promise<Array<JobPersistence.StateCount>> {
41
+ const result = await this.client.request("GET", "/jobs/stats");
42
+ return result.states;
43
+ }
44
+
31
45
  }
32
46
 
33
47
  export { CloudJobPersistence }