decord/source/modules/auth_sessions/AuthSessionsActionCreators.tsx

162 lines
4.9 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 14374
// Function ID: 14375
2026-07-20 16:05:17 +00:00
// Name: _fetchAuthSessions
2026-07-29 08:29:29 +00:00
// Dependencies: [5, 676, 530, 709, 2]
2026-07-20 16:05:17 +00:00
// Exports: clearAuthSessions, fetchAuthSessions, logOutSessions
2026-08-24 06:08:38 +00:00
// Module 14374 (_fetchAuthSessions)
import dispatcherDefault from "dispatcher" /* 709 */;
import closure_3 from "asyncGeneratorStep" /* 5 */;
import { Endpoints } from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function _fetchAuthSessions() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback(function*() {
2026-08-04 21:03:28 +00:00
const callback = tmp2;
2026-08-24 06:08:38 +00:00
closure_0 = tmp5;
const HTTP = closure_1_0(530).HTTP;
obj1 = { url: null, rejectWithError: false };
obj1[0] = closure_1_4.AUTH_SESSIONS;
2026-08-04 21:03:28 +00:00
closure_0 = yield HTTP.get(obj1);
2026-08-14 17:33:39 +00:00
const body = closure_0.body;
if (body != null) {
const user_sessions = body.user_sessions;
2026-08-04 21:03:28 +00:00
}
2026-08-14 17:33:39 +00:00
if (null != user_sessions) {
2026-08-04 21:03:28 +00:00
const obj = callback(709);
const obj4 = { type: "FETCH_AUTH_SESSIONS_SUCCESS", sessions: null };
obj4[1] = closure_0.body.user_sessions;
obj.dispatch(obj4);
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
return closure_0;
2026-07-29 08:29:29 +00:00
});
2026-08-24 06:08:38 +00:00
closure_5 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _logOutSessions() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c3 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0) {
if (constants === 2) {
constants = 3;
HermesBuiltin.throwTypeError();
} else if (tmp5 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
constants = 2;
let num2 = 0;
if (0 === c3) {
if (arg0 === 1) {
constants = 3;
throw arg1;
} else if (arg0 === 2) {
constants = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
const table = tmp3;
2026-08-14 17:33:39 +00:00
let callback2 = tmp2;
2026-07-29 08:29:29 +00:00
let HTTP;
2026-08-14 17:33:39 +00:00
callback2 = undefined;
2026-07-29 08:29:29 +00:00
const _Array = Array;
if (Array.isArray(items)) {
items = arr2;
if (num2 === arr2.length) {
constants = 3;
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
items = [arr2];
}
2026-08-24 06:08:38 +00:00
HTTP = callback(closure_1_2[2]).HTTP;
2026-07-29 08:29:29 +00:00
num2 = HTTP.post;
2026-08-24 06:08:38 +00:00
obj1 = { url: null, body: null, rejectWithError: false };
2026-07-29 08:29:29 +00:00
obj1[0] = constants.AUTH_SESSIONS_LOGOUT;
const obj2 = { session_id_hashes: null };
obj2[0] = items;
obj1[1] = obj2;
num2(obj1);
c3 = 1;
constants = 1;
}
} else if (arg0 === 1) {
constants = 3;
throw arg1;
} else if (arg0 === 2) {
constants = 3;
const obj3 = { value: null, done: true };
obj3[0] = arg1;
return obj3;
} else {
2026-08-14 17:33:39 +00:00
callback2 = arg1;
obj = callback2(table[3]);
const obj4 = { type: "LOGOUT_AUTH_SESSIONS_SUCCESS", sessionIdHashes: null };
obj4[1] = items;
obj.dispatch(obj4);
2026-07-29 08:29:29 +00:00
constants = 3;
const obj5 = { value: null, done: true };
2026-08-14 17:33:39 +00:00
obj5[0] = callback2;
2026-07-29 08:29:29 +00:00
return obj5;
}
2026-08-14 17:33:39 +00:00
} catch (tmp18) {
2026-07-29 08:29:29 +00:00
constants = tmp;
2026-08-14 17:33:39 +00:00
throw tmp18;
2026-07-29 08:29:29 +00:00
}
}
})();
});
2026-08-24 06:08:38 +00:00
closure_6 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/auth_sessions/AuthSessionsActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export const fetchAuthSessions = function fetchAuthSessions() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _fetchAuthSessions.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};
export const clearAuthSessions = function clearAuthSessions() {
2026-08-24 06:08:38 +00:00
dispatcherDefault.dispatch({ type: "FETCH_AUTH_SESSIONS_SUCCESS", sessions: [] });
2026-07-20 16:05:17 +00:00
};
export const logOutSessions = function logOutSessions(id_hash) {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _logOutSessions.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};