@icure/api 8.6.18 → 8.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/icc-api/api/IccDocumentApi.d.ts +10 -2
- package/icc-api/api/IccDocumentApi.js +22 -4
- package/icc-api/api/IccDocumentApi.js.map +1 -1
- package/icc-api/api/IccReceiptApi.d.ts +17 -0
- package/icc-api/api/IccReceiptApi.js +52 -0
- package/icc-api/api/IccReceiptApi.js.map +1 -1
- package/icc-api/model/DataAttachment.d.ts +22 -0
- package/icc-api/model/DataAttachment.js.map +1 -1
- package/icc-api/model/Document.d.ts +6 -0
- package/icc-api/model/Document.js.map +1 -1
- package/icc-api/model/Receipt.d.ts +6 -0
- package/icc-api/model/Receipt.js.map +1 -1
- package/icc-x-api/crypto/BaseExchangeDataManager.js +2 -2
- package/icc-x-api/crypto/BaseExchangeDataManager.js.map +1 -1
- package/icc-x-api/crypto/ExchangeDataManager.js +3 -3
- package/icc-x-api/crypto/ExchangeDataManager.js.map +1 -1
- package/icc-x-api/crypto/ExtendedApisUtils.d.ts +1 -1
- package/icc-x-api/crypto/ExtendedApisUtils.js.map +1 -1
- package/icc-x-api/crypto/ExtendedApisUtilsImpl.d.ts +1 -1
- package/icc-x-api/crypto/ExtendedApisUtilsImpl.js +8 -2
- package/icc-x-api/crypto/ExtendedApisUtilsImpl.js.map +1 -1
- package/icc-x-api/crypto/RecoveryDataEncryption.js.map +1 -1
- package/icc-x-api/icc-accesslog-x-api.js +7 -7
- package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
- package/icc-x-api/icc-calendar-item-x-api.js +7 -7
- package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
- package/icc-x-api/icc-classification-x-api.js +4 -5
- package/icc-x-api/icc-classification-x-api.js.map +1 -1
- package/icc-x-api/icc-code-x-api.d.ts +2 -2
- package/icc-x-api/icc-code-x-api.js +3 -33
- package/icc-x-api/icc-code-x-api.js.map +1 -1
- package/icc-x-api/icc-contact-x-api.js +20 -33
- package/icc-x-api/icc-contact-x-api.js.map +1 -1
- package/icc-x-api/icc-doctemplate-x-api.js.map +1 -1
- package/icc-x-api/icc-document-x-api.d.ts +8 -7
- package/icc-x-api/icc-document-x-api.js +64 -22
- package/icc-x-api/icc-document-x-api.js.map +1 -1
- package/icc-x-api/icc-form-x-api.js +3 -4
- package/icc-x-api/icc-form-x-api.js.map +1 -1
- package/icc-x-api/icc-helement-x-api.js +11 -11
- package/icc-x-api/icc-helement-x-api.js.map +1 -1
- package/icc-x-api/icc-invoice-x-api.js +3 -4
- package/icc-x-api/icc-invoice-x-api.js.map +1 -1
- package/icc-x-api/icc-maintenance-task-x-api.js +3 -3
- package/icc-x-api/icc-maintenance-task-x-api.js.map +1 -1
- package/icc-x-api/icc-patient-x-api.js +29 -29
- package/icc-x-api/icc-patient-x-api.js.map +1 -1
- package/icc-x-api/icc-receipt-x-api.d.ts +40 -0
- package/icc-x-api/icc-receipt-x-api.js +79 -1
- package/icc-x-api/icc-receipt-x-api.js.map +1 -1
- package/icc-x-api/icc-topic-x-api.js.map +1 -1
- package/icc-x-api/index.js +1 -1
- package/icc-x-api/index.js.map +1 -1
- package/icc-x-api/utils/code-util.d.ts +23 -0
- package/icc-x-api/utils/code-util.js +39 -2
- package/icc-x-api/utils/code-util.js.map +1 -1
- package/icc-x-api/utils/collection-utils.d.ts +13 -0
- package/icc-x-api/utils/collection-utils.js +69 -0
- package/icc-x-api/utils/collection-utils.js.map +1 -1
- package/icc-x-api/utils/compression-utils.d.ts +28 -0
- package/icc-x-api/utils/compression-utils.js +106 -0
- package/icc-x-api/utils/compression-utils.js.map +1 -0
- package/icc-x-api/utils/crypto-utils.js +7 -7
- package/icc-x-api/utils/crypto-utils.js.map +1 -1
- package/icc-x-api/utils/formatting-util.d.ts +1 -3
- package/icc-x-api/utils/formatting-util.js +15 -17
- package/icc-x-api/utils/formatting-util.js.map +1 -1
- package/icc-x-api/utils/hcp-util.js +2 -3
- package/icc-x-api/utils/hcp-util.js.map +1 -1
- package/icc-x-api/utils/insurability-util.js +10 -8
- package/icc-x-api/utils/insurability-util.js.map +1 -1
- package/icc-x-api/utils/lzma-wasm.d.ts +6 -0
- package/icc-x-api/utils/lzma-wasm.js +81 -0
- package/icc-x-api/utils/lzma-wasm.js.map +1 -0
- package/icc-x-api/utils/mutex.d.ts +12 -0
- package/icc-x-api/utils/mutex.js +26 -0
- package/icc-x-api/utils/mutex.js.map +1 -0
- package/icc-x-api/utils/websocket.js +7 -7
- package/icc-x-api/utils/websocket.js.map +1 -1
- package/icc-x-api/wasm/lzma/lzma.js +2 -0
- package/icc-x-api/wasm/lzma/lzma.wasm +0 -0
- package/package.json +2 -11
- package/icc-x-api/utils/uuid-encoder.d.ts +0 -44
- package/icc-x-api/utils/uuid-encoder.js +0 -114
- package/icc-x-api/utils/uuid-encoder.js.map +0 -1
- package/test/icc-api/api/IccAgendaApi.d.ts +0 -1
- package/test/icc-api/api/IccAgendaApi.js +0 -64
- package/test/icc-api/api/IccAgendaApi.js.map +0 -1
- package/test/icc-api/api/IccAnonymousAccessApi.d.ts +0 -1
- package/test/icc-api/api/IccAnonymousAccessApi.js +0 -58
- package/test/icc-api/api/IccAnonymousAccessApi.js.map +0 -1
- package/test/icc-api/api/IccCalendarItemApi.d.ts +0 -1
- package/test/icc-api/api/IccCalendarItemApi.js +0 -67
- package/test/icc-api/api/IccCalendarItemApi.js.map +0 -1
- package/test/icc-api/api/IccCalendarItemTypeApi.d.ts +0 -1
- package/test/icc-api/api/IccCalendarItemTypeApi.js +0 -96
- package/test/icc-api/api/IccCalendarItemTypeApi.js.map +0 -1
- package/test/icc-api/api/IccCodeApi.d.ts +0 -1
- package/test/icc-api/api/IccCodeApi.js +0 -38
- package/test/icc-api/api/IccCodeApi.js.map +0 -1
- package/test/icc-api/api/IccDocumentApi.d.ts +0 -1
- package/test/icc-api/api/IccDocumentApi.js +0 -199
- package/test/icc-api/api/IccDocumentApi.js.map +0 -1
- package/test/icc-api/api/IccGroupApi.d.ts +0 -1
- package/test/icc-api/api/IccGroupApi.js +0 -50
- package/test/icc-api/api/IccGroupApi.js.map +0 -1
- package/test/icc-api/api/IccKeywordApi.d.ts +0 -1
- package/test/icc-api/api/IccKeywordApi.js +0 -64
- package/test/icc-api/api/IccKeywordApi.js.map +0 -1
- package/test/icc-api/api/IccMedicalLocationApi.d.ts +0 -1
- package/test/icc-api/api/IccMedicalLocationApi.js +0 -64
- package/test/icc-api/api/IccMedicalLocationApi.js.map +0 -1
- package/test/icc-api/api/IccPlaceApi.d.ts +0 -1
- package/test/icc-api/api/IccPlaceApi.js +0 -64
- package/test/icc-api/api/IccPlaceApi.js.map +0 -1
- package/test/icc-api/api/IccRecoveryDataApi.d.ts +0 -1
- package/test/icc-api/api/IccRecoveryDataApi.js +0 -95
- package/test/icc-api/api/IccRecoveryDataApi.js.map +0 -1
- package/test/icc-api/api/IccRoleApi.d.ts +0 -1
- package/test/icc-api/api/IccRoleApi.js +0 -34
- package/test/icc-api/api/IccRoleApi.js.map +0 -1
- package/test/icc-api/api/IccUserApi.d.ts +0 -1
- package/test/icc-api/api/IccUserApi.js +0 -96
- package/test/icc-api/api/IccUserApi.js.map +0 -1
- package/test/icc-api/e2e/IccCalendarItemApi.d.ts +0 -1
- package/test/icc-api/e2e/IccCalendarItemApi.js +0 -46
- package/test/icc-api/e2e/IccCalendarItemApi.js.map +0 -1
- package/test/icc-api/model/modelHelpersTest.d.ts +0 -1
- package/test/icc-api/model/modelHelpersTest.js +0 -45
- package/test/icc-api/model/modelHelpersTest.js.map +0 -1
- package/test/icc-x-api/auth/group-switch-test.d.ts +0 -1
- package/test/icc-x-api/auth/group-switch-test.js +0 -81
- package/test/icc-x-api/auth/group-switch-test.js.map +0 -1
- package/test/icc-x-api/auth/jwt-concurrency-test.d.ts +0 -2
- package/test/icc-x-api/auth/jwt-concurrency-test.js +0 -112
- package/test/icc-x-api/auth/jwt-concurrency-test.js.map +0 -1
- package/test/icc-x-api/auth/jwt-provider-test.d.ts +0 -1
- package/test/icc-x-api/auth/jwt-provider-test.js +0 -197
- package/test/icc-x-api/auth/jwt-provider-test.js.map +0 -1
- package/test/icc-x-api/auth/smart-auth-provider-test.d.ts +0 -1
- package/test/icc-x-api/auth/smart-auth-provider-test.js +0 -224
- package/test/icc-x-api/auth/smart-auth-provider-test.js.map +0 -1
- package/test/icc-x-api/autofix-anonymity-test.d.ts +0 -1
- package/test/icc-x-api/autofix-anonymity-test.js +0 -122
- package/test/icc-x-api/autofix-anonymity-test.js.map +0 -1
- package/test/icc-x-api/confidential-entities-test.d.ts +0 -1
- package/test/icc-x-api/confidential-entities-test.js +0 -168
- package/test/icc-x-api/confidential-entities-test.js.map +0 -1
- package/test/icc-x-api/crud/comprehensive-crud-test.d.ts +0 -1
- package/test/icc-x-api/crud/comprehensive-crud-test.js +0 -276
- package/test/icc-x-api/crud/comprehensive-crud-test.js.map +0 -1
- package/test/icc-x-api/crud/entities-crud-test-interface.d.ts +0 -16
- package/test/icc-x-api/crud/entities-crud-test-interface.js +0 -408
- package/test/icc-x-api/crud/entities-crud-test-interface.js.map +0 -1
- package/test/icc-x-api/crypto/anonymous-delegations-test.d.ts +0 -1
- package/test/icc-x-api/crypto/anonymous-delegations-test.js +0 -587
- package/test/icc-x-api/crypto/anonymous-delegations-test.js.map +0 -1
- package/test/icc-x-api/crypto/concurrency.d.ts +0 -1
- package/test/icc-x-api/crypto/concurrency.js +0 -35
- package/test/icc-x-api/crypto/concurrency.js.map +0 -1
- package/test/icc-x-api/crypto/crypto-utils.d.ts +0 -1
- package/test/icc-x-api/crypto/crypto-utils.js +0 -79
- package/test/icc-x-api/crypto/crypto-utils.js.map +0 -1
- package/test/icc-x-api/crypto/cryptoTest.d.ts +0 -2
- package/test/icc-x-api/crypto/cryptoTest.js +0 -402
- package/test/icc-x-api/crypto/cryptoTest.js.map +0 -1
- package/test/icc-x-api/crypto/delegate-ci-to-patient-with-missing-keys-test.d.ts +0 -1
- package/test/icc-x-api/crypto/delegate-ci-to-patient-with-missing-keys-test.js +0 -166
- package/test/icc-x-api/crypto/delegate-ci-to-patient-with-missing-keys-test.js.map +0 -1
- package/test/icc-x-api/crypto/exchange-data-manager-test.d.ts +0 -1
- package/test/icc-x-api/crypto/exchange-data-manager-test.js +0 -674
- package/test/icc-x-api/crypto/exchange-data-manager-test.js.map +0 -1
- package/test/icc-x-api/crypto/full-crypto-test.d.ts +0 -1
- package/test/icc-x-api/crypto/full-crypto-test.js +0 -454
- package/test/icc-x-api/crypto/full-crypto-test.js.map +0 -1
- package/test/icc-x-api/crypto/legacy-metadata-migration-test.d.ts +0 -1
- package/test/icc-x-api/crypto/legacy-metadata-migration-test.js +0 -379
- package/test/icc-x-api/crypto/legacy-metadata-migration-test.js.map +0 -1
- package/test/icc-x-api/crypto/secure-delegations-manager-test.d.ts +0 -1
- package/test/icc-x-api/crypto/secure-delegations-manager-test.js +0 -278
- package/test/icc-x-api/crypto/secure-delegations-manager-test.js.map +0 -1
- package/test/icc-x-api/crypto/shamir.d.ts +0 -2
- package/test/icc-x-api/crypto/shamir.js +0 -167
- package/test/icc-x-api/crypto/shamir.js.map +0 -1
- package/test/icc-x-api/crypto/share-to-newly-created-patient-from-hcp.d.ts +0 -1
- package/test/icc-x-api/crypto/share-to-newly-created-patient-from-hcp.js +0 -71
- package/test/icc-x-api/crypto/share-to-newly-created-patient-from-hcp.js.map +0 -1
- package/test/icc-x-api/crypto/soft-deleted-data-owners.d.ts +0 -2
- package/test/icc-x-api/crypto/soft-deleted-data-owners.js +0 -113
- package/test/icc-x-api/crypto/soft-deleted-data-owners.js.map +0 -1
- package/test/icc-x-api/crypto/user-encryption-keys-manager-test.d.ts +0 -1
- package/test/icc-x-api/crypto/user-encryption-keys-manager-test.js +0 -246
- package/test/icc-x-api/crypto/user-encryption-keys-manager-test.js.map +0 -1
- package/test/icc-x-api/entity-with-attachments-api-test.d.ts +0 -1
- package/test/icc-x-api/entity-with-attachments-api-test.js +0 -142
- package/test/icc-x-api/entity-with-attachments-api-test.js.map +0 -1
- package/test/icc-x-api/filters/filters.d.ts +0 -1
- package/test/icc-x-api/filters/filters.js +0 -49
- package/test/icc-x-api/filters/filters.js.map +0 -1
- package/test/icc-x-api/filters/healthelement.d.ts +0 -1
- package/test/icc-x-api/filters/healthelement.js +0 -333
- package/test/icc-x-api/filters/healthelement.js.map +0 -1
- package/test/icc-x-api/icc-accesslog-x-api.d.ts +0 -1
- package/test/icc-x-api/icc-accesslog-x-api.js +0 -106
- package/test/icc-x-api/icc-accesslog-x-api.js.map +0 -1
- package/test/icc-x-api/icc-application-settings-x-api.d.ts +0 -1
- package/test/icc-x-api/icc-application-settings-x-api.js +0 -91
- package/test/icc-x-api/icc-application-settings-x-api.js.map +0 -1
- package/test/icc-x-api/icc-auth-api.d.ts +0 -1
- package/test/icc-x-api/icc-auth-api.js +0 -47
- package/test/icc-x-api/icc-auth-api.js.map +0 -1
- package/test/icc-x-api/icc-calendar-item-x-api.d.ts +0 -1
- package/test/icc-x-api/icc-calendar-item-x-api.js +0 -150
- package/test/icc-x-api/icc-calendar-item-x-api.js.map +0 -1
- package/test/icc-x-api/icc-contact-x-api.d.ts +0 -1
- package/test/icc-x-api/icc-contact-x-api.js +0 -355
- package/test/icc-x-api/icc-contact-x-api.js.map +0 -1
- package/test/icc-x-api/icc-document-x-api.d.ts +0 -1
- package/test/icc-x-api/icc-document-x-api.js +0 -76
- package/test/icc-x-api/icc-document-x-api.js.map +0 -1
- package/test/icc-x-api/icc-form-x-api.d.ts +0 -1
- package/test/icc-x-api/icc-form-x-api.js +0 -413
- package/test/icc-x-api/icc-form-x-api.js.map +0 -1
- package/test/icc-x-api/icc-hcparty-x-api-test.d.ts +0 -1
- package/test/icc-x-api/icc-hcparty-x-api-test.js +0 -43
- package/test/icc-x-api/icc-hcparty-x-api-test.js.map +0 -1
- package/test/icc-x-api/icc-helement-x-api-test.d.ts +0 -1
- package/test/icc-x-api/icc-helement-x-api-test.js +0 -155
- package/test/icc-x-api/icc-helement-x-api-test.js.map +0 -1
- package/test/icc-x-api/icc-invoice-x-api.d.ts +0 -1
- package/test/icc-x-api/icc-invoice-x-api.js +0 -99
- package/test/icc-x-api/icc-invoice-x-api.js.map +0 -1
- package/test/icc-x-api/icc-maintenance-task-x-api-test.d.ts +0 -1
- package/test/icc-x-api/icc-maintenance-task-x-api-test.js +0 -222
- package/test/icc-x-api/icc-maintenance-task-x-api-test.js.map +0 -1
- package/test/icc-x-api/icc-message-x-api.d.ts +0 -1
- package/test/icc-x-api/icc-message-x-api.js +0 -54
- package/test/icc-x-api/icc-message-x-api.js.map +0 -1
- package/test/icc-x-api/icc-patient-x-api-test.d.ts +0 -1
- package/test/icc-x-api/icc-patient-x-api-test.js +0 -165
- package/test/icc-x-api/icc-patient-x-api-test.js.map +0 -1
- package/test/icc-x-api/icc-recovery-x-api.d.ts +0 -1
- package/test/icc-x-api/icc-recovery-x-api.js +0 -175
- package/test/icc-x-api/icc-recovery-x-api.js.map +0 -1
- package/test/icc-x-api/icc-topic-x-api.d.ts +0 -1
- package/test/icc-x-api/icc-topic-x-api.js +0 -269
- package/test/icc-x-api/icc-topic-x-api.js.map +0 -1
- package/test/icc-x-api/icc-user-x-api-test.d.ts +0 -1
- package/test/icc-x-api/icc-user-x-api-test.js +0 -99
- package/test/icc-x-api/icc-user-x-api-test.js.map +0 -1
- package/test/icc-x-api/keyless-api.d.ts +0 -1
- package/test/icc-x-api/keyless-api.js +0 -125
- package/test/icc-x-api/keyless-api.js.map +0 -1
- package/test/icc-x-api/patient-user.d.ts +0 -2
- package/test/icc-x-api/patient-user.js +0 -103
- package/test/icc-x-api/patient-user.js.map +0 -1
- package/test/icc-x-api/storage/storage.d.ts +0 -1
- package/test/icc-x-api/storage/storage.js +0 -48
- package/test/icc-x-api/storage/storage.js.map +0 -1
- package/test/icc-x-api/test-api-no-parent.d.ts +0 -1
- package/test/icc-x-api/test-api-no-parent.js +0 -79
- package/test/icc-x-api/test-api-no-parent.js.map +0 -1
- package/test/icc-x-api/test-legacy-data-support.d.ts +0 -1
- package/test/icc-x-api/test-legacy-data-support.js +0 -375
- package/test/icc-x-api/test-legacy-data-support.js.map +0 -1
- package/test/icc-x-api/utils/graph-test.d.ts +0 -1
- package/test/icc-x-api/utils/graph-test.js +0 -54
- package/test/icc-x-api/utils/graph-test.js.map +0 -1
- package/test/icc-x-api/utils/lru-temporised-async-cache-test.d.ts +0 -1
- package/test/icc-x-api/utils/lru-temporised-async-cache-test.js +0 -364
- package/test/icc-x-api/utils/lru-temporised-async-cache-test.js.map +0 -1
- package/test/support/CSM-185.d.ts +0 -1
- package/test/support/CSM-185.js +0 -124
- package/test/support/CSM-185.js.map +0 -1
- package/test/support/CSM-243.d.ts +0 -1
- package/test/support/CSM-243.js +0 -120
- package/test/support/CSM-243.js.map +0 -1
- package/test/support/CSM-543.d.ts +0 -1
- package/test/support/CSM-543.js +0 -164
- package/test/support/CSM-543.js.map +0 -1
- package/test/support/CSM-729.d.ts +0 -1
- package/test/support/CSM-729.js +0 -225
- package/test/support/CSM-729.js.map +0 -1
- package/test/support/CSM-87.d.ts +0 -0
- package/test/support/CSM-87.js +0 -21
- package/test/support/CSM-87.js.map +0 -1
- package/test/support/CSM-93.d.ts +0 -1
- package/test/support/CSM-93.js +0 -112
- package/test/support/CSM-93.js.map +0 -1
- package/test/utils/FakeDataOwnerApi.d.ts +0 -32
- package/test/utils/FakeDataOwnerApi.js +0 -136
- package/test/utils/FakeDataOwnerApi.js.map +0 -1
- package/test/utils/FakeEncryptionKeysManager.d.ts +0 -36
- package/test/utils/FakeEncryptionKeysManager.js +0 -98
- package/test/utils/FakeEncryptionKeysManager.js.map +0 -1
- package/test/utils/FakeExchangeDataApi.d.ts +0 -32
- package/test/utils/FakeExchangeDataApi.js +0 -92
- package/test/utils/FakeExchangeDataApi.js.map +0 -1
- package/test/utils/FakeExchangeDataManager.d.ts +0 -48
- package/test/utils/FakeExchangeDataManager.js +0 -82
- package/test/utils/FakeExchangeDataManager.js.map +0 -1
- package/test/utils/FakeExchangeDataMapManager.d.ts +0 -12
- package/test/utils/FakeExchangeDataMapManager.js +0 -38
- package/test/utils/FakeExchangeDataMapManager.js.map +0 -1
- package/test/utils/FakeGenericApi.d.ts +0 -16
- package/test/utils/FakeGenericApi.js +0 -65
- package/test/utils/FakeGenericApi.js.map +0 -1
- package/test/utils/KeylessCryptoStrategies.d.ts +0 -23
- package/test/utils/KeylessCryptoStrategies.js +0 -26
- package/test/utils/KeylessCryptoStrategies.js.map +0 -1
- package/test/utils/TestApi.d.ts +0 -3
- package/test/utils/TestApi.js +0 -30
- package/test/utils/TestApi.js.map +0 -1
- package/test/utils/TestCollectionUtils.d.ts +0 -1
- package/test/utils/TestCollectionUtils.js +0 -109
- package/test/utils/TestCollectionUtils.js.map +0 -1
- package/test/utils/TestCryptoStrategies.d.ts +0 -42
- package/test/utils/TestCryptoStrategies.js +0 -80
- package/test/utils/TestCryptoStrategies.js.map +0 -1
- package/test/utils/TestStorage.d.ts +0 -23
- package/test/utils/TestStorage.js +0 -61
- package/test/utils/TestStorage.js.map +0 -1
- package/test/utils/roles.d.ts +0 -14
- package/test/utils/roles.js +0 -345
- package/test/utils/roles.js.map +0 -1
- package/test/utils/test_utils.d.ts +0 -87
- package/test/utils/test_utils.js +0 -452
- package/test/utils/test_utils.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test_utils.js","sourceRoot":"","sources":["../../../test/utils/test_utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAwCA,oCAEC;AAED,0CAOC;AAWD,8DAoCC;AAYD,wEAOC;AAuCD,0CAiCC;AAED,kDA2BC;AAED,kDAyBC;AAQD,wDAiKC;AAKD,wFA2CC;AAED,gDAkBC;AAaD,gEAwFC;AAED,gCAEC;AAED,wCAMC;AAED,4BAMC;AA3lBD,+CAawB;AACxB,2BAA2B;AAC3B,+BAA+C;AAC/C,+BAAiC;AACjC,mCAA8C;AAC9C,uCAAmC;AACnC,wCAAuD;AACv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ACjC,CAAC;SAAM,CAAC;QACN,OAAO,IAAA,gBAAQ,EAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IAC5B,CAAC;AACH,CAAC;AAED,SAAgB,QAAQ,CAAC,KAAa,EAAE,EAAuC;IAC7E,IAAI,UAAU,EAAE,EAAE,CAAC;QACjB,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IAC3B,CAAC;SAAM,CAAC;QACN,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IACtB,CAAC;AACH,CAAC","sourcesContent":["import {\n BasicAuthenticationProvider,\n EncryptedFieldsConfig,\n hex2ua,\n IcureApi,\n IcureApiOptions,\n IcureBasicApi,\n retry,\n RSAUtilsImpl,\n ShaVersion,\n ua2ab,\n ua2hex,\n WebCryptoPrimitives,\n} from '../../icc-x-api'\nimport { tmpdir } from 'os'\nimport { TextDecoder, TextEncoder } from 'util'\nimport { v4 as uuid } from 'uuid'\nimport { randomUUID, webcrypto } from 'crypto'\nimport { TestApi } from './TestApi'\nimport { IcureApi as TestSetupApi } from '@icure/apiV7'\nimport { testStorageWithKeys } from './TestStorage'\nimport { TestCryptoStrategies } from './TestCryptoStrategies'\nimport { User } from '../../icc-api/model/User'\nimport { TestEnvironmentBuilder } from '@icure/test-setup/builder'\nimport { getEnvVariables, TestVars, UserDetails } from '@icure/test-setup/types'\nimport { EnvInitializer } from '@icure/test-setup/decorators'\nimport 'isomorphic-fetch'\nimport { createPatientUser } from '@icure/test-setup/creation'\nimport { IccUserApi } from '../../icc-api'\nimport { Context, describe, Suite, Test } from 'mocha'\nimport { Group } from '../../icc-api/model/Group'\nimport { Patient } from '../../icc-api/model/Patient'\nimport { CryptoActorStubWithType } from '../../icc-api/model/CryptoActorStub'\nimport { DataOwnerTypeEnum } from '../../icc-api/model/DataOwnerTypeEnum'\nimport { DataOwnerWithType } from '../../icc-api/model/DataOwnerWithType'\nimport { KeyPairRecoverer } from '../../icc-x-api/crypto/KeyPairRecoverer'\nimport { KeylessCryptoStrategies } from './KeylessCryptoStrategies'\nimport { XHR } from '../../icc-api/api/XHR'\nimport { defaultRoles } from './roles'\n\nexport function getTempEmail(): string {\n return `${uuid().substring(0, 8)}@icure.com`\n}\n\nexport function setLocalStorage(fetch: (input: RequestInfo, init?: RequestInit) => Promise<Response>) {\n ;(global as any).localStorage = new (require('node-localstorage').LocalStorage)(tmpdir(), 5 * 1024 ** 3)\n ;(global as any).fetch = fetch\n ;(global as any).Storage = ''\n ;(global as any).TextDecoder = TextDecoder\n ;(global as any).TextEncoder = TextEncoder\n ;(global as any).headers = Headers\n}\n\nexport const hcp1Username = process.env.ICURE_TS_TEST_HCP_USER ?? getTempEmail()\nexport const hcp2Username = process.env.ICURE_TS_TEST_HCP_2_USER ?? getTempEmail()\nexport const hcp3Username = process.env.ICURE_TS_TEST_HCP_3_USER ?? getTempEmail()\nexport const patUsername = process.env.ICURE_TS_TEST_PAT_USER ?? getTempEmail()\n\nexport const deviceUsername = getTempEmail()\n\nlet cachedInitializer: EnvInitializer | undefined\n\nexport async function getEnvironmentInitializer(): Promise<EnvInitializer> {\n if (!cachedInitializer) {\n const env = getEnvVariables()\n const scratchDir = 'test/scratch'\n\n const baseEnvironment =\n env.testEnvironment === 'docker' || env.testEnvironment === 'oss'\n ? new TestEnvironmentBuilder().setUpDockerEnvironment(scratchDir, ['mock'])\n : new TestEnvironmentBuilder()\n cachedInitializer = await baseEnvironment\n .withGroup(fetch, {\n patient: ['BASIC_USER', 'BASIC_DATA_OWNER'],\n hcp: [\n 'BASIC_USER',\n 'BASIC_DATA_OWNER',\n 'PATIENT_USER_MANAGER',\n 'HIERARCHICAL_DATA_OWNER',\n 'TOPIC_MANAGER',\n 'TOPIC_PARTICIPANT',\n 'LEGACY_MESSAGE_MANAGER',\n ],\n device: ['BASIC_USER', 'BASIC_DATA_OWNER'],\n user: ['BASIC_USER'],\n })\n .withMasterUser(fetch)\n .withRoles(defaultRoles)\n .addHcp({ login: hcp1Username })\n .addHcp({ login: hcp2Username })\n .addHcp({ login: hcp3Username })\n .addPatient({ login: patUsername })\n .addDevice({ login: deviceUsername })\n .withSafeguard()\n .withEnvironmentSummary()\n .build()\n }\n return cachedInitializer\n}\n\nexport namespace TestUtils {\n export async function initApi(envVars: TestVars, userName: string = hcp1Username, options?: IcureApiOptions): Promise<IcureApi> {\n return await getApiAndAddPrivateKeysForUser(envVars.iCureUrl, envVars.dataOwnerDetails[userName], options)\n }\n\n export async function initMasterApi(envVars: TestVars, options?: IcureApiOptions): Promise<IcureApi> {\n return await getApiAndAddPrivateKeysForUser(envVars.iCureUrl, envVars.masterHcp!, options)\n }\n}\n\nexport async function getApiAndAddPrivateKeysForUser(iCureUrl: string, details: UserDetails, options?: IcureApiOptions) {\n const RSA = new RSAUtilsImpl(webcrypto as any)\n const keys = {\n publicKey: await RSA.importKey('spki', ua2ab(hex2ua(details.publicKey)), ['encrypt'], ShaVersion.Sha1),\n privateKey: await RSA.importKey('pkcs8', ua2ab(hex2ua(details.privateKey)), ['decrypt'], ShaVersion.Sha1),\n }\n return await TestApi(iCureUrl, details.user, details.password, webcrypto as any, keys, options)\n}\n\nasync function createHealthcarePartyUser(\n api: TestSetupApi,\n userLogin: string,\n userToken: string,\n publicKey?: string,\n privateKey?: string\n): Promise<UserDetails> {\n const { publicKey: newPublicKey, privateKey: newPrivateKey } = await api.cryptoApi.RSA.generateKeyPair()\n\n const publicKeyHex = !!publicKey && !!privateKey ? publicKey : ua2hex(await api.cryptoApi.RSA.exportKey(newPublicKey, 'spki'))\n const privateKeyHex = !!publicKey && !!privateKey ? privateKey : ua2hex(await api.cryptoApi.RSA.exportKey(newPrivateKey, 'pkcs8'))\n\n const hcp = await api.healthcarePartyApi.createHealthcareParty({\n id: uuid(),\n firstName: uuid().substring(0, 6),\n lastName: uuid().substring(0, 6),\n publicKey: publicKeyHex,\n })\n const hcpUser = await api.userApi.createUser(\n new User({\n id: uuid(),\n name: userLogin,\n login: userLogin,\n email: userLogin,\n healthcarePartyId: hcp.id,\n })\n )\n const token = await api.userApi.getToken(hcpUser.id!, uuid(), 24 * 60 * 60, userToken)\n return {\n user: hcpUser.login!,\n dataOwnerId: hcp.id!,\n password: token,\n publicKey: publicKeyHex,\n privateKey: privateKeyHex,\n }\n}\n\nexport async function createNewHcpApi(\n env: TestVars,\n options: {\n encryptedFieldsConfig?: EncryptedFieldsConfig\n } = {}\n): Promise<{\n api: IcureApi\n credentials: UserDetails\n user: User\n}> {\n const initialisationApi = await testSetupMasterApi(env)\n const primitives = new WebCryptoPrimitives(webcrypto as any)\n const credentials = await createHealthcarePartyUser(initialisationApi, `user-${primitives.randomUuid()}@icure.com`, primitives.randomUuid())\n const storage = await testStorageWithKeys([\n {\n dataOwnerId: credentials.dataOwnerId,\n pairs: [{ keyPair: { privateKey: credentials.privateKey, publicKey: credentials.publicKey }, shaVersion: ShaVersion.Sha1 }],\n },\n ])\n const api = await IcureApi.initialise(\n env.iCureUrl,\n { username: credentials.user, password: credentials.password },\n new TestCryptoStrategies(),\n webcrypto as any,\n fetch,\n {\n storage: storage.storage,\n keyStorage: storage.keyStorage,\n entryKeysFactory: storage.keyFactory,\n encryptedFieldsConfig: options.encryptedFieldsConfig,\n }\n )\n return { api, credentials, user: await api.userApi.getCurrentUser() }\n}\n\nexport async function createNewPatientApi(env: TestVars): Promise<{\n api: IcureApi\n credentials: UserDetails\n user: User\n}> {\n const initialisationApi = await testSetupMasterApi(env)\n const primitives = new WebCryptoPrimitives(webcrypto as any)\n const credentials = await createPatientUser(initialisationApi, `user-${primitives.randomUuid()}@icure.com`, primitives.randomUuid())\n const storage = await testStorageWithKeys([\n {\n dataOwnerId: credentials.dataOwnerId,\n pairs: [{ keyPair: { privateKey: credentials.privateKey, publicKey: credentials.publicKey }, shaVersion: ShaVersion.Sha1 }],\n },\n ])\n const api = await IcureApi.initialise(\n env.iCureUrl,\n { username: credentials.user, password: credentials.password },\n new TestCryptoStrategies(),\n webcrypto as any,\n fetch,\n {\n storage: storage.storage,\n keyStorage: storage.keyStorage,\n entryKeysFactory: storage.keyFactory,\n }\n )\n return { api, credentials, user: await api.userApi.getCurrentUser() }\n}\n\nexport async function createNewKeylessApi(env: TestVars): Promise<{\n api: IcureApi\n credentials: { username: string; password: string }\n}> {\n const initialisationApi = await IcureBasicApi.initialise(env.iCureUrl, { username: env.masterHcp!.user, password: env.masterHcp!.password }, fetch)\n const login = `${randomUUID()}@test.icure.com`\n const password = randomUUID()\n const patient = new Patient({\n id: randomUUID(),\n firstName: 'Gino',\n lastName: 'Pino',\n })\n const user = new User({\n id: randomUUID(),\n login,\n passwordHash: password,\n patientId: patient.id,\n })\n await initialisationApi.userApi.createUser(user)\n await initialisationApi.patientApi.createPatient(patient)\n const credentials = { username: login, password }\n const cryptoStrategies = new KeylessCryptoStrategies()\n const api = await IcureApi.initialise(env.iCureUrl, credentials, cryptoStrategies, webcrypto as any, fetch, {})\n if (!cryptoStrategies.requestedKey) throw new Error('Illegal state: did not request key')\n return { api, credentials }\n}\n\n/**\n * Creates a hierarchy of HCPs with the following structure:\n * grand HCP -+-> parent HCP ---> child HCP\n * |\n * +-> child2 HCP\n */\nexport async function createHcpHierarchyApis(\n env: TestVars,\n setupAutodelegations: boolean = true,\n disableParentKeysInitialisation: boolean = false\n): Promise<{\n grandApi: IcureApi\n grandUser: User\n grandCredentials: UserDetails\n parentApi: IcureApi\n parentUser: User\n parentCredentials: UserDetails\n childApi: IcureApi\n childUser: User\n childCredentials: UserDetails\n child2Api: IcureApi\n child2User: User\n child2Credentials: UserDetails\n}> {\n const shaVersion = ShaVersion.Sha1\n const initialisationApi = await testSetupMasterApi(env)\n const primitives = new WebCryptoPrimitives(webcrypto as any)\n const grandCredentials = await createHealthcarePartyUser(initialisationApi, `grand-${primitives.randomUuid()}@icure.com`, primitives.randomUuid())\n const parentCredentials = await createHealthcarePartyUser(initialisationApi, `parent-${primitives.randomUuid()}@icure.com`, primitives.randomUuid())\n const childCredentials = await createHealthcarePartyUser(initialisationApi, `child-${primitives.randomUuid()}@icure.com`, primitives.randomUuid())\n const child2Credentials = await createHealthcarePartyUser(initialisationApi, `child2-${primitives.randomUuid()}@icure.com`, primitives.randomUuid())\n await initialisationApi.healthcarePartyApi.modifyHealthcareParty({\n ...(await initialisationApi.healthcarePartyApi.getHealthcareParty(parentCredentials.dataOwnerId)),\n parentId: grandCredentials.dataOwnerId,\n })\n await initialisationApi.healthcarePartyApi.modifyHealthcareParty({\n ...(await initialisationApi.healthcarePartyApi.getHealthcareParty(childCredentials.dataOwnerId)),\n parentId: parentCredentials.dataOwnerId,\n })\n await initialisationApi.healthcarePartyApi.modifyHealthcareParty({\n ...(await initialisationApi.healthcarePartyApi.getHealthcareParty(child2Credentials.dataOwnerId)),\n parentId: grandCredentials.dataOwnerId,\n })\n const grandStorage = await testStorageWithKeys([\n {\n dataOwnerId: grandCredentials.dataOwnerId,\n pairs: [{ keyPair: { privateKey: grandCredentials.privateKey, publicKey: grandCredentials.publicKey }, shaVersion: shaVersion }],\n },\n ])\n const grandApi = await IcureApi.initialise(\n env.iCureUrl,\n { username: grandCredentials.user, password: grandCredentials.password },\n new TestCryptoStrategies(),\n webcrypto as any,\n fetch,\n {\n storage: grandStorage.storage,\n keyStorage: grandStorage.keyStorage,\n entryKeysFactory: grandStorage.keyFactory,\n disableParentKeysInitialisation,\n }\n )\n const parentStorage = await testStorageWithKeys([\n {\n dataOwnerId: grandCredentials.dataOwnerId,\n pairs: [{ keyPair: { privateKey: grandCredentials.privateKey, publicKey: grandCredentials.publicKey }, shaVersion: shaVersion }],\n },\n {\n dataOwnerId: parentCredentials.dataOwnerId,\n pairs: [{ keyPair: { privateKey: parentCredentials.privateKey, publicKey: parentCredentials.publicKey }, shaVersion: shaVersion }],\n },\n ])\n const parentApi = await IcureApi.initialise(\n env.iCureUrl,\n { username: parentCredentials.user, password: parentCredentials.password },\n new TestCryptoStrategies(),\n webcrypto as any,\n fetch,\n {\n storage: parentStorage.storage,\n keyStorage: parentStorage.keyStorage,\n entryKeysFactory: parentStorage.keyFactory,\n disableParentKeysInitialisation,\n }\n )\n const parentUser = setupAutodelegations\n ? await parentApi.userApi.modifyUser({\n ...(await parentApi.userApi.getCurrentUser()),\n autoDelegations: { all: [grandCredentials.dataOwnerId] },\n })\n : await parentApi.userApi.getCurrentUser()\n const childStorage = await testStorageWithKeys([\n {\n dataOwnerId: grandCredentials.dataOwnerId,\n pairs: [{ keyPair: { privateKey: grandCredentials.privateKey, publicKey: grandCredentials.publicKey }, shaVersion: shaVersion }],\n },\n {\n dataOwnerId: parentCredentials.dataOwnerId,\n pairs: [{ keyPair: { privateKey: parentCredentials.privateKey, publicKey: parentCredentials.publicKey }, shaVersion: shaVersion }],\n },\n {\n dataOwnerId: childCredentials.dataOwnerId,\n pairs: [{ keyPair: { privateKey: childCredentials.privateKey, publicKey: childCredentials.publicKey }, shaVersion: shaVersion }],\n },\n ])\n const childApi = await IcureApi.initialise(\n env.iCureUrl,\n { username: childCredentials.user, password: childCredentials.password },\n new TestCryptoStrategies(),\n webcrypto as any,\n fetch,\n {\n storage: childStorage.storage,\n keyStorage: childStorage.keyStorage,\n entryKeysFactory: childStorage.keyFactory,\n disableParentKeysInitialisation,\n }\n )\n const childUser = setupAutodelegations\n ? await childApi.userApi.modifyUser({\n ...(await childApi.userApi.getCurrentUser()),\n autoDelegations: { all: [grandCredentials.dataOwnerId, parentCredentials.dataOwnerId] },\n })\n : await childApi.userApi.getCurrentUser()\n const child2Storage = await testStorageWithKeys([\n {\n dataOwnerId: grandCredentials.dataOwnerId,\n pairs: [{ keyPair: { privateKey: grandCredentials.privateKey, publicKey: grandCredentials.publicKey }, shaVersion: shaVersion }],\n },\n {\n dataOwnerId: child2Credentials.dataOwnerId,\n pairs: [{ keyPair: { privateKey: child2Credentials.privateKey, publicKey: child2Credentials.publicKey }, shaVersion: shaVersion }],\n },\n ])\n const child2Api = await IcureApi.initialise(\n env.iCureUrl,\n { username: child2Credentials.user, password: child2Credentials.password },\n new TestCryptoStrategies(),\n webcrypto as any,\n fetch,\n {\n storage: child2Storage.storage,\n keyStorage: child2Storage.keyStorage,\n entryKeysFactory: child2Storage.keyFactory,\n disableParentKeysInitialisation,\n }\n )\n const child2User = setupAutodelegations\n ? await child2Api.userApi.modifyUser({\n ...(await child2Api.userApi.getCurrentUser()),\n autoDelegations: { all: [grandCredentials.dataOwnerId] },\n })\n : await child2Api.userApi.getCurrentUser()\n return {\n grandApi,\n grandUser: await grandApi.userApi.getCurrentUser(),\n grandCredentials,\n parentApi,\n parentUser,\n parentCredentials,\n childApi,\n childUser,\n childCredentials,\n child2Api,\n child2User,\n child2Credentials,\n }\n}\n\n/**\n * Create a parent HCP with a key and a child HCP without any initialised key\n */\nexport async function createNewHcpWithoutKeyAndParentWithKey(\n env: TestVars,\n props: {\n initialiseEmptyKeyForChild?: boolean\n } = {}\n): Promise<{\n parentCredentials: UserDetails\n childUser: string\n childDataOwnerId: string\n childPassword: string\n}> {\n const initialisationApi = await testSetupMasterApi(env)\n const primitives = new WebCryptoPrimitives(webcrypto as any)\n const parentCredentials = await createHealthcarePartyUser(initialisationApi, `parent-${primitives.randomUuid()}@icure.com`, primitives.randomUuid())\n const childUser = uuid() + '@email.com'\n const childPassword = uuid()\n const childHcp = {\n id: uuid(),\n firstName: uuid().substring(0, 6),\n lastName: uuid().substring(0, 6),\n parentId: parentCredentials.dataOwnerId,\n publicKey: undefined as string | undefined,\n }\n if (props.initialiseEmptyKeyForChild) {\n childHcp.publicKey = ''\n }\n await initialisationApi.healthcarePartyApi.createHealthcareParty(childHcp)\n await initialisationApi.userApi.createUser(\n new User({\n id: uuid(),\n name: childUser,\n login: childUser,\n email: childUser,\n passwordHash: childPassword,\n healthcarePartyId: childHcp.id,\n })\n )\n return {\n parentCredentials,\n childUser,\n childPassword,\n childDataOwnerId: childHcp.id!,\n }\n}\n\nexport function testSetupMasterApi(env: TestVars): Promise<TestSetupApi> {\n return TestSetupApi.initialise(\n env.iCureUrl,\n { username: env.masterHcp!.user, password: env.masterHcp!.password },\n {\n generateNewKeyForDataOwner(): Promise<boolean> {\n return Promise.resolve(true)\n },\n recoverAndVerifySelfHierarchyKeys(): never {\n throw new Error('Unsupported')\n },\n verifyDelegatePublicKeys(delegate: any, publicKeys: string[]): Promise<string[]> {\n return Promise.resolve(publicKeys)\n },\n },\n webcrypto as any,\n fetch\n )\n}\n\nexport type UserInManyGroupsDetails = {\n user1: User\n user2: User\n group3: Group\n userPw3: string\n user3: User\n group2: Group\n group1: Group\n userPw12: string\n userLogin: string\n}\nexport async function createUserInMultipleGroups(env: TestVars): Promise<UserInManyGroupsDetails> {\n const primitives = new WebCryptoPrimitives(webcrypto as any)\n const userGroup1Id: string = primitives.randomUuid() // Same username-pw as group 2\n const userGroup2Id: string = primitives.randomUuid() // Same username-pw as group 1\n const userGroup3Id: string = primitives.randomUuid() // Same username as group 1/2, different pw\n const userLogin: string = `maria-${primitives.randomUuid()}@pompei.it`\n const userPw12: string = `geppetto-${primitives.randomUuid()}`\n const userPw3: string = `pinocchio-${primitives.randomUuid()}`\n const user1Id: string = primitives.randomUuid()\n const user2Id: string = primitives.randomUuid()\n const user3Id: string = primitives.randomUuid()\n const api = await IcureBasicApi.initialise(env.iCureUrl, { username: 'john', password: 'LetMeIn' }, fetch) // pragma: allowlist secret\n const group1 = await api.groupApi.createGroup(\n userGroup1Id,\n `test-group-1-${primitives.randomUuid()}`,\n primitives.randomUuid(),\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n {}\n )\n const group2 = await api.groupApi.createGroup(\n userGroup2Id,\n `test-group-2-${primitives.randomUuid()}`,\n primitives.randomUuid(),\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n {}\n )\n const group3 = await api.groupApi.createGroup(\n userGroup3Id,\n `test-group-3-${primitives.randomUuid()}`,\n primitives.randomUuid(),\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n {}\n )\n const user1 = await api.userApi.createUserInGroup(userGroup1Id, {\n id: user1Id,\n name: userLogin,\n login: userLogin,\n email: userLogin,\n passwordHash: userPw12,\n })\n const user2 = await api.userApi.createUserInGroup(userGroup2Id, {\n id: user2Id,\n name: userLogin,\n login: userLogin,\n email: userLogin,\n passwordHash: userPw12,\n })\n const user3 = await api.userApi.createUserInGroup(userGroup3Id, {\n id: user3Id,\n name: userLogin,\n login: userLogin,\n email: userLogin,\n passwordHash: userPw3,\n })\n console.log(`Waiting for user to be created - ${userLogin}`)\n await retry(\n async () => {\n await new IccUserApi(env.iCureUrl, {}, new BasicAuthenticationProvider(`${userGroup1Id}/${user1Id}`, userPw12), fetch).getCurrentUser()\n await new IccUserApi(env.iCureUrl, {}, new BasicAuthenticationProvider(`${userGroup2Id}/${user2Id}`, userPw12), fetch).getCurrentUser()\n await new IccUserApi(env.iCureUrl, {}, new BasicAuthenticationProvider(`${userGroup3Id}/${user3Id}`, userPw3), fetch).getCurrentUser()\n },\n 10,\n 5_000,\n 1\n )\n return {\n user1,\n user2,\n user3,\n group1,\n group2,\n group3,\n userPw12,\n userPw3,\n userLogin,\n }\n}\n\nexport function isLiteTest() {\n return getEnvVariables().testEnvironment == 'oss'\n}\n\nexport function describeNoLite(title: string, fn: (this: Suite) => void): Suite | void {\n if (isLiteTest()) {\n return describe.skip(title, fn)\n } else {\n return describe(title, fn)\n }\n}\n\nexport function itNoLite(title: string, fn: (this: Context) => PromiseLike<any>): Test {\n if (isLiteTest()) {\n return it.skip(title, fn)\n } else {\n return it(title, fn)\n }\n}\n"]}
|