@scaleway/sdk-datawarehouse 2.3.1 → 2.5.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.
@@ -1,13 +1,12 @@
1
+ /** Lists transient statutes of the enum {@link DeploymentStatus}. */
1
2
  const DEPLOYMENT_TRANSIENT_STATUSES = [
2
- "creating",
3
- "configuring",
4
- "deleting",
5
- "locking",
6
- "unlocking",
7
- "deploying",
8
- "stopping",
9
- "starting"
3
+ "creating",
4
+ "configuring",
5
+ "deleting",
6
+ "locking",
7
+ "unlocking",
8
+ "deploying",
9
+ "stopping",
10
+ "starting"
10
11
  ];
11
- export {
12
- DEPLOYMENT_TRANSIENT_STATUSES
13
- };
12
+ export { DEPLOYMENT_TRANSIENT_STATUSES };
@@ -1,24 +1,26 @@
1
- import { API } from "./api.gen.js";
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { DEPLOYMENT_TRANSIENT_STATUSES } from "./content.gen.js";
3
3
  import { marshalCreateDatabaseRequest, marshalCreateDeploymentRequest, marshalCreateEndpointRequest, marshalCreateUserRequest, marshalUpdateDeploymentRequest, marshalUpdateUserRequest, unmarshalDatabase, unmarshalDeployment, unmarshalEndpoint, unmarshalListDatabasesResponse, unmarshalListDeploymentsResponse, unmarshalListPresetsResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalUser } from "./marshalling.gen.js";
