@icure/api 8.0.57 → 8.0.58
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.
|
@@ -79,7 +79,7 @@ export declare class IccDocumentApi {
|
|
|
79
79
|
* @return a promise that will resolve in a PaginatedListDocument.
|
|
80
80
|
*/
|
|
81
81
|
findDocumentsByHCPartyPatientForeignKey(hcPartyId: string, secretFKey: string, startKey?: string, startDocumentId?: string, limit?: number): Promise<PaginatedListDocument>;
|
|
82
|
-
findDocumentIdsByDataOwnerSecretForeignKey(dataOwnerId: string, secretForeignKeys: string[], startDate?: number, endDate?: number, descending?: boolean): Promise<
|
|
82
|
+
findDocumentIdsByDataOwnerSecretForeignKey(dataOwnerId: string, secretForeignKeys: string[], startDate?: number, endDate?: number, descending?: boolean): Promise<string[]>;
|
|
83
83
|
/**
|
|
84
84
|
* Keys must be delimited by commas.
|
|
85
85
|
* @summary List documents with no delegation
|
|
@@ -183,7 +183,7 @@ class IccDocumentApi {
|
|
|
183
183
|
let headers = yield this.headers;
|
|
184
184
|
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
185
185
|
return XHR_1.XHR.sendCommand('POST', _url, headers, { ids: secretForeignKeys }, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
186
|
-
.then((doc) =>
|
|
186
|
+
.then((doc) => doc.body.map((it) => JSON.parse(JSON.stringify(it))))
|
|
187
187
|
.catch((err) => this.handleError(err));
|
|
188
188
|
});
|
|
189
189
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IccDocumentApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccDocumentApi.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAC3B,0DAAsD;AACtD,gDAA4C;AAE5C,kDAA8C;AAC9C,wFAA8G;AAC9G,qDAAiD;AAEjD,mFAA+E;AAE/E,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,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,oCAAoC,GAAG,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;YAC7F,IAAI,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAA;YAChC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,cAAc,CAAC,CAAC,MAAM,CAAC,IAAI,SAAG,CAAC,MAAM,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC,CAAA;YACvH,OAAO,SAAG,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,sBAAsB,CAAC,cAAc,EAAE,CAAC;iBAC3H,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAE,GAAG,CAAC,IAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,6CAAqB,CAAW,CAAC,EAAE,mBAAQ,CAAC,CAAC,CAAC;iBACrG,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;QAC1C,CAAC;KAAA;CACF;AAtgBD,wCAsgBC","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\nimport { XHR } from './XHR'\nimport { DocIdentifier } from '../model/DocIdentifier'\nimport { Document } from '../model/Document'\nimport { IcureStub } from '../model/IcureStub'\nimport { ListOfIds } from '../model/ListOfIds'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\nimport { iccRestApiPath } from './IccRestApiPath'\nimport { EntityShareOrMetadataUpdateRequest } from '../model/requests/EntityShareOrMetadataUpdateRequest'\nimport { EntityBulkShareResult } from '../model/requests/EntityBulkShareResult'\nimport { BulkShareOrUpdateMetadataParams } from '../model/requests/BulkShareOrUpdateMetadataParams'\nimport { PaginatedListDocument } from '../model/PaginatedListDocument'\n\nexport class IccDocumentApi {\n host: string\n _headers: Array<XHR.Header>\n authenticationProvider: AuthenticationProvider\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n get headers(): Promise<Array<XHR.Header>> {\n return Promise.resolve(this._headers)\n }\n\n constructor(\n host: string,\n headers: any,\n authenticationProvider?: AuthenticationProvider,\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n ) {\n this.host = iccRestApiPath(host)\n this._headers = Object.keys(headers).map((k) => new XHR.Header(k, headers[k]))\n this.authenticationProvider = !!authenticationProvider ? authenticationProvider : new NoAuthenticationProvider()\n this.fetchImpl = fetchImpl\n }\n\n setHeaders(h: Array<XHR.Header>) {\n this._headers = h\n }\n\n handleError(e: XHR.XHRError): never {\n throw e\n }\n\n /**\n * Creates a document and returns an instance of created document afterward\n * @summary Create a document\n * @param body\n */\n async createDocument(body?: Document): Promise<Document> {\n const _url = this.host + `/document` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Document(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Deletes a document's attachment and returns the modified document instance afterward\n * @summary Delete a document's attachment\n * @param documentId\n */\n async deleteAttachment(documentId: string): Promise<Document> {\n let _body = null\n\n const _url = this.host + `/document/${encodeURIComponent(String(documentId))}/attachment` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Document(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Deletes a batch of documents and returns the list of deleted document ids.\n *\n * @param documentIds a ListOfIds containing the ids of the documents to delete.\n * @return a Promise that will resolve in an array of DocIdentifier of the successfully deleted documents.\n */\n async deleteDocuments(documentIds: ListOfIds): Promise<Array<DocIdentifier>> {\n const headers = (await this.headers).filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand(\n 'POST',\n this.host + `/document/delete/batch` + '?ts=' + new Date().getTime(),\n headers,\n documentIds,\n this.fetchImpl,\n undefined,\n this.authenticationProvider.getAuthService()\n )\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocIdentifier(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Deletes a single document by id.\n *\n * @param documentId the id of the document to delete.\n * @return a DocIdentifier of the document.\n */\n async deleteDocument(documentId: string): Promise<DocIdentifier> {\n return XHR.sendCommand(\n 'DELETE',\n this.host + `/document/${encodeURIComponent(documentId)}` + '?ts=' + new Date().getTime(),\n await this.headers,\n null,\n this.fetchImpl,\n undefined,\n this.authenticationProvider.getAuthService()\n )\n .then((doc) => new DocIdentifier(doc.body))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Keys must be delimited by coma\n * @summary List documents found By type, By Healthcare Party and secret foreign keys.\n * @param documentTypeCode\n * @param hcPartyId\n * @param secretFKeys\n */\n async findByTypeHCPartyMessageSecretFKeys(documentTypeCode: string, hcPartyId: string, secretFKeys: string[]): Promise<Array<Document>> {\n const body = new ListOfIds({ ids: secretFKeys })\n const _url =\n this.host +\n `/document/byHcPartySecretForeignKeys` +\n '?ts=' +\n new Date().getTime() +\n (documentTypeCode ? '&documentTypeCode=' + encodeURIComponent(String(documentTypeCode)) : '') +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Document(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Keys must be delimited by commas.\n * @deprecated use {@link findDocumentsByHCPartyPatientForeignKey} instead.\n * @summary List documents found By Healthcare Party and secret foreign keys.\n * @param hcPartyId\n * @param secretFKeys\n */\n async findDocumentsByHCPartyPatientForeignKeys(hcPartyId: string, secretFKeys: string[]): Promise<Array<Document>> {\n const body = new ListOfIds({ ids: secretFKeys })\n const _url =\n this.host +\n `/document/byHcPartySecretForeignKeys` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Document(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary List documents found By Healthcare Party and a single secret foreign key with pagination.\n * @deprecated use {@link findDocumentIdsByDataOwnerSecretForeignKey} instead.\n * @param hcPartyId the healthcare party id.\n * @param secretFKey the secret foreign key.\n * @param startKey the startKey provided by the previous page or undefined for the first page.\n * @param startDocumentId the startDocumentId provided by the previous page or undefined for the first page.\n * @param limit the number of elements that the page should contain.\n * @return a promise that will resolve in a PaginatedListDocument.\n */\n async findDocumentsByHCPartyPatientForeignKey(\n hcPartyId: string,\n secretFKey: string,\n startKey?: string,\n startDocumentId?: string,\n limit?: number\n ): Promise<PaginatedListDocument> {\n const _url =\n this.host +\n `/document/byHcPartySecretForeignKey?ts=${new Date().getTime()}` +\n `&hcPartyId=${encodeURIComponent(hcPartyId)}` +\n `&secretFKey=${encodeURIComponent(secretFKey)}` +\n (!!startKey ? `&startKey=${encodeURIComponent(startKey)}` : '') +\n (!!startDocumentId ? `&startDocumentId=${encodeURIComponent(startDocumentId)}` : '') +\n (!!limit ? `&limit=${limit}` : '')\n const headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListDocument(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n async findDocumentIdsByDataOwnerSecretForeignKey(\n dataOwnerId: string,\n secretForeignKeys: string[],\n startDate?: number,\n endDate?: number,\n descending?: boolean\n ): Promise<PaginatedListDocument> {\n const _url =\n this.host +\n `/document/byDataOwnerPatientCreated` +\n `&dataOwnerId=${encodeURIComponent(dataOwnerId)}` +\n (!!startDate ? `&startDate=${encodeURIComponent(startDate)}` : '') +\n (!!endDate ? `&endDate=${encodeURIComponent(endDate)}` : '') +\n (!!descending ? `&descending=${descending}` : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, { ids: secretForeignKeys }, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListDocument(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Keys must be delimited by commas.\n * @summary List documents with no delegation\n * @param limit\n */\n async findWithoutDelegation(limit?: number): Promise<Array<Document>> {\n let _body = null\n\n const _url = this.host + `/document/woDelegation` + '?ts=' + new Date().getTime() + (limit ? '&limit=' + encodeURIComponent(String(limit)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Document(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns the document corresponding to the identifier passed in the request\n * @summary Get a document\n * @param documentId\n */\n async getDocument(documentId: string): Promise<Document> {\n let _body = null\n\n const _url = this.host + `/document/${encodeURIComponent(String(documentId))}` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Document(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @deprecated use getMainDocumentAttachment instead\n */\n async getDocumentAttachment(documentId: string, attachmentId: string, enckeys?: string, fileName?: string): Promise<ArrayBuffer> {\n if (enckeys) {\n throw new Error('Server-side encryption of attachment is not allowed anymore')\n }\n return this.getMainDocumentAttachment(documentId)\n }\n\n /**\n * Get the main attachment of a document\n * @param documentId id of the document\n * @return the content of the main attachment for the document (if any)\n */\n async getMainDocumentAttachment(documentId: string): Promise<ArrayBuffer> {\n let _body = null\n\n const _url = this.host + `/document/${encodeURIComponent(String(documentId))}/attachment` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => doc.body)\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Get the main attachment of a document forcing usage of `application/octet-stream` in Content-Type\n * @param documentId id of the document\n * @return the content of the main attachment for the document (if any)\n */\n async getRawMainDocumentAttachment(documentId: string): Promise<ArrayBuffer> {\n let _body = null\n\n const _url = this.host + `/document/${encodeURIComponent(String(documentId))}/attachment` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, 'application/octet-stream', this.authenticationProvider.getAuthService())\n .then((doc) => doc.body)\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns the first document corresponding to the externalUuid passed in the request\n * @summary Get a document\n * @param externalUuid\n */\n async getDocumentByExternalUuid(externalUuid: string): Promise<Document> {\n let _body = null\n\n const _url = this.host + `/document/externaluuid/${encodeURIComponent(String(externalUuid))}` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Document(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of document corresponding to the identifiers passed in the body\n * @summary Get a batch of document\n * @param body\n */\n async getDocuments(body?: ListOfIds): Promise<Array<Document>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/document/byIds` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Document(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of document corresponding to the externalUuid passed in the request\n * @summary Get all documents with externalUuid\n * @param externalUuid\n */\n async getDocumentsByExternalUuid(externalUuid: string): Promise<Array<Document>> {\n let _body = null\n\n const _url = this.host + `/document/externaluuid/${encodeURIComponent(String(externalUuid))}/all` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Document(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Updates the document and returns an instance of the modified document afterward\n * @summary Update a document\n * @param body\n */\n async modifyDocument(body?: Document): Promise<Document> {\n let _body = null\n _body = body\n\n const _url = this.host + `/document` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Document(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns the modified documents.\n * @summary Update a batch of documents\n * @param body\n */\n async modifyDocuments(body?: Array<Document>): Promise<Array<Document>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/document/batch` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Document(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Creates or updates a main attachment for a document and returns the modified document instance afterward\n * @param documentId id of the document\n * @param documentRev revision of the document\n * @param body content of the attachment (must be compatible with XHR body)\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @param dataIsEncrypted set this to true if the body you provided is containing encrypted data. This helps to have the appropriate content type\n * for the attachment. Defaults is false\n */\n async setMainDocumentAttachment(\n documentId: string,\n documentRev: string,\n body: Object,\n utis?: Array<string>,\n dataIsEncrypted?: boolean\n ): Promise<Document> {\n if (!documentRev) throw new Error('Document rev is required')\n let _body = body\n\n const _url =\n this.host +\n `/document/${encodeURIComponent(String(documentId))}/attachment` +\n '?ts=' +\n new Date().getTime() +\n '&rev=' +\n encodeURIComponent(String(documentRev)) +\n (utis ? utis.map((x) => '&utis=' + encodeURIComponent(String(x))).join('') : '') +\n (dataIsEncrypted ? '&encrypted=' + encodeURIComponent(String(dataIsEncrypted)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/octet-stream'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Document(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @deprecated use setMainDocumentAttachment instead\n */\n setDocumentAttachmentBody(documentId: string, documentRev: string, enckeys?: null, body?: Object, utis?: string[]): Promise<Document> {\n if (enckeys) {\n throw new Error('Server-side encryption of attachment is not allowed anymore')\n }\n if (!body) {\n throw new Error('body is now required.')\n }\n return this.setMainDocumentAttachment(documentId, documentRev, body, utis)\n }\n\n /**\n * @deprecated use setMainDocumentAttachment instead\n */\n setDocumentAttachment(documentId: string, documentRev: string, enckeys?: null, body?: Object, utis?: string[]): Promise<Document> {\n if (enckeys) {\n throw new Error('Server-side encryption of attachment is not allowed anymore')\n }\n if (!body) {\n throw new Error('body is now required.')\n }\n return this.setMainDocumentAttachment(documentId, documentRev, body, utis)\n }\n\n /**\n * @deprecated use setMainDocumentAttachment instead\n */\n setDocumentAttachmentMulti(attachment: ArrayBuffer, documentRev: string, documentId: string, enckeys?: null): Promise<Document> {\n if (enckeys) {\n throw new Error('Server-side encryption of attachment is not allowed anymore')\n }\n return this.setMainDocumentAttachment(documentId, documentRev, attachment)\n }\n\n /**\n * Creates or updates a secondary attachment for a document and returns the modified document instance afterward\n * @summary Creates or modifies a secondary attachment for a document\n * @param documentId id of the document to update\n * @param key Key of the secondary attachment to update\n * @param rev Revision of the latest known version of the document. If the revision does not match the current version of the document the method\n * will fail with CONFLICT status\n * @param attachment\n * @param utis an array of UTIs for the attachment. If provided and non-empty overrides existing values.\n * @param dataIsEncrypted set this to true if the body you provided is containing encrypted data. This helps to have the appropriate content type\n * for the attachment. Defaults is false\n * @return the updated document\n */\n async setSecondaryAttachment(\n documentId: string,\n key: string,\n rev: string,\n attachment: Object,\n utis?: Array<string>,\n dataIsEncrypted?: boolean\n ): Promise<Document> {\n const _url =\n this.host +\n `/document/` +\n encodeURIComponent(String(documentId)) +\n '/secondaryAttachments/' +\n encodeURIComponent(String(key)) +\n '?ts=' +\n new Date().getTime() +\n (rev ? '&rev=' + encodeURIComponent(String(rev)) : '') +\n (utis ? utis.map((x) => '&utis=' + encodeURIComponent(String(x))).join('') : '') +\n (dataIsEncrypted ? '&encrypted=' + encodeURIComponent(String(dataIsEncrypted)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/octet-stream'))\n return XHR.sendCommand('PUT', _url, headers, attachment, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Document(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Get the secondary attachment with the provided key for a document\n * @summary Retrieve a secondary attachment of a document\n * @param documentId id of the document\n * @param key Key of the secondary attachment to retrieve\n * @param fileName\n * @return the content of the attachment\n */\n async getSecondaryAttachment(documentId: string, key: string, fileName?: string): Promise<ArrayBuffer> {\n let _body = null\n\n const _url =\n this.host +\n `/document/${encodeURIComponent(String(documentId))}/secondaryAttachments/${encodeURIComponent(String(key))}` +\n '?ts=' +\n new Date().getTime() +\n (fileName ? '&fileName=' + encodeURIComponent(String(fileName)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => doc.body)\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Deletes a document's attachment and returns the modified document instance afterward\n * @summary Delete a document's attachment\n * @param documentId id of the document\n * @param key Key of the secondary attachment to delete\n * @param rev Revision of the latest known version of the document. If the revision does not match the current version of the document the method will fail with CONFLICT status\n * @return the updated document\n */\n async deleteSecondaryAttachment(documentId: string, key: string, rev: string): Promise<Document> {\n let _body = null\n\n const _url =\n this.host +\n `/document/${encodeURIComponent(String(documentId))}/secondaryAttachments/${encodeURIComponent(String(key))}` +\n '?ts=' +\n new Date().getTime() +\n (rev ? '&rev=' + encodeURIComponent(String(rev)) : '')\n let headers = await this.headers\n return XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Document(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n // TODO single request multi-attachment update\n\n /**\n * @internal this method is for internal use only and may be changed without notice\n */\n async bulkShareDocument(request: BulkShareOrUpdateMetadataParams): Promise<EntityBulkShareResult<Document>[]> {\n const _url = this.host + '/document/bulkSharedMetadataUpdate' + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('PUT', _url, headers, request, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((x) => new EntityBulkShareResult<Document>(x, Document)))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IccDocumentApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccDocumentApi.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAC3B,0DAAsD;AACtD,gDAA4C;AAE5C,kDAA8C;AAC9C,wFAA8G;AAC9G,qDAAiD;AAEjD,mFAA+E;AAE/E,0EAAsE;AAEtE,MAAa,cAAc;IAMzB,IAAI,OAAO;QACT,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACvC,CAAC;IAED,YACE,IAAY,EACZ,OAAY,EACZ,sBAA+C,EAC/C,SAAyE;QAEzE,IAAI,CAAC,IAAI,GAAG,IAAA,+BAAc,EAAC,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,SAAG,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC9E,IAAI,CAAC,sBAAsB,GAAG,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,IAAI,iDAAwB,EAAE,CAAA;QAChH,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IAED,UAAU,CAAC,CAAoB;QAC7B,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAA;IACnB,CAAC;IAED,WAAW,CAAC,CAAe;QACzB,MAAM,CAAC,CAAA;IACT,CAAC;IAED;;;;OAIG;IACG,cAAc,CAAC,IAAe;;YAClC,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AC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;QAC1C,CAAC;KAAA;CACF;AAtgBD,wCAsgBC","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\nimport { XHR } from './XHR'\nimport { DocIdentifier } from '../model/DocIdentifier'\nimport { Document } from '../model/Document'\nimport { IcureStub } from '../model/IcureStub'\nimport { ListOfIds } from '../model/ListOfIds'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\nimport { iccRestApiPath } from './IccRestApiPath'\nimport { EntityShareOrMetadataUpdateRequest } from '../model/requests/EntityShareOrMetadataUpdateRequest'\nimport { EntityBulkShareResult } from '../model/requests/EntityBulkShareResult'\nimport { BulkShareOrUpdateMetadataParams } from '../model/requests/BulkShareOrUpdateMetadataParams'\nimport { PaginatedListDocument } from '../model/PaginatedListDocument'\n\nexport class IccDocumentApi {\n host: string\n _headers: Array<XHR.Header>\n authenticationProvider: AuthenticationProvider\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n get headers(): Promise<Array<XHR.Header>> {\n return Promise.resolve(this._headers)\n }\n\n constructor(\n host: string,\n headers: any,\n authenticationProvider?: AuthenticationProvider,\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n ) {\n this.host = iccRestApiPath(host)\n this._headers = Object.keys(headers).map((k) => new XHR.Header(k, headers[k]))\n this.authenticationProvider = !!authenticationProvider ? authenticationProvider : new NoAuthenticationProvider()\n this.fetchImpl = fetchImpl\n }\n\n setHeaders(h: Array<XHR.Header>) {\n this._headers = h\n }\n\n handleError(e: XHR.XHRError): never {\n throw e\n }\n\n /**\n * Creates a document and returns an instance of created document afterward\n * @summary Create a document\n * @param body\n */\n async createDocument(body?: Document): Promise<Document> {\n const _url = this.host + `/document` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Document(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Deletes a document's attachment and returns the modified document instance afterward\n * @summary Delete a document's attachment\n * @param documentId\n */\n async deleteAttachment(documentId: string): Promise<Document> {\n let _body = null\n\n const _url = this.host + `/document/${encodeURIComponent(String(documentId))}/attachment` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Document(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Deletes a batch of documents and returns the list of deleted document ids.\n *\n * @param documentIds a ListOfIds containing the ids of the documents to delete.\n * @return a Promise that will resolve in an array of DocIdentifier of the successfully deleted documents.\n */\n async deleteDocuments(documentIds: ListOfIds): Promise<Array<DocIdentifier>> {\n const headers = (await this.headers).filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand(\n 'POST',\n this.host + `/document/delete/batch` + '?ts=' + new Date().getTime(),\n headers,\n documentIds,\n this.fetchImpl,\n undefined,\n this.authenticationProvider.getAuthService()\n )\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocIdentifier(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Deletes a single document by id.\n *\n * @param documentId the id of the document to delete.\n * @return a DocIdentifier of the document.\n */\n async deleteDocument(documentId: string): Promise<DocIdentifier> {\n return XHR.sendCommand(\n 'DELETE',\n this.host + `/document/${encodeURIComponent(documentId)}` + '?ts=' + new Date().getTime(),\n await this.headers,\n null,\n this.fetchImpl,\n undefined,\n this.authenticationProvider.getAuthService()\n )\n .then((doc) => new DocIdentifier(doc.body))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Keys must be delimited by coma\n * @summary List documents found By type, By Healthcare Party and secret foreign keys.\n * @param documentTypeCode\n * @param hcPartyId\n * @param secretFKeys\n */\n async findByTypeHCPartyMessageSecretFKeys(documentTypeCode: string, hcPartyId: string, secretFKeys: string[]): Promise<Array<Document>> {\n const body = new ListOfIds({ ids: secretFKeys })\n const _url =\n this.host +\n `/document/byHcPartySecretForeignKeys` +\n '?ts=' +\n new Date().getTime() +\n (documentTypeCode ? '&documentTypeCode=' + encodeURIComponent(String(documentTypeCode)) : '') +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Document(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Keys must be delimited by commas.\n * @deprecated use {@link findDocumentsByHCPartyPatientForeignKey} instead.\n * @summary List documents found By Healthcare Party and secret foreign keys.\n * @param hcPartyId\n * @param secretFKeys\n */\n async findDocumentsByHCPartyPatientForeignKeys(hcPartyId: string, secretFKeys: string[]): Promise<Array<Document>> {\n const body = new ListOfIds({ ids: secretFKeys })\n const _url =\n this.host +\n `/document/byHcPartySecretForeignKeys` +\n '?ts=' +\n new Date().getTime() +\n (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Document(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary List documents found By Healthcare Party and a single secret foreign key with pagination.\n * @deprecated use {@link findDocumentIdsByDataOwnerSecretForeignKey} instead.\n * @param hcPartyId the healthcare party id.\n * @param secretFKey the secret foreign key.\n * @param startKey the startKey provided by the previous page or undefined for the first page.\n * @param startDocumentId the startDocumentId provided by the previous page or undefined for the first page.\n * @param limit the number of elements that the page should contain.\n * @return a promise that will resolve in a PaginatedListDocument.\n */\n async findDocumentsByHCPartyPatientForeignKey(\n hcPartyId: string,\n secretFKey: string,\n startKey?: string,\n startDocumentId?: string,\n limit?: number\n ): Promise<PaginatedListDocument> {\n const _url =\n this.host +\n `/document/byHcPartySecretForeignKey?ts=${new Date().getTime()}` +\n `&hcPartyId=${encodeURIComponent(hcPartyId)}` +\n `&secretFKey=${encodeURIComponent(secretFKey)}` +\n (!!startKey ? `&startKey=${encodeURIComponent(startKey)}` : '') +\n (!!startDocumentId ? `&startDocumentId=${encodeURIComponent(startDocumentId)}` : '') +\n (!!limit ? `&limit=${limit}` : '')\n const headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListDocument(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n async findDocumentIdsByDataOwnerSecretForeignKey(\n dataOwnerId: string,\n secretForeignKeys: string[],\n startDate?: number,\n endDate?: number,\n descending?: boolean\n ): Promise<string[]> {\n const _url =\n this.host +\n `/document/byDataOwnerPatientCreated` +\n `&dataOwnerId=${encodeURIComponent(dataOwnerId)}` +\n (!!startDate ? `&startDate=${encodeURIComponent(startDate)}` : '') +\n (!!endDate ? `&endDate=${encodeURIComponent(endDate)}` : '') +\n (!!descending ? `&descending=${descending}` : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, { ids: secretForeignKeys }, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => JSON.parse(JSON.stringify(it))))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Keys must be delimited by commas.\n * @summary List documents with no delegation\n * @param limit\n */\n async findWithoutDelegation(limit?: number): Promise<Array<Document>> {\n let _body = null\n\n const _url = this.host + `/document/woDelegation` + '?ts=' + new Date().getTime() + (limit ? '&limit=' + encodeURIComponent(String(limit)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Document(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns the document corresponding to the identifier passed in the request\n * @summary Get a document\n * @param documentId\n */\n async getDocument(documentId: string): Promise<Document> {\n let _body = null\n\n const _url = this.host + `/document/${encodeURIComponent(String(documentId))}` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Document(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @deprecated use getMainDocumentAttachment instead\n */\n async getDocumentAttachment(documentId: string, attachmentId: string, enckeys?: string, fileName?: string): Promise<ArrayBuffer> {\n if (enckeys) {\n throw new Error('Server-side encryption of attachment is not allowed anymore')\n }\n return this.getMainDocumentAttachment(documentId)\n }\n\n /**\n * Get the main attachment of a document\n * @param documentId id of the document\n * @return the content of the main attachment for the document (if any)\n */\n async getMainDocumentAttachment(documentId: string): Promise<ArrayBuffer> {\n let _body = null\n\n const _url = this.host + `/document/${encodeURIComponent(String(documentId))}/attachment` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => doc.body)\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Get the main attachment of a document forcing usage of `application/octet-stream` in Content-Type\n * @param documentId id of the document\n * @return the content of the main attachment for the document (if any)\n */\n async getRawMainDocumentAttachment(documentId: string): Promise<ArrayBuffer> {\n let _body = null\n\n const _url = this.host + `/document/${encodeURIComponent(String(documentId))}/attachment` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, 'application/octet-stream', this.authenticationProvider.getAuthService())\n .then((doc) => doc.body)\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns the first document corresponding to the externalUuid passed in the request\n * @summary Get a document\n * @param externalUuid\n */\n async getDocumentByExternalUuid(externalUuid: string): Promise<Document> {\n let _body = null\n\n const _url = this.host + `/document/externaluuid/${encodeURIComponent(String(externalUuid))}` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Document(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of document corresponding to the identifiers passed in the body\n * @summary Get a batch of document\n * @param body\n */\n async getDocuments(body?: ListOfIds): Promise<Array<Document>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/document/byIds` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Document(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of document corresponding to the externalUuid passed in the request\n * @summary Get all documents with externalUuid\n * @param externalUuid\n */\n async getDocumentsByExternalUuid(externalUuid: string): Promise<Array<Document>> {\n let _body = null\n\n const _url = this.host + `/document/externaluuid/${encodeURIComponent(String(externalUuid))}/all` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Document(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Updates the document and returns an instance of the modified document afterward\n * @summary Update a document\n * @param body\n */\n async modifyDocument(body?: Document): Promise<Document> {\n let _body = null\n _body = body\n\n const _url = this.host + `/document` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Document(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns the modified documents.\n * @summary Update a batch of documents\n * @param body\n */\n async modifyDocuments(body?: Array<Document>): Promise<Array<Document>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/document/batch` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Document(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Creates or updates a main attachment for a document and returns the modified document instance afterward\n * @param documentId id of the document\n * @param documentRev revision of the document\n * @param body content of the attachment (must be compatible with XHR body)\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @param dataIsEncrypted set this to true if the body you provided is containing encrypted data. This helps to have the appropriate content type\n * for the attachment. Defaults is false\n */\n async setMainDocumentAttachment(\n documentId: string,\n documentRev: string,\n body: Object,\n utis?: Array<string>,\n dataIsEncrypted?: boolean\n ): Promise<Document> {\n if (!documentRev) throw new Error('Document rev is required')\n let _body = body\n\n const _url =\n this.host +\n `/document/${encodeURIComponent(String(documentId))}/attachment` +\n '?ts=' +\n new Date().getTime() +\n '&rev=' +\n encodeURIComponent(String(documentRev)) +\n (utis ? utis.map((x) => '&utis=' + encodeURIComponent(String(x))).join('') : '') +\n (dataIsEncrypted ? '&encrypted=' + encodeURIComponent(String(dataIsEncrypted)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/octet-stream'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Document(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @deprecated use setMainDocumentAttachment instead\n */\n setDocumentAttachmentBody(documentId: string, documentRev: string, enckeys?: null, body?: Object, utis?: string[]): Promise<Document> {\n if (enckeys) {\n throw new Error('Server-side encryption of attachment is not allowed anymore')\n }\n if (!body) {\n throw new Error('body is now required.')\n }\n return this.setMainDocumentAttachment(documentId, documentRev, body, utis)\n }\n\n /**\n * @deprecated use setMainDocumentAttachment instead\n */\n setDocumentAttachment(documentId: string, documentRev: string, enckeys?: null, body?: Object, utis?: string[]): Promise<Document> {\n if (enckeys) {\n throw new Error('Server-side encryption of attachment is not allowed anymore')\n }\n if (!body) {\n throw new Error('body is now required.')\n }\n return this.setMainDocumentAttachment(documentId, documentRev, body, utis)\n }\n\n /**\n * @deprecated use setMainDocumentAttachment instead\n */\n setDocumentAttachmentMulti(attachment: ArrayBuffer, documentRev: string, documentId: string, enckeys?: null): Promise<Document> {\n if (enckeys) {\n throw new Error('Server-side encryption of attachment is not allowed anymore')\n }\n return this.setMainDocumentAttachment(documentId, documentRev, attachment)\n }\n\n /**\n * Creates or updates a secondary attachment for a document and returns the modified document instance afterward\n * @summary Creates or modifies a secondary attachment for a document\n * @param documentId id of the document to update\n * @param key Key of the secondary attachment to update\n * @param rev Revision of the latest known version of the document. If the revision does not match the current version of the document the method\n * will fail with CONFLICT status\n * @param attachment\n * @param utis an array of UTIs for the attachment. If provided and non-empty overrides existing values.\n * @param dataIsEncrypted set this to true if the body you provided is containing encrypted data. This helps to have the appropriate content type\n * for the attachment. Defaults is false\n * @return the updated document\n */\n async setSecondaryAttachment(\n documentId: string,\n key: string,\n rev: string,\n attachment: Object,\n utis?: Array<string>,\n dataIsEncrypted?: boolean\n ): Promise<Document> {\n const _url =\n this.host +\n `/document/` +\n encodeURIComponent(String(documentId)) +\n '/secondaryAttachments/' +\n encodeURIComponent(String(key)) +\n '?ts=' +\n new Date().getTime() +\n (rev ? '&rev=' + encodeURIComponent(String(rev)) : '') +\n (utis ? utis.map((x) => '&utis=' + encodeURIComponent(String(x))).join('') : '') +\n (dataIsEncrypted ? '&encrypted=' + encodeURIComponent(String(dataIsEncrypted)) : '')\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/octet-stream'))\n return XHR.sendCommand('PUT', _url, headers, attachment, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Document(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Get the secondary attachment with the provided key for a document\n * @summary Retrieve a secondary attachment of a document\n * @param documentId id of the document\n * @param key Key of the secondary attachment to retrieve\n * @param fileName\n * @return the content of the attachment\n */\n async getSecondaryAttachment(documentId: string, key: string, fileName?: string): Promise<ArrayBuffer> {\n let _body = null\n\n const _url =\n this.host +\n `/document/${encodeURIComponent(String(documentId))}/secondaryAttachments/${encodeURIComponent(String(key))}` +\n '?ts=' +\n new Date().getTime() +\n (fileName ? '&fileName=' + encodeURIComponent(String(fileName)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => doc.body)\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Deletes a document's attachment and returns the modified document instance afterward\n * @summary Delete a document's attachment\n * @param documentId id of the document\n * @param key Key of the secondary attachment to delete\n * @param rev Revision of the latest known version of the document. If the revision does not match the current version of the document the method will fail with CONFLICT status\n * @return the updated document\n */\n async deleteSecondaryAttachment(documentId: string, key: string, rev: string): Promise<Document> {\n let _body = null\n\n const _url =\n this.host +\n `/document/${encodeURIComponent(String(documentId))}/secondaryAttachments/${encodeURIComponent(String(key))}` +\n '?ts=' +\n new Date().getTime() +\n (rev ? '&rev=' + encodeURIComponent(String(rev)) : '')\n let headers = await this.headers\n return XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Document(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n // TODO single request multi-attachment update\n\n /**\n * @internal this method is for internal use only and may be changed without notice\n */\n async bulkShareDocument(request: BulkShareOrUpdateMetadataParams): Promise<EntityBulkShareResult<Document>[]> {\n const _url = this.host + '/document/bulkSharedMetadataUpdate' + '?ts=' + new Date().getTime()\n let headers = await this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('PUT', _url, headers, request, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((x) => new EntityBulkShareResult<Document>(x, Document)))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
|
|
@@ -63,7 +63,7 @@ export declare class IccDocumentXApi extends IccDocumentApi implements Encrypted
|
|
|
63
63
|
* Same as {@link findBy} but it will only return the ids of the contacts. It can also filter the documents where Document.created is between
|
|
64
64
|
* startDate and endDate in ascending or descending order by that field. (default: ascending).
|
|
65
65
|
*/
|
|
66
|
-
findIdsByMessage(hcpartyId: string, message: models.Message, startDate?: number, endDate?: number, descending?: boolean): Promise<
|
|
66
|
+
findIdsByMessage(hcpartyId: string, message: models.Message, startDate?: number, endDate?: number, descending?: boolean): Promise<string[]>;
|
|
67
67
|
decrypt(hcpartyId: string, documents: Array<models.Document>): Promise<Array<models.Document>>;
|
|
68
68
|
getAttachmentAs(documentId: string, attachmentId: string, returnType: "application/octet-stream", enckeys?: string, fileName?: string): Promise<ArrayBuffer>;
|
|
69
69
|
getAttachmentAs(documentId: string, attachmentId: string, returnType: "text/plain", enckeys?: string, fileName?: string): Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icc-document-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-document-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAuD;AAGvD,4BAA2B;AAC3B,4CAAwC;AACxC,kDAAiD;AAEjD,uDAAiF;AAEjF,0EAAgG;AAChG,wEAAoE;AACpE,IAAO,eAAe,GAAG,mCAAgB,CAAC,eAAe,CAAA;AAOzD,mCAAsD;AAEtD,qCAAqC;AACrC,MAAa,eAAgB,SAAQ,wBAAc;IAuhBjD,YACE,IAAY,EACZ,OAAkC,EAC1B,MAAqB,EACrB,OAAmB,EAC3B,YAA8B,EACb,cAAuB,EACxC,yBAAiD,IAAI,iDAAwB,EAAE,EAC/E,YAA2E,OAAO,MAAM,KAAK,WAAW;QACtG,CAAC,CAAC,MAAM,CAAC,KAAK;QACd,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW;YAC7B,CAAC,CAAC,IAAI,CAAC,KAAK;YACZ,CAAC,CAAC,KAAK;QAET,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,sBAAsB,EAAE,SAAS,CAAC,CAAA;QAX/C,WAAM,GAAN,MAAM,CAAe;QACrB,YAAO,GAAP,OAAO,CAAY;QAEV,mBAAc,GAAd,cAAc,CAAS;QA1hB1C,mGAAmG;QACnG,qBAAgB,GAA8B;YAC5C,kCAAkC,EAAE,WAAW;YAC/C,+BAA+B,EAAE,yBAAyB;YAC1D,yBAAyB,EAAE,gBAAgB;YAC3C,0BAA0B,EAAE,WAAW;YACvC,6BAA6B,EAAE,0BAA0B;YACzD,6BAA6B,EAAE,0BAA0B;YACzD,2BAA2B,EAAE,qBAAqB;YAClD,yBAAyB,EAAE,oBAAoB;YAC/C,yBAAyB,EAAE,+BAA+B;YAC1D,4BAA4B,EAAE,uBAAuB;YACrD,qCAAqC,EAAE,8BAA8B;YACrE,0BAA0B,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,EACD,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CACjC;iBACA,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACvF,CAAC;KAAA;IAED,yBAAyB,CACvB,MAAuB;QAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,yBAAyB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,oCAA4B,CAAC,QAAQ,EAAE,CAAC,CAAA;IAClI,CAAC;IAED,mBAAmB,CAAC,MAAuB;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,oCAA4B,CAAC,QAAQ,EAAE,EAAE,SAAS,CAAC,CAAA;IAC9G,CAAC;IAED,uCAAuC,CAAC,MAAuB,EAAE,SAAmB;QAClF,OAAO,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,iCAAiC,CAC7E,EAAE,MAAM,EAAE,IAAI,EAAE,oCAA4B,CAAC,QAAQ,EAAE,EACvD,SAAS,CACV,CAAA;IACH,CAAC;CACF;AAjiCD,0CAiiCC","sourcesContent":["import { IccAuthApi, IccDocumentApi } from '../icc-api'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\n\nimport * as _ from 'lodash'\nimport { XHR } from '../icc-api/api/XHR'\nimport * as models from '../icc-api/model/models'\n\nimport { a2b, hex2ua, string2ua, ua2string, ua2utf8 } from './utils/binary-utils'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport { AuthenticationProvider, NoAuthenticationProvider } from './auth/AuthenticationProvider'\nimport { SecureDelegation } from '../icc-api/model/SecureDelegation'\nimport AccessLevelEnum = SecureDelegation.AccessLevelEnum\nimport { ShareMetadataBehaviour } from './crypto/ShareMetadataBehaviour'\nimport { ShareResult } from './utils/ShareResult'\nimport { EntityShareRequest } from '../icc-api/model/requests/EntityShareRequest'\nimport RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum\nimport { EncryptedEntityXApi } from './basexapi/EncryptedEntityXApi'\nimport { AccessLog } from '../icc-api/model/models'\nimport { EntityWithDelegationTypeName } from './utils'\n\n// noinspection JSUnusedGlobalSymbols\nexport class IccDocumentXApi extends IccDocumentApi implements EncryptedEntityXApi<models.Document> {\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n /** maps invalid UTI values to corresponding MIME type for backward-compatibility (pre-v1.0.117) */\n compatUtiRevDefs: { [key: string]: string } = {\n 'com.adobe.encapsulatedPostscript': 'image/eps',\n 'com.adobe.illustrator.aiImage': 'application/illustrator',\n 'com.adobe.indesignImage': 'image/indesign',\n 'com.adobe.photoshopImage': 'image/psd',\n 'com.adobe.postscriptPfaFont': 'application/x-font-type1',\n 'com.adobe.postscriptPfbFont': 'application/x-font-type1',\n 'com.allume.stuffitArchive': 'application/stuffit',\n 'com.apple.binhexArchive': 'application/binhex',\n 'com.apple.diskImageUdif': 'application/x-apple-diskimage',\n 'com.apple.macbinaryArchive': 'application/macbinary',\n 'com.apple.quartzComposerComposition': 'application/x-quartzcomposer',\n 'com.apple.quicktimeImage': 'image/x-quicktime',\n 'com.apple.quicktimeMovie': 'video/quicktime',\n 'com.js.efxFax': 'image/efax',\n 'com.macromedia.shockwaveFlash': 'application/x-shockwave-flash',\n 'com.microsoft.advancedStreamRedirector': 'video/x-ms-asx',\n 'com.microsoft.advancedSystemsFormat': 'video/x-ms-asf',\n 'com.microsoft.waveformAudio': 'audio/wave',\n 'com.microsoft.windowsDynamicLinkLibrary': 'application/x-msdownload',\n 'com.microsoft.windowsExecutable': 'application/exe',\n 'com.microsoft.windowsMediaWax': 'audio/x-ms-wax',\n 'com.microsoft.windowsMediaWm': 'video/x-ms-wm',\n 'com.microsoft.windowsMediaWma': 'audio/x-ms-wma',\n 'com.microsoft.windowsMediaWmd': 'video/x-ms-wmd',\n 'com.microsoft.windowsMediaWmp': 'video/x-ms-wmp',\n 'com.microsoft.windowsMediaWmv': 'video/x-ms-wmv',\n 'com.microsoft.windowsMediaWmx': 'video/x-ms-wmx',\n 'com.microsoft.windowsMediaWmz': 'video/x-ms-wmz',\n 'com.microsoft.windowsMediaWvx': 'video/x-ms-wvx',\n 'com.netscape.javascriptSource': 'text/javascript',\n 'com.pkware.zipArchive': 'application/zip',\n 'com.rarlab.rarArchive': 'application/rar',\n 'com.redhat.redhatPackage': 'application/x-redhat-package',\n 'com.sgi.sgiImage': 'image/sgi',\n 'com.sun.javaAppDescriptor': 'text/vnd.sun.j2me.app-descriptor',\n 'com.sun.javaArchive': 'application/java-archive',\n 'com.sun.javaClass': 'application/java',\n 'com.sun.javaSource': 'text/x-java-source',\n 'com.sun.javaWebStart': 'application/jnlp',\n 'com.truevision.tgaImage': 'image/tga',\n 'org.bzip.bzip2Archive': 'application/x-bzip2',\n 'org.debian.debianPackage': 'application/x-debian-package',\n 'org.gnu.gnuTarArchive': 'application/x-gtar',\n 'org.gnu.gnuZipArchive': 'application/gzip',\n 'org.oasis.opendocument.textMaster': 'application/vnd.oasis.opendocument.text-master',\n 'org.oasis.opendocument.textWeb': 'application/vnd.oasis.opendocument.text-web',\n 'org.xiph.oggTheora': 'video/ogg',\n 'org.xiph.oggVorbis': 'audio/ogg',\n 'public.aifcAudio': 'audio/aiff',\n 'public.aiffAudio': 'audio/aiff',\n 'public.assemblySource': 'text/x-asm',\n 'public.cHeader': 'text/x-c-header',\n 'public.cpioArchive': 'application/x-cpio',\n 'public.cPlusPlusHeader': 'text/x-c++-hdr',\n 'public.cPlusPlusSource': 'application/x-cplusplus',\n 'public.cshScript': 'application/x-csh',\n 'public.cSource': 'text/x-c-code',\n 'public.isoImage': 'application/x-iso-image',\n 'public.mpeg4Audio': 'audio/mp4',\n 'public.objectiveCPlusPlusSource': 'text/x-objcppsrc',\n 'public.objectiveCSource': 'text/x-objcsrc',\n 'public.opentypeFont': 'font/opentype',\n 'public.perlScript': 'text/x-perl',\n 'public.phpScript': 'text/php',\n 'public.plainText': 'text/plain',\n 'public.pythonScript': 'text/x-python-script',\n 'public.shellScript': 'application/x-sh',\n 'public.tarArchive': 'application/tar',\n 'public.truetypeTtfFont': 'application/x-font-ttf',\n 'public.ulawAudio': 'audio/au',\n 'public.xbitmapImage': 'image/xbm',\n 'unofficial.atomFeed': 'application/atom+xml',\n 'unofficial.m3u8Playlist': 'application/x-mpegURL',\n 'unofficial.plsPlaylist': 'audio/scpls',\n 'unofficial.rdfFeed': 'application/rdf+xml',\n 'unofficial.rssFeed': 'application/rss+xml',\n }\n\n utiRevDefs: { [key: string]: string } = {\n ...this.compatUtiRevDefs,\n 'com.adobe.encapsulated-postscript': 'image/eps',\n 'com.adobe.illustrator.ai-image': 'application/illustrator',\n 'com.adobe.indesign-image': 'image/indesign',\n 'com.adobe.pdf': 'application/pdf',\n 'com.adobe.photoshop-image': 'image/psd',\n 'com.adobe.postscript': 'application/postscript',\n 'com.adobe.postscript-pfa-font': 'application/x-font-type1',\n 'com.adobe.postscript-pfb-font': 'application/x-font-type1',\n 'com.allume.stuffit-archive': 'application/stuffit',\n 'com.apple.applescript.script': 'application/x-applescript',\n 'com.apple.applescript.text': 'application/x-applescript',\n 'com.apple.binhex-archive': 'application/binhex',\n 'com.apple.disk-image-udif': 'application/x-apple-diskimage',\n 'com.apple.ical.ics': 'text/calendar',\n 'com.apple.ical.vcs': 'text/x-vcalendar',\n 'com.apple.macbinary-archive': 'application/macbinary',\n 'com.apple.pict': 'image/pict',\n 'com.apple.quartz-composer-composition': 'application/x-quartzcomposer',\n 'com.apple.quicktime-image': 'image/x-quicktime',\n 'com.apple.quicktime-movie': 'video/quicktime',\n 'com.bittorrent.torrent': 'application/x-bittorrent',\n 'com.compuserve.gif': 'image/gif',\n 'com.js.efx-fax': 'image/efax',\n 'com.kodak.flashpix.image': 'image/vndfpx',\n 'com.lizardtech.djvu': 'image/vnd.djvu',\n 'com.macromedia.shockwave-flash': 'application/x-shockwave-flash',\n 'com.microsoft.advanced-stream-redirector': 'video/x-ms-asx',\n 'com.microsoft.advanced-systems-format': 'video/x-ms-asf',\n 'com.microsoft.bmp': 'image/bmp',\n 'com.microsoft.excel.xls': 'application/excel',\n 'com.microsoft.ico': 'image/x-icon',\n 'com.microsoft.powerpoint.ppt': 'application/powerpoint',\n 'com.microsoft.waveform-audio': 'audio/wave',\n 'com.microsoft.windows-dynamic-link-library': 'application/x-msdownload',\n 'com.microsoft.windows-executable': 'application/exe',\n 'com.microsoft.windows-media-wax': 'audio/x-ms-wax',\n 'com.microsoft.windows-media-wm': 'video/x-ms-wm',\n 'com.microsoft.windows-media-wma': 'audio/x-ms-wma',\n 'com.microsoft.windows-media-wmd': 'video/x-ms-wmd',\n 'com.microsoft.windows-media-wmp': 'video/x-ms-wmp',\n 'com.microsoft.windows-media-wmv': 'video/x-ms-wmv',\n 'com.microsoft.windows-media-wmx': 'video/x-ms-wmx',\n 'com.microsoft.windows-media-wmz': 'video/x-ms-wmz',\n 'com.microsoft.windows-media-wvx': 'video/x-ms-wvx',\n 'com.microsoft.word.doc': 'application/msword',\n 'com.netscape.javascript-source': 'text/javascript',\n 'com.pkware.zip-archive': 'application/zip',\n 'com.rarlab.rar-archive': 'application/rar',\n 'com.real.realaudio': 'audio/vnd.rn-realaudio',\n 'com.real.realmedia': 'application/vnd.rn-realmedia',\n 'com.real.smil': 'application/smil',\n 'com.redhat.redhat-package': 'application/x-redhat-package',\n 'com.sgi.sgi-image': 'image/sgi',\n 'com.soundblaster.soundfont': 'application/x-soundfont',\n 'com.sun.java-app-descriptor': 'text/vnd.sun.j2me.app-descriptor',\n 'com.sun.java-archive': 'application/java-archive',\n 'com.sun.java-class': 'application/java',\n 'com.sun.java-source': 'text/x-java-source',\n 'com.sun.java-web-start': 'application/jnlp',\n 'com.truevision.tga-image': 'image/tga',\n 'org.bzip.bzip2-archive': 'application/x-bzip2',\n 'org.debian.debian-package': 'application/x-debian-package',\n 'org.gnu.gnu-tar-archive': 'application/x-gtar',\n 'org.gnu.gnu-zip-archive': 'application/gzip',\n 'org.neooffice.calc': 'application/vnd.sun.xml.calc',\n 'org.neooffice.draw': 'application/vnd.sun.xml.draw',\n 'org.neooffice.global': 'application/vnd.sun.xml.writer.global',\n 'org.neooffice.impress': 'application/vnd.sun.xml.impress',\n 'org.neooffice.math': 'application/vnd.sun.xml.math',\n 'org.neooffice.writer': 'application/vnd.sun.xml.writer',\n 'org.oasis.opendocument.chart': 'application/vnd.oasis.opendocument.chart',\n 'org.oasis.opendocument.database': 'application/vnd.oasis.opendocument.database',\n 'org.oasis.opendocument.formula': 'application/vnd.oasis.opendocument.formula',\n 'org.oasis.opendocument.graphics': 'application/vnd.oasis.opendocument.graphics',\n 'org.oasis.opendocument.image': 'application/vnd.oasis.opendocument.image',\n 'org.oasis.opendocument.presentation': 'application/vnd.oasis.opendocument.presentation',\n 'org.oasis.opendocument.spreadsheet': 'application/vnd.oasis.opendocument.spreadsheet',\n 'org.oasis.opendocument.text': 'application/vnd.oasis.opendocument.text',\n 'org.oasis.opendocument.text-master': 'application/vnd.oasis.opendocument.text-master',\n 'org.oasis.opendocument.text-web': 'application/vnd.oasis.opendocument.text-web',\n 'org.tug.tex': 'text/tex',\n 'org.xiph.flac': 'audio/flac',\n 'org.xiph.ogg-theora': 'video/ogg',\n 'org.xiph.ogg-vorbis': 'audio/ogg',\n 'public.3gpp': 'video/3gpp',\n 'public.3gpp2': 'video/3gpp2',\n 'public.aifc-audio': 'audio/aiff',\n 'public.aiff-audio': 'audio/aiff',\n 'public.assembly-source': 'text/x-asm',\n 'public.avi': 'video/avi',\n 'public.c-header': 'text/x-c-header',\n 'public.cpio-archive': 'application/x-cpio',\n 'public.c-plus-plus-header': 'text/x-c++-hdr',\n 'public.c-plus-plus-source': 'application/x-cplusplus',\n 'public.csh-script': 'application/x-csh',\n 'public.c-source': 'text/x-c-code',\n 'public.css': 'text/css',\n 'public.dv': 'video/x-dv',\n 'public.flv': 'video/x-flv',\n 'public.html': 'text/html',\n 'public.iso-image': 'application/x-iso-image',\n 'public.jpeg': 'image/jpeg',\n 'public.jpeg2000': 'image/jp2',\n 'public.midi': 'audio/midi',\n 'public.mka': 'audio/x-matroska',\n 'public.mkv': 'video/x-matroska',\n 'public.mp3': 'audio/mp3',\n 'public.mpeg': 'video/mpeg',\n 'public.mpeg4': 'video/mp4',\n 'public.mpeg4-audio': 'audio/mp4',\n 'public.mpegts': 'video/MP2T',\n 'public.objective-c-plus-plus-source': 'text/x-objcppsrc',\n 'public.objective-c-source': 'text/x-objcsrc',\n 'public.opentype-font': 'font/opentype',\n 'public.perl-script': 'text/x-perl',\n 'public.php-script': 'text/php',\n 'public.plain-text': 'text/plain',\n 'public.png': 'image/png',\n 'public.python-script': 'text/x-python-script',\n 'public.rtf': 'text/rtf',\n 'public.shell-script': 'application/x-sh',\n 'public.tar-archive': 'application/tar',\n 'public.tiff': 'image/tiff',\n 'public.truetype-ttf-font': 'application/x-font-ttf',\n 'public.ulaw-audio': 'audio/au',\n 'public.vcard': 'text/vcard',\n 'public.webm': 'video/webm',\n 'public.xbitmap-image': 'image/xbm',\n 'public.xml': 'text/xml',\n 'unofficial.atom-feed': 'application/atom+xml',\n 'unofficial.m3u8-playlist': 'application/x-mpegURL',\n 'unofficial.opml': 'text/x-opml',\n 'unofficial.pls-playlist': 'audio/scpls',\n 'unofficial.rdf-feed': 'application/rdf+xml',\n 'unofficial.rss-feed': 'application/rss+xml',\n }\n\n utiExts: { [key: string]: string } = {\n jpg: 'public.jpeg',\n jpeg: 'public.jpeg',\n png: 'public.png',\n rtf: 'public.rtf',\n mpeg: 'public.mpeg',\n mpg: 'public.mpeg',\n html: 'public.html',\n htm: 'public.html',\n pdf: 'com.adobe.pdf',\n xls: 'com.microsoft.excel.xls',\n xlsx: 'com.microsoft.excel.xls',\n doc: 'com.microsoft.word.doc',\n docx: 'com.microsoft.word.doc',\n }\n\n utiDefs: { [key: string]: string } = {\n 'application/atom+xml': 'unofficial.atom-feed',\n 'application/bat': 'com.microsoft.windows-executable',\n 'application/binhex': 'com.apple.binhex-archive',\n 'application/binhex4': 'com.apple.binhex-archive',\n 'application/ecmascript': 'com.netscape.javascript-source',\n 'application/eps': 'com.adobe.encapsulated-postscript',\n 'application/excel': 'com.microsoft.excel.xls',\n 'application/exe': 'com.microsoft.windows-executable',\n 'application/gnutar': 'public.tar-archive',\n 'application/gzip': 'org.gnu.gnu-zip-archive',\n 'application/illustrator': 'com.adobe.illustrator.ai-image',\n 'application/indesign': 'com.adobe.indesign-image',\n 'application/java-archive': 'com.sun.java-archive',\n 'application/java-byte-code': 'com.sun.java-class',\n 'application/java': 'com.sun.java-class',\n 'application/javascript': 'com.netscape.javascript-source',\n 'application/jnlp': 'com.sun.java-web-start',\n 'application/latex': 'org.tug.tex',\n 'application/mac-binary': 'com.apple.macbinary-archive',\n 'application/mac-binhex': 'com.apple.binhex-archive',\n 'application/mac-binhex40': 'com.apple.binhex-archive',\n 'application/macbinary': 'com.apple.macbinary-archive',\n 'application/mspowerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/msword': 'com.microsoft.word.doc',\n 'application/octet-stream': 'com.microsoft.windows-executable',\n 'application/pdf': 'com.adobe.pdf',\n 'application/photoshop': 'com.adobe.photoshop-image',\n 'application/php': 'public.php-script',\n 'application/plain': 'public.plain-text',\n 'application/postscript': 'com.adobe.postscript',\n 'application/powerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/rar': 'com.rarlab.rar-archive',\n 'application/rdf+xml': 'unofficial.rdf-feed',\n 'application/rss+xml': 'unofficial.rss-feed',\n 'application/rtf': 'public.rtf',\n 'application/smil': 'com.real.smil',\n 'application/stuffit': 'com.allume.stuffit-archive',\n 'application/tar': 'public.tar-archive',\n 'application/tga': 'com.truevision.tga-image',\n 'application/vnd.fpx': 'com.kodak.flashpix.image',\n 'application/vnd.ms-excel': 'com.microsoft.excel.xls',\n 'application/vnd.ms-powerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/vnd.oasis.opendocument.chart': 'org.oasis.opendocument.chart',\n 'application/vnd.oasis.opendocument.database': 'org.oasis.opendocument.database',\n 'application/vnd.oasis.opendocument.formula': 'org.oasis.opendocument.formula',\n 'application/vnd.oasis.opendocument.graphics-template': 'org.oasis.opendocument.graphics',\n 'application/vnd.oasis.opendocument.graphics': 'org.oasis.opendocument.graphics',\n 'application/vnd.oasis.opendocument.image': 'org.oasis.opendocument.image',\n 'application/vnd.oasis.opendocument.presentation-template': 'org.oasis.opendocument.presentation',\n 'application/vnd.oasis.opendocument.presentation': 'org.oasis.opendocument.presentation',\n 'application/vnd.oasis.opendocument.spreadsheet-template': 'org.oasis.opendocument.spreadsheet',\n 'application/vnd.oasis.opendocument.spreadsheet': 'org.oasis.opendocument.spreadsheet',\n 'application/vnd.oasis.opendocument.text-master': 'org.oasis.opendocument.text-master',\n 'application/vnd.oasis.opendocument.text-template': 'org.oasis.opendocument.text',\n 'application/vnd.oasis.opendocument.text-web': 'org.oasis.opendocument.text-web',\n 'application/vnd.oasis.opendocument.text': 'org.oasis.opendocument.text',\n 'application/vnd.rn-realmedia': 'com.real.realmedia',\n 'application/vnd.sun.xml.calc.template': 'org.neooffice.calc',\n 'application/vnd.sun.xml.calc': 'org.neooffice.calc',\n 'application/vnd.sun.xml.draw.template': 'org.neooffice.draw',\n 'application/vnd.sun.xml.draw': 'org.neooffice.draw',\n 'application/vnd.sun.xml.impress.template': 'org.neooffice.impress',\n 'application/vnd.sun.xml.impress': 'org.neooffice.impress',\n 'application/vnd.sun.xml.math': 'org.neooffice.math',\n 'application/vnd.sun.xml.writer.global': 'org.neooffice.global',\n 'application/vnd.sun.xml.writer.template': 'org.neooffice.writer',\n 'application/vnd.sun.xml.writer': 'org.neooffice.writer',\n 'application/vndms-excel': 'com.microsoft.excel.xls',\n 'application/vndms-powerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/vndrn-realmedia': 'com.real.realmedia',\n 'application/x-apple-diskimage': 'com.apple.disk-image-udif',\n 'application/x-applescript': 'com.apple.applescript.script',\n 'application/x-bat': 'com.microsoft.windows-executable',\n 'application/x-binary': 'com.apple.macbinary-archive',\n 'application/x-binhex40': 'com.apple.binhex-archive',\n 'application/x-bittorrent': 'com.bittorrent.torrent',\n 'application/x-bzip2': 'org.bzip.bzip2-archive',\n 'application/x-cpio': 'public.cpio-archive',\n 'application/x-cplusplus': 'public.c-plus-plus-source',\n 'application/x-csh': 'public.csh-script',\n 'application/x-deb': 'org.debian.debian-package',\n 'application/x-debian-package': 'org.debian.debian-package',\n 'application/x-eps': 'com.adobe.encapsulated-postscript',\n 'application/x-excel': 'com.microsoft.excel.xls',\n 'application/x-exe': 'com.microsoft.windows-executable',\n 'application/x-flac': 'org.xiph.flac',\n 'application/x-font-ttf': 'public.truetype-ttf-font',\n 'application/x-font-type1': 'com.adobe.postscript-pfa-font',\n 'application/x-gtar': 'org.gnu.gnu-tar-archive',\n 'application/x-gzip': 'org.gnu.gnu-zip-archive',\n 'application/x-iso-image': 'public.iso-image',\n 'application/x-java-class': 'com.sun.java-class',\n 'application/x-java': 'com.sun.java-web-start',\n 'application/x-javascript': 'com.netscape.javascript-source',\n 'application/x-latex': 'org.tug.tex',\n 'application/x-mac-binhex40': 'com.apple.binhex-archive',\n 'application/x-macbinary': 'com.apple.macbinary-archive',\n 'application/x-midi': 'public.midi',\n 'application/x-mpegURL': 'unofficial.m3u8-playlist',\n 'application/x-ms-wmd': 'com.microsoft.windows-media-wmd',\n 'application/x-ms-wmz': 'com.microsoft.windows-media-wmz',\n 'application/x-msdos-program': 'com.microsoft.windows-executable',\n 'application/x-msdownload': 'com.microsoft.windows-executable',\n 'application/x-msexcel': 'com.microsoft.excel.xls',\n 'application/x-mspowerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/x-pdf': 'com.adobe.pdf',\n 'application/x-perl': 'public.perl-script',\n 'application/x-php': 'public.php-script',\n 'application/x-quartzcomposer': 'com.apple.quartz-composer-composition',\n 'application/x-rar-compressed': 'com.rarlab.rar-archive',\n 'application/x-redhat-package': 'com.redhat.redhat-package',\n 'application/x-rpm': 'com.redhat.redhat-package',\n 'application/x-rtf': 'public.rtf',\n 'application/x-sh': 'public.shell-script',\n 'application/x-shellscript': 'public.shell-script',\n 'application/x-shockwave-flash': 'com.macromedia.shockwave-flash',\n 'application/x-sit': 'com.allume.stuffit-archive',\n 'application/x-smil': 'com.real.smil',\n 'application/x-soundfont': 'com.soundblaster.soundfont',\n 'application/x-stuffit': 'com.allume.stuffit-archive',\n 'application/x-tar': 'public.tar-archive',\n 'application/x-tex': 'org.tug.tex',\n 'application/x-texinfo': 'org.tug.tex',\n 'application/x-troff-msvideo': 'public.avi',\n 'application/x-zip-compressed': 'com.pkware.zip-archive',\n 'application/xhtml+xml': 'public.html',\n 'application/xml': 'public.xml',\n 'application/zip': 'com.pkware.zip-archive',\n 'audio/3gpp': 'public.3gpp',\n 'audio/3gpp2': 'public.3gpp2',\n 'audio/aiff': 'public.aiff-audio',\n 'audio/au': 'public.ulaw-audio',\n 'audio/basic': 'public.ulaw-audio',\n 'audio/flac': 'org.xiph.flac',\n 'audio/mid': 'public.midi',\n 'audio/midi': 'public.midi',\n 'audio/mp3': 'public.mp3',\n 'audio/mp4': 'public.mpeg4-audio',\n 'audio/mp4a-latm': 'public.mpeg4-audio',\n 'audio/mpeg': 'public.mp3',\n 'audio/mpeg3': 'public.mp3',\n 'audio/mpegurl': 'unofficial.m3u-playlist',\n 'audio/mpg': 'public.mp3',\n 'audio/ogg': 'org.xiph.ogg-vorbis',\n 'audio/scpls': 'unofficial.pls-playlist',\n 'audio/snd': 'public.ulaw-audio',\n 'audio/vnd.rn-realaudio': 'com.real.realaudio',\n 'audio/wav': 'com.microsoft.waveform-audio',\n 'audio/wave': 'com.microsoft.waveform-audio',\n 'audio/webm': 'public.webm',\n 'audio/x-adpcm': 'public.ulaw-audio',\n 'audio/x-aiff': 'public.aiff-audio',\n 'audio/x-au': 'public.ulaw-audio',\n 'audio/x-flac': 'org.xiph.flac',\n 'audio/x-matroska': 'public.mka',\n 'audio/x-mid': 'public.midi',\n 'audio/x-midi': 'public.midi',\n 'audio/x-mp3': 'public.mp3',\n 'audio/x-mpeg-3': 'public.mp3',\n 'audio/x-mpeg': 'public.mp3',\n 'audio/x-mpeg3': 'public.mp3',\n 'audio/x-mpegurl': 'unofficial.m3u-playlist',\n 'audio/x-mpg': 'public.mp3',\n 'audio/x-ms-wax': 'com.microsoft.windows-media-wax',\n 'audio/x-ms-wma': 'com.microsoft.windows-media-wma',\n 'audio/x-ogg': 'org.xiph.ogg-vorbis',\n 'audio/x-pn-realaudio-plugin': 'com.real.realaudio',\n 'audio/x-pn-realaudio': 'com.real.realaudio',\n 'audio/x-pn-wav': 'com.microsoft.waveform-audio',\n 'audio/x-realaudio': 'com.real.realmedia',\n 'audio/x-scpls': 'unofficial.pls-playlist',\n 'audio/x-wav': 'com.microsoft.waveform-audio',\n 'font/opentype': 'public.opentype-font',\n 'image/bmp': 'com.microsoft.bmp',\n 'image/efax': 'com.js.efx-fax',\n 'image/eps': 'com.adobe.encapsulated-postscript',\n 'image/fpx': 'com.kodak.flashpix.image',\n 'image/gif': 'com.compuserve.gif',\n 'image/indd': 'com.adobe.indesign-image',\n 'image/indesign': 'com.adobe.indesign-image',\n 'image/jp2': 'public.jpeg2000',\n 'image/jpeg': 'public.jpeg',\n 'image/ms-bmp': 'com.microsoft.bmp',\n 'image/photoshop': 'com.adobe.photoshop-image',\n 'image/pict': 'com.apple.pict',\n 'image/pipeg': 'public.jpeg',\n 'image/pjpeg': 'public.jpeg',\n 'image/png': 'public.png',\n 'image/psd': 'com.adobe.photoshop-image',\n 'image/sgi': 'com.sgi.sgi-image',\n 'image/targa': 'com.truevision.tga-image',\n 'image/tga': 'com.truevision.tga-image',\n 'image/tiff': 'public.tiff',\n 'image/vnd.djvu': 'com.lizardtech.djvu',\n 'image/vndfpx': 'com.kodak.flashpix.image',\n 'image/vndnet-fpx': 'com.kodak.flashpix.image',\n 'image/webp': 'public.webp',\n 'image/x-bitmap': 'com.microsoft.bmp',\n 'image/x-bmp': 'com.microsoft.bmp',\n 'image/x-djvu': 'com.lizardtech.djvu',\n 'image/x-eps': 'com.adobe.encapsulated-postscript',\n 'image/x-icon': 'com.microsoft.ico',\n 'image/x-indesign': 'com.adobe.indesign-image',\n 'image/x-macpict': 'com.apple.pict',\n 'image/x-ms-bmp': 'com.microsoft.bmp',\n 'image/x-photoshop': 'com.adobe.photoshop-image',\n 'image/x-pict': 'com.apple.pict',\n 'image/x-quicktime': 'com.apple.quicktime-image',\n 'image/x-tiff': 'public.tiff',\n 'image/x-windows-bmp': 'com.microsoft.bmp',\n 'image/x-xbitmap': 'com.microsoft.bmp',\n 'image/x-xbm': 'public.xbitmap-image',\n 'image/xbm': 'public.xbitmap-image',\n 'multipart/x-gzip': 'org.gnu.gnu-zip-archive',\n 'multipart/x-zip': 'com.pkware.zip-archive',\n 'music/crescendo': 'public.midi',\n 'text/calendar': 'com.apple.ical.ics',\n 'text/css': 'public.css',\n 'text/directory': 'public.vcard',\n 'text/ecmascript': 'com.netscape.javascript-source',\n 'text/html': 'public.html',\n 'text/javascript': 'com.netscape.javascript-source',\n 'text/php': 'public.php-script',\n 'text/plain': 'public.plain-text',\n 'text/richtext': 'public.rtf',\n 'text/rtf': 'public.rtf',\n 'text/ruby-script': 'public.ruby-script',\n 'text/tex': 'org.tug.tex',\n 'text/vcard': 'public.vcard',\n 'text/vnd.sun.j2me.app-descriptor': 'com.sun.java-app-descriptor',\n 'text/x-asm': 'public.assembly-source',\n 'text/x-c-code': 'public.c-source',\n 'text/x-c-header': 'public.c-header',\n 'text/x-c': 'public.c-source',\n 'text/x-c++-code': 'public.c-plus-plus-source',\n 'text/x-c++-hdr': 'public.c-plus-plus-header',\n 'text/x-c++-src': 'public.c-plus-plus-source',\n 'text/x-c++src': 'public.c-plus-plus-source',\n 'text/x-h': 'public.c-header',\n 'text/x-java-source': 'com.sun.java-source',\n 'text/x-latex': 'org.tug.tex',\n 'text/x-objcppsrc': 'public.objective-c-plus-plus-source',\n 'text/x-objcsrc': 'public.objective-c-source',\n 'text/x-opml': 'unofficial.opml',\n 'text/x-perl-script': 'public.perl-script',\n 'text/x-perl': 'public.perl-script',\n 'text/x-php-script': 'public.php-script',\n 'text/x-python-script': 'public.python-script',\n 'text/x-python': 'public.python-script',\n 'text/x-scriptcsh': 'public.csh-script',\n 'text/x-scriptperl-module': 'public.perl-script',\n 'text/x-scriptperl': 'public.perl-script',\n 'text/x-scriptphyton': 'public.python-script',\n 'text/x-scriptsh': 'public.shell-script',\n 'text/x-server-parsed-html': 'public.html',\n 'text/x-tex': 'org.tug.tex',\n 'text/x-vcalendar': 'com.apple.ical.vcs',\n 'text/x-vcard': 'public.vcard',\n 'text/xhtml': 'public.html',\n 'text/xml': 'public.xml',\n 'video/3gpp': 'public.3gpp',\n 'video/3gpp2': 'public.3gpp2',\n 'video/avi': 'public.avi',\n 'video/MP2T': 'public.mpegts',\n 'video/mp4': 'public.mpeg4',\n 'video/mp4v': 'public.mpeg4',\n 'video/mpeg': 'public.mpeg',\n 'video/mpg': 'public.mpeg',\n 'video/msvideo': 'public.avi',\n 'video/ogg': 'org.xiph.ogg-theora',\n 'video/quicktime': 'com.apple.quicktime-movie',\n 'video/webm': 'public.webm',\n 'video/x-dv': 'public.dv',\n 'video/x-flv': 'public.flv',\n 'video/x-m4v': 'public.mpeg4',\n 'video/x-matroska': 'public.mkv',\n 'video/x-mpeg': 'public.mpeg',\n 'video/x-mpg': 'public.mpeg',\n 'video/x-ms-asf-plugin': 'com.microsoft.advanced-systems-format',\n 'video/x-ms-asf': 'com.microsoft.advanced-systems-format',\n 'video/x-ms-asx': 'com.microsoft.advanced-stream-redirector',\n 'video/x-ms-wm': 'com.microsoft.windows-media-wm',\n 'video/x-ms-wmd': 'com.microsoft.windows-media-wmd',\n 'video/x-ms-wmp': 'com.microsoft.windows-media-wmp',\n 'video/x-ms-wmv': 'com.microsoft.windows-media-wmv',\n 'video/x-ms-wmx': 'com.microsoft.windows-media-wmx',\n 'video/x-ms-wmz': 'com.microsoft.windows-media-wmz',\n 'video/x-ms-wvx': 'com.microsoft.windows-media-wvx',\n 'video/x-msvideo': 'public.avi',\n 'video/x-ogg': 'org.xiph.ogg-theora',\n 'x-msdos-program': 'com.microsoft.windows-executable',\n 'x-music/x-midi': 'public.midi',\n }\n dataOwnerApi: IccDataOwnerXApi\n authenticationProvider: AuthenticationProvider\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n private crypto: IccCryptoXApi,\n private authApi: IccAuthApi,\n 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.fetchImpl = fetchImpl\n this.authenticationProvider = authenticationProvider\n this.dataOwnerApi = dataOwnerApi\n }\n\n override get headers(): Promise<Array<XHR.Header>> {\n return super.headers.then((h) => this.crypto.accessControlKeysHeaders.addAccessControlKeysHeaders(h, EntityWithDelegationTypeName.Document))\n }\n\n /**\n * Creates a new instance of document with initialised encryption metadata (not in the database).\n * @param user the current user.\n * @param message the message this document refers to.\n * @param c initialised data for the document. 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 * - preferredSfk: secret id of the message to use as the secret foreign key to use for the document. The default value will be a\n * secret id of the message known by the topmost parent in the current data owner hierarchy.\n * @return a new instance of document.\n */\n async newInstance(\n user: models.User,\n message?: models.Message,\n c: any = {},\n options: {\n additionalDelegates?: { [dataOwnerId: string]: AccessLevelEnum }\n preferredSfk?: string\n } = {}\n ) {\n if (!message && options.preferredSfk) throw new Error('You need to specify parent message in order to use secret foreign keys.')\n const document = {\n ...(c ?? {}),\n _type: 'org.taktik.icure.entities.Document',\n id: c?.id ?? this.crypto.primitives.randomUuid(),\n created: c?.created ?? new Date().getTime(),\n modified: c?.modified ?? new Date().getTime(),\n responsible: c?.responsible ?? (this.autofillAuthor ? this.dataOwnerApi.getDataOwnerIdOf(user) : undefined),\n author: c?.author ?? (this.autofillAuthor ? user.id : undefined),\n codes: c?.codes ?? [],\n tags: c?.tags ?? [],\n }\n\n const ownerId = this.dataOwnerApi.getDataOwnerIdOf(user)\n if (ownerId !== (await this.dataOwnerApi.getCurrentDataOwnerId())) throw new Error('Can only initialise entities as current data owner.')\n const sfk = message\n ? options.preferredSfk ??\n (await this.crypto.confidential.getAnySecretIdSharedWithParents({ entity: message, type: EntityWithDelegationTypeName.Message }))\n : undefined\n if (message && !sfk) throw new Error(`Couldn't find any sfk of parent message ${message.id}`)\n const extraDelegations = {\n ...Object.fromEntries(\n [...(user.autoDelegations?.all ?? []), ...(user.autoDelegations?.medicalInformation ?? [])].map((d) => [d, AccessLevelEnum.WRITE])\n ),\n ...(options?.additionalDelegates ?? {}),\n }\n return new models.Document(\n await this.crypto.xapi\n .entityWithInitialisedEncryptedMetadata(document, EntityWithDelegationTypeName.Document, message?.id, sfk, true, extraDelegations)\n .then((x) => x.updatedEntity)\n )\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * @deprecated use {@link findIdsByMessage} instead.\n */\n async findByMessage(hcpartyId: string, message: models.Message) {\n const extractedKeys = await this.crypto.xapi.secretIdsOf({ entity: message, type: EntityWithDelegationTypeName.Message }, hcpartyId)\n const topmostParentId = (await this.dataOwnerApi.getCurrentDataOwnerHierarchyIds())[0]\n let documents: Array<models.Document> = await this.findDocumentsByHCPartyPatientForeignKeys(topmostParentId, _.uniq(extractedKeys))\n return await this.decrypt(hcpartyId, documents)\n }\n\n /**\n * Same as {@link findBy} but it will only return the ids of the contacts. It can also filter the documents where Document.created is between\n * startDate and endDate in ascending or descending order by that field. (default: ascending).\n */\n async findIdsByMessage(hcpartyId: string, message: models.Message, startDate?: number, endDate?: number, descending?: boolean) {\n const extractedKeys = await this.crypto.xapi.secretIdsOf({ entity: message, type: EntityWithDelegationTypeName.Message }, hcpartyId)\n const topmostParentId = (await this.dataOwnerApi.getCurrentDataOwnerHierarchyIds())[0]\n return this.findDocumentIdsByDataOwnerSecretForeignKey(topmostParentId, _.uniq(extractedKeys), startDate, endDate, descending)\n }\n\n // Note: this is only for dealing with legacy documents: new document are not encrypted, only their attachments are\n decrypt(hcpartyId: string, documents: Array<models.Document>): Promise<Array<models.Document>> {\n return Promise.all(\n documents.map((document) =>\n this.crypto.xapi.decryptAndImportAllDecryptionKeys({ entity: document, type: EntityWithDelegationTypeName.Document }).then((keys) => {\n if (!keys.length) {\n console.log('Cannot decrypt document', document.id)\n return Promise.resolve(document)\n }\n\n if (keys.length && (document.encryptedSelf || document.encryptedAttachment)) {\n const key = keys[0].key\n return Promise.all([\n document.encryptedSelf\n ? new Promise((resolve: (value: ArrayBuffer | null) => any) => {\n this.crypto.primitives.AES.decrypt(key, string2ua(a2b(document.encryptedSelf!))).then(resolve, () => {\n console.log('Cannot decrypt document', document.id)\n resolve(null)\n })\n })\n : Promise.resolve(null),\n document.encryptedAttachment\n ? new Promise((resolve: (value: ArrayBuffer | null) => any) => {\n this.crypto.primitives.AES.decrypt(key, document.encryptedAttachment!).then(resolve, () => {\n console.log('Cannot decrypt document', document.id)\n resolve(null)\n })\n })\n : Promise.resolve(null),\n ]).then((decrypted: [ArrayBuffer | null, ArrayBuffer | null]) => {\n if (decrypted) {\n if (decrypted[0]) {\n document = _.extend(document, JSON.parse(ua2string(decrypted[0])))\n }\n if (decrypted[1]) {\n document.decryptedAttachment = decrypted[1]\n }\n }\n return document\n })\n } else {\n return Promise.resolve(document)\n }\n })\n )\n ).catch(function (e: Error) {\n console.log(e)\n return Promise.resolve(documents)\n })\n }\n\n //prettier-ignore\n getAttachmentAs(documentId: string, attachmentId: string, returnType: \"application/octet-stream\", enckeys?: string, fileName?: string): Promise<ArrayBuffer>\n //prettier-ignore\n getAttachmentAs(documentId: string, attachmentId: string, returnType: \"text/plain\", enckeys?: string, fileName?: string): Promise<string>\n //prettier-ignore\n getAttachmentAs(documentId: string, attachmentId: string, returnType: \"application/json\", enckeys?: string, fileName?: string): Promise<any>\n /**\n * @deprecated use getMainAttachmentAs instead\n */\n async getAttachmentAs(\n documentId: string,\n attachmentId: string,\n returnType: 'application/octet-stream' | 'text/plain' | 'application/json',\n enckeys?: string,\n fileName?: string\n ): Promise<any> {\n if (!!enckeys || !!fileName) {\n console.warn('Using getAttachmentAs method with a value for enckeys or fileName does nothing anymore.')\n }\n return this.getMainAttachmentAs(documentId, returnType)\n }\n\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: \"application/octet-stream\"): Promise<ArrayBuffer>\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: \"text/plain\"): Promise<string>\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: \"application/json\"): Promise<any>\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: 'application/octet-stream' | 'text/plain' | 'application/json'): Promise<any>\n async getMainAttachmentAs(documentId: string, returnType: 'application/octet-stream' | 'text/plain' | 'application/json'): Promise<any> {\n const url = this.host + `/document/${documentId}/attachment` + '?ts=' + new Date().getTime()\n return XHR.sendCommand('GET', url, await this.headers, null, this.fetchImpl, returnType, this.authenticationProvider.getAuthService())\n .then((doc) => doc.body)\n .catch((err) => this.handleError(err))\n }\n\n //prettier-ignore\n getAndTryDecryptMainAttachmentAs(document: models.Document, returnType: \"application/octet-stream\"): Promise<ArrayBuffer | undefined>\n //prettier-ignore\n getAndTryDecryptMainAttachmentAs(document: models.Document, returnType: \"text/plain\"): Promise<string | undefined>\n //prettier-ignore\n getAndTryDecryptMainAttachmentAs(document: models.Document, returnType: \"application/json\"): Promise<any | undefined>\n //prettier-ignore\n getAndTryDecryptMainAttachmentAs(document: models.Document, returnType: 'application/octet-stream' | 'text/plain' | 'application/json'): Promise<any | undefined>\n async getAndTryDecryptMainAttachmentAs(\n document: models.Document,\n returnType: 'application/octet-stream' | 'text/plain' | 'application/json'\n ): Promise<any | undefined> {\n const key = (await this.crypto.xapi.encryptionKeysOf({ entity: document, type: EntityWithDelegationTypeName.Document }, undefined))[0]\n if (!key) return undefined\n const tryParse = this.parserFor(returnType)\n const attachmentInfo = await this.getAndTryDecryptDocumentAttachment(document, (decrypted) => Promise.resolve(tryParse(decrypted) !== undefined))\n if (attachmentInfo.wasDecrypted) {\n return tryParse(attachmentInfo.data)\n } else return undefined\n }\n private parserFor(returnType: 'application/octet-stream' | 'text/plain' | 'application/json'): (data: ArrayBuffer) => any | undefined {\n if (returnType === 'application/octet-stream') {\n return (data) => data\n } else if (returnType === 'text/plain') {\n return (data) => {\n try {\n return ua2utf8(data)\n } catch (e) {\n return undefined\n }\n }\n } else if (returnType === 'application/json') {\n return (data) => {\n try {\n return JSON.parse(ua2utf8(data))\n } catch (e) {\n return undefined\n }\n }\n } else throw new Error(`Unsupported type ${returnType}`)\n }\n\n // noinspection JSUnusedGlobalSymbols\n uti(mimeType: string, extension: string) {\n return (mimeType && mimeType !== 'application/octet-stream' ? this.utiDefs[mimeType] : this.utiExts[extension]) || this.utiDefs[mimeType]\n }\n\n // noinspection JSUnusedGlobalSymbols\n mimeType(uti: string) {\n return this.utiRevDefs[uti]\n }\n\n /**\n * Adds an attachment to a document, encrypting it on client side using the encryption keys of the provided document.\n * @param document a document.\n * @param attachment a new main attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async encryptAndSetDocumentAttachment(document: models.Document, attachment: ArrayBuffer | Uint8Array, utis?: string[]): Promise<models.Document> {\n if (!document.rev) throw new Error('Cannot set attachment on document without rev')\n const { encryptedData, updatedEntity } = await this.crypto.xapi.encryptDataOf(document, EntityWithDelegationTypeName.Document, attachment, (d) =>\n this.modifyDocument(d)\n )\n return await this.setMainDocumentAttachment(document.id!, updatedEntity?.rev ?? document.rev, encryptedData, utis, true)\n }\n\n /**\n * Adds an unencrypted attachment to a document.\n * @param document a document.\n * @param attachment a new main attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async setClearDocumentAttachment(document: models.Document, attachment: ArrayBuffer | Uint8Array, utis?: string[]): Promise<models.Document> {\n if (!document.rev) throw new Error('Cannot set attachment on document without rev')\n return await this.setMainDocumentAttachment(document.id!, document.rev, attachment, utis, false)\n }\n\n /**\n * Adds a secondary attachment to a document, encrypting it on client side using the encryption keys of the provided document.\n * @param document a document.\n * @param secondaryAttachmentKey key for the secondary attachment.\n * @param attachment a new secondary attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async encryptAndSetSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n attachment: ArrayBuffer | Uint8Array,\n utis?: string[]\n ): Promise<models.Document> {\n if (!document.rev) throw new Error('Cannot set attachment on document without rev')\n const { encryptedData, updatedEntity } = await this.crypto.xapi.encryptDataOf(document, EntityWithDelegationTypeName.Document, attachment, (d) =>\n this.modifyDocument()\n )\n return await this.setSecondaryAttachment(document.id!, secondaryAttachmentKey, updatedEntity?.rev ?? document.rev!, encryptedData, utis, true)\n }\n\n /**\n * Adds an unencrypted secondary attachment to a document.\n * @param document a document.\n * @param secondaryAttachmentKey key for the secondary attachment.\n * @param attachment a new secondary attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async setClearSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n attachment: ArrayBuffer | Uint8Array,\n utis?: string[]\n ): Promise<models.Document> {\n return await this.setSecondaryAttachment(document.id!, secondaryAttachmentKey, document.rev!, attachment, utis, false)\n }\n\n /**\n * Gets the main attachment of a document and tries to decrypt it using the encryption keys of the document, throwing an error if the operation fails.\n * @param document a document.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return the decrypted attachment, if it could be decrypted, else the encrypted attachment.\n */\n async getAndDecryptDocumentAttachment(\n document: models.Document,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<ArrayBuffer> {\n const retrieved = await this.getAndTryDecryptDocumentAttachment(document, (x) => validator(x))\n if (!retrieved.wasDecrypted) throw new Error(`No valid key found to decrypt data of document ${document.id}.`)\n return retrieved.data\n }\n\n /**\n * Gets the main attachment of a document and tries to decrypt it using the encryption keys of the document.\n * @param document a document.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return an object containing:\n * - data: the decrypted attachment, if it could be decrypted, else the encrypted attachment.\n * - wasDecrypted: if the data was successfully decrypted or not\n */\n async getAndTryDecryptDocumentAttachment(\n document: models.Document,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<{ data: ArrayBuffer; wasDecrypted: boolean }> {\n return await this.crypto.xapi.tryDecryptDataOf(\n { entity: document, type: EntityWithDelegationTypeName.Document },\n await this.getRawMainDocumentAttachment(document.id!),\n (x) => validator(x)\n )\n }\n\n /**\n * Gets the secondary attachment of a document and tries to decrypt it using the encryption keys of the document, throwing an error if the operation fails.\n * @param document a document.\n * @param secondaryAttachmentKey key of the secondary attachment.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return the decrypted attachment.\n */\n async getAndDecryptSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<ArrayBuffer> {\n const { data, wasDecrypted } = await this.getAndTryDecryptSecondaryDocumentAttachment(document, secondaryAttachmentKey, (x) => validator(x))\n if (!wasDecrypted) throw new Error(`No valid key found to decrypt data of document ${document.id}.`)\n return data\n }\n\n /**\n * Gets the secondary attachment of a document and tries to decrypt it using the encryption keys of the document.\n * @param document a document.\n * @param secondaryAttachmentKey key of the secondary attachment.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return an object containing:\n * - data: the decrypted attachment, if it could be decrypted, else the encrypted attachment.\n * - wasDecrypted: if the data was successfully decrypted or not\n */\n async getAndTryDecryptSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<{ data: ArrayBuffer; wasDecrypted: boolean }> {\n return await this.crypto.xapi.tryDecryptDataOf(\n { entity: document, type: EntityWithDelegationTypeName.Document },\n await this.getSecondaryAttachment(document.id!, secondaryAttachmentKey),\n (x) => validator(x)\n )\n }\n\n /**\n * @param document a document\n * @return the id of the message that the document refers to, retrieved from the encrypted metadata. Normally there should only be one element\n * in the returned array, but in case of entity merges there could be multiple values.\n */\n async decryptMessageIdOf(document: models.Document): Promise<string[]> {\n return this.crypto.xapi.owningEntityIdsOf({ entity: document, type: EntityWithDelegationTypeName.Document }, undefined)\n }\n\n /**\n * @return if the logged data owner has write access to the content of the given document\n */\n async hasWriteAccess(document: models.Document): Promise<boolean> {\n return this.crypto.xapi.hasWriteAccess({ entity: document, type: EntityWithDelegationTypeName.Document })\n }\n\n /**\n * Share an existing document with other data owners, allowing them to access the non-encrypted data of the document 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 document.\n * @param document the document 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}).\n * - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\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 document: models.Document,\n options: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n shareMessageId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n } = {}\n ): Promise<models.Document> {\n return this.shareWithMany(document, { [delegateId]: options })\n }\n\n /**\n * Share an existing document with other data owners, allowing them to access the non-encrypted data of the document and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param document the document 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}).\n * - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity.\n */\n async shareWithMany(\n document: models.Document,\n delegates: {\n [delegateId: string]: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n shareMessageId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<models.Document> {\n return (await this.tryShareWithMany(document, delegates)).updatedEntityOrThrow\n }\n /**\n * Share an existing document with other data owners, allowing them to access the non-encrypted data of the document and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param document the document 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}).\n * - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\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 document: models.Document,\n delegates: {\n [delegateId: string]: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n shareMessageId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<ShareResult<models.Document>> {\n const self = await this.dataOwnerApi.getCurrentDataOwnerId()\n // All entities should have an encryption key.\n const entityWithEncryptionKey = await this.crypto.xapi.ensureEncryptionKeysInitialised(document, EntityWithDelegationTypeName.Document)\n const updatedEntity = entityWithEncryptionKey ? await this.modifyDocument(entityWithEncryptionKey) : document\n return this.crypto.xapi\n .simpleShareOrUpdateEncryptedEntityMetadata(\n {\n entity: updatedEntity,\n type: EntityWithDelegationTypeName.Document,\n },\n Object.fromEntries(\n Object.entries(delegates).map(([delegateId, options]) => [\n delegateId,\n {\n requestedPermissions: options.requestedPermissions,\n shareEncryptionKeys: options.shareEncryptionKey,\n shareOwningEntityIds: options.shareMessageId,\n shareSecretIds: options.shareSecretIds,\n },\n ])\n ),\n (x) => this.bulkShareDocument(x)\n )\n .then((r) => r.mapSuccessAsync((e) => this.decrypt(self, [e]).then((es) => es[0])))\n }\n\n getDataOwnersWithAccessTo(\n entity: models.Document\n ): Promise<{ permissionsByDataOwnerId: { [p: string]: AccessLevelEnum }; hasUnknownAnonymousDataOwners: boolean }> {\n return this.crypto.delegationsDeAnonymization.getDataOwnersWithAccessTo({ entity, type: EntityWithDelegationTypeName.Document })\n }\n\n getEncryptionKeysOf(entity: models.Document): Promise<string[]> {\n return this.crypto.xapi.encryptionKeysOf({ entity, type: EntityWithDelegationTypeName.Document }, undefined)\n }\n\n createDelegationDeAnonymizationMetadata(entity: models.Document, delegates: string[]): Promise<void> {\n return this.crypto.delegationsDeAnonymization.createOrUpdateDeAnonymizationInfo(\n { entity, type: EntityWithDelegationTypeName.Document },\n delegates\n )\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"icc-document-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-document-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAuD;AAGvD,4BAA2B;AAC3B,4CAAwC;AACxC,kDAAiD;AAEjD,uDAAiF;AAEjF,0EAAgG;AAChG,wEAAoE;AACpE,IAAO,eAAe,GAAG,mCAAgB,CAAC,eAAe,CAAA;AAOzD,mCAAsD;AAEtD,qCAAqC;AACrC,MAAa,eAAgB,SAAQ,wBAAc;IAuhBjD,YACE,IAAY,EACZ,OAAkC,EAC1B,MAAqB,EACrB,OAAmB,EAC3B,YAA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AE,IAAI,EAAE,oCAA4B,CAAC,QAAQ,EAAE,CAAC,CAAA;IAClI,CAAC;IAED,mBAAmB,CAAC,MAAuB;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,oCAA4B,CAAC,QAAQ,EAAE,EAAE,SAAS,CAAC,CAAA;IAC9G,CAAC;IAED,uCAAuC,CAAC,MAAuB,EAAE,SAAmB;QAClF,OAAO,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,iCAAiC,CAC7E,EAAE,MAAM,EAAE,IAAI,EAAE,oCAA4B,CAAC,QAAQ,EAAE,EACvD,SAAS,CACV,CAAA;IACH,CAAC;CACF;AAjiCD,0CAiiCC","sourcesContent":["import { IccAuthApi, IccDocumentApi } from '../icc-api'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\n\nimport * as _ from 'lodash'\nimport { XHR } from '../icc-api/api/XHR'\nimport * as models from '../icc-api/model/models'\n\nimport { a2b, hex2ua, string2ua, ua2string, ua2utf8 } from './utils/binary-utils'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport { AuthenticationProvider, NoAuthenticationProvider } from './auth/AuthenticationProvider'\nimport { SecureDelegation } from '../icc-api/model/SecureDelegation'\nimport AccessLevelEnum = SecureDelegation.AccessLevelEnum\nimport { ShareMetadataBehaviour } from './crypto/ShareMetadataBehaviour'\nimport { ShareResult } from './utils/ShareResult'\nimport { EntityShareRequest } from '../icc-api/model/requests/EntityShareRequest'\nimport RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum\nimport { EncryptedEntityXApi } from './basexapi/EncryptedEntityXApi'\nimport { AccessLog } from '../icc-api/model/models'\nimport { EntityWithDelegationTypeName } from './utils'\n\n// noinspection JSUnusedGlobalSymbols\nexport class IccDocumentXApi extends IccDocumentApi implements EncryptedEntityXApi<models.Document> {\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n /** maps invalid UTI values to corresponding MIME type for backward-compatibility (pre-v1.0.117) */\n compatUtiRevDefs: { [key: string]: string } = {\n 'com.adobe.encapsulatedPostscript': 'image/eps',\n 'com.adobe.illustrator.aiImage': 'application/illustrator',\n 'com.adobe.indesignImage': 'image/indesign',\n 'com.adobe.photoshopImage': 'image/psd',\n 'com.adobe.postscriptPfaFont': 'application/x-font-type1',\n 'com.adobe.postscriptPfbFont': 'application/x-font-type1',\n 'com.allume.stuffitArchive': 'application/stuffit',\n 'com.apple.binhexArchive': 'application/binhex',\n 'com.apple.diskImageUdif': 'application/x-apple-diskimage',\n 'com.apple.macbinaryArchive': 'application/macbinary',\n 'com.apple.quartzComposerComposition': 'application/x-quartzcomposer',\n 'com.apple.quicktimeImage': 'image/x-quicktime',\n 'com.apple.quicktimeMovie': 'video/quicktime',\n 'com.js.efxFax': 'image/efax',\n 'com.macromedia.shockwaveFlash': 'application/x-shockwave-flash',\n 'com.microsoft.advancedStreamRedirector': 'video/x-ms-asx',\n 'com.microsoft.advancedSystemsFormat': 'video/x-ms-asf',\n 'com.microsoft.waveformAudio': 'audio/wave',\n 'com.microsoft.windowsDynamicLinkLibrary': 'application/x-msdownload',\n 'com.microsoft.windowsExecutable': 'application/exe',\n 'com.microsoft.windowsMediaWax': 'audio/x-ms-wax',\n 'com.microsoft.windowsMediaWm': 'video/x-ms-wm',\n 'com.microsoft.windowsMediaWma': 'audio/x-ms-wma',\n 'com.microsoft.windowsMediaWmd': 'video/x-ms-wmd',\n 'com.microsoft.windowsMediaWmp': 'video/x-ms-wmp',\n 'com.microsoft.windowsMediaWmv': 'video/x-ms-wmv',\n 'com.microsoft.windowsMediaWmx': 'video/x-ms-wmx',\n 'com.microsoft.windowsMediaWmz': 'video/x-ms-wmz',\n 'com.microsoft.windowsMediaWvx': 'video/x-ms-wvx',\n 'com.netscape.javascriptSource': 'text/javascript',\n 'com.pkware.zipArchive': 'application/zip',\n 'com.rarlab.rarArchive': 'application/rar',\n 'com.redhat.redhatPackage': 'application/x-redhat-package',\n 'com.sgi.sgiImage': 'image/sgi',\n 'com.sun.javaAppDescriptor': 'text/vnd.sun.j2me.app-descriptor',\n 'com.sun.javaArchive': 'application/java-archive',\n 'com.sun.javaClass': 'application/java',\n 'com.sun.javaSource': 'text/x-java-source',\n 'com.sun.javaWebStart': 'application/jnlp',\n 'com.truevision.tgaImage': 'image/tga',\n 'org.bzip.bzip2Archive': 'application/x-bzip2',\n 'org.debian.debianPackage': 'application/x-debian-package',\n 'org.gnu.gnuTarArchive': 'application/x-gtar',\n 'org.gnu.gnuZipArchive': 'application/gzip',\n 'org.oasis.opendocument.textMaster': 'application/vnd.oasis.opendocument.text-master',\n 'org.oasis.opendocument.textWeb': 'application/vnd.oasis.opendocument.text-web',\n 'org.xiph.oggTheora': 'video/ogg',\n 'org.xiph.oggVorbis': 'audio/ogg',\n 'public.aifcAudio': 'audio/aiff',\n 'public.aiffAudio': 'audio/aiff',\n 'public.assemblySource': 'text/x-asm',\n 'public.cHeader': 'text/x-c-header',\n 'public.cpioArchive': 'application/x-cpio',\n 'public.cPlusPlusHeader': 'text/x-c++-hdr',\n 'public.cPlusPlusSource': 'application/x-cplusplus',\n 'public.cshScript': 'application/x-csh',\n 'public.cSource': 'text/x-c-code',\n 'public.isoImage': 'application/x-iso-image',\n 'public.mpeg4Audio': 'audio/mp4',\n 'public.objectiveCPlusPlusSource': 'text/x-objcppsrc',\n 'public.objectiveCSource': 'text/x-objcsrc',\n 'public.opentypeFont': 'font/opentype',\n 'public.perlScript': 'text/x-perl',\n 'public.phpScript': 'text/php',\n 'public.plainText': 'text/plain',\n 'public.pythonScript': 'text/x-python-script',\n 'public.shellScript': 'application/x-sh',\n 'public.tarArchive': 'application/tar',\n 'public.truetypeTtfFont': 'application/x-font-ttf',\n 'public.ulawAudio': 'audio/au',\n 'public.xbitmapImage': 'image/xbm',\n 'unofficial.atomFeed': 'application/atom+xml',\n 'unofficial.m3u8Playlist': 'application/x-mpegURL',\n 'unofficial.plsPlaylist': 'audio/scpls',\n 'unofficial.rdfFeed': 'application/rdf+xml',\n 'unofficial.rssFeed': 'application/rss+xml',\n }\n\n utiRevDefs: { [key: string]: string } = {\n ...this.compatUtiRevDefs,\n 'com.adobe.encapsulated-postscript': 'image/eps',\n 'com.adobe.illustrator.ai-image': 'application/illustrator',\n 'com.adobe.indesign-image': 'image/indesign',\n 'com.adobe.pdf': 'application/pdf',\n 'com.adobe.photoshop-image': 'image/psd',\n 'com.adobe.postscript': 'application/postscript',\n 'com.adobe.postscript-pfa-font': 'application/x-font-type1',\n 'com.adobe.postscript-pfb-font': 'application/x-font-type1',\n 'com.allume.stuffit-archive': 'application/stuffit',\n 'com.apple.applescript.script': 'application/x-applescript',\n 'com.apple.applescript.text': 'application/x-applescript',\n 'com.apple.binhex-archive': 'application/binhex',\n 'com.apple.disk-image-udif': 'application/x-apple-diskimage',\n 'com.apple.ical.ics': 'text/calendar',\n 'com.apple.ical.vcs': 'text/x-vcalendar',\n 'com.apple.macbinary-archive': 'application/macbinary',\n 'com.apple.pict': 'image/pict',\n 'com.apple.quartz-composer-composition': 'application/x-quartzcomposer',\n 'com.apple.quicktime-image': 'image/x-quicktime',\n 'com.apple.quicktime-movie': 'video/quicktime',\n 'com.bittorrent.torrent': 'application/x-bittorrent',\n 'com.compuserve.gif': 'image/gif',\n 'com.js.efx-fax': 'image/efax',\n 'com.kodak.flashpix.image': 'image/vndfpx',\n 'com.lizardtech.djvu': 'image/vnd.djvu',\n 'com.macromedia.shockwave-flash': 'application/x-shockwave-flash',\n 'com.microsoft.advanced-stream-redirector': 'video/x-ms-asx',\n 'com.microsoft.advanced-systems-format': 'video/x-ms-asf',\n 'com.microsoft.bmp': 'image/bmp',\n 'com.microsoft.excel.xls': 'application/excel',\n 'com.microsoft.ico': 'image/x-icon',\n 'com.microsoft.powerpoint.ppt': 'application/powerpoint',\n 'com.microsoft.waveform-audio': 'audio/wave',\n 'com.microsoft.windows-dynamic-link-library': 'application/x-msdownload',\n 'com.microsoft.windows-executable': 'application/exe',\n 'com.microsoft.windows-media-wax': 'audio/x-ms-wax',\n 'com.microsoft.windows-media-wm': 'video/x-ms-wm',\n 'com.microsoft.windows-media-wma': 'audio/x-ms-wma',\n 'com.microsoft.windows-media-wmd': 'video/x-ms-wmd',\n 'com.microsoft.windows-media-wmp': 'video/x-ms-wmp',\n 'com.microsoft.windows-media-wmv': 'video/x-ms-wmv',\n 'com.microsoft.windows-media-wmx': 'video/x-ms-wmx',\n 'com.microsoft.windows-media-wmz': 'video/x-ms-wmz',\n 'com.microsoft.windows-media-wvx': 'video/x-ms-wvx',\n 'com.microsoft.word.doc': 'application/msword',\n 'com.netscape.javascript-source': 'text/javascript',\n 'com.pkware.zip-archive': 'application/zip',\n 'com.rarlab.rar-archive': 'application/rar',\n 'com.real.realaudio': 'audio/vnd.rn-realaudio',\n 'com.real.realmedia': 'application/vnd.rn-realmedia',\n 'com.real.smil': 'application/smil',\n 'com.redhat.redhat-package': 'application/x-redhat-package',\n 'com.sgi.sgi-image': 'image/sgi',\n 'com.soundblaster.soundfont': 'application/x-soundfont',\n 'com.sun.java-app-descriptor': 'text/vnd.sun.j2me.app-descriptor',\n 'com.sun.java-archive': 'application/java-archive',\n 'com.sun.java-class': 'application/java',\n 'com.sun.java-source': 'text/x-java-source',\n 'com.sun.java-web-start': 'application/jnlp',\n 'com.truevision.tga-image': 'image/tga',\n 'org.bzip.bzip2-archive': 'application/x-bzip2',\n 'org.debian.debian-package': 'application/x-debian-package',\n 'org.gnu.gnu-tar-archive': 'application/x-gtar',\n 'org.gnu.gnu-zip-archive': 'application/gzip',\n 'org.neooffice.calc': 'application/vnd.sun.xml.calc',\n 'org.neooffice.draw': 'application/vnd.sun.xml.draw',\n 'org.neooffice.global': 'application/vnd.sun.xml.writer.global',\n 'org.neooffice.impress': 'application/vnd.sun.xml.impress',\n 'org.neooffice.math': 'application/vnd.sun.xml.math',\n 'org.neooffice.writer': 'application/vnd.sun.xml.writer',\n 'org.oasis.opendocument.chart': 'application/vnd.oasis.opendocument.chart',\n 'org.oasis.opendocument.database': 'application/vnd.oasis.opendocument.database',\n 'org.oasis.opendocument.formula': 'application/vnd.oasis.opendocument.formula',\n 'org.oasis.opendocument.graphics': 'application/vnd.oasis.opendocument.graphics',\n 'org.oasis.opendocument.image': 'application/vnd.oasis.opendocument.image',\n 'org.oasis.opendocument.presentation': 'application/vnd.oasis.opendocument.presentation',\n 'org.oasis.opendocument.spreadsheet': 'application/vnd.oasis.opendocument.spreadsheet',\n 'org.oasis.opendocument.text': 'application/vnd.oasis.opendocument.text',\n 'org.oasis.opendocument.text-master': 'application/vnd.oasis.opendocument.text-master',\n 'org.oasis.opendocument.text-web': 'application/vnd.oasis.opendocument.text-web',\n 'org.tug.tex': 'text/tex',\n 'org.xiph.flac': 'audio/flac',\n 'org.xiph.ogg-theora': 'video/ogg',\n 'org.xiph.ogg-vorbis': 'audio/ogg',\n 'public.3gpp': 'video/3gpp',\n 'public.3gpp2': 'video/3gpp2',\n 'public.aifc-audio': 'audio/aiff',\n 'public.aiff-audio': 'audio/aiff',\n 'public.assembly-source': 'text/x-asm',\n 'public.avi': 'video/avi',\n 'public.c-header': 'text/x-c-header',\n 'public.cpio-archive': 'application/x-cpio',\n 'public.c-plus-plus-header': 'text/x-c++-hdr',\n 'public.c-plus-plus-source': 'application/x-cplusplus',\n 'public.csh-script': 'application/x-csh',\n 'public.c-source': 'text/x-c-code',\n 'public.css': 'text/css',\n 'public.dv': 'video/x-dv',\n 'public.flv': 'video/x-flv',\n 'public.html': 'text/html',\n 'public.iso-image': 'application/x-iso-image',\n 'public.jpeg': 'image/jpeg',\n 'public.jpeg2000': 'image/jp2',\n 'public.midi': 'audio/midi',\n 'public.mka': 'audio/x-matroska',\n 'public.mkv': 'video/x-matroska',\n 'public.mp3': 'audio/mp3',\n 'public.mpeg': 'video/mpeg',\n 'public.mpeg4': 'video/mp4',\n 'public.mpeg4-audio': 'audio/mp4',\n 'public.mpegts': 'video/MP2T',\n 'public.objective-c-plus-plus-source': 'text/x-objcppsrc',\n 'public.objective-c-source': 'text/x-objcsrc',\n 'public.opentype-font': 'font/opentype',\n 'public.perl-script': 'text/x-perl',\n 'public.php-script': 'text/php',\n 'public.plain-text': 'text/plain',\n 'public.png': 'image/png',\n 'public.python-script': 'text/x-python-script',\n 'public.rtf': 'text/rtf',\n 'public.shell-script': 'application/x-sh',\n 'public.tar-archive': 'application/tar',\n 'public.tiff': 'image/tiff',\n 'public.truetype-ttf-font': 'application/x-font-ttf',\n 'public.ulaw-audio': 'audio/au',\n 'public.vcard': 'text/vcard',\n 'public.webm': 'video/webm',\n 'public.xbitmap-image': 'image/xbm',\n 'public.xml': 'text/xml',\n 'unofficial.atom-feed': 'application/atom+xml',\n 'unofficial.m3u8-playlist': 'application/x-mpegURL',\n 'unofficial.opml': 'text/x-opml',\n 'unofficial.pls-playlist': 'audio/scpls',\n 'unofficial.rdf-feed': 'application/rdf+xml',\n 'unofficial.rss-feed': 'application/rss+xml',\n }\n\n utiExts: { [key: string]: string } = {\n jpg: 'public.jpeg',\n jpeg: 'public.jpeg',\n png: 'public.png',\n rtf: 'public.rtf',\n mpeg: 'public.mpeg',\n mpg: 'public.mpeg',\n html: 'public.html',\n htm: 'public.html',\n pdf: 'com.adobe.pdf',\n xls: 'com.microsoft.excel.xls',\n xlsx: 'com.microsoft.excel.xls',\n doc: 'com.microsoft.word.doc',\n docx: 'com.microsoft.word.doc',\n }\n\n utiDefs: { [key: string]: string } = {\n 'application/atom+xml': 'unofficial.atom-feed',\n 'application/bat': 'com.microsoft.windows-executable',\n 'application/binhex': 'com.apple.binhex-archive',\n 'application/binhex4': 'com.apple.binhex-archive',\n 'application/ecmascript': 'com.netscape.javascript-source',\n 'application/eps': 'com.adobe.encapsulated-postscript',\n 'application/excel': 'com.microsoft.excel.xls',\n 'application/exe': 'com.microsoft.windows-executable',\n 'application/gnutar': 'public.tar-archive',\n 'application/gzip': 'org.gnu.gnu-zip-archive',\n 'application/illustrator': 'com.adobe.illustrator.ai-image',\n 'application/indesign': 'com.adobe.indesign-image',\n 'application/java-archive': 'com.sun.java-archive',\n 'application/java-byte-code': 'com.sun.java-class',\n 'application/java': 'com.sun.java-class',\n 'application/javascript': 'com.netscape.javascript-source',\n 'application/jnlp': 'com.sun.java-web-start',\n 'application/latex': 'org.tug.tex',\n 'application/mac-binary': 'com.apple.macbinary-archive',\n 'application/mac-binhex': 'com.apple.binhex-archive',\n 'application/mac-binhex40': 'com.apple.binhex-archive',\n 'application/macbinary': 'com.apple.macbinary-archive',\n 'application/mspowerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/msword': 'com.microsoft.word.doc',\n 'application/octet-stream': 'com.microsoft.windows-executable',\n 'application/pdf': 'com.adobe.pdf',\n 'application/photoshop': 'com.adobe.photoshop-image',\n 'application/php': 'public.php-script',\n 'application/plain': 'public.plain-text',\n 'application/postscript': 'com.adobe.postscript',\n 'application/powerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/rar': 'com.rarlab.rar-archive',\n 'application/rdf+xml': 'unofficial.rdf-feed',\n 'application/rss+xml': 'unofficial.rss-feed',\n 'application/rtf': 'public.rtf',\n 'application/smil': 'com.real.smil',\n 'application/stuffit': 'com.allume.stuffit-archive',\n 'application/tar': 'public.tar-archive',\n 'application/tga': 'com.truevision.tga-image',\n 'application/vnd.fpx': 'com.kodak.flashpix.image',\n 'application/vnd.ms-excel': 'com.microsoft.excel.xls',\n 'application/vnd.ms-powerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/vnd.oasis.opendocument.chart': 'org.oasis.opendocument.chart',\n 'application/vnd.oasis.opendocument.database': 'org.oasis.opendocument.database',\n 'application/vnd.oasis.opendocument.formula': 'org.oasis.opendocument.formula',\n 'application/vnd.oasis.opendocument.graphics-template': 'org.oasis.opendocument.graphics',\n 'application/vnd.oasis.opendocument.graphics': 'org.oasis.opendocument.graphics',\n 'application/vnd.oasis.opendocument.image': 'org.oasis.opendocument.image',\n 'application/vnd.oasis.opendocument.presentation-template': 'org.oasis.opendocument.presentation',\n 'application/vnd.oasis.opendocument.presentation': 'org.oasis.opendocument.presentation',\n 'application/vnd.oasis.opendocument.spreadsheet-template': 'org.oasis.opendocument.spreadsheet',\n 'application/vnd.oasis.opendocument.spreadsheet': 'org.oasis.opendocument.spreadsheet',\n 'application/vnd.oasis.opendocument.text-master': 'org.oasis.opendocument.text-master',\n 'application/vnd.oasis.opendocument.text-template': 'org.oasis.opendocument.text',\n 'application/vnd.oasis.opendocument.text-web': 'org.oasis.opendocument.text-web',\n 'application/vnd.oasis.opendocument.text': 'org.oasis.opendocument.text',\n 'application/vnd.rn-realmedia': 'com.real.realmedia',\n 'application/vnd.sun.xml.calc.template': 'org.neooffice.calc',\n 'application/vnd.sun.xml.calc': 'org.neooffice.calc',\n 'application/vnd.sun.xml.draw.template': 'org.neooffice.draw',\n 'application/vnd.sun.xml.draw': 'org.neooffice.draw',\n 'application/vnd.sun.xml.impress.template': 'org.neooffice.impress',\n 'application/vnd.sun.xml.impress': 'org.neooffice.impress',\n 'application/vnd.sun.xml.math': 'org.neooffice.math',\n 'application/vnd.sun.xml.writer.global': 'org.neooffice.global',\n 'application/vnd.sun.xml.writer.template': 'org.neooffice.writer',\n 'application/vnd.sun.xml.writer': 'org.neooffice.writer',\n 'application/vndms-excel': 'com.microsoft.excel.xls',\n 'application/vndms-powerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/vndrn-realmedia': 'com.real.realmedia',\n 'application/x-apple-diskimage': 'com.apple.disk-image-udif',\n 'application/x-applescript': 'com.apple.applescript.script',\n 'application/x-bat': 'com.microsoft.windows-executable',\n 'application/x-binary': 'com.apple.macbinary-archive',\n 'application/x-binhex40': 'com.apple.binhex-archive',\n 'application/x-bittorrent': 'com.bittorrent.torrent',\n 'application/x-bzip2': 'org.bzip.bzip2-archive',\n 'application/x-cpio': 'public.cpio-archive',\n 'application/x-cplusplus': 'public.c-plus-plus-source',\n 'application/x-csh': 'public.csh-script',\n 'application/x-deb': 'org.debian.debian-package',\n 'application/x-debian-package': 'org.debian.debian-package',\n 'application/x-eps': 'com.adobe.encapsulated-postscript',\n 'application/x-excel': 'com.microsoft.excel.xls',\n 'application/x-exe': 'com.microsoft.windows-executable',\n 'application/x-flac': 'org.xiph.flac',\n 'application/x-font-ttf': 'public.truetype-ttf-font',\n 'application/x-font-type1': 'com.adobe.postscript-pfa-font',\n 'application/x-gtar': 'org.gnu.gnu-tar-archive',\n 'application/x-gzip': 'org.gnu.gnu-zip-archive',\n 'application/x-iso-image': 'public.iso-image',\n 'application/x-java-class': 'com.sun.java-class',\n 'application/x-java': 'com.sun.java-web-start',\n 'application/x-javascript': 'com.netscape.javascript-source',\n 'application/x-latex': 'org.tug.tex',\n 'application/x-mac-binhex40': 'com.apple.binhex-archive',\n 'application/x-macbinary': 'com.apple.macbinary-archive',\n 'application/x-midi': 'public.midi',\n 'application/x-mpegURL': 'unofficial.m3u8-playlist',\n 'application/x-ms-wmd': 'com.microsoft.windows-media-wmd',\n 'application/x-ms-wmz': 'com.microsoft.windows-media-wmz',\n 'application/x-msdos-program': 'com.microsoft.windows-executable',\n 'application/x-msdownload': 'com.microsoft.windows-executable',\n 'application/x-msexcel': 'com.microsoft.excel.xls',\n 'application/x-mspowerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/x-pdf': 'com.adobe.pdf',\n 'application/x-perl': 'public.perl-script',\n 'application/x-php': 'public.php-script',\n 'application/x-quartzcomposer': 'com.apple.quartz-composer-composition',\n 'application/x-rar-compressed': 'com.rarlab.rar-archive',\n 'application/x-redhat-package': 'com.redhat.redhat-package',\n 'application/x-rpm': 'com.redhat.redhat-package',\n 'application/x-rtf': 'public.rtf',\n 'application/x-sh': 'public.shell-script',\n 'application/x-shellscript': 'public.shell-script',\n 'application/x-shockwave-flash': 'com.macromedia.shockwave-flash',\n 'application/x-sit': 'com.allume.stuffit-archive',\n 'application/x-smil': 'com.real.smil',\n 'application/x-soundfont': 'com.soundblaster.soundfont',\n 'application/x-stuffit': 'com.allume.stuffit-archive',\n 'application/x-tar': 'public.tar-archive',\n 'application/x-tex': 'org.tug.tex',\n 'application/x-texinfo': 'org.tug.tex',\n 'application/x-troff-msvideo': 'public.avi',\n 'application/x-zip-compressed': 'com.pkware.zip-archive',\n 'application/xhtml+xml': 'public.html',\n 'application/xml': 'public.xml',\n 'application/zip': 'com.pkware.zip-archive',\n 'audio/3gpp': 'public.3gpp',\n 'audio/3gpp2': 'public.3gpp2',\n 'audio/aiff': 'public.aiff-audio',\n 'audio/au': 'public.ulaw-audio',\n 'audio/basic': 'public.ulaw-audio',\n 'audio/flac': 'org.xiph.flac',\n 'audio/mid': 'public.midi',\n 'audio/midi': 'public.midi',\n 'audio/mp3': 'public.mp3',\n 'audio/mp4': 'public.mpeg4-audio',\n 'audio/mp4a-latm': 'public.mpeg4-audio',\n 'audio/mpeg': 'public.mp3',\n 'audio/mpeg3': 'public.mp3',\n 'audio/mpegurl': 'unofficial.m3u-playlist',\n 'audio/mpg': 'public.mp3',\n 'audio/ogg': 'org.xiph.ogg-vorbis',\n 'audio/scpls': 'unofficial.pls-playlist',\n 'audio/snd': 'public.ulaw-audio',\n 'audio/vnd.rn-realaudio': 'com.real.realaudio',\n 'audio/wav': 'com.microsoft.waveform-audio',\n 'audio/wave': 'com.microsoft.waveform-audio',\n 'audio/webm': 'public.webm',\n 'audio/x-adpcm': 'public.ulaw-audio',\n 'audio/x-aiff': 'public.aiff-audio',\n 'audio/x-au': 'public.ulaw-audio',\n 'audio/x-flac': 'org.xiph.flac',\n 'audio/x-matroska': 'public.mka',\n 'audio/x-mid': 'public.midi',\n 'audio/x-midi': 'public.midi',\n 'audio/x-mp3': 'public.mp3',\n 'audio/x-mpeg-3': 'public.mp3',\n 'audio/x-mpeg': 'public.mp3',\n 'audio/x-mpeg3': 'public.mp3',\n 'audio/x-mpegurl': 'unofficial.m3u-playlist',\n 'audio/x-mpg': 'public.mp3',\n 'audio/x-ms-wax': 'com.microsoft.windows-media-wax',\n 'audio/x-ms-wma': 'com.microsoft.windows-media-wma',\n 'audio/x-ogg': 'org.xiph.ogg-vorbis',\n 'audio/x-pn-realaudio-plugin': 'com.real.realaudio',\n 'audio/x-pn-realaudio': 'com.real.realaudio',\n 'audio/x-pn-wav': 'com.microsoft.waveform-audio',\n 'audio/x-realaudio': 'com.real.realmedia',\n 'audio/x-scpls': 'unofficial.pls-playlist',\n 'audio/x-wav': 'com.microsoft.waveform-audio',\n 'font/opentype': 'public.opentype-font',\n 'image/bmp': 'com.microsoft.bmp',\n 'image/efax': 'com.js.efx-fax',\n 'image/eps': 'com.adobe.encapsulated-postscript',\n 'image/fpx': 'com.kodak.flashpix.image',\n 'image/gif': 'com.compuserve.gif',\n 'image/indd': 'com.adobe.indesign-image',\n 'image/indesign': 'com.adobe.indesign-image',\n 'image/jp2': 'public.jpeg2000',\n 'image/jpeg': 'public.jpeg',\n 'image/ms-bmp': 'com.microsoft.bmp',\n 'image/photoshop': 'com.adobe.photoshop-image',\n 'image/pict': 'com.apple.pict',\n 'image/pipeg': 'public.jpeg',\n 'image/pjpeg': 'public.jpeg',\n 'image/png': 'public.png',\n 'image/psd': 'com.adobe.photoshop-image',\n 'image/sgi': 'com.sgi.sgi-image',\n 'image/targa': 'com.truevision.tga-image',\n 'image/tga': 'com.truevision.tga-image',\n 'image/tiff': 'public.tiff',\n 'image/vnd.djvu': 'com.lizardtech.djvu',\n 'image/vndfpx': 'com.kodak.flashpix.image',\n 'image/vndnet-fpx': 'com.kodak.flashpix.image',\n 'image/webp': 'public.webp',\n 'image/x-bitmap': 'com.microsoft.bmp',\n 'image/x-bmp': 'com.microsoft.bmp',\n 'image/x-djvu': 'com.lizardtech.djvu',\n 'image/x-eps': 'com.adobe.encapsulated-postscript',\n 'image/x-icon': 'com.microsoft.ico',\n 'image/x-indesign': 'com.adobe.indesign-image',\n 'image/x-macpict': 'com.apple.pict',\n 'image/x-ms-bmp': 'com.microsoft.bmp',\n 'image/x-photoshop': 'com.adobe.photoshop-image',\n 'image/x-pict': 'com.apple.pict',\n 'image/x-quicktime': 'com.apple.quicktime-image',\n 'image/x-tiff': 'public.tiff',\n 'image/x-windows-bmp': 'com.microsoft.bmp',\n 'image/x-xbitmap': 'com.microsoft.bmp',\n 'image/x-xbm': 'public.xbitmap-image',\n 'image/xbm': 'public.xbitmap-image',\n 'multipart/x-gzip': 'org.gnu.gnu-zip-archive',\n 'multipart/x-zip': 'com.pkware.zip-archive',\n 'music/crescendo': 'public.midi',\n 'text/calendar': 'com.apple.ical.ics',\n 'text/css': 'public.css',\n 'text/directory': 'public.vcard',\n 'text/ecmascript': 'com.netscape.javascript-source',\n 'text/html': 'public.html',\n 'text/javascript': 'com.netscape.javascript-source',\n 'text/php': 'public.php-script',\n 'text/plain': 'public.plain-text',\n 'text/richtext': 'public.rtf',\n 'text/rtf': 'public.rtf',\n 'text/ruby-script': 'public.ruby-script',\n 'text/tex': 'org.tug.tex',\n 'text/vcard': 'public.vcard',\n 'text/vnd.sun.j2me.app-descriptor': 'com.sun.java-app-descriptor',\n 'text/x-asm': 'public.assembly-source',\n 'text/x-c-code': 'public.c-source',\n 'text/x-c-header': 'public.c-header',\n 'text/x-c': 'public.c-source',\n 'text/x-c++-code': 'public.c-plus-plus-source',\n 'text/x-c++-hdr': 'public.c-plus-plus-header',\n 'text/x-c++-src': 'public.c-plus-plus-source',\n 'text/x-c++src': 'public.c-plus-plus-source',\n 'text/x-h': 'public.c-header',\n 'text/x-java-source': 'com.sun.java-source',\n 'text/x-latex': 'org.tug.tex',\n 'text/x-objcppsrc': 'public.objective-c-plus-plus-source',\n 'text/x-objcsrc': 'public.objective-c-source',\n 'text/x-opml': 'unofficial.opml',\n 'text/x-perl-script': 'public.perl-script',\n 'text/x-perl': 'public.perl-script',\n 'text/x-php-script': 'public.php-script',\n 'text/x-python-script': 'public.python-script',\n 'text/x-python': 'public.python-script',\n 'text/x-scriptcsh': 'public.csh-script',\n 'text/x-scriptperl-module': 'public.perl-script',\n 'text/x-scriptperl': 'public.perl-script',\n 'text/x-scriptphyton': 'public.python-script',\n 'text/x-scriptsh': 'public.shell-script',\n 'text/x-server-parsed-html': 'public.html',\n 'text/x-tex': 'org.tug.tex',\n 'text/x-vcalendar': 'com.apple.ical.vcs',\n 'text/x-vcard': 'public.vcard',\n 'text/xhtml': 'public.html',\n 'text/xml': 'public.xml',\n 'video/3gpp': 'public.3gpp',\n 'video/3gpp2': 'public.3gpp2',\n 'video/avi': 'public.avi',\n 'video/MP2T': 'public.mpegts',\n 'video/mp4': 'public.mpeg4',\n 'video/mp4v': 'public.mpeg4',\n 'video/mpeg': 'public.mpeg',\n 'video/mpg': 'public.mpeg',\n 'video/msvideo': 'public.avi',\n 'video/ogg': 'org.xiph.ogg-theora',\n 'video/quicktime': 'com.apple.quicktime-movie',\n 'video/webm': 'public.webm',\n 'video/x-dv': 'public.dv',\n 'video/x-flv': 'public.flv',\n 'video/x-m4v': 'public.mpeg4',\n 'video/x-matroska': 'public.mkv',\n 'video/x-mpeg': 'public.mpeg',\n 'video/x-mpg': 'public.mpeg',\n 'video/x-ms-asf-plugin': 'com.microsoft.advanced-systems-format',\n 'video/x-ms-asf': 'com.microsoft.advanced-systems-format',\n 'video/x-ms-asx': 'com.microsoft.advanced-stream-redirector',\n 'video/x-ms-wm': 'com.microsoft.windows-media-wm',\n 'video/x-ms-wmd': 'com.microsoft.windows-media-wmd',\n 'video/x-ms-wmp': 'com.microsoft.windows-media-wmp',\n 'video/x-ms-wmv': 'com.microsoft.windows-media-wmv',\n 'video/x-ms-wmx': 'com.microsoft.windows-media-wmx',\n 'video/x-ms-wmz': 'com.microsoft.windows-media-wmz',\n 'video/x-ms-wvx': 'com.microsoft.windows-media-wvx',\n 'video/x-msvideo': 'public.avi',\n 'video/x-ogg': 'org.xiph.ogg-theora',\n 'x-msdos-program': 'com.microsoft.windows-executable',\n 'x-music/x-midi': 'public.midi',\n }\n dataOwnerApi: IccDataOwnerXApi\n authenticationProvider: AuthenticationProvider\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n private crypto: IccCryptoXApi,\n private authApi: IccAuthApi,\n 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.fetchImpl = fetchImpl\n this.authenticationProvider = authenticationProvider\n this.dataOwnerApi = dataOwnerApi\n }\n\n override get headers(): Promise<Array<XHR.Header>> {\n return super.headers.then((h) => this.crypto.accessControlKeysHeaders.addAccessControlKeysHeaders(h, EntityWithDelegationTypeName.Document))\n }\n\n /**\n * Creates a new instance of document with initialised encryption metadata (not in the database).\n * @param user the current user.\n * @param message the message this document refers to.\n * @param c initialised data for the document. 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 * - preferredSfk: secret id of the message to use as the secret foreign key to use for the document. The default value will be a\n * secret id of the message known by the topmost parent in the current data owner hierarchy.\n * @return a new instance of document.\n */\n async newInstance(\n user: models.User,\n message?: models.Message,\n c: any = {},\n options: {\n additionalDelegates?: { [dataOwnerId: string]: AccessLevelEnum }\n preferredSfk?: string\n } = {}\n ) {\n if (!message && options.preferredSfk) throw new Error('You need to specify parent message in order to use secret foreign keys.')\n const document = {\n ...(c ?? {}),\n _type: 'org.taktik.icure.entities.Document',\n id: c?.id ?? this.crypto.primitives.randomUuid(),\n created: c?.created ?? new Date().getTime(),\n modified: c?.modified ?? new Date().getTime(),\n responsible: c?.responsible ?? (this.autofillAuthor ? this.dataOwnerApi.getDataOwnerIdOf(user) : undefined),\n author: c?.author ?? (this.autofillAuthor ? user.id : undefined),\n codes: c?.codes ?? [],\n tags: c?.tags ?? [],\n }\n\n const ownerId = this.dataOwnerApi.getDataOwnerIdOf(user)\n if (ownerId !== (await this.dataOwnerApi.getCurrentDataOwnerId())) throw new Error('Can only initialise entities as current data owner.')\n const sfk = message\n ? options.preferredSfk ??\n (await this.crypto.confidential.getAnySecretIdSharedWithParents({ entity: message, type: EntityWithDelegationTypeName.Message }))\n : undefined\n if (message && !sfk) throw new Error(`Couldn't find any sfk of parent message ${message.id}`)\n const extraDelegations = {\n ...Object.fromEntries(\n [...(user.autoDelegations?.all ?? []), ...(user.autoDelegations?.medicalInformation ?? [])].map((d) => [d, AccessLevelEnum.WRITE])\n ),\n ...(options?.additionalDelegates ?? {}),\n }\n return new models.Document(\n await this.crypto.xapi\n .entityWithInitialisedEncryptedMetadata(document, EntityWithDelegationTypeName.Document, message?.id, sfk, true, extraDelegations)\n .then((x) => x.updatedEntity)\n )\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * @deprecated use {@link findIdsByMessage} instead.\n */\n async findByMessage(hcpartyId: string, message: models.Message) {\n const extractedKeys = await this.crypto.xapi.secretIdsOf({ entity: message, type: EntityWithDelegationTypeName.Message }, hcpartyId)\n const topmostParentId = (await this.dataOwnerApi.getCurrentDataOwnerHierarchyIds())[0]\n let documents: Array<models.Document> = await this.findDocumentsByHCPartyPatientForeignKeys(topmostParentId, _.uniq(extractedKeys))\n return await this.decrypt(hcpartyId, documents)\n }\n\n /**\n * Same as {@link findBy} but it will only return the ids of the contacts. It can also filter the documents where Document.created is between\n * startDate and endDate in ascending or descending order by that field. (default: ascending).\n */\n async findIdsByMessage(hcpartyId: string, message: models.Message, startDate?: number, endDate?: number, descending?: boolean): Promise<string[]> {\n const extractedKeys = await this.crypto.xapi.secretIdsOf({ entity: message, type: EntityWithDelegationTypeName.Message }, hcpartyId)\n const topmostParentId = (await this.dataOwnerApi.getCurrentDataOwnerHierarchyIds())[0]\n return this.findDocumentIdsByDataOwnerSecretForeignKey(topmostParentId, _.uniq(extractedKeys), startDate, endDate, descending)\n }\n\n // Note: this is only for dealing with legacy documents: new document are not encrypted, only their attachments are\n decrypt(hcpartyId: string, documents: Array<models.Document>): Promise<Array<models.Document>> {\n return Promise.all(\n documents.map((document) =>\n this.crypto.xapi.decryptAndImportAllDecryptionKeys({ entity: document, type: EntityWithDelegationTypeName.Document }).then((keys) => {\n if (!keys.length) {\n console.log('Cannot decrypt document', document.id)\n return Promise.resolve(document)\n }\n\n if (keys.length && (document.encryptedSelf || document.encryptedAttachment)) {\n const key = keys[0].key\n return Promise.all([\n document.encryptedSelf\n ? new Promise((resolve: (value: ArrayBuffer | null) => any) => {\n this.crypto.primitives.AES.decrypt(key, string2ua(a2b(document.encryptedSelf!))).then(resolve, () => {\n console.log('Cannot decrypt document', document.id)\n resolve(null)\n })\n })\n : Promise.resolve(null),\n document.encryptedAttachment\n ? new Promise((resolve: (value: ArrayBuffer | null) => any) => {\n this.crypto.primitives.AES.decrypt(key, document.encryptedAttachment!).then(resolve, () => {\n console.log('Cannot decrypt document', document.id)\n resolve(null)\n })\n })\n : Promise.resolve(null),\n ]).then((decrypted: [ArrayBuffer | null, ArrayBuffer | null]) => {\n if (decrypted) {\n if (decrypted[0]) {\n document = _.extend(document, JSON.parse(ua2string(decrypted[0])))\n }\n if (decrypted[1]) {\n document.decryptedAttachment = decrypted[1]\n }\n }\n return document\n })\n } else {\n return Promise.resolve(document)\n }\n })\n )\n ).catch(function (e: Error) {\n console.log(e)\n return Promise.resolve(documents)\n })\n }\n\n //prettier-ignore\n getAttachmentAs(documentId: string, attachmentId: string, returnType: \"application/octet-stream\", enckeys?: string, fileName?: string): Promise<ArrayBuffer>\n //prettier-ignore\n getAttachmentAs(documentId: string, attachmentId: string, returnType: \"text/plain\", enckeys?: string, fileName?: string): Promise<string>\n //prettier-ignore\n getAttachmentAs(documentId: string, attachmentId: string, returnType: \"application/json\", enckeys?: string, fileName?: string): Promise<any>\n /**\n * @deprecated use getMainAttachmentAs instead\n */\n async getAttachmentAs(\n documentId: string,\n attachmentId: string,\n returnType: 'application/octet-stream' | 'text/plain' | 'application/json',\n enckeys?: string,\n fileName?: string\n ): Promise<any> {\n if (!!enckeys || !!fileName) {\n console.warn('Using getAttachmentAs method with a value for enckeys or fileName does nothing anymore.')\n }\n return this.getMainAttachmentAs(documentId, returnType)\n }\n\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: \"application/octet-stream\"): Promise<ArrayBuffer>\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: \"text/plain\"): Promise<string>\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: \"application/json\"): Promise<any>\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: 'application/octet-stream' | 'text/plain' | 'application/json'): Promise<any>\n async getMainAttachmentAs(documentId: string, returnType: 'application/octet-stream' | 'text/plain' | 'application/json'): Promise<any> {\n const url = this.host + `/document/${documentId}/attachment` + '?ts=' + new Date().getTime()\n return XHR.sendCommand('GET', url, await this.headers, null, this.fetchImpl, returnType, this.authenticationProvider.getAuthService())\n .then((doc) => doc.body)\n .catch((err) => this.handleError(err))\n }\n\n //prettier-ignore\n getAndTryDecryptMainAttachmentAs(document: models.Document, returnType: \"application/octet-stream\"): Promise<ArrayBuffer | undefined>\n //prettier-ignore\n getAndTryDecryptMainAttachmentAs(document: models.Document, returnType: \"text/plain\"): Promise<string | undefined>\n //prettier-ignore\n getAndTryDecryptMainAttachmentAs(document: models.Document, returnType: \"application/json\"): Promise<any | undefined>\n //prettier-ignore\n getAndTryDecryptMainAttachmentAs(document: models.Document, returnType: 'application/octet-stream' | 'text/plain' | 'application/json'): Promise<any | undefined>\n async getAndTryDecryptMainAttachmentAs(\n document: models.Document,\n returnType: 'application/octet-stream' | 'text/plain' | 'application/json'\n ): Promise<any | undefined> {\n const key = (await this.crypto.xapi.encryptionKeysOf({ entity: document, type: EntityWithDelegationTypeName.Document }, undefined))[0]\n if (!key) return undefined\n const tryParse = this.parserFor(returnType)\n const attachmentInfo = await this.getAndTryDecryptDocumentAttachment(document, (decrypted) => Promise.resolve(tryParse(decrypted) !== undefined))\n if (attachmentInfo.wasDecrypted) {\n return tryParse(attachmentInfo.data)\n } else return undefined\n }\n private parserFor(returnType: 'application/octet-stream' | 'text/plain' | 'application/json'): (data: ArrayBuffer) => any | undefined {\n if (returnType === 'application/octet-stream') {\n return (data) => data\n } else if (returnType === 'text/plain') {\n return (data) => {\n try {\n return ua2utf8(data)\n } catch (e) {\n return undefined\n }\n }\n } else if (returnType === 'application/json') {\n return (data) => {\n try {\n return JSON.parse(ua2utf8(data))\n } catch (e) {\n return undefined\n }\n }\n } else throw new Error(`Unsupported type ${returnType}`)\n }\n\n // noinspection JSUnusedGlobalSymbols\n uti(mimeType: string, extension: string) {\n return (mimeType && mimeType !== 'application/octet-stream' ? this.utiDefs[mimeType] : this.utiExts[extension]) || this.utiDefs[mimeType]\n }\n\n // noinspection JSUnusedGlobalSymbols\n mimeType(uti: string) {\n return this.utiRevDefs[uti]\n }\n\n /**\n * Adds an attachment to a document, encrypting it on client side using the encryption keys of the provided document.\n * @param document a document.\n * @param attachment a new main attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async encryptAndSetDocumentAttachment(document: models.Document, attachment: ArrayBuffer | Uint8Array, utis?: string[]): Promise<models.Document> {\n if (!document.rev) throw new Error('Cannot set attachment on document without rev')\n const { encryptedData, updatedEntity } = await this.crypto.xapi.encryptDataOf(document, EntityWithDelegationTypeName.Document, attachment, (d) =>\n this.modifyDocument(d)\n )\n return await this.setMainDocumentAttachment(document.id!, updatedEntity?.rev ?? document.rev, encryptedData, utis, true)\n }\n\n /**\n * Adds an unencrypted attachment to a document.\n * @param document a document.\n * @param attachment a new main attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async setClearDocumentAttachment(document: models.Document, attachment: ArrayBuffer | Uint8Array, utis?: string[]): Promise<models.Document> {\n if (!document.rev) throw new Error('Cannot set attachment on document without rev')\n return await this.setMainDocumentAttachment(document.id!, document.rev, attachment, utis, false)\n }\n\n /**\n * Adds a secondary attachment to a document, encrypting it on client side using the encryption keys of the provided document.\n * @param document a document.\n * @param secondaryAttachmentKey key for the secondary attachment.\n * @param attachment a new secondary attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async encryptAndSetSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n attachment: ArrayBuffer | Uint8Array,\n utis?: string[]\n ): Promise<models.Document> {\n if (!document.rev) throw new Error('Cannot set attachment on document without rev')\n const { encryptedData, updatedEntity } = await this.crypto.xapi.encryptDataOf(document, EntityWithDelegationTypeName.Document, attachment, (d) =>\n this.modifyDocument()\n )\n return await this.setSecondaryAttachment(document.id!, secondaryAttachmentKey, updatedEntity?.rev ?? document.rev!, encryptedData, utis, true)\n }\n\n /**\n * Adds an unencrypted secondary attachment to a document.\n * @param document a document.\n * @param secondaryAttachmentKey key for the secondary attachment.\n * @param attachment a new secondary attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async setClearSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n attachment: ArrayBuffer | Uint8Array,\n utis?: string[]\n ): Promise<models.Document> {\n return await this.setSecondaryAttachment(document.id!, secondaryAttachmentKey, document.rev!, attachment, utis, false)\n }\n\n /**\n * Gets the main attachment of a document and tries to decrypt it using the encryption keys of the document, throwing an error if the operation fails.\n * @param document a document.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return the decrypted attachment, if it could be decrypted, else the encrypted attachment.\n */\n async getAndDecryptDocumentAttachment(\n document: models.Document,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<ArrayBuffer> {\n const retrieved = await this.getAndTryDecryptDocumentAttachment(document, (x) => validator(x))\n if (!retrieved.wasDecrypted) throw new Error(`No valid key found to decrypt data of document ${document.id}.`)\n return retrieved.data\n }\n\n /**\n * Gets the main attachment of a document and tries to decrypt it using the encryption keys of the document.\n * @param document a document.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return an object containing:\n * - data: the decrypted attachment, if it could be decrypted, else the encrypted attachment.\n * - wasDecrypted: if the data was successfully decrypted or not\n */\n async getAndTryDecryptDocumentAttachment(\n document: models.Document,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<{ data: ArrayBuffer; wasDecrypted: boolean }> {\n return await this.crypto.xapi.tryDecryptDataOf(\n { entity: document, type: EntityWithDelegationTypeName.Document },\n await this.getRawMainDocumentAttachment(document.id!),\n (x) => validator(x)\n )\n }\n\n /**\n * Gets the secondary attachment of a document and tries to decrypt it using the encryption keys of the document, throwing an error if the operation fails.\n * @param document a document.\n * @param secondaryAttachmentKey key of the secondary attachment.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return the decrypted attachment.\n */\n async getAndDecryptSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<ArrayBuffer> {\n const { data, wasDecrypted } = await this.getAndTryDecryptSecondaryDocumentAttachment(document, secondaryAttachmentKey, (x) => validator(x))\n if (!wasDecrypted) throw new Error(`No valid key found to decrypt data of document ${document.id}.`)\n return data\n }\n\n /**\n * Gets the secondary attachment of a document and tries to decrypt it using the encryption keys of the document.\n * @param document a document.\n * @param secondaryAttachmentKey key of the secondary attachment.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return an object containing:\n * - data: the decrypted attachment, if it could be decrypted, else the encrypted attachment.\n * - wasDecrypted: if the data was successfully decrypted or not\n */\n async getAndTryDecryptSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<{ data: ArrayBuffer; wasDecrypted: boolean }> {\n return await this.crypto.xapi.tryDecryptDataOf(\n { entity: document, type: EntityWithDelegationTypeName.Document },\n await this.getSecondaryAttachment(document.id!, secondaryAttachmentKey),\n (x) => validator(x)\n )\n }\n\n /**\n * @param document a document\n * @return the id of the message that the document refers to, retrieved from the encrypted metadata. Normally there should only be one element\n * in the returned array, but in case of entity merges there could be multiple values.\n */\n async decryptMessageIdOf(document: models.Document): Promise<string[]> {\n return this.crypto.xapi.owningEntityIdsOf({ entity: document, type: EntityWithDelegationTypeName.Document }, undefined)\n }\n\n /**\n * @return if the logged data owner has write access to the content of the given document\n */\n async hasWriteAccess(document: models.Document): Promise<boolean> {\n return this.crypto.xapi.hasWriteAccess({ entity: document, type: EntityWithDelegationTypeName.Document })\n }\n\n /**\n * Share an existing document with other data owners, allowing them to access the non-encrypted data of the document 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 document.\n * @param document the document 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}).\n * - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\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 document: models.Document,\n options: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n shareMessageId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n } = {}\n ): Promise<models.Document> {\n return this.shareWithMany(document, { [delegateId]: options })\n }\n\n /**\n * Share an existing document with other data owners, allowing them to access the non-encrypted data of the document and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param document the document 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}).\n * - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity.\n */\n async shareWithMany(\n document: models.Document,\n delegates: {\n [delegateId: string]: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n shareMessageId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<models.Document> {\n return (await this.tryShareWithMany(document, delegates)).updatedEntityOrThrow\n }\n /**\n * Share an existing document with other data owners, allowing them to access the non-encrypted data of the document and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param document the document 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}).\n * - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\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 document: models.Document,\n delegates: {\n [delegateId: string]: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n shareMessageId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<ShareResult<models.Document>> {\n const self = await this.dataOwnerApi.getCurrentDataOwnerId()\n // All entities should have an encryption key.\n const entityWithEncryptionKey = await this.crypto.xapi.ensureEncryptionKeysInitialised(document, EntityWithDelegationTypeName.Document)\n const updatedEntity = entityWithEncryptionKey ? await this.modifyDocument(entityWithEncryptionKey) : document\n return this.crypto.xapi\n .simpleShareOrUpdateEncryptedEntityMetadata(\n {\n entity: updatedEntity,\n type: EntityWithDelegationTypeName.Document,\n },\n Object.fromEntries(\n Object.entries(delegates).map(([delegateId, options]) => [\n delegateId,\n {\n requestedPermissions: options.requestedPermissions,\n shareEncryptionKeys: options.shareEncryptionKey,\n shareOwningEntityIds: options.shareMessageId,\n shareSecretIds: options.shareSecretIds,\n },\n ])\n ),\n (x) => this.bulkShareDocument(x)\n )\n .then((r) => r.mapSuccessAsync((e) => this.decrypt(self, [e]).then((es) => es[0])))\n }\n\n getDataOwnersWithAccessTo(\n entity: models.Document\n ): Promise<{ permissionsByDataOwnerId: { [p: string]: AccessLevelEnum }; hasUnknownAnonymousDataOwners: boolean }> {\n return this.crypto.delegationsDeAnonymization.getDataOwnersWithAccessTo({ entity, type: EntityWithDelegationTypeName.Document })\n }\n\n getEncryptionKeysOf(entity: models.Document): Promise<string[]> {\n return this.crypto.xapi.encryptionKeysOf({ entity, type: EntityWithDelegationTypeName.Document }, undefined)\n }\n\n createDelegationDeAnonymizationMetadata(entity: models.Document, delegates: string[]): Promise<void> {\n return this.crypto.delegationsDeAnonymization.createOrUpdateDeAnonymizationInfo(\n { entity, type: EntityWithDelegationTypeName.Document },\n delegates\n )\n }\n}\n"]}
|