From 0fe5eaf18aceb9ee02d29cc74615fd64208f7a70 Mon Sep 17 00:00:00 2001 From: autobot Date: Wed, 20 Mar 2024 16:44:59 +0000 Subject: [PATCH] Generated PR for Release: 35.1.0 --- doc/api/bookings.md | 2 +- doc/api/labor.md | 28 ++++++------- doc/client.md | 6 +-- doc/models/catalog-item-modifier-list-info.md | 4 +- doc/models/digital-wallet-details.md | 2 +- ...list-location-booking-profiles-response.md | 40 ++++--------------- doc/models/tender-type.md | 2 +- package.json | 2 +- src/api/bookingsApi.ts | 2 +- src/api/laborApi.ts | 30 +++++++------- src/client.ts | 4 +- src/defaultConfiguration.ts | 2 +- src/models/catalogItemModifierListInfo.ts | 22 +++++++++- src/models/digitalWalletDetails.ts | 5 ++- 14 files changed, 74 insertions(+), 77 deletions(-) diff --git a/doc/api/bookings.md b/doc/api/bookings.md index 7f0bd3fe..0c818803 100644 --- a/doc/api/bookings.md +++ b/doc/api/bookings.md @@ -90,7 +90,7 @@ The required input must include the following: - `Booking.location_id` - `Booking.start_at` -- `Booking.team_member_id` +- `Booking.AppointmentSegment.team_member_id` - `Booking.AppointmentSegment.service_variation_id` - `Booking.AppointmentSegment.service_variation_version` diff --git a/doc/api/labor.md b/doc/api/labor.md index 4558980b..1564f970 100644 --- a/doc/api/labor.md +++ b/doc/api/labor.md @@ -386,20 +386,20 @@ try { Creates a new `Shift`. -A `Shift` represents a complete workday for a single employee. +A `Shift` represents a complete workday for a single team member. You must provide the following values in your request to this endpoint: - `location_id` -- `employee_id` +- `team_member_id` - `start_at` An attempt to create a new `Shift` can result in a `BAD_REQUEST` error when: -- The `status` of the new `Shift` is `OPEN` and the employee has another +- The `status` of the new `Shift` is `OPEN` and the team member has another shift with an `OPEN` status. - The `start_at` date is in the future. -- The `start_at` or `end_at` date overlaps another shift for the same employee. +- The `start_at` or `end_at` date overlaps another shift for the same team member. - The `Break` instances are set in the request and a break `start_at` is before the `Shift.start_at`, a break `end_at` is after the `Shift.end_at`, or both. @@ -479,19 +479,19 @@ try { Returns a paginated list of `Shift` records for a business. The list to be returned can be filtered by: -- Location IDs. -- Employee IDs. -- Shift status (`OPEN` and `CLOSED`). -- Shift start. -- Shift end. -- Workday details. +- Location IDs +- Team member IDs +- Shift status (`OPEN` or `CLOSED`) +- Shift start +- Shift end +- Workday details The list can be sorted by: -- `start_at`. -- `end_at`. -- `created_at`. -- `updated_at`. +- `START_AT` +- `END_AT` +- `CREATED_AT` +- `UPDATED_AT` ```ts async searchShifts( diff --git a/doc/client.md b/doc/client.md index e197cc92..808bd36c 100644 --- a/doc/client.md +++ b/doc/client.md @@ -5,7 +5,7 @@ The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| `squareVersion` | `string` | Square Connect API versions
*Default*: `'2024-02-22'` | +| `squareVersion` | `string` | Square Connect API versions
*Default*: `'2024-03-20'` | | `customUrl` | `string` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`
*Default*: `'https://connect.squareup.com'` | | `environment` | `string` | The API environment.
**Default: `production`** | | `additionalHeaders` | `Readonly>` | Additional headers to add to each API call
*Default*: `{}` | @@ -43,7 +43,7 @@ const client = new Client({ bearerAuthCredentials: { accessToken: 'AccessToken' }, - squareVersion: '2024-02-22', + squareVersion: '2024-03-20', timeout: 60000, additionalHeaders: {}, userAgentDetail: '', @@ -60,7 +60,7 @@ const client = new Client({ bearerAuthCredentials: { accessToken: 'AccessToken' }, - squareVersion: '2024-02-22', + squareVersion: '2024-03-20', timeout: 60000, additionalHeaders: {}, userAgentDetail: '', diff --git a/doc/models/catalog-item-modifier-list-info.md b/doc/models/catalog-item-modifier-list-info.md index 38d19e26..462a24bb 100644 --- a/doc/models/catalog-item-modifier-list-info.md +++ b/doc/models/catalog-item-modifier-list-info.md @@ -14,8 +14,8 @@ and specifies supported behaviors of the application. | --- | --- | --- | --- | | `modifierListId` | `string` | Required | The ID of the `CatalogModifierList` controlled by this `CatalogModifierListInfo`.
**Constraints**: *Minimum Length*: `1` | | `modifierOverrides` | [`CatalogModifierOverride[] \| null \| undefined`](../../doc/models/catalog-modifier-override.md) | Optional | A set of `CatalogModifierOverride` objects that override whether a given `CatalogModifier` is enabled by default. | -| `minSelectedModifiers` | `number \| null \| undefined` | Optional | If 0 or larger, the smallest number of `CatalogModifier`s that must be selected from this `CatalogModifierList`. | -| `maxSelectedModifiers` | `number \| null \| undefined` | Optional | If 0 or larger, the largest number of `CatalogModifier`s that can be selected from this `CatalogModifierList`. | +| `minSelectedModifiers` | `number \| null \| undefined` | Optional | If 0 or larger, the smallest number of `CatalogModifier`s that must be selected from this `CatalogModifierList`.
The default value is `-1`.

When `CatalogModifierList.selection_type` is `MULTIPLE`, `CatalogModifierListInfo.min_selected_modifiers=-1`
and `CatalogModifierListInfo.max_selected_modifier=-1` means that from zero to the maximum number of modifiers of
the `CatalogModifierList` can be selected from the `CatalogModifierList`.

When the `CatalogModifierList.selection_type` is `SINGLE`, `CatalogModifierListInfo.min_selected_modifiers=-1`
and `CatalogModifierListInfo.max_selected_modifier=-1` means that exactly one modifier must be present in
and can be selected from the `CatalogModifierList` | +| `maxSelectedModifiers` | `number \| null \| undefined` | Optional | If 0 or larger, the largest number of `CatalogModifier`s that can be selected from this `CatalogModifierList`.
The default value is `-1`.

When `CatalogModifierList.selection_type` is `MULTIPLE`, `CatalogModifierListInfo.min_selected_modifiers=-1`
and `CatalogModifierListInfo.max_selected_modifier=-1` means that from zero to the maximum number of modifiers of
the `CatalogModifierList` can be selected from the `CatalogModifierList`.

When the `CatalogModifierList.selection_type` is `SINGLE`, `CatalogModifierListInfo.min_selected_modifiers=-1`
and `CatalogModifierListInfo.max_selected_modifier=-1` means that exactly one modifier must be present in
and can be selected from the `CatalogModifierList` | | `enabled` | `boolean \| null \| undefined` | Optional | If `true`, enable this `CatalogModifierList`. The default value is `true`. | | `ordinal` | `number \| null \| undefined` | Optional | The position of this `CatalogItemModifierListInfo` object within the `modifier_list_info` list applied
to a `CatalogItem` instance. | diff --git a/doc/models/digital-wallet-details.md b/doc/models/digital-wallet-details.md index 2f15eafd..25d0fd8a 100644 --- a/doc/models/digital-wallet-details.md +++ b/doc/models/digital-wallet-details.md @@ -12,7 +12,7 @@ Additional details about `WALLET` type payments. Contains only non-confidential | Name | Type | Tags | Description | | --- | --- | --- | --- | | `status` | `string \| null \| undefined` | Optional | The status of the `WALLET` payment. The status can be `AUTHORIZED`, `CAPTURED`, `VOIDED`, or
`FAILED`.
**Constraints**: *Maximum Length*: `50` | -| `brand` | `string \| null \| undefined` | Optional | The brand used for the `WALLET` payment. The brand can be `CASH_APP`, `PAYPAY` or `UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | +| `brand` | `string \| null \| undefined` | Optional | The brand used for the `WALLET` payment. The brand can be `CASH_APP`, `PAYPAY`, `ALIPAY`,
`RAKUTEN_PAY`, `AU_PAY`, `D_BARAI`, `MERPAY`, `WECHAT_PAY` or `UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | | `cashAppDetails` | [`CashAppDetails \| undefined`](../../doc/models/cash-app-details.md) | Optional | Additional details about `WALLET` type payments with the `brand` of `CASH_APP`. | ## Example (as JSON) diff --git a/doc/models/list-location-booking-profiles-response.md b/doc/models/list-location-booking-profiles-response.md index e316ec8c..cba04484 100644 --- a/doc/models/list-location-booking-profiles-response.md +++ b/doc/models/list-location-booking-profiles-response.md @@ -17,44 +17,20 @@ ```json { + "errors": [], "location_booking_profiles": [ { - "location_id": "location_id0", - "booking_site_url": "booking_site_url2", - "online_booking_enabled": false + "booking_site_url": "https://squareup.com/book/LY6WNBPVM6VGV/testbusiness", + "location_id": "LY6WNBPVM6VGV", + "online_booking_enabled": true }, { - "location_id": "location_id0", - "booking_site_url": "booking_site_url2", - "online_booking_enabled": false - }, - { - "location_id": "location_id0", - "booking_site_url": "booking_site_url2", - "online_booking_enabled": false + "location_id": "PYTRNBPVMJUPV", + "online_booking_enabled": false, + "booking_site_url": "booking_site_url2" } ], - "cursor": "cursor8", - "errors": [ - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "MAP_KEY_LENGTH_TOO_LONG", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "MAP_KEY_LENGTH_TOO_LONG", - "detail": "detail6", - "field": "field4" - }, - { - "category": "MERCHANT_SUBSCRIPTION_ERROR", - "code": "MAP_KEY_LENGTH_TOO_LONG", - "detail": "detail6", - "field": "field4" - } - ] + "cursor": "cursor8" } ``` diff --git a/doc/models/tender-type.md b/doc/models/tender-type.md index 4deb583e..6771990f 100644 --- a/doc/models/tender-type.md +++ b/doc/models/tender-type.md @@ -17,7 +17,7 @@ Indicates a tender's type. | `SQUARE_GIFT_CARD` | A Square gift card. | | `NO_SALE` | This tender represents the register being opened for a "no sale" event. | | `BANK_ACCOUNT` | A bank account payment. | -| `WALLET` | A payment from a digital wallet, e.g. Cash App.

Note: Some "digital wallets", including Google Pay and Apple Pay, facilitate
card payments. Those payments have the `CARD` type. | +| `WALLET` | A payment from a digital wallet, e.g. Cash App, Paypay, Rakuten Pay,
Au Pay, D Barai, Merpay, Wechat Pay, Alipay.

Note: Some "digital wallets", including Google Pay and Apple Pay, facilitate
card payments. Those payments have the `CARD` type. | | `BUY_NOW_PAY_LATER` | A Buy Now Pay Later payment. | | `SQUARE_ACCOUNT` | A Square House Account payment. | | `OTHER` | A form of tender that does not match any other value. | diff --git a/package.json b/package.json index 121b1b47..b2ba953d 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "35.0.0", + "version": "35.1.0", "license": "MIT", "sideEffects": false, "main": "dist/cjs/index.js", diff --git a/src/api/bookingsApi.ts b/src/api/bookingsApi.ts index 32c0004b..aca6277a 100644 --- a/src/api/bookingsApi.ts +++ b/src/api/bookingsApi.ts @@ -138,7 +138,7 @@ export class BookingsApi extends BaseApi { * The required input must include the following: * - `Booking.location_id` * - `Booking.start_at` - * - `Booking.team_member_id` + * - `Booking.AppointmentSegment.team_member_id` * - `Booking.AppointmentSegment.service_variation_id` * - `Booking.AppointmentSegment.service_variation_version` * diff --git a/src/api/laborApi.ts b/src/api/laborApi.ts index d6516ec3..f97c7b71 100644 --- a/src/api/laborApi.ts +++ b/src/api/laborApi.ts @@ -268,19 +268,19 @@ export class LaborApi extends BaseApi { /** * Creates a new `Shift`. * - * A `Shift` represents a complete workday for a single employee. + * A `Shift` represents a complete workday for a single team member. * You must provide the following values in your request to this * endpoint: * * - `location_id` - * - `employee_id` + * - `team_member_id` * - `start_at` * * An attempt to create a new `Shift` can result in a `BAD_REQUEST` error when: - * - The `status` of the new `Shift` is `OPEN` and the employee has another + * - The `status` of the new `Shift` is `OPEN` and the team member has another * shift with an `OPEN` status. * - The `start_at` date is in the future. - * - The `start_at` or `end_at` date overlaps another shift for the same employee. + * - The `start_at` or `end_at` date overlaps another shift for the same team member. * - The `Break` instances are set in the request and a break `start_at` * is before the `Shift.start_at`, a break `end_at` is after * the `Shift.end_at`, or both. @@ -304,18 +304,18 @@ export class LaborApi extends BaseApi { /** * Returns a paginated list of `Shift` records for a business. * The list to be returned can be filtered by: - * - Location IDs. - * - Employee IDs. - * - Shift status (`OPEN` and `CLOSED`). - * - Shift start. - * - Shift end. - * - Workday details. + * - Location IDs + * - Team member IDs + * - Shift status (`OPEN` or `CLOSED`) + * - Shift start + * - Shift end + * - Workday details * * The list can be sorted by: - * - `start_at`. - * - `end_at`. - * - `created_at`. - * - `updated_at`. + * - `START_AT` + * - `END_AT` + * - `CREATED_AT` + * - `UPDATED_AT` * * @param body An object containing the fields to POST for the request. See * the corresponding object definition for field details. @@ -428,7 +428,7 @@ export class LaborApi extends BaseApi { } /** - * Returns a single `TeamMemberWage` specified by `id `. + * Returns a single `TeamMemberWage` specified by `id`. * * @param id The UUID for the `TeamMemberWage` being retrieved. * @return Response from the API call diff --git a/src/client.ts b/src/client.ts index 4d165c3b..67d97f76 100644 --- a/src/client.ts +++ b/src/client.ts @@ -67,7 +67,7 @@ import { import { HttpClient } from './clientAdapter'; /** Current SDK version */ -export const SDK_VERSION = '35.0.0'; +export const SDK_VERSION = '35.1.0'; export class Client implements ClientInterface { private _config: Readonly; private _timeout: number; @@ -138,7 +138,7 @@ export class Client implements ClientInterface { } this._userAgent = updateUserAgent( - 'Square-TypeScript-SDK/35.0.0 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}', + 'Square-TypeScript-SDK/35.1.0 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}', this._config.squareVersion, this._config.userAgentDetail ); diff --git a/src/defaultConfiguration.ts b/src/defaultConfiguration.ts index 31431bf2..dd1280b0 100644 --- a/src/defaultConfiguration.ts +++ b/src/defaultConfiguration.ts @@ -4,7 +4,7 @@ import { RetryConfiguration } from './core'; /** Default values for the configuration parameters of the client. */ export const DEFAULT_CONFIGURATION: Configuration = { timeout: 60000, - squareVersion: '2024-02-22', + squareVersion: '2024-03-20', additionalHeaders: {}, userAgentDetail: '', environment: Environment.Production, diff --git a/src/models/catalogItemModifierListInfo.ts b/src/models/catalogItemModifierListInfo.ts index 3262cbb6..cf2a5c0e 100644 --- a/src/models/catalogItemModifierListInfo.ts +++ b/src/models/catalogItemModifierListInfo.ts @@ -23,9 +23,27 @@ export interface CatalogItemModifierListInfo { modifierListId: string; /** A set of `CatalogModifierOverride` objects that override whether a given `CatalogModifier` is enabled by default. */ modifierOverrides?: CatalogModifierOverride[] | null; - /** If 0 or larger, the smallest number of `CatalogModifier`s that must be selected from this `CatalogModifierList`. */ + /** + * If 0 or larger, the smallest number of `CatalogModifier`s that must be selected from this `CatalogModifierList`. + * The default value is `-1`. + * When `CatalogModifierList.selection_type` is `MULTIPLE`, `CatalogModifierListInfo.min_selected_modifiers=-1` + * and `CatalogModifierListInfo.max_selected_modifier=-1` means that from zero to the maximum number of modifiers of + * the `CatalogModifierList` can be selected from the `CatalogModifierList`. + * When the `CatalogModifierList.selection_type` is `SINGLE`, `CatalogModifierListInfo.min_selected_modifiers=-1` + * and `CatalogModifierListInfo.max_selected_modifier=-1` means that exactly one modifier must be present in + * and can be selected from the `CatalogModifierList` + */ minSelectedModifiers?: number | null; - /** If 0 or larger, the largest number of `CatalogModifier`s that can be selected from this `CatalogModifierList`. */ + /** + * If 0 or larger, the largest number of `CatalogModifier`s that can be selected from this `CatalogModifierList`. + * The default value is `-1`. + * When `CatalogModifierList.selection_type` is `MULTIPLE`, `CatalogModifierListInfo.min_selected_modifiers=-1` + * and `CatalogModifierListInfo.max_selected_modifier=-1` means that from zero to the maximum number of modifiers of + * the `CatalogModifierList` can be selected from the `CatalogModifierList`. + * When the `CatalogModifierList.selection_type` is `SINGLE`, `CatalogModifierListInfo.min_selected_modifiers=-1` + * and `CatalogModifierListInfo.max_selected_modifier=-1` means that exactly one modifier must be present in + * and can be selected from the `CatalogModifierList` + */ maxSelectedModifiers?: number | null; /** If `true`, enable this `CatalogModifierList`. The default value is `true`. */ enabled?: boolean | null; diff --git a/src/models/digitalWalletDetails.ts b/src/models/digitalWalletDetails.ts index f178afc0..0cea6ee8 100644 --- a/src/models/digitalWalletDetails.ts +++ b/src/models/digitalWalletDetails.ts @@ -8,7 +8,10 @@ export interface DigitalWalletDetails { * `FAILED`. */ status?: string | null; - /** The brand used for the `WALLET` payment. The brand can be `CASH_APP`, `PAYPAY` or `UNKNOWN`. */ + /** + * The brand used for the `WALLET` payment. The brand can be `CASH_APP`, `PAYPAY`, `ALIPAY`, + * `RAKUTEN_PAY`, `AU_PAY`, `D_BARAI`, `MERPAY`, `WECHAT_PAY` or `UNKNOWN`. + */ brand?: string | null; /** Additional details about `WALLET` type payments with the `brand` of `CASH_APP`. */ cashAppDetails?: CashAppDetails;