@icure/api 8.6.3 → 8.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/icc-api/model/CryptoActorStub.d.ts +2 -0
  2. package/icc-api/model/CryptoActorStub.js.map +1 -1
  3. package/icc-api/model/Device.d.ts +1 -0
  4. package/icc-api/model/Device.js.map +1 -1
  5. package/icc-api/model/HealthcareParty.d.ts +1 -0
  6. package/icc-api/model/HealthcareParty.js.map +1 -1
  7. package/icc-api/model/ModelHelper.d.ts +1 -1
  8. package/icc-api/model/ModelHelper.js +15 -2
  9. package/icc-api/model/ModelHelper.js.map +1 -1
  10. package/icc-api/model/Patient.d.ts +1 -0
  11. package/icc-api/model/Patient.js.map +1 -1
  12. package/icc-api/model/User.d.ts +1 -0
  13. package/icc-api/model/User.js.map +1 -1
  14. package/icc-x-api/crypto/AES.js +1 -1
  15. package/icc-x-api/crypto/AES.js.map +1 -1
  16. package/icc-x-api/crypto/BaseExchangeDataManager.js +14 -14
  17. package/icc-x-api/crypto/BaseExchangeDataManager.js.map +1 -1
  18. package/icc-x-api/crypto/BaseExchangeKeysManager.js +1 -1
  19. package/icc-x-api/crypto/BaseExchangeKeysManager.js.map +1 -1
  20. package/icc-x-api/crypto/CryptoPrimitives.js +3 -2
  21. package/icc-x-api/crypto/CryptoPrimitives.js.map +1 -1
  22. package/icc-x-api/crypto/CryptoStrategies.d.ts +2 -1
  23. package/icc-x-api/crypto/CryptoStrategies.js.map +1 -1
  24. package/icc-x-api/crypto/ExchangeDataManager.js +3 -3
  25. package/icc-x-api/crypto/ExchangeDataManager.js.map +1 -1
  26. package/icc-x-api/crypto/ExtendedApisUtilsImpl.js +1 -1
  27. package/icc-x-api/crypto/ExtendedApisUtilsImpl.js.map +1 -1
  28. package/icc-x-api/crypto/KeyRecovery.js +3 -3
  29. package/icc-x-api/crypto/KeyRecovery.js.map +1 -1
  30. package/icc-x-api/crypto/NativeCryptoPrimitivesBridge.js +13 -13
  31. package/icc-x-api/crypto/NativeCryptoPrimitivesBridge.js.map +1 -1
  32. package/icc-x-api/crypto/RSA.js +2 -2
  33. package/icc-x-api/crypto/RSA.js.map +1 -1
  34. package/icc-x-api/crypto/RecoveryDataEncryption.js +5 -5
  35. package/icc-x-api/crypto/RecoveryDataEncryption.js.map +1 -1
  36. package/icc-x-api/crypto/SecureDelegationsManager.js +1 -1
  37. package/icc-x-api/crypto/SecureDelegationsManager.js.map +1 -1
  38. package/icc-x-api/crypto/ShamirKeysManager.js +1 -1
  39. package/icc-x-api/crypto/ShamirKeysManager.js.map +1 -1
  40. package/icc-x-api/crypto/UserEncryptionKeysManager.js +2 -2
  41. package/icc-x-api/crypto/UserEncryptionKeysManager.js.map +1 -1
  42. package/icc-x-api/crypto/utils.js +1 -1
  43. package/icc-x-api/crypto/utils.js.map +1 -1
  44. package/icc-x-api/filters/HealthElementByHcPartyCodeFilter.d.ts +24 -0
  45. package/icc-x-api/filters/HealthElementByHcPartyCodeFilter.js +24 -0
  46. package/icc-x-api/filters/HealthElementByHcPartyCodeFilter.js.map +1 -0
  47. package/icc-x-api/filters/HealthElementByHcPartyIdentifiersVersioningFilter.d.ts +22 -0
  48. package/icc-x-api/filters/HealthElementByHcPartyIdentifiersVersioningFilter.js +24 -0
  49. package/icc-x-api/filters/HealthElementByHcPartyIdentifiersVersioningFilter.js.map +1 -0
  50. package/icc-x-api/filters/HealthElementByHcPartyStatusVersioningFilter.d.ts +21 -0
  51. package/icc-x-api/filters/HealthElementByHcPartyStatusVersioningFilter.js +24 -0
  52. package/icc-x-api/filters/HealthElementByHcPartyStatusVersioningFilter.js.map +1 -0
  53. package/icc-x-api/filters/HealthElementByHcPartyTagFilter.d.ts +24 -0
  54. package/icc-x-api/filters/HealthElementByHcPartyTagFilter.js +24 -0
  55. package/icc-x-api/filters/HealthElementByHcPartyTagFilter.js.map +1 -0
  56. package/icc-x-api/filters/VersionFiltering.d.ts +14 -0
  57. package/icc-x-api/filters/VersionFiltering.js +19 -0
  58. package/icc-x-api/filters/VersionFiltering.js.map +1 -0
  59. package/icc-x-api/filters/filters.d.ts +8 -4
  60. package/icc-x-api/filters/filters.js +4 -0
  61. package/icc-x-api/filters/filters.js.map +1 -1
  62. package/icc-x-api/icc-receipt-x-api.js +1 -1
  63. package/icc-x-api/icc-receipt-x-api.js.map +1 -1
  64. package/icc-x-api/utils/binary-utils.js +1 -1
  65. package/icc-x-api/utils/binary-utils.js.map +1 -1
  66. package/package.json +1 -1
  67. package/test/icc-api/api/IccAnonymousAccessApi.js +1 -1
  68. package/test/icc-api/api/IccAnonymousAccessApi.js.map +1 -1
  69. package/test/icc-api/api/IccDocumentApi.js +13 -12
  70. package/test/icc-api/api/IccDocumentApi.js.map +1 -1
  71. package/test/icc-x-api/crud/comprehensive-crud-test.js +2 -2
  72. package/test/icc-x-api/crud/comprehensive-crud-test.js.map +1 -1
  73. package/test/icc-x-api/crypto/crypto-utils.js +1 -1
  74. package/test/icc-x-api/crypto/crypto-utils.js.map +1 -1
  75. package/test/icc-x-api/crypto/soft-deleted-data-owners.js +1 -1
  76. package/test/icc-x-api/crypto/soft-deleted-data-owners.js.map +1 -1
  77. package/test/icc-x-api/crypto/user-encryption-keys-manager-test.js +1 -1
  78. package/test/icc-x-api/crypto/user-encryption-keys-manager-test.js.map +1 -1
  79. package/test/icc-x-api/filters/healthelement.d.ts +1 -0
  80. package/test/icc-x-api/filters/healthelement.js +333 -0
  81. package/test/icc-x-api/filters/healthelement.js.map +1 -0
  82. package/test/icc-x-api/test-legacy-data-support.js +4 -4
  83. package/test/icc-x-api/test-legacy-data-support.js.map +1 -1
  84. package/test/support/CSM-729.d.ts +1 -0
  85. package/test/support/CSM-729.js +225 -0
  86. package/test/support/CSM-729.js.map +1 -0
  87. package/test/utils/TestCryptoStrategies.js +1 -1
  88. package/test/utils/TestCryptoStrategies.js.map +1 -1
  89. package/test/utils/roles.d.ts +1 -0
  90. package/test/utils/roles.js +1 -0
  91. package/test/utils/roles.js.map +1 -1
  92. package/test/utils/test_utils.js +2 -2
  93. package/test/utils/test_utils.js.map +1 -1
@@ -4,6 +4,7 @@ import { Patient } from './Patient';
4
4
  import { HealthcareParty } from './HealthcareParty';
5
5
  import { Device } from './Device';
6
6
  import { CodeStub } from './CodeStub';
