@relevanceai/sdk 1.2.0 → 1.7.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/dist-cjs/generated/VectorApi.js +99 -3
- package/dist-cjs/services/discovery/Dataset.js +4 -1
- package/dist-cjs/services/discovery/index.js +61 -48
- package/dist-es/generated/VectorApi.js +147 -3
- package/dist-es/services/discovery/Dataset.js +4 -1
- package/dist-es/services/discovery/index.js +81 -51
- package/dist-types/generated/VectorApi.d.ts +45 -9
- package/dist-types/generated/_VectorApiSchemaTypes.d.ts +579 -18
- package/dist-types/services/discovery/Dataset.d.ts +1 -0
- package/dist-types/services/discovery/index.d.ts +42 -9
- package/package.json +1 -1
- package/dist-cjs/generated/Discovery.js +0 -82
- package/dist-cjs/generated/Vector.js +0 -634
- package/dist-cjs/generated/_DiscoverySchemaTypes.js +0 -6
- package/dist-cjs/generated/_VectorSchemaTypes.js +0 -6
- package/dist-cjs/generated/clients.js +0 -82
- package/dist-es/generated/Discovery.js +0 -179
- package/dist-es/generated/Vector.js +0 -1007
- package/dist-es/generated/_DiscoverySchemaTypes.js +0 -5
- package/dist-es/generated/_VectorSchemaTypes.js +0 -5
- package/dist-es/generated/clients.js +0 -179
- package/dist-types/generated/Discovery.d.ts +0 -32
- package/dist-types/generated/Vector.d.ts +0 -239
- package/dist-types/generated/_DiscoverySchemaTypes.d.ts +0 -911
- package/dist-types/generated/_VectorSchemaTypes.d.ts +0 -5017
- package/dist-types/generated/clients.d.ts +0 -942
|
@@ -430,6 +430,14 @@ class VectorApiClient extends BaseClient_1._GenericClient {
|
|
|
430
430
|
options
|
|
431
431
|
});
|
|
432
432
|
}
|
|
433
|
+
async clustercentroidsapiv2servicesclustercentroidslistpost(input, options) {
|
|
434
|
+
return this.SendRequest({
|
|
435
|
+
input,
|
|
436
|
+
method: 'post',
|
|
437
|
+
path: '/services/cluster/centroids/list',
|
|
438
|
+
options
|
|
439
|
+
});
|
|
440
|
+
}
|
|
433
441
|
async clustercentroidsgetapiservicesclustercentroidsgetget(input, options) {
|
|
434
442
|
return this.SendRequest({
|
|
435
443
|
input,
|
|
@@ -438,7 +446,15 @@ class VectorApiClient extends BaseClient_1._GenericClient {
|
|
|
438
446
|
options
|
|
439
447
|
});
|
|
440
448
|
}
|
|
441
|
-
async
|
|
449
|
+
async clustercentroidsgetapiservicesclustercentroidsgetpost(input, options) {
|
|
450
|
+
return this.SendRequest({
|
|
451
|
+
input,
|
|
452
|
+
method: 'post',
|
|
453
|
+
path: '/services/cluster/centroids/get',
|
|
454
|
+
options
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
async insertclustercentroids2apiservicesclustercentroidsinsertpost(input, options) {
|
|
442
458
|
return this.SendRequest({
|
|
443
459
|
input,
|
|
444
460
|
method: 'post',
|
|
@@ -446,6 +462,38 @@ class VectorApiClient extends BaseClient_1._GenericClient {
|
|
|
446
462
|
options
|
|
447
463
|
});
|
|
448
464
|
}
|
|
465
|
+
async updatecentroidsapiv2servicesclustercentroidsupdatepost(input, options) {
|
|
466
|
+
return this.SendRequest({
|
|
467
|
+
input,
|
|
468
|
+
method: 'post',
|
|
469
|
+
path: '/services/cluster/centroids/update',
|
|
470
|
+
options
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
async deletecentroidsapiservicesclustercentroidscentroididdeleteget(input, options) {
|
|
474
|
+
return this.SendRequest({
|
|
475
|
+
input,
|
|
476
|
+
method: 'get',
|
|
477
|
+
path: '/services/cluster/centroids/{centroid_id}/delete',
|
|
478
|
+
options
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
async deletecentroidsapiservicesclustercentroidscentroididdeletepost(input, options) {
|
|
482
|
+
return this.SendRequest({
|
|
483
|
+
input,
|
|
484
|
+
method: 'post',
|
|
485
|
+
path: '/services/cluster/centroids/{centroid_id}/delete',
|
|
486
|
+
options
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
async clustercentroidsdeleteapiservicesclustercentroidsdeletepost(input, options) {
|
|
490
|
+
return this.SendRequest({
|
|
491
|
+
input,
|
|
492
|
+
method: 'post',
|
|
493
|
+
path: '/services/cluster/centroids/delete',
|
|
494
|
+
options
|
|
495
|
+
});
|
|
496
|
+
}
|
|
449
497
|
async clustercentroidsgetapiservicesclustercentroidsdocumentspost(input, options) {
|
|
450
498
|
return this.SendRequest({
|
|
451
499
|
input,
|
|
@@ -454,7 +502,39 @@ class VectorApiClient extends BaseClient_1._GenericClient {
|
|
|
454
502
|
options
|
|
455
503
|
});
|
|
456
504
|
}
|
|
457
|
-
async
|
|
505
|
+
async centroidsmetadatagetapiservicesclustercentroidsmetadataget(input, options) {
|
|
506
|
+
return this.SendRequest({
|
|
507
|
+
input,
|
|
508
|
+
method: 'get',
|
|
509
|
+
path: '/services/cluster/centroids/metadata',
|
|
510
|
+
options
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
async centroidsmetadatapostapiv2servicesclustercentroidsmetadatapost(input, options) {
|
|
514
|
+
return this.SendRequest({
|
|
515
|
+
input,
|
|
516
|
+
method: 'post',
|
|
517
|
+
path: '/services/cluster/centroids/metadata',
|
|
518
|
+
options
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
async centroidslistclosesttocenterv2servicesclustercentroidslistclosesttocenterpost(input, options) {
|
|
522
|
+
return this.SendRequest({
|
|
523
|
+
input,
|
|
524
|
+
method: 'post',
|
|
525
|
+
path: '/services/cluster/centroids/list_closest_to_center',
|
|
526
|
+
options
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
async centroidslistfurthestfromcenterv2servicesclustercentroidslistfurthestfromcenterpost(input, options) {
|
|
530
|
+
return this.SendRequest({
|
|
531
|
+
input,
|
|
532
|
+
method: 'post',
|
|
533
|
+
path: '/services/cluster/centroids/list_furthest_from_center',
|
|
534
|
+
options
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
async clusteraggregateapiv2servicesclusteraggregatepost(input, options) {
|
|
458
538
|
return this.SendRequest({
|
|
459
539
|
input,
|
|
460
540
|
method: 'post',
|
|
@@ -462,7 +542,7 @@ class VectorApiClient extends BaseClient_1._GenericClient {
|
|
|
462
542
|
options
|
|
463
543
|
});
|
|
464
544
|
}
|
|
465
|
-
async
|
|
545
|
+
async advancedclusterfacetsapiservicesclusterfacetsget(input, options) {
|
|
466
546
|
return this.SendRequest({
|
|
467
547
|
input,
|
|
468
548
|
method: 'get',
|
|
@@ -470,6 +550,22 @@ class VectorApiClient extends BaseClient_1._GenericClient {
|
|
|
470
550
|
options
|
|
471
551
|
});
|
|
472
552
|
}
|
|
553
|
+
async clusterlistservicesclusterlistget(input, options) {
|
|
554
|
+
return this.SendRequest({
|
|
555
|
+
input,
|
|
556
|
+
method: 'get',
|
|
557
|
+
path: '/services/cluster/list',
|
|
558
|
+
options
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
async clusterlistmultiservicesclusterlistpost(input, options) {
|
|
562
|
+
return this.SendRequest({
|
|
563
|
+
input,
|
|
564
|
+
method: 'post',
|
|
565
|
+
path: '/services/cluster/list',
|
|
566
|
+
options
|
|
567
|
+
});
|
|
568
|
+
}
|
|
473
569
|
async tagapiservicestaggertagpost(input, options) {
|
|
474
570
|
return this.SendRequest({
|
|
475
571
|
input,
|
|
@@ -27,8 +27,11 @@ class Dataset {
|
|
|
27
27
|
if (arg instanceof _1._QueryBuilder) {
|
|
28
28
|
payload = { ...payload, ...arg.build() };
|
|
29
29
|
}
|
|
30
|
-
else
|
|
30
|
+
else {
|
|
31
31
|
options = arg;
|
|
32
|
+
if (options.rawPayload)
|
|
33
|
+
payload = { ...payload, ...options.rawPayload };
|
|
34
|
+
}
|
|
32
35
|
}
|
|
33
36
|
const reqCallback = async () => await this.client.apiClient.SimpleSearchPost(payload, { dataset_id: this.name });
|
|
34
37
|
if (options.debounce && this.debounceTimer) {
|
|
@@ -1,15 +1,74 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DiscoveryClient = exports._QueryBuilder = exports.QueryBuilder = void 0;
|
|
3
|
+
exports.DiscoveryClient = exports._QueryBuilder = exports._FilterBuilder = exports.FilterBuilder = exports.QueryBuilder = void 0;
|
|
4
4
|
const __1 = require("../../");
|
|
5
5
|
const Dataset_1 = require("./Dataset");
|
|
6
6
|
function QueryBuilder() {
|
|
7
7
|
return new _QueryBuilder();
|
|
8
8
|
}
|
|
9
9
|
exports.QueryBuilder = QueryBuilder;
|
|
10
|
-
|
|
10
|
+
function FilterBuilder() {
|
|
11
|
+
return new _FilterBuilder();
|
|
12
|
+
}
|
|
13
|
+
exports.FilterBuilder = FilterBuilder;
|
|
14
|
+
class _FilterBuilder {
|
|
11
15
|
constructor() {
|
|
12
16
|
this.body = { filters: [], fieldsToAggregate: [], fieldsToAggregateStats: [] };
|
|
17
|
+
}
|
|
18
|
+
buildFilters() {
|
|
19
|
+
return this.body.filters;
|
|
20
|
+
}
|
|
21
|
+
rawFilter(filter) {
|
|
22
|
+
var _a;
|
|
23
|
+
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push(filter);
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
filter(type, key, value, ...options) {
|
|
27
|
+
var _a;
|
|
28
|
+
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({
|
|
29
|
+
[type]: {
|
|
30
|
+
key,
|
|
31
|
+
value,
|
|
32
|
+
...options
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
match(field, value) {
|
|
38
|
+
var _a;
|
|
39
|
+
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ match: { key: field, value } });
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
wildcard(field, value) {
|
|
43
|
+
var _a;
|
|
44
|
+
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ wildcard: { key: field, value } });
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
selfreference(fielda, fieldb, operation) {
|
|
48
|
+
var _a;
|
|
49
|
+
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ selfreference: { a: fielda, b: fieldb, operation } });
|
|
50
|
+
return this;
|
|
51
|
+
}
|
|
52
|
+
range(field, options) {
|
|
53
|
+
var _a;
|
|
54
|
+
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ range: { key: field, ...options } });
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
or(filters) {
|
|
58
|
+
var _a;
|
|
59
|
+
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ or: filters.map(f => { var _a; return (_a = f.body.filters) !== null && _a !== void 0 ? _a : []; }) });
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
not(filter) {
|
|
63
|
+
var _a, _b, _c;
|
|
64
|
+
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ not: (_c = (_b = filter.body) === null || _b === void 0 ? void 0 : _b.filters) !== null && _c !== void 0 ? _c : [] });
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports._FilterBuilder = _FilterBuilder;
|
|
69
|
+
class _QueryBuilder extends _FilterBuilder {
|
|
70
|
+
constructor() {
|
|
71
|
+
super();
|
|
13
72
|
this.shouldPerformTextQuery = false;
|
|
14
73
|
}
|
|
15
74
|
build() {
|
|
@@ -88,11 +147,6 @@ class _QueryBuilder {
|
|
|
88
147
|
this.body.pageSize = value;
|
|
89
148
|
return this;
|
|
90
149
|
}
|
|
91
|
-
rawFilter(filter) {
|
|
92
|
-
var _a;
|
|
93
|
-
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push(filter);
|
|
94
|
-
return this;
|
|
95
|
-
}
|
|
96
150
|
includeFields(fields) {
|
|
97
151
|
this.body.includeFields = fields;
|
|
98
152
|
}
|
|
@@ -102,47 +156,6 @@ class _QueryBuilder {
|
|
|
102
156
|
includeVectors(whetherToInclude) {
|
|
103
157
|
this.body.includeVectors = whetherToInclude;
|
|
104
158
|
}
|
|
105
|
-
filter(type, key, value, ...options) {
|
|
106
|
-
var _a;
|
|
107
|
-
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({
|
|
108
|
-
[type]: {
|
|
109
|
-
key,
|
|
110
|
-
value,
|
|
111
|
-
...options
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
return this;
|
|
115
|
-
}
|
|
116
|
-
match(field, value) {
|
|
117
|
-
var _a;
|
|
118
|
-
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ match: { key: field, value } });
|
|
119
|
-
return this;
|
|
120
|
-
}
|
|
121
|
-
wildcard(field, value) {
|
|
122
|
-
var _a;
|
|
123
|
-
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ wildcard: { key: field, value } });
|
|
124
|
-
return this;
|
|
125
|
-
}
|
|
126
|
-
selfreference(fielda, fieldb, operation) {
|
|
127
|
-
var _a;
|
|
128
|
-
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ selfreference: { a: fielda, b: fieldb, operation } });
|
|
129
|
-
return this;
|
|
130
|
-
}
|
|
131
|
-
range(field, options) {
|
|
132
|
-
var _a;
|
|
133
|
-
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ range: { key: field, ...options } });
|
|
134
|
-
return this;
|
|
135
|
-
}
|
|
136
|
-
or(filters) {
|
|
137
|
-
var _a;
|
|
138
|
-
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ or: filters.map(f => { var _a; return (_a = f.body.filters) !== null && _a !== void 0 ? _a : []; }) });
|
|
139
|
-
return this;
|
|
140
|
-
}
|
|
141
|
-
not(filter) {
|
|
142
|
-
var _a, _b, _c;
|
|
143
|
-
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ not: (_c = (_b = filter.body) === null || _b === void 0 ? void 0 : _b.filters) !== null && _c !== void 0 ? _c : [] });
|
|
144
|
-
return this;
|
|
145
|
-
}
|
|
146
159
|
aggregate(field, options) {
|
|
147
160
|
var _a, _b, _c;
|
|
148
161
|
(_a = this.body.fieldsToAggregate) === null || _a === void 0 ? void 0 : _a.push({ key: field, ...options, fieldsToAggregate: (_c = (_b = options === null || options === void 0 ? void 0 : options.aggregates) === null || _b === void 0 ? void 0 : _b.body.fieldsToAggregate) !== null && _c !== void 0 ? _c : [] });
|
|
@@ -702,6 +702,18 @@ var VectorApiClient = /** @class */ (function (_super) {
|
|
|
702
702
|
});
|
|
703
703
|
});
|
|
704
704
|
};
|
|
705
|
+
VectorApiClient.prototype.clustercentroidsapiv2servicesclustercentroidslistpost = function (input, options) {
|
|
706
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
707
|
+
return __generator(this, function (_a) {
|
|
708
|
+
return [2 /*return*/, this.SendRequest({
|
|
709
|
+
input: input,
|
|
710
|
+
method: 'post',
|
|
711
|
+
path: '/services/cluster/centroids/list',
|
|
712
|
+
options: options
|
|
713
|
+
})];
|
|
714
|
+
});
|
|
715
|
+
});
|
|
716
|
+
};
|
|
705
717
|
VectorApiClient.prototype.clustercentroidsgetapiservicesclustercentroidsgetget = function (input, options) {
|
|
706
718
|
return __awaiter(this, void 0, void 0, function () {
|
|
707
719
|
return __generator(this, function (_a) {
|
|
@@ -714,7 +726,19 @@ var VectorApiClient = /** @class */ (function (_super) {
|
|
|
714
726
|
});
|
|
715
727
|
});
|
|
716
728
|
};
|
|
717
|
-
VectorApiClient.prototype.
|
|
729
|
+
VectorApiClient.prototype.clustercentroidsgetapiservicesclustercentroidsgetpost = function (input, options) {
|
|
730
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
731
|
+
return __generator(this, function (_a) {
|
|
732
|
+
return [2 /*return*/, this.SendRequest({
|
|
733
|
+
input: input,
|
|
734
|
+
method: 'post',
|
|
735
|
+
path: '/services/cluster/centroids/get',
|
|
736
|
+
options: options
|
|
737
|
+
})];
|
|
738
|
+
});
|
|
739
|
+
});
|
|
740
|
+
};
|
|
741
|
+
VectorApiClient.prototype.insertclustercentroids2apiservicesclustercentroidsinsertpost = function (input, options) {
|
|
718
742
|
return __awaiter(this, void 0, void 0, function () {
|
|
719
743
|
return __generator(this, function (_a) {
|
|
720
744
|
return [2 /*return*/, this.SendRequest({
|
|
@@ -726,6 +750,54 @@ var VectorApiClient = /** @class */ (function (_super) {
|
|
|
726
750
|
});
|
|
727
751
|
});
|
|
728
752
|
};
|
|
753
|
+
VectorApiClient.prototype.updatecentroidsapiv2servicesclustercentroidsupdatepost = function (input, options) {
|
|
754
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
755
|
+
return __generator(this, function (_a) {
|
|
756
|
+
return [2 /*return*/, this.SendRequest({
|
|
757
|
+
input: input,
|
|
758
|
+
method: 'post',
|
|
759
|
+
path: '/services/cluster/centroids/update',
|
|
760
|
+
options: options
|
|
761
|
+
})];
|
|
762
|
+
});
|
|
763
|
+
});
|
|
764
|
+
};
|
|
765
|
+
VectorApiClient.prototype.deletecentroidsapiservicesclustercentroidscentroididdeleteget = function (input, options) {
|
|
766
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
767
|
+
return __generator(this, function (_a) {
|
|
768
|
+
return [2 /*return*/, this.SendRequest({
|
|
769
|
+
input: input,
|
|
770
|
+
method: 'get',
|
|
771
|
+
path: '/services/cluster/centroids/{centroid_id}/delete',
|
|
772
|
+
options: options
|
|
773
|
+
})];
|
|
774
|
+
});
|
|
775
|
+
});
|
|
776
|
+
};
|
|
777
|
+
VectorApiClient.prototype.deletecentroidsapiservicesclustercentroidscentroididdeletepost = function (input, options) {
|
|
778
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
779
|
+
return __generator(this, function (_a) {
|
|
780
|
+
return [2 /*return*/, this.SendRequest({
|
|
781
|
+
input: input,
|
|
782
|
+
method: 'post',
|
|
783
|
+
path: '/services/cluster/centroids/{centroid_id}/delete',
|
|
784
|
+
options: options
|
|
785
|
+
})];
|
|
786
|
+
});
|
|
787
|
+
});
|
|
788
|
+
};
|
|
789
|
+
VectorApiClient.prototype.clustercentroidsdeleteapiservicesclustercentroidsdeletepost = function (input, options) {
|
|
790
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
791
|
+
return __generator(this, function (_a) {
|
|
792
|
+
return [2 /*return*/, this.SendRequest({
|
|
793
|
+
input: input,
|
|
794
|
+
method: 'post',
|
|
795
|
+
path: '/services/cluster/centroids/delete',
|
|
796
|
+
options: options
|
|
797
|
+
})];
|
|
798
|
+
});
|
|
799
|
+
});
|
|
800
|
+
};
|
|
729
801
|
VectorApiClient.prototype.clustercentroidsgetapiservicesclustercentroidsdocumentspost = function (input, options) {
|
|
730
802
|
return __awaiter(this, void 0, void 0, function () {
|
|
731
803
|
return __generator(this, function (_a) {
|
|
@@ -738,7 +810,55 @@ var VectorApiClient = /** @class */ (function (_super) {
|
|
|
738
810
|
});
|
|
739
811
|
});
|
|
740
812
|
};
|
|
741
|
-
VectorApiClient.prototype.
|
|
813
|
+
VectorApiClient.prototype.centroidsmetadatagetapiservicesclustercentroidsmetadataget = function (input, options) {
|
|
814
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
815
|
+
return __generator(this, function (_a) {
|
|
816
|
+
return [2 /*return*/, this.SendRequest({
|
|
817
|
+
input: input,
|
|
818
|
+
method: 'get',
|
|
819
|
+
path: '/services/cluster/centroids/metadata',
|
|
820
|
+
options: options
|
|
821
|
+
})];
|
|
822
|
+
});
|
|
823
|
+
});
|
|
824
|
+
};
|
|
825
|
+
VectorApiClient.prototype.centroidsmetadatapostapiv2servicesclustercentroidsmetadatapost = function (input, options) {
|
|
826
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
827
|
+
return __generator(this, function (_a) {
|
|
828
|
+
return [2 /*return*/, this.SendRequest({
|
|
829
|
+
input: input,
|
|
830
|
+
method: 'post',
|
|
831
|
+
path: '/services/cluster/centroids/metadata',
|
|
832
|
+
options: options
|
|
833
|
+
})];
|
|
834
|
+
});
|
|
835
|
+
});
|
|
836
|
+
};
|
|
837
|
+
VectorApiClient.prototype.centroidslistclosesttocenterv2servicesclustercentroidslistclosesttocenterpost = function (input, options) {
|
|
838
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
839
|
+
return __generator(this, function (_a) {
|
|
840
|
+
return [2 /*return*/, this.SendRequest({
|
|
841
|
+
input: input,
|
|
842
|
+
method: 'post',
|
|
843
|
+
path: '/services/cluster/centroids/list_closest_to_center',
|
|
844
|
+
options: options
|
|
845
|
+
})];
|
|
846
|
+
});
|
|
847
|
+
});
|
|
848
|
+
};
|
|
849
|
+
VectorApiClient.prototype.centroidslistfurthestfromcenterv2servicesclustercentroidslistfurthestfromcenterpost = function (input, options) {
|
|
850
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
851
|
+
return __generator(this, function (_a) {
|
|
852
|
+
return [2 /*return*/, this.SendRequest({
|
|
853
|
+
input: input,
|
|
854
|
+
method: 'post',
|
|
855
|
+
path: '/services/cluster/centroids/list_furthest_from_center',
|
|
856
|
+
options: options
|
|
857
|
+
})];
|
|
858
|
+
});
|
|
859
|
+
});
|
|
860
|
+
};
|
|
861
|
+
VectorApiClient.prototype.clusteraggregateapiv2servicesclusteraggregatepost = function (input, options) {
|
|
742
862
|
return __awaiter(this, void 0, void 0, function () {
|
|
743
863
|
return __generator(this, function (_a) {
|
|
744
864
|
return [2 /*return*/, this.SendRequest({
|
|
@@ -750,7 +870,7 @@ var VectorApiClient = /** @class */ (function (_super) {
|
|
|
750
870
|
});
|
|
751
871
|
});
|
|
752
872
|
};
|
|
753
|
-
VectorApiClient.prototype.
|
|
873
|
+
VectorApiClient.prototype.advancedclusterfacetsapiservicesclusterfacetsget = function (input, options) {
|
|
754
874
|
return __awaiter(this, void 0, void 0, function () {
|
|
755
875
|
return __generator(this, function (_a) {
|
|
756
876
|
return [2 /*return*/, this.SendRequest({
|
|
@@ -762,6 +882,30 @@ var VectorApiClient = /** @class */ (function (_super) {
|
|
|
762
882
|
});
|
|
763
883
|
});
|
|
764
884
|
};
|
|
885
|
+
VectorApiClient.prototype.clusterlistservicesclusterlistget = function (input, options) {
|
|
886
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
887
|
+
return __generator(this, function (_a) {
|
|
888
|
+
return [2 /*return*/, this.SendRequest({
|
|
889
|
+
input: input,
|
|
890
|
+
method: 'get',
|
|
891
|
+
path: '/services/cluster/list',
|
|
892
|
+
options: options
|
|
893
|
+
})];
|
|
894
|
+
});
|
|
895
|
+
});
|
|
896
|
+
};
|
|
897
|
+
VectorApiClient.prototype.clusterlistmultiservicesclusterlistpost = function (input, options) {
|
|
898
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
899
|
+
return __generator(this, function (_a) {
|
|
900
|
+
return [2 /*return*/, this.SendRequest({
|
|
901
|
+
input: input,
|
|
902
|
+
method: 'post',
|
|
903
|
+
path: '/services/cluster/list',
|
|
904
|
+
options: options
|
|
905
|
+
})];
|
|
906
|
+
});
|
|
907
|
+
});
|
|
908
|
+
};
|
|
765
909
|
VectorApiClient.prototype.tagapiservicestaggertagpost = function (input, options) {
|
|
766
910
|
return __awaiter(this, void 0, void 0, function () {
|
|
767
911
|
return __generator(this, function (_a) {
|
|
@@ -105,8 +105,11 @@ var Dataset = /** @class */ (function () {
|
|
|
105
105
|
if (arg instanceof _QueryBuilder) {
|
|
106
106
|
payload = __assign(__assign({}, payload), arg.build());
|
|
107
107
|
}
|
|
108
|
-
else
|
|
108
|
+
else {
|
|
109
109
|
options = arg;
|
|
110
|
+
if (options.rawPayload)
|
|
111
|
+
payload = __assign(__assign({}, payload), options.rawPayload);
|
|
112
|
+
}
|
|
110
113
|
}
|
|
111
114
|
}
|
|
112
115
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
1
16
|
var __assign = (this && this.__assign) || function () {
|
|
2
17
|
__assign = Object.assign || function(t) {
|
|
3
18
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -25,10 +40,72 @@ import { Dataset } from './Dataset';
|
|
|
25
40
|
export function QueryBuilder() {
|
|
26
41
|
return new _QueryBuilder();
|
|
27
42
|
}
|
|
28
|
-
|
|
29
|
-
|
|
43
|
+
export function FilterBuilder() {
|
|
44
|
+
return new _FilterBuilder();
|
|
45
|
+
}
|
|
46
|
+
var _FilterBuilder = /** @class */ (function () {
|
|
47
|
+
function _FilterBuilder() {
|
|
30
48
|
this.body = { filters: [], fieldsToAggregate: [], fieldsToAggregateStats: [] };
|
|
31
|
-
|
|
49
|
+
}
|
|
50
|
+
_FilterBuilder.prototype.buildFilters = function () {
|
|
51
|
+
return this.body.filters;
|
|
52
|
+
};
|
|
53
|
+
_FilterBuilder.prototype.rawFilter = function (filter) {
|
|
54
|
+
var _a;
|
|
55
|
+
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push(filter);
|
|
56
|
+
return this;
|
|
57
|
+
};
|
|
58
|
+
_FilterBuilder.prototype.filter = function (type, key, value) {
|
|
59
|
+
var _a;
|
|
60
|
+
var _b;
|
|
61
|
+
var options = [];
|
|
62
|
+
for (var _i = 3; _i < arguments.length; _i++) {
|
|
63
|
+
options[_i - 3] = arguments[_i];
|
|
64
|
+
}
|
|
65
|
+
(_b = this.body.filters) === null || _b === void 0 ? void 0 : _b.push((_a = {},
|
|
66
|
+
_a[type] = __assign({ key: key, value: value }, options),
|
|
67
|
+
_a));
|
|
68
|
+
return this;
|
|
69
|
+
};
|
|
70
|
+
_FilterBuilder.prototype.match = function (field, value) {
|
|
71
|
+
var _a;
|
|
72
|
+
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ match: { key: field, value: value } });
|
|
73
|
+
return this;
|
|
74
|
+
};
|
|
75
|
+
_FilterBuilder.prototype.wildcard = function (field, value) {
|
|
76
|
+
var _a;
|
|
77
|
+
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ wildcard: { key: field, value: value } });
|
|
78
|
+
return this;
|
|
79
|
+
};
|
|
80
|
+
_FilterBuilder.prototype.selfreference = function (fielda, fieldb, operation) {
|
|
81
|
+
var _a;
|
|
82
|
+
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ selfreference: { a: fielda, b: fieldb, operation: operation } });
|
|
83
|
+
return this;
|
|
84
|
+
};
|
|
85
|
+
_FilterBuilder.prototype.range = function (field, options) {
|
|
86
|
+
var _a;
|
|
87
|
+
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ range: __assign({ key: field }, options) });
|
|
88
|
+
return this;
|
|
89
|
+
};
|
|
90
|
+
_FilterBuilder.prototype.or = function (filters) {
|
|
91
|
+
var _a;
|
|
92
|
+
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ or: filters.map(function (f) { var _a; return (_a = f.body.filters) !== null && _a !== void 0 ? _a : []; }) });
|
|
93
|
+
return this;
|
|
94
|
+
};
|
|
95
|
+
_FilterBuilder.prototype.not = function (filter) {
|
|
96
|
+
var _a, _b, _c;
|
|
97
|
+
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ not: (_c = (_b = filter.body) === null || _b === void 0 ? void 0 : _b.filters) !== null && _c !== void 0 ? _c : [] });
|
|
98
|
+
return this;
|
|
99
|
+
};
|
|
100
|
+
return _FilterBuilder;
|
|
101
|
+
}());
|
|
102
|
+
export { _FilterBuilder };
|
|
103
|
+
var _QueryBuilder = /** @class */ (function (_super) {
|
|
104
|
+
__extends(_QueryBuilder, _super);
|
|
105
|
+
function _QueryBuilder() {
|
|
106
|
+
var _this = _super.call(this) || this;
|
|
107
|
+
_this.shouldPerformTextQuery = false;
|
|
108
|
+
return _this;
|
|
32
109
|
}
|
|
33
110
|
_QueryBuilder.prototype.build = function () {
|
|
34
111
|
if (!this.shouldPerformTextQuery)
|
|
@@ -121,11 +198,6 @@ var _QueryBuilder = /** @class */ (function () {
|
|
|
121
198
|
this.body.pageSize = value;
|
|
122
199
|
return this;
|
|
123
200
|
};
|
|
124
|
-
_QueryBuilder.prototype.rawFilter = function (filter) {
|
|
125
|
-
var _a;
|
|
126
|
-
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push(filter);
|
|
127
|
-
return this;
|
|
128
|
-
};
|
|
129
201
|
_QueryBuilder.prototype.includeFields = function (fields) {
|
|
130
202
|
this.body.includeFields = fields;
|
|
131
203
|
};
|
|
@@ -135,48 +207,6 @@ var _QueryBuilder = /** @class */ (function () {
|
|
|
135
207
|
_QueryBuilder.prototype.includeVectors = function (whetherToInclude) {
|
|
136
208
|
this.body.includeVectors = whetherToInclude;
|
|
137
209
|
};
|
|
138
|
-
_QueryBuilder.prototype.filter = function (type, key, value) {
|
|
139
|
-
var _a;
|
|
140
|
-
var _b;
|
|
141
|
-
var options = [];
|
|
142
|
-
for (var _i = 3; _i < arguments.length; _i++) {
|
|
143
|
-
options[_i - 3] = arguments[_i];
|
|
144
|
-
}
|
|
145
|
-
(_b = this.body.filters) === null || _b === void 0 ? void 0 : _b.push((_a = {},
|
|
146
|
-
_a[type] = __assign({ key: key, value: value }, options),
|
|
147
|
-
_a));
|
|
148
|
-
return this;
|
|
149
|
-
};
|
|
150
|
-
_QueryBuilder.prototype.match = function (field, value) {
|
|
151
|
-
var _a;
|
|
152
|
-
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ match: { key: field, value: value } });
|
|
153
|
-
return this;
|
|
154
|
-
};
|
|
155
|
-
_QueryBuilder.prototype.wildcard = function (field, value) {
|
|
156
|
-
var _a;
|
|
157
|
-
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ wildcard: { key: field, value: value } });
|
|
158
|
-
return this;
|
|
159
|
-
};
|
|
160
|
-
_QueryBuilder.prototype.selfreference = function (fielda, fieldb, operation) {
|
|
161
|
-
var _a;
|
|
162
|
-
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ selfreference: { a: fielda, b: fieldb, operation: operation } });
|
|
163
|
-
return this;
|
|
164
|
-
};
|
|
165
|
-
_QueryBuilder.prototype.range = function (field, options) {
|
|
166
|
-
var _a;
|
|
167
|
-
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ range: __assign({ key: field }, options) });
|
|
168
|
-
return this;
|
|
169
|
-
};
|
|
170
|
-
_QueryBuilder.prototype.or = function (filters) {
|
|
171
|
-
var _a;
|
|
172
|
-
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ or: filters.map(function (f) { var _a; return (_a = f.body.filters) !== null && _a !== void 0 ? _a : []; }) });
|
|
173
|
-
return this;
|
|
174
|
-
};
|
|
175
|
-
_QueryBuilder.prototype.not = function (filter) {
|
|
176
|
-
var _a, _b, _c;
|
|
177
|
-
(_a = this.body.filters) === null || _a === void 0 ? void 0 : _a.push({ not: (_c = (_b = filter.body) === null || _b === void 0 ? void 0 : _b.filters) !== null && _c !== void 0 ? _c : [] });
|
|
178
|
-
return this;
|
|
179
|
-
};
|
|
180
210
|
_QueryBuilder.prototype.aggregate = function (field, options) {
|
|
181
211
|
var _a, _b, _c;
|
|
182
212
|
(_a = this.body.fieldsToAggregate) === null || _a === void 0 ? void 0 : _a.push(__assign(__assign({ key: field }, options), { fieldsToAggregate: (_c = (_b = options === null || options === void 0 ? void 0 : options.aggregates) === null || _b === void 0 ? void 0 : _b.body.fieldsToAggregate) !== null && _c !== void 0 ? _c : [] }));
|
|
@@ -188,7 +218,7 @@ var _QueryBuilder = /** @class */ (function () {
|
|
|
188
218
|
return this;
|
|
189
219
|
};
|
|
190
220
|
return _QueryBuilder;
|
|
191
|
-
}());
|
|
221
|
+
}(_FilterBuilder));
|
|
192
222
|
export { _QueryBuilder };
|
|
193
223
|
var DiscoveryClient = /** @class */ (function () {
|
|
194
224
|
function DiscoveryClient(config) {
|