Skip to content

Commit 6cc8429

Browse files
authored
Fix: use correct slug pattern for acme (#21)
1 parent b5b2273 commit 6cc8429

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

docs/internal/ARCHITECTURE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The package also ships **sibling accessors for other backoffices** —
1616
this package's auth (`TokenManager`), retry/backoff loop, `Logger`, base error
1717
types, tooling, and the Odyssey UI — differing only in transport (REST vs
1818
GraphQL) and gateway routing (`cng_backoffice_api-v1` /
19-
`acme_backoffice_api@v1` vs `peek_backoffice_api-v1`). See "CNG accessor" and
19+
`acme_backoffice_api-v1` vs `peek_backoffice_api-v1`). See "CNG accessor" and
2020
"ACME accessor" below.
2121

2222
## Layers
@@ -303,8 +303,8 @@ routing, endpoint, and response shape differ:
303303
the app-registry base URL, and exposes `getProductService()` +
304304
`getAllActivities()`.
305305
- **`RestClient`** (`src/internal/acme/rest-client.ts`) — the CNG REST client
306-
cloned with `extendableSlug = acme_backoffice_api@v1` (note the `@v1`
307-
separator, unlike CNG's `-v1`), logging `"Making ACME request"` and throwing
306+
cloned with `extendableSlug = acme_backoffice_api-v1` (same `-v1` separator
307+
as CNG/Peek), logging `"Making ACME request"` and throwing
308308
`AcmeApiError` on non-2xx.
309309
- **Products triad** (`src/internal/acme/products/`) — `product-queries.ts`
310310
(raw `TemplateNode`/`TemplatesResponse` for the `{ list: [...] }` envelope,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@peektravel/app-utilities",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "GraphQL JS mapping utilities extracted from the Peek Pro Autopilot connector.",
55
"license": "MIT",
66
"repository": {

src/acme-access-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Auth and transport mirror the CNG access service: the same app JWT
1010
* (`X-Peek-Auth: Bearer`) minted from the Peek app credentials via the shared
1111
* {@link TokenManager}, routed through the app-registry installations API. The
12-
* only differences are the extendable slug (`acme_backoffice_api@v1`), REST
12+
* only differences are the extendable slug (`acme_backoffice_api-v1`), REST
1313
* rather than GraphQL, and no `pk-api-key` header.
1414
*/
1515
import {

src/internal/acme/endpoints.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
/**
88
* Fixed extendable slug inserted between `appId` and the REST path. This is the
99
* only routing difference from the other gateways (CNG uses
10-
* `cng_backoffice_api-v1`; note ACME's `@v1` separator).
10+
* `cng_backoffice_api-v1`; Peek uses `peek_backoffice_api-v1`).
1111
*/
12-
export const ACME_EXTENDABLE_SLUG = "acme_backoffice_api@v1";
12+
export const ACME_EXTENDABLE_SLUG = "acme_backoffice_api-v1";
1313

1414
/** REST path (relative to the extendable) for the event-template names list. */
1515
export const TEMPLATES_PATH = "v2/b2b/event/templates/names?pageSize=-1&page=1";

test/acme/acme-access-service.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe("AcmeAccessService", () => {
6161
},
6262
]);
6363
expect(calls[0]).toBe(
64-
"https://app-registry.peeklabs.com/installations-api/app-1/acme_backoffice_api@v1/v2/b2b/event/templates/names?pageSize=-1&page=1",
64+
"https://app-registry.peeklabs.com/installations-api/app-1/acme_backoffice_api-v1/v2/b2b/event/templates/names?pageSize=-1&page=1",
6565
);
6666
});
6767

@@ -80,7 +80,7 @@ describe("AcmeAccessService", () => {
8080
await acme.getAllActivities();
8181

8282
expect(calls[0]).toBe(
83-
"https://custom.test/base/app-1/acme_backoffice_api@v1/v2/b2b/event/templates/names?pageSize=-1&page=1",
83+
"https://custom.test/base/app-1/acme_backoffice_api-v1/v2/b2b/event/templates/names?pageSize=-1&page=1",
8484
);
8585
});
8686
});

test/acme/products/product-service.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function buildClient(
4545
return new RestClient({
4646
baseUrl: "https://gw.test/api",
4747
appId: "app-1",
48-
extendableSlug: "acme_backoffice_api@v1",
48+
extendableSlug: "acme_backoffice_api-v1",
4949
getToken: () => "tok-123",
5050
retryDelaysMs: [],
5151
logger: noopLogger,
@@ -80,7 +80,7 @@ describe("AcmeProductService.getAllActivities", () => {
8080

8181
expect(calls).toHaveLength(1);
8282
expect(calls[0]!.url).toBe(
83-
"https://gw.test/api/app-1/acme_backoffice_api@v1/v2/b2b/event/templates/names?pageSize=-1&page=1",
83+
"https://gw.test/api/app-1/acme_backoffice_api-v1/v2/b2b/event/templates/names?pageSize=-1&page=1",
8484
);
8585
expect(calls[0]!.init.method).toBe("GET");
8686
const headers = calls[0]!.init.headers as Record<string, string>;

0 commit comments

Comments
 (0)