@acorex-platform/module-platform-management-client 0.0.32 → 0.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/{acorex-platform-module-platform-management-client-acorex-platform-module-platform-management-client-Dhg_zr0Y.mjs → acorex-platform-module-platform-management-client-acorex-platform-module-platform-management-client-BGVhn6wv.mjs} +134 -10
- package/fesm2022/acorex-platform-module-platform-management-client-acorex-platform-module-platform-management-client-BGVhn6wv.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entities-command-definition.mjs +273 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entities-command-definition.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entities-entity-access-policy.mjs +235 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entities-entity-access-policy.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entities-entity-definition.mjs +249 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entities-entity-definition.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entities-plugin-definition.mjs +258 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entities-plugin-definition.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entities-query-definition.mjs +477 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entities-query-definition.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entities-token.mjs +797 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entities-token.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entities-widget.mjs +305 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entities-widget.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entity-catalog-acorex-platform-module-platform-management-client-contracts-entity-catalog-BOwC5Ns9.mjs +116 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entity-catalog-acorex-platform-module-platform-management-client-contracts-entity-catalog-BOwC5Ns9.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entity-catalog-command-definition.entity-CdvQlwAk.mjs +182 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entity-catalog-command-definition.entity-CdvQlwAk.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entity-catalog-entity-access-policy.entity-Dye4aSKE.mjs +144 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entity-catalog-entity-access-policy.entity-Dye4aSKE.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entity-catalog-entity-definition.entity-CcJ58vfr.mjs +158 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entity-catalog-entity-definition.entity-CcJ58vfr.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entity-catalog-plugin-definition.entity-CwU5hMjI.mjs +167 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entity-catalog-plugin-definition.entity-CwU5hMjI.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entity-catalog-query-definition.entity-DGK684Q1.mjs +386 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entity-catalog-query-definition.entity-DGK684Q1.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entity-catalog-token.entity-DI_k6-ha.mjs +706 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entity-catalog-token.entity-DI_k6-ha.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entity-catalog-widget.entity-C18msniH.mjs +214 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entity-catalog-widget.entity-C18msniH.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entity-catalog.mjs +2 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts-entity-catalog.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-platform-management-client-contracts.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-platform-management-client-create-user-query.command-BZMFLEua.mjs → acorex-platform-module-platform-management-client-create-user-query.command-9Ku7C1BC.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-platform-management-client-create-user-query.command-BZMFLEua.mjs.map → acorex-platform-module-platform-management-client-create-user-query.command-9Ku7C1BC.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-platform-management-client-create-user-query.types-DdygAori.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-platform-management-client-customize-menu.command-2319iHsD.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-platform-management-client-data-list-pick-entity-item.command-CJVpqPmY.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-platform-management-client-entity-master-actions-for-ai.util-DmGyoy9o.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-platform-management-client-execute-token.command-B_xwW9lb.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-platform-management-client-list-catalog-scopes.query-ByhDTWE6.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-platform-management-client-list-editor-widgets.query-DITPMmbw.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-platform-management-client-list-platform-navigation-for-ai.query-2oHMITw-.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-platform-management-client-list-registered-entities.query-DjStd3a8.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-platform-management-client-list-registered-queries.query-C-IfkTel.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-platform-management-client-local-entities.mjs +35 -0
- package/fesm2022/acorex-platform-module-platform-management-client-local-entities.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-platform-management-client-menu-list.component-DiKmJva5.mjs → acorex-platform-module-platform-management-client-menu-list.component-uF5w1c7t.mjs} +4 -4
- package/fesm2022/{acorex-platform-module-platform-management-client-menu-list.component-DiKmJva5.mjs.map → acorex-platform-module-platform-management-client-menu-list.component-uF5w1c7t.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-platform-management-client-platform-console-charts.queries-CQ34R13-.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-platform-management-client-platform-console-data.util-BIkULtKk.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-platform-management-client-platform-console-kpi.queries-BkPdhVq_.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-platform-management-client-rest-api-generator-widget-column.component-BR1FlwWM.mjs → acorex-platform-module-platform-management-client-rest-api-generator-widget-column.component-B0g6dweQ.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-platform-management-client-rest-api-generator-widget-column.component-BR1FlwWM.mjs.map → acorex-platform-module-platform-management-client-rest-api-generator-widget-column.component-B0g6dweQ.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-platform-management-client-rest-api-generator-widget-edit.component-DwPKSgdP.mjs → acorex-platform-module-platform-management-client-rest-api-generator-widget-edit.component-A0v5MWRU.mjs} +3 -3
- package/fesm2022/{acorex-platform-module-platform-management-client-rest-api-generator-widget-edit.component-DwPKSgdP.mjs.map → acorex-platform-module-platform-management-client-rest-api-generator-widget-edit.component-A0v5MWRU.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-platform-management-client-rest-api-generator-widget-view.component-DPhBXqGo.mjs → acorex-platform-module-platform-management-client-rest-api-generator-widget-view.component-RR5zcsnI.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-platform-management-client-rest-api-generator-widget-view.component-DPhBXqGo.mjs.map → acorex-platform-module-platform-management-client-rest-api-generator-widget-view.component-RR5zcsnI.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-platform-management-client.mjs +1 -1
- package/package.json +39 -3
- package/types/acorex-platform-module-platform-management-client-contracts-entities-command-definition.d.ts +5 -0
- package/types/acorex-platform-module-platform-management-client-contracts-entities-entity-access-policy.d.ts +5 -0
- package/types/acorex-platform-module-platform-management-client-contracts-entities-entity-definition.d.ts +5 -0
- package/types/acorex-platform-module-platform-management-client-contracts-entities-plugin-definition.d.ts +5 -0
- package/types/acorex-platform-module-platform-management-client-contracts-entities-query-definition.d.ts +5 -0
- package/types/acorex-platform-module-platform-management-client-contracts-entities-token.d.ts +5 -0
- package/types/acorex-platform-module-platform-management-client-contracts-entities-widget.d.ts +5 -0
- package/types/acorex-platform-module-platform-management-client-contracts-entity-catalog.d.ts +10 -0
- package/types/acorex-platform-module-platform-management-client-local-entities.d.ts +12 -0
- package/fesm2022/acorex-platform-module-platform-management-client-acorex-platform-module-platform-management-client-Dhg_zr0Y.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-platform-management-client-create-user-query.types-DdygAori.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/features/query-definition/create-user-query.types.ts"],"sourcesContent":["import type { AXRestApiOutput } from '@acorex/components/rest-api-generator';\nimport { RootConfig } from '@acorex-platform/module-platform-management-client/contracts';\n\n//#region ----- Types -----\n\nexport type AXPUserQuerySourceKind = 'entity' | 'static' | 'api' | 'advanced';\n\nexport interface AXPUserQueryStaticItem {\n value: string;\n title: string;\n}\n\nexport type AXPUserQueryEntityFieldKind = 'host' | 'lookup' | 'relation';\n\nexport interface AXPUserQueryEntityFieldItem {\n path: string;\n text: string;\n}\n\nexport interface AXPUserQueryEntityFieldGroup {\n id: string;\n kind: AXPUserQueryEntityFieldKind;\n title: unknown;\n fallback: string;\n items: Array<{ path: string; title?: unknown; fallback: string }>;\n children?: AXPUserQueryEntityFieldGroup[];\n}\n\nexport interface AXPUserQueryEntityFieldGroupView {\n id: string;\n kind: AXPUserQueryEntityFieldKind;\n title: string;\n items: AXPUserQueryEntityFieldItem[];\n children?: AXPUserQueryEntityFieldGroupView[];\n}\n\nexport interface AXPUserQueryApiTestResult {\n ok: boolean;\n status: number | string;\n body: unknown;\n}\n\nexport interface AXPUserQueryWizardSource {\n kind: AXPUserQuerySourceKind;\n entity?: {\n entityName?: string;\n fields?: string[];\n fieldGroups?: Record<string, string[]>;\n };\n static?: {\n items: AXPUserQueryStaticItem[];\n };\n api?: {\n connectionId?: unknown;\n request?: AXRestApiOutput;\n lastTest?: AXPUserQueryApiTestResult;\n fields?: string[];\n fieldGroups?: Record<string, string[]>;\n };\n}\n\nexport interface AXPUserQueryWizardContext {\n sourceKind: AXPUserQuerySourceKind;\n source: AXPUserQueryWizardSource;\n}\n\nexport const CREATE_USER_QUERY_COMMAND_KEY = 'PlatformManagement:CreateUserQuery';\n\nexport const CREATE_USER_QUERY_WIZARD_NAME = 'create-user-query-wizard';\n\nexport const CREATE_USER_QUERY_ENTITY_CATALOG = `${RootConfig.module.name}.${RootConfig.entities.entityDefinition.name}`;\n\nexport const CREATE_USER_QUERY_I18N = {\n titles: {\n entity: '@platform-management:query-definitions.wizard.create.titles.entity',\n static: '@platform-management:query-definitions.wizard.create.titles.static-list',\n api: '@platform-management:query-definitions.wizard.create.titles.external-api',\n advanced: '@platform-management:query-definitions.wizard.create.titles.advanced',\n },\n steps: {\n source: '@platform-management:query-definitions.wizard.create.steps.source',\n entity: '@platform-management:query-definitions.wizard.create.steps.entity',\n fields: '@platform-management:query-definitions.wizard.create.steps.fields',\n contract: '@platform-management:query-definitions.wizard.create.steps.contract',\n },\n fields: {\n entity: '@platform-management:query-definitions.wizard.create.fields.entity',\n fields: '@platform-management:query-definitions.wizard.create.fields.fields',\n hostFields: '@platform-management:query-definitions.wizard.create.fields.host-fields',\n value: '@platform-management:query-definitions.wizard.create.fields.value',\n title: '@platform-management:query-definitions.wizard.create.fields.title',\n connection: '@platform-management:query-definitions.wizard.create.fields.connection',\n method: '@platform-management:query-definitions.wizard.create.fields.method',\n path: '@platform-management:query-definitions.wizard.create.fields.path',\n request: '@platform-management:query-definitions.wizard.create.fields.request',\n sample: '@platform-management:query-definitions.wizard.create.fields.sample',\n status: '@platform-management:query-definitions.wizard.create.fields.status',\n response: '@platform-management:query-definitions.wizard.create.fields.response',\n },\n import: {\n title: '@platform-management:query-definitions.wizard.create.import.title',\n placeholder: '@platform-management:query-definitions.wizard.create.import.placeholder',\n apply: '@platform-management:query-definitions.wizard.create.import.apply',\n parseFailed: '@platform-management:query-definitions.wizard.create.errors.parse-failed',\n },\n methods: {\n get: '@platform-management:query-definitions.wizard.create.methods.get',\n post: '@platform-management:query-definitions.wizard.create.methods.post',\n },\n placeholders: {\n contract: '@platform-management:query-definitions.wizard.create.placeholders.contract',\n advanced: '@platform-management:query-definitions.wizard.create.placeholders.advanced',\n itemsHint: '@platform-management:query-definitions.wizard.create.items-hint',\n entityFields: '@platform-management:query-definitions.wizard.create.placeholders.entity-fields',\n fieldsNext: '@platform-management:query-definitions.wizard.create.placeholders.fields-next',\n selectedEntityHint: '@platform-management:query-definitions.wizard.create.placeholders.selected-entity-hint',\n relatedTo: '@platform-management:query-definitions.wizard.create.placeholders.related-to',\n apiFieldsNext: '@platform-management:query-definitions.wizard.create.placeholders.api-fields-next',\n selectedApiHint: '@platform-management:query-definitions.wizard.create.placeholders.selected-api-hint',\n apiFields: '@platform-management:query-definitions.wizard.create.placeholders.api-fields',\n apiTestOk: '@platform-management:query-definitions.wizard.create.placeholders.api-test-ok',\n },\n errors: {\n entityRequired: '@platform-management:query-definitions.wizard.create.errors.entity-required',\n entityLoadFailed: '@platform-management:query-definitions.wizard.create.errors.entity-load-failed',\n fieldsRequired: '@platform-management:query-definitions.wizard.create.errors.fields-required',\n staticRequired: '@platform-management:query-definitions.wizard.create.errors.static-required',\n apiConnectionRequired: '@platform-management:query-definitions.wizard.create.errors.api-connection-required',\n apiPathRequired: '@platform-management:query-definitions.wizard.create.errors.api-path-required',\n apiUrlRequired: '@platform-management:query-definitions.wizard.create.errors.api-url-required',\n apiTestFailed: '@platform-management:query-definitions.wizard.create.errors.api-test-failed',\n apiTestNetwork: '@platform-management:query-definitions.wizard.create.errors.api-test-network',\n },\n} as const;\n\n//#endregion\n"],"names":[],"mappings":";;AAkEO,MAAM,6BAA6B,GAAG,oCAAoC;AAE1E,MAAM,6BAA6B,GA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AAA,QAAQ,EAAE,4EAA4E;AACtF,QAAA,QAAQ,EAAE,4EAA4E;AACtF,QAAA,SAAS,EAAE,iEAAiE;AAC5E,QAAA,YAAY,EAAE,iFAAiF;AAC/F,QAAA,UAAU,EAAE,+EAA+E;AAC3F,QAAA,kBAAkB,EAAE,wFAAwF;AAC5G,QAAA,SAAS,EAAE,8EAA8E;AACzF,QAAA,aAAa,EAAE,mFAAmF;AAClG,QAAA,eAAe,EAAE,qFAAqF;AACtG,QAAA,SAAS,EAAE,8EAA8E;AACzF,QAAA,SAAS,EAAE,+EAA+E;AAC3F,KAAA;AACD,IAAA,MAAM,EAAE;AACN,QAAA,cAAc,EAAE,6EAA6E;AAC7F,QAAA,gBAAgB,EAAE,gFAAgF;AAClG,QAAA,cAAc,EAAE,6EAA6E;AAC7F,QAAA,cAAc,EAAE,6EAA6E;AAC7F,QAAA,qBAAqB,EAAE,qFAAqF;AAC5G,QAAA,eAAe,EAAE,+EAA+E;AAChG,QAAA,cAAc,EAAE,8EAA8E;AAC9F,QAAA,aAAa,EAAE,6EAA6E;AAC5F,QAAA,cAAc,EAAE,8EAA8E;AAC/F,KAAA;;AAGH
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-platform-management-client-create-user-query.types-DdygAori.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/features/query-definition/create-user-query.types.ts"],"sourcesContent":["import type { AXRestApiOutput } from '@acorex/components/rest-api-generator';\nimport { RootConfig } from '@acorex-platform/module-platform-management-client/contracts';\n\n//#region ----- Types -----\n\nexport type AXPUserQuerySourceKind = 'entity' | 'static' | 'api' | 'advanced';\n\nexport interface AXPUserQueryStaticItem {\n value: string;\n title: string;\n}\n\nexport type AXPUserQueryEntityFieldKind = 'host' | 'lookup' | 'relation';\n\nexport interface AXPUserQueryEntityFieldItem {\n path: string;\n text: string;\n}\n\nexport interface AXPUserQueryEntityFieldGroup {\n id: string;\n kind: AXPUserQueryEntityFieldKind;\n title: unknown;\n fallback: string;\n items: Array<{ path: string; title?: unknown; fallback: string }>;\n children?: AXPUserQueryEntityFieldGroup[];\n}\n\nexport interface AXPUserQueryEntityFieldGroupView {\n id: string;\n kind: AXPUserQueryEntityFieldKind;\n title: string;\n items: AXPUserQueryEntityFieldItem[];\n children?: AXPUserQueryEntityFieldGroupView[];\n}\n\nexport interface AXPUserQueryApiTestResult {\n ok: boolean;\n status: number | string;\n body: unknown;\n}\n\nexport interface AXPUserQueryWizardSource {\n kind: AXPUserQuerySourceKind;\n entity?: {\n entityName?: string;\n fields?: string[];\n fieldGroups?: Record<string, string[]>;\n };\n static?: {\n items: AXPUserQueryStaticItem[];\n };\n api?: {\n connectionId?: unknown;\n request?: AXRestApiOutput;\n lastTest?: AXPUserQueryApiTestResult;\n fields?: string[];\n fieldGroups?: Record<string, string[]>;\n };\n}\n\nexport interface AXPUserQueryWizardContext {\n sourceKind: AXPUserQuerySourceKind;\n source: AXPUserQueryWizardSource;\n}\n\nexport const CREATE_USER_QUERY_COMMAND_KEY = 'PlatformManagement:CreateUserQuery';\n\nexport const CREATE_USER_QUERY_WIZARD_NAME = 'create-user-query-wizard';\n\nexport const CREATE_USER_QUERY_ENTITY_CATALOG = `${RootConfig.module.name}.${RootConfig.entities.entityDefinition.name}`;\n\nexport const CREATE_USER_QUERY_I18N = {\n titles: {\n entity: '@platform-management:query-definitions.wizard.create.titles.entity',\n static: '@platform-management:query-definitions.wizard.create.titles.static-list',\n api: '@platform-management:query-definitions.wizard.create.titles.external-api',\n advanced: '@platform-management:query-definitions.wizard.create.titles.advanced',\n },\n steps: {\n source: '@platform-management:query-definitions.wizard.create.steps.source',\n entity: '@platform-management:query-definitions.wizard.create.steps.entity',\n fields: '@platform-management:query-definitions.wizard.create.steps.fields',\n contract: '@platform-management:query-definitions.wizard.create.steps.contract',\n },\n fields: {\n entity: '@platform-management:query-definitions.wizard.create.fields.entity',\n fields: '@platform-management:query-definitions.wizard.create.fields.fields',\n hostFields: '@platform-management:query-definitions.wizard.create.fields.host-fields',\n value: '@platform-management:query-definitions.wizard.create.fields.value',\n title: '@platform-management:query-definitions.wizard.create.fields.title',\n connection: '@platform-management:query-definitions.wizard.create.fields.connection',\n method: '@platform-management:query-definitions.wizard.create.fields.method',\n path: '@platform-management:query-definitions.wizard.create.fields.path',\n request: '@platform-management:query-definitions.wizard.create.fields.request',\n sample: '@platform-management:query-definitions.wizard.create.fields.sample',\n status: '@platform-management:query-definitions.wizard.create.fields.status',\n response: '@platform-management:query-definitions.wizard.create.fields.response',\n },\n import: {\n title: '@platform-management:query-definitions.wizard.create.import.title',\n placeholder: '@platform-management:query-definitions.wizard.create.import.placeholder',\n apply: '@platform-management:query-definitions.wizard.create.import.apply',\n parseFailed: '@platform-management:query-definitions.wizard.create.errors.parse-failed',\n },\n methods: {\n get: '@platform-management:query-definitions.wizard.create.methods.get',\n post: '@platform-management:query-definitions.wizard.create.methods.post',\n },\n placeholders: {\n contract: '@platform-management:query-definitions.wizard.create.placeholders.contract',\n advanced: '@platform-management:query-definitions.wizard.create.placeholders.advanced',\n itemsHint: '@platform-management:query-definitions.wizard.create.items-hint',\n entityFields: '@platform-management:query-definitions.wizard.create.placeholders.entity-fields',\n fieldsNext: '@platform-management:query-definitions.wizard.create.placeholders.fields-next',\n selectedEntityHint: '@platform-management:query-definitions.wizard.create.placeholders.selected-entity-hint',\n relatedTo: '@platform-management:query-definitions.wizard.create.placeholders.related-to',\n apiFieldsNext: '@platform-management:query-definitions.wizard.create.placeholders.api-fields-next',\n selectedApiHint: '@platform-management:query-definitions.wizard.create.placeholders.selected-api-hint',\n apiFields: '@platform-management:query-definitions.wizard.create.placeholders.api-fields',\n apiTestOk: '@platform-management:query-definitions.wizard.create.placeholders.api-test-ok',\n },\n errors: {\n entityRequired: '@platform-management:query-definitions.wizard.create.errors.entity-required',\n entityLoadFailed: '@platform-management:query-definitions.wizard.create.errors.entity-load-failed',\n fieldsRequired: '@platform-management:query-definitions.wizard.create.errors.fields-required',\n staticRequired: '@platform-management:query-definitions.wizard.create.errors.static-required',\n apiConnectionRequired: '@platform-management:query-definitions.wizard.create.errors.api-connection-required',\n apiPathRequired: '@platform-management:query-definitions.wizard.create.errors.api-path-required',\n apiUrlRequired: '@platform-management:query-definitions.wizard.create.errors.api-url-required',\n apiTestFailed: '@platform-management:query-definitions.wizard.create.errors.api-test-failed',\n apiTestNetwork: '@platform-management:query-definitions.wizard.create.errors.api-test-network',\n },\n} as const;\n\n//#endregion\n"],"names":[],"mappings":";;AAkEO,MAAM,6BAA6B,GAAG,oCAAoC;AAE1E,MAAM,6BAA6B,GAAG;AAEtC,MAAM,gCAAgC,GAAG,CAAA,EAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAA,CAAA,EAAI,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI;AAE/G,MAAM,sBAAsB,GAAG;AACpC,IAAA,MAAM,EAAE;AACN,QAAA,MAAM,EAAE,oEAAoE;AAC5E,QAAA,MAAM,EAAE,yEAAyE;AACjF,QAAA,GAAG,EAAE,0EAA0E;AAC/E,QAAA,QAAQ,EAAE,sEAAsE;AACjF,KAAA;AACD,IAAA,KAAK,EAAE;AACL,QAAA,MAAM,EAAE,mEAAmE;AAC3E,QAAA,MAAM,EAAE,mEAAmE;AAC3E,QAAA,MAAM,EAAE,mEAAmE;AAC3E,QAAA,QAAQ,EAAE,qEAAqE;AAChF,KAAA;AACD,IAAA,MAAM,EAAE;AACN,QAAA,MAAM,EAAE,oEAAoE;AAC5E,QAAA,MAAM,EAAE,oEAAoE;AAC5E,QAAA,UAAU,EAAE,yEAAyE;AACrF,QAAA,KAAK,EAAE,mEAAmE;AAC1E,QAAA,KAAK,EAAE,mEAAmE;AAC1E,QAAA,UAAU,EAAE,wEAAwE;AACpF,QAAA,MAAM,EAAE,oEAAoE;AAC5E,QAAA,IAAI,EAAE,kEAAkE;AACxE,QAAA,OAAO,EAAE,qEAAqE;AAC9E,QAAA,MAAM,EAAE,oEAAoE;AAC5E,QAAA,MAAM,EAAE,oEAAoE;AAC5E,QAAA,QAAQ,EAAE,sEAAsE;AACjF,KAAA;AACD,IAAA,MAAM,EAAE;AACN,QAAA,KAAK,EAAE,mEAAmE;AAC1E,QAAA,WAAW,EAAE,yEAAyE;AACtF,QAAA,KAAK,EAAE,mEAAmE;AAC1E,QAAA,WAAW,EAAE,0EAA0E;AACxF,KAAA;AACD,IAAA,OAAO,EAAE;AACP,QAAA,GAAG,EAAE,kEAAkE;AACvE,QAAA,IAAI,EAAE,mEAAmE;AAC1E,KAAA;AACD,IAAA,YAAY,EAAE;AACZ,QAAA,QAAQ,EAAE,4EAA4E;AACtF,QAAA,QAAQ,EAAE,4EAA4E;AACtF,QAAA,SAAS,EAAE,iEAAiE;AAC5E,QAAA,YAAY,EAAE,iFAAiF;AAC/F,QAAA,UAAU,EAAE,+EAA+E;AAC3F,QAAA,kBAAkB,EAAE,wFAAwF;AAC5G,QAAA,SAAS,EAAE,8EAA8E;AACzF,QAAA,aAAa,EAAE,mFAAmF;AAClG,QAAA,eAAe,EAAE,qFAAqF;AACtG,QAAA,SAAS,EAAE,8EAA8E;AACzF,QAAA,SAAS,EAAE,+EAA+E;AAC3F,KAAA;AACD,IAAA,MAAM,EAAE;AACN,QAAA,cAAc,EAAE,6EAA6E;AAC7F,QAAA,gBAAgB,EAAE,gFAAgF;AAClG,QAAA,cAAc,EAAE,6EAA6E;AAC7F,QAAA,cAAc,EAAE,6EAA6E;AAC7F,QAAA,qBAAqB,EAAE,qFAAqF;AAC5G,QAAA,eAAe,EAAE,+EAA+E;AAChG,QAAA,cAAc,EAAE,8EAA8E;AAC9F,QAAA,aAAa,EAAE,6EAA6E;AAC5F,QAAA,cAAc,EAAE,8EAA8E;AAC/F,KAAA;;AAGH;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-platform-management-client-customize-menu.command-2319iHsD.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/features/menu-management/components/menu-customizer-popup/menu-customizer-popup.component.ts","../../../../libs/modules/platform-management/client/src/lib/features/menu-management/commands/customize-menu.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPActionMenuItem, AXPExecuteCommand } from '@acorex-platform/framework-shared/core';\nimport { AXTreeViewDragArea, AXTreeViewDragBehavior } from '@acorex/components/tree-view';\nimport { AXTranslationModule } from '@acorex/core/translation';\n\nimport { AXPMenuCustomizerComponent, AXPThemeLayoutBlockComponent } from '@acorex-platform/framework-client/layout/components';\nimport {\n AXPPopupLayoutBase,\n AXPPopupLayoutBaseComponent,\n AXPPopupLayoutComponent,\n} from '@acorex-platform/framework-client/layout/views';\n\nimport { Component, computed, signal, viewChild, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';\n\n//#endregion\n\n//#region ---- Menu Customizer Popup Component ----\n\n/**\n * Popup wrapper for the menu customizer component.\n * Provides a popup layout with actions for managing menu customizations.\n *\n * Pass the following data when opening the popup:\n * - scopeKey: string - The scope key for menu customizations\n * - showToolbar?: boolean - Whether to show the toolbar (default: true)\n * - allowAddItems?: boolean - Whether to allow adding items (default: true)\n * - dragBehavior?: AXTreeViewDragBehavior - Drag behavior (default: 'move')\n * - dragArea?: AXTreeViewDragArea - Drag area (default: 'handler')\n */\n@Component({\n selector: 'axp-menu-customizer-popup',\n template: `\n <axp-popup-layout>\n <axp-page-content>\n @if (isReady()) {\n <axp-menu-customizer\n [scopeKey]=\"scopeKey()\"\n [showToolbar]=\"showToolbar()\"\n [allowAddItems]=\"allowAddItems()\"\n [dragBehavior]=\"dragBehavior()\"\n [dragArea]=\"dragArea()\"\n (saved)=\"onSaved()\"\n (cancelled)=\"onCancelled()\"\n ></axp-menu-customizer>\n }\n </axp-page-content>\n </axp-popup-layout>\n `,\n imports: [\n AXTranslationModule,\n AXPPopupLayoutComponent,\n AXPThemeLayoutBlockComponent,\n AXPMenuCustomizerComponent\n],\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: AXPPopupLayoutBase,\n useExisting: AXPMenuCustomizerPopupComponent,\n },\n ],\n changeDetection: ChangeDetectionStrategy.Eager,\n host: { class: 'axp-menu-customizer-popup' },\n})\nexport class AXPMenuCustomizerPopupComponent extends AXPPopupLayoutBaseComponent {\n //#region ---- Component State ----\n\n /** Reference to the menu customizer component */\n protected menuCustomizer = viewChild(AXPMenuCustomizerComponent);\n\n /** The scope key for menu customizations (set by popup service) */\n scopeKey = signal<string>('');\n\n /** Whether to show the toolbar */\n showToolbar = signal<boolean>(true);\n\n /** Whether to allow adding custom items */\n allowAddItems = signal<boolean>(true);\n\n /** Drag behavior for the tree view */\n dragBehavior = signal<AXTreeViewDragBehavior>('both');\n\n /** Drag area for the tree view */\n dragArea = signal<AXTreeViewDragArea>('handler');\n\n /** Whether the component is ready to render (scopeKey is set) */\n protected isReady = computed(() => this.scopeKey() !== '');\n\n //#endregion\n\n //#region ---- Lifecycle Methods ----\n\n override async ngOnInit(): Promise<void> {\n await super.ngOnInit();\n // Popup-specific initialization can go here\n }\n\n //#endregion\n\n //#region ---- UI Handlers ----\n\n /**\n * Returns the primary menu items for the popup layout.\n */\n protected override getPrimaryMenuItems(): AXPActionMenuItem[] | Promise<AXPActionMenuItem[]> {\n return [\n {\n title: '@general:actions.close.title',\n icon: 'fa-solid fa-xmark',\n command: {\n name: 'close',\n },\n },\n ];\n }\n\n /**\n * Handles when changes are saved\n */\n protected onSaved(): void {\n this.close(true);\n }\n\n /**\n * Handles when customization is cancelled\n */\n protected onCancelled(): void {\n this.close(false);\n }\n\n /**\n * Executes popup commands\n */\n override execute(command: AXPExecuteCommand): void | Promise<void> {\n if (command.name === 'close') {\n this.close(false);\n }\n }\n\n //#endregion\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPopupService } from '@acorex/components/popup';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPCommonSettings, AXPSettingsService } from '@acorex-platform/framework-client/common';\nimport {\n AXPCommand,\n entityActionDataRecord,\n resolveEntityActionCommandInput,\n type AXPCommandExecuteResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport { inject, Injectable, signal } from '@angular/core';\n\nimport { AXPMenuCustomizerPopupComponent } from '../components/menu-customizer-popup/menu-customizer-popup.component';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface AXMCustomizeMenuCommandOptions {\n scopePrefix?: string;\n title?: string;\n showToolbar?: boolean;\n allowAddItems?: boolean;\n dragBehavior?: 'none' | 'move' | 'copy' | 'both';\n dragArea?: 'node' | 'handler';\n}\n\nexport interface AXMCustomizeMenuCommandInput {\n data?: Record<string, unknown>;\n options?: AXMCustomizeMenuCommandOptions;\n}\n\n//#endregion\n\n//#region ---- Helpers ----\n\nfunction resolveCustomizeMenuInput(input: AXMCustomizeMenuCommandInput = {}) {\n const resolved = resolveEntityActionCommandInput(input);\n const data = (entityActionDataRecord(resolved.data) ?? {}) as Record<string, unknown>;\n const options = (resolved.options ?? {}) as AXMCustomizeMenuCommandOptions;\n\n return { data, options };\n}\n\n//#endregion\n\n//#region ---- Customize menu command ----\n\n/**\n * Opens the menu customizer popup for an entity scope and shows a success toast on save.\n * Replaces the former `customize-menu` workflow (popup step + success toast).\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMCustomizeMenuCommand implements AXPCommand<AXMCustomizeMenuCommandInput> {\n private readonly popupService = inject(AXPopupService);\n private readonly translateService = inject(AXTranslationService);\n private readonly toastService = inject(AXToastService);\n private readonly settingsService = inject(AXPSettingsService);\n\n async execute(input: AXMCustomizeMenuCommandInput = {}): AXPCommandExecuteResultPromise {\n const { data, options } = resolveCustomizeMenuInput(input);\n const entityId = data['id'];\n\n if (!entityId) {\n return {\n success: false,\n message: { text: 'Menu customizer requires entity data with an id property.' },\n };\n }\n\n const scopePrefix = options.scopePrefix ?? 'entity';\n const scopeKey = `${scopePrefix}:${String(entityId)}`;\n\n const customTitle = options.title;\n const defaultTitle = await this.translateService.translateAsync(\n '@platform-management:menu-management.components.menu-customizer-popup.title',\n );\n const entityTitle = data['title'] ?? data['name'] ?? entityId;\n const title = customTitle ?? `${defaultTitle} - ${entityTitle}`;\n\n const result = await this.popupService.open(AXPMenuCustomizerPopupComponent, {\n title,\n size: 'lg',\n data: {\n scopeKey: signal(scopeKey),\n showToolbar: signal(options.showToolbar ?? true),\n allowAddItems: signal(options.allowAddItems ?? true),\n dragBehavior: signal(options.dragBehavior ?? 'both'),\n dragArea: signal(options.dragArea ?? 'handler'),\n },\n });\n\n if (result?.data !== true) {\n return { success: true, kind: 'object', data: { saved: false } };\n }\n\n await this.showSuccessToast();\n\n return { success: true, kind: 'object', data: { saved: true } };\n }\n\n private async showSuccessToast(): Promise<void> {\n const enableOperationToasts = await this.settingsService.get<boolean>(AXPCommonSettings.EnableOperationToasts);\n if (!enableOperationToasts) {\n return;\n }\n\n this.toastService.show({\n color: 'success',\n title: await this.translateService.translateAsync(\n '@platform-management:menu-management.messages.success.customization-saved',\n ),\n closeButton: true,\n timeOut: 3000,\n timeOutProgress: true,\n });\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;AAeA;AAEA;AAEA;;;;;;;;;;AAUG;AAoCG,MAAO,+BAAgC,SAAQ,2BAA2B,CAAA;AAnChF,IAAA,WAAA,GAAA;;;;QAuCY,IAAA,CAAA,cAAc,GAAG,SAAS,CAAC,0BAA0B;2FAAC;;QAGhE,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAS,EAAE;qFAAC;;QAG7B,IAAA,CAAA,WAAW,GAAG,MAAM,CAAU,IAAI;wFAAC;;QAGnC,IAAA,CAAA,aAAa,GAAG,MAAM,CAAU,IAAI;0FAAC;;QAGrC,IAAA,CAAA,YAAY,GAAG,MAAM,CAAyB,MAAM;yFAAC;;QAGrD,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAqB,SAAS;qFAAC;;QAGtC,IAAA,CAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE;oFAAC;AAsD3D,IAAA;;;AA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,GAAA;AAC5B,QAAA,MAAM,qBAAqB,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,GAAG,CAAU,iBAAiB,CAAC,qBAAqB,CAAC;QAC9G,IAAI,CAAC,qBAAqB,EAAE;YAC1B;QACF;AAEA,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;AACrB,YAAA,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,MAAM,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAC/C,2EAA2E,CAC5E;AACD,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,eAAe,EAAE,IAAI;AACtB,SAAA,CAAC;IACJ;8GA/DW,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAvB,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,uBAAuB,cADV,MAAM,EAAA,CAAA,CAAA;;2FACnB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBADnC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-platform-management-client-customize-menu.command-2319iHsD.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/features/menu-management/components/menu-customizer-popup/menu-customizer-popup.component.ts","../../../../libs/modules/platform-management/client/src/lib/features/menu-management/commands/customize-menu.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPActionMenuItem, AXPExecuteCommand } from '@acorex-platform/framework-shared/core';\nimport { AXTreeViewDragArea, AXTreeViewDragBehavior } from '@acorex/components/tree-view';\nimport { AXTranslationModule } from '@acorex/core/translation';\n\nimport { AXPMenuCustomizerComponent, AXPThemeLayoutBlockComponent } from '@acorex-platform/framework-client/layout/components';\nimport {\n AXPPopupLayoutBase,\n AXPPopupLayoutBaseComponent,\n AXPPopupLayoutComponent,\n} from '@acorex-platform/framework-client/layout/views';\n\nimport { Component, computed, signal, viewChild, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';\n\n//#endregion\n\n//#region ---- Menu Customizer Popup Component ----\n\n/**\n * Popup wrapper for the menu customizer component.\n * Provides a popup layout with actions for managing menu customizations.\n *\n * Pass the following data when opening the popup:\n * - scopeKey: string - The scope key for menu customizations\n * - showToolbar?: boolean - Whether to show the toolbar (default: true)\n * - allowAddItems?: boolean - Whether to allow adding items (default: true)\n * - dragBehavior?: AXTreeViewDragBehavior - Drag behavior (default: 'move')\n * - dragArea?: AXTreeViewDragArea - Drag area (default: 'handler')\n */\n@Component({\n selector: 'axp-menu-customizer-popup',\n template: `\n <axp-popup-layout>\n <axp-page-content>\n @if (isReady()) {\n <axp-menu-customizer\n [scopeKey]=\"scopeKey()\"\n [showToolbar]=\"showToolbar()\"\n [allowAddItems]=\"allowAddItems()\"\n [dragBehavior]=\"dragBehavior()\"\n [dragArea]=\"dragArea()\"\n (saved)=\"onSaved()\"\n (cancelled)=\"onCancelled()\"\n ></axp-menu-customizer>\n }\n </axp-page-content>\n </axp-popup-layout>\n `,\n imports: [\n AXTranslationModule,\n AXPPopupLayoutComponent,\n AXPThemeLayoutBlockComponent,\n AXPMenuCustomizerComponent\n],\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: AXPPopupLayoutBase,\n useExisting: AXPMenuCustomizerPopupComponent,\n },\n ],\n changeDetection: ChangeDetectionStrategy.Eager,\n host: { class: 'axp-menu-customizer-popup' },\n})\nexport class AXPMenuCustomizerPopupComponent extends AXPPopupLayoutBaseComponent {\n //#region ---- Component State ----\n\n /** Reference to the menu customizer component */\n protected menuCustomizer = viewChild(AXPMenuCustomizerComponent);\n\n /** The scope key for menu customizations (set by popup service) */\n scopeKey = signal<string>('');\n\n /** Whether to show the toolbar */\n showToolbar = signal<boolean>(true);\n\n /** Whether to allow adding custom items */\n allowAddItems = signal<boolean>(true);\n\n /** Drag behavior for the tree view */\n dragBehavior = signal<AXTreeViewDragBehavior>('both');\n\n /** Drag area for the tree view */\n dragArea = signal<AXTreeViewDragArea>('handler');\n\n /** Whether the component is ready to render (scopeKey is set) */\n protected isReady = computed(() => this.scopeKey() !== '');\n\n //#endregion\n\n //#region ---- Lifecycle Methods ----\n\n override async ngOnInit(): Promise<void> {\n await super.ngOnInit();\n // Popup-specific initialization can go here\n }\n\n //#endregion\n\n //#region ---- UI Handlers ----\n\n /**\n * Returns the primary menu items for the popup layout.\n */\n protected override getPrimaryMenuItems(): AXPActionMenuItem[] | Promise<AXPActionMenuItem[]> {\n return [\n {\n title: '@general:actions.close.title',\n icon: 'fa-solid fa-xmark',\n command: {\n name: 'close',\n },\n },\n ];\n }\n\n /**\n * Handles when changes are saved\n */\n protected onSaved(): void {\n this.close(true);\n }\n\n /**\n * Handles when customization is cancelled\n */\n protected onCancelled(): void {\n this.close(false);\n }\n\n /**\n * Executes popup commands\n */\n override execute(command: AXPExecuteCommand): void | Promise<void> {\n if (command.name === 'close') {\n this.close(false);\n }\n }\n\n //#endregion\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPopupService } from '@acorex/components/popup';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPCommonSettings, AXPSettingsService } from '@acorex-platform/framework-client/common';\nimport {\n AXPCommand,\n entityActionDataRecord,\n resolveEntityActionCommandInput,\n type AXPCommandExecuteResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport { inject, Injectable, signal } from '@angular/core';\n\nimport { AXPMenuCustomizerPopupComponent } from '../components/menu-customizer-popup/menu-customizer-popup.component';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface AXMCustomizeMenuCommandOptions {\n scopePrefix?: string;\n title?: string;\n showToolbar?: boolean;\n allowAddItems?: boolean;\n dragBehavior?: 'none' | 'move' | 'copy' | 'both';\n dragArea?: 'node' | 'handler';\n}\n\nexport interface AXMCustomizeMenuCommandInput {\n data?: Record<string, unknown>;\n options?: AXMCustomizeMenuCommandOptions;\n}\n\n//#endregion\n\n//#region ---- Helpers ----\n\nfunction resolveCustomizeMenuInput(input: AXMCustomizeMenuCommandInput = {}) {\n const resolved = resolveEntityActionCommandInput(input);\n const data = (entityActionDataRecord(resolved.data) ?? {}) as Record<string, unknown>;\n const options = (resolved.options ?? {}) as AXMCustomizeMenuCommandOptions;\n\n return { data, options };\n}\n\n//#endregion\n\n//#region ---- Customize menu command ----\n\n/**\n * Opens the menu customizer popup for an entity scope and shows a success toast on save.\n * Replaces the former `customize-menu` workflow (popup step + success toast).\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMCustomizeMenuCommand implements AXPCommand<AXMCustomizeMenuCommandInput> {\n private readonly popupService = inject(AXPopupService);\n private readonly translateService = inject(AXTranslationService);\n private readonly toastService = inject(AXToastService);\n private readonly settingsService = inject(AXPSettingsService);\n\n async execute(input: AXMCustomizeMenuCommandInput = {}): AXPCommandExecuteResultPromise {\n const { data, options } = resolveCustomizeMenuInput(input);\n const entityId = data['id'];\n\n if (!entityId) {\n return {\n success: false,\n message: { text: 'Menu customizer requires entity data with an id property.' },\n };\n }\n\n const scopePrefix = options.scopePrefix ?? 'entity';\n const scopeKey = `${scopePrefix}:${String(entityId)}`;\n\n const customTitle = options.title;\n const defaultTitle = await this.translateService.translateAsync(\n '@platform-management:menu-management.components.menu-customizer-popup.title',\n );\n const entityTitle = data['title'] ?? data['name'] ?? entityId;\n const title = customTitle ?? `${defaultTitle} - ${entityTitle}`;\n\n const result = await this.popupService.open(AXPMenuCustomizerPopupComponent, {\n title,\n size: 'lg',\n data: {\n scopeKey: signal(scopeKey),\n showToolbar: signal(options.showToolbar ?? true),\n allowAddItems: signal(options.allowAddItems ?? true),\n dragBehavior: signal(options.dragBehavior ?? 'both'),\n dragArea: signal(options.dragArea ?? 'handler'),\n },\n });\n\n if (result?.data !== true) {\n return { success: true, kind: 'object', data: { saved: false } };\n }\n\n await this.showSuccessToast();\n\n return { success: true, kind: 'object', data: { saved: true } };\n }\n\n private async showSuccessToast(): Promise<void> {\n const enableOperationToasts = await this.settingsService.get<boolean>(AXPCommonSettings.EnableOperationToasts);\n if (!enableOperationToasts) {\n return;\n }\n\n this.toastService.show({\n color: 'success',\n title: await this.translateService.translateAsync(\n '@platform-management:menu-management.messages.success.customization-saved',\n ),\n closeButton: true,\n timeOut: 3000,\n timeOutProgress: true,\n });\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;AAeA;AAEA;AAEA;;;;;;;;;;AAUG;AAoCG,MAAO,+BAAgC,SAAQ,2BAA2B,CAAA;AAnChF,IAAA,WAAA,GAAA;;;;QAuCY,IAAA,CAAA,cAAc,GAAG,SAAS,CAAC,0BAA0B;2FAAC;;QAGhE,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAS,EAAE;qFAAC;;QAG7B,IAAA,CAAA,WAAW,GAAG,MAAM,CAAU,IAAI;wFAAC;;QAGnC,IAAA,CAAA,aAAa,GAAG,MAAM,CAAU,IAAI;0FAAC;;QAGrC,IAAA,CAAA,YAAY,GAAG,MAAM,CAAyB,MAAM;yFAAC;;QAGrD,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAqB,SAAS;qFAAC;;QAGtC,IAAA,CAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE;oFAAC;AAsD3D,IAAA;;;AAhDU,IAAA,MAAM,QAAQ,GAAA;AACrB,QAAA,MAAM,KAAK,CAAC,QAAQ,EAAE;;IAExB;;;AAMA;;AAEG;IACgB,mBAAmB,GAAA;QACpC,OAAO;AACL,YAAA;AACE,gBAAA,KAAK,EAAE,8BAA8B;AACrC,gBAAA,IAAI,EAAE,mBAAmB;AACzB,gBAAA,OAAO,EAAE;AACP,oBAAA,IAAI,EAAE,OAAO;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AAI,CAAC,gBAAgB,CAAC,cAAc,CAC/C,2EAA2E,CAC5E;AACD,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,eAAe,EAAE,IAAI;AACtB,SAAA,CAAC;IACJ;8GA/DW,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAvB,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,uBAAuB,cADV,MAAM,EAAA,CAAA,CAAA;;2FACnB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBADnC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-platform-management-client-data-list-pick-entity-item.command-CJVpqPmY.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/commands/data-list-pick-entity-item.command.ts"],"sourcesContent":["import { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\n\nimport { AXPEntityDataSelectorService, AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';\n\nimport { Injectable, inject } from '@angular/core';\n\n//#region ---- Types ----\n\n/** Input for {@link AXPDataListPickEntityItemCommand} (also used from data-list `headerActions` payloads). */\nexport interface AXPDataListPickEntityItemInput {\n /** Full entity key e.g. `PlatformManagement.PropertyDefinition` */\n entity: string;\n title?: string;\n columns?: string[];\n /**\n * Optional context from the host data-list (form list value and paths).\n * Commands may ignore this or use it for advanced flows.\n */\n __dataListContext?: {\n value?: unknown;\n fullPath?: string | null;\n parentPath?: string | null;\n };\n}\n\nexport interface AXPDataListPickEntityItemOutput {\n items: Record<string, unknown>[];\n}\n\n//#endregion\n\n//#region ---- Command ----\n\n/**\n * Opens the standard entity data-selector; returns selected rows for data-list header `command` actions.\n * Registered as `PlatformManagement:DataListPickEntityItem`.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXPDataListPickEntityItemCommand\n implements AXPCommand<AXPDataListPickEntityItemInput, AXPDataListPickEntityItemOutput>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly registry = inject(AXPEntityDefinitionRegistryService);\n private readonly selector = inject(AXPEntityDataSelectorService);\n\n //#endregion\n\n //#region ---- Execution ----\n\n async execute(\n input: AXPDataListPickEntityItemInput,\n ): AXPCommandExecuteResultPromise<AXPDataListPickEntityItemOutput> {\n const key = input.entity?.trim() ?? '';\n const dot = key.indexOf('.');\n if (dot < 0 || dot === key.length - 1) {\n return {\n success: false,\n message: { text: 'Invalid entity identifier' },\n };\n }\n\n const moduleName = key.slice(0, dot);\n const entityName = key.slice(dot + 1);\n const entity = await this.registry.resolve(moduleName, entityName);\n const defaultTitle = typeof entity.title === 'string' ? entity.title : entity.name;\n\n const result = await this.selector.open({\n entity,\n title: input.title ?? defaultTitle,\n columns: input.columns,\n });\n\n const items = (result?.items ?? []) as Record<string, unknown>[];\n if (!items.length) {\n return { success: false };\n }\n\n return { success: true, kind: 'object', data: { items } };\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;AA8BA;AAEA;AAEA;;;AAGG;MAEU,gCAAgC,CAAA;AAD7C,IAAA,WAAA,GAAA;;AAMmB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,kCAAkC,CAAC;AACrD,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,4BAA4B,CAAC;AAsCjE,IAAA;;;IAhCC,MAAM,OAAO,CACX,KAAqC,EAAA;QAErC,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE;QACtC,MAAM,GAAG,GAAG,GA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AAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,cADnB,MAAM,EAAA,CAAA,CAAA;;2FACnB,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAD5C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-platform-management-client-data-list-pick-entity-item.command-CJVpqPmY.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/commands/data-list-pick-entity-item.command.ts"],"sourcesContent":["import { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\n\nimport { AXPEntityDataSelectorService, AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';\n\nimport { Injectable, inject } from '@angular/core';\n\n//#region ---- Types ----\n\n/** Input for {@link AXPDataListPickEntityItemCommand} (also used from data-list `headerActions` payloads). */\nexport interface AXPDataListPickEntityItemInput {\n /** Full entity key e.g. `PlatformManagement.PropertyDefinition` */\n entity: string;\n title?: string;\n columns?: string[];\n /**\n * Optional context from the host data-list (form list value and paths).\n * Commands may ignore this or use it for advanced flows.\n */\n __dataListContext?: {\n value?: unknown;\n fullPath?: string | null;\n parentPath?: string | null;\n };\n}\n\nexport interface AXPDataListPickEntityItemOutput {\n items: Record<string, unknown>[];\n}\n\n//#endregion\n\n//#region ---- Command ----\n\n/**\n * Opens the standard entity data-selector; returns selected rows for data-list header `command` actions.\n * Registered as `PlatformManagement:DataListPickEntityItem`.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXPDataListPickEntityItemCommand\n implements AXPCommand<AXPDataListPickEntityItemInput, AXPDataListPickEntityItemOutput>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly registry = inject(AXPEntityDefinitionRegistryService);\n private readonly selector = inject(AXPEntityDataSelectorService);\n\n //#endregion\n\n //#region ---- Execution ----\n\n async execute(\n input: AXPDataListPickEntityItemInput,\n ): AXPCommandExecuteResultPromise<AXPDataListPickEntityItemOutput> {\n const key = input.entity?.trim() ?? '';\n const dot = key.indexOf('.');\n if (dot < 0 || dot === key.length - 1) {\n return {\n success: false,\n message: { text: 'Invalid entity identifier' },\n };\n }\n\n const moduleName = key.slice(0, dot);\n const entityName = key.slice(dot + 1);\n const entity = await this.registry.resolve(moduleName, entityName);\n const defaultTitle = typeof entity.title === 'string' ? entity.title : entity.name;\n\n const result = await this.selector.open({\n entity,\n title: input.title ?? defaultTitle,\n columns: input.columns,\n });\n\n const items = (result?.items ?? []) as Record<string, unknown>[];\n if (!items.length) {\n return { success: false };\n }\n\n return { success: true, kind: 'object', data: { items } };\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;AA8BA;AAEA;AAEA;;;AAGG;MAEU,gCAAgC,CAAA;AAD7C,IAAA,WAAA,GAAA;;AAMmB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,kCAAkC,CAAC;AACrD,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,4BAA4B,CAAC;AAsCjE,IAAA;;;IAhCC,MAAM,OAAO,CACX,KAAqC,EAAA;QAErC,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE;QACtC,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC;AAC5B,QAAA,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE;YACrC,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,2BAA2B,EAAE;aAC/C;QACH;QAEA,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC;QACpC,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC;AACrC,QAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC;QAClE,MAAM,YAAY,GAAG,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,GAAG,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI;QAElF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;YACtC,MAAM;AACN,YAAA,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,YAAY;YAClC,OAAO,EAAE,KAAK,CAAC,OAAO;AACvB,SAAA,CAAC;QAEF,MAAM,KAAK,IAAI,MAAM,EAAE,KAAK,IAAI,EAAE,CAA8B;AAChE,QAAA,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;AACjB,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;QAC3B;AAEA,QAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE;IAC3D;8GAzCW,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAhC,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,gCAAgC,cADnB,MAAM,EAAA,CAAA,CAAA;;2FACnB,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAD5C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-platform-management-client-entity-master-actions-for-ai.util-DmGyoy9o.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/features/queries/entity-master-actions-for-ai.util.ts"],"sourcesContent":["import { AXPEntity, AXPEntityAction } from '@acorex-platform/framework-shared/entity';\n//#region ---- Imports ----\n\n//#endregion\n\n//#region ---- Types ----\n\n/**\n * Resolved master UI action for AI grounding — list toolbar vs detail (single) toolbar.\n */\nexport interface AXMEntityMasterActionAiSummary {\n /** User-visible caption (resolved from {@link AXPEntityAction.title} when possible). */\n resolvedTitle: string;\n /** Original entity action title (often `@scope:key`). */\n titleKey: string;\n /** Typical command key when known (see {@link AXPEntityAction.command}). */\n commandName?: string;\n /** {@link AXPEntityAction.type} (e.g. create, delete, view). */\n actionKind?: string;\n /** {@link AXPEntityAction.scope}. */\n actionScope?: string;\n}\n\n//#endregion\n\n//#region ---- Helpers ----\n\nfunction resolveCommandName(action: AXPEntityAction): string | undefined {\n const cmd = action.command;\n if (typeof cmd === 'object' && cmd != null && typeof cmd.name === 'string') {\n return cmd.name.trim() || undefined;\n }\n return undefined;\n}\n\nfunction collectActionsRecursive(\n actions: AXPEntityAction[] | undefined,\n translate: (key: string) => string,\n out: AXMEntityMasterActionAiSummary[],\n depth = 0,\n): void {\n if (!actions?.length || depth > 10) {\n return;\n }\n for (const a of actions) {\n const cmdName = resolveCommandName(a);\n try {\n out.push({\n resolvedTitle: translate(a.title),\n titleKey: a.title,\n ...(cmdName ? { commandName: cmdName } : {}),\n ...(typeof a.type === 'string' && a.type.trim().length ? { actionKind: a.type } : {}),\n ...(typeof a.scope === 'string' ? { actionScope: a.scope } : {}),\n });\n } catch {\n out.push({\n resolvedTitle: a.title,\n titleKey: a.title,\n ...(cmdName ? { commandName: cmdName } : {}),\n ...(typeof a.type === 'string' && a.type.trim().length ? { actionKind: a.type } : {}),\n ...(typeof a.scope === 'string' ? { actionScope: a.scope } : {}),\n });\n }\n if (a.items?.length) {\n collectActionsRecursive(a.items, translate, out, depth + 1);\n }\n }\n}\n\n//#endregion\n\n//#region ---- Public API ----\n\n/** Master interface list + detail (single) actions from an entity definition, for read-only grounding. */\nexport interface AXMEntityMasterUiActionsForAi {\n listToolbar: AXMEntityMasterActionAiSummary[];\n recordToolbar: AXMEntityMasterActionAiSummary[];\n}\n\n/**\n * Builds stable action labels derived from {@link AXPEntity.interfaces.master} list/single layouts.\n */\nexport function axmSummarizeMasterUiActionsForAi(\n entity: AXPEntity,\n translateWithFallback: (key: string) => string,\n): AXMEntityMasterUiActionsForAi {\n const listToolbar: AXMEntityMasterActionAiSummary[] = [];\n const recordToolbar: AXMEntityMasterActionAiSummary[] = [];\n\n collectActionsRecursive(\n entity.interfaces?.master?.list?.actions,\n translateWithFallback,\n listToolbar,\n );\n collectActionsRecursive(\n entity.interfaces?.master?.single?.actions,\n translateWithFallback,\n recordToolbar,\n );\n\n return {\n listToolbar,\n recordToolbar,\n };\n}\n\n//#endregion\n"],"names":[],"mappings":"AAuBA;AAEA;AAEA,SAAS,kBAAkB,CAAC,MAAuB,EAAA;AACjD,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO;AAC1B,IAAA,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,IAAI,IAAI,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;QAC1E,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,SAAS;IACrC;AACA,IAAA,OAAO,SAAS;AAClB;AAEA,SAAS,uBAAuB,CAC9B,OAAsC,EACtC,SAAkC,EAClC,GAAqC,EACrC,KAAK,GAAG,CAAC,EAAA;IAET,IAAI,CAAC,OAAO,EAAE,MAAM,IAAI,KAAK,GAAG,EAAE,EAAE;QAClC;IACF;AACA,IAAA,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;AACvB,QAAA,MAAM,OAAO,GAAG,kBAAkB,CAAC,CAAC,CAAC;AACrC,QAAA,IAAI;YACF,GAAG,CAAC,IAAI,CAAC;AACP,gBAAA,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;gBACjC,QAAQ,EAAE,CAAC,CAAC,KAAK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uBAAuB,CACrB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EACxC,qBAAqB,EACrB,WAAW,CACZ;AACD,IAAA,uBAAuB,CACrB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAC1C,qBAAqB,EACrB,aAAa,CACd;IAED,OAAO;QACL,WAAW;QACX,aAAa;KACd;AACH;AAEA
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-platform-management-client-entity-master-actions-for-ai.util-DmGyoy9o.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/features/queries/entity-master-actions-for-ai.util.ts"],"sourcesContent":["import { AXPEntity, AXPEntityAction } from '@acorex-platform/framework-shared/entity';\n//#region ---- Imports ----\n\n//#endregion\n\n//#region ---- Types ----\n\n/**\n * Resolved master UI action for AI grounding — list toolbar vs detail (single) toolbar.\n */\nexport interface AXMEntityMasterActionAiSummary {\n /** User-visible caption (resolved from {@link AXPEntityAction.title} when possible). */\n resolvedTitle: string;\n /** Original entity action title (often `@scope:key`). */\n titleKey: string;\n /** Typical command key when known (see {@link AXPEntityAction.command}). */\n commandName?: string;\n /** {@link AXPEntityAction.type} (e.g. create, delete, view). */\n actionKind?: string;\n /** {@link AXPEntityAction.scope}. */\n actionScope?: string;\n}\n\n//#endregion\n\n//#region ---- Helpers ----\n\nfunction resolveCommandName(action: AXPEntityAction): string | undefined {\n const cmd = action.command;\n if (typeof cmd === 'object' && cmd != null && typeof cmd.name === 'string') {\n return cmd.name.trim() || undefined;\n }\n return undefined;\n}\n\nfunction collectActionsRecursive(\n actions: AXPEntityAction[] | undefined,\n translate: (key: string) => string,\n out: AXMEntityMasterActionAiSummary[],\n depth = 0,\n): void {\n if (!actions?.length || depth > 10) {\n return;\n }\n for (const a of actions) {\n const cmdName = resolveCommandName(a);\n try {\n out.push({\n resolvedTitle: translate(a.title),\n titleKey: a.title,\n ...(cmdName ? { commandName: cmdName } : {}),\n ...(typeof a.type === 'string' && a.type.trim().length ? { actionKind: a.type } : {}),\n ...(typeof a.scope === 'string' ? { actionScope: a.scope } : {}),\n });\n } catch {\n out.push({\n resolvedTitle: a.title,\n titleKey: a.title,\n ...(cmdName ? { commandName: cmdName } : {}),\n ...(typeof a.type === 'string' && a.type.trim().length ? { actionKind: a.type } : {}),\n ...(typeof a.scope === 'string' ? { actionScope: a.scope } : {}),\n });\n }\n if (a.items?.length) {\n collectActionsRecursive(a.items, translate, out, depth + 1);\n }\n }\n}\n\n//#endregion\n\n//#region ---- Public API ----\n\n/** Master interface list + detail (single) actions from an entity definition, for read-only grounding. */\nexport interface AXMEntityMasterUiActionsForAi {\n listToolbar: AXMEntityMasterActionAiSummary[];\n recordToolbar: AXMEntityMasterActionAiSummary[];\n}\n\n/**\n * Builds stable action labels derived from {@link AXPEntity.interfaces.master} list/single layouts.\n */\nexport function axmSummarizeMasterUiActionsForAi(\n entity: AXPEntity,\n translateWithFallback: (key: string) => string,\n): AXMEntityMasterUiActionsForAi {\n const listToolbar: AXMEntityMasterActionAiSummary[] = [];\n const recordToolbar: AXMEntityMasterActionAiSummary[] = [];\n\n collectActionsRecursive(\n entity.interfaces?.master?.list?.actions,\n translateWithFallback,\n listToolbar,\n );\n collectActionsRecursive(\n entity.interfaces?.master?.single?.actions,\n translateWithFallback,\n recordToolbar,\n );\n\n return {\n listToolbar,\n recordToolbar,\n };\n}\n\n//#endregion\n"],"names":[],"mappings":"AAuBA;AAEA;AAEA,SAAS,kBAAkB,CAAC,MAAuB,EAAA;AACjD,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO;AAC1B,IAAA,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,IAAI,IAAI,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;QAC1E,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,SAAS;IACrC;AACA,IAAA,OAAO,SAAS;AAClB;AAEA,SAAS,uBAAuB,CAC9B,OAAsC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E,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC;AACjE,aAAA,CAAC;QACJ;AACA,QAAA,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE;AACnB,YAAA,uBAAuB,CAAC,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC;QAC7D;IACF;AACF;AAYA;;AAEG;AACG,SAAU,gCAAgC,CAC9C,MAAiB,EACjB,qBAA8C,EAAA;IAE9C,MAAM,WAAW,GAAqC,EAAE;IACxD,MAAM,aAAa,GAAqC,EAAE;AAE1D,IAAA,uBAAuB,CACrB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EACxC,qBAAqB,EACrB,WAAW,CACZ;AACD,IAAA,uBAAuB,CACrB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAC1C,qBAAqB,EACrB,aAAa,CACd;IAED,OAAO;QACL,WAAW;QACX,aAAa;KACd;AACH;AAEA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-platform-management-client-execute-token.command-B_xwW9lb.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/features/token/commands/execute-token.command.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { runtimeCommandPayloadData } from '@acorex-platform/framework-shared/core';\nimport { AXPCommandExecutor } from '@acorex-platform/framework-client/runtime';\nimport { AXPLayoutBuilderService, IWidgetBuilder } from '@acorex-platform/framework-client/layout/builder';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { Injectable, inject } from '@angular/core';\nimport {\n AXM_TOKEN_RESOLVE_COMMAND_KEY,\n type AXMTokenResolveRequest,\n type AXMTokenResolveResult,\n} from '@acorex-platform/module-platform-management-client/contracts';\n\n//#endregion\n\n//#region ----- Command Input/Output Types -----\n\n/**\n * Input for ExecuteToken command.\n */\nexport interface ExecuteTokenCommandInput {\n /**\n * Token name to execute.\n */\n tokenName?: string;\n\n /**\n * Token title (for display).\n */\n tokenTitle?: string;\n data?: { name?: string; title?: string };\n options?: Partial<ExecuteTokenCommandInput>;\n}\n\n//#endregion\n\n//#region ----- Execute Token Command -----\n\n/**\n * UI command: resolves token value on the server, then shows the result in a dialog.\n */\n@Injectable()\nexport class ExecuteTokenCommand implements AXPCommand<ExecuteTokenCommandInput, void> {\n //#region ----- Services & Dependencies -----\n\n private readonly commandExecutor = inject(AXPCommandExecutor);\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ----- Command Implementation -----\n\n async execute(raw: ExecuteTokenCommandInput): AXPCommandExecuteResultPromise<void> {\n try {\n const input = resolveExecuteTokenInput(raw);\n const tokenName = input.tokenName?.trim() ?? '';\n\n if (!tokenName) {\n const failedTitle = await this.translationService.translateAsync(\n '@platform-management:tokens.messages.execute-failed.title',\n );\n const failedContent = await this.translationService.translateAsync(\n '@platform-management:tokens.messages.execute-failed.content',\n { params: { tokenName: 'undefined' } },\n );\n\n this.toastService.show({\n color: 'warning',\n title: failedTitle,\n content: failedContent,\n closeButton: true,\n timeOut: 5000,\n });\n\n return {\n success: false,\n message: { text: failedContent },\n };\n }\n\n const resolveResult = await this.commandExecutor.execute<\n AXMTokenResolveRequest,\n AXMTokenResolveResult\n >(AXM_TOKEN_RESOLVE_COMMAND_KEY, { tokenName });\n\n const __d_resolveResult = runtimeCommandPayloadData(resolveResult);\n const tokenValue = __d_resolveResult?.value;\n const serverMessage =\n typeof resolveResult?.message?.text === 'string' ? resolveResult.message.text.trim() : '';\n\n if (!resolveResult?.success || tokenValue === undefined || tokenValue === null) {\n const failedTitle = await this.translationService.translateAsync(\n '@platform-management:tokens.messages.execute-failed.title',\n );\n const fallbackContent = await this.translationService.translateAsync(\n '@platform-management:tokens.messages.execute-failed.content',\n { params: { tokenName } },\n );\n // Prefer the server reason (e.g. missing expression scope) over the generic empty-value copy.\n const failedContent = serverMessage || fallbackContent;\n\n this.toastService.show({\n color: 'warning',\n title: failedTitle,\n content: failedContent,\n closeButton: true,\n timeOut: 5000,\n });\n\n return {\n success: false,\n message: {\n text: failedContent,\n },\n };\n }\n\n const isObjectValue = tokenValue !== null && typeof tokenValue === 'object';\n const displayValue = isObjectValue ? tokenValue : this.formatValueAsString(tokenValue);\n\n const dialogTitleKey = '@platform-management:tokens.components.execute-token-dialog.title';\n const dialogTitleBase = await this.translationService.translateAsync(dialogTitleKey);\n const dialogTitle = `${dialogTitleBase}: ${tokenName}`;\n\n await this.layoutBuilder\n .create()\n .dialog((dialog) => {\n dialog\n .setTitle(dialogTitle)\n .setSize('lg')\n .setCloseButton(true)\n .content((content) => {\n content.customWidget('json-viewer', (widget: IWidgetBuilder) => {\n widget.path('value');\n });\n })\n .setContext({\n value: displayValue,\n });\n })\n .show();\n\n return {\n success: true,\n kind: 'object',\n data: undefined,\n metadata: { refresh: false },\n };\n } catch (error: any) {\n const errorTitle = await this.translationService.translateAsync(\n '@platform-management:tokens.messages.execute-error.title',\n );\n const errorContent = await this.translationService.translateAsync(\n '@platform-management:tokens.messages.execute-error.content',\n { params: { error: error.message || 'Unknown error' } },\n );\n\n this.toastService.show({\n color: 'danger',\n title: errorTitle,\n content: errorContent,\n closeButton: true,\n timeOut: 5000,\n });\n\n return {\n success: false,\n message: {\n text: errorContent,\n },\n };\n }\n }\n\n //#endregion\n\n //#region ----- Utility Methods -----\n\n private formatValueAsString(value: any): string {\n if (value === null || value === undefined) {\n return '';\n }\n\n if (typeof value === 'string') {\n return value;\n }\n\n if (typeof value === 'object') {\n try {\n return JSON.stringify(value, null, 2);\n } catch {\n return String(value);\n }\n }\n\n return String(value);\n }\n\n //#endregion\n}\n\nfunction resolveExecuteTokenInput(raw: ExecuteTokenCommandInput): ExecuteTokenCommandInput {\n const options = raw?.options;\n const data = raw?.data;\n return {\n tokenName: options?.tokenName ?? raw?.tokenName ?? data?.name ?? '',\n tokenTitle: options?.tokenTitle ?? raw?.tokenTitle ?? data?.title,\n };\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;AAoCA;AAEA;AAEA;;AAEG;MAEU,mBAAmB,CAAA;AADhC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAC5C,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAC/C,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAyJnE,IAAA;;;IAnJC,MAAM,OAAO,CAAC,GAA6B,EAAA;AACzC,QAAA,IAAI;AACF,YAAA,MAAM,KAAK,GAAG,wBAAwB,CAAC,GAAG,CAAC;YAC3C,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE;YAE/C,IAAI,CAAC,SAAS,EAAE;gBACd,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAC9D,2DAA2D,CAC5D;gBACD,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAChE,6DAA6D,EAC7D,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,CACvC;AAED,gBAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;AACrB,oBAAA,KAAK,EAAE,SAAS;AAChB,oBAAA,KAAK,EAAE,WAAW;AAClB,oBAAA,OAAO,EAAE,aAAa;AACtB,oBAAA,WAAW,EAAE,IAAI;AACjB,oBAAA,OAAO,EAAE,IAAI;AACd,iBAAA,CAAC;gBAEF,OAAO;AACL,oBAAA,OAAO,EAAE,KAAK;AACd,o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,EAAE;QACnE,UAAU,EAAE,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,UAAU,IAAI,IAAI,EAAE,KAAK;KAClE;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-platform-management-client-execute-token.command-B_xwW9lb.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/features/token/commands/execute-token.command.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { runtimeCommandPayloadData } from '@acorex-platform/framework-shared/core';\nimport { AXPCommandExecutor } from '@acorex-platform/framework-client/runtime';\nimport { AXPLayoutBuilderService, IWidgetBuilder } from '@acorex-platform/framework-client/layout/builder';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { Injectable, inject } from '@angular/core';\nimport {\n AXM_TOKEN_RESOLVE_COMMAND_KEY,\n type AXMTokenResolveRequest,\n type AXMTokenResolveResult,\n} from '@acorex-platform/module-platform-management-client/contracts';\n\n//#endregion\n\n//#region ----- Command Input/Output Types -----\n\n/**\n * Input for ExecuteToken command.\n */\nexport interface ExecuteTokenCommandInput {\n /**\n * Token name to execute.\n */\n tokenName?: string;\n\n /**\n * Token title (for display).\n */\n tokenTitle?: string;\n data?: { name?: string; title?: string };\n options?: Partial<ExecuteTokenCommandInput>;\n}\n\n//#endregion\n\n//#region ----- Execute Token Command -----\n\n/**\n * UI command: resolves token value on the server, then shows the result in a dialog.\n */\n@Injectable()\nexport class ExecuteTokenCommand implements AXPCommand<ExecuteTokenCommandInput, void> {\n //#region ----- Services & Dependencies -----\n\n private readonly commandExecutor = inject(AXPCommandExecutor);\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ----- Command Implementation -----\n\n async execute(raw: ExecuteTokenCommandInput): AXPCommandExecuteResultPromise<void> {\n try {\n const input = resolveExecuteTokenInput(raw);\n const tokenName = input.tokenName?.trim() ?? '';\n\n if (!tokenName) {\n const failedTitle = await this.translationService.translateAsync(\n '@platform-management:tokens.messages.execute-failed.title',\n );\n const failedContent = await this.translationService.translateAsync(\n '@platform-management:tokens.messages.execute-failed.content',\n { params: { tokenName: 'undefined' } },\n );\n\n this.toastService.show({\n color: 'warning',\n title: failedTitle,\n content: failedContent,\n closeButton: true,\n timeOut: 5000,\n });\n\n return {\n success: false,\n message: { text: failedContent },\n };\n }\n\n const resolveResult = await this.commandExecutor.execute<\n AXMTokenResolveRequest,\n AXMTokenResolveResult\n >(AXM_TOKEN_RESOLVE_COMMAND_KEY, { tokenName });\n\n const __d_resolveResult = runtimeCommandPayloadData(resolveResult);\n const tokenValue = __d_resolveResult?.value;\n const serverMessage =\n typeof resolveResult?.message?.text === 'string' ? resolveResult.message.text.trim() : '';\n\n if (!resolveResult?.success || tokenValue === undefined || tokenValue === null) {\n const failedTitle = await this.translationService.translateAsync(\n '@platform-management:tokens.messages.execute-failed.title',\n );\n const fallbackContent = await this.translationService.translateAsync(\n '@platform-management:tokens.messages.execute-failed.content',\n { params: { tokenName } },\n );\n // Prefer the server reason (e.g. missing expression scope) over the generic empty-value copy.\n const failedContent = serverMessage || fallbackContent;\n\n this.toastService.show({\n color: 'warning',\n title: failedTitle,\n content: failedContent,\n closeButton: true,\n timeOut: 5000,\n });\n\n return {\n success: false,\n message: {\n text: failedContent,\n },\n };\n }\n\n const isObjectValue = tokenValue !== null && typeof tokenValue === 'object';\n const displayValue = isObjectValue ? tokenValue : this.formatValueAsString(tokenValue);\n\n const dialogTitleKey = '@platform-management:tokens.components.execute-token-dialog.title';\n const dialogTitleBase = await this.translationService.translateAsync(dialogTitleKey);\n const dialogTitle = `${dialogTitleBase}: ${tokenName}`;\n\n await this.layoutBuilder\n .create()\n .dialog((dialog) => {\n dialog\n .setTitle(dialogTitle)\n .setSize('lg')\n .setCloseButton(true)\n .content((content) => {\n content.customWidget('json-viewer', (widget: IWidgetBuilder) => {\n widget.path('value');\n });\n })\n .setContext({\n value: displayValue,\n });\n })\n .show();\n\n return {\n success: true,\n kind: 'object',\n data: undefined,\n metadata: { refresh: false },\n };\n } catch (error: any) {\n const errorTitle = await this.translationService.translateAsync(\n '@platform-management:tokens.messages.execute-error.title',\n );\n const errorContent = await this.translationService.translateAsync(\n '@platform-management:tokens.messages.execute-error.content',\n { params: { error: error.message || 'Unknown error' } },\n );\n\n this.toastService.show({\n color: 'danger',\n title: errorTitle,\n content: errorContent,\n closeButton: true,\n timeOut: 5000,\n });\n\n return {\n success: false,\n message: {\n text: errorContent,\n },\n };\n }\n }\n\n //#endregion\n\n //#region ----- Utility Methods -----\n\n private formatValueAsString(value: any): string {\n if (value === null || value === undefined) {\n return '';\n }\n\n if (typeof value === 'string') {\n return value;\n }\n\n if (typeof value === 'object') {\n try {\n return JSON.stringify(value, null, 2);\n } catch {\n return String(value);\n }\n }\n\n return String(value);\n }\n\n //#endregion\n}\n\nfunction resolveExecuteTokenInput(raw: ExecuteTokenCommandInput): ExecuteTokenCommandInput {\n const options = raw?.options;\n const data = raw?.data;\n return {\n tokenName: options?.tokenName ?? raw?.tokenName ?? data?.name ?? '',\n tokenTitle: options?.tokenTitle ?? raw?.tokenTitle ?? data?.title,\n };\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;AAoCA;AAEA;AAEA;;AAEG;MAEU,mBAAmB,CAAA;AADhC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAC5C,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAC/C,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAyJnE,IAAA;;;IAnJC,MAAM,OAAO,CAAC,GAA6B,EAAA;AACzC,Q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AK,QAAQ,EAAE;AAC7B,YAAA,IAAI;gBACF,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACvC;AAAE,YAAA,MAAM;AACN,gBAAA,OAAO,MAAM,CAAC,KAAK,CAAC;YACtB;QACF;AAEA,QAAA,OAAO,MAAM,CAAC,KAAK,CAAC;IACtB;8GA5JW,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAnB,mBAAmB,EAAA,CAAA,CAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAD/B;;AAkKD,SAAS,wBAAwB,CAAC,GAA6B,EAAA;AAC7D,IAAA,MAAM,OAAO,GAAG,GAAG,EAAE,OAAO;AAC5B,IAAA,MAAM,IAAI,GAAG,GAAG,EAAE,IAAI;IACtB,OAAO;AACL,QAAA,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,GAAG,EAAE,SAAS,IAAI,IAAI,EAAE,IAAI,IAAI,EAAE;QACnE,UAAU,EAAE,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,UAAU,IAAI,IAAI,EAAE,KAAK;KAClE;AACH;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-platform-management-client-list-catalog-scopes.query-ByhDTWE6.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/features/queries/list-catalog-scopes.query.ts"],"sourcesContent":["import {\n resolveCollectionSkip,\n resolveCollectionTake,\n type AXPCollectionQuery,\n type AXPCollectionQueryInput,\n type AXPQueryCollectionFetchResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n runtimeQueryFailure,\n runtimeQuerySuccessCollection,\n} from '@acorex-platform/framework-shared/core';\nimport {\n applyFilterArray,\n applySortArray,\n AXPCatalogScopeDefinitionProviderService,\n type AXPCatalogScopeDefinition,\n} from '@acorex-platform/framework-client/core';\n\nimport { Injectable, inject } from '@angular/core';\n\n//#region ---- Types ----\n\nexport interface AXMListCatalogScopesQueryInput extends AXPCollectionQueryInput {\n /** Optional `Module.Entity` — keep scopes whose `targets` include this ref. */\n target?: string;\n}\n\nexport interface AXMListCatalogScopesQueryItem {\n name: string;\n title: string;\n description?: AXPCatalogScopeDefinition['description'];\n targets: string[];\n icon?: string;\n cssClass?: string;\n}\n\n//#endregion\n\n//#region ---- Query ----\n\n/**\n * Lists catalog-scope definitions registered with {@link AXPCatalogScopeDefinitionProviderService}.\n * Same row shape as the former `platform-catalog-scopes` registry data source.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListCatalogScopesQuery\n implements AXPCollectionQuery<AXMListCatalogScopesQueryInput, AXMListCatalogScopesQueryItem>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly catalogScopeRegistry = inject(AXPCatalogScopeDefinitionProviderService);\n\n //#endregion\n\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListCatalogScopesQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListCatalogScopesQueryItem> {\n try {\n const all = await this.catalogScopeRegistry.items();\n const target = input?.target?.trim() || this.readTargetFilter(input?.filter);\n\n let items: AXMListCatalogScopesQueryItem[] = all\n .filter((scope) => !target || scope.targets?.includes(target))\n .map((scope) => ({\n name: scope.name,\n title: this.catalogScopeRegistry.resolveTitle(scope),\n description: scope.description,\n targets: scope.targets,\n icon: scope.icon,\n cssClass: scope.cssClass,\n }));\n\n if (input?.filter && this.readTargetFilter(input.filter) == null) {\n items = applyFilterArray(items, [input.filter]);\n }\n\n const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];\n const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'name' as const, dir: 'asc' as const }];\n items = applySortArray(items, sortOpt);\n\n const skip = resolveCollectionSkip(input?.skip);\n const take = resolveCollectionTake(input?.take);\n const total = items.length;\n const page = items.slice(skip, skip + take);\n\n return runtimeQuerySuccessCollection({ items: page, total });\n } catch (error) {\n return runtimeQueryFailure(\n error instanceof Error ? error.message : 'Unknown error occurred',\n );\n }\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private readTargetFilter(filter: unknown): string | undefined {\n if (!filter || typeof filter !== 'object') {\n return undefined;\n }\n const f = filter as { field?: string; value?: unknown };\n if (f.field === 'targets' && typeof f.value === 'string' && f.value.trim()) {\n return f.value.trim();\n }\n return undefined;\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;AAoCA;AAEA;AAEA;;;AAGG;MAEU,yBAAyB,CAAA;AADtC,IAAA,WAAA,GAAA;;AAMmB,QAAA,IAAA,CAAA,oBAAoB,GAAG,MAAM,CAAC,wCAAwC,CAAC;AA6DzF,IAAA;;;IAvDC,MAAM,KAAK,CACT,KAA6C,EAAA;AAE7C,QAAA,IAAI;YACF,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE;AACnD,YAAA,MAAM,MAAM,GAAG,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC;YAE5E,IAAI,KAAK,GAAoC;AAC1C,iBAAA,MAAM,CAAC,CAAC,KAAK,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC;AAC5D,iBAAA,GAAG,CAAC,CAAC,KAAK,MAAM;gBACf,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,KAAK,EAAE,IAAI,CAAC,oBAAoB,CAAC,YAAY,CAAC,KAAK,CAAC;gBACpD,WAAW,EAAE,KAAK,CAAC,WAAW;gBAC9B,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ;AACzB,aAAA,CAAC,CAAC;AAEL,YAAA,IAAI,KAAK,EAAE,MAAM,IAAI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,CAAC,KAAK,KAAK,QAAQ,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE;AAC1E,YAAA,OAAO,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE;QACvB;AACA,QAAA,OAAO,SAAS;IAClB;8GA/DW,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAzB,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,yBAAyB,cADZ,MAAM,EAAA,CAAA,CAAA;;2FACnB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-platform-management-client-list-catalog-scopes.query-ByhDTWE6.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/features/queries/list-catalog-scopes.query.ts"],"sourcesContent":["import {\n resolveCollectionSkip,\n resolveCollectionTake,\n type AXPCollectionQuery,\n type AXPCollectionQueryInput,\n type AXPQueryCollectionFetchResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n runtimeQueryFailure,\n runtimeQuerySuccessCollection,\n} from '@acorex-platform/framework-shared/core';\nimport {\n applyFilterArray,\n applySortArray,\n AXPCatalogScopeDefinitionProviderService,\n type AXPCatalogScopeDefinition,\n} from '@acorex-platform/framework-client/core';\n\nimport { Injectable, inject } from '@angular/core';\n\n//#region ---- Types ----\n\nexport interface AXMListCatalogScopesQueryInput extends AXPCollectionQueryInput {\n /** Optional `Module.Entity` — keep scopes whose `targets` include this ref. */\n target?: string;\n}\n\nexport interface AXMListCatalogScopesQueryItem {\n name: string;\n title: string;\n description?: AXPCatalogScopeDefinition['description'];\n targets: string[];\n icon?: string;\n cssClass?: string;\n}\n\n//#endregion\n\n//#region ---- Query ----\n\n/**\n * Lists catalog-scope definitions registered with {@link AXPCatalogScopeDefinitionProviderService}.\n * Same row shape as the former `platform-catalog-scopes` registry data source.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListCatalogScopesQuery\n implements AXPCollectionQuery<AXMListCatalogScopesQueryInput, AXMListCatalogScopesQueryItem>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly catalogScopeRegistry = inject(AXPCatalogScopeDefinitionProviderService);\n\n //#endregion\n\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListCatalogScopesQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListCatalogScopesQueryItem> {\n try {\n const all = await this.catalogScopeRegistry.items();\n const target = input?.target?.trim() || this.readTargetFilter(input?.filter);\n\n let items: AXMListCatalogScopesQueryItem[] = all\n .filter((scope) => !target || scope.targets?.includes(target))\n .map((scope) => ({\n name: scope.name,\n title: this.catalogScopeRegistry.resolveTitle(scope),\n description: scope.description,\n targets: scope.targets,\n icon: scope.icon,\n cssClass: scope.cssClass,\n }));\n\n if (input?.filter && this.readTargetFilter(input.filter) == null) {\n items = applyFilterArray(items, [input.filter]);\n }\n\n const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];\n const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'name' as const, dir: 'asc' as const }];\n items = applySortArray(items, sortOpt);\n\n const skip = resolveCollectionSkip(input?.skip);\n const take = resolveCollectionTake(input?.take);\n const total = items.length;\n const page = items.slice(skip, skip + take);\n\n return runtimeQuerySuccessCollection({ items: page, total });\n } catch (error) {\n return runtimeQueryFailure(\n error instanceof Error ? error.message : 'Unknown error occurred',\n );\n }\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private readTargetFilter(filter: unknown): string | undefined {\n if (!filter || typeof filter !== 'object') {\n return undefined;\n }\n const f = filter as { field?: string; value?: unknown };\n if (f.field === 'targets' && typeof f.value === 'string' && f.value.tr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,CAAA,UAAA,EAAA,CAAA,CAAA;AAAzB,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,yBAAyB,cADZ,MAAM,EAAA,CAAA,CAAA;;2FACnB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-platform-management-client-list-editor-widgets.query-DITPMmbw.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/features/queries/list-editor-widgets.query.ts"],"sourcesContent":["import {\n resolveCollectionSkip,\n resolveCollectionTake,\n type AXPCollectionQuery,\n type AXPCollectionQueryInput,\n type AXPQueryCollectionFetchResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n resolveMultiLanguageString,\n runtimeQueryFailure,\n runtimeQuerySuccessCollection,\n} from '@acorex-platform/framework-shared/core';\nimport { applyFilterArray, applySortArray } from '@acorex-platform/framework-client/core';\nimport { AXPWidgetRegistryService } from '@acorex-platform/framework-client/layout/widget-core';\n\nimport { Injectable, inject } from '@angular/core';\n\n//#region ---- Types ----\n\nexport type AXMListEditorWidgetsQueryInput = AXPCollectionQueryInput;\n\nexport interface AXMListEditorWidgetsQueryItem {\n /** Widget registry name — store as column `type`. */\n name: string;\n /** Display title (i18n key string when the widget uses one). */\n title: string;\n /** Widget type (always starts with `editor` for this query). */\n type: string;\n}\n\n//#endregion\n\n//#region ---- Query ----\n\n/**\n * Lists client-registered editor widgets from {@link AXPWidgetRegistryService}.\n * Same catalog slice as the former `editor-widgets` registry data source.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListEditorWidgetsQuery\n implements AXPCollectionQuery<AXMListEditorWidgetsQueryInput, AXMListEditorWidgetsQueryItem>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly widgetRegistry = inject(AXPWidgetRegistryService);\n\n //#endregion\n\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListEditorWidgetsQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListEditorWidgetsQueryItem> {\n try {\n let items: AXMListEditorWidgetsQueryItem[] = this.widgetRegistry\n .all()\n .filter((widget) => String(widget.type ?? '').startsWith('editor'))\n .map((widget) => ({\n name: String(widget.name),\n title: this.resolveWidgetTitle(widget.title),\n type: String(widget.type ?? ''),\n }));\n\n if (input?.filter) {\n items = applyFilterArray(items, [input.filter]);\n }\n\n const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];\n const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'title' as const, dir: 'asc' as const }];\n items = applySortArray(items, sortOpt);\n\n const skip = resolveCollectionSkip(input?.skip);\n const take = resolveCollectionTake(input?.take);\n const total = items.length;\n const page = items.slice(skip, skip + take);\n\n return runtimeQuerySuccessCollection({ items: page, total });\n } catch (error) {\n return runtimeQueryFailure(\n error instanceof Error ? error.message : 'Unknown error occurred',\n );\n }\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n /**\n * Keep string i18n keys intact so select-editor translate can resolve them;\n * flatten MLS maps to a display string.\n */\n private resolveWidgetTitle(title: unknown): string {\n if (typeof title === 'string') {\n return title;\n }\n return resolveMultiLanguageString(title, 'en-US');\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;AA8BA;AAEA;AAEA;;;AAGG;MAEU,yBAAyB,CAAA;AADtC,IAAA,WAAA,GAAA;;AAMmB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAwDnE,IAAA;;;IAlDC,MAAM,KAAK,CACT,KAA6C,EAAA;AAE7C,QAAA,IAAI;AACF,YAAA,IAAI,KAAK,GAAoC,IAAI,CAAC;AAC/C,iBAAA,GAAG;AACH,iBAAA,MAAM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,OAAO,KAAK,EAAE;AACd,YAAA,OAAO,mBAAmB,CACxB,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,wBAAwB,CAClE;QACH;IACF;;;AAMA;;;AAGG;AACK,IAAA,kBAAkB,CAAC,KAAc,EAAA;AACvC,QAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC7B,YAAA,OAAO,KAAK;QACd;AACA,QAAA,OAAO,0BAA0B,CAAC,KAAK,EAAE,OAAO,CAAC;IACnD;8GA1DW,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAzB,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,yBAAyB,cADZ,MAAM,EAAA,CAAA,CAAA;;2FACnB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-platform-management-client-list-editor-widgets.query-DITPMmbw.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/features/queries/list-editor-widgets.query.ts"],"sourcesContent":["import {\n resolveCollectionSkip,\n resolveCollectionTake,\n type AXPCollectionQuery,\n type AXPCollectionQueryInput,\n type AXPQueryCollectionFetchResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n resolveMultiLanguageString,\n runtimeQueryFailure,\n runtimeQuerySuccessCollection,\n} from '@acorex-platform/framework-shared/core';\nimport { applyFilterArray, applySortArray } from '@acorex-platform/framework-client/core';\nimport { AXPWidgetRegistryService } from '@acorex-platform/framework-client/layout/widget-core';\n\nimport { Injectable, inject } from '@angular/core';\n\n//#region ---- Types ----\n\nexport type AXMListEditorWidgetsQueryInput = AXPCollectionQueryInput;\n\nexport interface AXMListEditorWidgetsQueryItem {\n /** Widget registry name — store as column `type`. */\n name: string;\n /** Display title (i18n key string when the widget uses one). */\n title: string;\n /** Widget type (always starts with `editor` for this query). */\n type: string;\n}\n\n//#endregion\n\n//#region ---- Query ----\n\n/**\n * Lists client-registered editor widgets from {@link AXPWidgetRegistryService}.\n * Same catalog slice as the former `editor-widgets` registry data source.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListEditorWidgetsQuery\n implements AXPCollectionQuery<AXMListEditorWidgetsQueryInput, AXMListEditorWidgetsQueryItem>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly widgetRegistry = inject(AXPWidgetRegistryService);\n\n //#endregion\n\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListEditorWidgetsQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListEditorWidgetsQueryItem> {\n try {\n let items: AXMListEditorWidgetsQueryItem[] = this.widgetRegistry\n .all()\n .filter((widget) => String(widget.type ?? '').startsWith('editor'))\n .map((widget) => ({\n name: String(widget.name),\n title: this.resolveWidgetTitle(widget.title),\n type: String(widget.type ?? ''),\n }));\n\n if (input?.filter) {\n items = applyFilterArray(items, [input.filter]);\n }\n\n const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];\n const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'title' as const, dir: 'asc' as const }];\n items = applySortArray(items, sortOpt);\n\n const skip = resolveCollectionSkip(input?.skip);\n const take = resolveCollectionTake(input?.take);\n const total = items.length;\n const page = items.slice(skip, skip + take);\n\n return runtimeQuerySuccessCollection({ items: page, total });\n } catch (error) {\n return runtimeQueryFailure(\n error instanceof Error ? error.message : 'Unknown error occurred',\n );\n }\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n /**\n * Keep string i18n keys intact so select-editor translate can resolve them;\n * flatten MLS maps to a display string.\n */\n private resolveWidgetTitle(title: unknown): string {\n if (typeof title === 'string') {\n return title;\n }\n return resol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AO,CAAC;YAEtC,MAAM,IAAI,GAAG,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC;YAC/C,MAAM,IAAI,GAAG,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC;AAC/C,YAAA,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM;AAC1B,YAAA,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;YAE3C,OAAO,6BAA6B,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;QAC9D;QAAE,OAAO,KAAK,EAAE;AACd,YAAA,OAAO,mBAAmB,CACxB,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,wBAAwB,CAClE;QACH;IACF;;;AAMA;;;AAGG;AACK,IAAA,kBAAkB,CAAC,KAAc,EAAA;AACvC,QAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC7B,YAAA,OAAO,KAAK;QACd;AACA,QAAA,OAAO,0BAA0B,CAAC,KAAK,EAAE,OAAO,CAAC;IACnD;8GA1DW,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAzB,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,yBAAyB,cADZ,MAAM,EAAA,CAAA,CAAA;;2FACnB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-platform-management-client-list-platform-navigation-for-ai.query-2oHMITw-.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/features/queries/list-platform-navigation-for-ai.query.ts"],"sourcesContent":["import { AXTranslationService } from '@acorex/core/translation';\nimport type { AXPMenuItem } from '@acorex-platform/framework-client/common';\nimport { AXPMenuProviderService } from '@acorex-platform/framework-client/common';\nimport type { AXPQuery, AXPQueryFetchResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n runtimeQueryFailure,\n runtimeQuerySuccessObject,\n type AXPRuntimeQueryResult,\n} from '@acorex-platform/framework-shared/core';\nimport { AXPEntityResolver } from '@acorex-platform/framework-client/layout/entity';\nimport { Injectable, inject } from '@angular/core';\n\nimport type { AXMEntityMasterUiActionsForAi } from './entity-master-actions-for-ai.util';\nimport { axmSummarizeMasterUiActionsForAi } from './entity-master-actions-for-ai.util';\n\n//#region ---- Types ----\n\nexport interface AXMListPlatformNavigationForAiQueryInput {\n /**\n * Single-line filter against resolved titles, `titleKey`, `menuName`, routing `path`,\n * and hierarchical path text (case-insensitive substring match).\n * When omitted, all visible menu rows after middleware are returned (truncated via `limit`).\n */\n quickSearch?: string;\n /**\n * Soft cap after filtering; enforced between 40 and 500. Omit for default **300**.\n */\n limit?: number;\n /**\n * When set to exact `ModuleName.EntityName`, the result includes **`entityMasterUiActions`**\n * (toolbar labels from registered entity layouts) alongside navigation rows — same derivation as **`ListRegisteredEntities`**.\n */\n entityFullName?: string;\n /**\n * When true, the result includes **`registeredEntitiesNotInSidebarMenu`** — resolver catalog entries whose\n * standard master path segment **`/m/{module}/e/{entity}/`** does not appear in any flattened menu **`path`**.\n * Heuristic (see result field); pair with **`ListRegisteredEntities`** for the full catalog.\n */\n includeRegisteredEntitiesNotInSidebarMenu?: boolean;\n}\n\n/** One flattened row from the middleware-applied sidebar / shell menu tree. */\nexport interface AXMPlatformNavigationAiRow {\n /** Stable menu item key when present (often useful for correlate with manifests). */\n menuName?: string;\n /** User-visible title resolved with {@link AXTranslationService.translateSync} when possible. */\n title: string;\n /** Original `text` from the menu definition (typically a `@scope:key` token). */\n titleKey: string;\n /** Breadcrumb of resolved ancestor titles separated by › (current item included last). */\n hierarchyPath: string;\n depth: number;\n /** Entity / page route fragment when navigable via router. */\n path?: string;\n /** `menu` | `group` | `break` when present — folder vs leaf-ish chrome. */\n menuType?: string;\n}\n\n/** `catalog`: no filter. `filtered`: `quickSearch` applied. `empty`: matched nothing. */\nexport type AXMPlatformNavigationAiMatchStatus = 'catalog' | 'filtered' | 'empty';\n\nexport interface AXMListPlatformNavigationForAiQueryResult {\n matchStatus: AXMPlatformNavigationAiMatchStatus;\n /** Flattened menu rows sorted by hierarchy path — how-to answers should cite these verbatim. */\n navigation: AXMPlatformNavigationAiRow[];\n truncated: boolean;\n /**\n * Present when **`entityFullName`** was supplied: master list + detail toolbar action labels from the resolver.\n * `null` when the entity did not resolve.\n */\n entityMasterUiActions?: AXMEntityMasterUiActionsForAi | null;\n entityMasterUiActionsMatch?: AXMNavigationEntityUiActionsMatch;\n /**\n * Present when **`includeRegisteredEntitiesNotInSidebarMenu`** was true: `Module.Entity` keys from\n * {@link AXPEntityResolver.listAll} with no matching **`/m/{module}/e/{entity}/`** segment in any menu **`path`**.\n * Entities reachable only via lookups, merge-detail, related lists, or **`command`** navigation (no `path`) can appear here.\n */\n registeredEntitiesNotInSidebarMenu?: string[];\n}\n\n/** Resolver outcome for optional {@link AXMListPlatformNavigationForAiQueryInput.entityFullName}. */\nexport type AXMNavigationEntityUiActionsMatch = 'none' | 'single';\n\n//#endregion\n\n//#region ---- Helpers ----\n\nconst DEFAULT_ROW_LIMIT = 300;\nconst MIN_ROW_LIMIT = 40;\nconst MAX_ROW_LIMIT = 500;\n\nfunction normalizeLimit(raw: unknown): number {\n if (typeof raw === 'number' && Number.isFinite(raw)) {\n const n = Math.floor(raw);\n return Math.min(MAX_ROW_LIMIT, Math.max(MIN_ROW_LIMIT, n));\n }\n if (typeof raw === 'string') {\n const parsed = Number.parseInt(raw.trim(), 10);\n if (Number.isFinite(parsed)) {\n return Math.min(MAX_ROW_LIMIT, Math.max(MIN_ROW_LIMIT, parsed));\n }\n }\n return DEFAULT_ROW_LIMIT;\n}\n\nfunction matchesFold(haystack: string, needle: string): boolean {\n return haystack.toLocaleUpperCase().includes(needle.toLocaleUpperCase());\n}\n\n/** Expects **`Module.Entity`** (`SecurityManagement.User`). */\nfunction parseRegisteredEntityFullName(fullName: string): { module: string; name: string } | null {\n const trimmed = fullName.trim();\n const dot = trimmed.indexOf('.');\n if (dot <= 0 || dot >= trimmed.length - 1) {\n return null;\n }\n return { module: trimmed.slice(0, dot), name: trimmed.slice(dot + 1) };\n}\n\n/**\n * Collects `Module.Entity` keys implied by entity master router paths on menu rows\n * (`/{app}/m/{module}/e/{entity}/...`).\n */\nfunction collectEntityFullNamesFromMenuPaths(paths: Iterable<string | undefined>): Set<string> {\n const seen = new Set<string>();\n const re = /\\/m\\/([^/?#]+)\\/e\\/([^/?#]+)\\//g;\n for (const raw of paths) {\n if (!raw) {\n continue;\n }\n re.lastIndex = 0;\n let m: RegExpExecArray | null;\n while ((m = re.exec(raw)) !== null) {\n seen.add(`${m[1]}.${m[2]}`);\n }\n }\n return seen;\n}\n\n//#endregion\n\n//#region ---- List platform navigation for AI ----\n\n/**\n * Builds a flattened, searchable view of visible platform menu entries (middleware-filtered snapshot)\n * for product “how‑to” and navigation assistants. Intended for **read-only grounding** —\n * callers should complement with entity schema tools when field-level detail matters.\n * **Sidebar menus are not the full entity catalog** — use optional **`includeRegisteredEntitiesNotInSidebarMenu`**\n * or **`ListRegisteredEntities`** when assistants must not equate “in the menu” with “all registered entities”.\n * Optional **`entityFullName`** (`Module.Entity`) adds toolbar action labels from that entity’s master interfaces.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListPlatformNavigationForAiQuery\n implements AXPQuery<AXMListPlatformNavigationForAiQueryInput, AXMListPlatformNavigationForAiQueryResult>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly menuProviders = inject(AXPMenuProviderService);\n private readonly translation = inject(AXTranslationService);\n private readonly entityResolver = inject(AXPEntityResolver);\n\n //#endregion\n\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListPlatformNavigationForAiQueryInput | null,\n ): AXPQueryFetchResultPromise<AXMListPlatformNavigationForAiQueryResult> {\n try {\n const opts = input ?? {};\n const limit = normalizeLimit(opts.limit);\n const search = opts.quickSearch?.trim();\n\n const entityFullName = opts.entityFullName?.trim();\n\n const tree = await this.menuProviders.items();\n const flattened = this.flattenMenus(tree);\n const linkedFromMenuPaths = collectEntityFullNamesFromMenuPaths(flattened.map((r) => r.path));\n\n let rows = flattened;\n if (search) {\n rows = flattened.filter((r) =>\n matchesFold(`${r.menuName ?? ''}|${r.title}|${r.titleKey}|${r.path ?? ''}|${r.hierarchyPath}`, search),\n );\n }\n\n rows.sort((a, b) => a.hierarchyPath.localeCompare(b.hierarchyPath));\n\n let matchStatus: AXMPlatformNavigationAiMatchStatus;\n if (search && rows.length === 0) {\n matchStatus = 'empty';\n } else if (search) {\n matchStatus = 'filtered';\n } else {\n matchStatus = 'catalog';\n }\n\n const truncated = rows.length > limit;\n\n let entityMasterUiActions: AXMEntityMasterUiActionsForAi | null | undefined;\n let entityMasterUiActionsMatch: AXMNavigationEntityUiActionsMatch | undefined;\n\n if (entityFullName) {\n const parsed = parseRegisteredEntityFullName(entityFullName);\n if (!parsed) {\n entityMasterUiActions = null;\n entityMasterUiActionsMatch = 'none';\n } else {\n const def = await this.entityResolver.get(parsed.module, parsed.name);\n if (def) {\n entityMasterUiActions = axmSummarizeMasterUiActionsForAi(def, (key) =>\n this.resolveMenuTitle(key),\n );\n entityMasterUiActionsMatch = 'single';\n } else {\n entityMasterUiActions = null;\n entityMasterUiActionsMatch = 'none';\n }\n }\n }\n\n let registeredEntitiesNotInSidebarMenu: string[] | undefined;\n if (opts.includeRegisteredEntitiesNotInSidebarMenu) {\n const catalog = await this.entityResolver.listAll();\n const sortedCatalog = [...catalog].sort((a, b) => {\n const byModule = a.module.localeCompare(b.module);\n return byModule !== 0 ? byModule : a.name.localeCompare(b.name);\n });\n registeredEntitiesNotInSidebarMenu = sortedCatalog\n .filter((e) => !linkedFromMenuPaths.has(e.fullName))\n .map((e) => e.fullName);\n }\n\n return runtimeQuerySuccessObject({\n matchStatus,\n truncated,\n navigation: rows.slice(0, limit),\n ...(entityFullName\n ? {\n entityMasterUiActions: entityMasterUiActions ?? null,\n entityMasterUiActionsMatch,\n }\n : {}),\n ...(registeredEntitiesNotInSidebarMenu !== undefined\n ? { registeredEntitiesNotInSidebarMenu }\n : {}),\n });\n } catch (error) {\n return runtimeQueryFailure(\n error instanceof Error ? error.message : 'Unknown error occurred',\n );\n }\n }\n\n //#endregion\n\n //#region ---- Private ----\n\n private resolveMenuTitle(text: string): string {\n try {\n return this.translation.translateSync(text);\n } catch {\n return text;\n }\n }\n\n private flattenMenus(items: AXPMenuItem[]): AXMPlatformNavigationAiRow[] {\n const rows: AXMPlatformNavigationAiRow[] = [];\n\n const walk = (nodes: AXPMenuItem[], ancestorsResolved: string[]): void => {\n for (const item of nodes) {\n const title = this.resolveMenuTitle(item.text);\n const ancestors = [...ancestorsResolved, title];\n\n rows.push({\n menuName: item.name,\n title,\n titleKey: item.text,\n hierarchyPath: ancestors.join(' › '),\n depth: ancestorsResolved.length,\n ...(item.path ? { path: item.path } : {}),\n ...(item.type ? { menuType: item.type } : {}),\n });\n\n if (item.children?.length) {\n walk(item.children, ancestors);\n }\n }\n };\n\n walk(items, []);\n return rows;\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;AAmFA;AAEA;AAEA,MAAM,iBAAiB,GAAG,GAAG;AAC7B,MAAM,aAAa,GAAG,EAAE;AACxB,MAAM,aAAa,GAAG,GAAG;AAEzB,SAAS,cAAc,CAAC,GAAY,EAAA;AAClC,IAAA,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACnD,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;AACzB,QAAA,OAAO,IAAI,CAAC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AA,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,cADtB,MAAM,EAAA,CAAA,CAAA;;2FACnB,mCAAmC,EAAA,UAAA,EAAA,CAAA;kBAD/C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-platform-management-client-list-platform-navigation-for-ai.query-2oHMITw-.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/features/queries/list-platform-navigation-for-ai.query.ts"],"sourcesContent":["import { AXTranslationService } from '@acorex/core/translation';\nimport type { AXPMenuItem } from '@acorex-platform/framework-client/common';\nimport { AXPMenuProviderService } from '@acorex-platform/framework-client/common';\nimport type { AXPQuery, AXPQueryFetchResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n runtimeQueryFailure,\n runtimeQuerySuccessObject,\n type AXPRuntimeQueryResult,\n} from '@acorex-platform/framework-shared/core';\nimport { AXPEntityResolver } from '@acorex-platform/framework-client/layout/entity';\nimport { Injectable, inject } from '@angular/core';\n\nimport type { AXMEntityMasterUiActionsForAi } from './entity-master-actions-for-ai.util';\nimport { axmSummarizeMasterUiActionsForAi } from './entity-master-actions-for-ai.util';\n\n//#region ---- Types ----\n\nexport interface AXMListPlatformNavigationForAiQueryInput {\n /**\n * Single-line filter against resolved titles, `titleKey`, `menuName`, routing `path`,\n * and hierarchical path text (case-insensitive substring match).\n * When omitted, all visible menu rows after middleware are returned (truncated via `limit`).\n */\n quickSearch?: string;\n /**\n * Soft cap after filtering; enforced between 40 and 500. Omit for default **300**.\n */\n limit?: number;\n /**\n * When set to exact `ModuleName.EntityName`, the result includes **`entityMasterUiActions`**\n * (toolbar labels from registered entity layouts) alongside navigation rows — same derivation as **`ListRegisteredEntities`**.\n */\n entityFullName?: string;\n /**\n * When true, the result includes **`registeredEntitiesNotInSidebarMenu`** — resolver catalog entries whose\n * standard master path segment **`/m/{module}/e/{entity}/`** does not appear in any flattened menu **`path`**.\n * Heuristic (see result field); pair with **`ListRegisteredEntities`** for the full catalog.\n */\n includeRegisteredEntitiesNotInSidebarMenu?: boolean;\n}\n\n/** One flattened row from the middleware-applied sidebar / shell menu tree. */\nexport interface AXMPlatformNavigationAiRow {\n /** Stable menu item key when present (often useful for correlate with manifests). */\n menuName?: string;\n /** User-visible title resolved with {@link AXTranslationService.translateSync} when possible. */\n title: string;\n /** Original `text` from the menu definition (typically a `@scope:key` token). */\n titleKey: string;\n /** Breadcrumb of resolved ancestor titles separated by › (current item included last). */\n hierarchyPath: string;\n depth: number;\n /** Entity / page route fragment when navigable via router. */\n path?: string;\n /** `menu` | `group` | `break` when present — folder vs leaf-ish chrome. */\n menuType?: string;\n}\n\n/** `catalog`: no filter. `filtered`: `quickSearch` applied. `empty`: matched nothing. */\nexport type AXMPlatformNavigationAiMatchStatus = 'catalog' | 'filtered' | 'empty';\n\nexport interface AXMListPlatformNavigationForAiQueryResult {\n matchStatus: AXMPlatformNavigationAiMatchStatus;\n /** Flattened menu rows sorted by hierarchy path — how-to answers should cite these verbatim. */\n navigation: AXMPlatformNavigationAiRow[];\n truncated: boolean;\n /**\n * Present when **`entityFullName`** was supplied: master list + detail toolbar action labels from the resolver.\n * `null` when the entity did not resolve.\n */\n entityMasterUiActions?: AXMEntityMasterUiActionsForAi | null;\n entityMasterUiActionsMatch?: AXMNavigationEntityUiActionsMatch;\n /**\n * Present when **`includeRegisteredEntitiesNotInSidebarMenu`** was true: `Module.Entity` keys from\n * {@link AXPEntityResolver.listAll} with no matching **`/m/{module}/e/{entity}/`** segment in any menu **`path`**.\n * Entities reachable only via lookups, merge-detail, related lists, or **`command`** navigation (no `path`) can appear here.\n */\n registeredEntitiesNotInSidebarMenu?: string[];\n}\n\n/** Resolver outcome for optional {@link AXMListPlatformNavigationForAiQueryInput.entityFullName}. */\nexport type AXMNavigationEntityUiActionsMatch = 'none' | 'single';\n\n//#endregion\n\n//#region ---- Helpers ----\n\nconst DEFAULT_ROW_LIMIT = 300;\nconst MIN_ROW_LIMIT = 40;\nconst MAX_ROW_LIMIT = 500;\n\nfunction normalizeLimit(raw: unknown): number {\n if (typeof raw === 'number' && Number.isFinite(raw)) {\n const n = Math.floor(raw);\n return Math.min(MAX_ROW_LIMIT, Math.max(MIN_ROW_LIMIT, n));\n }\n if (typeof raw === 'string') {\n const parsed = Number.parseInt(raw.trim(), 10);\n if (Number.isFinite(parsed)) {\n return Math.min(MAX_ROW_LIMIT, Math.max(MIN_ROW_LIMIT, parsed));\n }\n }\n return DEFAULT_ROW_LIMIT;\n}\n\nfunction matchesFold(haystack: string, needle: string): boolean {\n return haystack.toLocaleUpperCase().includes(needle.toLocaleUpperCase());\n}\n\n/** Expects **`Module.Entity`** (`SecurityManagement.User`). */\nfunction parseRegisteredEntityFullName(fullName: string): { module: string; name: string } | null {\n const trimmed = fullName.trim();\n const dot = trimmed.indexOf('.');\n if (dot <= 0 || dot >= trimmed.length - 1) {\n return null;\n }\n return { module: trimmed.slice(0, dot), name: trimmed.slice(dot + 1) };\n}\n\n/**\n * Collects `Module.Entity` keys implied by entity master router paths on menu rows\n * (`/{app}/m/{module}/e/{entity}/...`).\n */\nfunction collectEntityFullNamesFromMenuPaths(paths: Iterable<string | undefined>): Set<string> {\n const seen = new Set<string>();\n const re = /\\/m\\/([^/?#]+)\\/e\\/([^/?#]+)\\//g;\n for (const raw of paths) {\n if (!raw) {\n continue;\n }\n re.lastIndex = 0;\n let m: RegExpExecArray | null;\n while ((m = re.exec(raw)) !== null) {\n seen.add(`${m[1]}.${m[2]}`);\n }\n }\n return seen;\n}\n\n//#endregion\n\n//#region ---- List platform navigation for AI ----\n\n/**\n * Builds a flattened, searchable view of visible platform menu entries (middleware-filtered snapshot)\n * for product “how‑to” and navigation assistants. Intended for **read-only grounding** —\n * callers should complement with entity schema tools when field-level detail matters.\n * **Sidebar menus are not the full entity catalog** — use optional **`includeRegisteredEntitiesNotInSidebarMenu`**\n * or **`ListRegisteredEntities`** when assistants must not equate “in the menu” with “all registered entities”.\n * Optional **`entityFullName`** (`Module.Entity`) adds toolbar action labels from that entity’s master interfaces.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListPlatformNavigationForAiQuery\n implements AXPQuery<AXMListPlatformNavigationForAiQueryInput, AXMListPlatformNavigationForAiQueryResult>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly menuProviders = inject(AXPMenuProviderService);\n private readonly translation = inject(AXTranslationService);\n private readonly entityResolver = inject(AXPEntityResolver);\n\n //#endregion\n\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListPlatformNavigationForAiQueryInput | null,\n ): AXPQueryFetchResultPromise<AXMListPlatformNavigationForAiQueryResult> {\n try {\n const opts = input ?? {};\n const limit = normalizeLimit(opts.limit);\n const search = opts.quickSearch?.trim();\n\n const entityFullName = opts.entityFullName?.trim();\n\n const tree = await this.menuProviders.items();\n const flattened = this.flattenMenus(tree);\n const linkedFromMenuPaths = collectEntityFullNamesFromMenuPaths(flattened.map((r) => r.path));\n\n let rows = flattened;\n if (search) {\n rows = flattened.filter((r) =>\n matchesFold(`${r.menuName ?? ''}|${r.title}|${r.titleKey}|${r.path ?? ''}|${r.hierarchyPath}`, search),\n );\n }\n\n rows.sort((a, b) => a.hierarchyPath.localeCompare(b.hierarchyPath));\n\n let matchStatus: AXMPlatformNavigationAiMatchStatus;\n if (search && rows.length === 0) {\n matchStatus = 'empty';\n } else if (search) {\n matchStatus = 'filtered';\n } else {\n matchStatus = 'catalog';\n }\n\n const truncated = rows.length > limit;\n\n let entityMasterUiActions: AXMEntityMasterUiActionsForAi | null | undefined;\n let entityMasterUiActionsMatch: AXMNavigationEntityUiActionsMatch | undefined;\n\n if (entityFullName) {\n const parsed = parseRegisteredEntityFullName(entityFullName);\n if (!parsed) {\n entityMasterUiActions = null;\n entityMasterUiActionsMatch = 'none';\n } else {\n const def = await this.entityResolver.get(parsed.module, parsed.name);\n if (def) {\n entityMasterUiActions = axmSummarizeMasterUiActionsForAi(def, (key) =>\n this.resolveMenuTitle(key),\n );\n entityMasterUiActionsMatch = 'single';\n } else {\n entityMasterUiActions = null;\n entityMasterUiActionsMatch = 'none';\n }\n }\n }\n\n let registeredEntitiesNotInSidebarMenu: string[] | undefined;\n if (opts.includeRegisteredEntitiesNotInSidebarMenu) {\n const catalog = await this.entityResolver.listAll();\n const sortedCatalog = [...catalog].sort((a, b) => {\n const byModule = a.module.localeCompare(b.module);\n return byModule !== 0 ? byModule : a.name.localeCompare(b.name);\n });\n registeredEntitiesNotInSidebarMenu = sortedCatalog\n .filter((e) => !linkedFromMenuPaths.has(e.fullName))\n .map((e) => e.fullName);\n }\n\n return runtimeQuerySuccessObject({\n matchStatus,\n truncated,\n navigation: rows.slice(0, limit),\n ...(entityFullName\n ? {\n entityMasterUiActions: entityMasterUiActions ?? null,\n entityMasterUiActionsMatch,\n }\n : {}),\n ...(registeredEntitiesNotInSidebarMenu !== undefined\n ? { registeredEntitiesNotInSidebarMenu }\n : {}),\n });\n } catch (error) {\n return runtimeQueryFailure(\n error instanceof Error ? error.message : 'Unknown error occurred',\n );\n }\n }\n\n //#endregion\n\n //#region ---- Private ----\n\n private resolveMenuTitle(text: string): string {\n try {\n return this.translation.translateSync(text);\n } catch {\n return text;\n }\n }\n\n private flattenMenus(items: AXPMenuItem[]): AXMPlatformNavigationAiRow[] {\n const rows: AXMPlatformNavigationAiRow[] = [];\n\n const walk = (nodes: AXPMenuItem[], ancestorsResolved: string[]): void => {\n for (const item of nodes) {\n const title = this.resolveMenuTitle(item.text);\n const ancestors = [...ancestorsResolved, title];\n\n rows.push({\n menuName: item.name,\n title,\n titleKey: item.text,\n hierarchyPath: ancestors.join(' › '),\n depth: ancestorsResolved.length,\n ...(item.path ? { path: item.path } : {}),\n ...(item.type ? { menuType: item.type } : {}),\n });\n\n if (item.children?.length) {\n walk(item.children, ancestors);\n }\n }\n };\n\n walk(items, []);\n return rows;\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;AAmFA;AAEA;AAEA,MAAM,iBAAiB,GAAG,GAAG;AAC7B,MAAM,aAAa,GAAG,EAAE;AACxB,MAAM,aAAa,GAAG,GAAG;AAEzB,SAAS,cAAc,CAAC,GAAY,EAAA;AAClC,IAAA,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACnD,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;AACzB,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;IAC5D;AACA,IAAA,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AAC3B,QAAA,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC;AAC9C,QAAA,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AAC3B,YAAA,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QACjE;IACF;AACA,IAAA,OAAO,iBAAiB;AAC1B;AAEA,SAAS,WAAW,CAAC,QAAgB,EAAE,MAAc,EAAA;AACnD,IAAA,OAAO,QAAQ,CAAC,iBAAiB,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;AAC1E;AAEA;AACA,SAAS,6BAA6B,CAAC,QAAgB,EAAA;AACrD,IAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE;IAC/B,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;AAChC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EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC;AACzC,oBAAA,IAAI,IAAI,CAAC,IAAI,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC;AAC9C,iBAAA,CAAC;AAEF,gBAAA,IAAI,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE;AACzB,oBAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC;gBAChC;YACF;AACF,QAAA,CAAC;AAED,QAAA,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;AACf,QAAA,OAAO,IAAI;IACb;8GA5IW,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,cADtB,MAAM,EAAA,CAAA,CAAA;;2FACnB,mCAAmC,EAAA,UAAA,EAAA,CAAA;kBAD/C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-platform-management-client-list-registered-entities.query-DjStd3a8.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/features/queries/list-registered-entities.query.ts"],"sourcesContent":["\n\nimport { AXPQuery, type AXPQueryFetchResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { type AXPEntityProperty, collectEntityQuickSearchFieldPaths } from '@acorex-platform/framework-shared/entity';\nimport {\n runtimeQueryFailure,\n runtimeQuerySuccessObject,\n type AXPRuntimeQueryResult,\n} from '@acorex-platform/framework-shared/core';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPEntityResolver } from '@acorex-platform/framework-client/layout/entity';\n\nimport { Injectable, inject } from '@angular/core';\n\nimport type { AXMEntityMasterUiActionsForAi } from './entity-master-actions-for-ai.util';\nimport { axmSummarizeMasterUiActionsForAi } from './entity-master-actions-for-ai.util';\n\n//#region ---- Types ----\n\nexport interface AXMListRegisteredEntitiesQueryInput {\n /**\n * Optional `ModuleName.EntityName`. When set, the result list is filtered to that entity only and its row\n * includes a full `properties` array. When omitted, the entire catalog is returned without `properties` on\n * any row (lightweight list).\n */\n entityFullName?: string;\n}\n\nexport interface AXMRegisteredEntityPropertySummary {\n name: string;\n title: string;\n dataType: string;\n nullable?: boolean;\n /** Editor/widget type when present (e.g. lookup). */\n interfaceType?: string;\n /** For lookup-like fields: related catalog entity as `Module.Entity`. */\n lookupEntity?: string;\n /**\n * Denormalized value paths on stored rows (lodash `get` paths for filters), e.g. `brand.title` alongside `brandId`.\n */\n filterValuePaths?: string[];\n}\n\nexport interface AXMListRegisteredEntitiesQueryItem {\n /** Module key as registered on entity loaders (first segment of fullName). */\n module: string;\n /** Entity name (second segment of fullName). */\n name: string;\n /** Canonical `ModuleName.EntityName` string; use this value for Entity:GetDetails `entity`. */\n fullName: string;\n /**\n * Present on each row when {@link AXMListRegisteredEntitiesQueryInput.entityFullName} was provided (the single\n * matching catalog entry). Omitted on every row when that input was not provided.\n */\n properties?: AXMRegisteredEntityPropertySummary[];\n /**\n * When {@link AXMListRegisteredEntitiesQueryInput.entityFullName} was supplied and the resolver returned a definition:\n * master **list** and **detail (single)** toolbar actions (resolved titles — Create, Delete, View, …).\n */\n masterUiActions?: AXMEntityMasterUiActionsForAi;\n /**\n * When {@link AXMListRegisteredEntitiesQueryInput.entityFullName} was supplied and a definition was resolved:\n * lodash-get paths included in mock storage **`quickSearch`** (text `contains`), including merge-detail related\n * snapshots (e.g. `person.fullName`) and dotted column paths.\n */\n quickSearchPaths?: string[];\n}\n\n/** How the result relates to the optional entityFullName filter; omitted when success is false. */\nexport type AXMListRegisteredEntitiesMatchStatus = 'none' | 'single' | 'multiple' | 'catalog';\n\nexport interface AXMListRegisteredEntitiesQueryResult {\n /** Documents catalog vs filter match cardinality for agents. */\n matchStatus: AXMListRegisteredEntitiesMatchStatus;\n entities: AXMListRegisteredEntitiesQueryItem[];\n}\n\n//#endregion\n\n//#region ---- Property summary ----\n\nfunction toRegisteredEntityPropertySummary(prop: AXPEntityProperty): AXMRegisteredEntityPropertySummary {\n const iface = prop.schema?.interface;\n const rawType = iface?.type;\n const interfaceType = typeof rawType === 'string' ? rawType : undefined;\n const opts = iface?.options as Record<string, unknown> | undefined;\n\n let lookupEntity: string | undefined;\n let filterValuePaths: string[] | undefined;\n\n if (opts && typeof opts['entity'] === 'string' && opts['entity'].trim()) {\n lookupEntity = opts['entity'].trim();\n }\n\n const expose = opts?.['expose'];\n if (Array.isArray(expose)) {\n const paths = expose\n .map((row) => (row && typeof row === 'object' ? (row as { target?: unknown }).target : undefined))\n .filter((t): t is string => typeof t === 'string' && t.length > 0);\n if (paths.length) {\n filterValuePaths = paths;\n }\n }\n\n return {\n name: prop.name,\n title: prop.title,\n dataType: prop.schema?.dataType ?? 'unknown',\n nullable: prop.schema?.nullable,\n ...(interfaceType ? { interfaceType } : {}),\n ...(lookupEntity ? { lookupEntity } : {}),\n ...(filterValuePaths ? { filterValuePaths } : {}),\n };\n}\n\n//#endregion\n\n//#region ---- List Registered Entities Query ----\n\n/**\n * Returns every entity known to {@link AXPEntityResolver} (all loaders), sorted by module then entity name,\n * unless {@link AXMListRegisteredEntitiesQueryInput.entityFullName} is set — then only that entity is returned,\n * with property metadata and **master UI action** summaries (list + detail toolbars).\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListRegisteredEntitiesQuery\n implements AXPQuery<AXMListRegisteredEntitiesQueryInput, AXMListRegisteredEntitiesQueryResult>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly entityResolver = inject(AXPEntityResolver);\n private readonly translation = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListRegisteredEntitiesQueryInput | null,\n ): AXPQueryFetchResultPromise<AXMListRegisteredEntitiesQueryResult> {\n try {\n const opts = input ?? {};\n const entries = await this.entityResolver.listAll();\n const targetFullName = opts.entityFullName?.trim();\n\n const sorted = [...entries].sort((a, b) => {\n const byModule = a.module.localeCompare(b.module);\n if (byModule !== 0) {\n return byModule;\n }\n return a.name.localeCompare(b.name);\n });\n\n const entities: AXMListRegisteredEntitiesQueryItem[] = [];\n\n for (const e of sorted) {\n if (targetFullName && e.fullName !== targetFullName) {\n continue;\n }\n\n const base: AXMListRegisteredEntitiesQueryItem = {\n module: e.module,\n name: e.name,\n fullName: e.fullName,\n };\n\n if (targetFullName) {\n const def = await this.entityResolver.get(e.module, e.name);\n const props = def?.properties?.map(toRegisteredEntityPropertySummary) ?? [];\n const masterUiActions = def ? axmSummarizeMasterUiActionsForAi(def, (k) => this.resolveEntityCopy(k)) : undefined;\n const quickSearchPaths = def\n ? await collectEntityQuickSearchFieldPaths(def, (m, n) => this.entityResolver.get(m, n))\n : undefined;\n entities.push({\n ...base,\n properties: props,\n ...(quickSearchPaths?.length ? { quickSearchPaths } : {}),\n ...(masterUiActions ? { masterUiActions } : {}),\n });\n } else {\n entities.push(base);\n }\n }\n\n let matchStatus: AXMListRegisteredEntitiesMatchStatus;\n if (!targetFullName) {\n matchStatus = 'catalog';\n } else if (entities.length === 0) {\n matchStatus = 'none';\n } else if (entities.length === 1) {\n matchStatus = 'single';\n } else {\n matchStatus = 'multiple';\n }\n\n return runtimeQuerySuccessObject({\n matchStatus,\n entities,\n });\n } catch (error) {\n return runtimeQueryFailure(\n error instanceof Error ? error.message : 'Unknown error occurred',\n );\n }\n }\n\n //#endregion\n\n //#region ---- Private helpers ----\n\n private resolveEntityCopy(text: string): string {\n try {\n return this.translation.translateSync(text);\n } catch {\n return text;\n }\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;AA6EA;AAEA;AAEA,SAAS,iCAAiC,CAAC,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YAAA,OAAO,yBAAyB,CAAC;gBAC/B,WAAW;gBACX,QAAQ;AACT,aAAA,CAAC;QACJ;QAAE,OAAO,KAAK,EAAE;AACd,YAAA,OAAO,mBAAmB,CACxB,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,wBAAwB,CAClE;QACH;IACF;;;AAMQ,IAAA,iBAAiB,CAAC,IAAY,EAAA;AACpC,QAAA,IAAI;YACF,OAAO,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC;QAC7C;AAAE,QAAA,MAAM;AACN,YAAA,OAAO,IAAI;QACb;IACF;8GA3FW,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA9B,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,8BAA8B,cADjB,MAAM,EAAA,CAAA,CAAA;;2FACnB,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAD1C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-platform-management-client-list-registered-entities.query-DjStd3a8.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/features/queries/list-registered-entities.query.ts"],"sourcesContent":["\n\nimport { AXPQuery, type AXPQueryFetchResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { type AXPEntityProperty, collectEntityQuickSearchFieldPaths } from '@acorex-platform/framework-shared/entity';\nimport {\n runtimeQueryFailure,\n runtimeQuerySuccessObject,\n type AXPRuntimeQueryResult,\n} from '@acorex-platform/framework-shared/core';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPEntityResolver } from '@acorex-platform/framework-client/layout/entity';\n\nimport { Injectable, inject } from '@angular/core';\n\nimport type { AXMEntityMasterUiActionsForAi } from './entity-master-actions-for-ai.util';\nimport { axmSummarizeMasterUiActionsForAi } from './entity-master-actions-for-ai.util';\n\n//#region ---- Types ----\n\nexport interface AXMListRegisteredEntitiesQueryInput {\n /**\n * Optional `ModuleName.EntityName`. When set, the result list is filtered to that entity only and its row\n * includes a full `properties` array. When omitted, the entire catalog is returned without `properties` on\n * any row (lightweight list).\n */\n entityFullName?: string;\n}\n\nexport interface AXMRegisteredEntityPropertySummary {\n name: string;\n title: string;\n dataType: string;\n nullable?: boolean;\n /** Editor/widget type when present (e.g. lookup). */\n interfaceType?: string;\n /** For lookup-like fields: related catalog entity as `Module.Entity`. */\n lookupEntity?: string;\n /**\n * Denormalized value paths on stored rows (lodash `get` paths for filters), e.g. `brand.title` alongside `brandId`.\n */\n filterValuePaths?: string[];\n}\n\nexport interface AXMListRegisteredEntitiesQueryItem {\n /** Module key as registered on entity loaders (first segment of fullName). */\n module: string;\n /** Entity name (second segment of fullName). */\n name: string;\n /** Canonical `ModuleName.EntityName` string; use this value for Entity:GetDetails `entity`. */\n fullName: string;\n /**\n * Present on each row when {@link AXMListRegisteredEntitiesQueryInput.entityFullName} was provided (the single\n * matching catalog entry). Omitted on every row when that input was not provided.\n */\n properties?: AXMRegisteredEntityPropertySummary[];\n /**\n * When {@link AXMListRegisteredEntitiesQueryInput.entityFullName} was supplied and the resolver returned a definition:\n * master **list** and **detail (single)** toolbar actions (resolved titles — Create, Delete, View, …).\n */\n masterUiActions?: AXMEntityMasterUiActionsForAi;\n /**\n * When {@link AXMListRegisteredEntitiesQueryInput.entityFullName} was supplied and a definition was resolved:\n * lodash-get paths included in mock storage **`quickSearch`** (text `contains`), including merge-detail related\n * snapshots (e.g. `person.fullName`) and dotted column paths.\n */\n quickSearchPaths?: string[];\n}\n\n/** How the result relates to the optional entityFullName filter; omitted when success is false. */\nexport type AXMListRegisteredEntitiesMatchStatus = 'none' | 'single' | 'multiple' | 'catalog';\n\nexport interface AXMListRegisteredEntitiesQueryResult {\n /** Documents catalog vs filter match cardinality for agents. */\n matchStatus: AXMListRegisteredEntitiesMatchStatus;\n entities: AXMListRegisteredEntitiesQueryItem[];\n}\n\n//#endregion\n\n//#region ---- Property summary ----\n\nfunction toRegisteredEntityPropertySummary(prop: AXPEntityProperty): AXMRegisteredEntityPropertySummary {\n const iface = prop.schema?.interface;\n const rawType = iface?.type;\n const interfaceType = typeof rawType === 'string' ? rawType : undefined;\n const opts = iface?.options as Record<string, unknown> | undefined;\n\n let lookupEntity: string | undefined;\n let filterValuePaths: string[] | undefined;\n\n if (opts && typeof opts['entity'] === 'string' && opts['entity'].trim()) {\n lookupEntity = opts['entity'].trim();\n }\n\n const expose = opts?.['expose'];\n if (Array.isArray(expose)) {\n const paths = expose\n .map((row) => (row && typeof row === 'object' ? (row as { target?: unknown }).target : undefined))\n .filter((t): t is string => typeof t === 'string' && t.length > 0);\n if (paths.length) {\n filterValuePaths = paths;\n }\n }\n\n return {\n name: prop.name,\n title: prop.title,\n dataType: prop.schema?.dataType ?? 'unknown',\n nullable: prop.schema?.nullable,\n ...(interfaceType ? { interfaceType } : {}),\n ...(lookupEntity ? { lookupEntity } : {}),\n ...(filterValuePaths ? { filterValuePaths } : {}),\n };\n}\n\n//#endregion\n\n//#region ---- List Registered Entities Query ----\n\n/**\n * Returns every entity known to {@link AXPEntityResolver} (all loaders), sorted by module then entity name,\n * unless {@link AXMListRegisteredEntitiesQueryInput.entityFullName} is set — then only that entity is returned,\n * with property metadata and **master UI action** summaries (list + detail toolbars).\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListRegisteredEntitiesQuery\n implements AXPQuery<AXMListRegisteredEntitiesQueryInput, AXMListRegisteredEntitiesQueryResult>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly entityResolver = inject(AXPEntityResolver);\n private readonly translation = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListRegisteredEntitiesQueryInput | null,\n ): AXPQueryFetchResultPromise<AXMListRegisteredEntitiesQueryResult> {\n try {\n const opts = input ?? {};\n const entries = await this.entityResolver.listAll();\n const targetFullName = opts.entityFullName?.trim();\n\n const sorted = [...entries].sort((a, b) => {\n const byModule = a.module.localeCompare(b.module);\n if (byModule !== 0) {\n return byModule;\n }\n return a.name.localeCompare(b.name);\n });\n\n const entities: AXMListRegisteredEntitiesQueryItem[] = [];\n\n for (const e of sorted) {\n if (targetFullName && e.fullName !== targetFullName) {\n continue;\n }\n\n const base: AXMListRegisteredEntitiesQueryItem = {\n module: e.module,\n name: e.name,\n fullName: e.fullName,\n };\n\n if (targetFullName) {\n const def = await this.entityResolver.get(e.module, e.name);\n const props = def?.properties?.map(toRegisteredEntityPropertySummary) ?? [];\n const masterUiActions = def ? axmSummarizeMasterUiActionsForAi(def, (k) => this.resolveEntityCopy(k)) : undefined;\n const quickSearchPaths = def\n ? await collectEntityQuickSearchFieldPaths(def, (m, n) => this.entityResolver.get(m, n))\n : undefined;\n entities.push({\n ...base,\n properties: props,\n ...(quickSearchPaths?.length ? { quickSearchPaths } : {}),\n ...(masterUiActions ? { masterUiActions } : {}),\n });\n } else {\n entities.push(base);\n }\n }\n\n let matchStatus: AXMListRegisteredEntitiesMatchStatus;\n if (!targetFullName) {\n matchStatus = 'catalog';\n } else if (entities.length === 0) {\n matchStatus = 'none';\n } else if (entities.length === 1) {\n matchStatus = 'single';\n } else {\n matchStatus = 'multiple';\n }\n\n return runtimeQuerySuccessObject({\n matchStatus,\n entities,\n });\n } catch (error) {\n return runtimeQueryFailure(\n error instanceof Error ? error.message : 'Unknown error occurred',\n );\n }\n }\n\n //#endregion\n\n //#region ---- Private helpers ----\n\n private resolveEntityCopy(text: string): string {\n try {\n return this.translation.translateSync(text);\n } catch {\n return text;\n }\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;AA6EA;AAEA;AAEA,SAAS,iCAAiC,CAAC,IAAuB,EAAA;AAChE,IAAA,MAAM,KA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,WAAW;gBACX,QAAQ;AACT,aAAA,CAAC;QACJ;QAAE,OAAO,KAAK,EAAE;AACd,YAAA,OAAO,mBAAmB,CACxB,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,wBAAwB,CAClE;QACH;IACF;;;AAMQ,IAAA,iBAAiB,CAAC,IAAY,EAAA;AACpC,QAAA,IAAI;YACF,OAAO,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC;QAC7C;AAAE,QAAA,MAAM;AACN,YAAA,OAAO,IAAI;QACb;IACF;8GA3FW,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA9B,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,8BAA8B,cADjB,MAAM,EAAA,CAAA,CAAA;;2FACnB,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAD1C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-platform-management-client-list-registered-queries.query-C-IfkTel.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/features/queries/list-registered-queries.query.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport {\n resolveCollectionSkip,\n resolveCollectionTake,\n type AXPCollectionQuery,\n type AXPCollectionQueryInput,\n type AXPQueryCollectionFetchResultPromise,\n type AXPQueryKind,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n runtimeQueryFailure,\n runtimeQuerySuccessCollection,\n} from '@acorex-platform/framework-shared/core';\nimport type { AXPPropertyDefinition } from '@acorex-platform/framework-shared/domain';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { RootConfig } from '@acorex-platform/module-platform-management-client/contracts';\nimport type { AXMQueryDefinitionEntityModel } from '@acorex-platform/module-platform-management-client/contracts';\nimport type { AXDataSourceFilterOption } from '@acorex/cdk/common';\n\nimport { Injectable, inject } from '@angular/core';\n\n//#endregion\n\n//#region ----- Types -----\n\nexport interface AXMListRegisteredQueriesQueryInput extends AXPCollectionQueryInput {\n /** Optional exact result DTO id (e.g. `AXPBarChartQueryResult`) to filter catalog rows. */\n resultType?: string;\n /** Optional exact query key (same string used in `options.dataSource` / `options.query`). */\n queryName?: string;\n /** Optional result kind (`value` | `object` | `collection`). Select pickers should pass `collection`. */\n kind?: AXPQueryKind;\n}\n\nexport interface AXMRegisteredQueryCatalogItem {\n name: string;\n title: string;\n kind?: AXPQueryKind;\n resultType?: string;\n description?: string;\n /** Collection select/lookup binding from query metadata. */\n binding?: { valueField: string; textField: string };\n /** Result field schema for object/collection queries. */\n columns?: AXPPropertyDefinition[];\n /** Flattened binding helpers for designers / AI. */\n valueFieldName?: string;\n textFieldName?: string;\n columnNames?: string[];\n}\n\nexport type AXMListRegisteredQueriesQueryResult = AXMRegisteredQueryCatalogItem;\n\n//#endregion\n\n//#region ----- Query -----\n\n/**\n * Lists {@link AXMQueryDefinitionEntityModel} rows from entity storage for designers and pickers.\n * Optional {@link AXMListRegisteredQueriesQueryInput.resultType} / `queryName` / `kind` filters rows.\n * Returns `kind: 'collection'` so select-editors can bind `options.dataSource` to this key.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListRegisteredQueriesQuery\n implements AXPCollectionQuery<AXMListRegisteredQueriesQueryInput, AXMListRegisteredQueriesQueryResult>\n{\n //#region ----- Services & Dependencies -----\n\n private readonly entityService = inject(AXPEntityService);\n\n //#endregion\n\n //#region ----- Query Execution -----\n\n async fetch(\n input?: AXMListRegisteredQueriesQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListRegisteredQueriesQueryResult> {\n try {\n const entityData = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.queryDefinition.name)\n .data<string, AXMQueryDefinitionEntityModel>();\n\n const resultType = input?.resultType?.trim();\n const queryName = input?.queryName?.trim();\n const kind = this.normalizeKind(input?.kind);\n const filters: AXDataSourceFilterOption[] = [];\n if (resultType) {\n filters.push({ field: 'resultType', operator: { type: 'equal' }, value: resultType });\n }\n if (queryName) {\n filters.push({ field: 'name', operator: { type: 'equal' }, value: queryName });\n }\n if (kind) {\n filters.push({ field: 'kind', operator: { type: 'equal' }, value: kind });\n }\n\n const result = await entityData.query({\n skip: 0,\n take: 5000,\n fields: ['id', 'name', 'catalogTitle', 'description', 'resultType', 'kind', 'binding', 'columns'],\n ...(filters.length\n ? { filter: { logic: 'and' as const, filters } }\n : {}),\n });\n\n let rows: AXMListRegisteredQueriesQueryResult[] = (result.items ?? []).map((row) =>\n this.mapRow(row, !!queryName),\n );\n if (kind) {\n rows = rows.filter((row) => row.kind === kind);\n }\n\n rows = rows.sort((a, b) => a.title.localeCompare(b.title));\n\n const skip = resolveCollectionSkip(input?.skip);\n const take = resolveCollectionTake(input?.take);\n const total = rows.length;\n const items = rows.slice(skip, skip + take);\n\n return runtimeQuerySuccessCollection({ items, total });\n } catch (error) {\n return runtimeQueryFailure(\n error instanceof Error ? error.message : 'Unknown error occurred',\n );\n }\n }\n\n //#endregion\n\n //#region ----- Helpers -----\n\n private mapRow(\n row: AXMQueryDefinitionEntityModel,\n includeColumnNames: boolean,\n ): AXMRegisteredQueryCatalogItem {\n const binding = this.resolveBinding(row.binding);\n const columns = this.resolveColumns(row.columns);\n const kind = this.normalizeKind(row.kind);\n const base: AXMRegisteredQueryCatalogItem = {\n name: row.name,\n title: row.catalogTitle ?? row.name,\n ...(kind ? { kind } : {}),\n ...(row.resultType ? { resultType: row.resultType } : {}),\n ...(row.description ? { description: row.description } : {}),\n ...(binding ? { binding } : {}),\n ...(columns.length ? { columns } : {}),\n ...(binding?.valueField ? { valueFieldName: binding.valueField } : {}),\n ...(binding?.textField ? { textFieldName: binding.textField } : {}),\n };\n if (includeColumnNames && columns.length) {\n base.columnNames = columns.map((c) => c.name).filter(Boolean);\n }\n return base;\n }\n\n private normalizeKind(value: unknown): AXPQueryKind | undefined {\n return value === 'value' || value === 'object' || value === 'collection' ? value : undefined;\n }\n\n private resolveBinding(raw: unknown): { valueField: string; textField: string } | undefined {\n if (!raw || typeof raw !== 'object') {\n return undefined;\n }\n const record = raw as { valueField?: unknown; textField?: unknown };\n const valueField = typeof record.valueField === 'string' ? record.valueField.trim() : '';\n const textField = typeof record.textField === 'string' ? record.textField.trim() : '';\n if (!valueField && !textField) {\n return undefined;\n }\n return {\n valueField: valueField || 'id',\n textField: textField || 'title',\n };\n }\n\n private resolveColumns(raw: unknown): AXPPropertyDefinition[] {\n if (Array.isArray(raw)) {\n return raw.filter(\n (col): col is AXPPropertyDefinition =>\n !!col && typeof col === 'object' && typeof (col as AXPPropertyDefinition).name === 'string',\n );\n }\n if (raw && typeof raw === 'object' && Array.isArray((raw as { definition?: unknown }).definition)) {\n return this.resolveColumns((raw as { definition: unknown }).definition);\n }\n return [];\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;AAAA;AAqDA;AAEA;AAEA;;;;AAIG;MAEU,6BAA6B,CAAA;AAD1C,IAAA,WAAA,GAAA;;AAMmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAyH1D,IAAA;;;IAnHC,MAAM,KAAK,CACT,KAAiD,EAAA;AAEjD,QAAA,IAAI;AACF,YAAA,MAAM,UAAU,GAAG,IAAI,CAAC;AACrB,iBAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI;AAC3E,iBAAA,IAAI,EAAyC;YAEhD,MAAM,UAAU,GAAG,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE;YAC5C,MAAM,SAAS,GAAG,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE;YAC1C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I,CAAC,UAAU,IAAI,CAAC,SAAS,EAAE;AAC7B,YAAA,OAAO,SAAS;QAClB;QACA,OAAO;YACL,UAAU,EAAE,UAAU,IAAI,IAAI;YAC9B,SAAS,EAAE,SAAS,IAAI,OAAO;SAChC;IACH;AAEQ,IAAA,cAAc,CAAC,GAAY,EAAA;AACjC,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACtB,OAAO,GAAG,CAAC,MAAM,CACf,CAAC,GAAG,KACF,CAAC,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAQ,GAA6B,CAAC,IAAI,KAAK,QAAQ,CAC9F;QACH;AACA,QAAA,IAAI,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAE,GAAgC,CAAC,UAAU,CAAC,EAAE;YACjG,OAAO,IAAI,CAAC,cAAc,CAAE,GAA+B,CAAC,UAAU,CAAC;QACzE;AACA,QAAA,OAAO,EAAE;IACX;8GA3HW,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA7B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,6BAA6B,cADhB,MAAM,EAAA,CAAA,CAAA;;2FACnB,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBADzC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-platform-management-client-list-registered-queries.query-C-IfkTel.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/features/queries/list-registered-queries.query.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport {\n resolveCollectionSkip,\n resolveCollectionTake,\n type AXPCollectionQuery,\n type AXPCollectionQueryInput,\n type AXPQueryCollectionFetchResultPromise,\n type AXPQueryKind,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n runtimeQueryFailure,\n runtimeQuerySuccessCollection,\n} from '@acorex-platform/framework-shared/core';\nimport type { AXPPropertyDefinition } from '@acorex-platform/framework-shared/domain';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { RootConfig } from '@acorex-platform/module-platform-management-client/contracts';\nimport type { AXMQueryDefinitionEntityModel } from '@acorex-platform/module-platform-management-client/contracts';\nimport type { AXDataSourceFilterOption } from '@acorex/cdk/common';\n\nimport { Injectable, inject } from '@angular/core';\n\n//#endregion\n\n//#region ----- Types -----\n\nexport interface AXMListRegisteredQueriesQueryInput extends AXPCollectionQueryInput {\n /** Optional exact result DTO id (e.g. `AXPBarChartQueryResult`) to filter catalog rows. */\n resultType?: string;\n /** Optional exact query key (same string used in `options.dataSource` / `options.query`). */\n queryName?: string;\n /** Optional result kind (`value` | `object` | `collection`). Select pickers should pass `collection`. */\n kind?: AXPQueryKind;\n}\n\nexport interface AXMRegisteredQueryCatalogItem {\n name: string;\n title: string;\n kind?: AXPQueryKind;\n resultType?: string;\n description?: string;\n /** Collection select/lookup binding from query metadata. */\n binding?: { valueField: string; textField: string };\n /** Result field schema for object/collection queries. */\n columns?: AXPPropertyDefinition[];\n /** Flattened binding helpers for designers / AI. */\n valueFieldName?: string;\n textFieldName?: string;\n columnNames?: string[];\n}\n\nexport type AXMListRegisteredQueriesQueryResult = AXMRegisteredQueryCatalogItem;\n\n//#endregion\n\n//#region ----- Query -----\n\n/**\n * Lists {@link AXMQueryDefinitionEntityModel} rows from entity storage for designers and pickers.\n * Optional {@link AXMListRegisteredQueriesQueryInput.resultType} / `queryName` / `kind` filters rows.\n * Returns `kind: 'collection'` so select-editors can bind `options.dataSource` to this key.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListRegisteredQueriesQuery\n implements AXPCollectionQuery<AXMListRegisteredQueriesQueryInput, AXMListRegisteredQueriesQueryResult>\n{\n //#region ----- Services & Dependencies -----\n\n private readonly entityService = inject(AXPEntityService);\n\n //#endregion\n\n //#region ----- Query Execution -----\n\n async fetch(\n input?: AXMListRegisteredQueriesQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListRegisteredQueriesQueryResult> {\n try {\n const entityData = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.queryDefinition.name)\n .data<string, AXMQueryDefinitionEntityModel>();\n\n const resultType = input?.resultType?.trim();\n const queryName = input?.queryName?.trim();\n const kind = this.normalizeKind(input?.kind);\n const filters: AXDataSourceFilterOption[] = [];\n if (resultType) {\n filters.push({ field: 'resultType', operator: { type: 'equal' }, value: resultType });\n }\n if (queryName) {\n filters.push({ field: 'name', operator: { type: 'equal' }, value: queryName });\n }\n if (kind) {\n filters.push({ field: 'kind', operator: { type: 'equal' }, value: kind });\n }\n\n const result = await entityData.query({\n skip: 0,\n take: 5000,\n fields: ['id', 'name', 'catalogTitle', 'description', 'resultType', 'kind', 'binding', 'columns'],\n ...(filters.length\n ? { filter: { logic: 'and' as const, filters } }\n : {}),\n });\n\n let rows: AXMListRegisteredQueriesQueryResult[] = (result.items ?? []).map((row) =>\n this.mapRow(row, !!queryName),\n );\n if (kind) {\n rows = rows.filter((row) => row.kind === kind);\n }\n\n rows = rows.sort((a, b) => a.title.localeCompare(b.title));\n\n const skip = resolveCollectionSkip(input?.skip);\n const take = resolveCollectionTake(input?.take);\n const total = rows.length;\n const items = rows.slice(skip, skip + take);\n\n return runtimeQuerySuccessCollection({ items, total });\n } catch (error) {\n return runtimeQueryFailure(\n error instanceof Error ? error.message : 'Unknown error occurred',\n );\n }\n }\n\n //#endregion\n\n //#region ----- Helpers -----\n\n private mapRow(\n row: AXMQueryDefinitionEntityModel,\n includeColumnNames: boolean,\n ): AXMRegisteredQueryCatalogItem {\n const binding = this.resolveBinding(row.binding);\n const columns = this.resolveColumns(row.columns);\n const kind = this.normalizeKind(row.kind);\n const base: AXMRegisteredQueryCatalogItem = {\n name: row.name,\n title: row.catalogTitle ?? row.name,\n ...(kind ? { kind } : {}),\n ...(row.resultType ? { resultType: row.resultType } : {}),\n ...(row.description ? { description: row.description } : {}),\n ...(binding ? { binding } : {}),\n ...(columns.length ? { columns } : {}),\n ...(binding?.valueField ? { valueFieldName: binding.valueField } : {}),\n ...(binding?.textField ? { textFieldName: binding.textField } : {}),\n };\n if (includeColumnNames && columns.length) {\n base.columnNames = columns.map((c) => c.name).filter(Boolean);\n }\n return base;\n }\n\n private normalizeKind(value: unknown): AXPQueryKind | undefined {\n return value === 'value' || value === 'object' || value === 'collection' ? value : undefined;\n }\n\n private resolveBinding(raw: unknown): { valueField: string; textField: string } | undefined {\n if (!raw || typeof raw !== 'object') {\n return undefined;\n }\n const record = raw as { valueField?: unknown; textField?: unknown };\n const valueField = typeof record.valueField === 'string' ? record.valueField.trim() : '';\n const textField = typeof record.textField === 'string' ? record.textField.trim() : '';\n if (!valueField && !textField) {\n return undefined;\n }\n return {\n valueField: valueField || 'id',\n textField: textField || 'title',\n };\n }\n\n private resolveColumns(raw: unknown): AXPPropertyDefinition[] {\n if (Array.isArray(raw)) {\n return raw.filter(\n (col): col is AXPPropertyDefinition =>\n !!col && typeof col === 'object' && typeof (col as AXPPropertyDefinition).name === 'string',\n );\n }\n if (raw && typeof raw === 'object' && Array.isArray((raw as { definition?: unknown }).definition)) {\n return this.resolveColumns((raw as { definition: unknown }).definition);\n }\n return [];\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;AAAA;AAqDA;AAEA;AAEA;;;;AAIG;MAEU,6BAA6B,CAAA;AAD1C,IAAA,WAAA,GAAA;;AAMmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAyH1D,IAAA;;;IAnHC,MAAM,KAAK,CACT,KAAiD,EAAA;AAEjD,QAAA,IAAI;AACF,YAAA,MAAM,UAAU,GAAG,IAAI,CAAC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CAAA;kBADzC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { provideLocalEntityCatalog } from '@acorex-platform/framework-client/layout/entity';
|
|
2
|
+
import { RootConfig } from '@acorex-platform/module-platform-management-client/contracts';
|
|
3
|
+
export { platformManagementLocalEntityCatalog } from '@acorex-platform/module-platform-management-client/contracts/entity-catalog';
|
|
4
|
+
|
|
5
|
+
//#region ----- Imports -----
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region ----- Provide local entities -----
|
|
8
|
+
/**
|
|
9
|
+
* Registers platform-management layouts on the client from packaged factories.
|
|
10
|
+
* Each `import()` targets a secondary entry so unused entities stay out of the
|
|
11
|
+
* bundle. Do not add this to the demo app; demo continues to load layouts via
|
|
12
|
+
* `Domain:GetEntityLayout`.
|
|
13
|
+
*/
|
|
14
|
+
function providePlatformManagementLocalEntities() {
|
|
15
|
+
return provideLocalEntityCatalog({
|
|
16
|
+
moduleName: RootConfig.module.name,
|
|
17
|
+
loaders: {
|
|
18
|
+
[RootConfig.entities.commandDefinition.name]: () => import('@acorex-platform/module-platform-management-client/contracts/entities/command-definition').then((m) => m.commandDefinitionEntityFactory()),
|
|
19
|
+
[RootConfig.entities.entityAccessPolicy.name]: () => import('@acorex-platform/module-platform-management-client/contracts/entities/entity-access-policy').then((m) => m.entityAccessPolicyEntityFactory()),
|
|
20
|
+
[RootConfig.entities.entityDefinition.name]: () => import('@acorex-platform/module-platform-management-client/contracts/entities/entity-definition').then((m) => m.entityDefinitionEntityFactory()),
|
|
21
|
+
[RootConfig.entities.pluginDefinition.name]: () => import('@acorex-platform/module-platform-management-client/contracts/entities/plugin-definition').then((m) => m.pluginDefinitionEntityFactory()),
|
|
22
|
+
[RootConfig.entities.queryDefinition.name]: () => import('@acorex-platform/module-platform-management-client/contracts/entities/query-definition').then((m) => m.queryDefinitionEntityFactory()),
|
|
23
|
+
[RootConfig.entities.token.name]: () => import('@acorex-platform/module-platform-management-client/contracts/entities/token').then((m) => m.tokenEntityFactory()),
|
|
24
|
+
[RootConfig.entities.widget.name]: () => import('@acorex-platform/module-platform-management-client/contracts/entities/widget').then((m) => m.widgetEntityFactory()),
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Generated bundle index. Do not edit.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
export { providePlatformManagementLocalEntities };
|
|
35
|
+
//# sourceMappingURL=acorex-platform-module-platform-management-client-local-entities.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-platform-management-client-local-entities.mjs","sources":["../../../../libs/modules/platform-management/client/src/lib/provide-local-entities.ts","../../../../libs/modules/platform-management/client/src/lib/acorex-platform-module-platform-management-client-local-entities.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { provideLocalEntityCatalog } from '@acorex-platform/framework-client/layout/entity';\nimport { RootConfig } from '@acorex-platform/module-platform-management-client/contracts';\n\n//#endregion\n\n//#region ----- Provide local entities -----\n\n/**\n * Registers platform-management layouts on the client from packaged factories.\n * Each `import()` targets a secondary entry so unused entities stay out of the\n * bundle. Do not add this to the demo app; demo continues to load layouts via\n * `Domain:GetEntityLayout`.\n */\nexport function providePlatformManagementLocalEntities() {\n return provideLocalEntityCatalog({\n moduleName: RootConfig.module.name,\n loaders: {\n [RootConfig.entities.commandDefinition.name]: () =>\n import('@acorex-platform/module-platform-management-client/contracts/entities/command-definition').then((m) => m.commandDefinitionEntityFactory()),\n [RootConfig.entities.entityAccessPolicy.name]: () =>\n import('@acorex-platform/module-platform-management-client/contracts/entities/entity-access-policy').then((m) => m.entityAccessPolicyEntityFactory()),\n [RootConfig.entities.entityDefinition.name]: () =>\n import('@acorex-platform/module-platform-management-client/contracts/entities/entity-definition').then((m) => m.entityDefinitionEntityFactory()),\n [RootConfig.entities.pluginDefinition.name]: () =>\n import('@acorex-platform/module-platform-management-client/contracts/entities/plugin-definition').then((m) => m.pluginDefinitionEntityFactory()),\n [RootConfig.entities.queryDefinition.name]: () =>\n import('@acorex-platform/module-platform-management-client/contracts/entities/query-definition').then((m) => m.queryDefinitionEntityFactory()),\n [RootConfig.entities.token.name]: () =>\n import('@acorex-platform/module-platform-management-client/contracts/entities/token').then((m) => m.tokenEntityFactory()),\n [RootConfig.entities.widget.name]: () =>\n import('@acorex-platform/module-platform-management-client/contracts/entities/widget').then((m) => m.widgetEntityFactory()),\n },\n });\n}\n\nexport { platformManagementLocalEntityCatalog } from '@acorex-platform/module-platform-management-client/contracts/entity-catalog';\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './provide-local-entities';\n"],"names":[],"mappings":";;;;AAAA;AAKA;AAEA;AAEA;;;;;AAKG;SACa,sCAAsC,GAAA;AACpD,IAAA,OAAO,yBAAyB,CAAC;AAC/B,QAAA,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAClC,QAAA,OAAO,EAAE;AACP,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,iBAAiB,CAAC,IAAI,GAAG,MAC5C,OAAO,0FAA0F,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,8BAA8B,EAAE,CAAC;AACpJ,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI,GAAG,MAC7C,OAAO,4FAA4F,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,+BAA+B,EAAE,CAAC;AACvJ,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,GAAG,MAC3C,OAAO,yFAAyF,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,6BAA6B,EAAE,CAAC;AAClJ,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,GAAG,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