@soat/sdk 0.4.3 → 0.4.4

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/dist/index.js CHANGED
@@ -45,6 +45,7 @@ __export(index_exports, {
45
45
  Projects: () => Projects,
46
46
  Secrets: () => Secrets,
47
47
  Sessions: () => Sessions,
48
+ SoatClient: () => SoatClient,
48
49
  Users: () => Users,
49
50
  Webhooks: () => Webhooks,
50
51
  createClient: () => createClient,
@@ -1069,7 +1070,7 @@ var AgentTools = class {
1069
1070
  scheme: "bearer",
1070
1071
  type: "http"
1071
1072
  }],
1072
- url: "/agents/tools/{toolId}",
1073
+ url: "/agents/tools/{tool_id}",
1073
1074
  ...options
1074
1075
  });
1075
1076
  }
@@ -1084,7 +1085,7 @@ var AgentTools = class {
1084
1085
  scheme: "bearer",
1085
1086
  type: "http"
1086
1087
  }],
1087
- url: "/agents/tools/{toolId}",
1088
+ url: "/agents/tools/{tool_id}",
1088
1089
  ...options
1089
1090
  });
1090
1091
  }
@@ -1099,7 +1100,7 @@ var AgentTools = class {
1099
1100
  scheme: "bearer",
1100
1101
  type: "http"
1101
1102
  }],
1102
- url: "/agents/tools/{toolId}",
1103
+ url: "/agents/tools/{tool_id}",
1103
1104
  ...options,
1104
1105
  headers: {
1105
1106
  "Content-Type": "application/json",
@@ -1138,7 +1139,7 @@ var AgentTraces = class {
1138
1139
  scheme: "bearer",
1139
1140
  type: "http"
1140
1141
  }],
1141
- url: "/agents/traces/{traceId}",
1142
+ url: "/agents/traces/{trace_id}",
1142
1143
  ...options
1143
1144
  });
1144
1145
  }
@@ -1192,7 +1193,7 @@ var Agents = class {
1192
1193
  scheme: "bearer",
1193
1194
  type: "http"
1194
1195
  }],
1195
- url: "/agents/{agentId}",
1196
+ url: "/agents/{agent_id}",
1196
1197
  ...options
1197
1198
  });
1198
1199
  }
@@ -1207,7 +1208,7 @@ var Agents = class {
1207
1208
  scheme: "bearer",
1208
1209
  type: "http"
1209
1210
  }],
1210
- url: "/agents/{agentId}",
1211
+ url: "/agents/{agent_id}",
1211
1212
  ...options
1212
1213
  });
1213
1214
  }
@@ -1222,7 +1223,7 @@ var Agents = class {
1222
1223
  scheme: "bearer",
1223
1224
  type: "http"
1224
1225
  }],
1225
- url: "/agents/{agentId}",
1226
+ url: "/agents/{agent_id}",
1226
1227
  ...options,
1227
1228
  headers: {
1228
1229
  "Content-Type": "application/json",
@@ -1242,7 +1243,7 @@ var Agents = class {
1242
1243
  scheme: "bearer",
1243
1244
  type: "http"
1244
1245
  }],
1245
- url: "/agents/{agentId}/generate",
1246
+ url: "/agents/{agent_id}/generate",
1246
1247
  ...options,
1247
1248
  headers: {
1248
1249
  "Content-Type": "application/json",
@@ -1262,7 +1263,7 @@ var Agents = class {
1262
1263
  scheme: "bearer",
1263
1264
  type: "http"
1264
1265
  }],
1265
- url: "/agents/{agentId}/generate/{generationId}/tool-outputs",
1266
+ url: "/agents/{agent_id}/generate/{generation_id}/tool-outputs",
1266
1267
  ...options,
