Skip to content

Exports

Jiří Čermák edited this page Jun 2, 2022 · 16 revisions

@ackee/petrus - v5.3.6

Table of contents

Enumerations

Interfaces

Type Aliases

Variables

Functions

Type Aliases

PetrusCredentials

Ƭ PetrusCredentials: any

Defined in

src/types/index.ts:16


PetrusLogger

Ƭ PetrusLogger: Object

Type declaration

Name Type
error Console["error"]

Defined in

src/types/index.ts:10


PetrusOAuth

Ƭ PetrusOAuth: Object

Type declaration

Name Type
searchParams Record<string, any>

Defined in

src/types/index.ts:32


PetrusTokens

Ƭ PetrusTokens: Object

Type declaration

Name Type
accessToken { expiration?: string | null ; token: string } & Record<string, any>
refreshToken? { token: string } & Record<string, any>

Defined in

src/types/index.ts:18


PetrusUser

Ƭ PetrusUser: any

Defined in

src/types/index.ts:14


StorageDriver

Ƭ StorageDriver: Object

Type declaration

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>

Defined in

src/config/types.ts:3

Variables

ACTION_PREFIX

Const ACTION_PREFIX: "@@petrus/"

Defined in

src/constants/index.ts:21


accessTokenAvailable

Const accessTokenAvailable: ActionCreatorWithPayload<{ expiration?: null | string ; token: string } & Record<string, any>, "@@petrus/ACCESS_TOKEN_AVAILABLE">

Defined in

src/services/actions/accessTokenAvailability.ts:10


accessTokenSelector

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 }

Defined in

src/services/selectors/tokens.ts:8


accessTokenUnavailable

Const accessTokenUnavailable: ActionCreatorWithoutPayload<"@@petrus/ACCESS_TOKEN_UNAVAILABLE">

Defined in

src/services/actions/accessTokenAvailability.ts:14


applyAccessTokenRequest

Const applyAccessTokenRequest: ActionCreatorWithPayload<{ expiration?: null | string ; token: string } & Record<string, any>, "@@petrus/APPLY_ACCESS_TOKEN_REQUEST">

Defined in

src/modules/tokens/modules/external/actions/applyAccessToken.ts:12


applyAccessTokenResolve

Const applyAccessTokenResolve: ActionCreatorWithoutPayload<"@@petrus/APPLY_ACCESS_TOKEN_RESOLVE">

Defined in

src/modules/tokens/modules/external/actions/applyAccessToken.ts:17


authSessionEnd

Const authSessionEnd: ActionCreatorWithoutPayload<"@@petrus/AUTH_SESSION_END">

Defined in

src/services/actions/authSession.ts:13


authSessionPause

Const authSessionPause: ActionCreatorWithoutPayload<"@@petrus/AUTH_SESSION_PAUSE">

Defined in

src/services/actions/authSession.ts:15


authSessionResume

Const authSessionResume: ActionCreatorWithoutPayload<"@@petrus/AUTH_SESSION_RESUME">

Defined in

src/services/actions/authSession.ts:17


authSessionStart

Const authSessionStart: ActionCreatorWithoutPayload<"@@petrus/AUTH_SESSION_START">

Defined in

src/services/actions/authSession.ts:11


checkAccessTokenExpiration

Const checkAccessTokenExpiration: ActionCreatorWithoutPayload<"@@petrus/CHECK_ACCESS_TOKEN_EXPIRATION">

Defined in

src/modules/tokens/modules/refreshment/actions/general.ts:8


login

Const login: Object

Type declaration

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"

Defined in

src/modules/auth-session/actions/login.ts:13


logout

Const logout: Object

Type declaration

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"

Defined in

src/modules/auth-session/actions/logout.ts:12


retrieveTokensRequest

Const retrieveTokensRequest: ActionCreatorWithoutPayload<"@@petrus/RETRIEVE_TOKENS_REQUEST">

Defined in

src/modules/tokens/modules/retrieval/actions/index.ts:9


retrieveTokensResolve

Const retrieveTokensResolve: ActionCreatorWithPayload<boolean, "@@petrus/RETRIEVE_TOKENS_RESOLVE">

Defined in

src/modules/tokens/modules/retrieval/actions/index.ts:13


setTokensPersistence

Const setTokensPersistence: ActionCreatorWithPayload<TokensPersistence, "@@petrus/SET_TOKENS_PERSISTENCE">

Defined in

src/modules/tokens/modules/storage/actions/index.ts:9


setUserWithTokens

Const setUserWithTokens: ActionCreatorWithPreparedPayload<[user: any, tokens: PetrusTokens], { tokens: PetrusTokens ; user: any }, "@@petrus/SET_USER_WITH_TOKENS", never, never>

Defined in

