@getsupervisor/agents-studio-sdk 1.41.2-patch.10 → 1.41.2-patch.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.
- package/dist/index.cjs +46 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +165 -49
- package/dist/index.d.ts +165 -49
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -1
- package/package.json +8 -5
package/dist/index.cjs
CHANGED
|
@@ -43,6 +43,7 @@ __export(index_exports, {
|
|
|
43
43
|
createAgentVersionsApi: () => createAgentVersionsApi,
|
|
44
44
|
createAgentsApi: () => createAgentsApi,
|
|
45
45
|
createApiKeysApi: () => createApiKeysApi,
|
|
46
|
+
createBillingApi: () => createBillingApi,
|
|
46
47
|
createCallsApi: () => createCallsApi,
|
|
47
48
|
createCampaignsApi: () => createCampaignsApi,
|
|
48
49
|
createCatalogTemplatesApi: () => createCatalogTemplatesApi,
|
|
@@ -50,6 +51,7 @@ __export(index_exports, {
|
|
|
50
51
|
createClient: () => createClient,
|
|
51
52
|
createHttp: () => createHttp,
|
|
52
53
|
createToolsApi: () => createToolsApi,
|
|
54
|
+
createUsageApi: () => createUsageApi,
|
|
53
55
|
createVoicesApi: () => createVoicesApi,
|
|
54
56
|
createWebhooksApi: () => createWebhooksApi,
|
|
55
57
|
createWorkspacesApi: () => createWorkspacesApi,
|
|
@@ -1379,6 +1381,19 @@ function createApiKeysApi(cfg) {
|
|
|
1379
1381
|
};
|
|
1380
1382
|
}
|
|
1381
1383
|
|
|
1384
|
+
// src/api/billing.ts
|
|
1385
|
+
function createBillingApi(cfg) {
|
|
1386
|
+
const { base, doFetch } = createHttp(cfg);
|
|
1387
|
+
return {
|
|
1388
|
+
async getBalance() {
|
|
1389
|
+
const res = await doFetch(`${base}/billing/balance`, {
|
|
1390
|
+
method: "GET"
|
|
1391
|
+
});
|
|
1392
|
+
return res.json();
|
|
1393
|
+
}
|
|
1394
|
+
};
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1382
1397
|
// src/api/calls.ts
|
|
1383
1398
|
function createCallsApi(cfg) {
|
|
1384
1399
|
const { base, doFetch } = createHttp(cfg);
|
|
@@ -1783,6 +1798,33 @@ function createToolsApi(cfg) {
|
|
|
1783
1798
|
};
|
|
1784
1799
|
}
|
|
1785
1800
|
|
|
1801
|
+
// src/api/usage.ts
|
|
1802
|
+
function createUsageApi(cfg) {
|
|
1803
|
+
const { base, doFetch } = createHttp(cfg);
|
|
1804
|
+
const fetchUsageAgentsPage = async (options = {}) => {
|
|
1805
|
+
const { resource, from, to, ...listOptions } = options ?? {};
|
|
1806
|
+
const query = serializeListOptions(listOptions, {
|
|
1807
|
+
resource,
|
|
1808
|
+
from,
|
|
1809
|
+
to
|
|
1810
|
+
});
|
|
1811
|
+
const res = await doFetch(`${base}/usage/agents`, {
|
|
1812
|
+
method: "GET",
|
|
1813
|
+
query
|
|
1814
|
+
});
|
|
1815
|
+
return res.json();
|
|
1816
|
+
};
|
|
1817
|
+
return {
|
|
1818
|
+
async agents(options = {}) {
|
|
1819
|
+
const normalizedOptions = {
|
|
1820
|
+
...options ?? {}
|
|
1821
|
+
};
|
|
1822
|
+
const response = await fetchUsageAgentsPage(normalizedOptions);
|
|
1823
|
+
return attachPaginator(response, fetchUsageAgentsPage, normalizedOptions);
|
|
1824
|
+
}
|
|
1825
|
+
};
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1786
1828
|
// src/utils/catalog-voices.ts
|
|
1787
1829
|
var FALLBACK_LOCALE = "und";
|
|
1788
1830
|
var FALLBACK_PROVIDER = "catalog";
|
|
@@ -2290,7 +2332,9 @@ function createClient(initialCfg) {
|
|
|
2290
2332
|
campaigns: createCampaignsApi(runtimeCfg),
|
|
2291
2333
|
voices: voicesApi,
|
|
2292
2334
|
apiKeys: apiKeysApi,
|
|
2335
|
+
billing: createBillingApi(runtimeCfg),
|
|
2293
2336
|
calls: callsApi,
|
|
2337
|
+
usage: createUsageApi(runtimeCfg),
|
|
2294
2338
|
webhooks: webhooksApi
|
|
2295
2339
|
};
|
|
2296
2340
|
return {
|
|
@@ -2374,6 +2418,7 @@ function createClient(initialCfg) {
|
|
|
2374
2418
|
createAgentVersionsApi,
|
|
2375
2419
|
createAgentsApi,
|
|
2376
2420
|
createApiKeysApi,
|
|
2421
|
+
createBillingApi,
|
|
2377
2422
|
createCallsApi,
|
|
2378
2423
|
createCampaignsApi,
|
|
2379
2424
|
createCatalogTemplatesApi,
|
|
@@ -2381,6 +2426,7 @@ function createClient(initialCfg) {
|
|
|
2381
2426
|
createClient,
|
|
2382
2427
|
createHttp,
|
|
2383
2428
|
createToolsApi,
|
|
2429
|
+
createUsageApi,
|
|
2384
2430
|
createVoicesApi,
|
|
2385
2431
|
createWebhooksApi,
|
|
2386
2432
|
createWorkspacesApi,
|