@daocloud-proto/hydra 0.17.0-rc1-dev-25 → 0.18.0-dev-2
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.
|
@@ -44,6 +44,9 @@ export enum APIKeyUsageQueryStatus {
|
|
|
44
44
|
workspace?: number
|
|
45
45
|
quota?: string
|
|
46
46
|
unlimitedQuota?: boolean
|
|
47
|
+
allowModels?: string[]
|
|
48
|
+
allowedIps?: string[]
|
|
49
|
+
blockedIps?: string[]
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
export type CreateWSAPIKeyRequest = BaseCreateWSAPIKeyRequest
|
|
@@ -53,6 +56,9 @@ export type CreateWSAPIKeyRequest = BaseCreateWSAPIKeyRequest
|
|
|
53
56
|
|
|
54
57
|
/* hydra modified */ export type BaseCreateAPIKeyRequest = {
|
|
55
58
|
name?: string
|
|
59
|
+
allowModels?: string[]
|
|
60
|
+
allowedIps?: string[]
|
|
61
|
+
blockedIps?: string[]
|
|
56
62
|
}
|
|
57
63
|
|
|
58
64
|
export type CreateAPIKeyRequest = BaseCreateAPIKeyRequest
|
|
@@ -78,6 +84,8 @@ export type APIKey = {
|
|
|
78
84
|
expired?: boolean
|
|
79
85
|
disabled?: boolean
|
|
80
86
|
quotaLimitedModels?: string[]
|
|
87
|
+
allowedIps?: string[]
|
|
88
|
+
blockedIps?: string[]
|
|
81
89
|
}
|
|
82
90
|
|
|
83
91
|
export type AllAPIKeyStatus = {
|
|
@@ -151,6 +159,23 @@ export type UpdateAPIKeyStatusRequest = {
|
|
|
151
159
|
disabled?: boolean
|
|
152
160
|
}
|
|
153
161
|
|
|
162
|
+
export type UpdateAPIKeyRequest = {
|
|
163
|
+
id?: string
|
|
164
|
+
allowModels?: string[]
|
|
165
|
+
allowedIps?: string[]
|
|
166
|
+
blockedIps?: string[]
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export type UpdateWSAPIKeyRequest = {
|
|
170
|
+
id?: string
|
|
171
|
+
workspace?: number
|
|
172
|
+
allowModels?: string[]
|
|
173
|
+
allowedIps?: string[]
|
|
174
|
+
blockedIps?: string[]
|
|
175
|
+
quota?: string
|
|
176
|
+
unlimitedQuota?: boolean
|
|
177
|
+
}
|
|
178
|
+
|
|
154
179
|
export type RegenerateAPIKeyRequest = {
|
|
155
180
|
id?: string
|
|
156
181
|
}
|
|
@@ -251,6 +276,9 @@ export class APIKeyManagement {
|
|
|
251
276
|
static UpdateAPIKeyStatus(req: UpdateAPIKeyStatusRequest, initReq?: fm.InitReq): Promise<APIKey> {
|
|
252
277
|
return fm.fetchReq<UpdateAPIKeyStatusRequest, APIKey>(`/apis/hydra.io/v1alpha1/apikeys/${req["id"]}/status`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
253
278
|
}
|
|
279
|
+
static UpdateAPIKey(req: UpdateAPIKeyRequest, initReq?: fm.InitReq): Promise<APIKey> {
|
|
280
|
+
return fm.fetchReq<UpdateAPIKeyRequest, APIKey>(`/apis/hydra.io/v1alpha1/apikeys/${req["id"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
281
|
+
}
|
|
254
282
|
static RegenerateAPIKey(req: RegenerateAPIKeyRequest, initReq?: fm.InitReq): Promise<APIKeySecret> {
|
|
255
283
|
return fm.fetchReq<RegenerateAPIKeyRequest, APIKeySecret>(`/apis/hydra.io/v1alpha1/apikeys/${req["id"]}/regenerate`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
256
284
|
}
|
|
@@ -289,6 +317,9 @@ export class WSAPIKeyManagement {
|
|
|
289
317
|
static UpdateWSAPIKeyQuota(req: UpdateWSAPIKeyQuotaRequest, initReq?: fm.InitReq): Promise<APIKey> {
|
|
290
318
|
return fm.fetchReq<UpdateWSAPIKeyQuotaRequest, APIKey>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/apikeys/${req["id"]}/quota`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
291
319
|
}
|
|
320
|
+
static UpdateWSAPIKey(req: UpdateWSAPIKeyRequest, initReq?: fm.InitReq): Promise<APIKey> {
|
|
321
|
+
return fm.fetchReq<UpdateWSAPIKeyRequest, APIKey>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/apikeys/${req["id"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
322
|
+
}
|
|
292
323
|
static RegenerateWSAPIKey(req: RegenerateWSAPIKeyRequest, initReq?: fm.InitReq): Promise<APIKeySecret> {
|
|
293
324
|
return fm.fetchReq<RegenerateWSAPIKeyRequest, APIKeySecret>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/apikeys/${req["id"]}/regenerate`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
294
325
|
}
|