@churchapps/apphelper 0.3.32 → 0.3.33
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,5 +1,5 @@
|
|
|
1
1
|
export declare class FileHelper {
|
|
2
|
-
static postPresignedFile: (presigned: any, uploadedFile: File, progressCallback: (percent: number) => void
|
|
2
|
+
static postPresignedFile: (presigned: any, uploadedFile: File, progressCallback: (percent: number) => void) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
3
3
|
static dataURLtoBlob(dataurl: string): Blob;
|
|
4
4
|
}
|
|
5
5
|
//# sourceMappingURL=FileHelper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileHelper.d.ts","sourceRoot":"","sources":["../../src/helpers/FileHelper.ts"],"names":[],"mappings":"AAEA,qBAAa,UAAU;
|
|
1
|
+
{"version":3,"file":"FileHelper.d.ts","sourceRoot":"","sources":["../../src/helpers/FileHelper.ts"],"names":[],"mappings":"AAEA,qBAAa,UAAU;IAErB,MAAM,CAAC,iBAAiB,cAAe,GAAG,gBAAgB,IAAI,8BAA8B,MAAM,KAAK,IAAI,sDAgBzG;IAEF,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM;CAQrC"}
|
|
@@ -15,8 +15,7 @@ class FileHelper {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
exports.FileHelper = FileHelper;
|
|
18
|
-
FileHelper.postPresignedFile = (presigned, uploadedFile, progressCallback
|
|
19
|
-
const axiosToUse = axiosInstance || axios_1.default;
|
|
18
|
+
FileHelper.postPresignedFile = (presigned, uploadedFile, progressCallback) => {
|
|
20
19
|
const formData = new FormData();
|
|
21
20
|
//formData.append("key", presigned.key); //no longer needed with new aws sdk
|
|
22
21
|
formData.append("acl", "public-read");
|
|
@@ -30,9 +29,6 @@ FileHelper.postPresignedFile = (presigned, uploadedFile, progressCallback, axios
|
|
|
30
29
|
progressCallback(Math.round((100 * data.loaded) / data.total));
|
|
31
30
|
}
|
|
32
31
|
};
|
|
33
|
-
|
|
34
|
-
console.log("axios: ", axiosToUse);
|
|
35
|
-
console.log("axios tyeof: ", typeof axiosToUse.post);
|
|
36
|
-
return axiosToUse.post(presigned.url, formData, axiosConfig);
|
|
32
|
+
return axios_1.default.post(presigned.url, formData, axiosConfig);
|
|
37
33
|
};
|
|
38
34
|
//# sourceMappingURL=FileHelper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileHelper.js","sourceRoot":"","sources":["../../src/helpers/FileHelper.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,MAAa,UAAU;
|
|
1
|
+
{"version":3,"file":"FileHelper.js","sourceRoot":"","sources":["../../src/helpers/FileHelper.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,MAAa,UAAU;IAoBrB,MAAM,CAAC,aAAa,CAAC,OAAe;QAClC,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAC7D,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;QAClE,OAAO,CAAC,EAAE,EAAE;YACV,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;SAC/B;QACD,OAAO,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3C,CAAC;;AA3BH,gCA4BC;AA1BQ,4BAAiB,GAAG,CAAC,SAAc,EAAE,YAAkB,EAAE,gBAA2C,EAAE,EAAE;IAC7G,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;IAChC,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IACtC,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IACnD,KAAK,MAAM,QAAQ,IAAI,SAAS,CAAC,MAAM;QAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/F,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAEtC,MAAM,WAAW,GAAG;QAClB,OAAO,EAAE,EAAE,cAAc,EAAE,qBAAqB,EAAE;QAClD,gBAAgB,EAAE,CAAC,IAAS,EAAE,EAAE;YAC9B,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACjE,CAAC;KACF,CAAC;IAEF,OAAO,eAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AAC1D,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@churchapps/apphelper",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.33",
|
|
4
4
|
"description": "Library of helper functions for React and NextJS ChurchApps",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"react-router-dom": "^6.15.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@churchapps/helpers": "^1.0.
|
|
40
|
+
"@churchapps/helpers": "^1.0.36",
|
|
41
41
|
"@emotion/cache": "^11.11.0",
|
|
42
42
|
"@emotion/react": "^11.11.1",
|
|
43
43
|
"@emotion/styled": "^11.11.0",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
|
|
3
3
|
export class FileHelper {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
|
|
5
|
+
static postPresignedFile = (presigned: any, uploadedFile: File, progressCallback: (percent: number) => void) => {
|
|
6
6
|
const formData = new FormData();
|
|
7
7
|
//formData.append("key", presigned.key); //no longer needed with new aws sdk
|
|
8
8
|
formData.append("acl", "public-read");
|
|
@@ -17,10 +17,7 @@ export class FileHelper {
|
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
console.log("axios: ", axiosToUse);
|
|
22
|
-
console.log("axios tyeof: ", typeof axiosToUse.post);
|
|
23
|
-
return axiosToUse.post(presigned.url, formData, axiosConfig);
|
|
20
|
+
return axios.post(presigned.url, formData, axiosConfig);
|
|
24
21
|
};
|
|
25
22
|
|
|
26
23
|
static dataURLtoBlob(dataurl: string) {
|