@brostark/solutions-client 1.1.20 → 1.1.21

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.
@@ -11,5 +11,11 @@ export declare const generateMediaAPI: (apiUrl: string, apiKey: string) => {
11
11
  * @returns A promise with information about the uploaded video (URL and path)
12
12
  */
13
13
  upload: (file: File, filename: string) => Promise<any>;
14
+ /**
15
+ * Deletes a media
16
+ * @param filename - The filename of the media to delete
17
+ * @returns A promise with the deleted media
18
+ */
19
+ delete: (filename: string) => Promise<any>;
14
20
  };
15
21
  //# 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;CAM9C,CAAA"}
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"}
@@ -19,6 +19,15 @@ const generateMediaAPI = (apiUrl, apiKey) => {
19
19
  const response = await (0, httpRequest_1.httpUploadRequest)(`${apiUrl}/media/${filename}`, apiKey, file);
20
20
  return response.data;
21
21
  },
22
+ /**
23
+ * Deletes a media
24
+ * @param filename - The filename of the media to delete
25
+ * @returns A promise with the deleted media
26
+ */
27
+ delete: async (filename) => {
28
+ const response = await (0, httpRequest_1.httpDeleteRequest)(`${apiUrl}/media/${filename}`, apiKey);
29
+ return response.data;
30
+ },
22
31
  };
23
32
  };
24
33
  exports.generateMediaAPI = generateMediaAPI;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brostark/solutions-client",
3
- "version": "1.1.20",
3
+ "version": "1.1.21",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -1,4 +1,4 @@
1
- import { httpUploadRequest } from "../../lib/httpRequest";
1
+ import { httpDeleteRequest, httpUploadRequest } from "../../lib/httpRequest";
2
2
 
3
3
 
4
4
  /**
@@ -19,5 +19,16 @@ export const generateMediaAPI = (apiUrl: string, apiKey: string) => {
19
19
 
20
20
  return response.data;
21
21
  },
22
+
23
+ /**
24
+ * Deletes a media
25
+ * @param filename - The filename of the media to delete
26
+ * @returns A promise with the deleted media
27
+ */
28
+ delete: async (filename: string) => {
29
+ const response = await httpDeleteRequest(`${apiUrl}/media/${filename}`, apiKey);
30
+
31
+ return response.data;
32
+ },
22
33
  }
23
34
  }