@cyber-eco/auth • Docs
index¶
Enumerations¶
AuthEventType¶
Authentication Logger Service Provides structured logging for SSO authentication flow with monitoring capabilities
Enumeration Members¶
LOGIN_ATTEMPT¶
LOGIN_ATTEMPT:
"auth.login.attempt"
Defined in¶
packages/auth/src/services/authLogger.ts:8
LOGIN_SUCCESS¶
LOGIN_SUCCESS:
"auth.login.success"
Defined in¶
packages/auth/src/services/authLogger.ts:9
LOGIN_FAILURE¶
LOGIN_FAILURE:
"auth.login.failure"
Defined in¶
packages/auth/src/services/authLogger.ts:10
LOGOUT¶
LOGOUT:
"auth.logout"
Defined in¶
packages/auth/src/services/authLogger.ts:11
TOKEN_GENERATED¶
TOKEN_GENERATED:
"auth.token.generated"
Defined in¶
packages/auth/src/services/authLogger.ts:14
TOKEN_VERIFIED¶
TOKEN_VERIFIED:
"auth.token.verified"
Defined in¶
packages/auth/src/services/authLogger.ts:15
TOKEN_EXPIRED¶
TOKEN_EXPIRED:
"auth.token.expired"
Defined in¶
packages/auth/src/services/authLogger.ts:16
TOKEN_REFRESH¶
TOKEN_REFRESH:
"auth.token.refresh"
Defined in¶
packages/auth/src/services/authLogger.ts:17
TOKEN_INVALID¶
TOKEN_INVALID:
"auth.token.invalid"
Defined in¶
packages/auth/src/services/authLogger.ts:18
SSO_REDIRECT¶
SSO_REDIRECT:
"auth.sso.redirect"
Defined in¶
packages/auth/src/services/authLogger.ts:21
SSO_CALLBACK¶
SSO_CALLBACK:
"auth.sso.callback"
Defined in¶
packages/auth/src/services/authLogger.ts:22
SSO_TOKEN_EXCHANGE¶
SSO_TOKEN_EXCHANGE:
"auth.sso.token_exchange"
Defined in¶
packages/auth/src/services/authLogger.ts:23
SSO_CROSS_APP¶
SSO_CROSS_APP:
"auth.sso.cross_app"
Defined in¶
packages/auth/src/services/authLogger.ts:24
SESSION_CREATE¶
SESSION_CREATE:
"auth.session.create"
Defined in¶
packages/auth/src/services/authLogger.ts:27
SESSION_RESTORE¶
SESSION_RESTORE:
"auth.session.restore"
Defined in¶
packages/auth/src/services/authLogger.ts:28
SESSION_EXPIRE¶
SESSION_EXPIRE:
"auth.session.expire"
Defined in¶
packages/auth/src/services/authLogger.ts:29
SESSION_CLEAR¶
SESSION_CLEAR:
"auth.session.clear"
Defined in¶
packages/auth/src/services/authLogger.ts:30
AUTH_ERROR¶
AUTH_ERROR:
"auth.error"
Defined in¶
packages/auth/src/services/authLogger.ts:33
PERMISSION_DENIED¶
PERMISSION_DENIED:
"auth.permission.denied"
Defined in¶
packages/auth/src/services/authLogger.ts:34
RATE_LIMIT¶
RATE_LIMIT:
"auth.rate_limit"
Defined in¶
packages/auth/src/services/authLogger.ts:35
PRIVACY_SETTINGS_UPDATED¶
PRIVACY_SETTINGS_UPDATED:
"privacy.settings.updated"
Defined in¶
packages/auth/src/services/authLogger.ts:38
DATA_ACCESS¶
DATA_ACCESS:
"privacy.data.access"
Defined in¶
packages/auth/src/services/authLogger.ts:39
CONSENT_GRANTED¶
CONSENT_GRANTED:
"privacy.consent.granted"
Defined in¶
packages/auth/src/services/authLogger.ts:40
CONSENT_REVOKED¶
CONSENT_REVOKED:
"privacy.consent.revoked"
Defined in¶
packages/auth/src/services/authLogger.ts:41
ERROR_CAPTURED¶
ERROR_CAPTURED:
"security.error.captured"
Defined in¶
packages/auth/src/services/authLogger.ts:44
ERROR_BOUNDARY_TRIGGERED¶
ERROR_BOUNDARY_TRIGGERED:
"security.error.boundary"
Defined in¶
packages/auth/src/services/authLogger.ts:45
LogLevel¶
Enumeration Members¶
DEBUG¶
DEBUG:
"debug"
Defined in¶
packages/auth/src/services/authLogger.ts:49
INFO¶
INFO:
"info"
Defined in¶
packages/auth/src/services/authLogger.ts:50
WARN¶
WARN:
"warn"
Defined in¶
packages/auth/src/services/authLogger.ts:51
ERROR¶
ERROR:
"error"
Defined in¶
packages/auth/src/services/authLogger.ts:52
RecoveryStrategy¶
Error recovery strategies
Enumeration Members¶
RETRY¶
RETRY:
"retry"
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:10
FALLBACK¶
FALLBACK:
"fallback"
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:11
IGNORE¶
IGNORE:
"ignore"
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:12
RESET¶
RESET:
"reset"
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:13
REFRESH¶
REFRESH:
"refresh"
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:14
ErrorCode¶
Custom error classes for CyberEco authentication system
Enumeration Members¶
INVALID_CREDENTIALS¶
INVALID_CREDENTIALS:
"AUTH_INVALID_CREDENTIALS"
Defined in¶
packages/auth/src/utils/errors.ts:7
TOKEN_EXPIRED¶
TOKEN_EXPIRED:
"AUTH_TOKEN_EXPIRED"
Defined in¶
packages/auth/src/utils/errors.ts:8
TOKEN_INVALID¶
TOKEN_INVALID:
"AUTH_TOKEN_INVALID"
Defined in¶
packages/auth/src/utils/errors.ts:9
REFRESH_TOKEN_INVALID¶
REFRESH_TOKEN_INVALID:
"AUTH_REFRESH_TOKEN_INVALID"
Defined in¶
packages/auth/src/utils/errors.ts:10
UNAUTHORIZED¶
UNAUTHORIZED:
"AUTH_UNAUTHORIZED"
Defined in¶
packages/auth/src/utils/errors.ts:11
TWO_FACTOR_REQUIRED¶
TWO_FACTOR_REQUIRED:
"AUTH_2FA_REQUIRED"
Defined in¶
packages/auth/src/utils/errors.ts:14
TWO_FACTOR_INVALID¶
TWO_FACTOR_INVALID:
"AUTH_2FA_INVALID"
Defined in¶
packages/auth/src/utils/errors.ts:15
BACKUP_CODE_INVALID¶
BACKUP_CODE_INVALID:
"AUTH_BACKUP_CODE_INVALID"
Defined in¶
packages/auth/src/utils/errors.ts:16
RATE_LIMIT_EXCEEDED¶
RATE_LIMIT_EXCEEDED:
"RATE_LIMIT_EXCEEDED"
Defined in¶
packages/auth/src/utils/errors.ts:19
SESSION_NOT_FOUND¶
SESSION_NOT_FOUND:
"SESSION_NOT_FOUND"
Defined in¶
packages/auth/src/utils/errors.ts:22
SESSION_EXPIRED¶
SESSION_EXPIRED:
"SESSION_EXPIRED"
Defined in¶
packages/auth/src/utils/errors.ts:23
VALIDATION_ERROR¶
VALIDATION_ERROR:
"VALIDATION_ERROR"
Defined in¶
packages/auth/src/utils/errors.ts:26
INVALID_INPUT¶
INVALID_INPUT:
"INVALID_INPUT"
Defined in¶
packages/auth/src/utils/errors.ts:27
MISSING_REQUIRED_FIELD¶
MISSING_REQUIRED_FIELD:
"MISSING_REQUIRED_FIELD"
Defined in¶
packages/auth/src/utils/errors.ts:28
PERMISSION_DENIED¶
PERMISSION_DENIED:
"PERMISSION_DENIED"
Defined in¶
packages/auth/src/utils/errors.ts:31
INSUFFICIENT_PERMISSIONS¶
INSUFFICIENT_PERMISSIONS:
"INSUFFICIENT_PERMISSIONS"
Defined in¶
packages/auth/src/utils/errors.ts:32
CONSENT_REQUIRED¶
CONSENT_REQUIRED:
"CONSENT_REQUIRED"
Defined in¶
packages/auth/src/utils/errors.ts:35
DATA_ACCESS_DENIED¶
DATA_ACCESS_DENIED:
"DATA_ACCESS_DENIED"
Defined in¶
packages/auth/src/utils/errors.ts:36
EXPORT_LIMIT_EXCEEDED¶
EXPORT_LIMIT_EXCEEDED:
"EXPORT_LIMIT_EXCEEDED"
Defined in¶
packages/auth/src/utils/errors.ts:39
EXPORT_NOT_FOUND¶
EXPORT_NOT_FOUND:
"EXPORT_NOT_FOUND"
Defined in¶
packages/auth/src/utils/errors.ts:40
EXPORT_FAILED¶
EXPORT_FAILED:
"EXPORT_FAILED"
Defined in¶
packages/auth/src/utils/errors.ts:41
INTERNAL_ERROR¶
INTERNAL_ERROR:
"INTERNAL_ERROR"
Defined in¶
packages/auth/src/utils/errors.ts:44
SERVICE_UNAVAILABLE¶
SERVICE_UNAVAILABLE:
"SERVICE_UNAVAILABLE"
Defined in¶
packages/auth/src/utils/errors.ts:45
NOT_FOUND¶
NOT_FOUND:
"NOT_FOUND"
Defined in¶
packages/auth/src/utils/errors.ts:46
CONFLICT¶
CONFLICT:
"CONFLICT"
Defined in¶
packages/auth/src/utils/errors.ts:47
BAD_REQUEST¶
BAD_REQUEST:
"BAD_REQUEST"
Defined in¶
packages/auth/src/utils/errors.ts:48
Classes¶
InMemoryRateLimitStore¶
Implements¶
Constructors¶
new InMemoryRateLimitStore()¶
new InMemoryRateLimitStore():
InMemoryRateLimitStore
Returns¶
Methods¶
increment()¶
increment(
key,windowMs):Promise\<number>
Parameters¶
• key: string
• windowMs: number
Returns¶
Promise\<number>
Implementation of¶
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:38
reset()¶
reset(
key):Promise\<void>
Parameters¶
• key: string
Returns¶
Promise\<void>
Implementation of¶
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:58
destroy()¶
destroy():
void
No-op, retained for API compatibility (there is no timer to stop).
Returns¶
void
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:63
RateLimiter¶
Constructors¶
new RateLimiter()¶
new RateLimiter(
config,store):RateLimiter
Parameters¶
• config: RateLimitConfig
• store: RateLimitStore = ...
Returns¶
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:73
Methods¶
check()¶
check(
identifier,store):Promise\<RateLimitResult>
Check rate limit for an identifier.
store overrides the constructor store for THIS call — the seam that lets
a serverless/edge request supply a durable per-request store (e.g. a
Cloudflare KV binding from locals.runtime.env) instead of the default
in-memory Map, which on edge is per-isolate and therefore ineffective.
Omit it on Node / dev / tests to use the in-memory store.
Parameters¶
• identifier: string
• store: RateLimitStore = ...
Returns¶
Promise\<RateLimitResult>
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:96
reset()¶
reset(
identifier,store):Promise\<void>
Reset rate limit for an identifier. Pass the same per-call store used in
check() so the reset lands in the same backing store.
Parameters¶
• identifier: string
• store: RateLimitStore = ...
Returns¶
Promise\<void>
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:117
getMessage()¶
getMessage():
string
Get error message
Returns¶
string
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:125
AuthTokenService¶
Constructors¶
new AuthTokenService()¶
new AuthTokenService():
AuthTokenService
Returns¶
Methods¶
processUrlAuthToken()¶
staticprocessUrlAuthToken():Promise\<null|AuthUser>
Process auth token from URL.
SECURITY (issue #6): the identity carried in a URL token is an UNTRUSTED UI hint, not an authentication source. A previous version "verified" it with a hardcoded signing key shipped in the client bundle — that is not a security boundary (the key is public). This method therefore does NOT authenticate the user from the URL. Real cross-origin SSO — verifying a short-lived custom token server-side — is tracked in issue #5. Until then, apps authenticate via Firebase; this returns null.
Returns¶
Promise\<null | AuthUser>
Defined in¶
packages/auth/src/services/authTokenService.ts:30
getStoredAuth()¶
staticgetStoredAuth():null|AuthUser
Get stored auth if still valid
Returns¶
null | AuthUser
Defined in¶
packages/auth/src/services/authTokenService.ts:49
clearAuth()¶
staticclearAuth():void
Clear stored auth
Returns¶
void
Defined in¶
packages/auth/src/services/authTokenService.ts:74
CacheService¶
Methods¶
getInstance()¶
staticgetInstance():CacheService
Returns¶
Defined in¶
packages/auth/src/services/cacheService.ts:17
set()¶
set\<
T>(key,value,ttlSeconds):void
Set a value in cache with TTL
Type Parameters¶
• T
Parameters¶
• key: string
• value: T
• ttlSeconds: number = 300
Returns¶
void
Defined in¶
packages/auth/src/services/cacheService.ts:27
get()¶
get\<
T>(key):null|T
Get a value from cache
Type Parameters¶
• T
Parameters¶
• key: string
Returns¶
null | T
Defined in¶
packages/auth/src/services/cacheService.ts:37
has()¶
has(
key):boolean
Check if key exists and is not expired
Parameters¶
• key: string
Returns¶
boolean
Defined in¶
packages/auth/src/services/cacheService.ts:55
delete()¶
delete(
key):void
Delete a key from cache
Parameters¶
• key: string
Returns¶
void
Defined in¶
packages/auth/src/services/cacheService.ts:73
clear()¶
clear():
void
Clear all cache
Returns¶
void
Defined in¶
packages/auth/src/services/cacheService.ts:80
getOrSet()¶
getOrSet\<
T>(key,factory,ttlSeconds):Promise\<T>
Get or set with factory function
Type Parameters¶
• T
Parameters¶
• key: string
• factory
• ttlSeconds: number = 300
Returns¶
Promise\<T>
Defined in¶
packages/auth/src/services/cacheService.ts:87
destroy()¶
destroy():
void
Destroy the cache service
Returns¶
void
Defined in¶
packages/auth/src/services/cacheService.ts:120
RequestBatcher\<TRequest, TResponse>¶
Type Parameters¶
• TRequest
• TResponse
Constructors¶
new RequestBatcher()¶
new RequestBatcher\<
TRequest,TResponse>(batchProcessor,maxBatchSize,maxWaitTime):RequestBatcher\<TRequest,TResponse>
Parameters¶
• batchProcessor
• maxBatchSize: number = 10
• maxWaitTime: number = 50
Returns¶
RequestBatcher\<TRequest, TResponse>
Defined in¶
packages/auth/src/services/cacheService.ts:139
Methods¶
add()¶
add(
request):Promise\<TResponse>
Parameters¶
• request: TRequest
Returns¶
Promise\<TResponse>
Defined in¶
packages/auth/src/services/cacheService.ts:149
CircuitBreaker¶
Circuit breaker pattern
Constructors¶
new CircuitBreaker()¶
new CircuitBreaker(
threshold,timeout,resetTimeout):CircuitBreaker
Parameters¶
• threshold: number = 5
• timeout: number = 60000
• resetTimeout: number = 30000
Returns¶
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:71
Methods¶
execute()¶
execute\<
T>(fn):Promise\<T>
Type Parameters¶
• T
Parameters¶
• fn
Returns¶
Promise\<T>
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:77
ErrorRecoveryBoundary¶
React Error Boundary Component
Extends¶
Component\<object,object>
Constructors¶
new ErrorRecoveryBoundary()¶
new ErrorRecoveryBoundary(
props):ErrorRecoveryBoundary
Parameters¶
• props: any
Returns¶
Overrides¶
React.Component\< { children: React.ReactNode; fallback?: React.ComponentType\<{ error: Error; reset: () => void }>; onError?: (error: Error, errorInfo: React.ErrorInfo) => void; }, { hasError: boolean; error: Error | null } >.constructor
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:328
Properties¶
contextType?¶
staticoptionalcontextType:Context\<any>
If set, this.context will be set at runtime to the current value of the given Context.
Example¶
type MyContext = number
const Ctx = React.createContext<MyContext>(0)
class Foo extends React.Component {
static contextType = Ctx
context!: React.ContextType<typeof Ctx>
render () {
return <>My context's value: {this.context}</>;
}
}
See¶
https://react.dev/reference/react/Component#static-contexttype
Inherited from¶
React.Component.contextType
Defined in¶
node_modules/@types/react/index.d.ts:996
context¶
context:
unknown
If using the new style context, re-declare this in your class to be the
React.ContextType of your static contextType.
Should be used with type annotation or static contextType.
Example¶
static contextType = MyContext
// For TS pre-3.7:
context!: React.ContextType<typeof MyContext>
// For TS 3.7 and above:
declare context: React.ContextType<typeof MyContext>
See¶
Inherited from¶
React.Component.context
Defined in¶
node_modules/@types/react/index.d.ts:1014
props¶
readonlyprops:Readonly\<object>
Type declaration¶
children¶
children:
ReactNode
fallback?¶
optionalfallback:ComponentType\<object>
Type declaration¶
error¶
error:
Error
reset()¶
reset: () =>
void
Returns¶
void
onError()?¶
optionalonError: (error,errorInfo) =>void
Parameters¶
• error: Error
• errorInfo: ErrorInfo
Returns¶
void
Inherited from¶
React.Component.props
Defined in¶
node_modules/@types/react/index.d.ts:1034
state¶
state:
Readonly\<object>
Type declaration¶
hasError¶
hasError:
boolean
error¶
error:
null|Error
Inherited from¶
React.Component.state
Defined in¶
node_modules/@types/react/index.d.ts:1035
refs¶
refs:
object
Index Signature¶
[key: string]: ReactInstance
Deprecated¶
See¶
Inherited from¶
React.Component.refs
Defined in¶
node_modules/@types/react/index.d.ts:1041
Methods¶
setState()¶
setState\<
K>(state,callback?):void
Type Parameters¶
• K extends "hasError" | "error"
Parameters¶
• state: null | object | (prevState, props) => null | object | Pick\<object, K> | Pick\<object, K>
• callback?
Returns¶
void
Inherited from¶
React.Component.setState
Defined in¶
node_modules/@types/react/index.d.ts:1026
forceUpdate()¶
forceUpdate(
callback?):void
Parameters¶
• callback?
Returns¶
void
Inherited from¶
React.Component.forceUpdate
Defined in¶
node_modules/@types/react/index.d.ts:1031
componentDidMount()?¶
optionalcomponentDidMount():void
Called immediately after a component is mounted. Setting state here will trigger re-rendering.
Returns¶
void
Inherited from¶
React.Component.componentDidMount
Defined in¶
node_modules/@types/react/index.d.ts:1377
shouldComponentUpdate()?¶
optionalshouldComponentUpdate(nextProps,nextState,nextContext):boolean
Called to determine whether the change in props and state should trigger a re-render.
Component always returns true.
PureComponent implements a shallow comparison on props and state and returns true if any
props or states have changed.
If false is returned, Component.render, componentWillUpdate
and componentDidUpdate will not be called.
Parameters¶
• nextProps: Readonly\<object>
• nextState: Readonly\<object>
• nextContext: any
Returns¶
boolean
Inherited from¶
React.Component.shouldComponentUpdate
Defined in¶
node_modules/@types/react/index.d.ts:1388
componentWillUnmount()?¶
optionalcomponentWillUnmount():void
Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
cancelled network requests, or cleaning up any DOM elements created in componentDidMount.
Returns¶
void
Inherited from¶
React.Component.componentWillUnmount
Defined in¶
node_modules/@types/react/index.d.ts:1393
getSnapshotBeforeUpdate()?¶
optionalgetSnapshotBeforeUpdate(prevProps,prevState):any
Runs before React applies the result of Component.render render to the document, and returns an object to be given to componentDidUpdate. Useful for saving things such as scroll position before Component.render render causes changes to it.
Note: the presence of this method prevents any of the deprecated lifecycle events from running.
Parameters¶
• prevProps: Readonly\<object>
• prevState: Readonly\<object>
Returns¶
any
Inherited from¶
React.Component.getSnapshotBeforeUpdate
Defined in¶
node_modules/@types/react/index.d.ts:1434
componentDidUpdate()?¶
optionalcomponentDidUpdate(prevProps,prevState,snapshot?):void
Called immediately after updating occurs. Not called for the initial render.
The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
Parameters¶
• prevProps: Readonly\<object>
• prevState: Readonly\<object>
• snapshot?: any
Returns¶
void
Inherited from¶
React.Component.componentDidUpdate
Defined in¶
node_modules/@types/react/index.d.ts:1440
componentWillMount()?¶
optionalcomponentWillMount():void
Called immediately before mounting occurs, and before Component.render. Avoid introducing any side-effects or subscriptions in this method.
Note: the presence of NewLifecycle.getSnapshotBeforeUpdate getSnapshotBeforeUpdate or StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps prevents this from being invoked.
Returns¶
void
Deprecated¶
16.3, use ComponentLifecycle.componentDidMount componentDidMount or the constructor instead; will stop working in React 17
See¶
- https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
- https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
Inherited from¶
React.Component.componentWillMount
Defined in¶
node_modules/@types/react/index.d.ts:1456
UNSAFE_componentWillMount()?¶
optionalUNSAFE_componentWillMount():void
Called immediately before mounting occurs, and before Component.render. Avoid introducing any side-effects or subscriptions in this method.
This method will not stop working in React 17.
Note: the presence of NewLifecycle.getSnapshotBeforeUpdate getSnapshotBeforeUpdate or StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps prevents this from being invoked.
Returns¶
void
Deprecated¶
16.3, use ComponentLifecycle.componentDidMount componentDidMount or the constructor instead
See¶
- https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
- https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
Inherited from¶
React.Component.UNSAFE_componentWillMount
Defined in¶
node_modules/@types/react/index.d.ts:1471
componentWillReceiveProps()?¶
optionalcomponentWillReceiveProps(nextProps,nextContext):void
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component.setState generally does not trigger this method.
Note: the presence of NewLifecycle.getSnapshotBeforeUpdate getSnapshotBeforeUpdate or StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps prevents this from being invoked.
Parameters¶
• nextProps: Readonly\<object>
• nextContext: any
Returns¶
void
Deprecated¶
16.3, use static StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps instead; will stop working in React 17
See¶
- https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
- https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
Inherited from¶
React.Component.componentWillReceiveProps
Defined in¶
node_modules/@types/react/index.d.ts:1487
UNSAFE_componentWillReceiveProps()?¶
optionalUNSAFE_componentWillReceiveProps(nextProps,nextContext):void
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component.setState generally does not trigger this method.
This method will not stop working in React 17.
Note: the presence of NewLifecycle.getSnapshotBeforeUpdate getSnapshotBeforeUpdate or StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps prevents this from being invoked.
Parameters¶
• nextProps: Readonly\<object>
• nextContext: any
Returns¶
void
Deprecated¶
16.3, use static StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps instead
See¶
- https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
- https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
Inherited from¶
React.Component.UNSAFE_componentWillReceiveProps
Defined in¶
node_modules/@types/react/index.d.ts:1505
componentWillUpdate()?¶
optionalcomponentWillUpdate(nextProps,nextState,nextContext):void
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component.setState here.
Note: the presence of NewLifecycle.getSnapshotBeforeUpdate getSnapshotBeforeUpdate or StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps prevents this from being invoked.
Parameters¶
• nextProps: Readonly\<object>
• nextState: Readonly\<object>
• nextContext: any
Returns¶
void
Deprecated¶
16.3, use getSnapshotBeforeUpdate instead; will stop working in React 17
See¶
- https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
- https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
Inherited from¶
React.Component.componentWillUpdate
Defined in¶
node_modules/@types/react/index.d.ts:1519
UNSAFE_componentWillUpdate()?¶
optionalUNSAFE_componentWillUpdate(nextProps,nextState,nextContext):void
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component.setState here.
This method will not stop working in React 17.
Note: the presence of NewLifecycle.getSnapshotBeforeUpdate getSnapshotBeforeUpdate or StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps prevents this from being invoked.
Parameters¶
• nextProps: Readonly\<object>
• nextState: Readonly\<object>
• nextContext: any
Returns¶
void
Deprecated¶
16.3, use getSnapshotBeforeUpdate instead
See¶
- https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
- https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
Inherited from¶
React.Component.UNSAFE_componentWillUpdate
Defined in¶
node_modules/@types/react/index.d.ts:1535
getDerivedStateFromError()¶
staticgetDerivedStateFromError(error):object
Parameters¶
• error: Error
Returns¶
object
hasError¶
hasError:
boolean=true
error¶
error:
Error
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:333
componentDidCatch()¶
componentDidCatch(
error,errorInfo):void
Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.
Parameters¶
• error: Error
• errorInfo: ErrorInfo
Returns¶
void
Overrides¶
React.Component.componentDidCatch
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:337
reset()¶
reset():
void
Returns¶
void
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:351
render()¶
render():
undefined|null|string|number|boolean|Element|Iterable\<ReactNode,any,any>
Returns¶
undefined | null | string | number | boolean | Element | Iterable\<ReactNode, any, any>
Overrides¶
React.Component.render
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:355
CyberEcoError¶
Base error class for all CyberEco errors
Extends¶
Error
Extended by¶
AuthenticationErrorAuthorizationErrorValidationErrorNotFoundErrorConflictErrorRateLimitErrorInternalErrorServiceUnavailableErrorTwoFactorRequiredErrorExportLimitExceededError
Constructors¶
new CyberEcoError()¶
new CyberEcoError(
code,message,statusCode,details?):CyberEcoError
Parameters¶
• code: ErrorCode
• message: string
• statusCode: number = 500
• details?: ErrorDetails
Returns¶
Overrides¶
Error.constructor
Defined in¶
packages/auth/src/utils/errors.ts:67
Properties¶
stackTraceLimit¶
staticstackTraceLimit:number
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from¶
Error.stackTraceLimit
Defined in¶
node_modules/@types/node/globals.d.ts:67
cause?¶
optionalcause:unknown
Inherited from¶
Error.cause
Defined in¶
node_modules/typescript/lib/lib.es2022.error.d.ts:24
name¶
name:
string
Inherited from¶
Error.name
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1076
message¶
message:
string
Inherited from¶
Error.message
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1077
stack?¶
optionalstack:string
Inherited from¶
Error.stack
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1078
code¶
readonlycode:ErrorCode
Defined in¶
packages/auth/src/utils/errors.ts:62
statusCode¶
readonlystatusCode:number
Defined in¶
packages/auth/src/utils/errors.ts:63
details?¶
readonlyoptionaldetails:ErrorDetails
Defined in¶
packages/auth/src/utils/errors.ts:64
timestamp¶
readonlytimestamp:Date
Defined in¶
packages/auth/src/utils/errors.ts:65
Methods¶
captureStackTrace()¶
staticcaptureStackTrace(targetObject,constructorOpt?):void
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters¶
• targetObject: object
• constructorOpt?: Function
Returns¶
void
Inherited from¶
Error.captureStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:51
prepareStackTrace()¶
staticprepareStackTrace(err,stackTraces):any
Parameters¶
• err: Error
• stackTraces: CallSite[]
Returns¶
any
See¶
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from¶
Error.prepareStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:55
toJSON()¶
toJSON():
object
Returns¶
object
error¶
error:
object
error.code¶
code:
ErrorCode
error.message¶
message:
string
error.details¶
details:
undefined|ErrorDetails
error.timestamp¶
timestamp:
Date
Defined in¶
packages/auth/src/utils/errors.ts:84
AuthenticationError¶
Authentication error (401)
Extends¶
Extended by¶
Constructors¶
new AuthenticationError()¶
new AuthenticationError(
message,code,details?):AuthenticationError
Parameters¶
• message: string = 'Authentication failed'
• code: ErrorCode = ErrorCode.UNAUTHORIZED
• details?: ErrorDetails
Returns¶
Overrides¶
Defined in¶
packages/auth/src/utils/errors.ts:100
Properties¶
stackTraceLimit¶
staticstackTraceLimit:number
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from¶
Defined in¶
node_modules/@types/node/globals.d.ts:67
cause?¶
optionalcause:unknown
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es2022.error.d.ts:24
name¶
name:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1076
message¶
message:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1077
stack?¶
optionalstack:string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1078
code¶
readonlycode:ErrorCode
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:62
statusCode¶
readonlystatusCode:number
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:63
details?¶
readonlyoptionaldetails:ErrorDetails
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:64
timestamp¶
readonlytimestamp:Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:65
Methods¶
captureStackTrace()¶
staticcaptureStackTrace(targetObject,constructorOpt?):void
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters¶
• targetObject: object
• constructorOpt?: Function
Returns¶
void
Inherited from¶
CyberEcoError.captureStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:51
prepareStackTrace()¶
staticprepareStackTrace(err,stackTraces):any
Parameters¶
• err: Error
• stackTraces: CallSite[]
Returns¶
any
See¶
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from¶
CyberEcoError.prepareStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:55
toJSON()¶
toJSON():
object
Returns¶
object
error¶
error:
object
error.code¶
code:
ErrorCode
error.message¶
message:
string
error.details¶
details:
undefined|ErrorDetails
error.timestamp¶
timestamp:
Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:84
AuthorizationError¶
Authorization error (403)
Extends¶
Extended by¶
Constructors¶
new AuthorizationError()¶
new AuthorizationError(
message,code,details?):AuthorizationError
Parameters¶
• message: string = 'Access denied'
• code: ErrorCode = ErrorCode.PERMISSION_DENIED
• details?: ErrorDetails
Returns¶
Overrides¶
Defined in¶
packages/auth/src/utils/errors.ts:109
Properties¶
stackTraceLimit¶
staticstackTraceLimit:number
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from¶
Defined in¶
node_modules/@types/node/globals.d.ts:67
cause?¶
optionalcause:unknown
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es2022.error.d.ts:24
name¶
name:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1076
message¶
message:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1077
stack?¶
optionalstack:string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1078
code¶
readonlycode:ErrorCode
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:62
statusCode¶
readonlystatusCode:number
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:63
details?¶
readonlyoptionaldetails:ErrorDetails
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:64
timestamp¶
readonlytimestamp:Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:65
Methods¶
captureStackTrace()¶
staticcaptureStackTrace(targetObject,constructorOpt?):void
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters¶
• targetObject: object
• constructorOpt?: Function
Returns¶
void
Inherited from¶
CyberEcoError.captureStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:51
prepareStackTrace()¶
staticprepareStackTrace(err,stackTraces):any
Parameters¶
• err: Error
• stackTraces: CallSite[]
Returns¶
any
See¶
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from¶
CyberEcoError.prepareStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:55
toJSON()¶
toJSON():
object
Returns¶
object
error¶
error:
object
error.code¶
code:
ErrorCode
error.message¶
message:
string
error.details¶
details:
undefined|ErrorDetails
error.timestamp¶
timestamp:
Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:84
ValidationError¶
Validation error (400)
Extends¶
Constructors¶
new ValidationError()¶
new ValidationError(
message,details?):ValidationError
Parameters¶
• message: string = 'Validation failed'
• details?: ErrorDetails
Returns¶
Overrides¶
Defined in¶
packages/auth/src/utils/errors.ts:118
Properties¶
stackTraceLimit¶
staticstackTraceLimit:number
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from¶
Defined in¶
node_modules/@types/node/globals.d.ts:67
cause?¶
optionalcause:unknown
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es2022.error.d.ts:24
name¶
name:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1076
message¶
message:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1077
stack?¶
optionalstack:string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1078
code¶
readonlycode:ErrorCode
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:62
statusCode¶
readonlystatusCode:number
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:63
details?¶
readonlyoptionaldetails:ErrorDetails
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:64
timestamp¶
readonlytimestamp:Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:65
Methods¶
captureStackTrace()¶
staticcaptureStackTrace(targetObject,constructorOpt?):void
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters¶
• targetObject: object
• constructorOpt?: Function
Returns¶
void
Inherited from¶
CyberEcoError.captureStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:51
prepareStackTrace()¶
staticprepareStackTrace(err,stackTraces):any
Parameters¶
• err: Error
• stackTraces: CallSite[]
Returns¶
any
See¶
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from¶
CyberEcoError.prepareStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:55
toJSON()¶
toJSON():
object
Returns¶
object
error¶
error:
object
error.code¶
code:
ErrorCode
error.message¶
message:
string
error.details¶
details:
undefined|ErrorDetails
error.timestamp¶
timestamp:
Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:84
NotFoundError¶
Not found error (404)
Extends¶
Constructors¶
new NotFoundError()¶
new NotFoundError(
message,details?):NotFoundError
Parameters¶
• message: string = 'Resource not found'
• details?: ErrorDetails
Returns¶
Overrides¶
Defined in¶
packages/auth/src/utils/errors.ts:127
Properties¶
stackTraceLimit¶
staticstackTraceLimit:number
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from¶
Defined in¶
node_modules/@types/node/globals.d.ts:67
cause?¶
optionalcause:unknown
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es2022.error.d.ts:24
name¶
name:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1076
message¶
message:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1077
stack?¶
optionalstack:string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1078
code¶
readonlycode:ErrorCode
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:62
statusCode¶
readonlystatusCode:number
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:63
details?¶
readonlyoptionaldetails:ErrorDetails
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:64
timestamp¶
readonlytimestamp:Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:65
Methods¶
captureStackTrace()¶
staticcaptureStackTrace(targetObject,constructorOpt?):void
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters¶
• targetObject: object
• constructorOpt?: Function
Returns¶
void
Inherited from¶
CyberEcoError.captureStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:51
prepareStackTrace()¶
staticprepareStackTrace(err,stackTraces):any
Parameters¶
• err: Error
• stackTraces: CallSite[]
Returns¶
any
See¶
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from¶
CyberEcoError.prepareStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:55
toJSON()¶
toJSON():
object
Returns¶
object
error¶
error:
object
error.code¶
code:
ErrorCode
error.message¶
message:
string
error.details¶
details:
undefined|ErrorDetails
error.timestamp¶
timestamp:
Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:84
ConflictError¶
Conflict error (409)
Extends¶
Constructors¶
new ConflictError()¶
new ConflictError(
message,details?):ConflictError
Parameters¶
• message: string = 'Resource conflict'
• details?: ErrorDetails
Returns¶
Overrides¶
Defined in¶
packages/auth/src/utils/errors.ts:136
Properties¶
stackTraceLimit¶
staticstackTraceLimit:number
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from¶
Defined in¶
node_modules/@types/node/globals.d.ts:67
cause?¶
optionalcause:unknown
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es2022.error.d.ts:24
name¶
name:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1076
message¶
message:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1077
stack?¶
optionalstack:string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1078
code¶
readonlycode:ErrorCode
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:62
statusCode¶
readonlystatusCode:number
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:63
details?¶
readonlyoptionaldetails:ErrorDetails
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:64
timestamp¶
readonlytimestamp:Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:65
Methods¶
captureStackTrace()¶
staticcaptureStackTrace(targetObject,constructorOpt?):void
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters¶
• targetObject: object
• constructorOpt?: Function
Returns¶
void
Inherited from¶
CyberEcoError.captureStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:51
prepareStackTrace()¶
staticprepareStackTrace(err,stackTraces):any
Parameters¶
• err: Error
• stackTraces: CallSite[]
Returns¶
any
See¶
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from¶
CyberEcoError.prepareStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:55
toJSON()¶
toJSON():
object
Returns¶
object
error¶
error:
object
error.code¶
code:
ErrorCode
error.message¶
message:
string
error.details¶
details:
undefined|ErrorDetails
error.timestamp¶
timestamp:
Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:84
RateLimitError¶
Rate limit error (429)
Extends¶
Constructors¶
new RateLimitError()¶
new RateLimitError(
message,retryAfter?):RateLimitError
Parameters¶
• message: string = 'Too many requests'
• retryAfter?: number
Returns¶
Overrides¶
Defined in¶
packages/auth/src/utils/errors.ts:147
Properties¶
stackTraceLimit¶
staticstackTraceLimit:number
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from¶
Defined in¶
node_modules/@types/node/globals.d.ts:67
cause?¶
optionalcause:unknown
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es2022.error.d.ts:24
name¶
name:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1076
message¶
message:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1077
stack?¶
optionalstack:string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1078
code¶
readonlycode:ErrorCode
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:62
statusCode¶
readonlystatusCode:number
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:63
details?¶
readonlyoptionaldetails:ErrorDetails
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:64
timestamp¶
readonlytimestamp:Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:65
retryAfter?¶
readonlyoptionalretryAfter:number
Defined in¶
packages/auth/src/utils/errors.ts:145
Methods¶
captureStackTrace()¶
staticcaptureStackTrace(targetObject,constructorOpt?):void
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters¶
• targetObject: object
• constructorOpt?: Function
Returns¶
void
Inherited from¶
CyberEcoError.captureStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:51
prepareStackTrace()¶
staticprepareStackTrace(err,stackTraces):any
Parameters¶
• err: Error
• stackTraces: CallSite[]
Returns¶
any
See¶
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from¶
CyberEcoError.prepareStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:55
toJSON()¶
toJSON():
object
Returns¶
object
error¶
error:
object
error.code¶
code:
ErrorCode
error.message¶
message:
string
error.details¶
details:
undefined|ErrorDetails
error.timestamp¶
timestamp:
Date
retryAfter¶
retryAfter:
undefined|number
Overrides¶
Defined in¶
packages/auth/src/utils/errors.ts:152
InternalError¶
Internal server error (500)
Extends¶
Constructors¶
new InternalError()¶
new InternalError(
message,details?):InternalError
Parameters¶
• message: string = 'Internal server error'
• details?: ErrorDetails
Returns¶
Overrides¶
Defined in¶
packages/auth/src/utils/errors.ts:164
Properties¶
stackTraceLimit¶
staticstackTraceLimit:number
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from¶
Defined in¶
node_modules/@types/node/globals.d.ts:67
cause?¶
optionalcause:unknown
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es2022.error.d.ts:24
name¶
name:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1076
message¶
message:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1077
stack?¶
optionalstack:string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1078
code¶
readonlycode:ErrorCode
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:62
statusCode¶
readonlystatusCode:number
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:63
details?¶
readonlyoptionaldetails:ErrorDetails
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:64
timestamp¶
readonlytimestamp:Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:65
Methods¶
captureStackTrace()¶
staticcaptureStackTrace(targetObject,constructorOpt?):void
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters¶
• targetObject: object
• constructorOpt?: Function
Returns¶
void
Inherited from¶
CyberEcoError.captureStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:51
prepareStackTrace()¶
staticprepareStackTrace(err,stackTraces):any
Parameters¶
• err: Error
• stackTraces: CallSite[]
Returns¶
any
See¶
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from¶
CyberEcoError.prepareStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:55
toJSON()¶
toJSON():
object
Returns¶
object
error¶
error:
object
error.code¶
code:
ErrorCode
error.message¶
message:
string
error.details¶
details:
undefined|ErrorDetails
error.timestamp¶
timestamp:
Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:84
ServiceUnavailableError¶
Service unavailable error (503)
Extends¶
Constructors¶
new ServiceUnavailableError()¶
new ServiceUnavailableError(
message,retryAfter?):ServiceUnavailableError
Parameters¶
• message: string = 'Service temporarily unavailable'
• retryAfter?: number
Returns¶
Overrides¶
Defined in¶
packages/auth/src/utils/errors.ts:175
Properties¶
stackTraceLimit¶
staticstackTraceLimit:number
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from¶
Defined in¶
node_modules/@types/node/globals.d.ts:67
cause?¶
optionalcause:unknown
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es2022.error.d.ts:24
name¶
name:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1076
message¶
message:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1077
stack?¶
optionalstack:string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1078
code¶
readonlycode:ErrorCode
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:62
statusCode¶
readonlystatusCode:number
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:63
details?¶
readonlyoptionaldetails:ErrorDetails
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:64
timestamp¶
readonlytimestamp:Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:65
retryAfter?¶
readonlyoptionalretryAfter:number
Defined in¶
packages/auth/src/utils/errors.ts:173
Methods¶
captureStackTrace()¶
staticcaptureStackTrace(targetObject,constructorOpt?):void
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters¶
• targetObject: object
• constructorOpt?: Function
Returns¶
void
Inherited from¶
CyberEcoError.captureStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:51
prepareStackTrace()¶
staticprepareStackTrace(err,stackTraces):any
Parameters¶
• err: Error
• stackTraces: CallSite[]
Returns¶
any
See¶
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from¶
CyberEcoError.prepareStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:55
toJSON()¶
toJSON():
object
Returns¶
object
error¶
error:
object
error.code¶
code:
ErrorCode
error.message¶
message:
string
error.details¶
details:
undefined|ErrorDetails
error.timestamp¶
timestamp:
Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:84
TokenExpiredError¶
Token-specific errors
Extends¶
Constructors¶
new TokenExpiredError()¶
new TokenExpiredError(
message):TokenExpiredError
Parameters¶
• message: string = 'Token has expired'
Returns¶
Overrides¶
AuthenticationError.constructor
Defined in¶
packages/auth/src/utils/errors.ts:185
Properties¶
stackTraceLimit¶
staticstackTraceLimit:number
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from¶
AuthenticationError.stackTraceLimit
Defined in¶
node_modules/@types/node/globals.d.ts:67
cause?¶
optionalcause:unknown
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es2022.error.d.ts:24
name¶
name:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1076
message¶
message:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1077
stack?¶
optionalstack:string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1078
code¶
readonlycode:ErrorCode
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:62
statusCode¶
readonlystatusCode:number
Inherited from¶
AuthenticationError.statusCode
Defined in¶
packages/auth/src/utils/errors.ts:63
details?¶
readonlyoptionaldetails:ErrorDetails
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:64
timestamp¶
readonlytimestamp:Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:65
Methods¶
captureStackTrace()¶
staticcaptureStackTrace(targetObject,constructorOpt?):void
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters¶
• targetObject: object
• constructorOpt?: Function
Returns¶
void
Inherited from¶
AuthenticationError.captureStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:51
prepareStackTrace()¶
staticprepareStackTrace(err,stackTraces):any
Parameters¶
• err: Error
• stackTraces: CallSite[]
Returns¶
any
See¶
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from¶
AuthenticationError.prepareStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:55
toJSON()¶
toJSON():
object
Returns¶
object
error¶
error:
object
error.code¶
code:
ErrorCode
error.message¶
message:
string
error.details¶
details:
undefined|ErrorDetails
error.timestamp¶
timestamp:
Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:84
InvalidTokenError¶
Authentication error (401)
Extends¶
Constructors¶
new InvalidTokenError()¶
new InvalidTokenError(
message):InvalidTokenError
Parameters¶
• message: string = 'Invalid token'
Returns¶
Overrides¶
AuthenticationError.constructor
Defined in¶
packages/auth/src/utils/errors.ts:191
Properties¶
stackTraceLimit¶
staticstackTraceLimit:number
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from¶
AuthenticationError.stackTraceLimit
Defined in¶
node_modules/@types/node/globals.d.ts:67
cause?¶
optionalcause:unknown
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es2022.error.d.ts:24
name¶
name:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1076
message¶
message:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1077
stack?¶
optionalstack:string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1078
code¶
readonlycode:ErrorCode
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:62
statusCode¶
readonlystatusCode:number
Inherited from¶
AuthenticationError.statusCode
Defined in¶
packages/auth/src/utils/errors.ts:63
details?¶
readonlyoptionaldetails:ErrorDetails
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:64
timestamp¶
readonlytimestamp:Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:65
Methods¶
captureStackTrace()¶
staticcaptureStackTrace(targetObject,constructorOpt?):void
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters¶
• targetObject: object
• constructorOpt?: Function
Returns¶
void
Inherited from¶
AuthenticationError.captureStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:51
prepareStackTrace()¶
staticprepareStackTrace(err,stackTraces):any
Parameters¶
• err: Error
• stackTraces: CallSite[]
Returns¶
any
See¶
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from¶
AuthenticationError.prepareStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:55
toJSON()¶
toJSON():
object
Returns¶
object
error¶
error:
object
error.code¶
code:
ErrorCode
error.message¶
message:
string
error.details¶
details:
undefined|ErrorDetails
error.timestamp¶
timestamp:
Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:84
TwoFactorRequiredError¶
2FA-specific errors
Extends¶
Constructors¶
new TwoFactorRequiredError()¶
new TwoFactorRequiredError(
message):TwoFactorRequiredError
Parameters¶
• message: string = '2FA verification required'
Returns¶
Overrides¶
Defined in¶
packages/auth/src/utils/errors.ts:200
Properties¶
stackTraceLimit¶
staticstackTraceLimit:number
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from¶
Defined in¶
node_modules/@types/node/globals.d.ts:67
cause?¶
optionalcause:unknown
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es2022.error.d.ts:24
name¶
name:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1076
message¶
message:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1077
stack?¶
optionalstack:string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1078
code¶
readonlycode:ErrorCode
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:62
statusCode¶
readonlystatusCode:number
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:63
details?¶
readonlyoptionaldetails:ErrorDetails
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:64
timestamp¶
readonlytimestamp:Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:65
Methods¶
captureStackTrace()¶
staticcaptureStackTrace(targetObject,constructorOpt?):void
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters¶
• targetObject: object
• constructorOpt?: Function
Returns¶
void
Inherited from¶
CyberEcoError.captureStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:51
prepareStackTrace()¶
staticprepareStackTrace(err,stackTraces):any
Parameters¶
• err: Error
• stackTraces: CallSite[]
Returns¶
any
See¶
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from¶
CyberEcoError.prepareStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:55
toJSON()¶
toJSON():
object
Returns¶
object
error¶
error:
object
error.code¶
code:
ErrorCode
error.message¶
message:
string
error.details¶
details:
undefined|ErrorDetails
error.timestamp¶
timestamp:
Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:84
InvalidTwoFactorCodeError¶
Authentication error (401)
Extends¶
Constructors¶
new InvalidTwoFactorCodeError()¶
new InvalidTwoFactorCodeError(
message):InvalidTwoFactorCodeError
Parameters¶
• message: string = 'Invalid 2FA code'
Returns¶
Overrides¶
AuthenticationError.constructor
Defined in¶
packages/auth/src/utils/errors.ts:206
Properties¶
stackTraceLimit¶
staticstackTraceLimit:number
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from¶
AuthenticationError.stackTraceLimit
Defined in¶
node_modules/@types/node/globals.d.ts:67
cause?¶
optionalcause:unknown
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es2022.error.d.ts:24
name¶
name:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1076
message¶
message:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1077
stack?¶
optionalstack:string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1078
code¶
readonlycode:ErrorCode
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:62
statusCode¶
readonlystatusCode:number
Inherited from¶
AuthenticationError.statusCode
Defined in¶
packages/auth/src/utils/errors.ts:63
details?¶
readonlyoptionaldetails:ErrorDetails
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:64
timestamp¶
readonlytimestamp:Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:65
Methods¶
captureStackTrace()¶
staticcaptureStackTrace(targetObject,constructorOpt?):void
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters¶
• targetObject: object
• constructorOpt?: Function
Returns¶
void
Inherited from¶
AuthenticationError.captureStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:51
prepareStackTrace()¶
staticprepareStackTrace(err,stackTraces):any
Parameters¶
• err: Error
• stackTraces: CallSite[]
Returns¶
any
See¶
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from¶
AuthenticationError.prepareStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:55
toJSON()¶
toJSON():
object
Returns¶
object
error¶
error:
object
error.code¶
code:
ErrorCode
error.message¶
message:
string
error.details¶
details:
undefined|ErrorDetails
error.timestamp¶
timestamp:
Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:84
ConsentRequiredError¶
Privacy/GDPR-specific errors
Extends¶
Constructors¶
new ConsentRequiredError()¶
new ConsentRequiredError(
message,details?):ConsentRequiredError
Parameters¶
• message: string = 'User consent required'
• details?: ErrorDetails
Returns¶
Overrides¶
AuthorizationError.constructor
Defined in¶
packages/auth/src/utils/errors.ts:215
Properties¶
stackTraceLimit¶
staticstackTraceLimit:number
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from¶
AuthorizationError.stackTraceLimit
Defined in¶
node_modules/@types/node/globals.d.ts:67
cause?¶
optionalcause:unknown
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es2022.error.d.ts:24
name¶
name:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1076
message¶
message:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1077
stack?¶
optionalstack:string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1078
code¶
readonlycode:ErrorCode
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:62
statusCode¶
readonlystatusCode:number
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:63
details?¶
readonlyoptionaldetails:ErrorDetails
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:64
timestamp¶
readonlytimestamp:Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:65
Methods¶
captureStackTrace()¶
staticcaptureStackTrace(targetObject,constructorOpt?):void
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters¶
• targetObject: object
• constructorOpt?: Function
Returns¶
void
Inherited from¶
AuthorizationError.captureStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:51
prepareStackTrace()¶
staticprepareStackTrace(err,stackTraces):any
Parameters¶
• err: Error
• stackTraces: CallSite[]
Returns¶
any
See¶
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from¶
AuthorizationError.prepareStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:55
toJSON()¶
toJSON():
object
Returns¶
object
error¶
error:
object
error.code¶
code:
ErrorCode
error.message¶
message:
string
error.details¶
details:
undefined|ErrorDetails
error.timestamp¶
timestamp:
Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:84
DataAccessDeniedError¶
Authorization error (403)
Extends¶
Constructors¶
new DataAccessDeniedError()¶
new DataAccessDeniedError(
message,details?):DataAccessDeniedError
Parameters¶
• message: string = 'Data access denied due to privacy settings'
• details?: ErrorDetails
Returns¶
Overrides¶
AuthorizationError.constructor
Defined in¶
packages/auth/src/utils/errors.ts:221
Properties¶
stackTraceLimit¶
staticstackTraceLimit:number
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from¶
AuthorizationError.stackTraceLimit
Defined in¶
node_modules/@types/node/globals.d.ts:67
cause?¶
optionalcause:unknown
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es2022.error.d.ts:24
name¶
name:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1076
message¶
message:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1077
stack?¶
optionalstack:string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1078
code¶
readonlycode:ErrorCode
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:62
statusCode¶
readonlystatusCode:number
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:63
details?¶
readonlyoptionaldetails:ErrorDetails
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:64
timestamp¶
readonlytimestamp:Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:65
Methods¶
captureStackTrace()¶
staticcaptureStackTrace(targetObject,constructorOpt?):void
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters¶
• targetObject: object
• constructorOpt?: Function
Returns¶
void
Inherited from¶
AuthorizationError.captureStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:51
prepareStackTrace()¶
staticprepareStackTrace(err,stackTraces):any
Parameters¶
• err: Error
• stackTraces: CallSite[]
Returns¶
any
See¶
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from¶
AuthorizationError.prepareStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:55
toJSON()¶
toJSON():
object
Returns¶
object
error¶
error:
object
error.code¶
code:
ErrorCode
error.message¶
message:
string
error.details¶
details:
undefined|ErrorDetails
error.timestamp¶
timestamp:
Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:84
ExportLimitExceededError¶
Export-specific errors
Extends¶
Constructors¶
new ExportLimitExceededError()¶
new ExportLimitExceededError(
message,details?):ExportLimitExceededError
Parameters¶
• message: string = 'Export limit exceeded'
• details?: ErrorDetails
Returns¶
Overrides¶
Defined in¶
packages/auth/src/utils/errors.ts:230
Properties¶
stackTraceLimit¶
staticstackTraceLimit:number
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from¶
Defined in¶
node_modules/@types/node/globals.d.ts:67
cause?¶
optionalcause:unknown
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es2022.error.d.ts:24
name¶
name:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1076
message¶
message:
string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1077
stack?¶
optionalstack:string
Inherited from¶
Defined in¶
node_modules/typescript/lib/lib.es5.d.ts:1078
code¶
readonlycode:ErrorCode
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:62
statusCode¶
readonlystatusCode:number
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:63
details?¶
readonlyoptionaldetails:ErrorDetails
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:64
timestamp¶
readonlytimestamp:Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:65
Methods¶
captureStackTrace()¶
staticcaptureStackTrace(targetObject,constructorOpt?):void
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters¶
• targetObject: object
• constructorOpt?: Function
Returns¶
void
Inherited from¶
CyberEcoError.captureStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:51
prepareStackTrace()¶
staticprepareStackTrace(err,stackTraces):any
Parameters¶
• err: Error
• stackTraces: CallSite[]
Returns¶
any
See¶
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from¶
CyberEcoError.prepareStackTrace
Defined in¶
node_modules/@types/node/globals.d.ts:55
toJSON()¶
toJSON():
object
Returns¶
object
error¶
error:
object
error.code¶
code:
ErrorCode
error.message¶
message:
string
error.details¶
details:
undefined|ErrorDetails
error.timestamp¶
timestamp:
Date
Inherited from¶
Defined in¶
packages/auth/src/utils/errors.ts:84
PerformanceMonitor¶
Methods¶
getInstance()¶
staticgetInstance():PerformanceMonitor
Returns¶
Defined in¶
packages/auth/src/utils/performance.ts:25
start()¶
start(
name,metadata?):void
Start measuring a performance metric
Parameters¶
• name: string
• metadata?: Record\<string, any>
Returns¶
void
Defined in¶
packages/auth/src/utils/performance.ts:35
end()¶
end(
name):null|PerformanceMetric
End measuring a performance metric
Parameters¶
• name: string
Returns¶
null | PerformanceMetric
Defined in¶
packages/auth/src/utils/performance.ts:46
measure()¶
measure\<
T>(name,fn,metadata?):Promise\<T>
Measure async function performance
Type Parameters¶
• T
Parameters¶
• name: string
• fn
• metadata?: Record\<string, any>
Returns¶
Promise\<T>
Defined in¶
packages/auth/src/utils/performance.ts:69
subscribe()¶
subscribe(
observer): () =>void
Subscribe to performance metrics
Parameters¶
• observer
Returns¶
Function
Returns¶
void
Defined in¶
packages/auth/src/utils/performance.ts:93
getActiveMetrics()¶
getActiveMetrics():
PerformanceMetric[]
Get all active metrics
Returns¶
Defined in¶
packages/auth/src/utils/performance.ts:107
Interfaces¶
AuthConfig\<T>¶
Backend-agnostic auth context.
This module has ZERO imports from any auth backend (Firebase, Supabase, …).
It depends only on the AuthAdapter + ProfileStore interfaces from
@cyber-eco/types; a concrete adapter (e.g. FirebaseAuthAdapter from
@cyber-eco/firebase) is injected via config. Mirrors the StorageAdapter
pattern for data (Tenet #2, Storage Agnosticism).
Type Parameters¶
• T extends BaseUserConstraint = BaseUserConstraint
Properties¶
adapter¶
adapter:
AuthAdapter
Defined in¶
packages/auth/src/context/AuthContext.tsx:24
profileStore¶
profileStore:
ProfileStore\<T>
Defined in¶
packages/auth/src/context/AuthContext.tsx:25
enableIndexedDBRecovery?¶
optionalenableIndexedDBRecovery:boolean
Defined in¶
packages/auth/src/context/AuthContext.tsx:26
AuthContextType\<T>¶
Type Parameters¶
• T extends BaseUserConstraint = BaseUserConstraint
Properties¶
currentUser¶
currentUser:
null|AuthUser
Defined in¶
packages/auth/src/context/AuthContext.tsx:41
userProfile¶
userProfile:
null|T
Defined in¶
packages/auth/src/context/AuthContext.tsx:42
isLoading¶
isLoading:
boolean
Defined in¶
packages/auth/src/context/AuthContext.tsx:43
signIn()¶
signIn: (
password) =>Promise\<void>
Parameters¶
• email: string
• password: string
Returns¶
Promise\<void>
Defined in¶
packages/auth/src/context/AuthContext.tsx:44
signUp()¶
signUp: (
password,displayName,extraData?) =>Promise\<void>
Parameters¶
• email: string
• password: string
• displayName: string
• extraData?: Partial\<T>
Returns¶
Promise\<void>
Defined in¶
packages/auth/src/context/AuthContext.tsx:45
signOut()¶
signOut: () =>
Promise\<void>
Returns¶
Promise\<void>
Defined in¶
packages/auth/src/context/AuthContext.tsx:46
signInWithProvider()¶
signInWithProvider: (
providerName) =>Promise\<void>
Parameters¶
• providerName: AuthProviderName
Returns¶
Promise\<void>
Defined in¶
packages/auth/src/context/AuthContext.tsx:47
linkAccount()¶
linkAccount: (
providerName) =>Promise\<void>
Parameters¶
• providerName: AuthProviderName
Returns¶
Promise\<void>
Defined in¶
packages/auth/src/context/AuthContext.tsx:48
resetPassword()¶
resetPassword: (
Promise\<void>
Parameters¶
• email: string
Returns¶
Promise\<void>
Defined in¶
packages/auth/src/context/AuthContext.tsx:49
updateProfile()¶
updateProfile: (
data) =>Promise\<void>
Parameters¶
• data: Partial\<T>
Returns¶
Promise\<void>
Defined in¶
packages/auth/src/context/AuthContext.tsx:50
handleDatabaseRecovery()?¶
optionalhandleDatabaseRecovery: () =>Promise\<void>
Returns¶
Promise\<void>
Defined in¶
packages/auth/src/context/AuthContext.tsx:51
hasDatabaseCorruption?¶
optionalhasDatabaseCorruption:boolean
Defined in¶
packages/auth/src/context/AuthContext.tsx:52
AuthProviderProps\<T>¶
Type Parameters¶
• T extends BaseUserConstraint = BaseUserConstraint
Properties¶
children¶
children:
ReactNode
Defined in¶
packages/auth/src/context/AuthContext.tsx:57
config¶
config:
AuthConfig\<T>
Defined in¶
packages/auth/src/context/AuthContext.tsx:58
createUserProfile()?¶
optionalcreateUserProfile: (user,extraData?) =>T
Parameters¶
• user: AuthUser
• extraData?: Partial\<T>
Returns¶
T
Defined in¶
packages/auth/src/context/AuthContext.tsx:59
onUserProfileLoaded()?¶
optionalonUserProfileLoaded: (userProfile) =>void
Parameters¶
• userProfile: T
Returns¶
void
Defined in¶
packages/auth/src/context/AuthContext.tsx:60
enableCorruptionRecovery?¶
optionalenableCorruptionRecovery:boolean
Defined in¶
packages/auth/src/context/AuthContext.tsx:61
HubUser¶
Properties¶
id¶
id:
string
Defined in¶
packages/auth/src/hooks/useHubAuth.ts:12
email¶
email:
string
Defined in¶
packages/auth/src/hooks/useHubAuth.ts:13
name¶
name:
string
Defined in¶
packages/auth/src/hooks/useHubAuth.ts:14
photoURL?¶
optionalphotoURL:null|string
Defined in¶
packages/auth/src/hooks/useHubAuth.ts:15
permissions?¶
optionalpermissions:string[]
Defined in¶
packages/auth/src/hooks/useHubAuth.ts:16
HubAuthState¶
Properties¶
user¶
user:
null|HubUser
Defined in¶
packages/auth/src/hooks/useHubAuth.ts:20
isLoading¶
isLoading:
boolean
Defined in¶
packages/auth/src/hooks/useHubAuth.ts:21
isAuthenticated¶
isAuthenticated:
boolean
Defined in¶
packages/auth/src/hooks/useHubAuth.ts:22
signOut()¶
signOut: () =>
void
Returns¶
void
Defined in¶
packages/auth/src/hooks/useHubAuth.ts:23
goToHub()¶
goToHub: () =>
void
Returns¶
void
Defined in¶
packages/auth/src/hooks/useHubAuth.ts:24
goToProfile()¶
goToProfile: () =>
void
Returns¶
void
Defined in¶
packages/auth/src/hooks/useHubAuth.ts:25
BaseUserConstraint¶
Extended by¶
Properties¶
id¶
id:
string
Defined in¶
packages/auth/src/hooks/usePermissions.tsx:7
name¶
name:
string
Defined in¶
packages/auth/src/hooks/usePermissions.tsx:8
email?¶
optionalemail:string
Defined in¶
packages/auth/src/hooks/usePermissions.tsx:9
AppPermission¶
Properties¶
appId¶
appId:
string
Defined in¶
packages/auth/src/hooks/usePermissions.tsx:14
roles¶
roles:
string[]
Defined in¶
packages/auth/src/hooks/usePermissions.tsx:15
features¶
features:
string[]
Defined in¶
packages/auth/src/hooks/usePermissions.tsx:16
UserWithPermissions¶
Extends¶
Properties¶
id¶
id:
string
Inherited from¶
Defined in¶
packages/auth/src/hooks/usePermissions.tsx:7
name¶
name:
string
Inherited from¶
Defined in¶
packages/auth/src/hooks/usePermissions.tsx:8
email?¶
optionalemail:string
Inherited from¶
Defined in¶
packages/auth/src/hooks/usePermissions.tsx:9
permissions?¶
optionalpermissions:AppPermission[]
Defined in¶
packages/auth/src/hooks/usePermissions.tsx:20
apps?¶
optionalapps:string[]
Defined in¶
packages/auth/src/hooks/usePermissions.tsx:21
PermissionCheck¶
Properties¶
hasAccess¶
hasAccess:
boolean
Defined in¶
packages/auth/src/hooks/usePermissions.tsx:25
hasFeature()¶
hasFeature: (
feature) =>boolean
Parameters¶
• feature: string
Returns¶
boolean
Defined in¶
packages/auth/src/hooks/usePermissions.tsx:26
hasRole()¶
hasRole: (
role) =>boolean
Parameters¶
• role: string
Returns¶
boolean
Defined in¶
packages/auth/src/hooks/usePermissions.tsx:27
isLoading¶
isLoading:
boolean
Defined in¶
packages/auth/src/hooks/usePermissions.tsx:28
error?¶
optionalerror:Error
Defined in¶
packages/auth/src/hooks/usePermissions.tsx:29
RateLimitConfig¶
Generic rate limiter implementation Works with any request/response pattern, not tied to Next.js
Properties¶
windowMs¶
windowMs:
number
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:7
maxRequests¶
maxRequests:
number
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:8
skipSuccessfulRequests?¶
optionalskipSuccessfulRequests:boolean
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:9
keyGenerator()?¶
optionalkeyGenerator: (identifier) =>string
Parameters¶
• identifier: string
Returns¶
string
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:10
message?¶
optionalmessage:string
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:11
RateLimitStore¶
Methods¶
increment()¶
increment(
key,windowMs):Promise\<number>
Parameters¶
• key: string
• windowMs: number
Returns¶
Promise\<number>
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:15
reset()¶
reset(
key):Promise\<void>
Parameters¶
• key: string
Returns¶
Promise\<void>
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:16
RateLimitResult¶
Properties¶
allowed¶
allowed:
boolean
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:20
limit¶
limit:
number
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:21
remaining¶
remaining:
number
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:22
resetAt¶
resetAt:
Date
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:23
retryAfter?¶
optionalretryAfter:number
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:24
PermissionContext¶
Properties¶
currentTime?¶
optionalcurrentTime:Date
Defined in¶
packages/auth/src/permissions/conditional.ts:4
ipAddress?¶
optionalipAddress:string
Defined in¶
packages/auth/src/permissions/conditional.ts:5
mfaVerified?¶
optionalmfaVerified:boolean
Defined in¶
packages/auth/src/permissions/conditional.ts:6
custom?¶
optionalcustom:Record\<string,unknown>
Defined in¶
packages/auth/src/permissions/conditional.ts:7
PermissionCheckOptions¶
Properties¶
appId¶
appId:
string
Defined in¶
packages/auth/src/permissions/middleware.ts:7
requiredRole?¶
optionalrequiredRole:AppRole
Defined in¶
packages/auth/src/permissions/middleware.ts:8
requiredFeatures?¶
optionalrequiredFeatures:string[]
Defined in¶
packages/auth/src/permissions/middleware.ts:9
conditions?¶
optionalconditions:PermissionContext
Defined in¶
packages/auth/src/permissions/middleware.ts:10
AuthLogEntry¶
Properties¶
timestamp¶
timestamp:
string
Defined in¶
packages/auth/src/services/authLogger.ts:56
level¶
level:
LogLevel
Defined in¶
packages/auth/src/services/authLogger.ts:57
eventType¶
eventType:
AuthEventType
Defined in¶
packages/auth/src/services/authLogger.ts:58
userId?¶
optionaluserId:string
Defined in¶
packages/auth/src/services/authLogger.ts:59
email?¶
optionalemail:string
Defined in¶
packages/auth/src/services/authLogger.ts:60
appId?¶
optionalappId:string
Defined in¶
packages/auth/src/services/authLogger.ts:61
sourceApp?¶
optionalsourceApp:string
Defined in¶
packages/auth/src/services/authLogger.ts:62
targetApp?¶
optionaltargetApp:string
Defined in¶
packages/auth/src/services/authLogger.ts:63
sessionId?¶
optionalsessionId:string
Defined in¶
packages/auth/src/services/authLogger.ts:64
ip?¶
optionalip:string
Defined in¶
packages/auth/src/services/authLogger.ts:65
userAgent?¶
optionaluserAgent:string
Defined in¶
packages/auth/src/services/authLogger.ts:66
message¶
message:
string
Defined in¶
packages/auth/src/services/authLogger.ts:67
metadata?¶
optionalmetadata:Record\<string,any>
Defined in¶
packages/auth/src/services/authLogger.ts:68
duration?¶
optionalduration:number
Defined in¶
packages/auth/src/services/authLogger.ts:69
success?¶
optionalsuccess:boolean
Defined in¶
packages/auth/src/services/authLogger.ts:70
errorCode?¶
optionalerrorCode:string
Defined in¶
packages/auth/src/services/authLogger.ts:71
errorMessage?¶
optionalerrorMessage:string
Defined in¶
packages/auth/src/services/authLogger.ts:72
stackTrace?¶
optionalstackTrace:string
Defined in¶
packages/auth/src/services/authLogger.ts:73
AuthMetrics¶
Properties¶
loginAttempts¶
loginAttempts:
number
Defined in¶
packages/auth/src/services/authLogger.ts:77
loginSuccesses¶
loginSuccesses:
number
Defined in¶
packages/auth/src/services/authLogger.ts:78
loginFailures¶
loginFailures:
number
Defined in¶
packages/auth/src/services/authLogger.ts:79
activeTokens¶
activeTokens:
number
Defined in¶
packages/auth/src/services/authLogger.ts:80
tokenRefreshes¶
tokenRefreshes:
number
Defined in¶
packages/auth/src/services/authLogger.ts:81
crossAppNavigations¶
crossAppNavigations:
number
Defined in¶
packages/auth/src/services/authLogger.ts:82
averageLoginTime¶
averageLoginTime:
number
Defined in¶
packages/auth/src/services/authLogger.ts:83
errorRate¶
errorRate:
number
Defined in¶
packages/auth/src/services/authLogger.ts:84
AuthUser¶
Properties¶
uid¶
uid:
string
Defined in¶
packages/auth/src/services/authTokenService.ts:9
email?¶
optionalemail:string
Defined in¶
packages/auth/src/services/authTokenService.ts:10
displayName?¶
optionaldisplayName:string
Defined in¶
packages/auth/src/services/authTokenService.ts:11
photoURL?¶
optionalphotoURL:null|string
Defined in¶
packages/auth/src/services/authTokenService.ts:12
emailVerified?¶
optionalemailVerified:boolean
Defined in¶
packages/auth/src/services/authTokenService.ts:13
permissions?¶
optionalpermissions:string[]
Defined in¶
packages/auth/src/services/authTokenService.ts:14
apps?¶
optionalapps:string[]
Defined in¶
packages/auth/src/services/authTokenService.ts:15
SSOToken¶
Properties¶
token¶
token:
string
Defined in¶
packages/auth/src/services/ssoService.ts:6
expiresAt¶
expiresAt:
Date
Defined in¶
packages/auth/src/services/ssoService.ts:7
appId¶
appId:
string
Defined in¶
packages/auth/src/services/ssoService.ts:8
userId¶
userId:
string
Defined in¶
packages/auth/src/services/ssoService.ts:9
permissions¶
permissions:
string[]
Defined in¶
packages/auth/src/services/ssoService.ts:10
metadata?¶
optionalmetadata:Record\<string,any>
Defined in¶
packages/auth/src/services/ssoService.ts:11
SSOClaims¶
Properties¶
userId¶
userId:
string
Defined in¶
packages/auth/src/services/ssoService.ts:15
email¶
email:
string
Defined in¶
packages/auth/src/services/ssoService.ts:16
displayName?¶
optionaldisplayName:string
Defined in¶
packages/auth/src/services/ssoService.ts:17
photoURL?¶
optionalphotoURL:string
Defined in¶
packages/auth/src/services/ssoService.ts:18
appId¶
appId:
string
Defined in¶
packages/auth/src/services/ssoService.ts:19
permissions¶
permissions:
string[]
Defined in¶
packages/auth/src/services/ssoService.ts:20
sessionId?¶
optionalsessionId:string
Defined in¶
packages/auth/src/services/ssoService.ts:21
metadata?¶
optionalmetadata:Record\<string,any>
Defined in¶
packages/auth/src/services/ssoService.ts:22
SSOSessionInfo¶
Properties¶
sessionId¶
sessionId:
string
Defined in¶
packages/auth/src/services/ssoService.ts:26
userId¶
userId:
string
Defined in¶
packages/auth/src/services/ssoService.ts:27
appId¶
appId:
string
Defined in¶
packages/auth/src/services/ssoService.ts:28
createdAt¶
createdAt:
Date
Defined in¶
packages/auth/src/services/ssoService.ts:29
lastActivity¶
lastActivity:
Date
Defined in¶
packages/auth/src/services/ssoService.ts:30
expiresAt¶
expiresAt:
Date
Defined in¶
packages/auth/src/services/ssoService.ts:31
SharedAuthUser¶
Shared authentication state management for cross-app SSO This bypasses Firebase Auth emulator limitations in development
Properties¶
uid¶
uid:
string
Defined in¶
packages/auth/src/shared-auth-state.ts:7
email¶
email:
null|string
Defined in¶
packages/auth/src/shared-auth-state.ts:8
displayName¶
displayName:
null|string
Defined in¶
packages/auth/src/shared-auth-state.ts:9
photoURL¶
photoURL:
null|string
Defined in¶
packages/auth/src/shared-auth-state.ts:10
emailVerified¶
emailVerified:
boolean
Defined in¶
packages/auth/src/shared-auth-state.ts:11
SharedAuthState¶
Properties¶
user¶
user:
null|SharedAuthUser
Defined in¶
packages/auth/src/shared-auth-state.ts:15
token¶
token:
null|string
Defined in¶
packages/auth/src/shared-auth-state.ts:16
timestamp¶
timestamp:
number
Defined in¶
packages/auth/src/shared-auth-state.ts:17
ErrorRecoveryOptions¶
Properties¶
maxRetries?¶
optionalmaxRetries:number
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:18
retryDelay?¶
optionalretryDelay:number
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:19
backoffMultiplier?¶
optionalbackoffMultiplier:number
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:20
fallbackValue?¶
optionalfallbackValue:any
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:21
onError()?¶
optionalonError: (error,attempt) =>void
Parameters¶
• error: Error
• attempt: number
Returns¶
void
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:22
onRecovery()?¶
optionalonRecovery: () =>void
Returns¶
void
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:23
strategy?¶
optionalstrategy:RecoveryStrategy
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:24
ErrorDetails¶
Properties¶
field?¶
optionalfield:string
Defined in¶
packages/auth/src/utils/errors.ts:52
value?¶
optionalvalue:any
Defined in¶
packages/auth/src/utils/errors.ts:53
constraints?¶
optionalconstraints:string[]
Defined in¶
packages/auth/src/utils/errors.ts:54
hint?¶
optionalhint:string
Defined in¶
packages/auth/src/utils/errors.ts:55
PerformanceMetric¶
Performance monitoring utilities
Properties¶
name¶
name:
string
Defined in¶
packages/auth/src/utils/performance.ts:11
startTime¶
startTime:
number
Defined in¶
packages/auth/src/utils/performance.ts:12
endTime?¶
optionalendTime:number
Defined in¶
packages/auth/src/utils/performance.ts:13
duration?¶
optionalduration:number
Defined in¶
packages/auth/src/utils/performance.ts:14
metadata?¶
optionalmetadata:Record\<string,any>
Defined in¶
packages/auth/src/utils/performance.ts:15
Variables¶
AuthContext¶
constAuthContext:Context\<undefined|AuthContextType\<BaseUserConstraint>> =defaultAuthContext.AuthContext
Defined in¶
packages/auth/src/context/AuthContext.tsx:285
authRateLimiter¶
constauthRateLimiter:RateLimiter
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:134
apiRateLimiter¶
constapiRateLimiter:RateLimiter
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:141
exportRateLimiter¶
constexportRateLimiter:RateLimiter
Defined in¶
packages/auth/src/middleware/rateLimiter.ts:147
authLogger¶
constauthLogger:AuthLogger
Defined in¶
packages/auth/src/services/authLogger.ts:445
cacheService¶
constcacheService:CacheService
Defined in¶
packages/auth/src/services/cacheService.ts:125
ssoService¶
constssoService:SSOService
Defined in¶
packages/auth/src/services/ssoService.ts:88
stream¶
conststream:object
Type declaration¶
write()¶
write: (
message) =>void
Parameters¶
• message: string
Returns¶
void
Defined in¶
packages/auth/src/utils/logger.ts:81
log¶
constlog:object
Type declaration¶
error()¶
error: (
message,meta?) =>void
Parameters¶
• message: string
• meta?: any
Returns¶
void
warn()¶
warn: (
message,meta?) =>void
Parameters¶
• message: string
• meta?: any
Returns¶
void
info()¶
info: (
message,meta?) =>void
Parameters¶
• message: string
• meta?: any
Returns¶
void
http()¶
http: (
message,meta?) =>void
Parameters¶
• message: string
• meta?: any
Returns¶
void
debug()¶
debug: (
message,meta?) =>void
Parameters¶
• message: string
• meta?: any
Returns¶
void
Defined in¶
packages/auth/src/utils/logger.ts:88
performanceMonitor¶
constperformanceMonitor:PerformanceMonitor
Defined in¶
packages/auth/src/utils/performance.ts:112
emailSchema¶
constemailSchema:ZodString
Common validation schemas
Defined in¶
packages/auth/src/utils/validation.ts:9
passwordSchema¶
constpasswordSchema:ZodString
Defined in¶
packages/auth/src/utils/validation.ts:12
userIdSchema¶
constuserIdSchema:ZodString
Defined in¶
packages/auth/src/utils/validation.ts:22
displayNameSchema¶
constdisplayNameSchema:ZodString
Defined in¶
packages/auth/src/utils/validation.ts:25
twoFactorCodeSchema¶
consttwoFactorCodeSchema:ZodString
Defined in¶
packages/auth/src/utils/validation.ts:32
backupCodeSchema¶
constbackupCodeSchema:ZodString
Defined in¶
packages/auth/src/utils/validation.ts:35
jwtTokenSchema¶
constjwtTokenSchema:ZodString
Defined in¶
packages/auth/src/utils/validation.ts:38
sessionIdSchema¶
constsessionIdSchema:ZodString
Defined in¶
packages/auth/src/utils/validation.ts:41
visibilityLevelSchema¶
constvisibilityLevelSchema:ZodEnum\<["everyone","friends","only-me"]>
Defined in¶
packages/auth/src/utils/validation.ts:44
consentTypeSchema¶
constconsentTypeSchema:ZodEnum\<["necessary","functional","analytics","marketing","personalization"]>
Defined in¶
packages/auth/src/utils/validation.ts:47
exportFormatSchema¶
constexportFormatSchema:ZodEnum\<["json","csv"]>
Defined in¶
packages/auth/src/utils/validation.ts:50
dateRangeSchema¶
constdateRangeSchema:ZodEffects\<ZodObject\<object,"strip",ZodTypeAny,object,object>,object,object>
Defined in¶
packages/auth/src/utils/validation.ts:53
signInSchema¶
constsignInSchema:ZodObject\<object,"strip",ZodTypeAny,object,object>
Authentication schemas
Type declaration¶
email¶
email:
ZodString=emailSchema
password¶
password:
ZodString
rememberMe¶
rememberMe:
ZodOptional\<ZodBoolean>
Defined in¶
packages/auth/src/utils/validation.ts:70
signUpSchema¶
constsignUpSchema:ZodObject\<object,"strip",ZodTypeAny,object,object>
Type declaration¶
email¶
email:
ZodString=emailSchema
password¶
password:
ZodString=passwordSchema
displayName¶
displayName:
ZodOptional\<ZodString>
acceptTerms¶
acceptTerms:
ZodEffects\<ZodBoolean,boolean,boolean>
marketingConsent¶
marketingConsent:
ZodOptional\<ZodBoolean>
Defined in¶
packages/auth/src/utils/validation.ts:76
refreshTokenSchema¶
constrefreshTokenSchema:ZodObject\<object,"strip",ZodTypeAny,object,object>
Type declaration¶
refreshToken¶
refreshToken:
ZodString=jwtTokenSchema
Defined in¶
packages/auth/src/utils/validation.ts:84
verify2FASchema¶
constverify2FASchema:ZodObject\<object,"strip",ZodTypeAny,object,object>
Type declaration¶
userId¶
userId:
ZodString=userIdSchema
code¶
code:
ZodString=twoFactorCodeSchema
Defined in¶
packages/auth/src/utils/validation.ts:88
verifyBackupCodeSchema¶
constverifyBackupCodeSchema:ZodObject\<object,"strip",ZodTypeAny,object,object>
Type declaration¶
userId¶
userId:
ZodString=userIdSchema
backupCode¶
backupCode:
ZodString=backupCodeSchema
Defined in¶
packages/auth/src/utils/validation.ts:93
revokeSessionSchema¶
constrevokeSessionSchema:ZodObject\<object,"strip",ZodTypeAny,object,object>
Session management schemas
Type declaration¶
sessionId¶
sessionId:
ZodString=sessionIdSchema
Defined in¶
packages/auth/src/utils/validation.ts:102
revokeAllSessionsSchema¶
constrevokeAllSessionsSchema:ZodObject\<object,"strip",ZodTypeAny,object,object>
Type declaration¶
password¶
password:
ZodString
keepCurrent¶
keepCurrent:
ZodDefault\<ZodOptional\<ZodBoolean>>
Defined in¶
packages/auth/src/utils/validation.ts:106
privacySettingsSchema¶
constprivacySettingsSchema:ZodObject\<object,"strip",ZodTypeAny,object,object>
Privacy schemas
Type declaration¶
profileVisibility¶
profileVisibility:
ZodOptional\<ZodEnum\<["everyone","friends","only-me"]>> =visibilityLevelSchema
activityVisibility¶
activityVisibility:
ZodOptional\<ZodObject\<object,"strip",ZodTypeAny,object,object>>
dataSharing¶
dataSharing:
ZodOptional\<ZodObject\<object,"strip",ZodTypeAny,object,object>>
Defined in¶
packages/auth/src/utils/validation.ts:115
consentRecordSchema¶
constconsentRecordSchema:ZodObject\<object,"strip",ZodTypeAny,object,object>
Type declaration¶
consentType¶
consentType:
ZodEnum\<["necessary","functional","analytics","marketing","personalization"]> =consentTypeSchema
granted¶
granted:
ZodBoolean
metadata¶
metadata:
ZodOptional\<ZodRecord\<ZodString,ZodAny>>
Defined in¶
packages/auth/src/utils/validation.ts:130
exportRequestSchema¶
constexportRequestSchema:ZodObject\<object,"strip",ZodTypeAny,object,object>
Data export schemas
Type declaration¶
format¶
format:
ZodEnum\<["json","csv"]> =exportFormatSchema
categories¶
categories:
ZodOptional\<ZodArray\<ZodString,"many">>
dateRange¶
dateRange:
ZodOptional\<ZodEffects\<ZodObject\<object,"strip",ZodTypeAny,object,object>,object,object>>
includeMetadata¶
includeMetadata:
ZodDefault\<ZodOptional\<ZodBoolean>>
compress¶
compress:
ZodDefault\<ZodOptional\<ZodBoolean>>
Defined in¶
packages/auth/src/utils/validation.ts:140
deletionRequestSchema¶
constdeletionRequestSchema:ZodObject\<object,"strip",ZodTypeAny,object,object>
GDPR schemas
Type declaration¶
password¶
password:
ZodString
reason¶
reason:
ZodOptional\<ZodString>
feedback¶
feedback:
ZodOptional\<ZodString>
Defined in¶
packages/auth/src/utils/validation.ts:152
dataPortabilitySchema¶
constdataPortabilitySchema:ZodObject\<object,"strip",ZodTypeAny,object,object>
Type declaration¶
format¶
format:
ZodEnum\<["json","csv"]> =exportFormatSchema
includeHistory¶
includeHistory:
ZodDefault\<ZodOptional\<ZodBoolean>>
targetService¶
targetService:
ZodOptional\<ZodString>
Defined in¶
packages/auth/src/utils/validation.ts:158
ROLE_HIERARCHY¶
constROLE_HIERARCHY:Record\<AppRole,number>
Role hierarchy values for comparison
Defined in¶
packages/types/src/permissions.ts:9
Functions¶
useCrossOriginAuth()¶
useCrossOriginAuth(
adapter):void
Parameters¶
• adapter: AuthAdapter
Returns¶
void
Defined in¶
packages/auth/src/components/CrossOriginAuth.tsx:28
getCrossOriginAuthState()¶
getCrossOriginAuthState():
CrossOriginAuthState|null
Returns¶
CrossOriginAuthState | null
Defined in¶
packages/auth/src/components/CrossOriginAuth.tsx:56
clearCrossOriginAuthState()¶
clearCrossOriginAuthState():
void
Returns¶
void
Defined in¶
packages/auth/src/components/CrossOriginAuth.tsx:91
waitForSharedAuth()¶
waitForSharedAuth(
timeout):Promise\<CrossOriginAuthState|null>
Parameters¶
• timeout: number = 5000
Returns¶
Promise\<CrossOriginAuthState | null>
Defined in¶
packages/auth/src/components/CrossOriginAuth.tsx:96
CrossOriginAuth()¶
CrossOriginAuth(
__namedParameters):null
Parameters¶
• __namedParameters
• __namedParameters.adapter: AuthAdapter
Returns¶
null
Defined in¶
packages/auth/src/components/CrossOriginAuth.tsx:137
useSessionSync()¶
useSessionSync(
__namedParameters):void
Parameters¶
• __namedParameters: SessionSyncConfig
Returns¶
void
Defined in¶
packages/auth/src/components/SessionSync.tsx:16
useSharedAuthState()¶
useSharedAuthState():
boolean
Returns¶
boolean
Defined in¶
packages/auth/src/components/SessionSync.tsx:75
clearSharedAuthState()¶
clearSharedAuthState():
void
Returns¶
void
Defined in¶
packages/auth/src/components/SessionSync.tsx:84
SessionSync()¶
SessionSync(
props):null
Parameters¶
• props: SessionSyncConfig
Returns¶
null
Defined in¶
packages/auth/src/components/SessionSync.tsx:102
sanitizeForFirestore()¶
sanitizeForFirestore(
obj):Record\<string,any>
Drop undefined values (kept for backward-compatible export).
Parameters¶
• obj: Record\<string, unknown>
Returns¶
Record\<string, any>
Defined in¶
packages/auth/src/context/AuthContext.tsx:65
createAuthContext()¶
createAuthContext\<
T>():object
Type Parameters¶
• T extends BaseUserConstraint = BaseUserConstraint
Returns¶
object
AuthProvider()¶
AuthProvider: (
__namedParameters) =>Element
Parameters¶
• __namedParameters: AuthProviderProps\<T>
Returns¶
Element
useAuth()¶
useAuth: () =>
AuthContextType\<T>
Returns¶
AuthContextType\<T>
AuthContext¶
AuthContext:
Context\<undefined|AuthContextType\<T>>
Defined in¶
packages/auth/src/context/AuthContext.tsx:74
AuthProvider()¶
AuthProvider(
__namedParameters):Element
Parameters¶
• __namedParameters: AuthProviderProps\<BaseUserConstraint>
Returns¶
Element
Defined in¶
packages/auth/src/context/AuthContext.tsx:283
useAuth()¶
useAuth():
AuthContextType\<BaseUserConstraint>
Returns¶
AuthContextType\<BaseUserConstraint>
Defined in¶
packages/auth/src/context/AuthContext.tsx:284
useHubAuth()¶
useHubAuth():
HubAuthState
Simple hook for lightweight apps to consume Hub authentication No Firebase, no user management, just auth tokens
Returns¶
Defined in¶
packages/auth/src/hooks/useHubAuth.ts:37
usePermissions()¶
usePermissions(
__namedParameters):PermissionCheck
Hook to check user permissions for the current app
Parameters¶
• __namedParameters: UsePermissionsConfig
Returns¶
Defined in¶
packages/auth/src/hooks/usePermissions.tsx:42
withPermissions()¶
withPermissions\<
P>(Component,config): (props) =>Element
HOC to protect components with permission checks
Type Parameters¶
• P extends object
Parameters¶
• Component: ComponentType\<P>
• config: Omit\<UsePermissionsConfig, "user">
Returns¶
Function
Parameters¶
• props: P & object
Returns¶
Element
Defined in¶
packages/auth/src/hooks/usePermissions.tsx:121
evaluateConditions()¶
evaluateConditions(
conditions,context):boolean
Parameters¶
• conditions: PermissionCondition[]
• context: PermissionContext
Returns¶
boolean
Defined in¶
packages/auth/src/permissions/conditional.ts:10
checkPermissions()¶
checkPermissions(
userPermissions,options):boolean
Check if user has required permissions
Parameters¶
• userPermissions: AppPermission[]
• options: PermissionCheckOptions
Returns¶
boolean
Defined in¶
packages/auth/src/permissions/middleware.ts:16
requirePermission()¶
requirePermission(
options): (userPermissions) =>boolean
Middleware helper for requiring permissions
Parameters¶
• options: PermissionCheckOptions
Returns¶
Function
Parameters¶
• userPermissions: AppPermission[]
Returns¶
boolean
Defined in¶
packages/auth/src/permissions/middleware.ts:65
getRoleLevel()¶
getRoleLevel(
role):number
Parameters¶
• role: AppRole
Returns¶
number
Defined in¶
packages/auth/src/permissions/role-hierarchy.ts:6
isRoleAbove()¶
isRoleAbove(
role,other):boolean
Parameters¶
• role: AppRole
• other: AppRole
Returns¶
boolean
Defined in¶
packages/auth/src/permissions/role-hierarchy.ts:10
debounce()¶
debounce\<
T>(func,delay): (...args) =>void
Type Parameters¶
• T extends (...args) => any
Parameters¶
• func: T
• delay: number
Returns¶
Function
Parameters¶
• ...args: Parameters\<T>
Returns¶
void
Defined in¶
packages/auth/src/services/cacheService.ts:192
throttle()¶
throttle\<
T>(func,limit): (...args) =>void
Type Parameters¶
• T extends (...args) => any
Parameters¶
• func: T
• limit: number
Returns¶
Function
Parameters¶
• ...args: Parameters\<T>
Returns¶
void
Defined in¶
packages/auth/src/services/cacheService.ts:211
memoize()¶
memoize\<
T>(func,getKey):T
Type Parameters¶
• T extends (...args) => any
Parameters¶
• func: T
• getKey = ...
Returns¶
T
Defined in¶
packages/auth/src/services/cacheService.ts:229
saveSharedAuthState()¶
saveSharedAuthState(
user,token):void
Save authentication state to be shared across apps
Parameters¶
• user: null | SharedAuthUser
• token: null | string = null
Returns¶
void
Defined in¶
packages/auth/src/shared-auth-state.ts:26
getSharedAuthState()¶
getSharedAuthState():
SharedAuthState|null
Get shared authentication state
Returns¶
SharedAuthState | null
Defined in¶
packages/auth/src/shared-auth-state.ts:53
subscribeToAuthStateChanges()¶
subscribeToAuthStateChanges(
callback): () =>void
Subscribe to authentication state changes
Parameters¶
• callback
Returns¶
Function
Returns¶
void
Defined in¶
packages/auth/src/shared-auth-state.ts:99
waitForAuth()¶
waitForAuth(
timeout):Promise\<SharedAuthState|null>
Wait for authentication to be available (with timeout)
Parameters¶
• timeout: number = 5000
Returns¶
Promise\<SharedAuthState | null>
Defined in¶
packages/auth/src/shared-auth-state.ts:116
retryWithBackoff()¶
retryWithBackoff\<
T>(fn,options):Promise\<T>
Retry with exponential backoff
Type Parameters¶
• T
Parameters¶
• fn
• options: ErrorRecoveryOptions = {}
Returns¶
Promise\<T>
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:30
useErrorBoundary()¶
useErrorBoundary():
object
Error boundary hook
Returns¶
object
error¶
error:
null|Error
resetError()¶
resetError: () =>
void
Returns¶
void
captureError()¶
captureError: (
error) =>void
Parameters¶
• error: Error
Returns¶
void
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:124
useOfflineRecovery()¶
useOfflineRecovery(
onOnline?,onOffline?):boolean
Offline recovery hook
Parameters¶
• onOnline?
• onOffline?
Returns¶
boolean
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:163
useAutoSave()¶
useAutoSave\<
T>(data,saveFn,options):object
Auto-save with recovery
Type Parameters¶
• T
Parameters¶
• data: T
• saveFn
• options = {}
• options.delay?: number
• options.onError?
• options.onSuccess?
Returns¶
object
isSaving¶
isSaving:
boolean
lastSaved¶
lastSaved:
null|Date
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:197
recoverFromIndexedDBCorruption()¶
recoverFromIndexedDBCorruption():
Promise\<boolean>
IndexedDB corruption recovery
Returns¶
Promise\<boolean>
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:250
handleFirebaseError()¶
handleFirebaseError(
error):object
Firebase error recovery
Parameters¶
• error: any
Returns¶
object
message¶
message:
string
recovery¶
recovery:
RecoveryStrategy
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:278
DefaultErrorFallback()¶
DefaultErrorFallback(
__namedParameters):Element
Default error fallback component
Parameters¶
• __namedParameters
• __namedParameters.error: Error
• __namedParameters.reset
Returns¶
Element
Defined in¶
packages/auth/src/utils/errorRecovery.tsx:378
isOperationalError()¶
isOperationalError(
error):boolean
Error handler utility
Parameters¶
• error: Error
Returns¶
boolean
Defined in¶
packages/auth/src/utils/errors.ts:238
serializeError()¶
serializeError(
error):any
Error serializer for API responses
Parameters¶
• error: Error
Returns¶
any
Defined in¶
packages/auth/src/utils/errors.ts:248
createLogger()¶
createLogger(
context):object
Parameters¶
• context: string
Returns¶
object
error()¶
error: (
message,meta?) =>void
Parameters¶
• message: string
• meta?: any
Returns¶
void
warn()¶
warn: (
message,meta?) =>void
Parameters¶
• message: string
• meta?: any
Returns¶
void
info()¶
info: (
message,meta?) =>void
Parameters¶
• message: string
• meta?: any
Returns¶
void
http()¶
http: (
message,meta?) =>void
Parameters¶
• message: string
• meta?: any
Returns¶
void
debug()¶
debug: (
message,meta?) =>void
Parameters¶
• message: string
• meta?: any
Returns¶
void
Defined in¶
packages/auth/src/utils/logger.ts:97
useRenderPerformance()¶
useRenderPerformance(
componentName):void
React hook for component render performance
Parameters¶
• componentName: string
Returns¶
void
Defined in¶
packages/auth/src/utils/performance.ts:117
lazyWithPerformance()¶
lazyWithPerformance\<
T>(importFn,componentName):React.LazyExoticComponent\<T>
Lazy component loading with performance tracking
Type Parameters¶
• T extends ComponentType\<any>
Parameters¶
• importFn
• componentName: string
Returns¶
React.LazyExoticComponent\<T>
Defined in¶
packages/auth/src/utils/performance.ts:133
reportWebVitals()¶
reportWebVitals(
metric):void
Web Vitals monitoring
Parameters¶
• metric: any
Returns¶
void
Defined in¶
packages/auth/src/utils/performance.ts:154
optimizeImage()¶
optimizeImage(
src,options):string
Image loading optimization
Parameters¶
• src: string
• options = {}
• options.width?: number
• options.height?: number
• options.quality?: number
• options.format?: "webp" | "jpeg" | "png"
Returns¶
string
Defined in¶
packages/auth/src/utils/performance.ts:177
useIntersectionObserver()¶
useIntersectionObserver(
ref,options):boolean
Intersection Observer hook for lazy loading
Parameters¶
• ref: RefObject\<Element>
• options: IntersectionObserverInit = {}
Returns¶
boolean
Defined in¶
packages/auth/src/utils/performance.ts:200
requestIdleCallback()¶
Request idle callback polyfill
requestIdleCallback(callback, options)¶
requestIdleCallback(
callback,options?):number|Timeout
Parameters¶
• callback: IdleRequestCallback
• options?: IdleRequestOptions
Returns¶
number | Timeout
Defined in¶
packages/auth/src/utils/performance.ts:226
requestIdleCallback(callback)¶
requestIdleCallback(
callback):number|Timeout
Request idle callback polyfill
Parameters¶
• callback: IdleRequestCallback
Returns¶
number | Timeout
Defined in¶
packages/auth/src/utils/performance.ts:229
cancelIdleCallback()¶
cancelIdleCallback(
handle):void
Parameters¶
• handle: number
Returns¶
void
Defined in¶
packages/auth/src/utils/performance.ts:239
validate()¶
validate\<
T>(schema,data):T
Validates input against a schema and throws ValidationError if invalid
Type Parameters¶
• T
Parameters¶
• schema: ZodType\<T, ZodTypeDef, T>
• data: unknown
Returns¶
T
Defined in¶
packages/auth/src/utils/validation.ts:171
validateSafe()¶
validateSafe\<
T>(schema,data):object|object
Validates input and returns result without throwing
Type Parameters¶
• T
Parameters¶
• schema: ZodType\<T, ZodTypeDef, T>
• data: unknown
Returns¶
object | object
Defined in¶
packages/auth/src/utils/validation.ts:189
sanitizeEmail()¶
sanitizeEmail(
string
Sanitization helpers
Parameters¶
• email: string
Returns¶
string
Defined in¶
packages/auth/src/utils/validation.ts:201
sanitizeDisplayName()¶
sanitizeDisplayName(
name):string
Parameters¶
• name: string
Returns¶
string
Defined in¶
packages/auth/src/utils/validation.ts:205
sanitizeString()¶
sanitizeString(
str,maxLength):string
Parameters¶
• str: string
• maxLength: number = 1000
Returns¶
string
Defined in¶
packages/auth/src/utils/validation.ts:209
isValidEmail()¶
isValidEmail(
boolean
Type guards
Parameters¶
• email: string
Returns¶
boolean
Defined in¶
packages/auth/src/utils/validation.ts:217
isValidUserId()¶
isValidUserId(
userId):boolean
Parameters¶
• userId: string
Returns¶
boolean
Defined in¶
packages/auth/src/utils/validation.ts:221
isValidJWT()¶
isValidJWT(
token):boolean
Parameters¶
• token: string
Returns¶
boolean
Defined in¶
packages/auth/src/utils/validation.ts:225
isValid2FACode()¶
isValid2FACode(
code):boolean
Parameters¶
• code: string
Returns¶
boolean
Defined in¶
packages/auth/src/utils/validation.ts:229
validateRequest()¶
validateRequest\<
T>(schema): (data) =>T
Request validation middleware helper
Type Parameters¶
• T
Parameters¶
• schema: ZodType\<T, ZodTypeDef, T>
Returns¶
Function
Parameters¶
• data: unknown
Returns¶
T
Defined in¶
packages/auth/src/utils/validation.ts:236
hasMinimumRole()¶
hasMinimumRole(
userRole,requiredRole):boolean
Check if user role meets minimum requirement
Parameters¶
• userRole: AppRole
• requiredRole: AppRole
Returns¶
boolean