import type { Square } from "square" import { defineSquareOperation } from "../lib" /** * Describes the reporting cubes, views, measures, dimensions, and segments * available to query. */ export const getSquareReportingMetadata = defineSquareOperation< Record, Square.MetadataResponse >({ allowedKeys: [], description: "Describes the reporting cubes, views, measures, dimensions, and segments available to query.", execute: (api, _input) => api.reporting.getMetadata(), name: "Get Square reporting metadata", replaySafety: "safe", requiredKeys: [], scopes: ["REPORTING_READ"], }) /** Runs an aggregated Square reporting query against the discovered schema. */ export const loadSquareReport = defineSquareOperation< Square.LoadRequest, Square.LoadResponse >({ allowedKeys: ["queryType", "cache", "query"], description: "Runs an aggregated Square reporting query against the discovered schema.", execute: (api, input) => api.reporting.load(input), name: "Load Square report", replaySafety: "safe", requiredKeys: [], scopes: ["REPORTING_READ"], })