@@ -22,36 +22,37 @@ import {
2222 type SeamHttpOptionsWithClientSessionToken ,
2323} from 'lib/seam/connect/options.js'
2424import { parseOptions } from 'lib/seam/connect/parse-options.js'
25- import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions.js'
25+
26+ import { SeamHttpClientSessions } from './client-sessions.js'
2627
2728export class SeamHttpAccessCodesUnmanaged {
2829 client : Client
2930
3031 constructor ( apiKeyOrOptions : string | SeamHttpOptions = { } ) {
31- const options = parseOptions ( apiKeyOrOptions )
32- this . client = createClient ( options )
32+ const clientOptions = parseOptions ( apiKeyOrOptions )
33+ this . client = createClient ( clientOptions )
3334 }
3435
3536 static fromClient (
3637 client : SeamHttpOptionsWithClient [ 'client' ] ,
3738 options : Omit < SeamHttpOptionsWithClient , 'client' > = { } ,
3839 ) : SeamHttpAccessCodesUnmanaged {
39- const opts = { ...options , client }
40- if ( ! isSeamHttpOptionsWithClient ( opts ) ) {
40+ const constructorOptions = { ...options , client }
41+ if ( ! isSeamHttpOptionsWithClient ( constructorOptions ) ) {
4142 throw new SeamHttpInvalidOptionsError ( 'Missing client' )
4243 }
43- return new SeamHttpAccessCodesUnmanaged ( opts )
44+ return new SeamHttpAccessCodesUnmanaged ( constructorOptions )
4445 }
4546
4647 static fromApiKey (
4748 apiKey : SeamHttpOptionsWithApiKey [ 'apiKey' ] ,
4849 options : Omit < SeamHttpOptionsWithApiKey , 'apiKey' > = { } ,
4950 ) : SeamHttpAccessCodesUnmanaged {
50- const opts = { ...options , apiKey }
51- if ( ! isSeamHttpOptionsWithApiKey ( opts ) ) {
51+ const constructorOptions = { ...options , apiKey }
52+ if ( ! isSeamHttpOptionsWithApiKey ( constructorOptions ) ) {
5253 throw new SeamHttpInvalidOptionsError ( 'Missing apiKey' )
5354 }
54- return new SeamHttpAccessCodesUnmanaged ( opts )
55+ return new SeamHttpAccessCodesUnmanaged ( constructorOptions )
5556 }
5657
5758 static fromClientSessionToken (
@@ -61,20 +62,20 @@ export class SeamHttpAccessCodesUnmanaged {
6162 'clientSessionToken'
6263 > = { } ,
6364 ) : SeamHttpAccessCodesUnmanaged {
64- const opts = { ...options , clientSessionToken }
65- if ( ! isSeamHttpOptionsWithClientSessionToken ( opts ) ) {
65+ const constructorOptions = { ...options , clientSessionToken }
66+ if ( ! isSeamHttpOptionsWithClientSessionToken ( constructorOptions ) ) {
6667 throw new SeamHttpInvalidOptionsError ( 'Missing clientSessionToken' )
6768 }
68- return new SeamHttpAccessCodesUnmanaged ( opts )
69+ return new SeamHttpAccessCodesUnmanaged ( constructorOptions )
6970 }
7071
7172 static async fromPublishableKey (
7273 publishableKey : string ,
7374 userIdentifierKey : string ,
7475 options : ClientOptions = { } ,
7576 ) : Promise < SeamHttpAccessCodesUnmanaged > {
76- const opts = parseOptions ( options )
77- const client = createClient ( { ... opts , publishableKey } )
77+ const clientOptions = parseOptions ( { ... options , publishableKey } )
78+ const client = createClient ( clientOptions )
7879 const clientSessions = SeamHttpClientSessions . fromClient ( client )
7980 // TODO: clientSessions.getOrCreate({ user_identifier_key: userIdentifierKey })
8081 const { token } = await clientSessions . create ( {
0 commit comments