@scaleway/sdk 0.1.0-beta.8 → 1.0.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.
Files changed (173) hide show
  1. package/README.md +1 -1
  2. package/dist/api/account/index.js +2 -2
  3. package/dist/api/account/v2/api.gen.js +5 -18
  4. package/dist/api/account/v2/index.gen.js +3 -0
  5. package/dist/api/account/v2/marshalling.gen.js +0 -2
  6. package/dist/api/account/v2alpha1/api.gen.js +3 -13
  7. package/dist/api/account/v2alpha1/marshalling.gen.js +0 -5
  8. package/dist/api/applesilicon/index.js +2 -2
  9. package/dist/api/applesilicon/v1alpha1/api.gen.js +7 -27
  10. package/dist/api/applesilicon/v1alpha1/index.gen.js +4 -0
  11. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +1 -14
  12. package/dist/api/baremetal/v1/api.gen.js +47 -49
  13. package/dist/api/baremetal/v1/api.utils.js +2 -10
  14. package/dist/api/baremetal/v1/content.gen.js +6 -3
  15. package/dist/api/baremetal/v1/index.js +4 -1
  16. package/dist/api/baremetal/v1/marshalling.gen.js +44 -45
  17. package/dist/api/baremetal/v1/validation-rules.gen.js +109 -0
  18. package/dist/api/container/index.js +2 -2
  19. package/dist/api/container/v1beta1/api.gen.js +5 -51
  20. package/dist/api/container/v1beta1/content.gen.js +4 -4
  21. package/dist/api/container/v1beta1/{index.js → index.gen.js} +3 -1
  22. package/dist/api/container/v1beta1/marshalling.gen.js +12 -26
  23. package/dist/api/domain/index.js +2 -2
  24. package/dist/api/domain/v2beta1/api.gen.js +55 -85
  25. package/dist/api/domain/v2beta1/content.gen.js +22 -1
  26. package/dist/api/domain/v2beta1/index.gen.js +4 -0
  27. package/dist/api/domain/v2beta1/marshalling.gen.js +47 -165
  28. package/dist/api/flexibleip/index.js +2 -2
  29. package/dist/api/flexibleip/v1alpha1/api.gen.js +5 -22
  30. package/dist/api/flexibleip/v1alpha1/content.gen.js +1 -1
  31. package/dist/api/flexibleip/v1alpha1/index.gen.js +6 -0
  32. package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -7
  33. package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +14 -0
  34. package/dist/api/function/index.js +2 -2
  35. package/dist/api/function/v1beta1/api.gen.js +54 -57
  36. package/dist/api/function/v1beta1/content.gen.js +8 -5
  37. package/dist/api/function/v1beta1/index.gen.js +4 -0
  38. package/dist/api/function/v1beta1/marshalling.gen.js +125 -33
  39. package/dist/api/iam/index.js +2 -2
  40. package/dist/api/iam/v1alpha1/api.gen.js +15 -62
  41. package/dist/api/iam/v1alpha1/index.gen.js +5 -0
  42. package/dist/api/iam/v1alpha1/marshalling.gen.js +7 -29
  43. package/dist/api/iam/v1alpha1/validation-rules.gen.js +184 -0
  44. package/dist/api/instance/v1/api.gen.js +38 -118
  45. package/dist/api/instance/v1/api.utils.js +59 -51
  46. package/dist/api/instance/v1/content.gen.js +7 -7
  47. package/dist/api/instance/v1/marshalling.gen.js +46 -168
  48. package/dist/api/instance/v1/marshalling.utils.js +63 -0
  49. package/dist/api/iot/index.js +2 -2
  50. package/dist/api/iot/v1/api.gen.js +5 -56
  51. package/dist/api/iot/v1/index.gen.js +4 -0
  52. package/dist/api/iot/v1/marshalling.gen.js +2 -51
  53. package/dist/api/k8s/index.js +2 -2
  54. package/dist/api/k8s/v1/api.gen.js +17 -43
  55. package/dist/api/k8s/v1/content.gen.js +2 -2
  56. package/dist/api/k8s/v1/index.gen.js +6 -0
  57. package/dist/api/k8s/v1/marshalling.gen.js +18 -36
  58. package/dist/api/k8s/v1/validation-rules.gen.js +92 -0
  59. package/dist/api/lb/v1/api.gen.js +8 -163
  60. package/dist/api/lb/v1/api.utils.js +3 -9
  61. package/dist/api/lb/v1/content.gen.js +3 -3
  62. package/dist/api/lb/v1/marshalling.gen.js +74 -101
  63. package/dist/api/marketplace/index.js +4 -2
  64. package/dist/api/marketplace/v1/api.gen.js +3 -13
  65. package/dist/api/marketplace/v1/index.gen.js +3 -0
  66. package/dist/api/marketplace/v1/marshalling.gen.js +0 -13
  67. package/dist/api/marketplace/v2/api.gen.js +85 -0
  68. package/dist/api/marketplace/v2/index.gen.js +3 -0
  69. package/dist/api/marketplace/v2/marshalling.gen.js +92 -0
  70. package/dist/api/mnq/index.js +2 -2
  71. package/dist/api/mnq/v1alpha1/api.gen.js +7 -25
  72. package/dist/api/mnq/v1alpha1/index.gen.js +3 -0
  73. package/dist/api/mnq/v1alpha1/marshalling.gen.js +7 -46
  74. package/dist/api/rdb/index.js +2 -2
  75. package/dist/api/rdb/v1/api.gen.js +15 -89
  76. package/dist/api/rdb/v1/content.gen.js +10 -4
  77. package/dist/api/rdb/v1/index.gen.js +4 -0
  78. package/dist/api/rdb/v1/marshalling.gen.js +25 -81
  79. package/dist/api/redis/index.js +2 -2
  80. package/dist/api/redis/{v1alpha1 → v1}/api.gen.js +45 -77
  81. package/dist/api/redis/{v1alpha1 → v1}/content.gen.js +1 -1
  82. package/dist/api/redis/v1/index.gen.js +4 -0
  83. package/dist/api/redis/{v1alpha1 → v1}/marshalling.gen.js +42 -59
  84. package/dist/api/registry/index.js +2 -2
  85. package/dist/api/registry/v1/api.gen.js +5 -29
  86. package/dist/api/registry/v1/content.gen.js +2 -2
  87. package/dist/api/registry/v1/{index.js → index.gen.js} +3 -1
  88. package/dist/api/registry/v1/marshalling.gen.js +2 -8
  89. package/dist/api/secret/index.js +2 -0
  90. package/dist/api/secret/v1alpha1/api.gen.js +135 -0
  91. package/dist/api/secret/v1alpha1/index.gen.js +3 -0
  92. package/dist/api/secret/v1alpha1/marshalling.gen.js +82 -0
  93. package/dist/api/tem/index.js +2 -0
  94. package/dist/api/tem/v1alpha1/api.gen.js +109 -0
  95. package/dist/api/tem/v1alpha1/content.gen.js +10 -0
  96. package/dist/api/tem/v1alpha1/index.gen.js +4 -0
  97. package/dist/api/tem/v1alpha1/marshalling.gen.js +132 -0
  98. package/dist/api/test/index.js +2 -2
  99. package/dist/api/test/v1/api.gen.js +6 -20
  100. package/dist/api/test/v1/index.gen.js +4 -0
  101. package/dist/api/test/v1/marshalling.gen.js +2 -5
  102. package/dist/api/vpc/index.js +2 -2
  103. package/dist/api/vpc/v1/api.gen.js +6 -17
  104. package/dist/api/vpc/v1/index.gen.js +3 -0
  105. package/dist/api/vpc/v1/marshalling.gen.js +1 -3
  106. package/dist/api/vpcgw/index.js +2 -2
  107. package/dist/api/vpcgw/v1/api.gen.js +5 -64
  108. package/dist/api/vpcgw/v1/content.gen.js +2 -2
  109. package/dist/api/vpcgw/v1/{index.js → index.gen.js} +3 -1
  110. package/dist/api/vpcgw/v1/marshalling.gen.js +3 -24
  111. package/dist/helpers/json.js +1 -2
  112. package/dist/helpers/marshalling.js +7 -20
  113. package/dist/index.cjs +3870 -2948
  114. package/dist/index.d.ts +7218 -4335
  115. package/dist/index.js +10 -6
  116. package/dist/internal/async/interval-retrier.js +10 -16
  117. package/dist/internal/interceptors/interceptor.js +3 -1
  118. package/dist/internal/interceptors/request.js +1 -3
  119. package/dist/internal/logger/console-logger.js +3 -5
  120. package/dist/internal/logger/index.js +3 -5
  121. package/dist/internal/logger/level-resolver.js +0 -3
  122. package/dist/internal/validations/string-validation.js +8 -10
  123. package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js +13 -0
  124. package/dist/scw/api.js +3 -4
  125. package/dist/scw/auth.js +3 -5
  126. package/dist/scw/client-ini-factory.js +32 -15
  127. package/dist/scw/client-ini-profile.js +10 -4
  128. package/dist/scw/client-settings.js +32 -15
  129. package/dist/scw/client.js +5 -6
  130. package/dist/scw/constants.js +1 -1
  131. package/dist/scw/custom-marshalling.js +8 -14
  132. package/dist/scw/errors/error-parser.js +2 -21
  133. package/dist/scw/errors/non-standard/invalid-request-mapper.js +17 -15
  134. package/dist/scw/errors/non-standard/unknown-resource-mapper.js +7 -6
  135. package/dist/scw/errors/scw-error.js +20 -20
  136. package/dist/scw/errors/standard/already-exists-error.js +3 -4
  137. package/dist/scw/errors/standard/denied-authentication-error.js +4 -11
  138. package/dist/scw/errors/standard/invalid-arguments-error.js +1 -10
  139. package/dist/scw/errors/standard/out-of-stock-error.js +0 -3
  140. package/dist/scw/errors/standard/permissions-denied-error.js +1 -4
  141. package/dist/scw/errors/standard/precondition-failed-error.js +4 -8
  142. package/dist/scw/errors/standard/quotas-exceeded-error.js +14 -14
  143. package/dist/scw/errors/standard/resource-expired-error.js +3 -4
  144. package/dist/scw/errors/standard/resource-locked-error.js +3 -4
  145. package/dist/scw/errors/standard/resource-not-found-error.js +3 -4
  146. package/dist/scw/errors/standard/too-many-requests-error.js +3 -16
  147. package/dist/scw/errors/standard/transient-state-error.js +3 -4
  148. package/dist/scw/errors/types.js +0 -3
  149. package/dist/scw/fetch/build-fetcher.js +1 -9
  150. package/dist/scw/fetch/http-dumper.js +4 -7
  151. package/dist/scw/fetch/http-interceptors.js +9 -12
  152. package/dist/scw/fetch/resource-paginator.js +18 -16
  153. package/dist/scw/fetch/response-parser.js +17 -23
  154. package/node_modules/@scaleway/random-name/CHANGELOG.md +42 -63
  155. package/node_modules/@scaleway/random-name/dist/index.js +5 -246
  156. package/node_modules/@scaleway/random-name/package.json +6 -5
  157. package/package.json +4 -5
  158. package/dist/api/account/v2/index.js +0 -1
  159. package/dist/api/applesilicon/v1alpha1/index.js +0 -2
  160. package/dist/api/domain/v2beta1/index.js +0 -2
  161. package/dist/api/flexibleip/v1alpha1/index.js +0 -2
  162. package/dist/api/function/v1beta1/index.js +0 -2
  163. package/dist/api/iam/v1alpha1/index.js +0 -1
  164. package/dist/api/iot/v1/index.js +0 -2
  165. package/dist/api/k8s/v1/index.js +0 -2
  166. package/dist/api/marketplace/v1/index.js +0 -1
  167. package/dist/api/mnq/v1alpha1/index.js +0 -1
  168. package/dist/api/rdb/v1/index.js +0 -2
  169. package/dist/api/redis/v1alpha1/index.js +0 -2
  170. package/dist/api/test/v1/index.js +0 -1
  171. package/dist/api/vpc/v1/index.js +0 -1
  172. package/dist/node_modules/.pnpm/@scaleway_random-name@3.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -254
  173. package/node_modules/@scaleway/random-name/dist/index.browser.js +0 -256
