Skip to content

Commit

Permalink
Merge pull request #147 from square/release/37.0.0
Browse files Browse the repository at this point in the history
Generated PR for Release: 37.0.0
  • Loading branch information
jessemartin authored May 14, 2024
2 parents b7b5c59 + 3664543 commit f00152c
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 14 deletions.
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*: `'2024-04-17'` |
| `squareVersion` | `string` | Square Connect API versions<br>*Default*: `'2024-05-15'` |
| `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 @@ -43,7 +43,7 @@ const client = new Client({
bearerAuthCredentials: {
accessToken: 'AccessToken'
},
squareVersion: '2024-04-17',
squareVersion: '2024-05-15',
timeout: 60000,
additionalHeaders: {},
userAgentDetail: '',
Expand All @@ -60,7 +60,7 @@ const client = new Client({
bearerAuthCredentials: {
accessToken: 'AccessToken'
},
squareVersion: '2024-04-17',
squareVersion: '2024-05-15',
timeout: 60000,
additionalHeaders: {},
userAgentDetail: '',
Expand Down
3 changes: 2 additions & 1 deletion doc/models/catalog-item.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ A [CatalogObject](../../doc/models/catalog-object.md) instance of the `ITEM` typ
| `description` | `string \| null \| 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](entity:CatalogItem) 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 \| null \| 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 \| null \| 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. |
| `isTaxable` | `boolean \| null \| undefined` | Optional | Indicates whether the item is taxable (`true`) or non-taxable (`false`). Default is `true`. |
| `availableOnline` | `boolean \| null \| undefined` | Optional | If `true`, the item can be added to shipping orders from the merchant's online store. |
| `availableForPickup` | `boolean \| null \| undefined` | Optional | If `true`, the item can be added to pickup orders from the merchant's online store. |
| `availableElectronically` | `boolean \| null \| undefined` | Optional | If `true`, the item can be added to electronically fulfilled orders from the merchant's online store. |
Expand Down Expand Up @@ -44,7 +45,7 @@ A [CatalogObject](../../doc/models/catalog-object.md) instance of the `ITEM` typ
"description": "description6",
"abbreviation": "abbreviation8",
"label_color": "label_color8",
"available_online": false
"is_taxable": false
}
```

4 changes: 3 additions & 1 deletion doc/models/destination-details-card-refund-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
| --- | --- | --- | --- |
| `card` | [`Card \| undefined`](../../doc/models/card.md) | Optional | Represents the payment details of a card to be used for payments. These<br>details are determined by the payment token generated by Web Payments SDK. |
| `entryMethod` | `string \| null \| undefined` | Optional | The method used to enter the card's details for the refund. The method can be<br>`KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`.<br>**Constraints**: *Maximum Length*: `50` |
| `authResultCode` | `string \| null \| undefined` | Optional | The authorization code provided by the issuer when a refund is approved.<br>**Constraints**: *Maximum Length*: `10` |

## Example (as JSON)

Expand All @@ -23,7 +24,8 @@
"exp_month": 228,
"exp_year": 68
},
"entry_method": "entry_method4"
"entry_method": "entry_method4",
"auth_result_code": "auth_result_code6"
}
```

