Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
src/lib/seam/connect/resources/** linguist-generated
src/lib/seam/connect/routes/** linguist-generated
src/lib/resources/** linguist-generated
src/lib/routes/** linguist-generated
4 changes: 2 additions & 2 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
uses: tj-actions/changed-files@v44
with:
files: |
src/lib/seam/connect/routes/**
src/lib/seam/connect/resources/**
src/lib/routes/**
src/lib/resources/**
merge:
name: Merge
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { seamApiLtsVersion } from 'lib/lts-version.js'
import { type Client, createClient } from 'lib/seam/connect/client.js'
import { type Client, createClient } from 'lib/client.js'
import {
isSeamHttpWithoutWorkspaceOptionsWithClient,
isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken,
Expand All @@ -10,5 +10,5 @@ import {
type SeamHttpWithoutWorkspaceOptionsWithClient,
type SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken,
type SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken,
} from 'lib/seam/connect/options.js'
import { limitToSeamHttpRequestOptions, parseOptions } from 'lib/seam/connect/parse-options.js'
} from 'lib/options.js'
import { limitToSeamHttpRequestOptions, parseOptions } from 'lib/parse-options.js'
18 changes: 9 additions & 9 deletions codegen/layouts/partials/route-imports.hbs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { seamApiLtsVersion } from 'lib/lts-version.js'
{{#each resourceTypeImports}}
import type { {{typeName}} } from 'lib/seam/connect/resources/{{fileName}}'
import type { {{typeName}} } from 'lib/resources/{{fileName}}'
{{/each}}

import {
getAuthHeadersForClientSessionToken,
warnOnInsecureuserIdentifierKey,
} from 'lib/seam/connect/auth.js'
} from 'lib/auth.js'
import {
type Client,
type ClientOptions,
createClient,
} from 'lib/seam/connect/client.js'
} from 'lib/client.js'
import {
isSeamHttpOptionsWithApiKey,
isSeamHttpOptionsWithClient,
Expand All @@ -27,19 +27,19 @@ import {
type SeamHttpOptionsWithConsoleSessionToken,
type SeamHttpOptionsWithPersonalAccessToken,
type SeamHttpRequestOptions,
} from 'lib/seam/connect/options.js'
} from 'lib/options.js'
import {
limitToSeamHttpRequestOptions,
parseOptions
} from 'lib/seam/connect/parse-options.js'
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js'
} from 'lib/parse-options.js'
import { SeamHttpRequest } from 'lib/seam-http-request.js'
import { SeamPaginator } from 'lib/seam-paginator.js'

{{#if needsActionAttemptsImport}}
import { SeamHttpActionAttempts } from 'lib/seam/connect/routes/action-attempts/index.js'
import { SeamHttpActionAttempts } from 'lib/routes/action-attempts/index.js'
{{/if}}
{{#unless skipClientSessionImport}}
import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js'
import { SeamHttpClientSessions } from 'lib/routes/client-sessions/index.js'
{{/unless}}

{{#each subroutes}}
Expand Down
2 changes: 1 addition & 1 deletion codegen/layouts/without-workspace.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{{> route-imports-without-workspace }}

import { SeamHttpWorkspaces } from 'lib/seam/connect/routes/workspaces/index.js'
import { SeamHttpWorkspaces } from 'lib/routes/workspaces/index.js'

export class SeamHttpWithoutWorkspace {
{{> route-class-methods-without-workspace }}
Expand Down
9 changes: 3 additions & 6 deletions codegen/lib/connect.ts → codegen/lib/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ type File = RouteLayoutContext &
ResourceLayoutContext &
ResourceIndexLayoutContext & { layout: string }

const rootPath = 'src/lib/seam/connect/routes'
const resourcesPath = 'src/lib/seam/connect/resources'
const rootPath = 'src/lib/routes'
const resourcesPath = 'src/lib/resources'

const supportedAuthMethods: SeamAuthMethod[] = [
'api_key',
Expand All @@ -39,10 +39,7 @@ const supportedAuthMethods: SeamAuthMethod[] = [
'console_session_token',
]

export const connect = (
files: Metalsmith.Files,
metalsmith: Metalsmith,
): void => {
export const http = (files: Metalsmith.Files, metalsmith: Metalsmith): void => {
const metadata = metalsmith.metadata() as Metadata
const { blueprint } = metadata

Expand Down
2 changes: 1 addition & 1 deletion codegen/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import * as customHelpers from './handlebars-helpers.js'

export const helpers = { ...handlebarsHelpers, ...customHelpers }

export * from './connect.js'
export * from './http.js'
8 changes: 4 additions & 4 deletions codegen/smith.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import * as types from '@seamapi/types/connect'
import { deleteAsync } from 'del'
import Metalsmith from 'metalsmith'

import { connect, helpers } from './lib/index.js'
import { helpers, http } from './lib/index.js'

const rootDir = dirname(fileURLToPath(import.meta.url))

await Promise.all([
deleteAsync('./src/lib/seam/connect/routes'),
deleteAsync('./src/lib/seam/connect/resources'),
deleteAsync('./src/lib/routes'),
deleteAsync('./src/lib/resources'),
])

const partials = await getHandlebarsPartials(`${rootDir}/layouts/partials`)
Expand All @@ -23,7 +23,7 @@ Metalsmith(rootDir)
.destination('../')
.clean(false)
.use(blueprint({ types, omitUndocumented: true }))
.use(connect)
.use(http)
.use(
layouts({
default: 'default.hbs',
Expand Down
121 changes: 2 additions & 119 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 4 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"import": "./index.js"
},
"./connect": {
"types": "./connect.d.ts",
"import": "./connect.js"
"types": "./index.d.ts",
"import": "./index.js"
}
},
"module": "index.js",
Expand All @@ -32,18 +32,15 @@
"index.js",
"index.js.map",
"index.d.ts",
"connect.js",
"connect.js.map",
"connect.d.ts",
"lib",
"src",
"!test",
"!**/*.test.ts"
],
"scripts": {
"build": "npm run build:entrypoints",
"prebuild": "concurrently --raw --group 'tsx src/index.ts' 'tsx src/connect.ts'",
"postbuild": "concurrently --raw --group 'node ./index.js' 'node ./connect.js'",
"prebuild": "tsx src/index.ts",
"postbuild": "node ./index.js",
"build:entrypoints": "npm run build:ts",
"build:ts": "tsc --project tsconfig.build.json",
"prebuild:ts": "del 'index.*' 'connect.*' lib",
Expand Down Expand Up @@ -96,7 +93,6 @@
"ava": "^8.0.1",
"c8": "^12.0.0",
"change-case": "^5.0.2",
"concurrently": "^10.0.4",
"del-cli": "^7.0.0",
"eslint": "^9.31.0",
"eslint-import-resolver-typescript": "^4.4.5",
Expand Down
2 changes: 0 additions & 2 deletions src/connect.ts

This file was deleted.

3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './connect.js'
export * from './lib/index.js'
export * from '@seamapi/url-search-params-serializer'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading