@scaleway/sdk 2.31.0 → 2.33.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.
Files changed (61) hide show
  1. package/dist/api/baremetal/v1/api.gen.cjs +1 -0
  2. package/dist/api/baremetal/v1/api.gen.js +1 -0
  3. package/dist/api/baremetal/v1/types.gen.d.ts +2 -0
  4. package/dist/api/block/v1alpha1/api.gen.cjs +44 -0
  5. package/dist/api/block/v1alpha1/api.gen.d.ts +19 -1
  6. package/dist/api/block/v1alpha1/api.gen.js +45 -1
  7. package/dist/api/block/v1alpha1/content.gen.cjs +2 -1
  8. package/dist/api/block/v1alpha1/content.gen.js +2 -1
  9. package/dist/api/block/v1alpha1/index.gen.d.ts +1 -1
  10. package/dist/api/block/v1alpha1/marshalling.gen.cjs +14 -0
  11. package/dist/api/block/v1alpha1/marshalling.gen.d.ts +3 -1
  12. package/dist/api/block/v1alpha1/marshalling.gen.js +14 -0
  13. package/dist/api/block/v1alpha1/types.gen.d.ts +27 -1
  14. package/dist/api/block/v1alpha1/validation-rules.gen.cjs +6 -0
  15. package/dist/api/block/v1alpha1/validation-rules.gen.d.ts +5 -0
  16. package/dist/api/block/v1alpha1/validation-rules.gen.js +6 -0
  17. package/dist/api/function/v1beta1/types.gen.d.ts +1 -1
  18. package/dist/api/instance/v1/api.gen.cjs +0 -25
  19. package/dist/api/instance/v1/api.gen.d.ts +1 -17
  20. package/dist/api/instance/v1/api.gen.js +1 -26
  21. package/dist/api/instance/v1/index.gen.d.ts +1 -1
  22. package/dist/api/instance/v1/marshalling.gen.cjs +5 -13
  23. package/dist/api/instance/v1/marshalling.gen.d.ts +1 -2
  24. package/dist/api/instance/v1/marshalling.gen.js +5 -13
  25. package/dist/api/instance/v1/types.gen.d.ts +26 -25
  26. package/dist/api/instance/v1/types.private.gen.d.ts +7 -0
  27. package/dist/api/jobs/v1alpha1/api.gen.cjs +13 -0
  28. package/dist/api/jobs/v1alpha1/api.gen.d.ts +8 -1
  29. package/dist/api/jobs/v1alpha1/api.gen.js +14 -1
  30. package/dist/api/jobs/v1alpha1/index.gen.d.ts +1 -1
  31. package/dist/api/jobs/v1alpha1/marshalling.gen.cjs +22 -0
  32. package/dist/api/jobs/v1alpha1/marshalling.gen.d.ts +2 -1
  33. package/dist/api/jobs/v1alpha1/marshalling.gen.js +22 -0
  34. package/dist/api/jobs/v1alpha1/types.gen.d.ts +14 -0
  35. package/dist/api/k8s/v1/api.gen.cjs +0 -22
  36. package/dist/api/k8s/v1/api.gen.d.ts +1 -10
  37. package/dist/api/k8s/v1/api.gen.js +1 -23
  38. package/dist/api/k8s/v1/index.gen.d.ts +1 -1
  39. package/dist/api/k8s/v1/marshalling.gen.cjs +0 -4
  40. package/dist/api/k8s/v1/marshalling.gen.d.ts +1 -2
  41. package/dist/api/k8s/v1/marshalling.gen.js +0 -4
  42. package/dist/api/k8s/v1/types.gen.d.ts +0 -11
  43. package/dist/api/key_manager/v1alpha1/types.gen.d.ts +6 -2
  44. package/dist/api/secret/v1beta1/types.gen.d.ts +4 -4
  45. package/dist/api/tem/v1alpha1/api.gen.cjs +50 -0
  46. package/dist/api/tem/v1alpha1/api.gen.d.ts +13 -1
  47. package/dist/api/tem/v1alpha1/api.gen.js +51 -1
  48. package/dist/api/tem/v1alpha1/index.gen.cjs +2 -0
  49. package/dist/api/tem/v1alpha1/index.gen.d.ts +2 -1
  50. package/dist/api/tem/v1alpha1/index.gen.js +3 -1
  51. package/dist/api/tem/v1alpha1/marshalling.gen.cjs +71 -0
  52. package/dist/api/tem/v1alpha1/marshalling.gen.d.ts +5 -1
  53. package/dist/api/tem/v1alpha1/marshalling.gen.js +72 -1
  54. package/dist/api/tem/v1alpha1/types.gen.d.ts +117 -0
  55. package/dist/api/tem/v1alpha1/validation-rules.gen.cjs +33 -0
  56. package/dist/api/tem/v1alpha1/validation-rules.gen.d.ts +28 -0
  57. package/dist/api/tem/v1alpha1/validation-rules.gen.js +33 -0
  58. package/dist/scw/constants.cjs +1 -1
  59. package/dist/scw/constants.d.ts +2 -2
  60. package/dist/scw/constants.js +1 -1
  61. package/package.json +2 -2
