Comparing version
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "✨ A cli that makes using AWS Parameter Store... as simple as the flick of a wand 🧙", | ||
@@ -16,3 +16,5 @@ "main": "index.ts", | ||
"build": "ncc build ./src/bin/cli.ts", | ||
"lint": "eslint src/* --ext .ts" | ||
"lint": "eslint src/* --ext .ts", | ||
"version": "auto-changelog -p && git add CHANGELOG.md", | ||
"release": "npm run build && npm publish" | ||
}, | ||
@@ -104,3 +106,2 @@ "engines": { | ||
"devDependencies": { | ||
"jest-mock-process": "^1.4.0", | ||
"@types/dateformat": "^3.0.1", | ||
@@ -115,2 +116,3 @@ "@types/debug": "^4.1.5", | ||
"ajv-keywords": "^3.4.1", | ||
"auto-changelog": "^2.0.0", | ||
"eslint": "^6.0.0", | ||
@@ -120,2 +122,3 @@ "eslint-config-prettier": "^6.10.1", | ||
"jest": "^25", | ||
"jest-mock-process": "^1.4.0", | ||
"lint-staged": "^10.2.2", | ||
@@ -122,0 +125,0 @@ "ncc": "^0.3.6", |
@@ -155,3 +155,3 @@  | ||
- **CLI flag** (`--cli`): Removes colors to avoid odd input. `default: false` | ||
- **CI flag** (`--ci`): Removes colors to avoid odd input. `default: false` | ||
@@ -158,0 +158,0 @@ If you are using `alo` as a [global command](#installation), you can provide all the above options via command line: |
@@ -5,3 +5,3 @@ import SSM from 'aws-sdk/clients/ssm'; | ||
import { Options } from '../types'; | ||
import { Actions } from '../types'; | ||
import { REGION, API_VERSION, Environment, SUCCESS_SYMBOL } from '../utils/constants'; | ||
@@ -12,3 +12,3 @@ import { getGlobalOptions, Command } from '../utils/getGlobalOptions'; | ||
interface Input extends Options { | ||
interface Input extends Actions { | ||
name: string; | ||
@@ -15,0 +15,0 @@ |
import SSM from 'aws-sdk/clients/ssm'; | ||
import groupBy from 'lodash.groupby'; | ||
import { Options } from '../types'; | ||
import { Actions } from '../types'; | ||
import { REGION, API_VERSION, MAX_RESULTS_FOR_PATH, Environment, Template } from '../utils/constants'; | ||
@@ -10,3 +10,3 @@ import { normalizeSecretKey } from '../utils/normalizeSecretKey'; | ||
import { setAWSCredentials } from '../utils/setAWSCredentials'; | ||
interface Input extends Options { templateName?: Template, custom?: string }; | ||
interface Input extends Actions { templateName?: Template, custom?: string }; | ||
@@ -13,0 +13,0 @@ const getParametersByPath = async (params: SSM.GetParametersByPathRequest, region: string): Promise<SSM.ParameterList> => { |
@@ -7,3 +7,3 @@ import SSM from 'aws-sdk/clients/ssm'; | ||
import { Options } from '../types'; | ||
import { Actions } from '../types'; | ||
import { REGION, API_VERSION, Environment, DATE_FORMAT, SUCCESS_SYMBOL, DISABLE_TABLE_COLORS } from '../utils/constants'; | ||
@@ -14,7 +14,7 @@ import { getGlobalOptions, Command } from '../utils/getGlobalOptions'; | ||
interface Input extends Options { | ||
interface Input extends Actions { | ||
name: string | ||
}; | ||
export const getParameter = async ({ name, prefix, region = REGION, cli = false, environment = Environment.all }: Input): Promise<string> => { | ||
export const getParameter = async ({ name, prefix, region = REGION, ci = false, environment = Environment.all }: Input): Promise<string> => { | ||
@@ -31,3 +31,3 @@ const loader = ora(`retrieving key ${name} with the prefix /${prefix} (${region})`).start(); | ||
head: ['Name', 'Value', 'Environment', 'Updated by', 'Version'], | ||
style: cli ? DISABLE_TABLE_COLORS : undefined | ||
style: ci ? DISABLE_TABLE_COLORS : undefined | ||
}); | ||
@@ -34,0 +34,0 @@ |
@@ -6,3 +6,3 @@ import Table from 'cli-table3'; | ||
import { Options } from '../types'; | ||
import { Actions } from '../types'; | ||
import { API_VERSION, REGION, DATE_FORMAT, SUCCESS_SYMBOL, MAX_RESULTS_FOR_DESCRIBE, DISABLE_TABLE_COLORS } from '../utils/constants'; | ||
@@ -29,3 +29,3 @@ import { normalizeSecretKey } from '../utils/normalizeSecretKey'; | ||
export const listParameters = async ({ environment, prefix, region = REGION, cli = false }: Options): Promise<string> => { | ||
export const listParameters = async ({ environment, prefix, region = REGION, ci = false }: Actions): Promise<string> => { | ||
@@ -36,3 +36,3 @@ const loader = ora(`Finding keys with the prefix /${prefix} (${region})`).start(); | ||
head: ['Name', 'Environment', 'Updated by', 'Updated at'], | ||
style: cli ? DISABLE_TABLE_COLORS : undefined | ||
style: ci ? DISABLE_TABLE_COLORS : undefined | ||
}); | ||
@@ -39,0 +39,0 @@ |
@@ -6,3 +6,3 @@ import SSM from 'aws-sdk/clients/ssm'; | ||
import { Options } from '../types'; | ||
import { Actions } from '../types'; | ||
import { REGION, API_VERSION, Environment, DATE_FORMAT, SUCCESS_SYMBOL, DISABLE_TABLE_COLORS } from '../utils/constants'; | ||
@@ -13,3 +13,3 @@ import { getGlobalOptions, Command } from '../utils/getGlobalOptions'; | ||
interface Input extends Options { | ||
interface Input extends Actions { | ||
name: string; | ||
@@ -21,3 +21,3 @@ value: string; | ||
export const setParameter = async ({ name, value, description, prefix, region = REGION, cli = false, environment = Environment.all }: Input): Promise<string> => { | ||
export const setParameter = async ({ name, value, description, prefix, region = REGION, ci = false, environment = Environment.all }: Input): Promise<string> => { | ||
@@ -41,3 +41,3 @@ const loader = ora(`storing key ${name} with the prefix /${prefix} (${region})`).start(); | ||
head: ['Name', 'Value', 'Environment', 'Updated at', 'Version'], | ||
style: cli ? DISABLE_TABLE_COLORS : undefined | ||
style: ci ? DISABLE_TABLE_COLORS : undefined | ||
}); | ||
@@ -44,0 +44,0 @@ |
import { Environment } from './utils/constants'; | ||
export interface Options { environment?: Environment | string, prefix: string, region?: string, cli?: boolean }; | ||
export interface Actions { environment?: Environment | string, prefix: string, region?: string, ci?: boolean }; |
import { CustomConfig, getCustomConfiguration } from './getCustomConfiguration'; | ||
interface Options { cli?: boolean, prefix?: string, awsProfile?: string, environment?: string, awsRegion?: string, awsAccessKeyId?: string, awsSecretAccessKey?: string, awsSessionToken?: string } | ||
interface Options { ci?: boolean, prefix?: string, awsProfile?: string, environment?: string, awsRegion?: string, awsAccessKeyId?: string, awsSecretAccessKey?: string, awsSessionToken?: string } | ||
type PossibleCredentials = { profile?: string, accessKeyId?: string, secretAccessKey?: string, sessionToken?: string }; | ||
type Parameters = { prefix: string, region?: string, environment?: string, cli?: boolean } | ||
type Parameters = { prefix: string, region?: string, environment?: string, ci?: boolean } | ||
export interface Command { parent: Options } | ||
@@ -19,3 +19,3 @@ export const getGlobalOptions = async (command: Command): Promise<{ params: Parameters, credentials: PossibleCredentials }> => { | ||
awsSessionToken: sessionToken, | ||
cli = false | ||
ci = false | ||
} | ||
@@ -42,5 +42,5 @@ } = command | ||
credentials, | ||
params: { prefix, environment, region, cli } | ||
params: { prefix, environment, region, ci } | ||
} | ||
} | ||
} |
Sorry, the diff of this file is too big to display
1394163
-13.68%25
4.17%