@relevanceai/sdk 1.10.0 → 1.13.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.
Files changed (33) hide show
  1. package/dist-cjs/generated/DiscoveryApi.js +595 -3
  2. package/dist-cjs/generated/_DiscoveryApiSchemaTypes.js +1 -4
  3. package/dist-cjs/generated/index.js +5 -2
  4. package/dist-cjs/index.js +6 -2
  5. package/dist-cjs/services/discovery/Dataset.js +125 -115
  6. package/dist-cjs/services/discovery/index.js +158 -179
  7. package/dist-cjs/services/index.js +2 -12
  8. package/dist-cjs/shared/generate.js +1 -1
  9. package/dist-cjs/shared/serviceConfigs.js +2 -7
  10. package/dist-es/generated/DiscoveryApi.js +898 -10
  11. package/dist-es/generated/_DiscoveryApiSchemaTypes.js +1 -4
  12. package/dist-es/generated/index.js +0 -1
  13. package/dist-es/index.js +1 -1
  14. package/dist-es/services/discovery/Dataset.js +126 -309
  15. package/dist-es/services/discovery/index.js +159 -233
  16. package/dist-es/services/index.js +3 -1
  17. package/dist-es/shared/BaseClient.js +9 -9
  18. package/dist-es/shared/generate.js +21 -20
  19. package/dist-es/shared/serviceConfigs.js +2 -7
  20. package/dist-types/generated/DiscoveryApi.d.ts +226 -4
  21. package/dist-types/generated/_DiscoveryApiSchemaTypes.d.ts +8663 -1056
  22. package/dist-types/generated/index.d.ts +0 -1
  23. package/dist-types/index.d.ts +0 -1
  24. package/dist-types/services/discovery/Dataset.d.ts +0 -50
  25. package/dist-types/services/discovery/index.d.ts +0 -366
  26. package/dist-types/services/index.d.ts +0 -1
  27. package/package.json +2 -2
  28. package/dist-cjs/generated/VectorApi.js +0 -754
  29. package/dist-cjs/generated/_VectorApiSchemaTypes.js +0 -6
  30. package/dist-es/generated/VectorApi.js +0 -1187
  31. package/dist-es/generated/_VectorApiSchemaTypes.js +0 -5
  32. package/dist-types/generated/VectorApi.d.ts +0 -284
  33. package/dist-types/generated/_VectorApiSchemaTypes.d.ts +0 -5724
@@ -1,2 +1 @@
1
1
  export * from "./DiscoveryApi";
2
- export * from "./VectorApi";
@@ -1,2 +1 @@
1
1
  export * from './generated';
