@acorex/connectivity 21.0.0-next.5 → 21.0.0-next.50

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 (110) hide show
  1. package/fesm2022/{acorex-connectivity-api-execute.command-SGNBLcOi.mjs → acorex-connectivity-api-execute.command-CiBl7z_H.mjs} +6 -6
  2. package/fesm2022/acorex-connectivity-api-execute.command-CiBl7z_H.mjs.map +1 -0
  3. package/fesm2022/acorex-connectivity-api.mjs +190 -188
  4. package/fesm2022/acorex-connectivity-api.mjs.map +1 -1
  5. package/fesm2022/acorex-connectivity-mock-acorex-connectivity-mock-CwWGrnVs.mjs +78646 -0
  6. package/fesm2022/acorex-connectivity-mock-acorex-connectivity-mock-CwWGrnVs.mjs.map +1 -0
  7. package/fesm2022/acorex-connectivity-mock-assign-to-manager.activity-B8bbsEQx.mjs +288 -0
  8. package/fesm2022/acorex-connectivity-mock-assign-to-manager.activity-B8bbsEQx.mjs.map +1 -0
  9. package/fesm2022/acorex-connectivity-mock-category-metadata-inheritance.query-CWRL1dTa.mjs +198 -0
  10. package/fesm2022/acorex-connectivity-mock-category-metadata-inheritance.query-CWRL1dTa.mjs.map +1 -0
  11. package/fesm2022/{acorex-connectivity-mock-category-with-items.query-Dsxj98tX.mjs → acorex-connectivity-mock-category-with-items.query-Cj6FWu7S.mjs} +4 -4
  12. package/fesm2022/acorex-connectivity-mock-category-with-items.query-Cj6FWu7S.mjs.map +1 -0
  13. package/fesm2022/acorex-connectivity-mock-chat-generate-image.command-CBlDsPWY.mjs +108 -0
  14. package/fesm2022/acorex-connectivity-mock-chat-generate-image.command-CBlDsPWY.mjs.map +1 -0
  15. package/fesm2022/acorex-connectivity-mock-chat-synthesize-speech.command-BCSsNdNv.mjs +130 -0
  16. package/fesm2022/acorex-connectivity-mock-chat-synthesize-speech.command-BCSsNdNv.mjs.map +1 -0
  17. package/fesm2022/acorex-connectivity-mock-chat-transcribe-speech.command-DM6JF63R.mjs +110 -0
  18. package/fesm2022/acorex-connectivity-mock-chat-transcribe-speech.command-DM6JF63R.mjs.map +1 -0
  19. package/fesm2022/acorex-connectivity-mock-check-permission.activity-vr3OHtjC.mjs +45 -0
  20. package/fesm2022/acorex-connectivity-mock-check-permission.activity-vr3OHtjC.mjs.map +1 -0
  21. package/fesm2022/acorex-connectivity-mock-complete-signature-process.activity-BO-IFsHT.mjs +56 -0
  22. package/fesm2022/acorex-connectivity-mock-complete-signature-process.activity-BO-IFsHT.mjs.map +1 -0
  23. package/fesm2022/acorex-connectivity-mock-contact-core.module-5TLCGWOR.mjs +968 -0
  24. package/fesm2022/acorex-connectivity-mock-contact-core.module-5TLCGWOR.mjs.map +1 -0
  25. package/fesm2022/acorex-connectivity-mock-content-management.module-GQdqKsPB.mjs +16 -0
  26. package/fesm2022/acorex-connectivity-mock-content-management.module-GQdqKsPB.mjs.map +1 -0
  27. package/fesm2022/{acorex-connectivity-mock-distribution-record.command-DRiDwlqN.mjs → acorex-connectivity-mock-distribution-record.activity-DuNluOzA.mjs} +18 -6
  28. package/fesm2022/acorex-connectivity-mock-distribution-record.activity-DuNluOzA.mjs.map +1 -0
  29. package/fesm2022/acorex-connectivity-mock-entity-create.activity-Ca19tIj4.mjs +60 -0
  30. package/fesm2022/acorex-connectivity-mock-entity-create.activity-Ca19tIj4.mjs.map +1 -0
  31. package/fesm2022/acorex-connectivity-mock-entity-delete.activity-ErEN1c24.mjs +60 -0
  32. package/fesm2022/acorex-connectivity-mock-entity-delete.activity-ErEN1c24.mjs.map +1 -0
  33. package/fesm2022/acorex-connectivity-mock-entity-read.activity-1fJW8gVe.mjs +67 -0
  34. package/fesm2022/acorex-connectivity-mock-entity-read.activity-1fJW8gVe.mjs.map +1 -0
  35. package/fesm2022/acorex-connectivity-mock-entity-update.activity-06HTKiQQ.mjs +68 -0
  36. package/fesm2022/acorex-connectivity-mock-entity-update.activity-06HTKiQQ.mjs.map +1 -0
  37. package/fesm2022/acorex-connectivity-mock-extract-document-text.command-nGfUTSf6.mjs +64 -0
  38. package/fesm2022/acorex-connectivity-mock-extract-document-text.command-nGfUTSf6.mjs.map +1 -0
  39. package/fesm2022/{acorex-connectivity-mock-get-application-versions-chart-data.query-C3eQfF0A.mjs → acorex-connectivity-mock-get-application-versions-chart-data.query-DwVuYuKx.mjs} +4 -4
  40. package/fesm2022/acorex-connectivity-mock-get-application-versions-chart-data.query-DwVuYuKx.mjs.map +1 -0
  41. package/fesm2022/{acorex-connectivity-mock-get-application-versions-timeline.query-CLzDz9ob.mjs → acorex-connectivity-mock-get-application-versions-timeline.query-sFKYynZA.mjs} +4 -4
  42. package/fesm2022/acorex-connectivity-mock-get-application-versions-timeline.query-sFKYynZA.mjs.map +1 -0
  43. package/fesm2022/acorex-connectivity-mock-get-current-session-user.activity-CsmxwXsM.mjs +39 -0
  44. package/fesm2022/acorex-connectivity-mock-get-current-session-user.activity-CsmxwXsM.mjs.map +1 -0
  45. package/fesm2022/acorex-connectivity-mock-get-current-user-manager.activity-C1mj2bgB.mjs +69 -0
  46. package/fesm2022/acorex-connectivity-mock-get-current-user-manager.activity-C1mj2bgB.mjs.map +1 -0
  47. package/fesm2022/acorex-connectivity-mock-get-employee-list.query-DifHwuqH.mjs +213 -0
  48. package/fesm2022/acorex-connectivity-mock-get-employee-list.query-DifHwuqH.mjs.map +1 -0
  49. package/fesm2022/acorex-connectivity-mock-get-location-list.query-bMjkZnzq.mjs +209 -0
  50. package/fesm2022/acorex-connectivity-mock-get-location-list.query-bMjkZnzq.mjs.map +1 -0
  51. package/fesm2022/acorex-connectivity-mock-get-product-chart-data.query-D7DBzLT-.mjs +186 -0
  52. package/fesm2022/acorex-connectivity-mock-get-product-chart-data.query-D7DBzLT-.mjs.map +1 -0
  53. package/fesm2022/{acorex-connectivity-mock-get-product-list.query-ChtYlSTt.mjs → acorex-connectivity-mock-get-product-list.query-f-mTj4ah.mjs} +107 -11
  54. package/fesm2022/acorex-connectivity-mock-get-product-list.query-f-mTj4ah.mjs.map +1 -0
  55. package/fesm2022/acorex-connectivity-mock-get-product-pdf-data.query-Co1V52c4.mjs +192 -0
  56. package/fesm2022/acorex-connectivity-mock-get-product-pdf-data.query-Co1V52c4.mjs.map +1 -0
  57. package/fesm2022/{acorex-connectivity-mock-get-subscriptions-chart-data.query-HxX_bCT8.mjs → acorex-connectivity-mock-get-subscriptions-chart-data.query-BQT5a_hn.mjs} +5 -5
  58. package/fesm2022/acorex-connectivity-mock-get-subscriptions-chart-data.query-BQT5a_hn.mjs.map +1 -0
  59. package/fesm2022/{acorex-connectivity-mock-get-subscriptions-timeline.query-dp08JqLP.mjs → acorex-connectivity-mock-get-subscriptions-timeline.query-D4qfDfeV.mjs} +91 -13
  60. package/fesm2022/acorex-connectivity-mock-get-subscriptions-timeline.query-D4qfDfeV.mjs.map +1 -0
  61. package/fesm2022/{acorex-connectivity-mock-get-tenant-application-access.query-IATTXcAV.mjs → acorex-connectivity-mock-get-tenant-application-access.query-n1_Azada.mjs} +91 -13
  62. package/fesm2022/acorex-connectivity-mock-get-tenant-application-access.query-n1_Azada.mjs.map +1 -0
  63. package/fesm2022/{acorex-connectivity-mock-get-tenant-registration-chart-data.query-DlXi4Rcg.mjs → acorex-connectivity-mock-get-tenant-registration-chart-data.query-Cg4ykZU2.mjs} +5 -5
  64. package/fesm2022/acorex-connectivity-mock-get-tenant-registration-chart-data.query-Cg4ykZU2.mjs.map +1 -0
  65. package/fesm2022/{acorex-connectivity-mock-get-tenant-registration-timeline.query-hskw8Ioa.mjs → acorex-connectivity-mock-get-tenant-registration-timeline.query-0sCBtdbp.mjs} +91 -13
  66. package/fesm2022/acorex-connectivity-mock-get-tenant-registration-timeline.query-0sCBtdbp.mjs.map +1 -0
  67. package/fesm2022/{acorex-connectivity-mock-get-tenant-user-distribution.query-Bs5U5tze.mjs → acorex-connectivity-mock-get-tenant-user-distribution.query-rD811gtM.mjs} +91 -13
  68. package/fesm2022/acorex-connectivity-mock-get-tenant-user-distribution.query-rD811gtM.mjs.map +1 -0
  69. package/fesm2022/acorex-connectivity-mock-if.activity-DvzuhItL.mjs +35 -0
  70. package/fesm2022/acorex-connectivity-mock-if.activity-DvzuhItL.mjs.map +1 -0
  71. package/fesm2022/acorex-connectivity-mock-notification-management-email-send.command-DAQfIWoD.mjs +73 -0
  72. package/fesm2022/acorex-connectivity-mock-notification-management-email-send.command-DAQfIWoD.mjs.map +1 -0
  73. package/fesm2022/acorex-connectivity-mock-notify-signers.activity-Dg0sKGip.mjs +49 -0
  74. package/fesm2022/acorex-connectivity-mock-notify-signers.activity-Dg0sKGip.mjs.map +1 -0
  75. package/fesm2022/acorex-connectivity-mock-request-signature.activity-CoRT_H2u.mjs +60 -0
  76. package/fesm2022/acorex-connectivity-mock-request-signature.activity-CoRT_H2u.mjs.map +1 -0
  77. package/fesm2022/{acorex-connectivity-mock-sample.command-CkH5bmEs.mjs → acorex-connectivity-mock-sample.command-CJmDL4pL.mjs} +4 -4
  78. package/fesm2022/acorex-connectivity-mock-sample.command-CJmDL4pL.mjs.map +1 -0
  79. package/fesm2022/acorex-connectivity-mock-structured-text-completion.command-l31pjl9-.mjs +38 -0
  80. package/fesm2022/acorex-connectivity-mock-structured-text-completion.command-l31pjl9-.mjs.map +1 -0
  81. package/fesm2022/acorex-connectivity-mock-user-roles-for-list-column.query-2PnIbRxO.mjs +30 -0
  82. package/fesm2022/acorex-connectivity-mock-user-roles-for-list-column.query-2PnIbRxO.mjs.map +1 -0
  83. package/fesm2022/acorex-connectivity-mock-validate-all-signatures.activity-JuHjNFFS.mjs +61 -0
  84. package/fesm2022/acorex-connectivity-mock-validate-all-signatures.activity-JuHjNFFS.mjs.map +1 -0
  85. package/fesm2022/acorex-connectivity-mock.mjs +2 -49588
  86. package/fesm2022/acorex-connectivity-mock.mjs.map +1 -1
  87. package/fesm2022/acorex-connectivity-utils.mjs +7 -7
  88. package/fesm2022/acorex-connectivity-utils.mjs.map +1 -1
  89. package/fesm2022/acorex-connectivity.mjs.map +1 -1
  90. package/package.json +8 -7
  91. package/{api/index.d.ts → types/acorex-connectivity-api.d.ts} +13 -60
  92. package/types/acorex-connectivity-mock.d.ts +4127 -0
  93. package/fesm2022/acorex-connectivity-api-execute.command-SGNBLcOi.mjs.map +0 -1
  94. package/fesm2022/acorex-connectivity-mock-category-with-items.query-Dsxj98tX.mjs.map +0 -1
  95. package/fesm2022/acorex-connectivity-mock-distribution-record.command-DRiDwlqN.mjs.map +0 -1
  96. package/fesm2022/acorex-connectivity-mock-get-application-versions-chart-data.query-C3eQfF0A.mjs.map +0 -1
  97. package/fesm2022/acorex-connectivity-mock-get-application-versions-timeline.query-CLzDz9ob.mjs.map +0 -1
  98. package/fesm2022/acorex-connectivity-mock-get-product-chart-data.query-DDVVFeYN.mjs +0 -97
  99. package/fesm2022/acorex-connectivity-mock-get-product-chart-data.query-DDVVFeYN.mjs.map +0 -1
  100. package/fesm2022/acorex-connectivity-mock-get-product-list.query-ChtYlSTt.mjs.map +0 -1
  101. package/fesm2022/acorex-connectivity-mock-get-subscriptions-chart-data.query-HxX_bCT8.mjs.map +0 -1
  102. package/fesm2022/acorex-connectivity-mock-get-subscriptions-timeline.query-dp08JqLP.mjs.map +0 -1
  103. package/fesm2022/acorex-connectivity-mock-get-tenant-application-access.query-IATTXcAV.mjs.map +0 -1
  104. package/fesm2022/acorex-connectivity-mock-get-tenant-registration-chart-data.query-DlXi4Rcg.mjs.map +0 -1
  105. package/fesm2022/acorex-connectivity-mock-get-tenant-registration-timeline.query-hskw8Ioa.mjs.map +0 -1
  106. package/fesm2022/acorex-connectivity-mock-get-tenant-user-distribution.query-Bs5U5tze.mjs.map +0 -1
  107. package/fesm2022/acorex-connectivity-mock-sample.command-CkH5bmEs.mjs.map +0 -1
  108. package/mock/index.d.ts +0 -2557
  109. /package/{utils/index.d.ts → types/acorex-connectivity-utils.d.ts} +0 -0
  110. /package/{index.d.ts → types/acorex-connectivity.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-connectivity-mock-get-tenant-registration-timeline.query-0sCBtdbp.mjs","sources":["../../../../libs/connectivity/mock/src/lib/tenant-management/reports/get-tenant-registration-timeline.query.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPQuery } from '@acorex/platform/runtime';\nimport { AXPEntityService } from '@acorex/platform/layout/entity';\nimport { AXMTenantManagementTenantEntityModel } from '@acorex/modules/tenant-management';\nimport { AXMTenantManagementTenantUserEntityModel } from '@acorex/modules/tenant-management';\nimport { AXMSubscriptionManagementSubscriptionEntityModel } from '@acorex/modules/subscription-management';\nimport { AXMSubscriptionManagementSubscriptionPlanItemEntityModel } from '@acorex/modules/subscription-management';\nimport { AXMApplicationManagementApplicationEntityModel } from '@acorex/modules/application-management';\nimport { RootConfig as TenantRootConfig } from '@acorex/modules/tenant-management';\nimport { RootConfig as SubscriptionRootConfig } from '@acorex/modules/subscription-management';\nimport { RootConfig as ApplicationRootConfig } from '@acorex/modules/application-management';\n\n//#region ---- Query Input/Output Types ----\n\nexport interface GetTenantRegistrationTimelineQueryInput {\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 TenantRegistrationTimelineResult {\n tenantId: string;\n tenantName: string;\n registrationDate: Date;\n registrationDateStr: string;\n status: string;\n country?: string;\n userCount: number;\n applicationCount: number;\n subscriptionCount: number;\n month: string;\n monthNumber: number;\n quarter: string;\n year: number;\n}\n\nexport interface GetTenantRegistrationTimelineQueryResult {\n items: TenantRegistrationTimelineResult[];\n total: number;\n}\n\n//#endregion\n\n@Injectable({\n providedIn: 'root',\n})\nexport class GetTenantRegistrationTimelineQuery\n implements AXPQuery<GetTenantRegistrationTimelineQueryInput, GetTenantRegistrationTimelineQueryResult>\n{\n private readonly entityService = inject(AXPEntityService);\n private tenantService = this.entityService\n .withEntity(`${TenantRootConfig.module.name}.${TenantRootConfig.entities.tenant.name}`)\n .data<string, AXMTenantManagementTenantEntityModel>();\n private tenantUserService = this.entityService\n .withEntity(`${TenantRootConfig.module.name}.${TenantRootConfig.entities.tenantUser.name}`)\n .data<string, AXMTenantManagementTenantUserEntityModel>();\n private subscriptionService = this.entityService\n .withEntity(`${SubscriptionRootConfig.module.name}.${SubscriptionRootConfig.entities.subscription.name}`)\n .data<string, AXMSubscriptionManagementSubscriptionEntityModel>();\n private planItemService = this.entityService\n .withEntity(`${SubscriptionRootConfig.module.name}.${SubscriptionRootConfig.entities.subscriptionPlanItem.name}`)\n .data<string, AXMSubscriptionManagementSubscriptionPlanItemEntityModel>();\n private applicationService = this.entityService\n .withEntity(`${ApplicationRootConfig.module.name}.${ApplicationRootConfig.entities.application.name}`)\n .data<string, AXMApplicationManagementApplicationEntityModel>();\n\n async fetch(input: GetTenantRegistrationTimelineQueryInput | any): Promise<GetTenantRegistrationTimelineQueryResult> {\n // Extract filters from AXPFilterClause format\n const extractedFilters = this.extractTenantFilters(input.filters);\n const filterLogic = (input.filters as any)?.logic || input.logic || 'and';\n\n // Separate custom filters from entity filters\n const entityFilters: GetTenantRegistrationTimelineQueryInput['filters'] = [];\n let dateRangeFilter: any;\n\n if (extractedFilters && extractedFilters.length > 0) {\n for (const filter of extractedFilters) {\n if (filter.field === 'dateRange') {\n dateRangeFilter = filter.value;\n } else {\n entityFilters.push(filter);\n }\n }\n }\n\n // Get all tenants\n const tenantsResult = await this.tenantService.query({\n skip: 0,\n take: 10000,\n filter:\n entityFilters.length > 0\n ? ({\n logic: filterLogic,\n filters: entityFilters,\n } as any)\n : undefined,\n });\n\n let tenants = tenantsResult.items.filter((t) => t.registrationDate);\n\n // Apply date range filter if provided\n if (dateRangeFilter) {\n tenants = this.applyDateRangeFilter(tenants, dateRangeFilter);\n }\n\n // Get all tenant users for counting\n const tenantUsersResult = await this.tenantUserService.query({\n skip: 0,\n take: 10000,\n });\n const tenantUsers = tenantUsersResult.items;\n\n // Get all subscriptions for counting\n const subscriptionsResult = await this.subscriptionService.query({\n skip: 0,\n take: 10000,\n });\n const subscriptions = subscriptionsResult.items.filter((s) => s.subscriberType === 'Tenant');\n\n // Get all plan items and applications for application counting\n const planItemsResult = await this.planItemService.query({\n skip: 0,\n take: 10000,\n });\n const planItems = planItemsResult.items;\n\n const applicationsResult = await this.applicationService.query({\n skip: 0,\n take: 10000,\n });\n const applications = applicationsResult.items;\n\n // Get application counts for tenants\n const applicationCounts = await this.getApplicationCountsForTenants(\n tenants.map((t) => t.id),\n subscriptions,\n planItems,\n applications\n );\n\n // Build results\n const results: TenantRegistrationTimelineResult[] = [];\n\n for (const tenant of tenants) {\n if (!tenant.registrationDate) continue;\n\n const registrationDate = new Date(tenant.registrationDate);\n\n // Extract time period info\n const year = registrationDate.getFullYear();\n const month = registrationDate.getMonth() + 1;\n const monthName = registrationDate.toLocaleString('en-US', { month: 'long' });\n const quarter = Math.ceil(month / 3);\n const quarterName = `Q${quarter}`;\n\n // Count users for this tenant\n const userCount = tenantUsers.filter((tu) => tu.tenantId === tenant.id).length;\n\n // Count subscriptions for this tenant\n const subscriptionCount = subscriptions.filter((s) => s.subscriberId === tenant.id).length;\n\n // Get application count\n const applicationCount = applicationCounts.get(tenant.id) || 0;\n\n results.push({\n tenantId: tenant.id,\n tenantName: tenant.title,\n registrationDate: registrationDate,\n registrationDateStr: registrationDate.toISOString(),\n status: tenant.statusId || 'Unknown',\n country: tenant.country?.title,\n userCount: userCount,\n applicationCount: applicationCount,\n subscriptionCount: subscriptionCount,\n month: monthName,\n monthNumber: month,\n quarter: quarterName,\n year: year,\n });\n }\n\n // Apply sorting if provided\n if (input.sort && input.sort.length > 0) {\n results.sort((a, b) => {\n for (const sortField of input.sort!) {\n const field = sortField.field as keyof TenantRegistrationTimelineResult;\n const aValue = a[field];\n const bValue = b[field];\n const dir = sortField.dir === 'asc' ? 1 : -1;\n\n if (aValue === undefined && bValue === undefined) continue;\n if (aValue === undefined) return 1 * dir;\n if (bValue === undefined) return -1 * dir;\n\n // Handle date comparison\n if (field === 'registrationDate') {\n const aDate = a.registrationDate.getTime();\n const bDate = b.registrationDate.getTime();\n if (aDate < bDate) return -1 * dir;\n if (aDate > bDate) return 1 * dir;\n continue;\n }\n\n if (aValue < bValue) return -1 * dir;\n if (aValue > bValue) return 1 * dir;\n }\n return 0;\n });\n } else {\n // Default sort by registration date descending (newest first)\n results.sort((a, b) => {\n return b.registrationDate.getTime() - a.registrationDate.getTime();\n });\n }\n\n // Apply pagination\n const skip = input.skip || 0;\n const take = input.take || 10;\n const total = results.length;\n const items = results.slice(skip, skip + take);\n\n return {\n items,\n total,\n };\n }\n\n //#region ---- Helper Methods ----\n\n /**\n * Get application counts for tenants\n */\n private async getApplicationCountsForTenants(\n tenantIds: string[],\n subscriptions: AXMSubscriptionManagementSubscriptionEntityModel[],\n planItems: AXMSubscriptionManagementSubscriptionPlanItemEntityModel[],\n applications: AXMApplicationManagementApplicationEntityModel[]\n ): Promise<Map<string, number>> {\n const counts = new Map<string, number>();\n\n for (const tenantId of tenantIds) {\n const tenantSubscriptions = subscriptions.filter((s) => s.subscriberId === tenantId);\n\n // Get unique applications through subscriptions → plans → plan items → editions → applications\n const applicationSet = new Set<string>();\n\n for (const subscription of tenantSubscriptions) {\n if (!subscription.planId) continue;\n\n // Get plan items for this plan\n const planPlanItems = planItems.filter((pi) => pi.planId === subscription.planId);\n\n for (const planItem of planPlanItems) {\n if (!planItem.editionId) continue;\n\n // Find applications that have this edition\n for (const application of applications) {\n if (application.editionIds && application.editionIds.includes(planItem.editionId)) {\n applicationSet.add(application.id);\n }\n }\n }\n }\n\n counts.set(tenantId, applicationSet.size);\n }\n\n return counts;\n }\n\n //#endregion\n\n //#region ---- Filter Extraction ----\n\n /**\n * Extract tenant-specific filters from AXPFilterClause format\n * Maps report parameter paths to tenant entity field names\n */\n private extractTenantFilters(parameters: any): GetTenantRegistrationTimelineQueryInput['filters'] {\n const filters: GetTenantRegistrationTimelineQueryInput['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 tenant-specific field mappings\n if (field === 'tenantId') {\n // Tenant ID filter - can be array of IDs or single ID\n if (Array.isArray(value) && value.length > 0) {\n filters.push({\n field: 'id',\n operator: { type: 'in' },\n value: value,\n });\n } else if (value) {\n filters.push({\n field: 'id',\n operator: { type: 'equal' },\n value: value,\n });\n }\n } else if (field === 'statusId') {\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 === 'dateRange') {\n // Date range filter - custom logic handled in query\n filters.push({\n field: 'dateRange',\n operator: { type: 'equal' },\n value: value,\n });\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 date range filter to tenants\n */\n private applyDateRangeFilter(\n tenants: AXMTenantManagementTenantEntityModel[],\n dateRange: any\n ): AXMTenantManagementTenantEntityModel[] {\n if (!dateRange || !dateRange.start || !dateRange.end) {\n return tenants;\n }\n\n const startDate = new Date(dateRange.start);\n const endDate = new Date(dateRange.end);\n endDate.setHours(23, 59, 59, 999);\n\n return tenants.filter((tenant) => {\n if (!tenant.registrationDate) return false;\n const regDate = new Date(tenant.registrationDate);\n return regDate >= startDate && regDate <= endDate;\n });\n }\n\n //#endregion\n}\n\n"],"names":["TenantRootConfig","SubscriptionRootConfig","ApplicationRootConfig"],"mappings":";;;;;;;AA+CA;MAKa,kCAAkC,CAAA;AAH/C,IAAA,WAAA,GAAA;AAMmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;QACjD,IAAA,CAAA,aAAa,GAAG,IAA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ACnD,QAAA,CAAC,CAAC;IACJ;8GA9TW,kCAAkC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAlC,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,kCAAkC,cAFjC,MAAM,EAAA,CAAA,CAAA;;2FAEP,kCAAkC,EAAA,UAAA,EAAA,CAAA;kBAH9C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
