@flashbacktech/tsclient 0.4.46 → 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 +15 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +60 -2
- package/dist/index.d.ts +60 -2
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1035,11 +1035,25 @@ var CreditsClient = class {
|
|
|
1035
1035
|
listTransactions(query = {}) {
|
|
1036
1036
|
return this.http.get("/credits/transactions", { query });
|
|
1037
1037
|
}
|
|
1038
|
-
/**
|
|
1038
|
+
/** Per-month credit activity (consumption / purchases / grants). */
|
|
1039
1039
|
async getMonthlyStats() {
|
|
1040
1040
|
const res = await this.http.get("/credits/stats/monthly");
|
|
1041
1041
|
return res.data ?? [];
|
|
1042
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
|
+
}
|
|
1043
1057
|
/**
|
|
1044
1058
|
* "Other amount" PAYG config — bounds + presets for the
|
|
1045
1059
|
* arbitrary-dollar tile. Public endpoint; returns a disabled
|