@brostark/solutions-client 1.1.4 → 1.1.6
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/api/v1/search.d.ts
CHANGED
|
@@ -44,6 +44,6 @@ export declare const generateSearchAPI: (apiUrl: string, apiKey: string) => {
|
|
|
44
44
|
* @param query - The query to search for
|
|
45
45
|
* @returns A promise with the search results
|
|
46
46
|
*/
|
|
47
|
-
|
|
47
|
+
query: (collectionName: string, query: BrostarkSolutions.Search.SearchQuery) => Promise<any>;
|
|
48
48
|
};
|
|
49
49
|
//# sourceMappingURL=search.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/api/v1/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAIjE;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,EAAE,QAAQ,MAAM;IAE5D;;;;OAIG;gCAC8B,WAAW;IAK5C;;;;OAIG;+BAC8B,iBAAiB,CAAC,MAAM,CAAC,sBAAsB;IAMhF;;;;OAIG;6BAC4B,MAAM;IAMrC;;;;;OAKG;sCACqC,MAAM,aAAa,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;IAMpF;;;;;OAKG;qCACoC,MAAM,cAAc,MAAM;IAMjE;;;;;OAKG;
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/api/v1/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAIjE;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,EAAE,QAAQ,MAAM;IAE5D;;;;OAIG;gCAC8B,WAAW;IAK5C;;;;OAIG;+BAC8B,iBAAiB,CAAC,MAAM,CAAC,sBAAsB;IAMhF;;;;OAIG;6BAC4B,MAAM;IAMrC;;;;;OAKG;sCACqC,MAAM,aAAa,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;IAMpF;;;;;OAKG;qCACoC,MAAM,cAAc,MAAM;IAMjE;;;;;OAKG;4BAC2B,MAAM,SAAS,iBAAiB,CAAC,MAAM,CAAC,WAAW;CAcpF,CAAA"}
|
package/dist/api/v1/search.js
CHANGED
|
@@ -63,15 +63,15 @@ const generateSearchAPI = (apiUrl, apiKey) => {
|
|
|
63
63
|
* @param query - The query to search for
|
|
64
64
|
* @returns A promise with the search results
|
|
65
65
|
*/
|
|
66
|
-
|
|
66
|
+
query: async (collectionName, query) => {
|
|
67
67
|
const urlQuery = new URLSearchParams();
|
|
68
68
|
Object.entries(query).forEach(([key, value]) => {
|
|
69
69
|
if (value !== undefined && value !== null) {
|
|
70
70
|
urlQuery.set(key, String(value));
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
|
-
const response = await (0, httpRequest_1.httpGetRequest)(`${apiUrl}/search/collections/${collectionName}/
|
|
74
|
-
return response
|
|
73
|
+
const response = await (0, httpRequest_1.httpGetRequest)(`${apiUrl}/search/collections/${collectionName}/query?${urlQuery.toString()}`, apiKey);
|
|
74
|
+
return response;
|
|
75
75
|
},
|
|
76
76
|
};
|
|
77
77
|
};
|
package/dist/client.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export declare function createClient(apiKey: string, options?: CreateClientOptio
|
|
|
32
32
|
deleteCollection: (name: string) => Promise<any>;
|
|
33
33
|
upsertDocuments: (collectionName: string, documents: Record<string, unknown>[]) => Promise<any>;
|
|
34
34
|
deleteDocument: (collectionName: string, documentId: string) => Promise<any>;
|
|
35
|
-
|
|
35
|
+
query: (collectionName: string, query: import("./lib/types").BrostarkSolutions.Search.SearchQuery) => Promise<any>;
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
//# sourceMappingURL=client.d.ts.map
|
package/package.json
CHANGED
package/src/api/v1/search.ts
CHANGED
|
@@ -72,7 +72,7 @@ export const generateSearchAPI = (apiUrl: string, apiKey: string) => {
|
|
|
72
72
|
* @param query - The query to search for
|
|
73
73
|
* @returns A promise with the search results
|
|
74
74
|
*/
|
|
75
|
-
|
|
75
|
+
query: async (collectionName: string, query: BrostarkSolutions.Search.SearchQuery) => {
|
|
76
76
|
const urlQuery = new URLSearchParams();
|
|
77
77
|
|
|
78
78
|
Object.entries(query).forEach(([key, value]) => {
|
|
@@ -81,9 +81,9 @@ export const generateSearchAPI = (apiUrl: string, apiKey: string) => {
|
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
|
|
84
|
-
const response = await httpGetRequest(`${apiUrl}/search/collections/${collectionName}/
|
|
84
|
+
const response = await httpGetRequest(`${apiUrl}/search/collections/${collectionName}/query?${urlQuery.toString()}`, apiKey);
|
|
85
85
|
|
|
86
|
-
return response
|
|
86
|
+
return response;
|
|
87
87
|
},
|
|
88
88
|
}
|
|
89
89
|
}
|