@sap-ux/ui5-config
Advanced tools
Comparing version 0.22.8 to 0.22.9
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": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65306
3
1317
3
+ Added@sap-ux/yaml@0.15.1(transitive)
- Removed@sap-ux/store@0.5.0
- Removed@babel/runtime@7.26.0(transitive)
- Removed@colors/colors@1.6.0(transitive)
- Removed@dabh/diagnostics@2.0.3(transitive)
- Removed@sap-ux/logger@0.5.1(transitive)
- Removed@sap-ux/store@0.5.0(transitive)
- Removed@sap-ux/yaml@0.15.0(transitive)
- Removed@types/triple-beam@1.3.5(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedasync@3.2.6(transitive)
- Removedbase64-js@1.5.1(transitive)
- Removedbl@4.1.0(transitive)
- Removedbuffer@5.7.1(transitive)
- Removedchalk@4.1.2(transitive)
- Removedchownr@1.1.4(transitive)
- Removedcolor@3.2.1(transitive)
- Removedcolor-convert@1.9.32.0.1(transitive)
- Removedcolor-name@1.1.31.1.4(transitive)
- Removedcolor-string@1.9.1(transitive)
- Removedcolorspace@1.1.4(transitive)
- Removeddecompress-response@6.0.0(transitive)
- Removeddeep-extend@0.6.0(transitive)
- Removeddetect-libc@2.0.3(transitive)
- Removedenabled@2.0.0(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removedexpand-template@2.0.3(transitive)
- Removedfecha@4.2.3(transitive)
- Removedfn.name@1.1.0(transitive)
- Removedfs-constants@1.0.0(transitive)
- Removedgithub-from-package@0.0.0(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedi18next@20.6.1(transitive)
- Removedi18next-fs-backend@1.2.0(transitive)
- Removedieee754@1.2.1(transitive)
- Removedinherits@2.0.4(transitive)
- Removedini@1.3.8(transitive)
- Removedis-arrayish@0.3.2(transitive)
- Removedis-stream@2.0.1(transitive)
- Removedkeytar@7.9.0(transitive)
- Removedkuler@2.0.0(transitive)
- Removedlogform@2.7.0(transitive)
- Removedmimic-response@3.1.0(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp-classic@0.5.3(transitive)
- Removedms@2.1.3(transitive)
- Removednapi-build-utils@1.0.2(transitive)
- Removednode-abi@3.71.0(transitive)
- Removednode-addon-api@4.3.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedone-time@1.0.0(transitive)
- Removedpluralize@8.0.0(transitive)
- Removedprebuild-install@7.1.2(transitive)
- Removedpump@3.0.2(transitive)
- Removedrc@1.2.8(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedreflect-metadata@0.1.13(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsafe-stable-stringify@2.5.0(transitive)
- Removedsimple-concat@1.0.1(transitive)
- Removedsimple-get@4.0.1(transitive)
- Removedsimple-swizzle@0.2.2(transitive)
- Removedstack-trace@0.0.10(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedstrip-json-comments@2.0.1(transitive)
- Removedsupports-color@7.2.0(transitive)
- Removedtar-fs@2.1.1(transitive)
- Removedtar-stream@2.2.0(transitive)
- Removedtext-hex@1.0.0(transitive)
- Removedtriple-beam@1.4.1(transitive)
- Removedtunnel-agent@0.6.0(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedwinston@3.11.0(transitive)
- Removedwinston-transport@4.7.0(transitive)
- Removedwrappy@1.0.2(transitive)
Updated@sap-ux/yaml@0.15.1