@nordsym/apiclaw 2.2.0 → 2.2.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 +15 -2
- package/dist/bin-http.js +0 -0
- package/dist/bin.bundled.js +79288 -0
- package/dist/gateway-client.d.ts.map +1 -1
- package/dist/gateway-client.js +24 -2
- package/dist/gateway-client.js.map +1 -1
- package/dist/index.bundled.js +61263 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +7 -2
- package/.claude/settings.local.json +0 -13
- package/.env.prod +0 -1
- package/apiclaw-README.md +0 -494
- package/convex/_generated/api.d.ts +0 -145
- package/convex/_generated/api.js +0 -23
- package/convex/_generated/dataModel.d.ts +0 -60
- package/convex/_generated/server.d.ts +0 -143
- package/convex/_generated/server.js +0 -93
- package/convex/_listWorkspaces.ts +0 -13
- package/convex/adminActivate.ts +0 -53
- package/convex/adminStats.ts +0 -306
- package/convex/agents.ts +0 -939
- package/convex/analytics.ts +0 -187
- package/convex/apiKeys.ts +0 -220
- package/convex/backfillAnalytics.ts +0 -272
- package/convex/backfillSearchLogs.ts +0 -35
- package/convex/billing.ts +0 -834
- package/convex/capabilities.ts +0 -157
- package/convex/chains.ts +0 -1318
- package/convex/credits.ts +0 -211
- package/convex/crons.ts +0 -65
- package/convex/debugFilestackLogs.ts +0 -16
- package/convex/debugGetToken.ts +0 -18
- package/convex/directCall.ts +0 -713
- package/convex/earnProgress.ts +0 -753
- package/convex/email.ts +0 -329
- package/convex/feedback.ts +0 -265
- package/convex/funnel.ts +0 -431
- package/convex/guards.ts +0 -174
- package/convex/http.ts +0 -3756
- package/convex/inbound.ts +0 -32
- package/convex/logs.ts +0 -701
- package/convex/migrateFilestack.ts +0 -81
- package/convex/migratePartnersProd.ts +0 -174
- package/convex/migratePratham.ts +0 -126
- package/convex/migrateProviderWorkspaces.ts +0 -175
- package/convex/mou.ts +0 -91
- package/convex/nurture.ts +0 -355
- package/convex/providerKeys.ts +0 -289
- package/convex/providers.ts +0 -1135
- package/convex/purchases.ts +0 -183
- package/convex/ratelimit.ts +0 -104
- package/convex/schema.ts +0 -926
- package/convex/searchLogs.ts +0 -265
- package/convex/seedAPILayerAPIs.ts +0 -191
- package/convex/seedDirectCallConfigs.ts +0 -336
- package/convex/seedPratham.ts +0 -149
- package/convex/spendAlerts.ts +0 -442
- package/convex/stripeActions.ts +0 -607
- package/convex/teams.ts +0 -243
- package/convex/telemetry.ts +0 -81
- package/convex/tsconfig.json +0 -25
- package/convex/updateAPIStatus.ts +0 -44
- package/convex/usage.ts +0 -260
- package/convex/usageReports.ts +0 -357
- package/convex/waitlist.ts +0 -55
- package/convex/webhooks.ts +0 -494
- package/convex/workspaceSettings.ts +0 -143
- package/convex/workspaces.ts +0 -1331
- package/convex.json +0 -3
- package/direct-test.mjs +0 -51
- package/email-templates/filestack-provider-outreach.html +0 -162
- package/email-templates/partnership-template.html +0 -116
- package/email-templates/pratham-draft-preview.txt +0 -57
- package/email-templates/pratham-partnership-draft.html +0 -141
- package/reports/APIClaw-Session-Report-2026-04-05.pdf +0 -0
- package/reports/pipeline/PIPELINE-REPORT.json +0 -153
- package/reports/pipeline/acquire_apisguru.json +0 -17
- package/reports/pipeline/capabilities.json +0 -38
- package/reports/pipeline/discover_azure_recursive.json +0 -1551
- package/reports/pipeline/discover_github.json +0 -25
- package/reports/pipeline/discover_github_repos.json +0 -49
- package/reports/pipeline/discover_swaggerhub.json +0 -24
- package/reports/pipeline/discover_well_known.json +0 -23
- package/reports/pipeline/fetch_specs.json +0 -19
- package/reports/pipeline/generate_providers.json +0 -14
- package/reports/pipeline/match_registry.json +0 -11
- package/reports/pipeline/parse_specs.json +0 -17
- package/reports/pipeline/promote_candidates.json +0 -34
- package/reports/pipeline/validate.json +0 -30
- package/reports/pipeline/validate_smoke_details.json +0 -3835
- package/reports/session-report-2026-04-05.html +0 -433
- package/seed-apis-direct.mjs +0 -106
- package/src/access-control.ts +0 -174
- package/src/adapters/base.ts +0 -364
- package/src/adapters/claude-desktop.ts +0 -41
- package/src/adapters/cline.ts +0 -88
- package/src/adapters/continue.ts +0 -91
- package/src/adapters/cursor.ts +0 -43
- package/src/adapters/custom.ts +0 -188
- package/src/adapters/detect.ts +0 -202
- package/src/adapters/index.ts +0 -47
- package/src/adapters/windsurf.ts +0 -44
- package/src/bin-http.ts +0 -45
- package/src/bin.ts +0 -34
- package/src/capability-router.ts +0 -331
- package/src/chainExecutor.ts +0 -730
- package/src/chainResolver.test.ts +0 -246
- package/src/chainResolver.ts +0 -658
- package/src/cli/commands/demo.ts +0 -109
- package/src/cli/commands/doctor.ts +0 -435
- package/src/cli/commands/index.ts +0 -9
- package/src/cli/commands/login.ts +0 -203
- package/src/cli/commands/mcp-install.ts +0 -373
- package/src/cli/commands/restore.ts +0 -333
- package/src/cli/commands/setup.ts +0 -297
- package/src/cli/commands/uninstall.ts +0 -240
- package/src/cli/index.ts +0 -148
- package/src/cli.ts +0 -370
- package/src/confirmation.ts +0 -296
- package/src/credentials.ts +0 -455
- package/src/credits.ts +0 -329
- package/src/crypto.ts +0 -75
- package/src/discovery.ts +0 -568
- package/src/enterprise/env.ts +0 -156
- package/src/enterprise/index.ts +0 -7
- package/src/enterprise/script-generator.ts +0 -481
- package/src/execute-dynamic.ts +0 -617
- package/src/execute.ts +0 -2386
- package/src/funnel-client.ts +0 -168
- package/src/funnel.test.ts +0 -187
- package/src/gateway-client.ts +0 -192
- package/src/hivr-whitelist.ts +0 -110
- package/src/http-api.ts +0 -286
- package/src/http-server-minimal.ts +0 -154
- package/src/index.ts +0 -2702
- package/src/intelligent-gateway.ts +0 -339
- package/src/mcp-analytics.ts +0 -156
- package/src/metered.ts +0 -149
- package/src/open-apis-generated.ts +0 -157
- package/src/open-apis.ts +0 -558
- package/src/postinstall.ts +0 -40
- package/src/product-whitelist.ts +0 -246
- package/src/proxy.ts +0 -36
- package/src/registration-guard.ts +0 -117
- package/src/session.ts +0 -129
- package/src/stripe.ts +0 -497
- package/src/telemetry.ts +0 -71
- package/src/test.ts +0 -135
- package/src/types/convex-api.d.ts +0 -20
- package/src/types/convex-api.ts +0 -21
- package/src/types.ts +0 -109
- package/src/ui/colors.ts +0 -219
- package/src/ui/errors.ts +0 -394
- package/src/ui/index.ts +0 -17
- package/src/ui/prompts.ts +0 -390
- package/src/ui/spinner.ts +0 -325
- package/src/utils/backup.ts +0 -224
- package/src/utils/config.ts +0 -318
- package/src/utils/os.ts +0 -124
- package/src/utils/paths.ts +0 -203
- package/src/webhook.ts +0 -107
- package/test-10-working.cjs +0 -97
- package/test-14-final.cjs +0 -96
- package/test-actual-handlers.ts +0 -92
- package/test-apilayer-all-14.ts +0 -249
- package/test-apilayer-fixed.ts +0 -248
- package/test-direct-endpoints.ts +0 -174
- package/test-exact-endpoints.ts +0 -144
- package/test-final.ts +0 -83
- package/test-full-routing.ts +0 -100
- package/test-handlers-correct.ts +0 -217
- package/test-numverify-key.ts +0 -41
- package/test-via-handlers.ts +0 -92
- package/test-worldnews.mjs +0 -26
- package/tsconfig.json +0 -20
|
@@ -1,336 +0,0 @@
|
|
|
1
|
-
import { mutation } from "./_generated/server";
|
|
2
|
-
import { v } from "convex/values";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Seed Direct Call configs + actions for all 27 APILayer APIs
|
|
6
|
-
* Sets status: "live" and creates action records matching MCP proxy
|
|
7
|
-
*
|
|
8
|
-
* Run: npx convex run seedDirectCallConfigs:seed
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
const API_CONFIGS: Record<string, {
|
|
12
|
-
baseUrl: string;
|
|
13
|
-
actions: { name: string; displayName: string; description: string; method: string; path: string; params: { name: string; type: string; required: boolean; description: string; in: string }[] }[];
|
|
14
|
-
}> = {
|
|
15
|
-
"ExchangeRate API": {
|
|
16
|
-
baseUrl: "https://api.apilayer.com/exchangerates_data",
|
|
17
|
-
actions: [
|
|
18
|
-
{ name: "exchange_rates", displayName: "Get Exchange Rates", description: "Get latest exchange rates", method: "GET", path: "/latest", params: [
|
|
19
|
-
{ name: "base", type: "string", required: false, description: "Base currency (default: EUR)", in: "query" },
|
|
20
|
-
{ name: "symbols", type: "string", required: false, description: "Comma-separated target currencies", in: "query" },
|
|
21
|
-
]},
|
|
22
|
-
],
|
|
23
|
-
},
|
|
24
|
-
"Marketstack": {
|
|
25
|
-
baseUrl: "http://api.marketstack.com/v1",
|
|
26
|
-
actions: [
|
|
27
|
-
{ name: "market_data", displayName: "End of Day Data", description: "Get end-of-day stock market data", method: "GET", path: "/eod", params: [
|
|
28
|
-
{ name: "symbols", type: "string", required: true, description: "Stock ticker symbol(s)", in: "query" },
|
|
29
|
-
]},
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
|
-
"AviationStack": {
|
|
33
|
-
baseUrl: "http://api.aviationstack.com/v1",
|
|
34
|
-
actions: [
|
|
35
|
-
{ name: "aviation", displayName: "Flight Status", description: "Get real-time flight status", method: "GET", path: "/flights", params: [
|
|
36
|
-
{ name: "flight_iata", type: "string", required: false, description: "Flight IATA code", in: "query" },
|
|
37
|
-
{ name: "dep_iata", type: "string", required: false, description: "Departure airport IATA", in: "query" },
|
|
38
|
-
]},
|
|
39
|
-
],
|
|
40
|
-
},
|
|
41
|
-
"PDF Layer": {
|
|
42
|
-
baseUrl: "https://api.pdflayer.com/api",
|
|
43
|
-
actions: [
|
|
44
|
-
{ name: "pdf_generate", displayName: "Generate PDF", description: "Convert HTML/URL to PDF", method: "POST", path: "/convert", params: [
|
|
45
|
-
{ name: "document_url", type: "string", required: false, description: "URL to convert", in: "query" },
|
|
46
|
-
{ name: "document_html", type: "string", required: false, description: "HTML to convert", in: "body" },
|
|
47
|
-
]},
|
|
48
|
-
],
|
|
49
|
-
},
|
|
50
|
-
"Screenshot Layer": {
|
|
51
|
-
baseUrl: "https://api.apilayer.com/screenshot",
|
|
52
|
-
actions: [
|
|
53
|
-
{ name: "screenshot", displayName: "Capture Screenshot", description: "Capture website screenshot", method: "GET", path: "/capture", params: [
|
|
54
|
-
{ name: "url", type: "string", required: true, description: "URL to screenshot", in: "query" },
|
|
55
|
-
]},
|
|
56
|
-
],
|
|
57
|
-
},
|
|
58
|
-
"Email Verification API": {
|
|
59
|
-
baseUrl: "https://api.apilayer.com/email_verification",
|
|
60
|
-
actions: [
|
|
61
|
-
{ name: "verify_email", displayName: "Verify Email", description: "Verify email address validity", method: "GET", path: "/check", params: [
|
|
62
|
-
{ name: "email", type: "string", required: true, description: "Email to verify", in: "query" },
|
|
63
|
-
]},
|
|
64
|
-
],
|
|
65
|
-
},
|
|
66
|
-
"Number Verification API": {
|
|
67
|
-
baseUrl: "https://api.apilayer.com/number_verification",
|
|
68
|
-
actions: [
|
|
69
|
-
{ name: "verify_number", displayName: "Verify Number", description: "Validate phone number", method: "GET", path: "/validate", params: [
|
|
70
|
-
{ name: "number", type: "string", required: true, description: "Phone number to validate", in: "query" },
|
|
71
|
-
]},
|
|
72
|
-
],
|
|
73
|
-
},
|
|
74
|
-
"VAT Layer": {
|
|
75
|
-
baseUrl: "https://api.apilayer.com/vat_layer",
|
|
76
|
-
actions: [
|
|
77
|
-
{ name: "vat_check", displayName: "Validate VAT", description: "Validate EU VAT number", method: "GET", path: "/validate", params: [
|
|
78
|
-
{ name: "vat_number", type: "string", required: true, description: "VAT number to validate", in: "query" },
|
|
79
|
-
]},
|
|
80
|
-
],
|
|
81
|
-
},
|
|
82
|
-
"World News API": {
|
|
83
|
-
baseUrl: "https://api.apilayer.com/world_news",
|
|
84
|
-
actions: [
|
|
85
|
-
{ name: "world_news", displayName: "Extract News", description: "Extract news from URL", method: "GET", path: "/extract-news", params: [
|
|
86
|
-
{ name: "url", type: "string", required: true, description: "News URL to extract", in: "query" },
|
|
87
|
-
]},
|
|
88
|
-
],
|
|
89
|
-
},
|
|
90
|
-
"Finance News API": {
|
|
91
|
-
baseUrl: "https://api.apilayer.com/financelayer",
|
|
92
|
-
actions: [
|
|
93
|
-
{ name: "finance_news", displayName: "Financial News", description: "Get financial news feed", method: "GET", path: "/news", params: [
|
|
94
|
-
{ name: "tickers", type: "string", required: false, description: "Stock tickers to filter", in: "query" },
|
|
95
|
-
]},
|
|
96
|
-
],
|
|
97
|
-
},
|
|
98
|
-
"Advanced Scraper API": {
|
|
99
|
-
baseUrl: "https://api.apilayer.com/adv_scraper",
|
|
100
|
-
actions: [
|
|
101
|
-
{ name: "scrape", displayName: "Scrape URL", description: "Scrape web page content", method: "GET", path: "/scraper", params: [
|
|
102
|
-
{ name: "url", type: "string", required: true, description: "URL to scrape", in: "query" },
|
|
103
|
-
]},
|
|
104
|
-
],
|
|
105
|
-
},
|
|
106
|
-
"Image Crop API": {
|
|
107
|
-
baseUrl: "https://api.apilayer.com/smart_crop",
|
|
108
|
-
actions: [
|
|
109
|
-
{ name: "image_crop", displayName: "Smart Crop", description: "AI-powered image cropping", method: "POST", path: "/url", params: [
|
|
110
|
-
{ name: "url", type: "string", required: true, description: "Image URL to crop", in: "query" },
|
|
111
|
-
]},
|
|
112
|
-
],
|
|
113
|
-
},
|
|
114
|
-
"Skills API": {
|
|
115
|
-
baseUrl: "https://api.apilayer.com/skills",
|
|
116
|
-
actions: [
|
|
117
|
-
{ name: "skills", displayName: "Search Skills", description: "Search skill database", method: "GET", path: "/", params: [
|
|
118
|
-
{ name: "q", type: "string", required: true, description: "Search query", in: "query" },
|
|
119
|
-
]},
|
|
120
|
-
],
|
|
121
|
-
},
|
|
122
|
-
"Form API": {
|
|
123
|
-
baseUrl: "https://api.apilayer.com/form_api",
|
|
124
|
-
actions: [
|
|
125
|
-
{ name: "form_submit", displayName: "Submit Form", description: "Form submission handling", method: "POST", path: "/submit", params: [
|
|
126
|
-
{ name: "endpoint", type: "string", required: true, description: "Form endpoint", in: "path" },
|
|
127
|
-
]},
|
|
128
|
-
],
|
|
129
|
-
},
|
|
130
|
-
"Fixer API": {
|
|
131
|
-
baseUrl: "http://data.fixer.io/api",
|
|
132
|
-
actions: [
|
|
133
|
-
{ name: "fixer_convert", displayName: "Convert Currency", description: "Convert between currencies", method: "GET", path: "/convert", params: [
|
|
134
|
-
{ name: "from", type: "string", required: true, description: "Source currency", in: "query" },
|
|
135
|
-
{ name: "to", type: "string", required: true, description: "Target currency", in: "query" },
|
|
136
|
-
{ name: "amount", type: "number", required: true, description: "Amount to convert", in: "query" },
|
|
137
|
-
]},
|
|
138
|
-
{ name: "fixer_latest", displayName: "Latest Rates", description: "Get latest exchange rates", method: "GET", path: "/latest", params: [
|
|
139
|
-
{ name: "base", type: "string", required: false, description: "Base currency", in: "query" },
|
|
140
|
-
{ name: "symbols", type: "string", required: false, description: "Target currencies", in: "query" },
|
|
141
|
-
]},
|
|
142
|
-
],
|
|
143
|
-
},
|
|
144
|
-
"Currencylayer": {
|
|
145
|
-
baseUrl: "http://api.currencylayer.com",
|
|
146
|
-
actions: [
|
|
147
|
-
{ name: "currencylayer_live", displayName: "Live Rates", description: "Get live exchange rates", method: "GET", path: "/live", params: [
|
|
148
|
-
{ name: "currencies", type: "string", required: false, description: "Target currencies", in: "query" },
|
|
149
|
-
]},
|
|
150
|
-
{ name: "currencylayer_convert", displayName: "Convert", description: "Convert currency amount", method: "GET", path: "/convert", params: [
|
|
151
|
-
{ name: "from", type: "string", required: true, description: "Source currency", in: "query" },
|
|
152
|
-
{ name: "to", type: "string", required: true, description: "Target currency", in: "query" },
|
|
153
|
-
{ name: "amount", type: "number", required: true, description: "Amount", in: "query" },
|
|
154
|
-
]},
|
|
155
|
-
],
|
|
156
|
-
},
|
|
157
|
-
"Coinlayer": {
|
|
158
|
-
baseUrl: "http://api.coinlayer.com",
|
|
159
|
-
actions: [
|
|
160
|
-
{ name: "coinlayer_live", displayName: "Live Crypto Rates", description: "Get live cryptocurrency rates", method: "GET", path: "/live", params: [
|
|
161
|
-
{ name: "symbols", type: "string", required: false, description: "Crypto symbols", in: "query" },
|
|
162
|
-
]},
|
|
163
|
-
],
|
|
164
|
-
},
|
|
165
|
-
"Exchangerate.host": {
|
|
166
|
-
baseUrl: "https://api.exchangerate.host",
|
|
167
|
-
actions: [
|
|
168
|
-
{ name: "exchangeratehost_latest", displayName: "Latest Rates", description: "Free exchange rates", method: "GET", path: "/latest", params: [
|
|
169
|
-
{ name: "base", type: "string", required: false, description: "Base currency", in: "query" },
|
|
170
|
-
]},
|
|
171
|
-
],
|
|
172
|
-
},
|
|
173
|
-
"Weatherstack": {
|
|
174
|
-
baseUrl: "http://api.weatherstack.com",
|
|
175
|
-
actions: [
|
|
176
|
-
{ name: "weatherstack_current", displayName: "Current Weather", description: "Get current weather data", method: "GET", path: "/current", params: [
|
|
177
|
-
{ name: "query", type: "string", required: true, description: "Location (city, IP, coordinates)", in: "query" },
|
|
178
|
-
]},
|
|
179
|
-
{ name: "weatherstack_forecast", displayName: "Weather Forecast", description: "Get weather forecast", method: "GET", path: "/forecast", params: [
|
|
180
|
-
{ name: "query", type: "string", required: true, description: "Location", in: "query" },
|
|
181
|
-
{ name: "forecast_days", type: "number", required: false, description: "Days to forecast", in: "query" },
|
|
182
|
-
]},
|
|
183
|
-
],
|
|
184
|
-
},
|
|
185
|
-
"IPstack": {
|
|
186
|
-
baseUrl: "http://api.ipstack.com",
|
|
187
|
-
actions: [
|
|
188
|
-
{ name: "ipstack_lookup", displayName: "IP Lookup", description: "Geolocate IP address", method: "GET", path: "/{ip}", params: [
|
|
189
|
-
{ name: "ip", type: "string", required: true, description: "IP address to lookup", in: "path" },
|
|
190
|
-
]},
|
|
191
|
-
],
|
|
192
|
-
},
|
|
193
|
-
"IPapi": {
|
|
194
|
-
baseUrl: "http://api.ipapi.com",
|
|
195
|
-
actions: [
|
|
196
|
-
{ name: "ipapi_lookup", displayName: "IP Geolocation", description: "IP address geolocation", method: "GET", path: "/{ip}", params: [
|
|
197
|
-
{ name: "ip", type: "string", required: true, description: "IP address", in: "path" },
|
|
198
|
-
]},
|
|
199
|
-
],
|
|
200
|
-
},
|
|
201
|
-
"Positionstack": {
|
|
202
|
-
baseUrl: "http://api.positionstack.com/v1",
|
|
203
|
-
actions: [
|
|
204
|
-
{ name: "positionstack_forward", displayName: "Forward Geocode", description: "Address to coordinates", method: "GET", path: "/forward", params: [
|
|
205
|
-
{ name: "query", type: "string", required: true, description: "Address to geocode", in: "query" },
|
|
206
|
-
]},
|
|
207
|
-
{ name: "positionstack_reverse", displayName: "Reverse Geocode", description: "Coordinates to address", method: "GET", path: "/reverse", params: [
|
|
208
|
-
{ name: "query", type: "string", required: true, description: "Lat,lng coordinates", in: "query" },
|
|
209
|
-
]},
|
|
210
|
-
],
|
|
211
|
-
},
|
|
212
|
-
"Languagelayer": {
|
|
213
|
-
baseUrl: "https://api.languagelayer.com",
|
|
214
|
-
actions: [
|
|
215
|
-
{ name: "languagelayer_detect", displayName: "Detect Language", description: "Detect text language", method: "POST", path: "/detect", params: [
|
|
216
|
-
{ name: "query", type: "string", required: true, description: "Text to analyze", in: "body" },
|
|
217
|
-
]},
|
|
218
|
-
],
|
|
219
|
-
},
|
|
220
|
-
"Scrapestack": {
|
|
221
|
-
baseUrl: "http://api.scrapestack.com",
|
|
222
|
-
actions: [
|
|
223
|
-
{ name: "scrapestack_scrape", displayName: "Scrape Page", description: "Web scraping proxy", method: "GET", path: "/scrape", params: [
|
|
224
|
-
{ name: "url", type: "string", required: true, description: "URL to scrape", in: "query" },
|
|
225
|
-
]},
|
|
226
|
-
],
|
|
227
|
-
},
|
|
228
|
-
"Serpstack": {
|
|
229
|
-
baseUrl: "http://api.serpstack.com",
|
|
230
|
-
actions: [
|
|
231
|
-
{ name: "serpstack_search", displayName: "Search Google", description: "Google search results", method: "GET", path: "/search", params: [
|
|
232
|
-
{ name: "query", type: "string", required: true, description: "Search query", in: "query" },
|
|
233
|
-
]},
|
|
234
|
-
],
|
|
235
|
-
},
|
|
236
|
-
"Mediastack": {
|
|
237
|
-
baseUrl: "http://api.mediastack.com/v1",
|
|
238
|
-
actions: [
|
|
239
|
-
{ name: "mediastack_news", displayName: "Get News", description: "Live news articles", method: "GET", path: "/news", params: [
|
|
240
|
-
{ name: "keywords", type: "string", required: false, description: "News keywords", in: "query" },
|
|
241
|
-
{ name: "countries", type: "string", required: false, description: "Country codes", in: "query" },
|
|
242
|
-
]},
|
|
243
|
-
],
|
|
244
|
-
},
|
|
245
|
-
"Userstack": {
|
|
246
|
-
baseUrl: "http://api.userstack.com",
|
|
247
|
-
actions: [
|
|
248
|
-
{ name: "userstack_detect", displayName: "Detect User Agent", description: "Parse user agent string", method: "GET", path: "/detect", params: [
|
|
249
|
-
{ name: "ua", type: "string", required: true, description: "User agent string", in: "query" },
|
|
250
|
-
]},
|
|
251
|
-
],
|
|
252
|
-
},
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
export const seed = mutation({
|
|
256
|
-
args: {},
|
|
257
|
-
handler: async (ctx) => {
|
|
258
|
-
const providerId = "k97cvcvadnyz8x8m4we7xqmh1s83p0ph" as any; // APILayer provider ID
|
|
259
|
-
const now = Date.now();
|
|
260
|
-
|
|
261
|
-
// Get all provider APIs
|
|
262
|
-
const apis = await ctx.db
|
|
263
|
-
.query("providerAPIs")
|
|
264
|
-
.withIndex("by_providerId", (q: any) => q.eq("providerId", providerId))
|
|
265
|
-
.collect();
|
|
266
|
-
|
|
267
|
-
let configsCreated = 0;
|
|
268
|
-
let actionsCreated = 0;
|
|
269
|
-
|
|
270
|
-
for (const api of apis) {
|
|
271
|
-
const config = API_CONFIGS[api.name];
|
|
272
|
-
if (!config) continue;
|
|
273
|
-
|
|
274
|
-
// Check if Direct Call config already exists
|
|
275
|
-
const existing = await ctx.db
|
|
276
|
-
.query("providerDirectCall")
|
|
277
|
-
.withIndex("by_apiId", (q: any) => q.eq("apiId", api._id))
|
|
278
|
-
.first();
|
|
279
|
-
|
|
280
|
-
let directCallId;
|
|
281
|
-
if (existing) {
|
|
282
|
-
// Update to live
|
|
283
|
-
await ctx.db.patch(existing._id, { status: "live", updatedAt: now, publishedAt: now });
|
|
284
|
-
directCallId = existing._id;
|
|
285
|
-
} else {
|
|
286
|
-
// Create new config
|
|
287
|
-
directCallId = await ctx.db.insert("providerDirectCall", {
|
|
288
|
-
providerId,
|
|
289
|
-
apiId: api._id,
|
|
290
|
-
baseUrl: config.baseUrl,
|
|
291
|
-
authType: "bearer",
|
|
292
|
-
authHeader: "apikey",
|
|
293
|
-
authPrefix: "",
|
|
294
|
-
encryptedMasterKey: "managed-by-apiclaw",
|
|
295
|
-
rateLimitPerUser: 60,
|
|
296
|
-
rateLimitPerDay: 1000,
|
|
297
|
-
pricePerRequest: 0,
|
|
298
|
-
status: "live",
|
|
299
|
-
allowCustomerKeys: false,
|
|
300
|
-
requireCustomerKeys: false,
|
|
301
|
-
createdAt: now,
|
|
302
|
-
updatedAt: now,
|
|
303
|
-
publishedAt: now,
|
|
304
|
-
});
|
|
305
|
-
configsCreated++;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
// Create actions (skip if already exist)
|
|
309
|
-
for (const action of config.actions) {
|
|
310
|
-
const existingAction = await ctx.db
|
|
311
|
-
.query("providerActions")
|
|
312
|
-
.withIndex("by_directCallId_name", (q: any) => q.eq("directCallId", directCallId).eq("name", action.name))
|
|
313
|
-
.first();
|
|
314
|
-
|
|
315
|
-
if (!existingAction) {
|
|
316
|
-
await ctx.db.insert("providerActions", {
|
|
317
|
-
directCallId,
|
|
318
|
-
name: action.name,
|
|
319
|
-
displayName: action.displayName,
|
|
320
|
-
description: action.description,
|
|
321
|
-
method: action.method,
|
|
322
|
-
path: action.path,
|
|
323
|
-
params: action.params,
|
|
324
|
-
responseMapping: [],
|
|
325
|
-
enabled: true,
|
|
326
|
-
createdAt: now,
|
|
327
|
-
updatedAt: now,
|
|
328
|
-
});
|
|
329
|
-
actionsCreated++;
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
return { success: true, configsCreated, actionsCreated, totalApis: apis.length };
|
|
335
|
-
},
|
|
336
|
-
});
|
package/convex/seedPratham.ts
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { mutation } from "./_generated/server";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Seed Pratham's workspace with all 27 APILayer APIs
|
|
5
|
-
* Run with: npx convex run seedPratham:seedPrathamWorkspace
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export const seedPrathamWorkspace = mutation({
|
|
9
|
-
args: {},
|
|
10
|
-
handler: async (ctx) => {
|
|
11
|
-
const email = "pratham@apilayer.com";
|
|
12
|
-
|
|
13
|
-
// 1. Get existing workspace (already created + activated on prod)
|
|
14
|
-
let workspace = await ctx.db
|
|
15
|
-
.query("workspaces")
|
|
16
|
-
.withIndex("by_email", (q) => q.eq("email", email))
|
|
17
|
-
.first();
|
|
18
|
-
|
|
19
|
-
if (!workspace) {
|
|
20
|
-
throw new Error(`Workspace for ${email} not found on prod. Create it first.`);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
console.log(`✓ Workspace exists: ${workspace._id} (${workspace.tier}, ${workspace.status})`);
|
|
24
|
-
|
|
25
|
-
// 2. Create provider profile linked to workspace
|
|
26
|
-
let provider = await ctx.db
|
|
27
|
-
.query("providers")
|
|
28
|
-
.withIndex("by_email", (q) => q.eq("email", email))
|
|
29
|
-
.first();
|
|
30
|
-
|
|
31
|
-
if (!provider) {
|
|
32
|
-
const providerId = await ctx.db.insert("providers", {
|
|
33
|
-
email,
|
|
34
|
-
name: "Pratham (APILayer)",
|
|
35
|
-
company: "APILayer",
|
|
36
|
-
website: "https://apilayer.com",
|
|
37
|
-
status: "approved",
|
|
38
|
-
workspaceId: workspace._id,
|
|
39
|
-
stripeOnboardingComplete: false,
|
|
40
|
-
createdAt: Date.now(),
|
|
41
|
-
updatedAt: Date.now(),
|
|
42
|
-
approvedAt: Date.now(),
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
provider = await ctx.db.get(providerId);
|
|
46
|
-
console.log(`✓ Created provider profile linked to workspace ${workspace._id}`);
|
|
47
|
-
} else {
|
|
48
|
-
// Ensure workspaceId is linked
|
|
49
|
-
if (!provider.workspaceId) {
|
|
50
|
-
await ctx.db.patch(provider._id, { workspaceId: workspace._id });
|
|
51
|
-
console.log(`✓ Linked existing provider to workspace ${workspace._id}`);
|
|
52
|
-
}
|
|
53
|
-
console.log(`✓ Provider profile exists: ${provider._id}`);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (!provider) throw new Error("Failed to create provider");
|
|
57
|
-
|
|
58
|
-
// 3. Create all 27 APILayer APIs
|
|
59
|
-
const apis = [
|
|
60
|
-
// Unified APIs (14)
|
|
61
|
-
{ name: "ExchangeRate API", description: "Real-time exchange rates", category: "finance", action: "exchange_rates" },
|
|
62
|
-
{ name: "Marketstack", description: "Real-time market data", category: "finance", action: "market_data" },
|
|
63
|
-
{ name: "AviationStack", description: "Flight data API", category: "geolocation", action: "aviation" },
|
|
64
|
-
{ name: "PDF Layer", description: "HTML to PDF conversion", category: "business", action: "pdf_generate" },
|
|
65
|
-
{ name: "Screenshot Layer", description: "Website screenshots", category: "marketing", action: "screenshot" },
|
|
66
|
-
{ name: "Email Verification API", description: "Verify email addresses", category: "devtools", action: "verify_email" },
|
|
67
|
-
{ name: "Number Verification API", description: "Validate phone numbers", category: "devtools", action: "verify_number" },
|
|
68
|
-
{ name: "VAT Layer", description: "VAT number validation", category: "finance", action: "vat_check" },
|
|
69
|
-
{ name: "World News API", description: "Extract news from URLs", category: "news", action: "world_news" },
|
|
70
|
-
{ name: "Finance News API", description: "Financial news feed", category: "news", action: "finance_news" },
|
|
71
|
-
{ name: "Advanced Scraper API", description: "Web scraping", category: "scraping", action: "scrape" },
|
|
72
|
-
{ name: "Image Crop API", description: "Smart image cropping", category: "marketing", action: "image_crop" },
|
|
73
|
-
{ name: "Skills API", description: "Skill database search", category: "devtools", action: "skills" },
|
|
74
|
-
{ name: "Form API", description: "Form submission handling", category: "devtools", action: "form_submit" },
|
|
75
|
-
|
|
76
|
-
// Legacy APIs (13)
|
|
77
|
-
{ name: "Fixer API", description: "Currency conversion (legacy)", category: "finance", action: "fixer_convert" },
|
|
78
|
-
{ name: "Fixer Latest Rates", description: "Latest exchange rates", category: "finance", action: "fixer_latest" },
|
|
79
|
-
{ name: "Currencylayer Live", description: "Live currency rates", category: "finance", action: "currencylayer_live" },
|
|
80
|
-
{ name: "Currencylayer Convert", description: "Currency conversion", category: "finance", action: "currencylayer_convert" },
|
|
81
|
-
{ name: "Coinlayer", description: "Crypto exchange rates", category: "finance", action: "coinlayer_live" },
|
|
82
|
-
{ name: "Exchangerate.host", description: "Exchange rates API", category: "finance", action: "exchangeratehost_latest" },
|
|
83
|
-
{ name: "Weatherstack Current", description: "Current weather data", category: "geolocation", action: "weatherstack_current" },
|
|
84
|
-
{ name: "Weatherstack Forecast", description: "Weather forecasts", category: "geolocation", action: "weatherstack_forecast" },
|
|
85
|
-
{ name: "IPstack", description: "IP geolocation lookup", category: "geolocation", action: "ipstack_lookup" },
|
|
86
|
-
{ name: "IPapi", description: "IP address lookup", category: "geolocation", action: "ipapi_lookup" },
|
|
87
|
-
{ name: "Positionstack Forward", description: "Geocoding (address → coords)", category: "geolocation", action: "positionstack_forward" },
|
|
88
|
-
{ name: "Positionstack Reverse", description: "Reverse geocoding (coords → address)", category: "geolocation", action: "positionstack_reverse" },
|
|
89
|
-
{ name: "Languagelayer", description: "Language detection", category: "devtools", action: "languagelayer_detect" },
|
|
90
|
-
{ name: "Scrapestack", description: "Web scraping service", category: "scraping", action: "scrapestack_scrape" },
|
|
91
|
-
{ name: "Serpstack", description: "Google search results", category: "scraping", action: "serpstack_search" },
|
|
92
|
-
{ name: "Mediastack", description: "News and blog articles", category: "news", action: "mediastack_news" },
|
|
93
|
-
{ name: "Userstack", description: "User agent detection", category: "devtools", action: "userstack_detect" },
|
|
94
|
-
];
|
|
95
|
-
|
|
96
|
-
let createdCount = 0;
|
|
97
|
-
let existingCount = 0;
|
|
98
|
-
|
|
99
|
-
for (const api of apis) {
|
|
100
|
-
// Check if already exists
|
|
101
|
-
const existing = await ctx.db
|
|
102
|
-
.query("providerAPIs")
|
|
103
|
-
.withIndex("by_providerId", (q) => q.eq("providerId", provider!._id))
|
|
104
|
-
.filter((q) => q.eq(q.field("name"), api.name))
|
|
105
|
-
.first();
|
|
106
|
-
|
|
107
|
-
if (!existing) {
|
|
108
|
-
await ctx.db.insert("providerAPIs", {
|
|
109
|
-
providerId: provider._id,
|
|
110
|
-
name: api.name,
|
|
111
|
-
description: api.description,
|
|
112
|
-
category: api.category,
|
|
113
|
-
pricingModel: "freemium",
|
|
114
|
-
pricingNotes: "Free tier available, paid tiers for higher limits",
|
|
115
|
-
status: "approved",
|
|
116
|
-
createdAt: Date.now(),
|
|
117
|
-
approvedAt: Date.now(),
|
|
118
|
-
discoveryCount: 0,
|
|
119
|
-
});
|
|
120
|
-
createdCount++;
|
|
121
|
-
} else {
|
|
122
|
-
existingCount++;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
console.log(`✓ APIs: ${createdCount} created, ${existingCount} already existed`);
|
|
127
|
-
|
|
128
|
-
return {
|
|
129
|
-
success: true,
|
|
130
|
-
workspace: {
|
|
131
|
-
email: workspace.email,
|
|
132
|
-
tier: workspace.tier,
|
|
133
|
-
id: workspace._id,
|
|
134
|
-
},
|
|
135
|
-
provider: {
|
|
136
|
-
name: provider.name,
|
|
137
|
-
company: provider.company,
|
|
138
|
-
id: provider._id,
|
|
139
|
-
},
|
|
140
|
-
apis: {
|
|
141
|
-
total: apis.length,
|
|
142
|
-
created: createdCount,
|
|
143
|
-
existing: existingCount,
|
|
144
|
-
},
|
|
145
|
-
dashboardUrl: `https://apiclaw.cloud/workspace`,
|
|
146
|
-
loginInstructions: "Magic link sent to pratham@apilayer.com",
|
|
147
|
-
};
|
|
148
|
-
},
|
|
149
|
-
});
|