@flashbacktech/flashbackclient 0.2.20 → 0.2.22
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CreateRepoRequest, CreateRepoResponse, CreateRepoKeyRequest, CreateRepoKeyResponse, GetReposResponse, GetRepoKeysResponse, ActionResponse, UpdateRepoRequest, UpdateRepoResponse, UpdateRepoKeyRequest, UpdateRepoKeyResponse, ValidateRepoUnitsRequest, ValidateRepoUnitsResponse, CreateBucketRequest, CreateBucketResponse, UpdateBucketRequest, UpdateBucketResponse, ValidateBucketRequest, ValidateBucketResponse, StorageBucket, GetBucketsResponse, StorageBucketStatusResponse, GetBucketNodeStatsRequest, GetBucketNodeStatsResponse, CreateRepoWithBucketsRequest, UpdateRepoWithBucketsRequest, ValidateRepoBucketsRequest, ValidateRepoBucketsResponse } from './types/storage/storage';
|
|
2
2
|
import { IApiClient, ProviderType } from './interfaces';
|
|
3
|
-
import { ActivateResponse, DeactivateResponse, LoginBody, LoginResponse, LogoutResponse, OAuth2ResponseDTO, RefreshTokenErrorResponse, RefreshTokenResponse, RegisterBody, RegisterResponse, ResetPasswordBody, Web3RegisterBody } from './types/platform/auth';
|
|
3
|
+
import { ActivateResponse, DeactivateResponse, DemoRequestBody, DemoRequestResponse, LoginBody, LoginResponse, LogoutResponse, OAuth2ResponseDTO, RefreshTokenErrorResponse, RefreshTokenResponse, RegisterBody, RegisterResponse, ResetPasswordBody, Web3RegisterBody } from './types/platform/auth';
|
|
4
4
|
import { StatsQueryParams, StatsResponse, NodeStatsMinuteResponse, NodeStatsDailyResponse, NodeStatsQueryParams, UnitStatsResponse, RepoStatsResponse, NodeStatsDailyQueryParams, BucketStatsResponse, StatsQueryWithBucketParams, NodeStatsQueryWithBucketParams, NodeStatsDailyQueryWithBucketParams } from './types/storage/stats';
|
|
5
5
|
import { NodeInfoResponse, RegisterRequest } from './types/storage/bridge';
|
|
6
6
|
import { GetOrganizationKeysResponse } from './types/storage/noderegistration';
|
|
@@ -17,7 +17,7 @@ import { SystemEventQueryRequest, SystemEventQueryResponse } from './types/platf
|
|
|
17
17
|
import { UserUpdateRequest, UserUpdateResponse } from './types/platform/user';
|
|
18
18
|
import { CreateRepoAiApiKeyRequest, CreateRepoAiApiKeyResponse, DeleteRepoAiApiKeyResponse, GetRepoAiApiKeysResponse, UpdateRepoAiApiKeyRequest, UpdateRepoAiApiKeyResponse } from './types/ai/aiapikey';
|
|
19
19
|
import { AiLlmStatsResponse, CreateAiLlmRequest, CreateAiLlmResponse, DeleteAiLlmResponse, GetAiLlmsResponse, UpdateAiLlmRequest, UpdateAiLlmResponse, ValidateAiLlmResponse } from './types/ai/aillm';
|
|
20
|
-
import { CreatePolicyRequest, GetPoliciesQuery, GetPolicyViolationsQuery, GetPolicyViolationsResponse, PolicyDTO, UpdatePolicyRequest } from './types/ai/policy';
|
|
20
|
+
import { CreatePolicyRequest, GetPoliciesQuery, GetPolicyViolationsQuery, GetPolicyViolationsResponse, PolicyDTO, UpdatePolicyRequest, PolicyValidationRequest, PolicyValidationResponse, PolicyRecommendationRequest, PolicyRecommendationResponse } from './types/ai/policy';
|
|
21
21
|
import { CreateConversationRequest, CreateConversationResponse, SendPromptRequest, SendPromptResponse, GetConversationsRequest, GetConversationsResponse, GetConversationMessagesResponse, GetConversationMessagesRequest } from './types/ai/conversation';
|
|
22
22
|
interface ErrorResponse {
|
|
23
23
|
message?: string;
|
|
@@ -99,6 +99,7 @@ export declare class ApiClient implements IApiClient {
|
|
|
99
99
|
updateUser: (userId: string, data: UserUpdateRequest) => Promise<UserUpdateResponse>;
|
|
100
100
|
requestPasswordReset: (email: string) => Promise<ActionResponse>;
|
|
101
101
|
resetPassword: (data: ResetPasswordBody) => Promise<ActionResponse>;
|
|
102
|
+
requestDemo: (data: DemoRequestBody) => Promise<DemoRequestResponse>;
|
|
102
103
|
private validateDateRange;
|
|
103
104
|
getDailyStats(params: StatsQueryParams): Promise<StatsResponse>;
|
|
104
105
|
getDailyStats(params: StatsQueryWithBucketParams): Promise<StatsResponse>;
|
|
@@ -254,5 +255,7 @@ export declare class ApiClient implements IApiClient {
|
|
|
254
255
|
deletePolicy: (policyId: string) => Promise<ActionResponse>;
|
|
255
256
|
getPolicyViolations: (query: GetPolicyViolationsQuery) => Promise<GetPolicyViolationsResponse>;
|
|
256
257
|
getPolicyViolationsByPolicyId: (policyId: string, query: Omit<GetPolicyViolationsQuery, "policyId">) => Promise<GetPolicyViolationsResponse>;
|
|
258
|
+
validatePolicies: (data: PolicyValidationRequest) => Promise<PolicyValidationResponse>;
|
|
259
|
+
recommendPolicies: (data: PolicyRecommendationRequest) => Promise<PolicyRecommendationResponse>;
|
|
257
260
|
}
|
|
258
261
|
export {};
|
package/dist/api/client.js
CHANGED
|
@@ -240,6 +240,9 @@ class ApiClient {
|
|
|
240
240
|
this.resetPassword = async (data) => {
|
|
241
241
|
return this.makeRequest('user/reset-password', 'POST', data);
|
|
242
242
|
};
|
|
243
|
+
this.requestDemo = async (data) => {
|
|
244
|
+
return this.makeRequest('demo/request', 'POST', data);
|
|
245
|
+
};
|
|
243
246
|
this.getRepoStats = async (params) => {
|
|
244
247
|
const queryParams = new URLSearchParams();
|
|
245
248
|
if (params && params.repoId && params.repoId.length > 0) {
|
|
@@ -652,6 +655,12 @@ class ApiClient {
|
|
|
652
655
|
}
|
|
653
656
|
return this.makeRequest(`policy/${policyId}/violations${queryParams.toString() ? `?${queryParams.toString()}` : ''}`, 'GET', null);
|
|
654
657
|
};
|
|
658
|
+
this.validatePolicies = async (data) => {
|
|
659
|
+
return this.makeRequest('policy/validate', 'POST', data);
|
|
660
|
+
};
|
|
661
|
+
this.recommendPolicies = async (data) => {
|
|
662
|
+
return this.makeRequest('policy/recommend', 'POST', data);
|
|
663
|
+
};
|
|
655
664
|
this.baseURL = baseURL;
|
|
656
665
|
this.headers = {};
|
|
657
666
|
this.debug = false;
|
|
@@ -85,3 +85,42 @@ export interface GetPolicyViolationsResponse {
|
|
|
85
85
|
skip: number;
|
|
86
86
|
take: number;
|
|
87
87
|
}
|
|
88
|
+
export interface PolicyToValidate {
|
|
89
|
+
policy_uuid: string;
|
|
90
|
+
content: string;
|
|
91
|
+
}
|
|
92
|
+
export interface PolicyValidationRequest {
|
|
93
|
+
policies: PolicyToValidate[];
|
|
94
|
+
}
|
|
95
|
+
export interface Issue {
|
|
96
|
+
type: string;
|
|
97
|
+
description: string;
|
|
98
|
+
suggestion: string;
|
|
99
|
+
}
|
|
100
|
+
export interface PolicyValidationResult {
|
|
101
|
+
policy_uuid: string;
|
|
102
|
+
score: number;
|
|
103
|
+
advice: string;
|
|
104
|
+
issues: Issue[];
|
|
105
|
+
severity: "none" | "low" | "medium" | "high";
|
|
106
|
+
}
|
|
107
|
+
export interface PolicyValidationResponse {
|
|
108
|
+
results: PolicyValidationResult[];
|
|
109
|
+
}
|
|
110
|
+
export interface PolicyRecommendationRequest {
|
|
111
|
+
level: 0 | 1 | 2;
|
|
112
|
+
uuid?: string;
|
|
113
|
+
prompt: string;
|
|
114
|
+
}
|
|
115
|
+
export interface PolicyRecommendation {
|
|
116
|
+
content: string;
|
|
117
|
+
riskType: "low" | "medium" | "high";
|
|
118
|
+
alertType: "log" | "alert" | "block";
|
|
119
|
+
}
|
|
120
|
+
export interface PolicyRecommendationResponse {
|
|
121
|
+
level: 0 | 1 | 2;
|
|
122
|
+
uuid: string;
|
|
123
|
+
tokens_in: number;
|
|
124
|
+
tokens_out: number;
|
|
125
|
+
recommended_policies: PolicyRecommendation[];
|
|
126
|
+
}
|
|
@@ -112,3 +112,12 @@ export interface GoogleLoginRequest extends LoginDeviceInfo {
|
|
|
112
112
|
export interface GithubLoginRequest extends LoginDeviceInfo {
|
|
113
113
|
code: string;
|
|
114
114
|
}
|
|
115
|
+
export interface DemoRequestBody {
|
|
116
|
+
userId: string;
|
|
117
|
+
email: string;
|
|
118
|
+
name: string;
|
|
119
|
+
}
|
|
120
|
+
export interface DemoRequestResponse {
|
|
121
|
+
success: boolean;
|
|
122
|
+
calendarUrl: string;
|
|
123
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flashbacktech/flashbackclient",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.22",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@aws-sdk/client-sts": "^3.777.0",
|
|
28
|
+
"@flashbacktech/flashbackclient": "^0.2.21",
|
|
28
29
|
"@google-cloud/storage": "^7.15.0",
|
|
29
30
|
"@stellar/stellar-sdk": "^14.0.0",
|
|
30
31
|
"formdata-node": "^6.0.3",
|