@brostark/solutions-client 1.1.13 → 1.1.14

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.
@@ -38,6 +38,13 @@ export declare const generateSearchAPI: (apiUrl: string, apiKey: string) => {
38
38
  * @returns A promise with the deleted document
39
39
  */
40
40
  deleteDocument: (collectionName: string, documentId: string) => Promise<any>;
41
+ /**
42
+ * Deletes multiple documents from a search collection
43
+ * @param collectionName - The name of the collection to delete the documents from
44
+ * @param documentIds - The IDs of the documents to delete
45
+ * @returns A promise with the deleted documents
46
+ */
47
+ deleteMultipleDocuments: (collectionName: string, documentIds: string[]) => Promise<any>;
41
48
  /**
42
49
  * Gets a document from a search collection by its ID
43
50
  * @param collectionName - The name of the collection to get the document from
@@ -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;AAKjE;;;;;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;sCACqC,MAAM,cAAc,MAAM;IAMlE;;;;;OAKG;4BAC2B,MAAM,SAAS,iBAAiB,CAAC,MAAM,CAAC,WAAW,KAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,YAAY,CAAC;CAcrI,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;AAKjE;;;;;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;8CAC6C,MAAM,eAAe,MAAM,EAAE;IAM7E;;;;;OAKG;sCACqC,MAAM,cAAc,MAAM;IAMlE;;;;;OAKG;4BAC2B,MAAM,SAAS,iBAAiB,CAAC,MAAM,CAAC,WAAW,KAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,YAAY,CAAC;CAcrI,CAAA"}
@@ -58,6 +58,16 @@ const generateSearchAPI = (apiUrl, apiKey) => {
58
58
  const response = await (0, httpRequest_1.httpDeleteRequest)(`${apiUrl}/search/collections/${collectionName}/documents/${documentId}`, apiKey);
59
59
  return response.data;
60
60
  },
61
+ /**
62
+ * Deletes multiple documents from a search collection
63
+ * @param collectionName - The name of the collection to delete the documents from
64
+ * @param documentIds - The IDs of the documents to delete
65
+ * @returns A promise with the deleted documents
66
+ */
67
+ deleteMultipleDocuments: async (collectionName, documentIds) => {
68
+ const response = await (0, httpRequest_1.httpPostRequest)(`${apiUrl}/search/collections/${collectionName}/documents/delete`, apiKey, { documentIds });
69
+ return response.data;
70
+ },
61
71
  /**
62
72
  * Gets a document from a search collection by its ID
63
73
  * @param collectionName - The name of the collection to get the document from
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brostark/solutions-client",
3
- "version": "1.1.13",
3
+ "version": "1.1.14",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -67,6 +67,18 @@ export const generateSearchAPI = (apiUrl: string, apiKey: string) => {
67
67
  return response.data;
68
68
  },
69
69
 
70
+ /**
71
+ * Deletes multiple documents from a search collection
72
+ * @param collectionName - The name of the collection to delete the documents from
73
+ * @param documentIds - The IDs of the documents to delete
74
+ * @returns A promise with the deleted documents
75
+ */
76
+ deleteMultipleDocuments: async (collectionName: string, documentIds: string[]) => {
77
+ const response = await httpPostRequest(`${apiUrl}/search/collections/${collectionName}/documents/delete`, apiKey, { documentIds });
78
+
79
+ return response.data;
80
+ },
81
+
70
82
  /**
71
83
  * Gets a document from a search collection by its ID
72
84
  * @param collectionName - The name of the collection to get the document from