amplify-cli-core
Advanced tools
Comparing version 1.6.3 to 1.7.0-backend.0
@@ -6,2 +6,19 @@ # Change Log | ||
# [1.7.0-backend.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-cli-core@1.6.0...amplify-cli-core@1.7.0-backend.0) (2020-11-21) | ||
### 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)) | ||
* team provider migration ([#5733](https://github.com/aws-amplify/amplify-cli/issues/5733)) ([d18f795](https://github.com/aws-amplify/amplify-cli/commit/d18f795560f0e671f63f1dcbe38931c951794619)) | ||
### Features | ||
* storage import ([#5893](https://github.com/aws-amplify/amplify-cli/issues/5893)) ([ad7b028](https://github.com/aws-amplify/amplify-cli/commit/ad7b028330bcee64d5124be7f27a8494dc8e9400)) | ||
## [1.6.3](https://github.com/aws-amplify/amplify-cli/compare/amplify-cli-core@1.6.0...amplify-cli-core@1.6.3) (2020-11-20) | ||
@@ -8,0 +25,0 @@ |
@@ -91,3 +91,3 @@ import { ServiceSelection } from './serviceSelection'; | ||
getWhen: () => $TSAny; | ||
inputValidation: () => $TSAny; | ||
inputValidation: (input: $TSAny) => $TSAny; | ||
listCategories: () => $TSAny; | ||
@@ -109,3 +109,3 @@ makeId: () => $TSAny; | ||
showResourceTable: () => $TSAny; | ||
serviceSelectionPrompt: (context: $TSContext, category: string, servicesMetadata: $TSAny, customQuestion?: $TSAny) => Promise<ServiceSelection>; | ||
serviceSelectionPrompt: (context: $TSContext, category: string, servicesMetadata: $TSAny, customQuestion?: $TSAny, optionNameOverrides?: Record<string, string>) => Promise<ServiceSelection>; | ||
updateProjectConfig: () => $TSAny; | ||
@@ -112,0 +112,0 @@ updateamplifyMetaAfterResourceUpdate: () => $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.6.3", | ||
"version": "1.7.0-backend.0", | ||
"description": "Amplify CLI Core", | ||
@@ -58,3 +58,3 @@ "repository": { | ||
}, | ||
"gitHead": "5ba0d787e0ee9302005ba839a91103e289f7c277" | ||
"gitHead": "f323eb267e9c37927f0432bbe7b554ad0f7b4c41" | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
156449
1709
2