decord/source/modules/user_identifiers/native/IOSUserIdentifiersManager.tsx

234 lines
7.7 KiB
TypeScript
Raw Normal View History

// Module ID: 17520
// Function ID: 17521
// Name: IOSUserIdentifiersManager
// Dependencies: [5, 17, 1371, 1074, 7221, 1363, 17521, 1270, 1230, 1240, 2]
2026-07-20 16:05:17 +00:00
// Module 17520 (IOSUserIdentifiersManager)
import SentryUtilsDefault from "SentryUtils" /* 1230 */;
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1240 */;
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
import UserStore from "UserStore" /* 1371 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 7221 */;
2026-07-23 10:11:24 +00:00
let require = fn;
const NativeModules = fn(17).NativeModules;
const AnalyticEvents = fn(1074).AnalyticEvents;
2026-08-27 16:17:25 +00:00
let closure_7 = { APP_TRANSACTION_UNAVAILABLE: "native_unavailable", APP_TRANSACTION_CANCELLED: "native_cancelled", APP_TRANSACTION_NETWORK_ERROR: "native_network", APP_TRANSACTION_ERROR: "native_error" };
2026-07-29 08:29:29 +00:00
class IOSUserIdentifiersManager extends tmp2 {
constructor() {
applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
closure_0 = applyArgumentsResult;
2026-08-27 16:17:25 +00:00
set = new Set();
applyArgumentsResult.syncedUserIds = set;
2026-07-29 08:29:29 +00:00
applyArgumentsResult.actions = {
POST_CONNECTION_OPEN() {
return applyArgumentsResult.onPostConnectionOpen();
}
};
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
const prototype = IOSUserIdentifiersManager.prototype;
prototype["onPostConnectionOpen"] = function onPostConnectionOpen() {
const self = this;
return (async (arg0, value) => {
if (v3 === 2) {
v3 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
2026-07-29 08:29:29 +00:00
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
const obj2 = { value, done: true };
return obj2;
2026-07-29 08:29:29 +00:00
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
v3 = 2;
2026-07-29 08:29:29 +00:00
if (0 === c1) {
if (arg0 === 1) {
v3 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
v3 = 3;
const obj4 = { value, done: true };
return obj4;
2026-07-29 08:29:29 +00:00
} else {
2026-08-27 16:17:25 +00:00
if (obj7.isIOS()) {
if (tmp14Result.isIOSAppTransactionIdTrackingEnabled("IOSUserIdentifiersManager")) {
currentUser = currentUser.getCurrentUser();
2026-07-29 08:29:29 +00:00
if (null != currentUser) {
const syncedUserIds = self.syncedUserIds;
2026-08-27 16:17:25 +00:00
if (!syncedUserIds.has(currentUser.id)) {
const syncedUserIds2 = obj3.syncedUserIds;
syncedUserIds2.add(currentUser.id);
c1 = 1;
v3 = 1;
const obj5 = { value: obj3.syncAppTransactionId(), done: false };
return obj5;
2026-08-27 16:17:25 +00:00
}
2026-07-29 08:29:29 +00:00
}
}
tmp14Result = tmp14(tmp15[6]);
2026-07-29 08:29:29 +00:00
}
obj7 = v3(dependencyMap[5]);
tmp14 = v3;
tmp15 = dependencyMap;
2026-07-29 08:29:29 +00:00
}
} else if (arg0 === 1) {
v3 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
v3 = 3;
const obj = { value, done: true };
2026-07-29 08:29:29 +00:00
return obj;
}
v3 = 3;
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
} catch (tmp9) {
v3 = tmp;
2026-07-29 08:29:29 +00:00
throw tmp9;
}
}
})();
};
2026-08-27 16:17:25 +00:00
prototype["syncAppTransactionId"] = function syncAppTransactionId() {
const self = this;
return (async (arg0, value) => {
2026-08-27 16:17:25 +00:00
if (c5 === 2) {
2026-08-24 06:08:38 +00:00
c5 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
2026-08-27 16:17:25 +00:00
} else if (tmp6 === 3) {
2026-07-29 08:29:29 +00:00
if (arg0 === 1) {
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
const obj2 = { value, done: true };
return obj2;
2026-07-29 08:29:29 +00:00
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-08-27 16:17:25 +00:00
}
} else {
try {
c5 = 2;
if (0 === c4) {
2026-08-27 16:17:25 +00:00
if (arg0 === 1) {
c5 = 3;
throw value;
2026-08-27 16:17:25 +00:00
} else if (arg0 === 2) {
c5 = 3;
const obj3 = { value, done: true };
return obj3;
2026-08-27 16:17:25 +00:00
} else {
closure_1 = tmp3;
_self = tmp7;
let appTransactionId;
let verified;
closure_128_2 = undefined;
2026-08-27 16:17:25 +00:00
c3 = 1;
const DCDAppTransactionManager = c4.DCDAppTransactionManager;
c4 = 2;
2026-08-27 16:17:25 +00:00
c5 = 1;
const obj4 = { value: DCDAppTransactionManager.getAppTransactionId(), done: false };
return obj4;
2026-08-27 16:17:25 +00:00
}
} else if (1 === tmp7) {
c3 = 0;
closure_128_3 = tmp41;
closure_129_0.trackSync((function getNativeReason(code) {
code = undefined;
if (code != null) {
code = code.code;
2026-08-04 21:03:28 +00:00
}
2026-08-27 16:17:25 +00:00
let str = "native_error";
if (typeof code === "string") {
let str2 = closure_1_7[code];
2026-08-27 16:17:25 +00:00
if (str2 == null) {
str2 = "native_error";
}
str = str2;
}
return str;
})(closure_128_3), closure_128_3);
2026-08-27 16:17:25 +00:00
c5 = 3;
const obj5 = { value: undefined, done: true };
return obj5;
2026-08-27 16:17:25 +00:00
} else {
if (2 === tmp7) {
if (arg0 === 1) {
c5 = 3;
throw value;
2026-08-27 16:17:25 +00:00
} else if (arg0 === 2) {
2026-07-29 08:29:29 +00:00
c3 = 0;
c5 = 3;
const obj6 = { value, done: true };
return obj6;
2026-08-04 21:03:28 +00:00
} else {
closure_128_2 = value;
appTransactionId = closure_128_2.appTransactionId;
verified = closure_128_2.verified;
2026-08-27 16:17:25 +00:00
c3 = 0;
if (null != appTransactionId) {
if ("" !== appTransactionId) {
c3 = 2;
const HTTP = _self(tmp41[7]).HTTP;
const request = { url: "/users/@me/app-transaction-ids", body: null, rejectWithError: true };
const obj7 = { app_transaction_id: appTransactionId };
request.body = obj7;
c4 = 4;
2026-08-27 16:17:25 +00:00
c5 = 1;
const obj8 = { value: HTTP.post(request), done: false };
return obj8;
2026-08-27 16:17:25 +00:00
}
}
closure_129_0.trackSync("empty_id", null, verified);
2026-08-27 16:17:25 +00:00
c5 = 3;
2026-07-29 08:29:29 +00:00
}
2026-08-27 16:17:25 +00:00
} else if (3 === tmp7) {
c3 = 0;
closure_128_4 = tmp41;
closure_129_0.trackSync("http_error", closure_128_4, verified);
2026-08-27 16:17:25 +00:00
c5 = 3;
const obj9 = { value: undefined, done: true };
return obj9;
2026-08-27 16:17:25 +00:00
} else if (arg0 === 1) {
c5 = 3;
throw value;
2026-08-27 16:17:25 +00:00
} else if (arg0 !== 2) {
c3 = 0;
closure_129_0.trackSync("synced", null, verified);
2026-07-29 08:29:29 +00:00
}
2026-08-27 16:17:25 +00:00
c3 = 0;
c5 = 3;
const obj = { value, done: true };
2026-08-27 16:17:25 +00:00
return obj;
}
} catch (tmp41) {
if (tmp4 === c3) {
c5 = tmp2;
throw tmp41;
} else if (tmp === tmp43) {
c4 = tmp;
2026-08-27 16:17:25 +00:00
} else {
c4 = tmp2;
2026-07-29 08:29:29 +00:00
}
}
}
})();
};
prototype["trackSync"] = function trackSync(empty_id, arg1, verified) {
if (null != arg1) {
const obj2 = { tags: null };
const obj3 = { source: "ios_user_identifiers_manager", step: "sync_app_transaction_id", reason: empty_id };
obj2.tags = obj3;
SentryUtilsDefault.captureException(arg1, obj2);
2026-08-27 16:17:25 +00:00
}
AnalyticsUtilsDefault.track(AnalyticEvents.APP_TRANSACTION_ID_SYNCED, { success: "synced" === empty_id, reason: empty_id, verified });
2026-08-27 16:17:25 +00:00
};
2026-07-29 08:29:29 +00:00
const iOSUserIdentifiersManager = new IOSUserIdentifiersManager();
const size = fn(2);
const result = size.fileFinishedImporting("modules/user_identifiers/native/IOSUserIdentifiersManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default iOSUserIdentifiersManager;