@acorex/connectivity 21.0.0-next.37 → 21.0.0-next.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. package/fesm2022/{acorex-connectivity-mock-acorex-connectivity-mock-BpUUTZOi.mjs → acorex-connectivity-mock-acorex-connectivity-mock-Bso6KgSC.mjs} +7102 -3436
  2. package/fesm2022/acorex-connectivity-mock-acorex-connectivity-mock-Bso6KgSC.mjs.map +1 -0
  3. package/fesm2022/{acorex-connectivity-mock-chat-generate-image.command-BA0r4IMn.mjs → acorex-connectivity-mock-chat-generate-image.command-BYNcjNoo.mjs} +2 -2
  4. package/fesm2022/{acorex-connectivity-mock-chat-generate-image.command-BA0r4IMn.mjs.map → acorex-connectivity-mock-chat-generate-image.command-BYNcjNoo.mjs.map} +1 -1
  5. package/fesm2022/{acorex-connectivity-mock-chat-synthesize-speech.command-B5-8a7SC.mjs → acorex-connectivity-mock-chat-synthesize-speech.command-82f3G8lC.mjs} +2 -2
  6. package/fesm2022/{acorex-connectivity-mock-chat-synthesize-speech.command-B5-8a7SC.mjs.map → acorex-connectivity-mock-chat-synthesize-speech.command-82f3G8lC.mjs.map} +1 -1
  7. package/fesm2022/{acorex-connectivity-mock-chat-transcribe-speech.command-BGzXvTnh.mjs → acorex-connectivity-mock-chat-transcribe-speech.command-D6gp3I1V.mjs} +2 -2
  8. package/fesm2022/{acorex-connectivity-mock-chat-transcribe-speech.command-BGzXvTnh.mjs.map → acorex-connectivity-mock-chat-transcribe-speech.command-D6gp3I1V.mjs.map} +1 -1
  9. package/fesm2022/{acorex-connectivity-mock-entity-update.activity-D0hyBha-.mjs → acorex-connectivity-mock-entity-update.activity-06HTKiQQ.mjs} +1 -3
  10. package/fesm2022/acorex-connectivity-mock-entity-update.activity-06HTKiQQ.mjs.map +1 -0
  11. package/fesm2022/{acorex-connectivity-mock-get-product-list.query-B06aC73T.mjs → acorex-connectivity-mock-get-product-list.query-f-mTj4ah.mjs} +7 -5
  12. package/fesm2022/acorex-connectivity-mock-get-product-list.query-f-mTj4ah.mjs.map +1 -0
  13. package/fesm2022/{acorex-connectivity-mock-get-product-pdf-data.query-CM7bsjl7.mjs → acorex-connectivity-mock-get-product-pdf-data.query-Co1V52c4.mjs} +2 -2
  14. package/fesm2022/{acorex-connectivity-mock-get-product-pdf-data.query-CM7bsjl7.mjs.map → acorex-connectivity-mock-get-product-pdf-data.query-Co1V52c4.mjs.map} +1 -1
  15. package/fesm2022/acorex-connectivity-mock.mjs +1 -1
  16. package/package.json +2 -2
  17. package/types/acorex-connectivity-mock.d.ts +80 -38
  18. package/fesm2022/acorex-connectivity-mock-acorex-connectivity-mock-BpUUTZOi.mjs.map +0 -1
  19. package/fesm2022/acorex-connectivity-mock-entity-update.activity-D0hyBha-.mjs.map +0 -1
  20. package/fesm2022/acorex-connectivity-mock-get-product-list.query-B06aC73T.mjs.map +0 -1
@@ -3,7 +3,7 @@ import * as i0 from '@angular/core';
3
3
  import { inject, Injectable } from '@angular/core';
4
4
  import { AXPFileStorageService } from '@acorex/platform/common';
5
5
  import { AXPEntityService } from '@acorex/platform/layout/entity';
6
- import { A as AXCAiChatRouterService, r as resolveDelegatedAssistOptionModel } from './acorex-connectivity-mock-acorex-connectivity-mock-BpUUTZOi.mjs';
6
+ import { A as AXCAiChatRouterService, r as resolveDelegatedAssistOptionModel } from './acorex-connectivity-mock-acorex-connectivity-mock-Bso6KgSC.mjs';
7
7
 
8
8
  //#region ---- Imports ----
9
9
  function parseGenerateImageInput(args) {
@@ -111,4 +111,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
111
111
  }] });
112
112
 
113
113
  export { AiManagementChatGenerateImageCommand };
114
- //# sourceMappingURL=acorex-connectivity-mock-chat-generate-image.command-BA0r4IMn.mjs.map
114
+ //# sourceMappingURL=acorex-connectivity-mock-chat-generate-image.command-BYNcjNoo.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-connectivity-mock-chat-generate-image.command-BA0r4IMn.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';\n\n//#endregion\n\n//#region ---- Command: AiManagement:ChatGenerateImage ----\n\nexport interface AiManagementChatGenerateImageInput {\n /** Catalog `AiModel` row id for an image-purpose model. When omitted, uses `delegatedAgents[].options.model` for the active delegated specialist (`agentId` in run context). */\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() || resolveDelegatedAssistOptionModel(assist, ctx.agentId) || '';\n if (!modelEntityId) {\n return {\n success: false,\n message: {\n text:\n 'No image model: pass \"model\" (catalog id) or set options.model on the image-generation delegated specialist row for this assist.',\n },\n };\n }\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 }\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;AAAA;AAgCA,SAAS,uBAAuB,CAAC,IAAa,EAAA;AAG5C,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,gEAAgE,EAAE;IAC/F;IACA,MAAM,KAAK,GAAG,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,GAAG,SAAS;IAChF,MAAM,IAAI,GAAG,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,SAAS;IAC7E,MAAM,KAAK,GAAG,OA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AAoC,EAAA,UAAA,EAAA,CAAA;kBADhD;;;;;"}
1
+ {"version":3,"file":"acorex-connectivity-mock-chat-generate-image.command-BYNcjNoo.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';\n\n//#endregion\n\n//#region ---- Command: AiManagement:ChatGenerateImage ----\n\nexport interface AiManagementChatGenerateImageInput {\n /** Catalog `AiModel` row id for an image-purpose model. When omitted, uses `delegatedAgents[].options.model` for the active delegated specialist (`agentId` in run context). */\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() || resolveDelegatedAssistOptionModel(assist, ctx.agentId) || '';\n if (!modelEntityId) {\n return {\n success: false,\n message: {\n text:\n 'No image model: pass \"model\" (catalog id) or set options.model on the image-generation delegated specialist row for this assist.',\n },\n };\n }\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 }\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;AAAA;AAgCA,SAAS,uBAAuB,CAAC,IAAa,EAAA;AAG5C,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,gEAAgE,EAAE;IAC/F;IACA,MAAM,KAAK,GAAG,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,GAAG,SAAS;IAChF,MAAM,IAAI,GAAG,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,CAA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AA,CAAA;kHAApC,oCAAoC,EAAA,CAAA,CAAA;;2FAApC,oCAAoC,EAAA,UAAA,EAAA,CAAA;kBADhD;;;;;"}
@@ -3,7 +3,7 @@ import * as i0 from '@angular/core';
3
3
  import { inject, Injectable } from '@angular/core';
4
4
  import { AXPFileStorageService } from '@acorex/platform/common';
5
5
  import { AXPEntityService } from '@acorex/platform/layout/entity';
6
- import { A as AXCAiChatRouterService, r as resolveDelegatedAssistOptionModel, a as resolveDelegatedAssistOptionString } from './acorex-connectivity-mock-acorex-connectivity-mock-BpUUTZOi.mjs';
6
+ import { A as AXCAiChatRouterService, r as resolveDelegatedAssistOptionModel, a as resolveDelegatedAssistOptionString } from './acorex-connectivity-mock-acorex-connectivity-mock-Bso6KgSC.mjs';
7
7
 
8
8
  //#region ---- Imports ----
9
9
  function extForMime(mime) {
@@ -127,4 +127,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
127
127
  }] });
128
128
 
129
129
  export { AiManagementChatSynthesizeSpeechCommand };
