@indxsearch/indx-types 2.0.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 +20 -0
- package/dist/enums.d.ts +9 -0
- package/dist/enums.js +10 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -1
- package/dist/problem.d.ts +41 -0
- package/dist/problem.js +1 -0
- package/dist/synonyms.d.ts +24 -0
- package/dist/synonyms.js +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,26 @@ 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
|
+
|
|
20
|
+
## [2.1.0] - 2026-09-08
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- `SynonymList`, `SynonymEntry`, and the `SynonymDirection` enum, typing the
|
|
25
|
+
`GET`/`PUT …/synonyms` endpoints. `direction` is numeric on the wire
|
|
26
|
+
(0 = Multidirectional, 1 = OneWay), like every enum in this API.
|
|
27
|
+
|
|
8
28
|
## [2.0.0] - 2026-08-25
|
|
9
29
|
|
|
10
30
|
First stable release of the v2 line, targeting IndxCloudApi v2 (IndxSearchLib v5).
|
package/dist/enums.d.ts
CHANGED
|
@@ -12,3 +12,12 @@ export declare enum BoostStrength {
|
|
|
12
12
|
Medium = 2,
|
|
13
13
|
High = 3
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* How a SynonymEntry expands. Multidirectional: every term in the entry triggers the whole
|
|
17
|
+
* group. OneWay: only `source` expands, into `terms` (acronyms).
|
|
18
|
+
* Numeric on the wire, like every enum in this API.
|
|
19
|
+
*/
|
|
20
|
+
export declare enum SynonymDirection {
|
|
21
|
+
Multidirectional = 0,
|
|
22
|
+
OneWay = 1
|
|
23
|
+
}
|
package/dist/enums.js
CHANGED
|
@@ -14,3 +14,13 @@ export var BoostStrength;
|
|
|
14
14
|
BoostStrength[BoostStrength["Medium"] = 2] = "Medium";
|
|
15
15
|
BoostStrength[BoostStrength["High"] = 3] = "High";
|
|
16
16
|
})(BoostStrength || (BoostStrength = {}));
|
|
17
|
+
/**
|
|
18
|
+
* How a SynonymEntry expands. Multidirectional: every term in the entry triggers the whole
|
|
19
|
+
* group. OneWay: only `source` expands, into `terms` (acronyms).
|
|
20
|
+
* Numeric on the wire, like every enum in this API.
|
|
21
|
+
*/
|
|
22
|
+
export var SynonymDirection;
|
|
23
|
+
(function (SynonymDirection) {
|
|
24
|
+
SynonymDirection[SynonymDirection["Multidirectional"] = 0] = "Multidirectional";
|
|
25
|
+
SynonymDirection[SynonymDirection["OneWay"] = 1] = "OneWay";
|
|
26
|
+
})(SynonymDirection || (SynonymDirection = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
export { SystemState, BoostStrength } from './enums';
|
|
1
|
+
export { SystemState, BoostStrength, SynonymDirection } from './enums';
|
|
2
2
|
export { JsonErrorType } from './errors';
|
|
3
3
|
export { LoginInfo, LoginResponse, ChangePasswordRequest } from './auth';
|
|
4
4
|
export { CloudQuery, CoverageSetup } from './query';
|
|
5
5
|
export { FilterProxy, RangeFilterProxy, ValueFilterProxy, CombinedFilterProxy, UpdateFieldProxy, FilterFieldUpdateProxy } from './filters';
|
|
6
6
|
export { BoostProxy } from './boost';
|
|
7
|
+
export { SynonymList, SynonymEntry } from './synonyms';
|
|
7
8
|
export { VectorQueryProxy, HybridQueryProxy, EmbeddingResultEntry } from './vector';
|
|
8
9
|
export { Result, ScoreEntry } from './result';
|
|
9
10
|
export { SystemStatus, LicenseInfo } from './status';
|
|
10
11
|
export { ParseResult, ProcessError, ProcessErrorCount } from './errors';
|
|
12
|
+
export { IndxProblem, IndxProblemCode } from './problem';
|
|
11
13
|
export { FieldProxy } from './fields';
|
|
12
14
|
export { DataSetListDto } from './datasets';
|
|
13
15
|
export { StringInt32KeyValuePair, StringSingleValueTuple } from './common';
|
package/dist/index.js
CHANGED
|
@@ -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
|
+
}
|
package/dist/problem.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SynonymDirection } from './enums';
|
|
2
|
+
/**
|
|
3
|
+
* One synonym rule: a set of terms plus the direction they expand in. Multi-word terms are
|
|
4
|
+
* matched as whole phrases.
|
|
5
|
+
*/
|
|
6
|
+
export interface SynonymEntry {
|
|
7
|
+
direction: SynonymDirection;
|
|
8
|
+
/** The trigger term for OneWay entries; null/omitted for Multidirectional ones. */
|
|
9
|
+
source?: string | null;
|
|
10
|
+
/** Terms appended to the query when the entry matches. */
|
|
11
|
+
terms: string[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A dataset's synonym list. GET/PUT api/teams/{team}/datasets/{dataset}/synonyms —
|
|
15
|
+
* GET returns the list or a literal null; PUT replaces it (a null body removes it, editor
|
|
16
|
+
* role required). Expansion happens at search time, so a PUT applies on the next search
|
|
17
|
+
* with no re-indexing.
|
|
18
|
+
*/
|
|
19
|
+
export interface SynonymList {
|
|
20
|
+
name?: string;
|
|
21
|
+
description?: string | null;
|
|
22
|
+
updatedUtc?: string;
|
|
23
|
+
entries: SynonymEntry[];
|
|
24
|
+
}
|
package/dist/synonyms.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indxsearch/indx-types",
|
|
3
|
-
"version": "2.
|
|
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",
|