175 lines
4.4 KiB
TypeScript
175 lines
4.4 KiB
TypeScript
// Metro module 10347 (f10348).
|
|
import ThemeStore from "../user_settings/ThemeStore";
|
|
import { DebugLogCategory, Endpoints } from "../../Constants";
|
|
import { HTTP } from "../../_bundle/sendRequest";
|
|
import { intl, t } from "../../intl/index.native";
|
|
import { uploadDebugLogFiles } from "../debug/DebugUploadManager";
|
|
import { isIOS } from "../../utils/PlatformUtils";
|
|
import TrackedHTTPUtils from "../../utils/TrackedHTTPUtils";
|
|
import { NetworkActionNames } from "../../_bundle/Module503";
|
|
export async function fetchBugReportConfig() {
|
|
return (await HTTP.get({
|
|
url: Endpoints.BUG_REPORTS,
|
|
rejectWithError: false
|
|
})).body;
|
|
}
|
|
export function getFeatureId(a0) {
|
|
let r5 = a0?.name;
|
|
if (r5 == null) {
|
|
r5 = "";
|
|
}
|
|
let r4 = a0?.squad;
|
|
if (r4 == null) {
|
|
r4 = "";
|
|
}
|
|
return r5 === "" && r4 === "" ? "" : r5 + "::" + r4;
|
|
}
|
|
export function getPriorities() {
|
|
return [{
|
|
title: intl.string(t.VwIij9),
|
|
description: intl.format(t.DOP8yY, {}),
|
|
emoji: "801497159479722084",
|
|
value: 0
|
|
}, {
|
|
title: intl.string(t.rYfJop),
|
|
description: intl.format(t["+LEfDL"], {}),
|
|
emoji: "410336837563973632",
|
|
value: 1
|
|
}, {
|
|
title: intl.string(t["9LSuy3"]),
|
|
description: intl.format(t.nC7pvx, {}),
|
|
emoji: "841420679643529296",
|
|
value: 2
|
|
}, {
|
|
title: intl.string(t.Ia0ska),
|
|
description: intl.format(t.D4rbgX, {}),
|
|
emoji: "827645852352512021",
|
|
value: 3
|
|
}];
|
|
}
|
|
export async function submitReport(c26660_0, c26660_1, attachments) {
|
|
let r29;
|
|
let value;
|
|
let c26660_6 = 0;
|
|
try {
|
|
const fields = [{
|
|
name: "name",
|
|
value: c26660_0.name
|
|
}, {
|
|
name: "priority",
|
|
value: `${c26660_0.priority}`
|
|
}, {
|
|
name: "override_platform_information",
|
|
value: `${c26660_1.overridePlatformInformation}`
|
|
}, {
|
|
name: "theme",
|
|
value: ThemeStore.theme
|
|
}];
|
|
if (c26660_0.description !== "") {
|
|
fields.push({
|
|
name: "description",
|
|
value: c26660_0.description
|
|
});
|
|
}
|
|
if (c26660_0.url !== "") {
|
|
fields.push({
|
|
name: "external_url",
|
|
value: c26660_0.url
|
|
});
|
|
}
|
|
if (c26660_0.buildOverride != null) {
|
|
fields.push({
|
|
name: "build_override",
|
|
value: c26660_0.buildOverride
|
|
});
|
|
}
|
|
if (c26660_0.experimentOverrides != null) {
|
|
fields.push({
|
|
name: "experiment_overrides",
|
|
value: c26660_0.experimentOverrides.map((experimentOverride) => `${experimentOverride.experimentId}:${experimentOverride.variantId}`).join(", ")
|
|
});
|
|
}
|
|
const asana_inbox_id = c26660_0.feature?.asana_inbox_id;
|
|
if (asana_inbox_id != null && asana_inbox_id !== "") {
|
|
fields.push({
|
|
name: "asana_inbox_id",
|
|
value: `${asana_inbox_id}`
|
|
});
|
|
}
|
|
const name = c26660_0.feature?.name;
|
|
if (name != null && name !== "") {
|
|
fields.push({
|
|
name: "feature_name",
|
|
value: name
|
|
});
|
|
}
|
|
if (c26660_1.overridePlatformInformation) {
|
|
fields.push({
|
|
name: "device",
|
|
value: c26660_1.device
|
|
});
|
|
fields.push({
|
|
name: "os",
|
|
value: c26660_1.operatingSystem
|
|
});
|
|
fields.push({
|
|
name: "os_version",
|
|
value: c26660_1.operatingSystemVersion
|
|
});
|
|
fields.push({
|
|
name: "client_version",
|
|
value: c26660_1.clientVersion
|
|
});
|
|
fields.push({
|
|
name: "client_build_number",
|
|
value: c26660_1.clientBuildNumber
|
|
});
|
|
fields.push({
|
|
name: "release_channel",
|
|
value: window.GLOBAL_ENV.RELEASE_CHANNEL
|
|
});
|
|
fields.push({
|
|
name: "locale",
|
|
value: c26660_1.locale
|
|
});
|
|
}
|
|
uploadDebugLogFiles(isIOS() ? DebugLogCategory.IOS_APP : DebugLogCategory.ANDROID_APP);
|
|
c26660_6 = 1;
|
|
r29 = await TrackedHTTPUtils.post({
|
|
url: Endpoints.BUG_REPORTS,
|
|
attachments,
|
|
fields,
|
|
trackedActionData: {
|
|
event: NetworkActionNames.BUG_REPORT_SUBMIT,
|
|
properties: {
|
|
priority: c26660_0.priority,
|
|
asana_inbox_id
|
|
}
|
|
},
|
|
rejectWithError: false
|
|
});
|
|
c26660_6 = 0;
|
|
} catch ($e) {
|
|
const r33 = $e;
|
|
let r8 = r33;
|
|
value = r33;
|
|
if (c26660_6 !== 0) {
|
|
while (true) {
|
|
try {
|
|
c26660_6 = 0;
|
|
} catch (r168) {
|
|
r8 = r168;
|
|
value = r168;
|
|
if (c26660_6 === 0) {
|
|
break;
|
|
}
|
|
continue;
|
|
}
|
|
return value;
|
|
}
|
|
}
|
|
throw r8;
|
|
}
|
|
return r29;
|
|
}
|