@scaleway/sdk 2.41.0 → 2.43.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/applesilicon/v1alpha1/marshalling.gen.cjs +5 -1
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +5 -1
- package/dist/api/applesilicon/v1alpha1/types.gen.d.ts +14 -2
- package/dist/api/block/v1alpha1/api.gen.cjs +4 -3
- package/dist/api/block/v1alpha1/api.gen.d.ts +4 -3
- package/dist/api/block/v1alpha1/api.gen.js +4 -3
- package/dist/api/container/v1beta1/marshalling.gen.cjs +3 -0
- package/dist/api/container/v1beta1/marshalling.gen.js +3 -0
- package/dist/api/container/v1beta1/types.gen.d.ts +6 -0
- package/dist/api/domain/v2beta1/types.gen.d.ts +1 -1
- package/dist/api/iam/v1alpha1/marshalling.gen.cjs +2 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.js +2 -0
- package/dist/api/iam/v1alpha1/types.gen.d.ts +4 -0
- package/dist/api/iam/v1alpha1/validation-rules.gen.cjs +6 -0
- package/dist/api/iam/v1alpha1/validation-rules.gen.d.ts +5 -0
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +6 -0
- package/dist/api/instance/v1/types.gen.d.ts +2 -1
- package/dist/api/k8s/v1/api.gen.cjs +32 -0
- package/dist/api/k8s/v1/api.gen.d.ts +19 -1
- package/dist/api/k8s/v1/api.gen.js +33 -1
- package/dist/api/k8s/v1/index.gen.d.ts +1 -1
- package/dist/api/k8s/v1/marshalling.gen.cjs +53 -0
- package/dist/api/k8s/v1/marshalling.gen.d.ts +3 -1
- package/dist/api/k8s/v1/marshalling.gen.js +53 -0
- package/dist/api/k8s/v1/types.gen.d.ts +48 -0
- package/dist/api/key_manager/v1alpha1/types.gen.d.ts +7 -7
- package/dist/api/secret/v1beta1/marshalling.gen.cjs +1 -0
- package/dist/api/secret/v1beta1/marshalling.gen.js +1 -0
- package/dist/api/secret/v1beta1/types.gen.d.ts +2 -0
- package/dist/api/tem/v1alpha1/api.gen.cjs +60 -0
- package/dist/api/tem/v1alpha1/api.gen.d.ts +45 -1
- package/dist/api/tem/v1alpha1/api.gen.js +61 -1
- package/dist/api/tem/v1alpha1/index.gen.d.ts +1 -1
- package/dist/api/tem/v1alpha1/marshalling.gen.cjs +10 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.d.ts +2 -1
- package/dist/api/tem/v1alpha1/marshalling.gen.js +10 -0
- package/dist/api/tem/v1alpha1/types.gen.d.ts +30 -0
- package/dist/api/tem/v1alpha1/validation-rules.gen.cjs +11 -0
- package/dist/api/tem/v1alpha1/validation-rules.gen.d.ts +10 -0
- package/dist/api/tem/v1alpha1/validation-rules.gen.js +11 -0
- package/dist/api/vpcgw/v1/api.gen.cjs +8 -5
- package/dist/api/vpcgw/v1/api.gen.d.ts +5 -4
- package/dist/api/vpcgw/v1/api.gen.js +9 -6
- package/dist/api/vpcgw/v1/marshalling.gen.cjs +4 -0
- package/dist/api/vpcgw/v1/marshalling.gen.d.ts +2 -1
- package/dist/api/vpcgw/v1/marshalling.gen.js +4 -0
- package/dist/api/vpcgw/v1/types.gen.d.ts +2 -0
- package/dist/api/webhosting/v1alpha1/api.gen.cjs +91 -0
- package/dist/api/webhosting/v1alpha1/api.gen.d.ts +47 -1
- package/dist/api/webhosting/v1alpha1/api.gen.js +93 -2
- package/dist/api/webhosting/v1alpha1/index.gen.cjs +1 -0
- package/dist/api/webhosting/v1alpha1/index.gen.d.ts +2 -2
- package/dist/api/webhosting/v1alpha1/index.gen.js +2 -1
- package/dist/api/webhosting/v1alpha1/marshalling.gen.cjs +48 -0
- package/dist/api/webhosting/v1alpha1/marshalling.gen.d.ts +5 -1
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +48 -0
- package/dist/api/webhosting/v1alpha1/types.gen.d.ts +84 -0
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.cjs +10 -0
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.d.ts +9 -0
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +10 -0
- package/dist/scw/constants.cjs +1 -1
- package/dist/scw/constants.d.ts +2 -2
- package/dist/scw/constants.js +1 -1
- package/package.json +2 -2
|
@@ -145,6 +145,7 @@ const unmarshalCluster = (data) => {
|
|
|
145
145
|
projectId: data.project_id,
|
|
146
146
|
region: data.region,
|
|
147
147
|
routedIpEnabled: data.routed_ip_enabled,
|
|
148
|
+
sbsCsiEnabled: data.sbs_csi_enabled,
|
|
148
149
|
status: data.status,
|
|
149
150
|
tags: data.tags,
|
|
150
151
|
type: data.type,
|
|
@@ -212,6 +213,17 @@ const unmarshalExternalNode = (data) => {
|
|
|
212
213
|
runcVersion: data.runc_version
|
|
213
214
|
};
|
|
214
215
|
};
|
|
216
|
+
const unmarshalExternalNodeAuth = (data) => {
|
|
217
|
+
if (!isJSONObject(data)) {
|
|
218
|
+
throw new TypeError(
|
|
219
|
+
`Unmarshalling the type 'ExternalNodeAuth' failed as data isn't a dictionary.`
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
return {
|
|
223
|
+
apiUrl: data.api_url,
|
|
224
|
+
nodeToken: data.node_token
|
|
225
|
+
};
|
|
226
|
+
};
|
|
215
227
|
const unmarshalClusterType = (data) => {
|
|
216
228
|
if (!isJSONObject(data)) {
|
|
217
229
|
throw new TypeError(
|
|
@@ -223,6 +235,7 @@ const unmarshalClusterType = (data) => {
|
|
|
223
235
|
availability: data.availability,
|
|
224
236
|
commitmentDelay: data.commitment_delay,
|
|
225
237
|
dedicated: data.dedicated,
|
|
238
|
+
maxEtcdSize: data.max_etcd_size,
|
|
226
239
|
maxNodes: data.max_nodes,
|
|
227
240
|
memory: data.memory,
|
|
228
241
|
name: data.name,
|
|
@@ -311,6 +324,44 @@ const unmarshalListVersionsResponse = (data) => {
|
|
|
311
324
|
versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)
|
|
312
325
|
};
|
|
313
326
|
};
|
|
327
|
+
const unmarshalNodeMetadataCoreV1Taint = (data) => {
|
|
328
|
+
if (!isJSONObject(data)) {
|
|
329
|
+
throw new TypeError(
|
|
330
|
+
`Unmarshalling the type 'NodeMetadataCoreV1Taint' failed as data isn't a dictionary.`
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
return {
|
|
334
|
+
effect: data.effect,
|
|
335
|
+
key: data.key,
|
|
336
|
+
value: data.value
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
const unmarshalNodeMetadata = (data) => {
|
|
340
|
+
if (!isJSONObject(data)) {
|
|
341
|
+
throw new TypeError(
|
|
342
|
+
`Unmarshalling the type 'NodeMetadata' failed as data isn't a dictionary.`
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
return {
|
|
346
|
+
clusterCa: data.cluster_ca,
|
|
347
|
+
clusterUrl: data.cluster_url,
|
|
348
|
+
credentialProviderConfig: data.credential_provider_config,
|
|
349
|
+
externalIp: data.external_ip,
|
|
350
|
+
fullIsolation: data.full_isolation,
|
|
351
|
+
hasGpu: data.has_gpu,
|
|
352
|
+
id: data.id,
|
|
353
|
+
kapsuleIfaceMac: data.kapsule_iface_mac,
|
|
354
|
+
kubeletConfig: data.kubelet_config,
|
|
355
|
+
name: data.name,
|
|
356
|
+
nodeLabels: data.node_labels,
|
|
357
|
+
nodeTaints: unmarshalArrayOfObject(
|
|
358
|
+
data.node_taints,
|
|
359
|
+
unmarshalNodeMetadataCoreV1Taint
|
|
360
|
+
),
|
|
361
|
+
poolVersion: data.pool_version,
|
|
362
|
+
privateNetworkMode: data.private_network_mode
|
|
363
|
+
};
|
|
364
|
+
};
|
|
314
365
|
const marshalMaintenanceWindow = (request, defaults) => ({
|
|
315
366
|
day: request.day,
|
|
316
367
|
start_hour: request.startHour
|
|
@@ -494,6 +545,7 @@ export {
|
|
|
494
545
|
marshalUpgradePoolRequest,
|
|
495
546
|
unmarshalCluster,
|
|
496
547
|
unmarshalExternalNode,
|
|
548
|
+
unmarshalExternalNodeAuth,
|
|
497
549
|
unmarshalListClusterAvailableTypesResponse,
|
|
498
550
|
unmarshalListClusterAvailableVersionsResponse,
|
|
499
551
|
unmarshalListClusterTypesResponse,
|
|
@@ -502,6 +554,7 @@ export {
|
|
|
502
554
|
unmarshalListPoolsResponse,
|
|
503
555
|
unmarshalListVersionsResponse,
|
|
504
556
|
unmarshalNode,
|
|
557
|
+
unmarshalNodeMetadata,
|
|
505
558
|
unmarshalPool,
|
|
506
559
|
unmarshalVersion
|
|
507
560
|
};
|
|
@@ -364,6 +364,8 @@ export interface ClusterType {
|
|
|
364
364
|
* note that audit logs are sent to Cockpit.
|
|
365
365
|
*/
|
|
366
366
|
auditLogsSupported: boolean;
|
|
367
|
+
/** Maximum amount of data that can be stored in etcd for the offer. */
|
|
368
|
+
maxEtcdSize: number;
|
|
367
369
|
}
|
|
368
370
|
export interface Version {
|
|
369
371
|
/** Name of the Kubernetes version. */
|
|
@@ -443,6 +445,11 @@ export interface Cluster {
|
|
|
443
445
|
* cluster.
|
|
444
446
|
*/
|
|
445
447
|
routedIpEnabled?: boolean;
|
|
448
|
+
/**
|
|
449
|
+
* @deprecated Defines whether the SBS-enabled CSI starting from v0.3 is
|
|
450
|
+
* installed on the cluster.
|
|
451
|
+
*/
|
|
452
|
+
sbsCsiEnabled?: boolean;
|
|
446
453
|
}
|
|
447
454
|
export interface Node {
|
|
448
455
|
/** Node ID. */
|
|
@@ -479,6 +486,11 @@ export interface Node {
|
|
|
479
486
|
/** Date on which the node was last updated. */
|
|
480
487
|
updatedAt?: Date;
|
|
481
488
|
}
|
|
489
|
+
export interface NodeMetadataCoreV1Taint {
|
|
490
|
+
key: string;
|
|
491
|
+
value: string;
|
|
492
|
+
effect: string;
|
|
493
|
+
}
|
|
482
494
|
export interface UpdateClusterRequestAutoUpgrade {
|
|
483
495
|
/** Defines whether auto upgrade is enabled for the cluster. */
|
|
484
496
|
enable?: boolean;
|
|
@@ -566,6 +578,15 @@ export interface UpdatePoolRequestUpgradePolicy {
|
|
|
566
578
|
maxUnavailable?: number;
|
|
567
579
|
maxSurge?: number;
|
|
568
580
|
}
|
|
581
|
+
export type AuthExternalNodeRequest = {
|
|
582
|
+
/**
|
|
583
|
+
* Region to target. If none is passed will use default region from the
|
|
584
|
+
* config.
|
|
585
|
+
*/
|
|
586
|
+
region?: Region;
|
|
587
|
+
/** Pool the node will be attached to. */
|
|
588
|
+
poolId: string;
|
|
589
|
+
};
|
|
569
590
|
export type CreateClusterRequest = {
|
|
570
591
|
/**
|
|
571
592
|
* Region to target. If none is passed will use default region from the
|
|
@@ -768,6 +789,10 @@ export interface ExternalNode {
|
|
|
768
789
|
nodeLabels: Record<string, string>;
|
|
769
790
|
nodeTaints: ExternalNodeCoreV1Taint[];
|
|
770
791
|
}
|
|
792
|
+
export interface ExternalNodeAuth {
|
|
793
|
+
nodeToken: string;
|
|
794
|
+
apiUrl: string;
|
|
795
|
+
}
|
|
771
796
|
export type GetClusterKubeConfigRequest = {
|
|
772
797
|
/**
|
|
773
798
|
* Region to target. If none is passed will use default region from the
|
|
@@ -788,6 +813,13 @@ export type GetClusterRequest = {
|
|
|
788
813
|
/** ID of the requested cluster. */
|
|
789
814
|
clusterId: string;
|
|
790
815
|
};
|
|
816
|
+
export type GetNodeMetadataRequest = {
|
|
817
|
+
/**
|
|
818
|
+
* Region to target. If none is passed will use default region from the
|
|
819
|
+
* config.
|
|
820
|
+
*/
|
|
821
|
+
region?: Region;
|
|
822
|
+
};
|
|
791
823
|
export type GetNodeRequest = {
|
|
792
824
|
/**
|
|
793
825
|
* Region to target. If none is passed will use default region from the
|
|
@@ -974,6 +1006,22 @@ export type MigrateClusterToRoutedIPsRequest = {
|
|
|
974
1006
|
region?: Region;
|
|
975
1007
|
clusterId: string;
|
|
976
1008
|
};
|
|
1009
|
+
export interface NodeMetadata {
|
|
1010
|
+
id: string;
|
|
1011
|
+
name: string;
|
|
1012
|
+
clusterUrl: string;
|
|
1013
|
+
clusterCa: string;
|
|
1014
|
+
credentialProviderConfig: string;
|
|
1015
|
+
poolVersion: string;
|
|
1016
|
+
kubeletConfig: string;
|
|
1017
|
+
nodeLabels: Record<string, string>;
|
|
1018
|
+
nodeTaints: NodeMetadataCoreV1Taint[];
|
|
1019
|
+
privateNetworkMode: string;
|
|
1020
|
+
kapsuleIfaceMac: string;
|
|
1021
|
+
fullIsolation: boolean;
|
|
1022
|
+
hasGpu: boolean;
|
|
1023
|
+
externalIp: string;
|
|
1024
|
+
}
|
|
977
1025
|
export type RebootNodeRequest = {
|
|
978
1026
|
/**
|
|
979
1027
|
* Region to target. If none is passed will use default region from the
|
|
@@ -14,7 +14,8 @@ export interface KeyRotationPolicy {
|
|
|
14
14
|
}
|
|
15
15
|
export interface KeyUsage {
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* See the `Key.Algorithm.SymmetricEncryption` enum for a description of
|
|
18
|
+
* values.
|
|
18
19
|
*
|
|
19
20
|
* One-of ('usage'): at most one of 'symmetricEncryption' could be set.
|
|
20
21
|
*/
|
|
@@ -33,11 +34,7 @@ export interface Key {
|
|
|
33
34
|
* AES-256-GCM.
|
|
34
35
|
*/
|
|
35
36
|
usage?: KeyUsage;
|
|
36
|
-
/**
|
|
37
|
-
* Current state of the key. Values include: `unknown_state`: key is in an
|
|
38
|
-
* unknown state. `enabled`: key can be used for cryptographic operations.
|
|
39
|
-
* `disabled`: key cannot be used for cryptographic operations.
|
|
40
|
-
*/
|
|
37
|
+
/** See the `Key.State` enum for a description of values. */
|
|
41
38
|
state: KeyState;
|
|
42
39
|
/** The rotation count tracks the amount of times that the key was rotated. */
|
|
43
40
|
rotationCount: number;
|
|
@@ -184,7 +181,10 @@ export type GenerateDataKeyRequest = {
|
|
|
184
181
|
region?: Region;
|
|
185
182
|
/** ID of the key. */
|
|
186
183
|
keyId: string;
|
|
187
|
-
/**
|
|
184
|
+
/**
|
|
185
|
+
* See the `DataKey.Algorithm.SymmetricEncryption` enum for a description of
|
|
186
|
+
* values.
|
|
187
|
+
*/
|
|
188
188
|
algorithm?: DataKeyAlgorithmSymmetricEncryption;
|
|
189
189
|
/**
|
|
190
190
|
* Default value is `false`, meaning that the plaintext is returned. Set it to
|
|
@@ -113,6 +113,8 @@ export interface Secret {
|
|
|
113
113
|
* default, the policy is applied to all the secret's versions.
|
|
114
114
|
*/
|
|
115
115
|
ephemeralPolicy?: EphemeralPolicy;
|
|
116
|
+
/** List of Scaleway resources that can access and manage the secret. */
|
|
117
|
+
usedBy: Product[];
|
|
116
118
|
/** Region of the secret. */
|
|
117
119
|
region: Region;
|
|
118
120
|
}
|
|
@@ -257,6 +257,24 @@ class API extends api.API {
|
|
|
257
257
|
},
|
|
258
258
|
marshalling_gen.unmarshalDomainLastStatus
|
|
259
259
|
);
|
|
260
|
+
/**
|
|
261
|
+
* Create a Webhook. Create a new Webhook triggered by a list of event types
|
|
262
|
+
* and pushed to a Scaleway SNS ARN.
|
|
263
|
+
*
|
|
264
|
+
* @param request - The request {@link CreateWebhookRequest}
|
|
265
|
+
* @returns A Promise of Webhook
|
|
266
|
+
*/
|
|
267
|
+
createWebhook = (request) => this.client.fetch(
|
|
268
|
+
{
|
|
269
|
+
body: JSON.stringify(
|
|
270
|
+
marshalling_gen.marshalCreateWebhookRequest(request, this.client.settings)
|
|
271
|
+
),
|
|
272
|
+
headers: jsonContentHeaders,
|
|
273
|
+
method: "POST",
|
|
274
|
+
path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks`
|
|
275
|
+
},
|
|
276
|
+
marshalling_gen.unmarshalWebhook
|
|
277
|
+
);
|
|
260
278
|
pageOfListWebhooks = (request = {}) => this.client.fetch(
|
|
261
279
|
{
|
|
262
280
|
method: "GET",
|
|
@@ -275,7 +293,34 @@ class API extends api.API {
|
|
|
275
293
|
},
|
|
276
294
|
marshalling_gen.unmarshalListWebhooksResponse
|
|
277
295
|
);
|
|
296
|
+
/**
|
|
297
|
+
* List Webhooks. Retrieve Webhooks in a specific Project or in a specific
|
|
298
|
+
* Organization using the `region` parameter.
|
|
299
|
+
*
|
|
300
|
+
* @param request - The request {@link ListWebhooksRequest}
|
|
301
|
+
* @returns A Promise of ListWebhooksResponse
|
|
302
|
+
*/
|
|
278
303
|
listWebhooks = (request = {}) => resourcePaginator.enrichForPagination("webhooks", this.pageOfListWebhooks, request);
|
|
304
|
+
/**
|
|
305
|
+
* Get information about a Webhook. Retrieve information about a specific
|
|
306
|
+
* Webhook using the `webhook_id` and `region` parameters.
|
|
307
|
+
*
|
|
308
|
+
* @param request - The request {@link GetWebhookRequest}
|
|
309
|
+
* @returns A Promise of Webhook
|
|
310
|
+
*/
|
|
311
|
+
getWebhook = (request) => this.client.fetch(
|
|
312
|
+
{
|
|
313
|
+
method: "GET",
|
|
314
|
+
path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${marshalling.validatePathParam("webhookId", request.webhookId)}`
|
|
315
|
+
},
|
|
316
|
+
marshalling_gen.unmarshalWebhook
|
|
317
|
+
);
|
|
318
|
+
/**
|
|
319
|
+
* Update a Webhook. Update a Webhook events type, SNS ARN or name.
|
|
320
|
+
*
|
|
321
|
+
* @param request - The request {@link UpdateWebhookRequest}
|
|
322
|
+
* @returns A Promise of Webhook
|
|
323
|
+
*/
|
|
279
324
|
updateWebhook = (request) => this.client.fetch(
|
|
280
325
|
{
|
|
281
326
|
body: JSON.stringify(
|
|
@@ -287,6 +332,13 @@ class API extends api.API {
|
|
|
287
332
|
},
|
|
288
333
|
marshalling_gen.unmarshalWebhook
|
|
289
334
|
);
|
|
335
|
+
/**
|
|
336
|
+
* Delete a Webhook. You must specify the Webhook you want to delete by the
|
|
337
|
+
* `region` and `webhook_id`. Deleting a Webhook is permanent and cannot be
|
|
338
|
+
* undone.
|
|
339
|
+
*
|
|
340
|
+
* @param request - The request {@link DeleteWebhookRequest}
|
|
341
|
+
*/
|
|
290
342
|
deleteWebhook = (request) => this.client.fetch({
|
|
291
343
|
method: "DELETE",
|
|
292
344
|
path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${marshalling.validatePathParam("webhookId", request.webhookId)}`
|
|
@@ -312,6 +364,14 @@ class API extends api.API {
|
|
|
312
364
|
},
|
|
313
365
|
marshalling_gen.unmarshalListWebhookEventsResponse
|
|
314
366
|
);
|
|
367
|
+
/**
|
|
368
|
+
* List Webhook triggered events. Retrieve the list of Webhook events
|
|
369
|
+
* triggered from a specific Webhook or for a specific Project or
|
|
370
|
+
* Organization. You must specify the `region`.
|
|
371
|
+
*
|
|
372
|
+
* @param request - The request {@link ListWebhookEventsRequest}
|
|
373
|
+
* @returns A Promise of ListWebhookEventsResponse
|
|
374
|
+
*/
|
|
315
375
|
listWebhookEvents = (request) => resourcePaginator.enrichForPagination("webhookEvents", this.pageOfListWebhookEvents, request);
|
|
316
376
|
}
|
|
317
377
|
exports.API = API;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { API as ParentAPI } from '../../../bridge';
|
|
2
2
|
import type { Region, WaitForOptions } from '../../../bridge';
|
|
3
|
-
import type { CancelEmailRequest, CheckDomainRequest, CreateDomainRequest, CreateEmailRequest, CreateEmailResponse, DeleteWebhookRequest, Domain, DomainLastStatus, Email, GetDomainLastStatusRequest, GetDomainRequest, GetEmailRequest, GetStatisticsRequest, ListDomainsRequest, ListDomainsResponse, ListEmailsRequest, ListEmailsResponse, ListWebhookEventsRequest, ListWebhookEventsResponse, ListWebhooksRequest, ListWebhooksResponse, RevokeDomainRequest, Statistics, UpdateWebhookRequest, Webhook } from './types.gen';
|
|
3
|
+
import type { CancelEmailRequest, CheckDomainRequest, CreateDomainRequest, CreateEmailRequest, CreateEmailResponse, CreateWebhookRequest, DeleteWebhookRequest, Domain, DomainLastStatus, Email, GetDomainLastStatusRequest, GetDomainRequest, GetEmailRequest, GetStatisticsRequest, GetWebhookRequest, ListDomainsRequest, ListDomainsResponse, ListEmailsRequest, ListEmailsResponse, ListWebhookEventsRequest, ListWebhookEventsResponse, ListWebhooksRequest, ListWebhooksResponse, RevokeDomainRequest, Statistics, UpdateWebhookRequest, Webhook } from './types.gen';
|
|
4
4
|
/**
|
|
5
5
|
* Transactional Email API.
|
|
6
6
|
*
|
|
@@ -131,14 +131,58 @@ export declare class API extends ParentAPI {
|
|
|
131
131
|
* @returns A Promise of DomainLastStatus
|
|
132
132
|
*/
|
|
133
133
|
getDomainLastStatus: (request: Readonly<GetDomainLastStatusRequest>) => Promise<DomainLastStatus>;
|
|
134
|
+
/**
|
|
135
|
+
* Create a Webhook. Create a new Webhook triggered by a list of event types
|
|
136
|
+
* and pushed to a Scaleway SNS ARN.
|
|
137
|
+
*
|
|
138
|
+
* @param request - The request {@link CreateWebhookRequest}
|
|
139
|
+
* @returns A Promise of Webhook
|
|
140
|
+
*/
|
|
141
|
+
createWebhook: (request: Readonly<CreateWebhookRequest>) => Promise<Webhook>;
|
|
134
142
|
protected pageOfListWebhooks: (request?: Readonly<ListWebhooksRequest>) => Promise<ListWebhooksResponse>;
|
|
143
|
+
/**
|
|
144
|
+
* List Webhooks. Retrieve Webhooks in a specific Project or in a specific
|
|
145
|
+
* Organization using the `region` parameter.
|
|
146
|
+
*
|
|
147
|
+
* @param request - The request {@link ListWebhooksRequest}
|
|
148
|
+
* @returns A Promise of ListWebhooksResponse
|
|
149
|
+
*/
|
|
135
150
|
listWebhooks: (request?: Readonly<ListWebhooksRequest>) => Promise<ListWebhooksResponse> & {
|
|
136
151
|
all: () => Promise<Webhook[]>;
|
|
137
152
|
[Symbol.asyncIterator]: () => AsyncGenerator<Webhook[], void, void>;
|
|
138
153
|
};
|
|
154
|
+
/**
|
|
155
|
+
* Get information about a Webhook. Retrieve information about a specific
|
|
156
|
+
* Webhook using the `webhook_id` and `region` parameters.
|
|
157
|
+
*
|
|
158
|
+
* @param request - The request {@link GetWebhookRequest}
|
|
159
|
+
* @returns A Promise of Webhook
|
|
160
|
+
*/
|
|
161
|
+
getWebhook: (request: Readonly<GetWebhookRequest>) => Promise<Webhook>;
|
|
162
|
+
/**
|
|
163
|
+
* Update a Webhook. Update a Webhook events type, SNS ARN or name.
|
|
164
|
+
*
|
|
165
|
+
* @param request - The request {@link UpdateWebhookRequest}
|
|
166
|
+
* @returns A Promise of Webhook
|
|
167
|
+
*/
|
|
139
168
|
updateWebhook: (request: Readonly<UpdateWebhookRequest>) => Promise<Webhook>;
|
|
169
|
+
/**
|
|
170
|
+
* Delete a Webhook. You must specify the Webhook you want to delete by the
|
|
171
|
+
* `region` and `webhook_id`. Deleting a Webhook is permanent and cannot be
|
|
172
|
+
* undone.
|
|
173
|
+
*
|
|
174
|
+
* @param request - The request {@link DeleteWebhookRequest}
|
|
175
|
+
*/
|
|
140
176
|
deleteWebhook: (request: Readonly<DeleteWebhookRequest>) => Promise<void>;
|
|
141
177
|
protected pageOfListWebhookEvents: (request: Readonly<ListWebhookEventsRequest>) => Promise<ListWebhookEventsResponse>;
|
|
178
|
+
/**
|
|
179
|
+
* List Webhook triggered events. Retrieve the list of Webhook events
|
|
180
|
+
* triggered from a specific Webhook or for a specific Project or
|
|
181
|
+
* Organization. You must specify the `region`.
|
|
182
|
+
*
|
|
183
|
+
* @param request - The request {@link ListWebhookEventsRequest}
|
|
184
|
+
* @returns A Promise of ListWebhookEventsResponse
|
|
185
|
+
*/
|
|
142
186
|
listWebhookEvents: (request: Readonly<ListWebhookEventsRequest>) => Promise<ListWebhookEventsResponse> & {
|
|
143
187
|
all: () => Promise<import("./types.gen").WebhookEvent[]>;
|
|
144
188
|
[Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").WebhookEvent[], void, void>;
|
|
@@ -4,7 +4,7 @@ import { validatePathParam, urlParams } from "../../../helpers/marshalling.js";
|
|
|
4
4
|
import "../../../vendor/base64/index.js";
|
|
5
5
|
import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
|
|
6
6
|
import { EMAIL_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
7
|
-
import { marshalCreateEmailRequest, unmarshalCreateEmailResponse, unmarshalEmail, unmarshalListEmailsResponse, unmarshalStatistics, marshalCreateDomainRequest, unmarshalDomain, unmarshalListDomainsResponse, unmarshalDomainLastStatus, unmarshalListWebhooksResponse, marshalUpdateWebhookRequest,
|
|
7
|
+
import { marshalCreateEmailRequest, unmarshalCreateEmailResponse, unmarshalEmail, unmarshalListEmailsResponse, unmarshalStatistics, marshalCreateDomainRequest, unmarshalDomain, unmarshalListDomainsResponse, unmarshalDomainLastStatus, marshalCreateWebhookRequest, unmarshalWebhook, unmarshalListWebhooksResponse, marshalUpdateWebhookRequest, unmarshalListWebhookEventsResponse } from "./marshalling.gen.js";
|
|
8
8
|
const jsonContentHeaders = {
|
|
9
9
|
"Content-Type": "application/json; charset=utf-8"
|
|
10
10
|
};
|
|
@@ -255,6 +255,24 @@ class API extends API$1 {
|
|
|
255
255
|
},
|
|
256
256
|
unmarshalDomainLastStatus
|
|
257
257
|
);
|
|
258
|
+
/**
|
|
259
|
+
* Create a Webhook. Create a new Webhook triggered by a list of event types
|
|
260
|
+
* and pushed to a Scaleway SNS ARN.
|
|
261
|
+
*
|
|
262
|
+
* @param request - The request {@link CreateWebhookRequest}
|
|
263
|
+
* @returns A Promise of Webhook
|
|
264
|
+
*/
|
|
265
|
+
createWebhook = (request) => this.client.fetch(
|
|
266
|
+
{
|
|
267
|
+
body: JSON.stringify(
|
|
268
|
+
marshalCreateWebhookRequest(request, this.client.settings)
|
|
269
|
+
),
|
|
270
|
+
headers: jsonContentHeaders,
|
|
271
|
+
method: "POST",
|
|
272
|
+
path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks`
|
|
273
|
+
},
|
|
274
|
+
unmarshalWebhook
|
|
275
|
+
);
|
|
258
276
|
pageOfListWebhooks = (request = {}) => this.client.fetch(
|
|
259
277
|
{
|
|
260
278
|
method: "GET",
|
|
@@ -273,7 +291,34 @@ class API extends API$1 {
|
|
|
273
291
|
},
|
|
274
292
|
unmarshalListWebhooksResponse
|
|
275
293
|
);
|
|
294
|
+
/**
|
|
295
|
+
* List Webhooks. Retrieve Webhooks in a specific Project or in a specific
|
|
296
|
+
* Organization using the `region` parameter.
|
|
297
|
+
*
|
|
298
|
+
* @param request - The request {@link ListWebhooksRequest}
|
|
299
|
+
* @returns A Promise of ListWebhooksResponse
|
|
300
|
+
*/
|
|
276
301
|
listWebhooks = (request = {}) => enrichForPagination("webhooks", this.pageOfListWebhooks, request);
|
|
302
|
+
/**
|
|
303
|
+
* Get information about a Webhook. Retrieve information about a specific
|
|
304
|
+
* Webhook using the `webhook_id` and `region` parameters.
|
|
305
|
+
*
|
|
306
|
+
* @param request - The request {@link GetWebhookRequest}
|
|
307
|
+
* @returns A Promise of Webhook
|
|
308
|
+
*/
|
|
309
|
+
getWebhook = (request) => this.client.fetch(
|
|
310
|
+
{
|
|
311
|
+
method: "GET",
|
|
312
|
+
path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${validatePathParam("webhookId", request.webhookId)}`
|
|
313
|
+
},
|
|
314
|
+
unmarshalWebhook
|
|
315
|
+
);
|
|
316
|
+
/**
|
|
317
|
+
* Update a Webhook. Update a Webhook events type, SNS ARN or name.
|
|
318
|
+
*
|
|
319
|
+
* @param request - The request {@link UpdateWebhookRequest}
|
|
320
|
+
* @returns A Promise of Webhook
|
|
321
|
+
*/
|
|
277
322
|
updateWebhook = (request) => this.client.fetch(
|
|
278
323
|
{
|
|
279
324
|
body: JSON.stringify(
|
|
@@ -285,6 +330,13 @@ class API extends API$1 {
|
|
|
285
330
|
},
|
|
286
331
|
unmarshalWebhook
|
|
287
332
|
);
|
|
333
|
+
/**
|
|
334
|
+
* Delete a Webhook. You must specify the Webhook you want to delete by the
|
|
335
|
+
* `region` and `webhook_id`. Deleting a Webhook is permanent and cannot be
|
|
336
|
+
* undone.
|
|
337
|
+
*
|
|
338
|
+
* @param request - The request {@link DeleteWebhookRequest}
|
|
339
|
+
*/
|
|
288
340
|
deleteWebhook = (request) => this.client.fetch({
|
|
289
341
|
method: "DELETE",
|
|
290
342
|
path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${validatePathParam("webhookId", request.webhookId)}`
|
|
@@ -310,6 +362,14 @@ class API extends API$1 {
|
|
|
310
362
|
},
|
|
311
363
|
unmarshalListWebhookEventsResponse
|
|
312
364
|
);
|
|
365
|
+
/**
|
|
366
|
+
* List Webhook triggered events. Retrieve the list of Webhook events
|
|
367
|
+
* triggered from a specific Webhook or for a specific Project or
|
|
368
|
+
* Organization. You must specify the `region`.
|
|
369
|
+
*
|
|
370
|
+
* @param request - The request {@link ListWebhookEventsRequest}
|
|
371
|
+
* @returns A Promise of ListWebhookEventsResponse
|
|
372
|
+
*/
|
|
313
373
|
listWebhookEvents = (request) => enrichForPagination("webhookEvents", this.pageOfListWebhookEvents, request);
|
|
314
374
|
}
|
|
315
375
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { API } from './api.gen';
|
|
2
2
|
export * from './content.gen';
|
|
3
|
-
export type { CancelEmailRequest, CheckDomainRequest, CreateDomainRequest, CreateEmailRequest, CreateEmailRequestAddress, CreateEmailRequestAttachment, CreateEmailRequestHeader, CreateEmailResponse, DeleteWebhookRequest, Domain, DomainLastStatus, DomainLastStatusDkimRecord, DomainLastStatusDmarcRecord, DomainLastStatusRecordStatus, DomainLastStatusSpfRecord, DomainRecords, DomainRecordsDMARC, DomainReputation, DomainReputationStatus, DomainStatistics, DomainStatus, Email, EmailFlag, EmailRcptType, EmailStatus, EmailTry, GetDomainLastStatusRequest, GetDomainRequest, GetEmailRequest, GetStatisticsRequest, ListDomainsRequest, ListDomainsResponse, ListEmailsRequest, ListEmailsRequestOrderBy, ListEmailsResponse, ListWebhookEventsRequest, ListWebhookEventsRequestOrderBy, ListWebhookEventsResponse, ListWebhooksRequest, ListWebhooksRequestOrderBy, ListWebhooksResponse, RevokeDomainRequest, Statistics, UpdateWebhookRequest, Webhook, WebhookEvent, WebhookEventStatus, WebhookEventType, } from './types.gen';
|
|
3
|
+
export type { CancelEmailRequest, CheckDomainRequest, CreateDomainRequest, CreateEmailRequest, CreateEmailRequestAddress, CreateEmailRequestAttachment, CreateEmailRequestHeader, CreateEmailResponse, CreateWebhookRequest, DeleteWebhookRequest, Domain, DomainLastStatus, DomainLastStatusDkimRecord, DomainLastStatusDmarcRecord, DomainLastStatusRecordStatus, DomainLastStatusSpfRecord, DomainRecords, DomainRecordsDMARC, DomainReputation, DomainReputationStatus, DomainStatistics, DomainStatus, Email, EmailFlag, EmailRcptType, EmailStatus, EmailTry, GetDomainLastStatusRequest, GetDomainRequest, GetEmailRequest, GetStatisticsRequest, GetWebhookRequest, ListDomainsRequest, ListDomainsResponse, ListEmailsRequest, ListEmailsRequestOrderBy, ListEmailsResponse, ListWebhookEventsRequest, ListWebhookEventsRequestOrderBy, ListWebhookEventsResponse, ListWebhooksRequest, ListWebhooksRequestOrderBy, ListWebhooksResponse, RevokeDomainRequest, Statistics, UpdateWebhookRequest, Webhook, WebhookEvent, WebhookEventStatus, WebhookEventType, } from './types.gen';
|
|
4
4
|
export * as ValidationRules from './validation-rules.gen';
|
|
@@ -95,6 +95,7 @@ const unmarshalDomain = (data) => {
|
|
|
95
95
|
);
|
|
96
96
|
}
|
|
97
97
|
return {
|
|
98
|
+
autoconfig: data.autoconfig,
|
|
98
99
|
createdAt: marshalling.unmarshalDate(data.created_at),
|
|
99
100
|
dkimConfig: data.dkim_config,
|
|
100
101
|
id: data.id,
|
|
@@ -275,6 +276,7 @@ const unmarshalStatistics = (data) => {
|
|
|
275
276
|
};
|
|
276
277
|
const marshalCreateDomainRequest = (request, defaults) => ({
|
|
277
278
|
accept_tos: request.acceptTos,
|
|
279
|
+
autoconfig: request.autoconfig,
|
|
278
280
|
domain_name: request.domainName,
|
|
279
281
|
project_id: request.projectId ?? defaults.defaultProjectId
|
|
280
282
|
});
|
|
@@ -308,6 +310,13 @@ const marshalCreateEmailRequest = (request, defaults) => ({
|
|
|
308
310
|
text: request.text,
|
|
309
311
|
to: request.to !== void 0 ? request.to.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0
|
|
310
312
|
});
|
|
313
|
+
const marshalCreateWebhookRequest = (request, defaults) => ({
|
|
314
|
+
domain_id: request.domainId,
|
|
315
|
+
event_types: request.eventTypes !== void 0 ? request.eventTypes : void 0,
|
|
316
|
+
name: request.name,
|
|
317
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
318
|
+
sns_arn: request.snsArn
|
|
319
|
+
});
|
|
311
320
|
const marshalUpdateWebhookRequest = (request, defaults) => ({
|
|
312
321
|
event_types: request.eventTypes !== void 0 ? request.eventTypes : void 0,
|
|
313
322
|
name: request.name,
|
|
@@ -315,6 +324,7 @@ const marshalUpdateWebhookRequest = (request, defaults) => ({
|
|
|
315
324
|
});
|
|
316
325
|
exports.marshalCreateDomainRequest = marshalCreateDomainRequest;
|
|
317
326
|
exports.marshalCreateEmailRequest = marshalCreateEmailRequest;
|
|
327
|
+
exports.marshalCreateWebhookRequest = marshalCreateWebhookRequest;
|
|
318
328
|
exports.marshalUpdateWebhookRequest = marshalUpdateWebhookRequest;
|
|
319
329
|
exports.unmarshalCreateEmailResponse = unmarshalCreateEmailResponse;
|
|
320
330
|
exports.unmarshalDomain = unmarshalDomain;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DefaultValues } from '../../../bridge';
|
|
2
|
-
import type { CreateDomainRequest, CreateEmailRequest, CreateEmailResponse, Domain, DomainLastStatus, Email, ListDomainsResponse, ListEmailsResponse, ListWebhookEventsResponse, ListWebhooksResponse, Statistics, UpdateWebhookRequest, Webhook } from './types.gen';
|
|
2
|
+
import type { CreateDomainRequest, CreateEmailRequest, CreateEmailResponse, CreateWebhookRequest, Domain, DomainLastStatus, Email, ListDomainsResponse, ListEmailsResponse, ListWebhookEventsResponse, ListWebhooksResponse, Statistics, UpdateWebhookRequest, Webhook } from './types.gen';
|
|
3
3
|
export declare const unmarshalEmail: (data: unknown) => Email;
|
|
4
4
|
export declare const unmarshalDomain: (data: unknown) => Domain;
|
|
5
5
|
export declare const unmarshalWebhook: (data: unknown) => Webhook;
|
|
@@ -12,4 +12,5 @@ export declare const unmarshalListWebhooksResponse: (data: unknown) => ListWebho
|
|
|
12
12
|
export declare const unmarshalStatistics: (data: unknown) => Statistics;
|
|
13
13
|
export declare const marshalCreateDomainRequest: (request: CreateDomainRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
14
14
|
export declare const marshalCreateEmailRequest: (request: CreateEmailRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
15
|
+
export declare const marshalCreateWebhookRequest: (request: CreateWebhookRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
15
16
|
export declare const marshalUpdateWebhookRequest: (request: UpdateWebhookRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
@@ -93,6 +93,7 @@ const unmarshalDomain = (data) => {
|
|
|
93
93
|
);
|
|
94
94
|
}
|
|
95
95
|
return {
|
|
96
|
+
autoconfig: data.autoconfig,
|
|
96
97
|
createdAt: unmarshalDate(data.created_at),
|
|
97
98
|
dkimConfig: data.dkim_config,
|
|
98
99
|
id: data.id,
|
|
@@ -273,6 +274,7 @@ const unmarshalStatistics = (data) => {
|
|
|
273
274
|
};
|
|
274
275
|
const marshalCreateDomainRequest = (request, defaults) => ({
|
|
275
276
|
accept_tos: request.acceptTos,
|
|
277
|
+
autoconfig: request.autoconfig,
|
|
276
278
|
domain_name: request.domainName,
|
|
277
279
|
project_id: request.projectId ?? defaults.defaultProjectId
|
|
278
280
|
});
|
|
@@ -306,6 +308,13 @@ const marshalCreateEmailRequest = (request, defaults) => ({
|
|
|
306
308
|
text: request.text,
|
|
307
309
|
to: request.to !== void 0 ? request.to.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0
|
|
308
310
|
});
|
|
311
|
+
const marshalCreateWebhookRequest = (request, defaults) => ({
|
|
312
|
+
domain_id: request.domainId,
|
|
313
|
+
event_types: request.eventTypes !== void 0 ? request.eventTypes : void 0,
|
|
314
|
+
name: request.name,
|
|
315
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
316
|
+
sns_arn: request.snsArn
|
|
317
|
+
});
|
|
309
318
|
const marshalUpdateWebhookRequest = (request, defaults) => ({
|
|
310
319
|
event_types: request.eventTypes !== void 0 ? request.eventTypes : void 0,
|
|
311
320
|
name: request.name,
|
|
@@ -314,6 +323,7 @@ const marshalUpdateWebhookRequest = (request, defaults) => ({
|
|
|
314
323
|
export {
|
|
315
324
|
marshalCreateDomainRequest,
|
|
316
325
|
marshalCreateEmailRequest,
|
|
326
|
+
marshalCreateWebhookRequest,
|
|
317
327
|
marshalUpdateWebhookRequest,
|
|
318
328
|
unmarshalCreateEmailResponse,
|
|
319
329
|
unmarshalDomain,
|
|
@@ -171,6 +171,8 @@ export interface Domain {
|
|
|
171
171
|
reputation?: DomainReputation;
|
|
172
172
|
/** List of records to configure to validate a domain. */
|
|
173
173
|
records?: DomainRecords;
|
|
174
|
+
/** Status of auto-configuration for the domain's DNS zone. */
|
|
175
|
+
autoconfig: boolean;
|
|
174
176
|
/**
|
|
175
177
|
* Region to target. If none is passed will use default region from the
|
|
176
178
|
* config.
|
|
@@ -251,6 +253,8 @@ export type CreateDomainRequest = {
|
|
|
251
253
|
domainName: string;
|
|
252
254
|
/** Accept Scaleway's Terms of Service. */
|
|
253
255
|
acceptTos: boolean;
|
|
256
|
+
/** Activate auto-configuration of the domain's DNS zone. */
|
|
257
|
+
autoconfig: boolean;
|
|
254
258
|
};
|
|
255
259
|
export type CreateEmailRequest = {
|
|
256
260
|
/**
|
|
@@ -285,6 +289,23 @@ export interface CreateEmailResponse {
|
|
|
285
289
|
/** Single page of emails matching the requested criteria. */
|
|
286
290
|
emails: Email[];
|
|
287
291
|
}
|
|
292
|
+
export type CreateWebhookRequest = {
|
|
293
|
+
/**
|
|
294
|
+
* Region to target. If none is passed will use default region from the
|
|
295
|
+
* config.
|
|
296
|
+
*/
|
|
297
|
+
region?: Region;
|
|
298
|
+
/** ID of the Domain to watch for triggering events. */
|
|
299
|
+
domainId: string;
|
|
300
|
+
/** ID of the project to which the Webhook belongs. */
|
|
301
|
+
projectId?: string;
|
|
302
|
+
/** Name of the Webhook. */
|
|
303
|
+
name: string;
|
|
304
|
+
/** List of event types that will trigger an event. */
|
|
305
|
+
eventTypes?: WebhookEventType[];
|
|
306
|
+
/** Scaleway SNS ARN topic to push the events to. */
|
|
307
|
+
snsArn: string;
|
|
308
|
+
};
|
|
288
309
|
export type DeleteWebhookRequest = {
|
|
289
310
|
/**
|
|
290
311
|
* Region to target. If none is passed will use default region from the
|
|
@@ -353,6 +374,15 @@ export type GetStatisticsRequest = {
|
|
|
353
374
|
/** (Optional) Number of emails sent with this sender's email address. */
|
|
354
375
|
mailFrom?: string;
|
|
355
376
|
};
|
|
377
|
+
export type GetWebhookRequest = {
|
|
378
|
+
/**
|
|
379
|
+
* Region to target. If none is passed will use default region from the
|
|
380
|
+
* config.
|
|
381
|
+
*/
|
|
382
|
+
region?: Region;
|
|
383
|
+
/** ID of the Webhook to check. */
|
|
384
|
+
webhookId: string;
|
|
385
|
+
};
|
|
356
386
|
export type ListDomainsRequest = {
|
|
357
387
|
/**
|
|
358
388
|
* Region to target. If none is passed will use default region from the
|