@icure/api 6.4.2 → 6.4.3

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 (43) hide show
  1. package/icc-api/api/IccAuthApi.d.ts +19 -0
  2. package/icc-api/api/IccAuthApi.js +46 -1
  3. package/icc-api/api/IccAuthApi.js.map +1 -1
  4. package/icc-api/api/IccBesamv2Api.d.ts +6 -0
  5. package/icc-api/api/IccBesamv2Api.js +13 -0
  6. package/icc-api/api/IccBesamv2Api.js.map +1 -1
  7. package/icc-api/api/IccGroupApi.d.ts +6 -0
  8. package/icc-api/api/IccGroupApi.js +13 -0
  9. package/icc-api/api/IccGroupApi.js.map +1 -1
  10. package/icc-api/index.d.ts +0 -1
  11. package/icc-api/index.js +0 -1
  12. package/icc-api/index.js.map +1 -1
  13. package/icc-api/model/AuthenticationToken.d.ts +1 -0
  14. package/icc-api/model/AuthenticationToken.js.map +1 -1
  15. package/icc-api/model/FlatRateTarification.d.ts +4 -1
  16. package/icc-api/model/FlatRateTarification.js +3 -0
  17. package/icc-api/model/FlatRateTarification.js.map +1 -1
  18. package/icc-api/model/UserGroup.d.ts +1 -0
  19. package/icc-api/model/UserGroup.js.map +1 -1
  20. package/icc-x-api/auth/AuthenticationProvider.d.ts +34 -2
  21. package/icc-x-api/auth/AuthenticationProvider.js +28 -6
  22. package/icc-x-api/auth/AuthenticationProvider.js.map +1 -1
  23. package/icc-x-api/auth/EnsembleAuthService.d.ts +6 -2
  24. package/icc-x-api/auth/EnsembleAuthService.js +9 -0
  25. package/icc-x-api/auth/EnsembleAuthService.js.map +1 -1
  26. package/icc-x-api/auth/JwtAuthService.d.ts +5 -4
  27. package/icc-x-api/auth/JwtAuthService.js +7 -20
  28. package/icc-x-api/auth/JwtAuthService.js.map +1 -1
  29. package/icc-x-api/auth/JwtBridgedAuthService.d.ts +26 -0
  30. package/icc-x-api/auth/JwtBridgedAuthService.js +128 -0
  31. package/icc-x-api/auth/JwtBridgedAuthService.js.map +1 -0
  32. package/icc-x-api/filters/ServiceByHcPartyTagCodeDateFilter.d.ts +1 -0
  33. package/icc-x-api/filters/ServiceByHcPartyTagCodeDateFilter.js.map +1 -1
  34. package/icc-x-api/icc-crypto-x-api.d.ts +3 -5
  35. package/icc-x-api/icc-crypto-x-api.js +46 -50
  36. package/icc-x-api/icc-crypto-x-api.js.map +1 -1
  37. package/icc-x-api/index.d.ts +7 -2
  38. package/icc-x-api/index.js +6 -4
  39. package/icc-x-api/index.js.map +1 -1
  40. package/package.json +1 -1
  41. package/icc-api/api/IccBemikronoApi.d.ts +0 -81
  42. package/icc-api/api/IccBemikronoApi.js +0 -162
  43. package/icc-api/api/IccBemikronoApi.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"IccGroupApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccGroupApi.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAE3B,0CAAsC;AACtC,oEAAgE;AAChE,sEAAkE;AAClE,kDAA8C;AAG9C,oEAAgE;AAEhE,sEAAkE;AAClE,8DAA0D;AAC1D,wCAAoC;AACpC,wFAA8G;AAE9G,MAAa,WAAW;IAMtB,YACE,IAAY,EACZ,OAAY,EACZ,sBAA+C,EAC/C,SAAyE;QAEzE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,OAAO,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;QAC7E,IAAI,CAAC,sBAAsB,GAAG,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,IAAI,iDAAwB,EAAE,CAAA;QAChH,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IAED,UAAU,CAA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AAE,KAAc,EAAE,MAAgB;QACzD,IAAI,KAAK,GAAG,IAAI,CAAA;QAEhB,MAAM,IAAI,GACR,IAAI,CAAC,IAAI;YACT,UAAU,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,YAAY;YACpD,MAAM;YACN,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;YACpB,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,GAAG,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5D,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,GAAG,kBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;QACjE,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAC1B,OAAO,SAAG,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,sBAAsB,CAAC,cAAc,EAAE,CAAC;aAC1H,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAE,GAAG,CAAC,IAAoB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,qBAAS,CAAC,EAAE,CAAC,CAAC,CAAC;aACvE,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;IAC1C,CAAC;CACF;AAtXD,kCAsXC","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 { DatabaseInitialisation } from '../model/DatabaseInitialisation'\nimport { Group } from '../model/Group'\nimport { GroupDatabasesInfo } from '../model/GroupDatabasesInfo'\nimport { GroupDeletionReport } from '../model/GroupDeletionReport'\nimport { IdWithRev } from '../model/IdWithRev'\nimport { ListOfIds } from '../model/ListOfIds'\nimport { ListOfProperties } from '../model/ListOfProperties'\nimport { PaginatedListGroup } from '../model/PaginatedListGroup'\nimport { RegistrationInformation } from '../model/RegistrationInformation'\nimport { RegistrationSuccess } from '../model/RegistrationSuccess'\nimport { ReplicationInfo } from '../model/ReplicationInfo'\nimport { Unit } from '../model/Unit'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\n\nexport class IccGroupApi {\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 = 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 * Create a new group and associated dbs. The created group will be manageable by the users that belong to the same group as the one that called createGroup. Several tasks can be executed during the group creation like DB replications towards the created DBs, users creation and healthcare parties creation\n * @summary Create a group\n * @param body\n * @param id The id of the group, also used for subsequent authentication against the db (can only contain digits, letters, - and _)\n * @param name The name of the group\n * @param type The type of the group.\n * @param password The password of the group (can only contain digits, letters, - and _)\n * @param server The server on which the group dbs will be created\n * @param q The number of shards for patient and healthdata dbs : 3-8 is a recommended range of value\n * @param n The number of replications for dbs : 3 is a recommended value\n * @param superGroup Group parent\n */\n createGroup(\n id: string,\n name: string,\n password: string,\n server?: string,\n q?: number,\n n?: number,\n superGroup?: string,\n type?: string,\n body?: DatabaseInitialisation\n ): Promise<Group> {\n let _body = null\n _body = body\n\n const _url =\n this.host +\n `/group/${encodeURIComponent(String(id))}` +\n '?ts=' +\n new Date().getTime() +\n (name ? '&name=' + encodeURIComponent(String(name)) : '') +\n (type ? '&type=' + encodeURIComponent(String(type)) : '') +\n (server ? '&server=' + encodeURIComponent(String(server)) : '') +\n (q ? '&q=' + encodeURIComponent(String(q)) : '') +\n (n ? '&n=' + encodeURIComponent(String(n)) : '') +\n (superGroup ? '&superGroup=' + encodeURIComponent(String(superGroup)) : '')\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n password && (headers = headers.concat(new XHR.Header('password', password)))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Group(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Delete group without reset or deleteing storage\n * @summary Delete group\n * @param id The id of group to delete\n */\n deleteGroup(id: string): Promise<Group> {\n let _body = null\n\n const _url = this.host + `/group/${encodeURIComponent(String(id))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Group(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * List groups that are the children of the group with the provided parent id\n * @summary Find groups by parent\n * @param id The id of the group\n * @param startDocumentId A group document ID used as a cursor for pagination\n * @param limit Number of rows\n */\n findGroups(id: string, startDocumentId?: string, limit?: number): Promise<PaginatedListGroup> {\n let _body = null\n\n const _url =\n this.host +\n `/group/${encodeURIComponent(String(id))}/children` +\n '?ts=' +\n new Date().getTime() +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\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 PaginatedListGroup(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * List groups that are the children of the group with the provided parent id and that match the provided search string\n * @summary Find groups by parent and content\n * @param id The id of the group\n * @param searchString The string to search for in the group. Properties, name and id are scanned for the provided search string.\n * @param startKey The start key for pagination, depends on the filters used\n * @param startDocumentId A group document ID used as a cursor for pagination\n * @param limit Number of rows\n */\n findGroupsWithContent(id: string, searchString: string, startKey?: string, startDocumentId?: string, limit?: number): Promise<PaginatedListGroup> {\n let _body = null\n\n const _url =\n this.host +\n `/group/${encodeURIComponent(String(id))}/children/search` +\n '?ts=' +\n new Date().getTime() +\n (searchString ? '&searchString=' + encodeURIComponent(String(searchString)) : '') +\n (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\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 PaginatedListGroup(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Get a group by id\n * @summary Get a group by id\n * @param id The id of the group\n */\n getGroup(id: string): Promise<Group> {\n let _body = null\n\n const _url = this.host + `/group/${encodeURIComponent(String(id))}` + '?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 Group(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Reset storage\n * @summary Reset storage for group\n * @param body\n */\n getGroupsStorageInfos(body?: ListOfIds): Promise<Array<GroupDatabasesInfo>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/group/storage/info` + '?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 GroupDatabasesInfo(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get index info\n * @param id The id of the group\n */\n getReplicationInfo1(id: string): Promise<ReplicationInfo> {\n let _body = null\n\n const _url = this.host + `/group/${encodeURIComponent(String(id))}/r` + '?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 ReplicationInfo(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Hard deletes the provided group from CouchDB. This operation can only be done by an admin user\n * @summary Hard delete group\n * @param id The id of group to delete\n */\n hardDeleteGroup(id: string): Promise<Array<GroupDeletionReport>> {\n let _body = null\n\n const _url = this.host + `/group/hard/${encodeURIComponent(String(id))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new GroupDeletionReport(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Init design docs for provided group\n * @summary Init design docs\n * @param id The id of the group\n * @param clazz The class of the design doc\n * @param warmup Warmup the design doc\n */\n initDesignDocs(id: string, clazz?: string, warmup?: boolean): Promise<Unit> {\n let _body = null\n\n const _url =\n this.host +\n `/group/${encodeURIComponent(String(id))}/dd` +\n '?ts=' +\n new Date().getTime() +\n (clazz ? '&clazz=' + encodeURIComponent(String(clazz)) : '') +\n (warmup ? '&warmup=' + encodeURIComponent(String(warmup)) : '')\n let headers = this.headers\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Unit(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * List available apps for user\n * @summary List apps\n */\n listApps(): Promise<Array<Group>> {\n let _body = null\n\n const _url = this.host + `/group/apps` + '?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 Group(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * List existing groups\n * @summary List groups\n */\n listGroups(): Promise<Array<Group>> {\n let _body = null\n\n const _url = this.host + `/group` + '?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 Group(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Update existing group name\n * @summary Update group name\n * @param id The id of the group\n * @param name The new name for the group\n */\n modifyGroupName(id: string, name: string): Promise<Group> {\n let _body = null\n\n const _url = this.host + `/group/${encodeURIComponent(String(id))}/name/${encodeURIComponent(String(name))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Group(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Update existing group properties\n * @summary Update group properties\n * @param body\n * @param id The id of the group\n */\n modifyGroupProperties(id: string, body?: ListOfProperties): Promise<Group> {\n let _body = null\n _body = body\n\n const _url = this.host + `/group/${encodeURIComponent(String(id))}/properties` + '?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 Group(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Create a new group and associated dbs. The created group will be manageable by the users that belong to the same group as the one that called createGroup. Several tasks can be executed during the group creation like DB replications towards the created DBs, users creation and healthcare parties creation\n * @summary Create a group\n * @param body\n * @param type The tyoe of the group (default: root)\n * @param role The role of the user (default: admin)\n */\n registerNewGroupAdministrator(type?: string, role?: string, body?: RegistrationInformation): Promise<RegistrationSuccess> {\n let _body = null\n _body = body\n\n const _url =\n this.host +\n `/group/register/trial` +\n '?ts=' +\n new Date().getTime() +\n (type ? '&type=' + encodeURIComponent(String(type)) : '') +\n (role ? '&role=' + encodeURIComponent(String(role)) : '')\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 RegistrationSuccess(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Reset storage\n * @summary Reset storage for group\n * @param body\n * @param id The id of the group\n * @param q The number of shards for patient and healthdata dbs : 3-8 is a recommended range of value\n * @param n The number of replications for dbs : 3 is a recommended value\n */\n resetStorage(id: string, q?: number, n?: number, body?: ListOfIds): Promise<Unit> {\n let _body = null\n _body = body\n\n const _url =\n this.host +\n `/group/${encodeURIComponent(String(id))}/reset/storage` +\n '?ts=' +\n new Date().getTime() +\n (q ? '&q=' + encodeURIComponent(String(q)) : '') +\n (n ? '&n=' + encodeURIComponent(String(n)) : '')\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 Unit(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Update password for provided group\n * @summary Set group password\n * @param id The id of the group\n * @param password The new password for the group (can only contain digits, letters, - and _)\n */\n setGroupPassword(id: string, password: string): Promise<Group> {\n let _body = null\n\n const _url = this.host + `/group/${encodeURIComponent(String(id))}/password` + '?ts=' + new Date().getTime()\n let headers = this.headers\n password && (headers = headers.concat(new XHR.Header('password', password)))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Group(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Solve conflicts for group\n * @summary Solve conflicts for group\n * @param id The id of the group\n * @param limit Solve at most limit conflicts\n * @param warmup Warmup the design doc\n */\n solveConflicts(id: string, limit?: number, warmup?: boolean): Promise<Array<IdWithRev>> {\n let _body = null\n\n const _url =\n this.host +\n `/group/${encodeURIComponent(String(id))}/conflicts` +\n '?ts=' +\n new Date().getTime() +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +\n (warmup ? '&warmup=' + encodeURIComponent(String(warmup)) : '')\n let headers = 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 IdWithRev(it)))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