4
- import * as validationRules_gen from "./validation-rules.gen.js";
5
- export {
6
- API,
7
- DEPLOYMENT_TRANSIENT_STATUSES,
8
- validationRules_gen as ValidationRules,
9
- marshalCreateDatabaseRequest,
10
- marshalCreateDeploymentRequest,
11
- marshalCreateEndpointRequest,
12
- marshalCreateUserRequest,
13
- marshalUpdateDeploymentRequest,
14
- marshalUpdateUserRequest,
15
- unmarshalDatabase,
16
- unmarshalDeployment,
17
- unmarshalEndpoint,
18
- unmarshalListDatabasesResponse,
19
- unmarshalListDeploymentsResponse,
20
- unmarshalListPresetsResponse,
21
- unmarshalListUsersResponse,
22
- unmarshalListVersionsResponse,
23
- unmarshalUser
24
- };
4
+ import { API } from "./api.gen.js";
5
+ import { validation_rules_gen_exports } from "./validation-rules.gen.js";
6
+ var index_gen_exports = /* @__PURE__ */ __exportAll({
7
+ API: () => API,
8
+ DEPLOYMENT_TRANSIENT_STATUSES: () => DEPLOYMENT_TRANSIENT_STATUSES,
9
+ ValidationRules: () => validation_rules_gen_exports,
10
+ marshalCreateDatabaseRequest: () => marshalCreateDatabaseRequest,
11
+ marshalCreateDeploymentRequest: () => marshalCreateDeploymentRequest,
12
+ marshalCreateEndpointRequest: () => marshalCreateEndpointRequest,
13
+ marshalCreateUserRequest: () => marshalCreateUserRequest,
14
+ marshalUpdateDeploymentRequest: () => marshalUpdateDeploymentRequest,
15
+ marshalUpdateUserRequest: () => marshalUpdateUserRequest,
16
+ unmarshalDatabase: () => unmarshalDatabase,
17
+ unmarshalDeployment: () => unmarshalDeployment,
18
+ unmarshalEndpoint: () => unmarshalEndpoint,
19
+ unmarshalListDatabasesResponse: () => unmarshalListDatabasesResponse,
20
+ unmarshalListDeploymentsResponse: () => unmarshalListDeploymentsResponse,
21
+ unmarshalListPresetsResponse: () => unmarshalListPresetsResponse,
22
+ unmarshalListUsersResponse: () => unmarshalListUsersResponse,
23
+ unmarshalListVersionsResponse: () => unmarshalListVersionsResponse,
24
+ unmarshalUser: () => unmarshalUser
25
+ });
26
+ export { index_gen_exports };
@@ -1,239 +1,159 @@
1
- import { resolveOneOf, isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
- const unmarshalEndpointPrivateNetworkDetails = (data) => {
3
- if (!isJSONObject(data)) {
4
- throw new TypeError(
5
- `Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`
6
- );
7
- }
8
- return {
9
- privateNetworkId: data.private_network_id
10
- };
1
+ import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
+ var unmarshalEndpointPrivateNetworkDetails = (data) => {
3
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`);
4
+ return { privateNetworkId: data.private_network_id };
11
5
  };
12
- const unmarshalEndpointPublicDetails = (data) => {
13
- if (!isJSONObject(data)) {
14
- throw new TypeError(
15
- `Unmarshalling the type 'EndpointPublicDetails' failed as data isn't a dictionary.`
16
- );
17
- }
18
- return {};
6
+ var unmarshalEndpointPublicDetails = (data) => {
7
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPublicDetails' failed as data isn't a dictionary.`);
8
+ return {};
19
9
  };
20
- const unmarshalEndpointService = (data) => {
21
- if (!isJSONObject(data)) {
22
- throw new TypeError(
23
- `Unmarshalling the type 'EndpointService' failed as data isn't a dictionary.`
24
- );
25
- }
26
- return {
27
- port: data.port,
28
- protocol: data.protocol
29
- };
10
+ var unmarshalEndpointService = (data) => {
11
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointService' failed as data isn't a dictionary.`);
12
+ return {
13
+ port: data.port,
14
+ protocol: data.protocol
15
+ };
30
16
  };
31
17
  const unmarshalEndpoint = (data) => {
32
- if (!isJSONObject(data)) {
33
- throw new TypeError(
34
- `Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`
35
- );
36
- }
37
- return {
38
- dnsRecord: data.dns_record,
39
- id: data.id,
40
- privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0,
41
- public: data.public ? unmarshalEndpointPublicDetails(data.public) : void 0,
42
- services: unmarshalArrayOfObject(data.services, unmarshalEndpointService)
43
- };
18
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);
19
+ return {
20
+ dnsRecord: data.dns_record,
21
+ id: data.id,
22
+ privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0,
23
+ public: data.public ? unmarshalEndpointPublicDetails(data.public) : void 0,
24
+ services: unmarshalArrayOfObject(data.services, unmarshalEndpointService)
25
+ };
44
26
  };
45
27
  const unmarshalDatabase = (data) => {
46
- if (!isJSONObject(data)) {
47
- throw new TypeError(
48
- `Unmarshalling the type 'Database' failed as data isn't a dictionary.`
49
- );
50
- }
51
- return {
52
- name: data.name,
53
- size: data.size
54
- };
28
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Database' failed as data isn't a dictionary.`);
29
+ return {
30
+ name: data.name,
31
+ size: data.size
32
+ };
55
33
  };
56
34
  const unmarshalDeployment = (data) => {
57
- if (!isJSONObject(data)) {
58
- throw new TypeError(
59
- `Unmarshalling the type 'Deployment' failed as data isn't a dictionary.`
60
- );
61
- }
62
- return {
63
- cpuMax: data.cpu_max,
64
- cpuMin: data.cpu_min,
65
- createdAt: unmarshalDate(data.created_at),
66
- endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
67
- id: data.id,
68
- name: data.name,
69
- organizationId: data.organization_id,
70
- projectId: data.project_id,
71
- ramPerCpu: data.ram_per_cpu,
72
- region: data.region,
73
- replicaCount: data.replica_count,
74
- status: data.status,
75
- tags: data.tags,
76
- updatedAt: unmarshalDate(data.updated_at),
77
- version: data.version
78
- };
35
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Deployment' failed as data isn't a dictionary.`);
36
+ return {
37
+ cpuMax: data.cpu_max,
38
+ cpuMin: data.cpu_min,
39
+ createdAt: unmarshalDate(data.created_at),
40
+ endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
41
+ id: data.id,
42
+ name: data.name,
43
+ organizationId: data.organization_id,
44
+ projectId: data.project_id,
45
+ ramPerCpu: data.ram_per_cpu,
46
+ region: data.region,
47
+ replicaCount: data.replica_count,
48
+ shardCount: data.shard_count,
49
+ status: data.status,
50
+ tags: data.tags,
51
+ updatedAt: unmarshalDate(data.updated_at),
52
+ version: data.version
53
+ };
79
54
  };
80
55
  const unmarshalUser = (data) => {
81
- if (!isJSONObject(data)) {
82
- throw new TypeError(
83
- `Unmarshalling the type 'User' failed as data isn't a dictionary.`
84
- );
85
- }
86
- return {
87
- isAdmin: data.is_admin,
88
- name: data.name
89
- };
56
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`);
57
+ return {
58
+ isAdmin: data.is_admin,
59
+ name: data.name
60
+ };
90
61
  };
91
62
  const unmarshalListDatabasesResponse = (data) => {
92
- if (!isJSONObject(data)) {
93
- throw new TypeError(
94
- `Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`
95
- );
96
- }
97
- return {
98
- databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase),
99
- totalCount: data.total_count
100
- };
63
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`);
64
+ return {
65
+ databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase),
66
+ totalCount: data.total_count
67
+ };
101
68
  };
