@icure/api 8.0.0-RC.5 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/icc-api/api/IccAccesslogApi.d.ts +3 -7
- package/icc-api/api/IccAccesslogApi.js +2 -2
- package/icc-api/api/IccAccesslogApi.js.map +1 -1
- package/icc-api/api/IccAgendaApi.d.ts +1 -1
- package/icc-api/api/IccAgendaApi.js +2 -2
- package/icc-api/api/IccAgendaApi.js.map +1 -1
- package/icc-api/api/IccAnonymousAccessApi.d.ts +10 -0
- package/icc-api/api/IccAnonymousAccessApi.js +33 -0
- package/icc-api/api/IccAnonymousAccessApi.js.map +1 -1
- package/icc-api/api/IccApplicationsettingsApi.d.ts +1 -1
- package/icc-api/api/IccApplicationsettingsApi.js +2 -2
- package/icc-api/api/IccApplicationsettingsApi.js.map +1 -1
- package/icc-api/api/IccArticleApi.d.ts +1 -1
- package/icc-api/api/IccArticleApi.js +2 -2
- package/icc-api/api/IccArticleApi.js.map +1 -1
- package/icc-api/api/IccAuthApi.d.ts +4 -2
- package/icc-api/api/IccAuthApi.js +11 -4
- package/icc-api/api/IccAuthApi.js.map +1 -1
- package/icc-api/api/IccCalendarItemApi.d.ts +4 -12
- package/icc-api/api/IccCalendarItemApi.js +2 -2
- package/icc-api/api/IccCalendarItemApi.js.map +1 -1
- package/icc-api/api/IccCalendarItemTypeApi.d.ts +1 -1
- package/icc-api/api/IccCalendarItemTypeApi.js +2 -2
- package/icc-api/api/IccCalendarItemTypeApi.js.map +1 -1
- package/icc-api/api/IccClassificationApi.d.ts +4 -12
- package/icc-api/api/IccClassificationApi.js +2 -2
- package/icc-api/api/IccClassificationApi.js.map +1 -1
- package/icc-api/api/IccClassificationTemplateApi.d.ts +1 -1
- package/icc-api/api/IccClassificationTemplateApi.js +2 -2
- package/icc-api/api/IccClassificationTemplateApi.js.map +1 -1
- package/icc-api/api/IccCodeApi.d.ts +1 -1
- package/icc-api/api/IccCodeApi.js +2 -2
- package/icc-api/api/IccCodeApi.js.map +1 -1
- package/icc-api/api/IccContactApi.d.ts +3 -11
- package/icc-api/api/IccContactApi.js.map +1 -1
- package/icc-api/api/IccDataownerApi.d.ts +1 -1
- package/icc-api/api/IccDataownerApi.js +2 -2
- package/icc-api/api/IccDataownerApi.js.map +1 -1
- package/icc-api/api/IccDeviceApi.d.ts +1 -1
- package/icc-api/api/IccDeviceApi.js +2 -2
- package/icc-api/api/IccDeviceApi.js.map +1 -1
- package/icc-api/api/IccDoctemplateApi.d.ts +1 -1
- package/icc-api/api/IccDoctemplateApi.js +2 -2
- package/icc-api/api/IccDoctemplateApi.js.map +1 -1
- package/icc-api/api/IccDocumentApi.d.ts +3 -7
- package/icc-api/api/IccDocumentApi.js +2 -2
- package/icc-api/api/IccDocumentApi.js.map +1 -1
- package/icc-api/api/IccEntityrefApi.d.ts +1 -1
- package/icc-api/api/IccEntityrefApi.js +2 -2
- package/icc-api/api/IccEntityrefApi.js.map +1 -1
- package/icc-api/api/IccEntitytemplateApi.d.ts +1 -1
- package/icc-api/api/IccEntitytemplateApi.js +2 -2
- package/icc-api/api/IccEntitytemplateApi.js.map +1 -1
- package/icc-api/api/IccFormApi.d.ts +4 -12
- package/icc-api/api/IccFormApi.js +2 -2
- package/icc-api/api/IccFormApi.js.map +1 -1
- package/icc-api/api/IccFrontendmigrationApi.d.ts +1 -1
- package/icc-api/api/IccFrontendmigrationApi.js +2 -2
- package/icc-api/api/IccFrontendmigrationApi.js.map +1 -1
- package/icc-api/api/IccGroupApi.d.ts +1 -1
- package/icc-api/api/IccGroupApi.js +2 -2
- package/icc-api/api/IccGroupApi.js.map +1 -1
- package/icc-api/api/IccHcpartyApi.d.ts +1 -1
- package/icc-api/api/IccHcpartyApi.js +2 -2
- package/icc-api/api/IccHcpartyApi.js.map +1 -1
- package/icc-api/api/IccHelementApi.d.ts +4 -12
- package/icc-api/api/IccHelementApi.js +2 -2
- package/icc-api/api/IccHelementApi.js.map +1 -1
- package/icc-api/api/IccIcureApi.d.ts +1 -1
- package/icc-api/api/IccIcureApi.js +2 -2
- package/icc-api/api/IccIcureApi.js.map +1 -1
- package/icc-api/api/IccInsuranceApi.d.ts +1 -1
- package/icc-api/api/IccInsuranceApi.js +2 -2
- package/icc-api/api/IccInsuranceApi.js.map +1 -1
- package/icc-api/api/IccInvoiceApi.d.ts +4 -12
- package/icc-api/api/IccInvoiceApi.js +2 -2
- package/icc-api/api/IccInvoiceApi.js.map +1 -1
- package/icc-api/api/IccKeywordApi.d.ts +1 -1
- package/icc-api/api/IccKeywordApi.js +2 -2
- package/icc-api/api/IccKeywordApi.js.map +1 -1
- package/icc-api/api/IccMaintenanceTaskApi.d.ts +3 -7
- package/icc-api/api/IccMaintenanceTaskApi.js +2 -2
- package/icc-api/api/IccMaintenanceTaskApi.js.map +1 -1
- package/icc-api/api/IccMedexApi.d.ts +1 -1
- package/icc-api/api/IccMedexApi.js +2 -2
- package/icc-api/api/IccMedexApi.js.map +1 -1
- package/icc-api/api/IccMedicallocationApi.d.ts +1 -1
- package/icc-api/api/IccMedicallocationApi.js +2 -2
- package/icc-api/api/IccMedicallocationApi.js.map +1 -1
- package/icc-api/api/IccMessageApi.d.ts +3 -7
- package/icc-api/api/IccMessageApi.js +2 -2
- package/icc-api/api/IccMessageApi.js.map +1 -1
- package/icc-api/api/IccPatientApi.d.ts +3 -7
- package/icc-api/api/IccPatientApi.js +2 -2
- package/icc-api/api/IccPatientApi.js.map +1 -1
- package/icc-api/api/IccPermissionApi.d.ts +1 -1
- package/icc-api/api/IccPermissionApi.js +2 -2
- package/icc-api/api/IccPermissionApi.js.map +1 -1
- package/icc-api/api/IccPlaceApi.d.ts +1 -1
- package/icc-api/api/IccPlaceApi.js +2 -2
- package/icc-api/api/IccPlaceApi.js.map +1 -1
- package/icc-api/api/IccReceiptApi.d.ts +3 -7
- package/icc-api/api/IccReceiptApi.js +2 -2
- package/icc-api/api/IccReceiptApi.js.map +1 -1
- package/icc-api/api/IccReplicationApi.d.ts +1 -1
- package/icc-api/api/IccReplicationApi.js +2 -2
- package/icc-api/api/IccReplicationApi.js.map +1 -1
- package/icc-api/api/IccRoleApi.d.ts +1 -1
- package/icc-api/api/IccRoleApi.js +2 -2
- package/icc-api/api/IccRoleApi.js.map +1 -1
- package/icc-api/api/IccTarificationApi.d.ts +1 -1
- package/icc-api/api/IccTarificationApi.js +2 -2
- package/icc-api/api/IccTarificationApi.js.map +1 -1
- package/icc-api/api/IccTimeTableApi.d.ts +3 -7
- package/icc-api/api/IccTimeTableApi.js +2 -2
- package/icc-api/api/IccTimeTableApi.js.map +1 -1
- package/icc-api/api/IccTopicApi.d.ts +3 -7
- package/icc-api/api/IccTopicApi.js +2 -2
- package/icc-api/api/IccTopicApi.js.map +1 -1
- package/icc-api/api/IccUserApi.d.ts +22 -1
- package/icc-api/api/IccUserApi.js +59 -2
- package/icc-api/api/IccUserApi.js.map +1 -1
- package/icc-api/api/XHR.d.ts +1 -1
- package/icc-api/api/XHR.js +4 -3
- package/icc-api/api/XHR.js.map +1 -1
- package/icc-api/api/internal/IccExchangeDataMapApi.d.ts +0 -3
- package/icc-api/api/internal/IccExchangeDataMapApi.js +0 -31
- package/icc-api/api/internal/IccExchangeDataMapApi.js.map +1 -1
- package/icc-api/api/internal/IccSecureDelegationKeyMapApi.d.ts +2 -6
- package/icc-api/api/internal/IccSecureDelegationKeyMapApi.js.map +1 -1
- package/icc-api/model/MedicalLocation.d.ts +3 -0
- package/icc-api/model/MedicalLocation.js.map +1 -1
- package/icc-api/model/PaginatedListMedicalLocation.d.ts +20 -0
- package/icc-api/model/PaginatedListMedicalLocation.js +10 -0
- package/icc-api/model/PaginatedListMedicalLocation.js.map +1 -0
- package/icc-api/model/requests/BulkShareOrUpdateMetadataParams.d.ts +12 -0
- package/icc-api/model/requests/BulkShareOrUpdateMetadataParams.js +3 -0
- package/icc-api/model/requests/BulkShareOrUpdateMetadataParams.js.map +1 -0
- package/icc-x-api/auth/AuthService.d.ts +2 -1
- package/icc-x-api/auth/AuthService.js.map +1 -1
- package/icc-x-api/auth/AuthenticationProvider.d.ts +1 -1
- package/icc-x-api/auth/AuthenticationProvider.js +1 -1
- package/icc-x-api/auth/AuthenticationProvider.js.map +1 -1
- package/icc-x-api/auth/EnsembleAuthService.d.ts +1 -1
- package/icc-x-api/auth/EnsembleAuthService.js +2 -2
- package/icc-x-api/auth/EnsembleAuthService.js.map +1 -1
- package/icc-x-api/auth/JwtAuthService.d.ts +0 -2
- package/icc-x-api/auth/JwtAuthService.js +3 -15
- package/icc-x-api/auth/JwtAuthService.js.map +1 -1
- package/icc-x-api/auth/JwtBridgedAuthService.d.ts +1 -1
- package/icc-x-api/auth/JwtBridgedAuthService.js +4 -4
- package/icc-x-api/auth/JwtBridgedAuthService.js.map +1 -1
- package/icc-x-api/auth/JwtUtils.d.ts +10 -0
- package/icc-x-api/auth/JwtUtils.js +31 -0
- package/icc-x-api/auth/JwtUtils.js.map +1 -0
- package/icc-x-api/auth/SmartAuthProvider.d.ts +132 -0
- package/icc-x-api/auth/SmartAuthProvider.js +419 -0
- package/icc-x-api/auth/SmartAuthProvider.js.map +1 -0
- package/icc-x-api/crypto/BaseExchangeDataManager.d.ts +20 -0
- package/icc-x-api/crypto/BaseExchangeDataManager.js +32 -2
- package/icc-x-api/crypto/BaseExchangeDataManager.js.map +1 -1
- package/icc-x-api/crypto/ConfidentialEntities.d.ts +2 -6
- package/icc-x-api/crypto/ConfidentialEntities.js.map +1 -1
- package/icc-x-api/crypto/CryptoStrategies.d.ts +3 -1
- package/icc-x-api/crypto/CryptoStrategies.js.map +1 -1
- package/icc-x-api/crypto/ExchangeDataManager.d.ts +3 -1
- package/icc-x-api/crypto/ExchangeDataManager.js +36 -22
- package/icc-x-api/crypto/ExchangeDataManager.js.map +1 -1
- package/icc-x-api/crypto/ExchangeDataMapManager.d.ts +0 -5
- package/icc-x-api/crypto/ExchangeDataMapManager.js +0 -11
- package/icc-x-api/crypto/ExchangeDataMapManager.js.map +1 -1
- package/icc-x-api/crypto/ExtendedApisUtils.d.ts +4 -16
- package/icc-x-api/crypto/ExtendedApisUtils.js.map +1 -1
- package/icc-x-api/crypto/ExtendedApisUtilsImpl.d.ts +4 -16
- package/icc-x-api/crypto/ExtendedApisUtilsImpl.js +12 -3
- package/icc-x-api/crypto/ExtendedApisUtilsImpl.js.map +1 -1
- package/icc-x-api/crypto/KeyPairRecoverer.d.ts +34 -0
- package/icc-x-api/crypto/KeyPairRecoverer.js +32 -0
- package/icc-x-api/crypto/KeyPairRecoverer.js.map +1 -0
- package/icc-x-api/crypto/RecoveryDataEncryption.d.ts +85 -0
- package/icc-x-api/crypto/RecoveryDataEncryption.js +171 -0
- package/icc-x-api/crypto/RecoveryDataEncryption.js.map +1 -0
- package/icc-x-api/crypto/SecureDelegationsManager.js +2 -2
- package/icc-x-api/crypto/SecureDelegationsManager.js.map +1 -1
- package/icc-x-api/crypto/ShamirKeysManager.js +1 -1
- package/icc-x-api/crypto/ShamirKeysManager.js.map +1 -1
- package/icc-x-api/crypto/UserEncryptionKeysManager.d.ts +4 -1
- package/icc-x-api/crypto/UserEncryptionKeysManager.js +4 -3
- package/icc-x-api/crypto/UserEncryptionKeysManager.js.map +1 -1
- package/icc-x-api/icc-bekmehr-x-api.d.ts +1 -0
- package/icc-x-api/icc-bekmehr-x-api.js +37 -36
- package/icc-x-api/icc-bekmehr-x-api.js.map +1 -1
- package/icc-x-api/icc-contact-x-api.js +15 -12
- package/icc-x-api/icc-contact-x-api.js.map +1 -1
- package/icc-x-api/icc-crypto-x-api.d.ts +1 -0
- package/icc-x-api/icc-crypto-x-api.js.map +1 -1
- package/icc-x-api/icc-maintenance-task-x-api.d.ts +1 -1
- package/icc-x-api/icc-maintenance-task-x-api.js.map +1 -1
- package/icc-x-api/icc-patient-x-api.d.ts +18 -0
- package/icc-x-api/icc-patient-x-api.js +29 -0
- package/icc-x-api/icc-patient-x-api.js.map +1 -1
- package/icc-x-api/icc-recovery-x-api.d.ts +127 -0
- package/icc-x-api/icc-recovery-x-api.js +217 -0
- package/icc-x-api/icc-recovery-x-api.js.map +1 -1
- package/icc-x-api/icc-user-x-api.js +15 -2
- package/icc-x-api/icc-user-x-api.js.map +1 -1
- package/icc-x-api/index.d.ts +68 -23
- package/icc-x-api/index.js +85 -38
- package/icc-x-api/index.js.map +1 -1
- package/icc-x-api/utils/collection-utils.d.ts +14 -1
- package/icc-x-api/utils/collection-utils.js +49 -3
- package/icc-x-api/utils/collection-utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icc-maintenance-task-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-maintenance-task-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gFAA4E;AAE5E,kDAAiD;AACjD,4BAA2B;AAE3B,oDAAmF;AAEnF,0EAAgG;AAChG,wEAAoE;AACpE,IAAO,eAAe,GAAG,mCAAgB,CAAC,eAAe,CAAA;AACzD,4EAAwE;AAKxE,mCAAqH;AAKrH,4DAAwE;AAExE,MAAa,sBAAuB,SAAQ,6CAAqB;IAG/D,IAAI,OAAO;QACT,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,2BAA2B,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAA;IAC1H,CAAC;IAED,YACE,IAAY,EACZ,OAAkC,EACjB,MAAqB,EACrB,UAA0B,EAC1B,YAA8B,EAC9B,OAAoB,EACpB,OAAmB,EACnB,cAAuB,EACxC,gBAA+B,EAAE,EACjC,yBAAiD,IAAI,iDAAwB,EAAE,EAC/E,YAA2E,OAAO,MAAM,KAAK,WAAW;QACtG,CAAC,CAAC,MAAM,CAAC,KAAK;QACd,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW;YAC7B,CAAC,CAAC,IAAI,CAAC,KAAK;YACZ,CAAC,CAAC,KAAK;QAET,KA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AAiB,EAAE,EAAE,SAAS,CAAC,CAAA;IACjI,CAAC;CACF;AAvSD,wDAuSC","sourcesContent":["import { IccMaintenanceTaskApi } from '../icc-api/api/IccMaintenanceTaskApi'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\nimport * as models from '../icc-api/model/models'\nimport * as _ from 'lodash'\nimport { IccHcpartyXApi } from './icc-hcparty-x-api'\nimport { DocIdentifier, ListOfIds, MaintenanceTask } from '../icc-api/model/models'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport { AuthenticationProvider, NoAuthenticationProvider } from './auth/AuthenticationProvider'\nimport { SecureDelegation } from '../icc-api/model/SecureDelegation'\nimport AccessLevelEnum = SecureDelegation.AccessLevelEnum\nimport { ShareMetadataBehaviour } from './crypto/ShareMetadataBehaviour'\nimport { ShareResult } from './utils/ShareResult'\nimport { EntityShareRequest } from '../icc-api/model/requests/EntityShareRequest'\nimport RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum\nimport { XHR } from '../icc-api/api/XHR'\nimport { EncryptedFieldsManifest, parseEncryptedFields, subscribeToEntityEvents, SubscriptionOptions } from './utils'\nimport { IccUserXApi } from '@icure/apiV6'\nimport { IccAuthApi } from '../icc-api'\nimport { EncryptedEntityXApi } from './basexapi/EncryptedEntityXApi'\nimport { AbstractFilter } from './filters/filters'\nimport { Connection, ConnectionImpl } from '../icc-api/model/Connection'\n\nexport class IccMaintenanceTaskXApi extends IccMaintenanceTaskApi implements EncryptedEntityXApi<models.MaintenanceTask> {\n private readonly encryptedFields: EncryptedFieldsManifest\n\n get headers(): Promise<Array<XHR.Header>> {\n return super.headers.then((h) => this.crypto.accessControlKeysHeaders.addAccessControlKeysHeaders(h, 'MaintenanceTask'))\n }\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n private readonly crypto: IccCryptoXApi,\n private readonly hcPartyApi: IccHcpartyXApi,\n private readonly dataOwnerApi: IccDataOwnerXApi,\n private readonly userApi: IccUserXApi,\n private readonly authApi: IccAuthApi,\n private readonly autofillAuthor: boolean,\n encryptedKeys: Array<string> = [],\n authenticationProvider: AuthenticationProvider = new NoAuthenticationProvider(),\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch\n ) {\n super(host, headers, authenticationProvider, fetchImpl)\n this.encryptedFields = parseEncryptedFields(encryptedKeys, 'MaintenanceTask.')\n }\n\n /**\n * Creates a new instance of maintenance task with initialised encryption metadata (not in the database).\n * @param user the current user.\n * @param m initialised data for the maintenance task. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify\n * other kinds of data or overwrite generated metadata with this. You can't specify encryption metadata.\n * @param options optional parameters:\n * - additionalDelegates: delegates which will have access to the entity in addition to the current data owner and delegates from the\n * 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\n * auto-delegations, in such case the access level specified here will be used.\n * @return a new instance of maintenance task.\n */\n async newInstance(\n user: models.User,\n m: any,\n options: {\n additionalDelegates?: { [dataOwnerId: string]: AccessLevelEnum }\n } = {}\n ) {\n const dataOwnerId = this.dataOwnerApi.getDataOwnerIdOf(user)\n const maintenanceTask = {\n ...(m ?? {}),\n _type: 'org.taktik.icure.entities.MaintenanceTask',\n id: m?.id ?? this.crypto.primitives.randomUuid(),\n created: m?.created ?? new Date().getTime(),\n modified: m?.modified ?? new Date().getTime(),\n responsible: m?.responsible ?? (this.autofillAuthor ? dataOwnerId : undefined),\n author: m?.author ?? (this.autofillAuthor ? user.id : undefined),\n }\n\n const extraDelegations = {\n ...Object.fromEntries((user.autoDelegations?.all ?? []).map((d) => [d, AccessLevelEnum.WRITE])),\n ...(options?.additionalDelegates ?? {}),\n }\n return new models.MaintenanceTask(\n await this.crypto.xapi\n .entityWithInitialisedEncryptedMetadata(maintenanceTask, 'MaintenanceTask', undefined, undefined, true, false, extraDelegations)\n .then((x) => x.updatedEntity)\n )\n }\n\n createMaintenanceTask(body?: models.MaintenanceTask): never {\n throw new Error('Cannot call a method that returns maintenance tasks without providing a user for de/encryption')\n }\n\n createMaintenanceTaskWithUser(user: models.User, body?: models.MaintenanceTask): Promise<models.MaintenanceTask | null> {\n return body\n ? this.encrypt(user, [_.cloneDeep(body)])\n .then((tasks) => super.createMaintenanceTask(tasks[0]))\n .then((mt) => this.decrypt(user, [mt]))\n .then((tasks) => tasks[0])\n : Promise.resolve(null)\n }\n\n filterMaintenanceTasksBy(startDocumentId?: string, limit?: number, body?: models.FilterChainMaintenanceTask): never {\n throw new Error('Cannot call a method that returns maintenance tasks without providing a user for de/encryption')\n }\n\n deleteMaintenanceTask(_maintenanceTaskId: string): never {\n throw new Error('Cannot call a method that returns maintenance tasks without providing a user for de/encryption')\n }\n\n deleteMaintenanceTaskWithUser(user: models.User, maintenanceTaskId: string): Promise<DocIdentifier> | never {\n return super.deleteMaintenanceTask(maintenanceTaskId)\n }\n\n deleteMaintenanceTasks(_maintenanceTaskIds: ListOfIds): never {\n throw new Error('Cannot call a method that returns maintenance tasks without providing a user for de/encryption')\n }\n\n deleteMaintenanceTasksWithUser(user: models.User, maintenanceTaskIds: ListOfIds): Promise<Array<DocIdentifier>> | never {\n return super.deleteMaintenanceTasks(maintenanceTaskIds)\n }\n\n filterMaintenanceTasksByWithUser(\n user: models.User,\n startDocumentId?: string,\n limit?: number,\n body?: models.FilterChainMaintenanceTask\n ): Promise<models.PaginatedListMaintenanceTask> {\n return super\n .filterMaintenanceTasksBy(startDocumentId, limit, body)\n .then((pl) => this.decrypt(user, pl.rows!).then((dr) => Object.assign(pl, { rows: dr })))\n }\n\n getMaintenanceTask(maintenanceTaskId: string): never {\n throw new Error('Cannot call a method that returns maintenance tasks without providing a user for de/encryption')\n }\n\n getMaintenanceTaskWithUser(user: models.User, maintenanceTaskId: string): Promise<models.MaintenanceTask | any> {\n return super\n .getMaintenanceTask(maintenanceTaskId)\n .then((mt) => this.decrypt(user, [mt]))\n .then((mts) => mts[0])\n }\n\n modifyMaintenanceTask(body?: models.MaintenanceTask): never {\n throw new Error('Cannot call a method that returns maintenance tasks without providing a user for de/encryption')\n }\n\n modifyMaintenanceTaskWithUser(user: models.User, body?: models.MaintenanceTask): Promise<models.MaintenanceTask | any> {\n return body ? this.modifyMaintenanceTaskAs(this.dataOwnerApi.getDataOwnerIdOf(user), body) : Promise.resolve(null)\n }\n\n private modifyMaintenanceTaskAs(dataOwner: string, body: models.MaintenanceTask): Promise<models.MaintenanceTask> {\n return this.encryptAs(dataOwner, [_.cloneDeep(body)])\n .then((encTasks) => super.modifyMaintenanceTask(encTasks[0]))\n .then((mt) => this.decryptAs(dataOwner, [mt]))\n .then((mts) => mts[0])\n }\n\n encrypt(user: models.User, maintenanceTasks: Array<models.MaintenanceTask>): Promise<Array<models.MaintenanceTask>> {\n const dataOwnerId = this.dataOwnerApi.getDataOwnerIdOf(user)\n return this.encryptAs(dataOwnerId, maintenanceTasks)\n }\n\n private encryptAs(dataOwner: string, maintenanceTasks: Array<models.MaintenanceTask>): Promise<Array<models.MaintenanceTask>> {\n return Promise.all(\n maintenanceTasks.map((m) =>\n this.crypto.xapi.tryEncryptEntity(m, 'MaintenanceTask', this.encryptedFields, true, false, (x) => new models.MaintenanceTask(x))\n )\n )\n }\n\n decrypt(user: models.User, maintenanceTasks: Array<models.MaintenanceTask>): Promise<Array<models.MaintenanceTask>> {\n const dataOwnerId = this.dataOwnerApi.getDataOwnerIdOf(user)\n return this.decryptAs(dataOwnerId, maintenanceTasks)\n }\n\n private decryptAs(dataOwner: string, maintenanceTasks: Array<models.MaintenanceTask>): Promise<Array<models.MaintenanceTask>> {\n return Promise.all(\n maintenanceTasks.map(async (mT) =>\n this.crypto.xapi.decryptEntity(mT, 'MaintenanceTask', (x) => new MaintenanceTask(x)).then(({ entity }) => entity)\n )\n )\n }\n\n /**\n * @return if the logged data owner has write access to the content of the given maintenance task\n */\n async hasWriteAccess(maintenanceTask: models.MaintenanceTask): Promise<boolean> {\n return this.crypto.xapi.hasWriteAccess({ entity: maintenanceTask, type: 'MaintenanceTask' })\n }\n\n /**\n * Share an existing maintenance task with other data owners, allowing them to access the non-encrypted data of the maintenance task and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param delegateId the id of the data owner which will be granted access to the maintenance task.\n * @param maintenanceTask the maintenance task to share.\n * @param options optional parameters to customize the sharing behaviour:\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * maintenance task does not have encrypted content.\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity\n */\n async shareWith(\n delegateId: string,\n maintenanceTask: models.MaintenanceTask,\n options: {\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n } = {}\n ): Promise<models.MaintenanceTask> {\n return this.shareWithMany(maintenanceTask, { [delegateId]: options })\n }\n\n /**\n * Share an existing maintenance task with other data owners, allowing them to access the non-encrypted data of the maintenance task and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param maintenanceTask the maintenance task to share.\n * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * maintenance task does not have encrypted content.\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity.\n */\n async shareWithMany(\n maintenanceTask: models.MaintenanceTask,\n delegates: {\n [delegateId: string]: {\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<models.MaintenanceTask> {\n return (await this.tryShareWithMany(maintenanceTask, delegates)).updatedEntityOrThrow\n }\n\n /**\n * Share an existing maintenance task with other data owners, allowing them to access the non-encrypted data of the maintenance task and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param maintenanceTask the maintenance task to share.\n * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * maintenance task does not have encrypted content.\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @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\n * the operation failed.\n */\n async tryShareWithMany(\n maintenanceTask: models.MaintenanceTask,\n delegates: {\n [delegateId: string]: {\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<ShareResult<models.MaintenanceTask>> {\n const self = await this.dataOwnerApi.getCurrentDataOwnerId()\n // All entities should have an encryption key.\n const entityWithEncryptionKey = await this.crypto.xapi.ensureEncryptionKeysInitialised(maintenanceTask, 'MaintenanceTask')\n const updatedEntity = entityWithEncryptionKey ? await this.modifyMaintenanceTaskAs(self, entityWithEncryptionKey) : maintenanceTask\n return this.crypto.xapi\n .simpleShareOrUpdateEncryptedEntityMetadata(\n { entity: updatedEntity, type: 'MaintenanceTask' },\n true,\n Object.fromEntries(\n Object.entries(delegates).map(([delegateId, options]) => [\n delegateId,\n {\n requestedPermissions: options.requestedPermissions,\n shareEncryptionKeys: options.shareEncryptionKey,\n shareOwningEntityIds: ShareMetadataBehaviour.NEVER,\n shareSecretIds: undefined,\n },\n ])\n ),\n (x) => this.bulkShareMaintenanceTask(x)\n )\n .then((r) => r.mapSuccessAsync((e) => this.decryptAs(self, [e]).then((es) => es[0])))\n }\n\n getDataOwnersWithAccessTo(\n entity: models.MaintenanceTask\n ): Promise<{ permissionsByDataOwnerId: { [p: string]: AccessLevelEnum }; hasUnknownAnonymousDataOwners: boolean }> {\n return this.crypto.delegationsDeAnonymization.getDataOwnersWithAccessTo({ entity, type: 'MaintenanceTask' })\n }\n\n getEncryptionKeysOf(entity: models.MaintenanceTask): Promise<string[]> {\n return this.crypto.xapi.encryptionKeysOf({ entity, type: 'MaintenanceTask' }, undefined)\n }\n\n async subscribeToMaintenanceTaskEvents(\n eventTypes: ('CREATE' | 'UPDATE' | 'DELETE')[],\n filter: AbstractFilter<MaintenanceTask>,\n eventFired: (dataSample: MaintenanceTask) => Promise<void>,\n options: SubscriptionOptions = {}\n ): Promise<Connection> {\n const currentUser = await this.userApi.getCurrentUser()\n\n return subscribeToEntityEvents(\n this.host,\n this.authApi,\n 'MaintenanceTask',\n eventTypes,\n filter,\n eventFired,\n options,\n async (encrypted) => (await this.decrypt(currentUser, [encrypted]))[0]\n ).then((rs) => new ConnectionImpl(rs))\n }\n\n createDelegationDeAnonymizationMetadata(entity: MaintenanceTask, delegates: string[]): Promise<void> {\n return this.crypto.delegationsDeAnonymization.createOrUpdateDeAnonymizationInfo({ entity, type: 'MaintenanceTask' }, delegates)\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"icc-maintenance-task-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-maintenance-task-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gFAA4E;AAE5E,kDAAiD;AACjD,4BAA2B;AAE3B,oDAAmF;AAEnF,0EAAgG;AAChG,wEAAoE;AACpE,IAAO,eAAe,GAAG,mCAAgB,CAAC,eAAe,CAAA;AACzD,4EAAwE;AAKxE,mCAAqH;AAIrH,4DAAwE;AAGxE,MAAa,sBAAuB,SAAQ,6CAAqB;IAG/D,IAAI,OAAO;QACT,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,wBAAw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EACN,UAAU,EACV,OAAO,EACP,CAAO,SAAS,EAAE,EAAE,gDAAC,OAAA,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA,GAAA,CACvE,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,2BAAc,CAAC,EAAE,CAAC,CAAC,CAAA;QACxC,CAAC;KAAA;IAED,uCAAuC,CAAC,MAAuB,EAAE,SAAmB;QAClF,OAAO,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,iCAAiC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAAE,SAAS,CAAC,CAAA;IACjI,CAAC;CACF;AAvSD,wDAuSC","sourcesContent":["import { IccMaintenanceTaskApi } from '../icc-api/api/IccMaintenanceTaskApi'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\nimport * as models from '../icc-api/model/models'\nimport * as _ from 'lodash'\nimport { IccHcpartyXApi } from './icc-hcparty-x-api'\nimport { DocIdentifier, ListOfIds, MaintenanceTask } from '../icc-api/model/models'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport { AuthenticationProvider, NoAuthenticationProvider } from './auth/AuthenticationProvider'\nimport { SecureDelegation } from '../icc-api/model/SecureDelegation'\nimport AccessLevelEnum = SecureDelegation.AccessLevelEnum\nimport { ShareMetadataBehaviour } from './crypto/ShareMetadataBehaviour'\nimport { ShareResult } from './utils/ShareResult'\nimport { EntityShareRequest } from '../icc-api/model/requests/EntityShareRequest'\nimport RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum\nimport { XHR } from '../icc-api/api/XHR'\nimport { EncryptedFieldsManifest, parseEncryptedFields, subscribeToEntityEvents, SubscriptionOptions } from './utils'\nimport { IccAuthApi } from '../icc-api'\nimport { EncryptedEntityXApi } from './basexapi/EncryptedEntityXApi'\nimport { AbstractFilter } from './filters/filters'\nimport { Connection, ConnectionImpl } from '../icc-api/model/Connection'\nimport { IccUserXApi } from './icc-user-x-api'\n\nexport class IccMaintenanceTaskXApi extends IccMaintenanceTaskApi implements EncryptedEntityXApi<models.MaintenanceTask> {\n private readonly encryptedFields: EncryptedFieldsManifest\n\n get headers(): Promise<Array<XHR.Header>> {\n return super.headers.then((h) => this.crypto.accessControlKeysHeaders.addAccessControlKeysHeaders(h, 'MaintenanceTask'))\n }\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n private readonly crypto: IccCryptoXApi,\n private readonly hcPartyApi: IccHcpartyXApi,\n private readonly dataOwnerApi: IccDataOwnerXApi,\n private readonly userApi: IccUserXApi,\n private readonly authApi: IccAuthApi,\n private readonly autofillAuthor: boolean,\n encryptedKeys: Array<string> = [],\n authenticationProvider: AuthenticationProvider = new NoAuthenticationProvider(),\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch\n ) {\n super(host, headers, authenticationProvider, fetchImpl)\n this.encryptedFields = parseEncryptedFields(encryptedKeys, 'MaintenanceTask.')\n }\n\n /**\n * Creates a new instance of maintenance task with initialised encryption metadata (not in the database).\n * @param user the current user.\n * @param m initialised data for the maintenance task. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify\n * other kinds of data or overwrite generated metadata with this. You can't specify encryption metadata.\n * @param options optional parameters:\n * - additionalDelegates: delegates which will have access to the entity in addition to the current data owner and delegates from the\n * 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\n * auto-delegations, in such case the access level specified here will be used.\n * @return a new instance of maintenance task.\n */\n async newInstance(\n user: models.User,\n m: any,\n options: {\n additionalDelegates?: { [dataOwnerId: string]: AccessLevelEnum }\n } = {}\n ) {\n const dataOwnerId = this.dataOwnerApi.getDataOwnerIdOf(user)\n const maintenanceTask = {\n ...(m ?? {}),\n _type: 'org.taktik.icure.entities.MaintenanceTask',\n id: m?.id ?? this.crypto.primitives.randomUuid(),\n created: m?.created ?? new Date().getTime(),\n modified: m?.modified ?? new Date().getTime(),\n responsible: m?.responsible ?? (this.autofillAuthor ? dataOwnerId : undefined),\n author: m?.author ?? (this.autofillAuthor ? user.id : undefined),\n }\n\n const extraDelegations = {\n ...Object.fromEntries((user.autoDelegations?.all ?? []).map((d) => [d, AccessLevelEnum.WRITE])),\n ...(options?.additionalDelegates ?? {}),\n }\n return new models.MaintenanceTask(\n await this.crypto.xapi\n .entityWithInitialisedEncryptedMetadata(maintenanceTask, 'MaintenanceTask', undefined, undefined, true, false, extraDelegations)\n .then((x) => x.updatedEntity)\n )\n }\n\n createMaintenanceTask(body?: models.MaintenanceTask): never {\n throw new Error('Cannot call a method that returns maintenance tasks without providing a user for de/encryption')\n }\n\n createMaintenanceTaskWithUser(user: models.User, body?: models.MaintenanceTask): Promise<models.MaintenanceTask | null> {\n return body\n ? this.encrypt(user, [_.cloneDeep(body)])\n .then((tasks) => super.createMaintenanceTask(tasks[0]))\n .then((mt) => this.decrypt(user, [mt]))\n .then((tasks) => tasks[0])\n : Promise.resolve(null)\n }\n\n filterMaintenanceTasksBy(startDocumentId?: string, limit?: number, body?: models.FilterChainMaintenanceTask): never {\n throw new Error('Cannot call a method that returns maintenance tasks without providing a user for de/encryption')\n }\n\n deleteMaintenanceTask(_maintenanceTaskId: string): never {\n throw new Error('Cannot call a method that returns maintenance tasks without providing a user for de/encryption')\n }\n\n deleteMaintenanceTaskWithUser(user: models.User, maintenanceTaskId: string): Promise<DocIdentifier> | never {\n return super.deleteMaintenanceTask(maintenanceTaskId)\n }\n\n deleteMaintenanceTasks(_maintenanceTaskIds: ListOfIds): never {\n throw new Error('Cannot call a method that returns maintenance tasks without providing a user for de/encryption')\n }\n\n deleteMaintenanceTasksWithUser(user: models.User, maintenanceTaskIds: ListOfIds): Promise<Array<DocIdentifier>> | never {\n return super.deleteMaintenanceTasks(maintenanceTaskIds)\n }\n\n filterMaintenanceTasksByWithUser(\n user: models.User,\n startDocumentId?: string,\n limit?: number,\n body?: models.FilterChainMaintenanceTask\n ): Promise<models.PaginatedListMaintenanceTask> {\n return super\n .filterMaintenanceTasksBy(startDocumentId, limit, body)\n .then((pl) => this.decrypt(user, pl.rows!).then((dr) => Object.assign(pl, { rows: dr })))\n }\n\n getMaintenanceTask(maintenanceTaskId: string): never {\n throw new Error('Cannot call a method that returns maintenance tasks without providing a user for de/encryption')\n }\n\n getMaintenanceTaskWithUser(user: models.User, maintenanceTaskId: string): Promise<models.MaintenanceTask | any> {\n return super\n .getMaintenanceTask(maintenanceTaskId)\n .then((mt) => this.decrypt(user, [mt]))\n .then((mts) => mts[0])\n }\n\n modifyMaintenanceTask(body?: models.MaintenanceTask): never {\n throw new Error('Cannot call a method that returns maintenance tasks without providing a user for de/encryption')\n }\n\n modifyMaintenanceTaskWithUser(user: models.User, body?: models.MaintenanceTask): Promise<models.MaintenanceTask | any> {\n return body ? this.modifyMaintenanceTaskAs(this.dataOwnerApi.getDataOwnerIdOf(user), body) : Promise.resolve(null)\n }\n\n private modifyMaintenanceTaskAs(dataOwner: string, body: models.MaintenanceTask): Promise<models.MaintenanceTask> {\n return this.encryptAs(dataOwner, [_.cloneDeep(body)])\n .then((encTasks) => super.modifyMaintenanceTask(encTasks[0]))\n .then((mt) => this.decryptAs(dataOwner, [mt]))\n .then((mts) => mts[0])\n }\n\n encrypt(user: models.User, maintenanceTasks: Array<models.MaintenanceTask>): Promise<Array<models.MaintenanceTask>> {\n const dataOwnerId = this.dataOwnerApi.getDataOwnerIdOf(user)\n return this.encryptAs(dataOwnerId, maintenanceTasks)\n }\n\n private encryptAs(dataOwner: string, maintenanceTasks: Array<models.MaintenanceTask>): Promise<Array<models.MaintenanceTask>> {\n return Promise.all(\n maintenanceTasks.map((m) =>\n this.crypto.xapi.tryEncryptEntity(m, 'MaintenanceTask', this.encryptedFields, true, false, (x) => new models.MaintenanceTask(x))\n )\n )\n }\n\n decrypt(user: models.User, maintenanceTasks: Array<models.MaintenanceTask>): Promise<Array<models.MaintenanceTask>> {\n const dataOwnerId = this.dataOwnerApi.getDataOwnerIdOf(user)\n return this.decryptAs(dataOwnerId, maintenanceTasks)\n }\n\n private decryptAs(dataOwner: string, maintenanceTasks: Array<models.MaintenanceTask>): Promise<Array<models.MaintenanceTask>> {\n return Promise.all(\n maintenanceTasks.map(async (mT) =>\n this.crypto.xapi.decryptEntity(mT, 'MaintenanceTask', (x) => new MaintenanceTask(x)).then(({ entity }) => entity)\n )\n )\n }\n\n /**\n * @return if the logged data owner has write access to the content of the given maintenance task\n */\n async hasWriteAccess(maintenanceTask: models.MaintenanceTask): Promise<boolean> {\n return this.crypto.xapi.hasWriteAccess({ entity: maintenanceTask, type: 'MaintenanceTask' })\n }\n\n /**\n * Share an existing maintenance task with other data owners, allowing them to access the non-encrypted data of the maintenance task and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param delegateId the id of the data owner which will be granted access to the maintenance task.\n * @param maintenanceTask the maintenance task to share.\n * @param options optional parameters to customize the sharing behaviour:\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * maintenance task does not have encrypted content.\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity\n */\n async shareWith(\n delegateId: string,\n maintenanceTask: models.MaintenanceTask,\n options: {\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n } = {}\n ): Promise<models.MaintenanceTask> {\n return this.shareWithMany(maintenanceTask, { [delegateId]: options })\n }\n\n /**\n * Share an existing maintenance task with other data owners, allowing them to access the non-encrypted data of the maintenance task and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param maintenanceTask the maintenance task to share.\n * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * maintenance task does not have encrypted content.\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity.\n */\n async shareWithMany(\n maintenanceTask: models.MaintenanceTask,\n delegates: {\n [delegateId: string]: {\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<models.MaintenanceTask> {\n return (await this.tryShareWithMany(maintenanceTask, delegates)).updatedEntityOrThrow\n }\n\n /**\n * Share an existing maintenance task with other data owners, allowing them to access the non-encrypted data of the maintenance task and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param maintenanceTask the maintenance task to share.\n * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * maintenance task does not have encrypted content.\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @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\n * the operation failed.\n */\n async tryShareWithMany(\n maintenanceTask: models.MaintenanceTask,\n delegates: {\n [delegateId: string]: {\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<ShareResult<models.MaintenanceTask>> {\n const self = await this.dataOwnerApi.getCurrentDataOwnerId()\n // All entities should have an encryption key.\n const entityWithEncryptionKey = await this.crypto.xapi.ensureEncryptionKeysInitialised(maintenanceTask, 'MaintenanceTask')\n const updatedEntity = entityWithEncryptionKey ? await this.modifyMaintenanceTaskAs(self, entityWithEncryptionKey) : maintenanceTask\n return this.crypto.xapi\n .simpleShareOrUpdateEncryptedEntityMetadata(\n { entity: updatedEntity, type: 'MaintenanceTask' },\n true,\n Object.fromEntries(\n Object.entries(delegates).map(([delegateId, options]) => [\n delegateId,\n {\n requestedPermissions: options.requestedPermissions,\n shareEncryptionKeys: options.shareEncryptionKey,\n shareOwningEntityIds: ShareMetadataBehaviour.NEVER,\n shareSecretIds: undefined,\n },\n ])\n ),\n (x) => this.bulkShareMaintenanceTask(x)\n )\n .then((r) => r.mapSuccessAsync((e) => this.decryptAs(self, [e]).then((es) => es[0])))\n }\n\n getDataOwnersWithAccessTo(\n entity: models.MaintenanceTask\n ): Promise<{ permissionsByDataOwnerId: { [p: string]: AccessLevelEnum }; hasUnknownAnonymousDataOwners: boolean }> {\n return this.crypto.delegationsDeAnonymization.getDataOwnersWithAccessTo({ entity, type: 'MaintenanceTask' })\n }\n\n getEncryptionKeysOf(entity: models.MaintenanceTask): Promise<string[]> {\n return this.crypto.xapi.encryptionKeysOf({ entity, type: 'MaintenanceTask' }, undefined)\n }\n\n async subscribeToMaintenanceTaskEvents(\n eventTypes: ('CREATE' | 'UPDATE' | 'DELETE')[],\n filter: AbstractFilter<MaintenanceTask>,\n eventFired: (dataSample: MaintenanceTask) => Promise<void>,\n options: SubscriptionOptions = {}\n ): Promise<Connection> {\n const currentUser = await this.userApi.getCurrentUser()\n\n return subscribeToEntityEvents(\n this.host,\n this.authApi,\n 'MaintenanceTask',\n eventTypes,\n filter,\n eventFired,\n options,\n async (encrypted) => (await this.decrypt(currentUser, [encrypted]))[0]\n ).then((rs) => new ConnectionImpl(rs))\n }\n\n createDelegationDeAnonymizationMetadata(entity: MaintenanceTask, delegates: string[]): Promise<void> {\n return this.crypto.delegationsDeAnonymization.createOrUpdateDeAnonymizationInfo({ entity, type: 'MaintenanceTask' }, delegates)\n }\n}\n"]}
|
|
@@ -289,4 +289,22 @@ export declare class IccPatientXApi extends IccPatientApi implements EncryptedEn
|
|
|
289
289
|
mergePatients(from: Patient, mergedInto: Patient): Promise<Patient>;
|
|
290
290
|
subscribeToPatientEvents(eventTypes: ('CREATE' | 'UPDATE' | 'DELETE')[], filter: AbstractFilter<Patient> | undefined, eventFired: (patient: Patient) => Promise<void>, options?: SubscriptionOptions): Promise<Connection>;
|
|
291
291
|
createDelegationDeAnonymizationMetadata(entity: Patient, delegates: string[]): Promise<void>;
|
|
292
|
+
/**
|
|
293
|
+
* Initializes the exchange data towards a newly invited patient. This allows the doctor to share data with the
|
|
294
|
+
* patient even if the patient has not yet initialized a keypair for himself.
|
|
295
|
+
*
|
|
296
|
+
* This method should be used only if the patient has not yet initialized a keypair for himself. If the patient has
|
|
297
|
+
* already initialized a keypair this method does nothing and returns false. In this case the exchange data will be
|
|
298
|
+
* automatically created the first time you share data with the patient, and your implementation of the crypto
|
|
299
|
+
* strategies will be used to validate the public keys of the patient.
|
|
300
|
+
*
|
|
301
|
+
* Once exchange data is initialized you can use the {@link IccRecoveryXApi.createExchangeDataRecoveryInfo} to
|
|
302
|
+
* generate a key that the patient will be able to use on his first login to immediately gain access to the exchange
|
|
303
|
+
* data (through the {@link IccRecoveryXApi.recoverExchangeData} method).
|
|
304
|
+
*
|
|
305
|
+
* @param patientId the id of the newly invited patient.
|
|
306
|
+
* @return true if exchange data was initialized, false if the patient already has a key pair and the exchange data
|
|
307
|
+
* will be initialized in the standard way (automatically on the first time data is shared with the user).
|
|
308
|
+
*/
|
|
309
|
+
forceInitialiseExchangeDataToNewlyInvitedPatient(patientId: string): Promise<boolean>;
|
|
292
310
|
}
|
|
@@ -841,6 +841,35 @@ class IccPatientXApi extends icc_api_1.IccPatientApi {
|
|
|
841
841
|
createDelegationDeAnonymizationMetadata(entity, delegates) {
|
|
842
842
|
return this.crypto.delegationsDeAnonymization.createOrUpdateDeAnonymizationInfo({ entity, type: 'Patient' }, delegates);
|
|
843
843
|
}
|
|
844
|
+
/**
|
|
845
|
+
* Initializes the exchange data towards a newly invited patient. This allows the doctor to share data with the
|
|
846
|
+
* patient even if the patient has not yet initialized a keypair for himself.
|
|
847
|
+
*
|
|
848
|
+
* This method should be used only if the patient has not yet initialized a keypair for himself. If the patient has
|
|
849
|
+
* already initialized a keypair this method does nothing and returns false. In this case the exchange data will be
|
|
850
|
+
* automatically created the first time you share data with the patient, and your implementation of the crypto
|
|
851
|
+
* strategies will be used to validate the public keys of the patient.
|
|
852
|
+
*
|
|
853
|
+
* Once exchange data is initialized you can use the {@link IccRecoveryXApi.createExchangeDataRecoveryInfo} to
|
|
854
|
+
* generate a key that the patient will be able to use on his first login to immediately gain access to the exchange
|
|
855
|
+
* data (through the {@link IccRecoveryXApi.recoverExchangeData} method).
|
|
856
|
+
*
|
|
857
|
+
* @param patientId the id of the newly invited patient.
|
|
858
|
+
* @return true if exchange data was initialized, false if the patient already has a key pair and the exchange data
|
|
859
|
+
* will be initialized in the standard way (automatically on the first time data is shared with the user).
|
|
860
|
+
*/
|
|
861
|
+
forceInitialiseExchangeDataToNewlyInvitedPatient(patientId) {
|
|
862
|
+
const _super = Object.create(null, {
|
|
863
|
+
getPatient: { get: () => super.getPatient }
|
|
864
|
+
});
|
|
865
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
866
|
+
const patient = yield _super.getPatient.call(this, patientId);
|
|
867
|
+
if (this.dataOwnerApi.getHexPublicKeysOf(patient).size)
|
|
868
|
+
return false;
|
|
869
|
+
yield this.crypto.exchangeData.getOrCreateEncryptionDataTo(patientId, undefined, undefined, true);
|
|
870
|
+
return true;
|
|
871
|
+
});
|
|
872
|
+
}
|
|
844
873
|
}
|
|
845
874
|
exports.IccPatientXApi = IccPatientXApi;
|
|
846
875
|
//# sourceMappingURL=icc-patient-x-api.js.map
|