@virtocommerce/mcp-onx 0.0.1-alpha.2 → 0.0.1-alpha.3
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/LICENSE +22 -22
- package/README.md +126 -360
- package/dist/adapter.d.ts +4 -1
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +9 -3
- package/dist/adapter.js.map +1 -1
- package/dist/mappers/filter.mappers.d.ts +1 -8
- package/dist/mappers/filter.mappers.d.ts.map +1 -1
- package/dist/mappers/filter.mappers.js +12 -90
- package/dist/mappers/filter.mappers.js.map +1 -1
- package/dist/mappers/index.d.ts +1 -1
- package/dist/mappers/index.d.ts.map +1 -1
- package/dist/mappers/index.js +1 -1
- package/dist/mappers/index.js.map +1 -1
- package/dist/models/search.d.ts +6 -12
- package/dist/models/search.d.ts.map +1 -1
- package/dist/services/order.service.d.ts +2 -1
- package/dist/services/order.service.d.ts.map +1 -1
- package/dist/services/order.service.js +2 -3
- package/dist/services/order.service.js.map +1 -1
- package/dist/services/return.service.d.ts +1 -0
- package/dist/services/return.service.d.ts.map +1 -1
- package/dist/services/return.service.js +14 -3
- package/dist/services/return.service.js.map +1 -1
- package/dist/transformers/address.transformer.d.ts +0 -2
- package/dist/transformers/address.transformer.d.ts.map +1 -1
- package/dist/transformers/address.transformer.js +2 -18
- package/dist/transformers/address.transformer.js.map +1 -1
- package/dist/transformers/customer.transformer.d.ts +0 -3
- package/dist/transformers/customer.transformer.d.ts.map +1 -1
- package/dist/transformers/customer.transformer.js +0 -18
- package/dist/transformers/customer.transformer.js.map +1 -1
- package/dist/transformers/fulfillment.transformer.js +0 -1
- package/dist/transformers/fulfillment.transformer.js.map +1 -1
- package/dist/transformers/order.transformer.d.ts +1 -0
- package/dist/transformers/order.transformer.d.ts.map +1 -1
- package/dist/transformers/order.transformer.js +16 -9
- package/dist/transformers/order.transformer.js.map +1 -1
- package/dist/types.d.ts +1 -96
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/api-client.d.ts +7 -6
- package/dist/utils/api-client.d.ts.map +1 -1
- package/dist/utils/api-client.js +16 -1
- package/dist/utils/api-client.js.map +1 -1
- package/package.json +62 -60
package/LICENSE
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c)
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
22
|
-
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 VirtoCommerce
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
CHANGED
|
@@ -1,360 +1,126 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
##
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
3. **Define your configuration types:**
|
|
129
|
-
```typescript
|
|
130
|
-
// src/types.ts
|
|
131
|
-
export interface YourAdapterConfig {
|
|
132
|
-
apiUrl: string;
|
|
133
|
-
apiKey: string;
|
|
134
|
-
// Add your specific config options
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
## Testing Your Adapter
|
|
140
|
-
|
|
141
|
-
### Step 1: Test Locally
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
# Build your adapter
|
|
145
|
-
npm run build
|
|
146
|
-
|
|
147
|
-
# Run unit tests
|
|
148
|
-
npm test
|
|
149
|
-
|
|
150
|
-
# Test with the MCP server locally
|
|
151
|
-
cd ../server
|
|
152
|
-
npm install
|
|
153
|
-
ADAPTER_TYPE=local ADAPTER_PATH=../my-fulfillment-adapter/dist/index.js npm start
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
### Step 2: Write Unit Tests
|
|
157
|
-
|
|
158
|
-
```typescript
|
|
159
|
-
// tests/adapter.test.ts
|
|
160
|
-
import { YourFulfillmentAdapter } from '../src/adapter';
|
|
161
|
-
|
|
162
|
-
describe('YourFulfillmentAdapter', () => {
|
|
163
|
-
let adapter: YourFulfillmentAdapter;
|
|
164
|
-
|
|
165
|
-
beforeEach(() => {
|
|
166
|
-
adapter = new YourFulfillmentAdapter({
|
|
167
|
-
apiUrl: 'https://sandbox.yourapi.com',
|
|
168
|
-
apiKey: 'test-key'
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
test('should connect successfully', async () => {
|
|
173
|
-
await expect(adapter.connect()).resolves.not.toThrow();
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
test('should create sales order', async () => {
|
|
177
|
-
const result = await adapter.createSalesOrder({
|
|
178
|
-
// ... test data
|
|
179
|
-
});
|
|
180
|
-
expect(result.success).toBe(true);
|
|
181
|
-
});
|
|
182
|
-
});
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
```typescript
|
|
186
|
-
// examples/test-server.ts
|
|
187
|
-
// Use this to test your adapter with a local MCP server
|
|
188
|
-
import { YourFulfillmentAdapter } from '../src/adapter';
|
|
189
|
-
|
|
190
|
-
const adapter = new YourFulfillmentAdapter({
|
|
191
|
-
apiUrl: process.env.API_URL || 'https://sandbox.yourapi.com',
|
|
192
|
-
apiKey: process.env.API_KEY || 'test-key'
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
async function test() {
|
|
196
|
-
await adapter.connect();
|
|
197
|
-
console.log('Connected!');
|
|
198
|
-
|
|
199
|
-
const health = await adapter.healthCheck();
|
|
200
|
-
console.log('Health:', health);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
test().catch(console.error);
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
## Using Your Adapter
|
|
207
|
-
|
|
208
|
-
### Option 1: Local Development (During Development)
|
|
209
|
-
|
|
210
|
-
```bash
|
|
211
|
-
# In the server directory, configure to use your local adapter
|
|
212
|
-
cd ../server
|
|
213
|
-
cat > .env << EOF
|
|
214
|
-
ADAPTER_TYPE=local
|
|
215
|
-
ADAPTER_PATH=../my-fulfillment-adapter/dist/index.js
|
|
216
|
-
ADAPTER_CONFIG={"apiUrl":"https://sandbox.yourapi.com","apiKey":"test-key"}
|
|
217
|
-
EOF
|
|
218
|
-
|
|
219
|
-
npm start
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
### Option 2: NPM Package (After Publishing)
|
|
223
|
-
|
|
224
|
-
```bash
|
|
225
|
-
# Install your published adapter
|
|
226
|
-
npm install @yourcompany/cof-adapter-yourfulfillment
|
|
227
|
-
|
|
228
|
-
# Configure the server to use it
|
|
229
|
-
cat > .env << EOF
|
|
230
|
-
ADAPTER_TYPE=npm
|
|
231
|
-
ADAPTER_PACKAGE=@yourcompany/cof-adapter-yourfulfillment
|
|
232
|
-
ADAPTER_CONFIG={"apiUrl":"https://api.yourfulfillment.com","apiKey":"production-key"}
|
|
233
|
-
EOF
|
|
234
|
-
|
|
235
|
-
npm start
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
## Configuration
|
|
239
|
-
|
|
240
|
-
Your adapter should accept configuration through the `ADAPTER_CONFIG` environment variable. Define your configuration interface in `src/types.ts`:
|
|
241
|
-
|
|
242
|
-
```typescript
|
|
243
|
-
export interface YourAdapterConfig {
|
|
244
|
-
apiUrl: string; // Required: Your API endpoint
|
|
245
|
-
apiKey: string; // Required: Authentication key
|
|
246
|
-
workspace?: string; // Optional: Tenant/workspace ID
|
|
247
|
-
timeout?: number; // Optional: Request timeout (ms)
|
|
248
|
-
retryAttempts?: number; // Optional: Retry count
|
|
249
|
-
}
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
## Publishing
|
|
253
|
-
|
|
254
|
-
### For Public NPM Packages
|
|
255
|
-
|
|
256
|
-
```bash
|
|
257
|
-
# 1. Update version
|
|
258
|
-
npm version patch # or minor/major
|
|
259
|
-
|
|
260
|
-
# 2. Build and test
|
|
261
|
-
npm run build
|
|
262
|
-
npm test
|
|
263
|
-
|
|
264
|
-
# 3. Publish to NPM
|
|
265
|
-
npm publish --access public
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
### For Private Use
|
|
269
|
-
|
|
270
|
-
```bash
|
|
271
|
-
# Option 1: Private NPM registry
|
|
272
|
-
npm publish --registry https://your-registry.com
|
|
273
|
-
|
|
274
|
-
# Option 2: Git repository
|
|
275
|
-
git tag v1.0.0
|
|
276
|
-
git push origin v1.0.0
|
|
277
|
-
|
|
278
|
-
# Option 3: Local file reference in package.json
|
|
279
|
-
"dependencies": {
|
|
280
|
-
"my-adapter": "file:../my-fulfillment-adapter"
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
## Troubleshooting
|
|
284
|
-
|
|
285
|
-
### Adapter Not Loading
|
|
286
|
-
|
|
287
|
-
```bash
|
|
288
|
-
# Check the adapter can be imported
|
|
289
|
-
node -e "import('../my-fulfillment-adapter/dist/index.js')"
|
|
290
|
-
|
|
291
|
-
# Verify environment variables
|
|
292
|
-
echo $ADAPTER_TYPE
|
|
293
|
-
echo $ADAPTER_PATH
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
### Connection Issues
|
|
297
|
-
|
|
298
|
-
- Verify API credentials are correct
|
|
299
|
-
- Check network connectivity to your API
|
|
300
|
-
- Test with curl: `curl -X GET https://your-api.com/health`
|
|
301
|
-
- Enable debug logging in your adapter
|
|
302
|
-
|
|
303
|
-
### Type Errors
|
|
304
|
-
|
|
305
|
-
```bash
|
|
306
|
-
# Ensure types are installed
|
|
307
|
-
npm install --save-dev @types/node
|
|
308
|
-
|
|
309
|
-
# Check TypeScript version
|
|
310
|
-
npx tsc --version
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
## API Reference
|
|
314
|
-
|
|
315
|
-
### Required Interfaces
|
|
316
|
-
|
|
317
|
-
Your adapter must implement the `IFulfillmentAdapter` interface from the main server. Key types:
|
|
318
|
-
|
|
319
|
-
```typescript
|
|
320
|
-
interface OrderParams {
|
|
321
|
-
extOrderId: string;
|
|
322
|
-
customer: Customer;
|
|
323
|
-
items: LineItem[];
|
|
324
|
-
shippingAddress?: Address;
|
|
325
|
-
billingAddress?: Address;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
interface OrderResult {
|
|
329
|
-
success: boolean;
|
|
330
|
-
orderId: string;
|
|
331
|
-
orderNumber?: string;
|
|
332
|
-
status?: string;
|
|
333
|
-
}
|
|
334
|
-
```
|
|
335
|
-
|
|
336
|
-
See the full type definitions in the server's `src/types/` directory.
|
|
337
|
-
|
|
338
|
-
## Support
|
|
339
|
-
|
|
340
|
-
### Documentation
|
|
341
|
-
- [Commerce Operations Foundation Docs](../docs/README.md)
|
|
342
|
-
- [For Fulfillment Vendors Guide](../docs/getting-started/for-fulfillment-vendors.md)
|
|
343
|
-
- [MCP Protocol Specification](https://modelcontextprotocol.io)
|
|
344
|
-
|
|
345
|
-
### Getting Help
|
|
346
|
-
- Create an issue in this repository
|
|
347
|
-
- Check existing adapters in the `adapters/` directory for examples
|
|
348
|
-
- Review the mock adapter implementation for reference
|
|
349
|
-
|
|
350
|
-
## Next Steps
|
|
351
|
-
|
|
352
|
-
1. **Copy this template** to start your adapter
|
|
353
|
-
2. **Implement the interface** methods for your fulfillment system
|
|
354
|
-
3. **Test locally** with the MCP server
|
|
355
|
-
4. **Publish** to NPM or deploy privately
|
|
356
|
-
5. **Document** your configuration options
|
|
357
|
-
|
|
358
|
-
---
|
|
359
|
-
|
|
360
|
-
*This template is part of the Commerce Operations Foundation (COF) project.*
|
|
1
|
+
# @virtocommerce/mcp-onx
|
|
2
|
+
|
|
3
|
+
VirtoCommerce adapter for the Commerce Operations Foundation (COF) MCP Server. Connects VirtoCommerce Platform to AI assistants via the Model Context Protocol (MCP), enabling order management, customer lookup, product catalog, inventory, fulfillment, and returns operations.
|
|
4
|
+
|
|
5
|
+
## Supported Operations
|
|
6
|
+
|
|
7
|
+
| Category | Tools |
|
|
8
|
+
| -------- | ----- |
|
|
9
|
+
| **Orders** | `create-sales-order`, `update-order`, `cancel-order`, `get-orders` |
|
|
10
|
+
| **Fulfillment** | `fulfill-order`, `get-fulfillments` |
|
|
11
|
+
| **Customers** | `get-customers` |
|
|
12
|
+
| **Products** | `get-products`, `get-product-variants` |
|
|
13
|
+
| **Inventory** | `get-inventory` |
|
|
14
|
+
| **Returns** | `create-return`, `get-returns` |
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
### Option A: Via npx (no local clone needed)
|
|
19
|
+
|
|
20
|
+
Add to your Claude Desktop config (`claude_desktop_config.json`):
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"mcpServers": {
|
|
25
|
+
"cof-mcp": {
|
|
26
|
+
"command": "npx",
|
|
27
|
+
"args": [
|
|
28
|
+
"--package=@virtocommerce/cof-mcp",
|
|
29
|
+
"--package=@virtocommerce/mcp-onx",
|
|
30
|
+
"--yes",
|
|
31
|
+
"cof-mcp"
|
|
32
|
+
],
|
|
33
|
+
"env": {
|
|
34
|
+
"ADAPTER_TYPE": "npm",
|
|
35
|
+
"ADAPTER_PACKAGE": "@virtocommerce/mcp-onx",
|
|
36
|
+
"ADAPTER_CONFIG": "{\"apiUrl\":\"https://your-vc-instance.com\",\"apiKey\":\"YOUR_API_KEY\",\"workspace\":\"your-store-id\"}",
|
|
37
|
+
"LOG_LEVEL": "info"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Option B: From source
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
git clone https://github.com/VirtoCommerce/mcp-onx.git
|
|
48
|
+
cd mcp-onx
|
|
49
|
+
|
|
50
|
+
# Build server first (adapter depends on it)
|
|
51
|
+
cd server && npm install && npm run build && cd ..
|
|
52
|
+
|
|
53
|
+
# Build adapter
|
|
54
|
+
cd virtocommerce-adapter && npm install && npm run build && cd ..
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Then add to Claude Desktop config:
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"mcpServers": {
|
|
62
|
+
"cof-mcp": {
|
|
63
|
+
"command": "node",
|
|
64
|
+
"args": ["/absolute/path/to/server/dist/index.js"],
|
|
65
|
+
"env": {
|
|
66
|
+
"ADAPTER_TYPE": "local",
|
|
67
|
+
"ADAPTER_PATH": "/absolute/path/to/virtocommerce-adapter/dist/index.js",
|
|
68
|
+
"ADAPTER_CONFIG": "{\"apiUrl\":\"https://your-vc-instance.com\",\"apiKey\":\"YOUR_API_KEY\",\"workspace\":\"your-store-id\"}",
|
|
69
|
+
"LOG_LEVEL": "info"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Configuration
|
|
77
|
+
|
|
78
|
+
| Option | Type | Required | Default | Description |
|
|
79
|
+
| ------ | ---- | -------- | ------- | ----------- |
|
|
80
|
+
| `apiUrl` | `string` | Yes | — | VirtoCommerce Platform URL |
|
|
81
|
+
| `apiKey` | `string` | Yes | — | API key (`api_key` header) |
|
|
82
|
+
| `workspace` | `string` | No | — | Store ID — scopes orders/shipments, auto-detects catalog |
|
|
83
|
+
| `catalogId` | `string` | No | — | Catalog ID for product searches (auto-detected from store if `workspace` is set) |
|
|
84
|
+
| `timeout` | `number` | No | `30000` | Request timeout in milliseconds |
|
|
85
|
+
| `retryAttempts` | `number` | No | `3` | Max retry attempts for failed requests |
|
|
86
|
+
| `debugMode` | `boolean` | No | `false` | Log all API requests/responses to stderr |
|
|
87
|
+
|
|
88
|
+
## VirtoCommerce Permissions
|
|
89
|
+
|
|
90
|
+
The adapter requires the following VirtoCommerce API permissions:
|
|
91
|
+
|
|
92
|
+
- **Order**: Read, Search, Create, Update
|
|
93
|
+
- **Shipment**: Search
|
|
94
|
+
- **Customer/Members**: Read, Search
|
|
95
|
+
- **Catalog**: Search
|
|
96
|
+
- **Inventory**: Search
|
|
97
|
+
- **Platform**: Read (countries list)
|
|
98
|
+
- **Store**: Read (when `workspace` is set)
|
|
99
|
+
- **Pricing**: Evaluate (optional — for automatic price lookup during order creation)
|
|
100
|
+
|
|
101
|
+
See [docs/PERMISSIONS.md](docs/PERMISSIONS.md) for detailed permission mappings.
|
|
102
|
+
|
|
103
|
+
## Documentation
|
|
104
|
+
|
|
105
|
+
- [Quick Start Guide](docs/QUICKSTART.md) — step-by-step setup with screenshots
|
|
106
|
+
- [Configuration Reference](docs/CONFIGURATION.md) — all options, environment variables, retry logic
|
|
107
|
+
- [API Reference](docs/API.md) — endpoint mappings, status maps, filter/search mappings
|
|
108
|
+
- [Permissions](docs/PERMISSIONS.md) — required VirtoCommerce permissions per operation
|
|
109
|
+
- [Known Limitations](docs/LIMITATIONS.md) — unimplemented features and workarounds
|
|
110
|
+
|
|
111
|
+
## Development
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
cd virtocommerce-adapter
|
|
115
|
+
|
|
116
|
+
npm run build # tsc → dist/
|
|
117
|
+
npm run dev # tsc --watch
|
|
118
|
+
npm test # Jest with --experimental-vm-modules
|
|
119
|
+
npm run lint # ESLint
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
> **Note**: Build the server (`cd server && npm run build`) before building the adapter — it depends on `@cof-org/mcp` via `file:../server`.
|
|
123
|
+
|
|
124
|
+
## License
|
|
125
|
+
|
|
126
|
+
See [LICENSE](../LICENSE) in the repository root.
|
package/dist/adapter.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IFulfillmentAdapter, AdapterConfig, AdapterCapabilities, HealthStatus, OrderResult, ReturnResult, FulfillmentToolResult, Order, Fulfillment, Return, InventoryItem, Product, ProductVariant, Customer, CreateSalesOrderInput, CreateReturnInput, CancelOrderInput, UpdateOrderInput, FulfillOrderInput, GetOrdersInput, GetInventoryInput, GetProductsInput, GetProductVariantsInput, GetCustomersInput, GetFulfillmentsInput, GetReturnsInput } from '@virtocommerce/cof-mcp';
|
|
2
|
+
import type { AdapterOptions } from './types.js';
|
|
2
3
|
export declare class VirtoCommerceFulfillmentAdapter implements IFulfillmentAdapter {
|
|
3
4
|
private client;
|
|
4
5
|
private connected;
|
|
@@ -9,7 +10,9 @@ export declare class VirtoCommerceFulfillmentAdapter implements IFulfillmentAdap
|
|
|
9
10
|
private fulfillmentService;
|
|
10
11
|
private productService;
|
|
11
12
|
private returnService;
|
|
12
|
-
constructor(config?:
|
|
13
|
+
constructor(config?: Partial<AdapterOptions> & {
|
|
14
|
+
options?: Partial<AdapterOptions>;
|
|
15
|
+
});
|
|
13
16
|
initialize?(config: AdapterConfig): Promise<void>;
|
|
14
17
|
cleanup?(): Promise<void>;
|
|
15
18
|
connect(): Promise<void>;
|
package/dist/adapter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,qBAAqB,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AAA;KAAE,CAAC,CAAC;IAI7F,kBAAkB,CACtB,KAAK,EAAE,uBAAuB,GAC7B,OAAO,CAAC,qBAAqB,CAAC;QAAE,eAAe,EAAE,cAAc,EAAE,CAAA;KAAE,CAAC,CAAC;IAIlE,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC;QAAE,SAAS,EAAE,aAAa,EAAE,CAAA;KAAE,CAAC,CAAC;IAMtG,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC;IAI7D,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,qBAAqB,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAM/F,OAAO,CAAC,aAAa;YAyCP,UAAU;YA0BV,cAAc;IAkB5B,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,GAAG;CAGZ"}
|
package/dist/adapter.js
CHANGED
|
@@ -15,9 +15,15 @@ export class VirtoCommerceFulfillmentAdapter {
|
|
|
15
15
|
returnService;
|
|
16
16
|
constructor(config = {}) {
|
|
17
17
|
const options = config.options || config;
|
|
18
|
+
if (!options.apiUrl) {
|
|
19
|
+
throw new AdapterError('apiUrl is required', ErrorCode.INVALID_REQUEST);
|
|
20
|
+
}
|
|
21
|
+
if (!options.apiKey) {
|
|
22
|
+
throw new AdapterError('apiKey is required', ErrorCode.INVALID_REQUEST);
|
|
23
|
+
}
|
|
18
24
|
this.options = {
|
|
19
|
-
apiUrl: options.apiUrl
|
|
20
|
-
apiKey: options.apiKey
|
|
25
|
+
apiUrl: options.apiUrl,
|
|
26
|
+
apiKey: options.apiKey,
|
|
21
27
|
workspace: options.workspace,
|
|
22
28
|
timeout: options.timeout || 30000,
|
|
23
29
|
retryAttempts: options.retryAttempts || 3,
|
|
@@ -31,8 +37,8 @@ export class VirtoCommerceFulfillmentAdapter {
|
|
|
31
37
|
debugMode: this.options.debugMode,
|
|
32
38
|
});
|
|
33
39
|
const tenantId = this.getTenantId();
|
|
34
|
-
this.orderService = new OrderService(this.client, tenantId, this.options.workspace);
|
|
35
40
|
this.customerService = new CustomerService(this.client, tenantId);
|
|
41
|
+
this.orderService = new OrderService(this.client, tenantId, this.options.workspace, this.customerService);
|
|
36
42
|
this.fulfillmentService = new FulfillmentService(this.client, tenantId, this.options.workspace);
|
|
37
43
|
this.productService = new ProductService(this.client, tenantId);
|
|
38
44
|
this.returnService = new ReturnService(this.client, tenantId);
|
package/dist/adapter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAmCA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,aAAa,GACd,MAAM,qBAAqB,CAAC;AAI7B,MAAM,OAAO,+BAA+B;IAClC,MAAM,CAAY;IAClB,SAAS,GAAG,KAAK,CAAC;IAClB,OAAO,CAAiB;IACxB,KAAK,CAAS;IAGd,YAAY,CAAe;IAC3B,eAAe,CAAkB;IACjC,kBAAkB,CAAqB;IACvC,cAAc,CAAiB;IAC/B,aAAa,CAAgB;IAErC,YAAY,
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAmCA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC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,GAAG,CAAiB,gCAAgC,CAAC,CAAC;YAEzF,IAAI,QAAQ,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACjF,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC;gBAChC,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;gBAC1C,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;gBAC7C,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;gBAChD,OAAO,CAAC,KAAK,CAAC,UAAU,SAAS,CAAC,MAAM,mCAAmC,CAAC,CAAC;YAC/E,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAC;YACjF,CAAC;QACH,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,OAAO,CAAC,KAAK,CAAC,uCAAuC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACjF,CAAC;IACH,CAAC;IAEO,WAAW;QACjB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,mBAAmB,CAAC;IACvD,CAAC;IAEO,GAAG;QACT,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import type { GetOrdersInput,
|
|
1
|
+
import type { GetOrdersInput, GetProductsInput, GetProductVariantsInput, GetCustomersInput, GetFulfillmentsInput, GetReturnsInput } from '@virtocommerce/cof-mcp';
|
|
2
2
|
import type { CustomerOrderSearchCriteria, MemberSearchCriteria, ProductSearchCriteria, ShipmentSearchCriteria, ReturnSearchCriteria } from '../models/index.js';
|
|
3
3
|
export declare function mapOrderFiltersToSearchCriteria(input: GetOrdersInput): CustomerOrderSearchCriteria;
|
|
4
|
-
export declare function mapOrderFilters(input: GetOrdersInput): Record<string, unknown>;
|
|
5
|
-
export declare function mapInventoryFilters(input: GetInventoryInput): Record<string, unknown>;
|
|
6
4
|
export declare function mapProductFiltersToSearchCriteria(input: GetProductsInput): ProductSearchCriteria;
|
|
7
|
-
export declare function mapProductFilters(input: GetProductsInput): Record<string, unknown>;
|
|
8
5
|
export declare function mapProductVariantFiltersToSearchCriteria(input: GetProductVariantsInput): ProductSearchCriteria;
|
|
9
|
-
export declare function mapProductVariantFilters(input: GetProductVariantsInput): Record<string, unknown>;
|
|
10
6
|
export declare function mapCustomerFiltersToSearchCriteria(input: GetCustomersInput): MemberSearchCriteria;
|
|
11
|
-
export declare function mapCustomerFilters(input: GetCustomersInput): Record<string, unknown>;
|
|
12
7
|
export declare function mapFulfillmentFiltersToSearchCriteria(input: GetFulfillmentsInput): ShipmentSearchCriteria;
|
|
13
|
-
export declare function mapFulfillmentFilters(input: GetFulfillmentsInput): Record<string, unknown>;
|
|
14
8
|
export declare function mapReturnFiltersToSearchCriteria(input: GetReturnsInput): ReturnSearchCriteria;
|
|
15
|
-
export declare function mapReturnFilters(input: GetReturnsInput): Record<string, unknown>;
|
|
16
9
|
//# sourceMappingURL=filter.mappers.d.ts.map
|