From 52f4cbec3b36bbfd7c09f62cea640ee1c2fe5128 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 11 Jan 2024 01:13:35 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc 3.0.1, Speakeasy CLI 1.134.1 --- .speakeasy/gen.lock | 8 ++-- RELEASES.md | 12 ++++- .../components/getaccesstokenrequest.md | 16 +++---- .../components/getaccesstokenresponse.md | 18 ++++---- .../components/getaccesstokenresponsescope.md | 10 ----- docs/models/components/granttype.md | 5 +-- docs/models/components/refreshtokenscope.md | 10 ----- docs/sdks/oauth/README.md | 7 +-- gen.yaml | 2 +- package-lock.json | 4 +- package.json | 2 +- src/lib/config.ts | 4 +- .../components/getaccesstokenrequest.ts | 35 +++++++-------- .../components/getaccesstokenresponse.ts | 44 ++++++------------- 14 files changed, 72 insertions(+), 105 deletions(-) delete mode 100644 docs/models/components/getaccesstokenresponsescope.md delete mode 100644 docs/models/components/refreshtokenscope.md diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index f53b8ee..ceba631 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 79fa0df9-852a-493c-b998-1d82654b5f18 management: - docChecksum: 62753fde5be1f94d492210a95b671a45 + docChecksum: 6ed50c0a738674fc6881ca1e83500d6f docVersion: 3.0.1 speakeasyVersion: internal generationVersion: 2.230.3 - releaseVersion: 0.4.0 - configChecksum: d65c440b4991499653ecbe5ea753d142 + releaseVersion: 0.4.1 + configChecksum: e568a802b1b0da51419990f6313728eb repoURL: https://github.com/BoltApp/Bolt-Typescript-SDK.git repoSubDirectory: . installationURL: https://github.com/BoltApp/Bolt-Typescript-SDK @@ -137,8 +137,6 @@ generatedFiles: - docs/models/components/dottag.md - docs/models/components/paymentactionrequest.md - docs/models/components/paymentinitializerequest.md - - docs/models/components/refreshtokenscope.md - - docs/models/components/getaccesstokenresponsescope.md - docs/models/components/getaccesstokenresponse.md - docs/models/components/granttype.md - docs/models/components/scope.md diff --git a/RELEASES.md b/RELEASES.md index 14cbb7a..acf7776 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -78,4 +78,14 @@ Based on: ### Generated - [typescript v0.4.0] . ### Releases -- [NPM v0.4.0] https://www.npmjs.com/package/@boltpay/bolt-typescript-sdk/v/0.4.0 - . \ No newline at end of file +- [NPM v0.4.0] https://www.npmjs.com/package/@boltpay/bolt-typescript-sdk/v/0.4.0 - . + +## 2024-01-11 01:13:19 +### Changes +Based on: +- OpenAPI Doc 3.0.1 +- Speakeasy CLI 1.134.1 (2.230.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.4.1] . +### Releases +- [NPM v0.4.1] https://www.npmjs.com/package/@boltpay/bolt-typescript-sdk/v/0.4.1 - . \ No newline at end of file diff --git a/docs/models/components/getaccesstokenrequest.md b/docs/models/components/getaccesstokenrequest.md index 523f7c0..23a6a25 100644 --- a/docs/models/components/getaccesstokenrequest.md +++ b/docs/models/components/getaccesstokenrequest.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `code` | *string* | :heavy_check_mark: | Fetched value using OTP value from the Authorization Modal. | -| `clientId` | *string* | :heavy_check_mark: | Merchant publishable key which can be found in the merchant dashboard | -| `clientSecret` | *string* | :heavy_check_mark: | Your Bolt API Key. | -| `grantType` | [components.GrantType](../../models/components/granttype.md) | :heavy_check_mark: | The type of OAuth 2.0 grant being utilized.

