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
0
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.8 to 0.22.9

2

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

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMockServerMiddlewareConfig = exports.getFioriToolsProxyMiddlewareConfig = exports.getBackendComments = exports.getAppReloadMiddlewareConfig = void 0;
const store_1 = require("@sap-ux/store");
/**

@@ -31,3 +30,3 @@ * Get the configuration for the AppReload middleware.

const comment = [];
if (backend.authenticationType === store_1.AuthenticationType.ReentranceTicket) {
if (backend.authenticationType === 'reentranceTicket') {
comment.push({

@@ -34,0 +33,0 @@ path: `configuration.backend.${index}.authenticationType`,

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

import type { AuthenticationType } from '@sap-ux/store';
export * from './ui5yaml';

@@ -18,2 +19,3 @@ export * from './middlewares';

scp?: boolean;
authenticationType?: AuthenticationType;
}

@@ -28,2 +30,3 @@ export interface DestinationAbapTarget {

ignoreCertError?: boolean;
index?: boolean;
}

@@ -30,0 +33,0 @@ export interface FioriAppReloadConfig {

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

import { AuthenticationType } from '@sap-ux/store';
import type { AuthenticationType } from '@sap-ux/store';
export interface UI5ProxyConfigTarget {

@@ -3,0 +3,0 @@ path: string | string[];

@@ -10,3 +10,3 @@ export interface CustomItem<C> {

}
export interface CustomTask<C = unknown> extends CustomItem<C> {
export interface CustomTask<C = unknown> extends Partial<CustomItem<C>> {
beforeTask?: string;

@@ -13,0 +13,0 @@ afterTask?: string;

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

/**
* Get the type in the yaml file.
*
* @returns {Ui5Document['type']} the type
* @memberof Ui5Document['type']
*/
getType(): Ui5Document['type'];
/**
* Set the type in the yaml file.

@@ -128,2 +135,8 @@ * See also https://sap.github.io/ui5-tooling/pages/Configuration/#general-configuration for reference.

/**
* Returns the backend configurations from the fiori-tools-proxy middleware.
*
* @returns {FioriToolsProxyConfigBackend[]} the backend configurations
*/
getBackendConfigsFromFioriToolsProxydMiddleware(): FioriToolsProxyConfigBackend[];
/**
* Adds a ui configuration to an existing fiori-tools-proxy middleware. If the config does not contain a fiori-tools-proxy middleware, an error is thrown.

@@ -151,6 +164,8 @@ *

* @param fioriTools if true use the middleware included in the @sap/ux-ui5-tooling module
* @param exclude optional list of files that are to be excluded from the deployment configuration
* @param index if true a standalone index.html is generated during deployment
* @returns this UI5Config instance
* @memberof UI5Config
*/
addAbapDeployTask(target: AbapTarget, app: BspApp | Adp, fioriTools?: boolean): this;
addAbapDeployTask(target: AbapTarget, app: BspApp | Adp, fioriTools?: boolean, exclude?: string[], index?: boolean): this;
/**

@@ -173,2 +188,21 @@ * Remove a middleware form the UI5 config.

/**
* Removes the entire config for the given key.
*
* @param key key of the config that is to be removed
* @returns {UI5Config} the UI5Config instance
*/
removeConfig(key: string): this;
/**
* Adds a comment to the ui5 config.
*
* @param root0 - the comment object
* @param root0.comment - the comment object's comment
* @param root0.location - the comment object's location
* @returns {UI5Config} the UI5Config instance
*/
addComment({ comment, location }: {
comment: string;
location?: 'beginning' | 'end';
}): this;
/**
* Find a custom item in the UI5 config.

@@ -175,0 +209,0 @@ *

@@ -81,2 +81,12 @@ "use strict";

/**
* Get the type in the yaml file.
*
* @returns {Ui5Document['type']} the type
* @memberof Ui5Document['type']
*/
getType() {
const type = this.document.getNode({ path: 'type' });
return type;
}
/**
* Set the type in the yaml file.

@@ -252,2 +262,22 @@ * See also https://sap.github.io/ui5-tooling/pages/Configuration/#general-configuration for reference.

/**
* Returns the backend configurations from the fiori-tools-proxy middleware.
*
* @returns {FioriToolsProxyConfigBackend[]} the backend configurations
*/
getBackendConfigsFromFioriToolsProxydMiddleware() {
let backendConfigs;
try {
const middlewareList = this.document.getSequence({ path: 'server.customMiddleware' });
const proxyMiddleware = this.document.findItem(middlewareList, (item) => item.name === constants_1.fioriToolsProxy);
const configuration = this.document.getMap({ start: proxyMiddleware, path: 'configuration' });
backendConfigs = this.document
.getSequence({ start: configuration, path: 'backend' })
.toJSON();
}
catch (e) {
return [];
}
return backendConfigs;
}
/**
* Adds a ui configuration to an existing fiori-tools-proxy middleware. If the config does not contain a fiori-tools-proxy middleware, an error is thrown.

@@ -289,6 +319,8 @@ *

* @param fioriTools if true use the middleware included in the @sap/ux-ui5-tooling module
* @param exclude optional list of files that are to be excluded from the deployment configuration
* @param index if true a standalone index.html is generated during deployment
* @returns this UI5Config instance
* @memberof UI5Config
*/
addAbapDeployTask(target, app, fioriTools = true) {
addAbapDeployTask(target, app, fioriTools = true, exclude, index = false) {
this.document.appendTo({

@@ -302,2 +334,6 @@ path: 'builder.resources.excludes',

});
const configuration = { target, app, exclude };
if (index) {
configuration['index'] = true;
}
this.document.appendTo({

@@ -308,3 +344,3 @@ path: 'builder.customTasks',

afterTask: 'generateCachebusterInfo',
configuration: { target, app }
configuration
}

@@ -343,2 +379,24 @@ });

/**
* Removes the entire config for the given key.
*
* @param key key of the config that is to be removed
* @returns {UI5Config} the UI5Config instance
*/
removeConfig(key) {
this.document.delete(key);
return this;
}
/**
* Adds a comment to the ui5 config.
*
* @param root0 - the comment object
* @param root0.comment - the comment object's comment
* @param root0.location - the comment object's location
* @returns {UI5Config} the UI5Config instance
*/
addComment({ comment, location = 'beginning' }) {
this.document.addDocumentComment({ comment, location });
return this;
}
/**
* Find a custom item in the UI5 config.

@@ -345,0 +403,0 @@ *

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

},
"version": "0.22.8",
"version": "0.22.9",
"license": "Apache-2.0",

@@ -25,8 +25,8 @@ "main": "dist/index.js",

"semver": "7.5.4",
"@sap-ux/store": "0.5.0",
"@sap-ux/yaml": "0.15.0"
"@sap-ux/yaml": "0.15.1"
},
"devDependencies": {
"@types/lodash": "4.14.202",
"@types/semver": "7.5.2"
"@types/semver": "7.5.2",
"@sap-ux/store": "0.6.0"
},

@@ -33,0 +33,0 @@ "engines": {

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