@clerk/types
Advanced tools
Comparing version
@@ -0,4 +1,38 @@ | ||
import { EmailAddressVerificationStrategy } from './emailAddress'; | ||
import { ClerkResource } from './resource'; | ||
import { IdentificationStrategy, SignInStrategyName } from './signIn'; | ||
/** | ||
* Authentication configuration attributes set. | ||
*/ | ||
export interface AuthConfigResource extends ClerkResource { | ||
id: string; | ||
firstName: ToggleTypeWithRequire; | ||
lastName: ToggleTypeWithRequire; | ||
emailAddress: ToggleType; | ||
phoneNumber: ToggleType; | ||
username: ToggleType; | ||
password: string; | ||
/** | ||
* Types of identification strategies selected. | ||
*/ | ||
identificationStrategies: IdentificationStrategy[]; | ||
/** | ||
* Combinations of strategies. | ||
*/ | ||
identificationRequirements: IdentificationStrategy[][]; | ||
passwordConditions: any; | ||
/** | ||
* Type of first factor authentication used. | ||
*/ | ||
firstFactors: SignInStrategyName[]; | ||
/** | ||
* Type of second factor authentication used. | ||
*/ | ||
secondFactors: SignInStrategyName[]; | ||
/** | ||
* All the verification strategies that can be used in | ||
* this instance to verify an email address. | ||
*/ | ||
emailAddressVerificationStrategies: EmailAddressVerificationStrategy[]; | ||
/** | ||
* Enabled single session configuration at the instance level. | ||
@@ -8,2 +42,4 @@ */ | ||
} | ||
export declare type ToggleType = 'on' | 'off'; | ||
export declare type ToggleTypeWithRequire = ToggleType | 'required'; | ||
//# sourceMappingURL=authConfig.d.ts.map |
import { AuthConfigResource } from './authConfig'; | ||
import { DisplayConfigResource } from './displayConfig'; | ||
import { ClerkResource } from './resource'; | ||
import { UserSettingsResource } from './userSettings'; | ||
export interface EnvironmentResource extends ClerkResource { | ||
userSettings: UserSettingsResource; | ||
authConfig: AuthConfigResource; | ||
@@ -8,0 +6,0 @@ displayConfig: DisplayConfigResource; |
@@ -25,3 +25,2 @@ export * from './api'; | ||
export * from './user'; | ||
export * from './userSettings'; | ||
export * from './utils'; | ||
@@ -28,0 +27,0 @@ export * from './verification'; |
@@ -37,3 +37,2 @@ "use strict"; | ||
__exportStar(require("./user"), exports); | ||
__exportStar(require("./userSettings"), exports); | ||
__exportStar(require("./utils"), exports); | ||
@@ -40,0 +39,0 @@ __exportStar(require("./verification"), exports); |
@@ -5,8 +5,9 @@ /** | ||
import { MembershipRole, OrganizationInvitationStatus } from '.'; | ||
import { ToggleType, ToggleTypeWithRequire } from './authConfig'; | ||
import { EmailAddressVerificationStrategy } from './emailAddress'; | ||
import { OAuthStrategy } from './oauth'; | ||
import { SessionStatus } from './session'; | ||
import { PreferredSignInStrategy, SignInFactor, SignInIdentifier, SignInStatus, UserData } from './signIn'; | ||
import { IdentificationStrategy, PreferredSignInStrategy, SignInFactor, SignInIdentifier, SignInStatus, SignInStrategyName, UserData } from './signIn'; | ||
import { SignUpField, SignUpIdentificationField, SignUpStatus } from './signUp'; | ||
import { BoxShadow, Color, EmUnit, FontFamily, FontWeight, HexColor } from './theme'; | ||
import { UserSettingsJSON } from './userSettings'; | ||
import { VerificationStatus } from './verification'; | ||
@@ -68,3 +69,2 @@ export interface ClerkResourceJSON { | ||
display_config: DisplayConfigJSON; | ||
user_settings: UserSettingsJSON; | ||
} | ||
@@ -189,3 +189,17 @@ export interface ClientJSON extends ClerkResourceJSON { | ||
} | ||
export interface AuthConfigJSON extends ClerkResourceJSON { | ||
export interface AuthConfigJSON { | ||
object: 'auth_config'; | ||
id: string; | ||
first_name: ToggleTypeWithRequire; | ||
last_name: ToggleTypeWithRequire; | ||
email_address: ToggleType; | ||
phone_number: ToggleType; | ||
username: ToggleType; | ||
password: ToggleTypeWithRequire; | ||
identification_strategies: IdentificationStrategy[]; | ||
identification_requirements: IdentificationStrategy[][]; | ||
password_conditions: any; | ||
first_factors: SignInStrategyName[]; | ||
second_factors: SignInStrategyName[]; | ||
email_address_verification_strategies: EmailAddressVerificationStrategy[]; | ||
single_session_mode: boolean; | ||
@@ -192,0 +206,0 @@ } |
@@ -102,4 +102,11 @@ "use strict"; | ||
.sort(function (a, b) { | ||
return sortingArray.indexOf(a.strategy) - | ||
sortingArray.indexOf(b.strategy); | ||
var aPos = sortingArray.indexOf(a.strategy); | ||
if (aPos == -1) { | ||
aPos = Number.MAX_SAFE_INTEGER; | ||
} | ||
var bPos = sortingArray.indexOf(b.strategy); | ||
if (bPos == -1) { | ||
bPos = Number.MAX_SAFE_INTEGER; | ||
} | ||
return aPos - bPos; | ||
}); | ||
@@ -106,0 +113,0 @@ } |
{ | ||
"name": "@clerk/types", | ||
"version": "1.27.3-staging.0", | ||
"version": "1.28.0", | ||
"license": "MIT", | ||
@@ -51,3 +51,3 @@ "description": "Typings for Clerk libraries.", | ||
"homepage": "https://clerk.dev/", | ||
"gitHead": "79137f93058fb7e2cba346da021719735d6a629e" | ||
"gitHead": "b4e29d586d8f0a9b5405abc0e345fd055a17dd68" | ||
} |
@@ -0,5 +1,53 @@ | ||
import { EmailAddressVerificationStrategy } from './emailAddress'; | ||
import { ClerkResource } from './resource'; | ||
import { IdentificationStrategy, SignInStrategyName } from './signIn'; | ||
/** | ||
* Authentication configuration attributes set. | ||
*/ | ||
export interface AuthConfigResource extends ClerkResource { | ||
id: string; | ||
firstName: ToggleTypeWithRequire; | ||
lastName: ToggleTypeWithRequire; | ||
emailAddress: ToggleType; | ||
phoneNumber: ToggleType; | ||
username: ToggleType; | ||
password: string; | ||
/** | ||
* Types of identification strategies selected. | ||
*/ | ||
identificationStrategies: IdentificationStrategy[]; | ||
/** | ||
* Combinations of strategies. | ||
*/ | ||
identificationRequirements: IdentificationStrategy[][]; | ||
passwordConditions: any; | ||
/** | ||
* Type of first factor authentication used. | ||
*/ | ||
firstFactors: SignInStrategyName[]; | ||
/** | ||
* Type of second factor authentication used. | ||
*/ | ||
secondFactors: SignInStrategyName[]; | ||
/** | ||
* All the verification strategies that can be used in | ||
* this instance to verify an email address. | ||
*/ | ||
emailAddressVerificationStrategies: EmailAddressVerificationStrategy[]; | ||
/** | ||
* Enabled single session configuration at the instance level. | ||
@@ -9,1 +57,5 @@ */ | ||
} | ||
export type ToggleType = 'on' | 'off'; | ||
export type ToggleTypeWithRequire = ToggleType | 'required'; |
import { AuthConfigResource } from './authConfig'; | ||
import { DisplayConfigResource } from './displayConfig'; | ||
import { ClerkResource } from './resource'; | ||
import { UserSettingsResource } from './userSettings'; | ||
export interface EnvironmentResource extends ClerkResource { | ||
userSettings: UserSettingsResource; | ||
authConfig: AuthConfigResource; | ||
@@ -9,0 +7,0 @@ displayConfig: DisplayConfigResource; |
@@ -25,3 +25,2 @@ export * from './api'; | ||
export * from './user'; | ||
export * from './userSettings'; | ||
export * from './utils'; | ||
@@ -28,0 +27,0 @@ export * from './verification'; |
@@ -6,5 +6,8 @@ /** | ||
import { MembershipRole, OrganizationInvitationStatus } from '.'; | ||
import { ToggleType, ToggleTypeWithRequire } from './authConfig'; | ||
import { EmailAddressVerificationStrategy } from './emailAddress'; | ||
import { OAuthStrategy } from './oauth'; | ||
import { SessionStatus } from './session'; | ||
import { | ||
IdentificationStrategy, | ||
PreferredSignInStrategy, | ||
@@ -14,2 +17,3 @@ SignInFactor, | ||
SignInStatus, | ||
SignInStrategyName, | ||
UserData, | ||
@@ -26,3 +30,2 @@ } from './signIn'; | ||
} from './theme'; | ||
import { UserSettingsJSON } from './userSettings'; | ||
import { VerificationStatus } from './verification'; | ||
@@ -90,3 +93,2 @@ | ||
display_config: DisplayConfigJSON; | ||
user_settings: UserSettingsJSON; | ||
} | ||
@@ -221,5 +223,20 @@ | ||
latest_activity: SessionActivityJSON; | ||
// activities: SessionActivityJSON[]; | ||
} | ||
export interface AuthConfigJSON extends ClerkResourceJSON { | ||
export interface AuthConfigJSON { | ||
object: 'auth_config'; | ||
id: string; | ||
first_name: ToggleTypeWithRequire; | ||
last_name: ToggleTypeWithRequire; | ||
email_address: ToggleType; | ||
phone_number: ToggleType; | ||
username: ToggleType; | ||
password: ToggleTypeWithRequire; | ||
identification_strategies: IdentificationStrategy[]; | ||
identification_requirements: IdentificationStrategy[][]; | ||
password_conditions: any; | ||
first_factors: SignInStrategyName[]; | ||
second_factors: SignInStrategyName[]; | ||
email_address_verification_strategies: EmailAddressVerificationStrategy[]; | ||
single_session_mode: boolean; | ||
@@ -226,0 +243,0 @@ } |
@@ -130,5 +130,15 @@ export type OAuthProvider = | ||
.sort( | ||
(a, b) => | ||
sortingArray.indexOf(a.strategy) - | ||
sortingArray.indexOf(b.strategy), | ||
(a, b) => { | ||
let aPos = sortingArray.indexOf(a.strategy); | ||
if (aPos == -1) { | ||
aPos = Number.MAX_SAFE_INTEGER; | ||
} | ||
let bPos = sortingArray.indexOf(b.strategy); | ||
if (bPos == -1) { | ||
bPos = Number.MAX_SAFE_INTEGER; | ||
} | ||
return aPos - bPos; | ||
} | ||
) | ||
@@ -135,0 +145,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
165527
0.27%3420
0.21%0
-100%0
-100%152
-5.59%