diff --git a/reference.md b/reference.md index f49565a8..73556c03 100644 --- a/reference.md +++ b/reference.md @@ -13705,48 +13705,6 @@ await client.vendors.update({ - - - - -## Mobile -
client.mobile.authorizationCode() -> void -
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.mobile.authorizationCode(); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**requestOptions:** `MobileClient.RequestOptions` - -
-
-
-
- -
diff --git a/src/Client.ts b/src/Client.ts index 417d575b..0a21e773 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -20,7 +20,6 @@ import { LaborClient } from "./api/resources/labor/client/Client"; import { LocationsClient } from "./api/resources/locations/client/Client"; import { LoyaltyClient } from "./api/resources/loyalty/client/Client"; import { MerchantsClient } from "./api/resources/merchants/client/Client"; -import { MobileClient } from "./api/resources/mobile/client/Client"; import { OAuthClient } from "./api/resources/oAuth/client/Client"; import { OrdersClient } from "./api/resources/orders/client/Client"; import { PaymentsClient } from "./api/resources/payments/client/Client"; @@ -80,7 +79,6 @@ export class SquareClient { protected _terminal: TerminalClient | undefined; protected _transferOrders: TransferOrdersClient | undefined; protected _vendors: VendorsClient | undefined; - protected _mobile: MobileClient | undefined; protected _cashDrawers: CashDrawersClient | undefined; protected _webhooks: WebhooksClient | undefined; @@ -220,10 +218,6 @@ export class SquareClient { return (this._vendors ??= new VendorsClient(this._options)); } - public get mobile(): MobileClient { - return (this._mobile ??= new MobileClient(this._options)); - } - public get cashDrawers(): CashDrawersClient { return (this._cashDrawers ??= new CashDrawersClient(this._options)); } diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index cc68fc92..daa39f21 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -37,7 +37,6 @@ export * as loyalty from "./loyalty"; export * from "./loyalty/client/requests"; export * as merchants from "./merchants"; export * from "./merchants/client/requests"; -export * as mobile from "./mobile"; export * as oAuth from "./oAuth"; export * from "./oAuth/client/requests"; export * as orders from "./orders"; diff --git a/src/api/resources/mobile/client/Client.ts b/src/api/resources/mobile/client/Client.ts deleted file mode 100644 index 52fb86c8..00000000 --- a/src/api/resources/mobile/client/Client.ts +++ /dev/null @@ -1,74 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient"; -import * as core from "../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError"; -import * as errors from "../../../../errors/index"; - -export declare namespace MobileClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class MobileClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - - constructor(options: MobileClient.Options = {}) { - this._options = normalizeClientOptionsWithAuth(options); - } - - /** - * @param {MobileClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.mobile.authorizationCode() - */ - public authorizationCode(requestOptions?: MobileClient.RequestOptions): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__authorizationCode(requestOptions)); - } - - private async __authorizationCode( - requestOptions?: MobileClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Square-Version": requestOptions?.version ?? "2026-01-22" }), - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.SquareEnvironment.Production, - "mobile/authorization-code", - ), - method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { data: undefined, rawResponse: _response.rawResponse }; - } - - if (_response.error.reason === "status-code") { - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/mobile/authorization-code"); - } -} diff --git a/src/api/resources/mobile/client/index.ts b/src/api/resources/mobile/client/index.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/src/api/resources/mobile/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/src/api/resources/mobile/index.ts b/src/api/resources/mobile/index.ts deleted file mode 100644 index 5ec76921..00000000 --- a/src/api/resources/mobile/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client"; diff --git a/tests/wire/mobile.test.ts b/tests/wire/mobile.test.ts deleted file mode 100644 index e134d29c..00000000 --- a/tests/wire/mobile.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import { SquareClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; - -describe("MobileClient", () => { - test("authorizationCode", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - server.mockEndpoint().post("/mobile/authorization-code").respondWith().statusCode(200).build(); - - const response = await client.mobile.authorizationCode(); - expect(response).toEqual(undefined); - }); -});