@daocloud-proto/hydra 0.18.0-dev-1 → 0.18.0-dev-3

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.
@@ -45,6 +45,8 @@ export enum APIKeyUsageQueryStatus {
45
45
  quota?: string
46
46
  unlimitedQuota?: boolean
47
47
  allowModels?: string[]
48
+ allowedIps?: string[]
49
+ blockedIps?: string[]
48
50
  }
49
51
 
50
52
  export type CreateWSAPIKeyRequest = BaseCreateWSAPIKeyRequest
@@ -55,6 +57,8 @@ export type CreateWSAPIKeyRequest = BaseCreateWSAPIKeyRequest
55
57
  /* hydra modified */ export type BaseCreateAPIKeyRequest = {
56
58
  name?: string
57
59
  allowModels?: string[]
60
+ allowedIps?: string[]
61
+ blockedIps?: string[]
58
62
  }
59
63
 
60
64
  export type CreateAPIKeyRequest = BaseCreateAPIKeyRequest
@@ -80,6 +84,8 @@ export type APIKey = {
80
84
  expired?: boolean
81
85
  disabled?: boolean
82
86
  quotaLimitedModels?: string[]
87
+ allowedIps?: string[]
88
+ blockedIps?: string[]
83
89
  }
84
90
 
85
91
  export type AllAPIKeyStatus = {
@@ -125,6 +131,11 @@ export type DeleteWSAPIKeyRequest = {
125
131
  workspace?: number
126
132
  }
127
133
 
134
+ export type GetWSAPIKeyRequest = {
135
+ id?: string
136
+ workspace?: number
137
+ }
138
+
128
139
  export type GetWSAPIKeySecretRequest = {
129
140
  id?: string
130
141
  workspace?: number
@@ -156,12 +167,18 @@ export type UpdateAPIKeyStatusRequest = {
156
167
  export type UpdateAPIKeyRequest = {
157
168
  id?: string
158
169
  allowModels?: string[]
170
+ allowedIps?: string[]
171
+ blockedIps?: string[]
159
172
  }
160
173
 
161
174
  export type UpdateWSAPIKeyRequest = {
162
175
  id?: string
163
176
  workspace?: number
164
177
  allowModels?: string[]
178
+ allowedIps?: string[]
179
+ blockedIps?: string[]
180
+ quota?: string
181
+ unlimitedQuota?: boolean
165
182
  }
166
183
 
167
184
  export type RegenerateAPIKeyRequest = {
@@ -177,6 +194,10 @@ export type DeleteAPIKeyRequest = {
177
194
  id?: string
178
195
  }
179
196
 
197
+ export type GetAPIKeyRequest = {
198
+ id?: string
199
+ }
200
+
180
201
  export type GetAPIKeySecretRequest = {
181
202
  id?: string
182
203
  }
@@ -255,6 +276,9 @@ export class APIKeyManagement {
255
276
  static ListAllAPIKeysStatus(req: ListAllAPIKeysStatusRequest, initReq?: fm.InitReq): Promise<ListAllAPIKeysStatusResponse> {
256
277
  return fm.fetchReq<ListAllAPIKeysStatusRequest, ListAllAPIKeysStatusResponse>(`/apis/hydra.io/v1alpha1/all-apikey-statuses?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
257
278
  }
279
+ static GetAPIKey(req: GetAPIKeyRequest, initReq?: fm.InitReq): Promise<APIKey> {
280
+ return fm.fetchReq<GetAPIKeyRequest, APIKey>(`/apis/hydra.io/v1alpha1/apikeys/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
281
+ }
258
282
  static GetAPIKeySecret(req: GetAPIKeySecretRequest, initReq?: fm.InitReq): Promise<APIKeySecret> {
259
283
  return fm.fetchReq<GetAPIKeySecretRequest, APIKeySecret>(`/apis/hydra.io/v1alpha1/apikeys/${req["id"]}/secret?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
260
284
  }
@@ -293,6 +317,9 @@ export class WSAPIKeyManagement {
293
317
  static ListWSAPIKeyMasked(req: ListWSAPIKeyRequest, initReq?: fm.InitReq): Promise<ListAPIKeyResponse> {
294
318
  return fm.fetchReq<ListWSAPIKeyRequest, ListAPIKeyResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/masked-apikeys?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
295
319
  }
320
+ static GetWSAPIKey(req: GetWSAPIKeyRequest, initReq?: fm.InitReq): Promise<APIKey> {
321
+ return fm.fetchReq<GetWSAPIKeyRequest, APIKey>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/apikeys/${req["id"]}?${fm.renderURLSearchParams(req, ["workspace", "id"])}`, {...initReq, method: "GET"})
322
+ }
296
323
  static GetWSAPIKeySecret(req: GetWSAPIKeySecretRequest, initReq?: fm.InitReq): Promise<APIKeySecret> {
297
324
  return fm.fetchReq<GetWSAPIKeySecretRequest, APIKeySecret>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/apikeys/${req["id"]}/secret?${fm.renderURLSearchParams(req, ["workspace", "id"])}`, {...initReq, method: "GET"})
298
325
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/hydra",
3
- "version": "v0.18.0-dev-1",
3
+ "version": "v0.18.0-dev-3",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"