import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient"; import * as core from "../../../../core"; import type * as Square from "../../../index"; import { ImagesClient } from "../resources/images/client/Client"; import { ObjectClient } from "../resources/object/client/Client"; export declare namespace CatalogClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } export declare class CatalogClient { protected readonly _options: NormalizedClientOptionsWithAuth; protected _images: ImagesClient | undefined; protected _object: ObjectClient | undefined; constructor(options?: CatalogClient.Options); get images(): ImagesClient; get object(): ObjectClient; /** * Deletes a set of [CatalogItem](entity:CatalogItem)s based on the * provided list of target IDs and returns a set of successfully deleted IDs in * the response. Deletion is a cascading event such that all children of the * targeted object are also deleted. For example, deleting a CatalogItem will * also delete all of its [CatalogItemVariation](entity:CatalogItemVariation) * children. * * `BatchDeleteCatalogObjects` succeeds even if only a portion of the targeted * IDs can be deleted. The response will only include IDs that were * actually deleted. * * To ensure consistency, only one delete request is processed at a time per seller account. * While one (batch or non-batch) delete request is being processed, other (batched and non-batched) * delete requests are rejected with the `429` error code. * * @param {Square.BatchDeleteCatalogObjectsRequest} request * @param {CatalogClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.batchDelete({ * objectIds: ["W62UWFY35CWMYGVWK6TWJDNI", "AA27W3M2GGTF3H6AVPNB77CK"] * }) */ batchDelete(request: Square.BatchDeleteCatalogObjectsRequest, requestOptions?: CatalogClient.RequestOptions): core.HttpResponsePromise; private __batchDelete; /** * Returns a set of objects based on the provided ID. * Each [CatalogItem](entity:CatalogItem) returned in the set includes all of its * child information including: all of its * [CatalogItemVariation](entity:CatalogItemVariation) objects, references to * its [CatalogModifierList](entity:CatalogModifierList) objects, and the ids of * any [CatalogTax](entity:CatalogTax) objects that apply to it. * * @param {Square.BatchGetCatalogObjectsRequest} request * @param {CatalogClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.batchGet({ * objectIds: ["W62UWFY35CWMYGVWK6TWJDNI", "AA27W3M2GGTF3H6AVPNB77CK"], * includeRelatedObjects: true * }) */ batchGet(request: Square.BatchGetCatalogObjectsRequest, requestOptions?: CatalogClient.RequestOptions): core.HttpResponsePromise; private __batchGet; /** * Creates or updates up to 10,000 target objects based on the provided * list of objects. The target objects are grouped into batches and each batch is * inserted/updated in an all-or-nothing manner. If an object within a batch is * malformed in some way, or violates a database constraint, the entire batch * containing that item will be disregarded. However, other batches in the same * request may still succeed. Each batch may contain up to 1,000 objects, and * batches will be processed in order as long as the total object count for the * request (items, variations, modifier lists, discounts, and taxes) is no more * than 10,000. * * This endpoint uses full-replacement semantics. The client must send the complete object, and any * field absent from the request is interpreted as an intentional clear. This logic applies to * nested objects as well. For example, omitting inlined children like variations will delete them. * * To ensure consistency, only one update request is processed at a time per seller account. * While one (batch or non-batch) update request is being processed, other (batched and non-batched) * update requests are rejected with the `429` error code. Prefer batching related changes into a * single call rather than issuing many small writes, since each write acquires the lock separately * and parallel writes to the same seller will contend with each other, producing `429` errors. * * @param {Square.BatchUpsertCatalogObjectsRequest} request * @param {CatalogClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.batchUpsert({ * idempotencyKey: "789ff020-f723-43a9-b4b5-43b5dc1fa3dc", * batches: [{ * objects: [{ * type: "ITEM", * id: "id" * }, { * type: "ITEM", * id: "id" * }, { * type: "ITEM", * id: "id" * }, { * type: "TAX", * id: "id" * }] * }] * }) */ batchUpsert(request: Square.BatchUpsertCatalogObjectsRequest, requestOptions?: CatalogClient.RequestOptions): core.HttpResponsePromise; private __batchUpsert; /** * Retrieves information about the Square Catalog API, such as batch size * limits that can be used by the `BatchUpsertCatalogObjects` endpoint. * * @param {CatalogClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.info() */ info(requestOptions?: CatalogClient.RequestOptions): core.HttpResponsePromise; private __info; /** * Returns a list of all [CatalogObject](entity:CatalogObject)s of the specified types in the catalog. * * The `types` parameter is specified as a comma-separated list of the [CatalogObjectType](entity:CatalogObjectType) values, * for example, "`ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`, `IMAGE`". * Always specify `types` explicitly. When upgrading to a newer API version, omitting `types` may * cause new object types to appear in results that were not returned under the previous version. * * __Important:__ ListCatalog does not return deleted catalog items. To retrieve * deleted catalog items, use [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects) * and set the `include_deleted_objects` attribute value to `true`. * * @param {Square.ListCatalogRequest} request * @param {CatalogClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.list({ * cursor: "cursor", * types: "types", * catalogVersion: BigInt("1000000") * }) */ list(request?: Square.ListCatalogRequest, requestOptions?: CatalogClient.RequestOptions): Promise>; /** * Searches for [CatalogObject](entity:CatalogObject) of any type by matching supported search attribute values, * excluding custom attribute values on items or item variations, against one or more of the specified query filters. * * This (`SearchCatalogObjects`) endpoint differs from the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) * endpoint in the following aspects: * * - `SearchCatalogItems` can only search for items or item variations, whereas `SearchCatalogObjects` can search for any type of catalog objects. * - `SearchCatalogItems` supports the custom attribute query filters to return items or item variations that contain custom attribute values, where `SearchCatalogObjects` does not. * - `SearchCatalogItems` does not support the `include_deleted_objects` filter to search for deleted items or item variations, whereas `SearchCatalogObjects` does. * - The both endpoints have different call conventions, including the query filter formats. * * The `object_types` parameter is specified as a list of [CatalogObjectType](entity:CatalogObjectType) values. * Always specify `object_types` explicitly. When upgrading to a newer API version, omitting * `object_types` may cause new object types to appear in results that were not returned under * the previous version. * * @param {Square.SearchCatalogObjectsRequest} request * @param {CatalogClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.search({ * objectTypes: ["ITEM"], * query: { * prefixQuery: { * attributeName: "name", * attributePrefix: "tea" * } * }, * limit: 100 * }) */ search(request?: Square.SearchCatalogObjectsRequest, requestOptions?: CatalogClient.RequestOptions): core.HttpResponsePromise; private __search; /** * Searches for catalog items or item variations by matching supported search attribute values, including * custom attribute values, against one or more of the specified query filters. * * This (`SearchCatalogItems`) endpoint differs from the [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects) * endpoint in the following aspects: * * - `SearchCatalogItems` can only search for items or item variations, whereas `SearchCatalogObjects` can search for any type of catalog objects. * - `SearchCatalogItems` supports the custom attribute query filters to return items or item variations that contain custom attribute values, where `SearchCatalogObjects` does not. * - `SearchCatalogItems` does not support the `include_deleted_objects` filter to search for deleted items or item variations, whereas `SearchCatalogObjects` does. * - The both endpoints use different call conventions, including the query filter formats. * * @param {Square.SearchCatalogItemsRequest} request * @param {CatalogClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.searchItems({ * textFilter: "red", * categoryIds: ["WINE_CATEGORY_ID"], * stockLevels: ["OUT", "LOW"], * enabledLocationIds: ["ATL_LOCATION_ID"], * limit: 100, * sortOrder: "ASC", * productTypes: ["REGULAR"], * customAttributeFilters: [{ * customAttributeDefinitionId: "VEGAN_DEFINITION_ID", * boolFilter: true * }, { * customAttributeDefinitionId: "BRAND_DEFINITION_ID", * stringFilter: "Dark Horse" * }, { * key: "VINTAGE", * numberFilter: { * min: "min", * max: "max" * } * }, { * customAttributeDefinitionId: "VARIETAL_DEFINITION_ID" * }] * }) */ searchItems(request?: Square.SearchCatalogItemsRequest, requestOptions?: CatalogClient.RequestOptions): core.HttpResponsePromise; private __searchItems; /** * Updates the [CatalogModifierList](entity:CatalogModifierList) objects * that apply to the targeted [CatalogItem](entity:CatalogItem) without having * to perform an upsert on the entire item. * * @param {Square.UpdateItemModifierListsRequest} request * @param {CatalogClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.updateItemModifierLists({ * itemIds: ["H42BRLUJ5KTZTTMPVSLFAACQ", "2JXOBJIHCWBQ4NZ3RIXQGJA6"], * modifierListsToEnable: ["H42BRLUJ5KTZTTMPVSLFAACQ", "2JXOBJIHCWBQ4NZ3RIXQGJA6"], * modifierListsToDisable: ["7WRC16CJZDVLSNDQ35PP6YAD"] * }) */ updateItemModifierLists(request: Square.UpdateItemModifierListsRequest, requestOptions?: CatalogClient.RequestOptions): core.HttpResponsePromise; private __updateItemModifierLists; /** * Updates the [CatalogTax](entity:CatalogTax) objects that apply to the * targeted [CatalogItem](entity:CatalogItem) without having to perform an * upsert on the entire item. * * @param {Square.UpdateItemTaxesRequest} request * @param {CatalogClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.updateItemTaxes({ * itemIds: ["H42BRLUJ5KTZTTMPVSLFAACQ", "2JXOBJIHCWBQ4NZ3RIXQGJA6"], * taxesToEnable: ["4WRCNHCJZDVLSNDQ35PP6YAD"], * taxesToDisable: ["AQCEGCEBBQONINDOHRGZISEX"] * }) */ updateItemTaxes(request: Square.UpdateItemTaxesRequest, requestOptions?: CatalogClient.RequestOptions): core.HttpResponsePromise; private __updateItemTaxes; }