1
+ {"version":3,"file":"IccGroupApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccGroupApi.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAE3B,0CAAsC;AACtC,oEAAgE;AAChE,sEAAkE;AAClE,kDAA8C;AAG9C,oEAAgE;AAEhE,sEAAkE;AAClE,8DAA0D;AAC1D,wCAAoC;AACpC,wFAA8G;AAE9G,MAAa,WAAW;IAMtB,YACE,IAAY,EACZ,OAAY,EACZ,sBAA+C,EAC/C,SAAyE;QAEzE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,OAAO,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;QAC7E,IAAI,CAAC,sBAAsB,GAAG,CAAC,CAAC,sBAAsB,CAA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E,CAAC,CAAA;QACjE,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAC1B,OAAO,SAAG,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,sBAAsB,CAAC,cAAc,EAAE,CAAC;aAC1H,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAE,GAAG,CAAC,IAAoB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,qBAAS,CAAC,EAAE,CAAC,CAAC,CAAC;aACvE,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;IAC1C,CAAC;CACF;AArYD,kCAqYC","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 { DatabaseInitialisation } from '../model/DatabaseInitialisation'\nimport { Group } from '../model/Group'\nimport { GroupDatabasesInfo } from '../model/GroupDatabasesInfo'\nimport { GroupDeletionReport } from '../model/GroupDeletionReport'\nimport { IdWithRev } from '../model/IdWithRev'\nimport { ListOfIds } from '../model/ListOfIds'\nimport { ListOfProperties } from '../model/ListOfProperties'\nimport { PaginatedListGroup } from '../model/PaginatedListGroup'\nimport { RegistrationInformation } from '../model/RegistrationInformation'\nimport { RegistrationSuccess } from '../model/RegistrationSuccess'\nimport { ReplicationInfo } from '../model/ReplicationInfo'\nimport { Unit } from '../model/Unit'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\n\nexport class IccGroupApi {\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 = 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 * Create a new group and associated dbs. The created group will be manageable by the users that belong to the same group as the one that called createGroup. Several tasks can be executed during the group creation like DB replications towards the created DBs, users creation and healthcare parties creation\n * @summary Create a group\n * @param body\n * @param id The id of the group, also used for subsequent authentication against the db (can only contain digits, letters, - and _)\n * @param name The name of the group\n * @param type The type of the group.\n * @param password The password of the group (can only contain digits, letters, - and _)\n * @param server The server on which the group dbs will be created\n * @param q The number of shards for patient and healthdata dbs : 3-8 is a recommended range of value\n * @param n The number of replications for dbs : 3 is a recommended value\n * @param superGroup Group parent\n */\n createGroup(\n id: string,\n name: string,\n password: string,\n server?: string,\n q?: number,\n n?: number,\n superGroup?: string,\n type?: string,\n body?: DatabaseInitialisation\n ): Promise<Group> {\n let _body = null\n _body = body\n\n const _url =\n this.host +\n `/group/${encodeURIComponent(String(id))}` +\n '?ts=' +\n new Date().getTime() +\n (name ? '&name=' + encodeURIComponent(String(name)) : '') +\n (type ? '&type=' + encodeURIComponent(String(type)) : '') +\n (server ? '&server=' + encodeURIComponent(String(server)) : '') +\n (q ? '&q=' + encodeURIComponent(String(q)) : '') +\n (n ? '&n=' + encodeURIComponent(String(n)) : '') +\n (superGroup ? '&superGroup=' + encodeURIComponent(String(superGroup)) : '')\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n password && (headers = headers.concat(new XHR.Header('password', password)))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Group(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Delete group without reset or deleteing storage\n * @summary Delete group\n * @param id The id of group to delete\n */\n deleteGroup(id: string): Promise<Group> {\n let _body = null\n\n const _url = this.host + `/group/${encodeURIComponent(String(id))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Group(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * List groups that are the children of the group with the provided parent id\n * @summary Find groups by parent\n * @param id The id of the group\n * @param startDocumentId A group document ID used as a cursor for pagination\n * @param limit Number of rows\n */\n findGroups(id: string, startDocumentId?: string, limit?: number): Promise<PaginatedListGroup> {\n let _body = null\n\n const _url =\n this.host +\n `/group/${encodeURIComponent(String(id))}/children` +\n '?ts=' +\n new Date().getTime() +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\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 PaginatedListGroup(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * List groups that are the children of the group with the provided parent id and that match the provided search string\n * @summary Find groups by parent and content\n * @param id The id of the group\n * @param searchString The string to search for in the group. Properties, name and id are scanned for the provided search string.\n * @param startKey The start key for pagination, depends on the filters used\n * @param startDocumentId A group document ID used as a cursor for pagination\n * @param limit Number of rows\n */\n findGroupsWithContent(id: string, searchString: string, startKey?: string, startDocumentId?: string, limit?: number): Promise<PaginatedListGroup> {\n let _body = null\n\n const _url =\n this.host +\n `/group/${encodeURIComponent(String(id))}/children/search` +\n '?ts=' +\n new Date().getTime() +\n (searchString ? '&searchString=' + encodeURIComponent(String(searchString)) : '') +\n (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\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 PaginatedListGroup(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Get the name of the parent of the group identified by id\n * @summary Get a parent group name by id of the child\n * @param id The id of the child group\n */\n getNameOfParentGroup(id: string): Promise<string> {\n let _body = null\n\n const _url = this.host + `/group/${encodeURIComponent(String(id))}/parent/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 string)\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Get a group by id\n * @summary Get a group by id\n * @param id The id of the group\n */\n getGroup(id: string): Promise<Group> {\n let _body = null\n\n const _url = this.host + `/group/${encodeURIComponent(String(id))}` + '?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 Group(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Reset storage\n * @summary Reset storage for group\n * @param body\n */\n getGroupsStorageInfos(body?: ListOfIds): Promise<Array<GroupDatabasesInfo>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/group/storage/info` + '?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 GroupDatabasesInfo(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get index info\n * @param id The id of the group\n */\n getReplicationInfo1(id: string): Promise<ReplicationInfo> {\n let _body = null\n\n const _url = this.host + `/group/${encodeURIComponent(String(id))}/r` + '?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 ReplicationInfo(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Hard deletes the provided group from CouchDB. This operation can only be done by an admin user\n * @summary Hard delete group\n * @param id The id of group to delete\n */\n hardDeleteGroup(id: string): Promise<Array<GroupDeletionReport>> {\n let _body = null\n\n const _url = this.host + `/group/hard/${encodeURIComponent(String(id))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new GroupDeletionReport(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Init design docs for provided group\n * @summary Init design docs\n * @param id The id of the group\n * @param clazz The class of the design doc\n * @param warmup Warmup the design doc\n */\n initDesignDocs(id: string, clazz?: string, warmup?: boolean): Promise<Unit> {\n let _body = null\n\n const _url =\n this.host +\n `/group/${encodeURIComponent(String(id))}/dd` +\n '?ts=' +\n new Date().getTime() +\n (clazz ? '&clazz=' + encodeURIComponent(String(clazz)) : '') +\n (warmup ? '&warmup=' + encodeURIComponent(String(warmup)) : '')\n let headers = this.headers\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Unit(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * List available apps for user\n * @summary List apps\n */\n listApps(): Promise<Array<Group>> {\n let _body = null\n\n const _url = this.host + `/group/apps` + '?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 Group(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * List existing groups\n * @summary List groups\n */\n listGroups(): Promise<Array<Group>> {\n let _body = null\n\n const _url = this.host + `/group` + '?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 Group(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Update existing group name\n * @summary Update group name\n * @param id The id of the group\n * @param name The new name for the group\n */\n modifyGroupName(id: string, name: string): Promise<Group> {\n let _body = null\n\n const _url = this.host + `/group/${encodeURIComponent(String(id))}/name/${encodeURIComponent(String(name))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Group(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Update existing group properties\n * @summary Update group properties\n * @param body\n * @param id The id of the group\n */\n modifyGroupProperties(id: string, body?: ListOfProperties): Promise<Group> {\n let _body = null\n _body = body\n\n const _url = this.host + `/group/${encodeURIComponent(String(id))}/properties` + '?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 Group(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Create a new group and associated dbs. The created group will be manageable by the users that belong to the same group as the one that called createGroup. Several tasks can be executed during the group creation like DB replications towards the created DBs, users creation and healthcare parties creation\n * @summary Create a group\n * @param body\n * @param type The tyoe of the group (default: root)\n * @param role The role of the user (default: admin)\n */\n registerNewGroupAdministrator(type?: string, role?: string, body?: RegistrationInformation): Promise<RegistrationSuccess> {\n let _body = null\n _body = body\n\n const _url =\n this.host +\n `/group/register/trial` +\n '?ts=' +\n new Date().getTime() +\n (type ? '&type=' + encodeURIComponent(String(type)) : '') +\n (role ? '&role=' + encodeURIComponent(String(role)) : '')\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 RegistrationSuccess(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Reset storage\n * @summary Reset storage for group\n * @param body\n * @param id The id of the group\n * @param q The number of shards for patient and healthdata dbs : 3-8 is a recommended range of value\n * @param n The number of replications for dbs : 3 is a recommended value\n */\n resetStorage(id: string, q?: number, n?: number, body?: ListOfIds): Promise<Unit> {\n let _body = null\n _body = body\n\n const _url =\n this.host +\n `/group/${encodeURIComponent(String(id))}/reset/storage` +\n '?ts=' +\n new Date().getTime() +\n (q ? '&q=' + encodeURIComponent(String(q)) : '') +\n (n ? '&n=' + encodeURIComponent(String(n)) : '')\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 Unit(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Update password for provided group\n * @summary Set group password\n * @param id The id of the group\n * @param password The new password for the group (can only contain digits, letters, - and _)\n */\n setGroupPassword(id: string, password: string): Promise<Group> {\n let _body = null\n\n const _url = this.host + `/group/${encodeURIComponent(String(id))}/password` + '?ts=' + new Date().getTime()\n let headers = this.headers\n password && (headers = headers.concat(new XHR.Header('password', password)))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Group(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Solve conflicts for group\n * @summary Solve conflicts for group\n * @param id The id of the group\n * @param limit Solve at most limit conflicts\n * @param warmup Warmup the design doc\n */\n solveConflicts(id: string, limit?: number, warmup?: boolean): Promise<Array<IdWithRev>> {\n let _body = null\n\n const _url =\n this.host +\n `/group/${encodeURIComponent(String(id))}/conflicts` +\n '?ts=' +\n new Date().getTime() +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +\n (warmup ? '&warmup=' + encodeURIComponent(String(warmup)) : '')\n let headers = 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 IdWithRev(it)))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
@@ -6,7 +6,6 @@ export * from './api/IccArticleApi';
6
6
  export * from './api/IccAuthApi';
7
7
  export * from './api/IccBeefactApi';
8
8
  export * from './api/IccBekmehrApi';
9
- export * from './api/IccBemikronoApi';
10
9
  export * from './api/IccBeresultexportApi';
11
10
  export * from './api/IccBeresultimportApi';
12
11
  export * from './api/IccBesamv2Api';
package/icc-api/index.js CHANGED
@@ -22,7 +22,6 @@ __exportStar(require("./api/IccArticleApi"), exports);
22
22
  __exportStar(require("./api/IccAuthApi"), exports);
23
23
  __exportStar(require("./api/IccBeefactApi"), exports);
24
24
  __exportStar(require("./api/IccBekmehrApi"), exports);
25
- __exportStar(require("./api/IccBemikronoApi"), exports);
26
25
  __exportStar(require("./api/IccBeresultexportApi"), exports);
27
26
  __exportStar(require("./api/IccBeresultimportApi"), exports);
28
27
  __exportStar(require("./api/IccBesamv2Api"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../icc-api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAqC;AACrC,qDAAkC;AAClC,8DAA2C;AAC3C,kEAA+C;AAC/C,sDAAmC;AACnC,mDAAgC;AAChC,sDAAmC;AACnC,sDAAmC;AACnC,wDAAqC;AACrC,6DAA0C;AAC1C,6DAA0C;AAC1C,sDAAmC;AACnC,2DAAwC;AACxC,+DAA4C;AAC5C,6DAA0C;AAC1C,qEAAkD;AAClD,mDAAgC;AAChC,sDAAmC;AACnC,qDAAkC;AAClC,0DAAuC;AACvC,uDAAoC;AACpC,wDAAqC;AACrC,6DAA0C;AAC1C,mDAAgC;AAChC,gEAA6C;AAC7C,oDAAiC;AACjC,sDAAmC;AACnC,uDAAoC;AACpC,oDAAiC;AACjC,wDAAqC;AACrC,sDAAmC;AACnC,sDAAmC;AACnC,oDAAiC;AACjC,8DAA2C;AAC3C,sDAAmC;AACnC,sDAAmC;AACnC,yDAAsC;AACtC,oDAAiC;AACjC,qDAAkC;AAClC,sDAAmC;AACnC,0DAAuC;AACvC,2DAAwC;AACxC,wDAAqC;AACrC,kDAA+B;AAC/B,mDAAgC","sourcesContent":["export * from './api/IccAccesslogApi'\nexport * from './api/IccAgendaApi'\nexport * from './api/IccAnonymousAccessApi'\nexport * from './api/IccApplicationsettingsApi'\nexport * from './api/IccArticleApi'\nexport * from './api/IccAuthApi'\nexport * from './api/IccBeefactApi'\nexport * from './api/IccBekmehrApi'\nexport * from './api/IccBemikronoApi'\nexport * from './api/IccBeresultexportApi'\nexport * from './api/IccBeresultimportApi'\nexport * from './api/IccBesamv2Api'\nexport * from './api/IccCalendarItemApi'\nexport * from './api/IccCalendarItemTypeApi'\nexport * from './api/IccClassificationApi'\nexport * from './api/IccClassificationTemplateApi'\nexport * from './api/IccCodeApi'\nexport * from './api/IccContactApi'\nexport * from './api/IccDeviceApi'\nexport * from './api/IccDoctemplateApi'\nexport * from './api/IccDocumentApi'\nexport * from './api/IccEntityrefApi'\nexport * from './api/IccEntitytemplateApi'\nexport * from './api/IccFormApi'\nexport * from './api/IccFrontendmigrationApi'\nexport * from './api/IccGroupApi'\nexport * from './api/IccHcpartyApi'\nexport * from './api/IccHelementApi'\nexport * from './api/IccIcureApi'\nexport * from './api/IccInsuranceApi'\nexport * from './api/IccInvoiceApi'\nexport * from './api/IccKeywordApi'\nexport * from './api/IccMedexApi'\nexport * from './api/IccMedicallocationApi'\nexport * from './api/IccMessageApi'\nexport * from './api/IccPatientApi'\nexport * from './api/IccPermissionApi'\nexport * from './api/IccPlaceApi'\nexport * from './api/IccPubsubApi'\nexport * from './api/IccReceiptApi'\nexport * from './api/IccReplicationApi'\nexport * from './api/IccTarificationApi'\nexport * from './api/IccTimeTableApi'\nexport * from './api/IccTmpApi'\nexport * from './api/IccUserApi'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../icc-api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAqC;AACrC,qDAAkC;AAClC,8DAA2C;AAC3C,kEAA+C;AAC/C,sDAAmC;AACnC,mDAAgC;AAChC,sDAAmC;AACnC,sDAAmC;AACnC,6DAA0C;AAC1C,6DAA0C;AAC1C,sDAAmC;AACnC,2DAAwC;AACxC,+DAA4C;AAC5C,6DAA0C;AAC1C,qEAAkD;AAClD,mDAAgC;AAChC,sDAAmC;AACnC,qDAAkC;AAClC,0DAAuC;AACvC,uDAAoC;AACpC,wDAAqC;AACrC,6DAA0C;AAC1C,mDAAgC;AAChC,gEAA6C;AAC7C,oDAAiC;AACjC,sDAAmC;AACnC,uDAAoC;AACpC,oDAAiC;AACjC,wDAAqC;AACrC,sDAAmC;AACnC,sDAAmC;AACnC,oDAAiC;AACjC,8DAA2C;AAC3C,sDAAmC;AACnC,sDAAmC;AACnC,yDAAsC;AACtC,oDAAiC;AACjC,qDAAkC;AAClC,sDAAmC;AACnC,0DAAuC;AACvC,2DAAwC;AACxC,wDAAqC;AACrC,kDAA+B;AAC/B,mDAAgC","sourcesContent":["export * from './api/IccAccesslogApi'\nexport * from './api/IccAgendaApi'\nexport * from './api/IccAnonymousAccessApi'\nexport * from './api/IccApplicationsettingsApi'\nexport * from './api/IccArticleApi'\nexport * from './api/IccAuthApi'\nexport * from './api/IccBeefactApi'\nexport * from './api/IccBekmehrApi'\nexport * from './api/IccBeresultexportApi'\nexport * from './api/IccBeresultimportApi'\nexport * from './api/IccBesamv2Api'\nexport * from './api/IccCalendarItemApi'\nexport * from './api/IccCalendarItemTypeApi'\nexport * from './api/IccClassificationApi'\nexport * from './api/IccClassificationTemplateApi'\nexport * from './api/IccCodeApi'\nexport * from './api/IccContactApi'\nexport * from './api/IccDeviceApi'\nexport * from './api/IccDoctemplateApi'\nexport * from './api/IccDocumentApi'\nexport * from './api/IccEntityrefApi'\nexport * from './api/IccEntitytemplateApi'\nexport * from './api/IccFormApi'\nexport * from './api/IccFrontendmigrationApi'\nexport * from './api/IccGroupApi'\nexport * from './api/IccHcpartyApi'\nexport * from './api/IccHelementApi'\nexport * from './api/IccIcureApi'\nexport * from './api/IccInsuranceApi'\nexport * from './api/IccInvoiceApi'\nexport * from './api/IccKeywordApi'\nexport * from './api/IccMedexApi'\nexport * from './api/IccMedicallocationApi'\nexport * from './api/IccMessageApi'\nexport * from './api/IccPatientApi'\nexport * from './api/IccPermissionApi'\nexport * from './api/IccPlaceApi'\nexport * from './api/IccPubsubApi'\nexport * from './api/IccReceiptApi'\nexport * from './api/IccReplicationApi'\nexport * from './api/IccTarificationApi'\nexport * from './api/IccTimeTableApi'\nexport * from './api/IccTmpApi'\nexport * from './api/IccUserApi'\n"]}
@@ -26,4 +26,5 @@ export declare class AuthenticationToken {
26
26
  * Token validity in seconds
27
27
  */
28
28
  validity?: number;
29
+ deletionDate?: number;
29
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AuthenticationToken.js","sourceRoot":"","sources":["../../../icc-api/model/AuthenticationToken.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH;;GAEG;AACH,MAAa,mBAAmB;IAC9B,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAA2B,EAAE,IAAI,CAAC,CAAA;IAClD,CAAC;CAcF;AAjBD,kDAiBC","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 */\n\n/**\n * Encrypted and time-limited Authentication tokens used for inter-applications authentication\n */\nexport class AuthenticationToken {\n constructor(json: JSON | any) {\n Object.assign(this as AuthenticationToken, json)\n }\n\n /**\n * Encrypted token\n */\n token?: string\n /**\n * Validity starting time of the token\n */\n creationTime?: number\n /**\n * Token validity in seconds\n */\n validity?: number\n}\n"]}
1
+ {"version":3,"file":"AuthenticationToken.js","sourceRoot":"","sources":["../../../icc-api/model/AuthenticationToken.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH;;GAEG;AACH,MAAa,mBAAmB;IAC9B,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAA2B,EAAE,IAAI,CAAC,CAAA;IAClD,CAAC;CAgBF;AAnBD,kDAmBC","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 */\n\n/**\n * Encrypted and time-limited Authentication tokens used for inter-applications authentication\n */\nexport class AuthenticationToken {\n constructor(json: JSON | any) {\n Object.assign(this as AuthenticationToken, json)\n }\n\n /**\n * Encrypted token\n */\n token?: string\n /**\n * Validity starting time of the token\n */\n creationTime?: number\n /**\n * Token validity in seconds\n */\n validity?: number\n\n deletionDate?: number\n}\n"]}
@@ -24,11 +24,14 @@ export declare class FlatRateTarification {
24
24
  encryptedSelf?: string;
25
25
  }
26
26
  export declare namespace FlatRateTarification {
27
- type FlatRateTypeEnum = 'physician' | 'physiotherapist' | 'nurse' | 'ptd';
27
+ type FlatRateTypeEnum = 'physician' | 'physiotherapist' | 'nurse' | 'ptd' | 'ivgFlatRate1' | 'ivgFlatRate2' | 'ivgPersonalIntervention';
28
28
  const FlatRateTypeEnum: {
29
29
  Physician: FlatRateTypeEnum;
30
30
  Physiotherapist: FlatRateTypeEnum;
31
31
  Nurse: FlatRateTypeEnum;
32
32
  Ptd: FlatRateTypeEnum;
33
+ IvgFlatRate1: FlatRateTypeEnum;
34
+ IvgFlatRate2: FlatRateTypeEnum;
35
+ IvgPersonalIntervention: FlatRateTypeEnum;
33
36
  };
34
37
  }
@@ -13,6 +13,9 @@ exports.FlatRateTarification = FlatRateTarification;
13
13
  Physiotherapist: 'physiotherapist',
14
14
  Nurse: 'nurse',
15
15
  Ptd: 'ptd',
16
+ IvgFlatRate1: 'ivgFlatRate1',
17
+ IvgFlatRate2: 'ivgFlatRate2',
18
+ IvgPersonalIntervention: 'ivgPersonalIntervention',
16
19
  };
17
20
  })(FlatRateTarification = exports.FlatRateTarification || (exports.FlatRateTarification = {}));
18
21
  //# sourceMappingURL=FlatRateTarification.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FlatRateTarification.js","sourceRoot":"","sources":["../../../icc-api/model/FlatRateTarification.ts"],"names":[],"mappings":";;;AAaA,MAAa,oBAAoB;IAC/B,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAA4B,EAAE,IAAI,CAAC,CAAA;IACnD,CAAC;CAUF;AAbD,oDAaC;AACD,WAAiB,oBAAoB;IAEtB,qCAAgB,GAAG;QAC9B,SAAS,EAAE,WAA+B;QAC1C,eAAe,EAAE,iBAAqC;QACtD,KAAK,EAAE,OAA2B;QAClC,GAAG,EAAE,KAAyB;KAC/B,CAAA;AACH,CAAC,EARgB,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAQpC","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 { Valorisation } from './Valorisation'\n\nexport class FlatRateTarification {\n constructor(json: JSON | any) {\n Object.assign(this as FlatRateTarification, json)\n }\n\n code?: string\n flatRateType?: FlatRateTarification.FlatRateTypeEnum\n label?: { [key: string]: string }\n valorisations?: Array<Valorisation>\n /**\n * The base64 encoded data of this object, formatted as JSON and encrypted in AES using the random master key from encryptionKeys.\n */\n encryptedSelf?: string\n}\nexport namespace FlatRateTarification {\n export type FlatRateTypeEnum = 'physician' | 'physiotherapist' | 'nurse' | 'ptd'\n export const FlatRateTypeEnum = {\n Physician: 'physician' as FlatRateTypeEnum,\n Physiotherapist: 'physiotherapist' as FlatRateTypeEnum,\n Nurse: 'nurse' as FlatRateTypeEnum,\n Ptd: 'ptd' as FlatRateTypeEnum,\n }\n}\n"]}
1
+ {"version":3,"file":"FlatRateTarification.js","sourceRoot":"","sources":["../../../icc-api/model/FlatRateTarification.ts"],"names":[],"mappings":";;;AAaA,MAAa,oBAAoB;IAC/B,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAA4B,EAAE,IAAI,CAAC,CAAA;IACnD,CAAC;CAUF;AAbD,oDAaC;AACD,WAAiB,oBAAoB;IAEtB,qCAAgB,GAAG;QAC9B,SAAS,EAAE,WAA+B;QAC1C,eAAe,EAAE,iBAAqC;QACtD,KAAK,EAAE,OAA2B;QAClC,GAAG,EAAE,KAAyB;QAC9B,YAAY,EAAE,cAAkC;QAChD,YAAY,EAAE,cAAkC;QAChD,uBAAuB,EAAE,yBAA6C;KACvE,CAAA;AACH,CAAC,EAXgB,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAWpC","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 { Valorisation } from './Valorisation'\n\nexport class FlatRateTarification {\n constructor(json: JSON | any) {\n Object.assign(this as FlatRateTarification, json)\n }\n\n code?: string\n flatRateType?: FlatRateTarification.FlatRateTypeEnum\n label?: { [key: string]: string }\n valorisations?: Array<Valorisation>\n /**\n * The base64 encoded data of this object, formatted as JSON and encrypted in AES using the random master key from encryptionKeys.\n */\n encryptedSelf?: string\n}\nexport namespace FlatRateTarification {\n export type FlatRateTypeEnum = 'physician' | 'physiotherapist' | 'nurse' | 'ptd' | 'ivgFlatRate1' | 'ivgFlatRate2' | 'ivgPersonalIntervention'\n export const FlatRateTypeEnum = {\n Physician: 'physician' as FlatRateTypeEnum,\n Physiotherapist: 'physiotherapist' as FlatRateTypeEnum,\n Nurse: 'nurse' as FlatRateTypeEnum,\n Ptd: 'ptd' as FlatRateTypeEnum,\n IvgFlatRate1: 'ivgFlatRate1' as FlatRateTypeEnum,\n IvgFlatRate2: 'ivgFlatRate2' as FlatRateTypeEnum,\n IvgPersonalIntervention: 'ivgPersonalIntervention' as FlatRateTypeEnum,\n }\n}\n"]}
@@ -23,4 +23,5 @@ export declare class UserGroup {
23
23
  patientId?: string;
24
24
  healthcarePartyId?: string;
25
25
  deviceId?: string;
26
+ nameOfParentOfTopmostGroupInHierarchy?: string;
26
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"UserGroup.js","sourceRoot":"","sources":["../../../icc-api/model/UserGroup.ts"],"names":[],"mappings":";;;AAaA,MAAa,SAAS;IACpB,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAAiB,EAAE,IAAI,CAAC,CAAA;IACxC,CAAC;CAaF;AAhBD,8BAgBC","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 { Group } from './Group'\n\nexport class UserGroup {\n constructor(json: JSON | any) {\n Object.assign(this as UserGroup, json)\n }\n\n groupId?: string\n groupName?: string\n groupsHierarchy?: Array<Group>\n userId?: string\n login?: string\n name?: string\n email?: string\n phone?: string\n patientId?: string\n healthcarePartyId?: string\n deviceId?: string\n}\n"]}
1
+ {"version":3,"file":"UserGroup.js","sourceRoot":"","sources":["../../../icc-api/model/UserGroup.ts"],"names":[],"mappings":";;;AAaA,MAAa,SAAS;IACpB,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAAiB,EAAE,IAAI,CAAC,CAAA;IACxC,CAAC;CAcF;AAjBD,8BAiBC","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 { Group } from './Group'\n\nexport class UserGroup {\n constructor(json: JSON | any) {\n Object.assign(this as UserGroup, json)\n }\n\n groupId?: string\n groupName?: string\n groupsHierarchy?: Array<Group>\n userId?: string\n login?: string\n name?: string\n email?: string\n phone?: string\n patientId?: string\n healthcarePartyId?: string\n deviceId?: string\n nameOfParentOfTopmostGroupInHierarchy?: string\n}\n"]}
@@ -2,6 +2,10 @@ import { AuthService } from './AuthService';
2
2
  import { IccAuthApi } from '../../icc-api';
