> ## Documentation Index
> Fetch the complete documentation index at: https://alibi.itsdote.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# @alibi/sdk-node/offline-queue

> Offline queue — generated from packages/sdk-node/src/offline-queue.ts.

Offline control-plane queue — buffer uploads when CP is unreachable.

*Source:* [`packages/sdk-node/src/offline-queue.ts`](https://github.com/valid22/alibi-ai/blob/main/packages/sdk-node/src/offline-queue.ts)

## `QueuedRequest`

| Property | Type |
| - | - |
| `id` | `string` |
| `method` | `string` |
| `path` | `string` |
| `jsonBody?` | `unknown` |
| `enqueuedAt` | `number` |
| `attempts` | `number` |
| `lastError?` | `string` |

## `FlushResult`

| Property | Type |
| - | - |
| `flushed` | `number` |
| `remaining` | `number` |
| `errors` | `string[]` |

## `OfflineQueue`

### `path`

```ts theme={null}
path: string | null
```

### `maxSize`

```ts theme={null}
maxSize: number
```

### `constructor`

```ts theme={null}
constructor(opts?: { path?: string | null; maxSize?: number })
```

**Parameters**

| Name | Type |
| - | - |
| `opts` | `\{ path?: string \| null; maxSize?: number \}` |

### `snapshot`

```ts theme={null}
snapshot(): QueuedRequest[]
```

### `clear`

```ts theme={null}
clear(): void
```

### `enqueue`

```ts theme={null}
enqueue(
    method: string,
    reqPath: string,
    jsonBody?: unknown,
  ): QueuedRequest
```

**Parameters**

| Name | Type |
| - | - |
| `method` | `string` |
| `reqPath` | `string` |
| `jsonBody` | `unknown` |

### `flush`

```ts theme={null}
async flush(
    send: (method: string, reqPath: string, jsonBody?: unknown) => Promise<unknown>,
    opts?: { maxItems?: number },
  ): Promise<FlushResult>
```

**Parameters**

| Name | Type |
| - | - |
| `send` | `(method: string, reqPath: string, jsonBody?: unknown) => Promise<unknown>, opts?: \{ maxItems?: number \},` |

## `offlineQueueEnabled`

```ts theme={null}
export function offlineQueueEnabled(): boolean
```

## `getOfflineQueue`

```ts theme={null}
export function getOfflineQueue(): OfflineQueue
```

## `resetOfflineQueueForTests`

```ts theme={null}
export function resetOfflineQueueForTests(): void
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.