@icure/api 5.0.14 → 5.0.17

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 (60) hide show
  1. package/icc-api/api/IccCodeApi.d.ts +14 -1
  2. package/icc-api/api/IccCodeApi.js +33 -1
  3. package/icc-api/api/IccCodeApi.js.map +1 -1
  4. package/icc-api/model/UserGroup.d.ts +3 -0
  5. package/icc-api/model/UserGroup.js.map +1 -1
  6. package/icc-x-api/crypto/utils.d.ts +0 -0
  7. package/icc-x-api/crypto/utils.js +2 -0
  8. package/icc-x-api/crypto/utils.js.map +1 -0
  9. package/icc-x-api/icc-accesslog-x-api.d.ts +3 -3
  10. package/icc-x-api/icc-accesslog-x-api.js +11 -11
  11. package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
  12. package/icc-x-api/icc-calendar-item-x-api.d.ts +3 -3
  13. package/icc-x-api/icc-calendar-item-x-api.js +13 -13
  14. package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
  15. package/icc-x-api/icc-classification-x-api.d.ts +3 -3
  16. package/icc-x-api/icc-classification-x-api.js +4 -4
  17. package/icc-x-api/icc-classification-x-api.js.map +1 -1
  18. package/icc-x-api/icc-contact-x-api.d.ts +3 -3
  19. package/icc-x-api/icc-contact-x-api.js +16 -16
  20. package/icc-x-api/icc-contact-x-api.js.map +1 -1
  21. package/icc-x-api/icc-crypto-x-api.d.ts +10 -3
  22. package/icc-x-api/icc-crypto-x-api.js +29 -17
  23. package/icc-x-api/icc-crypto-x-api.js.map +1 -1
  24. package/icc-x-api/icc-data-owner-x-api.d.ts +14 -0
  25. package/icc-x-api/icc-data-owner-x-api.js +44 -0
  26. package/icc-x-api/icc-data-owner-x-api.js.map +1 -0
  27. package/icc-x-api/icc-document-x-api.d.ts +3 -3
  28. package/icc-x-api/icc-document-x-api.js +5 -5
  29. package/icc-x-api/icc-document-x-api.js.map +1 -1
  30. package/icc-x-api/icc-form-x-api.d.ts +3 -3
  31. package/icc-x-api/icc-form-x-api.js +5 -5
  32. package/icc-x-api/icc-form-x-api.js.map +1 -1
  33. package/icc-x-api/icc-helement-x-api.d.ts +3 -3
  34. package/icc-x-api/icc-helement-x-api.js +10 -10
  35. package/icc-x-api/icc-helement-x-api.js.map +1 -1
  36. package/icc-x-api/icc-invoice-x-api.d.ts +3 -3
  37. package/icc-x-api/icc-invoice-x-api.js +5 -5
  38. package/icc-x-api/icc-invoice-x-api.js.map +1 -1
  39. package/icc-x-api/icc-maintenance-task-x-api.d.ts +6 -3
  40. package/icc-x-api/icc-maintenance-task-x-api.js +21 -7
  41. package/icc-x-api/icc-maintenance-task-x-api.js.map +1 -1
  42. package/icc-x-api/icc-message-x-api.d.ts +3 -3
  43. package/icc-x-api/icc-message-x-api.js +4 -4
  44. package/icc-x-api/icc-message-x-api.js.map +1 -1
  45. package/icc-x-api/icc-patient-x-api.d.ts +3 -3
  46. package/icc-x-api/icc-patient-x-api.js +9 -9
  47. package/icc-x-api/icc-patient-x-api.js.map +1 -1
  48. package/icc-x-api/icc-receipt-x-api.d.ts +3 -3
  49. package/icc-x-api/icc-receipt-x-api.js +5 -5
  50. package/icc-x-api/icc-receipt-x-api.js.map +1 -1
  51. package/icc-x-api/icc-time-table-x-api.d.ts +3 -3
  52. package/icc-x-api/icc-time-table-x-api.js +5 -5
  53. package/icc-x-api/icc-time-table-x-api.js.map +1 -1
  54. package/icc-x-api/icc-user-x-api.d.ts +0 -2
  55. package/icc-x-api/icc-user-x-api.js +0 -8
  56. package/icc-x-api/icc-user-x-api.js.map +1 -1
  57. package/icc-x-api/index.d.ts +2 -0
  58. package/icc-x-api/index.js +24 -19
  59. package/icc-x-api/index.js.map +1 -1
  60. package/package.json +1 -1
@@ -5,7 +5,7 @@ const i18n = require("./rsrc/contact.i18n");
5
5
  const _ = require("lodash");
6
6
  const icc_api_1 = require("../icc-api");
