@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
@@ -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, resolveOneOf } from '../../../helpers/marshalling.js';
4
4
  import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
5
  import { NAMESPACE_TRANSIENT_STATUSES, CONTAINER_TRANSIENT_STATUSES, CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES } from './content.gen.js';
@@ -9,51 +9,42 @@ import { unmarshalListNamespacesResponse, unmarshalNamespace, marshalCreateNames
9
9
  const jsonContentHeaders = {
10
10
  'Content-Type': 'application/json; charset=utf-8'
11
11
  };
12
+
12
13
  /**
13
14
  * Containers API.
14
15
  *
15
16
  * Serverless Containers API.
16
17
  */
17
-
18
- class ContainerV1Beta1GenAPI extends API {
18
+ class API extends API$1 {
19
19
  constructor() {
20
20
  var _this;
21
-
22
21
  super(...arguments);
23
22
  _this = this;
24
-
25
23
  this.pageOfListNamespaces = function (request) {
26
24
  if (request === void 0) {
27
25
  request = {};
28
26
  }
29
-
30
27
  return _this.client.fetch({
31
28
  method: 'GET',
32
29
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/namespaces`,
33
30
  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])
34
31
  }, unmarshalListNamespacesResponse);
35
32
  };
36
-
37
33
  this.listNamespaces = function (request) {
38
34
  if (request === void 0) {
39
35
  request = {};
40
36
  }
41
-
42
37
  return enrichForPagination('namespaces', _this.pageOfListNamespaces, request);
43
38
  };
44
-
45
39
  this.getNamespace = request => this.client.fetch({
46
40
  method: 'GET',
47
41
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`
48
42
  }, unmarshalNamespace);
49
-
50
43
  this.waitForNamespace = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES.includes(res.status))), this.getNamespace, request, options);
51
-
52
44
  this.createNamespace = function (request) {
53
45
  if (request === void 0) {
54
46
  request = {};
55
47
  }
56
-
57
48
  return _this.client.fetch({
58
49
  body: JSON.stringify(marshalCreateNamespaceRequest(request, _this.client.settings)),
59
50
  headers: jsonContentHeaders,
@@ -61,134 +52,107 @@ class ContainerV1Beta1GenAPI extends API {
61
52
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/namespaces`
62
53
  }, unmarshalNamespace);
63
54
  };
64
-
65
55
  this.updateNamespace = request => this.client.fetch({
66
56
  body: JSON.stringify(marshalUpdateNamespaceRequest(request, this.client.settings)),
67
57
  headers: jsonContentHeaders,
68
58
  method: 'PATCH',
69
59
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`
70
60
  }, unmarshalNamespace);
71
-
72
61
  this.deleteNamespace = request => this.client.fetch({
73
62
  method: 'DELETE',
74
63
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`
75
64
  }, unmarshalNamespace);
76
-
77
65
  this.pageOfListContainers = request => this.client.fetch({
78
66
  method: 'GET',
79
67
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers`,
80
68
  urlParams: urlParams(['name', request.name], ['namespace_id', request.namespaceId], ['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])
81
69
  }, unmarshalListContainersResponse);
82
-
83
70
  this.listContainers = request => enrichForPagination('containers', this.pageOfListContainers, request);
84
-
85
71
  this.getContainer = request => this.client.fetch({
86
72
  method: 'GET',
87
73
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}`
88
74
  }, unmarshalContainer);
89
-
90
75
  this.waitForContainer = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!CONTAINER_TRANSIENT_STATUSES.includes(res.status))), this.getContainer, request, options);
91
-
92
76
  this.createContainer = request => this.client.fetch({
93
77
  body: JSON.stringify(marshalCreateContainerRequest(request, this.client.settings)),
94
78
  headers: jsonContentHeaders,
95
79
  method: 'POST',
96
80
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers`
97
81
  }, unmarshalContainer);
98
-
99
82
  this.updateContainer = request => this.client.fetch({
100
83
  body: JSON.stringify(marshalUpdateContainerRequest(request, this.client.settings)),
101
84
  headers: jsonContentHeaders,
102
85
  method: 'PATCH',
103
86
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}`
104
87
  }, unmarshalContainer);
105
-
106
88
  this.deleteContainer = request => this.client.fetch({
107
89
  method: 'DELETE',
108
90
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}`
109
91
  }, unmarshalContainer);
110
-
111
92
  this.deployContainer = request => this.client.fetch({
112
93
  body: '{}',
113
94
  headers: jsonContentHeaders,
114
95
  method: 'POST',
115
96
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}/deploy`
116
97
  }, unmarshalContainer);
117
-
118
98
  this.pageOfListCrons = request => this.client.fetch({
119
99
  method: 'GET',
120
100
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons`,
121
101
  urlParams: urlParams(['container_id', request.containerId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
122
102
  }, unmarshalListCronsResponse);
123
-
124
103
  this.listCrons = request => enrichForPagination('crons', this.pageOfListCrons, request);
125
-
126
104
  this.getCron = request => this.client.fetch({
127
105
  method: 'GET',
128
106
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}`
129
107
  }, unmarshalCron);
130
-
131
108
  this.waitForCron = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!CRON_TRANSIENT_STATUSES.includes(res.status))), this.getCron, request, options);
132
-
133
109
  this.createCron = request => this.client.fetch({
134
110
  body: JSON.stringify(marshalCreateCronRequest(request, this.client.settings)),
135
111
  headers: jsonContentHeaders,
136
112
  method: 'POST',
137
113
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons`
138
114
  }, unmarshalCron);
139
-
140
115
  this.updateCron = request => this.client.fetch({
141
116
  body: JSON.stringify(marshalUpdateCronRequest(request, this.client.settings)),
142
117
  headers: jsonContentHeaders,
143
118
  method: 'PATCH',
144
119
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}`
145
120
  }, unmarshalCron);
146
-
147
121
  this.deleteCron = request => this.client.fetch({
148
122
  method: 'DELETE',
149
123
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}`
150
124
  }, unmarshalCron);
151
-
152
125
  this.pageOfListLogs = request => this.client.fetch({
153
126
  method: 'GET',
154
127
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}/logs`,
155
128
  urlParams: urlParams(['order_by', request.orderBy ?? 'timestamp_desc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
156
129
  }, unmarshalListLogsResponse);
157
-
158
130
  this.listLogs = request => enrichForPagination('logs', this.pageOfListLogs, request);
159
-
160
131
  this.pageOfListDomains = request => this.client.fetch({
161
132
  method: 'GET',
162
133
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains`,
163
134
  urlParams: urlParams(['container_id', request.containerId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
164
135
  }, unmarshalListDomainsResponse);
165
-
166
136
  this.listDomains = request => enrichForPagination('domains', this.pageOfListDomains, request);
167
-
168
137
  this.getDomain = request => this.client.fetch({
169
138
  method: 'GET',
170
139
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}`
171
140
  }, unmarshalDomain);
172
-
173
141
  this.waitForDomain = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
174
-
175
142
  this.createDomain = request => this.client.fetch({
176
143
  body: JSON.stringify(marshalCreateDomainRequest(request, this.client.settings)),
177
144
  headers: jsonContentHeaders,
178
145
  method: 'POST',
179
146
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains`
180
147
  }, unmarshalDomain);
181
-
182
148
  this.deleteDomain = request => this.client.fetch({
183
149
  method: 'DELETE',
184
150
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}`
185
151
  }, unmarshalDomain);
186
-
187
152
  this.issueJWT = function (request) {
188
153
  if (request === void 0) {
189
154
  request = {};
190
155
  }
191
-
192
156
  return _this.client.fetch({
193
157
  method: 'GET',
194
158
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/issue-jwt`,
@@ -201,12 +165,10 @@ class ContainerV1Beta1GenAPI extends API {
201
165
  }])))
