@acorex-platform/module-background-job-management-client 0.0.30 → 0.0.32

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.
Files changed (24) hide show
  1. package/fesm2022/{acorex-platform-module-background-job-management-client-background-job-command-error.util-BzDLhWRP.mjs → acorex-platform-module-background-job-management-client-background-job-command-error.util-BHBmSbvw.mjs} +5 -1
  2. package/fesm2022/acorex-platform-module-background-job-management-client-background-job-command-error.util-BHBmSbvw.mjs.map +1 -0
  3. package/fesm2022/acorex-platform-module-background-job-management-client-background-job-source-column.component-JzU8l_7q.mjs +83 -0
  4. package/fesm2022/acorex-platform-module-background-job-management-client-background-job-source-column.component-JzU8l_7q.mjs.map +1 -0
  5. package/fesm2022/{acorex-platform-module-background-job-management-client-cancel-background-job.command-OZPzjIow.mjs → acorex-platform-module-background-job-management-client-cancel-background-job.command-BHCWX1c1.mjs} +2 -2
  6. package/fesm2022/{acorex-platform-module-background-job-management-client-cancel-background-job.command-OZPzjIow.mjs.map → acorex-platform-module-background-job-management-client-cancel-background-job.command-BHCWX1c1.mjs.map} +1 -1
  7. package/fesm2022/acorex-platform-module-background-job-management-client-contracts.mjs +6 -1
  8. package/fesm2022/acorex-platform-module-background-job-management-client-contracts.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-module-background-job-management-client-replay-dead-letter.command-BM4NYBxr.mjs +37 -0
  10. package/fesm2022/acorex-platform-module-background-job-management-client-replay-dead-letter.command-BM4NYBxr.mjs.map +1 -0
  11. package/fesm2022/{acorex-platform-module-background-job-management-client-retry-background-job.command-BdJ_PC_y.mjs → acorex-platform-module-background-job-management-client-retry-background-job.command-BBEAc_i7.mjs} +2 -2
  12. package/fesm2022/{acorex-platform-module-background-job-management-client-retry-background-job.command-BdJ_PC_y.mjs.map → acorex-platform-module-background-job-management-client-retry-background-job.command-BBEAc_i7.mjs.map} +1 -1
  13. package/fesm2022/{acorex-platform-module-background-job-management-client-run-schedule-now.command-orzJ7ZmD.mjs → acorex-platform-module-background-job-management-client-run-schedule-now.command-5RV6hAnH.mjs} +2 -2
  14. package/fesm2022/{acorex-platform-module-background-job-management-client-run-schedule-now.command-orzJ7ZmD.mjs.map → acorex-platform-module-background-job-management-client-run-schedule-now.command-5RV6hAnH.mjs.map} +1 -1
  15. package/fesm2022/acorex-platform-module-background-job-management-client-tray-execute-click.command-CEVhvrDQ.mjs +27 -0
  16. package/fesm2022/acorex-platform-module-background-job-management-client-tray-execute-click.command-CEVhvrDQ.mjs.map +1 -0
  17. package/fesm2022/acorex-platform-module-background-job-management-client-tray-run-action.command-B9SFMGxf.mjs +38 -0
  18. package/fesm2022/acorex-platform-module-background-job-management-client-tray-run-action.command-B9SFMGxf.mjs.map +1 -0
  19. package/fesm2022/acorex-platform-module-background-job-management-client.mjs +556 -17
  20. package/fesm2022/acorex-platform-module-background-job-management-client.mjs.map +1 -1
  21. package/package.json +1 -1
  22. package/types/acorex-platform-module-background-job-management-client-contracts.d.ts +6 -1
  23. package/types/acorex-platform-module-background-job-management-client.d.ts +9 -2
  24. package/fesm2022/acorex-platform-module-background-job-management-client-background-job-command-error.util-BzDLhWRP.mjs.map +0 -1
@@ -12,6 +12,10 @@ const BackgroundJobCommandI18n = {
12
12
  success: `${ROOT}:jobs.commands.retry.messages.success`,
13
13
  failed: `${ROOT}:jobs.commands.retry.messages.failed`,
14
14
  },