7
7
  class IccTimeTableXApi extends icc_api_1.IccTimeTableApi {
8
- constructor(host, headers, crypto, userApi, fetchImpl = typeof window !== 'undefined'
8
+ constructor(host, headers, crypto, dataOwnerApi, fetchImpl = typeof window !== 'undefined'
9
9
  ? window.fetch
10
10
  : typeof self !== 'undefined'
11
11
  ? self.fetch
@@ -13,7 +13,7 @@ class IccTimeTableXApi extends icc_api_1.IccTimeTableApi {
13
13
  super(host, headers, fetchImpl);
14
14
  this.i18n = i18n;
15
15
  this.crypto = crypto;
16
- this.userApi = userApi;
16
+ this.dataOwnerApi = dataOwnerApi;
17
17
  }
18
18
  newInstance(user, tt) {
19
19
  const timeTable = _.extend({
@@ -21,16 +21,16 @@ class IccTimeTableXApi extends icc_api_1.IccTimeTableApi {
21
21
  _type: 'org.taktik.icure.entities.TimeTable',
22
22
  created: new Date().getTime(),
23
23
  modified: new Date().getTime(),
24
- responsible: this.userApi.getDataOwnerOf(user),
24
+ responsible: this.dataOwnerApi.getDataOwnerOf(user),
25
25
  author: user.id,
26
26
  codes: [],
27
27
  tags: [],
28
28
  }, tt || {});
29
- return this.crypto.initObjectDelegations(timeTable, null, this.userApi.getDataOwnerOf(user), null).then((initData) => {
29
+ return this.crypto.initObjectDelegations(timeTable, null, this.dataOwnerApi.getDataOwnerOf(user), null).then((initData) => {
30
30
  _.extend(timeTable, { delegations: initData.delegations });
31
31
  let promise = Promise.resolve(timeTable);
32
32
  (user.autoDelegations ? (user.autoDelegations.all || []).concat(user.autoDelegations.medicalInformation || []) : []).forEach((delegateId) => (promise = promise
33
- .then((patient) => this.crypto.extendedDelegationsAndCryptedForeignKeys(patient, null, this.userApi.getDataOwnerOf(user), delegateId, initData.secretId))
33
+ .then((patient) => this.crypto.extendedDelegationsAndCryptedForeignKeys(patient, null, this.dataOwnerApi.getDataOwnerOf(user), delegateId, initData.secretId))
34
34
  .then((extraData) => _.extend(timeTable, { delegations: extraData.delegations }))));
35
35
  return promise;
36
36
  });
@@ -1 +1 @@
1
- {"version":3,"file":"icc-time-table-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-time-table-x-api.ts"],"names":[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AC,WAAW,EAAE,CAAC,CAAA;YAE1D,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CACvC;YAAA,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,CAC3H,CAAC,UAAU,EAAE,EAAE,CACb,CAAC,OAAO,GAAG,OAAO;iBACf,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAChB,IAAI,CAAC,MAAM,CAAC,wCAAwC,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,CACtI;iBACA,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,WAAW,EAAE,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CACvF,CAAA;YACD,OAAO,OAAO,CAAA;QAChB,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AAnDD,4CAmDC","sourcesContent":["import * as i18n from './rsrc/contact.i18n'\n\nimport * as _ from 'lodash'\nimport { IccTimeTableApi } from '../icc-api'\nimport { User } from '../icc-api/model/User'\nimport { TimeTable } from '../icc-api/model/TimeTable'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\nimport { IccUserXApi } from './icc-user-x-api'\n\nexport class IccTimeTableXApi extends IccTimeTableApi {\n i18n: any = i18n\n crypto: IccCryptoXApi\n userApi: IccUserXApi\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n crypto: IccCryptoXApi,\n userApi: IccUserXApi,\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, fetchImpl)\n this.crypto = crypto\n this.userApi = userApi\n }\n\n newInstance(user: User, tt: TimeTable) {\n const timeTable = _.extend(\n {\n id: this.crypto.randomUuid(),\n _type: 'org.taktik.icure.entities.TimeTable',\n created: new Date().getTime(),\n modified: new Date().getTime(),\n responsible: this.userApi.getDataOwnerOf(user),\n author: user.id,\n codes: [],\n tags: [],\n },\n tt || {}\n )\n\n return this.crypto.initObjectDelegations(timeTable, null, this.userApi.getDataOwnerOf(user), null).then((initData) => {\n _.extend(timeTable, { delegations: initData.delegations })\n\n let promise = Promise.resolve(timeTable)\n ;(user.autoDelegations ? (user.autoDelegations.all || []).concat(user.autoDelegations.medicalInformation || []) : []).forEach(\n (delegateId) =>\n (promise = promise\n .then((patient) =>\n this.crypto.extendedDelegationsAndCryptedForeignKeys(patient, null, this.userApi.getDataOwnerOf(user), delegateId, initData.secretId)\n )\n .then((extraData) => _.extend(timeTable, { delegations: extraData.delegations })))\n )\n return promise\n })\n }\n}\n"]}
1
+ {"version":3,"file":"icc-time-table-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-time-table-x-api.ts"],"names":[],"mappings":";;;AAAA,4CAA2C;AAE3C,4BAA2B;AAC3B,wCAA4C;AAM5C,MAAa,gBAAiB,SAAQ,yBAAe;IAKnD,YACE,IAAY,EACZ,OAAkC,EAClC,MAAqB,EACrB,YAA8B,EAC9B,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,SAAS,CAAC,CAAA;QAfjC,SAAI,GAAQ,IAAI,CAAA;QAgBd,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,YAAY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AAC,YAAY,CAAC,cAAc,CAAC,IAAI,CAAC,EACtC,UAAU,EACV,QAAQ,CAAC,QAAQ,CAClB,CACF;iBACA,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,WAAW,EAAE,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CACvF,CAAA;YACD,OAAO,OAAO,CAAA;QAChB,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AAzDD,4CAyDC","sourcesContent":["import * as i18n from './rsrc/contact.i18n'\n\nimport * as _ from 'lodash'\nimport { IccTimeTableApi } from '../icc-api'\nimport { User } from '../icc-api/model/User'\nimport { TimeTable } from '../icc-api/model/TimeTable'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\n\nexport class IccTimeTableXApi extends IccTimeTableApi {\n i18n: any = i18n\n crypto: IccCryptoXApi\n dataOwnerApi: IccDataOwnerXApi\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n crypto: IccCryptoXApi,\n dataOwnerApi: IccDataOwnerXApi,\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, fetchImpl)\n this.crypto = crypto\n this.dataOwnerApi = dataOwnerApi\n }\n\n newInstance(user: User, tt: TimeTable) {\n const timeTable = _.extend(\n {\n id: this.crypto.randomUuid(),\n _type: 'org.taktik.icure.entities.TimeTable',\n created: new Date().getTime(),\n modified: new Date().getTime(),\n responsible: this.dataOwnerApi.getDataOwnerOf(user),\n author: user.id,\n codes: [],\n tags: [],\n },\n tt || {}\n )\n\n return this.crypto.initObjectDelegations(timeTable, null, this.dataOwnerApi.getDataOwnerOf(user), null).then((initData) => {\n _.extend(timeTable, { delegations: initData.delegations })\n\n let promise = Promise.resolve(timeTable)\n ;(user.autoDelegations ? (user.autoDelegations.all || []).concat(user.autoDelegations.medicalInformation || []) : []).forEach(\n (delegateId) =>\n (promise = promise\n .then((patient) =>\n this.crypto.extendedDelegationsAndCryptedForeignKeys(\n patient,\n null,\n this.dataOwnerApi.getDataOwnerOf(user),\n delegateId,\n initData.secretId\n )\n )\n .then((extraData) => _.extend(timeTable, { delegations: extraData.delegations })))\n )\n return promise\n })\n }\n}\n"]}
@@ -1,9 +1,7 @@
1
1
  import { IccUserApi } from '../icc-api/api/IccUserApi';
2
- import { User } from '../icc-api/model/User';
3
2
  export declare class IccUserXApi extends IccUserApi {
4
3
  fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
5
4
  constructor(host: string, headers: {
6
5
  [key: string]: string;
7
6
  }, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
8
- getDataOwnerOf(user: User): string;
9
7
  }
@@ -11,14 +11,6 @@ class IccUserXApi extends IccUserApi_1.IccUserApi {
11
11
  super(host, headers, fetchImpl);
12
12
  this.fetchImpl = fetchImpl;
13
13
  }
14
- getDataOwnerOf(user) {
15
- var _a, _b;
16
- const dataOwnerId = (_b = (_a = user.healthcarePartyId) !== null && _a !== void 0 ? _a : user.patientId) !== null && _b !== void 0 ? _b : user.deviceId;
17
- if (dataOwnerId == undefined) {
18
- throw Error(`User ${user.id} is not a data owner`);
19
- }
20
- return dataOwnerId;
21
- }
22
14
  }
23
15
  exports.IccUserXApi = IccUserXApi;
24
16
  //# sourceMappingURL=icc-user-x-api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"icc-user-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-user-x-api.ts"],"names":[],"mappings":";;;AAAA,0DAAsD;AAGtD,MAAa,WAAY,SAAQ,uBAAU;IAGzC,YACE,IAAY,EACZ,OAAkC,EAClC,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,SAAS,CAAC,CAAA;QAC/B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IAED,cAAc,CAAC,IAAU;;QACvB,MAAM,WAAW,GAAG,MAAA,MAAA,IAAI,CAAC,iBAAiB,mCAAI,IAAI,CAAC,SAAS,mCAAI,IAAI,CAAC,QAAQ,CAAA;QAC7E,IAAI,WAAW,IAAI,SAAS,EAAE;YAC5B,MAAM,KAAK,CAAC,QAAQ,IAAI,CAAC,EAAE,sBAAsB,CAAC,CAAA;SACnD;QACD,OAAO,WAAW,CAAA;IACpB,CAAC;CACF;AAvBD,kCAuBC","sourcesContent":["import { IccUserApi } from '../icc-api/api/IccUserApi'\nimport { User } from '../icc-api/model/User'\n\nexport class IccUserXApi extends IccUserApi {\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n constructor(\n host: string,\n headers: { [key: string]: string },\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, fetchImpl)\n this.fetchImpl = fetchImpl\n }\n\n getDataOwnerOf(user: User): string {\n const dataOwnerId = user.healthcarePartyId ?? user.patientId ?? user.deviceId\n if (dataOwnerId == undefined) {\n throw Error(`User ${user.id} is not a data owner`)\n }\n return dataOwnerId\n }\n}\n"]}
1
+ {"version":3,"file":"icc-user-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-user-x-api.ts"],"names":[],"mappings":";;;AAAA,0DAAsD;AAEtD,MAAa,WAAY,SAAQ,uBAAU;IAGzC,YACE,IAAY,EACZ,OAAkC,EAClC,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,SAAS,CAAC,CAAA;QAC/B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;CAGF;AAjBD,kCAiBC","sourcesContent":["import { IccUserApi } from '../icc-api/api/IccUserApi'\n\nexport class IccUserXApi extends IccUserApi {\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n constructor(\n host: string,\n headers: { [key: string]: string },\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, fetchImpl)\n this.fetchImpl = fetchImpl\n }\n\n\n}\n"]}
@@ -17,6 +17,7 @@ import { IccTimeTableXApi } from './icc-time-table-x-api';
17
17
  import { IccDeviceApi } from '../icc-api/api/IccDeviceApi';
18
18
  import { IccCodeXApi } from './icc-code-x-api';
19
19
  import { IccMaintenanceTaskXApi } from './icc-maintenance-task-x-api';
20
+ import { IccDataOwnerXApi } from './icc-data-owner-x-api';
20
21
  export * from './icc-accesslog-x-api';
21
22
  export * from './icc-bekmehr-x-api';
22
23
  export * from './icc-calendar-item-x-api';
@@ -65,5 +66,6 @@ export interface Apis {
65
66
  patientApi: IccPatientXApi;
66
67
  messageApi: IccMessageXApi;
67
68
  maintenanceTaskApi: IccMaintenanceTaskXApi;
69
+ dataOwnerApi: IccDataOwnerXApi;
68
70
  }
69
71
  export declare const Api: (host: string, username: string, password: string, crypto?: Crypto, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>, forceBasic?: boolean, autoLogin?: boolean) => Promise<Apis>;
@@ -43,6 +43,7 @@ const icc_time_table_x_api_1 = require("./icc-time-table-x-api");
43
43
  const IccDeviceApi_1 = require("../icc-api/api/IccDeviceApi");
44
44
  const icc_code_x_api_1 = require("./icc-code-x-api");
45
45
  const icc_maintenance_task_x_api_1 = require("./icc-maintenance-task-x-api");
46
+ const icc_data_owner_x_api_1 = require("./icc-data-owner-x-api");
46
47
  const utils_1 = require("./utils");
47
48
  __exportStar(require("./icc-accesslog-x-api"), exports);
48
49
  __exportStar(require("./icc-bekmehr-x-api"), exports);
@@ -85,32 +86,35 @@ const Api = function (host, username, password, crypto = typeof window !== 'unde
85
86
  const healthcarePartyApi = new icc_hcparty_x_api_1.IccHcpartyXApi(host, headers, fetchImpl);
86
87
  const deviceApi = new IccDeviceApi_1.IccDeviceApi(host, headers, fetchImpl);
87
88
  const cryptoApi = new icc_crypto_x_api_1.IccCryptoXApi(host, headers, healthcarePartyApi, new icc_api_1.IccPatientApi(host, headers, fetchImpl), deviceApi, crypto);
88
- const accessLogApi = new icc_accesslog_x_api_1.IccAccesslogXApi(host, headers, cryptoApi, userApi, fetchImpl);
89
+ const dataOwnerApi = new icc_data_owner_x_api_1.IccDataOwnerXApi(cryptoApi, new icc_api_1.IccPatientApi(host, headers, fetchImpl));
90
+ const accessLogApi = new icc_accesslog_x_api_1.IccAccesslogXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl);
89
91
  const agendaApi = new icc_api_1.IccAgendaApi(host, headers, fetchImpl);
90
- const contactApi = new icc_contact_x_api_1.IccContactXApi(host, headers, cryptoApi, userApi, fetchImpl);
91
- const formApi = new icc_form_x_api_1.IccFormXApi(host, headers, cryptoApi, userApi, fetchImpl);
92
+ const contactApi = new icc_contact_x_api_1.IccContactXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl);
93
+ const formApi = new icc_form_x_api_1.IccFormXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl);
92
94
  const groupApi = new icc_api_1.IccGroupApi(host, headers);
93
- const invoiceApi = new icc_invoice_x_api_1.IccInvoiceXApi(host, headers, cryptoApi, entityReferenceApi, userApi, fetchImpl);
95
+ const invoiceApi = new icc_invoice_x_api_1.IccInvoiceXApi(host, headers, cryptoApi, entityReferenceApi, dataOwnerApi, fetchImpl);
94
96
  const insuranceApi = new icc_api_1.IccInsuranceApi(host, headers, fetchImpl);
95
- const documentApi = new icc_document_x_api_1.IccDocumentXApi(host, headers, cryptoApi, authApi, userApi, fetchImpl);
96
- const healthcareElementApi = new icc_helement_x_api_1.IccHelementXApi(host, headers, cryptoApi, userApi, ['descr', 'note'], fetchImpl);
97
- const classificationApi = new icc_classification_x_api_1.IccClassificationXApi(host, headers, cryptoApi, userApi, fetchImpl);
98
- const calendarItemApi = new icc_calendar_item_x_api_1.IccCalendarItemXApi(host, headers, cryptoApi, userApi, ['details', 'title', 'patientId'], fetchImpl);
99
- const receiptApi = new icc_receipt_x_api_1.IccReceiptXApi(host, headers, cryptoApi, userApi, fetchImpl);
100
- const timetableApi = new icc_time_table_x_api_1.IccTimeTableXApi(host, headers, cryptoApi, userApi, fetchImpl);
101
- const patientApi = new icc_patient_x_api_1.IccPatientXApi(host, headers, cryptoApi, contactApi, formApi, healthcareElementApi, invoiceApi, documentApi, healthcarePartyApi, classificationApi, userApi, calendarItemApi, ['note'], fetchImpl);
102
- const messageApi = new icc_message_x_api_1.IccMessageXApi(host, headers, cryptoApi, userApi, fetchImpl);
103
- const maintenanceTaskApi = new icc_maintenance_task_x_api_1.IccMaintenanceTaskXApi(host, headers, cryptoApi, userApi, healthcarePartyApi, ['properties'], fetchImpl);
97
+ const documentApi = new icc_document_x_api_1.IccDocumentXApi(host, headers, cryptoApi, authApi, dataOwnerApi, fetchImpl);
98
+ const healthcareElementApi = new icc_helement_x_api_1.IccHelementXApi(host, headers, cryptoApi, dataOwnerApi, ['descr', 'note'], fetchImpl);
99
+ const classificationApi = new icc_classification_x_api_1.IccClassificationXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl);
100
+ const calendarItemApi = new icc_calendar_item_x_api_1.IccCalendarItemXApi(host, headers, cryptoApi, dataOwnerApi, ['details', 'title', 'patientId'], fetchImpl);
101
+ const receiptApi = new icc_receipt_x_api_1.IccReceiptXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl);
102
+ const timetableApi = new icc_time_table_x_api_1.IccTimeTableXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl);
103
+ const patientApi = new icc_patient_x_api_1.IccPatientXApi(host, headers, cryptoApi, contactApi, formApi, healthcareElementApi, invoiceApi, documentApi, healthcarePartyApi, classificationApi, dataOwnerApi, calendarItemApi, ['note'], fetchImpl);
104
+ const messageApi = new icc_message_x_api_1.IccMessageXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl);
105
+ const maintenanceTaskApi = new icc_maintenance_task_x_api_1.IccMaintenanceTaskXApi(host, headers, cryptoApi, healthcarePartyApi, dataOwnerApi, ['properties'], fetchImpl);
104
106
  if (autoLogin) {
105
- try {
106
- yield (0, utils_1.retry)(() => authApi.login({ username, password }), 3, 1000, 1.5);
107
- }
108
- catch (e) {
109
- console.error('Incorrect user and password used to instantiate Api, or network problem', e);
107
+ if (username != undefined && password != undefined) {
108
+ try {
109
+ yield (0, utils_1.retry)(() => authApi.login({ username, password }), 3, 1000, 1.5);
110
+ }
111
+ catch (e) {
112
+ console.error('Incorrect user and password used to instantiate Api, or network problem', e);
113
+ }
110
114
  }
111
115
  }
112
116
  else {
113
- console.info('Auto login skipped');
117
+ console.info("Auto login skipped");
114
118
  }
115
119
  return {
116
120
  cryptoApi,
@@ -137,6 +141,7 @@ const Api = function (host, username, password, crypto = typeof window !== 'unde
137
141
  timetableApi,
138
142
  groupApi,
139
143
  maintenanceTaskApi,
144
+ dataOwnerApi,
140
145
  };
141
146
  });
