-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DEV-2026] Refactor Active Campaign package (#1252)
* refactor * refactor * Removed axios, removed .env except than for the test, create new main handler to execute function in aws lambda * Update packages/active-campaign-client/jest.config.ts --------- Co-authored-by: t <[email protected]> Co-authored-by: Marco Ponchia <[email protected]>
- Loading branch information
1 parent
ba37f09
commit e725bb1
Showing
18 changed files
with
184 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"active-campaign-client": patch | ||
--- | ||
|
||
Removed axios, removed .env except than for the test, create new main handler to execute function in aws lambda |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { handler } from '../../handlers/deleteContact'; | ||
import { deleteContact } from '../../handlers/deleteContact'; | ||
import { SQSEvent } from 'aws-lambda'; | ||
|
||
// remove .skip to run the test, be aware it does a real API call so it will create a contact in the active campaign account | ||
|
@@ -11,7 +11,7 @@ describe.skip('deleteContact handler', () => { | |
receiptHandle: '1', | ||
body: JSON.stringify({ | ||
// Replace this with the existing email of the contact you want to delete, otherwise the test will fail | ||
username: `[email protected]`, | ||
cognitoId: `466e0280-9061-7007-c3e0-beb6be672f68`, | ||
}), | ||
attributes: { | ||
ApproximateReceiveCount: '1', | ||
|
@@ -28,7 +28,7 @@ describe.skip('deleteContact handler', () => { | |
], | ||
}; | ||
|
||
const response = await handler(event); | ||
const response = await deleteContact(event); | ||
expect(response.statusCode).toBe(200); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 0 additions & 82 deletions
82
packages/active-campaign-client/src/activeCampaignClient.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
packages/active-campaign-client/src/handlers/deleteContact.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { APIGatewayProxyResult, SQSEvent } from 'aws-lambda'; | ||
import { addContact } from './handlers/addContact'; | ||
|
||
export async function handler(event: { | ||
readonly Records: SQSEvent['Records']; | ||
}): Promise<APIGatewayProxyResult> { | ||
console.log('Event:', event); | ||
return { | ||
statusCode: 200, | ||
body: JSON.stringify(event), | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export type WebinarPayload = { | ||
readonly slug: string; | ||
readonly title: string; | ||
readonly subscribeCtaLabel: string; | ||
}; |
Oops, something went wrong.