From fbd134035faac2fbbec0c8605f7e5b8d71aae35e Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 12 Dec 2023 00:17:27 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc 3.0.1, Speakeasy CLI 1.126.0 --- README.md | 21 ++-- RELEASES.md | 12 +- USAGE.md | 3 +- docs/models/components/security.md | 8 +- .../operations/guestpaymentsactionsecurity.md | 6 +- .../guestpaymentsinitializesecurity.md | 6 +- .../operations/guestpaymentsupdatesecurity.md | 6 +- .../testingaccountcreatesecurity.md | 6 +- .../testingcreditcardgetsecurity.md | 6 +- docs/sdks/account/README.md | 115 ++++++++---------- docs/sdks/guest/README.md | 6 +- docs/sdks/loggedin/README.md | 9 +- docs/sdks/oauth/README.md | 3 +- docs/sdks/testing/README.md | 4 +- files.gen | 6 +- gen.yaml | 11 +- package-lock.json | 4 +- package.json | 2 +- src/models/components/security.ts | 8 +- src/sdk/account.ts | 110 +++++++++-------- src/sdk/guest.ts | 6 + src/sdk/loggedin.ts | 6 + src/sdk/oauth.ts | 2 + src/sdk/sdk.ts | 6 +- src/sdk/testing.ts | 4 + 25 files changed, 198 insertions(+), 178 deletions(-) diff --git a/README.md b/README.md index 418c3d1..4cca1fb 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,7 @@ import { AccountGetRequest } from "@boltpay/bolt-typescript-sdk/dist/models/oper async function run() { const sdk = new BoltTypescriptSDK({ security: { - apiKey: "", - oauth: "", + oauth: "Bearer ", }, }); const xPublishableKey: string = "string"; @@ -67,8 +66,8 @@ run(); * [getDetails](docs/sdks/account/README.md#getdetails) - Retrieve account details * [addAddress](docs/sdks/account/README.md#addaddress) - Add an address -* [deleteAddress](docs/sdks/account/README.md#deleteaddress) - Delete an existing address * [updateAddress](docs/sdks/account/README.md#updateaddress) - Edit an existing address +* [deleteAddress](docs/sdks/account/README.md#deleteaddress) - Delete an existing address * [detect](docs/sdks/account/README.md#detect) - Determine the existence of a Bolt account * [addPaymentMethod](docs/sdks/account/README.md#addpaymentmethod) - Add a payment method to a shopper's Bolt account Wallet. * [deletePaymentMethod](docs/sdks/account/README.md#deletepaymentmethod) - Delete an existing payment method @@ -115,8 +114,7 @@ import { AccountGetRequest } from "@boltpay/bolt-typescript-sdk/dist/models/oper async function run() { const sdk = new BoltTypescriptSDK({ security: { - apiKey: "", - oauth: "", + oauth: "Bearer ", }, }); const xPublishableKey: string = "string"; @@ -165,8 +163,7 @@ async function run() { const sdk = new BoltTypescriptSDK({ serverIdx: 0, security: { - apiKey: "", - oauth: "", + oauth: "Bearer ", }, }); const xPublishableKey: string = "string"; @@ -198,8 +195,7 @@ async function run() { const sdk = new BoltTypescriptSDK({ serverURL: "https://{environment}.bolt.com/v3", security: { - apiKey: "", - oauth: "", + oauth: "Bearer ", }, }); const xPublishableKey: string = "string"; @@ -244,8 +240,8 @@ This SDK supports the following security schemes globally: | Name | Type | Scheme | | ------------ | ------------ | ------------ | -| `apiKey` | apiKey | API key | | `oauth` | oauth2 | OAuth2 token | +| `apiKey` | apiKey | API key | You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example: ```typescript @@ -255,8 +251,7 @@ import { AccountGetRequest } from "@boltpay/bolt-typescript-sdk/dist/models/oper async function run() { const sdk = new BoltTypescriptSDK({ security: { - apiKey: "", - oauth: "", + oauth: "Bearer ", }, }); const xPublishableKey: string = "string"; @@ -352,7 +347,7 @@ async function run() { }, paymentMethod: "string", }; - const operationSecurity: GuestPaymentsInitializeSecurity = ""; + const operationSecurity: GuestPaymentsInitializeSecurity = ""; const res = await sdk.payments.guest.initialize( operationSecurity, diff --git a/RELEASES.md b/RELEASES.md index 569e226..7da39a8 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -58,4 +58,14 @@ Based on: ### Generated - [typescript v0.2.4] . ### Releases -- [NPM v0.2.4] https://www.npmjs.com/package/@boltpay/bolt-typescript-sdk/v/0.2.4 - . \ No newline at end of file +- [NPM v0.2.4] https://www.npmjs.com/package/@boltpay/bolt-typescript-sdk/v/0.2.4 - . + +## 2023-12-12 00:17:10 +### Changes +Based on: +- OpenAPI Doc 3.0.1 +- Speakeasy CLI 1.126.0 (2.213.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.3.0] . +### Releases +- [NPM v0.3.0] https://www.npmjs.com/package/@boltpay/bolt-typescript-sdk/v/0.3.0 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 85f63e3..4cae58b 100644 --- a/USAGE.md +++ b/USAGE.md @@ -6,8 +6,7 @@ import { AccountGetRequest } from "@boltpay/bolt-typescript-sdk/dist/models/oper async function run() { const sdk = new BoltTypescriptSDK({ security: { - apiKey: "", - oauth: "", + oauth: "Bearer ", }, }); const xPublishableKey: string = "string"; diff --git a/docs/models/components/security.md b/docs/models/components/security.md index 4a36ecb..0d61f37 100644 --- a/docs/models/components/security.md +++ b/docs/models/components/security.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `apiKey` | *string* | :heavy_check_mark: | N/A | | -| `oauth` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `oauth` | *string* | :heavy_minus_sign: | N/A | +| `apiKey` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/guestpaymentsactionsecurity.md b/docs/models/operations/guestpaymentsactionsecurity.md index 5d5912a..94464c7 100644 --- a/docs/models/operations/guestpaymentsactionsecurity.md +++ b/docs/models/operations/guestpaymentsactionsecurity.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `apiKey` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/guestpaymentsinitializesecurity.md b/docs/models/operations/guestpaymentsinitializesecurity.md index 0019673..909ddd2 100644 --- a/docs/models/operations/guestpaymentsinitializesecurity.md +++ b/docs/models/operations/guestpaymentsinitializesecurity.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `apiKey` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/guestpaymentsupdatesecurity.md b/docs/models/operations/guestpaymentsupdatesecurity.md index e08d904..09bfb3a 100644 --- a/docs/models/operations/guestpaymentsupdatesecurity.md +++ b/docs/models/operations/guestpaymentsupdatesecurity.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `apiKey` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/testingaccountcreatesecurity.md b/docs/models/operations/testingaccountcreatesecurity.md index d97236f..a6c57c2 100644 --- a/docs/models/operations/testingaccountcreatesecurity.md +++ b/docs/models/operations/testingaccountcreatesecurity.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `apiKey` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/testingcreditcardgetsecurity.md b/docs/models/operations/testingcreditcardgetsecurity.md index 73aad5a..7980042 100644 --- a/docs/models/operations/testingcreditcardgetsecurity.md +++ b/docs/models/operations/testingcreditcardgetsecurity.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `apiKey` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdks/account/README.md b/docs/sdks/account/README.md index 153c809..91171e9 100644 --- a/docs/sdks/account/README.md +++ b/docs/sdks/account/README.md @@ -11,8 +11,8 @@ you can add or remove addresses and payment information. * [getDetails](#getdetails) - Retrieve account details * [addAddress](#addaddress) - Add an address -* [deleteAddress](#deleteaddress) - Delete an existing address * [updateAddress](#updateaddress) - Edit an existing address +* [deleteAddress](#deleteaddress) - Delete an existing address * [detect](#detect) - Determine the existence of a Bolt account * [addPaymentMethod](#addpaymentmethod) - Add a payment method to a shopper's Bolt account Wallet. * [deletePaymentMethod](#deletepaymentmethod) - Delete an existing payment method @@ -30,8 +30,7 @@ import { AccountGetRequest } from "@boltpay/bolt-typescript-sdk/dist/models/oper async function run() { const sdk = new BoltTypescriptSDK({ security: { - apiKey: "", - oauth: "", + oauth: "Bearer ", }, }); const xPublishableKey: string = "string"; @@ -78,8 +77,7 @@ import { AccountAddressCreateRequest } from "@boltpay/bolt-typescript-sdk/dist/m async function run() { const sdk = new BoltTypescriptSDK({ security: { - apiKey: "", - oauth: "", + oauth: "Bearer ", }, }); const xPublishableKey: string = "string"; @@ -126,29 +124,44 @@ run(); | --------------- | --------------- | --------------- | | errors.SDKError | 400-600 | */* | -## deleteAddress +## updateAddress -Delete an existing address. Deleting an address does not invalidate transactions or -shipments that are associated with it. +Edit an existing address on the shopper's account. This does not edit addresses +that are already associated with other resources, such as transactions or +shipments. ### Example Usage ```typescript import { BoltTypescriptSDK } from "@boltpay/bolt-typescript-sdk"; -import { AccountAddressDeleteRequest } from "@boltpay/bolt-typescript-sdk/dist/models/operations"; +import { AddressListingInput, CountryCode } from "@boltpay/bolt-typescript-sdk/dist/models/components"; +import { AccountAddressEditRequest } from "@boltpay/bolt-typescript-sdk/dist/models/operations"; async function run() { const sdk = new BoltTypescriptSDK({ security: { - apiKey: "", - oauth: "", + oauth: "Bearer ", }, }); const id: string = "D4g3h5tBuVYK9"; const xPublishableKey: string = "string"; +const addressListing: AddressListingInput = { + firstName: "Alice", + lastName: "Baker", + company: "ACME Corporation", + streetAddress1: "535 Mission St, Ste 1401", + streetAddress2: "c/o Shipping Department", + locality: "San Francisco", + postalCode: "94105", + region: "CA", + countryCode: CountryCode.Us, + email: "alice@example.com", + phone: "+14155550199", + isDefault: true, +}; - const res = await sdk.account.deleteAddress(id, xPublishableKey); + const res = await sdk.account.updateAddress(id, xPublishableKey, addressListing); if (res.statusCode == 200) { // handle response @@ -160,62 +173,45 @@ run(); ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The ID of the address to delete | D4g3h5tBuVYK9 | -| `xPublishableKey` | *string* | :heavy_check_mark: | The publicly viewable identifier used to identify a merchant division. | | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The ID of the address to edit | D4g3h5tBuVYK9 | +| `xPublishableKey` | *string* | :heavy_check_mark: | The publicly viewable identifier used to identify a merchant division. | | +| `addressListing` | [components.AddressListingInput](../../models/components/addresslistinginput.md) | :heavy_check_mark: | N/A | | +| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | | ### Response -**Promise<[operations.AccountAddressDeleteResponse](../../models/operations/accountaddressdeleteresponse.md)>** +**Promise<[operations.AccountAddressEditResponse](../../models/operations/accountaddresseditresponse.md)>** ### Errors -| Error Object | Status Code | Content Type | -| ---------------- | ---------------- | ---------------- | -| errors.ErrorT | 4XX | application/json | -| errors.SDKError | 400-600 | */* | +| Error Object | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 400-600 | */* | -## updateAddress +## deleteAddress -Edit an existing address on the shopper's account. This does not edit addresses -that are already associated with other resources, such as transactions or -shipments. +Delete an existing address. Deleting an address does not invalidate transactions or +shipments that are associated with it. ### Example Usage ```typescript import { BoltTypescriptSDK } from "@boltpay/bolt-typescript-sdk"; -import { AddressListingInput, CountryCode } from "@boltpay/bolt-typescript-sdk/dist/models/components"; -import { AccountAddressEditRequest } from "@boltpay/bolt-typescript-sdk/dist/models/operations"; +import { AccountAddressDeleteRequest } from "@boltpay/bolt-typescript-sdk/dist/models/operations"; async function run() { const sdk = new BoltTypescriptSDK({ security: { - apiKey: "", - oauth: "", + oauth: "Bearer ", }, }); const id: string = "D4g3h5tBuVYK9"; const xPublishableKey: string = "string"; -const addressListing: AddressListingInput = { - firstName: "Alice", - lastName: "Baker", - company: "ACME Corporation", - streetAddress1: "535 Mission St, Ste 1401", - streetAddress2: "c/o Shipping Department", - locality: "San Francisco", - postalCode: "94105", - region: "CA", - countryCode: CountryCode.Us, - email: "alice@example.com", - phone: "+14155550199", - isDefault: true, -}; - const res = await sdk.account.updateAddress(id, xPublishableKey, addressListing); + const res = await sdk.account.deleteAddress(id, xPublishableKey); if (res.statusCode == 200) { // handle response @@ -227,22 +223,22 @@ run(); ### Parameters -| Parameter | Type | Required | Description | Example | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The ID of the address to edit | D4g3h5tBuVYK9 | -| `xPublishableKey` | *string* | :heavy_check_mark: | The publicly viewable identifier used to identify a merchant division. | | -| `addressListing` | [components.AddressListingInput](../../models/components/addresslistinginput.md) | :heavy_check_mark: | N/A | | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | | +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The ID of the address to delete | D4g3h5tBuVYK9 | +| `xPublishableKey` | *string* | :heavy_check_mark: | The publicly viewable identifier used to identify a merchant division. | | +| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | | ### Response -**Promise<[operations.AccountAddressEditResponse](../../models/operations/accountaddresseditresponse.md)>** +**Promise<[operations.AccountAddressDeleteResponse](../../models/operations/accountaddressdeleteresponse.md)>** ### Errors -| Error Object | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 400-600 | */* | +| Error Object | Status Code | Content Type | +| ---------------- | ---------------- | ---------------- | +| errors.ErrorT | 4XX | application/json | +| errors.SDKError | 400-600 | */* | ## detect @@ -258,8 +254,7 @@ import { AccountExistsRequest } from "@boltpay/bolt-typescript-sdk/dist/models/o async function run() { const sdk = new BoltTypescriptSDK({ security: { - apiKey: "", - oauth: "", + oauth: "Bearer ", }, }); const identifier: Identifier = { @@ -314,8 +309,7 @@ import { AccountAddPaymentMethodRequest } from "@boltpay/bolt-typescript-sdk/dis async function run() { const sdk = new BoltTypescriptSDK({ security: { - apiKey: "", - oauth: "", + oauth: "Bearer ", }, }); const xPublishableKey: string = "string"; @@ -364,8 +358,7 @@ import { AccountPaymentMethodDeleteRequest } from "@boltpay/bolt-typescript-sdk/ async function run() { const sdk = new BoltTypescriptSDK({ security: { - apiKey: "", - oauth: "", + oauth: "Bearer ", }, }); const id: string = "D4g3h5tBuVYK9"; diff --git a/docs/sdks/guest/README.md b/docs/sdks/guest/README.md index 2183f1b..4d3e304 100644 --- a/docs/sdks/guest/README.md +++ b/docs/sdks/guest/README.md @@ -89,7 +89,7 @@ const guestPaymentInitializeRequest: GuestPaymentInitializeRequest = { }, paymentMethod: "string", }; -const operationSecurity: GuestPaymentsInitializeSecurity = ""; +const operationSecurity: GuestPaymentsInitializeSecurity = ""; const res = await sdk.payments.guest.initialize(operationSecurity, xPublishableKey, guestPaymentInitializeRequest); @@ -194,7 +194,7 @@ const paymentUpdateRequest: PaymentUpdateRequest = { }, }, }; -const operationSecurity: GuestPaymentsUpdateSecurity = ""; +const operationSecurity: GuestPaymentsUpdateSecurity = ""; const res = await sdk.payments.guest.update(operationSecurity, id, xPublishableKey, paymentUpdateRequest); @@ -247,7 +247,7 @@ const paymentActionRequest: PaymentActionRequest = { dotTag: DotTag.Finalize, redirectResult: "eyJ0cmFuc", }; -const operationSecurity: GuestPaymentsActionSecurity = ""; +const operationSecurity: GuestPaymentsActionSecurity = ""; const res = await sdk.payments.guest.performAction(operationSecurity, id, xPublishableKey, paymentActionRequest); diff --git a/docs/sdks/loggedin/README.md b/docs/sdks/loggedin/README.md index dd0ae79..18498bd 100644 --- a/docs/sdks/loggedin/README.md +++ b/docs/sdks/loggedin/README.md @@ -31,8 +31,7 @@ import { PaymentsInitializeRequest } from "@boltpay/bolt-typescript-sdk/dist/mod async function run() { const sdk = new BoltTypescriptSDK({ security: { - apiKey: "", - oauth: "", + oauth: "Bearer ", }, }); const xPublishableKey: string = "string"; @@ -139,8 +138,7 @@ import { PaymentsUpdateRequest } from "@boltpay/bolt-typescript-sdk/dist/models/ async function run() { const sdk = new BoltTypescriptSDK({ security: { - apiKey: "", - oauth: "", + oauth: "Bearer ", }, }); const id: string = "iKv7t5bgt1gg"; @@ -240,8 +238,7 @@ import { PaymentsActionRequest } from "@boltpay/bolt-typescript-sdk/dist/models/ async function run() { const sdk = new BoltTypescriptSDK({ security: { - apiKey: "", - oauth: "", + oauth: "Bearer ", }, }); const id: string = "iKv7t5bgt1gg"; diff --git a/docs/sdks/oauth/README.md b/docs/sdks/oauth/README.md index f8666e8..6c1d616 100644 --- a/docs/sdks/oauth/README.md +++ b/docs/sdks/oauth/README.md @@ -25,8 +25,7 @@ import { GrantType, Scope } from "@boltpay/bolt-typescript-sdk/dist/models/compo async function run() { const sdk = new BoltTypescriptSDK({ security: { - apiKey: "", - oauth: "", + oauth: "Bearer ", }, }); diff --git a/docs/sdks/testing/README.md b/docs/sdks/testing/README.md index 6dff9fa..a828490 100644 --- a/docs/sdks/testing/README.md +++ b/docs/sdks/testing/README.md @@ -33,7 +33,7 @@ const accountTestCreationData: AccountTestCreationData = { isMigrated: true, hasAddress: true, }; -const operationSecurity: TestingAccountCreateSecurity = ""; +const operationSecurity: TestingAccountCreateSecurity = ""; const res = await sdk.testing.createAccount(operationSecurity, xPublishableKey, accountTestCreationData); @@ -79,7 +79,7 @@ import { TestingCreditCardGetSecurity } from "@boltpay/bolt-typescript-sdk/dist/ async function run() { const sdk = new BoltTypescriptSDK(); -const operationSecurity: TestingCreditCardGetSecurity = ""; +const operationSecurity: TestingCreditCardGetSecurity = ""; const res = await sdk.testing.getCreditCard(operationSecurity); diff --git a/files.gen b/files.gen index e79ac81..866557e 100644 --- a/files.gen +++ b/files.gen @@ -26,8 +26,8 @@ src/types/rfcdate.ts tsconfig.json src/models/operations/accountget.ts src/models/operations/accountaddresscreate.ts -src/models/operations/accountaddressdelete.ts src/models/operations/accountaddressedit.ts +src/models/operations/accountaddressdelete.ts src/models/operations/accountexists.ts src/models/operations/accountaddpaymentmethod.ts src/models/operations/accountpaymentmethoddelete.ts @@ -67,10 +67,10 @@ docs/models/operations/accountgetrequest.md docs/models/operations/accountgetresponse.md docs/models/operations/accountaddresscreaterequest.md docs/models/operations/accountaddresscreateresponse.md -docs/models/operations/accountaddressdeleterequest.md -docs/models/operations/accountaddressdeleteresponse.md docs/models/operations/accountaddresseditrequest.md docs/models/operations/accountaddresseditresponse.md +docs/models/operations/accountaddressdeleterequest.md +docs/models/operations/accountaddressdeleteresponse.md docs/models/operations/accountexistsrequest.md docs/models/operations/accountexistsresponse.md docs/models/operations/accountaddpaymentmethodrequest.md diff --git a/gen.yaml b/gen.yaml index 927fa9a..0864f37 100644 --- a/gen.yaml +++ b/gen.yaml @@ -2,8 +2,8 @@ configVersion: 1.0.0 management: docChecksum: 3b8fa46f5a3dd747537376b55b54f572 docVersion: 3.0.1 - speakeasyVersion: 1.125.2 - generationVersion: 2.210.6 + speakeasyVersion: 1.126.0 + generationVersion: 2.213.3 generation: comments: {} sdkClassName: Bolt-Typescript-SDK @@ -13,9 +13,9 @@ generation: optionalPropertyRendering: withExample features: typescript: - core: 3.1.4 + core: 3.3.0 flattening: 2.81.1 - globalSecurity: 2.82.0 + globalSecurity: 2.82.1 globalServerURLs: 2.82.1 groups: 2.81.2 ignores: 2.81.1 @@ -23,7 +23,7 @@ features: methodSecurity: 2.82.0 nameOverrides: 2.81.1 typescript: - version: 0.2.4 + version: 0.3.0 author: BoltPublicAPI clientServerStatusCodesAsErrors: true flattenGlobalSecurity: true @@ -42,3 +42,4 @@ typescript: packageName: '@boltpay/bolt-typescript-sdk' published: true repoSubDirectory: . + templateVersion: v1 diff --git a/package-lock.json b/package-lock.json index f84dc5f..ec91c43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@boltpay/bolt-typescript-sdk", - "version": "0.2.4", + "version": "0.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@boltpay/bolt-typescript-sdk", - "version": "0.2.4", + "version": "0.3.0", "dependencies": { "axios": "^1.1.3", "class-transformer": "^0.5.1", diff --git a/package.json b/package.json index 2a0068a..6d27a53 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@boltpay/bolt-typescript-sdk", - "version": "0.2.4", + "version": "0.3.0", "author": "BoltPublicAPI", "scripts": { "prepare": "tsc --build", diff --git a/src/models/components/security.ts b/src/models/components/security.ts index fa1c380..0d2c9dc 100644 --- a/src/models/components/security.ts +++ b/src/models/components/security.ts @@ -5,9 +5,9 @@ import { SpeakeasyBase, SpeakeasyMetadata } from "../../internal/utils"; export class Security extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "security, scheme=true;type=apiKey;subtype=header;name=X-API-Key" }) - apiKey: string; - @SpeakeasyMetadata({ data: "security, scheme=true;type=oauth2;name=Authorization" }) - oauth: string; + oauth?: string; + + @SpeakeasyMetadata({ data: "security, scheme=true;type=apiKey;subtype=header;name=X-API-Key" }) + apiKey?: string; } diff --git a/src/sdk/account.ts b/src/sdk/account.ts index 45b34b9..cd2a22b 100644 --- a/src/sdk/account.ts +++ b/src/sdk/account.ts @@ -115,6 +115,8 @@ export class Account { decodedRes, httpRes ); + default: + break; } return res; @@ -217,33 +219,48 @@ export class Account { decodedRes, httpRes ); + default: + break; } return res; } /** - * Delete an existing address + * Edit an existing address * * @remarks - * Delete an existing address. Deleting an address does not invalidate transactions or - * shipments that are associated with it. + * Edit an existing address on the shopper's account. This does not edit addresses + * that are already associated with other resources, such as transactions or + * shipments. * */ - async deleteAddress( + async updateAddress( id: string, xPublishableKey: string, + addressListing: components.AddressListingInput, config?: AxiosRequestConfig - ): Promise { - const req = new operations.AccountAddressDeleteRequest({ + ): Promise { + const req = new operations.AccountAddressEditRequest({ id: id, xPublishableKey: xPublishableKey, + addressListing: addressListing, }); const baseURL: string = utils.templateUrl( this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults ); const operationUrl: string = utils.generateURL(baseURL, "/account/addresses/{id}", req); + + let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; + + try { + [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "addressListing", "json"); + } catch (e: unknown) { + if (e instanceof Error) { + throw new Error(`Error serializing request body, cause: ${e.message}`); + } + } const client: AxiosInstance = this.sdkConfiguration.defaultClient; let globalSecurity = this.sdkConfiguration.security; if (typeof globalSecurity === "function") { @@ -255,9 +272,11 @@ export class Account { const properties = utils.parseSecurityProperties(globalSecurity); const headers: RawAxiosRequestHeaders = { ...utils.getHeadersFromRequest(req), + ...reqBodyHeaders, ...config?.headers, ...properties.headers, }; + if (reqBody == null) throw new Error("request body is required"); headers["Accept"] = "application/json"; headers["user-agent"] = this.sdkConfiguration.userAgent; @@ -265,9 +284,10 @@ export class Account { const httpRes: AxiosResponse = await client.request({ validateStatus: () => true, url: operationUrl, - method: "delete", + method: "put", headers: headers, responseType: "arraybuffer", + data: reqBody, ...config, }); @@ -277,8 +297,8 @@ export class Account { throw new Error(`status code not found in response: ${httpRes}`); } - const res: operations.AccountAddressDeleteResponse = - new operations.AccountAddressDeleteResponse({ + const res: operations.AccountAddressEditResponse = + new operations.AccountAddressEditResponse({ statusCode: httpRes.status, contentType: responseContentType, rawResponse: httpRes, @@ -286,12 +306,11 @@ export class Account { const decodedRes = new TextDecoder().decode(httpRes?.data); switch (true) { case httpRes?.status == 200: - break; - case httpRes?.status >= 400 && httpRes?.status < 500: if (utils.matchContentType(responseContentType, `application/json`)) { - const err = utils.objectToClass(JSON.parse(decodedRes), errors.ErrorT); - err.rawResponse = httpRes; - throw new errors.ErrorT(err); + res.addressListing = utils.objectToClass( + JSON.parse(decodedRes), + components.AddressListing + ); } else { throw new errors.SDKError( "unknown content-type received: " + responseContentType, @@ -301,53 +320,43 @@ export class Account { ); } break; - case httpRes?.status >= 500 && httpRes?.status < 600: + case (httpRes?.status >= 400 && httpRes?.status < 500) || + (httpRes?.status >= 500 && httpRes?.status < 600): throw new errors.SDKError( "API error occurred", httpRes.status, decodedRes, httpRes ); + default: + break; } return res; } /** - * Edit an existing address + * Delete an existing address * * @remarks - * Edit an existing address on the shopper's account. This does not edit addresses - * that are already associated with other resources, such as transactions or - * shipments. + * Delete an existing address. Deleting an address does not invalidate transactions or + * shipments that are associated with it. * */ - async updateAddress( + async deleteAddress( id: string, xPublishableKey: string, - addressListing: components.AddressListingInput, config?: AxiosRequestConfig - ): Promise { - const req = new operations.AccountAddressEditRequest({ + ): Promise { + const req = new operations.AccountAddressDeleteRequest({ id: id, xPublishableKey: xPublishableKey, - addressListing: addressListing, }); const baseURL: string = utils.templateUrl( this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults ); const operationUrl: string = utils.generateURL(baseURL, "/account/addresses/{id}", req); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "addressListing", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } const client: AxiosInstance = this.sdkConfiguration.defaultClient; let globalSecurity = this.sdkConfiguration.security; if (typeof globalSecurity === "function") { @@ -359,11 +368,9 @@ export class Account { const properties = utils.parseSecurityProperties(globalSecurity); const headers: RawAxiosRequestHeaders = { ...utils.getHeadersFromRequest(req), - ...reqBodyHeaders, ...config?.headers, ...properties.headers, }; - if (reqBody == null) throw new Error("request body is required"); headers["Accept"] = "application/json"; headers["user-agent"] = this.sdkConfiguration.userAgent; @@ -371,10 +378,9 @@ export class Account { const httpRes: AxiosResponse = await client.request({ validateStatus: () => true, url: operationUrl, - method: "put", + method: "delete", headers: headers, responseType: "arraybuffer", - data: reqBody, ...config, }); @@ -384,20 +390,19 @@ export class Account { throw new Error(`status code not found in response: ${httpRes}`); } - const res: operations.AccountAddressEditResponse = - new operations.AccountAddressEditResponse({ + const res: operations.AccountAddressDeleteResponse = + new operations.AccountAddressDeleteResponse({ statusCode: httpRes.status, contentType: responseContentType, rawResponse: httpRes, }); const decodedRes = new TextDecoder().decode(httpRes?.data); switch (true) { - case httpRes?.status == 200: + case httpRes?.status >= 400 && httpRes?.status < 500: if (utils.matchContentType(responseContentType, `application/json`)) { - res.addressListing = utils.objectToClass( - JSON.parse(decodedRes), - components.AddressListing - ); + const err = utils.objectToClass(JSON.parse(decodedRes), errors.ErrorT); + err.rawResponse = httpRes; + throw new errors.ErrorT(err); } else { throw new errors.SDKError( "unknown content-type received: " + responseContentType, @@ -407,14 +412,15 @@ export class Account { ); } break; - case (httpRes?.status >= 400 && httpRes?.status < 500) || - (httpRes?.status >= 500 && httpRes?.status < 600): + case httpRes?.status >= 500 && httpRes?.status < 600: throw new errors.SDKError( "API error occurred", httpRes.status, decodedRes, httpRes ); + default: + break; } return res; @@ -481,8 +487,6 @@ export class Account { }); const decodedRes = new TextDecoder().decode(httpRes?.data); switch (true) { - case httpRes?.status == 200: - break; case httpRes?.status >= 400 && httpRes?.status < 500: if (utils.matchContentType(responseContentType, `application/json`)) { const err = utils.objectToClass(JSON.parse(decodedRes), errors.ErrorT); @@ -504,6 +508,8 @@ export class Account { decodedRes, httpRes ); + default: + break; } return res; @@ -607,6 +613,8 @@ export class Account { decodedRes, httpRes ); + default: + break; } return res; @@ -679,8 +687,6 @@ export class Account { }); const decodedRes = new TextDecoder().decode(httpRes?.data); switch (true) { - case httpRes?.status == 200: - break; case httpRes?.status >= 400 && httpRes?.status < 500: if (utils.matchContentType(responseContentType, `application/json`)) { const err = utils.objectToClass(JSON.parse(decodedRes), errors.ErrorT); @@ -702,6 +708,8 @@ export class Account { decodedRes, httpRes ); + default: + break; } return res; diff --git a/src/sdk/guest.ts b/src/sdk/guest.ts index 24c6251..3017800 100644 --- a/src/sdk/guest.ts +++ b/src/sdk/guest.ts @@ -126,6 +126,8 @@ export class Guest { decodedRes, httpRes ); + default: + break; } return res; @@ -242,6 +244,8 @@ export class Guest { decodedRes, httpRes ); + default: + break; } return res; @@ -358,6 +362,8 @@ export class Guest { decodedRes, httpRes ); + default: + break; } return res; diff --git a/src/sdk/loggedin.ts b/src/sdk/loggedin.ts index 86f93dc..9d5963f 100644 --- a/src/sdk/loggedin.ts +++ b/src/sdk/loggedin.ts @@ -129,6 +129,8 @@ export class LoggedIn { decodedRes, httpRes ); + default: + break; } return res; @@ -247,6 +249,8 @@ export class LoggedIn { decodedRes, httpRes ); + default: + break; } return res; @@ -365,6 +369,8 @@ export class LoggedIn { decodedRes, httpRes ); + default: + break; } return res; diff --git a/src/sdk/oauth.ts b/src/sdk/oauth.ts index aac82d3..4fc18f3 100644 --- a/src/sdk/oauth.ts +++ b/src/sdk/oauth.ts @@ -133,6 +133,8 @@ export class OAuth { decodedRes, httpRes ); + default: + break; } return res; diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 4964b17..3831be5 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -62,9 +62,9 @@ export class SDKConfiguration { serverDefaults: any; language = "typescript"; openapiDocVersion = "3.0.1"; - sdkVersion = "0.2.4"; - genVersion = "2.210.6"; - userAgent = "speakeasy-sdk/typescript 0.2.4 2.210.6 3.0.1 @boltpay/bolt-typescript-sdk"; + sdkVersion = "0.3.0"; + genVersion = "2.213.3"; + userAgent = "speakeasy-sdk/typescript 0.3.0 2.213.3 3.0.1 @boltpay/bolt-typescript-sdk"; retryConfig?: utils.RetryConfig; public constructor(init?: Partial) { Object.assign(this, init); diff --git a/src/sdk/testing.ts b/src/sdk/testing.ts index 0205e9d..17b16f8 100644 --- a/src/sdk/testing.ts +++ b/src/sdk/testing.ts @@ -136,6 +136,8 @@ export class Testing { decodedRes, httpRes ); + default: + break; } return res; @@ -227,6 +229,8 @@ export class Testing { decodedRes, httpRes ); + default: + break; } return res;