Skip to content

Commit f2de0b4

Browse files
committed
feat: run prettier
1 parent 8edb21b commit f2de0b4

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

packages/sdk-browser/src/__clients__/browser-clients.ts

+37-37
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
108108
organizationId?: string;
109109
}): Promise<SdkApiTypes.TCreateReadOnlySessionResponse> => {
110110
const readOnlySessionResult = await this.createReadOnlySession(
111-
config || {}
111+
config || {},
112112
);
113113
await saveSession(readOnlySessionResult, this.authClient);
114114

@@ -128,12 +128,12 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
128128
refereshSession = async (
129129
sessionType: SessionType = SessionType.READ_WRITE,
130130
targetPublicKey?: string, // TODO: eventually we want to automatically pull this from localStorage/iframe
131-
expirationSeconds: string = DEFAULT_SESSION_EXPIRATION_IN_SECONDS
131+
expirationSeconds: string = DEFAULT_SESSION_EXPIRATION_IN_SECONDS,
132132
): Promise<void> => {
133133
if (sessionType === SessionType.READ_ONLY) {
134134
if (this! instanceof TurnkeyPasskeyClient) {
135135
throw new Error(
136-
"You must use a passkey client to refresh a read session"
136+
"You must use a passkey client to refresh a read session",
137137
); // TODO: support wallet clients perhaps?
138138
}
139139
const readOnlySessionResult = await this.createReadOnlySession({});
@@ -150,7 +150,7 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
150150
if (sessionType === SessionType.READ_WRITE) {
151151
if (!targetPublicKey) {
152152
throw new Error(
153-
"You must provide a targetPublicKey to refresh a read-write session."
153+
"You must provide a targetPublicKey to refresh a read-write session.",
154154
);
155155
}
156156
const readWriteSessionResult = await this.createReadWriteSession({
@@ -170,7 +170,7 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
170170
} else {
171171
// Throw an error if the client is not an iframe client
172172
throw new Error(
173-
"You must use an iframe client to refresh a read-write session"
173+
"You must use an iframe client to refresh a read-write session",
174174
); //should we default to a "localStorage" client?
175175
}
176176
await storeSession(session, AuthClient.Iframe);
@@ -187,14 +187,14 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
187187
*/
188188
loginWithBundle = async (
189189
bundle: string, // we need a way to get the expiry of this token. Either it lives in the token itself or is returned from the server action and passed again here
190-
expirationSeconds: string // we need a way to get the expiry of this token. Either it lives in the token itself or is returned from the server action and passed again here
190+
expirationSeconds: string, // we need a way to get the expiry of this token. Either it lives in the token itself or is returned from the server action and passed again here
191191
): Promise<void> => {
192192
if (this! instanceof TurnkeyIframeClient) {
193193
await this.injectCredentialBundle(bundle);
194194
} else {
195195
// Throw an error if the client is not an iframe client
196196
throw new Error(
197-
"You must use an iframe client to log in with a session."
197+
"You must use an iframe client to log in with a session.",
198198
); //should we default to a "localStorage" client?
199199
}
200200
const whoAmI = await this.getWhoami();
@@ -223,7 +223,7 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
223223
} else {
224224
// Throw an error if the client is not an iframe client
225225
throw new Error(
226-
"You must use an iframe client to log in with a session."
226+
"You must use an iframe client to log in with a session.",
227227
); //should we default to a "localStorage" client?
228228
}
229229
await storeSession(session, AuthClient.Iframe);
@@ -240,7 +240,7 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
240240
sessionType: SessionType = SessionType.READ_WRITE,
241241
iframeClient: TurnkeyIframeClient,
242242
targetPublicKey?: string, // TODO: eventually we want to automatically pull this from localStorage/iframe
243-
expirationSeconds: string = DEFAULT_SESSION_EXPIRATION_IN_SECONDS
243+
expirationSeconds: string = DEFAULT_SESSION_EXPIRATION_IN_SECONDS,
244244
): Promise<void> => {
245245
// Create a read-only session
246246
if (sessionType === SessionType.READ_ONLY) {
@@ -260,7 +260,7 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
260260
if (sessionType === SessionType.READ_WRITE) {
261261
if (!targetPublicKey) {
262262
throw new Error(
263-
"You must provide a targetPublicKey to create a read-write session."
263+
"You must provide a targetPublicKey to create a read-write session.",
264264
);
265265
}
266266

@@ -279,7 +279,7 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
279279

280280
if (!iframeClient) {
281281
throw new Error(
282-
"You must provide an iframe client to log in with a passkey."
282+
"You must provide an iframe client to log in with a passkey.",
283283
);
284284
}
285285
await iframeClient.injectCredentialBundle(session.token!);
@@ -303,7 +303,7 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
303303
loginWithReadWriteSession = async (
304304
targetEmbeddedKey: string,
305305
expirationSeconds: string = DEFAULT_SESSION_EXPIRATION_IN_SECONDS,
306-
userId?: string
306+
userId?: string,
307307
): Promise<SdkApiTypes.TCreateReadWriteSessionResponse> => {
308308
const readWriteSessionResult = await this.createReadWriteSession({
309309
targetPublicKey: targetEmbeddedKey,
@@ -333,7 +333,7 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
333333
*/
334334
loginWithAuthBundle = async (
335335
credentialBundle: string,
336-
expirationSeconds: string = DEFAULT_SESSION_EXPIRATION_IN_SECONDS
336+
expirationSeconds: string = DEFAULT_SESSION_EXPIRATION_IN_SECONDS,
337337
): Promise<any> => {
338338
try {
339339
const whoAmIResult = await this.getWhoami();
@@ -387,20 +387,20 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
387387

388388
if (phoneNumber) {
389389
promises.push(
390-
this.updateUser({ userId, userPhoneNumber: "", userTagIds: [] })
390+
this.updateUser({ userId, userPhoneNumber: "", userTagIds: [] }),
391391
);
392392
}
393393
if (email) {
394394
promises.push(
395-
this.updateUser({ userId, userEmail: "", userTagIds: [] })
395+
this.updateUser({ userId, userEmail: "", userTagIds: [] }),
396396
);
397397
}
398398
if (authenticatorIds && authenticatorIds.length > 0) {
399399
promises.push(this.deleteAuthenticators({ userId, authenticatorIds }));
400400
}
401401
if (oauthProviderIds && oauthProviderIds.length > 0) {
402402
promises.push(
403-
this.deleteOauthProviders({ userId, providerIds: oauthProviderIds })
403+
this.deleteOauthProviders({ userId, providerIds: oauthProviderIds }),
404404
);
405405
}
406406
if (apiKeyIds && apiKeyIds.length > 0) {
@@ -455,12 +455,12 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
455455
userId,
456456
userPhoneNumber: phoneNumber,
457457
userTagIds: [],
458-
})
458+
}),
459459
);
460460
}
461461
if (email) {
462462
promises.push(
463-
this.updateUser({ userId, userEmail: email, userTagIds: [] })
463+
this.updateUser({ userId, userEmail: email, userTagIds: [] }),
464464
);
465465
}
466466
if (authenticators && authenticators.length > 0) {
@@ -525,7 +525,7 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
525525
}
526526
if (Object.keys(userUpdates).length > 0) {
527527
promises.push(
528-
this.updateUser({ userId, ...userUpdates, userTagIds: [] })
528+
this.updateUser({ userId, ...userUpdates, userTagIds: [] }),
529529
);
530530
}
531531

@@ -536,15 +536,15 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
536536
this.createAuthenticators({
537537
userId,
538538
authenticators: authenticators.add,
539-
})
539+
}),
540540
);
541541
}
542542
if (authenticators.deleteIds?.length) {
543543
promises.push(
544544
this.deleteAuthenticators({
545545
userId,
546546
authenticatorIds: authenticators.deleteIds,
547-
})
547+
}),
548548
);
549549
}
550550
}
@@ -556,15 +556,15 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
556556
this.createOauthProviders({
557557
userId,
558558
oauthProviders: oauthProviders.add,
559-
})
559+
}),
560560
);
561561
}
562562
if (oauthProviders.deleteIds?.length) {
563563
promises.push(
564564
this.deleteOauthProviders({
565565
userId,
566566
providerIds: oauthProviders.deleteIds,
567-
})
567+
}),
568568
);
569569
}
570570
}
@@ -576,15 +576,15 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
576576
this.createApiKeys({
577577
userId,
578578
apiKeys: apiKeys.add,
579-
})
579+
}),
580580
);
581581
}
582582
if (apiKeys.deleteIds?.length) {
583583
promises.push(
584584
this.deleteApiKeys({
585585
userId,
586586
apiKeyIds: apiKeys.deleteIds,
587-
})
587+
}),
588588
);
589589
}
590590
}
@@ -613,7 +613,7 @@ export class TurnkeyPasskeyClient extends TurnkeyBrowserClient {
613613
* @returns {Promise<Passkey>}
614614
*/
615615
createUserPasskey = async (
616-
config: Record<any, any> = {}
616+
config: Record<any, any> = {},
617617
): Promise<Passkey> => {
618618
const challenge = generateRandomBuffer();
619619
const encodedChallenge = base64UrlEncode(challenge);
@@ -693,15 +693,15 @@ export class TurnkeyPasskeyClient extends TurnkeyBrowserClient {
693693
userId: string,
694694
targetEmbeddedKey: string,
695695
expirationSeconds: string = DEFAULT_SESSION_EXPIRATION_IN_SECONDS,
696-
organizationId?: string
696+
organizationId?: string,
697697
): Promise<ReadWriteSession> => {
698698
const user = await getStorageValue(StorageKeys.UserSession);
699699
organizationId = organizationId ?? user?.organization.organizationId;
700700
userId = userId ?? user?.userId;
701701

702702
if (!organizationId) {
703703
throw new Error(
704-
"Error creating passkey session: Organization ID is required"
704+
"Error creating passkey session: Organization ID is required",
705705
);
706706
}
707707

@@ -737,7 +737,7 @@ export class TurnkeyPasskeyClient extends TurnkeyBrowserClient {
737737
credentialBundle,
738738
sessionExpiry: expiry,
739739
},
740-
this.authClient
740+
this.authClient,
741741
);
742742

743743
return {
@@ -762,44 +762,44 @@ export class TurnkeyIframeClient extends TurnkeyBrowserClient {
762762
}
763763

764764
injectCredentialBundle = async (
765-
credentialBundle: string
765+
credentialBundle: string,
766766
): Promise<boolean> => {
767767
return await (this.stamper as IframeStamper).injectCredentialBundle(
768-
credentialBundle
768+
credentialBundle,
769769
);
770770
};
771771

772772
injectWalletExportBundle = async (
773773
credentialBundle: string,
774-
organizationId: string
774+
organizationId: string,
775775
): Promise<boolean> => {
776776
return await (this.stamper as IframeStamper).injectWalletExportBundle(
777777
credentialBundle,
778-
organizationId
778+
organizationId,
779779
);
780780
};
781781

782782
injectKeyExportBundle = async (
783783
credentialBundle: string,
784784
organizationId: string,
785-
keyFormat?: KeyFormat | undefined
785+
keyFormat?: KeyFormat | undefined,
786786
): Promise<boolean> => {
787787
return await (this.stamper as IframeStamper).injectKeyExportBundle(
788788
credentialBundle,
789789
organizationId,
790-
keyFormat
790+
keyFormat,
791791
);
792792
};
793793

794794
injectImportBundle = async (
795795
bundle: string,
796796
organizationId: string,
797-
userId: string
797+
userId: string,
798798
): Promise<boolean> => {
799799
return await (this.stamper as IframeStamper).injectImportBundle(
800800
bundle,
801801
organizationId,
802-
userId
802+
userId,
803803
);
804804
};
805805

0 commit comments

Comments
 (0)