@brostark/solutions-client 1.1.22 → 1.1.23

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.
@@ -1,3 +1,4 @@
1
+ import { ListOptions } from "../../lib/types";
1
2
  /**
2
3
  * Generates an API to manage media
3
4
  * @param apiUrl - The API URL
@@ -17,5 +18,11 @@ export declare const generateMediaAPI: (apiUrl: string, apiKey: string) => {
17
18
  * @returns A promise with the deleted media
18
19
  */
19
20
  delete: (filename: string) => Promise<any>;
21
+ /**
22
+ * Lists the media
23
+ * @param options - The pagination options
24
+ * @returns A promise with the list of media
25
+ */
26
+ list: (options?: ListOptions) => Promise<any>;
20
27
  };
21
28
  //# sourceMappingURL=media.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../src/api/v1/media.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,EAAE,QAAQ,MAAM;IAE3D;;;;OAIG;mBACkB,IAAI,YAAY,MAAM;IAM3C;;;;OAIG;uBACsB,MAAM;CAMlC,CAAA"}
1
+ {"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../src/api/v1/media.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,EAAE,QAAQ,MAAM;IAE3D;;;;OAIG;mBACkB,IAAI,YAAY,MAAM;IAM3C;;;;OAIG;uBACsB,MAAM;IAM/B;;;;OAIG;qBACmB,WAAW;CAMpC,CAAA"}
@@ -28,6 +28,15 @@ const generateMediaAPI = (apiUrl, apiKey) => {
28
28
  const response = await (0, httpRequest_1.httpDeleteRequest)(`${apiUrl}/media/${filename}`, apiKey);
29
29
  return response;
30
30
  },
31
+ /**
32
+ * Lists the media
33
+ * @param options - The pagination options
34
+ * @returns A promise with the list of media
35
+ */
36
+ list: async (options = {}) => {
37
+ const response = await (0, httpRequest_1.httpListRequest)(`${apiUrl}/media`, apiKey, options);
38
+ return response;
39
+ },
31
40
  };
32
41
  };
33
42
  exports.generateMediaAPI = generateMediaAPI;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brostark/solutions-client",
3
- "version": "1.1.22",
3
+ "version": "1.1.23",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -1,4 +1,5 @@
1
- import { httpDeleteRequest, httpUploadRequest } from "../../lib/httpRequest";
1
+ import { httpDeleteRequest, httpListRequest, httpUploadRequest } from "../../lib/httpRequest";
2
+ import { ListOptions } from "../../lib/types";
2
3
 
3
4
 
4
5
  /**
@@ -30,5 +31,16 @@ export const generateMediaAPI = (apiUrl: string, apiKey: string) => {
30
31
 
31
32
  return response;
32
33
  },
34
+
35
+ /**
36
+ * Lists the media
37
+ * @param options - The pagination options
38
+ * @returns A promise with the list of media
39
+ */
40
+ list: async (options: ListOptions = {}) => {
41
+ const response = await httpListRequest(`${apiUrl}/media`, apiKey, options);
42
+
43
+ return response;
44
+ },
33
45
  }
34
46
  }