@nordsym/apiclaw 2.1.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/funnel-client.d.ts +24 -0
- package/dist/funnel-client.d.ts.map +1 -0
- package/dist/funnel-client.js +131 -0
- package/dist/funnel-client.js.map +1 -0
- package/dist/funnel.test.d.ts +2 -0
- package/dist/funnel.test.d.ts.map +1 -0
- package/dist/funnel.test.js +145 -0
- package/dist/funnel.test.js.map +1 -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 +161 -74
- package/dist/index.js.map +1 -1
- package/dist/postinstall.d.ts +0 -5
- package/dist/postinstall.d.ts.map +1 -1
- package/dist/postinstall.js +24 -3
- package/dist/postinstall.js.map +1 -1
- package/dist/registration-guard.d.ts +29 -0
- package/dist/registration-guard.d.ts.map +1 -0
- package/dist/registration-guard.js +87 -0
- package/dist/registration-guard.js.map +1 -0
- package/package.json +7 -2
- package/.claude/settings.local.json +0 -9
- package/.env.prod +0 -1
- package/apiclaw-README.md +0 -494
- package/convex/_generated/api.d.ts +0 -137
- 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/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 -50
- 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/http.ts +0 -3430
- 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/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 -869
- 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/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 -2611
- 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 -18
- package/src/product-whitelist.ts +0 -246
- package/src/proxy.ts +0 -36
- 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
package/src/credentials.ts
DELETED
|
@@ -1,455 +0,0 @@
|
|
|
1
|
-
// Real credential providers for APIClaw Connected tier
|
|
2
|
-
// Reads from environment variables or ~/.secrets/
|
|
3
|
-
|
|
4
|
-
import { readFileSync, existsSync } from 'fs';
|
|
5
|
-
import { join } from 'path';
|
|
6
|
-
import { homedir } from 'os';
|
|
7
|
-
import { APICredentials } from './types.js';
|
|
8
|
-
|
|
9
|
-
interface ProviderCredential {
|
|
10
|
-
type: 'basic' | 'api_key' | 'bearer';
|
|
11
|
-
get(): APICredentials | null;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// Load env file helper
|
|
15
|
-
function loadEnvFile(filename: string): Record<string, string> {
|
|
16
|
-
const paths = [
|
|
17
|
-
join(homedir(), '.secrets', filename),
|
|
18
|
-
join(process.cwd(), filename),
|
|
19
|
-
join(process.cwd(), '.env.local'),
|
|
20
|
-
];
|
|
21
|
-
|
|
22
|
-
for (const path of paths) {
|
|
23
|
-
if (existsSync(path)) {
|
|
24
|
-
const content = readFileSync(path, 'utf-8');
|
|
25
|
-
const vars: Record<string, string> = {};
|
|
26
|
-
for (const line of content.split('\n')) {
|
|
27
|
-
const match = line.match(/^([^=]+)=(.*)$/);
|
|
28
|
-
if (match) {
|
|
29
|
-
vars[match[1].trim()] = match[2].trim().replace(/^["']|["']$/g, '');
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return vars;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return {};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Provider credential getters
|
|
39
|
-
const providers: Record<string, ProviderCredential> = {
|
|
40
|
-
'46elks': {
|
|
41
|
-
type: 'basic',
|
|
42
|
-
get(): APICredentials | null {
|
|
43
|
-
const env = loadEnvFile('46elks.env');
|
|
44
|
-
const user = env.ELKS_API_USER || process.env.ELKS_API_USER;
|
|
45
|
-
const pass = env.ELKS_API_PASSWORD || process.env.ELKS_API_PASSWORD;
|
|
46
|
-
|
|
47
|
-
if (!user || !pass) return null;
|
|
48
|
-
|
|
49
|
-
return {
|
|
50
|
-
type: 'basic',
|
|
51
|
-
username: user,
|
|
52
|
-
password: pass,
|
|
53
|
-
};
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
twilio: {
|
|
58
|
-
type: 'basic',
|
|
59
|
-
get(): APICredentials | null {
|
|
60
|
-
const env = loadEnvFile('twilio.env');
|
|
61
|
-
const sid = env.TWILIO_ACCOUNT_SID || process.env.TWILIO_ACCOUNT_SID;
|
|
62
|
-
const token = env.TWILIO_AUTH_TOKEN || process.env.TWILIO_AUTH_TOKEN;
|
|
63
|
-
|
|
64
|
-
if (!sid || !token) return null;
|
|
65
|
-
|
|
66
|
-
return {
|
|
67
|
-
type: 'basic',
|
|
68
|
-
username: sid,
|
|
69
|
-
password: token,
|
|
70
|
-
};
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
// Real credential providers
|
|
75
|
-
resend: {
|
|
76
|
-
type: 'api_key',
|
|
77
|
-
get(): APICredentials | null {
|
|
78
|
-
const env = loadEnvFile('resend.env');
|
|
79
|
-
const key = env.RESEND_API_KEY || process.env.RESEND_API_KEY;
|
|
80
|
-
if (key) {
|
|
81
|
-
return { type: 'api_key', api_key: key };
|
|
82
|
-
}
|
|
83
|
-
return null;
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
brave_search: {
|
|
88
|
-
type: 'api_key',
|
|
89
|
-
get(): APICredentials | null {
|
|
90
|
-
const env = loadEnvFile('brave.env');
|
|
91
|
-
const key = env.BRAVE_API_KEY || process.env.BRAVE_API_KEY;
|
|
92
|
-
if (key) {
|
|
93
|
-
return { type: 'api_key', api_key: key };
|
|
94
|
-
}
|
|
95
|
-
return null;
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
openrouter: {
|
|
100
|
-
type: 'bearer',
|
|
101
|
-
get(): APICredentials | null {
|
|
102
|
-
const env = loadEnvFile('openrouter.env');
|
|
103
|
-
const key = env.OPENROUTER_API_KEY || process.env.OPENROUTER_API_KEY;
|
|
104
|
-
if (key) {
|
|
105
|
-
return { type: 'bearer', api_key: key };
|
|
106
|
-
}
|
|
107
|
-
return null;
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
elevenlabs: {
|
|
112
|
-
type: 'api_key',
|
|
113
|
-
get(): APICredentials | null {
|
|
114
|
-
const env = loadEnvFile('elevenlabs.env');
|
|
115
|
-
const key = env.ELEVENLABS_API_KEY || process.env.ELEVENLABS_API_KEY;
|
|
116
|
-
if (key) {
|
|
117
|
-
return { type: 'api_key', api_key: key };
|
|
118
|
-
}
|
|
119
|
-
return null;
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
replicate: {
|
|
124
|
-
type: 'bearer',
|
|
125
|
-
get(): APICredentials | null {
|
|
126
|
-
const env = loadEnvFile('replicate.env');
|
|
127
|
-
const key = env.REPLICATE_API_TOKEN || process.env.REPLICATE_API_TOKEN;
|
|
128
|
-
if (key) {
|
|
129
|
-
return { type: 'bearer', api_key: key };
|
|
130
|
-
}
|
|
131
|
-
return null;
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
firecrawl: {
|
|
136
|
-
type: 'bearer',
|
|
137
|
-
get(): APICredentials | null {
|
|
138
|
-
const env = loadEnvFile('firecrawl.env');
|
|
139
|
-
const key = env.FIRECRAWL_API_KEY || process.env.FIRECRAWL_API_KEY;
|
|
140
|
-
if (key) {
|
|
141
|
-
return { type: 'bearer', api_key: key };
|
|
142
|
-
}
|
|
143
|
-
return null;
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
github: {
|
|
148
|
-
type: 'bearer',
|
|
149
|
-
get(): APICredentials | null {
|
|
150
|
-
const env = loadEnvFile('github.env');
|
|
151
|
-
const key = env.GITHUB_TOKEN || process.env.GITHUB_TOKEN;
|
|
152
|
-
if (key) {
|
|
153
|
-
return { type: 'bearer', token: key };
|
|
154
|
-
}
|
|
155
|
-
return null;
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
e2b: {
|
|
160
|
-
type: 'api_key',
|
|
161
|
-
get(): APICredentials | null {
|
|
162
|
-
const env = loadEnvFile('e2b.env');
|
|
163
|
-
const key = env.E2B_API_KEY || process.env.E2B_API_KEY;
|
|
164
|
-
if (key) {
|
|
165
|
-
return { type: 'api_key', api_key: key };
|
|
166
|
-
}
|
|
167
|
-
return null;
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
|
|
171
|
-
apilayer: {
|
|
172
|
-
type: 'api_key',
|
|
173
|
-
get(): APICredentials | null {
|
|
174
|
-
const env = loadEnvFile('apilayer.env');
|
|
175
|
-
const legacy = loadEnvFile('apilayer-legacy.env');
|
|
176
|
-
|
|
177
|
-
// Merge unified + legacy keys
|
|
178
|
-
const keys: Record<string, string> = {};
|
|
179
|
-
|
|
180
|
-
// Unified APILayer keys (APILAYER_*)
|
|
181
|
-
for (const [k, v] of Object.entries(env)) {
|
|
182
|
-
if (k.startsWith('APILAYER_') && v) {
|
|
183
|
-
keys[k] = v;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// Legacy keys (separate API domains)
|
|
188
|
-
for (const [k, v] of Object.entries(legacy)) {
|
|
189
|
-
if (v && k.endsWith('_API_KEY')) {
|
|
190
|
-
keys[k] = v;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
if (Object.keys(keys).length === 0) return null;
|
|
195
|
-
return { type: 'api_key', api_key: keys.APILAYER_EXCHANGERATE_KEY || '', ...keys } as any;
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
|
|
199
|
-
groq: {
|
|
200
|
-
type: 'bearer',
|
|
201
|
-
get(): APICredentials | null {
|
|
202
|
-
const env = loadEnvFile('groq.env');
|
|
203
|
-
const key = env.GROQ_API_KEY || process.env.GROQ_API_KEY;
|
|
204
|
-
if (key) {
|
|
205
|
-
return { type: 'bearer', api_key: key };
|
|
206
|
-
}
|
|
207
|
-
return null;
|
|
208
|
-
},
|
|
209
|
-
},
|
|
210
|
-
|
|
211
|
-
deepgram: {
|
|
212
|
-
type: 'bearer',
|
|
213
|
-
get(): APICredentials | null {
|
|
214
|
-
const env = loadEnvFile('deepgram.env');
|
|
215
|
-
const key = env.DEEPGRAM_API_KEY || process.env.DEEPGRAM_API_KEY;
|
|
216
|
-
if (key) {
|
|
217
|
-
return { type: 'bearer', api_key: key };
|
|
218
|
-
}
|
|
219
|
-
return null;
|
|
220
|
-
},
|
|
221
|
-
},
|
|
222
|
-
|
|
223
|
-
mistral: {
|
|
224
|
-
type: 'api_key',
|
|
225
|
-
get(): APICredentials | null {
|
|
226
|
-
const env = loadEnvFile('mistral.env');
|
|
227
|
-
const key = env.MISTRAL_API_KEY || process.env.MISTRAL_API_KEY;
|
|
228
|
-
if (key) {
|
|
229
|
-
return { type: 'api_key', api_key: key };
|
|
230
|
-
}
|
|
231
|
-
return null;
|
|
232
|
-
},
|
|
233
|
-
},
|
|
234
|
-
|
|
235
|
-
cohere: {
|
|
236
|
-
type: 'api_key',
|
|
237
|
-
get(): APICredentials | null {
|
|
238
|
-
const env = loadEnvFile('cohere.env');
|
|
239
|
-
const key = env.COHERE_API_KEY || process.env.COHERE_API_KEY;
|
|
240
|
-
if (key) {
|
|
241
|
-
return { type: 'api_key', api_key: key };
|
|
242
|
-
}
|
|
243
|
-
return null;
|
|
244
|
-
},
|
|
245
|
-
},
|
|
246
|
-
|
|
247
|
-
serper: {
|
|
248
|
-
type: 'api_key',
|
|
249
|
-
get(): APICredentials | null {
|
|
250
|
-
const env = loadEnvFile('serpapi.env');
|
|
251
|
-
const key = env.SERPAPI_API_KEY || process.env.SERPER_API_KEY || process.env.SERPAPI_API_KEY;
|
|
252
|
-
if (key) {
|
|
253
|
-
return { type: 'api_key', api_key: key };
|
|
254
|
-
}
|
|
255
|
-
return null;
|
|
256
|
-
},
|
|
257
|
-
},
|
|
258
|
-
|
|
259
|
-
stability: {
|
|
260
|
-
type: 'api_key',
|
|
261
|
-
get(): APICredentials | null {
|
|
262
|
-
const env = loadEnvFile('stability.env');
|
|
263
|
-
const key = env.STABILITY_API_KEY || process.env.STABILITY_API_KEY;
|
|
264
|
-
if (key) {
|
|
265
|
-
return { type: 'api_key', api_key: key };
|
|
266
|
-
}
|
|
267
|
-
return null;
|
|
268
|
-
},
|
|
269
|
-
},
|
|
270
|
-
|
|
271
|
-
together: {
|
|
272
|
-
type: 'bearer',
|
|
273
|
-
get(): APICredentials | null {
|
|
274
|
-
const env = loadEnvFile('together.env');
|
|
275
|
-
const key = env.TOGETHER_API_KEY || process.env.TOGETHER_API_KEY;
|
|
276
|
-
if (key) {
|
|
277
|
-
return { type: 'bearer', api_key: key };
|
|
278
|
-
}
|
|
279
|
-
return null;
|
|
280
|
-
},
|
|
281
|
-
},
|
|
282
|
-
|
|
283
|
-
assemblyai: {
|
|
284
|
-
type: 'api_key',
|
|
285
|
-
get(): APICredentials | null {
|
|
286
|
-
const env = loadEnvFile('assemblyai.env');
|
|
287
|
-
const key = env.ASSEMBLYAI_API_KEY || process.env.ASSEMBLYAI_API_KEY;
|
|
288
|
-
if (key) {
|
|
289
|
-
return { type: 'api_key', api_key: key };
|
|
290
|
-
}
|
|
291
|
-
return null;
|
|
292
|
-
},
|
|
293
|
-
},
|
|
294
|
-
|
|
295
|
-
voyage: {
|
|
296
|
-
type: 'bearer',
|
|
297
|
-
get(): APICredentials | null {
|
|
298
|
-
const env = loadEnvFile('voyage.env');
|
|
299
|
-
const key = env.VOYAGE_API_KEY || process.env.VOYAGE_API_KEY;
|
|
300
|
-
if (key) {
|
|
301
|
-
return { type: 'bearer', api_key: key };
|
|
302
|
-
}
|
|
303
|
-
return null;
|
|
304
|
-
},
|
|
305
|
-
},
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* Get real credentials for a provider
|
|
310
|
-
* Returns null if provider not supported
|
|
311
|
-
*/
|
|
312
|
-
export function getCredentials(providerId: string): APICredentials | null {
|
|
313
|
-
const provider = providers[providerId];
|
|
314
|
-
if (!provider) return null;
|
|
315
|
-
return provider.get();
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
/**
|
|
319
|
-
* Check if a provider has real (non-demo) credentials available
|
|
320
|
-
*/
|
|
321
|
-
export function hasRealCredentials(providerId: string): boolean {
|
|
322
|
-
if (providerId === '46elks') {
|
|
323
|
-
const env = loadEnvFile('46elks.env');
|
|
324
|
-
return !!(env.ELKS_API_USER || process.env.ELKS_API_USER);
|
|
325
|
-
}
|
|
326
|
-
if (providerId === 'twilio') {
|
|
327
|
-
const env = loadEnvFile('twilio.env');
|
|
328
|
-
return !!(env.TWILIO_ACCOUNT_SID || process.env.TWILIO_ACCOUNT_SID);
|
|
329
|
-
}
|
|
330
|
-
if (providerId === 'resend') {
|
|
331
|
-
const env = loadEnvFile('resend.env');
|
|
332
|
-
return !!(env.RESEND_API_KEY || process.env.RESEND_API_KEY);
|
|
333
|
-
}
|
|
334
|
-
if (providerId === 'brave_search') {
|
|
335
|
-
const env = loadEnvFile('brave.env');
|
|
336
|
-
return !!(env.BRAVE_API_KEY || process.env.BRAVE_API_KEY);
|
|
337
|
-
}
|
|
338
|
-
if (providerId === 'openrouter') {
|
|
339
|
-
const env = loadEnvFile('openrouter.env');
|
|
340
|
-
return !!(env.OPENROUTER_API_KEY || process.env.OPENROUTER_API_KEY);
|
|
341
|
-
}
|
|
342
|
-
if (providerId === 'elevenlabs') {
|
|
343
|
-
const env = loadEnvFile('elevenlabs.env');
|
|
344
|
-
return !!(env.ELEVENLABS_API_KEY || process.env.ELEVENLABS_API_KEY);
|
|
345
|
-
}
|
|
346
|
-
if (providerId === 'replicate') {
|
|
347
|
-
const env = loadEnvFile('replicate.env');
|
|
348
|
-
return !!(env.REPLICATE_API_TOKEN || process.env.REPLICATE_API_TOKEN);
|
|
349
|
-
}
|
|
350
|
-
if (providerId === 'e2b') {
|
|
351
|
-
const env = loadEnvFile('e2b.env');
|
|
352
|
-
return !!(env.E2B_API_KEY || process.env.E2B_API_KEY);
|
|
353
|
-
}
|
|
354
|
-
if (providerId === 'firecrawl') {
|
|
355
|
-
const env = loadEnvFile('firecrawl.env');
|
|
356
|
-
return !!(env.FIRECRAWL_API_KEY || process.env.FIRECRAWL_API_KEY);
|
|
357
|
-
}
|
|
358
|
-
if (providerId === 'github') {
|
|
359
|
-
const env = loadEnvFile('github.env');
|
|
360
|
-
return !!(env.GITHUB_TOKEN || process.env.GITHUB_TOKEN);
|
|
361
|
-
}
|
|
362
|
-
if (providerId === 'apilayer') {
|
|
363
|
-
const env = loadEnvFile('apilayer.env');
|
|
364
|
-
const legacy = loadEnvFile('apilayer-legacy.env');
|
|
365
|
-
return !!(
|
|
366
|
-
env.APILAYER_EXCHANGERATE_KEY ||
|
|
367
|
-
process.env.APILAYER_EXCHANGERATE_KEY ||
|
|
368
|
-
Object.keys(legacy).length > 0
|
|
369
|
-
);
|
|
370
|
-
}
|
|
371
|
-
if (providerId === 'groq') {
|
|
372
|
-
const env = loadEnvFile('groq.env');
|
|
373
|
-
return !!(env.GROQ_API_KEY || process.env.GROQ_API_KEY);
|
|
374
|
-
}
|
|
375
|
-
if (providerId === 'mistral') {
|
|
376
|
-
const env = loadEnvFile('mistral.env');
|
|
377
|
-
return !!(env.MISTRAL_API_KEY || process.env.MISTRAL_API_KEY);
|
|
378
|
-
}
|
|
379
|
-
if (providerId === 'cohere') {
|
|
380
|
-
const env = loadEnvFile('cohere.env');
|
|
381
|
-
return !!(env.COHERE_API_KEY || process.env.COHERE_API_KEY);
|
|
382
|
-
}
|
|
383
|
-
if (providerId === 'together') {
|
|
384
|
-
const env = loadEnvFile('together.env');
|
|
385
|
-
return !!(env.TOGETHER_API_KEY || process.env.TOGETHER_API_KEY);
|
|
386
|
-
}
|
|
387
|
-
if (providerId === 'stability') {
|
|
388
|
-
const env = loadEnvFile('stability.env');
|
|
389
|
-
return !!(env.STABILITY_API_KEY || process.env.STABILITY_API_KEY);
|
|
390
|
-
}
|
|
391
|
-
if (providerId === 'deepgram') {
|
|
392
|
-
const env = loadEnvFile('deepgram.env');
|
|
393
|
-
return !!(env.DEEPGRAM_API_KEY || process.env.DEEPGRAM_API_KEY);
|
|
394
|
-
}
|
|
395
|
-
if (providerId === 'assemblyai') {
|
|
396
|
-
const env = loadEnvFile('assemblyai.env');
|
|
397
|
-
return !!(env.ASSEMBLYAI_API_KEY || process.env.ASSEMBLYAI_API_KEY);
|
|
398
|
-
}
|
|
399
|
-
if (providerId === 'voyage') {
|
|
400
|
-
const env = loadEnvFile('voyage.env');
|
|
401
|
-
return !!(env.VOYAGE_API_KEY || process.env.VOYAGE_API_KEY);
|
|
402
|
-
}
|
|
403
|
-
if (providerId === 'serper') {
|
|
404
|
-
const env = loadEnvFile('serper.env');
|
|
405
|
-
const envAlt = loadEnvFile('serpapi.env');
|
|
406
|
-
return !!(env.SERPER_API_KEY || envAlt.SERPAPI_API_KEY || envAlt.SERPER_API_KEY || process.env.SERPER_API_KEY);
|
|
407
|
-
}
|
|
408
|
-
if (providerId === 'groq') {
|
|
409
|
-
const env = loadEnvFile('groq.env');
|
|
410
|
-
return !!(env.GROQ_API_KEY || process.env.GROQ_API_KEY);
|
|
411
|
-
}
|
|
412
|
-
if (providerId === 'deepgram') {
|
|
413
|
-
const env = loadEnvFile('deepgram.env');
|
|
414
|
-
return !!(env.DEEPGRAM_API_KEY || process.env.DEEPGRAM_API_KEY);
|
|
415
|
-
}
|
|
416
|
-
if (providerId === 'mistral') {
|
|
417
|
-
const env = loadEnvFile('mistral.env');
|
|
418
|
-
return !!(env.MISTRAL_API_KEY || process.env.MISTRAL_API_KEY);
|
|
419
|
-
}
|
|
420
|
-
if (providerId === 'cohere') {
|
|
421
|
-
const env = loadEnvFile('cohere.env');
|
|
422
|
-
return !!(env.COHERE_API_KEY || process.env.COHERE_API_KEY);
|
|
423
|
-
}
|
|
424
|
-
if (providerId === 'serper') {
|
|
425
|
-
const env = loadEnvFile('serpapi.env');
|
|
426
|
-
return !!(env.SERPAPI_API_KEY || process.env.SERPER_API_KEY || process.env.SERPAPI_API_KEY);
|
|
427
|
-
}
|
|
428
|
-
if (providerId === 'stability') {
|
|
429
|
-
const env = loadEnvFile('stability.env');
|
|
430
|
-
return !!(env.STABILITY_API_KEY || process.env.STABILITY_API_KEY);
|
|
431
|
-
}
|
|
432
|
-
if (providerId === 'together') {
|
|
433
|
-
const env = loadEnvFile('together.env');
|
|
434
|
-
return !!(env.TOGETHER_API_KEY || process.env.TOGETHER_API_KEY);
|
|
435
|
-
}
|
|
436
|
-
if (providerId === 'assemblyai') {
|
|
437
|
-
const env = loadEnvFile('assemblyai.env');
|
|
438
|
-
return !!(env.ASSEMBLYAI_API_KEY || process.env.ASSEMBLYAI_API_KEY);
|
|
439
|
-
}
|
|
440
|
-
return false;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
* List all supported providers
|
|
445
|
-
*/
|
|
446
|
-
export function listProviders(): string[] {
|
|
447
|
-
return Object.keys(providers);
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
/**
|
|
451
|
-
* Get credential type for a provider
|
|
452
|
-
*/
|
|
453
|
-
export function getCredentialType(providerId: string): string | null {
|
|
454
|
-
return providers[providerId]?.type || null;
|
|
455
|
-
}
|