@icure/api 8.6.19 → 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/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,413 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
require("isomorphic-fetch");
|
|
13
|
-
const test_utils_1 = require("../utils/test_utils");
|
|
14
|
-
const mocha_1 = require("mocha");
|
|
15
|
-
const icc_x_api_1 = require("../../icc-x-api");
|
|
16
|
-
const icc_api_1 = require("../../icc-api");
|
|
17
|
-
const Patient_1 = require("../../icc-api/model/Patient");
|
|
18
|
-
const crypto_1 = require("crypto");
|
|
19
|
-
const Form_1 = require("../../icc-api/model/Form");
|
|
20
|
-
const FormTemplate_1 = require("../../icc-api/model/FormTemplate");
|
|
21
|
-
const CodeStub_1 = require("../../icc-api/model/CodeStub");
|
|
22
|
-
const chai_1 = require("chai");
|
|
23
|
-
var initApi = test_utils_1.TestUtils.initApi;
|
|
24
|
-
const types_1 = require("@icure/test-setup/types");
|
|
25
|
-
const AuthenticationProvider_1 = require("../../icc-x-api/auth/AuthenticationProvider");
|
|
26
|
-
const IdWithRev_1 = require("../../icc-api/model/IdWithRev");
|
|
27
|
-
(0, test_utils_1.setLocalStorage)(fetch);
|
|
28
|
-
let env;
|
|
29
|
-
describe('icc-form-x-api Tests', () => {
|
|
30
|
-
(0, mocha_1.before)(function () {
|
|
31
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
this.timeout(600000);
|
|
33
|
-
const initializer = yield (0, test_utils_1.getEnvironmentInitializer)();
|
|
34
|
-
env = yield initializer.execute((0, types_1.getEnvVariables)());
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
function createPatient(patientApiForHcp, hcpUser) {
|
|
38
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
-
return patientApiForHcp.createPatientWithUser(hcpUser, yield patientApiForHcp.newInstance(hcpUser, new Patient_1.Patient({
|
|
40
|
-
id: (0, crypto_1.randomUUID)(),
|
|
41
|
-
firstName: 'John',
|
|
42
|
-
lastName: 'Snow',
|
|
43
|
-
note: 'Winter is coming',
|
|
44
|
-
})));
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
it('Test', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
-
// Given
|
|
49
|
-
const username = env.dataOwnerDetails[test_utils_1.hcp1Username].user;
|
|
50
|
-
const password = env.dataOwnerDetails[test_utils_1.hcp1Username].password;
|
|
51
|
-
const authProvider = new AuthenticationProvider_1.BasicAuthenticationProvider(username, password);
|
|
52
|
-
const userApi = new icc_x_api_1.IccUserXApi(env.iCureUrl, {}, authProvider, null, fetch);
|
|
53
|
-
const formApi = new icc_api_1.IccFormApi(env.iCureUrl, {}, authProvider, fetch);
|
|
54
|
-
const currentUser = yield userApi.getCurrentUser();
|
|
55
|
-
}));
|
|
56
|
-
it('Test findBy', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
57
|
-
// Given
|
|
58
|
-
const { userApi: userApiForHcp, dataOwnerApi: dataOwnerApiForHcp, patientApi: patientApiForHcp, cryptoApi: cryptoApiForHcp, dataOwnerApi: dateOwnerApiForHcp, formApi: formXApi, } = yield initApi(env, test_utils_1.hcp1Username);
|
|
59
|
-
const hcpUser = yield userApiForHcp.getCurrentUser();
|
|
60
|
-
const patient = (yield createPatient(patientApiForHcp, hcpUser));
|
|
61
|
-
const form = new Form_1.Form({
|
|
62
|
-
id: (0, crypto_1.randomUUID)(),
|
|
63
|
-
created: new Date().getTime(),
|
|
64
|
-
modified: new Date().getTime(),
|
|
65
|
-
responsible: hcpUser.healthcarePartyId,
|
|
66
|
-
author: hcpUser.id,
|
|
67
|
-
codes: [],
|
|
68
|
-
tags: [],
|
|
69
|
-
user: hcpUser.id,
|
|
70
|
-
patient: patient.id,
|
|
71
|
-
});
|
|
72
|
-
const formToCreate = yield formXApi.newInstance(hcpUser, patient, form);
|
|
73
|
-
const createdForm = yield formXApi.createForm(formToCreate);
|
|
74
|
-
const foundItems = (yield formXApi.findBy(hcpUser.healthcarePartyId, patient, false));
|
|
75
|
-
const foundItemsUsingPost = (yield formXApi.findBy(hcpUser.healthcarePartyId, patient, true));
|
|
76
|
-
(0, chai_1.assert)(foundItems.length == 1, 'Found items should be 1');
|
|
77
|
-
(0, chai_1.assert)(foundItems[0].id == createdForm.id, 'Found item should be the created one');
|
|
78
|
-
(0, chai_1.assert)(foundItemsUsingPost.length == 1, 'Found items using post should be 1');
|
|
79
|
-
(0, chai_1.assert)(foundItemsUsingPost[0].id == createdForm.id, 'Found item using post should be the created one');
|
|
80
|
-
}));
|
|
81
|
-
it('Share with should work as expected', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
82
|
-
const api1 = yield initApi(env, test_utils_1.hcp1Username);
|
|
83
|
-
const user1 = yield api1.userApi.getCurrentUser();
|
|
84
|
-
const api2 = yield initApi(env, test_utils_1.hcp2Username);
|
|
85
|
-
const user2 = yield api2.userApi.getCurrentUser();
|
|
86
|
-
const samplePatient = yield api1.patientApi.createPatientWithUser(user1, yield api1.patientApi.newInstance(user1, { firstName: 'Gigio', lastName: 'Bagigio' }));
|
|
87
|
-
const entity = yield api1.formApi.createForm(yield api1.formApi.newInstance(user1, samplePatient));
|
|
88
|
-
yield api2.formApi
|
|
89
|
-
.getForm(entity.id)
|
|
90
|
-
.then(() => {
|
|
91
|
-
throw new Error('Should not be able to get the entity');
|
|
92
|
-
})
|
|
93
|
-
.catch(() => {
|
|
94
|
-
/* expected */
|
|
95
|
-
});
|
|
96
|
-
yield api1.formApi.shareWith(user2.healthcarePartyId, entity);
|
|
97
|
-
const retrieved = yield api2.formApi.getForm(entity.id);
|
|
98
|
-
(0, chai_1.expect)((yield api2.formApi.decryptPatientIdOf(retrieved))[0]).to.equal(samplePatient.id);
|
|
99
|
-
}));
|
|
100
|
-
it('Tests for Form Templates', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
101
|
-
// Given
|
|
102
|
-
const { formApi, userApi } = yield initApi(env, test_utils_1.hcp1Username);
|
|
103
|
-
const guid = (0, crypto_1.randomUUID)();
|
|
104
|
-
const specialtyCode = 'SPECIALTY-' + (0, crypto_1.randomUUID)();
|
|
105
|
-
const user = yield userApi.getCurrentUser();
|
|
106
|
-
const formTemplateToCreate = new FormTemplate_1.FormTemplate({
|
|
107
|
-
id: (0, crypto_1.randomUUID)(),
|
|
108
|
-
guid: guid,
|
|
109
|
-
author: user.id,
|
|
110
|
-
name: 'My Test Template',
|
|
111
|
-
specialty: new CodeStub_1.CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),
|
|
112
|
-
descr: 'Description of the template',
|
|
113
|
-
});
|
|
114
|
-
// Create
|
|
115
|
-
const createdTemplate = yield formApi.createFormTemplate(formTemplateToCreate);
|
|
116
|
-
(0, chai_1.expect)(createdTemplate.id).to.not.be.undefined;
|
|
117
|
-
(0, chai_1.expect)(createdTemplate.guid).to.equal(guid);
|
|
118
|
-
(0, chai_1.expect)(createdTemplate.name).to.equal('My Test Template');
|
|
119
|
-
// Get
|
|
120
|
-
const retrievedTemplate = yield formApi.getFormTemplate(createdTemplate.id);
|
|
121
|
-
(0, chai_1.expect)(retrievedTemplate.id).to.equal(createdTemplate.id);
|
|
122
|
-
// Find all
|
|
123
|
-
const allTemplates = yield formApi.findFormTemplates();
|
|
124
|
-
(0, chai_1.expect)(allTemplates.map((t) => t.id)).to.include(createdTemplate.id);
|
|
125
|
-
// Find by specialty
|
|
126
|
-
const templatesBySpecialty = yield formApi.findFormTemplatesBySpeciality(specialtyCode);
|
|
127
|
-
(0, chai_1.expect)(templatesBySpecialty.map((t) => t.id)).to.include(createdTemplate.id);
|
|
128
|
-
(0, chai_1.expect)(templatesBySpecialty.length).to.be.greaterThan(0);
|
|
129
|
-
// Get by GUID (using getFormTemplatesByGuid)
|
|
130
|
-
const templatesByGuid = yield formApi.getFormTemplatesByGuid(guid, specialtyCode);
|
|
131
|
-
(0, chai_1.expect)(templatesByGuid.map((t) => t.id)).to.include(createdTemplate.id);
|
|
132
|
-
// Update
|
|
133
|
-
createdTemplate.name = 'Updated Name';
|
|
134
|
-
const updatedTemplate = yield formApi.updateFormTemplate(createdTemplate.id, createdTemplate);
|
|
135
|
-
(0, chai_1.expect)(updatedTemplate.name).to.equal('Updated Name');
|
|
136
|
-
// Delete
|
|
137
|
-
yield formApi.deleteFormTemplate(createdTemplate.id);
|
|
138
|
-
try {
|
|
139
|
-
yield formApi.getFormTemplate(createdTemplate.id);
|
|
140
|
-
chai_1.assert.fail('Should have thrown an error');
|
|
141
|
-
}
|
|
142
|
-
catch (e) {
|
|
143
|
-
// Expected
|
|
144
|
-
}
|
|
145
|
-
}));
|
|
146
|
-
(0, test_utils_1.describeNoLite)('Form Templates in Group Tests', () => {
|
|
147
|
-
it('should create, find, update and delete form templates in a group', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
148
|
-
// Given
|
|
149
|
-
const { formApi, userApi } = yield initApi(env);
|
|
150
|
-
const currentUser = yield userApi.getCurrentUser();
|
|
151
|
-
const guid = (0, crypto_1.randomUUID)();
|
|
152
|
-
const specialtyCode = 'SPECIALTY-' + (0, crypto_1.randomUUID)();
|
|
153
|
-
// Use the existing test group ID
|
|
154
|
-
const groupId = env.testGroupId;
|
|
155
|
-
const formTemplateToCreate = new FormTemplate_1.FormTemplate({
|
|
156
|
-
id: (0, crypto_1.randomUUID)(),
|
|
157
|
-
guid: guid,
|
|
158
|
-
author: currentUser.id,
|
|
159
|
-
name: 'My Group Template',
|
|
160
|
-
specialty: new CodeStub_1.CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),
|
|
161
|
-
descr: 'Description of the group template',
|
|
162
|
-
});
|
|
163
|
-
// Create In Group
|
|
164
|
-
const createdTemplate = yield formApi.createFormTemplateInGroup(groupId, formTemplateToCreate);
|
|
165
|
-
(0, chai_1.expect)(createdTemplate.id).to.not.be.undefined;
|
|
166
|
-
(0, chai_1.expect)(createdTemplate.guid).to.equal(guid);
|
|
167
|
-
if (createdTemplate.group) {
|
|
168
|
-
(0, chai_1.expect)(createdTemplate.group.guid).to.equal(groupId);
|
|
169
|
-
}
|
|
170
|
-
// Get In Group
|
|
171
|
-
const templatesInGroup = yield formApi.getFormTemplatesByUserInGroup(groupId, currentUser.id);
|
|
172
|
-
(0, chai_1.expect)(templatesInGroup.map((t) => t.id)).to.include(createdTemplate.id);
|
|
173
|
-
// Update In Group
|
|
174
|
-
createdTemplate.name = 'Updated Group Name';
|
|
175
|
-
const updatedTemplate = yield formApi.updateFormTemplateInGroup(groupId, createdTemplate.id, createdTemplate);
|
|
176
|
-
(0, chai_1.expect)(updatedTemplate.name).to.equal('Updated Group Name');
|
|
177
|
-
// Delete In Group
|
|
178
|
-
yield formApi.deleteFormTemplateInGroup(groupId, updatedTemplate.id, updatedTemplate.rev);
|
|
179
|
-
// Verify deletion
|
|
180
|
-
const templatesInGroupAfterDelete = yield formApi.getFormTemplatesByUserInGroup(groupId, currentUser.id);
|
|
181
|
-
(0, chai_1.expect)(templatesInGroupAfterDelete.map((t) => t.id)).to.not.include(createdTemplate.id);
|
|
182
|
-
}));
|
|
183
|
-
it('should find form templates by specialty in a group', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
184
|
-
// Given
|
|
185
|
-
const { formApi, userApi } = yield initApi(env);
|
|
186
|
-
const currentUser = yield userApi.getCurrentUser();
|
|
187
|
-
const groupId = env.testGroupId;
|
|
188
|
-
const specialtyCode = 'SPECIALTY-' + (0, crypto_1.randomUUID)();
|
|
189
|
-
const otherSpecialtyCode = 'SPECIALTY-' + (0, crypto_1.randomUUID)();
|
|
190
|
-
const templatesToCreate = [
|
|
191
|
-
new FormTemplate_1.FormTemplate({
|
|
192
|
-
id: (0, crypto_1.randomUUID)(),
|
|
193
|
-
guid: (0, crypto_1.randomUUID)(),
|
|
194
|
-
author: currentUser.id,
|
|
195
|
-
name: 'Specialty Template 1',
|
|
196
|
-
specialty: new CodeStub_1.CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),
|
|
197
|
-
}),
|
|
198
|
-
new FormTemplate_1.FormTemplate({
|
|
199
|
-
id: (0, crypto_1.randomUUID)(),
|
|
200
|
-
guid: (0, crypto_1.randomUUID)(),
|
|
201
|
-
author: currentUser.id,
|
|
202
|
-
name: 'Specialty Template 2',
|
|
203
|
-
specialty: new CodeStub_1.CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),
|
|
204
|
-
}),
|
|
205
|
-
new FormTemplate_1.FormTemplate({
|
|
206
|
-
id: (0, crypto_1.randomUUID)(),
|
|
207
|
-
guid: (0, crypto_1.randomUUID)(),
|
|
208
|
-
author: currentUser.id,
|
|
209
|
-
name: 'Other Specialty Template',
|
|
210
|
-
specialty: new CodeStub_1.CodeStub({ code: otherSpecialtyCode, type: 'specialty', version: '1' }),
|
|
211
|
-
}),
|
|
212
|
-
];
|
|
213
|
-
const createdTemplates = yield formApi.createFormTemplatesInGroup(groupId, templatesToCreate);
|
|
214
|
-
(0, chai_1.expect)(createdTemplates).to.have.lengthOf(3);
|
|
215
|
-
// When: find by specialty
|
|
216
|
-
const templatesBySpecialty = yield formApi.getFormTemplatesBySpecialtyInGroup(groupId, specialtyCode);
|
|
217
|
-
// Then: should return only the 2 templates with the matching specialty
|
|
218
|
-
(0, chai_1.expect)(templatesBySpecialty.map((t) => t.id)).to.include(createdTemplates[0].id);
|
|
219
|
-
(0, chai_1.expect)(templatesBySpecialty.map((t) => t.id)).to.include(createdTemplates[1].id);
|
|
220
|
-
(0, chai_1.expect)(templatesBySpecialty.map((t) => t.id)).to.not.include(createdTemplates[2].id);
|
|
221
|
-
// When: find by other specialty
|
|
222
|
-
const otherTemplates = yield formApi.getFormTemplatesBySpecialtyInGroup(groupId, otherSpecialtyCode);
|
|
223
|
-
// Then: should return only the 1 template with the other specialty
|
|
224
|
-
(0, chai_1.expect)(otherTemplates.map((t) => t.id)).to.include(createdTemplates[2].id);
|
|
225
|
-
(0, chai_1.expect)(otherTemplates.map((t) => t.id)).to.not.include(createdTemplates[0].id);
|
|
226
|
-
// When: find by non-existent specialty
|
|
227
|
-
const emptyResult = yield formApi.getFormTemplatesBySpecialtyInGroup(groupId, 'NONEXISTENT-' + (0, crypto_1.randomUUID)());
|
|
228
|
-
// Then: should return empty
|
|
229
|
-
(0, chai_1.expect)(emptyResult).to.have.lengthOf(0);
|
|
230
|
-
// Cleanup
|
|
231
|
-
const idsAndRevs = createdTemplates.map((t) => new IdWithRev_1.IdWithRev({ id: t.id, rev: t.rev }));
|
|
232
|
-
yield formApi.deleteFormTemplatesInGroup(groupId, idsAndRevs);
|
|
233
|
-
}));
|
|
234
|
-
});
|
|
235
|
-
(0, test_utils_1.describeNoLite)('Form Templates Batch Operations in Group Tests', () => {
|
|
236
|
-
it('should create, get, and modify multiple form templates in a group (batch)', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
237
|
-
// Given
|
|
238
|
-
const { formApi, userApi } = yield initApi(env);
|
|
239
|
-
const currentUser = yield userApi.getCurrentUser();
|
|
240
|
-
const groupId = env.testGroupId;
|
|
241
|
-
const specialtyCode = 'SPECIALTY-' + (0, crypto_1.randomUUID)();
|
|
242
|
-
// Create multiple templates
|
|
243
|
-
const templatesToCreate = [
|
|
244
|
-
new FormTemplate_1.FormTemplate({
|
|
245
|
-
id: (0, crypto_1.randomUUID)(),
|
|
246
|
-
guid: (0, crypto_1.randomUUID)(),
|
|
247
|
-
author: currentUser.id,
|
|
248
|
-
name: 'Batch Template 1',
|
|
249
|
-
specialty: new CodeStub_1.CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),
|
|
250
|
-
descr: 'First batch template',
|
|
251
|
-
}),
|
|
252
|
-
new FormTemplate_1.FormTemplate({
|
|
253
|
-
id: (0, crypto_1.randomUUID)(),
|
|
254
|
-
guid: (0, crypto_1.randomUUID)(),
|
|
255
|
-
author: currentUser.id,
|
|
256
|
-
name: 'Batch Template 2',
|
|
257
|
-
specialty: new CodeStub_1.CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),
|
|
258
|
-
descr: 'Second batch template',
|
|
259
|
-
}),
|
|
260
|
-
new FormTemplate_1.FormTemplate({
|
|
261
|
-
id: (0, crypto_1.randomUUID)(),
|
|
262
|
-
guid: (0, crypto_1.randomUUID)(),
|
|
263
|
-
author: currentUser.id,
|
|
264
|
-
name: 'Batch Template 3',
|
|
265
|
-
specialty: new CodeStub_1.CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),
|
|
266
|
-
descr: 'Third batch template',
|
|
267
|
-
}),
|
|
268
|
-
];
|
|
269
|
-
// Create batch
|
|
270
|
-
const createdTemplates = yield formApi.createFormTemplatesInGroup(groupId, templatesToCreate);
|
|
271
|
-
(0, chai_1.expect)(createdTemplates).to.have.lengthOf(3);
|
|
272
|
-
(0, chai_1.expect)(createdTemplates[0].name).to.equal('Batch Template 1');
|
|
273
|
-
(0, chai_1.expect)(createdTemplates[1].name).to.equal('Batch Template 2');
|
|
274
|
-
(0, chai_1.expect)(createdTemplates[2].name).to.equal('Batch Template 3');
|
|
275
|
-
createdTemplates.forEach((template) => {
|
|
276
|
-
(0, chai_1.expect)(template.id).to.not.be.undefined;
|
|
277
|
-
(0, chai_1.expect)(template.rev).to.not.be.undefined;
|
|
278
|
-
});
|
|
279
|
-
// Get batch by IDs
|
|
280
|
-
const retrievedTemplates = yield formApi.getFormTemplatesInGroup(groupId, createdTemplates.map((t) => t.id));
|
|
281
|
-
(0, chai_1.expect)(retrievedTemplates).to.have.lengthOf(3);
|
|
282
|
-
(0, chai_1.expect)(retrievedTemplates.map((t) => t.id)).to.have.members(createdTemplates.map((t) => t.id));
|
|
283
|
-
// Modify batch
|
|
284
|
-
const templatesForUpdate = createdTemplates.map((t, index) => (Object.assign(Object.assign({}, t), { name: `Updated Batch Template ${index + 1}` })));
|
|
285
|
-
const updatedTemplates = yield formApi.modifyFormTemplatesInGroup(groupId, templatesForUpdate);
|
|
286
|
-
(0, chai_1.expect)(updatedTemplates).to.have.lengthOf(3);
|
|
287
|
-
(0, chai_1.expect)(updatedTemplates[0].name).to.equal('Updated Batch Template 1');
|
|
288
|
-
(0, chai_1.expect)(updatedTemplates[1].name).to.equal('Updated Batch Template 2');
|
|
289
|
-
(0, chai_1.expect)(updatedTemplates[2].name).to.equal('Updated Batch Template 3');
|
|
290
|
-
// Clean up - delete batch
|
|
291
|
-
const idsAndRevs = updatedTemplates.map((t) => new IdWithRev_1.IdWithRev({ id: t.id, rev: t.rev }));
|
|
292
|
-
const deleteResults = yield formApi.deleteFormTemplatesInGroup(groupId, idsAndRevs);
|
|
293
|
-
(0, chai_1.expect)(deleteResults).to.have.lengthOf(3);
|
|
294
|
-
deleteResults.forEach((result) => {
|
|
295
|
-
(0, chai_1.expect)(result.id).to.not.be.undefined;
|
|
296
|
-
(0, chai_1.expect)(result.rev).to.not.be.undefined;
|
|
297
|
-
});
|
|
298
|
-
}));
|
|
299
|
-
it('should delete and undelete multiple form templates in a group (batch)', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
300
|
-
// Given
|
|
301
|
-
const { formApi, userApi } = yield initApi(env);
|
|
302
|
-
const currentUser = yield userApi.getCurrentUser();
|
|
303
|
-
const groupId = env.testGroupId;
|
|
304
|
-
const specialtyCode = 'SPECIALTY-' + (0, crypto_1.randomUUID)();
|
|
305
|
-
// Create templates
|
|
306
|
-
const templatesToCreate = [
|
|
307
|
-
new FormTemplate_1.FormTemplate({
|
|
308
|
-
id: (0, crypto_1.randomUUID)(),
|
|
309
|
-
guid: (0, crypto_1.randomUUID)(),
|
|
310
|
-
author: currentUser.id,
|
|
311
|
-
name: 'Delete Test Template 1',
|
|
312
|
-
specialty: new CodeStub_1.CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),
|
|
313
|
-
}),
|
|
314
|
-
new FormTemplate_1.FormTemplate({
|
|
315
|
-
id: (0, crypto_1.randomUUID)(),
|
|
316
|
-
guid: (0, crypto_1.randomUUID)(),
|
|
317
|
-
author: currentUser.id,
|
|
318
|
-
name: 'Delete Test Template 2',
|
|
319
|
-
specialty: new CodeStub_1.CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),
|
|
320
|
-
}),
|
|
321
|
-
];
|
|
322
|
-
const createdTemplates = yield formApi.createFormTemplatesInGroup(groupId, templatesToCreate);
|
|
323
|
-
(0, chai_1.expect)(createdTemplates).to.have.lengthOf(2);
|
|
324
|
-
// Delete batch
|
|
325
|
-
const idsAndRevs = createdTemplates.map((t) => new IdWithRev_1.IdWithRev({ id: t.id, rev: t.rev }));
|
|
326
|
-
const deleteResults = yield formApi.deleteFormTemplatesInGroup(groupId, idsAndRevs);
|
|
327
|
-
(0, chai_1.expect)(deleteResults).to.have.lengthOf(2);
|
|
328
|
-
// Verify deletion - templates should not be in active list
|
|
329
|
-
const allTemplates = yield formApi.getFormTemplatesByUserInGroup(groupId, currentUser.id);
|
|
330
|
-
const activeIds = allTemplates.map((t) => t.id);
|
|
331
|
-
createdTemplates.forEach((t) => {
|
|
332
|
-
(0, chai_1.expect)(activeIds).to.not.include(t.id);
|
|
333
|
-
});
|
|
334
|
-
// Undelete batch - use the updated revisions from delete results
|
|
335
|
-
const undeleteIdsAndRevs = deleteResults.map((result) => new IdWithRev_1.IdWithRev({ id: result.id, rev: result.rev }));
|
|
336
|
-
const undeletedTemplates = yield formApi.undeleteFormTemplatesInGroup(groupId, undeleteIdsAndRevs);
|
|
337
|
-
(0, chai_1.expect)(undeletedTemplates).to.have.lengthOf(2);
|
|
338
|
-
undeletedTemplates.forEach((template) => {
|
|
339
|
-
(0, chai_1.expect)(template.id).to.not.be.undefined;
|
|
340
|
-
(0, chai_1.expect)(template.rev).to.not.be.undefined;
|
|
341
|
-
(0, chai_1.expect)(template.deletionDate).to.be.undefined;
|
|
342
|
-
});
|
|
343
|
-
// Verify undelete - templates should be back in active list
|
|
344
|
-
const templatesAfterUndelete = yield formApi.getFormTemplatesByUserInGroup(groupId, currentUser.id);
|
|
345
|
-
const activeIdsAfterUndelete = templatesAfterUndelete.map((t) => t.id);
|
|
346
|
-
undeletedTemplates.forEach((t) => {
|
|
347
|
-
(0, chai_1.expect)(activeIdsAfterUndelete).to.include(t.id);
|
|
348
|
-
});
|
|
349
|
-
// Final cleanup - delete again
|
|
350
|
-
const finalIdsAndRevs = undeletedTemplates.map((t) => new IdWithRev_1.IdWithRev({ id: t.id, rev: t.rev }));
|
|
351
|
-
yield formApi.deleteFormTemplatesInGroup(groupId, finalIdsAndRevs);
|
|
352
|
-
}));
|
|
353
|
-
it('should purge multiple form templates in a group (batch)', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
354
|
-
// Given
|
|
355
|
-
const { formApi, userApi } = yield initApi(env);
|
|
356
|
-
const currentUser = yield userApi.getCurrentUser();
|
|
357
|
-
const groupId = env.testGroupId;
|
|
358
|
-
const specialtyCode = 'SPECIALTY-' + (0, crypto_1.randomUUID)();
|
|
359
|
-
// Create templates
|
|
360
|
-
const templatesToCreate = [
|
|
361
|
-
new FormTemplate_1.FormTemplate({
|
|
362
|
-
id: (0, crypto_1.randomUUID)(),
|
|
363
|
-
guid: (0, crypto_1.randomUUID)(),
|
|
364
|
-
author: currentUser.id,
|
|
365
|
-
name: 'Purge Test Template 1',
|
|
366
|
-
specialty: new CodeStub_1.CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),
|
|
367
|
-
}),
|
|
368
|
-
new FormTemplate_1.FormTemplate({
|
|
369
|
-
id: (0, crypto_1.randomUUID)(),
|
|
370
|
-
guid: (0, crypto_1.randomUUID)(),
|
|
371
|
-
author: currentUser.id,
|
|
372
|
-
name: 'Purge Test Template 2',
|
|
373
|
-
specialty: new CodeStub_1.CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),
|
|
374
|
-
}),
|
|
375
|
-
];
|
|
376
|
-
const createdTemplates = yield formApi.createFormTemplatesInGroup(groupId, templatesToCreate);
|
|
377
|
-
(0, chai_1.expect)(createdTemplates).to.have.lengthOf(2);
|
|
378
|
-
// First delete them (purge requires deletion first)
|
|
379
|
-
const deleteIdsAndRevs = createdTemplates.map((t) => new IdWithRev_1.IdWithRev({ id: t.id, rev: t.rev }));
|
|
380
|
-
const deleteResults = yield formApi.deleteFormTemplatesInGroup(groupId, deleteIdsAndRevs);
|
|
381
|
-
(0, chai_1.expect)(deleteResults).to.have.lengthOf(2);
|
|
382
|
-
// Purge batch
|
|
383
|
-
const purgeIdsAndRevs = deleteResults.map((result) => new IdWithRev_1.IdWithRev({ id: result.id, rev: result.rev }));
|
|
384
|
-
const purgeResults = yield formApi.purgeFormTemplatesInGroup(groupId, purgeIdsAndRevs);
|
|
385
|
-
(0, chai_1.expect)(purgeResults).to.have.lengthOf(2);
|
|
386
|
-
purgeResults.forEach((result) => {
|
|
387
|
-
(0, chai_1.expect)(result.id).to.not.be.undefined;
|
|
388
|
-
});
|
|
389
|
-
// Verify purge - trying to get the templates should fail or return empty
|
|
390
|
-
const retrievedTemplates = yield formApi.getFormTemplatesInGroup(groupId, createdTemplates.map((t) => t.id));
|
|
391
|
-
(0, chai_1.expect)(retrievedTemplates).to.have.lengthOf(0);
|
|
392
|
-
}));
|
|
393
|
-
it('should handle empty batch operations gracefully', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
394
|
-
// Given
|
|
395
|
-
const { formApi } = yield initApi(env);
|
|
396
|
-
const groupId = env.testGroupId;
|
|
397
|
-
// Test with empty arrays
|
|
398
|
-
const createdTemplates = yield formApi.createFormTemplatesInGroup(groupId, []);
|
|
399
|
-
(0, chai_1.expect)(createdTemplates).to.have.lengthOf(0);
|
|
400
|
-
const modifiedTemplates = yield formApi.modifyFormTemplatesInGroup(groupId, []);
|
|
401
|
-
(0, chai_1.expect)(modifiedTemplates).to.have.lengthOf(0);
|
|
402
|
-
const retrievedTemplates = yield formApi.getFormTemplatesInGroup(groupId, []);
|
|
403
|
-
(0, chai_1.expect)(retrievedTemplates).to.have.lengthOf(0);
|
|
404
|
-
const deleteResults = yield formApi.deleteFormTemplatesInGroup(groupId, []);
|
|
405
|
-
(0, chai_1.expect)(deleteResults).to.have.lengthOf(0);
|
|
406
|
-
const undeleteResults = yield formApi.undeleteFormTemplatesInGroup(groupId, []);
|
|
407
|
-
(0, chai_1.expect)(undeleteResults).to.have.lengthOf(0);
|
|
408
|
-
const purgeResults = yield formApi.purgeFormTemplatesInGroup(groupId, []);
|
|
409
|
-
(0, chai_1.expect)(purgeResults).to.have.lengthOf(0);
|
|
410
|
-
}));
|
|
411
|
-
});
|
|
412
|
-
});
|
|
413
|
-
//# sourceMappingURL=icc-form-x-api.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"icc-form-x-api.js","sourceRoot":"","sources":["../../../test/icc-x-api/icc-form-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4BAAyB;AACzB,oDAAuI;AACvI,iCAA8B;AAC9B,+CAA6D;AAC7D,2CAA0C;AAC1C,yDAAqD;AAErD,mCAAmC;AACnC,mDAA+C;AAC/C,mEAA+D;AAC/D,2DAAuD;AACvD,+BAAqC;AACrC,IAAO,OAAO,GAAG,sBAAS,CAAC,OAAO,CAAA;AAClC,mDAAmE;AACnE,wFAAyF;AACzF,6DAAyD;AAEzD,IAAA,4BAAe,EAAC,KAAK,CAAC,CAAA;AACtB,IAAI,GAAa,CAAA;AAEjB,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,IAAA,cAAM,EAAC;;YACL,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;YACpB,MAAM,WAAW,GAAG,MAAM,IAAA,sCAAyB,GAAE,CAAA;YACrD,GAAG,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,IAAA,uBAAe,GAAE,CAAC,CAAA;QACpD,CAAC;KAAA,CAAC,CAAA;IAEF,SAAe,aAAa,CAAC,gBAAgC,EAAE,OAAa;;YAC1E,OAAO,gBAAgB,CAAC,qBAAqB,CAC3C,OAAO,EACP,MAAM,gBAAgB,CAAC,WAAW,CAChC,OAAO,EACP,IAAI,iBAAO,CAAC;gBACV,EAAE,EAAE,IAAA,mBAAU,GAAE;gBAChB,SAAS,EAAE,MAAM;gBACjB,QAAQ,EAAE,MAAM;gBAChB,IAAI,EAAE,kBAAkB;aACzB,CAAC,CACH,CACF,CAAA;QACH,CAAC;KAAA;IAED,EAA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CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import 'isomorphic-fetch'\nimport { describeNoLite, getEnvironmentInitializer, hcp1Username, hcp2Username, setLocalStorage, TestUtils } from '../utils/test_utils'\nimport { before } from 'mocha'\nimport { IccPatientXApi, IccUserXApi } from '../../icc-x-api'\nimport { IccFormApi } from '../../icc-api'\nimport { Patient } from '../../icc-api/model/Patient'\nimport { User } from '../../icc-api/model/User'\nimport { randomUUID } from 'crypto'\nimport { Form } from '../../icc-api/model/Form'\nimport { FormTemplate } from '../../icc-api/model/FormTemplate'\nimport { CodeStub } from '../../icc-api/model/CodeStub'\nimport { assert, expect } from 'chai'\nimport initApi = TestUtils.initApi\nimport { getEnvVariables, TestVars } from '@icure/test-setup/types'\nimport { BasicAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\nimport { IdWithRev } from '../../icc-api/model/IdWithRev'\n\nsetLocalStorage(fetch)\nlet env: TestVars\n\ndescribe('icc-form-x-api Tests', () => {\n before(async function () {\n this.timeout(600000)\n const initializer = await getEnvironmentInitializer()\n env = await initializer.execute(getEnvVariables())\n })\n\n async function createPatient(patientApiForHcp: IccPatientXApi, hcpUser: User) {\n return patientApiForHcp.createPatientWithUser(\n hcpUser,\n await patientApiForHcp.newInstance(\n hcpUser,\n new Patient({\n id: randomUUID(),\n firstName: 'John',\n lastName: 'Snow',\n note: 'Winter is coming',\n })\n )\n )\n }\n\n it('Test', async () => {\n // Given\n const username = env.dataOwnerDetails[hcp1Username].user\n const password = env.dataOwnerDetails[hcp1Username].password\n\n const authProvider = new BasicAuthenticationProvider(username, password)\n\n const userApi = new IccUserXApi(env.iCureUrl, {}, authProvider, null as any, fetch)\n const formApi = new IccFormApi(env.iCureUrl, {}, authProvider, fetch)\n\n const currentUser = await userApi.getCurrentUser()\n })\n\n it('Test findBy', async () => {\n // Given\n const {\n userApi: userApiForHcp,\n dataOwnerApi: dataOwnerApiForHcp,\n patientApi: patientApiForHcp,\n cryptoApi: cryptoApiForHcp,\n dataOwnerApi: dateOwnerApiForHcp,\n formApi: formXApi,\n } = await initApi(env, hcp1Username)\n const hcpUser = await userApiForHcp.getCurrentUser()\n const patient = (await createPatient(patientApiForHcp, hcpUser)) as Patient\n\n const form = new Form({\n id: randomUUID(),\n created: new Date().getTime(),\n modified: new Date().getTime(),\n responsible: hcpUser.healthcarePartyId!,\n author: hcpUser.id,\n codes: [],\n tags: [],\n user: hcpUser.id,\n patient: patient.id,\n })\n const formToCreate = await formXApi.newInstance(hcpUser, patient, form)\n const createdForm = await formXApi.createForm(formToCreate)\n\n const foundItems: Form[] = (await formXApi.findBy(hcpUser.healthcarePartyId!, patient, false)) as Form[]\n const foundItemsUsingPost: Form[] = (await formXApi.findBy(hcpUser.healthcarePartyId!, patient, true)) as Form[]\n\n assert(foundItems.length == 1, 'Found items should be 1')\n assert(foundItems[0].id == createdForm.id, 'Found item should be the created one')\n\n assert(foundItemsUsingPost.length == 1, 'Found items using post should be 1')\n assert(foundItemsUsingPost[0].id == createdForm.id, 'Found item using post should be the created one')\n })\n\n it('Share with should work as expected', async () => {\n const api1 = await initApi(env!, hcp1Username)\n const user1 = await api1.userApi.getCurrentUser()\n const api2 = await initApi(env!, hcp2Username)\n const user2 = await api2.userApi.getCurrentUser()\n const samplePatient = await api1.patientApi.createPatientWithUser(\n user1,\n await api1.patientApi.newInstance(user1, { firstName: 'Gigio', lastName: 'Bagigio' })\n )\n const entity = await api1.formApi.createForm(await api1.formApi.newInstance(user1, samplePatient))\n await api2.formApi\n .getForm(entity.id!)\n .then(() => {\n throw new Error('Should not be able to get the entity')\n })\n .catch(() => {\n /* expected */\n })\n await api1.formApi.shareWith(user2.healthcarePartyId!, entity)\n const retrieved = await api2.formApi.getForm(entity.id!)\n expect((await api2.formApi.decryptPatientIdOf(retrieved))[0]).to.equal(samplePatient.id)\n })\n\n it('Tests for Form Templates', async () => {\n // Given\n const { formApi, userApi } = await initApi(env, hcp1Username)\n const guid = randomUUID()\n const specialtyCode = 'SPECIALTY-' + randomUUID()\n const user = await userApi.getCurrentUser()\n\n const formTemplateToCreate = new FormTemplate({\n id: randomUUID(),\n guid: guid,\n author: user.id,\n name: 'My Test Template',\n specialty: new CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),\n descr: 'Description of the template',\n })\n\n // Create\n const createdTemplate = await formApi.createFormTemplate(formTemplateToCreate)\n expect(createdTemplate.id).to.not.be.undefined\n expect(createdTemplate.guid).to.equal(guid)\n expect(createdTemplate.name).to.equal('My Test Template')\n\n // Get\n const retrievedTemplate = await formApi.getFormTemplate(createdTemplate.id!)\n expect(retrievedTemplate.id).to.equal(createdTemplate.id)\n\n // Find all\n const allTemplates = await formApi.findFormTemplates()\n expect(allTemplates.map((t) => t.id)).to.include(createdTemplate.id)\n\n // Find by specialty\n const templatesBySpecialty = await formApi.findFormTemplatesBySpeciality(specialtyCode)\n expect(templatesBySpecialty.map((t) => t.id)).to.include(createdTemplate.id)\n expect(templatesBySpecialty.length).to.be.greaterThan(0)\n\n // Get by GUID (using getFormTemplatesByGuid)\n const templatesByGuid = await formApi.getFormTemplatesByGuid(guid, specialtyCode)\n expect(templatesByGuid.map((t) => t.id)).to.include(createdTemplate.id)\n\n // Update\n createdTemplate.name = 'Updated Name'\n const updatedTemplate = await formApi.updateFormTemplate(createdTemplate.id!, createdTemplate)\n expect(updatedTemplate.name).to.equal('Updated Name')\n\n // Delete\n await formApi.deleteFormTemplate(createdTemplate.id!)\n try {\n await formApi.getFormTemplate(createdTemplate.id!)\n assert.fail('Should have thrown an error')\n } catch (e) {\n // Expected\n }\n })\n\n describeNoLite('Form Templates in Group Tests', () => {\n it('should create, find, update and delete form templates in a group', async () => {\n // Given\n const { formApi, userApi } = await initApi(env)\n const currentUser = await userApi.getCurrentUser()\n const guid = randomUUID()\n const specialtyCode = 'SPECIALTY-' + randomUUID()\n\n // Use the existing test group ID\n const groupId = env.testGroupId\n\n const formTemplateToCreate = new FormTemplate({\n id: randomUUID(),\n guid: guid,\n author: currentUser.id,\n name: 'My Group Template',\n specialty: new CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),\n descr: 'Description of the group template',\n })\n\n // Create In Group\n const createdTemplate = await formApi.createFormTemplateInGroup(groupId, formTemplateToCreate)\n expect(createdTemplate.id).to.not.be.undefined\n expect(createdTemplate.guid).to.equal(guid)\n if (createdTemplate.group) {\n expect(createdTemplate.group.guid).to.equal(groupId)\n }\n\n // Get In Group\n const templatesInGroup = await formApi.getFormTemplatesByUserInGroup(groupId, currentUser.id!)\n expect(templatesInGroup.map((t) => t.id)).to.include(createdTemplate.id)\n\n // Update In Group\n createdTemplate.name = 'Updated Group Name'\n const updatedTemplate = await formApi.updateFormTemplateInGroup(groupId, createdTemplate.id!, createdTemplate)\n expect(updatedTemplate.name).to.equal('Updated Group Name')\n\n // Delete In Group\n await formApi.deleteFormTemplateInGroup(groupId, updatedTemplate.id!, updatedTemplate.rev!)\n\n // Verify deletion\n const templatesInGroupAfterDelete = await formApi.getFormTemplatesByUserInGroup(groupId, currentUser.id!)\n expect(templatesInGroupAfterDelete.map((t) => t.id)).to.not.include(createdTemplate.id)\n })\n\n it('should find form templates by specialty in a group', async () => {\n // Given\n const { formApi, userApi } = await initApi(env)\n const currentUser = await userApi.getCurrentUser()\n const groupId = env.testGroupId\n const specialtyCode = 'SPECIALTY-' + randomUUID()\n const otherSpecialtyCode = 'SPECIALTY-' + randomUUID()\n\n const templatesToCreate = [\n new FormTemplate({\n id: randomUUID(),\n guid: randomUUID(),\n author: currentUser.id,\n name: 'Specialty Template 1',\n specialty: new CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),\n }),\n new FormTemplate({\n id: randomUUID(),\n guid: randomUUID(),\n author: currentUser.id,\n name: 'Specialty Template 2',\n specialty: new CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),\n }),\n new FormTemplate({\n id: randomUUID(),\n guid: randomUUID(),\n author: currentUser.id,\n name: 'Other Specialty Template',\n specialty: new CodeStub({ code: otherSpecialtyCode, type: 'specialty', version: '1' }),\n }),\n ]\n\n const createdTemplates = await formApi.createFormTemplatesInGroup(groupId, templatesToCreate)\n expect(createdTemplates).to.have.lengthOf(3)\n\n // When: find by specialty\n const templatesBySpecialty = await formApi.getFormTemplatesBySpecialtyInGroup(groupId, specialtyCode)\n\n // Then: should return only the 2 templates with the matching specialty\n expect(templatesBySpecialty.map((t) => t.id)).to.include(createdTemplates[0].id)\n expect(templatesBySpecialty.map((t) => t.id)).to.include(createdTemplates[1].id)\n expect(templatesBySpecialty.map((t) => t.id)).to.not.include(createdTemplates[2].id)\n\n // When: find by other specialty\n const otherTemplates = await formApi.getFormTemplatesBySpecialtyInGroup(groupId, otherSpecialtyCode)\n\n // Then: should return only the 1 template with the other specialty\n expect(otherTemplates.map((t) => t.id)).to.include(createdTemplates[2].id)\n expect(otherTemplates.map((t) => t.id)).to.not.include(createdTemplates[0].id)\n\n // When: find by non-existent specialty\n const emptyResult = await formApi.getFormTemplatesBySpecialtyInGroup(groupId, 'NONEXISTENT-' + randomUUID())\n\n // Then: should return empty\n expect(emptyResult).to.have.lengthOf(0)\n\n // Cleanup\n const idsAndRevs = createdTemplates.map((t) => new IdWithRev({ id: t.id!, rev: t.rev! }))\n await formApi.deleteFormTemplatesInGroup(groupId, idsAndRevs)\n })\n })\n\n describeNoLite('Form Templates Batch Operations in Group Tests', () => {\n it('should create, get, and modify multiple form templates in a group (batch)', async () => {\n // Given\n const { formApi, userApi } = await initApi(env)\n const currentUser = await userApi.getCurrentUser()\n const groupId = env.testGroupId\n const specialtyCode = 'SPECIALTY-' + randomUUID()\n\n // Create multiple templates\n const templatesToCreate = [\n new FormTemplate({\n id: randomUUID(),\n guid: randomUUID(),\n author: currentUser.id,\n name: 'Batch Template 1',\n specialty: new CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),\n descr: 'First batch template',\n }),\n new FormTemplate({\n id: randomUUID(),\n guid: randomUUID(),\n author: currentUser.id,\n name: 'Batch Template 2',\n specialty: new CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),\n descr: 'Second batch template',\n }),\n new FormTemplate({\n id: randomUUID(),\n guid: randomUUID(),\n author: currentUser.id,\n name: 'Batch Template 3',\n specialty: new CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),\n descr: 'Third batch template',\n }),\n ]\n\n // Create batch\n const createdTemplates = await formApi.createFormTemplatesInGroup(groupId, templatesToCreate)\n expect(createdTemplates).to.have.lengthOf(3)\n expect(createdTemplates[0].name).to.equal('Batch Template 1')\n expect(createdTemplates[1].name).to.equal('Batch Template 2')\n expect(createdTemplates[2].name).to.equal('Batch Template 3')\n createdTemplates.forEach((template) => {\n expect(template.id).to.not.be.undefined\n expect(template.rev).to.not.be.undefined\n })\n\n // Get batch by IDs\n const retrievedTemplates = await formApi.getFormTemplatesInGroup(\n groupId,\n createdTemplates.map((t) => t.id!)\n )\n expect(retrievedTemplates).to.have.lengthOf(3)\n expect(retrievedTemplates.map((t) => t.id)).to.have.members(createdTemplates.map((t) => t.id))\n\n // Modify batch\n const templatesForUpdate = createdTemplates.map((t, index) => ({\n ...t,\n name: `Updated Batch Template ${index + 1}`,\n }))\n const updatedTemplates = await formApi.modifyFormTemplatesInGroup(groupId, templatesForUpdate)\n expect(updatedTemplates).to.have.lengthOf(3)\n expect(updatedTemplates[0].name).to.equal('Updated Batch Template 1')\n expect(updatedTemplates[1].name).to.equal('Updated Batch Template 2')\n expect(updatedTemplates[2].name).to.equal('Updated Batch Template 3')\n\n // Clean up - delete batch\n const idsAndRevs = updatedTemplates.map((t) => new IdWithRev({ id: t.id!, rev: t.rev! }))\n const deleteResults = await formApi.deleteFormTemplatesInGroup(groupId, idsAndRevs)\n expect(deleteResults).to.have.lengthOf(3)\n deleteResults.forEach((result) => {\n expect(result.id).to.not.be.undefined\n expect(result.rev).to.not.be.undefined\n })\n })\n\n it('should delete and undelete multiple form templates in a group (batch)', async () => {\n // Given\n const { formApi, userApi } = await initApi(env)\n const currentUser = await userApi.getCurrentUser()\n const groupId = env.testGroupId\n const specialtyCode = 'SPECIALTY-' + randomUUID()\n\n // Create templates\n const templatesToCreate = [\n new FormTemplate({\n id: randomUUID(),\n guid: randomUUID(),\n author: currentUser.id,\n name: 'Delete Test Template 1',\n specialty: new CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),\n }),\n new FormTemplate({\n id: randomUUID(),\n guid: randomUUID(),\n author: currentUser.id,\n name: 'Delete Test Template 2',\n specialty: new CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),\n }),\n ]\n\n const createdTemplates = await formApi.createFormTemplatesInGroup(groupId, templatesToCreate)\n expect(createdTemplates).to.have.lengthOf(2)\n\n // Delete batch\n const idsAndRevs = createdTemplates.map((t) => new IdWithRev({ id: t.id!, rev: t.rev! }))\n const deleteResults = await formApi.deleteFormTemplatesInGroup(groupId, idsAndRevs)\n expect(deleteResults).to.have.lengthOf(2)\n\n // Verify deletion - templates should not be in active list\n const allTemplates = await formApi.getFormTemplatesByUserInGroup(groupId, currentUser.id!)\n const activeIds = allTemplates.map((t) => t.id)\n createdTemplates.forEach((t) => {\n expect(activeIds).to.not.include(t.id)\n })\n\n // Undelete batch - use the updated revisions from delete results\n const undeleteIdsAndRevs = deleteResults.map((result) => new IdWithRev({ id: result.id!, rev: result.rev! }))\n const undeletedTemplates = await formApi.undeleteFormTemplatesInGroup(groupId, undeleteIdsAndRevs)\n expect(undeletedTemplates).to.have.lengthOf(2)\n undeletedTemplates.forEach((template) => {\n expect(template.id).to.not.be.undefined\n expect(template.rev).to.not.be.undefined\n expect(template.deletionDate).to.be.undefined\n })\n\n // Verify undelete - templates should be back in active list\n const templatesAfterUndelete = await formApi.getFormTemplatesByUserInGroup(groupId, currentUser.id!)\n const activeIdsAfterUndelete = templatesAfterUndelete.map((t) => t.id)\n undeletedTemplates.forEach((t) => {\n expect(activeIdsAfterUndelete).to.include(t.id)\n })\n\n // Final cleanup - delete again\n const finalIdsAndRevs = undeletedTemplates.map((t) => new IdWithRev({ id: t.id!, rev: t.rev! }))\n await formApi.deleteFormTemplatesInGroup(groupId, finalIdsAndRevs)\n })\n\n it('should purge multiple form templates in a group (batch)', async () => {\n // Given\n const { formApi, userApi } = await initApi(env)\n const currentUser = await userApi.getCurrentUser()\n const groupId = env.testGroupId\n const specialtyCode = 'SPECIALTY-' + randomUUID()\n\n // Create templates\n const templatesToCreate = [\n new FormTemplate({\n id: randomUUID(),\n guid: randomUUID(),\n author: currentUser.id,\n name: 'Purge Test Template 1',\n specialty: new CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),\n }),\n new FormTemplate({\n id: randomUUID(),\n guid: randomUUID(),\n author: currentUser.id,\n name: 'Purge Test Template 2',\n specialty: new CodeStub({ code: specialtyCode, type: 'specialty', version: '1' }),\n }),\n ]\n\n const createdTemplates = await formApi.createFormTemplatesInGroup(groupId, templatesToCreate)\n expect(createdTemplates).to.have.lengthOf(2)\n\n // First delete them (purge requires deletion first)\n const deleteIdsAndRevs = createdTemplates.map((t) => new IdWithRev({ id: t.id!, rev: t.rev! }))\n const deleteResults = await formApi.deleteFormTemplatesInGroup(groupId, deleteIdsAndRevs)\n expect(deleteResults).to.have.lengthOf(2)\n\n // Purge batch\n const purgeIdsAndRevs = deleteResults.map((result) => new IdWithRev({ id: result.id!, rev: result.rev! }))\n const purgeResults = await formApi.purgeFormTemplatesInGroup(groupId, purgeIdsAndRevs)\n expect(purgeResults).to.have.lengthOf(2)\n purgeResults.forEach((result) => {\n expect(result.id).to.not.be.undefined\n })\n\n // Verify purge - trying to get the templates should fail or return empty\n const retrievedTemplates = await formApi.getFormTemplatesInGroup(\n groupId,\n createdTemplates.map((t) => t.id!)\n )\n expect(retrievedTemplates).to.have.lengthOf(0)\n })\n\n it('should handle empty batch operations gracefully', async () => {\n // Given\n const { formApi } = await initApi(env)\n const groupId = env.testGroupId\n\n // Test with empty arrays\n const createdTemplates = await formApi.createFormTemplatesInGroup(groupId, [])\n expect(createdTemplates).to.have.lengthOf(0)\n\n const modifiedTemplates = await formApi.modifyFormTemplatesInGroup(groupId, [])\n expect(modifiedTemplates).to.have.lengthOf(0)\n\n const retrievedTemplates = await formApi.getFormTemplatesInGroup(groupId, [])\n expect(retrievedTemplates).to.have.lengthOf(0)\n\n const deleteResults = await formApi.deleteFormTemplatesInGroup(groupId, [])\n expect(deleteResults).to.have.lengthOf(0)\n\n const undeleteResults = await formApi.undeleteFormTemplatesInGroup(groupId, [])\n expect(undeleteResults).to.have.lengthOf(0)\n\n const purgeResults = await formApi.purgeFormTemplatesInGroup(groupId, [])\n expect(purgeResults).to.have.lengthOf(0)\n })\n })\n})\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'isomorphic-fetch';
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
require("isomorphic-fetch");
|
|
13
|
-
const mocha_1 = require("mocha");
|
|
14
|
-
const test_utils_1 = require("../utils/test_utils");
|
|
15
|
-
var initApi = test_utils_1.TestUtils.initApi;
|
|
16
|
-
const chai_1 = require("chai");
|
|
17
|
-
const types_1 = require("@icure/test-setup/types");
|
|
18
|
-
(0, test_utils_1.setLocalStorage)(fetch);
|
|
19
|
-
let env;
|
|
20
|
-
describe('icc-hcparty-x-api Tests', () => {
|
|
21
|
-
(0, mocha_1.before)(function () {
|
|
22
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
this.timeout(600000);
|
|
24
|
-
const initializer = yield (0, test_utils_1.getEnvironmentInitializer)();
|
|
25
|
-
env = yield initializer.execute((0, types_1.getEnvVariables)());
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
it('Does not cache entities that are not HCPs', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
-
// Given
|
|
30
|
-
const { userApi: userApi, healthcarePartyApi: hcpApi } = yield initApi(env, test_utils_1.hcp1Username);
|
|
31
|
-
const user = yield userApi.getCurrentUser();
|
|
32
|
-
const retrievedBoth = yield hcpApi.getHealthcareParties({ ids: [user.id, user.healthcarePartyId] });
|
|
33
|
-
(0, chai_1.expect)(retrievedBoth.map((x) => x.id)).to.have.members([user.healthcarePartyId]);
|
|
34
|
-
const hcp = yield hcpApi.getHealthcareParty(user.healthcarePartyId);
|
|
35
|
-
(0, chai_1.expect)(hcp.id).to.be.equal(user.healthcarePartyId);
|
|
36
|
-
yield hcpApi.getHealthcareParty(user.id).then((_) => {
|
|
37
|
-
throw new Error('This promise should not resolve');
|
|
38
|
-
}, (e) => {
|
|
39
|
-
(0, chai_1.expect)(JSON.parse(e.message)['message']).to.be.equal(`Object with ID ${user.id} is not of expected type org.taktik.icure.entities.HealthcareParty but of type org.taktik.icure.entities.User`);
|
|
40
|
-
});
|
|
41
|
-
}));
|
|
42
|
-
});
|
|
43
|
-
//# sourceMappingURL=icc-hcparty-x-api-test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"icc-hcparty-x-api-test.js","sourceRoot":"","sources":["../../../test/icc-x-api/icc-hcparty-x-api-test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4BAAyB;AAEzB,iCAA8B;AAC9B,oDAAyG;AACzG,IAAO,OAAO,GAAG,sBAAS,CAAC,OAAO,CAAA;AAClC,+BAA6B;AAC7B,mDAA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I,CAC5C,CAAC,CAAC,EAAE,EAAE;YACJ,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;QACpD,CAAC,EACD,CAAC,CAAC,EAAE,EAAE;YACJ,IAAA,aAAM,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAClD,kBAAkB,IAAI,CAAC,EAAG,+GAA+G,CAC1I,CAAA;QACH,CAAC,CACF,CAAA;IACH,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import 'isomorphic-fetch'\n\nimport { before } from 'mocha'\nimport { getEnvironmentInitializer, hcp1Username, setLocalStorage, TestUtils } from '../utils/test_utils'\nimport initApi = TestUtils.initApi\nimport { expect } from 'chai'\nimport { getEnvVariables, TestVars } from '@icure/test-setup/types'\nimport { HealthcareParty } from '../../icc-api/model/HealthcareParty'\n\nsetLocalStorage(fetch)\nlet env: TestVars\n\ndescribe('icc-hcparty-x-api Tests', () => {\n before(async function () {\n this.timeout(600000)\n const initializer = await getEnvironmentInitializer()\n env = await initializer.execute(getEnvVariables())\n })\n\n it('Does not cache entities that are not HCPs', async () => {\n // Given\n const { userApi: userApi, healthcarePartyApi: hcpApi } = await initApi(env, hcp1Username)\n\n const user = await userApi.getCurrentUser()\n\n const retrievedBoth: HealthcareParty[] = await hcpApi.getHealthcareParties({ ids: [user.id!, user.healthcarePartyId!] })\n expect(retrievedBoth.map((x) => x.id)).to.have.members([user.healthcarePartyId])\n\n const hcp = await hcpApi.getHealthcareParty(user.healthcarePartyId!)\n expect(hcp.id).to.be.equal(user.healthcarePartyId!)\n\n await hcpApi.getHealthcareParty(user.id!).then(\n (_) => {\n throw new Error('This promise should not resolve')\n },\n (e) => {\n expect(JSON.parse(e.message)['message']).to.be.equal(\n `Object with ID ${user.id!} is not of expected type org.taktik.icure.entities.HealthcareParty but of type org.taktik.icure.entities.User`\n )\n }\n )\n })\n})\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'isomorphic-fetch';
|