anbaric-impl-cloud 1.16.4 → 1.18.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/README.md CHANGED
@@ -8,21 +8,22 @@ when the platform injects the `cloud` environment.
8
8
 
9
9
  All clients default their base URL to `ANBARIC_CLOUD_URL`. On a platform
10
10
  this points at the platform's **internal entry point**, which serves only
11
- the workflow APIs and is unreachable from outside the deployment's network.
11
+ the workflow APIs (under `/api/v2`) and is unreachable from outside the
12
+ deployment's network.
12
13
 
13
14
  | Class | Contract | Talks to |
14
15
  | --- | --- | --- |
15
- | `CloudJobPersistence` | `JobPersistence` | `/jobs` |
16
- | `CloudQueue` | `Queue` | `/queue/enqueue`, `/queue/schedule` |
17
- | `CloudJsonStore` | `JsonStore` | `/documents/<collection>` (validates against its schema client-side first) |
18
- | `CloudSecretStore` | `SecretStore` | `/secrets` |
16
+ | `CloudJobPersistence` | `JobPersistence` | `/api/v2/jobs` |
17
+ | `CloudQueue` | `Queue` | `/api/v2/queue/enqueue`, `/api/v2/queue/schedule` |
18
+ | `CloudJsonStore` | `JsonStore` | `/api/v2/documents/<collection>` (validates against its schema client-side first) |
19
+ | `CloudSecretStore` | `SecretStore` | `/api/v2/secrets` |
19
20
  | `CloudConsumer` | `Consumer` | listens on `ANBARIC_CONSUMER_PORT` for `POST /process` pushes |
20
21
 
21
22
  `CloudConsumer` is the push half of the platform's at-least-once delivery:
22
23
  the platform's dispatcher POSTs `{ messages }` to the app's consumer URL,
23
24
  the consumer responds `202` immediately, routes each message to its
24
25
  workflow's subscriber, and confirms each successfully processed message back
25
- via `POST /queue/confirm`. Unconfirmed messages are redelivered after the
26
+ via `POST /api/v2/queue/confirm`. Unconfirmed messages are redelivered after the
26
27
  platform's lease expires, so job processing must be idempotent.
27
28
 
28
29
  Environment (all injected by the platform into deployed apps):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anbaric-impl-cloud",
3
- "version": "1.16.4",
3
+ "version": "1.18.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.16.4"
14
+ "anbaric-tsapi": "^1.18.0"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@types/node": "^26.2.0",
@@ -1,4 +1,5 @@
1
1
  const DEFAULT_BASE_URL = "http://localhost:8787";
2
+ const API_PREFIX = "/api/v2";
2
3
 
3
4
  class CloudApiClient {
4
5
 
@@ -9,7 +10,7 @@ class CloudApiClient {
9
10
  }
10
11
 
11
12
  async request(method : string, path : string, body? : unknown) : Promise<any> {
12
- const response = await fetch(`${this.baseUrl}${path}`, {
13
+ const response = await fetch(`${this.baseUrl}${API_PREFIX}${path}`, {
13
14
  method,
14
15
  headers: body === undefined ? undefined : { "content-type": "application/json" },
15
16
  body: body === undefined ? undefined : JSON.stringify(body),