-
Notifications
You must be signed in to change notification settings - Fork 1
Refactor: Simplified Action Template #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
… readme for more information, simplfiied the sample code
// See README.MD for an in-depth explanation of each parameter. | ||
module.exports = { | ||
name: "get-top-reddit-posts", | ||
function: require('./get-top-reddit-posts.js'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's not use the reserverd keyword function.
Let's use actionCode:
@@ -1,4 +1,6 @@ | |||
module.exports = [ // the action function must return an object with the following parameters | |||
// These are used to help Clay's interface provide ways to extract data from the output of this action into the table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just generate this in the deploy endpoint automatically unless it's provided.
description: "The number of posts to fetch" | ||
} | ||
], | ||
outputParameterSchema: require('./output_parameter_schema.js'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is optional, maybe i remove it
], | ||
outputParameterSchema: require('./output_parameter_schema.js'), | ||
inputSample: require('./test-inputs').goodSample, | ||
outputSample: require('./output_sample.js'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just generate this automatically based on the input sample?
… readme for more information, simplfiied the sample code
Clubhouse Story
https://app.clubhouse.io/clay-run/story/2915/simplify-action-template
Summary (What)
Simplify the action template so there are fewer things to change when adapting it to your own code.
Motivation (Why)
Get started faster with less help and find the README for more information.
Implementation Details (How)
folder structure:
/index.js
/actions
/actions/reddit-posts
action-definition.js
reddit-posts.js
output-sample.js
output-schema.js
test-inputs.js
Testing
N/A