@icure/api 8.0.14 → 8.0.16

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.
@@ -13,6 +13,7 @@ exports.Content = void 0;
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  const Measure_1 = require("./Measure");
16
+ const Service_1 = require("./Service");
16
17
  /**
17
18
  * Information contained in the service. Content is localized, using ISO language code as key
18
19
  */
@@ -23,6 +24,9 @@ class Content {
23
24
  if (!!(json === null || json === void 0 ? void 0 : json.measureValue)) {
24
25
  this.measureValue = new Measure_1.Measure(json.measureValue);
25
26
  }
27
+ if (!!(json === null || json === void 0 ? void 0 : json.compoundValue)) {
28
+ this.compoundValue = json.compoundValue.map((service) => new Service_1.Service(service));
29
+ }
26
30
  }
27
31
  }
28
32
  exports.Content = Content;
@@ -1 +1 @@
1
- {"version":3,"file":"Content.js","sourceRoot":"","sources":["../../../icc-api/model/Content.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,uCAAmC;AAKnC;;GAEG;AACH,+CAAuC;AACvC,MAAa,OAAO;IAClB,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CACX,IAAe,EACf,IAAI,EACJ,CAAC,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,CAAA,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAA,qBAAO,EAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAC7E,CAAA;QAED,IAAI,CAAC,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,YAAY,CAAA,EAAE;YACxB,IAAI,CAAC,YAAY,GAAG,IAAI,iBAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;SACnD;IAEH,CAAC;CAqBF;AAjCD,0BAiCC","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 { Measure } from './Measure'\nimport { Medication } from './Medication'\nimport { Service } from './Service'\nimport { TimeSeries } from './TimeSeries'\n\n/**\n * Information contained in the service. Content is localized, using ISO language code as key\n */\nimport { b64_2ab } from './ModelHelper'\nexport class Content {\n constructor(json: JSON | any) {\n Object.assign(\n this as Content,\n json,\n !!json?.binaryValue ? { binaryValue: b64_2ab(json.binaryValue) } : undefined,\n )\n\n if (!!json?.measureValue) {\n this.measureValue = new Measure(json.measureValue)\n }\n\n }\n\n stringValue?: string\n numberValue?: number\n booleanValue?: boolean\n instantValue?: number\n /**\n * Value as date. The format could have a all three (day, month and year) or values on any of these three, whatever is known.\n */\n fuzzyDateValue?: number\n binaryValue?: ArrayBuffer\n /**\n * Linked document.\n */\n documentId?: string\n measureValue?: Measure\n medicationValue?: Medication\n timeSeries?: TimeSeries\n compoundValue?: Array<Service>\n ratio?: Array<Measure>\n range?: Array<Measure>\n}\n"]}
1
+ {"version":3,"file":"Content.js","sourceRoot":"","sources":["../../../icc-api/model/Content.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,uCAAmC;AAEnC,uCAAmC;AAGnC;;GAEG;AACH,+CAAuC;AACvC,MAAa,OAAO;IAClB,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CACX,IAAe,EACf,IAAI,EACJ,CAAC,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,CAAA,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAA,qBAAO,EAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAC7E,CAAA;QAED,IAAI,CAAC,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,YAAY,CAAA,EAAE;YACxB,IAAI,CAAC,YAAY,GAAG,IAAI,iBAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;SACnD;QAED,IAAI,CAAC,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,aAAa,CAAA,EAAE;YACzB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,OAAmB,EAAE,EAAE,CAAC,IAAI,iBAAO,CAAC,OAAO,CAAC,CAAC,CAAA;SAC3F;IACH,CAAC;CAqBF;AApCD,0BAoCC","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 { Measure } from './Measure'\nimport { Medication } from './Medication'\nimport { Service } from './Service'\nimport { TimeSeries } from './TimeSeries'\n\n/**\n * Information contained in the service. Content is localized, using ISO language code as key\n */\nimport { b64_2ab } from './ModelHelper'\nexport class Content {\n constructor(json: JSON | any) {\n Object.assign(\n this as Content,\n json,\n !!json?.binaryValue ? { binaryValue: b64_2ab(json.binaryValue) } : undefined,\n )\n\n if (!!json?.measureValue) {\n this.measureValue = new Measure(json.measureValue)\n }\n\n if (!!json?.compoundValue) {\n this.compoundValue = json.compoundValue.map((service: JSON | any) => new Service(service))\n }\n }\n\n stringValue?: string\n numberValue?: number\n booleanValue?: boolean\n instantValue?: number\n /**\n * Value as date. The format could have a all three (day, month and year) or values on any of these three, whatever is known.\n */\n fuzzyDateValue?: number\n binaryValue?: ArrayBuffer\n /**\n * Linked document.\n */\n documentId?: string\n measureValue?: Measure\n medicationValue?: Medication\n timeSeries?: TimeSeries\n compoundValue?: Array<Service>\n ratio?: Array<Measure>\n range?: Array<Measure>\n}\n"]}
@@ -13,7 +13,7 @@ import { CodeStub } from './CodeStub';
13
13
  import { ReferenceRange } from "./ReferenceRange";
14
14
  export declare class Measure {
15
15
  /**
16
- * We delete min and max from the json and create a referenceRange from it
16
+ * We delete min and max from the json and create a referenceRanges from it
17
17
  * Since this is a shallow copy, deletion of min and max will have no effect on the original json since it's the top level fields
18
18
  *
19
19
  * @param json
@@ -32,5 +32,5 @@ export declare class Measure {
32
32
  /**
33
33
  * Reference range for the measure
34
34
  */
35
- referenceRange?: Array<ReferenceRange>;
35
+ referenceRanges?: Array<ReferenceRange>;
36
36
  }
@@ -4,7 +4,7 @@ exports.Measure = void 0;
4
4
  const ReferenceRange_1 = require("./ReferenceRange");
5
5
  class Measure {
6
6
  /**
7
- * We delete min and max from the json and create a referenceRange from it
7
+ * We delete min and max from the json and create a referenceRanges from it
8
8
  * Since this is a shallow copy, deletion of min and max will have no effect on the original json since it's the top level fields
9
9
  *
10
10
  * @param json
@@ -12,7 +12,7 @@ class Measure {
12
12
  constructor(json) {
13
13
  const measureValue = Object.assign({}, json);
14
14
  if (!!(measureValue === null || measureValue === void 0 ? void 0 : measureValue.min) || !!(measureValue === null || measureValue === void 0 ? void 0 : measureValue.max)) {
15
- measureValue.referenceRange = [
15
+ measureValue.referenceRanges = [
16
16
  new ReferenceRange_1.ReferenceRange({
17
17
  low: measureValue.min,
18
18
  high: measureValue.max
@@ -1 +1 @@
1
- {"version":3,"file":"Measure.js","sourceRoot":"","sources":["../../../icc-api/model/Measure.ts"],"names":[],"mappings":";;;AAYA,qDAA+C;AAE/C,MAAa,OAAO;IAClB;;;;;OAKG;IACH,YAAY,IAAgB;QAC1B,MAAM,YAAY,qBAAO,IAAI,CAAC,CAAA;QAE9B,IAAI,CAAC,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,GAAG,CAAA,IAAI,CAAC,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,GAAG,CAAA,EAAE;YAC9C,YAAY,CAAC,cAAc,GAAG;gBAC5B,IAAI,+BAAc,CAAC;oBACjB,GAAG,EAAE,YAAY,CAAC,GAAG;oBACrB,IAAI,EAAE,YAAY,CAAC,GAAG;iBACvB,CAAC;aACH,CAAA;YACM,YAAY,aAAZ,YAAY,4BAAZ,YAAY,CAAE,GAAG,CAAA;YACjB,YAAY,aAAZ,YAAY,4BAAZ,YAAY,CAAE,GAAG,CAAA;SACzB;QAED,MAAM,CAAC,MAAM,CAAC,IAAe,EAAE,YAAY,CAAC,CAAA;IAC9C,CAAC;CAgBF;AAtCD,0BAsCC","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 { CodeStub } from './CodeStub'\nimport {ReferenceRange} from \"./ReferenceRange\"\n\nexport class Measure {\n /**\n * We delete min and max from the json and create a referenceRange from it\n * Since this is a shallow copy, deletion of min and max will have no effect on the original json since it's the top level fields\n *\n * @param json\n */\n constructor(json: JSON | any) {\n const measureValue = {...json}\n\n if (!!measureValue?.min || !!measureValue?.max) {\n measureValue.referenceRange = [\n new ReferenceRange({\n low: measureValue.min,\n high: measureValue.max\n })\n ]\n delete measureValue?.min\n delete measureValue?.max\n }\n\n Object.assign(this as Measure, measureValue)\n }\n\n value?: number\n ref?: number\n severity?: number\n severityCode?: string\n evolution?: number\n unit?: string\n sign?: string\n unitCodes?: Array<CodeStub>\n comment?: string\n comparator?: string\n /**\n * Reference range for the measure\n */\n referenceRange?: Array<ReferenceRange>\n}\n"]}
1
+ {"version":3,"file":"Measure.js","sourceRoot":"","sources":["../../../icc-api/model/Measure.ts"],"names":[],"mappings":";;;AAYA,qDAA+C;AAE/C,MAAa,OAAO;IAClB;;;;;OAKG;IACH,YAAY,IAAgB;QAC1B,MAAM,YAAY,qBAAO,IAAI,CAAC,CAAA;QAE9B,IAAI,CAAC,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,GAAG,CAAA,IAAI,CAAC,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,GAAG,CAAA,EAAE;YAC9C,YAAY,CAAC,eAAe,GAAG;gBAC7B,IAAI,+BAAc,CAAC;oBACjB,GAAG,EAAE,YAAY,CAAC,GAAG;oBACrB,IAAI,EAAE,YAAY,CAAC,GAAG;iBACvB,CAAC;aACH,CAAA;YACM,YAAY,aAAZ,YAAY,4BAAZ,YAAY,CAAE,GAAG,CAAA;YACjB,YAAY,aAAZ,YAAY,4BAAZ,YAAY,CAAE,GAAG,CAAA;SACzB;QAED,MAAM,CAAC,MAAM,CAAC,IAAe,EAAE,YAAY,CAAC,CAAA;IAC9C,CAAC;CAgBF;AAtCD,0BAsCC","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 { CodeStub } from './CodeStub'\nimport {ReferenceRange} from \"./ReferenceRange\"\n\nexport class Measure {\n /**\n * We delete min and max from the json and create a referenceRanges from it\n * Since this is a shallow copy, deletion of min and max will have no effect on the original json since it's the top level fields\n *\n * @param json\n */\n constructor(json: JSON | any) {\n const measureValue = {...json}\n\n if (!!measureValue?.min || !!measureValue?.max) {\n measureValue.referenceRanges = [\n new ReferenceRange({\n low: measureValue.min,\n high: measureValue.max\n })\n ]\n delete measureValue?.min\n delete measureValue?.max\n }\n\n Object.assign(this as Measure, measureValue)\n }\n\n value?: number\n ref?: number\n severity?: number\n severityCode?: string\n evolution?: number\n unit?: string\n sign?: string\n unitCodes?: Array<CodeStub>\n comment?: string\n comparator?: string\n /**\n * Reference range for the measure\n */\n referenceRanges?: Array<ReferenceRange>\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Service.js","sourceRoot":"","sources":["../../../icc-api/model/Service.ts"],"names":[],"mappings":";;;AAaA,uCAAmC;AAMnC;;GAEG;AACH,MAAa,OAAO;IAClB,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CACX,IAAe,EACf,IAAI,CACL,CAAA;QAED,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE;YAClB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,WAAW,CAC/B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,iBAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAC9E,CAAA;SACF;IACH,CAAC;CAoIF;AAhJD,0BAgJC","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 { Annotation } from './Annotation'\nimport { CodeStub } from './CodeStub'\nimport { Content } from './Content'\nimport { Delegation } from './Delegation'\nimport { Identifier } from './Identifier'\nimport { SecurityMetadata } from './SecurityMetadata'\nimport { EntityWithDelegationTypeName } from '../../icc-x-api/utils/EntityWithDelegationTypeName'\n\n/**\n * This entity represents a Service. A Service is created in the course a contact. Services include subjective information provided by the patient, such as complaints, reason for visit, feelings, etc. or objective information like bio-metric measures (blood pressure, temperature, heart beat, etc.), or physical exam description, diagnosis, prescription, integration of lab reports from another healthcare party, action plan, etc. Any action performed by the healthcare party which is relevant for the healthcare element of a patient is considered a service. The services can be linked to healthcare elements or other structuring elements of the medical record\n */\nexport class Service {\n constructor(json: JSON | any) {\n Object.assign(\n this as Service,\n json\n )\n\n if (!!this.content) {\n this.content = Object.fromEntries(\n Object.entries(this.content).map(([key, value]) => [key, new Content(value)])\n )\n }\n }\n\n /**\n * The Id of the Service. We encourage using either a v4 UUID or a HL7 Id.\n */\n id?: string\n /**\n * The transactionId is used when a single service had to be split into parts for technical reasons. Several services with the same non null transaction id form one single service\n */\n transactionId?: string\n identifier?: Array<Identifier>\n /**\n * Id of the contact during which the service is provided\n */\n contactId?: string\n /**\n * List of IDs of all sub-contacts that link the service to structural elements. Only used when the Service is emitted outside of its contact\n */\n subContactIds?: Array<string>\n /**\n * List of IDs of all plans of actions (healthcare approaches) as a part of which the Service is provided. Only used when the Service is emitted outside of its contact\n */\n plansOfActionIds?: Array<string>\n /**\n * List of IDs of all healthcare elements for which the service is provided. Only used when the Service is emitted outside of its contact\n */\n healthElementsIds?: Array<string>\n /**\n * List of Ids of all forms linked to the Service. Only used when the Service is emitted outside of its contact.\n */\n formIds?: Array<string>\n /**\n * The secret patient key, encrypted in the patient document, in clear here.\n */\n secretForeignKeys?: Array<string>\n /**\n * The public patient key, encrypted here for separate Crypto Actors.\n */\n cryptedForeignKeys?: { [key: string]: Array<Delegation> }\n /**\n * The delegations giving access to connected healthcare information.\n */\n delegations?: { [key: string]: Array<Delegation> }\n /**\n * The contact secret encryption key used to encrypt the secured properties (like services for example), encrypted for separate Crypto Actors.\n */\n encryptionKeys?: { [key: string]: Array<Delegation> }\n /**\n * Description / Unambiguous qualification (LOINC code) of the type of information contained in the service. Could be a code to qualify temperature, complaint, diagnostic, ...\n */\n label?: string\n dataClassName?: string\n /**\n * Used for sorting services inside an upper object (A contact, a transaction, a FHIR bundle, ...)\n */\n index?: number\n /**\n * Information contained in the service. Content is localized, using ISO language code as key\n */\n content?: { [key: string]: Content }\n encryptedContent?: string\n textIndexes?: { [key: string]: string }\n /**\n * The date (YYYYMMDDhhmmss) when the Service is noted to have started and also closes on the same date\n */\n valueDate?: number\n /**\n * The date (YYYYMMDDhhmmss) of the start of the Service\n */\n openingDate?: number\n /**\n * The date (YYYYMMDDhhmmss) marking the end of the Service\n */\n closingDate?: number\n /**\n * Id of the form used during the Service\n */\n formId?: string\n /**\n * The timestamp (unix epoch in ms) of creation of this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n created?: number\n /**\n * The date (unix epoch in ms) of the latest modification of this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n modified?: number\n /**\n * Soft delete (unix epoch in ms) timestamp of the object.\n */\n endOfLife?: number\n /**\n * The id of the User that has created this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n author?: string\n /**\n * The id of the HealthcareParty that is responsible for this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n responsible?: string\n /**\n * The id of the medical location where this entity was created.\n */\n medicalLocationId?: string\n /**\n * Text, comments on the Service provided\n */\n comment?: string\n status?: number\n /**\n * List of invoicing codes\n */\n invoicingCodes?: Array<string>\n /**\n * Comments - Notes recorded by a HCP about this service\n */\n notes?: Array<Annotation>\n /**\n * Links towards related services (possibly in other contacts)\n */\n qualifiedLinks?: { [key: string]: { [key: string]: string } }\n /**\n * A code is an item from a codification system that qualifies the content of this entity. SNOMED-CT, ICPC-2 or ICD-10 codifications systems can be used for codes\n */\n codes?: Array<CodeStub>\n /**\n * A tag is an item from a codification system that qualifies an entity as being member of a certain class, whatever the value it might have taken. If the tag qualifies the content of a field, it means that whatever the content of the field, the tag will always apply. For example, the label of a field is qualified using a tag. LOINC is a codification system typically used for tags.\n */\n tags?: Array<CodeStub>\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 securityMetadata?: SecurityMetadata\n}\n"]}
1
+ {"version":3,"file":"Service.js","sourceRoot":"","sources":["../../../icc-api/model/Service.ts"],"names":[],"mappings":";;;AAaA,uCAAmC;AAKnC;;GAEG;AACH,MAAa,OAAO;IAClB,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CACX,IAAe,EACf,IAAI,CACL,CAAA;QAED,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE;YAClB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,WAAW,CAC/B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,iBAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAC9E,CAAA;SACF;IACH,CAAC;CAoIF;AAhJD,0BAgJC","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 { Annotation } from './Annotation'\nimport { CodeStub } from './CodeStub'\nimport { Content } from './Content'\nimport { Delegation } from './Delegation'\nimport { Identifier } from './Identifier'\nimport { SecurityMetadata } from './SecurityMetadata'\n\n/**\n * This entity represents a Service. A Service is created in the course a contact. Services include subjective information provided by the patient, such as complaints, reason for visit, feelings, etc. or objective information like bio-metric measures (blood pressure, temperature, heart beat, etc.), or physical exam description, diagnosis, prescription, integration of lab reports from another healthcare party, action plan, etc. Any action performed by the healthcare party which is relevant for the healthcare element of a patient is considered a service. The services can be linked to healthcare elements or other structuring elements of the medical record\n */\nexport class Service {\n constructor(json: JSON | any) {\n Object.assign(\n this as Service,\n json\n )\n\n if (!!this.content) {\n this.content = Object.fromEntries(\n Object.entries(this.content).map(([key, value]) => [key, new Content(value)])\n )\n }\n }\n\n /**\n * The Id of the Service. We encourage using either a v4 UUID or a HL7 Id.\n */\n id?: string\n /**\n * The transactionId is used when a single service had to be split into parts for technical reasons. Several services with the same non null transaction id form one single service\n */\n transactionId?: string\n identifier?: Array<Identifier>\n /**\n * Id of the contact during which the service is provided\n */\n contactId?: string\n /**\n * List of IDs of all sub-contacts that link the service to structural elements. Only used when the Service is emitted outside of its contact\n */\n subContactIds?: Array<string>\n /**\n * List of IDs of all plans of actions (healthcare approaches) as a part of which the Service is provided. Only used when the Service is emitted outside of its contact\n */\n plansOfActionIds?: Array<string>\n /**\n * List of IDs of all healthcare elements for which the service is provided. Only used when the Service is emitted outside of its contact\n */\n healthElementsIds?: Array<string>\n /**\n * List of Ids of all forms linked to the Service. Only used when the Service is emitted outside of its contact.\n */\n formIds?: Array<string>\n /**\n * The secret patient key, encrypted in the patient document, in clear here.\n */\n secretForeignKeys?: Array<string>\n /**\n * The public patient key, encrypted here for separate Crypto Actors.\n */\n cryptedForeignKeys?: { [key: string]: Array<Delegation> }\n /**\n * The delegations giving access to connected healthcare information.\n */\n delegations?: { [key: string]: Array<Delegation> }\n /**\n * The contact secret encryption key used to encrypt the secured properties (like services for example), encrypted for separate Crypto Actors.\n */\n encryptionKeys?: { [key: string]: Array<Delegation> }\n /**\n * Description / Unambiguous qualification (LOINC code) of the type of information contained in the service. Could be a code to qualify temperature, complaint, diagnostic, ...\n */\n label?: string\n dataClassName?: string\n /**\n * Used for sorting services inside an upper object (A contact, a transaction, a FHIR bundle, ...)\n */\n index?: number\n /**\n * Information contained in the service. Content is localized, using ISO language code as key\n */\n content?: { [key: string]: Content }\n encryptedContent?: string\n textIndexes?: { [key: string]: string }\n /**\n * The date (YYYYMMDDhhmmss) when the Service is noted to have started and also closes on the same date\n */\n valueDate?: number\n /**\n * The date (YYYYMMDDhhmmss) of the start of the Service\n */\n openingDate?: number\n /**\n * The date (YYYYMMDDhhmmss) marking the end of the Service\n */\n closingDate?: number\n /**\n * Id of the form used during the Service\n */\n formId?: string\n /**\n * The timestamp (unix epoch in ms) of creation of this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n created?: number\n /**\n * The date (unix epoch in ms) of the latest modification of this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n modified?: number\n /**\n * Soft delete (unix epoch in ms) timestamp of the object.\n */\n endOfLife?: number\n /**\n * The id of the User that has created this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n author?: string\n /**\n * The id of the HealthcareParty that is responsible for this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n responsible?: string\n /**\n * The id of the medical location where this entity was created.\n */\n medicalLocationId?: string\n /**\n * Text, comments on the Service provided\n */\n comment?: string\n status?: number\n /**\n * List of invoicing codes\n */\n invoicingCodes?: Array<string>\n /**\n * Comments - Notes recorded by a HCP about this service\n */\n notes?: Array<Annotation>\n /**\n * Links towards related services (possibly in other contacts)\n */\n qualifiedLinks?: { [key: string]: { [key: string]: string } }\n /**\n * A code is an item from a codification system that qualifies the content of this entity. SNOMED-CT, ICPC-2 or ICD-10 codifications systems can be used for codes\n */\n codes?: Array<CodeStub>\n /**\n * A tag is an item from a codification system that qualifies an entity as being member of a certain class, whatever the value it might have taken. If the tag qualifies the content of a field, it means that whatever the content of the field, the tag will always apply. For example, the label of a field is qualified using a tag. LOINC is a codification system typically used for tags.\n */\n tags?: Array<CodeStub>\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 securityMetadata?: SecurityMetadata\n}\n"]}
@@ -177,10 +177,12 @@ export * from './PaginatedListDocument';
177
177
  export * from './PaginatedListEntityTemplate';
178
178
  export * from './PaginatedListForm';
179
179
  export * from './PaginatedListGroup';
180
- export * from './PaginatedListHealthElement';
181
180
  export * from './PaginatedListHealthcareParty';
181
+ export * from './PaginatedListHealthElement';
182
+ export * from './PaginatedListInsurance';
182
183
  export * from './PaginatedListInvoice';
183
184
  export * from './PaginatedListMaintenanceTask';
185
+ export * from './PaginatedListMedicalLocation';
184
186
  export * from './PaginatedListMessage';
185
187
  export * from './PaginatedListNmp';
186
188
  export * from './PaginatedListPatient';
@@ -176,10 +176,12 @@ __exportStar(require("./PaginatedListDocument"), exports);
176
176
  __exportStar(require("./PaginatedListEntityTemplate"), exports);
177
177
  __exportStar(require("./PaginatedListForm"), exports);
178
178
  __exportStar(require("./PaginatedListGroup"), exports);
179
- __exportStar(require("./PaginatedListHealthElement"), exports);
180
179
  __exportStar(require("./PaginatedListHealthcareParty"), exports);
180
+ __exportStar(require("./PaginatedListHealthElement"), exports);
181
+ __exportStar(require("./PaginatedListInsurance"), exports);
181
182
  __exportStar(require("./PaginatedListInvoice"), exports);
182
183
  __exportStar(require("./PaginatedListMaintenanceTask"), exports);
184
+ __exportStar(require("./PaginatedListMedicalLocation"), exports);
183
185
  __exportStar(require("./PaginatedListMessage"), exports);
184
186
  __exportStar(require("./PaginatedListNmp"), exports);
185
187
  __exportStar(require("./PaginatedListPatient"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../icc-api/model/models.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAkBA,uDAAoC;AACpC,0DAAuC;AACvC,yDAAsC;AACtC,gEAA6C;AAC7C,kEAA+C;AAC/C,0DAAuC;AACvC,kEAA+C;AAC/C,0DAAuC;AACvC,0DAAuC;AACvC,uDAAoC;AACpC,8CAA2B;AAC3B,kDAA+B;AAC/B,4CAAyB;AACzB,2DAAwC;AACxC,2CAAwB;AACxB,sDAAmC;AACnC,wCAAqB;AACrB,iDAA8B;AAC9B,yCAAsB;AACtB,kDAA+B;AAC/B,+CAA4B;AAC5B,wDAAqC;AACrC,4DAAyC;AACzC,4CAAyB;AACzB,wCAAqB;AACrB,uDAAoC;AACpC,2DAAwC;AACxC,wDAAqC;AACrC,0CAAuB;AACvB,yCAAsB;AACtB,gEAA6C;AAC7C,iDAA8B;AAC9B,oDAAiC;AACjC,qDAAkC;AAClC,mDAAgC;AAChC,uDAAoC;AACpC,0DAAuC;AACvC,mDAAgC;AAChC,2DAAwC;AACxC,yCAAsB;AACtB,6CAA0B;AAC1B,6CAA0B;AAC1B,4DAAyC;AACzC,sDAAmC;AACnC,4CAAyB;AACzB,4CAAyB;AACzB,4CAAyB;AACzB,8CAA2B;AAC3B,oDAAiC;AACjC,yCAAsB;AACtB,mDAAgC;AAChC,iEAA8C;AAC9C,sDAAmC;AACnC,iDAA8B;AAC9B,2DAAwC;AACxC,4DAAyC;AACzC,+CAA4B;AAC5B,sDA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5B,kDAA+B;AAC/B,4CAAyB;AACzB,4CAAyB;AACzB,gDAA6B;AAC7B,8DAA2C;AAC3C,sDAAmC;AACnC,kDAA+B;AAC/B,qDAAkC;AAClC,+CAA4B;AAC5B,8CAA2B;AAC3B,kDAA+B;AAC/B,qDAAkC;AAClC,4CAAyB;AACzB,kDAA+B;AAC/B,qDAAkC;AAClC,mDAAgC;AAChC,kDAA+B;AAC/B,+CAA4B;AAC5B,wCAAqB;AACrB,iDAA8B;AAC9B,4CAAyB;AACzB,+CAA4B;AAC5B,8CAA2B;AAC3B,kDAA+B;AAC/B,kDAA+B;AAC/B,mDAAgC;AAChC,qDAAkC;AAClC,yCAAsB;AACtB,yCAAsB;AACtB,2DAAwC;AACxC,8CAA2B;AAC3B,iDAA8B;AAC9B,iDAA8B;AAC9B,0CAAuB;AACvB,gDAA6B;AAC7B,sDAAmC;AACnC,wCAAqB;AACrB,iDAA8B;AAC9B,6CAA0B;AAC1B,iDAA8B;AAC9B,4CAAyB;AACzB,wCAAqB;AACrB,yCAAsB;AACtB,4CAAyB;AACzB,qDAAkC;AAClC,qDAAkC;AAClC,0CAAuB;AACvB,+CAA4B;AAC5B,6CAA0B","sourcesContent":["import { AccessLog } from './AccessLog'\nimport { Article } from './Article'\nimport { Classification } from './Classification'\nimport { Document } from './Document'\nimport { HealthElement } from './HealthElement'\nimport { Invoice } from './Invoice'\nimport { Form } from './Form'\nimport { Contact } from './Contact'\nimport { CalendarItem } from './CalendarItem'\nimport { MaintenanceTask } from './MaintenanceTask'\nimport { Message } from './Message'\nimport { Receipt } from './Receipt'\nimport { Patient } from './Patient'\nimport { Delegation } from './Delegation'\nimport { SecurityMetadata } from './SecurityMetadata'\nimport { IcureStub } from './IcureStub'\nimport { Topic } from './Topic'\n\nexport * from './AbstractFilterCode'\nexport * from './AbstractFilterContact'\nexport * from './AbstractFilterDevice'\nexport * from './AbstractFilterHealthElement'\nexport * from './AbstractFilterHealthcareParty'\nexport * from './AbstractFilterInvoice'\nexport * from './AbstractFilterMaintenanceTask'\nexport * from './AbstractFilterPatient'\nexport * from './AbstractFilterService'\nexport * from './AbstractFilterUser'\nexport * from './AccessLog'\nexport * from './AddedDocument'\nexport * from './Address'\nexport * from './AdministrationQuantity'\nexport * from './Agenda'\nexport * from './AgreementAppendix'\nexport * from './Amp'\nexport * from './AmpComponent'\nexport * from './Ampp'\nexport * from './AmppComponent'\nexport * from './Annotation'\nexport * from './ApplicationSettings'\nexport * from './AppointmentTypeAndPlace'\nexport * from './Article'\nexport * from './Atc'\nexport * from './AttachmentMetadata'\nexport * from './AuthenticationResponse'\nexport * from './AuthenticationToken'\nexport * from './Basic'\nexport * from './Body'\nexport * from './BulkAttachmentUpdateOptions'\nexport * from './CalendarItem'\nexport * from './CalendarItemTag'\nexport * from './CalendarItemType'\nexport * from './CareTeamMember'\nexport * from './CareTeamMembership'\nexport * from './CheckSMFPatientResult'\nexport * from './Classification'\nexport * from './ClassificationTemplate'\nexport * from './Code'\nexport * from './CodeStub'\nexport * from './CodeType'\nexport * from './CommentedClassification'\nexport * from './Commercialization'\nexport * from './Company'\nexport * from './Contact'\nexport * from './Content'\nexport * from './Copayment'\nexport * from './CryptoActorStub'\nexport * from './Data'\nexport * from './DataAttachment'\nexport * from './DataOwnerRegistrationSuccess'\nexport * from './DataOwnerWithType'\nexport * from './DatabaseInfo'\nexport * from './DatabaseInitialisation'\nexport * from './DatabaseSynchronization'\nexport * from './Delegation'\nexport * from './DeletedAttachment'\nexport * from './Device'\nexport * from './DeviceType'\nexport * from './DiaryNoteExportInfo'\nexport * from './Dmpp'\nexport * from './DocIdentifier'\nexport * from './Document'\nexport * from './DocumentGroup'\nexport * from './DocumentTemplate'\nexport * from './Duration'\nexport * from './EIDItem'\nexport * from './Editor'\nexport * from './EfactInvoice'\nexport * from './Employer'\nexport * from './EmploymentInfo'\nexport * from './EntityReference'\nexport * from './EntityTemplate'\nexport * from './Episode'\nexport * from './FilterChainCode'\nexport * from './FilterChainContact'\nexport * from './FilterChainDevice'\nexport * from './FilterChainHealthElement'\nexport * from './FilterChainHealthcareParty'\nexport * from './FilterChainInvoice'\nexport * from './FilterChainMaintenanceTask'\nexport * from './FilterChainPatient'\nexport * from './FilterChainService'\nexport * from './FilterChainUser'\nexport * from './FinancialInstitutionInformation'\nexport * from './FlatRateTarification'\nexport * from './FlowItem'\nexport * from './Form'\nexport * from './FormColumn'\nexport * from './FormDataOption'\nexport * from './FormLayout'\nexport * from './FormLayoutData'\nexport * from './FormPlanning'\nexport * from './FormSection'\nexport * from './FormTemplate'\nexport * from './FormTemplateLayout'\nexport * from './Formula'\nexport * from './FrontEndMigration'\nexport * from './Group'\nexport * from './GroupDatabasesInfo'\nexport * from './GuiCode'\nexport * from './GuiCodeType'\nexport * from './GroupDeletionReport'\nexport * from './HealthElement'\nexport * from './HealthcareParty'\nexport * from './HealthcarePartyHistoryStatus'\nexport * from './IcureStub'\nexport * from './IdWithRev'\nexport * from './Identifier'\nexport * from './IdentityDocumentReader'\nexport * from './ImportMapping'\nexport * from './ImportResult'\nexport * from './IncapacityExportInfo'\nexport * from './IndexingInfo'\nexport * from './Ingredient'\nexport * from './Insurability'\nexport * from './Insurance'\nexport * from './Invoice'\nexport * from './InvoiceItem'\nexport * from './InvoiceSender'\nexport * from './InvoicesBatch'\nexport * from './InvoicingCode'\nexport * from './Keyword'\nexport * from './KeywordSubword'\nexport * from './LabelledOccurence'\nexport * from './LetterValue'\nexport * from './ListOfIds'\nexport * from './ListOfProperties'\nexport * from './LoginCredentials'\nexport * from './MaintenanceTask'\nexport * from './MapOfIds'\nexport * from './Measure'\nexport * from './MedexInfo'\nexport * from './MedicalHouseContract'\nexport * from './MedicalLocation'\nexport * from './Medication'\nexport * from './MedicationSchemeExportInfo'\nexport * from './Medicinalproduct'\nexport * from './Message'\nexport * from './MessageAttachment'\nexport * from './MessageReadStatus'\nexport * from './MessageWithBatch'\nexport * from './MessagesReadStatusUpdate'\nexport * from './MimeAttachment'\nexport * from './Nmp'\nexport * from './NoGenericPrescriptionReason'\nexport * from './NoSwitchReason'\nexport * from './NumeratorRange'\nexport * from './PackagingType'\nexport * from './PaginatedDocumentKeyIdPairObject'\nexport * from './PaginatedListAccessLog'\nexport * from './PaginatedListAmp'\nexport * from './PaginatedListClassification'\nexport * from './PaginatedListClassificationTemplate'\nexport * from './PaginatedListCode'\nexport * from './PaginatedListContact'\nexport * from './PaginatedListDevice'\nexport * from './PaginatedListDocument'\nexport * from './PaginatedListEntityTemplate'\nexport * from './PaginatedListForm'\nexport * from './PaginatedListGroup'\nexport * from './PaginatedListHealthElement'\nexport * from './PaginatedListHealthcareParty'\nexport * from './PaginatedListInvoice'\nexport * from './PaginatedListMaintenanceTask'\nexport * from './PaginatedListMessage'\nexport * from './PaginatedListNmp'\nexport * from './PaginatedListPatient'\nexport * from './PaginatedListService'\nexport * from './PaginatedListString'\nexport * from './PaginatedListTarification'\nexport * from './PaginatedListTopic'\nexport * from './PaginatedListUser'\nexport * from './PaginatedListVmp'\nexport * from './PaginatedListVmpGroup'\nexport * from './Paragraph'\nexport * from './ParagraphAgreement'\nexport * from './Part'\nexport * from './Partnership'\nexport * from './Patient'\nexport * from './PatientHealthCareParty'\nexport * from './Payment'\nexport * from './Periodicity'\nexport * from './Permission'\nexport * from './PermissionItem'\nexport * from './PersonName'\nexport * from './PharmaceuticalForm'\nexport * from './PharmaceuticalFormStub'\nexport * from './Place'\nexport * from './PlanOfAction'\nexport * from './Predicate'\nexport * from './Pricing'\nexport * from './PropertyStub'\nexport * from './PropertyTypeStub'\nexport * from './PublicKey'\nexport * from './Quantity'\nexport * from './Range'\nexport * from './Receipt'\nexport * from './ReferenceRange'\nexport * from './ReferralPeriod'\nexport * from './RegimenItem'\nexport * from './RegistrationInformation'\nexport * from './RegistrationSuccess'\nexport * from './Reimbursement'\nexport * from './ReimbursementCriterion'\nexport * from './Remote'\nexport * from './RemoteAuthentication'\nexport * from './Renewal'\nexport * from './Replication'\nexport * from './ReplicateCommand'\nexport * from './ReplicationInfo'\nexport * from './ReplicationStats'\nexport * from './ReplicatorDocument'\nexport * from './ReplicatorResponse'\nexport * from './ResultInfo'\nexport * from './Right'\nexport * from './Role'\nexport * from './RoleConfiguration'\nexport * from './RoleSourceEnum'\nexport * from './RouteOfAdministration'\nexport * from './SamText'\nexport * from './SamVersion'\nexport * from './SchoolingInfo'\nexport * from './Section'\nexport * from './Service'\nexport * from './ServiceLink'\nexport * from './SoftwareMedicalFileExport'\nexport * from './StandardSubstance'\nexport * from './StrengthRange'\nexport * from './StructureElement'\nexport * from './SubContact'\nexport * from './Substance'\nexport * from './SubstanceStub'\nexport * from './Substanceproduct'\nexport * from './Suggest'\nexport * from './SumehrContent'\nexport * from './SumehrExportInfo'\nexport * from './SumehrValidity'\nexport * from './SupplyProblem'\nexport * from './Suspension'\nexport * from './Tag'\nexport * from './Tarification'\nexport * from './Telecom'\nexport * from './TimeSeries'\nexport * from './TimeTable'\nexport * from './TimeTableHour'\nexport * from './TimeTableItem'\nexport * from './TokenWithGroup'\nexport * from './TypedValueObject'\nexport * from './Unit'\nexport * from './User'\nexport * from './UserAndHealthcareParty'\nexport * from './UserGroup'\nexport * from './UserTypeEnum'\nexport * from './Valorisation'\nexport * from './Verse'\nexport * from './VirtualForm'\nexport * from './VirtualIngredient'\nexport * from './Vmp'\nexport * from './VmpComponent'\nexport * from './VmpGroup'\nexport * from './VmpGroupStub'\nexport * from './VmpStub'\nexport * from './Vtm'\nexport * from './Wada'\nexport * from './Weekday'\nexport * from './SecurityMetadata'\nexport * from './SecureDelegation'\nexport * from './Topic'\nexport * from './Connection'\nexport * from './ISO639_1'\n\nexport type EncryptedEntity =\n | AccessLog\n | Article\n | CalendarItem\n | Classification\n | Contact\n | Document\n | Form\n | HealthElement\n | Invoice\n | MaintenanceTask\n | Message\n | Patient\n | Receipt\n | Topic\n\nexport type EncryptedEntityStub =\n | {\n // When changing remember to also update icc-x-api/crypto/utils/encryptedStubEquals\n id?: string\n secretForeignKeys?: Array<string>\n cryptedForeignKeys?: { [key: string]: Delegation[] }\n delegations?: { [key: string]: Delegation[] }\n encryptionKeys?: { [key: string]: Delegation[] }\n encryptedSelf?: string\n securityMetadata?: SecurityMetadata\n }\n | IcureStub\n\nexport type EncryptedParentEntity = Message | Patient\n"]}
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../icc-api/model/models.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAkBA,uDAAoC;AACpC,0DAAuC;AACvC,yDAAsC;AACtC,gEAA6C;AAC7C,kEAA+C;AAC/C,0DAAuC;AACvC,kEAA+C;AAC/C,0DAAuC;AACvC,0DAAuC;AACvC,uDAAoC;AACpC,8CAA2B;AAC3B,kDAA+B;AAC/B,4CAAyB;AACzB,2DAAwC;AACxC,2CAAwB;AACxB,sDAAmC;AACnC,wCAAqB;AACrB,iDAA8B;AAC9B,yCAAsB;AACtB,kDAA+B;AAC/B,+CAA4B;AAC5B,wDAAqC;AACrC,4DAAyC;AACzC,4CAAyB;AACzB,wCAAqB;AACrB,uDAAoC;AACpC,2DAAwC;AACxC,wDAAqC;AACrC,0CAAuB;AACvB,yCAAsB;AACtB,gEAA6C;AAC7C,iDAA8B;AAC9B,oDAAiC;AACjC,qDAAkC;AAClC,mDAAgC;AAChC,uDAAoC;AACpC,0DAAuC;AACvC,mDAAgC;AAChC,2DAAwC;AACxC,yCAAsB;AACtB,6CAA0B;AAC1B,6CAA0B;AAC1B,4DAAyC;AACzC,sDAAmC;AACnC,4CAAyB;AACzB,4CAAyB;AACzB,4CAAyB;AACzB,8CAA2B;AAC3B,oDAAiC;AACjC,yCAAsB;AACtB,mDAAgC;AAChC,iEAA8C;AAC9C,sDAAmC;AACnC,iDAA8B;AAC9B,2DAAwC;AACxC,4DAAyC;AACzC,+CAA4B;AAC5B,sDAAmC;AACnC,2CAAwB;AACxB,+CAA4B;AAC5B,wDAAqC;AACrC,yCAAsB;AACtB,kDAA+B;AAC/B,6CAA0B;AAC1B,kDAA+B;AAC/B,qDAAkC;A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AA+B;AAC/B,qDAAkC;AAClC,+CAA4B;AAC5B,8CAA2B;AAC3B,kDAA+B;AAC/B,qDAAkC;AAClC,4CAAyB;AACzB,kDAA+B;AAC/B,qDAAkC;AAClC,mDAAgC;AAChC,kDAA+B;AAC/B,+CAA4B;AAC5B,wCAAqB;AACrB,iDAA8B;AAC9B,4CAAyB;AACzB,+CAA4B;AAC5B,8CAA2B;AAC3B,kDAA+B;AAC/B,kDAA+B;AAC/B,mDAAgC;AAChC,qDAAkC;AAClC,yCAAsB;AACtB,yCAAsB;AACtB,2DAAwC;AACxC,8CAA2B;AAC3B,iDAA8B;AAC9B,iDAA8B;AAC9B,0CAAuB;AACvB,gDAA6B;AAC7B,sDAAmC;AACnC,wCAAqB;AACrB,iDAA8B;AAC9B,6CAA0B;AAC1B,iDAA8B;AAC9B,4CAAyB;AACzB,wCAAqB;AACrB,yCAAsB;AACtB,4CAAyB;AACzB,qDAAkC;AAClC,qDAAkC;AAClC,0CAAuB;AACvB,+CAA4B;AAC5B,6CAA0B","sourcesContent":["import { AccessLog } from './AccessLog'\nimport { Article } from './Article'\nimport { Classification } from './Classification'\nimport { Document } from './Document'\nimport { HealthElement } from './HealthElement'\nimport { Invoice } from './Invoice'\nimport { Form } from './Form'\nimport { Contact } from './Contact'\nimport { CalendarItem } from './CalendarItem'\nimport { MaintenanceTask } from './MaintenanceTask'\nimport { Message } from './Message'\nimport { Receipt } from './Receipt'\nimport { Patient } from './Patient'\nimport { Delegation } from './Delegation'\nimport { SecurityMetadata } from './SecurityMetadata'\nimport { IcureStub } from './IcureStub'\nimport { Topic } from './Topic'\n\nexport * from './AbstractFilterCode'\nexport * from './AbstractFilterContact'\nexport * from './AbstractFilterDevice'\nexport * from './AbstractFilterHealthElement'\nexport * from './AbstractFilterHealthcareParty'\nexport * from './AbstractFilterInvoice'\nexport * from './AbstractFilterMaintenanceTask'\nexport * from './AbstractFilterPatient'\nexport * from './AbstractFilterService'\nexport * from './AbstractFilterUser'\nexport * from './AccessLog'\nexport * from './AddedDocument'\nexport * from './Address'\nexport * from './AdministrationQuantity'\nexport * from './Agenda'\nexport * from './AgreementAppendix'\nexport * from './Amp'\nexport * from './AmpComponent'\nexport * from './Ampp'\nexport * from './AmppComponent'\nexport * from './Annotation'\nexport * from './ApplicationSettings'\nexport * from './AppointmentTypeAndPlace'\nexport * from './Article'\nexport * from './Atc'\nexport * from './AttachmentMetadata'\nexport * from './AuthenticationResponse'\nexport * from './AuthenticationToken'\nexport * from './Basic'\nexport * from './Body'\nexport * from './BulkAttachmentUpdateOptions'\nexport * from './CalendarItem'\nexport * from './CalendarItemTag'\nexport * from './CalendarItemType'\nexport * from './CareTeamMember'\nexport * from './CareTeamMembership'\nexport * from './CheckSMFPatientResult'\nexport * from './Classification'\nexport * from './ClassificationTemplate'\nexport * from './Code'\nexport * from './CodeStub'\nexport * from './CodeType'\nexport * from './CommentedClassification'\nexport * from './Commercialization'\nexport * from './Company'\nexport * from './Contact'\nexport * from './Content'\nexport * from './Copayment'\nexport * from './CryptoActorStub'\nexport * from './Data'\nexport * from './DataAttachment'\nexport * from './DataOwnerRegistrationSuccess'\nexport * from './DataOwnerWithType'\nexport * from './DatabaseInfo'\nexport * from './DatabaseInitialisation'\nexport * from './DatabaseSynchronization'\nexport * from './Delegation'\nexport * from './DeletedAttachment'\nexport * from './Device'\nexport * from './DeviceType'\nexport * from './DiaryNoteExportInfo'\nexport * from './Dmpp'\nexport * from './DocIdentifier'\nexport * from './Document'\nexport * from './DocumentGroup'\nexport * from './DocumentTemplate'\nexport * from './Duration'\nexport * from './EIDItem'\nexport * from './Editor'\nexport * from './EfactInvoice'\nexport * from './Employer'\nexport * from './EmploymentInfo'\nexport * from './EntityReference'\nexport * from './EntityTemplate'\nexport * from './Episode'\nexport * from './FilterChainCode'\nexport * from './FilterChainContact'\nexport * from './FilterChainDevice'\nexport * from './FilterChainHealthElement'\nexport * from './FilterChainHealthcareParty'\nexport * from './FilterChainInvoice'\nexport * from './FilterChainMaintenanceTask'\nexport * from './FilterChainPatient'\nexport * from './FilterChainService'\nexport * from './FilterChainUser'\nexport * from './FinancialInstitutionInformation'\nexport * from './FlatRateTarification'\nexport * from './FlowItem'\nexport * from './Form'\nexport * from './FormColumn'\nexport * from './FormDataOption'\nexport * from './FormLayout'\nexport * from './FormLayoutData'\nexport * from './FormPlanning'\nexport * from './FormSection'\nexport * from './FormTemplate'\nexport * from './FormTemplateLayout'\nexport * from './Formula'\nexport * from './FrontEndMigration'\nexport * from './Group'\nexport * from './GroupDatabasesInfo'\nexport * from './GuiCode'\nexport * from './GuiCodeType'\nexport * from './GroupDeletionReport'\nexport * from './HealthElement'\nexport * from './HealthcareParty'\nexport * from './HealthcarePartyHistoryStatus'\nexport * from './IcureStub'\nexport * from './IdWithRev'\nexport * from './Identifier'\nexport * from './IdentityDocumentReader'\nexport * from './ImportMapping'\nexport * from './ImportResult'\nexport * from './IncapacityExportInfo'\nexport * from './IndexingInfo'\nexport * from './Ingredient'\nexport * from './Insurability'\nexport * from './Insurance'\nexport * from './Invoice'\nexport * from './InvoiceItem'\nexport * from './InvoiceSender'\nexport * from './InvoicesBatch'\nexport * from './InvoicingCode'\nexport * from './Keyword'\nexport * from './KeywordSubword'\nexport * from './LabelledOccurence'\nexport * from './LetterValue'\nexport * from './ListOfIds'\nexport * from './ListOfProperties'\nexport * from './LoginCredentials'\nexport * from './MaintenanceTask'\nexport * from './MapOfIds'\nexport * from './Measure'\nexport * from './MedexInfo'\nexport * from './MedicalHouseContract'\nexport * from './MedicalLocation'\nexport * from './Medication'\nexport * from './MedicationSchemeExportInfo'\nexport * from './Medicinalproduct'\nexport * from './Message'\nexport * from './MessageAttachment'\nexport * from './MessageReadStatus'\nexport * from './MessageWithBatch'\nexport * from './MessagesReadStatusUpdate'\nexport * from './MimeAttachment'\nexport * from './Nmp'\nexport * from './NoGenericPrescriptionReason'\nexport * from './NoSwitchReason'\nexport * from './NumeratorRange'\nexport * from './PackagingType'\nexport * from './PaginatedDocumentKeyIdPairObject'\nexport * from './PaginatedListAccessLog'\nexport * from './PaginatedListAmp'\nexport * from './PaginatedListClassification'\nexport * from './PaginatedListClassificationTemplate'\nexport * from './PaginatedListCode'\nexport * from './PaginatedListContact'\nexport * from './PaginatedListDevice'\nexport * from './PaginatedListDocument'\nexport * from './PaginatedListEntityTemplate'\nexport * from './PaginatedListForm'\nexport * from './PaginatedListGroup'\nexport * from './PaginatedListHealthcareParty'\nexport * from './PaginatedListHealthElement'\nexport * from './PaginatedListInsurance'\nexport * from './PaginatedListInvoice'\nexport * from './PaginatedListMaintenanceTask'\nexport * from './PaginatedListMedicalLocation'\nexport * from './PaginatedListMessage'\nexport * from './PaginatedListNmp'\nexport * from './PaginatedListPatient'\nexport * from './PaginatedListService'\nexport * from './PaginatedListString'\nexport * from './PaginatedListTarification'\nexport * from './PaginatedListTopic'\nexport * from './PaginatedListUser'\nexport * from './PaginatedListVmp'\nexport * from './PaginatedListVmpGroup'\nexport * from './Paragraph'\nexport * from './ParagraphAgreement'\nexport * from './Part'\nexport * from './Partnership'\nexport * from './Patient'\nexport * from './PatientHealthCareParty'\nexport * from './Payment'\nexport * from './Periodicity'\nexport * from './Permission'\nexport * from './PermissionItem'\nexport * from './PersonName'\nexport * from './PharmaceuticalForm'\nexport * from './PharmaceuticalFormStub'\nexport * from './Place'\nexport * from './PlanOfAction'\nexport * from './Predicate'\nexport * from './Pricing'\nexport * from './PropertyStub'\nexport * from './PropertyTypeStub'\nexport * from './PublicKey'\nexport * from './Quantity'\nexport * from './Range'\nexport * from './Receipt'\nexport * from './ReferenceRange'\nexport * from './ReferralPeriod'\nexport * from './RegimenItem'\nexport * from './RegistrationInformation'\nexport * from './RegistrationSuccess'\nexport * from './Reimbursement'\nexport * from './ReimbursementCriterion'\nexport * from './Remote'\nexport * from './RemoteAuthentication'\nexport * from './Renewal'\nexport * from './Replication'\nexport * from './ReplicateCommand'\nexport * from './ReplicationInfo'\nexport * from './ReplicationStats'\nexport * from './ReplicatorDocument'\nexport * from './ReplicatorResponse'\nexport * from './ResultInfo'\nexport * from './Right'\nexport * from './Role'\nexport * from './RoleConfiguration'\nexport * from './RoleSourceEnum'\nexport * from './RouteOfAdministration'\nexport * from './SamText'\nexport * from './SamVersion'\nexport * from './SchoolingInfo'\nexport * from './Section'\nexport * from './Service'\nexport * from './ServiceLink'\nexport * from './SoftwareMedicalFileExport'\nexport * from './StandardSubstance'\nexport * from './StrengthRange'\nexport * from './StructureElement'\nexport * from './SubContact'\nexport * from './Substance'\nexport * from './SubstanceStub'\nexport * from './Substanceproduct'\nexport * from './Suggest'\nexport * from './SumehrContent'\nexport * from './SumehrExportInfo'\nexport * from './SumehrValidity'\nexport * from './SupplyProblem'\nexport * from './Suspension'\nexport * from './Tag'\nexport * from './Tarification'\nexport * from './Telecom'\nexport * from './TimeSeries'\nexport * from './TimeTable'\nexport * from './TimeTableHour'\nexport * from './TimeTableItem'\nexport * from './TokenWithGroup'\nexport * from './TypedValueObject'\nexport * from './Unit'\nexport * from './User'\nexport * from './UserAndHealthcareParty'\nexport * from './UserGroup'\nexport * from './UserTypeEnum'\nexport * from './Valorisation'\nexport * from './Verse'\nexport * from './VirtualForm'\nexport * from './VirtualIngredient'\nexport * from './Vmp'\nexport * from './VmpComponent'\nexport * from './VmpGroup'\nexport * from './VmpGroupStub'\nexport * from './VmpStub'\nexport * from './Vtm'\nexport * from './Wada'\nexport * from './Weekday'\nexport * from './SecurityMetadata'\nexport * from './SecureDelegation'\nexport * from './Topic'\nexport * from './Connection'\nexport * from './ISO639_1'\n\nexport type EncryptedEntity =\n | AccessLog\n | Article\n | CalendarItem\n | Classification\n | Contact\n | Document\n | Form\n | HealthElement\n | Invoice\n | MaintenanceTask\n | Message\n | Patient\n | Receipt\n | Topic\n\nexport type EncryptedEntityStub =\n | {\n // When changing remember to also update icc-x-api/crypto/utils/encryptedStubEquals\n id?: string\n secretForeignKeys?: Array<string>\n cryptedForeignKeys?: { [key: string]: Delegation[] }\n delegations?: { [key: string]: Delegation[] }\n encryptionKeys?: { [key: string]: Delegation[] }\n encryptedSelf?: string\n securityMetadata?: SecurityMetadata\n }\n | IcureStub\n\nexport type EncryptedParentEntity = Message | Patient\n"]}
@@ -63,10 +63,7 @@ export declare class IccDocumentXApi extends IccDocumentApi implements Encrypted
63
63
  getMainAttachmentAs(documentId: string, returnType: "application/octet-stream"): Promise<ArrayBuffer>;
64
64
  getMainAttachmentAs(documentId: string, returnType: "text/plain"): Promise<string>;
65
65
  getMainAttachmentAs(documentId: string, returnType: "application/json"): Promise<any>;
66
- getAttachmentUrl(documentId: string, attachmentId: string, sfks: Array<{
67
- delegatorId: string;
68
- key: CryptoKey;
69
- }>, fileName?: string): Promise<string>;
66
+ getMainAttachmentAs(documentId: string, returnType: 'application/octet-stream' | 'text/plain' | 'application/json'): Promise<any>;
70
67
  uti(mimeType: string, extension: string): string;
71
68
  mimeType(uti: string): string;
72
69
  /**
@@ -520,15 +520,10 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
520
520
  */
521
521
  getAttachmentAs(documentId, attachmentId, returnType, enckeys, fileName) {
522
522
  return __awaiter(this, void 0, void 0, function* () {
523
- const url = this.host +
524
- `/document/${documentId}/attachment/${attachmentId}` +
525
- '?ts=' +
526
- new Date().getTime() +
527
- (enckeys ? `&enckeys=${enckeys}` : '') +
528
- (fileName ? `&fileName=${fileName}` : '');
529
- return XHR_1.XHR.sendCommand('GET', url, yield this.headers, null, this.fetchImpl, returnType, this.authenticationProvider.getAuthService())
530
- .then((doc) => doc.body)
531
- .catch((err) => this.handleError(err));
523
+ if (!!enckeys || !!fileName) {
524
+ console.warn('Using getAttachmentAs method with a value for enckeys or fileName does nothing anymore.');
525
+ }
526
+ return this.getMainAttachmentAs(documentId, returnType);
532
527
  });
533
528
  }
534
529
  getMainAttachmentAs(documentId, returnType) {
@@ -540,15 +535,6 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
540
535
  });
541
536
  }
542
537
  // noinspection JSUnusedGlobalSymbols
543
- getAttachmentUrl(documentId, attachmentId, sfks, fileName) {
544
- return this.authApi
545
- .token('GET', `/rest/v1/document/${documentId}/attachment/${attachmentId}`)
546
- .then((token) => this.host +
547
- `/document/${documentId}/attachment/${attachmentId}${token ? `;tokenid=${token}` : ''}` +
548
- (sfks && sfks.length ? '?enckeys=' + sfks.join(',') : '') +
549
- (fileName && fileName.length ? `${sfks && sfks.length ? '&' : '?'}fileName=${encodeURIComponent(fileName)}` : ''));
550
- }
551
- // noinspection JSUnusedGlobalSymbols
552
538
  uti(mimeType, extension) {
553
539
  return (mimeType && mimeType !== 'application/octet-stream' ? this.utiDefs[mimeType] : this.utiExts[extension]) || this.utiDefs[mimeType];
554
540
  }
@@ -1 +1 @@
1
- {"version":3,"file":"icc-document-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-document-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAuD;AAGvD,4BAA2B;AAC3B,4CAAwC;AACxC,kDAAiD;AAEjD,uDAAwE;AAExE,0EAAgG;AAChG,wEAAoE;AACpE,IAAO,eAAe,GAAG,mCAAgB,CAAC,eAAe,CAAA;AAOzD,mCAAsD;AAEtD,qCAAqC;AACrC,MAAa,eAAgB,SAAQ,wBAAc;IAuhBjD,YACE,IAAY,EACZ,OAAkC,EAC1B,MAAqB,EACrB,OAAmB,EAC3B,YAA8B,EACb,cAAuB,EACxC,yBAAiD,IAAI,iDAAwB,EAAE,EAC/E,YAA2E,OAAO,MAAM,KAAK,WAAW;QACtG,CAAC,CAAC,MAAM,CAAC,KAAK;QACd,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW;YAC7B,CAAC,CAAC,IAAI,CAAC,KAAK;YACZ,CAAC,CAAC,KAAK;QAET,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,sBAAsB,EAAE,SAAS,CAAC,CAAA;QAX/C,WAAM,GAAN,MAAM,CAAe;QACrB,YAAO,GAAP,OAAO,CAAY;QAEV,mBAAc,GAAd,cAAc,CAAS;QA1h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,CAAA;QACvF,CAAC;KAAA;IAED,yBAAyB,CACvB,MAAuB;QAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,yBAAyB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,oCAA4B,CAAC,QAAQ,EAAE,CAAC,CAAA;IAClI,CAAC;IAED,mBAAmB,CAAC,MAAuB;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,oCAA4B,CAAC,QAAQ,EAAE,EAAE,SAAS,CAAC,CAAA;IAC9G,CAAC;IAED,uCAAuC,CAAC,MAAuB,EAAE,SAAmB;QAClF,OAAO,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,iCAAiC,CAC7E,EAAE,MAAM,EAAE,IAAI,EAAE,oCAA4B,CAAC,QAAQ,EAAE,EACvD,SAAS,CACV,CAAA;IACH,CAAC;CACF;AAn/BD,0CAm/BC","sourcesContent":["import { IccAuthApi, IccDocumentApi } from '../icc-api'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\n\nimport * as _ from 'lodash'\nimport { XHR } from '../icc-api/api/XHR'\nimport * as models from '../icc-api/model/models'\n\nimport { a2b, hex2ua, string2ua, ua2string } from './utils/binary-utils'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport { AuthenticationProvider, NoAuthenticationProvider } from './auth/AuthenticationProvider'\nimport { SecureDelegation } from '../icc-api/model/SecureDelegation'\nimport AccessLevelEnum = SecureDelegation.AccessLevelEnum\nimport { ShareMetadataBehaviour } from './crypto/ShareMetadataBehaviour'\nimport { ShareResult } from './utils/ShareResult'\nimport { EntityShareRequest } from '../icc-api/model/requests/EntityShareRequest'\nimport RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum\nimport { EncryptedEntityXApi } from './basexapi/EncryptedEntityXApi'\nimport { AccessLog } from '../icc-api/model/models'\nimport { EntityWithDelegationTypeName } from './utils'\n\n// noinspection JSUnusedGlobalSymbols\nexport class IccDocumentXApi extends IccDocumentApi implements EncryptedEntityXApi<models.Document> {\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n /** maps invalid UTI values to corresponding MIME type for backward-compatibility (pre-v1.0.117) */\n compatUtiRevDefs: { [key: string]: string } = {\n 'com.adobe.encapsulatedPostscript': 'image/eps',\n 'com.adobe.illustrator.aiImage': 'application/illustrator',\n 'com.adobe.indesignImage': 'image/indesign',\n 'com.adobe.photoshopImage': 'image/psd',\n 'com.adobe.postscriptPfaFont': 'application/x-font-type1',\n 'com.adobe.postscriptPfbFont': 'application/x-font-type1',\n 'com.allume.stuffitArchive': 'application/stuffit',\n 'com.apple.binhexArchive': 'application/binhex',\n 'com.apple.diskImageUdif': 'application/x-apple-diskimage',\n 'com.apple.macbinaryArchive': 'application/macbinary',\n 'com.apple.quartzComposerComposition': 'application/x-quartzcomposer',\n 'com.apple.quicktimeImage': 'image/x-quicktime',\n 'com.apple.quicktimeMovie': 'video/quicktime',\n 'com.js.efxFax': 'image/efax',\n 'com.macromedia.shockwaveFlash': 'application/x-shockwave-flash',\n 'com.microsoft.advancedStreamRedirector': 'video/x-ms-asx',\n 'com.microsoft.advancedSystemsFormat': 'video/x-ms-asf',\n 'com.microsoft.waveformAudio': 'audio/wave',\n 'com.microsoft.windowsDynamicLinkLibrary': 'application/x-msdownload',\n 'com.microsoft.windowsExecutable': 'application/exe',\n 'com.microsoft.windowsMediaWax': 'audio/x-ms-wax',\n 'com.microsoft.windowsMediaWm': 'video/x-ms-wm',\n 'com.microsoft.windowsMediaWma': 'audio/x-ms-wma',\n 'com.microsoft.windowsMediaWmd': 'video/x-ms-wmd',\n 'com.microsoft.windowsMediaWmp': 'video/x-ms-wmp',\n 'com.microsoft.windowsMediaWmv': 'video/x-ms-wmv',\n 'com.microsoft.windowsMediaWmx': 'video/x-ms-wmx',\n 'com.microsoft.windowsMediaWmz': 'video/x-ms-wmz',\n 'com.microsoft.windowsMediaWvx': 'video/x-ms-wvx',\n 'com.netscape.javascriptSource': 'text/javascript',\n 'com.pkware.zipArchive': 'application/zip',\n 'com.rarlab.rarArchive': 'application/rar',\n 'com.redhat.redhatPackage': 'application/x-redhat-package',\n 'com.sgi.sgiImage': 'image/sgi',\n 'com.sun.javaAppDescriptor': 'text/vnd.sun.j2me.app-descriptor',\n 'com.sun.javaArchive': 'application/java-archive',\n 'com.sun.javaClass': 'application/java',\n 'com.sun.javaSource': 'text/x-java-source',\n 'com.sun.javaWebStart': 'application/jnlp',\n 'com.truevision.tgaImage': 'image/tga',\n 'org.bzip.bzip2Archive': 'application/x-bzip2',\n 'org.debian.debianPackage': 'application/x-debian-package',\n 'org.gnu.gnuTarArchive': 'application/x-gtar',\n 'org.gnu.gnuZipArchive': 'application/gzip',\n 'org.oasis.opendocument.textMaster': 'application/vnd.oasis.opendocument.text-master',\n 'org.oasis.opendocument.textWeb': 'application/vnd.oasis.opendocument.text-web',\n 'org.xiph.oggTheora': 'video/ogg',\n 'org.xiph.oggVorbis': 'audio/ogg',\n 'public.aifcAudio': 'audio/aiff',\n 'public.aiffAudio': 'audio/aiff',\n 'public.assemblySource': 'text/x-asm',\n 'public.cHeader': 'text/x-c-header',\n 'public.cpioArchive': 'application/x-cpio',\n 'public.cPlusPlusHeader': 'text/x-c++-hdr',\n 'public.cPlusPlusSource': 'application/x-cplusplus',\n 'public.cshScript': 'application/x-csh',\n 'public.cSource': 'text/x-c-code',\n 'public.isoImage': 'application/x-iso-image',\n 'public.mpeg4Audio': 'audio/mp4',\n 'public.objectiveCPlusPlusSource': 'text/x-objcppsrc',\n 'public.objectiveCSource': 'text/x-objcsrc',\n 'public.opentypeFont': 'font/opentype',\n 'public.perlScript': 'text/x-perl',\n 'public.phpScript': 'text/php',\n 'public.plainText': 'text/plain',\n 'public.pythonScript': 'text/x-python-script',\n 'public.shellScript': 'application/x-sh',\n 'public.tarArchive': 'application/tar',\n 'public.truetypeTtfFont': 'application/x-font-ttf',\n 'public.ulawAudio': 'audio/au',\n 'public.xbitmapImage': 'image/xbm',\n 'unofficial.atomFeed': 'application/atom+xml',\n 'unofficial.m3u8Playlist': 'application/x-mpegURL',\n 'unofficial.plsPlaylist': 'audio/scpls',\n 'unofficial.rdfFeed': 'application/rdf+xml',\n 'unofficial.rssFeed': 'application/rss+xml',\n }\n\n utiRevDefs: { [key: string]: string } = {\n ...this.compatUtiRevDefs,\n 'com.adobe.encapsulated-postscript': 'image/eps',\n 'com.adobe.illustrator.ai-image': 'application/illustrator',\n 'com.adobe.indesign-image': 'image/indesign',\n 'com.adobe.pdf': 'application/pdf',\n 'com.adobe.photoshop-image': 'image/psd',\n 'com.adobe.postscript': 'application/postscript',\n 'com.adobe.postscript-pfa-font': 'application/x-font-type1',\n 'com.adobe.postscript-pfb-font': 'application/x-font-type1',\n 'com.allume.stuffit-archive': 'application/stuffit',\n 'com.apple.applescript.script': 'application/x-applescript',\n 'com.apple.applescript.text': 'application/x-applescript',\n 'com.apple.binhex-archive': 'application/binhex',\n 'com.apple.disk-image-udif': 'application/x-apple-diskimage',\n 'com.apple.ical.ics': 'text/calendar',\n 'com.apple.ical.vcs': 'text/x-vcalendar',\n 'com.apple.macbinary-archive': 'application/macbinary',\n 'com.apple.pict': 'image/pict',\n 'com.apple.quartz-composer-composition': 'application/x-quartzcomposer',\n 'com.apple.quicktime-image': 'image/x-quicktime',\n 'com.apple.quicktime-movie': 'video/quicktime',\n 'com.bittorrent.torrent': 'application/x-bittorrent',\n 'com.compuserve.gif': 'image/gif',\n 'com.js.efx-fax': 'image/efax',\n 'com.kodak.flashpix.image': 'image/vndfpx',\n 'com.lizardtech.djvu': 'image/vnd.djvu',\n 'com.macromedia.shockwave-flash': 'application/x-shockwave-flash',\n 'com.microsoft.advanced-stream-redirector': 'video/x-ms-asx',\n 'com.microsoft.advanced-systems-format': 'video/x-ms-asf',\n 'com.microsoft.bmp': 'image/bmp',\n 'com.microsoft.excel.xls': 'application/excel',\n 'com.microsoft.ico': 'image/x-icon',\n 'com.microsoft.powerpoint.ppt': 'application/powerpoint',\n 'com.microsoft.waveform-audio': 'audio/wave',\n 'com.microsoft.windows-dynamic-link-library': 'application/x-msdownload',\n 'com.microsoft.windows-executable': 'application/exe',\n 'com.microsoft.windows-media-wax': 'audio/x-ms-wax',\n 'com.microsoft.windows-media-wm': 'video/x-ms-wm',\n 'com.microsoft.windows-media-wma': 'audio/x-ms-wma',\n 'com.microsoft.windows-media-wmd': 'video/x-ms-wmd',\n 'com.microsoft.windows-media-wmp': 'video/x-ms-wmp',\n 'com.microsoft.windows-media-wmv': 'video/x-ms-wmv',\n 'com.microsoft.windows-media-wmx': 'video/x-ms-wmx',\n 'com.microsoft.windows-media-wmz': 'video/x-ms-wmz',\n 'com.microsoft.windows-media-wvx': 'video/x-ms-wvx',\n 'com.microsoft.word.doc': 'application/msword',\n 'com.netscape.javascript-source': 'text/javascript',\n 'com.pkware.zip-archive': 'application/zip',\n 'com.rarlab.rar-archive': 'application/rar',\n 'com.real.realaudio': 'audio/vnd.rn-realaudio',\n 'com.real.realmedia': 'application/vnd.rn-realmedia',\n 'com.real.smil': 'application/smil',\n 'com.redhat.redhat-package': 'application/x-redhat-package',\n 'com.sgi.sgi-image': 'image/sgi',\n 'com.soundblaster.soundfont': 'application/x-soundfont',\n 'com.sun.java-app-descriptor': 'text/vnd.sun.j2me.app-descriptor',\n 'com.sun.java-archive': 'application/java-archive',\n 'com.sun.java-class': 'application/java',\n 'com.sun.java-source': 'text/x-java-source',\n 'com.sun.java-web-start': 'application/jnlp',\n 'com.truevision.tga-image': 'image/tga',\n 'org.bzip.bzip2-archive': 'application/x-bzip2',\n 'org.debian.debian-package': 'application/x-debian-package',\n 'org.gnu.gnu-tar-archive': 'application/x-gtar',\n 'org.gnu.gnu-zip-archive': 'application/gzip',\n 'org.neooffice.calc': 'application/vnd.sun.xml.calc',\n 'org.neooffice.draw': 'application/vnd.sun.xml.draw',\n 'org.neooffice.global': 'application/vnd.sun.xml.writer.global',\n 'org.neooffice.impress': 'application/vnd.sun.xml.impress',\n 'org.neooffice.math': 'application/vnd.sun.xml.math',\n 'org.neooffice.writer': 'application/vnd.sun.xml.writer',\n 'org.oasis.opendocument.chart': 'application/vnd.oasis.opendocument.chart',\n 'org.oasis.opendocument.database': 'application/vnd.oasis.opendocument.database',\n 'org.oasis.opendocument.formula': 'application/vnd.oasis.opendocument.formula',\n 'org.oasis.opendocument.graphics': 'application/vnd.oasis.opendocument.graphics',\n 'org.oasis.opendocument.image': 'application/vnd.oasis.opendocument.image',\n 'org.oasis.opendocument.presentation': 'application/vnd.oasis.opendocument.presentation',\n 'org.oasis.opendocument.spreadsheet': 'application/vnd.oasis.opendocument.spreadsheet',\n 'org.oasis.opendocument.text': 'application/vnd.oasis.opendocument.text',\n 'org.oasis.opendocument.text-master': 'application/vnd.oasis.opendocument.text-master',\n 'org.oasis.opendocument.text-web': 'application/vnd.oasis.opendocument.text-web',\n 'org.tug.tex': 'text/tex',\n 'org.xiph.flac': 'audio/flac',\n 'org.xiph.ogg-theora': 'video/ogg',\n 'org.xiph.ogg-vorbis': 'audio/ogg',\n 'public.3gpp': 'video/3gpp',\n 'public.3gpp2': 'video/3gpp2',\n 'public.aifc-audio': 'audio/aiff',\n 'public.aiff-audio': 'audio/aiff',\n 'public.assembly-source': 'text/x-asm',\n 'public.avi': 'video/avi',\n 'public.c-header': 'text/x-c-header',\n 'public.cpio-archive': 'application/x-cpio',\n 'public.c-plus-plus-header': 'text/x-c++-hdr',\n 'public.c-plus-plus-source': 'application/x-cplusplus',\n 'public.csh-script': 'application/x-csh',\n 'public.c-source': 'text/x-c-code',\n 'public.css': 'text/css',\n 'public.dv': 'video/x-dv',\n 'public.flv': 'video/x-flv',\n 'public.html': 'text/html',\n 'public.iso-image': 'application/x-iso-image',\n 'public.jpeg': 'image/jpeg',\n 'public.jpeg2000': 'image/jp2',\n 'public.midi': 'audio/midi',\n 'public.mka': 'audio/x-matroska',\n 'public.mkv': 'video/x-matroska',\n 'public.mp3': 'audio/mp3',\n 'public.mpeg': 'video/mpeg',\n 'public.mpeg4': 'video/mp4',\n 'public.mpeg4-audio': 'audio/mp4',\n 'public.mpegts': 'video/MP2T',\n 'public.objective-c-plus-plus-source': 'text/x-objcppsrc',\n 'public.objective-c-source': 'text/x-objcsrc',\n 'public.opentype-font': 'font/opentype',\n 'public.perl-script': 'text/x-perl',\n 'public.php-script': 'text/php',\n 'public.plain-text': 'text/plain',\n 'public.png': 'image/png',\n 'public.python-script': 'text/x-python-script',\n 'public.rtf': 'text/rtf',\n 'public.shell-script': 'application/x-sh',\n 'public.tar-archive': 'application/tar',\n 'public.tiff': 'image/tiff',\n 'public.truetype-ttf-font': 'application/x-font-ttf',\n 'public.ulaw-audio': 'audio/au',\n 'public.vcard': 'text/vcard',\n 'public.webm': 'video/webm',\n 'public.xbitmap-image': 'image/xbm',\n 'public.xml': 'text/xml',\n 'unofficial.atom-feed': 'application/atom+xml',\n 'unofficial.m3u8-playlist': 'application/x-mpegURL',\n 'unofficial.opml': 'text/x-opml',\n 'unofficial.pls-playlist': 'audio/scpls',\n 'unofficial.rdf-feed': 'application/rdf+xml',\n 'unofficial.rss-feed': 'application/rss+xml',\n }\n\n utiExts: { [key: string]: string } = {\n jpg: 'public.jpeg',\n jpeg: 'public.jpeg',\n png: 'public.png',\n rtf: 'public.rtf',\n mpeg: 'public.mpeg',\n mpg: 'public.mpeg',\n html: 'public.html',\n htm: 'public.html',\n pdf: 'com.adobe.pdf',\n xls: 'com.microsoft.excel.xls',\n xlsx: 'com.microsoft.excel.xls',\n doc: 'com.microsoft.word.doc',\n docx: 'com.microsoft.word.doc',\n }\n\n utiDefs: { [key: string]: string } = {\n 'application/atom+xml': 'unofficial.atom-feed',\n 'application/bat': 'com.microsoft.windows-executable',\n 'application/binhex': 'com.apple.binhex-archive',\n 'application/binhex4': 'com.apple.binhex-archive',\n 'application/ecmascript': 'com.netscape.javascript-source',\n 'application/eps': 'com.adobe.encapsulated-postscript',\n 'application/excel': 'com.microsoft.excel.xls',\n 'application/exe': 'com.microsoft.windows-executable',\n 'application/gnutar': 'public.tar-archive',\n 'application/gzip': 'org.gnu.gnu-zip-archive',\n 'application/illustrator': 'com.adobe.illustrator.ai-image',\n 'application/indesign': 'com.adobe.indesign-image',\n 'application/java-archive': 'com.sun.java-archive',\n 'application/java-byte-code': 'com.sun.java-class',\n 'application/java': 'com.sun.java-class',\n 'application/javascript': 'com.netscape.javascript-source',\n 'application/jnlp': 'com.sun.java-web-start',\n 'application/latex': 'org.tug.tex',\n 'application/mac-binary': 'com.apple.macbinary-archive',\n 'application/mac-binhex': 'com.apple.binhex-archive',\n 'application/mac-binhex40': 'com.apple.binhex-archive',\n 'application/macbinary': 'com.apple.macbinary-archive',\n 'application/mspowerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/msword': 'com.microsoft.word.doc',\n 'application/octet-stream': 'com.microsoft.windows-executable',\n 'application/pdf': 'com.adobe.pdf',\n 'application/photoshop': 'com.adobe.photoshop-image',\n 'application/php': 'public.php-script',\n 'application/plain': 'public.plain-text',\n 'application/postscript': 'com.adobe.postscript',\n 'application/powerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/rar': 'com.rarlab.rar-archive',\n 'application/rdf+xml': 'unofficial.rdf-feed',\n 'application/rss+xml': 'unofficial.rss-feed',\n 'application/rtf': 'public.rtf',\n 'application/smil': 'com.real.smil',\n 'application/stuffit': 'com.allume.stuffit-archive',\n 'application/tar': 'public.tar-archive',\n 'application/tga': 'com.truevision.tga-image',\n 'application/vnd.fpx': 'com.kodak.flashpix.image',\n 'application/vnd.ms-excel': 'com.microsoft.excel.xls',\n 'application/vnd.ms-powerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/vnd.oasis.opendocument.chart': 'org.oasis.opendocument.chart',\n 'application/vnd.oasis.opendocument.database': 'org.oasis.opendocument.database',\n 'application/vnd.oasis.opendocument.formula': 'org.oasis.opendocument.formula',\n 'application/vnd.oasis.opendocument.graphics-template': 'org.oasis.opendocument.graphics',\n 'application/vnd.oasis.opendocument.graphics': 'org.oasis.opendocument.graphics',\n 'application/vnd.oasis.opendocument.image': 'org.oasis.opendocument.image',\n 'application/vnd.oasis.opendocument.presentation-template': 'org.oasis.opendocument.presentation',\n 'application/vnd.oasis.opendocument.presentation': 'org.oasis.opendocument.presentation',\n 'application/vnd.oasis.opendocument.spreadsheet-template': 'org.oasis.opendocument.spreadsheet',\n 'application/vnd.oasis.opendocument.spreadsheet': 'org.oasis.opendocument.spreadsheet',\n 'application/vnd.oasis.opendocument.text-master': 'org.oasis.opendocument.text-master',\n 'application/vnd.oasis.opendocument.text-template': 'org.oasis.opendocument.text',\n 'application/vnd.oasis.opendocument.text-web': 'org.oasis.opendocument.text-web',\n 'application/vnd.oasis.opendocument.text': 'org.oasis.opendocument.text',\n 'application/vnd.rn-realmedia': 'com.real.realmedia',\n 'application/vnd.sun.xml.calc.template': 'org.neooffice.calc',\n 'application/vnd.sun.xml.calc': 'org.neooffice.calc',\n 'application/vnd.sun.xml.draw.template': 'org.neooffice.draw',\n 'application/vnd.sun.xml.draw': 'org.neooffice.draw',\n 'application/vnd.sun.xml.impress.template': 'org.neooffice.impress',\n 'application/vnd.sun.xml.impress': 'org.neooffice.impress',\n 'application/vnd.sun.xml.math': 'org.neooffice.math',\n 'application/vnd.sun.xml.writer.global': 'org.neooffice.global',\n 'application/vnd.sun.xml.writer.template': 'org.neooffice.writer',\n 'application/vnd.sun.xml.writer': 'org.neooffice.writer',\n 'application/vndms-excel': 'com.microsoft.excel.xls',\n 'application/vndms-powerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/vndrn-realmedia': 'com.real.realmedia',\n 'application/x-apple-diskimage': 'com.apple.disk-image-udif',\n 'application/x-applescript': 'com.apple.applescript.script',\n 'application/x-bat': 'com.microsoft.windows-executable',\n 'application/x-binary': 'com.apple.macbinary-archive',\n 'application/x-binhex40': 'com.apple.binhex-archive',\n 'application/x-bittorrent': 'com.bittorrent.torrent',\n 'application/x-bzip2': 'org.bzip.bzip2-archive',\n 'application/x-cpio': 'public.cpio-archive',\n 'application/x-cplusplus': 'public.c-plus-plus-source',\n 'application/x-csh': 'public.csh-script',\n 'application/x-deb': 'org.debian.debian-package',\n 'application/x-debian-package': 'org.debian.debian-package',\n 'application/x-eps': 'com.adobe.encapsulated-postscript',\n 'application/x-excel': 'com.microsoft.excel.xls',\n 'application/x-exe': 'com.microsoft.windows-executable',\n 'application/x-flac': 'org.xiph.flac',\n 'application/x-font-ttf': 'public.truetype-ttf-font',\n 'application/x-font-type1': 'com.adobe.postscript-pfa-font',\n 'application/x-gtar': 'org.gnu.gnu-tar-archive',\n 'application/x-gzip': 'org.gnu.gnu-zip-archive',\n 'application/x-iso-image': 'public.iso-image',\n 'application/x-java-class': 'com.sun.java-class',\n 'application/x-java': 'com.sun.java-web-start',\n 'application/x-javascript': 'com.netscape.javascript-source',\n 'application/x-latex': 'org.tug.tex',\n 'application/x-mac-binhex40': 'com.apple.binhex-archive',\n 'application/x-macbinary': 'com.apple.macbinary-archive',\n 'application/x-midi': 'public.midi',\n 'application/x-mpegURL': 'unofficial.m3u8-playlist',\n 'application/x-ms-wmd': 'com.microsoft.windows-media-wmd',\n 'application/x-ms-wmz': 'com.microsoft.windows-media-wmz',\n 'application/x-msdos-program': 'com.microsoft.windows-executable',\n 'application/x-msdownload': 'com.microsoft.windows-executable',\n 'application/x-msexcel': 'com.microsoft.excel.xls',\n 'application/x-mspowerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/x-pdf': 'com.adobe.pdf',\n 'application/x-perl': 'public.perl-script',\n 'application/x-php': 'public.php-script',\n 'application/x-quartzcomposer': 'com.apple.quartz-composer-composition',\n 'application/x-rar-compressed': 'com.rarlab.rar-archive',\n 'application/x-redhat-package': 'com.redhat.redhat-package',\n 'application/x-rpm': 'com.redhat.redhat-package',\n 'application/x-rtf': 'public.rtf',\n 'application/x-sh': 'public.shell-script',\n 'application/x-shellscript': 'public.shell-script',\n 'application/x-shockwave-flash': 'com.macromedia.shockwave-flash',\n 'application/x-sit': 'com.allume.stuffit-archive',\n 'application/x-smil': 'com.real.smil',\n 'application/x-soundfont': 'com.soundblaster.soundfont',\n 'application/x-stuffit': 'com.allume.stuffit-archive',\n 'application/x-tar': 'public.tar-archive',\n 'application/x-tex': 'org.tug.tex',\n 'application/x-texinfo': 'org.tug.tex',\n 'application/x-troff-msvideo': 'public.avi',\n 'application/x-zip-compressed': 'com.pkware.zip-archive',\n 'application/xhtml+xml': 'public.html',\n 'application/xml': 'public.xml',\n 'application/zip': 'com.pkware.zip-archive',\n 'audio/3gpp': 'public.3gpp',\n 'audio/3gpp2': 'public.3gpp2',\n 'audio/aiff': 'public.aiff-audio',\n 'audio/au': 'public.ulaw-audio',\n 'audio/basic': 'public.ulaw-audio',\n 'audio/flac': 'org.xiph.flac',\n 'audio/mid': 'public.midi',\n 'audio/midi': 'public.midi',\n 'audio/mp3': 'public.mp3',\n 'audio/mp4': 'public.mpeg4-audio',\n 'audio/mp4a-latm': 'public.mpeg4-audio',\n 'audio/mpeg': 'public.mp3',\n 'audio/mpeg3': 'public.mp3',\n 'audio/mpegurl': 'unofficial.m3u-playlist',\n 'audio/mpg': 'public.mp3',\n 'audio/ogg': 'org.xiph.ogg-vorbis',\n 'audio/scpls': 'unofficial.pls-playlist',\n 'audio/snd': 'public.ulaw-audio',\n 'audio/vnd.rn-realaudio': 'com.real.realaudio',\n 'audio/wav': 'com.microsoft.waveform-audio',\n 'audio/wave': 'com.microsoft.waveform-audio',\n 'audio/webm': 'public.webm',\n 'audio/x-adpcm': 'public.ulaw-audio',\n 'audio/x-aiff': 'public.aiff-audio',\n 'audio/x-au': 'public.ulaw-audio',\n 'audio/x-flac': 'org.xiph.flac',\n 'audio/x-matroska': 'public.mka',\n 'audio/x-mid': 'public.midi',\n 'audio/x-midi': 'public.midi',\n 'audio/x-mp3': 'public.mp3',\n 'audio/x-mpeg-3': 'public.mp3',\n 'audio/x-mpeg': 'public.mp3',\n 'audio/x-mpeg3': 'public.mp3',\n 'audio/x-mpegurl': 'unofficial.m3u-playlist',\n 'audio/x-mpg': 'public.mp3',\n 'audio/x-ms-wax': 'com.microsoft.windows-media-wax',\n 'audio/x-ms-wma': 'com.microsoft.windows-media-wma',\n 'audio/x-ogg': 'org.xiph.ogg-vorbis',\n 'audio/x-pn-realaudio-plugin': 'com.real.realaudio',\n 'audio/x-pn-realaudio': 'com.real.realaudio',\n 'audio/x-pn-wav': 'com.microsoft.waveform-audio',\n 'audio/x-realaudio': 'com.real.realmedia',\n 'audio/x-scpls': 'unofficial.pls-playlist',\n 'audio/x-wav': 'com.microsoft.waveform-audio',\n 'font/opentype': 'public.opentype-font',\n 'image/bmp': 'com.microsoft.bmp',\n 'image/efax': 'com.js.efx-fax',\n 'image/eps': 'com.adobe.encapsulated-postscript',\n 'image/fpx': 'com.kodak.flashpix.image',\n 'image/gif': 'com.compuserve.gif',\n 'image/indd': 'com.adobe.indesign-image',\n 'image/indesign': 'com.adobe.indesign-image',\n 'image/jp2': 'public.jpeg2000',\n 'image/jpeg': 'public.jpeg',\n 'image/ms-bmp': 'com.microsoft.bmp',\n 'image/photoshop': 'com.adobe.photoshop-image',\n 'image/pict': 'com.apple.pict',\n 'image/pipeg': 'public.jpeg',\n 'image/pjpeg': 'public.jpeg',\n 'image/png': 'public.png',\n 'image/psd': 'com.adobe.photoshop-image',\n 'image/sgi': 'com.sgi.sgi-image',\n 'image/targa': 'com.truevision.tga-image',\n 'image/tga': 'com.truevision.tga-image',\n 'image/tiff': 'public.tiff',\n 'image/vnd.djvu': 'com.lizardtech.djvu',\n 'image/vndfpx': 'com.kodak.flashpix.image',\n 'image/vndnet-fpx': 'com.kodak.flashpix.image',\n 'image/webp': 'public.webp',\n 'image/x-bitmap': 'com.microsoft.bmp',\n 'image/x-bmp': 'com.microsoft.bmp',\n 'image/x-djvu': 'com.lizardtech.djvu',\n 'image/x-eps': 'com.adobe.encapsulated-postscript',\n 'image/x-icon': 'com.microsoft.ico',\n 'image/x-indesign': 'com.adobe.indesign-image',\n 'image/x-macpict': 'com.apple.pict',\n 'image/x-ms-bmp': 'com.microsoft.bmp',\n 'image/x-photoshop': 'com.adobe.photoshop-image',\n 'image/x-pict': 'com.apple.pict',\n 'image/x-quicktime': 'com.apple.quicktime-image',\n 'image/x-tiff': 'public.tiff',\n 'image/x-windows-bmp': 'com.microsoft.bmp',\n 'image/x-xbitmap': 'com.microsoft.bmp',\n 'image/x-xbm': 'public.xbitmap-image',\n 'image/xbm': 'public.xbitmap-image',\n 'multipart/x-gzip': 'org.gnu.gnu-zip-archive',\n 'multipart/x-zip': 'com.pkware.zip-archive',\n 'music/crescendo': 'public.midi',\n 'text/calendar': 'com.apple.ical.ics',\n 'text/css': 'public.css',\n 'text/directory': 'public.vcard',\n 'text/ecmascript': 'com.netscape.javascript-source',\n 'text/html': 'public.html',\n 'text/javascript': 'com.netscape.javascript-source',\n 'text/php': 'public.php-script',\n 'text/plain': 'public.plain-text',\n 'text/richtext': 'public.rtf',\n 'text/rtf': 'public.rtf',\n 'text/ruby-script': 'public.ruby-script',\n 'text/tex': 'org.tug.tex',\n 'text/vcard': 'public.vcard',\n 'text/vnd.sun.j2me.app-descriptor': 'com.sun.java-app-descriptor',\n 'text/x-asm': 'public.assembly-source',\n 'text/x-c-code': 'public.c-source',\n 'text/x-c-header': 'public.c-header',\n 'text/x-c': 'public.c-source',\n 'text/x-c++-code': 'public.c-plus-plus-source',\n 'text/x-c++-hdr': 'public.c-plus-plus-header',\n 'text/x-c++-src': 'public.c-plus-plus-source',\n 'text/x-c++src': 'public.c-plus-plus-source',\n 'text/x-h': 'public.c-header',\n 'text/x-java-source': 'com.sun.java-source',\n 'text/x-latex': 'org.tug.tex',\n 'text/x-objcppsrc': 'public.objective-c-plus-plus-source',\n 'text/x-objcsrc': 'public.objective-c-source',\n 'text/x-opml': 'unofficial.opml',\n 'text/x-perl-script': 'public.perl-script',\n 'text/x-perl': 'public.perl-script',\n 'text/x-php-script': 'public.php-script',\n 'text/x-python-script': 'public.python-script',\n 'text/x-python': 'public.python-script',\n 'text/x-scriptcsh': 'public.csh-script',\n 'text/x-scriptperl-module': 'public.perl-script',\n 'text/x-scriptperl': 'public.perl-script',\n 'text/x-scriptphyton': 'public.python-script',\n 'text/x-scriptsh': 'public.shell-script',\n 'text/x-server-parsed-html': 'public.html',\n 'text/x-tex': 'org.tug.tex',\n 'text/x-vcalendar': 'com.apple.ical.vcs',\n 'text/x-vcard': 'public.vcard',\n 'text/xhtml': 'public.html',\n 'text/xml': 'public.xml',\n 'video/3gpp': 'public.3gpp',\n 'video/3gpp2': 'public.3gpp2',\n 'video/avi': 'public.avi',\n 'video/MP2T': 'public.mpegts',\n 'video/mp4': 'public.mpeg4',\n 'video/mp4v': 'public.mpeg4',\n 'video/mpeg': 'public.mpeg',\n 'video/mpg': 'public.mpeg',\n 'video/msvideo': 'public.avi',\n 'video/ogg': 'org.xiph.ogg-theora',\n 'video/quicktime': 'com.apple.quicktime-movie',\n 'video/webm': 'public.webm',\n 'video/x-dv': 'public.dv',\n 'video/x-flv': 'public.flv',\n 'video/x-m4v': 'public.mpeg4',\n 'video/x-matroska': 'public.mkv',\n 'video/x-mpeg': 'public.mpeg',\n 'video/x-mpg': 'public.mpeg',\n 'video/x-ms-asf-plugin': 'com.microsoft.advanced-systems-format',\n 'video/x-ms-asf': 'com.microsoft.advanced-systems-format',\n 'video/x-ms-asx': 'com.microsoft.advanced-stream-redirector',\n 'video/x-ms-wm': 'com.microsoft.windows-media-wm',\n 'video/x-ms-wmd': 'com.microsoft.windows-media-wmd',\n 'video/x-ms-wmp': 'com.microsoft.windows-media-wmp',\n 'video/x-ms-wmv': 'com.microsoft.windows-media-wmv',\n 'video/x-ms-wmx': 'com.microsoft.windows-media-wmx',\n 'video/x-ms-wmz': 'com.microsoft.windows-media-wmz',\n 'video/x-ms-wvx': 'com.microsoft.windows-media-wvx',\n 'video/x-msvideo': 'public.avi',\n 'video/x-ogg': 'org.xiph.ogg-theora',\n 'x-msdos-program': 'com.microsoft.windows-executable',\n 'x-music/x-midi': 'public.midi',\n }\n dataOwnerApi: IccDataOwnerXApi\n authenticationProvider: AuthenticationProvider\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n private crypto: IccCryptoXApi,\n private authApi: IccAuthApi,\n dataOwnerApi: IccDataOwnerXApi,\n private readonly autofillAuthor: boolean,\n authenticationProvider: AuthenticationProvider = new NoAuthenticationProvider(),\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch\n ) {\n super(host, headers, authenticationProvider, fetchImpl)\n this.fetchImpl = fetchImpl\n this.authenticationProvider = authenticationProvider\n this.dataOwnerApi = dataOwnerApi\n }\n\n override get headers(): Promise<Array<XHR.Header>> {\n return super.headers.then((h) => this.crypto.accessControlKeysHeaders.addAccessControlKeysHeaders(h, EntityWithDelegationTypeName.Document))\n }\n\n /**\n * Creates a new instance of document with initialised encryption metadata (not in the database).\n * @param user the current user.\n * @param message the message this document refers to.\n * @param c initialised data for the document. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify\n * other kinds of data or overwrite generated metadata with this. You can't specify encryption metadata.\n * @param options optional parameters:\n * - additionalDelegates: delegates which will have access to the entity in addition to the current data owner and delegates from the\n * auto-delegations. Must be an object which associates each data owner id with the access level to give to that data owner. May overlap with\n * auto-delegations, in such case the access level specified here will be used.\n * - preferredSfk: secret id of the message to use as the secret foreign key to use for the document. The default value will be a\n * secret id of the message known by the topmost parent in the current data owner hierarchy.\n * @return a new instance of document.\n */\n async newInstance(\n user: models.User,\n message?: models.Message,\n c: any = {},\n options: {\n additionalDelegates?: { [dataOwnerId: string]: AccessLevelEnum }\n preferredSfk?: string\n } = {}\n ) {\n if (!message && options.preferredSfk) throw new Error('You need to specify parent message in order to use secret foreign keys.')\n const document = {\n ...(c ?? {}),\n _type: 'org.taktik.icure.entities.Document',\n id: c?.id ?? this.crypto.primitives.randomUuid(),\n created: c?.created ?? new Date().getTime(),\n modified: c?.modified ?? new Date().getTime(),\n responsible: c?.responsible ?? (this.autofillAuthor ? this.dataOwnerApi.getDataOwnerIdOf(user) : undefined),\n author: c?.author ?? (this.autofillAuthor ? user.id : undefined),\n codes: c?.codes ?? [],\n tags: c?.tags ?? [],\n }\n\n const ownerId = this.dataOwnerApi.getDataOwnerIdOf(user)\n if (ownerId !== (await this.dataOwnerApi.getCurrentDataOwnerId())) throw new Error('Can only initialise entities as current data owner.')\n const sfk = message\n ? options.preferredSfk ??\n (await this.crypto.confidential.getAnySecretIdSharedWithParents({ entity: message, type: EntityWithDelegationTypeName.Message }))\n : undefined\n if (message && !sfk) throw new Error(`Couldn't find any sfk of parent message ${message.id}`)\n const extraDelegations = {\n ...Object.fromEntries(\n [...(user.autoDelegations?.all ?? []), ...(user.autoDelegations?.medicalInformation ?? [])].map((d) => [d, AccessLevelEnum.WRITE])\n ),\n ...(options?.additionalDelegates ?? {}),\n }\n return new models.Document(\n await this.crypto.xapi\n .entityWithInitialisedEncryptedMetadata(document, EntityWithDelegationTypeName.Document, message?.id, sfk, true, false, extraDelegations)\n .then((x) => x.updatedEntity)\n )\n }\n\n // noinspection JSUnusedGlobalSymbols\n async findByMessage(hcpartyId: string, message: models.Message) {\n const extractedKeys = await this.crypto.xapi.secretIdsOf({ entity: message, type: EntityWithDelegationTypeName.Message }, hcpartyId)\n const topmostParentId = (await this.dataOwnerApi.getCurrentDataOwnerHierarchyIds())[0]\n let documents: Array<models.Document> = await this.findDocumentsByHCPartyPatientForeignKeys(topmostParentId, _.uniq(extractedKeys).join(','))\n return await this.decrypt(hcpartyId, documents)\n }\n\n // Note: this is only for dealing with legacy documents: new document are not encrypted, only their attachments are\n decrypt(hcpartyId: string, documents: Array<models.Document>): Promise<Array<models.Document>> {\n return Promise.all(\n documents.map((document) =>\n this.crypto.xapi.decryptAndImportAllDecryptionKeys({ entity: document, type: EntityWithDelegationTypeName.Document }).then((keys) => {\n if (!keys.length) {\n console.log('Cannot decrypt document', document.id)\n return Promise.resolve(document)\n }\n\n if (keys.length && (document.encryptedSelf || document.encryptedAttachment)) {\n const key = keys[0].key\n return Promise.all([\n document.encryptedSelf\n ? new Promise((resolve: (value: ArrayBuffer | null) => any) => {\n this.crypto.primitives.AES.decrypt(key, string2ua(a2b(document.encryptedSelf!))).then(resolve, () => {\n console.log('Cannot decrypt document', document.id)\n resolve(null)\n })\n })\n : Promise.resolve(null),\n document.encryptedAttachment\n ? new Promise((resolve: (value: ArrayBuffer | null) => any) => {\n this.crypto.primitives.AES.decrypt(key, document.encryptedAttachment!).then(resolve, () => {\n console.log('Cannot decrypt document', document.id)\n resolve(null)\n })\n })\n : Promise.resolve(null),\n ]).then((decrypted: [ArrayBuffer | null, ArrayBuffer | null]) => {\n if (decrypted) {\n if (decrypted[0]) {\n document = _.extend(document, JSON.parse(ua2string(decrypted[0])))\n }\n if (decrypted[1]) {\n document.decryptedAttachment = decrypted[1]\n }\n }\n return document\n })\n } else {\n return Promise.resolve(document)\n }\n })\n )\n ).catch(function (e: Error) {\n console.log(e)\n return Promise.resolve(documents)\n })\n }\n\n //prettier-ignore\n getAttachmentAs(documentId: string, attachmentId: string, returnType: \"application/octet-stream\", enckeys?: string, fileName?: string): Promise<ArrayBuffer>\n //prettier-ignore\n getAttachmentAs(documentId: string, attachmentId: string, returnType: \"text/plain\", enckeys?: string, fileName?: string): Promise<string>\n //prettier-ignore\n getAttachmentAs(documentId: string, attachmentId: string, returnType: \"application/json\", enckeys?: string, fileName?: string): Promise<any>\n /**\n * @deprecated use getMainAttachmentAs instead\n */\n async getAttachmentAs(\n documentId: string,\n attachmentId: string,\n returnType: 'application/octet-stream' | 'text/plain' | 'application/json',\n enckeys?: string,\n fileName?: string\n ): Promise<any> {\n const url =\n this.host +\n `/document/${documentId}/attachment/${attachmentId}` +\n '?ts=' +\n new Date().getTime() +\n (enckeys ? `&enckeys=${enckeys}` : '') +\n (fileName ? `&fileName=${fileName}` : '')\n return XHR.sendCommand('GET', url, await this.headers, null, this.fetchImpl, returnType, this.authenticationProvider.getAuthService())\n .then((doc) => doc.body)\n .catch((err) => this.handleError(err))\n }\n\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: \"application/octet-stream\"): Promise<ArrayBuffer>\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: \"text/plain\"): Promise<string>\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: \"application/json\"): Promise<any>\n async getMainAttachmentAs(documentId: string, returnType: 'application/octet-stream' | 'text/plain' | 'application/json'): Promise<any> {\n const url = this.host + `/document/${documentId}/attachment` + '?ts=' + new Date().getTime()\n return XHR.sendCommand('GET', url, await this.headers, null, this.fetchImpl, returnType, this.authenticationProvider.getAuthService())\n .then((doc) => doc.body)\n .catch((err) => this.handleError(err))\n }\n\n // noinspection JSUnusedGlobalSymbols\n getAttachmentUrl(documentId: string, attachmentId: string, sfks: Array<{ delegatorId: string; key: CryptoKey }>, fileName?: string) {\n return this.authApi\n .token('GET', `/rest/v1/document/${documentId}/attachment/${attachmentId}`)\n .then(\n (token) =>\n this.host +\n `/document/${documentId}/attachment/${attachmentId}${token ? `;tokenid=${token}` : ''}` +\n (sfks && sfks.length ? '?enckeys=' + sfks.join(',') : '') +\n (fileName && fileName.length ? `${sfks && sfks.length ? '&' : '?'}fileName=${encodeURIComponent(fileName)}` : '')\n )\n }\n\n // noinspection JSUnusedGlobalSymbols\n uti(mimeType: string, extension: string) {\n return (mimeType && mimeType !== 'application/octet-stream' ? this.utiDefs[mimeType] : this.utiExts[extension]) || this.utiDefs[mimeType]\n }\n\n // noinspection JSUnusedGlobalSymbols\n mimeType(uti: string) {\n return this.utiRevDefs[uti]\n }\n\n /**\n * Adds an attachment to a document, encrypting it on client side using the encryption keys of the provided document.\n * @param document a document.\n * @param attachment a new main attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async encryptAndSetDocumentAttachment(document: models.Document, attachment: ArrayBuffer | Uint8Array, utis?: string[]): Promise<models.Document> {\n if (!document.rev) throw new Error('Cannot set attachment on document without rev')\n const { encryptedData, updatedEntity } = await this.crypto.xapi.encryptDataOf(document, EntityWithDelegationTypeName.Document, attachment, (d) =>\n this.modifyDocument(d)\n )\n return await this.setMainDocumentAttachment(document.id!, updatedEntity?.rev ?? document.rev, encryptedData, utis)\n }\n\n /**\n * Adds an unencrypted attachment to a document.\n * @param document a document.\n * @param attachment a new main attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async setClearDocumentAttachment(document: models.Document, attachment: ArrayBuffer | Uint8Array, utis?: string[]): Promise<models.Document> {\n if (!document.rev) throw new Error('Cannot set attachment on document without rev')\n return await this.setMainDocumentAttachment(document.id!, document.rev, attachment, utis)\n }\n\n /**\n * Adds a secondary attachment to a document, encrypting it on client side using the encryption keys of the provided document.\n * @param document a document.\n * @param secondaryAttachmentKey key for the secondary attachment.\n * @param attachment a new secondary attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async encryptAndSetSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n attachment: ArrayBuffer | Uint8Array,\n utis?: string[]\n ): Promise<models.Document> {\n if (!document.rev) throw new Error('Cannot set attachment on document without rev')\n const { encryptedData, updatedEntity } = await this.crypto.xapi.encryptDataOf(document, EntityWithDelegationTypeName.Document, attachment, (d) =>\n this.modifyDocument()\n )\n return await this.setSecondaryAttachment(document.id!, secondaryAttachmentKey, updatedEntity?.rev ?? document.rev!, encryptedData, utis)\n }\n\n /**\n * Adds an unencrypted secondary attachment to a document.\n * @param document a document.\n * @param secondaryAttachmentKey key for the secondary attachment.\n * @param attachment a new secondary attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async setClearSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n attachment: ArrayBuffer | Uint8Array,\n utis?: string[]\n ): Promise<models.Document> {\n return await this.setSecondaryAttachment(document.id!, secondaryAttachmentKey, document.rev!, attachment, utis)\n }\n\n /**\n * Gets the main attachment of a document and tries to decrypt it using the encryption keys of the document, throwing an error if the operation fails.\n * @param document a document.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return the decrypted attachment, if it could be decrypted, else the encrypted attachment.\n */\n async getAndDecryptDocumentAttachment(\n document: models.Document,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<ArrayBuffer> {\n const retrieved = await this.getAndTryDecryptDocumentAttachment(document, (x) => validator(x))\n if (!retrieved.wasDecrypted) throw new Error(`No valid key found to decrypt data of document ${document.id}.`)\n return retrieved.data\n }\n\n /**\n * Gets the main attachment of a document and tries to decrypt it using the encryption keys of the document.\n * @param document a document.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return an object containing:\n * - data: the decrypted attachment, if it could be decrypted, else the encrypted attachment.\n * - wasDecrypted: if the data was successfully decrypted or not\n */\n async getAndTryDecryptDocumentAttachment(\n document: models.Document,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<{ data: ArrayBuffer; wasDecrypted: boolean }> {\n return await this.crypto.xapi.tryDecryptDataOf(\n { entity: document, type: EntityWithDelegationTypeName.Document },\n await this.getRawMainDocumentAttachment(document.id!),\n (x) => validator(x)\n )\n }\n\n /**\n * Gets the secondary attachment of a document and tries to decrypt it using the encryption keys of the document, throwing an error if the operation fails.\n * @param document a document.\n * @param secondaryAttachmentKey key of the secondary attachment.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return the decrypted attachment.\n */\n async getAndDecryptSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<ArrayBuffer> {\n const { data, wasDecrypted } = await this.getAndTryDecryptSecondaryDocumentAttachment(document, secondaryAttachmentKey, (x) => validator(x))\n if (!wasDecrypted) throw new Error(`No valid key found to decrypt data of document ${document.id}.`)\n return data\n }\n\n /**\n * Gets the secondary attachment of a document and tries to decrypt it using the encryption keys of the document.\n * @param document a document.\n * @param secondaryAttachmentKey key of the secondary attachment.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return an object containing:\n * - data: the decrypted attachment, if it could be decrypted, else the encrypted attachment.\n * - wasDecrypted: if the data was successfully decrypted or not\n */\n async getAndTryDecryptSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<{ data: ArrayBuffer; wasDecrypted: boolean }> {\n return await this.crypto.xapi.tryDecryptDataOf(\n { entity: document, type: EntityWithDelegationTypeName.Document },\n await this.getSecondaryAttachment(document.id!, secondaryAttachmentKey),\n (x) => validator(x)\n )\n }\n\n /**\n * @param document a document\n * @return the id of the message that the document refers to, retrieved from the encrypted metadata. Normally there should only be one element\n * in the returned array, but in case of entity merges there could be multiple values.\n */\n async decryptMessageIdOf(document: models.Document): Promise<string[]> {\n return this.crypto.xapi.owningEntityIdsOf({ entity: document, type: EntityWithDelegationTypeName.Document }, undefined)\n }\n\n /**\n * @return if the logged data owner has write access to the content of the given document\n */\n async hasWriteAccess(document: models.Document): Promise<boolean> {\n return this.crypto.xapi.hasWriteAccess({ entity: document, type: EntityWithDelegationTypeName.Document })\n }\n\n /**\n * Share an existing document with other data owners, allowing them to access the non-encrypted data of the document and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param delegateId the id of the data owner which will be granted access to the document.\n * @param document the document to share.\n * @param options optional parameters to customize the sharing behaviour:\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity\n */\n async shareWith(\n delegateId: string,\n document: models.Document,\n options: {\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n shareMessageId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n } = {}\n ): Promise<models.Document> {\n return this.shareWithMany(document, { [delegateId]: options })\n }\n\n /**\n * Share an existing document with other data owners, allowing them to access the non-encrypted data of the document and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param document the document to share.\n * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity.\n */\n async shareWithMany(\n document: models.Document,\n delegates: {\n [delegateId: string]: {\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n shareMessageId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<models.Document> {\n return (await this.tryShareWithMany(document, delegates)).updatedEntityOrThrow\n }\n /**\n * Share an existing document with other data owners, allowing them to access the non-encrypted data of the document and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param document the document to share.\n * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return a promise which will contain the result of the operation: the updated entity if the operation was successful or details of the error if\n * the operation failed.\n */\n async tryShareWithMany(\n document: models.Document,\n delegates: {\n [delegateId: string]: {\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n shareMessageId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<ShareResult<models.Document>> {\n const self = await this.dataOwnerApi.getCurrentDataOwnerId()\n // All entities should have an encryption key.\n const entityWithEncryptionKey = await this.crypto.xapi.ensureEncryptionKeysInitialised(document, EntityWithDelegationTypeName.Document)\n const updatedEntity = entityWithEncryptionKey ? await this.modifyDocument(entityWithEncryptionKey) : document\n return this.crypto.xapi\n .simpleShareOrUpdateEncryptedEntityMetadata(\n { entity: updatedEntity, type: EntityWithDelegationTypeName.Document },\n true,\n Object.fromEntries(\n Object.entries(delegates).map(([delegateId, options]) => [\n delegateId,\n {\n requestedPermissions: options.requestedPermissions,\n shareEncryptionKeys: options.shareEncryptionKey,\n shareOwningEntityIds: options.shareMessageId,\n shareSecretIds: undefined,\n },\n ])\n ),\n (x) => this.bulkShareDocument(x)\n )\n .then((r) => r.mapSuccessAsync((e) => this.decrypt(self, [e]).then((es) => es[0])))\n }\n\n getDataOwnersWithAccessTo(\n entity: models.Document\n ): Promise<{ permissionsByDataOwnerId: { [p: string]: AccessLevelEnum }; hasUnknownAnonymousDataOwners: boolean }> {\n return this.crypto.delegationsDeAnonymization.getDataOwnersWithAccessTo({ entity, type: EntityWithDelegationTypeName.Document })\n }\n\n getEncryptionKeysOf(entity: models.Document): Promise<string[]> {\n return this.crypto.xapi.encryptionKeysOf({ entity, type: EntityWithDelegationTypeName.Document }, undefined)\n }\n\n createDelegationDeAnonymizationMetadata(entity: models.Document, delegates: string[]): Promise<void> {\n return this.crypto.delegationsDeAnonymization.createOrUpdateDeAnonymizationInfo(\n { entity, type: EntityWithDelegationTypeName.Document },\n delegates\n )\n }\n}\n"]}
1
+ {"version":3,"file":"icc-document-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-document-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAuD;AAGvD,4BAA2B;AAC3B,4CAAwC;AACxC,kDAAiD;AAEjD,uDAAwE;AAExE,0EAAgG;AAChG,wEAAoE;AACpE,IAAO,eAAe,GAAG,mCAAgB,CAAC,eAAe,CAAA;AAOzD,mCAAsD;AAEtD,qCAAqC;AACrC,MAAa,eAAgB,SAAQ,wBAAc;IAuhBjD,YACE,IAAY,EACZ,OAAkC,EAC1B,MAAqB,EACrB,OAAmB,EAC3B,YAA8B,EACb,cAAuB,EACxC,yBAAiD,IAAI,iDAAwB,EAAE,EAC/E,YAA2E,OAAO,MAAM,KAAK,WAAW;QACtG,CAAC,CAAC,MAAM,CAAC,KAAK;QACd,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW;YAC7B,CAAC,CAAC,IAAI,CAAC,KAAK;YACZ,CAAC,CAAC,KAAK;QAET,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,sBAAsB,EAAE,SAAS,CAAC,CAAA;QAX/C,W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AAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACvF,CAAC;KAAA;IAED,yBAAyB,CACvB,MAAuB;QAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,yBAAyB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,oCAA4B,CAAC,QAAQ,EAAE,CAAC,CAAA;IAClI,CAAC;IAED,mBAAmB,CAAC,MAAuB;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,oCAA4B,CAAC,QAAQ,EAAE,EAAE,SAAS,CAAC,CAAA;IAC9G,CAAC;IAED,uCAAuC,CAAC,MAAuB,EAAE,SAAmB;QAClF,OAAO,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,iCAAiC,CAC7E,EAAE,MAAM,EAAE,IAAI,EAAE,oCAA4B,CAAC,QAAQ,EAAE,EACvD,SAAS,CACV,CAAA;IACH,CAAC;CACF;AAl+BD,0CAk+BC","sourcesContent":["import { IccAuthApi, IccDocumentApi } from '../icc-api'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\n\nimport * as _ from 'lodash'\nimport { XHR } from '../icc-api/api/XHR'\nimport * as models from '../icc-api/model/models'\n\nimport { a2b, hex2ua, string2ua, ua2string } from './utils/binary-utils'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport { AuthenticationProvider, NoAuthenticationProvider } from './auth/AuthenticationProvider'\nimport { SecureDelegation } from '../icc-api/model/SecureDelegation'\nimport AccessLevelEnum = SecureDelegation.AccessLevelEnum\nimport { ShareMetadataBehaviour } from './crypto/ShareMetadataBehaviour'\nimport { ShareResult } from './utils/ShareResult'\nimport { EntityShareRequest } from '../icc-api/model/requests/EntityShareRequest'\nimport RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum\nimport { EncryptedEntityXApi } from './basexapi/EncryptedEntityXApi'\nimport { AccessLog } from '../icc-api/model/models'\nimport { EntityWithDelegationTypeName } from './utils'\n\n// noinspection JSUnusedGlobalSymbols\nexport class IccDocumentXApi extends IccDocumentApi implements EncryptedEntityXApi<models.Document> {\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n /** maps invalid UTI values to corresponding MIME type for backward-compatibility (pre-v1.0.117) */\n compatUtiRevDefs: { [key: string]: string } = {\n 'com.adobe.encapsulatedPostscript': 'image/eps',\n 'com.adobe.illustrator.aiImage': 'application/illustrator',\n 'com.adobe.indesignImage': 'image/indesign',\n 'com.adobe.photoshopImage': 'image/psd',\n 'com.adobe.postscriptPfaFont': 'application/x-font-type1',\n 'com.adobe.postscriptPfbFont': 'application/x-font-type1',\n 'com.allume.stuffitArchive': 'application/stuffit',\n 'com.apple.binhexArchive': 'application/binhex',\n 'com.apple.diskImageUdif': 'application/x-apple-diskimage',\n 'com.apple.macbinaryArchive': 'application/macbinary',\n 'com.apple.quartzComposerComposition': 'application/x-quartzcomposer',\n 'com.apple.quicktimeImage': 'image/x-quicktime',\n 'com.apple.quicktimeMovie': 'video/quicktime',\n 'com.js.efxFax': 'image/efax',\n 'com.macromedia.shockwaveFlash': 'application/x-shockwave-flash',\n 'com.microsoft.advancedStreamRedirector': 'video/x-ms-asx',\n 'com.microsoft.advancedSystemsFormat': 'video/x-ms-asf',\n 'com.microsoft.waveformAudio': 'audio/wave',\n 'com.microsoft.windowsDynamicLinkLibrary': 'application/x-msdownload',\n 'com.microsoft.windowsExecutable': 'application/exe',\n 'com.microsoft.windowsMediaWax': 'audio/x-ms-wax',\n 'com.microsoft.windowsMediaWm': 'video/x-ms-wm',\n 'com.microsoft.windowsMediaWma': 'audio/x-ms-wma',\n 'com.microsoft.windowsMediaWmd': 'video/x-ms-wmd',\n 'com.microsoft.windowsMediaWmp': 'video/x-ms-wmp',\n 'com.microsoft.windowsMediaWmv': 'video/x-ms-wmv',\n 'com.microsoft.windowsMediaWmx': 'video/x-ms-wmx',\n 'com.microsoft.windowsMediaWmz': 'video/x-ms-wmz',\n 'com.microsoft.windowsMediaWvx': 'video/x-ms-wvx',\n 'com.netscape.javascriptSource': 'text/javascript',\n 'com.pkware.zipArchive': 'application/zip',\n 'com.rarlab.rarArchive': 'application/rar',\n 'com.redhat.redhatPackage': 'application/x-redhat-package',\n 'com.sgi.sgiImage': 'image/sgi',\n 'com.sun.javaAppDescriptor': 'text/vnd.sun.j2me.app-descriptor',\n 'com.sun.javaArchive': 'application/java-archive',\n 'com.sun.javaClass': 'application/java',\n 'com.sun.javaSource': 'text/x-java-source',\n 'com.sun.javaWebStart': 'application/jnlp',\n 'com.truevision.tgaImage': 'image/tga',\n 'org.bzip.bzip2Archive': 'application/x-bzip2',\n 'org.debian.debianPackage': 'application/x-debian-package',\n 'org.gnu.gnuTarArchive': 'application/x-gtar',\n 'org.gnu.gnuZipArchive': 'application/gzip',\n 'org.oasis.opendocument.textMaster': 'application/vnd.oasis.opendocument.text-master',\n 'org.oasis.opendocument.textWeb': 'application/vnd.oasis.opendocument.text-web',\n 'org.xiph.oggTheora': 'video/ogg',\n 'org.xiph.oggVorbis': 'audio/ogg',\n 'public.aifcAudio': 'audio/aiff',\n 'public.aiffAudio': 'audio/aiff',\n 'public.assemblySource': 'text/x-asm',\n 'public.cHeader': 'text/x-c-header',\n 'public.cpioArchive': 'application/x-cpio',\n 'public.cPlusPlusHeader': 'text/x-c++-hdr',\n 'public.cPlusPlusSource': 'application/x-cplusplus',\n 'public.cshScript': 'application/x-csh',\n 'public.cSource': 'text/x-c-code',\n 'public.isoImage': 'application/x-iso-image',\n 'public.mpeg4Audio': 'audio/mp4',\n 'public.objectiveCPlusPlusSource': 'text/x-objcppsrc',\n 'public.objectiveCSource': 'text/x-objcsrc',\n 'public.opentypeFont': 'font/opentype',\n 'public.perlScript': 'text/x-perl',\n 'public.phpScript': 'text/php',\n 'public.plainText': 'text/plain',\n 'public.pythonScript': 'text/x-python-script',\n 'public.shellScript': 'application/x-sh',\n 'public.tarArchive': 'application/tar',\n 'public.truetypeTtfFont': 'application/x-font-ttf',\n 'public.ulawAudio': 'audio/au',\n 'public.xbitmapImage': 'image/xbm',\n 'unofficial.atomFeed': 'application/atom+xml',\n 'unofficial.m3u8Playlist': 'application/x-mpegURL',\n 'unofficial.plsPlaylist': 'audio/scpls',\n 'unofficial.rdfFeed': 'application/rdf+xml',\n 'unofficial.rssFeed': 'application/rss+xml',\n }\n\n utiRevDefs: { [key: string]: string } = {\n ...this.compatUtiRevDefs,\n 'com.adobe.encapsulated-postscript': 'image/eps',\n 'com.adobe.illustrator.ai-image': 'application/illustrator',\n 'com.adobe.indesign-image': 'image/indesign',\n 'com.adobe.pdf': 'application/pdf',\n 'com.adobe.photoshop-image': 'image/psd',\n 'com.adobe.postscript': 'application/postscript',\n 'com.adobe.postscript-pfa-font': 'application/x-font-type1',\n 'com.adobe.postscript-pfb-font': 'application/x-font-type1',\n 'com.allume.stuffit-archive': 'application/stuffit',\n 'com.apple.applescript.script': 'application/x-applescript',\n 'com.apple.applescript.text': 'application/x-applescript',\n 'com.apple.binhex-archive': 'application/binhex',\n 'com.apple.disk-image-udif': 'application/x-apple-diskimage',\n 'com.apple.ical.ics': 'text/calendar',\n 'com.apple.ical.vcs': 'text/x-vcalendar',\n 'com.apple.macbinary-archive': 'application/macbinary',\n 'com.apple.pict': 'image/pict',\n 'com.apple.quartz-composer-composition': 'application/x-quartzcomposer',\n 'com.apple.quicktime-image': 'image/x-quicktime',\n 'com.apple.quicktime-movie': 'video/quicktime',\n 'com.bittorrent.torrent': 'application/x-bittorrent',\n 'com.compuserve.gif': 'image/gif',\n 'com.js.efx-fax': 'image/efax',\n 'com.kodak.flashpix.image': 'image/vndfpx',\n 'com.lizardtech.djvu': 'image/vnd.djvu',\n 'com.macromedia.shockwave-flash': 'application/x-shockwave-flash',\n 'com.microsoft.advanced-stream-redirector': 'video/x-ms-asx',\n 'com.microsoft.advanced-systems-format': 'video/x-ms-asf',\n 'com.microsoft.bmp': 'image/bmp',\n 'com.microsoft.excel.xls': 'application/excel',\n 'com.microsoft.ico': 'image/x-icon',\n 'com.microsoft.powerpoint.ppt': 'application/powerpoint',\n 'com.microsoft.waveform-audio': 'audio/wave',\n 'com.microsoft.windows-dynamic-link-library': 'application/x-msdownload',\n 'com.microsoft.windows-executable': 'application/exe',\n 'com.microsoft.windows-media-wax': 'audio/x-ms-wax',\n 'com.microsoft.windows-media-wm': 'video/x-ms-wm',\n 'com.microsoft.windows-media-wma': 'audio/x-ms-wma',\n 'com.microsoft.windows-media-wmd': 'video/x-ms-wmd',\n 'com.microsoft.windows-media-wmp': 'video/x-ms-wmp',\n 'com.microsoft.windows-media-wmv': 'video/x-ms-wmv',\n 'com.microsoft.windows-media-wmx': 'video/x-ms-wmx',\n 'com.microsoft.windows-media-wmz': 'video/x-ms-wmz',\n 'com.microsoft.windows-media-wvx': 'video/x-ms-wvx',\n 'com.microsoft.word.doc': 'application/msword',\n 'com.netscape.javascript-source': 'text/javascript',\n 'com.pkware.zip-archive': 'application/zip',\n 'com.rarlab.rar-archive': 'application/rar',\n 'com.real.realaudio': 'audio/vnd.rn-realaudio',\n 'com.real.realmedia': 'application/vnd.rn-realmedia',\n 'com.real.smil': 'application/smil',\n 'com.redhat.redhat-package': 'application/x-redhat-package',\n 'com.sgi.sgi-image': 'image/sgi',\n 'com.soundblaster.soundfont': 'application/x-soundfont',\n 'com.sun.java-app-descriptor': 'text/vnd.sun.j2me.app-descriptor',\n 'com.sun.java-archive': 'application/java-archive',\n 'com.sun.java-class': 'application/java',\n 'com.sun.java-source': 'text/x-java-source',\n 'com.sun.java-web-start': 'application/jnlp',\n 'com.truevision.tga-image': 'image/tga',\n 'org.bzip.bzip2-archive': 'application/x-bzip2',\n 'org.debian.debian-package': 'application/x-debian-package',\n 'org.gnu.gnu-tar-archive': 'application/x-gtar',\n 'org.gnu.gnu-zip-archive': 'application/gzip',\n 'org.neooffice.calc': 'application/vnd.sun.xml.calc',\n 'org.neooffice.draw': 'application/vnd.sun.xml.draw',\n 'org.neooffice.global': 'application/vnd.sun.xml.writer.global',\n 'org.neooffice.impress': 'application/vnd.sun.xml.impress',\n 'org.neooffice.math': 'application/vnd.sun.xml.math',\n 'org.neooffice.writer': 'application/vnd.sun.xml.writer',\n 'org.oasis.opendocument.chart': 'application/vnd.oasis.opendocument.chart',\n 'org.oasis.opendocument.database': 'application/vnd.oasis.opendocument.database',\n 'org.oasis.opendocument.formula': 'application/vnd.oasis.opendocument.formula',\n 'org.oasis.opendocument.graphics': 'application/vnd.oasis.opendocument.graphics',\n 'org.oasis.opendocument.image': 'application/vnd.oasis.opendocument.image',\n 'org.oasis.opendocument.presentation': 'application/vnd.oasis.opendocument.presentation',\n 'org.oasis.opendocument.spreadsheet': 'application/vnd.oasis.opendocument.spreadsheet',\n 'org.oasis.opendocument.text': 'application/vnd.oasis.opendocument.text',\n 'org.oasis.opendocument.text-master': 'application/vnd.oasis.opendocument.text-master',\n 'org.oasis.opendocument.text-web': 'application/vnd.oasis.opendocument.text-web',\n 'org.tug.tex': 'text/tex',\n 'org.xiph.flac': 'audio/flac',\n 'org.xiph.ogg-theora': 'video/ogg',\n 'org.xiph.ogg-vorbis': 'audio/ogg',\n 'public.3gpp': 'video/3gpp',\n 'public.3gpp2': 'video/3gpp2',\n 'public.aifc-audio': 'audio/aiff',\n 'public.aiff-audio': 'audio/aiff',\n 'public.assembly-source': 'text/x-asm',\n 'public.avi': 'video/avi',\n 'public.c-header': 'text/x-c-header',\n 'public.cpio-archive': 'application/x-cpio',\n 'public.c-plus-plus-header': 'text/x-c++-hdr',\n 'public.c-plus-plus-source': 'application/x-cplusplus',\n 'public.csh-script': 'application/x-csh',\n 'public.c-source': 'text/x-c-code',\n 'public.css': 'text/css',\n 'public.dv': 'video/x-dv',\n 'public.flv': 'video/x-flv',\n 'public.html': 'text/html',\n 'public.iso-image': 'application/x-iso-image',\n 'public.jpeg': 'image/jpeg',\n 'public.jpeg2000': 'image/jp2',\n 'public.midi': 'audio/midi',\n 'public.mka': 'audio/x-matroska',\n 'public.mkv': 'video/x-matroska',\n 'public.mp3': 'audio/mp3',\n 'public.mpeg': 'video/mpeg',\n 'public.mpeg4': 'video/mp4',\n 'public.mpeg4-audio': 'audio/mp4',\n 'public.mpegts': 'video/MP2T',\n 'public.objective-c-plus-plus-source': 'text/x-objcppsrc',\n 'public.objective-c-source': 'text/x-objcsrc',\n 'public.opentype-font': 'font/opentype',\n 'public.perl-script': 'text/x-perl',\n 'public.php-script': 'text/php',\n 'public.plain-text': 'text/plain',\n 'public.png': 'image/png',\n 'public.python-script': 'text/x-python-script',\n 'public.rtf': 'text/rtf',\n 'public.shell-script': 'application/x-sh',\n 'public.tar-archive': 'application/tar',\n 'public.tiff': 'image/tiff',\n 'public.truetype-ttf-font': 'application/x-font-ttf',\n 'public.ulaw-audio': 'audio/au',\n 'public.vcard': 'text/vcard',\n 'public.webm': 'video/webm',\n 'public.xbitmap-image': 'image/xbm',\n 'public.xml': 'text/xml',\n 'unofficial.atom-feed': 'application/atom+xml',\n 'unofficial.m3u8-playlist': 'application/x-mpegURL',\n 'unofficial.opml': 'text/x-opml',\n 'unofficial.pls-playlist': 'audio/scpls',\n 'unofficial.rdf-feed': 'application/rdf+xml',\n 'unofficial.rss-feed': 'application/rss+xml',\n }\n\n utiExts: { [key: string]: string } = {\n jpg: 'public.jpeg',\n jpeg: 'public.jpeg',\n png: 'public.png',\n rtf: 'public.rtf',\n mpeg: 'public.mpeg',\n mpg: 'public.mpeg',\n html: 'public.html',\n htm: 'public.html',\n pdf: 'com.adobe.pdf',\n xls: 'com.microsoft.excel.xls',\n xlsx: 'com.microsoft.excel.xls',\n doc: 'com.microsoft.word.doc',\n docx: 'com.microsoft.word.doc',\n }\n\n utiDefs: { [key: string]: string } = {\n 'application/atom+xml': 'unofficial.atom-feed',\n 'application/bat': 'com.microsoft.windows-executable',\n 'application/binhex': 'com.apple.binhex-archive',\n 'application/binhex4': 'com.apple.binhex-archive',\n 'application/ecmascript': 'com.netscape.javascript-source',\n 'application/eps': 'com.adobe.encapsulated-postscript',\n 'application/excel': 'com.microsoft.excel.xls',\n 'application/exe': 'com.microsoft.windows-executable',\n 'application/gnutar': 'public.tar-archive',\n 'application/gzip': 'org.gnu.gnu-zip-archive',\n 'application/illustrator': 'com.adobe.illustrator.ai-image',\n 'application/indesign': 'com.adobe.indesign-image',\n 'application/java-archive': 'com.sun.java-archive',\n 'application/java-byte-code': 'com.sun.java-class',\n 'application/java': 'com.sun.java-class',\n 'application/javascript': 'com.netscape.javascript-source',\n 'application/jnlp': 'com.sun.java-web-start',\n 'application/latex': 'org.tug.tex',\n 'application/mac-binary': 'com.apple.macbinary-archive',\n 'application/mac-binhex': 'com.apple.binhex-archive',\n 'application/mac-binhex40': 'com.apple.binhex-archive',\n 'application/macbinary': 'com.apple.macbinary-archive',\n 'application/mspowerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/msword': 'com.microsoft.word.doc',\n 'application/octet-stream': 'com.microsoft.windows-executable',\n 'application/pdf': 'com.adobe.pdf',\n 'application/photoshop': 'com.adobe.photoshop-image',\n 'application/php': 'public.php-script',\n 'application/plain': 'public.plain-text',\n 'application/postscript': 'com.adobe.postscript',\n 'application/powerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/rar': 'com.rarlab.rar-archive',\n 'application/rdf+xml': 'unofficial.rdf-feed',\n 'application/rss+xml': 'unofficial.rss-feed',\n 'application/rtf': 'public.rtf',\n 'application/smil': 'com.real.smil',\n 'application/stuffit': 'com.allume.stuffit-archive',\n 'application/tar': 'public.tar-archive',\n 'application/tga': 'com.truevision.tga-image',\n 'application/vnd.fpx': 'com.kodak.flashpix.image',\n 'application/vnd.ms-excel': 'com.microsoft.excel.xls',\n 'application/vnd.ms-powerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/vnd.oasis.opendocument.chart': 'org.oasis.opendocument.chart',\n 'application/vnd.oasis.opendocument.database': 'org.oasis.opendocument.database',\n 'application/vnd.oasis.opendocument.formula': 'org.oasis.opendocument.formula',\n 'application/vnd.oasis.opendocument.graphics-template': 'org.oasis.opendocument.graphics',\n 'application/vnd.oasis.opendocument.graphics': 'org.oasis.opendocument.graphics',\n 'application/vnd.oasis.opendocument.image': 'org.oasis.opendocument.image',\n 'application/vnd.oasis.opendocument.presentation-template': 'org.oasis.opendocument.presentation',\n 'application/vnd.oasis.opendocument.presentation': 'org.oasis.opendocument.presentation',\n 'application/vnd.oasis.opendocument.spreadsheet-template': 'org.oasis.opendocument.spreadsheet',\n 'application/vnd.oasis.opendocument.spreadsheet': 'org.oasis.opendocument.spreadsheet',\n 'application/vnd.oasis.opendocument.text-master': 'org.oasis.opendocument.text-master',\n 'application/vnd.oasis.opendocument.text-template': 'org.oasis.opendocument.text',\n 'application/vnd.oasis.opendocument.text-web': 'org.oasis.opendocument.text-web',\n 'application/vnd.oasis.opendocument.text': 'org.oasis.opendocument.text',\n 'application/vnd.rn-realmedia': 'com.real.realmedia',\n 'application/vnd.sun.xml.calc.template': 'org.neooffice.calc',\n 'application/vnd.sun.xml.calc': 'org.neooffice.calc',\n 'application/vnd.sun.xml.draw.template': 'org.neooffice.draw',\n 'application/vnd.sun.xml.draw': 'org.neooffice.draw',\n 'application/vnd.sun.xml.impress.template': 'org.neooffice.impress',\n 'application/vnd.sun.xml.impress': 'org.neooffice.impress',\n 'application/vnd.sun.xml.math': 'org.neooffice.math',\n 'application/vnd.sun.xml.writer.global': 'org.neooffice.global',\n 'application/vnd.sun.xml.writer.template': 'org.neooffice.writer',\n 'application/vnd.sun.xml.writer': 'org.neooffice.writer',\n 'application/vndms-excel': 'com.microsoft.excel.xls',\n 'application/vndms-powerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/vndrn-realmedia': 'com.real.realmedia',\n 'application/x-apple-diskimage': 'com.apple.disk-image-udif',\n 'application/x-applescript': 'com.apple.applescript.script',\n 'application/x-bat': 'com.microsoft.windows-executable',\n 'application/x-binary': 'com.apple.macbinary-archive',\n 'application/x-binhex40': 'com.apple.binhex-archive',\n 'application/x-bittorrent': 'com.bittorrent.torrent',\n 'application/x-bzip2': 'org.bzip.bzip2-archive',\n 'application/x-cpio': 'public.cpio-archive',\n 'application/x-cplusplus': 'public.c-plus-plus-source',\n 'application/x-csh': 'public.csh-script',\n 'application/x-deb': 'org.debian.debian-package',\n 'application/x-debian-package': 'org.debian.debian-package',\n 'application/x-eps': 'com.adobe.encapsulated-postscript',\n 'application/x-excel': 'com.microsoft.excel.xls',\n 'application/x-exe': 'com.microsoft.windows-executable',\n 'application/x-flac': 'org.xiph.flac',\n 'application/x-font-ttf': 'public.truetype-ttf-font',\n 'application/x-font-type1': 'com.adobe.postscript-pfa-font',\n 'application/x-gtar': 'org.gnu.gnu-tar-archive',\n 'application/x-gzip': 'org.gnu.gnu-zip-archive',\n 'application/x-iso-image': 'public.iso-image',\n 'application/x-java-class': 'com.sun.java-class',\n 'application/x-java': 'com.sun.java-web-start',\n 'application/x-javascript': 'com.netscape.javascript-source',\n 'application/x-latex': 'org.tug.tex',\n 'application/x-mac-binhex40': 'com.apple.binhex-archive',\n 'application/x-macbinary': 'com.apple.macbinary-archive',\n 'application/x-midi': 'public.midi',\n 'application/x-mpegURL': 'unofficial.m3u8-playlist',\n 'application/x-ms-wmd': 'com.microsoft.windows-media-wmd',\n 'application/x-ms-wmz': 'com.microsoft.windows-media-wmz',\n 'application/x-msdos-program': 'com.microsoft.windows-executable',\n 'application/x-msdownload': 'com.microsoft.windows-executable',\n 'application/x-msexcel': 'com.microsoft.excel.xls',\n 'application/x-mspowerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/x-pdf': 'com.adobe.pdf',\n 'application/x-perl': 'public.perl-script',\n 'application/x-php': 'public.php-script',\n 'application/x-quartzcomposer': 'com.apple.quartz-composer-composition',\n 'application/x-rar-compressed': 'com.rarlab.rar-archive',\n 'application/x-redhat-package': 'com.redhat.redhat-package',\n 'application/x-rpm': 'com.redhat.redhat-package',\n 'application/x-rtf': 'public.rtf',\n 'application/x-sh': 'public.shell-script',\n 'application/x-shellscript': 'public.shell-script',\n 'application/x-shockwave-flash': 'com.macromedia.shockwave-flash',\n 'application/x-sit': 'com.allume.stuffit-archive',\n 'application/x-smil': 'com.real.smil',\n 'application/x-soundfont': 'com.soundblaster.soundfont',\n 'application/x-stuffit': 'com.allume.stuffit-archive',\n 'application/x-tar': 'public.tar-archive',\n 'application/x-tex': 'org.tug.tex',\n 'application/x-texinfo': 'org.tug.tex',\n 'application/x-troff-msvideo': 'public.avi',\n 'application/x-zip-compressed': 'com.pkware.zip-archive',\n 'application/xhtml+xml': 'public.html',\n 'application/xml': 'public.xml',\n 'application/zip': 'com.pkware.zip-archive',\n 'audio/3gpp': 'public.3gpp',\n 'audio/3gpp2': 'public.3gpp2',\n 'audio/aiff': 'public.aiff-audio',\n 'audio/au': 'public.ulaw-audio',\n 'audio/basic': 'public.ulaw-audio',\n 'audio/flac': 'org.xiph.flac',\n 'audio/mid': 'public.midi',\n 'audio/midi': 'public.midi',\n 'audio/mp3': 'public.mp3',\n 'audio/mp4': 'public.mpeg4-audio',\n 'audio/mp4a-latm': 'public.mpeg4-audio',\n 'audio/mpeg': 'public.mp3',\n 'audio/mpeg3': 'public.mp3',\n 'audio/mpegurl': 'unofficial.m3u-playlist',\n 'audio/mpg': 'public.mp3',\n 'audio/ogg': 'org.xiph.ogg-vorbis',\n 'audio/scpls': 'unofficial.pls-playlist',\n 'audio/snd': 'public.ulaw-audio',\n 'audio/vnd.rn-realaudio': 'com.real.realaudio',\n 'audio/wav': 'com.microsoft.waveform-audio',\n 'audio/wave': 'com.microsoft.waveform-audio',\n 'audio/webm': 'public.webm',\n 'audio/x-adpcm': 'public.ulaw-audio',\n 'audio/x-aiff': 'public.aiff-audio',\n 'audio/x-au': 'public.ulaw-audio',\n 'audio/x-flac': 'org.xiph.flac',\n 'audio/x-matroska': 'public.mka',\n 'audio/x-mid': 'public.midi',\n 'audio/x-midi': 'public.midi',\n 'audio/x-mp3': 'public.mp3',\n 'audio/x-mpeg-3': 'public.mp3',\n 'audio/x-mpeg': 'public.mp3',\n 'audio/x-mpeg3': 'public.mp3',\n 'audio/x-mpegurl': 'unofficial.m3u-playlist',\n 'audio/x-mpg': 'public.mp3',\n 'audio/x-ms-wax': 'com.microsoft.windows-media-wax',\n 'audio/x-ms-wma': 'com.microsoft.windows-media-wma',\n 'audio/x-ogg': 'org.xiph.ogg-vorbis',\n 'audio/x-pn-realaudio-plugin': 'com.real.realaudio',\n 'audio/x-pn-realaudio': 'com.real.realaudio',\n 'audio/x-pn-wav': 'com.microsoft.waveform-audio',\n 'audio/x-realaudio': 'com.real.realmedia',\n 'audio/x-scpls': 'unofficial.pls-playlist',\n 'audio/x-wav': 'com.microsoft.waveform-audio',\n 'font/opentype': 'public.opentype-font',\n 'image/bmp': 'com.microsoft.bmp',\n 'image/efax': 'com.js.efx-fax',\n 'image/eps': 'com.adobe.encapsulated-postscript',\n 'image/fpx': 'com.kodak.flashpix.image',\n 'image/gif': 'com.compuserve.gif',\n 'image/indd': 'com.adobe.indesign-image',\n 'image/indesign': 'com.adobe.indesign-image',\n 'image/jp2': 'public.jpeg2000',\n 'image/jpeg': 'public.jpeg',\n 'image/ms-bmp': 'com.microsoft.bmp',\n 'image/photoshop': 'com.adobe.photoshop-image',\n 'image/pict': 'com.apple.pict',\n 'image/pipeg': 'public.jpeg',\n 'image/pjpeg': 'public.jpeg',\n 'image/png': 'public.png',\n 'image/psd': 'com.adobe.photoshop-image',\n 'image/sgi': 'com.sgi.sgi-image',\n 'image/targa': 'com.truevision.tga-image',\n 'image/tga': 'com.truevision.tga-image',\n 'image/tiff': 'public.tiff',\n 'image/vnd.djvu': 'com.lizardtech.djvu',\n 'image/vndfpx': 'com.kodak.flashpix.image',\n 'image/vndnet-fpx': 'com.kodak.flashpix.image',\n 'image/webp': 'public.webp',\n 'image/x-bitmap': 'com.microsoft.bmp',\n 'image/x-bmp': 'com.microsoft.bmp',\n 'image/x-djvu': 'com.lizardtech.djvu',\n 'image/x-eps': 'com.adobe.encapsulated-postscript',\n 'image/x-icon': 'com.microsoft.ico',\n 'image/x-indesign': 'com.adobe.indesign-image',\n 'image/x-macpict': 'com.apple.pict',\n 'image/x-ms-bmp': 'com.microsoft.bmp',\n 'image/x-photoshop': 'com.adobe.photoshop-image',\n 'image/x-pict': 'com.apple.pict',\n 'image/x-quicktime': 'com.apple.quicktime-image',\n 'image/x-tiff': 'public.tiff',\n 'image/x-windows-bmp': 'com.microsoft.bmp',\n 'image/x-xbitmap': 'com.microsoft.bmp',\n 'image/x-xbm': 'public.xbitmap-image',\n 'image/xbm': 'public.xbitmap-image',\n 'multipart/x-gzip': 'org.gnu.gnu-zip-archive',\n 'multipart/x-zip': 'com.pkware.zip-archive',\n 'music/crescendo': 'public.midi',\n 'text/calendar': 'com.apple.ical.ics',\n 'text/css': 'public.css',\n 'text/directory': 'public.vcard',\n 'text/ecmascript': 'com.netscape.javascript-source',\n 'text/html': 'public.html',\n 'text/javascript': 'com.netscape.javascript-source',\n 'text/php': 'public.php-script',\n 'text/plain': 'public.plain-text',\n 'text/richtext': 'public.rtf',\n 'text/rtf': 'public.rtf',\n 'text/ruby-script': 'public.ruby-script',\n 'text/tex': 'org.tug.tex',\n 'text/vcard': 'public.vcard',\n 'text/vnd.sun.j2me.app-descriptor': 'com.sun.java-app-descriptor',\n 'text/x-asm': 'public.assembly-source',\n 'text/x-c-code': 'public.c-source',\n 'text/x-c-header': 'public.c-header',\n 'text/x-c': 'public.c-source',\n 'text/x-c++-code': 'public.c-plus-plus-source',\n 'text/x-c++-hdr': 'public.c-plus-plus-header',\n 'text/x-c++-src': 'public.c-plus-plus-source',\n 'text/x-c++src': 'public.c-plus-plus-source',\n 'text/x-h': 'public.c-header',\n 'text/x-java-source': 'com.sun.java-source',\n 'text/x-latex': 'org.tug.tex',\n 'text/x-objcppsrc': 'public.objective-c-plus-plus-source',\n 'text/x-objcsrc': 'public.objective-c-source',\n 'text/x-opml': 'unofficial.opml',\n 'text/x-perl-script': 'public.perl-script',\n 'text/x-perl': 'public.perl-script',\n 'text/x-php-script': 'public.php-script',\n 'text/x-python-script': 'public.python-script',\n 'text/x-python': 'public.python-script',\n 'text/x-scriptcsh': 'public.csh-script',\n 'text/x-scriptperl-module': 'public.perl-script',\n 'text/x-scriptperl': 'public.perl-script',\n 'text/x-scriptphyton': 'public.python-script',\n 'text/x-scriptsh': 'public.shell-script',\n 'text/x-server-parsed-html': 'public.html',\n 'text/x-tex': 'org.tug.tex',\n 'text/x-vcalendar': 'com.apple.ical.vcs',\n 'text/x-vcard': 'public.vcard',\n 'text/xhtml': 'public.html',\n 'text/xml': 'public.xml',\n 'video/3gpp': 'public.3gpp',\n 'video/3gpp2': 'public.3gpp2',\n 'video/avi': 'public.avi',\n 'video/MP2T': 'public.mpegts',\n 'video/mp4': 'public.mpeg4',\n 'video/mp4v': 'public.mpeg4',\n 'video/mpeg': 'public.mpeg',\n 'video/mpg': 'public.mpeg',\n 'video/msvideo': 'public.avi',\n 'video/ogg': 'org.xiph.ogg-theora',\n 'video/quicktime': 'com.apple.quicktime-movie',\n 'video/webm': 'public.webm',\n 'video/x-dv': 'public.dv',\n 'video/x-flv': 'public.flv',\n 'video/x-m4v': 'public.mpeg4',\n 'video/x-matroska': 'public.mkv',\n 'video/x-mpeg': 'public.mpeg',\n 'video/x-mpg': 'public.mpeg',\n 'video/x-ms-asf-plugin': 'com.microsoft.advanced-systems-format',\n 'video/x-ms-asf': 'com.microsoft.advanced-systems-format',\n 'video/x-ms-asx': 'com.microsoft.advanced-stream-redirector',\n 'video/x-ms-wm': 'com.microsoft.windows-media-wm',\n 'video/x-ms-wmd': 'com.microsoft.windows-media-wmd',\n 'video/x-ms-wmp': 'com.microsoft.windows-media-wmp',\n 'video/x-ms-wmv': 'com.microsoft.windows-media-wmv',\n 'video/x-ms-wmx': 'com.microsoft.windows-media-wmx',\n 'video/x-ms-wmz': 'com.microsoft.windows-media-wmz',\n 'video/x-ms-wvx': 'com.microsoft.windows-media-wvx',\n 'video/x-msvideo': 'public.avi',\n 'video/x-ogg': 'org.xiph.ogg-theora',\n 'x-msdos-program': 'com.microsoft.windows-executable',\n 'x-music/x-midi': 'public.midi',\n }\n dataOwnerApi: IccDataOwnerXApi\n authenticationProvider: AuthenticationProvider\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n private crypto: IccCryptoXApi,\n private authApi: IccAuthApi,\n dataOwnerApi: IccDataOwnerXApi,\n private readonly autofillAuthor: boolean,\n authenticationProvider: AuthenticationProvider = new NoAuthenticationProvider(),\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch\n ) {\n super(host, headers, authenticationProvider, fetchImpl)\n this.fetchImpl = fetchImpl\n this.authenticationProvider = authenticationProvider\n this.dataOwnerApi = dataOwnerApi\n }\n\n override get headers(): Promise<Array<XHR.Header>> {\n return super.headers.then((h) => this.crypto.accessControlKeysHeaders.addAccessControlKeysHeaders(h, EntityWithDelegationTypeName.Document))\n }\n\n /**\n * Creates a new instance of document with initialised encryption metadata (not in the database).\n * @param user the current user.\n * @param message the message this document refers to.\n * @param c initialised data for the document. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify\n * other kinds of data or overwrite generated metadata with this. You can't specify encryption metadata.\n * @param options optional parameters:\n * - additionalDelegates: delegates which will have access to the entity in addition to the current data owner and delegates from the\n * auto-delegations. Must be an object which associates each data owner id with the access level to give to that data owner. May overlap with\n * auto-delegations, in such case the access level specified here will be used.\n * - preferredSfk: secret id of the message to use as the secret foreign key to use for the document. The default value will be a\n * secret id of the message known by the topmost parent in the current data owner hierarchy.\n * @return a new instance of document.\n */\n async newInstance(\n user: models.User,\n message?: models.Message,\n c: any = {},\n options: {\n additionalDelegates?: { [dataOwnerId: string]: AccessLevelEnum }\n preferredSfk?: string\n } = {}\n ) {\n if (!message && options.preferredSfk) throw new Error('You need to specify parent message in order to use secret foreign keys.')\n const document = {\n ...(c ?? {}),\n _type: 'org.taktik.icure.entities.Document',\n id: c?.id ?? this.crypto.primitives.randomUuid(),\n created: c?.created ?? new Date().getTime(),\n modified: c?.modified ?? new Date().getTime(),\n responsible: c?.responsible ?? (this.autofillAuthor ? this.dataOwnerApi.getDataOwnerIdOf(user) : undefined),\n author: c?.author ?? (this.autofillAuthor ? user.id : undefined),\n codes: c?.codes ?? [],\n tags: c?.tags ?? [],\n }\n\n const ownerId = this.dataOwnerApi.getDataOwnerIdOf(user)\n if (ownerId !== (await this.dataOwnerApi.getCurrentDataOwnerId())) throw new Error('Can only initialise entities as current data owner.')\n const sfk = message\n ? options.preferredSfk ??\n (await this.crypto.confidential.getAnySecretIdSharedWithParents({ entity: message, type: EntityWithDelegationTypeName.Message }))\n : undefined\n if (message && !sfk) throw new Error(`Couldn't find any sfk of parent message ${message.id}`)\n const extraDelegations = {\n ...Object.fromEntries(\n [...(user.autoDelegations?.all ?? []), ...(user.autoDelegations?.medicalInformation ?? [])].map((d) => [d, AccessLevelEnum.WRITE])\n ),\n ...(options?.additionalDelegates ?? {}),\n }\n return new models.Document(\n await this.crypto.xapi\n .entityWithInitialisedEncryptedMetadata(document, EntityWithDelegationTypeName.Document, message?.id, sfk, true, false, extraDelegations)\n .then((x) => x.updatedEntity)\n )\n }\n\n // noinspection JSUnusedGlobalSymbols\n async findByMessage(hcpartyId: string, message: models.Message) {\n const extractedKeys = await this.crypto.xapi.secretIdsOf({ entity: message, type: EntityWithDelegationTypeName.Message }, hcpartyId)\n const topmostParentId = (await this.dataOwnerApi.getCurrentDataOwnerHierarchyIds())[0]\n let documents: Array<models.Document> = await this.findDocumentsByHCPartyPatientForeignKeys(topmostParentId, _.uniq(extractedKeys).join(','))\n return await this.decrypt(hcpartyId, documents)\n }\n\n // Note: this is only for dealing with legacy documents: new document are not encrypted, only their attachments are\n decrypt(hcpartyId: string, documents: Array<models.Document>): Promise<Array<models.Document>> {\n return Promise.all(\n documents.map((document) =>\n this.crypto.xapi.decryptAndImportAllDecryptionKeys({ entity: document, type: EntityWithDelegationTypeName.Document }).then((keys) => {\n if (!keys.length) {\n console.log('Cannot decrypt document', document.id)\n return Promise.resolve(document)\n }\n\n if (keys.length && (document.encryptedSelf || document.encryptedAttachment)) {\n const key = keys[0].key\n return Promise.all([\n document.encryptedSelf\n ? new Promise((resolve: (value: ArrayBuffer | null) => any) => {\n this.crypto.primitives.AES.decrypt(key, string2ua(a2b(document.encryptedSelf!))).then(resolve, () => {\n console.log('Cannot decrypt document', document.id)\n resolve(null)\n })\n })\n : Promise.resolve(null),\n document.encryptedAttachment\n ? new Promise((resolve: (value: ArrayBuffer | null) => any) => {\n this.crypto.primitives.AES.decrypt(key, document.encryptedAttachment!).then(resolve, () => {\n console.log('Cannot decrypt document', document.id)\n resolve(null)\n })\n })\n : Promise.resolve(null),\n ]).then((decrypted: [ArrayBuffer | null, ArrayBuffer | null]) => {\n if (decrypted) {\n if (decrypted[0]) {\n document = _.extend(document, JSON.parse(ua2string(decrypted[0])))\n }\n if (decrypted[1]) {\n document.decryptedAttachment = decrypted[1]\n }\n }\n return document\n })\n } else {\n return Promise.resolve(document)\n }\n })\n )\n ).catch(function (e: Error) {\n console.log(e)\n return Promise.resolve(documents)\n })\n }\n\n //prettier-ignore\n getAttachmentAs(documentId: string, attachmentId: string, returnType: \"application/octet-stream\", enckeys?: string, fileName?: string): Promise<ArrayBuffer>\n //prettier-ignore\n getAttachmentAs(documentId: string, attachmentId: string, returnType: \"text/plain\", enckeys?: string, fileName?: string): Promise<string>\n //prettier-ignore\n getAttachmentAs(documentId: string, attachmentId: string, returnType: \"application/json\", enckeys?: string, fileName?: string): Promise<any>\n /**\n * @deprecated use getMainAttachmentAs instead\n */\n async getAttachmentAs(\n documentId: string,\n attachmentId: string,\n returnType: 'application/octet-stream' | 'text/plain' | 'application/json',\n enckeys?: string,\n fileName?: string\n ): Promise<any> {\n if (!!enckeys || !!fileName) {\n console.warn('Using getAttachmentAs method with a value for enckeys or fileName does nothing anymore.')\n }\n return this.getMainAttachmentAs(documentId, returnType)\n }\n\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: \"application/octet-stream\"): Promise<ArrayBuffer>\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: \"text/plain\"): Promise<string>\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: \"application/json\"): Promise<any>\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: 'application/octet-stream' | 'text/plain' | 'application/json'): Promise<any>\n async getMainAttachmentAs(documentId: string, returnType: 'application/octet-stream' | 'text/plain' | 'application/json'): Promise<any> {\n const url = this.host + `/document/${documentId}/attachment` + '?ts=' + new Date().getTime()\n return XHR.sendCommand('GET', url, await this.headers, null, this.fetchImpl, returnType, this.authenticationProvider.getAuthService())\n .then((doc) => doc.body)\n .catch((err) => this.handleError(err))\n }\n\n // noinspection JSUnusedGlobalSymbols\n uti(mimeType: string, extension: string) {\n return (mimeType && mimeType !== 'application/octet-stream' ? this.utiDefs[mimeType] : this.utiExts[extension]) || this.utiDefs[mimeType]\n }\n\n // noinspection JSUnusedGlobalSymbols\n mimeType(uti: string) {\n return this.utiRevDefs[uti]\n }\n\n /**\n * Adds an attachment to a document, encrypting it on client side using the encryption keys of the provided document.\n * @param document a document.\n * @param attachment a new main attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async encryptAndSetDocumentAttachment(document: models.Document, attachment: ArrayBuffer | Uint8Array, utis?: string[]): Promise<models.Document> {\n if (!document.rev) throw new Error('Cannot set attachment on document without rev')\n const { encryptedData, updatedEntity } = await this.crypto.xapi.encryptDataOf(document, EntityWithDelegationTypeName.Document, attachment, (d) =>\n this.modifyDocument(d)\n )\n return await this.setMainDocumentAttachment(document.id!, updatedEntity?.rev ?? document.rev, encryptedData, utis)\n }\n\n /**\n * Adds an unencrypted attachment to a document.\n * @param document a document.\n * @param attachment a new main attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async setClearDocumentAttachment(document: models.Document, attachment: ArrayBuffer | Uint8Array, utis?: string[]): Promise<models.Document> {\n if (!document.rev) throw new Error('Cannot set attachment on document without rev')\n return await this.setMainDocumentAttachment(document.id!, document.rev, attachment, utis)\n }\n\n /**\n * Adds a secondary attachment to a document, encrypting it on client side using the encryption keys of the provided document.\n * @param document a document.\n * @param secondaryAttachmentKey key for the secondary attachment.\n * @param attachment a new secondary attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async encryptAndSetSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n attachment: ArrayBuffer | Uint8Array,\n utis?: string[]\n ): Promise<models.Document> {\n if (!document.rev) throw new Error('Cannot set attachment on document without rev')\n const { encryptedData, updatedEntity } = await this.crypto.xapi.encryptDataOf(document, EntityWithDelegationTypeName.Document, attachment, (d) =>\n this.modifyDocument()\n )\n return await this.setSecondaryAttachment(document.id!, secondaryAttachmentKey, updatedEntity?.rev ?? document.rev!, encryptedData, utis)\n }\n\n /**\n * Adds an unencrypted secondary attachment to a document.\n * @param document a document.\n * @param secondaryAttachmentKey key for the secondary attachment.\n * @param attachment a new secondary attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async setClearSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n attachment: ArrayBuffer | Uint8Array,\n utis?: string[]\n ): Promise<models.Document> {\n return await this.setSecondaryAttachment(document.id!, secondaryAttachmentKey, document.rev!, attachment, utis)\n }\n\n /**\n * Gets the main attachment of a document and tries to decrypt it using the encryption keys of the document, throwing an error if the operation fails.\n * @param document a document.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return the decrypted attachment, if it could be decrypted, else the encrypted attachment.\n */\n async getAndDecryptDocumentAttachment(\n document: models.Document,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<ArrayBuffer> {\n const retrieved = await this.getAndTryDecryptDocumentAttachment(document, (x) => validator(x))\n if (!retrieved.wasDecrypted) throw new Error(`No valid key found to decrypt data of document ${document.id}.`)\n return retrieved.data\n }\n\n /**\n * Gets the main attachment of a document and tries to decrypt it using the encryption keys of the document.\n * @param document a document.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return an object containing:\n * - data: the decrypted attachment, if it could be decrypted, else the encrypted attachment.\n * - wasDecrypted: if the data was successfully decrypted or not\n */\n async getAndTryDecryptDocumentAttachment(\n document: models.Document,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<{ data: ArrayBuffer; wasDecrypted: boolean }> {\n return await this.crypto.xapi.tryDecryptDataOf(\n { entity: document, type: EntityWithDelegationTypeName.Document },\n await this.getRawMainDocumentAttachment(document.id!),\n (x) => validator(x)\n )\n }\n\n /**\n * Gets the secondary attachment of a document and tries to decrypt it using the encryption keys of the document, throwing an error if the operation fails.\n * @param document a document.\n * @param secondaryAttachmentKey key of the secondary attachment.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return the decrypted attachment.\n */\n async getAndDecryptSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<ArrayBuffer> {\n const { data, wasDecrypted } = await this.getAndTryDecryptSecondaryDocumentAttachment(document, secondaryAttachmentKey, (x) => validator(x))\n if (!wasDecrypted) throw new Error(`No valid key found to decrypt data of document ${document.id}.`)\n return data\n }\n\n /**\n * Gets the secondary attachment of a document and tries to decrypt it using the encryption keys of the document.\n * @param document a document.\n * @param secondaryAttachmentKey key of the secondary attachment.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return an object containing:\n * - data: the decrypted attachment, if it could be decrypted, else the encrypted attachment.\n * - wasDecrypted: if the data was successfully decrypted or not\n */\n async getAndTryDecryptSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<{ data: ArrayBuffer; wasDecrypted: boolean }> {\n return await this.crypto.xapi.tryDecryptDataOf(\n { entity: document, type: EntityWithDelegationTypeName.Document },\n await this.getSecondaryAttachment(document.id!, secondaryAttachmentKey),\n (x) => validator(x)\n )\n }\n\n /**\n * @param document a document\n * @return the id of the message that the document refers to, retrieved from the encrypted metadata. Normally there should only be one element\n * in the returned array, but in case of entity merges there could be multiple values.\n */\n async decryptMessageIdOf(document: models.Document): Promise<string[]> {\n return this.crypto.xapi.owningEntityIdsOf({ entity: document, type: EntityWithDelegationTypeName.Document }, undefined)\n }\n\n /**\n * @return if the logged data owner has write access to the content of the given document\n */\n async hasWriteAccess(document: models.Document): Promise<boolean> {\n return this.crypto.xapi.hasWriteAccess({ entity: document, type: EntityWithDelegationTypeName.Document })\n }\n\n /**\n * Share an existing document with other data owners, allowing them to access the non-encrypted data of the document and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param delegateId the id of the data owner which will be granted access to the document.\n * @param document the document to share.\n * @param options optional parameters to customize the sharing behaviour:\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity\n */\n async shareWith(\n delegateId: string,\n document: models.Document,\n options: {\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n shareMessageId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n } = {}\n ): Promise<models.Document> {\n return this.shareWithMany(document, { [delegateId]: options })\n }\n\n /**\n * Share an existing document with other data owners, allowing them to access the non-encrypted data of the document and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param document the document to share.\n * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity.\n */\n async shareWithMany(\n document: models.Document,\n delegates: {\n [delegateId: string]: {\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n shareMessageId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<models.Document> {\n return (await this.tryShareWithMany(document, delegates)).updatedEntityOrThrow\n }\n /**\n * Share an existing document with other data owners, allowing them to access the non-encrypted data of the document and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param document the document to share.\n * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return a promise which will contain the result of the operation: the updated entity if the operation was successful or details of the error if\n * the operation failed.\n */\n async tryShareWithMany(\n document: models.Document,\n delegates: {\n [delegateId: string]: {\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n shareMessageId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<ShareResult<models.Document>> {\n const self = await this.dataOwnerApi.getCurrentDataOwnerId()\n // All entities should have an encryption key.\n const entityWithEncryptionKey = await this.crypto.xapi.ensureEncryptionKeysInitialised(document, EntityWithDelegationTypeName.Document)\n const updatedEntity = entityWithEncryptionKey ? await this.modifyDocument(entityWithEncryptionKey) : document\n return this.crypto.xapi\n .simpleShareOrUpdateEncryptedEntityMetadata(\n { entity: updatedEntity, type: EntityWithDelegationTypeName.Document },\n true,\n Object.fromEntries(\n Object.entries(delegates).map(([delegateId, options]) => [\n delegateId,\n {\n requestedPermissions: options.requestedPermissions,\n shareEncryptionKeys: options.shareEncryptionKey,\n shareOwningEntityIds: options.shareMessageId,\n shareSecretIds: undefined,\n },\n ])\n ),\n (x) => this.bulkShareDocument(x)\n )\n .then((r) => r.mapSuccessAsync((e) => this.decrypt(self, [e]).then((es) => es[0])))\n }\n\n getDataOwnersWithAccessTo(\n entity: models.Document\n ): Promise<{ permissionsByDataOwnerId: { [p: string]: AccessLevelEnum }; hasUnknownAnonymousDataOwners: boolean }> {\n return this.crypto.delegationsDeAnonymization.getDataOwnersWithAccessTo({ entity, type: EntityWithDelegationTypeName.Document })\n }\n\n getEncryptionKeysOf(entity: models.Document): Promise<string[]> {\n return this.crypto.xapi.encryptionKeysOf({ entity, type: EntityWithDelegationTypeName.Document }, undefined)\n }\n\n createDelegationDeAnonymizationMetadata(entity: models.Document, delegates: string[]): Promise<void> {\n return this.crypto.delegationsDeAnonymization.createOrUpdateDeAnonymizationInfo(\n { entity, type: EntityWithDelegationTypeName.Document },\n delegates\n )\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icure/api",
3
- "version": "8.0.14",
3
+ "version": "8.0.16",
4
4
  "description": "Typescript version of iCure standalone API client",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -189,21 +189,21 @@ describe('icc-x-contact-api Tests', () => {
189
189
  (0, chai_1.expect)(retrieved.details).to.be.equal(encryptedField);
190
190
  (0, chai_1.expect)((yield api2.calendarItemApi.decryptPatientIdOf(retrieved))[0]).to.equal(samplePatient.id);
191
191
  }));
192
- it('Instanciation of old Measure should be mapped to new Measure with referenceRange', () => {
192
+ it('Instanciation of old Measure should be mapped to new Measure with referenceRanges', () => {
193
193
  const oldMeasure = {
194
194
  min: 0,
195
195
  max: 10,
196
196
  };
197
197
  const newMeasure = new Measure_1.Measure(Object.assign({}, oldMeasure));
198
- (0, chai_1.expect)(newMeasure.referenceRange).to.not.be.undefined;
199
- (0, chai_1.expect)(newMeasure.referenceRange).to.not.undefined;
200
- (0, chai_1.expect)(newMeasure.referenceRange).to.have.length(1);
201
- (0, chai_1.expect)(newMeasure.referenceRange[0].low).to.be.equal(oldMeasure.min);
202
- (0, chai_1.expect)(newMeasure.referenceRange[0].high).to.be.equal(oldMeasure.max);
198
+ (0, chai_1.expect)(newMeasure.referenceRanges).to.not.be.undefined;
199
+ (0, chai_1.expect)(newMeasure.referenceRanges).to.not.undefined;
200
+ (0, chai_1.expect)(newMeasure.referenceRanges).to.have.length(1);
201
+ (0, chai_1.expect)(newMeasure.referenceRanges[0].low).to.be.equal(oldMeasure.min);
202
+ (0, chai_1.expect)(newMeasure.referenceRanges[0].high).to.be.equal(oldMeasure.max);
203
203
  (0, chai_1.expect)(Object.keys(newMeasure)).to.not.contain('min');
204
204
  (0, chai_1.expect)(Object.keys(newMeasure)).to.not.contain('max');
205
205
  });
206
- it('Instanciation of Service with old Measure should be mapped to new Measure with referenceRange', () => {
206
+ it('Instanciation of Service with old Measure should be mapped to new Measure with referenceRanges', () => {
207
207
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
208
208
  const serviceJson = {
209
209
  id: 'serviceId',
@@ -228,14 +228,14 @@ describe('icc-x-contact-api Tests', () => {
228
228
  };
229
229
  const service = new Service_1.Service(JSON.parse(JSON.stringify(serviceJson)));
230
230
  (0, chai_1.expect)((_b = (_a = service.content) === null || _a === void 0 ? void 0 : _a.en) === null || _b === void 0 ? void 0 : _b.measureValue).to.not.be.undefined;
231
- (0, chai_1.expect)((_e = (_d = (_c = service.content) === null || _c === void 0 ? void 0 : _c.en) === null || _d === void 0 ? void 0 : _d.measureValue) === null || _e === void 0 ? void 0 : _e.referenceRange).to.not.be.undefined;
232
- (0, chai_1.expect)((_h = (_g = (_f = service.content) === null || _f === void 0 ? void 0 : _f.en) === null || _g === void 0 ? void 0 : _g.measureValue) === null || _h === void 0 ? void 0 : _h.referenceRange).to.have.length(1);
233
- (0, chai_1.expect)((_l = (_k = (_j = service.content) === null || _j === void 0 ? void 0 : _j.en) === null || _k === void 0 ? void 0 : _k.measureValue) === null || _l === void 0 ? void 0 : _l.referenceRange[0].low).to.be.equal(serviceJson.content.en.measureValue.min);
234
- (0, chai_1.expect)((_p = (_o = (_m = service.content) === null || _m === void 0 ? void 0 : _m.en) === null || _o === void 0 ? void 0 : _o.measureValue) === null || _p === void 0 ? void 0 : _p.referenceRange[0].high).to.be.equal(serviceJson.content.en.measureValue.max);
231
+ (0, chai_1.expect)((_e = (_d = (_c = service.content) === null || _c === void 0 ? void 0 : _c.en) === null || _d === void 0 ? void 0 : _d.measureValue) === null || _e === void 0 ? void 0 : _e.referenceRanges).to.not.be.undefined;
232
+ (0, chai_1.expect)((_h = (_g = (_f = service.content) === null || _f === void 0 ? void 0 : _f.en) === null || _g === void 0 ? void 0 : _g.measureValue) === null || _h === void 0 ? void 0 : _h.referenceRanges).to.have.length(1);
233
+ (0, chai_1.expect)((_l = (_k = (_j = service.content) === null || _j === void 0 ? void 0 : _j.en) === null || _k === void 0 ? void 0 : _k.measureValue) === null || _l === void 0 ? void 0 : _l.referenceRanges[0].low).to.be.equal(serviceJson.content.en.measureValue.min);
234
+ (0, chai_1.expect)((_p = (_o = (_m = service.content) === null || _m === void 0 ? void 0 : _m.en) === null || _o === void 0 ? void 0 : _o.measureValue) === null || _p === void 0 ? void 0 : _p.referenceRanges[0].high).to.be.equal(serviceJson.content.en.measureValue.max);
235
235
  (0, chai_1.expect)(Object.keys((_r = (_q = service.content) === null || _q === void 0 ? void 0 : _q.en) === null || _r === void 0 ? void 0 : _r.measureValue)).to.not.contain('min');
236
236
  (0, chai_1.expect)(Object.keys((_t = (_s = service.content) === null || _s === void 0 ? void 0 : _s.en) === null || _t === void 0 ? void 0 : _t.measureValue)).to.not.contain('max');
237
237
  });
238
- it('Instanciation of Contact with old Measure should be mapped to new Measure with referenceRange', () => {
238
+ it('Instanciation of Contact with old Measure should be mapped to new Measure with referenceRanges', () => {
239
239
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
240
240
  const contactJson = {
241
241
  id: 'contactId',
@@ -268,10 +268,10 @@ describe('icc-x-contact-api Tests', () => {
268
268
  (0, chai_1.expect)(contact.services).to.not.be.undefined;
269
269
  (0, chai_1.expect)(contact.services).to.have.length(1);
270
270
  (0, chai_1.expect)((_b = (_a = contact.services[0].content) === null || _a === void 0 ? void 0 : _a.en) === null || _b === void 0 ? void 0 : _b.measureValue).to.not.be.undefined;
271
- (0, chai_1.expect)((_e = (_d = (_c = contact.services[0].content) === null || _c === void 0 ? void 0 : _c.en) === null || _d === void 0 ? void 0 : _d.measureValue) === null || _e === void 0 ? void 0 : _e.referenceRange).to.not.be.undefined;
272
- (0, chai_1.expect)((_h = (_g = (_f = contact.services[0].content) === null || _f === void 0 ? void 0 : _f.en) === null || _g === void 0 ? void 0 : _g.measureValue) === null || _h === void 0 ? void 0 : _h.referenceRange).to.have.length(1);
273
- (0, chai_1.expect)((_l = (_k = (_j = contact.services[0].content) === null || _j === void 0 ? void 0 : _j.en) === null || _k === void 0 ? void 0 : _k.measureValue) === null || _l === void 0 ? void 0 : _l.referenceRange[0].low).to.be.equal(contactJson.services[0].content.en.measureValue.min);
274
- (0, chai_1.expect)((_p = (_o = (_m = contact.services[0].content) === null || _m === void 0 ? void 0 : _m.en) === null || _o === void 0 ? void 0 : _o.measureValue) === null || _p === void 0 ? void 0 : _p.referenceRange[0].high).to.be.equal(contactJson.services[0].content.en.measureValue.max);
271
+ (0, chai_1.expect)((_e = (_d = (_c = contact.services[0].content) === null || _c === void 0 ? void 0 : _c.en) === null || _d === void 0 ? void 0 : _d.measureValue) === null || _e === void 0 ? void 0 : _e.referenceRanges).to.not.be.undefined;
272
+ (0, chai_1.expect)((_h = (_g = (_f = contact.services[0].content) === null || _f === void 0 ? void 0 : _f.en) === null || _g === void 0 ? void 0 : _g.measureValue) === null || _h === void 0 ? void 0 : _h.referenceRanges).to.have.length(1);
273
+ (0, chai_1.expect)((_l = (_k = (_j = contact.services[0].content) === null || _j === void 0 ? void 0 : _j.en) === null || _k === void 0 ? void 0 : _k.measureValue) === null || _l === void 0 ? void 0 : _l.referenceRanges[0].low).to.be.equal(contactJson.services[0].content.en.measureValue.min);
274
+ (0, chai_1.expect)((_p = (_o = (_m = contact.services[0].content) === null || _m === void 0 ? void 0 : _m.en) === null || _o === void 0 ? void 0 : _o.measureValue) === null || _p === void 0 ? void 0 : _p.referenceRanges[0].high).to.be.equal(contactJson.services[0].content.en.measureValue.max);
275
275
  (0, chai_1.expect)(Object.keys((_r = (_q = contact.services[0].content) === null || _q === void 0 ? void 0 : _q.en) === null || _r === void 0 ? void 0 : _r.measureValue)).to.not.contain('min');
276
276
  (0, chai_1.expect)(Object.keys((_t = (_s = contact.services[0].content) === null || _s === void 0 ? void 0 : _s.en) === null || _t === void 0 ? void 0 : _t.measureValue)).to.not.contain('max');
277
277
  });
@@ -1 +1 @@
1
- {"version":3,"file":"icc-contact-x-api.js","sourceRoot":"","sources":["../../../test/icc-x-api/icc-contact-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iCAA8B;AAE9B,4BAAyB;AAEzB,+CAA+G;AAC/G,yDAAqD;AACrD,+BAAqC;AACrC,mCAAmC;AACnC,oDAAuH;AACvH,mDAA+C;AAC/C,yDAAqD;AACrD,yDAAqD;AACrD,yDAAqD;AAErD,qEAAiE;AACjE,+DAA2D;AAC3D,iEAA6D;AAC7D,+EAA2E;AAC3E,2HAAuH;AACvH,mDAAmE;AACnE,yDAAqD;AACrD,IAAO,OAAO,GAAG,sBAAS,CAAC,OAAO,CAAA;AAElC,IAAA,4BAAe,EAAC,KAAK,CAAC,CAAA;AACtB,IAAI,GAAa,CAAA;AAEjB,IAAA,cAAM,EAAC;;QACL,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QACpB,MAAM,WAAW,GAAG,MAAM,IAAA,sCAAyB,GAAE,CAAA;QACrD,GAAG,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,IAAA,uBAAe,GAAE,CAAC,CAAA;IACpD,CAAC;CAAA,CAAC,CAAA;AAEF,SAAe,aAAa,CAAC,gBAAgC,EAAE,OAAa;;QAC1E,OAAO,gBAAgB,CAAC,qBAAqB,CAC3C,OAAO,EACP,MAAM,gBAAgB,CAAC,WAAW,CAChC,OAAO,EACP,IAAI,iBAAO,CAAC;YACV,EAAE,EAAE,IAAA,mBAAU,GAAE;YAChB,SAAS,EAAE,MAAM;YACjB,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,kBAAkB;SACzB,CAA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CAAC,CAAC,CAAA","sourcesContent":["import { before } from 'mocha'\n\nimport 'isomorphic-fetch'\n\nimport { EntityWithDelegationTypeName, IccContactXApi, IccHelementXApi, IccPatientXApi } from '../../icc-x-api'\nimport { Patient } from '../../icc-api/model/Patient'\nimport { assert, expect } from 'chai'\nimport { randomUUID } from 'crypto'\nimport { getEnvironmentInitializer, hcp1Username, hcp2Username, setLocalStorage, TestUtils } from '../utils/test_utils'\nimport { Code } from '../../icc-api/model/Code'\nimport { Contact } from '../../icc-api/model/Contact'\nimport { Service } from '../../icc-api/model/Service'\nimport { Content } from '../../icc-api/model/Content'\nimport { User } from '../../icc-api/model/User'\nimport { HealthElement } from '../../icc-api/model/HealthElement'\nimport { SubContact } from '../../icc-api/model/SubContact'\nimport { ServiceLink } from '../../icc-api/model/ServiceLink'\nimport { FilterChainService } from '../../icc-api/model/FilterChainService'\nimport { ServiceByHcPartyHealthElementIdsFilter } from '../../icc-x-api/filters/ServiceByHcPartyHealthElementIdsFilter'\nimport { getEnvVariables, TestVars } from '@icure/test-setup/types'\nimport { Measure } from '../../icc-api/model/Measure'\nimport initApi = TestUtils.initApi\n\nsetLocalStorage(fetch)\nlet env: TestVars\n\nbefore(async function () {\n this.timeout(600000)\n const initializer = await getEnvironmentInitializer()\n env = await initializer.execute(getEnvVariables())\n})\n\nasync function createPatient(patientApiForHcp: IccPatientXApi, hcpUser: User) {\n return patientApiForHcp.createPatientWithUser(\n hcpUser,\n await patientApiForHcp.newInstance(\n hcpUser,\n new Patient({\n id: randomUUID(),\n firstName: 'John',\n lastName: 'Snow',\n note: 'Winter is coming',\n })\n )\n )\n}\n\nasync function createHealthElement(healthElementApi: IccHelementXApi, hcpUser: User, patient: Patient) {\n return healthElementApi.createHealthElementWithUser(\n hcpUser,\n await healthElementApi.newInstance(\n hcpUser,\n patient,\n new HealthElement({\n id: randomUUID(),\n note: 'My secret note',\n tags: [\n new Code({\n id: 'ICURE|MY-CODE|1',\n code: 'MY-CODE',\n type: 'ICURE',\n version: '1',\n }),\n ],\n }),\n { confidential: true }\n )\n )\n}\n\nfunction createBasicContact(contactApiForHcp: IccContactXApi, hcpUser: User, patient: Patient) {\n return contactApiForHcp.newInstance(\n hcpUser,\n patient,\n new Contact({\n id: randomUUID(),\n services: [\n contactApiForHcp.service().newInstance(\n hcpUser,\n new Service({\n id: randomUUID(),\n valueDate: 20220203111034,\n content: { en: new Content({ numberValue: 53.5 }) },\n tags: [\n new Code({\n id: 'LOINC|29463-7|2',\n code: '29463-7',\n type: 'LOINC',\n version: '2',\n }),\n ],\n })\n ),\n ],\n descr: 'Weight value',\n }),\n { confidential: true }\n )\n}\n\ndescribe('icc-x-contact-api Tests', () => {\n it('CreateContactWithUser Success for HCP', async () => {\n // Given\n const { userApi: userApiForHcp, patientApi: patientApiForHcp, contactApi: contactApiForHcp, cryptoApi } = await initApi(env!, hcp1Username)\n\n const hcpUser = await userApiForHcp.getCurrentUser()\n\n const patient = await createPatient(patientApiForHcp, hcpUser)\n const contactToCreate = await createBasicContact(contactApiForHcp, hcpUser, patient)\n\n // When\n const createdContact = (await contactApiForHcp.createContactWithUser(hcpUser, contactToCreate)) as Contact\n\n // Then\n const readContact = await contactApiForHcp.getContactWithUser(hcpUser, createdContact.id!)\n expect(readContact).to.not.be.undefined\n expect(readContact).to.not.be.null\n expect(readContact.openingDate).to.not.be.undefined\n expect(readContact.openingDate).to.not.be.null\n expect(readContact.groupId).to.not.be.undefined\n expect(readContact.groupId).to.not.be.null\n expect(readContact.responsible).to.be.equal(hcpUser.healthcarePartyId)\n expect(readContact.id).to.be.equal(contactToCreate.id)\n expect(readContact.descr).to.be.equal(contactToCreate.descr)\n expect(readContact.services![0].responsible).to.be.equal(hcpUser.healthcarePartyId)\n expect(readContact.services![0].id).to.be.equal(contactToCreate.services![0].id)\n expect(readContact.services![0].valueDate).to.be.equal(contactToCreate.services![0].valueDate)\n expect(readContact.services![0].tags![0].id).to.be.equal(contactToCreate.services![0].tags![0].id!)\n expect(await cryptoApi.xapi.encryptionKeysOf({ entity: readContact, type: EntityWithDelegationTypeName.Contact }, undefined)).to.have.length(1)\n const decryptedPatientIds = await contactApiForHcp.decryptPatientIdOf(readContact)\n expect(decryptedPatientIds).to.have.length(1)\n expect(decryptedPatientIds[0]).to.equal(patient.id)\n })\n\n it('Filter Services By HealthElementId - Success', async () => {\n // Given\n const {\n userApi: userApiForHcp,\n patientApi: patientApiForHcp,\n contactApi: contactApiForHcp,\n healthcareElementApi: hElementApiForHcp,\n } = await initApi(env!, hcp1Username)\n\n const hcpUser = await userApiForHcp.getCurrentUser()\n\n const patient = await createPatient(patientApiForHcp, hcpUser)\n const healthElement = await createHealthElement(hElementApiForHcp, hcpUser, patient)\n const contactToCreate = await createBasicContact(contactApiForHcp, hcpUser, patient).then((contact) => {\n return {\n ...contact,\n subContacts: [\n new SubContact({\n id: randomUUID(),\n healthElementId: healthElement!.id!,\n services: [new ServiceLink({ serviceId: contact.services![0].id })],\n }),\n ],\n }\n })\n\n const createdContact = (await contactApiForHcp.createContactWithUser(hcpUser, new Contact(contactToCreate))) as Contact\n assert(createdContact != null)\n\n // When\n const foundServices = await contactApiForHcp.filterServicesBy(\n undefined,\n undefined,\n new FilterChainService({\n filter: new ServiceByHcPartyHealthElementIdsFilter({\n healthcarePartyId: hcpUser.healthcarePartyId!,\n healthElementIds: [healthElement!.id!],\n }),\n })\n )\n\n // Then\n assert(foundServices.rows!.length == 1)\n assert(foundServices.rows![0].id == createdContact.services![0].id)\n assert(foundServices.rows![0].healthElementsIds!.find((heId) => heId == healthElement!.id!) != undefined)\n })\n\n it('contacts findBy for HCP GET and POSt', async () => {\n // Given\n const {\n userApi: userApiForHcp,\n dataOwnerApi: dataOwnerApiForHcp,\n patientApi: patientApiForHcp,\n contactApi: contactApiForHcp,\n healthcareElementApi: hElementApiForHcp,\n cryptoApi: cryptoApiForHcp,\n } = await initApi(env, hcp1Username)\n const hcpUser = await userApiForHcp.getCurrentUser()\n\n const patient = (await createPatient(patientApiForHcp, hcpUser)) as Patient\n const healthElement = await createHealthElement(hElementApiForHcp, hcpUser, patient)\n const contactToCreate = await createBasicContact(contactApiForHcp, hcpUser, patient).then((contact) => {\n return {\n ...contact,\n subContacts: [\n new SubContact({\n id: randomUUID(),\n healthElementId: healthElement!.id!,\n services: [new ServiceLink({ serviceId: contact.services![0].id })],\n }),\n ],\n }\n })\n\n const createdContact = (await contactApiForHcp.createContactWithUser(hcpUser, contactToCreate)) as Contact\n\n // When\n const foundContats = await contactApiForHcp.findBy(hcpUser.healthcarePartyId!, patient, false)\n const foundContatsUsingPost = await contactApiForHcp.findBy(hcpUser.healthcarePartyId!, patient, true)\n\n // Then\n assert(foundContats.length == 1, 'Found items should be 1')\n assert(foundContats[0].id == contactToCreate.id, 'Found item should be the same as the created one')\n\n assert(foundContatsUsingPost.length == 1, 'Found items using post should be 1')\n assert(foundContatsUsingPost[0].id == createdContact.id, 'Found item using post should be the same as the created one')\n })\n\n it('Share with should work as expected', async () => {\n const api1 = await initApi(env!, hcp1Username)\n const user1 = await api1.userApi.getCurrentUser()\n const api2 = await initApi(env!, hcp2Username)\n const user2 = await api2.userApi.getCurrentUser()\n const samplePatient = await api1.patientApi.createPatientWithUser(\n user1,\n await api1.patientApi.newInstance(user1, { firstName: 'Gigio', lastName: 'Bagigio' })\n )\n const encryptedField = 'Something encrypted'\n const entity = await api1.calendarItemApi.createCalendarItemWithHcParty(\n user1,\n await api1.calendarItemApi.newInstancePatient(user1, samplePatient, { details: encryptedField })\n )\n expect(entity.details).to.be.equal(encryptedField)\n await api2.calendarItemApi\n .getCalendarItemWithUser(user2, entity.id)\n .then(() => {\n throw new Error('Should not be able to get the entity')\n })\n .catch(() => {\n /* expected */\n })\n await api1.calendarItemApi.shareWith(user2.healthcarePartyId!, entity)\n const retrieved = await api2.calendarItemApi.getCalendarItemWithUser(user2, entity.id)\n expect(retrieved.details).to.be.equal(encryptedField)\n expect((await api2.calendarItemApi.decryptPatientIdOf(retrieved))[0]).to.equal(samplePatient.id)\n })\n\n it('Instanciation of old Measure should be mapped to new Measure with referenceRange', () => {\n const oldMeasure = {\n min: 0,\n max: 10,\n }\n\n const newMeasure = new Measure({ ...oldMeasure })\n\n expect(newMeasure.referenceRange).to.not.be.undefined\n expect(newMeasure.referenceRange).to.not.undefined\n expect(newMeasure.referenceRange).to.have.length(1)\n expect(newMeasure.referenceRange![0].low).to.be.equal(oldMeasure.min)\n expect(newMeasure.referenceRange![0].high).to.be.equal(oldMeasure.max)\n\n expect(Object.keys(newMeasure)).to.not.contain('min')\n expect(Object.keys(newMeasure)).to.not.contain('max')\n })\n\n it('Instanciation of Service with old Measure should be mapped to new Measure with referenceRange', () => {\n const serviceJson = {\n id: 'serviceId',\n valueDate: 20220203111034,\n content: {\n en: {\n numberValue: 53.5,\n measureValue: {\n min: 0,\n max: 10,\n },\n },\n },\n tags: [\n {\n id: 'LOINC|29463-7|2',\n code: '29463-7',\n type: 'LOINC',\n version: '2',\n },\n ],\n }\n\n const service = new Service(JSON.parse(JSON.stringify(serviceJson)))\n\n expect(service.content?.en?.measureValue).to.not.be.undefined\n expect(service.content?.en?.measureValue?.referenceRange).to.not.be.undefined\n expect(service.content?.en?.measureValue?.referenceRange).to.have.length(1)\n expect(service.content?.en?.measureValue?.referenceRange![0].low).to.be.equal(serviceJson.content.en.measureValue.min)\n expect(service.content?.en?.measureValue?.referenceRange![0].high).to.be.equal(serviceJson.content.en.measureValue.max)\n\n expect(Object.keys(service.content?.en?.measureValue!)).to.not.contain('min')\n expect(Object.keys(service.content?.en?.measureValue!)).to.not.contain('max')\n })\n\n it('Instanciation of Contact with old Measure should be mapped to new Measure with referenceRange', () => {\n const contactJson = {\n id: 'contactId',\n services: [\n {\n id: 'serviceId',\n valueDate: 20220203111034,\n content: {\n en: {\n numberValue: 53.5,\n measureValue: {\n min: 0,\n max: 10,\n },\n },\n },\n tags: [\n {\n id: 'LOINC|29463-7|2',\n code: '29463-7',\n type: 'LOINC',\n version: '2',\n },\n ],\n },\n ],\n descr: 'Weight value',\n }\n\n const contact = new Contact(JSON.parse(JSON.stringify(contactJson)))\n\n expect(contact.services).to.not.be.undefined\n expect(contact.services).to.have.length(1)\n expect(contact.services![0].content?.en?.measureValue).to.not.be.undefined\n expect(contact.services![0].content?.en?.measureValue?.referenceRange).to.not.be.undefined\n expect(contact.services![0].content?.en?.measureValue?.referenceRange).to.have.length(1)\n expect(contact.services![0].content?.en?.measureValue?.referenceRange![0].low).to.be.equal(contactJson.services[0].content.en.measureValue.min)\n expect(contact.services![0].content?.en?.measureValue?.referenceRange![0].high).to.be.equal(contactJson.services[0].content.en.measureValue.max)\n\n expect(Object.keys(contact.services![0].content?.en?.measureValue!)).to.not.contain('min')\n expect(Object.keys(contact.services![0].content?.en?.measureValue!)).to.not.contain('max')\n })\n})\n"]}
1
+ {"version":3,"file":"icc-contact-x-api.js","sourceRoot":"","sources":["../../../test/icc-x-api/icc-contact-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iCAA8B;AAE9B,4BAAyB;AAEzB,+CAA+G;AAC/G,yDAAqD;AACrD,+BAAqC;AACrC,mCAAmC;AACnC,oDAAuH;AACvH,mDAA+C;AAC/C,yDAAqD;AACrD,yDAAqD;AACrD,yDAAqD;AAErD,qEAAiE;AACjE,+DAA2D;AAC3D,iEAA6D;AAC7D,+EAA2E;AAC3E,2HAAuH;AACvH,mDAAmE;AACnE,yDAAqD;AACrD,IAAO,OAAO,GAAG,sBAAS,CAAC,OAAO,CAAA;AAElC,IAAA,4BAAe,EAAC,KAAK,CAAC,CAAA;AACtB,IAAI,GAAa,CAAA;AAEjB,IAAA,cAAM,EAAC;;QACL,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QACpB,MAAM,WAAW,GAAG,MAAM,IAAA,sCAAyB,GAAE,CAAA;QACrD,GAAG,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,IAAA,uBAAe,GAAE,CAAC,CAAA;IACpD,CAAC;CAAA,CAAC,CAAA;AAEF,SAAe,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AC,OAAO,CAAC,KAAK,CAAC,CAAA;QAC1F,IAAA,aAAM,EAAC,MAAM,CAAC,IAAI,CAAC,MAAA,MAAA,OAAO,CAAC,QAAS,CAAC,CAAC,CAAC,CAAC,OAAO,0CAAE,EAAE,0CAAE,YAAa,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC5F,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { before } from 'mocha'\n\nimport 'isomorphic-fetch'\n\nimport { EntityWithDelegationTypeName, IccContactXApi, IccHelementXApi, IccPatientXApi } from '../../icc-x-api'\nimport { Patient } from '../../icc-api/model/Patient'\nimport { assert, expect } from 'chai'\nimport { randomUUID } from 'crypto'\nimport { getEnvironmentInitializer, hcp1Username, hcp2Username, setLocalStorage, TestUtils } from '../utils/test_utils'\nimport { Code } from '../../icc-api/model/Code'\nimport { Contact } from '../../icc-api/model/Contact'\nimport { Service } from '../../icc-api/model/Service'\nimport { Content } from '../../icc-api/model/Content'\nimport { User } from '../../icc-api/model/User'\nimport { HealthElement } from '../../icc-api/model/HealthElement'\nimport { SubContact } from '../../icc-api/model/SubContact'\nimport { ServiceLink } from '../../icc-api/model/ServiceLink'\nimport { FilterChainService } from '../../icc-api/model/FilterChainService'\nimport { ServiceByHcPartyHealthElementIdsFilter } from '../../icc-x-api/filters/ServiceByHcPartyHealthElementIdsFilter'\nimport { getEnvVariables, TestVars } from '@icure/test-setup/types'\nimport { Measure } from '../../icc-api/model/Measure'\nimport initApi = TestUtils.initApi\n\nsetLocalStorage(fetch)\nlet env: TestVars\n\nbefore(async function () {\n this.timeout(600000)\n const initializer = await getEnvironmentInitializer()\n env = await initializer.execute(getEnvVariables())\n})\n\nasync function createPatient(patientApiForHcp: IccPatientXApi, hcpUser: User) {\n return patientApiForHcp.createPatientWithUser(\n hcpUser,\n await patientApiForHcp.newInstance(\n hcpUser,\n new Patient({\n id: randomUUID(),\n firstName: 'John',\n lastName: 'Snow',\n note: 'Winter is coming',\n })\n )\n )\n}\n\nasync function createHealthElement(healthElementApi: IccHelementXApi, hcpUser: User, patient: Patient) {\n return healthElementApi.createHealthElementWithUser(\n hcpUser,\n await healthElementApi.newInstance(\n hcpUser,\n patient,\n new HealthElement({\n id: randomUUID(),\n note: 'My secret note',\n tags: [\n new Code({\n id: 'ICURE|MY-CODE|1',\n code: 'MY-CODE',\n type: 'ICURE',\n version: '1',\n }),\n ],\n }),\n { confidential: true }\n )\n )\n}\n\nfunction createBasicContact(contactApiForHcp: IccContactXApi, hcpUser: User, patient: Patient) {\n return contactApiForHcp.newInstance(\n hcpUser,\n patient,\n new Contact({\n id: randomUUID(),\n services: [\n contactApiForHcp.service().newInstance(\n hcpUser,\n new Service({\n id: randomUUID(),\n valueDate: 20220203111034,\n content: { en: new Content({ numberValue: 53.5 }) },\n tags: [\n new Code({\n id: 'LOINC|29463-7|2',\n code: '29463-7',\n type: 'LOINC',\n version: '2',\n }),\n ],\n })\n ),\n ],\n descr: 'Weight value',\n }),\n { confidential: true }\n )\n}\n\ndescribe('icc-x-contact-api Tests', () => {\n it('CreateContactWithUser Success for HCP', async () => {\n // Given\n const { userApi: userApiForHcp, patientApi: patientApiForHcp, contactApi: contactApiForHcp, cryptoApi } = await initApi(env!, hcp1Username)\n\n const hcpUser = await userApiForHcp.getCurrentUser()\n\n const patient = await createPatient(patientApiForHcp, hcpUser)\n const contactToCreate = await createBasicContact(contactApiForHcp, hcpUser, patient)\n\n // When\n const createdContact = (await contactApiForHcp.createContactWithUser(hcpUser, contactToCreate)) as Contact\n\n // Then\n const readContact = await contactApiForHcp.getContactWithUser(hcpUser, createdContact.id!)\n expect(readContact).to.not.be.undefined\n expect(readContact).to.not.be.null\n expect(readContact.openingDate).to.not.be.undefined\n expect(readContact.openingDate).to.not.be.null\n expect(readContact.groupId).to.not.be.undefined\n expect(readContact.groupId).to.not.be.null\n expect(readContact.responsible).to.be.equal(hcpUser.healthcarePartyId)\n expect(readContact.id).to.be.equal(contactToCreate.id)\n expect(readContact.descr).to.be.equal(contactToCreate.descr)\n expect(readContact.services![0].responsible).to.be.equal(hcpUser.healthcarePartyId)\n expect(readContact.services![0].id).to.be.equal(contactToCreate.services![0].id)\n expect(readContact.services![0].valueDate).to.be.equal(contactToCreate.services![0].valueDate)\n expect(readContact.services![0].tags![0].id).to.be.equal(contactToCreate.services![0].tags![0].id!)\n expect(await cryptoApi.xapi.encryptionKeysOf({ entity: readContact, type: EntityWithDelegationTypeName.Contact }, undefined)).to.have.length(1)\n const decryptedPatientIds = await contactApiForHcp.decryptPatientIdOf(readContact)\n expect(decryptedPatientIds).to.have.length(1)\n expect(decryptedPatientIds[0]).to.equal(patient.id)\n })\n\n it('Filter Services By HealthElementId - Success', async () => {\n // Given\n const {\n userApi: userApiForHcp,\n patientApi: patientApiForHcp,\n contactApi: contactApiForHcp,\n healthcareElementApi: hElementApiForHcp,\n } = await initApi(env!, hcp1Username)\n\n const hcpUser = await userApiForHcp.getCurrentUser()\n\n const patient = await createPatient(patientApiForHcp, hcpUser)\n const healthElement = await createHealthElement(hElementApiForHcp, hcpUser, patient)\n const contactToCreate = await createBasicContact(contactApiForHcp, hcpUser, patient).then((contact) => {\n return {\n ...contact,\n subContacts: [\n new SubContact({\n id: randomUUID(),\n healthElementId: healthElement!.id!,\n services: [new ServiceLink({ serviceId: contact.services![0].id })],\n }),\n ],\n }\n })\n\n const createdContact = (await contactApiForHcp.createContactWithUser(hcpUser, new Contact(contactToCreate))) as Contact\n assert(createdContact != null)\n\n // When\n const foundServices = await contactApiForHcp.filterServicesBy(\n undefined,\n undefined,\n new FilterChainService({\n filter: new ServiceByHcPartyHealthElementIdsFilter({\n healthcarePartyId: hcpUser.healthcarePartyId!,\n healthElementIds: [healthElement!.id!],\n }),\n })\n )\n\n // Then\n assert(foundServices.rows!.length == 1)\n assert(foundServices.rows![0].id == createdContact.services![0].id)\n assert(foundServices.rows![0].healthElementsIds!.find((heId) => heId == healthElement!.id!) != undefined)\n })\n\n it('contacts findBy for HCP GET and POSt', async () => {\n // Given\n const {\n userApi: userApiForHcp,\n dataOwnerApi: dataOwnerApiForHcp,\n patientApi: patientApiForHcp,\n contactApi: contactApiForHcp,\n healthcareElementApi: hElementApiForHcp,\n cryptoApi: cryptoApiForHcp,\n } = await initApi(env, hcp1Username)\n const hcpUser = await userApiForHcp.getCurrentUser()\n\n const patient = (await createPatient(patientApiForHcp, hcpUser)) as Patient\n const healthElement = await createHealthElement(hElementApiForHcp, hcpUser, patient)\n const contactToCreate = await createBasicContact(contactApiForHcp, hcpUser, patient).then((contact) => {\n return {\n ...contact,\n subContacts: [\n new SubContact({\n id: randomUUID(),\n healthElementId: healthElement!.id!,\n services: [new ServiceLink({ serviceId: contact.services![0].id })],\n }),\n ],\n }\n })\n\n const createdContact = (await contactApiForHcp.createContactWithUser(hcpUser, contactToCreate)) as Contact\n\n // When\n const foundContats = await contactApiForHcp.findBy(hcpUser.healthcarePartyId!, patient, false)\n const foundContatsUsingPost = await contactApiForHcp.findBy(hcpUser.healthcarePartyId!, patient, true)\n\n // Then\n assert(foundContats.length == 1, 'Found items should be 1')\n assert(foundContats[0].id == contactToCreate.id, 'Found item should be the same as the created one')\n\n assert(foundContatsUsingPost.length == 1, 'Found items using post should be 1')\n assert(foundContatsUsingPost[0].id == createdContact.id, 'Found item using post should be the same as the created one')\n })\n\n it('Share with should work as expected', async () => {\n const api1 = await initApi(env!, hcp1Username)\n const user1 = await api1.userApi.getCurrentUser()\n const api2 = await initApi(env!, hcp2Username)\n const user2 = await api2.userApi.getCurrentUser()\n const samplePatient = await api1.patientApi.createPatientWithUser(\n user1,\n await api1.patientApi.newInstance(user1, { firstName: 'Gigio', lastName: 'Bagigio' })\n )\n const encryptedField = 'Something encrypted'\n const entity = await api1.calendarItemApi.createCalendarItemWithHcParty(\n user1,\n await api1.calendarItemApi.newInstancePatient(user1, samplePatient, { details: encryptedField })\n )\n expect(entity.details).to.be.equal(encryptedField)\n await api2.calendarItemApi\n .getCalendarItemWithUser(user2, entity.id)\n .then(() => {\n throw new Error('Should not be able to get the entity')\n })\n .catch(() => {\n /* expected */\n })\n await api1.calendarItemApi.shareWith(user2.healthcarePartyId!, entity)\n const retrieved = await api2.calendarItemApi.getCalendarItemWithUser(user2, entity.id)\n expect(retrieved.details).to.be.equal(encryptedField)\n expect((await api2.calendarItemApi.decryptPatientIdOf(retrieved))[0]).to.equal(samplePatient.id)\n })\n\n it('Instanciation of old Measure should be mapped to new Measure with referenceRanges', () => {\n const oldMeasure = {\n min: 0,\n max: 10,\n }\n\n const newMeasure = new Measure({ ...oldMeasure })\n\n expect(newMeasure.referenceRanges).to.not.be.undefined\n expect(newMeasure.referenceRanges).to.not.undefined\n expect(newMeasure.referenceRanges).to.have.length(1)\n expect(newMeasure.referenceRanges![0].low).to.be.equal(oldMeasure.min)\n expect(newMeasure.referenceRanges![0].high).to.be.equal(oldMeasure.max)\n\n expect(Object.keys(newMeasure)).to.not.contain('min')\n expect(Object.keys(newMeasure)).to.not.contain('max')\n })\n\n it('Instanciation of Service with old Measure should be mapped to new Measure with referenceRanges', () => {\n const serviceJson = {\n id: 'serviceId',\n valueDate: 20220203111034,\n content: {\n en: {\n numberValue: 53.5,\n measureValue: {\n min: 0,\n max: 10,\n },\n },\n },\n tags: [\n {\n id: 'LOINC|29463-7|2',\n code: '29463-7',\n type: 'LOINC',\n version: '2',\n },\n ],\n }\n\n const service = new Service(JSON.parse(JSON.stringify(serviceJson)))\n\n expect(service.content?.en?.measureValue).to.not.be.undefined\n expect(service.content?.en?.measureValue?.referenceRanges).to.not.be.undefined\n expect(service.content?.en?.measureValue?.referenceRanges).to.have.length(1)\n expect(service.content?.en?.measureValue?.referenceRanges![0].low).to.be.equal(serviceJson.content.en.measureValue.min)\n expect(service.content?.en?.measureValue?.referenceRanges![0].high).to.be.equal(serviceJson.content.en.measureValue.max)\n\n expect(Object.keys(service.content?.en?.measureValue!)).to.not.contain('min')\n expect(Object.keys(service.content?.en?.measureValue!)).to.not.contain('max')\n })\n\n it('Instanciation of Contact with old Measure should be mapped to new Measure with referenceRanges', () => {\n const contactJson = {\n id: 'contactId',\n services: [\n {\n id: 'serviceId',\n valueDate: 20220203111034,\n content: {\n en: {\n numberValue: 53.5,\n measureValue: {\n min: 0,\n max: 10,\n },\n },\n },\n tags: [\n {\n id: 'LOINC|29463-7|2',\n code: '29463-7',\n type: 'LOINC',\n version: '2',\n },\n ],\n },\n ],\n descr: 'Weight value',\n }\n\n const contact = new Contact(JSON.parse(JSON.stringify(contactJson)))\n\n expect(contact.services).to.not.be.undefined\n expect(contact.services).to.have.length(1)\n expect(contact.services![0].content?.en?.measureValue).to.not.be.undefined\n expect(contact.services![0].content?.en?.measureValue?.referenceRanges).to.not.be.undefined\n expect(contact.services![0].content?.en?.measureValue?.referenceRanges).to.have.length(1)\n expect(contact.services![0].content?.en?.measureValue?.referenceRanges![0].low).to.be.equal(contactJson.services[0].content.en.measureValue.min)\n expect(contact.services![0].content?.en?.measureValue?.referenceRanges![0].high).to.be.equal(contactJson.services[0].content.en.measureValue.max)\n\n expect(Object.keys(contact.services![0].content?.en?.measureValue!)).to.not.contain('min')\n expect(Object.keys(contact.services![0].content?.en?.measureValue!)).to.not.contain('max')\n })\n})\n"]}
@@ -1 +0,0 @@
1
- import 'isomorphic-fetch';
@@ -8,40 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const icc_x_api_1 = require("../../icc-x-api");
13
- const crypto_1 = require("crypto");
14
- require("isomorphic-fetch");
15
- const test_utils_1 = require("../utils/test_utils");
16
- const icc_api_1 = require("../../icc-api");
17
- (0, test_utils_1.setLocalStorage)(fetch);
18
- class DiocaneCryptoStrategies {
19
- generateNewKeyForDataOwner(self, cryptoPrimitives) {
20
- return Promise.resolve(false);
21
- }
22
- recoverAndVerifySelfHierarchyKeys(keysData, cryptoPrimitives) {
23
- return Promise.resolve(Object.fromEntries(keysData.map(({ dataOwner }) => [dataOwner.dataOwner.id, { recoveredKeys: {}, keyAuthenticity: {} }])));
24
- }
25
- verifyDelegatePublicKeys(delegate, publicKeys, cryptoPrimitives) {
26
- return Promise.resolve(publicKeys);
27
- }
28
- dataOwnerRequiresAnonymousDelegation(dataOwner) {
29
- return dataOwner.type !== 'hcp';
30
- }
31
- }
32
11
  describe('CSM-87', function () {
33
12
  return __awaiter(this, void 0, void 0, function* () {
34
13
  it('An hcp should be able to load his key with `loadKeyPairsAsJwkInBrowserLocalStorage` and then create shamir partitions for himself', function () {
35
14
  return __awaiter(this, void 0, void 0, function* () {
36
- const api = yield icc_x_api_1.IcureApi.initialise("https://api.icure.cloud", new icc_x_api_1.JwtAuthenticationProvider(new icc_api_1.IccAuthApi("https://api.icure.cloud", {}, new icc_x_api_1.NoAuthenticationProvider(), fetch), "fabien.zimmer@medispring.be", "Ztf993pf", undefined, undefined), new DiocaneCryptoStrategies(), crypto_1.webcrypto, fetch, {
37
- groupSelector: (availableGroupsInfo, currentGroupId) => {
38
- const testapp = availableGroupsInfo.filter(g => { var _a; return ((_a = g.groupId) === null || _a === void 0 ? void 0 : _a.startsWith('ms-testapppatient')) == true; });
39
- return Promise.resolve(currentGroupId);
40
- // if (testapp.length != 1) throw new Error(`Found ${JSON.stringify(testapp)}`)
41
- // return Promise.resolve(testapp[0].groupId!)
42
- }
43
- });
44
- console.log("Hello");
15
+ // This test does not apply to v7 or higher: it was a bug related to a specific method
16
+ this.skip();
45
17
  });
46
18
  });
47
19
  });
@@ -1 +1 @@
1
- {"version":3,"file":"CSM-87.js","sourceRoot":"","sources":["../../../test/support/CSM-87.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+CAA0I;AAG1I,mCAAgC;AAChC,4BAAyB;AACzB,oDAAmD;AACnD,2CAAwC;AACxC,IAAA,4BAAe,EAAC,KAAK,CAAC,CAAA;AAEtB,MAA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,CAAA;wBACnG,OAAO,OAAO,CAAC,OAAO,CAAC,cAAe,CAAC,CAAA;wBACvC,+EAA+E;wBAC/E,8CAA8C;oBAChD,CAAC;iBACF,CACF,CAAA;gBACD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;YACtB,CAAC;SAAA,CAAC,CAAA;IACJ,CAAC;CAAA,CAAC,CAAA","sourcesContent":["import {CryptoPrimitives, CryptoStrategies, IcureApi, JwtAuthenticationProvider, KeyPair, NoAuthenticationProvider} from \"../../icc-x-api\"\nimport {DataOwnerWithType} from \"../../icc-api/model/DataOwnerWithType\"\nimport {CryptoActorStubWithType} from \"../../icc-api/model/CryptoActorStub\"\nimport {webcrypto} from \"crypto\"\nimport 'isomorphic-fetch'\nimport {setLocalStorage} from \"../utils/test_utils\"\nimport {IccAuthApi} from \"../../icc-api\"\nsetLocalStorage(fetch)\n\nclass DiocaneCryptoStrategies implements CryptoStrategies {\n generateNewKeyForDataOwner(self: DataOwnerWithType, cryptoPrimitives: CryptoPrimitives): Promise<KeyPair<CryptoKey> | boolean> {\n return Promise.resolve(false)\n }\n\n recoverAndVerifySelfHierarchyKeys(\n keysData: { dataOwner: DataOwnerWithType; unknownKeys: string[]; unavailableKeys: string[] }[],\n cryptoPrimitives: CryptoPrimitives\n ): Promise<{ [p: string]: { recoveredKeys: { [p: string]: KeyPair<CryptoKey> }; keyAuthenticity: { [p: string]: boolean } } }> {\n return Promise.resolve(Object.fromEntries(keysData.map(({ dataOwner }) => [dataOwner.dataOwner.id, { recoveredKeys: {}, keyAuthenticity: {} }])))\n }\n\n verifyDelegatePublicKeys(delegate: CryptoActorStubWithType, publicKeys: string[], cryptoPrimitives: CryptoPrimitives): Promise<string[]> {\n return Promise.resolve(publicKeys)\n }\n\n dataOwnerRequiresAnonymousDelegation(dataOwner: CryptoActorStubWithType): boolean {\n return dataOwner.type !== 'hcp'\n }\n}\n\n\ndescribe('CSM-87', async function () {\n it('An hcp should be able to load his key with `loadKeyPairsAsJwkInBrowserLocalStorage` and then create shamir partitions for himself', async function () {\n const api = await IcureApi.initialise(\n \"https://api.icure.cloud\",\n new JwtAuthenticationProvider(\n new IccAuthApi(\"https://api.icure.cloud\", {}, new NoAuthenticationProvider(), fetch),\n \"fabien.zimmer@medispring.be\",\n \"Ztf993pf\",\n undefined,\n undefined\n ),\n new DiocaneCryptoStrategies(),\n webcrypto as any,\n fetch,\n {\n groupSelector: (availableGroupsInfo, currentGroupId) => {\n const testapp = availableGroupsInfo.filter(g => g.groupId?.startsWith('ms-testapppatient') == true)\n return Promise.resolve(currentGroupId!)\n // if (testapp.length != 1) throw new Error(`Found ${JSON.stringify(testapp)}`)\n // return Promise.resolve(testapp[0].groupId!)\n }\n }\n )\n console.log(\"Hello\")\n })\n})\n"]}
1
+ {"version":3,"file":"CSM-87.js","sourceRoot":"","sources":["../../../test/support/CSM-87.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,QAAQ,CAAC,QAAQ,EAAE;;QACjB,EAAE,CAAC,mIAAmI,EAAE;;gBACtI,sFAAsF;gBACtF,IAAI,CAAC,IAAI,EAAE,CAAA;YACb,CAAC;SAAA,CAAC,CAAA;IACJ,CAAC;CAAA,CAAC,CAAA","sourcesContent":["describe('CSM-87', async function () {\n it('An hcp should be able to load his key with `loadKeyPairsAsJwkInBrowserLocalStorage` and then create shamir partitions for himself', async function () {\n // This test does not apply to v7 or higher: it was a bug related to a specific method\n this.skip()\n })\n})\n"]}