@icure/api 5.0.24 → 5.0.25

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.
@@ -1 +1 @@
1
- {"version":3,"file":"icc-data-owner-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-data-owner-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA,MAAa,gBAAgB;IAI3B,YAAY,MAAqB,EAAE,cAA6B;QAC9D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAA;IACtC,CAAC;IAED,cAAc,CAAC,IAAU;;QACvB,MAAM,WAAW,GAAG,MAAA,MAAA,IAAI,CAAC,iBAAiB,mCAAI,IAAI,CAAC,SAAS,mCAAI,IAAI,CAAC,QAAQ,CAAA;QAC7E,IAAI,WAAW,IAAI,SAAS,EAAE;YAC5B,MAAM,KAAK,CAAC,QAAQ,IAAI,CAAC,EAAE,sBAAsB,CAAC,CAAA;SACnD;QACD,OAAO,WAAW,CAAA;IACpB,CAAC;IAEa,YAAY,CAAC,WAAmB,EAAE,WAAiD;;YAC/F,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE;gBAC7E,MAAM,QAAQ,GAAI,SAA6B,CAAC,QAAQ,CAAA;gBACxD,IAAK,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,MAAM,EAAG;oBACtF,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;iBACrE;gBACD,OAAO,IAAI,CAAA;YACb,CAAC,CAAC,CAAA;QACJ,CAAC;KAAA;IAEK,WAAW,CAAC,SAAe,EAAE,WAAiD;;YAClF,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC,CAAA;QACvE,CAAC;KAAA;CACF;AA9BD,4CA8BC","sourcesContent":["import { User } from '../icc-api/model/User'\nimport { IccPatientApi } from '../icc-api'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\nimport { HealthcareParty } from '../icc-api/model/HealthcareParty'\nimport { Delegation } from '../icc-api/model/Delegation'\n\nexport class IccDataOwnerXApi {\n crypto: IccCryptoXApi\n private patientBaseApi: IccPatientApi\n\n constructor(crypto: IccCryptoXApi, patientBaseApi: IccPatientApi) {\n this.crypto = crypto\n this.patientBaseApi = patientBaseApi\n }\n\n getDataOwnerOf(user: User): string {\n const dataOwnerId = user.healthcarePartyId ?? user.patientId ?? user.deviceId\n if (dataOwnerId == undefined) {\n throw Error(`User ${user.id} is not a data owner`)\n }\n return dataOwnerId\n }\n\n private async _hasAccessTo(dataOwnerId: string, delegations: { [key: string]: Array<Delegation> }): Promise<boolean> {\n return this.crypto.getDataOwner(dataOwnerId).then(({ dataOwner: dataOwner }) => {\n const parentId = (dataOwner as HealthcareParty).parentId\n if ( !dataOwner.id || !delegations[dataOwner.id] || !delegations[dataOwner.id].length ) {\n return !!parentId ? this._hasAccessTo(parentId, delegations) : false\n }\n return true\n })\n }\n\n async hasAccessTo(dataOwner: User, delegations: { [key: string]: Array<Delegation> }): Promise<boolean> {\n return this._hasAccessTo(this.getDataOwnerOf(dataOwner), delegations)\n }\n}\n"]}
1
+ {"version":3,"file":"icc-data-owner-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-data-owner-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA,MAAa,gBAAgB;IAI3B,YAAY,MAAqB,EAAE,cAA6B;QAC9D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAA;IACtC,CAAC;IAED,cAAc,CAAC,IAAU;;QACvB,MAAM,WAAW,GAAG,MAAA,MAAA,IAAI,CAAC,iBAAiB,mCAAI,IAAI,CAAC,SAAS,mCAAI,IAAI,CAAC,QAAQ,CAAA;QAC7E,IAAI,WAAW,IAAI,SAAS,EAAE;YAC5B,MAAM,KAAK,CAAC,QAAQ,IAAI,CAAC,EAAE,sBAAsB,CAAC,CAAA;SACnD;QACD,OAAO,WAAW,CAAA;IACpB,CAAC;IAEa,YAAY,CAAC,WAAmB,EAAE,WAAiD;;YAC/F,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE;gBAC7E,MAAM,QAAQ,GAAI,SAA6B,CAAC,QAAQ,CAAA;gBACxD,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;oBACpF,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;iBACrE;gBACD,OAAO,IAAI,CAAA;YACb,CAAC,CAAC,CAAA;QACJ,CAAC;KAAA;IAEK,WAAW,CAAC,SAAe,EAAE,WAAiD;;YAClF,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC,CAAA;QACvE,CAAC;KAAA;CACF;AA9BD,4CA8BC","sourcesContent":["import { User } from '../icc-api/model/User'\nimport { IccPatientApi } from '../icc-api'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\nimport { HealthcareParty } from '../icc-api/model/HealthcareParty'\nimport { Delegation } from '../icc-api/model/Delegation'\n\nexport class IccDataOwnerXApi {\n crypto: IccCryptoXApi\n private patientBaseApi: IccPatientApi\n\n constructor(crypto: IccCryptoXApi, patientBaseApi: IccPatientApi) {\n this.crypto = crypto\n this.patientBaseApi = patientBaseApi\n }\n\n getDataOwnerOf(user: User): string {\n const dataOwnerId = user.healthcarePartyId ?? user.patientId ?? user.deviceId\n if (dataOwnerId == undefined) {\n throw Error(`User ${user.id} is not a data owner`)\n }\n return dataOwnerId\n }\n\n private async _hasAccessTo(dataOwnerId: string, delegations: { [key: string]: Array<Delegation> }): Promise<boolean> {\n return this.crypto.getDataOwner(dataOwnerId).then(({ dataOwner: dataOwner }) => {\n const parentId = (dataOwner as HealthcareParty).parentId\n if (!dataOwner.id || !delegations[dataOwner.id] || !delegations[dataOwner.id].length) {\n return !!parentId ? this._hasAccessTo(parentId, delegations) : false\n }\n return true\n })\n }\n\n async hasAccessTo(dataOwner: User, delegations: { [key: string]: Array<Delegation> }): Promise<boolean> {\n return this._hasAccessTo(this.getDataOwnerOf(dataOwner), delegations)\n }\n}\n"]}
@@ -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;AAEtD,MAAa,WAAY,SAAQ,uBAAU;IAGzC,YACE,IAAY,EACZ,OAAkC,EAClC,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,SAAS,CAAC,CAAA;QAC/B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;CAGF;AAjBD,kCAiBC","sourcesContent":["import { IccUserApi } from '../icc-api/api/IccUserApi'\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 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, fetchImpl)\n this.fetchImpl = fetchImpl\n }\n\n\n}\n"]}
1
+ {"version":3,"file":"icc-user-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-user-x-api.ts"],"names":[],"mappings":";;;AAAA,0DAAsD;AAEtD,MAAa,WAAY,SAAQ,uBAAU;IAGzC,YACE,IAAY,EACZ,OAAkC,EAClC,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,SAAS,CAAC,CAAA;QAC/B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;CACF;AAfD,kCAeC","sourcesContent":["import { IccUserApi } from '../icc-api/api/IccUserApi'\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 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, fetchImpl)\n this.fetchImpl = fetchImpl\n }\n}\n"]}
@@ -114,7 +114,7 @@ const Api = function (host, username, password, crypto = typeof window !== 'unde
114
114
  }
