@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,388 +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, resolveOneOf } 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 unmarshalDeviceMessageFiltersRule = data => {
9
- if (!isJSONObject(data)) {
10
- throw new TypeError(`Unmarshalling the type 'DeviceMessageFiltersRule' failed as data isn't a dictionary.`);
11
- }
12
- return {
13
- policy: data.policy,
14
- topics: data.topics ? data.topics : undefined
15
- };
16
- };
17
- const unmarshalDeviceMessageFilters = data => {
18
- if (!isJSONObject(data)) {
19
- throw new TypeError(`Unmarshalling the type 'DeviceMessageFilters' failed as data isn't a dictionary.`);
20
- }
21
- return {
22
- publish: unmarshalDeviceMessageFiltersRule(data.publish),
23
- subscribe: unmarshalDeviceMessageFiltersRule(data.subscribe)
24
- };
25
- };
26
- const unmarshalDevice = data => {
27
- if (!isJSONObject(data)) {
28
- throw new TypeError(`Unmarshalling the type 'Device' failed as data isn't a dictionary.`);
29
- }
30
- return {
31
- allowInsecure: data.allow_insecure,
32
- allowMultipleConnections: data.allow_multiple_connections,
33
- createdAt: unmarshalDate(data.created_at),
34
- description: data.description,
35
- hasCustomCertificate: data.has_custom_certificate,
36
- hubId: data.hub_id,
37
- id: data.id,
38
- isConnected: data.is_connected,
39
- lastActivityAt: unmarshalDate(data.last_activity_at),
40
- messageFilters: unmarshalDeviceMessageFilters(data.message_filters),
41
- name: data.name,
42
- status: data.status,
43
- updatedAt: unmarshalDate(data.updated_at)
44
- };
45
- };
46
- const unmarshalNetwork = data => {
47
- if (!isJSONObject(data)) {
48
- throw new TypeError(`Unmarshalling the type 'Network' failed as data isn't a dictionary.`);
49
- }
50
- return {
51
- createdAt: unmarshalDate(data.created_at),
52
- endpoint: data.endpoint,
53
- hubId: data.hub_id,
54
- id: data.id,
55
- name: data.name,
56
- topicPrefix: data.topic_prefix,
57
- type: data.type
58
- };
59
- };
60
- const unmarshalHubTwinsGraphiteConfig = data => {
61
- if (!isJSONObject(data)) {
62
- throw new TypeError(`Unmarshalling the type 'HubTwinsGraphiteConfig' failed as data isn't a dictionary.`);
63
- }
64
- return {
65
- pushUri: data.push_uri
66
- };
67
- };
68
- const unmarshalHub = data => {
69
- if (!isJSONObject(data)) {
70
- throw new TypeError(`Unmarshalling the type 'Hub' failed as data isn't a dictionary.`);
71
- }
72
- return {
73
- connectedDeviceCount: data.connected_device_count,
74
- createdAt: unmarshalDate(data.created_at),
75
- deviceCount: data.device_count,
76
- disableEvents: data.disable_events,
77
- enableDeviceAutoProvisioning: data.enable_device_auto_provisioning,
78
- enabled: data.enabled,
79
- endpoint: data.endpoint,
80
- eventsTopicPrefix: data.events_topic_prefix,
81
- hasCustomCa: data.has_custom_ca,
82
- id: data.id,
83
- name: data.name,
84
- organizationId: data.organization_id,
85
- productPlan: data.product_plan,
86
- projectId: data.project_id,
87
- region: data.region,
88
- status: data.status,
89
- twinsGraphiteConfig: data.twins_graphite_config ? unmarshalHubTwinsGraphiteConfig(data.twins_graphite_config) : undefined,
90
- updatedAt: unmarshalDate(data.updated_at)
91
- };
92
- };
93
- const unmarshalCertificate = data => {
94
- if (!isJSONObject(data)) {
95
- throw new TypeError(`Unmarshalling the type 'Certificate' failed as data isn't a dictionary.`);
96
- }
97
- return {
98
- crt: data.crt,
99
- key: data.key
100
- };
101
- };
102
- const unmarshalCreateDeviceResponse = data => {
103
- if (!isJSONObject(data)) {
104
- throw new TypeError(`Unmarshalling the type 'CreateDeviceResponse' failed as data isn't a dictionary.`);
105
- }
106
- return {
107
- certificate: unmarshalCertificate(data.certificate),
108
- device: unmarshalDevice(data.device)
109
- };
110
- };
111
- const unmarshalCreateNetworkResponse = data => {
112
- if (!isJSONObject(data)) {
113
- throw new TypeError(`Unmarshalling the type 'CreateNetworkResponse' failed as data isn't a dictionary.`);
114
- }
115
- return {
116
- network: unmarshalNetwork(data.network),
117
- secret: data.secret
118
- };
119
- };
120
- const unmarshalGetDeviceCertificateResponse = data => {
121
- if (!isJSONObject(data)) {
122
- throw new TypeError(`Unmarshalling the type 'GetDeviceCertificateResponse' failed as data isn't a dictionary.`);
123
- }
124
- return {
125
- certificatePem: data.certificate_pem,
126
- device: unmarshalDevice(data.device)
127
- };
128
- };
129
- const unmarshalGetDeviceMetricsResponse = data => {
130
- if (!isJSONObject(data)) {
131
- throw new TypeError(`Unmarshalling the type 'GetDeviceMetricsResponse' failed as data isn't a dictionary.`);
132
- }
133
- return {
134
- metrics: unmarshalArrayOfObject(data.metrics, unmarshalTimeSeries)
135
- };
136
- };
137
- const unmarshalGetHubCAResponse = data => {
138
- if (!isJSONObject(data)) {
139
- throw new TypeError(`Unmarshalling the type 'GetHubCAResponse' failed as data isn't a dictionary.`);
140
- }
141
- return {
142
- caCertPem: data.ca_cert_pem
143
- };
144
- };
145
- const unmarshalGetHubMetricsResponse = data => {
146
- if (!isJSONObject(data)) {
147
- throw new TypeError(`Unmarshalling the type 'GetHubMetricsResponse' failed as data isn't a dictionary.`);
148
- }
149
- return {
150
- metrics: unmarshalArrayOfObject(data.metrics, unmarshalTimeSeries)
151
- };
152
- };
153
- const unmarshalListDevicesResponse = data => {
154
- if (!isJSONObject(data)) {
155
- throw new TypeError(`Unmarshalling the type 'ListDevicesResponse' failed as data isn't a dictionary.`);
156
- }
157
- return {
158
- devices: unmarshalArrayOfObject(data.devices, unmarshalDevice),
159
- totalCount: data.total_count
160
- };
161
- };
162
- const unmarshalListHubsResponse = data => {
163
- if (!isJSONObject(data)) {
164
- throw new TypeError(`Unmarshalling the type 'ListHubsResponse' failed as data isn't a dictionary.`);
165
- }
166
- return {
167
- hubs: unmarshalArrayOfObject(data.hubs, unmarshalHub),
168
- totalCount: data.total_count
169
- };
170
- };
171
- const unmarshalListNetworksResponse = data => {
172
- if (!isJSONObject(data)) {
173
- throw new TypeError(`Unmarshalling the type 'ListNetworksResponse' failed as data isn't a dictionary.`);
174
- }
175
- return {
176
- networks: unmarshalArrayOfObject(data.networks, unmarshalNetwork),
177
- totalCount: data.total_count
178
- };
179
- };
180
- const unmarshalRouteSummary = data => {
181
- if (!isJSONObject(data)) {
182
- throw new TypeError(`Unmarshalling the type 'RouteSummary' failed as data isn't a dictionary.`);
183
- }
184
- return {
185
- createdAt: unmarshalDate(data.created_at),
186
- hubId: data.hub_id,
187
- id: data.id,
188
- name: data.name,
189
- topic: data.topic,
190
- type: data.type,
191
- updatedAt: unmarshalDate(data.updated_at)
192
- };
193
- };
194
- const unmarshalListRoutesResponse = data => {
195
- if (!isJSONObject(data)) {
196
- throw new TypeError(`Unmarshalling the type 'ListRoutesResponse' failed as data isn't a dictionary.`);
197
- }
198
- return {
199
- routes: unmarshalArrayOfObject(data.routes, unmarshalRouteSummary),
200
- totalCount: data.total_count
201
- };
202
- };
203
- const unmarshalListTwinDocumentsResponseDocumentSummary = data => {
204
- if (!isJSONObject(data)) {
205
- throw new TypeError(`Unmarshalling the type 'ListTwinDocumentsResponseDocumentSummary' failed as data isn't a dictionary.`);
206
- }
207
- return {
208
- documentName: data.document_name
209
- };
210
- };
211
- const unmarshalListTwinDocumentsResponse = data => {
212
- if (!isJSONObject(data)) {
213
- throw new TypeError(`Unmarshalling the type 'ListTwinDocumentsResponse' failed as data isn't a dictionary.`);
214
- }
215
- return {
216
- documents: unmarshalArrayOfObject(data.documents, unmarshalListTwinDocumentsResponseDocumentSummary)
217
- };
218
- };
219
- const unmarshalRenewDeviceCertificateResponse = data => {
220
- if (!isJSONObject(data)) {
221
- throw new TypeError(`Unmarshalling the type 'RenewDeviceCertificateResponse' failed as data isn't a dictionary.`);
222
- }
223
- return {
224
- certificate: unmarshalCertificate(data.certificate),
225
- device: unmarshalDevice(data.device)
226
- };
227
- };
228
- const unmarshalRouteRestConfig = data => {
229
- if (!isJSONObject(data)) {
230
- throw new TypeError(`Unmarshalling the type 'RouteRestConfig' failed as data isn't a dictionary.`);
231
- }
232
- return {
233
- headers: data.headers,
234
- uri: data.uri,
235
- verb: data.verb
236
- };
237
- };
238
- const unmarshalRouteDatabaseConfig = data => {
239
- if (!isJSONObject(data)) {
240
- throw new TypeError(`Unmarshalling the type 'RouteDatabaseConfig' failed as data isn't a dictionary.`);
241
- }
242
- return {
243
- dbname: data.dbname,
244
- engine: data.engine,
245
- host: data.host,
246
- password: data.password,
247
- port: data.port,
248
- query: data.query,
249
- username: data.username
250
- };
251
- };
252
- const unmarshalRouteS3Config = data => {
253
- if (!isJSONObject(data)) {
254
- throw new TypeError(`Unmarshalling the type 'RouteS3Config' failed as data isn't a dictionary.`);
255
- }
256
- return {
257
- bucketName: data.bucket_name,
258
- bucketRegion: data.bucket_region,
259
- objectPrefix: data.object_prefix,
260
- strategy: data.strategy
261
- };
262
- };
263
- const unmarshalRoute = data => {
264
- if (!isJSONObject(data)) {
265
- throw new TypeError(`Unmarshalling the type 'Route' failed as data isn't a dictionary.`);
266
- }
267
- return {
268
- createdAt: unmarshalDate(data.created_at),
269
- dbConfig: data.db_config ? unmarshalRouteDatabaseConfig(data.db_config) : undefined,
270
- hubId: data.hub_id,
271
- id: data.id,
272
- name: data.name,
273
- restConfig: data.rest_config ? unmarshalRouteRestConfig(data.rest_config) : undefined,
274
- s3Config: data.s3_config ? unmarshalRouteS3Config(data.s3_config) : undefined,
275
- topic: data.topic,
276
- type: data.type,
277
- updatedAt: unmarshalDate(data.updated_at)
278
- };
279
- };
280
- const unmarshalSetDeviceCertificateResponse = data => {
281
- if (!isJSONObject(data)) {
282
- throw new TypeError(`Unmarshalling the type 'SetDeviceCertificateResponse' failed as data isn't a dictionary.`);
283
- }
284
- return {
285
- certificatePem: data.certificate_pem,
286
- device: unmarshalDevice(data.device)
287
- };
288
- };
289
- const unmarshalTwinDocument = data => {
290
- if (!isJSONObject(data)) {
291
- throw new TypeError(`Unmarshalling the type 'TwinDocument' failed as data isn't a dictionary.`);
292
- }
293
- return {
294
- data: data.data ? data.data : undefined,
295
- documentName: data.document_name,
296
- twinId: data.twin_id,
297
- version: data.version
298
- };
299
- };
300
- const marshalCreateDeviceRequest = (request, defaults) => ({
301
- allow_insecure: request.allowInsecure,
302
- allow_multiple_connections: request.allowMultipleConnections,
303
- description: request.description,
304
- hub_id: request.hubId,
305
- message_filters: request.messageFilters,
306
- name: request.name || randomName('device')
307
- });
308
- const marshalCreateHubRequest = (request, defaults) => ({
309
- disable_events: request.disableEvents,
310
- events_topic_prefix: request.eventsTopicPrefix,
311
- name: request.name || randomName('hub'),
312
- product_plan: request.productPlan,
313
- project_id: request.projectId ?? defaults.defaultProjectId,
314
- ...resolveOneOf([{
315
- param: 'twins_graphite_config',
316
- value: request.twinsGraphiteConfig
317
- }])
318
- });
319
- const marshalCreateNetworkRequest = (request, defaults) => ({
320
- hub_id: request.hubId,
321
- name: request.name || randomName('network'),
322
- topic_prefix: request.topicPrefix,
323
- type: request.type
324
- });
325
- const marshalCreateRouteRequest = (request, defaults) => ({
326
- hub_id: request.hubId,
327
- name: request.name || randomName('route'),
328
- topic: request.topic,
329
- ...resolveOneOf([{
330
- param: 'db_config',
331
- value: request.dbConfig
332
- }, {
333
- param: 'rest_config',
334
- value: request.restConfig
335
- }, {
336
- param: 's3_config',
337
- value: request.s3Config
338
- }])
339
- });
340
- const marshalPatchTwinDocumentRequest = (request, defaults) => ({
341
- data: request.data,
342
- version: request.version
343
- });
344
- const marshalPutTwinDocumentRequest = (request, defaults) => ({
345
- data: request.data,
346
- version: request.version
347
- });
348
- const marshalSetDeviceCertificateRequest = (request, defaults) => ({
349
- certificate_pem: request.certificatePem
350
- });
351
- const marshalSetHubCARequest = (request, defaults) => ({
352
- ca_cert_pem: request.caCertPem,
353
- challenge_cert_pem: request.challengeCertPem
354
- });
355
- const marshalUpdateDeviceRequest = (request, defaults) => ({
356
- allow_insecure: request.allowInsecure,
357
- allow_multiple_connections: request.allowMultipleConnections,
358
- description: request.description,
359
- hub_id: request.hubId,
360
- message_filters: request.messageFilters
361
- });
362
- const marshalUpdateHubRequest = (request, defaults) => ({
363
- disable_events: request.disableEvents,
364
- enable_device_auto_provisioning: request.enableDeviceAutoProvisioning,
365
- events_topic_prefix: request.eventsTopicPrefix,
366
- name: request.name,
367
- product_plan: request.productPlan,
368
- ...resolveOneOf([{
369
- param: 'twins_graphite_config',
370
- value: request.twinsGraphiteConfig
371
- }])
372
- });
373
- const marshalUpdateRouteRequest = (request, defaults) => ({
374
- name: request.name,
375
- topic: request.topic,
376
- ...resolveOneOf([{
377
- param: 'db_config',
378
- value: request.dbConfig
379
- }, {
380
- param: 'rest_config',
381
- value: request.restConfig
382
- }, {
383
- param: 's3_config',
384
- value: request.s3Config
385
- }])
386
- });
387
-
388
- export { marshalCreateDeviceRequest, marshalCreateHubRequest, marshalCreateNetworkRequest, marshalCreateRouteRequest, marshalPatchTwinDocumentRequest, marshalPutTwinDocumentRequest, marshalSetDeviceCertificateRequest, marshalSetHubCARequest, marshalUpdateDeviceRequest, marshalUpdateHubRequest, marshalUpdateRouteRequest, unmarshalCreateDeviceResponse, unmarshalCreateNetworkResponse, unmarshalDevice, unmarshalGetDeviceCertificateResponse, unmarshalGetDeviceMetricsResponse, unmarshalGetHubCAResponse, unmarshalGetHubMetricsResponse, unmarshalHub, unmarshalListDevicesResponse, unmarshalListHubsResponse, unmarshalListNetworksResponse, unmarshalListRoutesResponse, unmarshalListTwinDocumentsResponse, unmarshalNetwork, unmarshalRenewDeviceCertificateResponse, unmarshalRoute, unmarshalSetDeviceCertificateResponse, unmarshalTwinDocument };
@@ -1,2 +0,0 @@
1
- import * as index_gen from './v1alpha1/index.gen.js';
2
- export { index_gen as v1alpha1 };
@@ -1,197 +0,0 @@
1
- import { waitForResource } from '../../../internal/async/interval-retrier.js';
2
- import { API as API$1 } from '../../../scw/api.js';
3
- import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
4
- import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
- import { PIN_TRANSIENT_STATUSES } from './content.gen.js';
6
- import { marshalCreateVolumeRequest, unmarshalVolume, unmarshalListVolumesResponse, marshalUpdateVolumeRequest, marshalCreatePinByURLRequest, unmarshalPin, marshalCreatePinByCIDRequest, marshalReplacePinRequest, unmarshalReplacePinResponse, unmarshalListPinsResponse } 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
- /** IPFS Pinning service API. */
15
- class API extends API$1 {
16
- /** Lists the available regions of the API. */
17
- static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
18
-
19
- /**
20
- * Create a new volume. Create a new volume from a Project ID. Volume is
21
- * identified by an ID and used to host pin references. Volume is personal (at
22
- * least to your organization) even if IPFS blocks and CID are available to
23
- * anyone. Should be the first command you made because every pin must be
24
- * attached to a volume.
25
- *
26
- * @param request - The request {@link CreateVolumeRequest}
27
- * @returns A Promise of Volume
28
- */
29
- createVolume = request => this.client.fetch({
30
- body: JSON.stringify(marshalCreateVolumeRequest(request, this.client.settings)),
31
- headers: jsonContentHeaders,
32
- method: 'POST',
33
- path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/volumes`
34
- }, unmarshalVolume);
35
-
36
- /**
37
- * Get information about a volume. Retrieve information about a specific
38
- * volume.
39
- *
40
- * @param request - The request {@link GetVolumeRequest}
41
- * @returns A Promise of Volume
42
- */
43
- getVolume = request => this.client.fetch({
44
- method: 'GET',
45
- path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/volumes/${validatePathParam('volumeId', request.volumeId)}`
46
- }, unmarshalVolume);
47
- pageOfListVolumes = (() => {
48
- var _this = this;
49
- return function (request) {
50
- if (request === void 0) {
51
- request = {};
52
- }
53
- return _this.client.fetch({
54
- method: 'GET',
55
- path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/volumes`,
56
- urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId])
57
- }, unmarshalListVolumesResponse);
58
- };
59
- })();
60
-
61
- /**
62
- * List all volumes by a Project ID. Retrieve information about all volumes
63
- * from a Project ID.
64
- *
65
- * @param request - The request {@link ListVolumesRequest}
66
- * @returns A Promise of ListVolumesResponse
67
- */
68
- listVolumes = (() => {
69
- var _this2 = this;
70
- return function (request) {
71
- if (request === void 0) {
72
- request = {};
73
- }
74
- return enrichForPagination('volumes', _this2.pageOfListVolumes, request);
75
- };
76
- })();
77
-
78
- /**
79
- * Update volume information. Update volume information (tag, name...).
80
- *
81
- * @param request - The request {@link UpdateVolumeRequest}
82
- * @returns A Promise of Volume
83
- */
84
- updateVolume = request => this.client.fetch({
85
- body: JSON.stringify(marshalUpdateVolumeRequest(request, this.client.settings)),
86
- headers: jsonContentHeaders,
87
- method: 'PATCH',
88
- path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/volumes/${validatePathParam('volumeId', request.volumeId)}`
89
- }, unmarshalVolume);
90
-
91
- /**
92
- * Delete an existing volume. Delete a volume by its ID and every pin attached
93
- * to this volume. This process can take a while to conclude, depending on the
94
- * size of your pinned content.
95
- *
96
- * @param request - The request {@link DeleteVolumeRequest}
97
- */
98
- deleteVolume = request => this.client.fetch({
99
- method: 'DELETE',
100
- path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/volumes/${validatePathParam('volumeId', request.volumeId)}`
101
- });
102
-
103
- /**
104
- * Create a pin by URL. Will fetch and store the content pointed by the
105
- * provided URL. The content must be available on the public IPFS network. The
106
- * content (IPFS blocks) will be host by the pinning service until pin
107
- * deletion. From that point, any other IPFS peer can fetch and host your
108
- * content: Make sure to pin public or encrypted content. Many pin requests
109
- * (from different users) can target the same CID. A pin is defined by its ID
110
- * (UUID), its status (queued, pinning, pinned or failed) and target CID.
111
- *
112
- * @param request - The request {@link CreatePinByURLRequest}
113
- * @returns A Promise of Pin
114
- */
115
- createPinByURL = request => this.client.fetch({
116
- body: JSON.stringify(marshalCreatePinByURLRequest(request, this.client.settings)),
117
- headers: jsonContentHeaders,
118
- method: 'POST',
119
- path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins/create-by-url`
120
- }, unmarshalPin);
121
-
122
- /**
123
- * Create a pin by CID. Will fetch and store the content pointed by the
124
- * provided CID. The content must be available on the public IPFS network. The
125
- * content (IPFS blocks) will be host by the pinning service until pin
126
- * deletion. From that point, any other IPFS peer can fetch and host your
127
- * content: Make sure to pin public or encrypted content. Many pin requests
128
- * (from different users) can target the same CID. A pin is defined by its ID
129
- * (UUID), its status (queued, pinning, pinned or failed) and target CID.
130
- *
131
- * @param request - The request {@link CreatePinByCIDRequest}
132
- * @returns A Promise of Pin
133
- */
134
- createPinByCID = request => this.client.fetch({
135
- body: JSON.stringify(marshalCreatePinByCIDRequest(request, this.client.settings)),
136
- headers: jsonContentHeaders,
137
- method: 'POST',
138
- path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins/create-by-cid`
139
- }, unmarshalPin);
140
- replacePin = request => this.client.fetch({
141
- body: JSON.stringify(marshalReplacePinRequest(request, this.client.settings)),
142
- headers: jsonContentHeaders,
143
- method: 'POST',
144
- path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins/${validatePathParam('pinId', request.pinId)}/replace`
145
- }, unmarshalReplacePinResponse);
146
-
147
- /**
148
- * Get pin information. Retrieve information about the provided **pin ID**,
149
- * such as status, last modification, and CID.
150
- *
151
- * @param request - The request {@link GetPinRequest}
152
- * @returns A Promise of Pin
153
- */
154
- getPin = request => this.client.fetch({
155
- method: 'GET',
156
- path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins/${validatePathParam('pinId', request.pinId)}`,
157
- urlParams: urlParams(['volume_id', request.volumeId])
158
- }, unmarshalPin);
159
-
160
- /**
161
- * Waits for {@link Pin} to be in a final state.
162
- *
163
- * @param request - The request {@link GetPinRequest}
164
- * @param options - The waiting options
165
- * @returns A Promise of Pin
166
- */
167
- waitForPin = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!PIN_TRANSIENT_STATUSES.includes(res.status))), this.getPin, request, options);
168
- pageOfListPins = request => this.client.fetch({
169
- method: 'GET',
170
- path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins`,
171
- urlParams: urlParams(['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['status', request.status], ['volume_id', request.volumeId])
172
- }, unmarshalListPinsResponse);
173
-
174
- /**
175
- * List all pins within a volume. Retrieve information about all pins within a
176
- * volume.
177
- *
178
- * @param request - The request {@link ListPinsRequest}
179
- * @returns A Promise of ListPinsResponse
180
- */
181
- listPins = request => enrichForPagination('pins', this.pageOfListPins, request);
182
-
183
- /**
184
- * Create an unpin request. An unpin request means that you no longer own the
185
- * content. This content can therefore be removed and no longer provided on
186
- * the IPFS network.
187
- *
188
- * @param request - The request {@link DeletePinRequest}
189
- */
190
- deletePin = request => this.client.fetch({
191
- method: 'DELETE',
192
- path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins/${validatePathParam('pinId', request.pinId)}`,
193
- urlParams: urlParams(['volume_id', request.volumeId])
194
- });
195
- }
196
-
197
- 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 PinStatus}. */
5
- const PIN_TRANSIENT_STATUSES = ['queued', 'pinning'];
6
-
7
- export { PIN_TRANSIENT_STATUSES };
@@ -1,5 +0,0 @@
1
- export { API } from './api.gen.js';
2
- export { PIN_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.