@indxsearch/indx-types 2.1.0 → 2.2.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/CHANGELOG.md CHANGED
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.2.0] - 2026-09-11
9
+
10
+ ### Added
11
+
12
+ - `IndxProblem` and `IndxProblemCode`: the RFC 9457 problem document every
13
+ error response carries, with its `code` extension typed as a union of the
14
+ documented codes (`unknownFilter`, `invalidState`, `shadowBusy`,
15
+ `datasetNotFound`, …) and the `invalidState` extras (`currentState`,
16
+ `allowedStates`, `retryable`, `errorMessage`). Switch on `code`, not on the
17
+ HTTP status. `unknownFilter` is new on the server: a filter token it cannot
18
+ honour is a 400 now, never a silently unfiltered search.
19
+
8
20
  ## [2.1.0] - 2026-09-08
9
21
 
10
22
  ### Added
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export { VectorQueryProxy, HybridQueryProxy, EmbeddingResultEntry } from './vect
9
9
  export { Result, ScoreEntry } from './result';
10
10
  export { SystemStatus, LicenseInfo } from './status';
11
11
  export { ParseResult, ProcessError, ProcessErrorCount } from './errors';
12
+ export { IndxProblem, IndxProblemCode } from './problem';
12
13
  export { FieldProxy } from './fields';
13
14
  export { DataSetListDto } from './datasets';
14
15
  export { StringInt32KeyValuePair, StringSingleValueTuple } from './common';
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Machine-readable error code carried by every IndxCloudApi error response, as the `code`
3
+ * extension of an RFC 9457 problem document. Switch on this, not on the HTTP status: a 400 can
4
+ * be any of five things, and the recovery differs.
5
+ *
6
+ * - `unknownFilter` (400): a filter token the server cannot honour (mistyped, truncated, or
7
+ * from another dataset). Recovery is mechanical — re-create the filter and retry with the new
8
+ * token; nothing about the request's shape needs fixing. Never silently widened to an
9
+ * unfiltered search.
10
+ * - `invalidState` (409): the dataset is not in a state that allows the operation. Carries
11
+ * `currentState`, `allowedStates` and `retryable`; when retryable (Loading / Indexing) the
12
+ * response also has a `Retry-After` header.
13
+ * - `shadowBusy` (409): a field-configuration or replace build is in progress; try again later.
14
+ */
15
+ export type IndxProblemCode = 'invalidArgument' | 'invalidDatasetName' | 'loadFailed' | 'operationFailed' | 'unknownFilter' | 'invalidCredentials' | 'emailNotConfirmed' | 'insufficientRole' | 'datasetNotFound' | 'documentNotFound' | 'teamNotFound' | 'invalidState' | 'shadowBusy';
16
+ /**
17
+ * An IndxCloudApi error response body (`application/problem+json`, RFC 9457) with the `code`
18
+ * extension every endpoint adds. 401 from the JWT middleware comes without a body.
19
+ */
20
+ export interface IndxProblem {
21
+ type?: string | null;
22
+ title?: string | null;
23
+ status?: number | null;
24
+ detail?: string | null;
25
+ instance?: string | null;
26
+ /** Machine-readable code; see {@link IndxProblemCode}. */
27
+ code: IndxProblemCode | (string & {});
28
+ /** `invalidState` only: the operation that was refused. */
29
+ operation?: string;
30
+ /** `invalidState` only: the dataset's state at the time. */
31
+ currentState?: string;
32
+ /** `invalidState` only: states in which the operation is allowed. */
33
+ allowedStates?: string[];
34
+ /** `invalidState` only: true while Loading / Indexing — the same request will succeed once
35
+ * the build completes (see the `Retry-After` header). */
36
+ retryable?: boolean;
37
+ /** `invalidState` in the Error state: the engine's error message. */
38
+ errorMessage?: string;
39
+ /** Registration / password endpoints: per-field validation messages. */
40
+ errors?: string[];
41
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indxsearch/indx-types",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "TypeScript type definitions for IndxCloudApi v2. Provides complete types for search queries, filters, boosts, results, and system status based on the official Swagger specification.",
5
5
  "keywords": [
6
6
  "indx",