The value will always be `authorization_code` when exchanging an authorization code for an access token.
| -| `scope` | [components.Scope](../../models/components/scope.md)[] | :heavy_check_mark: | The scope issued to the merchant when receiving an authorization code.
Options include `bolt.account.manage`, `bolt.account.view`, `openid`.
You can find more information on these options in our
[OAuth scope documentation](https://help.bolt.com/developers/references/bolt-oauth/#scopes).
| -| `state` | *string* | :heavy_minus_sign: | A randomly generated string issued to the merchant when receiving an authorization code used to prevent CSRF attacks | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `code` | *string* | :heavy_check_mark: | Fetched value using OTP value from the Authorization Modal. | 7GSjMRSHs6Ak7C_zvVW6P2IhZOHxMK7HZKW1fMX85ms | +| `clientId` | *string* | :heavy_check_mark: | The OAuth client ID, which corresponds to the merchant publishable key, which can be retrieved
in the Merchant Dashboard.
| 8fd9diIy59sj.IraJdeIgmdsO.fd233434fg2c616cgo932aa6e1e4fc627a9385045gr395222a127gi93c595rg4 | +| `clientSecret` | *string* | :heavy_check_mark: | The OAuth client secret, which corresponds the merchant API key, which can be retrieved in the
Merchant Dashboard.
| 23ee7ec7301779eaff451d7c6f6cba322499e3c0ec752f800c72a8f99217e3a8 | +| `grantType` | [components.GrantType](../../models/components/granttype.md) | :heavy_check_mark: | The type of OAuth 2.0 grant being utilized. The only supported grant is `authorization_code`. | authorization_code | +| `scope` | [components.Scope](../../models/components/scope.md)[] | :heavy_check_mark: | The scope issued to the merchant when receiving an authorization code.


[OAuth Developer Reference](https://help.bolt.com/developers/references/bolt-oauth/#scopes) | | +| `state` | *string* | :heavy_minus_sign: | A randomly generated string sent along with an authorization code. This must be included, if provided,
in order to prevent CSRF attacks. used to prevent CSRF attacks.
| xyzABC123 | \ No newline at end of file diff --git a/docs/models/components/getaccesstokenresponse.md b/docs/models/components/getaccesstokenresponse.md index 898b87d..bf7ee6e 100644 --- a/docs/models/components/getaccesstokenresponse.md +++ b/docs/models/components/getaccesstokenresponse.md @@ -3,12 +3,12 @@ ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `idToken` | *string* | :heavy_minus_sign: | A JWT token issued when the request includes the scope open_id. | -| `accessToken` | *string* | :heavy_minus_sign: | An access token you can use to make requests on behalf of a Bolt Account. | -| `expiresIn` | *number* | :heavy_minus_sign: | Access token’s expiration in seconds. | -| `refreshToken` | *string* | :heavy_minus_sign: | A refresh token you can use to issue a brand new access token without obtaining a new authorization code. | -| `refreshTokenScope` | [components.RefreshTokenScope](../../models/components/refreshtokenscope.md)[] | :heavy_minus_sign: | The scope granted to the refresh token. Currently this will always be bolt.account.view. | -| `scope` | [components.GetAccessTokenResponseScope](../../models/components/getaccesstokenresponsescope.md)[] | :heavy_minus_sign: | The scope granted to access token, depending on the scope granted to the authorization code as well as the scope parameter.
Options include `bolt.account.manage`, `bolt.account.view`, `openid`.'
| -| `tokenType` | *string* | :heavy_minus_sign: | The token_type will always be bearer. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `idToken` | *string* | :heavy_minus_sign: | A JWT token issued when the request includes the scope open_id. | | +| `accessToken` | *string* | :heavy_minus_sign: | An access token you can use to make requests on behalf of a Bolt Account. | KCqordmSK6_lpkaXaXfGD8LwnKMGGOYy4Ju2IaBXpJI.CzOF7QOmGGQEgIzBjxOEh1FbRdDpzf9zbm9eHrCZ6zw | +| `expiresIn` | *number* | :heavy_minus_sign: | The access token's expiration, in seconds. | 3600 | +| `refreshToken` | *string* | :heavy_minus_sign: | A refresh token you can use to issue a brand new access token without obtaining a new authorization code. | 4hJYNO4GHvALZoocXoLenfNeFy1RR5ZT6G5JYrFbvkI.Q_PqV0lIszCNoN-85EwD-2nYZOVEepVgJSolx-Jbzrs | +| `refreshTokenScope` | *string* | :heavy_minus_sign: | The scope granted to the refresh token. Currently, refreshed token will only grant view permissions. | bolt.account.view | +| `scope` | *string* | :heavy_minus_sign: | The scope granted to access token, depending on the scope granted to the authorization code as well as the scope parameter.
Options include `bolt.account.manage`, `bolt.account.view`, `openid`. Multiple values can be returned as space-separated strings.
| bolt.account.manage openid | +| `tokenType` | *string* | :heavy_minus_sign: | The token_type will always be bearer. | bearer | \ No newline at end of file diff --git a/docs/models/components/getaccesstokenresponsescope.md b/docs/models/components/getaccesstokenresponsescope.md deleted file mode 100644 index e023d54..0000000 --- a/docs/models/components/getaccesstokenresponsescope.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetAccessTokenResponseScope - - -## Values - -| Name | Value | -| ------------------- | ------------------- | -| `BoltAccountManage` | bolt.account.manage | -| `BoltAccountView` | bolt.account.view | -| `Openid` | openid | \ No newline at end of file diff --git a/docs/models/components/granttype.md b/docs/models/components/granttype.md index 2e7b4e6..a11b41f 100644 --- a/docs/models/components/granttype.md +++ b/docs/models/components/granttype.md @@ -1,9 +1,6 @@ # GrantType -The type of OAuth 2.0 grant being utilized. - -The value will always be `authorization_code` when exchanging an authorization code for an access token. - +The type of OAuth 2.0 grant being utilized. The only supported grant is `authorization_code`. ## Values diff --git a/docs/models/components/refreshtokenscope.md b/docs/models/components/refreshtokenscope.md deleted file mode 100644 index 3ada02c..0000000 --- a/docs/models/components/refreshtokenscope.md +++ /dev/null @@ -1,10 +0,0 @@ -# RefreshTokenScope - - -## Values - -| Name | Value | -| ------------------- | ------------------- | -| `BoltAccountManage` | bolt.account.manage | -| `BoltAccountView` | bolt.account.view | -| `Openid` | openid | \ No newline at end of file diff --git a/docs/sdks/oauth/README.md b/docs/sdks/oauth/README.md index 8e23277..047cd87 100644 --- a/docs/sdks/oauth/README.md +++ b/docs/sdks/oauth/README.md @@ -31,13 +31,14 @@ async function run() { }); const res = await sdk.oAuth.getToken({ - code: "string", - clientId: "string", - clientSecret: "string", + code: "7GSjMRSHs6Ak7C_zvVW6P2IhZOHxMK7HZKW1fMX85ms", + clientId: "8fd9diIy59sj.IraJdeIgmdsO.fd233434fg2c616cgo932aa6e1e4fc627a9385045gr395222a127gi93c595rg4", + clientSecret: "23ee7ec7301779eaff451d7c6f6cba322499e3c0ec752f800c72a8f99217e3a8", grantType: GrantType.AuthorizationCode, scope: [ Scope.BoltAccountManage, ], + state: "xyzABC123", }); if (res?.statusCode !== 200) { diff --git a/gen.yaml b/gen.yaml index 429350b..26fc48c 100644 --- a/gen.yaml +++ b/gen.yaml @@ -7,7 +7,7 @@ generation: fixes: nameResolutionDec2023: false typescript: - version: 0.4.0 + version: 0.4.1 author: BoltPublicAPI clientServerStatusCodesAsErrors: true flattenGlobalSecurity: true diff --git a/package-lock.json b/package-lock.json index 70fc7ab..9b01160 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@boltpay/bolt-typescript-sdk", - "version": "0.4.0", + "version": "0.4.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@boltpay/bolt-typescript-sdk", - "version": "0.4.0", + "version": "0.4.1", "dependencies": { "decimal.js": "^10.4.3", "jsonpath": "^1.1.1" diff --git a/package.json b/package.json index 319bf07..645fe4b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "type": "commonjs", "name": "@boltpay/bolt-typescript-sdk", - "version": "0.4.0", + "version": "0.4.1", "author": "BoltPublicAPI", "main": "./index.js", "sideEffects": false, diff --git a/src/lib/config.ts b/src/lib/config.ts index f37ccbc..86dbaa7 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL { export const SDK_METADATA = Object.freeze({ language: "typescript", openapiDocVersion: "3.0.1", - sdkVersion: "0.4.0", + sdkVersion: "0.4.1", genVersion: "2.230.3", - userAgent: "speakeasy-sdk/typescript 0.4.0 2.230.3 3.0.1 @boltpay/bolt-typescript-sdk", + userAgent: "speakeasy-sdk/typescript 0.4.1 2.230.3 3.0.1 @boltpay/bolt-typescript-sdk", }); diff --git a/src/models/components/getaccesstokenrequest.ts b/src/models/components/getaccesstokenrequest.ts index 82dbfd4..067bc09 100644 --- a/src/models/components/getaccesstokenrequest.ts +++ b/src/models/components/getaccesstokenrequest.ts @@ -5,12 +5,7 @@ import { z } from "zod"; /** - * The type of OAuth 2.0 grant being utilized. - * - * @remarks - * - * The value will always be `authorization_code` when exchanging an authorization code for an access token. - * + * The type of OAuth 2.0 grant being utilized. The only supported grant is `authorization_code`. */ export enum GrantType { AuthorizationCode = "authorization_code", @@ -28,34 +23,38 @@ export type GetAccessTokenRequest = { */ code: string; /** - * Merchant publishable key which can be found in the merchant dashboard + * The OAuth client ID, which corresponds to the merchant publishable key, which can be retrieved + * + * @remarks + * in the Merchant Dashboard. + * */ clientId: string; /** - * Your Bolt API Key. - */ - clientSecret: string; - /** - * The type of OAuth 2.0 grant being utilized. + * The OAuth client secret, which corresponds the merchant API key, which can be retrieved in the * * @remarks - * - * The value will always be `authorization_code` when exchanging an authorization code for an access token. + * Merchant Dashboard. * */ + clientSecret: string; + /** + * The type of OAuth 2.0 grant being utilized. The only supported grant is `authorization_code`. + */ grantType: GrantType; /** * The scope issued to the merchant when receiving an authorization code. * * @remarks - * Options include `bolt.account.manage`, `bolt.account.view`, `openid`. - * You can find more information on these options in our - * [OAuth scope documentation](https://help.bolt.com/developers/references/bolt-oauth/#scopes). * */ scope: Array; /** - * A randomly generated string issued to the merchant when receiving an authorization code used to prevent CSRF attacks + * A randomly generated string sent along with an authorization code. This must be included, if provided, + * + * @remarks + * in order to prevent CSRF attacks. used to prevent CSRF attacks. + * */ state?: string | undefined; }; diff --git a/src/models/components/getaccesstokenresponse.ts b/src/models/components/getaccesstokenresponse.ts index bdea664..2374935 100644 --- a/src/models/components/getaccesstokenresponse.ts +++ b/src/models/components/getaccesstokenresponse.ts @@ -4,18 +4,6 @@ import { z } from "zod"; -export enum RefreshTokenScope { - BoltAccountManage = "bolt.account.manage", - BoltAccountView = "bolt.account.view", - Openid = "openid", -} - -export enum GetAccessTokenResponseScope { - BoltAccountManage = "bolt.account.manage", - BoltAccountView = "bolt.account.view", - Openid = "openid", -} - export type GetAccessTokenResponse = { /** * A JWT token issued when the request includes the scope open_id. @@ -26,7 +14,7 @@ export type GetAccessTokenResponse = { */ accessToken?: string | undefined; /** - * Access token’s expiration in seconds. + * The access token's expiration, in seconds. */ expiresIn?: number | undefined; /** @@ -34,29 +22,23 @@ export type GetAccessTokenResponse = { */ refreshToken?: string | undefined; /** - * The scope granted to the refresh token. Currently this will always be bolt.account.view. + * The scope granted to the refresh token. Currently, refreshed token will only grant view permissions. */ - refreshTokenScope?: Array | undefined; + refreshTokenScope?: string | undefined; /** * The scope granted to access token, depending on the scope granted to the authorization code as well as the scope parameter. * * @remarks - * Options include `bolt.account.manage`, `bolt.account.view`, `openid`.' + * Options include `bolt.account.manage`, `bolt.account.view`, `openid`. Multiple values can be returned as space-separated strings. * */ - scope?: Array | undefined; + scope?: string | undefined; /** * The token_type will always be bearer. */ tokenType?: string | undefined; }; -/** @internal */ -export const RefreshTokenScope$ = z.nativeEnum(RefreshTokenScope); - -/** @internal */ -export const GetAccessTokenResponseScope$ = z.nativeEnum(GetAccessTokenResponseScope); - /** @internal */ export namespace GetAccessTokenResponse$ { export type Inbound = { @@ -64,8 +46,8 @@ export namespace GetAccessTokenResponse$ { access_token?: string | undefined; expires_in?: number | undefined; refresh_token?: string | undefined; - refresh_token_scope?: Array | undefined; - scope?: Array | undefined; + refresh_token_scope?: string | undefined; + scope?: string | undefined; token_type?: string | undefined; }; @@ -75,8 +57,8 @@ export namespace GetAccessTokenResponse$ { access_token: z.string().optional(), expires_in: z.number().int().optional(), refresh_token: z.string().optional(), - refresh_token_scope: z.array(RefreshTokenScope$).optional(), - scope: z.array(GetAccessTokenResponseScope$).optional(), + refresh_token_scope: z.string().optional(), + scope: z.string().optional(), token_type: z.string().optional(), }) .transform((v) => { @@ -98,8 +80,8 @@ export namespace GetAccessTokenResponse$ { access_token?: string | undefined; expires_in?: number | undefined; refresh_token?: string | undefined; - refresh_token_scope?: Array | undefined; - scope?: Array | undefined; + refresh_token_scope?: string | undefined; + scope?: string | undefined; token_type?: string | undefined; }; @@ -109,8 +91,8 @@ export namespace GetAccessTokenResponse$ { accessToken: z.string().optional(), expiresIn: z.number().int().optional(), refreshToken: z.string().optional(), - refreshTokenScope: z.array(RefreshTokenScope$).optional(), - scope: z.array(GetAccessTokenResponseScope$).optional(), + refreshTokenScope: z.string().optional(), + scope: z.string().optional(), tokenType: z.string().optional(), }) .transform((v) => {