From 4a0ff0608c88fa15b5b660e77477bd8bac377109 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 17 Jul 2024 19:49:10 +0000 Subject: [PATCH] Release 0.1.7 --- .mock/definition/api.yml | 5 +++-- package.json | 2 +- src/api/resources/checkout/client/Client.ts | 12 ++++++------ src/environments.ts | 5 +++-- tests/custom/custom.test.ts | 2 +- yarn.lock | 6 +++--- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.mock/definition/api.yml b/.mock/definition/api.yml index 37d0d1d..a092262 100644 --- a/.mock/definition/api.yml +++ b/.mock/definition/api.yml @@ -2,9 +2,10 @@ name: api error-discrimination: strategy: status-code display-name: Headless Checkout +default-environment: Staging environments: - Default: https://staging.crossmint.com/api -default-environment: Default + Staging: https://staging.crossmint.com/api + Production: https://www.crossmint.com/api auth-schemes: apiKey: header: X-API-KEY diff --git a/package.json b/package.json index 0322088..a15ea95 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "crossmint", - "version": "0.1.6", + "version": "0.1.7", "private": false, "repository": "https://github.com/fern-demo/crossmint-typescript-sdk", "main": "./index.js", diff --git a/src/api/resources/checkout/client/Client.ts b/src/api/resources/checkout/client/Client.ts index 723deb6..db435cb 100644 --- a/src/api/resources/checkout/client/Client.ts +++ b/src/api/resources/checkout/client/Client.ts @@ -57,14 +57,14 @@ export class Checkout { ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.CrossmintEnvironment.Default, + (await core.Supplier.get(this._options.environment)) ?? environments.CrossmintEnvironment.Staging, "2022-06-09/orders" ), method: "POST", headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "crossmint", - "X-Fern-SDK-Version": "0.1.6", + "X-Fern-SDK-Version": "0.1.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -169,14 +169,14 @@ export class Checkout { 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.Default, + (await core.Supplier.get(this._options.environment)) ?? environments.CrossmintEnvironment.Staging, `2022-06-09/orders/${encodeURIComponent(orderId)}` ), method: "GET", headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "crossmint", - "X-Fern-SDK-Version": "0.1.6", + "X-Fern-SDK-Version": "0.1.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -285,14 +285,14 @@ export class Checkout { ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.CrossmintEnvironment.Default, + (await core.Supplier.get(this._options.environment)) ?? environments.CrossmintEnvironment.Staging, `2022-06-09/orders/${encodeURIComponent(orderId)}` ), method: "PATCH", headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "crossmint", - "X-Fern-SDK-Version": "0.1.6", + "X-Fern-SDK-Version": "0.1.7", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/environments.ts b/src/environments.ts index 985b1f7..c89264f 100644 --- a/src/environments.ts +++ b/src/environments.ts @@ -3,7 +3,8 @@ */ export const CrossmintEnvironment = { - Default: "https://staging.crossmint.com/api", + Staging: "https://staging.crossmint.com/api", + Production: "https://www.crossmint.com/api", } as const; -export type CrossmintEnvironment = typeof CrossmintEnvironment.Default; +export type CrossmintEnvironment = typeof CrossmintEnvironment.Staging | typeof CrossmintEnvironment.Production; diff --git a/tests/custom/custom.test.ts b/tests/custom/custom.test.ts index 16dacbf..89e71bd 100644 --- a/tests/custom/custom.test.ts +++ b/tests/custom/custom.test.ts @@ -7,7 +7,7 @@ describe("Integration", () => { environment: CrossmintEnvironment.Staging }) - const create = await client.headless.createOrder({ + const create = await client.checkout.createOrder({ "recipient": { "email": "jsmith@example.com" }, diff --git a/yarn.lock b/yarn.lock index 03b1353..4b2afd2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1110,9 +1110,9 @@ domexception@^4.0.0: webidl-conversions "^7.0.0" electron-to-chromium@^1.4.820: - version "1.4.828" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.828.tgz#a1ee8cd8847448b2898d3f2d9db02113f9c5b35c" - integrity sha512-QOIJiWpQJDHAVO4P58pwb133Cwee0nbvy/MV1CwzZVGpkH1RX33N3vsaWRCpR6bF63AAq366neZrRTu7Qlsbbw== + version "1.4.829" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.829.tgz#3034a865b5eac9064c9db8b38ba99b60a446bb73" + integrity sha512-5qp1N2POAfW0u1qGAxXEtz6P7bO1m6gpZr5hdf5ve6lxpLM7MpiM4jIPz7xcrNlClQMafbyUDDWjlIQZ1Mw0Rw== emittery@^0.13.1: version "0.13.1"