scrt-link-core
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -8,2 +8,12 @@ # Change Log | ||
## [0.2.1] - 2017-10-29 | ||
### Added | ||
- Add optional multi-purpose receiptApi | ||
### Changed | ||
- Remove legacy warning | ||
## [0.2.0] - 2017-09-04 | ||
@@ -10,0 +20,0 @@ |
@@ -13,3 +13,3 @@ "use strict"; | ||
const createSecret = (message, options = {}, baseUrl = constants_1.baseUrl) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
const { alias = utils_1.generateAlias(), encryptionKey = utils_1.generateEncryptionKey(), password, secretType = "text", neogramDestructionMessage = "This message will self-destruct in…", neogramDestructionTimeout = 3, receiptEmail, receiptPhoneNumber, } = options; | ||
const { alias = utils_1.generateAlias(), encryptionKey = utils_1.generateEncryptionKey(), password, secretType = "text", neogramDestructionMessage = "This message will self-destruct in…", neogramDestructionTimeout = 3, receiptApi, receiptEmail, receiptPhoneNumber, } = options; | ||
if (password && ramda_1.is(String, password)) { | ||
@@ -27,3 +27,4 @@ message = utils_1.encryptMessage(message, password); | ||
} | ||
: {})), { receiptEmail, | ||
: {})), { receiptApi, | ||
receiptEmail, | ||
receiptPhoneNumber }); | ||
@@ -41,6 +42,2 @@ return utils_1.api(`${baseUrl}/api/secrets`, { method: "POST" }, ramda_1.reject(ramda_1.isNil, data)).then(() => ({ | ||
}); | ||
// Handle legacy implementation | ||
if (alias.length === 12) { | ||
throw new Error(`Oops, this shouldn't have happened. This link appears to be in a legacy format that is no longer supported. Please ask to the sender to re-send the secret. Sorry for the inconvenience.`); | ||
} | ||
if (!secretRaw.message) { | ||
@@ -47,0 +44,0 @@ throw new Error(`Couldn't retrieve secret message.`); |
@@ -11,2 +11,3 @@ export declare type SecretType = "text" | "url" | "neogram"; | ||
receiptPhoneNumber?: string; | ||
receiptApi?: Record<string, unknown>; | ||
} | ||
@@ -13,0 +14,0 @@ export declare type SecretUrlFields = Omit<CreateSecretOptions, "encryptionKey" | "password"> & { |
{ | ||
"name": "scrt-link-core", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Core for scrt.link - a tool to securely share sensitive information online.", | ||
@@ -5,0 +5,0 @@ "author": "Chris Chiller <kingchiller@protonmail.com>", |
@@ -34,2 +34,3 @@ import { reject, is, isNil } from "ramda"; | ||
neogramDestructionTimeout = 3, | ||
receiptApi, | ||
receiptEmail, | ||
@@ -57,2 +58,3 @@ receiptPhoneNumber, | ||
: {}), | ||
receiptApi, | ||
receiptEmail, | ||
@@ -91,9 +93,2 @@ receiptPhoneNumber, | ||
// Handle legacy implementation | ||
if (alias.length === 12) { | ||
throw new Error( | ||
`Oops, this shouldn't have happened. This link appears to be in a legacy format that is no longer supported. Please ask to the sender to re-send the secret. Sorry for the inconvenience.` | ||
); | ||
} | ||
if (!secretRaw.message) { | ||
@@ -100,0 +95,0 @@ throw new Error(`Couldn't retrieve secret message.`); |
@@ -12,2 +12,3 @@ export type SecretType = "text" | "url" | "neogram"; | ||
receiptPhoneNumber?: string; | ||
receiptApi?: Record<string, unknown>; | ||
} | ||
@@ -14,0 +15,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1872003
1648