@scaleway/sdk 2.40.0 → 2.42.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 (28) hide show
  1. package/dist/api/applesilicon/v1alpha1/marshalling.gen.cjs +2 -0
  2. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +2 -0
  3. package/dist/api/applesilicon/v1alpha1/types.gen.d.ts +5 -1
  4. package/dist/api/domain/v2beta1/types.gen.d.ts +1 -1
  5. package/dist/api/instance/v1/types.gen.d.ts +2 -1
  6. package/dist/api/tem/v1alpha1/api.gen.cjs +60 -0
  7. package/dist/api/tem/v1alpha1/api.gen.d.ts +45 -1
  8. package/dist/api/tem/v1alpha1/api.gen.js +61 -1
  9. package/dist/api/tem/v1alpha1/index.gen.d.ts +1 -1
  10. package/dist/api/tem/v1alpha1/marshalling.gen.cjs +8 -0
  11. package/dist/api/tem/v1alpha1/marshalling.gen.d.ts +2 -1
  12. package/dist/api/tem/v1alpha1/marshalling.gen.js +8 -0
  13. package/dist/api/tem/v1alpha1/types.gen.d.ts +27 -1
  14. package/dist/api/tem/v1alpha1/validation-rules.gen.cjs +11 -0
  15. package/dist/api/tem/v1alpha1/validation-rules.gen.d.ts +10 -0
  16. package/dist/api/tem/v1alpha1/validation-rules.gen.js +11 -0
  17. package/dist/api/webhosting/v1alpha1/api.gen.cjs +17 -0
  18. package/dist/api/webhosting/v1alpha1/api.gen.d.ts +8 -1
  19. package/dist/api/webhosting/v1alpha1/api.gen.js +18 -1
  20. package/dist/api/webhosting/v1alpha1/index.gen.d.ts +1 -1
  21. package/dist/api/webhosting/v1alpha1/marshalling.gen.cjs +15 -0
  22. package/dist/api/webhosting/v1alpha1/marshalling.gen.d.ts +3 -1
  23. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +15 -0
  24. package/dist/api/webhosting/v1alpha1/types.gen.d.ts +15 -0
  25. package/dist/scw/constants.cjs +1 -1
  26. package/dist/scw/constants.d.ts +2 -2
  27. package/dist/scw/constants.js +1 -1
  28. package/package.json +2 -2