1267
1268
  headers: {
1268
1269
  "Content-Type": "application/json",
@@ -1277,7 +1278,7 @@ var Agents = class {
1277
1278
  */
1278
1279
  static createAgentActor(options) {
1279
1280
  return (options.client ?? client).post({
1280
- url: "/agents/{agentId}/actors",
1281
+ url: "/agents/{agent_id}/actors",
1281
1282
  ...options,
1282
1283
  headers: {
1283
1284
  "Content-Type": "application/json",
@@ -1323,7 +1324,7 @@ var AiProviders = class {
1323
1324
  */
1324
1325
  static deleteAiProvider(options) {
1325
1326
  return (options.client ?? client).delete({
1326
- url: "/ai-providers/{aiProviderId}",
1327
+ url: "/ai-providers/{ai_provider_id}",
1327
1328
  ...options
1328
1329
  });
1329
1330
  }
@@ -1334,7 +1335,7 @@ var AiProviders = class {
1334
1335
  */
1335
1336
  static getAiProvider(options) {
1336
1337
  return (options.client ?? client).get({
1337
- url: "/ai-providers/{aiProviderId}",
1338
+ url: "/ai-providers/{ai_provider_id}",
1338
1339
  ...options
1339
1340
  });
1340
1341
  }
@@ -1345,7 +1346,7 @@ var AiProviders = class {
1345
1346
  */
1346
1347
  static updateAiProvider(options) {
1347
1348
  return (options.client ?? client).patch({
1348
- url: "/ai-providers/{aiProviderId}",
1349
+ url: "/ai-providers/{ai_provider_id}",
1349
1350
  ...options,
1350
1351
  headers: {
1351
1352
  "Content-Type": "application/json",
@@ -1477,7 +1478,7 @@ var Chats = class {
1477
1478
  scheme: "bearer",
1478
1479
  type: "http"
1479
1480
  }],
1480
- url: "/chats/{chatId}",
1481
+ url: "/chats/{chat_id}",
1481
1482
  ...options
1482
1483
  });
1483
1484
  }
@@ -1492,7 +1493,7 @@ var Chats = class {
1492
1493
  scheme: "bearer",
1493
1494
  type: "http"
1494
1495
  }],
1495
- url: "/chats/{chatId}",
1496
+ url: "/chats/{chat_id}",
1496
1497
  ...options
1497
1498
  });
1498
1499
  }
@@ -1508,7 +1509,7 @@ var Chats = class {
1508
1509
  scheme: "bearer",
1509
1510
  type: "http"
1510
1511
  }],
1511
- url: "/chats/{chatId}/completions",
1512
+ url: "/chats/{chat_id}/completions",
1512
1513
  ...options,
1513
1514
  headers: {
1514
1515
  "Content-Type": "application/json",
@@ -1543,7 +1544,7 @@ var Chats = class {
1543
1544
  */
1544
1545
  static createChatActor(options) {
1545
1546
  return (options.client ?? client).post({
1546
- url: "/chats/{chatId}/actors",
1547
+ url: "/chats/{chat_id}/actors",
1547
1548
  ...options,
1548
1549
  headers: {
1549
1550
  "Content-Type": "application/json",
@@ -1682,7 +1683,7 @@ var Conversations = class {
1682
1683
  */
1683
1684
  static removeConversationMessage(options) {
1684
1685
  return (options.client ?? client).delete({
1685
- url: "/conversations/{id}/messages/{documentId}",
1686
+ url: "/conversations/{id}/messages/{document_id}",
1686
1687
  ...options
1687
1688
  });
1688
1689
  }
@@ -2063,7 +2064,7 @@ var Policies = class {
2063
2064
  scheme: "bearer",
2064
2065
  type: "http"
2065
2066
  }],
2066
- url: "/policies/{policyId}",
2067
+ url: "/policies/{policy_id}",
2067
2068
  ...options
2068
2069
  });
2069
2070
  }
@@ -2078,7 +2079,7 @@ var Policies = class {
2078
2079
  scheme: "bearer",
2079
2080
  type: "http"
2080
2081
  }],
2081
- url: "/policies/{policyId}",
2082
+ url: "/policies/{policy_id}",
2082
2083
  ...options
2083
2084
  });
2084
2085
  }
@@ -2093,7 +2094,7 @@ var Policies = class {
2093
2094
  scheme: "bearer",
2094
2095
  type: "http"
2095
2096
  }],
2096
- url: "/policies/{policyId}",
2097
+ url: "/policies/{policy_id}",
2097
2098
  ...options,
2098
2099
  headers: {
2099
2100
  "Content-Type": "application/json",
@@ -2132,7 +2133,7 @@ var Projects = class {
2132
2133
  scheme: "bearer",
2133
2134
  type: "http"
2134
2135
  }],
2135
- url: "/projects/{projectId}",
2136
+ url: "/projects/{project_id}",
2136
2137
  ...options
2137
2138
  });
2138
2139
  }
@@ -2147,7 +2148,7 @@ var Projects = class {
2147
2148
  scheme: "bearer",
2148
2149
  type: "http"
2149
2150
  }],
2150
- url: "/projects/{projectId}",
2151
+ url: "/projects/{project_id}",
2151
2152
  ...options
2152
2153
  });
2153
2154
  }
