@sap-ux/store
Version:
NPM module for storing persistent data
41 lines • 2.06 kB
TypeScript
import type { Logger } from '@sap-ux/logger';
import type { BackendServiceRetrievalOptions, Service } from './index.js';
import type { ServiceOptions } from '../types.js';
import { BackendSystem, BackendSystemKey } from '../entities/backend-system.js';
/**
* Should not be used directly, use factory method `getService` instead.
* Data integrity cannot be guaranteed when using this class directly.
*/
export declare class SystemService implements Service<BackendSystem, BackendSystemKey> {
private readonly dataProvider;
private readonly logger;
constructor(logger: Logger, options?: ServiceOptions);
partialUpdate(key: BackendSystemKey, entity: Partial<BackendSystem>): Promise<BackendSystem | undefined>;
private mergeProperties;
private readOrThrow;
private validatePartialUpdateInput;
read(key: BackendSystemKey): Promise<BackendSystem | undefined>;
/**
* Write the backend system to the store. If a backend entity with the same key already exists and error is thrown.
* Use the `force` option to overwrite, use with cautions and are sure other clients will not break.
*
* @param entity the backend system to write
* @param options
* @param options.force Force overwrite existing backend system with the same key
* @returns
*/
write(entity: BackendSystem, options?: {
force: boolean;
}): Promise<BackendSystem | undefined>;
delete(entity: BackendSystem): Promise<boolean>;
/**
* Retrieves all backend systems from the store. Can be filtered by providing retrieval options.
* N.B. if no `connectionType` is provided in the options, only systems with `abap_catalog` connection type will be returned.
*
* @param options - backend service retrieval options
* @returns - list of backend systems
*/
getAll(options?: BackendServiceRetrievalOptions): Promise<BackendSystem[] | []>;
}
export declare function getInstance(logger: Logger, options?: ServiceOptions): SystemService;
//# sourceMappingURL=backend-system.d.ts.map