102
69
  const unmarshalListDeploymentsResponse = (data) => {
103
- if (!isJSONObject(data)) {
104
- throw new TypeError(
105
- `Unmarshalling the type 'ListDeploymentsResponse' failed as data isn't a dictionary.`
106
- );
107
- }
108
- return {
109
- deployments: unmarshalArrayOfObject(data.deployments, unmarshalDeployment),
110
- totalCount: data.total_count
111
- };
70
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDeploymentsResponse' failed as data isn't a dictionary.`);
71
+ return {
72
+ deployments: unmarshalArrayOfObject(data.deployments, unmarshalDeployment),
73
+ totalCount: data.total_count
74
+ };
112
75
  };
113
- const unmarshalPreset = (data) => {
114
- if (!isJSONObject(data)) {
115
- throw new TypeError(
116
- `Unmarshalling the type 'Preset' failed as data isn't a dictionary.`
117
- );
118
- }
119
- return {
120
- category: data.category,
121
- cpuMax: data.cpu_max,
122
- cpuMin: data.cpu_min,
123
- name: data.name,
124
- ramPerCpu: data.ram_per_cpu,
125
- replicaCount: data.replica_count
126
- };
76
+ var unmarshalPreset = (data) => {
77
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Preset' failed as data isn't a dictionary.`);
78
+ return {
79
+ category: data.category,
80
+ cpuMax: data.cpu_max,
81
+ cpuMin: data.cpu_min,
82
+ name: data.name,
83
+ ramPerCpu: data.ram_per_cpu,
84
+ replicaCount: data.replica_count,
85
+ shardCount: data.shard_count
86
+ };
127
87
  };
128
88
  const unmarshalListPresetsResponse = (data) => {
129
- if (!isJSONObject(data)) {
130
- throw new TypeError(
131
- `Unmarshalling the type 'ListPresetsResponse' failed as data isn't a dictionary.`
132
- );
133
- }
134
- return {
135
- presets: unmarshalArrayOfObject(data.presets, unmarshalPreset),
136
- totalCount: data.total_count
137
- };
89
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListPresetsResponse' failed as data isn't a dictionary.`);
90
+ return {
91
+ presets: unmarshalArrayOfObject(data.presets, unmarshalPreset),
92
+ totalCount: data.total_count
93
+ };
138
94
  };
139
95
  const unmarshalListUsersResponse = (data) => {
140
- if (!isJSONObject(data)) {
141
- throw new TypeError(
142
- `Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`
143
- );
144
- }
145
- return {
146
- totalCount: data.total_count,
147
- users: unmarshalArrayOfObject(data.users, unmarshalUser)
148
- };
96
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`);
97
+ return {
98
+ totalCount: data.total_count,
99
+ users: unmarshalArrayOfObject(data.users, unmarshalUser)
100
+ };
149
101
  };
