From efdc0cbc896669318ffe7422623453e4a4d8df76 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 15:19:03 +0000 Subject: [PATCH] Release 0.1.1 --- .mock/definition/__package__.yml | 322 ++++++++++++++++++++ .mock/definition/api.yml | 14 + .mock/definition/headless.yml | 186 +++++++++++ .mock/fern.config.json | 4 + package.json | 2 +- src/api/resources/headless/client/Client.ts | 6 +- 6 files changed, 530 insertions(+), 4 deletions(-) create mode 100644 .mock/definition/__package__.yml create mode 100644 .mock/definition/api.yml create mode 100644 .mock/definition/headless.yml create mode 100644 .mock/fern.config.json diff --git a/.mock/definition/__package__.yml b/.mock/definition/__package__.yml new file mode 100644 index 0000000..fc68fef --- /dev/null +++ b/.mock/definition/__package__.yml @@ -0,0 +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. +types: + 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. + properties: + email: + type: string + validation: + format: email + 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. + 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 + 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: + 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: + 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 diff --git a/.mock/definition/api.yml b/.mock/definition/api.yml new file mode 100644 index 0000000..a092262 --- /dev/null +++ b/.mock/definition/api.yml @@ -0,0 +1,14 @@ +name: api +error-discrimination: + strategy: status-code +display-name: Headless Checkout +default-environment: Staging +environments: + Staging: https://staging.crossmint.com/api + Production: https://www.crossmint.com/api +auth-schemes: + apiKey: + header: X-API-KEY + name: apiKey + type: string +auth: apiKey diff --git a/.mock/definition/headless.yml b/.mock/definition/headless.yml new file mode 100644 index 0000000..e2d8da7 --- /dev/null +++ b/.mock/definition/headless.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: 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 new file mode 100644 index 0000000..197432e --- /dev/null +++ b/.mock/fern.config.json @@ -0,0 +1,4 @@ +{ + "organization" : "crossmint", + "version" : "0.31.24" +} \ No newline at end of file diff --git a/package.json b/package.json index 6b3b5b4..b374aa5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "crossmint", - "version": "0.1.0", + "version": "0.1.1", "private": false, "repository": "https://github.com/fern-demo/crossmint-typescript-sdk", "main": "./index.js", diff --git a/src/api/resources/headless/client/Client.ts b/src/api/resources/headless/client/Client.ts index 9f7417e..9d7a419 100644 --- a/src/api/resources/headless/client/Client.ts +++ b/src/api/resources/headless/client/Client.ts @@ -64,7 +64,7 @@ export class Headless { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "crossmint", - "X-Fern-SDK-Version": "0.1.0", + "X-Fern-SDK-Version": "0.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -176,7 +176,7 @@ export class Headless { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "crossmint", - "X-Fern-SDK-Version": "0.1.0", + "X-Fern-SDK-Version": "0.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -292,7 +292,7 @@ export class Headless { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "crossmint", - "X-Fern-SDK-Version": "0.1.0", + "X-Fern-SDK-Version": "0.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()),