@scaleway/sdk 1.31.0 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/cockpit/v1beta1/api.gen.js +44 -40
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +18 -1
- package/dist/api/instance/v1/api.gen.js +1 -1
- package/dist/api/ipfs/v1alpha1/api.gen.js +2 -113
- package/dist/api/ipfs/v1alpha1/content.gen.js +1 -4
- package/dist/api/ipfs/v1alpha1/index.gen.js +1 -1
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +1 -55
- package/dist/api/k8s/v1/api.gen.js +1 -1
- package/dist/api/lb/v1/marshalling.gen.js +1 -0
- package/dist/api/secret/v1alpha1/api.gen.js +2 -2
- package/dist/helpers/is-browser.js +3 -1
- package/dist/index.cjs +69 -198
- package/dist/index.d.ts +136 -232
- package/dist/scw/constants.js +1 -1
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@ import { API as API$1 } from '../../../scw/api.js';
|
|
|
3
3
|
import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
|
|
4
4
|
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
5
5
|
import { COCKPIT_TRANSIENT_STATUSES } from './content.gen.js';
|
|
6
|
-
import { marshalActivateCockpitRequest, unmarshalCockpit, unmarshalCockpitMetrics, marshalDeactivateCockpitRequest, marshalResetCockpitGrafanaRequest, marshalCreateTokenRequest, unmarshalToken, unmarshalListTokensResponse, marshalCreateContactPointRequest, unmarshalContactPoint, unmarshalListContactPointsResponse, marshalDeleteContactPointRequest, marshalEnableManagedAlertsRequest, marshalDisableManagedAlertsRequest, marshalTriggerTestAlertRequest, marshalCreateGrafanaUserRequest, unmarshalGrafanaUser, unmarshalListGrafanaUsersResponse, marshalDeleteGrafanaUserRequest, marshalResetGrafanaUserPasswordRequest, unmarshalListPlansResponse, marshalSelectPlanRequest, unmarshalSelectPlanResponse } from './marshalling.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
7
|
|
|
8
8
|
// This file was automatically generated. DO NOT EDIT.
|
|
9
9
|
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
@@ -14,13 +14,13 @@ const jsonContentHeaders = {
|
|
|
14
14
|
/**
|
|
15
15
|
* Cockpit API.
|
|
16
16
|
*
|
|
17
|
-
* Cockpit
|
|
18
|
-
*
|
|
19
|
-
*
|
|
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. Cockpit API.
|
|
20
20
|
*/
|
|
21
21
|
class API extends API$1 {
|
|
22
22
|
/**
|
|
23
|
-
* Activate
|
|
23
|
+
* Activate the Cockpit of the specified Project ID.
|
|
24
24
|
*
|
|
25
25
|
* @param request - The request {@link ActivateCockpitRequest}
|
|
26
26
|
* @returns A Promise of Cockpit
|
|
@@ -41,7 +41,7 @@ class API extends API$1 {
|
|
|
41
41
|
})();
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Retrieve the Cockpit of the specified Project ID.
|
|
45
45
|
*
|
|
46
46
|
* @param request - The request {@link GetCockpitRequest}
|
|
47
47
|
* @returns A Promise of Cockpit
|
|
@@ -78,8 +78,7 @@ class API extends API$1 {
|
|
|
78
78
|
})();
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
|
-
* Get
|
|
82
|
-
* Project ID.
|
|
81
|
+
* Get metrics from your Cockpit with the specified Project ID.
|
|
83
82
|
*
|
|
84
83
|
* @param request - The request {@link GetCockpitMetricsRequest}
|
|
85
84
|
* @returns A Promise of CockpitMetrics
|
|
@@ -99,7 +98,7 @@ class API extends API$1 {
|
|
|
99
98
|
})();
|
|
100
99
|
|
|
101
100
|
/**
|
|
102
|
-
* Deactivate
|
|
101
|
+
* Deactivate the Cockpit of the specified Project ID.
|
|
103
102
|
*
|
|
104
103
|
* @param request - The request {@link DeactivateCockpitRequest}
|
|
105
104
|
* @returns A Promise of Cockpit
|
|
@@ -120,8 +119,7 @@ class API extends API$1 {
|
|
|
120
119
|
})();
|
|
121
120
|
|
|
122
121
|
/**
|
|
123
|
-
* Reset
|
|
124
|
-
* Project ID.
|
|
122
|
+
* Reset your Cockpit's Grafana associated with the specified Project ID.
|
|
125
123
|
*
|
|
126
124
|
* @param request - The request {@link ResetCockpitGrafanaRequest}
|
|
127
125
|
* @returns A Promise of Cockpit
|
|
@@ -142,7 +140,20 @@ class API extends API$1 {
|
|
|
142
140
|
})();
|
|
143
141
|
|
|
144
142
|
/**
|
|
145
|
-
* Create a
|
|
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.
|
|
146
157
|
*
|
|
147
158
|
* @param request - The request {@link CreateTokenRequest}
|
|
148
159
|
* @returns A Promise of Token
|
|
@@ -176,7 +187,7 @@ class API extends API$1 {
|
|
|
176
187
|
})();
|
|
177
188
|
|
|
178
189
|
/**
|
|
179
|
-
*
|
|
190
|
+
* Get a list of tokens associated with the specified Project ID.
|
|
180
191
|
*
|
|
181
192
|
* @param request - The request {@link ListTokensRequest}
|
|
182
193
|
* @returns A Promise of ListTokensResponse
|
|
@@ -192,7 +203,7 @@ class API extends API$1 {
|
|
|
192
203
|
})();
|
|
193
204
|
|
|
194
205
|
/**
|
|
195
|
-
*
|
|
206
|
+
* Retrieve the token associated with the specified token ID.
|
|
196
207
|
*
|
|
197
208
|
* @param request - The request {@link GetTokenRequest}
|
|
198
209
|
* @returns A Promise of Token
|
|
@@ -203,7 +214,7 @@ class API extends API$1 {
|
|
|
203
214
|
}, unmarshalToken);
|
|
204
215
|
|
|
205
216
|
/**
|
|
206
|
-
* Delete
|
|
217
|
+
* Delete the token associated with the specified token ID.
|
|
207
218
|
*
|
|
208
219
|
* @param request - The request {@link DeleteTokenRequest}
|
|
209
220
|
*/
|
|
@@ -213,8 +224,7 @@ class API extends API$1 {
|
|
|
213
224
|
});
|
|
214
225
|
|
|
215
226
|
/**
|
|
216
|
-
* Create a contact point
|
|
217
|
-
* default receiver.
|
|
227
|
+
* Create a contact point to receive alerts for the default receiver.
|
|
218
228
|
*
|
|
219
229
|
* @param request - The request {@link CreateContactPointRequest}
|
|
220
230
|
* @returns A Promise of ContactPoint
|
|
@@ -248,8 +258,8 @@ class API extends API$1 {
|
|
|
248
258
|
})();
|
|
249
259
|
|
|
250
260
|
/**
|
|
251
|
-
*
|
|
252
|
-
*
|
|
261
|
+
* Get a list of contact points for the Cockpit associated with the specified
|
|
262
|
+
* Project ID.
|
|
253
263
|
*
|
|
254
264
|
* @param request - The request {@link ListContactPointsRequest}
|
|
255
265
|
* @returns A Promise of ListContactPointsResponse
|
|
@@ -265,8 +275,7 @@ class API extends API$1 {
|
|
|
265
275
|
})();
|
|
266
276
|
|
|
267
277
|
/**
|
|
268
|
-
* Delete
|
|
269
|
-
* receiver.
|
|
278
|
+
* Delete a contact point for the default receiver.
|
|
270
279
|
*
|
|
271
280
|
* @param request - The request {@link DeleteContactPointRequest}
|
|
272
281
|
*/
|
|
@@ -286,8 +295,7 @@ class API extends API$1 {
|
|
|
286
295
|
})();
|
|
287
296
|
|
|
288
297
|
/**
|
|
289
|
-
* Enable
|
|
290
|
-
* specified Project's Cockpit.
|
|
298
|
+
* Enable the sending of managed alerts for the specified Project's Cockpit.
|
|
291
299
|
*
|
|
292
300
|
* @param request - The request {@link EnableManagedAlertsRequest}
|
|
293
301
|
*/
|
|
@@ -307,8 +315,7 @@ class API extends API$1 {
|
|
|
307
315
|
})();
|
|
308
316
|
|
|
309
317
|
/**
|
|
310
|
-
* Disable
|
|
311
|
-
* specified Project's Cockpit.
|
|
318
|
+
* Disable the sending of managed alerts for the specified Project's Cockpit.
|
|
312
319
|
*
|
|
313
320
|
* @param request - The request {@link DisableManagedAlertsRequest}
|
|
314
321
|
*/
|
|
@@ -328,8 +335,7 @@ class API extends API$1 {
|
|
|
328
335
|
})();
|
|
329
336
|
|
|
330
337
|
/**
|
|
331
|
-
* Trigger a test alert
|
|
332
|
-
* receivers.
|
|
338
|
+
* Trigger a test alert to all of the Cockpit's receivers.
|
|
333
339
|
*
|
|
334
340
|
* @param request - The request {@link TriggerTestAlertRequest}
|
|
335
341
|
*/
|
|
@@ -349,9 +355,8 @@ class API extends API$1 {
|
|
|
349
355
|
})();
|
|
350
356
|
|
|
351
357
|
/**
|
|
352
|
-
* Create a Grafana user
|
|
353
|
-
*
|
|
354
|
-
* Grafana user ID.
|
|
358
|
+
* Create a Grafana user for your Cockpit's Grafana instance. Make sure you
|
|
359
|
+
* save the automatically-generated password and the Grafana user ID.
|
|
355
360
|
*
|
|
356
361
|
* @param request - The request {@link CreateGrafanaUserRequest}
|
|
357
362
|
* @returns A Promise of GrafanaUser
|
|
@@ -377,8 +382,8 @@ class API extends API$1 {
|
|
|
377
382
|
})();
|
|
378
383
|
|
|
379
384
|
/**
|
|
380
|
-
*
|
|
381
|
-
*
|
|
385
|
+
* Get a list of Grafana users who are able to connect to the Cockpit's
|
|
386
|
+
* Grafana instance.
|
|
382
387
|
*
|
|
383
388
|
* @param request - The request {@link ListGrafanaUsersRequest}
|
|
384
389
|
* @returns A Promise of ListGrafanaUsersResponse
|
|
@@ -394,8 +399,8 @@ class API extends API$1 {
|
|
|
394
399
|
})();
|
|
395
400
|
|
|
396
401
|
/**
|
|
397
|
-
* Delete a Grafana user
|
|
398
|
-
*
|
|
402
|
+
* Delete a Grafana user from a Grafana instance, specified by the Cockpit's
|
|
403
|
+
* Project ID and the Grafana user ID.
|
|
399
404
|
*
|
|
400
405
|
* @param request - The request {@link DeleteGrafanaUserRequest}
|
|
401
406
|
*/
|
|
@@ -407,8 +412,8 @@ class API extends API$1 {
|
|
|
407
412
|
});
|
|
408
413
|
|
|
409
414
|
/**
|
|
410
|
-
* Reset a Grafana user's password
|
|
411
|
-
*
|
|
415
|
+
* Reset a Grafana user's password specified by the Cockpit's Project ID and
|
|
416
|
+
* the Grafana user ID.
|
|
412
417
|
*
|
|
413
418
|
* @param request - The request {@link ResetGrafanaUserPasswordRequest}
|
|
414
419
|
* @returns A Promise of GrafanaUser
|
|
@@ -434,7 +439,7 @@ class API extends API$1 {
|
|
|
434
439
|
})();
|
|
435
440
|
|
|
436
441
|
/**
|
|
437
|
-
*
|
|
442
|
+
* Get a list of all pricing plans available.
|
|
438
443
|
*
|
|
439
444
|
* @param request - The request {@link ListPlansRequest}
|
|
440
445
|
* @returns A Promise of ListPlansResponse
|
|
@@ -450,9 +455,8 @@ class API extends API$1 {
|
|
|
450
455
|
})();
|
|
451
456
|
|
|
452
457
|
/**
|
|
453
|
-
* Select
|
|
454
|
-
*
|
|
455
|
-
* request.
|
|
458
|
+
* Select your chosen pricing plan for your Cockpit, specifying the Cockpit's
|
|
459
|
+
* Project ID and the pricing plan's ID in the request.
|
|
456
460
|
*
|
|
457
461
|
* @param request - The request {@link SelectPlanRequest}
|
|
458
462
|
* @returns A Promise of SelectPlanResponse
|
|
@@ -109,6 +109,18 @@ const unmarshalCockpitMetrics = data => {
|
|
|
109
109
|
timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries)
|
|
110
110
|
};
|
|
111
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
|
+
};
|
|
112
124
|
const unmarshalListContactPointsResponse = data => {
|
|
113
125
|
if (!isJSONObject(data)) {
|
|
114
126
|
throw new TypeError(`Unmarshalling the type 'ListContactPointsResponse' failed as data isn't a dictionary.`);
|
|
@@ -180,6 +192,11 @@ const marshalCreateContactPointRequest = (request, defaults) => ({
|
|
|
180
192
|
contact_point: request.contactPoint ? marshalContactPoint(request.contactPoint) : undefined,
|
|
181
193
|
project_id: request.projectId ?? defaults.defaultProjectId
|
|
182
194
|
});
|
|
195
|
+
const marshalCreateDatasourceRequest = (request, defaults) => ({
|
|
196
|
+
name: request.name,
|
|
197
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
198
|
+
type: request.type ?? 'unknown_datasource_type'
|
|
199
|
+
});
|
|
183
200
|
const marshalCreateGrafanaUserRequest = (request, defaults) => ({
|
|
184
201
|
login: request.login,
|
|
185
202
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
@@ -220,4 +237,4 @@ const marshalTriggerTestAlertRequest = (request, defaults) => ({
|
|
|
220
237
|
project_id: request.projectId ?? defaults.defaultProjectId
|
|
221
238
|
});
|
|
222
239
|
|
|
223
|
-
export { marshalActivateCockpitRequest, marshalCreateContactPointRequest, marshalCreateGrafanaUserRequest, marshalCreateTokenRequest, marshalDeactivateCockpitRequest, marshalDeleteContactPointRequest, marshalDeleteGrafanaUserRequest, marshalDisableManagedAlertsRequest, marshalEnableManagedAlertsRequest, marshalResetCockpitGrafanaRequest, marshalResetGrafanaUserPasswordRequest, marshalSelectPlanRequest, marshalTriggerTestAlertRequest, unmarshalCockpit, unmarshalCockpitMetrics, unmarshalContactPoint, unmarshalGrafanaUser, unmarshalListContactPointsResponse, unmarshalListGrafanaUsersResponse, unmarshalListPlansResponse, unmarshalListTokensResponse, unmarshalSelectPlanResponse, unmarshalToken };
|
|
240
|
+
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 };
|
|
@@ -281,7 +281,7 @@ class API extends API$1 {
|
|
|
281
281
|
return _this8.client.fetch({
|
|
282
282
|
method: 'GET',
|
|
283
283
|
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? _this8.client.settings.defaultZone)}/snapshots`,
|
|
284
|
-
urlParams: urlParams(['name', request.name], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? _this8.client.settings.defaultPageSize], ['project', request.project], ['tags', request.tags])
|
|
284
|
+
urlParams: urlParams(['base_volume_id', request.baseVolumeId], ['name', request.name], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? _this8.client.settings.defaultPageSize], ['project', request.project], ['tags', request.tags])
|
|
285
285
|
}, unmarshalListSnapshotsResponse);
|
|
286
286
|
};
|
|
287
287
|
})();
|
|
@@ -2,8 +2,8 @@ import { waitForResource } from '../../../internal/async/interval-retrier.js';
|
|
|
2
2
|
import { API as API$1 } from '../../../scw/api.js';
|
|
3
3
|
import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
|
|
4
4
|
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
5
|
-
import { PIN_TRANSIENT_STATUSES
|
|
6
|
-
import { marshalCreateVolumeRequest, unmarshalVolume, unmarshalListVolumesResponse, marshalUpdateVolumeRequest, marshalCreatePinByURLRequest, unmarshalPin, marshalCreatePinByCIDRequest, marshalReplacePinRequest, unmarshalReplacePinResponse, unmarshalListPinsResponse
|
|
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
7
|
|
|
8
8
|
// This file was automatically generated. DO NOT EDIT.
|
|
9
9
|
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
@@ -192,117 +192,6 @@ class API extends API$1 {
|
|
|
192
192
|
path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins/${validatePathParam('pinId', request.pinId)}`,
|
|
193
193
|
urlParams: urlParams(['volume_id', request.volumeId])
|
|
194
194
|
});
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Create a new name. You can use the `ipfs key` command to list and generate
|
|
198
|
-
* more names and their respective keys.
|
|
199
|
-
*
|
|
200
|
-
* @param request - The request {@link CreateNameRequest}
|
|
201
|
-
* @returns A Promise of Name
|
|
202
|
-
*/
|
|
203
|
-
createName = request => this.client.fetch({
|
|
204
|
-
body: JSON.stringify(marshalCreateNameRequest(request, this.client.settings)),
|
|
205
|
-
headers: jsonContentHeaders,
|
|
206
|
-
method: 'POST',
|
|
207
|
-
path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names`
|
|
208
|
-
}, unmarshalName);
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* Get information about a name. Retrieve information about a specific name.
|
|
212
|
-
*
|
|
213
|
-
* @param request - The request {@link GetNameRequest}
|
|
214
|
-
* @returns A Promise of Name
|
|
215
|
-
*/
|
|
216
|
-
getName = request => this.client.fetch({
|
|
217
|
-
method: 'GET',
|
|
218
|
-
path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}`
|
|
219
|
-
}, unmarshalName);
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Waits for {@link Name} to be in a final state.
|
|
223
|
-
*
|
|
224
|
-
* @param request - The request {@link GetNameRequest}
|
|
225
|
-
* @param options - The waiting options
|
|
226
|
-
* @returns A Promise of Name
|
|
227
|
-
*/
|
|
228
|
-
waitForName = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NAME_TRANSIENT_STATUSES.includes(res.status))), this.getName, request, options);
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Delete an existing name. Delete a name by its ID.
|
|
232
|
-
*
|
|
233
|
-
* @param request - The request {@link DeleteNameRequest}
|
|
234
|
-
*/
|
|
235
|
-
deleteName = request => this.client.fetch({
|
|
236
|
-
method: 'DELETE',
|
|
237
|
-
path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}`
|
|
238
|
-
});
|
|
239
|
-
pageOfListNames = (() => {
|
|
240
|
-
var _this3 = this;
|
|
241
|
-
return function (request) {
|
|
242
|
-
if (request === void 0) {
|
|
243
|
-
request = {};
|
|
244
|
-
}
|
|
245
|
-
return _this3.client.fetch({
|
|
246
|
-
method: 'GET',
|
|
247
|
-
path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/names`,
|
|
248
|
-
urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['project_id', request.projectId])
|
|
249
|
-
}, unmarshalListNamesResponse);
|
|
250
|
-
};
|
|
251
|
-
})();
|
|
252
|
-
|
|
253
|
-
/**
|
|
254
|
-
* List all names by a Project ID. Retrieve information about all names from a
|
|
255
|
-
* Project ID.
|
|
256
|
-
*
|
|
257
|
-
* @param request - The request {@link ListNamesRequest}
|
|
258
|
-
* @returns A Promise of ListNamesResponse
|
|
259
|
-
*/
|
|
260
|
-
listNames = (() => {
|
|
261
|
-
var _this4 = this;
|
|
262
|
-
return function (request) {
|
|
263
|
-
if (request === void 0) {
|
|
264
|
-
request = {};
|
|
265
|
-
}
|
|
266
|
-
return enrichForPagination('names', _this4.pageOfListNames, request);
|
|
267
|
-
};
|
|
268
|
-
})();
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* Update name information. Update name information (CID, tag, name...).
|
|
272
|
-
*
|
|
273
|
-
* @param request - The request {@link UpdateNameRequest}
|
|
274
|
-
* @returns A Promise of Name
|
|
275
|
-
*/
|
|
276
|
-
updateName = request => this.client.fetch({
|
|
277
|
-
body: JSON.stringify(marshalUpdateNameRequest(request, this.client.settings)),
|
|
278
|
-
headers: jsonContentHeaders,
|
|
279
|
-
method: 'PATCH',
|
|
280
|
-
path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}`
|
|
281
|
-
}, unmarshalName);
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* Export your private key. Export a private key by its ID.
|
|
285
|
-
*
|
|
286
|
-
* @param request - The request {@link ExportKeyNameRequest}
|
|
287
|
-
* @returns A Promise of ExportKeyNameResponse
|
|
288
|
-
*/
|
|
289
|
-
exportKeyName = request => this.client.fetch({
|
|
290
|
-
method: 'GET',
|
|
291
|
-
path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/export-key/${validatePathParam('nameId', request.nameId)}`
|
|
292
|
-
}, unmarshalExportKeyNameResponse);
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* Import your private key. Import a private key.
|
|
296
|
-
*
|
|
297
|
-
* @param request - The request {@link ImportKeyNameRequest}
|
|
298
|
-
* @returns A Promise of Name
|
|
299
|
-
*/
|
|
300
|
-
importKeyName = request => this.client.fetch({
|
|
301
|
-
body: JSON.stringify(marshalImportKeyNameRequest(request, this.client.settings)),
|
|
302
|
-
headers: jsonContentHeaders,
|
|
303
|
-
method: 'POST',
|
|
304
|
-
path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/import-key`
|
|
305
|
-
}, unmarshalName);
|
|
306
195
|
}
|
|
307
196
|
|
|
308
197
|
export { API };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
// This file was automatically generated. DO NOT EDIT.
|
|
2
2
|
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
3
3
|
|
|
4
|
-
/** Lists transient statutes of the enum {@link NameStatus}. */
|
|
5
|
-
const NAME_TRANSIENT_STATUSES = ['queued', 'publishing'];
|
|
6
|
-
|
|
7
4
|
/** Lists transient statutes of the enum {@link PinStatus}. */
|
|
8
5
|
const PIN_TRANSIENT_STATUSES = ['queued', 'pinning'];
|
|
9
6
|
|
|
10
|
-
export {
|
|
7
|
+
export { PIN_TRANSIENT_STATUSES };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { API } from './api.gen.js';
|
|
2
|
-
export {
|
|
2
|
+
export { PIN_TRANSIENT_STATUSES } from './content.gen.js';
|
|
3
3
|
|
|
4
4
|
// This file was automatically generated. DO NOT EDIT.
|
|
5
5
|
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
@@ -34,22 +34,6 @@ const unmarshalPinInfo = data => {
|
|
|
34
34
|
url: data.url
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
-
const unmarshalName = data => {
|
|
38
|
-
if (!isJSONObject(data)) {
|
|
39
|
-
throw new TypeError(`Unmarshalling the type 'Name' failed as data isn't a dictionary.`);
|
|
40
|
-
}
|
|
41
|
-
return {
|
|
42
|
-
createdAt: unmarshalDate(data.created_at),
|
|
43
|
-
key: data.key,
|
|
44
|
-
name: data.name,
|
|
45
|
-
nameId: data.name_id,
|
|
46
|
-
projectId: data.project_id,
|
|
47
|
-
status: data.status,
|
|
48
|
-
tags: data.tags,
|
|
49
|
-
updatedAt: unmarshalDate(data.updated_at),
|
|
50
|
-
value: data.value
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
37
|
const unmarshalPin = data => {
|
|
54
38
|
if (!isJSONObject(data)) {
|
|
55
39
|
throw new TypeError(`Unmarshalling the type 'Pin' failed as data isn't a dictionary.`);
|
|
@@ -79,28 +63,6 @@ const unmarshalVolume = data => {
|
|
|
79
63
|
updatedAt: unmarshalDate(data.updated_at)
|
|
80
64
|
};
|
|
81
65
|
};
|
|
82
|
-
const unmarshalExportKeyNameResponse = data => {
|
|
83
|
-
if (!isJSONObject(data)) {
|
|
84
|
-
throw new TypeError(`Unmarshalling the type 'ExportKeyNameResponse' failed as data isn't a dictionary.`);
|
|
85
|
-
}
|
|
86
|
-
return {
|
|
87
|
-
createdAt: unmarshalDate(data.created_at),
|
|
88
|
-
nameId: data.name_id,
|
|
89
|
-
privateKey: data.private_key,
|
|
90
|
-
projectId: data.project_id,
|
|
91
|
-
publicKey: data.public_key,
|
|
92
|
-
updatedAt: unmarshalDate(data.updated_at)
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
const unmarshalListNamesResponse = data => {
|
|
96
|
-
if (!isJSONObject(data)) {
|
|
97
|
-
throw new TypeError(`Unmarshalling the type 'ListNamesResponse' failed as data isn't a dictionary.`);
|
|
98
|
-
}
|
|
99
|
-
return {
|
|
100
|
-
names: unmarshalArrayOfObject(data.names, unmarshalName),
|
|
101
|
-
totalCount: data.total_count
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
66
|
const unmarshalListPinsResponse = data => {
|
|
105
67
|
if (!isJSONObject(data)) {
|
|
106
68
|
throw new TypeError(`Unmarshalling the type 'ListPinsResponse' failed as data isn't a dictionary.`);
|
|
@@ -131,11 +93,6 @@ const marshalPinOptions = (request, defaults) => ({
|
|
|
131
93
|
replication_count: request.replicationCount,
|
|
132
94
|
required_zones: request.requiredZones
|
|
133
95
|
});
|
|
134
|
-
const marshalCreateNameRequest = (request, defaults) => ({
|
|
135
|
-
name: request.name,
|
|
136
|
-
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
137
|
-
value: request.value
|
|
138
|
-
});
|
|
139
96
|
const marshalCreatePinByCIDRequest = (request, defaults) => ({
|
|
140
97
|
cid: request.cid,
|
|
141
98
|
name: request.name,
|
|
@@ -153,12 +110,6 @@ const marshalCreateVolumeRequest = (request, defaults) => ({
|
|
|
153
110
|
name: request.name,
|
|
154
111
|
project_id: request.projectId ?? defaults.defaultProjectId
|
|
155
112
|
});
|
|
156
|
-
const marshalImportKeyNameRequest = (request, defaults) => ({
|
|
157
|
-
name: request.name,
|
|
158
|
-
private_key: request.privateKey,
|
|
159
|
-
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
160
|
-
value: request.value
|
|
161
|
-
});
|
|
162
113
|
const marshalReplacePinRequest = (request, defaults) => ({
|
|
163
114
|
cid: request.cid,
|
|
164
115
|
name: request.name,
|
|
@@ -166,14 +117,9 @@ const marshalReplacePinRequest = (request, defaults) => ({
|
|
|
166
117
|
pin_options: request.pinOptions ? marshalPinOptions(request.pinOptions) : undefined,
|
|
167
118
|
volume_id: request.volumeId
|
|
168
119
|
});
|
|
169
|
-
const marshalUpdateNameRequest = (request, defaults) => ({
|
|
170
|
-
name: request.name,
|
|
171
|
-
tags: request.tags,
|
|
172
|
-
value: request.value
|
|
173
|
-
});
|
|
174
120
|
const marshalUpdateVolumeRequest = (request, defaults) => ({
|
|
175
121
|
name: request.name,
|
|
176
122
|
tags: request.tags
|
|
177
123
|
});
|
|
178
124
|
|
|
179
|
-
export {
|
|
125
|
+
export { marshalCreatePinByCIDRequest, marshalCreatePinByURLRequest, marshalCreateVolumeRequest, marshalReplacePinRequest, marshalUpdateVolumeRequest, unmarshalListPinsResponse, unmarshalListVolumesResponse, unmarshalPin, unmarshalReplacePinResponse, unmarshalVolume };
|
|
@@ -24,7 +24,7 @@ class API extends API$1 {
|
|
|
24
24
|
return _this.client.fetch({
|
|
25
25
|
method: 'GET',
|
|
26
26
|
path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/clusters`,
|
|
27
|
-
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['status', request.status ?? 'unknown'], ['type', request.type])
|
|
27
|
+
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId], ['status', request.status ?? 'unknown'], ['type', request.type])
|
|
28
28
|
}, unmarshalListClustersResponse);
|
|
29
29
|
};
|
|
30
30
|
})();
|
|
@@ -345,6 +345,7 @@ const unmarshalPrivateNetwork = data => {
|
|
|
345
345
|
createdAt: unmarshalDate(data.created_at),
|
|
346
346
|
dhcpConfig: data.dhcp_config ? unmarshalPrivateNetworkDHCPConfig(data.dhcp_config) : undefined,
|
|
347
347
|
ipamConfig: data.ipam_config ? unmarshalPrivateNetworkIpamConfig(data.ipam_config) : undefined,
|
|
348
|
+
ipamIds: data.ipam_ids,
|
|
348
349
|
lb: data.lb ? unmarshalLb(data.lb) : undefined,
|
|
349
350
|
privateNetworkId: data.private_network_id,
|
|
350
351
|
staticConfig: data.static_config ? unmarshalPrivateNetworkStaticConfig(data.static_config) : undefined,
|
|
@@ -130,13 +130,13 @@ class API extends API$1 {
|
|
|
130
130
|
return _this3.client.fetch({
|
|
131
131
|
method: 'GET',
|
|
132
132
|
path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/folders`,
|
|
133
|
-
urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId
|
|
133
|
+
urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId])
|
|
134
134
|
}, unmarshalListFoldersResponse);
|
|
135
135
|
};
|
|
136
136
|
})();
|
|
137
137
|
|
|
138
138
|
/**
|
|
139
|
-
* List
|
|
139
|
+
* List folders. Retrieve the list of folders created within a Project.
|
|
140
140
|
*
|
|
141
141
|
* @param request - The request {@link ListFoldersRequest}
|
|
142
142
|
* @returns A Promise of ListFoldersResponse
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
const isBrowser = () =>
|
|
1
|
+
const isBrowser = () =>
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
|
|
3
|
+
typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
2
4
|
|
|
3
5
|
export { isBrowser };
|