decord/alpha/source/lib/uploader/native/CloudUploaderUtils.tsx

61 lines
2.2 KiB
TypeScript
Raw Permalink Normal View History

2026-10-12 06:59:38 +00:00
// Module ID: 7789
// Function ID: 7790
// Name: CloudUploaderUtils
2026-10-12 06:59:38 +00:00
// Dependencies: [2129, 502, 1370, 7760, 12, 1265, 2]
2026-07-20 16:05:17 +00:00
// Exports: getUploadPayload, prepareMessagePayload
2026-10-12 06:59:38 +00:00
// Module 7789 (CloudUploaderUtils)
import _modDef12 from "module_12" /* 12 */;
2026-10-09 10:00:15 +00:00
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1265 */;
2026-10-12 06:59:38 +00:00
import UploadUtils from "UploadUtils" /* 7760 */;
2026-10-10 08:08:14 +00:00
import LocaleStore from "LocaleStore" /* 2129 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
2026-10-09 10:00:15 +00:00
import DeveloperOptionsStore from "DeveloperOptionsStore" /* 1370 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
function getUploadPayload(self) {
2026-10-03 08:58:59 +00:00
let obj2;
2026-10-12 06:59:38 +00:00
const obj = { filename: self.filename, file_size: self.currentSize, id: obj2.uniqueId(), original_content_type: "a" };
2026-10-03 08:58:59 +00:00
obj2 = _modDef12;
2026-07-29 08:29:29 +00:00
return obj;
}
let result = size.fileFinishedImporting("lib/uploader/native/CloudUploaderUtils.tsx");
2026-07-29 08:29:29 +00:00
export default { getUploadPayload };
export const prepareMessagePayload = function prepareMessagePayload(Authorization, arr, arg2, arg3) {
2026-07-20 16:05:17 +00:00
const items = [];
const item = arr.forEach((item, index) => {
2026-10-03 08:58:59 +00:00
const push = items.push;
const obj = UploadUtils;
const obj2 = {};
const merged = Object.assign(obj.getAttachmentPayload(item, index));
push(obj2);
2026-07-20 16:05:17 +00:00
});
2026-07-29 08:29:29 +00:00
if (null != arg3) {
2026-10-03 08:58:59 +00:00
let result;
2026-07-29 08:29:29 +00:00
if (null != arg2) {
2026-10-03 08:58:59 +00:00
let obj = {};
2026-07-29 08:29:29 +00:00
let merged = Object.assign(arg2);
2026-07-20 16:05:17 +00:00
const items1 = [];
2026-10-03 08:58:59 +00:00
const obj3 = _modDef12;
HermesBuiltin.arraySpread(items1, items, HermesBuiltin.arraySpread(items1, obj3.get(obj, arg3, []), 0));
const obj4 = _modDef12;
result = obj4.set(obj, arg3, items1);
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
let obj2 = { Authorization, "X-Debug-Options": DeveloperOptionsStore.getDebugOptionsHeaderValue(), "Accept-Language": LocaleStore.locale };
const obj6 = AnalyticsUtilsDefault;
const superPropertiesBase64 = obj6.getSuperPropertiesBase64();
2026-07-29 08:29:29 +00:00
if (null != superPropertiesBase64) {
obj2["X-Super-Properties"] = superPropertiesBase64;
2026-07-29 08:29:29 +00:00
}
const fingerprint = AuthenticationStore.getFingerprint();
2026-07-29 08:29:29 +00:00
if (null != fingerprint) {
obj2["X-Fingerprint"] = fingerprint;
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
return { headers: obj2, body: result };
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
result = { attachments: items };
2026-07-29 08:29:29 +00:00
const merged1 = Object.assign(arg2);
2026-07-20 16:05:17 +00:00
};
export { getUploadPayload };