File tree Expand file tree Collapse file tree
packages/dashboard-client Expand file tree Collapse file tree Original file line number Diff line number Diff line change 225225 "responseType" : " AccountConvertToOrganizationJobSchema" ,
226226 "name" : " convertToOrganization" ,
227227 "rawName" : " rawConvertToOrganization"
228+ },
229+ {
230+ "returnsItem" : false ,
231+ "requestBodyRequiresItem" : false ,
232+ "offersNestedItemsOptionInQueryParams" : false ,
233+ "rel" : " confirm_email_change" ,
234+ "urlTemplate" : " /account/confirm-email-change" ,
235+ "method" : " POST" ,
236+ "comment" : " Confirm email change" ,
237+ "urlPlaceholders" : [],
238+ "requestBodyType" : " AccountConfirmEmailChangeSchema" ,
239+ "optionalRequestBody" : false ,
240+ "requestStructure" : {
241+ "type" : " account" ,
242+ "attributes" : [" token" ],
243+ "relationships" : []
244+ },
245+ "queryParamsRequired" : false ,
246+ "responseType" : " AccountConfirmEmailChangeTargetSchema" ,
247+ "name" : " confirmEmailChange" ,
248+ "rawName" : " rawConfirmEmailChange"
228249 }
229250 ],
230251 "namespace" : " account" ,
Original file line number Diff line number Diff line change @@ -946,13 +946,18 @@ export type Account = {
946946 * Whether 2-factor authentication is active for this account or not
947947 */
948948 is_2fa_active : boolean ;
949+ /**
950+ * Pending email address awaiting confirmation (only present if confirmation token hasn't expired)
951+ */
952+ pending_email ?: string | null ;
949953 active_subscription : null | PerOwnerPricingSubscriptionData ;
950954 billing_profile : null | PerOwnerPricingBillingProfileData ;
951955 default_organization : null | OrganizationData ;
952956} ;
953957export type AccountDestroyJobSchema = Account ;
954958export type AccountSelfTargetSchema = Account ;
955959export type AccountDeactivate_2FaTargetSchema = Account ;
960+ export type AccountConfirmEmailChangeTargetSchema = Account ;
956961/**
957962 * JSON API data
958963 *
@@ -1014,6 +1019,10 @@ export type AccountAttributes = {
10141019 * Whether 2-factor authentication is active for this account or not
10151020 */
10161021 is_2fa_active : boolean ;
1022+ /**
1023+ * Pending email address awaiting confirmation (only present if confirmation token hasn't expired)
1024+ */
1025+ pending_email ?: string | null ;
10171026} ;
10181027/**
10191028 * JSON API links
@@ -1347,6 +1356,17 @@ export type OrganizationDestroySchema = {
13471356 */
13481357 password : string ;
13491358} ;
1359+ /**
1360+ * This interface was referenced by `Account`'s JSON-Schema
1361+ * via the `confirm_email_change.schema` link.
1362+ */
1363+ export type AccountConfirmEmailChangeSchema = {
1364+ type ?: AccountType ;
1365+ /**
1366+ * Email confirmation token
1367+ */
1368+ token : string ;
1369+ } ;
13501370/**
13511371 * A project represents a specific DatoCMS administrative area
13521372 *
Original file line number Diff line number Diff line change @@ -811,6 +811,10 @@ export type AccountAttributes = {
811811 * Whether 2-factor authentication is active for this account or not
812812 */
813813 is_2fa_active : boolean ;
814+ /**
815+ * Pending email address awaiting confirmation (only present if confirmation token hasn't expired)
816+ */
817+ pending_email ?: string | null ;
814818} ;
815819/**
816820 * JSON API links
@@ -2182,6 +2186,28 @@ export type OrganizationDestroyTargetSchema = {
21822186export type OrganizationDestroyJobSchema = {
21832187 data : Organization ;
21842188} ;
2189+ /**
2190+ * This interface was referenced by `Account`'s JSON-Schema
2191+ * via the `confirm_email_change.schema` link.
2192+ */
2193+ export type AccountConfirmEmailChangeSchema = {
2194+ data : {
2195+ type : AccountType ;
2196+ attributes : {
2197+ /**
2198+ * Email confirmation token
2199+ */
2200+ token : string ;
2201+ } ;
2202+ } ;
2203+ } ;
2204+ /**
2205+ * This interface was referenced by `Account`'s JSON-Schema
2206+ * via the `confirm_email_change.targetSchema` link.
2207+ */
2208+ export type AccountConfirmEmailChangeTargetSchema = {
2209+ data : Account ;
2210+ } ;
21852211/**
21862212 * A per-project subscription record
21872213 *
Original file line number Diff line number Diff line change @@ -329,4 +329,45 @@ export default class Account extends BaseResource {
329329 } ,
330330 ) ;
331331 }
332+
333+ /**
334+ * Confirm email change
335+ *
336+ * @throws {ApiError }
337+ * @throws {TimeoutError }
338+ */
339+ confirmEmailChange ( body : ApiTypes . AccountConfirmEmailChangeSchema ) {
340+ return this . rawConfirmEmailChange (
341+ Utils . serializeRequestBody < RawApiTypes . AccountConfirmEmailChangeSchema > (
342+ body ,
343+ {
344+ type : 'account' ,
345+ attributes : [ 'token' ] ,
346+ relationships : [ ] ,
347+ } ,
348+ ) ,
349+ ) . then ( ( body ) =>
350+ Utils . deserializeResponseBody < ApiTypes . AccountConfirmEmailChangeTargetSchema > (
351+ body ,
352+ ) ,
353+ ) ;
354+ }
355+
356+ /**
357+ * Confirm email change
358+ *
359+ * @throws {ApiError }
360+ * @throws {TimeoutError }
361+ */
362+ rawConfirmEmailChange (
363+ body : RawApiTypes . AccountConfirmEmailChangeSchema ,
364+ ) : Promise < RawApiTypes . AccountConfirmEmailChangeTargetSchema > {
365+ return this . client . request < RawApiTypes . AccountConfirmEmailChangeTargetSchema > (
366+ {
367+ method : 'POST' ,
368+ url : '/account/confirm-email-change' ,
369+ body,
370+ } ,
371+ ) ;
372+ }
332373}
You can’t perform that action at this time.
0 commit comments