blob: b9191cc6d18e04430c3156e4b2f387252e3e4a7f [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";
aribeiro1de16922021-10-01 11:30:49 +010073import {ToscaArtifactService} from "../ng2/services/tosca-artifact.service";
Michael Landoed64b5e2017-06-09 03:19:04 +030074
ys969316a9fce2020-01-19 13:50:02 +020075const moduleName: string = 'Sdc.Services';
76const serviceModule: ng.IModule = angular.module(moduleName, []);
Michael Landoed64b5e2017-06-09 03:19:04 +030077
78serviceModule.service('Sdc.Services.ConfigurationUiService', ConfigurationUiService);
79serviceModule.service('Sdc.Services.CookieService', CookieService);
Michael Lando5b593492018-07-29 16:13:45 +030080serviceModule.service('Sdc.Services.ComponentFactory', ComponentFactory); // Why you need to declare it again, already done in utils.ts
Michael Landoed64b5e2017-06-09 03:19:04 +030081serviceModule.service('Sdc.Services.AvailableIconsService', AvailableIconsService);
82serviceModule.service('Sdc.Services.UrlToBase64Service', UrlToBase64Service);
Michael Landoed64b5e2017-06-09 03:19:04 +030083serviceModule.service('Sdc.Services.HeaderInterceptor', HeaderInterceptor);
Michael Landoed64b5e2017-06-09 03:19:04 +030084serviceModule.service('Sdc.Services.SdcVersionService', SdcVersionService);
Michael Landoed64b5e2017-06-09 03:19:04 +030085serviceModule.service('Sdc.Services.EcompHeaderService', EcompHeaderService);
86serviceModule.service('Sdc.Services.DataTypesService', DataTypesService);
87
ys969316a9fce2020-01-19 13:50:02 +020088// Components Services
Michael Landoed64b5e2017-06-09 03:19:04 +030089serviceModule.service('Sdc.Services.Components.ComponentService', ComponentService);
ys969316a9fce2020-01-19 13:50:02 +020090serviceModule.service('Sdc.Services.Components.ServiceService', ServiceService);
Michael Landoed64b5e2017-06-09 03:19:04 +030091serviceModule.service('Sdc.Services.Components.ResourceService', ResourceService);
Michael Landoed64b5e2017-06-09 03:19:04 +030092serviceModule.service('LeftPaletteLoaderService', LeftPaletteLoaderService);
Michael Landoed64b5e2017-06-09 03:19:04 +030093serviceModule.service('Sdc.Services.ProgressService', ProgressService);
94
ys969316a9fce2020-01-19 13:50:02 +020095// Utils
Michael Landoed64b5e2017-06-09 03:19:04 +030096serviceModule.service('FileUtils', FileUtils);
97serviceModule.service('ValidationUtils', ValidationUtils);
ys969316a9fce2020-01-19 13:50:02 +020098serviceModule.service('AngularJSBridge', AngularJSBridge);
Michael Landoed64b5e2017-06-09 03:19:04 +030099serviceModule.service('LoaderService', LoaderService);
Michael Landoed64b5e2017-06-09 03:19:04 +0300100serviceModule.factory('Sdc.Services.CategoryResourceService', CategoryResourceService.getResource);
Tal Gitelman51d50f02017-12-10 18:55:03 +0200101
102// 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 +0200103serviceModule.service('Sdc.Services.SharingService', downgradeInjectable(SharingService));
104serviceModule.service('Sdc.Services.CacheService', downgradeInjectable(CacheService));
Tal Gitelman51d50f02017-12-10 18:55:03 +0200105serviceModule.factory('ComponentServiceNg2', downgradeInjectable(ComponentServiceNg2));
ys969316a9fce2020-01-19 13:50:02 +0200106serviceModule.factory('TopologyTemplateService', downgradeInjectable(TopologyTemplateService));
107serviceModule.factory('WorkspaceNg1BridgeService', downgradeInjectable(WorkspaceNg1BridgeService));
108serviceModule.factory('workspaceService', downgradeInjectable(WorkspaceService));
Michael Landoa5445102018-03-04 14:53:33 +0200109serviceModule.factory('ComponentServiceFactoryNg2', downgradeInjectable(ComponentServiceFactoryNg2));
Tal Gitelman51d50f02017-12-10 18:55:03 +0200110serviceModule.factory('ServiceServiceNg2', downgradeInjectable(ServiceServiceNg2));
111serviceModule.factory('ModalServiceNg2', downgradeInjectable(ModalService));
ys969316a9fce2020-01-19 13:50:02 +0200112serviceModule.factory('ModalServiceSdcUI', downgradeInjectable(SdcUiServices.ModalService));
Tal Gitelman51d50f02017-12-10 18:55:03 +0200113serviceModule.factory('ConnectionWizardServiceNg2', downgradeInjectable(ConnectionWizardService));
114serviceModule.factory('ComponentInstanceServiceNg2', downgradeInjectable(ComponentInstanceServiceNg2));
Idan Amitae4ab932018-01-23 15:53:11 +0200115serviceModule.factory('UserServiceNg2', downgradeInjectable(UserServiceNg2));
ys969316a9fce2020-01-19 13:50:02 +0200116serviceModule.factory('AuthenticationServiceNg2', downgradeInjectable(AuthenticationServiceNg2));
Michael Lando5b593492018-07-29 16:13:45 +0300117serviceModule.factory('PoliciesServiceNg2', downgradeInjectable(PoliciesServiceNg2));
118serviceModule.factory('GroupsServiceNg2', downgradeInjectable(GroupsServiceNg2));
Idan Amiteedaaf92018-01-31 13:27:33 +0200119serviceModule.factory('PluginsService', downgradeInjectable(PluginsService));
Idan Amitf97bae32018-03-06 13:52:58 +0200120serviceModule.factory('EventBusService', downgradeInjectable(EventBusService));
Michael Landoa5445102018-03-04 14:53:33 +0200121serviceModule.factory('DynamicComponentService', downgradeInjectable(DynamicComponentService));
ys969316a9fce2020-01-19 13:50:02 +0200122serviceModule.factory('HomeService', downgradeInjectable(HomeService));
123serviceModule.factory('CatalogService', downgradeInjectable(CatalogService));
Piotr Darosz2c25cba2019-03-27 15:25:50 +0100124serviceModule.factory('GabServiceNg2', downgradeInjectable(GabServiceNg2));
Michael Lando5b593492018-07-29 16:13:45 +0300125serviceModule.factory('AutomatedUpgradeService', downgradeInjectable(AutomatedUpgradeService));
miriame41ee9cb2019-03-04 13:49:15 +0200126serviceModule.factory('ToscaTypesServiceNg2', downgradeInjectable(ToscaTypesServiceNg2));
ys969316a9fce2020-01-19 13:50:02 +0200127serviceModule.factory('EventListenerService', downgradeInjectable(EventListenerService));
128serviceModule.factory('CompositionService', downgradeInjectable(CompositionService));
129serviceModule.factory('ReqAndCapabilitiesService', downgradeInjectable(ReqAndCapabilitiesService));
130serviceModule.factory('NodesFactory', downgradeInjectable(NodesFactory));
131serviceModule.service('OnboardingService', downgradeInjectable(OnboardingService));
vasraza6ae7292021-03-21 20:48:30 +0000132serviceModule.service('ElementService', downgradeInjectable(ElementService));
aribeiro53df9762021-06-16 23:21:04 +0100133serviceModule.service('ModelService', downgradeInjectable(ModelService));
ys969316a9fce2020-01-19 13:50:02 +0200134serviceModule.service('ImportVSPService', downgradeInjectable(ImportVSPService));
aribeiro1de16922021-10-01 11:30:49 +0100135serviceModule.service('ToscaArtifactService', downgradeInjectable(ToscaArtifactService));