@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.
- package/dist/api/v1/media.d.ts +6 -0
- package/dist/api/v1/media.d.ts.map +1 -1
- package/dist/api/v1/media.js +9 -0
- package/package.json +1 -1
- package/src/api/v1/media.ts +12 -1
package/dist/api/v1/media.d.ts
CHANGED
|
@@ -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;
|
|
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"}
|
package/dist/api/v1/media.js
CHANGED
|
@@ -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
package/src/api/v1/media.ts
CHANGED
|
@@ -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
|
}
|