@nulvless/nulvless-js 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  type SdkErrorCode = 'no_session' | 'request_timeout' | 'network_error' | 'invalid_path' | 'unknown_error';
2
2
  type GatewayErrorCode = 'rate_limit_exceeded' | 'service_not_enabled' | 'service_unavailable' | 'project_not_ready' | 'project_paused' | 'project_unavailable' | 'bad_gateway' | 'upstream_timeout' | 'idle_timeout' | 'deadline_exceeded' | 'internal_error';
3
- type AuthErrorCode = 'unauthorized' | 'not_allowed' | 'unavailable' | 'invalid_credentials' | 'mfa_required' | 'mfa_factors_limit_reached' | 'mfa_phone_already_enrolled' | 'mfa_phone_not_supported' | 'refresh_token_not_found' | 'refresh_token_already_used' | 'refresh_token_not_issued_here' | 'registration_closed' | 'user_not_confirmed' | 'user_already_confirmed' | 'user_banned' | 'user_already_banned' | 'user_not_banned' | 'user_missing_email' | 'user_missing_phone' | 'email_already_exists' | 'phone_already_exists' | 'username_already_exists' | 'password_weak' | 'password_leaked' | 'captcha_required' | 'captcha_verification_failed' | 'protected_action_denied' | 'action_verification_failed' | 'forbidden_resource_access' | 'forbidden_access_waiting_accept' | 'forbidden_special_role_required' | 'cannot_leave_owner_access' | 'permission_already_granted' | 'bad_oauth_state' | 'bad_oauth_callback' | 'redirect_uri_mismatch' | 'provider_unavailable' | 'provider_unsupported_method' | 'oauth_email_missing' | 'oauth_email_not_verified' | 'oauth_account_link_required' | 'rate_limit_exceeded';
3
+ type AuthErrorCode = 'unauthorized' | 'not_allowed' | 'unavailable' | 'invalid_credentials' | 'mfa_required' | 'mfa_factors_limit_reached' | 'mfa_phone_already_enrolled' | 'mfa_phone_not_supported' | 'refresh_token_not_found' | 'refresh_token_already_used' | 'refresh_token_not_issued_here' | 'registration_closed' | 'user_not_confirmed' | 'user_already_confirmed' | 'user_banned' | 'user_already_banned' | 'user_not_banned' | 'user_missing_email' | 'user_missing_phone' | 'email_already_exists' | 'phone_already_exists' | 'username_already_exists' | 'password_weak' | 'password_leaked' | 'captcha_required' | 'captcha_verification_failed' | 'protected_action_denied' | 'login_required' | 'action_verification_failed' | 'forbidden_resource_access' | 'forbidden_access_waiting_accept' | 'forbidden_special_role_required' | 'cannot_leave_owner_access' | 'permission_already_granted' | 'bad_oauth_state' | 'bad_oauth_callback' | 'redirect_uri_mismatch' | 'provider_unavailable' | 'provider_unsupported_method' | 'oauth_email_missing' | 'oauth_email_not_verified' | 'oauth_account_link_required' | 'rate_limit_exceeded';
4
4
  type CommsErrorCode = 'unauthorized_platform' | 'rate_limit_exceeded';
5
5
  type EdgeFunctionErrorCode = 'function_not_found' | 'function_unavailable' | 'boot_failed' | 'execution_timeout' | 'cpu_time_limit_exceeded' | 'memory_limit_exceeded' | 'resource_unavailable' | 'internal_server_error';
6
6
  type ErrorCode = SdkErrorCode | GatewayErrorCode | AuthErrorCode | CommsErrorCode | (string & {});