15
+ replayDeadLetter: {
16
+ success: `${ROOT}:jobs.commands.replay-dead-letter.messages.success`,
17
+ failed: `${ROOT}:jobs.commands.replay-dead-letter.messages.failed`,
18
+ },
15
19
  cancel: {
16
20
  completed: `${ROOT}:jobs.commands.cancel.messages.completed`,
17
21
  requested: `${ROOT}:jobs.commands.cancel.messages.requested`,
@@ -63,4 +67,4 @@ async function resolveBackgroundJobCommandError(translationService, error, fallb
63
67
  }
64
68
 
65
69
  export { BackgroundJobCommandI18n as B, resolveBackgroundJobCommandError as r };
66
- //# sourceMappingURL=acorex-platform-module-background-job-management-client-background-job-command-error.util-BzDLhWRP.mjs.map
70
+ //# sourceMappingURL=acorex-platform-module-background-job-management-client-background-job-command-error.util-BHBmSbvw.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-background-job-management-client-background-job-command-error.util-BHBmSbvw.mjs","sources":["../../../../libs/modules/background-job-management/client/src/lib/commands/background-job-command.i18n.ts","../../../../libs/modules/background-job-management/client/src/lib/commands/background-job-command-error.util.ts"],"sourcesContent":["const ROOT = '@background-job-management';\n\nexport const BackgroundJobCommandI18n = {\n errors: {\n notFound: `${ROOT}:jobs.errors.not-found`,\n retryInvalidStatus: `${ROOT}:jobs.errors.retry-invalid-status`,\n notDeadLettered: `${ROOT}:jobs.errors.not-dead-lettered`,\n },\n retry: {\n success: `${ROOT}:jobs.commands.retry.messages.success`,\n failed: `${ROOT}:jobs.commands.retry.messages.failed`,\n },\n replayDeadLetter: {\n success: `${ROOT}:jobs.commands.replay-dead-letter.messages.success`,\n failed: `${ROOT}:jobs.commands.replay-dead-letter.messages.failed`,\n },\n cancel: {\n completed: `${ROOT}:jobs.commands.cancel.messages.completed`,\n requested: `${ROOT}:jobs.commands.cancel.messages.requested`,\n failed: `${ROOT}:jobs.commands.cancel.messages.failed`,\n },\n runNow: {\n successTitle: `${ROOT}:schedules.commands.run-now.messages.success.title`,\n successDescription: `${ROOT}:schedules.commands.run-now.messages.success.description`,\n failedTitle: `${ROOT}:schedules.commands.run-now.messages.failed.title`,\n failedDescription: `${ROOT}:schedules.commands.run-now.messages.failed.description`,\n },\n} as const;\n","import { extractRequestErrorInfo } from '@acorex-platform/framework-client/common';\nimport { AXP_BACKGROUND_JOB_ERROR_CODES } from '@acorex-platform/framework-shared/background-job';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { BackgroundJobCommandI18n } from './background-job-command.i18n';\n\nconst JOB_STATUS_I18N_ROOT = '@background-job-management:jobs.entities.background-job.states';\n\nconst ERROR_I18N_BY_CODE: Record<string, string> = {\n [AXP_BACKGROUND_JOB_ERROR_CODES.NOT_FOUND]: BackgroundJobCommandI18n.errors.notFound,\n [AXP_BACKGROUND_JOB_ERROR_CODES.RETRY_INVALID_STATUS]: BackgroundJobCommandI18n.errors.retryInvalidStatus,\n [AXP_BACKGROUND_JOB_ERROR_CODES.NOT_DEAD_LETTERED]: BackgroundJobCommandI18n.errors.notDeadLettered,\n};\n\nasync function translateJobStatus(\n translationService: AXTranslationService,\n status: string | undefined,\n): Promise<string | undefined> {\n if (!status) {\n return undefined;\n }\n\n const statusKey = `${JOB_STATUS_I18N_ROOT}.${status}`;\n const translated = await translationService.translateAsync(statusKey);\n return translated === statusKey ? status : translated;\n}\n\nexport async function resolveBackgroundJobCommandError(\n translationService: AXTranslationService,\n error: unknown,\n fallbackKey: string,\n): Promise<{ messageKeyOrText: string; displayText: string }> {\n const httpInfo = extractRequestErrorInfo(error);\n if (httpInfo?.code) {\n const messageKey = ERROR_I18N_BY_CODE[httpInfo.code];\n if (messageKey) {\n const statusLabel = await translateJobStatus(translationService, httpInfo.params?.['status']);\n const params = {\n ...(httpInfo.params ?? {}),\n ...(statusLabel ? { status: statusLabel } : {}),\n };\n const displayText = await translationService.translateAsync(messageKey, {\n params: Object.keys(params).length > 0 ? params : undefined,\n });\n return { messageKeyOrText: messageKey, displayText };\n }\n }\n\n if (httpInfo?.message) {\n return { messageKeyOrText: httpInfo.message, displayText: httpInfo.message };\n }\n\n const displayText = await translationService.translateAsync(fallbackKey);\n return { messageKeyOrText: fallbackKey, displayText };\n}\n"],"names":[],"mappings":";;;AAAA,MAAM,IAAI,GAAG,4BAA4B;AAElC,MAAM,wBAAwB,GAAG;AACtC,IAAA,MAAM,EAAE;QACN,QAAQ,EAAE,CAAA,EAAG,IAAI,CAAA,sBAAA,CAAwB;QACzC,kBAAkB,EAAE,CAAA,EAAG,IAAI,CAAA,iCAAA,CAAmC;QAC9D,eAAe,EAAE,CAAA,EAAG,IAAI,CAAA,8BAAA,CAAgC;AACzD,KAAA;AACD,IAAA,KAAK,EAA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"}
@@ -0,0 +1,83 @@
1
+ import { AXTranslationModule } from '@acorex/core/translation';
2
+ import { AXPUserAvatarComponent, AXPUserCardDirective } from '@acorex-platform/framework-client/layout/components';
3
+ import { AXPColumnWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';
4
+ import { CommonModule } from '@angular/common';
5
+ import * as i0 from '@angular/core';
6
+ import { computed, ChangeDetectionStrategy, Component } from '@angular/core';
7
+
8
+ //#region ----- Imports -----
9
+ //#endregion
10
+ //#region ----- Constants -----
11
+ const MACHINE_USER_ID = 'background-job';
12
+ const USER_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
13
+ //#endregion
14
+ //#region ----- Component -----
15
+ class BackgroundJobSourceColumnComponent extends AXPColumnWidgetComponent {
16
+ constructor() {
17
+ super(...arguments);
18
+ //#region ----- Computed Properties -----
19
+ this.startedByUserId = computed(() => this.resolveStartedByUserId(), /* @ts-ignore */
20
+ ...(ngDevMode ? [{ debugName: "startedByUserId" }] : /* istanbul ignore next */ []));
21
+ this.eventSourceLabel = computed(() => this.resolveEventSource()?.label ?? null, /* @ts-ignore */
22
+ ...(ngDevMode ? [{ debugName: "eventSourceLabel" }] : /* istanbul ignore next */ []));
23
+ this.eventSourceTitle = computed(() => this.resolveEventSource()?.title ?? '', /* @ts-ignore */
24
+ ...(ngDevMode ? [{ debugName: "eventSourceTitle" }] : /* istanbul ignore next */ []));
25
+ }
26
+ //#endregion
27
+ //#region ----- Event Handlers -----
28
+ stopRowClick(event) {
29
+ event.stopPropagation();
30
+ }
31
+ //#endregion
32
+ //#region ----- Helpers -----
33
+ resolveStartedByUserId() {
34
+ const userId = this.readString(this.readRowValue('userId'));
35
+ if (!userId || userId === MACHINE_USER_ID || !USER_ID_PATTERN.test(userId)) {
36
+ return null;
37
+ }
38
+ return userId;
39
+ }
40
+ resolveEventSource() {
41
+ const payload = this.readCommandPayload();
42
+ const eventSource = this.asRecord(payload['eventSource']);
43
+ const entityName = this.readString(eventSource['entityName']) || this.readString(payload['entityName']);
44
+ if (entityName) {
45
+ return { label: this.shortName(entityName, '.'), title: entityName };
46
+ }
47
+ const queryKeys = payload['queryKeys'];
48
+ const queryKey = Array.isArray(queryKeys) ? this.readString(queryKeys[0]) : '';
49
+ if (queryKey) {
50
+ return { label: this.shortName(queryKey, ':'), title: queryKey };
51
+ }
52
+ return null;
53
+ }
54
+ readCommandPayload() {
55
+ const command = this.asRecord(this.readRowValue('command'));
56
+ return this.asRecord(command['payload']);
57
+ }
58
+ readRowValue(path) {
59
+ const row = this.asRecord(this.rowData);
60
+ return row[path];
61
+ }
62
+ asRecord(value) {
63
+ return value != null && typeof value === 'object' && !Array.isArray(value)
64
+ ? value
65
+ : {};
66
+ }
67
+ shortName(value, separator) {
68
+ const index = value.lastIndexOf(separator);
69
+ return index >= 0 ? value.slice(index + 1) : value;
70
+ }
71
+ readString(value) {
72
+ return typeof value === 'string' ? value.trim() : '';
73
+ }
74
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BackgroundJobSourceColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
75
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: BackgroundJobSourceColumnComponent, isStandalone: true, selector: "axp-background-job-source-column", inputs: { rawValue: "rawValue", rowData: "rowData" }, usesInheritance: true, ngImport: i0, template: "@if (startedByUserId(); as userId) {\n <!-- ----- User who started a manual run ----- -->\n <div\n class=\"flex items-center gap-1.5 min-w-0\"\n (click)=\"stopRowClick($event)\"\n (pointerdown)=\"stopRowClick($event)\"\n >\n <axp-user-avatar\n #startedBy\n [size]=\"22\"\n [userId]=\"userId\"\n [showPresence]=\"false\"\n [axpUserCard]=\"userId\"\n ></axp-user-avatar>\n <span class=\"truncate text-sm\">{{ startedBy.title() }}</span>\n </div>\n}\n<!-- ----- Entity or query that raised an event-triggered job ----- -->\n@else if (eventSourceLabel(); as source) {\n <span class=\"truncate text-sm\" [attr.title]=\"eventSourceTitle()\">{{ source }}</span>\n}\n<!-- ----- Schedule and system jobs have no person or event source ----- -->\n@else {\n <span class=\"text-muted\">---</span>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXPUserAvatarComponent, selector: "axp-user-avatar", inputs: ["size", "userId", "showPresence", "displayName", "displayAvatar"] }, { kind: "directive", type: AXPUserCardDirective, selector: "[axpUserCard]", inputs: ["axpUserCard", "axpUserCardDisabled", "axpUserCardTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
76
+ }
77
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BackgroundJobSourceColumnComponent, decorators: [{
78
+ type: Component,
79
+ args: [{ selector: 'axp-background-job-source-column', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, AXTranslationModule, AXPUserAvatarComponent, AXPUserCardDirective], inputs: ['rawValue', 'rowData'], template: "@if (startedByUserId(); as userId) {\n <!-- ----- User who started a manual run ----- -->\n <div\n class=\"flex items-center gap-1.5 min-w-0\"\n (click)=\"stopRowClick($event)\"\n (pointerdown)=\"stopRowClick($event)\"\n >\n <axp-user-avatar\n #startedBy\n [size]=\"22\"\n [userId]=\"userId\"\n [showPresence]=\"false\"\n [axpUserCard]=\"userId\"\n ></axp-user-avatar>\n <span class=\"truncate text-sm\">{{ startedBy.title() }}</span>\n </div>\n}\n<!-- ----- Entity or query that raised an event-triggered job ----- -->\n@else if (eventSourceLabel(); as source) {\n <span class=\"truncate text-sm\" [attr.title]=\"eventSourceTitle()\">{{ source }}</span>\n}\n<!-- ----- Schedule and system jobs have no person or event source ----- -->\n@else {\n <span class=\"text-muted\">---</span>\n}\n" }]
80
+ }] });
81
+
82
+ export { BackgroundJobSourceColumnComponent };
83
+ //# sourceMappingURL=acorex-platform-module-background-job-management-client-background-job-source-column.component-JzU8l_7q.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-background-job-management-client-background-job-source-column.component-JzU8l_7q.mjs","sources":["../../../../libs/modules/background-job-management/client/src/lib/widgets/background-job-source-column.component.ts","../../../../libs/modules/background-job-management/client/src/lib/widgets/background-job-source-column.component.html"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AXPUserAvatarComponent, AXPUserCardDirective } from '@acorex-platform/framework-client/layout/components';\nimport { AXPColumnWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed } from '@angular/core';\n\n//#endregion\n\n//#region ----- Constants -----\n\nconst MACHINE_USER_ID = 'background-job';\nconst USER_ID_PATTERN =\n /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\n//#endregion\n\n//#region ----- Component -----\n\n@Component({\n selector: 'axp-background-job-source-column',\n templateUrl: './background-job-source-column.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [CommonModule, AXTranslationModule, AXPUserAvatarComponent, AXPUserCardDirective],\n inputs: ['rawValue', 'rowData'],\n})\nexport class BackgroundJobSourceColumnComponent extends AXPColumnWidgetComponent<unknown> {\n //#region ----- Computed Properties -----\n\n protected readonly startedByUserId = computed(() => this.resolveStartedByUserId());\n\n protected readonly eventSourceLabel = computed(() => this.resolveEventSource()?.label ?? null);\n\n protected readonly eventSourceTitle = computed(() => this.resolveEventSource()?.title ?? '');\n\n //#endregion\n\n //#region ----- Event Handlers -----\n\n protected stopRowClick(event: Event): void {\n event.stopPropagation();\n }\n\n //#endregion\n\n //#region ----- Helpers -----\n\n private resolveStartedByUserId(): string | null {\n const userId = this.readString(this.readRowValue('userId'));\n if (!userId || userId === MACHINE_USER_ID || !USER_ID_PATTERN.test(userId)) {\n return null;\n }\n return userId;\n }\n\n private resolveEventSource(): { label: string; title: string } | null {\n const payload = this.readCommandPayload();\n const eventSource = this.asRecord(payload['eventSource']);\n const entityName =\n this.readString(eventSource['entityName']) || this.readString(payload['entityName']);\n if (entityName) {\n return { label: this.shortName(entityName, '.'), title: entityName };\n }\n\n const queryKeys = payload['queryKeys'];\n const queryKey = Array.isArray(queryKeys) ? this.readString(queryKeys[0]) : '';\n if (queryKey) {\n return { label: this.shortName(queryKey, ':'), title: queryKey };\n }\n\n return null;\n }\n\n private readCommandPayload(): Record<string, unknown> {\n const command = this.asRecord(this.readRowValue('command'));\n return this.asRecord(command['payload']);\n }\n\n private readRowValue(path: string): unknown {\n const row = this.asRecord(this.rowData);\n return row[path];\n }\n\n private asRecord(value: unknown): Record<string, unknown> {\n return value != null && typeof value === 'object' && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : {};\n }\n\n private shortName(value: string, separator: string): string {\n const index = value.lastIndexOf(separator);\n return index >= 0 ? value.slice(index + 1) : value;\n }\n\n private readString(value: unknown): string {\n return typeof value === 'string' ? value.trim() : '';\n }\n\n //#endregion\n}\n\n//#endregion\n","@if (startedByUserId(); as userId) {\n <!-- ----- User who started a manual run ----- -->\n <div\n class=\"flex items-center gap-1.5 min-w-0\"\n (click)=\"stopRowClick($event)\"\n (pointerdown)=\"stopRowClick($event)\"\n >\n <axp-user-avatar\n #startedBy\n [size]=\"22\"\n [userId]=\"userId\"\n [showPresence]=\"false\"\n [axpUserCard]=\"userId\"\n ></axp-user-avatar>\n <span class=\"truncate text-sm\">{{ startedBy.title() }}</span>\n </div>\n}\n<!-- ----- Entity or query that raised an event-triggered job ----- -->\n@else if (eventSourceLabel(); as source) {\n <span class=\"truncate text-sm\" [attr.title]=\"eventSourceTitle()\">{{ source }}</span>\n}\n<!-- ----- Schedule and system jobs have no person or event source ----- -->\n@else {\n <span class=\"text-muted\">---</span>\n}\n"],"names":[],"mappings":";;;;;;;AAAA;AAQA;AAEA;AAEA,MAA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ular/core';
3
3
  import { AXTranslationService } from '@acorex/core/translation';