@@ -109,7 +109,9 @@ const unmarshalServer = (data) => {
109
109
  organizationId: data.organization_id,
110
110
  os: data.os ? unmarshalOS(data.os) : void 0,
111
111
  projectId: data.project_id,
112
+ sshUsername: data.ssh_username,
112
113
  status: data.status,
114
+ sudoPassword: data.sudo_password,
113
115
  type: data.type,
114
116
  updatedAt: marshalling.unmarshalDate(data.updated_at),
115
117
  vncUrl: data.vnc_url,
@@ -107,7 +107,9 @@ const unmarshalServer = (data) => {
107
107
  organizationId: data.organization_id,
108
108
  os: data.os ? unmarshalOS(data.os) : void 0,
109
109
  projectId: data.project_id,
110
+ sshUsername: data.ssh_username,
110
111
  status: data.status,
112
+ sudoPassword: data.sudo_password,
111
113
  type: data.type,
112
114
  updatedAt: unmarshalDate(data.updated_at),
113
115
  vncUrl: data.vnc_url,
@@ -74,8 +74,12 @@ export interface Server {
74
74
  organizationId: string;
75
75
  /** IPv4 address of the server. */
76
76
  ip: string;
77
- /** URL of the VNC. */
77
+ /** Vnc:// URL to access Apple Remote Desktop. */
78
78
  vncUrl: string;
79
+ /** SSH Username for remote shell. */
80
+ sshUsername: string;
81
+ /** Admin password required to execute commands. */
82
+ sudoPassword: string;
79
83
  /**
80
84
  * Initially installed OS, this does not necessarily reflect the current OS
81
85
  * version.
@@ -10,7 +10,7 @@ export type DSRecordAlgorithm = 'rsamd5' | 'dh' | 'dsa' | 'rsasha1' | 'dsa_nsec3
10
10
  export type DSRecordDigestType = 'sha_1' | 'sha_256' | 'gost_r_34_11_94' | 'sha_384';
11
11
  export type DomainFeatureStatus = 'feature_status_unknown' | 'enabling' | 'enabled' | 'disabling' | 'disabled';
12
12
  export type DomainRecordHTTPServiceConfigStrategy = 'random' | 'hashed' | 'all';
13
- export type DomainRecordType = 'unknown' | 'A' | 'AAAA' | 'CNAME' | 'TXT' | 'SRV' | 'TLSA' | 'MX' | 'NS' | 'PTR' | 'CAA' | 'ALIAS' | 'LOC' | 'SSHFP' | 'HINFO' | 'RP' | 'URI' | 'DS' | 'NAPTR' | 'DNAME';
13
+ export type DomainRecordType = 'unknown' | 'A' | 'AAAA' | 'CNAME' | 'TXT' | 'SRV' | 'TLSA' | 'MX' | 'NS' | 'PTR' | 'CAA' | 'ALIAS' | 'LOC' | 'SSHFP' | 'HINFO' | 'RP' | 'URI' | 'DS' | 'NAPTR' | 'DNAME' | 'SVCB' | 'HTTPS';
14
14
  export type DomainRegistrationStatusTransferStatus = 'status_unknown' | 'pending' | 'waiting_vote' | 'rejected' | 'processing' | 'done';
15
15
  export type DomainStatus = 'status_unknown' | 'active' | 'creating' | 'create_error' | 'renewing' | 'renew_error' | 'xfering' | 'xfer_error' | 'expired' | 'expiring' | 'updating' | 'checking' | 'locked' | 'deleting';
16
16
  export type HostStatus = 'unknown_status' | 'active' | 'updating' | 'deleting';
@@ -216,7 +216,8 @@ export interface ServerMaintenance {
216
216
  export interface VolumeServer {
217
217
  id: string;
218
218
  name: string;
219
- exportUri: string;
219
+ /** @deprecated */
220
+ exportUri?: string;
220
221
  organization: string;
221
222
  server?: ServerSummary;
222
223
  size: number;
@@ -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, unmarshalWebhook, unmarshalListWebhookEventsResponse } from "./marshalling.gen.js";
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';
@@ -308,6 +308,13 @@ const marshalCreateEmailRequest = (request, defaults) => ({
308
308
  text: request.text,
309
309
  to: request.to !== void 0 ? request.to.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0
310
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
+ });
311
318
  const marshalUpdateWebhookRequest = (request, defaults) => ({
312
319
  event_types: request.eventTypes !== void 0 ? request.eventTypes : void 0,
313
320
  name: request.name,
@@ -315,6 +322,7 @@ const marshalUpdateWebhookRequest = (request, defaults) => ({
315
322
  });
316
323
  exports.marshalCreateDomainRequest = marshalCreateDomainRequest;
317
324
  exports.marshalCreateEmailRequest = marshalCreateEmailRequest;
325
+ exports.marshalCreateWebhookRequest = marshalCreateWebhookRequest;
318
326
  exports.marshalUpdateWebhookRequest = marshalUpdateWebhookRequest;
319
327
  exports.unmarshalCreateEmailResponse = unmarshalCreateEmailResponse;
320
328
  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>;
@@ -306,6 +306,13 @@ const marshalCreateEmailRequest = (request, defaults) => ({
306
306
  text: request.text,
307
307
  to: request.to !== void 0 ? request.to.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0
308
308
  });
309
+ const marshalCreateWebhookRequest = (request, defaults) => ({
310
+ domain_id: request.domainId,
311
+ event_types: request.eventTypes !== void 0 ? request.eventTypes : void 0,
312
+ name: request.name,
313
+ project_id: request.projectId ?? defaults.defaultProjectId,
314
+ sns_arn: request.snsArn
315
+ });
309
316
  const marshalUpdateWebhookRequest = (request, defaults) => ({
310
317
  event_types: request.eventTypes !== void 0 ? request.eventTypes : void 0,
311
318
  name: request.name,
@@ -314,6 +321,7 @@ const marshalUpdateWebhookRequest = (request, defaults) => ({
314
321
  export {
315
322
  marshalCreateDomainRequest,
316
323
  marshalCreateEmailRequest,
324
+ marshalCreateWebhookRequest,
317
325
  marshalUpdateWebhookRequest,
318
326
  unmarshalCreateEmailResponse,
319
327
  unmarshalDomain,
@@ -8,7 +8,7 @@ export type EmailStatus = 'unknown' | 'new' | 'sending' | 'sent' | 'failed' | 'c
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
9
  export type ListWebhookEventsRequestOrderBy = 'created_at_desc' | 'created_at_asc';
10
10
  export type ListWebhooksRequestOrderBy = 'created_at_desc' | 'created_at_asc';
11
- export type WebhookEventStatus = 'unknown_status' | 'waiting' | 'sending' | 'sent' | 'error';
11
+ export type WebhookEventStatus = 'unknown_status' | 'sending' | 'sent' | 'failed';
12
12
  export type WebhookEventType = 'unknown_type' | 'email_queued' | 'email_dropped' | 'email_deferred' | 'email_delivered' | 'email_spam' | 'email_mailbox_not_found';
13
13
  export interface DomainRecordsDMARC {
14
14
  /** Name of the DMARC TXT record. */
@@ -285,6 +285,23 @@ export interface CreateEmailResponse {
285
285
  /** Single page of emails matching the requested criteria. */
286
286
  emails: Email[];
287
287
  }
288
+ export type CreateWebhookRequest = {
289
+ /**
290
+ * Region to target. If none is passed will use default region from the
291
+ * config.
292
+ */
293
+ region?: Region;
294
+ /** ID of the Domain to watch for triggering events. */
295
+ domainId: string;
296
+ /** ID of the project to which the Webhook belongs. */
297
+ projectId?: string;
298
+ /** Name of the Webhook. */
299
+ name: string;
300
+ /** List of event types that will trigger an event. */
301
+ eventTypes?: WebhookEventType[];
302
+ /** Scaleway SNS ARN topic to push the events to. */
303
+ snsArn: string;
304
+ };
288
305
  export type DeleteWebhookRequest = {
289
306
  /**
290
307
  * Region to target. If none is passed will use default region from the
@@ -353,6 +370,15 @@ export type GetStatisticsRequest = {
353
370
  /** (Optional) Number of emails sent with this sender's email address. */
354
371
  mailFrom?: string;
355
372
  };
373
+ export type GetWebhookRequest = {
374
+ /**
375
+ * Region to target. If none is passed will use default region from the
376
+ * config.
377
+ */
378
+ region?: Region;
379
+ /** ID of the Webhook to check. */
380
+ webhookId: string;
381
+ };
356
382
  export type ListDomainsRequest = {
357
383
  /**
358
384
  * Region to target. If none is passed will use default region from the
@@ -32,6 +32,16 @@ const CreateEmailRequestHeader = {
32
32
  minLength: 1
33
33
  }
34
34
  };
35
+ const CreateWebhookRequest = {
36
+ name: {
37
+ maxLength: 127,
38
+ minLength: 3
39
+ },
40
+ snsArn: {
41
+ maxLength: 127,
42
+ minLength: 3
43
+ }
44
+ };
35
45
  const ListDomainsRequest = {
36
46
  page: {
37
47
  greaterThan: 0
@@ -90,6 +100,7 @@ exports.CreateEmailRequest = CreateEmailRequest;
90
100
  exports.CreateEmailRequestAddress = CreateEmailRequestAddress;
91
101
  exports.CreateEmailRequestAttachment = CreateEmailRequestAttachment;
92
102
  exports.CreateEmailRequestHeader = CreateEmailRequestHeader;
103
+ exports.CreateWebhookRequest = CreateWebhookRequest;
93
104
  exports.ListDomainsRequest = ListDomainsRequest;
94
105
  exports.ListEmailsRequest = ListEmailsRequest;
95
106
  exports.ListWebhookEventsRequest = ListWebhookEventsRequest;
@@ -30,6 +30,16 @@ export declare const CreateEmailRequestHeader: {
30
30
  minLength: number;
31
31
  };
32
32
  };
33
+ export declare const CreateWebhookRequest: {
34
+ name: {
35
+ maxLength: number;
36
+ minLength: number;
37
+ };
38
+ snsArn: {
39
+ maxLength: number;
40
+ minLength: number;
41
+ };
42
+ };
33
43
  export declare const ListDomainsRequest: {
34
44
  page: {
35
45
  greaterThan: number;
@@ -30,6 +30,16 @@ const CreateEmailRequestHeader = {
30
30
  minLength: 1
31
31
  }
32
32
  };
33
+ const CreateWebhookRequest = {
34
+ name: {
35
+ maxLength: 127,
36
+ minLength: 3
37
+ },
38
+ snsArn: {
39
+ maxLength: 127,
40
+ minLength: 3
41
+ }
42
+ };
33
43
  const ListDomainsRequest = {
34
44
  page: {
35
45
  greaterThan: 0
@@ -89,6 +99,7 @@ export {
89
99
  CreateEmailRequestAddress,
90
100
  CreateEmailRequestAttachment,
91
101
  CreateEmailRequestHeader,
102
+ CreateWebhookRequest,
92
103
  ListDomainsRequest,
93
104
  ListEmailsRequest,
94
105
  ListWebhookEventsRequest,
@@ -157,6 +157,23 @@ class API extends api.API {
157
157
  },
158
158
  marshalling_gen.unmarshalDnsRecords
159
159
  );
160
+ /**
161
+ * "Check whether you own this domain or not.".
162
+ *
163
+ * @param request - The request {@link CheckUserOwnsDomainRequest}
164
+ * @returns A Promise of CheckUserOwnsDomainResponse
165
+ */
166
+ checkUserOwnsDomain = (request) => this.client.fetch(
167
+ {
168
+ body: JSON.stringify(
169
+ marshalling_gen.marshalCheckUserOwnsDomainRequest(request, this.client.settings)
170
+ ),
171
+ headers: jsonContentHeaders,
172
+ method: "POST",
173
+ path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam("domain", request.domain)}/check-ownership`
174
+ },
175
+ marshalling_gen.unmarshalCheckUserOwnsDomainResponse
176
+ );
160
177
  /**
161
178
  * List all offers. List the different Web Hosting offers, and their options,
162
179
  * available to order from Scaleway.
@@ -1,6 +1,6 @@
1
1
  import { API as ParentAPI } from '../../../bridge';
2
2
  import type { Region, WaitForOptions } from '../../../bridge';
3
- import type { CreateHostingRequest, CreateSessionRequest, DeleteHostingRequest, DnsRecords, GetDomainDnsRecordsRequest, GetHostingRequest, Hosting, ListControlPanelsRequest, ListControlPanelsResponse, ListHostingsRequest, ListHostingsResponse, ListOffersRequest, ListOffersResponse, ResetHostingPasswordRequest, ResetHostingPasswordResponse, RestoreHostingRequest, Session, UpdateHostingRequest } from './types.gen';
3
+ import type { CheckUserOwnsDomainRequest, CheckUserOwnsDomainResponse, CreateHostingRequest, CreateSessionRequest, DeleteHostingRequest, DnsRecords, GetDomainDnsRecordsRequest, GetHostingRequest, Hosting, ListControlPanelsRequest, ListControlPanelsResponse, ListHostingsRequest, ListHostingsResponse, ListOffersRequest, ListOffersResponse, ResetHostingPasswordRequest, ResetHostingPasswordResponse, RestoreHostingRequest, Session, UpdateHostingRequest } from './types.gen';
4
4
  /**
5
5
  * Web Hosting API.
6
6
  *
@@ -85,6 +85,13 @@ export declare class API extends ParentAPI {
85
85
  * @returns A Promise of DnsRecords
86
86
  */
87
87
  getDomainDnsRecords: (request: Readonly<GetDomainDnsRecordsRequest>) => Promise<DnsRecords>;
88
+ /**
89
+ * "Check whether you own this domain or not.".
90
+ *
91
+ * @param request - The request {@link CheckUserOwnsDomainRequest}
92
+ * @returns A Promise of CheckUserOwnsDomainResponse
93
+ */
94
+ checkUserOwnsDomain: (request: Readonly<CheckUserOwnsDomainRequest>) => Promise<CheckUserOwnsDomainResponse>;
88
95
  /**
89
96
  * List all offers. List the different Web Hosting offers, and their options,
90
97
  * available to order from Scaleway.
@@ -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 { HOSTING_TRANSIENT_STATUSES } from "./content.gen.js";
7
- import { marshalCreateHostingRequest, unmarshalHosting, unmarshalListHostingsResponse, marshalUpdateHostingRequest, unmarshalDnsRecords, unmarshalListOffersResponse, unmarshalListControlPanelsResponse, unmarshalSession, unmarshalResetHostingPasswordResponse } from "./marshalling.gen.js";
7
+ import { marshalCreateHostingRequest, unmarshalHosting, unmarshalListHostingsResponse, marshalUpdateHostingRequest, unmarshalDnsRecords, marshalCheckUserOwnsDomainRequest, unmarshalCheckUserOwnsDomainResponse, unmarshalListOffersResponse, unmarshalListControlPanelsResponse, unmarshalSession, unmarshalResetHostingPasswordResponse } from "./marshalling.gen.js";
8
8
  const jsonContentHeaders = {
9
9
  "Content-Type": "application/json; charset=utf-8"
10
10
  };
@@ -155,6 +155,23 @@ class API extends API$1 {
155
155
  },
156
156
  unmarshalDnsRecords
157
157
  );
158
+ /**
159
+ * "Check whether you own this domain or not.".
160
+ *
161
+ * @param request - The request {@link CheckUserOwnsDomainRequest}
162
+ * @returns A Promise of CheckUserOwnsDomainResponse
163
+ */
164
+ checkUserOwnsDomain = (request) => this.client.fetch(
165
+ {
166
+ body: JSON.stringify(
167
+ marshalCheckUserOwnsDomainRequest(request, this.client.settings)
168
+ ),
169
+ headers: jsonContentHeaders,
170
+ method: "POST",
171
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domain", request.domain)}/check-ownership`
172
+ },
173
+ unmarshalCheckUserOwnsDomainResponse
174
+ );
158
175
  /**
159
176
  * List all offers. List the different Web Hosting offers, and their options,
160
177
  * available to order from Scaleway.
@@ -1,4 +1,4 @@
1
1
  export { API } from './api.gen';
2
2
  export * from './content.gen';
3
- export type { ControlPanel, CreateHostingRequest, CreateHostingRequestDomainConfiguration, CreateSessionRequest, DeleteHostingRequest, DnsRecord, DnsRecordStatus, DnsRecordType, DnsRecords, DnsRecordsStatus, GetDomainDnsRecordsRequest, GetHostingRequest, Hosting, HostingCpanelUrls, HostingDnsStatus, HostingOption, HostingStatus, ListControlPanelsRequest, ListControlPanelsResponse, ListHostingsRequest, ListHostingsRequestOrderBy, ListHostingsResponse, ListOffersRequest, ListOffersRequestOrderBy, ListOffersResponse, Nameserver, NameserverStatus, Offer, OfferProduct, OfferQuotaWarning, ResetHostingPasswordRequest, ResetHostingPasswordResponse, RestoreHostingRequest, Session, UpdateHostingRequest, } from './types.gen';
3
+ export type { CheckUserOwnsDomainRequest, CheckUserOwnsDomainResponse, ControlPanel, CreateHostingRequest, CreateHostingRequestDomainConfiguration, CreateSessionRequest, DeleteHostingRequest, DnsRecord, DnsRecordStatus, DnsRecordType, DnsRecords, DnsRecordsStatus, GetDomainDnsRecordsRequest, GetHostingRequest, Hosting, HostingCpanelUrls, HostingDnsStatus, HostingOption, HostingStatus, ListControlPanelsRequest, ListControlPanelsResponse, ListHostingsRequest, ListHostingsRequestOrderBy, ListHostingsResponse, ListOffersRequest, ListOffersRequestOrderBy, ListOffersResponse, Nameserver, NameserverStatus, Offer, OfferProduct, OfferQuotaWarning, ResetHostingPasswordRequest, ResetHostingPasswordResponse, RestoreHostingRequest, Session, UpdateHostingRequest, } from './types.gen';
4
4
  export * as ValidationRules from './validation-rules.gen';
@@ -58,6 +58,16 @@ const unmarshalHosting = (data) => {
58
58
  username: data.username
59
59
  };
60
60
  };
61
+ const unmarshalCheckUserOwnsDomainResponse = (data) => {
62
+ if (!json.isJSONObject(data)) {
63
+ throw new TypeError(
64
+ `Unmarshalling the type 'CheckUserOwnsDomainResponse' failed as data isn't a dictionary.`
65
+ );
66
+ }
67
+ return {
68
+ ownsDomain: data.owns_domain
69
+ };
70
+ };
61
71
  const unmarshalDnsRecord = (data) => {
62
72
  if (!json.isJSONObject(data)) {
63
73
  throw new TypeError(
@@ -201,6 +211,9 @@ const unmarshalSession = (data) => {
201
211
  url: data.url
202
212
  };
203
213
  };
214
+ const marshalCheckUserOwnsDomainRequest = (request, defaults) => ({
215
+ project_id: request.projectId ?? defaults.defaultProjectId
216
+ });
204
217
  const marshalCreateHostingRequestDomainConfiguration = (request, defaults) => ({
205
218
  update_all_records: request.updateAllRecords,
206
219
  update_mail_record: request.updateMailRecord,
@@ -226,8 +239,10 @@ const marshalUpdateHostingRequest = (request, defaults) => ({
226
239
  protected: request.protected,
227
240
  tags: request.tags
228
241
  });
242
+ exports.marshalCheckUserOwnsDomainRequest = marshalCheckUserOwnsDomainRequest;
229
243
  exports.marshalCreateHostingRequest = marshalCreateHostingRequest;
230
244
  exports.marshalUpdateHostingRequest = marshalUpdateHostingRequest;
245
+ exports.unmarshalCheckUserOwnsDomainResponse = unmarshalCheckUserOwnsDomainResponse;
231
246
  exports.unmarshalDnsRecords = unmarshalDnsRecords;
232
247
  exports.unmarshalHosting = unmarshalHosting;
233
248
  exports.unmarshalListControlPanelsResponse = unmarshalListControlPanelsResponse;
@@ -1,11 +1,13 @@
1
1
  import type { DefaultValues } from '../../../bridge';
2
- import type { CreateHostingRequest, DnsRecords, Hosting, ListControlPanelsResponse, ListHostingsResponse, ListOffersResponse, ResetHostingPasswordResponse, Session, UpdateHostingRequest } from './types.gen';
2
+ import type { CheckUserOwnsDomainRequest, CheckUserOwnsDomainResponse, CreateHostingRequest, DnsRecords, Hosting, ListControlPanelsResponse, ListHostingsResponse, ListOffersResponse, ResetHostingPasswordResponse, Session, UpdateHostingRequest } from './types.gen';
3
3
  export declare const unmarshalHosting: (data: unknown) => Hosting;
4
+ export declare const unmarshalCheckUserOwnsDomainResponse: (data: unknown) => CheckUserOwnsDomainResponse;
4
5
  export declare const unmarshalDnsRecords: (data: unknown) => DnsRecords;
5
6
  export declare const unmarshalListControlPanelsResponse: (data: unknown) => ListControlPanelsResponse;
6
7
  export declare const unmarshalListHostingsResponse: (data: unknown) => ListHostingsResponse;
7
8
  export declare const unmarshalListOffersResponse: (data: unknown) => ListOffersResponse;
8
9
  export declare const unmarshalResetHostingPasswordResponse: (data: unknown) => ResetHostingPasswordResponse;
9
10
  export declare const unmarshalSession: (data: unknown) => Session;
11
+ export declare const marshalCheckUserOwnsDomainRequest: (request: CheckUserOwnsDomainRequest, defaults: DefaultValues) => Record<string, unknown>;
10
12
  export declare const marshalCreateHostingRequest: (request: CreateHostingRequest, defaults: DefaultValues) => Record<string, unknown>;
11
13
  export declare const marshalUpdateHostingRequest: (request: UpdateHostingRequest, defaults: DefaultValues) => Record<string, unknown>;
@@ -56,6 +56,16 @@ const unmarshalHosting = (data) => {
56
56
  username: data.username
57
57
  };
58
58
  };
59
+ const unmarshalCheckUserOwnsDomainResponse = (data) => {
60
+ if (!isJSONObject(data)) {
61
+ throw new TypeError(
62
+ `Unmarshalling the type 'CheckUserOwnsDomainResponse' failed as data isn't a dictionary.`
63
+ );
64
+ }
65
+ return {
66
+ ownsDomain: data.owns_domain
67
+ };
68
+ };
59
69
  const unmarshalDnsRecord = (data) => {
60
70
  if (!isJSONObject(data)) {
61
71
  throw new TypeError(
@@ -199,6 +209,9 @@ const unmarshalSession = (data) => {
199
209
  url: data.url
200
210
  };
201
211
  };
212
+ const marshalCheckUserOwnsDomainRequest = (request, defaults) => ({
213
+ project_id: request.projectId ?? defaults.defaultProjectId
214
+ });
202
215
  const marshalCreateHostingRequestDomainConfiguration = (request, defaults) => ({
203
216
  update_all_records: request.updateAllRecords,
204
217
  update_mail_record: request.updateMailRecord,
@@ -225,8 +238,10 @@ const marshalUpdateHostingRequest = (request, defaults) => ({
225
238
  tags: request.tags
226
239
  });
227
240
  export {
241
+ marshalCheckUserOwnsDomainRequest,
228
242
  marshalCreateHostingRequest,
229
243
  marshalUpdateHostingRequest,
244
+ unmarshalCheckUserOwnsDomainResponse,
230
245
  unmarshalDnsRecords,
231
246
  unmarshalHosting,
232
247
  unmarshalListControlPanelsResponse,
@@ -153,6 +153,21 @@ export interface Offer {
153
153
  /** Name of the control panel. */
154
154
  controlPanelName: string;
155
155
  }
156
+ export type CheckUserOwnsDomainRequest = {
157
+ /**
158
+ * Region to target. If none is passed will use default region from the
159
+ * config.
160
+ */
161
+ region?: Region;
162
+ /** Domain for which ownership is to be verified. */
163
+ domain: string;
164
+ /** ID of the project currently in use. */
165
+ projectId?: string;
166
+ };
167
+ export interface CheckUserOwnsDomainResponse {
168
+ /** Indicates whether the specified project owns the domain. */
169
+ ownsDomain: boolean;
170
+ }
156
171
  export type CreateHostingRequest = {
157
172
  /**
158
173
  * Region to target. If none is passed will use default region from the
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const version = "v2.39.0";
3
+ const version = "v2.41.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.39.0";
2
- export declare const userAgent = "scaleway-sdk-js/v2.39.0";
1
+ export declare const version = "v2.41.0";
2
+ export declare const userAgent = "scaleway-sdk-js/v2.41.0";
@@ -1,4 +1,4 @@
1
- const version = "v2.39.0";
1
+ const version = "v2.41.0";
2
2
  const userAgent = `scaleway-sdk-js/${version}`;
3
3
  export {
4
4
  userAgent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk",
3
- "version": "2.40.0",
3
+ "version": "2.42.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Scaleway SDK.",
6
6
  "keywords": [
@@ -39,5 +39,5 @@
39
39
  "bundledDependencies": [
40
40
  "@scaleway/random-name"
41
41
  ],
42
- "gitHead": "08b84339b223ef28275a55c900d9b4e8adc7dd7b"
42
+ "gitHead": "089401626b9b04deaf254edf576ee16c09776b13"
43
43
  }