@@ -2189,7 +2190,7 @@ var Secrets = class {
2189
2190
  */
2190
2191
  static deleteSecret(options) {
2191
2192
  return (options.client ?? client).delete({
2192
- url: "/secrets/{secretId}",
2193
+ url: "/secrets/{secret_id}",
2193
2194
  ...options
2194
2195
  });
2195
2196
  }
@@ -2200,7 +2201,7 @@ var Secrets = class {
2200
2201
  */
2201
2202
  static getSecret(options) {
2202
2203
  return (options.client ?? client).get({
2203
- url: "/secrets/{secretId}",
2204
+ url: "/secrets/{secret_id}",
2204
2205
  ...options
2205
2206
  });
2206
2207
  }
@@ -2211,7 +2212,7 @@ var Secrets = class {
2211
2212
  */
2212
2213
  static updateSecret(options) {
2213
2214
  return (options.client ?? client).patch({
2214
- url: "/secrets/{secretId}",
2215
+ url: "/secrets/{secret_id}",
2215
2216
  ...options,
2216
2217
  headers: {
2217
2218
  "Content-Type": "application/json",
@@ -2235,7 +2236,7 @@ var Sessions = class {
2235
2236
  scheme: "bearer",
2236
2237
  type: "http"
2237
2238
  }],
2238
- url: "/agents/{agentId}/sessions",
2239
+ url: "/agents/{agent_id}/sessions",
2239
2240
  ...options
2240
2241
  });
2241
2242
  }
@@ -2251,7 +2252,7 @@ var Sessions = class {
2251
2252
  scheme: "bearer",
2252
2253
  type: "http"
2253
2254
  }],
2254
- url: "/agents/{agentId}/sessions",
2255
+ url: "/agents/{agent_id}/sessions",
2255
2256
  ...options,
2256
2257
  headers: {
2257
2258
  "Content-Type": "application/json",
@@ -2270,7 +2271,7 @@ var Sessions = class {
2270
2271
  scheme: "bearer",
2271
2272
  type: "http"
2272
2273
  }],
2273
- url: "/agents/{agentId}/sessions/{sessionId}",
2274
+ url: "/agents/{agent_id}/sessions/{session_id}",
2274
2275
  ...options
2275
2276
  });
2276
2277
  }
@@ -2285,7 +2286,7 @@ var Sessions = class {
2285
2286
  scheme: "bearer",
2286
2287
  type: "http"
2287
2288
  }],
2288
- url: "/agents/{agentId}/sessions/{sessionId}",
2289
+ url: "/agents/{agent_id}/sessions/{session_id}",
2289
2290
  ...options
2290
2291
  });
2291
2292
  }
@@ -2300,7 +2301,7 @@ var Sessions = class {
2300
2301
  scheme: "bearer",
2301
2302
  type: "http"
2302
2303
  }],
2303
- url: "/agents/{agentId}/sessions/{sessionId}",
2304
+ url: "/agents/{agent_id}/sessions/{session_id}",
2304
2305
  ...options,
2305
2306
  headers: {
2306
2307
  "Content-Type": "application/json",
@@ -2320,7 +2321,7 @@ var Sessions = class {
2320
2321
  scheme: "bearer",
2321
2322
  type: "http"
2322
2323
  }],
2323
- url: "/agents/{agentId}/sessions/{sessionId}/messages",
2324
+ url: "/agents/{agent_id}/sessions/{session_id}/messages",
2324
2325
  ...options
2325
2326
  });
2326
2327
  }
@@ -2336,7 +2337,7 @@ var Sessions = class {
2336
2337
  scheme: "bearer",
2337
2338
  type: "http"
2338
2339
  }],
2339
- url: "/agents/{agentId}/sessions/{sessionId}/messages",
2340
+ url: "/agents/{agent_id}/sessions/{session_id}/messages",
2340
2341
  ...options,
2341
2342
  headers: {
2342
2343
  "Content-Type": "application/json",
@@ -2356,7 +2357,7 @@ var Sessions = class {
2356
2357
  scheme: "bearer",
2357
2358
  type: "http"
2358
2359
  }],
2359
- url: "/agents/{agentId}/sessions/{sessionId}/generate",
2360
+ url: "/agents/{agent_id}/sessions/{session_id}/generate",
2360
2361
  ...options,
2361
2362
  headers: {
2362
2363
  "Content-Type": "application/json",
@@ -2376,7 +2377,7 @@ var Sessions = class {
2376
2377
  scheme: "bearer",
2377
2378
  type: "http"
2378
2379
  }],
2379
- url: "/agents/{agentId}/sessions/{sessionId}/tool-outputs",
2380
+ url: "/agents/{agent_id}/sessions/{session_id}/tool-outputs",
2380
2381
  ...options,