202
166
  }, unmarshalToken);
203
167
  };
204
-
205
168
  this.createToken = function (request) {
206
169
  if (request === void 0) {
207
170
  request = {};
208
171
  }
209
-
210
172
  return _this.client.fetch({
211
173
  body: JSON.stringify(marshalCreateTokenRequest(request, _this.client.settings)),
212
174
  headers: jsonContentHeaders,
@@ -214,41 +176,33 @@ class ContainerV1Beta1GenAPI extends API {
214
176
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/tokens`
215
177
  }, unmarshalToken);
216
178
  };
217
-
218
179
  this.getToken = request => this.client.fetch({
219
180
  method: 'GET',
220
181
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}`
221
182
  }, unmarshalToken);
222
-
223
183
  this.waitForToken = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!TOKEN_TRANSIENT_STATUSES.includes(res.status))), this.getToken, request, options);
224
-
225
184
  this.pageOfListTokens = function (request) {
226
185
  if (request === void 0) {
227
186
  request = {};
228
187
  }
229
-
230
188
  return _this.client.fetch({
231
189
  method: 'GET',
232
190
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/tokens`,
233
191
  urlParams: urlParams(['container_id', request.containerId], ['namespace_id', request.namespaceId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize])
234
192
  }, unmarshalListTokensResponse);
235
193
  };
236
-
237
194
  this.listTokens = function (request) {
238
195
  if (request === void 0) {
239
196
  request = {};
240
197
  }
241
-
242
198
  return enrichForPagination('tokens', _this.pageOfListTokens, request);
243
199
  };
244
-
245
200
  this.deleteToken = request => this.client.fetch({
246
201
  method: 'DELETE',
247
202
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}`
248
203
  }, unmarshalToken);
249
204
  }
