@eclipse-theiacloud/common
Version:
Common functionality for Theia Cloud
37 lines • 1.4 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.KeycloakConfig = exports.TheiaCloudConfig = void 0;
exports.getTheiaCloudConfig = getTheiaCloudConfig;
var TheiaCloudConfig;
(function (TheiaCloudConfig) {
function is(thing) {
return (!!thing &&
typeof thing === 'object' &&
typeof thing.appId === 'string' &&
typeof thing.appName === 'string' &&
typeof thing.serviceUrl === 'string' &&
typeof thing.appDefinition === 'string' &&
typeof thing.useKeycloak === 'boolean' &&
typeof thing.useEphemeralStorage === 'boolean');
}
TheiaCloudConfig.is = is;
})(TheiaCloudConfig || (exports.TheiaCloudConfig = TheiaCloudConfig = {}));
var KeycloakConfig;
(function (KeycloakConfig) {
function is(thing) {
return (!!thing &&
typeof thing === 'object' &&
typeof thing.keycloakAuthUrl === 'string' &&
typeof thing.keycloakRealm === 'string' &&
typeof thing.keycloakClientId === 'string');
}
KeycloakConfig.is = is;
})(KeycloakConfig || (exports.KeycloakConfig = KeycloakConfig = {}));
function getTheiaCloudConfig() {
const config = window.theiaCloudConfig;
if (TheiaCloudConfig.is(config)) {
return Object.freeze({ ...config });
}
return undefined;
}
//# sourceMappingURL=config.js.map