src/modules/auth-session/actions/setUserWithTokens.ts:5


storageDrivers

Const storageDrivers: Object

Type declaration

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]

Defined in

src/config/index.ts:5


terminate

Const terminate: ActionCreatorWithoutPayload<"@@petrus/TERMINATE">

Defined in

src/services/actions/control.ts:8


tokensPersistenceSelector

Const tokensPersistenceSelector: (state: {}, ...params: []) => TokensPersistence & OutputSelectorFields<(...args: [PetrusEntitiesState<unknown>]) => NONE & { clearCache: () => void } & LOCAL & { clearCache: () => void } & SESSION & { clearCache: () => void }> & { clearCache: () => void }

Defined in

src/services/selectors/tokens.ts:6


tokensSelector

Const tokensSelector: (state: {}, ...params: []) => null | PetrusTokens & OutputSelectorFields<(...args: [PetrusEntitiesState<unknown>]) => PetrusTokens & { clearCache: () => void }> & { clearCache: () => void }

Defined in

src/services/selectors/tokens.ts:4


unapplyAccessTokenRequest

Const unapplyAccessTokenRequest: ActionCreatorWithoutPayload<"@@petrus/UNAPPLY_ACCESS_TOKEN_REQUEST">

Defined in

src/modules/tokens/modules/external/actions/applyAccessToken.ts:21


unapplyAccessTokenResolve

Const unapplyAccessTokenResolve: ActionCreatorWithoutPayload<"@@petrus/UNAPPLY_ACCESS_TOKEN_RESOLVE">

Defined in

src/modules/tokens/modules/external/actions/applyAccessToken.ts:25

Functions

Authenticated

Authenticated(__namedParameters): null | Element

Parameters

Name Type
__namedParameters AuthenticatedProps

Returns

null | Element

Defined in

src/components/Authenticated/Authenticated.tsx:13


apiSelector

apiSelector<AppState>(state, apiKey): ApiState

Type parameters

Name
AppState

Parameters

Name Type
state AppState
apiKey ApiKeys

Returns

ApiState

Defined in

src/services/selectors/api.ts:4


authorizable

authorizable(AuthorizableComponent, Firewall, Loader?): (props: any) => Element

Use Authenticated component instead.

deprecated

Parameters

Name Type Default value
AuthorizableComponent any undefined
Firewall any undefined
Loader () => Element MockAppLoader

Returns

fn

▸ (props): Element

Parameters
Name Type
props any
Returns

Element

Name Type
displayName string

Defined in

src/HOC/authorizable.jsx:12


configure

configure<User, Credentials, AppState>(customConfig): Object

Type parameters

Name Type
User extends unknown = any
Credentials extends unknown = any
AppState extends Record<string, any> = Record<string, any>

Parameters

Name Type
customConfig PetrusCustomConfig<User, Credentials, PetrusConfig<User, Credentials, PetrusLogger>>

Returns

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>

Defined in

src/configure/index.ts:11


createExpirationDate

createExpirationDate(expiresIn): null | string

creates an access token expiration date from expiration timeout value

Parameters

Name Type Description
expiresIn undefined | null | string | number value in ms when access token expires

Returns

null | string

Access token expiration date in ISO string format.

Defined in

src/modules/oAuth/utils/createExpirationDate.ts:6


entitiesSelector

entitiesSelector<AppState, User>(state): PetrusEntitiesState<User>

Type parameters

Name Type
AppState AppState
User extends unknown = any

Parameters

Name Type
state AppState

Returns

PetrusEntitiesState<User>

Defined in

src/services/selectors/entities.ts:4


getAccessToken

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" }>

Returns

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" }>

Defined in

src/services/sagas/getAccessToken.ts:47


getAuthStateChannel

getAuthStateChannel(): Generator<ActionChannelEffect, ActionChannelEffect, ActionChannelEffect>

Returns

Generator<ActionChannelEffect, ActionChannelEffect, ActionChannelEffect>

Defined in

src/services/sagas/authState/authState.ts:86


retrieveTokens

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>

Returns

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>

Defined in

src/modules/tokens/modules/retrieval/sagas/retrieveTokens.ts:77


useAuthenticated

useAuthenticated(): FlowType

Returns

FlowType

Defined in

src/hooks/useAuthenticated.ts:5


withAuthSession

withAuthSession<Fn>(task): Generator<TakeEffect | CancelEffect | ForkEffect<void>, void, Task>

Type parameters

Name Type
Fn extends DefaultFn

Parameters

Name Type
task Fn

Returns

Generator<TakeEffect | CancelEffect | ForkEffect<void>, void, Task>

Defined in

src/services/sagas/withAuthSession.ts:18

@ackee/petrus - v6.0.0

Clone this wiki locally