2
- export * from './services';
@@ -1,50 +0,0 @@
1
- /// <reference types="node" />
2
- import { DiscoveryClient, _QueryBuilder } from ".";
3
- import { DeleteDocumentOutput, DeleteWhereOutput, GetDocumentOutput, SimpleSearchPostOutput, BulkInsertOutput, UpdateWhereOutput, BulkUpdateOutput } from "../..";
4
- import { _GenericMethodOptions } from "../../shared/BaseClient";
5
- interface searchOptions {
6
- debounce?: number;
7
- rawPayload?: any;
8
- }
9
- export declare class Dataset {
10
- client: DiscoveryClient;
11
- name: string;
12
- config: any;
13
- debounceTimer?: NodeJS.Timeout;
14
- constructor(client: DiscoveryClient, name: string, options: any);
15
- get datasetName(): string;
16
- insertDocument(document: any, options?: _GenericMethodOptions): Promise<unknown>;
17
- search(): Promise<SimpleSearchPostOutput>;
18
- search(query?: _QueryBuilder): Promise<SimpleSearchPostOutput>;
19
- search(options?: searchOptions): Promise<SimpleSearchPostOutput>;
20
- search(query?: _QueryBuilder, options?: searchOptions): Promise<SimpleSearchPostOutput>;
21
- insertDocuments(documents: any, options?: _GenericMethodOptions & {
22
- batchSize?: number;
23
- retryCount?: number;
24
- progressCallback?: (progress: BulkInsertOutput[]) => any;
25
- }): Promise<BulkInsertOutput>;
26
- _GenericBulkOperation<InputItem, OutputItem>({ data, batchSize, fn, retryCount }: {
27
- data: InputItem[];
28
- fn: (data: InputItem[]) => Promise<OutputItem>;
29
- batchSize?: number;
30
- retryCount?: number;
31
- progressCallback?: (progress: OutputItem[]) => any;
32
- }): Promise<OutputItem[]>;
33
- updateDocument(documentId: string, partialUpdates: any): Promise<{
34
- status: string;
35
- message: string;
36
- }>;
37
- updateDocuments(updates: any, options?: _GenericMethodOptions & {
38
- batchSize?: number;
39
- retryCount?: number;
40
- progressCallback?: (progress: BulkUpdateOutput[]) => any;
41
- }): Promise<BulkUpdateOutput>;
42
- updateDocumentsWhere(filters: _QueryBuilder, partialUpdates: {
43
- [id: string]: any;
44
- }): Promise<UpdateWhereOutput>;
45
- getDocument(documentId: string): Promise<GetDocumentOutput>;
46
- deleteDocument(documentId: string): Promise<DeleteDocumentOutput>;
47
- deleteDocuments(documentIds: [string]): Promise<DeleteWhereOutput>;
48
- deleteDocumentsWhere(filters: _QueryBuilder): Promise<DeleteWhereOutput>;
49
- }
50
- export {};
@@ -1,366 +0,0 @@
1
- import { DiscoveryApiClient } from '../../';
2
- import { _ClientInput } from '../../shared/BaseClient';
3
- import { operations, components } from '../../generated/_DiscoveryApiSchemaTypes';
4
- import { Dataset } from './Dataset';
5
- declare type bodyType = operations['SimpleSearchPost']['requestBody']['content']['application/json'];
6
- export declare function QueryBuilder(): _QueryBuilder;
7
- export declare function FilterBuilder(): _FilterBuilder;
8
- export declare class _FilterBuilder {
9
- body: bodyType;
10
- constructor();
11
- buildFilters(): {
12
- match?: {
13
- key: string;
14
- value: string | number | boolean | unknown[];
15
- } | undefined;
16
- range?: {
17
- key: string;
18
- greaterThan?: unknown;
19
- lessThan?: unknown;
20
- } | undefined;
21
- wildcard?: {
22
- key: string;
23
- value: string | string[];
24
- } | undefined;
25
- fieldExists?: {
26
- key: string;
27
- } | undefined;
28
- selfreference?: {
29
- a: string;
30
- b: string;
31
- operation: "<=" | ">=" | "<" | ">" | "==" | "!=";
32
- } | undefined;
33
- or?: (any | any[])[] | undefined;
34
- not?: any | any[] | undefined;
35
- chunk?: {
36
- path: string;
37
- filters: any[];
38
- } | undefined;
39
- }[] | undefined;
40
- rawFilter(filter: components['schemas']['filterListItem']): this;
41
- filter(type: string, key: string, value: string, ...options: any): this;
42
- match(field: string, value: any): this;
43
- wildcard(field: string, value: any): this;
44
- selfreference(fielda: string, fieldb: string, operation: "<=" | ">=" | "<" | ">" | "==" | "!="): this;
45
- range(field: string, options: Omit<components['schemas']['filterListItem']['range'], 'key'>): this;
46
- or(filters: _FilterBuilder[]): this;
47
- not(filter: _FilterBuilder): this;
48
- }
49
- export declare class _QueryBuilder extends _FilterBuilder {
50
- defaultQueryValue?: string;
51
- shouldPerformTextQuery: boolean;
52
- constructor();
53
- build(): {
54
- query?: string | undefined;
55
- queryConfig?: {
56
- weight?: number | undefined;
57
- } | undefined;
58
- vectorSearchQuery?: {
59
- field: string;
60
- query?: string | undefined;
61
- model?: string | undefined;
62
- model_url?: string | undefined;
63
- weight?: number | undefined;
64
- chunkConfig?: {
65
- chunkField: string;
66
- page?: number | undefined;
67
- pageSize?: number | undefined;
68
- } | undefined;
69
- } | {
70
- field: string;
71
- query?: string | undefined;
72
- model?: string | undefined;
73
- model_url?: string | undefined;
74
- weight?: number | undefined;
75
- chunkConfig?: {
76
- chunkField: string;
77
- page?: number | undefined;
78
- pageSize?: number | undefined;
79
- } | undefined;
80
- }[] | undefined;
81
- fieldsToSearch?: (string | {
82
- key: string;
83
- weight?: number | undefined;
84
- })[] | undefined;
85
- page?: number | undefined;
86
- pageSize?: number | undefined;
87
- minimumRelevance?: number | undefined;
88
- cleanPayloadUsingSchema?: boolean | undefined;
89
- sort?: {
90
- [key: string]: "asc" | "desc";
91
- } | undefined;
92
- includeFields?: string[] | undefined;
93
- excludeFields?: string[] | undefined;
94
- includeVectors?: boolean | undefined;
95
- textSort?: {
96
- [key: string]: "asc" | "desc";
97
- } | undefined;
98
- fieldsToAggregate?: (string | {
99
- key: string;
100
- outputKey?: string | undefined;
101
- resultsSize?: number | undefined;
102
- fieldsToAggregate?: (string | any)[] | undefined;
103
- chunkAggregate?: {
104
- chunkFieldName: string;
105
- filters?: {
106
- match?: {
107
- key: string;
108
- value: string | number | boolean | unknown[];
109
- } | undefined;
110
- range?: {
111
- key: string;
112
- greaterThan?: unknown;
113
- lessThan?: unknown;
114
- } | undefined;
115
- wildcard?: {
116
- key: string;
117
- value: string | string[];
118
- } | undefined;
119
- fieldExists?: {
120
- key: string;
121
- } | undefined;
122
- selfreference?: {
123
- a: string;
124
- b: string;
125
- operation: "<=" | ">=" | "<" | ">" | "==" | "!=";
126
- } | undefined;
127
- or?: (any | any[])[] | undefined;
128
- not?: any | any[] | undefined;
129
- chunk?: {
130
- path: string;
131
- filters: any[];
132
- } | undefined;
133
- }[] | undefined;
134
- } | undefined;
135
- })[] | undefined;
136
- fieldsToAggregateStats?: (string | {
137
- key: string;
138
- interval?: number | undefined;
139
- })[] | undefined;
140
- filters?: {
141
- match?: {
142
- key: string;
143
- value: string | number | boolean | unknown[];
144
- } | undefined;
145
- range?: {
146
- key: string;
147
- greaterThan?: unknown;
148
- lessThan?: unknown;
149
- } | undefined;
150
- wildcard?: {
151
- key: string;
152
- value: string | string[];
153
- } | undefined;
154
- fieldExists?: {
155
- key: string;
156
- } | undefined;
157
- selfreference?: {
158
- a: string;
159
- b: string;
160
- operation: "<=" | ">=" | "<" | ">" | "==" | "!=";
161
- } | undefined;
162
- or?: (any | any[])[] | undefined;
163
- not?: any | any[] | undefined;
164
- chunk?: {
165
- path: string;
166
- filters: any[];
167
- } | undefined;
168
- }[] | undefined;
169
- relevanceBoosters?: {
170
- match?: {
171
- key: string;
172
- value: string | number | boolean | unknown[];
173
- } | undefined;
174
- range?: {
175
- key: string;
176
- greaterThan?: unknown;
177
- lessThan?: unknown;
178
- } | undefined;
179
- wildcard?: {
180
- key: string;
181
- value: string | string[];
182
- } | undefined;
183
- fieldExists?: {
184
- key: string;
185
- } | undefined;
186
- selfreference?: {
187
- a: string;
188
- b: string;
189
- operation: "<=" | ">=" | "<" | ">" | "==" | "!=";
190
- } | undefined;
191
- or?: ({
192
- match?: {
193
- key: string;
194
- value: string | number | boolean | unknown[];
195
- } | undefined;
196
- range?: {
197
- key: string;
198
- greaterThan?: unknown;
199
- lessThan?: unknown;
200
- } | undefined;
201
- wildcard?: {
202
- key: string;
203
- value: string | string[];
204
- } | undefined;
205
- fieldExists?: {
206
- key: string;
207
- } | undefined;
208
- selfreference?: {
209
- a: string;
210
- b: string;
211
- operation: "<=" | ">=" | "<" | ">" | "==" | "!=";
212
- } | undefined;
213
- or?: (any | any[])[] | undefined;
214
- not?: any | any[] | undefined;
215
- chunk?: {
216
- path: string;
217
- filters: any[];
218
- } | undefined;
219
- } | {
220
- match?: {
221
- key: string;
222
- value: string | number | boolean | unknown[];
223
- } | undefined;
224
- range?: {
225
- key: string;
226
- greaterThan?: unknown;
227
- lessThan?: unknown;
228
- } | undefined;
229
- wildcard?: {
230
- key: string;
231
- value: string | string[];
232
- } | undefined;
233
- fieldExists?: {
234
- key: string;
235
- } | undefined;
236
- selfreference?: {
237
- a: string;
238
- b: string;
239
- operation: "<=" | ">=" | "<" | ">" | "==" | "!=";
240
- } | undefined;
241
- or?: (any | any[])[] | undefined;
242
- not?: any | any[] | undefined;
243
- chunk?: {
244
- path: string;
245
- filters: any[];
246
- } | undefined;
247
- }[])[] | undefined;
248
- not?: {
249
- match?: {
250
- key: string;
251
- value: string | number | boolean | unknown[];
252
- } | undefined;
253
- range?: {
254
- key: string;
255
- greaterThan?: unknown;
256
- lessThan?: unknown;
257
- } | undefined;
258
- wildcard?: {
259
- key: string;
260
- value: string | string[];
261
- } | undefined;
262
- fieldExists?: {
263
- key: string;
264
- } | undefined;
265
- selfreference?: {
266
- a: string;
267
- b: string;
268
- operation: "<=" | ">=" | "<" | ">" | "==" | "!=";
269
- } | undefined;
270
- or?: (any | any[])[] | undefined;
271
- not?: any | any[] | undefined;
272
- chunk?: {
273
- path: string;
274
- filters: any[];
275
- } | undefined;
276
- } | {
277
- match?: {
278
- key: string;
279
- value: string | number | boolean | unknown[];
280
- } | undefined;
281
- range?: {
282
- key: string;
283
- greaterThan?: unknown;
284
- lessThan?: unknown;
285
- } | undefined;
286
- wildcard?: {
287
- key: string;
288
- value: string | string[];
289
- } | undefined;
290
- fieldExists?: {
291
- key: string;
292
- } | undefined;
293
- selfreference?: {
294
- a: string;
295
- b: string;
296
- operation: "<=" | ">=" | "<" | ">" | "==" | "!=";
297
- } | undefined;
298
- or?: (any | any[])[] | undefined;
299
- not?: any | any[] | undefined;
300
- chunk?: {
301
- path: string;
302
- filters: any[];
303
- } | undefined;
304
- }[] | undefined;
305
- chunk?: {
306
- path: string;
307
- filters: {
308
- match?: {
309
- key: string;
310
- value: string | number | boolean | unknown[];
311
- } | undefined;
312
- range?: {
313
- key: string;
314
- greaterThan?: unknown;
315
- lessThan?: unknown;
316
- } | undefined;
317
- wildcard?: {
318
- key: string;
319
- value: string | string[];
320
- } | undefined;
321
- fieldExists?: {
322
- key: string;
323
- } | undefined;
324
- selfreference?: {
325
- a: string;
326
- b: string;
327
- operation: "<=" | ">=" | "<" | ">" | "==" | "!=";
328
- } | undefined;
329
- or?: (any | any[])[] | undefined;
330
- not?: any | any[] | undefined;
331
- chunk?: {
332
- path: string;
333
- filters: any[];
334
- } | undefined;
335
- }[];
336
- } | undefined;
337
- weight?: number | undefined;
338
- }[] | undefined;
339
- };
340
- query(query: string, fieldsToSearch?: bodyType['fieldsToSearch']): this;
341
- queryConfig(weight: number, options?: bodyType['queryConfig']): this;
342
- text(field?: string): _QueryBuilder;
343
- vector(field: string, weight?: number): _QueryBuilder;
344
- vector(field: string, options?: components['schemas']['vectorSearchQuery']): _QueryBuilder;
345
- vector(field: string, weight?: number, options?: components['schemas']['vectorSearchQuery']): _QueryBuilder;
346
- sort(field: string, direction: 'asc' | 'desc'): this;
347
- textSort(field: string, direction: 'asc' | 'desc'): this;
348
- rawOption(key: string, value: any): this;
349
- minimumRelevance(value: bodyType['minimumRelevance']): this;
350
- page(value: bodyType['page']): this;
351
- pageSize(value: bodyType['pageSize']): this;
352
- includeFields(fields: bodyType['includeFields']): void;
353
- excludeFields(fields: bodyType['excludeFields']): void;
354
- includeVectors(whetherToInclude: bodyType['includeVectors']): void;
355
- aggregate(field: string, options?: {
356
- options?: any;
357
- aggregates?: _QueryBuilder;
358
- }): this;
359
- aggregateStats(field: string, interval?: number): this;
360
- }
361
- export declare class DiscoveryClient {
362
- apiClient: DiscoveryApiClient;
363
- constructor(config?: _ClientInput);
364
- dataset(name: string, options?: any): Dataset;
365
- }
366
- export {};
@@ -1 +0,0 @@
1
- export * from './discovery';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@relevanceai/sdk",
3
- "version": "1.10.0",
3
+ "version": "1.13.0",
4
4
  "description": "Javascript client for RelevanceAI APIs. Browser, Node.js and typescript support.",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "types": "./dist-types/index.d.ts",
@@ -12,7 +12,7 @@
12
12
  "build": "tsc -p tsconfig.json && tsc -p tsconfig.es.json && tsc -p tsconfig.types.json",
13
13
  "generate": "ts-node ./src/shared/generate.ts",
14
14
  "test": "jest",
15
- "prepare": "npm run test && npm run build"
15
+ "prepare": "npm run build"
16
16
  },
17
17
  "repository": {
18
18
  "type": "git",