@amityco/ts-sdk 7.33.1-c82094c.0 → 7.33.1-ed90356d.0
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.
|
@@ -9,10 +9,11 @@
|
|
|
9
9
|
* @param formData The data necessary to create a new {@link Amity.File<'image'>}
|
|
10
10
|
* @param onProgress The callback to track the upload progress
|
|
11
11
|
* @param altText The alt text for the image
|
|
12
|
+
* @param isFullImage Keeps the original image so `size=full` returns it instead of the large copy
|
|
12
13
|
* @returns The newly created {@link Amity.File<'image'>}
|
|
13
14
|
*
|
|
14
15
|
* @category File API
|
|
15
16
|
* @async
|
|
16
17
|
*/
|
|
17
|
-
export declare const uploadImage: (formData: FormData, onProgress?: ((percent: number) => void) | undefined, altText?: string) => Promise<Amity.Cached<Amity.File<'image'>[]>>;
|
|
18
|
+
export declare const uploadImage: (formData: FormData, onProgress?: ((percent: number) => void) | undefined, altText?: string, isFullImage?: boolean) => Promise<Amity.Cached<Amity.File<'image'>[]>>;
|
|
18
19
|
//# sourceMappingURL=uploadImage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploadImage.d.ts","sourceRoot":"","sources":["../../../src/fileRepository/api/uploadImage.ts"],"names":[],"mappings":"AASA
|
|
1
|
+
{"version":3,"file":"uploadImage.d.ts","sourceRoot":"","sources":["../../../src/fileRepository/api/uploadImage.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;GAgBG;AAEH,eAAO,MAAM,WAAW,aACZ,QAAQ,0BACK,MAAM,KAAK,IAAI,yBAC5B,MAAM,gBACF,OAAO,KACpB,QAAQ,MAAM,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,CA4D7C,CAAC"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -17628,12 +17628,13 @@ const uploadVideo = async (formData, feedType, onProgress) => {
|
|
|
17628
17628
|
* @param formData The data necessary to create a new {@link Amity.File<'image'>}
|
|
17629
17629
|
* @param onProgress The callback to track the upload progress
|
|
17630
17630
|
* @param altText The alt text for the image
|
|
17631
|
+
* @param isFullImage Keeps the original image so `size=full` returns it instead of the large copy
|
|
17631
17632
|
* @returns The newly created {@link Amity.File<'image'>}
|
|
17632
17633
|
*
|
|
17633
17634
|
* @category File API
|
|
17634
17635
|
* @async
|
|
17635
17636
|
*/
|
|
17636
|
-
const uploadImage = async (formData, onProgress, altText) => {
|
|
17637
|
+
const uploadImage = async (formData, onProgress, altText, isFullImage) => {
|
|
17637
17638
|
const client = getActiveClient();
|
|
17638
17639
|
client.log('file/uploadImage', formData);
|
|
17639
17640
|
const files = formData.getAll('files');
|
|
@@ -17654,6 +17655,10 @@ const uploadImage = async (formData, onProgress, altText) => {
|
|
|
17654
17655
|
}
|
|
17655
17656
|
const accessType = GlobalFileAccessType$1.getInstance().getFileAccessType();
|
|
17656
17657
|
formData.append('accessType', accessType);
|
|
17658
|
+
// skip if the caller already appended it, so the old FormData workaround keeps working
|
|
17659
|
+
if (isFullImage && !formData.getAll('fullImage').length) {
|
|
17660
|
+
formData.append('fullImage', 'true');
|
|
17661
|
+
}
|
|
17657
17662
|
const headers = 'getHeaders' in formData
|
|
17658
17663
|
? formData.getHeaders()
|
|
17659
17664
|
: { 'content-type': 'multipart/form-data' };
|
package/dist/index.esm.js
CHANGED
|
@@ -17628,12 +17628,13 @@ const uploadVideo = async (formData, feedType, onProgress) => {
|
|
|
17628
17628
|
* @param formData The data necessary to create a new {@link Amity.File<'image'>}
|
|
17629
17629
|
* @param onProgress The callback to track the upload progress
|
|
17630
17630
|
* @param altText The alt text for the image
|
|
17631
|
+
* @param isFullImage Keeps the original image so `size=full` returns it instead of the large copy
|
|
17631
17632
|
* @returns The newly created {@link Amity.File<'image'>}
|
|
17632
17633
|
*
|
|
17633
17634
|
* @category File API
|
|
17634
17635
|
* @async
|
|
17635
17636
|
*/
|
|
17636
|
-
const uploadImage = async (formData, onProgress, altText) => {
|
|
17637
|
+
const uploadImage = async (formData, onProgress, altText, isFullImage) => {
|
|
17637
17638
|
const client = getActiveClient();
|
|
17638
17639
|
client.log('file/uploadImage', formData);
|
|
17639
17640
|
const files = formData.getAll('files');
|
|
@@ -17654,6 +17655,10 @@ const uploadImage = async (formData, onProgress, altText) => {
|
|
|
17654
17655
|
}
|
|
17655
17656
|
const accessType = GlobalFileAccessType$1.getInstance().getFileAccessType();
|
|
17656
17657
|
formData.append('accessType', accessType);
|
|
17658
|
+
// skip if the caller already appended it, so the old FormData workaround keeps working
|
|
17659
|
+
if (isFullImage && !formData.getAll('fullImage').length) {
|
|
17660
|
+
formData.append('fullImage', 'true');
|
|
17661
|
+
}
|
|
17657
17662
|
const headers = 'getHeaders' in formData
|
|
17658
17663
|
? formData.getHeaders()
|
|
17659
17664
|
: { 'content-type': 'multipart/form-data' };
|