130
- //# sourceMappingURL=acorex-connectivity-mock-chat-synthesize-speech.command-B5-8a7SC.mjs.map
130
+ //# sourceMappingURL=acorex-connectivity-mock-chat-synthesize-speech.command-82f3G8lC.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-connectivity-mock-chat-synthesize-speech.command-B5-8a7SC.mjs","sources":["../../../../libs/connectivity/mock/src/lib/ai-management/commands/chat-synthesize-speech.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport {\n AI_CHAT_GENERATED_SPEECH_REF_TYPE,\n AXPAiChatToolRunContextService,\n persistAiGeneratedSpeech,\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 {\n resolveDelegatedAssistOptionModel,\n resolveDelegatedAssistOptionString,\n} from '../ai-delegated-agent-parameters.util';\nimport { AXCAiChatRouterService } from '../chat/ai-chat-router.service';\n\n//#endregion\n\n//#region ---- Command: AiManagement:ChatSynthesizeSpeech ----\n\nexport interface AiManagementChatSynthesizeSpeechInput {\n /** Catalog `AiModel` row id (purpose `tts`). When omitted, uses `delegatedAgents[].options.model` for the active delegated specialist. */\n model?: string;\n text?: string;\n voice?: string;\n responseFormat?: string;\n}\n\nfunction extForMime(mime: string): string {\n const m = mime.toLowerCase();\n if (m.includes('mpeg') || m.includes('mp3')) {\n return 'mp3';\n }\n if (m.includes('wav')) {\n return 'wav';\n }\n if (m.includes('opus')) {\n return 'opus';\n }\n if (m.includes('ogg')) {\n return 'ogg';\n }\n if (m.includes('aac')) {\n return 'aac';\n }\n if (m.includes('flac')) {\n return 'flac';\n }\n return 'bin';\n}\n\nfunction parseSynthesizeInput(args: unknown):\n | { ok: true; model?: string; text: string; voice?: string; responseFormat?: 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 text = typeof obj['text'] === 'string' ? obj['text'].trim() : '';\n if (!text) {\n return { ok: false, error: 'Invalid arguments: \"text\" is required and must be non-empty.' };\n }\n const model = typeof obj['model'] === 'string' ? obj['model'].trim() : undefined;\n const voice = typeof obj['voice'] === 'string' ? obj['voice'].trim() : undefined;\n const responseFormat =\n typeof obj['responseFormat'] === 'string' ? obj['responseFormat'].trim() : undefined;\n return {\n ok: true,\n text,\n ...(model ? { model } : {}),\n ...(voice ? { voice } : {}),\n ...(responseFormat ? { responseFormat } : {}),\n };\n}\n\n@Injectable()\nexport class AiManagementChatSynthesizeSpeechCommand\n implements\n AXPCommand<\n AiManagementChatSynthesizeSpeechInput,\n { fileId?: string; text: string; mimeType?: string }\n >\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: AiManagementChatSynthesizeSpeechInput,\n ): Promise<AXPExecuteCommandResult<{ fileId?: string; text: string; mimeType?: string }>> {\n const ctx = this.runContext.getContext();\n if (!ctx?.assistId?.trim()) {\n return {\n success: false,\n message: {\n text: 'Text-to-speech requires an active AI chat run context (assist id).',\n },\n };\n }\n\n const parsed = parseSynthesizeInput(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() || resolveDelegatedAssistOptionModel(assist, ctx.agentId) || '';\n if (!modelEntityId) {\n return {\n success: false,\n message: {\n text:\n 'No TTS model: pass \"model\" (catalog id) or set options.model on the text-to-speech delegated specialist row for this assist.',\n },\n };\n }\n\n const voiceFromAssist =\n resolveDelegatedAssistOptionString(assist, ctx.agentId, 'voice') || undefined;\n const voice = parsed.voice?.trim() || voiceFromAssist || 'alloy';\n\n const { audioBytes, mimeType } = await this.aiChatRouter.synthesizeSpeech({\n modelEntityId,\n text: parsed.text,\n voice,\n ...(parsed.responseFormat?.trim() ? { responseFormat: parsed.responseFormat.trim() } : {}),\n });\n\n const mt = mimeType?.trim() || 'application/octet-stream';\n const ext = extForMime(mt);\n const file = new File([audioBytes], `ai-tts.${ext}`, { type: mt });\n\n try {\n const { fileId } = await persistAiGeneratedSpeech(this.fileStorage, file, {\n refId: assist.id,\n refType: AI_CHAT_GENERATED_SPEECH_REF_TYPE,\n });\n return { success: true, data: { fileId, text: parsed.text, mimeType: mt } };\n } catch (persistErr) {\n const pmsg = persistErr instanceof Error ? persistErr.message : String(persistErr);\n throw new Error(`Could not store synthesized speech 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 }\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;AAAA;AAiCA,SAAS,UAAU,CAAC,IAAY,EAAA;AAC9B,IAAA,MAAM,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE;AAC5B,IAAA,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AAC3C,QAAA,OAAO,KAAK;IACd;AACA,IAAA,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACrB,QAAA,OAAO,KAAK;IACd;AACA,IAAA,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AACtB,QAAA,OAAO,MAAM;IACf;AACA,IAAA,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACrB,QAAA,OAAO,KAAK;IACd;AACA,IAAA,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACrB,QAAA,OAAO,KAAK;IACd;AACA,IAAA,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AACtB,QAAA,OAAO,MAAM;IACf;AACA,IAAA,OAAO,KAAK;AACd;AAEA,SAAS,oBAAoB,CAAC,IAAa,EAAA;AAGzC,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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G,UAAU,YAAY,KAAK,GAAG,UAAU,CAAC,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC;AAClF,gBAAA,MAAM,IAAI,KAAK,CAAC,uDAAuD,IAAI,CAAA,CAAE,CAAC;YAChF;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;8GApFW,uCAAuC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAvC,uCAAuC,EAAA,CAAA,CAAA;;2FAAvC,uCAAuC,EAAA,UAAA,EAAA,CAAA;kBADnD;;;;;"}
1
+ {"version":3,"file":"acorex-connectivity-mock-chat-synthesize-speech.command-82f3G8lC.mjs","sources":["../../../../libs/connectivity/mock/src/lib/ai-management/commands/chat-synthesize-speech.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport {\n AI_CHAT_GENERATED_SPEECH_REF_TYPE,\n AXPAiChatToolRunContextService,\n persistAiGeneratedSpeech,\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 {\n resolveDelegatedAssistOptionModel,\n resolveDelegatedAssistOptionString,\n} from '../ai-delegated-agent-parameters.util';\nimport { AXCAiChatRouterService } from '../chat/ai-chat-router.service';\n\n//#endregion\n\n//#region ---- Command: AiManagement:ChatSynthesizeSpeech ----\n\nexport interface AiManagementChatSynthesizeSpeechInput {\n /** Catalog `AiModel` row id (purpose `tts`). When omitted, uses `delegatedAgents[].options.model` for the active delegated specialist. */\n model?: string;\n text?: string;\n voice?: string;\n responseFormat?: string;\n}\n\nfunction extForMime(mime: string): string {\n const m = mime.toLowerCase();\n if (m.includes('mpeg') || m.includes('mp3')) {\n return 'mp3';\n }\n if (m.includes('wav')) {\n return 'wav';\n }\n if (m.includes('opus')) {\n return 'opus';\n }\n if (m.includes('ogg')) {\n return 'ogg';\n }\n if (m.includes('aac')) {\n return 'aac';\n }\n if (m.includes('flac')) {\n return 'flac';\n }\n return 'bin';\n}\n\nfunction parseSynthesizeInput(args: unknown):\n | { ok: true; model?: string; text: string; voice?: string; responseFormat?: 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 text = typeof obj['text'] === 'string' ? obj['text'].trim() : '';\n if (!text) {\n return { ok: false, error: 'Invalid arguments: \"text\" is required and must be non-empty.' };\n }\n const model = typeof obj['model'] === 'string' ? obj['model'].trim() : undefined;\n const voice = typeof obj['voice'] === 'string' ? obj['voice'].trim() : undefined;\n const responseFormat =\n typeof obj['responseFormat'] === 'string' ? obj['responseFormat'].trim() : undefined;\n return {\n ok: true,\n text,\n ...(model ? { model } : {}),\n ...(voice ? { voice } : {}),\n ...(responseFormat ? { responseFormat } : {}),\n };\n}\n\n@Injectable()\nexport class AiManagementChatSynthesizeSpeechCommand\n implements\n AXPCommand<\n AiManagementChatSynthesizeSpeechInput,\n { fileId?: string; text: string; mimeType?: string }\n >\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: AiManagementChatSynthesizeSpeechInput,\n ): Promise<AXPExecuteCommandResult<{ fileId?: string; text: string; mimeType?: string }>> {\n const ctx = this.runContext.getContext();\n if (!ctx?.assistId?.trim()) {\n return {\n success: false,\n message: {\n text: 'Text-to-speech requires an active AI chat run context (assist id).',\n },\n };\n }\n\n const parsed = parseSynthesizeInput(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() || resolveDelegatedAssistOptionModel(assist, ctx.agentId) || '';\n if (!modelEntityId) {\n return {\n success: false,\n message: {\n text:\n 'No TTS model: pass \"model\" (catalog id) or set options.model on the text-to-speech delegated specialist row for this assist.',\n },\n };\n }\n\n const voiceFromAssist =\n resolveDelegatedAssistOptionString(assist, ctx.agentId, 'voice') || undefined;\n const voice = parsed.voice?.trim() || voiceFromAssist || 'alloy';\n\n const { audioBytes, mimeType } = await this.aiChatRouter.synthesizeSpeech({\n modelEntityId,\n text: parsed.text,\n voice,\n ...(parsed.responseFormat?.trim() ? { responseFormat: parsed.responseFormat.trim() } : {}),\n });\n\n const mt = mimeType?.trim() || 'application/octet-stream';\n const ext = extForMime(mt);\n const file = new File([audioBytes], `ai-tts.${ext}`, { type: mt });\n\n try {\n const { fileId } = await persistAiGeneratedSpeech(this.fileStorage, file, {\n refId: assist.id,\n refType: AI_CHAT_GENERATED_SPEECH_REF_TYPE,\n });\n return { success: true, data: { fileId, text: parsed.text, mimeType: mt } };\n } catch (persistErr) {\n const pmsg = persistErr instanceof Error ? persistErr.message : String(persistErr);\n throw new Error(`Could not store synthesized speech for chat replay. ${pmsg}`);\n }\n } catch (e) {\n const msg = e instanceof Error ? e.message : String(e);\n return { success: false, message: { text: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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;8GApFW,uCAAuC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAvC,uCAAuC,EAAA,CAAA,CAAA;;2FAAvC,uCAAuC,EAAA,UAAA,EAAA,CAAA;kBADnD;;;;;"}
@@ -3,7 +3,7 @@ import * as i0 from '@angular/core';
3
3
  import { inject, Injectable } from '@angular/core';
4
4
  import { AXPFileStorageService } from '@acorex/platform/common';
5
5
  import { AXPEntityService } from '@acorex/platform/layout/entity';
6
- import { A as AXCAiChatRouterService, r as resolveDelegatedAssistOptionModel, a as resolveDelegatedAssistOptionString } from './acorex-connectivity-mock-acorex-connectivity-mock-BpUUTZOi.mjs';
6
+ import { A as AXCAiChatRouterService, r as resolveDelegatedAssistOptionModel, a as resolveDelegatedAssistOptionString } from './acorex-connectivity-mock-acorex-connectivity-mock-Bso6KgSC.mjs';
7
7
 
8
8
  //#region ---- Imports ----
9
9
  function parseTranscribeInput(args) {
@@ -107,4 +107,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
107
107
  }] });
108
108
 
109
109
  export { AiManagementChatTranscribeSpeechCommand };
