@goparrot/franchise-mcp-server
Version:
MCP Server for Franchise API
160 lines (159 loc) • 4.84 kB
JavaScript
import { dashboardBaseUrl, makeRequest } from '../../../common/index.js';
/**
* Method information for dashboard location category endpoints
*/
export const LocationCategoryMethods = {
list: {
description: 'List all categories for a location',
method: 'get',
path: '/storeitems-v2/api/v2/locations/{locationId}/categories',
pathParams: [
{
name: 'locationId',
type: 'string',
description: 'Location ID',
required: true,
},
],
queryParams: [],
requestType: 'ListLocationCategoriesRequest',
isMultipart: false,
originalName: 'list',
isWrite: false,
permissions: ['store-menu-management:api:read'],
},
get: {
description: 'Get a specific category by ID',
method: 'get',
path: '/storeitems-v2/api/v2/locations/{locationId}/categories/{categoryId}',
pathParams: [
{
name: 'locationId',
type: 'string',
description: 'Location ID',
required: true,
},
{
name: 'categoryId',
type: 'string',
description: 'Category ID',
required: true,
},
],
queryParams: [],
requestType: 'GetLocationCategoryRequest',
isMultipart: false,
originalName: 'get',
isWrite: false,
permissions: ['store-menu-management:api:read'],
},
create: {
description: 'Create a new category for a location',
method: 'post',
path: '/storeitems-v2/api/v2/locations/{locationId}/categories',
pathParams: [
{
name: 'locationId',
type: 'string',
description: 'Location ID',
required: true,
},
],
queryParams: [],
requestType: 'CreateLocationCategoryRequest',
isMultipart: false,
originalName: 'create',
isWrite: true,
permissions: ['store-menu-management:api:create'],
},
update: {
description: 'Update a category',
method: 'put',
path: '/storeitems-v2/api/v2/locations/{locationId}/categories/{categoryId}',
pathParams: [
{
name: 'locationId',
type: 'string',
description: 'Location ID',
required: true,
},
{
name: 'categoryId',
type: 'string',
description: 'Category ID',
required: true,
},
],
queryParams: [],
requestType: 'UpdateLocationCategoryRequest',
isMultipart: false,
originalName: 'update',
isWrite: true,
permissions: ['store-menu-management:api:update'],
},
delete: {
description: 'Delete a category',
method: 'delete',
path: '/storeitems-v2/api/v2/locations/{locationId}/categories/{categoryId}',
pathParams: [
{
name: 'locationId',
type: 'string',
description: 'Location ID',
required: true,
},
{
name: 'categoryId',
type: 'string',
description: 'Category ID',
required: true,
},
],
queryParams: [],
requestType: 'DeleteLocationCategoryRequest',
isMultipart: false,
originalName: 'delete',
isWrite: true,
permissions: ['store-menu-management:api:delete'],
},
};
/**
* Handlers for dashboard location category endpoints
*/
export const LocationCategoryHandlers = {
list: async (accessToken, args) => {
return makeRequest(LocationCategoryMethods.list, {
baseUrl: dashboardBaseUrl,
accessToken,
args,
});
},
get: async (accessToken, args) => {
return makeRequest(LocationCategoryMethods.get, {
baseUrl: dashboardBaseUrl,
accessToken,
args,
});
},
create: async (accessToken, args) => {
return makeRequest(LocationCategoryMethods.create, {
baseUrl: dashboardBaseUrl,
accessToken,
args,
});
},
update: async (accessToken, args) => {
return makeRequest(LocationCategoryMethods.update, {
baseUrl: dashboardBaseUrl,
accessToken,
args,
});
},
delete: async (accessToken, args) => {
return makeRequest(LocationCategoryMethods.delete, {
baseUrl: dashboardBaseUrl,
accessToken,
args,
});
},
};