@acorex-platform/framework-client 0.0.15 → 0.0.20
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.
- package/fesm2022/acorex-platform-framework-client-auth.mjs +872 -314
- package/fesm2022/acorex-platform-framework-client-auth.mjs.map +1 -1
- package/fesm2022/{acorex-platform-framework-client-common-common-settings.provider-Euotv9l0.mjs → acorex-platform-framework-client-common-common-settings.provider-CLm2BVk-.mjs} +88 -5
- package/fesm2022/acorex-platform-framework-client-common-common-settings.provider-CLm2BVk-.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-common.mjs +2685 -898
- package/fesm2022/acorex-platform-framework-client-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-core.mjs +691 -823
- package/fesm2022/acorex-platform-framework-client-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-domain.mjs +16 -16
- package/fesm2022/acorex-platform-framework-client-layout-builder.mjs +181 -84
- package/fesm2022/acorex-platform-framework-client-layout-builder.mjs.map +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-components-binding-expression-editor-popup.component-CjnQ9hAJ.mjs → acorex-platform-framework-client-layout-components-binding-expression-editor-popup.component-oE8CeLE8.mjs} +8 -6
- package/fesm2022/{acorex-platform-framework-client-layout-components-binding-expression-editor-popup.component-CjnQ9hAJ.mjs.map → acorex-platform-framework-client-layout-components-binding-expression-editor-popup.component-oE8CeLE8.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-components-file-provider-picker.popup.component-fFen8w8M.mjs → acorex-platform-framework-client-layout-components-file-provider-picker.popup.component-BtLEUWAA.mjs} +4 -4
- package/fesm2022/{acorex-platform-framework-client-layout-components-file-provider-picker.popup.component-fFen8w8M.mjs.map → acorex-platform-framework-client-layout-components-file-provider-picker.popup.component-BtLEUWAA.mjs.map} +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-components.mjs +3300 -1236
- package/fesm2022/acorex-platform-framework-client-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-designer.mjs +277 -185
- package/fesm2022/acorex-platform-framework-client-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-entity-acorex-platform-framework-client-layout-entity-BXOMs6oD.mjs +29184 -0
- package/fesm2022/acorex-platform-framework-client-layout-entity-acorex-platform-framework-client-layout-entity-BXOMs6oD.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-layout-entity-attachments-page.component-BzUM-JMC.mjs → acorex-platform-framework-client-layout-entity-attachments-page.component-DCK-qb-F.mjs} +34 -20
- package/fesm2022/acorex-platform-framework-client-layout-entity-attachments-page.component-DCK-qb-F.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-layout-entity-bulk-entity.command-Cs3agnpF.mjs +162 -0
- package/fesm2022/acorex-platform-framework-client-layout-entity-bulk-entity.command-Cs3agnpF.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-layout-entity-file-list-popup.component-Ci_CTFtq.mjs → acorex-platform-framework-client-layout-entity-file-list-popup.component-p0hxDb0W.mjs} +31 -19
- package/fesm2022/acorex-platform-framework-client-layout-entity-file-list-popup.component-p0hxDb0W.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-layout-entity-gallery-page.component-DmiB__JR.mjs → acorex-platform-framework-client-layout-entity-gallery-page.component-DYV9YPyw.mjs} +30 -18
- package/fesm2022/acorex-platform-framework-client-layout-entity-gallery-page.component-DYV9YPyw.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-layout-entity.mjs +2 -26780
- package/fesm2022/acorex-platform-framework-client-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-views.mjs +421 -151
- package/fesm2022/acorex-platform-framework-client-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-widget-core.mjs +673 -287
- package/fesm2022/acorex-platform-framework-client-layout-widget-core.mjs.map +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-button-widget-designer.component-CIwpAXbL.mjs → acorex-platform-framework-client-layout-widgets-button-widget-designer.component-BiWerYcu.mjs} +16 -10
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-button-widget-designer.component-CIwpAXbL.mjs.map → acorex-platform-framework-client-layout-widgets-button-widget-designer.component-BiWerYcu.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-image-preview.popup-CazpERbX.mjs → acorex-platform-framework-client-layout-widgets-image-preview.popup-BOrrMm3U.mjs} +9 -8
- package/fesm2022/acorex-platform-framework-client-layout-widgets-image-preview.popup-BOrrMm3U.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-page-widget-designer.component-DKkJi40s.mjs → acorex-platform-framework-client-layout-widgets-page-widget-designer.component-WzIiwnGC.mjs} +20 -12
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-page-widget-designer.component-DKkJi40s.mjs.map → acorex-platform-framework-client-layout-widgets-page-widget-designer.component-WzIiwnGC.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-DtYZfA79.mjs → acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-3CO4xJB3.mjs} +32 -18
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-DtYZfA79.mjs.map → acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-3CO4xJB3.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-tabular-data-edit-popup.component-nMUtxAyy.mjs → acorex-platform-framework-client-layout-widgets-tabular-data-edit-popup.component-CRST84ou.mjs} +8 -7
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-tabular-data-edit-popup.component-nMUtxAyy.mjs.map → acorex-platform-framework-client-layout-widgets-tabular-data-edit-popup.component-CRST84ou.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-tabular-data-view-popup.component-DvUSZ4hJ.mjs → acorex-platform-framework-client-layout-widgets-tabular-data-view-popup.component-FjtSRxIX.mjs} +4 -4
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-tabular-data-view-popup.component-DvUSZ4hJ.mjs.map → acorex-platform-framework-client-layout-widgets-tabular-data-view-popup.component-FjtSRxIX.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-BihIfkZW.mjs → acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-D6HFPmGC.mjs} +10 -8
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-BihIfkZW.mjs.map → acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-D6HFPmGC.mjs.map} +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-widgets.mjs +4907 -2554
- package/fesm2022/acorex-platform-framework-client-layout-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-native.mjs +7 -7
- package/fesm2022/acorex-platform-framework-client-realtime-set-presence-availability.command-CetlUjnM.mjs +29 -0
- package/fesm2022/acorex-platform-framework-client-realtime-set-presence-availability.command-CetlUjnM.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-realtime.mjs +463 -26
- package/fesm2022/acorex-platform-framework-client-realtime.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-runtime.mjs +300 -137
- package/fesm2022/acorex-platform-framework-client-runtime.mjs.map +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-default-entity-master-create-view.component-QIFX11dh.mjs → acorex-platform-framework-client-themes-default-entity-master-create-view.component-yeftgJ_K.mjs} +10 -7
- package/fesm2022/{acorex-platform-framework-client-themes-default-entity-master-create-view.component-QIFX11dh.mjs.map → acorex-platform-framework-client-themes-default-entity-master-create-view.component-yeftgJ_K.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-default-entity-master-modify-view.component-BBdellyL.mjs → acorex-platform-framework-client-themes-default-entity-master-modify-view.component-DWE3OWGm.mjs} +10 -7
- package/fesm2022/{acorex-platform-framework-client-themes-default-entity-master-modify-view.component-BBdellyL.mjs.map → acorex-platform-framework-client-themes-default-entity-master-modify-view.component-DWE3OWGm.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-default-entity-master-single-view.component-CIf1VWNW.mjs → acorex-platform-framework-client-themes-default-entity-master-single-view.component-C2Abf7Lb.mjs} +21 -19
- package/fesm2022/acorex-platform-framework-client-themes-default-entity-master-single-view.component-C2Abf7Lb.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-themes-default-error-401.component-C_czT_JC.mjs → acorex-platform-framework-client-themes-default-error-401.component-BrTotLx1.mjs} +5 -5
- package/fesm2022/{acorex-platform-framework-client-themes-default-error-401.component-C_czT_JC.mjs.map → acorex-platform-framework-client-themes-default-error-401.component-BrTotLx1.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-default-error-404.component-C2Wu0YtF.mjs → acorex-platform-framework-client-themes-default-error-404.component-DsC7_s59.mjs} +5 -5
- package/fesm2022/{acorex-platform-framework-client-themes-default-error-404.component-C2Wu0YtF.mjs.map → acorex-platform-framework-client-themes-default-error-404.component-DsC7_s59.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-default-error-offline.component-DRz-kVsT.mjs → acorex-platform-framework-client-themes-default-error-offline.component-CngiQycG.mjs} +6 -6
- package/fesm2022/acorex-platform-framework-client-themes-default-error-offline.component-CngiQycG.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-themes-default.mjs +448 -277
- package/fesm2022/acorex-platform-framework-client-themes-default.mjs.map +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-shared-icon-chooser-column.component-Ci_oH7NE.mjs → acorex-platform-framework-client-themes-shared-icon-chooser-column.component-CbZALjB5.mjs} +8 -6
- package/fesm2022/{acorex-platform-framework-client-themes-shared-icon-chooser-column.component-Ci_oH7NE.mjs.map → acorex-platform-framework-client-themes-shared-icon-chooser-column.component-CbZALjB5.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-shared-icon-chooser-view.component-Lb1G2Xz7.mjs → acorex-platform-framework-client-themes-shared-icon-chooser-view.component-BRrNT6x2.mjs} +8 -6
- package/fesm2022/{acorex-platform-framework-client-themes-shared-icon-chooser-view.component-Lb1G2Xz7.mjs.map → acorex-platform-framework-client-themes-shared-icon-chooser-view.component-BRrNT6x2.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-shared-theme-color-chooser-column.component-D4ubvFYf.mjs → acorex-platform-framework-client-themes-shared-theme-color-chooser-column.component-BIsQTr6B.mjs} +4 -4
- package/fesm2022/{acorex-platform-framework-client-themes-shared-theme-color-chooser-column.component-D4ubvFYf.mjs.map → acorex-platform-framework-client-themes-shared-theme-color-chooser-column.component-BIsQTr6B.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-shared-theme-color-chooser-view.component-Br8j_BF_.mjs → acorex-platform-framework-client-themes-shared-theme-color-chooser-view.component-ZclmSbt9.mjs} +16 -10
- package/fesm2022/{acorex-platform-framework-client-themes-shared-theme-color-chooser-view.component-Br8j_BF_.mjs.map → acorex-platform-framework-client-themes-shared-theme-color-chooser-view.component-ZclmSbt9.mjs.map} +1 -1
- package/fesm2022/acorex-platform-framework-client-themes-shared.mjs +538 -133
- package/fesm2022/acorex-platform-framework-client-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-workflow.mjs +26 -66
- package/fesm2022/acorex-platform-framework-client-workflow.mjs.map +1 -1
- package/package.json +10 -10
- package/realtime/README.md +16 -0
- package/runtime/README.md +14 -0
- package/types/acorex-platform-framework-client-auth.d.ts +291 -52
- package/types/acorex-platform-framework-client-common.d.ts +615 -202
- package/types/acorex-platform-framework-client-core.d.ts +215 -225
- package/types/acorex-platform-framework-client-layout-builder.d.ts +24 -8
- package/types/acorex-platform-framework-client-layout-components.d.ts +407 -94
- package/types/acorex-platform-framework-client-layout-entity.d.ts +734 -411
- package/types/acorex-platform-framework-client-layout-views.d.ts +40 -15
- package/types/acorex-platform-framework-client-layout-widget-core.d.ts +66 -17
- package/types/acorex-platform-framework-client-layout-widgets.d.ts +295 -68
- package/types/acorex-platform-framework-client-realtime.d.ts +183 -6
- package/types/acorex-platform-framework-client-runtime.d.ts +134 -28
- package/types/acorex-platform-framework-client-themes-default.d.ts +9 -1
- package/types/acorex-platform-framework-client-themes-shared.d.ts +8 -2
- package/types/acorex-platform-framework-client-workflow.d.ts +12 -37
- package/fesm2022/acorex-platform-framework-client-common-common-settings.provider-Euotv9l0.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-layout-entity-attachments-page.component-BzUM-JMC.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-layout-entity-file-list-popup.component-Ci_CTFtq.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-layout-entity-gallery-page.component-DmiB__JR.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-layout-widgets-image-preview.popup-CazpERbX.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-themes-default-entity-master-single-view.component-CIf1VWNW.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-themes-default-error-offline.component-DRz-kVsT.mjs.map +0 -1
|
@@ -1,8 +1,62 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, Injectable, InjectionToken, EnvironmentInjector, runInInjectionContext, makeEnvironmentProviders, input, ElementRef, effect, Directive, isDevMode, NgModule } from '@angular/core';
|
|
3
|
-
import { AXPBroadcastEventService, AXPDistributedEventListenerService,
|
|
3
|
+
import { AXPHookService, AXPBroadcastEventService, AXPDistributedEventListenerService, AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER } from '@acorex-platform/framework-client/core';
|
|
4
|
+
import { normalizeCommandInputForRemote, composeCommandMiddlewares, composeQueryMiddlewares } from '@acorex-platform/framework-shared/runtime';
|
|
5
|
+
export { composeCommandMiddlewares, composeQueryMiddlewares } from '@acorex-platform/framework-shared/runtime';
|
|
4
6
|
import { castArray } from 'lodash-es';
|
|
5
7
|
|
|
8
|
+
//#region ---- Runtime remote execute hooks ----
|
|
9
|
+
/**
|
|
10
|
+
* Distributed hook keys for remote (non-local) command/query execution.
|
|
11
|
+
* Connectivity (or another transport) implements these via {@link AXPHookService.runAsync}.
|
|
12
|
+
*
|
|
13
|
+
* Host apps that only consume the client lib and call a different API stack should
|
|
14
|
+
* register {@link provideExternalRuntimeBulkTransport} for {@link AXPRuntimeRemoteHookKeys.CommandExecuteBulk}
|
|
15
|
+
* (see `RUNTIME_REMOTE_BULK_TRANSPORT.md`).
|
|
16
|
+
*/
|
|
17
|
+
const AXPRuntimeRemoteHookKeys = {
|
|
18
|
+
CommandExecute: 'runtime.command.execute',
|
|
19
|
+
CommandExecuteBulk: 'runtime.command.execute-bulk',
|
|
20
|
+
QueryExecute: 'runtime.query.execute',
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
|
|
24
|
+
//#region ---- Imports ----
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region ---- Bulk command client ----
|
|
27
|
+
/**
|
|
28
|
+
* Invokes filter-only bulk execution via the remote hook transport
|
|
29
|
+
* (`runtime.command.execute-bulk`).
|
|
30
|
+
*
|
|
31
|
+
* Default connectivity posts to `/v1/runtime/commands/bulk`. Host apps on another
|
|
32
|
+
* API stack should register {@link provideExternalRuntimeBulkTransport} instead —
|
|
33
|
+
* this service never fans out one-by-one on the client.
|
|
34
|
+
*/
|
|
35
|
+
class AXPBulkCommandService {
|
|
36
|
+
constructor() {
|
|
37
|
+
this.hooks = inject(AXPHookService);
|
|
38
|
+
}
|
|
39
|
+
async execute(request) {
|
|
40
|
+
const payload = await this.hooks.runAsync(AXPRuntimeRemoteHookKeys.CommandExecuteBulk, { request });
|
|
41
|
+
if (!payload.handled) {
|
|
42
|
+
throw new Error('Bulk command remote handler is not available');
|
|
43
|
+
}
|
|
44
|
+
return (payload.result ?? {
|
|
45
|
+
success: false,
|
|
46
|
+
message: {
|
|
47
|
+
text: 'Bulk command returned no result.',
|
|
48
|
+
details: { total: 0, succeeded: 0, failed: 0, results: [] },
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPBulkCommandService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
53
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPBulkCommandService, providedIn: 'root' }); }
|
|
54
|
+
}
|
|
55
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPBulkCommandService, decorators: [{
|
|
56
|
+
type: Injectable,
|
|
57
|
+
args: [{ providedIn: 'root' }]
|
|
58
|
+
}] });
|
|
59
|
+
|
|
6
60
|
//#region ---- Imports ----
|
|
7
61
|
//#endregion
|
|
8
62
|
const COMMAND_EXECUTION_EVENT_KEY = '@commands:execution';
|
|
@@ -89,32 +143,14 @@ class AXPCommandEventsService {
|
|
|
89
143
|
};
|
|
90
144
|
return walk(value);
|
|
91
145
|
}
|
|
92
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
93
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
146
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPCommandEventsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
147
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPCommandEventsService, providedIn: 'root' }); }
|
|
94
148
|
}
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
149
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPCommandEventsService, decorators: [{
|
|
96
150
|
type: Injectable,
|
|
97
151
|
args: [{ providedIn: 'root' }]
|
|
98
152
|
}] });
|
|
99
153
|
|
|
100
|
-
//#endregion
|
|
101
|
-
//#region ---- Middleware Composition ----
|
|
102
|
-
/**
|
|
103
|
-
* Creates a composed handler by chaining the provided command middlewares.
|
|
104
|
-
*/
|
|
105
|
-
function composeCommandMiddlewares(middlewares) {
|
|
106
|
-
return (handler) => {
|
|
107
|
-
let composed = handler;
|
|
108
|
-
for (let i = middlewares.length - 1; i >= 0; i--) {
|
|
109
|
-
const mw = middlewares[i];
|
|
110
|
-
const next = composed;
|
|
111
|
-
composed = (input) => mw(input, next);
|
|
112
|
-
}
|
|
113
|
-
return composed;
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
//#endregion
|
|
117
|
-
|
|
118
154
|
class AXPCommandRegistry {
|
|
119
155
|
constructor() {
|
|
120
156
|
this.registry = new Map();
|
|
@@ -145,10 +181,10 @@ class AXPCommandRegistry {
|
|
|
145
181
|
this.registry.clear();
|
|
146
182
|
this.middlewares.length = 0;
|
|
147
183
|
}
|
|
148
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
149
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
184
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPCommandRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
185
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPCommandRegistry, providedIn: 'root' }); }
|
|
150
186
|
}
|
|
151
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
187
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPCommandRegistry, decorators: [{
|
|
152
188
|
type: Injectable,
|
|
153
189
|
args: [{ providedIn: 'root' }]
|
|
154
190
|
}] });
|
|
@@ -156,17 +192,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
156
192
|
// plugins/command.extension.token.ts
|
|
157
193
|
const AXP_COMMAND_EXTENSION = new InjectionToken('AXP_COMMAND_EXTENSION');
|
|
158
194
|
|
|
159
|
-
//#region ---- Runtime remote execute hooks ----
|
|
160
|
-
/**
|
|
161
|
-
* Distributed hook keys for remote (non-local) command/query execution.
|
|
162
|
-
* Connectivity (or another transport) implements these via {@link AXPHookService.runAsync}.
|
|
163
|
-
*/
|
|
164
|
-
const AXPRuntimeRemoteHookKeys = {
|
|
165
|
-
CommandExecute: 'runtime.command.execute',
|
|
166
|
-
QueryExecute: 'runtime.query.execute',
|
|
167
|
-
};
|
|
168
|
-
//#endregion
|
|
169
|
-
|
|
170
195
|
class AXPCommandExecutor {
|
|
171
196
|
constructor() {
|
|
172
197
|
this.injector = inject(EnvironmentInjector);
|
|
@@ -175,40 +200,59 @@ class AXPCommandExecutor {
|
|
|
175
200
|
this.commandEvents = inject(AXPCommandEventsService);
|
|
176
201
|
this.hooks = inject(AXPHookService);
|
|
177
202
|
}
|
|
178
|
-
async execute(key, input) {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
return this.
|
|
203
|
+
async execute(key, input, options) {
|
|
204
|
+
const handler = this.registry.exists(key)
|
|
205
|
+
? await this.createLocalHandler(key)
|
|
206
|
+
: this.createRemoteHandler(key);
|
|
207
|
+
return this.runWithMiddlewareAndEvents(key, input, handler, options);
|
|
183
208
|
}
|
|
184
|
-
|
|
209
|
+
/**
|
|
210
|
+
* Always dispatch via {@link AXPRuntimeRemoteHookKeys.CommandExecute}, even when a local
|
|
211
|
+
* command is registered for the same key. Use from gateway/API clients that wrap remote
|
|
212
|
+
* handlers so local UI commands can call them without async recursion.
|
|
213
|
+
*
|
|
214
|
+
* Skips command middlewares (e.g. toast): the local wrapper owns UX. Running toast
|
|
215
|
+
* middleware here would double-notify when the wrapper also returns a failure message.
|
|
216
|
+
*/
|
|
217
|
+
async executeRemote(key, input, options) {
|
|
218
|
+
return this.runWithEvents(key, input, () => this.createRemoteHandler(key)(input, options), options);
|
|
219
|
+
}
|
|
220
|
+
async createLocalHandler(key) {
|
|
185
221
|
const loader = this.registry.getLoader(key);
|
|
186
222
|
if (!loader) {
|
|
187
223
|
throw new Error(`Command '${key}' is not registered`);
|
|
188
224
|
}
|
|
189
225
|
const command = await loader();
|
|
190
|
-
|
|
226
|
+
return (i) => command.execute(i);
|
|
227
|
+
}
|
|
228
|
+
createRemoteHandler(key) {
|
|
229
|
+
return async (input, options) => {
|
|
230
|
+
const payload = await this.hooks.runAsync(AXPRuntimeRemoteHookKeys.CommandExecute, {
|
|
231
|
+
name: key,
|
|
232
|
+
input: normalizeCommandInputForRemote(input),
|
|
233
|
+
options,
|
|
234
|
+
});
|
|
235
|
+
if (!payload.handled) {
|
|
236
|
+
throw new Error(`Command '${key}' is not registered and no remote handler is available`);
|
|
237
|
+
}
|
|
238
|
+
return (payload.result ?? null);
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
async runWithMiddlewareAndEvents(key, input, handler, options) {
|
|
191
242
|
const pluginMiddlewares = this.getPluginMiddlewares(key);
|
|
192
243
|
const globalMiddlewares = this.registry.getMiddlewares();
|
|
244
|
+
// Registry middlewares are untyped (any); re-wrap in injection context.
|
|
193
245
|
const wrappedMiddlewares = [
|
|
194
246
|
...globalMiddlewares,
|
|
195
247
|
...pluginMiddlewares,
|
|
196
248
|
].map((middleware) => {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
const composed = composeCommandMiddlewares(wrappedMiddlewares)(handler);
|
|
200
|
-
return this.runWithEvents(key, input, () => composed(input));
|
|
201
|
-
}
|
|
202
|
-
async executeRemote(key, input) {
|
|
203
|
-
return this.runWithEvents(key, input, async () => {
|
|
204
|
-
const payload = await this.hooks.runAsync(AXPRuntimeRemoteHookKeys.CommandExecute, { name: key, input });
|
|
205
|
-
if (!payload.handled) {
|
|
206
|
-
throw new Error(`Command '${key}' is not registered and no remote handler is available`);
|
|
207
|
-
}
|
|
208
|
-
return (payload.result ?? null);
|
|
249
|
+
const wrapped = (context, next) => runInInjectionContext(this.injector, () => middleware(context, next));
|
|
250
|
+
return wrapped;
|
|
209
251
|
});
|
|
252
|
+
const composed = composeCommandMiddlewares(wrappedMiddlewares)((context) => handler(context.input, context.options));
|
|
253
|
+
return this.runWithEvents(key, input, () => composed({ input, key, options }), options);
|
|
210
254
|
}
|
|
211
|
-
async runWithEvents(key, input, run) {
|
|
255
|
+
async runWithEvents(key, input, run, options) {
|
|
212
256
|
const executionId = crypto.randomUUID();
|
|
213
257
|
const startedAt = performance.now();
|
|
214
258
|
const beforeEvent = {
|
|
@@ -216,6 +260,7 @@ class AXPCommandExecutor {
|
|
|
216
260
|
stage: 'before',
|
|
217
261
|
key,
|
|
218
262
|
input,
|
|
263
|
+
options,
|
|
219
264
|
};
|
|
220
265
|
await this.commandEvents.emit(beforeEvent);
|
|
221
266
|
try {
|
|
@@ -226,6 +271,7 @@ class AXPCommandExecutor {
|
|
|
226
271
|
stage: 'after',
|
|
227
272
|
key,
|
|
228
273
|
input,
|
|
274
|
+
options,
|
|
229
275
|
success: true,
|
|
230
276
|
result,
|
|
231
277
|
durationMs,
|
|
@@ -240,6 +286,7 @@ class AXPCommandExecutor {
|
|
|
240
286
|
stage: 'after',
|
|
241
287
|
key,
|
|
242
288
|
input,
|
|
289
|
+
options,
|
|
243
290
|
success: false,
|
|
244
291
|
error,
|
|
245
292
|
durationMs,
|
|
@@ -253,14 +300,19 @@ class AXPCommandExecutor {
|
|
|
253
300
|
?.filter((ext) => (ext.target instanceof RegExp ? ext.target.test(key) : ext.target === key))
|
|
254
301
|
.map((ext) => ext.middleware) ?? []);
|
|
255
302
|
}
|
|
256
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
257
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
303
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPCommandExecutor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
304
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPCommandExecutor, providedIn: 'root' }); }
|
|
258
305
|
}
|
|
259
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
306
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPCommandExecutor, decorators: [{
|
|
260
307
|
type: Injectable,
|
|
261
308
|
args: [{ providedIn: 'root' }]
|
|
262
309
|
}] });
|
|
263
310
|
|
|
311
|
+
/**
|
|
312
|
+
* Re-exports shared command middleware contracts.
|
|
313
|
+
* Registration stays client-side (`provideCommandMiddleware` / registry.use).
|
|
314
|
+
*/
|
|
315
|
+
|
|
264
316
|
class AXPCommandService {
|
|
265
317
|
constructor() {
|
|
266
318
|
this.registry = inject(AXPCommandRegistry);
|
|
@@ -286,13 +338,20 @@ class AXPCommandService {
|
|
|
286
338
|
this.registry.clear();
|
|
287
339
|
}
|
|
288
340
|
// Executor methods
|
|
289
|
-
async execute(key, input) {
|
|
290
|
-
return this.executor.execute(key, input);
|
|
341
|
+
async execute(key, input, options) {
|
|
342
|
+
return this.executor.execute(key, input, options);
|
|
291
343
|
}
|
|
292
|
-
|
|
293
|
-
|
|
344
|
+
/**
|
|
345
|
+
* Force remote transport for {@code key}, ignoring any local command registration.
|
|
346
|
+
* Prefer this in gateway/API clients used by local UI command wrappers.
|
|
347
|
+
*/
|
|
348
|
+
async executeRemote(key, input, options) {
|
|
349
|
+
return this.executor.executeRemote(key, input, options);
|
|
350
|
+
}
|
|
351
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPCommandService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
352
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPCommandService, providedIn: 'root' }); }
|
|
294
353
|
}
|
|
295
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
354
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPCommandService, decorators: [{
|
|
296
355
|
type: Injectable,
|
|
297
356
|
args: [{ providedIn: 'root' }]
|
|
298
357
|
}] });
|
|
@@ -316,9 +375,10 @@ function provideCommandMiddleware(entries) {
|
|
|
316
375
|
useValue: ext,
|
|
317
376
|
multi: true
|
|
318
377
|
})),
|
|
319
|
-
// Global middleware setup (
|
|
378
|
+
// Global middleware setup — multi so every provideCommandMiddleware() registers its globals
|
|
320
379
|
{
|
|
321
380
|
provide: AXP_COMMAND_MIDDLEWARE_SETUP,
|
|
381
|
+
multi: true,
|
|
322
382
|
useFactory: () => {
|
|
323
383
|
const registry = inject(AXPCommandRegistry);
|
|
324
384
|
for (const mw of global) {
|
|
@@ -397,10 +457,10 @@ class AXPQueryRegistry {
|
|
|
397
457
|
this.registry.clear();
|
|
398
458
|
this.middlewares.length = 0;
|
|
399
459
|
}
|
|
400
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
401
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
460
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPQueryRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
461
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPQueryRegistry, providedIn: 'root' }); }
|
|
402
462
|
}
|
|
403
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
463
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPQueryRegistry, decorators: [{
|
|
404
464
|
type: Injectable,
|
|
405
465
|
args: [{ providedIn: 'root' }]
|
|
406
466
|
}] });
|
|
@@ -417,7 +477,11 @@ function provideQueryMiddleware(entries) {
|
|
|
417
477
|
global.push(entry);
|
|
418
478
|
}
|
|
419
479
|
else {
|
|
420
|
-
|
|
480
|
+
const target = entry.target ?? entry.key;
|
|
481
|
+
if (target == null) {
|
|
482
|
+
throw new Error('provideQueryMiddleware: targeted entry requires `target` or `key`');
|
|
483
|
+
}
|
|
484
|
+
extensions.push({ target, middleware: entry.middleware });
|
|
421
485
|
}
|
|
422
486
|
}
|
|
423
487
|
return makeEnvironmentProviders([
|
|
@@ -427,9 +491,10 @@ function provideQueryMiddleware(entries) {
|
|
|
427
491
|
useValue: ext,
|
|
428
492
|
multi: true
|
|
429
493
|
})),
|
|
430
|
-
// Global middleware setup (
|
|
494
|
+
// Global middleware setup — multi so every provideQueryMiddleware() registers its globals
|
|
431
495
|
{
|
|
432
496
|
provide: AXP_QUERY_MIDDLEWARE_SETUP,
|
|
497
|
+
multi: true,
|
|
433
498
|
useFactory: () => {
|
|
434
499
|
const registry = inject(AXPQueryRegistry);
|
|
435
500
|
for (const mw of global) {
|
|
@@ -544,26 +609,14 @@ class AXPQueryEventsService {
|
|
|
544
609
|
};
|
|
545
610
|
return walk(value);
|
|
546
611
|
}
|
|
547
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
548
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
612
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPQueryEventsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
613
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPQueryEventsService, providedIn: 'root' }); }
|
|
549
614
|
}
|
|
550
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
615
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPQueryEventsService, decorators: [{
|
|
551
616
|
type: Injectable,
|
|
552
617
|
args: [{ providedIn: 'root' }]
|
|
553
618
|
}] });
|
|
554
619
|
|
|
555
|
-
function composeQueryMiddlewares(middlewares) {
|
|
556
|
-
return (handler) => {
|
|
557
|
-
let composed = handler;
|
|
558
|
-
for (let i = middlewares.length - 1; i >= 0; i--) {
|
|
559
|
-
const mw = middlewares[i];
|
|
560
|
-
const next = composed;
|
|
561
|
-
composed = (input) => mw(input, next);
|
|
562
|
-
}
|
|
563
|
-
return composed;
|
|
564
|
-
};
|
|
565
|
-
}
|
|
566
|
-
|
|
567
620
|
class AXPQueryExecutor {
|
|
568
621
|
constructor() {
|
|
569
622
|
this.injector = inject(EnvironmentInjector);
|
|
@@ -572,37 +625,49 @@ class AXPQueryExecutor {
|
|
|
572
625
|
this.queryEvents = inject(AXPQueryEventsService);
|
|
573
626
|
this.hooks = inject(AXPHookService);
|
|
574
627
|
}
|
|
575
|
-
async fetch(key, input) {
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
return this.
|
|
628
|
+
async fetch(key, input, options) {
|
|
629
|
+
const handler = this.registry.exists(key)
|
|
630
|
+
? await this.createLocalHandler(key)
|
|
631
|
+
: this.createRemoteHandler(key);
|
|
632
|
+
return this.runWithMiddlewareAndEvents(key, input, handler, options);
|
|
580
633
|
}
|
|
581
|
-
async
|
|
634
|
+
async createLocalHandler(key) {
|
|
582
635
|
const loader = this.registry.getLoader(key);
|
|
583
636
|
if (!loader) {
|
|
584
637
|
throw new Error(`Query '${key}' is not registered`);
|
|
585
638
|
}
|
|
586
639
|
const query = await loader();
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
async fetchRemote(key, input) {
|
|
597
|
-
return this.runWithEvents(key, input, async () => {
|
|
598
|
-
const payload = await this.hooks.runAsync(AXPRuntimeRemoteHookKeys.QueryExecute, { name: key, input });
|
|
640
|
+
return (i) => query.fetch(i);
|
|
641
|
+
}
|
|
642
|
+
createRemoteHandler(key) {
|
|
643
|
+
return async (input, options) => {
|
|
644
|
+
const payload = await this.hooks.runAsync(AXPRuntimeRemoteHookKeys.QueryExecute, {
|
|
645
|
+
name: key,
|
|
646
|
+
input: normalizeCommandInputForRemote(input),
|
|
647
|
+
options,
|
|
648
|
+
});
|
|
599
649
|
if (!payload.handled) {
|
|
600
650
|
throw new Error(`Query '${key}' is not registered and no remote handler is available`);
|
|
601
651
|
}
|
|
602
652
|
return (payload.result ?? null);
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
async runWithMiddlewareAndEvents(key, input, handler, options) {
|
|
656
|
+
const pluginMiddlewares = this.getPluginMiddlewares(key);
|
|
657
|
+
const globalMiddlewares = this.registry.getMiddlewares();
|
|
658
|
+
// Registry middlewares are stored as AXPQueryMiddleware (unknown input/result).
|
|
659
|
+
// Re-wrap in injection context and narrow for this fetch's TInput/TResult.
|
|
660
|
+
const wrappedMiddlewares = [
|
|
661
|
+
...globalMiddlewares,
|
|
662
|
+
...pluginMiddlewares,
|
|
663
|
+
].map((middleware) => {
|
|
664
|
+
const wrapped = (context, next) => runInInjectionContext(this.injector, () => middleware(context, next));
|
|
665
|
+
return wrapped;
|
|
603
666
|
});
|
|
667
|
+
const composed = composeQueryMiddlewares(wrappedMiddlewares)((context) => handler(context.input, context.options));
|
|
668
|
+
return this.runWithEvents(key, input, () => composed({ input, key, options }), options);
|
|
604
669
|
}
|
|
605
|
-
async runWithEvents(key, input, run) {
|
|
670
|
+
async runWithEvents(key, input, run, options) {
|
|
606
671
|
const executionId = crypto.randomUUID();
|
|
607
672
|
const startedAt = performance.now();
|
|
608
673
|
const beforeEvent = {
|
|
@@ -610,6 +675,7 @@ class AXPQueryExecutor {
|
|
|
610
675
|
stage: 'before',
|
|
611
676
|
key,
|
|
612
677
|
input,
|
|
678
|
+
options,
|
|
613
679
|
};
|
|
614
680
|
await this.queryEvents.emit(beforeEvent);
|
|
615
681
|
try {
|
|
@@ -620,6 +686,7 @@ class AXPQueryExecutor {
|
|
|
620
686
|
stage: 'after',
|
|
621
687
|
key,
|
|
622
688
|
input,
|
|
689
|
+
options,
|
|
623
690
|
success: true,
|
|
624
691
|
result,
|
|
625
692
|
durationMs,
|
|
@@ -634,6 +701,7 @@ class AXPQueryExecutor {
|
|
|
634
701
|
stage: 'after',
|
|
635
702
|
key,
|
|
636
703
|
input,
|
|
704
|
+
options,
|
|
637
705
|
success: false,
|
|
638
706
|
error,
|
|
639
707
|
durationMs,
|
|
@@ -647,14 +715,19 @@ class AXPQueryExecutor {
|
|
|
647
715
|
?.filter((ext) => (ext.target instanceof RegExp ? ext.target.test(key) : ext.target === key))
|
|
648
716
|
.map((ext) => ext.middleware) ?? []);
|
|
649
717
|
}
|
|
650
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
651
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
718
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPQueryExecutor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
719
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPQueryExecutor, providedIn: 'root' }); }
|
|
652
720
|
}
|
|
653
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
721
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPQueryExecutor, decorators: [{
|
|
654
722
|
type: Injectable,
|
|
655
723
|
args: [{ providedIn: 'root' }]
|
|
656
724
|
}] });
|
|
657
725
|
|
|
726
|
+
/**
|
|
727
|
+
* Re-exports shared query middleware contracts.
|
|
728
|
+
* Registration stays client-side (`provideQueryMiddleware` / registry.use).
|
|
729
|
+
*/
|
|
730
|
+
|
|
658
731
|
class AXPQueryService {
|
|
659
732
|
constructor() {
|
|
660
733
|
this.registry = inject(AXPQueryRegistry);
|
|
@@ -679,14 +752,14 @@ class AXPQueryService {
|
|
|
679
752
|
clear() {
|
|
680
753
|
this.registry.clear();
|
|
681
754
|
}
|
|
682
|
-
|
|
683
|
-
async fetch(key, input) {
|
|
684
|
-
return this.executor.fetch(key, input);
|
|
755
|
+
/** Same envelope pattern as {@link AXPCommandService.execute}. */
|
|
756
|
+
async fetch(key, input, options) {
|
|
757
|
+
return this.executor.fetch(key, input, options);
|
|
685
758
|
}
|
|
686
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
687
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
759
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPQueryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
760
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPQueryService, providedIn: 'root' }); }
|
|
688
761
|
}
|
|
689
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
762
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPQueryService, decorators: [{
|
|
690
763
|
type: Injectable,
|
|
691
764
|
args: [{ providedIn: 'root' }]
|
|
692
765
|
}] });
|
|
@@ -733,10 +806,10 @@ class AXPViewRegistry {
|
|
|
733
806
|
this.registry.clear();
|
|
734
807
|
this.middlewares.length = 0;
|
|
735
808
|
}
|
|
736
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
737
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
809
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPViewRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
810
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPViewRegistry, providedIn: 'root' }); }
|
|
738
811
|
}
|
|
739
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
812
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPViewRegistry, decorators: [{
|
|
740
813
|
type: Injectable,
|
|
741
814
|
args: [{ providedIn: 'root' }]
|
|
742
815
|
}] });
|
|
@@ -769,10 +842,10 @@ class AXPViewExecutor {
|
|
|
769
842
|
?.filter(ext => ext.target instanceof RegExp ? ext.target.test(key) : ext.target === key)
|
|
770
843
|
.map(ext => ext.middleware) ?? [];
|
|
771
844
|
}
|
|
772
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
773
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
845
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPViewExecutor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
846
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPViewExecutor, providedIn: 'root' }); }
|
|
774
847
|
}
|
|
775
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
848
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPViewExecutor, decorators: [{
|
|
776
849
|
type: Injectable,
|
|
777
850
|
args: [{ providedIn: 'root' }]
|
|
778
851
|
}] });
|
|
@@ -806,10 +879,10 @@ class AXPViewService {
|
|
|
806
879
|
async provide(key, input) {
|
|
807
880
|
return this.executor.provide(key, input);
|
|
808
881
|
}
|
|
809
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
810
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
882
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPViewService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
883
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPViewService, providedIn: 'root' }); }
|
|
811
884
|
}
|
|
812
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
885
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPViewService, decorators: [{
|
|
813
886
|
type: Injectable,
|
|
814
887
|
args: [{ providedIn: 'root' }]
|
|
815
888
|
}] });
|
|
@@ -925,10 +998,10 @@ class AXPPolicyEngineRegistry {
|
|
|
925
998
|
await composed(context);
|
|
926
999
|
return context;
|
|
927
1000
|
}
|
|
928
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
929
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1001
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPPolicyEngineRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1002
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPPolicyEngineRegistry, providedIn: 'root' }); }
|
|
930
1003
|
}
|
|
931
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1004
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPPolicyEngineRegistry, decorators: [{
|
|
932
1005
|
type: Injectable,
|
|
933
1006
|
args: [{ providedIn: 'root' }]
|
|
934
1007
|
}] });
|
|
@@ -977,10 +1050,10 @@ class AXPPolicyEngineService {
|
|
|
977
1050
|
// }
|
|
978
1051
|
// }
|
|
979
1052
|
}
|
|
980
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
981
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1053
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPPolicyEngineService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1054
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPPolicyEngineService, providedIn: 'root' }); }
|
|
982
1055
|
}
|
|
983
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1056
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPPolicyEngineService, decorators: [{
|
|
984
1057
|
type: Injectable,
|
|
985
1058
|
args: [{
|
|
986
1059
|
providedIn: 'root'
|
|
@@ -1002,13 +1075,14 @@ class AXPPolicyEngineDirective {
|
|
|
1002
1075
|
policies: castArray(policy),
|
|
1003
1076
|
sender: this.elementRef.nativeElement
|
|
1004
1077
|
});
|
|
1005
|
-
},
|
|
1078
|
+
}, /* @ts-ignore */
|
|
1079
|
+
...(ngDevMode ? [{ debugName: "#eff" }] : /* istanbul ignore next */ []));
|
|
1006
1080
|
}
|
|
1007
1081
|
#eff;
|
|
1008
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1009
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
1082
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPPolicyEngineDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1083
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.8", type: AXPPolicyEngineDirective, isStandalone: true, selector: "[axp-apply-policy]", inputs: { policy: { classPropertyName: "policy", publicName: "axp-apply-policy", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
|
|
1010
1084
|
}
|
|
1011
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1085
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPPolicyEngineDirective, decorators: [{
|
|
1012
1086
|
type: Directive,
|
|
1013
1087
|
args: [{
|
|
1014
1088
|
selector: '[axp-apply-policy]',
|
|
@@ -1081,19 +1155,108 @@ class AXPRuntimeModule {
|
|
|
1081
1155
|
console.log('[AXPRuntimeModule] Policy Engine Setup:', this._policyEngineSetup);
|
|
1082
1156
|
}
|
|
1083
1157
|
}
|
|
1084
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1085
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
1086
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
1158
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPRuntimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1159
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: AXPRuntimeModule }); }
|
|
1160
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPRuntimeModule }); }
|
|
1087
1161
|
}
|
|
1088
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1162
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPRuntimeModule, decorators: [{
|
|
1089
1163
|
type: NgModule
|
|
1090
1164
|
}], ctorParameters: () => [] });
|
|
1091
1165
|
|
|
1166
|
+
//#region ---- Runtime transport hooks ----
|
|
1167
|
+
/**
|
|
1168
|
+
* Distributed hook keys for keyed runtime transports (SSE, beacon, streaming POST).
|
|
1169
|
+
* Connectivity implements these via {@link AXPHookService.runAsync}.
|
|
1170
|
+
*/
|
|
1171
|
+
const AXPRuntimeTransportHookKeys = {
|
|
1172
|
+
Execute: 'runtime.transport.execute',
|
|
1173
|
+
};
|
|
1174
|
+
//#endregion
|
|
1175
|
+
|
|
1176
|
+
//#region ---- Imports ----
|
|
1177
|
+
//#endregion
|
|
1178
|
+
//#region ---- Runtime transport service ----
|
|
1179
|
+
/**
|
|
1180
|
+
* Dispatches keyed runtime transports (SSE, beacon, streaming) through distributed hooks.
|
|
1181
|
+
*/
|
|
1182
|
+
class AXPRuntimeTransportService {
|
|
1183
|
+
constructor() {
|
|
1184
|
+
this.hooks = inject(AXPHookService);
|
|
1185
|
+
}
|
|
1186
|
+
async execute(key, input) {
|
|
1187
|
+
const payload = await this.hooks.runAsync(AXPRuntimeTransportHookKeys.Execute, { key, input });
|
|
1188
|
+
if (!payload.handled) {
|
|
1189
|
+
throw new Error(`No runtime transport registered for key: ${key}`);
|
|
1190
|
+
}
|
|
1191
|
+
return payload.result;
|
|
1192
|
+
}
|
|
1193
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPRuntimeTransportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1194
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPRuntimeTransportService, providedIn: 'root' }); }
|
|
1195
|
+
}
|
|
1196
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPRuntimeTransportService, decorators: [{
|
|
1197
|
+
type: Injectable,
|
|
1198
|
+
args: [{ providedIn: 'root' }]
|
|
1199
|
+
}] });
|
|
1200
|
+
|
|
1201
|
+
//#region ---- Imports ----
|
|
1202
|
+
//#endregion
|
|
1203
|
+
//#region ---- Provider factory ----
|
|
1204
|
+
/**
|
|
1205
|
+
* Registers an external-stack implementation of `runtime.command.execute-bulk`.
|
|
1206
|
+
*
|
|
1207
|
+
* Use this when the host app consumes only the ACoreX **client** libraries and
|
|
1208
|
+
* implements the API in another stack. Entity bulk actions (`Entity:Bulk`,
|
|
1209
|
+
* selected delete, etc.) call {@link AXPBulkCommandService}, which runs this hook
|
|
1210
|
+
* once — no client-side per-id fan-out.
|
|
1211
|
+
*
|
|
1212
|
+
* @example
|
|
1213
|
+
* ```typescript
|
|
1214
|
+
* @NgModule({
|
|
1215
|
+
* providers: [
|
|
1216
|
+
* ...provideExternalRuntimeBulkTransport(async (request) => {
|
|
1217
|
+
* const response = await fetch(`${apiBase}/v1/runtime/commands/bulk`, {
|
|
1218
|
+
* method: 'POST',
|
|
1219
|
+
* headers: {
|
|
1220
|
+
* 'Content-Type': 'application/json',
|
|
1221
|
+
* Authorization: `Bearer ${token}`,
|
|
1222
|
+
* },
|
|
1223
|
+
* body: JSON.stringify(request),
|
|
1224
|
+
* });
|
|
1225
|
+
* return response.json();
|
|
1226
|
+
* }),
|
|
1227
|
+
* ],
|
|
1228
|
+
* })
|
|
1229
|
+
* export class AppModule {}
|
|
1230
|
+
* ```
|
|
1231
|
+
*/
|
|
1232
|
+
function provideExternalRuntimeBulkTransport(transport, options = {}) {
|
|
1233
|
+
const priority = options.priority ?? -100;
|
|
1234
|
+
const provider = {
|
|
1235
|
+
key: AXPRuntimeRemoteHookKeys.CommandExecuteBulk,
|
|
1236
|
+
priority,
|
|
1237
|
+
async execute(payload) {
|
|
1238
|
+
if (payload.handled) {
|
|
1239
|
+
return payload;
|
|
1240
|
+
}
|
|
1241
|
+
const result = await transport(payload.request);
|
|
1242
|
+
return { ...payload, handled: true, result };
|
|
1243
|
+
},
|
|
1244
|
+
};
|
|
1245
|
+
return [
|
|
1246
|
+
{
|
|
1247
|
+
provide: AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER,
|
|
1248
|
+
useValue: provider,
|
|
1249
|
+
multi: true,
|
|
1250
|
+
},
|
|
1251
|
+
];
|
|
1252
|
+
}
|
|
1253
|
+
//#endregion
|
|
1254
|
+
|
|
1092
1255
|
// Commands
|
|
1093
1256
|
|
|
1094
1257
|
/**
|
|
1095
1258
|
* Generated bundle index. Do not edit.
|
|
1096
1259
|
*/
|
|
1097
1260
|
|
|
1098
|
-
export { AXPCommandEventsService, AXPCommandExecutor, AXPCommandRegistry, AXPCommandService, AXPPolicyEngineContext, AXPPolicyEngineDirective, AXPPolicyEngineRegistry, AXPPolicyEngineService, AXPQueryEventsService, AXPQueryExecutor, AXPQueryRegistry, AXPQueryService, AXPRuntimeModule, AXPRuntimeRemoteHookKeys, AXPViewExecutor, AXPViewRegistry, AXPViewService, AXP_COMMAND_EXTENSION, AXP_COMMAND_MIDDLEWARE_SETUP, AXP_COMMAND_SETUP, AXP_POLICY_ENGINE_MIDDLEWARE_SETUP, AXP_POLICY_EXTENSION, AXP_QUERY_EXTENSION, AXP_QUERY_MIDDLEWARE_SETUP, AXP_QUERY_SETUP, AXP_VIEW_EXTENSION, AXP_VIEW_SETUP,
|
|
1261
|
+
export { AXPBulkCommandService, AXPCommandEventsService, AXPCommandExecutor, AXPCommandRegistry, AXPCommandService, AXPPolicyEngineContext, AXPPolicyEngineDirective, AXPPolicyEngineRegistry, AXPPolicyEngineService, AXPQueryEventsService, AXPQueryExecutor, AXPQueryRegistry, AXPQueryService, AXPRuntimeModule, AXPRuntimeRemoteHookKeys, AXPRuntimeTransportHookKeys, AXPRuntimeTransportService, AXPViewExecutor, AXPViewRegistry, AXPViewService, AXP_COMMAND_EXTENSION, AXP_COMMAND_MIDDLEWARE_SETUP, AXP_COMMAND_SETUP, AXP_POLICY_ENGINE_MIDDLEWARE_SETUP, AXP_POLICY_EXTENSION, AXP_QUERY_EXTENSION, AXP_QUERY_MIDDLEWARE_SETUP, AXP_QUERY_SETUP, AXP_VIEW_EXTENSION, AXP_VIEW_SETUP, composePolicyEngineMiddlewares, composeViewMiddlewares, provideCommand, provideCommandMiddleware, provideCommandSetups, provideExternalRuntimeBulkTransport, providePolicySetups, provideQueryMiddleware, provideQuerySetups, provideViewSetup, provideViewSetups };
|
|
1099
1262
|
//# sourceMappingURL=acorex-platform-framework-client-runtime.mjs.map
|