Skip to content

Commit

Permalink
Merge pull request #97 from square/release/20.0.0
Browse files Browse the repository at this point in the history
Generated PR for Release: 20.0.0
  • Loading branch information
Wolfgang Schuster committed Jul 20, 2022
2 parents ce8f8fd + df29fb6 commit 4f94247
Show file tree
Hide file tree
Showing 59 changed files with 197 additions and 178 deletions.
10 changes: 5 additions & 5 deletions doc/api/catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ bodybatches0objects0ItemDataVariations[0] = bodybatches0objects0ItemDatavariatio

const bodybatches0objects0ItemData: CatalogItem = {};
bodybatches0objects0ItemData.name = 'Tea';
bodybatches0objects0ItemData.description = 'Hot Leaf Juice';
bodybatches0objects0ItemData.categoryId = '#Beverages';
bodybatches0objects0ItemData.taxIds = bodybatches0objects0ItemDataTaxIds;
bodybatches0objects0ItemData.variations = bodybatches0objects0ItemDataVariations;
bodybatches0objects0ItemData.descriptionHtml = '<p><strong>Hot</strong> Leaf Juice</p>';

const bodybatches0objects0: CatalogObject = {
type: 'ITEM',
Expand Down Expand Up @@ -232,10 +232,10 @@ bodybatches0objects1ItemDataVariations[1] = bodybatches0objects1ItemDatavariatio

const bodybatches0objects1ItemData: CatalogItem = {};
bodybatches0objects1ItemData.name = 'Coffee';
bodybatches0objects1ItemData.description = 'Hot Bean Juice';
bodybatches0objects1ItemData.categoryId = '#Beverages';
bodybatches0objects1ItemData.taxIds = bodybatches0objects1ItemDataTaxIds;
bodybatches0objects1ItemData.variations = bodybatches0objects1ItemDataVariations;
bodybatches0objects1ItemData.descriptionHtml = '<p>Hot <em>Bean Juice</em></p>';

const bodybatches0objects1: CatalogObject = {
type: 'ITEM',
Expand Down Expand Up @@ -320,7 +320,7 @@ async createCatalogImage(

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `request` | [`CreateCatalogImageRequest \| undefined`](../../doc/models/create-catalog-image-request.md) | Form, Optional | - |
| `request` | [`CreateCatalogImageRequest \| undefined`](../../doc/models/create-catalog-image-request.md) | Form (JSON-Encoded), Optional | - |
| `imageFile` | `FileWrapper \| undefined` | Form, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |

Expand Down Expand Up @@ -380,7 +380,7 @@ async updateCatalogImage(
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `imageId` | `string` | Template, Required | The ID of the `CatalogImage` object to update the encapsulated image file. |
| `request` | [`UpdateCatalogImageRequest \| undefined`](../../doc/models/update-catalog-image-request.md) | Form, Optional | - |
| `request` | [`UpdateCatalogImageRequest \| undefined`](../../doc/models/update-catalog-image-request.md) | Form (JSON-Encoded), Optional | - |
| `imageFile` | `FileWrapper \| undefined` | Form, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |

Expand Down Expand Up @@ -556,9 +556,9 @@ bodyObjectItemDataVariations[1] = bodyObjectItemDatavariations1;

const bodyObjectItemData: CatalogItem = {};
bodyObjectItemData.name = 'Cocoa';
bodyObjectItemData.description = 'Hot Chocolate';
bodyObjectItemData.abbreviation = 'Ch';
bodyObjectItemData.variations = bodyObjectItemDataVariations;
bodyObjectItemData.descriptionHtml = '<p><strong>Hot</strong> Chocolate</p>';

const bodyObject: CatalogObject = {
type: 'ITEM',
Expand Down
4 changes: 2 additions & 2 deletions doc/api/customers.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ bodyQueryFilterCreationSource.values = bodyQueryFilterCreationSourceValues;
bodyQueryFilterCreationSource.rule = 'INCLUDE';

const bodyQueryFilterCreatedAt: TimeRange = {};
bodyQueryFilterCreatedAt.startAt = '2018-01-01T00:00:00-00:00';
bodyQueryFilterCreatedAt.endAt = '2018-02-01T00:00:00-00:00';
bodyQueryFilterCreatedAt.startAt = '2018-01-01T00:00:00+00:00';
bodyQueryFilterCreatedAt.endAt = '2018-02-01T00:00:00+00:00';

const bodyQueryFilterEmailAddress: CustomerTextFilter = {};
bodyQueryFilterEmailAddress.fuzzy = 'example.com';
Expand Down
2 changes: 1 addition & 1 deletion doc/api/disputes.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ async createDisputeEvidenceFile(
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `disputeId` | `string` | Template, Required | The ID of the dispute you want to upload evidence for. |
| `request` | [`CreateDisputeEvidenceFileRequest \| undefined`](../../doc/models/create-dispute-evidence-file-request.md) | Form, Optional | Defines the parameters for a `CreateDisputeEvidenceFile` request. |
| `request` | [`CreateDisputeEvidenceFileRequest \| undefined`](../../doc/models/create-dispute-evidence-file-request.md) | Form (JSON-Encoded), Optional | Defines the parameters for a `CreateDisputeEvidenceFile` request. |
| `imageFile` | `FileWrapper \| undefined` | Form, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |

Expand Down
12 changes: 6 additions & 6 deletions doc/api/inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ body.catalogObjectIds = bodyCatalogObjectIds;
body.locationIds = bodyLocationIds;
body.types = bodyTypes;
body.states = bodyStates;
body.updatedAfter = '2016-11-01T00:00:00.000Z';
body.updatedBefore = '2016-12-01T00:00:00.000Z';
body.updatedAfter = '2016-11-01T00:00:00Z';
body.updatedBefore = '2016-12-01T00:00:00Z';

try {
const { result, ...httpResponse } = await inventoryApi.deprecatedBatchRetrieveInventoryChanges(body);
Expand Down Expand Up @@ -260,7 +260,7 @@ const bodyLocationIds: string[] = ['59TNP9SA8VGDA'];
const body: BatchRetrieveInventoryCountsRequest = {};
body.catalogObjectIds = bodyCatalogObjectIds;
body.locationIds = bodyLocationIds;
body.updatedAfter = '2016-11-16T00:00:00.000Z';
body.updatedAfter = '2016-11-16T00:00:00Z';

try {
const { result, ...httpResponse } = await inventoryApi.deprecatedBatchRetrieveInventoryCounts(body);
Expand Down Expand Up @@ -383,8 +383,8 @@ body.catalogObjectIds = bodyCatalogObjectIds;
body.locationIds = bodyLocationIds;
body.types = bodyTypes;
body.states = bodyStates;
body.updatedAfter = '2016-11-01T00:00:00.000Z';
body.updatedBefore = '2016-12-01T00:00:00.000Z';
body.updatedAfter = '2016-11-01T00:00:00Z';
body.updatedBefore = '2016-12-01T00:00:00Z';

try {
const { result, ...httpResponse } = await inventoryApi.batchRetrieveInventoryChanges(body);
Expand Down Expand Up @@ -440,7 +440,7 @@ const bodyLocationIds: string[] = ['59TNP9SA8VGDA'];
const body: BatchRetrieveInventoryCountsRequest = {};
body.catalogObjectIds = bodyCatalogObjectIds;
body.locationIds = bodyLocationIds;
body.updatedAfter = '2016-11-16T00:00:00.000Z';
body.updatedAfter = '2016-11-16T00:00:00Z';

try {
const { result, ...httpResponse } = await inventoryApi.batchRetrieveInventoryCounts(body);
Expand Down
33 changes: 25 additions & 8 deletions doc/api/labor.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,21 +408,21 @@ bodyShiftWage.hourlyRate = bodyShiftWageHourlyRate;
const bodyShiftBreaks: Break[] = [];

const bodyShiftbreaks0: Break = {
startAt: '2019-01-25T06:11:00-05:00',
startAt: '2019-01-25T11:11:00+00:00',
breakTypeId: 'REGS1EQR1TPZ5',
name: 'Tea Break',
expectedDuration: 'PT5M',
isPaid: true,
};
bodyShiftbreaks0.endAt = '2019-01-25T06:16:00-05:00';
bodyShiftbreaks0.endAt = '2019-01-25T11:16:00+00:00';

bodyShiftBreaks[0] = bodyShiftbreaks0;

const bodyShift: Shift = {
startAt: '2019-01-25T03:11:00-05:00',
startAt: '2019-01-25T08:11:00+00:00',
};
bodyShift.locationId = 'PAA1RJZZKXBFG';
bodyShift.endAt = '2019-01-25T13:11:00-05:00';
bodyShift.endAt = '2019-01-25T18:11:00+00:00';
bodyShift.wage = bodyShiftWage;
bodyShift.breaks = bodyShiftBreaks;
bodyShift.teamMemberId = 'ormj0jJJZ5OZIzxrZYJI';
Expand Down Expand Up @@ -486,7 +486,24 @@ async searchShifts(

```ts
const contentType = null;
const bodyQueryFilterWorkdayDateRange: DateRange = {};
bodyQueryFilterWorkdayDateRange.startDate = '2019-01-20';
bodyQueryFilterWorkdayDateRange.endDate = '2019-02-03';

const bodyQueryFilterWorkday: ShiftWorkday = {};
bodyQueryFilterWorkday.dateRange = bodyQueryFilterWorkdayDateRange;
bodyQueryFilterWorkday.matchShiftsBy = 'START_AT';
bodyQueryFilterWorkday.defaultTimezone = 'America/Los_Angeles';

const bodyQueryFilter: ShiftFilter = {};
bodyQueryFilter.workday = bodyQueryFilterWorkday;

const bodyQuery: ShiftQuery = {};
bodyQuery.filter = bodyQueryFilter;

const body: SearchShiftsRequest = {};
body.query = bodyQuery;
body.limit = 100;

try {
const { result, ...httpResponse } = await laborApi.searchShifts(body);
Expand Down Expand Up @@ -625,22 +642,22 @@ bodyShiftWage.hourlyRate = bodyShiftWageHourlyRate;
const bodyShiftBreaks: Break[] = [];

const bodyShiftbreaks0: Break = {
startAt: '2019-01-25T06:11:00-05:00',
startAt: '2019-01-25T11:11:00+00:00',
breakTypeId: 'REGS1EQR1TPZ5',
name: 'Tea Break',
expectedDuration: 'PT5M',
isPaid: true,
};
bodyShiftbreaks0.id = 'X7GAQYVVRRG6P';
bodyShiftbreaks0.endAt = '2019-01-25T06:16:00-05:00';
bodyShiftbreaks0.endAt = '2019-01-25T11:16:00+00:00';

bodyShiftBreaks[0] = bodyShiftbreaks0;

const bodyShift: Shift = {
startAt: '2019-01-25T03:11:00-05:00',
startAt: '2019-01-25T08:11:00+00:00',
};
bodyShift.locationId = 'PAA1RJZZKXBFG';
bodyShift.endAt = '2019-01-25T13:11:00-05:00';
bodyShift.endAt = '2019-01-25T18:11:00+00:00';
bodyShift.wage = bodyShiftWage;
bodyShift.breaks = bodyShiftBreaks;
bodyShift.version = 1;
Expand Down
2 changes: 1 addition & 1 deletion doc/api/orders.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ An `UpdateOrder` request requires the following:

- The `order_id` in the endpoint path, identifying the order to update.
- The latest `version` of the order to update.
- The [sparse order](https://developer.squareup.com/docs/orders-api/manage-orders#sparse-order-objects)
- The [sparse order](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#sparse-order-objects)
containing only the fields to update and the version to which the update is
being applied.
- If deleting fields, the [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders#on-dot-notation)
Expand Down
10 changes: 0 additions & 10 deletions doc/api/subscriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,7 @@ async updateSubscription(
```ts
const subscriptionId = 'subscription_id0';
const contentType = null;
const bodySubscriptionPriceOverrideMoney: Money = {};
bodySubscriptionPriceOverrideMoney.amount = 2000;
bodySubscriptionPriceOverrideMoney.currency = 'USD';

const bodySubscription: Subscription = {};
bodySubscription.taxPercentage = 'null';
bodySubscription.priceOverrideMoney = bodySubscriptionPriceOverrideMoney;
bodySubscription.version = 1594155459464;

const body: UpdateSubscriptionRequest = {};
body.subscription = bodySubscription;

try {
const { result, ...httpResponse } = await subscriptionsApi.updateSubscription(subscriptionId, body);
Expand Down
2 changes: 1 addition & 1 deletion doc/api/terminal.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async searchTerminalActions(
```ts
const contentType = null;
const bodyQueryFilterCreatedAt: TimeRange = {};
bodyQueryFilterCreatedAt.startAt = '2022-04-01T00:00:00.000Z';
bodyQueryFilterCreatedAt.startAt = '2022-04-01T00:00:00Z';

const bodyQueryFilter: TerminalActionQueryFilter = {};
bodyQueryFilter.createdAt = bodyQueryFilterCreatedAt;
Expand Down
6 changes: 3 additions & 3 deletions doc/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The following parameters are configurable for the API Client:

| Parameter | Type | Description |
| --- | --- | --- |
| `squareVersion` | `string` | Square Connect API versions<br>*Default*: `'2022-06-16'` |
| `squareVersion` | `string` | Square Connect API versions<br>*Default*: `'2022-07-20'` |
| `customUrl` | `string` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`<br>*Default*: `'https://connect.squareup.com'` |
| `environment` | `string` | The API environment. <br> **Default: `production`** |
| `additionalHeaders` | `Readonly<Record<string, string>>` | Additional headers to add to each API call<br>*Default*: `{}` |
Expand Down Expand Up @@ -40,7 +40,7 @@ The API client can be initialized as follows:

```ts
const client = new Client({
squareVersion: '2022-06-16',
squareVersion: '2022-07-20',
timeout: 60000,
additionalHeaders: {},
userAgentDetail: '',
Expand All @@ -56,7 +56,7 @@ import fs from 'fs';
import { ApiError, Client, FileWrapper, LocationsApi } from 'square';

const client = new Client({
squareVersion: '2022-06-16',
squareVersion: '2022-07-20',
timeout: 60000,
additionalHeaders: {},
userAgentDetail: '',
Expand Down
2 changes: 1 addition & 1 deletion doc/models/batch-retrieve-inventory-changes-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
| `updatedAfter` | `string \| undefined` | Optional | The filter to return results with their `calculated_at` value<br>after the given time as specified in an RFC 3339 timestamp.<br>The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). |
| `updatedBefore` | `string \| undefined` | Optional | The filter to return results with their `created_at` or `calculated_at` value<br>strictly before the given time as specified in an RFC 3339 timestamp.<br>The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). |
| `cursor` | `string \| undefined` | Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this to retrieve the next set of results for the original query.<br><br>See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. |
| `limit` | `number \| undefined` | Optional | **Constraints**: `>= 1`, `<= 1000` |
| `limit` | `number \| undefined` | Optional | The number of [records](../../doc/models/inventory-change.md) to return.<br>**Constraints**: `>= 1`, `<= 1000` |

## Example (as JSON)

Expand Down
2 changes: 1 addition & 1 deletion doc/models/batch-retrieve-inventory-counts-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
| `updatedAfter` | `string \| undefined` | Optional | The filter to return results with their `calculated_at` value<br>after the given time as specified in an RFC 3339 timestamp.<br>The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). |
| `cursor` | `string \| undefined` | Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this to retrieve the next set of results for the original query.<br><br>See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. |
| `states` | [`string[] \| undefined`](../../doc/models/inventory-state.md) | Optional | The filter to return results by `InventoryState`. The filter is only applicable when set.<br>Ignored are untracked states of `NONE`, `SOLD`, and `UNLINKED_RETURN`.<br>The default is null. |
| `limit` | `number \| undefined` | Optional | **Constraints**: `>= 1`, `<= 1000` |
| `limit` | `number \| undefined` | Optional | The number of [records](../../doc/models/inventory-count.md) to return.<br>**Constraints**: `>= 1`, `<= 1000` |

## Example (as JSON)

Expand Down
4 changes: 2 additions & 2 deletions doc/models/batch-upsert-catalog-objects-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"id": "#Tea",
"item_data": {
"category_id": "#Beverages",
"description": "Hot Leaf Juice",
"description_html": "<p><strong>Hot</strong> Leaf Juice</p>",
"name": "Tea",
"tax_ids": [
"#SalesTax"
Expand Down Expand Up @@ -52,7 +52,7 @@
"id": "#Coffee",
"item_data": {
"category_id": "#Beverages",
"description": "Hot Bean Juice",
"description_html": "<p>Hot <em>Bean Juice</em></p>",
"name": "Coffee",
"tax_ids": [
"#SalesTax"
Expand Down
4 changes: 4 additions & 0 deletions doc/models/batch-upsert-catalog-objects-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
"item_data": {
"category_id": "LYT72K3WGJFFCIMB63XARP3I",
"description": "Hot Leaf Juice",
"description_html": "<p><strong>Hot</strong> Leaf Juice</p>",
"description_plaintext": "Hot Leaf Juice",
"name": "Tea",
"tax_ids": [
"XHSHLHNWSI3HVI4BW5ZUZXI3"
Expand Down Expand Up @@ -91,6 +93,8 @@
"item_data": {
"category_id": "LYT72K3WGJFFCIMB63XARP3I",
"description": "Hot Bean Juice",
"description_html": "<p>Hot <em>Bean Juice</em></p>",
"description_plaintext": "Hot Bean Juice",
"name": "Coffee",
"tax_ids": [
"XHSHLHNWSI3HVI4BW5ZUZXI3"
Expand Down
4 changes: 3 additions & 1 deletion doc/models/catalog-item.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A [CatalogObject](../../doc/models/catalog-object.md) instance of the `ITEM` typ
| Name | Type | Tags | Description |
| --- | --- | --- | --- |
| `name` | `string \| undefined` | Optional | The item's name. This is a searchable attribute for use in applicable query filters, its value must not be empty, and the length is of Unicode code points.<br>**Constraints**: *Maximum Length*: `512` |
| `description` | `string \| undefined` | Optional | The item's description. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.<br>**Constraints**: *Maximum Length*: `4096` |
| `description` | `string \| undefined` | Optional | The item's description. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.<br><br>Deprecated at 2022-07-20, this field is planned to retire in 6 months. You should migrate to use `description_html` to set the description<br>of the [CatalogItem](../../doc/models/catalog-item.md) instance. The `description` and `description_html` field values are kept in sync. If you try to<br>set the both fields, the `description_html` text value overwrites the `description` value. Updates in one field are also reflected in the other,<br>except for when you use an early version before Square API 2022-07-20 and `description_html` is set to blank, setting the `description` value to null<br>does not nullify `description_html`.<br>**Constraints**: *Maximum Length*: `4096` |
| `abbreviation` | `string \| undefined` | Optional | The text of the item's display label in the Square Point of Sale app. Only up to the first five characters of the string are used.<br>This attribute is searchable, and its value length is of Unicode code points.<br>**Constraints**: *Maximum Length*: `24` |
| `labelColor` | `string \| undefined` | Optional | The color of the item's display label in the Square Point of Sale app. This must be a valid hex color code. |
| `availableOnline` | `boolean \| undefined` | Optional | If `true`, the item can be added to shipping orders from the merchant's online store. |
Expand All @@ -27,6 +27,8 @@ A [CatalogObject](../../doc/models/catalog-object.md) instance of the `ITEM` typ
| `itemOptions` | [`CatalogItemOptionForItem[] \| undefined`](../../doc/models/catalog-item-option-for-item.md) | Optional | List of item options IDs for this item. Used to manage and group item<br>variations in a specified order.<br><br>Maximum: 6 item options. |
| `imageIds` | `string[] \| undefined` | Optional | The IDs of images associated with this `CatalogItem` instance.<br>These images will be shown to customers in Square Online Store.<br>The first image will show up as the icon for this item in POS. |
| `sortName` | `string \| undefined` | Optional | A name to sort the item by. If this name is unspecified, namely, the `sort_name` field is absent, the regular `name` field is used for sorting.<br><br>It is currently supported for sellers of the Japanese locale only. |
| `descriptionHtml` | `string \| undefined` | Optional | The item's description as expressed in valid HTML elements. The length of this field value, including those of HTML tags,<br>is of Unicode points. With application query filters, the text values of the HTML elements and attributes are searchable. Invalid or<br>unsupported HTML elements or attributes are ignored.<br><br>Supported HTML elements include:<br><br>- `a`: Link. Supports linking to website URLs, email address, and telephone numbers.<br>- `b`, `strong`: Bold text<br>- `br`: Line break<br>- `code`: Computer code<br>- `div`: Section<br>- `h1-h6`: Headings<br>- `i`, `em`: Italics<br>- `li`: List element<br>- `ol`: Numbered list<br>- `p`: Paragraph<br>- `ul`: Bullet list<br>- `u`: Underline<br><br>Supported HTML attributes include:<br><br>- `align`: Alignment of the text content<br>- `href`: Link destination<br>- `rel`: Relationship between link's target and source<br>- `target`: Place to open the linked document<br>**Constraints**: *Maximum Length*: `65536` |
| `descriptionPlaintext` | `string \| undefined` | Optional | A server-generated plaintext version of the `description_html` field, without formatting tags.<br>**Constraints**: *Maximum Length*: `65536` |

## Example (as JSON)

Expand Down
Loading

0 comments on commit 4f94247

Please sign in to comment.