blob: f4350a39d47e4fcde1501c32ab8a69a082608dce [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
Michael Landoa5445102018-03-04 14:53:33 +020010 *
Michael Landodd603392017-07-12 00:54:52 +030011 * http://www.apache.org/licenses/LICENSE-2.0
Michael Landoa5445102018-03-04 14:53:33 +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
Michael Landoed64b5e2017-06-09 03:19:04 +030021import {ConfigurationUiService} from "../services/configuration-ui-service";
22import {CookieService} from "../services/cookie-service";
23import {EntityService} from "../services/entity-service";
24import {AvailableIconsService} from "../services/available-icons-service";
25import {UrlToBase64Service} from "../services/url-tobase64-service";
26import {CacheService} from "../services/cache-service";
27import {HeaderInterceptor} from "../services/header-interceptor";
28import {HttpErrorInterceptor} from "../services/http-error-interceptor";
29import {SharingService} from "../services/sharing-service";
30import {SdcVersionService} from "../services/sdc-version-service";
31import {ActivityLogService} from "../services/activity-log-service";
32import {OnboardingService} from "../services/onboarding-service";
33import {EcompHeaderService} from "../services/ecomp-service";
34import {DataTypesService} from "../services/data-types-service";
35import {ComponentService} from "../services/components/component-service";
36import {ServiceService} from "../services/components/service-service";
37import {ResourceService} from "../services/components/resource-service";
Michael Landoed64b5e2017-06-09 03:19:04 +030038import {LeftPaletteLoaderService} from "../services/components/utils/composition-left-palette-service";
39import {EventListenerService} from "../services/event-listener-service";
40import {ProgressService} from "../services/progress-service";
41import {ArtifactsUtils} from "../utils/artifacts-utils";
42import {FileUtils} from "../utils/file-utils";
43import {ValidationUtils} from "../utils/validation-utils";
44import {AngularJSBridge} from "../services/angular-js-bridge-service";
45import {LoaderService} from "../services/loader-service";
Michael Landoed64b5e2017-06-09 03:19:04 +030046import {CategoryResourceService} from "../services/category-resource-service";
Tal Gitelman51d50f02017-12-10 18:55:03 +020047import {downgradeInjectable} from "@angular/upgrade/static";
48import {ModalService} from "../ng2/services/modal.service";
Michael Lando5b593492018-07-29 16:13:45 +030049import {SdcUiComponents} from "sdc-ui/lib/angular";
Tal Gitelman51d50f02017-12-10 18:55:03 +020050import {ComponentServiceNg2} from "../ng2/services/component-services/component.service";
51import {ServiceServiceNg2} from "../ng2/services/component-services/service.service";
Michael Landoa5445102018-03-04 14:53:33 +020052import {ComponentServiceFactoryNg2} from "../ng2/services/component-services/component.service.factory";
Tal Gitelman51d50f02017-12-10 18:55:03 +020053import {ConnectionWizardService} from "../ng2/pages/connection-wizard/connection-wizard.service";
54import {ComponentInstanceServiceNg2} from "../ng2/services/component-instance-services/component-instance.service";
55import {UserService as UserServiceNg2} from "../ng2/services/user.service";
Michael Lando5b593492018-07-29 16:13:45 +030056import {PoliciesService as PoliciesServiceNg2} from "../ng2/services/policies.service";
57import {GroupsService as GroupsServiceNg2} from "../ng2/services/groups.service";
Idan Amiteedaaf92018-01-31 13:27:33 +020058import {PluginsService} from "../ng2/services/plugins.service";
Idan Amitf97bae32018-03-06 13:52:58 +020059import {EventBusService} from "../ng2/services/event-bus.service";
Michael Landoa5445102018-03-04 14:53:33 +020060import {DynamicComponentService} from "app/ng2/services/dynamic-component.service";
Michael Lando5b593492018-07-29 16:13:45 +030061import {AutomatedUpgradeService} from "../ng2/pages/automated-upgrade/automated-upgrade.service";
62import {ArchiveService as ArchiveServiceNg2} from "app/ng2/services/archive.service";
63import {ComponentFactory} from "app/utils/component-factory";
Michael Landoed64b5e2017-06-09 03:19:04 +030064
65let moduleName:string = 'Sdc.Services';
66let serviceModule:ng.IModule = angular.module(moduleName, []);
67
68serviceModule.service('Sdc.Services.ConfigurationUiService', ConfigurationUiService);
69serviceModule.service('Sdc.Services.CookieService', CookieService);
Michael Lando5b593492018-07-29 16:13:45 +030070serviceModule.service('Sdc.Services.ComponentFactory', ComponentFactory); // Why you need to declare it again, already done in utils.ts
Michael Landoed64b5e2017-06-09 03:19:04 +030071serviceModule.service('Sdc.Services.EntityService', EntityService);
72serviceModule.service('Sdc.Services.AvailableIconsService', AvailableIconsService);
73serviceModule.service('Sdc.Services.UrlToBase64Service', UrlToBase64Service);
74serviceModule.service('Sdc.Services.CacheService', CacheService);
75serviceModule.service('Sdc.Services.HeaderInterceptor', HeaderInterceptor);
76serviceModule.service('Sdc.Services.HttpErrorInterceptor', HttpErrorInterceptor);
77serviceModule.service('Sdc.Services.SharingService', SharingService);
78serviceModule.service('Sdc.Services.SdcVersionService', SdcVersionService);
79serviceModule.service('Sdc.Services.ActivityLogService', ActivityLogService);
80serviceModule.service('Sdc.Services.OnboardingService', OnboardingService);
81serviceModule.service('Sdc.Services.EcompHeaderService', EcompHeaderService);
82serviceModule.service('Sdc.Services.DataTypesService', DataTypesService);
83
84//Components Services
85serviceModule.service('Sdc.Services.Components.ComponentService', ComponentService);
86serviceModule.service('Sdc.Services.Components.ServiceService',ServiceService);
87serviceModule.service('Sdc.Services.Components.ResourceService', ResourceService);
Michael Landoed64b5e2017-06-09 03:19:04 +030088serviceModule.service('LeftPaletteLoaderService', LeftPaletteLoaderService);
89serviceModule.service('EventListenerService', EventListenerService);
90serviceModule.service('Sdc.Services.ProgressService', ProgressService);
91
92//Utils
93serviceModule.service('ArtifactsUtils', ArtifactsUtils);
94serviceModule.service('FileUtils', FileUtils);
95serviceModule.service('ValidationUtils', ValidationUtils);
96
97serviceModule.service('AngularJSBridge',AngularJSBridge);
98serviceModule.service('LoaderService', LoaderService);
99
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
103serviceModule.factory('ComponentServiceNg2', downgradeInjectable(ComponentServiceNg2));
Michael Landoa5445102018-03-04 14:53:33 +0200104serviceModule.factory('ComponentServiceFactoryNg2', downgradeInjectable(ComponentServiceFactoryNg2));
Tal Gitelman51d50f02017-12-10 18:55:03 +0200105serviceModule.factory('ServiceServiceNg2', downgradeInjectable(ServiceServiceNg2));
106serviceModule.factory('ModalServiceNg2', downgradeInjectable(ModalService));
Michael Lando5b593492018-07-29 16:13:45 +0300107serviceModule.factory('ModalServiceSdcUI', downgradeInjectable(SdcUiComponents.ModalService));
Tal Gitelman51d50f02017-12-10 18:55:03 +0200108serviceModule.factory('ConnectionWizardServiceNg2', downgradeInjectable(ConnectionWizardService));
109serviceModule.factory('ComponentInstanceServiceNg2', downgradeInjectable(ComponentInstanceServiceNg2));
Idan Amitae4ab932018-01-23 15:53:11 +0200110serviceModule.factory('UserServiceNg2', downgradeInjectable(UserServiceNg2));
Michael Lando5b593492018-07-29 16:13:45 +0300111serviceModule.factory('PoliciesServiceNg2', downgradeInjectable(PoliciesServiceNg2));
112serviceModule.factory('GroupsServiceNg2', downgradeInjectable(GroupsServiceNg2));
Idan Amiteedaaf92018-01-31 13:27:33 +0200113serviceModule.factory('PluginsService', downgradeInjectable(PluginsService));
Idan Amitf97bae32018-03-06 13:52:58 +0200114serviceModule.factory('EventBusService', downgradeInjectable(EventBusService));
Michael Landoa5445102018-03-04 14:53:33 +0200115serviceModule.factory('DynamicComponentService', downgradeInjectable(DynamicComponentService));
Michael Lando5b593492018-07-29 16:13:45 +0300116serviceModule.factory('ArchiveServiceNg2', downgradeInjectable(ArchiveServiceNg2));
117serviceModule.factory('AutomatedUpgradeService', downgradeInjectable(AutomatedUpgradeService));