@indxsearch/indx-types 2.1.0 → 2.3.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/README.md +12 -12
- package/dist/index.d.ts +2 -1
- package/dist/problem.d.ts +41 -0
- package/dist/problem.js +1 -0
- package/dist/query.d.ts +3 -1
- package/package.json +2 -2
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.3.0] - 2026-09-12
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- `CloudQuery` is renamed `QueryProxy`, matching the server (`Indx.Http.QueryProxy`)
|
|
13
|
+
and its siblings `VectorQueryProxy` / `HybridQueryProxy`. `CloudQuery` stays as a
|
|
14
|
+
deprecated alias until 3.0. The JSON on the wire is unchanged.
|
|
15
|
+
|
|
16
|
+
## [2.2.0] - 2026-09-11
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- `IndxProblem` and `IndxProblemCode`: the RFC 9457 problem document every
|
|
21
|
+
error response carries, with its `code` extension typed as a union of the
|
|
22
|
+
documented codes (`unknownFilter`, `invalidState`, `shadowBusy`,
|
|
23
|
+
`datasetNotFound`, …) and the `invalidState` extras (`currentState`,
|
|
24
|
+
`allowedStates`, `retryable`, `errorMessage`). Switch on `code`, not on the
|
|
25
|
+
HTTP status. `unknownFilter` is new on the server: a filter token it cannot
|
|
26
|
+
honour is a 400 now, never a silently unfiltered search.
|
|
27
|
+
|
|
8
28
|
## [2.1.0] - 2026-09-08
|
|
9
29
|
|
|
10
30
|
### Added
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @indxsearch/indx-types
|
|
2
2
|
|
|
3
|
-
TypeScript type definitions for **
|
|
3
|
+
TypeScript type definitions for **Indx v2.0**. This package provides complete, strongly-typed interfaces for search queries, filters, boosts, results, and system status.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ npm install @indxsearch/indx-types
|
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
|
|
13
|
-
- Complete TypeScript type definitions for
|
|
13
|
+
- Complete TypeScript type definitions for Indx v2.0
|
|
14
14
|
- Zero runtime dependencies (types-only package)
|
|
15
15
|
- Matches official Swagger API specification exactly
|
|
16
16
|
- Full IntelliSense support in VS Code and other IDEs
|
|
@@ -18,16 +18,16 @@ npm install @indxsearch/indx-types
|
|
|
18
18
|
|
|
19
19
|
## Version Compatibility
|
|
20
20
|
|
|
21
|
-
This package (`@indxsearch/indx-types` 2.x) provides types for **
|
|
21
|
+
This package (`@indxsearch/indx-types` 2.x) provides types for **Indx v2.0** (IndxSearchLib v5). The shapes are generated from and verified against the live v5 OpenAPI spec.
|
|
22
22
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
25
25
|
### Basic Query
|
|
26
26
|
|
|
27
27
|
```typescript
|
|
28
|
-
import type {
|
|
28
|
+
import type { QueryProxy, Result } from '@indxsearch/indx-types';
|
|
29
29
|
|
|
30
|
-
const query:
|
|
30
|
+
const query: QueryProxy = {
|
|
31
31
|
text: 'search term',
|
|
32
32
|
maxNumberOfRecordsToReturn: 10,
|
|
33
33
|
};
|
|
@@ -78,7 +78,7 @@ const boost: BoostProxy = {
|
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
-
const query:
|
|
81
|
+
const query: QueryProxy = {
|
|
82
82
|
text: 'search term',
|
|
83
83
|
enableBoost: true,
|
|
84
84
|
boosts: [boost]
|
|
@@ -88,7 +88,7 @@ const query: CloudQuery = {
|
|
|
88
88
|
### Coverage Setup
|
|
89
89
|
|
|
90
90
|
```typescript
|
|
91
|
-
import type { CoverageSetup,
|
|
91
|
+
import type { CoverageSetup, QueryProxy } from '@indxsearch/indx-types';
|
|
92
92
|
|
|
93
93
|
const coverageSetup: CoverageSetup = {
|
|
94
94
|
coverWholeQuery: true,
|
|
@@ -100,7 +100,7 @@ const coverageSetup: CoverageSetup = {
|
|
|
100
100
|
truncationScore: 255
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
const query:
|
|
103
|
+
const query: QueryProxy = {
|
|
104
104
|
text: 'search term',
|
|
105
105
|
enableCoverage: true,
|
|
106
106
|
coverageSetup
|
|
@@ -125,7 +125,7 @@ if (status.systemState === SystemState.Ready) {
|
|
|
125
125
|
### Types
|
|
126
126
|
|
|
127
127
|
#### Query Types
|
|
128
|
-
- `
|
|
128
|
+
- `QueryProxy` - Main search query interface
|
|
129
129
|
- `CoverageSetup` - Coverage configuration options
|
|
130
130
|
|
|
131
131
|
#### Filter Types
|
|
@@ -145,7 +145,7 @@ if (status.systemState === SystemState.Ready) {
|
|
|
145
145
|
|
|
146
146
|
#### Boost Types
|
|
147
147
|
- `BoostProxy` - Search result boost configuration
|
|
148
|
-
- `
|
|
148
|
+
- `QueryProxy.fieldBoosts` - Per-field boost map (`Record<string, number>`) on `QueryProxy`
|
|
149
149
|
|
|
150
150
|
#### Vector / Hybrid Types
|
|
151
151
|
- `VectorQueryProxy` - Embedding vector search query (field, vector, max results, filter)
|
|
@@ -158,7 +158,7 @@ if (status.systemState === SystemState.Ready) {
|
|
|
158
158
|
|
|
159
159
|
#### Authentication
|
|
160
160
|
|
|
161
|
-
Auth is **bearer-token only** — create a token on the
|
|
161
|
+
Auth is **bearer-token only** — create a token on the Indx Dashboard and pass it as `preAuthenticatedToken`. The email/password login flow is deprecated and being removed.
|
|
162
162
|
|
|
163
163
|
- `ChangePasswordRequest` - Password change payload (`currentPassword`, `newPassword`)
|
|
164
164
|
- `LoginInfo` / `LoginResponse` - _Deprecated_ — legacy email/password login types, being removed in favour of token-only auth.
|
|
@@ -233,7 +233,7 @@ For monorepo development with path mapping:
|
|
|
233
233
|
## Documentation
|
|
234
234
|
|
|
235
235
|
- [Swagger API Specification](https://cloud.indx.co/swagger/v1/swagger.json)
|
|
236
|
-
- [
|
|
236
|
+
- [Indx Documentation](https://cloud.indx.co/swagger)
|
|
237
237
|
|
|
238
238
|
## License
|
|
239
239
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { SystemState, BoostStrength, SynonymDirection } from './enums';
|
|
2
2
|
export { JsonErrorType } from './errors';
|
|
3
3
|
export { LoginInfo, LoginResponse, ChangePasswordRequest } from './auth';
|
|
4
|
-
export { CloudQuery, CoverageSetup } from './query';
|
|
4
|
+
export { QueryProxy, CloudQuery, CoverageSetup } from './query';
|
|
5
5
|
export { FilterProxy, RangeFilterProxy, ValueFilterProxy, CombinedFilterProxy, UpdateFieldProxy, FilterFieldUpdateProxy } from './filters';
|
|
6
6
|
export { BoostProxy } from './boost';
|
|
7
7
|
export { SynonymList, SynonymEntry } from './synonyms';
|
|
@@ -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 Indx 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 Indx 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 {};
|
package/dist/query.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface CoverageSetup {
|
|
|
14
14
|
truncateWordHitTolerance?: number;
|
|
15
15
|
truncationScore?: number;
|
|
16
16
|
}
|
|
17
|
-
export interface
|
|
17
|
+
export interface QueryProxy {
|
|
18
18
|
text?: string | null;
|
|
19
19
|
maxNumberOfRecordsToReturn?: number;
|
|
20
20
|
enableCoverage?: boolean;
|
|
@@ -31,3 +31,5 @@ export interface CloudQuery {
|
|
|
31
31
|
fieldBoosts?: Record<string, number> | null;
|
|
32
32
|
logPrefix?: string | null;
|
|
33
33
|
}
|
|
34
|
+
/** @deprecated Renamed to {@link QueryProxy} in 2.3.0 (the server dropped its "cloud" vocabulary); removed in 3.0. */
|
|
35
|
+
export type CloudQuery = QueryProxy;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indxsearch/indx-types",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "TypeScript type definitions for
|
|
3
|
+
"version": "2.3.0",
|
|
4
|
+
"description": "TypeScript type definitions for Indx 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",
|
|
7
7
|
"typescript",
|