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.24.1 to 0.25.0

13

dist/middlewares.d.ts

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

import type { FioriToolsProxyConfigBackend, CustomMiddleware, FioriAppReloadConfig, FioriToolsProxyConfig, MockserverConfig, FioriToolsProxyConfigUI5 } from './types';
import type { FioriToolsProxyConfigBackend, CustomMiddleware, FioriAppReloadConfig, FioriToolsProxyConfig, MockserverConfig, FioriToolsProxyConfigUI5, FioriPreviewConfig } from './types';
import type { NodeComment } from '@sap-ux/yaml';

@@ -10,2 +10,10 @@ /**

/**
* Generates the configuration for a Fiori preview middleware.
*
* @param {string} appId - The ID of the application for which the preview middleware is being configured.
* @param {string} ui5Theme - The theme to be used for the application.
* @returns {CustomMiddleware<FioriPreviewConfig>} The configuration object for the middleware.
*/
export declare function getPreviewMiddlewareConfig(appId: string, ui5Theme: string): CustomMiddleware<FioriPreviewConfig>;
/**
* Returns default comments for the given backend configuration values.

@@ -24,5 +32,6 @@ *

* @param afterMiddleware middleware after which fiori-tools-proxy middleware will be started
* @param ignoreCertError ignore certificate errors
* @returns {{config, comments}} configuration and comments
*/
export declare function getFioriToolsProxyMiddlewareConfig(backends?: FioriToolsProxyConfigBackend[], ui5?: Partial<FioriToolsProxyConfigUI5>, afterMiddleware?: string): {
export declare function getFioriToolsProxyMiddlewareConfig(backends?: FioriToolsProxyConfigBackend[], ui5?: Partial<FioriToolsProxyConfigUI5>, afterMiddleware?: string, ignoreCertError?: boolean): {
config: CustomMiddleware<FioriToolsProxyConfig>;

@@ -29,0 +38,0 @@ comments: NodeComment<CustomMiddleware<FioriToolsProxyConfig>>[];

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMockServerMiddlewareConfig = exports.getFioriToolsProxyMiddlewareConfig = exports.getBackendComments = exports.getAppReloadMiddlewareConfig = void 0;
exports.getMockServerMiddlewareConfig = exports.getFioriToolsProxyMiddlewareConfig = exports.getBackendComments = exports.getPreviewMiddlewareConfig = exports.getAppReloadMiddlewareConfig = void 0;
/**

@@ -22,2 +22,20 @@ * Get the configuration for the AppReload middleware.

/**
* Generates the configuration for a Fiori preview middleware.
*
* @param {string} appId - The ID of the application for which the preview middleware is being configured.
* @param {string} ui5Theme - The theme to be used for the application.
* @returns {CustomMiddleware<FioriPreviewConfig>} The configuration object for the middleware.
*/
function getPreviewMiddlewareConfig(appId, ui5Theme) {
return {
name: 'fiori-tools-preview',
afterMiddleware: 'fiori-tools-appreload',
configuration: {
component: appId,
ui5Theme: ui5Theme
}
};
}
exports.getPreviewMiddlewareConfig = getPreviewMiddlewareConfig;
/**
* Returns default comments for the given backend configuration values.

@@ -47,5 +65,6 @@ *

* @param afterMiddleware middleware after which fiori-tools-proxy middleware will be started
* @param ignoreCertError ignore certificate errors
* @returns {{config, comments}} configuration and comments
*/
function getFioriToolsProxyMiddlewareConfig(backends, ui5, afterMiddleware = 'compression') {
function getFioriToolsProxyMiddlewareConfig(backends, ui5, afterMiddleware = 'compression', ignoreCertError = false) {
const fioriToolsProxy = {

@@ -55,3 +74,3 @@ name: 'fiori-tools-proxy',

configuration: {
ignoreCertError: false
ignoreCertError: ignoreCertError
}

@@ -58,0 +77,0 @@ };

@@ -36,2 +36,16 @@ import type { AuthenticationType } from '@sap-ux/store';

}
/**
* Interface representing the configuration for Fiori Preview.
*/
export interface FioriPreviewConfig {
/**
* The name of the component to be previewed.
*/
component: string;
/**
* The theme to be used for the SAP Fiori preview.
* This defines the UI5 theme, such as "sap_fiori_3" or other available themes.
*/
ui5Theme: string;
}
export interface ServeStaticPath {

@@ -38,0 +52,0 @@ path: string;

@@ -110,2 +110,11 @@ import type { BspApp, AbapTarget, Configuration, CustomMiddleware, CustomTask, FioriToolsProxyConfig, FioriToolsProxyConfigBackend, FioriToolsProxyConfigUI5, Ui5Document, Adp, MockserverConfig, ServeStaticPath } from './types';

/**
* Adds the Fiori Tools preview middleware configuration to the UI5 server configuration.
* This middleware is used to preview the Fiori application with the specified UI5 theme.
*
* @param {string} appId - The ID of the application for which the preview middleware is configured.
* @param {string} ui5Theme - The UI5 theme to be used.
* @returns {UI5Config} The updated UI5 configuration object.
*/
addFioriToolsPreviewMiddleware(appId: string, ui5Theme: string): UI5Config;
/**
* Adds a instance of the Fiori tools proxy middleware to the config.

@@ -112,0 +121,0 @@ *

@@ -191,2 +191,17 @@ "use strict";

/**
* Adds the Fiori Tools preview middleware configuration to the UI5 server configuration.
* This middleware is used to preview the Fiori application with the specified UI5 theme.
*
* @param {string} appId - The ID of the application for which the preview middleware is configured.
* @param {string} ui5Theme - The UI5 theme to be used.
* @returns {UI5Config} The updated UI5 configuration object.
*/
addFioriToolsPreviewMiddleware(appId, ui5Theme) {
this.document.appendTo({
path: 'server.customMiddleware',
value: (0, middlewares_1.getPreviewMiddlewareConfig)(appId, ui5Theme)
});
return this;
}
/**
* Adds a instance of the Fiori tools proxy middleware to the config.

@@ -200,3 +215,3 @@ *

addFioriToolsProxydMiddleware(proxyConfig, afterMiddleware) {
const { config, comments } = (0, middlewares_1.getFioriToolsProxyMiddlewareConfig)(proxyConfig.backend, proxyConfig.ui5, afterMiddleware);
const { config, comments } = (0, middlewares_1.getFioriToolsProxyMiddlewareConfig)(proxyConfig.backend, proxyConfig.ui5, afterMiddleware, proxyConfig.ignoreCertError);
this.document.appendTo({

@@ -203,0 +218,0 @@ path: 'server.customMiddleware',

2

package.json

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

},
"version": "0.24.1",
"version": "0.25.0",
"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