4
4
  import { AXPBackgroundJobManagementClient } from './acorex-platform-module-background-job-management-client.mjs';
5
- import { B as BackgroundJobCommandI18n, r as resolveBackgroundJobCommandError } from './acorex-platform-module-background-job-management-client-background-job-command-error.util-BzDLhWRP.mjs';
5
+ import { B as BackgroundJobCommandI18n, r as resolveBackgroundJobCommandError } from './acorex-platform-module-background-job-management-client-background-job-command-error.util-BHBmSbvw.mjs';
6
6
 
7
7
  class CancelBackgroundJobCommand {
8
8
  constructor() {
@@ -49,4 +49,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
49
49
  }] });
50
50
 
51
51
  export { CancelBackgroundJobCommand };
52
- //# sourceMappingURL=acorex-platform-module-background-job-management-client-cancel-background-job.command-OZPzjIow.mjs.map
52
+ //# sourceMappingURL=acorex-platform-module-background-job-management-client-cancel-background-job.command-BHCWX1c1.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-background-job-management-client-cancel-background-job.command-OZPzjIow.mjs","sources":["../../../../libs/modules/background-job-management/client/src/lib/commands/cancel-background-job.command.ts"],"sourcesContent":["import { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { Injectable, inject } from '@angular/core';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPBackgroundJobManagementClient } from '../background-job-management-client.port';\nimport { resolveBackgroundJobCommandError } from './background-job-command-error.util';\nimport { BackgroundJobCommandI18n } from './background-job-command.i18n';\n\nexport interface CancelBackgroundJobInput {\n jobId: string;\n reason?: string;\n}\n\n@Injectable()\nexport class CancelBackgroundJobCommand implements AXPCommand<CancelBackgroundJobInput, { status: string }> {\n private readonly client = inject(AXPBackgroundJobManagementClient);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(raw: unknown): AXPCommandExecuteResultPromise<{ status: string }> {\n const wrapped = raw as { options?: CancelBackgroundJobInput } & Record<string, unknown>;\n const input = (wrapped?.options ?? raw) as CancelBackgroundJobInput;\n\n try {\n const result = await this.client.cancelJob(input.jobId, input.reason);\n const messageKey =\n result.status === 'cancelled'\n ? BackgroundJobCommandI18n.cancel.completed\n : BackgroundJobCommandI18n.cancel.requested;\n return result.success\n ? {\n success: true,\n kind: 'object',\n data: { status: result.status },\n message: {\n text: messageKey,\n type: result.status === 'cancelled' ? 'success' : 'warning',\n },\n }\n : {\n success: false,\n message: {\n text: messageKey,\n type: 'warning',\n details: { status: result.status },\n },\n };\n } catch (error) {\n const { messageKeyOrText } = await resolveBackgroundJobCommandError(\n this.translationService,\n error,\n BackgroundJobCommandI18n.cancel.failed,\n );\n return { success: false, message: { text: messageKeyOrText } };\n }\n }\n}\n"],"names":[],"mappings":";;;;;;MAca,0BAA0B,CAAA;AADvC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,gCAAgC,CAAC;AACjD,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAuCnE,IAAA;IArCC,MAAM,OAAO,CAAC,GAAY,EAAA;QACxB,MAAM,OAAO,GAAG,GAAuE;QACvF,MAAM,KAAK,IAAI,OAAO,EAAE,OAAO,IAAI,GAAG,CAA6B;AAEnE,QAAA,IAAI;AACF,YAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;AACrE,YAAA,MAAM,UAAU,GACd,MAAM,CAAC,MAAM,KAAK;AAChB,kBAAE,wBAAwB,CAAC,MAAM,CAAC;AAClC,kBAAE,wBAAwB,CAAC,MAAM,CAAC,SAAS;YAC/C,OAAO,MAAM,CAAC;AACZ,kBAAE;AACE,oBAAA,OAAO,EAAE,IAAI;AACb,oBAAA,IAAI,EAAE,QAAQ;AACd,oBAAA,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;AAC/B,oBAAA,OAAO,EAAE;AACP,wBAAA,IAAI,EAAE,UAAU;AAChB,wBAAA,IAAI,EAAE,MAAM,CAAC,MAAM,KAAK,WAAW,GAAG,SAAS,GAAG,SAAS;AAC5D,qBAAA;AACF;AACH,kBAAE;AACE,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE;AACP,wBAAA,IAAI,EAAE,UAAU;AAChB,wBAAA,IAAI,EAAE,SAAS;AACf,wBAAA,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;AACnC,qBAAA;iBACF;QACP;QAAE,OAAO,KAAK,EAAE;AACd,YAAA,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,gCAAgC,CACjE,IAAI,CAAC,kBAAkB,EACvB,KAAK,EACL,wBAAwB,CAAC,MAAM,CAAC,MAAM,CACvC;AACD,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE;QAChE;IACF;8GAxCW,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAA1B,0BAA0B,EAAA,CAAA,CAAA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBADtC;;;;;"}
1
+ {"version":3,"file":"acorex-platform-module-background-job-management-client-cancel-background-job.command-BHCWX1c1.mjs","sources":["../../../../libs/modules/background-job-management/client/src/lib/commands/cancel-background-job.command.ts"],"sourcesContent":["import { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { Injectable, inject } from '@angular/core';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPBackgroundJobManagementClient } from '../background-job-management-client.port';\nimport { resolveBackgroundJobCommandError } from './background-job-command-error.util';\nimport { BackgroundJobCommandI18n } from './background-job-command.i18n';\n\nexport interface CancelBackgroundJobInput {\n jobId: string;\n reason?: string;\n}\n\n@Injectable()\nexport class CancelBackgroundJobCommand implements AXPCommand<CancelBackgroundJobInput, { status: string }> {\n private readonly client = inject(AXPBackgroundJobManagementClient);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(raw: unknown): AXPCommandExecuteResultPromise<{ status: string }> {\n const wrapped = raw as { options?: CancelBackgroundJobInput } & Record<string, unknown>;\n const input = (wrapped?.options ?? raw) as CancelBackgroundJobInput;\n\n try {\n const result = await this.client.cancelJob(input.jobId, input.reason);\n const messageKey =\n result.status === 'cancelled'\n ? BackgroundJobCommandI18n.cancel.completed\n : BackgroundJobCommandI18n.cancel.requested;\n return result.success\n ? {\n success: true,\n kind: 'object',\n data: { status: result.status },\n message: {\n text: messageKey,\n type: result.status === 'cancelled' ? 'success' : 'warning',\n },\n }\n : {\n success: false,\n message: {\n text: messageKey,\n type: 'warning',\n details: { status: result.status },\n },\n };\n } catch (error) {\n const { messageKeyOrText } = await resolveBackgroundJobCommandError(\n this.translationService,\n error,\n BackgroundJobCommandI18n.cancel.failed,\n );\n return { success: false, message: { text: messageKeyOrText } };\n }\n }\n}\n"],"names":[],"mappings":";;;;;;MAca,0BAA0B,CAAA;AADvC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,gCAAgC,CAAC;AACjD,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAuCnE,IAAA;IArCC,MAAM,OAAO,CAAC,GAAY,EAAA;QACxB,MAAM,OAAO,GAAG,GAAuE;QACvF,MAAM,KAAK,IAAI,OAAO,EAAE,OAAO,IAAI,GAAG,CAA6B;AAEnE,QAAA,IAAI;AACF,YAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,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DEFAULTS = {
67
67
  };
68
68
  //#endregion
69
69
 
