@nulvless/nulvless-js 0.1.6 → 0.1.7

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 & {});
@@ -718,7 +718,10 @@ interface OAuthAuthorizeParams {
718
718
  state?: string;
719
719
  resource?: string;
720
720
  nonce?: string;
721
+ prompt?: OAuthPrompt | `${OAuthPrompt} ${OAuthPrompt}`;
722
+ max_age?: number;
721
723
  }
724
+ type OAuthPrompt = 'none' | 'login' | 'consent' | 'select_account';
722
725
  interface ExchangeOAuthCodeParams {
723
726
  code: string;
724
727
  code_verifier: string;
@@ -750,6 +753,8 @@ interface OAuthAuthorization {
750
753
  uri?: string;
751
754
  };
752
755
  scope: string[];
756
+ prompt: OAuthPrompt[];
757
+ max_age: number | null;
753
758
  auto_approved: boolean;
754
759
  redirect?: {
755
760
  uri: string;
@@ -2346,4 +2351,4 @@ declare function createClient(url: string, publicKey: string, options?: ClientOp
2346
2351
  */
2347
2352
  declare function createServerClient(url: string, privateKey: string, options?: ServerClientOptions): NulvlessServerClient;
2348
2353
 
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 };
2354
+ 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 & {});
@@ -718,7 +718,10 @@ interface OAuthAuthorizeParams {
718
718
  state?: string;
719
719
  resource?: string;
720
720
  nonce?: string;
721
+ prompt?: OAuthPrompt | `${OAuthPrompt} ${OAuthPrompt}`;
722
+ max_age?: number;
721
723
  }
724
+ type OAuthPrompt = 'none' | 'login' | 'consent' | 'select_account';
722
725
  interface ExchangeOAuthCodeParams {
723
726
  code: string;
724
727
  code_verifier: string;
@@ -750,6 +753,8 @@ interface OAuthAuthorization {
750
753
  uri?: string;
751
754
  };
752
755
  scope: string[];
756
+ prompt: OAuthPrompt[];
757
+ max_age: number | null;
753
758
  auto_approved: boolean;
754
759
  redirect?: {
755
760
  uri: string;
@@ -2346,4 +2351,4 @@ declare function createClient(url: string, publicKey: string, options?: ClientOp
2346
2351
  */
2347
2352
  declare function createServerClient(url: string, privateKey: string, options?: ServerClientOptions): NulvlessServerClient;
2348
2353
 
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 };
2354
+ 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);