@nordsym/apiclaw 1.2.2 → 1.2.3
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/AGENTS.md +50 -33
- package/README.md +22 -12
- package/SOUL.md +60 -19
- package/STATUS.md +91 -169
- package/convex/_generated/api.d.ts +6 -0
- package/convex/directCall.ts +598 -0
- package/convex/providers.ts +341 -26
- package/convex/schema.ts +87 -0
- package/convex/usage.ts +260 -0
- package/convex/waitlist.ts +55 -0
- package/data/combined-02-26.json +22102 -0
- package/data/night-expansion-02-26-06-batch2.json +1898 -0
- package/data/night-expansion-02-26-06-batch3.json +1410 -0
- package/data/night-expansion-02-26-06.json +3146 -0
- package/data/night-expansion-02-26-full.json +9726 -0
- package/data/night-expansion-02-26-v2.json +330 -0
- package/data/night-expansion-02-26.json +171 -0
- package/dist/crypto.d.ts +7 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/crypto.js +67 -0
- package/dist/crypto.js.map +1 -0
- package/dist/execute-dynamic.d.ts +116 -0
- package/dist/execute-dynamic.d.ts.map +1 -0
- package/dist/execute-dynamic.js +456 -0
- package/dist/execute-dynamic.js.map +1 -0
- package/dist/execute.d.ts +2 -1
- package/dist/execute.d.ts.map +1 -1
- package/dist/execute.js +35 -5
- package/dist/execute.js.map +1 -1
- package/dist/index.js +33 -4
- package/dist/index.js.map +1 -1
- package/dist/registry/apis.json +2081 -3
- package/docs/PRD-customer-key-passthrough.md +184 -0
- package/landing/public/badges/available-on-apiclaw.svg +14 -0
- package/landing/scripts/generate-stats.js +75 -4
- package/landing/src/app/admin/page.tsx +1 -1
- package/landing/src/app/api/auth/magic-link/route.ts +1 -1
- package/landing/src/app/api/auth/session/route.ts +1 -1
- package/landing/src/app/api/auth/verify/route.ts +1 -1
- package/landing/src/app/api/og/route.tsx +5 -3
- package/landing/src/app/docs/page.tsx +5 -4
- package/landing/src/app/earn/page.tsx +14 -11
- package/landing/src/app/globals.css +16 -15
- package/landing/src/app/layout.tsx +2 -2
- package/landing/src/app/page.tsx +425 -254
- package/landing/src/app/providers/dashboard/[apiId]/actions/[actionId]/edit/page.tsx +600 -0
- package/landing/src/app/providers/dashboard/[apiId]/actions/new/page.tsx +583 -0
- package/landing/src/app/providers/dashboard/[apiId]/actions/page.tsx +301 -0
- package/landing/src/app/providers/dashboard/[apiId]/direct-call/page.tsx +659 -0
- package/landing/src/app/providers/dashboard/[apiId]/page.tsx +381 -0
- package/landing/src/app/providers/dashboard/[apiId]/test/page.tsx +418 -0
- package/landing/src/app/providers/dashboard/layout.tsx +292 -0
- package/landing/src/app/providers/dashboard/page.tsx +353 -290
- package/landing/src/app/providers/register/page.tsx +87 -10
- package/landing/src/components/AiClientDropdown.tsx +85 -0
- package/landing/src/components/ConfigHelperModal.tsx +113 -0
- package/landing/src/components/HeroTabs.tsx +187 -0
- package/landing/src/components/ShareIntegrationModal.tsx +198 -0
- package/landing/src/hooks/useDashboardData.ts +53 -1
- package/landing/src/lib/apis.json +46554 -174
- package/landing/src/lib/convex-client.ts +22 -3
- package/landing/src/lib/stats.json +4 -4
- package/landing/tsconfig.tsbuildinfo +1 -1
- package/night-expansion-02-26-06-batch2.py +368 -0
- package/night-expansion-02-26-06-batch3.py +299 -0
- package/night-expansion-02-26-06.py +756 -0
- package/package.json +1 -1
- package/scripts/bulk-add-public-apis-v2.py +418 -0
- package/scripts/night-expansion-02-26-v2.py +296 -0
- package/scripts/night-expansion-02-26.py +890 -0
- package/scripts/seed-complete-api.js +181 -0
- package/scripts/seed-demo-api.sh +44 -0
- package/src/crypto.ts +75 -0
- package/src/execute-dynamic.ts +589 -0
- package/src/execute.ts +41 -5
- package/src/index.ts +38 -4
- package/src/registry/apis.json +2081 -3
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { X, Twitter, Linkedin, Copy, Check, ExternalLink } from "lucide-react";
|
|
5
|
+
|
|
6
|
+
interface ShareIntegrationModalProps {
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
providerName: string;
|
|
10
|
+
apiName: string;
|
|
11
|
+
apiSlug: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function ShareIntegrationModal({
|
|
16
|
+
isOpen,
|
|
17
|
+
onClose,
|
|
18
|
+
providerName,
|
|
19
|
+
apiName,
|
|
20
|
+
apiSlug,
|
|
21
|
+
description,
|
|
22
|
+
}: ShareIntegrationModalProps) {
|
|
23
|
+
const [copiedBadge, setCopiedBadge] = useState(false);
|
|
24
|
+
const [copiedLink, setCopiedLink] = useState(false);
|
|
25
|
+
|
|
26
|
+
if (!isOpen) return null;
|
|
27
|
+
|
|
28
|
+
const providerUrl = `https://apiclaw.com/providers/${apiSlug}`;
|
|
29
|
+
|
|
30
|
+
const twitterText = `🦞 ${apiName} is now on @APIClaw!
|
|
31
|
+
|
|
32
|
+
AI agents can integrate our API in seconds.
|
|
33
|
+
|
|
34
|
+
${description || "Check it out:"}
|
|
35
|
+
|
|
36
|
+
${providerUrl}
|
|
37
|
+
|
|
38
|
+
#AI #API #AIAgents`;
|
|
39
|
+
|
|
40
|
+
const linkedinText = `Excited to announce that ${providerName} is now available on APIClaw — the API layer for autonomous AI agents.
|
|
41
|
+
|
|
42
|
+
This means AI agents can now integrate ${apiName} directly into their workflows.
|
|
43
|
+
|
|
44
|
+
We're proud to be among the first providers on this platform. The future of API consumption is autonomous.
|
|
45
|
+
|
|
46
|
+
🦞 ${providerUrl}`;
|
|
47
|
+
|
|
48
|
+
const badgeCode = `<a href="${providerUrl}" target="_blank" rel="noopener">
|
|
49
|
+
<img src="https://apiclaw.com/badges/available-on-apiclaw.svg"
|
|
50
|
+
alt="Available on APIClaw"
|
|
51
|
+
width="220" height="44" />
|
|
52
|
+
</a>`;
|
|
53
|
+
|
|
54
|
+
const handleTwitterShare = () => {
|
|
55
|
+
const url = `https://twitter.com/intent/tweet?text=${encodeURIComponent(twitterText)}`;
|
|
56
|
+
window.open(url, "_blank", "width=550,height=420");
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const handleLinkedInShare = () => {
|
|
60
|
+
const url = `https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(providerUrl)}`;
|
|
61
|
+
window.open(url, "_blank", "width=550,height=420");
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const handleCopyBadge = async () => {
|
|
65
|
+
await navigator.clipboard.writeText(badgeCode);
|
|
66
|
+
setCopiedBadge(true);
|
|
67
|
+
setTimeout(() => setCopiedBadge(false), 2000);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const handleCopyLink = async () => {
|
|
71
|
+
await navigator.clipboard.writeText(providerUrl);
|
|
72
|
+
setCopiedLink(true);
|
|
73
|
+
setTimeout(() => setCopiedLink(false), 2000);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<div className="fixed inset-0 z-50 flex items-center justify-center">
|
|
78
|
+
{/* Backdrop */}
|
|
79
|
+
<div
|
|
80
|
+
className="absolute inset-0 bg-black/70 backdrop-blur-sm"
|
|
81
|
+
onClick={onClose}
|
|
82
|
+
/>
|
|
83
|
+
|
|
84
|
+
{/* Modal */}
|
|
85
|
+
<div className="relative bg-surface-elevated border border-border rounded-2xl p-8 max-w-lg w-full mx-4 shadow-2xl">
|
|
86
|
+
{/* Close button */}
|
|
87
|
+
<button
|
|
88
|
+
onClick={onClose}
|
|
89
|
+
className="absolute top-4 right-4 p-2 text-text-muted hover:text-text rounded-lg hover:bg-surface transition-colors"
|
|
90
|
+
>
|
|
91
|
+
<X className="w-5 h-5" />
|
|
92
|
+
</button>
|
|
93
|
+
|
|
94
|
+
{/* Header */}
|
|
95
|
+
<div className="text-center mb-8">
|
|
96
|
+
<div className="text-5xl mb-4">🎉</div>
|
|
97
|
+
<h2 className="text-2xl font-bold mb-2">You're Live on APIClaw!</h2>
|
|
98
|
+
<p className="text-text-muted">
|
|
99
|
+
AI agents can now discover and use {apiName}.
|
|
100
|
+
</p>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
{/* Share section */}
|
|
104
|
+
<div className="space-y-6">
|
|
105
|
+
<div>
|
|
106
|
+
<h3 className="font-semibold mb-3">Share the news</h3>
|
|
107
|
+
<div className="flex gap-3">
|
|
108
|
+
<button
|
|
109
|
+
onClick={handleTwitterShare}
|
|
110
|
+
className="flex-1 flex items-center justify-center gap-2 px-4 py-3 bg-[#1DA1F2] hover:bg-[#1a8cd8] text-white rounded-xl transition-colors font-medium"
|
|
111
|
+
>
|
|
112
|
+
<Twitter className="w-5 h-5" />
|
|
113
|
+
Twitter
|
|
114
|
+
</button>
|
|
115
|
+
<button
|
|
116
|
+
onClick={handleLinkedInShare}
|
|
117
|
+
className="flex-1 flex items-center justify-center gap-2 px-4 py-3 bg-[#0A66C2] hover:bg-[#094d92] text-white rounded-xl transition-colors font-medium"
|
|
118
|
+
>
|
|
119
|
+
<Linkedin className="w-5 h-5" />
|
|
120
|
+
LinkedIn
|
|
121
|
+
</button>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
{/* Badge section */}
|
|
126
|
+
<div>
|
|
127
|
+
<h3 className="font-semibold mb-3">Add badge to your site</h3>
|
|
128
|
+
<div className="bg-surface rounded-xl p-4 border border-border">
|
|
129
|
+
{/* Badge preview */}
|
|
130
|
+
<div className="flex justify-center mb-4 p-4 bg-white/5 rounded-lg">
|
|
131
|
+
<img
|
|
132
|
+
src="/badges/available-on-apiclaw.svg"
|
|
133
|
+
alt="Available on APIClaw badge"
|
|
134
|
+
width={220}
|
|
135
|
+
height={44}
|
|
136
|
+
/>
|
|
137
|
+
</div>
|
|
138
|
+
{/* Code */}
|
|
139
|
+
<div className="relative">
|
|
140
|
+
<pre className="text-xs text-text-muted bg-black/30 rounded-lg p-3 overflow-x-auto">
|
|
141
|
+
{badgeCode}
|
|
142
|
+
</pre>
|
|
143
|
+
<button
|
|
144
|
+
onClick={handleCopyBadge}
|
|
145
|
+
className="absolute top-2 right-2 p-2 bg-surface-elevated hover:bg-surface rounded-lg transition-colors"
|
|
146
|
+
>
|
|
147
|
+
{copiedBadge ? (
|
|
148
|
+
<Check className="w-4 h-4 text-green-500" />
|
|
149
|
+
) : (
|
|
150
|
+
<Copy className="w-4 h-4 text-text-muted" />
|
|
151
|
+
)}
|
|
152
|
+
</button>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
{/* Direct link */}
|
|
158
|
+
<div>
|
|
159
|
+
<h3 className="font-semibold mb-3">Your provider page</h3>
|
|
160
|
+
<div className="flex gap-2">
|
|
161
|
+
<div className="flex-1 px-4 py-3 bg-surface rounded-xl border border-border text-sm text-text-muted truncate">
|
|
162
|
+
{providerUrl}
|
|
163
|
+
</div>
|
|
164
|
+
<button
|
|
165
|
+
onClick={handleCopyLink}
|
|
166
|
+
className="px-4 py-3 bg-surface hover:bg-surface-elevated border border-border rounded-xl transition-colors"
|
|
167
|
+
>
|
|
168
|
+
{copiedLink ? (
|
|
169
|
+
<Check className="w-5 h-5 text-green-500" />
|
|
170
|
+
) : (
|
|
171
|
+
<Copy className="w-5 h-5 text-text-muted" />
|
|
172
|
+
)}
|
|
173
|
+
</button>
|
|
174
|
+
<a
|
|
175
|
+
href={providerUrl}
|
|
176
|
+
target="_blank"
|
|
177
|
+
rel="noopener noreferrer"
|
|
178
|
+
className="px-4 py-3 bg-surface hover:bg-surface-elevated border border-border rounded-xl transition-colors"
|
|
179
|
+
>
|
|
180
|
+
<ExternalLink className="w-5 h-5 text-text-muted" />
|
|
181
|
+
</a>
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
|
|
186
|
+
{/* Footer */}
|
|
187
|
+
<div className="mt-8 text-center">
|
|
188
|
+
<button
|
|
189
|
+
onClick={onClose}
|
|
190
|
+
className="px-6 py-3 bg-accent hover:bg-accent/90 text-white rounded-xl font-medium transition-colors"
|
|
191
|
+
>
|
|
192
|
+
Done
|
|
193
|
+
</button>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
);
|
|
198
|
+
}
|
|
@@ -13,6 +13,47 @@ import {
|
|
|
13
13
|
type Earnings,
|
|
14
14
|
} from "@/lib/convex-client";
|
|
15
15
|
|
|
16
|
+
// Generate sample preview data for the dashboard
|
|
17
|
+
function generatePreviewAnalytics(): Analytics {
|
|
18
|
+
const today = new Date();
|
|
19
|
+
const callsByDay = [];
|
|
20
|
+
|
|
21
|
+
// Generate 14 days of sample data
|
|
22
|
+
for (let i = 13; i >= 0; i--) {
|
|
23
|
+
const date = new Date(today);
|
|
24
|
+
date.setDate(date.getDate() - i);
|
|
25
|
+
const calls = Math.floor(Math.random() * 40) + 20 + Math.sin(i * 0.5) * 15;
|
|
26
|
+
callsByDay.push({
|
|
27
|
+
date: date.toISOString().split('T')[0],
|
|
28
|
+
calls,
|
|
29
|
+
revenue: 0,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
totalCalls: 847,
|
|
35
|
+
uniqueAgents: 23,
|
|
36
|
+
totalRevenue: 0,
|
|
37
|
+
successRate: 98.2,
|
|
38
|
+
avgLatency: 145,
|
|
39
|
+
callsByDay,
|
|
40
|
+
topAgents: [
|
|
41
|
+
{ agentId: "demo_1", calls: 234 },
|
|
42
|
+
{ agentId: "demo_2", calls: 189 },
|
|
43
|
+
{ agentId: "demo_3", calls: 156 },
|
|
44
|
+
{ agentId: "demo_4", calls: 98 },
|
|
45
|
+
{ agentId: "demo_5", calls: 67 },
|
|
46
|
+
],
|
|
47
|
+
topActions: [
|
|
48
|
+
{ actionName: "send_message", calls: 412 },
|
|
49
|
+
{ actionName: "get_status", calls: 289 },
|
|
50
|
+
{ actionName: "create_invoice", calls: 146 },
|
|
51
|
+
],
|
|
52
|
+
apis: [],
|
|
53
|
+
isPreview: true,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
16
57
|
interface DashboardData {
|
|
17
58
|
session: ProviderSession | null;
|
|
18
59
|
apis: ProviderAPI[];
|
|
@@ -57,6 +98,12 @@ export function useDashboardData(): DashboardData {
|
|
|
57
98
|
}
|
|
58
99
|
|
|
59
100
|
setSession(sessionData);
|
|
101
|
+
|
|
102
|
+
// Update localStorage with current provider info
|
|
103
|
+
localStorage.setItem("apiclaw_provider", JSON.stringify({
|
|
104
|
+
name: sessionData.name,
|
|
105
|
+
email: sessionData.email
|
|
106
|
+
}));
|
|
60
107
|
|
|
61
108
|
// Load all dashboard data in parallel
|
|
62
109
|
const [apisData, analyticsData, earningsData] = await Promise.all([
|
|
@@ -66,7 +113,12 @@ export function useDashboardData(): DashboardData {
|
|
|
66
113
|
]);
|
|
67
114
|
|
|
68
115
|
setApis(apisData || []);
|
|
69
|
-
|
|
116
|
+
// If no real analytics, show preview data
|
|
117
|
+
if (!analyticsData || analyticsData.totalCalls === 0) {
|
|
118
|
+
setAnalytics(generatePreviewAnalytics());
|
|
119
|
+
} else {
|
|
120
|
+
setAnalytics(analyticsData);
|
|
121
|
+
}
|
|
70
122
|
setEarnings(earningsData);
|
|
71
123
|
} catch (err) {
|
|
72
124
|
console.error("Dashboard load error:", err);
|