Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// x-pd-ai: optimized
import { defineAction } from "@pipedream/types";
import { ConfigurationError } from "@pipedream/platform";
import app from "../../app/google_my_business.app";
Expand All @@ -12,7 +13,7 @@ export default defineAction({
key: "google_my_business-create-post",
name: "Create Post",
description: `Create a new local post associated with a location. [See the documentation](${DOCS_LINK})`,
version: "0.0.7",
version: "0.1.0",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand All @@ -31,9 +32,6 @@ export default defineAction({
propDefinition: [
app,
"location",
({ account }: { account: string; }) => ({
account,
}),
],
},
topicType: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// x-pd-ai: optimized
import { defineAction } from "@pipedream/types";
import app from "../../app/google_my_business.app";
import { UpdateReplyParams } from "../../common/requestParams";
Expand All @@ -8,7 +9,7 @@ export default defineAction({
key: "google_my_business-create-update-reply-to-review",
name: "Create or Update Reply to Review",
description: `Create or update a reply to the specified review. [See the documentation](${DOCS_LINK})`,
version: "0.0.6",
version: "0.1.0",
annotations: {
destructiveHint: true,
openWorldHint: true,
Expand All @@ -27,21 +28,12 @@ export default defineAction({
propDefinition: [
app,
"location",
({ account }: { account: string; }) => ({
account,
}),
],
},
review: {
propDefinition: [
app,
"review",
({
account, location,
}: Record<string, string>) => ({
account,
location,
}),
],
},
comment: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// x-pd-ai: optimized
import { defineAction } from "@pipedream/types";
import app from "../../app/google_my_business.app";
import { PerformanceParams } from "../../common/requestParams";
import { DAILY_METRIC_OPTIONS } from "../../common/constants";
import {
assertDateOrder, parseDate,
} from "../../common/utils";

const DOCS_LINK = "https://developers.google.com/my-business/reference/performance/rest/v1/locations/getDailyMetricsTimeSeries";

export default defineAction({
key: "google_my_business-get-daily-metrics-time-series",
name: "Get Daily Metrics Time Series",
description: `Get the values for a single performance metric of a location, aggregated by day over a date range. Use **Get Multiple Daily Metrics Time Series** to fetch several metrics in one call, and **List Search Keyword Impressions** for the search terms driving that traffic. [See the documentation](${DOCS_LINK})`,
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
type: "action",
props: {
app,
location: {
propDefinition: [
app,
"location",
],
},
dailyMetric: {
type: "string",
label: "Daily Metric",
description: "The metric to retrieve, e.g. `CALL_CLICKS` or `WEBSITE_CLICKS`.",
options: DAILY_METRIC_OPTIONS,
},
startDate: {
type: "string",
label: "Start Date",
description: "Start of the date range, in `YYYY-MM-DD` format (e.g. `2026-01-01`). The range must not exceed 18 months and cannot start before 2021-01-01.",
},
endDate: {
type: "string",
label: "End Date",
description: "End of the date range, in `YYYY-MM-DD` format (e.g. `2026-01-31`).",
},
},
async run({ $ }) {
const {
location, dailyMetric, startDate, endDate,
} = this;

const start = parseDate(startDate, "Start Date");
const end = parseDate(endDate, "End Date");
assertDateOrder(start, end, "Start Date", "End Date");

const params: PerformanceParams = {
$,
location,
params: {
dailyMetric,
"dailyRange.start_date.year": start.year,
"dailyRange.start_date.month": start.month,
"dailyRange.start_date.day": start.day,
"dailyRange.end_date.year": end.year,
"dailyRange.end_date.month": end.month,
"dailyRange.end_date.day": end.day,
},
};

const response = await this.app.getDailyMetricsTimeSeries(params);
const count = response?.timeSeries?.datedValues?.length ?? 0;

$.export("$summary", `Successfully retrieved ${count} daily value${count !== 1
? "s"
: ""} for ${dailyMetric}`);

return response;
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// x-pd-ai: optimized
import { defineAction } from "@pipedream/types";
import { ConfigurationError } from "@pipedream/platform";
import app from "../../app/google_my_business.app";
import { PerformanceParams } from "../../common/requestParams";
import { DAILY_METRIC_OPTIONS } from "../../common/constants";
import {
assertDateOrder, parseDate,
} from "../../common/utils";

const DOCS_LINK = "https://developers.google.com/my-business/reference/performance/rest/v1/locations/fetchMultiDailyMetricsTimeSeries";
const MAX_METRICS = 10;

export default defineAction({
key: "google_my_business-get-multiple-daily-metrics-time-series",
name: "Get Multiple Daily Metrics Time Series",
description: `Get the values for several performance metrics of a location over the same date range in a single call, e.g. views and calls together. Use **Get Daily Metrics Time Series** instead when only one metric is needed. [See the documentation](${DOCS_LINK})`,
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
type: "action",
props: {
app,
location: {
propDefinition: [
app,
"location",
],
},
dailyMetrics: {
type: "string[]",
label: "Daily Metrics",
description: `Up to ${MAX_METRICS} metrics to retrieve, e.g. \`CALL_CLICKS\` and \`WEBSITE_CLICKS\`.`,
options: DAILY_METRIC_OPTIONS,
},
startDate: {
type: "string",
label: "Start Date",
description: "Start of the date range, in `YYYY-MM-DD` format (e.g. `2026-01-01`). The range must not exceed 18 months and cannot start before 2021-01-01.",
},
endDate: {
type: "string",
label: "End Date",
description: "End of the date range, in `YYYY-MM-DD` format (e.g. `2026-01-31`).",
},
},
async run({ $ }) {
const {
location, dailyMetrics, startDate, endDate,
} = this;

if (dailyMetrics?.length > MAX_METRICS) {
throw new ConfigurationError(`**Daily Metrics** accepts at most ${MAX_METRICS} metrics. Received ${dailyMetrics.length}.`);
}

const start = parseDate(startDate, "Start Date");
const end = parseDate(endDate, "End Date");
assertDateOrder(start, end, "Start Date", "End Date");

const params: PerformanceParams = {
$,
location,
params: {
dailyMetrics,
"dailyRange.start_date.year": start.year,
"dailyRange.start_date.month": start.month,
"dailyRange.start_date.day": start.day,
"dailyRange.end_date.year": end.year,
"dailyRange.end_date.month": end.month,
"dailyRange.end_date.day": end.day,
},
};

const response = await this.app.fetchMultiDailyMetricsTimeSeries(params);
const count = response?.multiDailyMetricTimeSeries?.length ?? 0;

$.export("$summary", `Successfully retrieved time series for ${count} metric${count !== 1
? "s"
: ""}`);

return response;
},
});
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// x-pd-ai: optimized
import { defineAction } from "@pipedream/types";
import app from "../../app/google_my_business.app";
import { BatchGetReviewsParams } from "../../common/requestParams";
Expand All @@ -8,7 +9,7 @@ export default defineAction({
key: "google_my_business-get-reviews-multiple-locations",
name: "Get Reviews from Multiple Locations",
description: `Get reviews from multiple locations at once. [See the documentation](${DOCS_LINK})`,
version: "0.0.5",
version: "0.1.0",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand All @@ -27,13 +28,10 @@ export default defineAction({
propDefinition: [
app,
"location",
({ account }: { account: string; }) => ({
account,
}),
],
type: "string[]",
label: "Location Names",
description: "One or more locations to get reviews from",
description: "One or more location IDs or full resource names to get reviews from. Use **List Locations** to find valid location IDs for the account.",
},
pageSize: {
type: "integer",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// x-pd-ai: optimized
import { defineAction } from "@pipedream/types";
import app from "../../app/google_my_business.app";
import { GetReviewParams } from "../../common/requestParams";
Expand All @@ -8,7 +9,7 @@ export default defineAction({
key: "google_my_business-get-specific-review",
name: "Get a Specific Review",
description: `Return a specific review by name. [See the documentation](${DOCS_LINK})`,
version: "0.0.5",
version: "0.1.0",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand All @@ -27,21 +28,12 @@ export default defineAction({
propDefinition: [
app,
"location",
({ account }: { account: string; }) => ({
account,
}),
],
},
review: {
propDefinition: [
app,
"review",
({
account, location,
}: Record<string, string>) => ({
account,
location,
}),
],
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// x-pd-ai: optimized
import { defineAction } from "@pipedream/types";
import app from "../../app/google_my_business.app";
import { ListAccountsParams } from "../../common/requestParams";
Expand All @@ -9,7 +10,7 @@ export default defineAction({
key: "google_my_business-list-accounts",
name: "List Accounts",
description: `Lists all accounts accessible to the authenticated user. [See the documentation](${DOCS_LINK})`,
version: "0.0.2",
version: "0.1.0",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// x-pd-ai: optimized
import { defineAction } from "@pipedream/types";
import app from "../../app/google_my_business.app";
import { ListReviewsParams } from "../../common/requestParams";
Expand All @@ -8,7 +9,7 @@ export default defineAction({
key: "google_my_business-list-all-reviews",
name: "List All Reviews",
description: `List all reviews of a location to audit reviews in bulk. [See the documentation](${DOCS_LINK})`,
version: "0.0.5",
version: "0.1.0",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand All @@ -27,9 +28,6 @@ export default defineAction({
propDefinition: [
app,
"location",
({ account }: { account: string; }) => ({
account,
}),
],
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// x-pd-ai: optimized
import { defineAction } from "@pipedream/types";
import app from "../../app/google_my_business.app";
import { ListLocationsParams } from "../../common/requestParams";
Expand All @@ -9,7 +10,7 @@ export default defineAction({
key: "google_my_business-list-locations",
name: "List Locations",
description: `Lists the locations for the specified account. [See the documentation](${DOCS_LINK})`,
version: "0.0.2",
version: "0.1.0",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// x-pd-ai: optimized
import { defineAction } from "@pipedream/types";
import app from "../../app/google_my_business.app";
import { ListPostsParams } from "../../common/requestParams";
Expand All @@ -9,7 +10,7 @@ export default defineAction({
key: "google_my_business-list-posts",
name: "List Posts",
description: `List local posts associated with a location. [See the documentation](${DOCS_LINK})`,
version: "0.0.6",
version: "0.1.0",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand All @@ -28,9 +29,6 @@ export default defineAction({
propDefinition: [
app,
"location",
({ account }: { account: string; }) => ({
account,
}),
],
},
maxResults: {
Expand Down
Loading
Loading