@virtocommerce/mcp-onx 0.0.1-alpha.2 → 1.0.1
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 +1 -1
- package/README.md +86 -320
- 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 +7 -6
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,360 +1,126 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @virtocommerce/mcp-onx
|
|
2
2
|
|
|
3
|
-
|
|
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
4
|
|
|
5
|
-
##
|
|
5
|
+
## Supported Operations
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
- [API Reference](#api-reference)
|
|
16
|
-
- [Support](#support)
|
|
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` |
|
|
17
15
|
|
|
18
16
|
## Quick Start
|
|
19
17
|
|
|
20
|
-
###
|
|
18
|
+
### Option A: Via npx (no local clone needed)
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
# Copy this template to create your adapter
|
|
24
|
-
cp -r adapter-template/ my-fulfillment-adapter/
|
|
25
|
-
cd my-fulfillment-adapter/
|
|
26
|
-
|
|
27
|
-
# Install dependencies
|
|
28
|
-
npm install
|
|
29
|
-
|
|
30
|
-
# Rename the adapter in package.json
|
|
31
|
-
# Update name to: @yourcompany/cof-adapter-yourfulfillment
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### Step 2: Customize Package Information
|
|
35
|
-
|
|
36
|
-
Edit `package.json` to reflect your adapter:
|
|
20
|
+
Add to your Claude Desktop config (`claude_desktop_config.json`):
|
|
37
21
|
|
|
38
22
|
```json
|
|
39
23
|
{
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
├── src/
|
|
57
|
-
│ ├── adapter.ts # Main adapter implementation (modify this)
|
|
58
|
-
│ ├── index.ts # Module exports (update exports)
|
|
59
|
-
│ ├── types.ts # Custom type definitions (add your types)
|
|
60
|
-
│ └── utils/
|
|
61
|
-
│ └── api-client.ts # HTTP client wrapper (customize for your API)
|
|
62
|
-
├── tests/
|
|
63
|
-
│ └── adapter.test.ts # Unit tests (write your tests)
|
|
64
|
-
├── examples/
|
|
65
|
-
│ ├── basic-usage.ts # Basic usage examples
|
|
66
|
-
│ └── test-server.ts # Test with local MCP server
|
|
67
|
-
├── docs/
|
|
68
|
-
│ ├── API.md # Document your API mappings
|
|
69
|
-
│ └── CONFIGURATION.md # Document configuration options
|
|
70
|
-
├── package.json # Update name, author, description
|
|
71
|
-
├── tsconfig.json # TypeScript configuration
|
|
72
|
-
├── .env.example # Example configuration
|
|
73
|
-
└── README.md # Replace with your documentation
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
## Implementation Guide
|
|
77
|
-
|
|
78
|
-
### Required Methods Checklist
|
|
79
|
-
|
|
80
|
-
Your adapter must implement these methods from the `IFulfillmentAdapter` interface:
|
|
81
|
-
|
|
82
|
-
#### Lifecycle (3 methods)
|
|
83
|
-
- [ ] `connect()` - Establish connection to your fulfillment system
|
|
84
|
-
- [ ] `disconnect()` - Clean up resources
|
|
85
|
-
- [ ] `healthCheck()` - Return system health status
|
|
86
|
-
|
|
87
|
-
#### Action Operations (4 methods)
|
|
88
|
-
- [ ] `createSalesOrder()` - Create new orders
|
|
89
|
-
- [ ] `cancelOrder()` - Cancel existing orders
|
|
90
|
-
- [ ] `updateOrder()` - Update order details
|
|
91
|
-
- [ ] `fulfillOrder()` - Mark orders as fulfilled / shipped
|
|
92
|
-
|
|
93
|
-
#### Query Operations (6 methods)
|
|
94
|
-
- [ ] `getOrders()` - Retrieve order details
|
|
95
|
-
- [ ] `getCustomers()` - Get customer details
|
|
96
|
-
- [ ] `getProducts()` - Fetch product information
|
|
97
|
-
- [ ] `getProductVariants()` - Retrieve product variants
|
|
98
|
-
- [ ] `getInventory()` - Check inventory levels
|
|
99
|
-
- [ ] `getFulfillments()` - Fetch fulfillment records
|
|
100
|
-
|
|
101
|
-
### Implementation Steps
|
|
102
|
-
|
|
103
|
-
1. **Update adapter.ts with your API logic:**
|
|
104
|
-
```typescript
|
|
105
|
-
// src/adapter.ts
|
|
106
|
-
export class YourFulfillmentAdapter implements IFulfillmentAdapter {
|
|
107
|
-
async createSalesOrder(input: CreateSalesOrderInput): Promise<OrderResult> {
|
|
108
|
-
// TODO: Replace with your API call
|
|
109
|
-
const response = await this.apiClient.post('/orders', transform(input));
|
|
110
|
-
|
|
111
|
-
return response.success
|
|
112
|
-
? this.success({ order: mapOrder(response.data) })
|
|
113
|
-
: this.failure('Failed to create order', response.error);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
2. **Configure your API client:**
|
|
119
|
-
```typescript
|
|
120
|
-
// src/utils/api-client.ts
|
|
121
|
-
export class ApiClient {
|
|
122
|
-
constructor(config: YourConfig) {
|
|
123
|
-
// Set up authentication, base URL, etc.
|
|
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
|
+
}
|
|
124
40
|
}
|
|
125
41
|
}
|
|
126
42
|
```
|
|
127
43
|
|
|
128
|
-
|
|
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
|
|
44
|
+
### Option B: From source
|
|
142
45
|
|
|
143
46
|
```bash
|
|
144
|
-
|
|
145
|
-
|
|
47
|
+
git clone https://github.com/VirtoCommerce/mcp-onx.git
|
|
48
|
+
cd mcp-onx
|
|
146
49
|
|
|
147
|
-
#
|
|
148
|
-
npm
|
|
50
|
+
# Build server first (adapter depends on it)
|
|
51
|
+
cd server && npm install && npm run build && cd ..
|
|
149
52
|
|
|
150
|
-
#
|
|
151
|
-
cd
|
|
152
|
-
npm install
|
|
153
|
-
ADAPTER_TYPE=local ADAPTER_PATH=../my-fulfillment-adapter/dist/index.js npm start
|
|
53
|
+
# Build adapter
|
|
54
|
+
cd virtocommerce-adapter && npm install && npm run build && cd ..
|
|
154
55
|
```
|
|
155
56
|
|
|
156
|
-
|
|
57
|
+
Then add to Claude Desktop config:
|
|
157
58
|
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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);
|
|
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
|
+
}
|
|
201
73
|
}
|
|
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
74
|
```
|
|
237
75
|
|
|
238
76
|
## Configuration
|
|
239
77
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
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
|
|
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 |
|
|
273
87
|
|
|
274
|
-
|
|
275
|
-
git tag v1.0.0
|
|
276
|
-
git push origin v1.0.0
|
|
88
|
+
## VirtoCommerce Permissions
|
|
277
89
|
|
|
278
|
-
|
|
279
|
-
"dependencies": {
|
|
280
|
-
"my-adapter": "file:../my-fulfillment-adapter"
|
|
281
|
-
}
|
|
90
|
+
The adapter requires the following VirtoCommerce API permissions:
|
|
282
91
|
|
|
283
|
-
|
|
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)
|
|
284
100
|
|
|
285
|
-
|
|
101
|
+
See [docs/PERMISSIONS.md](docs/PERMISSIONS.md) for detailed permission mappings.
|
|
286
102
|
|
|
287
|
-
|
|
288
|
-
# Check the adapter can be imported
|
|
289
|
-
node -e "import('../my-fulfillment-adapter/dist/index.js')"
|
|
103
|
+
## Documentation
|
|
290
104
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
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
|
|
295
110
|
|
|
296
|
-
|
|
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
|
|
111
|
+
## Development
|
|
304
112
|
|
|
305
113
|
```bash
|
|
306
|
-
|
|
307
|
-
npm install --save-dev @types/node
|
|
114
|
+
cd virtocommerce-adapter
|
|
308
115
|
|
|
309
|
-
#
|
|
310
|
-
|
|
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
|
|
311
120
|
```
|
|
312
121
|
|
|
313
|
-
|
|
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
|
|
122
|
+
> **Note**: Build the server (`cd server && npm run build`) before building the adapter — it depends on `@cof-org/mcp` via `file:../server`.
|
|
357
123
|
|
|
358
|
-
|
|
124
|
+
## License
|
|
359
125
|
|
|
360
|
-
|
|
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,EACrB,KAAK,EACL,WAAW,EACX,MAAM,EACN,aAAa,EACb,OAAO,EACP,cAAc,EACd,QAAQ,EACR,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EAChB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,mBAAmB,EACnB,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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;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,SAA0E,EAAE;QACtF,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,MAAM,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,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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.mappers.d.ts","sourceRoot":"","sources":["../../src/mappers/filter.mappers.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,cAAc,EACd,
|
|
1
|
+
{"version":3,"file":"filter.mappers.d.ts","sourceRoot":"","sources":["../../src/mappers/filter.mappers.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAMjK,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,cAAc,GAAG,2BAA2B,CAsClG;AAKD,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,gBAAgB,GAAG,qBAAqB,CAmBhG;AAUD,wBAAgB,wCAAwC,CAAC,KAAK,EAAE,uBAAuB,GAAG,qBAAqB,CA2B9G;AAKD,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,iBAAiB,GAAG,oBAAoB,CAoBjG;AAKD,wBAAgB,qCAAqC,CAAC,KAAK,EAAE,oBAAoB,GAAG,sBAAsB,CAyBzG;AASD,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,eAAe,GAAG,oBAAoB,CAuC7F"}
|