@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
package/package.json CHANGED
@@ -1,39 +1,85 @@
1
1
  {
2
2
  "name": "@scaleway/sdk",
3
- "version": "3.0.0-alpha.0",
3
+ "version": "3.1.1",
4
+ "description": "Scaleway SDK TS.",
4
5
  "license": "Apache-2.0",
5
- "description": "Scaleway SDK.",
6
- "keywords": [
7
- "scaleway",
8
- "cloud",
9
- "sdk"
10
- ],
11
- "main": "dist/index.cjs",
12
- "module": "dist/index.js",
13
- "types": "dist/index.d.ts",
14
- "scripts": {
15
- "version": "./scripts/update-constants-file.sh"
16
- },
17
6
  "files": [
18
7
  "dist"
19
8
  ],
20
- "publishConfig": {
21
- "access": "public"
9
+ "type": "module",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.gen.d.ts",
13
+ "default": "./dist/index.gen.js"
14
+ }
22
15
  },
23
16
  "repository": {
24
17
  "type": "git",
25
- "url": "https://github.com/scaleway/scaleway-sdk-js",
26
- "directory": "packages/clients"
18
+ "url": "git+https://github.com/scaleway/scaleway-sdk-js.git",
19
+ "directory": "packages/sdk"
27
20
  },
28
21
  "engines": {
29
- "node": ">=18.0"
22
+ "node": ">=20.19.6"
30
23
  },
31
- "type": "module",
32
24
  "dependencies": {
33
- "@scaleway/random-name": "^4.0.2"
25
+ "@scaleway/sdk-applesilicon": "2.1.1",
26
+ "@scaleway/sdk-account": "2.1.1",
27
+ "@scaleway/sdk-autoscaling": "2.1.1",
28
+ "@scaleway/sdk-audit-trail": "2.1.1",
29
+ "@scaleway/sdk-baremetal": "2.1.1",
30
+ "@scaleway/sdk-billing": "2.1.1",
31
+ "@scaleway/sdk-block": "2.1.1",
32
+ "@scaleway/sdk-client": "^2.1.0",
33
+ "@scaleway/sdk-container": "2.1.1",
34
+ "@scaleway/sdk-cockpit": "2.1.1",
35
+ "@scaleway/sdk-datawarehouse": "2.1.1",
36
+ "@scaleway/sdk-dedibox": "2.1.1",
37
+ "@scaleway/sdk-domain": "2.1.1",
38
+ "@scaleway/sdk-edge-services": "2.1.1",
39
+ "@scaleway/sdk-environmental-footprint": "2.2.0",
40
+ "@scaleway/sdk-file": "2.1.1",
41
+ "@scaleway/sdk-iam": "2.1.1",
42
+ "@scaleway/sdk-function": "2.1.1",
43
+ "@scaleway/sdk-inference": "2.1.1",
44
+ "@scaleway/sdk-interlink": "2.1.1",
45
+ "@scaleway/sdk-instance": "2.1.1",
46
+ "@scaleway/sdk-flexibleip": "2.1.1",
47
+ "@scaleway/sdk-ipam": "2.1.1",
48
+ "@scaleway/sdk-iot": "2.1.1",
49
+ "@scaleway/sdk-jobs": "2.1.1",
50
+ "@scaleway/sdk-k8s": "2.2.0",
51
+ "@scaleway/sdk-kafka": "2.1.1",
52
+ "@scaleway/sdk-key-manager": "2.1.1",
53
+ "@scaleway/sdk-lb": "2.1.1",
54
+ "@scaleway/sdk-marketplace": "2.1.1",
55
+ "@scaleway/sdk-mongodb": "2.1.1",
56
+ "@scaleway/sdk-product-catalog": "2.1.1",
57
+ "@scaleway/sdk-mnq": "2.1.1",
58
+ "@scaleway/sdk-qaas": "2.1.1",
59
+ "@scaleway/sdk-rdb": "2.1.1",
60
+ "@scaleway/sdk-redis": "2.1.1",
61
+ "@scaleway/sdk-registry": "2.1.1",
62
+ "@scaleway/sdk-secret": "2.1.1",
63
+ "@scaleway/sdk-serverless-sqldb": "2.1.1",
64
+ "@scaleway/sdk-s2s-vpn": "2.1.1",
65
+ "@scaleway/sdk-tem": "2.1.1",
66
+ "@scaleway/sdk-test": "2.1.1",
67
+ "@scaleway/sdk-vpc": "2.1.1",
68
+ "@scaleway/sdk-std": "2.1.0",
69
+ "@scaleway/sdk-vpcgw": "2.1.1",
70
+ "@scaleway/sdk-webhosting": "2.1.1"
34
71
  },
