-
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?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| // 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'), | ||
| documentationUri: "https://github.com/clay-run/action-template-nodejs/blob/master/README.md", | ||
| iconUri: "https://logo.clearbit.com/reddit.com?size=80", | ||
| displayName: "Get Top Reddit Posts", | ||
| description: "This action allows to get the top posts of a sub-reddit", | ||
| inputParameterSchema: [ | ||
| { | ||
| name: "subredditName", | ||
| type: "text", | ||
| optional: false, | ||
| displayName: "SubReddit Name", | ||
| description: "The sub-reddit name to get posts from" | ||
| }, | ||
| { | ||
| name: "numberOfPosts", | ||
| type: "number", | ||
| displayName: "# of posts", | ||
| description: "The number of posts to fetch" | ||
| } | ||
| ], | ||
| outputParameterSchema: require('./output_parameter_schema.js'), | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is optional, maybe i remove it |
||
| inputSample: require('./test-inputs').goodSample, | ||
| outputSample: require('./output_sample.js'), | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we just generate this automatically based on the input sample? |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
|
||
| module.exports = [ | ||
| { | ||
| name: "arrayOfPosts", | ||
| type: "array", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| /* | ||
| This is an Action Package. It consists of one more Actions. | ||
| Add an Action by importing it's action-definition.js and adding it to the actionDefinitions array | ||
| */ | ||
|
|
||
| const getTopRedditPosts = require("./actions/get-reddit-posts/action-definition.js") | ||
|
|
||
| module.exports = { | ||
| name: "Reddit-Action-Package", | ||
| description: "Actions to search and get posts from Reddit", | ||
| actionDefinitions: [getTopRedditPosts], | ||
| } |
This file was deleted.
This file was deleted.
This file was deleted.
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: