@scaleway/sdk 1.4.0 → 1.5.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/account/index.js +0 -2
- package/dist/api/baremetal/index.js +2 -2
- package/dist/api/billing/index.js +2 -0
- package/dist/api/billing/v2alpha1/api.gen.js +52 -0
- package/dist/api/billing/v2alpha1/index.gen.js +3 -0
- package/dist/api/billing/v2alpha1/marshalling.gen.js +52 -0
- package/dist/api/cockpit/v1beta1/api.gen.js +11 -6
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +2 -1
- package/dist/api/flexibleip/v1alpha1/api.gen.js +7 -0
- package/dist/api/function/v1beta1/marshalling.gen.js +3 -0
- package/dist/api/iam/v1alpha1/api.gen.js +7 -0
- package/dist/api/instance/index.js +2 -2
- package/dist/api/k8s/index.js +2 -2
- package/dist/api/k8s/v1/api.gen.js +13 -1
- package/dist/api/k8s/v1/marshalling.gen.js +6 -1
- package/dist/api/lb/index.js +2 -2
- package/dist/api/rdb/v1/api.gen.js +10 -10
- package/dist/api/redis/v1/api.gen.js +88 -26
- package/dist/api/secret/v1alpha1/api.gen.js +43 -19
- package/dist/api/tem/v1alpha1/api.gen.js +25 -13
- package/dist/api/webhosting/v1alpha1/api.gen.js +3 -2
- package/dist/helpers/is-response.js +10 -0
- package/dist/index.cjs +350 -246
- package/dist/index.d.ts +775 -602
- package/dist/index.js +44 -42
- package/dist/scw/constants.js +1 -1
- package/dist/scw/fetch/response-parser.js +2 -1
- package/package.json +2 -2
- package/dist/api/account/v2alpha1/api.gen.js +0 -85
- package/dist/api/account/v2alpha1/index.js +0 -1
- package/dist/api/account/v2alpha1/marshalling.gen.js +0 -57
|
@@ -9,10 +9,10 @@ const jsonContentHeaders = {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* Secret API
|
|
12
|
+
* Secret Manager API documentation.
|
|
13
13
|
*
|
|
14
14
|
* This API allows you to conveniently store, access and share sensitive data.
|
|
15
|
-
* Secret API
|
|
15
|
+
* Secret Manager API documentation.
|
|
16
16
|
*/
|
|
17
17
|
class API extends API$1 {
|
|
18
18
|
constructor() {
|
|
@@ -20,7 +20,7 @@ class API extends API$1 {
|
|
|
20
20
|
super(...arguments);
|
|
21
21
|
_this = this;
|
|
22
22
|
/**
|
|
23
|
-
* Create a
|
|
23
|
+
* Create a secret. You must sepcify the `region` to create a secret.
|
|
24
24
|
*
|
|
25
25
|
* @param request - The request {@link CreateSecretRequest}
|
|
26
26
|
* @returns A Promise of Secret
|
|
@@ -32,7 +32,8 @@ class API extends API$1 {
|
|
|
32
32
|
path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets`
|
|
33
33
|
}, unmarshalSecret);
|
|
34
34
|
/**
|
|
35
|
-
* Get metadata of a
|
|
35
|
+
* Get metadata using the secret's name. Retrieve the metadata of a secret
|
|
36
|
+
* specified by the `region` and the `secret_name` parameters.
|
|
36
37
|
*
|
|
37
38
|
* @param request - The request {@link GetSecretRequest}
|
|
38
39
|
* @returns A Promise of Secret
|
|
@@ -42,7 +43,8 @@ class API extends API$1 {
|
|
|
42
43
|
path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`
|
|
43
44
|
}, unmarshalSecret);
|
|
44
45
|
/**
|
|
45
|
-
* Get metadata of a
|
|
46
|
+
* Get metadata using the secret's ID. Retrieve the metadata of a secret
|
|
47
|
+
* specified by the `region` and the `secret_id` parameters.
|
|
46
48
|
*
|
|
47
49
|
* @param request - The request {@link GetSecretByNameRequest}
|
|
48
50
|
* @returns A Promise of Secret
|
|
@@ -52,7 +54,9 @@ class API extends API$1 {
|
|
|
52
54
|
path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${validatePathParam('secretName', request.secretName)}`
|
|
53
55
|
}, unmarshalSecret);
|
|
54
56
|
/**
|
|
55
|
-
* Update metadata of a
|
|
57
|
+
* Update metadata of a secret. Edit a secret's metadata such as name, tag(s)
|
|
58
|
+
* and description. The secret to update is specified by the `secret_id` and
|
|
59
|
+
* `region` parameters.
|
|
56
60
|
*
|
|
57
61
|
* @param request - The request {@link UpdateSecretRequest}
|
|
58
62
|
* @returns A Promise of Secret
|
|
@@ -74,7 +78,9 @@ class API extends API$1 {
|
|
|
74
78
|
}, unmarshalListSecretsResponse);
|
|
75
79
|
};
|
|
76
80
|
/**
|
|
77
|
-
* List
|
|
81
|
+
* List secrets. Retrieve the list of secrets created within an Organization
|
|
82
|
+
* and/or Project. You must specify either the `organization_id` or the
|
|
83
|
+
* `project_id` and the `region`.
|
|
78
84
|
*
|
|
79
85
|
* @param request - The request {@link ListSecretsRequest}
|
|
80
86
|
* @returns A Promise of ListSecretsResponse
|
|
@@ -86,7 +92,8 @@ class API extends API$1 {
|
|
|
86
92
|
return enrichForPagination('secrets', _this.pageOfListSecrets, request);
|
|
87
93
|
};
|
|
88
94
|
/**
|
|
89
|
-
* Delete a secret.
|
|
95
|
+
* Delete a secret. Delete a given secret specified by the `region` and
|
|
96
|
+
* `secret_id` parameters.
|
|
90
97
|
*
|
|
91
98
|
* @param request - The request {@link DeleteSecretRequest}
|
|
92
99
|
*/
|
|
@@ -95,7 +102,8 @@ class API extends API$1 {
|
|
|
95
102
|
path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`
|
|
96
103
|
});
|
|
97
104
|
/**
|
|
98
|
-
* Create a
|
|
105
|
+
* Create a version. Create a version of a given secret specified by the
|
|
106
|
+
* `region` and `secret_id` parameters.
|
|
99
107
|
*
|
|
100
108
|
* @param request - The request {@link CreateSecretVersionRequest}
|
|
101
109
|
* @returns A Promise of SecretVersion
|
|
@@ -107,7 +115,9 @@ class API extends API$1 {
|
|
|
107
115
|
path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions`
|
|
108
116
|
}, unmarshalSecretVersion);
|
|
109
117
|
/**
|
|
110
|
-
* Get metadata of a
|
|
118
|
+
* Get metadata of a secret's version using the secret's ID. Retrieve the
|
|
119
|
+
* metadata of a secret's given version specified by the `region`, `secret_id`
|
|
120
|
+
* and `revision` parameters.
|
|
111
121
|
*
|
|
112
122
|
* @param request - The request {@link GetSecretVersionRequest}
|
|
113
123
|
* @returns A Promise of SecretVersion
|
|
@@ -117,7 +127,9 @@ class API extends API$1 {
|
|
|
117
127
|
path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}`
|
|
118
128
|
}, unmarshalSecretVersion);
|
|
119
129
|
/**
|
|
120
|
-
* Get metadata of a
|
|
130
|
+
* Get metadata of a secret's version using the secret's name. Retrieve the
|
|
131
|
+
* metadata of a secret's given version specified by the `region`,
|
|
132
|
+
* `secret_name` and `revision` parameters.
|
|
121
133
|
*
|
|
122
134
|
* @param request - The request {@link GetSecretVersionByNameRequest}
|
|
123
135
|
* @returns A Promise of SecretVersion
|
|
@@ -127,7 +139,8 @@ class API extends API$1 {
|
|
|
127
139
|
path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${validatePathParam('secretName', request.secretName)}/versions/${validatePathParam('revision', request.revision)}`
|
|
128
140
|
}, unmarshalSecretVersion);
|
|
129
141
|
/**
|
|
130
|
-
* Update metadata of a
|
|
142
|
+
* Update metadata of a version. Edit the metadata of a secret's given
|
|
143
|
+
* version, specified by the `region`, `secret_id` and `revision` parameters.
|
|
131
144
|
*
|
|
132
145
|
* @param request - The request {@link UpdateSecretVersionRequest}
|
|
133
146
|
* @returns A Promise of SecretVersion
|
|
@@ -144,7 +157,9 @@ class API extends API$1 {
|
|
|
144
157
|
urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['status', request.status])
|
|
145
158
|
}, unmarshalListSecretVersionsResponse);
|
|
146
159
|
/**
|
|
147
|
-
* List versions of a secret
|
|
160
|
+
* List versions of a secret using the secret's ID. Retrieve the list of a
|
|
161
|
+
* given secret's versions specified by the `secret_id` and `region`
|
|
162
|
+
* parameters.
|
|
148
163
|
*
|
|
149
164
|
* @param request - The request {@link ListSecretVersionsRequest}
|
|
150
165
|
* @returns A Promise of ListSecretVersionsResponse
|
|
@@ -156,14 +171,17 @@ class API extends API$1 {
|
|
|
156
171
|
urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['status', request.status])
|
|
157
172
|
}, unmarshalListSecretVersionsResponse);
|
|
158
173
|
/**
|
|
159
|
-
* List versions of a secret
|
|
174
|
+
* List versions of a secret using the secret's name. Retrieve the list of a
|
|
175
|
+
* given secret's versions specified by the `secret_name` and `region`
|
|
176
|
+
* parameters.
|
|
160
177
|
*
|
|
161
178
|
* @param request - The request {@link ListSecretVersionsByNameRequest}
|
|
162
179
|
* @returns A Promise of ListSecretVersionsResponse
|
|
163
180
|
*/
|
|
164
181
|
this.listSecretVersionsByName = request => enrichForPagination('versions', this.pageOfListSecretVersionsByName, request);
|
|
165
182
|
/**
|
|
166
|
-
*
|
|
183
|
+
* Delete a version. Delete a secret's version and the sensitive data
|
|
184
|
+
* contained in it. Deleting a version is permanent and cannot be undone.
|
|
167
185
|
*
|
|
168
186
|
* @param request - The request {@link DestroySecretVersionRequest}
|
|
169
187
|
* @returns A Promise of SecretVersion
|
|
@@ -175,7 +193,8 @@ class API extends API$1 {
|
|
|
175
193
|
path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/destroy`
|
|
176
194
|
}, unmarshalSecretVersion);
|
|
177
195
|
/**
|
|
178
|
-
* Enable a
|
|
196
|
+
* Enable a version. Make a specific version accessible. You must specify the
|
|
197
|
+
* `region`, `secret_id` and `revision` parameters.
|
|
179
198
|
*
|
|
180
199
|
* @param request - The request {@link EnableSecretVersionRequest}
|
|
181
200
|
* @returns A Promise of SecretVersion
|
|
@@ -187,7 +206,8 @@ class API extends API$1 {
|
|
|
187
206
|
path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/enable`
|
|
188
207
|
}, unmarshalSecretVersion);
|
|
189
208
|
/**
|
|
190
|
-
* Disable a
|
|
209
|
+
* Disable a version. Make a specific version inaccessible. You must specify
|
|
210
|
+
* the `region`, `secret_id` and `revision` parameters.
|
|
191
211
|
*
|
|
192
212
|
* @param request - The request {@link DisableSecretVersionRequest}
|
|
193
213
|
* @returns A Promise of SecretVersion
|
|
@@ -199,7 +219,9 @@ class API extends API$1 {
|
|
|
199
219
|
path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/disable`
|
|
200
220
|
}, unmarshalSecretVersion);
|
|
201
221
|
/**
|
|
202
|
-
* Access a
|
|
222
|
+
* Access a secret's version using the secret's ID. Access sensitive data in a
|
|
223
|
+
* secret's version specified by the `region`, `secret_id` and `revision`
|
|
224
|
+
* parameters.
|
|
203
225
|
*
|
|
204
226
|
* @param request - The request {@link AccessSecretVersionRequest}
|
|
205
227
|
* @returns A Promise of AccessSecretVersionResponse
|
|
@@ -209,7 +231,9 @@ class API extends API$1 {
|
|
|
209
231
|
path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/access`
|
|
210
232
|
}, unmarshalAccessSecretVersionResponse);
|
|
211
233
|
/**
|
|
212
|
-
* Access a
|
|
234
|
+
* Access a secret's version using the secret's name. Access sensitive data in
|
|
235
|
+
* a secret's version specified by the `region`, `secret_name` and `revision`
|
|
236
|
+
* parameters.
|
|
213
237
|
*
|
|
214
238
|
* @param request - The request {@link AccessSecretVersionByNameRequest}
|
|
215
239
|
* @returns A Promise of AccessSecretVersionResponse
|
|
@@ -11,9 +11,9 @@ const jsonContentHeaders = {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Transactional Email API.
|
|
14
|
+
* Transactional Email API documentation.
|
|
15
15
|
*
|
|
16
|
-
* Tem. Transactional Email API.
|
|
16
|
+
* Tem. Transactional Email API documentation.
|
|
17
17
|
*/
|
|
18
18
|
class API extends API$1 {
|
|
19
19
|
constructor() {
|
|
@@ -21,7 +21,10 @@ class API extends API$1 {
|
|
|
21
21
|
super(...arguments);
|
|
22
22
|
_this = this;
|
|
23
23
|
/**
|
|
24
|
-
* Send an email.
|
|
24
|
+
* Send an email. You must specify the `region`, the sender and the
|
|
25
|
+
* recipient's information and the `project_id` to send an email from a
|
|
26
|
+
* checked domain. The subject of the email must contain at least 6
|
|
27
|
+
* characters.
|
|
25
28
|
*
|
|
26
29
|
* @param request - The request {@link CreateEmailRequest}
|
|
27
30
|
* @returns A Promise of CreateEmailResponse
|
|
@@ -33,7 +36,8 @@ class API extends API$1 {
|
|
|
33
36
|
path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/emails`
|
|
34
37
|
}, unmarshalCreateEmailResponse);
|
|
35
38
|
/**
|
|
36
|
-
* Get information about
|
|
39
|
+
* Get an email. Retrieve information about a specific email using the
|
|
40
|
+
* `email_id` and `region` parameters.
|
|
37
41
|
*
|
|
38
42
|
* @param request - The request {@link GetEmailRequest}
|
|
39
43
|
* @returns A Promise of Email
|
|
@@ -61,8 +65,8 @@ class API extends API$1 {
|
|
|
61
65
|
}, unmarshalListEmailsResponse);
|
|
62
66
|
};
|
|
63
67
|
/**
|
|
64
|
-
* List emails
|
|
65
|
-
*
|
|
68
|
+
* List emails. Retrieve the list of emails sent from a specific domain or for
|
|
69
|
+
* a specific Project or Organization. You must specify the `region`.
|
|
66
70
|
*
|
|
67
71
|
* @param request - The request {@link ListEmailsRequest}
|
|
68
72
|
* @returns A Promise of ListEmailsResponse
|
|
@@ -74,7 +78,7 @@ class API extends API$1 {
|
|
|
74
78
|
return enrichForPagination('emails', _this.pageOfListEmails, request);
|
|
75
79
|
};
|
|
76
80
|
/**
|
|
77
|
-
* Get
|
|
81
|
+
* Email statuses. Get information on your emails' statuses.
|
|
78
82
|
*
|
|
79
83
|
* @param request - The request {@link GetStatisticsRequest}
|
|
80
84
|
* @returns A Promise of Statistics
|
|
@@ -90,7 +94,9 @@ class API extends API$1 {
|
|
|
90
94
|
}, unmarshalStatistics);
|
|
91
95
|
};
|
|
92
96
|
/**
|
|
93
|
-
*
|
|
97
|
+
* Cancel an email. You can cancel the sending of an email if it has not been
|
|
98
|
+
* sent yet. You must specify the `region` and the `email_id` of the email you
|
|
99
|
+
* want to cancel.
|
|
94
100
|
*
|
|
95
101
|
* @param request - The request {@link CancelEmailRequest}
|
|
96
102
|
* @returns A Promise of Email
|
|
@@ -102,7 +108,8 @@ class API extends API$1 {
|
|
|
102
108
|
path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/emails/${validatePathParam('emailId', request.emailId)}/cancel`
|
|
103
109
|
}, unmarshalEmail);
|
|
104
110
|
/**
|
|
105
|
-
* Register a domain in a project.
|
|
111
|
+
* Register a domain in a project. You must specify the `region`, `project_id`
|
|
112
|
+
* and `domain_name` to register a domain in a specific Project.
|
|
106
113
|
*
|
|
107
114
|
* @param request - The request {@link CreateDomainRequest}
|
|
108
115
|
* @returns A Promise of Domain
|
|
@@ -114,7 +121,8 @@ class API extends API$1 {
|
|
|
114
121
|
path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains`
|
|
115
122
|
}, unmarshalDomain);
|
|
116
123
|
/**
|
|
117
|
-
* Get information about a domain.
|
|
124
|
+
* Get information about a domain. Retrieve information about a specific
|
|
125
|
+
* domain using the `region` and `domain_id` parameters.
|
|
118
126
|
*
|
|
119
127
|
* @param request - The request {@link GetDomainRequest}
|
|
120
128
|
* @returns A Promise of Domain
|
|
@@ -142,7 +150,8 @@ class API extends API$1 {
|
|
|
142
150
|
}, unmarshalListDomainsResponse);
|
|
143
151
|
};
|
|
144
152
|
/**
|
|
145
|
-
* List domains in a project
|
|
153
|
+
* List domains. Retrieve domains in a specific project or in a specific
|
|
154
|
+
* Organization using the `region` parameter.
|
|
146
155
|
*
|
|
147
156
|
* @param request - The request {@link ListDomainsRequest}
|
|
148
157
|
* @returns A Promise of ListDomainsResponse
|
|
@@ -154,7 +163,9 @@ class API extends API$1 {
|
|
|
154
163
|
return enrichForPagination('domains', _this.pageOfListDomains, request);
|
|
155
164
|
};
|
|
156
165
|
/**
|
|
157
|
-
*
|
|
166
|
+
* Delete a domain. You must specify the domain you want to delete by the
|
|
167
|
+
* `region` and `domain_id`. Deleting a domain is permanent and cannot be
|
|
168
|
+
* undone.
|
|
158
169
|
*
|
|
159
170
|
* @param request - The request {@link RevokeDomainRequest}
|
|
160
171
|
* @returns A Promise of Domain
|
|
@@ -166,7 +177,8 @@ class API extends API$1 {
|
|
|
166
177
|
path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}/revoke`
|
|
167
178
|
}, unmarshalDomain);
|
|
168
179
|
/**
|
|
169
|
-
*
|
|
180
|
+
* Domain DNS check. Perform an immediate DNS check of a domain using the
|
|
181
|
+
* `region` and `domain_id` parameters.
|
|
170
182
|
*
|
|
171
183
|
* @param request - The request {@link CheckDomainRequest}
|
|
172
184
|
* @returns A Promise of Domain
|
|
@@ -91,7 +91,7 @@ class API extends API$1 {
|
|
|
91
91
|
path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}`
|
|
92
92
|
}, unmarshalHosting);
|
|
93
93
|
/**
|
|
94
|
-
*
|
|
94
|
+
* Restore a hosting. Restore a hosting with the given ID.
|
|
95
95
|
*
|
|
96
96
|
* @param request - The request {@link RestoreHostingRequest}
|
|
97
97
|
* @returns A Promise of Hosting
|
|
@@ -103,7 +103,8 @@ class API extends API$1 {
|
|
|
103
103
|
path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}/restore`
|
|
104
104
|
}, unmarshalHosting);
|
|
105
105
|
/**
|
|
106
|
-
* Get the DNS records.
|
|
106
|
+
* Get the DNS records. The set of DNS record of a specific domain associated
|
|
107
|
+
* to a hosting.
|
|
107
108
|
*
|
|
108
109
|
* @param request - The request {@link GetDomainDnsRecordsRequest}
|
|
109
110
|
* @returns A Promise of DnsRecords
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates an object is of type Response without using `instanceof`.
|
|
3
|
+
*
|
|
4
|
+
* @remarks Check issue #509 for more context.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
const isResponse = obj => obj !== null && obj !== undefined && typeof obj === 'object' && 'status' in obj && typeof obj.status === 'number' && 'statusText' in obj && typeof obj.statusText === 'string' && 'headers' in obj && typeof obj.headers === 'object' && 'body' in obj && typeof obj.body !== 'undefined';
|
|
9
|
+
|
|
10
|
+
export { isResponse };
|