scrt-link-core
Advanced tools
Comparing version 0.2.4 to 0.2.5
@@ -8,2 +8,9 @@ # Change Log | ||
## [0.2.5] - 2022-02-06 | ||
### Changed | ||
- Introduce meta property | ||
- Drop file property | ||
## [0.2.4] - 2022-02-02 | ||
@@ -10,0 +17,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, receiptApi, receiptEmail, receiptPhoneNumber, file, } = 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, meta, } = options; | ||
if (password && ramda_1.is(String, password)) { | ||
@@ -20,3 +20,3 @@ message = utils_1.encryptMessage(message, password); | ||
message = utils_1.encryptMessage(message, encryptionKey); | ||
const data = Object.assign(Object.assign(Object.assign({ alias, | ||
const data = Object.assign(Object.assign({ alias, | ||
message, | ||
@@ -30,7 +30,4 @@ secretType, isEncryptedWithUserPassword: !!password }, (secretType === 'neogram' | ||
receiptEmail, | ||
receiptPhoneNumber }), (secretType === 'file' | ||
? { | ||
file, | ||
} | ||
: {})); | ||
receiptPhoneNumber, | ||
meta }); | ||
return utils_1.api(`${baseUrl}/api/secrets`, { method: 'POST' }, ramda_1.reject(ramda_1.isNil, data)).then(() => ({ | ||
@@ -37,0 +34,0 @@ alias, |
@@ -12,9 +12,3 @@ export declare type SecretType = 'text' | 'url' | 'neogram' | 'file'; | ||
receiptApi?: Record<string, unknown>; | ||
file?: { | ||
bucket: string; | ||
key: string; | ||
fileType: string; | ||
name: string; | ||
size: number; | ||
}; | ||
meta?: string; | ||
} | ||
@@ -21,0 +15,0 @@ export declare type SecretUrlFields = Omit<CreateSecretOptions, 'encryptionKey' | 'password'> & { |
{ | ||
"name": "scrt-link-core", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "Core for scrt.link - a tool to securely share sensitive information online.", | ||
@@ -5,0 +5,0 @@ "author": "Chris Chiller <kingchiller@protonmail.com>", |
@@ -31,3 +31,3 @@ import { reject, is, isNil } from 'ramda' | ||
receiptPhoneNumber, | ||
file, | ||
meta, | ||
} = options | ||
@@ -56,7 +56,3 @@ | ||
receiptPhoneNumber, | ||
...(secretType === 'file' | ||
? { | ||
file, | ||
} | ||
: {}), | ||
meta, | ||
} | ||
@@ -63,0 +59,0 @@ |
@@ -13,9 +13,3 @@ export type SecretType = 'text' | 'url' | 'neogram' | 'file' | ||
receiptApi?: Record<string, unknown> | ||
file?: { | ||
bucket: string | ||
key: string | ||
fileType: string | ||
name: string | ||
size: number | ||
} | ||
meta?: string | ||
} | ||
@@ -22,0 +16,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
1871235
1595