@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
105 lines (98 loc) • 4.66 kB
TypeScript
import * as i0 from '@angular/core';
import { InjectionToken } from '@angular/core';
import * as _c8y_client from '@c8y/client';
import { IOperation, IdReference, OperationBulkService, OperationService, InventoryService, IOperationBulk, IResult, IManagedObject } from '@c8y/client';
import { Location } from '@angular/common';
import { Subject } from 'rxjs';
import { GenericHookType, GenericHookOptions, Pagination } from '@c8y/ngx-components';
import { OperationSchedule } from '@c8y/ngx-components/operations/bulk-operation-scheduler';
/**
* This module provides a shared bulk operations service.
*/
declare class BulkOperationsServiceModule {
static ɵfac: i0.ɵɵFactoryDeclaration<BulkOperationsServiceModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<BulkOperationsServiceModule, never, never, never>;
static ɵinj: i0.ɵɵInjectorDeclaration<BulkOperationsServiceModule>;
}
declare enum BulkOperationType {
SOFTWARE = "software",
FIRMWARE = "firmware",
CONFIGURATION = "configuration",
DEVICE_PROFILE = "device-profile"
}
interface OperationDetails {
name?: string;
description?: string;
note?: string;
prototype: IOperation;
schedule?: OperationSchedule;
}
interface OperationType {
type: BulkOperationType;
name: string;
path: string;
fragments: string[];
component: any;
icon?: string;
c8yIcon?: string;
selected?: boolean;
}
declare const baseUrl = "devicecontrol/bulk/creation/";
/**
* @deprecated Consider using the `hookListBulkType` function instead.
*/
declare const HOOK_LIST_BULK_TYPE: InjectionToken<OperationType | OperationType[]>;
/**
* You can either provide a single `OperationType` as parameter:
* ```typescript
* hookListBulkType(...)
* ```
*
* Or an array to directly register multiple:
* ```typescript
* hookListBulkType([...])
* ```
*
* Or you provide an Service that implements `ExtensionFactory<OperationType>`
* ```typescript
* export class MyListBulkTypeFactory implements ExtensionFactory<OperationType> {...}
* ...
* hookListBulkType(MyListBulkTypeFactory)
* ```
* A typed alternative to `HOOK_LIST_BULK_TYPE`.
* @param type The `OperationType`'s or `ExtensionFactory` to be provided.
* @returns An `Provider` to be provided in your module.
*/
declare function hookListBulkType(type: GenericHookType<OperationType>, options?: Partial<GenericHookOptions>): i0.ValueProvider | i0.ClassProvider | i0.ExistingProvider;
declare class BulkOperationsService {
private operationBulkService;
private operationService;
private inventoryService;
private location;
readonly DD_LOW_COUNT: number;
firmwareId: Subject<IdReference>;
private bulkTypes;
constructor(operationBulkService: OperationBulkService, operationService: OperationService, inventoryService: InventoryService, location: Location, bulkTypes: Array<OperationType | OperationType[]>);
getBulkOperations(customFilter?: {}): Promise<_c8y_client.IResultList<IOperationBulk>>;
getBulkOperationById(bulkOperationId: string | number): Promise<IResult<IOperationBulk>>;
createBulkOperation(bulkOperation: Partial<IOperationBulk>): Promise<IResult<IOperationBulk>>;
deleteBulkOperation(bulkOperationId: any): Promise<IResult<null>>;
updateBulkOperation(bulkOperation: Partial<IOperationBulk>): Promise<IResult<IOperationBulk>>;
getOperation(id: string): Promise<IResult<IOperation>>;
returnToBulkOperationOverview(): void;
setBulkTypes(list: OperationType[]): void;
getBulkTypes(): OperationType[];
setFirmwareId(id: IdReference): void;
createGroup(deviceQueryDataString: string): Promise<IResult<IManagedObject>>;
scheduleBulkOperation(deviceQueryString: string, details: OperationDetails): Promise<void>;
getSingleOperationsByStatus(status: any, bulkOperationId: any, pagination?: Pagination): Promise<_c8y_client.IResultList<IOperation>>;
getSingleOperationsCountByStatus(status: any, bulkOperationId: any): Promise<number>;
getSingleOperationsTotal(bulkOperationId: any): Promise<number>;
updateSingleOperation(partialUpdateObject: Partial<IOperation>): Promise<IResult<IOperation>>;
retrieveBulkOperationType(operation: IOperation): BulkOperationType;
static ɵfac: i0.ɵɵFactoryDeclaration<BulkOperationsService, [null, null, null, null, { optional: true; }]>;
static ɵprov: i0.ɵɵInjectableDeclaration<BulkOperationsService>;
}
export { BulkOperationType, BulkOperationsService, BulkOperationsServiceModule, HOOK_LIST_BULK_TYPE, baseUrl, hookListBulkType };
export type { OperationDetails, OperationType };
//# sourceMappingURL=index.d.ts.map