150
- const unmarshalVersion = (data) => {
151
- if (!isJSONObject(data)) {
152
- throw new TypeError(
153
- `Unmarshalling the type 'Version' failed as data isn't a dictionary.`
154
- );
155
- }
156
- return {
157
- endOfLifeAt: unmarshalDate(data.end_of_life_at),
158
- version: data.version
159
- };
102
+ var unmarshalVersion = (data) => {
103
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Version' failed as data isn't a dictionary.`);
104
+ return {
105
+ endOfLifeAt: unmarshalDate(data.end_of_life_at),
106
+ version: data.version
107
+ };
160
108
  };
161
109
  const unmarshalListVersionsResponse = (data) => {
162
- if (!isJSONObject(data)) {
163
- throw new TypeError(
164
- `Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`
165
- );
166
- }
167
- return {
168
- totalCount: data.total_count,
169
- versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)
170
- };
110
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`);
111
+ return {
112
+ totalCount: data.total_count,
113
+ versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)
114
+ };
171
115
  };
172
- const marshalCreateDatabaseRequest = (request, defaults) => ({
173
- name: request.name
174
- });
175
- const marshalEndpointSpecPrivateNetworkDetails = (request, defaults) => ({
176
- private_network_id: request.privateNetworkId
177
- });
178
- const marshalEndpointSpecPublicDetails = (request, defaults) => ({});
179
- const marshalEndpointSpec = (request, defaults) => ({
180
- ...resolveOneOf([
181
- {
182
- param: "public",
183
- value: request.public !== void 0 ? marshalEndpointSpecPublicDetails(request.public) : void 0
184
- },
185
- {
186
- param: "private_network",
187
- value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkDetails(request.privateNetwork) : void 0
188
- }
189
- ])
190
- });
116
+ const marshalCreateDatabaseRequest = (request, defaults) => ({ name: request.name });
117
+ var marshalEndpointSpecPrivateNetworkDetails = (request, defaults) => ({ private_network_id: request.privateNetworkId });
118
+ var marshalEndpointSpecPublicDetails = (request, defaults) => ({});
119
+ var marshalEndpointSpec = (request, defaults) => ({ ...resolveOneOf([{
120
+ param: "public",
121
+ value: request.public !== void 0 ? marshalEndpointSpecPublicDetails(request.public, defaults) : void 0
122
+ }, {
123
+ param: "private_network",
124
+ value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkDetails(request.privateNetwork, defaults) : void 0
125
+ }]) });
191
126
  const marshalCreateDeploymentRequest = (request, defaults) => ({
192
- cpu_max: request.cpuMax,
193
- cpu_min: request.cpuMin,
194
- endpoints: request.endpoints !== void 0 ? request.endpoints.map((elt) => marshalEndpointSpec(elt)) : void 0,
195
- name: request.name,
196
- password: request.password,
197
- project_id: request.projectId ?? defaults.defaultProjectId,
198
- ram_per_cpu: request.ramPerCpu,
199
- replica_count: request.replicaCount,
200
- tags: request.tags,
201
- version: request.version
127
+ cpu_max: request.cpuMax,
128
+ cpu_min: request.cpuMin,
129
+ endpoints: request.endpoints !== void 0 ? request.endpoints.map((elt) => marshalEndpointSpec(elt, defaults)) : void 0,
130
+ name: request.name,
131
+ password: request.password,
132
+ project_id: request.projectId ?? defaults.defaultProjectId,
133
+ ram_per_cpu: request.ramPerCpu,
134
+ replica_count: request.replicaCount,
135
+ shard_count: request.shardCount,
136
+ tags: request.tags,
137
+ version: request.version
202
138
  });
