diff --git a/doc/api/labor.md b/doc/api/labor.md index e6649dd8..4558980b 100644 --- a/doc/api/labor.md +++ b/doc/api/labor.md @@ -427,8 +427,8 @@ async createShift( ```ts const body: CreateShiftRequest = { shift: { - startAt: '2019-01-25T03:11:00-05:00', locationId: 'PAA1RJZZKXBFG', + startAt: '2019-01-25T03:11:00-05:00', endAt: '2019-01-25T13:11:00-05:00', wage: { title: 'Barista', @@ -436,6 +436,7 @@ const body: CreateShiftRequest = { amount: BigInt(1100), currency: 'USD', }, + tipEligible: true, }, breaks: [ { @@ -448,6 +449,10 @@ const body: CreateShiftRequest = { } ], teamMemberId: 'ormj0jJJZ5OZIzxrZYJI', + declaredCashTipMoney: { + amount: BigInt(500), + currency: 'USD', + }, }, idempotencyKey: 'HIDSNG5KS478L', }; @@ -667,8 +672,8 @@ const id = 'id0'; const body: UpdateShiftRequest = { shift: { - startAt: '2019-01-25T03:11:00-05:00', locationId: 'PAA1RJZZKXBFG', + startAt: '2019-01-25T03:11:00-05:00', endAt: '2019-01-25T13:11:00-05:00', wage: { title: 'Bartender', @@ -676,6 +681,7 @@ const body: UpdateShiftRequest = { amount: BigInt(1500), currency: 'USD', }, + tipEligible: true, }, breaks: [ { @@ -690,6 +696,10 @@ const body: UpdateShiftRequest = { ], version: 1, teamMemberId: 'ormj0jJJZ5OZIzxrZYJI', + declaredCashTipMoney: { + amount: BigInt(500), + currency: 'USD', + }, }, }; diff --git a/doc/client.md b/doc/client.md index ba025749..a794fcd7 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*: `'2023-10-18'` | +| `squareVersion` | `string` | Square Connect API versions
*Default*: `'2023-11-15'` | | `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*: `{}` | @@ -40,7 +40,7 @@ The API client can be initialized as follows: ```ts const client = new Client({ - squareVersion: '2023-10-18', + squareVersion: '2023-11-15', timeout: 60000, additionalHeaders: {}, userAgentDetail: '', @@ -55,7 +55,7 @@ const client = new Client({ import { ApiError, Client } from 'square'; const client = new Client({ - squareVersion: '2023-10-18', + squareVersion: '2023-11-15', timeout: 60000, additionalHeaders: {}, userAgentDetail: '', diff --git a/doc/models/catalog-item.md b/doc/models/catalog-item.md index 53b9dffd..06e169c0 100644 --- a/doc/models/catalog-item.md +++ b/doc/models/catalog-item.md @@ -35,17 +35,6 @@ A [CatalogObject](../../doc/models/catalog-object.md) instance of the `ITEM` typ ```json { - "object": { - "id": "#Cocoa", - "item_data": { - "abbreviation": "Ch", - "description": "Hot chocolate", - "name": "Cocoa", - "visibility": "PRIVATE" - }, - "present_at_all_locations": true, - "type": "ITEM" - }, "name": "name6", "description": "description6", "abbreviation": "abbreviation8", diff --git a/doc/models/catalog-modifier-list.md b/doc/models/catalog-modifier-list.md index 24d6e7c4..d0ccb20d 100644 --- a/doc/models/catalog-modifier-list.md +++ b/doc/models/catalog-modifier-list.md @@ -26,49 +26,6 @@ the modifier list are allowed. ```json { - "id": "#MilkType", - "modifier_list_data": { - "allow_quantities": false, - "modifiers": [ - { - "modifier_data": { - "name": "Whole Milk", - "price_money": { - "amount": 0, - "currency": "USD" - } - }, - "present_at_all_locations": true, - "type": "MODIFIER" - }, - { - "modifier_data": { - "name": "Almond Milk", - "price_money": { - "amount": 250, - "currency": "USD" - } - }, - "present_at_all_locations": true, - "type": "MODIFIER" - }, - { - "modifier_data": { - "name": "Soy Milk", - "price_money": { - "amount": 250, - "currency": "USD" - } - }, - "present_at_all_locations": true, - "type": "MODIFIER" - } - ], - "name": "Milk Type", - "selection_type": "SINGLE" - }, - "present_at_all_locations": true, - "type": "MODIFIER_LIST", "name": "name4", "ordinal": 226, "selection_type": "SINGLE", diff --git a/doc/models/catalog-object-batch.md b/doc/models/catalog-object-batch.md index 09fabccc..7401deaf 100644 --- a/doc/models/catalog-object-batch.md +++ b/doc/models/catalog-object-batch.md @@ -21,19 +21,6 @@ A batch of catalog objects. { "type": "PRICING_RULE", "id": "id6", - "item_data": { - "object": { - "id": "#Cocoa", - "item_data": { - "abbreviation": "Ch", - "description": "Hot chocolate", - "name": "Cocoa", - "visibility": "PRIVATE" - }, - "present_at_all_locations": true, - "type": "ITEM" - } - }, "category_data": { "object": { "category_data": { @@ -73,51 +60,6 @@ A batch of catalog objects. "type": "DISCOUNT" } }, - "modifier_list_data": { - "id": "#MilkType", - "modifier_list_data": { - "allow_quantities": false, - "modifiers": [ - { - "modifier_data": { - "name": "Whole Milk", - "price_money": { - "amount": 0, - "currency": "USD" - } - }, - "present_at_all_locations": true, - "type": "MODIFIER" - }, - { - "modifier_data": { - "name": "Almond Milk", - "price_money": { - "amount": 250, - "currency": "USD" - } - }, - "present_at_all_locations": true, - "type": "MODIFIER" - }, - { - "modifier_data": { - "name": "Soy Milk", - "price_money": { - "amount": 250, - "currency": "USD" - } - }, - "present_at_all_locations": true, - "type": "MODIFIER" - } - ], - "name": "Milk Type", - "selection_type": "SINGLE" - }, - "present_at_all_locations": true, - "type": "MODIFIER_LIST" - }, "modifier_data": { "object": { "modifier_data": { diff --git a/doc/models/catalog-object.md b/doc/models/catalog-object.md index 6d723885..0199cc95 100644 --- a/doc/models/catalog-object.md +++ b/doc/models/catalog-object.md @@ -55,19 +55,6 @@ For a more detailed discussion of the Catalog data model, please see the { "type": "TAX", "id": "id4", - "item_data": { - "object": { - "id": "#Cocoa", - "item_data": { - "abbreviation": "Ch", - "description": "Hot chocolate", - "name": "Cocoa", - "visibility": "PRIVATE" - }, - "present_at_all_locations": true, - "type": "ITEM" - } - }, "category_data": { "object": { "category_data": { @@ -107,51 +94,6 @@ For a more detailed discussion of the Catalog data model, please see the "type": "DISCOUNT" } }, - "modifier_list_data": { - "id": "#MilkType", - "modifier_list_data": { - "allow_quantities": false, - "modifiers": [ - { - "modifier_data": { - "name": "Whole Milk", - "price_money": { - "amount": 0, - "currency": "USD" - } - }, - "present_at_all_locations": true, - "type": "MODIFIER" - }, - { - "modifier_data": { - "name": "Almond Milk", - "price_money": { - "amount": 250, - "currency": "USD" - } - }, - "present_at_all_locations": true, - "type": "MODIFIER" - }, - { - "modifier_data": { - "name": "Soy Milk", - "price_money": { - "amount": 250, - "currency": "USD" - } - }, - "present_at_all_locations": true, - "type": "MODIFIER" - } - ], - "name": "Milk Type", - "selection_type": "SINGLE" - }, - "present_at_all_locations": true, - "type": "MODIFIER_LIST" - }, "modifier_data": { "object": { "modifier_data": { diff --git a/doc/models/change-billing-anchor-date-response.md b/doc/models/change-billing-anchor-date-response.md index bd66dc95..50bbf05a 100644 --- a/doc/models/change-billing-anchor-date-response.md +++ b/doc/models/change-billing-anchor-date-response.md @@ -20,33 +20,12 @@ Defines output parameters in a request to the ```json { - "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" - } - ], - "subscription": { - "id": "id4", - "location_id": "location_id8", - "plan_variation_id": "plan_variation_id8", - "customer_id": "customer_id2", - "start_date": "start_date8" - }, "actions": [ { - "id": "id8", - "type": "RESUME", - "effective_date": "effective_date8", - "monthly_billing_anchor_date": 186, + "effective_date": "2023-11-01", + "id": "f0a1dfdc-675b-3a14-a640-99f7ac1cee83", + "monthly_billing_anchor_date": 1, + "type": "CHANGE_BILLING_ANCHOR_DATE", "phases": [ { "uid": "uid0", @@ -68,6 +47,47 @@ Defines output parameters in a request to the } ] } + ], + "subscription": { + "created_at": "2023-06-20T21:53:10Z", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "id": "9ba40961-995a-4a3d-8c53-048c40cafc13", + "location_id": "S8GWD5R9QB376", + "monthly_billing_anchor_date": 20, + "phases": [ + { + "order_template_id": "E6oBY5WfQ2eN4pkYZwq4ka6n7KeZY", + "ordinal": 0, + "plan_phase_uid": "C66BKH3ASTDYGJJCEZXQQSS7", + "uid": "98d6f53b-40e1-4714-8827-032fd923be25" + } + ], + "plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7", + "price_override_money": { + "amount": 2000, + "currency": "USD" + }, + "source": { + "name": "My Application" + }, + "status": "ACTIVE", + "timezone": "America/Los_Angeles", + "version": 3, + "start_date": "start_date8" + }, + "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" + } ] } ``` diff --git a/doc/models/create-shift-request.md b/doc/models/create-shift-request.md index c30e6660..bb243c73 100644 --- a/doc/models/create-shift-request.md +++ b/doc/models/create-shift-request.md @@ -30,6 +30,10 @@ Represents a request to create a `Shift`. "start_at": "2019-01-25T06:11:00-05:00" } ], + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, "end_at": "2019-01-25T13:11:00-05:00", "location_id": "PAA1RJZZKXBFG", "start_at": "2019-01-25T03:11:00-05:00", @@ -39,7 +43,9 @@ Represents a request to create a `Shift`. "amount": 1100, "currency": "USD" }, - "title": "Barista" + "tip_eligible": true, + "title": "Barista", + "job_id": "job_id0" }, "id": "id4", "employee_id": "employee_id4", diff --git a/doc/models/create-shift-response.md b/doc/models/create-shift-response.md index d7d190f9..70a94d3f 100644 --- a/doc/models/create-shift-response.md +++ b/doc/models/create-shift-response.md @@ -33,6 +33,10 @@ the request resulted in errors. } ], "created_at": "2019-02-28T00:39:02Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, "employee_id": "ormj0jJJZ5OZIzxrZYJI", "end_at": "2019-01-25T13:11:00-05:00", "id": "K0YH4CV5462JB", @@ -49,6 +53,7 @@ the request resulted in errors. "currency": "USD" }, "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "tip_eligible": true, "title": "Barista" } }, diff --git a/doc/models/get-shift-response.md b/doc/models/get-shift-response.md index 3652f890..b76b9412 100644 --- a/doc/models/get-shift-response.md +++ b/doc/models/get-shift-response.md @@ -33,6 +33,10 @@ the request resulted in errors. } ], "created_at": "2019-02-27T00:12:12Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, "employee_id": "D71KRMQof6cXGUW0aAv7", "end_at": "2019-02-23T21:00:00-05:00", "id": "T35HMQSN89SV4", @@ -49,6 +53,7 @@ the request resulted in errors. "currency": "USD" }, "job_id": "N4YKVLzFj3oGtNocqoYHYpW3", + "tip_eligible": true, "title": "Cashier" } }, diff --git a/doc/models/get-team-member-wage-response.md b/doc/models/get-team-member-wage-response.md index cb676459..f275df8f 100644 --- a/doc/models/get-team-member-wage-response.md +++ b/doc/models/get-team-member-wage-response.md @@ -28,6 +28,7 @@ the request resulted in errors. "id": "pXS3qCv7BERPnEGedM4S8mhm", "job_id": "jxJNN6eCJsLrhg5UFJrDWDGE", "team_member_id": "33fJchumvVdJwxV0H6L9", + "tip_eligible": false, "title": "Manager" }, "errors": [ diff --git a/doc/models/list-team-member-wages-response.md b/doc/models/list-team-member-wages-response.md index 1772bf1f..af4fe62c 100644 --- a/doc/models/list-team-member-wages-response.md +++ b/doc/models/list-team-member-wages-response.md @@ -30,6 +30,7 @@ a set of `TeamMemberWage` objects. "id": "pXS3qCv7BERPnEGedM4S8mhm", "job_id": "jxJNN6eCJsLrhg5UFJrDWDGE", "team_member_id": "33fJchumvVdJwxV0H6L9", + "tip_eligible": false, "title": "Manager" }, { @@ -40,6 +41,7 @@ a set of `TeamMemberWage` objects. "id": "rZduCkzYDUVL3ovh1sQgbue6", "job_id": "gcbz15vKGnMKmaWJJ152kjim", "team_member_id": "33fJchumvVdJwxV0H6L9", + "tip_eligible": true, "title": "Cook" }, { @@ -50,6 +52,7 @@ a set of `TeamMemberWage` objects. "id": "FxLbs5KpPUHa8wyt5ctjubDX", "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", "team_member_id": "33fJchumvVdJwxV0H6L9", + "tip_eligible": true, "title": "Barista" }, { @@ -60,6 +63,7 @@ a set of `TeamMemberWage` objects. "id": "vD1wCgijMDR3cX5TPnu7VXto", "job_id": "N4YKVLzFj3oGtNocqoYHYpW3", "team_member_id": "33fJchumvVdJwxV0H6L9", + "tip_eligible": true, "title": "Cashier" } ], diff --git a/doc/models/obtain-token-response.md b/doc/models/obtain-token-response.md index 47c8def3..2864ff20 100644 --- a/doc/models/obtain-token-response.md +++ b/doc/models/obtain-token-response.md @@ -9,14 +9,14 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `accessToken` | `string \| undefined` | Optional | A valid OAuth access token. OAuth access tokens are 64 bytes long.
Provide the access token in a header with every request to Connect API
endpoints. For more information, see [OAuth API: Walkthrough](https://developer.squareup.com/docs/oauth-api/walkthrough).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | +| `accessToken` | `string \| undefined` | Optional | A valid OAuth access token.
Provide the access token in a header with every request to Connect API
endpoints. For more information, see [OAuth API: Walkthrough](https://developer.squareup.com/docs/oauth-api/walkthrough).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | | `tokenType` | `string \| undefined` | Optional | This value is always _bearer_.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10` | | `expiresAt` | `string \| undefined` | Optional | The date when the `access_token` expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format.
**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `48` | | `merchantId` | `string \| undefined` | Optional | The ID of the authorizing merchant's business.
**Constraints**: *Minimum Length*: `8`, *Maximum Length*: `191` | | `subscriptionId` | `string \| undefined` | Optional | __LEGACY FIELD__. The ID of a subscription plan the merchant signed up
for. The ID is only present if the merchant signed up for a subscription plan during authorization. | | `planId` | `string \| undefined` | Optional | __LEGACY FIELD__. The ID of the subscription plan the merchant signed
up for. The ID is only present if the merchant signed up for a subscription plan during
authorization. | | `idToken` | `string \| undefined` | Optional | The OpenID token belonging to this person. This token is only present if the
OPENID scope is included in the authorization request. | -| `refreshToken` | `string \| undefined` | Optional | A refresh token. OAuth refresh tokens are 64 bytes long.
For more information, see [Refresh, Revoke, and Limit the Scope of OAuth Tokens](https://developer.squareup.com/docs/oauth-api/refresh-revoke-limit-scope).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | +| `refreshToken` | `string \| undefined` | Optional | A refresh token.
For more information, see [Refresh, Revoke, and Limit the Scope of OAuth Tokens](https://developer.squareup.com/docs/oauth-api/refresh-revoke-limit-scope).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | | `shortLived` | `boolean \| undefined` | Optional | A Boolean indicating that the access token is a short-lived access token.
The short-lived access token returned in the response expires in 24 hours. | | `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | | `refreshTokenExpiresAt` | `string \| undefined` | Optional | The date when the `refresh_token` expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format.
**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `48` | diff --git a/doc/models/search-shifts-response.md b/doc/models/search-shifts-response.md index 401093fe..f81ddcb5 100644 --- a/doc/models/search-shifts-response.md +++ b/doc/models/search-shifts-response.md @@ -35,6 +35,10 @@ the request resulted in errors. } ], "created_at": "2019-01-24T01:12:03Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, "employee_id": "ormj0jJJZ5OZIzxrZYJI", "end_at": "2019-01-21T13:11:00-05:00", "id": "X714F3HA6D1PT", @@ -51,6 +55,7 @@ the request resulted in errors. "currency": "USD" }, "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "tip_eligible": true, "title": "Barista" } }, @@ -76,6 +81,10 @@ the request resulted in errors. } ], "created_at": "2019-01-23T23:32:45Z", + "declared_cash_tip_money": { + "amount": 0, + "currency": "USD" + }, "employee_id": "33fJchumvVdJwxV0H6L9", "end_at": "2019-01-22T13:02:00-05:00", "id": "GDHYBZYWK0P2V", @@ -92,6 +101,7 @@ the request resulted in errors. "currency": "USD" }, "job_id": "gcbz15vKGnMKmaWJJ152kjim", + "tip_eligible": true, "title": "Cook" } } diff --git a/doc/models/shift-wage.md b/doc/models/shift-wage.md index 698d13a8..74135407 100644 --- a/doc/models/shift-wage.md +++ b/doc/models/shift-wage.md @@ -14,6 +14,7 @@ The hourly wage rate used to compensate an employee for this shift. | `title` | `string \| null \| undefined` | Optional | The name of the job performed during this shift. | | `hourlyRate` | [`Money \| undefined`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | | `jobId` | `string \| undefined` | Optional | The id of the job performed during this shift. Square
labor-reporting UIs might group shifts together by id. This cannot be used to retrieve the job. | +| `tipEligible` | `boolean \| null \| undefined` | Optional | Whether team members are eligible for tips when working this job. | ## Example (as JSON) @@ -24,7 +25,8 @@ The hourly wage rate used to compensate an employee for this shift. "amount": 172, "currency": "OMR" }, - "job_id": "job_id2" + "job_id": "job_id2", + "tip_eligible": false } ``` diff --git a/doc/models/shift.md b/doc/models/shift.md index acbd1304..6d903a79 100644 --- a/doc/models/shift.md +++ b/doc/models/shift.md @@ -15,7 +15,7 @@ taken during the shift. | --- | --- | --- | --- | | `id` | `string \| undefined` | Optional | The UUID for this object.
**Constraints**: *Maximum Length*: `255` | | `employeeId` | `string \| null \| undefined` | Optional | The ID of the employee this shift belongs to. DEPRECATED at version 2020-08-26. Use `team_member_id` instead. | -| `locationId` | `string \| null \| undefined` | Optional | The ID of the location this shift occurred at. The location should be based on
where the employee clocked in. | +| `locationId` | `string` | Required | The ID of the location this shift occurred at. The location should be based on
where the employee clocked in.
**Constraints**: *Minimum Length*: `1` | | `timezone` | `string \| null \| undefined` | Optional | The read-only convenience value that is calculated from the location based
on the `location_id`. Format: the IANA timezone database identifier for the
location timezone. | | `startAt` | `string` | Required | RFC 3339; shifted to the location timezone + offset. Precision up to the
minute is respected; seconds are truncated.
**Constraints**: *Minimum Length*: `1` | | `endAt` | `string \| null \| undefined` | Optional | RFC 3339; shifted to the timezone + offset. Precision up to the minute is
respected; seconds are truncated. | @@ -26,6 +26,7 @@ taken during the shift. | `createdAt` | `string \| undefined` | Optional | A read-only timestamp in RFC 3339 format; presented in UTC. | | `updatedAt` | `string \| undefined` | Optional | A read-only timestamp in RFC 3339 format; presented in UTC. | | `teamMemberId` | `string \| null \| undefined` | Optional | The ID of the team member this shift belongs to. Replaced `employee_id` at version "2020-08-26". | +| `declaredCashTipMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | ## Example (as JSON) @@ -36,7 +37,16 @@ taken during the shift. "location_id": "location_id4", "timezone": "timezone0", "start_at": "start_at2", - "end_at": "end_at0" + "end_at": "end_at0", + "wage": { + "title": "title8", + "hourly_rate": { + "amount": 172, + "currency": "OMR" + }, + "job_id": "job_id0", + "tip_eligible": false + } } ``` diff --git a/doc/models/team-member-wage.md b/doc/models/team-member-wage.md index e5c27b3b..72314223 100644 --- a/doc/models/team-member-wage.md +++ b/doc/models/team-member-wage.md @@ -17,6 +17,7 @@ specified by the `title` property of this object. | `title` | `string \| null \| undefined` | Optional | The job title that this wage relates to. | | `hourlyRate` | [`Money \| undefined`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | | `jobId` | `string \| null \| undefined` | Optional | An identifier for the job that this wage relates to. This cannot be
used to retrieve the job. | +| `tipEligible` | `boolean \| null \| undefined` | Optional | Whether team members are eligible for tips when working this job. | ## Example (as JSON) diff --git a/doc/models/update-shift-request.md b/doc/models/update-shift-request.md index b997b7f6..ab1d3a41 100644 --- a/doc/models/update-shift-request.md +++ b/doc/models/update-shift-request.md @@ -29,6 +29,10 @@ A request to update a `Shift` object. "start_at": "2019-01-25T06:11:00-05:00" } ], + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, "end_at": "2019-01-25T13:11:00-05:00", "location_id": "PAA1RJZZKXBFG", "start_at": "2019-01-25T03:11:00-05:00", @@ -39,7 +43,9 @@ A request to update a `Shift` object. "amount": 1500, "currency": "USD" }, - "title": "Bartender" + "tip_eligible": true, + "title": "Bartender", + "job_id": "job_id0" }, "id": "id4", "employee_id": "employee_id4", diff --git a/doc/models/update-shift-response.md b/doc/models/update-shift-response.md index 2110a601..f15d3e8c 100644 --- a/doc/models/update-shift-response.md +++ b/doc/models/update-shift-response.md @@ -33,6 +33,10 @@ the request resulted in errors. } ], "created_at": "2019-02-28T00:39:02Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, "employee_id": "ormj0jJJZ5OZIzxrZYJI", "end_at": "2019-01-25T13:11:00-05:00", "id": "K0YH4CV5462JB", @@ -49,6 +53,7 @@ the request resulted in errors. "currency": "USD" }, "job_id": "dZtrPh5GSDGugyXGByesVp51", + "tip_eligible": true, "title": "Bartender" } }, diff --git a/package.json b/package.json index f5411ae2..da01a6c2 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "33.0.0", "license": "MIT", "sideEffects": false, "main": "dist/cjs/index.js", diff --git a/src/client.ts b/src/client.ts index 44be2e2b..d0424cce 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 = '32.0.0'; +export const SDK_VERSION = '33.0.0'; export class Client implements ClientInterface { private _config: Readonly; private _timeout: number; @@ -131,7 +131,7 @@ export class Client implements ClientInterface { ? this._config.httpClientOptions.timeout : this._config.timeout; this._userAgent = updateUserAgent( - 'Square-TypeScript-SDK/32.0.0 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}', + 'Square-TypeScript-SDK/33.0.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 c30efba2..373bab93 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: '2023-10-18', + squareVersion: '2023-11-15', additionalHeaders: {}, userAgentDetail: '', environment: Environment.Production, diff --git a/src/models/obtainTokenResponse.ts b/src/models/obtainTokenResponse.ts index 73703afd..b48874ec 100644 --- a/src/models/obtainTokenResponse.ts +++ b/src/models/obtainTokenResponse.ts @@ -11,7 +11,7 @@ import { Error, errorSchema } from './error'; export interface ObtainTokenResponse { /** - * A valid OAuth access token. OAuth access tokens are 64 bytes long. + * A valid OAuth access token. * Provide the access token in a header with every request to Connect API * endpoints. For more information, see [OAuth API: Walkthrough](https://developer.squareup.com/docs/oauth-api/walkthrough). */ @@ -39,7 +39,7 @@ export interface ObtainTokenResponse { */ idToken?: string; /** - * A refresh token. OAuth refresh tokens are 64 bytes long. + * A refresh token. * For more information, see [Refresh, Revoke, and Limit the Scope of OAuth Tokens](https://developer.squareup.com/docs/oauth-api/refresh-revoke-limit-scope). */ refreshToken?: string; diff --git a/src/models/shift.ts b/src/models/shift.ts index 512626c9..975db997 100644 --- a/src/models/shift.ts +++ b/src/models/shift.ts @@ -9,6 +9,7 @@ import { string, } from '../schema'; import { Break, breakSchema } from './break'; +import { Money, moneySchema } from './money'; import { ShiftWage, shiftWageSchema } from './shiftWage'; /** @@ -25,7 +26,7 @@ export interface Shift { * The ID of the location this shift occurred at. The location should be based on * where the employee clocked in. */ - locationId?: string | null; + locationId: string; /** * The read-only convenience value that is calculated from the location based * on the `location_id`. Format: the IANA timezone database identifier for the @@ -61,12 +62,21 @@ export interface Shift { updatedAt?: string; /** The ID of the team member this shift belongs to. Replaced `employee_id` at version "2020-08-26". */ teamMemberId?: string | null; + /** + * Represents an amount of money. `Money` fields can be signed or unsigned. + * Fields that do not explicitly define whether they are signed or unsigned are + * considered unsigned and can only hold positive amounts. For signed fields, the + * sign of the value indicates the purpose of the money transfer. See + * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts) + * for more information. + */ + declaredCashTipMoney?: Money; } export const shiftSchema: Schema = object({ id: ['id', optional(string())], employeeId: ['employee_id', optional(nullable(string()))], - locationId: ['location_id', optional(nullable(string()))], + locationId: ['location_id', string()], timezone: ['timezone', optional(nullable(string()))], startAt: ['start_at', string()], endAt: ['end_at', optional(nullable(string()))], @@ -77,4 +87,8 @@ export const shiftSchema: Schema = object({ createdAt: ['created_at', optional(string())], updatedAt: ['updated_at', optional(string())], teamMemberId: ['team_member_id', optional(nullable(string()))], + declaredCashTipMoney: [ + 'declared_cash_tip_money', + optional(lazy(() => moneySchema)), + ], }); diff --git a/src/models/shiftWage.ts b/src/models/shiftWage.ts index cea3b973..83ef0752 100644 --- a/src/models/shiftWage.ts +++ b/src/models/shiftWage.ts @@ -1,4 +1,12 @@ -import { lazy, nullable, object, optional, Schema, string } from '../schema'; +import { + boolean, + lazy, + nullable, + object, + optional, + Schema, + string, +} from '../schema'; import { Money, moneySchema } from './money'; /** The hourly wage rate used to compensate an employee for this shift. */ @@ -19,10 +27,13 @@ export interface ShiftWage { * labor-reporting UIs might group shifts together by id. This cannot be used to retrieve the job. */ jobId?: string; + /** Whether team members are eligible for tips when working this job. */ + tipEligible?: boolean | null; } export const shiftWageSchema: Schema = object({ title: ['title', optional(nullable(string()))], hourlyRate: ['hourly_rate', optional(lazy(() => moneySchema))], jobId: ['job_id', optional(string())], + tipEligible: ['tip_eligible', optional(nullable(boolean()))], }); diff --git a/src/models/teamMemberWage.ts b/src/models/teamMemberWage.ts index 0b9093fb..26ff0339 100644 --- a/src/models/teamMemberWage.ts +++ b/src/models/teamMemberWage.ts @@ -1,4 +1,12 @@ -import { lazy, nullable, object, optional, Schema, string } from '../schema'; +import { + boolean, + lazy, + nullable, + object, + optional, + Schema, + string, +} from '../schema'; import { Money, moneySchema } from './money'; /** @@ -26,6 +34,8 @@ export interface TeamMemberWage { * used to retrieve the job. */ jobId?: string | null; + /** Whether team members are eligible for tips when working this job. */ + tipEligible?: boolean | null; } export const teamMemberWageSchema: Schema = object({ @@ -34,4 +44,5 @@ export const teamMemberWageSchema: Schema = object({ title: ['title', optional(nullable(string()))], hourlyRate: ['hourly_rate', optional(lazy(() => moneySchema))], jobId: ['job_id', optional(nullable(string()))], + tipEligible: ['tip_eligible', optional(nullable(boolean()))], });