Skip to content

Commit 6062d3a

Browse files
authored
Merge pull request #99 from square/release/20.1.0
Generated PR for Release: 20.1.0
2 parents 4f94247 + b462d49 commit 6062d3a

File tree

6 files changed

+28
-3
lines changed

6 files changed

+28
-3
lines changed

doc/models/obtain-token-request.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
| `migrationToken` | `string \| undefined` | Optional | A legacy OAuth access token obtained using a Connect API version prior<br>to 2019-03-13. This parameter is required if `grant_type` is set to<br>`migration_token` to indicate that the application wants to get a replacement<br>OAuth access token. The response also returns a refresh token.<br>For more information, see [Migrate to Using Refresh Tokens](https://developer.squareup.com/docs/oauth-api/migrate-to-refresh-tokens).<br>**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` |
1919
| `scopes` | `string[] \| undefined` | Optional | A JSON list of strings representing the permissions that the application is requesting.<br>For example, "`["MERCHANT_PROFILE_READ","PAYMENTS_READ","BANK_ACCOUNTS_READ"]`".<br><br>The access token returned in the response is granted the permissions<br>that comprise the intersection between the requested list of permissions and those<br>that belong to the provided refresh token. |
2020
| `shortLived` | `boolean \| undefined` | Optional | A Boolean indicating a request for a short-lived access token.<br><br>The short-lived access token returned in the response expires in 24 hours. |
21+
| `codeVerifier` | `string \| undefined` | Optional | Must be provided when using PKCE OAuth flow. The `code_verifier` will be used to verify against the<br>`code_challenge` associated with the `authorization_code`. |
2122

2223
## Example (as JSON)
2324

doc/models/obtain-token-response.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
| `refreshToken` | `string \| undefined` | Optional | A refresh token. OAuth refresh tokens are 64 bytes long.<br>For more information, see [Refresh, Revoke, and Limit the Scope of OAuth Tokens](https://developer.squareup.com/docs/oauth-api/refresh-revoke-limit-scope).<br>**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` |
2020
| `shortLived` | `boolean \| undefined` | Optional | A Boolean indicating that the access token is a short-lived access token.<br>The short-lived access token returned in the response expires in 24 hours. |
2121
| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. |
22+
| `refreshTokenExpiresAt` | `string \| undefined` | Optional | The date when the `refresh_token` expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format.<br>**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `48` |
23+
| `appSubscriptionId` | `string \| undefined` | Optional | The subscription id of a v2 subscription the merchant signed up<br>for. The subscription id is only present if the merchant signed up for a subscription during authorization. |
24+
| `appPlanId` | `string \| undefined` | Optional | The plan id of a v2 subscription plan the merchant signed up<br>for. The plan id is only present if the merchant signed up for a subscription plan during authorization. |
2225

2326
## Example (as JSON)
2427

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "20.0.0",
2+
"version": "20.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
@@ -63,7 +63,7 @@ import {
6363
import { XmlSerialization } from './http/xmlSerialization';
6464

6565
/** Current SDK version */
66-
export const SDK_VERSION = '20.0.0';
66+
export const SDK_VERSION = '20.1.0';
6767
export class Client implements ClientInterface {
6868
private _config: Readonly<Configuration>;
6969
private _timeout: number;
@@ -122,7 +122,7 @@ export class Client implements ClientInterface {
122122
? this._config.httpClientOptions.timeout
123123
: this._config.timeout;
124124
this._userAgent = updateUserAgent(
125-
'Square-TypeScript-SDK/20.0.0 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}',
125+
'Square-TypeScript-SDK/20.1.0 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}',
126126
this._config.squareVersion,
127127
this._config.userAgentDetail
128128
);

src/models/obtainTokenRequest.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ export interface ObtainTokenRequest {
5151
* The short-lived access token returned in the response expires in 24 hours.
5252
*/
5353
shortLived?: boolean;
54+
/**
55+
* Must be provided when using PKCE OAuth flow. The `code_verifier` will be used to verify against the
56+
* `code_challenge` associated with the `authorization_code`.
57+
*/
58+
codeVerifier?: string;
5459
}
5560

5661
export const obtainTokenRequestSchema: Schema<ObtainTokenRequest> = object({
@@ -63,4 +68,5 @@ export const obtainTokenRequestSchema: Schema<ObtainTokenRequest> = object({
6368
migrationToken: ['migration_token', optional(string())],
6469
scopes: ['scopes', optional(array(string()))],
6570
shortLived: ['short_lived', optional(boolean())],
71+
codeVerifier: ['code_verifier', optional(string())],
6672
});

src/models/obtainTokenResponse.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ export interface ObtainTokenResponse {
5050
shortLived?: boolean;
5151
/** Any errors that occurred during the request. */
5252
errors?: Error[];
53+
/** The date when the `refresh_token` expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format. */
54+
refreshTokenExpiresAt?: string;
55+
/**
56+
* The subscription id of a v2 subscription the merchant signed up
57+
* for. The subscription id is only present if the merchant signed up for a subscription during authorization.
58+
*/
59+
appSubscriptionId?: string;
60+
/**
61+
* The plan id of a v2 subscription plan the merchant signed up
62+
* for. The plan id is only present if the merchant signed up for a subscription plan during authorization.
63+
*/
64+
appPlanId?: string;
5365
}
5466

5567
export const obtainTokenResponseSchema: Schema<ObtainTokenResponse> = object({
@@ -63,4 +75,7 @@ export const obtainTokenResponseSchema: Schema<ObtainTokenResponse> = object({
6375
refreshToken: ['refresh_token', optional(string())],
6476
shortLived: ['short_lived', optional(boolean())],
6577
errors: ['errors', optional(array(lazy(() => errorSchema)))],
78+
refreshTokenExpiresAt: ['refresh_token_expires_at', optional(string())],
79+
appSubscriptionId: ['app_subscription_id', optional(string())],
80+
appPlanId: ['app_plan_id', optional(string())],
6681
});

0 commit comments

Comments
 (0)