@scaleway/sdk 1.36.0 → 1.38.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/marshalling.gen.js +2 -1
- package/dist/api/container/v1beta1/index.gen.js +2 -0
- package/dist/api/container/v1beta1/marshalling.gen.js +4 -3
- package/dist/api/container/v1beta1/validation-rules.gen.js +44 -0
- package/dist/api/function/v1beta1/index.gen.js +2 -0
- package/dist/api/function/v1beta1/marshalling.gen.js +4 -3
- package/dist/api/function/v1beta1/validation-rules.gen.js +44 -0
- package/dist/api/ipam/index.js +2 -0
- package/dist/api/ipam/v1/api.gen.js +113 -0
- package/dist/api/ipam/v1/index.gen.js +6 -0
- package/dist/api/ipam/v1/marshalling.gen.js +77 -0
- package/dist/api/ipam/v1/validation-rules.gen.js +11 -0
- 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/v1beta1/validation-rules.gen.js +5 -5
- package/dist/api/tem/v1alpha1/marshalling.gen.js +13 -0
- package/dist/api/vpcgw/v1/marshalling.gen.js +10 -0
- package/dist/index.cjs +821 -336
- package/dist/index.d.ts +1662 -941
- package/dist/index.js +30 -28
- package/dist/scw/constants.js +1 -1
- package/package.json +2 -2
|
@@ -37,7 +37,8 @@ const unmarshalCockpitEndpoints = data => {
|
|
|
37
37
|
alertmanagerUrl: data.alertmanager_url,
|
|
38
38
|
grafanaUrl: data.grafana_url,
|
|
39
39
|
logsUrl: data.logs_url,
|
|
40
|
-
metricsUrl: data.metrics_url
|
|
40
|
+
metricsUrl: data.metrics_url,
|
|
41
|
+
tracesUrl: data.traces_url
|
|
41
42
|
};
|
|
42
43
|
};
|
|
43
44
|
const unmarshalContactPoint = data => {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { API } from './api.gen.js';
|
|
2
2
|
export { CONTAINER_TRANSIENT_STATUSES, CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES } from './content.gen.js';
|
|
3
|
+
import * as validationRules_gen from './validation-rules.gen.js';
|
|
4
|
+
export { validationRules_gen as ValidationRules };
|
|
3
5
|
|
|
4
6
|
// This file was automatically generated. DO NOT EDIT.
|
|
5
7
|
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
@@ -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
|
|
@@ -309,12 +310,12 @@ const marshalCreateTriggerRequest = (request, defaults) => ({
|
|
|
309
310
|
...resolveOneOf([{
|
|
310
311
|
param: 'scw_sqs_config',
|
|
311
312
|
value: request.scwSqsConfig ? marshalCreateTriggerRequestMnqSqsClientConfig(request.scwSqsConfig) : undefined
|
|
312
|
-
}, {
|
|
313
|
-
param: 'sqs_config',
|
|
314
|
-
value: request.sqsConfig ? marshalCreateTriggerRequestSqsClientConfig(request.sqsConfig) : undefined
|
|
315
313
|
}, {
|
|
316
314
|
param: 'scw_nats_config',
|
|
317
315
|
value: request.scwNatsConfig ? marshalCreateTriggerRequestMnqNatsClientConfig(request.scwNatsConfig) : undefined
|
|
316
|
+
}, {
|
|
317
|
+
param: 'sqs_config',
|
|
318
|
+
value: request.sqsConfig ? marshalCreateTriggerRequestSqsClientConfig(request.sqsConfig) : undefined
|
|
318
319
|
}])
|
|
319
320
|
});
|
|
320
321
|
const marshalUpdateContainerRequest = (request, defaults) => ({
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
2
|
+
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
3
|
+
|
|
4
|
+
const CreateTriggerRequest = {
|
|
5
|
+
description: {
|
|
6
|
+
maxLength: 255
|
|
7
|
+
},
|
|
8
|
+
name: {
|
|
9
|
+
maxLength: 50,
|
|
10
|
+
minLength: 1
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const CreateTriggerRequestMnqNatsClientConfig = {
|
|
14
|
+
mnqRegion: {
|
|
15
|
+
maxLength: 20,
|
|
16
|
+
minLength: 1
|
|
17
|
+
},
|
|
18
|
+
subject: {
|
|
19
|
+
maxLength: 100,
|
|
20
|
+
minLength: 1,
|
|
21
|
+
pattern: /^[^\s]+$/
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const CreateTriggerRequestMnqSqsClientConfig = {
|
|
25
|
+
mnqRegion: {
|
|
26
|
+
maxLength: 20,
|
|
27
|
+
minLength: 1
|
|
28
|
+
},
|
|
29
|
+
queue: {
|
|
30
|
+
maxLength: 100,
|
|
31
|
+
minLength: 1
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const UpdateTriggerRequest = {
|
|
35
|
+
description: {
|
|
36
|
+
maxLength: 255
|
|
37
|
+
},
|
|
38
|
+
name: {
|
|
39
|
+
maxLength: 50,
|
|
40
|
+
minLength: 1
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export { CreateTriggerRequest, CreateTriggerRequestMnqNatsClientConfig, CreateTriggerRequestMnqSqsClientConfig, UpdateTriggerRequest };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { API } from './api.gen.js';
|
|
2
2
|
export { CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, FUNCTION_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES } from './content.gen.js';
|
|
3
|
+
import * as validationRules_gen from './validation-rules.gen.js';
|
|
4
|
+
export { validationRules_gen as ValidationRules };
|
|
3
5
|
|
|
4
6
|
// This file was automatically generated. DO NOT EDIT.
|
|
5
7
|
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
@@ -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
|
|
@@ -350,12 +351,12 @@ const marshalCreateTriggerRequest = (request, defaults) => ({
|
|
|
350
351
|
...resolveOneOf([{
|
|
351
352
|
param: 'scw_sqs_config',
|
|
352
353
|
value: request.scwSqsConfig ? marshalCreateTriggerRequestMnqSqsClientConfig(request.scwSqsConfig) : undefined
|
|
353
|
-
}, {
|
|
354
|
-
param: 'sqs_config',
|
|
355
|
-
value: request.sqsConfig ? marshalCreateTriggerRequestSqsClientConfig(request.sqsConfig) : undefined
|
|
356
354
|
}, {
|
|
357
355
|
param: 'scw_nats_config',
|
|
358
356
|
value: request.scwNatsConfig ? marshalCreateTriggerRequestMnqNatsClientConfig(request.scwNatsConfig) : undefined
|
|
357
|
+
}, {
|
|
358
|
+
param: 'sqs_config',
|
|
359
|
+
value: request.sqsConfig ? marshalCreateTriggerRequestSqsClientConfig(request.sqsConfig) : undefined
|
|
359
360
|
}])
|
|
360
361
|
});
|
|
361
362
|
const marshalUpdateCronRequest = (request, defaults) => ({
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
2
|
+
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
3
|
+
|
|
4
|
+
const CreateTriggerRequest = {
|
|
5
|
+
description: {
|
|
6
|
+
maxLength: 255
|
|
7
|
+
},
|
|
8
|
+
name: {
|
|
9
|
+
maxLength: 50,
|
|
10
|
+
minLength: 1
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const CreateTriggerRequestMnqNatsClientConfig = {
|
|
14
|
+
mnqRegion: {
|
|
15
|
+
maxLength: 20,
|
|
16
|
+
minLength: 1
|
|
17
|
+
},
|
|
18
|
+
subject: {
|
|
19
|
+
maxLength: 100,
|
|
20
|
+
minLength: 1,
|
|
21
|
+
pattern: /^[^\s]+$/
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const CreateTriggerRequestMnqSqsClientConfig = {
|
|
25
|
+
mnqRegion: {
|
|
26
|
+
maxLength: 20,
|
|
27
|
+
minLength: 1
|
|
28
|
+
},
|
|
29
|
+
queue: {
|
|
30
|
+
maxLength: 100,
|
|
31
|
+
minLength: 1
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const UpdateTriggerRequest = {
|
|
35
|
+
description: {
|
|
36
|
+
maxLength: 255
|
|
37
|
+
},
|
|
38
|
+
name: {
|
|
39
|
+
maxLength: 50,
|
|
40
|
+
minLength: 1
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export { CreateTriggerRequest, CreateTriggerRequestMnqNatsClientConfig, CreateTriggerRequestMnqSqsClientConfig, UpdateTriggerRequest };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { API as API$1 } from '../../../scw/api.js';
|
|
2
|
+
import { validatePathParam, urlParams, resolveOneOf } from '../../../helpers/marshalling.js';
|
|
3
|
+
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
4
|
+
import { marshalBookIPRequest, unmarshalIP, marshalUpdateIPRequest, unmarshalListIPsResponse } from './marshalling.gen.js';
|
|
5
|
+
|
|
6
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
7
|
+
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
8
|
+
const jsonContentHeaders = {
|
|
9
|
+
'Content-Type': 'application/json; charset=utf-8'
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* IPAM API.
|
|
14
|
+
*
|
|
15
|
+
* This API allows you to manage IP addresses with Scaleway's IP Address
|
|
16
|
+
* Management tool. IPAM API.
|
|
17
|
+
*/
|
|
18
|
+
class API extends API$1 {
|
|
19
|
+
/** Lists the available regions of the API. */
|
|
20
|
+
static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Book a new IP. Book a new IP from the specified source. Currently IPs can
|
|
24
|
+
* only be booked from a Private Network.
|
|
25
|
+
*
|
|
26
|
+
* @param request - The request {@link BookIPRequest}
|
|
27
|
+
* @returns A Promise of IP
|
|
28
|
+
*/
|
|
29
|
+
bookIP = request => this.client.fetch({
|
|
30
|
+
body: JSON.stringify(marshalBookIPRequest(request, this.client.settings)),
|
|
31
|
+
headers: jsonContentHeaders,
|
|
32
|
+
method: 'POST',
|
|
33
|
+
path: `/ipam/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips`
|
|
34
|
+
}, unmarshalIP);
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Release an IP. Release an IP not currently attached to a resource, and
|
|
38
|
+
* returns it to the available IP pool.
|
|
39
|
+
*
|
|
40
|
+
* @param request - The request {@link ReleaseIPRequest}
|
|
41
|
+
*/
|
|
42
|
+
releaseIP = request => this.client.fetch({
|
|
43
|
+
body: '{}',
|
|
44
|
+
headers: jsonContentHeaders,
|
|
45
|
+
method: 'DELETE',
|
|
46
|
+
path: `/ipam/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam('ipId', request.ipId)}`
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Get an IP. Retrieve details of an existing IP, specified by its IP ID.
|
|
51
|
+
*
|
|
52
|
+
* @param request - The request {@link GetIPRequest}
|
|
53
|
+
* @returns A Promise of IP
|
|
54
|
+
*/
|
|
55
|
+
getIP = request => this.client.fetch({
|
|
56
|
+
method: 'GET',
|
|
57
|
+
path: `/ipam/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam('ipId', request.ipId)}`
|
|
58
|
+
}, unmarshalIP);
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Update an IP. Update parameters including tags of the specified IP.
|
|
62
|
+
*
|
|
63
|
+
* @param request - The request {@link UpdateIPRequest}
|
|
64
|
+
* @returns A Promise of IP
|
|
65
|
+
*/
|
|
66
|
+
updateIP = request => this.client.fetch({
|
|
67
|
+
body: JSON.stringify(marshalUpdateIPRequest(request, this.client.settings)),
|
|
68
|
+
headers: jsonContentHeaders,
|
|
69
|
+
method: 'PATCH',
|
|
70
|
+
path: `/ipam/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam('ipId', request.ipId)}`
|
|
71
|
+
}, unmarshalIP);
|
|
72
|
+
pageOfListIPs = (() => {
|
|
73
|
+
var _this = this;
|
|
74
|
+
return function (request) {
|
|
75
|
+
if (request === void 0) {
|
|
76
|
+
request = {};
|
|
77
|
+
}
|
|
78
|
+
return _this.client.fetch({
|
|
79
|
+
method: 'GET',
|
|
80
|
+
path: `/ipam/v1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/ips`,
|
|
81
|
+
urlParams: urlParams(['attached', request.attached], ['is_ipv6', request.isIpv6], ['mac_address', request.macAddress], ['order_by', request.orderBy ?? 'created_at_desc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['resource_id', request.resourceId], ['resource_name', request.resourceName], ['resource_type', request.resourceType ?? 'unknown_type'], ['tags', request.tags], ...Object.entries(resolveOneOf([{
|
|
82
|
+
param: 'zonal',
|
|
83
|
+
value: request.zonal
|
|
84
|
+
}, {
|
|
85
|
+
param: 'private_network_id',
|
|
86
|
+
value: request.privateNetworkId
|
|
87
|
+
}])))
|
|
88
|
+
}, unmarshalListIPsResponse);
|
|
89
|
+
};
|
|
90
|
+
})();
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* List existing IPs. List existing IPs in the specified region using various
|
|
94
|
+
* filters. For example, you can filter for IPs within a specified Private
|
|
95
|
+
* Network, or for public IPs within a specified Project. By default, the IPs
|
|
96
|
+
* returned in the list are ordered by creation date in ascending order,
|
|
97
|
+
* though this can be modified via the order_by field.
|
|
98
|
+
*
|
|
99
|
+
* @param request - The request {@link ListIPsRequest}
|
|
100
|
+
* @returns A Promise of ListIPsResponse
|
|
101
|
+
*/
|
|
102
|
+
listIPs = (() => {
|
|
103
|
+
var _this2 = this;
|
|
104
|
+
return function (request) {
|
|
105
|
+
if (request === void 0) {
|
|
106
|
+
request = {};
|
|
107
|
+
}
|
|
108
|
+
return enrichForPagination('ips', _this2.pageOfListIPs, request);
|
|
109
|
+
};
|
|
110
|
+
})();
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export { API };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { API } from './api.gen.js';
|
|
2
|
+
import * as validationRules_gen from './validation-rules.gen.js';
|
|
3
|
+
export { validationRules_gen as ValidationRules };
|
|
4
|
+
|
|
5
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
6
|
+
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { isJSONObject } from '../../../helpers/json.js';
|
|
2
|
+
import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.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.
|
|
6
|
+
const unmarshalResource = data => {
|
|
7
|
+
if (!isJSONObject(data)) {
|
|
8
|
+
throw new TypeError(`Unmarshalling the type 'Resource' failed as data isn't a dictionary.`);
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
id: data.id,
|
|
12
|
+
macAddress: data.mac_address,
|
|
13
|
+
name: data.name,
|
|
14
|
+
type: data.type
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
const unmarshalSource = data => {
|
|
18
|
+
if (!isJSONObject(data)) {
|
|
19
|
+
throw new TypeError(`Unmarshalling the type 'Source' failed as data isn't a dictionary.`);
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
privateNetworkId: data.private_network_id,
|
|
23
|
+
subnetId: data.subnet_id,
|
|
24
|
+
zonal: data.zonal
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
const unmarshalIP = data => {
|
|
28
|
+
if (!isJSONObject(data)) {
|
|
29
|
+
throw new TypeError(`Unmarshalling the type 'IP' failed as data isn't a dictionary.`);
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
address: data.address,
|
|
33
|
+
createdAt: unmarshalDate(data.created_at),
|
|
34
|
+
id: data.id,
|
|
35
|
+
isIpv6: data.is_ipv6,
|
|
36
|
+
projectId: data.project_id,
|
|
37
|
+
region: data.region,
|
|
38
|
+
resource: data.resource ? unmarshalResource(data.resource) : undefined,
|
|
39
|
+
source: data.source ? unmarshalSource(data.source) : undefined,
|
|
40
|
+
tags: data.tags,
|
|
41
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
42
|
+
zone: data.zone
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
const unmarshalListIPsResponse = data => {
|
|
46
|
+
if (!isJSONObject(data)) {
|
|
47
|
+
throw new TypeError(`Unmarshalling the type 'ListIPsResponse' failed as data isn't a dictionary.`);
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
ips: unmarshalArrayOfObject(data.ips, unmarshalIP),
|
|
51
|
+
totalCount: data.total_count
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
const marshalSource = (request, defaults) => ({
|
|
55
|
+
...resolveOneOf([{
|
|
56
|
+
param: 'zonal',
|
|
57
|
+
value: request.zonal
|
|
58
|
+
}, {
|
|
59
|
+
param: 'private_network_id',
|
|
60
|
+
value: request.privateNetworkId
|
|
61
|
+
}, {
|
|
62
|
+
param: 'subnet_id',
|
|
63
|
+
value: request.subnetId
|
|
64
|
+
}])
|
|
65
|
+
});
|
|
66
|
+
const marshalBookIPRequest = (request, defaults) => ({
|
|
67
|
+
address: request.address,
|
|
68
|
+
is_ipv6: request.isIpv6,
|
|
69
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
70
|
+
source: request.source ? marshalSource(request.source) : undefined,
|
|
71
|
+
tags: request.tags
|
|
72
|
+
});
|
|
73
|
+
const marshalUpdateIPRequest = (request, defaults) => ({
|
|
74
|
+
tags: request.tags
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export { marshalBookIPRequest, marshalUpdateIPRequest, unmarshalIP, unmarshalListIPsResponse };
|
|
@@ -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 };
|
|
@@ -9,7 +9,7 @@ const NatsApiCreateNatsAccountRequest = {
|
|
|
9
9
|
};
|
|
10
10
|
const NatsApiCreateNatsCredentialsRequest = {
|
|
11
11
|
name: {
|
|
12
|
-
maxLength:
|
|
12
|
+
maxLength: 500,
|
|
13
13
|
minLength: 1
|
|
14
14
|
}
|
|
15
15
|
};
|
|
@@ -21,25 +21,25 @@ const NatsApiUpdateNatsAccountRequest = {
|
|
|
21
21
|
};
|
|
22
22
|
const SnsApiCreateSnsCredentialsRequest = {
|
|
23
23
|
name: {
|
|
24
|
-
maxLength:
|
|
24
|
+
maxLength: 500,
|
|
25
25
|
minLength: 1
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
const SnsApiUpdateSnsCredentialsRequest = {
|
|
29
29
|
name: {
|
|
30
|
-
maxLength:
|
|
30
|
+
maxLength: 500,
|
|
31
31
|
minLength: 1
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
const SqsApiCreateSqsCredentialsRequest = {
|
|
35
35
|
name: {
|
|
36
|
-
maxLength:
|
|
36
|
+
maxLength: 500,
|
|
37
37
|
minLength: 1
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
const SqsApiUpdateSqsCredentialsRequest = {
|
|
41
41
|
name: {
|
|
42
|
-
maxLength:
|
|
42
|
+
maxLength: 500,
|
|
43
43
|
minLength: 1
|
|
44
44
|
}
|
|
45
45
|
};
|