@@ -684,6 +684,7 @@ interface OAuthApp {
684
684
  client_name?: string;
685
685
  client_uri?: string;
686
686
  logo_uri?: string;
687
+ default_max_age?: number | null;
687
688
  /** Only present right after create/regenerate (confidential apps). */
688
689
  client_secret?: string;
689
690
  created_at?: string;
@@ -697,6 +698,7 @@ interface RegisterOAuthAppParams {
697
698
  client_name?: string;
698
699
  client_uri?: string;
699
700
  logo_uri?: string;
701
+ default_max_age?: number | null;
700
702
  }
701
703
  /** `client_type` is immutable; the secret rotates via `regenerateSecret`. */
702
704
  interface UpdateOAuthAppParams {
@@ -706,6 +708,7 @@ interface UpdateOAuthAppParams {
706
708
  client_name?: string;
707
709
  client_uri?: string;
708
710
  logo_uri?: string;
711
+ default_max_age?: number | null;
709
712
  }
710
713
  /** Query parameters for the `/oauth/authorize` redirect (PKCE required, S256). */
711
714
  interface OAuthAuthorizeParams {
@@ -718,7 +721,10 @@ interface OAuthAuthorizeParams {
718
721
  state?: string;
719
722
  resource?: string;
720
723
  nonce?: string;
724
+ prompt?: OAuthPrompt | `${OAuthPrompt} ${OAuthPrompt}`;
725
+ max_age?: number;
721
726
  }
727
+ type OAuthPrompt = 'none' | 'login' | 'consent' | 'select_account';
722
728
  interface ExchangeOAuthCodeParams {
723
729
  code: string;
724
730
  code_verifier: string;
@@ -750,6 +756,8 @@ interface OAuthAuthorization {
750
756
  uri?: string;
751
757
  };
752
758
  scope: string[];
759
+ prompt: OAuthPrompt[];
760
+ max_age: number | null;
753
761
  auto_approved: boolean;
754
762
  redirect?: {
755
763
  uri: string;
@@ -2346,4 +2354,4 @@ declare function createClient(url: string, publicKey: string, options?: ClientOp
2346
2354
  */
2347
2355
  declare function createServerClient(url: string, privateKey: string, options?: ServerClientOptions): NulvlessServerClient;
2348
2356
 
2349
- export { AUTH_CACHE_HEADERS, type AccountEntry, type AddEmailIdentityParams, type AddPhoneIdentityParams, AdminClient, type AdminCreateUserParams, type AdminUpdateUserParams, type AssuranceLevel, AuthBrowserClient, AuthClient, type AuthErrorCode, AuthEventEmitter, type AuthEvents, type AuthFactorStatus, type AuthMethod, type AuthMethods, type AuthOptions, AuthServerClient, type Authenticated, type BlockGrantParams, type Challenge, type ChallengeSubject, type ChangeChallengeParams, type ChangePasswordParams, type ClientOptions, CommsClient, type CommsErrorCode, type ConfirmationType, type CreateChallengeParams, type CreateRoleParams, type CreateTemplateParams, type EdgeFunctionErrorCode, EmailClient, type EnableFactorParams, type EnrollFactorParams, type ErrorCode, type ExchangeOAuthCodeParams, type FactorEnrollment, FactorsClient, type GatewayErrorCode, type Grant, type GrantMembers, type GrantStatus, GrantsClient, HttpClient, type Identity, type IdentityType, type Invite, type InviteParams, type Language, type LeaveGrantParams, type LookupMatch, type LookupParams, type LookupResult, type MFAMethod, type Nonce, type NotificationChannel, NulvlessClient, type NulvlessError, NulvlessException, type NulvlessResult, NulvlessServerClient, type NulvlessStorage, type OAuthApp, type OAuthAppGrantType, type OAuthAppTokenEndpointAuthMethod, type OAuthAppType, type OAuthAuthorization, type OAuthAuthorizeParams, OAuthClient, type OAuthConsentAction, type OAuthConsentResult, type OAuthDiscovery, OAuthGrantsClient, type OAuthJWKS, type OAuthProvider, type OAuthTokenResponse, type OAuthUserGrant, type OAuthUserInfo, type PaginateGrantsParams, type PaginateUsersParams, type Paginated, type PaginatedTemplates, type PaginationSort, type Phone, type RecoverParams, type RefreshOAuthTokenParams, type RefreshTokenParams, type RegisterOAuthAppParams, type RemoveIdentityParams, type RequestOptions, type ResetPasswordParams, type RevokeGrantParams, type RevokeSessionParams, type Role, type SdkErrorCode, SecurityClient, type SendEmailParams, type SendOTPToUpdateEmailParams, type SendOTPToUpdatePhoneParams, type SendSMSParams, type ServerClientOptions, type Session, type SessionFingerPrint, SessionManager, SessionsClient, type SetGrantParams, type SignInMethod, type SignInParams, type SignInWithOTPParams, type SignOutScope, type SignUpParams, SmsClient, Storage, type StoredSession, type SudoMethod, type Template, type TemplateFilters, type TemplateLanguage, TemplatesClient, type TokenType, type UnenrollFactorParams, type UpdateGrantParams, type UpdateIdentityParams, type UpdateOAuthAppParams, type UpdateRoleParams, type UpdateTemplateParams, type User, type UserGender, type UserProfile, UsersClient, type Verified, type VerifyChallengeParams, type VerifyParams, type VerifyReason, applyAuthCacheHeaders, createClient, createServerClient, forwardUserHeaders };
2357
+ export { AUTH_CACHE_HEADERS, type AccountEntry, type AddEmailIdentityParams, type AddPhoneIdentityParams, AdminClient, type AdminCreateUserParams, type AdminUpdateUserParams, type AssuranceLevel, AuthBrowserClient, AuthClient, type AuthErrorCode, AuthEventEmitter, type AuthEvents, type AuthFactorStatus, type AuthMethod, type AuthMethods, type AuthOptions, AuthServerClient, type Authenticated, type BlockGrantParams, type Challenge, type ChallengeSubject, type ChangeChallengeParams, type ChangePasswordParams, type ClientOptions, CommsClient, type CommsErrorCode, type ConfirmationType, type CreateChallengeParams, type CreateRoleParams, type CreateTemplateParams, type EdgeFunctionErrorCode, EmailClient, type EnableFactorParams, type EnrollFactorParams, type ErrorCode, type ExchangeOAuthCodeParams, type FactorEnrollment, FactorsClient, type GatewayErrorCode, type Grant, type GrantMembers, type GrantStatus, GrantsClient, HttpClient, type Identity, type IdentityType, type Invite, type InviteParams, type Language, type LeaveGrantParams, type LookupMatch, type LookupParams, type LookupResult, type MFAMethod, type Nonce, type NotificationChannel, NulvlessClient, type NulvlessError, NulvlessException, type NulvlessResult, NulvlessServerClient, type NulvlessStorage, type OAuthApp, type OAuthAppGrantType, type OAuthAppTokenEndpointAuthMethod, type OAuthAppType, type OAuthAuthorization, type OAuthAuthorizeParams, OAuthClient, type OAuthConsentAction, type OAuthConsentResult, type OAuthDiscovery, OAuthGrantsClient, type OAuthJWKS, type OAuthPrompt, type OAuthProvider, type OAuthTokenResponse, type OAuthUserGrant, type OAuthUserInfo, type PaginateGrantsParams, type PaginateUsersParams, type Paginated, type PaginatedTemplates, type PaginationSort, type Phone, type RecoverParams, type RefreshOAuthTokenParams, type RefreshTokenParams, type RegisterOAuthAppParams, type RemoveIdentityParams, type RequestOptions, type ResetPasswordParams, type RevokeGrantParams, type RevokeSessionParams, type Role, type SdkErrorCode, SecurityClient, type SendEmailParams, type SendOTPToUpdateEmailParams, type SendOTPToUpdatePhoneParams, type SendSMSParams, type ServerClientOptions, type Session, type SessionFingerPrint, SessionManager, SessionsClient, type SetGrantParams, type SignInMethod, type SignInParams, type SignInWithOTPParams, type SignOutScope, type SignUpParams, SmsClient, Storage, type StoredSession, type SudoMethod, type Template, type TemplateFilters, type TemplateLanguage, TemplatesClient, type TokenType, type UnenrollFactorParams, type UpdateGrantParams, type UpdateIdentityParams, type UpdateOAuthAppParams, type UpdateRoleParams, type UpdateTemplateParams, type User, type UserGender, type UserProfile, UsersClient, type Verified, type VerifyChallengeParams, type VerifyParams, type VerifyReason, applyAuthCacheHeaders, createClient, createServerClient, forwardUserHeaders };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  type SdkErrorCode = 'no_session' | 'request_timeout' | 'network_error' | 'invalid_path' | 'unknown_error';
2
2
  type GatewayErrorCode = 'rate_limit_exceeded' | 'service_not_enabled' | 'service_unavailable' | 'project_not_ready' | 'project_paused' | 'project_unavailable' | 'bad_gateway' | 'upstream_timeout' | 'idle_timeout' | 'deadline_exceeded' | 'internal_error';
3
- type AuthErrorCode = 'unauthorized' | 'not_allowed' | 'unavailable' | 'invalid_credentials' | 'mfa_required' | 'mfa_factors_limit_reached' | 'mfa_phone_already_enrolled' | 'mfa_phone_not_supported' | 'refresh_token_not_found' | 'refresh_token_already_used' | 'refresh_token_not_issued_here' | 'registration_closed' | 'user_not_confirmed' | 'user_already_confirmed' | 'user_banned' | 'user_already_banned' | 'user_not_banned' | 'user_missing_email' | 'user_missing_phone' | 'email_already_exists' | 'phone_already_exists' | 'username_already_exists' | 'password_weak' | 'password_leaked' | 'captcha_required' | 'captcha_verification_failed' | 'protected_action_denied' | 'action_verification_failed' | 'forbidden_resource_access' | 'forbidden_access_waiting_accept' | 'forbidden_special_role_required' | 'cannot_leave_owner_access' | 'permission_already_granted' | 'bad_oauth_state' | 'bad_oauth_callback' | 'redirect_uri_mismatch' | 'provider_unavailable' | 'provider_unsupported_method' | 'oauth_email_missing' | 'oauth_email_not_verified' | 'oauth_account_link_required' | 'rate_limit_exceeded';
3
+ type AuthErrorCode = 'unauthorized' | 'not_allowed' | 'unavailable' | 'invalid_credentials' | 'mfa_required' | 'mfa_factors_limit_reached' | 'mfa_phone_already_enrolled' | 'mfa_phone_not_supported' | 'refresh_token_not_found' | 'refresh_token_already_used' | 'refresh_token_not_issued_here' | 'registration_closed' | 'user_not_confirmed' | 'user_already_confirmed' | 'user_banned' | 'user_already_banned' | 'user_not_banned' | 'user_missing_email' | 'user_missing_phone' | 'email_already_exists' | 'phone_already_exists' | 'username_already_exists' | 'password_weak' | 'password_leaked' | 'captcha_required' | 'captcha_verification_failed' | 'protected_action_denied' | 'login_required' | 'action_verification_failed' | 'forbidden_resource_access' | 'forbidden_access_waiting_accept' | 'forbidden_special_role_required' | 'cannot_leave_owner_access' | 'permission_already_granted' | 'bad_oauth_state' | 'bad_oauth_callback' | 'redirect_uri_mismatch' | 'provider_unavailable' | 'provider_unsupported_method' | 'oauth_email_missing' | 'oauth_email_not_verified' | 'oauth_account_link_required' | 'rate_limit_exceeded';
4
4
  type CommsErrorCode = 'unauthorized_platform' | 'rate_limit_exceeded';
5
5
  type EdgeFunctionErrorCode = 'function_not_found' | 'function_unavailable' | 'boot_failed' | 'execution_timeout' | 'cpu_time_limit_exceeded' | 'memory_limit_exceeded' | 'resource_unavailable' | 'internal_server_error';
6
6
  type ErrorCode = SdkErrorCode | GatewayErrorCode | AuthErrorCode | CommsErrorCode | (string & {});
@@ -684,6 +684,7 @@ interface OAuthApp {
684
684
  client_name?: string;
685
685
  client_uri?: string;
686
686
  logo_uri?: string;
687
+ default_max_age?: number | null;
687
688
  /** Only present right after create/regenerate (confidential apps). */
688
689
  client_secret?: string;
689
690
  created_at?: string;
@@ -697,6 +698,7 @@ interface RegisterOAuthAppParams {
697
698
  client_name?: string;
698
699
  client_uri?: string;
699
700
  logo_uri?: string;
701
+ default_max_age?: number | null;
700
702
  }
701
703
  /** `client_type` is immutable; the secret rotates via `regenerateSecret`. */
702
704
  interface UpdateOAuthAppParams {
@@ -706,6 +708,7 @@ interface UpdateOAuthAppParams {
706
708
  client_name?: string;
707
709
  client_uri?: string;
708
710
  logo_uri?: string;
711
+ default_max_age?: number | null;
709
712
  }
710
713
  /** Query parameters for the `/oauth/authorize` redirect (PKCE required, S256). */
711
714
  interface OAuthAuthorizeParams {
@@ -718,7 +721,10 @@ interface OAuthAuthorizeParams {
718
721
  state?: string;
719
722
  resource?: string;
720
723
  nonce?: string;
724
+ prompt?: OAuthPrompt | `${OAuthPrompt} ${OAuthPrompt}`;
725
+ max_age?: number;
721
726
  }
727
+ type OAuthPrompt = 'none' | 'login' | 'consent' | 'select_account';
722
728
  interface ExchangeOAuthCodeParams {
723
729
  code: string;
724
730
  code_verifier: string;
@@ -750,6 +756,8 @@ interface OAuthAuthorization {
750
756
  uri?: string;
751
757
  };
752
758
  scope: string[];
759
+ prompt: OAuthPrompt[];
760
+ max_age: number | null;
753
761
  auto_approved: boolean;
754
762
  redirect?: {
755
763
  uri: string;
@@ -2346,4 +2354,4 @@ declare function createClient(url: string, publicKey: string, options?: ClientOp
2346
2354
  */
2347
2355
  declare function createServerClient(url: string, privateKey: string, options?: ServerClientOptions): NulvlessServerClient;
2348
2356
 
2349
- export { AUTH_CACHE_HEADERS, type AccountEntry, type AddEmailIdentityParams, type AddPhoneIdentityParams, AdminClient, type AdminCreateUserParams, type AdminUpdateUserParams, type AssuranceLevel, AuthBrowserClient, AuthClient, type AuthErrorCode, AuthEventEmitter, type AuthEvents, type AuthFactorStatus, type AuthMethod, type AuthMethods, type AuthOptions, AuthServerClient, type Authenticated, type BlockGrantParams, type Challenge, type ChallengeSubject, type ChangeChallengeParams, type ChangePasswordParams, type ClientOptions, CommsClient, type CommsErrorCode, type ConfirmationType, type CreateChallengeParams, type CreateRoleParams, type CreateTemplateParams, type EdgeFunctionErrorCode, EmailClient, type EnableFactorParams, type EnrollFactorParams, type ErrorCode, type ExchangeOAuthCodeParams, type FactorEnrollment, FactorsClient, type GatewayErrorCode, type Grant, type GrantMembers, type GrantStatus, GrantsClient, HttpClient, type Identity, type IdentityType, type Invite, type InviteParams, type Language, type LeaveGrantParams, type LookupMatch, type LookupParams, type LookupResult, type MFAMethod, type Nonce, type NotificationChannel, NulvlessClient, type NulvlessError, NulvlessException, type NulvlessResult, NulvlessServerClient, type NulvlessStorage, type OAuthApp, type OAuthAppGrantType, type OAuthAppTokenEndpointAuthMethod, type OAuthAppType, type OAuthAuthorization, type OAuthAuthorizeParams, OAuthClient, type OAuthConsentAction, type OAuthConsentResult, type OAuthDiscovery, OAuthGrantsClient, type OAuthJWKS, type OAuthProvider, type OAuthTokenResponse, type OAuthUserGrant, type OAuthUserInfo, type PaginateGrantsParams, type PaginateUsersParams, type Paginated, type PaginatedTemplates, type PaginationSort, type Phone, type RecoverParams, type RefreshOAuthTokenParams, type RefreshTokenParams, type RegisterOAuthAppParams, type RemoveIdentityParams, type RequestOptions, type ResetPasswordParams, type RevokeGrantParams, type RevokeSessionParams, type Role, type SdkErrorCode, SecurityClient, type SendEmailParams, type SendOTPToUpdateEmailParams, type SendOTPToUpdatePhoneParams, type SendSMSParams, type ServerClientOptions, type Session, type SessionFingerPrint, SessionManager, SessionsClient, type SetGrantParams, type SignInMethod, type SignInParams, type SignInWithOTPParams, type SignOutScope, type SignUpParams, SmsClient, Storage, type StoredSession, type SudoMethod, type Template, type TemplateFilters, type TemplateLanguage, TemplatesClient, type TokenType, type UnenrollFactorParams, type UpdateGrantParams, type UpdateIdentityParams, type UpdateOAuthAppParams, type UpdateRoleParams, type UpdateTemplateParams, type User, type UserGender, type UserProfile, UsersClient, type Verified, type VerifyChallengeParams, type VerifyParams, type VerifyReason, applyAuthCacheHeaders, createClient, createServerClient, forwardUserHeaders };
2357
+ export { AUTH_CACHE_HEADERS, type AccountEntry, type AddEmailIdentityParams, type AddPhoneIdentityParams, AdminClient, type AdminCreateUserParams, type AdminUpdateUserParams, type AssuranceLevel, AuthBrowserClient, AuthClient, type AuthErrorCode, AuthEventEmitter, type AuthEvents, type AuthFactorStatus, type AuthMethod, type AuthMethods, type AuthOptions, AuthServerClient, type Authenticated, type BlockGrantParams, type Challenge, type ChallengeSubject, type ChangeChallengeParams, type ChangePasswordParams, type ClientOptions, CommsClient, type CommsErrorCode, type ConfirmationType, type CreateChallengeParams, type CreateRoleParams, type CreateTemplateParams, type EdgeFunctionErrorCode, EmailClient, type EnableFactorParams, type EnrollFactorParams, type ErrorCode, type ExchangeOAuthCodeParams, type FactorEnrollment, FactorsClient, type GatewayErrorCode, type Grant, type GrantMembers, type GrantStatus, GrantsClient, HttpClient, type Identity, type IdentityType, type Invite, type InviteParams, type Language, type LeaveGrantParams, type LookupMatch, type LookupParams, type LookupResult, type MFAMethod, type Nonce, type NotificationChannel, NulvlessClient, type NulvlessError, NulvlessException, type NulvlessResult, NulvlessServerClient, type NulvlessStorage, type OAuthApp, type OAuthAppGrantType, type OAuthAppTokenEndpointAuthMethod, type OAuthAppType, type OAuthAuthorization, type OAuthAuthorizeParams, OAuthClient, type OAuthConsentAction, type OAuthConsentResult, type OAuthDiscovery, OAuthGrantsClient, type OAuthJWKS, type OAuthPrompt, type OAuthProvider, type OAuthTokenResponse, type OAuthUserGrant, type OAuthUserInfo, type PaginateGrantsParams, type PaginateUsersParams, type Paginated, type PaginatedTemplates, type PaginationSort, type Phone, type RecoverParams, type RefreshOAuthTokenParams, type RefreshTokenParams, type RegisterOAuthAppParams, type RemoveIdentityParams, type RequestOptions, type ResetPasswordParams, type RevokeGrantParams, type RevokeSessionParams, type Role, type SdkErrorCode, SecurityClient, type SendEmailParams, type SendOTPToUpdateEmailParams, type SendOTPToUpdatePhoneParams, type SendSMSParams, type ServerClientOptions, type Session, type SessionFingerPrint, SessionManager, SessionsClient, type SetGrantParams, type SignInMethod, type SignInParams, type SignInWithOTPParams, type SignOutScope, type SignUpParams, SmsClient, Storage, type StoredSession, type SudoMethod, type Template, type TemplateFilters, type TemplateLanguage, TemplatesClient, type TokenType, type UnenrollFactorParams, type UpdateGrantParams, type UpdateIdentityParams, type UpdateOAuthAppParams, type UpdateRoleParams, type UpdateTemplateParams, type User, type UserGender, type UserProfile, UsersClient, type Verified, type VerifyChallengeParams, type VerifyParams, type VerifyReason, applyAuthCacheHeaders, createClient, createServerClient, forwardUserHeaders };
package/dist/index.mjs CHANGED
@@ -961,7 +961,9 @@ var OAuthClient = class extends AuthSubClient {
961
961
  scope: params.scope,
962
962
  state: params.state,
963
963
  resource: params.resource,
964
- nonce: params.nonce
964
+ nonce: params.nonce,
965
+ prompt: params.prompt,
966
+ max_age: params.max_age === void 0 ? void 0 : String(params.max_age)
965
967
  };
966
968
  for (const [key, value] of Object.entries(query)) {
967
969
  if (value !== void 0) url.searchParams.set(key, value);