@icure/api 6.0.1 → 6.0.3
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/IccAccesslogApi.d.ts +3 -1
- package/icc-api/api/IccAccesslogApi.js +9 -8
- package/icc-api/api/IccAccesslogApi.js.map +1 -1
- package/icc-api/api/IccAgendaApi.d.ts +3 -1
- package/icc-api/api/IccAgendaApi.js +9 -8
- package/icc-api/api/IccAgendaApi.js.map +1 -1
- package/icc-api/api/IccAnonymousAccessApi.d.ts +3 -1
- package/icc-api/api/IccAnonymousAccessApi.js +5 -4
- package/icc-api/api/IccAnonymousAccessApi.js.map +1 -1
- package/icc-api/api/IccApplicationsettingsApi.d.ts +3 -1
- package/icc-api/api/IccApplicationsettingsApi.js +5 -4
- package/icc-api/api/IccApplicationsettingsApi.js.map +1 -1
- package/icc-api/api/IccArticleApi.d.ts +3 -1
- package/icc-api/api/IccArticleApi.js +7 -6
- package/icc-api/api/IccArticleApi.js.map +1 -1
- package/icc-api/api/IccAuthApi.d.ts +10 -0
- package/icc-api/api/IccAuthApi.js +25 -1
- package/icc-api/api/IccAuthApi.js.map +1 -1
- package/icc-api/api/IccBeefactApi.d.ts +3 -1
- package/icc-api/api/IccBeefactApi.js +3 -2
- package/icc-api/api/IccBeefactApi.js.map +1 -1
- package/icc-api/api/IccBekmehrApi.d.ts +3 -1
- package/icc-api/api/IccBekmehrApi.js +29 -28
- package/icc-api/api/IccBekmehrApi.js.map +1 -1
- package/icc-api/api/IccBemikronoApi.d.ts +3 -1
- package/icc-api/api/IccBemikronoApi.js +10 -9
- package/icc-api/api/IccBemikronoApi.js.map +1 -1
- package/icc-api/api/IccBeresultexportApi.d.ts +3 -1
- package/icc-api/api/IccBeresultexportApi.js +5 -4
- package/icc-api/api/IccBeresultexportApi.js.map +1 -1
- package/icc-api/api/IccBeresultimportApi.d.ts +3 -1
- package/icc-api/api/IccBeresultimportApi.js +5 -4
- package/icc-api/api/IccBeresultimportApi.js.map +1 -1
- package/icc-api/api/IccBesamv2Api.d.ts +3 -1
- package/icc-api/api/IccBesamv2Api.js +35 -34
- package/icc-api/api/IccBesamv2Api.js.map +1 -1
- package/icc-api/api/IccCalendarItemApi.d.ts +3 -1
- package/icc-api/api/IccCalendarItemApi.js +14 -13
- package/icc-api/api/IccCalendarItemApi.js.map +1 -1
- package/icc-api/api/IccCalendarItemTypeApi.d.ts +3 -1
- package/icc-api/api/IccCalendarItemTypeApi.js +8 -7
- package/icc-api/api/IccCalendarItemTypeApi.js.map +1 -1
- package/icc-api/api/IccClassificationApi.d.ts +3 -1
- package/icc-api/api/IccClassificationApi.js +10 -9
- package/icc-api/api/IccClassificationApi.js.map +1 -1
- package/icc-api/api/IccClassificationTemplateApi.d.ts +3 -1
- package/icc-api/api/IccClassificationTemplateApi.js +10 -9
- package/icc-api/api/IccClassificationTemplateApi.js.map +1 -1
- package/icc-api/api/IccCodeApi.d.ts +3 -1
- package/icc-api/api/IccCodeApi.js +18 -17
- package/icc-api/api/IccCodeApi.js.map +1 -1
- package/icc-api/api/IccContactApi.d.ts +3 -2
- package/icc-api/api/IccContactApi.js +30 -32
- package/icc-api/api/IccContactApi.js.map +1 -1
- package/icc-api/api/IccDeviceApi.d.ts +3 -1
- package/icc-api/api/IccDeviceApi.js +20 -19
- package/icc-api/api/IccDeviceApi.js.map +1 -1
- package/icc-api/api/IccDoctemplateApi.d.ts +3 -1
- package/icc-api/api/IccDoctemplateApi.js +15 -14
- package/icc-api/api/IccDoctemplateApi.js.map +1 -1
- package/icc-api/api/IccDocumentApi.d.ts +3 -1
- package/icc-api/api/IccDocumentApi.js +22 -21
- package/icc-api/api/IccDocumentApi.js.map +1 -1
- package/icc-api/api/IccDocumentTemplateApi.d.ts +3 -1
- package/icc-api/api/IccDocumentTemplateApi.js +15 -14
- package/icc-api/api/IccDocumentTemplateApi.js.map +1 -1
- package/icc-api/api/IccEntityrefApi.d.ts +3 -1
- package/icc-api/api/IccEntityrefApi.js +4 -3
- package/icc-api/api/IccEntityrefApi.js.map +1 -1
- package/icc-api/api/IccEntitytemplateApi.d.ts +3 -1
- package/icc-api/api/IccEntitytemplateApi.js +13 -12
- package/icc-api/api/IccEntitytemplateApi.js.map +1 -1
- package/icc-api/api/IccFormApi.d.ts +3 -1
- package/icc-api/api/IccFormApi.js +26 -25
- package/icc-api/api/IccFormApi.js.map +1 -1
- package/icc-api/api/IccFrontendmigrationApi.d.ts +3 -1
- package/icc-api/api/IccFrontendmigrationApi.js +8 -7
- package/icc-api/api/IccFrontendmigrationApi.js.map +1 -1
- package/icc-api/api/IccGroupApi.d.ts +3 -1
- package/icc-api/api/IccGroupApi.js +18 -17
- package/icc-api/api/IccGroupApi.js.map +1 -1
- package/icc-api/api/IccHcpartyApi.d.ts +3 -1
- package/icc-api/api/IccHcpartyApi.js +24 -23
- package/icc-api/api/IccHcpartyApi.js.map +1 -1
- package/icc-api/api/IccHelementApi.d.ts +3 -1
- package/icc-api/api/IccHelementApi.js +15 -14
- package/icc-api/api/IccHelementApi.js.map +1 -1
- package/icc-api/api/IccIcureApi.d.ts +3 -1
- package/icc-api/api/IccIcureApi.js +18 -17
- package/icc-api/api/IccIcureApi.js.map +1 -1
- package/icc-api/api/IccInsuranceApi.d.ts +3 -1
- package/icc-api/api/IccInsuranceApi.js +9 -8
- package/icc-api/api/IccInsuranceApi.js.map +1 -1
- package/icc-api/api/IccInvoiceApi.d.ts +3 -1
- package/icc-api/api/IccInvoiceApi.js +33 -32
- package/icc-api/api/IccInvoiceApi.js.map +1 -1
- package/icc-api/api/IccKeywordApi.d.ts +3 -1
- package/icc-api/api/IccKeywordApi.js +8 -7
- package/icc-api/api/IccKeywordApi.js.map +1 -1
- package/icc-api/api/IccMaintenanceTaskApi.d.ts +3 -1
- package/icc-api/api/IccMaintenanceTaskApi.js +7 -6
- package/icc-api/api/IccMaintenanceTaskApi.js.map +1 -1
- package/icc-api/api/IccMedexApi.d.ts +3 -1
- package/icc-api/api/IccMedexApi.js +3 -2
- package/icc-api/api/IccMedexApi.js.map +1 -1
- package/icc-api/api/IccMedicallocationApi.d.ts +3 -1
- package/icc-api/api/IccMedicallocationApi.js +7 -6
- package/icc-api/api/IccMedicallocationApi.js.map +1 -1
- package/icc-api/api/IccMessageApi.d.ts +3 -1
- package/icc-api/api/IccMessageApi.js +21 -20
- package/icc-api/api/IccMessageApi.js.map +1 -1
- package/icc-api/api/IccPatientApi.d.ts +3 -1
- package/icc-api/api/IccPatientApi.js +36 -35
- package/icc-api/api/IccPatientApi.js.map +1 -1
- package/icc-api/api/IccPermissionApi.d.ts +3 -1
- package/icc-api/api/IccPermissionApi.js +3 -2
- package/icc-api/api/IccPermissionApi.js.map +1 -1
- package/icc-api/api/IccPlaceApi.d.ts +3 -1
- package/icc-api/api/IccPlaceApi.js +7 -6
- package/icc-api/api/IccPlaceApi.js.map +1 -1
- package/icc-api/api/IccPubsubApi.d.ts +3 -1
- package/icc-api/api/IccPubsubApi.js +6 -5
- package/icc-api/api/IccPubsubApi.js.map +1 -1
- package/icc-api/api/IccReceiptApi.d.ts +3 -1
- package/icc-api/api/IccReceiptApi.js +9 -8
- package/icc-api/api/IccReceiptApi.js.map +1 -1
- package/icc-api/api/IccReplicationApi.d.ts +3 -1
- package/icc-api/api/IccReplicationApi.js +6 -5
- package/icc-api/api/IccReplicationApi.js.map +1 -1
- package/icc-api/api/IccTarificationApi.d.ts +3 -1
- package/icc-api/api/IccTarificationApi.js +10 -9
- package/icc-api/api/IccTarificationApi.js.map +1 -1
- package/icc-api/api/IccTimeTableApi.d.ts +3 -1
- package/icc-api/api/IccTimeTableApi.js +8 -7
- package/icc-api/api/IccTimeTableApi.js.map +1 -1
- package/icc-api/api/IccTmpApi.d.ts +3 -1
- package/icc-api/api/IccTmpApi.js +73 -72
- package/icc-api/api/IccTmpApi.js.map +1 -1
- package/icc-api/api/IccUserApi.d.ts +3 -1
- package/icc-api/api/IccUserApi.js +28 -27
- package/icc-api/api/IccUserApi.js.map +1 -1
- package/icc-api/api/XHR.d.ts +2 -1
- package/icc-api/api/XHR.js +45 -59
- package/icc-api/api/XHR.js.map +1 -1
- package/icc-api/model/AuthenticationResponse.d.ts +2 -0
- package/icc-api/model/AuthenticationResponse.js.map +1 -1
- package/icc-api/model/Group.d.ts +6 -0
- package/icc-api/model/Group.js.map +1 -1
- package/icc-api/model/RefreshTokenExpiredError.d.ts +3 -0
- package/icc-api/model/RefreshTokenExpiredError.js +10 -0
- package/icc-api/model/RefreshTokenExpiredError.js.map +1 -0
- package/icc-api/model/RegistrationInformation.d.ts +1 -0
- package/icc-api/model/RegistrationInformation.js.map +1 -1
- package/icc-api/model/TimeTableItem.d.ts +2 -1
- package/icc-api/model/TimeTableItem.js.map +1 -1
- package/icc-x-api/auth/AuthService.d.ts +16 -0
- package/icc-x-api/auth/AuthService.js +3 -0
- package/icc-x-api/auth/AuthService.js.map +1 -0
- package/icc-x-api/auth/AuthenticationProvider.d.ts +22 -0
- package/icc-x-api/auth/AuthenticationProvider.js +41 -0
- package/icc-x-api/auth/AuthenticationProvider.js.map +1 -0
- package/icc-x-api/auth/BasicAuthService.d.ts +12 -0
- package/icc-x-api/auth/BasicAuthService.js +27 -0
- package/icc-x-api/auth/BasicAuthService.js.map +1 -0
- package/icc-x-api/auth/EnsembleAuthService.d.ts +17 -0
- package/icc-x-api/auth/EnsembleAuthService.js +60 -0
- package/icc-x-api/auth/EnsembleAuthService.js.map +1 -0
- package/icc-x-api/auth/JwtAuthService.d.ts +19 -0
- package/icc-x-api/auth/JwtAuthService.js +97 -0
- package/icc-x-api/auth/JwtAuthService.js.map +1 -0
- package/icc-x-api/auth/NoAuthService.d.ts +8 -0
- package/icc-x-api/auth/NoAuthService.js +30 -0
- package/icc-x-api/auth/NoAuthService.js.map +1 -0
- package/icc-x-api/icc-accesslog-x-api.d.ts +2 -1
- package/icc-x-api/icc-accesslog-x-api.js +2 -2
- package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
- package/icc-x-api/icc-bekmehr-x-api.d.ts +2 -1
- package/icc-x-api/icc-bekmehr-x-api.js +2 -2
- package/icc-x-api/icc-bekmehr-x-api.js.map +1 -1
- package/icc-x-api/icc-calendar-item-x-api.d.ts +2 -1
- package/icc-x-api/icc-calendar-item-x-api.js +2 -2
- package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
- package/icc-x-api/icc-classification-x-api.d.ts +2 -1
- package/icc-x-api/icc-classification-x-api.js +2 -2
- package/icc-x-api/icc-classification-x-api.js.map +1 -1
- package/icc-x-api/icc-code-x-api.d.ts +2 -1
- package/icc-x-api/icc-code-x-api.js +2 -2
- package/icc-x-api/icc-code-x-api.js.map +1 -1
- package/icc-x-api/icc-contact-x-api.d.ts +2 -1
- package/icc-x-api/icc-contact-x-api.js +2 -2
- package/icc-x-api/icc-contact-x-api.js.map +1 -1
- package/icc-x-api/icc-crypto-x-api.d.ts +1 -1
- package/icc-x-api/icc-crypto-x-api.js +10 -12
- package/icc-x-api/icc-crypto-x-api.js.map +1 -1
- package/icc-x-api/icc-doctemplate-x-api.d.ts +3 -1
- package/icc-x-api/icc-doctemplate-x-api.js +4 -3
- package/icc-x-api/icc-doctemplate-x-api.js.map +1 -1
- package/icc-x-api/icc-document-x-api.d.ts +3 -1
- package/icc-x-api/icc-document-x-api.js +4 -3
- package/icc-x-api/icc-document-x-api.js.map +1 -1
- package/icc-x-api/icc-form-x-api.d.ts +2 -1
- package/icc-x-api/icc-form-x-api.js +2 -2
- package/icc-x-api/icc-form-x-api.js.map +1 -1
- package/icc-x-api/icc-hcparty-x-api.d.ts +2 -1
- package/icc-x-api/icc-hcparty-x-api.js +2 -2
- package/icc-x-api/icc-hcparty-x-api.js.map +1 -1
- package/icc-x-api/icc-helement-x-api.d.ts +2 -1
- package/icc-x-api/icc-helement-x-api.js +2 -2
- package/icc-x-api/icc-helement-x-api.js.map +1 -1
- package/icc-x-api/icc-invoice-x-api.d.ts +2 -1
- package/icc-x-api/icc-invoice-x-api.js +2 -2
- package/icc-x-api/icc-invoice-x-api.js.map +1 -1
- package/icc-x-api/icc-maintenance-task-x-api.d.ts +2 -1
- package/icc-x-api/icc-maintenance-task-x-api.js +2 -2
- package/icc-x-api/icc-maintenance-task-x-api.js.map +1 -1
- package/icc-x-api/icc-message-x-api.d.ts +2 -1
- package/icc-x-api/icc-message-x-api.js +2 -2
- package/icc-x-api/icc-message-x-api.js.map +1 -1
- package/icc-x-api/icc-patient-x-api.d.ts +2 -1
- package/icc-x-api/icc-patient-x-api.js +2 -2
- package/icc-x-api/icc-patient-x-api.js.map +1 -1
- package/icc-x-api/icc-receipt-x-api.d.ts +2 -1
- package/icc-x-api/icc-receipt-x-api.js +2 -2
- package/icc-x-api/icc-receipt-x-api.js.map +1 -1
- package/icc-x-api/icc-time-table-x-api.d.ts +2 -1
- package/icc-x-api/icc-time-table-x-api.js +2 -2
- package/icc-x-api/icc-time-table-x-api.js.map +1 -1
- package/icc-x-api/icc-user-x-api.d.ts +2 -1
- package/icc-x-api/icc-user-x-api.js +2 -2
- package/icc-x-api/icc-user-x-api.js.map +1 -1
- package/icc-x-api/index.d.ts +0 -4
- package/icc-x-api/index.js +31 -34
- package/icc-x-api/index.js.map +1 -1
- package/icc-x-api/storage/KeyStorageImpl.js +3 -1
- package/icc-x-api/storage/KeyStorageImpl.js.map +1 -1
- package/icc-x-api/storage/LocalStorageImpl.d.ts +1 -1
- package/icc-x-api/storage/LocalStorageImpl.js +10 -2
- package/icc-x-api/storage/LocalStorageImpl.js.map +1 -1
- package/icc-x-api/storage/StorageFacade.d.ts +1 -1
- package/icc-x-api/storage/StorageFacade.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icc-time-table-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-time-table-x-api.ts"],"names":[],"mappings":";;;AAAA,4CAA2C;AAE3C,4BAA2B;AAC3B,wCAA4C;
|
|
1
|
+
{"version":3,"file":"icc-time-table-x-api.js","sourceRoot":"","sources":["../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CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAA;YAE1D,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CACvC;YAAA,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,CAC3H,CAAC,UAAU,EAAE,EAAE,CACb,CAAC,OAAO,GAAG,OAAO;iBACf,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAChB,IAAI,CAAC,MAAM,CAAC,wCAAwC,CAClD,OAAO,EACP,IAAI,EACJ,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,CAAC,EACtC,UAAU,EACV,QAAQ,CAAC,QAAQ,CAClB,CACF;iBACA,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,WAAW,EAAE,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CACvF,CAAA;YACD,OAAO,OAAO,CAAA;QAChB,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AA1DD,4CA0DC","sourcesContent":["import * as i18n from './rsrc/contact.i18n'\n\nimport * as _ from 'lodash'\nimport { IccTimeTableApi } from '../icc-api'\nimport { User } from '../icc-api/model/User'\nimport { TimeTable } from '../icc-api/model/TimeTable'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport { AuthenticationProvider } from './auth/AuthenticationProvider'\n\nexport class IccTimeTableXApi extends IccTimeTableApi {\n i18n: any = i18n\n crypto: IccCryptoXApi\n dataOwnerApi: IccDataOwnerXApi\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n crypto: IccCryptoXApi,\n dataOwnerApi: IccDataOwnerXApi,\n authenticationProvider: AuthenticationProvider,\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch\n ) {\n super(host, headers, authenticationProvider, fetchImpl)\n this.crypto = crypto\n this.dataOwnerApi = dataOwnerApi\n }\n\n newInstance(user: User, tt: TimeTable) {\n const timeTable = _.extend(\n {\n id: this.crypto.randomUuid(),\n _type: 'org.taktik.icure.entities.TimeTable',\n created: new Date().getTime(),\n modified: new Date().getTime(),\n responsible: this.dataOwnerApi.getDataOwnerOf(user),\n author: user.id,\n codes: [],\n tags: [],\n },\n tt || {}\n )\n\n return this.crypto.initObjectDelegations(timeTable, null, this.dataOwnerApi.getDataOwnerOf(user), null).then((initData) => {\n _.extend(timeTable, { delegations: initData.delegations })\n\n let promise = Promise.resolve(timeTable)\n ;(user.autoDelegations ? (user.autoDelegations.all || []).concat(user.autoDelegations.medicalInformation || []) : []).forEach(\n (delegateId) =>\n (promise = promise\n .then((patient) =>\n this.crypto.extendedDelegationsAndCryptedForeignKeys(\n patient,\n null,\n this.dataOwnerApi.getDataOwnerOf(user),\n delegateId,\n initData.secretId\n )\n )\n .then((extraData) => _.extend(timeTable, { delegations: extraData.delegations })))\n )\n return promise\n })\n }\n}\n"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { IccUserApi } from '../icc-api/api/IccUserApi';
|
|
2
|
+
import { AuthenticationProvider } from './auth/AuthenticationProvider';
|
|
2
3
|
export declare class IccUserXApi extends IccUserApi {
|
|
3
4
|
fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
|
|
4
5
|
constructor(host: string, headers: {
|
|
5
6
|
[key: string]: string;
|
|
6
|
-
}, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
|
|
7
|
+
}, authenticationProvider: AuthenticationProvider, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
|
|
7
8
|
}
|
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.IccUserXApi = void 0;
|
|
4
4
|
const IccUserApi_1 = require("../icc-api/api/IccUserApi");
|
|
5
5
|
class IccUserXApi extends IccUserApi_1.IccUserApi {
|
|
6
|
-
constructor(host, headers, fetchImpl = typeof window !== 'undefined'
|
|
6
|
+
constructor(host, headers, authenticationProvider, fetchImpl = typeof window !== 'undefined'
|
|
7
7
|
? window.fetch
|
|
8
8
|
: typeof self !== 'undefined'
|
|
9
9
|
? self.fetch
|
|
10
10
|
: fetch) {
|
|
11
|
-
super(host, headers, fetchImpl);
|
|
11
|
+
super(host, headers, authenticationProvider, fetchImpl);
|
|
12
12
|
this.fetchImpl = fetchImpl;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icc-user-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-user-x-api.ts"],"names":[],"mappings":";;;AAAA,0DAAsD;
|
|
1
|
+
{"version":3,"file":"icc-user-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-user-x-api.ts"],"names":[],"mappings":";;;AAAA,0DAAsD;AAGtD,MAAa,WAAY,SAAQ,uBAAU;IAGzC,YACE,IAAY,EACZ,OAAkC,EAClC,sBAA8C,EAC9C,YAA2E,OAAO,MAAM,KAAK,WAAW;QACtG,CAAC,CAAC,MAAM,CAAC,KAAK;QACd,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW;YAC7B,CAAC,CAAC,IAAI,CAAC,KAAK;YACZ,CAAC,CAAC,KAAK;QAET,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,sBAAsB,EAAE,SAAS,CAAC,CAAA;QACvD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;CACF;AAhBD,kCAgBC","sourcesContent":["import { IccUserApi } from '../icc-api/api/IccUserApi'\nimport { AuthenticationProvider } from './auth/AuthenticationProvider'\n\nexport class IccUserXApi extends IccUserApi {\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n authenticationProvider: AuthenticationProvider,\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch\n ) {\n super(host, headers, authenticationProvider, fetchImpl)\n this.fetchImpl = fetchImpl\n }\n}\n"]}
|
package/icc-x-api/index.d.ts
CHANGED
|
@@ -43,10 +43,6 @@ export { KeyStorageFacade } from './storage/KeyStorageFacade';
|
|
|
43
43
|
export { LocalStorageImpl } from './storage/LocalStorageImpl';
|
|
44
44
|
export { StorageFacade } from './storage/StorageFacade';
|
|
45
45
|
export { KeyStorageImpl } from './storage/KeyStorageImpl';
|
|
46
|
-
export declare const apiHeaders: (username: string, password: string, forceBasic?: boolean) => {
|
|
47
|
-
Authorization: string;
|
|
48
|
-
'force-authentication': string;
|
|
49
|
-
};
|
|
50
46
|
export interface Apis {
|
|
51
47
|
authApi: IccAuthApi;
|
|
52
48
|
codeApi: IccCodeXApi;
|
package/icc-x-api/index.js
CHANGED
|
@@ -23,7 +23,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Api = exports.
|
|
26
|
+
exports.Api = exports.KeyStorageImpl = exports.LocalStorageImpl = void 0;
|
|
27
27
|
const icc_api_1 = require("../icc-api");
|
|
28
28
|
const icc_user_x_api_1 = require("./icc-user-x-api");
|
|
29
29
|
const icc_crypto_x_api_1 = require("./icc-crypto-x-api");
|
|
@@ -47,6 +47,7 @@ const icc_data_owner_x_api_1 = require("./icc-data-owner-x-api");
|
|
|
47
47
|
const utils_1 = require("./utils");
|
|
48
48
|
const LocalStorageImpl_1 = require("./storage/LocalStorageImpl");
|
|
49
49
|
const KeyStorageImpl_1 = require("./storage/KeyStorageImpl");
|
|
50
|
+
const AuthenticationProvider_1 = require("./auth/AuthenticationProvider");
|
|
50
51
|
__exportStar(require("./icc-accesslog-x-api"), exports);
|
|
51
52
|
__exportStar(require("./icc-bekmehr-x-api"), exports);
|
|
52
53
|
__exportStar(require("./icc-calendar-item-x-api"), exports);
|
|
@@ -70,47 +71,43 @@ var LocalStorageImpl_2 = require("./storage/LocalStorageImpl");
|
|
|
70
71
|
Object.defineProperty(exports, "LocalStorageImpl", { enumerable: true, get: function () { return LocalStorageImpl_2.LocalStorageImpl; } });
|
|
71
72
|
var KeyStorageImpl_2 = require("./storage/KeyStorageImpl");
|
|
72
73
|
Object.defineProperty(exports, "KeyStorageImpl", { enumerable: true, get: function () { return KeyStorageImpl_2.KeyStorageImpl; } });
|
|
73
|
-
const apiHeaders = function (username, password, forceBasic = false) {
|
|
74
|
-
return {
|
|
75
|
-
Authorization: `Basic ${typeof btoa !== 'undefined' ? btoa(`${username}:${password}`) : Buffer.from(`${username}:${password}`).toString('base64')}`,
|
|
76
|
-
'force-authentication': forceBasic ? 'true' : 'false',
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
exports.apiHeaders = apiHeaders;
|
|
80
74
|
const Api = function (host, username, password, crypto = typeof window !== 'undefined' ? window.crypto : typeof self !== 'undefined' ? self.crypto : {}, fetchImpl = typeof window !== 'undefined'
|
|
81
75
|
? window.fetch
|
|
82
76
|
: typeof self !== 'undefined'
|
|
83
77
|
? self.fetch
|
|
84
|
-
: fetch, forceBasic = false, autoLogin =
|
|
78
|
+
: fetch, forceBasic = false, autoLogin = false, storage, keyStorage) {
|
|
85
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
86
80
|
const _storage = storage || new LocalStorageImpl_1.LocalStorageImpl();
|
|
87
81
|
const _keyStorage = keyStorage || new KeyStorageImpl_1.KeyStorageImpl(_storage);
|
|
88
|
-
const headers =
|
|
82
|
+
const headers = {};
|
|
89
83
|
const authApi = new icc_api_1.IccAuthApi(host, headers, fetchImpl);
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
const
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
const
|
|
98
|
-
const
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
const
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
const
|
|
105
|
-
const
|
|
106
|
-
const
|
|
107
|
-
const
|
|
108
|
-
const
|
|
109
|
-
const
|
|
110
|
-
const
|
|
111
|
-
const
|
|
112
|
-
const
|
|
113
|
-
const
|
|
84
|
+
const authenticationProvider = forceBasic
|
|
85
|
+
? new AuthenticationProvider_1.BasicAuthenticationProvider(username, password)
|
|
86
|
+
: new AuthenticationProvider_1.EnsembleAuthenticationProvider(authApi, username, password);
|
|
87
|
+
const codeApi = new icc_code_x_api_1.IccCodeXApi(host, headers, authenticationProvider, fetchImpl);
|
|
88
|
+
const entityReferenceApi = new icc_api_1.IccEntityrefApi(host, headers, authenticationProvider, fetchImpl);
|
|
89
|
+
const userApi = new icc_user_x_api_1.IccUserXApi(host, headers, authenticationProvider, fetchImpl);
|
|
90
|
+
const permissionApi = new icc_api_1.IccPermissionApi(host, headers, authenticationProvider, fetchImpl);
|
|
91
|
+
const healthcarePartyApi = new icc_hcparty_x_api_1.IccHcpartyXApi(host, headers, authenticationProvider, fetchImpl);
|
|
92
|
+
const deviceApi = new IccDeviceApi_1.IccDeviceApi(host, headers, authenticationProvider, fetchImpl);
|
|
93
|
+
const cryptoApi = new icc_crypto_x_api_1.IccCryptoXApi(host, headers, healthcarePartyApi, new icc_api_1.IccPatientApi(host, headers, authenticationProvider, fetchImpl), deviceApi, crypto, _storage, _keyStorage);
|
|
94
|
+
const dataOwnerApi = new icc_data_owner_x_api_1.IccDataOwnerXApi(cryptoApi, new icc_api_1.IccPatientApi(host, headers, authenticationProvider, fetchImpl));
|
|
95
|
+
const accessLogApi = new icc_accesslog_x_api_1.IccAccesslogXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl);
|
|
96
|
+
const agendaApi = new icc_api_1.IccAgendaApi(host, headers, authenticationProvider, fetchImpl);
|
|
97
|
+
const contactApi = new icc_contact_x_api_1.IccContactXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl);
|
|
98
|
+
const formApi = new icc_form_x_api_1.IccFormXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl);
|
|
99
|
+
const groupApi = new icc_api_1.IccGroupApi(host, headers, authenticationProvider);
|
|
100
|
+
const invoiceApi = new icc_invoice_x_api_1.IccInvoiceXApi(host, headers, cryptoApi, entityReferenceApi, dataOwnerApi, authenticationProvider, fetchImpl);
|
|
101
|
+
const insuranceApi = new icc_api_1.IccInsuranceApi(host, headers, authenticationProvider, fetchImpl);
|
|
102
|
+
const documentApi = new icc_document_x_api_1.IccDocumentXApi(host, headers, cryptoApi, authApi, dataOwnerApi, authenticationProvider, fetchImpl);
|
|
103
|
+
const healthcareElementApi = new icc_helement_x_api_1.IccHelementXApi(host, headers, cryptoApi, dataOwnerApi, ['descr', 'note'], authenticationProvider, fetchImpl);
|
|
104
|
+
const classificationApi = new icc_classification_x_api_1.IccClassificationXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl);
|
|
105
|
+
const calendarItemApi = new icc_calendar_item_x_api_1.IccCalendarItemXApi(host, headers, cryptoApi, dataOwnerApi, ['details', 'title', 'patientId'], authenticationProvider, fetchImpl);
|
|
106
|
+
const receiptApi = new icc_receipt_x_api_1.IccReceiptXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl);
|
|
107
|
+
const timetableApi = new icc_time_table_x_api_1.IccTimeTableXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl);
|
|
108
|
+
const patientApi = new icc_patient_x_api_1.IccPatientXApi(host, headers, cryptoApi, contactApi, formApi, healthcareElementApi, invoiceApi, documentApi, healthcarePartyApi, classificationApi, dataOwnerApi, calendarItemApi, ['note'], authenticationProvider, fetchImpl);
|
|
109
|
+
const messageApi = new icc_message_x_api_1.IccMessageXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl);
|
|
110
|
+
const maintenanceTaskApi = new icc_maintenance_task_x_api_1.IccMaintenanceTaskXApi(host, headers, cryptoApi, healthcarePartyApi, dataOwnerApi, ['properties'], authenticationProvider, fetchImpl);
|
|
114
111
|
if (autoLogin) {
|
|
115
112
|
if (username != undefined && password != undefined) {
|
|
116
113
|
try {
|
package/icc-x-api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../icc-x-api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAqI;AACrI,qDAA8C;AAC9C,yDAAkD;AAClD,2DAAoD;AACpD,2DAAoD;AACpD,6DAAsD;AACtD,2DAAoD;AACpD,qDAA8C;AAC9C,6DAAsD;AACtD,yEAAkE;AAClE,uEAA+D;AAC/D,2DAAoD;AACpD,2DAAoD;AACpD,2DAAoD;AACpD,+DAAwD;AACxD,iEAAyD;AACzD,8DAA0D;AAC1D,qDAA8C;AAC9C,6EAAqE;AACrE,iEAAyD;AACzD,mCAA+B;AAG/B,iEAA6D;AAC7D,6DAAyD;AAEzD,wDAAqC;AACrC,sDAAmC;AACnC,4DAAyC;AACzC,6DAA0C;AAC1C,mDAAgC;AAChC,sDAAmC;AACnC,qDAAkC;AAClC,0DAAuC;AACvC,uDAAoC;AACpC,mDAAgC;AAChC,sDAAmC;AACnC,uDAAoC;AACpC,sDAAmC;AACnC,sDAAmC;AACnC,sDAAmC;AACnC,mDAAgC;AAChC,yDAAsC;AACtC,sDAAmC;AACnC,0CAAuB;AAEvB,+DAA6D;AAApD,oHAAA,gBAAgB,OAAA;AAEzB,2DAAyD;AA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suranceApi, IccPatientApi, IccPermissionApi } from '../icc-api'\nimport { IccUserXApi } from './icc-user-x-api'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\nimport { IccContactXApi } from './icc-contact-x-api'\nimport { IccInvoiceXApi } from './icc-invoice-x-api'\nimport { IccDocumentXApi } from './icc-document-x-api'\nimport { IccHcpartyXApi } from './icc-hcparty-x-api'\nimport { IccFormXApi } from './icc-form-x-api'\nimport { IccHelementXApi } from './icc-helement-x-api'\nimport { IccClassificationXApi } from './icc-classification-x-api'\nimport { IccCalendarItemXApi } from './icc-calendar-item-x-api'\nimport { IccPatientXApi } from './icc-patient-x-api'\nimport { IccMessageXApi } from './icc-message-x-api'\nimport { IccReceiptXApi } from './icc-receipt-x-api'\nimport { IccAccesslogXApi } from './icc-accesslog-x-api'\nimport { IccTimeTableXApi } from './icc-time-table-x-api'\nimport { IccDeviceApi } from '../icc-api/api/IccDeviceApi'\nimport { IccCodeXApi } from './icc-code-x-api'\nimport { IccMaintenanceTaskXApi } from './icc-maintenance-task-x-api'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport { retry } from './utils'\nimport { StorageFacade } from './storage/StorageFacade'\nimport { KeyStorageFacade } from './storage/KeyStorageFacade'\nimport { LocalStorageImpl } from './storage/LocalStorageImpl'\nimport { KeyStorageImpl } from './storage/KeyStorageImpl'\n\nexport * from './icc-accesslog-x-api'\nexport * from './icc-bekmehr-x-api'\nexport * from './icc-calendar-item-x-api'\nexport * from './icc-classification-x-api'\nexport * from './icc-code-x-api'\nexport * from './icc-contact-x-api'\nexport * from './icc-crypto-x-api'\nexport * from './icc-doctemplate-x-api'\nexport * from './icc-document-x-api'\nexport * from './icc-form-x-api'\nexport * from './icc-hcparty-x-api'\nexport * from './icc-helement-x-api'\nexport * from './icc-invoice-x-api'\nexport * from './icc-message-x-api'\nexport * from './icc-patient-x-api'\nexport * from './icc-user-x-api'\nexport * from './icc-time-table-x-api'\nexport * from './icc-receipt-x-api'\nexport * from './utils'\nexport { KeyStorageFacade } from './storage/KeyStorageFacade'\nexport { LocalStorageImpl } from './storage/LocalStorageImpl'\nexport { StorageFacade } from './storage/StorageFacade'\nexport { KeyStorageImpl } from './storage/KeyStorageImpl'\n\nexport const apiHeaders = function (username: string, password: string, forceBasic = false) {\n return {\n Authorization: `Basic ${\n typeof btoa !== 'undefined' ? btoa(`${username}:${password}`) : Buffer.from(`${username}:${password}`).toString('base64')\n }`,\n 'force-authentication': forceBasic ? 'true' : 'false',\n }\n}\n\nexport interface Apis {\n authApi: IccAuthApi\n codeApi: IccCodeXApi\n entityReferenceApi: IccEntityrefApi\n userApi: IccUserXApi\n permissionApi: IccPermissionApi\n healthcarePartyApi: IccHcpartyXApi\n deviceApi: IccDeviceApi\n cryptoApi: IccCryptoXApi\n accessLogApi: IccAccesslogXApi\n agendaApi: IccAgendaApi\n contactApi: IccContactXApi\n formApi: IccFormXApi\n groupApi: IccGroupApi\n invoiceApi: IccInvoiceXApi\n insuranceApi: IccInsuranceApi\n documentApi: IccDocumentXApi\n healthcareElementApi: IccHelementXApi\n classificationApi: IccClassificationXApi\n calendarItemApi: IccCalendarItemXApi\n receiptApi: IccReceiptXApi\n timetableApi: IccTimeTableXApi\n patientApi: IccPatientXApi\n messageApi: IccMessageXApi\n maintenanceTaskApi: IccMaintenanceTaskXApi\n dataOwnerApi: IccDataOwnerXApi\n}\n\nexport const Api = async function (\n host: string,\n username: string,\n password: string,\n crypto: Crypto = typeof window !== 'undefined' ? window.crypto : typeof self !== 'undefined' ? self.crypto : ({} as Crypto),\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch,\n forceBasic = false,\n autoLogin = true,\n storage?: StorageFacade<string>,\n keyStorage?: KeyStorageFacade\n): Promise<Apis> {\n const _storage = storage || new LocalStorageImpl()\n const _keyStorage = keyStorage || new KeyStorageImpl(_storage)\n\n const headers = apiHeaders(username, password, forceBasic)\n const authApi = new IccAuthApi(host, headers, fetchImpl)\n const codeApi = new IccCodeXApi(host, headers, fetchImpl)\n const entityReferenceApi = new IccEntityrefApi(host, headers, fetchImpl)\n const userApi = new IccUserXApi(host, headers, fetchImpl)\n const permissionApi = new IccPermissionApi(host, headers, fetchImpl)\n const healthcarePartyApi = new IccHcpartyXApi(host, headers, fetchImpl)\n const deviceApi = new IccDeviceApi(host, headers, fetchImpl)\n const cryptoApi = new IccCryptoXApi(\n host,\n headers,\n healthcarePartyApi,\n new IccPatientApi(host, headers, fetchImpl),\n deviceApi,\n crypto,\n _storage,\n _keyStorage\n )\n const dataOwnerApi = new IccDataOwnerXApi(cryptoApi, new IccPatientApi(host, headers, fetchImpl))\n const accessLogApi = new IccAccesslogXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const agendaApi = new IccAgendaApi(host, headers, fetchImpl)\n const contactApi = new IccContactXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const formApi = new IccFormXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const groupApi = new IccGroupApi(host, headers)\n const invoiceApi = new IccInvoiceXApi(host, headers, cryptoApi, entityReferenceApi, dataOwnerApi, fetchImpl)\n const insuranceApi = new IccInsuranceApi(host, headers, fetchImpl)\n const documentApi = new IccDocumentXApi(host, headers, cryptoApi, authApi, dataOwnerApi, fetchImpl)\n const healthcareElementApi = new IccHelementXApi(host, headers, cryptoApi, dataOwnerApi, ['descr', 'note'], fetchImpl)\n const classificationApi = new IccClassificationXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const calendarItemApi = new IccCalendarItemXApi(host, headers, cryptoApi, dataOwnerApi, ['details', 'title', 'patientId'], fetchImpl)\n const receiptApi = new IccReceiptXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const timetableApi = new IccTimeTableXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const patientApi = new IccPatientXApi(\n host,\n headers,\n cryptoApi,\n contactApi,\n formApi,\n healthcareElementApi,\n invoiceApi,\n documentApi,\n healthcarePartyApi,\n classificationApi,\n dataOwnerApi,\n calendarItemApi,\n ['note'],\n fetchImpl\n )\n const messageApi = new IccMessageXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const maintenanceTaskApi = new IccMaintenanceTaskXApi(host, headers, cryptoApi, healthcarePartyApi, dataOwnerApi, ['properties'], fetchImpl)\n\n if (autoLogin) {\n if (username != undefined && password != undefined) {\n try {\n await retry(() => authApi.login({ username, password }), 3, 1000, 1.5)\n } catch (e) {\n console.error('Incorrect user and password used to instantiate Api, or network problem', e)\n }\n }\n } else {\n console.info('Auto login skipped')\n }\n\n return {\n cryptoApi,\n authApi,\n codeApi,\n userApi,\n permissionApi,\n patientApi,\n healthcarePartyApi,\n deviceApi,\n accessLogApi,\n contactApi,\n healthcareElementApi,\n documentApi,\n formApi,\n invoiceApi,\n insuranceApi,\n messageApi,\n entityReferenceApi,\n receiptApi,\n agendaApi,\n calendarItemApi,\n classificationApi,\n timetableApi,\n groupApi,\n maintenanceTaskApi,\n dataOwnerApi,\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../icc-x-api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAqI;AACrI,qDAA8C;AAC9C,yDAAkD;AAClD,2DAAoD;AACpD,2DAAoD;AACpD,6DAAsD;AACtD,2DAAoD;AACpD,qDAA8C;AAC9C,6DAAsD;AACtD,yEAAkE;AAClE,uEAA+D;AAC/D,2DAAoD;AACpD,2DAAoD;AACpD,2DAAoD;AACpD,+DAAwD;AACxD,iEAAyD;AACzD,8DAA0D;AAC1D,qDAA8C;AAC9C,6EAAqE;AACrE,iEAAyD;AACzD,mCAA+B;AAG/B,iEAA6D;AAC7D,6DAAyD;AACzD,0EAA2G;AAE3G,wDAAqC;AACrC,sDAAmC;AACnC,4DAAyC;AACzC,6DAA0C;AAC1C,mDAAgC;AAChC,s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X,OAAO;YACP,UAAU;YACV,YAAY;YACZ,UAAU;YACV,kBAAkB;YAClB,UAAU;YACV,SAAS;YACT,eAAe;YACf,iBAAiB;YACjB,YAAY;YACZ,QAAQ;YACR,kBAAkB;YAClB,YAAY;SACb,CAAA;IACH,CAAC;CAAA,CAAA;AAlIY,QAAA,GAAG,OAkIf","sourcesContent":["import { IccAgendaApi, IccAuthApi, IccEntityrefApi, IccGroupApi, IccInsuranceApi, IccPatientApi, IccPermissionApi } from '../icc-api'\nimport { IccUserXApi } from './icc-user-x-api'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\nimport { IccContactXApi } from './icc-contact-x-api'\nimport { IccInvoiceXApi } from './icc-invoice-x-api'\nimport { IccDocumentXApi } from './icc-document-x-api'\nimport { IccHcpartyXApi } from './icc-hcparty-x-api'\nimport { IccFormXApi } from './icc-form-x-api'\nimport { IccHelementXApi } from './icc-helement-x-api'\nimport { IccClassificationXApi } from './icc-classification-x-api'\nimport { IccCalendarItemXApi } from './icc-calendar-item-x-api'\nimport { IccPatientXApi } from './icc-patient-x-api'\nimport { IccMessageXApi } from './icc-message-x-api'\nimport { IccReceiptXApi } from './icc-receipt-x-api'\nimport { IccAccesslogXApi } from './icc-accesslog-x-api'\nimport { IccTimeTableXApi } from './icc-time-table-x-api'\nimport { IccDeviceApi } from '../icc-api/api/IccDeviceApi'\nimport { IccCodeXApi } from './icc-code-x-api'\nimport { IccMaintenanceTaskXApi } from './icc-maintenance-task-x-api'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport { retry } from './utils'\nimport { StorageFacade } from './storage/StorageFacade'\nimport { KeyStorageFacade } from './storage/KeyStorageFacade'\nimport { LocalStorageImpl } from './storage/LocalStorageImpl'\nimport { KeyStorageImpl } from './storage/KeyStorageImpl'\nimport { BasicAuthenticationProvider, EnsembleAuthenticationProvider } from './auth/AuthenticationProvider'\n\nexport * from './icc-accesslog-x-api'\nexport * from './icc-bekmehr-x-api'\nexport * from './icc-calendar-item-x-api'\nexport * from './icc-classification-x-api'\nexport * from './icc-code-x-api'\nexport * from './icc-contact-x-api'\nexport * from './icc-crypto-x-api'\nexport * from './icc-doctemplate-x-api'\nexport * from './icc-document-x-api'\nexport * from './icc-form-x-api'\nexport * from './icc-hcparty-x-api'\nexport * from './icc-helement-x-api'\nexport * from './icc-invoice-x-api'\nexport * from './icc-message-x-api'\nexport * from './icc-patient-x-api'\nexport * from './icc-user-x-api'\nexport * from './icc-time-table-x-api'\nexport * from './icc-receipt-x-api'\nexport * from './utils'\nexport { KeyStorageFacade } from './storage/KeyStorageFacade'\nexport { LocalStorageImpl } from './storage/LocalStorageImpl'\nexport { StorageFacade } from './storage/StorageFacade'\nexport { KeyStorageImpl } from './storage/KeyStorageImpl'\n\nexport interface Apis {\n authApi: IccAuthApi\n codeApi: IccCodeXApi\n entityReferenceApi: IccEntityrefApi\n userApi: IccUserXApi\n permissionApi: IccPermissionApi\n healthcarePartyApi: IccHcpartyXApi\n deviceApi: IccDeviceApi\n cryptoApi: IccCryptoXApi\n accessLogApi: IccAccesslogXApi\n agendaApi: IccAgendaApi\n contactApi: IccContactXApi\n formApi: IccFormXApi\n groupApi: IccGroupApi\n invoiceApi: IccInvoiceXApi\n insuranceApi: IccInsuranceApi\n documentApi: IccDocumentXApi\n healthcareElementApi: IccHelementXApi\n classificationApi: IccClassificationXApi\n calendarItemApi: IccCalendarItemXApi\n receiptApi: IccReceiptXApi\n timetableApi: IccTimeTableXApi\n patientApi: IccPatientXApi\n messageApi: IccMessageXApi\n maintenanceTaskApi: IccMaintenanceTaskXApi\n dataOwnerApi: IccDataOwnerXApi\n}\n\nexport const Api = async function (\n host: string,\n username: string,\n password: string,\n crypto: Crypto = typeof window !== 'undefined' ? window.crypto : typeof self !== 'undefined' ? self.crypto : ({} as Crypto),\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch,\n forceBasic = false,\n autoLogin = false,\n storage?: StorageFacade<string>,\n keyStorage?: KeyStorageFacade\n): Promise<Apis> {\n const _storage = storage || new LocalStorageImpl()\n const _keyStorage = keyStorage || new KeyStorageImpl(_storage)\n\n const headers = {}\n const authApi = new IccAuthApi(host, headers, fetchImpl)\n const authenticationProvider = forceBasic\n ? new BasicAuthenticationProvider(username, password)\n : new EnsembleAuthenticationProvider(authApi, username, password)\n\n const codeApi = new IccCodeXApi(host, headers, authenticationProvider, fetchImpl)\n const entityReferenceApi = new IccEntityrefApi(host, headers, authenticationProvider, fetchImpl)\n const userApi = new IccUserXApi(host, headers, authenticationProvider, fetchImpl)\n const permissionApi = new IccPermissionApi(host, headers, authenticationProvider, fetchImpl)\n const healthcarePartyApi = new IccHcpartyXApi(host, headers, authenticationProvider, fetchImpl)\n const deviceApi = new IccDeviceApi(host, headers, authenticationProvider, fetchImpl)\n const cryptoApi = new IccCryptoXApi(\n host,\n headers,\n healthcarePartyApi,\n new IccPatientApi(host, headers, authenticationProvider, fetchImpl),\n deviceApi,\n crypto,\n _storage,\n _keyStorage\n )\n const dataOwnerApi = new IccDataOwnerXApi(cryptoApi, new IccPatientApi(host, headers, authenticationProvider, fetchImpl))\n const accessLogApi = new IccAccesslogXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl)\n const agendaApi = new IccAgendaApi(host, headers, authenticationProvider, fetchImpl)\n const contactApi = new IccContactXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl)\n const formApi = new IccFormXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl)\n const groupApi = new IccGroupApi(host, headers, authenticationProvider)\n const invoiceApi = new IccInvoiceXApi(host, headers, cryptoApi, entityReferenceApi, dataOwnerApi, authenticationProvider, fetchImpl)\n const insuranceApi = new IccInsuranceApi(host, headers, authenticationProvider, fetchImpl)\n const documentApi = new IccDocumentXApi(host, headers, cryptoApi, authApi, dataOwnerApi, authenticationProvider, fetchImpl)\n const healthcareElementApi = new IccHelementXApi(host, headers, cryptoApi, dataOwnerApi, ['descr', 'note'], authenticationProvider, fetchImpl)\n const classificationApi = new IccClassificationXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl)\n const calendarItemApi = new IccCalendarItemXApi(\n host,\n headers,\n cryptoApi,\n dataOwnerApi,\n ['details', 'title', 'patientId'],\n authenticationProvider,\n fetchImpl\n )\n const receiptApi = new IccReceiptXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl)\n const timetableApi = new IccTimeTableXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl)\n const patientApi = new IccPatientXApi(\n host,\n headers,\n cryptoApi,\n contactApi,\n formApi,\n healthcareElementApi,\n invoiceApi,\n documentApi,\n healthcarePartyApi,\n classificationApi,\n dataOwnerApi,\n calendarItemApi,\n ['note'],\n authenticationProvider,\n fetchImpl\n )\n const messageApi = new IccMessageXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl)\n const maintenanceTaskApi = new IccMaintenanceTaskXApi(\n host,\n headers,\n cryptoApi,\n healthcarePartyApi,\n dataOwnerApi,\n ['properties'],\n authenticationProvider,\n fetchImpl\n )\n\n if (autoLogin) {\n if (username != undefined && password != undefined) {\n try {\n await retry(() => authApi.login({ username, password }), 3, 1000, 1.5)\n } catch (e) {\n console.error('Incorrect user and password used to instantiate Api, or network problem', e)\n }\n }\n } else {\n console.info('Auto login skipped')\n }\n\n return {\n cryptoApi,\n authApi,\n codeApi,\n userApi,\n permissionApi,\n patientApi,\n healthcarePartyApi,\n deviceApi,\n accessLogApi,\n contactApi,\n healthcareElementApi,\n documentApi,\n formApi,\n invoiceApi,\n insuranceApi,\n messageApi,\n entityReferenceApi,\n receiptApi,\n agendaApi,\n calendarItemApi,\n classificationApi,\n timetableApi,\n groupApi,\n maintenanceTaskApi,\n dataOwnerApi,\n }\n}\n"]}
|
|
@@ -15,7 +15,9 @@ class KeyStorageImpl {
|
|
|
15
15
|
this._storage = storage;
|
|
16
16
|
}
|
|
17
17
|
deleteKeypair(key) {
|
|
18
|
-
return this
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
return yield this._storage.removeItem(key);
|
|
20
|
+
});
|
|
19
21
|
}
|
|
20
22
|
getKeypair(key) {
|
|
21
23
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyStorageImpl.js","sourceRoot":"","sources":["../../../icc-x-api/storage/KeyStorageImpl.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,MAAa,cAAc;IAGzB,YAAY,OAA8B;QACxC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;IACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"KeyStorageImpl.js","sourceRoot":"","sources":["../../../icc-x-api/storage/KeyStorageImpl.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,MAAa,cAAc;IAGzB,YAAY,OAA8B;QACxC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;IACzB,CAAC;IAEK,aAAa,CAAC,GAAW;;YAC7B,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;QAC5C,CAAC;KAAA;IAEK,UAAU,CAAC,GAAW;;;YAC1B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAA,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,mCAAI,IAAI,CAAC,CAAA;YACtE,OAAO,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC;gBAChF,CAAC,CAAC;oBACE,SAAS,EAAE,OAAO,CAAC,SAAuB;oBAC1C,UAAU,EAAE,OAAO,CAAC,UAAwB;iBAC7C;gBACH,CAAC,CAAC,SAAS,CAAA;;KACd;IAEK,aAAa,CAAC,GAAW;;;YAC7B,OAAO,MAAA,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,0CAAE,UAAU,CAAA;;KAChD;IAEK,YAAY,CAAC,GAAW;;;YAC5B,OAAO,MAAA,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,0CAAE,SAAS,CAAA;;KAC/C;IAEK,YAAY,CAAC,GAAW,EAAE,OAA0D;;YACxF,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;QAClE,CAAC;KAAA;CACF;AAhCD,wCAgCC","sourcesContent":["import { StorageFacade } from './StorageFacade'\nimport { KeyStorageFacade } from './KeyStorageFacade'\n\nexport class KeyStorageImpl implements KeyStorageFacade {\n private readonly _storage: StorageFacade<string>\n\n constructor(storage: StorageFacade<string>) {\n this._storage = storage\n }\n\n async deleteKeypair(key: string): Promise<void> {\n return await this._storage.removeItem(key)\n }\n\n async getKeypair(key: string): Promise<{ publicKey: JsonWebKey; privateKey: JsonWebKey } | undefined> {\n const keyPair = JSON.parse((await this._storage.getItem(key)) ?? '{}')\n return keyPair.hasOwnProperty('publicKey') && keyPair.hasOwnProperty('privateKey')\n ? {\n publicKey: keyPair.publicKey as JsonWebKey,\n privateKey: keyPair.privateKey as JsonWebKey,\n }\n : undefined\n }\n\n async getPrivateKey(key: string): Promise<JsonWebKey | undefined> {\n return (await this.getKeypair(key))?.privateKey\n }\n\n async getPublicKey(key: string): Promise<JsonWebKey | undefined> {\n return (await this.getKeypair(key))?.publicKey\n }\n\n async storeKeyPair(key: string, keyPair: { publicKey: JsonWebKey; privateKey: JsonWebKey }): Promise<void> {\n return await this._storage.setItem(key, JSON.stringify(keyPair))\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StorageFacade } from './StorageFacade';
|
|
2
2
|
export declare class LocalStorageImpl implements StorageFacade<string> {
|
|
3
3
|
getItem(key: string): Promise<string | undefined>;
|
|
4
|
-
|
|
4
|
+
removeItem(key: string): Promise<void>;
|
|
5
5
|
setItem(key: string, valueToStore: string): Promise<void>;
|
|
6
6
|
}
|
|
@@ -14,11 +14,19 @@ class LocalStorageImpl {
|
|
|
14
14
|
getItem(key) {
|
|
15
15
|
var _a;
|
|
16
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
if (typeof Storage === 'undefined') {
|
|
18
|
+
console.error('Your browser does not support HTML5 Browser Local Storage !');
|
|
19
|
+
throw new Error('Your browser does not support HTML5 Browser Local Storage !');
|
|
20
|
+
}
|
|
17
21
|
return (_a = localStorage.getItem(key)) !== null && _a !== void 0 ? _a : undefined;
|
|
18
22
|
});
|
|
19
23
|
}
|
|
20
|
-
|
|
24
|
+
removeItem(key) {
|
|
21
25
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
if (typeof Storage === 'undefined') {
|
|
27
|
+
console.error('Your browser does not support HTML5 Browser Local Storage !');
|
|
28
|
+
throw new Error('Your browser does not support HTML5 Browser Local Storage !');
|
|
29
|
+
}
|
|
22
30
|
return localStorage.removeItem(key);
|
|
23
31
|
});
|
|
24
32
|
}
|
|
@@ -26,7 +34,7 @@ class LocalStorageImpl {
|
|
|
26
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
35
|
if (typeof Storage === 'undefined') {
|
|
28
36
|
console.error('Your browser does not support HTML5 Browser Local Storage !');
|
|
29
|
-
throw 'Your browser does not support HTML5 Browser Local Storage !';
|
|
37
|
+
throw new Error('Your browser does not support HTML5 Browser Local Storage !');
|
|
30
38
|
}
|
|
31
39
|
return localStorage.setItem(key, valueToStore);
|
|
32
40
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalStorageImpl.js","sourceRoot":"","sources":["../../../icc-x-api/storage/LocalStorageImpl.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,gBAAgB;IACrB,OAAO,CAAC,GAAW;;;YACvB,OAAO,MAAA,YAAY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CAAC;KAAA;CACF;AAxBD,4CAwBC","sourcesContent":["import { StorageFacade } from './StorageFacade'\n\nexport class LocalStorageImpl implements StorageFacade<string> {\n async getItem(key: string): Promise<string | undefined> {\n if (typeof Storage === 'undefined') {\n console.error('Your browser does not support HTML5 Browser Local Storage !')\n throw new Error('Your browser does not support HTML5 Browser Local Storage !')\n }\n return localStorage.getItem(key) ?? undefined\n }\n\n async removeItem(key: string): Promise<void> {\n if (typeof Storage === 'undefined') {\n console.error('Your browser does not support HTML5 Browser Local Storage !')\n throw new Error('Your browser does not support HTML5 Browser Local Storage !')\n }\n return localStorage.removeItem(key)\n }\n\n async setItem(key: string, valueToStore: string): Promise<void> {\n if (typeof Storage === 'undefined') {\n console.error('Your browser does not support HTML5 Browser Local Storage !')\n throw new Error('Your browser does not support HTML5 Browser Local Storage !')\n }\n return localStorage.setItem(key, valueToStore)\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageFacade.js","sourceRoot":"","sources":["../../../icc-x-api/storage/StorageFacade.ts"],"names":[],"mappings":"","sourcesContent":["export interface StorageFacade<T> {\n /**\n * Returns the value of the provided key from the storage\n * @param key Key of the value to retrieve\n * @return The value associated to the provided key or null if not found.\n */\n getItem(key: string): Promise<T | undefined>\n\n /**\n * Set an item in the storage for the given key\n * @param key Key of the value to set\n * @param valueToStore\n */\n setItem(key: string, valueToStore: T): Promise<void>\n\n /**\n * Removes the item with the given key from the storage.\n * @param key The key of the item to remove.\n */\n
|
|
1
|
+
{"version":3,"file":"StorageFacade.js","sourceRoot":"","sources":["../../../icc-x-api/storage/StorageFacade.ts"],"names":[],"mappings":"","sourcesContent":["export interface StorageFacade<T> {\n /**\n * Returns the value of the provided key from the storage\n * @param key Key of the value to retrieve\n * @return The value associated to the provided key or null if not found.\n */\n getItem(key: string): Promise<T | undefined>\n\n /**\n * Set an item in the storage for the given key\n * @param key Key of the value to set\n * @param valueToStore\n */\n setItem(key: string, valueToStore: T): Promise<void>\n\n /**\n * Removes the item with the given key from the storage.\n * @param key The key of the item to remove.\n */\n removeItem(key: string): Promise<void>\n}\n"]}
|