@relaycore/cli 0.1.3 → 0.1.4
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 +24 -0
- package/dist/commands/route.d.ts +8 -0
- package/dist/commands/route.d.ts.map +1 -0
- package/dist/commands/route.js +219 -0
- package/dist/commands/route.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/packages/types/tsconfig.json +9 -1
package/README.md
CHANGED
|
@@ -95,6 +95,30 @@ relaycore service register # Register new service
|
|
|
95
95
|
relaycore service list # List your services
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
+
### `route`
|
|
99
|
+
Create x402-protected proxy routes for any API endpoint.
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
relaycore route add # Create a new paid proxy route
|
|
103
|
+
relaycore route list # List your routes with earnings
|
|
104
|
+
relaycore route remove <id> # Remove a route
|
|
105
|
+
relaycore route test <id> # Test a route (shows 402 requirements)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Example: Make any API paid**
|
|
109
|
+
```bash
|
|
110
|
+
relaycore route add \
|
|
111
|
+
--url https://api.example.com/data \
|
|
112
|
+
--price 0.01 \
|
|
113
|
+
--name "Data API"
|
|
114
|
+
|
|
115
|
+
# Output:
|
|
116
|
+
# Route Created Successfully
|
|
117
|
+
# Proxy URL: https://api.relaycore.xyz/proxy/abc123
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Requests to the proxy URL require x402 payment before being forwarded to the upstream API.
|
|
121
|
+
|
|
98
122
|
### `dev`
|
|
99
123
|
```bash
|
|
100
124
|
relaycore dev
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../src/commands/route.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,eAAO,MAAM,YAAY,SAAuB,CAAC"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Route Command - API Route Proxy Management
|
|
3
|
+
*
|
|
4
|
+
* Create x402-protected proxy routes for any API endpoint.
|
|
5
|
+
*/
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
import inquirer from 'inquirer';
|
|
8
|
+
import chalk from 'chalk';
|
|
9
|
+
import ora from 'ora';
|
|
10
|
+
import { loadConfig } from './auth.js';
|
|
11
|
+
export const routeCommand = new Command('route');
|
|
12
|
+
routeCommand
|
|
13
|
+
.command('add')
|
|
14
|
+
.description('Create a new x402-protected route')
|
|
15
|
+
.option('-u, --url <url>', 'Upstream API URL to proxy')
|
|
16
|
+
.option('-m, --method <method>', 'HTTP method (GET, POST, PUT, DELETE)', 'GET')
|
|
17
|
+
.option('-p, --price <price>', 'Price per call in USDC', '0.01')
|
|
18
|
+
.option('-n, --name <name>', 'Display name for the route')
|
|
19
|
+
.option('--pay-to <address>', 'Wallet address to receive payments')
|
|
20
|
+
.action(async (options) => {
|
|
21
|
+
console.log(chalk.bold.cyan('\n Route Proxy Setup\n'));
|
|
22
|
+
try {
|
|
23
|
+
const config = await loadConfig();
|
|
24
|
+
let url = options.url;
|
|
25
|
+
let method = options.method;
|
|
26
|
+
let price = options.price;
|
|
27
|
+
let name = options.name;
|
|
28
|
+
let payTo = options.payTo;
|
|
29
|
+
if (!url || !name) {
|
|
30
|
+
const answers = await inquirer.prompt([
|
|
31
|
+
{
|
|
32
|
+
type: 'input',
|
|
33
|
+
name: 'name',
|
|
34
|
+
message: 'Route name:',
|
|
35
|
+
when: !name,
|
|
36
|
+
validate: (input) => input.length > 0 || 'Name is required'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: 'input',
|
|
40
|
+
name: 'url',
|
|
41
|
+
message: 'Upstream API URL:',
|
|
42
|
+
when: !url,
|
|
43
|
+
validate: (input) => {
|
|
44
|
+
try {
|
|
45
|
+
new URL(input);
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return 'Please enter a valid URL';
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: 'list',
|
|
55
|
+
name: 'method',
|
|
56
|
+
message: 'HTTP Method:',
|
|
57
|
+
choices: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'],
|
|
58
|
+
when: !method || method === 'GET',
|
|
59
|
+
default: 'GET'
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
type: 'input',
|
|
63
|
+
name: 'price',
|
|
64
|
+
message: 'Price per call (USDC):',
|
|
65
|
+
when: !price || price === '0.01',
|
|
66
|
+
default: '0.01',
|
|
67
|
+
validate: (input) => !isNaN(parseFloat(input)) || 'Please enter a valid number'
|
|
68
|
+
}
|
|
69
|
+
]);
|
|
70
|
+
url = url || answers.url;
|
|
71
|
+
method = answers.method || method;
|
|
72
|
+
price = answers.price || price;
|
|
73
|
+
name = name || answers.name;
|
|
74
|
+
}
|
|
75
|
+
const spinner = ora('Creating route...').start();
|
|
76
|
+
const response = await fetch(`${config.baseUrl}/api/routes`, {
|
|
77
|
+
method: 'POST',
|
|
78
|
+
headers: {
|
|
79
|
+
'Content-Type': 'application/json',
|
|
80
|
+
'x-api-key': config.apiKey
|
|
81
|
+
},
|
|
82
|
+
body: JSON.stringify({
|
|
83
|
+
name,
|
|
84
|
+
upstreamUrl: url,
|
|
85
|
+
method: method.toUpperCase(),
|
|
86
|
+
priceUsdc: price,
|
|
87
|
+
payTo: payTo
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
if (!response.ok) {
|
|
91
|
+
const error = await response.json();
|
|
92
|
+
throw new Error(error.error || 'Failed to create route');
|
|
93
|
+
}
|
|
94
|
+
const route = await response.json();
|
|
95
|
+
spinner.succeed('Route created');
|
|
96
|
+
console.log(chalk.green('\n Route Created Successfully\n'));
|
|
97
|
+
console.log(chalk.white(` Route ID: ${route.id}`));
|
|
98
|
+
console.log(chalk.white(` Name: ${route.name}`));
|
|
99
|
+
console.log(chalk.white(` Method: ${route.method}`));
|
|
100
|
+
console.log(chalk.white(` Price: $${route.priceUsdc} USDC`));
|
|
101
|
+
console.log(chalk.cyan(`\n Proxy URL: ${route.proxyUrl}\n`));
|
|
102
|
+
console.log(chalk.gray(' Requests to the proxy URL will require x402 payment.\n'));
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
console.error(chalk.red('\nError: ' + (error.message || error)));
|
|
106
|
+
process.exit(1);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
routeCommand
|
|
110
|
+
.command('list')
|
|
111
|
+
.description('List all your routes')
|
|
112
|
+
.action(async () => {
|
|
113
|
+
console.log(chalk.bold.cyan('\n Your Routes\n'));
|
|
114
|
+
try {
|
|
115
|
+
const config = await loadConfig();
|
|
116
|
+
const spinner = ora('Fetching routes...').start();
|
|
117
|
+
const response = await fetch(`${config.baseUrl}/api/routes`, {
|
|
118
|
+
headers: {
|
|
119
|
+
'x-api-key': config.apiKey
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
if (!response.ok) {
|
|
123
|
+
throw new Error('Failed to fetch routes');
|
|
124
|
+
}
|
|
125
|
+
const data = await response.json();
|
|
126
|
+
spinner.stop();
|
|
127
|
+
if (!data.routes || data.routes.length === 0) {
|
|
128
|
+
console.log(chalk.yellow(' No routes found. Create one with `relaycore route add`\n'));
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
console.log(chalk.white(` Found ${data.routes.length} route(s):\n`));
|
|
132
|
+
for (const route of data.routes) {
|
|
133
|
+
console.log(chalk.cyan(` ${route.name}`));
|
|
134
|
+
console.log(chalk.gray(` ID: ${route.id}`));
|
|
135
|
+
console.log(chalk.gray(` Method: ${route.method}`));
|
|
136
|
+
console.log(chalk.gray(` Price: $${route.priceUsdc} USDC`));
|
|
137
|
+
console.log(chalk.gray(` Proxy: ${route.proxyUrl}`));
|
|
138
|
+
console.log(chalk.gray(` Requests: ${route.requestCount || 0}`));
|
|
139
|
+
console.log(chalk.gray(` Revenue: $${route.revenue || '0.00'} USDC`));
|
|
140
|
+
console.log('');
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
console.error(chalk.red('\nError: ' + (error.message || error)));
|
|
145
|
+
process.exit(1);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
routeCommand
|
|
149
|
+
.command('remove <routeId>')
|
|
150
|
+
.description('Remove a route')
|
|
151
|
+
.action(async (routeId) => {
|
|
152
|
+
console.log(chalk.bold.cyan('\n Remove Route\n'));
|
|
153
|
+
try {
|
|
154
|
+
const config = await loadConfig();
|
|
155
|
+
const { confirm } = await inquirer.prompt([
|
|
156
|
+
{
|
|
157
|
+
type: 'confirm',
|
|
158
|
+
name: 'confirm',
|
|
159
|
+
message: `Are you sure you want to remove route ${routeId}?`,
|
|
160
|
+
default: false
|
|
161
|
+
}
|
|
162
|
+
]);
|
|
163
|
+
if (!confirm) {
|
|
164
|
+
console.log(chalk.yellow('\n Cancelled\n'));
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const spinner = ora('Removing route...').start();
|
|
168
|
+
const response = await fetch(`${config.baseUrl}/api/routes/${routeId}`, {
|
|
169
|
+
method: 'DELETE',
|
|
170
|
+
headers: {
|
|
171
|
+
'x-api-key': config.apiKey
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
if (!response.ok) {
|
|
175
|
+
throw new Error('Failed to remove route');
|
|
176
|
+
}
|
|
177
|
+
spinner.succeed('Route removed');
|
|
178
|
+
console.log(chalk.green('\n Route removed successfully\n'));
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
console.error(chalk.red('\nError: ' + (error.message || error)));
|
|
182
|
+
process.exit(1);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
routeCommand
|
|
186
|
+
.command('test <routeId>')
|
|
187
|
+
.description('Test a route (shows payment requirements)')
|
|
188
|
+
.action(async (routeId) => {
|
|
189
|
+
console.log(chalk.bold.cyan('\n Test Route\n'));
|
|
190
|
+
try {
|
|
191
|
+
const config = await loadConfig();
|
|
192
|
+
const spinner = ora('Testing route...').start();
|
|
193
|
+
const response = await fetch(`${config.baseUrl}/proxy/${routeId}`, {
|
|
194
|
+
method: 'GET'
|
|
195
|
+
});
|
|
196
|
+
spinner.stop();
|
|
197
|
+
if (response.status === 402) {
|
|
198
|
+
const requirements = await response.json();
|
|
199
|
+
console.log(chalk.yellow(' Payment Required (402)\n'));
|
|
200
|
+
console.log(chalk.white(' Payment Requirements:'));
|
|
201
|
+
console.log(chalk.gray(` Network: ${requirements.paymentRequirements?.network}`));
|
|
202
|
+
console.log(chalk.gray(` Amount: ${requirements.paymentRequirements?.maxAmountRequired} base units`));
|
|
203
|
+
console.log(chalk.gray(` Pay To: ${requirements.paymentRequirements?.payTo}`));
|
|
204
|
+
console.log(chalk.gray(` Asset: ${requirements.paymentRequirements?.asset}`));
|
|
205
|
+
console.log('');
|
|
206
|
+
}
|
|
207
|
+
else if (response.ok) {
|
|
208
|
+
console.log(chalk.green(' Route is accessible (no payment required)\n'));
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
console.log(chalk.red(` Route returned ${response.status}\n`));
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
catch (error) {
|
|
215
|
+
console.error(chalk.red('\nError: ' + (error.message || error)));
|
|
216
|
+
process.exit(1);
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
//# sourceMappingURL=route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../src/commands/route.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B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AC,iBAAiB,YAAY,CAAC,mBAAmB,EAAE,iBAAiB,aAAa,CAAC,CAAC,CAAC;YAC3G,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,iBAAiB,YAAY,CAAC,mBAAmB,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;YACpF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,iBAAiB,YAAY,CAAC,mBAAmB,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;YACpF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACpB,CAAC;aAAM,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;YACrB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC,CAAC;QAC9E,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,oBAAoB,QAAQ,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;QACpE,CAAC;IAEL,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,GAAG,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;QACjE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { initCommand } from './commands/init.js';
|
|
|
4
4
|
import { authCommand } from './commands/auth.js';
|
|
5
5
|
import { agentCommand } from './commands/agent.js';
|
|
6
6
|
import { serviceCommand } from './commands/service.js';
|
|
7
|
+
import { routeCommand } from './commands/route.js';
|
|
7
8
|
import { devCommand } from './commands/dev.js';
|
|
8
9
|
const program = new Command();
|
|
9
10
|
program
|
|
@@ -17,6 +18,7 @@ program
|
|
|
17
18
|
program.addCommand(authCommand);
|
|
18
19
|
program.addCommand(agentCommand);
|
|
19
20
|
program.addCommand(serviceCommand);
|
|
21
|
+
program.addCommand(routeCommand);
|
|
20
22
|
program
|
|
21
23
|
.command('dev')
|
|
22
24
|
.description('Start development environment')
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACF,IAAI,CAAC,WAAW,CAAC;KACjB,WAAW,CAAC,uDAAuD,CAAC;KACpE,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB,OAAO;KACF,OAAO,CAAC,qBAAqB,CAAC;KAC9B,WAAW,CAAC,oCAAoC,CAAC;KACjD,MAAM,CAAC,WAAW,CAAC,CAAC;AAEzB,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAChC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACjC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACF,IAAI,CAAC,WAAW,CAAC;KACjB,WAAW,CAAC,uDAAuD,CAAC;KACpE,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB,OAAO;KACF,OAAO,CAAC,qBAAqB,CAAC;KAC9B,WAAW,CAAC,oCAAoC,CAAC;KACjD,MAAM,CAAC,WAAW,CAAC,CAAC;AAEzB,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAChC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACjC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AAEjC,OAAO;KACF,OAAO,CAAC,KAAK,CAAC;KACd,WAAW,CAAC,+BAA+B,CAAC;KAC5C,MAAM,CAAC,mBAAmB,EAAE,6BAA6B,EAAE,MAAM,CAAC;KAClE,MAAM,CAAC,UAAU,CAAC,CAAC;AAExB,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "@relaycore/config/tsconfig",
|
|
3
2
|
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"forceConsistentCasingInFileNames": true,
|
|
10
|
+
"declaration": true,
|
|
11
|
+
"declarationMap": true,
|
|
4
12
|
"outDir": "./dist",
|
|
5
13
|
"rootDir": "./src"
|
|
6
14
|
},
|