From 67a003f2628e3ee663823b792b999e7eca2bc7ac Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 19 Jul 2024 04:21:30 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.344.0 --- .speakeasy/gen.lock | 99 ++++---- .speakeasy/workflow.lock | 10 +- README.md | 16 +- RELEASES.md | 12 +- .../models/components/paymentupdaterequest.md | 8 - docs/models/errors/errort.md | 4 +- docs/models/errors/fielderror.md | 4 +- .../errors/guestpaymentsupdateresponsebody.md | 19 -- .../errors/paymentsupdateresponsebody.md | 19 -- .../operations/guestpaymentsupdaterequest.md | 11 - .../operations/guestpaymentsupdateresponse.md | 11 - .../operations/guestpaymentsupdatesecurity.md | 8 - .../operations/paymentsupdaterequest.md | 11 - .../operations/paymentsupdateresponse.md | 11 - docs/sdks/guest/README.md | 108 --------- docs/sdks/loggedin/README.md | 111 --------- gen.yaml | 2 +- jsr.json | 2 +- package-lock.json | 4 +- package.json | 2 +- src/lib/config.ts | 8 +- src/lib/encodings.ts | 30 ++- src/models/components/index.ts | 1 - src/models/components/paymentupdaterequest.ts | 46 ---- src/models/errors/error.ts | 42 ---- src/models/errors/fielderror.ts | 42 ---- src/models/errors/guestpaymentsupdate.ts | 47 ---- src/models/errors/index.ts | 2 - src/models/errors/paymentsupdate.ts | 47 ---- src/models/operations/guestpaymentsupdate.ts | 220 ------------------ src/models/operations/index.ts | 2 - src/models/operations/paymentsupdate.ts | 168 ------------- src/sdk/guest.ts | 105 --------- src/sdk/loggedin.ts | 98 -------- src/sdk/payments.ts | 10 +- src/sdk/sdk.ts | 10 +- 36 files changed, 111 insertions(+), 1239 deletions(-) delete mode 100644 docs/models/components/paymentupdaterequest.md delete mode 100644 docs/models/errors/guestpaymentsupdateresponsebody.md delete mode 100644 docs/models/errors/paymentsupdateresponsebody.md delete mode 100644 docs/models/operations/guestpaymentsupdaterequest.md delete mode 100644 docs/models/operations/guestpaymentsupdateresponse.md delete mode 100644 docs/models/operations/guestpaymentsupdatesecurity.md delete mode 100644 docs/models/operations/paymentsupdaterequest.md delete mode 100644 docs/models/operations/paymentsupdateresponse.md delete mode 100644 src/models/components/paymentupdaterequest.ts delete mode 100644 src/models/errors/guestpaymentsupdate.ts delete mode 100644 src/models/errors/paymentsupdate.ts delete mode 100644 src/models/operations/guestpaymentsupdate.ts delete mode 100644 src/models/operations/paymentsupdate.ts diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index c952a1f..9795d76 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: 1c6f0a40f6a34b5758d83681c80c8538 - docVersion: 3.1.1 - speakeasyVersion: 1.337.1 - generationVersion: 2.373.2 - releaseVersion: 0.18.0 - configChecksum: 53969aeb13fadf716b60f94bca566c60 + docChecksum: 8c2776c2cbcdc065c8bb4d1442f50ef5 + docVersion: 3.2.0 + speakeasyVersion: 1.344.0 + generationVersion: 2.376.0 + releaseVersion: 0.19.0 + configChecksum: 2698678ca33723eee1d35dfef136b3af repoURL: https://github.com/BoltApp/Bolt-Typescript-SDK.git repoSubDirectory: . installationURL: https://github.com/BoltApp/Bolt-Typescript-SDK @@ -29,14 +29,14 @@ features: responseFormat: 0.2.3 retries: 2.83.0 sdkHooks: 0.1.0 - unions: 2.85.5 + unions: 2.85.6 generatedFiles: - src/sdk/account.ts - - src/sdk/guest.ts - src/sdk/loggedin.ts + - src/sdk/guest.ts - src/sdk/payments.ts - - src/sdk/oauth.ts - src/sdk/orders.ts + - src/sdk/oauth.ts - src/sdk/testing.ts - src/sdk/sdk.ts - .eslintrc.cjs @@ -71,14 +71,12 @@ generatedFiles: - src/models/operations/accountaddressdelete.ts - src/models/operations/accountaddpaymentmethod.ts - src/models/operations/accountpaymentmethoddelete.ts - - src/models/operations/guestpaymentsinitialize.ts - - src/models/operations/guestpaymentsupdate.ts - - src/models/operations/guestpaymentsaction.ts - src/models/operations/paymentsinitialize.ts - - src/models/operations/paymentsupdate.ts - src/models/operations/paymentsaction.ts - - src/models/operations/oauthgettoken.ts + - src/models/operations/guestpaymentsinitialize.ts + - src/models/operations/guestpaymentsaction.ts - src/models/operations/orderscreate.ts + - src/models/operations/oauthgettoken.ts - src/models/operations/testingaccountcreate.ts - src/models/operations/testingaccountphoneget.ts - src/models/operations/testingcreditcardget.ts @@ -105,24 +103,23 @@ generatedFiles: - src/models/components/paymentresponsefinalized.ts - src/models/components/transaction.ts - src/models/components/paymentresponsepending.ts - - src/models/components/guestpaymentinitializerequest.ts + - src/models/components/paymentinitializerequest.ts + - src/models/components/paymentmethodextended.ts + - src/models/components/paymentmethodreference.ts - src/models/components/cart.ts - src/models/components/amount.ts - src/models/components/cartitem.ts - src/models/components/cartdiscount.ts - src/models/components/cartshipment.ts - - src/models/components/profilecreationdata.ts - - src/models/components/paymentupdaterequest.ts - src/models/components/paymentactionrequest.ts - - src/models/components/paymentinitializerequest.ts - - src/models/components/paymentmethodextended.ts - - src/models/components/paymentmethodreference.ts + - src/models/components/guestpaymentinitializerequest.ts + - src/models/components/profilecreationdata.ts + - src/models/components/orderresponse.ts + - src/models/components/order.ts - src/models/components/getaccesstokenresponse.ts - src/models/components/tokenrequest.ts - src/models/components/authorizationcoderequest.ts - src/models/components/refreshtokenrequest.ts - - src/models/components/orderresponse.ts - - src/models/components/order.ts - src/models/components/accounttestcreationdataoutput.ts - src/models/components/accounttestphonedata.ts - src/models/components/testcreditcard.ts @@ -136,15 +133,13 @@ generatedFiles: - src/models/errors/accountaddpaymentmethod.ts - src/models/errors/creditcarderror.ts - src/models/errors/accountpaymentmethoddelete.ts - - src/models/errors/guestpaymentsinitialize.ts - - src/models/errors/carterror.ts - - src/models/errors/guestpaymentsupdate.ts - - src/models/errors/guestpaymentsaction.ts - src/models/errors/paymentsinitialize.ts - - src/models/errors/paymentsupdate.ts + - src/models/errors/carterror.ts - src/models/errors/paymentsaction.ts - - src/models/errors/oauthgettoken.ts + - src/models/errors/guestpaymentsinitialize.ts + - src/models/errors/guestpaymentsaction.ts - src/models/errors/orderscreate.ts + - src/models/errors/oauthgettoken.ts - src/models/errors/testingaccountcreate.ts - src/models/errors/testingaccountphoneget.ts - src/models/errors/testingcreditcardget.ts @@ -163,26 +158,21 @@ generatedFiles: - docs/models/operations/accountaddpaymentmethodresponse.md - docs/models/operations/accountpaymentmethoddeleterequest.md - docs/models/operations/accountpaymentmethoddeleteresponse.md + - docs/models/operations/paymentsinitializerequest.md + - docs/models/operations/paymentsinitializeresponse.md + - docs/models/operations/paymentsactionrequest.md + - docs/models/operations/paymentsactionresponse.md - docs/models/operations/guestpaymentsinitializesecurity.md - docs/models/operations/guestpaymentsinitializerequest.md - docs/models/operations/guestpaymentsinitializeresponse.md - - docs/models/operations/guestpaymentsupdatesecurity.md - - docs/models/operations/guestpaymentsupdaterequest.md - - docs/models/operations/guestpaymentsupdateresponse.md - docs/models/operations/guestpaymentsactionsecurity.md - docs/models/operations/guestpaymentsactionrequest.md - docs/models/operations/guestpaymentsactionresponse.md - - docs/models/operations/paymentsinitializerequest.md - - docs/models/operations/paymentsinitializeresponse.md - - docs/models/operations/paymentsupdaterequest.md - - docs/models/operations/paymentsupdateresponse.md - - docs/models/operations/paymentsactionrequest.md - - docs/models/operations/paymentsactionresponse.md - - docs/models/operations/oauthgettokenrequest.md - - docs/models/operations/oauthgettokenresponse.md - docs/models/operations/orderscreatesecurity.md - docs/models/operations/orderscreaterequest.md - docs/models/operations/orderscreateresponse.md + - docs/models/operations/oauthgettokenrequest.md + - docs/models/operations/oauthgettokenresponse.md - docs/models/operations/testingaccountcreatesecurity.md - docs/models/operations/testingaccountcreaterequest.md - docs/models/operations/testingaccountcreateresponse.md @@ -238,21 +228,22 @@ generatedFiles: - docs/models/components/paymentresponsependingstatus.md - docs/models/components/action.md - docs/models/components/paymentresponsepending.md - - docs/models/components/guestpaymentinitializerequest.md + - docs/models/components/paymentinitializerequest.md + - docs/models/components/paymentmethodextended.md + - docs/models/components/paymentmethodreferencetag.md + - docs/models/components/paymentmethodreference.md - docs/models/components/cart.md - docs/models/components/currency.md - docs/models/components/amount.md - docs/models/components/cartitem.md - docs/models/components/cartdiscount.md - docs/models/components/cartshipment.md - - docs/models/components/profilecreationdata.md - - docs/models/components/paymentupdaterequest.md - docs/models/components/paymentactionrequesttag.md - docs/models/components/paymentactionrequest.md - - docs/models/components/paymentinitializerequest.md - - docs/models/components/paymentmethodextended.md - - docs/models/components/paymentmethodreferencetag.md - - docs/models/components/paymentmethodreference.md + - docs/models/components/guestpaymentinitializerequest.md + - docs/models/components/profilecreationdata.md + - docs/models/components/orderresponse.md + - docs/models/components/order.md - docs/models/components/getaccesstokenresponse.md - docs/models/components/tokenrequest.md - docs/models/components/granttype.md @@ -261,8 +252,6 @@ generatedFiles: - docs/models/components/refreshtokenrequestgranttype.md - docs/models/components/refreshtokenrequestscope.md - docs/models/components/refreshtokenrequest.md - - docs/models/components/orderresponse.md - - docs/models/components/order.md - docs/models/components/emailstate.md - docs/models/components/phonestate.md - docs/models/components/accounttestcreationdataoutput.md @@ -282,16 +271,14 @@ generatedFiles: - docs/models/errors/schemascreditcarderrortag.md - docs/models/errors/creditcarderror.md - docs/models/errors/accountpaymentmethoddeleteresponsebody.md - - docs/models/errors/guestpaymentsinitializeresponsebody.md + - docs/models/errors/paymentsinitializeresponsebody.md - docs/models/errors/schemascarterrortag.md - docs/models/errors/carterror.md - - docs/models/errors/guestpaymentsupdateresponsebody.md - - docs/models/errors/guestpaymentsactionresponsebody.md - - docs/models/errors/paymentsinitializeresponsebody.md - - docs/models/errors/paymentsupdateresponsebody.md - docs/models/errors/paymentsactionresponsebody.md - - docs/models/errors/oauthgettokenresponsebody.md + - docs/models/errors/guestpaymentsinitializeresponsebody.md + - docs/models/errors/guestpaymentsactionresponsebody.md - docs/models/errors/orderscreateresponsebody.md + - docs/models/errors/oauthgettokenresponsebody.md - docs/models/errors/testingaccountcreateresponsebody.md - docs/models/errors/testingaccountphonegetresponsebody.md - docs/models/errors/testingcreditcardgetresponsebody.md @@ -299,10 +286,10 @@ generatedFiles: - docs/lib/utils/retryconfig.md - docs/sdks/account/README.md - docs/sdks/payments/README.md - - docs/sdks/guest/README.md - docs/sdks/loggedin/README.md - - docs/sdks/oauth/README.md + - docs/sdks/guest/README.md - docs/sdks/orders/README.md + - docs/sdks/oauth/README.md - docs/sdks/testing/README.md - USAGE.md - .gitattributes diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index ada3680..b2fc2ff 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.337.1 +speakeasyVersion: 1.344.0 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:a29c38c34ea084412a21ec783cc9e0ecc2ad18bb42fd6caa7a45132d75063024 - sourceBlobDigest: sha256:a17e5df430bc16f512ae76c093dd0dcd353e4994a539061a27c0575f157717d5 + sourceRevisionDigest: sha256:98e7ad9f70d219b7521618106928a1700247c2ef42f15199268b5c315b9514e3 + sourceBlobDigest: sha256:e23f694ae3f097bdcc023f6204f8521ecfa8dbb529379ae76560df4dc819c093 tags: - latest - main @@ -11,8 +11,8 @@ targets: bolt-typescript: source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:a29c38c34ea084412a21ec783cc9e0ecc2ad18bb42fd6caa7a45132d75063024 - sourceBlobDigest: sha256:a17e5df430bc16f512ae76c093dd0dcd353e4994a539061a27c0575f157717d5 + sourceRevisionDigest: sha256:98e7ad9f70d219b7521618106928a1700247c2ef42f15199268b5c315b9514e3 + sourceBlobDigest: sha256:e23f694ae3f097bdcc023f6204f8521ecfa8dbb529379ae76560df4dc819c093 outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/README.md b/README.md index 21feb89..09b788d 100644 --- a/README.md +++ b/README.md @@ -74,26 +74,24 @@ run(); * [deletePaymentMethod](docs/sdks/account/README.md#deletepaymentmethod) - Delete an existing payment method -### [payments.guest](docs/sdks/guest/README.md) - -* [initialize](docs/sdks/guest/README.md#initialize) - Initialize a Bolt payment for guest shoppers -* [update](docs/sdks/guest/README.md#update) - Update a pending guest payment -* [performAction](docs/sdks/guest/README.md#performaction) - Finalize a pending guest payment - ### [payments.loggedIn](docs/sdks/loggedin/README.md) * [initialize](docs/sdks/loggedin/README.md#initialize) - Initialize a Bolt payment for logged in shoppers -* [update](docs/sdks/loggedin/README.md#update) - Update a pending payment * [performAction](docs/sdks/loggedin/README.md#performaction) - Finalize a pending payment -### [oAuth](docs/sdks/oauth/README.md) +### [payments.guest](docs/sdks/guest/README.md) -* [getToken](docs/sdks/oauth/README.md#gettoken) - Get OAuth token +* [initialize](docs/sdks/guest/README.md#initialize) - Initialize a Bolt payment for guest shoppers +* [performAction](docs/sdks/guest/README.md#performaction) - Finalize a pending guest payment ### [orders](docs/sdks/orders/README.md) * [ordersCreate](docs/sdks/orders/README.md#orderscreate) - Create an order that was prepared outside the Bolt ecosystem. +### [oAuth](docs/sdks/oauth/README.md) + +* [getToken](docs/sdks/oauth/README.md#gettoken) - Get OAuth token + ### [testing](docs/sdks/testing/README.md) * [createAccount](docs/sdks/testing/README.md#createaccount) - Create a test account diff --git a/RELEASES.md b/RELEASES.md index ba62e15..38c5345 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -538,4 +538,14 @@ Based on: ### Generated - [typescript v0.18.0] . ### Releases -- [NPM v0.18.0] https://www.npmjs.com/package/@boltpay/bolt-typescript-sdk/v/0.18.0 - . \ No newline at end of file +- [NPM v0.18.0] https://www.npmjs.com/package/@boltpay/bolt-typescript-sdk/v/0.18.0 - . + +## 2024-07-19 04:20:41 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.344.0 (2.376.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.19.0] . +### Releases +- [NPM v0.19.0] https://www.npmjs.com/package/@boltpay/bolt-typescript-sdk/v/0.19.0 - . \ No newline at end of file diff --git a/docs/models/components/paymentupdaterequest.md b/docs/models/components/paymentupdaterequest.md deleted file mode 100644 index aed4f99..0000000 --- a/docs/models/components/paymentupdaterequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# PaymentUpdateRequest - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -| `cart` | [components.Cart](../../models/components/cart.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/errors/errort.md b/docs/models/errors/errort.md index 4efb764..106fa3f 100644 --- a/docs/models/errors/errort.md +++ b/docs/models/errors/errort.md @@ -21,6 +21,4 @@ | `rawResponse11` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | | `rawResponse12` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | | `rawResponse13` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | -| `rawResponse14` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | -| `rawResponse15` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | -| `rawResponse16` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| `rawResponse14` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/docs/models/errors/fielderror.md b/docs/models/errors/fielderror.md index 7988e7c..df8628b 100644 --- a/docs/models/errors/fielderror.md +++ b/docs/models/errors/fielderror.md @@ -24,6 +24,4 @@ An error that pertains to validation of a specific field in the request. | `rawResponse11` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | | `rawResponse12` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | | `rawResponse13` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | -| `rawResponse14` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | -| `rawResponse15` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | -| `rawResponse16` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| `rawResponse14` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/docs/models/errors/guestpaymentsupdateresponsebody.md b/docs/models/errors/guestpaymentsupdateresponsebody.md deleted file mode 100644 index 8d25782..0000000 --- a/docs/models/errors/guestpaymentsupdateresponsebody.md +++ /dev/null @@ -1,19 +0,0 @@ -# GuestPaymentsUpdateResponseBody - -An error has occurred, and further details are contained in the response - - -## Supported Types - -### `errors.ErrorT` - -```typescript -const value: errors.ErrorT = /* values here */ -``` - -### `errors.FieldError` - -```typescript -const value: errors.FieldError = /* values here */ -``` - diff --git a/docs/models/errors/paymentsupdateresponsebody.md b/docs/models/errors/paymentsupdateresponsebody.md deleted file mode 100644 index 54bbdf7..0000000 --- a/docs/models/errors/paymentsupdateresponsebody.md +++ /dev/null @@ -1,19 +0,0 @@ -# PaymentsUpdateResponseBody - -An error has occurred, and further details are contained in the response - - -## Supported Types - -### `errors.ErrorT` - -```typescript -const value: errors.ErrorT = /* values here */ -``` - -### `errors.FieldError` - -```typescript -const value: errors.FieldError = /* values here */ -``` - diff --git a/docs/models/operations/guestpaymentsupdaterequest.md b/docs/models/operations/guestpaymentsupdaterequest.md deleted file mode 100644 index a3958c0..0000000 --- a/docs/models/operations/guestpaymentsupdaterequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# GuestPaymentsUpdateRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The ID of the guest payment to update | iKv7t5bgt1gg | -| `xPublishableKey` | *string* | :heavy_check_mark: | The publicly shareable identifier used to identify your Bolt merchant division. | | -| `xMerchantClientId` | *string* | :heavy_check_mark: | A unique identifier for a shopper's device, generated by Bolt. This header is required for proper attribution of this operation to your analytics reports. Omitting this header may result in incorrect statistics. | | -| `paymentUpdateRequest` | [components.PaymentUpdateRequest](../../models/components/paymentupdaterequest.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/guestpaymentsupdateresponse.md b/docs/models/operations/guestpaymentsupdateresponse.md deleted file mode 100644 index 2e27e51..0000000 --- a/docs/models/operations/guestpaymentsupdateresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GuestPaymentsUpdateResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `paymentResponse` | *components.PaymentResponse* | :heavy_minus_sign: | The pending payment was successfully updated | \ No newline at end of file diff --git a/docs/models/operations/guestpaymentsupdatesecurity.md b/docs/models/operations/guestpaymentsupdatesecurity.md deleted file mode 100644 index 09bfb3a..0000000 --- a/docs/models/operations/guestpaymentsupdatesecurity.md +++ /dev/null @@ -1,8 +0,0 @@ -# GuestPaymentsUpdateSecurity - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `apiKey` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/paymentsupdaterequest.md b/docs/models/operations/paymentsupdaterequest.md deleted file mode 100644 index cb6e810..0000000 --- a/docs/models/operations/paymentsupdaterequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# PaymentsUpdateRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The ID of the payment to update | iKv7t5bgt1gg | -| `xPublishableKey` | *string* | :heavy_check_mark: | The publicly shareable identifier used to identify your Bolt merchant division. | | -| `xMerchantClientId` | *string* | :heavy_check_mark: | A unique identifier for a shopper's device, generated by Bolt. This header is required for proper attribution of this operation to your analytics reports. Omitting this header may result in incorrect statistics. | | -| `paymentUpdateRequest` | [components.PaymentUpdateRequest](../../models/components/paymentupdaterequest.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/paymentsupdateresponse.md b/docs/models/operations/paymentsupdateresponse.md deleted file mode 100644 index 3c37bea..0000000 --- a/docs/models/operations/paymentsupdateresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# PaymentsUpdateResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `paymentResponse` | *components.PaymentResponse* | :heavy_minus_sign: | The pending payment was successfully updated | \ No newline at end of file diff --git a/docs/sdks/guest/README.md b/docs/sdks/guest/README.md index 4bb326c..cef8026 100644 --- a/docs/sdks/guest/README.md +++ b/docs/sdks/guest/README.md @@ -4,7 +4,6 @@ ### Available Operations * [initialize](#initialize) - Initialize a Bolt payment for guest shoppers -* [update](#update) - Update a pending guest payment * [performAction](#performaction) - Finalize a pending guest payment ## initialize @@ -122,113 +121,6 @@ run(); | errors.GuestPaymentsInitializeResponseBody | 4XX | application/json | | errors.SDKError | 4xx-5xx | */* | -## update - -Update a guest payment that is still in the pending state, with new information about the payment. - -### Example Usage - -```typescript -import { BoltTypescriptSDK } from "@boltpay/bolt-typescript-sdk"; -import { AddressReferenceExplicitTag, CountryCode, Currency } from "@boltpay/bolt-typescript-sdk/models/components"; - -const boltTypescriptSDK = new BoltTypescriptSDK(); - -async function run() { - const result = await boltTypescriptSDK.payments.guest.update("", "iKv7t5bgt1gg", "", "", { - cart: { - orderReference: "order_100", - orderDescription: "Order #1234567890", - displayId: "215614191", - shipments: [ - { - address: { - dotTag: AddressReferenceExplicitTag.Explicit, - 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", - }, - cost: { - currency: Currency.Usd, - units: 900, - }, - carrier: "FedEx", - }, - ], - discounts: [ - { - amount: { - currency: Currency.Usd, - units: 900, - }, - code: "SUMMER10DISCOUNT", - detailsUrl: "https://www.example.com/SUMMER-SALE", - }, - ], - items: [ - { - name: "Bolt Swag Bag", - reference: "item_100", - description: "Large tote with Bolt logo.", - totalAmount: { - currency: Currency.Usd, - units: 900, - }, - unitPrice: 1000, - quantity: 1, - imageUrl: "https://www.example.com/products/123456/images/1.png", - }, - ], - total: { - currency: Currency.Usd, - units: 900, - }, - tax: { - currency: Currency.Usd, - units: 900, - }, - }, - }); - - // Handle the result - console.log(result) -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `security` | [operations.GuestPaymentsUpdateSecurity](../../models/operations/guestpaymentsupdatesecurity.md) | :heavy_check_mark: | The security requirements to use for the request. | | -| `id` | *string* | :heavy_check_mark: | The ID of the guest payment to update | [object Object] | -| `xPublishableKey` | *string* | :heavy_check_mark: | The publicly shareable identifier used to identify your Bolt merchant division. | | -| `xMerchantClientId` | *string* | :heavy_check_mark: | A unique identifier for a shopper's device, generated by Bolt. This header is required for proper attribution of this operation to your analytics reports. Omitting this header may result in incorrect statistics. | | -| `paymentUpdateRequest` | [components.PaymentUpdateRequest](../../models/components/paymentupdaterequest.md) | :heavy_check_mark: | N/A | | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | | - - -### Response - -**Promise\<[operations.GuestPaymentsUpdateResponse](../../models/operations/guestpaymentsupdateresponse.md)\>** -### Errors - -| Error Object | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| errors.GuestPaymentsUpdateResponseBody | 4XX | application/json | -| errors.SDKError | 4xx-5xx | */* | - ## performAction Finalize a pending payment being made by a Bolt guest shopper. Upon receipt of a finalized payment result, payment success should be communicated to the shopper. diff --git a/docs/sdks/loggedin/README.md b/docs/sdks/loggedin/README.md index 85a5b24..32e1db4 100644 --- a/docs/sdks/loggedin/README.md +++ b/docs/sdks/loggedin/README.md @@ -4,7 +4,6 @@ ### Available Operations * [initialize](#initialize) - Initialize a Bolt payment for logged in shoppers -* [update](#update) - Update a pending payment * [performAction](#performaction) - Finalize a pending payment ## initialize @@ -111,116 +110,6 @@ run(); | errors.PaymentsInitializeResponseBody | 4XX | application/json | | errors.SDKError | 4xx-5xx | */* | -## update - -Update a payment that is still in the pending state, with new information about the payment. - -### Example Usage - -```typescript -import { BoltTypescriptSDK } from "@boltpay/bolt-typescript-sdk"; -import { AddressReferenceExplicitTag, CountryCode, Currency } from "@boltpay/bolt-typescript-sdk/models/components"; - -const boltTypescriptSDK = new BoltTypescriptSDK({ - security: { - oauth: "", - }, -}); - -async function run() { - const result = await boltTypescriptSDK.payments.loggedIn.update("iKv7t5bgt1gg", "", "", { - cart: { - orderReference: "order_100", - orderDescription: "Order #1234567890", - displayId: "215614191", - shipments: [ - { - address: { - dotTag: AddressReferenceExplicitTag.Explicit, - 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", - }, - cost: { - currency: Currency.Usd, - units: 900, - }, - carrier: "FedEx", - }, - ], - discounts: [ - { - amount: { - currency: Currency.Usd, - units: 900, - }, - code: "SUMMER10DISCOUNT", - detailsUrl: "https://www.example.com/SUMMER-SALE", - }, - ], - items: [ - { - name: "Bolt Swag Bag", - reference: "item_100", - description: "Large tote with Bolt logo.", - totalAmount: { - currency: Currency.Usd, - units: 900, - }, - unitPrice: 1000, - quantity: 1, - imageUrl: "https://www.example.com/products/123456/images/1.png", - }, - ], - total: { - currency: Currency.Usd, - units: 900, - }, - tax: { - currency: Currency.Usd, - units: 900, - }, - }, - }); - - // Handle the result - console.log(result) -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The ID of the payment to update | [object Object] | -| `xPublishableKey` | *string* | :heavy_check_mark: | The publicly shareable identifier used to identify your Bolt merchant division. | | -| `xMerchantClientId` | *string* | :heavy_check_mark: | A unique identifier for a shopper's device, generated by Bolt. This header is required for proper attribution of this operation to your analytics reports. Omitting this header may result in incorrect statistics. | | -| `paymentUpdateRequest` | [components.PaymentUpdateRequest](../../models/components/paymentupdaterequest.md) | :heavy_check_mark: | N/A | | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | | - - -### Response - -**Promise\<[operations.PaymentsUpdateResponse](../../models/operations/paymentsupdateresponse.md)\>** -### Errors - -| Error Object | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.PaymentsUpdateResponseBody | 4XX | application/json | -| errors.SDKError | 4xx-5xx | */* | - ## performAction Finalize a pending payment being made by a Bolt logged-in shopper. Upon receipt of a finalized payment result, payment success should be communicated to the shopper. diff --git a/gen.yaml b/gen.yaml index 5d3b688..66d920a 100644 --- a/gen.yaml +++ b/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: false typescript: - version: 0.18.0 + version: 0.19.0 additionalDependencies: dependencies: {} devDependencies: {} diff --git a/jsr.json b/jsr.json index 94d52ab..d963d4d 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@boltpay/bolt-typescript-sdk", - "version": "0.18.0", + "version": "0.19.0", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 25732dd..eef6a38 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@boltpay/bolt-typescript-sdk", - "version": "0.18.0", + "version": "0.19.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@boltpay/bolt-typescript-sdk", - "version": "0.18.0", + "version": "0.19.0", "devDependencies": { "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", diff --git a/package.json b/package.json index d7f7147..0f811f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@boltpay/bolt-typescript-sdk", - "version": "0.18.0", + "version": "0.19.0", "author": "BoltPublicAPI", "main": "./index.js", "sideEffects": false, diff --git a/src/lib/config.ts b/src/lib/config.ts index 80ac411..71b0d09 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -70,8 +70,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", - openapiDocVersion: "3.1.1", - sdkVersion: "0.18.0", - genVersion: "2.373.2", - userAgent: "speakeasy-sdk/typescript 0.18.0 2.373.2 3.1.1 @boltpay/bolt-typescript-sdk", + openapiDocVersion: "3.2.0", + sdkVersion: "0.19.0", + genVersion: "2.376.0", + userAgent: "speakeasy-sdk/typescript 0.19.0 2.376.0 3.2.0 @boltpay/bolt-typescript-sdk", } as const; diff --git a/src/lib/encodings.ts b/src/lib/encodings.ts index 49f536b..9ddea67 100644 --- a/src/lib/encodings.ts +++ b/src/lib/encodings.ts @@ -212,6 +212,24 @@ export function encodeDeepObject( return ""; } + if (!isPlainObject(value)) { + throw new EncodingError( + `Value of parameter '${key}' which uses deepObject encoding must be an object`, + ); + } + + return encodeDeepObjectObject(key, value, options); +} + +export function encodeDeepObjectObject( + key: string, + value: unknown, + options?: { charEncoding?: "percent" | "none" }, +): string { + if (value == null) { + return ""; + } + let out = ""; const encodeString = (v: string) => { @@ -219,9 +237,7 @@ export function encodeDeepObject( }; if (!isPlainObject(value)) { - throw new EncodingError( - `Value of parameter '${key}' which uses deepObject encoding must be an object`, - ); + throw new EncodingError(`Expected parameter '${key}' to be an object.`); } Object.entries(value).forEach(([ck, cv]) => { @@ -232,9 +248,11 @@ export function encodeDeepObject( const pk = `${key}[${ck}]`; if (isPlainObject(cv)) { - throw new EncodingError( - `Value of parameter field '${pk}' cannot be an array or object.`, - ); + const objOut = encodeDeepObjectObject(pk, cv, options); + + out += `&${objOut}`; + + return; } const pairs: unknown[] = Array.isArray(cv) ? cv : [cv]; diff --git a/src/models/components/index.ts b/src/models/components/index.ts index 3f09965..1f225f2 100644 --- a/src/models/components/index.ts +++ b/src/models/components/index.ts @@ -39,7 +39,6 @@ export * from "./paymentmethodreference.js"; export * from "./paymentresponse.js"; export * from "./paymentresponsefinalized.js"; export * from "./paymentresponsepending.js"; -export * from "./paymentupdaterequest.js"; export * from "./profile.js"; export * from "./profilecreationdata.js"; export * from "./refreshtokenrequest.js"; diff --git a/src/models/components/paymentupdaterequest.ts b/src/models/components/paymentupdaterequest.ts deleted file mode 100644 index 91b8e23..0000000 --- a/src/models/components/paymentupdaterequest.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -import { Cart, Cart$inboundSchema, Cart$Outbound, Cart$outboundSchema } from "./cart.js"; -import * as z from "zod"; - -export type PaymentUpdateRequest = { - cart?: Cart | undefined; -}; - -/** @internal */ -export const PaymentUpdateRequest$inboundSchema: z.ZodType< - PaymentUpdateRequest, - z.ZodTypeDef, - unknown -> = z.object({ - cart: Cart$inboundSchema.optional(), -}); - -/** @internal */ -export type PaymentUpdateRequest$Outbound = { - cart?: Cart$Outbound | undefined; -}; - -/** @internal */ -export const PaymentUpdateRequest$outboundSchema: z.ZodType< - PaymentUpdateRequest$Outbound, - z.ZodTypeDef, - PaymentUpdateRequest -> = z.object({ - cart: Cart$outboundSchema.optional(), -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace PaymentUpdateRequest$ { - /** @deprecated use `PaymentUpdateRequest$inboundSchema` instead. */ - export const inboundSchema = PaymentUpdateRequest$inboundSchema; - /** @deprecated use `PaymentUpdateRequest$outboundSchema` instead. */ - export const outboundSchema = PaymentUpdateRequest$outboundSchema; - /** @deprecated use `PaymentUpdateRequest$Outbound` instead. */ - export type Outbound = PaymentUpdateRequest$Outbound; -} diff --git a/src/models/errors/error.ts b/src/models/errors/error.ts index be815fe..3d5d76a 100644 --- a/src/models/errors/error.ts +++ b/src/models/errors/error.ts @@ -84,14 +84,6 @@ export type ErrorTData = { * Raw HTTP response; suitable for custom response parsing */ rawResponse14?: Response | undefined; - /** - * Raw HTTP response; suitable for custom response parsing - */ - rawResponse15?: Response | undefined; - /** - * Raw HTTP response; suitable for custom response parsing - */ - rawResponse16?: Response | undefined; }; export class ErrorT extends Error { @@ -159,14 +151,6 @@ export class ErrorT extends Error { * Raw HTTP response; suitable for custom response parsing */ rawResponse14?: Response | undefined; - /** - * Raw HTTP response; suitable for custom response parsing - */ - rawResponse15?: Response | undefined; - /** - * Raw HTTP response; suitable for custom response parsing - */ - rawResponse16?: Response | undefined; /** The original data that was passed to this error instance. */ data$: ErrorTData; @@ -225,12 +209,6 @@ export class ErrorT extends Error { if (err.rawResponse14 != null) { this.rawResponse14 = err.rawResponse14; } - if (err.rawResponse15 != null) { - this.rawResponse15 = err.rawResponse15; - } - if (err.rawResponse16 != null) { - this.rawResponse16 = err.rawResponse16; - } this.name = "ErrorT"; } @@ -273,8 +251,6 @@ export const ErrorT$inboundSchema: z.ZodType = z RawResponse12: z.instanceof(Response).optional(), RawResponse13: z.instanceof(Response).optional(), RawResponse14: z.instanceof(Response).optional(), - RawResponse15: z.instanceof(Response).optional(), - RawResponse16: z.instanceof(Response).optional(), }) .transform((v) => { const remapped = remap$(v, { @@ -294,8 +270,6 @@ export const ErrorT$inboundSchema: z.ZodType = z RawResponse12: "rawResponse12", RawResponse13: "rawResponse13", RawResponse14: "rawResponse14", - RawResponse15: "rawResponse15", - RawResponse16: "rawResponse16", }); return new ErrorT(remapped); @@ -320,8 +294,6 @@ export type ErrorT$Outbound = { RawResponse12?: never | undefined; RawResponse13?: never | undefined; RawResponse14?: never | undefined; - RawResponse15?: never | undefined; - RawResponse16?: never | undefined; }; /** @internal */ @@ -423,18 +395,6 @@ export const ErrorT$outboundSchema: z.ZodType { - throw new Error("Response cannot be serialized"); - }) - .optional(), - rawResponse16: z - .instanceof(Response) - .transform(() => { - throw new Error("Response cannot be serialized"); - }) - .optional(), }) .transform((v) => { return remap$(v, { @@ -454,8 +414,6 @@ export const ErrorT$outboundSchema: z.ZodType { const remapped = remap$(v, { @@ -309,8 +285,6 @@ export const FieldError$inboundSchema: z.ZodType { - throw new Error("Response cannot be serialized"); - }) - .optional(), - rawResponse16: z - .instanceof(Response) - .transform(() => { - throw new Error("Response cannot be serialized"); - }) - .optional(), }) .transform((v) => { return remap$(v, { @@ -471,8 +431,6 @@ export const FieldError$outboundSchema: z.ZodType = z.union([ErrorT$inboundSchema, FieldError$inboundSchema]); - -/** @internal */ -export type GuestPaymentsUpdateResponseBody$Outbound = ErrorT$Outbound | FieldError$Outbound; - -/** @internal */ -export const GuestPaymentsUpdateResponseBody$outboundSchema: z.ZodType< - GuestPaymentsUpdateResponseBody$Outbound, - z.ZodTypeDef, - GuestPaymentsUpdateResponseBody -> = z.union([ErrorT$outboundSchema, FieldError$outboundSchema]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GuestPaymentsUpdateResponseBody$ { - /** @deprecated use `GuestPaymentsUpdateResponseBody$inboundSchema` instead. */ - export const inboundSchema = GuestPaymentsUpdateResponseBody$inboundSchema; - /** @deprecated use `GuestPaymentsUpdateResponseBody$outboundSchema` instead. */ - export const outboundSchema = GuestPaymentsUpdateResponseBody$outboundSchema; - /** @deprecated use `GuestPaymentsUpdateResponseBody$Outbound` instead. */ - export type Outbound = GuestPaymentsUpdateResponseBody$Outbound; -} diff --git a/src/models/errors/index.ts b/src/models/errors/index.ts index b42d90f..d69062c 100644 --- a/src/models/errors/index.ts +++ b/src/models/errors/index.ts @@ -14,12 +14,10 @@ export * from "./error.js"; export * from "./fielderror.js"; export * from "./guestpaymentsaction.js"; export * from "./guestpaymentsinitialize.js"; -export * from "./guestpaymentsupdate.js"; export * from "./oauthgettoken.js"; export * from "./orderscreate.js"; export * from "./paymentsaction.js"; export * from "./paymentsinitialize.js"; -export * from "./paymentsupdate.js"; export * from "./sdkerror.js"; export * from "./sdkvalidationerror.js"; export * from "./testingaccountcreate.js"; diff --git a/src/models/errors/paymentsupdate.ts b/src/models/errors/paymentsupdate.ts deleted file mode 100644 index 78510b0..0000000 --- a/src/models/errors/paymentsupdate.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -import { ErrorT, ErrorT$inboundSchema, ErrorT$Outbound, ErrorT$outboundSchema } from "./error.js"; -import { - FieldError, - FieldError$inboundSchema, - FieldError$Outbound, - FieldError$outboundSchema, -} from "./fielderror.js"; -import * as z from "zod"; - -/** - * An error has occurred, and further details are contained in the response - */ -export type PaymentsUpdateResponseBody = ErrorT | FieldError; - -/** @internal */ -export const PaymentsUpdateResponseBody$inboundSchema: z.ZodType< - PaymentsUpdateResponseBody, - z.ZodTypeDef, - unknown -> = z.union([ErrorT$inboundSchema, FieldError$inboundSchema]); - -/** @internal */ -export type PaymentsUpdateResponseBody$Outbound = ErrorT$Outbound | FieldError$Outbound; - -/** @internal */ -export const PaymentsUpdateResponseBody$outboundSchema: z.ZodType< - PaymentsUpdateResponseBody$Outbound, - z.ZodTypeDef, - PaymentsUpdateResponseBody -> = z.union([ErrorT$outboundSchema, FieldError$outboundSchema]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace PaymentsUpdateResponseBody$ { - /** @deprecated use `PaymentsUpdateResponseBody$inboundSchema` instead. */ - export const inboundSchema = PaymentsUpdateResponseBody$inboundSchema; - /** @deprecated use `PaymentsUpdateResponseBody$outboundSchema` instead. */ - export const outboundSchema = PaymentsUpdateResponseBody$outboundSchema; - /** @deprecated use `PaymentsUpdateResponseBody$Outbound` instead. */ - export type Outbound = PaymentsUpdateResponseBody$Outbound; -} diff --git a/src/models/operations/guestpaymentsupdate.ts b/src/models/operations/guestpaymentsupdate.ts deleted file mode 100644 index 3de4137..0000000 --- a/src/models/operations/guestpaymentsupdate.ts +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -import { remap as remap$ } from "../../lib/primitives.js"; -import * as components from "../components/index.js"; -import * as z from "zod"; - -export type GuestPaymentsUpdateSecurity = { - apiKey: string; -}; - -export type GuestPaymentsUpdateRequest = { - /** - * The ID of the guest payment to update - */ - id: string; - /** - * The publicly shareable identifier used to identify your Bolt merchant division. - */ - xPublishableKey: string; - /** - * A unique identifier for a shopper's device, generated by Bolt. This header is required for proper attribution of this operation to your analytics reports. Omitting this header may result in incorrect statistics. - */ - xMerchantClientId: string; - paymentUpdateRequest: components.PaymentUpdateRequest; -}; - -export type GuestPaymentsUpdateResponse = { - /** - * HTTP response content type for this operation - */ - contentType: string; - /** - * HTTP response status code for this operation - */ - statusCode: number; - /** - * Raw HTTP response; suitable for custom response parsing - */ - rawResponse: Response; - /** - * The pending payment was successfully updated - */ - paymentResponse?: components.PaymentResponse | undefined; -}; - -/** @internal */ -export const GuestPaymentsUpdateSecurity$inboundSchema: z.ZodType< - GuestPaymentsUpdateSecurity, - z.ZodTypeDef, - unknown -> = z - .object({ - "api-key": z.string(), - }) - .transform((v) => { - return remap$(v, { - "api-key": "apiKey", - }); - }); - -/** @internal */ -export type GuestPaymentsUpdateSecurity$Outbound = { - "api-key": string; -}; - -/** @internal */ -export const GuestPaymentsUpdateSecurity$outboundSchema: z.ZodType< - GuestPaymentsUpdateSecurity$Outbound, - z.ZodTypeDef, - GuestPaymentsUpdateSecurity -> = z - .object({ - apiKey: z.string(), - }) - .transform((v) => { - return remap$(v, { - apiKey: "api-key", - }); - }); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GuestPaymentsUpdateSecurity$ { - /** @deprecated use `GuestPaymentsUpdateSecurity$inboundSchema` instead. */ - export const inboundSchema = GuestPaymentsUpdateSecurity$inboundSchema; - /** @deprecated use `GuestPaymentsUpdateSecurity$outboundSchema` instead. */ - export const outboundSchema = GuestPaymentsUpdateSecurity$outboundSchema; - /** @deprecated use `GuestPaymentsUpdateSecurity$Outbound` instead. */ - export type Outbound = GuestPaymentsUpdateSecurity$Outbound; -} - -/** @internal */ -export const GuestPaymentsUpdateRequest$inboundSchema: z.ZodType< - GuestPaymentsUpdateRequest, - z.ZodTypeDef, - unknown -> = z - .object({ - id: z.string(), - "X-Publishable-Key": z.string(), - "X-Merchant-Client-Id": z.string(), - "payment-update-request": components.PaymentUpdateRequest$inboundSchema, - }) - .transform((v) => { - return remap$(v, { - "X-Publishable-Key": "xPublishableKey", - "X-Merchant-Client-Id": "xMerchantClientId", - "payment-update-request": "paymentUpdateRequest", - }); - }); - -/** @internal */ -export type GuestPaymentsUpdateRequest$Outbound = { - id: string; - "X-Publishable-Key": string; - "X-Merchant-Client-Id": string; - "payment-update-request": components.PaymentUpdateRequest$Outbound; -}; - -/** @internal */ -export const GuestPaymentsUpdateRequest$outboundSchema: z.ZodType< - GuestPaymentsUpdateRequest$Outbound, - z.ZodTypeDef, - GuestPaymentsUpdateRequest -> = z - .object({ - id: z.string(), - xPublishableKey: z.string(), - xMerchantClientId: z.string(), - paymentUpdateRequest: components.PaymentUpdateRequest$outboundSchema, - }) - .transform((v) => { - return remap$(v, { - xPublishableKey: "X-Publishable-Key", - xMerchantClientId: "X-Merchant-Client-Id", - paymentUpdateRequest: "payment-update-request", - }); - }); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GuestPaymentsUpdateRequest$ { - /** @deprecated use `GuestPaymentsUpdateRequest$inboundSchema` instead. */ - export const inboundSchema = GuestPaymentsUpdateRequest$inboundSchema; - /** @deprecated use `GuestPaymentsUpdateRequest$outboundSchema` instead. */ - export const outboundSchema = GuestPaymentsUpdateRequest$outboundSchema; - /** @deprecated use `GuestPaymentsUpdateRequest$Outbound` instead. */ - export type Outbound = GuestPaymentsUpdateRequest$Outbound; -} - -/** @internal */ -export const GuestPaymentsUpdateResponse$inboundSchema: z.ZodType< - GuestPaymentsUpdateResponse, - z.ZodTypeDef, - unknown -> = z - .object({ - ContentType: z.string(), - StatusCode: z.number().int(), - RawResponse: z.instanceof(Response), - "payment-response": components.PaymentResponse$inboundSchema.optional(), - }) - .transform((v) => { - return remap$(v, { - ContentType: "contentType", - StatusCode: "statusCode", - RawResponse: "rawResponse", - "payment-response": "paymentResponse", - }); - }); - -/** @internal */ -export type GuestPaymentsUpdateResponse$Outbound = { - ContentType: string; - StatusCode: number; - RawResponse: never; - "payment-response"?: components.PaymentResponse$Outbound | undefined; -}; - -/** @internal */ -export const GuestPaymentsUpdateResponse$outboundSchema: z.ZodType< - GuestPaymentsUpdateResponse$Outbound, - z.ZodTypeDef, - GuestPaymentsUpdateResponse -> = z - .object({ - contentType: z.string(), - statusCode: z.number().int(), - rawResponse: z.instanceof(Response).transform(() => { - throw new Error("Response cannot be serialized"); - }), - paymentResponse: components.PaymentResponse$outboundSchema.optional(), - }) - .transform((v) => { - return remap$(v, { - contentType: "ContentType", - statusCode: "StatusCode", - rawResponse: "RawResponse", - paymentResponse: "payment-response", - }); - }); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GuestPaymentsUpdateResponse$ { - /** @deprecated use `GuestPaymentsUpdateResponse$inboundSchema` instead. */ - export const inboundSchema = GuestPaymentsUpdateResponse$inboundSchema; - /** @deprecated use `GuestPaymentsUpdateResponse$outboundSchema` instead. */ - export const outboundSchema = GuestPaymentsUpdateResponse$outboundSchema; - /** @deprecated use `GuestPaymentsUpdateResponse$Outbound` instead. */ - export type Outbound = GuestPaymentsUpdateResponse$Outbound; -} diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index 8b9eec0..491b8be 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -10,12 +10,10 @@ export * from "./accountget.js"; export * from "./accountpaymentmethoddelete.js"; export * from "./guestpaymentsaction.js"; export * from "./guestpaymentsinitialize.js"; -export * from "./guestpaymentsupdate.js"; export * from "./oauthgettoken.js"; export * from "./orderscreate.js"; export * from "./paymentsaction.js"; export * from "./paymentsinitialize.js"; -export * from "./paymentsupdate.js"; export * from "./testingaccountcreate.js"; export * from "./testingaccountphoneget.js"; export * from "./testingcreditcardget.js"; diff --git a/src/models/operations/paymentsupdate.ts b/src/models/operations/paymentsupdate.ts deleted file mode 100644 index c3d3d3d..0000000 --- a/src/models/operations/paymentsupdate.ts +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -import { remap as remap$ } from "../../lib/primitives.js"; -import * as components from "../components/index.js"; -import * as z from "zod"; - -export type PaymentsUpdateRequest = { - /** - * The ID of the payment to update - */ - id: string; - /** - * The publicly shareable identifier used to identify your Bolt merchant division. - */ - xPublishableKey: string; - /** - * A unique identifier for a shopper's device, generated by Bolt. This header is required for proper attribution of this operation to your analytics reports. Omitting this header may result in incorrect statistics. - */ - xMerchantClientId: string; - paymentUpdateRequest: components.PaymentUpdateRequest; -}; - -export type PaymentsUpdateResponse = { - /** - * HTTP response content type for this operation - */ - contentType: string; - /** - * HTTP response status code for this operation - */ - statusCode: number; - /** - * Raw HTTP response; suitable for custom response parsing - */ - rawResponse: Response; - /** - * The pending payment was successfully updated - */ - paymentResponse?: components.PaymentResponse | undefined; -}; - -/** @internal */ -export const PaymentsUpdateRequest$inboundSchema: z.ZodType< - PaymentsUpdateRequest, - z.ZodTypeDef, - unknown -> = z - .object({ - id: z.string(), - "X-Publishable-Key": z.string(), - "X-Merchant-Client-Id": z.string(), - "payment-update-request": components.PaymentUpdateRequest$inboundSchema, - }) - .transform((v) => { - return remap$(v, { - "X-Publishable-Key": "xPublishableKey", - "X-Merchant-Client-Id": "xMerchantClientId", - "payment-update-request": "paymentUpdateRequest", - }); - }); - -/** @internal */ -export type PaymentsUpdateRequest$Outbound = { - id: string; - "X-Publishable-Key": string; - "X-Merchant-Client-Id": string; - "payment-update-request": components.PaymentUpdateRequest$Outbound; -}; - -/** @internal */ -export const PaymentsUpdateRequest$outboundSchema: z.ZodType< - PaymentsUpdateRequest$Outbound, - z.ZodTypeDef, - PaymentsUpdateRequest -> = z - .object({ - id: z.string(), - xPublishableKey: z.string(), - xMerchantClientId: z.string(), - paymentUpdateRequest: components.PaymentUpdateRequest$outboundSchema, - }) - .transform((v) => { - return remap$(v, { - xPublishableKey: "X-Publishable-Key", - xMerchantClientId: "X-Merchant-Client-Id", - paymentUpdateRequest: "payment-update-request", - }); - }); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace PaymentsUpdateRequest$ { - /** @deprecated use `PaymentsUpdateRequest$inboundSchema` instead. */ - export const inboundSchema = PaymentsUpdateRequest$inboundSchema; - /** @deprecated use `PaymentsUpdateRequest$outboundSchema` instead. */ - export const outboundSchema = PaymentsUpdateRequest$outboundSchema; - /** @deprecated use `PaymentsUpdateRequest$Outbound` instead. */ - export type Outbound = PaymentsUpdateRequest$Outbound; -} - -/** @internal */ -export const PaymentsUpdateResponse$inboundSchema: z.ZodType< - PaymentsUpdateResponse, - z.ZodTypeDef, - unknown -> = z - .object({ - ContentType: z.string(), - StatusCode: z.number().int(), - RawResponse: z.instanceof(Response), - "payment-response": components.PaymentResponse$inboundSchema.optional(), - }) - .transform((v) => { - return remap$(v, { - ContentType: "contentType", - StatusCode: "statusCode", - RawResponse: "rawResponse", - "payment-response": "paymentResponse", - }); - }); - -/** @internal */ -export type PaymentsUpdateResponse$Outbound = { - ContentType: string; - StatusCode: number; - RawResponse: never; - "payment-response"?: components.PaymentResponse$Outbound | undefined; -}; - -/** @internal */ -export const PaymentsUpdateResponse$outboundSchema: z.ZodType< - PaymentsUpdateResponse$Outbound, - z.ZodTypeDef, - PaymentsUpdateResponse -> = z - .object({ - contentType: z.string(), - statusCode: z.number().int(), - rawResponse: z.instanceof(Response).transform(() => { - throw new Error("Response cannot be serialized"); - }), - paymentResponse: components.PaymentResponse$outboundSchema.optional(), - }) - .transform((v) => { - return remap$(v, { - contentType: "ContentType", - statusCode: "StatusCode", - rawResponse: "RawResponse", - paymentResponse: "payment-response", - }); - }); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace PaymentsUpdateResponse$ { - /** @deprecated use `PaymentsUpdateResponse$inboundSchema` instead. */ - export const inboundSchema = PaymentsUpdateResponse$inboundSchema; - /** @deprecated use `PaymentsUpdateResponse$outboundSchema` instead. */ - export const outboundSchema = PaymentsUpdateResponse$outboundSchema; - /** @deprecated use `PaymentsUpdateResponse$Outbound` instead. */ - export type Outbound = PaymentsUpdateResponse$Outbound; -} diff --git a/src/sdk/guest.ts b/src/sdk/guest.ts index 4020ed3..94d62aa 100644 --- a/src/sdk/guest.ts +++ b/src/sdk/guest.ts @@ -142,111 +142,6 @@ export class Guest extends ClientSDK { return result$; } - /** - * Update a pending guest payment - * - * @remarks - * Update a guest payment that is still in the pending state, with new information about the payment. - */ - async update( - security: operations.GuestPaymentsUpdateSecurity, - id: string, - xPublishableKey: string, - xMerchantClientId: string, - paymentUpdateRequest: components.PaymentUpdateRequest, - options?: RequestOptions - ): Promise { - const input$: operations.GuestPaymentsUpdateRequest = { - id: id, - xPublishableKey: xPublishableKey, - xMerchantClientId: xMerchantClientId, - paymentUpdateRequest: paymentUpdateRequest, - }; - - const payload$ = schemas$.parse( - input$, - (value$) => operations.GuestPaymentsUpdateRequest$outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$["payment-update-request"], { explode: true }); - - const pathParams$ = { - id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), - }; - const path$ = this.templateURLComponent("/guest/payments/{id}")(pathParams$); - - const query$ = ""; - - const headers$ = new Headers({ - "Content-Type": "application/json", - Accept: "application/json", - "X-Merchant-Client-Id": encodeSimple$( - "X-Merchant-Client-Id", - payload$["X-Merchant-Client-Id"], - { explode: false, charEncoding: "none" } - ), - "X-Publishable-Key": encodeSimple$("X-Publishable-Key", payload$["X-Publishable-Key"], { - explode: false, - charEncoding: "none", - }), - }); - - const security$: SecurityInput[][] = [ - [ - { - fieldName: "X-API-Key", - type: "apiKey:header", - value: security?.apiKey, - }, - ], - ]; - const securitySettings$ = this.resolveSecurity(...security$); - const context = { - operationID: "guestPaymentsUpdate", - oAuth2Scopes: [], - securitySource: security$, - }; - - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "PATCH", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, - }, - options - ); - - const response = await this.do$(request$, { - context, - errorCodes: ["4XX", "5XX"], - retryConfig: options?.retries || this.options$.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - - const responseFields$ = { - ContentType: response.headers.get("content-type") ?? "application/octet-stream", - StatusCode: response.status, - RawResponse: response, - Headers: {}, - }; - - const [result$] = await this.matcher() - .json(200, operations.GuestPaymentsUpdateResponse$inboundSchema, { - key: "payment-response", - }) - .json("4XX", errors.GuestPaymentsUpdateResponseBody$inboundSchema, { err: true }) - .fail("5XX") - .void("default", operations.GuestPaymentsUpdateResponse$inboundSchema) - .match(response, { extraFields: responseFields$ }); - - return result$; - } - /** * Finalize a pending guest payment * diff --git a/src/sdk/loggedin.ts b/src/sdk/loggedin.ts index 51f8c0e..675193e 100644 --- a/src/sdk/loggedin.ts +++ b/src/sdk/loggedin.ts @@ -137,104 +137,6 @@ export class LoggedIn extends ClientSDK { return result$; } - /** - * Update a pending payment - * - * @remarks - * Update a payment that is still in the pending state, with new information about the payment. - */ - async update( - id: string, - xPublishableKey: string, - xMerchantClientId: string, - paymentUpdateRequest: components.PaymentUpdateRequest, - options?: RequestOptions - ): Promise { - const input$: operations.PaymentsUpdateRequest = { - id: id, - xPublishableKey: xPublishableKey, - xMerchantClientId: xMerchantClientId, - paymentUpdateRequest: paymentUpdateRequest, - }; - - const payload$ = schemas$.parse( - input$, - (value$) => operations.PaymentsUpdateRequest$outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$["payment-update-request"], { explode: true }); - - const pathParams$ = { - id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), - }; - const path$ = this.templateURLComponent("/payments/{id}")(pathParams$); - - const query$ = ""; - - const headers$ = new Headers({ - "Content-Type": "application/json", - Accept: "application/json", - "X-Merchant-Client-Id": encodeSimple$( - "X-Merchant-Client-Id", - payload$["X-Merchant-Client-Id"], - { explode: false, charEncoding: "none" } - ), - "X-Publishable-Key": encodeSimple$("X-Publishable-Key", payload$["X-Publishable-Key"], { - explode: false, - charEncoding: "none", - }), - }); - - const security$ = - typeof this.options$.security === "function" - ? await this.options$.security() - : this.options$.security; - - const context = { - operationID: "paymentsUpdate", - oAuth2Scopes: [], - securitySource: this.options$.security, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "PATCH", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, - }, - options - ); - - const response = await this.do$(request$, { - context, - errorCodes: ["4XX", "5XX"], - retryConfig: options?.retries || this.options$.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - - const responseFields$ = { - ContentType: response.headers.get("content-type") ?? "application/octet-stream", - StatusCode: response.status, - RawResponse: response, - Headers: {}, - }; - - const [result$] = await this.matcher() - .json(200, operations.PaymentsUpdateResponse$inboundSchema, { key: "payment-response" }) - .json("4XX", errors.PaymentsUpdateResponseBody$inboundSchema, { err: true }) - .fail("5XX") - .void("default", operations.PaymentsUpdateResponse$inboundSchema) - .match(response, { extraFields: responseFields$ }); - - return result$; - } - /** * Finalize a pending payment * diff --git a/src/sdk/payments.ts b/src/sdk/payments.ts index ec58df8..fe9deb4 100644 --- a/src/sdk/payments.ts +++ b/src/sdk/payments.ts @@ -36,13 +36,13 @@ export class Payments extends ClientSDK { void this.options$; } - private _guest?: Guest; - get guest(): Guest { - return (this._guest ??= new Guest(this.options$)); - } - private _loggedIn?: LoggedIn; get loggedIn(): LoggedIn { return (this._loggedIn ??= new LoggedIn(this.options$)); } + + private _guest?: Guest; + get guest(): Guest { + return (this._guest ??= new Guest(this.options$)); + } } diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 9b81fdc..95eea60 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -49,16 +49,16 @@ export class BoltTypescriptSDK extends ClientSDK { return (this._payments ??= new Payments(this.options$)); } - private _oAuth?: OAuth; - get oAuth(): OAuth { - return (this._oAuth ??= new OAuth(this.options$)); - } - private _orders?: Orders; get orders(): Orders { return (this._orders ??= new Orders(this.options$)); } + private _oAuth?: OAuth; + get oAuth(): OAuth { + return (this._oAuth ??= new OAuth(this.options$)); + } + private _testing?: Testing; get testing(): Testing { return (this._testing ??= new Testing(this.options$));