package/README.md CHANGED
@@ -9,7 +9,7 @@ This SDK enables you to interact with Scaleway APIs.
9
9
 
10
10
  ## Getting Started
11
11
 
12
- You'll need a pair of access and secret keys to connect to Scaleway API. Please check the [documentation](https://www.scaleway.com/docs/console/my-project/how-to/generate-api-key) on how to retrieve them.
12
+ You'll need a pair of access and secret keys to connect to Scaleway API. Please check the [documentation](https://www.scaleway.com/en/docs/console/my-project/how-to/generate-api-key/) on how to retrieve them.
13
13
 
14
14
  **A minimal setup** would look like this:
15
15
 
@@ -1,4 +1,4 @@
1
1
  import * as index$1 from './v2alpha1/index.js';
2
2
  export { index$1 as v2alpha1 };
3
- import * as index$2 from './v2/index.js';
4
- export { index$2 as v2 };
3
+ import * as index_gen from './v2/index.gen.js';
4
+ export { index_gen as v2 };
@@ -1,4 +1,4 @@
1
- import { API } from '../../../scw/api.js';
1
+ import { API as API$1 } from '../../../scw/api.js';
2
2
  import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
3
3
  import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
4
4
  import { marshalCreateProjectRequest, unmarshalProject, unmarshalListProjectsResponse, marshalUpdateProjectRequest } from './marshalling.gen.js';
