-
Notifications
You must be signed in to change notification settings - Fork 1
Exports
- accessTokenAvailable
- accessTokenUnavailable
- authSessionEnd
- authSessionPause
- authSessionResume
- authSessionStart
- checkAccessTokenExpiration
- login
- logout
- retrieveTokensRequest
- retrieveTokensResolve
- setTokensPersistence
- setUserWithTokens
- terminate
Ƭ PetrusCredentials: any
Ƭ PetrusLogger: Object
Name | Type |
---|---|
error |
Console ["error" ] |
Ƭ PetrusOAuth: Object
Name | Type |
---|---|
searchParams |
Record <string , any > |
Ƭ PetrusTokens: Object
Name | Type |
---|---|
accessToken |
{ expiration? : string | null ; token : string } & Record <string , any > |
refreshToken? |
{ token : string } & Record <string , any > |
Ƭ PetrusUser: any
Ƭ StorageDriver: Object
Name | Type |
---|---|
get |
<Key, Value>(k : Key ) => HandlerReturnValue <void | Value > |
remove |
<Key>(k : Key ) => HandlerReturnValue <void > |
set |
<Key, Value>(k : Key , v : Value ) => HandlerReturnValue <void > |
• Const
storageDrivers: Object
Name | Type |
---|---|
indexedDB |
{ get : <Key>(key : Key ) => Promise <any > ; remove : <Key>(key : Key ) => Promise <void > ; set : <Key, Value>(key : Key , val : Value ) => Promise <void | IDBValidKey > } |
indexedDB.get |
[object Object] |
indexedDB.remove |
[object Object] |
indexedDB.set |
[object Object] |
resetStorage |
{ get : () => null ; set : () => void ; remove : <Key>(key : Key ) => Promise <void > } |
resetStorage.get |
() => null
|
resetStorage.set |
() => void
|
resetStorage.remove |
[object Object] |
sessionStorage |
{ get : <Key>(key : Key ) => any ; remove : <Key>(key : Key ) => void ; set : <Key, Value>(key : Key , values : Value ) => void } |
sessionStorage.get |
[object Object] |
sessionStorage.remove |
[object Object] |
sessionStorage.set |
[object Object] |
• Const
accessTokenAvailable: ActionCreatorWithPayload
<{ expiration?
: null
| string
; token
: string
} & Record
<string
, any
>, "@@petrus/ACCESS_TOKEN_AVAILABLE"
>
src/services/actions/accessTokenAvailability.ts:13
• Const
accessTokenUnavailable: ActionCreatorWithoutPayload
<"@@petrus/ACCESS_TOKEN_UNAVAILABLE"
>
src/services/actions/accessTokenAvailability.ts:20
• Const
authSessionEnd: ActionCreatorWithoutPayload
<"@@petrus/AUTH_SESSION_END"
>
src/services/actions/authSession.ts:19
• Const
authSessionPause: ActionCreatorWithoutPayload
<"@@petrus/AUTH_SESSION_PAUSE"
>
src/services/actions/authSession.ts:24
• Const
authSessionResume: ActionCreatorWithoutPayload
<"@@petrus/AUTH_SESSION_RESUME"
>
src/services/actions/authSession.ts:29
• Const
authSessionStart: ActionCreatorWithoutPayload
<"@@petrus/AUTH_SESSION_START"
>
src/services/actions/authSession.ts:14
• Const
checkAccessTokenExpiration: ActionCreatorWithoutPayload
<"@@petrus/CHECK_ACCESS_TOKEN_EXPIRATION"
>
src/modules/tokens/modules/refreshment/actions/general.ts:11
• Const
login: Object
Name | Type |
---|---|
cancel |
ActionCreatorWithoutPayload <"@@petrus/LOGIN_CANCEL" > |
failure |
ActionCreatorWithPayload <Error , "@@petrus/LOGIN_FAILURE" > |
request |
ActionCreatorWithPayload <any , "@@petrus/LOGIN_REQUEST" > |
reset |
ActionCreatorWithoutPayload <"@@petrus/LOGIN_RESET" > |
success |
ActionCreatorWithoutPayload <"@@petrus/LOGIN_SUCCESS" > |
types |
{ CANCEL : "@@petrus/LOGIN_CANCEL" ; FAILURE : "@@petrus/LOGIN_FAILURE" ; REQUEST : "@@petrus/LOGIN_REQUEST" ; RESET : "@@petrus/LOGIN_RESET" ; SUCCESS : "@@petrus/LOGIN_SUCCESS" } |
types.CANCEL |
"@@petrus/LOGIN_CANCEL" |
types.FAILURE |
"@@petrus/LOGIN_FAILURE" |
types.REQUEST |
"@@petrus/LOGIN_REQUEST" |
types.RESET |
"@@petrus/LOGIN_RESET" |
types.SUCCESS |
"@@petrus/LOGIN_SUCCESS" |
src/modules/auth-session/actions/login.ts:16
• Const
logout: Object
Name | Type |
---|---|
cancel |
ActionCreatorWithoutPayload <"@@petrus/LOGOUT_CANCEL" > |
failure |
ActionCreatorWithPayload <Error , "@@petrus/LOGOUT_FAILURE" > |
request |
ActionCreatorWithoutPayload <"@@petrus/LOGOUT_REQUEST" > |
reset |
ActionCreatorWithoutPayload <"@@petrus/LOGOUT_RESET" > |
success |
ActionCreatorWithoutPayload <"@@petrus/LOGOUT_SUCCESS" > |
types |
{ CANCEL : "@@petrus/LOGOUT_CANCEL" ; FAILURE : "@@petrus/LOGOUT_FAILURE" ; REQUEST : "@@petrus/LOGOUT_REQUEST" ; RESET : "@@petrus/LOGOUT_RESET" ; SUCCESS : "@@petrus/LOGOUT_SUCCESS" } |
types.CANCEL |
"@@petrus/LOGOUT_CANCEL" |
types.FAILURE |
"@@petrus/LOGOUT_FAILURE" |
types.REQUEST |
"@@petrus/LOGOUT_REQUEST" |
types.RESET |
"@@petrus/LOGOUT_RESET" |
types.SUCCESS |
"@@petrus/LOGOUT_SUCCESS" |
src/modules/auth-session/actions/logout.ts:15
• Const
retrieveTokensRequest: ActionCreatorWithoutPayload
<"@@petrus/RETRIEVE_TOKENS_REQUEST"
>
src/modules/tokens/modules/retrieval/actions/index.ts:12
• Const
retrieveTokensResolve: ActionCreatorWithPayload
<boolean
, "@@petrus/RETRIEVE_TOKENS_RESOLVE"
>
src/modules/tokens/modules/retrieval/actions/index.ts:19
• Const
setTokensPersistence: ActionCreatorWithPayload
<TokensPersistence
, "@@petrus/SET_TOKENS_PERSISTENCE"
>
src/modules/tokens/modules/storage/actions/index.ts:12
• Const
setUserWithTokens: ActionCreatorWithPreparedPayload
<[user: any, tokens: PetrusTokens], { tokens
: PetrusTokens
; user
: any
}, "@@petrus/SET_USER_WITH_TOKENS"
, never
, never
>
src/modules/auth-session/actions/setUserWithTokens.ts:8
• Const
terminate: ActionCreatorWithoutPayload
<"@@petrus/TERMINATE"
>
src/services/actions/control.ts:11
• Const
accessTokenSelector: (state
: never
, ...params
: []) => null
| { expiration?
: null
| string
; token
: string
} & Record
<string
, any
> & OutputSelectorFields
<(...args
: [null
| PetrusTokens
]) => { expiration?
: null
| string
; token
: string
} & Record
<string
, any
> & { clearCache
: () => void
}> & { clearCache
: () => void
}
src/services/selectors/tokens.ts:17
• Const
tokensPersistenceSelector: (state
: {}, ...params
: []) => TokensPersistence
& OutputSelectorFields
<(...args
: [PetrusEntitiesState
<unknown
>]) => NONE
& { clearCache
: () => void
} & LOCAL
& { clearCache
: () => void
} & SESSION
& { clearCache
: () => void
}> & { clearCache
: () => void
}
src/services/selectors/tokens.ts:12
• Const
tokensSelector: (state
: {}, ...params
: []) => null
| PetrusTokens
& OutputSelectorFields
<(...args
: [PetrusEntitiesState
<unknown
>]) => PetrusTokens
& { clearCache
: () => void
}> & { clearCache
: () => void
}
src/services/selectors/tokens.ts:7
▸ authorizable(AuthorizableComponent
, Firewall
, Loader?
): (props
: any
) => Element
Use Authenticated
component instead.
deprecated
Name | Type | Default value |
---|---|---|
AuthorizableComponent |
any |
undefined |
Firewall |
any |
undefined |
Loader |
() => Element
|
MockAppLoader |
fn
▸ (props
): Element
Name | Type |
---|---|
props |
any |
Element
Name | Type |
---|---|
displayName |
string |
▸ configure<User
, Credentials
, AppState
>(customConfig
): Object
Name | Type |
---|---|
User |
extends unknown = any
|
Credentials |
extends unknown = any
|
AppState |
extends Record <string , any > = Record <string , any > |
Name | Type |
---|---|
customConfig |
PetrusCustomConfig <User , Credentials , PetrusConfig <User , Credentials , PetrusLogger >> |
Object
Name | Type |
---|---|
reducer |
Reducer <CombinedState <Object >, AnyAction > |
saga |
() => Generator <TakeEffect | CancelEffect | ForkEffect <Generator <AllEffect <Generator <AllEffect <Generator <any , void , any >>, void , unknown > | Generator <AllEffect <false | Generator <AllEffect <Generator <TakeEffect | CancelEffect | ForkEffect <void >, void , Task >>, void , unknown > | Generator <PutEffect <{ payload : undefined ; type : "@@petrus/RETRIEVE_TOKENS_REQUEST" }> | Generator <null | void | Record <string , any >, boolean , never > | PutEffect <{ payload : boolean ; type : "@@petrus/RETRIEVE_TOKENS_RESOLVE" }>, void , boolean >>, void , unknown >>, void , unknown >>, void , Task > |
▸ Authenticated(__namedParameters
): null
| Element
Name | Type |
---|---|
__namedParameters |
AuthenticatedProps |
null
| Element
src/components/Authenticated/Authenticated.tsx:16
▸ useAuthenticated(): FlowType
src/hooks/useAuthenticated.ts:8
▸ getAccessToken(): Generator
<TakeEffect
| SelectEffect
| PutEffect
<{ payload
: RefreshTokensRequestPayload
; type
: "@@petrus/REFRESH_TOKENS_REQUEST"
}> | RaceEffect
<ActionCreatorWithoutPayload
<"@@petrus/REFRESH_TOKENS_SUCCESS"
> | ActionCreatorWithPayload
<Error
, "@@petrus/REFRESH_TOKENS_FAILURE"
>>, null
| { expiration?
: null
| string
; token
: string
} & Record
<string
, any
>, PetrusEntitiesState
<any
> & ApiState
& { expiration?
: null
| string
; token
: string
} & Record
<string
, any
> & Partial
<{ failure
: ActionCreatorWithPayload
<Error
, "@@petrus/REFRESH_TOKENS_FAILURE"
> = refreshTokens.failure; success
: ActionCreatorWithoutPayload
<"@@petrus/REFRESH_TOKENS_SUCCESS"
> = refreshTokens.success }> & { payload
: { expiration?
: null
| string
; token
: string
} & Record
<string
, any
> ; type
: "@@petrus/ACCESS_TOKEN_AVAILABLE"
}>
Generator
<TakeEffect
| SelectEffect
| PutEffect
<{ payload
: RefreshTokensRequestPayload
; type
: "@@petrus/REFRESH_TOKENS_REQUEST"
}> | RaceEffect
<ActionCreatorWithoutPayload
<"@@petrus/REFRESH_TOKENS_SUCCESS"
> | ActionCreatorWithPayload
<Error
, "@@petrus/REFRESH_TOKENS_FAILURE"
>>, null
| { expiration?
: null
| string
; token
: string
} & Record
<string
, any
>, PetrusEntitiesState
<any
> & ApiState
& { expiration?
: null
| string
; token
: string
} & Record
<string
, any
> & Partial
<{ failure
: ActionCreatorWithPayload
<Error
, "@@petrus/REFRESH_TOKENS_FAILURE"
> = refreshTokens.failure; success
: ActionCreatorWithoutPayload
<"@@petrus/REFRESH_TOKENS_SUCCESS"
> = refreshTokens.success }> & { payload
: { expiration?
: null
| string
; token
: string
} & Record
<string
, any
> ; type
: "@@petrus/ACCESS_TOKEN_AVAILABLE"
}>
src/services/sagas/getAccessToken.ts:50
▸ retrieveTokens(): Generator
<PutEffect
<{ payload
: undefined
; type
: "@@petrus/RETRIEVE_TOKENS_REQUEST"
}> | Generator
<null
| void
| Record
<string
, any
>, boolean
, never
> | PutEffect
<{ payload
: boolean
; type
: "@@petrus/RETRIEVE_TOKENS_RESOLVE"
}>, void
, boolean
>
Generator
<PutEffect
<{ payload
: undefined
; type
: "@@petrus/RETRIEVE_TOKENS_REQUEST"
}> | Generator
<null
| void
| Record
<string
, any
>, boolean
, never
> | PutEffect
<{ payload
: boolean
; type
: "@@petrus/RETRIEVE_TOKENS_RESOLVE"
}>, void
, boolean
>
src/modules/tokens/modules/retrieval/sagas/retrieveTokens.ts:80
▸ withAuthSession<Fn
>(task
): Generator
<TakeEffect
| CancelEffect
| ForkEffect
<void
>, void
, Task
>
Name | Type |
---|---|
Fn |
extends DefaultFn
|
Name | Type |
---|---|
task |
Fn |
Generator
<TakeEffect
| CancelEffect
| ForkEffect
<void
>, void
, Task
>
src/services/sagas/withAuthSession.ts:21
▸ apiSelector<AppState
>(state
, apiKey
): ApiState
Name |
---|
AppState |
Name | Type |
---|---|
state |
AppState |
apiKey |
ApiKeys |
ApiState
src/services/selectors/api.ts:7
▸ entitiesSelector<AppState
, User
>(state
): PetrusEntitiesState
<User
>
Name | Type |
---|---|
AppState |
AppState |
User |
extends unknown = any
|
Name | Type |
---|---|
state |
AppState |
PetrusEntitiesState
<User
>
src/services/selectors/entities.ts:7
▸ createExpirationDate(expiresIn
): null
| string
creates an access token expiration date from expiration timeout value
Name | Type | Description |
---|---|---|
expiresIn |
undefined | null | string | number
|
value in ms when access token expires |
null
| string
Access token expiration date in ISO string format.