@daocloud-proto/hydra 0.0.0-dev-65873840 → 0.0.0-dev-df7fe94b
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.
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import * as HydraCommonCommon from "../../../common/common.pb"
|
|
8
8
|
import * as fm from "../../../fetch.pb"
|
|
9
9
|
import * as GoogleProtobufEmpty from "../../../google/protobuf/empty.pb"
|
|
10
|
+
import * as HydraManagement_apiCoreV1alpha1Permissions from "../../../management-api/core/v1alpha1/permissions.pb"
|
|
10
11
|
import * as HydraManagement_apiWorkspaceV1alpha1Workspace from "../../../management-api/workspace/v1alpha1/workspace.pb"
|
|
11
12
|
export type ListClusterRequest = {
|
|
12
13
|
page?: HydraCommonCommon.Pagination
|
|
@@ -22,6 +23,10 @@ export type ConstantsResponse = {
|
|
|
22
23
|
defaultMountPath?: string
|
|
23
24
|
}
|
|
24
25
|
|
|
26
|
+
export type ListPlatformRolePermissionsForCurrentUserResponse = {
|
|
27
|
+
permissions?: HydraManagement_apiCoreV1alpha1Permissions.Permission[]
|
|
28
|
+
}
|
|
29
|
+
|
|
25
30
|
export class CoreService {
|
|
26
31
|
static AdminListCluster(req: ListClusterRequest, initReq?: fm.InitReq): Promise<ListClusterResponse> {
|
|
27
32
|
return fm.fetchReq<ListClusterRequest, ListClusterResponse>(`/apis/admin.hydra.io/v1alpha1/clusters?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
@@ -29,4 +34,7 @@ export class CoreService {
|
|
|
29
34
|
static AdminListConstants(req: GoogleProtobufEmpty.Empty, initReq?: fm.InitReq): Promise<ConstantsResponse> {
|
|
30
35
|
return fm.fetchReq<GoogleProtobufEmpty.Empty, ConstantsResponse>(`/apis/admin.hydra.io/v1alpha1/constants?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
31
36
|
}
|
|
37
|
+
static ListPlatformRolePermissionsForCurrentUser(req: GoogleProtobufEmpty.Empty, initReq?: fm.InitReq): Promise<ListPlatformRolePermissionsForCurrentUserResponse> {
|
|
38
|
+
return fm.fetchReq<GoogleProtobufEmpty.Empty, ListPlatformRolePermissionsForCurrentUserResponse>(`/apis/admin.hydra.io/v1alpha1/permissions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
39
|
+
}
|
|
32
40
|
}
|
|
@@ -5,26 +5,44 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as fm from "../../../fetch.pb"
|
|
8
|
-
export type ListRolePermissionsByWorkspaceForCurrentUserRequest = {
|
|
9
|
-
workspace?: number
|
|
10
|
-
}
|
|
11
8
|
|
|
12
|
-
export
|
|
13
|
-
|
|
9
|
+
export enum Permission {
|
|
10
|
+
MODEL_GET = "MODEL_GET",
|
|
11
|
+
MODEL_CREATE = "MODEL_CREATE",
|
|
12
|
+
MODEL_UPDATE = "MODEL_UPDATE",
|
|
13
|
+
MODEL_DELETE = "MODEL_DELETE",
|
|
14
|
+
MAAS_MODEL_GET = "MAAS_MODEL_GET",
|
|
15
|
+
MAAS_MODEL_CREATE = "MAAS_MODEL_CREATE",
|
|
16
|
+
MAAS_MODEL_UPDATE = "MAAS_MODEL_UPDATE",
|
|
17
|
+
MODEL_SERVING_GET = "MODEL_SERVING_GET",
|
|
18
|
+
MODEL_SERVING_CREATE = "MODEL_SERVING_CREATE",
|
|
19
|
+
MODEL_SERVING_UPDATE = "MODEL_SERVING_UPDATE",
|
|
20
|
+
MODEL_SERVING_DELETE = "MODEL_SERVING_DELETE",
|
|
21
|
+
APIKEY_GET = "APIKEY_GET",
|
|
22
|
+
APIKEY_CREATE = "APIKEY_CREATE",
|
|
23
|
+
APIKEY_DELETE = "APIKEY_DELETE",
|
|
24
|
+
CLUSTER_GET = "CLUSTER_GET",
|
|
25
|
+
FILES_STORAGE_GET = "FILES_STORAGE_GET",
|
|
26
|
+
FILES_STORAGE_CREATE = "FILES_STORAGE_CREATE",
|
|
27
|
+
FILES_STORAGE_UPDATE = "FILES_STORAGE_UPDATE",
|
|
28
|
+
FILES_STORAGE_DELETE = "FILES_STORAGE_DELETE",
|
|
29
|
+
QUEUE_GET = "QUEUE_GET",
|
|
30
|
+
QUEUE_CREATE = "QUEUE_CREATE",
|
|
31
|
+
QUEUE_UPDATE = "QUEUE_UPDATE",
|
|
32
|
+
QUEUE_DELETE = "QUEUE_DELETE",
|
|
33
|
+
ALL = "ALL",
|
|
14
34
|
}
|
|
15
35
|
|
|
16
|
-
export type
|
|
36
|
+
export type ListRolePermissionsByWorkspaceForCurrentUserRequest = {
|
|
37
|
+
workspace?: number
|
|
17
38
|
}
|
|
18
39
|
|
|
19
|
-
export type
|
|
20
|
-
permissions?:
|
|
40
|
+
export type ListRolePermissionsByWorkspaceForCurrentUserResponse = {
|
|
41
|
+
permissions?: Permission[]
|
|
21
42
|
}
|
|
22
43
|
|
|
23
44
|
export class Core {
|
|
24
45
|
static ListRolePermissionsByWorkspaceForCurrentUser(req: ListRolePermissionsByWorkspaceForCurrentUserRequest, initReq?: fm.InitReq): Promise<ListRolePermissionsByWorkspaceForCurrentUserResponse> {
|
|
25
46
|
return fm.fetchReq<ListRolePermissionsByWorkspaceForCurrentUserRequest, ListRolePermissionsByWorkspaceForCurrentUserResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/permissions?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
26
47
|
}
|
|
27
|
-
static ListPlatformRolePermissionsForCurrentUser(req: ListPlatformRolePermissionsForCurrentUserRequest, initReq?: fm.InitReq): Promise<ListPlatformRolePermissionsForCurrentUserResponse> {
|
|
28
|
-
return fm.fetchReq<ListPlatformRolePermissionsForCurrentUserRequest, ListPlatformRolePermissionsForCurrentUserResponse>(`/apis/hydra.io/v1alpha1/permissions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
29
|
-
}
|
|
30
48
|
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/*
|
|
4
|
+
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as HydraCommonCommon from "../../../common/common.pb"
|
|
8
|
+
import * as fm from "../../../fetch.pb"
|
|
9
|
+
import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
|
|
10
|
+
|
|
11
|
+
export enum DatasetFramework {
|
|
12
|
+
DATASET_FRAMEWORK_UNSPECIFIED = "DATASET_FRAMEWORK_UNSPECIFIED",
|
|
13
|
+
DATASET_FRAMEWORK_LLAMAFACTORY = "DATASET_FRAMEWORK_LLAMAFACTORY",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export enum DatasetFormat {
|
|
17
|
+
DATASET_FORMAT_UNSPECIFIED = "DATASET_FORMAT_UNSPECIFIED",
|
|
18
|
+
DATASET_FORMAT_ALPACA = "DATASET_FORMAT_ALPACA",
|
|
19
|
+
DATASET_FORMAT_SHAREGPT = "DATASET_FORMAT_SHAREGPT",
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export enum DatasetUsageType {
|
|
23
|
+
DATASET_USAGE_TYPE_UNSPECIFIED = "DATASET_USAGE_TYPE_UNSPECIFIED",
|
|
24
|
+
DATASET_USAGE_TYPE_SFT = "DATASET_USAGE_TYPE_SFT",
|
|
25
|
+
DATASET_USAGE_TYPE_KTO = "DATASET_USAGE_TYPE_KTO",
|
|
26
|
+
DATASET_USAGE_TYPE_PREFERENCE = "DATASET_USAGE_TYPE_PREFERENCE",
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type GetDatasetTemplateResponse = {
|
|
30
|
+
templateJson?: string
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type ListWSDatasetRequest = {
|
|
34
|
+
workspace?: number
|
|
35
|
+
page?: HydraCommonCommon.Pagination
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type ListWSDatasetResponse = {
|
|
39
|
+
items?: WSDataset[]
|
|
40
|
+
page?: HydraCommonCommon.Pagination
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type SingleWSDatasetRequest = {
|
|
44
|
+
workspace?: number
|
|
45
|
+
datasetId?: string
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type GetWSDatasetTemplateRequest = {
|
|
49
|
+
workspace?: number
|
|
50
|
+
framework?: DatasetFramework
|
|
51
|
+
format?: DatasetFormat
|
|
52
|
+
usageType?: DatasetUsageType
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type WSDataset = {
|
|
56
|
+
datasetId?: string
|
|
57
|
+
datasetAvatar?: string
|
|
58
|
+
datasetName?: string
|
|
59
|
+
providerId?: string
|
|
60
|
+
providerName?: HydraCommonCommon.I18nName
|
|
61
|
+
datasetDescription?: HydraCommonCommon.I18nName
|
|
62
|
+
creationTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
63
|
+
updateTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
64
|
+
readme?: HydraCommonCommon.I18nName
|
|
65
|
+
visible?: string
|
|
66
|
+
source?: string
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type CreatePrivateDatasetRequest = {
|
|
70
|
+
workspace?: number
|
|
71
|
+
datasetAvatar?: string
|
|
72
|
+
datasetName?: string
|
|
73
|
+
datasetDescription?: HydraCommonCommon.I18nName
|
|
74
|
+
readme?: HydraCommonCommon.I18nName
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export type UpdatePrivateDatasetRequest = {
|
|
78
|
+
workspace?: number
|
|
79
|
+
datasetId?: string
|
|
80
|
+
datasetAvatar?: string
|
|
81
|
+
datasetName?: string
|
|
82
|
+
datasetDescription?: HydraCommonCommon.I18nName
|
|
83
|
+
readme?: HydraCommonCommon.I18nName
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export type ListPrivateDatasetRequest = {
|
|
87
|
+
workspace?: number
|
|
88
|
+
page?: HydraCommonCommon.Pagination
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export class WSDatasetManagement {
|
|
92
|
+
static GetWSDatasetTemplate(req: GetWSDatasetTemplateRequest, initReq?: fm.InitReq): Promise<GetDatasetTemplateResponse> {
|
|
93
|
+
return fm.fetchReq<GetWSDatasetTemplateRequest, GetDatasetTemplateResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/datasets:template?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
94
|
+
}
|
|
95
|
+
static ListPrivateDatasets(req: ListPrivateDatasetRequest, initReq?: fm.InitReq): Promise<ListWSDatasetResponse> {
|
|
96
|
+
return fm.fetchReq<ListPrivateDatasetRequest, ListWSDatasetResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/private-datasets?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
97
|
+
}
|
|
98
|
+
static GetPrivateDataset(req: SingleWSDatasetRequest, initReq?: fm.InitReq): Promise<WSDataset> {
|
|
99
|
+
return fm.fetchReq<SingleWSDatasetRequest, WSDataset>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/private-datasets/${req["datasetId"]}?${fm.renderURLSearchParams(req, ["workspace", "datasetId"])}`, {...initReq, method: "GET"})
|
|
100
|
+
}
|
|
101
|
+
static CreatePrivateDataset(req: CreatePrivateDatasetRequest, initReq?: fm.InitReq): Promise<WSDataset> {
|
|
102
|
+
return fm.fetchReq<CreatePrivateDatasetRequest, WSDataset>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/private-datasets`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
103
|
+
}
|
|
104
|
+
static UpdatePrivateDataset(req: UpdatePrivateDatasetRequest, initReq?: fm.InitReq): Promise<WSDataset> {
|
|
105
|
+
return fm.fetchReq<UpdatePrivateDatasetRequest, WSDataset>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/private-datasets/${req["datasetId"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
106
|
+
}
|
|
107
|
+
static DeletePrivateDataset(req: SingleWSDatasetRequest, initReq?: fm.InitReq): Promise<WSDataset> {
|
|
108
|
+
return fm.fetchReq<SingleWSDatasetRequest, WSDataset>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/private-datasets/${req["datasetId"]}`, {...initReq, method: "DELETE"})
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/*
|
|
4
|
+
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as HydraCommonCommon from "../../../common/common.pb"
|
|
8
|
+
import * as fm from "../../../fetch.pb"
|
|
9
|
+
import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
|
|
10
|
+
import * as HydraManagement_apiModelV1alpha1Model_weights_volume from "../../model/v1alpha1/model_weights_volume.pb"
|
|
11
|
+
import * as HydraManagement_apiDatasetV1alpha1Dataset from "./dataset.pb"
|
|
12
|
+
export type WSDatasetVolume = {
|
|
13
|
+
id?: string
|
|
14
|
+
datasetId?: string
|
|
15
|
+
datasetTag?: string
|
|
16
|
+
clusterName?: string
|
|
17
|
+
storageSource?: HydraManagement_apiModelV1alpha1Model_weights_volume.StorageSourceType
|
|
18
|
+
storageRef?: string
|
|
19
|
+
subPath?: string
|
|
20
|
+
mountPath?: string
|
|
21
|
+
creationTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
22
|
+
updateTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
23
|
+
referenced?: boolean
|
|
24
|
+
lfDatasetInfoJson?: string
|
|
25
|
+
datasetFormat?: HydraManagement_apiDatasetV1alpha1Dataset.DatasetFormat
|
|
26
|
+
datasetUsageType?: HydraManagement_apiDatasetV1alpha1Dataset.DatasetUsageType
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type CreateWSDatasetVolumeRequest = {
|
|
30
|
+
workspace?: number
|
|
31
|
+
id?: string
|
|
32
|
+
datasetId?: string
|
|
33
|
+
clusterName?: string
|
|
34
|
+
datasetTag?: string
|
|
35
|
+
storageSource?: HydraManagement_apiModelV1alpha1Model_weights_volume.StorageSourceType
|
|
36
|
+
storageRef?: string
|
|
37
|
+
subPath?: string
|
|
38
|
+
mountPath?: string
|
|
39
|
+
lfDatasetInfoJson?: string
|
|
40
|
+
datasetFormat?: HydraManagement_apiDatasetV1alpha1Dataset.DatasetFormat
|
|
41
|
+
datasetUsageType?: HydraManagement_apiDatasetV1alpha1Dataset.DatasetUsageType
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type UpdateWSDatasetVolumeRequest = {
|
|
45
|
+
workspace?: number
|
|
46
|
+
id?: string
|
|
47
|
+
datasetId?: string
|
|
48
|
+
clusterName?: string
|
|
49
|
+
datasetTag?: string
|
|
50
|
+
storageSource?: HydraManagement_apiModelV1alpha1Model_weights_volume.StorageSourceType
|
|
51
|
+
storageRef?: string
|
|
52
|
+
subPath?: string
|
|
53
|
+
mountPath?: string
|
|
54
|
+
lfDatasetInfoJson?: string
|
|
55
|
+
datasetFormat?: HydraManagement_apiDatasetV1alpha1Dataset.DatasetFormat
|
|
56
|
+
datasetUsageType?: HydraManagement_apiDatasetV1alpha1Dataset.DatasetUsageType
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type SingleWSDatasetVolumeRequest = {
|
|
60
|
+
workspace?: number
|
|
61
|
+
id?: string
|
|
62
|
+
datasetId?: string
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type ListWSDatasetVolumesRequest = {
|
|
66
|
+
workspace?: number
|
|
67
|
+
datasetId?: string
|
|
68
|
+
page?: HydraCommonCommon.Pagination
|
|
69
|
+
clusterName?: string
|
|
70
|
+
datasetFormat?: HydraManagement_apiDatasetV1alpha1Dataset.DatasetFormat
|
|
71
|
+
datasetUsageType?: HydraManagement_apiDatasetV1alpha1Dataset.DatasetUsageType
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export type ListWSDatasetVolumesResponse = {
|
|
75
|
+
items?: WSDatasetVolume[]
|
|
76
|
+
page?: HydraCommonCommon.Pagination
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type GetWSDatasetStorageSourceRequest = {
|
|
80
|
+
workspace?: number
|
|
81
|
+
datasetId?: string
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type GetWSDatasetStorageSourceResponse = {
|
|
85
|
+
sources?: {[key: string]: number}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export class WSDatasetVolumeManagement {
|
|
89
|
+
static CreateWSDatasetVolume(req: CreateWSDatasetVolumeRequest, initReq?: fm.InitReq): Promise<WSDatasetVolume> {
|
|
90
|
+
return fm.fetchReq<CreateWSDatasetVolumeRequest, WSDatasetVolume>(`/apis/hydra.io/v1alpha1/datasets/${req["datasetId"]}/workspaces/${req["workspace"]}/volumes`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
91
|
+
}
|
|
92
|
+
static UpdateWSDatasetVolume(req: UpdateWSDatasetVolumeRequest, initReq?: fm.InitReq): Promise<WSDatasetVolume> {
|
|
93
|
+
return fm.fetchReq<UpdateWSDatasetVolumeRequest, WSDatasetVolume>(`/apis/hydra.io/v1alpha1/datasets/${req["datasetId"]}/workspaces/${req["workspace"]}/volumes/${req["id"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
94
|
+
}
|
|
95
|
+
static DeleteWSDatasetVolume(req: SingleWSDatasetVolumeRequest, initReq?: fm.InitReq): Promise<WSDatasetVolume> {
|
|
96
|
+
return fm.fetchReq<SingleWSDatasetVolumeRequest, WSDatasetVolume>(`/apis/hydra.io/v1alpha1/datasets/${req["datasetId"]}/workspaces/${req["workspace"]}/volumes/${req["id"]}`, {...initReq, method: "DELETE"})
|
|
97
|
+
}
|
|
98
|
+
static GetWSDatasetVolume(req: SingleWSDatasetVolumeRequest, initReq?: fm.InitReq): Promise<WSDatasetVolume> {
|
|
99
|
+
return fm.fetchReq<SingleWSDatasetVolumeRequest, WSDatasetVolume>(`/apis/hydra.io/v1alpha1/datasets/${req["datasetId"]}/workspaces/${req["workspace"]}/volumes/${req["id"]}?${fm.renderURLSearchParams(req, ["datasetId", "workspace", "id"])}`, {...initReq, method: "GET"})
|
|
100
|
+
}
|
|
101
|
+
static ListWSDatasetVolumes(req: ListWSDatasetVolumesRequest, initReq?: fm.InitReq): Promise<ListWSDatasetVolumesResponse> {
|
|
102
|
+
return fm.fetchReq<ListWSDatasetVolumesRequest, ListWSDatasetVolumesResponse>(`/apis/hydra.io/v1alpha1/datasets/${req["datasetId"]}/workspaces/${req["workspace"]}/volumes?${fm.renderURLSearchParams(req, ["datasetId", "workspace"])}`, {...initReq, method: "GET"})
|
|
103
|
+
}
|
|
104
|
+
static GetWSDatasetStorageSource(req: GetWSDatasetStorageSourceRequest, initReq?: fm.InitReq): Promise<GetWSDatasetStorageSourceResponse> {
|
|
105
|
+
return fm.fetchReq<GetWSDatasetStorageSourceRequest, GetWSDatasetStorageSourceResponse>(`/apis/hydra.io/v1alpha1/datasets/${req["datasetId"]}/workspaces/${req["workspace"]}/volumes:storage-source?${fm.renderURLSearchParams(req, ["datasetId", "workspace"])}`, {...initReq, method: "GET"})
|
|
106
|
+
}
|
|
107
|
+
}
|