@icure/api 4.1.18 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/icc-api/api/IccGroupApi.d.ts +12 -2
- package/icc-api/api/IccGroupApi.js +26 -2
- package/icc-api/api/IccGroupApi.js.map +1 -1
- package/icc-x-api/filters/UserByNameEmailPhoneFilter.d.ts +18 -0
- package/icc-x-api/filters/UserByNameEmailPhoneFilter.js +25 -0
- package/icc-x-api/filters/UserByNameEmailPhoneFilter.js.map +1 -0
- package/icc-x-api/icc-accesslog-x-api.d.ts +3 -1
- package/icc-x-api/icc-accesslog-x-api.js +18 -17
- package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
- package/icc-x-api/icc-calendar-item-x-api.d.ts +4 -2
- package/icc-x-api/icc-calendar-item-x-api.js +19 -18
- package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
- package/icc-x-api/icc-classification-x-api.d.ts +3 -1
- package/icc-x-api/icc-classification-x-api.js +7 -6
- package/icc-x-api/icc-classification-x-api.js.map +1 -1
- package/icc-x-api/icc-contact-x-api.d.ts +3 -1
- package/icc-x-api/icc-contact-x-api.js +25 -21
- package/icc-x-api/icc-contact-x-api.js.map +1 -1
- package/icc-x-api/icc-crypto-x-api.d.ts +10 -10
- package/icc-x-api/icc-crypto-x-api.js +21 -21
- package/icc-x-api/icc-crypto-x-api.js.map +1 -1
- package/icc-x-api/icc-document-x-api.d.ts +4 -2
- package/icc-x-api/icc-document-x-api.js +24 -21
- package/icc-x-api/icc-document-x-api.js.map +1 -1
- package/icc-x-api/icc-form-x-api.d.ts +4 -2
- package/icc-x-api/icc-form-x-api.js +22 -21
- package/icc-x-api/icc-form-x-api.js.map +1 -1
- package/icc-x-api/icc-helement-x-api.d.ts +29 -4
- package/icc-x-api/icc-helement-x-api.js +136 -11
- package/icc-x-api/icc-helement-x-api.js.map +1 -1
- package/icc-x-api/icc-invoice-x-api.d.ts +5 -3
- package/icc-x-api/icc-invoice-x-api.js +22 -21
- package/icc-x-api/icc-invoice-x-api.js.map +1 -1
- package/icc-x-api/icc-message-x-api.d.ts +3 -1
- package/icc-x-api/icc-message-x-api.js +7 -6
- package/icc-x-api/icc-message-x-api.js.map +1 -1
- package/icc-x-api/icc-patient-x-api.d.ts +3 -1
- package/icc-x-api/icc-patient-x-api.js +19 -17
- package/icc-x-api/icc-patient-x-api.js.map +1 -1
- package/icc-x-api/icc-receipt-x-api.d.ts +4 -2
- package/icc-x-api/icc-receipt-x-api.js +21 -20
- package/icc-x-api/icc-receipt-x-api.js.map +1 -1
- package/icc-x-api/icc-time-table-x-api.d.ts +4 -2
- package/icc-x-api/icc-time-table-x-api.js +5 -4
- package/icc-x-api/icc-time-table-x-api.js.map +1 -1
- package/icc-x-api/icc-user-x-api.d.ts +2 -0
- package/icc-x-api/icc-user-x-api.js +8 -0
- package/icc-x-api/icc-user-x-api.js.map +1 -1
- package/icc-x-api/index.js +12 -12
- package/icc-x-api/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { IccReceiptApi } from '../icc-api';
|
|
2
2
|
import { IccCryptoXApi } from './icc-crypto-x-api';
|
|
3
3
|
import * as models from '../icc-api/model/models';
|
|
4
|
+
import { IccUserXApi } from './icc-user-x-api';
|
|
4
5
|
export declare class IccReceiptXApi extends IccReceiptApi {
|
|
5
6
|
private crypto;
|
|
7
|
+
userApi: IccUserXApi;
|
|
6
8
|
constructor(host: string, headers: {
|
|
7
9
|
[key: string]: string;
|
|
8
|
-
}, crypto: IccCryptoXApi, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
|
|
10
|
+
}, crypto: IccCryptoXApi, userApi: IccUserXApi, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
|
|
9
11
|
newInstance(user: models.User, r: any): Promise<models.Receipt>;
|
|
10
|
-
private initDelegationsAndEncryptionKeys;
|
|
11
12
|
initEncryptionKeys(user: models.User, rcpt: models.Receipt): Promise<models.Receipt & {
|
|
12
13
|
encryptionKeys: any;
|
|
13
14
|
}>;
|
|
15
|
+
private initDelegationsAndEncryptionKeys;
|
|
14
16
|
logReceipt(user: models.User, docId: string, refs: Array<string>, blobType: string, blob: ArrayBuffer): Promise<models.Receipt>;
|
|
15
17
|
}
|
|
@@ -5,13 +5,14 @@ const icc_api_1 = require("../icc-api");
|
|
|
5
5
|
const _ = require("lodash");
|
|
6
6
|
const models = require("../icc-api/model/models");
|
|
7
7
|
class IccReceiptXApi extends icc_api_1.IccReceiptApi {
|
|
8
|
-
constructor(host, headers, crypto, fetchImpl = typeof window !== 'undefined'
|
|
8
|
+
constructor(host, headers, crypto, userApi, fetchImpl = typeof window !== 'undefined'
|
|
9
9
|
? window.fetch
|
|
10
10
|
: typeof self !== 'undefined'
|
|
11
11
|
? self.fetch
|
|
12
12
|
: fetch) {
|
|
13
13
|
super(host, headers, fetchImpl);
|
|
14
14
|
this.crypto = crypto;
|
|
15
|
+
this.userApi = userApi;
|
|
15
16
|
}
|
|
16
17
|
newInstance(user, r) {
|
|
17
18
|
const receipt = new models.Receipt(_.extend({
|
|
@@ -19,17 +20,32 @@ class IccReceiptXApi extends icc_api_1.IccReceiptApi {
|
|
|
19
20
|
_type: 'org.taktik.icure.entities.Receipt',
|
|
20
21
|
created: new Date().getTime(),
|
|
21
22
|
modified: new Date().getTime(),
|
|
22
|
-
responsible:
|
|
23
|
+
responsible: this.userApi.getDataOwnerOf(user),
|
|
23
24
|
author: user.id,
|
|
24
25
|
codes: [],
|
|
25
26
|
tags: [],
|
|
26
27
|
}, r || {}));
|
|
27
28
|
return this.initDelegationsAndEncryptionKeys(user, receipt);
|
|
28
29
|
}
|
|
30
|
+
initEncryptionKeys(user, rcpt) {
|
|
31
|
+
const dataOwnerId = this.userApi.getDataOwnerOf(user);
|
|
32
|
+
return this.crypto.initEncryptionKeys(rcpt, dataOwnerId).then((eks) => {
|
|
33
|
+
let promise = Promise.resolve(_.extend(rcpt, {
|
|
34
|
+
encryptionKeys: eks.encryptionKeys,
|
|
35
|
+
}));
|
|
36
|
+
(user.autoDelegations ? (user.autoDelegations.all || []).concat(user.autoDelegations.medicalInformation || []) : []).forEach((delegateId) => (promise = promise.then((receipt) => this.crypto.appendEncryptionKeys(receipt, dataOwnerId, delegateId, eks.secretId).then((extraEks) => {
|
|
37
|
+
return _.extend(receipt, {
|
|
38
|
+
encryptionKeys: extraEks.encryptionKeys,
|
|
39
|
+
});
|
|
40
|
+
}))));
|
|
41
|
+
return promise;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
29
44
|
initDelegationsAndEncryptionKeys(user, receipt) {
|
|
45
|
+
const dataOwnerId = this.userApi.getDataOwnerOf(user);
|
|
30
46
|
return Promise.all([
|
|
31
|
-
this.crypto.initObjectDelegations(receipt, null,
|
|
32
|
-
this.crypto.initEncryptionKeys(receipt,
|
|
47
|
+
this.crypto.initObjectDelegations(receipt, null, dataOwnerId, null),
|
|
48
|
+
this.crypto.initEncryptionKeys(receipt, dataOwnerId),
|
|
33
49
|
]).then((initData) => {
|
|
34
50
|
const dels = initData[0];
|
|
35
51
|
const eks = initData[1];
|
|
@@ -40,28 +56,13 @@ class IccReceiptXApi extends icc_api_1.IccReceiptApi {
|
|
|
40
56
|
encryptionKeys: eks.encryptionKeys,
|
|
41
57
|
});
|
|
42
58
|
let promise = Promise.resolve(receipt);
|
|
43
|
-
(user.autoDelegations ? (user.autoDelegations.all || []).concat(user.autoDelegations.medicalInformation || []) : []).forEach((delegateId) => (promise = promise.then((receipt) => this.crypto
|
|
44
|
-
.addDelegationsAndEncryptionKeys(null, receipt, (user.healthcarePartyId || user.patientId), delegateId, dels.secretId, eks.secretId)
|
|
45
|
-
.catch((e) => {
|
|
59
|
+
(user.autoDelegations ? (user.autoDelegations.all || []).concat(user.autoDelegations.medicalInformation || []) : []).forEach((delegateId) => (promise = promise.then((receipt) => this.crypto.addDelegationsAndEncryptionKeys(null, receipt, dataOwnerId, delegateId, dels.secretId, eks.secretId).catch((e) => {
|
|
46
60
|
console.log(e);
|
|
47
61
|
return receipt;
|
|
48
62
|
}))));
|
|
49
63
|
return promise;
|
|
50
64
|
});
|
|
51
65
|
}
|
|
52
|
-
initEncryptionKeys(user, rcpt) {
|
|
53
|
-
return this.crypto.initEncryptionKeys(rcpt, (user.healthcarePartyId || user.patientId)).then((eks) => {
|
|
54
|
-
let promise = Promise.resolve(_.extend(rcpt, {
|
|
55
|
-
encryptionKeys: eks.encryptionKeys,
|
|
56
|
-
}));
|
|
57
|
-
(user.autoDelegations ? (user.autoDelegations.all || []).concat(user.autoDelegations.medicalInformation || []) : []).forEach((delegateId) => (promise = promise.then((receipt) => this.crypto.appendEncryptionKeys(receipt, (user.healthcarePartyId || user.patientId), delegateId, eks.secretId).then((extraEks) => {
|
|
58
|
-
return _.extend(receipt, {
|
|
59
|
-
encryptionKeys: extraEks.encryptionKeys,
|
|
60
|
-
});
|
|
61
|
-
}))));
|
|
62
|
-
return promise;
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
66
|
logReceipt(user, docId, refs, blobType, blob) {
|
|
66
67
|
return this.newInstance(user, { documentId: docId, references: refs })
|
|
67
68
|
.then((rcpt) => this.createReceipt(rcpt))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icc-receipt-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-receipt-x-api.ts"],"names":[],"mappings":";;;AAAA,wCAA0C;AAE1C,4BAA2B;AAC3B,kDAAiD;
|
|
1
|
+
{"version":3,"file":"icc-receipt-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-receipt-x-api.ts"],"names":[],"mappings":";;;AAAA,wCAA0C;AAE1C,4BAA2B;AAC3B,kDAAiD;AAGjD,MAAa,cAAe,SAAQ,uBAAa;IAG/C,YACE,IAAY,EACZ,OAAkC,EAC1B,MAAqB,EAC7B,OAAoB,EACpB,YAA2E,OAAO,MAAM,KAAK,WAAW;QACtG,CAAC,CAAC,MAAM,CAA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,CAAC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAG,EAAE,QAAQ,EAAE,EAAE,EAAO,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAClI,CAAC;CACF;AAhGD,wCAgGC","sourcesContent":["import { IccReceiptApi } from '../icc-api'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\nimport * as _ from 'lodash'\nimport * as models from '../icc-api/model/models'\nimport { IccUserXApi } from './icc-user-x-api'\n\nexport class IccReceiptXApi extends IccReceiptApi {\n userApi: IccUserXApi\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n private 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.userApi = userApi\n }\n\n newInstance(user: models.User, r: any): Promise<models.Receipt> {\n const receipt = new models.Receipt(\n _.extend(\n {\n id: this.crypto.randomUuid(),\n _type: 'org.taktik.icure.entities.Receipt',\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 r || {}\n )\n )\n\n return this.initDelegationsAndEncryptionKeys(user, receipt)\n }\n\n initEncryptionKeys(user: models.User, rcpt: models.Receipt) {\n const dataOwnerId = this.userApi.getDataOwnerOf(user)\n\n return this.crypto.initEncryptionKeys(rcpt, dataOwnerId).then((eks) => {\n let promise = Promise.resolve(\n _.extend(rcpt, {\n encryptionKeys: eks.encryptionKeys,\n })\n )\n ;(user.autoDelegations ? (user.autoDelegations.all || []).concat(user.autoDelegations.medicalInformation || []) : []).forEach(\n (delegateId) =>\n (promise = promise.then((receipt) =>\n this.crypto.appendEncryptionKeys(receipt, dataOwnerId, delegateId, eks.secretId).then((extraEks) => {\n return _.extend(receipt, {\n encryptionKeys: extraEks.encryptionKeys,\n })\n })\n ))\n )\n return promise\n })\n }\n\n private initDelegationsAndEncryptionKeys(user: models.User, receipt: models.Receipt): Promise<models.Receipt> {\n const dataOwnerId = this.userApi.getDataOwnerOf(user)\n\n return Promise.all([\n this.crypto.initObjectDelegations(receipt, null, dataOwnerId, null),\n this.crypto.initEncryptionKeys(receipt, dataOwnerId),\n ]).then((initData) => {\n const dels = initData[0]\n const eks = initData[1]\n _.extend(receipt, {\n delegations: dels.delegations,\n cryptedForeignKeys: dels.cryptedForeignKeys,\n secretForeignKeys: dels.secretForeignKeys,\n encryptionKeys: eks.encryptionKeys,\n })\n\n let promise = Promise.resolve(receipt)\n ;(user.autoDelegations ? (user.autoDelegations.all || []).concat(user.autoDelegations.medicalInformation || []) : []).forEach(\n (delegateId) =>\n (promise = promise.then((receipt) =>\n this.crypto.addDelegationsAndEncryptionKeys(null, receipt, dataOwnerId, delegateId, dels.secretId, eks.secretId).catch((e) => {\n console.log(e)\n return receipt\n })\n ))\n )\n return promise\n })\n }\n\n logReceipt(user: models.User, docId: string, refs: Array<string>, blobType: string, blob: ArrayBuffer) {\n return this.newInstance(user, { documentId: docId, references: refs })\n .then((rcpt) => this.createReceipt(rcpt))\n .then((rcpt) => (blob.byteLength != 0 ? this.setReceiptAttachment(rcpt.id!, blobType, '', <any>blob) : Promise.resolve(rcpt)))\n }\n}\n"]}
|
|
@@ -2,18 +2,20 @@ import { IccTimeTableApi } from '../icc-api';
|
|
|
2
2
|
import { User } from '../icc-api/model/User';
|
|
3
3
|
import { TimeTable } from '../icc-api/model/TimeTable';
|
|
4
4
|
import { IccCryptoXApi } from './icc-crypto-x-api';
|
|
5
|
+
import { IccUserXApi } from './icc-user-x-api';
|
|
5
6
|
export declare class IccTimeTableXApi extends IccTimeTableApi {
|
|
6
7
|
i18n: any;
|
|
7
8
|
crypto: IccCryptoXApi;
|
|
9
|
+
userApi: IccUserXApi;
|
|
8
10
|
constructor(host: string, headers: {
|
|
9
11
|
[key: string]: string;
|
|
10
|
-
}, crypto: IccCryptoXApi, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
|
|
12
|
+
}, crypto: IccCryptoXApi, userApi: IccUserXApi, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
|
|
11
13
|
newInstance(user: User, tt: TimeTable): Promise<{
|
|
12
14
|
id: string;
|
|
13
15
|
_type: string;
|
|
14
16
|
created: number;
|
|
15
17
|
modified: number;
|
|
16
|
-
responsible: string
|
|
18
|
+
responsible: string;
|
|
17
19
|
author: string | undefined;
|
|
18
20
|
codes: never[];
|
|
19
21
|
tags: never[];
|
|
@@ -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, fetchImpl = typeof window !== 'undefined'
|
|
8
|
+
constructor(host, headers, crypto, userApi, fetchImpl = typeof window !== 'undefined'
|
|
9
9
|
? window.fetch
|
|
10
10
|
: typeof self !== 'undefined'
|
|
11
11
|
? self.fetch
|
|
@@ -13,6 +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
17
|
}
|
|
17
18
|
newInstance(user, tt) {
|
|
18
19
|
const timeTable = _.extend({
|
|
@@ -20,16 +21,16 @@ class IccTimeTableXApi extends icc_api_1.IccTimeTableApi {
|
|
|
20
21
|
_type: 'org.taktik.icure.entities.TimeTable',
|
|
21
22
|
created: new Date().getTime(),
|
|
22
23
|
modified: new Date().getTime(),
|
|
23
|
-
responsible:
|
|
24
|
+
responsible: this.userApi.getDataOwnerOf(user),
|
|
24
25
|
author: user.id,
|
|
25
26
|
codes: [],
|
|
26
27
|
tags: [],
|
|
27
28
|
}, tt || {});
|
|
28
|
-
return this.crypto.initObjectDelegations(timeTable, null, (user
|
|
29
|
+
return this.crypto.initObjectDelegations(timeTable, null, this.userApi.getDataOwnerOf(user), null).then((initData) => {
|
|
29
30
|
_.extend(timeTable, { delegations: initData.delegations });
|
|
30
31
|
let promise = Promise.resolve(timeTable);
|
|
31
32
|
(user.autoDelegations ? (user.autoDelegations.all || []).concat(user.autoDelegations.medicalInformation || []) : []).forEach((delegateId) => (promise = promise
|
|
32
|
-
.then((patient) => this.crypto.extendedDelegationsAndCryptedForeignKeys(patient, null, (user
|
|
33
|
+
.then((patient) => this.crypto.extendedDelegationsAndCryptedForeignKeys(patient, null, this.userApi.getDataOwnerOf(user), delegateId, initData.secretId))
|
|
33
34
|
.then((extraData) => _.extend(timeTable, { delegations: extraData.delegations }))));
|
|
34
35
|
return promise;
|
|
35
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":[],"mappings":";;;AAAA,4CAA2C;AAE3C,4BAA2B;AAC3B,wCAA4C;
|
|
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,OAAoB,EACpB,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,I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AE,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,7 +1,9 @@
|
|
|
1
1
|
import { IccUserApi } from '../icc-api/api/IccUserApi';
|
|
2
|
+
import { User } from '../icc-api/model/User';
|
|
2
3
|
export declare class IccUserXApi extends IccUserApi {
|
|
3
4
|
fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
|
|
4
5
|
constructor(host: string, headers: {
|
|
5
6
|
[key: string]: string;
|
|
6
7
|
}, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
|
|
8
|
+
getDataOwnerOf(user: User): string;
|
|
7
9
|
}
|
|
@@ -11,6 +11,14 @@ 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
|
+
}
|
|
14
22
|
}
|
|
15
23
|
exports.IccUserXApi = IccUserXApi;
|
|
16
24
|
//# 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;CACF;
|
|
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"]}
|
package/icc-x-api/index.js
CHANGED
|
@@ -70,21 +70,21 @@ const Api = function (host, username, password, crypto = typeof window !== 'unde
|
|
|
70
70
|
const healthcarePartyApi = new icc_hcparty_x_api_1.IccHcpartyXApi(host, headers, fetchImpl);
|
|
71
71
|
const deviceApi = new IccDeviceApi_1.IccDeviceApi(host, headers, fetchImpl);
|
|
72
72
|
const cryptoApi = new icc_crypto_x_api_1.IccCryptoXApi(host, headers, healthcarePartyApi, new icc_api_1.IccPatientApi(host, headers, fetchImpl), deviceApi, crypto);
|
|
73
|
-
const accessLogApi = new icc_accesslog_x_api_1.IccAccesslogXApi(host, headers, cryptoApi, fetchImpl);
|
|
73
|
+
const accessLogApi = new icc_accesslog_x_api_1.IccAccesslogXApi(host, headers, cryptoApi, userApi, fetchImpl);
|
|
74
74
|
const agendaApi = new icc_api_1.IccAgendaApi(host, headers, fetchImpl);
|
|
75
|
-
const contactApi = new icc_contact_x_api_1.IccContactXApi(host, headers, cryptoApi, fetchImpl);
|
|
76
|
-
const formApi = new icc_form_x_api_1.IccFormXApi(host, headers, cryptoApi, fetchImpl);
|
|
75
|
+
const contactApi = new icc_contact_x_api_1.IccContactXApi(host, headers, cryptoApi, userApi, fetchImpl);
|
|
76
|
+
const formApi = new icc_form_x_api_1.IccFormXApi(host, headers, cryptoApi, userApi, fetchImpl);
|
|
77
77
|
const groupApi = new icc_api_1.IccGroupApi(host, headers);
|
|
78
|
-
const invoiceApi = new icc_invoice_x_api_1.IccInvoiceXApi(host, headers, cryptoApi, entityReferenceApi, fetchImpl);
|
|
78
|
+
const invoiceApi = new icc_invoice_x_api_1.IccInvoiceXApi(host, headers, cryptoApi, entityReferenceApi, userApi, fetchImpl);
|
|
79
79
|
const insuranceApi = new icc_api_1.IccInsuranceApi(host, headers, fetchImpl);
|
|
80
|
-
const documentApi = new icc_document_x_api_1.IccDocumentXApi(host, headers, cryptoApi, authApi, fetchImpl);
|
|
81
|
-
const healthcareElementApi = new icc_helement_x_api_1.IccHelementXApi(host, headers, cryptoApi, fetchImpl);
|
|
82
|
-
const classificationApi = new icc_classification_x_api_1.IccClassificationXApi(host, headers, cryptoApi, fetchImpl);
|
|
83
|
-
const calendarItemApi = new icc_calendar_item_x_api_1.IccCalendarItemXApi(host, headers, cryptoApi, fetchImpl);
|
|
84
|
-
const receiptApi = new icc_receipt_x_api_1.IccReceiptXApi(host, headers, cryptoApi, fetchImpl);
|
|
85
|
-
const timetableApi = new icc_time_table_x_api_1.IccTimeTableXApi(host, headers, cryptoApi, fetchImpl);
|
|
86
|
-
const patientApi = new icc_patient_x_api_1.IccPatientXApi(host, headers, cryptoApi, contactApi, formApi, healthcareElementApi, invoiceApi, documentApi, healthcarePartyApi, classificationApi, calendarItemApi, ['note'], fetchImpl);
|
|
87
|
-
const messageApi = new icc_message_x_api_1.IccMessageXApi(host, headers, cryptoApi, fetchImpl);
|
|
80
|
+
const documentApi = new icc_document_x_api_1.IccDocumentXApi(host, headers, cryptoApi, authApi, userApi, fetchImpl);
|
|
81
|
+
const healthcareElementApi = new icc_helement_x_api_1.IccHelementXApi(host, headers, cryptoApi, userApi, [], fetchImpl);
|
|
82
|
+
const classificationApi = new icc_classification_x_api_1.IccClassificationXApi(host, headers, cryptoApi, userApi, fetchImpl);
|
|
83
|
+
const calendarItemApi = new icc_calendar_item_x_api_1.IccCalendarItemXApi(host, headers, cryptoApi, userApi, fetchImpl);
|
|
84
|
+
const receiptApi = new icc_receipt_x_api_1.IccReceiptXApi(host, headers, cryptoApi, userApi, fetchImpl);
|
|
85
|
+
const timetableApi = new icc_time_table_x_api_1.IccTimeTableXApi(host, headers, cryptoApi, userApi, fetchImpl);
|
|
86
|
+
const patientApi = new icc_patient_x_api_1.IccPatientXApi(host, headers, cryptoApi, contactApi, formApi, healthcareElementApi, invoiceApi, documentApi, healthcarePartyApi, classificationApi, userApi, calendarItemApi, ['note'], fetchImpl);
|
|
87
|
+
const messageApi = new icc_message_x_api_1.IccMessageXApi(host, headers, cryptoApi, userApi, fetchImpl);
|
|
88
88
|
return {
|
|
89
89
|
cryptoApi,
|
|
90
90
|
authApi,
|
package/icc-x-api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../icc-x-api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../icc-x-api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,wCAAiH;AACjH,qDAA4C;AAC5C,yDAAgD;AAChD,2DAAkD;AAClD,2DAAkD;AAClD,6DAAoD;AACpD,2DAAkD;AAClD,qDAA4C;AAC5C,6DAAoD;AACpD,yEAAgE;AAChE,uEAA6D;AAC7D,2DAAkD;AAClD,2DAAkD;AAClD,2DAAkD;AAClD,+DAAsD;AACtD,iEAAuD;AACvD,8DAAwD;AACxD,qDAA4C;AAE5C,wDAAqC;AACrC,sDAAmC;AACnC,4DAAyC;AACzC,6DAA0C;AAC1C,mDAAgC;AAChC,sDAAmC;AACnC,qDAAkC;AAClC,0DAAuC;AACvC,uDAAoC;AACpC,mDAAgC;AAChC,sDAAmC;AACnC,uDAAoC;AACpC,sDAAmC;AACnC,sDAAmC;AACnC,sDAAmC;AACnC,mDAAgC;AAChC,yDAAsC;AACtC,sDAAmC;AACnC,wCAAkD;AAAzC,8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InsuranceApi, IccPatientApi} 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'\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 { utils, UtilsClass } from './crypto/utils'\nexport * from './utils'\n\nexport const apiHeaders = function (username: string, password: string) {\n return {\n Authorization: `Basic ${\n typeof btoa !== 'undefined' ? btoa(`${username}:${password}`) : Buffer.from(`${username}:${password}`).toString('base64')\n }`,\n }\n}\n\nexport const Api = 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) {\n const headers = apiHeaders(username, password)\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 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, [], fetchImpl)\n const classificationApi = new IccClassificationXApi(host, headers, cryptoApi, userApi, fetchImpl)\n const calendarItemApi = new IccCalendarItemXApi(host, headers, cryptoApi, userApi, 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\n return {\n cryptoApi,\n authApi,\n codeApi,\n userApi,\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 }\n}\n"]}
|