diff --git a/components/filter/actions/common/common.mjs b/components/filter/actions/common/common.mjs deleted file mode 100644 index d6b3d1da15a45..0000000000000 --- a/components/filter/actions/common/common.mjs +++ /dev/null @@ -1,77 +0,0 @@ -import filter from "../../filter.app.mjs"; -import valueTypes from "../../common/value-types.mjs"; -import { - arrayConditions, - binaryConditions, - textConditions, -} from "../../common/conditions.mjs"; - -export default { - props: { - filter, - messageOnContinue: { - type: "string", - label: "Reason for continuing", - description: "The message that will be displayed when the workflow **continues**", - optional: true, - }, - messageOnEnd: { - type: "string", - label: "Reason for ending", - description: "The message that will be displayed when the workflow **ends**", - optional: true, - }, - initialValue: { - type: "any", - label: "Initial value", - description: "The 1st of 2 values to compare", - }, - condition: { - propDefinition: [ - filter, - "condition", - ], - }, - }, - async additionalProps() { - const props = {}; - if (binaryConditions.includes(this.condition)) { - props.secondValue = { - type: "any", - label: "Second value", - description: "The 2nd of 2 values to compare", - }; - } - if (arrayConditions.includes(this.condition)) { - props.arrayType = { - type: "string", - label: "Initial value type", - description: "Type of the value to search for in the array", - options: Object.values(valueTypes), - default: valueTypes.TEXT, - reloadProps: true, - }; - } - if (textConditions.includes(this.condition) || - (arrayConditions.includes(this.condition) && this.arrayType === valueTypes.TEXT)) { - props.caseSensitive = { - type: "boolean", - label: "Case sensitive", - description: "Whether the text evaluation should be case sensitive or not", - optional: true, - default: false, - }; - } - return props; - }, - async run({ $ }) { - const result = this.filter.checkCondition( - this.condition, - this.initialValue, - this.secondValue, - this.caseSensitive, - this.arrayType, - ); - return this.consolidateResult($, result); - }, -}; diff --git a/components/filter/actions/continue-based-on-condition/continue-based-on-condition.mjs b/components/filter/actions/continue-based-on-condition/continue-based-on-condition.mjs deleted file mode 100644 index 7d0759fde14c8..0000000000000 --- a/components/filter/actions/continue-based-on-condition/continue-based-on-condition.mjs +++ /dev/null @@ -1,16 +0,0 @@ -import common from "../common/common.mjs"; - -export default { - ...common, - name: "Continue execution if a condition Is met", - version: "0.0.2", - key: "filter-continue-based-on-condition", - description: "Continue workflow execution only if a condition is met", - type: "action", - methods: { - consolidateResult($, result) { - !result && $.flow.exit(this.messageOnEnd); - return this.messageOnContinue; - }, - }, -}; diff --git a/components/filter/actions/end-based-on-condition/end-based-on-condition.mjs b/components/filter/actions/end-based-on-condition/end-based-on-condition.mjs deleted file mode 100644 index 1805ad16205bc..0000000000000 --- a/components/filter/actions/end-based-on-condition/end-based-on-condition.mjs +++ /dev/null @@ -1,16 +0,0 @@ -import common from "../common/common.mjs"; - -export default { - ...common, - name: "End execution if a condition is met", - version: "0.0.2", - key: "filter-end-based-on-condition", - description: "End workflow execution if a condition is met", - type: "action", - methods: { - consolidateResult($, result) { - result && $.flow.exit(this.messageOnEnd); - return this.messageOnContinue; - }, - }, -}; diff --git a/components/filter/package.json b/components/filter/package.json index 24ab209333bdb..8f801cd0a0b1d 100644 --- a/components/filter/package.json +++ b/components/filter/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/filter", - "version": "0.0.4", + "version": "0.0.5", "description": "Pipedream Filter Components", "main": "filter.app.mjs", "keywords": [ diff --git a/components/pushshift_reddit_search/actions/search-reddit-comments/search-reddit-comments.mjs b/components/pushshift_reddit_search/actions/search-reddit-comments/search-reddit-comments.mjs deleted file mode 100644 index ce0bde27ec963..0000000000000 --- a/components/pushshift_reddit_search/actions/search-reddit-comments/search-reddit-comments.mjs +++ /dev/null @@ -1,117 +0,0 @@ -import pushshift from "../../pushshift_reddit_search.app.mjs"; -import utils from "../../common/utils.mjs"; - -export default { - key: "pushshift_reddit_search-search-reddit-comments", - name: "Search Reddit Comments", - description: "Search Reddit comments using the Pushshift.io API. [See the docs here](https://github.com/pushshift/api)", - version: "0.1.2", - type: "action", - props: { - pushshift, - q: { - propDefinition: [ - pushshift, - "q", - ], - }, - ids: { - propDefinition: [ - pushshift, - "ids", - ], - }, - size: { - propDefinition: [ - pushshift, - "size", - ], - }, - fields: { - propDefinition: [ - pushshift, - "fields", - ], - }, - sort: { - propDefinition: [ - pushshift, - "sort", - ], - }, - sortType: { - propDefinition: [ - pushshift, - "sortType", - ], - }, - aggs: { - propDefinition: [ - pushshift, - "aggs", - ], - }, - author: { - propDefinition: [ - pushshift, - "author", - ], - }, - subreddit: { - propDefinition: [ - pushshift, - "subreddit", - ], - }, - after: { - propDefinition: [ - pushshift, - "after", - ], - }, - before: { - propDefinition: [ - pushshift, - "before", - ], - }, - frequency: { - propDefinition: [ - pushshift, - "frequency", - ], - }, - metadata: { - propDefinition: [ - pushshift, - "metadata", - ], - }, - }, - async run({ $ }) { - const params = utils.omitEmptyStringValues({ - q: this.q, - ids: this.ids, - size: this.size, - fields: this.fields, - sort: this.sort, - sort_type: this.sortType, - aggs: this.aggs, - author: this.author, - subreddit: this.subreddit, - after: this.after, - before: this.before, - frequency: this.frequency, - metadata: this.metadata, - }); - - const comments = await this.pushshift.searchComments({ - params, - $, - }); - - $.export("$summary", `Found ${comments.length} comment(s)`); - - return comments; - }, -}; diff --git a/components/pushshift_reddit_search/package.json b/components/pushshift_reddit_search/package.json index 49c59a7b1a395..46d4e81c1331c 100644 --- a/components/pushshift_reddit_search/package.json +++ b/components/pushshift_reddit_search/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/pushshift_reddit_search", - "version": "0.0.5", + "version": "0.0.6", "description": "Pipedream Pushshift Reddit Search Components", "main": "pushshift_reddit_search.app.mjs", "keywords": [