@amazon-sp-api-release/dev-mcp 0.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/README.md +82 -0
- package/dist/auth/sp-api-auth.d.ts +17 -0
- package/dist/auth/sp-api-auth.d.ts.map +1 -0
- package/dist/auth/sp-api-auth.js +55 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +96 -0
- package/dist/tools/api-tools/orders-api-tools.d.ts +103 -0
- package/dist/tools/api-tools/orders-api-tools.d.ts.map +1 -0
- package/dist/tools/api-tools/orders-api-tools.js +459 -0
- package/dist/tools/migration-assistant-tools/migration-tools.d.ts +21 -0
- package/dist/tools/migration-assistant-tools/migration-tools.d.ts.map +1 -0
- package/dist/tools/migration-assistant-tools/migration-tools.js +82 -0
- package/dist/tools/migration-assistant-tools/orders-api-migration/code-analyzer.d.ts +19 -0
- package/dist/tools/migration-assistant-tools/orders-api-migration/code-analyzer.d.ts.map +1 -0
- package/dist/tools/migration-assistant-tools/orders-api-migration/code-analyzer.js +52 -0
- package/dist/tools/migration-assistant-tools/orders-api-migration/code-generator.d.ts +3 -0
- package/dist/tools/migration-assistant-tools/orders-api-migration/code-generator.d.ts.map +1 -0
- package/dist/tools/migration-assistant-tools/orders-api-migration/code-generator.js +45 -0
- package/dist/tools/migration-assistant-tools/orders-api-migration/guidance-formatter.d.ts +3 -0
- package/dist/tools/migration-assistant-tools/orders-api-migration/guidance-formatter.d.ts.map +1 -0
- package/dist/tools/migration-assistant-tools/orders-api-migration/guidance-formatter.js +134 -0
- package/dist/tools/migration-assistant-tools/orders-api-migration/migration-data.d.ts +13 -0
- package/dist/tools/migration-assistant-tools/orders-api-migration/migration-data.d.ts.map +1 -0
- package/dist/tools/migration-assistant-tools/orders-api-migration/migration-data.js +181 -0
- package/dist/tools/migration-assistant-tools/orders-api-migration/report-formatter.d.ts +5 -0
- package/dist/tools/migration-assistant-tools/orders-api-migration/report-formatter.d.ts.map +1 -0
- package/dist/tools/migration-assistant-tools/orders-api-migration/report-formatter.js +64 -0
- package/dist/zod-schemas/migration-schemas.d.ts +24 -0
- package/dist/zod-schemas/migration-schemas.d.ts.map +1 -0
- package/dist/zod-schemas/migration-schemas.js +24 -0
- package/dist/zod-schemas/orders-schemas.d.ts +291 -0
- package/dist/zod-schemas/orders-schemas.d.ts.map +1 -0
- package/dist/zod-schemas/orders-schemas.js +178 -0
- package/package.json +66 -0
- package/src/auth/sp-api-auth.ts +88 -0
- package/src/index.ts +168 -0
- package/src/tools/api-tools/orders-api-tools.ts +684 -0
- package/src/tools/migration-assistant-tools/migration-tools.ts +143 -0
- package/src/tools/migration-assistant-tools/orders-api-migration/code-analyzer.ts +72 -0
- package/src/tools/migration-assistant-tools/orders-api-migration/code-generator.ts +64 -0
- package/src/tools/migration-assistant-tools/orders-api-migration/guidance-formatter.ts +154 -0
- package/src/tools/migration-assistant-tools/orders-api-migration/migration-data.ts +221 -0
- package/src/tools/migration-assistant-tools/orders-api-migration/report-formatter.ts +85 -0
- package/src/utils/logger.ts +75 -0
- package/src/zod-schemas/migration-schemas.ts +28 -0
- package/src/zod-schemas/orders-schemas.ts +196 -0
package/README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Amazon SP-API Developer MCP Server
|
|
2
|
+
|
|
3
|
+
A Model Context Protocol (MCP) server that provides tools for interacting with Amazon's Selling Partner API (SP-API), specifically focused on Orders API operations and migration assistance.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
### Migration Assistant
|
|
8
|
+
|
|
9
|
+
- `migration_assistant` - Assists with API version migrations
|
|
10
|
+
- Provides general migration guidance (without source code)
|
|
11
|
+
- Analyzes existing code and generates refactored implementations
|
|
12
|
+
- Supports: Orders API v0 → v2026-01-01
|
|
13
|
+
|
|
14
|
+
### Orders API Tools
|
|
15
|
+
|
|
16
|
+
**V1 API (2026-01-01)**
|
|
17
|
+
- `search_orders` - Search orders with various filters (date, status, marketplace, etc.)
|
|
18
|
+
- `get_order` - Get detailed information for a specific order
|
|
19
|
+
- `cancel_order` - Cancel an order with a reason code
|
|
20
|
+
|
|
21
|
+
**V0 API (Legacy)**
|
|
22
|
+
- `update_shipment_status` - Update shipment status for an order
|
|
23
|
+
- `update_verification_status` - Update verification status for regulated orders
|
|
24
|
+
- `confirm_shipment` - Confirm shipment for an order
|
|
25
|
+
- `get_order_regulated_info` - Get regulated information for compliance-related orders
|
|
26
|
+
|
|
27
|
+
## Usage with MCP Clients
|
|
28
|
+
|
|
29
|
+
### Claude Desktop
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"mcpServers": {
|
|
34
|
+
"sp-api-dev": {
|
|
35
|
+
"command": "npx",
|
|
36
|
+
"args": ["-y", "@amazon-sp-api-release/dev-mcp-test"],
|
|
37
|
+
/**env variablea are optional, The migration assistant tool does not require credentials and can be used without API access.*/
|
|
38
|
+
"env": {
|
|
39
|
+
"SP_API_CLIENT_ID": "your_client_id",
|
|
40
|
+
"SP_API_CLIENT_SECRET": "your_client_secret",
|
|
41
|
+
"SP_API_REFRESH_TOKEN": "your_refresh_token",
|
|
42
|
+
"SP_API_BASE_URL": "https://sellingpartnerapi-na.amazon.com"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Usage Examples
|
|
50
|
+
|
|
51
|
+
### Migration Assistant - General Guidance
|
|
52
|
+
|
|
53
|
+
#### Prompt:
|
|
54
|
+
```
|
|
55
|
+
Guide me through the processes to migrate from orders V0 to V1.
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
#### Tool args:
|
|
59
|
+
```typescript
|
|
60
|
+
{
|
|
61
|
+
"source_version": "orders-v0",
|
|
62
|
+
"target_version": "orders-2026-01-01"
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Migration Assistant - Code Analysis
|
|
67
|
+
|
|
68
|
+
#### Prompt:
|
|
69
|
+
```
|
|
70
|
+
Help me refactor my orders V0 code
|
|
71
|
+
<Code snippet>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
#### Tool args:
|
|
75
|
+
```typescript
|
|
76
|
+
{
|
|
77
|
+
"source_code": "your existing code here",
|
|
78
|
+
"source_version": "orders-v0",
|
|
79
|
+
"target_version": "orders-2026-01-01",
|
|
80
|
+
"language": "javascript"
|
|
81
|
+
}
|
|
82
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AxiosResponse } from "axios";
|
|
2
|
+
export interface SPAPIConfig {
|
|
3
|
+
clientId?: string;
|
|
4
|
+
clientSecret?: string;
|
|
5
|
+
refreshToken?: string;
|
|
6
|
+
baseUrl?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class SPAPIAuth {
|
|
9
|
+
private config;
|
|
10
|
+
private accessToken;
|
|
11
|
+
private tokenExpiry;
|
|
12
|
+
private axiosInstance;
|
|
13
|
+
constructor(config: SPAPIConfig);
|
|
14
|
+
private getAccessToken;
|
|
15
|
+
makeAuthenticatedRequest<T = any>(method: string, url: string, params?: Record<string, string>, data?: any): Promise<AxiosResponse<T>>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=sp-api-auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sp-api-auth.d.ts","sourceRoot":"","sources":["../../src/auth/sp-api-auth.ts"],"names":[],"mappings":"AAAA,OAAc,EAAqC,aAAa,EAAE,MAAM,OAAO,CAAC;AAEhF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAQD,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,WAAW,CAAuB;IAC1C,OAAO,CAAC,WAAW,CAAuB;IAC1C,OAAO,CAAC,aAAa,CAAgB;gBAEzB,MAAM,EAAE,WAAW;YAKjB,cAAc;IAmCtB,wBAAwB,CAAC,CAAC,GAAG,GAAG,EACpC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EACnC,IAAI,GAAE,GAAU,GACf,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;CAqB7B"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
export class SPAPIAuth {
|
|
3
|
+
config;
|
|
4
|
+
accessToken = null;
|
|
5
|
+
tokenExpiry = null;
|
|
6
|
+
axiosInstance;
|
|
7
|
+
constructor(config) {
|
|
8
|
+
this.config = config;
|
|
9
|
+
this.axiosInstance = axios.create();
|
|
10
|
+
}
|
|
11
|
+
async getAccessToken() {
|
|
12
|
+
// Check if we have a valid token
|
|
13
|
+
if (this.accessToken && this.tokenExpiry && Date.now() < this.tokenExpiry) {
|
|
14
|
+
return this.accessToken;
|
|
15
|
+
}
|
|
16
|
+
// Refresh the access token using LWA refresh token
|
|
17
|
+
try {
|
|
18
|
+
const response = await this.axiosInstance.post("https://api.amazon.com/auth/o2/token", {
|
|
19
|
+
grant_type: "refresh_token",
|
|
20
|
+
client_id: this.config.clientId,
|
|
21
|
+
client_secret: this.config.clientSecret,
|
|
22
|
+
refresh_token: this.config.refreshToken,
|
|
23
|
+
}, {
|
|
24
|
+
headers: {
|
|
25
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
this.accessToken = response.data.access_token;
|
|
29
|
+
// Set expiry 5 minutes before actual expiry to be safe
|
|
30
|
+
this.tokenExpiry = Date.now() + (response.data.expires_in - 300) * 1000;
|
|
31
|
+
return this.accessToken;
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
throw new Error(`Failed to get access token: ${error.response?.data?.error_description || error.message}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async makeAuthenticatedRequest(method, url, params = {}, data = null) {
|
|
38
|
+
const accessToken = await this.getAccessToken();
|
|
39
|
+
const config = {
|
|
40
|
+
method,
|
|
41
|
+
url,
|
|
42
|
+
headers: {
|
|
43
|
+
"x-amz-access-token": accessToken,
|
|
44
|
+
"Content-Type": "application/json",
|
|
45
|
+
"User-Agent": "SP-API-Orders-V1-MCP/1.1.0",
|
|
46
|
+
},
|
|
47
|
+
params,
|
|
48
|
+
timeout: 30000,
|
|
49
|
+
};
|
|
50
|
+
if (data && (method === "POST" || method === "PUT")) {
|
|
51
|
+
config.data = data;
|
|
52
|
+
}
|
|
53
|
+
return this.axiosInstance.request(config);
|
|
54
|
+
}
|
|
55
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { OrdersApiTool, } from "./tools/api-tools/orders-api-tools.js";
|
|
5
|
+
import { SPAPIMigrationAssistantTool } from "./tools/migration-assistant-tools/migration-tools.js";
|
|
6
|
+
import { searchOrdersSchema, getOrderSchema, cancelOrderSchema, updateShipmentStatusSchema, updateVerificationStatusSchema, confirmShipmentSchema, getOrderRegulatedInfoSchema, } from "./zod-schemas/orders-schemas.js";
|
|
7
|
+
import { migrationAssistantSchema } from "./zod-schemas/migration-schemas.js";
|
|
8
|
+
import { config } from "dotenv";
|
|
9
|
+
config();
|
|
10
|
+
class SPAPIDevMCPServer {
|
|
11
|
+
server;
|
|
12
|
+
ordersApiTool;
|
|
13
|
+
migrationAssistantTool;
|
|
14
|
+
constructor() {
|
|
15
|
+
this.server = new McpServer({
|
|
16
|
+
name: "selling-partner-api-dev-mcp",
|
|
17
|
+
version: "1.1.0",
|
|
18
|
+
});
|
|
19
|
+
const config = this.getAuthFromEnv();
|
|
20
|
+
this.ordersApiTool = new OrdersApiTool(config);
|
|
21
|
+
this.migrationAssistantTool = new SPAPIMigrationAssistantTool();
|
|
22
|
+
this.setupTools();
|
|
23
|
+
}
|
|
24
|
+
setupTools() {
|
|
25
|
+
// Register Orders API V1 Tools
|
|
26
|
+
this.server.registerTool("search_orders", {
|
|
27
|
+
description: "Search orders with various filters and include specific data sets. Use this to get orders by date, status, marketplace, etc.",
|
|
28
|
+
inputSchema: searchOrdersSchema,
|
|
29
|
+
}, async (args) => {
|
|
30
|
+
return await this.ordersApiTool.searchOrders(args);
|
|
31
|
+
});
|
|
32
|
+
this.server.registerTool("get_order", {
|
|
33
|
+
description: "Get detailed information for a specific order by order ID",
|
|
34
|
+
inputSchema: getOrderSchema,
|
|
35
|
+
}, async (args) => {
|
|
36
|
+
return await this.ordersApiTool.getOrder(args);
|
|
37
|
+
});
|
|
38
|
+
this.server.registerTool("cancel_order", {
|
|
39
|
+
description: "Cancel a specific order with a reason code",
|
|
40
|
+
inputSchema: cancelOrderSchema,
|
|
41
|
+
}, async (args) => {
|
|
42
|
+
return await this.ordersApiTool.cancelOrder(args);
|
|
43
|
+
});
|
|
44
|
+
// Register Orders API V0 Tools
|
|
45
|
+
this.server.registerTool("update_shipment_status", {
|
|
46
|
+
description: "Update shipment status for an order (V0 API - for orders that require shipment status updates)",
|
|
47
|
+
inputSchema: updateShipmentStatusSchema,
|
|
48
|
+
}, async (args) => {
|
|
49
|
+
return await this.ordersApiTool.updateShipmentStatus(args);
|
|
50
|
+
});
|
|
51
|
+
this.server.registerTool("update_verification_status", {
|
|
52
|
+
description: "Update verification status for regulated orders (V0 API - for compliance-related orders)",
|
|
53
|
+
inputSchema: updateVerificationStatusSchema,
|
|
54
|
+
}, async (args) => {
|
|
55
|
+
return await this.ordersApiTool.updateVerificationStatus(args);
|
|
56
|
+
});
|
|
57
|
+
this.server.registerTool("confirm_shipment", {
|
|
58
|
+
description: "Confirm shipment for an order (V0 API - for orders that require shipment confirmation)",
|
|
59
|
+
inputSchema: confirmShipmentSchema,
|
|
60
|
+
}, async (args) => {
|
|
61
|
+
return await this.ordersApiTool.confirmShipment(args);
|
|
62
|
+
});
|
|
63
|
+
this.server.registerTool("get_order_regulated_info", {
|
|
64
|
+
description: "Get regulated information for an order (V0 API - for compliance-related orders)",
|
|
65
|
+
inputSchema: getOrderRegulatedInfoSchema,
|
|
66
|
+
}, async (args) => {
|
|
67
|
+
return await this.ordersApiTool.getOrderRegulatedInfo(args);
|
|
68
|
+
});
|
|
69
|
+
// Register Migration Assistant Tool
|
|
70
|
+
this.server.registerTool("migration_assistant", {
|
|
71
|
+
description: "Assists with API version migrations. Can provide general migration guidance or analyze existing code and generate refactored implementations. When source_code is provided: returns detailed analysis with deprecated endpoints, breaking changes, refactored code, and migration checklist. When source_code is omitted: returns comprehensive migration guide with API mappings, attribute changes, code examples, and best practices. Supported Migrations: Orders API v0 → v2026-01-01",
|
|
72
|
+
inputSchema: migrationAssistantSchema,
|
|
73
|
+
}, async (args) => {
|
|
74
|
+
return await this.migrationAssistantTool.migrationAssistant(args);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
async run() {
|
|
78
|
+
const transport = new StdioServerTransport();
|
|
79
|
+
await this.server.connect(transport);
|
|
80
|
+
}
|
|
81
|
+
getAuthFromEnv() {
|
|
82
|
+
return {
|
|
83
|
+
clientId: process.env.SP_API_CLIENT_ID,
|
|
84
|
+
clientSecret: process.env.SP_API_CLIENT_SECRET,
|
|
85
|
+
refreshToken: process.env.SP_API_REFRESH_TOKEN,
|
|
86
|
+
baseUrl: process.env.SP_API_BASE_URL,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
const server = new SPAPIDevMCPServer();
|
|
92
|
+
await server.run();
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export interface SPAPIConfig {
|
|
2
|
+
clientId?: string;
|
|
3
|
+
clientSecret?: string;
|
|
4
|
+
refreshToken?: string;
|
|
5
|
+
baseUrl?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SearchOrdersArgs {
|
|
8
|
+
createdAfter?: string;
|
|
9
|
+
createdBefore?: string;
|
|
10
|
+
lastUpdatedAfter?: string;
|
|
11
|
+
lastUpdatedBefore?: string;
|
|
12
|
+
fulfillmentStatuses?: Array<"PENDING" | "UNSHIPPED" | "PARTIALLY_SHIPPED" | "SHIPPED" | "CANCELLED" | "UNFULFILLABLE">;
|
|
13
|
+
marketplaceIds?: string[];
|
|
14
|
+
fulfilledBy?: Array<"AMAZON" | "MERCHANT">;
|
|
15
|
+
maxResultsPerPage?: number;
|
|
16
|
+
includedData?: Array<"BUYER" | "RECIPIENT" | "PROCEEDS" | "EXPENSE" | "PROMOTION" | "CANCELLATION" | "FULFILLMENT" | "PACKAGES">;
|
|
17
|
+
paginationToken?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface GetOrderArgs {
|
|
20
|
+
orderId: string;
|
|
21
|
+
includedData?: Array<"BUYER" | "RECIPIENT" | "PROCEEDS" | "EXPENSE" | "PROMOTION" | "CANCELLATION" | "FULFILLMENT" | "PACKAGES">;
|
|
22
|
+
}
|
|
23
|
+
export interface CancelOrderArgs {
|
|
24
|
+
orderId: string;
|
|
25
|
+
cancelReasonCode: "NO_INVENTORY" | "BUYER_CANCELLED" | "SHIPPING_ADDRESS_UNDELIVERABLE" | "CUSTOMER_EXCHANGE" | "PRICING_ERROR";
|
|
26
|
+
}
|
|
27
|
+
export interface UpdateShipmentStatusArgs {
|
|
28
|
+
orderId: string;
|
|
29
|
+
marketplaceId: string;
|
|
30
|
+
shipmentStatus: "ReadyForPickup" | "PickedUp" | "RefusedPickup";
|
|
31
|
+
orderItems?: Array<{
|
|
32
|
+
orderItemId?: string;
|
|
33
|
+
quantity?: number;
|
|
34
|
+
}>;
|
|
35
|
+
}
|
|
36
|
+
export interface UpdateVerificationStatusArgs {
|
|
37
|
+
orderId: string;
|
|
38
|
+
marketplaceId: string;
|
|
39
|
+
regulatedOrderVerificationStatus: {
|
|
40
|
+
status: "Approved" | "Rejected" | "Expired" | "Cancelled";
|
|
41
|
+
validUntil?: string;
|
|
42
|
+
rejectionReason?: {
|
|
43
|
+
rejectionReasonId: string;
|
|
44
|
+
rejectionReasonDescription: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export interface ConfirmShipmentArgs {
|
|
49
|
+
orderId: string;
|
|
50
|
+
marketplaceId: string;
|
|
51
|
+
packageDetail: {
|
|
52
|
+
packageReferenceId: string;
|
|
53
|
+
carrierCode: string;
|
|
54
|
+
shippingMethod?: string;
|
|
55
|
+
trackingNumber?: string;
|
|
56
|
+
shipDate: string;
|
|
57
|
+
carrierName?: string;
|
|
58
|
+
shipFrom?: {
|
|
59
|
+
name: string;
|
|
60
|
+
addressLine1: string;
|
|
61
|
+
addressLine2?: string;
|
|
62
|
+
addressLine3?: string;
|
|
63
|
+
city: string;
|
|
64
|
+
county?: string;
|
|
65
|
+
district?: string;
|
|
66
|
+
stateOrRegion: string;
|
|
67
|
+
postalCode: string;
|
|
68
|
+
countryCode: string;
|
|
69
|
+
phone: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
codCollectionMethod?: "DirectPayment";
|
|
73
|
+
}
|
|
74
|
+
export interface GetOrderRegulatedInfoArgs {
|
|
75
|
+
orderId: string;
|
|
76
|
+
}
|
|
77
|
+
export interface ToolResponse {
|
|
78
|
+
content: Array<{
|
|
79
|
+
type: "text";
|
|
80
|
+
text: string;
|
|
81
|
+
meta?: Record<string, unknown>;
|
|
82
|
+
}>;
|
|
83
|
+
isError?: boolean;
|
|
84
|
+
[key: string]: unknown;
|
|
85
|
+
}
|
|
86
|
+
export declare class OrdersApiTool {
|
|
87
|
+
private config;
|
|
88
|
+
private auth?;
|
|
89
|
+
private hasCredentials;
|
|
90
|
+
constructor(config?: SPAPIConfig);
|
|
91
|
+
private checkCredentials;
|
|
92
|
+
searchOrders(args: SearchOrdersArgs): Promise<ToolResponse>;
|
|
93
|
+
getOrder(args: GetOrderArgs): Promise<ToolResponse>;
|
|
94
|
+
cancelOrder(args: CancelOrderArgs): Promise<ToolResponse>;
|
|
95
|
+
updateShipmentStatus(args: UpdateShipmentStatusArgs): Promise<ToolResponse>;
|
|
96
|
+
updateVerificationStatus(args: UpdateVerificationStatusArgs): Promise<ToolResponse>;
|
|
97
|
+
confirmShipment(args: ConfirmShipmentArgs): Promise<ToolResponse>;
|
|
98
|
+
getOrderRegulatedInfo(args: GetOrderRegulatedInfoArgs): Promise<ToolResponse>;
|
|
99
|
+
private formatOrdersResponse;
|
|
100
|
+
private formatOrderResponse;
|
|
101
|
+
private formatRegulatedInfoResponse;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=orders-api-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orders-api-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/api-tools/orders-api-tools.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAi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