@xemahq/llm-registry-api-client 0.14.0 → 0.15.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.
@@ -463,6 +463,37 @@ function isJsonMediaType(contentType) {
463
463
  const essence = contentType.split(';')[0]?.trim().toLowerCase() ?? '';
464
464
  return essence === 'application/json' || essence.endsWith('+json');
465
465
  }
466
+ /**
467
+ * Does this media type carry TEXT a caller reads as a string?
468
+ *
469
+ * The response body is decoded by its declared media type, in three classes,
470
+ * and each class matches what the generated function's return type says for
471
+ * the schema such a route declares:
472
+ *
473
+ * - JSON (`application/json` or an RFC 6839 `+json` suffix) → parsed;
474
+ * - TEXT (`text/*` — including `text/event-stream` — `application/javascript`,
475
+ * `application/ecmascript`, `application/xml` or an RFC 7303 `+xml`
476
+ * suffix) → a string, which is what a `{ type: string }` schema generates;
477
+ * - anything else — `application/octet-stream`, `application/gzip`,
478
+ * `application/pdf`, an Office document type, any `format: binary` body —
479
+ * → a `Blob`, which is what a `format: binary` schema generates.
480
+ *
481
+ * Reading every non-JSON body as text, as this transport did until 2026-10-04,
482
+ * handed a caller typed `Blob` a string: `response.text()` decodes the bytes
483
+ * as UTF-8, so a PDF or a gzip tarball arrived corrupted under a type that
484
+ * promised the bytes.
485
+ *
486
+ * A response with NO content type is read as text, so an empty body stays the
487
+ * empty string it always was.
488
+ */
489
+ function isTextMediaType(contentType) {
490
+ const essence = contentType.split(';')[0]?.trim().toLowerCase() ?? '';
491
+ return (essence.startsWith('text/') ||
492
+ essence === 'application/javascript' ||
493
+ essence === 'application/ecmascript' ||
494
+ essence === 'application/xml' ||
495
+ essence.endsWith('+xml'));
496
+ }
466
497
  async function parseBody(response) {
467
498
  // 204 FIRST, and deliberately — this ORDER is carried from `develop`, which
468
499
  // fixed the same defect independently and got this half right where `main`
@@ -478,7 +509,10 @@ async function parseBody(response) {
478
509
  if (isJsonMediaType(contentType)) {
479
510
  return response.json();
480
511
  }
481
- return response.text();
512
+ if (contentType === null || isTextMediaType(contentType)) {
513
+ return response.text();
514
+ }
515
+ return response.blob();
482
516
  }
483
517
  function parseRetryAfter(value) {
484
518
  if (!value)
@@ -190,6 +190,8 @@ export * from './modelCapability';
190
190
  export * from './modelFactConflictDto';
191
191
  export * from './modelFactName';
192
192
  export * from './modelFactSource';
193
+ export * from './modelLaneBindingSource';
194
+ export * from './modelLaneEffectiveBindingDto';
193
195
  export * from './modelModality';
194
196
  export * from './modelMode';
195
197
  export * from './modelPricingTierDto';
@@ -213,6 +215,7 @@ export * from './modelStatusDto';
213
215
  export * from './modelStatusDtoDataEnvelope';
214
216
  export * from './modelStrategyControllerGetProjectBinding200';
215
217
  export * from './modelStrategyEntryResponseDto';
218
+ export * from './modelStrategyLaneEffectiveResponseDto';
216
219
  export * from './modelStrategyResponseDto';
217
220
  export * from './modelStrategyResponseDtoDataArrayEnvelope';
218
221
  export * from './modelStrategyResponseDtoDataEnvelope';
@@ -207,6 +207,8 @@ __exportStar(require("./modelCapability"), exports);
207
207
  __exportStar(require("./modelFactConflictDto"), exports);
208
208
  __exportStar(require("./modelFactName"), exports);
209
209
  __exportStar(require("./modelFactSource"), exports);
210
+ __exportStar(require("./modelLaneBindingSource"), exports);
211
+ __exportStar(require("./modelLaneEffectiveBindingDto"), exports);
210
212
  __exportStar(require("./modelModality"), exports);
211
213
  __exportStar(require("./modelMode"), exports);
212
214
  __exportStar(require("./modelPricingTierDto"), exports);
@@ -230,6 +232,7 @@ __exportStar(require("./modelStatusDto"), exports);
230
232
  __exportStar(require("./modelStatusDtoDataEnvelope"), exports);
231
233
  __exportStar(require("./modelStrategyControllerGetProjectBinding200"), exports);
232
234
  __exportStar(require("./modelStrategyEntryResponseDto"), exports);
235
+ __exportStar(require("./modelStrategyLaneEffectiveResponseDto"), exports);
233
236
  __exportStar(require("./modelStrategyResponseDto"), exports);
234
237
  __exportStar(require("./modelStrategyResponseDtoDataArrayEnvelope"), exports);
235
238
  __exportStar(require("./modelStrategyResponseDtoDataEnvelope"), exports);
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Generated by @xemahq/api-client-generator — do not edit manually.
3
+ * LLM Registry API
4
+ * OpenAPI spec version: 0.1.3
5
+ */
6
+ /**
7
+ * `lane` — the strategy binds this lane directly. `default` — no entry for this lane; the strategy's default binding applies. `unconfigured` — no entry and no default; the lane resolves nothing.
8
+ */
9
+ export type ModelLaneBindingSource = typeof ModelLaneBindingSource[keyof typeof ModelLaneBindingSource];
10
+ export declare const ModelLaneBindingSource: {
11
+ readonly lane: "lane";
12
+ readonly default: "default";
13
+ readonly unconfigured: "unconfigured";
14
+ };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by @xemahq/api-client-generator — do not edit manually.
4
+ * LLM Registry API
5
+ * OpenAPI spec version: 0.1.3
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ModelLaneBindingSource = void 0;
9
+ exports.ModelLaneBindingSource = {
10
+ lane: 'lane',
11
+ default: 'default',
12
+ unconfigured: 'unconfigured',
13
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Generated by @xemahq/api-client-generator — do not edit manually.
3
+ * LLM Registry API
4
+ * OpenAPI spec version: 0.1.3
5
+ */
6
+ import type { ModelLaneBindingSource } from './modelLaneBindingSource.js';
7
+ export interface ModelLaneEffectiveBindingDto {
8
+ /**
9
+ * `null` only when `source` is `unconfigured` — the lane has neither its own entry nor a strategy default to fall back to.
10
+ * @nullable
11
+ */
12
+ modelSlug: string | null;
13
+ /** `lane` — the strategy binds this lane directly. `default` — no entry for this lane; the strategy's default binding applies. `unconfigured` — no entry and no default; the lane resolves nothing. */
14
+ source: ModelLaneBindingSource;
15
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Generated by @xemahq/api-client-generator — do not edit manually.
3
+ * LLM Registry API
4
+ * OpenAPI spec version: 0.1.3
5
+ */
6
+ import type { ModelLaneEffectiveBindingDto } from './modelLaneEffectiveBindingDto.js';
7
+ export interface ModelStrategyLaneEffectiveResponseDto {
8
+ /** The model lane this entry describes — see `ModelStrategyEntryResponseDto.modelLane`. */
9
+ lane: string;
10
+ effective: ModelLaneEffectiveBindingDto;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import type { ModelBindingResponseDto } from './modelBindingResponseDto.js';
7
7
  import type { ModelStrategyEntryResponseDto } from './modelStrategyEntryResponseDto.js';
8
+ import type { ModelStrategyLaneEffectiveResponseDto } from './modelStrategyLaneEffectiveResponseDto.js';
8
9
  export interface ModelStrategyResponseDto {
9
10
  id: string;
10
11
  orgId: string;
@@ -46,6 +47,8 @@ export interface ModelStrategyResponseDto {
46
47
  /** Show recommended badge in wizard */
47
48
  recommended?: boolean;
48
49
  entries?: ModelStrategyEntryResponseDto[];
50
+ /** Every declared model lane, paired with what it currently resolves to — computed by the same rule the resolver uses, before any credential check. See `ModelStrategyLaneEffectiveResponseDto`. */
51
+ effectiveLanes: ModelStrategyLaneEffectiveResponseDto[];
49
52
  /** The model an invocation routes to when the requested model lane has no entry of its own — the ONE systemic fallback in the routing plane. `null` means this organisation has not selected a default model, and in that state every unbound lane REFUSES with a typed unavailability rather than resolving something the platform picked. No lane is mandatory; THIS is the mandatory thing. */
50
53
  defaultBinding: ModelBindingResponseDto | null;
51
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xemahq/llm-registry-api-client",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [
@@ -19,7 +19,7 @@
19
19
  "service": "llm-registry-api",
20
20
  "biome": "agent-runtime",
21
21
  "target": "server",
22
- "generator": "@xemahq/api-client-generator@2.1.1",
22
+ "generator": "@xemahq/api-client-generator@2.2.0",
23
23
  "source": "openapi.public.json"
24
24
  },
25
25
  "license": "LicenseRef-Xema-BSL-1.1",