@dashai/sdk 0.8.0 → 0.9.0
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/dist/deps/index.d.cts +2 -2
- package/dist/deps/index.d.ts +2 -2
- package/dist/index.cjs +48 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +48 -3
- package/dist/index.js.map +1 -1
- package/dist/query/index.d.cts +1 -1
- package/dist/query/index.d.ts +1 -1
- package/dist/react/index.d.cts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/{types-BLNQ1S1C.d.cts → types-DXsbCVkb.d.cts} +47 -1
- package/dist/{types-BLNQ1S1C.d.ts → types-DXsbCVkb.d.ts} +47 -1
- package/package.json +2 -3
|
@@ -199,6 +199,16 @@ interface ClientConfig {
|
|
|
199
199
|
* Resolved tokens are attached as `Authorization: Bearer <token>`.
|
|
200
200
|
*/
|
|
201
201
|
getToken?: TokenResolver;
|
|
202
|
+
/**
|
|
203
|
+
* Custom Modules Platform v1 — a static `dwk_` API key used as the
|
|
204
|
+
* Bearer credential. Convenience over `getToken: () => apiKey` for the
|
|
205
|
+
* common "deployed module with one long-lived key" case (set it from
|
|
206
|
+
* `process.env.DASHWISE_API_KEY`). Precedence: a non-null `getToken()`
|
|
207
|
+
* result wins; otherwise `apiKey` is used. NEVER expose this to the
|
|
208
|
+
* browser — keep it server-only (route client data through server
|
|
209
|
+
* actions / route handlers).
|
|
210
|
+
*/
|
|
211
|
+
apiKey?: string;
|
|
202
212
|
/**
|
|
203
213
|
* Installation ID this client is scoped to. Required for module
|
|
204
214
|
* runtime calls. Typical values:
|
|
@@ -391,6 +401,42 @@ interface Client {
|
|
|
391
401
|
timeoutMs?: number;
|
|
392
402
|
idempotencyKey?: string;
|
|
393
403
|
}): Promise<TOutput>;
|
|
404
|
+
/**
|
|
405
|
+
* Custom Modules Platform v1 (P1b) — access to the workspace's shared
|
|
406
|
+
* Data Hub tables (the ones no-code users build), scoped by the key's
|
|
407
|
+
* datahub grants. Requires the client to be authenticated with a
|
|
408
|
+
* scoped `dwk_` API key that holds matching grants. Hits the
|
|
409
|
+
* runtime Data Hub bridge:
|
|
410
|
+
* GET/POST/PATCH/DELETE :installationId/datahub/tables/:tableId/rows…
|
|
411
|
+
*
|
|
412
|
+
* Untyped in v1 (rows are `Record<string, unknown>` — they follow the
|
|
413
|
+
* Data Hub table's own field schema, not the module manifest).
|
|
414
|
+
*/
|
|
415
|
+
datahub: DatahubClient;
|
|
416
|
+
}
|
|
417
|
+
/** Custom Modules Platform v1 (P1b) — Data Hub access surface. */
|
|
418
|
+
interface DatahubClient {
|
|
419
|
+
/** Bind a Data Hub table by its numeric id. */
|
|
420
|
+
table(tableId: number): DatahubTableClient;
|
|
421
|
+
}
|
|
422
|
+
/** Result envelope of a Data Hub list (mirrors the backend RowQueryService). */
|
|
423
|
+
interface DatahubListResult {
|
|
424
|
+
results: Array<Record<string, unknown>>;
|
|
425
|
+
count: number;
|
|
426
|
+
}
|
|
427
|
+
/** Row CRUD against a single Data Hub table, gated by the key's grants. */
|
|
428
|
+
interface DatahubTableClient {
|
|
429
|
+
/**
|
|
430
|
+
* List rows. `query` is the Baserow flat shape (e.g.
|
|
431
|
+
* `{ size: '50', order_by: '-created_on' }`); values are strings.
|
|
432
|
+
*/
|
|
433
|
+
list(query?: Record<string, string>): Promise<DatahubListResult>;
|
|
434
|
+
get(rowId: number): Promise<Record<string, unknown>>;
|
|
435
|
+
create(body: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
436
|
+
update(rowId: number, body: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
437
|
+
delete(rowId: number): Promise<{
|
|
438
|
+
success: true;
|
|
439
|
+
}>;
|
|
394
440
|
}
|
|
395
441
|
|
|
396
|
-
export type { BaseInsert as B, ClientConfig as C, Deps as D, FetchImpl as F, ListOpts as L, Page as P, ReadOnlyTableClient as R, SlowQueryInfo as S, TokenResolver as T, Where as W, Client as a, BaseRow as b, BaseUpdate as c,
|
|
442
|
+
export type { BaseInsert as B, ClientConfig as C, Deps as D, FetchImpl as F, ListOpts as L, Page as P, ReadOnlyTableClient as R, SlowQueryInfo as S, TokenResolver as T, Where as W, Client as a, BaseRow as b, BaseUpdate as c, DatahubClient as d, DatahubListResult as e, DatahubTableClient as f, FileRef as g, FilterOps as h, FilterValue as i, SortClause as j, SortDir as k, TableClient as l };
|
|
@@ -199,6 +199,16 @@ interface ClientConfig {
|
|
|
199
199
|
* Resolved tokens are attached as `Authorization: Bearer <token>`.
|
|
200
200
|
*/
|
|
201
201
|
getToken?: TokenResolver;
|
|
202
|
+
/**
|
|
203
|
+
* Custom Modules Platform v1 — a static `dwk_` API key used as the
|
|
204
|
+
* Bearer credential. Convenience over `getToken: () => apiKey` for the
|
|
205
|
+
* common "deployed module with one long-lived key" case (set it from
|
|
206
|
+
* `process.env.DASHWISE_API_KEY`). Precedence: a non-null `getToken()`
|
|
207
|
+
* result wins; otherwise `apiKey` is used. NEVER expose this to the
|
|
208
|
+
* browser — keep it server-only (route client data through server
|
|
209
|
+
* actions / route handlers).
|
|
210
|
+
*/
|
|
211
|
+
apiKey?: string;
|
|
202
212
|
/**
|
|
203
213
|
* Installation ID this client is scoped to. Required for module
|
|
204
214
|
* runtime calls. Typical values:
|
|
@@ -391,6 +401,42 @@ interface Client {
|
|
|
391
401
|
timeoutMs?: number;
|
|
392
402
|
idempotencyKey?: string;
|
|
393
403
|
}): Promise<TOutput>;
|
|
404
|
+
/**
|
|
405
|
+
* Custom Modules Platform v1 (P1b) — access to the workspace's shared
|
|
406
|
+
* Data Hub tables (the ones no-code users build), scoped by the key's
|
|
407
|
+
* datahub grants. Requires the client to be authenticated with a
|
|
408
|
+
* scoped `dwk_` API key that holds matching grants. Hits the
|
|
409
|
+
* runtime Data Hub bridge:
|
|
410
|
+
* GET/POST/PATCH/DELETE :installationId/datahub/tables/:tableId/rows…
|
|
411
|
+
*
|
|
412
|
+
* Untyped in v1 (rows are `Record<string, unknown>` — they follow the
|
|
413
|
+
* Data Hub table's own field schema, not the module manifest).
|
|
414
|
+
*/
|
|
415
|
+
datahub: DatahubClient;
|
|
416
|
+
}
|
|
417
|
+
/** Custom Modules Platform v1 (P1b) — Data Hub access surface. */
|
|
418
|
+
interface DatahubClient {
|
|
419
|
+
/** Bind a Data Hub table by its numeric id. */
|
|
420
|
+
table(tableId: number): DatahubTableClient;
|
|
421
|
+
}
|
|
422
|
+
/** Result envelope of a Data Hub list (mirrors the backend RowQueryService). */
|
|
423
|
+
interface DatahubListResult {
|
|
424
|
+
results: Array<Record<string, unknown>>;
|
|
425
|
+
count: number;
|
|
426
|
+
}
|
|
427
|
+
/** Row CRUD against a single Data Hub table, gated by the key's grants. */
|
|
428
|
+
interface DatahubTableClient {
|
|
429
|
+
/**
|
|
430
|
+
* List rows. `query` is the Baserow flat shape (e.g.
|
|
431
|
+
* `{ size: '50', order_by: '-created_on' }`); values are strings.
|
|
432
|
+
*/
|
|
433
|
+
list(query?: Record<string, string>): Promise<DatahubListResult>;
|
|
434
|
+
get(rowId: number): Promise<Record<string, unknown>>;
|
|
435
|
+
create(body: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
436
|
+
update(rowId: number, body: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
437
|
+
delete(rowId: number): Promise<{
|
|
438
|
+
success: true;
|
|
439
|
+
}>;
|
|
394
440
|
}
|
|
395
441
|
|
|
396
|
-
export type { BaseInsert as B, ClientConfig as C, Deps as D, FetchImpl as F, ListOpts as L, Page as P, ReadOnlyTableClient as R, SlowQueryInfo as S, TokenResolver as T, Where as W, Client as a, BaseRow as b, BaseUpdate as c,
|
|
442
|
+
export type { BaseInsert as B, ClientConfig as C, Deps as D, FetchImpl as F, ListOpts as L, Page as P, ReadOnlyTableClient as R, SlowQueryInfo as S, TokenResolver as T, Where as W, Client as a, BaseRow as b, BaseUpdate as c, DatahubClient as d, DatahubListResult as e, DatahubTableClient as f, FileRef as g, FilterOps as h, FilterValue as i, SortClause as j, SortDir as k, TableClient as l };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashai/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Runtime client for DashWise: typed data access + auth helpers for modules.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -81,8 +81,7 @@
|
|
|
81
81
|
"vitest": "^2.1.8"
|
|
82
82
|
},
|
|
83
83
|
"publishConfig": {
|
|
84
|
-
"access": "public"
|
|
85
|
-
"provenance": true
|
|
84
|
+
"access": "public"
|
|
86
85
|
},
|
|
87
86
|
"repository": {
|
|
88
87
|
"type": "git",
|