70
+ /** Inbox `definitionKey` for background-job complete/fail and schedule alerts. */
71
+ const BACKGROUND_JOB_NOTIFICATION_DEFINITION_KEY = 'BackgroundJobManagement:JobNotification';
72
+
73
+ const BACKGROUND_JOB_SOURCE_COLUMN_WIDGET = 'background-job-source';
74
+
70
75
  const config = {
71
76
  i18n: 'background-job-management',
72
77
  module: 'BackgroundJobManagement',
@@ -118,5 +123,5 @@ const RootConfig = {
118
123
  * Generated bundle index. Do not edit.
119
124
  */
120
125
 
121
- export { AXMBackgroundJobPermissionKeys, AXPAdministrationPermissionKeys, AXPBackgroundJobManagementMenuKeys, AXPBackgroundJobManagementSettings, AXP_BACKGROUND_JOB_RETENTION_SETTING_DEFAULTS, RootConfig };
126
+ export { AXMBackgroundJobPermissionKeys, AXPAdministrationPermissionKeys, AXPBackgroundJobManagementMenuKeys, AXPBackgroundJobManagementSettings, AXP_BACKGROUND_JOB_RETENTION_SETTING_DEFAULTS, BACKGROUND_JOB_NOTIFICATION_DEFINITION_KEY, BACKGROUND_JOB_SOURCE_COLUMN_WIDGET, RootConfig };
122
127
  //# sourceMappingURL=acorex-platform-module-background-job-management-client-contracts.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-background-job-management-client-contracts.mjs","sources":["../../../../libs/modules/background-job-management/contracts/src/menu.keys.ts","../../../../libs/modules/background-job-management/contracts/src/permission.keys.ts","../../../../libs/modules/background-job-management/contracts/src/settings.keys.ts","../../../../libs/modules/background-job-management/contracts/src/root-config.ts","../../../../libs/modules/background-job-management/contracts/src/entities/background-job-schedule/background-job-schedule.types.ts","../../../../libs/modules/background-job-management/contracts/src/index.ts","../../../../libs/modules/background-job-management/contracts/src/acorex-platform-module-background-job-management-client-contracts.ts"],"sourcesContent":["export const AXPBackgroundJobManagementMenuKeys = {\n Root: 'background-job-management:menu',\n Jobs: 'background-job-management:jobs',\n Schedules: 'background-job-management:schedules',\n} as const;\n","/**\n * Administration capabilities used by this module.\n * Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).\n */\nexport const AXPAdministrationPermissionKeys = {\n Access: 'Administration:Permission:Access',\n MaintainUsersAndRoles: 'Administration:Permission:MaintainUsersAndRoles',\n ManageSessions: 'Administration:Permission:ManageSessions',\n MaintainPolicies: 'Administration:Permission:MaintainPolicies',\n ViewIntegrations: 'Administration:Permission:ViewIntegrations',\n MaintainConnections: 'Administration:Permission:MaintainConnections',\n MaintainWorkflows: 'Administration:Permission:MaintainWorkflows',\n ManageWorkflowActions: 'Administration:Permission:ManageWorkflowActions',\n ViewRules: 'Administration:Permission:ViewRules',\n MaintainRules: 'Administration:Permission:MaintainRules',\n ManageRuleActions: 'Administration:Permission:ManageRuleActions',\n MaintainAi: 'Administration:Permission:MaintainAi',\n UseAiAssist: 'Administration:Permission:UseAiAssist',\n MaintainDashboards: 'Administration:Permission:MaintainDashboards',\n ViewJobs: 'Administration:Permission:ViewJobs',\n ManageJobActions: 'Administration:Permission:ManageJobActions',\n ViewObservability: 'Administration:Permission:ViewObservability',\n MaintainObservability: 'Administration:Permission:MaintainObservability',\n} as const;\n\n/**\n * @deprecated Prefer {@link AXPAdministrationPermissionKeys}.\n * Legacy nested shape kept so existing imports compile during migration.\n */\nexport const AXMBackgroundJobPermissionKeys = {\n Job: {\n View: AXPAdministrationPermissionKeys.ViewJobs,\n Cancel: AXPAdministrationPermissionKeys.ManageJobActions,\n Retry: AXPAdministrationPermissionKeys.ManageJobActions,\n Delete: AXPAdministrationPermissionKeys.ManageJobActions,\n ReplayDeadLetter: AXPAdministrationPermissionKeys.ManageJobActions,\n },\n Schedule: {\n View: AXPAdministrationPermissionKeys.ViewJobs,\n Manage: AXPAdministrationPermissionKeys.ManageJobActions,\n },\n Dashboard: {\n View: AXPAdministrationPermissionKeys.ViewJobs,\n },\n} as const;\n","//#region ---- Background job management settings ----\n\nexport enum AXPBackgroundJobManagementSettings {\n RetentionEnabled = 'BackgroundJobManagement:Setting:Retention.Enabled',\n RetentionDefaultDays = 'BackgroundJobManagement:Setting:Retention.DefaultDays',\n RetentionDeadLetterDays = 'BackgroundJobManagement:Setting:Retention.DeadLetterDays',\n RetentionBatchSize = 'BackgroundJobManagement:Setting:Retention.BatchSize',\n RetentionPurgeCron = 'BackgroundJobManagement:Setting:Retention.PurgeCron',\n}\n\nexport const AXP_BACKGROUND_JOB_RETENTION_SETTING_DEFAULTS = {\n [AXPBackgroundJobManagementSettings.RetentionEnabled]: true,\n [AXPBackgroundJobManagementSettings.RetentionDefaultDays]: 30,\n [AXPBackgroundJobManagementSettings.RetentionDeadLetterDays]: 90,\n [AXPBackgroundJobManagementSettings.RetentionBatchSize]: 500,\n [AXPBackgroundJobManagementSettings.RetentionPurgeCron]: '0 3 * * *',\n} as const;\n\n//#endregion\n","const config = {\n i18n: 'background-job-management',\n module: 'BackgroundJobManagement',\n};\n\nexport const RootConfig = {\n config,\n module: {\n route: 'background-job-management',\n name: config.module,\n title: '@background-job-management:module.title',\n icon: 'fa-light fa-gears',\n },\n entities: {\n backgroundJob: {\n name: 'BackgroundJob',\n fullName: `${config.module}.BackgroundJob`,\n title: '@background-job-management:jobs.entities.background-job.title',\n titlePlural: '@background-job-management:jobs.entities.background-job.plural',\n icon: 'fa-light fa-list-check',\n },\n backgroundJobAttempt: {\n name: 'BackgroundJobAttempt',\n fullName: `${config.module}.BackgroundJobAttempt`,\n title: '@background-job-management:attempts.entities.background-job-attempt.title',\n titlePlural: '@background-job-management:attempts.entities.background-job-attempt.plural',\n icon: 'fa-light fa-rotate',\n },\n backgroundJobSchedule: {\n name: 'BackgroundJobSchedule',\n fullName: `${config.module}.BackgroundJobSchedule`,\n title: '@background-job-management:schedules.entities.background-job-schedule.title',\n titlePlural: '@background-job-management:schedules.entities.background-job-schedule.plural',\n icon: 'fa-light fa-calendar-clock',\n },\n },\n queries: {\n dashboard: {\n jobsByStatusBar: `${config.module}:Dashboard:JobsByStatusBar`,\n jobSchedulesByStatusBar: `${config.module}:Dashboard:JobSchedulesByStatusBar`,\n },\n },\n} as const;\n","import type { AXPBackgroundJobSchedule } from '@acorex-platform/framework-shared/background-job';\n\n//#region ---- Background job schedule model ----\n\nexport type AXMBackgroundJobManagementBackgroundJobScheduleEntityModel = AXPBackgroundJobSchedule;\n\n//#endregion\n","//#region ---- Contracts barrel ----\n\nexport * from './menu.keys';\nexport * from './permission.keys';\nexport * from './settings.keys';\nexport * from './root-config';\n\n//#endregion\n\nexport * from './entities';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAO,MAAM,kCAAkC,GAAG;AAChD,IAAA,IAAI,EAAE,gCAAgC;AACtC,IAAA,IAAI,EAAE,gCAAgC;AACtC,IAAA,SAAS,EAAE,qCAAqC;;;ACHlD;;;AAGG;AACI,MAAM,+BAA+B,GAAG;AAC7C,IAAA,MAAM,EAAE,kCAAkC;AAC1C,IAAA,qBAAqB,EAAE,iDAAiD;AACxE,IAAA,cAAc,EAAE,0CAA0C;AAC1D,IAAA,gBAAgB,EAAE,4CAA4C;AAC9D,IAAA,gBAAgB,EAAE,4CAA4C;AAC9D,IAAA,mBAAmB,EAAE,+CAA+C;AACpE,IAAA,iBAAiB,EAAE,6CAA6C;AAChE,IAAA,qBAAqB,EAAE,iDAAiD;AACxE,IAAA,SAAS,EAAE,qCAAqC;AAChD,IAAA,aAAa,EAAE,yCAAyC;AACxD,IAAA,iBAAiB,EAAE,6CAA6C;AAChE,IAAA,UAAU,EAAE,sCAAsC;AAClD,IAAA,WAAW,EAAE,uCAAuC;AACpD,IAAA,kBAAkB,EAAE,8CAA8C;AAClE,IAAA,QAAQ,EAAE,oCAAoC;AAC9C,IAAA,gBAAgB,EAAE,4CAA4C;AAC9D,IAAA,iBAAiB,EAAE,6CAA6C;AAChE,IAAA,qBAAqB,EAAE,iDAAiD;;AAG1E;;;AAGG;AACI,MAAM,8BAA8B,GAAG;AAC5C,IAAA,GAAG,EAAE;QACH,IAA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":["../../../../libs/modules/background-job-management/contracts/src/menu.keys.ts","../../../../libs/modules/background-job-management/contracts/src/permission.keys.ts","../../../../libs/modules/background-job-management/contracts/src/settings.keys.ts","../../../../libs/modules/background-job-management/contracts/src/notification.keys.ts","../../../../libs/modules/background-job-management/contracts/src/widget.keys.ts","../../../../libs/modules/background-job-management/contracts/src/root-config.ts","../../../../libs/modules/background-job-management/contracts/src/entities/background-job-schedule/background-job-schedule.types.ts","../../../../libs/modules/background-job-management/contracts/src/index.ts","../../../../libs/modules/background-job-management/contracts/src/acorex-platform-module-background-job-management-client-contracts.ts"],"sourcesContent":["export const AXPBackgroundJobManagementMenuKeys = {\n Root: 'background-job-management:menu',\n Jobs: 'background-job-management:jobs',\n Schedules: 'background-job-management:schedules',\n} as const;\n","/**\n * Administration capabilities used by this module.\n * Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).\n */\nexport const AXPAdministrationPermissionKeys = {\n Access: 'Administration:Permission:Access',\n MaintainUsersAndRoles: 'Administration:Permission:MaintainUsersAndRoles',\n ManageSessions: 'Administration:Permission:ManageSessions',\n MaintainPolicies: 'Administration:Permission:MaintainPolicies',\n ViewIntegrations: 'Administration:Permission:ViewIntegrations',\n MaintainConnections: 'Administration:Permission:MaintainConnections',\n MaintainWorkflows: 'Administration:Permission:MaintainWorkflows',\n ManageWorkflowActions: 'Administration:Permission:ManageWorkflowActions',\n ViewRules: 'Administration:Permission:ViewRules',\n MaintainRules: 'Administration:Permission:MaintainRules',\n ManageRuleActions: 'Administration:Permission:ManageRuleActions',\n MaintainAi: 'Administration:Permission:MaintainAi',\n UseAiAssist: 'Administration:Permission:UseAiAssist',\n MaintainDashboards: 'Administration:Permission:MaintainDashboards',\n ViewJobs: 'Administration:Permission:ViewJobs',\n ManageJobActions: 'Administration:Permission:ManageJobActions',\n ViewObservability: 'Administration:Permission:ViewObservability',\n MaintainObservability: 'Administration:Permission:MaintainObservability',\n} as const;\n\n/**\n * @deprecated Prefer {@link AXPAdministrationPermissionKeys}.\n * Legacy nested shape kept so existing imports compile during migration.\n */\nexport const AXMBackgroundJobPermissionKeys = {\n Job: {\n View: AXPAdministrationPermissionKeys.ViewJobs,\n Cancel: AXPAdministrationPermissionKeys.ManageJobActions,\n Retry: AXPAdministrationPermissionKeys.ManageJobActions,\n Delete: AXPAdministrationPermissionKeys.ManageJobActions,\n ReplayDeadLetter: AXPAdministrationPermissionKeys.ManageJobActions,\n },\n Schedule: {\n View: AXPAdministrationPermissionKeys.ViewJobs,\n Manage: AXPAdministrationPermissionKeys.ManageJobActions,\n },\n Dashboard: {\n View: AXPAdministrationPermissionKeys.ViewJobs,\n },\n} as const;\n","//#region ---- Background job management settings ----\n\nexport enum AXPBackgroundJobManagementSettings {\n RetentionEnabled = 'BackgroundJobManagement:Setting:Retention.Enabled',\n RetentionDefaultDays = 'BackgroundJobManagement:Setting:Retention.DefaultDays',\n RetentionDeadLetterDays = 'BackgroundJobManagement:Setting:Retention.DeadLetterDays',\n RetentionBatchSize = 'BackgroundJobManagement:Setting:Retention.BatchSize',\n RetentionPurgeCron = 'BackgroundJobManagement:Setting:Retention.PurgeCron',\n}\n\nexport const AXP_BACKGROUND_JOB_RETENTION_SETTING_DEFAULTS = {\n [AXPBackgroundJobManagementSettings.RetentionEnabled]: true,\n [AXPBackgroundJobManagementSettings.RetentionDefaultDays]: 30,\n [AXPBackgroundJobManagementSettings.RetentionDeadLetterDays]: 90,\n [AXPBackgroundJobManagementSettings.RetentionBatchSize]: 500,\n [AXPBackgroundJobManagementSettings.RetentionPurgeCron]: '0 3 * * *',\n} as const;\n\n//#endregion\n","/** Inbox `definitionKey` for background-job complete/fail and schedule alerts. */\nexport const BACKGROUND_JOB_NOTIFICATION_DEFINITION_KEY = 'BackgroundJobManagement:JobNotification';\n","export const BACKGROUND_JOB_SOURCE_COLUMN_WIDGET = 'background-job-source';\n","const config = {\n i18n: 'background-job-management',\n module: 'BackgroundJobManagement',\n};\n\nexport const RootConfig = {\n config,\n module: {\n route: 'background-job-management',\n name: config.module,\n title: '@background-job-management:module.title',\n icon: 'fa-light fa-gears',\n },\n entities: {\n backgroundJob: {\n name: 'BackgroundJob',\n fullName: `${config.module}.BackgroundJob`,\n title: '@background-job-management:jobs.entities.background-job.title',\n titlePlural: '@background-job-management:jobs.entities.background-job.plural',\n icon: 'fa-light fa-list-check',\n },\n backgroundJobAttempt: {\n name: 'BackgroundJobAttempt',\n fullName: `${config.module}.BackgroundJobAttempt`,\n title: '@background-job-management:attempts.entities.background-job-attempt.title',\n titlePlural: '@background-job-management:attempts.entities.background-job-attempt.plural',\n icon: 'fa-light fa-rotate',\n },\n backgroundJobSchedule: {\n name: 'BackgroundJobSchedule',\n fullName: `${config.module}.BackgroundJobSchedule`,\n title: '@background-job-management:schedules.entities.background-job-schedule.title',\n titlePlural: '@background-job-management:schedules.entities.background-job-schedule.plural',\n icon: 'fa-light fa-calendar-clock',\n },\n },\n queries: {\n dashboard: {\n jobsByStatusBar: `${config.module}:Dashboard:JobsByStatusBar`,\n jobSchedulesByStatusBar: `${config.module}:Dashboard:JobSchedulesByStatusBar`,\n },\n },\n} as const;\n","import type { AXPBackgroundJobSchedule } from '@acorex-platform/framework-shared/background-job';\n\n//#region ---- Background job schedule model ----\n\nexport type AXMBackgroundJobManagementBackgroundJobScheduleEntityModel = AXPBackgroundJobSchedule;\n\n//#endregion\n","//#region ---- Contracts barrel ----\n\nexport * from './menu.keys';\nexport * from './permission.keys';\nexport * from './settings.keys';\nexport * from './notification.keys';\nexport * from './widget.keys';\nexport * from './root-config';\n\n//#endregion\n\nexport * from './entities';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAO,MAAM,kCAAkC,GAAG;AAChD,IAAA,IAAI,EAAE,gCAAgC;AACtC,IAAA,IAAI,EAAE,gCAAgC;AACtC,IAAA,SAAS,EAAE,qCAAqC;;;ACHlD;;;AAGG;AACI,MAAM,+BAA+B,GAAG;AAC7C,IAAA,MAAM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,QAAQ,EAAE,CAAA,EAAG,MAAM,CAAC,MAAM,CAAA,qBAAA,CAAuB;AACjD,YAAA,KAAK,EAAE,2EAA2E;AAClF,YAAA,WAAW,EAAE,4EAA4E;AACzF,YAAA,IAAI,EAAE,oBAAoB;AAC3B,SAAA;AACD,QAAA,qBAAqB,EAAE;AACrB,YAAA,IAAI,EAAE,uBAAuB;AAC7B,YAAA,QAAQ,EAAE,CAAA,EAAG,MAAM,CAAC,MAAM,CAAA,sBAAA,CAAwB;AAClD,YAAA,KAAK,EAAE,6EAA6E;AACpF,YAAA,WAAW,EAAE,8EAA8E;AAC3F,YAAA,IAAI,EAAE,4BAA4B;AACnC,SAAA;AACF,KAAA;AACD,IAAA,OAAO,EAAE;AACP,QAAA,SAAS,EAAE;AACT,YAAA,eAAe,EAAE,CAAA,EAAG,MAAM,CAAC,MAAM,CAAA,0BAAA,CAA4B;AAC7D,YAAA,uBAAuB,EAAE,CAAA,EAAG,MAAM,CAAC,MAAM,CAAA,kCAAA,CAAoC;AAC9E,SAAA;AACF,KAAA;;;ACnCH;;ACNA;;ACAA;;AAEG;;;;"}
@@ -0,0 +1,37 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, Injectable } from '@angular/core';
3
+ import { AXTranslationService } from '@acorex/core/translation';
4
+ import { AXPBackgroundJobManagementClient } from './acorex-platform-module-background-job-management-client.mjs';
5
+ import { B as BackgroundJobCommandI18n, r as resolveBackgroundJobCommandError } from './acorex-platform-module-background-job-management-client-background-job-command-error.util-BHBmSbvw.mjs';
6
+
7
+ class ReplayDeadLetterBackgroundJobCommand {
8
+ constructor() {
9
+ this.client = inject(AXPBackgroundJobManagementClient);
10
+ this.translationService = inject(AXTranslationService);
11
+ }
12
+ async execute(raw) {
13
+ const wrapped = raw;
14
+ const input = (wrapped?.options ?? raw);
15
+ try {
16
+ const result = await this.client.replayDeadLetter(input.jobId);
17
+ return {
18
+ success: true,
19
+ kind: 'object',
20
+ data: { jobId: result.jobId },
21
+ message: { text: BackgroundJobCommandI18n.replayDeadLetter.success },
22
+ };
23
+ }
24
+ catch (error) {
25
+ const { messageKeyOrText } = await resolveBackgroundJobCommandError(this.translationService, error, BackgroundJobCommandI18n.replayDeadLetter.failed);
26
+ return { success: false, message: { text: messageKeyOrText } };
27
+ }
28
+ }
29
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ReplayDeadLetterBackgroundJobCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
30
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ReplayDeadLetterBackgroundJobCommand }); }
31
+ }
32
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ReplayDeadLetterBackgroundJobCommand, decorators: [{
33
+ type: Injectable
34
+ }] });
35
+
36
+ export { ReplayDeadLetterBackgroundJobCommand };
37
+ //# sourceMappingURL=acorex-platform-module-background-job-management-client-replay-dead-letter.command-BM4NYBxr.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-background-job-management-client-replay-dead-letter.command-BM4NYBxr.mjs","sources":["../../../../libs/modules/background-job-management/client/src/lib/commands/replay-dead-letter.command.ts"],"sourcesContent":["import { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { Injectable, inject } from '@angular/core';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPBackgroundJobManagementClient } from '../background-job-management-client.port';\nimport { resolveBackgroundJobCommandError } from './background-job-command-error.util';\nimport { BackgroundJobCommandI18n } from './background-job-command.i18n';\n\nexport interface ReplayDeadLetterBackgroundJobInput {\n jobId: string;\n}\n\n@Injectable()\nexport class ReplayDeadLetterBackgroundJobCommand\n implements AXPCommand<ReplayDeadLetterBackgroundJobInput, { jobId: string }>\n{\n private readonly client = inject(AXPBackgroundJobManagementClient);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(raw: unknown): AXPCommandExecuteResultPromise<{ jobId: string }> {\n const wrapped = raw as { options?: ReplayDeadLetterBackgroundJobInput } & Record<string, unknown>;\n const input = (wrapped?.options ?? raw) as ReplayDeadLetterBackgroundJobInput;\n\n try {\n const result = await this.client.replayDeadLetter(input.jobId);\n return {\n success: true,\n kind: 'object',\n data: { jobId: result.jobId },\n message: { text: BackgroundJobCommandI18n.replayDeadLetter.success },\n };\n } catch (error) {\n const { messageKeyOrText } = await resolveBackgroundJobCommandError(\n this.translationService,\n error,\n BackgroundJobCommandI18n.replayDeadLetter.failed,\n );\n return { success: false, message: { text: messageKeyOrText } };\n }\n }\n}\n"],"names":[],"mappings":";;;;;;MAaa,oCAAoC,CAAA;AADjD,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,gCAAgC,CAAC;AACjD,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAuBnE,IAAA;IArBC,MAAM,OAAO,CAAC,GAAY,EAAA;QACxB,MAAM,OAAO,GAAG,GAAiF;QACjG,MAAM,KAAK,IAAI,OAAO,EAAE,OAAO,IAAI,GAAG,CAAuC;AAE7E,QAAA,IAAI;AACF,YAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,KAAK,CAAC;YAC9D,OAAO;AACL,gBAAA,OAAO,EAAE,IAAI;AACb,gBAAA,IAAI,EAAE,QAAQ;AACd,gBAAA,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE;gBAC7B,OAAO,EAAE,EAAE,IAAI,EAAE,wBAAwB,CAAC,gBAAgB,CAAC,OAAO,EAAE;aACrE;QACH;QAAE,OAAO,KAAK,EAAE;AACd,YAAA,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,gCAAgC,CACjE,IAAI,CAAC,kBAAkB,EACvB,KAAK,EACL,wBAAwB,CAAC,gBAAgB,CAAC,MAAM,CACjD;AACD,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE;QAChE;IACF;8GA1BW,oCAAoC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAApC,oCAAoC,EAAA,CAAA,CAAA;;2FAApC,oCAAoC,EAAA,UAAA,EAAA,CAAA;kBADhD;;;;;"}
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
2
2
  import { inject, Injectable } from '@angular/core';
