Skip to content

Commit

Permalink
feat(destination): onboard marketo static list (#1558)
Browse files Browse the repository at this point in the history
* feat: onboarding marketo static list destination

* feat: added proxy test cases

* Update v0/destinations/marketo_static_list/transform.js

Co-authored-by: Sudip Paul <[email protected]>

* fix: addressed comments

* fix: addressed comments+1

* Update index.js

* Update index.js

* fix: simplified processRouterDest and comments resolve

* fix: marketo util code refactor to accomodate marketo static list

* fix: event object destructuring at a single level

Co-authored-by: Anant <[email protected]>
Co-authored-by: Sudip Paul <[email protected]>
  • Loading branch information
3 people authored Nov 25, 2022
1 parent eb198dd commit db73de9
Show file tree
Hide file tree
Showing 22 changed files with 4,612 additions and 24 deletions.
38 changes: 38 additions & 0 deletions __mocks__/data/marketo_static_list/proxy_response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3": {
"data": {
"requestId": "68d8#1846058ee27",
"success": false,
"errors": [
{
"code": "601",
"message": "Access token invalid"
}
]
},
"status": 200
},
"https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2": {
"data": {
"requestId": "12d3c#1846057dce2",
"result": [
{
"id": 1,
"status": "added"
},
{
"id": 2,
"status": "skipped",
"reasons": [
{
"code": "1004",
"message": "Lead not found"
}
]
}
],
"success": true
},
"status": 200
}
}
4 changes: 3 additions & 1 deletion __mocks__/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ const urlDirectoryMap = {
"graph.facebook.com": "facebook_pixel",
"api.wootric.com": "wootric",
"api.mautic.com": "mautic",
"adsapi.snapchat.com": "snapchat_custom_audience"
"adsapi.snapchat.com": "snapchat_custom_audience",
"marketo_acct_id_success.mktorest.com": "marketo_static_list"

};

function getData(url) {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/data/marketo_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
},
{
"statusCode": 500,
"error": "Request Failed for Marketo, Access Token Expired (Retryable).During fetching auth token"
"error": "Request Failed for marketo, Access Token Expired (Retryable).During fetching auth token"
},
{
"statusCode": 400,
Expand Down
12 changes: 6 additions & 6 deletions __tests__/data/marketo_proxy_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{
"output": {
"status": 500,
"message": "Request Failed for Marketo, Access token invalid (Retryable).during Marketo Response Handling",
"message": "Request Failed for marketo, Access token invalid (Retryable).during Marketo Response Handling",
"destinationResponse": {
"response": {
"requestId": "a61c#17daea5968a",
Expand All @@ -47,7 +47,7 @@
{
"output": {
"status": 400,
"message": "Request Failed for Marketo, Requested resource not found (Aborted).during Marketo Response Handling",
"message": "Request Failed for marketo, Requested resource not found (Aborted).during Marketo Response Handling",
"destinationResponse": {
"response": {
"requestId": "a61c#17daea5968a",
Expand All @@ -73,7 +73,7 @@
{
"output": {
"status": 413,
"message": "[Marketo Response Handler] - Request failed with status: 413",
"message": "[marketo Response Handler] - Request failed with status: 413",
"destinationResponse": {
"response": {
"code": 413,
Expand All @@ -94,7 +94,7 @@
{
"output": {
"status": 500,
"message": "[Marketo Response Handler] - Request failed with status: 500",
"message": "[marketo Response Handler] - Request failed with status: 500",
"destinationResponse": {
"response": "",
"status": 500
Expand All @@ -111,7 +111,7 @@
{
"output": {
"status": 500,
"message": "[Marketo Response Handler] - Request failed with status: 500",
"message": "[marketo Response Handler] - Request failed with status: 500",
"destinationResponse": {
"response": "",
"status": 500
Expand All @@ -128,7 +128,7 @@
{
"output": {
"status": 400,
"message": "[Marketo Response Handler] - Request failed with status: 400",
"message": "[marketo Response Handler] - Request failed with status: 400",
"destinationResponse": {
"response": "[[ENOTFOUND] :: DNS lookup failed]",
"status": 400
Expand Down
2 changes: 1 addition & 1 deletion __tests__/data/marketo_router_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
{
"batched": false,
"statusCode": 400,
"error": "Request Failed for Marketo, Lookup field 'userId' not found (Aborted).[Marketo Transformer]: During lead look up using email",
"error": "Request Failed for marketo, Lookup field 'userId' not found (Aborted).[Marketo Transformer]: During lead look up using email",
"statTags": {
"destType": "MARKETO",
"stage": "transform",
Expand Down
Loading

0 comments on commit db73de9

Please sign in to comment.