2026-10-07 22:43:51 +00:00
|
|
|
// Module ID: 8941
|
|
|
|
|
// Function ID: 8942
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: ApplicationInstallUtils
|
2026-10-07 22:43:51 +00:00
|
|
|
// Dependencies: [8795, 5788, 8708, 2]
|
2026-09-18 19:45:33 +00:00
|
|
|
// Exports: canInstallApplication, isAppUserInstallable, shouldInstallApplicationOnDemand
|
|
|
|
|
|
2026-10-07 22:43:51 +00:00
|
|
|
// Module 8941 (ApplicationInstallUtils)
|
|
|
|
|
import ApplicationCommandConstants from "ApplicationCommandConstants" /* 5788 */;
|
|
|
|
|
import ApplicationIntegrationType from "ApplicationIntegrationType" /* 8708 */;
|
|
|
|
|
import ApplicationCommandIndexStore from "ApplicationCommandIndexStore" /* 8795 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import size from "module_2" /* 2 */;
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-10-09 10:34:53 +00:00
|
|
|
const f98862 = (oauth2_install_params) => {
|
2026-10-01 14:13:23 +00:00
|
|
|
let prop;
|
|
|
|
|
if (oauth2_install_params != null) {
|
|
|
|
|
prop = oauth2_install_params.oauth2_install_params;
|
|
|
|
|
}
|
|
|
|
|
let tmp2 = null != prop;
|
|
|
|
|
if (!tmp2) {
|
|
|
|
|
let oauth2InstallParams;
|
|
|
|
|
if (oauth2_install_params != null) {
|
|
|
|
|
oauth2InstallParams = oauth2_install_params.oauth2InstallParams;
|
|
|
|
|
}
|
|
|
|
|
tmp2 = null != oauth2InstallParams;
|
|
|
|
|
}
|
|
|
|
|
return tmp2;
|
|
|
|
|
};
|
|
|
|
|
const BuiltInSectionId = ApplicationCommandConstants.BuiltInSectionId;
|
2026-09-18 19:45:33 +00:00
|
|
|
let result = size.fileFinishedImporting("modules/applications/utils/ApplicationInstallUtils.tsx");
|
|
|
|
|
|
2026-10-02 13:37:24 +00:00
|
|
|
export const canInstallApplication = function canInstallApplication(installAppProps) {
|
|
|
|
|
const integrationTypesConfig = installAppProps.integrationTypesConfig;
|
|
|
|
|
let tmp = null != installAppProps.customInstallUrl || null != installAppProps.installParams;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (!tmp) {
|
|
|
|
|
let someResult = null != integrationTypesConfig;
|
|
|
|
|
if (someResult) {
|
|
|
|
|
const _Object = Object;
|
|
|
|
|
const values = Object.values(integrationTypesConfig);
|
2026-10-09 10:34:53 +00:00
|
|
|
someResult = values.some(f98862);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
tmp = someResult;
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
};
|
|
|
|
|
export const isAppUserInstallable = function isAppUserInstallable(integrationTypesConfig) {
|
|
|
|
|
integrationTypesConfig = integrationTypesConfig.integrationTypesConfig;
|
|
|
|
|
let tmp = null != integrationTypesConfig.customInstallUrl || null != integrationTypesConfig.installParams;
|
|
|
|
|
if (!tmp) {
|
|
|
|
|
let someResult = null != integrationTypesConfig;
|
|
|
|
|
if (someResult) {
|
|
|
|
|
const _Object = Object;
|
|
|
|
|
const values = Object.values(integrationTypesConfig);
|
2026-10-09 10:34:53 +00:00
|
|
|
someResult = values.some(f98862);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
tmp = someResult;
|
|
|
|
|
}
|
|
|
|
|
if (tmp) {
|
|
|
|
|
tmp = null != integrationTypesConfig;
|
|
|
|
|
}
|
|
|
|
|
if (tmp) {
|
|
|
|
|
tmp = ApplicationIntegrationType.ApplicationIntegrationType.USER_INSTALL in integrationTypesConfig;
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
};
|
|
|
|
|
export const shouldInstallApplicationOnDemand = function shouldInstallApplicationOnDemand(arg0) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let applicationId;
|
|
|
|
|
let channel;
|
|
|
|
|
let commandIntegrationTypes;
|
2026-09-18 19:45:33 +00:00
|
|
|
({ applicationId, channel, commandIntegrationTypes } = arg0);
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp4 = !(null != commandIntegrationTypes && !commandIntegrationTypes.includes(ApplicationIntegrationType.ApplicationIntegrationType.USER_INSTALL));
|
|
|
|
|
const tmp = null != commandIntegrationTypes && !commandIntegrationTypes.includes(ApplicationIntegrationType.ApplicationIntegrationType.USER_INSTALL);
|
|
|
|
|
if (tmp4) {
|
2026-09-18 19:45:33 +00:00
|
|
|
let tmp6 = applicationId !== BuiltInSectionId.BUILT_IN;
|
|
|
|
|
if (tmp6) {
|
|
|
|
|
const result = ApplicationCommandIndexStore.hasUserStateApplication(applicationId);
|
|
|
|
|
let tmp8 = !result;
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = ApplicationCommandIndexStore;
|
|
|
|
|
if (tmp8) {
|
2026-09-18 19:45:33 +00:00
|
|
|
let tmp9 = null == channel;
|
|
|
|
|
if (!tmp9) {
|
|
|
|
|
const obj3 = { applicationId, channelId: null, guildId: null };
|
|
|
|
|
({ id: obj2.channelId, guild_id: obj2.guildId } = channel);
|
|
|
|
|
tmp9 = !obj.hasContextStateApplication(obj3);
|
|
|
|
|
}
|
|
|
|
|
tmp8 = tmp9;
|
|
|
|
|
}
|
|
|
|
|
tmp6 = tmp8;
|
|
|
|
|
}
|
|
|
|
|
tmp4 = tmp6;
|
|
|
|
|
}
|
|
|
|
|
return tmp4;
|
|
|
|
|
};
|