Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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 1.9.0 to 1.10.0-beta.0

11

CHANGELOG.md

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

# [1.10.0-beta.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-cli-core@1.9.0...amplify-cli-core@1.10.0-beta.0) (2020-11-30)
### Features
* pre-deploy pull, new login mechanism and pkg cli updates ([#5941](https://github.com/aws-amplify/amplify-cli/issues/5941)) ([7274251](https://github.com/aws-amplify/amplify-cli/commit/7274251faadc1035acce5f44699b172e10e2e67d))
# [1.9.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-cli-core@1.8.0...amplify-cli-core@1.9.0) (2020-11-27)

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

@@ -27,2 +27,8 @@ export declare class NotImplementedError extends Error {

}
export declare class AppNotFoundError extends Error {
}
export declare class AppAlreadyDeployedError extends Error {
}
export declare class SchemaDoesNotExistError extends Error {
}
//# sourceMappingURL=index.d.ts.map

11

lib/errors/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TeamProviderInfoMigrateError = exports.FrontendBuildError = exports.InvalidSubCommandError = exports.InvalidEnvironmentNameError = exports.NonEmptyDirectoryError = exports.MissingParametersError = exports.EnvironmentDoesNotExistError = exports.UnknownArgumentError = exports.UnknownResourceTypeError = exports.ResourceCredentialsNotFoundError = exports.ResourceDoesNotExistError = exports.ResourceAlreadyExistsError = exports.NotImplementedError = void 0;
exports.SchemaDoesNotExistError = exports.AppAlreadyDeployedError = exports.AppNotFoundError = exports.TeamProviderInfoMigrateError = exports.FrontendBuildError = exports.InvalidSubCommandError = exports.InvalidEnvironmentNameError = exports.NonEmptyDirectoryError = exports.MissingParametersError = exports.EnvironmentDoesNotExistError = exports.UnknownArgumentError = exports.UnknownResourceTypeError = exports.ResourceCredentialsNotFoundError = exports.ResourceDoesNotExistError = exports.ResourceAlreadyExistsError = exports.NotImplementedError = void 0;
class NotImplementedError extends Error {

@@ -43,2 +43,11 @@ }

exports.TeamProviderInfoMigrateError = TeamProviderInfoMigrateError;
class AppNotFoundError extends Error {
}
exports.AppNotFoundError = AppNotFoundError;
class AppAlreadyDeployedError extends Error {
}
exports.AppAlreadyDeployedError = AppAlreadyDeployedError;
class SchemaDoesNotExistError extends Error {
}
exports.SchemaDoesNotExistError = SchemaDoesNotExistError;
//# sourceMappingURL=index.js.map

@@ -67,2 +67,13 @@ import { ServiceSelection } from './serviceSelection';

export declare type $TSObject = Record<string, $TSAny>;
export declare enum AmplifyFrontend {
android = "android",
ios = "ios",
javascript = "javascript"
}
export interface AmplifyProjectConfig {
projectName: string;
version: string;
frontend: AmplifyFrontend;
providers: string[];
}
interface AmplifyToolkit {

@@ -84,3 +95,3 @@ buildResources: () => $TSAny;

getEnvInfo: () => $TSAny;
getProviderPlugins: () => $TSAny;
getProviderPlugins: (context: $TSContext) => $TSAny;
getPluginInstance: () => $TSAny;

@@ -93,3 +104,3 @@ getProjectConfig: () => $TSAny;

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

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

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.AmplifyFrontend = void 0;
__exportStar(require("./cliContext"), exports);

@@ -28,2 +29,8 @@ __exportStar(require("./cliContextEnvironmentProvider"), exports);

__exportStar(require("./deploymentSecretsHelper"), exports);
var AmplifyFrontend;
(function (AmplifyFrontend) {
AmplifyFrontend["android"] = "android";
AmplifyFrontend["ios"] = "ios";
AmplifyFrontend["javascript"] = "javascript";
})(AmplifyFrontend = exports.AmplifyFrontend || (exports.AmplifyFrontend = {}));
//# sourceMappingURL=index.js.map

3

lib/jsonUtilities.d.ts

@@ -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) => {

export declare const PathConstants: {
DotAWSDir: string;
DotAWSDirName: string;
AWSCredentials: string;
AWSConfig: string;
DeploymentSecretsFileName: string;
AmplifyAdminDirName: string;
AmplifyDirName: string;

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

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

@@ -32,2 +34,4 @@ GitIgnoreFileName: string;

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

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

@@ -27,6 +27,7 @@ "use strict";

exports.PathConstants = {
DotAWSDir: '.aws',
DotAWSDirName: '.aws',
AWSCredentials: 'credentials',
AWSConfig: 'config',
DeploymentSecretsFileName: 'deployment-secrets.json',
AmplifyAdminDirName: '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.AmplifyAdminDirName]);
this.getAmplifyAdminConfigFilePath = () => this.constructPath(this.getAmplifyAdminDirPath(), [exports.PathConstants.AmplifyAdminConfigFileName]);
this.getAmplifyDirPath = (projectPath) => this.constructPath(projectPath, [exports.PathConstants.AmplifyDirName]);

@@ -95,3 +99,3 @@ this.getDotConfigDirPath = (projectPath) => this.constructPath(projectPath, [exports.PathConstants.AmplifyDirName, exports.PathConstants.DotConfigDirName]);

]);
this.getDotAWSDirPath = () => path.normalize(path.join(os_1.homedir(), exports.PathConstants.DotAWSDir));
this.getDotAWSDirPath = () => path.normalize(path.join(os_1.homedir(), exports.PathConstants.DotAWSDirName));
this.getAWSCredentialsFilePath = () => path.normalize(path.join(this.getDotAWSDirPath(), exports.PathConstants.AWSCredentials));

@@ -103,3 +107,3 @@ this.getAWSConfigFilePath = () => path.normalize(path.join(this.getDotAWSDirPath(), exports.PathConstants.AWSConfig));

};
this.getDotAWSAmplifyDirPath = () => path.normalize(path.join(os_1.homedir(), exports.PathConstants.DotAWSDir, exports.PathConstants.AmplifyDirName));
this.getDotAWSAmplifyDirPath = () => path.normalize(path.join(os_1.homedir(), exports.PathConstants.DotAWSDirName, exports.PathConstants.AmplifyDirName));
this.getDeploymentSecrets = () => path.normalize(path.join(this.getDotAWSAmplifyDirPath(), exports.PathConstants.DeploymentSecretsFileName));

@@ -106,0 +110,0 @@ this.constructPath = (projectPath, segments = []) => {

@@ -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, options?: GetOptions<any> | undefined) => 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,22 @@ const filePath = pathManager_1.pathManager.getBackendConfigFilePath(projectPath);

};
this.getAmplifyAdminConfigEntry = (appId, options) => {
var _a;
const mergedOptions = {
throwIfNotExist: false,
default: {},
...options,
};
const adminConfig = (_a = jsonUtilities_1.JSONUtilities.readJson(pathManager_1.pathManager.getAmplifyAdminConfigFilePath(), { throwIfNotExist: false })) !== null && _a !== void 0 ? _a : mergedOptions.default;
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 +176,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 +199,12 @@ const filePath = pathManager_1.pathManager.getCLIJSONFilePath(projectPath, env);

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

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

{
"name": "amplify-cli-core",
"version": "1.9.0",
"version": "1.10.0-beta.0",
"description": "Amplify CLI Core",

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

},
"gitHead": "eb4f23deeb3bf9e4896088faa6f8d734b84c24a5"
"gitHead": "f12d17a143583bbeda600d95afd9c0232339740a"
}

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc