You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@sap/html5-app-deployer

Package Overview
Dependencies
Maintainers
3
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap/html5-app-deployer - npm Package Compare versions

Comparing version

to
2.1.0

gulpfile.js

@@ -8,2 +8,20 @@ # Change Log

## 2.1.0 - 2020-04-21
### Added
- Support node 8,10,12 versions
## 2.0.3 - 2019-03-13
### Fixed
- On failure deploy return the error written to the log
- Return correct error when deploy with empty resources folder
- Support deploy without npm install
## 2.0.2 - 2018-11-22
### Fixed
- Vulnerability issues
## 2.0.1 - 2018-06-07

@@ -10,0 +28,0 @@

2

lib/deployerHandler.js

@@ -115,3 +115,3 @@ /* eslint-disable no-console */

log.logMessage('error', 'Deployment of html5 application content failed [Deployment Id: %s]', deployId, {'CODE': '2007'});
console.error('Deployment of html5 application content failed [Deployment Id: ' + deployId + ']');
console.error('Deployment of html5 application content failed [Deployment Id: ' + deployId + '] ' + err);
} else {

@@ -118,0 +118,0 @@ log.logMessage('info', 'Deployment of html5 application content done [Deployment Id: %s]', deployId, {'CODE': '2006'});

@@ -45,3 +45,3 @@ /* eslint-disable no-console */

exports.getCwd = function() {
return path.join(__dirname, '..', '..', '..', '..');
return process.env.HOME;
};

@@ -54,3 +54,3 @@

if (!fs.existsSync(resourcesPath)){
throw Error('The resources folder ' + resourcesFolder + ' does not exist.');
throw Error('The resources folder ' + resourcesFolder + ' does not exist or is empty.');
}

@@ -61,3 +61,3 @@ if (!fs.lstatSync(resourcesPath).isDirectory()){

var folderEntries = fs.readdirSync(resourcesPath);
if (!folderEntries.length){
if (!folderEntries || !folderEntries.length){
throw Error('The resources folder ' + resourcesFolder + ' is empty.');

@@ -137,4 +137,5 @@ }

cb(new Error('Bad token'));
} else {
cb(null, JSON.parse(body).access_token);
}
cb(null, JSON.parse(body).access_token);
} else {

@@ -141,0 +142,0 @@ cb(new Error('Error while obtaining aaaa token; Status: ' + res.statusCode +

@@ -1,1 +0,1 @@

{"dependencies":{"archiver":"1.3.0","async":"2.6.0","cf-nodejs-logging-support":"2.1.0","file-type":"7.6.0","request":"2.81.0"},"description":"HTML5 application deployer","devDependencies":{"chai":"3.5.0","connect":"3.6.2","eslint":"3.2.2","express":"4.16.2","istanbul":"0.4.4","mocha":"3.0.2","multer":"1.3.0","sinon":"4.2.2","test-console":"1.1.0","whitesource":"1.0.7"},"engines":{"node":"6.0.0"},"main":"index.js","maintainers":[{"name":"https-support.sap.com","email":"do-not-reply@sap.com"}],"name":"@sap/html5-app-deployer","optionalDependencies":{},"readme":"@sap/html5-app-deployer\n==============\n[![Build Status](https://travis-ci.mo.sap.corp/html5-apps-repo/html5-app-deployer.svg?token=WNUCzC1QGN7ssw8yMAqk&branch=master)](https://travis-ci.mo.sap.corp/html5-apps-repo/html5-app-deployer)\n\n<!-- toc -->\n- [Overview](#overview)\n- [Deploying HTML5 Application Deployer App](#deploying-html5-application-deployer-app)\n * [Deploying HTML5 Application Deployer App Using cf push](#deploying-html5-application-deployer-app-using-cf-push)\n * [Deploying HTML5 Application Deployer App using cf deploy](#deploying-html5-application-deployer-app-using-cf-deploy)\n- [Undeploy HTML5 Application Deployer Apps](#undeploy-html5-application-deployer-apps)\n * [Delete HTML5 Application Deployer App Using cf delete](#delete-html5-application-deployer-app-using-cf-delete)\n * [Undeploy HTML5 Application Deployer App Using cf undeploy](#undeploy-html5-application-deployer-app-using-cf-undeploy)\n- [Redeploy HTML5 Application Deployer App](#redeploy-html5-application-deployer-app)\n\n## Overview\nHTML5 application deployer handles the upload of the HTML5 applications content to the HTML5 application repository.\n\nThe @sap/html5-app-deployer module is consumed as a dependency in a node.js CF application.\n\nFor example:\n ```\n {\n \"name\": \"myAppDeployer\",\n \"engines\": {\n \"node\": \">=6.0.0\"\n },\n \"dependencies\": {\n \"@sap/html5-app-deployer\": \"2.0.1\"\n },\n \"scripts\": {\n \"start\": \"node node_modules/@sap/html5-app-deployer/index.js\"\n }\n }\n ```\n\n\nBelow the root folder, the HTML5 applications deployer app can contain a \"resources\" folder for the static files of the HTML5 application.\n\nFor example:\n```\ncf create-service html5-apps-repo app-host myApps-app-host\n```\n\nIf no \"resources=\" tag is provided HTML5 application deployer will still try to upload files from resources folder. If no resources folder is found,the upload will fail.In the resources folder there should be one folder or one zip archive for each application that should be uploaded. \nIn each application folder/zip archive there should be two files at root level: manifest.json and xs-app.json. \n\nFor example: \n ```\n myAppsDeployer\n + node_modules\n - resources\n - app1\n index.html\n manifest.json\n xs-app.json\n - app2\n ...\n package.json\n manifest.yaml\n \n ```\n\nThe manifest.json file should contain at least sap.app.id and sap.app.applicationVersion.version. \n\nNote that sap.app.id and sap.app.applicationVersion.version are used in the HTML5 application repository as applicationName and applicationVersion. If sap.app.id contains dots or dashes, they will be removed in the applicationName.\nThe version format must be xx.xx.xx, whereas x is a digit. For example: 1.0.10\n\nNote that different app-host service instances cannot be used to upload applications with the same application id/name.\n\nFor example:\n ```\n manifest.json\n {\n \"_version\": \"1.7.0\",\n \"sap.app\": {\n \"id\": \"app1\",\n \"type\": \"application\",\n \"i18n\": \"i18n/i18n.properties\",\n \"applicationVersion\": {\n \"version\": \"1.0.0\"\n }\n }\n }\n ```\n\nThe xs-app.json file that can be used by the application router to support application routing. \nFor example:\n ```\n xs-app.json\n \"welcomeFile\": \"index.html\",\n \"authenticationMethod\": \"route\",\n \"routes\": [\n {\n \"source\": \"^/be(.*)\",\n \"target\": \"$1\",\n \"destination\": \"mybackend\"\n },\n {\n \"source\": \"^(/.*)\",\n \"target\": \"$1\",\n \"service\": \"html5-apps-repo-rt\"\n }\n ]\n }\n ```\n\nThe @sap/html5-app-deployer consumer application should be bound to a single html5-apps-repo service instance of the app-host service plan. \nWhen the @sap/html5-app-deployer consumer application is started, the @sap/html5-app-deployer module creates a zip archive for each folder in the “resources” folder - if it is not zipped already - and triggers the upload of all zip archives to the HTML5 application repository via multi-part request.\n\n## Deploying HTML5 Application Deployer App\nTo deploy an sap/html5-app-deployer consumer application in the Cloud Foundry environment you can choose one of the following procedures: \n\n### Deploying HTML5 Application Deployer App Using cf push\n\n#### 1. Create a manifest.yaml file in the following format:\n```\napplications:\n\n- name: myAppsDeployer\n no-route: true\n memory: 128M\n services:\n - myApps-app-host\n```\n\n#### 2. Create an html5-apps-repo service instance of the app-host plan using CF CLI\n```\ncf create-service html5-apps-repo app-host myApps-app-host\n```\n\n#### 3. Push to CF\n```\ncf push -f manifest.yaml\n```\n#### 4. Stop sap/html5-app-deployer consumer application\nAfter @sap/html5-app-deployer consumer application has uploaded the content successfully, stop the application to avoid using up CF container resources.\n\n```\ncf stop myAppsDeployer\n```\n\n### Deploying HTML5 Application Deployer App using cf deploy\nTo use cf deploy the installation of the deploy plugin is required, see [deploy plugin documentation](https://github.com/SAP/cf-mta-plugin/blob/master/README.md)\nIn addition, create an *.mtar archive using WebIDE or MTA Build Tool.\n\n#### 1. Create an mtad.yaml file.\nThe MTA project should have an mtad.yaml file in the following format:\n```\nID: myApps.deployer //MTA ID \n_schema-version: '2.0'\nversion: 0.0.3\n \nmodules:\n - name: myAppsDeployer\n type: com.sap.html5.application-content\n path: deployer/\n requires:\n - name: myApps-app-host\n \n \nresources:\n - name: myApps-app-host //Resource name\n type: org.cloudfoundry.managed-service\n parameters:\n service: html5-apps-repo //Service name\n service-plan: app-host //Service plan\n service-name: myApps-app-host //Service instance name\n```\n#### 2. Generate *.mtar file.\nUse the WebIDE build or the MTA Build Tool to generate a valid myAppDeployer.mtar file.\n\n#### 3. Deploy *.mtar file.\n```\ncf deploy myAppsDeployer.mtar\n```\nAfter deploying the *.mtar file, an application called myAppsDeployer (stopped) is shown in cf apps.\n\n## Undeploy HTML5 Application Deployer Apps\nWhen you undeploy the HTML5 application deployer app using MTA ID, the related HTML5 application repository content should be deleted too.\n\n### Delete HTML5 Application Deployer App Using cf delete\nIf you have used the cf push command to deploy the app, delete the HTML5 application deployer app manually:\n\n#### 1. Unbind html5-apps-repo app-host service instance.\nFor example:\n```\ncf unbind-service myAppsDeployer myApps-app-host\n```\n\n#### 2. Delete html5-apps-repo app-host service instance\nThis step deletes the HTML5 application respository content.\nFor example\n```\ncf delete-service myApps-app-host\n```\nThis step deletes the HTML5 application repository content.\n\n#### 3. Delete the HTML5 application deployer app.\nFor example:\n```\ncf delete myAppsDeployer\n```\n\n### Undeploy HTML5 Application Deployer App Using cf undeploy\nWhen you undeploy the HTML5 application deployer app, the HTML5 application deployer app is deleted and you can - in the same step - delete the app-host service instance of the html5-apps-repo. To delete the app-host service instance of the html5-apps-repo, the --delete-service parameter should be passed. \nNote that the undeploy requires the mta id, which can be obtained by calling cf mtas or from the mtad.yaml ID.\n\n#### 1. Undeploy HTML5 Application Deployer App and delete the service instance\nFor example:\n```\ncf undeploy myApps.deployer --delete-services\n```\n\n## Redeploy HTML5 Application Deployer App\nAfter making changes to the static content files of HTML5 applications, the new content can be redeployed to the HTML5 application repository. \nAll content referenced by the app-host service instance id is replaced by the new content. \n\n\n","readmeFilename":"README.md","scripts":{"ipscan":"node ./node_modules/whitesource/bin/whitesource run","lint":"eslint -c .eslintrc -f stylish lib/ index.js","prepareRelease":"npm prune --production","removeTests":"rm -rf test && rm -f .travis.yml && rm -f .eslintrc && rm -f .gitignore && rm -f whitesource.config.json && rm -rf coverage","start":"node index.js","test":"node --throw-deprecation node_modules/istanbul/lib/cli.js cover node_modules/mocha/bin/_mocha test -- --recursive --check-leaks"},"version":"2.0.1","warnings":[{"code":"ENOTSUP","required":{"node":"6.0.0"},"pkgid":"@sap/html5-app-deployer@2.0.1"},{"code":"ENOTSUP","required":{"node":"6.0.0"},"pkgid":"@sap/html5-app-deployer@2.0.1"}],"license":"SEE LICENSE IN developer-license-3.1.txt"}
{"bundleDependencies":false,"dependencies":{"archiver":"1.3.0","async":"2.6.0","cf-nodejs-logging-support":"2.1.0","file-type":"7.6.0","request":"2.88.0"},"deprecated":false,"description":"HTML5 application deployer","devDependencies":{"chai":"3.5.0","connect":"3.6.2","eslint":"3.2.2","express":"4.16.2","gulp":"^3.9.1","gulp-eslint":"^4.0.0","gulp-mocha":"^4.3.1","istanbul":"0.4.4","mocha":"3.0.2","multer":"1.3.0","sinon":"4.2.2","sonarqube-scanner":"^2.1.2","test-console":"1.1.0","whitesource":"18.10.2-1"},"engines":{"node":"^6.0.0 || ^8.0.0 || ^10.0.0 || ^12.0.0"},"main":"index.js","name":"@sap/html5-app-deployer","scripts":{"ipscan":"node ./node_modules/whitesource/bin/whitesource run","lint":"eslint -c .eslintrc -f stylish lib/ index.js","prepareRelease":"npm prune --production","removeTests":"rm -rf test && rm -f .travis.yml && rm -f .eslintrc && rm -f .gitignore && rm -f whitesource.config.json && rm -rf coverage","sonar":"gulp sonarqube","start":"node index.js","test":"node node_modules/istanbul/lib/cli.js cover node_modules/mocha/bin/_mocha test -- --recursive --check-leaks"},"version":"2.1.0","license":"SEE LICENSE IN developer-license-3.1.txt"}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet