@scaleway/sdk 1.35.0 → 1.37.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/block/v1alpha1/api.gen.js +7 -1
- package/dist/api/block/v1alpha1/marshalling.gen.js +8 -1
- package/dist/api/block/v1alpha1/validation-rules.gen.js +6 -1
- package/dist/api/cockpit/v1beta1/api.gen.js +43 -1
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +22 -1
- package/dist/api/container/v1beta1/marshalling.gen.js +1 -0
- package/dist/api/function/v1beta1/marshalling.gen.js +1 -0
- package/dist/api/instance/v1/marshalling.gen.js +6 -4
- package/dist/api/ipfs/v1alpha1/api.gen.js +120 -3
- package/dist/api/ipfs/v1alpha1/content.gen.js +4 -1
- package/dist/api/ipfs/v1alpha1/index.gen.js +2 -2
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +56 -1
- package/dist/api/mnq/index.js +2 -0
- package/dist/api/mnq/v1beta1/api.gen.js +516 -0
- package/dist/api/mnq/v1beta1/index.gen.js +6 -0
- package/dist/api/mnq/v1beta1/marshalling.gen.js +212 -0
- package/dist/api/mnq/v1beta1/validation-rules.gen.js +47 -0
- package/dist/api/rdb/v1/marshalling.gen.js +2 -0
- package/dist/index.cjs +1249 -350
- package/dist/index.d.ts +1803 -682
- 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 { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
|
|
4
4
|
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
5
5
|
import { VOLUME_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES } from './content.gen.js';
|
|
6
|
-
import { unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, marshalCreateVolumeRequest, unmarshalVolume, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalSnapshot, marshalCreateSnapshotRequest, marshalUpdateSnapshotRequest } from './marshalling.gen.js';
|
|
6
|
+
import { unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, marshalCreateVolumeRequest, unmarshalVolume, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalSnapshot, marshalCreateSnapshotRequest, marshalImportSnapshotFromS3Request, marshalUpdateSnapshotRequest } 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.
|
|
@@ -215,6 +215,12 @@ class API extends API$1 {
|
|
|
215
215
|
method: 'POST',
|
|
216
216
|
path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots`
|
|
217
217
|
}, unmarshalSnapshot);
|
|
218
|
+
importSnapshotFromS3 = request => this.client.fetch({
|
|
219
|
+
body: JSON.stringify(marshalImportSnapshotFromS3Request(request, this.client.settings)),
|
|
220
|
+
headers: jsonContentHeaders,
|
|
221
|
+
method: 'POST',
|
|
222
|
+
path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/import-from-s3`
|
|
223
|
+
}, unmarshalSnapshot);
|
|
218
224
|
|
|
219
225
|
/**
|
|
220
226
|
* Delete a snapshot. You must specify the `snapshot_id` of the snapshot you
|
|
@@ -161,6 +161,13 @@ const marshalCreateVolumeRequest = (request, defaults) => ({
|
|
|
161
161
|
value: request.perfIops
|
|
162
162
|
}], true)
|
|
163
163
|
});
|
|
164
|
+
const marshalImportSnapshotFromS3Request = (request, defaults) => ({
|
|
165
|
+
bucket: request.bucket,
|
|
166
|
+
key: request.key,
|
|
167
|
+
name: request.name,
|
|
168
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
169
|
+
tags: request.tags
|
|
170
|
+
});
|
|
164
171
|
const marshalUpdateSnapshotRequest = (request, defaults) => ({
|
|
165
172
|
name: request.name,
|
|
166
173
|
tags: request.tags
|
|
@@ -172,4 +179,4 @@ const marshalUpdateVolumeRequest = (request, defaults) => ({
|
|
|
172
179
|
tags: request.tags
|
|
173
180
|
});
|
|
174
181
|
|
|
175
|
-
export { marshalCreateSnapshotRequest, marshalCreateVolumeRequest, marshalUpdateSnapshotRequest, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, unmarshalSnapshot, unmarshalVolume };
|
|
182
|
+
export { marshalCreateSnapshotRequest, marshalCreateVolumeRequest, marshalImportSnapshotFromS3Request, marshalUpdateSnapshotRequest, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, unmarshalSnapshot, unmarshalVolume };
|
|
@@ -11,6 +11,11 @@ const CreateVolumeRequest = {
|
|
|
11
11
|
minLength: 1
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
|
+
const ImportSnapshotFromS3Request = {
|
|
15
|
+
name: {
|
|
16
|
+
minLength: 1
|
|
17
|
+
}
|
|
18
|
+
};
|
|
14
19
|
const ListSnapshotsRequest = {
|
|
15
20
|
page: {
|
|
16
21
|
greaterThan: 0
|
|
@@ -39,4 +44,4 @@ const ListVolumesRequest = {
|
|
|
39
44
|
}
|
|
40
45
|
};
|
|
41
46
|
|
|
42
|
-
export { CreateSnapshotRequest, CreateVolumeRequest, ListSnapshotsRequest, ListVolumeTypesRequest, ListVolumesRequest };
|
|
47
|
+
export { CreateSnapshotRequest, CreateVolumeRequest, ImportSnapshotFromS3Request, ListSnapshotsRequest, ListVolumeTypesRequest, ListVolumesRequest };
|
|
@@ -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, marshalCreateDatasourceRequest, unmarshalDatasource, unmarshalListDatasourcesResponse, 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, unmarshalListDatasourcesResponse, marshalCreateTokenRequest, unmarshalToken, unmarshalListTokensResponse, marshalCreateContactPointRequest, unmarshalContactPoint, unmarshalListContactPointsResponse, marshalDeleteContactPointRequest, marshalEnableManagedAlertsRequest, marshalDisableManagedAlertsRequest, marshalTriggerTestAlertRequest, marshalCreateGrafanaUserRequest, unmarshalGrafanaUser, unmarshalListGrafanaUsersResponse, marshalDeleteGrafanaUserRequest, marshalResetGrafanaUserPasswordRequest, unmarshalListPlansResponse, marshalSelectPlanRequest, unmarshalSelectPlanResponse, unmarshalListGrafanaProductDashboardsResponse, unmarshalGrafanaProductDashboard } 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.
|
|
@@ -496,6 +496,48 @@ class API extends API$1 {
|
|
|
496
496
|
method: 'POST',
|
|
497
497
|
path: `/cockpit/v1beta1/select-plan`
|
|
498
498
|
}, unmarshalSelectPlanResponse);
|
|
499
|
+
pageOfListGrafanaProductDashboards = (() => {
|
|
500
|
+
var _this23 = this;
|
|
501
|
+
return function (request) {
|
|
502
|
+
if (request === void 0) {
|
|
503
|
+
request = {};
|
|
504
|
+
}
|
|
505
|
+
return _this23.client.fetch({
|
|
506
|
+
method: 'GET',
|
|
507
|
+
path: `/cockpit/v1beta1/grafana-product-dashboards`,
|
|
508
|
+
urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this23.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this23.client.settings.defaultProjectId], ['tags', request.tags])
|
|
509
|
+
}, unmarshalListGrafanaProductDashboardsResponse);
|
|
510
|
+
};
|
|
511
|
+
})();
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* List product dashboards. Get a list of available product dashboards.
|
|
515
|
+
*
|
|
516
|
+
* @param request - The request {@link ListGrafanaProductDashboardsRequest}
|
|
517
|
+
* @returns A Promise of ListGrafanaProductDashboardsResponse
|
|
518
|
+
*/
|
|
519
|
+
listGrafanaProductDashboards = (() => {
|
|
520
|
+
var _this24 = this;
|
|
521
|
+
return function (request) {
|
|
522
|
+
if (request === void 0) {
|
|
523
|
+
request = {};
|
|
524
|
+
}
|
|
525
|
+
return enrichForPagination('dashboards', _this24.pageOfListGrafanaProductDashboards, request);
|
|
526
|
+
};
|
|
527
|
+
})();
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Get a product dashboard. Get a product dashboard specified by the dashboard
|
|
531
|
+
* ID.
|
|
532
|
+
*
|
|
533
|
+
* @param request - The request {@link GetGrafanaProductDashboardRequest}
|
|
534
|
+
* @returns A Promise of GrafanaProductDashboard
|
|
535
|
+
*/
|
|
536
|
+
getGrafanaProductDashboard = request => this.client.fetch({
|
|
537
|
+
method: 'GET',
|
|
538
|
+
path: `/cockpit/v1beta1/grafana-product-dashboards/${validatePathParam('dashboardName', request.dashboardName)}`,
|
|
539
|
+
urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId])
|
|
540
|
+
}, unmarshalGrafanaProductDashboard);
|
|
499
541
|
}
|
|
500
542
|
|
|
501
543
|
export { API };
|
|
@@ -60,6 +60,18 @@ const unmarshalDatasource = data => {
|
|
|
60
60
|
url: data.url
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
|
+
const unmarshalGrafanaProductDashboard = data => {
|
|
64
|
+
if (!isJSONObject(data)) {
|
|
65
|
+
throw new TypeError(`Unmarshalling the type 'GrafanaProductDashboard' failed as data isn't a dictionary.`);
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
dashboardName: data.dashboard_name,
|
|
69
|
+
tags: data.tags,
|
|
70
|
+
title: data.title,
|
|
71
|
+
url: data.url,
|
|
72
|
+
variables: data.variables
|
|
73
|
+
};
|
|
74
|
+
};
|
|
63
75
|
const unmarshalGrafanaUser = data => {
|
|
64
76
|
if (!isJSONObject(data)) {
|
|
65
77
|
throw new TypeError(`Unmarshalling the type 'GrafanaUser' failed as data isn't a dictionary.`);
|
|
@@ -141,6 +153,15 @@ const unmarshalListDatasourcesResponse = data => {
|
|
|
141
153
|
totalCount: data.total_count
|
|
142
154
|
};
|
|
143
155
|
};
|
|
156
|
+
const unmarshalListGrafanaProductDashboardsResponse = data => {
|
|
157
|
+
if (!isJSONObject(data)) {
|
|
158
|
+
throw new TypeError(`Unmarshalling the type 'ListGrafanaProductDashboardsResponse' failed as data isn't a dictionary.`);
|
|
159
|
+
}
|
|
160
|
+
return {
|
|
161
|
+
dashboards: unmarshalArrayOfObject(data.dashboards, unmarshalGrafanaProductDashboard),
|
|
162
|
+
totalCount: data.total_count
|
|
163
|
+
};
|
|
164
|
+
};
|
|
144
165
|
const unmarshalListGrafanaUsersResponse = data => {
|
|
145
166
|
if (!isJSONObject(data)) {
|
|
146
167
|
throw new TypeError(`Unmarshalling the type 'ListGrafanaUsersResponse' failed as data isn't a dictionary.`);
|
|
@@ -246,4 +267,4 @@ const marshalTriggerTestAlertRequest = (request, defaults) => ({
|
|
|
246
267
|
project_id: request.projectId ?? defaults.defaultProjectId
|
|
247
268
|
});
|
|
248
269
|
|
|
249
|
-
export { marshalActivateCockpitRequest, marshalCreateContactPointRequest, marshalCreateDatasourceRequest, marshalCreateGrafanaUserRequest, marshalCreateTokenRequest, marshalDeactivateCockpitRequest, marshalDeleteContactPointRequest, marshalDeleteGrafanaUserRequest, marshalDisableManagedAlertsRequest, marshalEnableManagedAlertsRequest, marshalResetCockpitGrafanaRequest, marshalResetGrafanaUserPasswordRequest, marshalSelectPlanRequest, marshalTriggerTestAlertRequest, unmarshalCockpit, unmarshalCockpitMetrics, unmarshalContactPoint, unmarshalDatasource, unmarshalGrafanaUser, unmarshalListContactPointsResponse, unmarshalListDatasourcesResponse, unmarshalListGrafanaUsersResponse, unmarshalListPlansResponse, unmarshalListTokensResponse, unmarshalSelectPlanResponse, unmarshalToken };
|
|
270
|
+
export { marshalActivateCockpitRequest, marshalCreateContactPointRequest, marshalCreateDatasourceRequest, marshalCreateGrafanaUserRequest, marshalCreateTokenRequest, marshalDeactivateCockpitRequest, marshalDeleteContactPointRequest, marshalDeleteGrafanaUserRequest, marshalDisableManagedAlertsRequest, marshalEnableManagedAlertsRequest, marshalResetCockpitGrafanaRequest, marshalResetGrafanaUserPasswordRequest, marshalSelectPlanRequest, marshalTriggerTestAlertRequest, unmarshalCockpit, unmarshalCockpitMetrics, unmarshalContactPoint, unmarshalDatasource, unmarshalGrafanaProductDashboard, unmarshalGrafanaUser, unmarshalListContactPointsResponse, unmarshalListDatasourcesResponse, unmarshalListGrafanaProductDashboardsResponse, unmarshalListGrafanaUsersResponse, unmarshalListPlansResponse, unmarshalListTokensResponse, unmarshalSelectPlanResponse, unmarshalToken };
|
|
@@ -20,6 +20,7 @@ const unmarshalTriggerMnqNatsClientConfig = data => {
|
|
|
20
20
|
return {
|
|
21
21
|
mnqCredentialId: data.mnq_credential_id,
|
|
22
22
|
mnqNamespaceId: data.mnq_namespace_id,
|
|
23
|
+
mnqNatsAccountId: data.mnq_nats_account_id,
|
|
23
24
|
mnqProjectId: data.mnq_project_id,
|
|
24
25
|
mnqRegion: data.mnq_region,
|
|
25
26
|
subject: data.subject
|
|
@@ -20,6 +20,7 @@ const unmarshalTriggerMnqNatsClientConfig = data => {
|
|
|
20
20
|
return {
|
|
21
21
|
mnqCredentialId: data.mnq_credential_id,
|
|
22
22
|
mnqNamespaceId: data.mnq_namespace_id,
|
|
23
|
+
mnqNatsAccountId: data.mnq_nats_account_id,
|
|
23
24
|
mnqProjectId: data.mnq_project_id,
|
|
24
25
|
mnqRegion: data.mnq_region,
|
|
25
26
|
subject: data.subject
|
|
@@ -152,7 +152,8 @@ const unmarshalServerIp = data => {
|
|
|
152
152
|
gateway: data.gateway,
|
|
153
153
|
id: data.id,
|
|
154
154
|
netmask: data.netmask,
|
|
155
|
-
provisioningMode: data.provisioning_mode
|
|
155
|
+
provisioningMode: data.provisioning_mode,
|
|
156
|
+
tags: data.tags
|
|
156
157
|
};
|
|
157
158
|
};
|
|
158
159
|
const unmarshalServerIpv6 = data => {
|
|
@@ -994,7 +995,8 @@ const marshalServerIp = (request, defaults) => ({
|
|
|
994
995
|
gateway: request.gateway,
|
|
995
996
|
id: request.id,
|
|
996
997
|
netmask: request.netmask,
|
|
997
|
-
provisioning_mode: request.provisioningMode
|
|
998
|
+
provisioning_mode: request.provisioningMode,
|
|
999
|
+
tags: request.tags
|
|
998
1000
|
});
|
|
999
1001
|
const marshalServerIpv6 = (request, defaults) => ({
|
|
1000
1002
|
address: request.address,
|
|
@@ -1388,9 +1390,9 @@ const marshalUpdateServerRequest = (request, defaults) => ({
|
|
|
1388
1390
|
enable_ipv6: request.enableIpv6,
|
|
1389
1391
|
name: request.name,
|
|
1390
1392
|
placement_group: request.placementGroup,
|
|
1391
|
-
private_nics: request.privateNics
|
|
1393
|
+
private_nics: request.privateNics,
|
|
1392
1394
|
protected: request.protected,
|
|
1393
|
-
public_ips: request.publicIps
|
|
1395
|
+
public_ips: request.publicIps,
|
|
1394
1396
|
routed_ip_enabled: request.routedIpEnabled,
|
|
1395
1397
|
security_group: request.securityGroup ? marshalSecurityGroupTemplate(request.securityGroup) : undefined,
|
|
1396
1398
|
tags: request.tags,
|
|
@@ -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 } from './content.gen.js';
|
|
6
|
-
import { marshalCreateVolumeRequest, unmarshalVolume, unmarshalListVolumesResponse, marshalUpdateVolumeRequest, marshalCreatePinByURLRequest, unmarshalPin, marshalCreatePinByCIDRequest, marshalReplacePinRequest, unmarshalReplacePinResponse, unmarshalListPinsResponse } from './marshalling.gen.js';
|
|
5
|
+
import { PIN_TRANSIENT_STATUSES, NAME_TRANSIENT_STATUSES } from './content.gen.js';
|
|
6
|
+
import { marshalCreateVolumeRequest, unmarshalVolume, unmarshalListVolumesResponse, marshalUpdateVolumeRequest, marshalCreatePinByURLRequest, unmarshalPin, marshalCreatePinByCIDRequest, marshalReplacePinRequest, unmarshalReplacePinResponse, unmarshalListPinsResponse, marshalIpnsApiCreateNameRequest, unmarshalName, unmarshalListNamesResponse, marshalIpnsApiUpdateNameRequest, unmarshalExportKeyNameResponse, marshalIpnsApiImportKeyNameRequest } 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.
|
|
@@ -194,4 +194,121 @@ class API extends API$1 {
|
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
|
|
197
|
+
/** IPFS Naming service API. */
|
|
198
|
+
class IpnsAPI extends API$1 {
|
|
199
|
+
/** Lists the available regions of the API. */
|
|
200
|
+
static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Create a new name. You can use the `ipns key` command to list and generate
|
|
204
|
+
* more names and their respective keys.
|
|
205
|
+
*
|
|
206
|
+
* @param request - The request {@link IpnsApiCreateNameRequest}
|
|
207
|
+
* @returns A Promise of Name
|
|
208
|
+
*/
|
|
209
|
+
createName = request => this.client.fetch({
|
|
210
|
+
body: JSON.stringify(marshalIpnsApiCreateNameRequest(request, this.client.settings)),
|
|
211
|
+
headers: jsonContentHeaders,
|
|
212
|
+
method: 'POST',
|
|
213
|
+
path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names`
|
|
214
|
+
}, unmarshalName);
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Get information about a name. Retrieve information about a specific name.
|
|
218
|
+
*
|
|
219
|
+
* @param request - The request {@link IpnsApiGetNameRequest}
|
|
220
|
+
* @returns A Promise of Name
|
|
221
|
+
*/
|
|
222
|
+
getName = request => this.client.fetch({
|
|
223
|
+
method: 'GET',
|
|
224
|
+
path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}`
|
|
225
|
+
}, unmarshalName);
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Waits for {@link Name} to be in a final state.
|
|
229
|
+
*
|
|
230
|
+
* @param request - The request {@link GetNameRequest}
|
|
231
|
+
* @param options - The waiting options
|
|
232
|
+
* @returns A Promise of Name
|
|
233
|
+
*/
|
|
234
|
+
waitForName = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NAME_TRANSIENT_STATUSES.includes(res.status))), this.getName, request, options);
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Delete an existing name. Delete a name by its ID.
|
|
238
|
+
*
|
|
239
|
+
* @param request - The request {@link IpnsApiDeleteNameRequest}
|
|
240
|
+
*/
|
|
241
|
+
deleteName = request => this.client.fetch({
|
|
242
|
+
method: 'DELETE',
|
|
243
|
+
path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}`
|
|
244
|
+
});
|
|
245
|
+
pageOfListNames = (() => {
|
|
246
|
+
var _this3 = this;
|
|
247
|
+
return function (request) {
|
|
248
|
+
if (request === void 0) {
|
|
249
|
+
request = {};
|
|
250
|
+
}
|
|
251
|
+
return _this3.client.fetch({
|
|
252
|
+
method: 'GET',
|
|
253
|
+
path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/names`,
|
|
254
|
+
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])
|
|
255
|
+
}, unmarshalListNamesResponse);
|
|
256
|
+
};
|
|
257
|
+
})();
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* List all names by a Project ID. Retrieve information about all names from a
|
|
261
|
+
* Project ID.
|
|
262
|
+
*
|
|
263
|
+
* @param request - The request {@link IpnsApiListNamesRequest}
|
|
264
|
+
* @returns A Promise of ListNamesResponse
|
|
265
|
+
*/
|
|
266
|
+
listNames = (() => {
|
|
267
|
+
var _this4 = this;
|
|
268
|
+
return function (request) {
|
|
269
|
+
if (request === void 0) {
|
|
270
|
+
request = {};
|
|
271
|
+
}
|
|
272
|
+
return enrichForPagination('names', _this4.pageOfListNames, request);
|
|
273
|
+
};
|
|
274
|
+
})();
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Update name information. Update name information (CID, tag, name...).
|
|
278
|
+
*
|
|
279
|
+
* @param request - The request {@link IpnsApiUpdateNameRequest}
|
|
280
|
+
* @returns A Promise of Name
|
|
281
|
+
*/
|
|
282
|
+
updateName = request => this.client.fetch({
|
|
283
|
+
body: JSON.stringify(marshalIpnsApiUpdateNameRequest(request, this.client.settings)),
|
|
284
|
+
headers: jsonContentHeaders,
|
|
285
|
+
method: 'PATCH',
|
|
286
|
+
path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}`
|
|
287
|
+
}, unmarshalName);
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Export your private key. Export a private key by its ID.
|
|
291
|
+
*
|
|
292
|
+
* @param request - The request {@link IpnsApiExportKeyNameRequest}
|
|
293
|
+
* @returns A Promise of ExportKeyNameResponse
|
|
294
|
+
*/
|
|
295
|
+
exportKeyName = request => this.client.fetch({
|
|
296
|
+
method: 'GET',
|
|
297
|
+
path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}/export-key`
|
|
298
|
+
}, unmarshalExportKeyNameResponse);
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Import your private key. Import a private key.
|
|
302
|
+
*
|
|
303
|
+
* @param request - The request {@link IpnsApiImportKeyNameRequest}
|
|
304
|
+
* @returns A Promise of Name
|
|
305
|
+
*/
|
|
306
|
+
importKeyName = request => this.client.fetch({
|
|
307
|
+
body: JSON.stringify(marshalIpnsApiImportKeyNameRequest(request, this.client.settings)),
|
|
308
|
+
headers: jsonContentHeaders,
|
|
309
|
+
method: 'POST',
|
|
310
|
+
path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/import-key`
|
|
311
|
+
}, unmarshalName);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
export { API, IpnsAPI };
|
|
@@ -1,7 +1,10 @@
|
|
|
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
|
+
|
|
4
7
|
/** Lists transient statutes of the enum {@link PinStatus}. */
|
|
5
8
|
const PIN_TRANSIENT_STATUSES = ['queued', 'pinning'];
|
|
6
9
|
|
|
7
|
-
export { PIN_TRANSIENT_STATUSES };
|
|
10
|
+
export { NAME_TRANSIENT_STATUSES, PIN_TRANSIENT_STATUSES };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { API } from './api.gen.js';
|
|
2
|
-
export { PIN_TRANSIENT_STATUSES } from './content.gen.js';
|
|
1
|
+
export { API, IpnsAPI } from './api.gen.js';
|
|
2
|
+
export { NAME_TRANSIENT_STATUSES, 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,6 +34,23 @@ 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
|
+
region: data.region,
|
|
48
|
+
status: data.status,
|
|
49
|
+
tags: data.tags,
|
|
50
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
51
|
+
value: data.value
|
|
52
|
+
};
|
|
53
|
+
};
|
|
37
54
|
const unmarshalPin = data => {
|
|
38
55
|
if (!isJSONObject(data)) {
|
|
39
56
|
throw new TypeError(`Unmarshalling the type 'Pin' failed as data isn't a dictionary.`);
|
|
@@ -63,6 +80,28 @@ const unmarshalVolume = data => {
|
|
|
63
80
|
updatedAt: unmarshalDate(data.updated_at)
|
|
64
81
|
};
|
|
65
82
|
};
|
|
83
|
+
const unmarshalExportKeyNameResponse = data => {
|
|
84
|
+
if (!isJSONObject(data)) {
|
|
85
|
+
throw new TypeError(`Unmarshalling the type 'ExportKeyNameResponse' failed as data isn't a dictionary.`);
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
createdAt: unmarshalDate(data.created_at),
|
|
89
|
+
nameId: data.name_id,
|
|
90
|
+
privateKey: data.private_key,
|
|
91
|
+
projectId: data.project_id,
|
|
92
|
+
publicKey: data.public_key,
|
|
93
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
const unmarshalListNamesResponse = data => {
|
|
97
|
+
if (!isJSONObject(data)) {
|
|
98
|
+
throw new TypeError(`Unmarshalling the type 'ListNamesResponse' failed as data isn't a dictionary.`);
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
names: unmarshalArrayOfObject(data.names, unmarshalName),
|
|
102
|
+
totalCount: data.total_count
|
|
103
|
+
};
|
|
104
|
+
};
|
|
66
105
|
const unmarshalListPinsResponse = data => {
|
|
67
106
|
if (!isJSONObject(data)) {
|
|
68
107
|
throw new TypeError(`Unmarshalling the type 'ListPinsResponse' failed as data isn't a dictionary.`);
|
|
@@ -110,6 +149,22 @@ const marshalCreateVolumeRequest = (request, defaults) => ({
|
|
|
110
149
|
name: request.name,
|
|
111
150
|
project_id: request.projectId ?? defaults.defaultProjectId
|
|
112
151
|
});
|
|
152
|
+
const marshalIpnsApiCreateNameRequest = (request, defaults) => ({
|
|
153
|
+
name: request.name,
|
|
154
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
155
|
+
value: request.value
|
|
156
|
+
});
|
|
157
|
+
const marshalIpnsApiImportKeyNameRequest = (request, defaults) => ({
|
|
158
|
+
name: request.name,
|
|
159
|
+
private_key: request.privateKey,
|
|
160
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
161
|
+
value: request.value
|
|
162
|
+
});
|
|
163
|
+
const marshalIpnsApiUpdateNameRequest = (request, defaults) => ({
|
|
164
|
+
name: request.name,
|
|
165
|
+
tags: request.tags,
|
|
166
|
+
value: request.value
|
|
167
|
+
});
|
|
113
168
|
const marshalReplacePinRequest = (request, defaults) => ({
|
|
114
169
|
cid: request.cid,
|
|
115
170
|
name: request.name,
|
|
@@ -122,4 +177,4 @@ const marshalUpdateVolumeRequest = (request, defaults) => ({
|
|
|
122
177
|
tags: request.tags
|
|
123
178
|
});
|
|
124
179
|
|
|
125
|
-
export { marshalCreatePinByCIDRequest, marshalCreatePinByURLRequest, marshalCreateVolumeRequest, marshalReplacePinRequest, marshalUpdateVolumeRequest, unmarshalListPinsResponse, unmarshalListVolumesResponse, unmarshalPin, unmarshalReplacePinResponse, unmarshalVolume };
|
|
180
|
+
export { marshalCreatePinByCIDRequest, marshalCreatePinByURLRequest, marshalCreateVolumeRequest, marshalIpnsApiCreateNameRequest, marshalIpnsApiImportKeyNameRequest, marshalIpnsApiUpdateNameRequest, marshalReplacePinRequest, marshalUpdateVolumeRequest, unmarshalExportKeyNameResponse, unmarshalListNamesResponse, unmarshalListPinsResponse, unmarshalListVolumesResponse, unmarshalName, unmarshalPin, unmarshalReplacePinResponse, unmarshalVolume };
|
package/dist/api/mnq/index.js
CHANGED