@scaleway/sdk-applesilicon 1.5.0 → 2.1.1

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,384 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const randomName = require("@scaleway/random-name");
4
- const sdkClient = require("@scaleway/sdk-client");
5
- const unmarshalOSSupportedServerType = (data) => {
6
- if (!sdkClient.isJSONObject(data)) {
7
- throw new TypeError(
8
- `Unmarshalling the type 'OSSupportedServerType' failed as data isn't a dictionary.`
9
- );
10
- }
11
- return {
12
- fastDeliveryAvailable: data.fast_delivery_available,
13
- serverType: data.server_type
14
- };
15
- };
16
- const unmarshalOS = (data) => {
17
- if (!sdkClient.isJSONObject(data)) {
18
- throw new TypeError(
19
- `Unmarshalling the type 'OS' failed as data isn't a dictionary.`
20
- );
21
- }
22
- return {
23
- compatibleServerTypes: data.compatible_server_types ? data.compatible_server_types : void 0,
24
- description: data.description,
25
- family: data.family,
26
- id: data.id,
27
- imageUrl: data.image_url,
28
- isBeta: data.is_beta,
29
- label: data.label,
30
- name: data.name,
31
- releaseNotesUrl: data.release_notes_url,
32
- supportedServerTypes: sdkClient.unmarshalArrayOfObject(
33
- data.supported_server_types,
34
- unmarshalOSSupportedServerType
35
- ),
36
- tags: data.tags,
37
- version: data.version,
38
- xcodeVersion: data.xcode_version
39
- };
40
- };
41
- const unmarshalCommitment = (data) => {
42
- if (!sdkClient.isJSONObject(data)) {
43
- throw new TypeError(
44
- `Unmarshalling the type 'Commitment' failed as data isn't a dictionary.`
45
- );
46
- }
47
- return {
48
- cancelled: data.cancelled,
49
- type: data.type
50
- };
51
- };
52
- const unmarshalRunnerConfiguration = (data) => {
53
- if (!sdkClient.isJSONObject(data)) {
54
- throw new TypeError(
55
- `Unmarshalling the type 'RunnerConfiguration' failed as data isn't a dictionary.`
56
- );
57
- }
58
- return {
59
- name: data.name,
60
- provider: data.provider,
61
- token: data.token,
62
- url: data.url
63
- };
64
- };
65
- const unmarshalServer = (data) => {
66
- if (!sdkClient.isJSONObject(data)) {
67
- throw new TypeError(
68
- `Unmarshalling the type 'Server' failed as data isn't a dictionary.`
69
- );
70
- }
71
- return {
72
- commitment: data.commitment ? unmarshalCommitment(data.commitment) : void 0,
73
- createdAt: sdkClient.unmarshalDate(data.created_at),
74
- deletableAt: sdkClient.unmarshalDate(data.deletable_at),
75
- deletionScheduled: data.deletion_scheduled,
76
- delivered: data.delivered,
77
- id: data.id,
78
- ip: data.ip,
79
- name: data.name,
80
- organizationId: data.organization_id,
81
- os: data.os ? unmarshalOS(data.os) : void 0,
82
- projectId: data.project_id,
83
- publicBandwidthBps: data.public_bandwidth_bps,
84
- runnerConfiguration: data.runner_configuration ? unmarshalRunnerConfiguration(data.runner_configuration) : void 0,
85
- sshUsername: data.ssh_username,
86
- status: data.status,
87
- sudoPassword: data.sudo_password,
88
- tags: data.tags,
89
- type: data.type,
90
- updatedAt: sdkClient.unmarshalDate(data.updated_at),
91
- vncPort: data.vnc_port,
92
- vncUrl: data.vnc_url,
93
- vpcStatus: data.vpc_status,
94
- zone: data.zone
95
- };
96
- };
97
- const unmarshalServerPrivateNetwork = (data) => {
98
- if (!sdkClient.isJSONObject(data)) {
99
- throw new TypeError(
100
- `Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`
101
- );
102
- }
103
- return {
104
- createdAt: sdkClient.unmarshalDate(data.created_at),
105
- id: data.id,
106
- ipamIpIds: data.ipam_ip_ids,
107
- privateNetworkId: data.private_network_id,
108
- projectId: data.project_id,
109
- serverId: data.server_id,
110
- status: data.status,
111
- updatedAt: sdkClient.unmarshalDate(data.updated_at),
112
- vlan: data.vlan
113
- };
114
- };
115
- const unmarshalServerTypeCPU = (data) => {
116
- if (!sdkClient.isJSONObject(data)) {
117
- throw new TypeError(
118
- `Unmarshalling the type 'ServerTypeCPU' failed as data isn't a dictionary.`
119
- );
120
- }
121
- return {
122
- coreCount: data.core_count,
123
- frequency: data.frequency,
124
- name: data.name,
125
- sockets: data.sockets,
126
- threadsPerCore: data.threads_per_core
127
- };
128
- };
129
- const unmarshalServerTypeDisk = (data) => {
130
- if (!sdkClient.isJSONObject(data)) {
131
- throw new TypeError(
132
- `Unmarshalling the type 'ServerTypeDisk' failed as data isn't a dictionary.`
133
- );
134
- }
135
- return {
136
- capacity: data.capacity,
137
- type: data.type
138
- };
139
- };
140
- const unmarshalServerTypeGPU = (data) => {
141
- if (!sdkClient.isJSONObject(data)) {
142
- throw new TypeError(
143
- `Unmarshalling the type 'ServerTypeGPU' failed as data isn't a dictionary.`
144
- );
145
- }
146
- return {
147
- count: data.count
148
- };
149
- };
150
- const unmarshalServerTypeMemory = (data) => {
151
- if (!sdkClient.isJSONObject(data)) {
152
- throw new TypeError(
153
- `Unmarshalling the type 'ServerTypeMemory' failed as data isn't a dictionary.`
154
- );
155
- }
156
- return {
157
- capacity: data.capacity,
158
- type: data.type
159
- };
160
- };
161
- const unmarshalServerTypeNPU = (data) => {
162
- if (!sdkClient.isJSONObject(data)) {
163
- throw new TypeError(
164
- `Unmarshalling the type 'ServerTypeNPU' failed as data isn't a dictionary.`
165
- );
166
- }
167
- return {
168
- count: data.count
169
- };
170
- };
171
- const unmarshalServerTypeNetwork = (data) => {
172
- if (!sdkClient.isJSONObject(data)) {
173
- throw new TypeError(
174
- `Unmarshalling the type 'ServerTypeNetwork' failed as data isn't a dictionary.`
175
- );
176
- }
177
- return {
178
- defaultPublicBandwidth: data.default_public_bandwidth,
179
- publicBandwidthBps: data.public_bandwidth_bps,
180
- supportedBandwidth: data.supported_bandwidth
181
- };
182
- };
183
- const unmarshalServerType = (data) => {
184
- if (!sdkClient.isJSONObject(data)) {
185
- throw new TypeError(
186
- `Unmarshalling the type 'ServerType' failed as data isn't a dictionary.`
187
- );
188
- }
189
- return {
190
- cpu: data.cpu ? unmarshalServerTypeCPU(data.cpu) : void 0,
191
- defaultOs: data.default_os ? unmarshalOS(data.default_os) : void 0,
192
- disk: data.disk ? unmarshalServerTypeDisk(data.disk) : void 0,
193
- gpu: data.gpu ? unmarshalServerTypeGPU(data.gpu) : void 0,
194
- memory: data.memory ? unmarshalServerTypeMemory(data.memory) : void 0,
195
- minimumLeaseDuration: data.minimum_lease_duration,
196
- name: data.name,
197
- network: data.network ? unmarshalServerTypeNetwork(data.network) : void 0,
198
- npu: data.npu ? unmarshalServerTypeNPU(data.npu) : void 0,
199
- stock: data.stock
200
- };
201
- };
202
- const unmarshalBatchCreateServersResponse = (data) => {
203
- if (!sdkClient.isJSONObject(data)) {
204
- throw new TypeError(
205
- `Unmarshalling the type 'BatchCreateServersResponse' failed as data isn't a dictionary.`
206
- );
207
- }
208
- return {
209
- servers: sdkClient.unmarshalArrayOfObject(data.servers, unmarshalServer)
210
- };
211
- };
212
- const unmarshalConnectivityDiagnosticServerHealth = (data) => {
213
- if (!sdkClient.isJSONObject(data)) {
214
- throw new TypeError(
215
- `Unmarshalling the type 'ConnectivityDiagnosticServerHealth' failed as data isn't a dictionary.`
216
- );
217
- }
218
- return {
219
- isAgentAlive: data.is_agent_alive,
220
- isMdmAlive: data.is_mdm_alive,
221
- isServerAlive: data.is_server_alive,
222
- isSshPortUp: data.is_ssh_port_up,
223
- isVncPortUp: data.is_vnc_port_up,
224
- lastCheckinDate: sdkClient.unmarshalDate(data.last_checkin_date)
225
- };
226
- };
227
- const unmarshalConnectivityDiagnostic = (data) => {
228
- if (!sdkClient.isJSONObject(data)) {
229
- throw new TypeError(
230
- `Unmarshalling the type 'ConnectivityDiagnostic' failed as data isn't a dictionary.`
231
- );
232
- }
233
- return {
234
- errorMessage: data.error_message,
235
- healthDetails: data.health_details ? unmarshalConnectivityDiagnosticServerHealth(data.health_details) : void 0,
236
- id: data.id,
237
- isHealthy: data.is_healthy,
238
- status: data.status,
239
- supportedActions: data.supported_actions
240
- };
241
- };
242
- const unmarshalListOSResponse = (data) => {
243
- if (!sdkClient.isJSONObject(data)) {
244
- throw new TypeError(
245
- `Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.`
246
- );
247
- }
248
- return {
249
- os: sdkClient.unmarshalArrayOfObject(data.os, unmarshalOS),
250
- totalCount: data.total_count
251
- };
252
- };
253
- const unmarshalListServerPrivateNetworksResponse = (data) => {
254
- if (!sdkClient.isJSONObject(data)) {
255
- throw new TypeError(
256
- `Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.`
257
- );
258
- }
259
- return {
260
- serverPrivateNetworks: sdkClient.unmarshalArrayOfObject(
261
- data.server_private_networks,
262
- unmarshalServerPrivateNetwork
263
- ),
264
- totalCount: data.total_count
265
- };
266
- };
267
- const unmarshalListServerTypesResponse = (data) => {
268
- if (!sdkClient.isJSONObject(data)) {
269
- throw new TypeError(
270
- `Unmarshalling the type 'ListServerTypesResponse' failed as data isn't a dictionary.`
271
- );
272
- }
273
- return {
274
- serverTypes: sdkClient.unmarshalArrayOfObject(data.server_types, unmarshalServerType)
275
- };
276
- };
277
- const unmarshalListServersResponse = (data) => {
278
- if (!sdkClient.isJSONObject(data)) {
279
- throw new TypeError(
280
- `Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`
281
- );
282
- }
283
- return {
284
- servers: sdkClient.unmarshalArrayOfObject(data.servers, unmarshalServer),
285
- totalCount: data.total_count
286
- };
287
- };
288
- const unmarshalSetServerPrivateNetworksResponse = (data) => {
289
- if (!sdkClient.isJSONObject(data)) {
290
- throw new TypeError(
291
- `Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.`
292
- );
293
- }
294
- return {
295
- serverPrivateNetworks: sdkClient.unmarshalArrayOfObject(
296
- data.server_private_networks,
297
- unmarshalServerPrivateNetwork
298
- )
299
- };
300
- };
301
- const unmarshalStartConnectivityDiagnosticResponse = (data) => {
302
- if (!sdkClient.isJSONObject(data)) {
303
- throw new TypeError(
304
- `Unmarshalling the type 'StartConnectivityDiagnosticResponse' failed as data isn't a dictionary.`
305
- );
306
- }
307
- return {
308
- diagnosticId: data.diagnostic_id
309
- };
310
- };
311
- const marshalBatchCreateServersRequestBatchInnerCreateServerRequest = (request, defaults) => ({
312
- name: request.name
313
- });
314
- const marshalBatchCreateServersRequest = (request, defaults) => ({
315
- commitment_type: request.commitmentType,
316
- enable_vpc: request.enableVpc,
317
- os_id: request.osId,
318
- project_id: request.projectId ?? defaults.defaultProjectId,
319
- public_bandwidth_bps: request.publicBandwidthBps,
320
- requests: request.requests !== void 0 ? request.requests.map(
321
- (elt) => marshalBatchCreateServersRequestBatchInnerCreateServerRequest(
322
- elt
323
- )
324
- ) : void 0,
325
- type: request.type
326
- });
327
- const marshalRunnerConfiguration = (request, defaults) => ({
328
- name: request.name,
329
- provider: request.provider,
330
- token: request.token,
331
- url: request.url
332
- });
333
- const marshalCreateServerRequest = (request, defaults) => ({
334
- commitment_type: request.commitmentType,
335
- enable_vpc: request.enableVpc,
336
- name: request.name || randomName("as"),
337
- os_id: request.osId,
338
- project_id: request.projectId ?? defaults.defaultProjectId,
339
- public_bandwidth_bps: request.publicBandwidthBps,
340
- runner_configuration: request.runnerConfiguration !== void 0 ? marshalRunnerConfiguration(request.runnerConfiguration) : void 0,
341
- type: request.type
342
- });
343
- const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({
344
- ipam_ip_ids: request.ipamIpIds,
345
- private_network_id: request.privateNetworkId
346
- });
347
- const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaults) => ({
348
- per_private_network_ipam_ip_ids: request.perPrivateNetworkIpamIpIds
349
- });
350
- const marshalReinstallServerRequest = (request, defaults) => ({
351
- os_id: request.osId
352
- });
353
- const marshalStartConnectivityDiagnosticRequest = (request, defaults) => ({
354
- server_id: request.serverId
355
- });
356
- const marshalCommitmentTypeValue = (request, defaults) => ({
357
- commitment_type: request.commitmentType
358
- });
359
- const marshalUpdateServerRequest = (request, defaults) => ({
360
- commitment_type: request.commitmentType !== void 0 ? marshalCommitmentTypeValue(request.commitmentType) : void 0,
361
- enable_vpc: request.enableVpc,
362
- name: request.name,
363
- public_bandwidth_bps: request.publicBandwidthBps,
364
- schedule_deletion: request.scheduleDeletion
365
- });
366
- exports.marshalBatchCreateServersRequest = marshalBatchCreateServersRequest;
367
- exports.marshalCreateServerRequest = marshalCreateServerRequest;
368
- exports.marshalPrivateNetworkApiAddServerPrivateNetworkRequest = marshalPrivateNetworkApiAddServerPrivateNetworkRequest;
369
- exports.marshalPrivateNetworkApiSetServerPrivateNetworksRequest = marshalPrivateNetworkApiSetServerPrivateNetworksRequest;
370
- exports.marshalReinstallServerRequest = marshalReinstallServerRequest;
371
- exports.marshalStartConnectivityDiagnosticRequest = marshalStartConnectivityDiagnosticRequest;
372
- exports.marshalUpdateServerRequest = marshalUpdateServerRequest;
373
- exports.unmarshalBatchCreateServersResponse = unmarshalBatchCreateServersResponse;
374
- exports.unmarshalConnectivityDiagnostic = unmarshalConnectivityDiagnostic;
375
- exports.unmarshalListOSResponse = unmarshalListOSResponse;
376
- exports.unmarshalListServerPrivateNetworksResponse = unmarshalListServerPrivateNetworksResponse;
377
- exports.unmarshalListServerTypesResponse = unmarshalListServerTypesResponse;
378
- exports.unmarshalListServersResponse = unmarshalListServersResponse;
379
- exports.unmarshalOS = unmarshalOS;
380
- exports.unmarshalServer = unmarshalServer;
381
- exports.unmarshalServerPrivateNetwork = unmarshalServerPrivateNetwork;
382
- exports.unmarshalServerType = unmarshalServerType;
383
- exports.unmarshalSetServerPrivateNetworksResponse = unmarshalSetServerPrivateNetworksResponse;
384
- exports.unmarshalStartConnectivityDiagnosticResponse = unmarshalStartConnectivityDiagnosticResponse;