110
- //# sourceMappingURL=acorex-connectivity-mock-chat-transcribe-speech.command-BGzXvTnh.mjs.map
110
+ //# sourceMappingURL=acorex-connectivity-mock-chat-transcribe-speech.command-D6gp3I1V.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-connectivity-mock-chat-transcribe-speech.command-BGzXvTnh.mjs","sources":["../../../../libs/connectivity/mock/src/lib/ai-management/commands/chat-transcribe-speech.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPAiChatToolRunContextService, RootConfig } 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 {\n resolveDelegatedAssistOptionModel,\n resolveDelegatedAssistOptionString,\n} from '../ai-delegated-agent-parameters.util';\nimport { AXCAiChatRouterService } from '../chat/ai-chat-router.service';\n\n//#endregion\n\n//#region ---- Command: AiManagement:ChatTranscribeSpeech ----\n\nexport interface AiManagementChatTranscribeSpeechInput {\n /** Catalog `AiModel` row id for a speech-purpose model. When omitted, uses `delegatedAgents[].options.model` for the active delegated specialist (`agentId` in run context). */\n model?: string;\n fileId?: string;\n language?: string;\n}\n\nfunction parseTranscribeInput(args: unknown):\n | { ok: true; model?: string; fileId: string; language?: 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 and must be non-empty.' };\n }\n const model = typeof obj['model'] === 'string' ? obj['model'].trim() : undefined;\n const language = typeof obj['language'] === 'string' ? obj['language'].trim() : undefined;\n return {\n ok: true,\n fileId,\n ...(model ? { model } : {}),\n ...(language ? { language } : {}),\n };\n}\n\n@Injectable()\nexport class AiManagementChatTranscribeSpeechCommand\n implements AXPCommand<AiManagementChatTranscribeSpeechInput, { text: 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: AiManagementChatTranscribeSpeechInput,\n ): Promise<AXPExecuteCommandResult<{ text: string }>> {\n const ctx = this.runContext.getContext();\n if (!ctx?.assistId?.trim()) {\n return {\n success: false,\n message: {\n text: 'Speech transcription requires an active AI chat run context (assist id).',\n },\n };\n }\n\n const parsed = parseTranscribeInput(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() || resolveDelegatedAssistOptionModel(assist, ctx.agentId) || '';\n if (!modelEntityId) {\n return {\n success: false,\n message: {\n text:\n 'No speech model: pass \"model\" (catalog id) or set options.model on the speech-to-text delegated specialist row for this assist.',\n },\n };\n }\n\n let mimeType = 'application/octet-stream';\n let audioBytes: ArrayBuffer;\n try {\n const info = await this.fileStorage.getInfo(parsed.fileId);\n const file = info.binary;\n mimeType = info.mimeType?.trim() || file.type?.trim() || mimeType;\n audioBytes = await file.arrayBuffer();\n } catch (e) {\n const msg = e instanceof Error ? e.message : String(e);\n return {\n success: false,\n message: { text: `Could not read audio file (fileId: ${parsed.fileId}). ${msg}` },\n };\n }\n\n const language =\n parsed.language?.trim() ||\n resolveDelegatedAssistOptionString(assist, ctx.agentId, 'language') ||\n undefined;\n\n const { text } = await this.aiChatRouter.transcribeSpeech({\n modelEntityId,\n audioBytes,\n mimeType,\n fileName: parsed.fileId,\n ...(language ? { language } : {}),\n });\n\n return { success: true, data: { text } };\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":";;;;;;;AAAA;AA2BA,SAAS,oBAAoB,CAAC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AE,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE;QAC1C;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;8GApFW,uCAAuC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAvC,uCAAuC,EAAA,CAAA,CAAA;;2FAAvC,uCAAuC,EAAA,UAAA,EAAA,CAAA;kBADnD;;;;;"}
1
+ {"version":3,"file":"acorex-connectivity-mock-chat-transcribe-speech.command-D6gp3I1V.mjs","sources":["../../../../libs/connectivity/mock/src/lib/ai-management/commands/chat-transcribe-speech.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPAiChatToolRunContextService, RootConfig } 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 {\n resolveDelegatedAssistOptionModel,\n resolveDelegatedAssistOptionString,\n} from '../ai-delegated-agent-parameters.util';\nimport { AXCAiChatRouterService } from '../chat/ai-chat-router.service';\n\n//#endregion\n\n//#region ---- Command: AiManagement:ChatTranscribeSpeech ----\n\nexport interface AiManagementChatTranscribeSpeechInput {\n /** Catalog `AiModel` row id for a speech-purpose model. When omitted, uses `delegatedAgents[].options.model` for the active delegated specialist (`agentId` in run context). */\n model?: string;\n fileId?: string;\n language?: string;\n}\n\nfunction parseTranscribeInput(args: unknown):\n | { ok: true; model?: string; fileId: string; language?: 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 and must be non-empty.' };\n }\n const model = typeof obj['model'] === 'string' ? obj['model'].trim() : undefined;\n const language = typeof obj['language'] === 'string' ? obj['language'].trim() : undefined;\n return {\n ok: true,\n fileId,\n ...(model ? { model } : {}),\n ...(language ? { language } : {}),\n };\n}\n\n@Injectable()\nexport class AiManagementChatTranscribeSpeechCommand\n implements AXPCommand<AiManagementChatTranscribeSpeechInput, { text: 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: AiManagementChatTranscribeSpeechInput,\n ): Promise<AXPExecuteCommandResult<{ text: string }>> {\n const ctx = this.runContext.getContext();\n if (!ctx?.assistId?.trim()) {\n return {\n success: false,\n message: {\n text: 'Speech transcription requires an active AI chat run context (assist id).',\n },\n };\n }\n\n const parsed = parseTranscribeInput(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() || resolveDelegatedAssistOptionModel(assist, ctx.agentId) || '';\n if (!modelEntityId) {\n return {\n success: false,\n message: {\n text:\n 'No speech model: pass \"model\" (catalog id) or set options.model on the speech-to-text delegated specialist row for this assist.',\n },\n };\n }\n\n let mimeType = 'application/octet-stream';\n let audioBytes: ArrayBuffer;\n try {\n const info = await this.fileStorage.getInfo(parsed.fileId);\n const file = info.binary;\n mimeType = info.mimeType?.trim() || file.type?.trim() || mimeType;\n audioBytes = await file.arrayBuffer();\n } catch (e) {\n const msg = e instanceof Error ? e.message : String(e);\n return {\n success: false,\n message: { text: `Could not read audio file (fileId: ${parsed.fileId}). ${msg}` },\n };\n }\n\n const language =\n parsed.language?.trim() ||\n resolveDelegatedAssistOptionString(assist, ctx.agentId, 'language') ||\n undefined;\n\n const { text } = await this.aiChatRouter.transcribeSpeech({\n modelEntityId,\n audioBytes,\n mimeType,\n fileName: parsed.fileId,\n ...(language ? { language } : {}),\n });\n\n return { success: true, data: { text } };\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":";;;;;;;AAAA;AA2BA,SAAS,oBAAoB,CAAC,IAAa,EAAA;AAGzC,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,gEAAgE,EAAE;IAC/F;IACA,MAAM,KAAK,GAAG,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,QAAQ,GAAG,GAAG,CAAC,OAAO,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;
19
- console.log('EntityUpdateActivity', input);
20
18
  try {
21
19
  if (!input?.entity) {
22
20
  return {
@@ -67,4 +65,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
67
65
  }] });
68
66
 
69
67
  export { EntityUpdateActivity };
70
- //# sourceMappingURL=acorex-connectivity-mock-entity-update.activity-D0hyBha-.mjs.map
68
+ //# sourceMappingURL=acorex-connectivity-mock-entity-update.activity-06HTKiQQ.mjs.map
@@ -0,0 +1 @@
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,K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ADP,MAAM,EAAA,CAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
@@ -1,14 +1,16 @@
1
+ import { resolveMultiLanguageString } from '@acorex/core/translation';
2
+ import { RootConfig } from '@acorex/modules/product-catalog';
3
+ import { AXPEntityService } from '@acorex/platform/layout/entity';
1
4
  import * as i0 from '@angular/core';
2
5
  import { inject, Injectable } from '@angular/core';
3
- import { resolveMultiLanguageString } from '@acorex/platform/core';
4
- import { AXPEntityService } from '@acorex/platform/layout/entity';
5
- import { RootConfig } from '@acorex/modules/product-catalog';
6
6
 
7
7
  //#endregion
8
8
  class GetProductListQuery {
9
9
  constructor() {
10
10
  this.entityService = inject(AXPEntityService);
11
- this.productService = this.entityService.withEntity(`${RootConfig.module.name}.${RootConfig.entities.product.name}`).data();
11
+ this.productService = this.entityService
12
+ .withEntity(`${RootConfig.module.name}.${RootConfig.entities.product.name}`)
13
+ .data();
12
14
  }
13
15
  async fetch(input) {
14
16
  // Extract product-specific filters from AXPFilterClause format
@@ -248,4 +250,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
248
250
  }] });
249
251
 
250
252
  export { GetProductListQuery };
