UNPKG

@c8y/ngx-components

Version:

Angular modules for Cumulocity IoT applications

349 lines (332 loc) 18.1 kB
import * as i0 from '@angular/core'; import { OnInit, OnDestroy, EventEmitter, PipeTransform } from '@angular/core'; import * as _c8y_ngx_components from '@c8y/ngx-components'; import { DataGridComponent, ApplicationPlugin, ActionControl, BulkActionControl, HeaderActionControl, Pagination, DisplayOptions, Column, PluginsService, AlertService, GainsightService, BottomDrawerService, PackageType, BottomDrawerRef, WizardModalService, CellRendererContext } from '@c8y/ngx-components'; import * as i2 from '@c8y/ngx-components/ecosystem/shared'; import { EcosystemService, FilterableAppOrPlugin, FilterPipe, ApplicationState, ListFiltersComponent } from '@c8y/ngx-components/ecosystem/shared'; import { ActivatedRoute, ActivatedRouteSnapshot } from '@angular/router'; import { ApplicationRemotePlugins, IApplication, IApplicationVersion } from '@c8y/client'; import { BsModalService, BsModalRef } from 'ngx-bootstrap/modal'; import { BehaviorSubject, Observable } from 'rxjs'; import { FormControl } from '@angular/forms'; declare class ApplicationPluginsComponent implements OnInit, OnDestroy { private activatedRoute; private ecosystemService; private bsModalService; private pluginsService; private alertService; private gainsightService; private bottomDrawerService; PRODUCT_EXPERIENCE: { readonly APPLICATIONS: { readonly EVENTS: { readonly AVAILABILITY: "availability"; readonly APPLICATION_CARD: "applicationCard"; readonly APPLICATION_PROPERTIES: "applicationProperties"; readonly DEPLOY_APPLICATION: "deployApplication"; readonly DUPLICATE_APPLICATION: "duplicateApplication"; readonly INSTALLED_PLUGINS: "installedPlugins"; readonly PACKAGE_PLUGINS: "packagePlugins"; readonly PACKAGE_VERSIONS: "packageVersions"; readonly FILTER_LIST: "filterList"; }; readonly COMPONENTS: { readonly APPLICATION_CARD: "application-card"; readonly APPLICATION_PLUGINS: "application-plugins"; readonly APPLICATION_PROPERTIES: "application-properties"; readonly DEPLOY_APPLICATION: "deploy-application"; readonly DUPLICATE_APPLICATION_PROPERTIES: "duplicate-application-properties"; readonly PLUGIN_LIST: "plugin-list"; readonly PACKAGE_VERSIONS: "package-versions-list"; readonly UPDATE_PLUGIN_OF_APP: "update-plugin-of-app"; readonly LIST_FILTERS: "list-filters"; readonly PACKAGE_DETAILS: "package-details"; }; readonly ACTIONS: { readonly AVAILABILITY_CHANGE: "availabilityChange"; readonly CANCEL: "cancel"; readonly CLONE: "clone"; readonly CHANGE_PLUGIN_VERSION: "changePluginVersion"; readonly DELETE: "delete"; readonly DOWNLOAD: "download"; readonly DEPLOY_APPLICATION: "deployApplication"; readonly EDIT: "edit"; readonly INSTALL_PLUGIN: "installPlugin"; readonly INSTALL_PLUGINS: "installPlugins"; readonly UNINSTALL_PLUGIN: "uninstallPlugin"; readonly SELECT_VERSION: "selectVersion"; readonly SET_AS_LATEST: "setAsLatest"; readonly UPDATE_AVAILABLE: "updateAvailable"; readonly UPLOAD: "upload"; readonly SET_FILTER_TERM: "setFilterTerm"; readonly SET_PREDEFINED_FILTERS: "setPredefinedFilters"; readonly RESET_FILTER: "resetFilter"; readonly INSTALL_PLUGINS_INITIATED: "installPluginsInitiated"; readonly DEPLOY_APPLICATION_INITIATED: "deployApplicationInitiated"; }; readonly RESULTS: { readonly DEPLOYED: "deployed"; readonly DUPLICATED: "duplicated"; readonly PLUGIN_INSTALLED: "pluginInstalled"; readonly PLUGIN_REMOVED: "pluginRemoved"; readonly PLUGIN_VERSION_CHANGED: "pluginVersionChanged"; readonly SERVER_FAILURE: "serverFailure"; readonly SUCCESS: "success"; }; }; }; CURRENT_LOCATION: string; appId: string | number; dataGrid: DataGridComponent; remotePlugins$: BehaviorSubject<ApplicationRemotePlugins>; allAvailablePlugins$: BehaviorSubject<ApplicationPlugin[]>; selfPlugins$: BehaviorSubject<ApplicationPlugin[]>; installedPlugins$: Observable<ApplicationPlugin[]>; orphanedPlugins$: Observable<ApplicationPlugin[]>; isStandard$: Observable<boolean>; app: IApplication; isLoading: boolean; title: string; loadMoreItemsLabel: string; loadingItemsLabel: string; actionControls: ActionControl[]; bulkActionControls: BulkActionControl[]; headerActionControls: HeaderActionControl[]; noResultsMessage: "No plugins to display."; noDataMessage: "No plugins installed."; noResultsSubtitle: "Refine your search terms or check your spelling."; noDataSubtitle: "This application doesn't have any plugin. Click below to install."; pagination: Pagination; displayOptions: DisplayOptions; columns: Column[]; private destroy$; constructor(activatedRoute: ActivatedRoute, ecosystemService: EcosystemService, bsModalService: BsModalService, pluginsService: PluginsService, alertService: AlertService, gainsightService: GainsightService, bottomDrawerService: BottomDrawerService); ngOnInit(): void; loadData(): Promise<void>; resetToDefault(): Promise<void>; installPlugins(): Promise<void>; removePlugins(plugins: string[]): Promise<void>; cleanupOrphanedPlugins(plugins: ApplicationPlugin[]): Promise<void>; getActionControls(): ActionControl[]; showPluginReadme(plugin: ApplicationPlugin): void; getBulkActionControls(): BulkActionControl[]; updatePlugin(app: IApplication, plugin: ApplicationPlugin, downgrade?: boolean): Promise<void>; refresh(): void; ngOnDestroy(): void; isStandard(app: IApplication): boolean; private everyRemoteFromManifestIsInConfig; private everyRemoteFromConfigIsInManifest; private addInstallButtonToHeaderActionControls; private handleRemotesInstallation; private emitRemotes; private getApplicationMO; private getApplicationMFExports; private getApplicationMFRemotes; private getAllApplicationsMFExports; private getAllSelfMFExports; private getInstallModalInitState; private getOrphanedPlugins; private splitOrphanedPluginsIntoOrphanedAndRevokedPlugins; private getInstalledPlugins; private extractDetails; private getStringMatchingRegex; private triggerPluginEvent; static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationPluginsComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<ApplicationPluginsComponent, "c8y-app-plugins", never, { "appId": { "alias": "appId"; "required": false; }; }, {}, never, never, true, never>; } declare class PluginListItemComponent implements OnInit { private pluginService; plugin: ApplicationPlugin; selectable: boolean; hideSource: boolean; isItemSelected: EventEmitter<boolean>; packageType: PackageType; readonly PACKAGE_TYPE: typeof PackageType; constructor(pluginService: PluginsService); ngOnInit(): void; onChange(event: any): void; static ɵfac: i0.ɵɵFactoryDeclaration<PluginListItemComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<PluginListItemComponent, "c8y-plugin-list-item", never, { "plugin": { "alias": "plugin"; "required": false; }; "selectable": { "alias": "selectable"; "required": false; }; "hideSource": { "alias": "hideSource"; "required": false; }; }, { "isItemSelected": "isItemSelected"; }, never, never, true, never>; } declare class InstallPluginComponent { private bottomDrawerRef; private ecosystemService; private pluginsService; plugins$: Observable<FilterableAppOrPlugin[]>; filteredPlugins$: Observable<FilterableAppOrPlugin[]>; selectedPlugins: ApplicationPlugin[]; packageTypes: (_c8y_ngx_components.PackageType.OFFICIAL | _c8y_ngx_components.PackageType.COMMUNITY)[]; result: Promise<ApplicationPlugin[]>; onlyLatestPluginVersion: boolean; selectedPlugin: ApplicationPlugin; pluginBaseUrl: string; pluginMarkdown: string; private _install; private _cancel; constructor(bottomDrawerRef: BottomDrawerRef<InstallPluginComponent>, ecosystemService: EcosystemService, pluginsService: PluginsService); setFilterPipe(filterPipe: FilterPipe): void; cancel(): void; install(): void; showPluginOverview(plugin: ApplicationPlugin): Promise<void>; static ɵfac: i0.ɵɵFactoryDeclaration<InstallPluginComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<InstallPluginComponent, "c8y-install-plugin", never, { "plugins$": { "alias": "plugins$"; "required": false; }; }, {}, never, never, true, never>; } type UpdateType = 'install' | 'uninstall'; declare class PluginListService { CURRENT_LOCATION: string; updatingPluginId: Record<UpdateType, string>; private appsDisabled; private gainsightService; private pluginsService; private alertService; private ecosystemService; private humanizeAppNamePipe; private translateService; private bsModalService; updateAppRemotes(plugin: ApplicationPlugin, updateType: UpdateType, pluginPackage: IApplication): Promise<void>; getAppsForUpdate(plugin: ApplicationPlugin, updateType: UpdateType): Promise<IApplication[]>; private onUpdateEventHandleGS; private isPluginInstalledInApp; private getPluginContextPathWithoutVersion; private handleRemotesUpdate; private getAllPluginsToRemove; private selectApps; static ɵfac: i0.ɵɵFactoryDeclaration<PluginListService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<PluginListService>; } declare class PluginListComponent { private pluginListService; CURRENT_LOCATION: string; plugins$: Observable<ApplicationPlugin[]>; emptyListText: string; selectable: boolean; hideSource: boolean; /** * Shows the install button for each plugin separately. Currently used in package-details view. */ installable: boolean; package: IApplication; selectedPlugin: ApplicationPlugin; selectedItems: EventEmitter<ApplicationPlugin[]>; showOverview: EventEmitter<ApplicationPlugin>; selectedPlugins: { [key: string]: ApplicationPlugin; }; updatingPluginId: Record<UpdateType, string>; constructor(pluginListService: PluginListService); updateSelectedItems(selected: boolean, plugin: ApplicationPlugin): void; showPluginOverview(plugin: ApplicationPlugin): void; installPlugin(plugin: ApplicationPlugin): Promise<void>; uninstallPlugin(plugin: ApplicationPlugin): Promise<void>; static ɵfac: i0.ɵɵFactoryDeclaration<PluginListComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<PluginListComponent, "c8y-plugin-list", never, { "plugins$": { "alias": "plugins$"; "required": false; }; "emptyListText": { "alias": "emptyListText"; "required": false; }; "selectable": { "alias": "selectable"; "required": false; }; "hideSource": { "alias": "hideSource"; "required": false; }; "installable": { "alias": "installable"; "required": false; }; "package": { "alias": "package"; "required": false; }; "selectedPlugin": { "alias": "selectedPlugin"; "required": false; }; }, { "selectedItems": "selectedItems"; "showOverview": "showOverview"; }, never, never, true, never>; } declare class AppsToUpdateRemotesSelectComponent implements OnInit, OnDestroy { private bsModalRef; private wizardModalService; private ecosystemService; apps: IApplication[]; updateType: UpdateType; pluginName: string; appsDisabled: Set<IApplication['id']>; private destroy$; filterTerm$: BehaviorSubject<string>; filteredApps$: Observable<IApplication[]>; textConfig: { header: string; applyButton: string; }; appsToUpdateRemotes: IApplication[]; result: Promise<IApplication[]>; private _update; private _cancel; constructor(bsModalRef: BsModalRef, wizardModalService: WizardModalService, ecosystemService: EcosystemService); ngOnInit(): void; cancel(): void; setSelectedApps(selected: boolean, app: IApplication): void; ngOnDestroy(): void; duplicateApp(): Promise<void>; apply(): Promise<void>; private getOwnedHostedApps; static ɵfac: i0.ɵɵFactoryDeclaration<AppsToUpdateRemotesSelectComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<AppsToUpdateRemotesSelectComponent, "c8y-apps-to-update-remotes-select", never, { "apps": { "alias": "apps"; "required": false; }; "updateType": { "alias": "updateType"; "required": false; }; "pluginName": { "alias": "pluginName"; "required": false; }; "appsDisabled": { "alias": "appsDisabled"; "required": false; }; }, {}, never, never, true, never>; } declare class AppStatePipe implements PipeTransform { private ecosystemService; constructor(ecosystemService: EcosystemService); transform(app: IApplication, arg: keyof ApplicationState): ApplicationState[keyof ApplicationState]; static ɵfac: i0.ɵɵFactoryDeclaration<AppStatePipe, never>; static ɵpipe: i0.ɵɵPipeDeclaration<AppStatePipe, "appState", true>; } declare class LabelCellRendererComponent { context: CellRendererContext; constructor(context: CellRendererContext); static ɵfac: i0.ɵɵFactoryDeclaration<LabelCellRendererComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<LabelCellRendererComponent, "c8y-label-cell-renderer", never, {}, {}, never, never, true, never>; } declare class OrphanedStatusCellRendererComponent { context: CellRendererContext; label: { value: string; class: string; text: string; } | null; constructor(context: CellRendererContext); private getLabel; static ɵfac: i0.ɵɵFactoryDeclaration<OrphanedStatusCellRendererComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<OrphanedStatusCellRendererComponent, "c8y-orphaned-status-cell-renderer", never, {}, {}, never, never, true, never>; } declare class UpdatePluginOfAppComponent { private bsModalRef; private pluginsService; private alert; private ecosystemService; private gainsightService; CURRENT_LOCATION: string; app: IApplication; plugin: ApplicationPlugin; downgrade: boolean; result: Promise<void>; applicationVersion: IApplicationVersion; updateAll: boolean; private _install; private _cancel; constructor(bsModalRef: BsModalRef, pluginsService: PluginsService, alert: AlertService, ecosystemService: EcosystemService, gainsightService: GainsightService); update(): Promise<void>; cancel(): void; static ɵfac: i0.ɵɵFactoryDeclaration<UpdatePluginOfAppComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<UpdatePluginOfAppComponent, "c8y-update-plugin-of-app", never, {}, {}, never, never, true, never>; } declare class OnlyLatestFilterComponent { filterComponent: ListFiltersComponent; onlyLatestFormControl: FormControl; private readonly filterLabel; constructor(filterComponent: ListFiltersComponent); static ɵfac: i0.ɵɵFactoryDeclaration<OnlyLatestFilterComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<OnlyLatestFilterComponent, "c8y-only-latest-filter", never, {}, {}, never, never, true, never>; } declare class ApplicationPluginReadmeComponent implements OnInit { pluginMarkdown: string; pluginBaseUrl: string; plugin: ApplicationPlugin; private bottomDrawerRef; private pluginsService; ngOnInit(): Promise<void>; close(): void; static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationPluginReadmeComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<ApplicationPluginReadmeComponent, "c8y-application-plugin-readme", never, {}, {}, never, never, true, never>; } declare class ApplicationPluginsModule { static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationPluginsModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<ApplicationPluginsModule, never, [typeof _c8y_ngx_components.CoreModule, typeof i2.SharedEcosystemModule, typeof ApplicationPluginsComponent, typeof PluginListItemComponent, typeof InstallPluginComponent, typeof PluginListComponent, typeof AppsToUpdateRemotesSelectComponent, typeof AppStatePipe, typeof LabelCellRendererComponent, typeof OrphanedStatusCellRendererComponent, typeof UpdatePluginOfAppComponent, typeof OnlyLatestFilterComponent, typeof ApplicationPluginReadmeComponent], [typeof ApplicationPluginsComponent, typeof PluginListItemComponent, typeof InstallPluginComponent, typeof PluginListComponent, typeof AppsToUpdateRemotesSelectComponent, typeof AppStatePipe, typeof LabelCellRendererComponent, typeof OrphanedStatusCellRendererComponent, typeof UpdatePluginOfAppComponent, typeof OnlyLatestFilterComponent]>; static ɵinj: i0.ɵɵInjectorDeclaration<ApplicationPluginsModule>; } declare class ApplicationPluginsGuard { private ecosystemService; constructor(ecosystemService: EcosystemService); canActivate(route: ActivatedRouteSnapshot): boolean; static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationPluginsGuard, never>; static ɵprov: i0.ɵɵInjectableDeclaration<ApplicationPluginsGuard>; } export { AppStatePipe, ApplicationPluginsComponent, ApplicationPluginsGuard, ApplicationPluginsModule, AppsToUpdateRemotesSelectComponent, InstallPluginComponent, LabelCellRendererComponent, OnlyLatestFilterComponent, OrphanedStatusCellRendererComponent, PluginListComponent, PluginListItemComponent, UpdatePluginOfAppComponent }; //# sourceMappingURL=index.d.ts.map