3
3
  import { AXTranslationService } from '@acorex/core/translation';
4
4
  import { AXPBackgroundJobManagementClient } from './acorex-platform-module-background-job-management-client.mjs';
5
- import { B as BackgroundJobCommandI18n, r as resolveBackgroundJobCommandError } from './acorex-platform-module-background-job-management-client-background-job-command-error.util-BzDLhWRP.mjs';
5
+ import { B as BackgroundJobCommandI18n, r as resolveBackgroundJobCommandError } from './acorex-platform-module-background-job-management-client-background-job-command-error.util-BHBmSbvw.mjs';
6
6
 
7
7
  class RetryBackgroundJobCommand {
8
8
  constructor() {
@@ -29,4 +29,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
29
29
  }] });
30
30
 
31
31
  export { RetryBackgroundJobCommand };
32
- //# sourceMappingURL=acorex-platform-module-background-job-management-client-retry-background-job.command-BdJ_PC_y.mjs.map
32
+ //# sourceMappingURL=acorex-platform-module-background-job-management-client-retry-background-job.command-BBEAc_i7.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-background-job-management-client-retry-background-job.command-BdJ_PC_y.mjs","sources":["../../../../libs/modules/background-job-management/client/src/lib/commands/retry-background-job.command.ts"],"sourcesContent":["import { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { Injectable, inject } from '@angular/core';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPBackgroundJobManagementClient } from '../background-job-management-client.port';\nimport { resolveBackgroundJobCommandError } from './background-job-command-error.util';\nimport { BackgroundJobCommandI18n } from './background-job-command.i18n';\n\nexport interface RetryBackgroundJobInput {\n jobId: string;\n}\n\n@Injectable()\nexport class RetryBackgroundJobCommand implements AXPCommand<RetryBackgroundJobInput, { jobId: string }> {\n private readonly client = inject(AXPBackgroundJobManagementClient);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(raw: unknown): AXPCommandExecuteResultPromise<{ jobId: string }> {\n const wrapped = raw as { options?: RetryBackgroundJobInput } & Record<string, unknown>;\n const input = (wrapped?.options ?? raw) as RetryBackgroundJobInput;\n\n try {\n const result = await this.client.retryJob(input.jobId);\n return { success: true, kind: 'object', data: { jobId: result.jobId }, message: { text: BackgroundJobCommandI18n.retry.success } };\n } catch (error) {\n const { messageKeyOrText } = await resolveBackgroundJobCommandError(\n this.translationService,\n error,\n BackgroundJobCommandI18n.retry.failed,\n );\n return { success: false, message: { text: messageKeyOrText } };\n }\n }\n}\n"],"names":[],"mappings":";;;;;;MAaa,yBAAyB,CAAA;AADtC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,gCAAgC,CAAC;AACjD,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAkBnE,IAAA;IAhBC,MAAM,OAAO,CAAC,GAAY,EAAA;QACxB,MAAM,OAAO,GAAG,GAAsE;QACtF,MAAM,KAAK,IAAI,OAAO,EAAE,OAAO,IAAI,GAAG,CAA4B;AAElE,QAAA,IAAI;AACF,YAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;AACtD,YAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,wBAAwB,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE;QACpI;QAAE,OAAO,KAAK,EAAE;AACd,YAAA,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,gCAAgC,CACjE,IAAI,CAAC,kBAAkB,EACvB,KAAK,EACL,wBAAwB,CAAC,KAAK,CAAC,MAAM,CACtC;AACD,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE;QAChE;IACF;8GAnBW,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAzB,yBAAyB,EAAA,CAAA,CAAA;;2FAAzB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC;;;;;"}
1
+ {"version":3,"file":"acorex-platform-module-background-job-management-client-retry-background-job.command-BBEAc_i7.mjs","sources":["../../../../libs/modules/background-job-management/client/src/lib/commands/retry-background-job.command.ts"],"sourcesContent":["import { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { Injectable, inject } from '@angular/core';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPBackgroundJobManagementClient } from '../background-job-management-client.port';\nimport { resolveBackgroundJobCommandError } from './background-job-command-error.util';\nimport { BackgroundJobCommandI18n } from './background-job-command.i18n';\n\nexport interface RetryBackgroundJobInput {\n jobId: string;\n}\n\n@Injectable()\nexport class RetryBackgroundJobCommand implements AXPCommand<RetryBackgroundJobInput, { jobId: string }> {\n private readonly client = inject(AXPBackgroundJobManagementClient);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(raw: unknown): AXPCommandExecuteResultPromise<{ jobId: string }> {\n const wrapped = raw as { options?: RetryBackgroundJobInput } & Record<string, unknown>;\n const input = (wrapped?.options ?? raw) as RetryBackgroundJobInput;\n\n try {\n const result = await this.client.retryJob(input.jobId);\n return { success: true, kind: 'object', data: { jobId: result.jobId }, message: { text: BackgroundJobCommandI18n.retry.success } };\n } catch (error) {\n const { messageKeyOrText } = await resolveBackgroundJobCommandError(\n this.translationService,\n error,\n BackgroundJobCommandI18n.retry.failed,\n );\n return { success: false, message: { text: messageKeyOrText } };\n }\n }\n}\n"],"names":[],"mappings":";;;;;;MAaa,yBAAyB,CAAA;AADtC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,gCAAgC,CAAC;AACjD,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAkBnE,IAAA;IAhBC,MAAM,OAAO,CAAC,GAAY,EAAA;QACxB,MAAM,OAAO,GAAG,GAAsE;QACtF,MAAM,KAAK,IAAI,OAAO,EAAE,OAAO,IAAI,GAAG,CAA4B;AAElE,QAAA,IAAI;AACF,YAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;AACtD,YAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,wBAAwB,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE;QACpI;QAAE,OAAO,KAAK,EAAE;AACd,YAAA,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,gCAAgC,CACjE,IAAI,CAAC,kBAAkB,EACvB,KAAK,EACL,wBAAwB,CAAC,KAAK,CAAC,MAAM,CACtC;AACD,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE;QAChE;IACF;8GAnBW,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAzB,yBAAyB,EAAA,CAAA,CAAA;;2FAAzB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC;;;;;"}
@@ -6,7 +6,7 @@ import { AXToastService } from '@acorex/components/toast';
6
6
  import { AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';
7
7
  import { RootConfig } from '@acorex-platform/module-background-job-management-client/contracts';
8
8
  import { AXPBackgroundJobManagementClient } from './acorex-platform-module-background-job-management-client.mjs';
9
- import { B as BackgroundJobCommandI18n, r as resolveBackgroundJobCommandError } from './acorex-platform-module-background-job-management-client-background-job-command-error.util-BzDLhWRP.mjs';
9
+ import { B as BackgroundJobCommandI18n, r as resolveBackgroundJobCommandError } from './acorex-platform-module-background-job-management-client-background-job-command-error.util-BHBmSbvw.mjs';
10
10
 
11
11
  //#endregion
12
12
  //#region ----- Command -----
@@ -95,4 +95,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
95
95
  }] });
