@icure/api 8.0.28 → 8.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/icc-api/api/IccAccesslogApi.d.ts +14 -9
- package/icc-api/api/IccAccesslogApi.js +33 -22
- package/icc-api/api/IccAccesslogApi.js.map +1 -1
- package/icc-api/api/IccCalendarItemApi.d.ts +12 -0
- package/icc-api/api/IccCalendarItemApi.js +28 -0
- package/icc-api/api/IccCalendarItemApi.js.map +1 -1
- package/icc-api/api/IccClassificationApi.d.ts +12 -12
- package/icc-api/api/IccClassificationApi.js +25 -23
- package/icc-api/api/IccClassificationApi.js.map +1 -1
- package/icc-api/api/IccContactApi.d.ts +13 -11
- package/icc-api/api/IccContactApi.js +29 -25
- package/icc-api/api/IccContactApi.js.map +1 -1
- package/icc-api/api/IccDocumentApi.d.ts +2 -2
- package/icc-api/api/IccDocumentApi.js +10 -9
- package/icc-api/api/IccDocumentApi.js.map +1 -1
- package/icc-api/api/IccFormApi.d.ts +11 -10
- package/icc-api/api/IccFormApi.js +21 -19
- package/icc-api/api/IccFormApi.js.map +1 -1
- package/icc-api/api/IccHelementApi.d.ts +11 -9
- package/icc-api/api/IccHelementApi.js +21 -18
- package/icc-api/api/IccHelementApi.js.map +1 -1
- package/icc-api/api/IccInvoiceApi.d.ts +11 -9
- package/icc-api/api/IccInvoiceApi.js +21 -18
- package/icc-api/api/IccInvoiceApi.js.map +1 -1
- package/icc-api/api/IccMessageApi.d.ts +15 -9
- package/icc-api/api/IccMessageApi.js +35 -17
- package/icc-api/api/IccMessageApi.js.map +1 -1
- package/icc-x-api/crypto/NativeCryptoPrimitivesBridge.js +2 -2
- package/icc-x-api/crypto/NativeCryptoPrimitivesBridge.js.map +1 -1
- package/icc-x-api/icc-accesslog-x-api.d.ts +3 -2
- package/icc-x-api/icc-accesslog-x-api.js +8 -14
- package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
- package/icc-x-api/icc-contact-x-api.d.ts +0 -1
- package/icc-x-api/icc-contact-x-api.js +0 -15
- package/icc-x-api/icc-contact-x-api.js.map +1 -1
- package/icc-x-api/icc-document-x-api.js +1 -1
- package/icc-x-api/icc-document-x-api.js.map +1 -1
- package/icc-x-api/icc-form-x-api.js.map +1 -1
- package/icc-x-api/icc-helement-x-api.d.ts +0 -2
- package/icc-x-api/icc-helement-x-api.js +0 -18
- package/icc-x-api/icc-helement-x-api.js.map +1 -1
- package/icc-x-api/icc-invoice-x-api.js.map +1 -1
- package/icc-x-api/icc-message-x-api.js.map +1 -1
- package/package.json +1 -1
|
@@ -32,7 +32,6 @@ export declare class IccMessageApi {
|
|
|
32
32
|
setHeaders(h: Array<XHR.Header>): void;
|
|
33
33
|
handleError(e: XHR.XHRError): never;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
36
35
|
* @summary Creates a message
|
|
37
36
|
* @param body
|
|
38
37
|
*/
|
|
@@ -94,14 +93,17 @@ export declare class IccMessageApi {
|
|
|
94
93
|
*/
|
|
95
94
|
findMessagesByHCPartyPatientForeignKeys(secretFKeys: string): Promise<Array<Message>>;
|
|
96
95
|
/**
|
|
97
|
-
* @summary List
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
* @param
|
|
101
|
-
* @param
|
|
102
|
-
* @
|
|
96
|
+
* @summary List Message ids by data owner and a set of secret foreign key. The ids will be sorted by Message sent, in ascending or descending
|
|
97
|
+
* order according to the specified parameter value.
|
|
98
|
+
*
|
|
99
|
+
* @param dataOwnerId the data owner id.
|
|
100
|
+
* @param secretFKeys an array of secret foreign keys.
|
|
101
|
+
* @param startDate a timestamp in epoch milliseconds. If undefined, all the message ids since the beginning of time will be returned.
|
|
102
|
+
* @param endDate a timestamp in epoch milliseconds. If undefined, all the message ids until the end of time will be returned.
|
|
103
|
+
* @param descending whether to return the ids ordered in ascending or descending order by Message sent.
|
|
104
|
+
* @return a promise that will resolve in an Array of Message ids.
|
|
103
105
|
*/
|
|
104
|
-
|
|
106
|
+
listMessageIdsByDataOwnerPatientSentDate(dataOwnerId: string, secretFKeys: string[], startDate?: number, endDate?: number, descending?: boolean): Promise<string[]>;
|
|
105
107
|
/**
|
|
106
108
|
*
|
|
107
109
|
* @summary Get all messages (paginated) for current HC Party and provided to address
|
|
@@ -149,11 +151,15 @@ export declare class IccMessageApi {
|
|
|
149
151
|
*/
|
|
150
152
|
getChildrenMessagesOfList(body?: ListOfIds): Promise<Array<Message>>;
|
|
151
153
|
/**
|
|
152
|
-
*
|
|
153
154
|
* @summary Gets a message
|
|
154
155
|
* @param messageId
|
|
155
156
|
*/
|
|
156
157
|
getMessage(messageId: string): Promise<Message>;
|
|
158
|
+
/**
|
|
159
|
+
* @summary Gets batch of messages by their ids.
|
|
160
|
+
* @param messageIds the ids of the messages
|
|
161
|
+
*/
|
|
162
|
+
getMessages(messageIds: ListOfIds): Promise<Message[]>;
|
|
157
163
|
/**
|
|
158
164
|
*
|
|
159
165
|
* @summary Get children messages of provided message
|
|
@@ -24,6 +24,7 @@ exports.IccMessageApi = void 0;
|
|
|
24
24
|
const XHR_1 = require("./XHR");
|
|
25
25
|
const DocIdentifier_1 = require("../model/DocIdentifier");
|
|
26
26
|
const IcureStub_1 = require("../model/IcureStub");
|
|
27
|
+
const ListOfIds_1 = require("../model/ListOfIds");
|
|
27
28
|
const Message_1 = require("../model/Message");
|
|
28
29
|
const PaginatedListMessage_1 = require("../model/PaginatedListMessage");
|
|
29
30
|
const AuthenticationProvider_1 = require("../../icc-x-api/auth/AuthenticationProvider");
|
|
@@ -46,7 +47,6 @@ class IccMessageApi {
|
|
|
46
47
|
throw e;
|
|
47
48
|
}
|
|
48
49
|
/**
|
|
49
|
-
*
|
|
50
50
|
* @summary Creates a message
|
|
51
51
|
* @param body
|
|
52
52
|
*/
|
|
@@ -207,24 +207,29 @@ class IccMessageApi {
|
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
209
|
/**
|
|
210
|
-
* @summary List
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
* @param
|
|
214
|
-
* @param
|
|
215
|
-
* @
|
|
210
|
+
* @summary List Message ids by data owner and a set of secret foreign key. The ids will be sorted by Message sent, in ascending or descending
|
|
211
|
+
* order according to the specified parameter value.
|
|
212
|
+
*
|
|
213
|
+
* @param dataOwnerId the data owner id.
|
|
214
|
+
* @param secretFKeys an array of secret foreign keys.
|
|
215
|
+
* @param startDate a timestamp in epoch milliseconds. If undefined, all the message ids since the beginning of time will be returned.
|
|
216
|
+
* @param endDate a timestamp in epoch milliseconds. If undefined, all the message ids until the end of time will be returned.
|
|
217
|
+
* @param descending whether to return the ids ordered in ascending or descending order by Message sent.
|
|
218
|
+
* @return a promise that will resolve in an Array of Message ids.
|
|
216
219
|
*/
|
|
217
|
-
|
|
220
|
+
listMessageIdsByDataOwnerPatientSentDate(dataOwnerId, secretFKeys, startDate, endDate, descending) {
|
|
218
221
|
return __awaiter(this, void 0, void 0, function* () {
|
|
219
222
|
const _url = this.host +
|
|
220
|
-
`/message/
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
(!!
|
|
224
|
-
(!!
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
223
|
+
`/message/byDataOwnerPatientSentDate?ts=${new Date().getTime()}` +
|
|
224
|
+
'&dataOwnerId=' +
|
|
225
|
+
encodeURIComponent(dataOwnerId) +
|
|
226
|
+
(!!startDate ? `&startDate=${encodeURIComponent(startDate)}` : '') +
|
|
227
|
+
(!!endDate ? `&endDate=${encodeURIComponent(endDate)}` : '') +
|
|
228
|
+
(!!descending ? `&descending=${descending}` : '');
|
|
229
|
+
const headers = (yield this.headers).filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
230
|
+
const body = new ListOfIds_1.ListOfIds({ ids: secretFKeys });
|
|
231
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
232
|
+
.then((doc) => doc.body.map((it) => JSON.parse(JSON.stringify(it))))
|
|
228
233
|
.catch((err) => this.handleError(err));
|
|
229
234
|
});
|
|
230
235
|
}
|
|
@@ -350,7 +355,6 @@ class IccMessageApi {
|
|
|
350
355
|
});
|
|
351
356
|
}
|
|
352
357
|
/**
|
|
353
|
-
*
|
|
354
358
|
* @summary Gets a message
|
|
355
359
|
* @param messageId
|
|
356
360
|
*/
|
|
@@ -364,6 +368,20 @@ class IccMessageApi {
|
|
|
364
368
|
.catch((err) => this.handleError(err));
|
|
365
369
|
});
|
|
366
370
|
}
|
|
371
|
+
/**
|
|
372
|
+
* @summary Gets batch of messages by their ids.
|
|
373
|
+
* @param messageIds the ids of the messages
|
|
374
|
+
*/
|
|
375
|
+
getMessages(messageIds) {
|
|
376
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
377
|
+
const _url = this.host + `/message/byIds` + '?ts=' + new Date().getTime();
|
|
378
|
+
let headers = yield this.headers;
|
|
379
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
380
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, messageIds, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
381
|
+
.then((doc) => doc.body.map((it) => new Message_1.Message(it)))
|
|
382
|
+
.catch((err) => this.handleError(err));
|
|
383
|
+
});
|
|
384
|
+
}
|
|
367
385
|
/**
|
|
368
386
|
*
|
|
369
387
|
* @summary Get children messages of provided message
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IccMessageApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccMessageApi.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAE3B,0DAAsD;AACtD,kDAA8C;AAE9C,8CAA0C;AAE1C,wEAAoE;AACpE,wFAA8G;AAC9G,qDAAiD;AAEjD,mFAA+E;AAK/E,MAAa,aAAa;IAMxB,IAAI,OAAO;QACT,OAAO,OAAO,CAAC,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AAW,CAAC,GAAG,CAAC,CAAC,CAAA;QAC1C,CAAC;KAAA;CACF;AA1iBD,sCA0iBC","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 { Delegation } from '../model/Delegation'\nimport { DocIdentifier } from '../model/DocIdentifier'\nimport { IcureStub } from '../model/IcureStub'\nimport { ListOfIds } from '../model/ListOfIds'\nimport { Message } from '../model/Message'\nimport { MessagesReadStatusUpdate } from '../model/MessagesReadStatusUpdate'\nimport { PaginatedListMessage } from '../model/PaginatedListMessage'\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 { FilterChainMessage } from '../model/FilterChainMessage'\nimport { AbstractFilterMessage } from '../model/AbstractFilterMessage'\nimport { BulkShareOrUpdateMetadataParams } from '../model/requests/BulkShareOrUpdateMetadataParams'\n\nexport class IccMessageApi {\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 *\n * @summary Creates a message\n * @param body\n */\n async createMessage(body?: Message): Promise<Message> {\n const _url = this.host + `/message` + '?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 Message(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Creates a message\n * @param body\n */\n async createMessageInTopic(body?: Message): Promise<Message> {\n const _url = this.host + `/message/topic` + '?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 Message(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Deletes a message delegation\n * @param messageId\n * @param delegateId\n */\n async deleteDelegation(messageId: string, delegateId: string): Promise<Message> {\n let _body = null\n\n const _url =\n this.host +\n `/message/${encodeURIComponent(String(messageId))}/delegate/${encodeURIComponent(String(delegateId))}` +\n '?ts=' +\n 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 Message(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Deletes a batch of messages.\n *\n * @param messageIds a ListOfIds containing the ids of the messages to delete.\n * @return a Promise that will resolve in an array of DocIdentifiers of the messages successfully deleted\n */\n async deleteMessages(messageIds: 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 + `/message/delete/batch` + '?ts=' + new Date().getTime(),\n headers,\n messageIds,\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 message by id.\n *\n * @param messageId the id of the message to delete.\n * @return a Promise that will resolve in the DocIdentifier of the deleted message.\n */\n async deleteMessage(messageId: string): Promise<DocIdentifier> {\n return XHR.sendCommand(\n 'DELETE',\n this.host + `/message/${encodeURIComponent(messageId)}` + '?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 *\n * @summary Get all messages (paginated) for current HC Party\n * @param startKey\n * @param startDocumentId\n * @param limit\n */\n async findMessages(startKey?: string, startDocumentId?: string, limit?: number): Promise<PaginatedListMessage> {\n let _body = null\n\n const _url =\n this.host +\n `/message` +\n '?ts=' +\n new Date().getTime() +\n (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (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) => new PaginatedListMessage(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get all messages (paginated) for current HC Party and provided from address\n * @param fromAddress\n * @param startKey\n * @param startDocumentId\n * @param limit\n * @param hcpId\n */\n async findMessagesByFromAddress(\n fromAddress?: string,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n hcpId?: string\n ): Promise<PaginatedListMessage> {\n let _body = null\n\n const _url =\n this.host +\n `/message/byFromAddress` +\n '?ts=' +\n new Date().getTime() +\n (fromAddress ? '&fromAddress=' + encodeURIComponent(String(fromAddress)) : '') +\n (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +\n (hcpId ? '&hcpId=' + encodeURIComponent(String(hcpId)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListMessage(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary List messages found By Healthcare Party and secret foreign keys.\n * @param body\n */\n async findMessagesByHCPartyPatientForeignKeysUsingPost(body?: Array<string>): Promise<Array<Message>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/message/byHcPartySecretForeignKeys` + '?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)\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Message(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Keys must be delimited by commas.\n * @summary List messages found By Healthcare Party and secret foreign keys.\n * @param secretFKeys\n */\n async findMessagesByHCPartyPatientForeignKeys(secretFKeys: string): Promise<Array<Message>> {\n let _body = null\n\n const _url =\n this.host +\n `/message/byHcPartySecretForeignKeys` +\n '?ts=' +\n new Date().getTime() +\n (secretFKeys ? '&secretFKeys=' + encodeURIComponent(String(secretFKeys)) : '')\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 Message(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary List messages found for the current healthcare party and a single secret foreign key.\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 PaginatedListMessage.\n */\n async findMessagesByHCPartyPatientForeignKey(\n secretFKey: string,\n startKey?: string,\n startDocumentId?: string,\n limit?: number\n ): Promise<PaginatedListMessage> {\n const _url =\n this.host +\n `/message/byHcPartySecretForeignKeys?ts=${new Date().getTime()}` +\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 PaginatedListMessage(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get all messages (paginated) for current HC Party and provided to address\n * @param toAddress\n * @param startKey\n * @param startDocumentId\n * @param limit\n * @param reverse\n * @param hcpId\n */\n async findMessagesByToAddress(\n toAddress?: string,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n reverse?: boolean,\n hcpId?: string\n ): Promise<PaginatedListMessage> {\n let _body = null\n\n const _url =\n this.host +\n `/message/byToAddress` +\n '?ts=' +\n new Date().getTime() +\n (toAddress ? '&toAddress=' + encodeURIComponent(String(toAddress)) : '') +\n (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +\n (reverse ? '&reverse=' + encodeURIComponent(String(reverse)) : '') +\n (hcpId ? '&hcpId=' + encodeURIComponent(String(hcpId)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListMessage(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get all messages (paginated) for current HC Party and provided transportGuid\n * @param transportGuid\n * @param received\n * @param startKey\n * @param startDocumentId\n * @param limit\n * @param hcpId\n */\n async findMessagesByTransportGuid(\n transportGuid?: string,\n received?: boolean,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n hcpId?: string\n ): Promise<PaginatedListMessage> {\n let _body = null\n\n const _url =\n this.host +\n `/message/byTransportGuid` +\n '?ts=' +\n new Date().getTime() +\n (transportGuid ? '&transportGuid=' + encodeURIComponent(String(transportGuid)) : '') +\n (received ? '&received=' + encodeURIComponent(String(received)) : '') +\n (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +\n (hcpId ? '&hcpId=' + encodeURIComponent(String(hcpId)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListMessage(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get all messages starting by a prefix between two date\n * @param transportGuid\n * @param from\n * @param to\n * @param startKey\n * @param startDocumentId\n * @param limit\n * @param hcpId\n */\n async findMessagesByTransportGuidSentDate(\n transportGuid?: string,\n from?: number,\n to?: number,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n hcpId?: string\n ): Promise<PaginatedListMessage> {\n let _body = null\n\n const _url =\n this.host +\n `/message/byTransportGuidSentDate` +\n '?ts=' +\n new Date().getTime() +\n (transportGuid ? '&transportGuid=' + encodeURIComponent(String(transportGuid)) : '') +\n (from ? '&from=' + encodeURIComponent(String(from)) : '') +\n (to ? '&to=' + encodeURIComponent(String(to)) : '') +\n (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +\n (hcpId ? '&hcpId=' + encodeURIComponent(String(hcpId)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListMessage(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get children messages of provided message\n * @param messageId\n */\n async getChildrenMessages(messageId: string): Promise<Array<Message>> {\n let _body = null\n\n const _url = this.host + `/message/${encodeURIComponent(String(messageId))}/children` + '?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 Message(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get children messages of provided message\n * @param body\n */\n async getChildrenMessagesOfList(body?: ListOfIds): Promise<Array<Message>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/message/children/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('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Message(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets a message\n * @param messageId\n */\n async getMessage(messageId: string): Promise<Message> {\n let _body = null\n\n const _url = this.host + `/message/${encodeURIComponent(String(messageId))}` + '?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 Message(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get children messages of provided message\n * @param body\n */\n async listMessagesByInvoiceIds(body?: ListOfIds): Promise<Array<Message>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/message/byInvoiceId` + '?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 Message(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get all messages for current HC Party and provided transportGuids\n * @param body\n * @param hcpId\n */\n async listMessagesByTransportGuids(hcpId: string, body?: ListOfIds): Promise<Array<Message>> {\n let _body = null\n _body = body\n\n const _url =\n this.host + `/message/byTransportGuid/list` + '?ts=' + new Date().getTime() + (hcpId ? '&hcpId=' + encodeURIComponent(String(hcpId)) : '')\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 Message(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Updates a message\n * @param body\n */\n async modifyMessage(body?: Message): Promise<Message> {\n let _body = null\n _body = body\n\n const _url = this.host + `/message` + '?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 Message(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Adds a delegation to a message\n * @param body\n * @param messageId\n */\n async newMessageDelegations(messageId: string, body?: Array<Delegation>): Promise<IcureStub> {\n let _body = null\n _body = body\n\n const _url = this.host + `/message/${encodeURIComponent(String(messageId))}/delegate` + '?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 IcureStub(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Set read status for given list of messages\n * @param body\n */\n async setMessagesReadStatus(body?: MessagesReadStatusUpdate): Promise<Array<Message>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/message/readstatus` + '?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 Message(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Set status bits for given list of messages\n * @param body\n * @param status\n */\n async setMessagesStatusBits(status: number, body?: ListOfIds): Promise<Array<Message>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/message/status/${encodeURIComponent(String(status))}` + '?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 Message(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @internal this method is for internal use only and may be changed without notice\n */\n async bulkShareMessages(request: BulkShareOrUpdateMetadataParams): Promise<EntityBulkShareResult<Message>[]> {\n const _url = this.host + '/message/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<Message>(x, Message)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of messages along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.\n * @summary List messages for the current user (HcParty) or the given hcparty in the filter\n * @param body\n * @param startDocumentId A Message document ID\n * @param limit Number of rows\n */\n async filterMessagesBy(body: FilterChainMessage, startDocumentId?: string, limit?: number): Promise<PaginatedListMessage> {\n const _url =\n this.host +\n `/message/filter` +\n '?ts=' +\n new Date().getTime() +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '')\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 PaginatedListMessage(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get ids of messages matching the provided filter for the current user (HcParty)\n * @param body\n */\n async matchMessagesBy(body: AbstractFilterMessage): Promise<Array<string>> {\n const _url = this.host + `/message/match` + '?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) => JSON.parse(JSON.stringify(it))))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IccMessageApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccMessageApi.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAE3B,0DAAsD;AACtD,kDAA8C;AAC9C,kDAA8C;AAC9C,8CAA0C;AAE1C,wEAAoE;AACpE,wFAA8G;AAC9G,qDAAiD;AAEjD,mFAA+E;AAM/E,MAAa,aAAa;IAMxB,IAAI,OAAO;QACT,OAA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AAW,CAAC,GAAG,CAAC,CAAC,CAAA;QAC1C,CAAC;KAAA;CACF;AA3jBD,sCA2jBC","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 { Delegation } from '../model/Delegation'\nimport { DocIdentifier } from '../model/DocIdentifier'\nimport { IcureStub } from '../model/IcureStub'\nimport { ListOfIds } from '../model/ListOfIds'\nimport { Message } from '../model/Message'\nimport { MessagesReadStatusUpdate } from '../model/MessagesReadStatusUpdate'\nimport { PaginatedListMessage } from '../model/PaginatedListMessage'\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 { FilterChainMessage } from '../model/FilterChainMessage'\nimport { AbstractFilterMessage } from '../model/AbstractFilterMessage'\nimport { BulkShareOrUpdateMetadataParams } from '../model/requests/BulkShareOrUpdateMetadataParams'\nimport { AccessLog } from '../model/AccessLog'\n\nexport class IccMessageApi {\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 * @summary Creates a message\n * @param body\n */\n async createMessage(body?: Message): Promise<Message> {\n const _url = this.host + `/message` + '?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 Message(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Creates a message\n * @param body\n */\n async createMessageInTopic(body?: Message): Promise<Message> {\n const _url = this.host + `/message/topic` + '?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 Message(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Deletes a message delegation\n * @param messageId\n * @param delegateId\n */\n async deleteDelegation(messageId: string, delegateId: string): Promise<Message> {\n let _body = null\n\n const _url =\n this.host +\n `/message/${encodeURIComponent(String(messageId))}/delegate/${encodeURIComponent(String(delegateId))}` +\n '?ts=' +\n 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 Message(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Deletes a batch of messages.\n *\n * @param messageIds a ListOfIds containing the ids of the messages to delete.\n * @return a Promise that will resolve in an array of DocIdentifiers of the messages successfully deleted\n */\n async deleteMessages(messageIds: 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 + `/message/delete/batch` + '?ts=' + new Date().getTime(),\n headers,\n messageIds,\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 message by id.\n *\n * @param messageId the id of the message to delete.\n * @return a Promise that will resolve in the DocIdentifier of the deleted message.\n */\n async deleteMessage(messageId: string): Promise<DocIdentifier> {\n return XHR.sendCommand(\n 'DELETE',\n this.host + `/message/${encodeURIComponent(messageId)}` + '?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 *\n * @summary Get all messages (paginated) for current HC Party\n * @param startKey\n * @param startDocumentId\n * @param limit\n */\n async findMessages(startKey?: string, startDocumentId?: string, limit?: number): Promise<PaginatedListMessage> {\n let _body = null\n\n const _url =\n this.host +\n `/message` +\n '?ts=' +\n new Date().getTime() +\n (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (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) => new PaginatedListMessage(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get all messages (paginated) for current HC Party and provided from address\n * @param fromAddress\n * @param startKey\n * @param startDocumentId\n * @param limit\n * @param hcpId\n */\n async findMessagesByFromAddress(\n fromAddress?: string,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n hcpId?: string\n ): Promise<PaginatedListMessage> {\n let _body = null\n\n const _url =\n this.host +\n `/message/byFromAddress` +\n '?ts=' +\n new Date().getTime() +\n (fromAddress ? '&fromAddress=' + encodeURIComponent(String(fromAddress)) : '') +\n (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +\n (hcpId ? '&hcpId=' + encodeURIComponent(String(hcpId)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListMessage(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary List messages found By Healthcare Party and secret foreign keys.\n * @param body\n */\n async findMessagesByHCPartyPatientForeignKeysUsingPost(body?: Array<string>): Promise<Array<Message>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/message/byHcPartySecretForeignKeys` + '?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)\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Message(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Keys must be delimited by commas.\n * @summary List messages found By Healthcare Party and secret foreign keys.\n * @param secretFKeys\n */\n async findMessagesByHCPartyPatientForeignKeys(secretFKeys: string): Promise<Array<Message>> {\n let _body = null\n\n const _url =\n this.host +\n `/message/byHcPartySecretForeignKeys` +\n '?ts=' +\n new Date().getTime() +\n (secretFKeys ? '&secretFKeys=' + encodeURIComponent(String(secretFKeys)) : '')\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 Message(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary List Message ids by data owner and a set of secret foreign key. The ids will be sorted by Message sent, in ascending or descending\n * order according to the specified parameter value.\n *\n * @param dataOwnerId the data owner id.\n * @param secretFKeys an array of secret foreign keys.\n * @param startDate a timestamp in epoch milliseconds. If undefined, all the message ids since the beginning of time will be returned.\n * @param endDate a timestamp in epoch milliseconds. If undefined, all the message ids until the end of time will be returned.\n * @param descending whether to return the ids ordered in ascending or descending order by Message sent.\n * @return a promise that will resolve in an Array of Message ids.\n */\n async listMessageIdsByDataOwnerPatientSentDate(\n dataOwnerId: string,\n secretFKeys: string[],\n startDate?: number,\n endDate?: number,\n descending?: boolean\n ): Promise<string[]> {\n const _url =\n this.host +\n `/message/byDataOwnerPatientSentDate?ts=${new Date().getTime()}` +\n '&dataOwnerId=' +\n encodeURIComponent(dataOwnerId) +\n (!!startDate ? `&startDate=${encodeURIComponent(startDate)}` : '') +\n (!!endDate ? `&endDate=${encodeURIComponent(endDate)}` : '') +\n (!!descending ? `&descending=${descending}` : '')\n const headers = (await this.headers).filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n const body = new ListOfIds({ ids: secretFKeys })\n return XHR.sendCommand('POST', _url, headers, null, 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 *\n * @summary Get all messages (paginated) for current HC Party and provided to address\n * @param toAddress\n * @param startKey\n * @param startDocumentId\n * @param limit\n * @param reverse\n * @param hcpId\n */\n async findMessagesByToAddress(\n toAddress?: string,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n reverse?: boolean,\n hcpId?: string\n ): Promise<PaginatedListMessage> {\n let _body = null\n\n const _url =\n this.host +\n `/message/byToAddress` +\n '?ts=' +\n new Date().getTime() +\n (toAddress ? '&toAddress=' + encodeURIComponent(String(toAddress)) : '') +\n (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +\n (reverse ? '&reverse=' + encodeURIComponent(String(reverse)) : '') +\n (hcpId ? '&hcpId=' + encodeURIComponent(String(hcpId)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListMessage(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get all messages (paginated) for current HC Party and provided transportGuid\n * @param transportGuid\n * @param received\n * @param startKey\n * @param startDocumentId\n * @param limit\n * @param hcpId\n */\n async findMessagesByTransportGuid(\n transportGuid?: string,\n received?: boolean,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n hcpId?: string\n ): Promise<PaginatedListMessage> {\n let _body = null\n\n const _url =\n this.host +\n `/message/byTransportGuid` +\n '?ts=' +\n new Date().getTime() +\n (transportGuid ? '&transportGuid=' + encodeURIComponent(String(transportGuid)) : '') +\n (received ? '&received=' + encodeURIComponent(String(received)) : '') +\n (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +\n (hcpId ? '&hcpId=' + encodeURIComponent(String(hcpId)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListMessage(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get all messages starting by a prefix between two date\n * @param transportGuid\n * @param from\n * @param to\n * @param startKey\n * @param startDocumentId\n * @param limit\n * @param hcpId\n */\n async findMessagesByTransportGuidSentDate(\n transportGuid?: string,\n from?: number,\n to?: number,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n hcpId?: string\n ): Promise<PaginatedListMessage> {\n let _body = null\n\n const _url =\n this.host +\n `/message/byTransportGuidSentDate` +\n '?ts=' +\n new Date().getTime() +\n (transportGuid ? '&transportGuid=' + encodeURIComponent(String(transportGuid)) : '') +\n (from ? '&from=' + encodeURIComponent(String(from)) : '') +\n (to ? '&to=' + encodeURIComponent(String(to)) : '') +\n (startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +\n (hcpId ? '&hcpId=' + encodeURIComponent(String(hcpId)) : '')\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListMessage(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get children messages of provided message\n * @param messageId\n */\n async getChildrenMessages(messageId: string): Promise<Array<Message>> {\n let _body = null\n\n const _url = this.host + `/message/${encodeURIComponent(String(messageId))}/children` + '?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 Message(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get children messages of provided message\n * @param body\n */\n async getChildrenMessagesOfList(body?: ListOfIds): Promise<Array<Message>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/message/children/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('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Message(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Gets a message\n * @param messageId\n */\n async getMessage(messageId: string): Promise<Message> {\n let _body = null\n\n const _url = this.host + `/message/${encodeURIComponent(String(messageId))}` + '?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 Message(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Gets batch of messages by their ids.\n * @param messageIds the ids of the messages\n */\n async getMessages(messageIds: ListOfIds): Promise<Message[]> {\n const _url = this.host + `/message/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('GET', _url, headers, messageIds, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Message(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get children messages of provided message\n * @param body\n */\n async listMessagesByInvoiceIds(body?: ListOfIds): Promise<Array<Message>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/message/byInvoiceId` + '?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 Message(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get all messages for current HC Party and provided transportGuids\n * @param body\n * @param hcpId\n */\n async listMessagesByTransportGuids(hcpId: string, body?: ListOfIds): Promise<Array<Message>> {\n let _body = null\n _body = body\n\n const _url =\n this.host + `/message/byTransportGuid/list` + '?ts=' + new Date().getTime() + (hcpId ? '&hcpId=' + encodeURIComponent(String(hcpId)) : '')\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 Message(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Updates a message\n * @param body\n */\n async modifyMessage(body?: Message): Promise<Message> {\n let _body = null\n _body = body\n\n const _url = this.host + `/message` + '?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 Message(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Adds a delegation to a message\n * @param body\n * @param messageId\n */\n async newMessageDelegations(messageId: string, body?: Array<Delegation>): Promise<IcureStub> {\n let _body = null\n _body = body\n\n const _url = this.host + `/message/${encodeURIComponent(String(messageId))}/delegate` + '?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 IcureStub(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Set read status for given list of messages\n * @param body\n */\n async setMessagesReadStatus(body?: MessagesReadStatusUpdate): Promise<Array<Message>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/message/readstatus` + '?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 Message(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Set status bits for given list of messages\n * @param body\n * @param status\n */\n async setMessagesStatusBits(status: number, body?: ListOfIds): Promise<Array<Message>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/message/status/${encodeURIComponent(String(status))}` + '?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 Message(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @internal this method is for internal use only and may be changed without notice\n */\n async bulkShareMessages(request: BulkShareOrUpdateMetadataParams): Promise<EntityBulkShareResult<Message>[]> {\n const _url = this.host + '/message/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<Message>(x, Message)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of messages along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.\n * @summary List messages for the current user (HcParty) or the given hcparty in the filter\n * @param body\n * @param startDocumentId A Message document ID\n * @param limit Number of rows\n */\n async filterMessagesBy(body: FilterChainMessage, startDocumentId?: string, limit?: number): Promise<PaginatedListMessage> {\n const _url =\n this.host +\n `/message/filter` +\n '?ts=' +\n new Date().getTime() +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '')\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 PaginatedListMessage(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get ids of messages matching the provided filter for the current user (HcParty)\n * @param body\n */\n async matchMessagesBy(body: AbstractFilterMessage): Promise<Array<string>> {\n const _url = this.host + `/message/match` + '?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) => JSON.parse(JSON.stringify(it))))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
|
|
@@ -262,10 +262,10 @@ class NativeRsaBridge {
|
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
else if (format === 'spki') {
|
|
265
|
-
return yield this.rsa.
|
|
265
|
+
return yield this.rsa.exportPublicKeySpki(getKryptomKey(cryptoKey));
|
|
266
266
|
}
|
|
267
267
|
else if (format === 'pkcs8') {
|
|
268
|
-
return yield this.rsa.
|
|
268
|
+
return yield this.rsa.exportPrivateKeyPkcs8(getKryptomKey(cryptoKey));
|
|
269
269
|
}
|
|
270
270
|
else
|
|
271
271
|
throw new Error(`Invalid format ${format}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeCryptoPrimitivesBridge.js","sourceRoot":"","sources":["../../../icc-x-api/crypto/NativeCryptoPrimitivesBridge.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,qCAAsC;AAGtC,oCAA6E;AAE7E;;GAEG;AACH,MAAa,4BAA4B;IACvC,YAAY,iBAAoI;QAC9I,IAAI,CAAC,YAAY,GAAG,iBAAiB,CAAC,YAAY,CAAA;QAClD,IAAI,CAAC,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAA;QACtC,IAAI,CAAC,MAAM,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QACvD,IAAI,CAAC,GAAG,GAAG,IAAI,eAAe,CAAC,iBAAiB,CAAC,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;QACxE,IAAI,CAAC,IAAI,GAAG,IAAI,gBAAgB,CAAC,iBAAiB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A7D,eAAU,GAAV,UAAU,CAAc;QAAW,cAAS,GAAT,SAAS,CAAiB;IAAG,CAAC;IAEtF,IAAI,WAAW;QACb,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,IAAI;QACN,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;IACpE,CAAC;IAED,MAAM;QACJ,OAAO,EAAE,CAAA;IACX,CAAC;CACF;AAED,IAAK,YAEJ;AAFD,WAAK,YAAY;IACf,2CAA2B,CAAA;AAC7B,CAAC,EAFI,YAAY,KAAZ,YAAY,QAEhB;AACD,IAAK,sBAGJ;AAHD,WAAK,sBAAsB;IACzB,uDAA6B,CAAA;IAC7B,2DAAiC,CAAA;AACnC,CAAC,EAHI,sBAAsB,KAAtB,sBAAsB,QAG1B;AACD,IAAK,qBAEJ;AAFD,WAAK,qBAAqB;IACxB,wDAA+B,CAAA;AACjC,CAAC,EAFI,qBAAqB,KAArB,qBAAqB,QAEzB;AAED,IAAK,aAEJ;AAFD,WAAK,aAAa;IAChB,0CAAyB,CAAA;AAC3B,CAAC,EAFI,aAAa,KAAb,aAAa,QAEjB","sourcesContent":["import { CryptoPrimitives } from './CryptoPrimitives'\nimport { HMACUtils } from './HMACUtils'\nimport { ShamirClass } from './shamir'\nimport { AESUtils } from './AES'\nimport { KeyPair, RSAUtils, ShaVersion } from './RSA'\nimport { b64_2ua, hex2ua, ua2b64, ua2hex, ua2utf8, utf8_2ua } from '../utils'\n\n/**\n * Allows to use the expo-kryptom module as crypto primitives. This is necessary when building expo (react native) apps.\n */\nexport class NativeCryptoPrimitivesBridge implements CryptoPrimitives {\n constructor(expoKryptomModule: { Aes: AesService; Rsa: RsaService; Hmac: HmacService; StrongRandom: StrongRandomService; Digest: DigestService }) {\n this.strongRandom = expoKryptomModule.StrongRandom\n this.digest = expoKryptomModule.Digest\n this.shamir = new StrongRandomShamir(this.strongRandom)\n this.AES = new NativeAesBridge(expoKryptomModule.Aes, this.strongRandom)\n this.HMAC = new NativeHmacBridge(expoKryptomModule.Hmac)\n this.RSA = new NativeRsaBridge(expoKryptomModule.Rsa)\n }\n\n readonly AES: AESUtils\n readonly HMAC: HMACUtils\n readonly RSA: RSAUtils\n readonly shamir: ShamirClass\n private readonly strongRandom: StrongRandomService\n private readonly digest: DigestService\n\n randomBytes(n: number): Uint8Array {\n return this.strongRandom.randomBytes(n)\n }\n\n randomUuid(): string {\n return this.strongRandom.randomUUID()\n }\n\n async sha256(data: ArrayBuffer | Uint8Array): Promise<ArrayBuffer> {\n return await this.digest.sha256(data instanceof ArrayBuffer ? new Uint8Array(data) : data)\n }\n}\n\nclass StrongRandomShamir extends ShamirClass {\n constructor(private readonly strongRandom: StrongRandomService) {\n super()\n }\n\n protected fillRandom(arr: Uint32Array): void {\n const random = this.strongRandom.randomBytes(arr.byteLength)\n // Note that the new Uint32Array does not copy the random array\n arr.set(new Uint32Array(random.buffer))\n }\n}\n\nclass NativeAesBridge implements AESUtils {\n constructor(private readonly aes: AesService, private readonly random: StrongRandomService) {}\n\n async decrypt(cryptoKey: CryptoKey, encryptedData: ArrayBuffer | Uint8Array): Promise<ArrayBuffer> {\n return await this.aes.decrypt(new Uint8Array(encryptedData), getKryptomKey(cryptoKey))\n }\n\n decryptSome(cryptoKeys: CryptoKey[], uint8Array: Uint8Array): Promise<ArrayBuffer> {\n try {\n return this.decrypt(cryptoKeys[0], uint8Array)\n } catch (e) {\n if (cryptoKeys.length > 1) {\n return this.decryptSome(cryptoKeys.slice(1), uint8Array)\n } else {\n throw e\n }\n }\n }\n\n async decryptWithRawKey(rawKey: string, plainData: ArrayBuffer | Uint8Array): Promise<ArrayBuffer> {\n const imported = await this.importKey('raw', hex2ua(rawKey))\n return this.decrypt(imported, plainData)\n }\n\n async encrypt(cryptoKey: CryptoKey, plainData: ArrayBuffer | Uint8Array): Promise<ArrayBuffer> {\n return await this.aes.encrypt(new Uint8Array(plainData), getKryptomKey(cryptoKey), null)\n }\n\n async encryptWithRawKey(rawKey: string, plainData: ArrayBuffer | Uint8Array): Promise<ArrayBuffer> {\n const imported = await this.importKey('raw', hex2ua(rawKey))\n return this.encrypt(imported, plainData)\n }\n\n exportKey(cryptoKey: CryptoKey, format: 'raw'): Promise<ArrayBuffer>\n exportKey(cryptoKey: CryptoKey, format: 'jwk'): Promise<JsonWebKey>\n async exportKey(cryptoKey: CryptoKey, format: 'jwk' | 'raw'): Promise<ArrayBuffer | JsonWebKey> {\n const rawKey = await this.aes.exportRawKey(getKryptomKey(cryptoKey))\n if (format == 'raw') return rawKey\n return {\n kty: 'oct',\n alg: rawKey.byteLength == 32 ? 'A256CBC' : 'A128CBC',\n ext: true,\n key_ops: ['encrypt', 'decrypt'],\n k: ua2b64(rawKey).replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_'),\n }\n }\n\n generateCryptoKey(toHex: false): Promise<CryptoKey>\n generateCryptoKey(toHex: true): Promise<string>\n async generateCryptoKey(toHex: boolean): Promise<string | CryptoKey> {\n if (toHex) {\n return Promise.resolve(ua2hex(this.random.randomBytes(32)))\n } else {\n const aesKey = await this.aes.generateKey(AesAlgorithm.AesCbcPkcs7, 256)\n return new AesCryptoKey(aesKey, 256)\n }\n }\n\n generateIV(ivByteLength: number): Uint8Array {\n return this.random.randomBytes(ivByteLength)\n }\n\n async importKey(format: 'jwk' | 'raw', aesKey: JsonWebKey | ArrayBuffer | Uint8Array): Promise<CryptoKey> {\n let keyBytes: Uint8Array\n if (format === 'jwk') {\n if (\n (aesKey as JsonWebKey).kty !== 'oct' ||\n ((aesKey as JsonWebKey).alg !== 'A256CBC' && (aesKey as JsonWebKey).alg !== 'A128CBC') ||\n !(aesKey as JsonWebKey).ext ||\n !(aesKey as JsonWebKey).key_ops?.includes('encrypt') ||\n !(aesKey as JsonWebKey).key_ops?.includes('decrypt') ||\n !(aesKey as JsonWebKey).k\n ) {\n throw new Error(\n 'Invalid JWK - must have kty=oct, alg=(A256CBC||A128CBC), ext=true, key_ops=[encrypt, decrypt], and must have non-empty k field'\n )\n }\n // b64_2ua works also with url-safe base64\n keyBytes = new Uint8Array(b64_2ua((aesKey as JsonWebKey).k!))\n } else if (format === 'raw') {\n if (aesKey! instanceof ArrayBuffer && !ArrayBuffer.isView(aesKey))\n throw new Error(\"aesKey must be an ArrayBuffer or an ArrayBufferView when format is 'raw'\")\n keyBytes = new Uint8Array(aesKey as ArrayBufferLike)\n } else throw new Error(`Invalid format ${format}`)\n const imported = await this.aes.importRawKey(keyBytes, AesAlgorithm.AesCbcPkcs7)\n return new AesCryptoKey(imported, keyBytes.length)\n }\n}\n\nfunction getKryptomKey<T>(cryptoKey: CryptoKey) {\n if ('kryptomKey' in cryptoKey) {\n return cryptoKey.kryptomKey as T\n } else throw new Error('Invalid crypto key: only crypto keys generated or loaded with this implementation of crypto primitives are supported')\n}\n\nclass AesCryptoKey implements CryptoKey {\n constructor(readonly kryptomKey: AesKey, readonly size: number) {}\n\n get algorithm(): AesKeyAlgorithm {\n return { name: 'AES-CBC', length: this.size }\n }\n get extractable(): boolean {\n return true\n }\n get type(): KeyType {\n return 'secret'\n }\n get usages(): KeyUsage[] {\n return ['encrypt', 'decrypt']\n }\n\n toJSON() {\n return {}\n }\n}\n\nclass NativeHmacBridge implements HMACUtils {\n constructor(private readonly hmac: HmacService) {}\n\n async exportKey(key: CryptoKey): Promise<ArrayBuffer> {\n return await this.hmac.exportRawKey(getKryptomKey(key))\n }\n\n async generateKey(): Promise<CryptoKey> {\n const kryptomKey = await this.hmac.generateKey(HmacAlgorithm.HmacSha512)\n return new HmacCryptoKey(kryptomKey)\n }\n\n async importKey(key: ArrayBuffer): Promise<CryptoKey> {\n const kryptomKey = await this.hmac.importRawKey(new Uint8Array(key), HmacAlgorithm.HmacSha512)\n return new HmacCryptoKey(kryptomKey)\n }\n\n async sign(key: CryptoKey, data: ArrayBuffer): Promise<ArrayBuffer> {\n return await this.hmac.sign(new Uint8Array(data), getKryptomKey(key))\n }\n\n async verify(key: CryptoKey, data: ArrayBuffer, signature: ArrayBuffer): Promise<boolean> {\n return await this.hmac.verify(new Uint8Array(signature), new Uint8Array(data), getKryptomKey(key))\n }\n}\n\nclass HmacCryptoKey implements CryptoKey {\n constructor(readonly kryptomKey: HmacKey) {}\n\n get algorithm(): HmacKeyAlgorithm {\n return { name: 'HMAC', hash: { name: 'SHA-512' }, length: 1024 }\n }\n get extractable(): boolean {\n return true\n }\n get type(): KeyType {\n return 'secret'\n }\n get usages(): KeyUsage[] {\n return ['sign', 'verify']\n }\n\n toJSON() {\n return {}\n }\n}\n\nclass NativeRsaBridge implements RSAUtils {\n constructor(private readonly rsa: RsaService) {}\n\n async checkKeyPairValidity(keyPair: KeyPair<CryptoKey>): Promise<boolean> {\n try {\n const text = 'shibboleth'\n const encryptedText = await this.encrypt(keyPair.publicKey, utf8_2ua(text))\n const decryptedText = ua2utf8(await this.decrypt(keyPair.privateKey, new Uint8Array(encryptedText)))\n return decryptedText === text\n } catch (e) {\n return false\n }\n }\n\n async decrypt(privateKey: CryptoKey, encryptedData: Uint8Array): Promise<ArrayBuffer> {\n return await this.rsa.decrypt(encryptedData, getKryptomKey(privateKey))\n }\n\n async encrypt(publicKey: CryptoKey, plainData: Uint8Array): Promise<ArrayBuffer> {\n return await this.rsa.encrypt(plainData, getKryptomKey(publicKey))\n }\n\n exportKey(cryptoKey: CryptoKey, format: 'jwk'): Promise<JsonWebKey>\n exportKey(cryptoKey: CryptoKey, format: 'spki'): Promise<ArrayBuffer>\n exportKey(cryptoKey: CryptoKey, format: 'pkcs8'): Promise<ArrayBuffer>\n async exportKey(cryptoKey: CryptoKey, format: 'jwk' | 'spki' | 'pkcs8'): Promise<JsonWebKey | ArrayBuffer> {\n if (format === 'jwk') {\n if (cryptoKey.type === 'private') {\n return await this.rsa.exportPrivateKeyJwk(getKryptomKey(cryptoKey))\n } else {\n return await this.rsa.exportPublicKeyJwk(getKryptomKey(cryptoKey))\n }\n } else if (format === 'spki') {\n return await this.rsa.exportPrivateKeyPkcs8(getKryptomKey(cryptoKey))\n } else if (format === 'pkcs8') {\n return await this.rsa.exportPublicKeySpki(getKryptomKey(cryptoKey))\n } else throw new Error(`Invalid format ${format}`)\n }\n\n exportKeys(keyPair: KeyPair<CryptoKey>, privKeyFormat: 'jwk', pubKeyFormat: 'jwk'): Promise<KeyPair<JsonWebKey>>\n exportKeys(keyPair: KeyPair<CryptoKey>, privKeyFormat: 'pkcs8', pubKeyFormat: 'spki'): Promise<KeyPair<ArrayBuffer>>\n async exportKeys(\n keyPair: KeyPair<CryptoKey>,\n privKeyFormat: 'jwk' | 'pkcs8',\n pubKeyFormat: 'jwk' | 'spki'\n ): Promise<KeyPair<JsonWebKey | ArrayBuffer>> {\n let privateKey: JsonWebKey | ArrayBuffer\n if (privKeyFormat === 'jwk') {\n privateKey = await this.rsa.exportPrivateKeyJwk(getKryptomKey(keyPair.privateKey))\n } else {\n privateKey = await this.rsa.exportPrivateKeyPkcs8(getKryptomKey(keyPair.privateKey))\n }\n let publicKey: JsonWebKey | ArrayBuffer\n if (pubKeyFormat === 'jwk') {\n publicKey = await this.rsa.exportPublicKeyJwk(getKryptomKey(keyPair.publicKey))\n } else {\n publicKey = await this.rsa.exportPublicKeySpki(getKryptomKey(keyPair.publicKey))\n }\n return { privateKey, publicKey }\n }\n\n async generateKeyPair(shaVersion: ShaVersion): Promise<KeyPair<CryptoKey>> {\n const generated = await this.rsa.generateKey(this.kryptomAlgorithm(shaVersion), 2048)\n // In expo-kryptom a private keys and public keys are supertypes of keypair.\n return {\n privateKey: new PrivateRsaCryptoKey(generated, this.encryptionKeysAlgorithm(shaVersion)),\n publicKey: new PublicRsaCryptoKey(generated, this.encryptionKeysAlgorithm(shaVersion)),\n }\n }\n\n async generateSignatureKeyPair(): Promise<KeyPair<CryptoKey>> {\n const generated = await this.rsa.generateKey(RsaSignatureAlgorithm.PssWithSha256, 2048)\n return {\n privateKey: new PrivateRsaCryptoKey(generated, this.signatureKeysAlgorithm()),\n publicKey: new PublicRsaCryptoKey(generated, this.signatureKeysAlgorithm()),\n }\n }\n\n importKey(\n format: 'jwk' | 'spki' | 'pkcs8',\n keydata: JsonWebKey | ArrayBuffer,\n keyUsages: KeyUsage[],\n hashAlgorithm: ShaVersion\n ): Promise<CryptoKey> {\n if (keyUsages[0] == 'encrypt' && (format == 'jwk' || format == 'spki')) {\n return this.importPublicKey(format, keydata, hashAlgorithm)\n } else if (keyUsages[0] == 'decrypt' && (format == 'jwk' || format == 'pkcs8')) {\n return this.importPrivateKey(format, keydata, hashAlgorithm)\n } else throw new Error(`Combination of key usages and key format not supported: ${keyUsages} ${format}`)\n }\n\n async importKeyPair(\n privateKeyFormat: string,\n privateKeydata: JsonWebKey | ArrayBuffer,\n publicKeyFormat: string,\n publicKeyData: JsonWebKey | ArrayBuffer,\n hashAlgorithm: ShaVersion\n ): Promise<KeyPair<CryptoKey>> {\n let importedPrivate: RsaPrivateKey\n let importedPublic: RsaPublicKey\n const algorithm = this.kryptomAlgorithm(hashAlgorithm)\n if (privateKeyFormat == 'jwk') {\n importedPrivate = await this.rsa.importPrivateKeyJwk(privateKeydata as PrivateRsaKeyJwk, algorithm)\n } else {\n importedPrivate = await this.rsa.importPrivateKeyPkcs8(new Uint8Array(privateKeydata as ArrayBuffer), algorithm)\n }\n if (publicKeyFormat == 'jwk') {\n importedPublic = await this.rsa.importPublicKeyJwk(publicKeyData as PublicRsaKeyJwk, algorithm)\n } else {\n importedPublic = await this.rsa.importPublicKeySpki(new Uint8Array(publicKeyData as ArrayBuffer), algorithm)\n }\n return {\n privateKey: new PrivateRsaCryptoKey(importedPrivate, this.encryptionKeysAlgorithm(hashAlgorithm)),\n publicKey: new PublicRsaCryptoKey(importedPublic, this.encryptionKeysAlgorithm(hashAlgorithm)),\n }\n }\n\n async importPrivateKey(format: 'jwk' | 'pkcs8', keydata: JsonWebKey | ArrayBuffer, hashAlgorithm: ShaVersion): Promise<CryptoKey> {\n let imported: RsaPrivateKey\n if (format == 'jwk') {\n imported = await this.rsa.importPrivateKeyJwk(keydata as PrivateRsaKeyJwk, this.kryptomAlgorithm(hashAlgorithm))\n } else {\n imported = await this.rsa.importPrivateKeyPkcs8(new Uint8Array(keydata as ArrayBuffer), this.kryptomAlgorithm(hashAlgorithm))\n }\n return new PrivateRsaCryptoKey(imported, this.encryptionKeysAlgorithm(hashAlgorithm))\n }\n\n async importPublicKey(format: 'jwk' | 'spki', keydata: JsonWebKey | ArrayBuffer, hashAlgorithm: ShaVersion): Promise<CryptoKey> {\n let imported: RsaPublicKey\n if (format == 'jwk') {\n imported = await this.rsa.importPublicKeyJwk(keydata as PublicRsaKeyJwk, this.kryptomAlgorithm(hashAlgorithm))\n } else {\n imported = await this.rsa.importPublicKeySpki(new Uint8Array(keydata as ArrayBuffer), this.kryptomAlgorithm(hashAlgorithm))\n }\n return new PublicRsaCryptoKey(imported, this.encryptionKeysAlgorithm(hashAlgorithm))\n }\n\n async importSignatureKey(format: 'jwk' | 'pkcs8', keydata: JsonWebKey | ArrayBuffer): Promise<CryptoKey> {\n let importedKey: RsaPrivateKey\n if (format == 'jwk') {\n importedKey = await this.rsa.importPrivateKeyJwk(keydata as PrivateRsaKeyJwk, RsaSignatureAlgorithm.PssWithSha256)\n } else {\n importedKey = await this.rsa.importPrivateKeyPkcs8(new Uint8Array(keydata as ArrayBuffer), RsaSignatureAlgorithm.PssWithSha256)\n }\n return new PrivateRsaCryptoKey(importedKey, this.signatureKeysAlgorithm())\n }\n\n async importVerificationKey(format: 'jwk' | 'spki', keydata: JsonWebKey | ArrayBuffer): Promise<CryptoKey> {\n let importedKey: RsaPublicKey\n if (format == 'jwk') {\n importedKey = await this.rsa.importPublicKeyJwk(keydata as PublicRsaKeyJwk, RsaSignatureAlgorithm.PssWithSha256)\n } else {\n importedKey = await this.rsa.importPublicKeySpki(new Uint8Array(keydata as ArrayBuffer), RsaSignatureAlgorithm.PssWithSha256)\n }\n return new PublicRsaCryptoKey(importedKey, this.signatureKeysAlgorithm())\n }\n\n async sign(privateKey: CryptoKey, data: ArrayBuffer): Promise<ArrayBuffer> {\n return await this.rsa.signature(new Uint8Array(data), getKryptomKey(privateKey))\n }\n\n async verifySignature(publicKey: CryptoKey, signature: ArrayBuffer, data: ArrayBuffer): Promise<boolean> {\n return await this.rsa.verify(new Uint8Array(signature), new Uint8Array(data), getKryptomKey(publicKey))\n }\n\n private kryptomAlgorithm(shaVersion: ShaVersion): RsaEncryptionAlgorithm {\n return shaVersion == 'sha-256' ? RsaEncryptionAlgorithm.OaepWithSha256 : RsaEncryptionAlgorithm.OaepWithSha1\n }\n\n private encryptionKeysAlgorithm(shaVersion: ShaVersion): RsaHashedKeyAlgorithm {\n return {\n name: 'RSA-OAEP',\n modulusLength: 2048,\n publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537 (Fermat F4), read http://en.wikipedia.org/wiki/65537_(number)\n hash: { name: shaVersion == 'sha-256' ? 'SHA-256' : 'SHA-1' },\n }\n }\n\n private signatureKeysAlgorithm(): RsaHashedKeyAlgorithm {\n return {\n name: 'RSA-PSS',\n modulusLength: 2048,\n publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537 (Fermat F4), read http://en.wikipedia.org/wiki/65537_(number)\n hash: { name: 'SHA-256' },\n }\n }\n}\n\nclass PrivateRsaCryptoKey implements CryptoKey {\n constructor(readonly kryptomKey: RsaPrivateKey, readonly algorithm: RsaKeyAlgorithm) {}\n\n get extractable(): boolean {\n return true\n }\n\n get type(): KeyType {\n return 'private'\n }\n\n get usages(): KeyUsage[] {\n return this.algorithm.name != 'RSA-PSS' ? ['decrypt'] : ['sign']\n }\n\n toJSON() {\n return {}\n }\n}\n\nclass PublicRsaCryptoKey implements CryptoKey {\n constructor(readonly kryptomKey: RsaPublicKey, readonly algorithm: RsaKeyAlgorithm) {}\n\n get extractable(): boolean {\n return true\n }\n\n get type(): KeyType {\n return 'public'\n }\n\n get usages(): KeyUsage[] {\n return this.algorithm.name != 'RSA-PSS' ? ['encrypt'] : ['verify']\n }\n\n toJSON() {\n return {}\n }\n}\n\nenum AesAlgorithm {\n AesCbcPkcs7 = 'AesCbcPkcs7',\n}\nenum RsaEncryptionAlgorithm {\n OaepWithSha1 = 'OaepWithSha1',\n OaepWithSha256 = 'OaepWithSha256',\n}\nenum RsaSignatureAlgorithm {\n PssWithSha256 = 'PssWithSha256',\n}\ntype RsaAlgorithm = RsaEncryptionAlgorithm | RsaSignatureAlgorithm\nenum HmacAlgorithm {\n HmacSha512 = 'HmacSha512',\n}\n\ninterface HmacKey {\n algorithmIdentifier: HmacAlgorithm\n}\n\ninterface AesKey {\n algorithmIdentifier: AesAlgorithm\n}\n\ninterface RsaKeyPair {\n algorithmIdentifier: RsaAlgorithm\n}\n\ninterface RsaPrivateKey {\n algorithmIdentifier: RsaAlgorithm\n}\n\ninterface RsaPublicKey {\n algorithmIdentifier: RsaAlgorithm\n}\n\ntype PrivateRsaKeyJwk = {\n alg: string\n d: string\n dp: string\n dq: string\n e: string\n ext: boolean\n key_ops: string[]\n n: string\n p: string\n q: string\n qi: string\n}\n\ntype PublicRsaKeyJwk = {\n alg: string\n e: string\n ext: boolean\n key_ops: string[]\n n: string\n}\n\ninterface AesService {\n generateKey(algorithmIdentifier: AesAlgorithm, size: number): Promise<AesKey>\n encrypt(data: Uint8Array, key: AesKey, iv: Uint8Array | null): Promise<Uint8Array>\n decrypt(ivAndEncryptedData: Uint8Array, key: AesKey): Promise<Uint8Array>\n exportRawKey(key: AesKey): Promise<Uint8Array>\n importRawKey(rawKey: Uint8Array, algorithmIdentifier: AesAlgorithm): Promise<AesKey>\n}\n\ninterface RsaService {\n generateKey(algorithmIdentifier: RsaAlgorithm, size: number): Promise<RsaKeyPair>\n encrypt(data: Uint8Array, key: RsaPublicKey): Promise<Uint8Array>\n decrypt(data: Uint8Array, key: RsaPrivateKey): Promise<Uint8Array>\n signature(data: Uint8Array, key: RsaPrivateKey): Promise<Uint8Array>\n verify(signature: Uint8Array, data: Uint8Array, key: RsaPublicKey): Promise<boolean>\n exportPrivateKeyPkcs8(key: RsaPrivateKey): Promise<Uint8Array>\n exportPrivateKeyJwk(key: RsaPrivateKey): Promise<PrivateRsaKeyJwk>\n exportPublicKeySpki(key: RsaPublicKey): Promise<Uint8Array>\n exportPublicKeyJwk(key: RsaPublicKey): Promise<PublicRsaKeyJwk>\n importPrivateKeyPkcs8(privateKeyPkcs8: Uint8Array, algorithmIdentifier: RsaAlgorithm): Promise<RsaPrivateKey>\n importPrivateKeyJwk(privateKey: PrivateRsaKeyJwk, algorithmIdentifier: RsaAlgorithm): Promise<RsaPrivateKey>\n importPublicKeySpki(publicKeySpki: Uint8Array, algorithmIdentifier: RsaAlgorithm): Promise<RsaPublicKey>\n importPublicKeyJwk(publicKey: PublicRsaKeyJwk, algorithmIdentifier: RsaAlgorithm): Promise<RsaPublicKey>\n importKeyPair(privateKeyPkcs8: Uint8Array, algorithmIdentifier: RsaAlgorithm): Promise<RsaKeyPair>\n}\n\ninterface HmacService {\n generateKey(algorithmIdentifier: HmacAlgorithm): Promise<HmacKey>\n sign(data: Uint8Array, key: HmacKey): Promise<Uint8Array>\n verify(signature: Uint8Array, data: Uint8Array, key: HmacKey): Promise<boolean>\n exportRawKey(key: HmacKey): Promise<Uint8Array>\n importRawKey(rawKey: Uint8Array, algorithmIdentifier: HmacAlgorithm): Promise<HmacKey>\n}\n\ninterface StrongRandomService {\n randomBytes(length: number): Uint8Array\n randomUUID(): string\n}\n\ninterface DigestService {\n sha256(data: Uint8Array): Promise<Uint8Array>\n}\n"]}
|
|
1
|
+
{"version":3,"file":"NativeCryptoPrimitivesBridge.js","sourceRoot":"","sources":["../../../icc-x-api/crypto/NativeCryptoPrimitivesBridge.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,qCAAsC;AAGtC,oCAA6E;AAE7E;;GAEG;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esContent":["import { CryptoPrimitives } from './CryptoPrimitives'\nimport { HMACUtils } from './HMACUtils'\nimport { ShamirClass } from './shamir'\nimport { AESUtils } from './AES'\nimport { KeyPair, RSAUtils, ShaVersion } from './RSA'\nimport { b64_2ua, hex2ua, ua2b64, ua2hex, ua2utf8, utf8_2ua } from '../utils'\n\n/**\n * Allows to use the expo-kryptom module as crypto primitives. This is necessary when building expo (react native) apps.\n */\nexport class NativeCryptoPrimitivesBridge implements CryptoPrimitives {\n constructor(expoKryptomModule: { Aes: AesService; Rsa: RsaService; Hmac: HmacService; StrongRandom: StrongRandomService; Digest: DigestService }) {\n this.strongRandom = expoKryptomModule.StrongRandom\n this.digest = expoKryptomModule.Digest\n this.shamir = new StrongRandomShamir(this.strongRandom)\n this.AES = new NativeAesBridge(expoKryptomModule.Aes, this.strongRandom)\n this.HMAC = new NativeHmacBridge(expoKryptomModule.Hmac)\n this.RSA = new NativeRsaBridge(expoKryptomModule.Rsa)\n }\n\n readonly AES: AESUtils\n readonly HMAC: HMACUtils\n readonly RSA: RSAUtils\n readonly shamir: ShamirClass\n private readonly strongRandom: StrongRandomService\n private readonly digest: DigestService\n\n randomBytes(n: number): Uint8Array {\n return this.strongRandom.randomBytes(n)\n }\n\n randomUuid(): string {\n return this.strongRandom.randomUUID()\n }\n\n async sha256(data: ArrayBuffer | Uint8Array): Promise<ArrayBuffer> {\n return await this.digest.sha256(data instanceof ArrayBuffer ? new Uint8Array(data) : data)\n }\n}\n\nclass StrongRandomShamir extends ShamirClass {\n constructor(private readonly strongRandom: StrongRandomService) {\n super()\n }\n\n protected fillRandom(arr: Uint32Array): void {\n const random = this.strongRandom.randomBytes(arr.byteLength)\n // Note that the new Uint32Array does not copy the random array\n arr.set(new Uint32Array(random.buffer))\n }\n}\n\nclass NativeAesBridge implements AESUtils {\n constructor(private readonly aes: AesService, private readonly random: StrongRandomService) {}\n\n async decrypt(cryptoKey: CryptoKey, encryptedData: ArrayBuffer | Uint8Array): Promise<ArrayBuffer> {\n return await this.aes.decrypt(new Uint8Array(encryptedData), getKryptomKey(cryptoKey))\n }\n\n decryptSome(cryptoKeys: CryptoKey[], uint8Array: Uint8Array): Promise<ArrayBuffer> {\n try {\n return this.decrypt(cryptoKeys[0], uint8Array)\n } catch (e) {\n if (cryptoKeys.length > 1) {\n return this.decryptSome(cryptoKeys.slice(1), uint8Array)\n } else {\n throw e\n }\n }\n }\n\n async decryptWithRawKey(rawKey: string, plainData: ArrayBuffer | Uint8Array): Promise<ArrayBuffer> {\n const imported = await this.importKey('raw', hex2ua(rawKey))\n return this.decrypt(imported, plainData)\n }\n\n async encrypt(cryptoKey: CryptoKey, plainData: ArrayBuffer | Uint8Array): Promise<ArrayBuffer> {\n return await this.aes.encrypt(new Uint8Array(plainData), getKryptomKey(cryptoKey), null)\n }\n\n async encryptWithRawKey(rawKey: string, plainData: ArrayBuffer | Uint8Array): Promise<ArrayBuffer> {\n const imported = await this.importKey('raw', hex2ua(rawKey))\n return this.encrypt(imported, plainData)\n }\n\n exportKey(cryptoKey: CryptoKey, format: 'raw'): Promise<ArrayBuffer>\n exportKey(cryptoKey: CryptoKey, format: 'jwk'): Promise<JsonWebKey>\n async exportKey(cryptoKey: CryptoKey, format: 'jwk' | 'raw'): Promise<ArrayBuffer | JsonWebKey> {\n const rawKey = await this.aes.exportRawKey(getKryptomKey(cryptoKey))\n if (format == 'raw') return rawKey\n return {\n kty: 'oct',\n alg: rawKey.byteLength == 32 ? 'A256CBC' : 'A128CBC',\n ext: true,\n key_ops: ['encrypt', 'decrypt'],\n k: ua2b64(rawKey).replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_'),\n }\n }\n\n generateCryptoKey(toHex: false): Promise<CryptoKey>\n generateCryptoKey(toHex: true): Promise<string>\n async generateCryptoKey(toHex: boolean): Promise<string | CryptoKey> {\n if (toHex) {\n return Promise.resolve(ua2hex(this.random.randomBytes(32)))\n } else {\n const aesKey = await this.aes.generateKey(AesAlgorithm.AesCbcPkcs7, 256)\n return new AesCryptoKey(aesKey, 256)\n }\n }\n\n generateIV(ivByteLength: number): Uint8Array {\n return this.random.randomBytes(ivByteLength)\n }\n\n async importKey(format: 'jwk' | 'raw', aesKey: JsonWebKey | ArrayBuffer | Uint8Array): Promise<CryptoKey> {\n let keyBytes: Uint8Array\n if (format === 'jwk') {\n if (\n (aesKey as JsonWebKey).kty !== 'oct' ||\n ((aesKey as JsonWebKey).alg !== 'A256CBC' && (aesKey as JsonWebKey).alg !== 'A128CBC') ||\n !(aesKey as JsonWebKey).ext ||\n !(aesKey as JsonWebKey).key_ops?.includes('encrypt') ||\n !(aesKey as JsonWebKey).key_ops?.includes('decrypt') ||\n !(aesKey as JsonWebKey).k\n ) {\n throw new Error(\n 'Invalid JWK - must have kty=oct, alg=(A256CBC||A128CBC), ext=true, key_ops=[encrypt, decrypt], and must have non-empty k field'\n )\n }\n // b64_2ua works also with url-safe base64\n keyBytes = new Uint8Array(b64_2ua((aesKey as JsonWebKey).k!))\n } else if (format === 'raw') {\n if (aesKey! instanceof ArrayBuffer && !ArrayBuffer.isView(aesKey))\n throw new Error(\"aesKey must be an ArrayBuffer or an ArrayBufferView when format is 'raw'\")\n keyBytes = new Uint8Array(aesKey as ArrayBufferLike)\n } else throw new Error(`Invalid format ${format}`)\n const imported = await this.aes.importRawKey(keyBytes, AesAlgorithm.AesCbcPkcs7)\n return new AesCryptoKey(imported, keyBytes.length)\n }\n}\n\nfunction getKryptomKey<T>(cryptoKey: CryptoKey) {\n if ('kryptomKey' in cryptoKey) {\n return cryptoKey.kryptomKey as T\n } else throw new Error('Invalid crypto key: only crypto keys generated or loaded with this implementation of crypto primitives are supported')\n}\n\nclass AesCryptoKey implements CryptoKey {\n constructor(readonly kryptomKey: AesKey, readonly size: number) {}\n\n get algorithm(): AesKeyAlgorithm {\n return { name: 'AES-CBC', length: this.size }\n }\n get extractable(): boolean {\n return true\n }\n get type(): KeyType {\n return 'secret'\n }\n get usages(): KeyUsage[] {\n return ['encrypt', 'decrypt']\n }\n\n toJSON() {\n return {}\n }\n}\n\nclass NativeHmacBridge implements HMACUtils {\n constructor(private readonly hmac: HmacService) {}\n\n async exportKey(key: CryptoKey): Promise<ArrayBuffer> {\n return await this.hmac.exportRawKey(getKryptomKey(key))\n }\n\n async generateKey(): Promise<CryptoKey> {\n const kryptomKey = await this.hmac.generateKey(HmacAlgorithm.HmacSha512)\n return new HmacCryptoKey(kryptomKey)\n }\n\n async importKey(key: ArrayBuffer): Promise<CryptoKey> {\n const kryptomKey = await this.hmac.importRawKey(new Uint8Array(key), HmacAlgorithm.HmacSha512)\n return new HmacCryptoKey(kryptomKey)\n }\n\n async sign(key: CryptoKey, data: ArrayBuffer): Promise<ArrayBuffer> {\n return await this.hmac.sign(new Uint8Array(data), getKryptomKey(key))\n }\n\n async verify(key: CryptoKey, data: ArrayBuffer, signature: ArrayBuffer): Promise<boolean> {\n return await this.hmac.verify(new Uint8Array(signature), new Uint8Array(data), getKryptomKey(key))\n }\n}\n\nclass HmacCryptoKey implements CryptoKey {\n constructor(readonly kryptomKey: HmacKey) {}\n\n get algorithm(): HmacKeyAlgorithm {\n return { name: 'HMAC', hash: { name: 'SHA-512' }, length: 1024 }\n }\n get extractable(): boolean {\n return true\n }\n get type(): KeyType {\n return 'secret'\n }\n get usages(): KeyUsage[] {\n return ['sign', 'verify']\n }\n\n toJSON() {\n return {}\n }\n}\n\nclass NativeRsaBridge implements RSAUtils {\n constructor(private readonly rsa: RsaService) {}\n\n async checkKeyPairValidity(keyPair: KeyPair<CryptoKey>): Promise<boolean> {\n try {\n const text = 'shibboleth'\n const encryptedText = await this.encrypt(keyPair.publicKey, utf8_2ua(text))\n const decryptedText = ua2utf8(await this.decrypt(keyPair.privateKey, new Uint8Array(encryptedText)))\n return decryptedText === text\n } catch (e) {\n return false\n }\n }\n\n async decrypt(privateKey: CryptoKey, encryptedData: Uint8Array): Promise<ArrayBuffer> {\n return await this.rsa.decrypt(encryptedData, getKryptomKey(privateKey))\n }\n\n async encrypt(publicKey: CryptoKey, plainData: Uint8Array): Promise<ArrayBuffer> {\n return await this.rsa.encrypt(plainData, getKryptomKey(publicKey))\n }\n\n exportKey(cryptoKey: CryptoKey, format: 'jwk'): Promise<JsonWebKey>\n exportKey(cryptoKey: CryptoKey, format: 'spki'): Promise<ArrayBuffer>\n exportKey(cryptoKey: CryptoKey, format: 'pkcs8'): Promise<ArrayBuffer>\n async exportKey(cryptoKey: CryptoKey, format: 'jwk' | 'spki' | 'pkcs8'): Promise<JsonWebKey | ArrayBuffer> {\n if (format === 'jwk') {\n if (cryptoKey.type === 'private') {\n return await this.rsa.exportPrivateKeyJwk(getKryptomKey(cryptoKey))\n } else {\n return await this.rsa.exportPublicKeyJwk(getKryptomKey(cryptoKey))\n }\n } else if (format === 'spki') {\n return await this.rsa.exportPublicKeySpki(getKryptomKey(cryptoKey))\n } else if (format === 'pkcs8') {\n return await this.rsa.exportPrivateKeyPkcs8(getKryptomKey(cryptoKey))\n } else throw new Error(`Invalid format ${format}`)\n }\n\n exportKeys(keyPair: KeyPair<CryptoKey>, privKeyFormat: 'jwk', pubKeyFormat: 'jwk'): Promise<KeyPair<JsonWebKey>>\n exportKeys(keyPair: KeyPair<CryptoKey>, privKeyFormat: 'pkcs8', pubKeyFormat: 'spki'): Promise<KeyPair<ArrayBuffer>>\n async exportKeys(\n keyPair: KeyPair<CryptoKey>,\n privKeyFormat: 'jwk' | 'pkcs8',\n pubKeyFormat: 'jwk' | 'spki'\n ): Promise<KeyPair<JsonWebKey | ArrayBuffer>> {\n let privateKey: JsonWebKey | ArrayBuffer\n if (privKeyFormat === 'jwk') {\n privateKey = await this.rsa.exportPrivateKeyJwk(getKryptomKey(keyPair.privateKey))\n } else {\n privateKey = await this.rsa.exportPrivateKeyPkcs8(getKryptomKey(keyPair.privateKey))\n }\n let publicKey: JsonWebKey | ArrayBuffer\n if (pubKeyFormat === 'jwk') {\n publicKey = await this.rsa.exportPublicKeyJwk(getKryptomKey(keyPair.publicKey))\n } else {\n publicKey = await this.rsa.exportPublicKeySpki(getKryptomKey(keyPair.publicKey))\n }\n return { privateKey, publicKey }\n }\n\n async generateKeyPair(shaVersion: ShaVersion): Promise<KeyPair<CryptoKey>> {\n const generated = await this.rsa.generateKey(this.kryptomAlgorithm(shaVersion), 2048)\n // In expo-kryptom a private keys and public keys are supertypes of keypair.\n return {\n privateKey: new PrivateRsaCryptoKey(generated, this.encryptionKeysAlgorithm(shaVersion)),\n publicKey: new PublicRsaCryptoKey(generated, this.encryptionKeysAlgorithm(shaVersion)),\n }\n }\n\n async generateSignatureKeyPair(): Promise<KeyPair<CryptoKey>> {\n const generated = await this.rsa.generateKey(RsaSignatureAlgorithm.PssWithSha256, 2048)\n return {\n privateKey: new PrivateRsaCryptoKey(generated, this.signatureKeysAlgorithm()),\n publicKey: new PublicRsaCryptoKey(generated, this.signatureKeysAlgorithm()),\n }\n }\n\n importKey(\n format: 'jwk' | 'spki' | 'pkcs8',\n keydata: JsonWebKey | ArrayBuffer,\n keyUsages: KeyUsage[],\n hashAlgorithm: ShaVersion\n ): Promise<CryptoKey> {\n if (keyUsages[0] == 'encrypt' && (format == 'jwk' || format == 'spki')) {\n return this.importPublicKey(format, keydata, hashAlgorithm)\n } else if (keyUsages[0] == 'decrypt' && (format == 'jwk' || format == 'pkcs8')) {\n return this.importPrivateKey(format, keydata, hashAlgorithm)\n } else throw new Error(`Combination of key usages and key format not supported: ${keyUsages} ${format}`)\n }\n\n async importKeyPair(\n privateKeyFormat: string,\n privateKeydata: JsonWebKey | ArrayBuffer,\n publicKeyFormat: string,\n publicKeyData: JsonWebKey | ArrayBuffer,\n hashAlgorithm: ShaVersion\n ): Promise<KeyPair<CryptoKey>> {\n let importedPrivate: RsaPrivateKey\n let importedPublic: RsaPublicKey\n const algorithm = this.kryptomAlgorithm(hashAlgorithm)\n if (privateKeyFormat == 'jwk') {\n importedPrivate = await this.rsa.importPrivateKeyJwk(privateKeydata as PrivateRsaKeyJwk, algorithm)\n } else {\n importedPrivate = await this.rsa.importPrivateKeyPkcs8(new Uint8Array(privateKeydata as ArrayBuffer), algorithm)\n }\n if (publicKeyFormat == 'jwk') {\n importedPublic = await this.rsa.importPublicKeyJwk(publicKeyData as PublicRsaKeyJwk, algorithm)\n } else {\n importedPublic = await this.rsa.importPublicKeySpki(new Uint8Array(publicKeyData as ArrayBuffer), algorithm)\n }\n return {\n privateKey: new PrivateRsaCryptoKey(importedPrivate, this.encryptionKeysAlgorithm(hashAlgorithm)),\n publicKey: new PublicRsaCryptoKey(importedPublic, this.encryptionKeysAlgorithm(hashAlgorithm)),\n }\n }\n\n async importPrivateKey(format: 'jwk' | 'pkcs8', keydata: JsonWebKey | ArrayBuffer, hashAlgorithm: ShaVersion): Promise<CryptoKey> {\n let imported: RsaPrivateKey\n if (format == 'jwk') {\n imported = await this.rsa.importPrivateKeyJwk(keydata as PrivateRsaKeyJwk, this.kryptomAlgorithm(hashAlgorithm))\n } else {\n imported = await this.rsa.importPrivateKeyPkcs8(new Uint8Array(keydata as ArrayBuffer), this.kryptomAlgorithm(hashAlgorithm))\n }\n return new PrivateRsaCryptoKey(imported, this.encryptionKeysAlgorithm(hashAlgorithm))\n }\n\n async importPublicKey(format: 'jwk' | 'spki', keydata: JsonWebKey | ArrayBuffer, hashAlgorithm: ShaVersion): Promise<CryptoKey> {\n let imported: RsaPublicKey\n if (format == 'jwk') {\n imported = await this.rsa.importPublicKeyJwk(keydata as PublicRsaKeyJwk, this.kryptomAlgorithm(hashAlgorithm))\n } else {\n imported = await this.rsa.importPublicKeySpki(new Uint8Array(keydata as ArrayBuffer), this.kryptomAlgorithm(hashAlgorithm))\n }\n return new PublicRsaCryptoKey(imported, this.encryptionKeysAlgorithm(hashAlgorithm))\n }\n\n async importSignatureKey(format: 'jwk' | 'pkcs8', keydata: JsonWebKey | ArrayBuffer): Promise<CryptoKey> {\n let importedKey: RsaPrivateKey\n if (format == 'jwk') {\n importedKey = await this.rsa.importPrivateKeyJwk(keydata as PrivateRsaKeyJwk, RsaSignatureAlgorithm.PssWithSha256)\n } else {\n importedKey = await this.rsa.importPrivateKeyPkcs8(new Uint8Array(keydata as ArrayBuffer), RsaSignatureAlgorithm.PssWithSha256)\n }\n return new PrivateRsaCryptoKey(importedKey, this.signatureKeysAlgorithm())\n }\n\n async importVerificationKey(format: 'jwk' | 'spki', keydata: JsonWebKey | ArrayBuffer): Promise<CryptoKey> {\n let importedKey: RsaPublicKey\n if (format == 'jwk') {\n importedKey = await this.rsa.importPublicKeyJwk(keydata as PublicRsaKeyJwk, RsaSignatureAlgorithm.PssWithSha256)\n } else {\n importedKey = await this.rsa.importPublicKeySpki(new Uint8Array(keydata as ArrayBuffer), RsaSignatureAlgorithm.PssWithSha256)\n }\n return new PublicRsaCryptoKey(importedKey, this.signatureKeysAlgorithm())\n }\n\n async sign(privateKey: CryptoKey, data: ArrayBuffer): Promise<ArrayBuffer> {\n return await this.rsa.signature(new Uint8Array(data), getKryptomKey(privateKey))\n }\n\n async verifySignature(publicKey: CryptoKey, signature: ArrayBuffer, data: ArrayBuffer): Promise<boolean> {\n return await this.rsa.verify(new Uint8Array(signature), new Uint8Array(data), getKryptomKey(publicKey))\n }\n\n private kryptomAlgorithm(shaVersion: ShaVersion): RsaEncryptionAlgorithm {\n return shaVersion == 'sha-256' ? RsaEncryptionAlgorithm.OaepWithSha256 : RsaEncryptionAlgorithm.OaepWithSha1\n }\n\n private encryptionKeysAlgorithm(shaVersion: ShaVersion): RsaHashedKeyAlgorithm {\n return {\n name: 'RSA-OAEP',\n modulusLength: 2048,\n publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537 (Fermat F4), read http://en.wikipedia.org/wiki/65537_(number)\n hash: { name: shaVersion == 'sha-256' ? 'SHA-256' : 'SHA-1' },\n }\n }\n\n private signatureKeysAlgorithm(): RsaHashedKeyAlgorithm {\n return {\n name: 'RSA-PSS',\n modulusLength: 2048,\n publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537 (Fermat F4), read http://en.wikipedia.org/wiki/65537_(number)\n hash: { name: 'SHA-256' },\n }\n }\n}\n\nclass PrivateRsaCryptoKey implements CryptoKey {\n constructor(readonly kryptomKey: RsaPrivateKey, readonly algorithm: RsaKeyAlgorithm) {}\n\n get extractable(): boolean {\n return true\n }\n\n get type(): KeyType {\n return 'private'\n }\n\n get usages(): KeyUsage[] {\n return this.algorithm.name != 'RSA-PSS' ? ['decrypt'] : ['sign']\n }\n\n toJSON() {\n return {}\n }\n}\n\nclass PublicRsaCryptoKey implements CryptoKey {\n constructor(readonly kryptomKey: RsaPublicKey, readonly algorithm: RsaKeyAlgorithm) {}\n\n get extractable(): boolean {\n return true\n }\n\n get type(): KeyType {\n return 'public'\n }\n\n get usages(): KeyUsage[] {\n return this.algorithm.name != 'RSA-PSS' ? ['encrypt'] : ['verify']\n }\n\n toJSON() {\n return {}\n }\n}\n\nenum AesAlgorithm {\n AesCbcPkcs7 = 'AesCbcPkcs7',\n}\nenum RsaEncryptionAlgorithm {\n OaepWithSha1 = 'OaepWithSha1',\n OaepWithSha256 = 'OaepWithSha256',\n}\nenum RsaSignatureAlgorithm {\n PssWithSha256 = 'PssWithSha256',\n}\ntype RsaAlgorithm = RsaEncryptionAlgorithm | RsaSignatureAlgorithm\nenum HmacAlgorithm {\n HmacSha512 = 'HmacSha512',\n}\n\ninterface HmacKey {\n algorithmIdentifier: HmacAlgorithm\n}\n\ninterface AesKey {\n algorithmIdentifier: AesAlgorithm\n}\n\ninterface RsaKeyPair {\n algorithmIdentifier: RsaAlgorithm\n}\n\ninterface RsaPrivateKey {\n algorithmIdentifier: RsaAlgorithm\n}\n\ninterface RsaPublicKey {\n algorithmIdentifier: RsaAlgorithm\n}\n\ntype PrivateRsaKeyJwk = {\n alg: string\n d: string\n dp: string\n dq: string\n e: string\n ext: boolean\n key_ops: string[]\n n: string\n p: string\n q: string\n qi: string\n}\n\ntype PublicRsaKeyJwk = {\n alg: string\n e: string\n ext: boolean\n key_ops: string[]\n n: string\n}\n\ninterface AesService {\n generateKey(algorithmIdentifier: AesAlgorithm, size: number): Promise<AesKey>\n encrypt(data: Uint8Array, key: AesKey, iv: Uint8Array | null): Promise<Uint8Array>\n decrypt(ivAndEncryptedData: Uint8Array, key: AesKey): Promise<Uint8Array>\n exportRawKey(key: AesKey): Promise<Uint8Array>\n importRawKey(rawKey: Uint8Array, algorithmIdentifier: AesAlgorithm): Promise<AesKey>\n}\n\ninterface RsaService {\n generateKey(algorithmIdentifier: RsaAlgorithm, size: number): Promise<RsaKeyPair>\n encrypt(data: Uint8Array, key: RsaPublicKey): Promise<Uint8Array>\n decrypt(data: Uint8Array, key: RsaPrivateKey): Promise<Uint8Array>\n signature(data: Uint8Array, key: RsaPrivateKey): Promise<Uint8Array>\n verify(signature: Uint8Array, data: Uint8Array, key: RsaPublicKey): Promise<boolean>\n exportPrivateKeyPkcs8(key: RsaPrivateKey): Promise<Uint8Array>\n exportPrivateKeyJwk(key: RsaPrivateKey): Promise<PrivateRsaKeyJwk>\n exportPublicKeySpki(key: RsaPublicKey): Promise<Uint8Array>\n exportPublicKeyJwk(key: RsaPublicKey): Promise<PublicRsaKeyJwk>\n importPrivateKeyPkcs8(privateKeyPkcs8: Uint8Array, algorithmIdentifier: RsaAlgorithm): Promise<RsaPrivateKey>\n importPrivateKeyJwk(privateKey: PrivateRsaKeyJwk, algorithmIdentifier: RsaAlgorithm): Promise<RsaPrivateKey>\n importPublicKeySpki(publicKeySpki: Uint8Array, algorithmIdentifier: RsaAlgorithm): Promise<RsaPublicKey>\n importPublicKeyJwk(publicKey: PublicRsaKeyJwk, algorithmIdentifier: RsaAlgorithm): Promise<RsaPublicKey>\n importKeyPair(privateKeyPkcs8: Uint8Array, algorithmIdentifier: RsaAlgorithm): Promise<RsaKeyPair>\n}\n\ninterface HmacService {\n generateKey(algorithmIdentifier: HmacAlgorithm): Promise<HmacKey>\n sign(data: Uint8Array, key: HmacKey): Promise<Uint8Array>\n verify(signature: Uint8Array, data: Uint8Array, key: HmacKey): Promise<boolean>\n exportRawKey(key: HmacKey): Promise<Uint8Array>\n importRawKey(rawKey: Uint8Array, algorithmIdentifier: HmacAlgorithm): Promise<HmacKey>\n}\n\ninterface StrongRandomService {\n randomBytes(length: number): Uint8Array\n randomUUID(): string\n}\n\ninterface DigestService {\n sha256(data: Uint8Array): Promise<Uint8Array>\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IccAccesslogApi } from '../icc-api';
|
|
2
2
|
import { IccCryptoXApi } from './icc-crypto-x-api';
|
|
3
3
|
import * as models from '../icc-api/model/models';
|
|
4
|
-
import { AccessLog, PaginatedListAccessLog } from '../icc-api/model/models';
|
|
4
|
+
import { AccessLog, ListOfIds, PaginatedListAccessLog } from '../icc-api/model/models';
|
|
5
5
|
import { IccDataOwnerXApi } from './icc-data-owner-x-api';
|
|
6
6
|
import { AuthenticationProvider } from './auth/AuthenticationProvider';
|
|
7
7
|
import { SecureDelegation } from '../icc-api/model/SecureDelegation';
|
|
@@ -64,7 +64,6 @@ export declare class IccAccesslogXApi extends IccAccesslogApi implements Encrypt
|
|
|
64
64
|
findBy(hcpartyId: string, patient: models.Patient, usingPost?: boolean): Promise<models.AccessLog[]>;
|
|
65
65
|
findByHCPartyPatientSecretFKeys(hcPartyId: string, secretFKeys: string): Promise<AccessLog[]>;
|
|
66
66
|
findByHCPartyPatientSecretFKeysArray(hcPartyId: string, secretFKeys: string[]): Promise<Array<AccessLog> | any>;
|
|
67
|
-
findAccessLogsByHCPartyPatientForeignKey(hcPartyId: string, secretFKey: string, startKey?: string, startDocumentId?: string, limit?: number): Promise<PaginatedListAccessLog>;
|
|
68
67
|
decrypt(hcpId: string, accessLogs: Array<models.AccessLog>): Promise<Array<models.AccessLog>>;
|
|
69
68
|
encrypt(user: models.User, accessLogs: Array<models.AccessLog>): Promise<Array<models.AccessLog>>;
|
|
70
69
|
private encryptAs;
|
|
@@ -72,6 +71,8 @@ export declare class IccAccesslogXApi extends IccAccesslogApi implements Encrypt
|
|
|
72
71
|
createAccessLogWithUser(user: models.User, body?: models.AccessLog): Promise<models.AccessLog | any>;
|
|
73
72
|
getAccessLog(accessLogId: string): never;
|
|
74
73
|
getAccessLogWithUser(user: models.User, accessLogId: string): Promise<models.AccessLog | any>;
|
|
74
|
+
getAccessLogs(ids: ListOfIds): Promise<AccessLog[]>;
|
|
75
|
+
getAccessLogsWithUser(user: models.User, ids: ListOfIds): Promise<AccessLog[]>;
|
|
75
76
|
listAccessLogs(fromEpoch?: number, toEpoch?: number, startKey?: number, startDocumentId?: string, limit?: number): never;
|
|
76
77
|
listAccessLogsWithUser(user: models.User, fromEpoch?: number, toEpoch?: number, startKey?: number, startDocumentId?: string, limit?: number, descending?: boolean): Promise<PaginatedListAccessLog>;
|
|
77
78
|
modifyAccessLog(body?: models.AccessLog): never;
|