Skip to content

Commit e2ce966

Browse files
author
Xiao Hu
authored
Merge pull request #102 from square/release/21.1.0
Generated PR for Release: 21.1.0
2 parents d6f56ec + e2b016b commit e2ce966

File tree

9 files changed

+54
-10
lines changed

9 files changed

+54
-10
lines changed

doc/client.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The following parameters are configurable for the API Client:
55

66
| Parameter | Type | Description |
77
| --- | --- | --- |
8-
| `squareVersion` | `string` | Square Connect API versions<br>*Default*: `'2022-08-17'` |
8+
| `squareVersion` | `string` | Square Connect API versions<br>*Default*: `'2022-08-23'` |
99
| `customUrl` | `string` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`<br>*Default*: `'https://connect.squareup.com'` |
1010
| `environment` | `string` | The API environment. <br> **Default: `production`** |
1111
| `additionalHeaders` | `Readonly<Record<string, string>>` | Additional headers to add to each API call<br>*Default*: `{}` |
@@ -40,7 +40,7 @@ The API client can be initialized as follows:
4040

4141
```ts
4242
const client = new Client({
43-
squareVersion: '2022-08-17',
43+
squareVersion: '2022-08-23',
4444
timeout: 60000,
4545
additionalHeaders: {},
4646
userAgentDetail: '',
@@ -56,7 +56,7 @@ import fs from 'fs';
5656
import { ApiError, Client, FileWrapper, LocationsApi } from 'square';
5757

5858
const client = new Client({
59-
squareVersion: '2022-08-17',
59+
squareVersion: '2022-08-23',
6060
timeout: 60000,
6161
additionalHeaders: {},
6262
userAgentDetail: '',

doc/models/buy-now-pay-later-details.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ Additional details about a Buy Now Pay Later payment type.
1111

1212
| Name | Type | Tags | Description |
1313
| --- | --- | --- | --- |
14-
| `brand` | `string \| undefined` | Optional | The brand used for the Buy Now Pay Later payment.<br>The brand can be `AFTERPAY` or `UNKNOWN`.<br>**Constraints**: *Maximum Length*: `50` |
14+
| `brand` | `string \| undefined` | Optional | The brand used for the Buy Now Pay Later payment.<br>The brand can be `AFTERPAY`, `CLEARPAY` or `UNKNOWN`.<br>**Constraints**: *Maximum Length*: `50` |
1515
| `afterpayDetails` | [`AfterpayDetails \| undefined`](../../doc/models/afterpay-details.md) | Optional | Additional details about Afterpay payments. |
16+
| `clearpayDetails` | [`ClearpayDetails \| undefined`](../../doc/models/clearpay-details.md) | Optional | Additional details about Clearpay payments. |
1617

1718
## Example (as JSON)
1819

1920
```json
2021
{
2122
"brand": null,
22-
"afterpay_details": null
23+
"afterpay_details": null,
24+
"clearpay_details": null
2325
}
2426
```
2527

doc/models/clearpay-details.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
# Clearpay Details
3+
4+
Additional details about Clearpay payments.
5+
6+
## Structure
7+
8+
`ClearpayDetails`
9+
10+
## Fields
11+
12+
| Name | Type | Tags | Description |
13+
| --- | --- | --- | --- |
14+
| `emailAddress` | `string \| undefined` | Optional | Email address on the buyer's Clearpay account.<br>**Constraints**: *Maximum Length*: `255` |
15+
16+
## Example (as JSON)
17+
18+
```json
19+
{
20+
"email_address": null
21+
}
22+
```
23+

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "21.0.0",
2+
"version": "21.1.0",
33
"license": "MIT",
44
"sideEffects": false,
55
"main": "dist/index.js",

src/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ import {
6464
import { XmlSerialization } from './http/xmlSerialization';
6565

6666
/** Current SDK version */
67-
export const SDK_VERSION = '21.0.0';
67+
export const SDK_VERSION = '21.1.0';
6868
export class Client implements ClientInterface {
6969
private _config: Readonly<Configuration>;
7070
private _timeout: number;
@@ -124,7 +124,7 @@ export class Client implements ClientInterface {
124124
? this._config.httpClientOptions.timeout
125125
: this._config.timeout;
126126
this._userAgent = updateUserAgent(
127-
'Square-TypeScript-SDK/21.0.0 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}',
127+
'Square-TypeScript-SDK/21.1.0 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}',
128128
this._config.squareVersion,
129129
this._config.userAgentDetail
130130
);

src/defaultConfiguration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { RetryConfiguration } from './core';
44
/** Default values for the configuration parameters of the client. */
55
export const DEFAULT_CONFIGURATION: Configuration = {
66
timeout: 60000,
7-
squareVersion: '2022-08-17',
7+
squareVersion: '2022-08-23',
88
additionalHeaders: {},
99
userAgentDetail: '',
1010
environment: Environment.Production,

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ export { ChargeRequestAdditionalRecipient } from './models/chargeRequestAddition
178178
export { ChargeResponse } from './models/chargeResponse';
179179
export { Checkout } from './models/checkout';
180180
export { CheckoutOptions } from './models/checkoutOptions';
181+
export { ClearpayDetails } from './models/clearpayDetails';
181182
export { CloneOrderRequest } from './models/cloneOrderRequest';
182183
export { CloneOrderResponse } from './models/cloneOrderResponse';
183184
export { CompletePaymentRequest } from './models/completePaymentRequest';

src/models/buyNowPayLaterDetails.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
import { lazy, object, optional, Schema, string } from '../schema';
22
import { AfterpayDetails, afterpayDetailsSchema } from './afterpayDetails';
3+
import { ClearpayDetails, clearpayDetailsSchema } from './clearpayDetails';
34

45
/** Additional details about a Buy Now Pay Later payment type. */
56
export interface BuyNowPayLaterDetails {
67
/**
78
* The brand used for the Buy Now Pay Later payment.
8-
* The brand can be `AFTERPAY` or `UNKNOWN`.
9+
* The brand can be `AFTERPAY`, `CLEARPAY` or `UNKNOWN`.
910
*/
1011
brand?: string;
1112
/** Additional details about Afterpay payments. */
1213
afterpayDetails?: AfterpayDetails;
14+
/** Additional details about Clearpay payments. */
15+
clearpayDetails?: ClearpayDetails;
1316
}
1417

1518
export const buyNowPayLaterDetailsSchema: Schema<BuyNowPayLaterDetails> = object(
@@ -19,5 +22,9 @@ export const buyNowPayLaterDetailsSchema: Schema<BuyNowPayLaterDetails> = object
1922
'afterpay_details',
2023
optional(lazy(() => afterpayDetailsSchema)),
2124
],
25+
clearpayDetails: [
26+
'clearpay_details',
27+
optional(lazy(() => clearpayDetailsSchema)),
28+
],
2229
}
2330
);

src/models/clearpayDetails.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { object, optional, Schema, string } from '../schema';
2+
3+
/** Additional details about Clearpay payments. */
4+
export interface ClearpayDetails {
5+
/** Email address on the buyer's Clearpay account. */
6+
emailAddress?: string;
7+
}
8+
9+
export const clearpayDetailsSchema: Schema<ClearpayDetails> = object({
10+
emailAddress: ['email_address', optional(string())],
11+
});

0 commit comments

Comments
 (0)