@@ -2,11 +2,11 @@ import { readFile, writeFile } from 'node:fs/promises'
22import { resolve } from 'node:path'
33
44import { openapi } from '@seamapi/types/connect'
5- import { camelCase , paramCase , pascalCase , snakeCase } from 'change-case'
5+ import { camelCase , kebabCase , pascalCase , snakeCase } from 'change-case'
66import { ESLint } from 'eslint'
77import { format , resolveConfig } from 'prettier'
88
9- const rootClassPath = resolve ( 'src' , 'lib' , 'seam' , 'connect' , 'client .ts' )
9+ const rootClassPath = resolve ( 'src' , 'lib' , 'seam' , 'connect' , 'seam-http .ts' )
1010const routeOutputPath = resolve ( 'src' , 'lib' , 'seam' , 'connect' , 'routes' )
1111
1212const routePaths = [
@@ -237,7 +237,7 @@ import type { RouteRequestParams, RouteResponse, RouteRequestBody } from '@seama
237237import { Axios } from 'axios'
238238import type { SetNonNullable } from 'type-fest'
239239
240- import { createAxiosClient } from 'lib/seam/connect/axios .js'
240+ import { createClient } from 'lib/seam/connect/client .js'
241241import {
242242 isSeamHttpOptionsWithApiKey,
243243 isSeamHttpOptionsWithClient,
@@ -247,7 +247,7 @@ import {
247247 type SeamHttpOptionsWithApiKey,
248248 type SeamHttpOptionsWithClient,
249249 type SeamHttpOptionsWithClientSessionToken,
250- } from 'lib/seam/connect/client- options.js'
250+ } from 'lib/seam/connect/options.js'
251251import { parseOptions } from 'lib/seam/connect/parse-options.js'
252252${ subresources
253253 . map ( ( subresource ) => renderSubresourceImport ( subresource , namespace ) )
@@ -259,7 +259,7 @@ const renderSubresourceImport = (
259259) : string => `
260260 import {
261261 SeamHttp${ pascalCase ( namespace ) } ${ pascalCase ( subresource ) }
262- } from './${ paramCase ( namespace ) } -${ paramCase ( subresource ) } .js'
262+ } from './${ kebabCase ( namespace ) } -${ kebabCase ( subresource ) } .js'
263263`
264264
265265const renderClass = (
@@ -389,13 +389,13 @@ const writeRoute = async (route: Route): Promise<void> => {
389389 await write (
390390 renderRoute ( route , { constructors } ) ,
391391 routeOutputPath ,
392- `${ paramCase ( route . namespace ) } .ts` ,
392+ `${ kebabCase ( route . namespace ) } .ts` ,
393393 )
394394}
395395
396396const writeRoutesIndex = async ( routes : Route [ ] ) : Promise < void > => {
397397 const exports = routes . map (
398- ( route ) => `export * from './${ paramCase ( route . namespace ) } .js'` ,
398+ ( route ) => `export * from './${ kebabCase ( route . namespace ) } .js'` ,
399399 )
400400 await write ( exports . join ( '\n' ) , routeOutputPath , `index.ts` )
401401}
0 commit comments