@scaleway/sdk 3.0.0-alpha.0 → 3.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.
Files changed (214) hide show
  1. package/dist/index.gen.d.ts +362 -0
  2. package/dist/index.gen.js +323 -0
  3. package/package.json +71 -25
  4. package/README.md +0 -46
  5. package/dist/api/account/index.js +0 -4
  6. package/dist/api/account/v2/api.gen.js +0 -147
  7. package/dist/api/account/v2/index.gen.js +0 -4
  8. package/dist/api/account/v2/marshalling.gen.js +0 -39
  9. package/dist/api/account/v3/api.gen.js +0 -129
  10. package/dist/api/account/v3/index.gen.js +0 -6
  11. package/dist/api/account/v3/marshalling.gen.js +0 -39
  12. package/dist/api/account/v3/validation-rules.gen.js +0 -39
  13. package/dist/api/applesilicon/index.js +0 -2
  14. package/dist/api/applesilicon/v1alpha1/api.gen.js +0 -220
  15. package/dist/api/applesilicon/v1alpha1/content.gen.js +0 -7
  16. package/dist/api/applesilicon/v1alpha1/index.gen.js +0 -5
  17. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +0 -113
  18. package/dist/api/baremetal/index.js +0 -2
  19. package/dist/api/baremetal/v1/api.gen.js +0 -523
  20. package/dist/api/baremetal/v1/api.utils.js +0 -27
  21. package/dist/api/baremetal/v1/content.gen.js +0 -13
  22. package/dist/api/baremetal/v1/index.js +0 -5
  23. package/dist/api/baremetal/v1/marshalling.gen.js +0 -395
  24. package/dist/api/baremetal/v1/validation-rules.gen.js +0 -109
  25. package/dist/api/billing/index.js +0 -2
  26. package/dist/api/billing/v2alpha1/api.gen.js +0 -80
  27. package/dist/api/billing/v2alpha1/index.gen.js +0 -4
  28. package/dist/api/billing/v2alpha1/marshalling.gen.js +0 -53
  29. package/dist/api/block/index.js +0 -2
  30. package/dist/api/block/v1alpha1/api.gen.js +0 -245
  31. package/dist/api/block/v1alpha1/content.gen.js +0 -13
  32. package/dist/api/block/v1alpha1/index.gen.js +0 -7
  33. package/dist/api/block/v1alpha1/marshalling.gen.js +0 -175
  34. package/dist/api/block/v1alpha1/validation-rules.gen.js +0 -42
  35. package/dist/api/cockpit/index.js +0 -2
  36. package/dist/api/cockpit/v1beta1/api.gen.js +0 -448
  37. package/dist/api/cockpit/v1beta1/content.gen.js +0 -7
  38. package/dist/api/cockpit/v1beta1/index.gen.js +0 -5
  39. package/dist/api/cockpit/v1beta1/marshalling.gen.js +0 -220
  40. package/dist/api/container/index.js +0 -2
  41. package/dist/api/container/v1beta1/api.gen.js +0 -549
  42. package/dist/api/container/v1beta1/content.gen.js +0 -22
  43. package/dist/api/container/v1beta1/index.gen.js +0 -5
  44. package/dist/api/container/v1beta1/marshalling.gen.js +0 -330
  45. package/dist/api/document_db/index.js +0 -2
  46. package/dist/api/document_db/v1beta1/api.gen.js +0 -830
  47. package/dist/api/document_db/v1beta1/content.gen.js +0 -19
  48. package/dist/api/document_db/v1beta1/index.gen.js +0 -7
  49. package/dist/api/document_db/v1beta1/marshalling.gen.js +0 -580
  50. package/dist/api/document_db/v1beta1/validation-rules.gen.js +0 -10
  51. package/dist/api/domain/index.js +0 -2
  52. package/dist/api/domain/v2beta1/api.gen.js +0 -875
  53. package/dist/api/domain/v2beta1/content.gen.js +0 -28
  54. package/dist/api/domain/v2beta1/index.gen.js +0 -7
  55. package/dist/api/domain/v2beta1/marshalling.gen.js +0 -958
  56. package/dist/api/flexibleip/index.js +0 -2
  57. package/dist/api/flexibleip/v1alpha1/api.gen.js +0 -203
  58. package/dist/api/flexibleip/v1alpha1/content.gen.js +0 -10
  59. package/dist/api/flexibleip/v1alpha1/index.gen.js +0 -7
  60. package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -97
  61. package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +0 -14
  62. package/dist/api/function/index.js +0 -2
  63. package/dist/api/function/v1beta1/api.gen.js +0 -560
  64. package/dist/api/function/v1beta1/content.gen.js +0 -22
  65. package/dist/api/function/v1beta1/index.gen.js +0 -5
  66. package/dist/api/function/v1beta1/marshalling.gen.js +0 -368
  67. package/dist/api/iam/index.js +0 -2
  68. package/dist/api/iam/v1alpha1/api.gen.js +0 -799
  69. package/dist/api/iam/v1alpha1/index.gen.js +0 -6
  70. package/dist/api/iam/v1alpha1/marshalling.gen.js +0 -373
  71. package/dist/api/iam/v1alpha1/validation-rules.gen.js +0 -207
  72. package/dist/api/instance/index.js +0 -2
  73. package/dist/api/instance/v1/api.gen.js +0 -1003
  74. package/dist/api/instance/v1/api.utils.js +0 -369
  75. package/dist/api/instance/v1/content.gen.js +0 -31
  76. package/dist/api/instance/v1/index.js +0 -2
  77. package/dist/api/instance/v1/marshalling.gen.js +0 -1206
  78. package/dist/api/instance/v1/marshalling.utils.js +0 -63
  79. package/dist/api/iot/index.js +0 -2
  80. package/dist/api/iot/v1/api.gen.js +0 -581
  81. package/dist/api/iot/v1/content.gen.js +0 -7
  82. package/dist/api/iot/v1/index.gen.js +0 -5
  83. package/dist/api/iot/v1/marshalling.gen.js +0 -388
  84. package/dist/api/ipfs/index.js +0 -2
  85. package/dist/api/ipfs/v1alpha1/api.gen.js +0 -197
  86. package/dist/api/ipfs/v1alpha1/content.gen.js +0 -7
  87. package/dist/api/ipfs/v1alpha1/index.gen.js +0 -5
  88. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +0 -121
  89. package/dist/api/k8s/index.js +0 -2
  90. package/dist/api/k8s/v1/api.gen.js +0 -454
  91. package/dist/api/k8s/v1/api.utils.js +0 -13
  92. package/dist/api/k8s/v1/content.gen.js +0 -13
  93. package/dist/api/k8s/v1/index.js +0 -4
  94. package/dist/api/k8s/v1/marshalling.gen.js +0 -333
  95. package/dist/api/k8s/v1/validation-rules.gen.js +0 -101
  96. package/dist/api/lb/index.js +0 -2
  97. package/dist/api/lb/v1/api.gen.js +0 -1669
  98. package/dist/api/lb/v1/api.utils.js +0 -81
  99. package/dist/api/lb/v1/content.gen.js +0 -16
  100. package/dist/api/lb/v1/index.js +0 -2
  101. package/dist/api/lb/v1/marshalling.gen.js +0 -923
  102. package/dist/api/marketplace/index.js +0 -4
  103. package/dist/api/marketplace/v1/api.gen.js +0 -60
  104. package/dist/api/marketplace/v1/index.gen.js +0 -4
  105. package/dist/api/marketplace/v1/marshalling.gen.js +0 -92
  106. package/dist/api/marketplace/v2/api.gen.js +0 -162
  107. package/dist/api/marketplace/v2/index.gen.js +0 -4
  108. package/dist/api/marketplace/v2/marshalling.gen.js +0 -94
  109. package/dist/api/mnq/index.js +0 -2
  110. package/dist/api/mnq/v1alpha1/api.gen.js +0 -205
  111. package/dist/api/mnq/v1alpha1/index.gen.js +0 -4
  112. package/dist/api/mnq/v1alpha1/marshalling.gen.js +0 -121
  113. package/dist/api/rdb/index.js +0 -2
  114. package/dist/api/rdb/v1/api.gen.js +0 -972
  115. package/dist/api/rdb/v1/content.gen.js +0 -22
  116. package/dist/api/rdb/v1/index.gen.js +0 -7
  117. package/dist/api/rdb/v1/marshalling.gen.js +0 -636
  118. package/dist/api/rdb/v1/validation-rules.gen.js +0 -10
  119. package/dist/api/redis/index.js +0 -2
  120. package/dist/api/redis/v1/api.gen.js +0 -389
  121. package/dist/api/redis/v1/content.gen.js +0 -7
  122. package/dist/api/redis/v1/index.gen.js +0 -5
  123. package/dist/api/redis/v1/marshalling.gen.js +0 -259
  124. package/dist/api/registry/index.js +0 -2
  125. package/dist/api/registry/v1/api.gen.js +0 -252
  126. package/dist/api/registry/v1/content.gen.js +0 -13
  127. package/dist/api/registry/v1/index.gen.js +0 -5
  128. package/dist/api/registry/v1/marshalling.gen.js +0 -106
  129. package/dist/api/secret/index.js +0 -2
  130. package/dist/api/secret/v1alpha1/api.gen.js +0 -415
  131. package/dist/api/secret/v1alpha1/index.gen.js +0 -4
  132. package/dist/api/secret/v1alpha1/marshalling.gen.js +0 -143
  133. package/dist/api/tem/index.js +0 -2
  134. package/dist/api/tem/v1alpha1/api.gen.js +0 -229
  135. package/dist/api/tem/v1alpha1/content.gen.js +0 -10
  136. package/dist/api/tem/v1alpha1/index.gen.js +0 -5
  137. package/dist/api/tem/v1alpha1/marshalling.gen.js +0 -159
  138. package/dist/api/test/index.js +0 -2
  139. package/dist/api/test/v1/api.gen.js +0 -152
  140. package/dist/api/test/v1/content.gen.js +0 -7
  141. package/dist/api/test/v1/index.gen.js +0 -5
  142. package/dist/api/test/v1/marshalling.gen.js +0 -79
  143. package/dist/api/vpc/index.js +0 -4
  144. package/dist/api/vpc/v1/api.gen.js +0 -110
  145. package/dist/api/vpc/v1/index.gen.js +0 -4
  146. package/dist/api/vpc/v1/marshalling.gen.js +0 -44
  147. package/dist/api/vpc/v2/api.gen.js +0 -276
  148. package/dist/api/vpc/v2/index.gen.js +0 -4
  149. package/dist/api/vpc/v2/marshalling.gen.js +0 -135
  150. package/dist/api/vpcgw/index.js +0 -2
  151. package/dist/api/vpcgw/v1/api.gen.js +0 -669
  152. package/dist/api/vpcgw/v1/content.gen.js +0 -10
  153. package/dist/api/vpcgw/v1/index.gen.js +0 -5
  154. package/dist/api/vpcgw/v1/marshalling.gen.js +0 -336
  155. package/dist/api/webhosting/index.js +0 -2
  156. package/dist/api/webhosting/v1alpha1/api.gen.js +0 -210
  157. package/dist/api/webhosting/v1alpha1/content.gen.js +0 -7
  158. package/dist/api/webhosting/v1alpha1/index.gen.js +0 -7
  159. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +0 -173
  160. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +0 -23
  161. package/dist/helpers/is-browser.js +0 -5
  162. package/dist/helpers/is-response.js +0 -10
  163. package/dist/helpers/json.js +0 -11
  164. package/dist/helpers/marshalling.js +0 -130
  165. package/dist/index.cjs +0 -24364
  166. package/dist/index.d.ts +0 -27584
  167. package/dist/index.js +0 -69
  168. package/dist/internal/async/interval-retrier.js +0 -105
  169. package/dist/internal/async/sleep.js +0 -13
  170. package/dist/internal/interceptors/composer.js +0 -46
  171. package/dist/internal/interceptors/helpers.js +0 -32
  172. package/dist/internal/logger/console-logger.js +0 -38
  173. package/dist/internal/logger/index.js +0 -41
  174. package/dist/internal/logger/level-resolver.js +0 -13
  175. package/dist/internal/validations/string-validation.js +0 -38
  176. package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -13
  177. package/dist/scw/api.js +0 -12
  178. package/dist/scw/auth.js +0 -68
  179. package/dist/scw/client-ini-factory.js +0 -174
  180. package/dist/scw/client-ini-profile.js +0 -54
  181. package/dist/scw/client-settings.js +0 -78
  182. package/dist/scw/client.js +0 -98
  183. package/dist/scw/constants.js +0 -4
  184. package/dist/scw/custom-marshalling.js +0 -131
  185. package/dist/scw/errors/error-parser.js +0 -107
  186. package/dist/scw/errors/non-standard/invalid-request-mapper.js +0 -36
  187. package/dist/scw/errors/non-standard/unknown-resource-mapper.js +0 -27
  188. package/dist/scw/errors/scw-error.js +0 -66
  189. package/dist/scw/errors/standard/already-exists-error.js +0 -26
  190. package/dist/scw/errors/standard/denied-authentication-error.js +0 -52
  191. package/dist/scw/errors/standard/index.js +0 -13
  192. package/dist/scw/errors/standard/invalid-arguments-error.js +0 -67
  193. package/dist/scw/errors/standard/out-of-stock-error.js +0 -22
  194. package/dist/scw/errors/standard/permissions-denied-error.js +0 -48
  195. package/dist/scw/errors/standard/precondition-failed-error.js +0 -42
  196. package/dist/scw/errors/standard/quotas-exceeded-error.js +0 -68
  197. package/dist/scw/errors/standard/resource-expired-error.js +0 -26
  198. package/dist/scw/errors/standard/resource-locked-error.js +0 -25
  199. package/dist/scw/errors/standard/resource-not-found-error.js +0 -25
  200. package/dist/scw/errors/standard/too-many-requests-error.js +0 -70
  201. package/dist/scw/errors/standard/transient-state-error.js +0 -26
  202. package/dist/scw/errors/types.js +0 -23
  203. package/dist/scw/fetch/build-fetcher.js +0 -72
  204. package/dist/scw/fetch/http-dumper.js +0 -54
  205. package/dist/scw/fetch/http-interceptors.js +0 -99
  206. package/dist/scw/fetch/resource-paginator.js +0 -84
  207. package/dist/scw/fetch/response-parser.js +0 -72
  208. package/node_modules/@scaleway/random-name/.npmignore +0 -4
  209. package/node_modules/@scaleway/random-name/CHANGELOG.md +0 -129
  210. package/node_modules/@scaleway/random-name/LICENSE.md +0 -21
  211. package/node_modules/@scaleway/random-name/README.md +0 -26
  212. package/node_modules/@scaleway/random-name/dist/index.d.ts +0 -3
  213. package/node_modules/@scaleway/random-name/dist/index.js +0 -13
  214. package/node_modules/@scaleway/random-name/package.json +0 -23
