From ac0c6b88d60a8a7055d94079042010d484ea52ac Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 17 Jul 2024 01:20:25 +0000 Subject: [PATCH] Release 0.1.3 --- .github/workflows/ci.yml | 36 +- .mock/definition/__package__.yml | 630 +++++++++--------- .mock/definition/api.yml | 15 +- .mock/definition/checkout.yml | 186 ++++++ .mock/definition/headless.yml | 186 ------ .mock/fern.config.json | 6 +- package.json | 10 +- reference.md | 22 +- src/Client.ts | 8 +- src/api/errors/BadRequestError.ts | 2 +- src/api/errors/ForbiddenError.ts | 2 +- src/api/errors/NotFoundError.ts | 2 +- src/api/errors/ServiceUnavailableError.ts | 2 +- .../{headless => checkout}/client/Client.ts | 66 +- .../{headless => checkout}/client/index.ts | 0 .../requests/CheckoutCreateOrderRequest.ts} | 2 +- .../client/requests/OrderDto.ts | 0 .../checkout/client/requests/index.ts | 2 + .../resources/{headless => checkout}/index.ts | 0 .../headless/client/requests/index.ts | 2 - src/api/resources/index.ts | 4 +- .../{Response403.ts => BadRequestResponse.ts} | 2 +- .../types/{Evm.ts => EvmPaymentMethods.ts} | 2 +- .../types/{Fiat.ts => FiatPaymentMethods.ts} | 2 +- src/api/types/LineItems.ts | 2 +- .../{Response400.ts => NotFoundResponse.ts} | 2 +- src/api/types/Payment.ts | 2 +- src/api/types/Recipient.ts | 4 +- src/api/types/{Email.ts => RecipientEmail.ts} | 2 +- .../types/{Wallet.ts => RecipientWallet.ts} | 2 +- src/api/types/Response524.ts | 8 - src/api/types/ServiceUnavailabileResponse.ts | 8 + ...LineItemsCallData.ts => SingleLineItem.ts} | 2 +- .../{Solana.ts => SolanaPaymentMethods.ts} | 2 +- .../{Response503.ts => TimeoutResponse.ts} | 2 +- ...Response404.ts => UnauthorizedResponse.ts} | 2 +- src/api/types/index.ts | 22 +- src/environments.ts | 5 +- .../{headless => checkout}/client/index.ts | 0 .../requests/CheckoutCreateOrderRequest.ts} | 8 +- .../client/requests/OrderDto.ts | 0 .../checkout/client/requests/index.ts | 2 + .../resources/{headless => checkout}/index.ts | 0 .../headless/client/requests/index.ts | 2 - src/serialization/resources/index.ts | 4 +- src/serialization/types/BadRequestResponse.ts | 22 + .../types/{Evm.ts => EvmPaymentMethods.ts} | 7 +- .../types/{Fiat.ts => FiatPaymentMethods.ts} | 7 +- src/serialization/types/LineItems.ts | 6 +- src/serialization/types/NotFoundResponse.ts | 22 + src/serialization/types/Payment.ts | 10 +- src/serialization/types/Recipient.ts | 8 +- .../types/{Email.ts => RecipientEmail.ts} | 9 +- .../types/{Wallet.ts => RecipientWallet.ts} | 12 +- src/serialization/types/Response400.ts | 20 - src/serialization/types/Response403.ts | 20 - src/serialization/types/Response404.ts | 20 - src/serialization/types/Response503.ts | 20 - src/serialization/types/Response524.ts | 20 - .../types/ServiceUnavailabileResponse.ts | 22 + ...LineItemsCallData.ts => SingleLineItem.ts} | 14 +- src/serialization/types/Solana.ts | 25 - .../types/SolanaPaymentMethods.ts | 27 + src/serialization/types/TimeoutResponse.ts | 22 + .../types/UnauthorizedResponse.ts | 22 + src/serialization/types/index.ts | 22 +- yarn.lock | 35 +- 67 files changed, 834 insertions(+), 828 deletions(-) create mode 100644 .mock/definition/checkout.yml delete mode 100644 .mock/definition/headless.yml rename src/api/resources/{headless => checkout}/client/Client.ts (86%) rename src/api/resources/{headless => checkout}/client/index.ts (100%) rename src/api/resources/{headless/client/requests/CreateOrderRequest.ts => checkout/client/requests/CheckoutCreateOrderRequest.ts} (92%) rename src/api/resources/{headless => checkout}/client/requests/OrderDto.ts (100%) create mode 100644 src/api/resources/checkout/client/requests/index.ts rename src/api/resources/{headless => checkout}/index.ts (100%) delete mode 100644 src/api/resources/headless/client/requests/index.ts rename src/api/types/{Response403.ts => BadRequestResponse.ts} (75%) rename src/api/types/{Evm.ts => EvmPaymentMethods.ts} (90%) rename src/api/types/{Fiat.ts => FiatPaymentMethods.ts} (88%) rename src/api/types/{Response400.ts => NotFoundResponse.ts} (76%) rename src/api/types/{Email.ts => RecipientEmail.ts} (91%) rename src/api/types/{Wallet.ts => RecipientWallet.ts} (90%) delete mode 100644 src/api/types/Response524.ts create mode 100644 src/api/types/ServiceUnavailabileResponse.ts rename src/api/types/{LineItemsCallData.ts => SingleLineItem.ts} (91%) rename src/api/types/{Solana.ts => SolanaPaymentMethods.ts} (88%) rename src/api/types/{Response503.ts => TimeoutResponse.ts} (77%) rename src/api/types/{Response404.ts => UnauthorizedResponse.ts} (74%) rename src/serialization/resources/{headless => checkout}/client/index.ts (100%) rename src/serialization/resources/{headless/client/requests/CreateOrderRequest.ts => checkout/client/requests/CheckoutCreateOrderRequest.ts} (78%) rename src/serialization/resources/{headless => checkout}/client/requests/OrderDto.ts (100%) create mode 100644 src/serialization/resources/checkout/client/requests/index.ts rename src/serialization/resources/{headless => checkout}/index.ts (100%) delete mode 100644 src/serialization/resources/headless/client/requests/index.ts create mode 100644 src/serialization/types/BadRequestResponse.ts rename src/serialization/types/{Evm.ts => EvmPaymentMethods.ts} (76%) rename src/serialization/types/{Fiat.ts => FiatPaymentMethods.ts} (73%) create mode 100644 src/serialization/types/NotFoundResponse.ts rename src/serialization/types/{Email.ts => RecipientEmail.ts} (59%) rename src/serialization/types/{Wallet.ts => RecipientWallet.ts} (50%) delete mode 100644 src/serialization/types/Response400.ts delete mode 100644 src/serialization/types/Response403.ts delete mode 100644 src/serialization/types/Response404.ts delete mode 100644 src/serialization/types/Response503.ts delete mode 100644 src/serialization/types/Response524.ts create mode 100644 src/serialization/types/ServiceUnavailabileResponse.ts rename src/serialization/types/{LineItemsCallData.ts => SingleLineItem.ts} (54%) delete mode 100644 src/serialization/types/Solana.ts create mode 100644 src/serialization/types/SolanaPaymentMethods.ts create mode 100644 src/serialization/types/TimeoutResponse.ts create mode 100644 src/serialization/types/UnauthorizedResponse.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f69d2ba..cf13c1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,28 +3,28 @@ name: ci on: [push] jobs: - compile: - runs-on: ubuntu-latest + compile: + runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 + steps: + - name: Checkout repo + uses: actions/checkout@v3 - - name: Set up node - uses: actions/setup-node@v3 + - name: Set up node + uses: actions/setup-node@v3 - - name: Compile - run: yarn && yarn build + - name: Compile + run: yarn && yarn build - test: - runs-on: ubuntu-latest + test: + runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 + steps: + - name: Checkout repo + uses: actions/checkout@v3 - - name: Set up node - uses: actions/setup-node@v3 + - name: Set up node + uses: actions/setup-node@v3 - - name: Compile - run: yarn && yarn test + - name: Compile + run: yarn && yarn test diff --git a/.mock/definition/__package__.yml b/.mock/definition/__package__.yml index 086c141..2558ab5 100644 --- a/.mock/definition/__package__.yml +++ b/.mock/definition/__package__.yml @@ -1,322 +1,322 @@ errors: - BadRequestError: - status-code: 400 - type: Response400 - docs: >- - Invalid arguments, please make sure you're following the api - specification. - ForbiddenError: - status-code: 403 - type: Response403 - docs: Forbidden error, please ensure the credentials are correct. - NotFoundError: - status-code: 404 - type: Response404 - docs: Not found error. - ServiceUnavailableError: - status-code: 503 - type: Response503 - docs: >- - Please try again in a few minutes. If the issue still persists, contact - Crossmint support. + BadRequestError: + status-code: 400 + type: BadRequestResponse + docs: >- + Invalid arguments, please make sure you're following the api + specification. + ForbiddenError: + status-code: 403 + type: UnauthorizedResponse + docs: Forbidden error, please ensure the credentials are correct. + NotFoundError: + status-code: 404 + type: NotFoundResponse + docs: Not found error. + ServiceUnavailableError: + status-code: 503 + type: ServiceUnavailabileResponse + docs: >- + Please try again in a few minutes. If the issue still persists, contact + Crossmint support. types: - Email: + RecipientEmail: + docs: >- + Recipient of the items being purchased. Crossmint will create a custodial + wallet address for the user on the fly, that they can later log in to. If + no recipient is passed, an order will be created with the status + 'requires-recipient', until you pass one. + properties: + email: + type: string + validation: + format: email + RecipientWallet: + docs: >- + Recipient of the items being purchased. If specifying a recipient by + wallet address, ensure the address is valid for the chain your + **collection** is on, which may differ from the chain the payment is + performed on. + properties: + walletAddress: string + Recipient: + discriminated: false + union: + - type: RecipientEmail + docs: >- + Recipient of the items being purchased. Crossmint will create a + custodial wallet address for the user on the fly, that they can later + log in to. If no recipient is passed, an order will be created with + the status 'requires-recipient', until you pass one. + - type: RecipientWallet docs: >- - Recipient of the items being purchased. Crossmint will create a custodial - wallet address for the user on the fly, that they can later log in to. If - no recipient is passed, an order will be created with the status - 'requires-recipient', until you pass one. - properties: - email: - type: string - validation: - format: email - Wallet: + Recipient of the items being purchased. If specifying a recipient by + wallet address, ensure the address is valid for the chain your + **collection** is on, which may differ from the chain the payment is + performed on. + Locale: + enum: + - value: en-US + name: EnUs + - value: es-ES + name: EsEs + - value: fr-FR + name: FrFr + - value: it-IT + name: ItIt + - value: ko-KR + name: KoKr + - value: pt-PT + name: PtPt + - value: ja-JP + name: JaJp + - value: zh-CN + name: ZhCn + - value: zh-TW + name: ZhTw + - value: de-DE + name: DeDe + - value: ru-RU + name: RuRu + - value: tr-TR + name: TrTr + - value: uk-UA + name: UkUa + - value: th-TH + name: ThTh + - value: vi-VN + name: ViVn + - Klingon + docs: >- + Locale for the checkout, in IETF BCP 47. It impacts the email receipt + language. Ensure your UI is set to the same language as specified here. + Throws an error if passed an invalid language. + PaymentZeroMethod: + enum: + - value: arbitrum-sepolia + name: ArbitrumSepolia + - value: base-sepolia + name: BaseSepolia + - value: ethereum-sepolia + name: EthereumSepolia + - value: optimism-sepolia + name: OptimismSepolia + - arbitrum + - bsc + - ethereum + - optimism + PaymentZeroCurrency: + enum: + - eth + - usdc + - degen + - brett + - toshi + EvmPaymentMethods: + properties: + receiptEmail: + type: optional + docs: Email that the receipt will be sent to. + validation: + format: email + method: PaymentZeroMethod + currency: PaymentZeroCurrency + payerAddress: + type: optional + docs: An EVM wallet address. + validation: + pattern: ^0x[0-9a-fA-F]{40}$ + PaymentOneCurrency: + enum: + - sol + - usdc + - bonk + - wif + - mother + SolanaPaymentMethods: + properties: + receiptEmail: + type: optional + docs: Email that the receipt will be sent to. + validation: + format: email + method: literal<"solana"> + currency: PaymentOneCurrency + payerAddress: + type: optional + docs: A Solana public key. + validation: + pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$ + PaymentCurrencyCurrency: + enum: + - usd + - eur + - aud + - gbp + - jpy + - sgd + - hkd + - krw + - inr + - vnd + FiatPaymentMethods: + properties: + receiptEmail: + type: optional + docs: Email that the receipt will be sent to. + validation: + format: email + method: literal<"stripe-payment-element"> + currency: optional + Payment: + discriminated: false + union: + - EvmPaymentMethods + - SolanaPaymentMethods + - FiatPaymentMethods + LineItemsCallDataCallData: + docs: Information that you pass to your contract mint function. + properties: + totalPrice: + type: optional docs: >- - Recipient of the items being purchased. If specifying a recipient by - wallet address, ensure the address is valid for the chain your - **collection** is on, which may differ from the chain the payment is - performed on. - properties: - walletAddress: string - Recipient: - discriminated: false - union: - - type: Email - docs: >- - Recipient of the items being purchased. Crossmint will create a - custodial wallet address for the user on the fly, that they can later - log in to. If no recipient is passed, an order will be created with - the status 'requires-recipient', until you pass one. - - type: Wallet - docs: >- - Recipient of the items being purchased. If specifying a recipient by - wallet address, ensure the address is valid for the chain your - **collection** is on, which may differ from the chain the payment is - performed on. - Locale: - enum: - - value: en-US - name: EnUs - - value: es-ES - name: EsEs - - value: fr-FR - name: FrFr - - value: it-IT - name: ItIt - - value: ko-KR - name: KoKr - - value: pt-PT - name: PtPt - - value: ja-JP - name: JaJp - - value: zh-CN - name: ZhCn - - value: zh-TW - name: ZhTw - - value: de-DE - name: DeDe - - value: ru-RU - name: RuRu - - value: tr-TR - name: TrTr - - value: uk-UA - name: UkUa - - value: th-TH - name: ThTh - - value: vi-VN - name: ViVn - - Klingon + The total price of the line item. It must be the same as the contract + expects to receive. Read + https://docs.crossmint.com/nft-checkout/advanced/component-properties#mintconfig + extra-properties: true + SingleLineItem: + properties: + collectionLocator: + type: string docs: >- - Locale for the checkout, in IETF BCP 47. It impacts the email receipt - language. Ensure your UI is set to the same language as specified here. - Throws an error if passed an invalid language. - PaymentZeroMethod: - enum: - - value: arbitrum-sepolia - name: ArbitrumSepolia - - value: base-sepolia - name: BaseSepolia - - value: ethereum-sepolia - name: EthereumSepolia - - value: optimism-sepolia - name: OptimismSepolia - - arbitrum - - bsc - - ethereum - - optimism - PaymentZeroCurrency: - enum: - - eth - - usdc - - degen - - brett - - toshi - EVM: - properties: - receiptEmail: - type: optional - docs: Email that the receipt will be sent to. - validation: - format: email - method: PaymentZeroMethod - currency: PaymentZeroCurrency - payerAddress: - type: optional - docs: An EVM wallet address. - validation: - pattern: ^0x[0-9a-fA-F]{40}$ - PaymentOneCurrency: - enum: - - sol - - usdc - - bonk - - wif - - mother - Solana: - properties: - receiptEmail: - type: optional - docs: Email that the receipt will be sent to. - validation: - format: email - method: literal<"solana"> - currency: PaymentOneCurrency - payerAddress: - type: optional - docs: A Solana public key. - validation: - pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$ - PaymentCurrencyCurrency: - enum: - - usd - - eur - - aud - - gbp - - jpy - - sgd - - hkd - - krw - - inr - - vnd - Fiat: - properties: - receiptEmail: - type: optional - docs: Email that the receipt will be sent to. - validation: - format: email - method: literal<"stripe-payment-element"> - currency: optional - Payment: - discriminated: false - union: - - EVM - - Solana - - Fiat - LineItemsCallDataCallData: + The collection locator of the line item. For example: + 'crossmint:'. These fields can be retrieved from the + Crossmint console. + callData: + type: optional docs: Information that you pass to your contract mint function. - properties: - totalPrice: - type: optional - docs: >- - The total price of the line item. It must be the same as the contract - expects to receive. Read - https://docs.crossmint.com/nft-checkout/advanced/component-properties#mintconfig - extra-properties: true - LineItemsCallData: - properties: - collectionLocator: - type: string - docs: >- - The collection locator of the line item. For example: - 'crossmint:'. These fields can be retrieved from the - Crossmint console. - callData: - type: optional - docs: Information that you pass to your contract mint function. - LineItemsItemCallData: + LineItemsItemCallData: + docs: Information that you pass to your contract mint function. + properties: + totalPrice: + type: optional + docs: >- + The total price of the line item. It must be the same as the contract + expects to receive. Read + https://docs.crossmint.com/nft-checkout/advanced/component-properties#mintconfig + extra-properties: true + LineItemsItem: + properties: + collectionLocator: + type: string + docs: >- + The collection locator of the line item. Eg. + 'crossmint::', 'crossmint:'. + These fields can be retrieved from the Crossmint console. + callData: + type: optional docs: Information that you pass to your contract mint function. - properties: - totalPrice: - type: optional - docs: >- - The total price of the line item. It must be the same as the contract - expects to receive. Read - https://docs.crossmint.com/nft-checkout/advanced/component-properties#mintconfig - extra-properties: true - LineItemsItem: - properties: - collectionLocator: - type: string - docs: >- - The collection locator of the line item. Eg. - 'crossmint::', 'crossmint:'. - These fields can be retrieved from the Crossmint console. - callData: - type: optional - docs: Information that you pass to your contract mint function. - LineItems: - discriminated: false - union: - - LineItemsCallData - - list - CreateOrderResponse: - properties: - clientSecret: - type: optional - docs: >- - A token exclusively scoped to a particular order, allowing for the - reading or updating of that order. - order: optional - OrderObjectLineItemsItemCallData: - properties: - quantity: optional - ADDITIONAL_PROPERTIES: optional - OrderObjectLineItemsItemMetadata: - properties: - name: optional - description: optional - imageUrl: optional - OrderObjectLineItemsItemQuoteChargesUnit: - properties: - amount: optional - currency: optional - OrderObjectLineItemsItemQuoteCharges: - properties: - unit: optional - OrderObjectLineItemsItemQuoteTotalPrice: - properties: - amount: optional - currency: optional - OrderObjectLineItemsItemQuote: - properties: - status: optional - charges: optional - totalPrice: optional - OrderObjectLineItemsItemDeliveryRecipient: - properties: - locator: optional - email: optional - walletAddress: optional - OrderObjectLineItemsItemDelivery: - properties: - status: optional - recipient: optional - OrderObjectLineItemsItem: - properties: - chain: optional - quantity: optional - callData: optional - metadata: optional - quote: optional - delivery: optional - OrderObjectQuoteTotalPrice: - properties: - amount: optional - currency: optional - OrderObjectQuote: - properties: - status: optional - quotedAt: optional - expiresAt: optional - totalPrice: optional - OrderObjectPaymentPreparation: - properties: - chain: optional - payerAddress: optional - serializedTransaction: optional - OrderObjectPayment: - properties: - status: optional - method: optional - currency: optional - preparation: optional - OrderObject: - properties: - orderId: optional - phase: optional - locale: optional - lineItems: optional> - quote: optional - payment: optional - Response400: - properties: - error: optional - message: optional - Response403: - properties: - error: optional - message: optional - Response404: - properties: - error: optional - message: optional - Response503: - properties: - error: optional - message: optional - Response524: - properties: - error: optional - message: optional + LineItems: + discriminated: false + union: + - SingleLineItem + - list + CreateOrderResponse: + properties: + clientSecret: + type: optional + docs: >- + A token exclusively scoped to a particular order, allowing for the + reading or updating of that order. + order: optional + OrderObjectLineItemsItemCallData: + properties: + quantity: optional + ADDITIONAL_PROPERTIES: optional + OrderObjectLineItemsItemMetadata: + properties: + name: optional + description: optional + imageUrl: optional + OrderObjectLineItemsItemQuoteChargesUnit: + properties: + amount: optional + currency: optional + OrderObjectLineItemsItemQuoteCharges: + properties: + unit: optional + OrderObjectLineItemsItemQuoteTotalPrice: + properties: + amount: optional + currency: optional + OrderObjectLineItemsItemQuote: + properties: + status: optional + charges: optional + totalPrice: optional + OrderObjectLineItemsItemDeliveryRecipient: + properties: + locator: optional + email: optional + walletAddress: optional + OrderObjectLineItemsItemDelivery: + properties: + status: optional + recipient: optional + OrderObjectLineItemsItem: + properties: + chain: optional + quantity: optional + callData: optional + metadata: optional + quote: optional + delivery: optional + OrderObjectQuoteTotalPrice: + properties: + amount: optional + currency: optional + OrderObjectQuote: + properties: + status: optional + quotedAt: optional + expiresAt: optional + totalPrice: optional + OrderObjectPaymentPreparation: + properties: + chain: optional + payerAddress: optional + serializedTransaction: optional + OrderObjectPayment: + properties: + status: optional + method: optional + currency: optional + preparation: optional + OrderObject: + properties: + orderId: optional + phase: optional + locale: optional + lineItems: optional> + quote: optional + payment: optional + BadRequestResponse: + properties: + error: optional + message: optional + UnauthorizedResponse: + properties: + error: optional + message: optional + NotFoundResponse: + properties: + error: optional + message: optional + ServiceUnavailabileResponse: + properties: + error: optional + message: optional + TimeoutResponse: + properties: + error: optional + message: optional diff --git a/.mock/definition/api.yml b/.mock/definition/api.yml index 3a17b47..37d0d1d 100644 --- a/.mock/definition/api.yml +++ b/.mock/definition/api.yml @@ -1,14 +1,13 @@ name: api error-discrimination: - strategy: status-code + strategy: status-code display-name: Headless Checkout -default-environment: Staging environments: - Staging: https://staging.crossmint.com/api - Production: https://www.crossmint.com/api + Default: https://staging.crossmint.com/api +default-environment: Default auth-schemes: - apiKey: - header: X-API-KEY - name: apiKey - type: string + apiKey: + header: X-API-KEY + name: apiKey + type: string auth: apiKey diff --git a/.mock/definition/checkout.yml b/.mock/definition/checkout.yml new file mode 100644 index 0000000..18cd29c --- /dev/null +++ b/.mock/definition/checkout.yml @@ -0,0 +1,186 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + create-order: + path: /2022-06-09/orders + method: POST + auth: true + docs: Creates a new order that can be used to complete a headless checkout. + display-name: Create Order + request: + name: CheckoutCreateOrderRequest + body: + properties: + recipient: optional + locale: optional + payment: root.Payment + lineItems: root.LineItems + response: + docs: Order successfully created. + type: root.CreateOrderResponse + errors: + - root.BadRequestError + - root.ForbiddenError + - root.NotFoundError + - root.ServiceUnavailableError + examples: + - request: + payment: + method: arbitrum-sepolia + currency: eth + lineItems: + collectionLocator: crossmint: + response: + body: + clientSecret: _removed_ + order: + orderId: b2959ca5-65e4-466a-bd26-1bd05cb4f837 + phase: payment + locale: en-US + lineItems: + - chain: polygon-amoy + quantity: 1 + quote: + status: valid + quotedAt: '2024-06-07T16:55:44.653Z' + expiresAt: '2024-06-07T17:55:44.653Z' + totalPrice: + amount: '0.0001375741' + currency: eth + payment: + status: awaiting-payment + method: base-sepolia + currency: eth + preparation: + chain: base-sepolia + payerAddress: 0x1234abcd... + serializedTransaction: 0x02f90..... + get-order: + path: /2022-06-09/orders/{orderId} + method: GET + auth: true + docs: Get specific order by ID + path-parameters: + orderId: + type: string + docs: | + This is the identifier for the order with UUID format. + + **Example:** `9c82ef99-617f-497d-9abb-fd355291681b` + display-name: Get Order + response: + docs: Order successfully created. + type: root.OrderObject + errors: + - root.BadRequestError + - root.ForbiddenError + - root.NotFoundError + - root.ServiceUnavailableError + examples: + - path-parameters: + orderId: orderId + response: + body: + orderId: b2959ca5-65e4-466a-bd26-1bd05cb4f837 + phase: payment + locale: en-US + lineItems: + - chain: polygon-amoy + quantity: 1 + callData: + quantity: 1 + ADDITIONAL_PROPERTIES: Your other mint function arguments + metadata: + name: Headless Checkout Demo + description: NFT Description + imageUrl: https://cdn.io/image.png + quote: + status: valid + delivery: + status: awaiting-payment + quote: + status: valid + quotedAt: '2024-06-07T16:55:44.653Z' + expiresAt: '2024-06-07T17:55:44.653Z' + totalPrice: + amount: '0.0001375741' + currency: eth + payment: + status: awaiting-payment + method: base-sepolia + currency: eth + preparation: + chain: base-sepolia + payerAddress: 0x1234abcd... + serializedTransaction: 0x02f90..... + edit-order: + path: /2022-06-09/orders/{orderId} + method: PATCH + auth: true + docs: >- + Edit an existing order. You can update the recipient, the payment + method, and/or the locale. + path-parameters: + orderId: + type: string + docs: | + This is the identifier for the order with UUID format. + + **Example:** `9c82ef99-617f-497d-9abb-fd355291681b` + display-name: Edit Order + request: + name: OrderDto + body: + properties: + recipient: optional + locale: optional + payment: optional + response: + docs: Order successfully created. + type: root.OrderObject + errors: + - root.BadRequestError + - root.ForbiddenError + - root.NotFoundError + - root.ServiceUnavailableError + examples: + - path-parameters: + orderId: orderId + request: {} + response: + body: + orderId: b2959ca5-65e4-466a-bd26-1bd05cb4f837 + phase: payment + locale: en-US + lineItems: + - chain: polygon-amoy + quantity: 1 + callData: + quantity: 1 + ADDITIONAL_PROPERTIES: Your other mint function arguments + metadata: + name: Headless Checkout Demo + description: NFT Description + imageUrl: https://cdn.io/image.png + quote: + status: valid + delivery: + status: awaiting-payment + quote: + status: valid + quotedAt: '2024-06-07T16:55:44.653Z' + expiresAt: '2024-06-07T17:55:44.653Z' + totalPrice: + amount: '0.0001375741' + currency: eth + payment: + status: awaiting-payment + method: base-sepolia + currency: eth + preparation: + chain: base-sepolia + payerAddress: 0x1234abcd... + serializedTransaction: 0x02f90..... diff --git a/.mock/definition/headless.yml b/.mock/definition/headless.yml deleted file mode 100644 index 8b50ddc..0000000 --- a/.mock/definition/headless.yml +++ /dev/null @@ -1,186 +0,0 @@ -imports: - root: __package__.yml -service: - auth: false - base-path: "" - endpoints: - create-order: - path: /2022-06-09/orders - method: POST - auth: true - docs: Creates a new order that can be used to complete a headless checkout. - display-name: Create Order - request: - name: CreateOrderRequest - body: - properties: - recipient: optional - locale: optional - payment: root.Payment - lineItems: root.LineItems - response: - docs: Order successfully created. - type: root.CreateOrderResponse - errors: - - root.BadRequestError - - root.ForbiddenError - - root.NotFoundError - - root.ServiceUnavailableError - examples: - - request: - payment: - method: arbitrum-sepolia - currency: eth - lineItems: - collectionLocator: crossmint: - response: - body: - clientSecret: _removed_ - order: - orderId: b2959ca5-65e4-466a-bd26-1bd05cb4f837 - phase: payment - locale: en-US - lineItems: - - chain: polygon-amoy - quantity: 1 - quote: - status: valid - quotedAt: "2024-06-07T16:55:44.653Z" - expiresAt: "2024-06-07T17:55:44.653Z" - totalPrice: - amount: "0.0001375741" - currency: eth - payment: - status: awaiting-payment - method: base-sepolia - currency: eth - preparation: - chain: base-sepolia - payerAddress: 0x1234abcd... - serializedTransaction: 0x02f90..... - get-order: - path: /2022-06-09/orders/{orderId} - method: GET - auth: true - docs: Get specific order by ID - path-parameters: - orderId: - type: string - docs: | - This is the identifier for the order with UUID format. - - **Example:** `9c82ef99-617f-497d-9abb-fd355291681b` - display-name: Get Order - response: - docs: Order successfully created. - type: root.OrderObject - errors: - - root.BadRequestError - - root.ForbiddenError - - root.NotFoundError - - root.ServiceUnavailableError - examples: - - path-parameters: - orderId: orderId - response: - body: - orderId: b2959ca5-65e4-466a-bd26-1bd05cb4f837 - phase: payment - locale: en-US - lineItems: - - chain: polygon-amoy - quantity: 1 - callData: - quantity: 1 - ADDITIONAL_PROPERTIES: Your other mint function arguments - metadata: - name: Headless Checkout Demo - description: NFT Description - imageUrl: https://cdn.io/image.png - quote: - status: valid - delivery: - status: awaiting-payment - quote: - status: valid - quotedAt: "2024-06-07T16:55:44.653Z" - expiresAt: "2024-06-07T17:55:44.653Z" - totalPrice: - amount: "0.0001375741" - currency: eth - payment: - status: awaiting-payment - method: base-sepolia - currency: eth - preparation: - chain: base-sepolia - payerAddress: 0x1234abcd... - serializedTransaction: 0x02f90..... - edit-order: - path: /2022-06-09/orders/{orderId} - method: PATCH - auth: true - docs: >- - Edit an existing order. You can update the recipient, the payment - method, and/or the locale. - path-parameters: - orderId: - type: string - docs: | - This is the identifier for the order with UUID format. - - **Example:** `9c82ef99-617f-497d-9abb-fd355291681b` - display-name: Edit Order - request: - name: OrderDto - body: - properties: - recipient: optional - locale: optional - payment: optional - response: - docs: Order successfully created. - type: root.OrderObject - errors: - - root.BadRequestError - - root.ForbiddenError - - root.NotFoundError - - root.ServiceUnavailableError - examples: - - path-parameters: - orderId: orderId - request: {} - response: - body: - orderId: b2959ca5-65e4-466a-bd26-1bd05cb4f837 - phase: payment - locale: en-US - lineItems: - - chain: polygon-amoy - quantity: 1 - callData: - quantity: 1 - ADDITIONAL_PROPERTIES: Your other mint function arguments - metadata: - name: Headless Checkout Demo - description: NFT Description - imageUrl: https://cdn.io/image.png - quote: - status: valid - delivery: - status: awaiting-payment - quote: - status: valid - quotedAt: "2024-06-07T16:55:44.653Z" - expiresAt: "2024-06-07T17:55:44.653Z" - totalPrice: - amount: "0.0001375741" - currency: eth - payment: - status: awaiting-payment - method: base-sepolia - currency: eth - preparation: - chain: base-sepolia - payerAddress: 0x1234abcd... - serializedTransaction: 0x02f90..... diff --git a/.mock/fern.config.json b/.mock/fern.config.json index b428a3a..197432e 100644 --- a/.mock/fern.config.json +++ b/.mock/fern.config.json @@ -1,4 +1,4 @@ { - "organization": "crossmint", - "version": "0.31.24" -} + "organization" : "crossmint", + "version" : "0.31.24" +} \ No newline at end of file diff --git a/package.json b/package.json index d2e9d27..edba519 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "crossmint", - "version": "0.1.2", + "version": "0.1.3", "private": false, "repository": "https://github.com/fern-demo/crossmint-typescript-sdk", "main": "./index.js", @@ -9,10 +9,7 @@ "format": "prettier . --write --ignore-unknown", "build": "tsc", "prepack": "cp -rv dist/. .", - "test": "jest", - "test:unit": "jest tests/unit", - "test:mock": "fern test --command 'yarn jest tests/integration'", - "test:integration": "jest tests/integration tests/custom" + "test": "jest" }, "dependencies": { "url-join": "4.0.1", @@ -31,8 +28,7 @@ "jest-environment-jsdom": "29.7.0", "@types/node": "17.0.33", "prettier": "2.7.1", - "typescript": "4.6.4", - "fern-api": "^0.31.22" + "typescript": "4.6.4" }, "browser": { "fs": false, diff --git a/reference.md b/reference.md index e8c5c30..98b2f47 100644 --- a/reference.md +++ b/reference.md @@ -1,6 +1,6 @@ -## Headless +## Checkout -
client.headless.createOrder({ ...params }) -> Crossmint.CreateOrderResponse +
client.checkout.createOrder({ ...params }) -> Crossmint.CreateOrderResponse
@@ -37,7 +37,7 @@ Creates a new order that can be used to complete a headless checkout.
```ts -await client.headless.createOrder({ +await client.checkout.createOrder({ payment: { method: Crossmint.PaymentZeroMethod.ArbitrumSepolia, currency: Crossmint.PaymentZeroCurrency.Eth, @@ -66,7 +66,7 @@ await client.headless.createOrder({
-**request: `Crossmint.CreateOrderRequest`** +**request: `Crossmint.CheckoutCreateOrderRequest`**
@@ -76,7 +76,7 @@ await client.headless.createOrder({
-**requestOptions: `Headless.RequestOptions`** +**requestOptions: `Checkout.RequestOptions`**
@@ -91,7 +91,7 @@ await client.headless.createOrder({
-
client.headless.getOrder(orderId) -> Crossmint.OrderObject +
client.checkout.getOrder(orderId) -> Crossmint.OrderObject
@@ -128,7 +128,7 @@ Get specific order by ID
```ts -await client.headless.getOrder("orderId"); +await client.checkout.getOrder("orderId"); ```
@@ -163,7 +163,7 @@ This is the identifier for the order with UUID format.
-**requestOptions: `Headless.RequestOptions`** +**requestOptions: `Checkout.RequestOptions`**
@@ -178,7 +178,7 @@ This is the identifier for the order with UUID format.
-
client.headless.editOrder(orderId, { ...params }) -> Crossmint.OrderObject +
client.checkout.editOrder(orderId, { ...params }) -> Crossmint.OrderObject
@@ -215,7 +215,7 @@ Edit an existing order. You can update the recipient, the payment method, and/or
```ts -await client.headless.editOrder("orderId"); +await client.checkout.editOrder("orderId"); ```
@@ -260,7 +260,7 @@ This is the identifier for the order with UUID format.
-**requestOptions: `Headless.RequestOptions`** +**requestOptions: `Checkout.RequestOptions`**
diff --git a/src/Client.ts b/src/Client.ts index 08945db..b39645f 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -4,7 +4,7 @@ import * as environments from "./environments"; import * as core from "./core"; -import { Headless } from "./api/resources/headless/client/Client"; +import { Checkout } from "./api/resources/checkout/client/Client"; export declare namespace CrossmintClient { interface Options { @@ -26,9 +26,9 @@ export declare namespace CrossmintClient { export class CrossmintClient { constructor(protected readonly _options: CrossmintClient.Options) {} - protected _headless: Headless | undefined; + protected _checkout: Checkout | undefined; - public get headless(): Headless { - return (this._headless ??= new Headless(this._options)); + public get checkout(): Checkout { + return (this._checkout ??= new Checkout(this._options)); } } diff --git a/src/api/errors/BadRequestError.ts b/src/api/errors/BadRequestError.ts index 9a95737..0695521 100644 --- a/src/api/errors/BadRequestError.ts +++ b/src/api/errors/BadRequestError.ts @@ -6,7 +6,7 @@ import * as errors from "../../errors/index"; import * as Crossmint from "../index"; export class BadRequestError extends errors.CrossmintError { - constructor(body: Crossmint.Response400) { + constructor(body: Crossmint.BadRequestResponse) { super({ message: "BadRequestError", statusCode: 400, diff --git a/src/api/errors/ForbiddenError.ts b/src/api/errors/ForbiddenError.ts index 08ad2d3..21819ae 100644 --- a/src/api/errors/ForbiddenError.ts +++ b/src/api/errors/ForbiddenError.ts @@ -6,7 +6,7 @@ import * as errors from "../../errors/index"; import * as Crossmint from "../index"; export class ForbiddenError extends errors.CrossmintError { - constructor(body: Crossmint.Response403) { + constructor(body: Crossmint.UnauthorizedResponse) { super({ message: "ForbiddenError", statusCode: 403, diff --git a/src/api/errors/NotFoundError.ts b/src/api/errors/NotFoundError.ts index fab24ff..7b7849a 100644 --- a/src/api/errors/NotFoundError.ts +++ b/src/api/errors/NotFoundError.ts @@ -6,7 +6,7 @@ import * as errors from "../../errors/index"; import * as Crossmint from "../index"; export class NotFoundError extends errors.CrossmintError { - constructor(body: Crossmint.Response404) { + constructor(body: Crossmint.NotFoundResponse) { super({ message: "NotFoundError", statusCode: 404, diff --git a/src/api/errors/ServiceUnavailableError.ts b/src/api/errors/ServiceUnavailableError.ts index 9b52e1a..3d054b4 100644 --- a/src/api/errors/ServiceUnavailableError.ts +++ b/src/api/errors/ServiceUnavailableError.ts @@ -6,7 +6,7 @@ import * as errors from "../../errors/index"; import * as Crossmint from "../index"; export class ServiceUnavailableError extends errors.CrossmintError { - constructor(body: Crossmint.Response503) { + constructor(body: Crossmint.ServiceUnavailabileResponse) { super({ message: "ServiceUnavailableError", statusCode: 503, diff --git a/src/api/resources/headless/client/Client.ts b/src/api/resources/checkout/client/Client.ts similarity index 86% rename from src/api/resources/headless/client/Client.ts rename to src/api/resources/checkout/client/Client.ts index 9d7a419..e73779c 100644 --- a/src/api/resources/headless/client/Client.ts +++ b/src/api/resources/checkout/client/Client.ts @@ -9,7 +9,7 @@ import * as serializers from "../../../../serialization/index"; import urlJoin from "url-join"; import * as errors from "../../../../errors/index"; -export declare namespace Headless { +export declare namespace Checkout { interface Options { environment?: core.Supplier; apiKey: core.Supplier; @@ -26,14 +26,14 @@ export declare namespace Headless { } } -export class Headless { - constructor(protected readonly _options: Headless.Options) {} +export class Checkout { + constructor(protected readonly _options: Checkout.Options) {} /** * Creates a new order that can be used to complete a headless checkout. * - * @param {Crossmint.CreateOrderRequest} request - * @param {Headless.RequestOptions} requestOptions - Request-specific configuration. + * @param {Crossmint.CheckoutCreateOrderRequest} request + * @param {Checkout.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Crossmint.BadRequestError} * @throws {@link Crossmint.ForbiddenError} @@ -41,7 +41,7 @@ export class Headless { * @throws {@link Crossmint.ServiceUnavailableError} * * @example - * await client.headless.createOrder({ + * await client.checkout.createOrder({ * payment: { * method: Crossmint.PaymentZeroMethod.ArbitrumSepolia, * currency: Crossmint.PaymentZeroCurrency.Eth @@ -52,25 +52,25 @@ export class Headless { * }) */ public async createOrder( - request: Crossmint.CreateOrderRequest, - requestOptions?: Headless.RequestOptions + request: Crossmint.CheckoutCreateOrderRequest, + requestOptions?: Checkout.RequestOptions ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.CrossmintEnvironment.Staging, + (await core.Supplier.get(this._options.environment)) ?? environments.CrossmintEnvironment.Default, "2022-06-09/orders" ), method: "POST", headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "crossmint", - "X-Fern-SDK-Version": "0.1.1", + "X-Fern-SDK-Version": "0.1.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), }, contentType: "application/json", - body: serializers.CreateOrderRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.CheckoutCreateOrderRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -89,7 +89,7 @@ export class Headless { switch (_response.error.statusCode) { case 400: throw new Crossmint.BadRequestError( - serializers.Response400.parseOrThrow(_response.error.body, { + serializers.BadRequestResponse.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -99,7 +99,7 @@ export class Headless { ); case 403: throw new Crossmint.ForbiddenError( - serializers.Response403.parseOrThrow(_response.error.body, { + serializers.UnauthorizedResponse.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -109,7 +109,7 @@ export class Headless { ); case 404: throw new Crossmint.NotFoundError( - serializers.Response404.parseOrThrow(_response.error.body, { + serializers.NotFoundResponse.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -119,7 +119,7 @@ export class Headless { ); case 503: throw new Crossmint.ServiceUnavailableError( - serializers.Response503.parseOrThrow(_response.error.body, { + serializers.ServiceUnavailabileResponse.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -156,7 +156,7 @@ export class Headless { * @param {string} orderId - This is the identifier for the order with UUID format. * * **Example:** `9c82ef99-617f-497d-9abb-fd355291681b` - * @param {Headless.RequestOptions} requestOptions - Request-specific configuration. + * @param {Checkout.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Crossmint.BadRequestError} * @throws {@link Crossmint.ForbiddenError} @@ -164,19 +164,19 @@ export class Headless { * @throws {@link Crossmint.ServiceUnavailableError} * * @example - * await client.headless.getOrder("orderId") + * await client.checkout.getOrder("orderId") */ - public async getOrder(orderId: string, requestOptions?: Headless.RequestOptions): Promise { + public async getOrder(orderId: string, requestOptions?: Checkout.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.CrossmintEnvironment.Staging, + (await core.Supplier.get(this._options.environment)) ?? environments.CrossmintEnvironment.Default, `2022-06-09/orders/${encodeURIComponent(orderId)}` ), method: "GET", headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "crossmint", - "X-Fern-SDK-Version": "0.1.1", + "X-Fern-SDK-Version": "0.1.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -200,7 +200,7 @@ export class Headless { switch (_response.error.statusCode) { case 400: throw new Crossmint.BadRequestError( - serializers.Response400.parseOrThrow(_response.error.body, { + serializers.BadRequestResponse.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -210,7 +210,7 @@ export class Headless { ); case 403: throw new Crossmint.ForbiddenError( - serializers.Response403.parseOrThrow(_response.error.body, { + serializers.UnauthorizedResponse.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -220,7 +220,7 @@ export class Headless { ); case 404: throw new Crossmint.NotFoundError( - serializers.Response404.parseOrThrow(_response.error.body, { + serializers.NotFoundResponse.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -230,7 +230,7 @@ export class Headless { ); case 503: throw new Crossmint.ServiceUnavailableError( - serializers.Response503.parseOrThrow(_response.error.body, { + serializers.ServiceUnavailabileResponse.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -268,7 +268,7 @@ export class Headless { * * **Example:** `9c82ef99-617f-497d-9abb-fd355291681b` * @param {Crossmint.OrderDto} request - * @param {Headless.RequestOptions} requestOptions - Request-specific configuration. + * @param {Checkout.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Crossmint.BadRequestError} * @throws {@link Crossmint.ForbiddenError} @@ -276,23 +276,23 @@ export class Headless { * @throws {@link Crossmint.ServiceUnavailableError} * * @example - * await client.headless.editOrder("orderId") + * await client.checkout.editOrder("orderId") */ public async editOrder( orderId: string, request: Crossmint.OrderDto = {}, - requestOptions?: Headless.RequestOptions + requestOptions?: Checkout.RequestOptions ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.CrossmintEnvironment.Staging, + (await core.Supplier.get(this._options.environment)) ?? environments.CrossmintEnvironment.Default, `2022-06-09/orders/${encodeURIComponent(orderId)}` ), method: "PATCH", headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "crossmint", - "X-Fern-SDK-Version": "0.1.1", + "X-Fern-SDK-Version": "0.1.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -317,7 +317,7 @@ export class Headless { switch (_response.error.statusCode) { case 400: throw new Crossmint.BadRequestError( - serializers.Response400.parseOrThrow(_response.error.body, { + serializers.BadRequestResponse.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -327,7 +327,7 @@ export class Headless { ); case 403: throw new Crossmint.ForbiddenError( - serializers.Response403.parseOrThrow(_response.error.body, { + serializers.UnauthorizedResponse.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -337,7 +337,7 @@ export class Headless { ); case 404: throw new Crossmint.NotFoundError( - serializers.Response404.parseOrThrow(_response.error.body, { + serializers.NotFoundResponse.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -347,7 +347,7 @@ export class Headless { ); case 503: throw new Crossmint.ServiceUnavailableError( - serializers.Response503.parseOrThrow(_response.error.body, { + serializers.ServiceUnavailabileResponse.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, diff --git a/src/api/resources/headless/client/index.ts b/src/api/resources/checkout/client/index.ts similarity index 100% rename from src/api/resources/headless/client/index.ts rename to src/api/resources/checkout/client/index.ts diff --git a/src/api/resources/headless/client/requests/CreateOrderRequest.ts b/src/api/resources/checkout/client/requests/CheckoutCreateOrderRequest.ts similarity index 92% rename from src/api/resources/headless/client/requests/CreateOrderRequest.ts rename to src/api/resources/checkout/client/requests/CheckoutCreateOrderRequest.ts index e5aed0a..049da6b 100644 --- a/src/api/resources/headless/client/requests/CreateOrderRequest.ts +++ b/src/api/resources/checkout/client/requests/CheckoutCreateOrderRequest.ts @@ -16,7 +16,7 @@ import * as Crossmint from "../../../../index"; * } * } */ -export interface CreateOrderRequest { +export interface CheckoutCreateOrderRequest { recipient?: Crossmint.Recipient; locale?: Crossmint.Locale; payment: Crossmint.Payment; diff --git a/src/api/resources/headless/client/requests/OrderDto.ts b/src/api/resources/checkout/client/requests/OrderDto.ts similarity index 100% rename from src/api/resources/headless/client/requests/OrderDto.ts rename to src/api/resources/checkout/client/requests/OrderDto.ts diff --git a/src/api/resources/checkout/client/requests/index.ts b/src/api/resources/checkout/client/requests/index.ts new file mode 100644 index 0000000..75c4af4 --- /dev/null +++ b/src/api/resources/checkout/client/requests/index.ts @@ -0,0 +1,2 @@ +export { type CheckoutCreateOrderRequest } from "./CheckoutCreateOrderRequest"; +export { type OrderDto } from "./OrderDto"; diff --git a/src/api/resources/headless/index.ts b/src/api/resources/checkout/index.ts similarity index 100% rename from src/api/resources/headless/index.ts rename to src/api/resources/checkout/index.ts diff --git a/src/api/resources/headless/client/requests/index.ts b/src/api/resources/headless/client/requests/index.ts deleted file mode 100644 index 0dbebaf..0000000 --- a/src/api/resources/headless/client/requests/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { type CreateOrderRequest } from "./CreateOrderRequest"; -export { type OrderDto } from "./OrderDto"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 7ff6823..0bcc23f 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -1,2 +1,2 @@ -export * as headless from "./headless"; -export * from "./headless/client/requests"; +export * as checkout from "./checkout"; +export * from "./checkout/client/requests"; diff --git a/src/api/types/Response403.ts b/src/api/types/BadRequestResponse.ts similarity index 75% rename from src/api/types/Response403.ts rename to src/api/types/BadRequestResponse.ts index 1db326d..f22f8cd 100644 --- a/src/api/types/Response403.ts +++ b/src/api/types/BadRequestResponse.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -export interface Response403 { +export interface BadRequestResponse { error?: boolean; message?: string; } diff --git a/src/api/types/Evm.ts b/src/api/types/EvmPaymentMethods.ts similarity index 90% rename from src/api/types/Evm.ts rename to src/api/types/EvmPaymentMethods.ts index ed06b9e..a7c83d4 100644 --- a/src/api/types/Evm.ts +++ b/src/api/types/EvmPaymentMethods.ts @@ -4,7 +4,7 @@ import * as Crossmint from "../index"; -export interface Evm { +export interface EvmPaymentMethods { /** Email that the receipt will be sent to. */ receiptEmail?: string; method: Crossmint.PaymentZeroMethod; diff --git a/src/api/types/Fiat.ts b/src/api/types/FiatPaymentMethods.ts similarity index 88% rename from src/api/types/Fiat.ts rename to src/api/types/FiatPaymentMethods.ts index a743cc3..a365c0e 100644 --- a/src/api/types/Fiat.ts +++ b/src/api/types/FiatPaymentMethods.ts @@ -4,7 +4,7 @@ import * as Crossmint from "../index"; -export interface Fiat { +export interface FiatPaymentMethods { /** Email that the receipt will be sent to. */ receiptEmail?: string; method: "stripe-payment-element"; diff --git a/src/api/types/LineItems.ts b/src/api/types/LineItems.ts index a3f11ef..cef757e 100644 --- a/src/api/types/LineItems.ts +++ b/src/api/types/LineItems.ts @@ -4,4 +4,4 @@ import * as Crossmint from "../index"; -export type LineItems = Crossmint.LineItemsCallData | Crossmint.LineItemsItem[]; +export type LineItems = Crossmint.SingleLineItem | Crossmint.LineItemsItem[]; diff --git a/src/api/types/Response400.ts b/src/api/types/NotFoundResponse.ts similarity index 76% rename from src/api/types/Response400.ts rename to src/api/types/NotFoundResponse.ts index 9aeffa0..14ad0e6 100644 --- a/src/api/types/Response400.ts +++ b/src/api/types/NotFoundResponse.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -export interface Response400 { +export interface NotFoundResponse { error?: boolean; message?: string; } diff --git a/src/api/types/Payment.ts b/src/api/types/Payment.ts index 5c38e38..ac53883 100644 --- a/src/api/types/Payment.ts +++ b/src/api/types/Payment.ts @@ -4,4 +4,4 @@ import * as Crossmint from "../index"; -export type Payment = Crossmint.Evm | Crossmint.Solana | Crossmint.Fiat; +export type Payment = Crossmint.EvmPaymentMethods | Crossmint.SolanaPaymentMethods | Crossmint.FiatPaymentMethods; diff --git a/src/api/types/Recipient.ts b/src/api/types/Recipient.ts index d69a811..1e5d79e 100644 --- a/src/api/types/Recipient.ts +++ b/src/api/types/Recipient.ts @@ -7,7 +7,7 @@ import * as Crossmint from "../index"; export type Recipient = /** * Recipient of the items being purchased. Crossmint will create a custodial wallet address for the user on the fly, that they can later log in to. If no recipient is passed, an order will be created with the status 'requires-recipient', until you pass one. */ - | Crossmint.Email + | Crossmint.RecipientEmail /** * Recipient of the items being purchased. If specifying a recipient by wallet address, ensure the address is valid for the chain your **collection** is on, which may differ from the chain the payment is performed on. */ - | Crossmint.Wallet; + | Crossmint.RecipientWallet; diff --git a/src/api/types/Email.ts b/src/api/types/RecipientEmail.ts similarity index 91% rename from src/api/types/Email.ts rename to src/api/types/RecipientEmail.ts index 8f6cfa3..72a7653 100644 --- a/src/api/types/Email.ts +++ b/src/api/types/RecipientEmail.ts @@ -5,6 +5,6 @@ /** * Recipient of the items being purchased. Crossmint will create a custodial wallet address for the user on the fly, that they can later log in to. If no recipient is passed, an order will be created with the status 'requires-recipient', until you pass one. */ -export interface Email { +export interface RecipientEmail { email: string; } diff --git a/src/api/types/Wallet.ts b/src/api/types/RecipientWallet.ts similarity index 90% rename from src/api/types/Wallet.ts rename to src/api/types/RecipientWallet.ts index 0c23033..a22c96e 100644 --- a/src/api/types/Wallet.ts +++ b/src/api/types/RecipientWallet.ts @@ -5,6 +5,6 @@ /** * Recipient of the items being purchased. If specifying a recipient by wallet address, ensure the address is valid for the chain your **collection** is on, which may differ from the chain the payment is performed on. */ -export interface Wallet { +export interface RecipientWallet { walletAddress: string; } diff --git a/src/api/types/Response524.ts b/src/api/types/Response524.ts deleted file mode 100644 index af6b986..0000000 --- a/src/api/types/Response524.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface Response524 { - error?: boolean; - message?: string; -} diff --git a/src/api/types/ServiceUnavailabileResponse.ts b/src/api/types/ServiceUnavailabileResponse.ts new file mode 100644 index 0000000..30aec3b --- /dev/null +++ b/src/api/types/ServiceUnavailabileResponse.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ServiceUnavailabileResponse { + error?: boolean; + message?: string; +} diff --git a/src/api/types/LineItemsCallData.ts b/src/api/types/SingleLineItem.ts similarity index 91% rename from src/api/types/LineItemsCallData.ts rename to src/api/types/SingleLineItem.ts index c458005..af58e8c 100644 --- a/src/api/types/LineItemsCallData.ts +++ b/src/api/types/SingleLineItem.ts @@ -4,7 +4,7 @@ import * as Crossmint from "../index"; -export interface LineItemsCallData { +export interface SingleLineItem { /** The collection locator of the line item. For example: 'crossmint:'. These fields can be retrieved from the Crossmint console. */ collectionLocator: string; /** Information that you pass to your contract mint function. */ diff --git a/src/api/types/Solana.ts b/src/api/types/SolanaPaymentMethods.ts similarity index 88% rename from src/api/types/Solana.ts rename to src/api/types/SolanaPaymentMethods.ts index 339784e..b0b05d2 100644 --- a/src/api/types/Solana.ts +++ b/src/api/types/SolanaPaymentMethods.ts @@ -4,7 +4,7 @@ import * as Crossmint from "../index"; -export interface Solana { +export interface SolanaPaymentMethods { /** Email that the receipt will be sent to. */ receiptEmail?: string; method: "solana"; diff --git a/src/api/types/Response503.ts b/src/api/types/TimeoutResponse.ts similarity index 77% rename from src/api/types/Response503.ts rename to src/api/types/TimeoutResponse.ts index 737fa01..1d4cb67 100644 --- a/src/api/types/Response503.ts +++ b/src/api/types/TimeoutResponse.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -export interface Response503 { +export interface TimeoutResponse { error?: boolean; message?: string; } diff --git a/src/api/types/Response404.ts b/src/api/types/UnauthorizedResponse.ts similarity index 74% rename from src/api/types/Response404.ts rename to src/api/types/UnauthorizedResponse.ts index 889d595..a7d5705 100644 --- a/src/api/types/Response404.ts +++ b/src/api/types/UnauthorizedResponse.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -export interface Response404 { +export interface UnauthorizedResponse { error?: boolean; message?: string; } diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 8ae5c2d..fc718a7 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -1,17 +1,17 @@ -export * from "./Email"; -export * from "./Wallet"; +export * from "./RecipientEmail"; +export * from "./RecipientWallet"; export * from "./Recipient"; export * from "./Locale"; export * from "./PaymentZeroMethod"; export * from "./PaymentZeroCurrency"; -export * from "./Evm"; +export * from "./EvmPaymentMethods"; export * from "./PaymentOneCurrency"; -export * from "./Solana"; +export * from "./SolanaPaymentMethods"; export * from "./PaymentCurrencyCurrency"; -export * from "./Fiat"; +export * from "./FiatPaymentMethods"; export * from "./Payment"; export * from "./LineItemsCallDataCallData"; -export * from "./LineItemsCallData"; +export * from "./SingleLineItem"; export * from "./LineItemsItemCallData"; export * from "./LineItemsItem"; export * from "./LineItems"; @@ -30,8 +30,8 @@ export * from "./OrderObjectQuote"; export * from "./OrderObjectPaymentPreparation"; export * from "./OrderObjectPayment"; export * from "./OrderObject"; -export * from "./Response400"; -export * from "./Response403"; -export * from "./Response404"; -export * from "./Response503"; -export * from "./Response524"; +export * from "./BadRequestResponse"; +export * from "./UnauthorizedResponse"; +export * from "./NotFoundResponse"; +export * from "./ServiceUnavailabileResponse"; +export * from "./TimeoutResponse"; diff --git a/src/environments.ts b/src/environments.ts index c89264f..985b1f7 100644 --- a/src/environments.ts +++ b/src/environments.ts @@ -3,8 +3,7 @@ */ export const CrossmintEnvironment = { - Staging: "https://staging.crossmint.com/api", - Production: "https://www.crossmint.com/api", + Default: "https://staging.crossmint.com/api", } as const; -export type CrossmintEnvironment = typeof CrossmintEnvironment.Staging | typeof CrossmintEnvironment.Production; +export type CrossmintEnvironment = typeof CrossmintEnvironment.Default; diff --git a/src/serialization/resources/headless/client/index.ts b/src/serialization/resources/checkout/client/index.ts similarity index 100% rename from src/serialization/resources/headless/client/index.ts rename to src/serialization/resources/checkout/client/index.ts diff --git a/src/serialization/resources/headless/client/requests/CreateOrderRequest.ts b/src/serialization/resources/checkout/client/requests/CheckoutCreateOrderRequest.ts similarity index 78% rename from src/serialization/resources/headless/client/requests/CreateOrderRequest.ts rename to src/serialization/resources/checkout/client/requests/CheckoutCreateOrderRequest.ts index d9fc962..8164475 100644 --- a/src/serialization/resources/headless/client/requests/CreateOrderRequest.ts +++ b/src/serialization/resources/checkout/client/requests/CheckoutCreateOrderRequest.ts @@ -10,9 +10,9 @@ import { Locale } from "../../../../types/Locale"; import { Payment } from "../../../../types/Payment"; import { LineItems } from "../../../../types/LineItems"; -export const CreateOrderRequest: core.serialization.Schema< - serializers.CreateOrderRequest.Raw, - Crossmint.CreateOrderRequest +export const CheckoutCreateOrderRequest: core.serialization.Schema< + serializers.CheckoutCreateOrderRequest.Raw, + Crossmint.CheckoutCreateOrderRequest > = core.serialization.object({ recipient: Recipient.optional(), locale: Locale.optional(), @@ -20,7 +20,7 @@ export const CreateOrderRequest: core.serialization.Schema< lineItems: LineItems, }); -export declare namespace CreateOrderRequest { +export declare namespace CheckoutCreateOrderRequest { interface Raw { recipient?: Recipient.Raw | null; locale?: Locale.Raw | null; diff --git a/src/serialization/resources/headless/client/requests/OrderDto.ts b/src/serialization/resources/checkout/client/requests/OrderDto.ts similarity index 100% rename from src/serialization/resources/headless/client/requests/OrderDto.ts rename to src/serialization/resources/checkout/client/requests/OrderDto.ts diff --git a/src/serialization/resources/checkout/client/requests/index.ts b/src/serialization/resources/checkout/client/requests/index.ts new file mode 100644 index 0000000..3c1abcb --- /dev/null +++ b/src/serialization/resources/checkout/client/requests/index.ts @@ -0,0 +1,2 @@ +export { CheckoutCreateOrderRequest } from "./CheckoutCreateOrderRequest"; +export { OrderDto } from "./OrderDto"; diff --git a/src/serialization/resources/headless/index.ts b/src/serialization/resources/checkout/index.ts similarity index 100% rename from src/serialization/resources/headless/index.ts rename to src/serialization/resources/checkout/index.ts diff --git a/src/serialization/resources/headless/client/requests/index.ts b/src/serialization/resources/headless/client/requests/index.ts deleted file mode 100644 index 584abc0..0000000 --- a/src/serialization/resources/headless/client/requests/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { CreateOrderRequest } from "./CreateOrderRequest"; -export { OrderDto } from "./OrderDto"; diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts index 7ff6823..0bcc23f 100644 --- a/src/serialization/resources/index.ts +++ b/src/serialization/resources/index.ts @@ -1,2 +1,2 @@ -export * as headless from "./headless"; -export * from "./headless/client/requests"; +export * as checkout from "./checkout"; +export * from "./checkout/client/requests"; diff --git a/src/serialization/types/BadRequestResponse.ts b/src/serialization/types/BadRequestResponse.ts new file mode 100644 index 0000000..128e08f --- /dev/null +++ b/src/serialization/types/BadRequestResponse.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Crossmint from "../../api/index"; +import * as core from "../../core"; + +export const BadRequestResponse: core.serialization.ObjectSchema< + serializers.BadRequestResponse.Raw, + Crossmint.BadRequestResponse +> = core.serialization.object({ + error: core.serialization.boolean().optional(), + message: core.serialization.string().optional(), +}); + +export declare namespace BadRequestResponse { + interface Raw { + error?: boolean | null; + message?: string | null; + } +} diff --git a/src/serialization/types/Evm.ts b/src/serialization/types/EvmPaymentMethods.ts similarity index 76% rename from src/serialization/types/Evm.ts rename to src/serialization/types/EvmPaymentMethods.ts index bf5a4c8..54fc886 100644 --- a/src/serialization/types/Evm.ts +++ b/src/serialization/types/EvmPaymentMethods.ts @@ -8,14 +8,17 @@ import * as core from "../../core"; import { PaymentZeroMethod } from "./PaymentZeroMethod"; import { PaymentZeroCurrency } from "./PaymentZeroCurrency"; -export const Evm: core.serialization.ObjectSchema = core.serialization.object({ +export const EvmPaymentMethods: core.serialization.ObjectSchema< + serializers.EvmPaymentMethods.Raw, + Crossmint.EvmPaymentMethods +> = core.serialization.object({ receiptEmail: core.serialization.string().optional(), method: PaymentZeroMethod, currency: PaymentZeroCurrency, payerAddress: core.serialization.string().optional(), }); -export declare namespace Evm { +export declare namespace EvmPaymentMethods { interface Raw { receiptEmail?: string | null; method: PaymentZeroMethod.Raw; diff --git a/src/serialization/types/Fiat.ts b/src/serialization/types/FiatPaymentMethods.ts similarity index 73% rename from src/serialization/types/Fiat.ts rename to src/serialization/types/FiatPaymentMethods.ts index c040153..4741f26 100644 --- a/src/serialization/types/Fiat.ts +++ b/src/serialization/types/FiatPaymentMethods.ts @@ -7,13 +7,16 @@ import * as Crossmint from "../../api/index"; import * as core from "../../core"; import { PaymentCurrencyCurrency } from "./PaymentCurrencyCurrency"; -export const Fiat: core.serialization.ObjectSchema = core.serialization.object({ +export const FiatPaymentMethods: core.serialization.ObjectSchema< + serializers.FiatPaymentMethods.Raw, + Crossmint.FiatPaymentMethods +> = core.serialization.object({ receiptEmail: core.serialization.string().optional(), method: core.serialization.stringLiteral("stripe-payment-element"), currency: PaymentCurrencyCurrency.optional(), }); -export declare namespace Fiat { +export declare namespace FiatPaymentMethods { interface Raw { receiptEmail?: string | null; method: "stripe-payment-element"; diff --git a/src/serialization/types/LineItems.ts b/src/serialization/types/LineItems.ts index f5f2482..506eaee 100644 --- a/src/serialization/types/LineItems.ts +++ b/src/serialization/types/LineItems.ts @@ -5,12 +5,12 @@ import * as serializers from "../index"; import * as Crossmint from "../../api/index"; import * as core from "../../core"; -import { LineItemsCallData } from "./LineItemsCallData"; +import { SingleLineItem } from "./SingleLineItem"; import { LineItemsItem } from "./LineItemsItem"; export const LineItems: core.serialization.Schema = - core.serialization.undiscriminatedUnion([LineItemsCallData, core.serialization.list(LineItemsItem)]); + core.serialization.undiscriminatedUnion([SingleLineItem, core.serialization.list(LineItemsItem)]); export declare namespace LineItems { - type Raw = LineItemsCallData.Raw | LineItemsItem.Raw[]; + type Raw = SingleLineItem.Raw | LineItemsItem.Raw[]; } diff --git a/src/serialization/types/NotFoundResponse.ts b/src/serialization/types/NotFoundResponse.ts new file mode 100644 index 0000000..2d60f18 --- /dev/null +++ b/src/serialization/types/NotFoundResponse.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Crossmint from "../../api/index"; +import * as core from "../../core"; + +export const NotFoundResponse: core.serialization.ObjectSchema< + serializers.NotFoundResponse.Raw, + Crossmint.NotFoundResponse +> = core.serialization.object({ + error: core.serialization.boolean().optional(), + message: core.serialization.string().optional(), +}); + +export declare namespace NotFoundResponse { + interface Raw { + error?: boolean | null; + message?: string | null; + } +} diff --git a/src/serialization/types/Payment.ts b/src/serialization/types/Payment.ts index a4344a8..0928564 100644 --- a/src/serialization/types/Payment.ts +++ b/src/serialization/types/Payment.ts @@ -5,13 +5,13 @@ import * as serializers from "../index"; import * as Crossmint from "../../api/index"; import * as core from "../../core"; -import { Evm } from "./Evm"; -import { Solana } from "./Solana"; -import { Fiat } from "./Fiat"; +import { EvmPaymentMethods } from "./EvmPaymentMethods"; +import { SolanaPaymentMethods } from "./SolanaPaymentMethods"; +import { FiatPaymentMethods } from "./FiatPaymentMethods"; export const Payment: core.serialization.Schema = - core.serialization.undiscriminatedUnion([Evm, Solana, Fiat]); + core.serialization.undiscriminatedUnion([EvmPaymentMethods, SolanaPaymentMethods, FiatPaymentMethods]); export declare namespace Payment { - type Raw = Evm.Raw | Solana.Raw | Fiat.Raw; + type Raw = EvmPaymentMethods.Raw | SolanaPaymentMethods.Raw | FiatPaymentMethods.Raw; } diff --git a/src/serialization/types/Recipient.ts b/src/serialization/types/Recipient.ts index 4486b18..96d0205 100644 --- a/src/serialization/types/Recipient.ts +++ b/src/serialization/types/Recipient.ts @@ -5,12 +5,12 @@ import * as serializers from "../index"; import * as Crossmint from "../../api/index"; import * as core from "../../core"; -import { Email } from "./Email"; -import { Wallet } from "./Wallet"; +import { RecipientEmail } from "./RecipientEmail"; +import { RecipientWallet } from "./RecipientWallet"; export const Recipient: core.serialization.Schema = - core.serialization.undiscriminatedUnion([Email, Wallet]); + core.serialization.undiscriminatedUnion([RecipientEmail, RecipientWallet]); export declare namespace Recipient { - type Raw = Email.Raw | Wallet.Raw; + type Raw = RecipientEmail.Raw | RecipientWallet.Raw; } diff --git a/src/serialization/types/Email.ts b/src/serialization/types/RecipientEmail.ts similarity index 59% rename from src/serialization/types/Email.ts rename to src/serialization/types/RecipientEmail.ts index 8168a8c..2203cfd 100644 --- a/src/serialization/types/Email.ts +++ b/src/serialization/types/RecipientEmail.ts @@ -6,13 +6,12 @@ import * as serializers from "../index"; import * as Crossmint from "../../api/index"; import * as core from "../../core"; -export const Email: core.serialization.ObjectSchema = core.serialization.object( - { +export const RecipientEmail: core.serialization.ObjectSchema = + core.serialization.object({ email: core.serialization.string(), - } -); + }); -export declare namespace Email { +export declare namespace RecipientEmail { interface Raw { email: string; } diff --git a/src/serialization/types/Wallet.ts b/src/serialization/types/RecipientWallet.ts similarity index 50% rename from src/serialization/types/Wallet.ts rename to src/serialization/types/RecipientWallet.ts index efe2e39..b274751 100644 --- a/src/serialization/types/Wallet.ts +++ b/src/serialization/types/RecipientWallet.ts @@ -6,12 +6,14 @@ import * as serializers from "../index"; import * as Crossmint from "../../api/index"; import * as core from "../../core"; -export const Wallet: core.serialization.ObjectSchema = - core.serialization.object({ - walletAddress: core.serialization.string(), - }); +export const RecipientWallet: core.serialization.ObjectSchema< + serializers.RecipientWallet.Raw, + Crossmint.RecipientWallet +> = core.serialization.object({ + walletAddress: core.serialization.string(), +}); -export declare namespace Wallet { +export declare namespace RecipientWallet { interface Raw { walletAddress: string; } diff --git a/src/serialization/types/Response400.ts b/src/serialization/types/Response400.ts deleted file mode 100644 index 588d5a1..0000000 --- a/src/serialization/types/Response400.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Crossmint from "../../api/index"; -import * as core from "../../core"; - -export const Response400: core.serialization.ObjectSchema = - core.serialization.object({ - error: core.serialization.boolean().optional(), - message: core.serialization.string().optional(), - }); - -export declare namespace Response400 { - interface Raw { - error?: boolean | null; - message?: string | null; - } -} diff --git a/src/serialization/types/Response403.ts b/src/serialization/types/Response403.ts deleted file mode 100644 index b3cfd69..0000000 --- a/src/serialization/types/Response403.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Crossmint from "../../api/index"; -import * as core from "../../core"; - -export const Response403: core.serialization.ObjectSchema = - core.serialization.object({ - error: core.serialization.boolean().optional(), - message: core.serialization.string().optional(), - }); - -export declare namespace Response403 { - interface Raw { - error?: boolean | null; - message?: string | null; - } -} diff --git a/src/serialization/types/Response404.ts b/src/serialization/types/Response404.ts deleted file mode 100644 index 99b9b11..0000000 --- a/src/serialization/types/Response404.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Crossmint from "../../api/index"; -import * as core from "../../core"; - -export const Response404: core.serialization.ObjectSchema = - core.serialization.object({ - error: core.serialization.boolean().optional(), - message: core.serialization.string().optional(), - }); - -export declare namespace Response404 { - interface Raw { - error?: boolean | null; - message?: string | null; - } -} diff --git a/src/serialization/types/Response503.ts b/src/serialization/types/Response503.ts deleted file mode 100644 index 9b97dc7..0000000 --- a/src/serialization/types/Response503.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Crossmint from "../../api/index"; -import * as core from "../../core"; - -export const Response503: core.serialization.ObjectSchema = - core.serialization.object({ - error: core.serialization.boolean().optional(), - message: core.serialization.string().optional(), - }); - -export declare namespace Response503 { - interface Raw { - error?: boolean | null; - message?: string | null; - } -} diff --git a/src/serialization/types/Response524.ts b/src/serialization/types/Response524.ts deleted file mode 100644 index 314ac71..0000000 --- a/src/serialization/types/Response524.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Crossmint from "../../api/index"; -import * as core from "../../core"; - -export const Response524: core.serialization.ObjectSchema = - core.serialization.object({ - error: core.serialization.boolean().optional(), - message: core.serialization.string().optional(), - }); - -export declare namespace Response524 { - interface Raw { - error?: boolean | null; - message?: string | null; - } -} diff --git a/src/serialization/types/ServiceUnavailabileResponse.ts b/src/serialization/types/ServiceUnavailabileResponse.ts new file mode 100644 index 0000000..a76e453 --- /dev/null +++ b/src/serialization/types/ServiceUnavailabileResponse.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Crossmint from "../../api/index"; +import * as core from "../../core"; + +export const ServiceUnavailabileResponse: core.serialization.ObjectSchema< + serializers.ServiceUnavailabileResponse.Raw, + Crossmint.ServiceUnavailabileResponse +> = core.serialization.object({ + error: core.serialization.boolean().optional(), + message: core.serialization.string().optional(), +}); + +export declare namespace ServiceUnavailabileResponse { + interface Raw { + error?: boolean | null; + message?: string | null; + } +} diff --git a/src/serialization/types/LineItemsCallData.ts b/src/serialization/types/SingleLineItem.ts similarity index 54% rename from src/serialization/types/LineItemsCallData.ts rename to src/serialization/types/SingleLineItem.ts index eb14f6b..3a4d192 100644 --- a/src/serialization/types/LineItemsCallData.ts +++ b/src/serialization/types/SingleLineItem.ts @@ -7,15 +7,13 @@ import * as Crossmint from "../../api/index"; import * as core from "../../core"; import { LineItemsCallDataCallData } from "./LineItemsCallDataCallData"; -export const LineItemsCallData: core.serialization.ObjectSchema< - serializers.LineItemsCallData.Raw, - Crossmint.LineItemsCallData -> = core.serialization.object({ - collectionLocator: core.serialization.string(), - callData: LineItemsCallDataCallData.optional(), -}); +export const SingleLineItem: core.serialization.ObjectSchema = + core.serialization.object({ + collectionLocator: core.serialization.string(), + callData: LineItemsCallDataCallData.optional(), + }); -export declare namespace LineItemsCallData { +export declare namespace SingleLineItem { interface Raw { collectionLocator: string; callData?: LineItemsCallDataCallData.Raw | null; diff --git a/src/serialization/types/Solana.ts b/src/serialization/types/Solana.ts deleted file mode 100644 index 4f99dc4..0000000 --- a/src/serialization/types/Solana.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Crossmint from "../../api/index"; -import * as core from "../../core"; -import { PaymentOneCurrency } from "./PaymentOneCurrency"; - -export const Solana: core.serialization.ObjectSchema = - core.serialization.object({ - receiptEmail: core.serialization.string().optional(), - method: core.serialization.stringLiteral("solana"), - currency: PaymentOneCurrency, - payerAddress: core.serialization.string().optional(), - }); - -export declare namespace Solana { - interface Raw { - receiptEmail?: string | null; - method: "solana"; - currency: PaymentOneCurrency.Raw; - payerAddress?: string | null; - } -} diff --git a/src/serialization/types/SolanaPaymentMethods.ts b/src/serialization/types/SolanaPaymentMethods.ts new file mode 100644 index 0000000..7ac2607 --- /dev/null +++ b/src/serialization/types/SolanaPaymentMethods.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Crossmint from "../../api/index"; +import * as core from "../../core"; +import { PaymentOneCurrency } from "./PaymentOneCurrency"; + +export const SolanaPaymentMethods: core.serialization.ObjectSchema< + serializers.SolanaPaymentMethods.Raw, + Crossmint.SolanaPaymentMethods +> = core.serialization.object({ + receiptEmail: core.serialization.string().optional(), + method: core.serialization.stringLiteral("solana"), + currency: PaymentOneCurrency, + payerAddress: core.serialization.string().optional(), +}); + +export declare namespace SolanaPaymentMethods { + interface Raw { + receiptEmail?: string | null; + method: "solana"; + currency: PaymentOneCurrency.Raw; + payerAddress?: string | null; + } +} diff --git a/src/serialization/types/TimeoutResponse.ts b/src/serialization/types/TimeoutResponse.ts new file mode 100644 index 0000000..70e13e7 --- /dev/null +++ b/src/serialization/types/TimeoutResponse.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Crossmint from "../../api/index"; +import * as core from "../../core"; + +export const TimeoutResponse: core.serialization.ObjectSchema< + serializers.TimeoutResponse.Raw, + Crossmint.TimeoutResponse +> = core.serialization.object({ + error: core.serialization.boolean().optional(), + message: core.serialization.string().optional(), +}); + +export declare namespace TimeoutResponse { + interface Raw { + error?: boolean | null; + message?: string | null; + } +} diff --git a/src/serialization/types/UnauthorizedResponse.ts b/src/serialization/types/UnauthorizedResponse.ts new file mode 100644 index 0000000..a722bb3 --- /dev/null +++ b/src/serialization/types/UnauthorizedResponse.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Crossmint from "../../api/index"; +import * as core from "../../core"; + +export const UnauthorizedResponse: core.serialization.ObjectSchema< + serializers.UnauthorizedResponse.Raw, + Crossmint.UnauthorizedResponse +> = core.serialization.object({ + error: core.serialization.boolean().optional(), + message: core.serialization.string().optional(), +}); + +export declare namespace UnauthorizedResponse { + interface Raw { + error?: boolean | null; + message?: string | null; + } +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 8ae5c2d..fc718a7 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -1,17 +1,17 @@ -export * from "./Email"; -export * from "./Wallet"; +export * from "./RecipientEmail"; +export * from "./RecipientWallet"; export * from "./Recipient"; export * from "./Locale"; export * from "./PaymentZeroMethod"; export * from "./PaymentZeroCurrency"; -export * from "./Evm"; +export * from "./EvmPaymentMethods"; export * from "./PaymentOneCurrency"; -export * from "./Solana"; +export * from "./SolanaPaymentMethods"; export * from "./PaymentCurrencyCurrency"; -export * from "./Fiat"; +export * from "./FiatPaymentMethods"; export * from "./Payment"; export * from "./LineItemsCallDataCallData"; -export * from "./LineItemsCallData"; +export * from "./SingleLineItem"; export * from "./LineItemsItemCallData"; export * from "./LineItemsItem"; export * from "./LineItems"; @@ -30,8 +30,8 @@ export * from "./OrderObjectQuote"; export * from "./OrderObjectPaymentPreparation"; export * from "./OrderObjectPayment"; export * from "./OrderObject"; -export * from "./Response400"; -export * from "./Response403"; -export * from "./Response404"; -export * from "./Response503"; -export * from "./Response524"; +export * from "./BadRequestResponse"; +export * from "./UnauthorizedResponse"; +export * from "./NotFoundResponse"; +export * from "./ServiceUnavailabileResponse"; +export * from "./TimeoutResponse"; diff --git a/yarn.lock b/yarn.lock index 68239e6..03b1353 100644 --- a/yarn.lock +++ b/yarn.lock @@ -45,9 +45,9 @@ semver "^6.3.1" "@babel/generator@^7.24.8", "@babel/generator@^7.24.9", "@babel/generator@^7.7.2": - version "7.24.9" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.24.9.tgz#5c2575a1070e661bbbc9df82a853989c9a656f12" - integrity sha512-G8v3jRg+z8IwY1jHFxvCNhOPYPterE4XljNgdGTYfSTtzzwjIswIzIaSPSLs3R7yFuqnqNeay5rjICfqVr+/6A== + version "7.24.10" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.24.10.tgz#a4ab681ec2a78bbb9ba22a3941195e28a81d8e76" + integrity sha512-o9HBZL1G2129luEUlG1hB4N/nlYNWHnpwlND9eOMclRqqu1YDy2sSYVCFUZwl8I1Gxh+QSRrP2vD7EpUmFVXxg== dependencies: "@babel/types" "^7.24.9" "@jridgewell/gen-mapping" "^0.3.5" @@ -650,9 +650,9 @@ form-data "^4.0.0" "@types/node@*": - version "20.14.10" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.10.tgz#a1a218290f1b6428682e3af044785e5874db469a" - integrity sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ== + version "20.14.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.11.tgz#09b300423343460455043ddd4d0ded6ac579b74b" + integrity sha512-kprQpL8MMeszbz6ojB5/tU8PLN4kesnN8Gjzw349rDlNgsSzg90lAVj3llK99Dh7JON+t9AuscPPFW6mPbTnSA== dependencies: undici-types "~5.26.4" @@ -1110,9 +1110,9 @@ domexception@^4.0.0: webidl-conversions "^7.0.0" electron-to-chromium@^1.4.820: - version "1.4.827" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.827.tgz#76068ed1c71dd3963e1befc8ae815004b2da6a02" - integrity sha512-VY+J0e4SFcNfQy19MEoMdaIcZLmDCprqvBtkii1WTCTQHpRvf5N8+3kTYCgL/PcntvwQvmMJWTuDPsq+IlhWKQ== + version "1.4.828" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.828.tgz#a1ee8cd8847448b2898d3f2d9db02113f9c5b35c" + integrity sha512-QOIJiWpQJDHAVO4P58pwb133Cwee0nbvy/MV1CwzZVGpkH1RX33N3vsaWRCpR6bF63AAq366neZrRTu7Qlsbbw== emittery@^0.13.1: version "0.13.1" @@ -1232,11 +1232,6 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -fern-api@^0.31.22: - version "0.31.24" - resolved "https://registry.yarnpkg.com/fern-api/-/fern-api-0.31.24.tgz#352d9151b618fcd8e4a0cc3a27151a2a1a4f28eb" - integrity sha512-hO0BY0q3+//OVLALI6875Sh6OlMPRJG4HeIRjIaX4ZmMtPbsZKMoowPSKWyewwnw2uYotklIgIsZWLKoAo7C3A== - fill-range@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" @@ -2082,9 +2077,9 @@ node-int64@^0.4.0: integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== node-releases@^2.0.14: - version "2.0.14" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.14.tgz#2ffb053bceb8b2be8495ece1ab6ce600c4461b0b" - integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw== + version "2.0.17" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.17.tgz#d74bc4fec38d839eec5db2a3c9c963d4f33cb366" + integrity sha512-Ww6ZlOiEQfPfXM45v17oabk77Z7mg5bOt7AjDyzy7RjK9OrLrLC8dyZQoAPEOtFX9SaNf1Tdvr5gRJWdTJj7GA== normalize-path@^3.0.0: version "3.0.0" @@ -2315,9 +2310,9 @@ semver@^6.3.0, semver@^6.3.1: integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== semver@^7.5.3, semver@^7.5.4: - version "7.6.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" - integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== + version "7.6.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== set-function-length@^1.2.1: version "1.2.2"