@sap-ux/fe-mockserver-core
Advanced tools
Comparing version 1.4.6 to 1.4.7
@@ -39,2 +39,3 @@ /// <reference types="node" /> | ||
watch: boolean; | ||
i18nPath: string[]; | ||
metadataProcessor?: MetadataProcessorConfig; | ||
@@ -54,2 +55,3 @@ } | ||
options?: any; | ||
i18nPath?: string[]; | ||
}; | ||
@@ -88,2 +90,3 @@ export interface BaseServerConfig { | ||
mockdataPath: string; | ||
i18nPath?: string[]; | ||
generateMockData?: boolean; | ||
@@ -90,0 +93,0 @@ forceNullableValuesToNull?: boolean; |
@@ -10,2 +10,3 @@ /// <reference path="../types.d.ts" /> | ||
loadMetadata(filePath: string): Promise<string>; | ||
addI18nPath(i18Path?: string[]): void; | ||
} | ||
@@ -12,0 +13,0 @@ export * from './api'; |
@@ -43,6 +43,6 @@ "use strict"; | ||
async initialize() { | ||
var _a, _b; | ||
var _a, _b, _c; | ||
const FileLoaderClass = this.configuration.fileLoader || (await Promise.resolve().then(() => __importStar(require('./plugins/fileSystemLoader')))).default; | ||
this.fileLoader = new FileLoaderClass(); | ||
this.metadataProvider = await (0, pluginsManager_1.getMetadataProcessor)(this.fileLoader, (_a = this.configuration.metadataProcessor) === null || _a === void 0 ? void 0 : _a.name, (_b = this.configuration.metadataProcessor) === null || _b === void 0 ? void 0 : _b.options); | ||
this.metadataProvider = await (0, pluginsManager_1.getMetadataProcessor)(this.fileLoader, (_a = this.configuration.metadataProcessor) === null || _a === void 0 ? void 0 : _a.name, (_b = this.configuration.metadataProcessor) === null || _b === void 0 ? void 0 : _b.options, (_c = this.configuration.metadataProcessor) === null || _c === void 0 ? void 0 : _c.i18nPath); | ||
await (0, middleware_1.createMockMiddleware)(this.configuration, this.mainRouter, this.fileLoader, this.metadataProvider); | ||
@@ -49,0 +49,0 @@ } |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getLogger = void 0; | ||
const logger_1 = require("@ui5/logger"); | ||
const node_process_1 = __importDefault(require("node:process")); | ||
class Logger { | ||
constructor(loggerName, debug) { | ||
this.loggerName = loggerName; | ||
this.debug = debug; | ||
this.logger = (0, logger_1.getLogger)(loggerName); | ||
} | ||
error(message) { | ||
this.logger.error(message); | ||
node_process_1.default.stderr.write('error ' + this.loggerName + ' :: ' + message.toString() + '\n'); | ||
} | ||
info(message) { | ||
if (this.debug) { | ||
this.logger.info(message); | ||
node_process_1.default.stdout.write('info ' + this.loggerName + ' :: ' + message + '\n'); | ||
} | ||
@@ -17,0 +20,0 @@ } |
@@ -111,4 +111,7 @@ "use strict"; | ||
log.info(`Loading service-specific metadata processor for ${mockService.urlPath}: ${JSON.stringify(mockService.metadataProcessor)}`); | ||
processor = await (0, pluginsManager_1.getMetadataProcessor)(fileLoader, mockService.metadataProcessor.name, mockService.metadataProcessor.options); | ||
processor = await (0, pluginsManager_1.getMetadataProcessor)(fileLoader, mockService.metadataProcessor.name, mockService.metadataProcessor.options, mockServiceIn.i18nPath); | ||
} | ||
else { | ||
processor.addI18nPath(mockServiceIn.i18nPath); | ||
} | ||
let metadata = await loadMetadata(mockService, processor); | ||
@@ -115,0 +118,0 @@ const dataAccess = new dataAccess_1.DataAccess(mockService, metadata, fileLoader, newConfig.logger); |
@@ -6,3 +6,4 @@ import type { IFileLoader, IMetadataProcessor } from '../index'; | ||
loadMetadata(filePath: string): Promise<string>; | ||
addI18nPath(_i18Path?: string[]): void; | ||
} | ||
//# sourceMappingURL=metadataProvider.d.ts.map |
@@ -10,4 +10,7 @@ "use strict"; | ||
} | ||
addI18nPath(_i18Path) { | ||
// do nothing | ||
} | ||
} | ||
exports.default = MetadataProvider; | ||
//# sourceMappingURL=metadataProvider.js.map |
@@ -8,5 +8,6 @@ import type { IFileLoader, IMetadataProcessor } from './index'; | ||
* @param options The options for the metadata processor | ||
* @param i18nPath The path to the i18n files | ||
* @returns The metadata processor | ||
*/ | ||
export declare function getMetadataProcessor(fileLoader: IFileLoader, name: string | undefined, options?: unknown): Promise<IMetadataProcessor>; | ||
export declare function getMetadataProcessor(fileLoader: IFileLoader, name: string | undefined, options?: unknown, i18nPath?: string[]): Promise<IMetadataProcessor>; | ||
//# sourceMappingURL=pluginsManager.d.ts.map |
@@ -34,9 +34,10 @@ "use strict"; | ||
* @param options The options for the metadata processor | ||
* @param i18nPath The path to the i18n files | ||
* @returns The metadata processor | ||
*/ | ||
async function getMetadataProcessor(fileLoader, name, options) { | ||
async function getMetadataProcessor(fileLoader, name, options, i18nPath) { | ||
const MetadataProcessorClass = (await fileLoader.loadJS(name || path.resolve(__dirname, './plugins/metadataProvider'))).default; | ||
return new MetadataProcessorClass(fileLoader, options); | ||
return new MetadataProcessorClass(fileLoader, options, i18nPath); | ||
} | ||
exports.getMetadataProcessor = getMetadataProcessor; | ||
//# sourceMappingURL=pluginsManager.js.map |
{ | ||
"name": "@sap-ux/fe-mockserver-core", | ||
"version": "1.4.6", | ||
"version": "1.4.7", | ||
"description": "SAP Fiori OData - Fiori elements mock server core", | ||
@@ -17,3 +17,2 @@ "repository": { | ||
"dependencies": { | ||
"@ui5/logger": "4.0.1", | ||
"balanced-match": "1.0.2", | ||
@@ -34,2 +33,3 @@ "body-parser": "1.20.3", | ||
"devDependencies": { | ||
"@ui5/logger": "^4.0.1", | ||
"@babel/preset-env": "^7.26.0", | ||
@@ -47,4 +47,4 @@ "@types/body-parser": "1.19.5", | ||
"finalhandler": "1.2.0", | ||
"@sap-ux/fe-mockserver-plugin-cds": "1.2.4", | ||
"@sap-ux/vocabularies-types": "0.11.7" | ||
"@sap-ux/vocabularies-types": "0.11.7", | ||
"@sap-ux/fe-mockserver-plugin-cds": "1.2.5" | ||
}, | ||
@@ -51,0 +51,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
657163
13
7647
15
- Removed@ui5/logger@4.0.1
- Removed@ui5/logger@4.0.1(transitive)
- Removedansi-regex@5.0.1(transitive)
- Removedchalk@5.4.1(transitive)
- Removedcli-progress@3.12.0(transitive)
- Removedemoji-regex@8.0.0(transitive)
- Removedfigures@6.1.0(transitive)
- Removedis-fullwidth-code-point@3.0.0(transitive)
- Removedis-unicode-supported@2.1.0(transitive)
- Removedstring-width@4.2.3(transitive)
- Removedstrip-ansi@6.0.1(transitive)