@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.
- package/dist/index.gen.d.ts +362 -0
- package/dist/index.gen.js +323 -0
- package/package.json +71 -25
- package/README.md +0 -46
- package/dist/api/account/index.js +0 -4
- package/dist/api/account/v2/api.gen.js +0 -147
- package/dist/api/account/v2/index.gen.js +0 -4
- package/dist/api/account/v2/marshalling.gen.js +0 -39
- package/dist/api/account/v3/api.gen.js +0 -129
- package/dist/api/account/v3/index.gen.js +0 -6
- package/dist/api/account/v3/marshalling.gen.js +0 -39
- package/dist/api/account/v3/validation-rules.gen.js +0 -39
- package/dist/api/applesilicon/index.js +0 -2
- package/dist/api/applesilicon/v1alpha1/api.gen.js +0 -220
- package/dist/api/applesilicon/v1alpha1/content.gen.js +0 -7
- package/dist/api/applesilicon/v1alpha1/index.gen.js +0 -5
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +0 -113
- package/dist/api/baremetal/index.js +0 -2
- package/dist/api/baremetal/v1/api.gen.js +0 -523
- package/dist/api/baremetal/v1/api.utils.js +0 -27
- package/dist/api/baremetal/v1/content.gen.js +0 -13
- package/dist/api/baremetal/v1/index.js +0 -5
- package/dist/api/baremetal/v1/marshalling.gen.js +0 -395
- package/dist/api/baremetal/v1/validation-rules.gen.js +0 -109
- package/dist/api/billing/index.js +0 -2
- package/dist/api/billing/v2alpha1/api.gen.js +0 -80
- package/dist/api/billing/v2alpha1/index.gen.js +0 -4
- package/dist/api/billing/v2alpha1/marshalling.gen.js +0 -53
- package/dist/api/block/index.js +0 -2
- package/dist/api/block/v1alpha1/api.gen.js +0 -245
- package/dist/api/block/v1alpha1/content.gen.js +0 -13
- package/dist/api/block/v1alpha1/index.gen.js +0 -7
- package/dist/api/block/v1alpha1/marshalling.gen.js +0 -175
- package/dist/api/block/v1alpha1/validation-rules.gen.js +0 -42
- package/dist/api/cockpit/index.js +0 -2
- package/dist/api/cockpit/v1beta1/api.gen.js +0 -448
- package/dist/api/cockpit/v1beta1/content.gen.js +0 -7
- package/dist/api/cockpit/v1beta1/index.gen.js +0 -5
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +0 -220
- package/dist/api/container/index.js +0 -2
- package/dist/api/container/v1beta1/api.gen.js +0 -549
- package/dist/api/container/v1beta1/content.gen.js +0 -22
- package/dist/api/container/v1beta1/index.gen.js +0 -5
- package/dist/api/container/v1beta1/marshalling.gen.js +0 -330
- package/dist/api/document_db/index.js +0 -2
- package/dist/api/document_db/v1beta1/api.gen.js +0 -830
- package/dist/api/document_db/v1beta1/content.gen.js +0 -19
- package/dist/api/document_db/v1beta1/index.gen.js +0 -7
- package/dist/api/document_db/v1beta1/marshalling.gen.js +0 -580
- package/dist/api/document_db/v1beta1/validation-rules.gen.js +0 -10
- package/dist/api/domain/index.js +0 -2
- package/dist/api/domain/v2beta1/api.gen.js +0 -875
- package/dist/api/domain/v2beta1/content.gen.js +0 -28
- package/dist/api/domain/v2beta1/index.gen.js +0 -7
- package/dist/api/domain/v2beta1/marshalling.gen.js +0 -958
- package/dist/api/flexibleip/index.js +0 -2
- package/dist/api/flexibleip/v1alpha1/api.gen.js +0 -203
- package/dist/api/flexibleip/v1alpha1/content.gen.js +0 -10
- package/dist/api/flexibleip/v1alpha1/index.gen.js +0 -7
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -97
- package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +0 -14
- package/dist/api/function/index.js +0 -2
- package/dist/api/function/v1beta1/api.gen.js +0 -560
- package/dist/api/function/v1beta1/content.gen.js +0 -22
- package/dist/api/function/v1beta1/index.gen.js +0 -5
- package/dist/api/function/v1beta1/marshalling.gen.js +0 -368
- package/dist/api/iam/index.js +0 -2
- package/dist/api/iam/v1alpha1/api.gen.js +0 -799
- package/dist/api/iam/v1alpha1/index.gen.js +0 -6
- package/dist/api/iam/v1alpha1/marshalling.gen.js +0 -373
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +0 -207
- package/dist/api/instance/index.js +0 -2
- package/dist/api/instance/v1/api.gen.js +0 -1003
- package/dist/api/instance/v1/api.utils.js +0 -369
- package/dist/api/instance/v1/content.gen.js +0 -31
- package/dist/api/instance/v1/index.js +0 -2
- package/dist/api/instance/v1/marshalling.gen.js +0 -1206
- package/dist/api/instance/v1/marshalling.utils.js +0 -63
- package/dist/api/iot/index.js +0 -2
- package/dist/api/iot/v1/api.gen.js +0 -581
- package/dist/api/iot/v1/content.gen.js +0 -7
- package/dist/api/iot/v1/index.gen.js +0 -5
- package/dist/api/iot/v1/marshalling.gen.js +0 -388
- package/dist/api/ipfs/index.js +0 -2
- package/dist/api/ipfs/v1alpha1/api.gen.js +0 -197
- package/dist/api/ipfs/v1alpha1/content.gen.js +0 -7
- package/dist/api/ipfs/v1alpha1/index.gen.js +0 -5
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +0 -121
- package/dist/api/k8s/index.js +0 -2
- package/dist/api/k8s/v1/api.gen.js +0 -454
- package/dist/api/k8s/v1/api.utils.js +0 -13
- package/dist/api/k8s/v1/content.gen.js +0 -13
- package/dist/api/k8s/v1/index.js +0 -4
- package/dist/api/k8s/v1/marshalling.gen.js +0 -333
- package/dist/api/k8s/v1/validation-rules.gen.js +0 -101
- package/dist/api/lb/index.js +0 -2
- package/dist/api/lb/v1/api.gen.js +0 -1669
- package/dist/api/lb/v1/api.utils.js +0 -81
- package/dist/api/lb/v1/content.gen.js +0 -16
- package/dist/api/lb/v1/index.js +0 -2
- package/dist/api/lb/v1/marshalling.gen.js +0 -923
- package/dist/api/marketplace/index.js +0 -4
- package/dist/api/marketplace/v1/api.gen.js +0 -60
- package/dist/api/marketplace/v1/index.gen.js +0 -4
- package/dist/api/marketplace/v1/marshalling.gen.js +0 -92
- package/dist/api/marketplace/v2/api.gen.js +0 -162
- package/dist/api/marketplace/v2/index.gen.js +0 -4
- package/dist/api/marketplace/v2/marshalling.gen.js +0 -94
- package/dist/api/mnq/index.js +0 -2
- package/dist/api/mnq/v1alpha1/api.gen.js +0 -205
- package/dist/api/mnq/v1alpha1/index.gen.js +0 -4
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +0 -121
- package/dist/api/rdb/index.js +0 -2
- package/dist/api/rdb/v1/api.gen.js +0 -972
- package/dist/api/rdb/v1/content.gen.js +0 -22
- package/dist/api/rdb/v1/index.gen.js +0 -7
- package/dist/api/rdb/v1/marshalling.gen.js +0 -636
- package/dist/api/rdb/v1/validation-rules.gen.js +0 -10
- package/dist/api/redis/index.js +0 -2
- package/dist/api/redis/v1/api.gen.js +0 -389
- package/dist/api/redis/v1/content.gen.js +0 -7
- package/dist/api/redis/v1/index.gen.js +0 -5
- package/dist/api/redis/v1/marshalling.gen.js +0 -259
- package/dist/api/registry/index.js +0 -2
- package/dist/api/registry/v1/api.gen.js +0 -252
- package/dist/api/registry/v1/content.gen.js +0 -13
- package/dist/api/registry/v1/index.gen.js +0 -5
- package/dist/api/registry/v1/marshalling.gen.js +0 -106
- package/dist/api/secret/index.js +0 -2
- package/dist/api/secret/v1alpha1/api.gen.js +0 -415
- package/dist/api/secret/v1alpha1/index.gen.js +0 -4
- package/dist/api/secret/v1alpha1/marshalling.gen.js +0 -143
- package/dist/api/tem/index.js +0 -2
- package/dist/api/tem/v1alpha1/api.gen.js +0 -229
- package/dist/api/tem/v1alpha1/content.gen.js +0 -10
- package/dist/api/tem/v1alpha1/index.gen.js +0 -5
- package/dist/api/tem/v1alpha1/marshalling.gen.js +0 -159
- package/dist/api/test/index.js +0 -2
- package/dist/api/test/v1/api.gen.js +0 -152
- package/dist/api/test/v1/content.gen.js +0 -7
- package/dist/api/test/v1/index.gen.js +0 -5
- package/dist/api/test/v1/marshalling.gen.js +0 -79
- package/dist/api/vpc/index.js +0 -4
- package/dist/api/vpc/v1/api.gen.js +0 -110
- package/dist/api/vpc/v1/index.gen.js +0 -4
- package/dist/api/vpc/v1/marshalling.gen.js +0 -44
- package/dist/api/vpc/v2/api.gen.js +0 -276
- package/dist/api/vpc/v2/index.gen.js +0 -4
- package/dist/api/vpc/v2/marshalling.gen.js +0 -135
- package/dist/api/vpcgw/index.js +0 -2
- package/dist/api/vpcgw/v1/api.gen.js +0 -669
- package/dist/api/vpcgw/v1/content.gen.js +0 -10
- package/dist/api/vpcgw/v1/index.gen.js +0 -5
- package/dist/api/vpcgw/v1/marshalling.gen.js +0 -336
- package/dist/api/webhosting/index.js +0 -2
- package/dist/api/webhosting/v1alpha1/api.gen.js +0 -210
- package/dist/api/webhosting/v1alpha1/content.gen.js +0 -7
- package/dist/api/webhosting/v1alpha1/index.gen.js +0 -7
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +0 -173
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +0 -23
- package/dist/helpers/is-browser.js +0 -5
- package/dist/helpers/is-response.js +0 -10
- package/dist/helpers/json.js +0 -11
- package/dist/helpers/marshalling.js +0 -130
- package/dist/index.cjs +0 -24364
- package/dist/index.d.ts +0 -27584
- package/dist/index.js +0 -69
- package/dist/internal/async/interval-retrier.js +0 -105
- package/dist/internal/async/sleep.js +0 -13
- package/dist/internal/interceptors/composer.js +0 -46
- package/dist/internal/interceptors/helpers.js +0 -32
- package/dist/internal/logger/console-logger.js +0 -38
- package/dist/internal/logger/index.js +0 -41
- package/dist/internal/logger/level-resolver.js +0 -13
- package/dist/internal/validations/string-validation.js +0 -38
- package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -13
- package/dist/scw/api.js +0 -12
- package/dist/scw/auth.js +0 -68
- package/dist/scw/client-ini-factory.js +0 -174
- package/dist/scw/client-ini-profile.js +0 -54
- package/dist/scw/client-settings.js +0 -78
- package/dist/scw/client.js +0 -98
- package/dist/scw/constants.js +0 -4
- package/dist/scw/custom-marshalling.js +0 -131
- package/dist/scw/errors/error-parser.js +0 -107
- package/dist/scw/errors/non-standard/invalid-request-mapper.js +0 -36
- package/dist/scw/errors/non-standard/unknown-resource-mapper.js +0 -27
- package/dist/scw/errors/scw-error.js +0 -66
- package/dist/scw/errors/standard/already-exists-error.js +0 -26
- package/dist/scw/errors/standard/denied-authentication-error.js +0 -52
- package/dist/scw/errors/standard/index.js +0 -13
- package/dist/scw/errors/standard/invalid-arguments-error.js +0 -67
- package/dist/scw/errors/standard/out-of-stock-error.js +0 -22
- package/dist/scw/errors/standard/permissions-denied-error.js +0 -48
- package/dist/scw/errors/standard/precondition-failed-error.js +0 -42
- package/dist/scw/errors/standard/quotas-exceeded-error.js +0 -68
- package/dist/scw/errors/standard/resource-expired-error.js +0 -26
- package/dist/scw/errors/standard/resource-locked-error.js +0 -25
- package/dist/scw/errors/standard/resource-not-found-error.js +0 -25
- package/dist/scw/errors/standard/too-many-requests-error.js +0 -70
- package/dist/scw/errors/standard/transient-state-error.js +0 -26
- package/dist/scw/errors/types.js +0 -23
- package/dist/scw/fetch/build-fetcher.js +0 -72
- package/dist/scw/fetch/http-dumper.js +0 -54
- package/dist/scw/fetch/http-interceptors.js +0 -99
- package/dist/scw/fetch/resource-paginator.js +0 -84
- package/dist/scw/fetch/response-parser.js +0 -72
- package/node_modules/@scaleway/random-name/.npmignore +0 -4
- package/node_modules/@scaleway/random-name/CHANGELOG.md +0 -129
- package/node_modules/@scaleway/random-name/LICENSE.md +0 -21
- package/node_modules/@scaleway/random-name/README.md +0 -26
- package/node_modules/@scaleway/random-name/dist/index.d.ts +0 -3
- package/node_modules/@scaleway/random-name/dist/index.js +0 -13
- 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 };
|
package/dist/api/ipfs/index.js
DELETED
|
@@ -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 };
|