Skip to content
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

Google postmaster improvement #11698

Merged
merged 5 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ export default {
};
},
},
matchAllFilters: {
type: "boolean",
label: "Match All Filters",
description: "If `true`, events will only be emitted if they match **all** of the selected criteria. The default behavior is matching any of them.",
optional: true,
default: false,
},
ipReputation: {
type: "string[]",
label: "IP Reputation",
Expand Down
2 changes: 1 addition & 1 deletion components/google_postmaster_tools_api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/google_postmaster_tools_api",
"version": "0.1.1",
"version": "0.2.0",
"description": "Pipedream Google Postmaster Tools Components",
"main": "google_postmaster_tools_api.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
name: "New Matched Traffic Stats",
description:
"Emits a new event when traffic stats match certain criteria. [See the documentation](https://developers.google.com/gmail/postmaster/reference/rest)",
version: "0.0.2",
version: "0.1.0",
type: "source",
dedupe: "unique",
sampleEmit,
Expand All @@ -26,6 +26,17 @@ export default {
"domain",
],
},
filterInfo: {
type: "alert",
alertType: "info",
content: "By default, events will be emitted when matching **any** of the configured filters. If you want **all** configured filters to be required instead, you can use the `Match All Filters` prop below.",
},
matchAllFilters: {
propDefinition: [
googlePostmasterToolsApi,
"matchAllFilters",
],
},
ipReputation: {
propDefinition: [
googlePostmasterToolsApi,
Expand Down Expand Up @@ -215,8 +226,9 @@ export default {
for (let filter of filters) {
const result = filter(item);
if (result === true) {
if (!this.matchAllFilters) return true;
hasMatch = true;
} else if (result === false) {
} else if (result === false && this.matchAllFilters) {
return false;
}
}
Expand Down