Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added actions/.DS_Store
Binary file not shown.
Binary file added actions/get-reddit-posts/.DS_Store
Binary file not shown.
27 changes: 27 additions & 0 deletions actions/get-reddit-posts/action-definition.js
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'),

Copy link
Copy Markdown
Contributor Author

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:

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'),

Copy link
Copy Markdown
Contributor Author

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

inputSample: require('./test-inputs').goodSample,
outputSample: require('./output_sample.js'),

Copy link
Copy Markdown
Contributor Author

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?

}
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

Copy link
Copy Markdown
Contributor Author

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.


module.exports = [
{
name: "arrayOfPosts",
type: "array",
Expand Down
12 changes: 12 additions & 0 deletions index.js
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],
}
64 changes: 0 additions & 64 deletions src/get_top_reddit_posts/definition.js

This file was deleted.

71 changes: 0 additions & 71 deletions src/get_top_reddit_posts/get_top_reddit_posts.js

This file was deleted.

22 changes: 0 additions & 22 deletions src/index.js

This file was deleted.