From 17021919aafc8fbedae569668f5143cac85a78cf Mon Sep 17 00:00:00 2001 From: Igor Balos Date: Tue, 27 Aug 2024 12:28:13 +0200 Subject: [PATCH 1/2] support custom tracking domains --- src/client/AccountClient.ts | 22 +++++++++++++++++----- src/client/models/domains/Domain.ts | 12 +++++++++--- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/client/AccountClient.ts b/src/client/AccountClient.ts index 83bc676..679e889 100644 --- a/src/client/AccountClient.ts +++ b/src/client/AccountClient.ts @@ -159,7 +159,7 @@ export default class AccountClient extends BaseClient { /** * Trigger Domain DKIM key verification. * - * @param id - The ID of the Domain you wish to trigger DKIM verification for. + * @param id - The ID of the Domain you wish to trigger verification for. * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation. * @returns A promise that will complete when the API responds (or an error occurs). */ @@ -168,9 +168,9 @@ export default class AccountClient extends BaseClient { } /** - * Trigger Domain DKIM key verification. + * Trigger Domain Return Path verification. * - * @param id - The ID of the Domain you wish to trigger DKIM verification for. + * @param id - The ID of the Domain you wish to trigger verification for. * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation. * @returns A promise that will complete when the API responds (or an error occurs). */ @@ -179,7 +179,19 @@ export default class AccountClient extends BaseClient { } /** - * Trigger Domain DKIM key verification. + * Trigger Domain Custom Tracking verification. + * + * @param id - The ID of the Domain you wish to trigger verification for. + * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation. + * @returns A promise that will complete when the API responds (or an error occurs). + */ + public verifyDomainCustomTracking(id: number, callback?: Callback): Promise { + return this.processRequestWithoutBody(ClientOptions.HttpMethod.PUT, `/domains/${id}/verifyCustomTracking`, {}, callback); + } + + + /** + * Trigger Domain SPF key verification. * * @param id - The ID of the Domain you wish to trigger DKIM verification for. * @param callback If the callback is provided, it will be passed to the resulting promise as a continuation. @@ -190,7 +202,7 @@ export default class AccountClient extends BaseClient { } /** - * Trigger Domain DKIM key verification. + * Trigger Domain DKIM rotation * * @param id - The ID of the Domain you wish to trigger DKIM verification for. * @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation. diff --git a/src/client/models/domains/Domain.ts b/src/client/models/domains/Domain.ts index 3b3bc93..3218a88 100644 --- a/src/client/models/domains/Domain.ts +++ b/src/client/models/domains/Domain.ts @@ -1,17 +1,20 @@ export class CreateDomainRequest { - public Name: string; public ReturnPathDomain?: string; - constructor(Name: string, ReturnPathDomain?: string) { + public CustomTrackingDomain?: string; + constructor(Name: string, ReturnPathDomain?: string, CustomTrackingDomain?: string) { this.Name = Name; this.ReturnPathDomain = ReturnPathDomain; + this.CustomTrackingDomain = CustomTrackingDomain; } } export class UpdateDomainRequest { public ReturnPathDomain?: string; - constructor(ReturnPathDomain: string) { + public CustomTrackingDomain?: string; + constructor(ReturnPathDomain: string, CustomTrackingDomain?: string) { this.ReturnPathDomain = ReturnPathDomain; + this.CustomTrackingDomain = CustomTrackingDomain; } } @@ -22,6 +25,7 @@ export interface Domain { DKIMVerified: boolean; WeakDKIM: boolean; ReturnPathDomainVerified: boolean; + CustomTrackingVerified: boolean; } export interface DomainDetails extends Domain { @@ -37,6 +41,8 @@ export interface DomainDetails extends Domain { DKIMUpdateStatus: string; ReturnPathDomain: string; ReturnPathDomainCNAMEValue: string; + CustomTrackingDomain: string; + CustomTrackingDomainCNAMEValue: string; } export interface Domains { From b121f307e71aa99b231bfdddfe189cfa661a406c Mon Sep 17 00:00:00 2001 From: Igor Balos Date: Tue, 27 Aug 2024 12:29:16 +0200 Subject: [PATCH 2/2] updated integration test --- test/integration/Domains.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/integration/Domains.test.ts b/test/integration/Domains.test.ts index e733003..1351218 100644 --- a/test/integration/Domains.test.ts +++ b/test/integration/Domains.test.ts @@ -77,4 +77,10 @@ describe("Client - Domains", () => { const response = await client.verifyDomainReturnPath(domain.ID); expect(response.ID).to.eq(domain.ID); }); + + it("verifyDomainCustomTracking", async () => { + const domain = await client.createDomain(domainToTest()); + const response = await client.verifyDomainCustomTracking(domain.ID); + expect(response.ID).to.eq(domain.ID); + }); });