UNPKG

@c8y/ngx-components

Version:

Angular modules for Cumulocity IoT applications

275 lines (261 loc) 13.5 kB
import * as i0 from '@angular/core'; import { OnInit, EventEmitter } from '@angular/core'; import * as i1 from '@c8y/ngx-components'; import { AppStateService, AlertService, ModalService, ForOfFilterPipe, PopoverConfirmButtons, PopoverConfirmComponent } from '@c8y/ngx-components'; import * as _c8y_client from '@c8y/client'; import { FetchClient, IFetchResponse, IApplication, InventoryService, IdentityService, IManagedObject, IResultList } from '@c8y/client'; import * as i2 from '@angular/router'; import { Router } from '@angular/router'; import { NgForm } from '@angular/forms'; import { TranslateService } from '@ngx-translate/core'; import { BsModalService, BsModalRef } from 'ngx-bootstrap/modal'; declare enum ConnectionType { ACTILITY = 0, SIGFOX = 1, LORIOT = 2 } interface Connection { name: string; baseUrl: string; username: string; password: string; description: string; } interface SigfoxConnection extends Connection { parentGroupId: string; } interface ActilityConnection extends Connection { profileId: string; routeApplicationServerId?: string; routeApplicationServerKey?: string; adminApiVersion: string; coreApiVersion: string; enterpriseConnection: boolean; } interface LoriotConnection extends Connection { providerType: string; } type LpwanState = 'loadingConnection' | 'loadingError' | 'connectionAvailable' | 'connectionNotAvailable' | 'addConnections' | 'savedSuccessfully' | 'updateConnection'; declare class MultipleLnsConnectorService { private client; private appStateService; private alertService; private headers; constructor(client: FetchClient, appStateService: AppStateService, alertService: AlertService); list(connectionType: ConnectionType): Promise<IFetchResponse>; /** * Saves the connection. * @param connection The connection to be saved. * @param originalName The original name of the connection, required to perform an update. */ save(connection: ActilityConnection | SigfoxConnection | LoriotConnection, originalName?: string): Promise<IFetchResponse>; detail(connectionType: ConnectionType, connectionName: string): Promise<ActilityConnection | SigfoxConnection | LoriotConnection | null>; exists(connectionType: ConnectionType, connectionName: string): Promise<boolean>; create(connection: ActilityConnection | SigfoxConnection | LoriotConnection): Promise<IFetchResponse>; update(connection: ActilityConnection | SigfoxConnection | LoriotConnection, originalName: string): Promise<IFetchResponse>; getBaseUrlByConnection(connection: ActilityConnection | SigfoxConnection | LoriotConnection): "service/sigfox-agent" | "service/actility" | "service/loriot" | ""; getBaseUrlByType(connectionType: ConnectionType): "service/sigfox-agent" | "service/actility" | "service/loriot" | ""; delete(connection: ActilityConnection | SigfoxConnection | LoriotConnection): Promise<IFetchResponse>; getApplication(name: string): Partial<IApplication>; download(url: string): Promise<IFetchResponse>; static ɵfac: i0.ɵɵFactoryDeclaration<MultipleLnsConnectorService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<MultipleLnsConnectorService>; } declare class SigfoxMultipleLnsConnectorComponent implements OnInit { private connectorService; private alertService; private translateService; private modalService; private modal; state: LpwanState; cloneDeep: any; connection: SigfoxConnection; connections: SigfoxConnection[]; showPassword: boolean; connectorsForm: NgForm; cardHeader: "Sigfox connections"; allowedSpecialCharacters: string; namePattern: string; namePatternError: any; originalConnection: SigfoxConnection; constructor(connectorService: MultipleLnsConnectorService, alertService: AlertService, translateService: TranslateService, modalService: BsModalService, modal: ModalService); ngOnInit(): Promise<void>; loadConnections(): Promise<void>; setModel(connectionObj?: any): Promise<void>; resetEditedUnsavedConnection(): Promise<SigfoxConnection | undefined>; addConnection(): Promise<void>; save(): Promise<void>; deleteConnection(originalConnection: any): Promise<void>; changePassword(): void; private saveConnection; private delete; static ɵfac: i0.ɵɵFactoryDeclaration<SigfoxMultipleLnsConnectorComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<SigfoxMultipleLnsConnectorComponent, "sigfox-multiple-lns-connector", never, {}, {}, never, never, true, never>; } declare class NoConnectionsFoundComponent { onAction: EventEmitter<void>; header: string; addConnection(): void; static ɵfac: i0.ɵɵFactoryDeclaration<NoConnectionsFoundComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<NoConnectionsFoundComponent, "no-connections-found", never, { "header": { "alias": "header"; "required": false; }; }, { "onAction": "onAction"; }, never, never, true, never>; } declare class ActilityMultipleLnsConnectorComponent implements OnInit { private connectorService; private alertService; private translateService; private modal; private modalService; state: LpwanState; connection: ActilityConnection; connections: ActilityConnection[]; connectorsForm: NgForm; showPassword: boolean; cardHeader: "Actility connections"; allowedSpecialCharacters: string; namePattern: string; namePatternError: any; originalConnection: ActilityConnection; constructor(connectorService: MultipleLnsConnectorService, alertService: AlertService, translateService: TranslateService, modal: ModalService, modalService: BsModalService); ngOnInit(): Promise<void>; loadConnections(): Promise<void>; setModel(connectionObj?: any): Promise<void>; setAdminAndCoreApiVersion(): Promise<void>; resetEditedUnsavedConnection(): Promise<void>; addConnection(): Promise<void>; save(): Promise<void>; deleteConnection(originalConnection: any): Promise<void>; changePassword(): void; saveConnection(): Promise<void>; private delete; static ɵfac: i0.ɵɵFactoryDeclaration<ActilityMultipleLnsConnectorComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<ActilityMultipleLnsConnectorComponent, "actility-multiple-lns-connector", never, {}, {}, never, never, true, never>; } declare class LoriotMultipleLnsConnectorComponent implements OnInit { private connectorService; private alertService; private translateService; private modalService; private modal; state: LpwanState; cloneDeep: any; connection: LoriotConnection; connections: LoriotConnection[]; showPassword: boolean; connectorsForm: NgForm; cardHeader: "LORIOT connections"; allowedSpecialCharacters: string; namePattern: string; namePatternError: any; originalConnection: LoriotConnection; constructor(connectorService: MultipleLnsConnectorService, alertService: AlertService, translateService: TranslateService, modalService: BsModalService, modal: ModalService); ngOnInit(): Promise<void>; loadConnections(): Promise<void>; setModel(connectionObj?: any): Promise<void>; resetEditedUnsavedConnection(): Promise<LoriotConnection | undefined>; addConnection(): Promise<void>; save(): Promise<void>; deleteConnection(originalConnection: any): Promise<void>; changePassword(): void; private saveConnection; private delete; static ɵfac: i0.ɵɵFactoryDeclaration<LoriotMultipleLnsConnectorComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<LoriotMultipleLnsConnectorComponent, "loriot-multiple-lns-connector", never, {}, {}, never, never, true, never>; } declare class ConnectionInfoWithDownloadCsvComponent { private modal; private connectorService; private alertService; private translateService; messageData: any; appData: IApplication; modalTitle: string; connectionName: string; constructor(modal: BsModalRef, connectorService: MultipleLnsConnectorService, alertService: AlertService, translateService: TranslateService); dismiss(): void; download(): Promise<void>; static ɵfac: i0.ɵɵFactoryDeclaration<ConnectionInfoWithDownloadCsvComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<ConnectionInfoWithDownloadCsvComponent, "connection-info-with-download-csv", never, { "messageData": { "alias": "messageData"; "required": false; }; "appData": { "alias": "appData"; "required": false; }; "modalTitle": { "alias": "modalTitle"; "required": false; }; "connectionName": { "alias": "connectionName"; "required": false; }; }, {}, never, never, true, never>; } declare class MultipleLnsConnectorsModule { static ɵfac: i0.ɵɵFactoryDeclaration<MultipleLnsConnectorsModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<MultipleLnsConnectorsModule, never, [typeof i1.CoreModule, typeof i1.CommonModule, typeof i1.FormsModule, typeof i2.RouterModule, typeof SigfoxMultipleLnsConnectorComponent, typeof NoConnectionsFoundComponent, typeof ActilityMultipleLnsConnectorComponent, typeof LoriotMultipleLnsConnectorComponent, typeof ConnectionInfoWithDownloadCsvComponent], never>; static ɵinj: i0.ɵɵInjectorDeclaration<MultipleLnsConnectorsModule>; } declare class LpwanSetDeviceProtocolService { private inventoryService; private client; private identityService; private lnsService; supportedDevicesCfgs: { name: string; match: (device: any) => boolean; protocolTypes: string[]; externalIdTypes: string[]; connectionType: ConnectionType; }[]; private readonly header; constructor(inventoryService: InventoryService, client: FetchClient, identityService: IdentityService, lnsService: MultipleLnsConnectorService); refreshCache(device: any): Promise<_c8y_client.IFetchResponse>; getMicroserviceUrl(device: any): string; isSupportedDevice(device: IManagedObject): boolean; getCurrentProtocol(device: IManagedObject): Promise<IManagedObject>; applyProtocol(device: IManagedObject, selectedProtocol: IManagedObject): Promise<_c8y_client.IResult<IManagedObject>>; getAvailableProtocols(device: IManagedObject): Promise<IResultList<IManagedObject>>; getAvailableConnections(device: IManagedObject): Promise<IResultList<ActilityConnection | SigfoxConnection>>; private getProtocolTypesMatchingDevice; private getExternalId; static ɵfac: i0.ɵɵFactoryDeclaration<LpwanSetDeviceProtocolService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<LpwanSetDeviceProtocolService>; } declare class LpwanAssignDeviceProtocolComponent implements OnInit { private lpwanService; private alertService; private router; private inventoryService; loading: boolean; device: IManagedObject; currentProtocol: IManagedObject; availableProtocols: IResultList<IManagedObject>; newProtocol: IManagedObject; filterProtocols: ForOfFilterPipe<IManagedObject>; pattern: string; lpwanSetDeviceProtocolForm: NgForm; constructor(lpwanService: LpwanSetDeviceProtocolService, alertService: AlertService, router: Router, inventoryService: InventoryService); ngOnInit(): Promise<void>; setPipe(filterStr: string): void; reload(): Promise<void>; loadDevice(): Promise<void>; apply(selectedProtocol: any): Promise<void>; refreshCache(): Promise<void>; static ɵfac: i0.ɵɵFactoryDeclaration<LpwanAssignDeviceProtocolComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<LpwanAssignDeviceProtocolComponent, "set-device-protocol", never, {}, {}, never, never, true, never>; } declare class LpwanAssignLnsConnectionsComponent implements OnInit { private lpwanService; private alertService; loading: boolean; device: IManagedObject; buttons: PopoverConfirmButtons[]; reRegisterMsg: "To change provider connection, you need to re-register device first."; filterConnection: ForOfFilterPipe<ActilityConnection | SigfoxConnection>; pattern: string; popoverConfirm: PopoverConfirmComponent; newConnection: ActilityConnection | SigfoxConnection; availableConnections: IResultList<ActilityConnection | SigfoxConnection>; currentConnection: ActilityConnection | SigfoxConnection; constructor(lpwanService: LpwanSetDeviceProtocolService, alertService: AlertService); ngOnInit(): Promise<void>; setConnectionPipe(filterStr: string): void; reload(): Promise<void>; togglePopover(popoverCfrm: any): void; deviceReregister(): Promise<unknown>; static ɵfac: i0.ɵɵFactoryDeclaration<LpwanAssignLnsConnectionsComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<LpwanAssignLnsConnectionsComponent, "set-lns-connections", never, { "device": { "alias": "device"; "required": false; }; }, {}, never, never, true, never>; } declare class LpwanProtocolModule { static ɵfac: i0.ɵɵFactoryDeclaration<LpwanProtocolModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<LpwanProtocolModule, never, [typeof i1.CoreModule, typeof i1.FormsModule, typeof LpwanAssignDeviceProtocolComponent, typeof LpwanAssignLnsConnectionsComponent], never>; static ɵinj: i0.ɵɵInjectorDeclaration<LpwanProtocolModule>; } export { LpwanAssignDeviceProtocolComponent, LpwanProtocolModule, MultipleLnsConnectorsModule }; //# sourceMappingURL=index.d.ts.map