@airwallex/developer-mcp 0.3.0-beta.10

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.
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.simulateDepositToolConfig = exports.simulateDepositSchema = void 0;
4
+ exports.executeSimulateDeposit = executeSimulateDeposit;
5
+ const zod_1 = require("zod");
6
+ const descriptions_1 = require("../constants/descriptions");
7
+ exports.simulateDepositSchema = zod_1.z.object({
8
+ amount: zod_1.z
9
+ .number()
10
+ .positive()
11
+ .describe("The amount to deposit into the global account (in the account's base currency, not minor units)"),
12
+ globalAccountId: zod_1.z
13
+ .string()
14
+ .min(1)
15
+ .describe("The unique ID of the global account to deposit funds into"),
16
+ });
17
+ async function executeSimulateDeposit(airwallex, args) {
18
+ try {
19
+ const response = await airwallex.post("/api/v1/simulation/deposit/create", {
20
+ amount: args.amount,
21
+ global_account_id: args.globalAccountId,
22
+ });
23
+ const result = {
24
+ amount: response.amount,
25
+ created_at: response.create_time,
26
+ currency: response.currency,
27
+ deposit_id: response.id,
28
+ status: response.status,
29
+ };
30
+ return {
31
+ content: [
32
+ {
33
+ text: JSON.stringify(result, null, 2),
34
+ type: "text",
35
+ },
36
+ ],
37
+ };
38
+ }
39
+ catch (error) {
40
+ const statusCode = error?.status || error?.statusCode || 500;
41
+ const errorMessage = error?.message || "Unknown error occurred";
42
+ throw new Error(`Deposit simulation failed (${statusCode}): ${errorMessage}`);
43
+ }
44
+ }
45
+ exports.simulateDepositToolConfig = {
46
+ annotations: {
47
+ openWorldHint: true,
48
+ readOnlyHint: false,
49
+ title: "Simulate global account deposit",
50
+ },
51
+ description: descriptions_1.TOOL_DESCRIPTIONS.SIMULATE_DEPOSIT,
52
+ inputSchema: exports.simulateDepositSchema,
53
+ name: "simulate_create_deposit",
54
+ };
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.simulateTransferUpdateToolConfig = exports.simulateTransferUpdateSchema = void 0;
4
+ exports.executeSimulateTransferUpdate = executeSimulateTransferUpdate;
5
+ const zod_1 = require("zod");
6
+ const descriptions_1 = require("../constants/descriptions");
7
+ exports.simulateTransferUpdateSchema = zod_1.z.object({
8
+ next_status: zod_1.z
9
+ .enum(["OVERDUE", "PROCESSING", "SENT", "PAID", "FAILED", "CANCELLED"])
10
+ .describe("The next status of the transfer. One of the following: OVERDUE, PROCESSING, SENT, PAID, FAILED, CANCELLED."),
11
+ transfer_id: zod_1.z.string().min(1).describe("The ID of the transfer to update."),
12
+ });
13
+ async function executeSimulateTransferUpdate(airwallex, args) {
14
+ try {
15
+ const response = (await airwallex.post(`/api/v1/simulation/transfers/${args.transfer_id}/transition`, {
16
+ next_status: args.next_status,
17
+ }));
18
+ return {
19
+ content: [
20
+ {
21
+ text: JSON.stringify(response, null, 2),
22
+ type: "text",
23
+ },
24
+ ],
25
+ };
26
+ }
27
+ catch (error) {
28
+ const statusCode = error?.status || error?.statusCode || 500;
29
+ const errorMessage = error?.message || "Unknown error occurred";
30
+ throw new Error(`Failed to simulate transfer update (${statusCode}): ${errorMessage}`);
31
+ }
32
+ }
33
+ exports.simulateTransferUpdateToolConfig = {
34
+ annotations: {
35
+ openWorldHint: true,
36
+ readOnlyHint: false,
37
+ title: "Simulate transfer result",
38
+ },
39
+ description: descriptions_1.TOOL_DESCRIPTIONS.SIMULATE_TRANSFER_UPDATE,
40
+ inputSchema: exports.simulateTransferUpdateSchema,
41
+ name: "simulate_transfer_result",
42
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractDeviceId = extractDeviceId;
4
+ const node_machine_id_1 = require("node-machine-id");
5
+ function extractDeviceId() {
6
+ try {
7
+ return (0, node_machine_id_1.machineIdSync)();
8
+ }
9
+ catch (error) {
10
+ console.error("Error extracting device ID:", error);
11
+ return "unknown";
12
+ }
13
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.getVersion = getVersion;
37
+ const fs = __importStar(require("fs"));
38
+ const path = __importStar(require("path"));
39
+ function getVersion(dirname) {
40
+ const packageJsonPath = path.join(dirname, "..", "package.json");
41
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
42
+ return packageJson.version;
43
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withToolTelemetry = withToolTelemetry;
4
+ const TOOL_INVOKED_EVENT_NAME = "TOOL_INVOKED";
5
+ // Middleware that wraps around a MCP tool's execute function and logs the event using the telemetry client
6
+ function withToolTelemetry(toolName, toolExecutor, { disableTelemetry, telemetryClient, }) {
7
+ return async (args) => {
8
+ if (disableTelemetry) {
9
+ return await toolExecutor(args);
10
+ }
11
+ telemetryClient.logEvent(TOOL_INVOKED_EVENT_NAME, {
12
+ toolName: toolName,
13
+ });
14
+ return await toolExecutor(args);
15
+ };
16
+ }
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@airwallex/developer-mcp",
3
+ "version": "v0.3.0-beta.10",
4
+ "description": "MCP server for AI agents that assist developers integrating with the Airwallex platform",
5
+ "bin": {
6
+ "awx-developer-mcp": "dist/index.js"
7
+ },
8
+ "packageManager": "yarn@1.22.22",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "scripts": {
13
+ "build": "tsc && cp src/*.md dist/",
14
+ "lint": "prettier --check . && eslint . && tsc --noEmit",
15
+ "test": "vitest run",
16
+ "test:unit": "vitest run --project unit",
17
+ "test:integration": "vitest run --project integration",
18
+ "test:watch": "vitest",
19
+ "test:unit:watch": "vitest --project unit",
20
+ "test:integration:watch": "vitest --project integration",
21
+ "format": "prettier --write .",
22
+ "release": "semantic-release",
23
+ "sonar": "sonar-scanner"
24
+ },
25
+ "author": "Developer Experience Team <developer.support@airwallex.com>",
26
+ "license": "MIT",
27
+ "dependencies": {
28
+ "@airwallex/node-sdk": "2.0.0-beta.4",
29
+ "@modelcontextprotocol/sdk": "1.22.0",
30
+ "node-machine-id": "1.1.12",
31
+ "uuid": "11",
32
+ "zod": "3.25.76"
33
+ },
34
+ "engines": {
35
+ "node": ">=18"
36
+ },
37
+ "keywords": [
38
+ "mcp",
39
+ "modelcontextprotocol",
40
+ "airwallex"
41
+ ],
42
+ "devDependencies": {
43
+ "@eslint/js": "^9.26.0",
44
+ "@semantic-release/changelog": "^6.0.3",
45
+ "@semantic-release/commit-analyzer": "^13.0.1",
46
+ "@semantic-release/git": "^10.0.1",
47
+ "@semantic-release/gitlab": "^13.2.9",
48
+ "@semantic-release/release-notes-generator": "^14.1.0",
49
+ "@tsconfig/node22": "^22.0.1",
50
+ "@types/nock": "^11.1.0",
51
+ "@types/node": "^24.3.0",
52
+ "@vitest/coverage-v8": "^3.2.4",
53
+ "eslint": "^9.39.0",
54
+ "eslint-config-prettier": "^10.1.3",
55
+ "eslint-plugin-perfectionist": "^4.12.3",
56
+ "jiti": "^2.4.2",
57
+ "nock": "^14.0.10",
58
+ "prettier": "^3.5.3",
59
+ "semantic-release": "^25.0.1",
60
+ "tsx": "^4.19.4",
61
+ "typescript": "^5.8.3",
62
+ "typescript-eslint": "^8.32.0",
63
+ "vitest": "^3.1.3"
64
+ }
65
+ }