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.6.0 to 1.6.1-teamprv.15

lib/cliConstants.d.ts

2

lib/errors/index.d.ts

@@ -25,2 +25,4 @@ export declare class NotImplementedError extends Error {

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

5

lib/errors/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
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.MigrateError = 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 {

@@ -40,2 +40,5 @@ }

exports.FrontendBuildError = FrontendBuildError;
class MigrateError extends Error {
}
exports.MigrateError = MigrateError;
//# sourceMappingURL=index.js.map

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

export * from './isPackaged';
export * from './cliConstants';
export declare type $TSAny = any;

@@ -63,3 +64,3 @@ export declare type $TSContext = {

getPlugin: () => $TSAny;
getCategoryPluginInfo: (context: $TSContext) => $TSAny;
getCategoryPluginInfo: (context: $TSContext, category?: string, service?: string) => $TSAny;
getAllCategoryPluginInfo: (context: $TSContext) => $TSAny;

@@ -135,3 +136,4 @@ getFrontendPlugins: () => $TSAny;

};
invokePluginMethod: <T>(context: $TSContext, category: string, service: string | null, method: string, args: any[]) => Promise<T>;
}
//# sourceMappingURL=index.d.ts.map

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

__exportStar(require("./isPackaged"), exports);
__exportStar(require("./cliConstants"), exports);
//# sourceMappingURL=index.js.map

@@ -9,2 +9,3 @@ export declare class JSONUtilities {

keepComments?: boolean | undefined;
mode?: number | undefined;
} | undefined) => void;

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

@@ -70,3 +70,6 @@ "use strict";

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

