Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sap-ux/ui5-config

Package Overview
Dependencies
Maintainers
3
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap-ux/ui5-config - npm Package Compare versions

Comparing version 0.22.0 to 0.22.1

dist/constants.d.ts

2

dist/index.d.ts
export { UI5Config } from './ui5config';
export { Configuration, CustomTask, CustomMiddleware, FioriAppReloadConfig, FioriToolsProxyConfig, FioriToolsProxyConfigBackend, FioriToolsProxyConfigUI5, FioriToolsServeStaticPath, FioriToolsServeStaticConfig, Adp, BspApp, AbapTarget, AbapDeployConfig, UI5ProxyConfig, UI5ProxyConfigTarget } from './types';
export { Configuration, CustomTask, CustomMiddleware, FioriAppReloadConfig, FioriToolsProxyConfig, FioriToolsProxyConfigBackend, FioriToolsProxyConfigUI5, FioriToolsServeStaticPath, FioriToolsServeStaticConfig, ServeStaticPath, Adp, BspApp, AbapTarget, AbapDeployConfig, UI5ProxyConfig, UI5ProxyConfigTarget } from './types';
export { UI5_DEFAULT } from './defaults';

@@ -4,0 +4,0 @@ export { mergeObjects, getEsmTypesVersion, getTypesVersion, getTypesPackage } from './utils';

@@ -33,2 +33,7 @@ export * from './ui5yaml';

}
export interface ServeStaticPath {
path: string;
src: string;
fallthrough: boolean;
}
//# sourceMappingURL=index.d.ts.map

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

import type { BspApp, AbapTarget, Configuration, CustomMiddleware, CustomTask, FioriToolsProxyConfig, FioriToolsProxyConfigBackend, FioriToolsProxyConfigUI5, Ui5Document, Adp, MockserverConfig } from './types';
import type { BspApp, AbapTarget, Configuration, CustomMiddleware, CustomTask, FioriToolsProxyConfig, FioriToolsProxyConfigBackend, FioriToolsProxyConfigUI5, Ui5Document, Adp, MockserverConfig, ServeStaticPath } from './types';
import type { NodeComment } from '@sap-ux/yaml';

@@ -196,2 +196,17 @@ /**

/**
* Returns the serve static config.
*
* @param addFioriToolProxy - if true, `fiori-tools-proxy` config is added, otherwise a `compression` config will be added
* @param paths - serve static paths for the reuse libraries
* @returns the serve static middleware config
*/
private getServeStaticConfig;
/**
* Adds or updates the serve static middleware in the config.
*
* @param serveStaticPaths serve static paths for the reuse libraries
* @returns {UI5Config} the UI5Config instance
*/
addServeStaticConfig(serveStaticPaths: ServeStaticPath[]): this;
/**
* Returns a string representation of the config.

@@ -198,0 +213,0 @@ *

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

const middlewares_1 = require("./middlewares");
const constants_1 = require("./constants");
/**

@@ -217,3 +218,3 @@ * Represents a UI5 config file in yaml format (ui5(-*).yaml) with utility functions to manipulate the yaml document.

const middlewareList = this.document.getSequence({ path: 'server.customMiddleware' });
const proxyMiddleware = this.document.findItem(middlewareList, (item) => item.name === 'fiori-tools-proxy');
const proxyMiddleware = this.document.findItem(middlewareList, (item) => item.name === constants_1.fioriToolsProxy);
if (!proxyMiddleware) {

@@ -234,3 +235,3 @@ throw new Error('Could not find fiori-tools-proxy');

const middlewareList = this.document.getSequence({ path: 'server.customMiddleware' });
const proxyMiddleware = this.document.findItem(middlewareList, (item) => item.name === 'fiori-tools-proxy');
const proxyMiddleware = this.document.findItem(middlewareList, (item) => item.name === constants_1.fioriToolsProxy);
if (!proxyMiddleware) {

@@ -379,2 +380,52 @@ throw new Error('Could not find fiori-tools-proxy');

/**
* Returns the serve static config.
*
* @param addFioriToolProxy - if true, `fiori-tools-proxy` config is added, otherwise a `compression` config will be added
* @param paths - serve static paths for the reuse libraries
* @returns the serve static middleware config
*/
getServeStaticConfig(addFioriToolProxy, paths) {
return addFioriToolProxy
? {
name: constants_1.serveStatic,
beforeMiddleware: constants_1.fioriToolsProxy,
configuration: {
paths: paths
}
}
: {
name: constants_1.serveStatic,
afterMiddleware: 'compression',
configuration: {
paths: paths
}
};
}
/**
* Adds or updates the serve static middleware in the config.
*
* @param serveStaticPaths serve static paths for the reuse libraries
* @returns {UI5Config} the UI5Config instance
*/
addServeStaticConfig(serveStaticPaths) {
const serveStaticConfig = this.findCustomMiddleware(constants_1.serveStatic);
const fioriToolsProxyConfig = this.findCustomMiddleware(constants_1.fioriToolsProxy);
if (serveStaticConfig) {
if (serveStaticConfig.afterMiddleware === 'compression' && fioriToolsProxyConfig) {
this.updateCustomMiddleware({
name: constants_1.serveStatic,
beforeMiddleware: constants_1.fioriToolsProxy,
configuration: {
paths: [...serveStaticConfig.configuration.paths, ...serveStaticPaths]
}
});
}
}
else {
const serveStaticConfig = this.getServeStaticConfig(!!fioriToolsProxyConfig, serveStaticPaths);
this.addCustomMiddleware([serveStaticConfig]);
}
return this;
}
/**
* Returns a string representation of the config.

@@ -381,0 +432,0 @@ *

@@ -12,3 +12,3 @@ {

},
"version": "0.22.0",
"version": "0.22.1",
"license": "Apache-2.0",

@@ -15,0 +15,0 @@ "main": "dist/index.js",

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