7
+ import { PropertyStub } from './PropertyStub';
7
8
  export declare class CryptoActorStub {
8
9
  constructor(json: JSON | any);
9
10
  static fromDataOwner(dataOwnerWithType: Patient | HealthcareParty | Device): CryptoActorStub;
@@ -52,6 +53,7 @@ export declare class CryptoActorStub {
52
53
  */
53
54
  tags?: Array<CodeStub>;
54
55
  parentId?: string;
56
+ cryptoActorProperties?: Array<PropertyStub>;
55
57
  }
56
58
  export declare class CryptoActorStubWithType {
57
59
  constructor(json: JSON | any);
@@ -1 +1 @@
1
- {"version":3,"file":"CryptoActorStub.js","sourceRoot":"","sources":["../../../icc-api/model/CryptoActorStub.ts"],"names":[],"mappings":";;;AAOA,MAAa,eAAe;IAC1B,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAAuB,EAAE,IAAI,CAAC,CAAA;IAC9C,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,iBAAqD;QACxE,OAAO,IAAI,eAAe,CAAC;YACzB,EAAE,EAAE,iBAAiB,CAAC,EAAE;YACxB,GAAG,EAAE,iBAAiB,CAAC,GAAG;YAC1B,WAAW,EAAE,iBAAiB,CAAC,WAAW;YAC1C,eAAe,EAAE,iBAAiB,CAAC,eAAe;YAClD,YAAY,EAAE,iBAAiB,CAAC,YAAY;YAC5C,0BAA0B,EAAE,iBAAiB,CAAC,0BAA0B;YACxE,2BAA2B,EAAE,iBAAiB,CAAC,2BAA2B;YAC1E,SAAS,EAAE,iBAAiB,CAAC,SAAS;YACtC,IAAI,EAAE,iBAAiB,CAAC,IAAI;YAC5B,QAAQ,EAAE,iBAAiB,CAAC,QAAQ;SACrC,CAAC,CAAA;IACJ,CAAC;CAiCF;AAnDD,0CAmDC;AACD,MAAa,uBAAuB;IAClC,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC1C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAyB,CAAA;IAC5C,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,iBAAoC;QACvD,OAAO,IAAI,uBAAuB,CAAC;YACjC,IAAI,EAAE,eAAe,CAAC,aAAa,CAAC,iBAAiB,CAAC,SAAS,CAAC;YAChE,IAAI,EAAE,iBAAiB,CAAC,IAAI;SAC7B,CAAC,CAAA;IACJ,CAAC;CAIF;AAfD,0DAeC","sourcesContent":["import { DataOwnerTypeEnum } from './DataOwnerTypeEnum'\nimport { DataOwnerWithType } from './DataOwnerWithType'\nimport { Patient } from './Patient'\nimport { HealthcareParty } from './HealthcareParty'\nimport { Device } from './Device'\nimport { CodeStub } from './CodeStub'\n\nexport class CryptoActorStub {\n constructor(json: JSON | any) {\n Object.assign(this as CryptoActorStub, json)\n }\n\n static fromDataOwner(dataOwnerWithType: Patient | HealthcareParty | Device) {\n return new CryptoActorStub({\n id: dataOwnerWithType.id,\n rev: dataOwnerWithType.rev,\n hcPartyKeys: dataOwnerWithType.hcPartyKeys,\n aesExchangeKeys: dataOwnerWithType.aesExchangeKeys,\n transferKeys: dataOwnerWithType.transferKeys,\n privateKeyShamirPartitions: dataOwnerWithType.privateKeyShamirPartitions,\n publicKeysForOaepWithSha256: dataOwnerWithType.publicKeysForOaepWithSha256,\n publicKey: dataOwnerWithType.publicKey,\n tags: dataOwnerWithType.tags,\n parentId: dataOwnerWithType.parentId,\n })\n }\n\n readonly id!: string\n readonly rev?: string\n /**\n * For each couple of HcParties (delegator and delegate), this map contains the exchange AES key. The delegator is always this hcp, the key of the map is the id of the delegate.The AES exchange key is encrypted using RSA twice : once using this hcp public key (index 0 in the Array) and once using the other hcp public key (index 1 in the Array). For a pair of HcParties. Each HcParty always has one AES exchange key for himself.\n */\n hcPartyKeys?: { [key: string]: Array<string> }\n /**\n * Extra AES exchange keys, usually the ones we lost access to at some point. The structure is { publicKey: { delegateId: { myPubKey1: aesExKey_for_this, delegatePubKey1: aesExKey_for_delegate } } }\n */\n aesExchangeKeys?: { [key: string]: { [key: string]: { [key: string]: string } } }\n /**\n * Our private keys encrypted with our public keys. The structure is { publicKey1: { publicKey2: privateKey2_encrypted_with_publicKey1, publicKey3: privateKey3_encrypted_with_publicKey1 } }\n */\n transferKeys?: { [key: string]: { [key: string]: string } }\n /**\n * The privateKeyShamirPartitions are used to share this hcp's private RSA key with a series of other hcParties using Shamir's algorithm. The key of the map is the hcp Id with whom this partition has been shared. The value is \\\"threshold⎮partition in hex\\\" encrypted using the the partition's holder's public RSA key\n */\n privateKeyShamirPartitions?: { [key: string]: string }\n /**\n * The public keys of this actor which should be used for RSA-OAEP with sha256 encryption.\n */\n publicKeysForOaepWithSha256?: string[]\n /**\n * The public key of this hcp\n */\n publicKey?: string\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 parentId?: string\n}\nexport class CryptoActorStubWithType {\n constructor(json: JSON | any) {\n this.stub = new CryptoActorStub(json.stub)\n this.type = json.type as DataOwnerTypeEnum\n }\n\n static fromDataOwner(dataOwnerWithType: DataOwnerWithType) {\n return new CryptoActorStubWithType({\n stub: CryptoActorStub.fromDataOwner(dataOwnerWithType.dataOwner),\n type: dataOwnerWithType.type,\n })\n }\n\n stub: CryptoActorStub\n type: DataOwnerTypeEnum\n}\n"]}
1
+ {"version":3,"file":"CryptoActorStub.js","sourceRoot":"","sources":["../../../icc-api/model/CryptoActorStub.ts"],"names":[],"mappings":";;;AAQA,MAAa,eAAe;IAC1B,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAAuB,EAAE,IAAI,CAAC,CAAA;IAC9C,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,iBAAqD;QACxE,OAAO,IAAI,eAAe,CAAC;YACzB,EAAE,EAAE,iBAAiB,CAAC,EAAE;YACxB,GAAG,EAAE,iBAAiB,CAAC,GAAG;YAC1B,WAAW,EAAE,iBAAiB,CAAC,WAAW;YAC1C,eAAe,EAAE,iBAAiB,CAAC,eAAe;YAClD,YAAY,EAAE,iBAAiB,CAAC,YAAY;YAC5C,0BAA0B,EAAE,iBAAiB,CAAC,0BAA0B;YACxE,2BAA2B,EAAE,iBAAiB,CAAC,2BAA2B;YAC1E,SAAS,EAAE,iBAAiB,CAAC,SAAS;YACtC,IAAI,EAAE,iBAAiB,CAAC,IAAI;YAC5B,QAAQ,EAAE,iBAAiB,CAAC,QAAQ;SACrC,CAAC,CAAA;IACJ,CAAC;CAkCF;AApDD,0CAoDC;AACD,MAAa,uBAAuB;IAClC,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC1C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAyB,CAAA;IAC5C,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,iBAAoC;QACvD,OAAO,IAAI,uBAAuB,CAAC;YACjC,IAAI,EAAE,eAAe,CAAC,aAAa,CAAC,iBAAiB,CAAC,SAAS,CAAC;YAChE,IAAI,EAAE,iBAAiB,CAAC,IAAI;SAC7B,CAAC,CAAA;IACJ,CAAC;CAIF;AAfD,0DAeC","sourcesContent":["import { DataOwnerTypeEnum } from './DataOwnerTypeEnum'\nimport { DataOwnerWithType } from './DataOwnerWithType'\nimport { Patient } from './Patient'\nimport { HealthcareParty } from './HealthcareParty'\nimport { Device } from './Device'\nimport { CodeStub } from './CodeStub'\nimport { PropertyStub } from './PropertyStub'\n\nexport class CryptoActorStub {\n constructor(json: JSON | any) {\n Object.assign(this as CryptoActorStub, json)\n }\n\n static fromDataOwner(dataOwnerWithType: Patient | HealthcareParty | Device) {\n return new CryptoActorStub({\n id: dataOwnerWithType.id,\n rev: dataOwnerWithType.rev,\n hcPartyKeys: dataOwnerWithType.hcPartyKeys,\n aesExchangeKeys: dataOwnerWithType.aesExchangeKeys,\n transferKeys: dataOwnerWithType.transferKeys,\n privateKeyShamirPartitions: dataOwnerWithType.privateKeyShamirPartitions,\n publicKeysForOaepWithSha256: dataOwnerWithType.publicKeysForOaepWithSha256,\n publicKey: dataOwnerWithType.publicKey,\n tags: dataOwnerWithType.tags,\n parentId: dataOwnerWithType.parentId,\n })\n }\n\n readonly id!: string\n readonly rev?: string\n /**\n * For each couple of HcParties (delegator and delegate), this map contains the exchange AES key. The delegator is always this hcp, the key of the map is the id of the delegate.The AES exchange key is encrypted using RSA twice : once using this hcp public key (index 0 in the Array) and once using the other hcp public key (index 1 in the Array). For a pair of HcParties. Each HcParty always has one AES exchange key for himself.\n */\n hcPartyKeys?: { [key: string]: Array<string> }\n /**\n * Extra AES exchange keys, usually the ones we lost access to at some point. The structure is { publicKey: { delegateId: { myPubKey1: aesExKey_for_this, delegatePubKey1: aesExKey_for_delegate } } }\n */\n aesExchangeKeys?: { [key: string]: { [key: string]: { [key: string]: string } } }\n /**\n * Our private keys encrypted with our public keys. The structure is { publicKey1: { publicKey2: privateKey2_encrypted_with_publicKey1, publicKey3: privateKey3_encrypted_with_publicKey1 } }\n */\n transferKeys?: { [key: string]: { [key: string]: string } }\n /**\n * The privateKeyShamirPartitions are used to share this hcp's private RSA key with a series of other hcParties using Shamir's algorithm. The key of the map is the hcp Id with whom this partition has been shared. The value is \\\"threshold⎮partition in hex\\\" encrypted using the the partition's holder's public RSA key\n */\n privateKeyShamirPartitions?: { [key: string]: string }\n /**\n * The public keys of this actor which should be used for RSA-OAEP with sha256 encryption.\n */\n publicKeysForOaepWithSha256?: string[]\n /**\n * The public key of this hcp\n */\n publicKey?: string\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 parentId?: string\n cryptoActorProperties?: Array<PropertyStub>\n}\nexport class CryptoActorStubWithType {\n constructor(json: JSON | any) {\n this.stub = new CryptoActorStub(json.stub)\n this.type = json.type as DataOwnerTypeEnum\n }\n\n static fromDataOwner(dataOwnerWithType: DataOwnerWithType) {\n return new CryptoActorStubWithType({\n stub: CryptoActorStub.fromDataOwner(dataOwnerWithType.dataOwner),\n type: dataOwnerWithType.type,\n })\n }\n\n stub: CryptoActorStub\n type: DataOwnerTypeEnum\n}\n"]}
@@ -100,4 +100,5 @@ export declare class Device {
100
100
  * The public keys of this actor that are generates using the OAEP Sha-256 standard
101
101
  */
102
102
  publicKeysForOaepWithSha256?: Array<string>;
103
+ cryptoActorProperties?: Array<PropertyStub>;
103
104
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Device.js","sourceRoot":"","sources":["../../../icc-api/model/Device.ts"],"names":[],"mappings":";;;AAeA;;GAEG;AACH,+CAAwD;AACxD,MAAa,MAAM;IACjB,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAAc,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAA,uCAAyB,EAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IAC/G,CAAC;CA0EF;AA7ED,wBA6EC","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 { Identifier } from './Identifier'\nimport { PropertyStub } from './PropertyStub'\n\n/**\n * This entity is a root level object. It represents a device. It is serialized in JSON and saved in the underlying icure-base CouchDB database.\n */\nimport { decodeStringOrArrayBuffer} from './ModelHelper'\nexport class Device {\n constructor(json: JSON | any) {\n Object.assign(this as Device, json, json.picture ? { picture: decodeStringOrArrayBuffer(json.picture) } : {})\n }\n\n id?: string\n rev?: string\n /**\n * hard delete (unix epoch in ms) timestamp of the object. Filled automatically when deletePatient is called.\n */\n deletionDate?: number\n identifiers?: Array<Identifier>\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 * 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 * 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 * 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 * Soft delete (unix epoch in ms) timestamp of the object.\n */\n endOfLife?: number\n /**\n * The id of the medical location where this entity was created.\n */\n medicalLocationId?: string\n externalId?: string\n name?: string\n type?: string\n brand?: string\n model?: string\n serialNumber?: string\n parentId?: string\n picture?: ArrayBuffer\n properties?: Array<PropertyStub>\n /**\n * For each couple of HcParties (delegator and delegate), this map contains the exchange AES key. The delegator is always this hcp, the key of the map is the id of the delegate.The AES exchange key is encrypted using RSA twice : once using this hcp public key (index 0 in the Array) and once using the other hcp public key (index 1 in the Array). For a pair of HcParties. Each HcParty always has one AES exchange key for himself.\n */\n hcPartyKeys?: { [key: string]: Array<string> }\n /**\n * Extra AES exchange keys, usually the ones we lost access to at some point. The structure is { publicKey: { delegateId: { myPubKey1: aesExKey_for_this, delegatePubKey1: aesExKey_for_delegate } } }\n */\n aesExchangeKeys?: { [key: string]: { [key: string]: { [key: string]: string } } }\n /**\n * Our private keys encrypted with our public keys. The structure is { publicKey1: { publicKey2: privateKey2_encrypted_with_publicKey1, publicKey3: privateKey3_encrypted_with_publicKey1 } }\n */\n transferKeys?: { [key: string]: { [key: string]: string } }\n /**\n * The privateKeyShamirPartitions are used to share this device private RSA key with a series of other hcParties using Shamir's algorithm. The key of the map is the hcp Id with whom this partition has been shared. The value is \\\"threshold⎮partition in hex\\\" encrypted using the the partition's holder's public RSA key\n */\n privateKeyShamirPartitions?: { [key: string]: string }\n /**\n * The public key of this device\n */\n publicKey?: string\n /**\n * The public keys of this actor that are generates using the OAEP Sha-256 standard\n */\n publicKeysForOaepWithSha256?: Array<string>\n}\n"]}
1
+ {"version":3,"file":"Device.js","sourceRoot":"","sources":["../../../icc-api/model/Device.ts"],"names":[],"mappings":";;;AAeA;;GAEG;AACH,+CAAyD;AACzD,MAAa,MAAM;IACjB,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAAc,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAA,uCAAyB,EAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IAC/G,CAAC;CA2EF;AA9ED,wBA8EC","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 { Identifier } from './Identifier'\nimport { PropertyStub } from './PropertyStub'\n\n/**\n * This entity is a root level object. It represents a device. It is serialized in JSON and saved in the underlying icure-base CouchDB database.\n */\nimport { decodeStringOrArrayBuffer } from './ModelHelper'\nexport class Device {\n constructor(json: JSON | any) {\n Object.assign(this as Device, json, json.picture ? { picture: decodeStringOrArrayBuffer(json.picture) } : {})\n }\n\n id?: string\n rev?: string\n /**\n * hard delete (unix epoch in ms) timestamp of the object. Filled automatically when deletePatient is called.\n */\n deletionDate?: number\n identifiers?: Array<Identifier>\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 * 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 * 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 * 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 * Soft delete (unix epoch in ms) timestamp of the object.\n */\n endOfLife?: number\n /**\n * The id of the medical location where this entity was created.\n */\n medicalLocationId?: string\n externalId?: string\n name?: string\n type?: string\n brand?: string\n model?: string\n serialNumber?: string\n parentId?: string\n picture?: ArrayBuffer\n properties?: Array<PropertyStub>\n /**\n * For each couple of HcParties (delegator and delegate), this map contains the exchange AES key. The delegator is always this hcp, the key of the map is the id of the delegate.The AES exchange key is encrypted using RSA twice : once using this hcp public key (index 0 in the Array) and once using the other hcp public key (index 1 in the Array). For a pair of HcParties. Each HcParty always has one AES exchange key for himself.\n */\n hcPartyKeys?: { [key: string]: Array<string> }\n /**\n * Extra AES exchange keys, usually the ones we lost access to at some point. The structure is { publicKey: { delegateId: { myPubKey1: aesExKey_for_this, delegatePubKey1: aesExKey_for_delegate } } }\n */\n aesExchangeKeys?: { [key: string]: { [key: string]: { [key: string]: string } } }\n /**\n * Our private keys encrypted with our public keys. The structure is { publicKey1: { publicKey2: privateKey2_encrypted_with_publicKey1, publicKey3: privateKey3_encrypted_with_publicKey1 } }\n */\n transferKeys?: { [key: string]: { [key: string]: string } }\n /**\n * The privateKeyShamirPartitions are used to share this device private RSA key with a series of other hcParties using Shamir's algorithm. The key of the map is the hcp Id with whom this partition has been shared. The value is \\\"threshold⎮partition in hex\\\" encrypted using the the partition's holder's public RSA key\n */\n privateKeyShamirPartitions?: { [key: string]: string }\n /**\n * The public key of this device\n */\n publicKey?: string\n /**\n * The public keys of this actor that are generates using the OAEP Sha-256 standard\n */\n publicKeysForOaepWithSha256?: Array<string>\n cryptoActorProperties?: Array<PropertyStub>\n}\n"]}
@@ -221,6 +221,7 @@ export declare class HealthcareParty {
221
221
  * The public keys of this actor that are generates using the OAEP Sha-256 standard
222
222
  */
223
223
  publicKeysForOaepWithSha256?: Array<string>;
224
+ cryptoActorProperties?: Array<PropertyStub>;
224
225
  }
225
226
  export declare namespace HealthcareParty {
226
227
  type GenderEnum = 'male' | 'female' | 'indeterminate' | 'changed' | 'changedToMale' | 'changedToFemale' | 'unknown';
@@ -1 +1 @@
1
- {"version":3,"file":"HealthcareParty.js","sourceRoot":"","sources":["../../../icc-api/model/HealthcareParty.ts"],"names":[],"mappings":";;;AAoBA;;GAEG;AACH,+CAAuC;AAEvC,MAAa,eAAe;IAC1B,YAAY,IAAgB;QAC1B,IAAI,WAAW,GAA8B,EAAE,CAAA;QAC/C,IAAI,CAAC,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,CAAA,EAAE,CAAC;YACpB,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;gBACrC,WAAW,CAAC,OAAO,GAAG,IAAA,qBAAO,EAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAC7C,CAAC;iBAAM,IAAI,IAAI,CAAC,OAAO,YAAY,WAAW,IAAI,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;gBACnF,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;YACpC,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,6BAA6B,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,CAAA;YACrE,CAAC;QACH,CAAC;QACD,MAAM,CAAC,MAAM,CAAC,IAAe,EAAE,IAAI,EAAE,WAAW,CAAC,CAAA;IACnD,CAAC;CAsLF;AAnMD,0CAmMC;AACD,WAAiB,eAAe;IAEjB,0BAAU,GAAG;QACxB,IAAI,EAAE,MAAoB;QAC1B,MAAM,EAAE,QAAsB;QAC9B,aAAa,EAAE,eAA6B;QAC5C,OAAO,EAAE,SAAuB;QAChC,aAAa,EAAE,eAA6B;QAC5C,eAAe,EAAE,iBAA+B;QAChD,OAAO,EAAE,SAAuB;KACjC,CAAA;IAEY,4BAAY,GAAG;QAC1B,OAAO,EAAE,SAAyB;QAClC,cAAc,EAAE,gBAAgC;QAChD,YAAY,EAAE,cAA8B;KAC7C,CAAA;AACH,CAAC,EAjBgB,eAAe,+BAAf,eAAe,QAiB/B","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 { Address } from './Address'\nimport { CodeStub } from './CodeStub'\nimport { FinancialInstitutionInformation } from './FinancialInstitutionInformation'\nimport { FlatRateTarification } from './FlatRateTarification'\nimport { HealthcarePartyHistoryStatus } from './HealthcarePartyHistoryStatus'\nimport { Identifier } from './Identifier'\nimport { PersonName } from './PersonName'\nimport { PropertyStub } from './PropertyStub'\n\n/**\n * This entity is a root level object. It represents a healthcare party. It is serialized in JSON and saved in the underlying icure-healthdata CouchDB database.\n */\nimport { b64_2ab } from './ModelHelper'\nimport { Patient } from './Patient'\nexport class HealthcareParty {\n constructor(json: JSON | any) {\n let pictureData: { picture?: ArrayBuffer } = {}\n if (!!json?.picture) {\n if (typeof json.picture === 'string') {\n pictureData.picture = b64_2ab(json.picture)\n } else if (json.picture instanceof ArrayBuffer || ArrayBuffer.isView(json.picture)) {\n pictureData.picture = json.picture\n } else {\n throw new Error(`Invalid type for picture: ${typeof json.picture}`)\n }\n }\n Object.assign(this as Patient, json, pictureData)\n }\n\n /**\n * the Id of the healthcare party. We encourage using either a v4 UUID or a HL7 Id.\n */\n id?: string\n /**\n * the revision of the healthcare party in the database, used for conflict management / optimistic locking.\n */\n rev?: string\n /**\n * creation timestamp of the object.\n */\n created?: number\n /**\n * last modification timestamp of the object.\n */\n modified?: number\n /**\n * hard delete (unix epoch in ms) timestamp of the object. Filled automatically when deletePatient is called.\n */\n deletionDate?: number\n /**\n * The healthcareparty's identifiers, used by the client to identify uniquely and unambiguously the HCP. However, iCure may not guarantee this uniqueness by itself : This should be done at the client side.\n */\n identifier?: Array<Identifier>\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 * 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 * The full name of the healthcare party, used mainly when the healthcare party is an organization\n */\n name?: string\n /**\n * the lastname (surname) of the healthcare party. This is the official lastname that should be used for official administrative purposes.\n */\n lastName?: string\n /**\n * the firstname (name) of the healthcare party.\n */\n firstName?: string\n /**\n * the list of all names of the healthcare party, also containing the official full name information. Ordered by preference of use. First element is therefore the official name used for the healthcare party in the application\n */\n names?: Array<PersonName>\n /**\n * the gender of the healthcare party: male, female, indeterminate, changed, changedToMale, changedToFemale, unknown\n */\n gender?: HealthcareParty.GenderEnum\n /**\n * Mr., Ms., Pr., Dr. ...\n */\n civility?: string\n /**\n * The name of the company this healthcare party is member of\n */\n companyName?: string\n /**\n * Medical specialty of the healthcare party\n */\n speciality?: string\n /**\n * Bank Account identifier of the healhtcare party, IBAN, deprecated, use financial institutions instead\n */\n bankAccount?: string\n /**\n * Bank Identifier Code, the SWIFT Address assigned to the bank, use financial institutions instead\n */\n bic?: string\n proxyBankAccount?: string\n proxyBic?: string\n /**\n * All details included in the invoice header\n */\n invoiceHeader?: string\n /**\n * Identifier number for institution type if the healthcare party is an enterprise\n */\n cbe?: string\n /**\n * Identifier number for the institution if the healthcare party is an organization\n */\n ehp?: string\n /**\n * The id of the user that usually handles this healthcare party.\n */\n userId?: string\n /**\n * Id of parent of the user representing the healthcare party.\n */\n parentId?: string\n convention?: number\n /**\n * National Institute for Health and Invalidity Insurance number assigned to healthcare parties (institution or person).\n */\n nihii?: string\n nihiiSpecCode?: string\n /**\n * Social security inscription number.\n */\n ssin?: string\n /**\n * The list of addresses (with address type).\n */\n addresses?: Array<Address>\n /**\n * The list of languages spoken by the patient ordered by fluency (alpha-2 code http://www.loc.gov/standards/iso639-2/ascii_8bits.html).\n */\n languages?: Array<string>\n /**\n * A picture usually saved in JPEG format.\n */\n picture?: ArrayBuffer\n /**\n * The healthcare party's status: 'trainee' or 'withconvention' or 'accredited'\n */\n statuses?: Array<HealthcareParty.StatusesEnum>\n /**\n * The healthcare party's status history\n */\n statusHistory?: Array<HealthcarePartyHistoryStatus>\n /**\n * Medical specialty of the healthcare party codified using FHIR or Kmehr codificaiton scheme\n */\n specialityCodes?: Array<CodeStub>\n /**\n * The type of format for contacting the healthcare party, ex: mobile, phone, email, etc.\n */\n sendFormats?: { [key: string]: string }\n /**\n * Text notes.\n */\n notes?: string\n /**\n * List of financial information (Bank, bank account).\n */\n financialInstitutionInformation?: Array<FinancialInstitutionInformation>\n /**\n * A description of the HCP, meant for the public and in multiple languages.\n */\n descr?: { [key: string]: string }\n /**\n * The invoicing scheme this healthcare party adheres to : 'service fee' or 'flat rate'\n */\n billingType?: string\n type?: string\n contactPerson?: string\n contactPersonHcpId?: string\n supervisorId?: string\n flatRateTarifications?: Array<FlatRateTarification>\n importedData?: { [key: string]: string }\n options?: { [key: string]: string }\n properties?: Array<PropertyStub>\n /**\n * For each couple of HcParties (delegator and delegate), this map contains the exchange AES key. The delegator is always this hcp, the key of the map is the id of the delegate.The AES exchange key is encrypted using RSA twice : once using this hcp public key (index 0 in the Array) and once using the other hcp public key (index 1 in the Array). For a pair of HcParties. Each HcParty always has one AES exchange key for himself.\n */\n hcPartyKeys?: { [key: string]: Array<string> }\n /**\n * Extra AES exchange keys, usually the ones we lost access to at some point. The structure is { publicKey: { delegateId: { myPubKey1: aesExKey_for_this, delegatePubKey1: aesExKey_for_delegate } } }\n */\n aesExchangeKeys?: { [key: string]: { [key: string]: { [key: string]: string } } }\n /**\n * Our private keys encrypted with our public keys. The structure is { publicKey1: { publicKey2: privateKey2_encrypted_with_publicKey1, publicKey3: privateKey3_encrypted_with_publicKey1 } }\n */\n transferKeys?: { [key: string]: { [key: string]: string } }\n /**\n * The privateKeyShamirPartitions are used to share this hcp's private RSA key with a series of other hcParties using Shamir's algorithm. The key of the map is the hcp Id with whom this partition has been shared. The value is \\\"threshold⎮partition in hex\\\" encrypted using the the partition's holder's public RSA key\n */\n privateKeyShamirPartitions?: { [key: string]: string }\n /**\n * The public key of this hcp\n */\n publicKey?: string\n /**\n * The public keys of this actor that are generates using the OAEP Sha-256 standard\n */\n publicKeysForOaepWithSha256?: Array<string>\n}\nexport namespace HealthcareParty {\n export type GenderEnum = 'male' | 'female' | 'indeterminate' | 'changed' | 'changedToMale' | 'changedToFemale' | 'unknown'\n export const GenderEnum = {\n Male: 'male' as GenderEnum,\n Female: 'female' as GenderEnum,\n Indeterminate: 'indeterminate' as GenderEnum,\n Changed: 'changed' as GenderEnum,\n ChangedToMale: 'changedToMale' as GenderEnum,\n ChangedToFemale: 'changedToFemale' as GenderEnum,\n Unknown: 'unknown' as GenderEnum,\n }\n export type StatusesEnum = 'trainee' | 'withconvention' | 'accreditated'\n export const StatusesEnum = {\n Trainee: 'trainee' as StatusesEnum,\n Withconvention: 'withconvention' as StatusesEnum,\n Accreditated: 'accreditated' as StatusesEnum,\n }\n}\n"]}
1
+ {"version":3,"file":"HealthcareParty.js","sourceRoot":"","sources":["../../../icc-api/model/HealthcareParty.ts"],"names":[],"mappings":";;;AAoBA;;GAEG;AACH,+CAAuC;AAEvC,MAAa,eAAe;IAC1B,YAAY,IAAgB;QAC1B,IAAI,WAAW,GAA8B,EAAE,CAAA;QAC/C,IAAI,CAAC,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,CAAA,EAAE,CAAC;YACpB,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;gBACrC,WAAW,CAAC,OAAO,GAAG,IAAA,qBAAO,EAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAC7C,CAAC;iBAAM,IAAI,IAAI,CAAC,OAAO,YAAY,WAAW,IAAI,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;gBACnF,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;YACpC,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,6BAA6B,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,CAAA;YACrE,CAAC;QACH,CAAC;QACD,MAAM,CAAC,MAAM,CAAC,IAAe,EAAE,IAAI,EAAE,WAAW,CAAC,CAAA;IACnD,CAAC;CAuLF;AApMD,0CAoMC;AACD,WAAiB,eAAe;IAEjB,0BAAU,GAAG;QACxB,IAAI,EAAE,MAAoB;QAC1B,MAAM,EAAE,QAAsB;QAC9B,aAAa,EAAE,eAA6B;QAC5C,OAAO,EAAE,SAAuB;QAChC,aAAa,EAAE,eAA6B;QAC5C,eAAe,EAAE,iBAA+B;QAChD,OAAO,EAAE,SAAuB;KACjC,CAAA;IAEY,4BAAY,GAAG;QAC1B,OAAO,EAAE,SAAyB;QAClC,cAAc,EAAE,gBAAgC;QAChD,YAAY,EAAE,cAA8B;KAC7C,CAAA;AACH,CAAC,EAjBgB,eAAe,+BAAf,eAAe,QAiB/B","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 { Address } from './Address'\nimport { CodeStub } from './CodeStub'\nimport { FinancialInstitutionInformation } from './FinancialInstitutionInformation'\nimport { FlatRateTarification } from './FlatRateTarification'\nimport { HealthcarePartyHistoryStatus } from './HealthcarePartyHistoryStatus'\nimport { Identifier } from './Identifier'\nimport { PersonName } from './PersonName'\nimport { PropertyStub } from './PropertyStub'\n\n/**\n * This entity is a root level object. It represents a healthcare party. It is serialized in JSON and saved in the underlying icure-healthdata CouchDB database.\n */\nimport { b64_2ab } from './ModelHelper'\nimport { Patient } from './Patient'\nexport class HealthcareParty {\n constructor(json: JSON | any) {\n let pictureData: { picture?: ArrayBuffer } = {}\n if (!!json?.picture) {\n if (typeof json.picture === 'string') {\n pictureData.picture = b64_2ab(json.picture)\n } else if (json.picture instanceof ArrayBuffer || ArrayBuffer.isView(json.picture)) {\n pictureData.picture = json.picture\n } else {\n throw new Error(`Invalid type for picture: ${typeof json.picture}`)\n }\n }\n Object.assign(this as Patient, json, pictureData)\n }\n\n /**\n * the Id of the healthcare party. We encourage using either a v4 UUID or a HL7 Id.\n */\n id?: string\n /**\n * the revision of the healthcare party in the database, used for conflict management / optimistic locking.\n */\n rev?: string\n /**\n * creation timestamp of the object.\n */\n created?: number\n /**\n * last modification timestamp of the object.\n */\n modified?: number\n /**\n * hard delete (unix epoch in ms) timestamp of the object. Filled automatically when deletePatient is called.\n */\n deletionDate?: number\n /**\n * The healthcareparty's identifiers, used by the client to identify uniquely and unambiguously the HCP. However, iCure may not guarantee this uniqueness by itself : This should be done at the client side.\n */\n identifier?: Array<Identifier>\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 * 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 * The full name of the healthcare party, used mainly when the healthcare party is an organization\n */\n name?: string\n /**\n * the lastname (surname) of the healthcare party. This is the official lastname that should be used for official administrative purposes.\n */\n lastName?: string\n /**\n * the firstname (name) of the healthcare party.\n */\n firstName?: string\n /**\n * the list of all names of the healthcare party, also containing the official full name information. Ordered by preference of use. First element is therefore the official name used for the healthcare party in the application\n */\n names?: Array<PersonName>\n /**\n * the gender of the healthcare party: male, female, indeterminate, changed, changedToMale, changedToFemale, unknown\n */\n gender?: HealthcareParty.GenderEnum\n /**\n * Mr., Ms., Pr., Dr. ...\n */\n civility?: string\n /**\n * The name of the company this healthcare party is member of\n */\n companyName?: string\n /**\n * Medical specialty of the healthcare party\n */\n speciality?: string\n /**\n * Bank Account identifier of the healhtcare party, IBAN, deprecated, use financial institutions instead\n */\n bankAccount?: string\n /**\n * Bank Identifier Code, the SWIFT Address assigned to the bank, use financial institutions instead\n */\n bic?: string\n proxyBankAccount?: string\n proxyBic?: string\n /**\n * All details included in the invoice header\n */\n invoiceHeader?: string\n /**\n * Identifier number for institution type if the healthcare party is an enterprise\n */\n cbe?: string\n /**\n * Identifier number for the institution if the healthcare party is an organization\n */\n ehp?: string\n /**\n * The id of the user that usually handles this healthcare party.\n */\n userId?: string\n /**\n * Id of parent of the user representing the healthcare party.\n */\n parentId?: string\n convention?: number\n /**\n * National Institute for Health and Invalidity Insurance number assigned to healthcare parties (institution or person).\n */\n nihii?: string\n nihiiSpecCode?: string\n /**\n * Social security inscription number.\n */\n ssin?: string\n /**\n * The list of addresses (with address type).\n */\n addresses?: Array<Address>\n /**\n * The list of languages spoken by the patient ordered by fluency (alpha-2 code http://www.loc.gov/standards/iso639-2/ascii_8bits.html).\n */\n languages?: Array<string>\n /**\n * A picture usually saved in JPEG format.\n */\n picture?: ArrayBuffer\n /**\n * The healthcare party's status: 'trainee' or 'withconvention' or 'accredited'\n */\n statuses?: Array<HealthcareParty.StatusesEnum>\n /**\n * The healthcare party's status history\n */\n statusHistory?: Array<HealthcarePartyHistoryStatus>\n /**\n * Medical specialty of the healthcare party codified using FHIR or Kmehr codificaiton scheme\n */\n specialityCodes?: Array<CodeStub>\n /**\n * The type of format for contacting the healthcare party, ex: mobile, phone, email, etc.\n */\n sendFormats?: { [key: string]: string }\n /**\n * Text notes.\n */\n notes?: string\n /**\n * List of financial information (Bank, bank account).\n */\n financialInstitutionInformation?: Array<FinancialInstitutionInformation>\n /**\n * A description of the HCP, meant for the public and in multiple languages.\n */\n descr?: { [key: string]: string }\n /**\n * The invoicing scheme this healthcare party adheres to : 'service fee' or 'flat rate'\n */\n billingType?: string\n type?: string\n contactPerson?: string\n contactPersonHcpId?: string\n supervisorId?: string\n flatRateTarifications?: Array<FlatRateTarification>\n importedData?: { [key: string]: string }\n options?: { [key: string]: string }\n properties?: Array<PropertyStub>\n /**\n * For each couple of HcParties (delegator and delegate), this map contains the exchange AES key. The delegator is always this hcp, the key of the map is the id of the delegate.The AES exchange key is encrypted using RSA twice : once using this hcp public key (index 0 in the Array) and once using the other hcp public key (index 1 in the Array). For a pair of HcParties. Each HcParty always has one AES exchange key for himself.\n */\n hcPartyKeys?: { [key: string]: Array<string> }\n /**\n * Extra AES exchange keys, usually the ones we lost access to at some point. The structure is { publicKey: { delegateId: { myPubKey1: aesExKey_for_this, delegatePubKey1: aesExKey_for_delegate } } }\n */\n aesExchangeKeys?: { [key: string]: { [key: string]: { [key: string]: string } } }\n /**\n * Our private keys encrypted with our public keys. The structure is { publicKey1: { publicKey2: privateKey2_encrypted_with_publicKey1, publicKey3: privateKey3_encrypted_with_publicKey1 } }\n */\n transferKeys?: { [key: string]: { [key: string]: string } }\n /**\n * The privateKeyShamirPartitions are used to share this hcp's private RSA key with a series of other hcParties using Shamir's algorithm. The key of the map is the hcp Id with whom this partition has been shared. The value is \\\"threshold⎮partition in hex\\\" encrypted using the the partition's holder's public RSA key\n */\n privateKeyShamirPartitions?: { [key: string]: string }\n /**\n * The public key of this hcp\n */\n publicKey?: string\n /**\n * The public keys of this actor that are generates using the OAEP Sha-256 standard\n */\n publicKeysForOaepWithSha256?: Array<string>\n cryptoActorProperties?: Array<PropertyStub>\n}\nexport namespace HealthcareParty {\n export type GenderEnum = 'male' | 'female' | 'indeterminate' | 'changed' | 'changedToMale' | 'changedToFemale' | 'unknown'\n export const GenderEnum = {\n Male: 'male' as GenderEnum,\n Female: 'female' as GenderEnum,\n Indeterminate: 'indeterminate' as GenderEnum,\n Changed: 'changed' as GenderEnum,\n ChangedToMale: 'changedToMale' as GenderEnum,\n ChangedToFemale: 'changedToFemale' as GenderEnum,\n Unknown: 'unknown' as GenderEnum,\n }\n export type StatusesEnum = 'trainee' | 'withconvention' | 'accreditated'\n export const StatusesEnum = {\n Trainee: 'trainee' as StatusesEnum,\n Withconvention: 'withconvention' as StatusesEnum,\n Accreditated: 'accreditated' as StatusesEnum,\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  export declare function ua2string(_ua: Uint8Array | ArrayBuffer): string;
2
2
  export declare function string2ua(s: string): Uint8Array;
3
3
  export declare function string2ab(s: string): ArrayBuffer;
4
- export declare function ua2ab(ua: Uint8Array): ArrayBuffer;
4
+ export declare function ua2ab(ua: ArrayBuffer | Uint8Array): ArrayBuffer;
5
5
  export declare function decodeStringOrArrayBuffer(value: string | ArrayBuffer): ArrayBuffer;
6
6
  export declare function b64_2ab(s: string): ArrayBuffer;
7
7
  export declare function b64_2ua(s: string): Uint8Array;
@@ -33,9 +33,22 @@ function string2ua(s) {
33
33
  function string2ab(s) {
34
34
  return ua2ab(string2ua(s));
35
35
  }
36
+ // Get an array buffer matching the content of the input, copying only when necessary
36
37
  function ua2ab(ua) {
37
- const buffer = ua.buffer;
38
- return (buffer.byteLength > ua.byteLength ? buffer.slice(0, ua.byteLength) : buffer);
38
+ if (ua instanceof ArrayBuffer)
39
+ return ua;
40
+ const { buffer, byteOffset, byteLength } = ua;
41
+ if (buffer instanceof ArrayBuffer) {
42
+ if (byteOffset === 0 && byteLength === buffer.byteLength) {
43
+ // zero-copy fast path
44
+ return buffer;
45
+ }
46
+ return buffer.slice(byteOffset, byteOffset + byteLength);
47
+ }
48
+ // buffer is SharedArrayBuffer → must copy
49
+ const copy = new Uint8Array(byteLength);
50
+ copy.set(ua);
51
+ return copy.buffer;
39
52
  }
40
53
  function decodeStringOrArrayBuffer(value) {
41
54
  if (typeof value === 'string') {
@@ -1 +1 @@
1
- {"version":3,"file":"ModelHelper.js","sourceRoot":"","sources":["../../../icc-api/model/ModelHelper.ts"],"names":[],"mappings":";;AAAA,8BAYC;AAED,8BAMC;AAED,8BAEC;AAED,sBAGC;AAED,8DAQC;AAED,0BAEC;AAED,0BAEC;AAED,wBAEC;AAED,kBAoBC;AAED,kBAqBC;AAhGD,SAAgB,SAAS,CAAC,GAA6B;IACrD,IAAI,GAAG,GAAG,EAAE,CAAA;IACZ,MAAM,EAAE,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAA;IAC9B,MAAM,KAAK,GAAG,EAAE,CAAC,MAAM,CAAA;IACvB,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACjC,IAAI,MAAM,EAAE,GAAG,EAAE,KAAK,CAAA;IACtB,KAAK,MAAM,GAAG,CAA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AAA;QAChB,CAAC;IACH,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;AAC9C,CAAC;AAED,SAAgB,GAAG,CAAC,CAAS;IAC3B,MAAM,eAAe,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAC/D,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,wBAAwB;QACxB,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;YAChC,OAAO,IAAI,CAAC,eAAe,CAAC,CAAA;QAC9B,CAAC;QACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,MAAM,GAAG,GAAG,IAAI,MAAM,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAA;YACjD,OAAO,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;QAC/B,CAAC;IACH,CAAC;SAAM,CAAC;QACN,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,MAAM,GAAG,GAAG,IAAI,MAAM,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAA;YACjD,OAAO,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;QAC/B,CAAC;QACD,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;YAChC,OAAO,IAAI,CAAC,eAAe,CAAC,CAAA;QAC9B,CAAC;IACH,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;AAC9C,CAAC","sourcesContent":["export function ua2string(_ua: Uint8Array | ArrayBuffer): string {\n let str = ''\n const ab = new Uint8Array(_ua)\n const abLen = ab.length\n const CHUNK_SIZE = Math.pow(2, 8)\n let offset, len, subab\n for (offset = 0; offset < abLen; offset += CHUNK_SIZE) {\n len = Math.min(CHUNK_SIZE, abLen - offset)\n subab = ab.subarray(offset, offset + len)\n str += String.fromCharCode.apply(null, subab as any)\n }\n return str\n}\n\nexport function string2ua(s: string): Uint8Array {\n const ua = new Uint8Array(s.length)\n for (let i = 0; i < s.length; i++) {\n ua[i] = s.charCodeAt(i) & 0xff\n }\n return ua\n}\n\nexport function string2ab(s: string): ArrayBuffer {\n return ua2ab(string2ua(s))\n}\n\nexport function ua2ab(ua: Uint8Array): ArrayBuffer {\n const buffer = ua.buffer\n return (buffer.byteLength > ua.byteLength ? buffer.slice(0, ua.byteLength) : buffer) as ArrayBuffer\n}\n\nexport function decodeStringOrArrayBuffer(value: string | ArrayBuffer): ArrayBuffer {\n if (typeof value === 'string') {\n return b64_2ab(value)\n } else if (value instanceof ArrayBuffer || ArrayBuffer.isView(value)) {\n return value as ArrayBuffer\n } else {\n throw new Error(`Invalid type : ${typeof value}`)\n }\n}\n\nexport function b64_2ab(s: string): ArrayBuffer {\n return ua2ab(string2ua(a2b(s)))\n}\n\nexport function b64_2ua(s: string): Uint8Array {\n return string2ua(a2b(s))\n}\n\nexport function ua2b64(_ua: Uint8Array | ArrayBuffer): string {\n return b2a(ua2string(_ua))\n}\n\nexport function b2a(a: string): string {\n if (typeof window !== 'undefined') {\n //Favour btoa in browser\n if (typeof btoa !== 'undefined') {\n return btoa(a)\n }\n if (typeof Buffer !== 'undefined') {\n const buf = Buffer.from(a, 'latin1')\n return buf.toString('base64')\n }\n } else {\n if (typeof Buffer !== 'undefined') {\n const buf = Buffer.from(a, 'latin1')\n return buf.toString('base64')\n }\n if (typeof btoa !== 'undefined') {\n return btoa(a)\n }\n }\n throw new Error('Unsupported operation b2a')\n}\n\nexport function a2b(s: string): string {\n const urlUnsafeString = s.replace(/_/g, '/').replace(/-/g, '+')\n if (typeof window !== 'undefined') {\n //Favour atob in browser\n if (typeof atob !== 'undefined') {\n return atob(urlUnsafeString)\n }\n if (typeof Buffer !== 'undefined') {\n const buf = new Buffer(urlUnsafeString, 'base64')\n return buf.toString('latin1')\n }\n } else {\n if (typeof Buffer !== 'undefined') {\n const buf = new Buffer(urlUnsafeString, 'base64')\n return buf.toString('latin1')\n }\n if (typeof atob !== 'undefined') {\n return atob(urlUnsafeString)\n }\n }\n throw new Error('Unsupported operation a2b')\n}\n"]}
1
+ {"version":3,"file":"ModelHelper.js","sourceRoot":"","sources":["../../../icc-api/model/ModelHelper.ts"],"names":[],"mappings":";;AAEA,8BAYC;AAED,8BAMC;AAED,8BAEC;AAGD,sBAiBC;AAED,8DAQC;AAED,0BAEC;AAED,0BAEC;AAED,wBAEC;AAED,kBAoBC;AAED,kBAqBC;AA/GD,SAAgB,SAAS,CAAC,GAA6B;IACrD,IAAI,GAAG,GAAG,EAAE,CAAA;IACZ,MAAM,EAAE,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAA;IAC9B,MAAM,KAAK,GAAG,EAAE,CAAC,MAAM,CAAA;IACvB,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACjC,IAAI,MAAM,EAAE,GAAG,EAAE,KAAK,CAAA;IACtB,KAAK,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,CAAC;QACtD,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,GAAG,MAAM,CAAC,CAAA;QAC1C,KAAK,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,CAAA;QACzC,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,KAAY,CAAC,CAAA;IACtD,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,SAAgB,SAAS,CAAC,CAAS;IACjC,MAAM,EAAE,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QA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C,CAAA;IAC/D,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,wBAAwB;QACxB,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;YAChC,OAAO,IAAI,CAAC,eAAe,CAAC,CAAA;QAC9B,CAAC;QACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,MAAM,GAAG,GAAG,IAAI,MAAM,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAA;YACjD,OAAO,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;QAC/B,CAAC;IACH,CAAC;SAAM,CAAC;QACN,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,MAAM,GAAG,GAAG,IAAI,MAAM,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAA;YACjD,OAAO,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;QAC/B,CAAC;QACD,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;YAChC,OAAO,IAAI,CAAC,eAAe,CAAC,CAAA;QAC9B,CAAC;IACH,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;AAC9C,CAAC","sourcesContent":["import { readUInt24BE } from 'rsocket-core'\n\nexport function ua2string(_ua: Uint8Array | ArrayBuffer): string {\n let str = ''\n const ab = new Uint8Array(_ua)\n const abLen = ab.length\n const CHUNK_SIZE = Math.pow(2, 8)\n let offset, len, subab\n for (offset = 0; offset < abLen; offset += CHUNK_SIZE) {\n len = Math.min(CHUNK_SIZE, abLen - offset)\n subab = ab.subarray(offset, offset + len)\n str += String.fromCharCode.apply(null, subab as any)\n }\n return str\n}\n\nexport function string2ua(s: string): Uint8Array {\n const ua = new Uint8Array(s.length)\n for (let i = 0; i < s.length; i++) {\n ua[i] = s.charCodeAt(i) & 0xff\n }\n return ua\n}\n\nexport function string2ab(s: string): ArrayBuffer {\n return ua2ab(string2ua(s))\n}\n\n// Get an array buffer matching the content of the input, copying only when necessary\nexport function ua2ab(ua: ArrayBuffer | Uint8Array): ArrayBuffer {\n if (ua instanceof ArrayBuffer) return ua\n const { buffer, byteOffset, byteLength } = ua\n\n if (buffer instanceof ArrayBuffer) {\n if (byteOffset === 0 && byteLength === buffer.byteLength) {\n // zero-copy fast path\n return buffer\n }\n\n return buffer.slice(byteOffset, byteOffset + byteLength)\n }\n\n // buffer is SharedArrayBuffer → must copy\n const copy = new Uint8Array(byteLength)\n copy.set(ua)\n return copy.buffer\n}\n\nexport function decodeStringOrArrayBuffer(value: string | ArrayBuffer): ArrayBuffer {\n if (typeof value === 'string') {\n return b64_2ab(value)\n } else if (value instanceof ArrayBuffer || ArrayBuffer.isView(value)) {\n return value as ArrayBuffer\n } else {\n throw new Error(`Invalid type : ${typeof value}`)\n }\n}\n\nexport function b64_2ab(s: string): ArrayBuffer {\n return ua2ab(string2ua(a2b(s)))\n}\n\nexport function b64_2ua(s: string): Uint8Array {\n return string2ua(a2b(s))\n}\n\nexport function ua2b64(_ua: Uint8Array | ArrayBuffer): string {\n return b2a(ua2string(_ua))\n}\n\nexport function b2a(a: string): string {\n if (typeof window !== 'undefined') {\n //Favour btoa in browser\n if (typeof btoa !== 'undefined') {\n return btoa(a)\n }\n if (typeof Buffer !== 'undefined') {\n const buf = Buffer.from(a, 'latin1')\n return buf.toString('base64')\n }\n } else {\n if (typeof Buffer !== 'undefined') {\n const buf = Buffer.from(a, 'latin1')\n return buf.toString('base64')\n }\n if (typeof btoa !== 'undefined') {\n return btoa(a)\n }\n }\n throw new Error('Unsupported operation b2a')\n}\n\nexport function a2b(s: string): string {\n const urlUnsafeString = s.replace(/_/g, '/').replace(/-/g, '+')\n if (typeof window !== 'undefined') {\n //Favour atob in browser\n if (typeof atob !== 'undefined') {\n return atob(urlUnsafeString)\n }\n if (typeof Buffer !== 'undefined') {\n const buf = new Buffer(urlUnsafeString, 'base64')\n return buf.toString('latin1')\n }\n } else {\n if (typeof Buffer !== 'undefined') {\n const buf = new Buffer(urlUnsafeString, 'base64')\n return buf.toString('latin1')\n }\n if (typeof atob !== 'undefined') {\n return atob(urlUnsafeString)\n }\n }\n throw new Error('Unsupported operation a2b')\n}\n"]}
@@ -332,6 +332,7 @@ export declare class Patient {
332
332
  employementInfos?: Array<EmploymentInfo>;
333
333
  securityMetadata?: SecurityMetadata;
334
334
  parentId?: never;
335
+ cryptoActorProperties?: Array<PropertyStub>;
335
336
  }
336
337
  export declare namespace Patient {
337
338
  type GenderEnum = 'male' | 'female' | 'indeterminate' | 'changed' | 'changedToMale' | 'changedToFemale' | 'unknown';
@@ -1 +1 @@
1
- {"version":3,"file":"Patient.js","sourceRoot":"","sources":["../../../icc-api/model/Patient.ts"],"names":[],"mappings":";;;AA0BA;;GAEG;AACH,+CAAyD;AAGzD,MAAa,OAAO;IAClB,YAAY,IAAgB;QAC1B,IAAI,WAAW,GAA8B,EAAE,CAAA;QAC/C,IAAI,CAAC,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,CAAA,EAAE,CAAC;YACpB,WAAW,CAAC,OAAO,GAAG,IAAA,uCAAyB,EAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/D,CAAC;QACD,MAAM,CAAC,MAAM,CAAC,IAAe,EAAE,IAAI,EAAE,WAAW,CAAC,CAAA;IACnD,CAAC;CA8RF;AArSD,0BAqSC;AACD,WAAiB,OAAO;IAET,kBAAU,GAAG;QACxB,IAAI,EAAE,MAAoB;QAC1B,MAAM,EAAE,QAAsB;QAC9B,aAAa,EAAE,eAA6B;QAC5C,OAAO,EAAE,SAAuB;QAChC,aAAa,EAAE,eAA6B;QAC5C,eAAe,EAAE,iBAA+B;QAChD,OAAO,EAAE,SAAuB;KACjC,CAAA;IAEY,oBAAY,GAAG;QAC1B,IAAI,EAAE,MAAsB;QAC5B,MAAM,EAAE,QAAwB;QAChC,aAAa,EAAE,eAA+B;QAC9C,OAAO,EAAE,SAAyB;QAClC,aAAa,EAAE,eAA+B;QAC9C,eAAe,EAAE,iBAAiC;QAClD,OAAO,EAAE,SAAyB;KACnC,CAAA;IAEY,8BAAsB,GAAG;QACpC,QAAQ,EAAE,UAAoC;QAC9C,KAAK,EAAE,OAAiC;QACxC,WAAW,EAAE,cAAwC;QACrD,aAAa,EAAE,gBAA0C;QACzD,OAAO,EAAE,SAAmC;QAC5C,SAAS,EAAE,YAAsC;QACjD,OAAO,EAAE,SAAmC;QAC5C,IAAI,EAAE,MAAgC;KACvC,CAAA;IAgBY,0BAAkB,GAAG;QAChC,MAAM,EAAE,QAA8B;QACtC,QAAQ,EAAE,WAAiC;QAC3C,OAAO,EAAE,SAA+B;QACxC,SAAS,EAAE,WAAiC;QAC5C,QAAQ,EAAE,UAAgC;QAC1C,SAAS,EAAE,WAAiC;QAC5C,OAAO,EAAE,SAA+B;QACxC,OAAO,EAAE,SAA+B;QACxC,WAAW,EAAE,aAAmC;QAChD,OAAO,EAAE,SAA+B;QACxC,QAAQ,EAAE,UAAgC;QAC1C,KAAK,EAAE,OAA6B;QACpC,QAAQ,EAAE,UAAgC;QAC1C,UAAU,EAAE,YAAkC;KAC/C,CAAA;AACH,CAAC,EA/DgB,OAAO,uBAAP,OAAO,QA+DvB","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 { Address } from './Address'\nimport { CodeStub } from './CodeStub'\nimport { Delegation } from './Delegation'\nimport { EmploymentInfo } from './EmploymentInfo'\nimport { FinancialInstitutionInformation } from './FinancialInstitutionInformation'\nimport { Identifier } from './Identifier'\nimport { Insurability } from './Insurability'\nimport { MedicalHouseContract } from './MedicalHouseContract'\nimport { Partnership } from './Partnership'\nimport { PatientHealthCareParty } from './PatientHealthCareParty'\nimport { PersonName } from './PersonName'\nimport { PropertyStub } from './PropertyStub'\nimport { SchoolingInfo } from './SchoolingInfo'\nimport { Annotation } from './Annotation'\n\n/**\n * This entity is a root level object. It represents a patient It is serialized in JSON and saved in the underlying icure-patient CouchDB database.\n */\nimport { decodeStringOrArrayBuffer } from './ModelHelper'\nimport { SecurityMetadata } from './SecurityMetadata'\n\nexport class Patient {\n constructor(json: JSON | any) {\n let pictureData: { picture?: ArrayBuffer } = {}\n if (!!json?.picture) {\n pictureData.picture = decodeStringOrArrayBuffer(json.picture)\n }\n Object.assign(this as Patient, json, pictureData)\n }\n\n /**\n * the Id of the patient. We encourage using either a v4 UUID or a HL7 Id.\n */\n id?: string\n /**\n * the revision of the patient in the database, used for conflict management / optimistic locking.\n */\n rev?: string\n identifier?: Array<Identifier>\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 * 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 * 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 * 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 * Soft delete (unix epoch in ms) timestamp of the object.\n */\n endOfLife?: number\n /**\n * hard delete (unix epoch in ms) timestamp of the object. Filled automatically when deletePatient is called.\n */\n deletionDate?: number\n /**\n * the firstname (name) of the patient.\n */\n firstName?: string\n /**\n * the lastname (surname) of the patient. This is the official lastname that should be used for official administrative purposes.\n */\n lastName?: string\n /**\n * the list of all names of the patient, also containing the official full name information. Ordered by preference of use. First element is therefore the official name used for the patient in the application\n */\n names?: Array<PersonName>\n /**\n * the name of the company this patient is member of.\n */\n companyName?: string\n /**\n * the list of languages spoken by the patient ordered by fluency (alpha-2 code http://www.loc.gov/standards/iso639-2/ascii_8bits.html).\n */\n languages?: Array<string>\n /**\n * the list of addresses (with address type).\n */\n addresses?: Array<Address>\n /**\n * Mr., Ms., Pr., Dr. ...\n */\n civility?: string\n /**\n * the gender of the patient: male, female, indeterminate, changed, changedToMale, changedToFemale, unknown\n */\n gender?: Patient.GenderEnum\n /**\n * the birth sex of the patient: male, female, indeterminate, unknown\n */\n birthSex?: Patient.BirthSexEnum\n /**\n * The id of the patient this patient has been merged with.\n */\n mergeToPatientId?: string\n /**\n * The ids of the patients that have been merged inside this patient.\n */\n mergedIds?: Array<string>\n /**\n * An alias of the person, nickname, ...\n */\n alias?: string\n /**\n * Is the patient active (boolean).\n */\n active?: boolean\n /**\n * When not active, the reason for deactivation.\n */\n deactivationReason?: Patient.DeactivationReasonEnum\n /**\n * Deactivation date of the patient\n */\n deactivationDate?: number\n /**\n * Social security inscription number.\n */\n ssin?: string\n /**\n * Lastname at birth (can be different of the current name), depending on the country, must be used to design the patient .\n */\n maidenName?: string\n /**\n * Lastname of the spouse for a married woman, depending on the country, can be used to design the patient.\n */\n spouseName?: string\n /**\n * Lastname of the partner, should not be used to design the patient.\n */\n partnerName?: string\n /**\n * any of `single`, `in_couple`, `married`, `separated`, `divorced`, `divorcing`, `widowed`, `widower`, `complicated`, `unknown`, `contract`, `other`.\n */\n personalStatus?: Patient.PersonalStatusEnum\n /**\n * The birthdate encoded as a fuzzy date on 8 positions (YYYYMMDD) MM and/or DD can be set to 00 if unknown (19740000 is a valid date).\n */\n dateOfBirth?: number\n /**\n * The date of death encoded as a fuzzy date on 8 positions (YYYYMMDD) MM and/or DD can be set to 00 if unknown (19740000 is a valid date).\n */\n dateOfDeath?: number\n /**\n * Timestamp of the latest validation of the eID of the person..\n */\n timestampOfLatestEidReading?: number\n /**\n * The place of birth.\n */\n placeOfBirth?: string\n /**\n * The place of death.\n */\n placeOfDeath?: string\n /**\n * Is the patient deceased.\n */\n deceased?: boolean\n /**\n * The level of education (college degree, undergraduate, phd).\n */\n education?: string\n /**\n * The current professional activity.\n */\n profession?: string\n /**\n * A text note (can be confidential, encrypted by default).\n * @deprecated use notes instead with proper tags\n */\n note?: string\n /**\n * An administrative note, not confidential.\n * @deprecated use notes instead with proper tags\n */\n administrativeNote?: string\n /**\n * A list of localized notes.\n */\n notes?: Annotation[]\n /**\n * The nationality of the patient.\n */\n nationality?: string\n /**\n * The race of the patient.\n */\n race?: string\n /**\n * The ethnicity of the patient.\n */\n ethnicity?: string\n /**\n * The id of the user that usually handles this patient.\n */\n preferredUserId?: string\n /**\n * A picture usually saved in JPEG format.\n */\n picture?: ArrayBuffer\n /**\n * An external (from another source) id with no guarantee or requirement for unicity .\n */\n externalId?: string\n /**\n * List of insurance coverages (of class Insurability, see below).\n */\n insurabilities?: Array<Insurability>\n /**\n * List of partners, or persons of contact (of class Partnership, see below).\n */\n partnerships?: Array<Partnership>\n /**\n * Links (usually for therapeutic reasons) between this patient and healthcare parties (of class PatientHealthcareParty).\n */\n patientHealthCareParties?: Array<PatientHealthCareParty>\n /**\n * Financial information (Bank, bank account) used to reimburse the patient.\n */\n financialInstitutionInformation?: Array<FinancialInstitutionInformation>\n /**\n * Contracts between the patient and the healthcare entity.\n */\n medicalHouseContracts?: Array<MedicalHouseContract>\n /**\n * Codified list of professions exercised by this patient.\n */\n patientProfessions?: Array<CodeStub>\n /**\n * Extra parameters\n */\n parameters?: { [key: string]: Array<string> }\n /**\n * Extra properties\n */\n properties?: Array<PropertyStub>\n /**\n * For each couple of HcParties (delegator and delegate), this map contains the exchange AES key. The delegator is always this hcp, the key of the map is the id of the delegate.The AES exchange key is encrypted using RSA twice : once using this hcp public key (index 0 in the Array) and once using the other hcp public key (index 1 in the Array). For a pair of HcParties. Each HcParty always has one AES exchange key for himself.\n */\n hcPartyKeys?: { [key: string]: Array<string> }\n /**\n * Extra AES exchange keys, usually the ones we lost access to at some point. The structure is { publicKey: { delegateId: { myPubKey1: aesExKey_for_this, delegatePubKey1: aesExKey_for_delegate } } }\n */\n aesExchangeKeys?: { [key: string]: { [key: string]: { [key: string]: string } } }\n /**\n * Our private keys encrypted with our public keys. The structure is { publicKey1: { publicKey2: privateKey2_encrypted_with_publicKey1, publicKey3: privateKey3_encrypted_with_publicKey1 } }\n */\n transferKeys?: { [key: string]: { [key: string]: string } }\n /**\n * The privateKeyShamirPartitions are used to share this hcp's private RSA key with a series of other hcParties using Shamir's algorithm. The key of the map is the hcp Id with whom this partition has been shared. The value is \\\"threshold⎮partition in hex\\\" encrypted using the the partition's holder's public RSA key\n */\n privateKeyShamirPartitions?: { [key: string]: string }\n /**\n * The public key of this hcp\n */\n publicKey?: string\n /**\n * The public keys of this actor that are generates using the OAEP Sha-256 standard\n */\n publicKeysForOaepWithSha256?: Array<string>\n /**\n * The secretForeignKeys are filled at the to many end of a one to many relationship (for example inside Contact for the Patient -> Contacts relationship). Used when we want to find all contacts for a specific patient. These keys are in clear. You can have several to partition the medical document space.\n */\n secretForeignKeys?: Array<string>\n /**\n * The secretForeignKeys are filled at the to many end of a one to many relationship (for example inside Contact for the Patient -> Contacts relationship). Used when we want to find the patient for a specific contact. These keys are the encrypted id (using the hcParty key for the delegate) that can be found in clear inside the patient. ids encrypted using the hcParty keys.\n */\n cryptedForeignKeys?: { [key: string]: Array<Delegation> }\n /**\n * When a document is created, the responsible generates a cryptographically random master key (never to be used for something else than referencing from other entities). He/she encrypts it using his own AES exchange key and stores it as a delegation. The responsible is thus always in the delegations as well\n */\n delegations?: { [key: string]: Array<Delegation> }\n /**\n * When a document needs to be encrypted, the responsible generates a cryptographically random master key (different from the delegation key, never to appear in clear anywhere in the db. He/she encrypts it using his own AES exchange key and stores it as a delegation\n */\n encryptionKeys?: { [key: string]: Array<Delegation> }\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 /**\n * The id of the medical location where this entity was created.\n */\n medicalLocationId?: string\n nonDuplicateIds?: Array<string>\n encryptedAdministrativesDocuments?: Array<string>\n comment?: string\n warning?: string\n fatherBirthCountry?: CodeStub\n birthCountry?: CodeStub\n nativeCountry?: CodeStub\n socialStatus?: CodeStub\n mainSourceOfIncome?: CodeStub\n schoolingInfos?: Array<SchoolingInfo>\n employementInfos?: Array<EmploymentInfo>\n securityMetadata?: SecurityMetadata\n parentId?: never\n}\nexport namespace Patient {\n export type GenderEnum = 'male' | 'female' | 'indeterminate' | 'changed' | 'changedToMale' | 'changedToFemale' | 'unknown'\n export const GenderEnum = {\n Male: 'male' as GenderEnum,\n Female: 'female' as GenderEnum,\n Indeterminate: 'indeterminate' as GenderEnum,\n Changed: 'changed' as GenderEnum,\n ChangedToMale: 'changedToMale' as GenderEnum,\n ChangedToFemale: 'changedToFemale' as GenderEnum,\n Unknown: 'unknown' as GenderEnum,\n }\n export type BirthSexEnum = 'male' | 'female' | 'indeterminate' | 'changed' | 'changedToMale' | 'changedToFemale' | 'unknown'\n export const BirthSexEnum = {\n Male: 'male' as BirthSexEnum,\n Female: 'female' as BirthSexEnum,\n Indeterminate: 'indeterminate' as BirthSexEnum,\n Changed: 'changed' as BirthSexEnum,\n ChangedToMale: 'changedToMale' as BirthSexEnum,\n ChangedToFemale: 'changedToFemale' as BirthSexEnum,\n Unknown: 'unknown' as BirthSexEnum,\n }\n export type DeactivationReasonEnum = 'deceased' | 'moved' | 'other_doctor' | 'left_structure' | 'retired' | 'no_contact' | 'unknown' | 'none'\n export const DeactivationReasonEnum = {\n Deceased: 'deceased' as DeactivationReasonEnum,\n Moved: 'moved' as DeactivationReasonEnum,\n OtherDoctor: 'other_doctor' as DeactivationReasonEnum,\n LeftStructure: 'left_structure' as DeactivationReasonEnum,\n Retired: 'retired' as DeactivationReasonEnum,\n NoContact: 'no_contact' as DeactivationReasonEnum,\n Unknown: 'unknown' as DeactivationReasonEnum,\n None: 'none' as DeactivationReasonEnum,\n }\n export type PersonalStatusEnum =\n | 'single'\n | 'in_couple'\n | 'married'\n | 'separated'\n | 'divorced'\n | 'divorcing'\n | 'widowed'\n | 'widower'\n | 'complicated'\n | 'unknown'\n | 'contract'\n | 'other'\n | 'annulled'\n | 'polygamous'\n export const PersonalStatusEnum = {\n Single: 'single' as PersonalStatusEnum,\n InCouple: 'in_couple' as PersonalStatusEnum,\n Married: 'married' as PersonalStatusEnum,\n Separated: 'separated' as PersonalStatusEnum,\n Divorced: 'divorced' as PersonalStatusEnum,\n Divorcing: 'divorcing' as PersonalStatusEnum,\n Widowed: 'widowed' as PersonalStatusEnum,\n Widower: 'widower' as PersonalStatusEnum,\n Complicated: 'complicated' as PersonalStatusEnum,\n Unknown: 'unknown' as PersonalStatusEnum,\n Contract: 'contract' as PersonalStatusEnum,\n Other: 'other' as PersonalStatusEnum,\n Annulled: 'annulled' as PersonalStatusEnum,\n Polygamous: 'polygamous' as PersonalStatusEnum,\n }\n}\n"]}
1
+ {"version":3,"file":"Patient.js","sourceRoot":"","sources":["../../../icc-api/model/Patient.ts"],"names":[],"mappings":";;;AA0BA;;GAEG;AACH,+CAAyD;AAGzD,MAAa,OAAO;IAClB,YAAY,IAAgB;QAC1B,IAAI,WAAW,GAA8B,EAAE,CAAA;QAC/C,IAAI,CAAC,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,CAAA,EAAE,CAAC;YACpB,WAAW,CAAC,OAAO,GAAG,IAAA,uCAAyB,EAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/D,CAAC;QACD,MAAM,CAAC,MAAM,CAAC,IAAe,EAAE,IAAI,EAAE,WAAW,CAAC,CAAA;IACnD,CAAC;CA+RF;AAtSD,0BAsSC;AACD,WAAiB,OAAO;IAET,kBAAU,GAAG;QACxB,IAAI,EAAE,MAAoB;QAC1B,MAAM,EAAE,QAAsB;QAC9B,aAAa,EAAE,eAA6B;QAC5C,OAAO,EAAE,SAAuB;QAChC,aAAa,EAAE,eAA6B;QAC5C,eAAe,EAAE,iBAA+B;QAChD,OAAO,EAAE,SAAuB;KACjC,CAAA;IAEY,oBAAY,GAAG;QAC1B,IAAI,EAAE,MAAsB;QAC5B,MAAM,EAAE,QAAwB;QAChC,aAAa,EAAE,eAA+B;QAC9C,OAAO,EAAE,SAAyB;QAClC,aAAa,EAAE,eAA+B;QAC9C,eAAe,EAAE,iBAAiC;QAClD,OAAO,EAAE,SAAyB;KACnC,CAAA;IAEY,8BAAsB,GAAG;QACpC,QAAQ,EAAE,UAAoC;QAC9C,KAAK,EAAE,OAAiC;QACxC,WAAW,EAAE,cAAwC;QACrD,aAAa,EAAE,gBAA0C;QACzD,OAAO,EAAE,SAAmC;QAC5C,SAAS,EAAE,YAAsC;QACjD,OAAO,EAAE,SAAmC;QAC5C,IAAI,EAAE,MAAgC;KACvC,CAAA;IAgBY,0BAAkB,GAAG;QAChC,MAAM,EAAE,QAA8B;QACtC,QAAQ,EAAE,WAAiC;QAC3C,OAAO,EAAE,SAA+B;QACxC,SAAS,EAAE,WAAiC;QAC5C,QAAQ,EAAE,UAAgC;QAC1C,SAAS,EAAE,WAAiC;QAC5C,OAAO,EAAE,SAA+B;QACxC,OAAO,EAAE,SAA+B;QACxC,WAAW,EAAE,aAAmC;QAChD,OAAO,EAAE,SAA+B;QACxC,QAAQ,EAAE,UAAgC;QAC1C,KAAK,EAAE,OAA6B;QACpC,QAAQ,EAAE,UAAgC;QAC1C,UAAU,EAAE,YAAkC;KAC/C,CAAA;AACH,CAAC,EA/DgB,OAAO,uBAAP,OAAO,QA+DvB","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 { Address } from './Address'\nimport { CodeStub } from './CodeStub'\nimport { Delegation } from './Delegation'\nimport { EmploymentInfo } from './EmploymentInfo'\nimport { FinancialInstitutionInformation } from './FinancialInstitutionInformation'\nimport { Identifier } from './Identifier'\nimport { Insurability } from './Insurability'\nimport { MedicalHouseContract } from './MedicalHouseContract'\nimport { Partnership } from './Partnership'\nimport { PatientHealthCareParty } from './PatientHealthCareParty'\nimport { PersonName } from './PersonName'\nimport { PropertyStub } from './PropertyStub'\nimport { SchoolingInfo } from './SchoolingInfo'\nimport { Annotation } from './Annotation'\n\n/**\n * This entity is a root level object. It represents a patient It is serialized in JSON and saved in the underlying icure-patient CouchDB database.\n */\nimport { decodeStringOrArrayBuffer } from './ModelHelper'\nimport { SecurityMetadata } from './SecurityMetadata'\n\nexport class Patient {\n constructor(json: JSON | any) {\n let pictureData: { picture?: ArrayBuffer } = {}\n if (!!json?.picture) {\n pictureData.picture = decodeStringOrArrayBuffer(json.picture)\n }\n Object.assign(this as Patient, json, pictureData)\n }\n\n /**\n * the Id of the patient. We encourage using either a v4 UUID or a HL7 Id.\n */\n id?: string\n /**\n * the revision of the patient in the database, used for conflict management / optimistic locking.\n */\n rev?: string\n identifier?: Array<Identifier>\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 * 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 * 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 * 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 * Soft delete (unix epoch in ms) timestamp of the object.\n */\n endOfLife?: number\n /**\n * hard delete (unix epoch in ms) timestamp of the object. Filled automatically when deletePatient is called.\n */\n deletionDate?: number\n /**\n * the firstname (name) of the patient.\n */\n firstName?: string\n /**\n * the lastname (surname) of the patient. This is the official lastname that should be used for official administrative purposes.\n */\n lastName?: string\n /**\n * the list of all names of the patient, also containing the official full name information. Ordered by preference of use. First element is therefore the official name used for the patient in the application\n */\n names?: Array<PersonName>\n /**\n * the name of the company this patient is member of.\n */\n companyName?: string\n /**\n * the list of languages spoken by the patient ordered by fluency (alpha-2 code http://www.loc.gov/standards/iso639-2/ascii_8bits.html).\n */\n languages?: Array<string>\n /**\n * the list of addresses (with address type).\n */\n addresses?: Array<Address>\n /**\n * Mr., Ms., Pr., Dr. ...\n */\n civility?: string\n /**\n * the gender of the patient: male, female, indeterminate, changed, changedToMale, changedToFemale, unknown\n */\n gender?: Patient.GenderEnum\n /**\n * the birth sex of the patient: male, female, indeterminate, unknown\n */\n birthSex?: Patient.BirthSexEnum\n /**\n * The id of the patient this patient has been merged with.\n */\n mergeToPatientId?: string\n /**\n * The ids of the patients that have been merged inside this patient.\n */\n mergedIds?: Array<string>\n /**\n * An alias of the person, nickname, ...\n */\n alias?: string\n /**\n * Is the patient active (boolean).\n */\n active?: boolean\n /**\n * When not active, the reason for deactivation.\n */\n deactivationReason?: Patient.DeactivationReasonEnum\n /**\n * Deactivation date of the patient\n */\n deactivationDate?: number\n /**\n * Social security inscription number.\n */\n ssin?: string\n /**\n * Lastname at birth (can be different of the current name), depending on the country, must be used to design the patient .\n */\n maidenName?: string\n /**\n * Lastname of the spouse for a married woman, depending on the country, can be used to design the patient.\n */\n spouseName?: string\n /**\n * Lastname of the partner, should not be used to design the patient.\n */\n partnerName?: string\n /**\n * any of `single`, `in_couple`, `married`, `separated`, `divorced`, `divorcing`, `widowed`, `widower`, `complicated`, `unknown`, `contract`, `other`.\n */\n personalStatus?: Patient.PersonalStatusEnum\n /**\n * The birthdate encoded as a fuzzy date on 8 positions (YYYYMMDD) MM and/or DD can be set to 00 if unknown (19740000 is a valid date).\n */\n dateOfBirth?: number\n /**\n * The date of death encoded as a fuzzy date on 8 positions (YYYYMMDD) MM and/or DD can be set to 00 if unknown (19740000 is a valid date).\n */\n dateOfDeath?: number\n /**\n * Timestamp of the latest validation of the eID of the person..\n */\n timestampOfLatestEidReading?: number\n /**\n * The place of birth.\n */\n placeOfBirth?: string\n /**\n * The place of death.\n */\n placeOfDeath?: string\n /**\n * Is the patient deceased.\n */\n deceased?: boolean\n /**\n * The level of education (college degree, undergraduate, phd).\n */\n education?: string\n /**\n * The current professional activity.\n */\n profession?: string\n /**\n * A text note (can be confidential, encrypted by default).\n * @deprecated use notes instead with proper tags\n */\n note?: string\n /**\n * An administrative note, not confidential.\n * @deprecated use notes instead with proper tags\n */\n administrativeNote?: string\n /**\n * A list of localized notes.\n */\n notes?: Annotation[]\n /**\n * The nationality of the patient.\n */\n nationality?: string\n /**\n * The race of the patient.\n */\n race?: string\n /**\n * The ethnicity of the patient.\n */\n ethnicity?: string\n /**\n * The id of the user that usually handles this patient.\n */\n preferredUserId?: string\n /**\n * A picture usually saved in JPEG format.\n */\n picture?: ArrayBuffer\n /**\n * An external (from another source) id with no guarantee or requirement for unicity .\n */\n externalId?: string\n /**\n * List of insurance coverages (of class Insurability, see below).\n */\n insurabilities?: Array<Insurability>\n /**\n * List of partners, or persons of contact (of class Partnership, see below).\n */\n partnerships?: Array<Partnership>\n /**\n * Links (usually for therapeutic reasons) between this patient and healthcare parties (of class PatientHealthcareParty).\n */\n patientHealthCareParties?: Array<PatientHealthCareParty>\n /**\n * Financial information (Bank, bank account) used to reimburse the patient.\n */\n financialInstitutionInformation?: Array<FinancialInstitutionInformation>\n /**\n * Contracts between the patient and the healthcare entity.\n */\n medicalHouseContracts?: Array<MedicalHouseContract>\n /**\n * Codified list of professions exercised by this patient.\n */\n patientProfessions?: Array<CodeStub>\n /**\n * Extra parameters\n */\n parameters?: { [key: string]: Array<string> }\n /**\n * Extra properties\n */\n properties?: Array<PropertyStub>\n /**\n * For each couple of HcParties (delegator and delegate), this map contains the exchange AES key. The delegator is always this hcp, the key of the map is the id of the delegate.The AES exchange key is encrypted using RSA twice : once using this hcp public key (index 0 in the Array) and once using the other hcp public key (index 1 in the Array). For a pair of HcParties. Each HcParty always has one AES exchange key for himself.\n */\n hcPartyKeys?: { [key: string]: Array<string> }\n /**\n * Extra AES exchange keys, usually the ones we lost access to at some point. The structure is { publicKey: { delegateId: { myPubKey1: aesExKey_for_this, delegatePubKey1: aesExKey_for_delegate } } }\n */\n aesExchangeKeys?: { [key: string]: { [key: string]: { [key: string]: string } } }\n /**\n * Our private keys encrypted with our public keys. The structure is { publicKey1: { publicKey2: privateKey2_encrypted_with_publicKey1, publicKey3: privateKey3_encrypted_with_publicKey1 } }\n */\n transferKeys?: { [key: string]: { [key: string]: string } }\n /**\n * The privateKeyShamirPartitions are used to share this hcp's private RSA key with a series of other hcParties using Shamir's algorithm. The key of the map is the hcp Id with whom this partition has been shared. The value is \\\"threshold⎮partition in hex\\\" encrypted using the the partition's holder's public RSA key\n */\n privateKeyShamirPartitions?: { [key: string]: string }\n /**\n * The public key of this hcp\n */\n publicKey?: string\n /**\n * The public keys of this actor that are generates using the OAEP Sha-256 standard\n */\n publicKeysForOaepWithSha256?: Array<string>\n /**\n * The secretForeignKeys are filled at the to many end of a one to many relationship (for example inside Contact for the Patient -> Contacts relationship). Used when we want to find all contacts for a specific patient. These keys are in clear. You can have several to partition the medical document space.\n */\n secretForeignKeys?: Array<string>\n /**\n * The secretForeignKeys are filled at the to many end of a one to many relationship (for example inside Contact for the Patient -> Contacts relationship). Used when we want to find the patient for a specific contact. These keys are the encrypted id (using the hcParty key for the delegate) that can be found in clear inside the patient. ids encrypted using the hcParty keys.\n */\n cryptedForeignKeys?: { [key: string]: Array<Delegation> }\n /**\n * When a document is created, the responsible generates a cryptographically random master key (never to be used for something else than referencing from other entities). He/she encrypts it using his own AES exchange key and stores it as a delegation. The responsible is thus always in the delegations as well\n */\n delegations?: { [key: string]: Array<Delegation> }\n /**\n * When a document needs to be encrypted, the responsible generates a cryptographically random master key (different from the delegation key, never to appear in clear anywhere in the db. He/she encrypts it using his own AES exchange key and stores it as a delegation\n */\n encryptionKeys?: { [key: string]: Array<Delegation> }\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 /**\n * The id of the medical location where this entity was created.\n */\n medicalLocationId?: string\n nonDuplicateIds?: Array<string>\n encryptedAdministrativesDocuments?: Array<string>\n comment?: string\n warning?: string\n fatherBirthCountry?: CodeStub\n birthCountry?: CodeStub\n nativeCountry?: CodeStub\n socialStatus?: CodeStub\n mainSourceOfIncome?: CodeStub\n schoolingInfos?: Array<SchoolingInfo>\n employementInfos?: Array<EmploymentInfo>\n securityMetadata?: SecurityMetadata\n parentId?: never\n cryptoActorProperties?: Array<PropertyStub>\n}\nexport namespace Patient {\n export type GenderEnum = 'male' | 'female' | 'indeterminate' | 'changed' | 'changedToMale' | 'changedToFemale' | 'unknown'\n export const GenderEnum = {\n Male: 'male' as GenderEnum,\n Female: 'female' as GenderEnum,\n Indeterminate: 'indeterminate' as GenderEnum,\n Changed: 'changed' as GenderEnum,\n ChangedToMale: 'changedToMale' as GenderEnum,\n ChangedToFemale: 'changedToFemale' as GenderEnum,\n Unknown: 'unknown' as GenderEnum,\n }\n export type BirthSexEnum = 'male' | 'female' | 'indeterminate' | 'changed' | 'changedToMale' | 'changedToFemale' | 'unknown'\n export const BirthSexEnum = {\n Male: 'male' as BirthSexEnum,\n Female: 'female' as BirthSexEnum,\n Indeterminate: 'indeterminate' as BirthSexEnum,\n Changed: 'changed' as BirthSexEnum,\n ChangedToMale: 'changedToMale' as BirthSexEnum,\n ChangedToFemale: 'changedToFemale' as BirthSexEnum,\n Unknown: 'unknown' as BirthSexEnum,\n }\n export type DeactivationReasonEnum = 'deceased' | 'moved' | 'other_doctor' | 'left_structure' | 'retired' | 'no_contact' | 'unknown' | 'none'\n export const DeactivationReasonEnum = {\n Deceased: 'deceased' as DeactivationReasonEnum,\n Moved: 'moved' as DeactivationReasonEnum,\n OtherDoctor: 'other_doctor' as DeactivationReasonEnum,\n LeftStructure: 'left_structure' as DeactivationReasonEnum,\n Retired: 'retired' as DeactivationReasonEnum,\n NoContact: 'no_contact' as DeactivationReasonEnum,\n Unknown: 'unknown' as DeactivationReasonEnum,\n None: 'none' as DeactivationReasonEnum,\n }\n export type PersonalStatusEnum =\n | 'single'\n | 'in_couple'\n | 'married'\n | 'separated'\n | 'divorced'\n | 'divorcing'\n | 'widowed'\n | 'widower'\n | 'complicated'\n | 'unknown'\n | 'contract'\n | 'other'\n | 'annulled'\n | 'polygamous'\n export const PersonalStatusEnum = {\n Single: 'single' as PersonalStatusEnum,\n InCouple: 'in_couple' as PersonalStatusEnum,\n Married: 'married' as PersonalStatusEnum,\n Separated: 'separated' as PersonalStatusEnum,\n Divorced: 'divorced' as PersonalStatusEnum,\n Divorcing: 'divorcing' as PersonalStatusEnum,\n Widowed: 'widowed' as PersonalStatusEnum,\n Widower: 'widower' as PersonalStatusEnum,\n Complicated: 'complicated' as PersonalStatusEnum,\n Unknown: 'unknown' as PersonalStatusEnum,\n Contract: 'contract' as PersonalStatusEnum,\n Other: 'other' as PersonalStatusEnum,\n Annulled: 'annulled' as PersonalStatusEnum,\n Polygamous: 'polygamous' as PersonalStatusEnum,\n }\n}\n"]}
@@ -95,6 +95,7 @@ export declare class User {
95
95
  [key in User.AutoDelegationTagEnum]?: Array<string>;
96
96
  };
97
97
  /**
98
+ * @deprecated use created instead
98
99
  * the timestamp (unix epoch in ms) of creation of the user, will be filled automatically if missing. Not enforced by the application server.
99
100
  */
100
101
  createdDate?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"User.js","sourceRoot":"","sources":["../../../icc-api/model/User.ts"],"names":[],"mappings":";;;AAgBA;;GAEG;AACH,MAAa,IAAI;IACf,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAAY,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC;CAqGF;AAxGD,oBAwGC;AACD,WAAiB,IAAI;IAEN,aAAQ,GAAG;QACtB,QAAQ,EAAE,UAAsB;QAChC,IAAI,EAAE,MAAkB;QACxB,KAAK,EAAE,OAAmB;KAC3B,CAAA;IAEY,eAAU,GAAG;QACxB,MAAM,EAAE,QAAsB;QAC9B,QAAQ,EAAE,UAAwB;QAClC,WAAW,EAAE,aAA2B;KACzC,CAAA;IAqBY,0BAAqB,GAAG;QACnC,GAAG,EAAE,KAA8B;QACnC,kBAAkB,EAAE,oBAA6C;QACjE,kBAAkB,EAAE,oBAA6C;QACjE,oBAAoB,EAAE,sBAA+C;QACrE,kBAAkB,EAAE,oBAA6C;QACjE,oBAAoB,EAAE,sBAA+C;QACrE,uBAAuB,EAAE,yBAAkD;QAC3E,UAAU,EAAE,YAAqC;QACjD,gBAAgB,EAAE,kBAA2C;QAC7D,uBAAuB,EAAE,yBAAkD;QAC3E,wBAAwB,EAAE,0BAAmD;QAC7E,aAAa,EAAE,eAAwC;QACvD,eAAe,EAAE,iBAA0C;QAC3D,SAAS,EAAE,WAAoC;QAC/C,YAAY,EAAE,cAAuC;QACrD,eAAe,EAAE,iBAA0C;QAC3D,gBAAgB,EAAE,kBAA2C;QAC7D,eAAe,EAAE,iBAA0C;QAC3D,aAAa,EAAE,eAAwC;KACxD,CAAA;IAED,MAAa,cAAc;QACzB,YAAY,IAAgB;YAC1B,MAAM,CAAC,MAAM,CAAC,IAAY,EAAE,IAAI,CAAC,CAAA;QACnC,CAAC;KAkBF;IArBY,mBAAc,iBAqB1B,CAAA;AACH,CAAC,EA7EgB,IAAI,oBAAJ,IAAI,QA6EpB","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 { AuthenticationToken } from './AuthenticationToken'\nimport { Permission } from './Permission'\nimport { PropertyStub } from './PropertyStub'\nimport { Identifier } from './Identifier'\n\n/**\n * This entity is a root level object. It represents an user that can log in to the iCure platform. It is serialized in JSON and saved in the underlying icure-base CouchDB database.\n */\nexport class User {\n constructor(json: JSON | any) {\n Object.assign(this as User, json)\n }\n\n /**\n * the Id of the user. We encourage using either a v4 UUID or a HL7 Id.\n */\n id?: string\n /**\n * the revision of the user in the database, used for conflict management / optimistic locking.\n */\n rev?: string\n identifier?: Array<Identifier>\n /**\n * hard delete (unix epoch in ms) timestamp of the object. Filled automatically when deletePatient is called.\n */\n deletionDate?: number\n created?: number\n /**\n * Last name of the user. This is the official last name that should be used for official administrative purposes.\n */\n name?: string\n /**\n * Extra properties for the user. Those properties are typed (see class Property)\n */\n properties?: Array<PropertyStub>\n /**\n * If permission to modify patient data is granted or revoked\n */\n permissions?: Array<Permission>\n /**\n * Roles specified for the user\n */\n roles?: Array<string>\n /**\n * Authorization source for user. 'Database', 'ldap' or 'token'\n */\n type?: User.TypeEnum\n /**\n * State of user's activeness: 'Active', 'Disabled' or 'Registering'\n */\n status?: User.StatusEnum\n /**\n * Username for this user. We encourage using an email address\n */\n login?: string\n /**\n * Hashed version of the password (BCrypt is used for hashing)\n */\n passwordHash?: string\n /**\n * Secret token used to verify 2fa\n */\n secret?: string\n /**\n * Whether the user has activated two factors authentication\n */\n use2fa?: boolean\n /**\n * id of the group (practice/hospital) the user is member of\n */\n groupId?: string\n /**\n * Id of the healthcare party if the user is a healthcare party.\n */\n healthcarePartyId?: string\n /**\n * Id of the patient if the user is a patient\n */\n patientId?: string\n /**\n * Id of the device if the user is a device\n */\n deviceId?: string\n /**\n * Delegations that are automatically generated client side when a new database object is created by this user\n */\n autoDelegations?: { [key in User.AutoDelegationTagEnum]?: Array<string> }\n /**\n * the timestamp (unix epoch in ms) of creation of the user, will be filled automatically if missing. Not enforced by the application server.\n */\n createdDate?: number\n /**\n * the timestamp (unix epoch in ms) of the latest validation of the terms of use of the application\n */\n termsOfUseDate?: number\n /**\n * email address of the user (used for token exchange or password recovery).\n */\n email?: string\n /**\n * mobile phone of the user (used for token exchange or password recovery).\n */\n mobilePhone?: string\n applicationTokens?: { [key: string]: string }\n /**\n * Encrypted and time-limited Authentication tokens used for inter-applications authentication\n */\n authenticationTokens?: { [key: string]: AuthenticationToken }\n /**\n * System metadata for the user: this configuration is read only, and defined only when using the cloud version of iCure.\n */\n systemMetadata?: User.SystemMetadata\n}\nexport namespace User {\n export type TypeEnum = 'database' | 'ldap' | 'token'\n export const TypeEnum = {\n Database: 'database' as TypeEnum,\n Ldap: 'ldap' as TypeEnum,\n Token: 'token' as TypeEnum,\n }\n export type StatusEnum = 'ACTIVE' | 'DISABLED' | 'REGISTERING'\n export const StatusEnum = {\n ACTIVE: 'ACTIVE' as StatusEnum,\n DISABLED: 'DISABLED' as StatusEnum,\n REGISTERING: 'REGISTERING' as StatusEnum,\n }\n export type AutoDelegationTagEnum =\n | 'all'\n | 'administrativeData'\n | 'generalInformation'\n | 'financialInformation'\n | 'medicalInformation'\n | 'sensitiveInformation'\n | 'confidentialInformation'\n | 'cdItemRisk'\n | 'cdItemFamilyRisk'\n | 'cdItemHealthcareelement'\n | 'cdItemHealthcareapproach'\n | 'cdItemAllergy'\n | 'cdItemDiagnosis'\n | 'cdItemLab'\n | 'cdItemResult'\n | 'cdItemParameter'\n | 'cdItemMedication'\n | 'cdItemTreatment'\n | 'cdItemVaccine'\n export const AutoDelegationTagEnum = {\n all: 'all' as AutoDelegationTagEnum,\n administrativeData: 'administrativeData' as AutoDelegationTagEnum,\n generalInformation: 'generalInformation' as AutoDelegationTagEnum,\n financialInformation: 'financialInformation' as AutoDelegationTagEnum,\n medicalInformation: 'medicalInformation' as AutoDelegationTagEnum,\n sensitiveInformation: 'sensitiveInformation' as AutoDelegationTagEnum,\n confidentialInformation: 'confidentialInformation' as AutoDelegationTagEnum,\n cdItemRisk: 'cdItemRisk' as AutoDelegationTagEnum,\n cdItemFamilyRisk: 'cdItemFamilyRisk' as AutoDelegationTagEnum,\n cdItemHealthcareelement: 'cdItemHealthcareelement' as AutoDelegationTagEnum,\n cdItemHealthcareapproach: 'cdItemHealthcareapproach' as AutoDelegationTagEnum,\n cdItemAllergy: 'cdItemAllergy' as AutoDelegationTagEnum,\n cdItemDiagnosis: 'cdItemDiagnosis' as AutoDelegationTagEnum,\n cdItemLab: 'cdItemLab' as AutoDelegationTagEnum,\n cdItemResult: 'cdItemResult' as AutoDelegationTagEnum,\n cdItemParameter: 'cdItemParameter' as AutoDelegationTagEnum,\n cdItemMedication: 'cdItemMedication' as AutoDelegationTagEnum,\n cdItemTreatment: 'cdItemTreatment' as AutoDelegationTagEnum,\n cdItemVaccine: 'cdItemVaccine' as AutoDelegationTagEnum,\n }\n\n export class SystemMetadata {\n constructor(json: JSON | any) {\n Object.assign(this as User, json)\n }\n\n /**\n * The roles of the user that the cloud environment recognizes\n */\n roles?: string[]\n /**\n * If the user is considered as an admin by the cloud environment\n */\n isAdmin?: boolean\n /**\n * True if the content of roles is inherited from the user's group configuration, false if the roles are defined specifically for the use\n */\n inheritsRoles?: boolean\n /**\n * Identifiers of the user available for login\n */\n loginIdentifiers?: Identifier[]\n }\n}\n"]}
1
+ {"version":3,"file":"User.js","sourceRoot":"","sources":["../../../icc-api/model/User.ts"],"names":[],"mappings":";;;AAgBA;;GAEG;AACH,MAAa,IAAI;IACf,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAAY,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC;CAsGF;AAzGD,oBAyGC;AACD,WAAiB,IAAI;IAEN,aAAQ,GAAG;QACtB,QAAQ,EAAE,UAAsB;QAChC,IAAI,EAAE,MAAkB;QACxB,KAAK,EAAE,OAAmB;KAC3B,CAAA;IAEY,eAAU,GAAG;QACxB,MAAM,EAAE,QAAsB;QAC9B,QAAQ,EAAE,UAAwB;QAClC,WAAW,EAAE,aAA2B;KACzC,CAAA;IAqBY,0BAAqB,GAAG;QACnC,GAAG,EAAE,KAA8B;QACnC,kBAAkB,EAAE,oBAA6C;QACjE,kBAAkB,EAAE,oBAA6C;QACjE,oBAAoB,EAAE,sBAA+C;QACrE,kBAAkB,EAAE,oBAA6C;QACjE,oBAAoB,EAAE,sBAA+C;QACrE,uBAAuB,EAAE,yBAAkD;QAC3E,UAAU,EAAE,YAAqC;QACjD,gBAAgB,EAAE,kBAA2C;QAC7D,uBAAuB,EAAE,yBAAkD;QAC3E,wBAAwB,EAAE,0BAAmD;QAC7E,aAAa,EAAE,eAAwC;QACvD,eAAe,EAAE,iBAA0C;QAC3D,SAAS,EAAE,WAAoC;QAC/C,YAAY,EAAE,cAAuC;QACrD,eAAe,EAAE,iBAA0C;QAC3D,gBAAgB,EAAE,kBAA2C;QAC7D,eAAe,EAAE,iBAA0C;QAC3D,aAAa,EAAE,eAAwC;KACxD,CAAA;IAED,MAAa,cAAc;QACzB,YAAY,IAAgB;YAC1B,MAAM,CAAC,MAAM,CAAC,IAAY,EAAE,IAAI,CAAC,CAAA;QACnC,CAAC;KAkBF;IArBY,mBAAc,iBAqB1B,CAAA;AACH,CAAC,EA7EgB,IAAI,oBAAJ,IAAI,QA6EpB","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 { AuthenticationToken } from './AuthenticationToken'\nimport { Permission } from './Permission'\nimport { PropertyStub } from './PropertyStub'\nimport { Identifier } from './Identifier'\n\n/**\n * This entity is a root level object. It represents an user that can log in to the iCure platform. It is serialized in JSON and saved in the underlying icure-base CouchDB database.\n */\nexport class User {\n constructor(json: JSON | any) {\n Object.assign(this as User, json)\n }\n\n /**\n * the Id of the user. We encourage using either a v4 UUID or a HL7 Id.\n */\n id?: string\n /**\n * the revision of the user in the database, used for conflict management / optimistic locking.\n */\n rev?: string\n identifier?: Array<Identifier>\n /**\n * hard delete (unix epoch in ms) timestamp of the object. Filled automatically when deletePatient is called.\n */\n deletionDate?: number\n created?: number\n /**\n * Last name of the user. This is the official last name that should be used for official administrative purposes.\n */\n name?: string\n /**\n * Extra properties for the user. Those properties are typed (see class Property)\n */\n properties?: Array<PropertyStub>\n /**\n * If permission to modify patient data is granted or revoked\n */\n permissions?: Array<Permission>\n /**\n * Roles specified for the user\n */\n roles?: Array<string>\n /**\n * Authorization source for user. 'Database', 'ldap' or 'token'\n */\n type?: User.TypeEnum\n /**\n * State of user's activeness: 'Active', 'Disabled' or 'Registering'\n */\n status?: User.StatusEnum\n /**\n * Username for this user. We encourage using an email address\n */\n login?: string\n /**\n * Hashed version of the password (BCrypt is used for hashing)\n */\n passwordHash?: string\n /**\n * Secret token used to verify 2fa\n */\n secret?: string\n /**\n * Whether the user has activated two factors authentication\n */\n use2fa?: boolean\n /**\n * id of the group (practice/hospital) the user is member of\n */\n groupId?: string\n /**\n * Id of the healthcare party if the user is a healthcare party.\n */\n healthcarePartyId?: string\n /**\n * Id of the patient if the user is a patient\n */\n patientId?: string\n /**\n * Id of the device if the user is a device\n */\n deviceId?: string\n /**\n * Delegations that are automatically generated client side when a new database object is created by this user\n */\n autoDelegations?: { [key in User.AutoDelegationTagEnum]?: Array<string> }\n /**\n * @deprecated use created instead\n * the timestamp (unix epoch in ms) of creation of the user, will be filled automatically if missing. Not enforced by the application server.\n */\n createdDate?: number\n /**\n * the timestamp (unix epoch in ms) of the latest validation of the terms of use of the application\n */\n termsOfUseDate?: number\n /**\n * email address of the user (used for token exchange or password recovery).\n */\n email?: string\n /**\n * mobile phone of the user (used for token exchange or password recovery).\n */\n mobilePhone?: string\n applicationTokens?: { [key: string]: string }\n /**\n * Encrypted and time-limited Authentication tokens used for inter-applications authentication\n */\n authenticationTokens?: { [key: string]: AuthenticationToken }\n /**\n * System metadata for the user: this configuration is read only, and defined only when using the cloud version of iCure.\n */\n systemMetadata?: User.SystemMetadata\n}\nexport namespace User {\n export type TypeEnum = 'database' | 'ldap' | 'token'\n export const TypeEnum = {\n Database: 'database' as TypeEnum,\n Ldap: 'ldap' as TypeEnum,\n Token: 'token' as TypeEnum,\n }\n export type StatusEnum = 'ACTIVE' | 'DISABLED' | 'REGISTERING'\n export const StatusEnum = {\n ACTIVE: 'ACTIVE' as StatusEnum,\n DISABLED: 'DISABLED' as StatusEnum,\n REGISTERING: 'REGISTERING' as StatusEnum,\n }\n export type AutoDelegationTagEnum =\n | 'all'\n | 'administrativeData'\n | 'generalInformation'\n | 'financialInformation'\n | 'medicalInformation'\n | 'sensitiveInformation'\n | 'confidentialInformation'\n | 'cdItemRisk'\n | 'cdItemFamilyRisk'\n | 'cdItemHealthcareelement'\n | 'cdItemHealthcareapproach'\n | 'cdItemAllergy'\n | 'cdItemDiagnosis'\n | 'cdItemLab'\n | 'cdItemResult'\n | 'cdItemParameter'\n | 'cdItemMedication'\n | 'cdItemTreatment'\n | 'cdItemVaccine'\n export const AutoDelegationTagEnum = {\n all: 'all' as AutoDelegationTagEnum,\n administrativeData: 'administrativeData' as AutoDelegationTagEnum,\n generalInformation: 'generalInformation' as AutoDelegationTagEnum,\n financialInformation: 'financialInformation' as AutoDelegationTagEnum,\n medicalInformation: 'medicalInformation' as AutoDelegationTagEnum,\n sensitiveInformation: 'sensitiveInformation' as AutoDelegationTagEnum,\n confidentialInformation: 'confidentialInformation' as AutoDelegationTagEnum,\n cdItemRisk: 'cdItemRisk' as AutoDelegationTagEnum,\n cdItemFamilyRisk: 'cdItemFamilyRisk' as AutoDelegationTagEnum,\n cdItemHealthcareelement: 'cdItemHealthcareelement' as AutoDelegationTagEnum,\n cdItemHealthcareapproach: 'cdItemHealthcareapproach' as AutoDelegationTagEnum,\n cdItemAllergy: 'cdItemAllergy' as AutoDelegationTagEnum,\n cdItemDiagnosis: 'cdItemDiagnosis' as AutoDelegationTagEnum,\n cdItemLab: 'cdItemLab' as AutoDelegationTagEnum,\n cdItemResult: 'cdItemResult' as AutoDelegationTagEnum,\n cdItemParameter: 'cdItemParameter' as AutoDelegationTagEnum,\n cdItemMedication: 'cdItemMedication' as AutoDelegationTagEnum,\n cdItemTreatment: 'cdItemTreatment' as AutoDelegationTagEnum,\n cdItemVaccine: 'cdItemVaccine' as AutoDelegationTagEnum,\n }\n\n export class SystemMetadata {\n constructor(json: JSON | any) {\n Object.assign(this as User, json)\n }\n\n /**\n * The roles of the user that the cloud environment recognizes\n */\n roles?: string[]\n /**\n * If the user is considered as an admin by the cloud environment\n */\n isAdmin?: boolean\n /**\n * True if the content of roles is inherited from the user's group configuration, false if the roles are defined specifically for the use\n */\n inheritsRoles?: boolean\n /**\n * Identifiers of the user available for login\n */\n loginIdentifiers?: Identifier[]\n }\n}\n"]}
@@ -91,7 +91,7 @@ class AESUtilsImpl {
91
91
  */
92
92
  };
93
93
  this._debug && console.log(`decrypt ${(0, utils_1.ua2hex)(encryptedData)} with ${rawKey}`);
94
- this.crypto.subtle.decrypt(aesAlgorithmEncrypt, cryptoKey, encryptedDataUint8.subarray(this.ivLength, encryptedDataUint8.length)).then((decipheredData) => {
94
+ this.crypto.subtle.decrypt(aesAlgorithmEncrypt, cryptoKey, (0, utils_1.ua2ab)(encryptedDataUint8.subarray(this.ivLength, encryptedDataUint8.length))).then((decipheredData) => {
95
95
  this._debug && console.log(`decipheredData: ${(0, utils_1.ua2hex)(decipheredData)}`);
96
96
  resolve(decipheredData);
97
97
  }, (err) => {
@@ -1 +1 @@
1
- {"version":3,"file":"AES.js","sourceRoot":"","sources":["../../../icc-x-api/crypto/AES.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oCAAuD;AAmEvD,MAAa,YAAY;IAYvB,IAAI,KAAK,CAAC,KAAc;Q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MAAM,CAAC,CAAA;QACrF,CAAC,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,MAAqB,EAAE,MAA6C;QAC5E,OAAO,IAAI,OAAO,CAAC,CAAC,OAAkC,EAAE,MAA4B,EAAE,EAAE;YACtF,MAAM,WAAW,GAAG,IAAI,CAAA;YACxB,MAAM,SAAS,GAAe,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;YACpD,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM;iBACtB,SAAS,CAAC,MAAa,EAAE,MAAa,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,EAAE,SAAS,CAAC;iBACrF,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;gBACb,IAAI,MAAM,IAAI,KAAK,IAAI,CAAC,MAAM,YAAY,WAAW,IAAI,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;oBACrF,OAAO,CAAC,IAAI,CAAC,iBAAiB,IAAA,cAAM,EAAC,MAAM,CAAC,SAAS,CAAC,CAAA;gBACxD,CAAC;gBACD,MAAM,GAAG,CAAA;YACX,CAAC,CAAC;iBACD,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;QAC1B,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AAhMD,oCAgMC;AAEY,QAAA,GAAG,GAAG,IAAI,YAAY,EAAE,CAAA","sourcesContent":["import { appendBuffer, hex2ua, ua2hex } from '../utils'\n\nexport interface AESUtils {\n encryptWithRawKey(rawKey: string, plainData: ArrayBuffer | Uint8Array): Promise<ArrayBuffer>\n\n encrypt(cryptoKey: CryptoKey, plainData: ArrayBuffer | Uint8Array, rawKey?: string): Promise<ArrayBuffer>\n\n decryptWithRawKey(rawKey: string, plainData: ArrayBuffer | Uint8Array): Promise<ArrayBuffer>\n\n /**\n *\n * @param cryptoKey (CryptoKey)\n * @param encryptedData (ArrayBuffer)\n * @param rawKey\n * @returns {Promise} will be ArrayBuffer\n */\n decrypt(cryptoKey: CryptoKey, encryptedData: ArrayBuffer | Uint8Array, rawKey?: string): Promise<ArrayBuffer>\n\n /**\n * @deprecated this method is not correct: in some cases decryption may not fail even if the wrong key is used: if the\n * first provided keys are wrong and the last one is correct the decryption will succeed for sure, but there is a small\n * chance that you will get garbage\n */\n decryptSome(cryptoKeys: CryptoKey[], uint8Array: Uint8Array): Promise<ArrayBuffer>\n\n /**\n *\n * @param toHex boolean, if true, it returns hex String\n * @returns {Promise} either Hex string or CryptoKey\n */\n generateCryptoKey(toHex: false): Promise<CryptoKey>\n\n generateCryptoKey(toHex: true): Promise<string>\n\n generateCryptoKey(toHex: boolean): Promise<string | CryptoKey>\n\n generateIV(ivByteLength: number): Uint8Array\n\n /**\n * This function return a promise which will be the key Format will be either 'raw' or 'jwk'.\n * JWK: Json Web key (ref. http://tools.ietf.org/html/draft-ietf-jose-json-web-key-11)\n *\n * @param cryptoKey CryptoKey\n * @param format will be 'raw' or 'jwk'\n * @returns {Promise} will the AES Key\n */\n exportKey(cryptoKey: CryptoKey, format: 'raw'): Promise<ArrayBuffer>\n\n exportKey(cryptoKey: CryptoKey, format: 'jwk'): Promise<JsonWebKey>\n\n exportKey(cryptoKey: CryptoKey, format: 'jwk' | 'raw'): Promise<ArrayBuffer | JsonWebKey>\n\n /**\n * the ability to import a key that have already been created elsewhere, for use within the web\n * application that is invoking the import function, for use within the importing web application's\n * origin. This necessiates an interoperable key format, such as JSON Web Key [JWK] which may be\n * represented as octets.\n *\n * https://chromium.googlesource.com/chromium/blink.git/+/6b902997e3ca0384c8fa6fe56f79ecd7589d3ca6/LayoutTests/crypto/resources/common.js\n *\n * @param format 'raw' or 'jwk'\n * @param aesKey\n * @returns {*}\n */\n importKey(format: 'jwk' | 'raw', aesKey: JsonWebKey | ArrayBuffer | Uint8Array): Promise<CryptoKey>\n}\n\nexport class AESUtilsImpl implements AESUtils {\n /********* AES Config **********/\n ivLength = 16\n aesAlgorithmEncryptName = 'AES-CBC'\n\n aesKeyGenParams: AesKeyGenParams = {\n name: 'AES-CBC',\n length: 256,\n }\n private crypto: Crypto\n private _debug: boolean = false\n\n set debug(value: boolean) {\n this._debug = value\n }\n\n constructor(crypto: Crypto = typeof window !== 'undefined' ? window.crypto : typeof self !== 'undefined' ? self.crypto : ({} as Crypto)) {\n this.crypto = crypto\n }\n\n async encryptWithRawKey(rawKey: string, plainData: ArrayBuffer | Uint8Array): Promise<ArrayBuffer> {\n return this.encrypt(\n await this.importKey('raw', hex2ua(rawKey.replace(/-/g, ''))),\n plainData,\n rawKey // Used for logging only if debug is enabled, ok to always pass\n )\n }\n\n encrypt(cryptoKey: CryptoKey, plainData: ArrayBuffer | Uint8Array, rawKey = '<NA>'): Promise<ArrayBuffer> {\n return new Promise((resolve: (value: ArrayBuffer) => any, reject: (reason: any) => any) => {\n if (plainData instanceof Uint8Array) {\n const buffer = plainData.buffer\n plainData = (buffer.byteLength > plainData.byteLength ? buffer.slice(0, plainData.byteLength) : buffer) as ArrayBuffer\n }\n const aesAlgorithmEncrypt = {\n name: this.aesAlgorithmEncryptName,\n iv: this.generateIV(this.ivLength),\n }\n this._debug && console.log(`encrypt ${ua2hex(plainData)} with ${rawKey}`)\n this.crypto.subtle\n .encrypt(\n {\n ...aesAlgorithmEncrypt,\n } /* some ill behaved implementations change the values in place */,\n cryptoKey,\n plainData\n )\n .then(\n (cipherData) => {\n this._debug && console.log(`cipherData: ${ua2hex(cipherData)}`)\n return resolve(appendBuffer(aesAlgorithmEncrypt.iv.buffer as ArrayBuffer, cipherData))\n },\n (err) => reject('AES encryption failed: ' + err)\n )\n })\n }\n\n async decryptWithRawKey(rawKey: string, plainData: ArrayBuffer | Uint8Array): Promise<ArrayBuffer> {\n return this.decrypt(\n await this.importKey('raw', hex2ua(rawKey.replace(/-/g, ''))),\n plainData,\n rawKey // Used for logging only if debug is enabled, ok to always pass\n )\n }\n\n /**\n *\n * @param cryptoKey (CryptoKey)\n * @param encryptedData (ArrayBuffer)\n * @param rawKey\n * @returns {Promise} will be ArrayBuffer\n */\n decrypt(cryptoKey: CryptoKey, encryptedData: ArrayBuffer | Uint8Array, rawKey?: string): Promise<ArrayBuffer> {\n return new Promise((resolve: (value: ArrayBuffer) => any, reject: (reason: any) => any) => {\n if (!cryptoKey) {\n return reject('No crypto key provided for decryption')\n }\n const encryptedDataUint8 = encryptedData instanceof ArrayBuffer ? new Uint8Array(encryptedData) : encryptedData\n const aesAlgorithmEncrypt = {\n name: this.aesAlgorithmEncryptName,\n iv: encryptedDataUint8.subarray(0, this.ivLength),\n\n /*\n * IF THIS BIT OF CODE PRODUCES A DOMEXCEPTION CODE 0 ERROR, IT MIGHT BE RELATED TO THIS:\n *\n * NOTOK:\n * if (!hcparty.hcPartyKeys && !hcparty.hcPartyKeys[hcpartyId] && hcparty.hcPartyKeys[hcpartyId].length !== 2) {\n * throw 'No hcPartyKey for this Healthcare party(' + hcpartyId + ').';\n * }\n * var delegateHcPartyKey = hcparty.hcPartyKeys[hcpartyId][1];\n *\n * SHOULD BE:\n * var delegatorId = patient.delegations[hcpartyId][0].owner;\n * if (!hcparty.hcPartyKeys && !hcparty.hcPartyKeys[delegatorId] && hcparty.hcPartyKeys[delegatorId].length !== 2) {\n * throw 'No hcPartyKey for this Healthcare party(' + delegatorId + ').';\n * }\n * var delegateHcPartyKey = hcparty.hcPartyKeys[delegatorId][1];\n */\n }\n this._debug && console.log(`decrypt ${ua2hex(encryptedData)} with ${rawKey}`)\n this.crypto.subtle.decrypt(aesAlgorithmEncrypt, cryptoKey, encryptedDataUint8.subarray(this.ivLength, encryptedDataUint8.length)).then(\n (decipheredData) => {\n this._debug && console.log(`decipheredData: ${ua2hex(decipheredData)}`)\n resolve(decipheredData)\n },\n (err) => {\n reject(new Error('AES decryption failed: ' + err))\n }\n )\n })\n }\n\n async decryptSome(cryptoKeys: CryptoKey[], uint8Array: Uint8Array): Promise<ArrayBuffer> {\n try {\n return this.decrypt(cryptoKeys[0], uint8Array)\n } catch (e) {\n if (cryptoKeys.length > 1) {\n return this.decryptSome(cryptoKeys.slice(1), uint8Array)\n } else {\n throw e\n }\n }\n }\n\n // generate an AES key\n // noinspection JSUnusedGlobalSymbols\n /**\n *\n * @param toHex boolean, if true, it returns hex String\n * @returns {Promise} either Hex string or CryptoKey\n */\n generateCryptoKey(toHex: false): Promise<CryptoKey>\n generateCryptoKey(toHex: true): Promise<string>\n generateCryptoKey(toHex: boolean): Promise<string | CryptoKey> {\n return new Promise((resolve: (value: CryptoKey | string) => any, reject: (reason: any) => any) => {\n const extractable = true\n const keyUsages: KeyUsage[] = ['decrypt', 'encrypt']\n const cryptoKeyPromise: Promise<CryptoKey> = this.crypto.subtle.generateKey(this.aesKeyGenParams, extractable, keyUsages) as Promise<CryptoKey>\n return toHex === undefined || !toHex\n ? cryptoKeyPromise.then(resolve, reject)\n : cryptoKeyPromise.then((k) => this.exportKey(k, 'raw'), reject).then((raw) => resolve(ua2hex(raw)), reject)\n })\n }\n\n // noinspection JSMethodCanBeStatic\n generateIV(ivByteLength: number): Uint8Array {\n return new Uint8Array(this.crypto.getRandomValues(new Uint8Array(ivByteLength)))\n }\n\n /**\n * This function return a promise which will be the key Format will be either 'raw' or 'jwk'.\n * JWK: Json Web key (ref. http://tools.ietf.org/html/draft-ietf-jose-json-web-key-11)\n *\n * @param cryptoKey CryptoKey\n * @param format will be 'raw' or 'jwk'\n * @returns {Promise} will the AES Key\n */\n exportKey(cryptoKey: CryptoKey, format: 'raw'): Promise<ArrayBuffer>\n exportKey(cryptoKey: CryptoKey, format: 'jwk'): Promise<JsonWebKey>\n exportKey(cryptoKey: CryptoKey, format: 'jwk' | 'raw'): Promise<ArrayBuffer | JsonWebKey> {\n return new Promise((resolve: (value: ArrayBuffer | JsonWebKey) => any, reject: (reason: any) => any) => {\n return this.crypto.subtle.exportKey(format as any, cryptoKey).then(resolve, reject)\n })\n }\n\n /**\n * the ability to import a key that have already been created elsewhere, for use within the web\n * application that is invoking the import function, for use within the importing web application's\n * origin. This necessiates an interoperable key format, such as JSON Web Key [JWK] which may be\n * represented as octets.\n *\n * https://chromium.googlesource.com/chromium/blink.git/+/6b902997e3ca0384c8fa6fe56f79ecd7589d3ca6/LayoutTests/crypto/resources/common.js\n *\n * @param format 'raw' or 'jwk'\n * @param aesKey\n * @returns {*}\n */\n importKey(format: 'jwk' | 'raw', aesKey: JsonWebKey | ArrayBuffer | Uint8Array): Promise<CryptoKey> {\n return new Promise((resolve: (value: CryptoKey) => any, reject: (reason: any) => any) => {\n const extractable = true\n const keyUsages: KeyUsage[] = ['decrypt', 'encrypt']\n return this.crypto.subtle\n .importKey(format as any, aesKey as any, this.aesKeyGenParams, extractable, keyUsages)\n .catch((err) => {\n if (format == 'raw' && (aesKey instanceof ArrayBuffer || ArrayBuffer.isView(aesKey))) {\n console.warn(`Import of key ${ua2hex(aesKey)} failed`)\n }\n throw err\n })\n .then(resolve, reject)\n })\n }\n}\n\nexport const AES = new AESUtilsImpl()\n"]}
1
+ {"version":3,"file":"AES.js","sourceRoot":"","sources":["../../../icc-x-api/crypto/AES.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oCAA8D;AAmE9D,MAAa,YAAY;IAYvB,IAAI,KAAK,CAAC,KAAc;QACtB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;IACrB,CAAC;IAED,YAAY,SAAiB,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAE,EAAa;QAfvI,iCAAiC;QACjC,aAAQ,GAAG,EAAE,CAAA;QACb,4BAAuB,GAAG,SAAS,CAAA;QAEnC,oBAAe,GAAoB;YACjC,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,GAAG;SACZ,CAAA;QAEO,WAAM,GAAY,KAAK,CAAA;QAO7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAE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;gBACb,IAAI,MAAM,IAAI,KAAK,IAAI,CAAC,MAAM,YAAY,WAAW,IAAI,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;oBACrF,OAAO,CAAC,IAAI,CAAC,iBAAiB,IAAA,cAAM,EAAC,MAAM,CAAC,SAAS,CAAC,CAAA;gBACxD,CAAC;gBACD,MAAM,GAAG,CAAA;YACX,CAAC,CAAC;iBACD,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;QAC1B,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AAhMD,oCAgMC;AAEY,QAAA,GAAG,GAAG,IAAI,YAAY,EAAE,CAAA","sourcesContent":["import { appendBuffer, hex2ua, ua2ab, ua2hex } from '../utils'\n\nexport interface AESUtils {\n encryptWithRawKey(rawKey: string, plainData: ArrayBuffer | Uint8Array): Promise<ArrayBuffer>\n\n encrypt(cryptoKey: CryptoKey, plainData: ArrayBuffer | Uint8Array, rawKey?: string): Promise<ArrayBuffer>\n\n decryptWithRawKey(rawKey: string, plainData: ArrayBuffer | Uint8Array): Promise<ArrayBuffer>\n\n /**\n *\n * @param cryptoKey (CryptoKey)\n * @param encryptedData (ArrayBuffer)\n * @param rawKey\n * @returns {Promise} will be ArrayBuffer\n */\n decrypt(cryptoKey: CryptoKey, encryptedData: ArrayBuffer | Uint8Array, rawKey?: string): Promise<ArrayBuffer>\n\n /**\n * @deprecated this method is not correct: in some cases decryption may not fail even if the wrong key is used: if the\n * first provided keys are wrong and the last one is correct the decryption will succeed for sure, but there is a small\n * chance that you will get garbage\n */\n decryptSome(cryptoKeys: CryptoKey[], uint8Array: Uint8Array): Promise<ArrayBuffer>\n\n /**\n *\n * @param toHex boolean, if true, it returns hex String\n * @returns {Promise} either Hex string or CryptoKey\n */\n generateCryptoKey(toHex: false): Promise<CryptoKey>\n\n generateCryptoKey(toHex: true): Promise<string>\n\n generateCryptoKey(toHex: boolean): Promise<string | CryptoKey>\n\n generateIV(ivByteLength: number): Uint8Array\n\n /**\n * This function return a promise which will be the key Format will be either 'raw' or 'jwk'.\n * JWK: Json Web key (ref. http://tools.ietf.org/html/draft-ietf-jose-json-web-key-11)\n *\n * @param cryptoKey CryptoKey\n * @param format will be 'raw' or 'jwk'\n * @returns {Promise} will the AES Key\n */\n exportKey(cryptoKey: CryptoKey, format: 'raw'): Promise<ArrayBuffer>\n\n exportKey(cryptoKey: CryptoKey, format: 'jwk'): Promise<JsonWebKey>\n\n exportKey(cryptoKey: CryptoKey, format: 'jwk' | 'raw'): Promise<ArrayBuffer | JsonWebKey>\n\n /**\n * the ability to import a key that have already been created elsewhere, for use within the web\n * application that is invoking the import function, for use within the importing web application's\n * origin. This necessiates an interoperable key format, such as JSON Web Key [JWK] which may be\n * represented as octets.\n *\n * https://chromium.googlesource.com/chromium/blink.git/+/6b902997e3ca0384c8fa6fe56f79ecd7589d3ca6/LayoutTests/crypto/resources/common.js\n *\n * @param format 'raw' or 'jwk'\n * @param aesKey\n * @returns {*}\n */\n importKey(format: 'jwk' | 'raw', aesKey: JsonWebKey | ArrayBuffer | Uint8Array): Promise<CryptoKey>\n}\n\nexport class AESUtilsImpl implements AESUtils {\n /********* AES Config **********/\n ivLength = 16\n aesAlgorithmEncryptName = 'AES-CBC'\n\n aesKeyGenParams: AesKeyGenParams = {\n name: 'AES-CBC',\n length: 256,\n }\n private crypto: Crypto\n private _debug: boolean = false\n\n set debug(value: boolean) {\n this._debug = value\n }\n\n constructor(crypto: Crypto = typeof window !== 'undefined' ? window.crypto : typeof self !== 'undefined' ? self.crypto : ({} as Crypto)) {\n this.crypto = crypto\n }\n\n async encryptWithRawKey(rawKey: string, plainData: ArrayBuffer | Uint8Array): Promise<ArrayBuffer> {\n return this.encrypt(\n await this.importKey('raw', hex2ua(rawKey.replace(/-/g, ''))),\n plainData,\n rawKey // Used for logging only if debug is enabled, ok to always pass\n )\n }\n\n encrypt(cryptoKey: CryptoKey, plainData: ArrayBuffer | Uint8Array, rawKey = '<NA>'): Promise<ArrayBuffer> {\n return new Promise((resolve: (value: ArrayBuffer) => any, reject: (reason: any) => any) => {\n if (plainData instanceof Uint8Array) {\n const buffer = plainData.buffer\n plainData = (buffer.byteLength > plainData.byteLength ? buffer.slice(0, plainData.byteLength) : buffer) as ArrayBuffer\n }\n const aesAlgorithmEncrypt = {\n name: this.aesAlgorithmEncryptName,\n iv: this.generateIV(this.ivLength),\n }\n this._debug && console.log(`encrypt ${ua2hex(plainData)} with ${rawKey}`)\n this.crypto.subtle\n .encrypt(\n {\n ...aesAlgorithmEncrypt,\n } /* some ill behaved implementations change the values in place */,\n cryptoKey,\n plainData\n )\n .then(\n (cipherData) => {\n this._debug && console.log(`cipherData: ${ua2hex(cipherData)}`)\n return resolve(appendBuffer(aesAlgorithmEncrypt.iv.buffer as ArrayBuffer, cipherData))\n },\n (err) => reject('AES encryption failed: ' + err)\n )\n })\n }\n\n async decryptWithRawKey(rawKey: string, plainData: ArrayBuffer | Uint8Array): Promise<ArrayBuffer> {\n return this.decrypt(\n await this.importKey('raw', hex2ua(rawKey.replace(/-/g, ''))),\n plainData,\n rawKey // Used for logging only if debug is enabled, ok to always pass\n )\n }\n\n /**\n *\n * @param cryptoKey (CryptoKey)\n * @param encryptedData (ArrayBuffer)\n * @param rawKey\n * @returns {Promise} will be ArrayBuffer\n */\n decrypt(cryptoKey: CryptoKey, encryptedData: ArrayBuffer | Uint8Array, rawKey?: string): Promise<ArrayBuffer> {\n return new Promise((resolve: (value: ArrayBuffer) => any, reject: (reason: any) => any) => {\n if (!cryptoKey) {\n return reject('No crypto key provided for decryption')\n }\n const encryptedDataUint8 = encryptedData instanceof ArrayBuffer ? new Uint8Array(encryptedData) : encryptedData\n const aesAlgorithmEncrypt = {\n name: this.aesAlgorithmEncryptName,\n iv: encryptedDataUint8.subarray(0, this.ivLength),\n\n /*\n * IF THIS BIT OF CODE PRODUCES A DOMEXCEPTION CODE 0 ERROR, IT MIGHT BE RELATED TO THIS:\n *\n * NOTOK:\n * if (!hcparty.hcPartyKeys && !hcparty.hcPartyKeys[hcpartyId] && hcparty.hcPartyKeys[hcpartyId].length !== 2) {\n * throw 'No hcPartyKey for this Healthcare party(' + hcpartyId + ').';\n * }\n * var delegateHcPartyKey = hcparty.hcPartyKeys[hcpartyId][1];\n *\n * SHOULD BE:\n * var delegatorId = patient.delegations[hcpartyId][0].owner;\n * if (!hcparty.hcPartyKeys && !hcparty.hcPartyKeys[delegatorId] && hcparty.hcPartyKeys[delegatorId].length !== 2) {\n * throw 'No hcPartyKey for this Healthcare party(' + delegatorId + ').';\n * }\n * var delegateHcPartyKey = hcparty.hcPartyKeys[delegatorId][1];\n */\n }\n this._debug && console.log(`decrypt ${ua2hex(encryptedData)} with ${rawKey}`)\n this.crypto.subtle.decrypt(aesAlgorithmEncrypt, cryptoKey, ua2ab(encryptedDataUint8.subarray(this.ivLength, encryptedDataUint8.length))).then(\n (decipheredData) => {\n this._debug && console.log(`decipheredData: ${ua2hex(decipheredData)}`)\n resolve(decipheredData)\n },\n (err) => {\n reject(new Error('AES decryption failed: ' + err))\n }\n )\n })\n }\n\n async decryptSome(cryptoKeys: CryptoKey[], uint8Array: Uint8Array): Promise<ArrayBuffer> {\n try {\n return this.decrypt(cryptoKeys[0], uint8Array)\n } catch (e) {\n if (cryptoKeys.length > 1) {\n return this.decryptSome(cryptoKeys.slice(1), uint8Array)\n } else {\n throw e\n }\n }\n }\n\n // generate an AES key\n // noinspection JSUnusedGlobalSymbols\n /**\n *\n * @param toHex boolean, if true, it returns hex String\n * @returns {Promise} either Hex string or CryptoKey\n */\n generateCryptoKey(toHex: false): Promise<CryptoKey>\n generateCryptoKey(toHex: true): Promise<string>\n generateCryptoKey(toHex: boolean): Promise<string | CryptoKey> {\n return new Promise((resolve: (value: CryptoKey | string) => any, reject: (reason: any) => any) => {\n const extractable = true\n const keyUsages: KeyUsage[] = ['decrypt', 'encrypt']\n const cryptoKeyPromise: Promise<CryptoKey> = this.crypto.subtle.generateKey(this.aesKeyGenParams, extractable, keyUsages) as Promise<CryptoKey>\n return toHex === undefined || !toHex\n ? cryptoKeyPromise.then(resolve, reject)\n : cryptoKeyPromise.then((k) => this.exportKey(k, 'raw'), reject).then((raw) => resolve(ua2hex(raw)), reject)\n })\n }\n\n // noinspection JSMethodCanBeStatic\n generateIV(ivByteLength: number): Uint8Array {\n return new Uint8Array(this.crypto.getRandomValues(new Uint8Array(ivByteLength)))\n }\n\n /**\n * This function return a promise which will be the key Format will be either 'raw' or 'jwk'.\n * JWK: Json Web key (ref. http://tools.ietf.org/html/draft-ietf-jose-json-web-key-11)\n *\n * @param cryptoKey CryptoKey\n * @param format will be 'raw' or 'jwk'\n * @returns {Promise} will the AES Key\n */\n exportKey(cryptoKey: CryptoKey, format: 'raw'): Promise<ArrayBuffer>\n exportKey(cryptoKey: CryptoKey, format: 'jwk'): Promise<JsonWebKey>\n exportKey(cryptoKey: CryptoKey, format: 'jwk' | 'raw'): Promise<ArrayBuffer | JsonWebKey> {\n return new Promise((resolve: (value: ArrayBuffer | JsonWebKey) => any, reject: (reason: any) => any) => {\n return this.crypto.subtle.exportKey(format as any, cryptoKey).then(resolve, reject)\n })\n }\n\n /**\n * the ability to import a key that have already been created elsewhere, for use within the web\n * application that is invoking the import function, for use within the importing web application's\n * origin. This necessiates an interoperable key format, such as JSON Web Key [JWK] which may be\n * represented as octets.\n *\n * https://chromium.googlesource.com/chromium/blink.git/+/6b902997e3ca0384c8fa6fe56f79ecd7589d3ca6/LayoutTests/crypto/resources/common.js\n *\n * @param format 'raw' or 'jwk'\n * @param aesKey\n * @returns {*}\n */\n importKey(format: 'jwk' | 'raw', aesKey: JsonWebKey | ArrayBuffer | Uint8Array): Promise<CryptoKey> {\n return new Promise((resolve: (value: CryptoKey) => any, reject: (reason: any) => any) => {\n const extractable = true\n const keyUsages: KeyUsage[] = ['decrypt', 'encrypt']\n return this.crypto.subtle\n .importKey(format as any, aesKey as any, this.aesKeyGenParams, extractable, keyUsages)\n .catch((err) => {\n if (format == 'raw' && (aesKey instanceof ArrayBuffer || ArrayBuffer.isView(aesKey))) {\n console.warn(`Import of key ${ua2hex(aesKey)} failed`)\n }\n throw err\n })\n .then(resolve, reject)\n })\n }\n}\n\nexport const AES = new AESUtilsImpl()\n"]}
@@ -150,7 +150,7 @@ class BaseExchangeDataManager {
150
150
  */
151
151
  tryDecryptAccessControlSecret(exchangeData, decryptionKeys) {
152
152
  return __awaiter(this, void 0, void 0, function* () {
153
- return yield this.tryDecryptExchangeData(exchangeData, decryptionKeys, (ed) => ed.accessControlSecret, (d) => this.importAccessControlSecret(new Uint8Array(d)));
153
+ return yield this.tryDecryptExchangeData(exchangeData, decryptionKeys, (ed) => ed.accessControlSecret, (d) => this.importAccessControlSecret(new Uint8Array(d).buffer));
154
154
  });
155
155
  }
156
156
  /**
@@ -163,7 +163,7 @@ class BaseExchangeDataManager {
163
163
  */
164
164
  tryDecryptExchangeKeys(exchangeData, decryptionKeys) {
165
165
  return __awaiter(this, void 0, void 0, function* () {
166
- return yield this.tryDecryptExchangeData(exchangeData, decryptionKeys, (ed) => ed.exchangeKey, (d) => this.importExchangeKey(new Uint8Array(d)));
166
+ return yield this.tryDecryptExchangeData(exchangeData, decryptionKeys, (ed) => ed.exchangeKey, (d) => this.importExchangeKey(new Uint8Array(d).buffer));
167
167
  });
168
168
  }
169
169
  /**
@@ -176,7 +176,7 @@ class BaseExchangeDataManager {
176
176
  */
177
177
  tryDecryptSharedSignatureKeys(exchangeData, decryptionKeys) {
178
178
  return __awaiter(this, void 0, void 0, function* () {
179
- return yield this.tryDecryptExchangeData(exchangeData, decryptionKeys, (ed) => ed.sharedSignatureKey, (d) => this.importSharedSignatureKey(new Uint8Array(d)));
179
+ return yield this.tryDecryptExchangeData(exchangeData, decryptionKeys, (ed) => ed.sharedSignatureKey, (d) => this.importSharedSignatureKey(new Uint8Array(d).buffer));
180
180
  });
181
181
  }
182
182
  tryDecryptExchangeData(exchangeData, decryptionKeys, encryptedDataSelector, unmarshalDecrypted) {
@@ -311,9 +311,9 @@ class BaseExchangeDataManager {
311
311
  return __awaiter(this, arguments, void 0, function* ({ exchangeData, newEncryptionKeys, rawExchangeKey, rawAccessControlSecret, rawSharedSignatureKey, newDelegatorSignatureKeys, }) {
312
312
  var _b;
313
313
  const self = yield this.dataOwnerApi.getCurrentDataOwnerId();
314
- const exchangeKey = yield this.importExchangeKey(new Uint8Array(rawExchangeKey));
315
- const accessControlSecret = yield this.importAccessControlSecret(new Uint8Array(rawAccessControlSecret));
316
- const sharedSignatureKey = yield this.importSharedSignatureKey(new Uint8Array(rawSharedSignatureKey));
314
+ const exchangeKey = yield this.importExchangeKey(new Uint8Array(rawExchangeKey).buffer);
315
+ const accessControlSecret = yield this.importAccessControlSecret(new Uint8Array(rawAccessControlSecret).buffer);
316
+ const sharedSignatureKey = yield this.importSharedSignatureKey(new Uint8Array(rawSharedSignatureKey).buffer);
317
317
  const existingExchangeKeyEntries = new Set(Object.keys(exchangeData.exchangeKey));
318
318
  const existingAcsEntries = new Set(Object.keys(exchangeData.accessControlSecret));
319
319
  const existingSharedSignatureKeyEntries = new Set(Object.keys(exchangeData.sharedSignatureKey));
@@ -368,7 +368,7 @@ class BaseExchangeDataManager {
368
368
  ['publicKeysFingerprints', data.publicKeysFingerprintsV2.sort()],
369
369
  ];
370
370
  const signJson = JSON.stringify(signObject);
371
- return (0, utils_1.utf8_2ua)(signJson);
371
+ return (0, utils_1.ua2ab)((0, utils_1.utf8_2ua)(signJson));
372
372
  });
373
373
  }
374
374
  bytesToSignForDelegatorSignature(data) {
@@ -379,7 +379,7 @@ class BaseExchangeDataManager {
379
379
  // Generates a new exchange key
380
380
  generateExchangeKey() {
381
381
  return __awaiter(this, void 0, void 0, function* () {
382
- const rawBytes = yield this.primitives.randomBytes(32);
382
+ const rawBytes = (0, utils_1.ua2ab)(this.primitives.randomBytes(32));
383
383
  return {
384
384
  key: yield this.importExchangeKey(rawBytes),
385
385
  rawBytes,
@@ -415,7 +415,7 @@ class BaseExchangeDataManager {
415
415
  // Generates a new access control secret
416
416
  generateAccessControlSecret() {
417
417
  return __awaiter(this, void 0, void 0, function* () {
418
- const rawBytes = this.primitives.randomBytes(16);
418
+ const rawBytes = (0, utils_1.ua2ab)(this.primitives.randomBytes(16));
419
419
  return {
420
420
  secret: yield this.importAccessControlSecret(rawBytes),
421
421
  rawBytes,
@@ -426,7 +426,7 @@ class BaseExchangeDataManager {
426
426
  return Promise.resolve((0, utils_1.ua2hex)(decryptedBytes));
427
427
  }
428
428
  exportAccessControlSecret(secret) {
429
- return Promise.resolve((0, utils_1.hex2ua)(secret));
429
+ return Promise.resolve((0, utils_1.ua2ab)((0, utils_1.hex2ua)(secret)));
430
430
  }
431
431
  encryptDataWithKeys(rawData, keys) {
432
432
  return __awaiter(this, void 0, void 0, function* () {
@@ -451,7 +451,7 @@ class BaseExchangeDataManager {
451
451
  return __awaiter(this, void 0, void 0, function* () {
452
452
  const res = {};
453
453
  for (const [fp, key] of Object.entries(keys)) {
454
- res[(0, utils_2.fingerprintV1toV2)(fp)] = (0, utils_1.ua2b64)(yield this.primitives.HMAC.sign(yield this.extractHmacFromRsaPrivate(key), new Uint8Array(rawData)));
454
+ res[(0, utils_2.fingerprintV1toV2)(fp)] = (0, utils_1.ua2b64)(yield this.primitives.HMAC.sign(yield this.extractHmacFromRsaPrivate(key), new Uint8Array(rawData).buffer));
455
455
  }
456
456
  return res;
457
457
  });
@@ -466,7 +466,7 @@ class BaseExchangeDataManager {
466
466
  for (const [fp, signature] of Object.entries((_a = exchangeData.delegatorSignature) !== null && _a !== void 0 ? _a : {})) {
467
467
  const verificationKey = keysByV2Fp[fp];
468
468
  if (verificationKey &&
469
- (yield this.primitives.HMAC.verify(yield this.extractHmacFromRsaPrivate(verificationKey), delegatorSignatureData, (0, utils_1.b64_2ua)(signature))))
469
+ (yield this.primitives.HMAC.verify(yield this.extractHmacFromRsaPrivate(verificationKey), delegatorSignatureData, (0, utils_1.ua2ab)((0, utils_1.b64_2ua)(signature)))))
470
470
  return true;
471
471
  }
472
472
  return false;
@@ -474,12 +474,12 @@ class BaseExchangeDataManager {
474
474
  }
475
475
  signDataWithSharedKey(rawData, key) {
476
476
  return __awaiter(this, void 0, void 0, function* () {
477
- return (0, utils_1.ua2b64)(yield this.primitives.HMAC.sign(key, new Uint8Array(rawData)));
477
+ return (0, utils_1.ua2b64)(yield this.primitives.HMAC.sign(key, new Uint8Array(rawData).buffer));
478
478
  });
479
479
  }
480
480
  verifyDataWithSharedKey(rawData, key, signature) {
481
481
  return __awaiter(this, void 0, void 0, function* () {
482
- return yield this.primitives.HMAC.verify(key, new Uint8Array(rawData), (0, utils_1.b64_2ua)(signature));
482
+ return yield this.primitives.HMAC.verify(key, new Uint8Array(rawData).buffer, (0, utils_1.ua2ab)((0, utils_1.b64_2ua)(signature)));
483
483
  });
484
484
  }
485
485
  }