@soat/sdk 0.14.0 → 0.14.1
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 +131 -2
- package/dist/index.d.cts +586 -25
- package/dist/index.d.mts +586 -25
- package/dist/index.mjs +131 -3
- package/package.json +7 -9
package/dist/index.mjs
CHANGED
|
@@ -106,7 +106,8 @@ function createSseClient({ onRequest, onSseError, onSseEvent, responseTransforme
|
|
|
106
106
|
} catch (error) {
|
|
107
107
|
onSseError?.(error);
|
|
108
108
|
if (sseMaxRetryAttempts !== void 0 && attempt >= sseMaxRetryAttempts) break;
|
|
109
|
-
|
|
109
|
+
const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 3e4);
|
|
110
|
+
await sleep(backoff);
|
|
110
111
|
}
|
|
111
112
|
}
|
|
112
113
|
};
|
|
@@ -2458,7 +2459,8 @@ var Sessions = class {
|
|
|
2458
2459
|
/**
|
|
2459
2460
|
* Delete a session
|
|
2460
2461
|
*
|
|
2461
|
-
* Deletes the session and its underlying conversation and
|
|
2462
|
+
* Deletes the session and its underlying conversation and messages. The session's actor is not deleted. Generations and traces produced by the session are not deleted either, since they are not linked to the session or conversation.
|
|
2463
|
+
*
|
|
2462
2464
|
*/
|
|
2463
2465
|
static deleteSession(options) {
|
|
2464
2466
|
return (options.client ?? client).delete({
|
|
@@ -2701,6 +2703,130 @@ var Traces = class {
|
|
|
2701
2703
|
});
|
|
2702
2704
|
}
|
|
2703
2705
|
};
|
|
2706
|
+
var Triggers = class {
|
|
2707
|
+
/**
|
|
2708
|
+
* List triggers
|
|
2709
|
+
*
|
|
2710
|
+
* Lists triggers. Filter by project, starter type, or target type.
|
|
2711
|
+
*/
|
|
2712
|
+
static listTriggers(options) {
|
|
2713
|
+
return (options?.client ?? client).get({
|
|
2714
|
+
url: "/api/v1/triggers",
|
|
2715
|
+
...options
|
|
2716
|
+
});
|
|
2717
|
+
}
|
|
2718
|
+
/**
|
|
2719
|
+
* Create a trigger
|
|
2720
|
+
*
|
|
2721
|
+
* Creates a new trigger for a project
|
|
2722
|
+
*/
|
|
2723
|
+
static createTrigger(options) {
|
|
2724
|
+
return (options.client ?? client).post({
|
|
2725
|
+
url: "/api/v1/triggers",
|
|
2726
|
+
...options,
|
|
2727
|
+
headers: {
|
|
2728
|
+
"Content-Type": "application/json",
|
|
2729
|
+
...options.headers
|
|
2730
|
+
}
|
|
2731
|
+
});
|
|
2732
|
+
}
|
|
2733
|
+
/**
|
|
2734
|
+
* Delete a trigger
|
|
2735
|
+
*
|
|
2736
|
+
* Deletes a trigger
|
|
2737
|
+
*/
|
|
2738
|
+
static deleteTrigger(options) {
|
|
2739
|
+
return (options.client ?? client).delete({
|
|
2740
|
+
url: "/api/v1/triggers/{trigger_id}",
|
|
2741
|
+
...options
|
|
2742
|
+
});
|
|
2743
|
+
}
|
|
2744
|
+
/**
|
|
2745
|
+
* Get a trigger
|
|
2746
|
+
*
|
|
2747
|
+
* Retrieves the details of a specific trigger
|
|
2748
|
+
*/
|
|
2749
|
+
static getTrigger(options) {
|
|
2750
|
+
return (options.client ?? client).get({
|
|
2751
|
+
url: "/api/v1/triggers/{trigger_id}",
|
|
2752
|
+
...options
|
|
2753
|
+
});
|
|
2754
|
+
}
|
|
2755
|
+
/**
|
|
2756
|
+
* Update a trigger
|
|
2757
|
+
*
|
|
2758
|
+
* Updates an existing trigger's configuration. The type is immutable.
|
|
2759
|
+
*/
|
|
2760
|
+
static updateTrigger(options) {
|
|
2761
|
+
return (options.client ?? client).patch({
|
|
2762
|
+
url: "/api/v1/triggers/{trigger_id}",
|
|
2763
|
+
...options,
|
|
2764
|
+
headers: {
|
|
2765
|
+
"Content-Type": "application/json",
|
|
2766
|
+
...options.headers
|
|
2767
|
+
}
|
|
2768
|
+
});
|
|
2769
|
+
}
|
|
2770
|
+
/**
|
|
2771
|
+
* Fire a trigger
|
|
2772
|
+
*
|
|
2773
|
+
* Fires a trigger synchronously and returns the terminal firing record.
|
|
2774
|
+
*/
|
|
2775
|
+
static fireTrigger(options) {
|
|
2776
|
+
return (options.client ?? client).post({
|
|
2777
|
+
url: "/api/v1/triggers/{trigger_id}/fire",
|
|
2778
|
+
...options,
|
|
2779
|
+
headers: {
|
|
2780
|
+
"Content-Type": "application/json",
|
|
2781
|
+
...options.headers
|
|
2782
|
+
}
|
|
2783
|
+
});
|
|
2784
|
+
}
|
|
2785
|
+
/**
|
|
2786
|
+
* Get trigger secret
|
|
2787
|
+
*
|
|
2788
|
+
* Retrieves the signing secret for a webhook trigger
|
|
2789
|
+
*/
|
|
2790
|
+
static getTriggerSecret(options) {
|
|
2791
|
+
return (options.client ?? client).get({
|
|
2792
|
+
url: "/api/v1/triggers/{trigger_id}/secret",
|
|
2793
|
+
...options
|
|
2794
|
+
});
|
|
2795
|
+
}
|
|
2796
|
+
/**
|
|
2797
|
+
* Rotate trigger secret
|
|
2798
|
+
*
|
|
2799
|
+
* Rotates the signing secret for a webhook trigger
|
|
2800
|
+
*/
|
|
2801
|
+
static rotateTriggerSecret(options) {
|
|
2802
|
+
return (options.client ?? client).post({
|
|
2803
|
+
url: "/api/v1/triggers/{trigger_id}/rotate-secret",
|
|
2804
|
+
...options
|
|
2805
|
+
});
|
|
2806
|
+
}
|
|
2807
|
+
/**
|
|
2808
|
+
* List trigger firings
|
|
2809
|
+
*
|
|
2810
|
+
* Lists firings for a trigger (trigger_id is required).
|
|
2811
|
+
*/
|
|
2812
|
+
static listTriggerFirings(options) {
|
|
2813
|
+
return (options.client ?? client).get({
|
|
2814
|
+
url: "/api/v1/trigger-firings",
|
|
2815
|
+
...options
|
|
2816
|
+
});
|
|
2817
|
+
}
|
|
2818
|
+
/**
|
|
2819
|
+
* Get a trigger firing
|
|
2820
|
+
*
|
|
2821
|
+
* Retrieves the details of a specific trigger firing
|
|
2822
|
+
*/
|
|
2823
|
+
static getTriggerFiring(options) {
|
|
2824
|
+
return (options.client ?? client).get({
|
|
2825
|
+
url: "/api/v1/trigger-firings/{firing_id}",
|
|
2826
|
+
...options
|
|
2827
|
+
});
|
|
2828
|
+
}
|
|
2829
|
+
};
|
|
2704
2830
|
var Users = class {
|
|
2705
2831
|
/**
|
|
2706
2832
|
* Get the current authenticated user
|
|
@@ -2979,6 +3105,7 @@ var SoatClient = class {
|
|
|
2979
3105
|
sessions;
|
|
2980
3106
|
tools;
|
|
2981
3107
|
traces;
|
|
3108
|
+
triggers;
|
|
2982
3109
|
users;
|
|
2983
3110
|
webhooks;
|
|
2984
3111
|
constructor({ baseUrl, token, headers } = {}) {
|
|
@@ -3009,9 +3136,10 @@ var SoatClient = class {
|
|
|
3009
3136
|
this.sessions = bindResource(Sessions, httpClient);
|
|
3010
3137
|
this.tools = bindResource(Tools, httpClient);
|
|
3011
3138
|
this.traces = bindResource(Traces, httpClient);
|
|
3139
|
+
this.triggers = bindResource(Triggers, httpClient);
|
|
3012
3140
|
this.users = bindResource(Users, httpClient);
|
|
3013
3141
|
this.webhooks = bindResource(Webhooks, httpClient);
|
|
3014
3142
|
}
|
|
3015
3143
|
};
|
|
3016
3144
|
//#endregion
|
|
3017
|
-
export { Actors, Agents, AiProviders, ApiKeys, Chats, Conversations, Discussions, Documents, Embeddings, Files, Formations, Generations, IngestionRules, Knowledge, Memories, MemoryEntries, Orchestrations, Policies, Projects, Secrets, Sessions, SoatClient, Tools, Traces, Users, Webhooks, createClient, createConfig };
|
|
3145
|
+
export { Actors, Agents, AiProviders, ApiKeys, Chats, Conversations, Discussions, Documents, Embeddings, Files, Formations, Generations, IngestionRules, Knowledge, Memories, MemoryEntries, Orchestrations, Policies, Projects, Secrets, Sessions, SoatClient, Tools, Traces, Triggers, Users, Webhooks, createClient, createConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soat/sdk",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "TypeScript SDK for the SOAT API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -29,14 +29,12 @@
|
|
|
29
29
|
"provenance": true
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@hey-api/
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"tsdown": "^0.22.1",
|
|
39
|
-
"tsx": "^4.22.4"
|
|
32
|
+
"@hey-api/openapi-ts": "^0.99.0",
|
|
33
|
+
"@ttoss/config": "^1.37.17",
|
|
34
|
+
"@types/node": "^24.13.2",
|
|
35
|
+
"js-yaml": "^5.2.1",
|
|
36
|
+
"tsdown": "^0.22.3",
|
|
37
|
+
"tsx": "^4.23.0"
|
|
40
38
|
},
|
|
41
39
|
"scripts": {
|
|
42
40
|
"build": "pnpm generate && tsdown",
|