@flashbacktech/tsclient 0.4.42 → 0.4.46
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 +52 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +119 -1
- package/dist/index.d.ts +119 -1
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -302,6 +302,41 @@ var OrganizationClient = class {
|
|
|
302
302
|
const res = await this.http.patch(`/orgs/${orgId}/allow-debug`, { body: { allow } });
|
|
303
303
|
return res.data;
|
|
304
304
|
}
|
|
305
|
+
/**
|
|
306
|
+
* Platform-admin only: add a new member to an existing org.
|
|
307
|
+
* Creates the user without a password and sends an invite email via the
|
|
308
|
+
* same TokenOrgInvite flow as the regular member invite.
|
|
309
|
+
* Returns 403 unless platform admin; 409 when the email already exists.
|
|
310
|
+
*/
|
|
311
|
+
async addUserToOrg(orgId, body) {
|
|
312
|
+
const res = await this.http.post(
|
|
313
|
+
`/orgs/${orgId}/users`,
|
|
314
|
+
{ body }
|
|
315
|
+
);
|
|
316
|
+
return unwrapData(res);
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Platform-admin only: fetch an org's two-bucket credit balance.
|
|
320
|
+
* Returns 403 unless platform admin; 404 when the org doesn't exist.
|
|
321
|
+
*/
|
|
322
|
+
async getOrgCreditBalance(orgId) {
|
|
323
|
+
const res = await this.http.get(
|
|
324
|
+
`/orgs/${orgId}/credits`
|
|
325
|
+
);
|
|
326
|
+
return unwrapData(res);
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Platform-admin only: grant or revoke credits on an org.
|
|
330
|
+
* amountMicros is signed: positive = grant, negative = revoke.
|
|
331
|
+
* Records a CreditKindAdminAdjust ledger entry and returns the updated balance.
|
|
332
|
+
*/
|
|
333
|
+
async adjustOrgCredits(orgId, body) {
|
|
334
|
+
const res = await this.http.post(
|
|
335
|
+
`/orgs/${orgId}/credits/adjust`,
|
|
336
|
+
{ body }
|
|
337
|
+
);
|
|
338
|
+
return unwrapData(res);
|
|
339
|
+
}
|
|
305
340
|
};
|
|
306
341
|
|
|
307
342
|
// src/adapters/projectAdapter.ts
|
|
@@ -781,6 +816,22 @@ var ChatSchedulesScope = class {
|
|
|
781
816
|
);
|
|
782
817
|
}
|
|
783
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
|
+
};
|
|
784
835
|
var ChatClient = class {
|
|
785
836
|
constructor(http, streamDeps) {
|
|
786
837
|
this.http = http;
|
|
@@ -790,6 +841,7 @@ var ChatClient = class {
|
|
|
790
841
|
this.questions = new ChatQuestionsScope(http);
|
|
791
842
|
this.debug = new ChatDebugScope(http);
|
|
792
843
|
this.schedules = new ChatSchedulesScope(http);
|
|
844
|
+
this.feedback = new ChatFeedbackScope(http);
|
|
793
845
|
}
|
|
794
846
|
openStream(options) {
|
|
795
847
|
return openChatStream(this.streamDeps, options);
|