142
147
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../icc-x-api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAqI;AACrI,qDAA8C;AAC9C,yDAAkD;AAClD,2DAAoD;AACpD,2DAAoD;AACpD,6DAAsD;AACtD,2DAAoD;AACpD,qDAA8C;AAC9C,6DAAsD;AACtD,yEAAkE;AAClE,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ranceApi, IccPatientApi, IccPermissionApi } from '../icc-api'\nimport { IccUserXApi } from './icc-user-x-api'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\nimport { IccContactXApi } from './icc-contact-x-api'\nimport { IccInvoiceXApi } from './icc-invoice-x-api'\nimport { IccDocumentXApi } from './icc-document-x-api'\nimport { IccHcpartyXApi } from './icc-hcparty-x-api'\nimport { IccFormXApi } from './icc-form-x-api'\nimport { IccHelementXApi } from './icc-helement-x-api'\nimport { IccClassificationXApi } from './icc-classification-x-api'\nimport { IccCalendarItemXApi } from './icc-calendar-item-x-api'\nimport { IccPatientXApi } from './icc-patient-x-api'\nimport { IccMessageXApi } from './icc-message-x-api'\nimport { IccReceiptXApi } from './icc-receipt-x-api'\nimport { IccAccesslogXApi } from './icc-accesslog-x-api'\nimport { IccTimeTableXApi } from './icc-time-table-x-api'\nimport { IccDeviceApi } from '../icc-api/api/IccDeviceApi'\nimport { IccCodeXApi } from './icc-code-x-api'\nimport { IccMaintenanceTaskXApi } from './icc-maintenance-task-x-api'\nimport { retry } from './utils'\n\nexport * from './icc-accesslog-x-api'\nexport * from './icc-bekmehr-x-api'\nexport * from './icc-calendar-item-x-api'\nexport * from './icc-classification-x-api'\nexport * from './icc-code-x-api'\nexport * from './icc-contact-x-api'\nexport * from './icc-crypto-x-api'\nexport * from './icc-doctemplate-x-api'\nexport * from './icc-document-x-api'\nexport * from './icc-form-x-api'\nexport * from './icc-hcparty-x-api'\nexport * from './icc-helement-x-api'\nexport * from './icc-invoice-x-api'\nexport * from './icc-message-x-api'\nexport * from './icc-patient-x-api'\nexport * from './icc-user-x-api'\nexport * from './icc-time-table-x-api'\nexport * from './icc-receipt-x-api'\nexport * from './utils'\n\nexport const apiHeaders = function (username: string, password: string, forceBasic = false) {\n return {\n Authorization: `Basic ${\n typeof btoa !== 'undefined' ? btoa(`${username}:${password}`) : Buffer.from(`${username}:${password}`).toString('base64')\n }`,\n 'force-authentication': forceBasic ? 'true' : 'false',\n }\n}\n\nexport interface Apis {\n authApi: IccAuthApi\n codeApi: IccCodeXApi\n entityReferenceApi: IccEntityrefApi\n userApi: IccUserXApi\n permissionApi: IccPermissionApi\n healthcarePartyApi: IccHcpartyXApi\n deviceApi: IccDeviceApi\n cryptoApi: IccCryptoXApi\n accessLogApi: IccAccesslogXApi\n agendaApi: IccAgendaApi\n contactApi: IccContactXApi\n formApi: IccFormXApi\n groupApi: IccGroupApi\n invoiceApi: IccInvoiceXApi\n insuranceApi: IccInsuranceApi\n documentApi: IccDocumentXApi\n healthcareElementApi: IccHelementXApi\n classificationApi: IccClassificationXApi\n calendarItemApi: IccCalendarItemXApi\n receiptApi: IccReceiptXApi\n timetableApi: IccTimeTableXApi\n patientApi: IccPatientXApi\n messageApi: IccMessageXApi\n maintenanceTaskApi: IccMaintenanceTaskXApi\n}\n\nexport const Api = async function (\n host: string,\n username: string,\n password: string,\n crypto: Crypto = typeof window !== 'undefined' ? window.crypto : typeof self !== 'undefined' ? self.crypto : ({} as Crypto),\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch,\n forceBasic = false,\n autoLogin = true\n): Promise<Apis> {\n const headers = apiHeaders(username, password, forceBasic)\n const authApi = new IccAuthApi(host, headers, fetchImpl)\n const codeApi = new IccCodeXApi(host, headers, fetchImpl)\n const entityReferenceApi = new IccEntityrefApi(host, headers, fetchImpl)\n const userApi = new IccUserXApi(host, headers, fetchImpl)\n const permissionApi = new IccPermissionApi(host, headers, fetchImpl)\n const healthcarePartyApi = new IccHcpartyXApi(host, headers, fetchImpl)\n const deviceApi = new IccDeviceApi(host, headers, fetchImpl)\n const cryptoApi = new IccCryptoXApi(host, headers, healthcarePartyApi, new IccPatientApi(host, headers, fetchImpl), deviceApi, crypto)\n const accessLogApi = new IccAccesslogXApi(host, headers, cryptoApi, userApi, fetchImpl)\n const agendaApi = new IccAgendaApi(host, headers, fetchImpl)\n const contactApi = new IccContactXApi(host, headers, cryptoApi, userApi, fetchImpl)\n const formApi = new IccFormXApi(host, headers, cryptoApi, userApi, fetchImpl)\n const groupApi = new IccGroupApi(host, headers)\n const invoiceApi = new IccInvoiceXApi(host, headers, cryptoApi, entityReferenceApi, userApi, fetchImpl)\n const insuranceApi = new IccInsuranceApi(host, headers, fetchImpl)\n const documentApi = new IccDocumentXApi(host, headers, cryptoApi, authApi, userApi, fetchImpl)\n const healthcareElementApi = new IccHelementXApi(host, headers, cryptoApi, userApi, ['descr', 'note'], fetchImpl)\n const classificationApi = new IccClassificationXApi(host, headers, cryptoApi, userApi, fetchImpl)\n const calendarItemApi = new IccCalendarItemXApi(host, headers, cryptoApi, userApi, ['details', 'title', 'patientId'], fetchImpl)\n const receiptApi = new IccReceiptXApi(host, headers, cryptoApi, userApi, fetchImpl)\n const timetableApi = new IccTimeTableXApi(host, headers, cryptoApi, userApi, fetchImpl)\n const patientApi = new IccPatientXApi(\n host,\n headers,\n cryptoApi,\n contactApi,\n formApi,\n healthcareElementApi,\n invoiceApi,\n documentApi,\n healthcarePartyApi,\n classificationApi,\n userApi,\n calendarItemApi,\n ['note'],\n fetchImpl\n )\n const messageApi = new IccMessageXApi(host, headers, cryptoApi, userApi, fetchImpl)\n const maintenanceTaskApi = new IccMaintenanceTaskXApi(host, headers, cryptoApi, userApi, healthcarePartyApi, ['properties'], fetchImpl)\n\n if (autoLogin) {\n try {\n await retry(() => authApi.login({ username, password }), 3, 1000, 1.5)\n } catch (e) {\n console.error('Incorrect user and password used to instantiate Api, or network problem', e)\n }\n } else {\n console.info('Auto login skipped')\n }\n\n return {\n cryptoApi,\n authApi,\n codeApi,\n userApi,\n permissionApi,\n patientApi,\n healthcarePartyApi,\n deviceApi,\n accessLogApi,\n contactApi,\n healthcareElementApi,\n documentApi,\n formApi,\n invoiceApi,\n insuranceApi,\n messageApi,\n entityReferenceApi,\n receiptApi,\n agendaApi,\n calendarItemApi,\n classificationApi,\n timetableApi,\n groupApi,\n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AC5F;aACF;SACF;aACI;YACH,OAAO,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA;SACnC;QAED,OAAO;YACL,SAAS;YACT,OAAO;YACP,OAAO;YACP,OAAO;YACP,aAAa;YACb,UAAU;YACV,kBAAkB;YAClB,SAAS;YACT,YAAY;YACZ,UAAU;YACV,oBAAoB;YACpB,WAAW;YACX,OAAO;YACP,UAAU;YACV,YAAY;YACZ,UAAU;YACV,kBAAkB;YAClB,UAAU;YACV,SAAS;YACT,eAAe;YACf,iBAAiB;YACjB,YAAY;YACZ,QAAQ;YACR,kBAAkB;YAClB,YAAY;SACb,CAAA;IACH,CAAC;CAAA,CAAA;AA/FY,QAAA,GAAG,OA+Ff","sourcesContent":["import { IccAgendaApi, IccAuthApi, IccEntityrefApi, IccGroupApi, IccInsuranceApi, IccPatientApi, IccPermissionApi } from '../icc-api'\nimport { IccUserXApi } from './icc-user-x-api'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\nimport { IccContactXApi } from './icc-contact-x-api'\nimport { IccInvoiceXApi } from './icc-invoice-x-api'\nimport { IccDocumentXApi } from './icc-document-x-api'\nimport { IccHcpartyXApi } from './icc-hcparty-x-api'\nimport { IccFormXApi } from './icc-form-x-api'\nimport { IccHelementXApi } from './icc-helement-x-api'\nimport { IccClassificationXApi } from './icc-classification-x-api'\nimport { IccCalendarItemXApi } from './icc-calendar-item-x-api'\nimport { IccPatientXApi } from './icc-patient-x-api'\nimport { IccMessageXApi } from './icc-message-x-api'\nimport { IccReceiptXApi } from './icc-receipt-x-api'\nimport { IccAccesslogXApi } from './icc-accesslog-x-api'\nimport { IccTimeTableXApi } from './icc-time-table-x-api'\nimport { IccDeviceApi } from '../icc-api/api/IccDeviceApi'\nimport { IccCodeXApi } from './icc-code-x-api'\nimport { IccMaintenanceTaskXApi } from './icc-maintenance-task-x-api'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport { retry } from './utils'\n\nexport * from './icc-accesslog-x-api'\nexport * from './icc-bekmehr-x-api'\nexport * from './icc-calendar-item-x-api'\nexport * from './icc-classification-x-api'\nexport * from './icc-code-x-api'\nexport * from './icc-contact-x-api'\nexport * from './icc-crypto-x-api'\nexport * from './icc-doctemplate-x-api'\nexport * from './icc-document-x-api'\nexport * from './icc-form-x-api'\nexport * from './icc-hcparty-x-api'\nexport * from './icc-helement-x-api'\nexport * from './icc-invoice-x-api'\nexport * from './icc-message-x-api'\nexport * from './icc-patient-x-api'\nexport * from './icc-user-x-api'\nexport * from './icc-time-table-x-api'\nexport * from './icc-receipt-x-api'\nexport * from './utils'\n\nexport const apiHeaders = function (username: string, password: string, forceBasic = false) {\n return {\n Authorization: `Basic ${\n typeof btoa !== 'undefined' ? btoa(`${username}:${password}`) : Buffer.from(`${username}:${password}`).toString('base64')\n }`,\n 'force-authentication': forceBasic ? 'true' : 'false',\n }\n}\n\nexport interface Apis {\n authApi: IccAuthApi\n codeApi: IccCodeXApi\n entityReferenceApi: IccEntityrefApi\n userApi: IccUserXApi\n permissionApi: IccPermissionApi\n healthcarePartyApi: IccHcpartyXApi\n deviceApi: IccDeviceApi\n cryptoApi: IccCryptoXApi\n accessLogApi: IccAccesslogXApi\n agendaApi: IccAgendaApi\n contactApi: IccContactXApi\n formApi: IccFormXApi\n groupApi: IccGroupApi\n invoiceApi: IccInvoiceXApi\n insuranceApi: IccInsuranceApi\n documentApi: IccDocumentXApi\n healthcareElementApi: IccHelementXApi\n classificationApi: IccClassificationXApi\n calendarItemApi: IccCalendarItemXApi\n receiptApi: IccReceiptXApi\n timetableApi: IccTimeTableXApi\n patientApi: IccPatientXApi\n messageApi: IccMessageXApi\n maintenanceTaskApi: IccMaintenanceTaskXApi\n dataOwnerApi: IccDataOwnerXApi\n}\n\nexport const Api = async function (\n host: string,\n username: string,\n password: string,\n crypto: Crypto = typeof window !== 'undefined' ? window.crypto : typeof self !== 'undefined' ? self.crypto : ({} as Crypto),\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch,\n forceBasic = false,\n autoLogin = true\n): Promise<Apis> {\n const headers = apiHeaders(username, password, forceBasic)\n const authApi = new IccAuthApi(host, headers, fetchImpl)\n const codeApi = new IccCodeXApi(host, headers, fetchImpl)\n const entityReferenceApi = new IccEntityrefApi(host, headers, fetchImpl)\n const userApi = new IccUserXApi(host, headers, fetchImpl)\n const permissionApi = new IccPermissionApi(host, headers, fetchImpl)\n const healthcarePartyApi = new IccHcpartyXApi(host, headers, fetchImpl)\n const deviceApi = new IccDeviceApi(host, headers, fetchImpl)\n const cryptoApi = new IccCryptoXApi(host, headers, healthcarePartyApi, new IccPatientApi(host, headers, fetchImpl), deviceApi, crypto)\n const dataOwnerApi = new IccDataOwnerXApi(cryptoApi, new IccPatientApi(host, headers, fetchImpl))\n const accessLogApi = new IccAccesslogXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const agendaApi = new IccAgendaApi(host, headers, fetchImpl)\n const contactApi = new IccContactXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const formApi = new IccFormXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const groupApi = new IccGroupApi(host, headers)\n const invoiceApi = new IccInvoiceXApi(host, headers, cryptoApi, entityReferenceApi, dataOwnerApi, fetchImpl)\n const insuranceApi = new IccInsuranceApi(host, headers, fetchImpl)\n const documentApi = new IccDocumentXApi(host, headers, cryptoApi, authApi, dataOwnerApi, fetchImpl)\n const healthcareElementApi = new IccHelementXApi(host, headers, cryptoApi, dataOwnerApi, ['descr', 'note'], fetchImpl)\n const classificationApi = new IccClassificationXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const calendarItemApi = new IccCalendarItemXApi(host, headers, cryptoApi, dataOwnerApi, ['details', 'title', 'patientId'], fetchImpl)\n const receiptApi = new IccReceiptXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const timetableApi = new IccTimeTableXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const patientApi = new IccPatientXApi(\n host,\n headers,\n cryptoApi,\n contactApi,\n formApi,\n healthcareElementApi,\n invoiceApi,\n documentApi,\n healthcarePartyApi,\n classificationApi,\n dataOwnerApi,\n calendarItemApi,\n ['note'],\n fetchImpl\n )\n const messageApi = new IccMessageXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const maintenanceTaskApi = new IccMaintenanceTaskXApi(host, headers, cryptoApi, healthcarePartyApi, dataOwnerApi, ['properties'], fetchImpl)\n\n if (autoLogin) {\n if (username != undefined && password != undefined) {\n try {\n await retry(() => authApi.login({ username, password }), 3, 1000, 1.5)\n } catch (e) {\n console.error('Incorrect user and password used to instantiate Api, or network problem', e)\n }\n }\n }\n else {\n console.info(\"Auto login skipped\")\n }\n\n return {\n cryptoApi,\n authApi,\n codeApi,\n userApi,\n permissionApi,\n patientApi,\n healthcarePartyApi,\n deviceApi,\n accessLogApi,\n contactApi,\n healthcareElementApi,\n documentApi,\n formApi,\n invoiceApi,\n insuranceApi,\n messageApi,\n entityReferenceApi,\n receiptApi,\n agendaApi,\n calendarItemApi,\n classificationApi,\n timetableApi,\n groupApi,\n maintenanceTaskApi,\n dataOwnerApi,\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icure/api",
3
- "version": "5.0.14",
3
+ "version": "5.0.17",
4
4
  "description": "Typescript version of iCure standalone API client",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",