import { IccMaintenanceTaskApi } from '../icc-api/api/IccMaintenanceTaskApi'; import { IccCryptoXApi } from './icc-crypto-x-api'; import * as models from '../icc-api/model/models'; import { IccHcpartyXApi } from './icc-hcparty-x-api'; import { DocIdentifier, ListOfIds, MaintenanceTask, TimingInfo } from '../icc-api/model/models'; import { IccDataOwnerXApi } from './icc-data-owner-x-api'; import { AuthenticationProvider } from './auth/AuthenticationProvider'; import { SecureDelegation } from '../icc-api/model/SecureDelegation'; import AccessLevelEnum = SecureDelegation.AccessLevelEnum; import { ShareMetadataBehaviour } from './crypto/ShareMetadataBehaviour'; import { ShareResult } from './utils/ShareResult'; import { EntityShareRequest } from '../icc-api/model/requests/EntityShareRequest'; import RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum; import { XHR } from '../icc-api/api/XHR'; import { SubscriptionOptions } from './utils'; import { IccAuthApi } from '../icc-api'; import { EncryptedEntityXApi } from './basexapi/EncryptedEntityXApi'; import { AbstractFilter } from './filters/filters'; import { Connection } from '../icc-api/model/Connection'; import { IccUserXApi } from './icc-user-x-api'; export declare class IccMaintenanceTaskXApi extends IccMaintenanceTaskApi implements EncryptedEntityXApi { private readonly crypto; private readonly hcPartyApi; private readonly dataOwnerApi; private readonly userApi; private readonly authApi; private readonly autofillAuthor; private readonly encryptedFields; get headers(): Promise>; constructor(host: string, headers: { [key: string]: string; }, crypto: IccCryptoXApi, hcPartyApi: IccHcpartyXApi, dataOwnerApi: IccDataOwnerXApi, userApi: IccUserXApi, authApi: IccAuthApi, autofillAuthor: boolean, encryptedKeys?: Array, authenticationProvider?: AuthenticationProvider, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise); /** * Creates a new instance of maintenance task with initialised encryption metadata (not in the database). * @param user the current user. * @param m initialised data for the maintenance task. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify * other kinds of data or overwrite generated metadata with this. You can't specify encryption metadata. * @param options optional parameters: * - additionalDelegates: delegates which will have access to the entity in addition to the current data owner and delegates from the * auto-delegations. Must be an object which associates each data owner id with the access level to give to that data owner. May overlap with * auto-delegations, in such case the access level specified here will be used. * - ignoreAutoDelegations: if true the data won't be shared with the autodelegations of the user, but only with additional delegates * - alternateRootDelegation: by default a new entity is created with a root delegation from self to self. In keyless mode this is not possible, * and instead the root delegation will be from self to another. You have to specify which delegate will be part of the root delegation. * @return a new instance of maintenance task. */ newInstance(user: models.User, m: any, options?: { additionalDelegates?: { [dataOwnerId: string]: AccessLevelEnum; }; ignoreAutoDelegations?: boolean; alternateRootDelegation?: string; }): Promise; createMaintenanceTask(body?: models.MaintenanceTask): never; createMaintenanceTaskWithUser(user: models.User, body?: models.MaintenanceTask): Promise; filterMaintenanceTasksBy(startDocumentId?: string, limit?: number, body?: models.FilterChainMaintenanceTask): never; deleteMaintenanceTask(_maintenanceTaskId: string): never; deleteMaintenanceTaskWithUser(user: models.User, maintenanceTaskId: string): Promise | never; deleteMaintenanceTasks(_maintenanceTaskIds: ListOfIds): never; deleteMaintenanceTasksWithUser(user: models.User, maintenanceTaskIds: ListOfIds): Promise> | never; filterMaintenanceTasksByWithUser(user: models.User, startDocumentId?: string, limit?: number, body?: models.FilterChainMaintenanceTask, collectTiming?: false): Promise; filterMaintenanceTasksByWithUser(user: models.User, startDocumentId?: string, limit?: number, body?: models.FilterChainMaintenanceTask, collectTiming?: true): Promise; getMaintenanceTask(maintenanceTaskId: string): never; getMaintenanceTaskWithUser(user: models.User, maintenanceTaskId: string): Promise; modifyMaintenanceTask(body?: models.MaintenanceTask): never; modifyMaintenanceTaskWithUser(user: models.User, body?: models.MaintenanceTask): Promise; private modifyMaintenanceTaskAs; encrypt(user: models.User, maintenanceTasks: Array): Promise>; private encryptAs; decrypt(user: models.User, maintenanceTasks: Array): Promise>; private decryptAs; /** * @return if the logged data owner has write access to the content of the given maintenance task */ hasWriteAccess(maintenanceTask: models.MaintenanceTask): Promise; /** * Share an existing maintenance task with other data owners, allowing them to access the non-encrypted data of the maintenance task and optionally also * the encrypted content, with read-only or read-write permissions. * @param delegateId the id of the data owner which will be granted access to the maintenance task. * @param maintenanceTask the maintenance task to share. * @param options optional parameters to customize the sharing behaviour: * - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a * maintenance task does not have encrypted content. * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}. * @return the updated entity */ shareWith(delegateId: string, maintenanceTask: models.MaintenanceTask, options?: { shareSecretIds?: string[]; requestedPermissions?: RequestedPermissionEnum; shareEncryptionKey?: ShareMetadataBehaviour; }): Promise; /** * Share an existing maintenance task with other data owners, allowing them to access the non-encrypted data of the maintenance task and optionally also * the encrypted content, with read-only or read-write permissions. * @param maintenanceTask the maintenance task to share. * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options: * - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a * maintenance task does not have encrypted content. * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}. * @return the updated entity. */ shareWithMany(maintenanceTask: models.MaintenanceTask, delegates: { [delegateId: string]: { shareSecretIds?: string[]; requestedPermissions?: RequestedPermissionEnum; shareEncryptionKey?: ShareMetadataBehaviour; }; }): Promise; /** * Share an existing maintenance task with other data owners, allowing them to access the non-encrypted data of the maintenance task and optionally also * the encrypted content, with read-only or read-write permissions. * @param maintenanceTask the maintenance task to share. * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options: * - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a * maintenance task does not have encrypted content. * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}. * @return a promise which will contain the result of the operation: the updated entity if the operation was successful or details of the error if * the operation failed. */ tryShareWithMany(maintenanceTask: models.MaintenanceTask, delegates: { [delegateId: string]: { shareSecretIds?: string[]; requestedPermissions?: RequestedPermissionEnum; shareEncryptionKey?: ShareMetadataBehaviour; }; }): Promise>; getDataOwnersWithAccessTo(entity: models.MaintenanceTask): Promise<{ permissionsByDataOwnerId: { [p: string]: AccessLevelEnum; }; hasUnknownAnonymousDataOwners: boolean; }>; getEncryptionKeysOf(entity: models.MaintenanceTask): Promise; subscribeToMaintenanceTaskEvents(eventTypes: ('CREATE' | 'UPDATE' | 'DELETE')[], filter: AbstractFilter, eventFired: (dataSample: MaintenanceTask) => Promise, options?: SubscriptionOptions): Promise; createDelegationDeAnonymizationMetadata(entity: MaintenanceTask, delegates: string[]): Promise; }