251
- //# sourceMappingURL=acorex-connectivity-mock-get-product-list.query-B06aC73T.mjs.map
253
+ //# sourceMappingURL=acorex-connectivity-mock-get-product-list.query-f-mTj4ah.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-connectivity-mock-get-product-list.query-f-mTj4ah.mjs","sources":["../../../../libs/connectivity/mock/src/lib/product-catalog/reports/get-product-list.query.ts"],"sourcesContent":["import { resolveMultiLanguageString } from '@acorex/core/translation';\nimport { AXMProductCatalogProductEntityModel, RootConfig } from '@acorex/modules/product-catalog';\nimport { AXPEntityService } from '@acorex/platform/layout/entity';\nimport { AXPQuery } from '@acorex/platform/runtime';\nimport { inject, Injectable } from '@angular/core';\n\n//#region ---- Query Input/Output Types ----\n\nexport interface GetProductListQueryInput {\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 ProductByBrandResult {\n brand: string;\n brandId?: string;\n manufacturer: string;\n manufacturerId?: string;\n productCount: number;\n totalValue: number;\n averagePrice: number;\n minPrice: number;\n maxPrice: number;\n categories: string;\n}\n\nexport interface GetProductListQueryResult {\n items: ProductByBrandResult[];\n total: number;\n}\n\n//#endregion\n\n@Injectable({\n providedIn: 'root',\n})\nexport class GetProductListQuery implements AXPQuery<GetProductListQueryInput, GetProductListQueryResult> {\n private readonly entityService = inject(AXPEntityService);\n private productService = this.entityService\n .withEntity(`${RootConfig.module.name}.${RootConfig.entities.product.name}`)\n .data<string, AXMProductCatalogProductEntityModel>();\n\n async fetch(input: GetProductListQueryInput | any): Promise<GetProductListQueryResult> {\n // Extract product-specific filters from AXPFilterClause format\n const extractedFilters = this.extractProductFilters(input.filters);\n\n // Separate custom filters from entity filters\n const entityFilters: GetProductListQueryInput['filters'] = [];\n let priceRangeFilter: string | undefined;\n\n if (extractedFilters && extractedFilters.length > 0) {\n for (const filter of extractedFilters) {\n if (filter.field === 'priceRange') {\n priceRangeFilter = filter.value;\n } else {\n entityFilters.push(filter);\n }\n }\n }\n\n // Get all products from storage with entity filters\n const allProductsResult = await this.productService.query({\n skip: 0,\n take: 10000, // Get all products for aggregation\n filter:\n entityFilters.length > 0\n ? ({\n logic: input.logic || 'and',\n filters: entityFilters,\n } as any)\n : undefined,\n });\n\n let allProducts = allProductsResult.items;\n\n // Apply custom price range filter after fetching\n if (priceRangeFilter && priceRangeFilter !== 'all') {\n allProducts = this.applyPriceRangeFilter(allProducts, priceRangeFilter);\n }\n\n // Group products by brand\n const brandGroups = new Map<string, AXMProductCatalogProductEntityModel[]>();\n\n for (const product of allProducts) {\n const brandKey = product.brand?.title || product.brandId || 'Unknown';\n\n if (!brandGroups.has(brandKey)) {\n brandGroups.set(brandKey, []);\n }\n\n brandGroups.get(brandKey)!.push(product);\n }\n\n // Aggregate data by brand\n const aggregatedResults: ProductByBrandResult[] = [];\n\n for (const [brandName, products] of brandGroups.entries()) {\n const prices = products.map((p) => p.basePrice || 0).filter((p) => p > 0);\n const totalValue = prices.reduce((sum, price) => sum + price, 0);\n const productCount = products.length;\n const averagePrice = productCount > 0 ? totalValue / productCount : 0;\n const minPrice = prices.length > 0 ? Math.min(...prices) : 0;\n const maxPrice = prices.length > 0 ? Math.max(...prices) : 0;\n\n // Get unique categories\n const categorySet = new Set<string>();\n for (const product of products) {\n if (product.categories && Array.isArray(product.categories)) {\n for (const cat of product.categories) {\n if (cat.title) {\n categorySet.add(resolveMultiLanguageString(cat.title, 'en-US'));\n }\n }\n }\n }\n const categories = Array.from(categorySet).join(', ');\n\n // Get brand ID from first product\n const brandId = products[0]?.brandId || products[0]?.brand?.id;\n\n // Get manufacturer from first product (assuming all products in a brand have same manufacturer)\n const manufacturerName =\n (products[0]?.manufacturer?.title != null\n ? resolveMultiLanguageString(products[0].manufacturer!.title, 'en-US')\n : '') ||\n products[0]?.manufacturerId ||\n 'Unknown';\n const manufacturerId = products[0]?.manufacturerId || products[0]?.manufacturer?.id;\n\n aggregatedResults.push({\n brand: brandName,\n brandId,\n manufacturer: manufacturerName,\n manufacturerId,\n productCount,\n totalValue: Number(totalValue.toFixed(2)),\n averagePrice: Number(averagePrice.toFixed(2)),\n minPrice: Number(minPrice.toFixed(2)),\n maxPrice: Number(maxPrice.toFixed(2)),\n categories,\n });\n }\n\n // Apply sorting if provided\n if (input.sort && input.sort.length > 0) {\n aggregatedResults.sort((a, b) => {\n for (const sortField of input.sort!) {\n const field = sortField.field as keyof ProductByBrandResult;\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 if (aValue < bValue) return -1 * dir;\n if (aValue > bValue) return 1 * dir;\n }\n return 0;\n });\n }\n\n // Apply pagination\n const skip = input.skip || 0;\n const take = input.take || 10;\n const total = aggregatedResults.length;\n const items = aggregatedResults.slice(skip, skip + take);\n\n return {\n items,\n total,\n };\n }\n\n //#region ---- Filter Extraction ----\n\n /**\n * Extract product-specific filters from AXPFilterClause format\n * Maps report parameter paths to product entity field names\n */\n private extractProductFilters(parameters: any): GetProductListQueryInput['filters'] {\n const filters: GetProductListQueryInput['filters'] = [];\n const paramsAny = parameters as any;\n\n if (!paramsAny?.filters || !Array.isArray(paramsAny.filters)) {\n return filters;\n }\n\n for (const filter of paramsAny.filters) {\n if (!filter?.field || filter?.value === undefined || filter?.value === null) {\n continue;\n }\n\n const field = filter.field;\n const value = filter.value;\n const operator = filter.operator || { type: 'equal' };\n\n // Handle product-specific field mappings\n if (field === 'brand') {\n // Brand filter - can be array of IDs or single ID\n if (Array.isArray(value) && value.length > 0) {\n filters.push({\n field: 'brandId',\n operator: { type: 'in' },\n value: value,\n });\n } else if (value) {\n filters.push({\n field: 'brandId',\n operator: { type: 'equal' },\n value: value,\n });\n }\n } else if (field === 'category') {\n // Category filter - can be array of IDs or single ID\n if (Array.isArray(value) && value.length > 0) {\n filters.push({\n field: 'categoryIds',\n operator: { type: 'contains' },\n value: value[0], // Use first category for contains check\n });\n } else if (value) {\n filters.push({\n field: 'categoryIds',\n operator: { type: 'contains' },\n value: value,\n });\n }\n } else if (field === 'status') {\n // Status filter - skip 'all' value\n if (value && value !== 'all') {\n filters.push({\n field: 'statusId',\n operator: { type: 'equal' },\n value: value,\n });\n }\n } else if (field === 'priceRange') {\n // Price range filter - custom logic handled in query\n filters.push({\n field: 'priceRange',\n operator: { type: 'equal' },\n value: value,\n });\n } else if (field === 'startDate' || field === 'endDate') {\n // Date filters - can be handled if needed\n // For now, skip as they might not be directly on product entity\n } else {\n // Direct field mapping\n filters.push({\n field: field,\n operator: operator,\n value: value,\n });\n }\n }\n\n return filters;\n }\n\n //#endregion\n\n //#region ---- Custom Filter Handlers ----\n\n /**\n * Apply custom price range filter to products\n */\n private applyPriceRangeFilter(\n products: AXMProductCatalogProductEntityModel[],\n priceRange: string,\n ): AXMProductCatalogProductEntityModel[] {\n return products.filter((product) => {\n const price = product.basePrice || 0;\n\n switch (priceRange) {\n case 'under-50':\n return price < 50;\n case '50-100':\n return price >= 50 && price < 100;\n case '100-500':\n return price >= 100 && price < 500;\n case '500-1000':\n return price >= 500 && price < 1000;\n case 'over-1000':\n return price >= 1000;\n default:\n return true;\n }\n });\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;AAsCA;MAKa,mBAAmB,CAAA;AAHhC,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;QACjD,IAAA,CAAA,cAAc,GAAG,IAAI,CAAC;AAC3B,aAAA,UAAU,CAAC,CAAA,EAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAA,CAAA,EAAI,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE;AAC1E,aAAA,IAAI,EAA+C;AA8PvD,IAAA;IA5PC,MAAM,KAAK,CAAC,KAAqC,EAAA;;QAE/C,MAAM,gBAAgB,GAAG,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,OAAO,CAAC;;QAGlE,MAAM,aAAa,GAAwC,EAAE;AAC7D,QAAA,IAAI,gBAAoC;QAExC,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;AACnD,YAAA,KAAK,MAAM,MAAM,IAAI,gBAAgB,EAAE;AACrC,gBAAA,IAAI,MAAM,CAAC,KAAK,KAAK,YAAY,EAAE;AACjC,oBAAA,gBAAgB,GAAG,MAAM,CAAC,KAAK;gBACjC;qBAAO;AACL,oBAAA,aAAa,CAAC,IAAI,CAAC,MAAM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IAAI;AACrC,gBAAA,KAAK,WAAW;oBACd,OAAO,KAAK,IAAI,IAAI;AACtB,gBAAA;AACE,oBAAA,OAAO,IAAI;;AAEjB,QAAA,CAAC,CAAC;IACJ;8GA/PW,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnB,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,mBAAmB,cAFlB,MAAM,EAAA,CAAA,CAAA;;2FAEP,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { inject, Injectable } from '@angular/core';
3
- import { GetProductListQuery } from './acorex-connectivity-mock-get-product-list.query-B06aC73T.mjs';
3
+ import { GetProductListQuery } from './acorex-connectivity-mock-get-product-list.query-f-mTj4ah.mjs';
4
4
 
5
5
  //#endregion
6
6
  class GetProductPdfDataQuery {
@@ -189,4 +189,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
189
189
  }] });
190
190
 
191
191
  export { GetProductPdfDataQuery };
