UNPKG

@c8y/ngx-components

Version:

Angular modules for Cumulocity IoT applications

72 lines (68 loc) 2.6 kB
import { ApplicationService, FetchClient, IApplication } from '@c8y/client'; import { AppStateService, FilesService, ZipService, DroppedFile } from '@c8y/ngx-components'; import * as i0 from '@angular/core'; interface StaticAsset { fileName: string; originalFileName: string; size: number; addedAt: string; extension: string; path: string; type: string; hashSum: string; lastModified: number; } type StaticAssetType = 'branding' | 'translation'; declare class StaticAssetsService { private appstate; private appService; private fetchClient; private fileService; private zip; readonly fileNames: { readonly contents: "contents.json"; readonly manifest: "cumulocity.json"; readonly exportZipName: "static-assets.zip"; }; private listFilesCachePromises; constructor(appstate: AppStateService, appService: ApplicationService, fetchClient: FetchClient, fileService: FilesService, zip: ZipService); /** * Lists all files of the given type. * Forces a cache renewal. */ listFiles<T extends string = StaticAssetType>(type: T): Promise<StaticAsset[]>; /** * Lists all files of the given type. * Uses a cache. */ listFilesCached<T extends string = StaticAssetType>(type: T, forceCacheRenewal?: boolean): Promise<StaticAsset[]>; /** * Clones all assets of the given type from parent tenants into the current tenant. */ cloneAssetsIntoTenant<T extends string = StaticAssetType>(type: T): Promise<{ oldAssets: StaticAsset[]; newAssets: StaticAsset[]; }>; /** * Adds the given files to the static assets of the given type. */ addFilesToStaticAssets<T extends string = StaticAssetType>(type: T, files: DroppedFile[] | File[], existingFiles: StaticAsset[], throwErrorOnExistingFiles?: boolean): Promise<StaticAsset[]>; /** * Gets the static assets app for the given type. */ getAppForTenant<T extends string = StaticAssetType>(type: T): Promise<IApplication>; private getContentJSONForType; private getContentJSONFromPath; private ensureAddedFilesArePresent; private ensureFileIsPresent; private sleep; private _listFiles; private getPathForContent; private getContextPath; private createEmptyApp; static ɵfac: i0.ɵɵFactoryDeclaration<StaticAssetsService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<StaticAssetsService>; } export { StaticAssetsService }; export type { StaticAsset, StaticAssetType }; //# sourceMappingURL=index.d.ts.map