node-sp-alm
Advanced tools
Comparing version 1.0.1-beta.2e6ebb1 to 1.1.0-beta.cbccf55
# Change Log | ||
## 1.1.0 | ||
- Retract action added | ||
- Remove action added | ||
## 1.0.0 | ||
- Initial release |
/// <reference types="node" /> | ||
import { IOptions } from './../utils/IAlmTasks'; | ||
import { IAddedApp } from './IAppMetadata'; | ||
import { IAddedApp } from '../utils/IAppMetadata'; | ||
export declare function add(options: IOptions, filename: string, contents: Buffer, useAppCatalog?: boolean): Promise<IAddedApp>; |
@@ -38,7 +38,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var authHelper_1 = require("../helper/authHelper"); | ||
var appCatalog_1 = require("../helper/appCatalog"); | ||
var appInsights_1 = require("../helper/appInsights"); | ||
var request = require("request"); | ||
var logger_1 = require("../helper/logger"); | ||
var baseRequester_1 = require("../helper/baseRequester"); | ||
function deploy(options, pkgId, skipFeatureDeployment, useAppCatalog) { | ||
@@ -48,44 +46,11 @@ if (skipFeatureDeployment === void 0) { skipFeatureDeployment = true; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var siteUrl, headers, restUrl; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (!pkgId) { | ||
throw "Package ID (pkgId) argument is required"; | ||
} | ||
appInsights_1.default.trackEvent({ | ||
name: 'deploy' | ||
}); | ||
logger_1.default.info('Starting to deploy solution package.'); | ||
return [4, appCatalog_1.default.get(options, useAppCatalog)]; | ||
case 1: | ||
siteUrl = _a.sent(); | ||
return [4, authHelper_1.default.getRequestHeaders(options, siteUrl)]; | ||
case 2: | ||
headers = _a.sent(); | ||
restUrl = siteUrl + "/_api/web/tenantappcatalog/AvailableApps/GetById('" + pkgId + "')/Deploy"; | ||
return [2, new Promise(function (resolve, reject) { | ||
request.post(restUrl, { headers: headers, body: JSON.stringify({ "skipFeatureDeployment": skipFeatureDeployment }) }, function (err, resp, body) { | ||
if (err) { | ||
logger_1.default.error(JSON.stringify(err)); | ||
reject("Failed to deploy the solution package with ID: " + pkgId); | ||
return; | ||
} | ||
var data = JSON.parse(body); | ||
if (data["odata.error"]) { | ||
logger_1.default.error(JSON.stringify(data["odata.error"])); | ||
reject("Failed to deploy the solution package with ID: " + pkgId); | ||
return; | ||
} | ||
if (resp.statusCode === 200) { | ||
logger_1.default.info('Deployed the solution package.'); | ||
resolve(true); | ||
} | ||
else { | ||
logger_1.default.warning('Something went wrong deploying the solution package.'); | ||
resolve(false); | ||
} | ||
}); | ||
})]; | ||
if (!pkgId) { | ||
throw "Package ID (pkgId) argument is required"; | ||
} | ||
appInsights_1.default.trackEvent({ | ||
name: 'deploy' | ||
}); | ||
logger_1.default.info('Starting to deploy solution package.'); | ||
return [2, baseRequester_1.default.post('Deploy', pkgId, options, useAppCatalog, skipFeatureDeployment)]; | ||
}); | ||
@@ -92,0 +57,0 @@ }); |
@@ -1,3 +0,3 @@ | ||
import { IAppMetadata } from './IAppMetadata'; | ||
import { IAppMetadata } from '../utils/IAppMetadata'; | ||
import { IOptions } from './../utils/IAlmTasks'; | ||
export declare function details(options: IOptions, pkgId: string, useAppCatalog?: boolean): Promise<IAppMetadata>; |
@@ -5,1 +5,3 @@ export * from './add'; | ||
export * from './list'; | ||
export * from './retract'; | ||
export * from './remove'; |
@@ -10,2 +10,4 @@ "use strict"; | ||
__export(require("./list")); | ||
__export(require("./retract")); | ||
__export(require("./remove")); | ||
//# sourceMappingURL=index.js.map |
@@ -1,3 +0,3 @@ | ||
import { IAppMetadata } from './IAppMetadata'; | ||
import { IAppMetadata } from '../utils/IAppMetadata'; | ||
import { IOptions } from './../utils/IAlmTasks'; | ||
export declare function list(options: IOptions, useAppCatalog?: boolean): Promise<IAppMetadata[]>; |
/// <reference types="node" /> | ||
import { IAppMetadata, IAddedApp } from './actions/IAppMetadata'; | ||
import { IAppMetadata, IAddedApp } from './utils/IAppMetadata'; | ||
import { IOptions } from './utils/IAlmTasks'; | ||
@@ -11,3 +11,3 @@ export declare class ALM { | ||
deploy(pkgId: string, skipFeatureDeployment: boolean, useAppCatalog?: boolean): Promise<boolean>; | ||
retract(): Promise<void>; | ||
retract(pkgId: string, useAppCatalog?: boolean): Promise<boolean>; | ||
remove(): Promise<void>; | ||
@@ -14,0 +14,0 @@ install(): Promise<void>; |
@@ -109,10 +109,10 @@ "use strict"; | ||
}; | ||
ALM.prototype.retract = function () { | ||
ALM.prototype.retract = function (pkgId, useAppCatalog) { | ||
if (useAppCatalog === void 0) { useAppCatalog = true; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
appInsights_1.default.trackEvent({ | ||
name: 'retract' | ||
}); | ||
console.log('retract - not yet implemented'); | ||
return [2]; | ||
switch (_a.label) { | ||
case 0: return [4, actions.retract(this._internalOptions, pkgId, useAppCatalog)]; | ||
case 1: return [2, _a.sent()]; | ||
} | ||
}); | ||
@@ -119,0 +119,0 @@ }); |
{ | ||
"name": "node-sp-alm", | ||
"version": "1.0.1-beta.2e6ebb1", | ||
"version": "1.1.0-beta.cbccf55", | ||
"description": "This node/gulp plugin that allows you to automate your add-in / SPFx deployment and installation", | ||
@@ -27,2 +27,3 @@ "main": "dist/index.js", | ||
"@types/request": "2.0.8", | ||
"@types/request-promise": "4.1.36", | ||
"typescript": "2.4.2" | ||
@@ -29,0 +30,0 @@ }, |
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
121441
56
2042
3