@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.
Files changed (145) hide show
  1. package/README.md +4 -4
  2. package/apiclaw-README.md +12 -12
  3. package/convex/_generated/api.d.ts +16 -0
  4. package/convex/analytics.d.ts.map +1 -1
  5. package/convex/analytics.js.map +1 -1
  6. package/convex/analytics.ts +1 -0
  7. package/convex/apiKeys.ts +220 -0
  8. package/convex/backfillAnalytics.d.ts.map +1 -0
  9. package/convex/backfillAnalytics.js.map +1 -0
  10. package/convex/backfillAnalytics.ts +22 -0
  11. package/convex/backfillSearchLogs.d.ts.map +1 -0
  12. package/convex/backfillSearchLogs.js.map +1 -0
  13. package/convex/backfillSearchLogs.ts +35 -0
  14. package/convex/debugFilestackLogs.d.ts.map +1 -0
  15. package/convex/debugFilestackLogs.js.map +1 -0
  16. package/convex/debugFilestackLogs.ts +16 -0
  17. package/convex/debugGetToken.d.ts.map +1 -0
  18. package/convex/debugGetToken.js.map +1 -0
  19. package/convex/debugGetToken.ts +18 -0
  20. package/convex/directCall.ts +49 -14
  21. package/convex/email.ts +5 -5
  22. package/convex/http.d.ts.map +1 -1
  23. package/convex/http.js.map +1 -1
  24. package/convex/http.ts +611 -49
  25. package/convex/logs.ts +26 -22
  26. package/convex/migrateFilestack.d.ts.map +1 -1
  27. package/convex/migrateFilestack.js.map +1 -1
  28. package/convex/migrateFilestack.ts +65 -101
  29. package/convex/migratePartnersProd.d.ts.map +1 -0
  30. package/convex/migratePartnersProd.js.map +1 -0
  31. package/convex/migratePartnersProd.ts +174 -0
  32. package/convex/migrateProviderWorkspaces.d.ts.map +1 -0
  33. package/convex/migrateProviderWorkspaces.js.map +1 -0
  34. package/convex/migrateProviderWorkspaces.ts +175 -0
  35. package/convex/providers.js.map +1 -1
  36. package/convex/providers.ts +313 -203
  37. package/convex/schema.ts +50 -1
  38. package/convex/searchLogs.d.ts.map +1 -1
  39. package/convex/searchLogs.js.map +1 -1
  40. package/convex/searchLogs.ts +11 -3
  41. package/convex/seedPratham.ts +1 -1
  42. package/convex/spendAlerts.ts +2 -2
  43. package/convex/stripeActions.ts +1 -1
  44. package/convex/updateAPIStatus.ts +2 -3
  45. package/convex/workspaceSettings.ts +136 -0
  46. package/dist/bin-http.js +0 -0
  47. package/dist/bin.js +0 -0
  48. package/dist/cli/commands/demo.js +2 -2
  49. package/dist/cli/commands/doctor.js +1 -1
  50. package/dist/cli/commands/login.js +1 -1
  51. package/dist/cli/commands/setup.js +2 -2
  52. package/dist/discovery.js +1 -1
  53. package/dist/execute.js +3 -3
  54. package/dist/index.js +13 -13
  55. package/dist/registry/apis.json +1 -1
  56. package/dist/ui/errors.js +16 -16
  57. package/dist/ui/prompts.js +1 -1
  58. package/email-templates/filestack-provider-outreach.html +1 -1
  59. package/email-templates/partnership-template.html +1 -1
  60. package/email-templates/pratham-partnership-draft.html +2 -2
  61. package/package.json +2 -2
  62. package/reports/APIClaw-Session-Report-2026-04-05.pdf +0 -0
  63. package/reports/session-report-2026-04-05.html +433 -0
  64. package/src/cli/commands/demo.ts +2 -2
  65. package/src/cli/commands/doctor.ts +1 -1
  66. package/src/cli/commands/login.ts +1 -1
  67. package/src/cli/commands/setup.ts +2 -2
  68. package/src/discovery.ts +1 -1
  69. package/src/execute.ts +3 -3
  70. package/src/index.ts +14 -14
  71. package/src/registry/apis.json +1 -1
  72. package/src/ui/errors.ts +16 -16
  73. package/src/ui/prompts.ts +1 -1
  74. package/convex/adminActivate.d.ts +0 -3
  75. package/convex/adminActivate.js +0 -47
  76. package/convex/adminStats.d.ts +0 -9
  77. package/convex/adminStats.js +0 -280
  78. package/convex/agents.d.ts +0 -84
  79. package/convex/agents.js +0 -809
  80. package/convex/analytics.d.ts +0 -5
  81. package/convex/analytics.js +0 -166
  82. package/convex/billing.d.ts +0 -88
  83. package/convex/billing.js +0 -655
  84. package/convex/capabilities.d.ts +0 -9
  85. package/convex/capabilities.js +0 -145
  86. package/convex/chains.d.ts +0 -68
  87. package/convex/chains.js +0 -1105
  88. package/convex/credits.d.ts +0 -25
  89. package/convex/credits.js +0 -186
  90. package/convex/crons.d.ts +0 -3
  91. package/convex/crons.js +0 -17
  92. package/convex/directCall.d.ts +0 -72
  93. package/convex/directCall.js +0 -627
  94. package/convex/earnProgress.d.ts +0 -58
  95. package/convex/earnProgress.js +0 -649
  96. package/convex/email.d.ts +0 -14
  97. package/convex/email.js +0 -300
  98. package/convex/feedback.d.ts +0 -7
  99. package/convex/feedback.js +0 -227
  100. package/convex/http.d.ts +0 -3
  101. package/convex/http.js +0 -1405
  102. package/convex/inbound.d.ts +0 -2
  103. package/convex/inbound.js +0 -32
  104. package/convex/logs.d.ts +0 -48
  105. package/convex/logs.js +0 -621
  106. package/convex/migrateFilestack.d.ts +0 -2
  107. package/convex/migrateFilestack.js +0 -113
  108. package/convex/migratePratham.d.ts +0 -2
  109. package/convex/migratePratham.js +0 -121
  110. package/convex/mou.d.ts +0 -6
  111. package/convex/mou.js +0 -82
  112. package/convex/providerKeys.d.ts +0 -31
  113. package/convex/providerKeys.js +0 -257
  114. package/convex/providers.d.ts +0 -35
  115. package/convex/providers.js +0 -922
  116. package/convex/purchases.d.ts +0 -7
  117. package/convex/purchases.js +0 -157
  118. package/convex/ratelimit.d.ts +0 -4
  119. package/convex/ratelimit.js +0 -91
  120. package/convex/searchLogs.d.ts +0 -13
  121. package/convex/searchLogs.js +0 -232
  122. package/convex/seedAPILayerAPIs.d.ts +0 -7
  123. package/convex/seedAPILayerAPIs.js +0 -177
  124. package/convex/seedDirectCallConfigs.d.ts +0 -2
  125. package/convex/seedDirectCallConfigs.js +0 -324
  126. package/convex/seedPratham.d.ts +0 -6
  127. package/convex/seedPratham.js +0 -150
  128. package/convex/spendAlerts.d.ts +0 -36
  129. package/convex/spendAlerts.js +0 -380
  130. package/convex/stripeActions.d.ts +0 -19
  131. package/convex/stripeActions.js +0 -411
  132. package/convex/teams.d.ts +0 -21
  133. package/convex/teams.js +0 -215
  134. package/convex/telemetry.d.ts +0 -4
  135. package/convex/telemetry.js +0 -74
  136. package/convex/updateAPIStatus.d.ts +0 -6
  137. package/convex/updateAPIStatus.js +0 -40
  138. package/convex/usage.d.ts +0 -27
  139. package/convex/usage.js +0 -229
  140. package/convex/waitlist.d.ts +0 -4
  141. package/convex/waitlist.js +0 -49
  142. package/convex/webhooks.d.ts +0 -12
  143. package/convex/webhooks.js +0 -410
  144. package/convex/workspaces.d.ts +0 -33
  145. package/convex/workspaces.js +0 -991
@@ -1,145 +0,0 @@
1
- import { v } from "convex/values";
2
- import { query, mutation } from "./_generated/server";
3
- // Get a capability by ID
4
- export const getById = query({
5
- args: { id: v.string() },
6
- handler: async (ctx, args) => {
7
- return await ctx.db
8
- .query("capabilities")
9
- .withIndex("by_capability_id", (q) => q.eq("id", args.id))
10
- .first();
11
- },
12
- });
13
- // List all capabilities
14
- export const list = query({
15
- args: {},
16
- handler: async (ctx) => {
17
- return await ctx.db.query("capabilities").collect();
18
- },
19
- });
20
- // List capabilities by category
21
- export const listByCategory = query({
22
- args: { category: v.string() },
23
- handler: async (ctx, args) => {
24
- return await ctx.db
25
- .query("capabilities")
26
- .withIndex("by_category", (q) => q.eq("category", args.category))
27
- .collect();
28
- },
29
- });
30
- // Get providers for a capability (sorted by priority, filtered by enabled + healthy)
31
- export const getProviders = query({
32
- args: { capabilityId: v.string(), region: v.optional(v.string()) },
33
- handler: async (ctx, args) => {
34
- let providers = await ctx.db
35
- .query("providerCapabilities")
36
- .withIndex("by_capabilityId_enabled", (q) => q.eq("capabilityId", args.capabilityId).eq("enabled", true))
37
- .collect();
38
- // Filter by region if specified
39
- if (args.region) {
40
- providers = providers.filter(p => p.regions.includes(args.region));
41
- }
42
- // Filter out unhealthy providers
43
- providers = providers.filter(p => p.healthStatus !== "down");
44
- // Sort by priority, then price, then latency
45
- providers.sort((a, b) => {
46
- if (a.priority !== b.priority)
47
- return a.priority - b.priority;
48
- if (a.pricePerUnit !== b.pricePerUnit)
49
- return a.pricePerUnit - b.pricePerUnit;
50
- return a.avgLatencyMs - b.avgLatencyMs;
51
- });
52
- return providers;
53
- },
54
- });
55
- // Create a capability
56
- export const create = mutation({
57
- args: {
58
- id: v.string(),
59
- name: v.string(),
60
- description: v.string(),
61
- category: v.string(),
62
- standardParams: v.array(v.object({
63
- name: v.string(),
64
- type: v.string(),
65
- required: v.boolean(),
66
- description: v.string(),
67
- default: v.optional(v.any()),
68
- })),
69
- },
70
- handler: async (ctx, args) => {
71
- const now = Date.now();
72
- return await ctx.db.insert("capabilities", {
73
- ...args,
74
- createdAt: now,
75
- updatedAt: now,
76
- });
77
- },
78
- });
79
- // Add provider to capability
80
- export const addProvider = mutation({
81
- args: {
82
- providerId: v.string(),
83
- capabilityId: v.string(),
84
- priority: v.number(),
85
- regions: v.array(v.string()),
86
- pricePerUnit: v.number(),
87
- currency: v.string(),
88
- avgLatencyMs: v.number(),
89
- paramMapping: v.any(),
90
- },
91
- handler: async (ctx, args) => {
92
- const now = Date.now();
93
- return await ctx.db.insert("providerCapabilities", {
94
- ...args,
95
- enabled: true,
96
- healthStatus: "healthy",
97
- createdAt: now,
98
- updatedAt: now,
99
- });
100
- },
101
- });
102
- // Update provider health status
103
- export const updateHealth = mutation({
104
- args: {
105
- providerId: v.string(),
106
- capabilityId: v.string(),
107
- healthStatus: v.string(),
108
- },
109
- handler: async (ctx, args) => {
110
- const mapping = await ctx.db
111
- .query("providerCapabilities")
112
- .withIndex("by_providerId", (q) => q.eq("providerId", args.providerId))
113
- .filter((q) => q.eq(q.field("capabilityId"), args.capabilityId))
114
- .first();
115
- if (mapping) {
116
- await ctx.db.patch(mapping._id, {
117
- healthStatus: args.healthStatus,
118
- lastHealthCheck: Date.now(),
119
- updatedAt: Date.now(),
120
- });
121
- }
122
- },
123
- });
124
- // Log capability usage
125
- export const logUsage = mutation({
126
- args: {
127
- capabilityId: v.string(),
128
- providerId: v.string(),
129
- userId: v.string(),
130
- action: v.string(),
131
- success: v.boolean(),
132
- fallbackUsed: v.boolean(),
133
- fallbackReason: v.optional(v.string()),
134
- latencyMs: v.number(),
135
- cost: v.number(),
136
- currency: v.string(),
137
- },
138
- handler: async (ctx, args) => {
139
- return await ctx.db.insert("capabilityLogs", {
140
- ...args,
141
- timestamp: Date.now(),
142
- });
143
- },
144
- });
145
- //# sourceMappingURL=capabilities.js.map
@@ -1,68 +0,0 @@
1
- /**
2
- * Get chain executions for a workspace (authenticated via session token)
3
- */
4
- export declare const getChainExecutions: any;
5
- /**
6
- * Get full trace for a single chain (authenticated via session token)
7
- */
8
- export declare const getChainTraceAuth: any;
9
- /**
10
- * Resume a failed/paused chain (authenticated via session token)
11
- */
12
- export declare const resumeChainAuth: any;
13
- /**
14
- * Get chain statistics for workspace (authenticated via session token)
15
- */
16
- export declare const getChainStatsAuth: any;
17
- /**
18
- * Create a new chain execution record (internal)
19
- */
20
- export declare const createChainInternal: any;
21
- /**
22
- * Create a new chain execution record (public API)
23
- */
24
- export declare const createChain: any;
25
- /**
26
- * Create chain from template
27
- */
28
- export declare const createChainFromTemplate: any;
29
- /**
30
- * Execute a single step and store the result
31
- */
32
- export declare const executeStep: any;
33
- /**
34
- * Record step completion with result
35
- */
36
- export declare const completeStep: any;
37
- /**
38
- * Advance chain to next step
39
- */
40
- export declare const advanceChain: any;
41
- /**
42
- * Handle chain failure
43
- */
44
- export declare const failChain: any;
45
- /**
46
- * Resume chain from failed step (public mutation)
47
- */
48
- export declare const resumeChain: any;
49
- /**
50
- * Mark chain as completed
51
- */
52
- export declare const completeChain: any;
53
- /**
54
- * Pause chain execution
55
- */
56
- export declare const pauseChain: any;
57
- export declare const saveChainTemplate: any;
58
- export declare const deleteChainTemplate: any;
59
- export declare const getChain: any;
60
- export declare const getChainTrace: any;
61
- export declare const listChains: any;
62
- export declare const listChainTemplates: any;
63
- export declare const getChainTemplate: any;
64
- export declare const getChainStats: any;
65
- export declare const runChain: any;
66
- export declare const runParallelSteps: any;
67
- export declare const getInboundAPIActivity: any;
68
- //# sourceMappingURL=chains.d.ts.map