anbaric-impl-cloud 1.23.2 → 1.24.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.
@@ -0,0 +1,10 @@
1
+ import { JobRunSchedulePersistence, ScheduledRun } from "anbaric-tsapi";
2
+ declare class CloudJobRunSchedulePersistence implements JobRunSchedulePersistence {
3
+ private client;
4
+ constructor(baseUrl?: string);
5
+ highWaterMark(appId: string, workflowId: string): Promise<Date | undefined>;
6
+ plan(runs: Array<ScheduledRun>): Promise<void>;
7
+ claimDue(at: Date): Promise<Array<ScheduledRun>>;
8
+ }
9
+ export { CloudJobRunSchedulePersistence };
10
+ //# sourceMappingURL=CloudJobRunSchedulePersistence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CloudJobRunSchedulePersistence.d.ts","sourceRoot":"","sources":["../src/CloudJobRunSchedulePersistence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,yBAAyB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAGtE,cAAM,8BAA+B,YAAW,yBAAyB;IAErE,OAAO,CAAC,MAAM,CAAkB;IAEhC,YAAY,OAAO,GAAG,MAAwC,EAE7D;IAEK,aAAa,CAAC,KAAK,EAAG,MAAM,EAAE,UAAU,EAAG,MAAM,GAAI,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,CAKnF;IAEK,IAAI,CAAC,IAAI,EAAG,KAAK,CAAC,YAAY,CAAC,GAAI,OAAO,CAAC,IAAI,CAAC,CAKrD;IAEK,QAAQ,CAAC,EAAE,EAAG,IAAI,GAAI,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAQvD;CAEJ;AAED,OAAO,EAAE,8BAA8B,EAAE,CAAA"}
@@ -0,0 +1,29 @@
1
+ import { CloudApiClient } from "./CloudApiClient.js";
2
+ class CloudJobRunSchedulePersistence {
3
+ client;
4
+ constructor(baseUrl = CloudApiClient.defaultBaseUrl()) {
5
+ this.client = new CloudApiClient(baseUrl);
6
+ }
7
+ async highWaterMark(appId, workflowId) {
8
+ const query = `appId=${encodeURIComponent(appId)}&workflowId=${encodeURIComponent(workflowId)}`;
9
+ const response = await this.client.request("GET", `/job-run-schedules/high-water-mark?${query}`);
10
+ return response.highWaterMark ? new Date(response.highWaterMark) : undefined;
11
+ }
12
+ async plan(runs) {
13
+ if (runs.length === 0)
14
+ return;
15
+ await this.client.request("POST", "/job-run-schedules/plan", {
16
+ runs: runs.map(run => ({ ...run, runAt: run.runAt.toISOString() })),
17
+ });
18
+ }
19
+ async claimDue(at) {
20
+ const response = await this.client.request("POST", "/job-run-schedules/claim-due", { at: at.toISOString() });
21
+ return (response.runs ?? []).map(run => ({
22
+ appId: run.appId ?? "",
23
+ workflowId: run.workflowId,
24
+ runAt: new Date(run.runAt),
25
+ }));
26
+ }
27
+ }
28
+ export { CloudJobRunSchedulePersistence };
29
+ //# sourceMappingURL=CloudJobRunSchedulePersistence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CloudJobRunSchedulePersistence.js","sourceRoot":"","sources":["../src/CloudJobRunSchedulePersistence.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAEnD,MAAM,8BAA8B;IAExB,MAAM,CAAkB;IAEhC,YAAY,OAAO,GAAY,cAAc,CAAC,cAAc,EAAE;QAC1D,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,KAAc,EAAE,UAAmB;QACnD,MAAM,KAAK,GAAG,SAAS,kBAAkB,CAAC,KAAK,CAAC,eAAe,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC;QAChG,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,sCAAsC,KAAK,EAAE,CAC1D,CAAC;QACtC,OAAO,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACjF,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,IAA0B;QACjC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QAC9B,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,yBAAyB,EAAE;YACzD,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;SACtE,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,EAAS;QACpB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,8BAA8B,EAC7E,EAAE,EAAE,EAAE,EAAE,CAAC,WAAW,EAAE,EAAE,CAA8E,CAAC;QAC3G,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACrC,KAAK,EAAE,GAAG,CAAC,KAAK,IAAI,EAAE;YACtB,UAAU,EAAE,GAAG,CAAC,UAAU;YAC1B,KAAK,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;SAC7B,CAAC,CAAC,CAAC;IACR,CAAC;CAEJ;AAED,OAAO,EAAE,8BAA8B,EAAE,CAAA"}
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export * from "./CloudJobPersistence.js";
3
3
  export * from "./CloudJsonStore.js";
4
4
  export * from "./CloudSecretStore.js";
5
5
  export * from "./CloudQueue.js";
6
+ export * from "./CloudJobRunSchedulePersistence.js";
6
7
  export * from "./CloudAuditor.js";
7
8
  export * from "./CloudSessionResolver.js";
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qCAAqC,CAAC;AACpD,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ export * from "./CloudJobPersistence.js";
3
3
  export * from "./CloudJsonStore.js";
4
4
  export * from "./CloudSecretStore.js";
5
5
  export * from "./CloudQueue.js";
6
+ export * from "./CloudJobRunSchedulePersistence.js";
6
7
  export * from "./CloudAuditor.js";
7
8
  export * from "./CloudSessionResolver.js";
8
9
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qCAAqC,CAAC;AACpD,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anbaric-impl-cloud",
3
- "version": "1.23.2",
3
+ "version": "1.24.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",
@@ -20,7 +20,7 @@
20
20
  "prepublishOnly": "npm run build"
21
21
  },
22
22
  "dependencies": {
23
- "anbaric-tsapi": "^1.23.2"
23
+ "anbaric-tsapi": "^1.24.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/node": "^26.2.0",