@icure/api 8.0.48 → 8.0.50

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.
Files changed (61) hide show
  1. package/icc-api/api/IccContactApi.js +1 -1
  2. package/icc-api/api/IccContactApi.js.map +1 -1
  3. package/icc-x-api/crypto/ConfidentialEntities.js +1 -1
  4. package/icc-x-api/crypto/ConfidentialEntities.js.map +1 -1
  5. package/icc-x-api/crypto/DelegationsDeAnonymization.js +5 -2
  6. package/icc-x-api/crypto/DelegationsDeAnonymization.js.map +1 -1
  7. package/icc-x-api/crypto/ExtendedApisUtils.d.ts +5 -8
  8. package/icc-x-api/crypto/ExtendedApisUtils.js.map +1 -1
  9. package/icc-x-api/crypto/ExtendedApisUtilsImpl.d.ts +5 -5
  10. package/icc-x-api/crypto/ExtendedApisUtilsImpl.js +4 -14
  11. package/icc-x-api/crypto/ExtendedApisUtilsImpl.js.map +1 -1
  12. package/icc-x-api/crypto/utils.js +5 -2
  13. package/icc-x-api/crypto/utils.js.map +1 -1
  14. package/icc-x-api/filters/HealthElementByHcPartyTagCodeFilter.d.ts +1 -1
  15. package/icc-x-api/filters/HealthElementByHcPartyTagCodeFilter.js.map +1 -1
  16. package/icc-x-api/icc-accesslog-x-api.d.ts +6 -0
  17. package/icc-x-api/icc-accesslog-x-api.js +9 -3
  18. package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
  19. package/icc-x-api/icc-calendar-item-x-api.d.ts +6 -0
  20. package/icc-x-api/icc-calendar-item-x-api.js +9 -3
  21. package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
  22. package/icc-x-api/icc-classification-x-api.d.ts +6 -0
  23. package/icc-x-api/icc-classification-x-api.js +9 -3
  24. package/icc-x-api/icc-classification-x-api.js.map +1 -1
  25. package/icc-x-api/icc-contact-x-api.d.ts +6 -0
  26. package/icc-x-api/icc-contact-x-api.js +9 -3
  27. package/icc-x-api/icc-contact-x-api.js.map +1 -1
  28. package/icc-x-api/icc-document-x-api.d.ts +6 -0
  29. package/icc-x-api/icc-document-x-api.js +9 -3
  30. package/icc-x-api/icc-document-x-api.js.map +1 -1
  31. package/icc-x-api/icc-form-x-api.d.ts +6 -0
  32. package/icc-x-api/icc-form-x-api.js +9 -3
  33. package/icc-x-api/icc-form-x-api.js.map +1 -1
  34. package/icc-x-api/icc-helement-x-api.d.ts +6 -0
  35. package/icc-x-api/icc-helement-x-api.js +9 -3
  36. package/icc-x-api/icc-helement-x-api.js.map +1 -1
  37. package/icc-x-api/icc-invoice-x-api.d.ts +6 -0
  38. package/icc-x-api/icc-invoice-x-api.js +9 -3
  39. package/icc-x-api/icc-invoice-x-api.js.map +1 -1
  40. package/icc-x-api/icc-maintenance-task-x-api.d.ts +6 -0
  41. package/icc-x-api/icc-maintenance-task-x-api.js +9 -3
  42. package/icc-x-api/icc-maintenance-task-x-api.js.map +1 -1
  43. package/icc-x-api/icc-message-x-api.js +5 -2
  44. package/icc-x-api/icc-message-x-api.js.map +1 -1
  45. package/icc-x-api/icc-patient-x-api.js +5 -2
  46. package/icc-x-api/icc-patient-x-api.js.map +1 -1
  47. package/icc-x-api/icc-receipt-x-api.d.ts +6 -0
  48. package/icc-x-api/icc-receipt-x-api.js +9 -3
  49. package/icc-x-api/icc-receipt-x-api.js.map +1 -1
  50. package/icc-x-api/icc-time-table-x-api.d.ts +6 -0
  51. package/icc-x-api/icc-time-table-x-api.js +9 -3
  52. package/icc-x-api/icc-time-table-x-api.js.map +1 -1
  53. package/icc-x-api/icc-topic-x-api.d.ts +6 -0
  54. package/icc-x-api/icc-topic-x-api.js +9 -3
  55. package/icc-x-api/icc-topic-x-api.js.map +1 -1
  56. package/package.json +1 -1
  57. package/test/icc-x-api/help-meddi.d.ts +1 -0
  58. package/test/icc-x-api/help-meddi.js +53 -0
  59. package/test/icc-x-api/help-meddi.js.map +1 -0
  60. package/test/icc-x-api/icc-recovery-x-api.js +5 -0
  61. package/test/icc-x-api/icc-recovery-x-api.js.map +1 -1
