@agility/cli
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -8,2 +8,3 @@ import { AxiosInstance } from 'axios'; | ||
getInstance(guid: string): AxiosInstance; | ||
getInstancePoll(): AxiosInstance; | ||
executeGet(apiPath: string, guid: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
@@ -10,0 +11,0 @@ executePost(apiPath: string, guid: string, data: any): Promise<import("axios").AxiosResponse<any, any>>; |
@@ -86,2 +86,9 @@ "use strict"; | ||
}; | ||
Auth.prototype.getInstancePoll = function () { | ||
var baseURL = "https://mgmt.aglty.io"; | ||
var instance = axios_1.default.create({ | ||
baseURL: "".concat(baseURL, "/oauth") | ||
}); | ||
return instance; | ||
}; | ||
Auth.prototype.executeGet = function (apiPath, guid) { | ||
@@ -119,3 +126,3 @@ return __awaiter(this, void 0, void 0, function () { | ||
case 0: | ||
instance = this.getInstance(guid); | ||
instance = this.getInstancePoll(); | ||
_a.label = 1; | ||
@@ -122,0 +129,0 @@ case 1: |
@@ -72,10 +72,13 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var apiClient, containers, progressBar3, fileExport, index, i, container_1, referenceName, progressCount; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
var apiClient, containers, progressBar3, fileExport, index, i, container_1, referenceName, progressCount, _a; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
apiClient = new mgmtApi.ApiClient(this._options); | ||
_b.label = 1; | ||
case 1: | ||
_b.trys.push([1, 7, , 8]); | ||
return [4 /*yield*/, apiClient.containerMethods.getContainerList(guid)]; | ||
case 1: | ||
containers = _a.sent(); | ||
case 2: | ||
containers = _b.sent(); | ||
progressBar3 = this._multibar.create(containers.length, 0); | ||
@@ -86,8 +89,8 @@ progressBar3.update(0, { name: 'Containers' }); | ||
i = 0; | ||
_a.label = 2; | ||
case 2: | ||
if (!(i < containers.length)) return [3 /*break*/, 5]; | ||
_b.label = 3; | ||
case 3: | ||
if (!(i < containers.length)) return [3 /*break*/, 6]; | ||
return [4 /*yield*/, apiClient.containerMethods.getContainerByID(containers[i].contentViewID, guid)]; | ||
case 3: | ||
container_1 = _a.sent(); | ||
case 4: | ||
container_1 = _b.sent(); | ||
referenceName = container_1.referenceName.replace(/[^a-zA-Z ]/g, ""); | ||
@@ -104,7 +107,11 @@ ; | ||
index += 1; | ||
_a.label = 4; | ||
case 4: | ||
_b.label = 5; | ||
case 5: | ||
i++; | ||
return [3 /*break*/, 2]; | ||
case 5: return [2 /*return*/]; | ||
return [3 /*break*/, 3]; | ||
case 6: return [3 /*break*/, 8]; | ||
case 7: | ||
_a = _b.sent(); | ||
return [3 /*break*/, 8]; | ||
case 8: return [2 /*return*/]; | ||
} | ||
@@ -111,0 +118,0 @@ }); |
@@ -14,2 +14,3 @@ export declare class fileOperations { | ||
readDirectory(folderName: string): string[]; | ||
folderExists(folderName: string): boolean; | ||
codeFileExists(): boolean; | ||
@@ -16,0 +17,0 @@ fileExists(path: string): boolean; |
@@ -169,2 +169,11 @@ "use strict"; | ||
}; | ||
fileOperations.prototype.folderExists = function (folderName) { | ||
var directory = ".agility-files/".concat(folderName); | ||
if (fs.existsSync(directory)) { | ||
return true; | ||
} | ||
else { | ||
return false; | ||
} | ||
}; | ||
fileOperations.prototype.codeFileExists = function () { | ||
@@ -171,0 +180,0 @@ var appName = 'mgmt-cli-code'; |
@@ -174,7 +174,7 @@ #!/usr/bin/env node | ||
case 10: | ||
console.log(colors.red('Please authenticate first to perform the push operation.')); | ||
console.log(colors.red('Please authenticate first to perform the pull operation.')); | ||
_a.label = 11; | ||
case 11: return [3 /*break*/, 13]; | ||
case 12: | ||
console.log(colors.red('Please authenticate first to perform the push operation.')); | ||
console.log(colors.red('Please authenticate first to perform the pull operation.')); | ||
_a.label = 13; | ||
@@ -181,0 +181,0 @@ case 13: return [2 /*return*/]; |
@@ -72,13 +72,16 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var apiClient, contentModules, pageModules, models, fileExport, totalLength, progressBar4, i, i, index, i, model_1; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
var apiClient, contentModules, pageModules, models, fileExport, totalLength, progressBar4, i, i, index, i, model_1, _a; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
apiClient = new mgmtApi.ApiClient(this._options); | ||
_b.label = 1; | ||
case 1: | ||
_b.trys.push([1, 8, , 9]); | ||
return [4 /*yield*/, apiClient.modelMethods.getContentModules(true, guid, false)]; | ||
case 1: | ||
contentModules = _a.sent(); | ||
case 2: | ||
contentModules = _b.sent(); | ||
return [4 /*yield*/, apiClient.modelMethods.getPageModules(true, guid)]; | ||
case 2: | ||
pageModules = _a.sent(); | ||
case 3: | ||
pageModules = _b.sent(); | ||
models = []; | ||
@@ -97,8 +100,8 @@ fileExport = new fileOperations_1.fileOperations(); | ||
i = 0; | ||
_a.label = 3; | ||
case 3: | ||
if (!(i < models.length)) return [3 /*break*/, 6]; | ||
_b.label = 4; | ||
case 4: | ||
if (!(i < models.length)) return [3 /*break*/, 7]; | ||
return [4 /*yield*/, apiClient.modelMethods.getContentModel(models[i].id, guid)]; | ||
case 4: | ||
model_1 = _a.sent(); | ||
case 5: | ||
model_1 = _b.sent(); | ||
fileExport.exportFiles('models', model_1.id, model_1); | ||
@@ -112,7 +115,11 @@ if (index === 1) { | ||
index += 1; | ||
_a.label = 5; | ||
case 5: | ||
_b.label = 6; | ||
case 6: | ||
i++; | ||
return [3 /*break*/, 3]; | ||
case 6: | ||
return [3 /*break*/, 4]; | ||
case 7: return [3 /*break*/, 9]; | ||
case 8: | ||
_a = _b.sent(); | ||
return [3 /*break*/, 9]; | ||
case 9: | ||
this._multibar.stop(); | ||
@@ -119,0 +126,0 @@ return [2 /*return*/]; |
@@ -104,10 +104,13 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var apiClient, pageTemplates, progressBar0, index, fileExport, i, template; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
var apiClient, pageTemplates, progressBar0, index, fileExport, i, template, _a; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
apiClient = new mgmtApi.ApiClient(this._options); | ||
_b.label = 1; | ||
case 1: | ||
_b.trys.push([1, 3, , 4]); | ||
return [4 /*yield*/, apiClient.pageMethods.getPageTemplates(this._guid, this._locale, true)]; | ||
case 1: | ||
pageTemplates = _a.sent(); | ||
case 2: | ||
pageTemplates = _b.sent(); | ||
progressBar0 = this._multibar.create(pageTemplates.length, 0); | ||
@@ -123,3 +126,7 @@ progressBar0.update(0, { name: 'Templates' }); | ||
} | ||
return [2 /*return*/]; | ||
return [3 /*break*/, 4]; | ||
case 3: | ||
_a = _b.sent(); | ||
return [3 /*break*/, 4]; | ||
case 4: return [2 /*return*/]; | ||
} | ||
@@ -137,2 +144,3 @@ }); | ||
fileOperation = new fileOperations_1.fileOperations(); | ||
if (!fileOperation.folderExists("".concat(this._locale, "/page"))) return [3 /*break*/, 6]; | ||
files = fileOperation.readDirectory("".concat(this._locale, "/page")); | ||
@@ -139,0 +147,0 @@ progressBar01 = this._multibar.create(files.length, 0); |
{ | ||
"name": "@agility/cli", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Agility CLI for working with your content.", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is too big to display
201479
3725