@atlas-kitchen/atlas-mcp 1.0.0
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/.env.example +8 -0
- package/CLAUDE.md +135 -0
- package/README.md +161 -0
- package/dist/auth.d.ts +24 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +78 -0
- package/dist/auth.js.map +1 -0
- package/dist/client.d.ts +22 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +1142 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +83 -0
- package/dist/index.js.map +1 -0
- package/dist/polyfills.d.ts +2 -0
- package/dist/polyfills.d.ts.map +1 -0
- package/dist/tools/auth.d.ts +11 -0
- package/dist/tools/auth.d.ts.map +1 -0
- package/dist/tools/auth.js +155 -0
- package/dist/tools/auth.js.map +1 -0
- package/dist/tools/menu.d.ts +11 -0
- package/dist/tools/menu.d.ts.map +1 -0
- package/dist/tools/menu.js +161 -0
- package/dist/tools/menu.js.map +1 -0
- package/dist/tools/orders.d.ts +11 -0
- package/dist/tools/orders.d.ts.map +1 -0
- package/dist/tools/orders.js +170 -0
- package/dist/tools/orders.js.map +1 -0
- package/dist/tools/reports.d.ts +11 -0
- package/dist/tools/reports.d.ts.map +1 -0
- package/dist/tools/reports.js +151 -0
- package/dist/tools/reports.js.map +1 -0
- package/dist/types/atlas.d.ts +125 -0
- package/dist/types/atlas.d.ts.map +1 -0
- package/dist/types/atlas.js +2 -0
- package/dist/types/atlas.js.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const GetOrdersSchema = z.object({
|
|
3
|
+
startDate: z.string().optional(),
|
|
4
|
+
endDate: z.string().optional(),
|
|
5
|
+
state: z.string().optional(),
|
|
6
|
+
limit: z.number().min(1).max(100).default(20),
|
|
7
|
+
cursor: z.string().optional(),
|
|
8
|
+
});
|
|
9
|
+
const GetOrderSchema = z.object({
|
|
10
|
+
orderId: z.string(),
|
|
11
|
+
});
|
|
12
|
+
const GetCartSchema = z.object({
|
|
13
|
+
cartId: z.string(),
|
|
14
|
+
});
|
|
15
|
+
export function createOrderTools(client, authManager) {
|
|
16
|
+
return [
|
|
17
|
+
{
|
|
18
|
+
name: 'atlas_get_orders',
|
|
19
|
+
description: 'List orders with optional filters',
|
|
20
|
+
inputSchema: {
|
|
21
|
+
type: 'object',
|
|
22
|
+
properties: {
|
|
23
|
+
startDate: { type: 'string', description: 'Start date for filtering (ISO format)' },
|
|
24
|
+
endDate: { type: 'string', description: 'End date for filtering (ISO format)' },
|
|
25
|
+
state: { type: 'string', description: 'Order state filter (unpaid, confirmed, dispatched, ready_for_pickup, completed, cancelled)' },
|
|
26
|
+
limit: { type: 'number', description: 'Number of orders to return (1-100, default: 20)' },
|
|
27
|
+
cursor: { type: 'string', description: 'Pagination cursor from previous request' },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
handler: async (input) => {
|
|
31
|
+
const { startDate, endDate, state, limit, cursor } = GetOrdersSchema.parse(input);
|
|
32
|
+
if (!authManager.isAuthenticated()) {
|
|
33
|
+
return {
|
|
34
|
+
success: false,
|
|
35
|
+
error: 'Not authenticated. Please login first.',
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
const filters = {
|
|
40
|
+
first: limit,
|
|
41
|
+
};
|
|
42
|
+
if (startDate)
|
|
43
|
+
filters.startDate = startDate;
|
|
44
|
+
if (endDate)
|
|
45
|
+
filters.endDate = endDate;
|
|
46
|
+
if (state)
|
|
47
|
+
filters.state = state;
|
|
48
|
+
if (cursor)
|
|
49
|
+
filters.after = cursor;
|
|
50
|
+
const response = await client.getOrders(filters);
|
|
51
|
+
return {
|
|
52
|
+
success: true,
|
|
53
|
+
orders: response.orders,
|
|
54
|
+
totalCount: response.totalCount,
|
|
55
|
+
page: response.page,
|
|
56
|
+
perPage: response.perPage,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
return {
|
|
61
|
+
success: false,
|
|
62
|
+
error: error.message || 'Failed to fetch orders',
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'atlas_get_order',
|
|
69
|
+
description: 'Get detailed information about a specific order',
|
|
70
|
+
inputSchema: {
|
|
71
|
+
type: 'object',
|
|
72
|
+
properties: {
|
|
73
|
+
orderId: { type: 'string', description: 'Order ID or identifier' },
|
|
74
|
+
},
|
|
75
|
+
required: ['orderId'],
|
|
76
|
+
},
|
|
77
|
+
handler: async (input) => {
|
|
78
|
+
const { orderId } = GetOrderSchema.parse(input);
|
|
79
|
+
if (!authManager.isAuthenticated()) {
|
|
80
|
+
return {
|
|
81
|
+
success: false,
|
|
82
|
+
error: 'Not authenticated. Please login first.',
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
try {
|
|
86
|
+
const order = await client.getOrder(orderId);
|
|
87
|
+
return {
|
|
88
|
+
success: true,
|
|
89
|
+
order,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
return {
|
|
94
|
+
success: false,
|
|
95
|
+
error: error.message || 'Failed to fetch order',
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: 'atlas_get_cart',
|
|
102
|
+
description: 'Get information about a specific cart',
|
|
103
|
+
inputSchema: {
|
|
104
|
+
type: 'object',
|
|
105
|
+
properties: {
|
|
106
|
+
cartId: { type: 'string', description: 'Cart ID' },
|
|
107
|
+
},
|
|
108
|
+
required: ['cartId'],
|
|
109
|
+
},
|
|
110
|
+
handler: async (input) => {
|
|
111
|
+
const { cartId } = GetCartSchema.parse(input);
|
|
112
|
+
if (!authManager.isAuthenticated()) {
|
|
113
|
+
return {
|
|
114
|
+
success: false,
|
|
115
|
+
error: 'Not authenticated. Please login first.',
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
try {
|
|
119
|
+
const cart = await client.getCart(cartId);
|
|
120
|
+
return {
|
|
121
|
+
success: true,
|
|
122
|
+
cart,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
return {
|
|
127
|
+
success: false,
|
|
128
|
+
error: error.message || 'Failed to fetch cart',
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: 'atlas_get_pos_carts',
|
|
135
|
+
description: 'List all open POS carts',
|
|
136
|
+
inputSchema: {
|
|
137
|
+
type: 'object',
|
|
138
|
+
properties: {},
|
|
139
|
+
},
|
|
140
|
+
handler: async () => {
|
|
141
|
+
if (!authManager.isAuthenticated()) {
|
|
142
|
+
return {
|
|
143
|
+
success: false,
|
|
144
|
+
error: 'Not authenticated. Please login first.',
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
if (!authManager.getOutletId()) {
|
|
148
|
+
return {
|
|
149
|
+
success: false,
|
|
150
|
+
error: 'No outlet selected. Please use atlas_switch_merchant with an outletId first.',
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
try {
|
|
154
|
+
const carts = await client.getOpenPosCarts();
|
|
155
|
+
return {
|
|
156
|
+
success: true,
|
|
157
|
+
carts,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
catch (error) {
|
|
161
|
+
return {
|
|
162
|
+
success: false,
|
|
163
|
+
error: error.message || 'Failed to fetch POS carts',
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
];
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=orders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orders.js","sourceRoot":"","sources":["../../src/tools/orders.ts"],"names":[],"mappings":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
1
|
+
import { AtlasClient } from '../client.js';
|
|
2
|
+
import { AuthManager } from '../auth.js';
|
|
3
|
+
interface Tool {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: any;
|
|
7
|
+
handler: (input: unknown) => Promise<any>;
|
|
8
|
+
}
|
|
9
|
+
export declare function createReportingTools(client: AtlasClient, authManager: AuthManager): Tool[];
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=reports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reports.d.ts","sourceRoot":"","sources":["../../src/tools/reports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC,UAAU,IAAI;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,GAAG,CAAC;IACjB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CAC3C;AA4BD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,GAAG,IAAI,EAAE,CAwH1F"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const GetSalesReportSchema = z.object({
|
|
3
|
+
startDate: z.string(),
|
|
4
|
+
endDate: z.string(),
|
|
5
|
+
brandIds: z.array(z.number()).optional(),
|
|
6
|
+
outletIds: z.array(z.number()).optional(),
|
|
7
|
+
stationIds: z.array(z.number()).optional(),
|
|
8
|
+
promoCodes: z.array(z.string()).optional(),
|
|
9
|
+
includeCancelledOrders: z.boolean().optional(),
|
|
10
|
+
daysOfWeek: z.array(z.number()).optional(),
|
|
11
|
+
orderSources: z.array(z.string()).optional(),
|
|
12
|
+
diningOptions: z.array(z.string()).optional(),
|
|
13
|
+
});
|
|
14
|
+
const GetProductInsightsSchema = z.object({
|
|
15
|
+
brandIds: z.array(z.number()),
|
|
16
|
+
outletIds: z.array(z.number()),
|
|
17
|
+
itemTypes: z.array(z.string()),
|
|
18
|
+
fulfilmentTypes: z.array(z.string()),
|
|
19
|
+
startDate: z.string(),
|
|
20
|
+
endDate: z.string(),
|
|
21
|
+
sources: z.array(z.string()).optional(),
|
|
22
|
+
itemTagIds: z.array(z.number()).optional(),
|
|
23
|
+
searchQuery: z.string().optional(),
|
|
24
|
+
itemsToVisualize: z.array(z.string()).optional(),
|
|
25
|
+
});
|
|
26
|
+
export function createReportingTools(client, authManager) {
|
|
27
|
+
return [
|
|
28
|
+
{
|
|
29
|
+
name: 'atlas_get_sales_report',
|
|
30
|
+
description: 'Get sales summary report with filters',
|
|
31
|
+
inputSchema: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
properties: {
|
|
34
|
+
startDate: { type: 'string', description: 'Start date (ISO format YYYY-MM-DD)' },
|
|
35
|
+
endDate: { type: 'string', description: 'End date (ISO format YYYY-MM-DD)' },
|
|
36
|
+
brandIds: { type: 'array', items: { type: 'number' }, description: 'Filter by brand IDs' },
|
|
37
|
+
outletIds: { type: 'array', items: { type: 'number' }, description: 'Filter by outlet IDs' },
|
|
38
|
+
stationIds: { type: 'array', items: { type: 'number' }, description: 'Filter by station IDs' },
|
|
39
|
+
promoCodes: { type: 'array', items: { type: 'string' }, description: 'Filter by promo codes' },
|
|
40
|
+
includeCancelledOrders: { type: 'boolean', description: 'Include cancelled orders (default: false)' },
|
|
41
|
+
daysOfWeek: { type: 'array', items: { type: 'number' }, description: 'ISO day of week (1-7)' },
|
|
42
|
+
orderSources: { type: 'array', items: { type: 'string' }, description: 'Filter by order sources' },
|
|
43
|
+
diningOptions: { type: 'array', items: { type: 'string' }, description: 'Filter by dining options' },
|
|
44
|
+
},
|
|
45
|
+
required: ['startDate', 'endDate'],
|
|
46
|
+
},
|
|
47
|
+
handler: async (input) => {
|
|
48
|
+
const parsed = GetSalesReportSchema.parse(input);
|
|
49
|
+
const { startDate, endDate, ...filterOptions } = parsed;
|
|
50
|
+
if (!authManager.isAuthenticated()) {
|
|
51
|
+
return {
|
|
52
|
+
success: false,
|
|
53
|
+
error: 'Not authenticated. Please login first.',
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
// Build filters object, only including provided values
|
|
58
|
+
const filters = {};
|
|
59
|
+
if (filterOptions.brandIds)
|
|
60
|
+
filters.brandIds = filterOptions.brandIds;
|
|
61
|
+
if (filterOptions.outletIds)
|
|
62
|
+
filters.outletIds = filterOptions.outletIds;
|
|
63
|
+
if (filterOptions.stationIds)
|
|
64
|
+
filters.stationIds = filterOptions.stationIds;
|
|
65
|
+
if (filterOptions.promoCodes)
|
|
66
|
+
filters.promoCodes = filterOptions.promoCodes;
|
|
67
|
+
if (filterOptions.includeCancelledOrders !== undefined)
|
|
68
|
+
filters.includeCancelledOrders = filterOptions.includeCancelledOrders;
|
|
69
|
+
if (filterOptions.daysOfWeek)
|
|
70
|
+
filters.daysOfWeek = filterOptions.daysOfWeek;
|
|
71
|
+
if (filterOptions.orderSources)
|
|
72
|
+
filters.orderSources = filterOptions.orderSources;
|
|
73
|
+
if (filterOptions.diningOptions)
|
|
74
|
+
filters.diningOptions = filterOptions.diningOptions;
|
|
75
|
+
const dateRange = { start_date: startDate, end_date: endDate };
|
|
76
|
+
const report = await client.getSalesReport(filters, dateRange);
|
|
77
|
+
return {
|
|
78
|
+
success: true,
|
|
79
|
+
report,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
return {
|
|
84
|
+
success: false,
|
|
85
|
+
error: error.message || 'Failed to fetch sales report',
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'atlas_get_product_insights',
|
|
92
|
+
description: 'Get product performance insights with required filters',
|
|
93
|
+
inputSchema: {
|
|
94
|
+
type: 'object',
|
|
95
|
+
properties: {
|
|
96
|
+
brandIds: { type: 'array', items: { type: 'number' }, description: 'Brand IDs (required)' },
|
|
97
|
+
outletIds: { type: 'array', items: { type: 'number' }, description: 'Outlet IDs (required)' },
|
|
98
|
+
itemTypes: { type: 'array', items: { type: 'string' }, description: 'Item types e.g. ["ITEM", "MODIFIER"] (required)' },
|
|
99
|
+
fulfilmentTypes: { type: 'array', items: { type: 'string' }, description: 'Fulfilment types e.g. ["DELIVERY", "PICKUP"] (required)' },
|
|
100
|
+
startDate: { type: 'string', description: 'Start date (ISO format YYYY-MM-DD)' },
|
|
101
|
+
endDate: { type: 'string', description: 'End date (ISO format YYYY-MM-DD)' },
|
|
102
|
+
sources: { type: 'array', items: { type: 'string' }, description: 'Order sources' },
|
|
103
|
+
itemTagIds: { type: 'array', items: { type: 'number' }, description: 'Item tag IDs' },
|
|
104
|
+
searchQuery: { type: 'string', description: 'Search query for product names' },
|
|
105
|
+
itemsToVisualize: { type: 'array', items: { type: 'string' }, description: 'Product names to visualize' },
|
|
106
|
+
},
|
|
107
|
+
required: ['brandIds', 'outletIds', 'itemTypes', 'fulfilmentTypes', 'startDate', 'endDate'],
|
|
108
|
+
},
|
|
109
|
+
handler: async (input) => {
|
|
110
|
+
const parsed = GetProductInsightsSchema.parse(input);
|
|
111
|
+
const { startDate, endDate, ...otherParams } = parsed;
|
|
112
|
+
if (!authManager.isAuthenticated()) {
|
|
113
|
+
return {
|
|
114
|
+
success: false,
|
|
115
|
+
error: 'Not authenticated. Please login first.',
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
try {
|
|
119
|
+
const params = {
|
|
120
|
+
brandIds: otherParams.brandIds,
|
|
121
|
+
outletIds: otherParams.outletIds,
|
|
122
|
+
itemTypes: otherParams.itemTypes,
|
|
123
|
+
fulfilmentTypes: otherParams.fulfilmentTypes,
|
|
124
|
+
servingDateBetween: { start_date: startDate, end_date: endDate },
|
|
125
|
+
};
|
|
126
|
+
// Only add optional parameters if they're provided
|
|
127
|
+
if (otherParams.sources)
|
|
128
|
+
params.sources = otherParams.sources;
|
|
129
|
+
if (otherParams.itemTagIds)
|
|
130
|
+
params.itemTagIds = otherParams.itemTagIds;
|
|
131
|
+
if (otherParams.searchQuery)
|
|
132
|
+
params.searchQuery = otherParams.searchQuery;
|
|
133
|
+
if (otherParams.itemsToVisualize)
|
|
134
|
+
params.itemsToVisualize = otherParams.itemsToVisualize;
|
|
135
|
+
const insights = await client.getProductInsights(params);
|
|
136
|
+
return {
|
|
137
|
+
success: true,
|
|
138
|
+
insights,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
return {
|
|
143
|
+
success: false,
|
|
144
|
+
error: error.message || 'Failed to fetch product insights',
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
];
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=reports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reports.js","sourceRoot":"","sources":["../../src/tools/reports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACxC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACzC,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC1C,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CA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WAAW,CAAC,UAAU;wBAAE,MAAM,CAAC,UAAU,GAAG,WAAW,CAAC,UAAU,CAAC;oBACvE,IAAI,WAAW,CAAC,WAAW;wBAAE,MAAM,CAAC,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC;oBAC1E,IAAI,WAAW,CAAC,gBAAgB;wBAAE,MAAM,CAAC,gBAAgB,GAAG,WAAW,CAAC,gBAAgB,CAAC;oBAEzF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;oBAEzD,OAAO;wBACL,OAAO,EAAE,IAAI;wBACb,QAAQ;qBACT,CAAC;gBACJ,CAAC;gBAAC,OAAO,KAAU,EAAE,CAAC;oBACpB,OAAO;wBACL,OAAO,EAAE,KAAK;wBACd,KAAK,EAAE,KAAK,CAAC,OAAO,IAAI,kCAAkC;qBAC3D,CAAC;gBACJ,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
export interface AuthTokens {
|
|
2
|
+
accessToken: string;
|
|
3
|
+
refreshToken: string;
|
|
4
|
+
}
|
|
5
|
+
export interface Account {
|
|
6
|
+
id: string;
|
|
7
|
+
email: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
username?: string;
|
|
10
|
+
isVerified?: boolean;
|
|
11
|
+
requireSetPassword?: boolean;
|
|
12
|
+
merchants?: Merchant[];
|
|
13
|
+
merchantAccounts?: MerchantAccount[];
|
|
14
|
+
}
|
|
15
|
+
export interface Merchant {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
identifier: string;
|
|
19
|
+
}
|
|
20
|
+
export interface MerchantAccount {
|
|
21
|
+
id: string;
|
|
22
|
+
merchantId: string;
|
|
23
|
+
role: string;
|
|
24
|
+
}
|
|
25
|
+
export interface LoginResponse {
|
|
26
|
+
accessToken: string;
|
|
27
|
+
refreshToken: string;
|
|
28
|
+
account: Account;
|
|
29
|
+
merchants: Merchant[];
|
|
30
|
+
}
|
|
31
|
+
export interface Order {
|
|
32
|
+
id: string;
|
|
33
|
+
identifier: string;
|
|
34
|
+
state: string;
|
|
35
|
+
fulfilmentType: string;
|
|
36
|
+
createdAt: string;
|
|
37
|
+
updatedAt: string;
|
|
38
|
+
grossAmount: number;
|
|
39
|
+
netAmount: number;
|
|
40
|
+
currency: string;
|
|
41
|
+
items?: OrderItem[];
|
|
42
|
+
payments?: OrderPayment[];
|
|
43
|
+
user?: {
|
|
44
|
+
id: string;
|
|
45
|
+
email?: string;
|
|
46
|
+
firstName?: string;
|
|
47
|
+
lastName?: string;
|
|
48
|
+
};
|
|
49
|
+
outlet?: {
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
};
|
|
53
|
+
brand?: {
|
|
54
|
+
id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export interface OrderItem {
|
|
59
|
+
id: string;
|
|
60
|
+
name: string;
|
|
61
|
+
quantity: number;
|
|
62
|
+
price: number;
|
|
63
|
+
modifiers?: string[];
|
|
64
|
+
}
|
|
65
|
+
export interface OrderPayment {
|
|
66
|
+
id: string;
|
|
67
|
+
paymentType: string;
|
|
68
|
+
amount: number;
|
|
69
|
+
status: string;
|
|
70
|
+
}
|
|
71
|
+
export interface Cart {
|
|
72
|
+
id: string;
|
|
73
|
+
identifier: string;
|
|
74
|
+
platform: string;
|
|
75
|
+
fulfilmentType: string;
|
|
76
|
+
isCheckedOut: boolean;
|
|
77
|
+
items?: CartItem[];
|
|
78
|
+
grossAmount: number;
|
|
79
|
+
netAmount: number;
|
|
80
|
+
currency: string;
|
|
81
|
+
}
|
|
82
|
+
export interface CartItem {
|
|
83
|
+
id: string;
|
|
84
|
+
itemId: string;
|
|
85
|
+
name: string;
|
|
86
|
+
quantity: number;
|
|
87
|
+
price: number;
|
|
88
|
+
}
|
|
89
|
+
export interface Menu {
|
|
90
|
+
id: string;
|
|
91
|
+
identifier: string;
|
|
92
|
+
name: string;
|
|
93
|
+
state: string;
|
|
94
|
+
startDate?: string;
|
|
95
|
+
endDate?: string;
|
|
96
|
+
sections?: MenuSection[];
|
|
97
|
+
}
|
|
98
|
+
export interface MenuSection {
|
|
99
|
+
id: string;
|
|
100
|
+
name: string;
|
|
101
|
+
identifier: string;
|
|
102
|
+
items?: MenuItem[];
|
|
103
|
+
}
|
|
104
|
+
export interface MenuItem {
|
|
105
|
+
id: string;
|
|
106
|
+
name: string;
|
|
107
|
+
identifier: string;
|
|
108
|
+
price: number;
|
|
109
|
+
description?: string;
|
|
110
|
+
imageUrl?: string;
|
|
111
|
+
}
|
|
112
|
+
export interface SalesReport {
|
|
113
|
+
startDate: string;
|
|
114
|
+
endDate: string;
|
|
115
|
+
totalRevenue: number;
|
|
116
|
+
totalOrders: number;
|
|
117
|
+
averageOrderValue: number;
|
|
118
|
+
topSellingItems?: {
|
|
119
|
+
itemId: string;
|
|
120
|
+
name: string;
|
|
121
|
+
quantity: number;
|
|
122
|
+
revenue: number;
|
|
123
|
+
}[];
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=atlas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atlas.d.ts","sourceRoot":"","sources":["../../src/types/atlas.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;CACtC;AAED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ACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;CACL"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atlas.js","sourceRoot":"","sources":["../../src/types/atlas.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlas-kitchen/atlas-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Model Context Protocol server for Atlas restaurant management system - enables Claude to interact with restaurant orders, menus, and reports",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"atlas-mcp": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/",
|
|
11
|
+
".env.example",
|
|
12
|
+
"README.md",
|
|
13
|
+
"CLAUDE.md"
|
|
14
|
+
],
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=18.0.0"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc && chmod +x dist/index.js",
|
|
20
|
+
"start": "node dist/index.js",
|
|
21
|
+
"dev": "tsx src/index.ts",
|
|
22
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
23
|
+
"prepublishOnly": "npm run build",
|
|
24
|
+
"prepare": "npm run build"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"mcp",
|
|
28
|
+
"modelcontextprotocol",
|
|
29
|
+
"atlas",
|
|
30
|
+
"restaurant",
|
|
31
|
+
"graphql",
|
|
32
|
+
"claude",
|
|
33
|
+
"ai"
|
|
34
|
+
],
|
|
35
|
+
"author": "Atlas Kitchen",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"type": "module",
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "https://github.com/atlas-kitchen/atlas-mcp.git"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/atlas-kitchen/atlas-mcp#readme",
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@modelcontextprotocol/sdk": "^1.15.0",
|
|
45
|
+
"@types/node": "^24.0.10",
|
|
46
|
+
"@types/uuid": "^10.0.0",
|
|
47
|
+
"dotenv": "^17.0.1",
|
|
48
|
+
"graphql": "^16.11.0",
|
|
49
|
+
"graphql-request": "^7.2.0",
|
|
50
|
+
"tsx": "^4.20.3",
|
|
51
|
+
"typescript": "^5.8.3",
|
|
52
|
+
"uuid": "^11.1.0",
|
|
53
|
+
"zod": "^3.25.75"
|
|
54
|
+
}
|
|
55
|
+
}
|