@flashbacktech/tsclient 0.4.64 → 0.4.66
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.cjs +70 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +82 -1
- package/dist/index.d.ts +82 -1
- package/dist/index.js +70 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1453,6 +1453,74 @@ var ResellerClient = class {
|
|
|
1453
1453
|
}
|
|
1454
1454
|
};
|
|
1455
1455
|
|
|
1456
|
+
// src/modules/platformAdmin/PlatformAdminClient.ts
|
|
1457
|
+
var PlatformAdminClient = class {
|
|
1458
|
+
constructor(http) {
|
|
1459
|
+
this.http = http;
|
|
1460
|
+
}
|
|
1461
|
+
// --- Global backend settings (open registration + free-tier credits) ---
|
|
1462
|
+
/** Current global settings. */
|
|
1463
|
+
async getPlatformSettings() {
|
|
1464
|
+
const res = await this.http.get("/admin/platform-settings");
|
|
1465
|
+
return unwrapData(res);
|
|
1466
|
+
}
|
|
1467
|
+
/** Update the global settings. */
|
|
1468
|
+
async updatePlatformSettings(body) {
|
|
1469
|
+
const res = await this.http.put("/admin/platform-settings", {
|
|
1470
|
+
body
|
|
1471
|
+
});
|
|
1472
|
+
return unwrapData(res);
|
|
1473
|
+
}
|
|
1474
|
+
/** Models the aigateway currently exposes (for validating selection/pricing). */
|
|
1475
|
+
async listAvailableModels() {
|
|
1476
|
+
const res = await this.http.get(
|
|
1477
|
+
"/admin/available-models"
|
|
1478
|
+
);
|
|
1479
|
+
return unwrapData(res);
|
|
1480
|
+
}
|
|
1481
|
+
// --- Chat-model selection (bridged to cloud-agent) ---
|
|
1482
|
+
/** Current model selection (provider priority + per-provider/role models). */
|
|
1483
|
+
async getModelSelection() {
|
|
1484
|
+
const res = await this.http.get("/admin/model-selection");
|
|
1485
|
+
return unwrapData(res);
|
|
1486
|
+
}
|
|
1487
|
+
/** Full replace of the model selection. Returns the fresh selection. */
|
|
1488
|
+
async putModelSelection(body) {
|
|
1489
|
+
const res = await this.http.put("/admin/model-selection", { body });
|
|
1490
|
+
return unwrapData(res);
|
|
1491
|
+
}
|
|
1492
|
+
/** Upsert a single (provider, role) → model slot. Returns the fresh selection. */
|
|
1493
|
+
async patchModelSelection(body) {
|
|
1494
|
+
const res = await this.http.patch("/admin/model-selection", {
|
|
1495
|
+
body
|
|
1496
|
+
});
|
|
1497
|
+
return unwrapData(res);
|
|
1498
|
+
}
|
|
1499
|
+
// --- Model pricing / surcharge (bridged to cloud-agent) ---
|
|
1500
|
+
/** All model_pricing rows. */
|
|
1501
|
+
async listModelPricing() {
|
|
1502
|
+
const res = await this.http.get(
|
|
1503
|
+
"/admin/model-pricing"
|
|
1504
|
+
);
|
|
1505
|
+
return unwrapData(res).pricing ?? [];
|
|
1506
|
+
}
|
|
1507
|
+
/** Upsert one model_pricing row (also used to add a new row). Returns the fresh list. */
|
|
1508
|
+
async putModelPricing(row) {
|
|
1509
|
+
const res = await this.http.put(
|
|
1510
|
+
"/admin/model-pricing",
|
|
1511
|
+
{ body: row }
|
|
1512
|
+
);
|
|
1513
|
+
return unwrapData(res).pricing ?? [];
|
|
1514
|
+
}
|
|
1515
|
+
/** Delete a model_pricing row by model id. Returns the fresh list. */
|
|
1516
|
+
async deleteModelPricing(model) {
|
|
1517
|
+
const res = await this.http.delete(
|
|
1518
|
+
`/admin/model-pricing?model=${encodeURIComponent(model)}`
|
|
1519
|
+
);
|
|
1520
|
+
return unwrapData(res).pricing ?? [];
|
|
1521
|
+
}
|
|
1522
|
+
};
|
|
1523
|
+
|
|
1456
1524
|
// src/client.ts
|
|
1457
1525
|
var AgentEngineFacade = class {
|
|
1458
1526
|
constructor(templates, scheduledTasks) {
|
|
@@ -1488,6 +1556,7 @@ var CloudAgentClient = class {
|
|
|
1488
1556
|
this.budgets = new BudgetsClient(this.http);
|
|
1489
1557
|
this.referrals = new ReferralsClient(this.http);
|
|
1490
1558
|
this.reseller = new ResellerClient(this.http);
|
|
1559
|
+
this.platformAdmin = new PlatformAdminClient(this.http);
|
|
1491
1560
|
}
|
|
1492
1561
|
};
|
|
1493
1562
|
|
|
@@ -2337,6 +2406,7 @@ exports.MFAType = MFAType;
|
|
|
2337
2406
|
exports.NotImplementedError = NotImplementedError;
|
|
2338
2407
|
exports.OrgRoles = OrgRoles;
|
|
2339
2408
|
exports.PROVIDER_CATALOG = PROVIDER_CATALOG;
|
|
2409
|
+
exports.PlatformAdminClient = PlatformAdminClient;
|
|
2340
2410
|
exports.ProviderType = ProviderType;
|
|
2341
2411
|
exports.ReferralsClient = ReferralsClient;
|
|
2342
2412
|
exports.ResellerClient = ResellerClient;
|