@sap-ux/ui5-config
Advanced tools
Comparing version 0.21.1 to 0.22.0
@@ -20,3 +20,3 @@ import type { FioriToolsProxyConfigBackend, CustomMiddleware, FioriAppReloadConfig, FioriToolsProxyConfig, MockserverConfig, FioriToolsProxyConfigUI5 } from './types'; | ||
}; | ||
export declare const getMockServerMiddlewareConfig: (path?: string) => CustomMiddleware<MockserverConfig>; | ||
export declare const getMockServerMiddlewareConfig: (path?: string, annotationsConfig?: MockserverConfig['annotations']) => CustomMiddleware<MockserverConfig>; | ||
//# sourceMappingURL=middlewares.d.ts.map |
@@ -65,3 +65,3 @@ "use strict"; | ||
exports.getFioriToolsProxyMiddlewareConfig = getFioriToolsProxyMiddlewareConfig; | ||
const getMockServerMiddlewareConfig = (path) => { | ||
const getMockServerMiddlewareConfig = (path, annotationsConfig = []) => { | ||
path = path === null || path === void 0 ? void 0 : path.replace(/\/$/, ''); // Mockserver is sensitive to trailing '/' | ||
@@ -81,3 +81,3 @@ return { | ||
], | ||
annotations: [] | ||
annotations: annotationsConfig | ||
} | ||
@@ -84,0 +84,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
import type { BspApp, AbapTarget, Configuration, CustomMiddleware, CustomTask, FioriToolsProxyConfig, FioriToolsProxyConfigBackend, FioriToolsProxyConfigUI5, Ui5Document, Adp } from './types'; | ||
import type { BspApp, AbapTarget, Configuration, CustomMiddleware, CustomTask, FioriToolsProxyConfig, FioriToolsProxyConfigBackend, FioriToolsProxyConfigUI5, Ui5Document, Adp, MockserverConfig } from './types'; | ||
import type { NodeComment } from '@sap-ux/yaml'; | ||
@@ -130,6 +130,7 @@ /** | ||
* @param path option path that is to be mocked | ||
* @param annotationsConfig optional annotations config that is to be mocked | ||
* @returns {UI5Config} the UI5Config instance | ||
* @memberof UI5Config | ||
*/ | ||
addMockServerMiddleware(path?: string): UI5Config; | ||
addMockServerMiddleware(path?: string, annotationsConfig?: MockserverConfig['annotations']): this; | ||
/** | ||
@@ -136,0 +137,0 @@ * Adds the ABAP deployment task to the config. |
@@ -243,9 +243,10 @@ "use strict"; | ||
* @param path option path that is to be mocked | ||
* @param annotationsConfig optional annotations config that is to be mocked | ||
* @returns {UI5Config} the UI5Config instance | ||
* @memberof UI5Config | ||
*/ | ||
addMockServerMiddleware(path) { | ||
addMockServerMiddleware(path, annotationsConfig) { | ||
this.document.appendTo({ | ||
path: 'server.customMiddleware', | ||
value: (0, middlewares_1.getMockServerMiddlewareConfig)(path) | ||
value: (0, middlewares_1.getMockServerMiddlewareConfig)(path, annotationsConfig) | ||
}); | ||
@@ -252,0 +253,0 @@ return this; |
@@ -12,3 +12,3 @@ { | ||
}, | ||
"version": "0.21.1", | ||
"version": "0.22.0", | ||
"license": "Apache-2.0", | ||
@@ -15,0 +15,0 @@ "main": "dist/index.js", |
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
53742
1017