Comparing version 1.6.0 to 1.7.0
@@ -0,1 +1,7 @@ | ||
export interface SecretKMSInstance { | ||
encrypt: (secret: any, keyName: string, version?: string) => Secret; | ||
decrypt: (data: string, keyName: string, version?: string) => Promise<string>; | ||
} | ||
export type SecretKMSConfig = { | ||
@@ -9,3 +15,3 @@ accessKey: string, | ||
export type Secret = { | ||
export type SecretKMSSecret = { | ||
data: string, | ||
@@ -19,10 +25,4 @@ key: { | ||
export interface SecretKMSInstance { | ||
encrypt: (secret: any, keyName: string, version?: string) => Secret; | ||
decrypt: (data: string, keyName: string, version?: string) => Promise<string>; | ||
} | ||
declare function init(config: SecretKMSConfig): SecretKMSInstance; | ||
export type SecretKMSSetup = (config: SecretKMSConfig) => SecretKMSInstance; | ||
export default SecretKMSSetup; | ||
export default init; |
@@ -217,3 +217,3 @@ module.exports = | ||
module.exports = function (config) { | ||
function init(config) { | ||
if (!config || !config.accessKey || !config.secretKey || !config.region || !config.bucket || !config.masterKey) { | ||
@@ -350,4 +350,6 @@ throw new Error('Configuration must include keys [accessKey, secretKey, region, bucket, masterKey]'); | ||
}; | ||
}; | ||
} | ||
module.exports = init; | ||
/***/ }), | ||
@@ -354,0 +356,0 @@ /* 3 */ |
{ | ||
"name": "secretkms", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "scripts": { |
428
20866