### Hierarchy

- Api
  - DrupalApi

## Index

### Constructors

- constructor

### Properties

- baseUrl
- cachePolicy
- corsMode
- credentials
- entities
- hasDebugger
- headers
- idField
- requestCredentials
- routes
- settings

### Methods

- clearCredentials
- delete
- errorHandler
- flushLocalResource
- get
- getCredentials
- init
- initApiRoutes
- loadLocalResource
- login
- logout
- patch
- post
- route
- saveLocalResource
- setCredentials

## Constructors

### constructor

- new Api(): Api

- - Defined in api.ts:39

  #### Returns Api

## Properties

### baseUrl

baseUrl: string = "/api"

- Defined in api.ts:32

### cachePolicy

cachePolicy: string = "no-cache"

- Defined in api.ts:36

### corsMode

corsMode: string = "same-origin"

- Defined in api.ts:35

### credentials

credentials: any

- Defined in api.ts:37

### entities

entities: any

- Defined in api.ts:38

### hasDebugger

hasDebugger: boolean = false

- Defined in api.ts:39

### headers

headers: any

- Defined in api.ts:29

### idField

idField: string = "id"

- Defined in api.ts:33

### requestCredentials

requestCredentials: string = "same-origin"

- Defined in api.ts:34

### routes

routes: object

- Defined in api.ts:31

#### Type declaration

### settings

settings: any

- Defined in api.ts:30

## Methods

### clearCredentials

- clearCredentials(namespace?: string): void

- - Defined in api.ts:191

  #### Parameters

  - ##### Default value namespace: string = "app:authData"

  #### Returns void

### delete

- delete(path: any, id: any): Promise<void>

- - Defined in api.ts:152

  #### Parameters

  - ##### path: any

  - ##### id: any

  #### Returns Promise<void>

### errorHandler

- errorHandler(error: any): void

- - Defined in api.ts:214

  #### Parameters

  - ##### error: any

  #### Returns void

### flushLocalResource

- flushLocalResource(ID: any): void

- - Defined in api.ts:253

  #### Parameters

  - ##### ID: any

  #### Returns void

### get

- get(path: string, params?: any): Promise<any>

- - Defined in api.ts:111

  #### Parameters

  - ##### path: string

  - ##### Default value params: any = undefined

  #### Returns Promise<any>

### getCredentials

- getCredentials(namespace?: string): any

- - Defined in api.ts:184

  #### Parameters

  - ##### Default value namespace: string = "app:authData"

  #### Returns any

### init

- init(settings: any): void

- - Defined in api.ts:43

  #### Parameters

  - ##### settings: any

  #### Returns void

### initApiRoutes

- initApiRoutes(routes: any): void

- - Defined in api.ts:197

  #### Parameters

  - ##### routes: any

  #### Returns void

### loadLocalResource

- loadLocalResource(ID: any): void

- - Defined in api.ts:247

  #### Parameters

  - ##### ID: any

  #### Returns void

### login

- login(username: string, password: string): void

- - Defined in api.ts:162

  #### Parameters

  - ##### username: string

  - ##### password: string

  #### Returns void

### logout

- logout(namespace?: string, refresh?: boolean): void

- - Defined in api.ts:167

  #### Parameters

  - ##### Default value namespace: string = "app:authData"

  - ##### Default value refresh: boolean = false

  #### Returns void

### patch

- patch(path: any, id: any, data: any): Promise<void>

- - Defined in api.ts:141

  #### Parameters

  - ##### path: any

  - ##### id: any

  - ##### data: any

  #### Returns Promise<void>

### post

- post(path: any, data: any): Promise<any>

- - Defined in api.ts:85

  #### Parameters

  - ##### path: any

  - ##### data: any

  #### Returns Promise<any>

### route

- route(url: string): string

- - Defined in api.ts:70

  #### Parameters

  - ##### url: string

  #### Returns string

### saveLocalResource

- saveLocalResource(resource: any): void

- - Defined in api.ts:243

  #### Parameters

  - ##### resource: any

  #### Returns void

### setCredentials

- setCredentials(credentials: any, namespace?: string): void

- - Defined in api.ts:177

  #### Parameters

  - ##### credentials: any

  - ##### Default value namespace: string = "app-auth"

  #### Returns void