218 lines
9.4 KiB
TypeScript
218 lines
9.4 KiB
TypeScript
/* Metro module 13039; source: modules/rpc/server/commands/relationships.tsx; dependencies: [57, 3793, 1878, 4135, 661, 13026, 4122, 483, 8076, 8081, 2] */
|
|
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import UserStore from '../../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import RelationshipStore from '../../../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
|
|
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as BigFlagUtilsModule from '../../../../external/discord_common/js/shared/utils/BigFlagUtils.tsx'; /* Metro dependency 483 */
|
|
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as OAuth2ScopesModule from '../../../../external/discord_common/js/shared/shared-constants/OAuth2Scopes.tsx'; /* Metro dependency 4122 */
|
|
import * as ConstantsModule2 from '../../Constants.tsx'; /* Metro dependency 4135 */
|
|
|
|
function _fun99538(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99538, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13229:6, offset: 0x021cc6c3, size: 345 bytes, params: 8, frame: 25
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_99541 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const RPC_SCOPE_CONFIG = (ConstantsModule2).RPC_SCOPE_CONFIG;
|
|
let value = ConstantsModule;
|
|
const env0_7 = value.ApplicationFlags;
|
|
const env0_8 = value.RelationshipTypes;
|
|
const RPCCommands = value.RPCCommands;
|
|
const env0_9 = value.RPCErrors;
|
|
object = {};
|
|
const GET_RELATIONSHIPS = RPCCommands.GET_RELATIONSHIPS;
|
|
value = require(13026) /* metro dependency 13026: rpcSchema */;
|
|
const createRPCCommand = value.createRPCCommand;
|
|
const GET_RELATIONSHIPS2 = RPCCommands.GET_RELATIONSHIPS;
|
|
const ANY = RPC_SCOPE_CONFIG.ANY;
|
|
const OAuth2Scopes = (OAuth2ScopesModule).OAuth2Scopes;
|
|
const RELATIONSHIPS_READ = OAuth2Scopes.RELATIONSHIPS_READ;
|
|
object[GET_RELATIONSHIPS] = Reflect.apply(createRPCCommand, value, [GET_RELATIONSHIPS2,
|
|
{scope: {[ANY]: [RELATIONSHIPS_READ]}, handler: handler_99542}]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/rpc/server/commands/relationships.tsx');
|
|
exports.default = object;
|
|
function _createForOfIteratorHelperLoose_99539(a0, a1) { // fn#99539, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13229:242, offset: 0x021cc81c, size: 372 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun99540;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_99541(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_99541(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_99541(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun99540;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
function _fun99540() { // fn#99540, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13229:813, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
|
|
return env0_1 >= env0_0.length ? {done: true} : {done: false,
|
|
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
|
|
}
|
|
|
|
}
|
|
|
|
function handler_99542(a0) { // fn#99542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13229:1287, offset: 0x021cc990, size: 434 bytes, params: 2, frame: 27
|
|
var r5;
|
|
var value7;
|
|
var value8;
|
|
var property;
|
|
var property2;
|
|
var NONE;
|
|
var user;
|
|
var moduleValue4;
|
|
var value10;
|
|
var push;
|
|
var moduleValue5;
|
|
var transformApplicationRelationship;
|
|
var id;
|
|
var value11;
|
|
const has = BigFlagUtilsModule.has;
|
|
let deserialize = BigFlagUtilsModule.deserialize;
|
|
let socket = a0.socket;
|
|
let application = socket.application;
|
|
const flags = application.flags;
|
|
const value2 = 0;
|
|
const value3 = Reflect.apply(deserialize, BigFlagUtilsModule, [flags ?? value2]);
|
|
deserialize = BigFlagUtilsModule.deserialize;
|
|
const DISABLE_RELATIONSHIPS_ACCESS = ApplicationFlags.DISABLE_RELATIONSHIPS_ACCESS;
|
|
if (Reflect.apply(has, BigFlagUtilsModule, [value3, Reflect.apply(deserialize, BigFlagUtilsModule,
|
|
[DISABLE_RELATIONSHIPS_ACCESS])])) {
|
|
throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.INVALID_PERMISSIONS},
|
|
|
|
'Missing Permissions');
|
|
}
|
|
const items2 = [];
|
|
const _createForOfIteratorHelperLoose_99539Binding = _createForOfIteratorHelperLoose_99539;
|
|
const mutableRelationships = RelationshipStore.getMutableRelationships();
|
|
const value5 = _createForOfIteratorHelperLoose_99539Binding(mutableRelationships.entries());
|
|
const value6 = value5();
|
|
let done = value6.done;
|
|
if (!done) {
|
|
r5 = value6;
|
|
while (true) {
|
|
value7 = r5.value;
|
|
value8 = Module00057(value7, 2);
|
|
property = value8[value2];
|
|
property2 = value8[1];
|
|
NONE = RelationshipTypes.NONE;
|
|
if (property2 !== NONE) {
|
|
user = UserStore.getUser(property);
|
|
if (user == null) {
|
|
break;
|
|
}
|
|
moduleValue4 = require(8081) /* metro dependency 8081: RPCHelpers */;
|
|
value10 = moduleValue4.transformBaseRelationship(property2, user);
|
|
push = items2.push;
|
|
moduleValue5 = require(8081) /* metro dependency 8081: RPCHelpers */;
|
|
transformApplicationRelationship = moduleValue5.transformApplicationRelationship;
|
|
socket = a0.socket;
|
|
application = socket.application;
|
|
id = application.id;
|
|
Reflect.apply(push, items2, [Reflect.apply(transformApplicationRelationship, moduleValue5, [value10,
|
|
id])]);
|
|
break;
|
|
}
|
|
value11 = value5();
|
|
done = value11.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r5 = value11;
|
|
continue;
|
|
}
|
|
}
|
|
return {relationships: items2};
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun99538, 13039, [57, 3793, 1878, 4135, 661, 13026, 4122, 483, 8076, 8081,
|
|
2]) /* metro module 13039, dependencies: [57, 3793, 1878, 4135, 661, 13026, 4122, 483, 8076, 8081, 2] */;
|