@@ -7,73 +7,61 @@ import { marshalCreateProjectRequest, unmarshalProject, unmarshalListProjectsRes
7
7
  const jsonContentHeaders = {
8
8
  'Content-Type': 'application/json; charset=utf-8'
9
9
  };
10
+
10
11
  /**
11
12
  * Account API.
12
13
  *
13
14
  * This API allows you to manage projects.
14
15
  */
15
-
16
- class AccountV2GenAPI extends API {
16
+ class API extends API$1 {
17
17
  constructor() {
18
18
  var _this;
19
-
20
19
  super(...arguments);
21
20
  _this = this;
22
-
23
21
  this.createProject = request => this.client.fetch({
24
22
  body: JSON.stringify(marshalCreateProjectRequest(request, this.client.settings)),
25
23
  headers: jsonContentHeaders,
26
24
  method: 'POST',
27
25
  path: `/account/v2/projects`
28
26
  }, unmarshalProject);
29
-
30
27
  this.pageOfListProjects = function (request) {
31
28
  if (request === void 0) {
32
29
  request = {};
33
30
  }
34
-
35
31
  return _this.client.fetch({
36
32
  method: 'GET',
37
33
  path: `/account/v2/projects`,
38
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize])
34
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_ids', request.projectIds])
39
35
  }, unmarshalListProjectsResponse);
40
36
  };
41
-
42
37
  this.listProjects = function (request) {
43
38
  if (request === void 0) {
44
39
  request = {};
45
40
  }
46
-
47
41
  return enrichForPagination('projects', _this.pageOfListProjects, request);
48
42
  };
49
-
50
43
  this.getProject = function (request) {
51
44
  if (request === void 0) {
52
45
  request = {};
53
46
  }
54
-
55
47
  return _this.client.fetch({
56
48
  method: 'GET',
57
49
  path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this.client.settings.defaultProjectId)}`
58
50
  }, unmarshalProject);
59
51
  };
60
-
61
52
  this.deleteProject = function (request) {
62
53
  if (request === void 0) {
63
54
  request = {};
64
55
  }
65
-
66
56
  return _this.client.fetch({
67
57
  method: 'DELETE',
68
58
  path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this.client.settings.defaultProjectId)}`
69
59
  });
70
60
  };
