@indxsearch/indx-types 2.2.0 → 2.4.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 +18 -0
- package/README.md +12 -12
- package/dist/index.d.ts +1 -1
- package/dist/problem.d.ts +11 -3
- package/dist/query.d.ts +3 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,24 @@ 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.4.0] - 2026-09-14
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `rateLimited` in `IndxProblemCode`, with `retryAfterSeconds` on `IndxProblem`: the
|
|
13
|
+
server's anonymous auth endpoints (login, register, password reset) answer 429 with it
|
|
14
|
+
after too many attempts from one address; so do API calls over a key's per-second budget
|
|
15
|
+
(where the operator enabled it), heavy operations beyond the server's concurrency cap, and
|
|
16
|
+
searches beyond its queue.
|
|
17
|
+
|
|
18
|
+
## [2.3.0] - 2026-09-12
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- `CloudQuery` is renamed `QueryProxy`, matching the server (`Indx.Http.QueryProxy`)
|
|
23
|
+
and its siblings `VectorQueryProxy` / `HybridQueryProxy`. `CloudQuery` stays as a
|
|
24
|
+
deprecated alias until 3.0. The JSON on the wire is unchanged.
|
|
25
|
+
|
|
8
26
|
## [2.2.0] - 2026-09-11
|
|
9
27
|
|
|
10
28
|
### 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';
|
package/dist/problem.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Machine-readable error code carried by every
|
|
2
|
+
* Machine-readable error code carried by every Indx error response, as the `code`
|
|
3
3
|
* extension of an RFC 9457 problem document. Switch on this, not on the HTTP status: a 400 can
|
|
4
4
|
* be any of five things, and the recovery differs.
|
|
5
5
|
*
|
|
@@ -11,10 +11,16 @@
|
|
|
11
11
|
* `currentState`, `allowedStates` and `retryable`; when retryable (Loading / Indexing) the
|
|
12
12
|
* response also has a `Retry-After` header.
|
|
13
13
|
* - `shadowBusy` (409): a field-configuration or replace build is in progress; try again later.
|
|
14
|
+
* - `rateLimited` (429): too many attempts from this address on an anonymous auth endpoint
|
|
15
|
+
* (login, register, password reset); this API key exceeded its per-second budget where the
|
|
16
|
+
* operator enabled per-key limits; or the server is at capacity — its cap on concurrent
|
|
17
|
+
* heavy operations (load, replace, index, wake-up, batch document changes) is reached, or
|
|
18
|
+
* its search queue is full. Carries `retryAfterSeconds` and a `Retry-After` header; wait that
|
|
19
|
+
* long and retry.
|
|
14
20
|
*/
|
|
15
|
-
export type IndxProblemCode = 'invalidArgument' | 'invalidDatasetName' | 'loadFailed' | 'operationFailed' | 'unknownFilter' | 'invalidCredentials' | 'emailNotConfirmed' | 'insufficientRole' | 'datasetNotFound' | 'documentNotFound' | 'teamNotFound' | 'invalidState' | 'shadowBusy';
|
|
21
|
+
export type IndxProblemCode = 'invalidArgument' | 'invalidDatasetName' | 'loadFailed' | 'operationFailed' | 'unknownFilter' | 'invalidCredentials' | 'emailNotConfirmed' | 'insufficientRole' | 'datasetNotFound' | 'documentNotFound' | 'teamNotFound' | 'invalidState' | 'shadowBusy' | 'rateLimited';
|
|
16
22
|
/**
|
|
17
|
-
* An
|
|
23
|
+
* An Indx error response body (`application/problem+json`, RFC 9457) with the `code`
|
|
18
24
|
* extension every endpoint adds. 401 from the JWT middleware comes without a body.
|
|
19
25
|
*/
|
|
20
26
|
export interface IndxProblem {
|
|
@@ -36,6 +42,8 @@ export interface IndxProblem {
|
|
|
36
42
|
retryable?: boolean;
|
|
37
43
|
/** `invalidState` in the Error state: the engine's error message. */
|
|
38
44
|
errorMessage?: string;
|
|
45
|
+
/** `rateLimited` only: seconds until the window opens again (also the `Retry-After` header). */
|
|
46
|
+
retryAfterSeconds?: number;
|
|
39
47
|
/** Registration / password endpoints: per-field validation messages. */
|
|
40
48
|
errors?: string[];
|
|
41
49
|
}
|
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.4.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",
|