🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

amplify-cli-core

Package Overview
Dependencies
Maintainers
1
Versions
486
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amplify-cli-core - npm Package Compare versions

Comparing version

to
1.8.1-backend.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [1.8.1-backend.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-cli-core@1.8.0...amplify-cli-core@1.8.1-backend.0) (2020-11-23)
### Bug Fixes
* file existence checks, enable admin console ([#5922](https://github.com/aws-amplify/amplify-cli/issues/5922)) ([d5d2ce6](https://github.com/aws-amplify/amplify-cli/commit/d5d2ce69bea99d0853e3ba7c0133f9334b4724ef))
# [1.8.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-cli-core@1.6.0...amplify-cli-core@1.8.0) (2020-11-22)

@@ -8,0 +19,0 @@

2

lib/index.d.ts

@@ -91,3 +91,3 @@ import { ServiceSelection } from './serviceSelection';

getWhen: () => $TSAny;
inputValidation: () => $TSAny;
inputValidation: (input: $TSAny) => $TSAny;
listCategories: () => $TSAny;

@@ -94,0 +94,0 @@ makeId: () => $TSAny;

@@ -7,5 +7,6 @@ export declare class JSONUtilities {

static writeJson: (fileName: string, data: any, options?: {
minify?: boolean | undefined;
keepComments?: boolean | undefined;
mode?: number | undefined;
minify?: boolean | undefined;
secureFile?: boolean | undefined;
} | undefined) => void;

@@ -12,0 +13,0 @@ static parse: <T>(jsonString: string, options?: {

@@ -60,4 +60,5 @@ "use strict";

const mergedOptions = {
keepComments: false,
minify: false,
keepComments: false,
secureFile: false,
...options,

@@ -71,6 +72,7 @@ };

fs.ensureDirSync(dirPath);
fs.writeFileSync(fileName, jsonString, {
encoding: 'utf8',
mode: options === null || options === void 0 ? void 0 : options.mode,
});
const writeFileOptions = { encoding: 'utf8', mode: options === null || options === void 0 ? void 0 : options.mode };
if (mergedOptions.secureFile) {
writeFileOptions.mode = 0o600;
}
fs.writeFileSync(fileName, jsonString, writeFileOptions);
};

@@ -77,0 +79,0 @@ JSONUtilities.parse = (jsonString, options) => {

@@ -6,2 +6,3 @@ export declare const PathConstants: {

DeploymentSecretsFileName: string;
AmplifyAdminDir: string;
AmplifyDirName: string;

@@ -12,2 +13,3 @@ DotAmplifyDirName: string;

CurrentCloudBackendDirName: string;
AmplifyAdminConfigFileName: string;
AmplifyRcFileName: string;

@@ -33,2 +35,4 @@ GitIgnoreFileName: string;

getHomeDotAmplifyDirPath: () => string;
getAmplifyAdminDirPath: () => string;
getAmplifyAdminConfigFilePath: () => string;
getAmplifyDirPath: (projectPath?: string | undefined) => string;

@@ -35,0 +39,0 @@ getDotConfigDirPath: (projectPath?: string | undefined) => string;

@@ -31,2 +31,3 @@ "use strict";

DeploymentSecretsFileName: 'deployment-secrets.json',
AmplifyAdminDir: 'admin',
AmplifyDirName: 'amplify',

@@ -37,2 +38,3 @@ DotAmplifyDirName: '.amplify',

CurrentCloudBackendDirName: '#current-cloud-backend',
AmplifyAdminConfigFileName: 'config.json',
AmplifyRcFileName: '.amplifyrc',

@@ -63,2 +65,4 @@ GitIgnoreFileName: '.gitignore',

this.getHomeDotAmplifyDirPath = () => this.homeDotAmplifyDirPath;
this.getAmplifyAdminDirPath = () => this.constructPath(this.getHomeDotAmplifyDirPath(), [exports.PathConstants.AmplifyAdminDir]);
this.getAmplifyAdminConfigFilePath = () => this.constructPath(this.getAmplifyAdminDirPath(), [exports.PathConstants.AmplifyAdminConfigFileName]);
this.getAmplifyDirPath = (projectPath) => this.constructPath(projectPath, [exports.PathConstants.AmplifyDirName]);

@@ -65,0 +69,0 @@ this.getDotConfigDirPath = (projectPath) => this.constructPath(projectPath, [exports.PathConstants.AmplifyDirName, exports.PathConstants.DotConfigDirName]);

@@ -27,2 +27,5 @@ import { $TSMeta, $TSTeamProviderInfo, $TSAny, DeploymentSecrets } from '..';

getResourceParametersJson: (projectPath: string | undefined, category: string, resourceName: string, options?: GetOptions<any> | undefined) => $TSAny;
getAmplifyAdminConfigEntry: (appId: string) => any;
removeAmplifyAdminConfigEntry: (appId: string) => void;
setAmplifyAdminConfigEntry: (appId: string, config: $TSAny) => void;
setLocalEnvInfo: (projectPath: string | undefined, localEnvInfo: $TSAny) => void;

@@ -40,2 +43,3 @@ setLocalAWSInfo: (projectPath: string | undefined, localAWSInfo: $TSAny) => void;

setCLIJSON: (projectPath: string, cliJSON: any, env?: string | undefined) => void;
private doesExist;
private getData;

@@ -42,0 +46,0 @@ }

@@ -30,3 +30,3 @@ "use strict";

constructor() {
this.metaFileExists = (projectPath) => fs.existsSync(pathManager_1.pathManager.getAmplifyMetaFilePath(projectPath));
this.metaFileExists = (projectPath) => this.doesExist(pathManager_1.pathManager.getAmplifyMetaFilePath, projectPath);
this.getMeta = (projectPath, options) => {

@@ -41,3 +41,3 @@ const filePath = pathManager_1.pathManager.getAmplifyMetaFilePath(projectPath);

};
this.currentMetaFileExists = (projectPath) => fs.existsSync(pathManager_1.pathManager.getCurrentAmplifyMetaFilePath(projectPath));
this.currentMetaFileExists = (projectPath) => this.doesExist(pathManager_1.pathManager.getCurrentAmplifyMetaFilePath, projectPath);
this.setDeploymentSecrets = (deploymentSecrets) => {

@@ -63,3 +63,3 @@ const path = pathManager_1.pathManager.getDeploymentSecrets();

this.getCurrentProjectTags = (projectPath) => tags_1.ReadValidateTags(pathManager_1.pathManager.getCurrentTagFilePath(projectPath));
this.teamProviderInfoExists = (projectPath) => fs.existsSync(pathManager_1.pathManager.getTeamProviderInfoFilePath(projectPath));
this.teamProviderInfoExists = (projectPath) => this.doesExist(pathManager_1.pathManager.getTeamProviderInfoFilePath, projectPath);
this.getTeamProviderInfo = (projectPath, options) => {

@@ -73,3 +73,3 @@ const filePath = pathManager_1.pathManager.getTeamProviderInfoFilePath(projectPath);

};
this.localEnvInfoExists = (projectPath) => fs.existsSync(pathManager_1.pathManager.getLocalEnvFilePath(projectPath));
this.localEnvInfoExists = (projectPath) => this.doesExist(pathManager_1.pathManager.getLocalEnvFilePath, projectPath);
this.getLocalEnvInfo = (projectPath, options) => {

@@ -91,3 +91,3 @@ const filePath = pathManager_1.pathManager.getLocalEnvFilePath(projectPath);

};
this.projectConfigExists = (projectPath) => fs.existsSync(pathManager_1.pathManager.getProjectConfigFilePath(projectPath));
this.projectConfigExists = (projectPath) => this.doesExist(pathManager_1.pathManager.getProjectConfigFilePath, projectPath);
this.getProjectConfig = (projectPath, options) => {

@@ -101,3 +101,3 @@ const filePath = pathManager_1.pathManager.getProjectConfigFilePath(projectPath);

};
this.backendConfigFileExists = (projectPath) => fs.existsSync(pathManager_1.pathManager.getBackendConfigFilePath(projectPath));
this.backendConfigFileExists = (projectPath) => this.doesExist(pathManager_1.pathManager.getBackendConfigFilePath, projectPath);
this.getBackendConfig = (projectPath, options) => {

@@ -119,2 +119,16 @@ const filePath = pathManager_1.pathManager.getBackendConfigFilePath(projectPath);

};
this.getAmplifyAdminConfigEntry = (appId) => {
const adminConfig = (jsonUtilities_1.JSONUtilities.readJson(pathManager_1.pathManager.getAmplifyAdminConfigFilePath(), { throwIfNotExist: false }) || {});
return adminConfig[appId];
};
this.removeAmplifyAdminConfigEntry = (appId) => {
const adminConfig = jsonUtilities_1.JSONUtilities.readJson(pathManager_1.pathManager.getAmplifyAdminConfigFilePath());
delete adminConfig[appId];
jsonUtilities_1.JSONUtilities.writeJson(pathManager_1.pathManager.getAmplifyAdminConfigFilePath(), adminConfig, { secureFile: true });
};
this.setAmplifyAdminConfigEntry = (appId, config) => {
const adminConfig = jsonUtilities_1.JSONUtilities.readJson(pathManager_1.pathManager.getAmplifyAdminConfigFilePath(), { throwIfNotExist: false }) || {};
adminConfig[appId] = config;
jsonUtilities_1.JSONUtilities.writeJson(pathManager_1.pathManager.getAmplifyAdminConfigFilePath(), adminConfig, { secureFile: true });
};
this.setLocalEnvInfo = (projectPath, localEnvInfo) => {

@@ -156,3 +170,10 @@ const filePath = pathManager_1.pathManager.getLocalEnvFilePath(projectPath);

};
this.cliJSONFileExists = (projectPath, env) => fs.existsSync(pathManager_1.pathManager.getCLIJSONFilePath(projectPath, env));
this.cliJSONFileExists = (projectPath, env) => {
try {
return fs.existsSync(pathManager_1.pathManager.getCLIJSONFilePath(projectPath, env));
}
catch (e) {
return false;
}
};
this.getCLIJSON = (projectPath, env, options) => {

@@ -172,2 +193,12 @@ const filePath = pathManager_1.pathManager.getCLIJSONFilePath(projectPath, env);

};
this.doesExist = (filePathGetter, projectPath) => {
let path;
try {
path = filePathGetter(projectPath);
return fs.existsSync(path);
}
catch (e) {
return false;
}
};
this.getData = (filePath, options) => {

@@ -174,0 +205,0 @@ var _a;

{
"name": "amplify-cli-core",
"version": "1.8.1-alpha.0+c0aa2d9fa",
"version": "1.8.1-backend.0",
"description": "Amplify CLI Core",

@@ -58,3 +58,3 @@ "repository": {

},
"gitHead": "c0aa2d9fa4739214aba42fa9fff5d6c5164f540c"
"gitHead": "21cd6739f2f6d489857bc285bd1fb2b0b2b91bcd"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet