@nordsym/apiclaw 1.5.18 → 1.5.19

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 (66) hide show
  1. package/convex/http.js.map +1 -1
  2. package/convex/http.ts +315 -0
  3. package/dist/credentials.d.ts.map +1 -1
  4. package/dist/credentials.js +123 -0
  5. package/dist/credentials.js.map +1 -1
  6. package/package.json +2 -2
  7. package/src/credentials.ts +131 -0
  8. package/convex/adminActivate.d.ts +0 -3
  9. package/convex/adminActivate.js +0 -47
  10. package/convex/adminStats.d.ts +0 -3
  11. package/convex/adminStats.js +0 -42
  12. package/convex/agents.d.ts +0 -54
  13. package/convex/agents.js +0 -499
  14. package/convex/analytics.d.ts +0 -5
  15. package/convex/analytics.js +0 -166
  16. package/convex/billing.d.ts +0 -88
  17. package/convex/billing.js +0 -655
  18. package/convex/capabilities.d.ts +0 -9
  19. package/convex/capabilities.js +0 -145
  20. package/convex/chains.d.ts +0 -67
  21. package/convex/chains.js +0 -1042
  22. package/convex/credits.d.ts +0 -25
  23. package/convex/credits.js +0 -186
  24. package/convex/crons.d.ts +0 -3
  25. package/convex/crons.js +0 -17
  26. package/convex/directCall.d.ts +0 -72
  27. package/convex/directCall.js +0 -627
  28. package/convex/earnProgress.d.ts +0 -58
  29. package/convex/earnProgress.js +0 -649
  30. package/convex/email.d.ts +0 -14
  31. package/convex/email.js +0 -300
  32. package/convex/feedback.d.ts +0 -7
  33. package/convex/feedback.js +0 -227
  34. package/convex/http.d.ts +0 -3
  35. package/convex/http.js +0 -1106
  36. package/convex/http.ts.bak +0 -934
  37. package/convex/logs.d.ts +0 -38
  38. package/convex/logs.js +0 -487
  39. package/convex/mou.d.ts +0 -6
  40. package/convex/mou.js +0 -82
  41. package/convex/providerKeys.d.ts +0 -31
  42. package/convex/providerKeys.js +0 -257
  43. package/convex/providers.d.ts +0 -29
  44. package/convex/providers.js +0 -756
  45. package/convex/purchases.d.ts +0 -7
  46. package/convex/purchases.js +0 -157
  47. package/convex/ratelimit.d.ts +0 -4
  48. package/convex/ratelimit.js +0 -91
  49. package/convex/searchLogs.d.ts +0 -4
  50. package/convex/searchLogs.js +0 -129
  51. package/convex/spendAlerts.d.ts +0 -36
  52. package/convex/spendAlerts.js +0 -380
  53. package/convex/stripeActions.d.ts +0 -19
  54. package/convex/stripeActions.js +0 -411
  55. package/convex/teams.d.ts +0 -21
  56. package/convex/teams.js +0 -215
  57. package/convex/telemetry.d.ts +0 -4
  58. package/convex/telemetry.js +0 -74
  59. package/convex/usage.d.ts +0 -27
  60. package/convex/usage.js +0 -229
  61. package/convex/waitlist.d.ts +0 -4
  62. package/convex/waitlist.js +0 -49
  63. package/convex/webhooks.d.ts +0 -12
  64. package/convex/webhooks.js +0 -410
  65. package/convex/workspaces.d.ts +0 -29
  66. package/convex/workspaces.js +0 -880
@@ -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,67 +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
- //# sourceMappingURL=chains.d.ts.map