@@ -73,0 +76,0 @@ JSONUtilities.parse = (jsonString, options) => {

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

AWSConfig: string;
DeploymentSecrets: string;
AmplifyDirName: string;

@@ -52,2 +53,4 @@ DotAmplifyDirName: string;

getCLIJSONFilePath: (projectPath: string, env?: string | undefined) => string;
getDotAWSAmplifyDirPath: () => string;
getDeploymentSecrets: () => string;
private constructPath;

@@ -54,0 +57,0 @@ private validateProjectPath;

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

AWSConfig: 'config',
DeploymentSecrets: 'deployment-secrets.json',
AmplifyDirName: 'amplify',

@@ -99,2 +100,4 @@ DotAmplifyDirName: '.amplify',

};
this.getDotAWSAmplifyDirPath = () => path.normalize(path.join(os_1.homedir(), exports.PathConstants.DotAWSDir, exports.PathConstants.AmplifyDirName));
this.getDeploymentSecrets = () => path.normalize(path.join(this.getDotAWSAmplifyDirPath(), exports.PathConstants.DeploymentSecrets));
this.constructPath = (projectPath, segments = []) => {

@@ -101,0 +104,0 @@ if (!projectPath) {

@@ -12,6 +12,10 @@ import { $TSMeta, $TSTeamProviderInfo, $TSAny } from '..';

currentMetaFileExists: (projectPath?: string | undefined) => boolean;
setDeploymentSecrets: (deploymentSecrets: $TSAny) => void;
getCurrentMeta: (projectPath?: string | undefined, options?: GetOptions<any> | undefined) => $TSMeta;
getDeploymentSecrets: () => $TSAny;
getProjectTags: (projectPath?: string | undefined) => Tag[];
getCurrentProjectTags: (projectPath?: string | undefined) => Tag[];
teamProviderInfoExists: (projectPath?: string | undefined) => boolean;
teamProviderInfoHasAuthSecrets: (projectPath?: string | undefined) => any;
moveSecretsFromTeamProviderToDeployment: (projectPath?: string | undefined) => void;
getTeamProviderInfo: (projectPath?: string | undefined, options?: GetOptions<any> | undefined) => $TSTeamProviderInfo;

@@ -18,0 +22,0 @@ localEnvInfoExists: (projectPath?: string | undefined) => boolean;

@@ -21,2 +21,5 @@ "use strict";

};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -28,2 +31,5 @@ exports.stateManager = exports.StateManager = void 0;

const tags_1 = require("../tags");
const lodash_1 = __importDefault(require("lodash"));
const cliConstants_1 = require("../cliConstants");
const hostedUIProviderCredsField = 'hostedUIProviderCreds';
class StateManager {

@@ -42,2 +48,6 @@ constructor() {

this.currentMetaFileExists = (projectPath) => fs.existsSync(pathManager_1.pathManager.getCurrentAmplifyMetaFilePath(projectPath));
this.setDeploymentSecrets = (deploymentSecrets) => {
const path = pathManager_1.pathManager.getDeploymentSecrets();
jsonUtilities_1.JSONUtilities.writeJson(path, deploymentSecrets, { mode: cliConstants_1.SecretFileMode });
};
this.getCurrentMeta = (projectPath, options) => {

@@ -52,5 +62,43 @@ const filePath = pathManager_1.pathManager.getCurrentAmplifyMetaFilePath(projectPath);

};
this.getDeploymentSecrets = () => {
return (jsonUtilities_1.JSONUtilities.readJson(pathManager_1.pathManager.getDeploymentSecrets(), {
throwIfNotExist: false,
}) || {});
};
this.getProjectTags = (projectPath) => tags_1.ReadValidateTags(pathManager_1.pathManager.getTagFilePath(projectPath));
this.getCurrentProjectTags = (projectPath) => tags_1.ReadValidateTags(pathManager_1.pathManager.getCurrentTagFilePath(projectPath));
this.teamProviderInfoExists = (projectPath) => fs.existsSync(pathManager_1.pathManager.getTeamProviderInfoFilePath(projectPath));
this.teamProviderInfoHasAuthSecrets = (projectPath) => {
if (this.teamProviderInfoExists(projectPath)) {
const teamProviderInfo = this.getTeamProviderInfo(projectPath);
const { envName } = this.getLocalEnvInfo();
const envTeamProvider = teamProviderInfo[envName];
if (envTeamProvider && envTeamProvider.categories && envTeamProvider.categories.auth) {
return lodash_1.default.some(Object.keys(envTeamProvider.categories.auth), resource => {
return envTeamProvider.categories.auth[resource][hostedUIProviderCredsField];
});
}
}
return false;
};
this.moveSecretsFromTeamProviderToDeployment = (projectPath) => {
const { envName } = this.getLocalEnvInfo(projectPath);
let teamProviderInfo = this.getTeamProviderInfo();
const envTeamProvider = teamProviderInfo[envName];
const amplifyAppId = envTeamProvider.awscloudformation.AmplifyAppId;
let secrets = {};
Object.keys(envTeamProvider.categories).forEach(category => {
if (category === 'auth') {
Object.keys(envTeamProvider.categories.auth).forEach(resourceName => {
if (envTeamProvider.categories.auth[resourceName][hostedUIProviderCredsField]) {
const teamProviderSecrets = envTeamProvider.categories.auth[resourceName][hostedUIProviderCredsField];
delete envTeamProvider.categories.auth[resourceName][hostedUIProviderCredsField];
secrets = lodash_1.default.set(secrets, [amplifyAppId, envName, 'auth', resourceName, hostedUIProviderCredsField], teamProviderSecrets);
}
});
}
});
this.setTeamProviderInfo(undefined, teamProviderInfo);
this.setDeploymentSecrets(secrets);
};
this.getTeamProviderInfo = (projectPath, options) => {

@@ -57,0 +105,0 @@ const filePath = pathManager_1.pathManager.getTeamProviderInfoFilePath(projectPath);

{
"name": "amplify-cli-core",
"version": "1.6.0",
"version": "1.6.1-teamprv.15+661cdbe4d",
"description": "Amplify CLI Core",

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

},
"gitHead": "31a0390c46de51f02716164a30fe7b92fa1a0c21"
"gitHead": "661cdbe4d24bcaad7670eab50ff336e3d0720e07"
}

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