diff --git a/.changeset/plenty-peas-pretend.md b/.changeset/plenty-peas-pretend.md new file mode 100644 index 0000000000..d52fe008d5 --- /dev/null +++ b/.changeset/plenty-peas-pretend.md @@ -0,0 +1,6 @@ +--- +'@clerk/clerk-js': patch +'@clerk/types': patch +--- + +Initialize `tasks` on `Session` resource diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index b122e4cce9..ea41eaa12a 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -65,4 +65,3 @@ export * from './customMenuItems'; export * from './samlConnection'; export * from './waitlist'; export * from './snapshots'; -export * from './tasks'; diff --git a/packages/types/src/json.ts b/packages/types/src/json.ts index a7acb98ad5..962179431d 100644 --- a/packages/types/src/json.ts +++ b/packages/types/src/json.ts @@ -12,11 +12,10 @@ import type { OrganizationCustomRoleKey, OrganizationPermissionKey } from './org import type { OrganizationSettingsJSON } from './organizationSettings'; import type { OrganizationSuggestionStatus } from './organizationSuggestion'; import type { SamlIdpSlug } from './saml'; -import type { SessionStatus } from './session'; +import type { SessionStatus, SessionTasks } from './session'; import type { SessionVerificationLevel, SessionVerificationStatus } from './sessionVerification'; import type { SignInFirstFactor, SignInJSON, SignInSecondFactor } from './signIn'; import type { SignUpField, SignUpIdentificationField, SignUpStatus } from './signUp'; -import type { SessionTasks } from './tasks'; import type { BoxShadow, Color, EmUnit, FontWeight, HexColor } from './theme'; import type { UserSettingsJSON } from './userSettings'; import type { CamelToSnake } from './utils'; diff --git a/packages/types/src/session.ts b/packages/types/src/session.ts index 75fa93e6b9..76a782b9e2 100644 --- a/packages/types/src/session.ts +++ b/packages/types/src/session.ts @@ -96,13 +96,14 @@ export interface SessionResource extends ClerkResource { /** * Factor Verification Age * Each item represents the minutes that have passed since the last time a first or second factor were verified. - * [fistFactorAge, secondFactorAge] + * [firstFactorAge, secondFactorAge] */ - factorVerificationAge: [fistFactorAge: number, secondFactorAge: number] | null; + factorVerificationAge: [firstFactorAge: number, secondFactorAge: number] | null; lastActiveToken: TokenResource | null; lastActiveOrganizationId: string | null; lastActiveAt: Date; actor: ActJWTClaim | null; + tasks: SessionTasks | null; user: UserResource | null; publicUserData: PublicUserData; end: () => Promise; @@ -169,6 +170,10 @@ export interface PublicUserData { userId?: string; } +export interface SessionTasks { + orgs: Record; +} + export type GetTokenOptions = { template?: string; organizationId?: string; diff --git a/packages/types/src/tasks.ts b/packages/types/src/tasks.ts deleted file mode 100644 index 068ebd3e9b..0000000000 --- a/packages/types/src/tasks.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface SessionTasks { - orgs: Record; -}