115
115
  }
116
116
  else {
117
- console.info("Auto login skipped");
117
+ console.info('Auto login skipped');
118
118
  }
119
119
  return {
120
120
  cryptoApi,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../icc-x-api/index.ts"],"names":[],"mappings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AS;YACT,OAAO;YACP,OAAO;YACP,OAAO;YACP,aAAa;YACb,UAAU;YACV,kBAAkB;YAClB,SAAS;YACT,YAAY;YACZ,UAAU;YACV,oBAAoB;YACpB,WAAW;YACX,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;AA/FY,QAAA,GAAG,OA+Ff","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'\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'\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): Promise<Apis> {\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(host, headers, healthcarePartyApi, new IccPatientApi(host, headers, fetchImpl), deviceApi, crypto)\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 }\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;AAE/B,wDAAqC;AACrC,sDAAmC;AACnC,4DAAyC;AACzC,6DAA0C;AAC1C,mDAAgC;AAChC,sDAAmC;AACnC,qDAAkC;AAClC,0DAAuC;AACvC,uDAAoC;AACpC,m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,CAAC,MAAM,CAAC,EACR,SAAS,CACV,CAAA;QACD,MAAM,UAAU,GAAG,IAAI,kCAAc,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,CAAC,CAAA;QACxF,MAAM,kBAAkB,GAAG,IAAI,mDAAsB,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,YAAY,EAAE,CAAC,YAAY,CAAC,EAAE,SAAS,CAAC,CAAA;QAE5I,IAAI,SAAS,EAAE;YACb,IAAI,QAAQ,IAAI,SAAS,IAAI,QAAQ,IAAI,SAAS,EAAE;gBAClD,IAAI;oBACF,MAAM,IAAA,aAAK,EAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;iBACvE;gBAAC,OAAO,CAAC,EAAE;oBACV,OAAO,CAAC,KAAK,CAAC,yEAAyE,EAAE,CAAC,CAAC,CAAA;iBAC5F;aACF;SACF;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA;SACnC;QAED,OAAO;YACL,SAAS;YACT,OAAO;YACP,OAAO;YACP,OAAO;YACP,aAAa;YACb,UAAU;YACV,kBAAkB;YAClB,SAAS;YACT,YAAY;YACZ,UAAU;YACV,oBAAoB;YACpB,WAAW;YACX,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;AA9FY,QAAA,GAAG,OA8Ff","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'\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'\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): Promise<Apis> {\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(host, headers, healthcarePartyApi, new IccPatientApi(host, headers, fetchImpl), deviceApi, crypto)\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,2 +1,3 @@
1
1
  export declare function also<T>(value: T, lambda: (it: T) => void): T;
2
2
  export declare function fold<T, R>(whereToFold: Array<T>, initial: R, operation: (acc: R, element: T) => R): R;
3
+ export declare function foldAsync<T, R>(whereToFold: Array<T>, initial: R, operation: (acc: R, element: T) => Promise<R>): Promise<R>;
@@ -1,6 +1,15 @@
1
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
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fold = exports.also = void 0;
12
+ exports.foldAsync = exports.fold = exports.also = void 0;
4
13
  function also(value, lambda) {
5
14
  lambda(value);
6
15
  return value;
@@ -13,4 +22,13 @@ function fold(whereToFold, initial, operation) {
13
22
  return accumulator;
14
23
  }
15
24
  exports.fold = fold;
25
+ function foldAsync(whereToFold, initial, operation) {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ let accumulator = initial;
28
+ for (let i = 0; i < whereToFold.length; i++)
29
+ accumulator = yield operation(accumulator, whereToFold[i]);
30
+ return accumulator;
31
+ });
32
+ }
33
+ exports.foldAsync = foldAsync;
16
34
  //# sourceMappingURL=functional-util.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"functional-util.js","sourceRoot":"","sources":["../../../icc-x-api/utils/functional-util.ts"],"names":[],"mappings":";;;AAAA,SAAgB,IAAI,CAAI,KAAQ,EAAE,MAAuB;IACvD,MAAM,CAAC,KAAK,CAAC,CAAA;IACb,OAAO,KAAK,CAAA;AACd,CAAC;AAHD,oBAGC;AAED,SAAgB,IAAI,CAAO,WAAqB,EAAE,OAAU,EAAE,SAAoC;IAChG,IAAI,WAAW,GAAG,OAAO,CAAA;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE;QAAE,WAAW,GAAG,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;IACjG,OAAO,WAAW,CAAA;AACpB,CAAC;AAJD,oBAIC","sourcesContent":["export function also<T>(value: T, lambda: (it: T) => void) {\n lambda(value)\n return value\n}\n\nexport function fold<T, R>(whereToFold: Array<T>, initial: R, operation: (acc: R, element: T) => R): R {\n let accumulator = initial\n for (let i = 0; i < whereToFold.length; i++) accumulator = operation(accumulator, whereToFold[i])\n return accumulator\n}\n"]}
