@seekora-ai/search-sdk 0.2.15 → 0.2.16
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/client.d.ts +1 -4
- package/dist/client.js +13 -16
- package/dist/generated/api.d.ts +1689 -11710
- package/dist/generated/api.js +1292 -2048
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -322,11 +322,8 @@ export declare class SeekoraClient {
|
|
|
322
322
|
private config;
|
|
323
323
|
private searchApi;
|
|
324
324
|
private suggestionsApi;
|
|
325
|
-
private suggestionsConfigApi;
|
|
326
325
|
private analyticsApi;
|
|
327
|
-
private
|
|
328
|
-
private documentsApi;
|
|
329
|
-
private schemaApi;
|
|
326
|
+
private storeManagementApi;
|
|
330
327
|
private filtersApi;
|
|
331
328
|
private experimentsApi;
|
|
332
329
|
private storeId;
|
package/dist/client.js
CHANGED
|
@@ -94,11 +94,8 @@ class SeekoraClient {
|
|
|
94
94
|
// Initialize API clients
|
|
95
95
|
this.searchApi = new generated_1.SearchApi(this.config);
|
|
96
96
|
this.suggestionsApi = new generated_1.QuerySuggestionsApi(this.config);
|
|
97
|
-
this.suggestionsConfigApi = new generated_1.SDKQuerySuggestionsConfigApi(this.config);
|
|
98
97
|
this.analyticsApi = new generated_1.AnalyticsEventsApi(this.config);
|
|
99
|
-
this.
|
|
100
|
-
this.documentsApi = new generated_1.SDKDocumentsApi(this.config);
|
|
101
|
-
this.schemaApi = new generated_1.SDKSchemaApi(this.config);
|
|
98
|
+
this.storeManagementApi = new generated_1.StoreManagementApi(this.config);
|
|
102
99
|
this.filtersApi = new generated_1.FiltersApi(this.config);
|
|
103
100
|
this.experimentsApi = new generated_1.SDKExperimentsApi(this.config);
|
|
104
101
|
this.logger.info('SeekoraClient initialized successfully');
|
|
@@ -481,7 +478,7 @@ class SeekoraClient {
|
|
|
481
478
|
'x-storesecret': this.readSecret,
|
|
482
479
|
};
|
|
483
480
|
try {
|
|
484
|
-
const response = await this.
|
|
481
|
+
const response = await this.storeManagementApi.apiV1StoresXStoreIDQuerySuggestionsConfigGet(this.storeId, this.readSecret, this.storeId, { headers });
|
|
485
482
|
const data = response.data?.data;
|
|
486
483
|
const config = data?.metadata?.config ?? data?.config ?? data;
|
|
487
484
|
this.logger.info('Suggestions configuration retrieved', {
|
|
@@ -531,7 +528,7 @@ class SeekoraClient {
|
|
|
531
528
|
if (this.sessionId) {
|
|
532
529
|
headers['x-session-id'] = this.sessionId;
|
|
533
530
|
}
|
|
534
|
-
const response = await this.
|
|
531
|
+
const response = await this.storeManagementApi.apiV1StoresXStoreIDConfigGet(this.storeId, this.readSecret, this.storeId, { headers });
|
|
535
532
|
const config = response.data?.data;
|
|
536
533
|
this.logger.info('Store configuration retrieved', {
|
|
537
534
|
status: response.status,
|
|
@@ -661,7 +658,7 @@ class SeekoraClient {
|
|
|
661
658
|
'x-storesecret': this.readSecret,
|
|
662
659
|
'x-store-write-secret': this.writeSecret,
|
|
663
660
|
};
|
|
664
|
-
const response = await this.
|
|
661
|
+
const response = await this.storeManagementApi.apiV1StoresXStoreIDConfigPut(this.storeId, this.writeSecret, this.storeId, config, { headers });
|
|
665
662
|
const updatedConfig = response.data?.data;
|
|
666
663
|
this.logger.info('Store configuration updated successfully', {
|
|
667
664
|
status: response.status,
|
|
@@ -694,7 +691,7 @@ class SeekoraClient {
|
|
|
694
691
|
'Content-Type': 'application/json',
|
|
695
692
|
};
|
|
696
693
|
try {
|
|
697
|
-
const response = await this.
|
|
694
|
+
const response = await this.storeManagementApi.apiV1StoresXStoreIDQuerySuggestionsConfigPut(this.storeId, this.writeSecret, this.storeId, config, { headers });
|
|
698
695
|
const data = response.data?.data;
|
|
699
696
|
const updatedConfig = data?.metadata?.config ?? data?.config ?? data;
|
|
700
697
|
this.logger.info('Query suggestions configuration updated successfully', {
|
|
@@ -705,7 +702,7 @@ class SeekoraClient {
|
|
|
705
702
|
}
|
|
706
703
|
catch (apiError) {
|
|
707
704
|
this.logger.verbose('PUT via generated API failed, using direct HTTP', { message: apiError?.message });
|
|
708
|
-
const axiosInstance = this.
|
|
705
|
+
const axiosInstance = this.storeManagementApi.axios ?? this.suggestionsApi.axios ?? axios_1.default;
|
|
709
706
|
const baseUrl = this.config.basePath ?? 'https://api.seekora.com/api';
|
|
710
707
|
const response = await axiosInstance.put(`${baseUrl}/v1/stores/${this.storeId}/query-suggestions/config`, config, { headers });
|
|
711
708
|
const data = response.data?.data;
|
|
@@ -728,7 +725,7 @@ class SeekoraClient {
|
|
|
728
725
|
async getConfigSchema() {
|
|
729
726
|
this.logger.verbose('Getting configuration schema');
|
|
730
727
|
try {
|
|
731
|
-
const response = await this.
|
|
728
|
+
const response = await this.storeManagementApi.apiV1StoresXStoreIDConfigSchemaGet(this.storeId, this.readSecret, this.storeId, {
|
|
732
729
|
headers: {
|
|
733
730
|
'x-storeid': this.storeId,
|
|
734
731
|
'x-storesecret': this.readSecret,
|
|
@@ -769,7 +766,7 @@ class SeekoraClient {
|
|
|
769
766
|
id: document.id,
|
|
770
767
|
data: document.data,
|
|
771
768
|
};
|
|
772
|
-
const response = await this.
|
|
769
|
+
const response = await this.storeManagementApi.apiV1StoresXStoreIDDocumentsPost(this.storeId, this.writeSecret, this.storeId, request);
|
|
773
770
|
const responseData = response.data?.data;
|
|
774
771
|
this.logger.info('Document indexed successfully', {
|
|
775
772
|
id: responseData?.id || document.id,
|
|
@@ -813,7 +810,7 @@ class SeekoraClient {
|
|
|
813
810
|
data: doc.data,
|
|
814
811
|
})),
|
|
815
812
|
};
|
|
816
|
-
const response = await this.
|
|
813
|
+
const response = await this.storeManagementApi.apiV1StoresXStoreIDDocumentsBulkPost(this.storeId, this.writeSecret, this.storeId, request);
|
|
817
814
|
const responseData = response.data?.data;
|
|
818
815
|
this.logger.info('Bulk document indexing completed', {
|
|
819
816
|
successCount: responseData?.successCount || 0,
|
|
@@ -857,7 +854,7 @@ class SeekoraClient {
|
|
|
857
854
|
throw new Error('Write secret is required for deleteDocument');
|
|
858
855
|
}
|
|
859
856
|
try {
|
|
860
|
-
const response = await this.
|
|
857
|
+
const response = await this.storeManagementApi.apiV1StoresXStoreIDDocumentsDocumentIDDelete(this.storeId, this.writeSecret, this.storeId, documentId);
|
|
861
858
|
this.logger.info('Document deleted successfully', {
|
|
862
859
|
documentId,
|
|
863
860
|
status: response.status
|
|
@@ -935,7 +932,7 @@ class SeekoraClient {
|
|
|
935
932
|
default_sorting_field: request.defaultSortingField,
|
|
936
933
|
enable_nested_fields: request.enableNestedFields,
|
|
937
934
|
};
|
|
938
|
-
const response = await this.
|
|
935
|
+
const response = await this.storeManagementApi.apiV1StoresXStoreIDSchemaPost(this.storeId, this.writeSecret, this.storeId, apiRequest);
|
|
939
936
|
const responseData = response.data;
|
|
940
937
|
this.logger.info('Schema created/updated successfully', {
|
|
941
938
|
name: responseData.data?.name,
|
|
@@ -976,7 +973,7 @@ class SeekoraClient {
|
|
|
976
973
|
async getSchema() {
|
|
977
974
|
this.logger.verbose('Getting schema', { storeId: this.storeId });
|
|
978
975
|
try {
|
|
979
|
-
const response = await this.
|
|
976
|
+
const response = await this.storeManagementApi.apiV1StoresXStoreIDSchemaGet(this.storeId, this.readSecret, this.storeId);
|
|
980
977
|
const responseData = response.data;
|
|
981
978
|
this.logger.info('Schema retrieved successfully', {
|
|
982
979
|
name: responseData.data?.name,
|
|
@@ -1027,7 +1024,7 @@ class SeekoraClient {
|
|
|
1027
1024
|
throw new Error('Write secret is required for clearDocuments');
|
|
1028
1025
|
}
|
|
1029
1026
|
try {
|
|
1030
|
-
const response = await this.
|
|
1027
|
+
const response = await this.storeManagementApi.apiV1StoresXStoreIDDocumentsDelete(this.storeId, this.writeSecret, this.storeId);
|
|
1031
1028
|
const responseData = response.data;
|
|
1032
1029
|
this.logger.info('Documents cleared successfully', {
|
|
1033
1030
|
deletedCount: responseData.data?.deleted_count
|