@sap-ux/repo-app-import-sub-generator 1.2.82 → 1.2.84

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.
@@ -121,10 +121,12 @@ export default class extends Generator {
121
121
  catch (error) {
122
122
  RepoAppDownloadLogger.logger?.error(t('error.writingPhase', { error: error instanceof Error ? error.message : String(error) }));
123
123
  const failEvent = this.downloadType === AppDownloadType.AbapRepository
124
- ? EventName.ABAP_REPO_DOWNLOAD_FAIL
125
- : EventName.ADT_QUICK_DEPLOY_DOWNLOAD_FAIL;
124
+ ? EventName.ABAP_REPO_APP_WRITING_FAILED
125
+ : EventName.ADT_QUICK_DEPLOY_APP_WRITING_FAILED;
126
+ // Fires when the writing phase throws — includes the caught error message for diagnosis.
126
127
  await sendTelemetry(failEvent, TelemetryHelper.createTelemetryData({
127
128
  appType: generatorName,
129
+ errorMessage: error instanceof Error ? error.message : String(error),
128
130
  ...this.options.telemetryData
129
131
  }) ?? {}).catch(() => {
130
132
  // telemetry errors are non-fatal
@@ -338,9 +340,10 @@ export default class extends Generator {
338
340
  try {
339
341
  this.appWizard.showInformation(downloadTypeConfig[this.downloadType].generatorSuccessMsg, MessageType.notification);
340
342
  await this._handlePostAppGeneration();
343
+ // Fires when the full generation pipeline completes without error.
341
344
  const successEvent = this.downloadType === AppDownloadType.AbapRepository
342
- ? EventName.ABAP_REPO_DOWNLOAD_SUCCESS
343
- : EventName.ADT_QUICK_DEPLOY_DOWNLOAD_SUCCESS;
345
+ ? EventName.ABAP_REPO_DOWNLOAD_COMPLETE
346
+ : EventName.ADT_QUICK_DEPLOY_COMPLETE;
344
347
  await sendTelemetry(successEvent, TelemetryHelper.createTelemetryData({
345
348
  appType: generatorName,
346
349
  ...this.options.telemetryData
@@ -2,11 +2,21 @@
2
2
  * Event names for telemetry for the generator when downloading an app from repository
3
3
  */
4
4
  export declare const EventName: {
5
+ /** Zip file successfully fetched from the ABAP repository during the prompting phase. */
5
6
  readonly ABAP_REPO_DOWNLOAD_SUCCESS: "ABAP_REPO_DOWNLOAD_SUCCESS";
7
+ /** Full ABAP repository app generation completed successfully - fired in end(). */
8
+ readonly ABAP_REPO_DOWNLOAD_COMPLETE: "ABAP_REPO_DOWNLOAD_COMPLETE";
9
+ /** Writing phase failed for an ABAP repository download (caught exception). */
10
+ readonly ABAP_REPO_APP_WRITING_FAILED: "ABAP_REPO_APP_WRITING_FAILED";
11
+ /** Server returned no content — legacy ABAP system without repository content. */
6
12
  readonly ABAP_REPO_DOWNLOAD_FAIL: "ABAP_REPO_DOWNLOAD_FAIL";
7
- readonly ABAP_REPO_DOWNLOAD_NO_FILES_RETURNED: "ABAP_REPO_DOWNLOAD_NO_FILES_RETURNED";
13
+ /** Zip file successfully fetched during ADT quick-deploy prompting phase. */
8
14
  readonly ADT_QUICK_DEPLOY_DOWNLOAD_SUCCESS: "ADT_QUICK_DEPLOY_DOWNLOAD_SUCCESS";
9
- readonly ADT_QUICK_DEPLOY_DOWNLOAD_FAIL: "ADT_QUICK_DEPLOY_DOWNLOAD_FAIL";
15
+ /** Full ADT quick-deploy app generation completed successfully (fired in end()). */
16
+ readonly ADT_QUICK_DEPLOY_COMPLETE: "ADT_QUICK_DEPLOY_COMPLETE";
17
+ /** Writing phase failed for an ADT quick-deploy download (caught exception). */
18
+ readonly ADT_QUICK_DEPLOY_APP_WRITING_FAILED: "ADT_QUICK_DEPLOY_APP_WRITING_FAILED";
19
+ /** Post-generation migration hook completed for an ABAP repository app. */
10
20
  readonly ABAP_REPO_DOWNLOAD_MIGRATION_COMPLETED: "ABAP_REPO_DOWNLOAD_MIGRATION_COMPLETED";
11
21
  };
12
22
  export type EventName = (typeof EventName)[keyof typeof EventName];
@@ -2,11 +2,21 @@
2
2
  * Event names for telemetry for the generator when downloading an app from repository
3
3
  */
4
4
  export const EventName = {
5
+ /** Zip file successfully fetched from the ABAP repository during the prompting phase. */
5
6
  ABAP_REPO_DOWNLOAD_SUCCESS: 'ABAP_REPO_DOWNLOAD_SUCCESS',
7
+ /** Full ABAP repository app generation completed successfully - fired in end(). */
8
+ ABAP_REPO_DOWNLOAD_COMPLETE: 'ABAP_REPO_DOWNLOAD_COMPLETE',
9
+ /** Writing phase failed for an ABAP repository download (caught exception). */
10
+ ABAP_REPO_APP_WRITING_FAILED: 'ABAP_REPO_APP_WRITING_FAILED',
11
+ /** Server returned no content — legacy ABAP system without repository content. */
6
12
  ABAP_REPO_DOWNLOAD_FAIL: 'ABAP_REPO_DOWNLOAD_FAIL',
7
- ABAP_REPO_DOWNLOAD_NO_FILES_RETURNED: 'ABAP_REPO_DOWNLOAD_NO_FILES_RETURNED',
13
+ /** Zip file successfully fetched during ADT quick-deploy prompting phase. */
8
14
  ADT_QUICK_DEPLOY_DOWNLOAD_SUCCESS: 'ADT_QUICK_DEPLOY_DOWNLOAD_SUCCESS',
9
- ADT_QUICK_DEPLOY_DOWNLOAD_FAIL: 'ADT_QUICK_DEPLOY_DOWNLOAD_FAIL',
15
+ /** Full ADT quick-deploy app generation completed successfully (fired in end()). */
16
+ ADT_QUICK_DEPLOY_COMPLETE: 'ADT_QUICK_DEPLOY_COMPLETE',
17
+ /** Writing phase failed for an ADT quick-deploy download (caught exception). */
18
+ ADT_QUICK_DEPLOY_APP_WRITING_FAILED: 'ADT_QUICK_DEPLOY_APP_WRITING_FAILED',
19
+ /** Post-generation migration hook completed for an ABAP repository app. */
10
20
  ABAP_REPO_DOWNLOAD_MIGRATION_COMPLETED: 'ABAP_REPO_DOWNLOAD_MIGRATION_COMPLETED'
11
21
  };
12
22
  //# sourceMappingURL=index.js.map
@@ -26,9 +26,13 @@ export declare function extractZip(extractedProjectPath: string, fs: Editor): Pr
26
26
  * Downloads application files from the ABAP repository.
27
27
  *
28
28
  * @param {string} repoName - The repository name of the application.
29
- * @returns {Promise<boolean>} - Resolves to false if no data was returned (such as on a legacy ABAP system), true otherwise.
29
+ * @returns `{ success: true }` on success, or `{ success: false, errorMessage }` if the server
30
+ * returns no content (e.g. a legacy ABAP system that does not support repository downloads).
30
31
  */
31
- export declare function downloadApp(repoName: string): Promise<boolean>;
32
+ export declare function downloadApp(repoName: string): Promise<{
33
+ success: boolean;
34
+ errorMessage?: string;
35
+ }>;
32
36
  /**
33
37
  * Resolve a transport request for the given app/package.
34
38
  *
@@ -59,7 +59,8 @@ export async function extractZip(extractedProjectPath, fs) {
59
59
  * Downloads application files from the ABAP repository.
60
60
  *
61
61
  * @param {string} repoName - The repository name of the application.
62
- * @returns {Promise<boolean>} - Resolves to false if no data was returned (such as on a legacy ABAP system), true otherwise.
62
+ * @returns `{ success: true }` on success, or `{ success: false, errorMessage }` if the server
63
+ * returns no content (e.g. a legacy ABAP system that does not support repository downloads).
63
64
  */
64
65
  export async function downloadApp(repoName) {
65
66
  const serviceProvider = PromptState.systemSelection?.connectedSystem?.serviceProvider;
@@ -68,13 +69,15 @@ export async function downloadApp(repoName) {
68
69
  RepoAppDownloadLogger.logger?.debug(`App download started: ${repoName}`);
69
70
  const downloadedAppPackage = await ui5AbapRepository.downloadFiles(repoName);
70
71
  if (!downloadedAppPackage || downloadedAppPackage.length === 0) {
71
- RepoAppDownloadLogger.logger?.error(t('error.appDownloadFailed'));
72
- return false;
72
+ // Legacy ABAP systems may return empty content rather than an error response.
73
+ const errorMessage = t('error.appDownloadFailed');
74
+ RepoAppDownloadLogger.logger?.error(errorMessage);
75
+ return { success: false, errorMessage };
73
76
  }
74
77
  RepoAppDownloadLogger.logger?.debug(`App download completed: ${repoName}`);
75
78
  // store downloaded package in prompt state
76
79
  PromptState.admZip = downloadedAppPackage;
77
- return true;
80
+ return { success: true };
78
81
  }
79
82
  /**
80
83
  * Resolve a transport request for the given app/package.
@@ -129,15 +129,23 @@ export async function validateAppSelection(answers, appList, quickDeployedAppCon
129
129
  // Valid app selected, try to download
130
130
  if (answers?.appId) {
131
131
  try {
132
- const downloadSucceeded = await downloadApp(answers.repoName);
133
- if (!downloadSucceeded) {
132
+ const result = await downloadApp(answers.repoName);
133
+ if (!result.success) {
134
134
  if (downloadType === AppDownloadType.AbapRepository) {
135
- await sendTelemetry(EventName.ABAP_REPO_DOWNLOAD_NO_FILES_RETURNED, TelemetryHelper.createTelemetryData({}) ?? {}).catch(() => {
135
+ // Fires when the server returns no content — legacy ABAP system without repository content.
136
+ await sendTelemetry(EventName.ABAP_REPO_DOWNLOAD_FAIL, TelemetryHelper.createTelemetryData({ errorMessage: result.errorMessage }) ?? {}).catch(() => {
136
137
  // telemetry errors are non-fatal
137
138
  });
138
139
  }
139
140
  return await generateAppDownloadFailedHelpLink();
140
141
  }
142
+ // Fires when the zip is successfully fetched — before writing begins.
143
+ const downloadSuccessEvent = downloadType === AppDownloadType.AbapRepository
144
+ ? EventName.ABAP_REPO_DOWNLOAD_SUCCESS
145
+ : EventName.ADT_QUICK_DEPLOY_DOWNLOAD_SUCCESS;
146
+ await sendTelemetry(downloadSuccessEvent, TelemetryHelper.createTelemetryData({}) ?? {}).catch(() => {
147
+ // telemetry errors are non-fatal
148
+ });
141
149
  const isQfaJsonPresent = hasQfaJson();
142
150
  if (!isQfaJsonPresent && downloadType === AppDownloadType.ADTQuickDeploy) {
143
151
  appWizard?.showError(t('error.qfaJsonNotFound', { jsonFileName: qfaJsonFileName }), MessageType.notification);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/repo-app-import-sub-generator",
3
3
  "description": "Generator to download LROP Fiori applications deployed from an ABAP repository.",
4
- "version": "1.2.82",
4
+ "version": "1.2.84",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -30,8 +30,8 @@
30
30
  "@sap-ux/inquirer-common": "1.0.46",
31
31
  "@sap-ux/project-access": "2.3.0",
32
32
  "@sap-ux/odata-service-inquirer": "3.2.24",
33
- "@sap-ux/fiori-elements-writer": "3.1.78",
34
- "@sap-ux/fiori-freestyle-writer": "3.0.121",
33
+ "@sap-ux/fiori-elements-writer": "3.1.79",
34
+ "@sap-ux/fiori-freestyle-writer": "3.0.122",
35
35
  "@sap-ux/logger": "1.0.3",
36
36
  "@sap-ux/project-input-validator": "1.0.23",
37
37
  "@sap-ux/launch-config": "1.0.24",