71
-
72
61
  this.updateProject = function (request) {
73
62
  if (request === void 0) {
74
63
  request = {};
75
64
  }
76
-
77
65
  return _this.client.fetch({
78
66
  body: JSON.stringify(marshalUpdateProjectRequest(request, _this.client.settings)),
79
67
  headers: jsonContentHeaders,
@@ -82,7 +70,6 @@ class AccountV2GenAPI extends API {
82
70
  }, unmarshalProject);
83
71
  };
84
72
  }
85
-
86
73
  }
87
74
 
88
- export { AccountV2GenAPI };
75
+ export { API };
@@ -0,0 +1,3 @@
1
+ export { API } from './api.gen.js';
2
+
3
+ // This file was automatically generated. DO NOT EDIT.
@@ -6,7 +6,6 @@ const unmarshalProject = data => {
6
6
  if (!isJSONObject(data)) {
7
7
  throw new TypeError(`Unmarshalling the type 'Project' failed as data isn't a dictionary.`);
8
8
  }
9
-
10
9
  return {
11
10
  createdAt: unmarshalDate(data.created_at),
12
11
  description: data.description,
@@ -20,7 +19,6 @@ const unmarshalListProjectsResponse = data => {
20
19
  if (!isJSONObject(data)) {
21
20
  throw new TypeError(`Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`);
22
21
  }
23
-
24
22
  return {
25
23
  projects: unmarshalArrayOfObject(data.projects, unmarshalProject),
26
24
  totalCount: data.total_count
@@ -1,4 +1,4 @@
1
- import { API } from '../../../scw/api.js';
1
+ import { API as API$1 } from '../../../scw/api.js';
2
2
  import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
3
3
  import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
4
4
  import { unmarshalListSSHKeysResponse, marshalCreateSSHKeyRequest, unmarshalSSHKey, marshalUpdateSSHKeyRequest } from './marshalling.gen.js';
@@ -7,60 +7,50 @@ import { unmarshalListSSHKeysResponse, marshalCreateSSHKeyRequest, unmarshalSSHK
7
7
  const jsonContentHeaders = {
8
8
  'Content-Type': 'application/json; charset=utf-8'
9
9
  };
10
- /** Account API. */
11
10
 
12
- class AccountV2Alpha1GenAPI extends API {
11
+ /** Account API. */
12
+ class AccountV2Alpha1GenAPI extends API$1 {
13
13
  constructor() {
14
14
  var _this;
15
-
16
15
  super(...arguments);
17
16
  _this = this;
18
-
19
17
  this.pageOfListSSHKeys = function (request) {
20
18
  if (request === void 0) {
21
19
  request = {};
22
20
  }
23
-
24
21
  return _this.client.fetch({
25
22
  method: 'GET',
26
23
  path: `/account/v2alpha1/ssh-keys`,
27
24
  urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId])
28
25
  }, unmarshalListSSHKeysResponse);
29
26
  };
30
-
31
27
  this.listSSHKeys = function (request) {
32
28
  if (request === void 0) {
33
29
  request = {};
34
30
  }
35
-
36
31
  return enrichForPagination('sshKeys', _this.pageOfListSSHKeys, request);
37
32
  };
38
-
39
33
  this.createSSHKey = request => this.client.fetch({
40
34
  body: JSON.stringify(marshalCreateSSHKeyRequest(request, this.client.settings)),
41
35
  headers: jsonContentHeaders,
42
36
  method: 'POST',
43
37
  path: `/account/v2alpha1/ssh-keys`
44
38
  }, unmarshalSSHKey);
45
-
46
39
  this.getSSHKey = request => this.client.fetch({
47
40
  method: 'GET',
48
41
  path: `/account/v2alpha1/ssh-key/${validatePathParam('sshKeyId', request.sshKeyId)}`
49
42
  }, unmarshalSSHKey);
50
-
51
43
  this.updateSSHKey = request => this.client.fetch({
52
44
  body: JSON.stringify(marshalUpdateSSHKeyRequest(request, this.client.settings)),
53
45
  headers: jsonContentHeaders,
54
46
  method: 'PATCH',
55
47
  path: `/account/v2alpha1/ssh-key/${validatePathParam('sshKeyId', request.sshKeyId)}`
56
48
  }, unmarshalSSHKey);
57
-
58
49
  this.deleteSSHKey = request => this.client.fetch({
59
50
  method: 'DELETE',
60
51
  path: `/account/v2alpha1/ssh-key/${validatePathParam('sshKeyId', request.sshKeyId)}`
61
52
  });
62
53
  }
63
-
64
54
  }
65
55
 
66
56
  export { AccountV2Alpha1GenAPI };
@@ -2,24 +2,20 @@ import { isJSONObject } from '../../../helpers/json.js';
2
2
  import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
3
3
 
4
4
  // This file was automatically generated. DO NOT EDIT.
5
-
6
5
  const unmarshalSSHKeyCreationInfo = data => {
7
6
  if (!isJSONObject(data)) {
8
7
  throw new TypeError(`Unmarshalling the type 'SSHKeyCreationInfo' failed as data isn't a dictionary.`);
9
8
  }
10
-
11
9
  return {
12
10
  address: data.address,
13
11
  countryCode: data.country_code,
14
12
  userAgent: data.user_agent
15
13
  };
16
14
  };
17
-
18
15
  const unmarshalSSHKey = data => {
19
16
  if (!isJSONObject(data)) {
20
17
  throw new TypeError(`Unmarshalling the type 'SSHKey' failed as data isn't a dictionary.`);
21
18
  }
22
-
23
19
  return {
24
20
  createdAt: unmarshalDate(data.created_at),
25
21
  creationInfo: data.creation_info ? unmarshalSSHKeyCreationInfo(data.creation_info) : undefined,
@@ -36,7 +32,6 @@ const unmarshalListSSHKeysResponse = data => {
36
32
  if (!isJSONObject(data)) {
37
33
  throw new TypeError(`Unmarshalling the type 'ListSSHKeysResponse' failed as data isn't a dictionary.`);
38
34
  }
39
-
40
35
  return {
41
36
  sshKeys: unmarshalArrayOfObject(data.ssh_keys, unmarshalSSHKey),
42
37
  totalCount: data.total_count
@@ -1,2 +1,2 @@
1
- import * as index$1 from './v1alpha1/index.js';
2
- export { index$1 as v1alpha1 };
1
+ import * as index_gen from './v1alpha1/index.gen.js';
2
+ export { index_gen as v1alpha1 };
@@ -1,5 +1,5 @@
1
1
  import { waitForResource } from '../../../internal/async/interval-retrier.js';
2
- import { API } from '../../../scw/api.js';
2
+ import { API as API$1 } from '../../../scw/api.js';
3
3
  import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
4
4
  import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
5
  import { SERVER_TRANSIENT_STATUSES } from './content.gen.js';
@@ -9,6 +9,7 @@ import { unmarshalListServerTypesResponse, unmarshalServerType, marshalCreateSer
9
9
  const jsonContentHeaders = {
10
10
  'Content-Type': 'application/json; charset=utf-8'
11
11
  };
12
+
12
13
  /**
13
14
  * Apple silicon.
14
15
  *
@@ -22,115 +23,95 @@ const jsonContentHeaders = {
22
23
  * Get set to explore, learn and build on a dedicated Mac mini M1 with more
23
24
  * performance and speed than you ever thought possible.
24
25
  *
25
- * _Apple silicon as a Service comes with a minimum allocation period of 24 hours_*.
26
+ * _Apple silicon as a Service comes with a minimum allocation period of 24
27
+ * hours_*.
26
28
  *
27
29
  * Mac mini and macOS are trademarks of Apple Inc., registered in the U.S. and
28
30
  * other countries and regions. IOS is a trademark or registered trademark of
29
31
  * Cisco in the U.S. and other countries and is used by Apple under license.
30
32
  * Scaleway is not affiliated with Apple Inc.
31
33
  */
32
-
33
- class ApplesiliconV1Alpha1GenAPI extends API {
34
+ class API extends API$1 {
34
35
  constructor() {
35
36
  var _this;
36
-
37
37
  super(...arguments);
38
38
  _this = this;
39
-
40
39
  this.listServerTypes = function (request) {
41
40
  if (request === void 0) {
42
41
  request = {};
43
42
  }
44
-
45
43
  return _this.client.fetch({
46
44
  method: 'GET',
47
45
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/server-types`
48
46
  }, unmarshalListServerTypesResponse);
49
47
  };
50
-
51
48
  this.getServerType = request => this.client.fetch({
52
49
  method: 'GET',
53
50
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/server-type/${validatePathParam('serverType', request.serverType)}`
54
51
  }, unmarshalServerType);
55
-
56
52
  this.createServer = request => this.client.fetch({
57
53
  body: JSON.stringify(marshalCreateServerRequest(request, this.client.settings)),
58
54
  headers: jsonContentHeaders,
59
55
  method: 'POST',
60
56
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`
61
57
  }, unmarshalServer);
62
-
63
58
  this.pageOfListServers = function (request) {
64
59
  if (request === void 0) {
65
60
  request = {};
66
61
  }
67
-
68
62
  return _this.client.fetch({
69
63
  method: 'GET',
70
64
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/servers`,
71
65
  urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId])
72
66
  }, unmarshalListServersResponse);
73
67
  };
74
-
75
68
  this.listServers = function (request) {
76
69
  if (request === void 0) {
77
70
  request = {};
78
71
  }
79
-
80
72
  return enrichForPagination('servers', _this.pageOfListServers, request);
81
73
  };
82
-
83
74
  this.pageOfListOS = function (request) {
84
75
  if (request === void 0) {
85
76
  request = {};
86
77
  }
87
-
88
78
  return _this.client.fetch({
89
79
  method: 'GET',
90
80
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/os`,
91
81
  urlParams: urlParams(['name', request.name], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['server_type', request.serverType])
92
82
  }, unmarshalListOSResponse);
93
83
  };
94
-
95
84
  this.listOS = function (request) {
96
85
  if (request === void 0) {
97
86
  request = {};
98
87
  }
99
-
100
88
  return enrichForPagination('os', _this.pageOfListOS, request);
101
89
  };
102
-
103
90
  this.getOS = request => this.client.fetch({
104
91
  method: 'GET',
105
92
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}`
106
93
  }, unmarshalOS);
107
-
108
94
  this.getServer = request => this.client.fetch({
109
95
  method: 'GET',
110
96
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
111
97
  }, unmarshalServer);
112
-
113
98
  this.waitForServer = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
114
-
115
99
  this.updateServer = request => this.client.fetch({
116
100
  body: JSON.stringify(marshalUpdateServerRequest(request, this.client.settings)),
117
101
  headers: jsonContentHeaders,
118
102
  method: 'PATCH',
119
103
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
120
104
  }, unmarshalServer);
121
-
122
105
  this.deleteServer = request => this.client.fetch({
123
106
  method: 'DELETE',
124
107
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
125
108
  });
126
-
127
109
  this.rebootServer = request => this.client.fetch({
128
110
  body: '{}',
129
111
  headers: jsonContentHeaders,
130
112
  method: 'POST',
131
113
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot`
132
114
  }, unmarshalServer);
133
-
134
115
  this.reinstallServer = request => this.client.fetch({
135
116
  body: '{}',
136
117
  headers: jsonContentHeaders,
@@ -138,8 +119,7 @@ class ApplesiliconV1Alpha1GenAPI extends API {
138
119
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reinstall`
139
120
  }, unmarshalServer);
140
121
  }
141
-
142
122
  }
143
- ApplesiliconV1Alpha1GenAPI.LOCALITIES = ['fr-par-3'];
123
+ API.LOCALITIES = ['fr-par-3'];
144
124
 
145
- export { ApplesiliconV1Alpha1GenAPI };
125
+ export { API };
@@ -0,0 +1,4 @@
1
+ export { API } from './api.gen.js';
2
+ export { SERVER_TRANSIENT_STATUSES } from './content.gen.js';
3
+
4
+ // This file was automatically generated. DO NOT EDIT.
@@ -1,47 +1,39 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@3.0.2/node_modules/@scaleway/random-name/dist/index.js';
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
2
2
  import { isJSONObject } from '../../../helpers/json.js';
3
3
  import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
4
4
 
5
5
  // This file was automatically generated. DO NOT EDIT.
6
-
7
6
  const unmarshalServerTypeCPU = data => {
8
7
  if (!isJSONObject(data)) {
9
8
  throw new TypeError(`Unmarshalling the type 'ServerTypeCPU' failed as data isn't a dictionary.`);
10
9
  }
11
-
12
10
  return {
13
11
  coreCount: data.core_count,
14
12
  name: data.name
15
13
  };
16
14
  };
17
-
18
15
  const unmarshalServerTypeDisk = data => {
19
16
  if (!isJSONObject(data)) {
20
17
  throw new TypeError(`Unmarshalling the type 'ServerTypeDisk' failed as data isn't a dictionary.`);
21
18
  }
22
-
23
19
  return {
24
20
  capacity: data.capacity,
25
21
  type: data.type
26
22
  };
27
23
  };
28
-
29
24
  const unmarshalServerTypeMemory = data => {
30
25
  if (!isJSONObject(data)) {
31
26
  throw new TypeError(`Unmarshalling the type 'ServerTypeMemory' failed as data isn't a dictionary.`);
32
27
  }
33
-
34
28
  return {
35
29
  capacity: data.capacity,
36
30
  type: data.type
37
31
  };
38
32
  };
39
-
40
33
  const unmarshalOS = data => {
41
34
  if (!isJSONObject(data)) {
42
35
  throw new TypeError(`Unmarshalling the type 'OS' failed as data isn't a dictionary.`);
43
36
  }
44
-
45
37
  return {
46
38
  compatibleServerTypes: data.compatible_server_types,
47
39
  id: data.id,
@@ -54,7 +46,6 @@ const unmarshalServer = data => {
54
46
  if (!isJSONObject(data)) {
55
47
  throw new TypeError(`Unmarshalling the type 'Server' failed as data isn't a dictionary.`);
56
48
  }
57
-
58
49
  return {
59
50
  createdAt: unmarshalDate(data.created_at),
60
51
  deletableAt: unmarshalDate(data.deletable_at),
@@ -74,7 +65,6 @@ const unmarshalServerType = data => {
74
65
  if (!isJSONObject(data)) {
75
66
  throw new TypeError(`Unmarshalling the type 'ServerType' failed as data isn't a dictionary.`);
76
67
  }
77
-
78
68
  return {
79
69
  cpu: data.cpu ? unmarshalServerTypeCPU(data.cpu) : undefined,
80
70
  disk: data.disk ? unmarshalServerTypeDisk(data.disk) : undefined,
@@ -88,7 +78,6 @@ const unmarshalListOSResponse = data => {
88
78
  if (!isJSONObject(data)) {
89
79
  throw new TypeError(`Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.`);
90
80
  }
91
-
92
81
  return {
93
82
  os: unmarshalArrayOfObject(data.os, unmarshalOS),
94
83
  totalCount: data.total_count
@@ -98,7 +87,6 @@ const unmarshalListServerTypesResponse = data => {
98
87
  if (!isJSONObject(data)) {
99
88
  throw new TypeError(`Unmarshalling the type 'ListServerTypesResponse' failed as data isn't a dictionary.`);
100
89
  }
101
-
102
90
  return {
103
91
  serverTypes: unmarshalArrayOfObject(data.server_types, unmarshalServerType)
104
92
  };
@@ -107,7 +95,6 @@ const unmarshalListServersResponse = data => {
107
95
  if (!isJSONObject(data)) {
108
96
  throw new TypeError(`Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`);
109
97
  }
110
-
111
98
  return {
112
99
  servers: unmarshalArrayOfObject(data.servers, unmarshalServer),
113
100
  totalCount: data.total_count