@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.
@@ -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
- var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
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
- * Locality of this API.
14
- * type {'zone','region','global','unspecified'}
15
- */
16
- static LOCALITY = toApiLocality({ regions: ["fr-par"] });
17
- pageOfListDeployments = (request = {}) => this.client.fetch({
18
- method: "GET",
19
- path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments`,
20
- 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])
21
- }, unmarshalListDeploymentsResponse);
22
- /**
23
- * List inference deployments. List all your inference deployments.
24
- *
25
- * @param request - The request {@link ListDeploymentsRequest}
26
- * @returns A Promise of ListDeploymentsResponse
27
- */
28
- listDeployments = (request = {}) => enrichForPagination("deployments", this.pageOfListDeployments, request);
29
- /**
30
- * Get a deployment. Get the deployment for the given ID.
31
- *
32
- * @param request - The request {@link GetDeploymentRequest}
33
- * @returns A Promise of Deployment
34
- */
35
- getDeployment = (request) => this.client.fetch({
36
- method: "GET",
37
- path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}`
38
- }, unmarshalDeployment);
39
- /**
40
- * Waits for {@link Deployment} to be in a final state.
41
- *
42
- * @param request - The request {@link GetDeploymentRequest}
43
- * @param options - The waiting options
44
- * @returns A Promise of Deployment
45
- */
46
- waitForDeployment = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DEPLOYMENT_TRANSIENT_STATUSES.includes(res.status))), this.getDeployment, request, options);
47
- /**
48
- * Create a deployment. Create a new inference deployment related to a specific model.
49
- *
50
- * @param request - The request {@link CreateDeploymentRequest}
51
- * @returns A Promise of Deployment
52
- */
53
- createDeployment = (request) => this.client.fetch({
54
- body: JSON.stringify(marshalCreateDeploymentRequest(request, this.client.settings)),
55
- headers: jsonContentHeaders,
56
- method: "POST",
57
- path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments`
58
- }, unmarshalDeployment);
59
- /**
60
- * Update a deployment. Update an existing inference deployment.
61
- *
62
- * @param request - The request {@link UpdateDeploymentRequest}
63
- * @returns A Promise of Deployment
64
- */
65
- updateDeployment = (request) => this.client.fetch({
66
- body: JSON.stringify(marshalUpdateDeploymentRequest(request, this.client.settings)),
67
- headers: jsonContentHeaders,
68
- method: "PATCH",
69
- path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}`
70
- }, unmarshalDeployment);
71
- /**
72
- * Delete a deployment. Delete an existing inference deployment.
73
- *
74
- * @param request - The request {@link DeleteDeploymentRequest}
75
- * @returns A Promise of Deployment
76
- */
77
- deleteDeployment = (request) => this.client.fetch({
78
- method: "DELETE",
79
- path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}`
80
- }, unmarshalDeployment);
81
- /**
82
- * Get the CA certificate. Get the CA certificate used for the deployment of private endpoints.
83
- The CA certificate will be returned as a PEM file.
84
- *
85
- * @param request - The request {@link GetDeploymentCertificateRequest}
86
- * @returns A Promise of Blob
87
- */
88
- getDeploymentCertificate = (request) => this.client.fetch({
89
- method: "GET",
90
- path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/certificate`,
91
- urlParams: urlParams(["dl", 1]),
92
- responseType: "blob"
93
- });
94
- /**
95
- * Create an endpoint. Create a new Endpoint related to a specific deployment.
96
- *
97
- * @param request - The request {@link CreateEndpointRequest}
98
- * @returns A Promise of Endpoint
99
- */
100
- createEndpoint = (request) => this.client.fetch({
101
- body: JSON.stringify(marshalCreateEndpointRequest(request, this.client.settings)),
102
- headers: jsonContentHeaders,
103
- method: "POST",
104
- path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints`
105
- }, unmarshalEndpoint);
106
- /**
107
- * Update an endpoint. Update an existing Endpoint.
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,6 +1,6 @@
1
1
  //#region src/v1beta1/content.gen.ts
2
2
  /** Lists transient statutes of the enum {@link DeploymentStatus}. */
3
- var DEPLOYMENT_TRANSIENT_STATUSES = [
3
+ const DEPLOYMENT_TRANSIENT_STATUSES = [
4
4
  "creating",
5
5
  "deploying",
6
6
  "deleting",
@@ -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
- var unmarshalEndpointPrivateNetworkDetails = (data) => {
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
- var unmarshalEndpointPublicAccessDetails = (data) => {
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
- var unmarshalEndpoint = (data) => {
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
- var unmarshalDeployment = (data) => {
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
- var unmarshalModelS3Model = (data) => {
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
- var unmarshalModel = (data) => {
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
- var unmarshalACLRule = (data) => {
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
- var unmarshalAddDeploymentACLRulesResponse = (data) => {
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
- var unmarshalEula = (data) => {
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
- var unmarshalListDeploymentACLRulesResponse = (data) => {
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
- var unmarshalListDeploymentsResponse = (data) => {
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
- var unmarshalListModelsResponse = (data) => {
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
- var unmarshalNodeType = (data) => {
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
- var unmarshalListNodeTypesResponse = (data) => {
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
- var unmarshalSetDeploymentACLRulesResponse = (data) => {
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
- var marshalACLRuleRequest = (request, defaults) => ({
136
+ const marshalACLRuleRequest = (request, defaults) => ({
137
137
  description: request.description,
138
138
  ip: request.ip
139
139
  });
140
- var marshalAddDeploymentACLRulesRequest = (request, defaults) => ({ acls: request.acls !== void 0 ? request.acls.map((elt) => marshalACLRuleRequest(elt, defaults)) : void 0 });
141
- var marshalEndpointSpecPrivateNetwork = (request, defaults) => ({ private_network_id: request.privateNetworkId });
142
- var marshalEndpointSpecPublic = (request, defaults) => ({});
143
- var marshalEndpointSpec = (request, defaults) => ({
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
- var marshalCreateDeploymentRequest = (request, defaults) => ({
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
- var marshalCreateEndpointRequest = (request, defaults) => ({
164
+ const marshalCreateEndpointRequest = (request, defaults) => ({
165
165
  deployment_id: request.deploymentId,
166
166
  endpoint: marshalEndpointSpec(request.endpoint, defaults)
167
167
  });
168
- var marshalSetDeploymentACLRulesRequest = (request, defaults) => ({ acls: request.acls !== void 0 ? request.acls.map((elt) => marshalACLRuleRequest(elt, defaults)) : void 0 });
169
- var marshalUpdateDeploymentRequest = (request, defaults) => ({
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
- var marshalUpdateEndpointRequest = (request, defaults) => ({ disable_auth: request.disableAuth });
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
- var CreateDeploymentRequest = {
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
- var ListDeploymentsRequest = { name: {
33
+ const ListDeploymentsRequest = { name: {
34
34
  maxLength: 255,
35
35
  minLength: 1
36
36
  } };
37
- var ListModelsRequest = { name: {
37
+ const ListModelsRequest = { name: {
38
38
  maxLength: 255,
39
39
  minLength: 1
40
40
  } };
41
- var UpdateDeploymentRequest = {
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.5.0",
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.2.2"
38
+ "@scaleway/sdk-std": "2.4.0"
31
39
  },
32
40
  "peerDependencies": {
33
- "@scaleway/sdk-client": "^2.2.2"
41
+ "@repo/configs": "^0.1.1",
42
+ "@scaleway/sdk-client": "^2.3.0"
34
43
  },
35
44
  "devDependencies": {
36
- "@scaleway/sdk-client": "^2.2.2"
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": "tsc --noEmit",
41
- "type:generate": "tsc --declaration -p tsconfig.build.json",
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
  }