Last active
November 15, 2020 14:11
-
-
Save chaiwa-berian/2f88df80c0363d9178c470b71ef70827 to your computer and use it in GitHub Desktop.
OpenFn devtools testing
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
get(state.configuration.dataSourceUrl,{ | |
query: {userId: 1}, | |
headers: state.configuration.headers | |
}, | |
function(state){ | |
var posts = state.data; | |
return posts.reduce(function(acc, item){ | |
item.tag = `${state.configuration.tags.testing}`; | |
return acc.then( | |
post(state.configuration.inboxUrl,{body: item, headers: state.configuration.headers}) | |
); | |
}, Promise.resolve(state)).then(function(state){ | |
delete state.data; | |
return state; | |
}); | |
}); |
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
{ | |
"references": [ | |
null, | |
[ | |
{ | |
"userId": 1, | |
"id": 1, | |
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit", | |
"body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto", | |
"tag": "testing-devtools" | |
}, | |
{ | |
"userId": 1, | |
"id": 2, | |
"title": "qui est esse", | |
"body": "est rerum tempore vitae\nsequi sint nihil reprehenderit dolor beatae ea dolores neque\nfugiat blanditiis voluptate porro vel nihil molestiae ut reiciendis\nqui aperiam non debitis possimus qui neque nisi nulla", | |
"tag": "testing-devtools" | |
}, | |
{ | |
"userId": 1, | |
"id": 3, | |
"title": "ea molestias quasi exercitationem repellat qui ipsa sit aut", | |
"body": "et iusto sed quo iure\nvoluptatem occaecati omnis eligendi aut ad\nvoluptatem doloribus vel accusantium quis pariatur\nmolestiae porro eius odio et labore et velit aut", | |
"tag": "testing-devtools" | |
}, | |
{ | |
"userId": 1, | |
"id": 4, | |
"title": "eum et est occaecati", | |
"body": "ullam et saepe reiciendis voluptatem adipisci\nsit amet autem assumenda provident rerum culpa\nquis hic commodi nesciunt rem tenetur doloremque ipsam iure\nquis sunt voluptatem rerum illo velit", | |
"tag": "testing-devtools" | |
}, | |
{ | |
"userId": 1, | |
"id": 5, | |
"title": "nesciunt quas odio", | |
"body": "repudiandae veniam quaerat sunt sed\nalias aut fugiat sit autem sed est\nvoluptatem omnis possimus esse voluptatibus quis\nest aut tenetur dolor neque", | |
"tag": "testing-devtools" | |
}, | |
{ | |
"userId": 1, | |
"id": 6, | |
"title": "dolorem eum magni eos aperiam quia", | |
"body": "ut aspernatur corporis harum nihil quis provident sequi\nmollitia nobis aliquid molestiae\nperspiciatis et ea nemo ab reprehenderit accusantium quas\nvoluptate dolores velit et doloremque molestiae", | |
"tag": "testing-devtools" | |
}, | |
{ | |
"userId": 1, | |
"id": 7, | |
"title": "magnam facilis autem", | |
"body": "dolore placeat quibusdam ea quo vitae\nmagni quis enim qui quis quo nemo aut saepe\nquidem repellat excepturi ut quia\nsunt ut sequi eos ea sed quas", | |
"tag": "testing-devtools" | |
}, | |
{ | |
"userId": 1, | |
"id": 8, | |
"title": "dolorem dolore est ipsam", | |
"body": "dignissimos aperiam dolorem qui eum\nfacilis quibusdam animi sint suscipit qui sint possimus cum\nquaerat magni maiores excepturi\nipsam ut commodi dolor voluptatum modi aut vitae", | |
"tag": "testing-devtools" | |
}, | |
{ | |
"userId": 1, | |
"id": 9, | |
"title": "nesciunt iure omnis dolorem tempora et accusantium", | |
"body": "consectetur animi nesciunt iure dolore\nenim quia ad\nveniam autem ut quam aut nobis\net est aut quod aut provident voluptas autem voluptas", | |
"tag": "testing-devtools" | |
}, | |
{ | |
"userId": 1, | |
"id": 10, | |
"title": "optio molestias id quia eum", | |
"body": "quo et expedita modi cum officia vel magni\ndoloribus qui repudiandae\nvero nisi sit\nquos veniam quod sed accusamus veritatis error", | |
"tag": "testing-devtools" | |
} | |
], | |
{ | |
"body": { | |
"success": true | |
} | |
}, | |
{ | |
"body": { | |
"success": true | |
} | |
}, | |
{ | |
"body": { | |
"success": true | |
} | |
}, | |
{ | |
"body": { | |
"success": true | |
} | |
}, | |
{ | |
"body": { | |
"success": true | |
} | |
}, | |
{ | |
"body": { | |
"success": true | |
} | |
}, | |
{ | |
"body": { | |
"success": true | |
} | |
}, | |
{ | |
"body": { | |
"success": true | |
} | |
}, | |
{ | |
"body": { | |
"success": true | |
} | |
} | |
], | |
"configuration": { | |
"dataSourceUrl": "https://jsonplaceholder.typicode.com/posts", | |
"inboxUrl": "https://4d78b6afc5147fd667773a78055b7416.m.pipedream.net", | |
"headers": { | |
"content-type": "application/json" | |
}, | |
"tags": { | |
"testing": "testing-devtools" | |
} | |
} | |
} |
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
{ | |
"configuration":{ | |
"dataSourceUrl": "https://jsonplaceholder.typicode.com/posts", | |
"inboxUrl": "https://4d78b6afc5147fd667773a78055b7416.m.pipedream.net", | |
"headers": {"content-type":"application/json"}, | |
"tags": { | |
"testing": "testing-devtools" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment