/** * @license * * Copyright 2026 Adobe. All rights reserved. * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ //#region source/menu/acl-resource-id.d.ts /** * Derives the deterministic Commerce ACL resource id for a specific menu item. * * The id is assembled as: `getAclResourceId(metadataId)` + `"_menu_"` + sanitized `menuId`. * Each segment is sanitized independently (trimmed, lowercased, non-`[a-z0-9_]` → `_`). * `"Magento_CommerceBackendUix::adminuisdk_app_"` in the example is the fixed constant prefix * (not a placeholder), and `"_menu_"` is the literal keyword separator for this component: * * @example * ``` * getMenuAclResourceId("approval-dashboard-app", "approval_dashboard") * // getAclResourceId("approval-dashboard-app") + "_menu_" + sanitize("approval_dashboard") * // "Magento_CommerceBackendUix::adminuisdk_app_approval_dashboard_app" + "_menu_" + "approval_dashboard" * // → "Magento_CommerceBackendUix::adminuisdk_app_approval_dashboard_app_menu_approval_dashboard" * ``` * * @param metadataId - The application's `metadata.id` value (e.g. `"approval-dashboard-app"`). * @param menuId - The menu item's `id` value from `adminUi.menu.id` (e.g. `"approval_dashboard"`). * @returns The full Commerce ACL resource id for the menu leaf node, or an empty string * when `metadataId` is blank. */ declare function getMenuAclResourceId(metadataId: string, menuId: string): string; //#endregion //#region source/menu/paths.d.ts /** Menu ID for "Catalog" in the Adobe Commerce admin */ declare const MENU_CATALOG = "catalog"; /** Menu ID for "Customers" in the Adobe Commerce admin */ declare const MENU_CUSTOMERS = "customers"; /** Menu ID for "Marketing" in the Adobe Commerce admin */ declare const MENU_MARKETING = "marketing"; /** Menu ID for "Content" in the Adobe Commerce admin */ declare const MENU_CONTENT = "content"; /** Menu ID for "Reports" in the Adobe Commerce admin */ declare const MENU_REPORTS = "reports"; /** Menu ID for "Sales" in the Adobe Commerce admin */ declare const MENU_SALES = "sales"; /** Menu ID for "Stores" in the Adobe Commerce admin */ declare const MENU_STORES = "stores"; /** Menu ID for "System" in the Adobe Commerce admin */ declare const MENU_SYSTEM = "system"; /** All Commerce Admin menus available for app attachment. */ declare const COMMERCE_MENUS: readonly ["sales", "catalog", "customers", "marketing", "content", "reports", "stores", "system"]; /** A union type of all known supported Commerce Admin menu IDs. */ type CommerceMenu = (typeof COMMERCE_MENUS)[number]; /** Returns true if the given string is a known Commerce Admin menu ID. */ declare function isCommerceMenu(menu: string): menu is CommerceMenu; //#endregion export { COMMERCE_MENUS, CommerceMenu, MENU_CATALOG, MENU_CONTENT, MENU_CUSTOMERS, MENU_MARKETING, MENU_REPORTS, MENU_SALES, MENU_STORES, MENU_SYSTEM, getMenuAclResourceId, isCommerceMenu };