@scaleway/sdk 2.69.0 → 2.71.0
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/dist/api/account/v3/api.gen.cjs +23 -0
- package/dist/api/account/v3/api.gen.d.ts +11 -1
- package/dist/api/account/v3/api.gen.js +24 -1
- package/dist/api/account/v3/index.gen.d.ts +1 -1
- package/dist/api/account/v3/marshalling.gen.cjs +171 -0
- package/dist/api/account/v3/marshalling.gen.d.ts +3 -1
- package/dist/api/account/v3/marshalling.gen.js +173 -2
- package/dist/api/account/v3/types.gen.d.ts +93 -0
- package/dist/api/applesilicon/v1alpha1/api.gen.cjs +3 -1
- package/dist/api/applesilicon/v1alpha1/api.gen.js +3 -1
- package/dist/api/applesilicon/v1alpha1/types.gen.d.ts +3 -2
- package/dist/api/baremetal/v1/api.gen.cjs +3 -1
- package/dist/api/baremetal/v1/api.gen.js +3 -1
- package/dist/api/baremetal/v1/marshalling.gen.cjs +4 -2
- package/dist/api/baremetal/v1/marshalling.gen.js +4 -2
- package/dist/api/baremetal/v1/types.gen.d.ts +65 -64
- package/dist/api/block/v1/api.gen.cjs +6 -2
- package/dist/api/block/v1/api.gen.js +6 -2
- package/dist/api/block/v1alpha1/api.gen.cjs +6 -2
- package/dist/api/block/v1alpha1/api.gen.js +6 -2
- package/dist/api/block/v1alpha1/marshalling.gen.cjs +0 -1
- package/dist/api/block/v1alpha1/marshalling.gen.d.ts +1 -2
- package/dist/api/block/v1alpha1/marshalling.gen.js +0 -1
- package/dist/api/cockpit/v1/marshalling.gen.cjs +4 -4
- package/dist/api/cockpit/v1/marshalling.gen.js +4 -4
- package/dist/api/cockpit/v1/types.gen.d.ts +3 -3
- package/dist/api/container/v1beta1/api.gen.cjs +18 -6
- package/dist/api/container/v1beta1/api.gen.js +18 -6
- package/dist/api/dedibox/v1/api.gen.cjs +9 -3
- package/dist/api/dedibox/v1/api.gen.js +9 -3
- package/dist/api/domain/v2beta1/api.gen.cjs +3 -1
- package/dist/api/domain/v2beta1/api.gen.js +3 -1
- package/dist/api/edge_services/v1beta1/api.gen.cjs +6 -2
- package/dist/api/edge_services/v1beta1/api.gen.js +6 -2
- package/dist/api/edge_services/v1beta1/types.gen.d.ts +1 -1
- package/dist/api/function/v1beta1/api.gen.cjs +18 -6
- package/dist/api/function/v1beta1/api.gen.js +18 -6
- package/dist/api/function/v1beta1/types.gen.d.ts +1 -1
- package/dist/api/iam/v1alpha1/api.gen.cjs +1 -0
- package/dist/api/iam/v1alpha1/api.gen.js +1 -0
- package/dist/api/iam/v1alpha1/index.gen.d.ts +1 -1
- package/dist/api/iam/v1alpha1/marshalling.gen.cjs +21 -14
- package/dist/api/iam/v1alpha1/marshalling.gen.js +21 -14
- package/dist/api/iam/v1alpha1/types.gen.d.ts +32 -6
- package/dist/api/iam/v1alpha1/validation-rules.gen.cjs +38 -12
- package/dist/api/iam/v1alpha1/validation-rules.gen.d.ts +36 -11
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +38 -12
- package/dist/api/inference/index.gen.cjs +4 -2
- package/dist/api/inference/index.gen.d.ts +1 -0
- package/dist/api/inference/index.gen.js +4 -2
- package/dist/api/inference/v1/api.gen.cjs +278 -0
- package/dist/api/inference/v1/api.gen.d.ts +140 -0
- package/dist/api/inference/v1/api.gen.js +278 -0
- package/dist/api/inference/v1/content.gen.cjs +13 -0
- package/dist/api/inference/v1/content.gen.d.ts +5 -0
- package/dist/api/inference/v1/content.gen.js +13 -0
- package/dist/api/inference/v1/index.gen.cjs +9 -0
- package/dist/api/inference/v1/index.gen.d.ts +4 -0
- package/dist/api/inference/v1/index.gen.js +9 -0
- package/dist/api/inference/v1/marshalling.gen.cjs +260 -0
- package/dist/api/inference/v1/marshalling.gen.d.ts +14 -0
- package/dist/api/inference/v1/marshalling.gen.js +260 -0
- package/dist/api/inference/v1/types.gen.d.ts +397 -0
- package/dist/api/inference/v1/validation-rules.gen.cjs +65 -0
- package/dist/api/inference/v1/validation-rules.gen.d.ts +57 -0
- package/dist/api/inference/v1/validation-rules.gen.js +65 -0
- package/dist/api/inference/v1beta1/api.gen.cjs +3 -1
- package/dist/api/inference/v1beta1/api.gen.js +3 -1
- package/dist/api/instance/v1/index.gen.d.ts +1 -1
- package/dist/api/instance/v1/marshalling.gen.cjs +13 -1
- package/dist/api/instance/v1/marshalling.gen.js +13 -1
- package/dist/api/instance/v1/types.gen.d.ts +10 -2
- package/dist/api/k8s/v1/api.gen.cjs +3 -1
- package/dist/api/k8s/v1/api.gen.js +3 -1
- package/dist/api/k8s/v1/marshalling.gen.cjs +1 -0
- package/dist/api/k8s/v1/marshalling.gen.js +1 -0
- package/dist/api/k8s/v1/types.gen.d.ts +5 -0
- package/dist/api/lb/v1/types.gen.d.ts +3 -3
- package/dist/api/mongodb/v1alpha1/api.gen.cjs +6 -2
- package/dist/api/mongodb/v1alpha1/api.gen.js +6 -2
- package/dist/api/qaas/v1alpha1/api.gen.cjs +6 -2
- package/dist/api/qaas/v1alpha1/api.gen.js +6 -2
- package/dist/api/rdb/v1/api.gen.cjs +6 -2
- package/dist/api/rdb/v1/api.gen.js +6 -2
- package/dist/api/redis/v1/api.gen.cjs +3 -1
- package/dist/api/redis/v1/api.gen.js +3 -1
- package/dist/api/registry/v1/api.gen.cjs +9 -3
- package/dist/api/registry/v1/api.gen.js +9 -3
- package/dist/api/secret/v1beta1/api.gen.cjs +32 -0
- package/dist/api/secret/v1beta1/api.gen.d.ts +17 -1
- package/dist/api/secret/v1beta1/api.gen.js +32 -0
- package/dist/api/secret/v1beta1/index.gen.d.ts +1 -1
- package/dist/api/secret/v1beta1/types.gen.d.ts +17 -0
- package/dist/api/serverless_sqldb/v1alpha1/api.gen.cjs +3 -1
- package/dist/api/serverless_sqldb/v1alpha1/api.gen.js +3 -1
- package/dist/api/tem/v1alpha1/api.gen.cjs +93 -0
- package/dist/api/tem/v1alpha1/api.gen.d.ts +44 -1
- package/dist/api/tem/v1alpha1/api.gen.js +94 -1
- package/dist/api/tem/v1alpha1/index.gen.d.ts +1 -1
- package/dist/api/tem/v1alpha1/marshalling.gen.cjs +114 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.d.ts +7 -1
- package/dist/api/tem/v1alpha1/marshalling.gen.js +114 -0
- package/dist/api/tem/v1alpha1/types.gen.d.ts +157 -1
- package/dist/api/tem/v1alpha1/validation-rules.gen.cjs +10 -0
- package/dist/api/tem/v1alpha1/validation-rules.gen.d.ts +9 -0
- package/dist/api/tem/v1alpha1/validation-rules.gen.js +10 -0
- package/dist/api/vpc/v2/api.gen.cjs +33 -0
- package/dist/api/vpc/v2/api.gen.d.ts +17 -1
- package/dist/api/vpc/v2/api.gen.js +34 -1
- package/dist/api/vpc/v2/index.gen.d.ts +1 -1
- package/dist/api/vpc/v2/marshalling.gen.cjs +59 -0
- package/dist/api/vpc/v2/marshalling.gen.d.ts +4 -1
- package/dist/api/vpc/v2/marshalling.gen.js +59 -0
- package/dist/api/vpc/v2/types.gen.d.ts +80 -0
- package/dist/api/vpc/v2/validation-rules.gen.cjs +18 -0
- package/dist/api/vpc/v2/validation-rules.gen.d.ts +17 -0
- package/dist/api/vpc/v2/validation-rules.gen.js +18 -0
- package/dist/api/vpcgw/v1/api.gen.cjs +3 -1
- package/dist/api/vpcgw/v1/api.gen.js +3 -1
- package/dist/api/vpcgw/v2/api.gen.cjs +3 -1
- package/dist/api/vpcgw/v2/api.gen.js +3 -1
- package/dist/api/webhosting/v1/api.gen.cjs +6 -2
- package/dist/api/webhosting/v1/api.gen.js +6 -2
- package/dist/api/webhosting/v1/index.gen.d.ts +1 -1
- package/dist/api/webhosting/v1/marshalling.gen.cjs +27 -2
- package/dist/api/webhosting/v1/marshalling.gen.js +27 -2
- package/dist/api/webhosting/v1/types.gen.d.ts +64 -15
- package/dist/scw/constants.cjs +1 -1
- package/dist/scw/constants.d.ts +2 -2
- package/dist/scw/constants.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const DEPLOYMENT_TRANSIENT_STATUSES = [
|
|
4
|
+
"creating",
|
|
5
|
+
"deploying",
|
|
6
|
+
"deleting"
|
|
7
|
+
];
|
|
8
|
+
const MODEL_TRANSIENT_STATUSES = [
|
|
9
|
+
"preparing",
|
|
10
|
+
"downloading"
|
|
11
|
+
];
|
|
12
|
+
exports.DEPLOYMENT_TRANSIENT_STATUSES = DEPLOYMENT_TRANSIENT_STATUSES;
|
|
13
|
+
exports.MODEL_TRANSIENT_STATUSES = MODEL_TRANSIENT_STATUSES;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DeploymentStatus, ModelStatus } from './types.gen';
|
|
2
|
+
/** Lists transient statutes of the enum {@link DeploymentStatus}. */
|
|
3
|
+
export declare const DEPLOYMENT_TRANSIENT_STATUSES: DeploymentStatus[];
|
|
4
|
+
/** Lists transient statutes of the enum {@link ModelStatus}. */
|
|
5
|
+
export declare const MODEL_TRANSIENT_STATUSES: ModelStatus[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const api_gen = require("./api.gen.cjs");
|
|
4
|
+
const content_gen = require("./content.gen.cjs");
|
|
5
|
+
const validationRules_gen = require("./validation-rules.gen.cjs");
|
|
6
|
+
exports.API = api_gen.API;
|
|
7
|
+
exports.DEPLOYMENT_TRANSIENT_STATUSES = content_gen.DEPLOYMENT_TRANSIENT_STATUSES;
|
|
8
|
+
exports.MODEL_TRANSIENT_STATUSES = content_gen.MODEL_TRANSIENT_STATUSES;
|
|
9
|
+
exports.ValidationRules = validationRules_gen;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { API } from './api.gen.js';
|
|
2
|
+
export * from './content.gen.js';
|
|
3
|
+
export type { CreateDeploymentRequest, CreateEndpointRequest, CreateModelRequest, DeleteDeploymentRequest, DeleteEndpointRequest, DeleteModelRequest, Deployment, DeploymentQuantization, DeploymentStatus, Endpoint, EndpointPrivateNetworkDetails, EndpointPublicNetworkDetails, EndpointSpec, GetDeploymentCertificateRequest, GetDeploymentRequest, GetModelRequest, ListDeploymentsRequest, ListDeploymentsRequestOrderBy, ListDeploymentsResponse, ListModelsRequest, ListModelsRequestOrderBy, ListModelsResponse, ListNodeTypesRequest, ListNodeTypesResponse, Model, ModelSource, ModelStatus, ModelSupportInfo, ModelSupportedNode, ModelSupportedQuantization, NodeType, NodeTypeStock, UpdateDeploymentRequest, UpdateEndpointRequest, } from './types.gen';
|
|
4
|
+
export * as ValidationRules from './validation-rules.gen.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { API } from "./api.gen.js";
|
|
2
|
+
import { DEPLOYMENT_TRANSIENT_STATUSES, MODEL_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
|
+
import * as validationRules_gen from "./validation-rules.gen.js";
|
|
4
|
+
export {
|
|
5
|
+
API,
|
|
6
|
+
DEPLOYMENT_TRANSIENT_STATUSES,
|
|
7
|
+
MODEL_TRANSIENT_STATUSES,
|
|
8
|
+
validationRules_gen as ValidationRules
|
|
9
|
+
};
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const randomName = require("@scaleway/random-name");
|
|
4
|
+
const json = require("../../../helpers/json.cjs");
|
|
5
|
+
const marshalling = require("../../../helpers/marshalling.cjs");
|
|
6
|
+
require("../../../vendor/base64/index.cjs");
|
|
7
|
+
const unmarshalEndpointPrivateNetworkDetails = (data) => {
|
|
8
|
+
if (!json.isJSONObject(data)) {
|
|
9
|
+
throw new TypeError(
|
|
10
|
+
`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
privateNetworkId: data.private_network_id
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
const unmarshalEndpointPublicNetworkDetails = (data) => {
|
|
18
|
+
if (!json.isJSONObject(data)) {
|
|
19
|
+
throw new TypeError(
|
|
20
|
+
`Unmarshalling the type 'EndpointPublicNetworkDetails' failed as data isn't a dictionary.`
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
return {};
|
|
24
|
+
};
|
|
25
|
+
const unmarshalEndpoint = (data) => {
|
|
26
|
+
if (!json.isJSONObject(data)) {
|
|
27
|
+
throw new TypeError(
|
|
28
|
+
`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
disableAuth: data.disable_auth,
|
|
33
|
+
id: data.id,
|
|
34
|
+
privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0,
|
|
35
|
+
publicNetwork: data.public_network ? unmarshalEndpointPublicNetworkDetails(data.public_network) : void 0,
|
|
36
|
+
url: data.url
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
const unmarshalModelSupportedQuantization = (data) => {
|
|
40
|
+
if (!json.isJSONObject(data)) {
|
|
41
|
+
throw new TypeError(
|
|
42
|
+
`Unmarshalling the type 'ModelSupportedQuantization' failed as data isn't a dictionary.`
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
allowed: data.allowed,
|
|
47
|
+
maxContextSize: data.max_context_size,
|
|
48
|
+
quantizationBits: data.quantization_bits
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
const unmarshalModelSupportedNode = (data) => {
|
|
52
|
+
if (!json.isJSONObject(data)) {
|
|
53
|
+
throw new TypeError(
|
|
54
|
+
`Unmarshalling the type 'ModelSupportedNode' failed as data isn't a dictionary.`
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
nodeTypeName: data.node_type_name,
|
|
59
|
+
quantizations: marshalling.unmarshalArrayOfObject(
|
|
60
|
+
data.quantizations,
|
|
61
|
+
unmarshalModelSupportedQuantization
|
|
62
|
+
)
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
const unmarshalModelSupportInfo = (data) => {
|
|
66
|
+
if (!json.isJSONObject(data)) {
|
|
67
|
+
throw new TypeError(
|
|
68
|
+
`Unmarshalling the type 'ModelSupportInfo' failed as data isn't a dictionary.`
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
nodes: marshalling.unmarshalArrayOfObject(data.nodes, unmarshalModelSupportedNode)
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
const unmarshalDeploymentQuantization = (data) => {
|
|
76
|
+
if (!json.isJSONObject(data)) {
|
|
77
|
+
throw new TypeError(
|
|
78
|
+
`Unmarshalling the type 'DeploymentQuantization' failed as data isn't a dictionary.`
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
bits: data.bits
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
const unmarshalDeployment = (data) => {
|
|
86
|
+
if (!json.isJSONObject(data)) {
|
|
87
|
+
throw new TypeError(
|
|
88
|
+
`Unmarshalling the type 'Deployment' failed as data isn't a dictionary.`
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
createdAt: marshalling.unmarshalDate(data.created_at),
|
|
93
|
+
endpoints: marshalling.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
|
|
94
|
+
errorMessage: data.error_message,
|
|
95
|
+
id: data.id,
|
|
96
|
+
maxSize: data.max_size,
|
|
97
|
+
minSize: data.min_size,
|
|
98
|
+
modelId: data.model_id,
|
|
99
|
+
modelName: data.model_name,
|
|
100
|
+
name: data.name,
|
|
101
|
+
nodeTypeName: data.node_type_name,
|
|
102
|
+
projectId: data.project_id,
|
|
103
|
+
quantization: data.quantization ? unmarshalDeploymentQuantization(data.quantization) : void 0,
|
|
104
|
+
region: data.region,
|
|
105
|
+
size: data.size,
|
|
106
|
+
status: data.status,
|
|
107
|
+
tags: data.tags,
|
|
108
|
+
updatedAt: marshalling.unmarshalDate(data.updated_at)
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
const unmarshalModel = (data) => {
|
|
112
|
+
if (!json.isJSONObject(data)) {
|
|
113
|
+
throw new TypeError(
|
|
114
|
+
`Unmarshalling the type 'Model' failed as data isn't a dictionary.`
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
createdAt: marshalling.unmarshalDate(data.created_at),
|
|
119
|
+
description: data.description,
|
|
120
|
+
errorMessage: data.error_message,
|
|
121
|
+
hasEula: data.has_eula,
|
|
122
|
+
id: data.id,
|
|
123
|
+
name: data.name,
|
|
124
|
+
nodesSupport: marshalling.unmarshalArrayOfObject(
|
|
125
|
+
data.nodes_support,
|
|
126
|
+
unmarshalModelSupportInfo
|
|
127
|
+
),
|
|
128
|
+
parameterSizeBits: data.parameter_size_bits,
|
|
129
|
+
projectId: data.project_id,
|
|
130
|
+
region: data.region,
|
|
131
|
+
sizeBytes: data.size_bytes,
|
|
132
|
+
status: data.status,
|
|
133
|
+
tags: data.tags,
|
|
134
|
+
updatedAt: marshalling.unmarshalDate(data.updated_at)
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
const unmarshalListDeploymentsResponse = (data) => {
|
|
138
|
+
if (!json.isJSONObject(data)) {
|
|
139
|
+
throw new TypeError(
|
|
140
|
+
`Unmarshalling the type 'ListDeploymentsResponse' failed as data isn't a dictionary.`
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
deployments: marshalling.unmarshalArrayOfObject(data.deployments, unmarshalDeployment),
|
|
145
|
+
totalCount: data.total_count
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
const unmarshalListModelsResponse = (data) => {
|
|
149
|
+
if (!json.isJSONObject(data)) {
|
|
150
|
+
throw new TypeError(
|
|
151
|
+
`Unmarshalling the type 'ListModelsResponse' failed as data isn't a dictionary.`
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
models: marshalling.unmarshalArrayOfObject(data.models, unmarshalModel),
|
|
156
|
+
totalCount: data.total_count
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
const unmarshalNodeType = (data) => {
|
|
160
|
+
if (!json.isJSONObject(data)) {
|
|
161
|
+
throw new TypeError(
|
|
162
|
+
`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
return {
|
|
166
|
+
beta: data.beta,
|
|
167
|
+
createdAt: marshalling.unmarshalDate(data.created_at),
|
|
168
|
+
description: data.description,
|
|
169
|
+
disabled: data.disabled,
|
|
170
|
+
gpus: data.gpus,
|
|
171
|
+
memory: data.memory,
|
|
172
|
+
name: data.name,
|
|
173
|
+
region: data.region,
|
|
174
|
+
stockStatus: data.stock_status,
|
|
175
|
+
updatedAt: marshalling.unmarshalDate(data.updated_at),
|
|
176
|
+
vcpus: data.vcpus,
|
|
177
|
+
vram: data.vram
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
const unmarshalListNodeTypesResponse = (data) => {
|
|
181
|
+
if (!json.isJSONObject(data)) {
|
|
182
|
+
throw new TypeError(
|
|
183
|
+
`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
return {
|
|
187
|
+
nodeTypes: marshalling.unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
|
|
188
|
+
totalCount: data.total_count
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
const marshalEndpointPrivateNetworkDetails = (request, defaults) => ({
|
|
192
|
+
private_network_id: request.privateNetworkId
|
|
193
|
+
});
|
|
194
|
+
const marshalEndpointPublicNetworkDetails = (request, defaults) => ({});
|
|
195
|
+
const marshalDeploymentQuantization = (request, defaults) => ({
|
|
196
|
+
bits: request.bits
|
|
197
|
+
});
|
|
198
|
+
const marshalEndpointSpec = (request, defaults) => ({
|
|
199
|
+
disable_auth: request.disableAuth,
|
|
200
|
+
...marshalling.resolveOneOf([
|
|
201
|
+
{
|
|
202
|
+
param: "public_network",
|
|
203
|
+
value: request.publicNetwork !== void 0 ? marshalEndpointPublicNetworkDetails(request.publicNetwork) : void 0
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
param: "private_network",
|
|
207
|
+
value: request.privateNetwork !== void 0 ? marshalEndpointPrivateNetworkDetails(
|
|
208
|
+
request.privateNetwork
|
|
209
|
+
) : void 0
|
|
210
|
+
}
|
|
211
|
+
])
|
|
212
|
+
});
|
|
213
|
+
const marshalCreateDeploymentRequest = (request, defaults) => ({
|
|
214
|
+
accept_eula: request.acceptEula,
|
|
215
|
+
endpoints: request.endpoints.map((elt) => marshalEndpointSpec(elt)),
|
|
216
|
+
max_size: request.maxSize,
|
|
217
|
+
min_size: request.minSize,
|
|
218
|
+
model_id: request.modelId,
|
|
219
|
+
name: request.name || randomName("inference"),
|
|
220
|
+
node_type_name: request.nodeTypeName,
|
|
221
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
222
|
+
quantization: request.quantization !== void 0 ? marshalDeploymentQuantization(request.quantization) : void 0,
|
|
223
|
+
tags: request.tags
|
|
224
|
+
});
|
|
225
|
+
const marshalCreateEndpointRequest = (request, defaults) => ({
|
|
226
|
+
deployment_id: request.deploymentId,
|
|
227
|
+
endpoint: marshalEndpointSpec(request.endpoint)
|
|
228
|
+
});
|
|
229
|
+
const marshalModelSource = (request, defaults) => ({
|
|
230
|
+
url: request.url,
|
|
231
|
+
...marshalling.resolveOneOf([{ param: "secret", value: request.secret }])
|
|
232
|
+
});
|
|
233
|
+
const marshalCreateModelRequest = (request, defaults) => ({
|
|
234
|
+
name: request.name || randomName("model"),
|
|
235
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
236
|
+
source: marshalModelSource(request.source)
|
|
237
|
+
});
|
|
238
|
+
const marshalUpdateDeploymentRequest = (request, defaults) => ({
|
|
239
|
+
max_size: request.maxSize,
|
|
240
|
+
min_size: request.minSize,
|
|
241
|
+
model_id: request.modelId,
|
|
242
|
+
name: request.name,
|
|
243
|
+
quantization: request.quantization !== void 0 ? marshalDeploymentQuantization(request.quantization) : void 0,
|
|
244
|
+
tags: request.tags
|
|
245
|
+
});
|
|
246
|
+
const marshalUpdateEndpointRequest = (request, defaults) => ({
|
|
247
|
+
disable_auth: request.disableAuth
|
|
248
|
+
});
|
|
249
|
+
exports.marshalCreateDeploymentRequest = marshalCreateDeploymentRequest;
|
|
250
|
+
exports.marshalCreateEndpointRequest = marshalCreateEndpointRequest;
|
|
251
|
+
exports.marshalCreateModelRequest = marshalCreateModelRequest;
|
|
252
|
+
exports.marshalUpdateDeploymentRequest = marshalUpdateDeploymentRequest;
|
|
253
|
+
exports.marshalUpdateEndpointRequest = marshalUpdateEndpointRequest;
|
|
254
|
+
exports.unmarshalDeployment = unmarshalDeployment;
|
|
255
|
+
exports.unmarshalEndpoint = unmarshalEndpoint;
|
|
256
|
+
exports.unmarshalListDeploymentsResponse = unmarshalListDeploymentsResponse;
|
|
257
|
+
exports.unmarshalListModelsResponse = unmarshalListModelsResponse;
|
|
258
|
+
exports.unmarshalListNodeTypesResponse = unmarshalListNodeTypesResponse;
|
|
259
|
+
exports.unmarshalModel = unmarshalModel;
|
|
260
|
+
exports.unmarshalModelSupportInfo = unmarshalModelSupportInfo;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DefaultValues } from '../../../bridge';
|
|
2
|
+
import type { CreateDeploymentRequest, CreateEndpointRequest, CreateModelRequest, Deployment, Endpoint, ListDeploymentsResponse, ListModelsResponse, ListNodeTypesResponse, Model, ModelSupportInfo, UpdateDeploymentRequest, UpdateEndpointRequest } from './types.gen';
|
|
3
|
+
export declare const unmarshalEndpoint: (data: unknown) => Endpoint;
|
|
4
|
+
export declare const unmarshalModelSupportInfo: (data: unknown) => ModelSupportInfo;
|
|
5
|
+
export declare const unmarshalDeployment: (data: unknown) => Deployment;
|
|
6
|
+
export declare const unmarshalModel: (data: unknown) => Model;
|
|
7
|
+
export declare const unmarshalListDeploymentsResponse: (data: unknown) => ListDeploymentsResponse;
|
|
8
|
+
export declare const unmarshalListModelsResponse: (data: unknown) => ListModelsResponse;
|
|
9
|
+
export declare const unmarshalListNodeTypesResponse: (data: unknown) => ListNodeTypesResponse;
|
|
10
|
+
export declare const marshalCreateDeploymentRequest: (request: CreateDeploymentRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
11
|
+
export declare const marshalCreateEndpointRequest: (request: CreateEndpointRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
12
|
+
export declare const marshalCreateModelRequest: (request: CreateModelRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
13
|
+
export declare const marshalUpdateDeploymentRequest: (request: UpdateDeploymentRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
14
|
+
export declare const marshalUpdateEndpointRequest: (request: UpdateEndpointRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import randomName from "@scaleway/random-name";
|
|
2
|
+
import { isJSONObject } from "../../../helpers/json.js";
|
|
3
|
+
import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from "../../../helpers/marshalling.js";
|
|
4
|
+
import "../../../vendor/base64/index.js";
|
|
5
|
+
const unmarshalEndpointPrivateNetworkDetails = (data) => {
|
|
6
|
+
if (!isJSONObject(data)) {
|
|
7
|
+
throw new TypeError(
|
|
8
|
+
`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
privateNetworkId: data.private_network_id
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
const unmarshalEndpointPublicNetworkDetails = (data) => {
|
|
16
|
+
if (!isJSONObject(data)) {
|
|
17
|
+
throw new TypeError(
|
|
18
|
+
`Unmarshalling the type 'EndpointPublicNetworkDetails' failed as data isn't a dictionary.`
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
return {};
|
|
22
|
+
};
|
|
23
|
+
const unmarshalEndpoint = (data) => {
|
|
24
|
+
if (!isJSONObject(data)) {
|
|
25
|
+
throw new TypeError(
|
|
26
|
+
`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
disableAuth: data.disable_auth,
|
|
31
|
+
id: data.id,
|
|
32
|
+
privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0,
|
|
33
|
+
publicNetwork: data.public_network ? unmarshalEndpointPublicNetworkDetails(data.public_network) : void 0,
|
|
34
|
+
url: data.url
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
const unmarshalModelSupportedQuantization = (data) => {
|
|
38
|
+
if (!isJSONObject(data)) {
|
|
39
|
+
throw new TypeError(
|
|
40
|
+
`Unmarshalling the type 'ModelSupportedQuantization' failed as data isn't a dictionary.`
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
allowed: data.allowed,
|
|
45
|
+
maxContextSize: data.max_context_size,
|
|
46
|
+
quantizationBits: data.quantization_bits
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
const unmarshalModelSupportedNode = (data) => {
|
|
50
|
+
if (!isJSONObject(data)) {
|
|
51
|
+
throw new TypeError(
|
|
52
|
+
`Unmarshalling the type 'ModelSupportedNode' failed as data isn't a dictionary.`
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
nodeTypeName: data.node_type_name,
|
|
57
|
+
quantizations: unmarshalArrayOfObject(
|
|
58
|
+
data.quantizations,
|
|
59
|
+
unmarshalModelSupportedQuantization
|
|
60
|
+
)
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
const unmarshalModelSupportInfo = (data) => {
|
|
64
|
+
if (!isJSONObject(data)) {
|
|
65
|
+
throw new TypeError(
|
|
66
|
+
`Unmarshalling the type 'ModelSupportInfo' failed as data isn't a dictionary.`
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
nodes: unmarshalArrayOfObject(data.nodes, unmarshalModelSupportedNode)
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
const unmarshalDeploymentQuantization = (data) => {
|
|
74
|
+
if (!isJSONObject(data)) {
|
|
75
|
+
throw new TypeError(
|
|
76
|
+
`Unmarshalling the type 'DeploymentQuantization' failed as data isn't a dictionary.`
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
bits: data.bits
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
const unmarshalDeployment = (data) => {
|
|
84
|
+
if (!isJSONObject(data)) {
|
|
85
|
+
throw new TypeError(
|
|
86
|
+
`Unmarshalling the type 'Deployment' failed as data isn't a dictionary.`
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
createdAt: unmarshalDate(data.created_at),
|
|
91
|
+
endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
|
|
92
|
+
errorMessage: data.error_message,
|
|
93
|
+
id: data.id,
|
|
94
|
+
maxSize: data.max_size,
|
|
95
|
+
minSize: data.min_size,
|
|
96
|
+
modelId: data.model_id,
|
|
97
|
+
modelName: data.model_name,
|
|
98
|
+
name: data.name,
|
|
99
|
+
nodeTypeName: data.node_type_name,
|
|
100
|
+
projectId: data.project_id,
|
|
101
|
+
quantization: data.quantization ? unmarshalDeploymentQuantization(data.quantization) : void 0,
|
|
102
|
+
region: data.region,
|
|
103
|
+
size: data.size,
|
|
104
|
+
status: data.status,
|
|
105
|
+
tags: data.tags,
|
|
106
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
const unmarshalModel = (data) => {
|
|
110
|
+
if (!isJSONObject(data)) {
|
|
111
|
+
throw new TypeError(
|
|
112
|
+
`Unmarshalling the type 'Model' failed as data isn't a dictionary.`
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
createdAt: unmarshalDate(data.created_at),
|
|
117
|
+
description: data.description,
|
|
118
|
+
errorMessage: data.error_message,
|
|
119
|
+
hasEula: data.has_eula,
|
|
120
|
+
id: data.id,
|
|
121
|
+
name: data.name,
|
|
122
|
+
nodesSupport: unmarshalArrayOfObject(
|
|
123
|
+
data.nodes_support,
|
|
124
|
+
unmarshalModelSupportInfo
|
|
125
|
+
),
|
|
126
|
+
parameterSizeBits: data.parameter_size_bits,
|
|
127
|
+
projectId: data.project_id,
|
|
128
|
+
region: data.region,
|
|
129
|
+
sizeBytes: data.size_bytes,
|
|
130
|
+
status: data.status,
|
|
131
|
+
tags: data.tags,
|
|
132
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
const unmarshalListDeploymentsResponse = (data) => {
|
|
136
|
+
if (!isJSONObject(data)) {
|
|
137
|
+
throw new TypeError(
|
|
138
|
+
`Unmarshalling the type 'ListDeploymentsResponse' failed as data isn't a dictionary.`
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
deployments: unmarshalArrayOfObject(data.deployments, unmarshalDeployment),
|
|
143
|
+
totalCount: data.total_count
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
const unmarshalListModelsResponse = (data) => {
|
|
147
|
+
if (!isJSONObject(data)) {
|
|
148
|
+
throw new TypeError(
|
|
149
|
+
`Unmarshalling the type 'ListModelsResponse' failed as data isn't a dictionary.`
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
models: unmarshalArrayOfObject(data.models, unmarshalModel),
|
|
154
|
+
totalCount: data.total_count
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
const unmarshalNodeType = (data) => {
|
|
158
|
+
if (!isJSONObject(data)) {
|
|
159
|
+
throw new TypeError(
|
|
160
|
+
`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
beta: data.beta,
|
|
165
|
+
createdAt: unmarshalDate(data.created_at),
|
|
166
|
+
description: data.description,
|
|
167
|
+
disabled: data.disabled,
|
|
168
|
+
gpus: data.gpus,
|
|
169
|
+
memory: data.memory,
|
|
170
|
+
name: data.name,
|
|
171
|
+
region: data.region,
|
|
172
|
+
stockStatus: data.stock_status,
|
|
173
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
174
|
+
vcpus: data.vcpus,
|
|
175
|
+
vram: data.vram
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
const unmarshalListNodeTypesResponse = (data) => {
|
|
179
|
+
if (!isJSONObject(data)) {
|
|
180
|
+
throw new TypeError(
|
|
181
|
+
`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
return {
|
|
185
|
+
nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
|
|
186
|
+
totalCount: data.total_count
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
const marshalEndpointPrivateNetworkDetails = (request, defaults) => ({
|
|
190
|
+
private_network_id: request.privateNetworkId
|
|
191
|
+
});
|
|
192
|
+
const marshalEndpointPublicNetworkDetails = (request, defaults) => ({});
|
|
193
|
+
const marshalDeploymentQuantization = (request, defaults) => ({
|
|
194
|
+
bits: request.bits
|
|
195
|
+
});
|
|
196
|
+
const marshalEndpointSpec = (request, defaults) => ({
|
|
197
|
+
disable_auth: request.disableAuth,
|
|
198
|
+
...resolveOneOf([
|
|
199
|
+
{
|
|
200
|
+
param: "public_network",
|
|
201
|
+
value: request.publicNetwork !== void 0 ? marshalEndpointPublicNetworkDetails(request.publicNetwork) : void 0
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
param: "private_network",
|
|
205
|
+
value: request.privateNetwork !== void 0 ? marshalEndpointPrivateNetworkDetails(
|
|
206
|
+
request.privateNetwork
|
|
207
|
+
) : void 0
|
|
208
|
+
}
|
|
209
|
+
])
|
|
210
|
+
});
|
|
211
|
+
const marshalCreateDeploymentRequest = (request, defaults) => ({
|
|
212
|
+
accept_eula: request.acceptEula,
|
|
213
|
+
endpoints: request.endpoints.map((elt) => marshalEndpointSpec(elt)),
|
|
214
|
+
max_size: request.maxSize,
|
|
215
|
+
min_size: request.minSize,
|
|
216
|
+
model_id: request.modelId,
|
|
217
|
+
name: request.name || randomName("inference"),
|
|
218
|
+
node_type_name: request.nodeTypeName,
|
|
219
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
220
|
+
quantization: request.quantization !== void 0 ? marshalDeploymentQuantization(request.quantization) : void 0,
|
|
221
|
+
tags: request.tags
|
|
222
|
+
});
|
|
223
|
+
const marshalCreateEndpointRequest = (request, defaults) => ({
|
|
224
|
+
deployment_id: request.deploymentId,
|
|
225
|
+
endpoint: marshalEndpointSpec(request.endpoint)
|
|
226
|
+
});
|
|
227
|
+
const marshalModelSource = (request, defaults) => ({
|
|
228
|
+
url: request.url,
|
|
229
|
+
...resolveOneOf([{ param: "secret", value: request.secret }])
|
|
230
|
+
});
|
|
231
|
+
const marshalCreateModelRequest = (request, defaults) => ({
|
|
232
|
+
name: request.name || randomName("model"),
|
|
233
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
234
|
+
source: marshalModelSource(request.source)
|
|
235
|
+
});
|
|
236
|
+
const marshalUpdateDeploymentRequest = (request, defaults) => ({
|
|
237
|
+
max_size: request.maxSize,
|
|
238
|
+
min_size: request.minSize,
|
|
239
|
+
model_id: request.modelId,
|
|
240
|
+
name: request.name,
|
|
241
|
+
quantization: request.quantization !== void 0 ? marshalDeploymentQuantization(request.quantization) : void 0,
|
|
242
|
+
tags: request.tags
|
|
243
|
+
});
|
|
244
|
+
const marshalUpdateEndpointRequest = (request, defaults) => ({
|
|
245
|
+
disable_auth: request.disableAuth
|
|
246
|
+
});
|
|
247
|
+
export {
|
|
248
|
+
marshalCreateDeploymentRequest,
|
|
249
|
+
marshalCreateEndpointRequest,
|
|
250
|
+
marshalCreateModelRequest,
|
|
251
|
+
marshalUpdateDeploymentRequest,
|
|
252
|
+
marshalUpdateEndpointRequest,
|
|
253
|
+
unmarshalDeployment,
|
|
254
|
+
unmarshalEndpoint,
|
|
255
|
+
unmarshalListDeploymentsResponse,
|
|
256
|
+
unmarshalListModelsResponse,
|
|
257
|
+
unmarshalListNodeTypesResponse,
|
|
258
|
+
unmarshalModel,
|
|
259
|
+
unmarshalModelSupportInfo
|
|
260
|
+
};
|