Skip to content

Commit

Permalink
Update config and options for eds sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
dlazarenko-macrometa committed Sep 24, 2024
1 parent f53ca18 commit c2b2b39
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
17 changes: 13 additions & 4 deletions docs/photoniq/event-delivery/clients/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,20 @@ let connection = PhotoniqEdsSdk.create(config);

| **Property** | **Type** | **Requred** | **Description** |
|----------------------|-----------|-----------|-----------------------------------|
| `host` | `string` | Yes | Host of the connectionn |
| `host` | `string` | Yes | Host of the connection |
| `customerId` | `string` | Yes | Customer ID credentails |
| `apiKey` | `string` | Yes | ApiKey credentails |
| `fabric` | `string` | No | Fabric to be used. Default is `_system` |
| `connectionTypes` | `string[]` | No | Use type of connection and priority. Default is `["ws"]`. Types: `ws`, `sse` |
| `queryType` | `string` | No | Type of query to use. Types: `"SQL"` |
| `connectionTypes` | `(string `\|` SubConfig)[]` | No | Use type of connection and priority. Default is `["ws"]`. Types: `ws`, `sse` |
| `autoReconnect` | `boolean` | No | Automatically reconnect in case of network issues. Default is `true` |
| `pingSeconds` | `number` | No | Seconds between ping-pong messages to the WebSocket server. Default is `29` |

#### `SubConfig` instance schema:

| **Property** | **Type** | **Requred** | **Description** |
|----------------------|-----------|-----------|-----------------------------------|
| `type` | `string` | Yes | Type of the connection. Value: `ws` or `sse` |
| `customerId` | `string` | No | Customer ID credentails. Default set from `Config` |
| `apiKey` | `string` | No | ApiKey credentails. Default set from `Config` |
| `fabric` | `string` | No | Fabric to be used. Default set from `Config` |
| `pingSeconds` | `number` | No | Seconds between ping-pong messages to the WebSocket server. Default is `29`. Acceptable only for `ws` connection. |
| `flushTimeoutMs` | `number` | No | Seconds between ping-pong messages to the WebSocket server. Default is `20`. Acceptable only for `sse` connection. |
18 changes: 13 additions & 5 deletions docs/photoniq/event-delivery/clients/query-set-and-batch.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ querySet.retrieve("SELECT * FROM <YOUR-COLLECTION> WHERE key=<YOUR-KEY>", (event
|--------------|------------|----------|------------------------|
| `query` | `string` | Yes | SQL query to retrieve/listen |
| `resultListener`| `function` | Yes | [Info](/photoniq/event-delivery/clients/listeners-and-errors#result-listener) |
| `errorListener`| `function` | No | [Info](/photoniq/event-delivery/clients/listeners-and-errors#error-listener) |
| `compress` | `boolean` | No | Compress incoming initial data. |
| `errorListenerOrOptions`| `function `\|` QueryOptions` | No | [Info](/photoniq/event-delivery/clients/listeners-and-errors#error-listener) or set query options |
| `options` | `QueryOptions` | No | Set query options. |

### retrieveAndSubscribe

Expand All @@ -41,8 +41,8 @@ querySet.retrieveAndSubscribe("SELECT * FROM <YOUR-COLLECTION> WHERE key=<YOUR-K
|--------------|------------|----------|-------------------|
| `query` | `string` | Yes | SQL query to retrieve/listen |
| `resultListener`| `function` | Yes | [Info](/photoniq/event-delivery/clients/listeners-and-errors#result-listener) |
| `errorListener`| `function` | No | [Info](/photoniq/event-delivery/clients/listeners-and-errors#error-listener) |
| `compress` | `boolean` | No | Compress incoming initial data. |
| `errorListenerOrOptions`| `function `\|` QueryOptions` | No | [Info](/photoniq/event-delivery/clients/listeners-and-errors#error-listener) or set query options |
| `options` | `QueryOptions` | No | Set query options. |

### subscribe

Expand All @@ -57,7 +57,8 @@ querySet.subscribe("SELECT * FROM <YOUR-COLLECTION> WHERE key=<YOUR-KEY>", (even
|--------------|------------|----------|-------------------|
| `query` | `string` | Yes | SQL query to retrieve/listen |
| `resultListener`| `function` | Yes | [Info](/photoniq/event-delivery/clients/listeners-and-errors#result-listener) |
| `errorListener`| `function` | No | [Info](/photoniq/event-delivery/clients/listeners-and-errors#error-listener) |
| `errorListenerOrOptions`| `function `\|` QueryOptions` | No | [Info](/photoniq/event-delivery/clients/listeners-and-errors#error-listener) or set query options |
| `options` | `QueryOptions` | No | Set query options. |

### unubscribe

Expand Down Expand Up @@ -92,3 +93,10 @@ Removes all subscriptions in the `QuerySet`:
```js
querySet.unsubscribeAll();
```


#### `QueryOptions` instance schema:

| **Property** | **Type** | **Requred** | **Description** |
|--------------|----------|-------------|-----------------|
| `compress` | `bolean` | No | compress response data |
Loading

0 comments on commit c2b2b39

Please sign in to comment.