@icure/api 8.2.10 → 8.3.2
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/IccUserApi.d.ts +1 -0
- package/icc-api/api/IccUserApi.js +10 -0
- package/icc-api/api/IccUserApi.js.map +1 -1
- package/icc-api/model/TimeTable.d.ts +0 -29
- package/icc-api/model/TimeTable.js.map +1 -1
- package/icc-x-api/index.d.ts +2 -4
- package/icc-x-api/index.js +1 -3
- package/icc-x-api/index.js.map +1 -1
- package/package.json +1 -1
- package/test/icc-x-api/crud/entities-crud-test-interface.js +4 -11
- package/test/icc-x-api/crud/entities-crud-test-interface.js.map +1 -1
- package/test/icc-x-api/icc-time-table-x-api.js +2 -20
- package/test/icc-x-api/icc-time-table-x-api.js.map +1 -1
- package/icc-x-api/icc-time-table-x-api.d.ts +0 -115
- package/icc-x-api/icc-time-table-x-api.js +0 -150
- package/icc-x-api/icc-time-table-x-api.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities-crud-test-interface.js","sourceRoot":"","sources":["../../../../test/icc-x-api/crud/entities-crud-test-interface.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,mCAAmC;AAInC,gEAA4D;AAE5D,0DAAsD;AAGtD,8EAA0E;AAE1E,0FAAsF;AAEtF,0DAAsD;AAGtD,4EAAwE;AAExE,gEAA4D;AAC5D,4DAAwD;AACxD,4DAAwD;AAExD,4EAAwE;AAExE,wDAAoD;AAevC,QAAA,QAAQ,GAAqC;IACxD,SAAS,EAAE;QACT,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,CAAO,GAAa,EAAE,OAAgB,EAAE,EAAE;YAChD,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,CAAA;YACtD,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,YAAY,CAAC,WAAW,CAAC,WAAW,EAAE,OAAO,EAAE,EAAE,MAAM,EAA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,OAAA,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,qBAAS,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAG,CAAC,EAAE,CAAC,CAAC,CAAA,GAAA;QACjI,MAAM,EAAE,CAAO,GAAa,EAAE,EAAa,EAAE,EAAE,kDAAC,OAAA,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,EAAG,CAAC,CAAA,GAAA;KACjF;CACF,CAAA","sourcesContent":["import { IcureApi } from '../../../icc-x-api'\nimport { randomUUID } from 'crypto'\nimport { Patient } from '../../../icc-api/model/Patient'\nimport { IdWithRev } from '../../../icc-api/model/IdWithRev'\nimport { AccessLog } from '../../../icc-api/model/AccessLog'\nimport { ListOfIds } from '../../../icc-api/model/ListOfIds'\nimport { DocIdentifier } from '../../../icc-api/model/DocIdentifier'\nimport { Agenda } from '../../../icc-api/model/Agenda'\nimport { Article } from '../../../icc-api/model/Article'\nimport { CalendarItem } from '../../../icc-api/model/CalendarItem'\nimport { CalendarItemType } from '../../../icc-api/model/CalendarItemType'\nimport { Classification } from '../../../icc-api/model/Classification'\nimport { ClassificationTemplate } from '../../../icc-api/model/ClassificationTemplate'\nimport { Contact } from '../../../icc-api/model/Contact'\nimport { Device } from '../../../icc-api/model/Device'\nimport { Document } from '../../../icc-api/model/Document'\nimport { Form } from '../../../icc-api/model/Form'\nimport { HealthcareParty } from '../../../icc-api/model/HealthcareParty'\nimport { HealthElement } from '../../../icc-api/model/HealthElement'\nimport { Insurance } from '../../../icc-api/model/Insurance'\nimport { Invoice } from '../../../icc-api/model/Invoice'\nimport { Keyword } from '../../../icc-api/model/Keyword'\nimport { MaintenanceTask } from '../../../icc-api/model/MaintenanceTask'\nimport { MedicalLocation } from '../../../icc-api/model/MedicalLocation'\nimport { Message } from '../../../icc-api/model/Message'\nimport { Place } from '../../../icc-api/model/Place'\nimport { Receipt } from '../../../icc-api/model/Receipt'\nimport { TimeTable } from '../../../icc-api/model/TimeTable'\nimport { Topic } from '../../../icc-api/model/Topic'\n\nexport interface CRUDInterface {\n encryptable: boolean\n skipDenied?: boolean\n cloudOnly?: boolean\n create(api: IcureApi, patient: Patient): Promise<IdWithRev>\n share(delegatorApi: IcureApi, delegateApi: IcureApi, entity: any): Promise<IdWithRev>\n deleteMany(api: IcureApi, ids: IdWithRev[]): Promise<Array<DocIdentifier>>\n delete(api: IcureApi, id: IdWithRev): Promise<DocIdentifier>\n}\n\nexport const entities: { [key: string]: CRUDInterface } = {\n AccessLog: {\n encryptable: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const accessLog = await api.accessLogApi.newInstance(currentUser, patient, { detail: randomUUID() })\n return api.accessLogApi.createAccessLogWithUser(currentUser, accessLog)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.accessLogApi.shareWith(delegateId, entity as AccessLog)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.accessLogApi.deleteAccessLogs(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.accessLogApi.deleteAccessLog(id.id!),\n },\n Agenda: {\n skipDenied: true,\n encryptable: false,\n create: async (api: IcureApi, _: Patient) => api.agendaApi.createAgenda(new Agenda({ id: randomUUID(), name: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.agendaApi.deleteAgendas(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.agendaApi.deleteAgenda(id.id!),\n },\n CalendarItem: {\n encryptable: true,\n create: async (api: IcureApi, _: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.calendarItemApi.newInstance(currentUser, { title: randomUUID() })\n return api.calendarItemApi.createCalendarItemWithHcParty(currentUser, item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.calendarItemApi.shareWith(delegateId, entity as CalendarItem)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.calendarItemApi.deleteCalendarItems(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.calendarItemApi.deleteCalendarItem(id.id!),\n },\n CalendarItemType: {\n skipDenied: true,\n encryptable: false,\n create: async (api: IcureApi, _: Patient) =>\n api.calendarItemTypeApi.createCalendarItemType(new CalendarItemType({ id: randomUUID(), color: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) =>\n api.calendarItemTypeApi.deleteCalendarItemTypes(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) =>\n api.calendarItemTypeApi.deleteCalendarItemTypes(new ListOfIds({ ids: [id.id!] })).then((r) => {\n if (r.length === 0) throw Error('No element deleted')\n else return r[0]\n }),\n },\n Classification: {\n encryptable: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.classificationApi.newInstance(currentUser, patient, { label: randomUUID() })\n return api.classificationApi.createClassification(item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.classificationApi.shareWith(delegateId, entity as Classification)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) =>\n api.classificationApi.deleteClassifications(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.classificationApi.deleteClassification(id.id!),\n },\n ClassificationTemplate: {\n encryptable: false,\n skipDenied: true,\n create: async (api: IcureApi, _: Patient) =>\n api.classificationTemplateApi.createClassificationTemplate(new ClassificationTemplate({ id: randomUUID(), label: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) =>\n api.classificationTemplateApi.deleteClassificationTemplates(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.classificationTemplateApi.deleteClassificationTemplate(id.id!),\n },\n Contact: {\n encryptable: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.contactApi.newInstance(currentUser, patient, { descr: randomUUID() })\n return (await api.contactApi.createContactWithUser(currentUser, item))!\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.contactApi.shareWith(delegateId, entity as Contact)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.contactApi.deleteContacts(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.contactApi.deleteContact(id.id!),\n },\n Device: {\n encryptable: false,\n create: async (api: IcureApi, _: Patient) => api.deviceApi.createDevice(new Device({ id: randomUUID(), name: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.deviceApi.deleteDevices(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.deviceApi.deleteDevice(id.id!),\n },\n Document: {\n encryptable: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.documentApi.newInstance(currentUser, patient, { name: randomUUID() })\n return api.documentApi.createDocument(item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.documentApi.shareWith(delegateId, entity as Document)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.documentApi.deleteDocuments(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.documentApi.deleteDocument(id.id!),\n },\n Form: {\n encryptable: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.formApi.newInstance(currentUser, patient, { uniqueId: randomUUID() })\n return api.formApi.createForm(item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.formApi.shareWith(delegateId, entity as Form)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.formApi.deleteForms(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.formApi.deleteForm(id.id!),\n },\n HealthcareParty: {\n encryptable: false,\n create: async (api: IcureApi, _: Patient) =>\n api.healthcarePartyApi.createHealthcareParty(new HealthcareParty({ id: randomUUID(), name: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) =>\n api.healthcarePartyApi.deleteHealthcareParties(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.healthcarePartyApi.deleteHealthcareParty(id.id!),\n },\n HealthcarePartyInGroup: {\n encryptable: false,\n cloudOnly: true,\n create: async (api: IcureApi, _: Patient) =>\n api.healthcarePartyApi.createHealthcareParty(new HealthcareParty({ id: randomUUID(), name: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => {\n const currentUser = await api.userApi.getCurrentUser()\n return api.healthcarePartyApi.deleteHealthcarePartiesInGroup(currentUser.groupId!, new ListOfIds({ ids: ids.map((it) => it.id!) }))\n },\n delete: async (api: IcureApi, id: IdWithRev) => {\n const currentUser = await api.userApi.getCurrentUser()\n return api.healthcarePartyApi.deleteHealthcarePartyInGroup(currentUser.groupId!, id.id!)\n },\n },\n HealthcareElement: {\n encryptable: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.healthcareElementApi.newInstance(currentUser, patient, { descr: randomUUID() })\n return api.healthcareElementApi.createHealthElementWithUser(currentUser, item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.healthcareElementApi.shareWith(delegateId, entity as HealthElement)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) =>\n api.healthcareElementApi.deleteHealthElements(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.healthcareElementApi.deleteHealthElement(id.id!),\n },\n Insurance: {\n encryptable: false,\n skipDenied: true,\n create: async (api: IcureApi, _: Patient) => api.insuranceApi.createInsurance(new Insurance({ id: randomUUID(), code: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => {\n const ret: DocIdentifier[] = []\n for (const id of ids) {\n const result = await api.insuranceApi.deleteInsurance(id.id!)\n ret.push(result)\n }\n return ret\n },\n delete: async (api: IcureApi, id: IdWithRev) => api.insuranceApi.deleteInsurance(id.id!),\n },\n Invoice: {\n encryptable: false,\n skipDenied: true,\n create: async (api: IcureApi, _: Patient) => api.invoiceApi.createInvoice(new Invoice({ id: randomUUID(), recipientId: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => {\n const ret: DocIdentifier[] = []\n for (const id of ids) {\n const result = await api.invoiceApi.deleteInvoice(id.id!)\n ret.push(result)\n }\n return ret\n },\n delete: async (api: IcureApi, id: IdWithRev) => api.invoiceApi.deleteInvoice(id.id!),\n },\n Keyword: {\n encryptable: false,\n skipDenied: true,\n create: async (api: IcureApi, _: Patient) => api.keywordApi.createKeyword(new Keyword({ id: randomUUID(), value: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.keywordApi.deleteKeywords(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) =>\n api.keywordApi.deleteKeywords(new ListOfIds({ ids: [id.id!] })).then((r) => {\n if (r.length === 0) throw new Error('No keyword deleted')\n else return r[0]\n }),\n },\n MaintenanceTask: {\n encryptable: true,\n create: async (api: IcureApi, _: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.maintenanceTaskApi.newInstance(currentUser, {})\n return (await api.maintenanceTaskApi.createMaintenanceTaskWithUser(currentUser, item))!\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.maintenanceTaskApi.shareWith(delegateId, entity as MaintenanceTask)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => {\n const currentUser = await api.userApi.getCurrentUser()\n return api.maintenanceTaskApi.deleteMaintenanceTasksWithUser(currentUser, new ListOfIds({ ids: ids.map((it) => it.id!) }))\n },\n delete: async (api: IcureApi, id: IdWithRev) => {\n const currentUser = await api.userApi.getCurrentUser()\n return api.maintenanceTaskApi.deleteMaintenanceTaskWithUser(currentUser, id.id!)\n },\n },\n MedicalLocation: {\n encryptable: false,\n skipDenied: true,\n create: async (api: IcureApi, _: Patient) =>\n api.medicalLocationApi.createMedicalLocation(new MedicalLocation({ id: randomUUID(), nihii: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) =>\n api.medicalLocationApi.deleteMedicalLocations(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) =>\n api.medicalLocationApi.deleteMedicalLocations(new ListOfIds({ ids: [id.id!] })).then((r) => {\n if (r.length === 0) throw new Error('No medical location deleted')\n else return r[0]\n }),\n },\n Message: {\n encryptable: true,\n create: async (api: IcureApi, _: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.messageApi.newInstance(currentUser, {})\n return api.messageApi.createMessage(item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.messageApi.shareWith(delegateId, entity as Message, [])\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.messageApi.deleteMessages(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.messageApi.deleteMessage(id.id!),\n },\n Patient: {\n encryptable: true,\n create: async (api: IcureApi, _: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.patientApi.newInstance(currentUser, {})\n return api.patientApi.createPatientWithUser(currentUser, item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.patientApi.shareWith(delegateId, entity as Patient, [])\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.patientApi.deletePatients(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.patientApi.deletePatient(id.id!),\n },\n Place: {\n encryptable: false,\n skipDenied: true,\n create: async (api: IcureApi, _: Patient) => api.placeApi.createPlace(new Place({ id: randomUUID(), name: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.placeApi.deletePlaces(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) =>\n api.placeApi.deletePlaces(new ListOfIds({ ids: [id.id!] })).then((r) => {\n if (r.length === 0) throw new Error('No place deleted')\n else return r[0]\n }),\n },\n Receipt: {\n encryptable: true,\n create: async (api: IcureApi, _: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.receiptApi.newInstance(currentUser, {})\n return api.receiptApi.createReceipt(item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.receiptApi.shareWith(delegateId, entity as Receipt)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.receiptApi.deleteReceipts(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.receiptApi.deleteReceipt(id.id!),\n },\n TimeTable: {\n encryptable: true,\n create: async (api: IcureApi, _: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.timetableApi.newInstance(currentUser, {})\n return api.timetableApi.createTimeTable(item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.timetableApi.shareWith(delegateId, entity as TimeTable)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.timetableApi.deleteTimeTables(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.timetableApi.deleteTimeTable(id.id!),\n },\n Topic: {\n encryptable: true,\n cloudOnly: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.topicApi.newInstance(currentUser, patient)\n return api.topicApi.createTopic(item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.topicApi.shareWith(delegateId, entity as Topic)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.topicApi.deleteTopics(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.topicApi.deleteTopic(id.id!),\n },\n}\n"]}
|
|
1
|
+
{"version":3,"file":"entities-crud-test-interface.js","sourceRoot":"","sources":["../../../../test/icc-x-api/crud/entities-crud-test-interface.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,mCAAmC;AAInC,gEAA4D;AAE5D,0DAAsD;AAGtD,8EAA0E;AAE1E,0FAAsF;AAEtF,0DAAsD;AAGtD,4EAAwE;AAExE,gEAA4D;AAC5D,4DAAwD;AACxD,4DAAwD;AAExD,4EAAwE;AAExE,wDAAoD;AAEpD,gEAA4D;AAa/C,QAAA,QAAQ,GAAqC;IACxD,SAAS,EAAE;QACT,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,CAAO,GAAa,EAAE,OAAgB,EAAE,EAAE;YAChD,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,CAAA;YACtD,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,YAAY,CAAC,WAAW,CAAC,WAAW,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,IAAA,mBAAU,GAAE,EAAE,CAAC,CAAA;YACpG,OAAO,GAAG,CAAC,YAAY,CAAC,uBAAuB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;QACzE,CAAC,CAAA;QACD,KAAK,EAAE,CAAO,YAAsB,EAAE,WAAqB,EAAE,MAAW,EAAE,EAAE;;YAC1E,MAAM,YAAY,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,cAAc,EAAE,CAAA;YAC/D,MAAM,UAAU,GAAG,MAAA,MAAA,YAAY,CAAC,iBAAiB,mCAAI,YAAY,CAAC,SAAS,mCAAI,YAAY,CAAC,QAAQ,CAAA;YACpG,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAA;YAC1D,CAAC;YACD,OAAO,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,UAAU,EAAE,MAAmB,CAAC,CAAA;QAC7E,CAAC,CAAA;QACD,UAAU,E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,EAAE,CAAC;gBAChB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAA;YAC1D,CAAC;YACD,OAAO,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,EAAE,MAAe,CAAC,CAAA;QACrE,CAAC,CAAA;QACD,UAAU,EAAE,CAAO,GAAa,EAAE,GAAgB,EAAE,EAAE,kDAAC,OAAA,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,qBAAS,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAG,CAAC,EAAE,CAAC,CAAC,CAAA,GAAA;QACjI,MAAM,EAAE,CAAO,GAAa,EAAE,EAAa,EAAE,EAAE,kDAAC,OAAA,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,EAAG,CAAC,CAAA,GAAA;KACjF;CACF,CAAA","sourcesContent":["import { IcureApi } from '../../../icc-x-api'\nimport { randomUUID } from 'crypto'\nimport { Patient } from '../../../icc-api/model/Patient'\nimport { IdWithRev } from '../../../icc-api/model/IdWithRev'\nimport { AccessLog } from '../../../icc-api/model/AccessLog'\nimport { ListOfIds } from '../../../icc-api/model/ListOfIds'\nimport { DocIdentifier } from '../../../icc-api/model/DocIdentifier'\nimport { Agenda } from '../../../icc-api/model/Agenda'\nimport { Article } from '../../../icc-api/model/Article'\nimport { CalendarItem } from '../../../icc-api/model/CalendarItem'\nimport { CalendarItemType } from '../../../icc-api/model/CalendarItemType'\nimport { Classification } from '../../../icc-api/model/Classification'\nimport { ClassificationTemplate } from '../../../icc-api/model/ClassificationTemplate'\nimport { Contact } from '../../../icc-api/model/Contact'\nimport { Device } from '../../../icc-api/model/Device'\nimport { Document } from '../../../icc-api/model/Document'\nimport { Form } from '../../../icc-api/model/Form'\nimport { HealthcareParty } from '../../../icc-api/model/HealthcareParty'\nimport { HealthElement } from '../../../icc-api/model/HealthElement'\nimport { Insurance } from '../../../icc-api/model/Insurance'\nimport { Invoice } from '../../../icc-api/model/Invoice'\nimport { Keyword } from '../../../icc-api/model/Keyword'\nimport { MaintenanceTask } from '../../../icc-api/model/MaintenanceTask'\nimport { MedicalLocation } from '../../../icc-api/model/MedicalLocation'\nimport { Message } from '../../../icc-api/model/Message'\nimport { Place } from '../../../icc-api/model/Place'\nimport { Receipt } from '../../../icc-api/model/Receipt'\nimport { TimeTable } from '../../../icc-api/model/TimeTable'\nimport { Topic } from '../../../icc-api/model/Topic'\n\nexport interface CRUDInterface {\n encryptable: boolean\n skipDenied?: boolean\n cloudOnly?: boolean\n create(api: IcureApi, patient: Patient): Promise<IdWithRev>\n share(delegatorApi: IcureApi, delegateApi: IcureApi, entity: any): Promise<IdWithRev>\n deleteMany(api: IcureApi, ids: IdWithRev[]): Promise<Array<DocIdentifier>>\n delete(api: IcureApi, id: IdWithRev): Promise<DocIdentifier>\n}\n\nexport const entities: { [key: string]: CRUDInterface } = {\n AccessLog: {\n encryptable: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const accessLog = await api.accessLogApi.newInstance(currentUser, patient, { detail: randomUUID() })\n return api.accessLogApi.createAccessLogWithUser(currentUser, accessLog)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.accessLogApi.shareWith(delegateId, entity as AccessLog)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.accessLogApi.deleteAccessLogs(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.accessLogApi.deleteAccessLog(id.id!),\n },\n Agenda: {\n skipDenied: true,\n encryptable: false,\n create: async (api: IcureApi, _: Patient) => api.agendaApi.createAgenda(new Agenda({ id: randomUUID(), name: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.agendaApi.deleteAgendas(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.agendaApi.deleteAgenda(id.id!),\n },\n CalendarItem: {\n encryptable: true,\n create: async (api: IcureApi, _: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.calendarItemApi.newInstance(currentUser, { title: randomUUID() })\n return api.calendarItemApi.createCalendarItemWithHcParty(currentUser, item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.calendarItemApi.shareWith(delegateId, entity as CalendarItem)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.calendarItemApi.deleteCalendarItems(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.calendarItemApi.deleteCalendarItem(id.id!),\n },\n CalendarItemType: {\n skipDenied: true,\n encryptable: false,\n create: async (api: IcureApi, _: Patient) =>\n api.calendarItemTypeApi.createCalendarItemType(new CalendarItemType({ id: randomUUID(), color: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) =>\n api.calendarItemTypeApi.deleteCalendarItemTypes(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) =>\n api.calendarItemTypeApi.deleteCalendarItemTypes(new ListOfIds({ ids: [id.id!] })).then((r) => {\n if (r.length === 0) throw Error('No element deleted')\n else return r[0]\n }),\n },\n Classification: {\n encryptable: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.classificationApi.newInstance(currentUser, patient, { label: randomUUID() })\n return api.classificationApi.createClassification(item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.classificationApi.shareWith(delegateId, entity as Classification)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) =>\n api.classificationApi.deleteClassifications(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.classificationApi.deleteClassification(id.id!),\n },\n ClassificationTemplate: {\n encryptable: false,\n skipDenied: true,\n create: async (api: IcureApi, _: Patient) =>\n api.classificationTemplateApi.createClassificationTemplate(new ClassificationTemplate({ id: randomUUID(), label: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) =>\n api.classificationTemplateApi.deleteClassificationTemplates(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.classificationTemplateApi.deleteClassificationTemplate(id.id!),\n },\n Contact: {\n encryptable: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.contactApi.newInstance(currentUser, patient, { descr: randomUUID() })\n return (await api.contactApi.createContactWithUser(currentUser, item))!\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.contactApi.shareWith(delegateId, entity as Contact)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.contactApi.deleteContacts(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.contactApi.deleteContact(id.id!),\n },\n Device: {\n encryptable: false,\n create: async (api: IcureApi, _: Patient) => api.deviceApi.createDevice(new Device({ id: randomUUID(), name: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.deviceApi.deleteDevices(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.deviceApi.deleteDevice(id.id!),\n },\n Document: {\n encryptable: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.documentApi.newInstance(currentUser, patient, { name: randomUUID() })\n return api.documentApi.createDocument(item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.documentApi.shareWith(delegateId, entity as Document)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.documentApi.deleteDocuments(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.documentApi.deleteDocument(id.id!),\n },\n Form: {\n encryptable: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.formApi.newInstance(currentUser, patient, { uniqueId: randomUUID() })\n return api.formApi.createForm(item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.formApi.shareWith(delegateId, entity as Form)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.formApi.deleteForms(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.formApi.deleteForm(id.id!),\n },\n HealthcareParty: {\n encryptable: false,\n create: async (api: IcureApi, _: Patient) =>\n api.healthcarePartyApi.createHealthcareParty(new HealthcareParty({ id: randomUUID(), name: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) =>\n api.healthcarePartyApi.deleteHealthcareParties(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.healthcarePartyApi.deleteHealthcareParty(id.id!),\n },\n HealthcarePartyInGroup: {\n encryptable: false,\n cloudOnly: true,\n create: async (api: IcureApi, _: Patient) =>\n api.healthcarePartyApi.createHealthcareParty(new HealthcareParty({ id: randomUUID(), name: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => {\n const currentUser = await api.userApi.getCurrentUser()\n return api.healthcarePartyApi.deleteHealthcarePartiesInGroup(currentUser.groupId!, new ListOfIds({ ids: ids.map((it) => it.id!) }))\n },\n delete: async (api: IcureApi, id: IdWithRev) => {\n const currentUser = await api.userApi.getCurrentUser()\n return api.healthcarePartyApi.deleteHealthcarePartyInGroup(currentUser.groupId!, id.id!)\n },\n },\n HealthcareElement: {\n encryptable: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.healthcareElementApi.newInstance(currentUser, patient, { descr: randomUUID() })\n return api.healthcareElementApi.createHealthElementWithUser(currentUser, item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.healthcareElementApi.shareWith(delegateId, entity as HealthElement)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) =>\n api.healthcareElementApi.deleteHealthElements(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.healthcareElementApi.deleteHealthElement(id.id!),\n },\n Insurance: {\n encryptable: false,\n skipDenied: true,\n create: async (api: IcureApi, _: Patient) => api.insuranceApi.createInsurance(new Insurance({ id: randomUUID(), code: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => {\n const ret: DocIdentifier[] = []\n for (const id of ids) {\n const result = await api.insuranceApi.deleteInsurance(id.id!)\n ret.push(result)\n }\n return ret\n },\n delete: async (api: IcureApi, id: IdWithRev) => api.insuranceApi.deleteInsurance(id.id!),\n },\n Invoice: {\n encryptable: false,\n skipDenied: true,\n create: async (api: IcureApi, _: Patient) => api.invoiceApi.createInvoice(new Invoice({ id: randomUUID(), recipientId: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => {\n const ret: DocIdentifier[] = []\n for (const id of ids) {\n const result = await api.invoiceApi.deleteInvoice(id.id!)\n ret.push(result)\n }\n return ret\n },\n delete: async (api: IcureApi, id: IdWithRev) => api.invoiceApi.deleteInvoice(id.id!),\n },\n Keyword: {\n encryptable: false,\n skipDenied: true,\n create: async (api: IcureApi, _: Patient) => api.keywordApi.createKeyword(new Keyword({ id: randomUUID(), value: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.keywordApi.deleteKeywords(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) =>\n api.keywordApi.deleteKeywords(new ListOfIds({ ids: [id.id!] })).then((r) => {\n if (r.length === 0) throw new Error('No keyword deleted')\n else return r[0]\n }),\n },\n MaintenanceTask: {\n encryptable: true,\n create: async (api: IcureApi, _: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.maintenanceTaskApi.newInstance(currentUser, {})\n return (await api.maintenanceTaskApi.createMaintenanceTaskWithUser(currentUser, item))!\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.maintenanceTaskApi.shareWith(delegateId, entity as MaintenanceTask)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => {\n const currentUser = await api.userApi.getCurrentUser()\n return api.maintenanceTaskApi.deleteMaintenanceTasksWithUser(currentUser, new ListOfIds({ ids: ids.map((it) => it.id!) }))\n },\n delete: async (api: IcureApi, id: IdWithRev) => {\n const currentUser = await api.userApi.getCurrentUser()\n return api.maintenanceTaskApi.deleteMaintenanceTaskWithUser(currentUser, id.id!)\n },\n },\n MedicalLocation: {\n encryptable: false,\n skipDenied: true,\n create: async (api: IcureApi, _: Patient) =>\n api.medicalLocationApi.createMedicalLocation(new MedicalLocation({ id: randomUUID(), nihii: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) =>\n api.medicalLocationApi.deleteMedicalLocations(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) =>\n api.medicalLocationApi.deleteMedicalLocations(new ListOfIds({ ids: [id.id!] })).then((r) => {\n if (r.length === 0) throw new Error('No medical location deleted')\n else return r[0]\n }),\n },\n Message: {\n encryptable: true,\n create: async (api: IcureApi, _: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.messageApi.newInstance(currentUser, {})\n return api.messageApi.createMessage(item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.messageApi.shareWith(delegateId, entity as Message, [])\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.messageApi.deleteMessages(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.messageApi.deleteMessage(id.id!),\n },\n Patient: {\n encryptable: true,\n create: async (api: IcureApi, _: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.patientApi.newInstance(currentUser, {})\n return api.patientApi.createPatientWithUser(currentUser, item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.patientApi.shareWith(delegateId, entity as Patient, [])\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.patientApi.deletePatients(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.patientApi.deletePatient(id.id!),\n },\n Place: {\n encryptable: false,\n skipDenied: true,\n create: async (api: IcureApi, _: Patient) => api.placeApi.createPlace(new Place({ id: randomUUID(), name: randomUUID() })),\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.placeApi.deletePlaces(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) =>\n api.placeApi.deletePlaces(new ListOfIds({ ids: [id.id!] })).then((r) => {\n if (r.length === 0) throw new Error('No place deleted')\n else return r[0]\n }),\n },\n Receipt: {\n encryptable: true,\n create: async (api: IcureApi, _: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.receiptApi.newInstance(currentUser, {})\n return api.receiptApi.createReceipt(item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.receiptApi.shareWith(delegateId, entity as Receipt)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.receiptApi.deleteReceipts(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.receiptApi.deleteReceipt(id.id!),\n },\n TimeTable: {\n encryptable: false,\n create: async (api: IcureApi, _: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = new TimeTable({})\n return api.timetableApi.createTimeTable(item)\n },\n share: async (_: IcureApi, __: IcureApi, entity: any) => entity,\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.timetableApi.deleteTimeTables(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.timetableApi.deleteTimeTable(id.id!),\n },\n Topic: {\n encryptable: true,\n cloudOnly: true,\n create: async (api: IcureApi, patient: Patient) => {\n const currentUser = await api.userApi.getCurrentUser()\n const item = await api.topicApi.newInstance(currentUser, patient)\n return api.topicApi.createTopic(item)\n },\n share: async (delegatorApi: IcureApi, delegateApi: IcureApi, entity: any) => {\n const delegateUser = await delegateApi.userApi.getCurrentUser()\n const delegateId = delegateUser.healthcarePartyId ?? delegateUser.patientId ?? delegateUser.deviceId\n if (!delegateId) {\n throw new Error('Cannot share with non data owner user')\n }\n return delegatorApi.topicApi.shareWith(delegateId, entity as Topic)\n },\n deleteMany: async (api: IcureApi, ids: IdWithRev[]) => api.topicApi.deleteTopics(new ListOfIds({ ids: ids.map((it) => it.id!) })),\n delete: async (api: IcureApi, id: IdWithRev) => api.topicApi.deleteTopic(id.id!),\n },\n}\n"]}
|
|
@@ -25,7 +25,7 @@ const types_1 = require("@icure/test-setup/types");
|
|
|
25
25
|
let env;
|
|
26
26
|
function instanceTimeTableFor(timeTableApi, user) {
|
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
return
|
|
28
|
+
return new TimeTable_1.TimeTable({
|
|
29
29
|
id: (0, crypto_1.randomUUID)(),
|
|
30
30
|
tags: [
|
|
31
31
|
new Code_1.Code({
|
|
@@ -51,7 +51,7 @@ function instanceTimeTableFor(timeTableApi, user) {
|
|
|
51
51
|
],
|
|
52
52
|
}),
|
|
53
53
|
],
|
|
54
|
-
})
|
|
54
|
+
});
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
describe('icc-x-time-table-api Tests', () => {
|
|
@@ -78,23 +78,5 @@ describe('icc-x-time-table-api Tests', () => {
|
|
|
78
78
|
(0, chai_1.expect)(yield cryptoApi.xapi.secretIdsOf({ entity: createdTimeTable, type: icc_x_api_1.EntityWithDelegationTypeName.TimeTable }, undefined)).to.have.length(0);
|
|
79
79
|
(0, chai_1.expect)(yield cryptoApi.xapi.owningEntityIdsOf({ entity: createdTimeTable, type: icc_x_api_1.EntityWithDelegationTypeName.TimeTable }, undefined)).to.have.length(0);
|
|
80
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 entity = (yield api1.timetableApi.createTimeTable(yield api1.timetableApi.newInstance(user1, {})));
|
|
87
|
-
yield api2.timetableApi
|
|
88
|
-
.getTimeTable(entity.id)
|
|
89
|
-
.then(() => {
|
|
90
|
-
throw new Error('Should not be able to get the entity');
|
|
91
|
-
})
|
|
92
|
-
.catch(() => {
|
|
93
|
-
/* expected */
|
|
94
|
-
});
|
|
95
|
-
yield api1.timetableApi.shareWith(user2.healthcarePartyId, entity);
|
|
96
|
-
const retrieved = yield api2.timetableApi.getTimeTable(entity.id);
|
|
97
|
-
(0, chai_1.expect)(retrieved.id).to.equal(entity.id);
|
|
98
|
-
}));
|
|
99
81
|
});
|
|
100
82
|
//# sourceMappingURL=icc-time-table-x-api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icc-time-table-x-api.js","sourceRoot":"","sources":["../../../test/icc-x-api/icc-time-table-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4BAAyB;AAEzB,iCAA8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"icc-time-table-x-api.js","sourceRoot":"","sources":["../../../test/icc-x-api/icc-time-table-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4BAAyB;AAEzB,iCAA8B;AAC9B,oDAAyG;AACzG,+CAA8D;AAC9D,IAAO,OAAO,GAAG,sBAAS,CAAC,OAAO,CAAA;AAElC,mCAAmC;AACnC,6DAAyD;AACzD,mDAA+C;AAC/C,qEAAiE;AACjE,qEAAiE;AACjE,+BAA6B;AAC7B,mDAAmE;AAGnE,IAAA,4BAAe,EAAC,KAAK,CAAC,CAAA;AACtB,IAAI,GAAa,CAAA;AAEjB,SAAe,oBAAoB,CAAC,YAA6B,EAAE,IAAU;;QAC3E,OAAO,IAAI,qBAAS,CAAC;YACjB,EAAE,EAAE,IAAA,mBAAU,GAAE;YAChB,IAAI,EAAE;gBACJ,IAAI,WAAI,CAAC;oBACP,EAAE,EAAE,iBAAiB;oBACrB,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,OAAO;oBACb,OAAO,EAAE,GAAG;iBACb,CAAC;aACH;YACD,IAAI,EAAE,gBAAgB;YACtB,SAAS,EAAE,WAAW;YACtB,OAAO,EAAE,WAAW;YACpB,KAAK,EAAE;gBACL,IAAI,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CAAC,CAAA;QAC3D,IAAA,aAAM,EAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,CAAA;QACrE,IAAA,aAAM,EAAC,gBAAgB,CAAC,KAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QACnD,IAAA,aAAM,EACJ,MAAM,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,wCAA4B,CAAC,SAAS,EAAE,EAAE,SAAS,CAAC,CAC7H,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QACnB,IAAA,aAAM,EAAC,MAAM,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,wCAA4B,CAAC,SAAS,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QACjJ,IAAA,aAAM,EACJ,MAAM,SAAS,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,wCAA4B,CAAC,SAAS,EAAE,EAAE,SAAS,CAAC,CAC9H,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IACrB,CAAC,CAAA,CAAC,CAAA;AAEJ,CAAC,CAAC,CAAA","sourcesContent":["import 'isomorphic-fetch'\n\nimport { before } from 'mocha'\nimport { getEnvironmentInitializer, hcp1Username, setLocalStorage, TestUtils } from '../utils/test_utils'\nimport { EntityWithDelegationTypeName } from '../../icc-x-api'\nimport initApi = TestUtils.initApi\nimport { User } from '../../icc-api/model/User'\nimport { randomUUID } from 'crypto'\nimport { TimeTable } from '../../icc-api/model/TimeTable'\nimport { Code } from '../../icc-api/model/Code'\nimport { TimeTableItem } from '../../icc-api/model/TimeTableItem'\nimport { TimeTableHour } from '../../icc-api/model/TimeTableHour'\nimport { expect } from 'chai'\nimport { getEnvVariables, TestVars } from '@icure/test-setup/types'\nimport {IccTimeTableApi} from \"../../icc-api\"\n\nsetLocalStorage(fetch)\nlet env: TestVars\n\nasync function instanceTimeTableFor(timeTableApi: IccTimeTableApi, user: User): Promise<TimeTable> {\n return new TimeTable({\n id: randomUUID(),\n tags: [\n new Code({\n id: 'ICURE|MY-CODE|1',\n code: 'MY-CODE',\n type: 'ICURE',\n version: '1',\n }),\n ],\n name: 'Main TimeTable',\n startTime: 20221101000,\n endTime: 20221128000,\n items: [\n new TimeTableItem({\n id: randomUUID(),\n rrule: 'RRULE:FREQ=WEEKLY;BYDAY=TU;COUNT=10',\n days: ['monday', 'tuesday', 'thursday'],\n hours: [\n new TimeTableHour({\n startHour: 1000,\n endHour: 1800,\n }),\n ],\n }),\n ],\n })\n}\n\ndescribe('icc-x-time-table-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('Create TimeTable Success', async () => {\n // Given\n const { userApi: userApiForHcp, timetableApi: timeTableApiForHcp, cryptoApi } = await initApi(env, hcp1Username)\n\n const hcpUser = await userApiForHcp.getCurrentUser()\n\n const baseTimeTable = await instanceTimeTableFor(timeTableApiForHcp, hcpUser)\n\n // When\n const createdTimeTable = await timeTableApiForHcp.createTimeTable(baseTimeTable)\n\n // Then\n expect(createdTimeTable.id).to.equals(baseTimeTable.id)\n expect(createdTimeTable.name).to.equals(baseTimeTable.name)\n expect(createdTimeTable.startTime).to.equals(baseTimeTable.startTime)\n expect(createdTimeTable.items!.length).to.equals(1)\n expect(\n await cryptoApi.xapi.encryptionKeysOf({ entity: createdTimeTable, type: EntityWithDelegationTypeName.TimeTable }, undefined)\n ).to.have.length(1)\n expect(await cryptoApi.xapi.secretIdsOf({ entity: createdTimeTable, type: EntityWithDelegationTypeName.TimeTable }, undefined)).to.have.length(0)\n expect(\n await cryptoApi.xapi.owningEntityIdsOf({ entity: createdTimeTable, type: EntityWithDelegationTypeName.TimeTable }, undefined)\n ).to.have.length(0)\n })\n\n})\n"]}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { IccTimeTableApi } from '../icc-api';
|
|
2
|
-
import { User } from '../icc-api/model/User';
|
|
3
|
-
import { TimeTable } from '../icc-api/model/TimeTable';
|
|
4
|
-
import { IccCryptoXApi } from './icc-crypto-x-api';
|
|
5
|
-
import { IccDataOwnerXApi } from './icc-data-owner-x-api';
|
|
6
|
-
import * as models from '../icc-api/model/models';
|
|
7
|
-
import { AuthenticationProvider } from './auth/AuthenticationProvider';
|
|
8
|
-
import { ShareMetadataBehaviour } from './crypto/ShareMetadataBehaviour';
|
|
9
|
-
import { ShareResult } from './utils/ShareResult';
|
|
10
|
-
import { EntityShareRequest } from '../icc-api/model/requests/EntityShareRequest';
|
|
11
|
-
import RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum;
|
|
12
|
-
import { SecureDelegation } from '../icc-api/model/SecureDelegation';
|
|
13
|
-
import AccessLevelEnum = SecureDelegation.AccessLevelEnum;
|
|
14
|
-
import { XHR } from '../icc-api/api/XHR';
|
|
15
|
-
import { EncryptedEntityXApi } from './basexapi/EncryptedEntityXApi';
|
|
16
|
-
export declare class IccTimeTableXApi extends IccTimeTableApi implements EncryptedEntityXApi<models.TimeTable> {
|
|
17
|
-
private readonly crypto;
|
|
18
|
-
private readonly dataOwnerApi;
|
|
19
|
-
private readonly autofillAuthor;
|
|
20
|
-
i18n: any;
|
|
21
|
-
get headers(): Promise<Array<XHR.Header>>;
|
|
22
|
-
constructor(host: string, headers: {
|
|
23
|
-
[key: string]: string;
|
|
24
|
-
}, crypto: IccCryptoXApi, dataOwnerApi: IccDataOwnerXApi, autofillAuthor: boolean, authenticationProvider?: AuthenticationProvider, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
|
|
25
|
-
/**
|
|
26
|
-
* Creates a new instance of timetable with initialised encryption metadata (not in the database).
|
|
27
|
-
* @param user the current user.
|
|
28
|
-
* @param tt initialised data for the timetable. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify
|
|
29
|
-
* other kinds of data or overwrite generated metadata with this. You can't specify encryption metadata.
|
|
30
|
-
* @param options optional parameters:
|
|
31
|
-
* - additionalDelegates: delegates which will have access to the entity in addition to the current data owner and delegates from the
|
|
32
|
-
* auto-delegations. Must be an object which associates each data owner id with the access level to give to that data owner. May overlap with
|
|
33
|
-
* auto-delegations, in such case the access level specified here will be used.
|
|
34
|
-
* - ignoreAutoDelegations: if true the data won't be shared with the autodelegations of the user, but only with additional delegates
|
|
35
|
-
* - alternateRootDelegation: by default a new entity is created with a root delegation from self to self. In keyless mode this is not possible,
|
|
36
|
-
* and instead the root delegation will be from self to another. You have to specify which delegate will be part of the root delegation.
|
|
37
|
-
* @return a new instance of timetable.
|
|
38
|
-
*/
|
|
39
|
-
newInstance(user: User, tt: TimeTable, options?: {
|
|
40
|
-
additionalDelegates?: {
|
|
41
|
-
[dataOwnerId: string]: AccessLevelEnum;
|
|
42
|
-
};
|
|
43
|
-
ignoreAutoDelegations?: boolean;
|
|
44
|
-
alternateRootDelegation?: string;
|
|
45
|
-
}): Promise<TimeTable>;
|
|
46
|
-
/**
|
|
47
|
-
* @return if the logged data owner has write access to the content of the given time table
|
|
48
|
-
*/
|
|
49
|
-
hasWriteAccess(timeTable: models.TimeTable): Promise<boolean>;
|
|
50
|
-
/**
|
|
51
|
-
* Share an existing time table with other data owners, allowing them to access the non-encrypted data of the time table and optionally also
|
|
52
|
-
* the encrypted content, with read-only or read-write permissions.
|
|
53
|
-
* @param delegateId the id of the data owner which will be granted access to the time table.
|
|
54
|
-
* @param timeTable the time table to share.
|
|
55
|
-
* @param options optional parameters to customize the sharing behaviour:
|
|
56
|
-
* - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared
|
|
57
|
-
* - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted
|
|
58
|
-
* content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a
|
|
59
|
-
* time table does not have encrypted content.
|
|
60
|
-
* - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.
|
|
61
|
-
* @return the updated entity
|
|
62
|
-
*/
|
|
63
|
-
shareWith(delegateId: string, timeTable: models.TimeTable, options?: {
|
|
64
|
-
shareSecretIds?: string[];
|
|
65
|
-
requestedPermissions?: RequestedPermissionEnum;
|
|
66
|
-
shareEncryptionKey?: ShareMetadataBehaviour;
|
|
67
|
-
}): Promise<models.TimeTable>;
|
|
68
|
-
/**
|
|
69
|
-
* Share an existing time table with other data owners, allowing them to access the non-encrypted data of the time table and optionally also
|
|
70
|
-
* the encrypted content, with read-only or read-write permissions.
|
|
71
|
-
* @param timeTable the time table to share.
|
|
72
|
-
* @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:
|
|
73
|
-
* - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared
|
|
74
|
-
* - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted
|
|
75
|
-
* content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a
|
|
76
|
-
* time table does not have encrypted content.
|
|
77
|
-
* - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.
|
|
78
|
-
* @return the updated entity
|
|
79
|
-
*/
|
|
80
|
-
shareWithMany(timeTable: models.TimeTable, delegates: {
|
|
81
|
-
[delegateId: string]: {
|
|
82
|
-
shareSecretIds?: string[];
|
|
83
|
-
requestedPermissions?: RequestedPermissionEnum;
|
|
84
|
-
shareEncryptionKey?: ShareMetadataBehaviour;
|
|
85
|
-
};
|
|
86
|
-
}): Promise<models.TimeTable>;
|
|
87
|
-
/**
|
|
88
|
-
* Share an existing time table with other data owners, allowing them to access the non-encrypted data of the time table and optionally also
|
|
89
|
-
* the encrypted content, with read-only or read-write permissions.
|
|
90
|
-
* @param timeTable the time table to share.
|
|
91
|
-
* @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:
|
|
92
|
-
* - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared
|
|
93
|
-
* - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted
|
|
94
|
-
* content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a
|
|
95
|
-
* time table does not have encrypted content.
|
|
96
|
-
* - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.
|
|
97
|
-
* @return a promise which will contain the result of the operation: the updated entity if the operation was successful or details of the error if
|
|
98
|
-
* the operation failed.
|
|
99
|
-
*/
|
|
100
|
-
tryShareWithMany(timeTable: models.TimeTable, delegates: {
|
|
101
|
-
[delegateId: string]: {
|
|
102
|
-
shareSecretIds?: string[];
|
|
103
|
-
requestedPermissions?: RequestedPermissionEnum;
|
|
104
|
-
shareEncryptionKey?: ShareMetadataBehaviour;
|
|
105
|
-
};
|
|
106
|
-
}): Promise<ShareResult<models.TimeTable>>;
|
|
107
|
-
getDataOwnersWithAccessTo(entity: models.TimeTable): Promise<{
|
|
108
|
-
permissionsByDataOwnerId: {
|
|
109
|
-
[p: string]: AccessLevelEnum;
|
|
110
|
-
};
|
|
111
|
-
hasUnknownAnonymousDataOwners: boolean;
|
|
112
|
-
}>;
|
|
113
|
-
getEncryptionKeysOf(entity: models.TimeTable): Promise<string[]>;
|
|
114
|
-
createDelegationDeAnonymizationMetadata(entity: models.TimeTable, delegates: string[]): Promise<void>;
|
|
115
|
-
}
|
|
@@ -1,150 +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
|
-
exports.IccTimeTableXApi = void 0;
|
|
13
|
-
const i18n = require("./rsrc/contact.i18n");
|
|
14
|
-
const icc_api_1 = require("../icc-api");
|
|
15
|
-
const models = require("../icc-api/model/models");
|
|
16
|
-
const AuthenticationProvider_1 = require("./auth/AuthenticationProvider");
|
|
17
|
-
const ShareMetadataBehaviour_1 = require("./crypto/ShareMetadataBehaviour");
|
|
18
|
-
const SecureDelegation_1 = require("../icc-api/model/SecureDelegation");
|
|
19
|
-
var AccessLevelEnum = SecureDelegation_1.SecureDelegation.AccessLevelEnum;
|
|
20
|
-
const utils_1 = require("./utils");
|
|
21
|
-
class IccTimeTableXApi extends icc_api_1.IccTimeTableApi {
|
|
22
|
-
get headers() {
|
|
23
|
-
return super.headers.then((h) => this.crypto.accessControlKeysHeaders.addAccessControlKeysHeaders(h, utils_1.EntityWithDelegationTypeName.TimeTable));
|
|
24
|
-
}
|
|
25
|
-
constructor(host, headers, crypto, dataOwnerApi, autofillAuthor, authenticationProvider = new AuthenticationProvider_1.NoAuthenticationProvider(), fetchImpl = typeof window !== 'undefined'
|
|
26
|
-
? window.fetch
|
|
27
|
-
: typeof self !== 'undefined'
|
|
28
|
-
? self.fetch
|
|
29
|
-
: fetch) {
|
|
30
|
-
super(host, headers, authenticationProvider, fetchImpl);
|
|
31
|
-
this.crypto = crypto;
|
|
32
|
-
this.dataOwnerApi = dataOwnerApi;
|
|
33
|
-
this.autofillAuthor = autofillAuthor;
|
|
34
|
-
this.i18n = i18n;
|
|
35
|
-
this.crypto = crypto;
|
|
36
|
-
this.dataOwnerApi = dataOwnerApi;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Creates a new instance of timetable with initialised encryption metadata (not in the database).
|
|
40
|
-
* @param user the current user.
|
|
41
|
-
* @param tt initialised data for the timetable. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify
|
|
42
|
-
* other kinds of data or overwrite generated metadata with this. You can't specify encryption metadata.
|
|
43
|
-
* @param options optional parameters:
|
|
44
|
-
* - additionalDelegates: delegates which will have access to the entity in addition to the current data owner and delegates from the
|
|
45
|
-
* auto-delegations. Must be an object which associates each data owner id with the access level to give to that data owner. May overlap with
|
|
46
|
-
* auto-delegations, in such case the access level specified here will be used.
|
|
47
|
-
* - ignoreAutoDelegations: if true the data won't be shared with the autodelegations of the user, but only with additional delegates
|
|
48
|
-
* - alternateRootDelegation: by default a new entity is created with a root delegation from self to self. In keyless mode this is not possible,
|
|
49
|
-
* and instead the root delegation will be from self to another. You have to specify which delegate will be part of the root delegation.
|
|
50
|
-
* @return a new instance of timetable.
|
|
51
|
-
*/
|
|
52
|
-
newInstance(user_1, tt_1) {
|
|
53
|
-
return __awaiter(this, arguments, void 0, function* (user, tt, options = {}) {
|
|
54
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
55
|
-
const timeTable = Object.assign(Object.assign({}, (tt !== null && tt !== void 0 ? tt : {})), { id: (_a = tt === null || tt === void 0 ? void 0 : tt.id) !== null && _a !== void 0 ? _a : this.crypto.primitives.randomUuid(), created: (_b = tt === null || tt === void 0 ? void 0 : tt.created) !== null && _b !== void 0 ? _b : new Date().getTime(), modified: (_c = tt === null || tt === void 0 ? void 0 : tt.modified) !== null && _c !== void 0 ? _c : new Date().getTime(), responsible: (_d = tt === null || tt === void 0 ? void 0 : tt.responsible) !== null && _d !== void 0 ? _d : (this.autofillAuthor ? this.dataOwnerApi.getDataOwnerIdOf(user) : undefined), author: (_e = tt === null || tt === void 0 ? void 0 : tt.author) !== null && _e !== void 0 ? _e : (this.autofillAuthor ? user.id : undefined), codes: (_f = tt === null || tt === void 0 ? void 0 : tt.codes) !== null && _f !== void 0 ? _f : [], tags: (_g = tt === null || tt === void 0 ? void 0 : tt.tags) !== null && _g !== void 0 ? _g : [] });
|
|
56
|
-
const extraDelegations = Object.assign(Object.assign({}, (options.ignoreAutoDelegations == true
|
|
57
|
-
? {}
|
|
58
|
-
: Object.fromEntries([...((_j = (_h = user.autoDelegations) === null || _h === void 0 ? void 0 : _h.all) !== null && _j !== void 0 ? _j : []), ...((_l = (_k = user.autoDelegations) === null || _k === void 0 ? void 0 : _k.administrativeData) !== null && _l !== void 0 ? _l : [])].map((d) => [d, AccessLevelEnum.WRITE])))), ((_m = options === null || options === void 0 ? void 0 : options.additionalDelegates) !== null && _m !== void 0 ? _m : {}));
|
|
59
|
-
return new models.TimeTable(yield this.crypto.xapi
|
|
60
|
-
.entityWithInitialisedEncryptedMetadata(timeTable, utils_1.EntityWithDelegationTypeName.TimeTable, undefined, undefined, true, extraDelegations, options.alternateRootDelegation)
|
|
61
|
-
.then((x) => x.updatedEntity));
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* @return if the logged data owner has write access to the content of the given time table
|
|
66
|
-
*/
|
|
67
|
-
hasWriteAccess(timeTable) {
|
|
68
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
-
return this.crypto.xapi.hasWriteAccess({ entity: timeTable, type: utils_1.EntityWithDelegationTypeName.TimeTable });
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Share an existing time table with other data owners, allowing them to access the non-encrypted data of the time table and optionally also
|
|
74
|
-
* the encrypted content, with read-only or read-write permissions.
|
|
75
|
-
* @param delegateId the id of the data owner which will be granted access to the time table.
|
|
76
|
-
* @param timeTable the time table to share.
|
|
77
|
-
* @param options optional parameters to customize the sharing behaviour:
|
|
78
|
-
* - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared
|
|
79
|
-
* - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted
|
|
80
|
-
* content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a
|
|
81
|
-
* time table does not have encrypted content.
|
|
82
|
-
* - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.
|
|
83
|
-
* @return the updated entity
|
|
84
|
-
*/
|
|
85
|
-
shareWith(delegateId_1, timeTable_1) {
|
|
86
|
-
return __awaiter(this, arguments, void 0, function* (delegateId, timeTable, options = {}) {
|
|
87
|
-
return this.shareWithMany(timeTable, { [delegateId]: options });
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Share an existing time table with other data owners, allowing them to access the non-encrypted data of the time table and optionally also
|
|
92
|
-
* the encrypted content, with read-only or read-write permissions.
|
|
93
|
-
* @param timeTable the time table to share.
|
|
94
|
-
* @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:
|
|
95
|
-
* - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared
|
|
96
|
-
* - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted
|
|
97
|
-
* content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a
|
|
98
|
-
* time table does not have encrypted content.
|
|
99
|
-
* - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.
|
|
100
|
-
* @return the updated entity
|
|
101
|
-
*/
|
|
102
|
-
shareWithMany(timeTable, delegates) {
|
|
103
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
-
return (yield this.tryShareWithMany(timeTable, delegates)).updatedEntityOrThrow;
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Share an existing time table with other data owners, allowing them to access the non-encrypted data of the time table and optionally also
|
|
109
|
-
* the encrypted content, with read-only or read-write permissions.
|
|
110
|
-
* @param timeTable the time table to share.
|
|
111
|
-
* @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:
|
|
112
|
-
* - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared
|
|
113
|
-
* - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted
|
|
114
|
-
* content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a
|
|
115
|
-
* time table does not have encrypted content.
|
|
116
|
-
* - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.
|
|
117
|
-
* @return a promise which will contain the result of the operation: the updated entity if the operation was successful or details of the error if
|
|
118
|
-
* the operation failed.
|
|
119
|
-
*/
|
|
120
|
-
tryShareWithMany(timeTable, delegates) {
|
|
121
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
-
// All entities should have an encryption key.
|
|
123
|
-
const entityWithEncryptionKey = yield this.crypto.xapi.ensureEncryptionKeysInitialised(timeTable, utils_1.EntityWithDelegationTypeName.TimeTable);
|
|
124
|
-
const updatedEntity = entityWithEncryptionKey ? yield this.modifyTimeTable(entityWithEncryptionKey) : timeTable;
|
|
125
|
-
return this.crypto.xapi.simpleShareOrUpdateEncryptedEntityMetadata({
|
|
126
|
-
entity: updatedEntity,
|
|
127
|
-
type: utils_1.EntityWithDelegationTypeName.TimeTable,
|
|
128
|
-
}, Object.fromEntries(Object.entries(delegates).map(([delegateId, options]) => [
|
|
129
|
-
delegateId,
|
|
130
|
-
{
|
|
131
|
-
requestedPermissions: options.requestedPermissions,
|
|
132
|
-
shareEncryptionKeys: options.shareEncryptionKey,
|
|
133
|
-
shareOwningEntityIds: ShareMetadataBehaviour_1.ShareMetadataBehaviour.NEVER,
|
|
134
|
-
shareSecretIds: options.shareSecretIds,
|
|
135
|
-
},
|
|
136
|
-
])), (x) => this.bulkShareTimeTable(x));
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
getDataOwnersWithAccessTo(entity) {
|
|
140
|
-
return this.crypto.delegationsDeAnonymization.getDataOwnersWithAccessTo({ entity, type: utils_1.EntityWithDelegationTypeName.TimeTable });
|
|
141
|
-
}
|
|
142
|
-
getEncryptionKeysOf(entity) {
|
|
143
|
-
return this.crypto.xapi.encryptionKeysOf({ entity, type: utils_1.EntityWithDelegationTypeName.TimeTable }, undefined);
|
|
144
|
-
}
|
|
145
|
-
createDelegationDeAnonymizationMetadata(entity, delegates) {
|
|
146
|
-
return this.crypto.delegationsDeAnonymization.createOrUpdateDeAnonymizationInfo({ entity, type: utils_1.EntityWithDelegationTypeName.TimeTable }, delegates);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
exports.IccTimeTableXApi = IccTimeTableXApi;
|
|
150
|
-
//# sourceMappingURL=icc-time-table-x-api.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAG3C,wCAA4C;AAK5C,kDAAiD;AACjD,0EAAgG;AAChG,4EAAwE;AAIxE,wEAAoE;AACpE,IAAO,eAAe,GAAG,mCAAgB,CAAC,eAAe,CAAA;AAIzD,mCAAsD;AAEtD,MAAa,gBAAiB,SAAQ,yBAAe;IAGnD,IAAI,OAAO;QACT,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,2BAA2B,CAAC,C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BACV;oBACE,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;oBAClD,mBAAmB,EAAE,OAAO,CAAC,kBAAkB;oBAC/C,oBAAoB,EAAE,+CAAsB,CAAC,KAAK;oBAClD,cAAc,EAAE,OAAO,CAAC,cAAc;iBACvC;aACF,CAAC,CACH,EACD,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAClC,CAAA;QACH,CAAC;KAAA;IAED,yBAAyB,CACvB,MAAwB;QAExB,OAAO,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,yBAAyB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,oCAA4B,CAAC,SAAS,EAAE,CAAC,CAAA;IACnI,CAAC;IAED,mBAAmB,CAAC,MAAwB;QAC1C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,oCAA4B,CAAC,SAAS,EAAE,EAAE,SAAS,CAAC,CAAA;IAC/G,CAAC;IAED,uCAAuC,CAAC,MAAwB,EAAE,SAAmB;QACnF,OAAO,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,iCAAiC,CAC7E,EAAE,MAAM,EAAE,IAAI,EAAE,oCAA4B,CAAC,SAAS,EAAE,EACxD,SAAS,CACV,CAAA;IACH,CAAC;CACF;AA1MD,4CA0MC","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 * as models from '../icc-api/model/models'\nimport { AuthenticationProvider, NoAuthenticationProvider } from './auth/AuthenticationProvider'\nimport { ShareMetadataBehaviour } from './crypto/ShareMetadataBehaviour'\nimport { ShareResult } from './utils/ShareResult'\nimport { EntityShareRequest } from '../icc-api/model/requests/EntityShareRequest'\nimport RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum\nimport { SecureDelegation } from '../icc-api/model/SecureDelegation'\nimport AccessLevelEnum = SecureDelegation.AccessLevelEnum\nimport { XHR } from '../icc-api/api/XHR'\nimport { EncryptedEntityXApi } from './basexapi/EncryptedEntityXApi'\nimport { MaintenanceTask } from '../icc-api/model/models'\nimport { EntityWithDelegationTypeName } from './utils'\n\nexport class IccTimeTableXApi extends IccTimeTableApi implements EncryptedEntityXApi<models.TimeTable> {\n i18n: any = i18n\n\n get headers(): Promise<Array<XHR.Header>> {\n return super.headers.then((h) => this.crypto.accessControlKeysHeaders.addAccessControlKeysHeaders(h, EntityWithDelegationTypeName.TimeTable))\n }\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n private readonly crypto: IccCryptoXApi,\n private readonly dataOwnerApi: IccDataOwnerXApi,\n private readonly autofillAuthor: boolean,\n authenticationProvider: AuthenticationProvider = new NoAuthenticationProvider(),\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 /**\n * Creates a new instance of timetable with initialised encryption metadata (not in the database).\n * @param user the current user.\n * @param tt initialised data for the timetable. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify\n * other kinds of data or overwrite generated metadata with this. You can't specify encryption metadata.\n * @param options optional parameters:\n * - additionalDelegates: delegates which will have access to the entity in addition to the current data owner and delegates from the\n * auto-delegations. Must be an object which associates each data owner id with the access level to give to that data owner. May overlap with\n * auto-delegations, in such case the access level specified here will be used.\n * - ignoreAutoDelegations: if true the data won't be shared with the autodelegations of the user, but only with additional delegates\n * - alternateRootDelegation: by default a new entity is created with a root delegation from self to self. In keyless mode this is not possible,\n * and instead the root delegation will be from self to another. You have to specify which delegate will be part of the root delegation.\n * @return a new instance of timetable.\n */\n async newInstance(\n user: User,\n tt: TimeTable,\n options: {\n additionalDelegates?: { [dataOwnerId: string]: AccessLevelEnum }\n ignoreAutoDelegations?: boolean\n alternateRootDelegation?: string\n } = {}\n ) {\n const timeTable: TimeTable = {\n ...(tt ?? {}),\n id: tt?.id ?? this.crypto.primitives.randomUuid(),\n created: tt?.created ?? new Date().getTime(),\n modified: tt?.modified ?? new Date().getTime(),\n responsible: tt?.responsible ?? (this.autofillAuthor ? this.dataOwnerApi.getDataOwnerIdOf(user) : undefined),\n author: tt?.author ?? (this.autofillAuthor ? user.id : undefined),\n codes: tt?.codes ?? [],\n tags: tt?.tags ?? [],\n }\n\n const extraDelegations = {\n ...(options.ignoreAutoDelegations == true\n ? {}\n : Object.fromEntries(\n [...(user.autoDelegations?.all ?? []), ...(user.autoDelegations?.administrativeData ?? [])].map((d) => [d, AccessLevelEnum.WRITE])\n )),\n ...(options?.additionalDelegates ?? {}),\n }\n\n return new models.TimeTable(\n await this.crypto.xapi\n .entityWithInitialisedEncryptedMetadata(\n timeTable,\n EntityWithDelegationTypeName.TimeTable,\n undefined,\n undefined,\n true,\n extraDelegations,\n options.alternateRootDelegation\n )\n .then((x) => x.updatedEntity)\n )\n }\n\n /**\n * @return if the logged data owner has write access to the content of the given time table\n */\n async hasWriteAccess(timeTable: models.TimeTable): Promise<boolean> {\n return this.crypto.xapi.hasWriteAccess({ entity: timeTable, type: EntityWithDelegationTypeName.TimeTable })\n }\n\n /**\n * Share an existing time table with other data owners, allowing them to access the non-encrypted data of the time table and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param delegateId the id of the data owner which will be granted access to the time table.\n * @param timeTable the time table to share.\n * @param options optional parameters to customize the sharing behaviour:\n * - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * time table does not have encrypted content.\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity\n */\n async shareWith(\n delegateId: string,\n timeTable: models.TimeTable,\n options: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n } = {}\n ): Promise<models.TimeTable> {\n return this.shareWithMany(timeTable, { [delegateId]: options })\n }\n\n /**\n * Share an existing time table with other data owners, allowing them to access the non-encrypted data of the time table and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param timeTable the time table to share.\n * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:\n * - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * time table does not have encrypted content.\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity\n */\n async shareWithMany(\n timeTable: models.TimeTable,\n delegates: {\n [delegateId: string]: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<models.TimeTable> {\n return (await this.tryShareWithMany(timeTable, delegates)).updatedEntityOrThrow\n }\n\n /**\n * Share an existing time table with other data owners, allowing them to access the non-encrypted data of the time table and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param timeTable the time table to share.\n * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:\n * - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * time table does not have encrypted content.\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return a promise which will contain the result of the operation: the updated entity if the operation was successful or details of the error if\n * the operation failed.\n */\n async tryShareWithMany(\n timeTable: models.TimeTable,\n delegates: {\n [delegateId: string]: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<ShareResult<models.TimeTable>> {\n // All entities should have an encryption key.\n const entityWithEncryptionKey = await this.crypto.xapi.ensureEncryptionKeysInitialised(timeTable, EntityWithDelegationTypeName.TimeTable)\n const updatedEntity = entityWithEncryptionKey ? await this.modifyTimeTable(entityWithEncryptionKey) : timeTable\n return this.crypto.xapi.simpleShareOrUpdateEncryptedEntityMetadata(\n {\n entity: updatedEntity,\n type: EntityWithDelegationTypeName.TimeTable,\n },\n Object.fromEntries(\n Object.entries(delegates).map(([delegateId, options]) => [\n delegateId,\n {\n requestedPermissions: options.requestedPermissions,\n shareEncryptionKeys: options.shareEncryptionKey,\n shareOwningEntityIds: ShareMetadataBehaviour.NEVER,\n shareSecretIds: options.shareSecretIds,\n },\n ])\n ),\n (x) => this.bulkShareTimeTable(x)\n )\n }\n\n getDataOwnersWithAccessTo(\n entity: models.TimeTable\n ): Promise<{ permissionsByDataOwnerId: { [p: string]: AccessLevelEnum }; hasUnknownAnonymousDataOwners: boolean }> {\n return this.crypto.delegationsDeAnonymization.getDataOwnersWithAccessTo({ entity, type: EntityWithDelegationTypeName.TimeTable })\n }\n\n getEncryptionKeysOf(entity: models.TimeTable): Promise<string[]> {\n return this.crypto.xapi.encryptionKeysOf({ entity, type: EntityWithDelegationTypeName.TimeTable }, undefined)\n }\n\n createDelegationDeAnonymizationMetadata(entity: models.TimeTable, delegates: string[]): Promise<void> {\n return this.crypto.delegationsDeAnonymization.createOrUpdateDeAnonymizationInfo(\n { entity, type: EntityWithDelegationTypeName.TimeTable },\n delegates\n )\n }\n}\n"]}
|