@flashbacktech/flashbackclient 0.2.47 → 0.2.49
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
|
@@ -17,7 +17,7 @@ import { CreateOrgUserRequest, CreateOrgUserResponse, DeleteOrgUserResponse, Get
|
|
|
17
17
|
import { SystemEventQueryRequest, SystemEventQueryResponse } 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
|
-
import { AiLlmStatsResponse, CreateAiLlmRequest, CreateAiLlmResponse, DeleteAiLlmResponse, GetAiLlmsResponse, UpdateAiLlmRequest, UpdateAiLlmResponse, ValidateAiLlmResponse } from './types/ai/aillm';
|
|
20
|
+
import { AiLlmStatsResponse, CreateAiLlmRequest, CreateAiLlmResponse, DeleteAiLlmResponse, GetAiLlmsResponse, UpdateAiLlmRequest, UpdateAiLlmResponse, ValidateAiLlmResponse, GetAiModelsRequest, GetAiModelsResponse } from './types/ai/aillm';
|
|
21
21
|
import { CreatePolicyRequest, GetPoliciesQuery, GetPolicyViolationsQuery, GetPolicyViolationsResponse, GetPolicyAlertsQuery, GetPolicyAlertsResponse, PolicyDTO, UpdatePolicyRequest, PolicyValidationRequest, PolicyValidationResponse, PolicyRecommendationRequest, PolicyRecommendationResponse } from './types/ai/policy';
|
|
22
22
|
import { CreateConversationRequest, CreateConversationResponse, SendPromptRequest, SendPromptResponse, GetConversationsRequest, GetConversationsResponse, GetConversationMessagesResponse, GetConversationMessagesRequest, DeleteConversationRequest, DeleteConversationResponse } from './types/ai/conversation';
|
|
23
23
|
import { GetLinksRequest, GetLinksResponse, CreateLinkRequest, CreateLinkResponse, UpdateLinkRequest, UpdateLinkResponse, DeleteLinkResponse, GetLinkByTokenResponse } from './types/platform/links';
|
|
@@ -273,5 +273,6 @@ export declare class ApiClient implements IApiClient {
|
|
|
273
273
|
getPolicyAlertsByPolicyId: (policyId: string, query: Omit<GetPolicyAlertsQuery, "policyId">) => Promise<GetPolicyAlertsResponse>;
|
|
274
274
|
validatePolicies: (data: PolicyValidationRequest) => Promise<PolicyValidationResponse>;
|
|
275
275
|
recommendPolicies: (data: PolicyRecommendationRequest) => Promise<PolicyRecommendationResponse>;
|
|
276
|
+
getAiModels: (data: GetAiModelsRequest) => Promise<GetAiModelsResponse>;
|
|
276
277
|
}
|
|
277
278
|
export {};
|
package/dist/api/client.js
CHANGED
|
@@ -698,6 +698,21 @@ class ApiClient {
|
|
|
698
698
|
if (query.skip !== undefined) {
|
|
699
699
|
queryParams.append('skip', query.skip.toString());
|
|
700
700
|
}
|
|
701
|
+
if (query.llmType && query.llmType.length > 0) {
|
|
702
|
+
queryParams.append('llmType', query.llmType.join(','));
|
|
703
|
+
}
|
|
704
|
+
if (query.llmModel && query.llmModel.length > 0) {
|
|
705
|
+
queryParams.append('llmModel', query.llmModel.join(','));
|
|
706
|
+
}
|
|
707
|
+
if (query.host && query.host.length > 0) {
|
|
708
|
+
queryParams.append('host', query.host.join(','));
|
|
709
|
+
}
|
|
710
|
+
if (query.severity && query.severity.length > 0) {
|
|
711
|
+
queryParams.append('severity', query.severity.join(','));
|
|
712
|
+
}
|
|
713
|
+
if (query.block !== undefined) {
|
|
714
|
+
queryParams.append('block', query.block.toString());
|
|
715
|
+
}
|
|
701
716
|
return this.makeRequest(`policy/violations?${queryParams.toString()}`, 'GET', null);
|
|
702
717
|
};
|
|
703
718
|
this.getPolicyViolationsByPolicyId = async (policyId, query) => {
|
|
@@ -720,6 +735,21 @@ class ApiClient {
|
|
|
720
735
|
if (query.skip !== undefined) {
|
|
721
736
|
queryParams.append('skip', query.skip.toString());
|
|
722
737
|
}
|
|
738
|
+
if (query.llmType && query.llmType.length > 0) {
|
|
739
|
+
queryParams.append('llmType', query.llmType.join(','));
|
|
740
|
+
}
|
|
741
|
+
if (query.llmModel && query.llmModel.length > 0) {
|
|
742
|
+
queryParams.append('llmModel', query.llmModel.join(','));
|
|
743
|
+
}
|
|
744
|
+
if (query.host && query.host.length > 0) {
|
|
745
|
+
queryParams.append('host', query.host.join(','));
|
|
746
|
+
}
|
|
747
|
+
if (query.severity && query.severity.length > 0) {
|
|
748
|
+
queryParams.append('severity', query.severity.join(','));
|
|
749
|
+
}
|
|
750
|
+
if (query.block !== undefined) {
|
|
751
|
+
queryParams.append('block', query.block.toString());
|
|
752
|
+
}
|
|
723
753
|
return this.makeRequest(`policy/${policyId}/violations${queryParams.toString() ? `?${queryParams.toString()}` : ''}`, 'GET', null);
|
|
724
754
|
};
|
|
725
755
|
this.getPolicyAlerts = async (query) => {
|
|
@@ -745,6 +775,15 @@ class ApiClient {
|
|
|
745
775
|
if (query.skip !== undefined) {
|
|
746
776
|
queryParams.append('skip', query.skip.toString());
|
|
747
777
|
}
|
|
778
|
+
if (query.llmType && query.llmType.length > 0) {
|
|
779
|
+
queryParams.append('llmType', query.llmType.join(','));
|
|
780
|
+
}
|
|
781
|
+
if (query.llmModel && query.llmModel.length > 0) {
|
|
782
|
+
queryParams.append('llmModel', query.llmModel.join(','));
|
|
783
|
+
}
|
|
784
|
+
if (query.host && query.host.length > 0) {
|
|
785
|
+
queryParams.append('host', query.host.join(','));
|
|
786
|
+
}
|
|
748
787
|
return this.makeRequest(`policy/alerts?${queryParams.toString()}`, 'GET', null);
|
|
749
788
|
};
|
|
750
789
|
this.getPolicyAlertsByPolicyId = async (policyId, query) => {
|
|
@@ -767,6 +806,15 @@ class ApiClient {
|
|
|
767
806
|
if (query.skip !== undefined) {
|
|
768
807
|
queryParams.append('skip', query.skip.toString());
|
|
769
808
|
}
|
|
809
|
+
if (query.llmType && query.llmType.length > 0) {
|
|
810
|
+
queryParams.append('llmType', query.llmType.join(','));
|
|
811
|
+
}
|
|
812
|
+
if (query.llmModel && query.llmModel.length > 0) {
|
|
813
|
+
queryParams.append('llmModel', query.llmModel.join(','));
|
|
814
|
+
}
|
|
815
|
+
if (query.host && query.host.length > 0) {
|
|
816
|
+
queryParams.append('host', query.host.join(','));
|
|
817
|
+
}
|
|
770
818
|
return this.makeRequest(`policy/${policyId}/alerts${queryParams.toString() ? `?${queryParams.toString()}` : ''}`, 'GET', null);
|
|
771
819
|
};
|
|
772
820
|
this.validatePolicies = async (data) => {
|
|
@@ -775,6 +823,9 @@ class ApiClient {
|
|
|
775
823
|
this.recommendPolicies = async (data) => {
|
|
776
824
|
return this.makeRequest('policy/recommend', 'POST', data);
|
|
777
825
|
};
|
|
826
|
+
this.getAiModels = async (data) => {
|
|
827
|
+
return this.makeRequest('ai/models', 'POST', data);
|
|
828
|
+
};
|
|
778
829
|
this.baseURL = baseURL;
|
|
779
830
|
this.headers = {};
|
|
780
831
|
this.debug = false;
|
|
@@ -866,6 +917,12 @@ class ApiClient {
|
|
|
866
917
|
if (params.hosts && params.hosts.length > 0) {
|
|
867
918
|
queryParams.append('hosts', params.hosts.join(','));
|
|
868
919
|
}
|
|
920
|
+
if (params.llmType && params.llmType.length > 0) {
|
|
921
|
+
queryParams.append('llmType', params.llmType.join(','));
|
|
922
|
+
}
|
|
923
|
+
if (params.llmModel && params.llmModel.length > 0) {
|
|
924
|
+
queryParams.append('llmModel', params.llmModel.join(','));
|
|
925
|
+
}
|
|
869
926
|
return this.makeRequest(`aistats/daily?${queryParams.toString()}`, 'GET', null);
|
|
870
927
|
}
|
|
871
928
|
async getAiStatsMinute(params) {
|
|
@@ -888,6 +945,12 @@ class ApiClient {
|
|
|
888
945
|
if (params.hosts && params.hosts.length > 0) {
|
|
889
946
|
queryParams.append('hosts', params.hosts.join(','));
|
|
890
947
|
}
|
|
948
|
+
if (params.llmType && params.llmType.length > 0) {
|
|
949
|
+
queryParams.append('llmType', params.llmType.join(','));
|
|
950
|
+
}
|
|
951
|
+
if (params.llmModel && params.llmModel.length > 0) {
|
|
952
|
+
queryParams.append('llmModel', params.llmModel.join(','));
|
|
953
|
+
}
|
|
891
954
|
return this.makeRequest(`aistats/minute?${queryParams.toString()}`, 'GET', null);
|
|
892
955
|
}
|
|
893
956
|
async getNodeStatsMinute(params) {
|
|
@@ -77,3 +77,20 @@ export interface RepoAiLlmInfo {
|
|
|
77
77
|
aiLlmId?: string;
|
|
78
78
|
aiLlm?: AiLlmDTO;
|
|
79
79
|
}
|
|
80
|
+
export interface GetAiModelsRequest {
|
|
81
|
+
repoId: string;
|
|
82
|
+
aiType?: AiType;
|
|
83
|
+
llmType?: string;
|
|
84
|
+
}
|
|
85
|
+
export interface AiModelDTO {
|
|
86
|
+
id: string;
|
|
87
|
+
name: string;
|
|
88
|
+
created?: number;
|
|
89
|
+
aiType: AiType;
|
|
90
|
+
llmType: string;
|
|
91
|
+
llmProvider: string;
|
|
92
|
+
}
|
|
93
|
+
export interface GetAiModelsResponse {
|
|
94
|
+
success: boolean;
|
|
95
|
+
models: AiModelDTO[];
|
|
96
|
+
}
|
|
@@ -63,6 +63,11 @@ export interface GetPolicyViolationsQuery {
|
|
|
63
63
|
to?: string;
|
|
64
64
|
take?: number;
|
|
65
65
|
skip?: number;
|
|
66
|
+
llmType?: string[];
|
|
67
|
+
llmModel?: string[];
|
|
68
|
+
host?: string[];
|
|
69
|
+
severity?: RiskType[];
|
|
70
|
+
block?: boolean;
|
|
66
71
|
}
|
|
67
72
|
export interface PolicyViolationDTO {
|
|
68
73
|
id: string;
|
|
@@ -77,6 +82,11 @@ export interface PolicyViolationDTO {
|
|
|
77
82
|
userName: string;
|
|
78
83
|
repoAiApiKeyId: string;
|
|
79
84
|
repoAiApiKeyName: string;
|
|
85
|
+
severity: RiskType | null;
|
|
86
|
+
block: boolean;
|
|
87
|
+
llmType: string;
|
|
88
|
+
llmModel: string;
|
|
89
|
+
host: string;
|
|
80
90
|
}
|
|
81
91
|
export interface GetPolicyViolationsResponse {
|
|
82
92
|
success: boolean;
|
|
@@ -93,6 +103,9 @@ export interface GetPolicyAlertsQuery {
|
|
|
93
103
|
to?: string;
|
|
94
104
|
take?: number;
|
|
95
105
|
skip?: number;
|
|
106
|
+
llmType?: string[];
|
|
107
|
+
llmModel?: string[];
|
|
108
|
+
host?: string[];
|
|
96
109
|
}
|
|
97
110
|
export interface PolicyAlertDTO {
|
|
98
111
|
id: string;
|
|
@@ -107,6 +120,9 @@ export interface PolicyAlertDTO {
|
|
|
107
120
|
userName: string;
|
|
108
121
|
repoAiApiKeyId: string;
|
|
109
122
|
repoAiApiKeyName: string;
|
|
123
|
+
llmType: string;
|
|
124
|
+
llmModel: string;
|
|
125
|
+
host: string;
|
|
110
126
|
}
|
|
111
127
|
export interface GetPolicyAlertsResponse {
|
|
112
128
|
success: boolean;
|
|
@@ -5,6 +5,8 @@ export interface AiStatsQueryParams {
|
|
|
5
5
|
aiLlmId?: string[];
|
|
6
6
|
repoAiApiKeyId?: string[];
|
|
7
7
|
hosts?: string[];
|
|
8
|
+
llmType?: string[];
|
|
9
|
+
llmModel?: string[];
|
|
8
10
|
}
|
|
9
11
|
export interface AiStatsResponse {
|
|
10
12
|
success: boolean;
|
|
@@ -25,6 +27,9 @@ export interface AiStatsData {
|
|
|
25
27
|
policyViolations: number;
|
|
26
28
|
numAlerts: number;
|
|
27
29
|
numBlocks: number;
|
|
30
|
+
numSeverityLow: number;
|
|
31
|
+
numSeverityMedium: number;
|
|
32
|
+
numSeverityHigh: number;
|
|
28
33
|
latency_ms: number;
|
|
29
34
|
llmType: string;
|
|
30
35
|
llmModel: string;
|