@icure/api 8.0.12 → 8.0.14

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.
@@ -134,9 +134,8 @@ export declare class IccHcpartyApi {
134
134
  /**
135
135
  * General information about the healthcare Party
136
136
  * @summary Get healthcareParties by their IDs
137
- * @param healthcarePartyIds
138
137
  */
139
- getHealthcareParties(healthcarePartyIds: string): Promise<Array<HealthcareParty>>;
138
+ getHealthcareParties(body?: ListOfIds): Promise<Array<HealthcareParty>>;
140
139
  /**
141
140
  * Return a list of children hcp.
142
141
  * @summary Find children of an healthcare parties
@@ -258,13 +258,13 @@ class IccHcpartyApi {
258
258
  /**
259
259
  * General information about the healthcare Party
260
260
  * @summary Get healthcareParties by their IDs
261
- * @param healthcarePartyIds
262
261
  */
263
- getHealthcareParties(healthcarePartyIds) {
264
- let _body = null;
265
- const _url = this.host + `/hcparty/byIds/${encodeURIComponent(String(healthcarePartyIds))}` + '?ts=' + new Date().getTime();
262
+ getHealthcareParties(body) {
263
+ let _body = body;
264
+ const _url = this.host + '/hcparty/byIds?ts=' + new Date().getTime();
266
265
  let headers = this.headers;
267
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
266
+ headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
267
+ return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
268
268
  .then((doc) => doc.body.map((it) => new HealthcareParty_1.HealthcareParty(it)))
269
269
  .catch((err) => this.handleError(err));
270
270
  }
@@ -1 +1 @@
1
- {"version":3,"file":"IccHcpartyApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccHcpartyApi.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAE3B,wFAAoF;AACpF,0DAAsD;AAEtD,8DAA0D;AAE1D,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OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,sBAAsB,CAAC,cAAc,EAAE,CAAC;aAC1H,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,2DAA4B,CAAC,GAAG,CAAC,IAAY,CAAC,CAAC;aACjE,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;IAC1C,CAAC;CACF;AApfD,sCAofC","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 { AbstractFilterHealthcareParty } from '../model/AbstractFilterHealthcareParty'\nimport { DataOwnerRegistrationSuccess } from '../model/DataOwnerRegistrationSuccess'\nimport { DocIdentifier } from '../model/DocIdentifier'\nimport { FilterChainHealthcareParty } from '../model/FilterChainHealthcareParty'\nimport { HealthcareParty } from '../model/HealthcareParty'\nimport { ListOfIds } from '../model/ListOfIds'\nimport { PaginatedListHealthcareParty } from '../model/PaginatedListHealthcareParty'\nimport { PublicKey } from '../model/PublicKey'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\nimport { iccRestApiPath } from './IccRestApiPath'\n\nexport class IccHcpartyApi {\n host: string\n headers: Array<XHR.Header>\n authenticationProvider: AuthenticationProvider\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\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 setHeaders(h: Array<XHR.Header>) {\n this.headers = h\n }\n\n handleError(e: XHR.XHRError): never {\n throw e\n }\n\n /**\n * One of Name or Last name+First name, Nihii, and Public key are required.\n * @summary Create a healthcare party\n * @param body\n */\n async createHealthcareParty(body?: HealthcareParty): Promise<HealthcareParty> {\n const _url = this.host + `/hcparty` + '?ts=' + new Date().getTime()\n let headers = 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 HealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * One of Name or Last name+First name, Nihii, and Public key are required.\n * @summary Create a healthcare party\n * @param body\n * @param groupId\n */\n async createHealthcarePartyInGroup(groupId: string, body?: HealthcareParty): Promise<HealthcareParty> {\n const _url = this.host + `/hcparty/inGroup/${encodeURIComponent(String(groupId))}` + '?ts=' + new Date().getTime()\n let headers = 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 HealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Deletes a healthcare parties in batch.\n * @param healthcarePartyIds a ListOfIds containing the ids of the healthcare parties to delete.\n * @return a Promise that will resolve in an Array of DocIdentifiers of the successfully deleted healthcare parties.\n */\n async deleteHealthcareParties(healthcarePartyIds: ListOfIds): Promise<Array<DocIdentifier>> {\n return XHR.sendCommand(\n 'POST',\n this.host + `/hcparty/delete/batch` + '?ts=' + new Date().getTime(),\n this.headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json')),\n healthcarePartyIds,\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 healthcare party by id.\n *\n * @param healthcarePartyId the id of the healthcare party to delete.\n * @return a Promise that will resolve in the DocIdentifier of the healthcare party.\n */\n async deleteHealthcareParty(healthcarePartyId: string): Promise<DocIdentifier> {\n return XHR.sendCommand(\n 'DELETE',\n this.host + `/hcparty/${encodeURIComponent(healthcarePartyId)}` + '?ts=' + new Date().getTime(),\n 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 * @summary Deletes a healthcare parties in batch in a specific group\n * @param groupId the id of the group where to delete the healthcare parties.\n * @param healthcarePartyIds a ListOfIds containing the ids of the healthcare parties to delete.\n * @return a Promise that will resolve in an Array of DocIdentifiers of the successfully deleted healthcare parties.\n */\n async deleteHealthcarePartiesInGroup(groupId: string, healthcarePartyIds: ListOfIds): Promise<Array<DocIdentifier>> {\n return XHR.sendCommand(\n 'POST',\n this.host + `/hcparty/delete/batch/inGroup/${encodeURIComponent(groupId)}` + '?ts=' + new Date().getTime(),\n this.headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json')),\n healthcarePartyIds,\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 healthcare party by id in a specific group.\n *\n * @param groupId the id of the group where to delete the healthcare party.\n * @param healthcarePartyId the id of the healthcare party to delete.\n * @return a Promise that will resolve in the DocIdentifier of the healthcare party.\n */\n async deleteHealthcarePartyInGroup(groupId: string, healthcarePartyId: string): Promise<DocIdentifier> {\n return XHR.sendCommand(\n 'DELETE',\n this.host + `/hcparty/${encodeURIComponent(healthcarePartyId)}/inGroup/${encodeURIComponent(groupId)}` + '?ts=' + new Date().getTime(),\n 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 healthcare party along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.\n * @summary Filter healthcare parties for the current user (HcParty)\n * @param body\n * @param startDocumentId A HealthcareParty document ID\n * @param limit Number of rows\n */\n async filterHealthPartiesBy(startDocumentId?: string, limit?: number, body?: FilterChainHealthcareParty): Promise<PaginatedListHealthcareParty> {\n const _url =\n this.host +\n `/hcparty/filter` +\n '?ts=' +\n new Date().getTime() +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '')\n let headers = 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 PaginatedListHealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of healthcare parties.\n * @summary Find healthcare parties by name with(out) pagination\n * @param name The Last name search value\n * @param startKey A healthcare party Last name\n * @param startDocumentId A healthcare party document ID\n * @param limit Number of rows\n * @param desc Descending\n */\n findByName(name?: string, startKey?: string, startDocumentId?: string, limit?: number, desc?: boolean): Promise<PaginatedListHealthcareParty> {\n let _body = null\n\n const _url =\n this.host +\n `/hcparty/byName` +\n '?ts=' +\n new Date().getTime() +\n (name ? '&name=' + encodeURIComponent(String(name)) : '') +\n (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +\n (desc ? '&desc=' + encodeURIComponent(String(desc)) : '')\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListHealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of healthcare parties.\n * @summary Find healthcare parties by name with(out) pagination\n * @param type The type of the HCP (persphysician)\n * @param spec The speciality of the HCP\n * @param firstCode The first postCode for the HCP\n * @param lastCode The last postCode for the HCP\n * @param limit Number of rows\n */\n findBySpecialityAndPostCode(\n type: string,\n spec: string,\n firstCode: string,\n lastCode: string,\n limit?: number\n ): Promise<PaginatedListHealthcareParty> {\n let _body = null\n\n const _url =\n this.host +\n `/hcparty/bySpecialityAndPostCode/${encodeURIComponent(String(type))}/${encodeURIComponent(String(spec))}/${encodeURIComponent(\n String(firstCode)\n )}/to/${encodeURIComponent(String(lastCode))}` +\n '?ts=' +\n new Date().getTime() +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '')\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListHealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of healthcare parties.\n * @summary Find healthcare parties by nihii or ssin with(out) pagination\n * @param searchValue\n * @param startKey A healthcare party Last name\n * @param startDocumentId A healthcare party document ID\n * @param limit Number of rows\n * @param desc Descending\n */\n findBySsinOrNihii(\n searchValue: string,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n desc?: boolean\n ): Promise<PaginatedListHealthcareParty> {\n let _body = null\n\n const _url =\n this.host +\n `/hcparty/byNihiiOrSsin/${encodeURIComponent(String(searchValue))}` +\n '?ts=' +\n new Date().getTime() +\n (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +\n (desc ? '&desc=' + encodeURIComponent(String(desc)) : '')\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListHealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * (key, value) of the map is as follows: (ID of the owner of the encrypted AES key, encrypted AES keys)\n * @summary Get the HcParty encrypted AES keys indexed by owner.\n * @param healthcarePartyId\n */\n getAesExchangeKeysForDelegate(\n healthcarePartyId: string\n ): Promise<{ [delegatorId: string]: { [delegatorPubKeyFingerprint: string]: { [delegatePubKeyFingerprint: string]: string } } }> {\n let _body = null\n\n const _url = this.host + `/hcparty/${encodeURIComponent(String(healthcarePartyId))}/aesExchangeKeys` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => JSON.parse(JSON.stringify(doc.body)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * General information about the current healthcare Party\n * @summary Get the current healthcare party if logged in.\n */\n getCurrentHealthcareParty(): Promise<HealthcareParty> {\n let _body = null\n\n const _url = this.host + `/hcparty/current` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new HealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * (key, value) of the map is as follows: (ID of the owner of the encrypted AES key, encrypted AES key)\n * @summary Get the HcParty encrypted AES keys indexed by owner. As a HCp may now have multiple AES keys, this service is deprecated. Use /{healthcarePartyId}/aesExchangeKeys\n * @param healthcarePartyId\n */\n getHcPartyKeysForDelegate(healthcarePartyId: string): Promise<{ [key: string]: string }> {\n let _body = null\n\n const _url = this.host + `/hcparty/${encodeURIComponent(String(healthcarePartyId))}/keys` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => JSON.parse(JSON.stringify(doc.body)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * General information about the healthcare Party\n * @summary Get healthcareParties by their IDs\n * @param healthcarePartyIds\n */\n getHealthcareParties(healthcarePartyIds: string): Promise<Array<HealthcareParty>> {\n let _body = null\n\n const _url = this.host + `/hcparty/byIds/${encodeURIComponent(String(healthcarePartyIds))}` + '?ts=' + new Date().getTime()\n let headers = 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 HealthcareParty(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Return a list of children hcp.\n * @summary Find children of an healthcare parties\n * @param parentId\n */\n getHealthcarePartiesByParentId(parentId: string): Promise<Array<HealthcareParty>> {\n let _body = null\n\n const _url = this.host + `/hcparty/${encodeURIComponent(String(parentId))}/children` + '?ts=' + new Date().getTime()\n let headers = 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 HealthcareParty(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * General information about the healthcare Party\n * @summary Get healthcareParties by their IDs\n * @param body\n * @param groupId\n */\n getHealthcarePartiesInGroup(groupId: string, body?: ListOfIds): Promise<Array<HealthcareParty>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/hcparty/inGroup/${encodeURIComponent(String(groupId))}/byIds` + '?ts=' + new Date().getTime()\n let headers = 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 HealthcareParty(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * General information about the healthcare Party\n * @summary Get a healthcareParty by his ID\n * @param healthcarePartyId\n */\n getHealthcareParty(healthcarePartyId: string): Promise<HealthcareParty> {\n let _body = null\n\n const _url = this.host + `/hcparty/${encodeURIComponent(String(healthcarePartyId))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new HealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns the public key of a healthcare party in Hex\n * @summary Get public key of a healthcare party\n * @param healthcarePartyId\n */\n getPublicKey(healthcarePartyId: string): Promise<PublicKey> {\n let _body = null\n\n const _url = this.host + `/hcparty/${encodeURIComponent(String(healthcarePartyId))}/publicKey` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PublicKey(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of healthcare parties.\n * @summary Find healthcare parties by name with(out) pagination\n * @param name The Last name search value\n */\n listByName(name: string): Promise<Array<HealthcareParty>> {\n let _body = null\n\n const _url = this.host + `/hcparty/byNameStrict/${encodeURIComponent(String(name))}` + '?ts=' + new Date().getTime()\n let headers = 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 HealthcareParty(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of healthcare parties.\n * @summary List healthcare parties with(out) pagination\n * @param startKey A healthcare party Last name\n * @param startDocumentId A healthcare party document ID\n * @param limit Number of rows\n * @param desc Descending\n */\n listHealthcareParties(startKey?: string, startDocumentId?: string, limit?: number, desc?: boolean): Promise<PaginatedListHealthcareParty> {\n let _body = null\n\n const _url =\n this.host +\n `/hcparty` +\n '?ts=' +\n new Date().getTime() +\n (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +\n (desc ? '&desc=' + encodeURIComponent(String(desc)) : '')\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListHealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get ids of healthcare party matching the provided filter for the current user (HcParty)\n * @param body\n */\n matchHealthcarePartiesBy(body?: AbstractFilterHealthcareParty): Promise<Array<string>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/hcparty/match` + '?ts=' + new Date().getTime()\n let headers = 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 * No particular return value. It's just a message.\n * @summary Modify a Healthcare Party.\n * @param body\n */\n modifyHealthcareParty(body?: HealthcareParty): Promise<HealthcareParty> {\n let _body = null\n _body = body\n\n const _url = this.host + `/hcparty` + '?ts=' + new Date().getTime()\n let headers = 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 HealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * No particular return value. It's just a message.\n * @summary Modify a Healthcare Party.\n * @param body\n * @param groupId\n */\n modifyHealthcarePartyInGroup(groupId: string, body?: HealthcareParty): Promise<HealthcareParty> {\n let _body = null\n _body = body\n\n const _url = this.host + `/hcparty/inGroup/${encodeURIComponent(String(groupId))}` + '?ts=' + new Date().getTime()\n let headers = 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 HealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Register a new hcp into the system\n * @summary Register a hcp\n * @param body\n * @param groupId\n * @param parentHcPartyId\n * @param token\n * @param useShortToken\n */\n registerHealthcareParty(\n groupId: string,\n parentHcPartyId?: string,\n token?: string,\n useShortToken?: boolean,\n body?: HealthcareParty\n ): Promise<DataOwnerRegistrationSuccess> {\n let _body = null\n _body = body\n\n const _url =\n this.host +\n `/hcparty/register/inGroup/${encodeURIComponent(String(groupId))}` +\n '?ts=' +\n new Date().getTime() +\n (parentHcPartyId ? '&parentHcPartyId=' + encodeURIComponent(String(parentHcPartyId)) : '') +\n (token ? '&token=' + encodeURIComponent(String(token)) : '') +\n (useShortToken ? '&useShortToken=' + encodeURIComponent(String(useShortToken)) : '')\n let headers = 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 DataOwnerRegistrationSuccess(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
1
+ {"version":3,"file":"IccHcpartyApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccHcpartyApi.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAE3B,wFAAoF;AACpF,0DAAsD;AAEtD,8DAA0D;AAE1D,wFAAoF;AACpF,kDAA8C;AAC9C,wFAA8G;AAC9G,qDAAiD;AAEjD,MAAa,aAAa;IAMxB,YACE,IAAY,EACZ,OAAY,EACZ,sBAA+C,EAC/C,SAAyE;QAEzE,IAAI,CAAC,IAAI,GAAG,IAAA,+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AE,SAAS,EAAE,IAAI,CAAC,sBAAsB,CAAC,cAAc,EAAE,CAAC;aAC1H,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,2DAA4B,CAAC,GAAG,CAAC,IAAY,CAAC,CAAC;aACjE,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;IAC1C,CAAC;CACF;AApfD,sCAofC","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 { AbstractFilterHealthcareParty } from '../model/AbstractFilterHealthcareParty'\nimport { DataOwnerRegistrationSuccess } from '../model/DataOwnerRegistrationSuccess'\nimport { DocIdentifier } from '../model/DocIdentifier'\nimport { FilterChainHealthcareParty } from '../model/FilterChainHealthcareParty'\nimport { HealthcareParty } from '../model/HealthcareParty'\nimport { ListOfIds } from '../model/ListOfIds'\nimport { PaginatedListHealthcareParty } from '../model/PaginatedListHealthcareParty'\nimport { PublicKey } from '../model/PublicKey'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\nimport { iccRestApiPath } from './IccRestApiPath'\n\nexport class IccHcpartyApi {\n host: string\n headers: Array<XHR.Header>\n authenticationProvider: AuthenticationProvider\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\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 setHeaders(h: Array<XHR.Header>) {\n this.headers = h\n }\n\n handleError(e: XHR.XHRError): never {\n throw e\n }\n\n /**\n * One of Name or Last name+First name, Nihii, and Public key are required.\n * @summary Create a healthcare party\n * @param body\n */\n async createHealthcareParty(body?: HealthcareParty): Promise<HealthcareParty> {\n const _url = this.host + `/hcparty` + '?ts=' + new Date().getTime()\n let headers = 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 HealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * One of Name or Last name+First name, Nihii, and Public key are required.\n * @summary Create a healthcare party\n * @param body\n * @param groupId\n */\n async createHealthcarePartyInGroup(groupId: string, body?: HealthcareParty): Promise<HealthcareParty> {\n const _url = this.host + `/hcparty/inGroup/${encodeURIComponent(String(groupId))}` + '?ts=' + new Date().getTime()\n let headers = 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 HealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Deletes a healthcare parties in batch.\n * @param healthcarePartyIds a ListOfIds containing the ids of the healthcare parties to delete.\n * @return a Promise that will resolve in an Array of DocIdentifiers of the successfully deleted healthcare parties.\n */\n async deleteHealthcareParties(healthcarePartyIds: ListOfIds): Promise<Array<DocIdentifier>> {\n return XHR.sendCommand(\n 'POST',\n this.host + `/hcparty/delete/batch` + '?ts=' + new Date().getTime(),\n this.headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json')),\n healthcarePartyIds,\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 healthcare party by id.\n *\n * @param healthcarePartyId the id of the healthcare party to delete.\n * @return a Promise that will resolve in the DocIdentifier of the healthcare party.\n */\n async deleteHealthcareParty(healthcarePartyId: string): Promise<DocIdentifier> {\n return XHR.sendCommand(\n 'DELETE',\n this.host + `/hcparty/${encodeURIComponent(healthcarePartyId)}` + '?ts=' + new Date().getTime(),\n 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 * @summary Deletes a healthcare parties in batch in a specific group\n * @param groupId the id of the group where to delete the healthcare parties.\n * @param healthcarePartyIds a ListOfIds containing the ids of the healthcare parties to delete.\n * @return a Promise that will resolve in an Array of DocIdentifiers of the successfully deleted healthcare parties.\n */\n async deleteHealthcarePartiesInGroup(groupId: string, healthcarePartyIds: ListOfIds): Promise<Array<DocIdentifier>> {\n return XHR.sendCommand(\n 'POST',\n this.host + `/hcparty/delete/batch/inGroup/${encodeURIComponent(groupId)}` + '?ts=' + new Date().getTime(),\n this.headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json')),\n healthcarePartyIds,\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 healthcare party by id in a specific group.\n *\n * @param groupId the id of the group where to delete the healthcare party.\n * @param healthcarePartyId the id of the healthcare party to delete.\n * @return a Promise that will resolve in the DocIdentifier of the healthcare party.\n */\n async deleteHealthcarePartyInGroup(groupId: string, healthcarePartyId: string): Promise<DocIdentifier> {\n return XHR.sendCommand(\n 'DELETE',\n this.host + `/hcparty/${encodeURIComponent(healthcarePartyId)}/inGroup/${encodeURIComponent(groupId)}` + '?ts=' + new Date().getTime(),\n 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 healthcare party along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.\n * @summary Filter healthcare parties for the current user (HcParty)\n * @param body\n * @param startDocumentId A HealthcareParty document ID\n * @param limit Number of rows\n */\n async filterHealthPartiesBy(startDocumentId?: string, limit?: number, body?: FilterChainHealthcareParty): Promise<PaginatedListHealthcareParty> {\n const _url =\n this.host +\n `/hcparty/filter` +\n '?ts=' +\n new Date().getTime() +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '')\n let headers = 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 PaginatedListHealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of healthcare parties.\n * @summary Find healthcare parties by name with(out) pagination\n * @param name The Last name search value\n * @param startKey A healthcare party Last name\n * @param startDocumentId A healthcare party document ID\n * @param limit Number of rows\n * @param desc Descending\n */\n findByName(name?: string, startKey?: string, startDocumentId?: string, limit?: number, desc?: boolean): Promise<PaginatedListHealthcareParty> {\n let _body = null\n\n const _url =\n this.host +\n `/hcparty/byName` +\n '?ts=' +\n new Date().getTime() +\n (name ? '&name=' + encodeURIComponent(String(name)) : '') +\n (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +\n (desc ? '&desc=' + encodeURIComponent(String(desc)) : '')\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListHealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of healthcare parties.\n * @summary Find healthcare parties by name with(out) pagination\n * @param type The type of the HCP (persphysician)\n * @param spec The speciality of the HCP\n * @param firstCode The first postCode for the HCP\n * @param lastCode The last postCode for the HCP\n * @param limit Number of rows\n */\n findBySpecialityAndPostCode(\n type: string,\n spec: string,\n firstCode: string,\n lastCode: string,\n limit?: number\n ): Promise<PaginatedListHealthcareParty> {\n let _body = null\n\n const _url =\n this.host +\n `/hcparty/bySpecialityAndPostCode/${encodeURIComponent(String(type))}/${encodeURIComponent(String(spec))}/${encodeURIComponent(\n String(firstCode)\n )}/to/${encodeURIComponent(String(lastCode))}` +\n '?ts=' +\n new Date().getTime() +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '')\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListHealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of healthcare parties.\n * @summary Find healthcare parties by nihii or ssin with(out) pagination\n * @param searchValue\n * @param startKey A healthcare party Last name\n * @param startDocumentId A healthcare party document ID\n * @param limit Number of rows\n * @param desc Descending\n */\n findBySsinOrNihii(\n searchValue: string,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n desc?: boolean\n ): Promise<PaginatedListHealthcareParty> {\n let _body = null\n\n const _url =\n this.host +\n `/hcparty/byNihiiOrSsin/${encodeURIComponent(String(searchValue))}` +\n '?ts=' +\n new Date().getTime() +\n (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +\n (desc ? '&desc=' + encodeURIComponent(String(desc)) : '')\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListHealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * (key, value) of the map is as follows: (ID of the owner of the encrypted AES key, encrypted AES keys)\n * @summary Get the HcParty encrypted AES keys indexed by owner.\n * @param healthcarePartyId\n */\n getAesExchangeKeysForDelegate(\n healthcarePartyId: string\n ): Promise<{ [delegatorId: string]: { [delegatorPubKeyFingerprint: string]: { [delegatePubKeyFingerprint: string]: string } } }> {\n let _body = null\n\n const _url = this.host + `/hcparty/${encodeURIComponent(String(healthcarePartyId))}/aesExchangeKeys` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => JSON.parse(JSON.stringify(doc.body)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * General information about the current healthcare Party\n * @summary Get the current healthcare party if logged in.\n */\n getCurrentHealthcareParty(): Promise<HealthcareParty> {\n let _body = null\n\n const _url = this.host + `/hcparty/current` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new HealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * (key, value) of the map is as follows: (ID of the owner of the encrypted AES key, encrypted AES key)\n * @summary Get the HcParty encrypted AES keys indexed by owner. As a HCp may now have multiple AES keys, this service is deprecated. Use /{healthcarePartyId}/aesExchangeKeys\n * @param healthcarePartyId\n */\n getHcPartyKeysForDelegate(healthcarePartyId: string): Promise<{ [key: string]: string }> {\n let _body = null\n\n const _url = this.host + `/hcparty/${encodeURIComponent(String(healthcarePartyId))}/keys` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => JSON.parse(JSON.stringify(doc.body)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * General information about the healthcare Party\n * @summary Get healthcareParties by their IDs\n */\n getHealthcareParties(body?: ListOfIds): Promise<Array<HealthcareParty>> {\n let _body = body\n\n const _url = this.host + '/hcparty/byIds?ts=' + new Date().getTime()\n let headers = 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 HealthcareParty(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Return a list of children hcp.\n * @summary Find children of an healthcare parties\n * @param parentId\n */\n getHealthcarePartiesByParentId(parentId: string): Promise<Array<HealthcareParty>> {\n let _body = null\n\n const _url = this.host + `/hcparty/${encodeURIComponent(String(parentId))}/children` + '?ts=' + new Date().getTime()\n let headers = 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 HealthcareParty(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * General information about the healthcare Party\n * @summary Get healthcareParties by their IDs\n * @param body\n * @param groupId\n */\n getHealthcarePartiesInGroup(groupId: string, body?: ListOfIds): Promise<Array<HealthcareParty>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/hcparty/inGroup/${encodeURIComponent(String(groupId))}/byIds` + '?ts=' + new Date().getTime()\n let headers = 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 HealthcareParty(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * General information about the healthcare Party\n * @summary Get a healthcareParty by his ID\n * @param healthcarePartyId\n */\n getHealthcareParty(healthcarePartyId: string): Promise<HealthcareParty> {\n let _body = null\n\n const _url = this.host + `/hcparty/${encodeURIComponent(String(healthcarePartyId))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new HealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns the public key of a healthcare party in Hex\n * @summary Get public key of a healthcare party\n * @param healthcarePartyId\n */\n getPublicKey(healthcarePartyId: string): Promise<PublicKey> {\n let _body = null\n\n const _url = this.host + `/hcparty/${encodeURIComponent(String(healthcarePartyId))}/publicKey` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PublicKey(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of healthcare parties.\n * @summary Find healthcare parties by name with(out) pagination\n * @param name The Last name search value\n */\n listByName(name: string): Promise<Array<HealthcareParty>> {\n let _body = null\n\n const _url = this.host + `/hcparty/byNameStrict/${encodeURIComponent(String(name))}` + '?ts=' + new Date().getTime()\n let headers = 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 HealthcareParty(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of healthcare parties.\n * @summary List healthcare parties with(out) pagination\n * @param startKey A healthcare party Last name\n * @param startDocumentId A healthcare party document ID\n * @param limit Number of rows\n * @param desc Descending\n */\n listHealthcareParties(startKey?: string, startDocumentId?: string, limit?: number, desc?: boolean): Promise<PaginatedListHealthcareParty> {\n let _body = null\n\n const _url =\n this.host +\n `/hcparty` +\n '?ts=' +\n new Date().getTime() +\n (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +\n (desc ? '&desc=' + encodeURIComponent(String(desc)) : '')\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListHealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get ids of healthcare party matching the provided filter for the current user (HcParty)\n * @param body\n */\n matchHealthcarePartiesBy(body?: AbstractFilterHealthcareParty): Promise<Array<string>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/hcparty/match` + '?ts=' + new Date().getTime()\n let headers = 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 * No particular return value. It's just a message.\n * @summary Modify a Healthcare Party.\n * @param body\n */\n modifyHealthcareParty(body?: HealthcareParty): Promise<HealthcareParty> {\n let _body = null\n _body = body\n\n const _url = this.host + `/hcparty` + '?ts=' + new Date().getTime()\n let headers = 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 HealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * No particular return value. It's just a message.\n * @summary Modify a Healthcare Party.\n * @param body\n * @param groupId\n */\n modifyHealthcarePartyInGroup(groupId: string, body?: HealthcareParty): Promise<HealthcareParty> {\n let _body = null\n _body = body\n\n const _url = this.host + `/hcparty/inGroup/${encodeURIComponent(String(groupId))}` + '?ts=' + new Date().getTime()\n let headers = 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 HealthcareParty(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Register a new hcp into the system\n * @summary Register a hcp\n * @param body\n * @param groupId\n * @param parentHcPartyId\n * @param token\n * @param useShortToken\n */\n registerHealthcareParty(\n groupId: string,\n parentHcPartyId?: string,\n token?: string,\n useShortToken?: boolean,\n body?: HealthcareParty\n ): Promise<DataOwnerRegistrationSuccess> {\n let _body = null\n _body = body\n\n const _url =\n this.host +\n `/hcparty/register/inGroup/${encodeURIComponent(String(groupId))}` +\n '?ts=' +\n new Date().getTime() +\n (parentHcPartyId ? '&parentHcPartyId=' + encodeURIComponent(String(parentHcPartyId)) : '') +\n (token ? '&token=' + encodeURIComponent(String(token)) : '') +\n (useShortToken ? '&useShortToken=' + encodeURIComponent(String(useShortToken)) : '')\n let headers = 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 DataOwnerRegistrationSuccess(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
@@ -8,3 +8,8 @@ export declare function isJwtInvalidOrExpired(jwt: string): boolean;
8
8
  * Get the claims of the jwt.
9
9
  */
10
10
  export declare function decodeJwtClaims(jwt: string): any;
11
+ /**
12
+ * @internal this function is for internal use only and may be changed without notice
13
+ * Get the group of the jwt.
14
+ */
15
+ export declare function getGroupOfJwt(jwt: string): string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.decodeJwtClaims = exports.isJwtInvalidOrExpired = void 0;
3
+ exports.getGroupOfJwt = exports.decodeJwtClaims = exports.isJwtInvalidOrExpired = void 0;
4
4
  const utils_1 = require("../utils");
5
5
  /**
6
6
  * @internal this function is for internal use only and may be changed without notice
@@ -28,4 +28,12 @@ function decodeJwtClaims(jwt) {
28
28
  return JSON.parse((0, utils_1.a2b)(parts[1]));
29
29
  }
30
30
  exports.decodeJwtClaims = decodeJwtClaims;
31
+ /**
32
+ * @internal this function is for internal use only and may be changed without notice
33
+ * Get the group of the jwt.
34
+ */
35
+ function getGroupOfJwt(jwt) {
36
+ return decodeJwtClaims(jwt)['g'];
37
+ }
38
+ exports.getGroupOfJwt = getGroupOfJwt;
31
39
  //# sourceMappingURL=JwtUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"JwtUtils.js","sourceRoot":"","sources":["../../../icc-x-api/auth/JwtUtils.ts"],"names":[],"mappings":";;;AAAA,oCAA8B;AAE9B;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,GAAW;IAC/C,IAAI;QACF,MAAM,MAAM,GAAG,eAAe,CAAC,GAAG,CAAC,CAAA;QACnC,mGAAmG;QACnG,OAAO,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;KACzE;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,IAAI,CAAA;KACZ;AACH,CAAC;AARD,sDAQC;AAED;;;GAGG;AACH,SAAgB,eAAe,CAAC,GAAW;IACzC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC5B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;IACzE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,WAAG,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAClC,CAAC;AAJD,0CAIC","sourcesContent":["import { a2b } from '../utils'\n\n/**\n * @internal this function is for internal use only and may be changed without notice\n * Returns true if the jwt is invalid or expired, false otherwise.\n */\nexport function isJwtInvalidOrExpired(jwt: string): boolean {\n try {\n const claims = decodeJwtClaims(jwt)\n // Using the 'exp' string is safe to use as it is part of the JWT RFC and cannot be modified by us.\n return !('exp' in claims) || claims['exp'] * 1000 < new Date().getTime()\n } catch (e) {\n return true\n }\n}\n\n/**\n * @internal this function is for internal use only and may be changed without notice\n * Get the claims of the jwt.\n */\nexport function decodeJwtClaims(jwt: string): any {\n const parts = jwt.split('.')\n if (parts.length !== 3) throw new Error('Invalid JWT: should be 3 parts')\n return JSON.parse(a2b(parts[1]))\n}\n"]}
1
+ {"version":3,"file":"JwtUtils.js","sourceRoot":"","sources":["../../../icc-x-api/auth/JwtUtils.ts"],"names":[],"mappings":";;;AAAA,oCAA8B;AAE9B;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,GAAW;IAC/C,IAAI;QACF,MAAM,MAAM,GAAG,eAAe,CAAC,GAAG,CAAC,CAAA;QACnC,mGAAmG;QACnG,OAAO,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;KACzE;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,IAAI,CAAA;KACZ;AACH,CAAC;AARD,sDAQC;AAED;;;GAGG;AACH,SAAgB,eAAe,CAAC,GAAW;IACzC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC5B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;IACzE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,WAAG,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAClC,CAAC;AAJD,0CAIC;AAED;;;GAGG;AACH,SAAgB,aAAa,CAAC,GAAW;IACvC,OAAO,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;AAClC,CAAC;AAFD,sCAEC","sourcesContent":["import { a2b } from '../utils'\n\n/**\n * @internal this function is for internal use only and may be changed without notice\n * Returns true if the jwt is invalid or expired, false otherwise.\n */\nexport function isJwtInvalidOrExpired(jwt: string): boolean {\n try {\n const claims = decodeJwtClaims(jwt)\n // Using the 'exp' string is safe to use as it is part of the JWT RFC and cannot be modified by us.\n return !('exp' in claims) || claims['exp'] * 1000 < new Date().getTime()\n } catch (e) {\n return true\n }\n}\n\n/**\n * @internal this function is for internal use only and may be changed without notice\n * Get the claims of the jwt.\n */\nexport function decodeJwtClaims(jwt: string): any {\n const parts = jwt.split('.')\n if (parts.length !== 3) throw new Error('Invalid JWT: should be 3 parts')\n return JSON.parse(a2b(parts[1]))\n}\n\n/**\n * @internal this function is for internal use only and may be changed without notice\n * Get the group of the jwt.\n */\nexport function getGroupOfJwt(jwt: string): string {\n return decodeJwtClaims(jwt)['g']\n}\n"]}
@@ -19,7 +19,7 @@ export declare class UserSignatureKeysManager {
19
19
  /**
20
20
  * Get all available keys which can be used to verify the authenticity of a signature which should have been created
21
21
  * by the current data owner.
22
- * @param fingerprint v1 fingerprint of the key to retrieve.
22
+ * @param fingerprint v2 fingerprint of the key to retrieve.
23
23
  * @return all available verification keys by fingerprint.
24
24
  */
25
25
  getSignatureVerificationKey(fingerprint: string): Promise<CryptoKey | undefined>;
@@ -56,7 +56,7 @@ class UserSignatureKeysManager {
56
56
  /**
57
57
  * Get all available keys which can be used to verify the authenticity of a signature which should have been created
58
58
  * by the current data owner.
59
- * @param fingerprint v1 fingerprint of the key to retrieve.
59
+ * @param fingerprint v2 fingerprint of the key to retrieve.
60
60
  * @return all available verification keys by fingerprint.
61
61
  */
62
62
  getSignatureVerificationKey(fingerprint) {
@@ -1 +1 @@
1
- {"version":3,"file":"UserSignatureKeysManager.js","sourceRoot":"","sources":["../../../icc-x-api/crypto/UserSignatureKeysManager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,oC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AAxED,4DAwEC","sourcesContent":["import { IcureStorageFacade } from '../storage/IcureStorageFacade'\nimport { IccDataOwnerXApi } from '../icc-data-owner-x-api'\nimport { CryptoPrimitives } from './CryptoPrimitives'\nimport { hex2ua, jwk2spki, ua2hex } from '../utils'\nimport { KeyPair } from './RSA'\nimport { checkStandardPublicKeyTail, fingerprintV1, fingerprintV2, fingerprintV2ToStandardV1 } from './utils'\n\nexport class UserSignatureKeysManager {\n constructor(\n private readonly iCureStorage: IcureStorageFacade,\n private readonly dataOwnerApi: IccDataOwnerXApi,\n private readonly primitives: CryptoPrimitives\n ) {}\n\n private signatureKeysCache:\n | {\n fingerprint: string\n keyPair: KeyPair<CryptoKey>\n }\n | undefined = undefined\n private verificationKeysCache = new Map<string, CryptoKey>()\n\n /**\n * Get a key which can be used to sign data in order to allow verification of the data authenticity in the future.\n */\n async getOrCreateSignatureKeyPair(): Promise<{\n fingerprint: string\n keyPair: KeyPair<CryptoKey>\n }> {\n if (this.signatureKeysCache) return this.signatureKeysCache\n const dataOwnerId = await this.dataOwnerApi.getCurrentDataOwnerId()\n const existing = await this.iCureStorage.loadSignatureKey(dataOwnerId)\n if (existing) {\n const fingerprint = fingerprintV1(jwk2spki(existing.publicKey))\n this.signatureKeysCache = {\n fingerprint,\n keyPair: {\n privateKey: await this.primitives.RSA.importSignatureKey('jwk', existing.privateKey),\n publicKey: await this.primitives.RSA.importVerificationKey('jwk', existing.publicKey),\n },\n }\n return this.signatureKeysCache\n } else {\n const generatedPair = await this.primitives.RSA.generateSignatureKeyPair()\n const exportedPub = ua2hex(await this.primitives.RSA.exportKey(generatedPair.publicKey, 'spki'))\n checkStandardPublicKeyTail(exportedPub)\n const fpV2 = fingerprintV2(exportedPub)\n // For consistency with encryption keys we use fpv1 when saving\n await this.iCureStorage.saveSignatureKeyPair(\n dataOwnerId,\n fingerprintV1(exportedPub),\n await this.primitives.RSA.exportKeys(generatedPair, 'jwk', 'jwk')\n )\n this.verificationKeysCache.set(fpV2, generatedPair.publicKey)\n this.signatureKeysCache = { fingerprint: fpV2, keyPair: generatedPair }\n return this.signatureKeysCache\n }\n }\n\n /**\n * Get all available keys which can be used to verify the authenticity of a signature which should have been created\n * by the current data owner.\n * @param fingerprint v1 fingerprint of the key to retrieve.\n * @return all available verification keys by fingerprint.\n */\n async getSignatureVerificationKey(fingerprint: string): Promise<CryptoKey | undefined> {\n const cached = this.verificationKeysCache.get(fingerprint)\n if (cached) return cached\n // For consistency with encryption keys we use fpv1 when saving\n const loaded = await this.iCureStorage.loadSignatureVerificationKey(\n await this.dataOwnerApi.getCurrentDataOwnerId(),\n fingerprintV2ToStandardV1(fingerprint)\n )\n if (loaded) {\n const imported = await this.primitives.RSA.importVerificationKey('jwk', loaded)\n this.verificationKeysCache.set(fingerprint, imported)\n return imported\n }\n }\n}\n"]}
1
+ {"version":3,"file":"UserSignatureKeysManager.js","sourceRoot":"","sources":["../../../icc-x-api/crypto/UserSignatureKeysManager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,oCAAmD;AAEnD,mCAA6G;AAE7G,MAAa,wBAAwB;IACnC,YACmB,YAAgC,EAChC,YAA8B,EAC9B,UAA4B;QAF5B,iBAAY,GAAZ,YAAY,CAAoB;QAChC,iBAAY,GAAZ,YAAY,CAAkB;QAC9B,eAAU,GAAV,UAAU,CAAkB;QAGvC,uBAAkB,GAKV,SAAS,CAAA;QACjB,0BAAqB,GAAG,IAAI,GAAG,EAAqB,CAAA;IARzD,CAAC;IAUJ;;OAEG;IACG,2BAA2B;;YAI/B,IAAI,IAAI,CAAC,kBAAkB;gBAAE,OAAO,IAAI,CAAC,kBAAkB,CAAA;YAC3D,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,qBAAqB,EAAE,CAAA;YACnE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAA;YACtE,IAAI,QAAQ,EAAE;gBACZ,MAAM,WAAW,GAAG,IAA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,CAAC;KAAA;IAED;;;;;OAKG;IACG,2BAA2B,CAAC,WAAmB;;YACnD,MAAM,MAAM,GAAG,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;YAC1D,IAAI,MAAM;gBAAE,OAAO,MAAM,CAAA;YACzB,+DAA+D;YAC/D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,4BAA4B,CACjE,MAAM,IAAI,CAAC,YAAY,CAAC,qBAAqB,EAAE,EAC/C,IAAA,iCAAyB,EAAC,WAAW,CAAC,CACvC,CAAA;YACD,IAAI,MAAM,EAAE;gBACV,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,qBAAqB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;gBAC/E,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAA;gBACrD,OAAO,QAAQ,CAAA;aAChB;QACH,CAAC;KAAA;CACF;AAxED,4DAwEC","sourcesContent":["import { IcureStorageFacade } from '../storage/IcureStorageFacade'\nimport { IccDataOwnerXApi } from '../icc-data-owner-x-api'\nimport { CryptoPrimitives } from './CryptoPrimitives'\nimport { hex2ua, jwk2spki, ua2hex } from '../utils'\nimport { KeyPair } from './RSA'\nimport { checkStandardPublicKeyTail, fingerprintV1, fingerprintV2, fingerprintV2ToStandardV1 } from './utils'\n\nexport class UserSignatureKeysManager {\n constructor(\n private readonly iCureStorage: IcureStorageFacade,\n private readonly dataOwnerApi: IccDataOwnerXApi,\n private readonly primitives: CryptoPrimitives\n ) {}\n\n private signatureKeysCache:\n | {\n fingerprint: string\n keyPair: KeyPair<CryptoKey>\n }\n | undefined = undefined\n private verificationKeysCache = new Map<string, CryptoKey>()\n\n /**\n * Get a key which can be used to sign data in order to allow verification of the data authenticity in the future.\n */\n async getOrCreateSignatureKeyPair(): Promise<{\n fingerprint: string\n keyPair: KeyPair<CryptoKey>\n }> {\n if (this.signatureKeysCache) return this.signatureKeysCache\n const dataOwnerId = await this.dataOwnerApi.getCurrentDataOwnerId()\n const existing = await this.iCureStorage.loadSignatureKey(dataOwnerId)\n if (existing) {\n const fingerprint = fingerprintV1(jwk2spki(existing.publicKey))\n this.signatureKeysCache = {\n fingerprint,\n keyPair: {\n privateKey: await this.primitives.RSA.importSignatureKey('jwk', existing.privateKey),\n publicKey: await this.primitives.RSA.importVerificationKey('jwk', existing.publicKey),\n },\n }\n return this.signatureKeysCache\n } else {\n const generatedPair = await this.primitives.RSA.generateSignatureKeyPair()\n const exportedPub = ua2hex(await this.primitives.RSA.exportKey(generatedPair.publicKey, 'spki'))\n checkStandardPublicKeyTail(exportedPub)\n const fpV2 = fingerprintV2(exportedPub)\n // For consistency with encryption keys we use fpv1 when saving\n await this.iCureStorage.saveSignatureKeyPair(\n dataOwnerId,\n fingerprintV1(exportedPub),\n await this.primitives.RSA.exportKeys(generatedPair, 'jwk', 'jwk')\n )\n this.verificationKeysCache.set(fpV2, generatedPair.publicKey)\n this.signatureKeysCache = { fingerprint: fpV2, keyPair: generatedPair }\n return this.signatureKeysCache\n }\n }\n\n /**\n * Get all available keys which can be used to verify the authenticity of a signature which should have been created\n * by the current data owner.\n * @param fingerprint v2 fingerprint of the key to retrieve.\n * @return all available verification keys by fingerprint.\n */\n async getSignatureVerificationKey(fingerprint: string): Promise<CryptoKey | undefined> {\n const cached = this.verificationKeysCache.get(fingerprint)\n if (cached) return cached\n // For consistency with encryption keys we use fpv1 when saving\n const loaded = await this.iCureStorage.loadSignatureVerificationKey(\n await this.dataOwnerApi.getCurrentDataOwnerId(),\n fingerprintV2ToStandardV1(fingerprint)\n )\n if (loaded) {\n const imported = await this.primitives.RSA.importVerificationKey('jwk', loaded)\n this.verificationKeysCache.set(fingerprint, imported)\n return imported\n }\n }\n}\n"]}
@@ -2,9 +2,10 @@ import { IccAuthApi, IccHcpartyApi } from '../icc-api';
2
2
  import { HealthcareParty } from '../icc-api/model/HealthcareParty';
3
3
  import * as models from '../icc-api/model/models';
4
4
  import { AuthenticationProvider } from './auth/AuthenticationProvider';
5
- import { AbstractFilter } from "./filters/filters";
6
- import { SubscriptionOptions } from "./utils";
7
- import { Connection } from "../icc-api/model/Connection";
5
+ import { AbstractFilter } from './filters/filters';
6
+ import { SubscriptionOptions } from './utils';
7
+ import { Connection } from '../icc-api/model/Connection';
8
+ import { ListOfIds } from '../icc-api/model/models';
8
9
  export declare class IccHcpartyXApi extends IccHcpartyApi {
9
10
  private readonly authApi;
10
11
  hcPartyKeysCache: {
@@ -27,7 +28,7 @@ export declare class IccHcpartyXApi extends IccHcpartyApi {
27
28
  modifyHealthcareParty(body?: HealthcareParty): Promise<HealthcareParty | any>;
28
29
  getHealthcareParty(healthcarePartyId: string, bypassCache?: boolean): Promise<HealthcareParty | any>;
29
30
  getHealthcarePartyHierarchyIds(healthcarePartyId: string, bypassCache?: boolean): Promise<string[]>;
30
- getHealthcareParties(healthcarePartyIds: string): Promise<Array<HealthcareParty> | any>;
31
+ getHealthcareParties(healthcarePartyIds: ListOfIds): Promise<Array<HealthcareParty> | any>;
31
32
  getCurrentHealthcareParty(): Promise<HealthcareParty>;
32
33
  getHcPartyKeysForDelegate(healthcarePartyId: string, bypassCache?: boolean): Promise<{
33
34
  [key: string]: string;
@@ -16,6 +16,7 @@ const person_util_1 = require("./utils/person-util");
16
16
  const AuthenticationProvider_1 = require("./auth/AuthenticationProvider");
17
17
  const utils_1 = require("./utils");
18
18
  const Connection_1 = require("../icc-api/model/Connection");
19
+ const models_1 = require("../icc-api/model/models");
19
20
  // noinspection JSUnusedGlobalSymbols
20
21
  class IccHcpartyXApi extends icc_api_1.IccHcpartyApi {
21
22
  constructor(host, headers, authenticationProvider = new AuthenticationProvider_1.NoAuthenticationProvider(), authApi, fetchImpl = typeof window !== 'undefined'
@@ -91,13 +92,16 @@ class IccHcpartyXApi extends icc_api_1.IccHcpartyApi {
91
92
  }));
92
93
  }
93
94
  getHealthcareParties(healthcarePartyIds) {
94
- const ids = healthcarePartyIds.split(',').filter((x) => !!x);
95
+ const ids = healthcarePartyIds.ids;
96
+ if (!ids || !ids.length) {
97
+ return Promise.resolve([]);
98
+ }
95
99
  const cached = ids.map((id) => [id, this.getHcPartyFromCache(id)]);
96
100
  const toFetch = cached.filter((x) => !x[1]).map((x) => x[0]);
97
101
  if (!toFetch.length) {
98
102
  return Promise.all(cached.map((x) => x[1]));
99
103
  }
100
- const prom = super.getHealthcareParties(toFetch.join(','));
104
+ const prom = super.getHealthcareParties(new models_1.ListOfIds({ ids: toFetch }));
101
105
  return Promise.all(cached.map((x) => x[1] ||
102
106
  this.putHcPartyInCache(x[0], prom.then((hcps) => hcps.find((h) => h.id === x[0])))));
103
107
  }
@@ -1 +1 @@
1
- {"version":3,"file":"icc-hcparty-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-hcparty-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAoD;AAEpD,kDAAiD;AACjD,qDAA8E;AAC9E,0EAAgG;AAEhG,mCAAqE;AACrE,4DAAuE;AAEvE,qCAAqC;AACrC,MAAa,cAAe,SAAQ,uBAAa;IAK/C,YACE,IAAY,EACZ,OAAkC,EAClC,yBAAiD,IAAI,iDAAwB,EAAE,EAC9D,OAAmB,EACpC,YAA2E,OAAO,MAAM,KAAK,WAAW;QACtG,CAAC,CAAC,MAAM,CAAC,KAAK;QACd,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW;YAC7B,CAAC,CAAC,IAAI,CAAC,KAAK;YACZ,CAAC,CAAC,KAAK;QAET,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,sBAAsB,EAAE,SAAS,CAAC,CAAA;QAPtC,YAAO,GAAP,OAAO,CAAY;QARtC,qBAAgB,GAAiD,EAAE,CAAA;QACnE,iBAAY,GAA0D,EAAE,CAAA;QAEhE,0BAAqB,GAAG,MAAO,CAAA;IAavC,CAAC;IAEO,mBAAmB,CAAC,GAAW;QACrC,MAAM,UAAU,GA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C,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,2BAAc,CAAC,EAAE,CAAC,CAAC,CAAA;QACxC,CAAC;KAAA;CACF;AAhKD,wCAgKC","sourcesContent":["import {IccAuthApi, IccHcpartyApi} from '../icc-api'\nimport { HealthcareParty } from '../icc-api/model/HealthcareParty'\nimport * as models from '../icc-api/model/models'\nimport { findName, garnishPersonWithName, hasName } from './utils/person-util'\nimport { AuthenticationProvider, NoAuthenticationProvider } from './auth/AuthenticationProvider'\nimport {AbstractFilter} from \"./filters/filters\";\nimport {subscribeToEntityEvents, SubscriptionOptions} from \"./utils\";\nimport {Connection, ConnectionImpl} from \"../icc-api/model/Connection\";\n\n// noinspection JSUnusedGlobalSymbols\nexport class IccHcpartyXApi extends IccHcpartyApi {\n hcPartyKeysCache: { [key: string]: { [key: string]: string } } = {}\n hcPartyCache: { [key: string]: [number, Promise<HealthcareParty>] } = {}\n\n private CACHE_RETENTION_IN_MS = 300_000\n constructor(\n host: string,\n headers: { [key: string]: string },\n authenticationProvider: AuthenticationProvider = new NoAuthenticationProvider(),\n private readonly authApi: IccAuthApi,\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch\n ) {\n super(host, headers, authenticationProvider, fetchImpl)\n }\n\n private getHcPartyFromCache(key: string) {\n const hcpInCache = this.hcPartyCache[key]\n const now = Date.now()\n if (hcpInCache && hcpInCache[0] > now) {\n return hcpInCache[1]\n }\n if (!hcpInCache) {\n console.log(`Cache miss for key ${key} because not in cache`)\n } else {\n console.log(`Cache miss for key ${key} because ${hcpInCache[0]} > ${now}`)\n }\n return null\n }\n\n completeNames(hcParty?: models.HealthcareParty): models.HealthcareParty | undefined {\n if (!hcParty) {\n return hcParty\n }\n\n let finalHcParty = hcParty\n\n if ((!!finalHcParty.lastName || !!finalHcParty.name) && !hasName(finalHcParty, models.PersonName.UseEnum.Official)) {\n finalHcParty = garnishPersonWithName(\n finalHcParty,\n models.PersonName.UseEnum.Official,\n finalHcParty.lastName,\n finalHcParty.firstName,\n finalHcParty.name\n )\n }\n\n if ((!finalHcParty.lastName || !finalHcParty.name) && !!hasName(finalHcParty, models.PersonName.UseEnum.Official)) {\n let officialName = findName(finalHcParty, models.PersonName.UseEnum.Official)\n finalHcParty = {\n ...finalHcParty,\n lastName: officialName!.lastName,\n firstName: officialName!.firstNames ? officialName!.firstNames[0] : undefined,\n name: officialName!.text,\n }\n }\n\n return finalHcParty\n }\n\n putHcPartyInCache(key: string, value: Promise<HealthcareParty> | null = null): Promise<HealthcareParty> {\n const hcp =\n value ||\n super.getHealthcareParty(key).catch((e) => {\n console.log(`Evict key ${key} because of error`)\n delete this.hcPartyCache[key]\n throw e\n })\n this.hcPartyCache[key] = [Date.now() + this.CACHE_RETENTION_IN_MS, hcp]\n return hcp\n }\n\n createHealthcareParty(body?: HealthcareParty): Promise<HealthcareParty> {\n return super.createHealthcareParty(this.completeNames(body))\n }\n\n createHealthcarePartyInGroup(groupId: string, body?: HealthcareParty): Promise<HealthcareParty> {\n return super.createHealthcarePartyInGroup(groupId, this.completeNames(body))\n }\n\n modifyHealthcareParty(body?: HealthcareParty): Promise<HealthcareParty | any> {\n if (body && body.id) {\n console.log(`Evict key ${body.id} because of modification`)\n delete this.hcPartyCache[body.id]\n }\n\n return super.modifyHealthcareParty(this.completeNames(body)).then((hcp) => this.putHcPartyInCache(hcp.id!, Promise.resolve(hcp)))\n }\n\n getHealthcareParty(healthcarePartyId: string, bypassCache = false): Promise<HealthcareParty | any> {\n const fromCache = bypassCache ? undefined : this.getHcPartyFromCache(healthcarePartyId)\n return fromCache || this.putHcPartyInCache(healthcarePartyId)\n }\n\n getHealthcarePartyHierarchyIds(healthcarePartyId: string, bypassCache = false): Promise<string[]> {\n const fromCache = bypassCache ? undefined : this.getHcPartyFromCache(healthcarePartyId)\n return (fromCache || this.putHcPartyInCache(healthcarePartyId)).then(async (hcp: HealthcareParty) => {\n return hcp ? (hcp.parentId ? (await this.getHealthcarePartyHierarchyIds(hcp.parentId!, bypassCache)).concat([hcp.id!]) : [hcp.id!]) : []\n })\n }\n\n getHealthcareParties(healthcarePartyIds: string): Promise<Array<HealthcareParty> | any> {\n const ids = healthcarePartyIds.split(',').filter((x) => !!x)\n const cached: Array<[string, Promise<HealthcareParty> | null]> = ids.map((id) => [id, this.getHcPartyFromCache(id)])\n const toFetch = cached.filter((x) => !x[1]).map((x) => x[0])\n\n if (!toFetch.length) {\n return Promise.all(cached.map((x) => x[1]!))\n }\n\n const prom: Promise<HealthcareParty[]> = super.getHealthcareParties(toFetch.join(','))\n return Promise.all(\n cached.map(\n (x) =>\n x[1] ||\n this.putHcPartyInCache(\n x[0],\n prom.then((hcps) => hcps.find((h) => h.id === x[0])!)\n )\n )\n )\n }\n\n getCurrentHealthcareParty(): Promise<HealthcareParty> {\n return super.getCurrentHealthcareParty().then((hcp) => this.putHcPartyInCache(hcp.id!, Promise.resolve(hcp)))\n }\n\n getHcPartyKeysForDelegate(healthcarePartyId: string, bypassCache = false): Promise<{ [key: string]: string }> {\n const cached = bypassCache ? null : this.hcPartyKeysCache[healthcarePartyId]\n return cached\n ? Promise.resolve(cached)\n : super.getHcPartyKeysForDelegate(healthcarePartyId).then((r) => (this.hcPartyKeysCache[healthcarePartyId] = r))\n }\n\n isValidCbe(cbe: string) {\n cbe = cbe.replace(new RegExp('[^(0-9)]', 'g'), '')\n cbe = cbe.length == 9 ? '0' + cbe : cbe\n\n return 97 - (Number(cbe.substring(0, 8)) % 97) === Number(cbe.substring(8, 2))\n }\n\n async subscribeToHealthcarePartyEvents(\n eventTypes: ('CREATE' | 'UPDATE' | 'DELETE')[],\n filter: AbstractFilter<HealthcareParty> | undefined,\n eventFired: (dataSample: HealthcareParty) => Promise<void>,\n options: SubscriptionOptions = {}\n ): Promise<Connection> {\n return subscribeToEntityEvents(\n this.host,\n this.authApi,\n 'HealthcareParty',\n eventTypes,\n filter,\n eventFired,\n options,\n ).then((rs) => new ConnectionImpl(rs))\n }\n}\n"]}
1
+ {"version":3,"file":"icc-hcparty-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-hcparty-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAsD;AAEtD,kDAAiD;AACjD,qDAA8E;AAC9E,0EAAgG;AAEhG,mCAAsE;AACtE,4DAAwE;AACxE,oDAAmD;AAEnD,qCAAqC;AACrC,MAAa,cAAe,SAAQ,uBAAa;IAK/C,YACE,IAAY,EACZ,OAAkC,EAClC,yBAAiD,IAAI,iDAAwB,EAAE,EAC9D,OAAmB,EACpC,YAA2E,OAAO,MAAM,KAAK,WAAW;QACtG,CAAC,CAAC,MAAM,CAAC,KAAK;QACd,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW;YAC7B,CAAC,CAAC,IAAI,CAAC,KAAK;YACZ,CAAC,CAAC,KAAK;QAET,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,sBAAsB,EAAE,SAAS,CAAC,CAAA;QAPtC,YAAO,GAAP,OAAO,CAAY;QARtC,qBAAgB,GAAiD,EAAE,CAAA;QACnE,iBAAY,GAA0D,EAAE,CAAA;QAEhE,0BAAqB,GAAG,MAAO,CAAA;IAavC,CAAC;IAEO,mBAAmB,CAAC,GAAW;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;QACzC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QACtB,IAAI,UAAU,IAAI,UAAU,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE;YACrC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAA;SACrB;QACD,IAAI,CAAC,UAAU,EAAE;YACf,OAAO,CAAC,GAAG,CAAC,sBAAsB,GAAG,uBAAuB,CAAC,CAAA;SAC9D;aAAM;YACL,OAAO,CAAC,GAAG,CAAC,sBAAsB,GAAG,YAAY,UAAU,CAAC,CAAC,CAAC,MAAM,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MAAM,CAAC;YACzB,CAAC,CAAC,KAAK,CAAC,yBAAyB,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IACpH,CAAC;IAED,UAAU,CAAC,GAAW;QACpB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAA;QAClD,GAAG,GAAG,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAA;QAEvC,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IAChF,CAAC;IAEK,gCAAgC,CACpC,UAA8C,EAC9C,MAAmD,EACnD,UAA0D,EAC1D,UAA+B,EAAE;;YAEjC,OAAO,IAAA,+BAAuB,EAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CACtH,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,2BAAc,CAAC,EAAE,CAAC,CAC/B,CAAA;QACH,CAAC;KAAA;CACF;AA7JD,wCA6JC","sourcesContent":["import { IccAuthApi, IccHcpartyApi } from '../icc-api'\nimport { HealthcareParty } from '../icc-api/model/HealthcareParty'\nimport * as models from '../icc-api/model/models'\nimport { findName, garnishPersonWithName, hasName } from './utils/person-util'\nimport { AuthenticationProvider, NoAuthenticationProvider } from './auth/AuthenticationProvider'\nimport { AbstractFilter } from './filters/filters'\nimport { subscribeToEntityEvents, SubscriptionOptions } from './utils'\nimport { Connection, ConnectionImpl } from '../icc-api/model/Connection'\nimport { ListOfIds } from '../icc-api/model/models'\n\n// noinspection JSUnusedGlobalSymbols\nexport class IccHcpartyXApi extends IccHcpartyApi {\n hcPartyKeysCache: { [key: string]: { [key: string]: string } } = {}\n hcPartyCache: { [key: string]: [number, Promise<HealthcareParty>] } = {}\n\n private CACHE_RETENTION_IN_MS = 300_000\n constructor(\n host: string,\n headers: { [key: string]: string },\n authenticationProvider: AuthenticationProvider = new NoAuthenticationProvider(),\n private readonly authApi: IccAuthApi,\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch\n ) {\n super(host, headers, authenticationProvider, fetchImpl)\n }\n\n private getHcPartyFromCache(key: string) {\n const hcpInCache = this.hcPartyCache[key]\n const now = Date.now()\n if (hcpInCache && hcpInCache[0] > now) {\n return hcpInCache[1]\n }\n if (!hcpInCache) {\n console.log(`Cache miss for key ${key} because not in cache`)\n } else {\n console.log(`Cache miss for key ${key} because ${hcpInCache[0]} > ${now}`)\n }\n return null\n }\n\n completeNames(hcParty?: models.HealthcareParty): models.HealthcareParty | undefined {\n if (!hcParty) {\n return hcParty\n }\n\n let finalHcParty = hcParty\n\n if ((!!finalHcParty.lastName || !!finalHcParty.name) && !hasName(finalHcParty, models.PersonName.UseEnum.Official)) {\n finalHcParty = garnishPersonWithName(\n finalHcParty,\n models.PersonName.UseEnum.Official,\n finalHcParty.lastName,\n finalHcParty.firstName,\n finalHcParty.name\n )\n }\n\n if ((!finalHcParty.lastName || !finalHcParty.name) && !!hasName(finalHcParty, models.PersonName.UseEnum.Official)) {\n let officialName = findName(finalHcParty, models.PersonName.UseEnum.Official)\n finalHcParty = {\n ...finalHcParty,\n lastName: officialName!.lastName,\n firstName: officialName!.firstNames ? officialName!.firstNames[0] : undefined,\n name: officialName!.text,\n }\n }\n\n return finalHcParty\n }\n\n putHcPartyInCache(key: string, value: Promise<HealthcareParty> | null = null): Promise<HealthcareParty> {\n const hcp =\n value ||\n super.getHealthcareParty(key).catch((e) => {\n console.log(`Evict key ${key} because of error`)\n delete this.hcPartyCache[key]\n throw e\n })\n this.hcPartyCache[key] = [Date.now() + this.CACHE_RETENTION_IN_MS, hcp]\n return hcp\n }\n\n createHealthcareParty(body?: HealthcareParty): Promise<HealthcareParty> {\n return super.createHealthcareParty(this.completeNames(body))\n }\n\n createHealthcarePartyInGroup(groupId: string, body?: HealthcareParty): Promise<HealthcareParty> {\n return super.createHealthcarePartyInGroup(groupId, this.completeNames(body))\n }\n\n modifyHealthcareParty(body?: HealthcareParty): Promise<HealthcareParty | any> {\n if (body && body.id) {\n console.log(`Evict key ${body.id} because of modification`)\n delete this.hcPartyCache[body.id]\n }\n\n return super.modifyHealthcareParty(this.completeNames(body)).then((hcp) => this.putHcPartyInCache(hcp.id!, Promise.resolve(hcp)))\n }\n\n getHealthcareParty(healthcarePartyId: string, bypassCache = false): Promise<HealthcareParty | any> {\n const fromCache = bypassCache ? undefined : this.getHcPartyFromCache(healthcarePartyId)\n return fromCache || this.putHcPartyInCache(healthcarePartyId)\n }\n\n getHealthcarePartyHierarchyIds(healthcarePartyId: string, bypassCache = false): Promise<string[]> {\n const fromCache = bypassCache ? undefined : this.getHcPartyFromCache(healthcarePartyId)\n return (fromCache || this.putHcPartyInCache(healthcarePartyId)).then(async (hcp: HealthcareParty) => {\n return hcp ? (hcp.parentId ? (await this.getHealthcarePartyHierarchyIds(hcp.parentId!, bypassCache)).concat([hcp.id!]) : [hcp.id!]) : []\n })\n }\n\n getHealthcareParties(healthcarePartyIds: ListOfIds): Promise<Array<HealthcareParty> | any> {\n const ids = healthcarePartyIds.ids\n if (!ids || !ids.length) {\n return Promise.resolve([])\n }\n const cached: Array<[string, Promise<HealthcareParty> | null]> = ids.map((id) => [id, this.getHcPartyFromCache(id)])\n const toFetch = cached.filter((x) => !x[1]).map((x) => x[0])\n\n if (!toFetch.length) {\n return Promise.all(cached.map((x) => x[1]!))\n }\n\n const prom: Promise<HealthcareParty[]> = super.getHealthcareParties(new ListOfIds({ ids: toFetch }))\n return Promise.all(\n cached.map(\n (x) =>\n x[1] ||\n this.putHcPartyInCache(\n x[0],\n prom.then((hcps) => hcps.find((h) => h.id === x[0])!)\n )\n )\n )\n }\n\n getCurrentHealthcareParty(): Promise<HealthcareParty> {\n return super.getCurrentHealthcareParty().then((hcp) => this.putHcPartyInCache(hcp.id!, Promise.resolve(hcp)))\n }\n\n getHcPartyKeysForDelegate(healthcarePartyId: string, bypassCache = false): Promise<{ [key: string]: string }> {\n const cached = bypassCache ? null : this.hcPartyKeysCache[healthcarePartyId]\n return cached\n ? Promise.resolve(cached)\n : super.getHcPartyKeysForDelegate(healthcarePartyId).then((r) => (this.hcPartyKeysCache[healthcarePartyId] = r))\n }\n\n isValidCbe(cbe: string) {\n cbe = cbe.replace(new RegExp('[^(0-9)]', 'g'), '')\n cbe = cbe.length == 9 ? '0' + cbe : cbe\n\n return 97 - (Number(cbe.substring(0, 8)) % 97) === Number(cbe.substring(8, 2))\n }\n\n async subscribeToHealthcarePartyEvents(\n eventTypes: ('CREATE' | 'UPDATE' | 'DELETE')[],\n filter: AbstractFilter<HealthcareParty> | undefined,\n eventFired: (dataSample: HealthcareParty) => Promise<void>,\n options: SubscriptionOptions = {}\n ): Promise<Connection> {\n return subscribeToEntityEvents(this.host, this.authApi, 'HealthcareParty', eventTypes, filter, eventFired, options).then(\n (rs) => new ConnectionImpl(rs)\n )\n }\n}\n"]}
@@ -159,12 +159,15 @@ export interface IcureApiOptions {
159
159
  readonly encryptedFieldsConfig?: EncryptedFieldsConfig;
160
160
  /**
161
161
  * Each user may exist in multiple groups, but an instance of {@link IcureApi} is specialised for a single group. This function allows you to decide
162
- * the group to use for a given user. This functions will be called only if a user exists in at least 2 groups, takes in input the information on
163
- * the groups the user can access (in no specific order) and must return the id of one of these groups.
162
+ * the group to use for a given user.
163
+ * This functions will be called only if a user exists in at least 2 groups, and takes in input:
164
+ * - the information on the groups the user can access (in no specific order)
165
+ * - if the authentication method uses JWT also the current group id (undefined otherwise)
166
+ * The function must return the id of one of the available groups.
164
167
  * @default takes the first group provided. The group chosen by this method may vary between different instantiations of the {@link IcureApi} even
165
168
  * if for the same user and if the groups available for the user do not change.
166
169
  */
167
- readonly groupSelector?: (availableGroupsInfo: UserGroup[]) => Promise<string>;
170
+ readonly groupSelector?: (availableGroupsInfo: UserGroup[], currentGroupId?: string) => Promise<string>;
168
171
  /**
169
172
  * Temporary value to support EHR Lite and MedTech api implementations.
170
173
  *
@@ -84,6 +84,7 @@ const KeyPairRecoverer_1 = require("./crypto/KeyPairRecoverer");
84
84
  const IccRecoveryDataApi_1 = require("../icc-api/api/internal/IccRecoveryDataApi");
85
85
  const RecoveryDataEncryption_1 = require("./crypto/RecoveryDataEncryption");
86
86
  const icc_recovery_x_api_1 = require("./icc-recovery-x-api");
87
+ const JwtUtils_1 = require("./auth/JwtUtils");
87
88
  __exportStar(require("./icc-accesslog-x-api"), exports);
88
89
  __exportStar(require("./icc-bekmehr-x-api"), exports);
89
90
  __exportStar(require("./icc-calendar-item-x-api"), exports);
@@ -170,15 +171,14 @@ var IcureApi;
170
171
  // TODO if this uses a smart auth provider the groupless auth provider does not share the secret cache with the group specific one.
171
172
  const grouplessUserApi = new icc_api_1.IccUserApi(host, params.headers, grouplessAuthenticationProvider, fetchImpl);
172
173
  const matches = yield getMatchesOrEmpty(grouplessUserApi);
173
- const chosenGroupId = matches.length > 1 && !!options.groupSelector ? yield options.groupSelector(matches) : (_a = matches[0]) === null || _a === void 0 ? void 0 : _a.groupId;
174
- const groupSpecificAuthenticationProviderInfo = matches.length > 1 && chosenGroupId
175
- ? yield grouplessAuthenticationProvider.switchGroup(chosenGroupId, matches)
176
- : { switchedProvider: grouplessAuthenticationProvider, isGroupLocked: false };
174
+ const tokens = yield grouplessAuthenticationProvider.getIcureTokens();
175
+ const currentGroupId = tokens ? (0, JwtUtils_1.getGroupOfJwt)(tokens.token) : undefined;
176
+ const chosenGroupId = matches.length > 1 && !!options.groupSelector ? yield options.groupSelector(matches, currentGroupId) : (_a = matches[0]) === null || _a === void 0 ? void 0 : _a.groupId;
177
177
  /*TODO
178
178
  * On new very new users switching the authentication provider to a specific group may fail and block the user for too many requests. This is
179
179
  * probably linked to replication of the user in the fallback database.
180
180
  */
181
- const groupSpecificAuthenticationProvider = matches.length > 1 && chosenGroupId
181
+ const groupSpecificAuthenticationProvider = matches.length > 1 && chosenGroupId && chosenGroupId !== currentGroupId
182
182
  ? yield grouplessAuthenticationProvider.switchGroup(chosenGroupId, matches)
183
183
  : grouplessAuthenticationProvider;
184
184
  const cryptoInitInfo = yield initialiseCryptoWithProvider(host, fetchImpl, groupSpecificAuthenticationProvider, params, cryptoStrategies, crypto);