@daocloud-proto/hydra 0.16.0-dev-22 → 0.16.0-dev-25

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.
@@ -150,6 +150,39 @@ export type QueryAIAuditLogResponse = {
150
150
  page?: HydraCommonCommon.Pagination
151
151
  }
152
152
 
153
+ export type QueryAIAuditLogStatisticsRequest = {
154
+ startTime?: GoogleProtobufTimestamp.Timestamp
155
+ endTime?: GoogleProtobufTimestamp.Timestamp
156
+ pluginId?: GuardrailsPlugin
157
+ level?: GuardrailsLevel
158
+ routeName?: string
159
+ }
160
+
161
+ export type AIAuditLogPolicyCount = {
162
+ pluginId?: GuardrailsPlugin
163
+ count?: string
164
+ }
165
+
166
+ export type AIAuditLogRouteNameCount = {
167
+ routeName?: string
168
+ count?: string
169
+ }
170
+
171
+ export type AIAuditLogRouteStatistics = {
172
+ routeName?: string
173
+ riskRequestCount?: string
174
+ logCount?: string
175
+ blockedCount?: string
176
+ policyCounts?: AIAuditLogPolicyCount[]
177
+ averageProcessingDurationMs?: number
178
+ }
179
+
180
+ export type QueryAIAuditLogStatisticsResponse = {
181
+ statisticsStartTime?: GoogleProtobufTimestamp.Timestamp
182
+ statisticsEndTime?: GoogleProtobufTimestamp.Timestamp
183
+ routeStatistics?: AIAuditLogRouteStatistics[]
184
+ }
185
+
153
186
  export type ExportAIAuditLogRequest = {
154
187
  startTime?: GoogleProtobufTimestamp.Timestamp
155
188
  endTime?: GoogleProtobufTimestamp.Timestamp
@@ -174,6 +207,9 @@ export class AIGuardrailsService {
174
207
  static QueryAIAuditLog(req: QueryAIAuditLogRequest, initReq?: fm.InitReq): Promise<QueryAIAuditLogResponse> {
175
208
  return fm.fetchReq<QueryAIAuditLogRequest, QueryAIAuditLogResponse>(`/apis/admin.hydra.io/v1alpha1/ai-guardrails-logs?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
176
209
  }
210
+ static QueryAIAuditLogStatistics(req: QueryAIAuditLogStatisticsRequest, initReq?: fm.InitReq): Promise<QueryAIAuditLogStatisticsResponse> {
211
+ return fm.fetchReq<QueryAIAuditLogStatisticsRequest, QueryAIAuditLogStatisticsResponse>(`/apis/admin.hydra.io/v1alpha1/ai-guardrails-logs/statistics?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
212
+ }
177
213
  static ExportAIAuditLog(req: ExportAIAuditLogRequest, initReq?: fm.InitReq): Promise<GoogleApiHttpbody.HttpBody> {
178
214
  return fm.fetchReq<ExportAIAuditLogRequest, GoogleApiHttpbody.HttpBody>(`/apis/admin.hydra.io/v1alpha1/ai-guardrails-logs/export?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
179
215
  }
@@ -6,6 +6,12 @@
6
6
 
7
7
  import * as HydraCommonCommon from "../../../common/common.pb"
8
8
  import * as fm from "../../../fetch.pb"
9
+
10
+ export enum DuplicatePolicy {
11
+ DUPLICATE_POLICY_SKIP = "DUPLICATE_POLICY_SKIP",
12
+ DUPLICATE_POLICY_UPDATE = "DUPLICATE_POLICY_UPDATE",
13
+ }
14
+
9
15
  export type CreateProviderRequest = {
10
16
  providerId?: string
11
17
  providerName?: HydraCommonCommon.I18nName
@@ -40,6 +46,29 @@ export type SingleProviderRequest = {
40
46
  providerId?: string
41
47
  }
42
48
 
49
+ export type BatchCreateProvidersRequest = {
50
+ providers?: CreateProviderRequest[]
51
+ duplicatePolicy?: DuplicatePolicy
52
+ }
53
+
54
+ export type BatchCreateProvidersResponse = {
55
+ items?: Provider[]
56
+ skippedNames?: string[]
57
+ }
58
+
59
+ export type ParsedProvider = {
60
+ provider?: Provider
61
+ error?: string
62
+ }
63
+
64
+ export type ParseProvidersRequest = {
65
+ providers?: CreateProviderRequest[]
66
+ }
67
+
68
+ export type ParseProvidersResponse = {
69
+ items?: ParsedProvider[]
70
+ }
71
+
43
72
  export class AdminProviderManagement {
44
73
  static CreateProvider(req: CreateProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
45
74
  return fm.fetchReq<CreateProviderRequest, Provider>(`/apis/admin.hydra.io/v1alpha1/providers`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
@@ -56,4 +85,10 @@ export class AdminProviderManagement {
56
85
  static DeleteProvider(req: SingleProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
57
86
  return fm.fetchReq<SingleProviderRequest, Provider>(`/apis/admin.hydra.io/v1alpha1/providers/${req["providerId"]}`, {...initReq, method: "DELETE"})
58
87
  }
88
+ static ParseProviderSpecs(req: ParseProvidersRequest, initReq?: fm.InitReq): Promise<ParseProvidersResponse> {
89
+ return fm.fetchReq<ParseProvidersRequest, ParseProvidersResponse>(`/apis/admin.hydra.io/v1alpha1/providers:parse`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
90
+ }
91
+ static BatchCreateProviders(req: BatchCreateProvidersRequest, initReq?: fm.InitReq): Promise<BatchCreateProvidersResponse> {
92
+ return fm.fetchReq<BatchCreateProvidersRequest, BatchCreateProvidersResponse>(`/apis/admin.hydra.io/v1alpha1/providers:batch_create`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
93
+ }
59
94
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/hydra",
3
- "version": "v0.16.0-dev-22",
3
+ "version": "v0.16.0-dev-25",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"