@brostark/solutions-client 1.1.10 → 1.1.12

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
+ * Gets a document from a search collection by its ID
43
+ * @param collectionName - The name of the collection to get the document from
44
+ * @param documentId - The ID of the document to get
45
+ * @returns A promise with the document
46
+ */
47
+ getDocumentById: (collectionName: string, documentId: string) => Promise<any>;
41
48
  /**
42
49
  * Searches for documents in a search collection
43
50
  * @param collectionName - The name of the collection to search in
@@ -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;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;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;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"}
@@ -57,6 +57,16 @@ const generateSearchAPI = (apiUrl, apiKey) => {
57
57
  const response = await (0, httpRequest_1.httpDeleteRequest)(`${apiUrl}/search/collections/${collectionName}/documents/${documentId}`, apiKey);
58
58
  return response.data;
59
59
  },
60
+ /**
61
+ * Gets a document from a search collection by its ID
62
+ * @param collectionName - The name of the collection to get the document from
63
+ * @param documentId - The ID of the document to get
64
+ * @returns A promise with the document
65
+ */
66
+ getDocumentById: async (collectionName, documentId) => {
67
+ const response = await (0, httpRequest_1.httpGetRequest)(`${apiUrl}/search/collections/${collectionName}/documents/${documentId}`, apiKey);
68
+ return response;
69
+ },
60
70
  /**
61
71
  * Searches for documents in a search collection
62
72
  * @param collectionName - The name of the collection to search in
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brostark/solutions-client",
3
- "version": "1.1.10",
3
+ "version": "1.1.12",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -66,6 +66,18 @@ export const generateSearchAPI = (apiUrl: string, apiKey: string) => {
66
66
  return response.data;
67
67
  },
68
68
 
69
+ /**
70
+ * Gets a document from a search collection by its ID
71
+ * @param collectionName - The name of the collection to get the document from
72
+ * @param documentId - The ID of the document to get
73
+ * @returns A promise with the document
74
+ */
75
+ getDocumentById: async (collectionName: string, documentId: string) => {
76
+ const response = await httpGetRequest(`${apiUrl}/search/collections/${collectionName}/documents/${documentId}`, apiKey);
77
+
78
+ return response;
79
+ },
80
+
69
81
  /**
70
82
  * Searches for documents in a search collection
71
83
  * @param collectionName - The name of the collection to search in