@brostark/solutions-client 1.1.4 → 1.1.5

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.
@@ -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
- search: (collectionName: string, query: BrostarkSolutions.Search.SearchQuery) => Promise<any>;
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;6BAC4B,MAAM,SAAS,iBAAiB,CAAC,MAAM,CAAC,WAAW;CAcrF,CAAA"}
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"}
@@ -63,14 +63,14 @@ 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
- search: async (collectionName, query) => {
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}/search?${urlQuery.toString()}`, apiKey);
73
+ const response = await (0, httpRequest_1.httpGetRequest)(`${apiUrl}/search/collections/${collectionName}/query?${urlQuery.toString()}`, apiKey);
74
74
  return response.data;
75
75
  },
76
76
  };
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
- search: (collectionName: string, query: import("./lib/types").BrostarkSolutions.Search.SearchQuery) => Promise<any>;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brostark/solutions-client",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -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
- search: async (collectionName: string, query: BrostarkSolutions.Search.SearchQuery) => {
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,7 +81,7 @@ export const generateSearchAPI = (apiUrl: string, apiKey: string) => {
81
81
  }
82
82
  });
83
83
 
84
- const response = await httpGetRequest(`${apiUrl}/search/collections/${collectionName}/search?${urlQuery.toString()}`, apiKey);
84
+ const response = await httpGetRequest(`${apiUrl}/search/collections/${collectionName}/query?${urlQuery.toString()}`, apiKey);
85
85
 
86
86
  return response.data;
87
87
  },