@acorex/connectivity 21.0.0-next.63 → 21.0.0-next.65
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-connectivity-mock-acorex-connectivity-mock-U3_OWcLL.mjs → acorex-connectivity-mock-acorex-connectivity-mock--5Xrsmgy.mjs} +23100 -23089
- package/fesm2022/acorex-connectivity-mock-acorex-connectivity-mock--5Xrsmgy.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-assign-to-manager.activity-BRdgF2Nt.mjs → acorex-connectivity-mock-assign-to-manager.activity-NlqPDd5p.mjs} +2 -2
- package/fesm2022/{acorex-connectivity-mock-assign-to-manager.activity-BRdgF2Nt.mjs.map → acorex-connectivity-mock-assign-to-manager.activity-NlqPDd5p.mjs.map} +1 -1
- package/fesm2022/{acorex-connectivity-mock-chat-generate-image.command-D6HSaQY0.mjs → acorex-connectivity-mock-chat-generate-image.command-CzaHjSnU.mjs} +11 -3
- package/fesm2022/acorex-connectivity-mock-chat-generate-image.command-CzaHjSnU.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-chat-synthesize-speech.command-DkSFKM1o.mjs → acorex-connectivity-mock-chat-synthesize-speech.command-P5gOvT0K.mjs} +2 -2
- package/fesm2022/{acorex-connectivity-mock-chat-synthesize-speech.command-DkSFKM1o.mjs.map → acorex-connectivity-mock-chat-synthesize-speech.command-P5gOvT0K.mjs.map} +1 -1
- package/fesm2022/{acorex-connectivity-mock-chat-transcribe-speech.command-CGB_ud93.mjs → acorex-connectivity-mock-chat-transcribe-speech.command-B1v1x3zx.mjs} +2 -2
- package/fesm2022/{acorex-connectivity-mock-chat-transcribe-speech.command-CGB_ud93.mjs.map → acorex-connectivity-mock-chat-transcribe-speech.command-B1v1x3zx.mjs.map} +1 -1
- package/fesm2022/{acorex-connectivity-mock-user-roles-for-list-column.query-1lSQeAEv.mjs → acorex-connectivity-mock-user-roles-for-list-column.query-nadNnJKc.mjs} +2 -2
- package/fesm2022/{acorex-connectivity-mock-user-roles-for-list-column.query-1lSQeAEv.mjs.map → acorex-connectivity-mock-user-roles-for-list-column.query-nadNnJKc.mjs.map} +1 -1
- package/fesm2022/acorex-connectivity-mock.mjs +1 -1
- package/package.json +2 -2
- package/types/acorex-connectivity-mock.d.ts +59 -17
- package/fesm2022/acorex-connectivity-mock-acorex-connectivity-mock-U3_OWcLL.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-chat-generate-image.command-D6HSaQY0.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-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-validate-all-signatures.activity-JuHjNFFS.mjs +0 -61
- package/fesm2022/acorex-connectivity-mock-validate-all-signatures.activity-JuHjNFFS.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-chat-generate-image.command-D6HSaQY0.mjs","sources":["../../../../libs/connectivity/mock/src/lib/ai-management/commands/chat-generate-image.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport {\n AI_CHAT_GENERATED_IMAGE_REF_TYPE,\n AI_GENERATED_IMAGE_MAX_REMOTE_URL_IN_TOOL,\n AXPAiChatToolRunContextService,\n blobOrFileFromImageResult,\n persistAiGeneratedImage,\n RootConfig,\n} from '@acorex/modules/ai-management';\nimport { Injectable, inject } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPFileStorageService } from '@acorex/platform/common';\nimport { AXPEntityService } from '@acorex/platform/layout/entity';\n\nimport type { AXMAiAssistRow } from '../ai-agent-engine.types';\nimport { resolveDelegatedAssistOptionModel } from '../ai-delegated-agent-parameters.util';\nimport { AXCAiChatRouterService } from '../chat/ai-chat-router.service';\nimport { AXMAiModelStableIds } from '../model/model.mock';\n\n//#endregion\n\n//#region ---- Command: AiManagement:ChatGenerateImage ----\n\nexport interface AiManagementChatGenerateImageInput {\n /**\n * Catalog `AiModel` row id for an image-purpose model. When omitted, uses\n * `delegatedAgents[].options.model` for the active delegated specialist (`agentId` in run context),\n * then falls back to the mock catalog default (OpenAI gpt-image-1).\n */\n model?: string;\n prompt?: string;\n size?: string;\n style?: string;\n}\n\nfunction parseGenerateImageInput(args: unknown):\n | { ok: true; model?: string; prompt: string; size?: string; style?: 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 prompt = typeof obj['prompt'] === 'string' ? obj['prompt'].trim() : '';\n if (!prompt) {\n return { ok: false, error: 'Invalid arguments: \"prompt\" is required and must be non-empty.' };\n }\n const model = typeof obj['model'] === 'string' ? obj['model'].trim() : undefined;\n const size = typeof obj['size'] === 'string' ? obj['size'].trim() : undefined;\n const style = typeof obj['style'] === 'string' ? obj['style'].trim() : undefined;\n return {\n ok: true,\n prompt,\n ...(model ? { model } : {}),\n ...(size ? { size } : {}),\n ...(style ? { style } : {}),\n };\n}\n\n@Injectable()\nexport class AiManagementChatGenerateImageCommand\n implements AXPCommand<AiManagementChatGenerateImageInput, { fileId?: string; prompt: string; imageUrl?: string }>\n{\n private readonly aiChatRouter = inject(AXCAiChatRouterService);\n private readonly runContext = inject(AXPAiChatToolRunContextService);\n private readonly fileStorage = inject(AXPFileStorageService);\n private readonly entityService = inject(AXPEntityService);\n\n private readonly assistData = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.assist.name)\n .data<string, AXMAiAssistRow, AXMAiAssistRow, AXMAiAssistRow, AXMAiAssistRow>();\n\n async execute(\n input: AiManagementChatGenerateImageInput,\n ): Promise<AXPExecuteCommandResult<{ fileId?: string; prompt: string; imageUrl?: string }>> {\n const ctx = this.runContext.getContext();\n if (!ctx?.assistId?.trim()) {\n return {\n success: false,\n message: {\n text: 'Image generation requires an active AI chat run context (assist id).',\n },\n };\n }\n\n const parsed = parseGenerateImageInput(input);\n if (!parsed.ok) {\n return { success: false, message: { text: parsed.error } };\n }\n\n try {\n const assist = await this.assistData.byKey(ctx.assistId.trim());\n if (!assist) {\n return {\n success: false,\n message: { text: `Assist row was not found (id: ${ctx.assistId.trim()}).` },\n };\n }\n\n const modelEntityId =\n parsed.model?.trim() ||\n resolveDelegatedAssistOptionModel(assist, ctx.agentId) ||\n AXMAiModelStableIds.openaiGptImage1;\n\n let composedPrompt = parsed.prompt;\n if (parsed.style?.trim()) {\n composedPrompt = `${composedPrompt}\\nStyle: ${parsed.style.trim()}`;\n }\n\n const { imageUrl } = await this.aiChatRouter.generateImage({\n modelEntityId,\n prompt: composedPrompt,\n size: parsed.size?.trim() || undefined,\n });\n\n try {\n const file = await blobOrFileFromImageResult(imageUrl);\n const { fileId } = await persistAiGeneratedImage(this.fileStorage, file, {\n refId: assist.id,\n refType: AI_CHAT_GENERATED_IMAGE_REF_TYPE,\n });\n return { success: true, data: { fileId, prompt: parsed.prompt } };\n } catch (persistErr) {\n const u = imageUrl.trim();\n if (u.startsWith('https://') && u.length <= AI_GENERATED_IMAGE_MAX_REMOTE_URL_IN_TOOL) {\n return {\n success: true,\n data: { prompt: parsed.prompt, imageUrl: u },\n };\n }\n const pmsg = persistErr instanceof Error ? persistErr.message : String(persistErr);\n throw new Error(`Could not store generated image for chat replay. ${pmsg}`);\n }\n } catch (e) {\n const msg = e instanceof Error ? e.message : String(e);\n return { success: false, message: { text: msg } };\n }\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AyC,EAAE;oBACrF,OAAO;AACL,wBAAA,OAAO,EAAE,IAAI;wBACb,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE;qBAC7C;gBACH;AACA,gBAAA,MAAM,IAAI,GAAG,UAAU,YAAY,KAAK,GAAG,UAAU,CAAC,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC;AAClF,gBAAA,MAAM,IAAI,KAAK,CAAC,oDAAoD,IAAI,CAAA,CAAE,CAAC;YAC7E;QACF;QAAE,OAAO,CAAC,EAAE;AACV,YAAA,MAAM,GAAG,GAAG,CAAC,YAAY,KAAK,GAAG,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC;AACtD,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;QACnD;IACF;8GA7EW,oCAAoC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAApC,oCAAoC,EAAA,CAAA,CAAA;;2FAApC,oCAAoC,EAAA,UAAA,EAAA,CAAA;kBADhD;;;;;"}
|
|
@@ -1,56 +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
|
-
* Complete Signature Process Activity (Backend - Mock)
|
|
8
|
-
*
|
|
9
|
-
* Completes the signature process and updates the entity record.
|
|
10
|
-
* Activity type: workflow-activity:complete-signature-process
|
|
11
|
-
*/
|
|
12
|
-
class CompleteSignatureProcessActivity {
|
|
13
|
-
constructor() {
|
|
14
|
-
this.storageService = inject(AXPEntityStorageService);
|
|
15
|
-
}
|
|
16
|
-
async execute(input) {
|
|
17
|
-
try {
|
|
18
|
-
console.log(`[CompleteSignatureProcessActivity] Completing signature process for ${input.refType}:${input.refId}`);
|
|
19
|
-
if (!input.signatureRequestId || !input.refId || !input.refType) {
|
|
20
|
-
throw new Error('Invalid input: signatureRequestId, refId, and refType are required');
|
|
21
|
-
}
|
|
22
|
-
console.log(`[CompleteSignatureProcessActivity] Signature process completed successfully`);
|
|
23
|
-
return {
|
|
24
|
-
success: true,
|
|
25
|
-
data: { completed: true },
|
|
26
|
-
metadata: {
|
|
27
|
-
outcome: 'Done',
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
console.error(`[CompleteSignatureProcessActivity] Failed to complete signature process:`, error);
|
|
33
|
-
return {
|
|
34
|
-
success: false,
|
|
35
|
-
message: {
|
|
36
|
-
text: error.message || 'Failed to complete signature process',
|
|
37
|
-
},
|
|
38
|
-
data: { completed: false },
|
|
39
|
-
metadata: {
|
|
40
|
-
outcome: 'Failed',
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CompleteSignatureProcessActivity, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
46
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CompleteSignatureProcessActivity, providedIn: 'root' }); }
|
|
47
|
-
}
|
|
48
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CompleteSignatureProcessActivity, decorators: [{
|
|
49
|
-
type: Injectable,
|
|
50
|
-
args: [{
|
|
51
|
-
providedIn: 'root',
|
|
52
|
-
}]
|
|
53
|
-
}] });
|
|
54
|
-
|
|
55
|
-
export { CompleteSignatureProcessActivity };
|
|
56
|
-
//# sourceMappingURL=acorex-connectivity-mock-complete-signature-process.activity-BO-IFsHT.mjs.map
|
package/fesm2022/acorex-connectivity-mock-complete-signature-process.activity-BO-IFsHT.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-complete-signature-process.activity-BO-IFsHT.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/complete-signature-process.activity.ts"],"sourcesContent":["import { Injectable, inject } 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 CompleteSignatureProcessInput {\n signatureRequestId: string;\n refId: string;\n refType: string;\n}\n\nexport interface CompleteSignatureProcessOutput {\n completed: boolean;\n}\n\n//#endregion\n\n/**\n * Complete Signature Process Activity (Backend - Mock)\n *\n * Completes the signature process and updates the entity record.\n * Activity type: workflow-activity:complete-signature-process\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class CompleteSignatureProcessActivity\n implements AXPCommand<CompleteSignatureProcessInput, CompleteSignatureProcessOutput> {\n private readonly storageService = inject(AXPEntityStorageService);\n\n async execute(\n input: CompleteSignatureProcessInput,\n ): Promise<AXPExecuteCommandResult<CompleteSignatureProcessOutput>> {\n try {\n console.log(\n `[CompleteSignatureProcessActivity] Completing signature process for ${input.refType}:${input.refId}`,\n );\n\n if (!input.signatureRequestId || !input.refId || !input.refType) {\n throw new Error('Invalid input: signatureRequestId, refId, and refType are required');\n }\n\n console.log(`[CompleteSignatureProcessActivity] Signature process completed successfully`);\n\n return {\n success: true,\n data: { completed: true },\n metadata: {\n outcome: 'Done',\n },\n };\n } catch (error: any) {\n console.error(`[CompleteSignatureProcessActivity] Failed to complete signature process:`, error);\n\n return {\n success: false,\n message: {\n text: error.message || 'Failed to complete signature process',\n },\n data: { completed: false },\n metadata: {\n outcome: 'Failed',\n },\n };\n }\n }\n}\n"],"names":[],"mappings":";;;;AAiBA;AAEA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A,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,cAF/B,MAAM,EAAA,CAAA,CAAA;;2FAEP,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAH5C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable } from '@angular/core';
|
|
3
|
-
|
|
4
|
-
//#endregion
|
|
5
|
-
/**
|
|
6
|
-
* Notify Signers Activity (Backend - Mock)
|
|
7
|
-
*
|
|
8
|
-
* Sends notifications to signers about the signature request.
|
|
9
|
-
* Activity type: workflow-activity:notify-signers
|
|
10
|
-
*/
|
|
11
|
-
class NotifySignersActivity {
|
|
12
|
-
async execute(input) {
|
|
13
|
-
try {
|
|
14
|
-
console.log(`[NotifySignersActivity] Notifying ${input.signers.length} signers for request: ${input.signatureRequestId}`);
|
|
15
|
-
if (!input.signatureRequestId || !input.signers || input.signers.length === 0) {
|
|
16
|
-
throw new Error('Invalid input: signatureRequestId and at least one signer are required');
|
|
17
|
-
}
|
|
18
|
-
const notifiedCount = input.signers.length;
|
|
19
|
-
console.log(`[NotifySignersActivity] Successfully notified ${notifiedCount} signers`);
|
|
20
|
-
return {
|
|
21
|
-
success: true,
|
|
22
|
-
data: { notifiedCount },
|
|
23
|
-
metadata: { outcome: 'Done' },
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
catch (error) {
|
|
27
|
-
console.error(`[NotifySignersActivity] Failed to notify signers:`, error);
|
|
28
|
-
return {
|
|
29
|
-
success: false,
|
|
30
|
-
message: {
|
|
31
|
-
text: error.message || 'Failed to notify signers',
|
|
32
|
-
},
|
|
33
|
-
data: { notifiedCount: 0 },
|
|
34
|
-
metadata: { outcome: 'Failed' },
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NotifySignersActivity, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
39
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NotifySignersActivity, providedIn: 'root' }); }
|
|
40
|
-
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NotifySignersActivity, decorators: [{
|
|
42
|
-
type: Injectable,
|
|
43
|
-
args: [{
|
|
44
|
-
providedIn: 'root',
|
|
45
|
-
}]
|
|
46
|
-
}] });
|
|
47
|
-
|
|
48
|
-
export { NotifySignersActivity };
|
|
49
|
-
//# sourceMappingURL=acorex-connectivity-mock-notify-signers.activity-Dg0sKGip.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-notify-signers.activity-Dg0sKGip.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/notify-signers.activity.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\n\n//#region ---- Types ----\n\nexport interface NotifySignersInput {\n signatureRequestId: string;\n signers: string[];\n message?: string;\n}\n\nexport interface NotifySignersOutput {\n notifiedCount: number;\n}\n\n//#endregion\n\n/**\n * Notify Signers Activity (Backend - Mock)\n *\n * Sends notifications to signers about the signature request.\n * Activity type: workflow-activity:notify-signers\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class NotifySignersActivity implements AXPCommand<NotifySignersInput, NotifySignersOutput> {\n async execute(\n input: NotifySignersInput,\n ): Promise<AXPExecuteCommandResult<NotifySignersOutput>> {\n try {\n console.log(`[NotifySignersActivity] Notifying ${input.signers.length} signers for request: ${input.signatureRequestId}`);\n\n if (!input.signatureRequestId || !input.signers || input.signers.length === 0) {\n throw new Error('Invalid input: signatureRequestId and at least one signer are required');\n }\n\n const notifiedCount = input.signers.length;\n\n console.log(`[NotifySignersActivity] Successfully notified ${notifiedCount} signers`);\n\n return {\n success: true,\n data: { notifiedCount },\n metadata: { outcome: 'Done' },\n };\n } catch (error: any) {\n console.error(`[NotifySignersActivity] Failed to notify signers:`, error);\n\n return {\n success: false,\n message: {\n text: error.message || 'Failed to notify signers',\n },\n data: { notifiedCount: 0 },\n metadata: { outcome: 'Failed' },\n };\n }\n }\n}\n"],"names":[],"mappings":";;;AAgBA;AAEA;;;;;AAKG;MAIU,qBAAqB,CAAA;IAChC,MAAM,OAAO,CACX,KAAyB,EAAA;AAEzB,QAAA,IAAI;AACF,YAAA,OAAO,CAAC,GAAG,CAAC,CAAA,kCAAA,EAAqC,KAAK,CAAC,OAAO,CAAC,MAAM,yBAAyB,KAAK,CAAC,kBAAkB,CAAA,CAAE,CAAC;AAEzH,YAAA,IAAI,CAAC,KAAK,CAAC,kBAAkB,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;AAC7E,gBAAA,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC;YAC3F;AAEA,YAAA,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM;AAE1C,YAAA,OAAO,CAAC,GAAG,CAAC,iDAAiD,aAAa,CAAA,QAAA,CAAU,CAAC;YAErF,OAAO;AACL,gBAAA,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE,EAAE,aAAa,EAAE;AACvB,gBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;aAC9B;QACH;QAAE,OAAO,KAAU,EAAE;AACnB,YAAA,OAAO,CAAC,KAAK,CAAC,mDAAmD,EAAE,KAAK,CAAC;YAEzE,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;AACP,oBAAA,IAAI,EAAE,KAAK,CAAC,OAAO,IAAI,0BAA0B;AAClD,iBAAA;AACD,gBAAA,IAAI,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;AAC1B,gBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;aAChC;QACH;IACF;8GAhCW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAArB,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,qBAAqB,cAFpB,MAAM,EAAA,CAAA,CAAA;;2FAEP,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAHjC,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 { Injectable } from '@angular/core';
|
|
3
|
-
import { AXPDataGenerator } from '@acorex/platform/core';
|
|
4
|
-
|
|
5
|
-
//#endregion
|
|
6
|
-
/**
|
|
7
|
-
* Request Signature Activity (Backend - Mock)
|
|
8
|
-
*
|
|
9
|
-
* Creates a new signature request for an entity record.
|
|
10
|
-
* Activity type: workflow-activity:request-signature
|
|
11
|
-
*/
|
|
12
|
-
class RequestSignatureActivity {
|
|
13
|
-
async execute(input) {
|
|
14
|
-
try {
|
|
15
|
-
console.log(`[RequestSignatureActivity] Creating signature request for ${input.refType}:${input.refId}`);
|
|
16
|
-
if (!input.refId || !input.refType || !input.signers || input.signers.length === 0) {
|
|
17
|
-
throw new Error('Invalid input: refId, refType, and at least one signer are required');
|
|
18
|
-
}
|
|
19
|
-
const signatureRequestId = AXPDataGenerator.uuid();
|
|
20
|
-
console.log(`[RequestSignatureActivity] Created signature request: ${signatureRequestId} for ${input.signers.length} signers`);
|
|
21
|
-
return {
|
|
22
|
-
success: true,
|
|
23
|
-
data: {
|
|
24
|
-
signatureRequestId,
|
|
25
|
-
workflowInstanceId: input.workflowName ? `${input.workflowName}-${signatureRequestId}` : undefined,
|
|
26
|
-
},
|
|
27
|
-
metadata: {
|
|
28
|
-
outcome: 'Done',
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
catch (error) {
|
|
33
|
-
console.error(`[RequestSignatureActivity] Failed to create signature request:`, error);
|
|
34
|
-
return {
|
|
35
|
-
success: false,
|
|
36
|
-
message: {
|
|
37
|
-
text: error.message || 'Failed to create signature request',
|
|
38
|
-
},
|
|
39
|
-
data: {
|
|
40
|
-
signatureRequestId: '',
|
|
41
|
-
workflowInstanceId: undefined,
|
|
42
|
-
},
|
|
43
|
-
metadata: {
|
|
44
|
-
outcome: 'Failed',
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RequestSignatureActivity, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
50
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RequestSignatureActivity, providedIn: 'root' }); }
|
|
51
|
-
}
|
|
52
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RequestSignatureActivity, decorators: [{
|
|
53
|
-
type: Injectable,
|
|
54
|
-
args: [{
|
|
55
|
-
providedIn: 'root',
|
|
56
|
-
}]
|
|
57
|
-
}] });
|
|
58
|
-
|
|
59
|
-
export { RequestSignatureActivity };
|
|
60
|
-
//# sourceMappingURL=acorex-connectivity-mock-request-signature.activity-CoRT_H2u.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-request-signature.activity-CoRT_H2u.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/request-signature.activity.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult, AXPDataGenerator } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\n\n//#region ---- Types ----\n\nexport interface RequestSignatureInput {\n refId: string;\n refType: string;\n signers: string[];\n workflowName?: string;\n}\n\nexport interface RequestSignatureOutput {\n signatureRequestId: string;\n workflowInstanceId?: string;\n}\n\n//#endregion\n\n/**\n * Request Signature Activity (Backend - Mock)\n *\n * Creates a new signature request for an entity record.\n * Activity type: workflow-activity:request-signature\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class RequestSignatureActivity implements AXPCommand<RequestSignatureInput, RequestSignatureOutput> {\n async execute(\n input: RequestSignatureInput,\n ): Promise<AXPExecuteCommandResult<RequestSignatureOutput>> {\n try {\n console.log(`[RequestSignatureActivity] Creating signature request for ${input.refType}:${input.refId}`);\n\n if (!input.refId || !input.refType || !input.signers || input.signers.length === 0) {\n throw new Error('Invalid input: refId, refType, and at least one signer are required');\n }\n\n const signatureRequestId = AXPDataGenerator.uuid();\n\n console.log(\n `[RequestSignatureActivity] Created signature request: ${signatureRequestId} for ${input.signers.length} signers`,\n );\n\n return {\n success: true,\n data: {\n signatureRequestId,\n workflowInstanceId: input.workflowName ? `${input.workflowName}-${signatureRequestId}` : undefined,\n },\n metadata: {\n outcome: 'Done',\n },\n };\n } catch (error: any) {\n console.error(`[RequestSignatureActivity] Failed to create signature request:`, error);\n\n return {\n success: false,\n message: {\n text: error.message || 'Failed to create signature request',\n },\n data: {\n signatureRequestId: '',\n workflowInstanceId: undefined,\n },\n metadata: {\n outcome: 'Failed',\n },\n };\n }\n }\n}\n"],"names":[],"mappings":";;;;AAkBA;AAEA;;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AAC9B,iBAAA;AACD,gBAAA,QAAQ,EAAE;AACR,oBAAA,OAAO,EAAE,QAAQ;AAClB,iBAAA;aACF;QACH;IACF;8GA5CW,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAxB,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,wBAAwB,cAFvB,MAAM,EAAA,CAAA,CAAA;;2FAEP,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAHpC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable } from '@angular/core';
|
|
3
|
-
|
|
4
|
-
//#endregion
|
|
5
|
-
/**
|
|
6
|
-
* Validate All Signatures Activity (Backend - Mock)
|
|
7
|
-
*
|
|
8
|
-
* Validates whether all required signatures have been collected.
|
|
9
|
-
* Activity type: workflow-activity:validate-all-signatures
|
|
10
|
-
* Outcomes: AllSigned | Pending | Failed
|
|
11
|
-
*/
|
|
12
|
-
class ValidateAllSignaturesActivity {
|
|
13
|
-
async execute(input) {
|
|
14
|
-
try {
|
|
15
|
-
console.log(`[ValidateAllSignaturesActivity] Validating signatures for request: ${input.signatureRequestId}, required: ${input.requiredSigners}`);
|
|
16
|
-
if (!input.signatureRequestId || input.requiredSigners < 1) {
|
|
17
|
-
throw new Error('Invalid input: signatureRequestId and requiredSigners >= 1 are required');
|
|
18
|
-
}
|
|
19
|
-
const signedCount = Math.floor(Math.random() * (input.requiredSigners + 1));
|
|
20
|
-
const allSigned = signedCount >= input.requiredSigners;
|
|
21
|
-
console.log(`[ValidateAllSignaturesActivity] Validation result: ${signedCount}/${input.requiredSigners} signatures collected, allSigned: ${allSigned}`);
|
|
22
|
-
return {
|
|
23
|
-
success: true,
|
|
24
|
-
data: {
|
|
25
|
-
allSigned,
|
|
26
|
-
signedCount,
|
|
27
|
-
},
|
|
28
|
-
metadata: {
|
|
29
|
-
outcome: allSigned ? 'AllSigned' : 'Pending',
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
catch (error) {
|
|
34
|
-
console.error(`[ValidateAllSignaturesActivity] Failed to validate signatures:`, error);
|
|
35
|
-
return {
|
|
36
|
-
success: false,
|
|
37
|
-
message: {
|
|
38
|
-
text: error.message || 'Failed to validate signatures',
|
|
39
|
-
},
|
|
40
|
-
data: {
|
|
41
|
-
allSigned: false,
|
|
42
|
-
signedCount: 0,
|
|
43
|
-
},
|
|
44
|
-
metadata: {
|
|
45
|
-
outcome: 'Failed',
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ValidateAllSignaturesActivity, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
51
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ValidateAllSignaturesActivity, providedIn: 'root' }); }
|
|
52
|
-
}
|
|
53
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ValidateAllSignaturesActivity, decorators: [{
|
|
54
|
-
type: Injectable,
|
|
55
|
-
args: [{
|
|
56
|
-
providedIn: 'root',
|
|
57
|
-
}]
|
|
58
|
-
}] });
|
|
59
|
-
|
|
60
|
-
export { ValidateAllSignaturesActivity };
|
|
61
|
-
//# sourceMappingURL=acorex-connectivity-mock-validate-all-signatures.activity-JuHjNFFS.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-validate-all-signatures.activity-JuHjNFFS.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/validate-all-signatures.activity.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\n\n//#region ---- Types ----\n\nexport interface ValidateAllSignaturesInput {\n signatureRequestId: string;\n requiredSigners: number;\n}\n\nexport interface ValidateAllSignaturesOutput {\n allSigned: boolean;\n signedCount: number;\n}\n\n//#endregion\n\n/**\n * Validate All Signatures Activity (Backend - Mock)\n *\n * Validates whether all required signatures have been collected.\n * Activity type: workflow-activity:validate-all-signatures\n * Outcomes: AllSigned | Pending | Failed\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ValidateAllSignaturesActivity\n implements AXPCommand<ValidateAllSignaturesInput, ValidateAllSignaturesOutput> {\n async execute(\n input: ValidateAllSignaturesInput,\n ): Promise<AXPExecuteCommandResult<ValidateAllSignaturesOutput>> {\n try {\n console.log(\n `[ValidateAllSignaturesActivity] Validating signatures for request: ${input.signatureRequestId}, required: ${input.requiredSigners}`,\n );\n\n if (!input.signatureRequestId || input.requiredSigners < 1) {\n throw new Error('Invalid input: signatureRequestId and requiredSigners >= 1 are required');\n }\n\n const signedCount = Math.floor(Math.random() * (input.requiredSigners + 1));\n const allSigned = signedCount >= input.requiredSigners;\n\n console.log(\n `[ValidateAllSignaturesActivity] Validation result: ${signedCount}/${input.requiredSigners} signatures collected, allSigned: ${allSigned}`,\n );\n\n return {\n success: true,\n data: {\n allSigned,\n signedCount,\n },\n metadata: {\n outcome: allSigned ? 'AllSigned' : 'Pending',\n },\n };\n } catch (error: any) {\n console.error(`[ValidateAllSignaturesActivity] Failed to validate signatures:`, error);\n\n return {\n success: false,\n message: {\n text: error.message || 'Failed to validate signatures',\n },\n data: {\n allSigned: false,\n signedCount: 0,\n },\n metadata: {\n outcome: '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