Files
discord-decomp/sources/modules/connections/ConnectionsRoleActionCreators.tsx
2026-07-28 01:06:53 +03:00

150 lines
9.2 KiB
TypeScript

/* Metro module 11374; source: modules/connections/ConnectionsRoleActionCreators.tsx; dependencies: [5, 661, 507, 694, 6738, 2] */
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
import Dispatcher from '../../Dispatcher.tsx'; /* Metro dependency 694 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as HTTPUtilsModule from '../../external/discord_common/js/packages/http-utils/HTTPUtils.tsx'; /* Metro dependency 507 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
function _fun87184(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#87184, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11560:6, offset: 0x01fb299f, size: 188 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/connections/ConnectionsRoleActionCreators.tsx');
exports.fetchRoleConnectionsConfiguration = fetchRoleConnectionsConfiguration;
exports.putRoleConnectionsConfigurations = function() {
return _putRoleConnectionsConfigurations.apply(this, arguments);
};
exports.fetchUserApplicationRoleConnections = function() {
return _fetchUserApplicationRoleConnections.apply(this, arguments);
};
function _putRoleConnectionsConfigurations() { // fn#87185, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11560:126, offset: 0x01fb2a5b, size: 50 bytes, params: 1, frame: 14
return Module00005(_fun87187).apply(this, arguments);
function* _fun87187(a0, a1, a2) { // fn#87187, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11560:215, offset: 0x01fb2a98, size: 329 bytes, params: 4, frame: 22
var value8;
if (true) {
value = a2.map(function(a0) {
return a0.map(_fun87189);
});
var HTTP = env2_0(env2_2[2]).HTTP;
var put = HTTP.put;
var object = {};
object.url = env2_4.GUILD_ROLE_CONNECTIONS_CONFIGURATION(a0, a1);
object.body = value.length !== 0 ? value : [];
object.oldFormErrors = true;
object.rejectWithError = false;
value = Reflect.apply(put, HTTP, [object]);
yield value.then(function(a0) {
return a0.body.length > 0 ? a0.body.map(_fun87191) : [];
});
value = undefined;
if (false) {
return value;
}
var value5 = env2_0(env2_2[4]);
yield value5.requestMembersForRole(a0, a1, false);
var value6 = undefined;
if (false) {
return value6;
}
if (value6 != null) {
value8 = env2_1(env2_2[3]);
value8.dispatch({type: 'GUILD_ROLE_MEMBER_COUNT_UPDATE', guildId: a0, roleId: a1, count: value6});
}
var value9 = env2_1(env2_2[3]);
value9.dispatch({type: 'GUILD_ROLE_CONNECTIONS_CONFIGURATIONS_FETCH_SUCCESS', roleId: a1,
roleConnectionConfigurations: value});
}
function _fun87188(a0) { // fn#87188, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11560:245, offset: 0x01fb2be1, size: 24 bytes, params: 2, frame: 11
return a0.map(function(a0) {
return {connection_type: a0.connectionType, connection_metadata_field: a0.connectionMetadataField,
application_id: a0.applicationId, operator: a0.operator, value: a0.value};
});
}
function _fun87190(a0) { // fn#87190, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11560:557, offset: 0x01fb2c34, size: 49 bytes, params: 2, frame: 12
return a0.body.length > 0 ? a0.body.map(function(a0) {
return a0.map(_fun87192);
}) : [];
function _fun87191(a0) { // fn#87191, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11560:609, offset: 0x01fb2c65, size: 24 bytes, params: 2, frame: 11
return a0.map(function(a0) {
return {connectionType: a0.connection_type, connectionMetadataField: a0.connection_metadata_field,
applicationId: a0.application_id, operator: a0.operator, value: a0.value};
});
}
}
}
}
function _fetchUserApplicationRoleConnections() { // fn#87193, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11560:1071, offset: 0x01fb2cb8, size: 50 bytes, params: 1, frame: 14
return Module00005(_fun87195).apply(this, arguments);
function* _fun87195() { // fn#87195, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11560:1166, offset: 0x01fb2cf5, size: 93 bytes, params: 1, frame: 13
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
const HTTP = env2_0(env2_2[2]).HTTP;
const get = HTTP.get;
const APPLICATION_USER_ROLE_CONNECTIONS = env2_4.APPLICATION_USER_ROLE_CONNECTIONS;
yield Reflect.apply(get, HTTP, [{url: APPLICATION_USER_ROLE_CONNECTIONS, rejectWithError: false}]);
value = undefined;
if (false) {
return value;
}
return value.body;
}
}
function fetchRoleConnectionsConfiguration(a0, a1) { // fn#87196, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11560:1425, offset: 0x01fb2d52, size: 117 bytes, params: 3, frame: 18
const env0_0 = a1;
const HTTP = (HTTPUtilsModule).HTTP;
const get = HTTP.get;
const object = {};
object.url = Endpoints.GUILD_ROLE_CONNECTIONS_CONFIGURATION(a0, a1);
object.rejectWithError = true;
let value = Reflect.apply(get, HTTP, [object]);
value = value.then(_fun87197);
value.catch(function() {
});
function _fun87197(a0) { // fn#87197, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11560:1566, offset: 0x01fb2dc7, size: 111 bytes, params: 2, frame: 14
var environment;
const r4 = a0.body.length > 0 ? a0.body.map(function(a0) {
return a0.map(_fun87199);
}) : [];
const value = environment.__proto__;
(Dispatcher).dispatch({type: 'GUILD_ROLE_CONNECTIONS_CONFIGURATIONS_FETCH_SUCCESS',
roleId: require, roleConnectionConfigurations: r4});
function _fun87198(a0) { // fn#87198, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11560:1611, offset: 0x01fb2e36, size: 24 bytes, params: 2, frame: 11
return a0.map(function(a0) {
return {connectionType: a0.connection_type, connectionMetadataField: a0.connection_metadata_field,
applicationId: a0.application_id, operator: a0.operator, value: a0.value};
});
}
}
}
}
function _fun87189({connectionType, connectionMetadataField, applicationId, operator, value}) { // fn#87189, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11560:255, offset: 0x01fb2bf9, size: 59 bytes, params: 2, frame: 3
return {connection_type: connectionType, connection_metadata_field: connectionMetadataField,
application_id: applicationId, operator: operator, value: value};
}
function _fun87192({connection_type, connection_metadata_field, application_id, operator, value}) { // fn#87192, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11560:619, offset: 0x01fb2c7d, size: 59 bytes, params: 2, frame: 3
return {connectionType: connection_type, connectionMetadataField: connection_metadata_field,
applicationId: application_id, operator: operator, value: value};
}
function _fun87199({connection_type, connection_metadata_field, application_id, operator, value}) { // fn#87199, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11560:1621, offset: 0x01fb2c7d, size: 59 bytes, params: 2, frame: 3
return {connectionType: connection_type, connectionMetadataField: connection_metadata_field,
applicationId: application_id, operator: operator, value: value};
}
global.__d(_fun87184, 11374, [5, 661, 507, 694, 6738,
2]) /* metro module 11374, dependencies: [5, 661, 507, 694, 6738, 2] */;