@peektravel/app-utilities 0.8.2 → 0.9.1

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/docs/webhooks.md CHANGED
@@ -301,14 +301,17 @@ event**, so persist them alongside `installId`/`accountId`:
301
301
  - **`timezone`** — the account's IANA zone (e.g. `America/New_York`). Downstream
302
302
  date/time handling for the install (scheduling, day boundaries, display) needs
303
303
  the account's own zone, not the server's.
304
- - **`apiUrl`** — the **app endpoint URL** the registry serves this install from.
305
- Use it **as given** for this install's API calls: hit it unmodified, do not
306
- decompose it or append your own app id. If the registry tags traffic with an
307
- app id in the path, that is the registry's concern and opaque to you. Store it
308
- and pass it as the access service's **`apiUrl`** (for Peek it is the sole
309
- request URL; for CNG/ACME it is the base and the REST path is appended) — or
310
- hand the whole install to `createAccessServiceForInstall` (below), which wires
311
- it for you.
304
+ - **`apiUrl`** — the **base API URL** the registry serves this install from.
305
+ Store it and pass it straight through as the access service's **`apiUrl`**: do
306
+ not decompose it or append your own app id. Each service class appends its own
307
+ backoffice slug (e.g. `peek_backoffice_api-v1`) when it makes a call, so a Peek
308
+ GraphQL call POSTs to `<base>/peek_backoffice_api-v1` and a CNG/ACME REST call
309
+ hits `<base>/<slug>/<path>`. If the URL you pass already carries this platform's
310
+ slug (dashes or underscores) it is stripped back to the base; a URL carrying a
311
+ *different* platform's slug makes the constructor throw. If the registry tags
312
+ traffic with an app id in the path, that is the registry's concern and opaque to
313
+ you. Or hand the whole install to `createAccessServiceForInstall` (below), which
314
+ wires it for you.
312
315
 
313
316
  Both default to `""` when a delivery omits them, so treat empty as "not
314
317
  reported" and keep any value you previously stored.