96
96
 
97
97
  export { RunScheduleNowCommand };
98
- //# sourceMappingURL=acorex-platform-module-background-job-management-client-run-schedule-now.command-orzJ7ZmD.mjs.map
98
+ //# sourceMappingURL=acorex-platform-module-background-job-management-client-run-schedule-now.command-5RV6hAnH.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-background-job-management-client-run-schedule-now.command-orzJ7ZmD.mjs","sources":["../../../../libs/modules/background-job-management/client/src/lib/commands/run-schedule-now.command.ts"],"sourcesContent":["import { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPCommonSettings, AXPSettingsService } from '@acorex-platform/framework-client/common';\nimport { AXPEntityBroadcastService } from '@acorex-platform/framework-client/core';\nimport { Injectable, inject } from '@angular/core';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';\nimport { RootConfig } from '@acorex-platform/module-background-job-management-client/contracts';\nimport { AXPBackgroundJobManagementClient } from '../background-job-management-client.port';\nimport { resolveBackgroundJobCommandError } from './background-job-command-error.util';\nimport { BackgroundJobCommandI18n } from './background-job-command.i18n';\n\n//#region ----- Types -----\n\nexport interface RunScheduleNowInput {\n scheduleId: string;\n}\n\ntype RunScheduleNowRaw = {\n options?: RunScheduleNowInput;\n data?: Record<string, unknown>;\n};\n\n//#endregion\n\n//#region ----- Command -----\n\n@Injectable()\nexport class RunScheduleNowCommand implements AXPCommand<RunScheduleNowInput, { jobId: string }> {\n //#region ----- Services & Dependencies -----\n\n private readonly client = inject(AXPBackgroundJobManagementClient);\n private readonly entityEvents = inject(AXPEntityBroadcastService);\n private readonly translationService = inject(AXTranslationService);\n private readonly toastService = inject(AXToastService);\n private readonly settingsService = inject(AXPSettingsService);\n\n //#endregion\n\n //#region ----- Constants -----\n\n private readonly scheduleEntityRef = RootConfig.entities.backgroundJobSchedule.fullName;\n\n //#endregion\n\n //#region ----- Execute -----\n\n async execute(raw: unknown): AXPCommandExecuteResultPromise<{ jobId: string }> {\n const payload = raw as RunScheduleNowRaw;\n const input = (payload?.options ?? raw) as RunScheduleNowInput;\n const scheduleName = this.resolveScheduleName(payload?.data, input.scheduleId);\n\n try {\n const result = await this.client.runScheduleNow(input.scheduleId);\n this.entityEvents.publishLayoutRefresh(this.scheduleEntityRef);\n this.entityEvents.publishDataReload(this.scheduleEntityRef);\n await this.showToast('success', BackgroundJobCommandI18n.runNow.successTitle, BackgroundJobCommandI18n.runNow.successDescription, {\n name: scheduleName,\n });\n return { success: true, kind: 'object', data: { jobId: result.jobId } };\n } catch (error) {\n const { messageKeyOrText, displayText } = await resolveBackgroundJobCommandError(\n this.translationService,\n error,\n BackgroundJobCommandI18n.runNow.failedDescription,\n );\n const content =\n messageKeyOrText === BackgroundJobCommandI18n.runNow.failedDescription\n ? BackgroundJobCommandI18n.runNow.failedDescription\n : displayText;\n await this.showToast('danger', BackgroundJobCommandI18n.runNow.failedTitle, content, {\n name: scheduleName,\n });\n return { success: false };\n }\n }\n\n //#endregion\n\n //#region ----- Toast & Labels -----\n\n private resolveScheduleName(data: unknown, scheduleId: string): string {\n const row = data as { title?: unknown; command?: { key?: string } } | null | undefined;\n if (!row) {\n return scheduleId;\n }\n\n const title = row.title;\n if (typeof title === 'string' && title.trim()) {\n return title.trim();\n }\n if (title && typeof title === 'object') {\n const resolved = resolveMultiLanguageString(title as never, this.translationService.getActiveLang())?.trim();\n if (resolved) {\n return resolved;\n }\n }\n\n const commandKey = row.command?.key;\n if (typeof commandKey === 'string' && commandKey.trim()) {\n return commandKey.trim();\n }\n\n return scheduleId;\n }\n\n private async showToast(\n color: 'success' | 'danger',\n titleKey: string,\n contentKeyOrText: string,\n params: { name: string },\n ): Promise<void> {\n const enabled = await this.settingsService.get<boolean>(AXPCommonSettings.EnableOperationToasts);\n if (!enabled) {\n return;\n }\n\n const title = await this.translationService.translateAsync(titleKey);\n const content = contentKeyOrText.startsWith('@')\n ? await this.translationService.translateAsync(contentKeyOrText, { params })\n : contentKeyOrText;\n\n this.toastService.show({\n color,\n title,\n content,\n timeOut: color === 'success' ? 4000 : 5000,\n });\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;AAuBA;AAEA;MAGa,qBAAqB,CAAA;AADlC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,gCAAgC,CAAC;AACjD,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,yBAAyB,CAAC;AAChD,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACjD,QAAA,IAAA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qB,CAAC;QAChG,IAAI,CAAC,OAAO,EAAE;YACZ;QACF;QAEA,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,QAAQ,CAAC;AACpE,QAAA,MAAM,OAAO,GAAG,gBAAgB,CAAC,UAAU,CAAC,GAAG;AAC7C,cAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,gBAAgB,EAAE,EAAE,MAAM,EAAE;cACzE,gBAAgB;AAEpB,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;YACrB,KAAK;YACL,KAAK;YACL,OAAO;YACP,OAAO,EAAE,KAAK,KAAK,SAAS,GAAG,IAAI,GAAG,IAAI;AAC3C,SAAA,CAAC;IACJ;8GApGW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAArB,qBAAqB,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBADjC;;;;;"}
1
+ {"version":3,"file":"acorex-platform-module-background-job-management-client-run-schedule-now.command-5RV6hAnH.mjs","sources":["../../../../libs/modules/background-job-management/client/src/lib/commands/run-schedule-now.command.ts"],"sourcesContent":["import { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPCommonSettings, AXPSettingsService } from '@acorex-platform/framework-client/common';\nimport { AXPEntityBroadcastService } from '@acorex-platform/framework-client/core';\nimport { Injectable, inject } from '@angular/core';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';\nimport { RootConfig } from '@acorex-platform/module-background-job-management-client/contracts';\nimport { AXPBackgroundJobManagementClient } from '../background-job-management-client.port';\nimport { resolveBackgroundJobCommandError } from './background-job-command-error.util';\nimport { BackgroundJobCommandI18n } from './background-job-command.i18n';\n\n//#region ----- Types -----\n\nexport interface RunScheduleNowInput {\n scheduleId: string;\n}\n\ntype RunScheduleNowRaw = {\n options?: RunScheduleNowInput;\n data?: Record<string, unknown>;\n};\n\n//#endregion\n\n//#region ----- Command -----\n\n@Injectable()\nexport class RunScheduleNowCommand implements AXPCommand<RunScheduleNowInput, { jobId: string }> {\n //#region ----- Services & Dependencies -----\n\n private readonly client = inject(AXPBackgroundJobManagementClient);\n private readonly entityEvents = inject(AXPEntityBroadcastService);\n private readonly translationService = inject(AXTranslationService);\n private readonly toastService = inject(AXToastService);\n private readonly settingsService = inject(AXPSettingsService);\n\n //#endregion\n\n //#region ----- Constants -----\n\n private readonly scheduleEntityRef = RootConfig.entities.backgroundJobSchedule.fullName;\n\n //#endregion\n\n //#region ----- Execute -----\n\n async execute(raw: unknown): AXPCommandExecuteResultPromise<{ jobId: string }> {\n const payload = raw as RunScheduleNowRaw;\n const input = (payload?.options ?? raw) as RunScheduleNowInput;\n const scheduleName = this.resolveScheduleName(payload?.data, input.scheduleId);\n\n try {\n const result = await this.client.runScheduleNow(input.scheduleId);\n this.entityEvents.publishLayoutRefresh(this.scheduleEntityRef);\n this.entityEvents.publishDataReload(this.scheduleEntityRef);\n await this.showToast('success', BackgroundJobCommandI18n.runNow.successTitle, BackgroundJobCommandI18n.runNow.successDescription, {\n name: scheduleName,\n });\n return { success: true, kind: 'object', data: { jobId: result.jobId } };\n } catch (error) {\n const { messageKeyOrText, displayText } = await resolveBackgroundJobCommandError(\n this.translationService,\n error,\n BackgroundJobCommandI18n.runNow.failedDescription,\n );\n const content =\n messageKeyOrText === BackgroundJobCommandI18n.runNow.failedDescription\n ? BackgroundJobCommandI18n.runNow.failedDescription\n : displayText;\n await this.showToast('danger', BackgroundJobCommandI18n.runNow.failedTitle, content, {\n name: scheduleName,\n });\n return { success: false };\n }\n }\n\n //#endregion\n\n //#region ----- Toast & Labels -----\n\n private resolveScheduleName(data: unknown, scheduleId: string): string {\n const row = data as { title?: unknown; command?: { key?: string } } | null | undefined;\n if (!row) {\n return scheduleId;\n }\n\n const title = row.title;\n if (typeof title === 'string' && title.trim()) {\n return title.trim();\n }\n if (title && typeof title === 'object') {\n const resolved = resolveMultiLanguageString(title as never, this.translationService.getActiveLang())?.trim();\n if (resolved) {\n return resolved;\n }\n }\n\n const commandKey = row.command?.key;\n if (typeof commandKey === 'string' && commandKey.trim()) {\n return commandKey.trim();\n }\n\n return scheduleId;\n }\n\n private async showToast(\n color: 'success' | 'danger',\n titleKey: string,\n contentKeyOrText: string,\n params: { name: string },\n ): Promise<void> {\n const enabled = await this.settingsService.get<boolean>(AXPCommonSettings.EnableOperationToasts);\n if (!enabled) {\n return;\n }\n\n const title = await this.translationService.translateAsync(titleKey);\n const content = contentKeyOrText.startsWith('@')\n ? await this.translationService.translateAsync(contentKeyOrText, { params })\n : contentKeyOrText;\n\n this.toastService.show({\n color,\n title,\n content,\n timeOut: color === 'success' ? 4000 : 5000,\n });\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;AAuBA;AAEA;MAGa,qBAAqB,CAAA;AADlC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,gCAAgC,CAAC;AACjD,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,yBAAyB,CAAC;AAChD,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACjD,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,kBAAkB,CAAC;;;QAM5C,IAAA,CAAA,iBAAiB,GAAG,UAAU,CAAC,QAAQ,CAAC,qBAAqB,CAAC,QAAQ;AA0FxF,IAAA;;;IApFC,MAAM,OAAO,CAAC,GAAY,EAAA;QACxB,MAAM,OAAO,GAAG,GAAwB;QACxC,MAAM,KAAK,IAAI,OAAO,EAAE,OA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,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;YACrB,KAAK;YACL,KAAK;YACL,OAAO;YACP,OAAO,EAAE,KAAK,KAAK,SAAS,GAAG,IAAI,GAAG,IAAI;AAC3C,SAAA,CAAC;IACJ;8GApGW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAArB,qBAAqB,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBADjC;;;;;"}
@@ -0,0 +1,27 @@
1
+ import { AXPBackgroundOperationService } from '@acorex-platform/framework-client/common';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, Injectable } from '@angular/core';
4
+
5
+ class BackgroundJobTrayExecuteClickCommand {
6
+ constructor() {
7
+ this.operations = inject(AXPBackgroundOperationService);
8
+ }
9
+ async execute(raw) {
10
+ const wrapped = raw;
11
+ const input = (wrapped?.options ?? raw);
12
+ const operationId = (input.operationId ?? input.jobId ?? input.id)?.trim();
13
+ if (!operationId) {
14
+ return { success: false, message: { text: 'operationId is required.' } };
15
+ }
16
+ await this.operations.executeClick(operationId);
17
+ return { success: true, kind: 'object', data: undefined };
18
+ }
19
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BackgroundJobTrayExecuteClickCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
20
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BackgroundJobTrayExecuteClickCommand }); }
21
+ }
22
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BackgroundJobTrayExecuteClickCommand, decorators: [{
23
+ type: Injectable
24
+ }] });
25
+
26
+ export { BackgroundJobTrayExecuteClickCommand };
27
+ //# sourceMappingURL=acorex-platform-module-background-job-management-client-tray-execute-click.command-CEVhvrDQ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-background-job-management-client-tray-execute-click.command-CEVhvrDQ.mjs","sources":["../../../../libs/modules/background-job-management/client/src/lib/commands/tray-execute-click.command.ts"],"sourcesContent":["import { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPBackgroundOperationService } from '@acorex-platform/framework-client/common';\nimport { Injectable, inject } from '@angular/core';\n\nexport interface TrayExecuteClickInput {\n operationId?: string;\n jobId?: string;\n id?: string;\n}\n\n@Injectable()\nexport class BackgroundJobTrayExecuteClickCommand implements AXPCommand<TrayExecuteClickInput, void> {\n private readonly operations = inject(AXPBackgroundOperationService);\n\n async execute(raw: unknown): AXPCommandExecuteResultPromise<void> {\n const wrapped = raw as { options?: TrayExecuteClickInput } & Record<string, unknown>;\n const input = (wrapped?.options ?? raw) as TrayExecuteClickInput;\n const operationId = (input.operationId ?? input.jobId ?? input.id)?.trim();\n if (!operationId) {\n return { success: false, message: { text: 'operationId is required.' } };\n }\n\n await this.operations.executeClick(operationId);\n return { success: true, kind: 'object', data: undefined };\n }\n}\n"],"names":[],"mappings":";;;;MAWa,oCAAoC,CAAA;AADjD,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,6BAA6B,CAAC;AAapE,IAAA;IAXC,MAAM,OAAO,CAAC,GAAY,EAAA;QACxB,MAAM,OAAO,GAAG,GAAoE;QACpF,MAAM,KAAK,IAAI,OAAO,EAAE,OAAO,IAAI,GAAG,CAA0B;AAChE,QAAA,MAAM,WAAW,GAAG,CAAC,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,EAAE,GAAG,IAAI,EAAE;QAC1E,IAAI,CAAC,WAAW,EAAE;AAChB,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE,EAAE;QAC1E;QAEA,MAAM,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,WAAW,CAAC;AAC/C,QAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;IAC3D;8GAbW,oCAAoC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAApC,oCAAoC,EAAA,CAAA,CAAA;;2FAApC,oCAAoC,EAAA,UAAA,EAAA,CAAA;kBADhD;;;;;"}
@@ -0,0 +1,38 @@
1
+ import { AXPBackgroundOperationService } from '@acorex-platform/framework-client/common';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, Injectable } from '@angular/core';
4
+
5
+ const TRAY_ACTIONS = new Set([
6
+ 'cancel',
7
+ 'pause',
8
+ 'resume',
9
+ 'retry',
10
+ 'dismiss',
11
+ ]);
12
+ class BackgroundJobTrayRunActionCommand {
13
+ constructor() {
14
+ this.operations = inject(AXPBackgroundOperationService);
15
+ }
16
+ async execute(raw) {
17
+ const wrapped = raw;
18
+ const input = (wrapped?.options ?? raw);
19
+ const operationId = (input.operationId ?? input.jobId ?? input.id)?.trim();
20
+ const action = input.action?.trim();
21
+ if (!operationId) {
22
+ return { success: false, message: { text: 'operationId is required.' } };
23
+ }
24
+ if (!action || !TRAY_ACTIONS.has(action)) {
25
+ return { success: false, message: { text: 'A valid tray action is required.' } };
26
+ }
27
+ await this.operations.runAction(operationId, action);
28
+ return { success: true, kind: 'object', data: undefined };
29
+ }
30
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BackgroundJobTrayRunActionCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
31
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BackgroundJobTrayRunActionCommand }); }
32
+ }
33
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BackgroundJobTrayRunActionCommand, decorators: [{
34
+ type: Injectable
35
+ }] });
36
+
37
+ export { BackgroundJobTrayRunActionCommand };
38
+ //# sourceMappingURL=acorex-platform-module-background-job-management-client-tray-run-action.command-B9SFMGxf.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-background-job-management-client-tray-run-action.command-B9SFMGxf.mjs","sources":["../../../../libs/modules/background-job-management/client/src/lib/commands/tray-run-action.command.ts"],"sourcesContent":["import { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n AXPBackgroundOperationService,\n type AXPBackgroundOperationActionKey,\n} from '@acorex-platform/framework-client/common';\nimport { Injectable, inject } from '@angular/core';\n\nconst TRAY_ACTIONS = new Set<AXPBackgroundOperationActionKey>([\n 'cancel',\n 'pause',\n 'resume',\n 'retry',\n 'dismiss',\n]);\n\nexport interface TrayRunActionInput {\n operationId?: string;\n jobId?: string;\n id?: string;\n action?: string;\n}\n\n@Injectable()\nexport class BackgroundJobTrayRunActionCommand implements AXPCommand<TrayRunActionInput, void> {\n private readonly operations = inject(AXPBackgroundOperationService);\n\n async execute(raw: unknown): AXPCommandExecuteResultPromise<void> {\n const wrapped = raw as { options?: TrayRunActionInput } & Record<string, unknown>;\n const input = (wrapped?.options ?? raw) as TrayRunActionInput;\n const operationId = (input.operationId ?? input.jobId ?? input.id)?.trim();\n const action = input.action?.trim() as AXPBackgroundOperationActionKey | undefined;\n if (!operationId) {\n return { success: false, message: { text: 'operationId is required.' } };\n }\n if (!action || !TRAY_ACTIONS.has(action)) {\n return { success: false, message: { text: 'A valid tray action is required.' } };\n }\n\n await this.operations.runAction(operationId, action);\n return { success: true, kind: 'object', data: undefined };\n }\n}\n"],"names":[],"mappings":";;;;AAOA,MAAM,YAAY,GAAG,IAAI,GAAG,CAAkC;IAC5D,QAAQ;IACR,OAAO;IACP,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