@flashbacktech/tsclient 0.4.44 → 0.4.47
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 +32 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +107 -2
- package/dist/index.d.ts +107 -2
- package/dist/index.js +32 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -816,6 +816,22 @@ var ChatSchedulesScope = class {
|
|
|
816
816
|
);
|
|
817
817
|
}
|
|
818
818
|
};
|
|
819
|
+
var ChatFeedbackScope = class {
|
|
820
|
+
constructor(http) {
|
|
821
|
+
this.http = http;
|
|
822
|
+
}
|
|
823
|
+
submit(scope, conversationId, body) {
|
|
824
|
+
return this.http.post(`${BASE_PATH}/${conversationId}/feedback`, {
|
|
825
|
+
body,
|
|
826
|
+
headers: scopeHeaders(scope)
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
list(scope, conversationId) {
|
|
830
|
+
return this.http.get(`${BASE_PATH}/${conversationId}/feedback`, {
|
|
831
|
+
headers: scopeHeaders(scope)
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
};
|
|
819
835
|
var ChatClient = class {
|
|
820
836
|
constructor(http, streamDeps) {
|
|
821
837
|
this.http = http;
|
|
@@ -825,6 +841,7 @@ var ChatClient = class {
|
|
|
825
841
|
this.questions = new ChatQuestionsScope(http);
|
|
826
842
|
this.debug = new ChatDebugScope(http);
|
|
827
843
|
this.schedules = new ChatSchedulesScope(http);
|
|
844
|
+
this.feedback = new ChatFeedbackScope(http);
|
|
828
845
|
}
|
|
829
846
|
openStream(options) {
|
|
830
847
|
return openChatStream(this.streamDeps, options);
|
|
@@ -1018,11 +1035,25 @@ var CreditsClient = class {
|
|
|
1018
1035
|
listTransactions(query = {}) {
|
|
1019
1036
|
return this.http.get("/credits/transactions", { query });
|
|
1020
1037
|
}
|
|
1021
|
-
/**
|
|
1038
|
+
/** Per-month credit activity (consumption / purchases / grants). */
|
|
1022
1039
|
async getMonthlyStats() {
|
|
1023
1040
|
const res = await this.http.get("/credits/stats/monthly");
|
|
1024
1041
|
return res.data ?? [];
|
|
1025
1042
|
}
|
|
1043
|
+
/** Fixed credit-pack catalog. Public endpoint. */
|
|
1044
|
+
async listPacks() {
|
|
1045
|
+
const res = await this.http.get("/credits/packs", { skipAuth: true });
|
|
1046
|
+
return res.data ?? [];
|
|
1047
|
+
}
|
|
1048
|
+
/**
|
|
1049
|
+
* Buy a fixed credit pack. Requires an active paid subscription
|
|
1050
|
+
* (the backend 403s free-tier orgs with SUBSCRIPTION_REQUIRED) and
|
|
1051
|
+
* caps purchases per pack per billing cycle. Returns a Stripe
|
|
1052
|
+
* Checkout URL to redirect to.
|
|
1053
|
+
*/
|
|
1054
|
+
buyPack(body) {
|
|
1055
|
+
return this.http.post("/credits/packs/buy", { body });
|
|
1056
|
+
}
|
|
1026
1057
|
/**
|
|
1027
1058
|
* "Other amount" PAYG config — bounds + presets for the
|
|
1028
1059
|
* arbitrary-dollar tile. Public endpoint; returns a disabled
|