2381
2382
  headers: {
2382
2383
  "Content-Type": "application/json",
@@ -2395,7 +2396,7 @@ var Sessions = class {
2395
2396
  scheme: "bearer",
2396
2397
  type: "http"
2397
2398
  }],
2398
- url: "/agents/{agentId}/sessions/{sessionId}/tags",
2399
+ url: "/agents/{agent_id}/sessions/{session_id}/tags",
2399
2400
  ...options
2400
2401
  });
2401
2402
  }
@@ -2410,7 +2411,7 @@ var Sessions = class {
2410
2411
  scheme: "bearer",
2411
2412
  type: "http"
2412
2413
  }],
2413
- url: "/agents/{agentId}/sessions/{sessionId}/tags",
2414
+ url: "/agents/{agent_id}/sessions/{session_id}/tags",
2414
2415
  ...options,
2415
2416
  headers: {
2416
2417
  "Content-Type": "application/json",
@@ -2429,7 +2430,7 @@ var Sessions = class {
2429
2430
  scheme: "bearer",
2430
2431
  type: "http"
2431
2432
  }],
2432
- url: "/agents/{agentId}/sessions/{sessionId}/tags",
2433
+ url: "/agents/{agent_id}/sessions/{session_id}/tags",
2433
2434
  ...options,
2434
2435
  headers: {
2435
2436
  "Content-Type": "application/json",
@@ -2531,7 +2532,7 @@ var Users = class {
2531
2532
  scheme: "bearer",
2532
2533
  type: "http"
2533
2534
  }],
2534
- url: "/users/{userId}/policies",
2535
+ url: "/users/{user_id}/policies",
2535
2536
  ...options
2536
2537
  });
2537
2538
  }
@@ -2546,7 +2547,7 @@ var Users = class {
2546
2547
  scheme: "bearer",
2547
2548
  type: "http"
2548
2549
  }],
2549
- url: "/users/{userId}/policies",
2550
+ url: "/users/{user_id}/policies",
2550
2551
  ...options,
