@nordsym/apiclaw 1.7.10 → 1.7.11

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.
Files changed (2) hide show
  1. package/convex/providers.ts +10 -14
  2. package/package.json +1 -1
@@ -164,32 +164,28 @@ export const trackDiscovery = mutation({
164
164
  export const trackDiscoveryByProvider = mutation({
165
165
  args: { provider: v.string(), query: v.string() },
166
166
  handler: async (ctx, args) => {
167
- // Find all APIs belonging to this provider's workspace
167
+ // Find provider by email mapping
168
168
  const providerEmailMap: Record<string, string> = {
169
169
  apilayer: "gustav_hemmingsson@hotmail.com",
170
170
  };
171
171
  const email = providerEmailMap[args.provider];
172
- if (!email) return;
172
+ if (!email) return { updated: 0, error: "no email mapping" };
173
173
 
174
- const workspace = await ctx.db
175
- .query("workspaces")
176
- .withIndex("by_email", (q: any) => q.eq("email", email))
174
+ // Find provider record by email
175
+ const provider = await ctx.db
176
+ .query("providers")
177
+ .withIndex("by_email", (q) => q.eq("email", email))
177
178
  .first();
178
- if (!workspace) return;
179
-
180
- // Find provider record
181
- const providers = await ctx.db.query("providers").collect();
182
- const provider = providers.find((p: any) => p.workspaceId === workspace._id);
183
- if (!provider) return;
179
+ if (!provider) return { updated: 0, error: "provider not found" };
184
180
 
185
181
  // Get all APIs for this provider
186
182
  const apis = await ctx.db.query("providerAPIs").collect();
187
- const providerApis = apis.filter((a: any) => a.providerId === provider._id);
183
+ const providerApis = apis.filter((a) => a.providerId === provider._id);
188
184
 
189
- // Increment discoveryCount on ALL provider APIs (the whole catalog was discovered)
185
+ // Increment discoveryCount on ALL provider APIs
190
186
  for (const api of providerApis) {
191
187
  await ctx.db.patch(api._id, {
192
- discoveryCount: (api.discoveryCount || 0) + 1,
188
+ discoveryCount: ((api as any).discoveryCount || 0) + 1,
193
189
  lastDiscoveredAt: Date.now(),
194
190
  });
195
191
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nordsym/apiclaw",
3
- "version": "1.7.10",
3
+ "version": "1.7.11",
4
4
  "description": "The API layer for AI agents. Dashboard + 22K APIs + 18 Direct Call providers. MCP native.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",