35
- "bundledDependencies": [
36
- "@scaleway/random-name"
37
- ],
38
- "gitHead": "28047ea6cbed152dde09cf282a4c957d5ff559ce"
39
- }
72
+ "devDependencies": {
73
+ "@scaleway/sdk-client": "^2.1.0"
74
+ },
75
+ "peerDependencies": {
76
+ "@scaleway/sdk-client": "^2.1.0"
77
+ },
78
+ "scripts": {
79
+ "package:check": "pnpm publint",
80
+ "typecheck": "tsc --noEmit",
81
+ "type:generate": "tsc --declaration -p tsconfig.build.json",
82
+ "build": "vite build --config vite.config.ts && pnpm run type:generate",
83
+ "build:profile": "npx vite-bundle-visualizer -c vite.config.ts"
84
+ }
85
+ }
package/README.md DELETED
@@ -1,46 +0,0 @@
1
- # Scaleway SDK
2
-
3
- This SDK enables you to interact with Scaleway APIs.
4
-
5
- **🔗  Important links:**
6
- * [Reference documentation](https://scaleway.github.io/scaleway-sdk-js)
7
- * [Example projects](https://github.com/scaleway/scaleway-sdk-js/tree/master/examples)
8
- * [Developers website](https://developers.scaleway.com) (API documentation)
9
-
10
- ## Getting Started
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/en/docs/identity-and-access-management/iam/how-to/create-api-keys/) on how to retrieve them.
13
-
14
- **A minimal setup** would look like this:
15
-
16
- ```ts
17
- import { Registry, createClient } from '@scaleway/sdk'
18
-
19
- const client = createClient({
20
- accessKey: 'SCWXXXXXXXXXXXXXXXXX',
21
- secretKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
22
- defaultProjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
23
- defaultRegion: 'fr-par',
24
- defaultZone: 'fr-par-1',
25
- })
26
-
27
- const api = new Registry.v1.API(client)
28
- ```
29
-
30
- **For a simpler setup**, you could retrieve the profile from either the configuration file or the environment variables:
31
-
32
- ```ts
33
- import {
34
- loadProfileFromConfigurationFile,
35
- // loadProfileFromEnvironmentValues,
36
- } from '@scaleway/configuration-loader'
37
-
38
- const profile = loadProfileFromConfigurationFile() // loadProfileFromEnvironmentValues()
39
- const client = createClient(profile)
40
- ```
41
-
42
- **For more information**, please check the [GitHub project](https://github.com/scaleway/scaleway-sdk-js).
43
-
44
- ## Reach us
45
-
46
- We love feedback. Feel free to reach us on [Scaleway Slack community](https://slack.scaleway.com/), we are waiting for you on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource).
@@ -1,4 +0,0 @@
1
- import * as index_gen from './v2/index.gen.js';
2
- export { index_gen as v2 };
3
- import * as index_gen$1 from './v3/index.gen.js';
4
- export { index_gen$1 as v3 };
@@ -1,147 +0,0 @@
1
- import { API as API$1 } from '../../../scw/api.js';
2
- import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
3
- import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
4
- import { marshalCreateProjectRequest, unmarshalProject, unmarshalListProjectsResponse, marshalUpdateProjectRequest } from './marshalling.gen.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 jsonContentHeaders = {
9
- 'Content-Type': 'application/json; charset=utf-8'
10
- };
11
-
12
- /**
13
- * Account API.
14
- *
15
- * User related data. This API allows you to manage projects.
16
- */
17
- class API extends API$1 {
18
- /**
19
- * Create a new Project for an Organization. Deprecated in favor of Account
20
- * API v3. Generate a new Project for an Organization, specifying its
21
- * configuration including name and description.
22
- *
23
- * @deprecated
24
- * @param request - The request {@link CreateProjectRequest}
25
- * @returns A Promise of Project
26
- */
27
- createProject = (() => {
28
- var _this = this;
29
- return function (request) {
30
- if (request === void 0) {
31
- request = {};
32
- }
33
- return _this.client.fetch({
34
- body: JSON.stringify(marshalCreateProjectRequest(request, _this.client.settings)),
35
- headers: jsonContentHeaders,
36
- method: 'POST',
37
- path: `/account/v2/projects`
38
- }, unmarshalProject);
39
- };
40
- })();
41
- pageOfListProjects = (() => {
42
- var _this2 = this;
43
- return function (request) {
44
- if (request === void 0) {
45
- request = {};
46
- }
47
- return _this2.client.fetch({
48
- method: 'GET',
49
- path: `/account/v2/projects`,
50
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId ?? _this2.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this2.client.settings.defaultPageSize], ['project_ids', request.projectIds])
51
- }, unmarshalListProjectsResponse);
52
- };
53
- })();
54
-
55
- /**
56
- * List all Projects of an Organization. Deprecated in favor of Account API
57
- * v3. List all Projects of an Organization. The response will include the
58
- * total number of Projects as well as their associated Organizations, names
59
- * and IDs. Other information include the creation and update date of the
60
- * Project.
61
- *
62
- * @deprecated
63
- * @param request - The request {@link ListProjectsRequest}
64
- * @returns A Promise of ListProjectsResponse
65
- */
66
- listProjects = (() => {
67
- var _this3 = this;
68
- return function (request) {
69
- if (request === void 0) {
70
- request = {};
71
- }
72
- return enrichForPagination('projects', _this3.pageOfListProjects, request);
73
- };
74
- })();
75
-
76
- /**
77
- * Get an existing Project. Deprecated in favor of Account API v3. Retrieve
78
- * information about an existing Project, specified by its Project ID. Its
79
- * full details, including ID, name and description, are returned in the
80
- * response object.
81
- *
82
- * @deprecated
83
- * @param request - The request {@link GetProjectRequest}
84
- * @returns A Promise of Project
85
- */
86
- getProject = (() => {
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: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this4.client.settings.defaultProjectId)}`
95
- }, unmarshalProject);
96
- };
97
- })();
98
-
99
- /**
100
- * Delete an existing Project. Deprecated in favor of Account API v3. Delete
101
- * an existing Project, specified by its Project ID. The Project needs to be
102
- * empty (meaning there are no resources left in it) to be deleted
103
- * effectively. Note that deleting a Project is permanent, and cannot be
104
- * undone.
105
- *
106
- * @deprecated
107
- * @param request - The request {@link DeleteProjectRequest}
108
- */
109
- deleteProject = (() => {
110
- var _this5 = this;
111
- return function (request) {
112
- if (request === void 0) {
113
- request = {};
114
- }
115
- return _this5.client.fetch({
116
- method: 'DELETE',
117
- path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this5.client.settings.defaultProjectId)}`
118
- });
119
- };
120
- })();
121
-
122
- /**
123
- * Update Project. Deprecated in favor of Account API v3. Update the
124
- * parameters of an existing Project, specified by its Project ID. These
125
- * parameters include the name and description.
126
- *
127
- * @deprecated
128
- * @param request - The request {@link UpdateProjectRequest}
129
- * @returns A Promise of Project
130
- */
131
- updateProject = (() => {
132
- var _this6 = this;
133
- return function (request) {
134
- if (request === void 0) {
135
- request = {};
136
- }
137
- return _this6.client.fetch({
138
- body: JSON.stringify(marshalUpdateProjectRequest(request, _this6.client.settings)),
139
- headers: jsonContentHeaders,
140
- method: 'PATCH',
141
- path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this6.client.settings.defaultProjectId)}`
142
- }, unmarshalProject);
143
- };
144
- })();
145
- }
146
-
147
- export { API };
@@ -1,4 +0,0 @@
1
- export { API } from './api.gen.js';
2
-
3
- // This file was automatically generated. DO NOT EDIT.
4
- // If you have any remark or suggestion do not hesitate to open an issue.
@@ -1,39 +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 { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
4
-
5
- // This file was automatically generated. DO NOT EDIT.
6
- // If you have any remark or suggestion do not hesitate to open an issue.
7
- const unmarshalProject = data => {
8
- if (!isJSONObject(data)) {
9
- throw new TypeError(`Unmarshalling the type 'Project' failed as data isn't a dictionary.`);
10
- }
11
- return {
12
- createdAt: unmarshalDate(data.created_at),
13
- description: data.description,
14
- id: data.id,
15
- name: data.name,
16
- organizationId: data.organization_id,
17
- updatedAt: unmarshalDate(data.updated_at)
18
- };
19
- };
20
- const unmarshalListProjectsResponse = data => {
21
- if (!isJSONObject(data)) {
22
- throw new TypeError(`Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`);
23
- }
24
- return {
25
- projects: unmarshalArrayOfObject(data.projects, unmarshalProject),
26
- totalCount: data.total_count
27
- };
28
- };
29
- const marshalCreateProjectRequest = (request, defaults) => ({
30
- description: request.description,
31
- name: request.name || randomName('proj'),
32
- organization_id: request.organizationId ?? defaults.defaultOrganizationId
33
- });
34
- const marshalUpdateProjectRequest = (request, defaults) => ({
35
- description: request.description,
36
- name: request.name
37
- });
38
-
39
- export { marshalCreateProjectRequest, marshalUpdateProjectRequest, unmarshalListProjectsResponse, unmarshalProject };
@@ -1,129 +0,0 @@
1
- import { API as API$1 } from '../../../scw/api.js';
2
- import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
3
- import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
4
- import { marshalProjectApiCreateProjectRequest, unmarshalProject, unmarshalListProjectsResponse, marshalProjectApiUpdateProjectRequest } from './marshalling.gen.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 jsonContentHeaders = {
9
- 'Content-Type': 'application/json; charset=utf-8'
10
- };
11
-
12
- /**
13
- * Account API.
14
- *
15
- * This API allows you to manage projects.
16
- */
17
- class ProjectAPI extends API$1 {
18
- /**
19
- * Create a new Project for an Organization. Generate a new Project for an
20
- * Organization, specifying its configuration including name and description.
21
- *
22
- * @param request - The request {@link ProjectApiCreateProjectRequest}
23
- * @returns A Promise of Project
24
- */
25
- createProject = request => this.client.fetch({
26
- body: JSON.stringify(marshalProjectApiCreateProjectRequest(request, this.client.settings)),
27
- headers: jsonContentHeaders,
28
- method: 'POST',
29
- path: `/account/v3/projects`
30
- }, unmarshalProject);
31
- pageOfListProjects = (() => {
32
- var _this = this;
33
- return function (request) {
34
- if (request === void 0) {
35
- request = {};
36
- }
37
- return _this.client.fetch({
38
- method: 'GET',
39
- path: `/account/v3/projects`,
40
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_ids', request.projectIds])
41
- }, unmarshalListProjectsResponse);
42
- };
43
- })();
44
-
45
- /**
46
- * List all Projects of an Organization. List all Projects of an Organization.
47
- * The response will include the total number of Projects as well as their
48
- * associated Organizations, names, and IDs. Other information includes the
49
- * creation and update date of the Project.
50
- *
51
- * @param request - The request {@link ProjectApiListProjectsRequest}
52
- * @returns A Promise of ListProjectsResponse
53
- */
54
- listProjects = (() => {
55
- var _this2 = this;
56
- return function (request) {
57
- if (request === void 0) {
58
- request = {};
59
- }
60
- return enrichForPagination('projects', _this2.pageOfListProjects, request);
61
- };
62
- })();
63
-
64
- /**
65
- * Get an existing Project. Retrieve information about an existing Project,
66
- * specified by its Project ID. Its full details, including ID, name and
67
- * description, are returned in the response object.
68
- *
69
- * @param request - The request {@link ProjectApiGetProjectRequest}
70
- * @returns A Promise of Project
71
- */
72
- getProject = (() => {
73
- var _this3 = this;
74
- return function (request) {
75
- if (request === void 0) {
76
- request = {};
77
- }
78
- return _this3.client.fetch({
79
- method: 'GET',
80
- path: `/account/v3/projects/${validatePathParam('projectId', request.projectId ?? _this3.client.settings.defaultProjectId)}`
81
- }, unmarshalProject);
82
- };
83
- })();
84
-
85
- /**
86
- * Delete an existing Project. Delete an existing Project, specified by its
87
- * Project ID. The Project needs to be empty (meaning there are no resources
88
- * left in it) to be deleted effectively. Note that deleting a Project is
89
- * permanent, and cannot be undone.
90
- *
91
- * @param request - The request {@link ProjectApiDeleteProjectRequest}
92
- */
93
- deleteProject = (() => {
94
- var _this4 = this;
95
- return function (request) {
96
- if (request === void 0) {
97
- request = {};
98
- }
99
- return _this4.client.fetch({
100
- method: 'DELETE',
101
- path: `/account/v3/projects/${validatePathParam('projectId', request.projectId ?? _this4.client.settings.defaultProjectId)}`
102
- });
103
- };
104
- })();
105
-
106
- /**
107
- * Update Project. Update the parameters of an existing Project, specified by
108
- * its Project ID. These parameters include the name and description.
109
- *
110
- * @param request - The request {@link ProjectApiUpdateProjectRequest}
111
- * @returns A Promise of Project
112
- */
113
- updateProject = (() => {
114
- var _this5 = this;
115
- return function (request) {
116
- if (request === void 0) {
117
- request = {};
118
- }
119
- return _this5.client.fetch({
120
- body: JSON.stringify(marshalProjectApiUpdateProjectRequest(request, _this5.client.settings)),
121
- headers: jsonContentHeaders,
122
- method: 'PATCH',
123
- path: `/account/v3/projects/${validatePathParam('projectId', request.projectId ?? _this5.client.settings.defaultProjectId)}`
124
- }, unmarshalProject);
125
- };
126
- })();
127
- }
128
-
129
- export { ProjectAPI };
@@ -1,6 +0,0 @@
1
- export { ProjectAPI } from './api.gen.js';
2
- import * as validationRules_gen from './validation-rules.gen.js';
3
- export { validationRules_gen as ValidationRules };
4
-
5
- // This file was automatically generated. DO NOT EDIT.
6
- // If you have any remark or suggestion do not hesitate to open an issue.
@@ -1,39 +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 { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
4
-
5
- // This file was automatically generated. DO NOT EDIT.
6
- // If you have any remark or suggestion do not hesitate to open an issue.
7
- const unmarshalProject = data => {
8
- if (!isJSONObject(data)) {
9
- throw new TypeError(`Unmarshalling the type 'Project' failed as data isn't a dictionary.`);
10
- }
11
- return {
12
- createdAt: unmarshalDate(data.created_at),
13
- description: data.description,
14
- id: data.id,
15
- name: data.name,
16
- organizationId: data.organization_id,
17
- updatedAt: unmarshalDate(data.updated_at)
18
- };
19
- };
20
- const unmarshalListProjectsResponse = data => {
21
- if (!isJSONObject(data)) {
22
- throw new TypeError(`Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`);
23
- }
24
- return {
25
- projects: unmarshalArrayOfObject(data.projects, unmarshalProject),
26
- totalCount: data.total_count
27
- };
28
- };
29
- const marshalProjectApiCreateProjectRequest = (request, defaults) => ({
30
- description: request.description,
31
- name: request.name || randomName('proj'),
32
- organization_id: request.organizationId ?? defaults.defaultOrganizationId
33
- });
34
- const marshalProjectApiUpdateProjectRequest = (request, defaults) => ({
35
- description: request.description,
36
- name: request.name
37
- });
38
-
39
- export { marshalProjectApiCreateProjectRequest, marshalProjectApiUpdateProjectRequest, unmarshalListProjectsResponse, unmarshalProject };
@@ -1,39 +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
- const ProjectApiCreateProjectRequest = {
5
- description: {
6
- maxLength: 200
7
- },
8
- name: {
9
- maxLength: 64,
10
- minLength: 1,
11
- pattern: /^[a-zA-Z0-9\._\- ]+$/
12
- }
13
- };
14
- const ProjectApiListProjectsRequest = {
15
- name: {
16
- maxLength: 64,
17
- minLength: 1,
18
- pattern: /^[a-zA-Z0-9\._\- ]+$/
19
- },
20
- page: {
21
- greaterThan: 0
22
- },
23
- pageSize: {
24
- greaterThanOrEqual: 1,
25
- lessThanOrEqual: 100
26
- }
27
- };
28
- const ProjectApiUpdateProjectRequest = {
29
- description: {
30
- maxLength: 200
31
- },
32
- name: {
33
- maxLength: 64,
34
- minLength: 1,
35
- pattern: /^[a-zA-Z0-9\._\- ]+$/
36
- }
37
- };
38
-
39
- export { ProjectApiCreateProjectRequest, ProjectApiListProjectsRequest, ProjectApiUpdateProjectRequest };
@@ -1,2 +0,0 @@
1
- import * as index_gen from './v1alpha1/index.gen.js';
2
- export { index_gen as v1alpha1 };