@nordsym/apiclaw 1.8.5 → 1.8.7
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 +4 -4
- package/apiclaw-README.md +12 -12
- package/convex/_generated/api.d.ts +16 -0
- package/convex/analytics.d.ts.map +1 -1
- package/convex/analytics.js.map +1 -1
- package/convex/analytics.ts +1 -0
- package/convex/apiKeys.ts +220 -0
- package/convex/backfillAnalytics.d.ts.map +1 -0
- package/convex/backfillAnalytics.js.map +1 -0
- package/convex/backfillAnalytics.ts +22 -0
- package/convex/backfillSearchLogs.d.ts.map +1 -0
- package/convex/backfillSearchLogs.js.map +1 -0
- package/convex/backfillSearchLogs.ts +35 -0
- package/convex/debugFilestackLogs.d.ts.map +1 -0
- package/convex/debugFilestackLogs.js.map +1 -0
- package/convex/debugFilestackLogs.ts +16 -0
- package/convex/debugGetToken.d.ts.map +1 -0
- package/convex/debugGetToken.js.map +1 -0
- package/convex/debugGetToken.ts +18 -0
- package/convex/directCall.ts +49 -14
- package/convex/email.ts +5 -5
- package/convex/http.d.ts.map +1 -1
- package/convex/http.js.map +1 -1
- package/convex/http.ts +611 -49
- package/convex/logs.ts +26 -22
- package/convex/migrateFilestack.d.ts.map +1 -1
- package/convex/migrateFilestack.js.map +1 -1
- package/convex/migrateFilestack.ts +65 -101
- package/convex/migratePartnersProd.d.ts.map +1 -0
- package/convex/migratePartnersProd.js.map +1 -0
- package/convex/migratePartnersProd.ts +174 -0
- package/convex/migrateProviderWorkspaces.d.ts.map +1 -0
- package/convex/migrateProviderWorkspaces.js.map +1 -0
- package/convex/migrateProviderWorkspaces.ts +175 -0
- package/convex/providers.js.map +1 -1
- package/convex/providers.ts +313 -203
- package/convex/schema.ts +50 -1
- package/convex/searchLogs.d.ts.map +1 -1
- package/convex/searchLogs.js.map +1 -1
- package/convex/searchLogs.ts +11 -3
- package/convex/seedPratham.ts +1 -1
- package/convex/spendAlerts.ts +2 -2
- package/convex/stripeActions.ts +1 -1
- package/convex/updateAPIStatus.ts +2 -3
- package/convex/workspaceSettings.ts +136 -0
- package/dist/bin-http.js +0 -0
- package/dist/bin.js +0 -0
- package/dist/cli/commands/demo.js +2 -2
- package/dist/cli/commands/doctor.js +1 -1
- package/dist/cli/commands/login.js +1 -1
- package/dist/cli/commands/setup.js +2 -2
- package/dist/discovery.js +1 -1
- package/dist/execute.js +3 -3
- package/dist/index.js +13 -13
- package/dist/registry/apis.json +1 -1
- package/dist/ui/errors.js +16 -16
- package/dist/ui/prompts.js +1 -1
- package/email-templates/filestack-provider-outreach.html +1 -1
- package/email-templates/partnership-template.html +1 -1
- package/email-templates/pratham-partnership-draft.html +2 -2
- package/package.json +2 -2
- package/reports/APIClaw-Session-Report-2026-04-05.pdf +0 -0
- package/reports/session-report-2026-04-05.html +433 -0
- package/src/cli/commands/demo.ts +2 -2
- package/src/cli/commands/doctor.ts +1 -1
- package/src/cli/commands/login.ts +1 -1
- package/src/cli/commands/setup.ts +2 -2
- package/src/discovery.ts +1 -1
- package/src/execute.ts +3 -3
- package/src/index.ts +14 -14
- package/src/registry/apis.json +1 -1
- package/src/ui/errors.ts +16 -16
- package/src/ui/prompts.ts +1 -1
- package/convex/adminActivate.d.ts +0 -3
- package/convex/adminActivate.js +0 -47
- package/convex/adminStats.d.ts +0 -9
- package/convex/adminStats.js +0 -280
- package/convex/agents.d.ts +0 -84
- package/convex/agents.js +0 -809
- package/convex/analytics.d.ts +0 -5
- package/convex/analytics.js +0 -166
- package/convex/billing.d.ts +0 -88
- package/convex/billing.js +0 -655
- package/convex/capabilities.d.ts +0 -9
- package/convex/capabilities.js +0 -145
- package/convex/chains.d.ts +0 -68
- package/convex/chains.js +0 -1105
- package/convex/credits.d.ts +0 -25
- package/convex/credits.js +0 -186
- package/convex/crons.d.ts +0 -3
- package/convex/crons.js +0 -17
- package/convex/directCall.d.ts +0 -72
- package/convex/directCall.js +0 -627
- package/convex/earnProgress.d.ts +0 -58
- package/convex/earnProgress.js +0 -649
- package/convex/email.d.ts +0 -14
- package/convex/email.js +0 -300
- package/convex/feedback.d.ts +0 -7
- package/convex/feedback.js +0 -227
- package/convex/http.d.ts +0 -3
- package/convex/http.js +0 -1405
- package/convex/inbound.d.ts +0 -2
- package/convex/inbound.js +0 -32
- package/convex/logs.d.ts +0 -48
- package/convex/logs.js +0 -621
- package/convex/migrateFilestack.d.ts +0 -2
- package/convex/migrateFilestack.js +0 -113
- package/convex/migratePratham.d.ts +0 -2
- package/convex/migratePratham.js +0 -121
- package/convex/mou.d.ts +0 -6
- package/convex/mou.js +0 -82
- package/convex/providerKeys.d.ts +0 -31
- package/convex/providerKeys.js +0 -257
- package/convex/providers.d.ts +0 -35
- package/convex/providers.js +0 -922
- package/convex/purchases.d.ts +0 -7
- package/convex/purchases.js +0 -157
- package/convex/ratelimit.d.ts +0 -4
- package/convex/ratelimit.js +0 -91
- package/convex/searchLogs.d.ts +0 -13
- package/convex/searchLogs.js +0 -232
- package/convex/seedAPILayerAPIs.d.ts +0 -7
- package/convex/seedAPILayerAPIs.js +0 -177
- package/convex/seedDirectCallConfigs.d.ts +0 -2
- package/convex/seedDirectCallConfigs.js +0 -324
- package/convex/seedPratham.d.ts +0 -6
- package/convex/seedPratham.js +0 -150
- package/convex/spendAlerts.d.ts +0 -36
- package/convex/spendAlerts.js +0 -380
- package/convex/stripeActions.d.ts +0 -19
- package/convex/stripeActions.js +0 -411
- package/convex/teams.d.ts +0 -21
- package/convex/teams.js +0 -215
- package/convex/telemetry.d.ts +0 -4
- package/convex/telemetry.js +0 -74
- package/convex/updateAPIStatus.d.ts +0 -6
- package/convex/updateAPIStatus.js +0 -40
- package/convex/usage.d.ts +0 -27
- package/convex/usage.js +0 -229
- package/convex/waitlist.d.ts +0 -4
- package/convex/waitlist.js +0 -49
- package/convex/webhooks.d.ts +0 -12
- package/convex/webhooks.js +0 -410
- package/convex/workspaces.d.ts +0 -33
- package/convex/workspaces.js +0 -991
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ The API layer for AI agents. One install. Three tiers of access.
|
|
|
11
11
|
## Install
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
curl -fsSL https://apiclaw.
|
|
14
|
+
curl -fsSL https://apiclaw.cloud/install.sh | bash
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
Restart your AI assistant. First 5 API calls are free. Register your email to unlock 50/month.
|
|
@@ -84,16 +84,16 @@ Premium APIs proxied through APIClaw. No keys needed. APIClaw handles auth, rate
|
|
|
84
84
|
| Unregistered | Free | 5 API calls, unlimited search |
|
|
85
85
|
| Free | Free | 50 calls/month, full dashboard |
|
|
86
86
|
| Founding Backer | $199 one-time | Unlimited until 2027 |
|
|
87
|
-
| Enterprise | Custom | [Book a call](https://apiclaw.
|
|
87
|
+
| Enterprise | Custom | [Book a call](https://apiclaw.cloud/book) |
|
|
88
88
|
|
|
89
89
|
## For API Providers
|
|
90
90
|
|
|
91
91
|
List your APIs on APIClaw. Get discovered by AI agents. Track usage, discoveries, and calls in your dashboard.
|
|
92
92
|
|
|
93
|
-
[Register as provider](https://apiclaw.
|
|
93
|
+
[Register as provider](https://apiclaw.cloud/providers/register)
|
|
94
94
|
|
|
95
95
|
---
|
|
96
96
|
|
|
97
|
-
[Dashboard](https://apiclaw.
|
|
97
|
+
[Dashboard](https://apiclaw.cloud) - [Docs](https://apiclaw.cloud/docs) - [Book a Call](https://apiclaw.cloud/book)
|
|
98
98
|
|
|
99
99
|
MIT License
|
package/apiclaw-README.md
CHANGED
|
@@ -23,7 +23,7 @@ The API layer for AI agents. 18 providers → 1000s of capabilities. Workspace
|
|
|
23
23
|
|
|
24
24
|
## The Platform
|
|
25
25
|
|
|
26
|
-
**[apiclaw.
|
|
26
|
+
**[apiclaw.cloud](https://apiclaw.cloud)** — Your workspace for API-powered agents.
|
|
27
27
|
|
|
28
28
|
| Layer | What You Get |
|
|
29
29
|
|-------|--------------|
|
|
@@ -43,7 +43,7 @@ One `mcp-install` connects your agent to all of it.
|
|
|
43
43
|
|
|
44
44
|
```bash
|
|
45
45
|
# Install
|
|
46
|
-
curl -fsSL https://apiclaw.
|
|
46
|
+
curl -fsSL https://apiclaw.cloud/install.sh | bash
|
|
47
47
|
|
|
48
48
|
# Restart your AI assistant
|
|
49
49
|
# Immediately use any API (10 calls/week)
|
|
@@ -194,7 +194,7 @@ Public APIs, instantly callable. No API keys needed.
|
|
|
194
194
|
- Food & Recipes
|
|
195
195
|
- Science & Education
|
|
196
196
|
|
|
197
|
-
Browse at [apiclaw.
|
|
197
|
+
Browse at [apiclaw.cloud/open-apis](https://apiclaw.cloud/open-apis)
|
|
198
198
|
|
|
199
199
|
---
|
|
200
200
|
|
|
@@ -209,7 +209,7 @@ Use `discover_apis` to search:
|
|
|
209
209
|
"What APIs exist for recipe data?"
|
|
210
210
|
```
|
|
211
211
|
|
|
212
|
-
Browse at [apiclaw.
|
|
212
|
+
Browse at [apiclaw.cloud/discover](https://apiclaw.cloud/discover)
|
|
213
213
|
|
|
214
214
|
---
|
|
215
215
|
|
|
@@ -218,7 +218,7 @@ Browse at [apiclaw.nordsym.com/discover](https://apiclaw.nordsym.com/discover)
|
|
|
218
218
|
### One-Line Install (Recommended)
|
|
219
219
|
|
|
220
220
|
```bash
|
|
221
|
-
curl -fsSL https://apiclaw.
|
|
221
|
+
curl -fsSL https://apiclaw.cloud/install.sh | bash
|
|
222
222
|
```
|
|
223
223
|
|
|
224
224
|
Auto-detects Claude Desktop or Claude Code. Configures MCP. Done.
|
|
@@ -404,7 +404,7 @@ You don't manage API keys. You don't configure auth. You don't worry about rate
|
|
|
404
404
|
- Usage analytics in your workspace
|
|
405
405
|
- Production-ready from day one
|
|
406
406
|
|
|
407
|
-
**Want higher limits?** See [Pricing](#pricing) below or upgrade at [apiclaw.
|
|
407
|
+
**Want higher limits?** See [Pricing](#pricing) below or upgrade at [apiclaw.cloud](https://apiclaw.cloud).
|
|
408
408
|
|
|
409
409
|
---
|
|
410
410
|
|
|
@@ -456,7 +456,7 @@ APIClaw is purpose-built for AI agents and MCP clients. No glue code, no key jug
|
|
|
456
456
|
| **Scale** | $249/mo | 25,000 | Production agents |
|
|
457
457
|
| **Enterprise** | Custom | Unlimited | Large teams & custom SLAs |
|
|
458
458
|
|
|
459
|
-
→ [Upgrade at apiclaw.
|
|
459
|
+
→ [Upgrade at apiclaw.cloud](https://apiclaw.cloud) · Enterprise: [book a call](https://apiclaw.cloud/contact)
|
|
460
460
|
|
|
461
461
|
---
|
|
462
462
|
|
|
@@ -464,9 +464,9 @@ APIClaw is purpose-built for AI agents and MCP clients. No glue code, no key jug
|
|
|
464
464
|
|
|
465
465
|
APIClaw is optimized for discovery by AI agents and LLM tooling:
|
|
466
466
|
|
|
467
|
-
- **llms.txt:** [apiclaw.
|
|
468
|
-
- **llms-full.txt:** [apiclaw.
|
|
469
|
-
- **ai-plugin.json:** [apiclaw.
|
|
467
|
+
- **llms.txt:** [apiclaw.cloud/llms.txt](https://apiclaw.cloud/llms.txt) — Machine-readable API index
|
|
468
|
+
- **llms-full.txt:** [apiclaw.cloud/llms-full.txt](https://apiclaw.cloud/llms-full.txt) — Full capability descriptions
|
|
469
|
+
- **ai-plugin.json:** [apiclaw.cloud/.well-known/ai-plugin.json](https://apiclaw.cloud/.well-known/ai-plugin.json) — OpenAI plugin manifest
|
|
470
470
|
- **MCP:** Install with one command and any MCP-compatible agent can use APIClaw immediately
|
|
471
471
|
|
|
472
472
|
---
|
|
@@ -480,8 +480,8 @@ APIClaw is optimized for discovery by AI agents and LLM tooling:
|
|
|
480
480
|
|
|
481
481
|
## Links
|
|
482
482
|
|
|
483
|
-
- **Platform:** [apiclaw.
|
|
484
|
-
- **Docs:** [apiclaw.
|
|
483
|
+
- **Platform:** [apiclaw.cloud](https://apiclaw.cloud)
|
|
484
|
+
- **Docs:** [apiclaw.cloud/docs](https://apiclaw.cloud/docs)
|
|
485
485
|
- **GitHub:** [github.com/nordsym/apiclaw](https://github.com/nordsym/apiclaw)
|
|
486
486
|
- **npm:** [@nordsym/apiclaw](https://www.npmjs.com/package/@nordsym/apiclaw)
|
|
487
487
|
- **Security:** [SECURITY.md](SECURITY.md)
|
|
@@ -12,11 +12,16 @@ import type * as adminActivate from "../adminActivate.js";
|
|
|
12
12
|
import type * as adminStats from "../adminStats.js";
|
|
13
13
|
import type * as agents from "../agents.js";
|
|
14
14
|
import type * as analytics from "../analytics.js";
|
|
15
|
+
import type * as apiKeys from "../apiKeys.js";
|
|
16
|
+
import type * as backfillAnalytics from "../backfillAnalytics.js";
|
|
17
|
+
import type * as backfillSearchLogs from "../backfillSearchLogs.js";
|
|
15
18
|
import type * as billing from "../billing.js";
|
|
16
19
|
import type * as capabilities from "../capabilities.js";
|
|
17
20
|
import type * as chains from "../chains.js";
|
|
18
21
|
import type * as credits from "../credits.js";
|
|
19
22
|
import type * as crons from "../crons.js";
|
|
23
|
+
import type * as debugFilestackLogs from "../debugFilestackLogs.js";
|
|
24
|
+
import type * as debugGetToken from "../debugGetToken.js";
|
|
20
25
|
import type * as directCall from "../directCall.js";
|
|
21
26
|
import type * as earnProgress from "../earnProgress.js";
|
|
22
27
|
import type * as email from "../email.js";
|
|
@@ -25,7 +30,9 @@ import type * as http from "../http.js";
|
|
|
25
30
|
import type * as inbound from "../inbound.js";
|
|
26
31
|
import type * as logs from "../logs.js";
|
|
27
32
|
import type * as migrateFilestack from "../migrateFilestack.js";
|
|
33
|
+
import type * as migratePartnersProd from "../migratePartnersProd.js";
|
|
28
34
|
import type * as migratePratham from "../migratePratham.js";
|
|
35
|
+
import type * as migrateProviderWorkspaces from "../migrateProviderWorkspaces.js";
|
|
29
36
|
import type * as mou from "../mou.js";
|
|
30
37
|
import type * as providerKeys from "../providerKeys.js";
|
|
31
38
|
import type * as providers from "../providers.js";
|
|
@@ -43,6 +50,7 @@ import type * as updateAPIStatus from "../updateAPIStatus.js";
|
|
|
43
50
|
import type * as usage from "../usage.js";
|
|
44
51
|
import type * as waitlist from "../waitlist.js";
|
|
45
52
|
import type * as webhooks from "../webhooks.js";
|
|
53
|
+
import type * as workspaceSettings from "../workspaceSettings.js";
|
|
46
54
|
import type * as workspaces from "../workspaces.js";
|
|
47
55
|
|
|
48
56
|
import type {
|
|
@@ -56,11 +64,16 @@ declare const fullApi: ApiFromModules<{
|
|
|
56
64
|
adminStats: typeof adminStats;
|
|
57
65
|
agents: typeof agents;
|
|
58
66
|
analytics: typeof analytics;
|
|
67
|
+
apiKeys: typeof apiKeys;
|
|
68
|
+
backfillAnalytics: typeof backfillAnalytics;
|
|
69
|
+
backfillSearchLogs: typeof backfillSearchLogs;
|
|
59
70
|
billing: typeof billing;
|
|
60
71
|
capabilities: typeof capabilities;
|
|
61
72
|
chains: typeof chains;
|
|
62
73
|
credits: typeof credits;
|
|
63
74
|
crons: typeof crons;
|
|
75
|
+
debugFilestackLogs: typeof debugFilestackLogs;
|
|
76
|
+
debugGetToken: typeof debugGetToken;
|
|
64
77
|
directCall: typeof directCall;
|
|
65
78
|
earnProgress: typeof earnProgress;
|
|
66
79
|
email: typeof email;
|
|
@@ -69,7 +82,9 @@ declare const fullApi: ApiFromModules<{
|
|
|
69
82
|
inbound: typeof inbound;
|
|
70
83
|
logs: typeof logs;
|
|
71
84
|
migrateFilestack: typeof migrateFilestack;
|
|
85
|
+
migratePartnersProd: typeof migratePartnersProd;
|
|
72
86
|
migratePratham: typeof migratePratham;
|
|
87
|
+
migrateProviderWorkspaces: typeof migrateProviderWorkspaces;
|
|
73
88
|
mou: typeof mou;
|
|
74
89
|
providerKeys: typeof providerKeys;
|
|
75
90
|
providers: typeof providers;
|
|
@@ -87,6 +102,7 @@ declare const fullApi: ApiFromModules<{
|
|
|
87
102
|
usage: typeof usage;
|
|
88
103
|
waitlist: typeof waitlist;
|
|
89
104
|
webhooks: typeof webhooks;
|
|
105
|
+
workspaceSettings: typeof workspaceSettings;
|
|
90
106
|
workspaces: typeof workspaces;
|
|
91
107
|
}>;
|
|
92
108
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["analytics.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["analytics.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,GAAG,KAed,CAAC;AAGH,eAAO,MAAM,QAAQ,KAoDnB,CAAC;AAGH,eAAO,MAAM,SAAS,KAapB,CAAC;AAGH,eAAO,MAAM,oBAAoB,KA6F/B,CAAC"}
|
package/convex/analytics.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["analytics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElC,yBAAyB;AACzB,MAAM,CAAC,MAAM,GAAG,GAAG,QAAQ,CAAC;IAC1B,IAAI,EAAE;QACJ,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;QACjB,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QAChC,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QAC7B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;KAC9B;IACD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC3B,OAAO,MAAM,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE;YACtC,GAAG,IAAI;YACP,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;SACtB,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,0BAA0B;AAC1B,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAAC;IAC5B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-0,0 +1,220 @@
|
|
|
1
|
+
import { v } from "convex/values";
|
|
2
|
+
import { mutation, query, internalQuery } from "./_generated/server";
|
|
3
|
+
|
|
4
|
+
// ============================================
|
|
5
|
+
// WORKSPACE API KEYS
|
|
6
|
+
// Generate persistent API keys for programmatic access.
|
|
7
|
+
// Users generate keys in the dashboard, then use them
|
|
8
|
+
// in any agent config, automation, or script.
|
|
9
|
+
// ============================================
|
|
10
|
+
|
|
11
|
+
function generateRawKey(): string {
|
|
12
|
+
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
13
|
+
let result = "";
|
|
14
|
+
for (let i = 0; i < 48; i++) {
|
|
15
|
+
result += chars.charAt(Math.floor(Math.random() * chars.length));
|
|
16
|
+
}
|
|
17
|
+
return `sk-claw-${result}`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Simple hash for key lookup (SHA-256 not available in Convex runtime, use deterministic hash)
|
|
21
|
+
function hashKey(key: string): string {
|
|
22
|
+
let hash = 0;
|
|
23
|
+
for (let i = 0; i < key.length; i++) {
|
|
24
|
+
const char = key.charCodeAt(i);
|
|
25
|
+
hash = ((hash << 5) - hash + char) | 0;
|
|
26
|
+
}
|
|
27
|
+
// Create a longer hash by running multiple rounds with offsets
|
|
28
|
+
let h1 = hash;
|
|
29
|
+
let h2 = 0;
|
|
30
|
+
for (let i = 0; i < key.length; i++) {
|
|
31
|
+
h2 = ((h2 << 7) - h2 + key.charCodeAt(i) * 31) | 0;
|
|
32
|
+
}
|
|
33
|
+
let h3 = 0;
|
|
34
|
+
for (let i = 0; i < key.length; i++) {
|
|
35
|
+
h3 = ((h3 << 11) - h3 + key.charCodeAt(i) * 127) | 0;
|
|
36
|
+
}
|
|
37
|
+
return `${(h1 >>> 0).toString(36)}-${(h2 >>> 0).toString(36)}-${(h3 >>> 0).toString(36)}`;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function getKeyPrefix(key: string): string {
|
|
41
|
+
return `sk-claw-...${key.slice(-4)}`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// ============================================
|
|
45
|
+
// GENERATE KEY
|
|
46
|
+
// ============================================
|
|
47
|
+
|
|
48
|
+
export const generateKey = mutation({
|
|
49
|
+
args: {
|
|
50
|
+
token: v.string(), // session token for auth
|
|
51
|
+
name: v.string(), // user label
|
|
52
|
+
},
|
|
53
|
+
handler: async (ctx, args) => {
|
|
54
|
+
// Auth via agentSession
|
|
55
|
+
const session = await ctx.db
|
|
56
|
+
.query("agentSessions")
|
|
57
|
+
.withIndex("by_sessionToken", (q) => q.eq("sessionToken", args.token))
|
|
58
|
+
.first();
|
|
59
|
+
|
|
60
|
+
if (!session) {
|
|
61
|
+
throw new Error("Invalid session");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const workspaceId = session.workspaceId;
|
|
65
|
+
|
|
66
|
+
// Limit: max 5 active keys per workspace
|
|
67
|
+
const existingKeys = await ctx.db
|
|
68
|
+
.query("workspaceApiKeys")
|
|
69
|
+
.withIndex("by_workspaceId", (q) => q.eq("workspaceId", workspaceId))
|
|
70
|
+
.collect();
|
|
71
|
+
|
|
72
|
+
const activeKeys = existingKeys.filter((k) => !k.revokedAt);
|
|
73
|
+
if (activeKeys.length >= 5) {
|
|
74
|
+
throw new Error("Maximum 5 active keys per workspace. Revoke an existing key first.");
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Check for duplicate name
|
|
78
|
+
const nameExists = activeKeys.some(
|
|
79
|
+
(k) => k.name.toLowerCase() === args.name.toLowerCase()
|
|
80
|
+
);
|
|
81
|
+
if (nameExists) {
|
|
82
|
+
throw new Error(`A key named "${args.name}" already exists.`);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const rawKey = generateRawKey();
|
|
86
|
+
const now = Date.now();
|
|
87
|
+
|
|
88
|
+
await ctx.db.insert("workspaceApiKeys", {
|
|
89
|
+
workspaceId,
|
|
90
|
+
key: "", // We don't store the raw key
|
|
91
|
+
keyHash: hashKey(rawKey),
|
|
92
|
+
keyPrefix: getKeyPrefix(rawKey),
|
|
93
|
+
name: args.name,
|
|
94
|
+
createdAt: now,
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// Return the raw key ONCE - it won't be retrievable again
|
|
98
|
+
return {
|
|
99
|
+
key: rawKey,
|
|
100
|
+
keyPrefix: getKeyPrefix(rawKey),
|
|
101
|
+
name: args.name,
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
// ============================================
|
|
107
|
+
// LIST KEYS
|
|
108
|
+
// ============================================
|
|
109
|
+
|
|
110
|
+
export const listKeys = query({
|
|
111
|
+
args: {
|
|
112
|
+
token: v.string(),
|
|
113
|
+
},
|
|
114
|
+
handler: async (ctx, args) => {
|
|
115
|
+
const session = await ctx.db
|
|
116
|
+
.query("agentSessions")
|
|
117
|
+
.withIndex("by_sessionToken", (q) => q.eq("sessionToken", args.token))
|
|
118
|
+
.first();
|
|
119
|
+
|
|
120
|
+
if (!session) {
|
|
121
|
+
return { keys: [] };
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const keys = await ctx.db
|
|
125
|
+
.query("workspaceApiKeys")
|
|
126
|
+
.withIndex("by_workspaceId", (q) => q.eq("workspaceId", session.workspaceId))
|
|
127
|
+
.collect();
|
|
128
|
+
|
|
129
|
+
return {
|
|
130
|
+
keys: keys
|
|
131
|
+
.filter((k) => !k.revokedAt)
|
|
132
|
+
.map((k) => ({
|
|
133
|
+
id: k._id,
|
|
134
|
+
name: k.name,
|
|
135
|
+
keyPrefix: k.keyPrefix,
|
|
136
|
+
lastUsedAt: k.lastUsedAt,
|
|
137
|
+
createdAt: k.createdAt,
|
|
138
|
+
}))
|
|
139
|
+
.sort((a, b) => b.createdAt - a.createdAt),
|
|
140
|
+
};
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
// ============================================
|
|
145
|
+
// REVOKE KEY
|
|
146
|
+
// ============================================
|
|
147
|
+
|
|
148
|
+
export const revokeKey = mutation({
|
|
149
|
+
args: {
|
|
150
|
+
token: v.string(),
|
|
151
|
+
keyId: v.id("workspaceApiKeys"),
|
|
152
|
+
},
|
|
153
|
+
handler: async (ctx, args) => {
|
|
154
|
+
const session = await ctx.db
|
|
155
|
+
.query("agentSessions")
|
|
156
|
+
.withIndex("by_sessionToken", (q) => q.eq("sessionToken", args.token))
|
|
157
|
+
.first();
|
|
158
|
+
|
|
159
|
+
if (!session) {
|
|
160
|
+
throw new Error("Invalid session");
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const key = await ctx.db.get(args.keyId);
|
|
164
|
+
if (!key || key.workspaceId !== session.workspaceId) {
|
|
165
|
+
throw new Error("Key not found");
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (key.revokedAt) {
|
|
169
|
+
throw new Error("Key already revoked");
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
await ctx.db.patch(args.keyId, { revokedAt: Date.now() });
|
|
173
|
+
return { success: true };
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
// ============================================
|
|
178
|
+
// RESOLVE KEY (internal - used by gateway)
|
|
179
|
+
// ============================================
|
|
180
|
+
|
|
181
|
+
export const resolveKey = internalQuery({
|
|
182
|
+
args: {
|
|
183
|
+
rawKey: v.string(),
|
|
184
|
+
},
|
|
185
|
+
handler: async (ctx, args) => {
|
|
186
|
+
const keyHash = hashKey(args.rawKey);
|
|
187
|
+
|
|
188
|
+
const keyDoc = await ctx.db
|
|
189
|
+
.query("workspaceApiKeys")
|
|
190
|
+
.withIndex("by_keyHash", (q) => q.eq("keyHash", keyHash))
|
|
191
|
+
.first();
|
|
192
|
+
|
|
193
|
+
if (!keyDoc) {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (keyDoc.revokedAt) {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return {
|
|
202
|
+
workspaceId: keyDoc.workspaceId,
|
|
203
|
+
keyId: keyDoc._id,
|
|
204
|
+
name: keyDoc.name,
|
|
205
|
+
};
|
|
206
|
+
},
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
// ============================================
|
|
210
|
+
// TOUCH KEY (internal - update lastUsedAt)
|
|
211
|
+
// ============================================
|
|
212
|
+
|
|
213
|
+
export const touchKey = mutation({
|
|
214
|
+
args: {
|
|
215
|
+
keyId: v.id("workspaceApiKeys"),
|
|
216
|
+
},
|
|
217
|
+
handler: async (ctx, args) => {
|
|
218
|
+
await ctx.db.patch(args.keyId, { lastUsedAt: Date.now() });
|
|
219
|
+
},
|
|
220
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backfillAnalytics.d.ts","sourceRoot":"","sources":["backfillAnalytics.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,KAmBd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backfillAnalytics.js","sourceRoot":"","sources":["backfillAnalytics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,MAAM,CAAC,MAAM,GAAG,GAAG,QAAQ,CAAC;IAC1B,IAAI,EAAE,EAAE;IACR,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;QACrB,MAAM,qBAAqB,GAAG,kCAAkC,CAAC;QAEjE,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,EAAE;aACxB,KAAK,CAAC,WAAW,CAAC;aAClB,SAAS,CAAC,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;aAC7D,OAAO,EAAE,CAAC;QAEb,IAAI,OAAO,GAAG,CAAC,CAAC;QAChB,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;YACvB,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;gBACnB,MAAM,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,qBAA4B,EAAE,CAAC,CAAC;gBACzE,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,CAAC;IACrB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { mutation } from "./_generated/server";
|
|
2
|
+
|
|
3
|
+
export const run = mutation({
|
|
4
|
+
args: {},
|
|
5
|
+
handler: async (ctx) => {
|
|
6
|
+
const APILAYER_WORKSPACE_ID = "n17bf4raa01r0d4na0bsgg117x83y551";
|
|
7
|
+
|
|
8
|
+
const events = await ctx.db
|
|
9
|
+
.query("analytics")
|
|
10
|
+
.withIndex("by_provider", (q) => q.eq("provider", "apilayer"))
|
|
11
|
+
.collect();
|
|
12
|
+
|
|
13
|
+
let patched = 0;
|
|
14
|
+
for (const e of events) {
|
|
15
|
+
if (!e.workspaceId) {
|
|
16
|
+
await ctx.db.patch(e._id, { workspaceId: APILAYER_WORKSPACE_ID as any });
|
|
17
|
+
patched++;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return { patched };
|
|
21
|
+
},
|
|
22
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backfillSearchLogs.d.ts","sourceRoot":"","sources":["backfillSearchLogs.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,GAAG,KA+Bd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backfillSearchLogs.js","sourceRoot":"","sources":["backfillSearchLogs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,+EAA+E;AAC/E,MAAM,CAAC,MAAM,GAAG,GAAG,QAAQ,CAAC;IAC1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chLogs from apiLogs that have action starting with "discovery:"
|
|
4
|
+
export const run = mutation({
|
|
5
|
+
args: {},
|
|
6
|
+
handler: async (ctx) => {
|
|
7
|
+
const APILAYER_WORKSPACE_ID = "n17bf4raa01r0d4na0bsgg117x83y551";
|
|
8
|
+
|
|
9
|
+
const apiLogs = await ctx.db
|
|
10
|
+
.query("apiLogs")
|
|
11
|
+
.withIndex("by_workspaceId_createdAt", (q: any) => q.eq("workspaceId", APILAYER_WORKSPACE_ID))
|
|
12
|
+
.collect();
|
|
13
|
+
|
|
14
|
+
const discoveryLogs = apiLogs.filter((l: any) =>
|
|
15
|
+
typeof l.action === "string" && l.action.startsWith("discovery:")
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
let inserted = 0;
|
|
19
|
+
for (const log of discoveryLogs) {
|
|
20
|
+
const query = (log.action as string).replace("discovery:", "").trim();
|
|
21
|
+
await ctx.db.insert("searchLogs", {
|
|
22
|
+
workspaceId: APILAYER_WORKSPACE_ID as any,
|
|
23
|
+
query,
|
|
24
|
+
resultCount: 1,
|
|
25
|
+
hasResults: true,
|
|
26
|
+
matchedProviders: ["apilayer"],
|
|
27
|
+
responseTimeMs: log.latencyMs || 20,
|
|
28
|
+
timestamp: log.createdAt,
|
|
29
|
+
});
|
|
30
|
+
inserted++;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return { inserted, total: discoveryLogs.length };
|
|
34
|
+
},
|
|
35
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugFilestackLogs.d.ts","sourceRoot":"","sources":["debugFilestackLogs.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,GAAG,KAcd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugFilestackLogs.js","sourceRoot":"","sources":["debugFilestackLogs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,CAAC;IACvB,IAAI,EAAE,EAAE;IACR,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,EAAE;aACtB,KAAK,CAAC,SAAS,CAAC;aAChB,SAAS,CAAC,0BAA0B,EAAE,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,EAAE,kCAAkC,CAAC,CAAC;aAC1G,OAAO,EAAE,CAAC;QACb,MAAM,QAAQ,GAA2B,EAAE,CAAC;QAC5C,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;YACrB,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC;YACvF,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC;IACnI,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { query } from "./_generated/server";
|
|
2
|
+
export const run = query({
|
|
3
|
+
args: {},
|
|
4
|
+
handler: async (ctx) => {
|
|
5
|
+
const logs = await ctx.db
|
|
6
|
+
.query("apiLogs")
|
|
7
|
+
.withIndex("by_workspaceId_createdAt", (q: any) => q.eq("workspaceId", "n175gprvbbvygmhtg8cfk8jzbd83m0p8"))
|
|
8
|
+
.collect();
|
|
9
|
+
const byAction: Record<string, number> = {};
|
|
10
|
+
for (const l of logs) {
|
|
11
|
+
const k = (l.action || "?").startsWith("discovery:") ? "discovery" : (l.action || "?");
|
|
12
|
+
byAction[k] = (byAction[k] || 0) + 1;
|
|
13
|
+
}
|
|
14
|
+
return { total: logs.length, byAction, sample: logs.slice(0,3).map((l: any) => ({ action: l.action, createdAt: l.createdAt })) };
|
|
15
|
+
},
|
|
16
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugGetToken.d.ts","sourceRoot":"","sources":["debugGetToken.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,KAc1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugGetToken.js","sourceRoot":"","sources":["debugGetToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElC,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;IACnC,IAAI,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE;IACzC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE;QACtC,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,EAAE;aAC1B,KAAK,CAAC,eAAe,CAAC;aACtB,SAAS,CAAC,gBAAgB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;aACpE,OAAO,EAAE,CAAC;QACb,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACxB,EAAE,EAAE,CAAC,CAAC,GAAG;YACT,YAAY,EAAE,CAAC,CAAC,YAAY;YAC5B,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,SAAS,EAAE,CAAC,CAAC,SAAS;SACvB,CAAC,CAAC,CAAC;IACN,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { query } from "./_generated/server";
|
|
2
|
+
import { v } from "convex/values";
|
|
3
|
+
|
|
4
|
+
export const getForWorkspace = query({
|
|
5
|
+
args: { workspaceId: v.id("workspaces") },
|
|
6
|
+
handler: async (ctx, { workspaceId }) => {
|
|
7
|
+
const sessions = await ctx.db
|
|
8
|
+
.query("agentSessions")
|
|
9
|
+
.withIndex("by_workspaceId", (q) => q.eq("workspaceId", workspaceId))
|
|
10
|
+
.collect();
|
|
11
|
+
return sessions.map(s => ({
|
|
12
|
+
id: s._id,
|
|
13
|
+
sessionToken: s.sessionToken,
|
|
14
|
+
fingerprint: s.fingerprint,
|
|
15
|
+
createdAt: s.createdAt,
|
|
16
|
+
}));
|
|
17
|
+
},
|
|
18
|
+
});
|