Dependencies and linting updates

This commit is contained in:
Mike Cook 2018-03-19 10:02:26 +00:00
parent 9ef7415615
commit a626af102f
3 changed files with 19 additions and 12 deletions

View File

@ -6,7 +6,7 @@
/// <reference types="node"/>
import * as AWS from 'aws-sdk';
interface ICredstashConfig {
interface CredstashConfig {
table?: string;
awsOpts?: AWS.KMS.ClientConfiguration;
dynamoOpts?: AWS.DynamoDB.ClientConfiguration;
@ -14,32 +14,32 @@ interface ICredstashConfig {
kmsOpts?: AWS.KMS.ClientConfiguration;
}
interface ICredstashContext {
interface CredstashContext {
[key: string]: string;
}
interface IPutSecretOptions {
interface PutSecretOptions {
name: string;
secret: string;
context: ICredstashContext;
context: CredstashContext;
digest?: string;
version?: number;
}
interface ICredstash {
interface Credstash {
getHighestVersion: (options: { name: string }) => Promise<AWS.DynamoDB.AttributeMap>;
incrementVersion: (options: { name: string }) => Promise<string>;
putSecret: (options: IPutSecretOptions) => Promise<AWS.DynamoDB.DocumentClient.PutItemOutput>;
decryptStash: (stash: { key: string; }, context?: ICredstashContext) => Promise<AWS.KMS.DecryptResponse>;
getAllVersions: (options: { name: string, context?: ICredstashContext, limit?: number }) => Promise<Array<{ version: string; secret: string }>>;
getSecret: (options: { name: string, context?: ICredstashContext, version?: number }) => Promise<string>;
deleteSecrets: (options: { name: string }) => Promise<Array<AWS.DynamoDB.DocumentClient.DeleteItemOutput>>;
putSecret: (options: PutSecretOptions) => Promise<AWS.DynamoDB.DocumentClient.PutItemOutput>;
decryptStash: (stash: { key: string; }, context?: CredstashContext) => Promise<AWS.KMS.DecryptResponse>;
getAllVersions: (options: { name: string, context?: CredstashContext, limit?: number }) => Promise<Array<{ version: string; secret: string }>>;
getSecret: (options: { name: string, context?: CredstashContext, version?: number }) => Promise<string>;
deleteSecrets: (options: { name: string }) => Promise<AWS.DynamoDB.DocumentClient.DeleteItemOutput[]>;
deleteSecret: (options: { name: string, version: number }) => Promise<AWS.DynamoDB.DocumentClient.DeleteItemOutput>;
listSecrets: () => Promise<string[]>;
getAllSecrets: (options: { version?: number, context?: ICredstashContext, startsWith?: string }) => Promise<{ [key: string]: string }>;
getAllSecrets: (options: { version?: number, context?: CredstashContext, startsWith?: string }) => Promise<{ [key: string]: string }>;
createDdbTable: () => Promise<void>;
}
declare function Credstash(config: ICredstashConfig): ICredstash;
declare function Credstash(config: CredstashConfig): Credstash;
export = Credstash;

View File

@ -0,0 +1,6 @@
{
"dependencies": {
"aws-sdk": "^2.211.0"
},
"private": true
}

View File

@ -7,6 +7,7 @@
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"