250
-
251
205
  }
252
- ContainerV1Beta1GenAPI.LOCALITIES = ['fr-par'];
206
+ API.LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
253
207
 
254
- export { ContainerV1Beta1GenAPI };
208
+ export { API };
@@ -3,17 +3,17 @@
3
3
 
4
4
  /** Lists transient statutes of the enum {@link ContainerStatus}. */
5
5
  const CONTAINER_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
6
- /** Lists transient statutes of the enum {@link CronStatus}. */
7
6
 
7
+ /** Lists transient statutes of the enum {@link CronStatus}. */
8
8
  const CRON_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
9
- /** Lists transient statutes of the enum {@link DomainStatus}. */
10
9
 
10
+ /** Lists transient statutes of the enum {@link DomainStatus}. */
11
11
  const DOMAIN_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
12
- /** Lists transient statutes of the enum {@link NamespaceStatus}. */
13
12
 
13
+ /** Lists transient statutes of the enum {@link NamespaceStatus}. */
14
14
  const NAMESPACE_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
15
- /** Lists transient statutes of the enum {@link TokenStatus}. */
16
15
 
16
+ /** Lists transient statutes of the enum {@link TokenStatus}. */
17
17
  const TOKEN_TRANSIENT_STATUSES = ['deleting', 'creating'];
18
18
 
19
19
  export { CONTAINER_TRANSIENT_STATUSES, CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES };
@@ -1,2 +1,4 @@
1
- export { ContainerV1Beta1GenAPI as API } from './api.gen.js';
1
+ export { API } from './api.gen.js';
2
2
  export { CONTAINER_TRANSIENT_STATUSES, CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES } from './content.gen.js';
3
+
4
+ // This file was automatically generated. DO NOT EDIT.
@@ -1,25 +1,21 @@
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 { unmarshalArrayOfObject, unmarshalDate, resolveOneOf } from '../../../helpers/marshalling.js';
4
4
 
5
5
  // This file was automatically generated. DO NOT EDIT.
6
-
7
6
  const unmarshalSecretHashedValue = data => {
8
7
  if (!isJSONObject(data)) {
9
8
  throw new TypeError(`Unmarshalling the type 'SecretHashedValue' failed as data isn't a dictionary.`);
10
9
  }
11
-
12
10
  return {
13
11
  hashedValue: data.hashed_value,
14
12
  key: data.key
15
13
  };
16
14
  };