2551
2552
  headers: {
2552
2553
  "Content-Type": "application/json",
@@ -2566,7 +2567,7 @@ var Webhooks = class {
2566
2567
  */
2567
2568
  static listWebhooks(options) {
2568
2569
  return (options.client ?? client).get({
2569
- url: "/projects/{projectId}/webhooks",
2570
+ url: "/projects/{project_id}/webhooks",
2570
2571
  ...options
2571
2572
  });
2572
2573
  }
@@ -2577,7 +2578,7 @@ var Webhooks = class {
2577
2578
  */
2578
2579
  static createWebhook(options) {
2579
2580
  return (options.client ?? client).post({
2580
- url: "/projects/{projectId}/webhooks",
2581
+ url: "/projects/{project_id}/webhooks",
2581
2582
  ...options,
2582
2583
  headers: {
2583
2584
  "Content-Type": "application/json",
@@ -2592,7 +2593,7 @@ var Webhooks = class {
2592
2593
  */
2593
2594
  static deleteWebhook(options) {
2594
2595
  return (options.client ?? client).delete({
2595
- url: "/projects/{projectId}/webhooks/{webhookId}",
2596
+ url: "/projects/{project_id}/webhooks/{webhook_id}",
2596
2597
  ...options
2597
2598
  });
2598
2599
  }
@@ -2603,7 +2604,7 @@ var Webhooks = class {
2603
2604
  */
2604
2605
  static getWebhook(options) {
2605
2606
  return (options.client ?? client).get({
2606
- url: "/projects/{projectId}/webhooks/{webhookId}",
2607
+ url: "/projects/{project_id}/webhooks/{webhook_id}",
2607
2608
  ...options
2608
2609
  });
2609
2610
  }
@@ -2614,7 +2615,7 @@ var Webhooks = class {
2614
2615
  */
2615
2616
  static updateWebhook(options) {
2616
2617
  return (options.client ?? client).put({
2617
- url: "/projects/{projectId}/webhooks/{webhookId}",
2618
+ url: "/projects/{project_id}/webhooks/{webhook_id}",
2618
2619
  ...options,
2619
2620
  headers: {
2620
2621
  "Content-Type": "application/json",
@@ -2629,7 +2630,7 @@ var Webhooks = class {
2629
2630
  */
2630
2631
  static listWebhookDeliveries(options) {
2631
2632
  return (options.client ?? client).get({
2632
- url: "/projects/{projectId}/webhooks/{webhookId}/deliveries",
2633
+ url: "/projects/{project_id}/webhooks/{webhook_id}/deliveries",
2633
2634
  ...options
2634
2635
  });
2635
2636
  }
@@ -2640,7 +2641,7 @@ var Webhooks = class {
2640
2641
  */
2641
2642
  static getWebhookDelivery(options) {
2642
2643
  return (options.client ?? client).get({
2643
- url: "/projects/{projectId}/webhooks/{webhookId}/deliveries/{deliveryId}",
2644
+ url: "/projects/{project_id}/webhooks/{webhook_id}/deliveries/{delivery_id}",
2644
2645
  ...options
2645
2646
  });
2646
2647
  }
@@ -2651,11 +2652,82 @@ var Webhooks = class {
2651
2652
  */
2652
2653
  static rotateWebhookSecret(options) {
2653
2654
  return (options.client ?? client).post({
2654
- url: "/projects/{projectId}/webhooks/{webhookId}/rotate-secret",
2655
+ url: "/projects/{project_id}/webhooks/{webhook_id}/rotate-secret",
2655
2656
  ...options
2656
2657
  });
2657
2658
  }
2658
2659
  };
2660
+
2661
+ // src/soatClient.ts
2662
+ var bindResource = /* @__PURE__ */__name((SdkClass, client2) => {
2663
+ return new Proxy(SdkClass, {
2664
+ get: /* @__PURE__ */__name((target, prop) => {
2665
+ const value = target[prop];
2666
+ if (typeof value === "function") {
2667
+ return options => {
2668
+ return value({
2669
+ ...options,
2670
+ client: client2
2671
+ });
2672
+ };
2673
+ }
2674
+ return value;
2675
+ }, "get")
2676
+ });
2677
+ }, "bindResource");
2678
+ var SoatClient = class {
2679
+ static {
2680
+ __name(this, "SoatClient");
2681
+ }
2682
+ actors;
2683
+ agentTools;
2684
+ agentTraces;
2685
+ agents;
2686
+ aiProviders;
2687
+ apiKeys;
2688
+ chats;
2689
+ conversations;
2690
+ documents;
2691
+ files;
2692
+ policies;
2693
+ projects;
2694
+ secrets;
2695
+ sessions;
2696
+ users;
2697
+ webhooks;
2698
+ constructor({
2699
+ baseUrl,
2700
+ token,
2701
+ headers
2702
+ } = {}) {
2703
+ const authHeaders = token ? {
2704
+ Authorization: `Bearer ${token}`
2705
+ } : {};
2706
+ const httpClient = createClient(createConfig({
2707
+ baseUrl: baseUrl ?? "/api/v1",
2708
+ headers: {
2709
+ ...authHeaders,
2710
+ ...headers
2711
+ }
2712
+ }));
2713
+ this.actors = bindResource(Actors, httpClient);
2714
+ this.agentTools = bindResource(AgentTools, httpClient);
2715
+ this.agentTraces = bindResource(AgentTraces, httpClient);
2716
+ this.agents = bindResource(Agents, httpClient);
2717
+ this.aiProviders = bindResource(AiProviders, httpClient);
2718
+ this.apiKeys = bindResource(ApiKeys, httpClient);
2719
+ this.chats = bindResource(Chats, httpClient);
2720
+ this.conversations = bindResource(Conversations, httpClient);
2721
+ this.documents = bindResource(Documents, httpClient);
2722
+ this.files = bindResource(Files, httpClient);
2723
+ this.policies = bindResource(Policies, httpClient);
2724
+ this.projects = bindResource(Projects, httpClient);
2725
+ this.secrets = bindResource(Secrets, httpClient);
2726
+ this.sessions = bindResource(Sessions, httpClient);
2727
+ this.users = bindResource(Users, httpClient);
2728
+ this.webhooks = bindResource(Webhooks, httpClient);
2729
+ }
2730
+ };
2659
2731
  // Annotate the CommonJS export names for ESM import in node:
2660
2732
  0 && (module.exports = {
2661
2733
  Actors,
@@ -2672,6 +2744,7 @@ var Webhooks = class {
2672
2744
  Projects,
2673
2745
  Secrets,
2674
2746
  Sessions,
2747
+ SoatClient,
2675
2748
  Users,
2676
2749
  Webhooks,
2677
2750
  createClient,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soat/sdk",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "TypeScript SDK for the SOAT API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -40,6 +40,8 @@
40
40
  },
41
41
  "scripts": {
42
42
  "build": "pnpm generate && tsup",
43
+ "lint": "eslint src",
44
+ "typecheck": "tsc --noEmit",
43
45
  "generate": "tsx scripts/generate.ts"
44
46
  }
45
47
  }