package/llms.txt CHANGED
@@ -22,7 +22,7 @@ const peek = new PeekAccessService({
22
22
  installId, // JWT subject
23
23
  jwtSecret, // HMAC secret signing the JWT
24
24
  issuer, // app name (JWT issuer)
25
- apiUrl, // the install webhook's apiUrl — the app endpoint, used as given
25
+ apiUrl, // the install webhook's apiUrl — the base API URL; each service appends its own backoffice slug
26
26
  // optional: gatewayKey, tokenTtlSeconds, tokenRefreshLeewaySeconds,
27
27
  // retryDelaysMs, logger, fetch, itemOptionsPageSize,
28
28
  // accessOptions: { fullCustomerAccess: false } // default — see "Access options / PII"
@@ -30,10 +30,15 @@ const peek = new PeekAccessService({
30
30
  ```
31
31
 
32
32
  Targeting an install by URL: pass the install webhook's `apiUrl` as the config
33
- `apiUrl` — for Peek it is the **sole** request URL (every call POSTs to it,
34
- unmodified); for CNG/ACME it is the base and the REST path is appended. No
35
- app-id/gateway segment is inserted (`appId` is unused). Any app id in the path is
36
- the registry's own traffic tag, opaque to callers. `createAccessServiceForInstall(install, config)`
33
+ `apiUrl`. It is the install's **base API URL**; each service class appends its own
34
+ backoffice slug (e.g. `peek_backoffice_api-v1`, from a small per-platform endpoint
35
+ lookup) when it calls — so a Peek GraphQL call POSTs to `<base>/peek_backoffice_api-v1`
36
+ and a CNG/ACME REST call hits `<base>/<slug>/<path>`. If the URL you pass already
37
+ carries this platform's slug (dashes or underscores interchangeable) it is
38
+ **stripped** back to the base; a URL carrying a *different* platform's slug is
39
+ **rejected** (constructor throws). No app-id/gateway segment is inserted (`appId`
40
+ is unused). Any app id in the path is the registry's own traffic tag, opaque to
41
+ callers. `createAccessServiceForInstall(install, config)`
37
42
  builds the right service for `install.platform` (`peek`/`cng`/`acme`) wired to
38
43
  `install.apiUrl` in one call (throws on unknown/`null` platform). `appId` +
39
44
  `baseUrl` (and the hardcoded gateway default) are **`@deprecated`** — they
@@ -140,9 +145,11 @@ final authority and may still reject the request.
140
145
  Two brand-parallel accessors sit alongside `PeekAccessService` and share the same
141
146
  auth/transport/UI plumbing. Both are **REST** and deliberately minimal today
142
147
  (products only). Construct one per install, same config shape **minus `gatewayKey`**
143
- (`installId`, `jwtSecret`, `issuer`, `apiUrl`). With `apiUrl` set, it is the REST
144
- base and only the path is appended; the deprecated `baseUrl`/`appId` fall back to
145
- the app-registry installations API default. `createAccessServiceForInstall` routes
148
+ (`installId`, `jwtSecret`, `issuer`, `apiUrl`). With `apiUrl` set, it is the base
149
+ API URL and the product service appends its backoffice slug (`cng_backoffice_api-v1` /
150
+ `acme_backoffice_api-v1`) and the REST path (`<base>/<slug>/<path>`); the
151
+ deprecated `baseUrl`/`appId` fall back to the app-registry installations API
152
+ default (`<baseUrl>/<appId>` as the base). `createAccessServiceForInstall` routes
146
153
  `platform` `"cng"`/`"acme"` to these.
147
154
 
148
155
  - `CngAccessService` — `getProductService().getAllActivities()` (short-form
@@ -251,8 +258,9 @@ an external system** (App Store config), not from code.
251
258
 
252
259
  Browser-only, framework-agnostic Web Components (Custom Elements, light DOM,
253
260
  dependency-free) ported from the Peek Odyssey design system. The server library
254
- above stays DOM-free. **Full guide: `docs/ui.md` (shipped). Authoritative
255
- per-component contract: `dist/ui/index.d.ts` (TSDoc) — read via go-to-definition.**
261
+ above stays DOM-free. **Authoritative per-component contract: `dist/ui/index.d.ts`
262
+ (TSDoc, shipped) — read via go-to-definition. Interactive reference (in-repo, not
263
+ shipped): `docs/html/ui.html`.**
256
264
 
257
265
  Setup — importing the entry registers every `<ody-*>` element as a side effect:
258
266
 
@@ -281,7 +289,7 @@ Registration is idempotent (importing twice never throws). Lazy registration:
281
289
  render on it. `registeredTags()` returns the registered tag list. A failed
282
290
  dynamic import rejects at the `import()` call site.
283
291
 
284
- Tags by tier (see `docs/ui.md` for attributes/events/examples per component):
292
+ Tags by tier (see `dist/ui/index.d.ts` TSDoc for attributes/events/examples per component):
285
293
  - display: `ody-button`, `ody-tag`, `ody-alert`, `ody-card`, `ody-horizontal-divider`
286
294
  (1px rule with a default `margin-block: var(--gap16)`; `spacing="tight"|"none"`),
287
295
  `ody-status-dot`, `ody-message`, `ody-icon`, `ody-loading-spinner`, `ody-loading-bar`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peektravel/app-utilities",
3
- "version": "0.8.2",
3
+ "version": "0.9.1",
4
4
  "description": "GraphQL JS mapping utilities extracted from the Peek Pro Autopilot connector.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -39,7 +39,6 @@
39
39
  "files": [
40
40
  "dist",
41
41
  "llms.txt",
42
- "docs/ui.md",
43
42
  "docs/webhooks.md"
44
43
  ],
45
44
  "sideEffects": [