blob: 38cd27250c513d90f1526ab2c86f5ec008981dec [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';
ys969316a9fce2020-01-19 13:50:02 +020047import { PluginsService } from '../ng2/services/plugins.service';
48import { PoliciesService as PoliciesServiceNg2 } from '../ng2/services/policies.service';
49import { SharingService } from '../ng2/services/sharing.service';
50import { ToscaTypesServiceNg2 } from '../ng2/services/tosca-types.service';
51import { UserService as UserServiceNg2 } from '../ng2/services/user.service';
52import { AngularJSBridge } from '../services/angular-js-bridge-service';
53import { AvailableIconsService } from '../services/available-icons-service';
54import { CategoryResourceService } from '../services/category-resource-service';
55import { ComponentService } from '../services/components/component-service';
56import { ResourceService } from '../services/components/resource-service';
57import { ServiceService } from '../services/components/service-service';
58import { LeftPaletteLoaderService } from '../services/components/utils/composition-left-palette-service';
59import { ConfigurationUiService } from '../services/configuration-ui-service';
60import { CookieService } from '../services/cookie-service';
61import { DataTypesService } from '../services/data-types-service';
62import { EcompHeaderService } from '../services/ecomp-service';
63import { EventListenerService } from '../services/event-listener-service';
64import { HeaderInterceptor } from '../services/header-interceptor';
65import { LoaderService } from '../services/loader-service';
66import { ProgressService } from '../services/progress-service';
67import { SdcVersionService } from '../services/sdc-version-service';
68import { UrlToBase64Service } from '../services/url-tobase64-service';
69import { FileUtils } from '../utils/file-utils';
70import { ValidationUtils } from '../utils/validation-utils';
71import {ReqAndCapabilitiesService} from "../ng2/pages/workspace/req-and-capabilities/req-and-capabilities.service";
Michael Landoed64b5e2017-06-09 03:19:04 +030072
ys969316a9fce2020-01-19 13:50:02 +020073const moduleName: string = 'Sdc.Services';
74const serviceModule: ng.IModule = angular.module(moduleName, []);
Michael Landoed64b5e2017-06-09 03:19:04 +030075
76serviceModule.service('Sdc.Services.ConfigurationUiService', ConfigurationUiService);
77serviceModule.service('Sdc.Services.CookieService', CookieService);
Michael Lando5b593492018-07-29 16:13:45 +030078serviceModule.service('Sdc.Services.ComponentFactory', ComponentFactory); // Why you need to declare it again, already done in utils.ts
Michael Landoed64b5e2017-06-09 03:19:04 +030079serviceModule.service('Sdc.Services.AvailableIconsService', AvailableIconsService);
80serviceModule.service('Sdc.Services.UrlToBase64Service', UrlToBase64Service);
Michael Landoed64b5e2017-06-09 03:19:04 +030081serviceModule.service('Sdc.Services.HeaderInterceptor', HeaderInterceptor);
Michael Landoed64b5e2017-06-09 03:19:04 +030082serviceModule.service('Sdc.Services.SdcVersionService', SdcVersionService);
Michael Landoed64b5e2017-06-09 03:19:04 +030083serviceModule.service('Sdc.Services.EcompHeaderService', EcompHeaderService);
84serviceModule.service('Sdc.Services.DataTypesService', DataTypesService);
85
ys969316a9fce2020-01-19 13:50:02 +020086// Components Services
Michael Landoed64b5e2017-06-09 03:19:04 +030087serviceModule.service('Sdc.Services.Components.ComponentService', ComponentService);
ys969316a9fce2020-01-19 13:50:02 +020088serviceModule.service('Sdc.Services.Components.ServiceService', ServiceService);
Michael Landoed64b5e2017-06-09 03:19:04 +030089serviceModule.service('Sdc.Services.Components.ResourceService', ResourceService);
Michael Landoed64b5e2017-06-09 03:19:04 +030090serviceModule.service('LeftPaletteLoaderService', LeftPaletteLoaderService);
Michael Landoed64b5e2017-06-09 03:19:04 +030091serviceModule.service('Sdc.Services.ProgressService', ProgressService);
92
ys969316a9fce2020-01-19 13:50:02 +020093// Utils
Michael Landoed64b5e2017-06-09 03:19:04 +030094serviceModule.service('FileUtils', FileUtils);
95serviceModule.service('ValidationUtils', ValidationUtils);
ys969316a9fce2020-01-19 13:50:02 +020096serviceModule.service('AngularJSBridge', AngularJSBridge);
Michael Landoed64b5e2017-06-09 03:19:04 +030097serviceModule.service('LoaderService', LoaderService);
Michael Landoed64b5e2017-06-09 03:19:04 +030098serviceModule.factory('Sdc.Services.CategoryResourceService', CategoryResourceService.getResource);
Tal Gitelman51d50f02017-12-10 18:55:03 +020099
100// 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 +0200101serviceModule.service('Sdc.Services.SharingService', downgradeInjectable(SharingService));
102serviceModule.service('Sdc.Services.CacheService', downgradeInjectable(CacheService));
Tal Gitelman51d50f02017-12-10 18:55:03 +0200103serviceModule.factory('ComponentServiceNg2', downgradeInjectable(ComponentServiceNg2));
ys969316a9fce2020-01-19 13:50:02 +0200104serviceModule.factory('TopologyTemplateService', downgradeInjectable(TopologyTemplateService));
105serviceModule.factory('WorkspaceNg1BridgeService', downgradeInjectable(WorkspaceNg1BridgeService));
106serviceModule.factory('workspaceService', downgradeInjectable(WorkspaceService));
Michael Landoa5445102018-03-04 14:53:33 +0200107serviceModule.factory('ComponentServiceFactoryNg2', downgradeInjectable(ComponentServiceFactoryNg2));
Tal Gitelman51d50f02017-12-10 18:55:03 +0200108serviceModule.factory('ServiceServiceNg2', downgradeInjectable(ServiceServiceNg2));
109serviceModule.factory('ModalServiceNg2', downgradeInjectable(ModalService));
ys969316a9fce2020-01-19 13:50:02 +0200110serviceModule.factory('ModalServiceSdcUI', downgradeInjectable(SdcUiServices.ModalService));
Tal Gitelman51d50f02017-12-10 18:55:03 +0200111serviceModule.factory('ConnectionWizardServiceNg2', downgradeInjectable(ConnectionWizardService));
112serviceModule.factory('ComponentInstanceServiceNg2', downgradeInjectable(ComponentInstanceServiceNg2));
Idan Amitae4ab932018-01-23 15:53:11 +0200113serviceModule.factory('UserServiceNg2', downgradeInjectable(UserServiceNg2));
ys969316a9fce2020-01-19 13:50:02 +0200114serviceModule.factory('AuthenticationServiceNg2', downgradeInjectable(AuthenticationServiceNg2));
Michael Lando5b593492018-07-29 16:13:45 +0300115serviceModule.factory('PoliciesServiceNg2', downgradeInjectable(PoliciesServiceNg2));
116serviceModule.factory('GroupsServiceNg2', downgradeInjectable(GroupsServiceNg2));
Idan Amiteedaaf92018-01-31 13:27:33 +0200117serviceModule.factory('PluginsService', downgradeInjectable(PluginsService));
Idan Amitf97bae32018-03-06 13:52:58 +0200118serviceModule.factory('EventBusService', downgradeInjectable(EventBusService));
Michael Landoa5445102018-03-04 14:53:33 +0200119serviceModule.factory('DynamicComponentService', downgradeInjectable(DynamicComponentService));
ys969316a9fce2020-01-19 13:50:02 +0200120serviceModule.factory('HomeService', downgradeInjectable(HomeService));
121serviceModule.factory('CatalogService', downgradeInjectable(CatalogService));
Piotr Darosz2c25cba2019-03-27 15:25:50 +0100122serviceModule.factory('GabServiceNg2', downgradeInjectable(GabServiceNg2));
Michael Lando5b593492018-07-29 16:13:45 +0300123serviceModule.factory('AutomatedUpgradeService', downgradeInjectable(AutomatedUpgradeService));
miriame41ee9cb2019-03-04 13:49:15 +0200124serviceModule.factory('ToscaTypesServiceNg2', downgradeInjectable(ToscaTypesServiceNg2));
ys969316a9fce2020-01-19 13:50:02 +0200125serviceModule.factory('EventListenerService', downgradeInjectable(EventListenerService));
126serviceModule.factory('CompositionService', downgradeInjectable(CompositionService));
127serviceModule.factory('ReqAndCapabilitiesService', downgradeInjectable(ReqAndCapabilitiesService));
128serviceModule.factory('NodesFactory', downgradeInjectable(NodesFactory));
129serviceModule.service('OnboardingService', downgradeInjectable(OnboardingService));
vasraza6ae7292021-03-21 20:48:30 +0000130serviceModule.service('ElementService', downgradeInjectable(ElementService));
ys969316a9fce2020-01-19 13:50:02 +0200131serviceModule.service('ImportVSPService', downgradeInjectable(ImportVSPService));