203
139
  const marshalCreateEndpointRequest = (request, defaults) => ({
204
- deployment_id: request.deploymentId,
205
- endpoint: request.endpoint !== void 0 ? marshalEndpointSpec(request.endpoint) : void 0
140
+ deployment_id: request.deploymentId,
141
+ endpoint: request.endpoint !== void 0 ? marshalEndpointSpec(request.endpoint, defaults) : void 0
206
142
  });
207
143
  const marshalCreateUserRequest = (request, defaults) => ({
208
- is_admin: request.isAdmin,
209
- name: request.name,
210
- password: request.password
144
+ is_admin: request.isAdmin,
145
+ name: request.name,
146
+ password: request.password
211
147
  });
212
148
  const marshalUpdateDeploymentRequest = (request, defaults) => ({
213
- cpu_max: request.cpuMax,
214
- cpu_min: request.cpuMin,
215
- name: request.name,
216
- replica_count: request.replicaCount,
217
- tags: request.tags
149
+ cpu_max: request.cpuMax,
150
+ cpu_min: request.cpuMin,
151
+ name: request.name,
152
+ replica_count: request.replicaCount,
153
+ tags: request.tags
218
154
  });
219
155
  const marshalUpdateUserRequest = (request, defaults) => ({
220
- is_admin: request.isAdmin,
221
- password: request.password
156
+ is_admin: request.isAdmin,
157
+ password: request.password
222
158
  });
223
- export {
224
- marshalCreateDatabaseRequest,
225
- marshalCreateDeploymentRequest,
226
- marshalCreateEndpointRequest,
227
- marshalCreateUserRequest,
228
- marshalUpdateDeploymentRequest,
229
- marshalUpdateUserRequest,
230
- unmarshalDatabase,
231
- unmarshalDeployment,
232
- unmarshalEndpoint,
233
- unmarshalListDatabasesResponse,
234
- unmarshalListDeploymentsResponse,
235
- unmarshalListPresetsResponse,
236
- unmarshalListUsersResponse,
237
- unmarshalListVersionsResponse,
238
- unmarshalUser
239
- };
159
+ export { marshalCreateDatabaseRequest, marshalCreateDeploymentRequest, marshalCreateEndpointRequest, marshalCreateUserRequest, marshalUpdateDeploymentRequest, marshalUpdateUserRequest, unmarshalDatabase, unmarshalDeployment, unmarshalEndpoint, unmarshalListDatabasesResponse, unmarshalListDeploymentsResponse, unmarshalListPresetsResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalUser };
@@ -110,6 +110,10 @@ export interface Deployment {
110
110
  * Number of replicas for the deployment.
111
111
  */
112
112
  replicaCount: number;
113
+ /**
114
+ * Number of shards for the deployment.
115
+ */
116
+ shardCount: number;
113
117
  /**
114
118
  * Minimum CPU count for the deployment.
115
119
  */
@@ -156,6 +160,10 @@ export interface Preset {
156
160
  * Number of replicas for the preset.
157
161
  */
158
162
  replicaCount: number;
163
+ /**
164
+ * Number of shards for the preset.
165
+ */
166
+ shardCount: number;
159
167
  }
160
168
  export interface User {
161
169
  /**
@@ -216,6 +224,10 @@ export type CreateDeploymentRequest = {
216
224
  * Number of replicas for the deployment.
217
225
  */
218
226
  replicaCount: number;
227
+ /**
228
+ * Number of shard for the deployment.
229
+ */
230
+ shardCount?: number;
219
231
  /**
220
232
  * Password for the initial user.
221
233
  */
@@ -27,6 +27,10 @@ export declare const CreateDeploymentRequest: {
27
27
  greaterThanOrEqual: number;
28
28
  lessThanOrEqual: number;
29
29
  };
30
+ shardCount: {
31
+ greaterThanOrEqual: number;
32
+ lessThanOrEqual: number;
33
+ };
30
34
  version: {
31
35
  maxLength: number;
32
36
  minLength: number;