@daocloud-proto/hydra 0.16.0-dev-12 → 0.16.0-dev-14
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/common/errorcode.ts
CHANGED
|
@@ -30,6 +30,9 @@ export enum ErrorCode {
|
|
|
30
30
|
// EN: Request mode not match
|
|
31
31
|
// ZH: 请求模式不匹配。
|
|
32
32
|
SYSTEM_REQUEST_MODE_ERROR = "SYSTEM-REQUEST_MODE_ERROR",
|
|
33
|
+
// EN: upstream service unavailable: %v
|
|
34
|
+
// ZH: 上游服务暂时不可用:%v
|
|
35
|
+
SYSTEM_UPSTREAM_UNAVAILABLE = "SYSTEM-UPSTREAM_UNAVAILABLE",
|
|
33
36
|
// EN: Requested resource conflicted error: %v
|
|
34
37
|
// ZH: 请求的资源冲突错误:%v
|
|
35
38
|
USER_CONFLICT_ERROR = "USER-CONFLICT_ERROR",
|
|
@@ -85,6 +85,16 @@ export type DeleteWSAPIKeyRequest = {
|
|
|
85
85
|
workspace?: number
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
export type GetWSAPIKeySecretRequest = {
|
|
89
|
+
id?: string
|
|
90
|
+
workspace?: number
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export type APIKeySecret = {
|
|
94
|
+
id?: string
|
|
95
|
+
key?: string
|
|
96
|
+
}
|
|
97
|
+
|
|
88
98
|
export type UpdateWSAPIKeyQuotaRequest = {
|
|
89
99
|
id?: string
|
|
90
100
|
workspace?: number
|
|
@@ -177,6 +187,12 @@ export class WSAPIKeyManagement {
|
|
|
177
187
|
static ListMyWSAPIKeys(req: ListWSAPIKeyRequest, initReq?: fm.InitReq): Promise<ListAPIKeyResponse> {
|
|
178
188
|
return fm.fetchReq<ListWSAPIKeyRequest, ListAPIKeyResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/my-apikeys?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
179
189
|
}
|
|
190
|
+
static ListWSAPIKeyMasked(req: ListWSAPIKeyRequest, initReq?: fm.InitReq): Promise<ListAPIKeyResponse> {
|
|
191
|
+
return fm.fetchReq<ListWSAPIKeyRequest, ListAPIKeyResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/masked-apikeys?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
192
|
+
}
|
|
193
|
+
static GetWSAPIKeySecret(req: GetWSAPIKeySecretRequest, initReq?: fm.InitReq): Promise<APIKeySecret> {
|
|
194
|
+
return fm.fetchReq<GetWSAPIKeySecretRequest, APIKeySecret>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/apikeys/${req["id"]}/secret?${fm.renderURLSearchParams(req, ["workspace", "id"])}`, {...initReq, method: "GET"})
|
|
195
|
+
}
|
|
180
196
|
static DeleteWSAPIKey(req: DeleteWSAPIKeyRequest, initReq?: fm.InitReq): Promise<APIKey> {
|
|
181
197
|
return fm.fetchReq<DeleteWSAPIKeyRequest, APIKey>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/apikeys/${req["id"]}`, {...initReq, method: "DELETE", body: JSON.stringify(req, fm.replacer)})
|
|
182
198
|
}
|