@@ -16,25 +16,37 @@ class GetTenantUserDistributionQuery {
16
16
  .data();
17
17
  }
18
18
  async fetch(input) {
19
+ // Extract filters from AXPFilterClause format
20
+ const extractedFilters = this.extractTenantFilters(input.filters);
21
+ const filterLogic = input.filters?.logic || input.logic || 'and';
22
+ // Separate custom filters from entity filters
23
+ const entityFilters = [];
24
+ let dateRangeFilter;
25
+ if (extractedFilters && extractedFilters.length > 0) {
26
+ for (const filter of extractedFilters) {
27
+ if (filter.field === 'dateRange') {
28
+ dateRangeFilter = filter.value;
29
+ }
30
+ else {
31
+ entityFilters.push(filter);
32
+ }
33
+ }
34
+ }
19
35
  // Get all tenants
20
36
  const tenantsResult = await this.tenantService.query({
21
37
  skip: 0,
22
38
  take: 10000,
23
- filter: input.filters && input.filters.length > 0
39
+ filter: entityFilters.length > 0
24
40
  ? {
25
- logic: input.logic || 'and',
26
- filters: input.filters.filter((f) => f.field !== 'dateRange'),
41
+ logic: filterLogic,
42
+ filters: entityFilters,
27
43
  }
28
44
  : undefined,
29
45
  });
30
46
  let tenants = tenantsResult.items;
31
47
  // Apply date range filter if provided
32
- if (input.filters) {
33
- for (const filter of input.filters) {
34
- if (filter.field === 'dateRange' && filter.value) {
35
- tenants = this.applyDateRangeFilter(tenants, filter.value);
36
- }
37
- }
48
+ if (dateRangeFilter) {
49
+ tenants = this.applyDateRangeFilter(tenants, dateRangeFilter);
38
50
  }
39
51
  // Get all tenant users
40
52
  const tenantUsersResult = await this.tenantUserService.query({
@@ -102,6 +114,72 @@ class GetTenantUserDistributionQuery {
102
114
  total,
103
115
  };
104
116
  }
117
+ //#region ---- Filter Extraction ----
118
+ /**
119
+ * Extract tenant-specific filters from AXPFilterClause format
120
+ * Maps report parameter paths to tenant entity field names
121
+ */
122
+ extractTenantFilters(parameters) {
123
+ const filters = [];
124
+ const paramsAny = parameters;
125
+ if (!paramsAny?.filters || !Array.isArray(paramsAny.filters)) {
126
+ return filters;
127
+ }
128
+ for (const filter of paramsAny.filters) {
129
+ if (!filter?.field || filter?.value === undefined || filter?.value === null) {
130
+ continue;
131
+ }
132
+ const field = filter.field;
133
+ const value = filter.value;
134
+ const operator = filter.operator || { type: 'equal' };
135
+ // Handle tenant-specific field mappings
136
+ if (field === 'tenantId') {
137
+ // Tenant ID filter - can be array of IDs or single ID
138
+ if (Array.isArray(value) && value.length > 0) {
139
+ filters.push({
140
+ field: 'id',
141
+ operator: { type: 'in' },
142
+ value: value,
143
+ });
144
+ }
145
+ else if (value) {
146
+ filters.push({
147
+ field: 'id',
148
+ operator: { type: 'equal' },
149
+ value: value,
150
+ });
151
+ }
152
+ }
153
+ else if (field === 'statusId') {
154
+ // Status filter - skip 'all' value
155
+ if (value && value !== 'all') {
156
+ filters.push({
157
+ field: 'statusId',
158
+ operator: { type: 'equal' },
159
+ value: value,
160
+ });
161
+ }
162
+ }
163
+ else if (field === 'dateRange') {
164
+ // Date range filter - custom logic handled in query
165
+ filters.push({
166
+ field: 'dateRange',
167
+ operator: { type: 'equal' },
168
+ value: value,
169
+ });
170
+ }
171
+ else {
172
+ // Direct field mapping
173
+ filters.push({
174
+ field: field,
175
+ operator: operator,
176
+ value: value,
177
+ });
178
+ }
179
+ }
180
+ return filters;
181
+ }
182
+ //#endregion
105
183
  //#region ---- Custom Filter Handlers ----
106
184
  /**
107
185
  * Apply date range filter to tenants
@@ -120,10 +198,10 @@ class GetTenantUserDistributionQuery {
120
198
  return regDate >= startDate && regDate <= endDate;
121
199
  });
122
200
  }
123
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: GetTenantUserDistributionQuery, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
124
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: GetTenantUserDistributionQuery, providedIn: 'root' }); }
201
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: GetTenantUserDistributionQuery, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
202
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: GetTenantUserDistributionQuery, providedIn: 'root' }); }
125
203
  }
126
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: GetTenantUserDistributionQuery, decorators: [{
204
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: GetTenantUserDistributionQuery, decorators: [{
127
205
  type: Injectable,
128
206
  args: [{
129
207
  providedIn: 'root',
@@ -131,4 +209,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
131
209
  }] });
132
210
 
133
211
  export { GetTenantUserDistributionQuery };
134
- //# sourceMappingURL=acorex-connectivity-mock-get-tenant-user-distribution.query-Bs5U5tze.mjs.map
212
+ //# sourceMappingURL=acorex-connectivity-mock-get-tenant-user-distribution.query-rD811gtM.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-connectivity-mock-get-tenant-user-distribution.query-rD811gtM.mjs","sources":["../../../../libs/connectivity/mock/src/lib/tenant-management/reports/get-tenant-user-distribution.query.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPQuery } from '@acorex/platform/runtime';\nimport { AXPEntityService } from '@acorex/platform/layout/entity';\nimport { AXMTenantManagementTenantEntityModel } from '@acorex/modules/tenant-management';\nimport { AXMTenantManagementTenantUserEntityModel } from '@acorex/modules/tenant-management';\nimport { AXPSystemStatusType } from '@acorex/platform/common';\nimport { RootConfig as TenantRootConfig } from '@acorex/modules/tenant-management';\n\n//#region ---- Query Input/Output Types ----\n\nexport interface GetTenantUserDistributionQueryInput {\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 TenantUserDistributionResult {\n tenantId: string;\n tenantName: string;\n tenantStatus: string;\n totalUsersCount: number;\n activeUsersCount: number;\n inactiveUsersCount: number;\n maxUsers?: number;\n utilizationPercent: number;\n registrationDate?: Date;\n registrationDateStr?: string;\n}\n\nexport interface GetTenantUserDistributionQueryResult {\n items: TenantUserDistributionResult[];\n total: number;\n}\n\n//#endregion\n\n@Injectable({\n providedIn: 'root',\n})\nexport class GetTenantUserDistributionQuery\n implements AXPQuery<GetTenantUserDistributionQueryInput, GetTenantUserDistributionQueryResult>\n{\n private readonly entityService = inject(AXPEntityService);\n private tenantService = this.entityService\n .withEntity(`${TenantRootConfig.module.name}.${TenantRootConfig.entities.tenant.name}`)\n .data<string, AXMTenantManagementTenantEntityModel>();\n private tenantUserService = this.entityService\n .withEntity(`${TenantRootConfig.module.name}.${TenantRootConfig.entities.tenantUser.name}`)\n .data<string, AXMTenantManagementTenantUserEntityModel>();\n\n async fetch(input: GetTenantUserDistributionQueryInput | any): Promise<GetTenantUserDistributionQueryResult> {\n // Extract filters from AXPFilterClause format\n const extractedFilters = this.extractTenantFilters(input.filters);\n const filterLogic = (input.filters as any)?.logic || input.logic || 'and';\n\n // Separate custom filters from entity filters\n const entityFilters: GetTenantUserDistributionQueryInput['filters'] = [];\n let dateRangeFilter: any;\n\n if (extractedFilters && extractedFilters.length > 0) {\n for (const filter of extractedFilters) {\n if (filter.field === 'dateRange') {\n dateRangeFilter = filter.value;\n } else {\n entityFilters.push(filter);\n }\n }\n }\n\n // Get all tenants\n const tenantsResult = await this.tenantService.query({\n skip: 0,\n take: 10000,\n filter:\n entityFilters.length > 0\n ? ({\n logic: filterLogic,\n filters: entityFilters,\n } as any)\n : undefined,\n });\n\n let tenants = tenantsResult.items;\n\n // Apply date range filter if provided\n if (dateRangeFilter) {\n tenants = this.applyDateRangeFilter(tenants, dateRangeFilter);\n }\n\n // Get all tenant users\n const tenantUsersResult = await this.tenantUserService.query({\n skip: 0,\n take: 10000,\n });\n const tenantUsers = tenantUsersResult.items;\n\n // Build results for each tenant\n const results: TenantUserDistributionResult[] = [];\n\n for (const tenant of tenants) {\n // Get tenant's users\n const tenantUsersList = tenantUsers.filter((tu) => tu.tenantId === tenant.id);\n\n // Count active and inactive users\n const activeUsers = tenantUsersList.filter(\n (tu) => tu.statusId === AXPSystemStatusType.Active\n );\n const inactiveUsers = tenantUsersList.filter(\n (tu) => tu.statusId !== AXPSystemStatusType.Active\n );\n\n // Calculate utilization percentage\n const maxUsers = tenant.maxUsers;\n const utilizationPercent =\n maxUsers && maxUsers > 0 ? Math.round((tenantUsersList.length / maxUsers) * 100) : 0;\n\n results.push({\n tenantId: tenant.id,\n tenantName: tenant.title,\n tenantStatus: tenant.statusId || 'Unknown',\n totalUsersCount: tenantUsersList.length,\n activeUsersCount: activeUsers.length,\n inactiveUsersCount: inactiveUsers.length,\n maxUsers: maxUsers,\n utilizationPercent: utilizationPercent,\n registrationDate: tenant.registrationDate,\n registrationDateStr: tenant.registrationDate?.toISOString(),\n });\n }\n\n // Apply sorting if provided\n if (input.sort && input.sort.length > 0) {\n results.sort((a, b) => {\n for (const sortField of input.sort!) {\n const field = sortField.field as keyof TenantUserDistributionResult;\n const aValue = a[field];\n const bValue = b[field];\n const dir = sortField.dir === 'asc' ? 1 : -1;\n\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 } else {\n // Default sort by tenant name\n results.sort((a, b) => a.tenantName.localeCompare(b.tenantName));\n }\n\n // Apply pagination\n const skip = input.skip || 0;\n const take = input.take || 10;\n const total = results.length;\n const items = results.slice(skip, skip + take);\n\n return {\n items,\n total,\n };\n }\n\n //#region ---- Filter Extraction ----\n\n /**\n * Extract tenant-specific filters from AXPFilterClause format\n * Maps report parameter paths to tenant entity field names\n */\n private extractTenantFilters(parameters: any): GetTenantUserDistributionQueryInput['filters'] {\n const filters: GetTenantUserDistributionQueryInput['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 tenant-specific field mappings\n if (field === 'tenantId') {\n // Tenant ID filter - can be array of IDs or single ID\n if (Array.isArray(value) && value.length > 0) {\n filters.push({\n field: 'id',\n operator: { type: 'in' },\n value: value,\n });\n } else if (value) {\n filters.push({\n field: 'id',\n operator: { type: 'equal' },\n value: value,\n });\n }\n } else if (field === 'statusId') {\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 === 'dateRange') {\n // Date range filter - custom logic handled in query\n filters.push({\n field: 'dateRange',\n operator: { type: 'equal' },\n value: value,\n });\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 date range filter to tenants\n */\n private applyDateRangeFilter(\n tenants: AXMTenantManagementTenantEntityModel[],\n dateRange: any\n ): AXMTenantManagementTenantEntityModel[] {\n if (!dateRange || !dateRange.start || !dateRange.end) {\n return tenants;\n }\n\n const startDate = new Date(dateRange.start);\n const endDate = new Date(dateRange.end);\n endDate.setHours(23, 59, 59, 999);\n\n return tenants.filter((tenant) => {\n if (!tenant.registrationDate) return false;\n const regDate = new Date(tenant.registrationDate);\n return regDate >= startDate && regDate <= endDate;\n });\n }\n\n //#endregion\n}\n\n"],"names":["TenantRootConfig"],"mappings":";;;;;;AAwCA;MAKa,8BAA8B,CAAA;AAH3C,IAAA,WAAA,GAAA;AAMmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;QACjD,IAAA,CAAA,aAAa,GAAG,IAAI,CAAC;AAC1B,aAAA,UAAU,CAAC,CAAA,EAAGA,UAAgB,CAAC,MAAM,CAAC,IAAI,CAAA,CAAA,EAAIA,UAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE;AACrF,aAAA,IAAI,EAAgD;QAC/C,IAAA,CAAA,iBAAiB,GAAG,IAAI,CAAC;AAC9B,aAAA,UAAU,CAAC,CAAA,EAAGA,UAAgB,CAAC,MAAM,CAAC,IAAI,CAAA,CAAA,EAAIA,UAAgB,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE;AACzF,aAAA,IAAI,EAAoD;AAoN5D,IAAA;IAlNC,MAAM,KAAK,CAAC,KAAgD,EAAA;;QAE1D,MAAM,gBAAgB,GAAG,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,OAAO,CAAC;AACjE,QAAA,MAAM,WAAW,GAAI,KAAK,CAAC,OAAe,EAAE,KAAK,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK;;QAGzE,MAAM,aAAa,GAAmD,EAAE;AACxE,QAAA,IAAI,eAAoB;QAExB,IAAI,gBAAgB,IAAI,gBAAgB,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A,IAAA,EAAA,8BAA8B,cAF7B,MAAM,EAAA,CAAA,CAAA;;2FAEP,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAH1C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
@@ -0,0 +1,35 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable } from '@angular/core';
3
+
4
+ //#endregion
5
+ /**
6
+ * If Activity (Backend - Mock)
7
+ *
8
+ * Evaluates a condition and continues via Then or Else outcome.
9
+ * Activity type: workflow-activity:if
10
+ * Outcomes: Then | Else
11
+ */
12
+ class IfActivity {
13
+ async execute(input) {
14
+ const condition = input?.condition ?? false;
15
+ const outcome = condition ? 'Then' : 'Else';
16
+ return {
17
+ success: true,
18
+ data: { condition: !!condition },
19
+ metadata: {
20
+ outcome,
21
+ },
22
+ };
23
+ }
24
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IfActivity, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
25
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IfActivity, providedIn: 'root' }); }
26
+ }
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IfActivity, decorators: [{
28
+ type: Injectable,
29
+ args: [{
30
+ providedIn: 'root',
31
+ }]
32
+ }] });
33
+
34
+ export { IfActivity };
35
+ //# sourceMappingURL=acorex-connectivity-mock-if.activity-DvzuhItL.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-connectivity-mock-if.activity-DvzuhItL.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/if.activity.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\n\n//#region ---- Types ----\n\nexport interface IfActivityInput {\n condition?: boolean;\n}\n\nexport interface IfActivityOutput {\n condition: boolean;\n}\n\n//#endregion\n\n/**\n * If Activity (Backend - Mock)\n *\n * Evaluates a condition and continues via Then or Else outcome.\n * Activity type: workflow-activity:if\n * Outcomes: Then | Else\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class IfActivity implements AXPCommand<IfActivityInput, IfActivityOutput> {\n async execute(\n input: IfActivityInput,\n ): Promise<AXPExecuteCommandResult<IfActivityOutput>> {\n const condition = input?.condition ?? false;\n const outcome = condition ? 'Then' : 'Else';\n\n return {\n success: true,\n data: { condition: !!condition },\n metadata: {\n outcome,\n },\n };\n }\n}\n"],"names":[],"mappings":";;;AAcA;AAEA;;;;;;AAMG;MAIU,UAAU,CAAA;IACrB,MAAM,OAAO,CACX,KAAsB,EAAA;AAEtB,QAAA,MAAM,SAAS,GAAG,KAAK,EAAE,SAAS,IAAI,KAAK;QAC3C,MAAM,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM;QAE3C,OAAO;AACL,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE;AAChC,YAAA,QAAQ,EAAE;gBACR,OAAO;AACR,aAAA;SACF;IACH;8GAdW,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAV,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,UAAU,cAFT,MAAM,EAAA,CAAA,CAAA;;2FAEP,UAAU,EAAA,UAAA,EAAA,CAAA;kBAHtB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
@@ -0,0 +1,73 @@
1
+ import { AXPDataGenerator } from '@acorex/platform/core';
2
+ import { AXToastService } from '@acorex/components/toast';
3
+ import * as i0 from '@angular/core';
4
+ import { inject, Injectable } from '@angular/core';
5
+
6
+ //#region ---- Imports ----
7
+ //#endregion
8
+ //#region ---- Input parsing ----
9
+ function parseSendInput(raw) {
10
+ const obj = raw != null && typeof raw === 'object' && !Array.isArray(raw) ? raw : null;
11
+ if (!obj) {
12
+ return { ok: false, error: 'Invalid arguments: expected an object.' };
13
+ }
14
+ const to = typeof obj['to'] === 'string' ? obj['to'].trim() : '';
15
+ const subject = typeof obj['subject'] === 'string' ? obj['subject'].trim() : '';
16
+ const body = typeof obj['body'] === 'string' ? obj['body'].trim() : '';
17
+ if (!to) {
18
+ return { ok: false, error: 'Invalid arguments: "to" is required.' };
19
+ }
20
+ if (!subject) {
21
+ return { ok: false, error: 'Invalid arguments: "subject" is required.' };
22
+ }
23
+ if (!body) {
24
+ return { ok: false, error: 'Invalid arguments: "body" is required.' };
25
+ }
26
+ const cc = typeof obj['cc'] === 'string' ? obj['cc'].trim() : '';
27
+ const bcc = typeof obj['bcc'] === 'string' ? obj['bcc'].trim() : '';
28
+ const tid = typeof obj['textTemplateId'] === 'string' ? obj['textTemplateId'].trim() : '';
29
+ return {
30
+ ok: true,
31
+ value: {
32
+ to,
33
+ subject,
34
+ body,
35
+ ...(cc ? { cc } : {}),
36
+ ...(bcc ? { bcc } : {}),
37
+ ...(tid ? { textTemplateId: tid } : {}),
38
+ },
39
+ };
40
+ }
41
+ //#endregion
42
+ //#region ---- Mock send command ----
43
+ const MOCK_SEND_LATENCY_MS = 120;
44
+ class NotificationManagementEmailSendMockCommand {
45
+ constructor() {
46
+ this.toastService = inject(AXToastService);
47
+ }
48
+ async execute(input) {
49
+ await new Promise((resolve) => setTimeout(resolve, MOCK_SEND_LATENCY_MS));
50
+ const parsed = parseSendInput(input);
51
+ if (!parsed.ok) {
52
+ return { success: false, message: { text: parsed.error } };
53
+ }
54
+ // Mock transport: surface as UI toast only; replace with HTTP when backend exists.
55
+ this.toastService.show({
56
+ color: 'warning',
57
+ title: 'Email send (simulation)',
58
+ content: `No email was delivered — mock only.\n To: ${parsed.value.to}.\n Subject: ${parsed.value.subject}.`,
59
+ });
60
+ return {
61
+ success: true,
62
+ data: { messageId: AXPDataGenerator.uuid() },
63
+ };
64
+ }
65
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NotificationManagementEmailSendMockCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
66
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NotificationManagementEmailSendMockCommand }); }
67
+ }
68
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NotificationManagementEmailSendMockCommand, decorators: [{
69
+ type: Injectable
70
+ }] });
71
+
72
+ export { NotificationManagementEmailSendMockCommand };
73
+ //# sourceMappingURL=acorex-connectivity-mock-notification-management-email-send.command-DAQfIWoD.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-connectivity-mock-notification-management-email-send.command-DAQfIWoD.mjs","sources":["../../../../libs/connectivity/mock/src/lib/notification-management/commands/notification-management-email-send.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPDataGenerator } from '@acorex/platform/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport type {\n NotificationManagementEmailSendInput,\n NotificationManagementEmailSendResult,\n} from '@acorex/modules/notification-management';\nimport { AXToastService } from '@acorex/components/toast';\nimport { inject, Injectable } from '@angular/core';\n\n//#endregion\n\n//#region ---- Input parsing ----\n\nfunction parseSendInput(\n raw: unknown,\n): { ok: true; value: NotificationManagementEmailSendInput } | { ok: false; error: string } {\n const obj =\n raw != null && typeof raw === 'object' && !Array.isArray(raw) ? (raw as Record<string, unknown>) : null;\n if (!obj) {\n return { ok: false, error: 'Invalid arguments: expected an object.' };\n }\n const to = typeof obj['to'] === 'string' ? obj['to'].trim() : '';\n const subject = typeof obj['subject'] === 'string' ? obj['subject'].trim() : '';\n const body = typeof obj['body'] === 'string' ? obj['body'].trim() : '';\n if (!to) {\n return { ok: false, error: 'Invalid arguments: \"to\" is required.' };\n }\n if (!subject) {\n return { ok: false, error: 'Invalid arguments: \"subject\" is required.' };\n }\n if (!body) {\n return { ok: false, error: 'Invalid arguments: \"body\" is required.' };\n }\n const cc = typeof obj['cc'] === 'string' ? obj['cc'].trim() : '';\n const bcc = typeof obj['bcc'] === 'string' ? obj['bcc'].trim() : '';\n const tid = typeof obj['textTemplateId'] === 'string' ? obj['textTemplateId'].trim() : '';\n return {\n ok: true,\n value: {\n to,\n subject,\n body,\n ...(cc ? { cc } : {}),\n ...(bcc ? { bcc } : {}),\n ...(tid ? { textTemplateId: tid } : {}),\n },\n };\n}\n\n//#endregion\n\n//#region ---- Mock send command ----\n\nconst MOCK_SEND_LATENCY_MS = 120;\n\n@Injectable()\nexport class NotificationManagementEmailSendMockCommand\n implements AXPCommand<NotificationManagementEmailSendInput, NotificationManagementEmailSendResult> {\n private readonly toastService = inject(AXToastService);\n\n async execute(\n input: NotificationManagementEmailSendInput,\n ): Promise<AXPExecuteCommandResult<NotificationManagementEmailSendResult>> {\n await new Promise<void>((resolve) => setTimeout(resolve, MOCK_SEND_LATENCY_MS));\n const parsed = parseSendInput(input);\n if (!parsed.ok) {\n return { success: false, message: { text: parsed.error } };\n }\n // Mock transport: surface as UI toast only; replace with HTTP when backend exists.\n this.toastService.show({\n color: 'warning',\n title: 'Email send (simulation)',\n content: `No email was delivered — mock only.\\n To: ${parsed.value.to}.\\n Subject: ${parsed.value.subject}.`,\n });\n return {\n success: true,\n data: { messageId: AXPDataGenerator.uuid() },\n };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;AAAA;AAYA;AAEA;AAEA,S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C7G,SAAA,CAAC;QACF,OAAO;AACL,YAAA,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,EAAE,SAAS,EAAE,gBAAgB,CAAC,IAAI,EAAE,EAAE;SAC7C;IACH;8GAtBW,0CAA0C,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAA1C,0CAA0C,EAAA,CAAA,CAAA;;2FAA1C,0CAA0C,EAAA,UAAA,EAAA,CAAA;kBADtD;;;;;"}
@@ -0,0 +1,49 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable } from '@angular/core';
3
+
4
+ //#endregion
5
+ /**
6
+ * Notify Signers Activity (Backend - Mock)
7
+ *
8
+ * Sends notifications to signers about the signature request.
9
+ * Activity type: workflow-activity:notify-signers
10
+ */
11
+ class NotifySignersActivity {
12
+ async execute(input) {
13
+ try {
14
+ console.log(`[NotifySignersActivity] Notifying ${input.signers.length} signers for request: ${input.signatureRequestId}`);
15
+ if (!input.signatureRequestId || !input.signers || input.signers.length === 0) {
16
+ throw new Error('Invalid input: signatureRequestId and at least one signer are required');
17
+ }
18
+ const notifiedCount = input.signers.length;
19
+ console.log(`[NotifySignersActivity] Successfully notified ${notifiedCount} signers`);
20
+ return {
21
+ success: true,
22
+ data: { notifiedCount },
23
+ metadata: { outcome: 'Done' },
24
+ };
25
+ }
26
+ catch (error) {
27
+ console.error(`[NotifySignersActivity] Failed to notify signers:`, error);
28
+ return {
29
+ success: false,
30
+ message: {
31
+ text: error.message || 'Failed to notify signers',
32
+ },
33
+ data: { notifiedCount: 0 },
34
+ metadata: { outcome: 'Failed' },
35
+ };
36
+ }
37
+ }
38
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NotifySignersActivity, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
39
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NotifySignersActivity, providedIn: 'root' }); }
40
+ }
41
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NotifySignersActivity, decorators: [{
42
+ type: Injectable,
43
+ args: [{
44
+ providedIn: 'root',
45
+ }]
46
+ }] });
47
+
48
+ export { NotifySignersActivity };
49
+ //# sourceMappingURL=acorex-connectivity-mock-notify-signers.activity-Dg0sKGip.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-connectivity-mock-notify-signers.activity-Dg0sKGip.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/notify-signers.activity.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\n\n//#region ---- Types ----\n\nexport interface NotifySignersInput {\n signatureRequestId: string;\n signers: string[];\n message?: string;\n}\n\nexport interface NotifySignersOutput {\n notifiedCount: number;\n}\n\n//#endregion\n\n/**\n * Notify Signers Activity (Backend - Mock)\n *\n * Sends notifications to signers about the signature request.\n * Activity type: workflow-activity:notify-signers\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class NotifySignersActivity implements AXPCommand<NotifySignersInput, NotifySignersOutput> {\n async execute(\n input: NotifySignersInput,\n ): Promise<AXPExecuteCommandResult<NotifySignersOutput>> {\n try {\n console.log(`[NotifySignersActivity] Notifying ${input.signers.length} signers for request: ${input.signatureRequestId}`);\n\n if (!input.signatureRequestId || !input.signers || input.signers.length === 0) {\n throw new Error('Invalid input: signatureRequestId and at least one signer are required');\n }\n\n const notifiedCount = input.signers.length;\n\n console.log(`[NotifySignersActivity] Successfully notified ${notifiedCount} signers`);\n\n return {\n success: true,\n data: { notifiedCount },\n metadata: { outcome: 'Done' },\n };\n } catch (error: any) {\n console.error(`[NotifySignersActivity] Failed to notify signers:`, error);\n\n return {\n success: false,\n message: {\n text: error.message || 'Failed to notify signers',\n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AA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,cAFpB,MAAM,EAAA,CAAA,CAAA;;2FAEP,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAHjC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
@@ -0,0 +1,60 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable } from '@angular/core';
3
+ import { AXPDataGenerator } from '@acorex/platform/core';
4
+
5
+ //#endregion
6
+ /**
7
+ * Request Signature Activity (Backend - Mock)
8
+ *
9
+ * Creates a new signature request for an entity record.
10
+ * Activity type: workflow-activity:request-signature
11
+ */
12
+ class RequestSignatureActivity {
13
+ async execute(input) {
14
+ try {
15
+ console.log(`[RequestSignatureActivity] Creating signature request for ${input.refType}:${input.refId}`);
16
+ if (!input.refId || !input.refType || !input.signers || input.signers.length === 0) {
17
+ throw new Error('Invalid input: refId, refType, and at least one signer are required');
18
+ }
19
+ const signatureRequestId = AXPDataGenerator.uuid();
20
+ console.log(`[RequestSignatureActivity] Created signature request: ${signatureRequestId} for ${input.signers.length} signers`);
21
+ return {
22
+ success: true,
23
+ data: {
24
+ signatureRequestId,
25
+ workflowInstanceId: input.workflowName ? `${input.workflowName}-${signatureRequestId}` : undefined,
26
+ },
27
+ metadata: {
28
+ outcome: 'Done',
29
+ },
30
+ };
31
+ }
32
+ catch (error) {
33
+ console.error(`[RequestSignatureActivity] Failed to create signature request:`, error);
34
+ return {
35
+ success: false,
36
+ message: {
37
+ text: error.message || 'Failed to create signature request',
38
+ },
39
+ data: {
40
+ signatureRequestId: '',
41
+ workflowInstanceId: undefined,
42
+ },
43
+ metadata: {
44
+ outcome: 'Failed',
45
+ },
46
+ };
47
+ }
48
+ }
49
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RequestSignatureActivity, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
50
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RequestSignatureActivity, providedIn: 'root' }); }
51
+ }
52
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RequestSignatureActivity, decorators: [{
53
+ type: Injectable,
54
+ args: [{
55
+ providedIn: 'root',
56
+ }]
57
+ }] });
58
+
59
+ export { RequestSignatureActivity };
60
+ //# sourceMappingURL=acorex-connectivity-mock-request-signature.activity-CoRT_H2u.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-connectivity-mock-request-signature.activity-CoRT_H2u.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/request-signature.activity.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult, AXPDataGenerator } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\n\n//#region ---- Types ----\n\nexport interface RequestSignatureInput {\n refId: string;\n refType: string;\n signers: string[];\n workflowName?: string;\n}\n\nexport interface RequestSignatureOutput {\n signatureRequestId: string;\n workflowInstanceId?: string;\n}\n\n//#endregion\n\n/**\n * Request Signature Activity (Backend - Mock)\n *\n * Creates a new signature request for an entity record.\n * Activity type: workflow-activity:request-signature\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class RequestSignatureActivity implements AXPCommand<RequestSignatureInput, RequestSignatureOutput> {\n async execute(\n input: RequestSignatureInput,\n ): Promise<AXPExecuteCommandResult<RequestSignatureOutput>> {\n try {\n console.log(`[RequestSignatureActivity] Creating signature request for ${input.refType}:${input.refId}`);\n\n if (!input.refId || !input.refType || !input.signers || input.signers.length === 0) {\n throw new Error('Invalid input: refId, refType, and at least one signer are required');\n }\n\n const signatureRequestId = AXPDataGenerator.uuid();\n\n console.log(\n `[RequestSignatureActivity] Created signature request: ${signatureRequestId} for ${input.signers.length} signers`,\n );\n\n return {\n success: true,\n data: {\n signatureRequestId,\n workflowInstanceId: input.workflowName ? `${input.workflowName}-${signatureRequestId}` : undefined,\n },\n metadata: {\n outcome: 'Done',\n },\n };\n } catch (error: any) {\n console.error(`[RequestSignatureActivity] Failed to create signature request:`, error);\n\n return {\n success: false,\n message: {\n text: error.message || 'Failed to create signature request',\n },\n data: {\n signatureRequestId: '',\n workflowInstanceId: undefined,\n },\n metadata: {\n outcome: 'Failed',\n },\n };\n }\n }\n}\n"],"names":[],"mappings":";;;;AAkBA;AAEA;;;;;AAKG;MAIU,wBAAwB,CAAA;IACnC,MAAM,OAAO,CACX,KAA4B,EAAA;AAE5B,QAAA,IAAI;AACF,YAAA,OAAO,CAAC,GAAG,CAAC,CAAA,0DAAA,EAA6D,KAAK,CAAC,OAAO,CAAA,CAAA,EAAI,KAAK,CAAC,KAAK,CAAA,CAAE,CAAC;YAExG,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;AAClF,gBAAA,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC;YACxF;AAEA,YAAA,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,IAAI,EAAE;AAElD,YAAA,OAAO,CAAC,GAAG,CACT,CAAA,sDAAA,EAAyD,kBAAkB,CAAA,KAAA,EAAQ,KAAK,CAAC,OAAO,CAAC,MAAM,CAAA,QAAA,CAAU,CAClH;YAED,OAAO;AACL,gBAAA,OAAO,EAAE,IAAI;AACb,gBAAA,IAAI,EAAE;oBACJ,kBAAkB;AAClB,oBAAA,kBAAkB,EAAE,KAAK,CAAC,YAAY,GAAG,CAAA,EAAG,KAAK,CAAC,YAAY,CAAA,CAAA,EAAI,kBAAkB,EAAE,GAAG,SAAS;AACnG,iBAAA;AACD,gBAAA,QAAQ,EAAE;AACR,oBAAA,OAAO,EAAE,MAAM;AAChB,iBAAA;aACF;QACH;QAAE,OAAO,KAAU,EAAE;AACnB,YAAA,OAAO,CAAC,KAAK,CAAC,gEAAgE,EAAE,KAAK,CAAC;YAEtF,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;AACP,oBAAA,IAAI,EAAE,KAAK,CAAC,OAAO,IAAI,oCAAoC;AAC5D,iBAAA;AACD,gBAAA,IAAI,EAAE;AACJ,oBAAA,kBAAkB,EAAE,EAAE;AACtB,oBAAA,kBAAkB,EAAE,SAAS;AAC9B,iBAAA;AACD,gBAAA,QAAQ,EAAE;AACR,oBAAA,OAAO,EAAE,QAAQ;AAClB,iBAAA;aACF;QACH;IACF;8GA5CW,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAxB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,cAFvB,MAAM,EAAA,CAAA,CAAA;;2FAEP,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAHpC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
@@ -9,10 +9,10 @@ class AXMReportSampleActionExecuteCommand {
9
9
  success: true,
10
10
  };
