@scaleway/sdk 2.40.0 → 2.41.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.
@@ -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. */
@@ -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.40.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.40.0";
2
+ export declare const userAgent = "scaleway-sdk-js/v2.40.0";
@@ -1,4 +1,4 @@
1
- const version = "v2.39.0";
1
+ const version = "v2.40.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.41.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": "33be5736d009849b28bef4e66a0a2c6aec80827b"
43
43
  }