@pushprotocol/restapi
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -5,2 +5,12 @@ # Changelog | ||
## [0.3.2](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.3.1...restapi-0.3.2) (2023-02-03) | ||
### Bug Fixes | ||
* Metamask reject handled ([#136](https://github.com/ethereum-push-notification-service/push-sdk/issues/136)) ([46a20b7](https://github.com/ethereum-push-notification-service/push-sdk/commit/46a20b751e655a526168c8ae7c400211f3b62b15)) | ||
* **restapi:** fix parse api response of notifications to send subject/title as asub ([#140](https://github.com/ethereum-push-notification-service/push-sdk/issues/140)) ([6a11feb](https://github.com/ethereum-push-notification-service/push-sdk/commit/6a11feb7cc02bf9ca0541b34f399992ad33f12a4)), closes [#139](https://github.com/ethereum-push-notification-service/push-sdk/issues/139) | ||
## [0.3.1](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.3.0...restapi-0.3.1) (2023-01-27) | ||
@@ -7,0 +17,0 @@ |
{ | ||
"name": "@pushprotocol/restapi", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
@@ -12,3 +12,2 @@ import { Chat, IMessageIPFS, IUser } from '../../types'; | ||
connectedUser: IUser; | ||
toDecrypt: boolean; | ||
pgpPrivateKey?: string; | ||
@@ -15,0 +14,0 @@ env?: string; |
@@ -19,7 +19,9 @@ "use strict"; | ||
} | ||
return (0, exports.decryptConversation)({ messages, connectedUser, toDecrypt, pgpPrivateKey, env }); | ||
if (toDecrypt) | ||
return (0, exports.decryptConversation)({ messages, connectedUser, pgpPrivateKey, env }); | ||
return messages; | ||
}); | ||
exports.getInboxLists = getInboxLists; | ||
const decryptConversation = (options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
const { messages, connectedUser, toDecrypt, pgpPrivateKey, env = constants_1.default.ENV.PROD, } = options || {}; | ||
const { messages, connectedUser, pgpPrivateKey, env = constants_1.default.ENV.PROD, } = options || {}; | ||
let otherPeer; | ||
@@ -43,12 +45,10 @@ let signatureValidationPubliKey; // To do signature verification it depends on who has sent the message | ||
} | ||
if (toDecrypt) { | ||
message.messageContent = yield (0, helpers_1.decryptMessage)({ | ||
encryptedMessage: message.messageContent, | ||
encryptedSecret: message.encryptedSecret, | ||
encryptionType: message.encType, | ||
signature: message.signature, | ||
signatureValidationPubliKey: signatureValidationPubliKey, | ||
pgpPrivateKey, | ||
}); | ||
} | ||
message.messageContent = yield (0, helpers_1.decryptMessage)({ | ||
encryptedMessage: message.messageContent, | ||
encryptedSecret: message.encryptedSecret, | ||
encryptionType: message.encType, | ||
signature: message.signature, | ||
signatureValidationPubliKey: signatureValidationPubliKey, | ||
pgpPrivateKey, | ||
}); | ||
} | ||
@@ -55,0 +55,0 @@ } |
@@ -19,3 +19,3 @@ "use strict"; | ||
encryptedSecret: aesEncryptedSecret, | ||
sigType: signature, | ||
sigType: 'pgp', | ||
}; | ||
@@ -22,0 +22,0 @@ return body; |
@@ -8,2 +8,2 @@ import { AccountEnvOptionsType } from '../types'; | ||
} | ||
export declare const history: (options: HistoricalMessagesOptionsType) => Promise<import("../types").IMessageIPFS[]>; | ||
export declare const history: (options: HistoricalMessagesOptionsType) => Promise<any>; |
@@ -29,9 +29,11 @@ "use strict"; | ||
const connectedUser = yield (0, user_1.get)({ account: (0, helpers_1.pCAIP10ToWallet)(account), env }); | ||
return yield (0, helpers_2.decryptConversation)({ | ||
messages, | ||
connectedUser, | ||
toDecrypt, | ||
pgpPrivateKey, | ||
env, | ||
}); | ||
if (toDecrypt) { | ||
return yield (0, helpers_2.decryptConversation)({ | ||
messages, | ||
connectedUser, | ||
pgpPrivateKey, | ||
env, | ||
}); | ||
} | ||
return messages; | ||
} | ||
@@ -38,0 +40,0 @@ catch (err) { |
@@ -10,2 +10,2 @@ import { AccountEnvOptionsType } from '../types'; | ||
} | ||
export declare const latest: (options: LatestMessagesOptionsType) => Promise<import("../types").IMessageIPFS[]>; | ||
export declare const latest: (options: LatestMessagesOptionsType) => Promise<any>; |
@@ -14,3 +14,3 @@ "use strict"; | ||
cta, | ||
title: asub || notification.title || '', | ||
title: asub || '', | ||
message: bigMessage || notification.body || '', | ||
@@ -17,0 +17,0 @@ icon, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
181589
2562