192
- //# sourceMappingURL=acorex-connectivity-mock-get-product-pdf-data.query-CM7bsjl7.mjs.map
192
+ //# sourceMappingURL=acorex-connectivity-mock-get-product-pdf-data.query-Co1V52c4.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-connectivity-mock-get-product-pdf-data.query-CM7bsjl7.mjs","sources":["../../../../libs/connectivity/mock/src/lib/product-catalog/reports/get-product-pdf-data.query.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPQuery } from '@acorex/platform/runtime';\nimport { GetProductListQueryInput, GetProductListQueryResult } from './get-product-list.query';\nimport { GetProductListQuery } from './get-product-list.query';\n\n//#region ---- Query Input/Output Types ----\n\nexport interface GetProductPdfDataQueryInput {\n filters?: Array<{\n field: string;\n operator: { type: string };\n value: any;\n }>;\n logic?: 'and' | 'or';\n}\n\nexport interface GetProductPdfDataQueryResult {\n url?: string;\n base64?: string;\n blob?: Blob;\n filename?: string;\n}\n\n//#endregion\n\n@Injectable({\n providedIn: 'root',\n})\nexport class GetProductPdfDataQuery implements AXPQuery<GetProductPdfDataQueryInput, GetProductPdfDataQueryResult> {\n private readonly productListQuery = inject(GetProductListQuery);\n\n async fetch(input: GetProductPdfDataQueryInput | any): Promise<GetProductPdfDataQueryResult> {\n // Extract product-specific filters from AXPFilterClause format\n const extractedFilters = this.extractProductFilters(input.filters);\n\n // Get the product list data to generate PDF content\n const productListInput: GetProductListQueryInput = {\n skip: 0,\n take: 10000, // Get all products for PDF\n filters: extractedFilters,\n logic: input.logic,\n };\n\n const productData = await this.productListQuery.fetch(productListInput);\n\n // Generate a mock PDF base64 string\n // In production, this would call an actual PDF generation service\n const pdfBase64 = this.generateMockPdfBase64(productData);\n\n return {\n base64: pdfBase64,\n filename: `Product_Report_${new Date().toISOString().split('T')[0]}.pdf`,\n };\n }\n\n //#region ---- Filter Extraction ----\n\n /**\n * Extract product-specific filters from AXPFilterClause format\n * Maps report parameter paths to product entity field names\n */\n private extractProductFilters(parameters: any): GetProductListQueryInput['filters'] {\n const filters: GetProductListQueryInput['filters'] = [];\n const paramsAny = parameters as any;\n\n if (!paramsAny?.filters || !Array.isArray(paramsAny.filters)) {\n return filters;\n }\n\n for (const filter of paramsAny.filters) {\n if (!filter?.field || filter?.value === undefined || filter?.value === null) {\n continue;\n }\n\n const field = filter.field;\n const value = filter.value;\n const operator = filter.operator || { type: 'equal' };\n\n // Handle product-specific field mappings\n if (field === 'brand') {\n // Brand filter - can be array of IDs or single ID\n if (Array.isArray(value) && value.length > 0) {\n filters.push({\n field: 'brandId',\n operator: { type: 'in' },\n value: value,\n });\n } else if (value) {\n filters.push({\n field: 'brandId',\n operator: { type: 'equal' },\n value: value,\n });\n }\n } else if (field === 'category') {\n // Category filter - can be array of IDs or single ID\n if (Array.isArray(value) && value.length > 0) {\n filters.push({\n field: 'categoryIds',\n operator: { type: 'contains' },\n value: value[0], // Use first category for contains check\n });\n } else if (value) {\n filters.push({\n field: 'categoryIds',\n operator: { type: 'contains' },\n value: value,\n });\n }\n } else if (field === 'status') {\n // Status filter - skip 'all' value\n if (value && value !== 'all') {\n filters.push({\n field: 'statusId',\n operator: { type: 'equal' },\n value: value,\n });\n }\n } else if (field === 'priceRange') {\n // Price range filter - custom logic handled in query\n filters.push({\n field: 'priceRange',\n operator: { type: 'equal' },\n value: value,\n });\n } else if (field === 'startDate' || field === 'endDate') {\n // Date filters - can be handled if needed\n // For now, skip as they might not be directly on product entity\n } else {\n // Direct field mapping\n filters.push({\n field: field,\n operator: operator,\n value: value,\n });\n }\n }\n\n return filters;\n }\n\n //#endregion\n\n //#region ---- PDF Generation Helpers ----\n\n /**\n * Generate a mock PDF base64 string\n * In production, this would call an actual PDF generation service\n */\n private generateMockPdfBase64(productData: GetProductListQueryResult): string {\n // Create a minimal valid PDF with some content\n // This is a very basic PDF structure for demonstration\n // In production, use a proper PDF library like jsPDF or call a backend service\n\n const pdfContent = this.createSimplePdf(productData);\n\n // Convert to base64\n const base64 = btoa(pdfContent);\n\n return base64;\n }\n\n /**\n * Create a simple PDF document structure\n * This is a minimal valid PDF for demonstration - in production use a proper PDF library\n */\n private createSimplePdf(productData: GetProductListQueryResult): string {\n // Use a minimal valid PDF structure that browsers can render\n // This is a very basic single-page PDF\n const pdf = `%PDF-1.4\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R >>\nendobj\n2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Contents 4 0 R /Resources << /Font << /F1 5 0 R >> >> >>\nendobj\n4 0 obj\n<< /Length 200 >>\nstream\nBT\n/F1 12 Tf\n100 700 Td\n(Product Report) Tj\n0 -20 Td\n(Total Brands: ${productData.total}) Tj\n0 -20 Td\n(Generated: ${new Date().toLocaleDateString()}) Tj\n0 -20 Td\n(Items: ${productData.items.length}) Tj\nET\nendstream\nendobj\n5 0 obj\n<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>\nendobj\nxref\n0 6\n0000000000 65535 f \n0000000009 00000 n \n0000000058 00000 n \n0000000115 00000 n \n0000000317 00000 n \n0000000444 00000 n \ntrailer\n<< /Size 6 /Root 1 0 R >>\nstartxref\n527\n%%EOF`;\n\n return pdf;\n }\n\n //#endregion\n}\n\n"],"names":[],"mappings":";;;;AAuBA;MAKa,sBAAsB,CAAA;AAHnC,IAAA,WAAA,GAAA;AAIqB,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AA2LlE,IAAA;IAzLG,MAAM,KAAK,CAAC,KAAwC,EAAA;;QAEhD,MAAM,gBAAgB,GAAG,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,OAAO,CAAC;;AAGlE,QAAA,MAAM,gBAAgB,GAA6B;AAC/C,YAAA,IAAI,EAAE,CAAC;YACP,IAAI,EAAE,KAAK;AACX,YAAA,OAAO,EAAE,gBAAgB;YACzB,KAAK,EAAE,KAAK,CAAC,KAAK;SACrB;QAED,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,gBAAgB,CAAC;;;QAIvE,MAAM,SAAS,GAAG,IAAI,CAAC,qBAAqB,CAAC,WAAW,CAAC;QAEzD,OAAO;AACH,YAAA,MAAM,EAAE,SAAS;AACjB,YAAA,QAAQ,EAAE,CAAA,eAAA,EAAkB,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CA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N;QACJ;AAEA,QAAA,OAAO,OAAO;IAClB;;;AAMA;;;AAGG;AACK,IAAA,qBAAqB,CAAC,WAAsC,EAAA;;;;QAKhE,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC;;AAGpD,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC;AAE/B,QAAA,OAAO,MAAM;IACjB;AAEA;;;AAGG;AACK,IAAA,eAAe,CAAC,WAAsC,EAAA;;;AAG1D,QAAA,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;AAkBH,eAAA,EAAA,WAAW,CAAC,KAAK,CAAA;;AAEpB,YAAA,EAAA,IAAI,IAAI,EAAE,CAAC,kBAAkB,EAAE,CAAA;;UAEnC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAA;;;;;;;;;;;;;;;;;;;MAmB5B;AAEE,QAAA,OAAO,GAAG;IACd;8GAzLS,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAtB,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,sBAAsB,cAFnB,MAAM,EAAA,CAAA,CAAA;;2FAET,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAHlC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE,MAAM;AACrB,iBAAA;;;;;"}
1
+ {"version":3,"file":"acorex-connectivity-mock-get-product-pdf-data.query-Co1V52c4.mjs","sources":["../../../../libs/connectivity/mock/src/lib/product-catalog/reports/get-product-pdf-data.query.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPQuery } from '@acorex/platform/runtime';\nimport { GetProductListQueryInput, GetProductListQueryResult } from './get-product-list.query';\nimport { GetProductListQuery } from './get-product-list.query';\n\n//#region ---- Query Input/Output Types ----\n\nexport interface GetProductPdfDataQueryInput {\n filters?: Array<{\n field: string;\n operator: { type: string };\n value: any;\n }>;\n logic?: 'and' | 'or';\n}\n\nexport interface GetProductPdfDataQueryResult {\n url?: string;\n base64?: string;\n blob?: Blob;\n filename?: string;\n}\n\n//#endregion\n\n@Injectable({\n providedIn: 'root',\n})\nexport class GetProductPdfDataQuery implements AXPQuery<GetProductPdfDataQueryInput, GetProductPdfDataQueryResult> {\n private readonly productListQuery = inject(GetProductListQuery);\n\n async fetch(input: GetProductPdfDataQueryInput | any): Promise<GetProductPdfDataQueryResult> {\n // Extract product-specific filters from AXPFilterClause format\n const extractedFilters = this.extractProductFilters(input.filters);\n\n // Get the product list data to generate PDF content\n const productListInput: GetProductListQueryInput = {\n skip: 0,\n take: 10000, // Get all products for PDF\n filters: extractedFilters,\n logic: input.logic,\n };\n\n const productData = await this.productListQuery.fetch(productListInput);\n\n // Generate a mock PDF base64 string\n // In production, this would call an actual PDF generation service\n const pdfBase64 = this.generateMockPdfBase64(productData);\n\n return {\n base64: pdfBase64,\n filename: `Product_Report_${new Date().toISOString().split('T')[0]}.pdf`,\n };\n }\n\n //#region ---- Filter Extraction ----\n\n /**\n * Extract product-specific filters from AXPFilterClause format\n * Maps report parameter paths to product entity field names\n */\n private extractProductFilters(parameters: any): GetProductListQueryInput['filters'] {\n const filters: GetProductListQueryInput['filters'] = [];\n const paramsAny = parameters as any;\n\n if (!paramsAny?.filters || !Array.isArray(paramsAny.filters)) {\n return filters;\n }\n\n for (const filter of paramsAny.filters) {\n if (!filter?.field || filter?.value === undefined || filter?.value === null) {\n continue;\n }\n\n const field = filter.field;\n const value = filter.value;\n const operator = filter.operator || { type: 'equal' };\n\n // Handle product-specific field mappings\n if (field === 'brand') {\n // Brand filter - can be array of IDs or single ID\n if (Array.isArray(value) && value.length > 0) {\n filters.push({\n field: 'brandId',\n operator: { type: 'in' },\n value: value,\n });\n } else if (value) {\n filters.push({\n field: 'brandId',\n operator: { type: 'equal' },\n value: value,\n });\n }\n } else if (field === 'category') {\n // Category filter - can be array of IDs or single ID\n if (Array.isArray(value) && value.length > 0) {\n filters.push({\n field: 'categoryIds',\n operator: { type: 'contains' },\n value: value[0], // Use first category for contains check\n });\n } else if (value) {\n filters.push({\n field: 'categoryIds',\n operator: { type: 'contains' },\n value: value,\n });\n }\n } else if (field === 'status') {\n // Status filter - skip 'all' value\n if (value && value !== 'all') {\n filters.push({\n field: 'statusId',\n operator: { type: 'equal' },\n value: value,\n });\n }\n } else if (field === 'priceRange') {\n // Price range filter - custom logic handled in query\n filters.push({\n field: 'priceRange',\n operator: { type: 'equal' },\n value: value,\n });\n } else if (field === 'startDate' || field === 'endDate') {\n // Date filters - can be handled if needed\n // For now, skip as they might not be directly on product entity\n } else {\n // Direct field mapping\n filters.push({\n field: field,\n operator: operator,\n value: value,\n });\n }\n }\n\n return filters;\n }\n\n //#endregion\n\n //#region ---- PDF Generation Helpers ----\n\n /**\n * Generate a mock PDF base64 string\n * In production, this would call an actual PDF generation service\n */\n private generateMockPdfBase64(productData: GetProductListQueryResult): string {\n // Create a minimal valid PDF with some content\n // This is a very basic PDF structure for demonstration\n // In production, use a proper PDF library like jsPDF or call a backend service\n\n const pdfContent = this.createSimplePdf(productData);\n\n // Convert to base64\n const base64 = btoa(pdfContent);\n\n return base64;\n }\n\n /**\n * Create a simple PDF document structure\n * This is a minimal valid PDF for demonstration - in production use a proper PDF library\n */\n private createSimplePdf(productData: GetProductListQueryResult): string {\n // Use a minimal valid PDF structure that browsers can render\n // This is a very basic single-page PDF\n const pdf = `%PDF-1.4\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R >>\nendobj\n2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Contents 4 0 R /Resources << /Font << /F1 5 0 R >> >> >>\nendobj\n4 0 obj\n<< /Length 200 >>\nstream\nBT\n/F1 12 Tf\n100 700 Td\n(Product Report) Tj\n0 -20 Td\n(Total Brands: ${productData.total}) Tj\n0 -20 Td\n(Generated: ${new Date().toLocaleDateString()}) Tj\n0 -20 Td\n(Items: ${productData.items.length}) Tj\nET\nendstream\nendobj\n5 0 obj\n<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>\nendobj\nxref\n0 6\n0000000000 65535 f \n0000000009 00000 n \n0000000058 00000 n \n0000000115 00000 n \n0000000317 00000 n \n0000000444 00000 n \ntrailer\n<< /Size 6 /Root 1 0 R >>\nstartxref\n527\n%%EOF`;\n\n return pdf;\n }\n\n //#endregion\n}\n\n"],"names":[],"mappings":";;;;AAuBA;MAKa,sBAAsB,CAAA;AAHnC,IAAA,WAAA,GAAA;AAIqB,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AA2LlE,IAAA;IAzLG,MAAM,KAAK,CAAC,KAAwC,EAAA;;QAEhD,MAAM,gBAAgB,GAAG,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,OAAO,CAAC;;AAGlE,QAAA,MAAM,gBAAgB,GAA6B;AAC/C,YAAA,IAAI,EAAE,CAAC;YACP,IAAI,EAAE,KAAK;AACX,YAAA,OAAO,EAAE,gBAAgB;YACzB,KAAK,EAAE,KAAK,CAAC,KAAK;SACrB;QAED,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,gBAAgB,CAAC;;;QAIvE,MAAM,SAAS,GAAG,IAAI,CAAC,qBAAqB,CAAC,WAAW,CAAC;QAEzD,OAAO;AACH,YAAA,MAAM,EAAE,SAAS;AACjB,YAAA,QAAQ,EAAE,CAAA,eAAA,EAAkB,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA,IAAA,CAAM;SAC3E;IACL;;AAIA;;;AAGG;AACK,I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AAA,qBAAqB,CAAC,WAAsC,EAAA;;;;QAKhE,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC;;AAGpD,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC;AAE/B,QAAA,OAAO,MAAM;IACjB;AAEA;;;AAGG;AACK,IAAA,eAAe,CAAC,WAAsC,EAAA;;;AAG1D,QAAA,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;AAkBH,eAAA,EAAA,WAAW,CAAC,KAAK,CAAA;;AAEpB,YAAA,EAAA,IAAI,IAAI,EAAE,CAAC,kBAAkB,EAAE,CAAA;;UAEnC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAA;;;;;;;;;;;;;;;;;;;MAmB5B;AAEE,QAAA,OAAO,GAAG;IACd;8GAzLS,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAtB,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,sBAAsB,cAFnB,MAAM,EAAA,CAAA,CAAA;;2FAET,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAHlC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE,MAAM;AACrB,iBAAA;;;;;"}
@@ -1,2 +1,2 @@
1
- export { b as ACTIVITY_CATEGORIES, c as ACTIVITY_DEFINITIONS, d as AI_ASSIST_MOCK, e as AI_MODEL_MOCK, f as APPLICATIONS, g as AXCActivityCategorySeeder, h as AXCActivityDefinitionSeeder, i as AXCAiAssistSeeder, j as AXCAiManagementMockModule, k as AXCAiModelSeeder, l as AXCAppTermDataSeeder, m as AXCAppVersionDataSeeder, n as AXCApplicationDataSeeder, o as AXCApplicationManagementMockModule, p as AXCAssessmentManagementMockModule, q as AXCAssetManagementMockModule, s as AXCAuthMockModule, t as AXCCalendarDataSeeder, u as AXCCalendarEventDataSeeder, v as AXCCalendarManagementMockModule, w as AXCCommandRegistryDataSeeder, x as AXCCommonMockModule, y as AXCContactCoreMockModule, z as AXCContentManagementMockModule, B as AXCConversationDataSeeder, C as AXCConversationMockConversationApi, D as AXCConversationMockMessageApi, E as AXCConversationMockModule, F as AXCConversationMockRealtimeApi, G as AXCConversationMockUserApi, H as AXCCustomerManagementMockModule, I as AXCDashboardManagementMockModule, J as AXCDataManagementMockModule, K as AXCDexieEntityStorageService, L as AXCDocumentManagementMockModule, M as AXCEditionDataSeeder, N as AXCEntityDefinitionSeederService, O as AXCEntityDefinitionsModule, P as AXCEntityStorageInsertCommand, Q as AXCEntityStorageModule, R as AXCEntityStorageQueryQuery, S as AXCFileStorageServiceDexie, T as AXCFileStorageServiceFirestore, U as AXCFinancialCoreMockModule, V as AXCFirestoreEntityStorageService, W as AXCFormTemplateManagementMockModule, X as AXCGoogleStrategyMock, Y as AXCHealthCoreMockModule, Z as AXCHelpDeskMockModule, _ as AXCHumanCapitalManagementMockModule, $ as AXCIdentifierManagementMockModule, a0 as AXCImageCaptchaChallengeProviderMock, a1 as AXCLearningManagementMockModule, a2 as AXCLocaleManagementMockModule, a3 as AXCLocationManagementMockModule, a4 as AXCLockService, a5 as AXCMeasurementCoreMockModule, a6 as AXCMeetingManagementMockModule, a7 as AXCMetaDataDefinitionDataSeeder, a8 as AXCMetadataCategorySeeder, a9 as AXCMiddlewaresModule, aa as AXCMockCaptchaChallengeComponent, ab as AXCMockEntityLogListener, ac as AXCMockModule, ad as AXCMockShowMetaDataFormPopupCommand, ae as AXCNotificationManagementMockModule, af as AXCOrderManagementMockModule, ag as AXCOrganizationManagementMockModule, ah as AXCPersonCoreMockModule, ai as AXCPlatformManagementMockModule, aj as AXCProcurementManagementMockModule, ak as AXCProductCatalogMockModule, al as AXCProjectManagementMockModule, am as AXCQueryRegistryDataSeeder, an as AXCReportManagementMockModule, ao as AXCSecurityManagementMockModule, ap as AXCStoredEntityDefinitionLoader, aq as AXCSubscriptionManagementMockModule, ar as AXCSupplierManagementMockModule, as as AXCTaskManagementMockModule, at as AXCTenantManagementMockModule, au as AXCTenantSeeder, av as AXCTokensDataSeeder, aw as AXCUserPassStrategyMock, ax as AXCVersionDB, ay as AXCVersioningService, az as AXCWorkflowCategorySeeder, aA as AXCWorkflowDefinitionDataSeeder, aB as AXCWorkflowEngine, aC as AXCWorkflowExecutionDB, aD as AXCWorkflowExecutionStoreDexie, aE as AXCWorkflowExecutionStoreFirestore, aF as AXCWorkflowManagementMockModule, aG as AXC_ENTITY_STORAGE_BACKEND_TYPE, aH as AXC_FIRESTORE_CONFIG, aI as AXC_FIRESTORE_DB, aJ as AXC_WORKFLOW_EXECUTION_STORE, aK as AXMAiDemisDefaultAssistId, aL as AXMAiModelStableIds, aM as AXMAiPlatformDefaultAssistId, aN as AXMAutomationDataSeeder, aO as AXMBusinessUnitDataSeeder, aP as AXMCalendarEventTypeSeeder, aQ as AXMDashboardChartDataSourceDefinition, aR as AXMEmployeeDataSeeder, aS as AXMEmploymentTypeDataSeeder, aT as AXMFormDataSourcesProvider, aU as AXMJobDefinitionDataSeeder, aV as AXMJobLevelDataSeeder, aW as AXMLeaveRequestDataSeeder, aX as AXMMeetingDataSeeder, aY as AXMMeetingFilesDataSeeder, aZ as AXMMeetingParticipantDataSeeder, a_ as AXMMeetingRoleTypeDataSeeder, a$ as AXMMeetingSessionDataSeeder, b0 as AXMMeetingTypeDataSeeder, b1 as AXMMeetingTypeFileTemplateDataSeeder, b2 as AXMPositionAssignmentDataSeeder, b3 as AXMPositionDataSeeder, b4 as AXMQuestionBankItemCategoryDataSeeder, b5 as AXMQuestionBankItemDataSeeder, b6 as AXMQuestionnaireCalculationDataSeeder, b7 as AXMQuestionnaireCategoryDataSeeder, b8 as AXMQuestionnaireDataSeeder, b9 as AXMResponsibilityDataSeeder, ba as AXMTagDataSeeder, bb as AXMTeamDataSeeder, bc as AXMTeamMemberDataSeeder, bd as AXMTeamMemberRoleDataSeeder, be as AXMWorkflowDashboardChartDataSourceDefinition, bf as AXM_AI_REGISTRY_COMMAND_NAME, bg as AXM_AI_REGISTRY_QUERY_NAME, bh as AXM_CORPORATE_BUSINESS_UNIT_ID, bi as AXPDashboardDataSeeder, bj as AXPIdentifierDB, bk as AXPMessageDataSeeder, bl as AXPMockChecksumProvider, bm as AXPMockClockProvider, bn as AXPMockIdentifierService, bo as AXPMockLookupProvider, bp as AXPMockPolicyProvider, bq as AXPMockSequenceProvider, br as AXPRoomDataSeeder, bs as AXPSecurityManagementRoleDataSeeder, bt as AXPSecurityManagementUserDataSeeder, bu as AXPTaskBoardPlatformManagementTaskProvider, bv as AXPTaskBoardProjectManagementTaskProvider, bw as AXVChangeType, bx as BCC, by as BOC, bz as BUSINESS_UNITS_MOCK, bA as CHAT_LAST_MESSAGE_IDS, bB as COSTMANAGER_ENTERPRISE, bC as COSTMANAGER_PROFESSIONAL, bD as COSTMANAGER_STANDARD, bE as CP, bF as CRM_ENTERPRISE, bG as DASHBOARDS, bH as EDITIONS, bI as EMPLOYEES_MOCK, bJ as EMPLOYMENT_TYPES_MOCK, bK as ENTITY_DEFINITION_MAP, bL as ENTITY_REGISTRY, bM as FINANCE_BASIC, bN as FINANCE_ENTERPRISE, bO as FINANCE_PRO, bP as G, bQ as HR_ENTERPRISE, bR as HW, bS as JOB_DEFINITIONS_CATEGORY_MOCK, bT as JOB_DEFINITIONS_MOCK, bU as JOB_DEFINITION_CATEGORY_KEY_TO_ID, bV as JOB_LEVELS_MOCK, bW as LASER_PLUMBING_TENANT_ID, bX as LEAVE_REQUESTS_MOCK, bY as METADATA_CATEGORY_IDS, bZ as METADATA_GENERAL_CATEGORY_REFS, b_ as METADATA_SYSTEM_CATEGORY_REFS, b$ as MLC, c0 as OHR, c1 as ORDERING_BASIC, c2 as ORDERING_ENTERPRISE, c3 as ORDERING_STANDARD, c4 as OWNERSHIP_FILTER_BYPASS, c5 as PLATFORM_CONSOLE, c6 as PLATFORM_TENANT_ID, c7 as PM, c8 as POSITIONS_CATEGORY_MOCK, c9 as POSITIONS_MOCK, ca as POSITION_ASSIGNMENTS_MOCK, cb as QCP, cc as QGEN, cd as QHW, ce as QOHR, cf as QPM, cg as QTLE, ch as QUESTIONNAIRE_CATEGORY_MOCK, ci as QUESTION_BANK_ITEM_CATEGORY_MOCK, cj as QWS, ck as RESPONSIBILITIES_CATEGORY_MOCK, cl as RESPONSIBILITIES_MOCK, cm as RESPONSIBILITY_CATEGORY_KEY_TO_ID, cn as SAFETYMINDER_BASIC, co as SAFETYMINDER_ENTERPRISE, cp as SAFETYMINDER_PROFESSIONAL, cq as SHOP_BASIC, cr as SHOP_ENTERPRISE, cs as SHOP_PRO, ct as TAGS_MOCK, cu as TASKS, cv as TASK_STATUSES, cw as TASK_TEMPLATES, cx as TASK_TYPES, cy as TEAMS_MOCK, cz as TEAM_MEMBERS_MOCK, cA as TEAM_MEMBER_ROLES_MOCK, cB as TIMEPLICITY_TENANT_ID, cC as TLA, cD as TOKENS, cE as TPC, cF as VISIBILITY_FILTER_BYPASS, cG as WORKFLOW_CATEGORIES, cH as WS, cI as activityCategoryMocks, cJ as activityDefinitionEntityMock, cK as applyEntityDefinitionFirestoreSnapshot, cL as automationCommandMiddleware, cM as automationMock, cN as avatarInterface, cO as axVersionDB, cP as axWorkflowExecutionDB, cQ as axcPatchEmployeeActivePrimaryPositionRefsFromRows, cR as axcPatchEmployeeManagerRefsFromRows, cS as axcResolveCommandRegistrySeedId, cT as axcResolveQueryRegistrySeedId, cU as bankCategory, cV as buildEntityStorageQuickSearchFilter, cW as bypassAllFilters, cX as bypassOwnershipFilter, cY as bypassVisibilityFilter, cZ as calendarEventMock, c_ as calendarEventTypeMockData, c$ as calendarMock, d0 as chatMessageMock, d1 as chatMock, d2 as checkboxInterface, d3 as childCountMiddleware, d4 as clearEntityDefinitionFirestoreCollections, d5 as collectQuickSearchFieldPathsFromEntityDefinition, d6 as colorInterface, d7 as computeDiff, d8 as contactInterface, d9 as createAndSaveDashboardForUser, da as createDashboardForUser, db as createFileCastMiddleware, dc as createWidgetLayoutConfig, dd as dateInterface, de as dateTimeInterface, df as descriptionInterface, dg as documentFolderSyncMiddleware, dh as emailInterface, di as entityDefDb, dj as entityValidationMiddleware, dk as fileUploaderInterface, dl as findEmployeeById, dm as folderStorageMiddleware, dn as generateUserDashboard, dp as groupOrderItemCalculatorMiddleware, dq as historyMiddleware, dr as identifierCommitMiddleware, ds as imageInterface, dt as inspectionOkXNaInterface, du as loadMockPropertyDefinitions, dv as lockGuardMiddleware, dw as longTextAnswerInterface, dx as lookupInterface, dy as lookupResolverMiddleware, dz as mapInterface, dA as meetingFilesMock, dB as meetingIds, dC as meetingMock, dD as meetingParticipantMock, dE as meetingRoleTypeMock, dF as meetingSessionMock, dG as meetingTimeSlotMock, dH as meetingTypeFileTemplateMock, dI as meetingTypeMock, dJ as mergeDetailRelationMiddleware, dK as mergeQuickSearchIntoRequest, dL as metadataCategoryMocks, dM as mockQuestionBankItemByName, dN as mockRoleDefinitions, dO as mockUsers, dP as multipleChoiceInterface, dQ as multipleSelectInterface, dR as normalizeAnyFileArrayForView, dS as normalizeSnapshotFileFieldsForView, dT as numberInterface, dU as parseEntityStorageInsertData, dV as parseEntityStorageQueryRequest, dW as participantIds, dX as participantMock, dY as passwordInterface, dZ as personIdentifierTypeMock, d_ as personIds, d$ as personLegalIds, e0 as personMock, e1 as personNaturalIds, e2 as phoneInterface, e3 as primaryMiddleware, e4 as provideMockPropertySetups, e5 as qrcodeInterface, e6 as questionBankItemMock, e7 as questionnaireCalculationMock, e8 as questionnaireMock, e9 as ratingInterface, ea as richTextInterface, eb as scaleInterface, ec as selectInterface, ed as selectionListInterface, ee as sexAtBirthInterface, ef as signatureInterface, eg as signatureLoaderMiddleware, eh as statusDefaultMiddleware, ei as tagInterface, ej as tenantMocks, ek as textAreaInterface, el as textInterface, em as timeDurationInterface, en as titleInterface, eo as toUiRows, ep as toggleInterface, eq as tokenCategoryIds, er as tokenCategoryMocks, es as urlInterface, et as versionInterface, eu as visibilityFilterMiddleware, ev as workflowDefinitionEntityMock, ew as workflowDefinitionIds, ex as workflowDefinitionMock, ey as yesNoInterface } from './acorex-connectivity-mock-acorex-connectivity-mock-BpUUTZOi.mjs';
1
+ export { b as ACTIVITY_CATEGORIES, c as ACTIVITY_CATEGORY_ID_BY_KEY, d as ACTIVITY_DEFINITIONS, e as AI_ASSIST_MOCK, f as AI_MODEL_MOCK, g as APPLICATIONS, h as AXCActivityCategorySeeder, i as AXCActivityDefinitionSeeder, j as AXCAiAssistSeeder, k as AXCAiManagementMockModule, l as AXCAiModelSeeder, m as AXCAppTermDataSeeder, n as AXCAppVersionDataSeeder, o as AXCApplicationDataSeeder, p as AXCApplicationManagementMockModule, q as AXCAssessmentManagementMockModule, s as AXCAssetManagementMockModule, t as AXCAuthMockModule, u as AXCCalendarDataSeeder, v as AXCCalendarEventDataSeeder, w as AXCCalendarManagementMockModule, x as AXCCommandRegistryDataSeeder, y as AXCCommonMockModule, z as AXCContactCoreMockModule, B as AXCContentManagementMockModule, C as AXCConversationDataSeeder, D as AXCConversationMockConversationApi, E as AXCConversationMockMessageApi, F as AXCConversationMockModule, G as AXCConversationMockRealtimeApi, H as AXCConversationMockUserApi, I as AXCCustomerManagementMockModule, J as AXCDashboardManagementMockModule, K as AXCDataManagementMockModule, L as AXCDexieEntityStorageService, M as AXCDocumentManagementMockModule, N as AXCEditionDataSeeder, O as AXCEntityDefinitionSeederService, P as AXCEntityDefinitionsModule, Q as AXCEntityStorageInsertCommand, R as AXCEntityStorageModule, S as AXCEntityStorageQueryQuery, T as AXCFileStorageServiceDexie, U as AXCFileStorageServiceFirestore, V as AXCFinancialCoreMockModule, W as AXCFirestoreEntityStorageService, X as AXCFormTemplateManagementMockModule, Y as AXCGoogleStrategyMock, Z as AXCHealthCoreMockModule, _ as AXCHelpDeskMockModule, $ as AXCHumanCapitalManagementMockModule, a0 as AXCIdentifierManagementMockModule, a1 as AXCImageCaptchaChallengeProviderMock, a2 as AXCLearningManagementMockModule, a3 as AXCLocaleManagementMockModule, a4 as AXCLocationManagementMockModule, a5 as AXCLockService, a6 as AXCMeasurementCoreMockModule, a7 as AXCMeetingManagementMockModule, a8 as AXCMetaDataDefinitionDataSeeder, a9 as AXCMetadataCategorySeeder, aa as AXCMiddlewaresModule, ab as AXCMockCaptchaChallengeComponent, ac as AXCMockEntityLogListener, ad as AXCMockModule, ae as AXCMockShowMetaDataFormPopupCommand, af as AXCNotificationManagementMockModule, ag as AXCOrderManagementMockModule, ah as AXCOrganizationManagementMockModule, ai as AXCPersonCoreMockModule, aj as AXCPlatformManagementMockModule, ak as AXCProcurementManagementMockModule, al as AXCProductCatalogMockModule, am as AXCProjectManagementMockModule, an as AXCQueryRegistryDataSeeder, ao as AXCReportManagementMockModule, ap as AXCSecurityManagementMockModule, aq as AXCStoredEntityDefinitionLoader, ar as AXCSubscriptionManagementMockModule, as as AXCSupplierManagementMockModule, at as AXCTaskManagementMockModule, au as AXCTenantManagementMockModule, av as AXCTenantSeeder, aw as AXCTokensDataSeeder, ax as AXCUserPassStrategyMock, ay as AXCVersionDB, az as AXCVersioningService, aA as AXCWorkflowCategorySeeder, aB as AXCWorkflowDefinitionDataSeeder, aC as AXCWorkflowEngine, aD as AXCWorkflowExecutionDB, aE as AXCWorkflowExecutionStoreDexie, aF as AXCWorkflowExecutionStoreFirestore, aG as AXCWorkflowManagementMockModule, aH as AXC_ENTITY_STORAGE_BACKEND_TYPE, aI as AXC_FIRESTORE_CONFIG, aJ as AXC_FIRESTORE_DB, aK as AXC_WORKFLOW_EXECUTION_STORE, aL as AXMAiDemisDefaultAssistId, aM as AXMAiModelStableIds, aN as AXMAiPlatformDefaultAssistId, aO as AXMAutomationDataSeeder, aP as AXMBusinessUnitDataSeeder, aQ as AXMCalendarEventTypeSeeder, aR as AXMDashboardChartDataSourceDefinition, aS as AXMEmployeeDataSeeder, aT as AXMEmploymentTypeDataSeeder, aU as AXMFormDataSourcesProvider, aV as AXMJobDefinitionDataSeeder, aW as AXMJobLevelDataSeeder, aX as AXMLeaveRequestDataSeeder, aY as AXMMeetingDataSeeder, aZ as AXMMeetingFilesDataSeeder, a_ as AXMMeetingParticipantDataSeeder, a$ as AXMMeetingRoleTypeDataSeeder, b0 as AXMMeetingSessionDataSeeder, b1 as AXMMeetingTypeDataSeeder, b2 as AXMMeetingTypeFileTemplateDataSeeder, b3 as AXMPositionAssignmentDataSeeder, b4 as AXMPositionDataSeeder, b5 as AXMQuestionBankItemCategoryDataSeeder, b6 as AXMQuestionBankItemDataSeeder, b7 as AXMQuestionnaireCalculationDataSeeder, b8 as AXMQuestionnaireCategoryDataSeeder, b9 as AXMQuestionnaireDataSeeder, ba as AXMResponsibilityDataSeeder, bb as AXMTagDataSeeder, bc as AXMTeamDataSeeder, bd as AXMTeamMemberDataSeeder, be as AXMTeamMemberRoleDataSeeder, bf as AXMWorkflowDashboardChartDataSourceDefinition, bg as AXM_AI_REGISTRY_COMMAND_NAME, bh as AXM_AI_REGISTRY_QUERY_NAME, bi as AXM_CORPORATE_BUSINESS_UNIT_ID, bj as AXPDashboardDataSeeder, bk as AXPIdentifierDB, bl as AXPMessageDataSeeder, bm as AXPMockChecksumProvider, bn as AXPMockClockProvider, bo as AXPMockIdentifierService, bp as AXPMockLookupProvider, bq as AXPMockPolicyProvider, br as AXPMockSequenceProvider, bs as AXPRoomDataSeeder, bt as AXPSecurityManagementRoleDataSeeder, bu as AXPSecurityManagementUserDataSeeder, bv as AXPTaskBoardPlatformManagementTaskProvider, bw as AXPTaskBoardProjectManagementTaskProvider, bx as AXVChangeType, by as BCC, bz as BOC, bA as BUSINESS_UNITS_MOCK, bB as CHAT_LAST_MESSAGE_IDS, bC as COSTMANAGER_ENTERPRISE, bD as COSTMANAGER_PROFESSIONAL, bE as COSTMANAGER_STANDARD, bF as CP, bG as CRM_ENTERPRISE, bH as DASHBOARDS, bI as EDITIONS, bJ as EMPLOYEES_MOCK, bK as EMPLOYMENT_TYPES_MOCK, bL as ENTITY_DEFINITION_MAP, bM as ENTITY_REGISTRY, bN as FINANCE_BASIC, bO as FINANCE_ENTERPRISE, bP as FINANCE_PRO, bQ as G, bR as HR_ENTERPRISE, bS as HW, bT as JOB_DEFINITIONS_CATEGORY_MOCK, bU as JOB_DEFINITIONS_MOCK, bV as JOB_DEFINITION_CATEGORY_KEY_TO_ID, bW as JOB_LEVELS_MOCK, bX as LASER_PLUMBING_TENANT_ID, bY as LEAVE_REQUESTS_MOCK, bZ as METADATA_CATEGORY_IDS, b_ as METADATA_GENERAL_CATEGORY_REFS, b$ as METADATA_SYSTEM_CATEGORY_REFS, c0 as MLC, c1 as OHR, c2 as ORDERING_BASIC, c3 as ORDERING_ENTERPRISE, c4 as ORDERING_STANDARD, c5 as OWNERSHIP_FILTER_BYPASS, c6 as PLATFORM_CONSOLE, c7 as PLATFORM_TENANT_ID, c8 as PM, c9 as POSITIONS_CATEGORY_MOCK, ca as POSITIONS_MOCK, cb as POSITION_ASSIGNMENTS_MOCK, cc as QCP, cd as QGEN, ce as QHW, cf as QOHR, cg as QPM, ch as QTLE, ci as QUESTIONNAIRE_CATEGORY_MOCK, cj as QUESTION_BANK_ITEM_CATEGORY_MOCK, ck as QWS, cl as RESPONSIBILITIES_CATEGORY_MOCK, cm as RESPONSIBILITIES_MOCK, cn as RESPONSIBILITY_CATEGORY_KEY_TO_ID, co as SAFETYMINDER_BASIC, cp as SAFETYMINDER_ENTERPRISE, cq as SAFETYMINDER_PROFESSIONAL, cr as SHOP_BASIC, cs as SHOP_ENTERPRISE, ct as SHOP_PRO, cu as TAGS_MOCK, cv as TASKS, cw as TASK_STATUSES, cx as TASK_TEMPLATES, cy as TASK_TYPES, cz as TEAMS_MOCK, cA as TEAM_MEMBERS_MOCK, cB as TEAM_MEMBER_ROLES_MOCK, cC as TIMEPLICITY_TENANT_ID, cD as TLA, cE as TOKENS, cF as TPC, cG as VISIBILITY_FILTER_BYPASS, cH as WORKFLOW_CATEGORIES, cI as WS, cJ as activityCategoryMocks, cK as activityDefinitionEntityMock, cL as applyEntityDefinitionFirestoreSnapshot, cM as automationCommandMiddleware, cN as automationMock, cO as avatarInterface, cP as axVersionDB, cQ as axWorkflowExecutionDB, cR as axcPatchEmployeeActivePrimaryBusinessUnitRefsFromRows, cS as axcPatchEmployeeActivePrimaryPositionRefsFromRows, cT as axcPatchEmployeeManagerRefsFromRows, cU as axcResolveCommandRegistrySeedId, cV as axcResolveQueryRegistrySeedId, cW as bankCategory, cX as buildEntityStorageQuickSearchFilter, cY as bypassAllFilters, cZ as bypassOwnershipFilter, c_ as bypassVisibilityFilter, c$ as calendarEventMock, d0 as calendarEventTypeMockData, d1 as calendarMock, d2 as chatMessageMock, d3 as chatMock, d4 as checkboxInterface, d5 as childCountMiddleware, d6 as clearEntityDefinitionFirestoreCollections, d7 as collectQuickSearchFieldPathsFromEntityDefinition, d8 as colorInterface, d9 as computeDiff, da as contactInterface, db as createAndSaveDashboardForUser, dc as createDashboardForUser, dd as createFileCastMiddleware, de as createWidgetLayoutConfig, df as dateInterface, dg as dateTimeInterface, dh as descriptionInterface, di as documentFolderSyncMiddleware, dj as emailInterface, dk as entityDefDb, dl as entityValidationMiddleware, dm as fileUploaderInterface, dn as finalizeActivityCategoryItemCounts, dp as findEmployeeById, dq as folderStorageMiddleware, dr as generateUserDashboard, ds as groupOrderItemCalculatorMiddleware, dt as historyMiddleware, du as identifierCommitMiddleware, dv as imageInterface, dw as inspectionOkXNaInterface, dx as loadMockPropertyDefinitions, dy as lockGuardMiddleware, dz as longTextAnswerInterface, dA as lookupInterface, dB as lookupResolverMiddleware, dC as mapInterface, dD as meetingFilesMock, dE as meetingIds, dF as meetingMock, dG as meetingParticipantMock, dH as meetingRoleTypeMock, dI as meetingSessionMock, dJ as meetingTimeSlotMock, dK as meetingTypeFileTemplateMock, dL as meetingTypeMock, dM as mergeDetailRelationMiddleware, dN as mergeQuickSearchIntoRequest, dO as metadataCategoryMocks, dP as mockQuestionBankItemByName, dQ as mockRoleDefinitions, dR as mockUsers, dS as multipleChoiceInterface, dT as multipleSelectInterface, dU as normalizeAnyFileArrayForView, dV as normalizeSnapshotFileFieldsForView, dW as numberInterface, dX as parseEntityStorageInsertData, dY as parseEntityStorageQueryRequest, dZ as participantIds, d_ as participantMock, d$ as passwordInterface, e0 as personIdentifierTypeMock, e1 as personIds, e2 as personLegalIds, e3 as personMock, e4 as personNaturalIds, e5 as phoneInterface, e6 as primaryMiddleware, e7 as provideMockPropertySetups, e8 as qrcodeInterface, e9 as questionBankItemMock, ea as questionnaireCalculationMock, eb as questionnaireMock, ec as ratingInterface, ed as richTextInterface, ee as scaleInterface, ef as selectInterface, eg as selectionListInterface, eh as sexAtBirthInterface, ei as signatureInterface, ej as signatureLoaderMiddleware, ek as statusDefaultMiddleware, el as tagInterface, em as tenantMocks, en as textAreaInterface, eo as textInterface, ep as timeDurationInterface, eq as titleInterface, er as toUiRows, es as toggleInterface, et as tokenCategoryIds, eu as tokenCategoryMocks, ev as urlInterface, ew as versionInterface, ex as visibilityFilterMiddleware, ey as workflowDefinitionEntityMock, ez as workflowDefinitionIds, eA as workflowDefinitionMock, eB as yesNoInterface } from './acorex-connectivity-mock-acorex-connectivity-mock-Bso6KgSC.mjs';
2
2
  //# sourceMappingURL=acorex-connectivity-mock.mjs.map
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@acorex/connectivity",
3
- "version": "21.0.0-next.37",
3
+ "version": "21.0.0-next.39",
4
4
  "peerDependencies": {
5
- "@acorex/modules": "21.0.0-next.37"
5
+ "@acorex/modules": "21.0.0-next.39"
6
6
  },
7
7
  "sideEffects": false,
8
8
  "module": "fesm2022/acorex-connectivity.mjs",