@@ -256,5 +256,55 @@ class API extends api.API {
256
256
  },
257
257
  marshalling_gen.unmarshalDomainLastStatus
258
258
  );
259
+ pageOfListWebhooks = (request = {}) => this.client.fetch(
260
+ {
261
+ method: "GET",
262
+ path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks`,
263
+ urlParams: marshalling.urlParams(
264
+ ["domain_id", request.domainId],
265
+ ["order_by", request.orderBy],
266
+ ["organization_id", request.organizationId],
267
+ ["page", request.page],
268
+ [
269
+ "page_size",
270
+ request.pageSize ?? this.client.settings.defaultPageSize
271
+ ],
272
+ ["project_id", request.projectId]
273
+ )
274
+ },
275
+ marshalling_gen.unmarshalListWebhooksResponse
276
+ );
277
+ listWebhooks = (request = {}) => resourcePaginator.enrichForPagination("webhooks", this.pageOfListWebhooks, request);
278
+ updateWebhook = (request) => this.client.fetch(
279
+ {
280
+ body: JSON.stringify(
281
+ marshalling_gen.marshalUpdateWebhookRequest(request, this.client.settings)
282
+ ),
283
+ headers: jsonContentHeaders,
284
+ method: "PATCH",
285
+ path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${marshalling.validatePathParam("webhookId", request.webhookId)}`
286
+ },
287
+ marshalling_gen.unmarshalWebhook
288
+ );
289
+ deleteWebhook = (request) => this.client.fetch({
290
+ method: "DELETE",
291
+ path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${marshalling.validatePathParam("webhookId", request.webhookId)}`
292
+ });
293
+ pageOfListWebhookEvents = (request) => this.client.fetch(
294
+ {
295
+ method: "GET",
296
+ path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${marshalling.validatePathParam("webhookId", request.webhookId)}/events`,
297
+ urlParams: marshalling.urlParams(
298
+ ["order_by", request.orderBy],
299
+ ["page", request.page],
300
+ [
301
+ "page_size",
302
+ request.pageSize ?? this.client.settings.defaultPageSize
303
+ ]
304
+ )
305
+ },
306
+ marshalling_gen.unmarshalListWebhookEventsResponse
307
+ );
308
+ listWebhookEvents = (request) => resourcePaginator.enrichForPagination("webhookEvents", this.pageOfListWebhookEvents, request);
259
309
  }
260
310
  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, Domain, DomainLastStatus, Email, GetDomainLastStatusRequest, GetDomainRequest, GetEmailRequest, GetStatisticsRequest, ListDomainsRequest, ListDomainsResponse, ListEmailsRequest, ListEmailsResponse, RevokeDomainRequest, Statistics } from './types.gen';
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';
4
4
  /**
5
5
  * Transactional Email API.
6
6
  *
@@ -131,4 +131,16 @@ export declare class API extends ParentAPI {
131
131
  * @returns A Promise of DomainLastStatus
132
132
  */
133
133
  getDomainLastStatus: (request: Readonly<GetDomainLastStatusRequest>) => Promise<DomainLastStatus>;
134
+ protected pageOfListWebhooks: (request?: Readonly<ListWebhooksRequest>) => Promise<ListWebhooksResponse>;
135
+ listWebhooks: (request?: Readonly<ListWebhooksRequest>) => Promise<ListWebhooksResponse> & {
136
+ all: () => Promise<Webhook[]>;
137
+ [Symbol.asyncIterator]: () => AsyncGenerator<Webhook[], void, void>;
138
+ };
139
+ updateWebhook: (request: Readonly<UpdateWebhookRequest>) => Promise<Webhook>;
140
+ deleteWebhook: (request: Readonly<DeleteWebhookRequest>) => Promise<void>;
141
+ protected pageOfListWebhookEvents: (request: Readonly<ListWebhookEventsRequest>) => Promise<ListWebhookEventsResponse>;
142
+ listWebhookEvents: (request: Readonly<ListWebhookEventsRequest>) => Promise<ListWebhookEventsResponse> & {
143
+ all: () => Promise<import("./types.gen").WebhookEvent[]>;
144
+ [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").WebhookEvent[], void, void>;
145
+ };
134
146
  }