3
3
  export interface AuthenticationProvider {
4
4
  getAuthService(): AuthService;
5
+ getIcureTokens(): Promise<{
6
+ token: string;
7
+ refreshToken: string;
8
+ } | undefined>;
5
9
  }
6
10
  export declare class EnsembleAuthenticationProvider implements AuthenticationProvider {
7
11
  private authApi;
@@ -11,20 +15,48 @@ export declare class EnsembleAuthenticationProvider implements AuthenticationPro
11
15
  private readonly basicAuth;
12
16
  private jwtAuth;
13
17
  private suspensionEnd;
14
- constructor(authApi: IccAuthApi, username: string, password: string, jwtTimeout?: number);
18
+ constructor(authApi: IccAuthApi, username: string, password: string, jwtTimeout?: number, thirdPartyTokens?: {
19
+ [thirdParty: string]: string;
20
+ });
21
+ getIcureTokens(): Promise<{
22
+ token: string;
23
+ refreshToken: string;
24
+ } | undefined>;
15
25
  getAuthService(): AuthService;
16
26
  }
17
27
  export declare class JwtAuthenticationProvider implements AuthenticationProvider {
28
+ getIcureTokens(): Promise<{
29
+ token: string;
30
+ refreshToken: string;
31
+ }>;
18
32
  private readonly jwtAuth;
19
- constructor(authApi: IccAuthApi, username: string, password: string);
33
+ /**
34
+ * @internal
35
+ * @param authApi
36
+ * @param username
37
+ * @param password
38
+ * @param icureToken
39
+ */
40
+ constructor(authApi: IccAuthApi, username?: string, password?: string, icureToken?: {
41
+ token: string;
42
+ refreshToken: string;
43
+ });
20
44
  getAuthService(): AuthService;
21
45
  }
