@querypanel/node-sdk 1.0.23 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/package.json +21 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ A lightweight Node.js client for QueryPanel's NL-to-SQL APIs. The SDK manages JW
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @querypanel/node-sdk
|
|
8
|
+
npm install @querypanel/node-sdk
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
- Requires **Node 18+**.
|
|
@@ -20,6 +20,7 @@ import { createClient } from "@clickhouse/client";
|
|
|
20
20
|
const qp = new QueryPanelSdkAPI(
|
|
21
21
|
process.env.QUERYPANEL_URL!,
|
|
22
22
|
process.env.QUERYPANEL_SERVICE_TOKEN!,
|
|
23
|
+
process.env.PRIVATE_KEY!
|
|
23
24
|
);
|
|
24
25
|
|
|
25
26
|
// Attach a ClickHouse database (use the SDK-supplied adapter)
|
|
@@ -49,13 +50,12 @@ console.table(response.rows);
|
|
|
49
50
|
|
|
50
51
|
## Authentication modes
|
|
51
52
|
|
|
52
|
-
The constructor accepts
|
|
53
|
+
The constructor accepts a private key/organization pair for on-the-fly token generation:
|
|
53
54
|
|
|
54
55
|
```ts
|
|
55
|
-
// Mode 1: pass a pre-signed JWT for legacy integrations
|
|
56
|
-
const qpLegacy = new QueryPanelSdkAPI(baseUrl, signedJwt);
|
|
57
56
|
|
|
58
|
-
//
|
|
57
|
+
// provide an RSA private key and organization ID (recommended)
|
|
58
|
+
// and save the public key on the querypanel ui
|
|
59
59
|
const qp = new QueryPanelSdkAPI(baseUrl, privateKeyPem, organizationId);
|
|
60
60
|
```
|
|
61
61
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@querypanel/node-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.24",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/esm/index.d.ts",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/querypanel/node-sdk.git"
|
|
11
|
+
},
|
|
12
|
+
"author": "QueryPanel",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"homepage": "https://querypanel.io",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/querypanel/node-sdk/issues"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"querypanel",
|
|
20
|
+
"sdk",
|
|
21
|
+
"node",
|
|
22
|
+
"javascript",
|
|
23
|
+
"typescript",
|
|
24
|
+
"text-to-dashboard",
|
|
25
|
+
"natural-language-to-sql",
|
|
26
|
+
"text-to-sql"
|
|
27
|
+
],
|
|
8
28
|
"exports": {
|
|
9
29
|
".": {
|
|
10
30
|
"types": "./dist/esm/index.d.ts",
|