@@ -3,7 +3,7 @@ import { API as API$1 } from "../../../scw/api.js";
3
3
  import { validatePathParam, urlParams } from "../../../helpers/marshalling.js";
4
4
  import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
5
5
  import { EMAIL_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES } from "./content.gen.js";
6
- import { marshalCreateEmailRequest, unmarshalCreateEmailResponse, unmarshalEmail, unmarshalListEmailsResponse, unmarshalStatistics, marshalCreateDomainRequest, unmarshalDomain, unmarshalListDomainsResponse, unmarshalDomainLastStatus } from "./marshalling.gen.js";
6
+ import { marshalCreateEmailRequest, unmarshalCreateEmailResponse, unmarshalEmail, unmarshalListEmailsResponse, unmarshalStatistics, marshalCreateDomainRequest, unmarshalDomain, unmarshalListDomainsResponse, unmarshalDomainLastStatus, unmarshalListWebhooksResponse, marshalUpdateWebhookRequest, unmarshalWebhook, unmarshalListWebhookEventsResponse } from "./marshalling.gen.js";
7
7
  const jsonContentHeaders = {
8
8
  "Content-Type": "application/json; charset=utf-8"
9
9
  };
@@ -254,6 +254,56 @@ class API extends API$1 {
254
254
  },
255
255
  unmarshalDomainLastStatus
256
256
  );