22
46
  export declare class BasicAuthenticationProvider implements AuthenticationProvider {
23
47
  private username;
24
48
  private password;
49
+ getIcureTokens(): Promise<{
50
+ token: string;
51
+ refreshToken: string;
52
+ } | undefined>;
25
53
  constructor(username: string, password: string);
26
54
  getAuthService(): AuthService;
27
55
  }
28
56
  export declare class NoAuthenticationProvider implements AuthenticationProvider {
29
57
  getAuthService(): AuthService;
58
+ getIcureTokens(): Promise<{
59
+ token: string;
60
+ refreshToken: string;
61
+ } | undefined>;
30
62
  }
@@ -2,24 +2,28 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NoAuthenticationProvider = exports.BasicAuthenticationProvider = exports.JwtAuthenticationProvider = exports.EnsembleAuthenticationProvider = void 0;
4
4
  const EnsembleAuthService_1 = require("./EnsembleAuthService");
5
- const JwtAuthService_1 = require("./JwtAuthService");
5
+ const JwtBridgedAuthService_1 = require("./JwtBridgedAuthService");
6
6
  const NoAuthService_1 = require("./NoAuthService");
7
7
  const BasicAuthService_1 = require("./BasicAuthService");
8
+ const JwtAuthService_1 = require("./JwtAuthService");
8
9
  class EnsembleAuthenticationProvider {
9
- constructor(authApi, username, password, jwtTimeout = 3600) {
10
+ constructor(authApi, username, password, jwtTimeout = 3600, thirdPartyTokens = {}) {
10
11
  this.authApi = authApi;
11
12
  this.username = username;
12
13
  this.password = password;
13
14
  this.jwtTimeout = jwtTimeout;
14
- this.jwtAuth = new JwtAuthService_1.JwtAuthService(this.authApi, this.username, this.password);
15
+ this.jwtAuth = new JwtBridgedAuthService_1.JwtBridgedAuthService(this.authApi, this.username, this.password, thirdPartyTokens);
15
16
  this.basicAuth = new BasicAuthService_1.BasicAuthService(this.username, this.password);
16
17
  }
18
+ getIcureTokens() {
19
+ return this.jwtAuth.getIcureTokens();
20
+ }
17
21
  getAuthService() {
18
22
  // If the jwtAuth is in an error state, it instantiates a new one,
19
23
  // but it will not use it until the suspension ends
20
24
  if (this.jwtAuth.isInErrorState()) {
21
25
  console.warn('Error state in JWT, I will skip it');
22
- this.jwtAuth = new JwtAuthService_1.JwtAuthService(this.authApi, this.username, this.password);
26
+ this.jwtAuth = new JwtBridgedAuthService_1.JwtBridgedAuthService(this.authApi, this.username, this.password);
23
27
  this.suspensionEnd = new Date(new Date().getTime() + this.jwtTimeout * 1000);
24
28
  }
25
29
  return !!this.suspensionEnd && new Date() <= this.suspensionEnd
@@ -29,8 +33,20 @@ class EnsembleAuthenticationProvider {
29
33
  }
30
34
  exports.EnsembleAuthenticationProvider = EnsembleAuthenticationProvider;
31
35
  class JwtAuthenticationProvider {
32
- constructor(authApi, username, password) {
33
- this.jwtAuth = new JwtAuthService_1.JwtAuthService(authApi, username, password);
36
+ /**
37
+ * @internal
38
+ * @param authApi
39
+ * @param username
40
+ * @param password
41
+ * @param icureToken
42
+ */
43
+ constructor(authApi, username, password, icureToken) {
44
+ this.jwtAuth = icureToken
45
+ ? new JwtAuthService_1.JwtAuthService(authApi, icureToken.token, icureToken.refreshToken)
46
+ : new JwtBridgedAuthService_1.JwtBridgedAuthService(authApi, username, password);
47
+ }
48
+ getIcureTokens() {
49
+ return Promise.resolve({ refreshToken: '', token: '' });
34
50
  }
35
51
  getAuthService() {
36
52
  return this.jwtAuth;
@@ -42,6 +58,9 @@ class BasicAuthenticationProvider {
42
58
  this.username = username;
43
59
  this.password = password;
44
60
  }
61
+ getIcureTokens() {
62
+ return Promise.resolve();
63
+ }
45
64
  getAuthService() {
46
65
  return new BasicAuthService_1.BasicAuthService(this.username, this.password);
47
66
  }
@@ -51,6 +70,9 @@ class NoAuthenticationProvider {
51
70
  getAuthService() {
52
71
  return new NoAuthService_1.NoAuthService();
53
72
  }
73
+ getIcureTokens() {
74
+ return Promise.resolve();
75
+ }
54
76
  }
55
77
  exports.NoAuthenticationProvider = NoAuthenticationProvider;
56
78
  //# sourceMappingURL=AuthenticationProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AuthenticationProvider.js","sourceRoot":"","sources":["../../../icc-x-api/auth/AuthenticationProvider.ts"],"names":[],"mappings":";;;AAEA,+DAA2D;AAC3D,qDAAiD;AACjD,mDAA+C;AAC/C,yDAAqD;AAMrD,MAAa,8BAA8B;IAKzC,YAAoB,OAAmB,EAAU,QAAgB,EAAU,QAAgB,EAAU,aAAqB,IAAI;QAA1G,YAAO,GAAP,OAAO,CAAY;QAAU,aAAQ,GAAR,QAAQ,CAAQ;QAAU,aAAQ,GAAR,QAAQ,CAAQ;QAAU,eAAU,GAAV,UAAU,CAAe;QAC5H,IAAI,CAAC,OAAO,GAAG,IAAI,+BAAc,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC7E,IAAI,CAAC,SAAS,GAAG,IAAI,mCAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;IACrE,CAAC;IAED,cAAc;QACZ,kEAAkE;QAClE,mDAAmD;QACnD,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE;YACjC,OAAO,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAA;YAClD,IAAI,CAAC,OAAO,GAAG,IAAI,+BAAc,CAAC,IA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EnsembleAuthService } from './EnsembleAuthService'\nimport { JwtAuthService } from './JwtAuthService'\nimport { NoAuthService } from './NoAuthService'\nimport { BasicAuthService } from './BasicAuthService'\n\nexport interface AuthenticationProvider {\n getAuthService(): AuthService\n}\n\nexport class EnsembleAuthenticationProvider implements AuthenticationProvider {\n private readonly basicAuth: BasicAuthService\n private jwtAuth: JwtAuthService\n private suspensionEnd: Date | undefined\n\n constructor(private authApi: IccAuthApi, private username: string, private password: string, private jwtTimeout: number = 3600) {\n this.jwtAuth = new JwtAuthService(this.authApi, this.username, this.password)\n this.basicAuth = new BasicAuthService(this.username, this.password)\n }\n\n getAuthService(): AuthService {\n // If the jwtAuth is in an error state, it instantiates a new one,\n // but it will not use it until the suspension ends\n if (this.jwtAuth.isInErrorState()) {\n console.warn('Error state in JWT, I will skip it')\n this.jwtAuth = new JwtAuthService(this.authApi, this.username, this.password)\n this.suspensionEnd = new Date(new Date().getTime() + this.jwtTimeout * 1000)\n }\n\n return !!this.suspensionEnd && new Date() <= this.suspensionEnd\n ? new EnsembleAuthService(null, new NoAuthService(), this.basicAuth)\n : new EnsembleAuthService(this.jwtAuth, new NoAuthService(), this.basicAuth)\n }\n}\n\nexport class JwtAuthenticationProvider implements AuthenticationProvider {\n private readonly jwtAuth: JwtAuthService\n\n constructor(authApi: IccAuthApi, username: string, password: string) {\n this.jwtAuth = new JwtAuthService(authApi, username, password)\n }\n\n getAuthService(): AuthService {\n return this.jwtAuth\n }\n}\n\nexport class BasicAuthenticationProvider implements AuthenticationProvider {\n constructor(private username: string, private password: string) {}\n\n getAuthService(): AuthService {\n return new BasicAuthService(this.username, this.password)\n }\n}\n\nexport class NoAuthenticationProvider implements AuthenticationProvider {\n getAuthService(): AuthService {\n return new NoAuthService()\n }\n}\n"]}
1
+ {"version":3,"file":"AuthenticationProvider.js","sourceRoot":"","sources":["../../../icc-x-api/auth/AuthenticationProvider.ts"],"names":[],"mappings":";;;AAEA,+DAA2D;AAC3D,mEAA+D;AAC/D,mDA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'\nimport { EnsembleAuthService } from './EnsembleAuthService'\nimport { JwtBridgedAuthService } from './JwtBridgedAuthService'\nimport { NoAuthService } from './NoAuthService'\nimport { BasicAuthService } from './BasicAuthService'\nimport { JwtAuthService } from './JwtAuthService'\n\nexport interface AuthenticationProvider {\n getAuthService(): AuthService\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined>\n}\n\nexport class EnsembleAuthenticationProvider implements AuthenticationProvider {\n private readonly basicAuth: BasicAuthService\n private jwtAuth: JwtBridgedAuthService\n private suspensionEnd: Date | undefined\n\n constructor(\n private authApi: IccAuthApi,\n private username: string,\n private password: string,\n private jwtTimeout: number = 3600,\n thirdPartyTokens: { [thirdParty: string]: string } = {}\n ) {\n this.jwtAuth = new JwtBridgedAuthService(this.authApi, this.username, this.password, thirdPartyTokens)\n this.basicAuth = new BasicAuthService(this.username, this.password)\n }\n\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined> {\n return this.jwtAuth.getIcureTokens()\n }\n\n getAuthService(): AuthService {\n // If the jwtAuth is in an error state, it instantiates a new one,\n // but it will not use it until the suspension ends\n if (this.jwtAuth.isInErrorState()) {\n console.warn('Error state in JWT, I will skip it')\n this.jwtAuth = new JwtBridgedAuthService(this.authApi, this.username, this.password)\n this.suspensionEnd = new Date(new Date().getTime() + this.jwtTimeout * 1000)\n }\n\n return !!this.suspensionEnd && new Date() <= this.suspensionEnd\n ? new EnsembleAuthService(null, new NoAuthService(), this.basicAuth)\n : new EnsembleAuthService(this.jwtAuth, new NoAuthService(), this.basicAuth)\n }\n}\n\nexport class JwtAuthenticationProvider implements AuthenticationProvider {\n getIcureTokens(): Promise<{ token: string; refreshToken: string }> {\n return Promise.resolve({ refreshToken: '', token: '' })\n }\n private readonly jwtAuth: AuthService\n\n /**\n * @internal\n * @param authApi\n * @param username\n * @param password\n * @param icureToken\n */\n constructor(authApi: IccAuthApi, username?: string, password?: string, icureToken?: { token: string; refreshToken: string }) {\n this.jwtAuth = icureToken\n ? new JwtAuthService(authApi, icureToken.token, icureToken.refreshToken)\n : new JwtBridgedAuthService(authApi, username!, password!)\n }\n\n getAuthService(): AuthService {\n return this.jwtAuth\n }\n}\n\nexport class BasicAuthenticationProvider implements AuthenticationProvider {\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined> {\n return Promise.resolve() as Promise<undefined>\n }\n constructor(private username: string, private password: string) {}\n\n getAuthService(): AuthService {\n return new BasicAuthService(this.username, this.password)\n }\n}\n\nexport class NoAuthenticationProvider implements AuthenticationProvider {\n getAuthService(): AuthService {\n return new NoAuthService()\n }\n\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined> {\n return Promise.resolve() as Promise<undefined>\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { AuthService } from './AuthService';
2
2
  import { XHR } from '../../icc-api/api/XHR';
3
- import { JwtAuthService } from './JwtAuthService';
3
+ import { JwtBridgedAuthService } from './JwtBridgedAuthService';
4
4
  import { NoAuthService } from './NoAuthService';
5
5
  import { BasicAuthService } from './BasicAuthService';
6
6
  import Header = XHR.Header;
@@ -11,7 +11,11 @@ export declare class EnsembleAuthService implements AuthService {
11
11
  private currentState;
12
12
  private error;
13
13
  private stateMap;
14
- constructor(jwtAuth: JwtAuthService | null, sessionAuth: NoAuthService, basicAuth: BasicAuthService);
14
+ constructor(jwtAuth: JwtBridgedAuthService | null, sessionAuth: NoAuthService, basicAuth: BasicAuthService);
15
+ getIcureTokens(): Promise<{
16
+ token: string;
17
+ refreshToken: string;
18
+ } | undefined>;
15
19
  getAuthHeaders(): Promise<Array<Header>>;
16
20
  invalidateHeader(error: Error): void;
17
21
  }
@@ -10,6 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.EnsembleAuthService = void 0;
13
+ const XHR_1 = require("../../icc-api/api/XHR");
14
+ var XHRError = XHR_1.XHR.XHRError;
13
15
  class EnsembleAuthService {
14
16
  constructor(jwtAuth, sessionAuth, basicAuth) {
15
17
  this.jwtAuth = jwtAuth;
@@ -24,6 +26,10 @@ class EnsembleAuthService {
24
26
  };
25
27
  this.currentState = 'start';
26
28
  }
29
+ getIcureTokens() {
30
+ var _a, _b;
31
+ return (_b = (_a = this.jwtAuth) === null || _a === void 0 ? void 0 : _a.getIcureTokens()) !== null && _b !== void 0 ? _b : Promise.resolve();
32
+ }
27
33
  getAuthHeaders() {
28
34
  return __awaiter(this, void 0, void 0, function* () {
29
35
  this.currentState = !!this.currentState ? this.stateMap[this.currentState].next : this.currentState;
@@ -32,6 +38,9 @@ class EnsembleAuthService {
32
38
  // And delegate the responsibility of handling the error to the next call
33
39
  return !!this.stateMap[this.currentState].state
34
40
  ? this.stateMap[this.currentState].state.getAuthHeaders().catch((e) => {
41
+ if (e instanceof XHRError && e.statusCode === 417) {
42
+ throw e;
43
+ }
35
44
  // If I get an error, it is also responsibility of the next call, but I give a warning
36
45
  console.warn(e.message);
37
46
  this.error = e;
@@ -1 +1 @@
1
- {"version":3,"file":"EnsembleAuthService.js","sourceRoot":"","sources":["../../../icc-x-api/auth/EnsembleAuthService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAOA,MAAa,mBAAmB;IAK9B,YACmB,OAA8B,EAC9B,WAA0B,EAC1B,SAA2B;QAF3B,YAAO,GAAP,OAAO,CAAuB;QAC9B,gBAAW,GAAX,WAAW,CAAe;QAC1B,cAAS,GAAT,SAAS,CAAkB;QANtC,UAAK,GAAiB,IAAI,CAAA;QAQhC,IAAI,CAAC,QAAQ,GAAG;YACd,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE;YACnC,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;YAC7C,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE;YACnD,KAAK,EA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Y,CAAC,CAAC,KAAK,0CAAE,gBAAgB,CAAC,KAAK,CAAC,CAAA;SAChE;IACH,CAAC;CACF;AA/CD,kDA+CC","sourcesContent":["import { AuthService } from './AuthService'\nimport { XHR } from '../../icc-api/api/XHR'\nimport { JwtAuthService } from './JwtAuthService'\nimport { NoAuthService } from './NoAuthService'\nimport { BasicAuthService } from './BasicAuthService'\nimport Header = XHR.Header\n\nexport class EnsembleAuthService implements AuthService {\n private currentState: string | null\n private error: Error | null = null\n private stateMap: { [key: string]: { state: AuthService | null; next: string | null } }\n\n constructor(\n private readonly jwtAuth: JwtAuthService | null,\n private readonly sessionAuth: NoAuthService,\n private readonly basicAuth: BasicAuthService\n ) {\n this.stateMap = {\n start: { state: null, next: 'jwt' },\n jwt: { state: this.jwtAuth, next: 'session' },\n session: { state: this.sessionAuth, next: 'basic' },\n basic: { state: this.basicAuth, next: null },\n }\n this.currentState = 'start'\n }\n\n async getAuthHeaders(): Promise<Array<Header>> {\n this.currentState = !!this.currentState ? this.stateMap[this.currentState].next : this.currentState\n\n if (!!this.currentState) {\n // If I have a state I return the headers, otherwise I return empty headers\n // And delegate the responsibility of handling the error to the next call\n return !!this.stateMap[this.currentState].state\n ? this.stateMap[this.currentState].state!.getAuthHeaders().catch((e) => {\n // If I get an error, it is also responsibility of the next call, but I give a warning\n console.warn(e.message)\n this.error = e\n return []\n })\n : Promise.resolve([])\n } else if (!!this.error) {\n // If I have no more states, I throw the last error or a default one\n throw this.error\n } else {\n throw new Error('Cannot authenticate')\n }\n }\n\n invalidateHeader(error: Error): void {\n this.error = error\n if (!!this.currentState) {\n this.stateMap[this.currentState].state?.invalidateHeader(error)\n }\n }\n}\n"]}
1
+ {"version":3,"file":"EnsembleAuthService.js","sourceRoot":"","sources":["../../../icc-x-api/auth/EnsembleAuthService.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+CAA2C;AAK3C,IAAO,QAAQ,GAAG,SAAG,CAAC,QAAQ,CAAA;AAE9B,MAAa,mBAAm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wBACnE,IAAI,CAAC,YAAY,QAAQ,IAAI,CAAC,CAAC,UAAU,KAAK,GAAG,EAAE;4BACjD,MAAM,CAAC,CAAA;yBACR;wBACD,sFAAsF;wBACtF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;wBACvB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;wBAEd,OAAO,EAAE,CAAA;oBACX,CAAC,CAAC;oBACJ,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;aACxB;iBAAM,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE;gBACvB,oEAAoE;gBACpE,MAAM,IAAI,CAAC,KAAK,CAAA;aACjB;iBAAM;gBACL,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAA;aACvC;QACH,CAAC;KAAA;IAED,gBAAgB,CAAC,KAAY;;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE;YACvB,MAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,KAAK,0CAAE,gBAAgB,CAAC,KAAK,CAAC,CAAA;SAChE;IACH,CAAC;CACF;AAvDD,kDAuDC","sourcesContent":["import { AuthService } from './AuthService'\nimport { XHR } from '../../icc-api/api/XHR'\nimport { JwtBridgedAuthService } from './JwtBridgedAuthService'\nimport { NoAuthService } from './NoAuthService'\nimport { BasicAuthService } from './BasicAuthService'\nimport Header = XHR.Header\nimport XHRError = XHR.XHRError\n\nexport class EnsembleAuthService implements AuthService {\n private currentState: string | null\n private error: Error | null = null\n private stateMap: { [key: string]: { state: AuthService | null; next: string | null } }\n\n constructor(\n private readonly jwtAuth: JwtBridgedAuthService | null,\n private readonly sessionAuth: NoAuthService,\n private readonly basicAuth: BasicAuthService\n ) {\n this.stateMap = {\n start: { state: null, next: 'jwt' },\n jwt: { state: this.jwtAuth, next: 'session' },\n session: { state: this.sessionAuth, next: 'basic' },\n basic: { state: this.basicAuth, next: null },\n }\n this.currentState = 'start'\n }\n\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined> {\n return this.jwtAuth?.getIcureTokens() ?? (Promise.resolve() as Promise<undefined>)\n }\n\n async getAuthHeaders(): Promise<Array<Header>> {\n this.currentState = !!this.currentState ? this.stateMap[this.currentState].next : this.currentState\n\n if (!!this.currentState) {\n // If I have a state I return the headers, otherwise I return empty headers\n // And delegate the responsibility of handling the error to the next call\n return !!this.stateMap[this.currentState].state\n ? this.stateMap[this.currentState].state!.getAuthHeaders().catch((e) => {\n if (e instanceof XHRError && e.statusCode === 417) {\n throw e\n }\n // If I get an error, it is also responsibility of the next call, but I give a warning\n console.warn(e.message)\n this.error = e\n\n return []\n })\n : Promise.resolve([])\n } else if (!!this.error) {\n // If I have no more states, I throw the last error or a default one\n throw this.error\n } else {\n throw new Error('Cannot authenticate')\n }\n }\n\n invalidateHeader(error: Error): void {\n this.error = error\n if (!!this.currentState) {\n this.stateMap[this.currentState].state?.invalidateHeader(error)\n }\n }\n}\n"]}
@@ -4,14 +4,15 @@ import { IccAuthApi } from '../../icc-api';
4
4
  import Header = XHR.Header;
5
5
  export declare class JwtAuthService implements AuthService {
6
6
  private authApi;
7
- private username;
8
- private password;
9
7
  private _error;
10
8
  private _currentPromise;
11
- constructor(authApi: IccAuthApi, username: string, password: string);
9
+ constructor(authApi: IccAuthApi, token: string, refreshToken: string);
10
+ getIcureTokens(): Promise<{
11
+ token: string;
12
+ refreshToken: string;
13
+ } | undefined>;
12
14
  getAuthHeaders(): Promise<Array<Header>>;
13
15
  private _refreshAuthJwt;
14
- private _loginAndGetTokens;
15
16
  private _isJwtExpired;
16
17
  private _base64Decode;
17
18
  invalidateHeader(error: Error): void;
@@ -11,15 +11,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.JwtAuthService = void 0;
13
13
  const XHR_1 = require("../../icc-api/api/XHR");
14
- const LoginCredentials_1 = require("../../icc-api/model/LoginCredentials");
15
14
  const utils_1 = require("../utils");
16
15
  class JwtAuthService {
17
- constructor(authApi, username, password) {
16
+ constructor(authApi, token, refreshToken) {
18
17
  this.authApi = authApi;
19
- this.username = username;
20
- this.password = password;
21
18
  this._error = null;
22
- this._currentPromise = Promise.resolve({});
19
+ this._currentPromise = Promise.resolve({ authJwt: token, refreshJwt: refreshToken });
20
+ }
21
+ getIcureTokens() {
22
+ return this._currentPromise.then(({ authJwt, refreshJwt }) => ({ token: authJwt, refreshToken: refreshJwt }));
23
23
  }
24
24
  getAuthHeaders() {
25
25
  return __awaiter(this, void 0, void 0, function* () {
@@ -51,8 +51,8 @@ class JwtAuthService {
51
51
  return __awaiter(this, void 0, void 0, function* () {
52
52
  // If I do not have a refresh JWT or the refresh JWT is expired,
53
53
  // I have to log in again
54
- if (!refreshJwt || this._isJwtExpired(refreshJwt)) {
55
- return this._loginAndGetTokens();
54
+ if (this._isJwtExpired(refreshJwt)) {
55
+ throw Error('Missing or expired refresh token: please log in again');
56
56
  }
57
57
  else {
58
58
  return this.authApi.refreshAuthenticationJWT(refreshJwt).then((refreshResponse) => ({
@@ -62,19 +62,6 @@ class JwtAuthService {
62
62
  }
63
63
  });
64
64
  }
65
- _loginAndGetTokens() {
66
- return __awaiter(this, void 0, void 0, function* () {
67
- return this.authApi
68
- .login(new LoginCredentials_1.LoginCredentials({
69
- username: this.username,
70
- password: this.password,
71
- }))
72
- .then((authResponse) => ({
73
- authJwt: authResponse.token,
74
- refreshJwt: authResponse.refreshToken,
75
- }));
76
- });
77
- }
78
65
  _isJwtExpired(jwt) {
79
66
  const parts = jwt.split('.');
80
67
  if (parts.length !== 3) {
@@ -1 +1 @@
1
- {"version":3,"file":"JwtAuthService.js","sourceRoot":"","sources":["../../../icc-x-api/auth/JwtAuthService.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+CAA2C;AAE3C,2EAAuE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C,KAAY;QAC3B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;IACrB,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAA;IACtB,CAAC;CACF;AA/ED,wCA+EC","sourcesContent":["import { AuthService } from './AuthService'\nimport { XHR } from '../../icc-api/api/XHR'\nimport { IccAuthApi } from '../../icc-api'\nimport { LoginCredentials } from '../../icc-api/model/LoginCredentials'\nimport Header = XHR.Header\nimport { a2b } from '../utils'\n\nexport class JwtAuthService implements AuthService {\n private _error: Error | null = null\n private _currentPromise: Promise<{ authJwt?: string; refreshJwt?: string }> = Promise.resolve({})\n\n constructor(private authApi: IccAuthApi, private username: string, private password: string) {}\n\n async getAuthHeaders(): Promise<Array<Header>> {\n return this._currentPromise\n .then(({ authJwt, refreshJwt }) => {\n if (!authJwt || this._isJwtExpired(authJwt)) {\n // If it does not have the JWT, tries to get it\n // If the JWT is expired, tries to refresh it\n\n this._currentPromise = this._refreshAuthJwt(refreshJwt).then((updatedTokens) => {\n // If here the token is null,\n // it goes in a suspension status\n if (!updatedTokens.authJwt) {\n throw new Error('Your iCure back-end version does not support JWT authentication')\n }\n\n return updatedTokens\n })\n } else if (!!this._error) {\n throw this._error\n }\n return this._currentPromise\n })\n .then(({ authJwt }) => {\n return [new XHR.Header('Authorization', `Bearer ${authJwt}`)]\n })\n }\n\n private async _refreshAuthJwt(refreshJwt: string | undefined): Promise<{ authJwt?: string; refreshJwt?: string }> {\n // If I do not have a refresh JWT or the refresh JWT is expired,\n // I have to log in again\n if (!refreshJwt || this._isJwtExpired(refreshJwt)) {\n return this._loginAndGetTokens()\n } else {\n return this.authApi.refreshAuthenticationJWT(refreshJwt).then((refreshResponse) => ({\n authJwt: refreshResponse.token,\n refreshJwt: refreshJwt,\n }))\n }\n }\n\n private async _loginAndGetTokens(): Promise<{ authJwt?: string; refreshJwt?: string }> {\n return this.authApi\n .login(\n new LoginCredentials({\n username: this.username,\n password: this.password,\n })\n )\n .then((authResponse) => ({\n authJwt: authResponse.token,\n refreshJwt: authResponse.refreshToken,\n }))\n }\n\n private _isJwtExpired(jwt: string): boolean {\n const parts = jwt.split('.')\n if (parts.length !== 3) {\n return false\n }\n const payload = this._base64Decode(parts[1])\n return !('exp' in payload) || payload['exp'] * 1000 < new Date().getTime()\n }\n\n private _base64Decode(encodedString: string): any {\n return JSON.parse(a2b(encodedString))\n }\n\n invalidateHeader(error: Error): void {\n this._error = error\n }\n\n isInErrorState(): boolean {\n return !!this._error\n }\n}\n"]}
1
+ {"version":3,"file":"JwtAuthService.js","sourceRoot":"","sources":["../../../icc-x-api/auth/JwtAuthService.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+CAA2C;AAI3C,oCAA8B;AAI9B,MAAa,cAAc;IAIzB,YAAoB,OAAmB,EAAE,KAAa,EAAE,YAAoB;QAAxD,YAAO,GAAP,OAAO,CAAY;QAH/B,WAAM,GAAiB,IAAI,CAAA;QAIjC,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC,CAAA;IACtF,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC,CAAC,CAAA;IAC/G,CAAC;IAEK,cAAc;;YAClB,OAAO,IAAI,CAAC,eAAe;iBACxB,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE;gBAChC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE;oBAC3C,+CAA+C;oBAC/C,6CAA6C;oBAE7C,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC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AAC,KAAK,IAAI,OAAO,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;IAC5E,CAAC;IAEO,aAAa,CAAC,aAAqB;QACzC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,WAAG,EAAC,aAAa,CAAC,CAAC,CAAA;IACvC,CAAC;IAED,gBAAgB,CAAC,KAAY;QAC3B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;IACrB,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAA;IACtB,CAAC;CACF;AAvED,wCAuEC","sourcesContent":["import { AuthService } from './AuthService'\nimport { XHR } from '../../icc-api/api/XHR'\nimport { IccAuthApi, OAuthThirdParty } from '../../icc-api'\nimport { LoginCredentials } from '../../icc-api/model/LoginCredentials'\nimport Header = XHR.Header\nimport { a2b } from '../utils'\nimport { AuthenticationResponse } from '../../icc-api/model/AuthenticationResponse'\nimport XHRError = XHR.XHRError\n\nexport class JwtAuthService implements AuthService {\n private _error: Error | null = null\n private _currentPromise: Promise<{ authJwt: string; refreshJwt: string }>\n\n constructor(private authApi: IccAuthApi, token: string, refreshToken: string) {\n this._currentPromise = Promise.resolve({ authJwt: token, refreshJwt: refreshToken })\n }\n\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined> {\n return this._currentPromise.then(({ authJwt, refreshJwt }) => ({ token: authJwt, refreshToken: refreshJwt }))\n }\n\n async getAuthHeaders(): Promise<Array<Header>> {\n return this._currentPromise\n .then(({ authJwt, refreshJwt }) => {\n if (!authJwt || this._isJwtExpired(authJwt)) {\n // If it does not have the JWT, tries to get it\n // If the JWT is expired, tries to refresh it\n\n this._currentPromise = this._refreshAuthJwt(refreshJwt).then((updatedTokens) => {\n // If here the token is null,\n // it goes in a suspension status\n if (!updatedTokens.authJwt) {\n throw new Error('Your iCure back-end version does not support JWT authentication')\n }\n\n return updatedTokens\n })\n } else if (!!this._error) {\n throw this._error\n }\n return this._currentPromise\n })\n .then(({ authJwt }) => {\n return [new XHR.Header('Authorization', `Bearer ${authJwt}`)]\n })\n }\n\n private async _refreshAuthJwt(refreshJwt: string): Promise<{ authJwt: string; refreshJwt: string }> {\n // If I do not have a refresh JWT or the refresh JWT is expired,\n // I have to log in again\n if (this._isJwtExpired(refreshJwt)) {\n throw Error('Missing or expired refresh token: please log in again')\n } else {\n return this.authApi.refreshAuthenticationJWT(refreshJwt).then((refreshResponse) => ({\n authJwt: refreshResponse.token!,\n refreshJwt: refreshJwt,\n }))\n }\n }\n\n private _isJwtExpired(jwt: string): boolean {\n const parts = jwt.split('.')\n if (parts.length !== 3) {\n return false\n }\n const payload = this._base64Decode(parts[1])\n return !('exp' in payload) || payload['exp'] * 1000 < new Date().getTime()\n }\n\n private _base64Decode(encodedString: string): any {\n return JSON.parse(a2b(encodedString))\n }\n\n invalidateHeader(error: Error): void {\n this._error = error\n }\n\n isInErrorState(): boolean {\n return !!this._error\n }\n}\n"]}