import * as i0 from '@angular/core'; import { AfterViewInit, OnDestroy, ChangeDetectorRef, OnInit, TemplateRef, Type, InjectionToken, Injector } from '@angular/core'; import { FormlyFormOptions, FormlyFieldConfig } from '@ngx-formly/core'; import * as i3 from '@c8y/ngx-components'; import { AlertService, IRealtimeDeviceBootstrap, TenantUiService, GainsightService, FeatureCacheService, C8yStepper, DeviceBootstrapRealtimeService, ModalService, OptionsService, C8yJSONSchema, AppStateService, ExtensionFactory, ExtensionPointWithoutStateForPlugins, PluginsResolveService, GenericHookType, GenericHookOptions } from '@c8y/ngx-components'; import { FormGroup } from '@angular/forms'; import * as rxjs from 'rxjs'; import { Subject, BehaviorSubject, Observable } from 'rxjs'; import { IDeviceRegistrationLimit, IDeviceRegistration, Paging, DeviceRegistrationService, IDeviceRegistrationCreate, DeviceRegistrationStatus, TenantService, InventoryService, IDeviceRegistrationBulkResult, DeviceRegistrationBulkService, ApplicationService, FetchClient, IResult } from '@c8y/client'; import * as i4 from '@angular/router'; import { Router, ActivatedRoute } from '@angular/router'; import { CdkStep } from '@angular/cdk/stepper'; import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal'; import * as i1 from 'ngx-bootstrap/dropdown'; import * as i2 from 'ngx-bootstrap/popover'; import { TranslateService } from '@ngx-translate/core'; import { JSONSchema7 } from 'json-schema'; import * as _c8y_ngx_components_register_device from '@c8y/ngx-components/register-device'; declare class RegisterDeviceService { private router; private deviceRegService; private alertService; readonly _loading: Subject; readonly _limit: BehaviorSubject; readonly _deviceRegistrationRequests: BehaviorSubject<{ data: IDeviceRegistration[]; paging?: Paging; }>; readonly deviceRegistrationRequests$: Observable<{ data: IDeviceRegistration[]; paging?: Paging; }>; readonly loading$: Observable; readonly limit$: Observable; paging: Paging; private readonly deviceRegUrl; private endSubscriptions; constructor(router: Router, deviceRegService: DeviceRegistrationService, alertService: AlertService); isDeviceRegistration(): boolean; internalListUpdate(deviceRequests: IDeviceRegistration[], pagingObject?: Paging): void; onDeviceBootstrap(bsData: IRealtimeDeviceBootstrap): void; list(pageSize?: number): void; createMultiple(newDeviceRequests: IDeviceRegistrationCreate[]): Observable<{ success: IDeviceRegistration[]; failed: IDeviceRegistration[]; }>; remove(id: string): void; accept(request: IDeviceRegistration): void; acceptAll(): void; limit(): void; getRequestByStatus(status: DeviceRegistrationStatus): IDeviceRegistration[]; ngOnDestroy(): void; private updateStatusById; private removeDeviceRegistrationRequestById; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } interface GeneralDeviceRegistrationModelType { id: string; tenant?: { id: string; }; group?: { id: string; name?: string; }; oneTimePassword?: string; } declare class GeneralDeviceRegistrationComponent implements AfterViewInit, OnDestroy { private tenantUIService; private tenantService; private registerDeviceService; private inventoryService; private cd; bsModalRef: BsModalRef; private gainsightService; private featureCacheService; readonly MANAGEMENT = "management"; readonly FILTER: object; useEST$: BehaviorSubject; certificateAuthorityFeatureEnabled: Observable; form: FormGroup<{}>; model: { devicesToCreate: GeneralDeviceRegistrationModelType[]; }; options: FormlyFormOptions; PRODUCT_EXPERIENCE: { EVENT: string; COMPONENT: string; RESULT: { SUCCESS: string; FAILURE: string; }; }; isLoading$: Observable; success: { id: string; }[]; failed: { id: string; message?: string; details?: any; }[]; fields: FormlyFieldConfig[]; result: Promise; private onSuccessfulClosing; private onCancel; private destroy$; private lastCreatedDevices; constructor(tenantUIService: TenantUiService, tenantService: TenantService, registerDeviceService: RegisterDeviceService, inventoryService: InventoryService, cd: ChangeDetectorRef, bsModalRef: BsModalRef, gainsightService: GainsightService, featureCacheService: FeatureCacheService); ngAfterViewInit(): void; ngOnDestroy(): void; registerDevice(eventObject: { stepper: C8yStepper; step: CdkStep; }): void; fixErrors(event: { stepper: C8yStepper; step: CdkStep; }, failedRequests: any): void; close(): void; cancel(): void; private create; private canLoadTenants$; private getTenants$; private getGroups$; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class GeneralDeviceRegistrationService { private modalService; open(initialState?: Partial): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class GeneralDeviceRegistrationButtonComponent { private registrationService; constructor(registrationService: GeneralDeviceRegistrationService); open(): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class DeviceRegistrationViewComponent implements OnInit, OnDestroy { private registerDeviceService; private bootstrapRealtimeService; private tenantUiService; private modalService; private translateService; private optionsService; private activatedRoute; private generalRegistration; deviceRequests$: Observable<{ data: IDeviceRegistration[]; paging?: Paging; }>; limit$: Observable; limitReachedInfo$: Observable; requireSecurityToken: boolean; isManagementTenant: boolean; isLoading: boolean; gridOrList: 'interact-list' | 'interact-grid'; status: typeof DeviceRegistrationStatus; readonly statusProps: { [DeviceRegistrationStatus.WAITING_FOR_CONNECTION]: { label: "Waiting for connection"; icon: string; cls: string; }; [DeviceRegistrationStatus.PENDING_ACCEPTANCE]: { label: "Pending acceptance"; icon: string; cls: string; }; [DeviceRegistrationStatus.ACCEPTED]: { label: "Accepted"; icon: string; cls: string; }; [DeviceRegistrationStatus.BLOCKED]: { label: "Blocked"; icon: string; cls: string; }; }; private unsubscribe$; private readonly _securityTokenPolicy; constructor(registerDeviceService: RegisterDeviceService, bootstrapRealtimeService: DeviceBootstrapRealtimeService, tenantUiService: TenantUiService, modalService: ModalService, translateService: TranslateService, optionsService: OptionsService, activatedRoute: ActivatedRoute, generalRegistration: GeneralDeviceRegistrationService); ngOnInit(): void; ngOnDestroy(): void; updateList(data: any): void; handleQueryParams(): Promise; delete(id: string): Promise; accept(request: IDeviceRegistration): void; acceptAll(): void; canAcceptAll(): boolean; loadAll(): void; displayMode(listClass: 'interact-list' | 'interact-grid'): void; setRequireSecurityToken(): Promise; setIsManagementTenant(): Promise; shouldShowSecurityTokenInput(data: IDeviceRegistration): boolean; showTokenInputBasedOnSecurityMode(): boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } interface BulkFileExample { title: string; description: string; url: URL; } interface BulkDescription { exampleFileUrls: BulkFileExample[]; title: string; } interface BulkResult { operationId: string; sourceDeviceId: string; message: string; } interface BulkFailedResult { error: string; message: string; } declare class BulkDeviceRegistrationModalComponent { private jsonschema; private deviceRegistrationService; private registerDeviceService; private bsModalRef; private gainsightService; private featureCacheService; private translateService; stepper: C8yStepper; message: string; success: boolean; pending: boolean; result: IDeviceRegistrationBulkResult; failedResult: BulkFailedResult; form: FormGroup<{}>; model: {}; template: FormlyFieldConfig[]; certificateAuthorityFeatureEnabled: rxjs.Observable; constructor(jsonschema: C8yJSONSchema, deviceRegistrationService: DeviceRegistrationBulkService, registerDeviceService: RegisterDeviceService, bsModalRef: BsModalRef, gainsightService: GainsightService, featureCacheService: FeatureCacheService, translateService: TranslateService); ngOnInit(): void; upload(): void; downloadSimple(): void; downloadFull(): void; downloadEst(): void; download(headers: string[], fileName: string): void; complete(): void; cancel(): void; private getFile; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } interface ApplicationExtension { name: string; description: string; type: string; } interface ExtensibleDeviceRegistrationProvider extends ApplicationExtension { contextPath: string; } declare class BulkDeviceRegistrationButtonComponent { private modalService; bulkProvidersMetaData: Promise; constructor(modalService: BsModalService); click(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class BaseExtensibleDeviceRegistrationService { protected applicationService: ApplicationService; protected stateService: AppStateService; constructor(applicationService: ApplicationService, stateService: AppStateService); protected getMetadataUrl(contextPath: string): string; protected getServiceBaseUrl(contextPath: string): string; protected getDeviceRegistrationProviders(bulk: boolean): Promise; private listMicroservicesByUser; private getProvidersFromManifestExtensions; private getProvidersFromExtensions; private appSupportingExtensibleDeviceRegistrationForm; } interface ExtensibleDeviceRegistrationSchema { title: string; description?: string; pages?: JSONSchema7[]; } declare class ExtensibleDeviceRegistrationService extends BaseExtensibleDeviceRegistrationService { protected applicationService: ApplicationService; protected stateService: AppStateService; private client; constructor(applicationService: ApplicationService, stateService: AppStateService, client: FetchClient); getSchema(contextPath: string): Promise; getDeviceRegistrationProviders(): Promise; registerDevice(contextPath: string, model: any): Promise>; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class ExtensibleDeviceRegistrationButtonComponent implements OnInit { private deviceRegistrationService; private modalService; providersMetaData: Promise; constructor(deviceRegistrationService: ExtensibleDeviceRegistrationService, modalService: BsModalService); ngOnInit(): void; click(providerMetaData: ExtensibleDeviceRegistrationProvider): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ExtensibleDeviceRegistrationModalComponent implements OnInit { bsModalRef: BsModalRef; private jsonschema; private registrationService; title: string; loadingErrorMessage: string; pages: FormlyFieldConfig[][]; labels: string[]; contextPath: string; constructor(bsModalRef: BsModalRef, jsonschema: C8yJSONSchema, registrationService: ExtensibleDeviceRegistrationService); ngOnInit(): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ExtensibleDeviceRegistrationStepperComponent implements OnInit { private customProviderService; private registerDeviceService; private bsModalRef; private gainsightService; message: string; errorMessage: string; pendingStatus: boolean; forms: FormGroup[]; model: any; stepper: C8yStepper; contextPath: string; labels: string[]; steps: FormlyFieldConfig[][]; private readonly SERVER_ERROR; private readonly SUCCESSFUL_REGISTRATION; private readonly NO_CONNECTION; constructor(customProviderService: ExtensibleDeviceRegistrationService, registerDeviceService: RegisterDeviceService, bsModalRef: BsModalRef, gainsightService: GainsightService); ngOnInit(): void; save(): Promise; close(): void; complete(): void; goToFirstStep(): void; isRegistrationStep(): boolean; finalStepStatus(): string; private handleError; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class BulkExtensibleDeviceRegistrationService extends BaseExtensibleDeviceRegistrationService { protected applicationService: ApplicationService; protected stateService: AppStateService; private client; constructor(applicationService: ApplicationService, stateService: AppStateService, client: FetchClient); getDeviceRegistrationProviders(): Promise; getBulkDescription(contextPath: string): Promise; upload(csv: File, contextPath: any): Promise>; getBulkUrl(contextPath: string): string; private createBinaryRequestBody; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class ExtensibleBulkDeviceRegistrationModalComponent implements OnInit { private jsonschema; private bulkExtensibleDeviceRegistrationService; private registerDeviceService; private bsModalRef; private gainsightService; stepper: C8yStepper; title: string; examples: BulkFileExample[]; message: string; success: boolean; loadingError: boolean; pending: boolean; contextPath: string; result: BulkResult | BulkFailedResult; form: FormGroup<{}>; model: {}; template: FormlyFieldConfig[]; constructor(jsonschema: C8yJSONSchema, bulkExtensibleDeviceRegistrationService: BulkExtensibleDeviceRegistrationService, registerDeviceService: RegisterDeviceService, bsModalRef: BsModalRef, gainsightService: GainsightService); ngOnInit(): Promise; upload(): Promise; getFile(model: any): any; complete(): void; cancel(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ExtensibleBulkDeviceRegistrationButtonComponent implements OnInit { private bulkExtensibleDeviceRegistrationService; private modalService; bulkProvidersMetaData: Promise; constructor(bulkExtensibleDeviceRegistrationService: BulkExtensibleDeviceRegistrationService, modalService: BsModalService); ngOnInit(): void; click(contextPath: any): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * A register device item is the entry point to define * a specific registration flow. */ interface RegisterDeviceItem { /** * Angular template used for Content Projection */ template: TemplateRef | Type | Element; /** * Ordering of the device registration possibilities (high number first) */ priority: number; /** * Category of registration */ category: 'bulk' | 'single'; } /** * Factory to implement if used in a hook for Multi Provider extension. */ type RegisterDeviceFactory = ExtensionFactory; /** * An extension HOOK can use either a pure value: * ```typescript * { provide: HOOK_X, useValue: { ...hookValue }, multi: true } * ``` * * Or an array to directly register multiple: * ```typescript * { provide: HOOK_X, useValue: [{ ...hookValues }], multi: true } * ``` * * Or an ExtensionFactory which allows to define a get() function. This function * gets called on each navigation with the current route and can return values * async (observable or promise). * ```typescript * { provide: HOOK_X, useFactory: { get: (route) => doSomethingAsync(route) }, multi: true } * ``` */ type RegisterDeviceExtension = RegisterDeviceItem | RegisterDeviceItem[] | ExtensionFactory; /** * A hook to use for Multi Provider extension. * @deprecated Consider using the `hookDeviceRegistration` function instead. */ declare const HOOK_DEVICE_REGISTRATION: InjectionToken; /** * You can either provide a single `RegisterDeviceExtension` as parameter: * ```typescript * hookDeviceRegistration(...) * ``` * * Or an array to directly register multiple: * ```typescript * hookDeviceRegistration([...]) * ``` * * Or you provide an Service that implements `ExtensionFactory` * ```typescript * export class MyDeviceRegistrationFactory implements ExtensionFactory {...} * ... * hookDeviceRegistration(MyDeviceRegistrationFactory) * ``` * A typed alternative to `HOOK_DEVICE_REGISTRATION`. * @param registration The `RegisterDeviceExtension`'s or `ExtensionFactory` to be provided. * @returns An `Provider` to be provided in your module. */ declare function hookDeviceRegistration(registration: GenericHookType, options?: Partial): i0.ValueProvider | i0.ClassProvider | i0.ExistingProvider; /** * A service which defines device registration options. */ declare class RegisterDeviceExtensionService extends ExtensionPointWithoutStateForPlugins { private router; constructor(rootInjector: Injector, router: Router, plugins: PluginsResolveService); protected setupItemsObservable(): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class RegisterDeviceDropdownComponent { private registerDeviceExtensionService; private registerDeviceService; single$: Observable<_c8y_ngx_components_register_device.RegisterDeviceItem[]>; bulk$: Observable<_c8y_ngx_components_register_device.RegisterDeviceItem[]>; limit$: Observable; constructor(registerDeviceExtensionService: RegisterDeviceExtensionService, registerDeviceService: RegisterDeviceService); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class RegisterDeviceModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class DeviceRegistrationFactory implements RegisterDeviceFactory { get(): RegisterDeviceItem[]; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { DeviceRegistrationFactory, GeneralDeviceRegistrationButtonComponent, GeneralDeviceRegistrationComponent, GeneralDeviceRegistrationService, HOOK_DEVICE_REGISTRATION, RegisterDeviceExtensionService, RegisterDeviceModule, RegisterDeviceService, hookDeviceRegistration }; export type { RegisterDeviceExtension, RegisterDeviceFactory, RegisterDeviceItem }; //# sourceMappingURL=index.d.ts.map