@scaleway/sdk 0.1.0-beta.9 → 1.0.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/README.md +1 -1
- package/dist/api/account/index.js +2 -2
- package/dist/api/account/v2/api.gen.js +5 -18
- package/dist/api/account/v2/index.gen.js +3 -0
- package/dist/api/account/v2/marshalling.gen.js +0 -2
- package/dist/api/account/v2alpha1/api.gen.js +3 -13
- package/dist/api/account/v2alpha1/marshalling.gen.js +0 -5
- package/dist/api/applesilicon/index.js +2 -2
- package/dist/api/applesilicon/v1alpha1/api.gen.js +7 -27
- package/dist/api/applesilicon/v1alpha1/index.gen.js +4 -0
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +1 -14
- package/dist/api/baremetal/v1/api.gen.js +47 -49
- package/dist/api/baremetal/v1/api.utils.js +2 -10
- package/dist/api/baremetal/v1/content.gen.js +6 -3
- package/dist/api/baremetal/v1/index.js +4 -1
- package/dist/api/baremetal/v1/marshalling.gen.js +44 -45
- package/dist/api/baremetal/v1/validation-rules.gen.js +109 -0
- package/dist/api/container/index.js +2 -2
- package/dist/api/container/v1beta1/api.gen.js +5 -51
- package/dist/api/container/v1beta1/content.gen.js +4 -4
- package/dist/api/container/v1beta1/{index.js → index.gen.js} +3 -1
- package/dist/api/container/v1beta1/marshalling.gen.js +12 -26
- package/dist/api/domain/index.js +2 -2
- package/dist/api/domain/v2beta1/api.gen.js +55 -85
- package/dist/api/domain/v2beta1/content.gen.js +22 -1
- package/dist/api/domain/v2beta1/index.gen.js +4 -0
- package/dist/api/domain/v2beta1/marshalling.gen.js +47 -165
- package/dist/api/flexibleip/index.js +2 -2
- package/dist/api/flexibleip/v1alpha1/api.gen.js +5 -22
- package/dist/api/flexibleip/v1alpha1/content.gen.js +1 -1
- package/dist/api/flexibleip/v1alpha1/index.gen.js +6 -0
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -7
- package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +14 -0
- package/dist/api/function/index.js +2 -2
- package/dist/api/function/v1beta1/api.gen.js +54 -57
- package/dist/api/function/v1beta1/content.gen.js +8 -5
- package/dist/api/function/v1beta1/index.gen.js +4 -0
- package/dist/api/function/v1beta1/marshalling.gen.js +125 -33
- package/dist/api/iam/index.js +2 -2
- package/dist/api/iam/v1alpha1/api.gen.js +15 -62
- package/dist/api/iam/v1alpha1/index.gen.js +5 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.js +7 -29
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +184 -0
- package/dist/api/instance/v1/api.gen.js +38 -118
- package/dist/api/instance/v1/api.utils.js +59 -51
- package/dist/api/instance/v1/content.gen.js +7 -7
- package/dist/api/instance/v1/marshalling.gen.js +46 -168
- package/dist/api/instance/v1/marshalling.utils.js +63 -0
- package/dist/api/iot/index.js +2 -2
- package/dist/api/iot/v1/api.gen.js +5 -56
- package/dist/api/iot/v1/index.gen.js +4 -0
- package/dist/api/iot/v1/marshalling.gen.js +2 -51
- package/dist/api/k8s/index.js +2 -2
- package/dist/api/k8s/v1/api.gen.js +17 -43
- package/dist/api/k8s/v1/content.gen.js +2 -2
- package/dist/api/k8s/v1/index.gen.js +6 -0
- package/dist/api/k8s/v1/marshalling.gen.js +18 -36
- package/dist/api/k8s/v1/validation-rules.gen.js +92 -0
- package/dist/api/lb/v1/api.gen.js +8 -163
- package/dist/api/lb/v1/api.utils.js +3 -9
- package/dist/api/lb/v1/content.gen.js +3 -3
- package/dist/api/lb/v1/marshalling.gen.js +74 -101
- package/dist/api/marketplace/index.js +4 -2
- package/dist/api/marketplace/v1/api.gen.js +3 -13
- package/dist/api/marketplace/v1/index.gen.js +3 -0
- package/dist/api/marketplace/v1/marshalling.gen.js +0 -13
- package/dist/api/marketplace/v2/api.gen.js +85 -0
- package/dist/api/marketplace/v2/index.gen.js +3 -0
- package/dist/api/marketplace/v2/marshalling.gen.js +92 -0
- package/dist/api/mnq/index.js +2 -2
- package/dist/api/mnq/v1alpha1/api.gen.js +7 -25
- package/dist/api/mnq/v1alpha1/index.gen.js +3 -0
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +7 -46
- package/dist/api/rdb/index.js +2 -2
- package/dist/api/rdb/v1/api.gen.js +15 -89
- package/dist/api/rdb/v1/content.gen.js +10 -4
- package/dist/api/rdb/v1/index.gen.js +4 -0
- package/dist/api/rdb/v1/marshalling.gen.js +25 -81
- package/dist/api/redis/index.js +2 -2
- package/dist/api/redis/{v1alpha1 → v1}/api.gen.js +45 -77
- package/dist/api/redis/{v1alpha1 → v1}/content.gen.js +1 -1
- package/dist/api/redis/v1/index.gen.js +4 -0
- package/dist/api/redis/{v1alpha1 → v1}/marshalling.gen.js +42 -59
- package/dist/api/registry/index.js +2 -2
- package/dist/api/registry/v1/api.gen.js +5 -29
- package/dist/api/registry/v1/content.gen.js +2 -2
- package/dist/api/registry/v1/{index.js → index.gen.js} +3 -1
- package/dist/api/registry/v1/marshalling.gen.js +2 -8
- package/dist/api/secret/index.js +2 -0
- package/dist/api/secret/v1alpha1/api.gen.js +135 -0
- package/dist/api/secret/v1alpha1/index.gen.js +3 -0
- package/dist/api/secret/v1alpha1/marshalling.gen.js +82 -0
- package/dist/api/tem/index.js +2 -0
- package/dist/api/tem/v1alpha1/api.gen.js +109 -0
- package/dist/api/tem/v1alpha1/content.gen.js +10 -0
- package/dist/api/tem/v1alpha1/index.gen.js +4 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.js +132 -0
- package/dist/api/test/index.js +2 -2
- package/dist/api/test/v1/api.gen.js +6 -20
- package/dist/api/test/v1/index.gen.js +4 -0
- package/dist/api/test/v1/marshalling.gen.js +2 -5
- package/dist/api/vpc/index.js +2 -2
- package/dist/api/vpc/v1/api.gen.js +6 -17
- package/dist/api/vpc/v1/index.gen.js +3 -0
- package/dist/api/vpc/v1/marshalling.gen.js +1 -3
- package/dist/api/vpcgw/index.js +2 -2
- package/dist/api/vpcgw/v1/api.gen.js +5 -64
- package/dist/api/vpcgw/v1/content.gen.js +2 -2
- package/dist/api/vpcgw/v1/{index.js → index.gen.js} +3 -1
- package/dist/api/vpcgw/v1/marshalling.gen.js +3 -24
- package/dist/helpers/json.js +1 -2
- package/dist/helpers/marshalling.js +7 -20
- package/dist/index.cjs +3864 -2945
- package/dist/index.d.ts +7212 -4332
- package/dist/index.js +10 -6
- package/dist/internal/async/interval-retrier.js +10 -16
- package/dist/internal/interceptors/interceptor.js +3 -1
- package/dist/internal/interceptors/request.js +1 -3
- package/dist/internal/logger/console-logger.js +3 -5
- package/dist/internal/logger/index.js +3 -5
- package/dist/internal/logger/level-resolver.js +0 -3
- package/dist/internal/validations/string-validation.js +8 -10
- package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js +13 -0
- package/dist/scw/api.js +3 -4
- package/dist/scw/auth.js +3 -5
- package/dist/scw/client-ini-factory.js +32 -15
- package/dist/scw/client-ini-profile.js +10 -4
- package/dist/scw/client-settings.js +32 -15
- package/dist/scw/client.js +5 -6
- package/dist/scw/constants.js +1 -1
- package/dist/scw/custom-marshalling.js +8 -14
- package/dist/scw/errors/error-parser.js +2 -21
- package/dist/scw/errors/non-standard/invalid-request-mapper.js +17 -15
- package/dist/scw/errors/non-standard/unknown-resource-mapper.js +7 -6
- package/dist/scw/errors/scw-error.js +20 -20
- package/dist/scw/errors/standard/already-exists-error.js +3 -4
- package/dist/scw/errors/standard/denied-authentication-error.js +4 -11
- package/dist/scw/errors/standard/invalid-arguments-error.js +1 -10
- package/dist/scw/errors/standard/out-of-stock-error.js +0 -3
- package/dist/scw/errors/standard/permissions-denied-error.js +1 -4
- package/dist/scw/errors/standard/precondition-failed-error.js +4 -8
- package/dist/scw/errors/standard/quotas-exceeded-error.js +14 -14
- package/dist/scw/errors/standard/resource-expired-error.js +3 -4
- package/dist/scw/errors/standard/resource-locked-error.js +3 -4
- package/dist/scw/errors/standard/resource-not-found-error.js +3 -4
- package/dist/scw/errors/standard/too-many-requests-error.js +3 -16
- package/dist/scw/errors/standard/transient-state-error.js +3 -4
- package/dist/scw/errors/types.js +0 -3
- package/dist/scw/fetch/build-fetcher.js +1 -9
- package/dist/scw/fetch/http-dumper.js +4 -7
- package/dist/scw/fetch/http-interceptors.js +9 -12
- package/dist/scw/fetch/resource-paginator.js +18 -16
- package/dist/scw/fetch/response-parser.js +17 -23
- package/node_modules/@scaleway/random-name/CHANGELOG.md +42 -63
- package/node_modules/@scaleway/random-name/dist/index.js +5 -246
- package/node_modules/@scaleway/random-name/package.json +6 -5
- package/package.json +4 -5
- package/dist/api/account/v2/index.js +0 -1
- package/dist/api/applesilicon/v1alpha1/index.js +0 -2
- package/dist/api/domain/v2beta1/index.js +0 -2
- package/dist/api/flexibleip/v1alpha1/index.js +0 -2
- package/dist/api/function/v1beta1/index.js +0 -2
- package/dist/api/iam/v1alpha1/index.js +0 -1
- package/dist/api/iot/v1/index.js +0 -2
- package/dist/api/k8s/v1/index.js +0 -2
- package/dist/api/marketplace/v1/index.js +0 -1
- package/dist/api/mnq/v1alpha1/index.js +0 -1
- package/dist/api/rdb/v1/index.js +0 -2
- package/dist/api/redis/v1alpha1/index.js +0 -2
- package/dist/api/test/v1/index.js +0 -1
- package/dist/api/vpc/v1/index.js +0 -1
- package/dist/node_modules/.pnpm/@scaleway_random-name@3.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -254
- package/node_modules/@scaleway/random-name/dist/index.browser.js +0 -256
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { isJSONObject } from '../../../helpers/json.js';
|
|
2
|
+
import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
|
|
3
|
+
|
|
4
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
5
|
+
const unmarshalDomainStatistics = data => {
|
|
6
|
+
if (!isJSONObject(data)) {
|
|
7
|
+
throw new TypeError(`Unmarshalling the type 'DomainStatistics' failed as data isn't a dictionary.`);
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
canceledCount: data.canceled_count,
|
|
11
|
+
failedCount: data.failed_count,
|
|
12
|
+
sentCount: data.sent_count,
|
|
13
|
+
totalCount: data.total_count
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
const unmarshalEmailTry = data => {
|
|
17
|
+
if (!isJSONObject(data)) {
|
|
18
|
+
throw new TypeError(`Unmarshalling the type 'EmailTry' failed as data isn't a dictionary.`);
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
code: data.code,
|
|
22
|
+
message: data.message,
|
|
23
|
+
rank: data.rank,
|
|
24
|
+
triedAt: unmarshalDate(data.tried_at)
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
const unmarshalDomain = data => {
|
|
28
|
+
if (!isJSONObject(data)) {
|
|
29
|
+
throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`);
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
createdAt: unmarshalDate(data.created_at),
|
|
33
|
+
dkimConfig: data.dkim_config,
|
|
34
|
+
id: data.id,
|
|
35
|
+
lastError: data.last_error,
|
|
36
|
+
lastValidAt: unmarshalDate(data.last_valid_at),
|
|
37
|
+
name: data.name,
|
|
38
|
+
nextCheckAt: unmarshalDate(data.next_check_at),
|
|
39
|
+
organizationId: data.organization_id,
|
|
40
|
+
projectId: data.project_id,
|
|
41
|
+
region: data.region,
|
|
42
|
+
revokedAt: unmarshalDate(data.revoked_at),
|
|
43
|
+
spfConfig: data.spf_config,
|
|
44
|
+
statistics: data.statistics ? unmarshalDomainStatistics(data.statistics) : undefined,
|
|
45
|
+
status: data.status
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
const unmarshalEmail = data => {
|
|
49
|
+
if (!isJSONObject(data)) {
|
|
50
|
+
throw new TypeError(`Unmarshalling the type 'Email' failed as data isn't a dictionary.`);
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
createdAt: unmarshalDate(data.created_at),
|
|
54
|
+
id: data.id,
|
|
55
|
+
lastTries: unmarshalArrayOfObject(data.last_tries, unmarshalEmailTry),
|
|
56
|
+
mailFrom: data.mail_from,
|
|
57
|
+
messageId: data.message_id,
|
|
58
|
+
projectId: data.project_id,
|
|
59
|
+
rcptTo: data.rcpt_to,
|
|
60
|
+
rcptType: data.rcpt_type,
|
|
61
|
+
status: data.status,
|
|
62
|
+
statusDetails: data.status_details,
|
|
63
|
+
tryCount: data.try_count,
|
|
64
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
const unmarshalCreateEmailResponse = data => {
|
|
68
|
+
if (!isJSONObject(data)) {
|
|
69
|
+
throw new TypeError(`Unmarshalling the type 'CreateEmailResponse' failed as data isn't a dictionary.`);
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
emails: unmarshalArrayOfObject(data.emails, unmarshalEmail)
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
const unmarshalListDomainsResponse = data => {
|
|
76
|
+
if (!isJSONObject(data)) {
|
|
77
|
+
throw new TypeError(`Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`);
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
domains: unmarshalArrayOfObject(data.domains, unmarshalDomain),
|
|
81
|
+
totalCount: data.total_count
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
const unmarshalListEmailsResponse = data => {
|
|
85
|
+
if (!isJSONObject(data)) {
|
|
86
|
+
throw new TypeError(`Unmarshalling the type 'ListEmailsResponse' failed as data isn't a dictionary.`);
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
emails: unmarshalArrayOfObject(data.emails, unmarshalEmail),
|
|
90
|
+
totalCount: data.total_count
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
const unmarshalStatistics = data => {
|
|
94
|
+
if (!isJSONObject(data)) {
|
|
95
|
+
throw new TypeError(`Unmarshalling the type 'Statistics' failed as data isn't a dictionary.`);
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
canceledCount: data.canceled_count,
|
|
99
|
+
failedCount: data.failed_count,
|
|
100
|
+
newCount: data.new_count,
|
|
101
|
+
sendingCount: data.sending_count,
|
|
102
|
+
sentCount: data.sent_count,
|
|
103
|
+
totalCount: data.total_count
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
const marshalCreateEmailRequestAddress = (request, defaults) => ({
|
|
107
|
+
email: request.email,
|
|
108
|
+
name: request.name
|
|
109
|
+
});
|
|
110
|
+
const marshalCreateEmailRequestAttachment = (request, defaults) => ({
|
|
111
|
+
content: request.content,
|
|
112
|
+
name: request.name,
|
|
113
|
+
type: request.type
|
|
114
|
+
});
|
|
115
|
+
const marshalCreateDomainRequest = (request, defaults) => ({
|
|
116
|
+
domain_name: request.domainName,
|
|
117
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
118
|
+
});
|
|
119
|
+
const marshalCreateEmailRequest = (request, defaults) => ({
|
|
120
|
+
attachments: request.attachments ? request.attachments.map(elt => marshalCreateEmailRequestAttachment(elt)) : undefined,
|
|
121
|
+
bcc: request.bcc ? request.bcc.map(elt => marshalCreateEmailRequestAddress(elt)) : undefined,
|
|
122
|
+
cc: request.cc ? request.cc.map(elt => marshalCreateEmailRequestAddress(elt)) : undefined,
|
|
123
|
+
from: request.from ? marshalCreateEmailRequestAddress(request.from) : undefined,
|
|
124
|
+
html: request.html,
|
|
125
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
126
|
+
send_before: request.sendBefore,
|
|
127
|
+
subject: request.subject,
|
|
128
|
+
text: request.text,
|
|
129
|
+
to: request.to ? request.to.map(elt => marshalCreateEmailRequestAddress(elt)) : undefined
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
export { marshalCreateDomainRequest, marshalCreateEmailRequest, unmarshalCreateEmailResponse, unmarshalDomain, unmarshalEmail, unmarshalListDomainsResponse, unmarshalListEmailsResponse, unmarshalStatistics };
|
package/dist/api/test/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
export {
|
|
1
|
+
import * as index_gen from './v1/index.gen.js';
|
|
2
|
+
export { index_gen as v1 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { waitForResource } from '../../../internal/async/interval-retrier.js';
|
|
2
|
-
import { API } from '../../../scw/api.js';
|
|
2
|
+
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 { HUMAN_TRANSIENT_STATUSES } from './content.gen.js';
|
|
@@ -9,6 +9,7 @@ import { marshalRegisterRequest, unmarshalRegisterResponse, unmarshalListHumansR
|
|
|
9
9
|
const jsonContentHeaders = {
|
|
10
10
|
'Content-Type': 'application/json; charset=utf-8'
|
|
11
11
|
};
|
|
12
|
+
|
|
12
13
|
/**
|
|
13
14
|
* Fake API.
|
|
14
15
|
*
|
|
@@ -16,85 +17,71 @@ const jsonContentHeaders = {
|
|
|
16
17
|
* internal and public end-to-end tests.
|
|
17
18
|
*
|
|
18
19
|
* This service don't use the Scaleway authentication service but a fake one. It
|
|
19
|
-
* allows to use this test service publicly without requiring a Scaleway
|
|
20
|
+
* allows to use this test service publicly without requiring a Scaleway
|
|
21
|
+
* account.
|
|
20
22
|
*
|
|
21
23
|
* First, you need to register a user with `scw test human register` to get an
|
|
22
24
|
* access-key. Then, you can use other test commands by setting the
|
|
23
25
|
* SCW_SECRET_KEY env variable.
|
|
24
26
|
*/
|
|
25
|
-
|
|
26
|
-
class TestV1GenAPI extends API {
|
|
27
|
+
class API extends API$1 {
|
|
27
28
|
constructor() {
|
|
28
29
|
var _this;
|
|
29
|
-
|
|
30
30
|
super(...arguments);
|
|
31
31
|
_this = this;
|
|
32
|
-
|
|
33
32
|
this.register = request => this.client.fetch({
|
|
34
33
|
body: JSON.stringify(marshalRegisterRequest(request, this.client.settings)),
|
|
35
34
|
headers: jsonContentHeaders,
|
|
36
35
|
method: 'POST',
|
|
37
36
|
path: `/test/v1/register`
|
|
38
37
|
}, unmarshalRegisterResponse);
|
|
39
|
-
|
|
40
38
|
this.pageOfListHumans = function (request) {
|
|
41
39
|
if (request === void 0) {
|
|
42
40
|
request = {};
|
|
43
41
|
}
|
|
44
|
-
|
|
45
42
|
return _this.client.fetch({
|
|
46
43
|
method: 'GET',
|
|
47
44
|
path: `/test/v1/humans`,
|
|
48
45
|
urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId])
|
|
49
46
|
}, unmarshalListHumansResponse);
|
|
50
47
|
};
|
|
51
|
-
|
|
52
48
|
this.listHumans = function (request) {
|
|
53
49
|
if (request === void 0) {
|
|
54
50
|
request = {};
|
|
55
51
|
}
|
|
56
|
-
|
|
57
52
|
return enrichForPagination('humans', _this.pageOfListHumans, request);
|
|
58
53
|
};
|
|
59
|
-
|
|
60
54
|
this.getHuman = request => this.client.fetch({
|
|
61
55
|
method: 'GET',
|
|
62
56
|
path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}`
|
|
63
57
|
}, unmarshalHuman);
|
|
64
|
-
|
|
65
58
|
this.waitForHuman = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!HUMAN_TRANSIENT_STATUSES.includes(res.status))), this.getHuman, request, options);
|
|
66
|
-
|
|
67
59
|
this.createHuman = request => this.client.fetch({
|
|
68
60
|
body: JSON.stringify(marshalCreateHumanRequest(request, this.client.settings)),
|
|
69
61
|
headers: jsonContentHeaders,
|
|
70
62
|
method: 'POST',
|
|
71
63
|
path: `/test/v1/humans`
|
|
72
64
|
}, unmarshalHuman);
|
|
73
|
-
|
|
74
65
|
this.updateHuman = request => this.client.fetch({
|
|
75
66
|
body: JSON.stringify(marshalUpdateHumanRequest(request, this.client.settings)),
|
|
76
67
|
headers: jsonContentHeaders,
|
|
77
68
|
method: 'PATCH',
|
|
78
69
|
path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}`
|
|
79
70
|
}, unmarshalHuman);
|
|
80
|
-
|
|
81
71
|
this.deleteHuman = request => this.client.fetch({
|
|
82
72
|
method: 'DELETE',
|
|
83
73
|
path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}`
|
|
84
74
|
}, unmarshalHuman);
|
|
85
|
-
|
|
86
75
|
this.runHuman = request => this.client.fetch({
|
|
87
76
|
body: '{}',
|
|
88
77
|
headers: jsonContentHeaders,
|
|
89
78
|
method: 'POST',
|
|
90
79
|
path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}/run`
|
|
91
80
|
}, unmarshalHuman);
|
|
92
|
-
|
|
93
81
|
this.smokeHuman = function (request) {
|
|
94
82
|
if (request === void 0) {
|
|
95
83
|
request = {};
|
|
96
84
|
}
|
|
97
|
-
|
|
98
85
|
return _this.client.fetch({
|
|
99
86
|
body: '{}',
|
|
100
87
|
headers: jsonContentHeaders,
|
|
@@ -103,7 +90,6 @@ class TestV1GenAPI extends API {
|
|
|
103
90
|
}, unmarshalHuman);
|
|
104
91
|
};
|
|
105
92
|
}
|
|
106
|
-
|
|
107
93
|
}
|
|
108
94
|
|
|
109
|
-
export {
|
|
95
|
+
export { API };
|
|
@@ -6,7 +6,6 @@ const unmarshalHuman = data => {
|
|
|
6
6
|
if (!isJSONObject(data)) {
|
|
7
7
|
throw new TypeError(`Unmarshalling the type 'Human' failed as data isn't a dictionary.`);
|
|
8
8
|
}
|
|
9
|
-
|
|
10
9
|
return {
|
|
11
10
|
altitudeInMeter: data.altitude_in_meter,
|
|
12
11
|
altitudeInMillimeter: data.altitude_in_millimeter,
|
|
@@ -29,7 +28,6 @@ const unmarshalListHumansResponse = data => {
|
|
|
29
28
|
if (!isJSONObject(data)) {
|
|
30
29
|
throw new TypeError(`Unmarshalling the type 'ListHumansResponse' failed as data isn't a dictionary.`);
|
|
31
30
|
}
|
|
32
|
-
|
|
33
31
|
return {
|
|
34
32
|
humans: unmarshalArrayOfObject(data.humans, unmarshalHuman),
|
|
35
33
|
totalCount: data.total_count
|
|
@@ -39,7 +37,6 @@ const unmarshalRegisterResponse = data => {
|
|
|
39
37
|
if (!isJSONObject(data)) {
|
|
40
38
|
throw new TypeError(`Unmarshalling the type 'RegisterResponse' failed as data isn't a dictionary.`);
|
|
41
39
|
}
|
|
42
|
-
|
|
43
40
|
return {
|
|
44
41
|
accessKey: data.access_key,
|
|
45
42
|
secretKey: data.secret_key
|
|
@@ -48,7 +45,7 @@ const unmarshalRegisterResponse = data => {
|
|
|
48
45
|
const marshalCreateHumanRequest = (request, defaults) => ({
|
|
49
46
|
altitude_in_meter: request.altitudeInMeter,
|
|
50
47
|
altitude_in_millimeter: request.altitudeInMillimeter,
|
|
51
|
-
eyes_color: request.eyesColor,
|
|
48
|
+
eyes_color: request.eyesColor ?? 'unknown',
|
|
52
49
|
fingers_count: request.fingersCount,
|
|
53
50
|
hair_count: request.hairCount,
|
|
54
51
|
height: request.height,
|
|
@@ -71,7 +68,7 @@ const marshalRegisterRequest = (request, defaults) => ({
|
|
|
71
68
|
const marshalUpdateHumanRequest = (request, defaults) => ({
|
|
72
69
|
altitude_in_meter: request.altitudeInMeter,
|
|
73
70
|
altitude_in_millimeter: request.altitudeInMillimeter,
|
|
74
|
-
eyes_color: request.eyesColor,
|
|
71
|
+
eyes_color: request.eyesColor ?? 'unknown',
|
|
75
72
|
fingers_count: request.fingersCount,
|
|
76
73
|
hair_count: request.hairCount,
|
|
77
74
|
height: request.height,
|
package/dist/api/vpc/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
export {
|
|
1
|
+
import * as index_gen from './v1/index.gen.js';
|
|
2
|
+
export { index_gen as v1 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { API } from '../../../scw/api.js';
|
|
1
|
+
import { API as API$1 } from '../../../scw/api.js';
|
|
2
2
|
import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
|
|
3
3
|
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
4
4
|
import { unmarshalListPrivateNetworksResponse, marshalCreatePrivateNetworkRequest, unmarshalPrivateNetwork, marshalUpdatePrivateNetworkRequest } from './marshalling.gen.js';
|
|
@@ -7,40 +7,33 @@ import { unmarshalListPrivateNetworksResponse, marshalCreatePrivateNetworkReques
|
|
|
7
7
|
const jsonContentHeaders = {
|
|
8
8
|
'Content-Type': 'application/json; charset=utf-8'
|
|
9
9
|
};
|
|
10
|
-
/** VPC API. */
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
/** VPC API. */
|
|
12
|
+
class API extends API$1 {
|
|
13
13
|
constructor() {
|
|
14
14
|
var _this;
|
|
15
|
-
|
|
16
15
|
super(...arguments);
|
|
17
16
|
_this = this;
|
|
18
|
-
|
|
19
17
|
this.pageOfListPrivateNetworks = function (request) {
|
|
20
18
|
if (request === void 0) {
|
|
21
19
|
request = {};
|
|
22
20
|
}
|
|
23
|
-
|
|
24
21
|
return _this.client.fetch({
|
|
25
22
|
method: 'GET',
|
|
26
23
|
path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/private-networks`,
|
|
27
|
-
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId], ['tags', request.tags])
|
|
24
|
+
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['private_network_ids', request.privateNetworkIds], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId], ['tags', request.tags])
|
|
28
25
|
}, unmarshalListPrivateNetworksResponse);
|
|
29
26
|
};
|
|
30
|
-
|
|
31
27
|
this.listPrivateNetworks = function (request) {
|
|
32
28
|
if (request === void 0) {
|
|
33
29
|
request = {};
|
|
34
30
|
}
|
|
35
|
-
|
|
36
31
|
return enrichForPagination('privateNetworks', _this.pageOfListPrivateNetworks, request);
|
|
37
32
|
};
|
|
38
|
-
|
|
39
33
|
this.createPrivateNetwork = function (request) {
|
|
40
34
|
if (request === void 0) {
|
|
41
35
|
request = {};
|
|
42
36
|
}
|
|
43
|
-
|
|
44
37
|
return _this.client.fetch({
|
|
45
38
|
body: JSON.stringify(marshalCreatePrivateNetworkRequest(request, _this.client.settings)),
|
|
46
39
|
headers: jsonContentHeaders,
|
|
@@ -48,26 +41,22 @@ class VpcV1GenAPI extends API {
|
|
|
48
41
|
path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/private-networks`
|
|
49
42
|
}, unmarshalPrivateNetwork);
|
|
50
43
|
};
|
|
51
|
-
|
|
52
44
|
this.getPrivateNetwork = request => this.client.fetch({
|
|
53
45
|
method: 'GET',
|
|
54
46
|
path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`
|
|
55
47
|
}, unmarshalPrivateNetwork);
|
|
56
|
-
|
|
57
48
|
this.updatePrivateNetwork = request => this.client.fetch({
|
|
58
49
|
body: JSON.stringify(marshalUpdatePrivateNetworkRequest(request, this.client.settings)),
|
|
59
50
|
headers: jsonContentHeaders,
|
|
60
51
|
method: 'PATCH',
|
|
61
52
|
path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`
|
|
62
53
|
}, unmarshalPrivateNetwork);
|
|
63
|
-
|
|
64
54
|
this.deletePrivateNetwork = request => this.client.fetch({
|
|
65
55
|
method: 'DELETE',
|
|
66
56
|
path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`
|
|
67
57
|
});
|
|
68
58
|
}
|
|
69
|
-
|
|
70
59
|
}
|
|
71
|
-
|
|
60
|
+
API.LOCALITIES = ['fr-par-1', 'fr-par-2', 'fr-par-3', 'nl-ams-1', 'nl-ams-2', 'pl-waw-1', 'pl-waw-2'];
|
|
72
61
|
|
|
73
|
-
export {
|
|
62
|
+
export { API };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@
|
|
1
|
+
import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
|
|
2
2
|
import { isJSONObject } from '../../../helpers/json.js';
|
|
3
3
|
import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
|
|
4
4
|
|
|
@@ -7,7 +7,6 @@ const unmarshalPrivateNetwork = data => {
|
|
|
7
7
|
if (!isJSONObject(data)) {
|
|
8
8
|
throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`);
|
|
9
9
|
}
|
|
10
|
-
|
|
11
10
|
return {
|
|
12
11
|
createdAt: unmarshalDate(data.created_at),
|
|
13
12
|
id: data.id,
|
|
@@ -24,7 +23,6 @@ const unmarshalListPrivateNetworksResponse = data => {
|
|
|
24
23
|
if (!isJSONObject(data)) {
|
|
25
24
|
throw new TypeError(`Unmarshalling the type 'ListPrivateNetworksResponse' failed as data isn't a dictionary.`);
|
|
26
25
|
}
|
|
27
|
-
|
|
28
26
|
return {
|
|
29
27
|
privateNetworks: unmarshalArrayOfObject(data.private_networks, unmarshalPrivateNetwork),
|
|
30
28
|
totalCount: data.total_count
|
package/dist/api/vpcgw/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
export {
|
|
1
|
+
import * as index_gen from './v1/index.gen.js';
|
|
2
|
+
export { index_gen as v1 };
|