open-collaboration-server
Version:
Open Collaboration Server implementation, part of the Open Collaboration Tools project
47 lines • 2.87 kB
JavaScript
;
// ******************************************************************************
// Copyright 2024 TypeFox GmbH
// This program and the accompanying materials are made available under the
// terms of the MIT License, which is available in the project root.
// ******************************************************************************
Object.defineProperty(exports, "__esModule", { value: true });
const inversify_1 = require("inversify");
const collaboration_server_1 = require("./collaboration-server");
const credentials_manager_1 = require("./credentials-manager");
const message_relay_1 = require("./message-relay");
const peer_1 = require("./peer");
const room_manager_1 = require("./room-manager");
const types_1 = require("./types");
const user_manager_1 = require("./user-manager");
const logging_1 = require("./utils/logging");
const simple_login_endpoint_1 = require("./auth-endpoints/simple-login-endpoint");
const auth_endpoint_1 = require("./auth-endpoints/auth-endpoint");
const oauth_endpoint_1 = require("./auth-endpoints/oauth-endpoint");
const configuration_1 = require("./utils/configuration");
const peer_manager_1 = require("./peer-manager");
exports.default = new inversify_1.ContainerModule(bind => {
bind(logging_1.LoggerSymbol).to(logging_1.ConsoleLogger).inSingletonScope();
bind(logging_1.LogLevelSymbol).toConstantValue(logging_1.LogLevel.info);
bind(configuration_1.DefaultConfiguration).toSelf().inSingletonScope();
bind(configuration_1.Configuration).toService(configuration_1.DefaultConfiguration);
bind(collaboration_server_1.CollaborationServer).toSelf().inSingletonScope();
bind(room_manager_1.RoomManager).toSelf().inSingletonScope();
bind(credentials_manager_1.CredentialsManager).toSelf().inSingletonScope();
bind(user_manager_1.UserManager).toSelf().inSingletonScope();
bind(message_relay_1.MessageRelay).toSelf().inSingletonScope();
bind(peer_1.PeerImpl).toSelf().inTransientScope();
bind(peer_1.PeerFactory).toFactory(context => (peerInfo) => {
const child = new inversify_1.Container();
child.parent = context.container;
child.bind(types_1.PeerInfo).toConstantValue(peerInfo);
return child.get(peer_1.PeerImpl);
});
bind(peer_manager_1.PeerManager).toSelf().inSingletonScope();
bind(simple_login_endpoint_1.SimpleLoginEndpoint).toSelf().inSingletonScope();
bind(auth_endpoint_1.AuthEndpoint).toService(simple_login_endpoint_1.SimpleLoginEndpoint);
bind(oauth_endpoint_1.GitHubOAuthEndpoint).toSelf().inSingletonScope();
bind(auth_endpoint_1.AuthEndpoint).toService(oauth_endpoint_1.GitHubOAuthEndpoint);
bind(oauth_endpoint_1.GoogleOAuthEndpoint).toSelf().inSingletonScope();
bind(auth_endpoint_1.AuthEndpoint).toService(oauth_endpoint_1.GoogleOAuthEndpoint);
});
//# sourceMappingURL=container.js.map