@@ -1,448 +0,0 @@
1
- import { waitForResource } from '../../../internal/async/interval-retrier.js';
2
- import { API as API$1 } from '../../../scw/api.js';
3
- import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
4
- import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
- import { COCKPIT_TRANSIENT_STATUSES } from './content.gen.js';
6
- import { marshalActivateCockpitRequest, unmarshalCockpit, unmarshalCockpitMetrics, marshalDeactivateCockpitRequest, marshalResetCockpitGrafanaRequest, marshalCreateDatasourceRequest, unmarshalDatasource, marshalCreateTokenRequest, unmarshalToken, unmarshalListTokensResponse, marshalCreateContactPointRequest, unmarshalContactPoint, unmarshalListContactPointsResponse, marshalDeleteContactPointRequest, marshalEnableManagedAlertsRequest, marshalDisableManagedAlertsRequest, marshalTriggerTestAlertRequest, marshalCreateGrafanaUserRequest, unmarshalGrafanaUser, unmarshalListGrafanaUsersResponse, marshalDeleteGrafanaUserRequest, marshalResetGrafanaUserPasswordRequest, unmarshalListPlansResponse, marshalSelectPlanRequest, unmarshalSelectPlanResponse } from './marshalling.gen.js';
7
-
8
- // This file was automatically generated. DO NOT EDIT.
9
- // If you have any remark or suggestion do not hesitate to open an issue.
10
- const jsonContentHeaders = {
11
- 'Content-Type': 'application/json; charset=utf-8'
12
- };
13
-
14
- /**
15
- * Cockpit API.
16
- *
17
- * Cockpit's API allows you to activate your Cockpit on your Projects.
18
- * Scaleway's Cockpit stores metrics and logs and provides a dedicated Grafana
19
- * for dashboarding to visualize them.
20
- */
21
- class API extends API$1 {
22
- /**
23
- * Activate the Cockpit of the specified Project ID.
24
- *
25
- * @param request - The request {@link ActivateCockpitRequest}
26
- * @returns A Promise of Cockpit
27
- */
28
- activateCockpit = (() => {
29
- var _this = this;
30
- return function (request) {
31
- if (request === void 0) {
32
- request = {};
33
- }
34
- return _this.client.fetch({
35
- body: JSON.stringify(marshalActivateCockpitRequest(request, _this.client.settings)),
36
- headers: jsonContentHeaders,
37
- method: 'POST',
38
- path: `/cockpit/v1beta1/activate`
39
- }, unmarshalCockpit);
40
- };
41
- })();
42
-
43
- /**
44
- * Retrieve the Cockpit of the specified Project ID.
45
- *
46
- * @param request - The request {@link GetCockpitRequest}
47
- * @returns A Promise of Cockpit
48
- */
49
- getCockpit = (() => {
50
- var _this2 = this;
51
- return function (request) {
52
- if (request === void 0) {
53
- request = {};
54
- }
55
- return _this2.client.fetch({
56
- method: 'GET',
57
- path: `/cockpit/v1beta1/cockpit`,
58
- urlParams: urlParams(['project_id', request.projectId ?? _this2.client.settings.defaultProjectId])
59
- }, unmarshalCockpit);
60
- };
61
- })();
62
-
63
- /**
64
- * Waits for {@link Cockpit} to be in a final state.
65
- *
66
- * @param request - The request {@link GetCockpitRequest}
67
- * @param options - The waiting options
68
- * @returns A Promise of Cockpit
69
- */
70
- waitForCockpit = (() => {
71
- var _this3 = this;
72
- return function (request, options) {
73
- if (request === void 0) {
74
- request = {};
75
- }
76
- return waitForResource(options?.stop ?? (res => Promise.resolve(!COCKPIT_TRANSIENT_STATUSES.includes(res.status))), _this3.getCockpit, request, options);
77
- };
78
- })();
79
-
80
- /**
81
- * Get metrics from your Cockpit with the specified Project ID.
82
- *
83
- * @param request - The request {@link GetCockpitMetricsRequest}
84
- * @returns A Promise of CockpitMetrics
85
- */
86
- getCockpitMetrics = (() => {
87
- var _this4 = this;
88
- return function (request) {
89
- if (request === void 0) {
90
- request = {};
91
- }
92
- return _this4.client.fetch({
93
- method: 'GET',
94
- path: `/cockpit/v1beta1/cockpit/metrics`,
95
- urlParams: urlParams(['end_date', request.endDate], ['metric_name', request.metricName], ['project_id', request.projectId ?? _this4.client.settings.defaultProjectId], ['start_date', request.startDate])
96
- }, unmarshalCockpitMetrics);
97
- };
98
- })();
99
-
100
- /**
101
- * Deactivate the Cockpit of the specified Project ID.
102
- *
103
- * @param request - The request {@link DeactivateCockpitRequest}
104
- * @returns A Promise of Cockpit
105
- */
106
- deactivateCockpit = (() => {
107
- var _this5 = this;
108
- return function (request) {
109
- if (request === void 0) {
110
- request = {};
111
- }
112
- return _this5.client.fetch({
113
- body: JSON.stringify(marshalDeactivateCockpitRequest(request, _this5.client.settings)),
114
- headers: jsonContentHeaders,
115
- method: 'POST',
116
- path: `/cockpit/v1beta1/deactivate`
117
- }, unmarshalCockpit);
118
- };
119
- })();
120
-
121
- /**
122
- * Reset your Cockpit's Grafana associated with the specified Project ID.
123
- *
124
- * @param request - The request {@link ResetCockpitGrafanaRequest}
125
- * @returns A Promise of Cockpit
126
- */
127
- resetCockpitGrafana = (() => {
128
- var _this6 = this;
129
- return function (request) {
130
- if (request === void 0) {
131
- request = {};
132
- }
133
- return _this6.client.fetch({
134
- body: JSON.stringify(marshalResetCockpitGrafanaRequest(request, _this6.client.settings)),
135
- headers: jsonContentHeaders,
136
- method: 'POST',
137
- path: `/cockpit/v1beta1/reset-grafana`
138
- }, unmarshalCockpit);
139
- };
140
- })();
141
-
142
- /**
143
- * Create a datasource for the specified Project ID and the given type.
144
- *
145
- * @param request - The request {@link CreateDatasourceRequest}
146
- * @returns A Promise of Datasource
147
- */
148
- createDatasource = request => this.client.fetch({
149
- body: JSON.stringify(marshalCreateDatasourceRequest(request, this.client.settings)),
150
- headers: jsonContentHeaders,
151
- method: 'POST',
152
- path: `/cockpit/v1beta1/datasources`
153
- }, unmarshalDatasource);
154
-
155
- /**
156
- * Create a token associated with the specified Project ID.
157
- *
158
- * @param request - The request {@link CreateTokenRequest}
159
- * @returns A Promise of Token
160
- */
161
- createToken = request => this.client.fetch({
162
- body: JSON.stringify(marshalCreateTokenRequest(request, this.client.settings)),
163
- headers: jsonContentHeaders,
164
- method: 'POST',
165
- path: `/cockpit/v1beta1/tokens`
166
- }, unmarshalToken);
167
- pageOfListTokens = (() => {
168
- var _this7 = this;
169
- return function (request) {
170
- if (request === void 0) {
171
- request = {};
172
- }
173
- return _this7.client.fetch({
174
- method: 'GET',
175
- path: `/cockpit/v1beta1/tokens`,
176
- urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this7.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this7.client.settings.defaultProjectId])
177
- }, unmarshalListTokensResponse);
178
- };
179
- })();
180
-
181
- /**
182
- * Get a list of tokens associated with the specified Project ID.
183
- *
184
- * @param request - The request {@link ListTokensRequest}
185
- * @returns A Promise of ListTokensResponse
186
- */
187
- listTokens = (() => {
188
- var _this8 = this;
189
- return function (request) {
190
- if (request === void 0) {
191
- request = {};
192
- }
193
- return enrichForPagination('tokens', _this8.pageOfListTokens, request);
194
- };
195
- })();
196
-
197
- /**
198
- * Retrieve the token associated with the specified token ID.
199
- *
200
- * @param request - The request {@link GetTokenRequest}
201
- * @returns A Promise of Token
202
- */
203
- getToken = request => this.client.fetch({
204
- method: 'GET',
205
- path: `/cockpit/v1beta1/tokens/${validatePathParam('tokenId', request.tokenId)}`
206
- }, unmarshalToken);
207
-
208
- /**
209
- * Delete the token associated with the specified token ID.
210
- *
211
- * @param request - The request {@link DeleteTokenRequest}
212
- */
213
- deleteToken = request => this.client.fetch({
214
- method: 'DELETE',
215
- path: `/cockpit/v1beta1/tokens/${validatePathParam('tokenId', request.tokenId)}`
216
- });
217
-
218
- /**
219
- * Create a contact point to receive alerts for the default receiver.
220
- *
221
- * @param request - The request {@link CreateContactPointRequest}
222
- * @returns A Promise of ContactPoint
223
- */
224
- createContactPoint = request => this.client.fetch({
225
- body: JSON.stringify(marshalCreateContactPointRequest(request, this.client.settings)),
226
- headers: jsonContentHeaders,
227
- method: 'POST',
228
- path: `/cockpit/v1beta1/contact-points`
229
- }, unmarshalContactPoint);
230
- pageOfListContactPoints = (() => {
231
- var _this9 = this;
232
- return function (request) {
233
- if (request === void 0) {
234
- request = {};
235
- }
236
- return _this9.client.fetch({
237
- method: 'GET',
238
- path: `/cockpit/v1beta1/contact-points`,
239
- urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this9.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this9.client.settings.defaultProjectId])
240
- }, unmarshalListContactPointsResponse);
241
- };
242
- })();
243
-
244
- /**
245
- * Get a list of contact points for the Cockpit associated with the specified
246
- * Project ID.
247
- *
248
- * @param request - The request {@link ListContactPointsRequest}
249
- * @returns A Promise of ListContactPointsResponse
250
- */
251
- listContactPoints = (() => {
252
- var _this10 = this;
253
- return function (request) {
254
- if (request === void 0) {
255
- request = {};
256
- }
257
- return enrichForPagination('contactPoints', _this10.pageOfListContactPoints, request);
258
- };
259
- })();
260
-
261
- /**
262
- * Delete a contact point for the default receiver.
263
- *
264
- * @param request - The request {@link DeleteContactPointRequest}
265
- */
266
- deleteContactPoint = request => this.client.fetch({
267
- body: JSON.stringify(marshalDeleteContactPointRequest(request, this.client.settings)),
268
- headers: jsonContentHeaders,
269
- method: 'POST',
270
- path: `/cockpit/v1beta1/delete-contact-point`
271
- });
272
-
273
- /**
274
- * Enable the sending of managed alerts for the specified Project's Cockpit.
275
- *
276
- * @param request - The request {@link EnableManagedAlertsRequest}
277
- */
278
- enableManagedAlerts = (() => {
279
- var _this11 = this;
280
- return function (request) {
281
- if (request === void 0) {
282
- request = {};
283
- }
284
- return _this11.client.fetch({
285
- body: JSON.stringify(marshalEnableManagedAlertsRequest(request, _this11.client.settings)),
286
- headers: jsonContentHeaders,
287
- method: 'POST',
288
- path: `/cockpit/v1beta1/enable-managed-alerts`
289
- });
290
- };
291
- })();
292
-
293
- /**
294
- * Disable the sending of managed alerts for the specified Project's Cockpit.
295
- *
296
- * @param request - The request {@link DisableManagedAlertsRequest}
297
- */
298
- disableManagedAlerts = (() => {
299
- var _this12 = this;
300
- return function (request) {
301
- if (request === void 0) {
302
- request = {};
303
- }
304
- return _this12.client.fetch({
305
- body: JSON.stringify(marshalDisableManagedAlertsRequest(request, _this12.client.settings)),
306
- headers: jsonContentHeaders,
307
- method: 'POST',
308
- path: `/cockpit/v1beta1/disable-managed-alerts`
309
- });
310
- };
311
- })();
312
-
313
- /**
314
- * Trigger a test alert to all of the Cockpit's receivers.
315
- *
316
- * @param request - The request {@link TriggerTestAlertRequest}
317
- */
318
- triggerTestAlert = (() => {
319
- var _this13 = this;
320
- return function (request) {
321
- if (request === void 0) {
322
- request = {};
323
- }
324
- return _this13.client.fetch({
325
- body: JSON.stringify(marshalTriggerTestAlertRequest(request, _this13.client.settings)),
326
- headers: jsonContentHeaders,
327
- method: 'POST',
328
- path: `/cockpit/v1beta1/trigger-test-alert`
329
- });
330
- };
331
- })();
332
-
333
- /**
334
- * Create a Grafana user for your Cockpit's Grafana instance. Make sure you
335
- * save the automatically-generated password and the Grafana user ID.
336
- *
337
- * @param request - The request {@link CreateGrafanaUserRequest}
338
- * @returns A Promise of GrafanaUser
339
- */
340
- createGrafanaUser = request => this.client.fetch({
341
- body: JSON.stringify(marshalCreateGrafanaUserRequest(request, this.client.settings)),
342
- headers: jsonContentHeaders,
343
- method: 'POST',
344
- path: `/cockpit/v1beta1/grafana-users`
345
- }, unmarshalGrafanaUser);
346
- pageOfListGrafanaUsers = (() => {
347
- var _this14 = this;
348
- return function (request) {
349
- if (request === void 0) {
350
- request = {};
351
- }
352
- return _this14.client.fetch({
353
- method: 'GET',
354
- path: `/cockpit/v1beta1/grafana-users`,
355
- urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this14.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this14.client.settings.defaultProjectId])
356
- }, unmarshalListGrafanaUsersResponse);
357
- };
358
- })();
359
-
360
- /**
361
- * Get a list of Grafana users who are able to connect to the Cockpit's
362
- * Grafana instance.
363
- *
364
- * @param request - The request {@link ListGrafanaUsersRequest}
365
- * @returns A Promise of ListGrafanaUsersResponse
366
- */
367
- listGrafanaUsers = (() => {
368
- var _this15 = this;
369
- return function (request) {
370
- if (request === void 0) {
371
- request = {};
372
- }
373
- return enrichForPagination('grafanaUsers', _this15.pageOfListGrafanaUsers, request);
374
- };
375
- })();
376
-
377
- /**
378
- * Delete a Grafana user from a Grafana instance, specified by the Cockpit's
379
- * Project ID and the Grafana user ID.
380
- *
381
- * @param request - The request {@link DeleteGrafanaUserRequest}
382
- */
383
- deleteGrafanaUser = request => this.client.fetch({
384
- body: JSON.stringify(marshalDeleteGrafanaUserRequest(request, this.client.settings)),
385
- headers: jsonContentHeaders,
386
- method: 'POST',
387
- path: `/cockpit/v1beta1/grafana-users/${validatePathParam('grafanaUserId', request.grafanaUserId)}/delete`
388
- });
389
-
390
- /**
391
- * Reset a Grafana user's password specified by the Cockpit's Project ID and
392
- * the Grafana user ID.
393
- *
394
- * @param request - The request {@link ResetGrafanaUserPasswordRequest}
395
- * @returns A Promise of GrafanaUser
396
- */
397
- resetGrafanaUserPassword = request => this.client.fetch({
398
- body: JSON.stringify(marshalResetGrafanaUserPasswordRequest(request, this.client.settings)),
399
- headers: jsonContentHeaders,
400
- method: 'POST',
401
- path: `/cockpit/v1beta1/grafana-users/${validatePathParam('grafanaUserId', request.grafanaUserId)}/reset-password`
402
- }, unmarshalGrafanaUser);
403
- pageOfListPlans = (() => {
404
- var _this16 = this;
405
- return function (request) {
406
- if (request === void 0) {
407
- request = {};
408
- }
409
- return _this16.client.fetch({
410
- method: 'GET',
411
- path: `/cockpit/v1beta1/plans`,
412
- urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this16.client.settings.defaultPageSize])
413
- }, unmarshalListPlansResponse);
414
- };
415
- })();
416
-
417
- /**
418
- * Get a list of all pricing plans available.
419
- *
420
- * @param request - The request {@link ListPlansRequest}
421
- * @returns A Promise of ListPlansResponse
422
- */
423
- listPlans = (() => {
424
- var _this17 = this;
425
- return function (request) {
426
- if (request === void 0) {
427
- request = {};
428
- }
429
- return enrichForPagination('plans', _this17.pageOfListPlans, request);
430
- };
431
- })();
432
-
433
- /**
434
- * Select your chosen pricing plan for your Cockpit, specifying the Cockpit's
435
- * Project ID and the pricing plan's ID in the request.
436
- *
437
- * @param request - The request {@link SelectPlanRequest}
438
- * @returns A Promise of SelectPlanResponse
439
- */
440
- selectPlan = request => this.client.fetch({
441
- body: JSON.stringify(marshalSelectPlanRequest(request, this.client.settings)),
442
- headers: jsonContentHeaders,
443
- method: 'POST',
444
- path: `/cockpit/v1beta1/select-plan`
445
- }, unmarshalSelectPlanResponse);
446
- }
447
-
448
- export { API };
@@ -1,7 +0,0 @@
1
- // This file was automatically generated. DO NOT EDIT.
2
- // If you have any remark or suggestion do not hesitate to open an issue.
3
-
4
- /** Lists transient statutes of the enum {@link CockpitStatus}. */
5
- const COCKPIT_TRANSIENT_STATUSES = ['creating', 'deleting', 'updating'];
6
-
7
- export { COCKPIT_TRANSIENT_STATUSES };
@@ -1,5 +0,0 @@
1
- export { API } from './api.gen.js';
2
- export { COCKPIT_TRANSIENT_STATUSES } from './content.gen.js';
3
-
4
- // This file was automatically generated. DO NOT EDIT.
5
- // If you have any remark or suggestion do not hesitate to open an issue.
@@ -1,220 +0,0 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js';
2
- import { isJSONObject } from '../../../helpers/json.js';
3
- import { unmarshalTimeSeries } from '../../../scw/custom-marshalling.js';
4
- import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
5
-
6
- // This file was automatically generated. DO NOT EDIT.
7
- // If you have any remark or suggestion do not hesitate to open an issue.
8
- const unmarshalContactPointEmail = data => {
9
- if (!isJSONObject(data)) {
10
- throw new TypeError(`Unmarshalling the type 'ContactPointEmail' failed as data isn't a dictionary.`);
11
- }
12
- return {
13
- to: data.to
14
- };
15
- };
16
- const unmarshalContactPoint = data => {
17
- if (!isJSONObject(data)) {
18
- throw new TypeError(`Unmarshalling the type 'ContactPoint' failed as data isn't a dictionary.`);
19
- }
20
- return {
21
- email: data.email ? unmarshalContactPointEmail(data.email) : undefined
22
- };
23
- };
24
- const unmarshalGrafanaUser = data => {
25
- if (!isJSONObject(data)) {
26
- throw new TypeError(`Unmarshalling the type 'GrafanaUser' failed as data isn't a dictionary.`);
27
- }
28
- return {
29
- id: data.id,
30
- login: data.login,
31
- password: data.password ? data.password : undefined,
32
- role: data.role
33
- };
34
- };
35
- const unmarshalTokenScopes = data => {
36
- if (!isJSONObject(data)) {
37
- throw new TypeError(`Unmarshalling the type 'TokenScopes' failed as data isn't a dictionary.`);
38
- }
39
- return {
40
- queryLogs: data.query_logs,
41
- queryMetrics: data.query_metrics,
42
- queryTraces: data.query_traces,
43
- setupAlerts: data.setup_alerts,
44
- setupLogsRules: data.setup_logs_rules,
45
- setupMetricsRules: data.setup_metrics_rules,
46
- writeLogs: data.write_logs,
47
- writeMetrics: data.write_metrics,
48
- writeTraces: data.write_traces
49
- };
50
- };
51
- const unmarshalToken = data => {
52
- if (!isJSONObject(data)) {
53
- throw new TypeError(`Unmarshalling the type 'Token' failed as data isn't a dictionary.`);
54
- }
55
- return {
56
- createdAt: unmarshalDate(data.created_at),
57
- id: data.id,
58
- name: data.name,
59
- projectId: data.project_id,
60
- scopes: unmarshalTokenScopes(data.scopes),
61
- secretKey: data.secret_key ? data.secret_key : undefined,
62
- updatedAt: unmarshalDate(data.updated_at)
63
- };
64
- };
65
- const unmarshalPlan = data => {
66
- if (!isJSONObject(data)) {
67
- throw new TypeError(`Unmarshalling the type 'Plan' failed as data isn't a dictionary.`);
68
- }
69
- return {
70
- id: data.id,
71
- logsIngestionPrice: data.logs_ingestion_price,
72
- name: data.name,
73
- retentionLogsInterval: data.retention_logs_interval ? data.retention_logs_interval : undefined,
74
- retentionMetricsInterval: data.retention_metrics_interval ? data.retention_metrics_interval : undefined,
75
- retentionPrice: data.retention_price,
76
- sampleIngestionPrice: data.sample_ingestion_price
77
- };
78
- };
79
- const unmarshalCockpitEndpoints = data => {
80
- if (!isJSONObject(data)) {
81
- throw new TypeError(`Unmarshalling the type 'CockpitEndpoints' failed as data isn't a dictionary.`);
82
- }
83
- return {
84
- alertmanagerUrl: data.alertmanager_url,
85
- grafanaUrl: data.grafana_url,
86
- logsUrl: data.logs_url,
87
- metricsUrl: data.metrics_url
88
- };
89
- };
90
- const unmarshalCockpit = data => {
91
- if (!isJSONObject(data)) {
92
- throw new TypeError(`Unmarshalling the type 'Cockpit' failed as data isn't a dictionary.`);
93
- }
94
- return {
95
- createdAt: unmarshalDate(data.created_at),
96
- endpoints: unmarshalCockpitEndpoints(data.endpoints),
97
- managedAlertsEnabled: data.managed_alerts_enabled,
98
- plan: unmarshalPlan(data.plan),
99
- projectId: data.project_id,
100
- status: data.status,
101
- updatedAt: unmarshalDate(data.updated_at)
102
- };
103
- };
104
- const unmarshalCockpitMetrics = data => {
105
- if (!isJSONObject(data)) {
106
- throw new TypeError(`Unmarshalling the type 'CockpitMetrics' failed as data isn't a dictionary.`);
107
- }
108
- return {
109
- timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries)
110
- };
111
- };
112
- const unmarshalDatasource = data => {
113
- if (!isJSONObject(data)) {
114
- throw new TypeError(`Unmarshalling the type 'Datasource' failed as data isn't a dictionary.`);
115
- }
116
- return {
117
- id: data.id,
118
- name: data.name,
119
- projectId: data.project_id,
120
- type: data.type,
121
- url: data.url
122
- };
123
- };
124
- const unmarshalListContactPointsResponse = data => {
125
- if (!isJSONObject(data)) {
126
- throw new TypeError(`Unmarshalling the type 'ListContactPointsResponse' failed as data isn't a dictionary.`);
127
- }
128
- return {
129
- contactPoints: unmarshalArrayOfObject(data.contact_points, unmarshalContactPoint),
130
- hasAdditionalContactPoints: data.has_additional_contact_points,
131
- hasAdditionalReceivers: data.has_additional_receivers,
132
- totalCount: data.total_count
133
- };
134
- };
135
- const unmarshalListGrafanaUsersResponse = data => {
136
- if (!isJSONObject(data)) {
137
- throw new TypeError(`Unmarshalling the type 'ListGrafanaUsersResponse' failed as data isn't a dictionary.`);
138
- }
139
- return {
140
- grafanaUsers: unmarshalArrayOfObject(data.grafana_users, unmarshalGrafanaUser),
141
- totalCount: data.total_count
142
- };
143
- };
144
- const unmarshalListPlansResponse = data => {
145
- if (!isJSONObject(data)) {
146
- throw new TypeError(`Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.`);
147
- }
148
- return {
149
- plans: unmarshalArrayOfObject(data.plans, unmarshalPlan),
150
- totalCount: data.total_count
151
- };
152
- };
153
- const unmarshalListTokensResponse = data => {
154
- if (!isJSONObject(data)) {
155
- throw new TypeError(`Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`);
156
- }
157
- return {
158
- tokens: unmarshalArrayOfObject(data.tokens, unmarshalToken),
159
- totalCount: data.total_count
160
- };
161
- };
162
- const unmarshalSelectPlanResponse = data => {
163
- if (!isJSONObject(data)) {
164
- throw new TypeError(`Unmarshalling the type 'SelectPlanResponse' failed as data isn't a dictionary.`);
165
- }
166
- return {};
167
- };
168
- const marshalActivateCockpitRequest = (request, defaults) => ({
169
- project_id: request.projectId ?? defaults.defaultProjectId
170
- });
171
- const marshalCreateContactPointRequest = (request, defaults) => ({
172
- contact_point: request.contactPoint,
173
- project_id: request.projectId ?? defaults.defaultProjectId
174
- });
175
- const marshalCreateDatasourceRequest = (request, defaults) => ({
176
- name: request.name,
177
- project_id: request.projectId ?? defaults.defaultProjectId,
178
- type: request.type
179
- });
180
- const marshalCreateGrafanaUserRequest = (request, defaults) => ({
181
- login: request.login,
182
- project_id: request.projectId ?? defaults.defaultProjectId,
183
- role: request.role
184
- });
185
- const marshalCreateTokenRequest = (request, defaults) => ({
186
- name: request.name || randomName('token'),
187
- project_id: request.projectId ?? defaults.defaultProjectId,
188
- scopes: request.scopes
189
- });
190
- const marshalDeactivateCockpitRequest = (request, defaults) => ({
191
- project_id: request.projectId ?? defaults.defaultProjectId
192
- });
193
- const marshalDeleteContactPointRequest = (request, defaults) => ({
194
- contact_point: request.contactPoint,
195
- project_id: request.projectId ?? defaults.defaultProjectId
196
- });
197
- const marshalDeleteGrafanaUserRequest = (request, defaults) => ({
198
- project_id: request.projectId ?? defaults.defaultProjectId
199
- });
200
- const marshalDisableManagedAlertsRequest = (request, defaults) => ({
201
- project_id: request.projectId ?? defaults.defaultProjectId
202
- });
203
- const marshalEnableManagedAlertsRequest = (request, defaults) => ({
204
- project_id: request.projectId ?? defaults.defaultProjectId
205
- });
206
- const marshalResetCockpitGrafanaRequest = (request, defaults) => ({
207
- project_id: request.projectId ?? defaults.defaultProjectId
208
- });
209
- const marshalResetGrafanaUserPasswordRequest = (request, defaults) => ({
210
- project_id: request.projectId ?? defaults.defaultProjectId
211
- });
212
- const marshalSelectPlanRequest = (request, defaults) => ({
213
- plan_id: request.planId,
214
- project_id: request.projectId ?? defaults.defaultProjectId
215
- });
216
- const marshalTriggerTestAlertRequest = (request, defaults) => ({
217
- project_id: request.projectId ?? defaults.defaultProjectId
218
- });
219
-
220
- export { marshalActivateCockpitRequest, marshalCreateContactPointRequest, marshalCreateDatasourceRequest, marshalCreateGrafanaUserRequest, marshalCreateTokenRequest, marshalDeactivateCockpitRequest, marshalDeleteContactPointRequest, marshalDeleteGrafanaUserRequest, marshalDisableManagedAlertsRequest, marshalEnableManagedAlertsRequest, marshalResetCockpitGrafanaRequest, marshalResetGrafanaUserPasswordRequest, marshalSelectPlanRequest, marshalTriggerTestAlertRequest, unmarshalCockpit, unmarshalCockpitMetrics, unmarshalContactPoint, unmarshalDatasource, unmarshalGrafanaUser, unmarshalListContactPointsResponse, unmarshalListGrafanaUsersResponse, unmarshalListPlansResponse, unmarshalListTokensResponse, unmarshalSelectPlanResponse, unmarshalToken };
@@ -1,2 +0,0 @@
1
- import * as index_gen from './v1beta1/index.gen.js';
2
- export { index_gen as v1beta1 };