import type { Square } from "square" import { defineSquareOperation } from "../lib" /** Creates a [location](https://developer.squareup.com/docs/locations-api). */ export const createSquareLocation = defineSquareOperation< Square.CreateLocationRequest, Square.CreateLocationResponse >({ allowedKeys: ["location"], description: "Creates a [location](https://developer.squareup.com/docs/locations-api).", execute: (api, input) => api.locations.create(input), name: "Create Square Location", replaySafety: "unsafe", requiredKeys: [], scopes: ["MERCHANT_PROFILE_WRITE"], }) /** * Provides details about all of the seller's * [locations](https://developer.squareup.com/docs/locations-api), including * those with an inactive status. */ export const listSquareLocations = defineSquareOperation< Record, Square.ListLocationsResponse >({ allowedKeys: [], description: "Provides details about all of the seller's [locations](https://developer.squareup.com/docs/locations-api), including those with an inactive status.", execute: (api, _input) => api.locations.list(), name: "List Square Locations", replaySafety: "safe", requiredKeys: [], scopes: ["MERCHANT_PROFILE_READ"], }) /** Retrieves details of a single location. */ export const retrieveSquareLocation = defineSquareOperation< Square.GetLocationsRequest, Square.GetLocationResponse >({ allowedKeys: ["locationId"], description: "Retrieves details of a single location.", execute: (api, input) => api.locations.get(input), name: "Retrieve Square Location", replaySafety: "safe", requiredKeys: ["locationId"], scopes: ["MERCHANT_PROFILE_READ"], }) /** Updates a [location](https://developer.squareup.com/docs/locations-api). */ export const updateSquareLocation = defineSquareOperation< Square.UpdateLocationRequest, Square.UpdateLocationResponse >({ allowedKeys: ["locationId", "location"], description: "Updates a [location](https://developer.squareup.com/docs/locations-api).", execute: (api, input) => api.locations.update(input), name: "Update Square Location", replaySafety: "safe", requiredKeys: ["locationId"], scopes: ["MERCHANT_PROFILE_WRITE"], })