UNPKG

@goparrot/franchise-mcp-server

Version:

MCP Server for Franchise API

494 lines (493 loc) 16.1 kB
import { dashboardBaseUrl, makeRequest } from '../../../common/index.js'; /** * Method information for dashboard menu orchestrator endpoints */ export const MenuOrchestratorMethods = { // Menu Actions endpoints setTitlePrefixes: { description: 'Set title prefixes for menu items', method: 'post', path: '/menuOrchestrator/api/v1/stores/{storeId}/menu-actions/set-title-prefixes', pathParams: [ { name: 'storeId', type: 'string', description: 'Store ID', required: true, }, ], queryParams: [], requestType: 'SetTitlePrefixesRequest', isMultipart: false, originalName: 'setTitlePrefixes', isWrite: true, permissions: ['store-menu-management:api:update'], }, removeStoreSpecificItems: { description: 'Remove store-specific items from the menu', method: 'post', path: '/menuOrchestrator/api/v1/stores/{storeId}/menu-actions/remove-store-specific-items', pathParams: [ { name: 'storeId', type: 'string', description: 'Store ID', required: true, }, ], queryParams: [], requestType: 'RemoveStoreSpecificItemsRequest', isMultipart: false, originalName: 'removeStoreSpecificItems', isWrite: true, permissions: ['store-menu-management:api:update'], }, // Price Copy endpoints copyPrices: { description: 'Copy prices between stores or items', method: 'post', path: '/menuOrchestrator/api/v1/merchants/{merchantId}/copy-prices', pathParams: [ { name: 'merchantId', type: 'string', description: 'Merchant ID', required: true, }, ], queryParams: [], requestType: 'CopyPricesRequest', isMultipart: false, originalName: 'copyPrices', isWrite: true, permissions: ['franchise-management:menu:write'], }, // Batch Location endpoints createManyLocations: { description: 'Create multiple locations for a merchant', method: 'post', path: '/menuOrchestrator/api/v1/batch/merchants/{merchantId}/locations', pathParams: [ { name: 'merchantId', type: 'string', description: 'Merchant ID', required: true, }, ], queryParams: [], requestType: 'CreateManyLocationsRequest', isMultipart: false, originalName: 'createManyLocations', isWrite: true, permissions: ['merchant-menu-management:api:create'], }, deleteLocationsByMerchant: { description: 'Delete all locations for a merchant', method: 'delete', path: '/menuOrchestrator/api/v1/batch/merchants/{merchantId}/locations', pathParams: [ { name: 'merchantId', type: 'string', description: 'Merchant ID', required: true, }, ], queryParams: [], requestType: 'DeleteLocationsByMerchantRequest', isMultipart: false, originalName: 'deleteLocationsByMerchant', isWrite: true, permissions: ['merchant-menu-management:api:delete'], }, updateCatalogByItemSets: { description: 'Update catalog by item sets for locations', method: 'patch', path: '/menuOrchestrator/api/v1/batch/merchants/{merchantId}/locations/item-sets', pathParams: [ { name: 'merchantId', type: 'string', description: 'Merchant ID', required: true, }, ], queryParams: [], requestType: 'UpdateCatalogByItemSetsRequest', isMultipart: false, originalName: 'updateCatalogByItemSets', isWrite: true, permissions: ['merchant-menu-management:api:update', 'franchise-management:api:update'], }, batchPatchLocations: { description: 'Batch patch locations', method: 'patch', path: '/menuOrchestrator/api/v1/batch/merchants/{merchantId}/locations', pathParams: [ { name: 'merchantId', type: 'string', description: 'Merchant ID', required: true, }, ], queryParams: [], requestType: 'BatchPatchLocationsRequest', isMultipart: false, originalName: 'batchPatchLocations', isWrite: true, permissions: ['merchant-menu-management:api:update', 'franchise-management:api:update'], }, // Store Item Mapping endpoints listStoreItemMappings: { description: 'List store item mappings for a store', method: 'get', path: '/menuOrchestrator/api/v1/stores/{storeId}/store-item-mappings', pathParams: [ { name: 'storeId', type: 'string', description: 'Store ID', required: true, }, ], queryParams: [], requestType: 'ListStoreItemMappingsRequest', isMultipart: false, originalName: 'listStoreItemMappings', isWrite: false, permissions: ['store-menu-management:api:read'], }, getStoreItemMapping: { description: 'Get a specific store item mapping', method: 'get', path: '/menuOrchestrator/api/v1/stores/{storeId}/store-item-mappings/{replicaUniqueName}', pathParams: [ { name: 'storeId', type: 'string', description: 'Store ID', required: true, }, { name: 'replicaUniqueName', type: 'string', description: 'Replica Unique Name', required: true, }, ], queryParams: [], requestType: 'GetStoreItemMappingRequest', isMultipart: false, originalName: 'getStoreItemMapping', isWrite: false, permissions: ['store-menu-management:api:read'], }, // Location endpoints listLocations: { description: 'List all locations for a merchant', method: 'get', path: '/menuOrchestrator/api/v1/merchants/{merchantId}/locations', pathParams: [ { name: 'merchantId', type: 'string', description: 'Merchant ID', required: true, }, ], queryParams: [], requestType: 'ListLocationsRequest', isMultipart: false, originalName: 'listLocations', isWrite: false, permissions: ['merchant-menu-management:api:read'], }, getCentralLocation: { description: 'Get central location for a merchant', method: 'get', path: '/menuOrchestrator/api/v1/merchants/{merchantId}/locations/central', pathParams: [ { name: 'merchantId', type: 'string', description: 'Merchant ID', required: true, }, ], queryParams: [], requestType: 'GetCentralLocationRequest', isMultipart: false, originalName: 'getCentralLocation', isWrite: false, permissions: ['merchant-menu-management:api:read'], }, getLocation: { description: 'Get a specific location', method: 'get', path: '/menuOrchestrator/api/v1/merchants/{merchantId}/locations/{storeId}', pathParams: [ { name: 'merchantId', type: 'string', description: 'Merchant ID', required: true, }, { name: 'storeId', type: 'string', description: 'Store ID', required: true, }, ], queryParams: [], requestType: 'GetLocationRequest', isMultipart: false, originalName: 'getLocation', isWrite: false, permissions: ['merchant-menu-management:api:read'], }, createLocation: { description: 'Create a new location', method: 'post', path: '/menuOrchestrator/api/v1/merchants/{merchantId}/locations', pathParams: [ { name: 'merchantId', type: 'string', description: 'Merchant ID', required: true, }, ], queryParams: [], requestType: 'CreateLocationRequest', isMultipart: false, originalName: 'createLocation', isWrite: true, permissions: ['merchant-menu-management:api:create'], }, updateLocation: { description: 'Update a location', method: 'put', path: '/menuOrchestrator/api/v1/merchants/{merchantId}/locations/{storeId}', pathParams: [ { name: 'merchantId', type: 'string', description: 'Merchant ID', required: true, }, { name: 'storeId', type: 'string', description: 'Store ID', required: true, }, ], queryParams: [], requestType: 'UpdateLocationRequest', isMultipart: false, originalName: 'updateLocation', isWrite: true, permissions: ['merchant-menu-management:api:update'], }, patchLocation: { description: 'Patch a location', method: 'patch', path: '/menuOrchestrator/api/v1/merchants/{merchantId}/locations/{storeId}', pathParams: [ { name: 'merchantId', type: 'string', description: 'Merchant ID', required: true, }, { name: 'storeId', type: 'string', description: 'Store ID', required: true, }, ], queryParams: [], requestType: 'PatchLocationRequest', isMultipart: false, originalName: 'patchLocation', isWrite: true, permissions: ['merchant-menu-management:api:update'], }, deleteLocation: { description: 'Delete a location', method: 'delete', path: '/menuOrchestrator/api/v1/merchants/{merchantId}/locations/{storeId}', pathParams: [ { name: 'merchantId', type: 'string', description: 'Merchant ID', required: true, }, { name: 'storeId', type: 'string', description: 'Store ID', required: true, }, ], queryParams: [], requestType: 'DeleteLocationRequest', isMultipart: false, originalName: 'deleteLocation', isWrite: true, permissions: ['merchant-menu-management:api:delete'], }, linkToLocation: { description: 'Link central catalog to a location', method: 'patch', path: '/menuOrchestrator/api/v1/merchants/{merchantId}/locations/central/link-to-location', pathParams: [ { name: 'merchantId', type: 'string', description: 'Merchant ID', required: true, }, ], queryParams: [], requestType: 'LinkToLocationRequest', isMultipart: false, originalName: 'linkToLocation', isWrite: true, permissions: ['merchant-menu-management:api:update'], }, }; /** * Handlers for dashboard menu orchestrator endpoints */ export const MenuOrchestratorHandlers = { // Menu Actions handlers setTitlePrefixes: async (accessToken, args) => { return makeRequest(MenuOrchestratorMethods.setTitlePrefixes, { baseUrl: dashboardBaseUrl, accessToken, args, }); }, removeStoreSpecificItems: async (accessToken, args) => { return makeRequest(MenuOrchestratorMethods.removeStoreSpecificItems, { baseUrl: dashboardBaseUrl, accessToken, args, }); }, // Price Copy handlers copyPrices: async (accessToken, args) => { return makeRequest(MenuOrchestratorMethods.copyPrices, { baseUrl: dashboardBaseUrl, accessToken, args, }); }, // Batch Location handlers createManyLocations: async (accessToken, args) => { return makeRequest(MenuOrchestratorMethods.createManyLocations, { baseUrl: dashboardBaseUrl, accessToken, args, }); }, deleteLocationsByMerchant: async (accessToken, args) => { return makeRequest(MenuOrchestratorMethods.deleteLocationsByMerchant, { baseUrl: dashboardBaseUrl, accessToken, args, }); }, updateCatalogByItemSets: async (accessToken, args) => { return makeRequest(MenuOrchestratorMethods.updateCatalogByItemSets, { baseUrl: dashboardBaseUrl, accessToken, args, }); }, batchPatchLocations: async (accessToken, args) => { return makeRequest(MenuOrchestratorMethods.batchPatchLocations, { baseUrl: dashboardBaseUrl, accessToken, args, }); }, // Store Item Mapping handlers listStoreItemMappings: async (accessToken, args) => { return makeRequest(MenuOrchestratorMethods.listStoreItemMappings, { baseUrl: dashboardBaseUrl, accessToken, args, }); }, getStoreItemMapping: async (accessToken, args) => { return makeRequest(MenuOrchestratorMethods.getStoreItemMapping, { baseUrl: dashboardBaseUrl, accessToken, args, }); }, // Location handlers listLocations: async (accessToken, args) => { return makeRequest(MenuOrchestratorMethods.listLocations, { baseUrl: dashboardBaseUrl, accessToken, args, }); }, getCentralLocation: async (accessToken, args) => { return makeRequest(MenuOrchestratorMethods.getCentralLocation, { baseUrl: dashboardBaseUrl, accessToken, args, }); }, getLocation: async (accessToken, args) => { return makeRequest(MenuOrchestratorMethods.getLocation, { baseUrl: dashboardBaseUrl, accessToken, args, }); }, createLocation: async (accessToken, args) => { return makeRequest(MenuOrchestratorMethods.createLocation, { baseUrl: dashboardBaseUrl, accessToken, args, }); }, updateLocation: async (accessToken, args) => { return makeRequest(MenuOrchestratorMethods.updateLocation, { baseUrl: dashboardBaseUrl, accessToken, args, }); }, patchLocation: async (accessToken, args) => { return makeRequest(MenuOrchestratorMethods.patchLocation, { baseUrl: dashboardBaseUrl, accessToken, args, }); }, deleteLocation: async (accessToken, args) => { return makeRequest(MenuOrchestratorMethods.deleteLocation, { baseUrl: dashboardBaseUrl, accessToken, args, }); }, linkToLocation: async (accessToken, args) => { return makeRequest(MenuOrchestratorMethods.linkToLocation, { baseUrl: dashboardBaseUrl, accessToken, args, }); }, };