@acorex/connectivity 20.8.13 → 20.8.15
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/{types/acorex-connectivity-api.d.ts → api/index.d.ts} +1 -12
- package/fesm2022/{acorex-connectivity-api-execute.command-CiBl7z_H.mjs → acorex-connectivity-api-execute.command-D2Q0ahw4.mjs} +4 -4
- package/fesm2022/acorex-connectivity-api-execute.command-D2Q0ahw4.mjs.map +1 -0
- package/fesm2022/acorex-connectivity-api.mjs +40 -126
- package/fesm2022/acorex-connectivity-api.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-assign-to-manager.command-CzzTHBVX.mjs +66 -0
- package/fesm2022/acorex-connectivity-mock-assign-to-manager.command-CzzTHBVX.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-category-with-items.query-Cj6FWu7S.mjs → acorex-connectivity-mock-category-with-items.query-DWW7t6nc.mjs} +4 -4
- package/fesm2022/acorex-connectivity-mock-category-with-items.query-DWW7t6nc.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-check-permission.activity-vr3OHtjC.mjs → acorex-connectivity-mock-check-permission.command-DFcxfjxp.mjs} +16 -8
- package/fesm2022/acorex-connectivity-mock-check-permission.command-DFcxfjxp.mjs.map +1 -0
- package/fesm2022/acorex-connectivity-mock-complete-signature-process.command-BG_rxbUl.mjs +80 -0
- package/fesm2022/acorex-connectivity-mock-complete-signature-process.command-BG_rxbUl.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-distribution-record.activity-DuNluOzA.mjs → acorex-connectivity-mock-distribution-record.command-BopU0LyU.mjs} +6 -18
- package/fesm2022/acorex-connectivity-mock-distribution-record.command-BopU0LyU.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-get-application-versions-chart-data.query-DwVuYuKx.mjs → acorex-connectivity-mock-get-application-versions-chart-data.query-uwDUrbFJ.mjs} +4 -4
- package/fesm2022/acorex-connectivity-mock-get-application-versions-chart-data.query-uwDUrbFJ.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-get-application-versions-timeline.query-sFKYynZA.mjs → acorex-connectivity-mock-get-application-versions-timeline.query-BHjQYTyZ.mjs} +4 -4
- package/fesm2022/acorex-connectivity-mock-get-application-versions-timeline.query-BHjQYTyZ.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-get-employee-list.query-DifHwuqH.mjs → acorex-connectivity-mock-get-employee-list.query-Ch-Vh5GE.mjs} +4 -4
- package/fesm2022/acorex-connectivity-mock-get-employee-list.query-Ch-Vh5GE.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-get-location-list.query-bMjkZnzq.mjs → acorex-connectivity-mock-get-location-list.query-Xbc6d8kb.mjs} +4 -4
- package/fesm2022/acorex-connectivity-mock-get-location-list.query-Xbc6d8kb.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-get-product-chart-data.query-D7DBzLT-.mjs → acorex-connectivity-mock-get-product-chart-data.query-m8_ME45B.mjs} +4 -4
- package/fesm2022/acorex-connectivity-mock-get-product-chart-data.query-m8_ME45B.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-get-product-list.query-f-mTj4ah.mjs → acorex-connectivity-mock-get-product-list.query-DzkssYRw.mjs} +9 -16
- package/fesm2022/acorex-connectivity-mock-get-product-list.query-DzkssYRw.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-get-product-pdf-data.query-Co1V52c4.mjs → acorex-connectivity-mock-get-product-pdf-data.query-wMD65pwR.mjs} +5 -5
- package/fesm2022/acorex-connectivity-mock-get-product-pdf-data.query-wMD65pwR.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-get-subscriptions-chart-data.query-BQT5a_hn.mjs → acorex-connectivity-mock-get-subscriptions-chart-data.query-DBOT_0IN.mjs} +5 -5
- package/fesm2022/acorex-connectivity-mock-get-subscriptions-chart-data.query-DBOT_0IN.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-get-subscriptions-timeline.query-D4qfDfeV.mjs → acorex-connectivity-mock-get-subscriptions-timeline.query-DBEEbeiS.mjs} +4 -4
- package/fesm2022/acorex-connectivity-mock-get-subscriptions-timeline.query-DBEEbeiS.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-get-tenant-application-access.query-n1_Azada.mjs → acorex-connectivity-mock-get-tenant-application-access.query-BM9toJ45.mjs} +4 -4
- package/fesm2022/acorex-connectivity-mock-get-tenant-application-access.query-BM9toJ45.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-get-tenant-registration-chart-data.query-Cg4ykZU2.mjs → acorex-connectivity-mock-get-tenant-registration-chart-data.query-CACCBXn-.mjs} +5 -5
- package/fesm2022/acorex-connectivity-mock-get-tenant-registration-chart-data.query-CACCBXn-.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-get-tenant-registration-timeline.query-0sCBtdbp.mjs → acorex-connectivity-mock-get-tenant-registration-timeline.query-CfDjhtaC.mjs} +4 -4
- package/fesm2022/acorex-connectivity-mock-get-tenant-registration-timeline.query-CfDjhtaC.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-get-tenant-user-distribution.query-rD811gtM.mjs → acorex-connectivity-mock-get-tenant-user-distribution.query-CZXvavUh.mjs} +4 -4
- package/fesm2022/acorex-connectivity-mock-get-tenant-user-distribution.query-CZXvavUh.mjs.map +1 -0
- package/fesm2022/acorex-connectivity-mock-notify-signers.command-BV-b8NBg.mjs +69 -0
- package/fesm2022/acorex-connectivity-mock-notify-signers.command-BV-b8NBg.mjs.map +1 -0
- package/fesm2022/acorex-connectivity-mock-request-signature.command-DZyVnhAp.mjs +72 -0
- package/fesm2022/acorex-connectivity-mock-request-signature.command-DZyVnhAp.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-sample.command-CJmDL4pL.mjs → acorex-connectivity-mock-sample.command-CXz1poTn.mjs} +4 -4
- package/fesm2022/acorex-connectivity-mock-sample.command-CXz1poTn.mjs.map +1 -0
- package/fesm2022/acorex-connectivity-mock-validate-all-signatures.command-leYngRtS.mjs +81 -0
- package/fesm2022/acorex-connectivity-mock-validate-all-signatures.command-leYngRtS.mjs.map +1 -0
- package/fesm2022/acorex-connectivity-mock.mjs +51673 -2
- package/fesm2022/acorex-connectivity-mock.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-utils.mjs +7 -7
- package/fesm2022/acorex-connectivity-utils.mjs.map +1 -1
- package/fesm2022/acorex-connectivity.mjs.map +1 -1
- package/mock/index.d.ts +3022 -0
- package/package.json +7 -8
- package/fesm2022/acorex-connectivity-api-execute.command-CiBl7z_H.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-acorex-connectivity-mock-CwWGrnVs.mjs +0 -78646
- package/fesm2022/acorex-connectivity-mock-acorex-connectivity-mock-CwWGrnVs.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-assign-to-manager.activity-B8bbsEQx.mjs +0 -288
- package/fesm2022/acorex-connectivity-mock-assign-to-manager.activity-B8bbsEQx.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-category-metadata-inheritance.query-CWRL1dTa.mjs +0 -198
- package/fesm2022/acorex-connectivity-mock-category-metadata-inheritance.query-CWRL1dTa.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-category-with-items.query-Cj6FWu7S.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-chat-generate-image.command-CBlDsPWY.mjs +0 -108
- package/fesm2022/acorex-connectivity-mock-chat-generate-image.command-CBlDsPWY.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-chat-synthesize-speech.command-BCSsNdNv.mjs +0 -130
- package/fesm2022/acorex-connectivity-mock-chat-synthesize-speech.command-BCSsNdNv.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-chat-transcribe-speech.command-DM6JF63R.mjs +0 -110
- package/fesm2022/acorex-connectivity-mock-chat-transcribe-speech.command-DM6JF63R.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-check-permission.activity-vr3OHtjC.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-complete-signature-process.activity-BO-IFsHT.mjs +0 -56
- package/fesm2022/acorex-connectivity-mock-complete-signature-process.activity-BO-IFsHT.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-contact-core.module-5TLCGWOR.mjs +0 -968
- package/fesm2022/acorex-connectivity-mock-contact-core.module-5TLCGWOR.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-content-management.module-GQdqKsPB.mjs +0 -16
- package/fesm2022/acorex-connectivity-mock-content-management.module-GQdqKsPB.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-distribution-record.activity-DuNluOzA.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-entity-create.activity-Ca19tIj4.mjs +0 -60
- package/fesm2022/acorex-connectivity-mock-entity-create.activity-Ca19tIj4.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-entity-delete.activity-ErEN1c24.mjs +0 -60
- package/fesm2022/acorex-connectivity-mock-entity-delete.activity-ErEN1c24.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-entity-read.activity-1fJW8gVe.mjs +0 -67
- package/fesm2022/acorex-connectivity-mock-entity-read.activity-1fJW8gVe.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-entity-update.activity-06HTKiQQ.mjs +0 -68
- package/fesm2022/acorex-connectivity-mock-entity-update.activity-06HTKiQQ.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-extract-document-text.command-nGfUTSf6.mjs +0 -64
- package/fesm2022/acorex-connectivity-mock-extract-document-text.command-nGfUTSf6.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-get-application-versions-chart-data.query-DwVuYuKx.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-get-application-versions-timeline.query-sFKYynZA.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-get-current-session-user.activity-CsmxwXsM.mjs +0 -39
- package/fesm2022/acorex-connectivity-mock-get-current-session-user.activity-CsmxwXsM.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-get-current-user-manager.activity-C1mj2bgB.mjs +0 -69
- package/fesm2022/acorex-connectivity-mock-get-current-user-manager.activity-C1mj2bgB.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-get-employee-list.query-DifHwuqH.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-get-location-list.query-bMjkZnzq.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-get-product-chart-data.query-D7DBzLT-.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-get-product-list.query-f-mTj4ah.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-get-product-pdf-data.query-Co1V52c4.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-get-subscriptions-chart-data.query-BQT5a_hn.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-get-subscriptions-timeline.query-D4qfDfeV.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-get-tenant-application-access.query-n1_Azada.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-get-tenant-registration-chart-data.query-Cg4ykZU2.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-get-tenant-registration-timeline.query-0sCBtdbp.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-get-tenant-user-distribution.query-rD811gtM.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-if.activity-DvzuhItL.mjs +0 -35
- package/fesm2022/acorex-connectivity-mock-if.activity-DvzuhItL.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-notification-management-email-send.command-DAQfIWoD.mjs +0 -73
- package/fesm2022/acorex-connectivity-mock-notification-management-email-send.command-DAQfIWoD.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-notify-signers.activity-Dg0sKGip.mjs +0 -49
- package/fesm2022/acorex-connectivity-mock-notify-signers.activity-Dg0sKGip.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-request-signature.activity-CoRT_H2u.mjs +0 -60
- package/fesm2022/acorex-connectivity-mock-request-signature.activity-CoRT_H2u.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-sample.command-CJmDL4pL.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-structured-text-completion.command-l31pjl9-.mjs +0 -38
- package/fesm2022/acorex-connectivity-mock-structured-text-completion.command-l31pjl9-.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-user-roles-for-list-column.query-2PnIbRxO.mjs +0 -30
- package/fesm2022/acorex-connectivity-mock-user-roles-for-list-column.query-2PnIbRxO.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-validate-all-signatures.activity-JuHjNFFS.mjs +0 -61
- package/fesm2022/acorex-connectivity-mock-validate-all-signatures.activity-JuHjNFFS.mjs.map +0 -1
- package/types/acorex-connectivity-mock.d.ts +0 -4127
- /package/{types/acorex-connectivity.d.ts → index.d.ts} +0 -0
- /package/{types/acorex-connectivity-utils.d.ts → utils/index.d.ts} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-contact-core.module-5TLCGWOR.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
var name = "content-management";
|
|
2
|
-
var title = "Content Management";
|
|
3
|
-
var icon = "fa-light fa-file-invoice";
|
|
4
|
-
var i18n = "content-management";
|
|
5
|
-
var aggregates = [
|
|
6
|
-
];
|
|
7
|
-
var contentManagement_module = {
|
|
8
|
-
name: name,
|
|
9
|
-
title: title,
|
|
10
|
-
icon: icon,
|
|
11
|
-
i18n: i18n,
|
|
12
|
-
aggregates: aggregates
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { aggregates, contentManagement_module as default, i18n, icon, name, title };
|
|
16
|
-
//# sourceMappingURL=acorex-connectivity-mock-content-management.module-GQdqKsPB.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-content-management.module-GQdqKsPB.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-distribution-record.activity-DuNluOzA.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/distribution-record.activity.ts"],"sourcesContent":["import { AXMEntityCrudServiceImpl } from '@acorex/platform/layout/entity';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { inject, Injectable, Injector, runInInjectionContext } from '@angular/core';\n\nexport interface DistributionRecordInput {\n refId: string;\n refType: string;\n assignedTo: string[];\n}\n\nexport interface DistributionRecordOutput {\n success: boolean;\n message: string;\n}\n\n/**\n * Distribution Record Activity (Backend - Mock)\n *\n * Creates distribution records for assigned users.\n * Key: Distribution:Record (not workflow-activity - used by other flows)\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DistributionRecordActivity\n implements AXPCommand<DistributionRecordInput, DistributionRecordOutput> {\n private readonly injector = inject(Injector);\n\n async execute(\n input: DistributionRecordInput,\n ): Promise<AXPExecuteCommandResult<DistributionRecordOutput>> {\n const dataService = runInInjectionContext(\n this.injector,\n () => new AXMEntityCrudServiceImpl<any, any>(`${input.refType}Distribution`),\n );\n\n const dataServiceEntity = runInInjectionContext(\n this.injector,\n () => new AXMEntityCrudServiceImpl<any, any>(input.refType),\n );\n\n try {\n for (const user of input.assignedTo) {\n await dataService.insertOne({\n distributionRefId: input.refId,\n assignedId: user,\n distributionDate: new Date(),\n });\n await dataServiceEntity.updateOne(input.refId, {\n stateInfo: {\n ...(await dataServiceEntity.getOne(input.refId)).stateInfo,\n isDistributed: true,\n },\n });\n }\n return {\n success: true,\n data: {\n success: true,\n message: 'Distribution records created successfully',\n },\n metadata: {\n outcome: 'Done',\n },\n };\n } catch (error) {\n return {\n success: false,\n message: {\n text: error instanceof Error ? error.message : 'Failed to create distribution records',\n },\n data: {\n success: false,\n message: 'Failed to create distribution records',\n },\n metadata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F;QACH;QAAE,OAAO,KAAK,EAAE;YACd,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;AACP,oBAAA,IAAI,EAAE,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,uCAAuC;AACvF,iBAAA;AACD,gBAAA,IAAI,EAAE;AACJ,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE,uCAAuC;AACjD,iBAAA;AACD,gBAAA,QAAQ,EAAE;AACR,oBAAA,OAAO,EAAE,QAAQ;AAClB,iBAAA;aACF;QACH;IACF;8GAxDW,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA1B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,cAFzB,MAAM,EAAA,CAAA,CAAA;;2FAEP,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAHtC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Injectable } from '@angular/core';
|
|
3
|
-
import { AXPEntityStorageService } from '@acorex/platform/layout/entity';
|
|
4
|
-
|
|
5
|
-
//#endregion
|
|
6
|
-
/**
|
|
7
|
-
* Entity Create Activity (Mock – Dexie)
|
|
8
|
-
*
|
|
9
|
-
* Inserts one entity into storage (Dexie in mock).
|
|
10
|
-
* Activity type: workflow-activity:entity-create
|
|
11
|
-
* Outcomes: Done | Failed
|
|
12
|
-
*/
|
|
13
|
-
class EntityCreateActivity {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.storage = inject(AXPEntityStorageService);
|
|
16
|
-
}
|
|
17
|
-
async execute(input) {
|
|
18
|
-
try {
|
|
19
|
-
if (!input?.entity) {
|
|
20
|
-
return {
|
|
21
|
-
success: false,
|
|
22
|
-
message: { text: 'entity is required' },
|
|
23
|
-
data: { id: '', success: false, error: 'entity is required' },
|
|
24
|
-
metadata: { outcome: 'Failed' },
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
if (!input.data || typeof input.data !== 'object') {
|
|
28
|
-
return {
|
|
29
|
-
success: false,
|
|
30
|
-
message: { text: 'data is required' },
|
|
31
|
-
data: { id: '', success: false, error: 'data is required' },
|
|
32
|
-
metadata: { outcome: 'Failed' },
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
const id = await this.storage.insertOne(input.entity, input.data);
|
|
36
|
-
return {
|
|
37
|
-
success: true,
|
|
38
|
-
data: { id, success: true },
|
|
39
|
-
metadata: { outcome: 'Done' },
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
return {
|
|
44
|
-
success: false,
|
|
45
|
-
message: { text: error?.message ?? 'Create failed' },
|
|
46
|
-
data: { id: '', success: false, error: error?.message ?? 'Create failed' },
|
|
47
|
-
metadata: { outcome: 'Failed' },
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EntityCreateActivity, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
52
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EntityCreateActivity, providedIn: 'root' }); }
|
|
53
|
-
}
|
|
54
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EntityCreateActivity, decorators: [{
|
|
55
|
-
type: Injectable,
|
|
56
|
-
args: [{ providedIn: 'root' }]
|
|
57
|
-
}] });
|
|
58
|
-
|
|
59
|
-
export { EntityCreateActivity };
|
|
60
|
-
//# sourceMappingURL=acorex-connectivity-mock-entity-create.activity-Ca19tIj4.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-entity-create.activity-Ca19tIj4.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/entity-create.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPEntityStorageService } from '@acorex/platform/layout/entity';\n\n//#region ---- Types ----\n\nexport interface EntityCreateInput {\n entity: string;\n data: Record<string, any>;\n}\n\nexport interface EntityCreateOutput {\n id: string;\n success: boolean;\n error?: string;\n}\n\n//#endregion\n\n/**\n * Entity Create Activity (Mock – Dexie)\n *\n * Inserts one entity into storage (Dexie in mock).\n * Activity type: workflow-activity:entity-create\n * Outcomes: Done | Failed\n */\n@Injectable({ providedIn: 'root' })\nexport class EntityCreateActivity implements AXPCommand<EntityCreateInput, EntityCreateOutput> {\n private readonly storage = inject(AXPEntityStorageService);\n\n async execute(\n input: EntityCreateInput,\n ): Promise<AXPExecuteCommandResult<EntityCreateOutput>> {\n try {\n if (!input?.entity) {\n return {\n success: false,\n message: { text: 'entity is required' },\n data: { id: '', success: false, error: 'entity is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n if (!input.data || typeof input.data !== 'object') {\n return {\n success: false,\n message: { text: 'data is required' },\n data: { id: '', success: false, error: 'data is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const id = await this.storage.insertOne(input.entity, input.data as any);\n\n return {\n success: true,\n data: { id, success: true },\n metadata: { outcome: 'Done' },\n };\n } catch (error: any) {\n return {\n success: false,\n message: { text: error?.message ?? 'Create failed' },\n data: { id: '', success: false, error: error?.message ?? 'Create failed' },\n metadata: { outcome: 'Failed' },\n };\n }\n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AU,EAAE;YACnB,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,IAAI,eAAe,EAAE;AACpD,gBAAA,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,IAAI,eAAe,EAAE;AAC1E,gBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;aAChC;QACH;IACF;8GAvCW,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAApB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Injectable } from '@angular/core';
|
|
3
|
-
import { AXPEntityStorageService } from '@acorex/platform/layout/entity';
|
|
4
|
-
|
|
5
|
-
//#endregion
|
|
6
|
-
/**
|
|
7
|
-
* Entity Delete Activity (Mock – Dexie)
|
|
8
|
-
*
|
|
9
|
-
* Deletes one entity from storage (Dexie in mock).
|
|
10
|
-
* Activity type: workflow-activity:entity-delete
|
|
11
|
-
* Outcomes: Done | Failed
|
|
12
|
-
*/
|
|
13
|
-
class EntityDeleteActivity {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.storage = inject(AXPEntityStorageService);
|
|
16
|
-
}
|
|
17
|
-
async execute(input) {
|
|
18
|
-
try {
|
|
19
|
-
if (!input?.entity) {
|
|
20
|
-
return {
|
|
21
|
-
success: false,
|
|
22
|
-
message: { text: 'entity is required' },
|
|
23
|
-
data: { success: false, error: 'entity is required' },
|
|
24
|
-
metadata: { outcome: 'Failed' },
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
if (!input?.id) {
|
|
28
|
-
return {
|
|
29
|
-
success: false,
|
|
30
|
-
message: { text: 'id is required' },
|
|
31
|
-
data: { success: false, error: 'id is required' },
|
|
32
|
-
metadata: { outcome: 'Failed' },
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
await this.storage.deleteOne(input.entity, input.id);
|
|
36
|
-
return {
|
|
37
|
-
success: true,
|
|
38
|
-
data: { success: true },
|
|
39
|
-
metadata: { outcome: 'Done' },
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
return {
|
|
44
|
-
success: false,
|
|
45
|
-
message: { text: error?.message ?? 'Delete failed' },
|
|
46
|
-
data: { success: false, error: error?.message ?? 'Delete failed' },
|
|
47
|
-
metadata: { outcome: 'Failed' },
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EntityDeleteActivity, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
52
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EntityDeleteActivity, providedIn: 'root' }); }
|
|
53
|
-
}
|
|
54
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EntityDeleteActivity, decorators: [{
|
|
55
|
-
type: Injectable,
|
|
56
|
-
args: [{ providedIn: 'root' }]
|
|
57
|
-
}] });
|
|
58
|
-
|
|
59
|
-
export { EntityDeleteActivity };
|
|
60
|
-
//# sourceMappingURL=acorex-connectivity-mock-entity-delete.activity-ErEN1c24.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-entity-delete.activity-ErEN1c24.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/entity-delete.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPEntityStorageService } from '@acorex/platform/layout/entity';\n\n//#region ---- Types ----\n\nexport interface EntityDeleteInput {\n entity: string;\n id: string;\n}\n\nexport interface EntityDeleteOutput {\n success: boolean;\n error?: string;\n}\n\n//#endregion\n\n/**\n * Entity Delete Activity (Mock – Dexie)\n *\n * Deletes one entity from storage (Dexie in mock).\n * Activity type: workflow-activity:entity-delete\n * Outcomes: Done | Failed\n */\n@Injectable({ providedIn: 'root' })\nexport class EntityDeleteActivity implements AXPCommand<EntityDeleteInput, EntityDeleteOutput> {\n private readonly storage = inject(AXPEntityStorageService);\n\n async execute(\n input: EntityDeleteInput,\n ): Promise<AXPExecuteCommandResult<EntityDeleteOutput>> {\n try {\n if (!input?.entity) {\n return {\n success: false,\n message: { text: 'entity is required' },\n data: { success: false, error: 'entity is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n if (!input?.id) {\n return {\n success: false,\n message: { text: 'id is required' },\n data: { success: false, error: 'id is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n await this.storage.deleteOne(input.entity, input.id);\n\n return {\n success: true,\n data: { success: true },\n metadata: { outcome: 'Done' },\n };\n } catch (error: any) {\n return {\n success: false,\n message: { text: error?.message ?? 'Delete failed' },\n data: { success: false, error: error?.message ?? 'Delete failed' },\n metadata: { outcome: 'Failed' },\n };\n }\n }\n}\n"],"names":[],"mappings":";;;;AAiBA;AAEA;;;;;;AAMG;MAEU,oBAAoB,CAAA;AADjC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,u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;aAChC;QACH;IACF;8GAvCW,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAApB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Injectable } from '@angular/core';
|
|
3
|
-
import { AXPEntityStorageService } from '@acorex/platform/layout/entity';
|
|
4
|
-
|
|
5
|
-
//#endregion
|
|
6
|
-
/**
|
|
7
|
-
* Entity Read Activity (Mock – Dexie)
|
|
8
|
-
*
|
|
9
|
-
* Loads one entity by id from storage (Dexie in mock).
|
|
10
|
-
* Activity type: workflow-activity:entity-read
|
|
11
|
-
* Outcomes: Done | NotFound | Failed
|
|
12
|
-
*/
|
|
13
|
-
class EntityReadActivity {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.storage = inject(AXPEntityStorageService);
|
|
16
|
-
}
|
|
17
|
-
async execute(input) {
|
|
18
|
-
try {
|
|
19
|
-
if (!input?.entity) {
|
|
20
|
-
return {
|
|
21
|
-
success: false,
|
|
22
|
-
message: { text: 'entity is required' },
|
|
23
|
-
data: { data: null, success: false, error: 'entity is required' },
|
|
24
|
-
metadata: { outcome: 'Failed' },
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
if (!input?.id) {
|
|
28
|
-
return {
|
|
29
|
-
success: false,
|
|
30
|
-
message: { text: 'id is required' },
|
|
31
|
-
data: { data: null, success: false, error: 'id is required' },
|
|
32
|
-
metadata: { outcome: 'Failed' },
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
const data = await this.storage.getOne(input.entity, input.id);
|
|
36
|
-
if (data == null) {
|
|
37
|
-
return {
|
|
38
|
-
success: true,
|
|
39
|
-
data: { data: null, success: false, error: 'Not found' },
|
|
40
|
-
metadata: { outcome: 'NotFound' },
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
return {
|
|
44
|
-
success: true,
|
|
45
|
-
data: { data, success: true },
|
|
46
|
-
metadata: { outcome: 'Done' },
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
return {
|
|
51
|
-
success: false,
|
|
52
|
-
message: { text: error?.message ?? 'Read failed' },
|
|
53
|
-
data: { data: null, success: false, error: error?.message ?? 'Read failed' },
|
|
54
|
-
metadata: { outcome: 'Failed' },
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EntityReadActivity, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
59
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EntityReadActivity, providedIn: 'root' }); }
|
|
60
|
-
}
|
|
61
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EntityReadActivity, decorators: [{
|
|
62
|
-
type: Injectable,
|
|
63
|
-
args: [{ providedIn: 'root' }]
|
|
64
|
-
}] });
|
|
65
|
-
|
|
66
|
-
export { EntityReadActivity };
|
|
67
|
-
//# sourceMappingURL=acorex-connectivity-mock-entity-read.activity-1fJW8gVe.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-entity-read.activity-1fJW8gVe.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/entity-read.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPEntityStorageService } from '@acorex/platform/layout/entity';\n\n//#region ---- Types ----\n\nexport interface EntityReadInput {\n entity: string;\n id: string;\n}\n\nexport interface EntityReadOutput {\n data: any;\n success: boolean;\n error?: string;\n}\n\n//#endregion\n\n/**\n * Entity Read Activity (Mock – Dexie)\n *\n * Loads one entity by id from storage (Dexie in mock).\n * Activity type: workflow-activity:entity-read\n * Outcomes: Done | NotFound | Failed\n */\n@Injectable({ providedIn: 'root' })\nexport class EntityReadActivity implements AXPCommand<EntityReadInput, EntityReadOutput> {\n private readonly storage = inject(AXPEntityStorageService);\n\n async execute(\n input: EntityReadInput,\n ): Promise<AXPExecuteCommandResult<EntityReadOutput>> {\n try {\n if (!input?.entity) {\n return {\n success: false,\n message: { text: 'entity is required' },\n data: { data: null, success: false, error: 'entity is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n if (!input?.id) {\n return {\n success: false,\n message: { text: 'id is required' },\n data: { data: null, success: false, error: 'id is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const data = await this.storage.getOne(input.entity, input.id);\n\n if (data == null) {\n return {\n success: true,\n data: { data: null, success: false, error: 'Not found' },\n metadata: { outcome: 'NotFound' },\n };\n }\n\n return {\n success: true,\n data: { data, success: true },\n metadata: { outcome: 'Done' },\n };\n } catch (error: any) {\n return {\n success: false,\n message: { text: error?.message ?? 'Read failed' },\n data: { data: null, success: false, error: error?.message ?? 'Read failed' },\n metadata: { outcome: 'Failed' },\n };\n }\n }\n}\n"],"names":[],"mappings":";;;;AAkBA;AAEA;;;;;;AAMG;MAEU,kBAAkB,CAAA;AAD/B,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,uBAAuB,CAAC;AA+C3D,IAAA;IA7CC,MAAM,OAAO,CACX,K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QAAE,OAAO,KAAU,EAAE;YACnB,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE;AAClD,gBAAA,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE;AAC5E,gBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;aAChC;QACH;IACF;8GA/CW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,cADL,MAAM,EAAA,CAAA,CAAA;;2FACnB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAD9B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Injectable } from '@angular/core';
|
|
3
|
-
import { AXPEntityStorageService } from '@acorex/platform/layout/entity';
|
|
4
|
-
|
|
5
|
-
//#endregion
|
|
6
|
-
/**
|
|
7
|
-
* Entity Update Activity (Mock – Dexie)
|
|
8
|
-
*
|
|
9
|
-
* Updates one entity in storage (Dexie in mock).
|
|
10
|
-
* Activity type: workflow-activity:entity-update
|
|
11
|
-
* Outcomes: Done | Failed
|
|
12
|
-
*/
|
|
13
|
-
class EntityUpdateActivity {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.storage = inject(AXPEntityStorageService);
|
|
16
|
-
}
|
|
17
|
-
async execute(input) {
|
|
18
|
-
try {
|
|
19
|
-
if (!input?.entity) {
|
|
20
|
-
return {
|
|
21
|
-
success: false,
|
|
22
|
-
message: { text: 'entity is required' },
|
|
23
|
-
data: { data: null, success: false, error: 'entity is required' },
|
|
24
|
-
metadata: { outcome: 'Failed' },
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
if (!input?.id) {
|
|
28
|
-
return {
|
|
29
|
-
success: false,
|
|
30
|
-
message: { text: 'id is required' },
|
|
31
|
-
data: { data: null, success: false, error: 'id is required' },
|
|
32
|
-
metadata: { outcome: 'Failed' },
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
if (!input.data || typeof input.data !== 'object') {
|
|
36
|
-
return {
|
|
37
|
-
success: false,
|
|
38
|
-
message: { text: 'data is required' },
|
|
39
|
-
data: { data: null, success: false, error: 'data is required' },
|
|
40
|
-
metadata: { outcome: 'Failed' },
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
const updated = await this.storage.updateOne(input.entity, input.id, input.data);
|
|
44
|
-
return {
|
|
45
|
-
success: true,
|
|
46
|
-
data: { data: updated, success: true },
|
|
47
|
-
metadata: { outcome: 'Done' },
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
catch (error) {
|
|
51
|
-
return {
|
|
52
|
-
success: false,
|
|
53
|
-
message: { text: error?.message ?? 'Update failed' },
|
|
54
|
-
data: { data: null, success: false, error: error?.message ?? 'Update failed' },
|
|
55
|
-
metadata: { outcome: 'Failed' },
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EntityUpdateActivity, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
60
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EntityUpdateActivity, providedIn: 'root' }); }
|
|
61
|
-
}
|
|
62
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EntityUpdateActivity, decorators: [{
|
|
63
|
-
type: Injectable,
|
|
64
|
-
args: [{ providedIn: 'root' }]
|
|
65
|
-
}] });
|
|
66
|
-
|
|
67
|
-
export { EntityUpdateActivity };
|
|
68
|
-
//# sourceMappingURL=acorex-connectivity-mock-entity-update.activity-06HTKiQQ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-entity-update.activity-06HTKiQQ.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/entity-update.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPEntityStorageService } from '@acorex/platform/layout/entity';\n\n//#region ---- Types ----\n\nexport interface EntityUpdateInput {\n entity: string;\n id: string;\n data: Record<string, any>;\n}\n\nexport interface EntityUpdateOutput {\n data: any;\n success: boolean;\n error?: string;\n}\n\n//#endregion\n\n/**\n * Entity Update Activity (Mock – Dexie)\n *\n * Updates one entity in storage (Dexie in mock).\n * Activity type: workflow-activity:entity-update\n * Outcomes: Done | Failed\n */\n@Injectable({ providedIn: 'root' })\nexport class EntityUpdateActivity implements AXPCommand<EntityUpdateInput, EntityUpdateOutput> {\n private readonly storage = inject(AXPEntityStorageService);\n\n async execute(\n input: EntityUpdateInput,\n ): Promise<AXPExecuteCommandResult<EntityUpdateOutput>> {\n\n\n try {\n if (!input?.entity) {\n return {\n success: false,\n message: { text: 'entity is required' },\n data: { data: null, success: false, error: 'entity is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n if (!input?.id) {\n return {\n success: false,\n message: { text: 'id is required' },\n data: { data: null, success: false, error: 'id is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n if (!input.data || typeof input.data !== 'object') {\n return {\n success: false,\n message: { text: 'data is required' },\n data: { data: null, success: false, error: 'data is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const updated = await this.storage.updateOne(input.entity, input.id, input.data as any);\n\n return {\n success: true,\n data: { data: updated, success: true },\n metadata: { outcome: 'Done' },\n };\n } catch (error: any) {\n return {\n success: false,\n message: { text: error?.message ?? 'Update failed' },\n data: { data: null, success: false, error: error?.message ?? 'Update failed' },\n metadata: { outcome: 'Failed' },\n };\n }\n }\n}\n"],"names":[],"mappings":";;;;AAmBA;AAEA;;;;;;AAMG;MAEU,oBAAoB,CAAA;AADjC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAiD3D,IAAA;IA/CC,MAAM,OAAO,CACX,KAAwB,EAAA;AAIxB,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE;gBAClB,OAAO;AACL,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE;AACvC,oBAAA,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE;AACjE,oBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;iBAChC;YACH;AACA,YAAA,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE;gBACd,OAAO;AACL,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;AACnC,oBAAA,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE;AAC7D,oBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;iBAChC;YACH;AACA,YAAA,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;gBACjD,OAAO;A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nB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { AXPAiEngine, AXPAiChatToolRunContextService } from '@acorex/modules/ai-management';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, Injectable } from '@angular/core';
|
|
4
|
-
|
|
5
|
-
function parseExtractInput(args) {
|
|
6
|
-
const obj = args != null && typeof args === 'object' && !Array.isArray(args)
|
|
7
|
-
? args
|
|
8
|
-
: null;
|
|
9
|
-
if (!obj) {
|
|
10
|
-
return { ok: false, error: 'Invalid arguments: expected an object.' };
|
|
11
|
-
}
|
|
12
|
-
const fileId = typeof obj['fileId'] === 'string' ? obj['fileId'].trim() : '';
|
|
13
|
-
if (!fileId) {
|
|
14
|
-
return { ok: false, error: 'Invalid arguments: "fileId" is required.' };
|
|
15
|
-
}
|
|
16
|
-
const instruction = typeof obj['instruction'] === 'string' ? obj['instruction'].trim() : undefined;
|
|
17
|
-
return { ok: true, fileId, ...(instruction ? { instruction } : {}) };
|
|
18
|
-
}
|
|
19
|
-
class AiManagementExtractDocumentTextCommand {
|
|
20
|
-
constructor() {
|
|
21
|
-
this.engine = inject(AXPAiEngine);
|
|
22
|
-
this.runContext = inject(AXPAiChatToolRunContextService);
|
|
23
|
-
}
|
|
24
|
-
async execute(input) {
|
|
25
|
-
const ctx = this.runContext.getContext();
|
|
26
|
-
const parsed = parseExtractInput(input);
|
|
27
|
-
if (!parsed.ok) {
|
|
28
|
-
return { success: false, message: { text: parsed.error } };
|
|
29
|
-
}
|
|
30
|
-
const assistId = ctx?.assistId?.trim() ?? input.assistId?.trim();
|
|
31
|
-
const chatTransport = ctx?.chatTransport ?? input.chatTransport;
|
|
32
|
-
const modelEntityId = ctx?.modelEntityId ?? input.modelEntityId;
|
|
33
|
-
if (!assistId || !chatTransport) {
|
|
34
|
-
return {
|
|
35
|
-
success: false,
|
|
36
|
-
message: {
|
|
37
|
-
text: 'Document extraction requires assist id and chat transport (active chat context or input fields).',
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
try {
|
|
42
|
-
const data = await this.engine.extractDocumentTextFromStoredFile({
|
|
43
|
-
assistId,
|
|
44
|
-
chatTransport,
|
|
45
|
-
modelEntityId,
|
|
46
|
-
fileId: parsed.fileId,
|
|
47
|
-
instruction: parsed.instruction,
|
|
48
|
-
});
|
|
49
|
-
return { success: true, data };
|
|
50
|
-
}
|
|
51
|
-
catch (e) {
|
|
52
|
-
const msg = e instanceof Error ? e.message : String(e);
|
|
53
|
-
return { success: false, message: { text: msg } };
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AiManagementExtractDocumentTextCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
57
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AiManagementExtractDocumentTextCommand }); }
|
|
58
|
-
}
|
|
59
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AiManagementExtractDocumentTextCommand, decorators: [{
|
|
60
|
-
type: Injectable
|
|
61
|
-
}] });
|
|
62
|
-
|
|
63
|
-
export { AiManagementExtractDocumentTextCommand };
|
|
64
|
-
//# sourceMappingURL=acorex-connectivity-mock-extract-document-text.command-nGfUTSf6.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-extract-document-text.command-nGfUTSf6.mjs","sources":["../../../../libs/connectivity/mock/src/lib/ai-management/commands/extract-document-text.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport type { AXPAiChatTransport } from '@acorex/modules/ai-management';\nimport { AXPAiChatToolRunContextService } from '@acorex/modules/ai-management';\nimport { Injectable, inject } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPAiEngine } from '@acorex/modules/ai-management';\n\nimport type { AXCAiEngine } from '../ai-agent-engine.mock';\n\n//#endregion\n\n//#region ---- Command ----\n\nexport interface AiManagementExtractDocumentTextInput {\n fileId?: string;\n instruction?: string;\n /** When not in an AI chat run context (e.g. document metadata prefill). */\n assistId?: string;\n chatTransport?: AXPAiChatTransport;\n modelEntityId?: string;\n}\n\nfunction parseExtractInput(args: unknown):\n | { ok: true; fileId: string; instruction?: string }\n | { ok: false; error: string } {\n const obj =\n args != null && typeof args === 'object' && !Array.isArray(args)\n ? (args as Record<string, unknown>)\n : null;\n if (!obj) {\n return { ok: false, error: 'Invalid arguments: expected an object.' };\n }\n const fileId = typeof obj['fileId'] === 'string' ? obj['fileId'].trim() : '';\n if (!fileId) {\n return { ok: false, error: 'Invalid arguments: \"fileId\" is required.' };\n }\n const instruction = typeof obj['instruction'] === 'string' ? obj['instruction'].trim() : undefined;\n return { ok: true, fileId, ...(instruction ? { instruction } : {}) };\n}\n\n@Injectable()\nexport class AiManagementExtractDocumentTextCommand\n implements AXPCommand<AiManagementExtractDocumentTextInput, { text: string }>\n{\n private readonly engine = inject(AXPAiEngine) as AXCAiEngine;\n private readonly runContext = inject(AXPAiChatToolRunContextService);\n\n async execute(\n input: AiManagementExtractDocumentTextInput,\n ): Promise<AXPExecuteCommandResult<{ text: string }>> {\n const ctx = this.runContext.getContext();\n const parsed = parseExtractInput(input);\n if (!parsed.ok) {\n return { success: false, message: { text: parsed.error } };\n }\n\n const assistId = ctx?.assistId?.trim() ?? input.assistId?.trim();\n const chatTransport = ctx?.chatTransport ?? input.chatTransport;\n const modelEntityId = ctx?.modelEntityId ?? input.modelEntityId;\n\n if (!assistId || !chatTransport) {\n return {\n success: false,\n message: {\n text: 'Document extraction requires assist id and chat transport (active chat context or input fields).',\n },\n };\n }\n\n try {\n const data = await this.engine.extractDocumentTextFromStoredFile({\n assistId,\n chatTransport,\n modelEntityId,\n fileId: parsed.fileId,\n instruction: parsed.instruction,\n });\n return { success: true, data };\n } catch (e) {\n const msg = e instanceof Error ? e.message : String(e);\n return { success: false, message: { text: msg } };\n }\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;AAwBA,SAAS,iBAAiB,CAAC,IAAa,EAAA;AAGtC,IAAA,MAAM,GAAG,GACP,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI;AAC7D,UAAG;UACD,IAAI;IACV,IAAI,CAAC,GAAG,EAAE;QACR,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,wCAAwC,EAAE;IACvE;IACA,MAAM,MAAM,GAAG,OAAO,GAAG,CAAC,QAAQ,CAAC,KAAK,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE;IAC5E,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,0CAA0C,EAAE;IACzE;IACA,MAAM,WAAW,GAAG,OAAO,GAAG,CAAC,aAAa,CAAC,KAAK,QAAQ,GAAG,GAAG,CAAC,aAAa,CAAC,CAAC,IAAI,EAAE,GAAG,SAAS;IAClG,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,WAAW,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE;AACtE;MAGa,sCAAsC,CAAA;AADnD,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,WAAW,CAAgB;AAC3C,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,8BAA8B,CAAC;AAsCrE,IAAA;IApCC,MAAM,OAAO,CACX,KAA2C,EAAA;QAE3C,MAAM,GAAG,GAAG,IAAI,CA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MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAtC,sCAAsC,EAAA,CAAA,CAAA;;2FAAtC,sCAAsC,EAAA,UAAA,EAAA,CAAA;kBADlD;;;;;"}
|
package/fesm2022/acorex-connectivity-mock-get-application-versions-chart-data.query-DwVuYuKx.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-get-application-versions-chart-data.query-DwVuYuKx.mjs","sources":["../../../../libs/connectivity/mock/src/lib/application-management/reports/get-application-versions-chart-data.query.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPQuery } from '@acorex/platform/runtime';\nimport { AXPEntityService } from '@acorex/platform/layout/entity';\nimport { AXMAppVersionEntityModel } from '@acorex/modules/application-management';\nimport { RootConfig } from '@acorex/modules/application-management';\nimport { GetApplicationVersionsTimelineQueryInput } from './get-application-versions-timeline.query';\n\n//#region ---- Query Input/Output Types ----\n\nexport interface GetApplicationVersionsChartDataQueryInput {\n filters?: Array<{\n field: string;\n operator: { type: string };\n value: any;\n }>;\n logic?: 'and' | 'or';\n}\n\nexport interface ApplicationVersionChartDataResult {\n publishDate: string;\n month: string;\n year: number;\n quarter: string;\n versionCount: number;\n}\n\nexport interface GetApplicationVersionsChartDataQueryResult {\n items: ApplicationVersionChartDataResult[];\n}\n\n//#endregion\n\n@Injectable({\n providedIn: 'root',\n})\nexport class GetApplicationVersionsChartDataQuery\n implements AXPQuery<GetApplicationVersionsChartDataQueryInput, GetApplicationVersionsChartDataQueryResult>\n{\n private readonly entityService = inject(AXPEntityService);\n private appVersionService = this.entityService\n .withEntity(`${RootConfig.module.name}.${RootConfig.entities.appVersion.name}`)\n .data<string, AXMAppVersionEntityModel>();\n\n async fetch(\n input: GetApplicationVersionsChartDataQueryInput\n ): Promise<GetApplicationVersionsChartDataQueryResult> {\n // Get all app versions from storage (no pagination for charts)\n const allVersionsResult = await this.appVersionService.query({\n skip: 0,\n take: 10000, // Get all versions for aggregation\n filter:\n input.filters && input.filters.length > 0\n ? ({\n logic: input.logic || 'and',\n filters: input.filters,\n } as any)\n : undefined,\n });\n\n let allVersions = allVersionsResult.items;\n\n // Apply custom filters after fetching\n if (input.filters) {\n for (const filter of input.filters) {\n if (filter.field === 'dateRange' && filter.value) {\n allVersions = this.applyDateRangeFilter(allVersions, filter.value);\n }\n if (filter.field === 'versionNumber' && filter.value) {\n allVersions = this.applyVersionNumberFilter(allVersions, filter.value);\n }\n }\n }\n\n // Group versions by month for chart aggregation\n const monthGroups = new Map<string, AXMAppVersionEntityModel[]>();\n\n for (const version of allVersions) {\n const publishDate = new Date(version.publishDate);\n const year = publishDate.getFullYear();\n const month = publishDate.getMonth() + 1;\n const monthKey = `${year}-${String(month).padStart(2, '0')}`;\n\n if (!monthGroups.has(monthKey)) {\n monthGroups.set(monthKey, []);\n }\n\n monthGroups.get(monthKey)!.push(version);\n }\n\n // Aggregate data by month for chart\n const chartResults: ApplicationVersionChartDataResult[] = [];\n\n for (const [monthKey, versions] of monthGroups.entries()) {\n const [year, month] = monthKey.split('-');\n const publishDate = new Date(parseInt(year), parseInt(month) - 1, 1);\n const monthName = publishDate.toLocaleString('en-US', { month: 'long' });\n const quarter = Math.ceil(parseInt(month) / 3);\n const quarterName = `Q${quarter}`;\n\n chartResults.push({\n publishDate: publishDate.toISOString(),\n month: monthName,\n year: parseInt(year),\n quarter: quarterName,\n versionCount: versions.length,\n });\n }\n\n // Sort by date ascending for timeline\n chartResults.sort((a, b) => {\n const dateA = new Date(a.publishDate).getTime();\n const dateB = new Date(b.publishDate).getTime();\n return dateA - dateB;\n });\n\n return {\n items: chartResults,\n };\n }\n\n //#region ---- Custom Filter Handlers ----\n\n /**\n * Apply date range filter to versions\n */\n private applyDateRangeFilter(versions: AXMAppVersionEntityModel[], dateRange: any): AXMAppVersionEntityModel[] {\n if (!dateRange || !dateRange.start || !dateRange.end) {\n return versions;\n }\n\n const startDate = new Date(dateRange.start);\n const endDate = new Date(dateRange.end);\n endDate.setHours(23, 59, 59, 999); // Include the entire end date\n\n return versions.filter((version) => {\n const publishDate = new Date(version.publishDate);\n return publishDate >= startDate && publishDate <= endDate;\n });\n }\n\n /**\n * Apply version number filter to versions\n */\n private applyVersionNumberFilter(\n versions: AXMAppVersionEntityModel[],\n versionNumber: string\n ): AXMAppVersionEntityModel[] {\n if (!versionNumber) {\n return versions;\n }\n\n const searchTerm = versionNumber.toLowerCase().trim();\n\n return versions.filter((version) => {\n return version.versionNumber.toLowerCase().includes(searchTerm);\n });\n }\n\n //#endregion\n}\n\n"],"names":[],"mappings":";;;;;AA8BA;MAKa,oCAAoC,CAAA;AAHjD,IAAA,WAAA,GAAA;AAMmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;QACjD,IAAA,CAAA,iBAAiB,GAAG,IAAI,CAAC;AAC9B,aAAA,UAAU,CAAC,CAAA,EAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAA,CAAA,EAAI,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE;AAC7E,aAAA,IAAI,EAAoC;AAsH5C,IAAA;IApHC,MAAM,KAAK,CACT,KAAgD,EAAA;;QAGhD,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC;AAC3D,YAAA,IAAI,EAAE,CAAC;YACP,IAAI,EAAE,KAAK;YACX,MAAM,EACJ,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG;AACtC,kBAAG;AACC,oBAAA,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,KAAK;oBAC3B,OAAO,EAAE,KAAK,CAAC,OAAO;AACf;AACX,kBAAE,SAAS;AAChB,SAAA,CAAC;AAEF,QAAA,IAAI,WAAW,GAAG,iBAAiB,CAAC,KAAK;;AAGzC,QAAA,IAAI,KAAK,CAAC,OAAO,EAAE;AACjB,YAAA,KAAK,MA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-timeline.query-sFKYynZA.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-get-application-versions-timeline.query-sFKYynZA.mjs","sources":["../../../../libs/connectivity/mock/src/lib/application-management/reports/get-application-versions-timeline.query.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPQuery } from '@acorex/platform/runtime';\nimport { AXPEntityService } from '@acorex/platform/layout/entity';\nimport { AXMAppVersionEntityModel } from '@acorex/modules/application-management';\nimport { RootConfig } from '@acorex/modules/application-management';\n\n//#region ---- Query Input/Output Types ----\n\nexport interface GetApplicationVersionsTimelineQueryInput {\n skip?: number;\n take?: number;\n sort?: Array<{ field: string; dir: 'asc' | 'desc' }>;\n filters?: Array<{\n field: string;\n operator: { type: string };\n value: any;\n }>;\n logic?: 'and' | 'or';\n}\n\nexport interface ApplicationVersionTimelineResult {\n versionNumber: string;\n publishDate: string;\n publishDateObj: Date;\n year: number;\n month: string;\n monthNumber: number;\n quarter: string;\n versionCount: number;\n}\n\nexport interface GetApplicationVersionsTimelineQueryResult {\n items: ApplicationVersionTimelineResult[];\n total: number;\n}\n\n//#endregion\n\n@Injectable({\n providedIn: 'root',\n})\nexport class GetApplicationVersionsTimelineQuery\n implements AXPQuery<GetApplicationVersionsTimelineQueryInput, GetApplicationVersionsTimelineQueryResult> {\n\n\n private readonly entityService = inject(AXPEntityService);\n private appVersionService = this.entityService\n .withEntity(`${RootConfig.module.name}.${RootConfig.entities.appVersion.name}`)\n .data<string, AXMAppVersionEntityModel>();\n\n async fetch(input: GetApplicationVersionsTimelineQueryInput): Promise<GetApplicationVersionsTimelineQueryResult> {\n // Get all app versions from storage\n const allVersionsResult = await this.appVersionService.query({\n skip: 0,\n take: 10000, // Get all versions for aggregation\n filter:\n input.filters && input.filters.length > 0\n ? ({\n logic: input.logic || 'and',\n filters: input.filters,\n } as any)\n : undefined,\n });\n\n let allVersions = allVersionsResult.items;\n\n // Apply date range filter if provided\n if (input.filters) {\n for (const filter of input.filters) {\n if (filter.field === 'dateRange' && filter.value) {\n allVersions = this.applyDateRangeFilter(allVersions, filter.value);\n }\n if (filter.field === 'versionNumber' && filter.value) {\n allVersions = this.applyVersionNumberFilter(allVersions, filter.value);\n }\n }\n }\n\n // Group versions by time period (month/quarter/year)\n const periodGroups = new Map<string, AXMAppVersionEntityModel[]>();\n\n for (const version of allVersions) {\n const publishDate = new Date(version.publishDate);\n const year = publishDate.getFullYear();\n const month = publishDate.getMonth() + 1;\n const quarter = Math.ceil(month / 3);\n const monthName = publishDate.toLocaleString('en-US', { month: 'long' });\n const quarterName = `Q${quarter}`;\n const periodKey = `${year}-${String(month).padStart(2, '0')}`;\n\n if (!periodGroups.has(periodKey)) {\n periodGroups.set(periodKey, []);\n }\n\n periodGroups.get(periodKey)!.push(version);\n }\n\n // Create timeline results\n const timelineResults: ApplicationVersionTimelineResult[] = [];\n\n for (const version of allVersions) {\n const publishDate = new Date(version.publishDate);\n const year = publishDate.getFullYear();\n const month = publishDate.getMonth() + 1;\n const quarter = Math.ceil(month / 3);\n const monthName = publishDate.toLocaleString('en-US', { month: 'long' });\n const quarterName = `Q${quarter}`;\n const periodKey = `${year}-${String(month).padStart(2, '0')}`;\n\n const versionsInPeriod = periodGroups.get(periodKey)?.length || 0;\n\n timelineResults.push({\n versionNumber: version.versionNumber,\n publishDate: version.publishDate,\n publishDateObj: publishDate,\n year,\n month: monthName,\n monthNumber: month,\n quarter: quarterName,\n versionCount: versionsInPeriod,\n });\n }\n\n // Apply sorting if provided\n if (input.sort && input.sort.length > 0) {\n timelineResults.sort((a, b) => {\n for (const sortField of input.sort!) {\n const field = sortField.field as keyof ApplicationVersionTimelineResult;\n const aValue = a[field];\n const bValue = b[field];\n const dir = sortField.dir === 'asc' ? 1 : -1;\n\n // Handle undefined values\n if (aValue === undefined && bValue === undefined) continue;\n if (aValue === undefined) return 1 * dir;\n if (bValue === undefined) return -1 * dir;\n\n // Handle date comparison\n if (field === 'publishDateObj') {\n const aDate = a.publishDateObj.getTime();\n const bDate = b.publishDateObj.getTime();\n if (aDate < bDate) return -1 * dir;\n if (aDate > bDate) return 1 * dir;\n continue;\n }\n\n if (aValue < bValue) return -1 * dir;\n if (aValue > bValue) return 1 * dir;\n }\n return 0;\n });\n } else {\n // Default sort by publish date descending (newest first)\n timelineResults.sort((a, b) => {\n return b.publishDateObj.getTime() - a.publishDateObj.getTime();\n });\n }\n\n // Apply pagination\n const skip = input.skip || 0;\n const take = input.take || 10;\n const total = timelineResults.length;\n const items = timelineResults.slice(skip, skip + take);\n\n return {\n items,\n total,\n };\n }\n\n //#region ---- Custom Filter Handlers ----\n\n /**\n * Apply date range filter to versions\n */\n private applyDateRangeFilter(versions: AXMAppVersionEntityModel[], dateRange: any): AXMAppVersionEntityModel[] {\n if (!dateRange || !dateRange.start || !dateRange.end) {\n return versions;\n }\n\n const startDate = new Date(dateRange.start);\n const endDate = new Date(dateRange.end);\n endDate.setHours(23, 59, 59, 999); // Include the entire end date\n\n return versions.filter((version) => {\n const publishDate = new Date(version.publishDate);\n return publishDate >= startDate && publishDate <= endDate;\n });\n }\n\n /**\n * Apply version number filter to versions\n */\n private applyVersionNumberFilter(\n versions: AXMAppVersionEntityModel[],\n versionNumber: string\n ): AXMAppVersionEntityModel[] {\n if (!versionNumber) {\n return versions;\n }\n\n const searchTerm = versionNumber.toLowerCase().trim();\n\n return versions.filter((version) => {\n return version.versionNumber.toLowerCase().includes(searchTerm);\n });\n }\n\n //#endregion\n}\n\n"],"names":[],"mappings":";;;;;AAoCA;MAKa,mCAAmC,CAAA;AAHhD,IAAA,WAAA,GAAA;AAOmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;QACjD,IAAA,CAAA,iBAAiB,GAAG,IAAI,CAAC;AAC9B,aAAA,UAAU,CAAC,CAAA,EAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAA,CAAA,EAAI,UAAU,CAAC,QAAQ,CAAC,UAAU,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GAAG,CAAC,CAAC;AAElC,QAAA,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,KAAI;YACjC,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;AACjD,YAAA,OAAO,WAAW,IAAI,SAAS,IAAI,WAAW,IAAI,OAAO;AAC3D,QAAA,CAAC,CAAC;IACJ;AAEA;;AAEG;IACK,wBAAwB,CAC9B,QAAoC,EACpC,aAAqB,EAAA;QAErB,IAAI,CAAC,aAAa,EAAE;AAClB,YAAA,OAAO,QAAQ;QACjB;QAEA,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE;AAErD,QAAA,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,KAAI;YACjC,OAAO,OAAO,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC;AACjE,QAAA,CAAC,CAAC;IACJ;8GArKW,mCAAmC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnC,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mCAAmC,cAFlC,MAAM,EAAA,CAAA,CAAA;;2FAEP,mCAAmC,EAAA,UAAA,EAAA,CAAA;kBAH/C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Injectable } from '@angular/core';
|
|
3
|
-
import { AXPSessionService } from '@acorex/platform/auth';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Returns the platform user id of the current session (workflow initiator when run in UI).
|
|
7
|
-
*
|
|
8
|
-
* Activity Type: workflow-activity:get-current-session-user
|
|
9
|
-
*/
|
|
10
|
-
class GetCurrentSessionUserActivity {
|
|
11
|
-
constructor() {
|
|
12
|
-
this.sessionService = inject(AXPSessionService);
|
|
13
|
-
}
|
|
14
|
-
async execute() {
|
|
15
|
-
const userId = this.sessionService.user?.id ?? null;
|
|
16
|
-
console.log('[WFM-LifecycleTaskTrace] get-current-session-user', {
|
|
17
|
-
userId,
|
|
18
|
-
hasSession: !!this.sessionService.user,
|
|
19
|
-
});
|
|
20
|
-
return {
|
|
21
|
-
success: true,
|
|
22
|
-
data: { userId },
|
|
23
|
-
metadata: {
|
|
24
|
-
outcome: 'Done',
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: GetCurrentSessionUserActivity, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
29
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: GetCurrentSessionUserActivity, providedIn: 'root' }); }
|
|
30
|
-
}
|
|
31
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: GetCurrentSessionUserActivity, decorators: [{
|
|
32
|
-
type: Injectable,
|
|
33
|
-
args: [{
|
|
34
|
-
providedIn: 'root',
|
|
35
|
-
}]
|
|
36
|
-
}] });
|
|
37
|
-
|
|
38
|
-
export { GetCurrentSessionUserActivity };
|
|
39
|
-
//# sourceMappingURL=acorex-connectivity-mock-get-current-session-user.activity-CsmxwXsM.mjs.map
|
package/fesm2022/acorex-connectivity-mock-get-current-session-user.activity-CsmxwXsM.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-get-current-session-user.activity-CsmxwXsM.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/get-current-session-user.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPSessionService } from '@acorex/platform/auth';\n\nexport interface GetCurrentSessionUserOutput {\n userId: string | null;\n}\n\n/**\n * Returns the platform user id of the current session (workflow initiator when run in UI).\n *\n * Activity Type: workflow-activity:get-current-session-user\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class GetCurrentSessionUserActivity\n implements AXPCommand<Record<string, never>, GetCurrentSessionUserOutput>\n{\n private readonly sessionService = inject(AXPSessionService);\n\n async execute(): Promise<AXPExecuteCommandResult<GetCurrentSessionUserOutput>> {\n const userId = this.sessionService.user?.id ?? null;\n console.log('[WFM-LifecycleTaskTrace] get-current-session-user', {\n userId,\n hasSession: !!this.sessionService.user,\n });\n return {\n success: true,\n data: { userId },\n metadata: {\n outcome: 'Done',\n },\n };\n }\n}\n"],"names":[],"mappings":";;;;AASA;;;;AAIG;MAIU,6BAA6B,CAAA;AAH1C,IAAA,WAAA,GAAA;AAMmB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAgB5D,IAAA;AAdC,IAAA,MAAM,OAAO,GAAA;QACX,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,EAAE,IAAI,IAAI;AACnD,QAAA,OAAO,CAAC,GAAG,CAAC,mDAAmD,EAAE;YAC/D,MAAM;AACN,YAAA,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI;AACvC,SAAA,CAAC;QACF,OAAO;AACL,YAAA,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,EAAE,MAAM,EAAE;AAChB,YAAA,QAAQ,EAAE;AACR,gBAAA,OAAO,EAAE,MAAM;AAChB,aAAA;SACF;IACH;8GAlBW,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA7B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,6BAA6B,cAF5B,MAAM,EAAA,CAAA,CAAA;;2FAEP,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBAHzC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Injectable } from '@angular/core';
|
|
3
|
-
import { AXPEntityStorageService } from '@acorex/platform/layout/entity';
|
|
4
|
-
import { AXPSessionService } from '@acorex/platform/auth';
|
|
5
|
-
|
|
6
|
-
const EMPLOYEE_ENTITY = 'HumanCapitalManagement.Employee';
|
|
7
|
-
/**
|
|
8
|
-
* Get Current User Manager Activity (Backend - Mock)
|
|
9
|
-
*
|
|
10
|
-
* Resolves the manager of the current user (Employee → managerId → manager's userId).
|
|
11
|
-
* Use when assigning a review task to the current user's manager (e.g. questionnaire review)
|
|
12
|
-
* without a leave request or other ref entity.
|
|
13
|
-
*
|
|
14
|
-
* Execution Mode: backend
|
|
15
|
-
* Activity Type: workflow-activity:get-current-user-manager
|
|
16
|
-
*/
|
|
17
|
-
class GetCurrentUserManagerActivity {
|
|
18
|
-
constructor() {
|
|
19
|
-
this.entityStorage = inject(AXPEntityStorageService);
|
|
20
|
-
this.sessionService = inject(AXPSessionService);
|
|
21
|
-
}
|
|
22
|
-
async execute() {
|
|
23
|
-
let managerId = null;
|
|
24
|
-
const userId = this.sessionService.user?.id;
|
|
25
|
-
if (userId) {
|
|
26
|
-
try {
|
|
27
|
-
const result = await this.entityStorage.query(EMPLOYEE_ENTITY, {
|
|
28
|
-
skip: 0,
|
|
29
|
-
take: 1,
|
|
30
|
-
filter: {
|
|
31
|
-
field: 'userId',
|
|
32
|
-
operator: { type: 'equal' },
|
|
33
|
-
value: userId,
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
const employees = result.items;
|
|
37
|
-
const employee = employees?.[0];
|
|
38
|
-
const managerEmployeeId = employee?.managerId;
|
|
39
|
-
if (managerEmployeeId) {
|
|
40
|
-
const managerEmp = (await this.entityStorage.getOne(EMPLOYEE_ENTITY, managerEmployeeId));
|
|
41
|
-
managerId = managerEmp?.userId ?? managerEmployeeId;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
catch {
|
|
45
|
-
// keep managerId null
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return {
|
|
49
|
-
success: true,
|
|
50
|
-
data: {
|
|
51
|
-
managerId,
|
|
52
|
-
},
|
|
53
|
-
metadata: {
|
|
54
|
-
outcome: 'Done',
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: GetCurrentUserManagerActivity, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
59
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: GetCurrentUserManagerActivity, providedIn: 'root' }); }
|
|
60
|
-
}
|
|
61
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: GetCurrentUserManagerActivity, decorators: [{
|
|
62
|
-
type: Injectable,
|
|
63
|
-
args: [{
|
|
64
|
-
providedIn: 'root',
|
|
65
|
-
}]
|
|
66
|
-
}] });
|
|
67
|
-
|
|
68
|
-
export { GetCurrentUserManagerActivity };
|
|
69
|
-
//# sourceMappingURL=acorex-connectivity-mock-get-current-user-manager.activity-C1mj2bgB.mjs.map
|
package/fesm2022/acorex-connectivity-mock-get-current-user-manager.activity-C1mj2bgB.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-get-current-user-manager.activity-C1mj2bgB.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/get-current-user-manager.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPEntityStorageService } from '@acorex/platform/layout/entity';\nimport { AXPSessionService } from '@acorex/platform/auth';\n\nconst EMPLOYEE_ENTITY = 'HumanCapitalManagement.Employee';\n\nexport interface GetCurrentUserManagerOutput {\n managerId: string | null;\n}\n\n/**\n * Get Current User Manager Activity (Backend - Mock)\n *\n * Resolves the manager of the current user (Employee → managerId → manager's userId).\n * Use when assigning a review task to the current user's manager (e.g. questionnaire review)\n * without a leave request or other ref entity.\n *\n * Execution Mode: backend\n * Activity Type: workflow-activity:get-current-user-manager\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class GetCurrentUserManagerActivity implements AXPCommand<Record<string, never>, GetCurrentUserManagerOutput> {\n private readonly entityStorage = inject(AXPEntityStorageService);\n private readonly sessionService = inject(AXPSessionService);\n\n async execute(): Promise<AXPExecuteCommandResult<GetCurrentUserManagerOutput>> {\n let managerId: string | null = null;\n const userId = this.sessionService.user?.id;\n\n if (userId) {\n try {\n const result = await this.entityStorage.query(EMPLOYEE_ENTITY, {\n skip: 0,\n take: 1,\n filter: {\n field: 'userId',\n operator: { type: 'equal' },\n value: userId,\n },\n });\n const employees = result.items as { id: string; managerId?: string | null }[] | undefined;\n const employee = employees?.[0];\n const managerEmployeeId = employee?.managerId;\n\n if (managerEmployeeId) {\n const managerEmp = (await this.entityStorage.getOne(EMPLOYEE_ENTITY, managerEmployeeId)) as {\n userId?: string;\n } | null;\n managerId = managerEmp?.userId ?? managerEmployeeId;\n }\n } catch {\n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