1
+ {"version":3,"file":"functional-util.js","sourceRoot":"","sources":["../../../icc-x-api/utils/functional-util.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,SAAgB,IAAI,CAAI,KAAQ,EAAE,MAAuB;IACvD,MAAM,CAAC,KAAK,CAAC,CAAA;IACb,OAAO,KAAK,CAAA;AACd,CAAC;AAHD,oBAGC;AAED,SAAgB,IAAI,CAAO,WAAqB,EAAE,OAAU,EAAE,SAAoC;IAChG,IAAI,WAAW,GAAG,OAAO,CAAA;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE;QAAE,WAAW,GAAG,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;IACjG,OAAO,WAAW,CAAA;AACpB,CAAC;AAJD,oBAIC;AAED,SAAsB,SAAS,CAAO,WAAqB,EAAE,OAAU,EAAE,SAA6C;;QACpH,IAAI,WAAW,GAAG,OAAO,CAAA;QACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE;YAAE,WAAW,GAAG,MAAM,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;QACvG,OAAO,WAAW,CAAA;IACpB,CAAC;CAAA;AAJD,8BAIC","sourcesContent":["export function also<T>(value: T, lambda: (it: T) => void) {\n lambda(value)\n return value\n}\n\nexport function fold<T, R>(whereToFold: Array<T>, initial: R, operation: (acc: R, element: T) => R): R {\n let accumulator = initial\n for (let i = 0; i < whereToFold.length; i++) accumulator = operation(accumulator, whereToFold[i])\n return accumulator\n}\n\nexport async function foldAsync<T, R>(whereToFold: Array<T>, initial: R, operation: (acc: R, element: T) => Promise<R>): Promise<R> {\n let accumulator = initial\n for (let i = 0; i < whereToFold.length; i++) accumulator = await operation(accumulator, whereToFold[i])\n return accumulator\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icure/api",
3
- "version": "5.0.24",
3
+ "version": "5.0.25",
4
4
  "description": "Typescript version of iCure standalone API client",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",