@@ -470,7 +470,7 @@ class IccContactApi {
470
470
  new Date().getTime() +
471
471
  (startDate ? '&startDate=' + encodeURIComponent(String(startDate)) : '') +
472
472
  (endDate ? '&endDate=' + encodeURIComponent(String(endDate)) : '') +
473
- (hcpartyid ? '&hcpartyid=' + encodeURIComponent(String(hcpartyid)) : '') +
473
+ (hcpartyid ? '&hcPartyId=' + encodeURIComponent(String(hcpartyid)) : '') +
474
474
  (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
475
475
  (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
476
476
  (limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
@@ -1 +1 @@
1
- {"version":3,"file":"IccContactApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccContactApi.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAG3B,8CAA0C;AAC1C,8CAA0C;AAE1C,0DAAsD;AAGtD,kDAA8C;AAC9C,kEAA8D;AAC9D,kDAA8C;AAC9C,wEAAoE;AACpE,wEAAoE;AACpE,8CAA0C;AAC1C,wFAA8G;AAC9G,qDAAiD;AAEjD,mFAA+E;AAC/E,iGAA6F;AAG7F,MAAa,aAAa;IAMxB,IAAI,OAAO;QACT,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACvC,CAAC;IAED,YACE,IAAY,EACZ,OAAY,EACZ,sBAA+C,EAC/C,SAAyE;QAEzE,IAAI,CAAC,IAAI,GAAG,IAAA,+BAAc,EAAC,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,SAAG,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC9E,IAAI,CAAC,sBAAsB,GAAG,C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AM,IAAI,CAAC,OAAO,CAAA;YAChC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,cAAc,CAAC,CAAC,MAAM,CAAC,IAAI,SAAG,CAAC,MAAM,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC,CAAA;YACvH,OAAO,SAAG,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,sBAAsB,CAAC,cAAc,EAAE,CAAC;iBAC3H,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAE,GAAG,CAAC,IAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,2DAA4B,CAAC,CAAC,CAAC,CAAC,CAAC;iBACxF,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;QAC1C,CAAC;KAAA;CACF;AA/rBD,sCA+rBC","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\nimport { XHR } from './XHR'\nimport { AbstractFilterContact } from '../model/AbstractFilterContact'\nimport { AbstractFilterService } from '../model/AbstractFilterService'\nimport { Contact } from '../model/Contact'\nimport { Content } from '../model/Content'\nimport { Delegation } from '../model/Delegation'\nimport { DocIdentifier } from '../model/DocIdentifier'\nimport { FilterChainContact } from '../model/FilterChainContact'\nimport { FilterChainService } from '../model/FilterChainService'\nimport { IcureStub } from '../model/IcureStub'\nimport { LabelledOccurence } from '../model/LabelledOccurence'\nimport { ListOfIds } from '../model/ListOfIds'\nimport { PaginatedListContact } from '../model/PaginatedListContact'\nimport { PaginatedListService } from '../model/PaginatedListService'\nimport { Service } from '../model/Service'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\nimport { iccRestApiPath } from './IccRestApiPath'\nimport { EntityShareOrMetadataUpdateRequest } from '../model/requests/EntityShareOrMetadataUpdateRequest'\nimport { EntityBulkShareResult } from '../model/requests/EntityBulkShareResult'\nimport { MinimalEntityBulkShareResult } from '../model/requests/MinimalEntityBulkShareResult'\nimport { BulkShareOrUpdateMetadataParams } from '../model/requests/BulkShareOrUpdateMetadataParams'\n\nexport class IccContactApi {\n host: string\n _headers: Array<XHR.Header>\n authenticationProvider: AuthenticationProvider\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n get headers(): Promise<Array<XHR.Header>> {\n return Promise.resolve(this._headers)\n }\n\n constructor(\n host: string,\n headers: any,\n authenticationProvider?: AuthenticationProvider,\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n ) {\n this.host = iccRestApiPath(host)\n this._headers = Object.keys(headers).map((k) => new XHR.Header(k, headers[k]))\n this.authenticationProvider = !!authenticationProvider ? authenticationProvider : new NoAuthenticationProvider()\n this.fetchImpl = fetchImpl\n }\n\n handleError(e: XHR.XHRError): never {\n throw e\n }\n\n /**\n * Keys must be delimited by coma\n * @summary Close contacts for Healthcare Party and secret foreign keys.\n * @param hcPartyId\n * @param secretFKeys\n */\n async closeForHCPartyPatientForeignKeys(hcPartyId: string, secretFKeys: string): Promise<Array<Contact>> {\n let _body = null\n\n const _url =\n this.host +\n `/contact/byHcPartySecretForeignKeys/close` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +\n (secretFKeys ? '&secretFKeys=' + encodeURIComponent(String(secretFKeys)) : '')\n let headers = await this.headers\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Creates a contact with the current user and returns an instance of created contact afterward.\n * @summary Create a contact with the current user\n * @param body\n */\n async createContact(body?: Contact): Promise<Contact> {\n const _url = this.host + `/contact` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Contact(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns the modified contacts.\n * @summary Create a batch of contacts\n * @param body\n */\n async createContacts(body?: Array<Contact>): Promise<Array<Contact>> {\n const _url = this.host + `/contact/batch` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Deletes a batch of contacts.\n *\n * @param contactIds a ListOfIds containing the ids of the contacts to delete.\n * @return a Promise that will resolve in an array of the DocIdentifiers of the successfully deleted contacts.\n */\n async deleteContacts(contactIds: ListOfIds): Promise<Array<DocIdentifier>> {\n const headers = (await this.headers).filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand(\n 'POST',\n this.host + `/contact/delete/batch` + '?ts=' + new Date().getTime(),\n headers,\n contactIds,\n this.fetchImpl,\n undefined,\n this.authenticationProvider.getAuthService()\n )\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocIdentifier(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Deletes a single contact by id.\n *\n * @param contactId the id of the contact to delete.\n */\n async deleteContact(contactId: string): Promise<DocIdentifier> {\n return XHR.sendCommand(\n 'DELETE',\n this.host + `/contact/${encodeURIComponent(contactId)}` + '?ts=' + new Date().getTime(),\n await this.headers,\n null,\n this.fetchImpl,\n undefined,\n this.authenticationProvider.getAuthService()\n )\n .then((doc) => new DocIdentifier(doc.body))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of contacts along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.\n * @summary List contacts for the current user (HcParty) or the given hcparty in the filter\n * @param body\n * @param startDocumentId A Contact document ID\n * @param limit Number of rows\n */\n async filterContactsBy(startDocumentId?: string, limit?: number, body?: FilterChainContact): Promise<PaginatedListContact> {\n let _body = null\n _body = body\n\n const _url =\n this.host +\n `/contact/filter` +\n '?ts=' +\n new Date().getTime() +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListContact(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of contacts along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.\n * @summary List services for the current user (HcParty) or the given hcparty in the filter\n * @param body\n * @param startDocumentId A Contact document ID\n * @param limit Number of rows\n */\n async filterServicesBy(startDocumentId?: string, limit?: number, body?: FilterChainService): Promise<PaginatedListService> {\n let _body = null\n _body = body\n\n const _url =\n this.host +\n `/contact/service/filter` +\n '?ts=' +\n new Date().getTime() +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListService(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get a list of contacts found by Healthcare Party and form's id.\n * @param hcPartyId\n * @param formId\n */\n async findByHCPartyFormId(hcPartyId: string, formId: string): Promise<Array<Contact>> {\n let _body = null\n\n const _url =\n this.host +\n `/contact/byHcPartyFormId` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +\n (formId ? '&formId=' + encodeURIComponent(String(formId)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get a list of contacts found by Healthcare Party and form's ids.\n * @param body\n * @param hcPartyId\n */\n async findByHCPartyFormIds(hcPartyId: string, body?: ListOfIds): Promise<Array<Contact>> {\n let _body = null\n _body = body\n\n const _url =\n this.host +\n `/contact/byHcPartyFormIds` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Keys must be delimited by coma\n * @summary Get a list of contacts found by Healthcare Party and secret foreign keys.\n * @param hcPartyId\n * @param planOfActionsIds\n * @param skipClosedContacts\n @param body\n */\n async findByHCPartyPatientSecretFKeysUsingPost(\n hcPartyId: string,\n planOfActionsIds?: string,\n skipClosedContacts?: boolean,\n body?: Array<string>\n ): Promise<Array<Contact>> {\n let _body = null\n _body = body\n\n const _url =\n this.host +\n `/contact/byHcPartySecretForeignKeys` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +\n (planOfActionsIds ? '&planOfActionsIds=' + encodeURIComponent(String(planOfActionsIds)) : '') +\n (skipClosedContacts ? '&skipClosedContacts=' + encodeURIComponent(String(skipClosedContacts)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Keys must be delimited by coma\n * @summary Get a list of contacts found by Healthcare Party and secret foreign keys.\n * @param hcPartyId\n * @param secretFKeys\n * @param planOfActionsIds\n * @param skipClosedContacts\n */\n async findByHCPartyPatientSecretFKeys(\n hcPartyId: string,\n secretFKeys: string,\n planOfActionsIds?: string,\n skipClosedContacts?: boolean\n ): Promise<Array<Contact>> {\n let _body = null\n\n const _url =\n this.host +\n `/contact/byHcPartySecretForeignKeys` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +\n (secretFKeys ? '&secretFKeys=' + encodeURIComponent(String(secretFKeys)) : '') +\n (planOfActionsIds ? '&planOfActionsIds=' + encodeURIComponent(String(planOfActionsIds)) : '') +\n (skipClosedContacts ? '&skipClosedContacts=' + encodeURIComponent(String(skipClosedContacts)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary List contacts found By Healthcare Party and service Id.\n * @param hcPartyId\n * @param serviceId\n */\n async findByHCPartyServiceId(hcPartyId: string, serviceId: string): Promise<Array<Contact>> {\n let _body = null\n\n const _url =\n this.host +\n `/contact/byHcPartyServiceId` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +\n (serviceId ? '&serviceId=' + encodeURIComponent(String(serviceId)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary List contacts found By externalId.\n * @param externalId\n */\n async findContactsByExternalId(externalId: string): Promise<Array<Contact>> {\n let _body = null\n\n const _url =\n this.host +\n `/contact/byExternalId` +\n '?ts=' +\n new Date().getTime() +\n (externalId ? '&externalId=' + encodeURIComponent(String(externalId)) : '')\n let headers = await this.headers\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get a list of contacts found by Healthcare Party and Patient foreign keys.\n * @param body\n * @param hcPartyId\n */\n async findContactsByHCPartyPatientForeignKeys(hcPartyId: string, body?: ListOfIds): Promise<Array<Contact>> {\n let _body = null\n _body = body\n\n const _url =\n this.host +\n `/contact/byHcPartyPatientForeignKeys` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Keys must be delimited by coma\n * @summary List contacts found By Healthcare Party and secret foreign keys.\n * @param body\n * @param hcPartyId\n */\n async findContactsDelegationsStubsByHCPartyPatientForeignKeysUsingPost(hcPartyId: string, body?: Array<string>): Promise<Array<IcureStub>> {\n let _body = null\n _body = body\n\n const _url =\n this.host +\n `/contact/byHcPartySecretForeignKeys/delegations` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new IcureStub(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary List contacts found By Healthcare Party and secret foreign keys.\n * @param hcPartyId\n * @param secretFKeys\n */\n async findContactsDelegationsStubsByHCPartyPatientForeignKeys(hcPartyId: string, secretFKeys: string): Promise<Array<IcureStub>> {\n let _body = null\n\n const _url =\n this.host +\n `/contact/byHcPartySecretForeignKeys/delegations` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +\n (secretFKeys ? '&secretFKeys=' + encodeURIComponent(String(secretFKeys)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new IcureStub(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Gets a contact based on its id\n * @summary Get a contact\n * @param contactId\n */\n async getContact(contactId: string): Promise<Contact> {\n let _body = null\n\n const _url = this.host + `/contact/${encodeURIComponent(String(contactId))}` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Contact(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Gets a service based on its id\n * @summary Get a service\n * @param serviceId\n */\n async getService(serviceId: string): Promise<Service> {\n let _body = null\n\n const _url = this.host + `/contact/service/${encodeURIComponent(String(serviceId))}` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Service(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Get a list of contact by ids/keys.\n * @summary Get contacts by batch\n * @param body\n */\n async getContacts(body?: ListOfIds): Promise<Array<Contact>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/contact/byIds` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get an empty content\n */\n async getEmptyContent(): Promise<Content> {\n let _body = null\n\n const _url = this.host + `/contact/service/content/empty` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Content(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get the list of all used codes frequencies in services\n * @param codeType\n * @param minOccurences\n */\n async getServiceCodesOccurences(codeType: string, minOccurences: number): Promise<Array<LabelledOccurence>> {\n let _body = null\n\n const _url =\n this.host +\n `/contact/service/codes/${encodeURIComponent(String(codeType))}/${encodeURIComponent(String(minOccurences))}` +\n '?ts=' +\n new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new LabelledOccurence(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of contacts.\n * @summary List contacts bu opening date parties with(out) pagination\n * @param startKey The contact openingDate\n * @param endKey The contact max openingDate\n * @param hcpartyid hcpartyid\n * @param startDocumentId A contact party document ID\n * @param limit Number of rows\n */\n async listContactsByOpeningDate(\n startDate: number,\n endDate: number,\n hcpartyid: string,\n startKey?: string,\n startDocumentId?: string,\n limit?: number\n ): Promise<PaginatedListContact> {\n let _body = null\n\n const _url =\n this.host +\n `/contact/byOpeningDate` +\n '?ts=' +\n new Date().getTime() +\n (startDate ? '&startDate=' + encodeURIComponent(String(startDate)) : '') +\n (endDate ? '&endDate=' + encodeURIComponent(String(endDate)) : '') +\n (hcpartyid ? '&hcpartyid=' + encodeURIComponent(String(hcpartyid)) : '') +\n (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListContact(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of services\n * @summary List services with provided ids\n * @param body\n */\n async listServices(body?: ListOfIds): Promise<Array<Service>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/contact/service` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Service(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of services\n * @summary List services by related association id\n * @param associationId\n */\n async listServicesByAssociationId(associationId: string): Promise<Array<Service>> {\n let _body = null\n\n const _url =\n this.host +\n `/contact/service/associationId` +\n '?ts=' +\n new Date().getTime() +\n (associationId ? '&associationId=' + encodeURIComponent(String(associationId)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Service(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns the list of services linked to the provided health element id\n * @summary List services linked to a health element\n * @param healthElementId\n * @param hcPartyId hcPartyId\n */\n async listServicesByHealthElementId(healthElementId: string, hcPartyId: string): Promise<Array<Service>> {\n let _body = null\n\n const _url =\n this.host +\n `/contact/service/healthElementId/${encodeURIComponent(String(healthElementId))}` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Service(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of services\n * @summary List services linked to provided ids\n * @param body\n * @param linkType The type of the link\n */\n async listServicesLinkedTo(linkType?: string, body?: ListOfIds): Promise<Array<Service>> {\n let _body = null\n _body = body\n\n const _url =\n this.host + `/contact/service/linkedTo` + '?ts=' + new Date().getTime() + (linkType ? '&linkType=' + encodeURIComponent(String(linkType)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Service(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get ids of contacts matching the provided filter for the current user (HcParty)\n * @param body\n */\n async matchContactsBy(body?: AbstractFilterContact): Promise<Array<string>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/contact/match` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => JSON.parse(JSON.stringify(it))))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get ids of services matching the provided filter for the current user\n * @param body\n */\n async matchServicesBy(body?: AbstractFilterService): Promise<Array<string>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/contact/service/match` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => JSON.parse(JSON.stringify(it))))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns the modified contact.\n * @summary Modify a contact\n * @param body\n */\n async modifyContact(body?: Contact): Promise<Contact> {\n let _body = null\n _body = body\n\n const _url = this.host + `/contact` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Contact(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns the modified contacts.\n * @summary Modify a batch of contacts\n * @param body\n */\n async modifyContacts(body?: Array<Contact>): Promise<Array<Contact>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/contact/batch` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n\n /**\n * @summary List Contact ids by data owner and a set of secret foreign key. The ids will be sorted by Contact openingDate, in ascending or descending\n * order according to the specified parameter value.\n *\n * @param dataOwnerId the data owner id.\n * @param secretFKeys an array of secret foreign keys.\n * @param startDate a timestamp in epoch milliseconds. If undefined, all the contact ids since the beginning of time will be returned.\n * @param endDate a timestamp in epoch milliseconds. If undefined, all the contact ids until the end of time will be returned.\n * @param descending whether to return the ids ordered in ascending or descending order by Contact openingDate\n * @return a promise that will resolve in an Array of Contact ids.\n */\n async findContactIdsByDataOwnerPatientOpeningDate(\n dataOwnerId: string,\n secretFKeys: string[],\n startDate?: number,\n endDate?: number,\n descending?: boolean\n ): Promise<string[]> {\n const _url =\n this.host +\n `/contact/byDataOwnerPatientOpeningDate?ts=${new Date().getTime()}` +\n '&dataOwnerId=' +\n encodeURIComponent(dataOwnerId) +\n (!!startDate ? `&startDate=${encodeURIComponent(startDate)}` : '') +\n (!!endDate ? `&endDate=${encodeURIComponent(endDate)}` : '') +\n (!!descending ? `&descending=${descending}` : '')\n const headers = (await this.headers).filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n const body = new ListOfIds({ ids: secretFKeys })\n return XHR.sendCommand('POST', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => JSON.parse(JSON.stringify(it))))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @internal this method is for internal use only and may be changed without notice\n */\n async bulkShareContacts(request: BulkShareOrUpdateMetadataParams): Promise<EntityBulkShareResult<Contact>[]> {\n const _url = this.host + '/contact/bulkSharedMetadataUpdate' + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('PUT', _url, headers, request, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((x) => new EntityBulkShareResult<Contact>(x, Contact)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @internal this method is for internal use only and may be changed without notice\n */\n async bulkShareContactsMinimal(request: BulkShareOrUpdateMetadataParams): Promise<MinimalEntityBulkShareResult[]> {\n const _url = this.host + '/contact/bulkSharedMetadataUpdateMinimal' + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('PUT', _url, headers, request, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((x) => new MinimalEntityBulkShareResult(x)))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
1
+ {"version":3,"file":"IccContactApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccContactApi.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAG3B,8CAA0C;AAC1C,8CAA0C;AAE1C,0DAAsD;AAGtD,kDAA8C;AAC9C,kEAA8D;AAC9D,kDAA8C;AAC9C,wEAAoE;AACpE,wEAAoE;AACpE,8CAA0C;AAC1C,wFAA8G;AAC9G,qDAAiD;AAEjD,mFAA+E;AAC/E,iGAA6F;AAG7F,MAAa,aAAa;IAMxB,IAAI,OAAO;QACT,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACvC,CAAC;IAED,YACE,IAAY,EACZ,OAAY,EACZ,sBAA+C,EAC/C,SAAyE;QAEzE,IAAI,CAAC,IAAI,GAAG,IAAA,+BAAc,EAAC,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,SAAG,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC9E,IAAI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,IAAI,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAA;YAChC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,cAAc,CAAC,CAAC,MAAM,CAAC,IAAI,SAAG,CAAC,MAAM,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC,CAAA;YACvH,OAAO,SAAG,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,sBAAsB,CAAC,cAAc,EAAE,CAAC;iBAC3H,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAE,GAAG,CAAC,IAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,2DAA4B,CAAC,CAAC,CAAC,CAAC,CAAC;iBACxF,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;QAC1C,CAAC;KAAA;CACF;AA9rBD,sCA8rBC","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\nimport { XHR } from './XHR'\nimport { AbstractFilterContact } from '../model/AbstractFilterContact'\nimport { AbstractFilterService } from '../model/AbstractFilterService'\nimport { Contact } from '../model/Contact'\nimport { Content } from '../model/Content'\nimport { Delegation } from '../model/Delegation'\nimport { DocIdentifier } from '../model/DocIdentifier'\nimport { FilterChainContact } from '../model/FilterChainContact'\nimport { FilterChainService } from '../model/FilterChainService'\nimport { IcureStub } from '../model/IcureStub'\nimport { LabelledOccurence } from '../model/LabelledOccurence'\nimport { ListOfIds } from '../model/ListOfIds'\nimport { PaginatedListContact } from '../model/PaginatedListContact'\nimport { PaginatedListService } from '../model/PaginatedListService'\nimport { Service } from '../model/Service'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\nimport { iccRestApiPath } from './IccRestApiPath'\nimport { EntityShareOrMetadataUpdateRequest } from '../model/requests/EntityShareOrMetadataUpdateRequest'\nimport { EntityBulkShareResult } from '../model/requests/EntityBulkShareResult'\nimport { MinimalEntityBulkShareResult } from '../model/requests/MinimalEntityBulkShareResult'\nimport { BulkShareOrUpdateMetadataParams } from '../model/requests/BulkShareOrUpdateMetadataParams'\n\nexport class IccContactApi {\n host: string\n _headers: Array<XHR.Header>\n authenticationProvider: AuthenticationProvider\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n get headers(): Promise<Array<XHR.Header>> {\n return Promise.resolve(this._headers)\n }\n\n constructor(\n host: string,\n headers: any,\n authenticationProvider?: AuthenticationProvider,\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n ) {\n this.host = iccRestApiPath(host)\n this._headers = Object.keys(headers).map((k) => new XHR.Header(k, headers[k]))\n this.authenticationProvider = !!authenticationProvider ? authenticationProvider : new NoAuthenticationProvider()\n this.fetchImpl = fetchImpl\n }\n\n handleError(e: XHR.XHRError): never {\n throw e\n }\n\n /**\n * Keys must be delimited by coma\n * @summary Close contacts for Healthcare Party and secret foreign keys.\n * @param hcPartyId\n * @param secretFKeys\n */\n async closeForHCPartyPatientForeignKeys(hcPartyId: string, secretFKeys: string): Promise<Array<Contact>> {\n let _body = null\n\n const _url =\n this.host +\n `/contact/byHcPartySecretForeignKeys/close` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +\n (secretFKeys ? '&secretFKeys=' + encodeURIComponent(String(secretFKeys)) : '')\n let headers = await this.headers\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Creates a contact with the current user and returns an instance of created contact afterward.\n * @summary Create a contact with the current user\n * @param body\n */\n async createContact(body?: Contact): Promise<Contact> {\n const _url = this.host + `/contact` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Contact(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns the modified contacts.\n * @summary Create a batch of contacts\n * @param body\n */\n async createContacts(body?: Array<Contact>): Promise<Array<Contact>> {\n const _url = this.host + `/contact/batch` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Deletes a batch of contacts.\n *\n * @param contactIds a ListOfIds containing the ids of the contacts to delete.\n * @return a Promise that will resolve in an array of the DocIdentifiers of the successfully deleted contacts.\n */\n async deleteContacts(contactIds: ListOfIds): Promise<Array<DocIdentifier>> {\n const headers = (await this.headers).filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand(\n 'POST',\n this.host + `/contact/delete/batch` + '?ts=' + new Date().getTime(),\n headers,\n contactIds,\n this.fetchImpl,\n undefined,\n this.authenticationProvider.getAuthService()\n )\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocIdentifier(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Deletes a single contact by id.\n *\n * @param contactId the id of the contact to delete.\n */\n async deleteContact(contactId: string): Promise<DocIdentifier> {\n return XHR.sendCommand(\n 'DELETE',\n this.host + `/contact/${encodeURIComponent(contactId)}` + '?ts=' + new Date().getTime(),\n await this.headers,\n null,\n this.fetchImpl,\n undefined,\n this.authenticationProvider.getAuthService()\n )\n .then((doc) => new DocIdentifier(doc.body))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of contacts along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.\n * @summary List contacts for the current user (HcParty) or the given hcparty in the filter\n * @param body\n * @param startDocumentId A Contact document ID\n * @param limit Number of rows\n */\n async filterContactsBy(startDocumentId?: string, limit?: number, body?: FilterChainContact): Promise<PaginatedListContact> {\n let _body = null\n _body = body\n\n const _url =\n this.host +\n `/contact/filter` +\n '?ts=' +\n new Date().getTime() +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListContact(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of contacts along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.\n * @summary List services for the current user (HcParty) or the given hcparty in the filter\n * @param body\n * @param startDocumentId A Contact document ID\n * @param limit Number of rows\n */\n async filterServicesBy(startDocumentId?: string, limit?: number, body?: FilterChainService): Promise<PaginatedListService> {\n let _body = null\n _body = body\n\n const _url =\n this.host +\n `/contact/service/filter` +\n '?ts=' +\n new Date().getTime() +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListService(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get a list of contacts found by Healthcare Party and form's id.\n * @param hcPartyId\n * @param formId\n */\n async findByHCPartyFormId(hcPartyId: string, formId: string): Promise<Array<Contact>> {\n let _body = null\n\n const _url =\n this.host +\n `/contact/byHcPartyFormId` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +\n (formId ? '&formId=' + encodeURIComponent(String(formId)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get a list of contacts found by Healthcare Party and form's ids.\n * @param body\n * @param hcPartyId\n */\n async findByHCPartyFormIds(hcPartyId: string, body?: ListOfIds): Promise<Array<Contact>> {\n let _body = null\n _body = body\n\n const _url =\n this.host +\n `/contact/byHcPartyFormIds` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Keys must be delimited by coma\n * @summary Get a list of contacts found by Healthcare Party and secret foreign keys.\n * @param hcPartyId\n * @param planOfActionsIds\n * @param skipClosedContacts\n @param body\n */\n async findByHCPartyPatientSecretFKeysUsingPost(\n hcPartyId: string,\n planOfActionsIds?: string,\n skipClosedContacts?: boolean,\n body?: Array<string>\n ): Promise<Array<Contact>> {\n let _body = null\n _body = body\n\n const _url =\n this.host +\n `/contact/byHcPartySecretForeignKeys` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +\n (planOfActionsIds ? '&planOfActionsIds=' + encodeURIComponent(String(planOfActionsIds)) : '') +\n (skipClosedContacts ? '&skipClosedContacts=' + encodeURIComponent(String(skipClosedContacts)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Keys must be delimited by coma\n * @summary Get a list of contacts found by Healthcare Party and secret foreign keys.\n * @param hcPartyId\n * @param secretFKeys\n * @param planOfActionsIds\n * @param skipClosedContacts\n */\n async findByHCPartyPatientSecretFKeys(\n hcPartyId: string,\n secretFKeys: string,\n planOfActionsIds?: string,\n skipClosedContacts?: boolean\n ): Promise<Array<Contact>> {\n let _body = null\n\n const _url =\n this.host +\n `/contact/byHcPartySecretForeignKeys` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +\n (secretFKeys ? '&secretFKeys=' + encodeURIComponent(String(secretFKeys)) : '') +\n (planOfActionsIds ? '&planOfActionsIds=' + encodeURIComponent(String(planOfActionsIds)) : '') +\n (skipClosedContacts ? '&skipClosedContacts=' + encodeURIComponent(String(skipClosedContacts)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary List contacts found By Healthcare Party and service Id.\n * @param hcPartyId\n * @param serviceId\n */\n async findByHCPartyServiceId(hcPartyId: string, serviceId: string): Promise<Array<Contact>> {\n let _body = null\n\n const _url =\n this.host +\n `/contact/byHcPartyServiceId` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +\n (serviceId ? '&serviceId=' + encodeURIComponent(String(serviceId)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary List contacts found By externalId.\n * @param externalId\n */\n async findContactsByExternalId(externalId: string): Promise<Array<Contact>> {\n let _body = null\n\n const _url =\n this.host +\n `/contact/byExternalId` +\n '?ts=' +\n new Date().getTime() +\n (externalId ? '&externalId=' + encodeURIComponent(String(externalId)) : '')\n let headers = await this.headers\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get a list of contacts found by Healthcare Party and Patient foreign keys.\n * @param body\n * @param hcPartyId\n */\n async findContactsByHCPartyPatientForeignKeys(hcPartyId: string, body?: ListOfIds): Promise<Array<Contact>> {\n let _body = null\n _body = body\n\n const _url =\n this.host +\n `/contact/byHcPartyPatientForeignKeys` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Keys must be delimited by coma\n * @summary List contacts found By Healthcare Party and secret foreign keys.\n * @param body\n * @param hcPartyId\n */\n async findContactsDelegationsStubsByHCPartyPatientForeignKeysUsingPost(hcPartyId: string, body?: Array<string>): Promise<Array<IcureStub>> {\n let _body = null\n _body = body\n\n const _url =\n this.host +\n `/contact/byHcPartySecretForeignKeys/delegations` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new IcureStub(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary List contacts found By Healthcare Party and secret foreign keys.\n * @param hcPartyId\n * @param secretFKeys\n */\n async findContactsDelegationsStubsByHCPartyPatientForeignKeys(hcPartyId: string, secretFKeys: string): Promise<Array<IcureStub>> {\n let _body = null\n\n const _url =\n this.host +\n `/contact/byHcPartySecretForeignKeys/delegations` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +\n (secretFKeys ? '&secretFKeys=' + encodeURIComponent(String(secretFKeys)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new IcureStub(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Gets a contact based on its id\n * @summary Get a contact\n * @param contactId\n */\n async getContact(contactId: string): Promise<Contact> {\n let _body = null\n\n const _url = this.host + `/contact/${encodeURIComponent(String(contactId))}` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Contact(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Gets a service based on its id\n * @summary Get a service\n * @param serviceId\n */\n async getService(serviceId: string): Promise<Service> {\n let _body = null\n\n const _url = this.host + `/contact/service/${encodeURIComponent(String(serviceId))}` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Service(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Get a list of contact by ids/keys.\n * @summary Get contacts by batch\n * @param body\n */\n async getContacts(body?: ListOfIds): Promise<Array<Contact>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/contact/byIds` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get an empty content\n */\n async getEmptyContent(): Promise<Content> {\n let _body = null\n\n const _url = this.host + `/contact/service/content/empty` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Content(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get the list of all used codes frequencies in services\n * @param codeType\n * @param minOccurences\n */\n async getServiceCodesOccurences(codeType: string, minOccurences: number): Promise<Array<LabelledOccurence>> {\n let _body = null\n\n const _url =\n this.host +\n `/contact/service/codes/${encodeURIComponent(String(codeType))}/${encodeURIComponent(String(minOccurences))}` +\n '?ts=' +\n new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new LabelledOccurence(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of contacts.\n * @summary List contacts bu opening date parties with(out) pagination\n * @param startKey The contact openingDate\n * @param endKey The contact max openingDate\n * @param hcpartyid hcpartyid\n * @param startDocumentId A contact party document ID\n * @param limit Number of rows\n */\n async listContactsByOpeningDate(\n startDate: number,\n endDate: number,\n hcpartyid: string,\n startKey?: string,\n startDocumentId?: string,\n limit?: number\n ): Promise<PaginatedListContact> {\n let _body = null\n\n const _url =\n this.host +\n `/contact/byOpeningDate` +\n '?ts=' +\n new Date().getTime() +\n (startDate ? '&startDate=' + encodeURIComponent(String(startDate)) : '') +\n (endDate ? '&endDate=' + encodeURIComponent(String(endDate)) : '') +\n (hcpartyid ? '&hcPartyId=' + encodeURIComponent(String(hcpartyid)) : '') +\n (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListContact(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of services\n * @summary List services with provided ids\n * @param body\n */\n async listServices(body?: ListOfIds): Promise<Array<Service>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/contact/service` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Service(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of services\n * @summary List services by related association id\n * @param associationId\n */\n async listServicesByAssociationId(associationId: string): Promise<Array<Service>> {\n let _body = null\n\n const _url =\n this.host +\n `/contact/service/associationId` +\n '?ts=' +\n new Date().getTime() +\n (associationId ? '&associationId=' + encodeURIComponent(String(associationId)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Service(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns the list of services linked to the provided health element id\n * @summary List services linked to a health element\n * @param healthElementId\n * @param hcPartyId hcPartyId\n */\n async listServicesByHealthElementId(healthElementId: string, hcPartyId: string): Promise<Array<Service>> {\n let _body = null\n\n const _url =\n this.host +\n `/contact/service/healthElementId/${encodeURIComponent(String(healthElementId))}` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Service(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of services\n * @summary List services linked to provided ids\n * @param body\n * @param linkType The type of the link\n */\n async listServicesLinkedTo(linkType?: string, body?: ListOfIds): Promise<Array<Service>> {\n let _body = null\n _body = body\n\n const _url =\n this.host + `/contact/service/linkedTo` + '?ts=' + new Date().getTime() + (linkType ? '&linkType=' + encodeURIComponent(String(linkType)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Service(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get ids of contacts matching the provided filter for the current user (HcParty)\n * @param body\n */\n async matchContactsBy(body?: AbstractFilterContact): Promise<Array<string>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/contact/match` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => JSON.parse(JSON.stringify(it))))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get ids of services matching the provided filter for the current user\n * @param body\n */\n async matchServicesBy(body?: AbstractFilterService): Promise<Array<string>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/contact/service/match` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => JSON.parse(JSON.stringify(it))))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns the modified contact.\n * @summary Modify a contact\n * @param body\n */\n async modifyContact(body?: Contact): Promise<Contact> {\n let _body = null\n _body = body\n\n const _url = this.host + `/contact` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Contact(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns the modified contacts.\n * @summary Modify a batch of contacts\n * @param body\n */\n async modifyContacts(body?: Array<Contact>): Promise<Array<Contact>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/contact/batch` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Contact(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary List Contact ids by data owner and a set of secret foreign key. The ids will be sorted by Contact openingDate, in ascending or descending\n * order according to the specified parameter value.\n *\n * @param dataOwnerId the data owner id.\n * @param secretFKeys an array of secret foreign keys.\n * @param startDate a timestamp in epoch milliseconds. If undefined, all the contact ids since the beginning of time will be returned.\n * @param endDate a timestamp in epoch milliseconds. If undefined, all the contact ids until the end of time will be returned.\n * @param descending whether to return the ids ordered in ascending or descending order by Contact openingDate\n * @return a promise that will resolve in an Array of Contact ids.\n */\n async findContactIdsByDataOwnerPatientOpeningDate(\n dataOwnerId: string,\n secretFKeys: string[],\n startDate?: number,\n endDate?: number,\n descending?: boolean\n ): Promise<string[]> {\n const _url =\n this.host +\n `/contact/byDataOwnerPatientOpeningDate?ts=${new Date().getTime()}` +\n '&dataOwnerId=' +\n encodeURIComponent(dataOwnerId) +\n (!!startDate ? `&startDate=${encodeURIComponent(startDate)}` : '') +\n (!!endDate ? `&endDate=${encodeURIComponent(endDate)}` : '') +\n (!!descending ? `&descending=${descending}` : '')\n const headers = (await this.headers).filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n const body = new ListOfIds({ ids: secretFKeys })\n return XHR.sendCommand('POST', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => JSON.parse(JSON.stringify(it))))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @internal this method is for internal use only and may be changed without notice\n */\n async bulkShareContacts(request: BulkShareOrUpdateMetadataParams): Promise<EntityBulkShareResult<Contact>[]> {\n const _url = this.host + '/contact/bulkSharedMetadataUpdate' + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('PUT', _url, headers, request, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((x) => new EntityBulkShareResult<Contact>(x, Contact)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @internal this method is for internal use only and may be changed without notice\n */\n async bulkShareContactsMinimal(request: BulkShareOrUpdateMetadataParams): Promise<MinimalEntityBulkShareResult[]> {\n const _url = this.host + '/contact/bulkSharedMetadataUpdateMinimal' + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('PUT', _url, headers, request, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((x) => new MinimalEntityBulkShareResult(x)))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
@@ -43,7 +43,7 @@ class ConfidentialEntities {
43
43
  if (yield this.getConfidentialSecretId({ entity, type: entityType }))
44
44
  return undefined;
45
45
  const confidentialSecretId = this.primitives.randomUuid();
46
- return (yield this.entitiesEncryption.simpleShareOrUpdateEncryptedEntityMetadata({ entity, type: entityType }, false, {
46
+ return (yield this.entitiesEncryption.simpleShareOrUpdateEncryptedEntityMetadata({ entity, type: entityType }, {
47
47
  [yield this.dataOwnerApi.getCurrentDataOwnerId()]: {
48
48
  shareEncryptionKeys: ShareMetadataBehaviour_1.ShareMetadataBehaviour.NEVER,
49
49
  shareOwningEntityIds: ShareMetadataBehaviour_1.ShareMetadataBehaviour.NEVER,
@@ -1 +1 @@
1
- {"version":3,"file":"ConfidentialEntities.js","sourceRoot":"","sources":["../../../icc-x-api/crypto/ConfidentialEntities.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,qEAAiE;AACjE,wFAAoF;AACpF,IAAO,uBAAuB,GAAG,uCAAkB,CAAC,uBAAuB,CAAA;AAK3E;;;;;;;GAOG;AACH,MAAa,oBAAoB;IAC/B,YACmB,kBAAqC,EACrC,UAA4B,EAC5B,YAA8B;QAF9B,uBAAkB,GAAlB,kBAAkB,CAAmB;QACrC,eAAU,G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AA;YAC1F,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,mCAAmC,CAAC,iBAAiB,CAAC,CAAA;YACzG,MAAM,kBAAkB,GAAG,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CACzG,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CACvC,CAAA;YACD,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,iBAAiB,CAAC,CAAA;YAExF,IAAI,CAAC,gBAAgB;gBAAE,OAAO,EAAE,CAAA;YAChC,OAAO,gBAAgB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,iBAAiB,IAAI,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC9I,CAAC;KAAA;IAED;;;;;;OAMG;IACG,+BAA+B,CAAC,MAA+B;;YACnE,OAAO,CAAC,MAAM,IAAI,CAAC,6BAA6B,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC9D,CAAC;KAAA;IAED;;;;;OAKG;IACG,6BAA6B,CAAC,MAA+B;;YACjE,OAAO,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QACxF,CAAC;KAAA;CACF;AA7FD,oDA6FC","sourcesContent":["import { EncryptedEntity } from '../../icc-api/model/models'\nimport { ExtendedApisUtils } from './ExtendedApisUtils'\nimport { CryptoPrimitives } from './CryptoPrimitives'\nimport { IccDataOwnerXApi } from '../icc-data-owner-x-api'\nimport { EncryptedEntityWithType, EntityWithDelegationTypeName } from '../utils/EntityWithDelegationTypeName'\nimport { ShareMetadataBehaviour } from './ShareMetadataBehaviour'\nimport { EntityShareRequest } from '../../icc-api/model/requests/EntityShareRequest'\nimport RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum\nimport { EntityShareOrMetadataUpdateRequest } from '../../icc-api/model/requests/EntityShareOrMetadataUpdateRequest'\nimport { EntityBulkShareResult } from '../../icc-api/model/requests/EntityBulkShareResult'\nimport { BulkShareOrUpdateMetadataParams } from '../../icc-api/model/requests/BulkShareOrUpdateMetadataParams'\n\n/**\n * @internal this class is intended for internal use only and may be changed without notice.\n * This class helps to create confidential medical data in systems where multiple hcps share data with each other using parent hcps: while normally\n * the hcps would share all data with other hcps part of the same \"family\" (e.g. an hospital) there are situations where the medical data is\n * confidential and should only be known by the doctor which created the data. In these situations it is also important that the secret foreign key\n * used in the confidential data is not known by other members of the hcp family, otherwise they may be able to draw some links between the medical\n * data and the patient.\n */\nexport class ConfidentialEntities {\n constructor(\n private readonly entitiesEncryption: ExtendedApisUtils,\n private readonly primitives: CryptoPrimitives,\n private readonly dataOwnerApi: IccDataOwnerXApi\n ) {}\n\n /**\n * Ensures that the current data owner has access to a confidential secret id for the provided entity: this is an id that is known to the data owner\n * but is not known by any of his parents. If there is currently no confidential secret id for this entity the method returns a copy of the entity\n * with a new confidential secret id for the current data owner (the entity in the database won't be updated), else this method returns undefined.\n * New confidential secret ids will have an appropriate tag, but existing confidential secret ids may not necessarily have it.\n * @param entity an entity which needs to have a confidential secret id for the current data owner\n * @param entityType the type of the entity\n * @param doRequestBulkShareOrUpdate perform the request to share or update an entity encrypted metadata on the cloud API (and save to DB).\n * @return undefined if the entity already had a confidential secret id for the current user, or the updated AND SAVED entity with the new\n * confidential secret id.\n */\n async initialiseConfidentialSecretId<T extends EncryptedEntity>(\n entity: T,\n entityType: EntityWithDelegationTypeName,\n doRequestBulkShareOrUpdate: (request: BulkShareOrUpdateMetadataParams) => Promise<EntityBulkShareResult<T>[]>\n ): Promise<T | undefined> {\n if (await this.getConfidentialSecretId({ entity, type: entityType })) return undefined\n const confidentialSecretId = this.primitives.randomUuid()\n return (\n await this.entitiesEncryption.simpleShareOrUpdateEncryptedEntityMetadata(\n { entity, type: entityType },\n false,\n {\n [await this.dataOwnerApi.getCurrentDataOwnerId()]: {\n shareEncryptionKeys: ShareMetadataBehaviour.NEVER,\n shareOwningEntityIds: ShareMetadataBehaviour.NEVER,\n shareSecretIds: [confidentialSecretId],\n requestedPermissions: RequestedPermissionEnum.MAX_WRITE,\n },\n },\n (request) => doRequestBulkShareOrUpdate(request)\n )\n ).updatedEntityOrThrow\n }\n\n /**\n * Get an existing confidential secret id of the provided entity for the provided data owner (current data owner by default). A confidential secret\n * id is a secret id known by the data owner but not known by any of his parents: note however that children will know confidential secret ids.\n * @param entity an entity for which you want to retrieve the confidential secret id.\n * @param dataOwnerId (current data owner by default) a data owner for which you want to get a confidential secret id.\n * @return the confidential secret id or undefined if there is no confidential secret id for the provided data owner.\n */\n async getConfidentialSecretId(entity: EncryptedEntityWithType, dataOwnerId?: string): Promise<string | undefined> {\n return this.getConfidentialSecretIds(entity, dataOwnerId).then((x) => x[0])\n }\n\n /**\n * Get all existing confidential secret ids of the provided entity for the provided data owner (current data owner by default). A confidential secret\n * id is a secret id known by the data owner but not known by any of his parents: note however that children will know confidential secret ids.\n * @param entity an entity for which you want to retrieve the confidential secret id.\n * @param dataOwnerId (current data owner by default) a data owner for which you want to get a confidential secret id.\n * @return the confidential secret ids for the data owner (may be empty).\n */\n async getConfidentialSecretIds(entity: EncryptedEntityWithType, dataOwnerId?: string): Promise<string[]> {\n // TODO throw exception if any parent key is not available? if we are missing even only one single parent key we can't be sure it is confidential\n const chosenDataOwnerId = dataOwnerId ?? (await this.dataOwnerApi.getCurrentDataOwnerId())\n const dataOwnerHierarchy = await this.dataOwnerApi.getCurrentDataOwnerHierarchyIdsFrom(chosenDataOwnerId)\n const hierarchySecretIds = (await this.entitiesEncryption.secretIdsForHcpHierarchyOf(entity)).filter((x) =>\n dataOwnerHierarchy.includes(x.ownerId)\n )\n const keysForDataOwner = hierarchySecretIds.find((x) => x.ownerId === chosenDataOwnerId)\n\n if (!keysForDataOwner) return []\n return keysForDataOwner.extracted.filter((k) => !hierarchySecretIds.some((x) => x.ownerId !== chosenDataOwnerId && x.extracted.includes(k)))\n }\n\n /**\n * Gets a secret id known by the topmost parent of the current data owner hierarchy. If there is multiple secret ids shared with the topmost parent\n * there is no guarantee on which one will be chosen.\n * @param entity an entity.\n * @return a secret id known by the topmost parent of the current data owner hierarchy, or undefined if there is no secret id currently available\n * for the topmost parent.\n */\n async getAnySecretIdSharedWithParents(entity: EncryptedEntityWithType): Promise<string | undefined> {\n return (await this.getSecretIdsSharedWithParents(entity))[0]\n }\n\n /**\n * Gets all secret ids known by the topmost parent of the current data owner hierarchy (or all secret ids known by the current data owner if he is\n * not part of any data owner hierarchy).\n * @param entity an entity.\n * @return all secret ids known by the topmost parent of the current data owner hierarchy, may be empty.\n */\n async getSecretIdsSharedWithParents(entity: EncryptedEntityWithType): Promise<string[]> {\n return (await this.entitiesEncryption.secretIdsForHcpHierarchyOf(entity))[0].extracted\n }\n}\n"]}
1
+ {"version":3,"file":"ConfidentialEntities.js","sourceRoot":"","sources":["../../../icc-x-api/crypto/ConfidentialEntities.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,qEAAiE;AACjE,wFAAoF;AACpF,IAAO,uBAAuB,GAAG,uCAAkB,CAAC,uBAAuB,CAAA;AAK3E;;;;;;;GAOG;AACH,MAAa,oBAAoB;IAC/B,YACmB,kBAAqC,EACrC,UAA4B,EAC5B,YAA8B;QAF9B,uBAAkB,GAAlB,kBAAkB,CAAmB;QACrC,eAAU,GAAV,UAAU,CAAkB;QAC5B,iBAAY,GAAZ,YAAY,CAAkB;IAC9C,CAAC;IAEJ;;;;;;;;;;OAUG;IACG,8BAA8B,CAClC,MAA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AAC,MAAM,IAAI,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CACzG,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CACvC,CAAA;YACD,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,iBAAiB,CAAC,CAAA;YAExF,IAAI,CAAC,gBAAgB;gBAAE,OAAO,EAAE,CAAA;YAChC,OAAO,gBAAgB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,iBAAiB,IAAI,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC9I,CAAC;KAAA;IAED;;;;;;OAMG;IACG,+BAA+B,CAAC,MAA+B;;YACnE,OAAO,CAAC,MAAM,IAAI,CAAC,6BAA6B,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC9D,CAAC;KAAA;IAED;;;;;OAKG;IACG,6BAA6B,CAAC,MAA+B;;YACjE,OAAO,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QACxF,CAAC;KAAA;CACF;AA5FD,oDA4FC","sourcesContent":["import { EncryptedEntity } from '../../icc-api/model/models'\nimport { ExtendedApisUtils } from './ExtendedApisUtils'\nimport { CryptoPrimitives } from './CryptoPrimitives'\nimport { IccDataOwnerXApi } from '../icc-data-owner-x-api'\nimport { EncryptedEntityWithType, EntityWithDelegationTypeName } from '../utils/EntityWithDelegationTypeName'\nimport { ShareMetadataBehaviour } from './ShareMetadataBehaviour'\nimport { EntityShareRequest } from '../../icc-api/model/requests/EntityShareRequest'\nimport RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum\nimport { EntityShareOrMetadataUpdateRequest } from '../../icc-api/model/requests/EntityShareOrMetadataUpdateRequest'\nimport { EntityBulkShareResult } from '../../icc-api/model/requests/EntityBulkShareResult'\nimport { BulkShareOrUpdateMetadataParams } from '../../icc-api/model/requests/BulkShareOrUpdateMetadataParams'\n\n/**\n * @internal this class is intended for internal use only and may be changed without notice.\n * This class helps to create confidential medical data in systems where multiple hcps share data with each other using parent hcps: while normally\n * the hcps would share all data with other hcps part of the same \"family\" (e.g. an hospital) there are situations where the medical data is\n * confidential and should only be known by the doctor which created the data. In these situations it is also important that the secret foreign key\n * used in the confidential data is not known by other members of the hcp family, otherwise they may be able to draw some links between the medical\n * data and the patient.\n */\nexport class ConfidentialEntities {\n constructor(\n private readonly entitiesEncryption: ExtendedApisUtils,\n private readonly primitives: CryptoPrimitives,\n private readonly dataOwnerApi: IccDataOwnerXApi\n ) {}\n\n /**\n * Ensures that the current data owner has access to a confidential secret id for the provided entity: this is an id that is known to the data owner\n * but is not known by any of his parents. If there is currently no confidential secret id for this entity the method returns a copy of the entity\n * with a new confidential secret id for the current data owner (the entity in the database won't be updated), else this method returns undefined.\n * New confidential secret ids will have an appropriate tag, but existing confidential secret ids may not necessarily have it.\n * @param entity an entity which needs to have a confidential secret id for the current data owner\n * @param entityType the type of the entity\n * @param doRequestBulkShareOrUpdate perform the request to share or update an entity encrypted metadata on the cloud API (and save to DB).\n * @return undefined if the entity already had a confidential secret id for the current user, or the updated AND SAVED entity with the new\n * confidential secret id.\n */\n async initialiseConfidentialSecretId<T extends EncryptedEntity>(\n entity: T,\n entityType: EntityWithDelegationTypeName,\n doRequestBulkShareOrUpdate: (request: BulkShareOrUpdateMetadataParams) => Promise<EntityBulkShareResult<T>[]>\n ): Promise<T | undefined> {\n if (await this.getConfidentialSecretId({ entity, type: entityType })) return undefined\n const confidentialSecretId = this.primitives.randomUuid()\n return (\n await this.entitiesEncryption.simpleShareOrUpdateEncryptedEntityMetadata(\n { entity, type: entityType },\n {\n [await this.dataOwnerApi.getCurrentDataOwnerId()]: {\n shareEncryptionKeys: ShareMetadataBehaviour.NEVER,\n shareOwningEntityIds: ShareMetadataBehaviour.NEVER,\n shareSecretIds: [confidentialSecretId],\n requestedPermissions: RequestedPermissionEnum.MAX_WRITE,\n },\n },\n (request) => doRequestBulkShareOrUpdate(request)\n )\n ).updatedEntityOrThrow\n }\n\n /**\n * Get an existing confidential secret id of the provided entity for the provided data owner (current data owner by default). A confidential secret\n * id is a secret id known by the data owner but not known by any of his parents: note however that children will know confidential secret ids.\n * @param entity an entity for which you want to retrieve the confidential secret id.\n * @param dataOwnerId (current data owner by default) a data owner for which you want to get a confidential secret id.\n * @return the confidential secret id or undefined if there is no confidential secret id for the provided data owner.\n */\n async getConfidentialSecretId(entity: EncryptedEntityWithType, dataOwnerId?: string): Promise<string | undefined> {\n return this.getConfidentialSecretIds(entity, dataOwnerId).then((x) => x[0])\n }\n\n /**\n * Get all existing confidential secret ids of the provided entity for the provided data owner (current data owner by default). A confidential secret\n * id is a secret id known by the data owner but not known by any of his parents: note however that children will know confidential secret ids.\n * @param entity an entity for which you want to retrieve the confidential secret id.\n * @param dataOwnerId (current data owner by default) a data owner for which you want to get a confidential secret id.\n * @return the confidential secret ids for the data owner (may be empty).\n */\n async getConfidentialSecretIds(entity: EncryptedEntityWithType, dataOwnerId?: string): Promise<string[]> {\n // TODO throw exception if any parent key is not available? if we are missing even only one single parent key we can't be sure it is confidential\n const chosenDataOwnerId = dataOwnerId ?? (await this.dataOwnerApi.getCurrentDataOwnerId())\n const dataOwnerHierarchy = await this.dataOwnerApi.getCurrentDataOwnerHierarchyIdsFrom(chosenDataOwnerId)\n const hierarchySecretIds = (await this.entitiesEncryption.secretIdsForHcpHierarchyOf(entity)).filter((x) =>\n dataOwnerHierarchy.includes(x.ownerId)\n )\n const keysForDataOwner = hierarchySecretIds.find((x) => x.ownerId === chosenDataOwnerId)\n\n if (!keysForDataOwner) return []\n return keysForDataOwner.extracted.filter((k) => !hierarchySecretIds.some((x) => x.ownerId !== chosenDataOwnerId && x.extracted.includes(k)))\n }\n\n /**\n * Gets a secret id known by the topmost parent of the current data owner hierarchy. If there is multiple secret ids shared with the topmost parent\n * there is no guarantee on which one will be chosen.\n * @param entity an entity.\n * @return a secret id known by the topmost parent of the current data owner hierarchy, or undefined if there is no secret id currently available\n * for the topmost parent.\n */\n async getAnySecretIdSharedWithParents(entity: EncryptedEntityWithType): Promise<string | undefined> {\n return (await this.getSecretIdsSharedWithParents(entity))[0]\n }\n\n /**\n * Gets all secret ids known by the topmost parent of the current data owner hierarchy (or all secret ids known by the current data owner if he is\n * not part of any data owner hierarchy).\n * @param entity an entity.\n * @return all secret ids known by the topmost parent of the current data owner hierarchy, may be empty.\n */\n async getSecretIdsSharedWithParents(entity: EncryptedEntityWithType): Promise<string[]> {\n return (await this.entitiesEncryption.secretIdsForHcpHierarchyOf(entity))[0].extracted\n }\n}\n"]}
@@ -196,7 +196,10 @@ class DelegationsDeAnonymization {
196
196
  const dataOwnersNeedingShare = delegates.filter((x) => !dataOwnersWithAccessToMap.has(x));
197
197
  if (dataOwnersNeedingShare.length) {
198
198
  ;
199
- (yield this.xapis.simpleShareOrUpdateEncryptedEntityMetadata({ entity: keyMap, type: entityType }, false, Object.fromEntries(dataOwnersNeedingShare.map((x) => [
199
+ (yield this.xapis.simpleShareOrUpdateEncryptedEntityMetadata({
200
+ entity: keyMap,
201
+ type: entityType,
202
+ }, Object.fromEntries(dataOwnersNeedingShare.map((x) => [
200
203
  x,
201
204
  {
202
205
  shareSecretIds: [],
@@ -225,7 +228,7 @@ class DelegationsDeAnonymization {
225
228
  delegate: delegationMembersDetails.delegate,
226
229
  delegator: delegationMembersDetails.delegator,
227
230
  delegationKey: delegationKey,
228
- }, entityType, undefined, undefined, true, false, Object.fromEntries(initialDelegates.map((x) => [x, AccessLevelEnum.READ])));
231
+ }, entityType, undefined, undefined, true, Object.fromEntries(initialDelegates.map((x) => [x, AccessLevelEnum.READ])));
229
232
  const encryptedKeyMap = yield this.xapis.tryEncryptEntity(initalisedMapInfo.updatedEntity, entityType, this.delegationKeyMapFieldsToEncrypt, false, true, (x) => new SecureDelegationKeyMap_1.SecureDelegationKeyMap(x));
230
233
  yield this.delegationKeyMapApi.create(encryptedKeyMap, new XHR_1.XHR.Header(AccessControlKeysHeadersProvider_1.ACCESS_CONTROL_KEYS_HEADER, yield this.accessControlSecretUtils.getEncodedAccessControlKeys([delegationMembersDetails.accessControlSecret], entityType)));
231
234
  });
@@ -1 +1 @@
1
- {"version":3,"file":"DelegationsDeAnonymization.js","sourceRoot":"","sources":["../../../icc-x-api/crypto/DelegationsDeAnonymization.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2EAAuE;AACvE,IAAO,eAAe,GAAG,mCAAgB,CAAC,eAAe,CAAA;AAEzD,gGAA4F;AAE5F,qEAAiE;AACjE,wFAAoF;AACpF,IAAO,uBAAuB,GAAG,uCAAkB,CAAC,uBAAuB,CAAA;AAE3E,oCAAwE;AACxE,0GAAsG;AACtG,+CAA2C;AAC3C,2EAAiG;AACjG,yFAAiH;AAIjH,6CAA6C;AAC7C,MAAa,0BAA0B;IAIrC,YACmB,YAA8B,EAC9B,kCAA8E,EAC9E,KAAwB,EACxB,gBAAkC,EAClC,wBAAkD,EACnE,IAAY,EACZ,OAAkC,EAClC,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,EACQ,gCAAkE;QAblE,iBAAY,GAAZ,YAAY,CAAkB;QAC9B,uCAAkC,GAAlC,kCAAkC,CAA4C;QAC9E,UAAK,GAAL,KAAK,CAAmB;Q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AAC,sCAAsC,CAC/E;gBACE,EAAE,EAAE,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE;gBACtC,QAAQ,EAAE,wBAAwB,CAAC,QAAQ;gBAC3C,SAAS,EAAE,wBAAwB,CAAC,SAAS;gBAC7C,aAAa,EAAE,aAAa;aAC7B,EACD,UAAU,EACV,SAAS,EACT,SAAS,EACT,IAAI,EACJ,KAAK,EACL,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAC3E,CAAA;YACD,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,gBAAgB,CACvD,iBAAiB,CAAC,aAAa,EAC/B,UAAU,EACV,IAAI,CAAC,+BAA+B,EACpC,KAAK,EACL,IAAI,EACJ,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,+CAAsB,CAAC,CAAC,CAAC,CACrC,CAAA;YACD,MAAM,IAAI,CAAC,mBAAmB,CAAC,MAAM,CACnC,eAAe,EACf,IAAI,SAAG,CAAC,MAAM,CACZ,6DAA0B,EAC1B,MAAM,IAAI,CAAC,wBAAwB,CAAC,2BAA2B,CAAC,CAAC,wBAAwB,CAAC,mBAAmB,CAAC,EAAE,UAAU,CAAC,CAC5H,CACF,CAAA;QACH,CAAC;KAAA;CACF;AA3QD,gEA2QC","sourcesContent":["import { EncryptedEntityWithType, EntityWithDelegationTypeName } from '../utils/EntityWithDelegationTypeName'\nimport { SecureDelegation } from '../../icc-api/model/SecureDelegation'\nimport AccessLevelEnum = SecureDelegation.AccessLevelEnum\nimport { DelegationMembersDetails, SecureDelegationsSecurityMetadataDecryptor } from './SecureDelegationsSecurityMetadataDecryptor'\nimport { SecureDelegationKeyMap } from '../../icc-api/model/internal/SecureDelegationKeyMap'\nimport { ExtendedApisUtils } from './ExtendedApisUtils'\nimport { ShareMetadataBehaviour } from './ShareMetadataBehaviour'\nimport { EntityShareRequest } from '../../icc-api/model/requests/EntityShareRequest'\nimport RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum\nimport { CryptoPrimitives } from './CryptoPrimitives'\nimport { EncryptedFieldsManifest, parseEncryptedFields } from '../utils'\nimport { IccSecureDelegationKeyMapApi } from '../../icc-api/api/internal/IccSecureDelegationKeyMapApi'\nimport { XHR } from '../../icc-api/api/XHR'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../auth/AuthenticationProvider'\nimport { ACCESS_CONTROL_KEYS_HEADER, AccessControlKeysHeadersProvider } from './AccessControlKeysHeadersProvider'\nimport { AccessControlSecretUtils } from './AccessControlSecretUtils'\nimport { IccDataOwnerXApi } from '../icc-data-owner-x-api'\n\n// TODO could be optimised using bulk methods\nexport class DelegationsDeAnonymization {\n private readonly delegationKeyMapFieldsToEncrypt: EncryptedFieldsManifest\n private readonly delegationKeyMapApi: IccSecureDelegationKeyMapApi\n\n constructor(\n private readonly dataOwnerApi: IccDataOwnerXApi,\n private readonly secureDelegationsMetadataDecryptor: SecureDelegationsSecurityMetadataDecryptor,\n private readonly xapis: ExtendedApisUtils,\n private readonly cryptoPrimitives: CryptoPrimitives,\n private readonly accessControlSecretUtils: AccessControlSecretUtils,\n host: string,\n headers: { [key: string]: 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 private readonly accessControlKeysHeadersProvider: AccessControlKeysHeadersProvider\n ) {\n this.delegationKeyMapFieldsToEncrypt = parseEncryptedFields(['delegate', 'delegator'], 'SecureDelegationKeyMap')\n this.delegationKeyMapApi = new IccSecureDelegationKeyMapApi(host, headers, authenticationProvider, fetchImpl)\n }\n\n /**\n * Creates / updates information to allow the data owners in {@link shareWithDataOwners} to de-anonymize the delegations contained within\n * {@link entity}.\n * Note that the delegation de-anonymization information may be used also with other entities of the same type.\n */\n async createOrUpdateDeAnonymizationInfo(entityWithType: EncryptedEntityWithType, shareWithDataOwners: string[]) {\n const delegationsDetails = Object.entries(await this.secureDelegationsMetadataDecryptor.getDelegationMemberDetails(entityWithType)).flatMap(\n ([canonicalKey, delegation]) => {\n const aliases = Object.entries(entityWithType.entity.securityMetadata?.keysEquivalences ?? {}).flatMap(([alias, canon]) => {\n if (canon == canonicalKey) {\n return [alias]\n } else {\n return []\n }\n })\n return [[canonicalKey, delegation], ...aliases.map((alias) => [alias, delegation])] as [string, DelegationMembersDetails][]\n }\n )\n const delegationsForDeanonInfoSharing = delegationsDetails.filter(([_, delegationInfo]) => {\n // Drop fully explicit ones: they don't need de-anonymization info\n return !delegationInfo.fullyExplicit\n })\n // A subset of delegations for which deanon info is relevant AND for which we can also create new info instead of sharing only existing one.\n const delegationsForNewDeanonInfoCreation = delegationsForDeanonInfoSharing.filter(([_, delegationInfo]) => {\n // Drop those for which we don't have the full information needed for the creation of new data.\n return !!delegationInfo.delegate && !!delegationInfo.delegator && !!delegationInfo.accessControlSecret\n })\n const existingDelegationsMap = await this.getDecryptedSecureDelegationKeyMaps(\n delegationsForDeanonInfoSharing.map((x) => x[0]),\n entityWithType.type\n )\n for (const delMapToShare of existingDelegationsMap) {\n await this.ensureDelegationKeyMapSharedWith(entityWithType.type, delMapToShare, shareWithDataOwners)\n }\n const existingDelegationsMapKeys = new Set(existingDelegationsMap.map((x) => x.delegationKey))\n const delegationsToCreate = delegationsForNewDeanonInfoCreation.filter(([k, _]) => !existingDelegationsMapKeys.has(k))\n for (const [delKey, membersDetails] of delegationsToCreate) {\n await this.createSecureDelegationKeyMap(entityWithType.type, delKey, membersDetails, shareWithDataOwners)\n }\n }\n\n /**\n * Get the data owners which can access the entity. See {@link EncryptedEntityXApi.getDataOwnersWithAccessTo} for more details.\n * @param entityWithType an entity.\n */\n async getDataOwnersWithAccessTo(entityWithType: EncryptedEntityWithType): Promise<{\n permissionsByDataOwnerId: { [dataOwnerId: string]: AccessLevelEnum }\n hasUnknownAnonymousDataOwners: boolean\n }> {\n return this.mergePermissions([\n await this.getDataOwnersWithAccessToSecureDelegations(entityWithType),\n {\n permissionsByDataOwnerId: Object.fromEntries(Object.keys(entityWithType.entity.delegations ?? {}).map((k) => [k, AccessLevelEnum.WRITE])),\n hasUnknownAnonymousDataOwners: false,\n },\n ])\n }\n\n private async getDataOwnersWithAccessToSecureDelegations(entityWithType: EncryptedEntityWithType): Promise<{\n permissionsByDataOwnerId: { [dataOwnerId: string]: AccessLevelEnum }\n hasUnknownAnonymousDataOwners: boolean\n }> {\n const secureDelegationDetails = await this.secureDelegationsMetadataDecryptor.getDelegationMemberDetails(entityWithType)\n const secureDelegationWithUnknownMembers = Object.entries(secureDelegationDetails).flatMap(([canonicalKey, delegation]) => {\n if (!delegation.delegate || !delegation.delegator) {\n const aliases = Object.entries(entityWithType.entity.securityMetadata?.keysEquivalences ?? {}).flatMap(([alias, canon]) => {\n if (canon == canonicalKey) {\n return [alias]\n } else {\n return []\n }\n })\n return [{ keys: [canonicalKey, ...aliases], delegation }]\n } else {\n return []\n }\n })\n const secureDelegationKeyMapsByDelegationKey = Object.fromEntries(\n (\n await this.getDecryptedSecureDelegationKeyMaps(\n secureDelegationWithUnknownMembers.flatMap(({ keys }) => keys),\n entityWithType.type\n )\n ).map((x) => [x.delegationKey, x])\n )\n const permissionsByDataOwnerId: { [dataOwnerId: string]: AccessLevelEnum } = {}\n let hasUnknownAnonymousDataOwners = false\n function addAccess(dataOwnerId: string, level: AccessLevelEnum) {\n if (permissionsByDataOwnerId[dataOwnerId] !== AccessLevelEnum.WRITE) {\n permissionsByDataOwnerId[dataOwnerId] = level\n }\n }\n for (const delegation of Object.values(secureDelegationDetails)) {\n if (delegation.delegate) addAccess(delegation.delegate, delegation.accessLevel)\n if (delegation.delegator) addAccess(delegation.delegator, delegation.accessLevel)\n }\n for (const { keys, delegation } of secureDelegationWithUnknownMembers) {\n const bestKey = keys.find((k) => {\n const currMap = secureDelegationKeyMapsByDelegationKey[k]\n return currMap && !!currMap.delegator && !!currMap.delegate\n })\n if (bestKey) {\n const keyMap = secureDelegationKeyMapsByDelegationKey[bestKey]\n addAccess(keyMap.delegate!, delegation.accessLevel)\n addAccess(keyMap.delegator!, delegation.accessLevel)\n } else {\n hasUnknownAnonymousDataOwners = true\n }\n }\n return { permissionsByDataOwnerId, hasUnknownAnonymousDataOwners }\n }\n\n private async mergePermissions(\n values: {\n permissionsByDataOwnerId: { [dataOwnerId: string]: AccessLevelEnum }\n hasUnknownAnonymousDataOwners: boolean\n }[]\n ): Promise<{\n permissionsByDataOwnerId: { [dataOwnerId: string]: AccessLevelEnum }\n hasUnknownAnonymousDataOwners: boolean\n }> {\n const accumulatedPermissions: { [dataOwnerId: string]: AccessLevelEnum } = {}\n let hasUnknownAnonymousDataOwners = false\n for (const v of values) {\n hasUnknownAnonymousDataOwners = hasUnknownAnonymousDataOwners || v.hasUnknownAnonymousDataOwners\n for (const [dataOwnerId, level] of Object.entries(v.permissionsByDataOwnerId)) {\n if (accumulatedPermissions[dataOwnerId] !== AccessLevelEnum.WRITE) {\n accumulatedPermissions[dataOwnerId] = level\n }\n }\n }\n return {\n permissionsByDataOwnerId: accumulatedPermissions,\n hasUnknownAnonymousDataOwners,\n }\n }\n\n private async getDecryptedSecureDelegationKeyMaps(\n delegationIds: string[],\n entityType: EntityWithDelegationTypeName\n ): Promise<SecureDelegationKeyMap[]> {\n if (delegationIds.length) {\n const encryptedMaps = await this.delegationKeyMapApi.getByDelegationKeys(\n { ids: delegationIds },\n await this.accessControlKeysHeadersProvider.getAccessControlKeysHeaders(entityType)\n )\n const res: SecureDelegationKeyMap[] = []\n for (const encryptedMap of encryptedMaps) {\n // Use the original entity type\n const decryptionResult = await this.xapis.decryptEntity(encryptedMap, entityType, (x) => new SecureDelegationKeyMap(x))\n if (decryptionResult.decrypted) {\n res.push(decryptionResult.entity)\n }\n }\n return res\n } else return []\n }\n\n // Important: to avoid potentially leaking links between entities of different types the key map calculates the secure delegation keys using the\n // same entity type as the delegation key for which they are mapping information.\n private async ensureDelegationKeyMapSharedWith(entityType: EntityWithDelegationTypeName, keyMap: SecureDelegationKeyMap, delegates: string[]) {\n if (!keyMap.delegator || !keyMap.delegate) throw new Error('Illegal state: key map is missing delegator or delegate info.')\n const dataOwnersWithAccessToMapThroughDelegation = Object.values(\n await this.secureDelegationsMetadataDecryptor.getDelegationMemberDetails({\n type: entityType,\n entity: keyMap,\n })\n )\n .flatMap((x) => [x.delegate, x.delegator])\n .filter((x) => !!x) as string[]\n // Delegator and delegate got access to the entity when it was first created: no need to share with them ever.\n const dataOwnersWithAccessToMap = new Set([keyMap.delegate, keyMap.delegator, ...dataOwnersWithAccessToMapThroughDelegation])\n const dataOwnersNeedingShare = delegates.filter((x) => !dataOwnersWithAccessToMap.has(x))\n if (dataOwnersNeedingShare.length) {\n ;(\n await this.xapis.simpleShareOrUpdateEncryptedEntityMetadata(\n { entity: keyMap, type: entityType },\n false,\n Object.fromEntries(\n dataOwnersNeedingShare.map((x) => [\n x,\n {\n shareSecretIds: [],\n shareEncryptionKeys: ShareMetadataBehaviour.REQUIRED,\n shareOwningEntityIds: ShareMetadataBehaviour.NEVER,\n requestedPermissions: RequestedPermissionEnum.FULL_READ,\n },\n ])\n ),\n async (request) =>\n this.delegationKeyMapApi.bulkShareSecureDelegationKeyMap(\n request,\n await this.accessControlKeysHeadersProvider.getAccessControlKeysHeaders(entityType)\n )\n )\n ).updatedEntityOrThrow\n }\n }\n\n // Important: to avoid potentially leaking links between entities of different types the key map calculates the secure delegation keys using the\n // same entity type as the delegation key for which they are mapping information.\n private async createSecureDelegationKeyMap(\n entityType: EntityWithDelegationTypeName,\n delegationKey: string,\n delegationMembersDetails: DelegationMembersDetails,\n delegates: string[]\n ) {\n if (!delegationMembersDetails.delegate || !delegationMembersDetails.delegator || !delegationMembersDetails.accessControlSecret)\n throw new Error('Illegal state: delegation members details are missing delegate, delegator or access control secret info.')\n const selfDoId = await this.dataOwnerApi.getCurrentDataOwnerId()\n // Ensure that both the delegator and delegate of the delegation this map refers tho can share it later on, even if they did not create it.\n // Usually either the delegator or delegate are the current data owner, but sometimes also the child of the delegator or delegate can do it.\n const initialDelegates = [delegationMembersDetails.delegate, delegationMembersDetails.delegator, ...delegates].filter((x) => x != selfDoId)\n const initalisedMapInfo = await this.xapis.entityWithInitialisedEncryptedMetadata<SecureDelegationKeyMap>(\n {\n id: this.cryptoPrimitives.randomUuid(),\n delegate: delegationMembersDetails.delegate,\n delegator: delegationMembersDetails.delegator,\n delegationKey: delegationKey,\n },\n entityType,\n undefined,\n undefined,\n true,\n false,\n Object.fromEntries(initialDelegates.map((x) => [x, AccessLevelEnum.READ]))\n )\n const encryptedKeyMap = await this.xapis.tryEncryptEntity(\n initalisedMapInfo.updatedEntity,\n entityType,\n this.delegationKeyMapFieldsToEncrypt,\n false,\n true,\n (x) => new SecureDelegationKeyMap(x)\n )\n await this.delegationKeyMapApi.create(\n encryptedKeyMap,\n new XHR.Header(\n ACCESS_CONTROL_KEYS_HEADER,\n await this.accessControlSecretUtils.getEncodedAccessControlKeys([delegationMembersDetails.accessControlSecret], entityType)\n )\n )\n }\n}\n"]}
1
+ {"version":3,"file":"DelegationsDeAnonymization.js","sourceRoot":"","sources":["../../../icc-x-api/crypto/DelegationsDeAnonymization.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2EAAuE;AACvE,IAAO,eAAe,GAAG,mCAAgB,CAAC,eAAe,CAAA;AAEzD,gGAA4F;AAE5F,qEAAiE;AACjE,wFAAoF;AACpF,IAAO,uBAAuB,GAAG,uCAAkB,CAAC,uBAAuB,CAAA;AAE3E,oCAAwE;AACxE,0GAAsG;AACtG,+CAA2C;AAC3C,2EAAiG;AACjG,yFAAiH;AAIjH,6CAA6C;AAC7C,MAAa,0BAA0B;IAIrC,YACmB,YAA8B,EAC9B,kCAA8E,EAC9E,KAAwB,EACxB,gBAAkC,EAClC,wBAAkD,EACnE,IAAY,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ptedEntityWithType, EntityWithDelegationTypeName } from '../utils/EntityWithDelegationTypeName'\nimport { SecureDelegation } from '../../icc-api/model/SecureDelegation'\nimport AccessLevelEnum = SecureDelegation.AccessLevelEnum\nimport { DelegationMembersDetails, SecureDelegationsSecurityMetadataDecryptor } from './SecureDelegationsSecurityMetadataDecryptor'\nimport { SecureDelegationKeyMap } from '../../icc-api/model/internal/SecureDelegationKeyMap'\nimport { ExtendedApisUtils } from './ExtendedApisUtils'\nimport { ShareMetadataBehaviour } from './ShareMetadataBehaviour'\nimport { EntityShareRequest } from '../../icc-api/model/requests/EntityShareRequest'\nimport RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum\nimport { CryptoPrimitives } from './CryptoPrimitives'\nimport { EncryptedFieldsManifest, parseEncryptedFields } from '../utils'\nimport { IccSecureDelegationKeyMapApi } from '../../icc-api/api/internal/IccSecureDelegationKeyMapApi'\nimport { XHR } from '../../icc-api/api/XHR'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../auth/AuthenticationProvider'\nimport { ACCESS_CONTROL_KEYS_HEADER, AccessControlKeysHeadersProvider } from './AccessControlKeysHeadersProvider'\nimport { AccessControlSecretUtils } from './AccessControlSecretUtils'\nimport { IccDataOwnerXApi } from '../icc-data-owner-x-api'\n\n// TODO could be optimised using bulk methods\nexport class DelegationsDeAnonymization {\n private readonly delegationKeyMapFieldsToEncrypt: EncryptedFieldsManifest\n private readonly delegationKeyMapApi: IccSecureDelegationKeyMapApi\n\n constructor(\n private readonly dataOwnerApi: IccDataOwnerXApi,\n private readonly secureDelegationsMetadataDecryptor: SecureDelegationsSecurityMetadataDecryptor,\n private readonly xapis: ExtendedApisUtils,\n private readonly cryptoPrimitives: CryptoPrimitives,\n private readonly accessControlSecretUtils: AccessControlSecretUtils,\n host: string,\n headers: { [key: string]: 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 private readonly accessControlKeysHeadersProvider: AccessControlKeysHeadersProvider\n ) {\n this.delegationKeyMapFieldsToEncrypt = parseEncryptedFields(['delegate', 'delegator'], 'SecureDelegationKeyMap')\n this.delegationKeyMapApi = new IccSecureDelegationKeyMapApi(host, headers, authenticationProvider, fetchImpl)\n }\n\n /**\n * Creates / updates information to allow the data owners in {@link shareWithDataOwners} to de-anonymize the delegations contained within\n * {@link entity}.\n * Note that the delegation de-anonymization information may be used also with other entities of the same type.\n */\n async createOrUpdateDeAnonymizationInfo(entityWithType: EncryptedEntityWithType, shareWithDataOwners: string[]) {\n const delegationsDetails = Object.entries(await this.secureDelegationsMetadataDecryptor.getDelegationMemberDetails(entityWithType)).flatMap(\n ([canonicalKey, delegation]) => {\n const aliases = Object.entries(entityWithType.entity.securityMetadata?.keysEquivalences ?? {}).flatMap(([alias, canon]) => {\n if (canon == canonicalKey) {\n return [alias]\n } else {\n return []\n }\n })\n return [[canonicalKey, delegation], ...aliases.map((alias) => [alias, delegation])] as [string, DelegationMembersDetails][]\n }\n )\n const delegationsForDeanonInfoSharing = delegationsDetails.filter(([_, delegationInfo]) => {\n // Drop fully explicit ones: they don't need de-anonymization info\n return !delegationInfo.fullyExplicit\n })\n // A subset of delegations for which deanon info is relevant AND for which we can also create new info instead of sharing only existing one.\n const delegationsForNewDeanonInfoCreation = delegationsForDeanonInfoSharing.filter(([_, delegationInfo]) => {\n // Drop those for which we don't have the full information needed for the creation of new data.\n return !!delegationInfo.delegate && !!delegationInfo.delegator && !!delegationInfo.accessControlSecret\n })\n const existingDelegationsMap = await this.getDecryptedSecureDelegationKeyMaps(\n delegationsForDeanonInfoSharing.map((x) => x[0]),\n entityWithType.type\n )\n for (const delMapToShare of existingDelegationsMap) {\n await this.ensureDelegationKeyMapSharedWith(entityWithType.type, delMapToShare, shareWithDataOwners)\n }\n const existingDelegationsMapKeys = new Set(existingDelegationsMap.map((x) => x.delegationKey))\n const delegationsToCreate = delegationsForNewDeanonInfoCreation.filter(([k, _]) => !existingDelegationsMapKeys.has(k))\n for (const [delKey, membersDetails] of delegationsToCreate) {\n await this.createSecureDelegationKeyMap(entityWithType.type, delKey, membersDetails, shareWithDataOwners)\n }\n }\n\n /**\n * Get the data owners which can access the entity. See {@link EncryptedEntityXApi.getDataOwnersWithAccessTo} for more details.\n * @param entityWithType an entity.\n */\n async getDataOwnersWithAccessTo(entityWithType: EncryptedEntityWithType): Promise<{\n permissionsByDataOwnerId: { [dataOwnerId: string]: AccessLevelEnum }\n hasUnknownAnonymousDataOwners: boolean\n }> {\n return this.mergePermissions([\n await this.getDataOwnersWithAccessToSecureDelegations(entityWithType),\n {\n permissionsByDataOwnerId: Object.fromEntries(Object.keys(entityWithType.entity.delegations ?? {}).map((k) => [k, AccessLevelEnum.WRITE])),\n hasUnknownAnonymousDataOwners: false,\n },\n ])\n }\n\n private async getDataOwnersWithAccessToSecureDelegations(entityWithType: EncryptedEntityWithType): Promise<{\n permissionsByDataOwnerId: { [dataOwnerId: string]: AccessLevelEnum }\n hasUnknownAnonymousDataOwners: boolean\n }> {\n const secureDelegationDetails = await this.secureDelegationsMetadataDecryptor.getDelegationMemberDetails(entityWithType)\n const secureDelegationWithUnknownMembers = Object.entries(secureDelegationDetails).flatMap(([canonicalKey, delegation]) => {\n if (!delegation.delegate || !delegation.delegator) {\n const aliases = Object.entries(entityWithType.entity.securityMetadata?.keysEquivalences ?? {}).flatMap(([alias, canon]) => {\n if (canon == canonicalKey) {\n return [alias]\n } else {\n return []\n }\n })\n return [{ keys: [canonicalKey, ...aliases], delegation }]\n } else {\n return []\n }\n })\n const secureDelegationKeyMapsByDelegationKey = Object.fromEntries(\n (\n await this.getDecryptedSecureDelegationKeyMaps(\n secureDelegationWithUnknownMembers.flatMap(({ keys }) => keys),\n entityWithType.type\n )\n ).map((x) => [x.delegationKey, x])\n )\n const permissionsByDataOwnerId: { [dataOwnerId: string]: AccessLevelEnum } = {}\n let hasUnknownAnonymousDataOwners = false\n function addAccess(dataOwnerId: string, level: AccessLevelEnum) {\n if (permissionsByDataOwnerId[dataOwnerId] !== AccessLevelEnum.WRITE) {\n permissionsByDataOwnerId[dataOwnerId] = level\n }\n }\n for (const delegation of Object.values(secureDelegationDetails)) {\n if (delegation.delegate) addAccess(delegation.delegate, delegation.accessLevel)\n if (delegation.delegator) addAccess(delegation.delegator, delegation.accessLevel)\n }\n for (const { keys, delegation } of secureDelegationWithUnknownMembers) {\n const bestKey = keys.find((k) => {\n const currMap = secureDelegationKeyMapsByDelegationKey[k]\n return currMap && !!currMap.delegator && !!currMap.delegate\n })\n if (bestKey) {\n const keyMap = secureDelegationKeyMapsByDelegationKey[bestKey]\n addAccess(keyMap.delegate!, delegation.accessLevel)\n addAccess(keyMap.delegator!, delegation.accessLevel)\n } else {\n hasUnknownAnonymousDataOwners = true\n }\n }\n return { permissionsByDataOwnerId, hasUnknownAnonymousDataOwners }\n }\n\n private async mergePermissions(\n values: {\n permissionsByDataOwnerId: { [dataOwnerId: string]: AccessLevelEnum }\n hasUnknownAnonymousDataOwners: boolean\n }[]\n ): Promise<{\n permissionsByDataOwnerId: { [dataOwnerId: string]: AccessLevelEnum }\n hasUnknownAnonymousDataOwners: boolean\n }> {\n const accumulatedPermissions: { [dataOwnerId: string]: AccessLevelEnum } = {}\n let hasUnknownAnonymousDataOwners = false\n for (const v of values) {\n hasUnknownAnonymousDataOwners = hasUnknownAnonymousDataOwners || v.hasUnknownAnonymousDataOwners\n for (const [dataOwnerId, level] of Object.entries(v.permissionsByDataOwnerId)) {\n if (accumulatedPermissions[dataOwnerId] !== AccessLevelEnum.WRITE) {\n accumulatedPermissions[dataOwnerId] = level\n }\n }\n }\n return {\n permissionsByDataOwnerId: accumulatedPermissions,\n hasUnknownAnonymousDataOwners,\n }\n }\n\n private async getDecryptedSecureDelegationKeyMaps(\n delegationIds: string[],\n entityType: EntityWithDelegationTypeName\n ): Promise<SecureDelegationKeyMap[]> {\n if (delegationIds.length) {\n const encryptedMaps = await this.delegationKeyMapApi.getByDelegationKeys(\n { ids: delegationIds },\n await this.accessControlKeysHeadersProvider.getAccessControlKeysHeaders(entityType)\n )\n const res: SecureDelegationKeyMap[] = []\n for (const encryptedMap of encryptedMaps) {\n // Use the original entity type\n const decryptionResult = await this.xapis.decryptEntity(encryptedMap, entityType, (x) => new SecureDelegationKeyMap(x))\n if (decryptionResult.decrypted) {\n res.push(decryptionResult.entity)\n }\n }\n return res\n } else return []\n }\n\n // Important: to avoid potentially leaking links between entities of different types the key map calculates the secure delegation keys using the\n // same entity type as the delegation key for which they are mapping information.\n private async ensureDelegationKeyMapSharedWith(entityType: EntityWithDelegationTypeName, keyMap: SecureDelegationKeyMap, delegates: string[]) {\n if (!keyMap.delegator || !keyMap.delegate) throw new Error('Illegal state: key map is missing delegator or delegate info.')\n const dataOwnersWithAccessToMapThroughDelegation = Object.values(\n await this.secureDelegationsMetadataDecryptor.getDelegationMemberDetails({\n type: entityType,\n entity: keyMap,\n })\n )\n .flatMap((x) => [x.delegate, x.delegator])\n .filter((x) => !!x) as string[]\n // Delegator and delegate got access to the entity when it was first created: no need to share with them ever.\n const dataOwnersWithAccessToMap = new Set([keyMap.delegate, keyMap.delegator, ...dataOwnersWithAccessToMapThroughDelegation])\n const dataOwnersNeedingShare = delegates.filter((x) => !dataOwnersWithAccessToMap.has(x))\n if (dataOwnersNeedingShare.length) {\n ;(\n await this.xapis.simpleShareOrUpdateEncryptedEntityMetadata(\n {\n entity: keyMap,\n type: entityType,\n },\n Object.fromEntries(\n dataOwnersNeedingShare.map((x) => [\n x,\n {\n shareSecretIds: [],\n shareEncryptionKeys: ShareMetadataBehaviour.REQUIRED,\n shareOwningEntityIds: ShareMetadataBehaviour.NEVER,\n requestedPermissions: RequestedPermissionEnum.FULL_READ,\n },\n ])\n ),\n async (request) =>\n this.delegationKeyMapApi.bulkShareSecureDelegationKeyMap(\n request,\n await this.accessControlKeysHeadersProvider.getAccessControlKeysHeaders(entityType)\n )\n )\n ).updatedEntityOrThrow\n }\n }\n\n // Important: to avoid potentially leaking links between entities of different types the key map calculates the secure delegation keys using the\n // same entity type as the delegation key for which they are mapping information.\n private async createSecureDelegationKeyMap(\n entityType: EntityWithDelegationTypeName,\n delegationKey: string,\n delegationMembersDetails: DelegationMembersDetails,\n delegates: string[]\n ) {\n if (!delegationMembersDetails.delegate || !delegationMembersDetails.delegator || !delegationMembersDetails.accessControlSecret)\n throw new Error('Illegal state: delegation members details are missing delegate, delegator or access control secret info.')\n const selfDoId = await this.dataOwnerApi.getCurrentDataOwnerId()\n // Ensure that both the delegator and delegate of the delegation this map refers tho can share it later on, even if they did not create it.\n // Usually either the delegator or delegate are the current data owner, but sometimes also the child of the delegator or delegate can do it.\n const initialDelegates = [delegationMembersDetails.delegate, delegationMembersDetails.delegator, ...delegates].filter((x) => x != selfDoId)\n const initalisedMapInfo = await this.xapis.entityWithInitialisedEncryptedMetadata<SecureDelegationKeyMap>(\n {\n id: this.cryptoPrimitives.randomUuid(),\n delegate: delegationMembersDetails.delegate,\n delegator: delegationMembersDetails.delegator,\n delegationKey: delegationKey,\n },\n entityType,\n undefined,\n undefined,\n true,\n Object.fromEntries(initialDelegates.map((x) => [x, AccessLevelEnum.READ]))\n )\n const encryptedKeyMap = await this.xapis.tryEncryptEntity(\n initalisedMapInfo.updatedEntity,\n entityType,\n this.delegationKeyMapFieldsToEncrypt,\n false,\n true,\n (x) => new SecureDelegationKeyMap(x)\n )\n await this.delegationKeyMapApi.create(\n encryptedKeyMap,\n new XHR.Header(\n ACCESS_CONTROL_KEYS_HEADER,\n await this.accessControlSecretUtils.getEncodedAccessControlKeys([delegationMembersDetails.accessControlSecret], entityType)\n )\n )\n }\n}\n"]}
@@ -1,7 +1,6 @@
1
1
  import { EncryptedEntity, EncryptedEntityStub } from '../../icc-api/model/models';
2
2
  import { EncryptedEntityWithType, EntityWithDelegationTypeName } from '../utils/EntityWithDelegationTypeName';
3
3
  import { SecureDelegation } from '../../icc-api/model/SecureDelegation';
4
- import AccessLevelEnum = SecureDelegation.AccessLevelEnum;
5
4
  import { EntityShareRequest } from '../../icc-api/model/requests/EntityShareRequest';
6
5
  import { EntityBulkShareResult } from '../../icc-api/model/requests/EntityBulkShareResult';
7
6
  import RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum;
@@ -104,14 +103,13 @@ export interface ExtendedApisUtils {
104
103
  * @param owningEntitySecretId secret id of the parent entity, to use in the secret foreign keys for the provided entity, if any.
105
104
  * @param initialiseEncryptionKey if false this method will not initialize an encryption key for the entity. Use only for entities which use
106
105
  * delegations for access control but don't actually have any encrypted content.
107
- * @param initialiseSecretId if false this method will not initialize any secret id, use it for entities which can not be 'owning entities' (e.g.
108
106
  * HealthcareElement).
109
107
  * @param autoDelegations automatically shares the metadata with the provided data owners, with the provided access level.
110
108
  * @throws if the entity already has non-empty values for encryption metadata.
111
109
  * @return an updated copy of the entity.
112
110
  */
113
- entityWithInitialisedEncryptedMetadata<T extends EncryptedEntity>(entity: T, entityType: EntityWithDelegationTypeName, owningEntity: string | undefined, owningEntitySecretId: string | undefined, initialiseEncryptionKey: boolean, initialiseSecretId: boolean, autoDelegations: {
114
- [dataOwnerId: string]: AccessLevelEnum;
111
+ entityWithInitialisedEncryptedMetadata<T extends EncryptedEntity>(entity: T, entityType: EntityWithDelegationTypeName, owningEntity: string | undefined, owningEntitySecretId: string | undefined, initialiseEncryptionKey: boolean, autoDelegations: {
112
+ [p: string]: SecureDelegation.AccessLevelEnum;
115
113
  }): Promise<{
116
114
  updatedEntity: T;
117
115
  rawEncryptionKey: string | undefined;
@@ -202,7 +200,6 @@ export interface ExtendedApisUtils {
202
200
  * and owning entity ids if requested. NOTE: this method can only be used with entities which already exist in the cloud (the entity must have
203
201
  * been saved).
204
202
  * @param entity an entity.
205
- * @param unusedSecretIds specifies if the entity should not actually use secret ids but may have some if it was created using older iCure sdk
206
203
  * versions. If true the method expects `shareSecretIds` options to always be undefined and will always share any available secret ids. If false
207
204
  * it expects `shareSecretIds` options to always be defined and will only share the secret ids specified in the options.
208
205
  * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:
@@ -220,12 +217,12 @@ export interface ExtendedApisUtils {
220
217
  simpleShareOrUpdateEncryptedEntityMetadata<T extends EncryptedEntityStub>(entity: {
221
218
  entity: T;
222
219
  type: EntityWithDelegationTypeName;
223
- }, unusedSecretIds: boolean, delegates: {
224
- [delegateId: string]: {
220
+ }, delegates: {
221
+ [p: string]: {
225
222
  shareSecretIds: string[] | undefined;
226
223
  shareEncryptionKeys: ShareMetadataBehaviour | undefined;
227
224
  shareOwningEntityIds: ShareMetadataBehaviour | undefined;
228
- requestedPermissions: RequestedPermissionEnum | undefined;
225
+ requestedPermissions: EntityShareRequest.RequestedPermissionEnum | undefined;
229
226
  };
230
227
  }, doRequestBulkShareOrUpdate: (request: BulkShareOrUpdateMetadataParams) => Promise<EntityBulkShareResult<T>[]>): Promise<ShareResult<T>>;
231
228
  /**