@scaleway/sdk-inference 2.5.0 → 2.7.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/.vite/license.md +3 -0
- package/dist/metadata.gen.d.ts +12 -0
- package/dist/metadata.gen.js +13 -0
- package/dist/v1/api.gen.d.ts +2 -2
- package/dist/v1/api.gen.js +83 -179
- package/dist/v1/content.gen.js +2 -2
- package/dist/v1/marshalling.gen.js +23 -23
- package/dist/v1/metadata.gen.js +1 -1
- package/dist/v1/validation-rules.gen.js +6 -6
- package/dist/v1beta1/api.gen.d.ts +1 -1
- package/dist/v1beta1/api.gen.js +98 -199
- package/dist/v1beta1/content.gen.js +1 -1
- package/dist/v1beta1/marshalling.gen.js +25 -25
- package/dist/v1beta1/validation-rules.gen.js +4 -4
- package/package.json +16 -6
- package/LICENSE +0 -191
package/dist/v1beta1/api.gen.js
CHANGED
|
@@ -2,211 +2,110 @@ import { DEPLOYMENT_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
|
2
2
|
import { marshalAddDeploymentACLRulesRequest, marshalCreateDeploymentRequest, marshalCreateEndpointRequest, marshalSetDeploymentACLRulesRequest, marshalUpdateDeploymentRequest, marshalUpdateEndpointRequest, unmarshalAddDeploymentACLRulesResponse, unmarshalDeployment, unmarshalEndpoint, unmarshalEula, unmarshalListDeploymentACLRulesResponse, unmarshalListDeploymentsResponse, unmarshalListModelsResponse, unmarshalListNodeTypesResponse, unmarshalModel, unmarshalSetDeploymentACLRulesResponse } from "./marshalling.gen.js";
|
|
3
3
|
import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
|
|
4
4
|
//#region src/v1beta1/api.gen.ts
|
|
5
|
-
|
|
5
|
+
const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
6
6
|
/**
|
|
7
7
|
* Managed Inference API.
|
|
8
8
|
|
|
9
9
|
This API allows you to manage your Inference services.
|
|
10
10
|
*/
|
|
11
11
|
var API = class extends API$1 {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
* @param request - The request {@link UpdateEndpointRequest}
|
|
110
|
-
* @returns A Promise of Endpoint
|
|
111
|
-
*/
|
|
112
|
-
updateEndpoint = (request) => this.client.fetch({
|
|
113
|
-
body: JSON.stringify(marshalUpdateEndpointRequest(request, this.client.settings)),
|
|
114
|
-
headers: jsonContentHeaders,
|
|
115
|
-
method: "PATCH",
|
|
116
|
-
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
|
|
117
|
-
}, unmarshalEndpoint);
|
|
118
|
-
/**
|
|
119
|
-
* Delete an endpoint. Delete an existing Endpoint.
|
|
120
|
-
*
|
|
121
|
-
* @param request - The request {@link DeleteEndpointRequest}
|
|
122
|
-
*/
|
|
123
|
-
deleteEndpoint = (request) => this.client.fetch({
|
|
124
|
-
method: "DELETE",
|
|
125
|
-
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
|
|
126
|
-
});
|
|
127
|
-
pageOfListDeploymentACLRules = (request) => this.client.fetch({
|
|
128
|
-
method: "GET",
|
|
129
|
-
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/acls`,
|
|
130
|
-
urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
131
|
-
}, unmarshalListDeploymentACLRulesResponse);
|
|
132
|
-
/**
|
|
133
|
-
* List your ACLs. List ACLs for a specific deployment.
|
|
134
|
-
*
|
|
135
|
-
* @param request - The request {@link ListDeploymentACLRulesRequest}
|
|
136
|
-
* @returns A Promise of ListDeploymentACLRulesResponse
|
|
137
|
-
*/
|
|
138
|
-
listDeploymentACLRules = (request) => enrichForPagination("rules", this.pageOfListDeploymentACLRules, request);
|
|
139
|
-
/**
|
|
140
|
-
* Add new ACLs. Add new ACL rules for a specific deployment.
|
|
141
|
-
*
|
|
142
|
-
* @param request - The request {@link AddDeploymentACLRulesRequest}
|
|
143
|
-
* @returns A Promise of AddDeploymentACLRulesResponse
|
|
144
|
-
*/
|
|
145
|
-
addDeploymentACLRules = (request) => this.client.fetch({
|
|
146
|
-
body: JSON.stringify(marshalAddDeploymentACLRulesRequest(request, this.client.settings)),
|
|
147
|
-
headers: jsonContentHeaders,
|
|
148
|
-
method: "POST",
|
|
149
|
-
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/acls`
|
|
150
|
-
}, unmarshalAddDeploymentACLRulesResponse);
|
|
151
|
-
/**
|
|
152
|
-
* Set new ACL. Set new ACL rules for a specific deployment.
|
|
153
|
-
*
|
|
154
|
-
* @param request - The request {@link SetDeploymentACLRulesRequest}
|
|
155
|
-
* @returns A Promise of SetDeploymentACLRulesResponse
|
|
156
|
-
*/
|
|
157
|
-
setDeploymentACLRules = (request) => this.client.fetch({
|
|
158
|
-
body: JSON.stringify(marshalSetDeploymentACLRulesRequest(request, this.client.settings)),
|
|
159
|
-
headers: jsonContentHeaders,
|
|
160
|
-
method: "PUT",
|
|
161
|
-
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/acls`
|
|
162
|
-
}, unmarshalSetDeploymentACLRulesResponse);
|
|
163
|
-
/**
|
|
164
|
-
* Delete an existing ACL.
|
|
165
|
-
*
|
|
166
|
-
* @param request - The request {@link DeleteDeploymentACLRuleRequest}
|
|
167
|
-
*/
|
|
168
|
-
deleteDeploymentACLRule = (request) => this.client.fetch({
|
|
169
|
-
method: "DELETE",
|
|
170
|
-
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam("aclId", request.aclId)}`
|
|
171
|
-
});
|
|
172
|
-
pageOfListModels = (request = {}) => this.client.fetch({
|
|
173
|
-
method: "GET",
|
|
174
|
-
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models`,
|
|
175
|
-
urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["tags", request.tags])
|
|
176
|
-
}, unmarshalListModelsResponse);
|
|
177
|
-
/**
|
|
178
|
-
* List models. List all available models.
|
|
179
|
-
*
|
|
180
|
-
* @param request - The request {@link ListModelsRequest}
|
|
181
|
-
* @returns A Promise of ListModelsResponse
|
|
182
|
-
*/
|
|
183
|
-
listModels = (request = {}) => enrichForPagination("models", this.pageOfListModels, request);
|
|
184
|
-
/**
|
|
185
|
-
* Get a model. Get the model for the given ID.
|
|
186
|
-
*
|
|
187
|
-
* @param request - The request {@link GetModelRequest}
|
|
188
|
-
* @returns A Promise of Model
|
|
189
|
-
*/
|
|
190
|
-
getModel = (request) => this.client.fetch({
|
|
191
|
-
method: "GET",
|
|
192
|
-
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models/${validatePathParam("modelId", request.modelId)}`
|
|
193
|
-
}, unmarshalModel);
|
|
194
|
-
getModelEula = (request) => this.client.fetch({
|
|
195
|
-
method: "GET",
|
|
196
|
-
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models/${validatePathParam("modelId", request.modelId)}/eula`
|
|
197
|
-
}, unmarshalEula);
|
|
198
|
-
pageOfListNodeTypes = (request) => this.client.fetch({
|
|
199
|
-
method: "GET",
|
|
200
|
-
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`,
|
|
201
|
-
urlParams: urlParams(["include_disabled_types", request.includeDisabledTypes], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
202
|
-
}, unmarshalListNodeTypesResponse);
|
|
203
|
-
/**
|
|
204
|
-
* List available node types. List all available node types. By default, the node types returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
|
|
205
|
-
*
|
|
206
|
-
* @param request - The request {@link ListNodeTypesRequest}
|
|
207
|
-
* @returns A Promise of ListNodeTypesResponse
|
|
208
|
-
*/
|
|
209
|
-
listNodeTypes = (request) => enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request);
|
|
12
|
+
constructor(..._args) {
|
|
13
|
+
super(..._args);
|
|
14
|
+
this.pageOfListDeployments = (request = {}) => this.client.fetch({
|
|
15
|
+
method: "GET",
|
|
16
|
+
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments`,
|
|
17
|
+
urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["tags", request.tags])
|
|
18
|
+
}, unmarshalListDeploymentsResponse);
|
|
19
|
+
this.listDeployments = (request = {}) => enrichForPagination("deployments", this.pageOfListDeployments, request);
|
|
20
|
+
this.getDeployment = (request) => this.client.fetch({
|
|
21
|
+
method: "GET",
|
|
22
|
+
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}`
|
|
23
|
+
}, unmarshalDeployment);
|
|
24
|
+
this.waitForDeployment = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DEPLOYMENT_TRANSIENT_STATUSES.includes(res.status))), this.getDeployment, request, options);
|
|
25
|
+
this.createDeployment = (request) => this.client.fetch({
|
|
26
|
+
body: JSON.stringify(marshalCreateDeploymentRequest(request, this.client.settings)),
|
|
27
|
+
headers: jsonContentHeaders,
|
|
28
|
+
method: "POST",
|
|
29
|
+
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments`
|
|
30
|
+
}, unmarshalDeployment);
|
|
31
|
+
this.updateDeployment = (request) => this.client.fetch({
|
|
32
|
+
body: JSON.stringify(marshalUpdateDeploymentRequest(request, this.client.settings)),
|
|
33
|
+
headers: jsonContentHeaders,
|
|
34
|
+
method: "PATCH",
|
|
35
|
+
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}`
|
|
36
|
+
}, unmarshalDeployment);
|
|
37
|
+
this.deleteDeployment = (request) => this.client.fetch({
|
|
38
|
+
method: "DELETE",
|
|
39
|
+
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}`
|
|
40
|
+
}, unmarshalDeployment);
|
|
41
|
+
this.getDeploymentCertificate = (request) => this.client.fetch({
|
|
42
|
+
method: "GET",
|
|
43
|
+
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/certificate`,
|
|
44
|
+
urlParams: urlParams(["dl", 1]),
|
|
45
|
+
responseType: "blob"
|
|
46
|
+
});
|
|
47
|
+
this.createEndpoint = (request) => this.client.fetch({
|
|
48
|
+
body: JSON.stringify(marshalCreateEndpointRequest(request, this.client.settings)),
|
|
49
|
+
headers: jsonContentHeaders,
|
|
50
|
+
method: "POST",
|
|
51
|
+
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints`
|
|
52
|
+
}, unmarshalEndpoint);
|
|
53
|
+
this.updateEndpoint = (request) => this.client.fetch({
|
|
54
|
+
body: JSON.stringify(marshalUpdateEndpointRequest(request, this.client.settings)),
|
|
55
|
+
headers: jsonContentHeaders,
|
|
56
|
+
method: "PATCH",
|
|
57
|
+
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
|
|
58
|
+
}, unmarshalEndpoint);
|
|
59
|
+
this.deleteEndpoint = (request) => this.client.fetch({
|
|
60
|
+
method: "DELETE",
|
|
61
|
+
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
|
|
62
|
+
});
|
|
63
|
+
this.pageOfListDeploymentACLRules = (request) => this.client.fetch({
|
|
64
|
+
method: "GET",
|
|
65
|
+
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/acls`,
|
|
66
|
+
urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
67
|
+
}, unmarshalListDeploymentACLRulesResponse);
|
|
68
|
+
this.listDeploymentACLRules = (request) => enrichForPagination("rules", this.pageOfListDeploymentACLRules, request);
|
|
69
|
+
this.addDeploymentACLRules = (request) => this.client.fetch({
|
|
70
|
+
body: JSON.stringify(marshalAddDeploymentACLRulesRequest(request, this.client.settings)),
|
|
71
|
+
headers: jsonContentHeaders,
|
|
72
|
+
method: "POST",
|
|
73
|
+
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/acls`
|
|
74
|
+
}, unmarshalAddDeploymentACLRulesResponse);
|
|
75
|
+
this.setDeploymentACLRules = (request) => this.client.fetch({
|
|
76
|
+
body: JSON.stringify(marshalSetDeploymentACLRulesRequest(request, this.client.settings)),
|
|
77
|
+
headers: jsonContentHeaders,
|
|
78
|
+
method: "PUT",
|
|
79
|
+
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/acls`
|
|
80
|
+
}, unmarshalSetDeploymentACLRulesResponse);
|
|
81
|
+
this.deleteDeploymentACLRule = (request) => this.client.fetch({
|
|
82
|
+
method: "DELETE",
|
|
83
|
+
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam("aclId", request.aclId)}`
|
|
84
|
+
});
|
|
85
|
+
this.pageOfListModels = (request = {}) => this.client.fetch({
|
|
86
|
+
method: "GET",
|
|
87
|
+
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models`,
|
|
88
|
+
urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["tags", request.tags])
|
|
89
|
+
}, unmarshalListModelsResponse);
|
|
90
|
+
this.listModels = (request = {}) => enrichForPagination("models", this.pageOfListModels, request);
|
|
91
|
+
this.getModel = (request) => this.client.fetch({
|
|
92
|
+
method: "GET",
|
|
93
|
+
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models/${validatePathParam("modelId", request.modelId)}`
|
|
94
|
+
}, unmarshalModel);
|
|
95
|
+
this.getModelEula = (request) => this.client.fetch({
|
|
96
|
+
method: "GET",
|
|
97
|
+
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models/${validatePathParam("modelId", request.modelId)}/eula`
|
|
98
|
+
}, unmarshalEula);
|
|
99
|
+
this.pageOfListNodeTypes = (request) => this.client.fetch({
|
|
100
|
+
method: "GET",
|
|
101
|
+
path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`,
|
|
102
|
+
urlParams: urlParams(["include_disabled_types", request.includeDisabledTypes], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
103
|
+
}, unmarshalListNodeTypesResponse);
|
|
104
|
+
this.listNodeTypes = (request) => enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request);
|
|
105
|
+
}
|
|
106
|
+
static {
|
|
107
|
+
this.LOCALITY = toApiLocality({ regions: ["fr-par"] });
|
|
108
|
+
}
|
|
210
109
|
};
|
|
211
110
|
//#endregion
|
|
212
111
|
export { API };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
|
|
2
2
|
import randomName from "@scaleway/random-name";
|
|
3
3
|
//#region src/v1beta1/marshalling.gen.ts
|
|
4
|
-
|
|
4
|
+
const unmarshalEndpointPrivateNetworkDetails = (data) => {
|
|
5
5
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`);
|
|
6
6
|
return { privateNetworkId: data.private_network_id };
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
const unmarshalEndpointPublicAccessDetails = (data) => {
|
|
9
9
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPublicAccessDetails' failed as data isn't a dictionary.`);
|
|
10
10
|
return {};
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
const unmarshalEndpoint = (data) => {
|
|
13
13
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);
|
|
14
14
|
return {
|
|
15
15
|
disableAuth: data.disable_auth,
|
|
@@ -19,7 +19,7 @@ var unmarshalEndpoint = (data) => {
|
|
|
19
19
|
url: data.url
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
const unmarshalDeployment = (data) => {
|
|
23
23
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Deployment' failed as data isn't a dictionary.`);
|
|
24
24
|
return {
|
|
25
25
|
createdAt: unmarshalDate(data.created_at),
|
|
@@ -40,7 +40,7 @@ var unmarshalDeployment = (data) => {
|
|
|
40
40
|
updatedAt: unmarshalDate(data.updated_at)
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
|
-
|
|
43
|
+
const unmarshalModelS3Model = (data) => {
|
|
44
44
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ModelS3Model' failed as data isn't a dictionary.`);
|
|
45
45
|
return {
|
|
46
46
|
nodeType: data.node_type,
|
|
@@ -49,7 +49,7 @@ var unmarshalModelS3Model = (data) => {
|
|
|
49
49
|
tritonServerVersion: data.triton_server_version
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
const unmarshalModel = (data) => {
|
|
53
53
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Model' failed as data isn't a dictionary.`);
|
|
54
54
|
return {
|
|
55
55
|
compatibleNodeTypes: data.compatible_node_types,
|
|
@@ -68,7 +68,7 @@ var unmarshalModel = (data) => {
|
|
|
68
68
|
updatedAt: unmarshalDate(data.updated_at)
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
|
-
|
|
71
|
+
const unmarshalACLRule = (data) => {
|
|
72
72
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`);
|
|
73
73
|
return {
|
|
74
74
|
description: data.description,
|
|
@@ -76,36 +76,36 @@ var unmarshalACLRule = (data) => {
|
|
|
76
76
|
ip: data.ip
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
|
-
|
|
79
|
+
const unmarshalAddDeploymentACLRulesResponse = (data) => {
|
|
80
80
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'AddDeploymentACLRulesResponse' failed as data isn't a dictionary.`);
|
|
81
81
|
return { rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule) };
|
|
82
82
|
};
|
|
83
|
-
|
|
83
|
+
const unmarshalEula = (data) => {
|
|
84
84
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Eula' failed as data isn't a dictionary.`);
|
|
85
85
|
return { content: data.content };
|
|
86
86
|
};
|
|
87
|
-
|
|
87
|
+
const unmarshalListDeploymentACLRulesResponse = (data) => {
|
|
88
88
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDeploymentACLRulesResponse' failed as data isn't a dictionary.`);
|
|
89
89
|
return {
|
|
90
90
|
rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule),
|
|
91
91
|
totalCount: data.total_count
|
|
92
92
|
};
|
|
93
93
|
};
|
|
94
|
-
|
|
94
|
+
const unmarshalListDeploymentsResponse = (data) => {
|
|
95
95
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDeploymentsResponse' failed as data isn't a dictionary.`);
|
|
96
96
|
return {
|
|
97
97
|
deployments: unmarshalArrayOfObject(data.deployments, unmarshalDeployment),
|
|
98
98
|
totalCount: data.total_count
|
|
99
99
|
};
|
|
100
100
|
};
|
|
101
|
-
|
|
101
|
+
const unmarshalListModelsResponse = (data) => {
|
|
102
102
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListModelsResponse' failed as data isn't a dictionary.`);
|
|
103
103
|
return {
|
|
104
104
|
models: unmarshalArrayOfObject(data.models, unmarshalModel),
|
|
105
105
|
totalCount: data.total_count
|
|
106
106
|
};
|
|
107
107
|
};
|
|
108
|
-
|
|
108
|
+
const unmarshalNodeType = (data) => {
|
|
109
109
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`);
|
|
110
110
|
return {
|
|
111
111
|
beta: data.beta,
|
|
@@ -122,25 +122,25 @@ var unmarshalNodeType = (data) => {
|
|
|
122
122
|
vram: data.vram
|
|
123
123
|
};
|
|
124
124
|
};
|
|
125
|
-
|
|
125
|
+
const unmarshalListNodeTypesResponse = (data) => {
|
|
126
126
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);
|
|
127
127
|
return {
|
|
128
128
|
nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
|
|
129
129
|
totalCount: data.total_count
|
|
130
130
|
};
|
|
131
131
|
};
|
|
132
|
-
|
|
132
|
+
const unmarshalSetDeploymentACLRulesResponse = (data) => {
|
|
133
133
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetDeploymentACLRulesResponse' failed as data isn't a dictionary.`);
|
|
134
134
|
return { rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule) };
|
|
135
135
|
};
|
|
136
|
-
|
|
136
|
+
const marshalACLRuleRequest = (request, defaults) => ({
|
|
137
137
|
description: request.description,
|
|
138
138
|
ip: request.ip
|
|
139
139
|
});
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
140
|
+
const marshalAddDeploymentACLRulesRequest = (request, defaults) => ({ acls: request.acls !== void 0 ? request.acls.map((elt) => marshalACLRuleRequest(elt, defaults)) : void 0 });
|
|
141
|
+
const marshalEndpointSpecPrivateNetwork = (request, defaults) => ({ private_network_id: request.privateNetworkId });
|
|
142
|
+
const marshalEndpointSpecPublic = (request, defaults) => ({});
|
|
143
|
+
const marshalEndpointSpec = (request, defaults) => ({
|
|
144
144
|
disable_auth: request.disableAuth,
|
|
145
145
|
...resolveOneOf([{
|
|
146
146
|
param: "public",
|
|
@@ -150,7 +150,7 @@ var marshalEndpointSpec = (request, defaults) => ({
|
|
|
150
150
|
value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetwork(request.privateNetwork, defaults) : void 0
|
|
151
151
|
}])
|
|
152
152
|
});
|
|
153
|
-
|
|
153
|
+
const marshalCreateDeploymentRequest = (request, defaults) => ({
|
|
154
154
|
accept_eula: request.acceptEula,
|
|
155
155
|
endpoints: request.endpoints.map((elt) => marshalEndpointSpec(elt, defaults)),
|
|
156
156
|
max_size: request.maxSize,
|
|
@@ -161,17 +161,17 @@ var marshalCreateDeploymentRequest = (request, defaults) => ({
|
|
|
161
161
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
162
162
|
tags: request.tags
|
|
163
163
|
});
|
|
164
|
-
|
|
164
|
+
const marshalCreateEndpointRequest = (request, defaults) => ({
|
|
165
165
|
deployment_id: request.deploymentId,
|
|
166
166
|
endpoint: marshalEndpointSpec(request.endpoint, defaults)
|
|
167
167
|
});
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
const marshalSetDeploymentACLRulesRequest = (request, defaults) => ({ acls: request.acls !== void 0 ? request.acls.map((elt) => marshalACLRuleRequest(elt, defaults)) : void 0 });
|
|
169
|
+
const marshalUpdateDeploymentRequest = (request, defaults) => ({
|
|
170
170
|
max_size: request.maxSize,
|
|
171
171
|
min_size: request.minSize,
|
|
172
172
|
name: request.name,
|
|
173
173
|
tags: request.tags
|
|
174
174
|
});
|
|
175
|
-
|
|
175
|
+
const marshalUpdateEndpointRequest = (request, defaults) => ({ disable_auth: request.disableAuth });
|
|
176
176
|
//#endregion
|
|
177
177
|
export { marshalAddDeploymentACLRulesRequest, marshalCreateDeploymentRequest, marshalCreateEndpointRequest, marshalSetDeploymentACLRulesRequest, marshalUpdateDeploymentRequest, marshalUpdateEndpointRequest, unmarshalAddDeploymentACLRulesResponse, unmarshalDeployment, unmarshalEndpoint, unmarshalEula, unmarshalListDeploymentACLRulesResponse, unmarshalListDeploymentsResponse, unmarshalListModelsResponse, unmarshalListNodeTypesResponse, unmarshalModel, unmarshalSetDeploymentACLRulesResponse };
|
|
@@ -6,7 +6,7 @@ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
6
6
|
ListModelsRequest: () => ListModelsRequest,
|
|
7
7
|
UpdateDeploymentRequest: () => UpdateDeploymentRequest
|
|
8
8
|
});
|
|
9
|
-
|
|
9
|
+
const CreateDeploymentRequest = {
|
|
10
10
|
maxSize: {
|
|
11
11
|
greaterThanOrEqual: 1,
|
|
12
12
|
lessThanOrEqual: 50
|
|
@@ -30,15 +30,15 @@ var CreateDeploymentRequest = {
|
|
|
30
30
|
minLength: 1
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
-
|
|
33
|
+
const ListDeploymentsRequest = { name: {
|
|
34
34
|
maxLength: 255,
|
|
35
35
|
minLength: 1
|
|
36
36
|
} };
|
|
37
|
-
|
|
37
|
+
const ListModelsRequest = { name: {
|
|
38
38
|
maxLength: 255,
|
|
39
39
|
minLength: 1
|
|
40
40
|
} };
|
|
41
|
-
|
|
41
|
+
const UpdateDeploymentRequest = {
|
|
42
42
|
maxSize: {
|
|
43
43
|
greaterThanOrEqual: 1,
|
|
44
44
|
lessThanOrEqual: 50
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk-inference",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "Scaleway SDK inference",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"files": [
|
|
@@ -16,6 +16,14 @@
|
|
|
16
16
|
"./*": {
|
|
17
17
|
"types": "./dist/*/index.gen.d.ts",
|
|
18
18
|
"default": "./dist/*/index.gen.js"
|
|
19
|
+
},
|
|
20
|
+
"./metadata": {
|
|
21
|
+
"types": "./dist/metadata.gen.d.ts",
|
|
22
|
+
"default": "./dist/metadata.gen.js"
|
|
23
|
+
},
|
|
24
|
+
"./*/metadata": {
|
|
25
|
+
"types": "./dist/*/metadata.gen.d.ts",
|
|
26
|
+
"default": "./dist/*/metadata.gen.js"
|
|
19
27
|
}
|
|
20
28
|
},
|
|
21
29
|
"repository": {
|
|
@@ -27,18 +35,20 @@
|
|
|
27
35
|
},
|
|
28
36
|
"dependencies": {
|
|
29
37
|
"@scaleway/random-name": "5.1.4",
|
|
30
|
-
"@scaleway/sdk-std": "2.
|
|
38
|
+
"@scaleway/sdk-std": "2.4.0"
|
|
31
39
|
},
|
|
32
40
|
"peerDependencies": {
|
|
33
|
-
"@
|
|
41
|
+
"@repo/configs": "^0.1.1",
|
|
42
|
+
"@scaleway/sdk-client": "^2.3.0"
|
|
34
43
|
},
|
|
35
44
|
"devDependencies": {
|
|
36
|
-
"@
|
|
45
|
+
"@repo/configs": "^0.1.1",
|
|
46
|
+
"@scaleway/sdk-client": "^2.3.0"
|
|
37
47
|
},
|
|
38
48
|
"scripts": {
|
|
39
49
|
"package:check": "pnpm publint",
|
|
40
|
-
"typecheck": "
|
|
41
|
-
"type:generate": "
|
|
50
|
+
"typecheck": "tsgo --noEmit",
|
|
51
|
+
"type:generate": "tsgo --declaration -p tsconfig.build.json",
|
|
42
52
|
"build": "vite build --config vite.config.ts && pnpm run type:generate",
|
|
43
53
|
"build:profile": "npx vite-bundle-visualizer -c vite.config.ts"
|
|
44
54
|
}
|