Skip to content

Commit ecabd78

Browse files
committed
feat: run prettier
1 parent 37a199f commit ecabd78

File tree

2 files changed

+39
-39
lines changed

2 files changed

+39
-39
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);
@@ -241,7 +241,7 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
241241
iframeClient: TurnkeyIframeClient,
242242
targetPublicKey?: string, // TODO: eventually we want to automatically pull this from localStorage/iframe
243243

244-
expirationSeconds: string = DEFAULT_SESSION_EXPIRATION_IN_SECONDS
244+
expirationSeconds: string = DEFAULT_SESSION_EXPIRATION_IN_SECONDS,
245245
): Promise<void> => {
246246
// Create a read-only session
247247
if (sessionType === SessionType.READ_ONLY) {
@@ -261,7 +261,7 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
261261
if (sessionType === SessionType.READ_WRITE) {
262262
if (!targetPublicKey) {
263263
throw new Error(
264-
"You must provide a targetPublicKey to create a read-write session."
264+
"You must provide a targetPublicKey to create a read-write session.",
265265
);
266266
}
267267

@@ -280,7 +280,7 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
280280

281281
if (!iframeClient) {
282282
throw new Error(
283-
"You must provide an iframe client to log in with a passkey."
283+
"You must provide an iframe client to log in with a passkey.",
284284
);
285285
}
286286
await iframeClient.injectCredentialBundle(session.token!);
@@ -304,7 +304,7 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
304304
loginWithReadWriteSession = async (
305305
targetEmbeddedKey: string,
306306
expirationSeconds: string = DEFAULT_SESSION_EXPIRATION_IN_SECONDS,
307-
userId?: string
307+
userId?: string,
308308
): Promise<SdkApiTypes.TCreateReadWriteSessionResponse> => {
309309
const readWriteSessionResult = await this.createReadWriteSession({
310310
targetPublicKey: targetEmbeddedKey,
@@ -334,7 +334,7 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
334334
*/
335335
loginWithAuthBundle = async (
336336
credentialBundle: string,
337-
expirationSeconds: string = DEFAULT_SESSION_EXPIRATION_IN_SECONDS
337+
expirationSeconds: string = DEFAULT_SESSION_EXPIRATION_IN_SECONDS,
338338
): Promise<any> => {
339339
try {
340340
const whoAmIResult = await this.getWhoami();
@@ -388,20 +388,20 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
388388

389389
if (phoneNumber) {
390390
promises.push(
391-
this.updateUser({ userId, userPhoneNumber: "", userTagIds: [] })
391+
this.updateUser({ userId, userPhoneNumber: "", userTagIds: [] }),
392392
);
393393
}
394394
if (email) {
395395
promises.push(
396-
this.updateUser({ userId, userEmail: "", userTagIds: [] })
396+
this.updateUser({ userId, userEmail: "", userTagIds: [] }),
397397
);
398398
}
399399
if (authenticatorIds && authenticatorIds.length > 0) {
400400
promises.push(this.deleteAuthenticators({ userId, authenticatorIds }));
401401
}
402402
if (oauthProviderIds && oauthProviderIds.length > 0) {
403403
promises.push(
404-
this.deleteOauthProviders({ userId, providerIds: oauthProviderIds })
404+
this.deleteOauthProviders({ userId, providerIds: oauthProviderIds }),
405405
);
406406
}
407407
if (apiKeyIds && apiKeyIds.length > 0) {
@@ -456,12 +456,12 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
456456
userId,
457457
userPhoneNumber: phoneNumber,
458458
userTagIds: [],
459-
})
459+
}),
460460
);
461461
}
462462
if (email) {
463463
promises.push(
464-
this.updateUser({ userId, userEmail: email, userTagIds: [] })
464+
this.updateUser({ userId, userEmail: email, userTagIds: [] }),
465465
);
466466
}
467467
if (authenticators && authenticators.length > 0) {
@@ -526,7 +526,7 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
526526
}
527527
if (Object.keys(userUpdates).length > 0) {
528528
promises.push(
529-
this.updateUser({ userId, ...userUpdates, userTagIds: [] })
529+
this.updateUser({ userId, ...userUpdates, userTagIds: [] }),
530530
);
531531
}
532532

@@ -537,15 +537,15 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
537537
this.createAuthenticators({
538538
userId,
539539
authenticators: authenticators.add,
540-
})
540+
}),
541541
);
542542
}
543543
if (authenticators.deleteIds?.length) {
544544
promises.push(
545545
this.deleteAuthenticators({
546546
userId,
547547
authenticatorIds: authenticators.deleteIds,
548-
})
548+
}),
549549
);
550550
}
551551
}
@@ -557,15 +557,15 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
557557
this.createOauthProviders({
558558
userId,
559559
oauthProviders: oauthProviders.add,
560-
})
560+
}),
561561
);
562562
}
563563
if (oauthProviders.deleteIds?.length) {
564564
promises.push(
565565
this.deleteOauthProviders({
566566
userId,
567567
providerIds: oauthProviders.deleteIds,
568-
})
568+
}),
569569
);
570570
}
571571
}
@@ -577,15 +577,15 @@ export class TurnkeyBrowserClient extends TurnkeyBaseClient {
577577
this.createApiKeys({
578578
userId,
579579
apiKeys: apiKeys.add,
580-
})
580+
}),
581581
);
582582
}
583583
if (apiKeys.deleteIds?.length) {
584584
promises.push(
585585
this.deleteApiKeys({
586586
userId,
587587
apiKeyIds: apiKeys.deleteIds,
588-
})
588+
}),
589589
);
590590
}
591591
}
@@ -614,7 +614,7 @@ export class TurnkeyPasskeyClient extends TurnkeyBrowserClient {
614614
* @returns {Promise<Passkey>}
615615
*/
616616
createUserPasskey = async (
617-
config: Record<any, any> = {}
617+
config: Record<any, any> = {},
618618
): Promise<Passkey> => {
619619
const challenge = generateRandomBuffer();
620620
const encodedChallenge = base64UrlEncode(challenge);
@@ -694,15 +694,15 @@ export class TurnkeyPasskeyClient extends TurnkeyBrowserClient {
694694
userId: string,
695695
targetEmbeddedKey: string,
696696
expirationSeconds: string = DEFAULT_SESSION_EXPIRATION_IN_SECONDS,
697-
organizationId?: string
697+
organizationId?: string,
698698
): Promise<ReadWriteSession> => {
699699
const user = await getStorageValue(StorageKeys.UserSession);
700700
organizationId = organizationId ?? user?.organization.organizationId;
701701
userId = userId ?? user?.userId;
702702

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

@@ -738,7 +738,7 @@ export class TurnkeyPasskeyClient extends TurnkeyBrowserClient {
738738
credentialBundle,
739739
sessionExpiry: expiry,
740740
},
741-
this.authClient
741+
this.authClient,
742742
);
743743

744744
return {
@@ -763,44 +763,44 @@ export class TurnkeyIframeClient extends TurnkeyBrowserClient {
763763
}
764764

765765
injectCredentialBundle = async (
766-
credentialBundle: string
766+
credentialBundle: string,
767767
): Promise<boolean> => {
768768
return await (this.stamper as IframeStamper).injectCredentialBundle(
769-
credentialBundle
769+
credentialBundle,
770770
);
771771
};
772772

773773
injectWalletExportBundle = async (
774774
credentialBundle: string,
775-
organizationId: string
775+
organizationId: string,
776776
): Promise<boolean> => {
777777
return await (this.stamper as IframeStamper).injectWalletExportBundle(
778778
credentialBundle,
779-
organizationId
779+
organizationId,
780780
);
781781
};
782782

783783
injectKeyExportBundle = async (
784784
credentialBundle: string,
785785
organizationId: string,
786-
keyFormat?: KeyFormat | undefined
786+
keyFormat?: KeyFormat | undefined,
787787
): Promise<boolean> => {
788788
return await (this.stamper as IframeStamper).injectKeyExportBundle(
789789
credentialBundle,
790790
organizationId,
791-
keyFormat
791+
keyFormat,
792792
);
793793
};
794794

795795
injectImportBundle = async (
796796
bundle: string,
797797
organizationId: string,
798-
userId: string
798+
userId: string,
799799
): Promise<boolean> => {
800800
return await (this.stamper as IframeStamper).injectImportBundle(
801801
bundle,
802802
organizationId,
803-
userId
803+
userId,
804804
);
805805
};
806806

packages/sdk-react/src/contexts/TurnkeyContext.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const TurnkeyProvider: React.FC<TurnkeyProviderProps> = ({
5757
TurnkeyIframeClient | undefined
5858
>(undefined);
5959
const [client, setClient] = useState<TurnkeyBrowserClient | undefined>(
60-
undefined
60+
undefined,
6161
);
6262

6363
const { session } = useUserSession();
@@ -122,7 +122,7 @@ export const TurnkeyProvider: React.FC<TurnkeyProviderProps> = ({
122122
// create an instance of TurnkeyIframeClient
123123
const iframeClient = await turnkeyBrowserSDK.iframeClient({
124124
iframeContainer: document.getElementById(
125-
TurnkeyAuthIframeContainerId
125+
TurnkeyAuthIframeContainerId,
126126
),
127127
iframeUrl: config.iframeUrl || "https://auth.turnkey.com",
128128
iframeElementId: TurnkeyAuthIframeElementId,

0 commit comments

Comments
 (0)