3 changes: 2 additions & 1 deletion doc/models/destination-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Details about a refund's destination.
"exp_month": 228,
"exp_year": 68
},
"entry_method": "entry_method8"
"entry_method": "entry_method8",
"auth_result_code": "auth_result_code0"
}
}
```
Expand Down
3 changes: 2 additions & 1 deletion doc/models/get-payment-refund-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ present or it might be present in a FAILED state.
"exp_month": 228,
"exp_year": 68
},
"entry_method": "entry_method8"
"entry_method": "entry_method8",
"auth_result_code": "auth_result_code0"
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion doc/models/list-payment-refunds-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ Either `errors` or `refunds` is present in a given response (never both).
"exp_month": 228,
"exp_year": 68
},
"entry_method": "entry_method8"
"entry_method": "entry_method8",
"auth_result_code": "auth_result_code0"
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion doc/models/payment-refund.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ the original payment and the amount of money refunded.
"exp_month": 228,
"exp_year": 68
},
"entry_method": "entry_method8"
"entry_method": "entry_method8",
"auth_result_code": "auth_result_code0"
}
},
"amount_money": {
Expand Down
1 change: 1 addition & 0 deletions doc/models/payment.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Represents a payment processed by the Square API.
| `receiptUrl` | `string \| undefined` | Optional | The URL for the payment's receipt.<br>The field is only populated for COMPLETED payments.<br>**Constraints**: *Maximum Length*: `255` |
| `deviceDetails` | [`DeviceDetails \| undefined`](../../doc/models/device-details.md) | Optional | Details about the device that took the payment. |
| `applicationDetails` | [`ApplicationDetails \| undefined`](../../doc/models/application-details.md) | Optional | Details about the application that took the payment. |
| `isOfflinePayment` | `boolean \| undefined` | Optional | Whether or not this payment was taken offline. |
| `versionToken` | `string \| null \| undefined` | Optional | Used for optimistic concurrency. This opaque token identifies a specific version of the<br>`Payment` object. |

## Example (as JSON)
Expand Down
3 changes: 2 additions & 1 deletion doc/models/refund-payment-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ present, or it might be present with a status of `FAILED`.
"exp_month": 228,
"exp_year": 68
},
"entry_method": "entry_method8"
"entry_method": "entry_method8",
"auth_result_code": "auth_result_code0"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "36.0.0",
"version": "37.0.0",
"license": "MIT",
"sideEffects": false,
"main": "dist/cjs/index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ import {
import { HttpClient } from './clientAdapter';

/** Current SDK version */
export const SDK_VERSION = '36.0.0';
export const SDK_VERSION = '37.0.0';
export class Client implements ClientInterface {
private _config: Readonly<Configuration>;
private _timeout: number;
Expand Down Expand Up @@ -138,7 +138,7 @@ export class Client implements ClientInterface {
}

this._userAgent = updateUserAgent(
'Square-TypeScript-SDK/36.0.0 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}',
'Square-TypeScript-SDK/37.0.0 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}',
this._config.squareVersion,
this._config.userAgentDetail
);
Expand Down
2 changes: 1 addition & 1 deletion src/defaultConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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-04-17',
squareVersion: '2024-05-15',
additionalHeaders: {},
userAgentDetail: '',
environment: Environment.Production,
Expand Down
3 changes: 3 additions & 0 deletions src/models/catalogItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export interface CatalogItem {
abbreviation?: string | null;
/** The color of the item's display label in the Square Point of Sale app. This must be a valid hex color code. */
labelColor?: string | null;
/** Indicates whether the item is taxable (`true`) or non-taxable (`false`). Default is `true`. */
isTaxable?: boolean | null;
/** If `true`, the item can be added to shipping orders from the merchant's online store. */
availableOnline?: boolean | null;
/** If `true`, the item can be added to pickup orders from the merchant's online store. */
Expand Down Expand Up @@ -154,6 +156,7 @@ export const catalogItemSchema: Schema<CatalogItem> = object({
description: ['description', optional(nullable(string()))],
abbreviation: ['abbreviation', optional(nullable(string()))],
labelColor: ['label_color', optional(nullable(string()))],
isTaxable: ['is_taxable', optional(nullable(boolean()))],
availableOnline: ['available_online', optional(nullable(boolean()))],
availableForPickup: ['available_for_pickup', optional(nullable(boolean()))],
availableElectronically: [
Expand Down
3 changes: 3 additions & 0 deletions src/models/destinationDetailsCardRefundDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ export interface DestinationDetailsCardRefundDetails {
* `KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`.
*/
entryMethod?: string | null;
/** The authorization code provided by the issuer when a refund is approved. */
authResultCode?: string | null;
}

export const destinationDetailsCardRefundDetailsSchema: Schema<DestinationDetailsCardRefundDetails> = object(
{
card: ['card', optional(lazy(() => cardSchema))],
entryMethod: ['entry_method', optional(nullable(string()))],
authResultCode: ['auth_result_code', optional(nullable(string()))],
}
);
4 changes: 4 additions & 0 deletions src/models/payment.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
array,
boolean,
lazy,
nullable,
object,
Expand Down Expand Up @@ -252,6 +253,8 @@ export interface Payment {
deviceDetails?: DeviceDetails;
/** Details about the application that took the payment. */
applicationDetails?: ApplicationDetails;
/** Whether or not this payment was taken offline. */
isOfflinePayment?: boolean;
/**
* Used for optimistic concurrency. This opaque token identifies a specific version of the
* `Payment` object.
Expand Down Expand Up @@ -327,5 +330,6 @@ export const paymentSchema: Schema<Payment> = object({
'application_details',
optional(lazy(() => applicationDetailsSchema)),
],
isOfflinePayment: ['is_offline_payment', optional(boolean())],
versionToken: ['version_token', optional(nullable(string()))],
});

0 comments on commit f00152c

Please sign in to comment.