17
-
18
15
  const unmarshalContainer = data => {
19
16
  if (!isJSONObject(data)) {
20
17
  throw new TypeError(`Unmarshalling the type 'Container' failed as data isn't a dictionary.`);
21
18
  }
22
-
23
19
  return {
24
20
  cpuLimit: data.cpu_limit,
25
21
  description: data.description,
@@ -48,11 +44,11 @@ const unmarshalCron = data => {
48
44
  if (!isJSONObject(data)) {
49
45
  throw new TypeError(`Unmarshalling the type 'Cron' failed as data isn't a dictionary.`);
50
46
  }
51
-
52
47
  return {
53
48
  args: data.args,
54
49
  containerId: data.container_id,
55
50
  id: data.id,
51
+ name: data.name,
56
52
  schedule: data.schedule,
57
53
  status: data.status
58
54
  };
@@ -61,7 +57,6 @@ const unmarshalDomain = data => {
61
57
  if (!isJSONObject(data)) {
62
58
  throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`);
63
59
  }
64
-
65
60
  return {
66
61
  containerId: data.container_id,
67
62
  errorMessage: data.error_message,
@@ -71,12 +66,10 @@ const unmarshalDomain = data => {
71
66
  url: data.url
72
67
  };
73
68
  };
74
-
75
69
  const unmarshalLog = data => {
76
70
  if (!isJSONObject(data)) {
77
71
  throw new TypeError(`Unmarshalling the type 'Log' failed as data isn't a dictionary.`);
78
72
  }
79
-
80
73
  return {
81
74
  id: data.id,
82
75
  level: data.level,
@@ -86,12 +79,10 @@ const unmarshalLog = data => {
86
79
  timestamp: unmarshalDate(data.timestamp)
87
80
  };
88
81
  };
89
-
90
82
  const unmarshalNamespace = data => {
91
83
  if (!isJSONObject(data)) {
92
84
  throw new TypeError(`Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`);
93
85
  }
94
-
95
86
  return {
96
87
  description: data.description,
97
88
  environmentVariables: data.environment_variables,
@@ -111,9 +102,9 @@ const unmarshalToken = data => {
111
102
  if (!isJSONObject(data)) {
112
103
  throw new TypeError(`Unmarshalling the type 'Token' failed as data isn't a dictionary.`);
113
104
  }
114
-
115
105
  return {
116
106
  containerId: data.container_id,
107
+ description: data.description,
117
108
  expiresAt: unmarshalDate(data.expires_at),
118
109
  id: data.id,
119
110
  namespaceId: data.namespace_id,
@@ -126,7 +117,6 @@ const unmarshalListContainersResponse = data => {
126
117
  if (!isJSONObject(data)) {
127
118
  throw new TypeError(`Unmarshalling the type 'ListContainersResponse' failed as data isn't a dictionary.`);
128
119
  }
129
-
130
120
  return {
131
121
  containers: unmarshalArrayOfObject(data.containers, unmarshalContainer),
132
122
  totalCount: data.total_count
@@ -136,7 +126,6 @@ const unmarshalListCronsResponse = data => {
136
126
  if (!isJSONObject(data)) {
137
127
  throw new TypeError(`Unmarshalling the type 'ListCronsResponse' failed as data isn't a dictionary.`);
138
128
  }
139
-
140
129
  return {
141
130
  crons: unmarshalArrayOfObject(data.crons, unmarshalCron),
142
131
  totalCount: data.total_count
@@ -146,7 +135,6 @@ const unmarshalListDomainsResponse = data => {
146
135
  if (!isJSONObject(data)) {
147
136
  throw new TypeError(`Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`);
148
137
  }
149
-
150
138
  return {
151
139
  domains: unmarshalArrayOfObject(data.domains, unmarshalDomain),
152
140
  totalCount: data.total_count
@@ -156,7 +144,6 @@ const unmarshalListLogsResponse = data => {
156
144
  if (!isJSONObject(data)) {
157
145
  throw new TypeError(`Unmarshalling the type 'ListLogsResponse' failed as data isn't a dictionary.`);
158
146
  }
159
-
160
147
  return {
161
148
  logs: unmarshalArrayOfObject(data.logs, unmarshalLog),
162
149
  totalCount: data.total_count
@@ -166,7 +153,6 @@ const unmarshalListNamespacesResponse = data => {
166
153
  if (!isJSONObject(data)) {
167
154
  throw new TypeError(`Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`);
168
155
  }
169
-
170
156
  return {
171
157
  namespaces: unmarshalArrayOfObject(data.namespaces, unmarshalNamespace),
172
158
  totalCount: data.total_count
@@ -176,22 +162,19 @@ const unmarshalListTokensResponse = data => {
176
162
  if (!isJSONObject(data)) {
177
163
  throw new TypeError(`Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`);
178
164
  }
179
-
180
165
  return {
181
166
  tokens: unmarshalArrayOfObject(data.tokens, unmarshalToken),
182
167
  totalCount: data.total_count
183
168
  };
184
169
  };
185
-
186
170
  const marshalSecret = (request, defaults) => ({
187
171
  key: request.key,
188
172
  value: request.value
189
173
  });
190
-
191
174
  const marshalCreateContainerRequest = (request, defaults) => ({
192
175
  description: request.description,
193
176
  environment_variables: request.environmentVariables,
194
- http_option: request.httpOption,
177
+ http_option: request.httpOption ?? 'unknown_http_option',
195
178
  max_concurrency: request.maxConcurrency,
196
179
  max_scale: request.maxScale,
197
180
  memory_limit: request.memoryLimit,
@@ -199,8 +182,8 @@ const marshalCreateContainerRequest = (request, defaults) => ({
199
182
  name: request.name || randomName('ctnr'),
200
183
  namespace_id: request.namespaceId,
201
184
  port: request.port,
202
- privacy: request.privacy,
203
- protocol: request.protocol,
185
+ privacy: request.privacy ?? 'unknown_privacy',
186
+ protocol: request.protocol ?? 'unknown_protocol',
204
187
  registry_image: request.registryImage,
205
188
  secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined,
206
189
  timeout: request.timeout
@@ -208,6 +191,7 @@ const marshalCreateContainerRequest = (request, defaults) => ({
208
191
  const marshalCreateCronRequest = (request, defaults) => ({
209
192
  args: request.args,
210
193
  container_id: request.containerId,
194
+ name: request.name,
211
195
  schedule: request.schedule
212
196
  });
213
197
  const marshalCreateDomainRequest = (request, defaults) => ({
@@ -222,6 +206,7 @@ const marshalCreateNamespaceRequest = (request, defaults) => ({
222
206
  secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined
223
207
  });
224
208
  const marshalCreateTokenRequest = (request, defaults) => ({
209
+ description: request.description,
225
210
  expires_at: request.expiresAt,
226
211
  ...resolveOneOf([{
227
212
  param: 'container_id',
@@ -234,14 +219,14 @@ const marshalCreateTokenRequest = (request, defaults) => ({
234
219
  const marshalUpdateContainerRequest = (request, defaults) => ({
235
220
  description: request.description,
236
221
  environment_variables: request.environmentVariables,
237
- http_option: request.httpOption,
222
+ http_option: request.httpOption ?? 'unknown_http_option',
238
223
  max_concurrency: request.maxConcurrency,
239
224
  max_scale: request.maxScale,
240
225
  memory_limit: request.memoryLimit,
241
226
  min_scale: request.minScale,
242
227
  port: request.port,
243
- privacy: request.privacy,
244
- protocol: request.protocol,
228
+ privacy: request.privacy ?? 'unknown_privacy',
229
+ protocol: request.protocol ?? 'unknown_protocol',
245
230
  redeploy: request.redeploy,
246
231
  registry_image: request.registryImage,
247
232
  secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined,
@@ -250,6 +235,7 @@ const marshalUpdateContainerRequest = (request, defaults) => ({
250
235
  const marshalUpdateCronRequest = (request, defaults) => ({
251
236
  args: request.args,
252
237
  container_id: request.containerId,
238
+ name: request.name,
253
239
  schedule: request.schedule
254
240
  });
255
241
  const marshalUpdateNamespaceRequest = (request, defaults) => ({
@@ -1,2 +1,2 @@
1
- import * as index$1 from './v2beta1/index.js';
2
- export { index$1 as v2beta1 };
1
+ import * as index_gen from './v2beta1/index.gen.js';
2
+ export { index_gen as v2beta1 };