@getsupervisor/agents-studio-sdk 1.41.1-beta.167 → 1.41.1-beta.169
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 +36 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +71 -10
- package/dist/index.d.ts +71 -10
- package/dist/index.js +35 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -51,6 +51,7 @@ __export(index_exports, {
|
|
|
51
51
|
createClient: () => createClient,
|
|
52
52
|
createDocumentsApi: () => createDocumentsApi,
|
|
53
53
|
createHttp: () => createHttp,
|
|
54
|
+
createMessageTemplatesApi: () => createMessageTemplatesApi,
|
|
54
55
|
createSipTrunksApi: () => createSipTrunksApi,
|
|
55
56
|
createToolsApi: () => createToolsApi,
|
|
56
57
|
createUsageApi: () => createUsageApi,
|
|
@@ -1842,6 +1843,39 @@ function createDocumentsApi(cfg) {
|
|
|
1842
1843
|
};
|
|
1843
1844
|
}
|
|
1844
1845
|
|
|
1846
|
+
// src/api/message-templates.ts
|
|
1847
|
+
function createMessageTemplatesApi(cfg) {
|
|
1848
|
+
const { base, doFetch } = createHttp(cfg);
|
|
1849
|
+
const jsonHeaders = { "content-type": "application/json" };
|
|
1850
|
+
return {
|
|
1851
|
+
async getConnection() {
|
|
1852
|
+
const res = await doFetch(`${base}/message-templates/connection`, {
|
|
1853
|
+
method: "GET"
|
|
1854
|
+
});
|
|
1855
|
+
return res.json();
|
|
1856
|
+
},
|
|
1857
|
+
async list(channel) {
|
|
1858
|
+
const query = buildSearchParams([["channel", channel]]);
|
|
1859
|
+
const res = await doFetch(`${base}/message-templates`, {
|
|
1860
|
+
method: "GET",
|
|
1861
|
+
query
|
|
1862
|
+
});
|
|
1863
|
+
return res.json();
|
|
1864
|
+
},
|
|
1865
|
+
async create(payload) {
|
|
1866
|
+
const res = await doFetch(`${base}/message-templates`, {
|
|
1867
|
+
method: "POST",
|
|
1868
|
+
body: JSON.stringify(payload),
|
|
1869
|
+
headers: jsonHeaders
|
|
1870
|
+
});
|
|
1871
|
+
return res.json();
|
|
1872
|
+
},
|
|
1873
|
+
async remove(id) {
|
|
1874
|
+
await doFetch(`${base}/message-templates/${id}`, { method: "DELETE" });
|
|
1875
|
+
}
|
|
1876
|
+
};
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1845
1879
|
// src/api/sip-trunks.ts
|
|
1846
1880
|
function createSipTrunksApi(cfg) {
|
|
1847
1881
|
const { base, doFetch } = createHttp(cfg);
|
|
@@ -2051,21 +2085,14 @@ function createToolsApi(cfg) {
|
|
|
2051
2085
|
}
|
|
2052
2086
|
);
|
|
2053
2087
|
return res.json();
|
|
2054
|
-
},
|
|
2055
|
-
async deleteConnection(toolAgentConnectionId) {
|
|
2056
|
-
await doFetch(`${base}/tools/connections/${toolAgentConnectionId}`, {
|
|
2057
|
-
method: "DELETE"
|
|
2058
|
-
});
|
|
2059
2088
|
}
|
|
2060
2089
|
};
|
|
2061
2090
|
const connections = {
|
|
2062
2091
|
connect: api.connect,
|
|
2063
2092
|
create: api.createConnection,
|
|
2064
|
-
delete: api.deleteConnection,
|
|
2065
2093
|
execute: api.executeConnection,
|
|
2066
2094
|
list: api.listConnections,
|
|
2067
2095
|
createConnection: api.createConnection,
|
|
2068
|
-
deleteConnection: api.deleteConnection,
|
|
2069
2096
|
executeConnection: api.executeConnection
|
|
2070
2097
|
};
|
|
2071
2098
|
return {
|
|
@@ -2661,6 +2688,7 @@ function createClient(initialCfg) {
|
|
|
2661
2688
|
templates: catalogTemplatesApi
|
|
2662
2689
|
},
|
|
2663
2690
|
documents: createDocumentsApi(runtimeCfg),
|
|
2691
|
+
messageTemplates: createMessageTemplatesApi(runtimeCfg),
|
|
2664
2692
|
campaigns: createCampaignsApi(runtimeCfg),
|
|
2665
2693
|
voices: voicesApi,
|
|
2666
2694
|
apiKeys: apiKeysApi,
|
|
@@ -2759,6 +2787,7 @@ function createClient(initialCfg) {
|
|
|
2759
2787
|
createClient,
|
|
2760
2788
|
createDocumentsApi,
|
|
2761
2789
|
createHttp,
|
|
2790
|
+
createMessageTemplatesApi,
|
|
2762
2791
|
createSipTrunksApi,
|
|
2763
2792
|
createToolsApi,
|
|
2764
2793
|
createUsageApi,
|