From 43a7cf9d92b5e9578a569c58ca9c4eefc706436f Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Thu, 21 Sep 2023 15:06:54 -0700 Subject: [PATCH] Use RouteResponse and RouteRequestParams --- src/lib/seam/connect/legacy/workspaces.ts | 18 ++++++------------ src/lib/seam/connect/routes/workspaces.ts | 18 ++++++------------ 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/src/lib/seam/connect/legacy/workspaces.ts b/src/lib/seam/connect/legacy/workspaces.ts index d870a9c9..8072f225 100644 --- a/src/lib/seam/connect/legacy/workspaces.ts +++ b/src/lib/seam/connect/legacy/workspaces.ts @@ -1,11 +1,12 @@ -// TODO: Example of non-generated overrides to methods to preserve legacy behavior -import type { Routes } from '@seamapi/types/connect' +import type { RouteRequestParams, RouteResponse } from '@seamapi/types/connect' import type { SetNonNullable } from 'type-fest' import { Workspaces } from 'lib/seam/connect/routes/workspaces.js' export class LegacyWorkspaces extends Workspaces { - override async get(params: WorkspacesGetParams = {}): Promise { + override async get( + params: WorkspacesGetParams = {}, + ): Promise { const { data: { workspace }, } = await this.client.get('/workspaces/get', { @@ -16,16 +17,9 @@ export class LegacyWorkspaces extends Workspaces { } export type WorkspacesGetParams = SetNonNullable< - Required + Required> > export type WorkspacesGetResponse = SetNonNullable< - Required + Required> > - -// UPSTREAM: Should come from @seamapi/types/connect -// import type { Workspace } from @seamapi/types -// export type { Workspace } from '@seamapi/types/connect' -export interface Workspace { - workspace_id: string -} diff --git a/src/lib/seam/connect/routes/workspaces.ts b/src/lib/seam/connect/routes/workspaces.ts index b21ae010..dd0c53f9 100644 --- a/src/lib/seam/connect/routes/workspaces.ts +++ b/src/lib/seam/connect/routes/workspaces.ts @@ -1,5 +1,4 @@ -// TODO: This file is generated from route spec -import type { Routes } from '@seamapi/types/connect' +import type { RouteRequestParams, RouteResponse } from '@seamapi/types/connect' import type { Axios } from 'axios' import type { SetNonNullable } from 'type-fest' @@ -10,7 +9,9 @@ export class Workspaces { this.client = client } - async get(params: WorkspacesGetParams = {}): Promise { + async get( + params: WorkspacesGetParams = {}, + ): Promise { const { data: { workspace }, } = await this.client.get('/workspaces/get', { @@ -21,16 +22,9 @@ export class Workspaces { } export type WorkspacesGetParams = SetNonNullable< - Required + Required> > export type WorkspacesGetResponse = SetNonNullable< - Required + Required> > - -// UPSTREAM: Should come from @seamapi/types/connect -// import type { Workspace } from @seamapi/types -// export type { Workspace } from '@seamapi/types/connect' -export interface Workspace { - workspace_id: string -}