@sap-ux/adp-tooling 0.13.34 → 0.13.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ import type { NextFunction, Request, Response, Router } from 'express';
4
4
  import type { Logger, ToolsLogger } from '@sap-ux/logger';
5
5
  import type { UI5FlexLayer } from '@sap-ux/project-access';
6
6
  import type { MergedAppDescriptor } from '@sap-ux/axios-extension';
7
- import type { AdpPreviewConfig, CommonChangeProperties, DescriptorVariant, OperationType } from '../types';
7
+ import type { AdpPreviewConfig, CommonChangeProperties, DescriptorVariant, OperationType, CommonAdditionalChangeInfoProperties } from '../types';
8
8
  import type { Editor } from 'mem-fs-editor';
9
9
  declare global {
10
10
  var __SAP_UX_MANIFEST_SYNC_REQUIRED__: boolean | undefined;
@@ -112,8 +112,9 @@ export declare class AdpPreview {
112
112
  * @param {CommonChangeProperties} change - An object containing properties common to all change types.
113
113
  * @param {Editor} fs - An instance of an editor interface for file system operations.
114
114
  * @param {Logger} logger - An instance of a logging interface for message logging.
115
+ * @param {CommonAdditionalChangeInfoProperties} [additionalChangeInfo] - An optional object containing extended change properties.
115
116
  * @returns {Promise<void>} A promise that resolves when the change request has been processed.
116
117
  */
117
- onChangeRequest(type: OperationType, change: CommonChangeProperties, fs: Editor, logger: Logger): Promise<void>;
118
+ onChangeRequest(type: OperationType, change: CommonChangeProperties, fs: Editor, logger: Logger, additionalChangeInfo?: CommonAdditionalChangeInfoProperties): Promise<void>;
118
119
  }
119
120
  //# sourceMappingURL=adp-preview.d.ts.map
@@ -194,9 +194,10 @@ class AdpPreview {
194
194
  * @param {CommonChangeProperties} change - An object containing properties common to all change types.
195
195
  * @param {Editor} fs - An instance of an editor interface for file system operations.
196
196
  * @param {Logger} logger - An instance of a logging interface for message logging.
197
+ * @param {CommonAdditionalChangeInfoProperties} [additionalChangeInfo] - An optional object containing extended change properties.
197
198
  * @returns {Promise<void>} A promise that resolves when the change request has been processed.
198
199
  */
199
- async onChangeRequest(type, change, fs, logger) {
200
+ async onChangeRequest(type, change, fs, logger, additionalChangeInfo) {
200
201
  switch (type) {
201
202
  case 'read':
202
203
  if (change_handler_1.moduleNameContentMap[change.changeType] && !change.moduleName) {
@@ -205,7 +206,7 @@ class AdpPreview {
205
206
  break;
206
207
  case 'write':
207
208
  if ((0, change_handler_1.isAddXMLChange)(change)) {
208
- (0, change_handler_1.addXmlFragment)(this.util.getProject().getSourcePath(), change, fs, logger);
209
+ (0, change_handler_1.addXmlFragment)(this.util.getProject().getSourcePath(), change, fs, logger, additionalChangeInfo);
209
210
  }
210
211
  if ((0, change_handler_1.isAddAnnotationChange)(change)) {
211
212
  await (0, change_handler_1.addAnnotationFile)(this.util.getProject().getSourcePath(), this.util.getProject().getRootPath(), change, fs, logger);
@@ -1,5 +1,5 @@
1
1
  import type { Editor } from 'mem-fs-editor';
2
- import type { AddXMLChange, CommonChangeProperties, AnnotationFileChange } from '../types';
2
+ import type { AddXMLChange, CommonChangeProperties, AnnotationFileChange, CommonAdditionalChangeInfoProperties } from '../types';
3
3
  import type { Logger } from '@sap-ux/logger';
4
4
  /**
5
5
  * A mapping object that defines how to extract change content data from changes based on their type.
@@ -44,8 +44,9 @@ export declare function isAddAnnotationChange(change: CommonChangeProperties): c
44
44
  * @param {AddXMLChange} change - The change data, including the fragment path.
45
45
  * @param {Editor} fs - The mem-fs-editor instance.
46
46
  * @param {Logger} logger - The logging instance.
47
+ * @param {CommonAdditionalChangeInfoProperties} additionalChangeInfo - Optional extended change properties.
47
48
  */
48
- export declare function addXmlFragment(basePath: string, change: AddXMLChange, fs: Editor, logger: Logger): void;
49
+ export declare function addXmlFragment(basePath: string, change: AddXMLChange, fs: Editor, logger: Logger, additionalChangeInfo?: CommonAdditionalChangeInfoProperties): void;
49
50
  /**
50
51
  * Asynchronously adds an XML fragment to the project if it doesn't already exist.
51
52
  *
@@ -200,11 +200,12 @@ function isAddAnnotationChange(change) {
200
200
  * @param {AddXMLChange} change - The change data, including the fragment path.
201
201
  * @param {Editor} fs - The mem-fs-editor instance.
202
202
  * @param {Logger} logger - The logging instance.
203
+ * @param {CommonAdditionalChangeInfoProperties} additionalChangeInfo - Optional extended change properties.
203
204
  */
204
- function addXmlFragment(basePath, change, fs, logger) {
205
+ function addXmlFragment(basePath, change, fs, logger, additionalChangeInfo) {
205
206
  const { fragmentPath } = change.content;
206
207
  const fullPath = (0, path_1.join)(basePath, project_access_1.DirName.Changes, fragmentPath);
207
- const templateConfig = fragmentTemplateDefinitions[change.content?.templateName ?? ''];
208
+ const templateConfig = fragmentTemplateDefinitions[additionalChangeInfo?.templateName ?? ''];
208
209
  try {
209
210
  if (templateConfig) {
210
211
  const fragmentTemplatePath = (0, path_1.join)(__dirname, '../../templates/rta', templateConfig.path);
package/dist/types.d.ts CHANGED
@@ -196,6 +196,9 @@ export interface CommonChangeProperties {
196
196
  fileName: string;
197
197
  texts: Record<string, unknown>;
198
198
  }
199
+ export interface CommonAdditionalChangeInfoProperties {
200
+ templateName?: string;
201
+ }
199
202
  export interface ManifestChangeProperties {
200
203
  fileName: string;
201
204
  fileType: string;
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aadp-tooling"
11
11
  },
12
- "version": "0.13.34",
12
+ "version": "0.13.35",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",