blob: de620912f2553de7ac9254cd6c65e1e3734f0d45 [file] [log] [blame]
Michael Landodd603392017-07-12 00:54:52 +03001/*-
2 * ============LICENSE_START=======================================================
3 * SDC
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
ys969316a9fce2020-01-19 13:50:02 +020010 *
Michael Landodd603392017-07-12 00:54:52 +030011 * http://www.apache.org/licenses/LICENSE-2.0
ys969316a9fce2020-01-19 13:50:02 +020012 *
Michael Landodd603392017-07-12 00:54:52 +030013 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
19 */
20
ys969316a9fce2020-01-19 13:50:02 +020021import { downgradeInjectable } from '@angular/upgrade/static';
22import { CompositionService } from 'app/ng2/pages/composition/composition.service';
23import { CatalogService } from 'app/ng2/services/catalog.service';
24import { TopologyTemplateService } from 'app/ng2/services/component-services/topology-template.service';
25import { DynamicComponentService } from 'app/ng2/services/dynamic-component.service';
Piotr Darosz2c25cba2019-03-27 15:25:50 +010026import {GabService as GabServiceNg2} from "app/ng2/services/gab.service";
ys969316a9fce2020-01-19 13:50:02 +020027import { ComponentFactory } from 'app/utils/component-factory';
28import { SdcUiServices } from 'onap-ui-angular';
29import { NodesFactory } from '../models/graph/nodes/nodes-factory';
30import { ImportVSPService } from '../ng2/components/modals/onboarding-modal/import-vsp.service';
31import { AutomatedUpgradeService } from '../ng2/pages/automated-upgrade/automated-upgrade.service';
32import { ConnectionWizardService } from '../ng2/pages/composition/graph/connection-wizard/connection-wizard.service';
33import { WorkspaceNg1BridgeService } from '../ng2/pages/workspace/workspace-ng1-bridge-service';
34import { WorkspaceService } from '../ng2/pages/workspace/workspace.service';
35import { AuthenticationService as AuthenticationServiceNg2 } from '../ng2/services/authentication.service';
36import { CacheService } from '../ng2/services/cache.service';
37import { ComponentInstanceServiceNg2 } from '../ng2/services/component-instance-services/component-instance.service';
38import { ComponentServiceNg2 } from '../ng2/services/component-services/component.service';
39import { ComponentServiceFactoryNg2 } from '../ng2/services/component-services/component.service.factory';
40import { ServiceServiceNg2 } from '../ng2/services/component-services/service.service';
41import { EventBusService } from '../ng2/services/event-bus.service';
42import { GroupsService as GroupsServiceNg2 } from '../ng2/services/groups.service';
43import { HomeService } from '../ng2/services/home.service';
44import { ModalService } from '../ng2/services/modal.service';
45import { OnboardingService } from '../ng2/services/onboarding.service';
vasraza6ae7292021-03-21 20:48:30 +000046import { ElementService } from '../ng2/services/element.service';
aribeiro53df9762021-06-16 23:21:04 +010047import { ModelService } from '../ng2/services/model.service';
ys969316a9fce2020-01-19 13:50:02 +020048import { PluginsService } from '../ng2/services/plugins.service';
49import { PoliciesService as PoliciesServiceNg2 } from '../ng2/services/policies.service';
50import { SharingService } from '../ng2/services/sharing.service';
51import { ToscaTypesServiceNg2 } from '../ng2/services/tosca-types.service';
52import { UserService as UserServiceNg2 } from '../ng2/services/user.service';
53import { AngularJSBridge } from '../services/angular-js-bridge-service';
54import { AvailableIconsService } from '../services/available-icons-service';
55import { CategoryResourceService } from '../services/category-resource-service';
56import { ComponentService } from '../services/components/component-service';
57import { ResourceService } from '../services/components/resource-service';
58import { ServiceService } from '../services/components/service-service';
59import { LeftPaletteLoaderService } from '../services/components/utils/composition-left-palette-service';
60import { ConfigurationUiService } from '../services/configuration-ui-service';
61import { CookieService } from '../services/cookie-service';
62import { DataTypesService } from '../services/data-types-service';
63import { EcompHeaderService } from '../services/ecomp-service';
64import { EventListenerService } from '../services/event-listener-service';
65import { HeaderInterceptor } from '../services/header-interceptor';
66import { LoaderService } from '../services/loader-service';
67import { ProgressService } from '../services/progress-service';
68import { SdcVersionService } from '../services/sdc-version-service';
69import { UrlToBase64Service } from '../services/url-tobase64-service';
70import { FileUtils } from '../utils/file-utils';
71import { ValidationUtils } from '../utils/validation-utils';
72import {ReqAndCapabilitiesService} from "../ng2/pages/workspace/req-and-capabilities/req-and-capabilities.service";
Michael Landoed64b5e2017-06-09 03:19:04 +030073
ys969316a9fce2020-01-19 13:50:02 +020074const moduleName: string = 'Sdc.Services';
75const serviceModule: ng.IModule = angular.module(moduleName, []);
Michael Landoed64b5e2017-06-09 03:19:04 +030076
77serviceModule.service('Sdc.Services.ConfigurationUiService', ConfigurationUiService);
78serviceModule.service('Sdc.Services.CookieService', CookieService);
Michael Lando5b593492018-07-29 16:13:45 +030079serviceModule.service('Sdc.Services.ComponentFactory', ComponentFactory); // Why you need to declare it again, already done in utils.ts
Michael Landoed64b5e2017-06-09 03:19:04 +030080serviceModule.service('Sdc.Services.AvailableIconsService', AvailableIconsService);
81serviceModule.service('Sdc.Services.UrlToBase64Service', UrlToBase64Service);
Michael Landoed64b5e2017-06-09 03:19:04 +030082serviceModule.service('Sdc.Services.HeaderInterceptor', HeaderInterceptor);
Michael Landoed64b5e2017-06-09 03:19:04 +030083serviceModule.service('Sdc.Services.SdcVersionService', SdcVersionService);
Michael Landoed64b5e2017-06-09 03:19:04 +030084serviceModule.service('Sdc.Services.EcompHeaderService', EcompHeaderService);
85serviceModule.service('Sdc.Services.DataTypesService', DataTypesService);
86
ys969316a9fce2020-01-19 13:50:02 +020087// Components Services
Michael Landoed64b5e2017-06-09 03:19:04 +030088serviceModule.service('Sdc.Services.Components.ComponentService', ComponentService);
ys969316a9fce2020-01-19 13:50:02 +020089serviceModule.service('Sdc.Services.Components.ServiceService', ServiceService);
Michael Landoed64b5e2017-06-09 03:19:04 +030090serviceModule.service('Sdc.Services.Components.ResourceService', ResourceService);
Michael Landoed64b5e2017-06-09 03:19:04 +030091serviceModule.service('LeftPaletteLoaderService', LeftPaletteLoaderService);
Michael Landoed64b5e2017-06-09 03:19:04 +030092serviceModule.service('Sdc.Services.ProgressService', ProgressService);
93
ys969316a9fce2020-01-19 13:50:02 +020094// Utils
Michael Landoed64b5e2017-06-09 03:19:04 +030095serviceModule.service('FileUtils', FileUtils);
96serviceModule.service('ValidationUtils', ValidationUtils);
ys969316a9fce2020-01-19 13:50:02 +020097serviceModule.service('AngularJSBridge', AngularJSBridge);
Michael Landoed64b5e2017-06-09 03:19:04 +030098serviceModule.service('LoaderService', LoaderService);
Michael Landoed64b5e2017-06-09 03:19:04 +030099serviceModule.factory('Sdc.Services.CategoryResourceService', CategoryResourceService.getResource);
Tal Gitelman51d50f02017-12-10 18:55:03 +0200100
101// Angular2 upgraded services - This is in order to use the service in angular1 till we finish remove all angular1 code
ys969316a9fce2020-01-19 13:50:02 +0200102serviceModule.service('Sdc.Services.SharingService', downgradeInjectable(SharingService));
103serviceModule.service('Sdc.Services.CacheService', downgradeInjectable(CacheService));
Tal Gitelman51d50f02017-12-10 18:55:03 +0200104serviceModule.factory('ComponentServiceNg2', downgradeInjectable(ComponentServiceNg2));
ys969316a9fce2020-01-19 13:50:02 +0200105serviceModule.factory('TopologyTemplateService', downgradeInjectable(TopologyTemplateService));
106serviceModule.factory('WorkspaceNg1BridgeService', downgradeInjectable(WorkspaceNg1BridgeService));
107serviceModule.factory('workspaceService', downgradeInjectable(WorkspaceService));
Michael Landoa5445102018-03-04 14:53:33 +0200108serviceModule.factory('ComponentServiceFactoryNg2', downgradeInjectable(ComponentServiceFactoryNg2));
Tal Gitelman51d50f02017-12-10 18:55:03 +0200109serviceModule.factory('ServiceServiceNg2', downgradeInjectable(ServiceServiceNg2));
110serviceModule.factory('ModalServiceNg2', downgradeInjectable(ModalService));
ys969316a9fce2020-01-19 13:50:02 +0200111serviceModule.factory('ModalServiceSdcUI', downgradeInjectable(SdcUiServices.ModalService));
Tal Gitelman51d50f02017-12-10 18:55:03 +0200112serviceModule.factory('ConnectionWizardServiceNg2', downgradeInjectable(ConnectionWizardService));
113serviceModule.factory('ComponentInstanceServiceNg2', downgradeInjectable(ComponentInstanceServiceNg2));
Idan Amitae4ab932018-01-23 15:53:11 +0200114serviceModule.factory('UserServiceNg2', downgradeInjectable(UserServiceNg2));
ys969316a9fce2020-01-19 13:50:02 +0200115serviceModule.factory('AuthenticationServiceNg2', downgradeInjectable(AuthenticationServiceNg2));
Michael Lando5b593492018-07-29 16:13:45 +0300116serviceModule.factory('PoliciesServiceNg2', downgradeInjectable(PoliciesServiceNg2));
117serviceModule.factory('GroupsServiceNg2', downgradeInjectable(GroupsServiceNg2));
Idan Amiteedaaf92018-01-31 13:27:33 +0200118serviceModule.factory('PluginsService', downgradeInjectable(PluginsService));
Idan Amitf97bae32018-03-06 13:52:58 +0200119serviceModule.factory('EventBusService', downgradeInjectable(EventBusService));
Michael Landoa5445102018-03-04 14:53:33 +0200120serviceModule.factory('DynamicComponentService', downgradeInjectable(DynamicComponentService));
ys969316a9fce2020-01-19 13:50:02 +0200121serviceModule.factory('HomeService', downgradeInjectable(HomeService));
122serviceModule.factory('CatalogService', downgradeInjectable(CatalogService));
Piotr Darosz2c25cba2019-03-27 15:25:50 +0100123serviceModule.factory('GabServiceNg2', downgradeInjectable(GabServiceNg2));
Michael Lando5b593492018-07-29 16:13:45 +0300124serviceModule.factory('AutomatedUpgradeService', downgradeInjectable(AutomatedUpgradeService));
miriame41ee9cb2019-03-04 13:49:15 +0200125serviceModule.factory('ToscaTypesServiceNg2', downgradeInjectable(ToscaTypesServiceNg2));
ys969316a9fce2020-01-19 13:50:02 +0200126serviceModule.factory('EventListenerService', downgradeInjectable(EventListenerService));
127serviceModule.factory('CompositionService', downgradeInjectable(CompositionService));
128serviceModule.factory('ReqAndCapabilitiesService', downgradeInjectable(ReqAndCapabilitiesService));
129serviceModule.factory('NodesFactory', downgradeInjectable(NodesFactory));
130serviceModule.service('OnboardingService', downgradeInjectable(OnboardingService));
vasraza6ae7292021-03-21 20:48:30 +0000131serviceModule.service('ElementService', downgradeInjectable(ElementService));
aribeiro53df9762021-06-16 23:21:04 +0100132serviceModule.service('ModelService', downgradeInjectable(ModelService));
ys969316a9fce2020-01-19 13:50:02 +0200133serviceModule.service('ImportVSPService', downgradeInjectable(ImportVSPService));