11
11
  }
12
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXMReportSampleActionExecuteCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
13
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXMReportSampleActionExecuteCommand, providedIn: 'root' }); }
12
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMReportSampleActionExecuteCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
13
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMReportSampleActionExecuteCommand, providedIn: 'root' }); }
14
14
  }
15
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXMReportSampleActionExecuteCommand, decorators: [{
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMReportSampleActionExecuteCommand, decorators: [{
16
16
  type: Injectable,
17
17
  args: [{
18
18
  providedIn: 'root',
@@ -20,4 +20,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
20
20
  }] });
21
21
 
22
22
  export { AXMReportSampleActionExecuteCommand };
23
- //# sourceMappingURL=acorex-connectivity-mock-sample.command-CkH5bmEs.mjs.map
23
+ //# sourceMappingURL=acorex-connectivity-mock-sample.command-CJmDL4pL.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-connectivity-mock-sample.command-CJmDL4pL.mjs","sources":["../../../../libs/connectivity/mock/src/lib/report-management/sample.command.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\n\n\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXMReportSampleActionExecuteCommand implements AXPCommand<any, void> {\n\n\n //#region ---- Command Implementation ----\n\n async execute(context: any): Promise<AXPExecuteCommandResult<void>> {\n console.log('ReportManagement.Report:SampleAction', context);\n return {\n success: true,\n };\n }\n\n //#endregion\n} "],"names":[],"mappings":";;;MASa,mCAAmC,CAAA;;IAK9C,MAAM,OAAO,CAAC,OAAY,EAAA;AACxB,QAAA,OAAO,CAAC,GAAG,CAAC,sCAAsC,EAAE,OAAO,CAAC;QAC5D,OAAO;AACL,YAAA,OAAO,EAAE,IAAI;SACd;IACH;8GAVW,mCAAmC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnC,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mCAAmC,cAFlC,MAAM,EAAA,CAAA,CAAA;;2FAEP,mCAAmC,EAAA,UAAA,EAAA,CAAA;kBAH/C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
@@ -0,0 +1,38 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, Injectable } from '@angular/core';
3
+ import { AXPAiEngine } from '@acorex/modules/ai-management';
4
+
5
+ class AiManagementStructuredTextCompletionCommand {
6
+ constructor() {
7
+ this.engine = inject(AXPAiEngine);
8
+ }
9
+ async execute(input) {
10
+ if (!Array.isArray(input.messages) || input.messages.length === 0) {
11
+ return { success: false, message: { text: 'Invalid arguments: "messages" is required.' } };
12
+ }
13
+ const options = {
14
+ assistId: input.assistId,
15
+ modelEntityId: input.modelEntityId,
16
+ modelId: input.modelId,
17
+ messages: input.messages,
18
+ maxTokens: input.maxTokens,
19
+ temperature: input.temperature,
20
+ };
21
+ try {
22
+ const { text } = await this.engine.completeStructuredText(options);
23
+ return { success: true, data: { text } };
24
+ }
25
+ catch (e) {
26
+ const msg = e instanceof Error ? e.message : String(e);
27
+ return { success: false, message: { text: msg } };
28
+ }
29
+ }
30
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AiManagementStructuredTextCompletionCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
31
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AiManagementStructuredTextCompletionCommand }); }
32
+ }
33
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AiManagementStructuredTextCompletionCommand, decorators: [{
34
+ type: Injectable
35
+ }] });
36
+
37
+ export { AiManagementStructuredTextCompletionCommand };
38
+ //# sourceMappingURL=acorex-connectivity-mock-structured-text-completion.command-l31pjl9-.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-connectivity-mock-structured-text-completion.command-l31pjl9-.mjs","sources":["../../../../libs/connectivity/mock/src/lib/ai-management/commands/structured-text-completion.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport type { AXPAiChatMessage, AXPAiStructuredTextCompletionOptions } from '@acorex/modules/ai-management';\nimport { Injectable, inject } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPAiEngine } from '@acorex/modules/ai-management';\n\nimport type { AXCAiEngine } from '../ai-agent-engine.mock';\n\n//#endregion\n\n//#region ---- Command ----\n\nexport interface AiManagementStructuredTextCompletionInput {\n assistId?: string;\n modelEntityId?: string;\n modelId?: string;\n messages: AXPAiChatMessage[];\n maxTokens?: number;\n temperature?: number;\n}\n\n@Injectable()\nexport class AiManagementStructuredTextCompletionCommand\n implements AXPCommand<AiManagementStructuredTextCompletionInput, { text: string }>\n{\n private readonly engine = inject(AXPAiEngine) as AXCAiEngine;\n\n async execute(\n input: AiManagementStructuredTextCompletionInput,\n ): Promise<AXPExecuteCommandResult<{ text: string }>> {\n if (!Array.isArray(input.messages) || input.messages.length === 0) {\n return { success: false, message: { text: 'Invalid arguments: \"messages\" is required.' } };\n }\n const options: AXPAiStructuredTextCompletionOptions = {\n assistId: input.assistId,\n modelEntityId: input.modelEntityId,\n modelId: input.modelId,\n messages: input.messages,\n maxTokens: input.maxTokens,\n temperature: input.temperature,\n };\n try {\n const { text } = await this.engine.completeStructuredText(options);\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":";;;;MAwBa,2CAA2C,CAAA;AADxD,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,WAAW,CAAgB;AAwB7D,IAAA;IAtBC,MAAM,OAAO,CACX,KAAgD,EAAA;AAEhD,QAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;AACjE,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,4CAA4C,EAAE,EAAE;QAC5F;AACA,QAAA,MAAM,OAAO,GAAyC;YACpD,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,aAAa,EAAE,KAAK,CAAC,aAAa;YAClC,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,WAAW,EAAE,KAAK,CAAC,WAAW;SAC/B;AACD,QAAA,IAAI;AACF,YAAA,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,OAAO,CAAC;YAClE,OAAO,EAAE,OAAO,EAAE,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;8GA1BW,2CAA2C,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAA3C,2CAA2C,EAAA,CAAA,CAAA;;2FAA3C,2CAA2C,EAAA,UAAA,EAAA,CAAA;kBADvD;;;;;"}
@@ -0,0 +1,30 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable } from '@angular/core';
3
+ import { m as mockUsers } from './acorex-connectivity-mock-acorex-connectivity-mock-CwWGrnVs.mjs';
4
+
5
+ //#endregion
6
+ /**
7
+ * Resolves role rows for the user list lookup column when using {@link countOnly} column resolve.
8
+ */
9
+ class UserRolesForListColumnQuery {
10
+ async fetch(input) {
11
+ const userId = input?.userId?.trim();
12
+ if (!userId) {
13
+ return { items: [] };
14
+ }
15
+ const user = mockUsers.find((u) => u.id === userId);
16
+ if (!user?.roles?.length) {
17
+ return { items: [] };
18
+ }
19
+ return { items: user.roles };
20
+ }
21
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: UserRolesForListColumnQuery, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
22
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: UserRolesForListColumnQuery, providedIn: 'root' }); }
23
+ }
24
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: UserRolesForListColumnQuery, decorators: [{
25
+ type: Injectable,
26
+ args: [{ providedIn: 'root' }]
27
+ }] });
28
+
29
+ export { UserRolesForListColumnQuery };
30
+ //# sourceMappingURL=acorex-connectivity-mock-user-roles-for-list-column.query-2PnIbRxO.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-connectivity-mock-user-roles-for-list-column.query-2PnIbRxO.mjs","sources":["../../../../libs/connectivity/mock/src/lib/security-management/user/user-roles-for-list-column.query.ts"],"sourcesContent":["import { AXPQuery } from '@acorex/platform/runtime';\nimport { Injectable } from '@angular/core';\nimport { mockUsers } from './user.mock';\n\n//#region ---- Types ----\n\nexport interface UserRolesForListColumnQueryInput {\n userId?: string;\n}\n\nexport interface UserRolesForListColumnQueryResult {\n items: { id: string; title: unknown }[];\n}\n\n//#endregion\n\n/**\n * Resolves role rows for the user list lookup column when using {@link countOnly} column resolve.\n */\n@Injectable({ providedIn: 'root' })\nexport class UserRolesForListColumnQuery implements AXPQuery<UserRolesForListColumnQueryInput, UserRolesForListColumnQueryResult> {\n async fetch(input: UserRolesForListColumnQueryInput): Promise<UserRolesForListColumnQueryResult> {\n const userId = input?.userId?.trim();\n if (!userId) {\n return { items: [] };\n }\n const user = mockUsers.find((u) => u.id === userId);\n if (!user?.roles?.length) {\n return { items: [] };\n }\n return { items: user.roles };\n }\n}\n"],"names":[],"mappings":";;;;AAcA;AAEA;;AAEG;MAEU,2BAA2B,CAAA;IACtC,MAAM,KAAK,CAAC,KAAuC,EAAA;QACjD,MAAM,MAAM,GAAG,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE;QACpC,IAAI,CAAC,MAAM,EAAE;AACX,YAAA,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;QACtB;AACA,QAAA,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC;AACnD,QAAA,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE;AACxB,YAAA,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;QACtB;AACA,QAAA,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE;IAC9B;8GAXW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA3B,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,2BAA2B,cADd,MAAM,EAAA,CAAA,CAAA;;2FACnB,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBADvC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}