Skip to content

Commit

Permalink
refactor(types): consistent import paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ijxy committed Dec 20, 2024
1 parent 46e1b3d commit 108527f
Show file tree
Hide file tree
Showing 25 changed files with 29 additions and 53 deletions.
3 changes: 1 addition & 2 deletions packages/types/src/authConfig.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { AuthConfigJSONSnapshot } from 'snapshots';

import type { ClerkResource } from './resource';
import type { AuthConfigJSONSnapshot } from './snapshots';

export interface AuthConfigResource extends ClerkResource {
/**
Expand Down
5 changes: 2 additions & 3 deletions packages/types/src/clerk.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import type { ClientJSONSnapshot, EnvironmentJSONSnapshot } from 'snapshots';
import type { TelemetryCollector } from 'telemetry';

import type {
Appearance,
CreateOrganizationTheme,
Expand Down Expand Up @@ -39,7 +36,9 @@ import type { ActiveSessionResource } from './session';
import type { SessionVerificationLevel } from './sessionVerification';
import type { SignInResource } from './signIn';
import type { SignUpResource } from './signUp';
import type { ClientJSONSnapshot, EnvironmentJSONSnapshot } from './snapshots';
import type { Web3Strategy } from './strategies';
import type { TelemetryCollector } from './telemetry';
import type { UserResource } from './user';
import type { Autocomplete, DeepPartial, DeepSnakeToCamel } from './utils';
import type { WaitlistResource } from './waitlist';
Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import type { ClientJSONSnapshot } from 'snapshots';

import type { ClerkResource } from './resource';
import type { ActiveSessionResource, SessionResource } from './session';
import type { SignInResource } from './signIn';
import type { SignUpResource } from './signUp';
import type { ClientJSONSnapshot } from './snapshots';

export interface ClientResource extends ClerkResource {
sessions: SessionResource[];
Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/displayConfig.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { DisplayConfigJSONSnapshot } from 'snapshots';

import type { DisplayThemeJSON } from './json';
import type { ClerkResource } from './resource';
import type { DisplayConfigJSONSnapshot } from './snapshots';
import type { OAuthStrategy } from './strategies';

export type PreferredSignInStrategy = 'password' | 'otp';
Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/emailAddress.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { EmailAddressJSONSnapshot } from 'snapshots';

import type { IdentificationLinkResource } from './identificationLink';
import type { ClerkResource } from './resource';
import type { EmailAddressJSONSnapshot } from './snapshots';
import type { EmailCodeStrategy, EmailLinkStrategy } from './strategies';
import type { CreateEmailLinkFlowReturn, StartEmailLinkFlowParams, VerificationResource } from './verification';

Expand Down
9 changes: 4 additions & 5 deletions packages/types/src/enterpriseAccount.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import type { OAuthProvider } from 'oauth';
import type { SamlIdpSlug } from 'saml';
import type { EnterpriseAccountConnectionJSONSnapshot, EnterpriseAccountJSONSnapshot } from 'snapshots';
import type { VerificationResource } from 'verification';

import type { OAuthProvider } from './oauth';
import type { ClerkResource } from './resource';
import type { SamlIdpSlug } from './saml';
import type { EnterpriseAccountConnectionJSONSnapshot, EnterpriseAccountJSONSnapshot } from './snapshots';
import type { VerificationResource } from './verification';

export type EnterpriseProtocol = 'saml' | 'oauth';

Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/environment.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import type { EnvironmentJSONSnapshot } from 'snapshots';

import type { AuthConfigResource } from './authConfig';
import type { DisplayConfigResource } from './displayConfig';
import type { OrganizationSettingsResource } from './organizationSettings';
import type { ClerkResource } from './resource';
import type { EnvironmentJSONSnapshot } from './snapshots';
import type { UserSettingsResource } from './userSettings';

export interface EnvironmentResource extends ClerkResource {
Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/externalAccount.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { ExternalAccountJSONSnapshot } from 'snapshots';

import type { OAuthProvider, OAuthScope } from './oauth';
import type { ClerkResource } from './resource';
import type { ExternalAccountJSONSnapshot } from './snapshots';
import type { VerificationResource } from './verification';

export type ReauthorizeExternalAccountParams = {
Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/identificationLink.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { IdentificationLinkJSONSnapshot } from 'snapshots';

import type { ClerkResource } from './resource';
import type { IdentificationLinkJSONSnapshot } from './snapshots';

export interface IdentificationLinkResource extends ClerkResource {
id: string;
Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/organization.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import type { OrganizationJSONSnapshot } from 'snapshots';

import type { OrganizationDomainResource, OrganizationEnrollmentMode } from './organizationDomain';
import type { OrganizationInvitationResource, OrganizationInvitationStatus } from './organizationInvitation';
import type { OrganizationCustomRoleKey, OrganizationMembershipResource } from './organizationMembership';
import type { OrganizationMembershipRequestResource } from './organizationMembershipRequest';
import type { ClerkPaginatedResponse, ClerkPaginationParams } from './pagination';
import type { ClerkResource } from './resource';
import type { RoleResource } from './role';
import type { OrganizationJSONSnapshot } from './snapshots';

declare global {
/**
Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/organizationMembership.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { OrganizationMembershipJSONSnapshot } from 'snapshots';

import type { OrganizationResource } from './organization';
import type { ClerkResource } from './resource';
import type { PublicUserData } from './session';
import type { OrganizationMembershipJSONSnapshot } from './snapshots';
import type { Autocomplete } from './utils';

interface Base {
Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/organizationSettings.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { OrganizationSettingsJSONSnapshot } from 'snapshots';

import type { ClerkResourceJSON } from './json';
import type { OrganizationEnrollmentMode } from './organizationDomain';
import type { ClerkResource } from './resource';
import type { OrganizationSettingsJSONSnapshot } from './snapshots';

export interface OrganizationSettingsJSON extends ClerkResourceJSON {
id: never;
Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/passkey.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { PasskeyJSONSnapshot } from 'snapshots';

import type { DeletedObjectResource } from './deletedObject';
import type { PasskeyJSON } from './json';
import type { ClerkResource } from './resource';
import type { PasskeyJSONSnapshot } from './snapshots';
import type { SnakeToCamel } from './utils';
import type { PasskeyVerificationResource } from './verification';

Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/phoneNumber.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { PhoneNumberJSONSnapshot } from 'snapshots';

import type { IdentificationLinkResource } from './identificationLink';
import type { ClerkResource } from './resource';
import type { PhoneNumberJSONSnapshot } from './snapshots';
import type { PhoneCodeStrategy } from './strategies';
import type { VerificationResource } from './verification';

Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/samlAccount.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { SamlAccountJSONSnapshot } from 'snapshots';

import type { ClerkResource } from './resource';
import type { SamlIdpSlug } from './saml';
import type { SamlAccountConnectionResource } from './samlConnection';
import type { SamlAccountJSONSnapshot } from './snapshots';
import type { VerificationResource } from './verification';

export interface SamlAccountResource extends ClerkResource {
Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/samlConnection.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { SamlAccountConnectionJSONSnapshot } from 'snapshots';

import type { ClerkResource } from './resource';
import type { SamlAccountConnectionJSONSnapshot } from './snapshots';

export interface SamlAccountConnectionResource extends ClerkResource {
id: string;
Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/session.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { SessionJSONSnapshot } from 'snapshots';

import type {
BackupCodeAttempt,
EmailCodeAttempt,
Expand All @@ -22,6 +20,7 @@ import type {
SessionVerificationLevel,
SessionVerificationResource,
} from './sessionVerification';
import type { SessionJSONSnapshot } from './snapshots';
import type { TokenResource } from './token';
import type { UserResource } from './user';

Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/signIn.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { SignInJSONSnapshot } from 'snapshots';

import type {
BackupCodeAttempt,
BackupCodeFactor,
Expand Down Expand Up @@ -51,6 +49,7 @@ import type {
import type { ValidatePasswordCallbacks } from './passwords';
import type { AuthenticateWithRedirectParams } from './redirects';
import type { ClerkResource } from './resource';
import type { SignInJSONSnapshot } from './snapshots';
import type {
BackupCodeStrategy,
EmailCodeStrategy,
Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/signUp.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { SignUpJSONSnapshot, SignUpVerificationJSONSnapshot, SignUpVerificationsJSONSnapshot } from 'snapshots';

import type { FirstNameAttribute, LastNameAttribute, LegalAcceptedAttribute, PasswordAttribute } from './attributes';
import type { AttemptEmailAddressVerificationParams, PrepareEmailAddressVerificationParams } from './emailAddress';
import type {
Expand All @@ -13,6 +11,7 @@ import type { ValidatePasswordCallbacks } from './passwords';
import type { AttemptPhoneNumberVerificationParams, PreparePhoneNumberVerificationParams } from './phoneNumber';
import type { AuthenticateWithRedirectParams } from './redirects';
import type { ClerkResource } from './resource';
import type { SignUpJSONSnapshot, SignUpVerificationJSONSnapshot, SignUpVerificationsJSONSnapshot } from './snapshots';
import type {
EmailCodeStrategy,
EmailLinkStrategy,
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/telemetry.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { InstanceType } from 'instance';
import type { InstanceType } from './instance';

/**
* @internal
Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/token.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { TokenJSONSnapshot } from 'snapshots';

import type { JWT } from './jwt';
import type { ClerkResource } from './resource';
import type { TokenJSONSnapshot } from './snapshots';

export interface TokenResource extends ClerkResource {
jwt?: JWT;
Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/user.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { UserJSONSnapshot } from 'snapshots';

import type { BackupCodeResource } from './backupCode';
import type { DeletedObjectResource } from './deletedObject';
import type { EmailAddressResource } from './emailAddress';
Expand All @@ -17,6 +15,7 @@ import type { PhoneNumberResource } from './phoneNumber';
import type { ClerkResource } from './resource';
import type { SamlAccountResource } from './samlAccount';
import type { SessionWithActivitiesResource } from './session';
import type { UserJSONSnapshot } from './snapshots';
import type { OAuthStrategy } from './strategies';
import type { TOTPResource } from './totp';
import type { UserOrganizationInvitationResource } from './userOrganizationInvitation';
Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/userSettings.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { UserSettingsJSONSnapshot } from 'snapshots';

import type { ClerkResourceJSON } from './json';
import type { ClerkResource } from './resource';
import type { UserSettingsJSONSnapshot } from './snapshots';
import type { OAuthStrategy, Web3Strategy } from './strategies';

export type Attribute =
Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/verification.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { VerificationJSONSnapshot } from 'snapshots';

import type { ClerkAPIError } from './api';
import type { PublicKeyCredentialCreationOptionsWithoutExtensions } from './passkey';
import type { ClerkResource } from './resource';
import type { VerificationJSONSnapshot } from './snapshots';

export interface VerificationResource extends ClerkResource {
attempts: number | null;
Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/web3Wallet.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Web3WalletJSONSnapshot } from 'snapshots';

import type { ClerkResource } from './resource';
import type { Web3WalletJSONSnapshot } from './snapshots';
import type { Web3Strategy } from './strategies';
import type { VerificationResource } from './verification';
import type { Web3Provider } from './web3';
Expand Down

0 comments on commit 108527f

Please sign in to comment.