257
+ pageOfListWebhooks = (request = {}) => this.client.fetch(
258
+ {
259
+ method: "GET",
260
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks`,
261
+ urlParams: urlParams(
262
+ ["domain_id", request.domainId],
263
+ ["order_by", request.orderBy],
264
+ ["organization_id", request.organizationId],
265
+ ["page", request.page],
266
+ [
267
+ "page_size",
268
+ request.pageSize ?? this.client.settings.defaultPageSize
269
+ ],
270
+ ["project_id", request.projectId]
271
+ )
272
+ },
273
+ unmarshalListWebhooksResponse
274
+ );
275
+ listWebhooks = (request = {}) => enrichForPagination("webhooks", this.pageOfListWebhooks, request);
276
+ updateWebhook = (request) => this.client.fetch(
277
+ {
278
+ body: JSON.stringify(
279
+ marshalUpdateWebhookRequest(request, this.client.settings)
280
+ ),
281
+ headers: jsonContentHeaders,
282
+ method: "PATCH",
283
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${validatePathParam("webhookId", request.webhookId)}`
284
+ },
285
+ unmarshalWebhook
286
+ );
287
+ deleteWebhook = (request) => this.client.fetch({
288
+ method: "DELETE",
289
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${validatePathParam("webhookId", request.webhookId)}`
290
+ });
291
+ pageOfListWebhookEvents = (request) => this.client.fetch(
292
+ {
293
+ method: "GET",
294
+ path: `/transactional-email/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${validatePathParam("webhookId", request.webhookId)}/events`,
295
+ urlParams: urlParams(
296
+ ["order_by", request.orderBy],
297
+ ["page", request.page],
298
+ [
299
+ "page_size",
300
+ request.pageSize ?? this.client.settings.defaultPageSize
301
+ ]
302
+ )
303
+ },
304
+ unmarshalListWebhookEventsResponse
305
+ );
306
+ listWebhookEvents = (request) => enrichForPagination("webhookEvents", this.pageOfListWebhookEvents, request);
257
307
  }
258
308
  export {
259
309
  API
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const api_gen = require("./api.gen.cjs");
4
4
  const content_gen = require("./content.gen.cjs");
5
+ const validationRules_gen = require("./validation-rules.gen.cjs");
5
6
  exports.API = api_gen.API;
6
7
  exports.DOMAIN_TRANSIENT_STATUSES = content_gen.DOMAIN_TRANSIENT_STATUSES;
7
8
  exports.EMAIL_TRANSIENT_STATUSES = content_gen.EMAIL_TRANSIENT_STATUSES;
9
+ exports.ValidationRules = validationRules_gen;
@@ -1,3 +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, 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, RevokeDomainRequest, Statistics, } from './types.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';
4
+ export * as ValidationRules from './validation-rules.gen';
@@ -1,7 +1,9 @@
1
1
  import { API } from "./api.gen.js";
2
2
  import { DOMAIN_TRANSIENT_STATUSES, EMAIL_TRANSIENT_STATUSES } from "./content.gen.js";
3
+ import * as validationRules_gen from "./validation-rules.gen.js";
3
4
  export {
4
5
  API,
5
6
  DOMAIN_TRANSIENT_STATUSES,
6
- EMAIL_TRANSIENT_STATUSES
7
+ EMAIL_TRANSIENT_STATUSES,
8
+ validationRules_gen as ValidationRules
7
9
  };
@@ -112,6 +112,24 @@ const unmarshalDomain = (data) => {
112
112
  status: data.status
113
113
  };
114
114
  };
115
+ const unmarshalWebhook = (data) => {
116
+ if (!json.isJSONObject(data)) {
117
+ throw new TypeError(
118
+ `Unmarshalling the type 'Webhook' failed as data isn't a dictionary.`
119
+ );
120
+ }
121
+ return {
122
+ createdAt: marshalling.unmarshalDate(data.created_at),
123
+ domainId: data.domain_id,
124
+ eventTypes: data.event_types,
125
+ id: data.id,
126
+ name: data.name,
127
+ organizationId: data.organization_id,
128
+ projectId: data.project_id,
129
+ snsArn: data.sns_arn,
130
+ updatedAt: marshalling.unmarshalDate(data.updated_at)
131
+ };
132
+ };
115
133
  const unmarshalCreateEmailResponse = (data) => {
116
134
  if (!json.isJSONObject(data)) {
117
135
  throw new TypeError(
@@ -194,6 +212,50 @@ const unmarshalListEmailsResponse = (data) => {
194
212
  totalCount: data.total_count
195
213
  };
196
214
  };
215
+ const unmarshalWebhookEvent = (data) => {
216
+ if (!json.isJSONObject(data)) {
217
+ throw new TypeError(
218
+ `Unmarshalling the type 'WebhookEvent' failed as data isn't a dictionary.`
219
+ );
220
+ }
221
+ return {
222
+ createdAt: marshalling.unmarshalDate(data.created_at),
223
+ data: data.data,
224
+ emailId: data.email_id,
225
+ id: data.id,
226
+ organizationId: data.organization_id,
227
+ projectId: data.project_id,
228
+ status: data.status,
229
+ type: data.type,
230
+ updatedAt: marshalling.unmarshalDate(data.updated_at),
231
+ webhookId: data.webhook_id
232
+ };
233
+ };
234
+ const unmarshalListWebhookEventsResponse = (data) => {
235
+ if (!json.isJSONObject(data)) {
236
+ throw new TypeError(
237
+ `Unmarshalling the type 'ListWebhookEventsResponse' failed as data isn't a dictionary.`
238
+ );
239
+ }
240
+ return {
241
+ totalCount: data.total_count,
242
+ webhookEvents: marshalling.unmarshalArrayOfObject(
243
+ data.webhook_events,
244
+ unmarshalWebhookEvent
245
+ )
246
+ };
247
+ };
248
+ const unmarshalListWebhooksResponse = (data) => {
249
+ if (!json.isJSONObject(data)) {
250
+ throw new TypeError(
251
+ `Unmarshalling the type 'ListWebhooksResponse' failed as data isn't a dictionary.`
252
+ );
253
+ }
254
+ return {
255
+ totalCount: data.total_count,
256
+ webhooks: marshalling.unmarshalArrayOfObject(data.webhooks, unmarshalWebhook)
257
+ };
258
+ };
197
259
  const unmarshalStatistics = (data) => {
198
260
  if (!json.isJSONObject(data)) {
199
261
  throw new TypeError(
@@ -244,12 +306,21 @@ const marshalCreateEmailRequest = (request, defaults) => ({
244
306
  text: request.text,
245
307
  to: request.to !== void 0 ? request.to.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0
246
308
  });
309
+ const marshalUpdateWebhookRequest = (request, defaults) => ({
310
+ event_types: request.eventTypes !== void 0 ? request.eventTypes : void 0,
311
+ name: request.name,
312
+ sns_arn: request.snsArn
313
+ });
247
314
  exports.marshalCreateDomainRequest = marshalCreateDomainRequest;
248
315
  exports.marshalCreateEmailRequest = marshalCreateEmailRequest;
316
+ exports.marshalUpdateWebhookRequest = marshalUpdateWebhookRequest;
249
317
  exports.unmarshalCreateEmailResponse = unmarshalCreateEmailResponse;
250
318
  exports.unmarshalDomain = unmarshalDomain;
251
319
  exports.unmarshalDomainLastStatus = unmarshalDomainLastStatus;
252
320
  exports.unmarshalEmail = unmarshalEmail;
253
321
  exports.unmarshalListDomainsResponse = unmarshalListDomainsResponse;
254
322
  exports.unmarshalListEmailsResponse = unmarshalListEmailsResponse;
323
+ exports.unmarshalListWebhookEventsResponse = unmarshalListWebhookEventsResponse;
324
+ exports.unmarshalListWebhooksResponse = unmarshalListWebhooksResponse;
255
325
  exports.unmarshalStatistics = unmarshalStatistics;
326
+ exports.unmarshalWebhook = unmarshalWebhook;
@@ -1,11 +1,15 @@
1
1
  import type { DefaultValues } from '../../../bridge';
2
- import type { CreateDomainRequest, CreateEmailRequest, CreateEmailResponse, Domain, DomainLastStatus, Email, ListDomainsResponse, ListEmailsResponse, Statistics } from './types.gen';
2
+ import type { CreateDomainRequest, CreateEmailRequest, CreateEmailResponse, 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
+ export declare const unmarshalWebhook: (data: unknown) => Webhook;
5
6
  export declare const unmarshalCreateEmailResponse: (data: unknown) => CreateEmailResponse;
6
7
  export declare const unmarshalDomainLastStatus: (data: unknown) => DomainLastStatus;
7
8
  export declare const unmarshalListDomainsResponse: (data: unknown) => ListDomainsResponse;
8
9
  export declare const unmarshalListEmailsResponse: (data: unknown) => ListEmailsResponse;
10
+ export declare const unmarshalListWebhookEventsResponse: (data: unknown) => ListWebhookEventsResponse;
11
+ export declare const unmarshalListWebhooksResponse: (data: unknown) => ListWebhooksResponse;
9
12
  export declare const unmarshalStatistics: (data: unknown) => Statistics;
10
13
  export declare const marshalCreateDomainRequest: (request: CreateDomainRequest, defaults: DefaultValues) => Record<string, unknown>;
11
14
  export declare const marshalCreateEmailRequest: (request: CreateEmailRequest, defaults: DefaultValues) => Record<string, unknown>;
15
+ export declare const marshalUpdateWebhookRequest: (request: UpdateWebhookRequest, defaults: DefaultValues) => Record<string, unknown>;
@@ -110,6 +110,24 @@ const unmarshalDomain = (data) => {
110
110
  status: data.status
111
111
  };
112
112
  };
113
+ const unmarshalWebhook = (data) => {
114
+ if (!isJSONObject(data)) {
115
+ throw new TypeError(
116
+ `Unmarshalling the type 'Webhook' failed as data isn't a dictionary.`
117
+ );
118
+ }
119
+ return {
120
+ createdAt: unmarshalDate(data.created_at),
121
+ domainId: data.domain_id,
122
+ eventTypes: data.event_types,
123
+ id: data.id,
124
+ name: data.name,
125
+ organizationId: data.organization_id,
126
+ projectId: data.project_id,
127
+ snsArn: data.sns_arn,
128
+ updatedAt: unmarshalDate(data.updated_at)
129
+ };
130
+ };
113
131
  const unmarshalCreateEmailResponse = (data) => {
114
132
  if (!isJSONObject(data)) {
115
133
  throw new TypeError(
@@ -192,6 +210,50 @@ const unmarshalListEmailsResponse = (data) => {
192
210
  totalCount: data.total_count
193
211
  };
194
212
  };
213
+ const unmarshalWebhookEvent = (data) => {
214
+ if (!isJSONObject(data)) {
215
+ throw new TypeError(
216
+ `Unmarshalling the type 'WebhookEvent' failed as data isn't a dictionary.`
217
+ );
218
+ }
219
+ return {
220
+ createdAt: unmarshalDate(data.created_at),
221
+ data: data.data,
222
+ emailId: data.email_id,
223
+ id: data.id,
224
+ organizationId: data.organization_id,
225
+ projectId: data.project_id,
226
+ status: data.status,
227
+ type: data.type,
228
+ updatedAt: unmarshalDate(data.updated_at),
229
+ webhookId: data.webhook_id
230
+ };
231
+ };
232
+ const unmarshalListWebhookEventsResponse = (data) => {
233
+ if (!isJSONObject(data)) {
234
+ throw new TypeError(
235
+ `Unmarshalling the type 'ListWebhookEventsResponse' failed as data isn't a dictionary.`
236
+ );
237
+ }
238
+ return {
239
+ totalCount: data.total_count,
240
+ webhookEvents: unmarshalArrayOfObject(
241
+ data.webhook_events,
242
+ unmarshalWebhookEvent
243
+ )
244
+ };
245
+ };
246
+ const unmarshalListWebhooksResponse = (data) => {
247
+ if (!isJSONObject(data)) {
248
+ throw new TypeError(
249
+ `Unmarshalling the type 'ListWebhooksResponse' failed as data isn't a dictionary.`
250
+ );
251
+ }
252
+ return {
253
+ totalCount: data.total_count,
254
+ webhooks: unmarshalArrayOfObject(data.webhooks, unmarshalWebhook)
255
+ };
256
+ };
195
257
  const unmarshalStatistics = (data) => {
196
258
  if (!isJSONObject(data)) {
197
259
  throw new TypeError(
@@ -242,14 +304,23 @@ const marshalCreateEmailRequest = (request, defaults) => ({
242
304
  text: request.text,
243
305
  to: request.to !== void 0 ? request.to.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0
244
306
  });
307
+ const marshalUpdateWebhookRequest = (request, defaults) => ({
308
+ event_types: request.eventTypes !== void 0 ? request.eventTypes : void 0,
309
+ name: request.name,
310
+ sns_arn: request.snsArn
311
+ });
245
312
  export {
246
313
  marshalCreateDomainRequest,
247
314
  marshalCreateEmailRequest,
315
+ marshalUpdateWebhookRequest,
248
316
  unmarshalCreateEmailResponse,
249
317
  unmarshalDomain,
250
318
  unmarshalDomainLastStatus,
251
319
  unmarshalEmail,
252
320
  unmarshalListDomainsResponse,
253
321
  unmarshalListEmailsResponse,
254
- unmarshalStatistics
322
+ unmarshalListWebhookEventsResponse,
323
+ unmarshalListWebhooksResponse,
324
+ unmarshalStatistics,
325
+ unmarshalWebhook
255
326
  };
@@ -6,6 +6,10 @@ export type EmailFlag = 'unknown_flag' | 'soft_bounce' | 'hard_bounce' | 'spam'
6
6
  export type EmailRcptType = 'unknown_rcpt_type' | 'to' | 'cc' | 'bcc';
7
7
  export type EmailStatus = 'unknown' | 'new' | 'sending' | 'sent' | 'failed' | 'canceled';
8
8
  export type ListEmailsRequestOrderBy = 'created_at_desc' | 'created_at_asc' | 'updated_at_desc' | 'updated_at_asc' | 'status_desc' | 'status_asc' | 'mail_from_desc' | 'mail_from_asc' | 'mail_rcpt_desc' | 'mail_rcpt_asc' | 'subject_desc' | 'subject_asc';
9
+ export type ListWebhookEventsRequestOrderBy = 'created_at_desc' | 'created_at_asc';
10
+ export type ListWebhooksRequestOrderBy = 'created_at_desc' | 'created_at_asc';
11
+ export type WebhookEventStatus = 'unknown_status' | 'waiting' | 'sending' | 'sent' | 'error';
12
+ export type WebhookEventType = 'unknown_type' | 'email_queued' | 'email_dropped' | 'email_deferred' | 'email_delivered' | 'email_spam' | 'email_mailbox_not_found';
9
13
  export interface DomainRecordsDMARC {
10
14
  /** Name of the DMARC TXT record. */
11
15
  name: string;
@@ -173,6 +177,48 @@ export interface Domain {
173
177
  */
174
178
  region: Region;
175
179
  }
180
+ export interface WebhookEvent {
181
+ /** ID of the Webhook Event. */
182
+ id: string;
183
+ /** ID of the Webhook that triggers the Event. */
184
+ webhookId: string;
185
+ /** ID of the Webhook Event Organization. */
186
+ organizationId: string;
187
+ /** ID of the Webhook Event Project. */
188
+ projectId: string;
189
+ /** Type of the Webhook Event. */
190
+ type: WebhookEventType;
191
+ /** Status of the Webhook Event. */
192
+ status: WebhookEventStatus;
193
+ /** Data sent to the Webhook destination. */
194
+ data: string;
195
+ /** Date and time of the Webhook Event creation. */
196
+ createdAt?: Date;
197
+ /** Date and time of last Webhook Event updates. */
198
+ updatedAt?: Date;
199
+ /** Optional Email ID if the event is triggered by an Email resource. */
200
+ emailId?: string;
201
+ }
202
+ export interface Webhook {
203
+ /** ID of the Webhook. */
204
+ id: string;
205
+ /** ID of the Domain to watch for triggering events. */
206
+ domainId: string;
207
+ /** ID of the Webhook Organization. */
208
+ organizationId: string;
209
+ /** ID of the Webhook Project. */
210
+ projectId: string;
211
+ /** Name of the Webhook. */
212
+ name: string;
213
+ /** List of event types that will trigger a Webhook Event. */
214
+ eventTypes: WebhookEventType[];
215
+ /** Scaleway SNS ARN topic to push the events to. */
216
+ snsArn: string;
217
+ /** Date and time of the Webhook creation. */
218
+ createdAt?: Date;
219
+ /** Date and time of last Webhook updates. */
220
+ updatedAt?: Date;
221
+ }
176
222
  export type CancelEmailRequest = {
177
223
  /**
178
224
  * Region to target. If none is passed will use default region from the
@@ -237,6 +283,15 @@ export interface CreateEmailResponse {
237
283
  /** Single page of emails matching the requested criteria. */
238
284
  emails: Email[];
239
285
  }
286
+ export type DeleteWebhookRequest = {
287
+ /**
288
+ * Region to target. If none is passed will use default region from the
289
+ * config.
290
+ */
291
+ region?: Region;
292
+ /** ID of the Webhook to delete. */
293
+ webhookId: string;
294
+ };
240
295
  export interface DomainLastStatus {
241
296
  /** The ID of the domain. */
242
297
  domainId: string;
@@ -318,6 +373,7 @@ export type ListDomainsRequest = {
318
373
  export interface ListDomainsResponse {
319
374
  /** Number of domains that match the request (without pagination). */
320
375
  totalCount: number;
376
+ /** Single page of domains matching the requested criteria. */
321
377
  domains: Domain[];
322
378
  }
323
379
  export type ListEmailsRequest = {
@@ -361,6 +417,52 @@ export interface ListEmailsResponse {
361
417
  /** Single page of emails matching the requested criteria. */
362
418
  emails: Email[];
363
419
  }
420
+ export type ListWebhookEventsRequest = {
421
+ /**
422
+ * Region to target. If none is passed will use default region from the
423
+ * config.
424
+ */
425
+ region?: Region;
426
+ /** ID of the Webhook linked to the events. */
427
+ webhookId: string;
428
+ /** (Optional) List Webhook events corresponding to specific criteria. */
429
+ orderBy?: ListWebhookEventsRequestOrderBy;
430
+ /** Requested page number. Value must be greater or equal to 1. */
431
+ page?: number;
432
+ /** Requested page size. Value must be between 1 and 100. */
433
+ pageSize?: number;
434
+ };
435
+ export interface ListWebhookEventsResponse {
436
+ /** Number of Webhook events matching the requested criteria. */
437
+ totalCount: number;
438
+ /** Single page of Webhook events matching the requested criteria. */
439
+ webhookEvents: WebhookEvent[];
440
+ }
441
+ export type ListWebhooksRequest = {
442
+ /**
443
+ * Region to target. If none is passed will use default region from the
444
+ * config.
445
+ */
446
+ region?: Region;
447
+ /** (Optional) List Webhooks corresponding to specific criteria. */
448
+ orderBy?: ListWebhooksRequestOrderBy;
449
+ /** (Optional) Requested page number. Value must be greater or equal to 1. */
450
+ page?: number;
451
+ /** (Optional) Requested page size. Value must be between 1 and 100. */
452
+ pageSize?: number;
453
+ /** (Optional) ID of the Project for which to list the Webhooks. */
454
+ projectId?: string;
455
+ /** (Optional) ID of the Organization for which to list the Webhooks. */
456
+ organizationId?: string;
457
+ /** (Optional) ID of the Domain for which to list the Webhooks. */
458
+ domainId?: string;
459
+ };
460
+ export interface ListWebhooksResponse {
461
+ /** Number of Webhooks matching the requested criteria. */
462
+ totalCount: number;
463
+ /** Single page of Webhooks matching the requested criteria. */
464
+ webhooks: Webhook[];
465
+ }
364
466
  export type RevokeDomainRequest = {
365
467
  /**
366
468
  * Region to target. If none is passed will use default region from the
@@ -399,3 +501,18 @@ export interface Statistics {
399
501
  */
400
502
  canceledCount: number;
401
503
  }
504
+ export type UpdateWebhookRequest = {
505
+ /**
506
+ * Region to target. If none is passed will use default region from the
507
+ * config.
508
+ */
509
+ region?: Region;
510
+ /** ID of the Webhook to update. */
511
+ webhookId: string;
512
+ /** Name of the Webhook to update. */
513
+ name?: string;
514
+ /** List of event types to update. */
515
+ eventTypes?: WebhookEventType[];
516
+ /** Scaleway SNS ARN topic to update. */
517
+ snsArn?: string;
518
+ };
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const ListWebhookEventsRequest = {
4
+ page: {
5
+ greaterThan: 0
6
+ },
7
+ pageSize: {
8
+ greaterThanOrEqual: 1,
9
+ lessThanOrEqual: 100
10
+ }
11
+ };
12
+ const ListWebhooksRequest = {
13
+ page: {
14
+ greaterThan: 0
15
+ },
16
+ pageSize: {
17
+ greaterThanOrEqual: 1,
18
+ lessThanOrEqual: 100
19
+ }
20
+ };
21
+ const UpdateWebhookRequest = {
22
+ name: {
23
+ maxLength: 127,
24
+ minLength: 3
25
+ },
26
+ snsArn: {
27
+ maxLength: 127,
28
+ minLength: 3
29
+ }
30
+ };
31
+ exports.ListWebhookEventsRequest = ListWebhookEventsRequest;
32
+ exports.ListWebhooksRequest = ListWebhooksRequest;
33
+ exports.UpdateWebhookRequest = UpdateWebhookRequest;
@@ -0,0 +1,28 @@
1
+ export declare const ListWebhookEventsRequest: {
2
+ page: {
3
+ greaterThan: number;
4
+ };
5
+ pageSize: {
6
+ greaterThanOrEqual: number;
7
+ lessThanOrEqual: number;
8
+ };
9
+ };
10
+ export declare const ListWebhooksRequest: {
11
+ page: {
12
+ greaterThan: number;
13
+ };
14
+ pageSize: {
15
+ greaterThanOrEqual: number;
16
+ lessThanOrEqual: number;
17
+ };
18
+ };
19
+ export declare const UpdateWebhookRequest: {
20
+ name: {
21
+ maxLength: number;
22
+ minLength: number;
23
+ };
24
+ snsArn: {
25
+ maxLength: number;
26
+ minLength: number;
27
+ };
28
+ };
@@ -0,0 +1,33 @@
1
+ const ListWebhookEventsRequest = {
2
+ page: {
3
+ greaterThan: 0
4
+ },
5
+ pageSize: {
6
+ greaterThanOrEqual: 1,
7
+ lessThanOrEqual: 100
8
+ }
9
+ };
10
+ const ListWebhooksRequest = {
11
+ page: {
12
+ greaterThan: 0
13
+ },
14
+ pageSize: {
15
+ greaterThanOrEqual: 1,
16
+ lessThanOrEqual: 100
17
+ }
18
+ };
19
+ const UpdateWebhookRequest = {
20
+ name: {
21
+ maxLength: 127,
22
+ minLength: 3
23
+ },
24
+ snsArn: {
25
+ maxLength: 127,
26
+ minLength: 3
27
+ }
28
+ };
29
+ export {
30
+ ListWebhookEventsRequest,
31
+ ListWebhooksRequest,
32
+ UpdateWebhookRequest
33
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const version = "v2.30.0";
3
+ const version = "v2.32.0";
4
4
  const userAgent = `scaleway-sdk-js/${version}`;
5
5
  exports.userAgent = userAgent;
6
6
  exports.version = version;
@@ -1,2 +1,2 @@
1
- export declare const version = "v2.30.0";
2
- export declare const userAgent = "scaleway-sdk-js/v2.30.0";
1
+ export declare const version = "v2.32.0";
2
+ export declare const userAgent = "scaleway-sdk-js/v2.32.0";
@@ -1,4 +1,4 @@
1
- const version = "v2.30.0";
1
+ const version = "v2.32.0";
2
2
  const userAgent = `scaleway-sdk-js/${version}`;
3
3
  export {
4
4
  userAgent,