@flashbacktech/flashbackclient 0.2.56 → 0.2.57
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/api/client.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { DeleteSettingsRequest, GetSettingsResponse, PartialUpdateSettingsReques
|
|
|
14
14
|
import { UpdateUserRoleResponse, UserRoleResponse } from './types/platform/roles';
|
|
15
15
|
import { UserProfileResponse } from './types/platform/roles';
|
|
16
16
|
import { CreateOrgUserRequest, CreateOrgUserResponse, DeleteOrgUserResponse, GetOrganizationResponse, ListOrgUsersResponse, OrgUserResponse, UpdateOrganizationBody, UpdateOrganizationResponse, UpdateOrgUserRequest, UpdateOrgUserResponse } from './types/platform/organization';
|
|
17
|
-
import { SystemEventQueryRequest, SystemEventQueryResponse } from './types/platform/systemevent';
|
|
17
|
+
import { SystemEventQueryRequest, SystemEventQueryResponse, SystemEventReadStatusResponse } from './types/platform/systemevent';
|
|
18
18
|
import { PreVerifyEmailResponse, UserUpdateRequest, UserUpdateResponse } from './types/platform/user';
|
|
19
19
|
import { CreateRepoAiApiKeyRequest, CreateRepoAiApiKeyResponse, DeleteRepoAiApiKeyResponse, GetRepoAiApiKeysResponse, UpdateRepoAiApiKeyRequest, UpdateRepoAiApiKeyResponse } from './types/ai/aiapikey';
|
|
20
20
|
import { AiLlmStatsResponse, CreateAiLlmRequest, CreateAiLlmResponse, DeleteAiLlmResponse, GetAiLlmsResponse, UpdateAiLlmRequest, UpdateAiLlmResponse, ValidateAiLlmResponse, GetAiModelsRequest, GetAiModelsResponse } from './types/ai/aillm';
|
|
@@ -235,6 +235,8 @@ export declare class ApiClient implements IApiClient {
|
|
|
235
235
|
nodeRegister: (data: RegisterRequest) => Promise<RegisterResponse>;
|
|
236
236
|
nodeUnregister: (data: RegisterRequest) => Promise<RegisterResponse>;
|
|
237
237
|
getSystemEvents: (data: SystemEventQueryRequest) => Promise<SystemEventQueryResponse>;
|
|
238
|
+
markSystemEventAsRead: (systemEventLogId: number) => Promise<SystemEventReadStatusResponse>;
|
|
239
|
+
markSystemEventAsUnread: (systemEventLogId: number) => Promise<SystemEventReadStatusResponse>;
|
|
238
240
|
createAiLlm: (data: CreateAiLlmRequest) => Promise<CreateAiLlmResponse>;
|
|
239
241
|
getAiLlms: (workspaceId?: string) => Promise<GetAiLlmsResponse>;
|
|
240
242
|
getAiLlmStats: (aiLlmId?: string) => Promise<AiLlmStatsResponse>;
|
package/dist/api/client.js
CHANGED
|
@@ -581,6 +581,12 @@ class ApiClient {
|
|
|
581
581
|
this.getSystemEvents = async (data) => {
|
|
582
582
|
return this.makeRequest('systemevent', 'POST', data);
|
|
583
583
|
};
|
|
584
|
+
this.markSystemEventAsRead = async (systemEventLogId) => {
|
|
585
|
+
return this.makeRequest(`systemevent/${systemEventLogId}/read`, 'POST', null);
|
|
586
|
+
};
|
|
587
|
+
this.markSystemEventAsUnread = async (systemEventLogId) => {
|
|
588
|
+
return this.makeRequest(`systemevent/${systemEventLogId}/read`, 'DELETE', null);
|
|
589
|
+
};
|
|
584
590
|
////// AI LLM API calls
|
|
585
591
|
this.createAiLlm = async (data) => {
|
|
586
592
|
return this.makeRequest('ai/llm', 'POST', data);
|
|
@@ -852,9 +858,7 @@ class ApiClient {
|
|
|
852
858
|
return this.makeRequest('credits/balance', 'GET', null);
|
|
853
859
|
};
|
|
854
860
|
this.getCreditsTransactions = async (query) => {
|
|
855
|
-
console.log('[ApiClient] getCreditsTransactions called', query);
|
|
856
861
|
const result = await this.makeRequest('credits/transactions', 'GET', query);
|
|
857
|
-
console.log('[ApiClient] getCreditsTransactions result', result);
|
|
858
862
|
return result;
|
|
859
863
|
};
|
|
860
864
|
/** Consumption = transactions with direction 'out' (backend uses same endpoint) */
|
|
@@ -872,9 +876,7 @@ class ApiClient {
|
|
|
872
876
|
};
|
|
873
877
|
/** Get aggregated monthly credit stats for histogram (consumption, purchases, grants, balance) */
|
|
874
878
|
this.getCreditsMonthlyStats = async (query) => {
|
|
875
|
-
console.log('[ApiClient] getCreditsMonthlyStats called', query);
|
|
876
879
|
const result = await this.makeRequest('credits/stats/monthly', 'GET', query ?? null);
|
|
877
|
-
console.log('[ApiClient] getCreditsMonthlyStats result', result);
|
|
878
880
|
return result;
|
|
879
881
|
};
|
|
880
882
|
this.baseURL = baseURL;
|
|
@@ -6,6 +6,8 @@ export interface SystemEventQueryRequest {
|
|
|
6
6
|
event?: number;
|
|
7
7
|
userId?: string;
|
|
8
8
|
workspaceId?: string;
|
|
9
|
+
/** When true, only return events the current user has not read. */
|
|
10
|
+
showUnread?: boolean;
|
|
9
11
|
skip: number;
|
|
10
12
|
take: number;
|
|
11
13
|
}
|
|
@@ -21,6 +23,8 @@ export interface SystemEventResponse {
|
|
|
21
23
|
userEmail: string;
|
|
22
24
|
workspaceId: string | null;
|
|
23
25
|
jsonData: string | null;
|
|
26
|
+
/** True when the current user has not read this event. */
|
|
27
|
+
showUnread: boolean;
|
|
24
28
|
}
|
|
25
29
|
export interface SystemEventQueryResponse {
|
|
26
30
|
events: SystemEventResponse[];
|
|
@@ -28,6 +32,10 @@ export interface SystemEventQueryResponse {
|
|
|
28
32
|
skip: number;
|
|
29
33
|
take: number;
|
|
30
34
|
}
|
|
35
|
+
/** Response for mark-as-read / mark-as-unread. */
|
|
36
|
+
export interface SystemEventReadStatusResponse {
|
|
37
|
+
success: boolean;
|
|
38
|
+
}
|
|
31
39
|
export declare class ContextTypeHelper {
|
|
32
40
|
static readonly contextTypes: readonly ["workspace", "bucket", "repo", "user", "org", "workspaceuser", "apikey", "usersettings", "orgsettings", "flashbacknode", "orgkey", "aillm", "aillmapikey", "conversation"];
|
|
33
41
|
/**
|