@truenorth-it/dataverse-client 1.0.5 → 1.0.7
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 +219 -30
- package/package.json +17 -4
- package/sdk/dist/client.d.ts +15 -1
- package/sdk/dist/client.d.ts.map +1 -1
- package/sdk/dist/client.js +46 -9
- package/sdk/dist/client.js.map +1 -1
- package/sdk/dist/codegen.d.ts.map +1 -1
- package/sdk/dist/codegen.js.map +1 -1
- package/sdk/dist/index.d.ts +6 -2
- package/sdk/dist/index.d.ts.map +1 -1
- package/sdk/dist/index.js +4 -0
- package/sdk/dist/index.js.map +1 -1
- package/sdk/dist/quick-date.d.ts +36 -0
- package/sdk/dist/quick-date.d.ts.map +1 -0
- package/sdk/dist/quick-date.js +118 -0
- package/sdk/dist/quick-date.js.map +1 -0
- package/sdk/dist/realtime.d.ts +66 -0
- package/sdk/dist/realtime.d.ts.map +1 -0
- package/sdk/dist/realtime.js +129 -0
- package/sdk/dist/realtime.js.map +1 -0
- package/sdk/dist/types.d.ts +42 -0
- package/sdk/dist/types.d.ts.map +1 -1
- package/sdk/dist/tables.generated.d.ts +0 -1606
- package/sdk/dist/tables.generated.d.ts.map +0 -1
- package/sdk/dist/tables.generated.js +0 -7
- package/sdk/dist/tables.generated.js.map +0 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ const client = createClient({
|
|
|
24
24
|
getToken: () => getAccessTokenSilently(), // your Auth0 token provider
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
const result = await client.me.list("
|
|
27
|
+
const result = await client.me.list("case", {
|
|
28
28
|
select: ["title", "ticketnumber", "statuscode", "createdon"],
|
|
29
29
|
top: 20,
|
|
30
30
|
orderBy: "modifiedon:desc",
|
|
@@ -43,7 +43,7 @@ This client eliminates all of that:
|
|
|
43
43
|
|
|
44
44
|
| You write | Instead of |
|
|
45
45
|
|---|---|
|
|
46
|
-
| `client.me.list("
|
|
46
|
+
| `client.me.list("case")` | OData queries, `$filter`, `$expand`, GUID joins |
|
|
47
47
|
| `getAccessTokenSilently()` | MSAL, client credentials, service principal config |
|
|
48
48
|
| Nothing — it's automatic | Custom row-level security middleware |
|
|
49
49
|
| `npx dataverse-client generate` | Manually typing Dataverse schemas |
|
|
@@ -55,14 +55,14 @@ This client eliminates all of that:
|
|
|
55
55
|
Generated types are a **developer experience** convenience, not a requirement. The SDK works identically with or without them — every method accepts an optional generic, and defaults to `Record<string, unknown>` when none is provided.
|
|
56
56
|
|
|
57
57
|
- **No types**: works out of the box, no setup needed
|
|
58
|
-
- **With types**: add `<
|
|
58
|
+
- **With types**: add `<Case>` (or any generated interface) to calls where you want autocomplete
|
|
59
59
|
- **Mix freely**: type the tables you work with most, leave the rest untyped
|
|
60
60
|
- **Stale types are fine**: if your schema changes and you don't regenerate, your code still runs — you just lose autocomplete for new fields
|
|
61
61
|
|
|
62
62
|
```typescript
|
|
63
63
|
// ✅ All three of these work in the same file
|
|
64
|
-
const cases = await client.me.list<
|
|
65
|
-
const projects = await client.me.list("
|
|
64
|
+
const cases = await client.me.list<Case>("case"); // typed
|
|
65
|
+
const projects = await client.me.list("project"); // untyped — still works
|
|
66
66
|
const contacts = await client.me.lookup<Contact>("contact", { search: "jane" }); // typed
|
|
67
67
|
```
|
|
68
68
|
|
|
@@ -91,15 +91,15 @@ This fetches the schema and choice values from your API (public endpoints, no au
|
|
|
91
91
|
|
|
92
92
|
```typescript
|
|
93
93
|
import { createClient } from "@truenorth-it/dataverse-client";
|
|
94
|
-
import type {
|
|
94
|
+
import type { Case, Contact } from "./dataverse-tables.generated";
|
|
95
95
|
|
|
96
96
|
const client = createClient({
|
|
97
97
|
baseUrl: "https://your-api.vercel.app",
|
|
98
98
|
getToken: () => getAccessTokenSilently(),
|
|
99
99
|
});
|
|
100
100
|
|
|
101
|
-
// Fully typed — result.data is
|
|
102
|
-
const result = await client.me.list<
|
|
101
|
+
// Fully typed — result.data is Case[]
|
|
102
|
+
const result = await client.me.list<Case>("case", {
|
|
103
103
|
select: ["title", "ticketnumber", "statuscode", "createdon"],
|
|
104
104
|
top: 20,
|
|
105
105
|
});
|
|
@@ -116,18 +116,18 @@ The generated file also includes const objects for choice (picklist) fields, so
|
|
|
116
116
|
|
|
117
117
|
```typescript
|
|
118
118
|
import { createClient } from "@truenorth-it/dataverse-client";
|
|
119
|
-
import type {
|
|
120
|
-
import {
|
|
119
|
+
import type { Case } from "./dataverse-tables.generated";
|
|
120
|
+
import { CaseStatuscode, CasePrioritycode } from "./dataverse-tables.generated";
|
|
121
121
|
|
|
122
|
-
const cases = await client.me.list<
|
|
123
|
-
filter: `statuscode eq ${
|
|
122
|
+
const cases = await client.me.list<Case>("case", {
|
|
123
|
+
filter: `statuscode eq ${CaseStatuscode.InProgress}`,
|
|
124
124
|
});
|
|
125
125
|
|
|
126
126
|
for (const c of cases.data) {
|
|
127
|
-
if (c.statuscode ===
|
|
127
|
+
if (c.statuscode === CaseStatuscode.OnHold) {
|
|
128
128
|
console.log("Case is on hold:", c.title);
|
|
129
129
|
}
|
|
130
|
-
if (c.prioritycode ===
|
|
130
|
+
if (c.prioritycode === CasePrioritycode.High) {
|
|
131
131
|
console.log("High priority:", c.title);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
@@ -136,7 +136,7 @@ for (const c of cases.data) {
|
|
|
136
136
|
Each choice const is also a type — use it for function signatures:
|
|
137
137
|
|
|
138
138
|
```typescript
|
|
139
|
-
function handleStatus(status:
|
|
139
|
+
function handleStatus(status: CaseStatuscode) {
|
|
140
140
|
// status is narrowed to 1 | 2 | 3 | 5 etc.
|
|
141
141
|
}
|
|
142
142
|
```
|
|
@@ -215,14 +215,14 @@ The client exposes three scopes, each backed by server-side authorization:
|
|
|
215
215
|
### List records
|
|
216
216
|
|
|
217
217
|
```typescript
|
|
218
|
-
const result = await client.me.list("
|
|
218
|
+
const result = await client.me.list("case", {
|
|
219
219
|
select: ["title", "ticketnumber", "statuscode", "prioritycode", "createdon"],
|
|
220
220
|
top: 50,
|
|
221
221
|
orderBy: "createdon:desc",
|
|
222
222
|
filter: "statuscode eq 1",
|
|
223
223
|
});
|
|
224
224
|
|
|
225
|
-
// result.data — Record<string, unknown>[] (or
|
|
225
|
+
// result.data — Record<string, unknown>[] (or Case[] if you pass a generic)
|
|
226
226
|
// result.page — { top, skip, next }
|
|
227
227
|
|
|
228
228
|
for (const c of result.data) {
|
|
@@ -232,12 +232,36 @@ for (const c of result.data) {
|
|
|
232
232
|
}
|
|
233
233
|
```
|
|
234
234
|
|
|
235
|
-
> **With types:** `client.me.list<
|
|
235
|
+
> **With types:** `client.me.list<Case>("case", ...)` — gives full autocomplete on `result.data`.
|
|
236
|
+
|
|
237
|
+
### List activity records by subtype
|
|
238
|
+
|
|
239
|
+
Activity tables (`caseactivities`, `contactactivities`) support subtype filtering to retrieve specific activity types:
|
|
240
|
+
|
|
241
|
+
```typescript
|
|
242
|
+
// List all phone calls for your cases
|
|
243
|
+
const phoneCalls = await client.me.list("caseactivities", {
|
|
244
|
+
subtype: "phonecall",
|
|
245
|
+
select: ["activityid", "subject", "activitytypecode"],
|
|
246
|
+
top: 20,
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
// List all activity types at once
|
|
250
|
+
const allActivities = await client.me.list("caseactivities", {
|
|
251
|
+
subtype: "all",
|
|
252
|
+
orderBy: "createdon:desc",
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
// Each record includes a _link to its canonical URL
|
|
256
|
+
for (const activity of allActivities.data) {
|
|
257
|
+
console.log(activity._link); // "/api/v2/me/caseactivities/phonecall/a1b2c3d4-..."
|
|
258
|
+
}
|
|
259
|
+
```
|
|
236
260
|
|
|
237
261
|
### Get a single record
|
|
238
262
|
|
|
239
263
|
```typescript
|
|
240
|
-
const result = await client.me.get("
|
|
264
|
+
const result = await client.me.get("case", caseId, {
|
|
241
265
|
select: ["title", "description", "statuscode", "customerid"],
|
|
242
266
|
});
|
|
243
267
|
|
|
@@ -264,7 +288,7 @@ For tables with auto-binding configured (like `incident`), you only need to prov
|
|
|
264
288
|
|
|
265
289
|
```typescript
|
|
266
290
|
// Create a case — contact and account are auto-bound from your identity
|
|
267
|
-
const newCase = await client.me.create("
|
|
291
|
+
const newCase = await client.me.create("case", {
|
|
268
292
|
title: "VPN not connecting",
|
|
269
293
|
description: "Getting timeout errors when connecting to corporate VPN.",
|
|
270
294
|
});
|
|
@@ -281,7 +305,7 @@ these from your authenticated identity and binds them automatically.
|
|
|
281
305
|
Available on all scopes (`me`, `team`, `all`):
|
|
282
306
|
|
|
283
307
|
```typescript
|
|
284
|
-
const result = await client.me.update("
|
|
308
|
+
const result = await client.me.update("case", caseId, {
|
|
285
309
|
description: "Updated with latest findings",
|
|
286
310
|
});
|
|
287
311
|
|
|
@@ -304,7 +328,7 @@ for (const contact of result.data) {
|
|
|
304
328
|
}
|
|
305
329
|
```
|
|
306
330
|
|
|
307
|
-
> **With types:** any operation accepts a generic — `client.me.lookup<Contact>("contact", ...)`, `client.me.get<
|
|
331
|
+
> **With types:** any operation accepts a generic — `client.me.lookup<Contact>("contact", ...)`, `client.me.get<Case>("case", ...)`, etc.
|
|
308
332
|
|
|
309
333
|
### Who am I
|
|
310
334
|
|
|
@@ -322,12 +346,12 @@ Choice fields (picklists) have their values managed in Dataverse. Fetch them for
|
|
|
322
346
|
|
|
323
347
|
```typescript
|
|
324
348
|
// All choice fields for a table
|
|
325
|
-
const allChoices = await client.choices("
|
|
349
|
+
const allChoices = await client.choices("case");
|
|
326
350
|
// allChoices.fields.statuscode → [{ value: 1, label: "In Progress" }, ...]
|
|
327
351
|
// allChoices.fields.prioritycode → [{ value: 1, label: "High" }, ...]
|
|
328
352
|
|
|
329
353
|
// Single field
|
|
330
|
-
const statusChoices = await client.choices("
|
|
354
|
+
const statusChoices = await client.choices("case", "statuscode");
|
|
331
355
|
// statusChoices.choices → [{ value: 1, label: "In Progress" }, ...]
|
|
332
356
|
```
|
|
333
357
|
|
|
@@ -338,9 +362,9 @@ const statusChoices = await client.choices("incident", "statuscode");
|
|
|
338
362
|
const schemas = await client.schema();
|
|
339
363
|
|
|
340
364
|
// Single table
|
|
341
|
-
const
|
|
342
|
-
console.log(
|
|
343
|
-
console.log(
|
|
365
|
+
const caseSchema = await client.schema("case");
|
|
366
|
+
console.log(caseSchema.fields); // field definitions with types + descriptions
|
|
367
|
+
console.log(caseSchema.defaultFields); // fields returned when no `select` is specified
|
|
344
368
|
```
|
|
345
369
|
|
|
346
370
|
## Query options
|
|
@@ -356,6 +380,9 @@ Used by `list()`:
|
|
|
356
380
|
| `filter` | `string \| string[]` | OData-style filter expressions |
|
|
357
381
|
| `filterLogic` | `"and" \| "or"` | How to combine multiple filters (default: `"and"`) |
|
|
358
382
|
| `expand` | `string` | Expand related lookups |
|
|
383
|
+
| `subtype` | `string` | Activity subtype filter (e.g. `"phonecall"`, `"email"`, `"task"`, `"all"`) — only for activity tables |
|
|
384
|
+
| `created` | `string` | Quick filter on creation date — e.g. `"today"`, `"7d"`, `"thismonth"`, `"2026-01-01..2026-02-01"` |
|
|
385
|
+
| `modified` | `string` | Quick filter on last-modified date (same formats as `created`) |
|
|
359
386
|
|
|
360
387
|
`lookup()` accepts the same options plus:
|
|
361
388
|
|
|
@@ -365,13 +392,54 @@ Used by `list()`:
|
|
|
365
392
|
|
|
366
393
|
`get()` accepts only `select` and `expand`.
|
|
367
394
|
|
|
395
|
+
### Quick date filter values
|
|
396
|
+
|
|
397
|
+
| Format | Examples | Description |
|
|
398
|
+
|--------|----------|-------------|
|
|
399
|
+
| Named period | `today`, `yesterday`, `thisweek`, `lastweek`, `thismonth`, `lastmonth`, `thisyear` | Human-friendly period presets |
|
|
400
|
+
| Relative | `1h`, `24h`, `7d`, `30d`, `90d` | Sliding window from now |
|
|
401
|
+
| Date range | `2026-01-01..2026-02-01`, `2026-01-01..`, `..2026-02-01` | Explicit date range (inclusive start, exclusive end) |
|
|
402
|
+
|
|
403
|
+
```typescript
|
|
404
|
+
// Cases created in the last 7 days
|
|
405
|
+
const recent = await client.me.list<Case>("case", { created: "7d" });
|
|
406
|
+
|
|
407
|
+
// Cases modified today
|
|
408
|
+
const updated = await client.me.list<Case>("case", { modified: "today" });
|
|
409
|
+
|
|
410
|
+
// Combine with regular filters
|
|
411
|
+
const urgentRecent = await client.me.list<Case>("case", {
|
|
412
|
+
created: "thismonth",
|
|
413
|
+
filter: "prioritycode eq 1",
|
|
414
|
+
});
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
The SDK resolves these client-side — dates are converted into standard `filter` conditions before the request is sent. This means quick dates work with **any server version**, even older deployments that don't support the `created`/`modified` parameters natively.
|
|
418
|
+
|
|
419
|
+
### Standalone utility
|
|
420
|
+
|
|
421
|
+
The resolution logic is also exported for direct use:
|
|
422
|
+
|
|
423
|
+
```typescript
|
|
424
|
+
import { resolveQuickDate, quickDateToFilters } from "@truenorth-it/dataverse-client";
|
|
425
|
+
|
|
426
|
+
resolveQuickDate("7d");
|
|
427
|
+
// → { ge: "2026-02-08T12:00:00.000Z" }
|
|
428
|
+
|
|
429
|
+
resolveQuickDate("today");
|
|
430
|
+
// → { ge: "2026-02-15T00:00:00.000Z", lt: "2026-02-16T00:00:00.000Z" }
|
|
431
|
+
|
|
432
|
+
quickDateToFilters("createdon", "thisweek");
|
|
433
|
+
// → ["createdon ge 2026-02-09T00:00:00.000Z"]
|
|
434
|
+
```
|
|
435
|
+
|
|
368
436
|
## Error handling
|
|
369
437
|
|
|
370
438
|
```typescript
|
|
371
439
|
import { ApiError } from "@truenorth-it/dataverse-client";
|
|
372
440
|
|
|
373
441
|
try {
|
|
374
|
-
await client.me.list("
|
|
442
|
+
await client.me.list("case");
|
|
375
443
|
} catch (err) {
|
|
376
444
|
if (err instanceof ApiError) {
|
|
377
445
|
console.error(err.status); // HTTP status code
|
|
@@ -386,6 +454,122 @@ try {
|
|
|
386
454
|
| 403 | Insufficient permissions |
|
|
387
455
|
| 404 | Unknown table or contact not found |
|
|
388
456
|
|
|
457
|
+
## Real-time notifications
|
|
458
|
+
|
|
459
|
+
The SDK includes a React hook that connects to Azure SignalR and automatically invalidates TanStack Query caches when data changes on the server. When another user (or an MCP client) creates or updates a record, your portal's UI refreshes instantly — no polling required.
|
|
460
|
+
|
|
461
|
+
### Prerequisites
|
|
462
|
+
|
|
463
|
+
Install the SignalR client as a peer dependency:
|
|
464
|
+
|
|
465
|
+
```bash
|
|
466
|
+
npm install @microsoft/signalr
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
The API must have `SIGNALR_CONNECTION_STRING` configured. When it's not set, `negotiate()` returns a 404 and the hook gracefully does nothing.
|
|
470
|
+
|
|
471
|
+
### Negotiate
|
|
472
|
+
|
|
473
|
+
The client exposes a `negotiate()` method that exchanges your Auth0 token for a SignalR connection token:
|
|
474
|
+
|
|
475
|
+
```typescript
|
|
476
|
+
const { url, accessToken } = await client.negotiate();
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
You don't usually call this directly — the `useRealtime` hook handles it.
|
|
480
|
+
|
|
481
|
+
### useRealtime hook
|
|
482
|
+
|
|
483
|
+
```tsx
|
|
484
|
+
import { useCallback } from "react";
|
|
485
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
486
|
+
import { createClient, useRealtime } from "@truenorth-it/dataverse-client";
|
|
487
|
+
|
|
488
|
+
function App() {
|
|
489
|
+
const client = useApiClient();
|
|
490
|
+
const queryClient = useQueryClient();
|
|
491
|
+
|
|
492
|
+
const negotiate = useCallback(() => client.negotiate(), [client]);
|
|
493
|
+
|
|
494
|
+
const { connected, error } = useRealtime({
|
|
495
|
+
negotiate,
|
|
496
|
+
queryClient,
|
|
497
|
+
});
|
|
498
|
+
|
|
499
|
+
// connected: true when the SignalR connection is active
|
|
500
|
+
// error: last error message, or null
|
|
501
|
+
}
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
That's all you need. When a `dataChanged` event arrives (e.g. for table `"case"`), the hook automatically calls `queryClient.invalidateQueries()` for the matching query keys. TanStack Query refetches in the background and your UI updates.
|
|
505
|
+
|
|
506
|
+
### Options
|
|
507
|
+
|
|
508
|
+
```typescript
|
|
509
|
+
interface RealtimeOptions {
|
|
510
|
+
negotiate: () => Promise<{ url: string; accessToken: string }>;
|
|
511
|
+
queryClient: QueryClient;
|
|
512
|
+
tableQueryKeys?: Record<string, readonly (readonly unknown[])[]>;
|
|
513
|
+
onEvent?: (event: DataChangeEvent) => void;
|
|
514
|
+
enabled?: boolean; // default: true
|
|
515
|
+
}
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
| Option | Description |
|
|
519
|
+
|--------|-------------|
|
|
520
|
+
| `negotiate` | Function that returns a SignalR token (from `client.negotiate()`) |
|
|
521
|
+
| `queryClient` | TanStack React Query client instance |
|
|
522
|
+
| `tableQueryKeys` | Custom mapping of table names to query key prefixes (see below) |
|
|
523
|
+
| `onEvent` | Optional callback for every data change event |
|
|
524
|
+
| `enabled` | Set to `false` to disable the connection |
|
|
525
|
+
|
|
526
|
+
### Default table-to-query-key mapping
|
|
527
|
+
|
|
528
|
+
The hook ships with sensible defaults:
|
|
529
|
+
|
|
530
|
+
```typescript
|
|
531
|
+
{
|
|
532
|
+
case: [["cases"], ["aggStats"]],
|
|
533
|
+
casenotes: [["caseNotes"]],
|
|
534
|
+
caseactivities: [["caseActivities"]],
|
|
535
|
+
caseemails: [["caseActivities"]],
|
|
536
|
+
casephonecalls: [["caseActivities"]],
|
|
537
|
+
casetasks: [["caseActivities"]],
|
|
538
|
+
caseappointments:[["caseActivities"]],
|
|
539
|
+
}
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
Override or extend for your own tables:
|
|
543
|
+
|
|
544
|
+
```typescript
|
|
545
|
+
useRealtime({
|
|
546
|
+
negotiate,
|
|
547
|
+
queryClient,
|
|
548
|
+
tableQueryKeys: {
|
|
549
|
+
// Keep defaults
|
|
550
|
+
case: [["cases"], ["aggStats"]],
|
|
551
|
+
casenotes: [["caseNotes"]],
|
|
552
|
+
// Add your custom tables
|
|
553
|
+
invoice: [["invoices"]],
|
|
554
|
+
project: [["projects"], ["projectStats"]],
|
|
555
|
+
},
|
|
556
|
+
});
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
### DataChangeEvent
|
|
560
|
+
|
|
561
|
+
Events received from the server:
|
|
562
|
+
|
|
563
|
+
```typescript
|
|
564
|
+
interface DataChangeEvent {
|
|
565
|
+
table: string; // e.g. "case", "casenotes"
|
|
566
|
+
action: "created" | "updated" | "deleted";
|
|
567
|
+
recordId: string; // GUID of the affected record
|
|
568
|
+
timestamp: string; // ISO 8601
|
|
569
|
+
actor?: string; // email of the user who made the change
|
|
570
|
+
}
|
|
571
|
+
```
|
|
572
|
+
|
|
389
573
|
## Response field patterns
|
|
390
574
|
|
|
391
575
|
These patterns apply to **all** API responses, whether or not you use generated types.
|
|
@@ -411,7 +595,7 @@ If you use codegen, the generated file includes a `TableName` union of all valid
|
|
|
411
595
|
```typescript
|
|
412
596
|
import type { TableName } from "./dataverse-tables.generated";
|
|
413
597
|
|
|
414
|
-
// Type-safe table parameter — accepts "
|
|
598
|
+
// Type-safe table parameter — accepts "case", "case", "contact", etc.
|
|
415
599
|
function fetchRecords(table: TableName) {
|
|
416
600
|
return client.me.list(table);
|
|
417
601
|
}
|
|
@@ -436,13 +620,18 @@ import type {
|
|
|
436
620
|
SchemaResponse, SchemaTableInput,
|
|
437
621
|
// Errors
|
|
438
622
|
ApiErrorBody,
|
|
623
|
+
// Real-time notifications
|
|
624
|
+
NegotiateResponse, DataChangeEvent, RealtimeOptions, RealtimeState,
|
|
439
625
|
} from "@truenorth-it/dataverse-client";
|
|
626
|
+
|
|
627
|
+
// React hook (requires @microsoft/signalr peer dependency)
|
|
628
|
+
import { useRealtime } from "@truenorth-it/dataverse-client";
|
|
440
629
|
```
|
|
441
630
|
|
|
442
631
|
Table-specific types come from your generated file:
|
|
443
632
|
|
|
444
633
|
```typescript
|
|
445
|
-
import type {
|
|
634
|
+
import type { Case, Contact, TableName } from "./dataverse-tables.generated";
|
|
446
635
|
```
|
|
447
636
|
|
|
448
637
|
## Requirements
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truenorth-it/dataverse-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./sdk/dist/index.js",
|
|
6
6
|
"types": "./sdk/dist/index.d.ts",
|
|
@@ -17,11 +17,10 @@
|
|
|
17
17
|
"sdk/dist"
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
|
-
"generate:sdk-types": "tsx scripts/generate-sdk-types.ts",
|
|
21
20
|
"build:sdk": "tsc -p sdk/tsconfig.json",
|
|
22
21
|
"prepare": "tsc -p sdk/tsconfig.json",
|
|
23
22
|
"dev": "vite",
|
|
24
|
-
"build": "tsc
|
|
23
|
+
"build": "tsc & vite build && wait",
|
|
25
24
|
"preview": "vite preview",
|
|
26
25
|
"lint": "eslint . --ext .ts,.tsx",
|
|
27
26
|
"typecheck": "tsc --noEmit",
|
|
@@ -33,7 +32,8 @@
|
|
|
33
32
|
"capture-snapshots:force": "tsx scripts/capture-dataverse-snapshots.ts --force",
|
|
34
33
|
"test": "vitest run",
|
|
35
34
|
"test:watch": "vitest",
|
|
36
|
-
"test:coverage": "vitest run --coverage"
|
|
35
|
+
"test:coverage": "vitest run --coverage",
|
|
36
|
+
"test:stats": "vitest run --coverage && node scripts/generate-test-stats.cjs"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@auth0/auth0-react": "^2.2.4",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"zod": "^3.25.76"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
+
"@microsoft/signalr": "^10.0.0",
|
|
54
55
|
"@tailwindcss/vite": "^4.1.18",
|
|
55
56
|
"@testing-library/jest-dom": "^6.9.1",
|
|
56
57
|
"@testing-library/react": "^16.3.2",
|
|
@@ -72,6 +73,18 @@
|
|
|
72
73
|
"vite": "^5.0.12",
|
|
73
74
|
"vitest": "^4.0.18"
|
|
74
75
|
},
|
|
76
|
+
"peerDependencies": {
|
|
77
|
+
"@microsoft/signalr": ">=8.0.0",
|
|
78
|
+
"@tanstack/react-query": ">=5.0.0"
|
|
79
|
+
},
|
|
80
|
+
"peerDependenciesMeta": {
|
|
81
|
+
"@microsoft/signalr": {
|
|
82
|
+
"optional": true
|
|
83
|
+
},
|
|
84
|
+
"@tanstack/react-query": {
|
|
85
|
+
"optional": true
|
|
86
|
+
}
|
|
87
|
+
},
|
|
75
88
|
"engines": {
|
|
76
89
|
"node": ">=18"
|
|
77
90
|
}
|
package/sdk/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ClientConfig, QueryOptions, LookupOptions, PaginatedResponse, SingleResponse, WhoamiResponse, TableSchema, FieldChoicesResponse, TableChoicesResponse, ApiErrorBody } from "./types.js";
|
|
1
|
+
import type { ClientConfig, QueryOptions, LookupOptions, AggregateOptions, PaginatedResponse, SingleResponse, AggregateResponse, WhoamiResponse, TableSchema, FieldChoicesResponse, TableChoicesResponse, ApiErrorBody } from "./types.js";
|
|
2
2
|
/** Error thrown when the API returns a non-OK response */
|
|
3
3
|
export declare class ApiError extends Error {
|
|
4
4
|
readonly status: number;
|
|
@@ -16,6 +16,13 @@ export interface ScopeClient {
|
|
|
16
16
|
update<T = Record<string, unknown>>(table: string, id: string, data: Record<string, unknown>): Promise<SingleResponse<T>>;
|
|
17
17
|
/** Search records — returns summary fields only (ID + display name), no sensitive details */
|
|
18
18
|
lookup<T = Record<string, unknown>>(table: string, options?: LookupOptions): Promise<PaginatedResponse<T>>;
|
|
19
|
+
/**
|
|
20
|
+
* Aggregate records with groupBy and aggregate functions.
|
|
21
|
+
*
|
|
22
|
+
* Uses Dataverse OData $apply — supports count, sum, average, min, max.
|
|
23
|
+
* Results are not paginated (aggregate results are typically small).
|
|
24
|
+
*/
|
|
25
|
+
aggregate<T = Record<string, unknown>>(table: string, options: AggregateOptions): Promise<AggregateResponse<T>>;
|
|
19
26
|
}
|
|
20
27
|
/** Extended scope with create and whoami (only available on "me") */
|
|
21
28
|
export interface MeScopeClient extends ScopeClient {
|
|
@@ -30,6 +37,11 @@ export interface MeScopeClient extends ScopeClient {
|
|
|
30
37
|
/** Get authenticated identity + Dataverse contact info */
|
|
31
38
|
whoami(): Promise<WhoamiResponse>;
|
|
32
39
|
}
|
|
40
|
+
/** SignalR negotiate response */
|
|
41
|
+
export interface NegotiateResponse {
|
|
42
|
+
url: string;
|
|
43
|
+
accessToken: string;
|
|
44
|
+
}
|
|
33
45
|
/** Dataverse Contact API client */
|
|
34
46
|
export interface DataverseClient {
|
|
35
47
|
/** Operations on the authenticated user's own records */
|
|
@@ -42,6 +54,8 @@ export interface DataverseClient {
|
|
|
42
54
|
choices(table: string, field?: string): Promise<FieldChoicesResponse | TableChoicesResponse>;
|
|
43
55
|
/** Fetch table schema (single table or all tables) */
|
|
44
56
|
schema(table?: string): Promise<TableSchema | TableSchema[]>;
|
|
57
|
+
/** Negotiate a SignalR connection token for real-time notifications */
|
|
58
|
+
negotiate(): Promise<NegotiateResponse>;
|
|
45
59
|
}
|
|
46
60
|
/** Create a configured API client instance */
|
|
47
61
|
export declare function createClient(config: ClientConfig): DataverseClient;
|
package/sdk/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,EACb,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAC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O,CAAC,iBAAiB,CAAC,CAAC;CACzC;AAED,8CAA8C;AAC9C,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,eAAe,CA0BlE"}
|
package/sdk/dist/client.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { quickDateToFilters } from "./quick-date.js";
|
|
1
2
|
/** Error thrown when the API returns a non-OK response */
|
|
2
3
|
export class ApiError extends Error {
|
|
3
4
|
status;
|
|
@@ -11,6 +12,23 @@ export class ApiError extends Error {
|
|
|
11
12
|
this.body = body;
|
|
12
13
|
}
|
|
13
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Collect all filter strings, including any resolved from `created`/`modified`
|
|
17
|
+
* quick date shortcuts. Resolves client-side so the SDK works against any
|
|
18
|
+
* server version — no dependency on the server supporting these params.
|
|
19
|
+
*/
|
|
20
|
+
function collectFilters(options) {
|
|
21
|
+
const filters = [];
|
|
22
|
+
if (options.filter) {
|
|
23
|
+
const raw = Array.isArray(options.filter) ? options.filter : [options.filter];
|
|
24
|
+
filters.push(...raw);
|
|
25
|
+
}
|
|
26
|
+
if (options.created)
|
|
27
|
+
filters.push(...quickDateToFilters("createdon", options.created));
|
|
28
|
+
if (options.modified)
|
|
29
|
+
filters.push(...quickDateToFilters("modifiedon", options.modified));
|
|
30
|
+
return filters;
|
|
31
|
+
}
|
|
14
32
|
function buildQueryString(options) {
|
|
15
33
|
const params = new URLSearchParams();
|
|
16
34
|
if (options.select?.length)
|
|
@@ -28,14 +46,9 @@ function buildQueryString(options) {
|
|
|
28
46
|
if (options.filterLogic && options.filterLogic !== "and") {
|
|
29
47
|
params.set("filterLogic", options.filterLogic);
|
|
30
48
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
: [options.filter];
|
|
35
|
-
for (const f of filters) {
|
|
36
|
-
params.append("filter", f);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
49
|
+
const filters = collectFilters(options);
|
|
50
|
+
for (const f of filters)
|
|
51
|
+
params.append("filter", f);
|
|
39
52
|
const qs = params.toString();
|
|
40
53
|
return qs ? `?${qs}` : "";
|
|
41
54
|
}
|
|
@@ -63,10 +76,28 @@ async function request(config, method, path, body) {
|
|
|
63
76
|
return undefined;
|
|
64
77
|
return JSON.parse(text);
|
|
65
78
|
}
|
|
79
|
+
function buildAggregateQueryString(options) {
|
|
80
|
+
const params = new URLSearchParams();
|
|
81
|
+
params.set("aggregate", options.aggregate);
|
|
82
|
+
if (options.groupBy?.length)
|
|
83
|
+
params.set("groupBy", options.groupBy.join(","));
|
|
84
|
+
if (options.filterLogic && options.filterLogic !== "and") {
|
|
85
|
+
params.set("filterLogic", options.filterLogic);
|
|
86
|
+
}
|
|
87
|
+
const filters = collectFilters(options);
|
|
88
|
+
for (const f of filters)
|
|
89
|
+
params.append("filter", f);
|
|
90
|
+
const qs = params.toString();
|
|
91
|
+
return qs ? `?${qs}` : "";
|
|
92
|
+
}
|
|
66
93
|
function createScopeClient(config, scope) {
|
|
67
94
|
return {
|
|
68
95
|
list(table, options = {}) {
|
|
69
|
-
|
|
96
|
+
const { subtype, ...queryOptions } = options;
|
|
97
|
+
const path = subtype
|
|
98
|
+
? `/${scope}/${table}/${subtype}${buildQueryString(queryOptions)}`
|
|
99
|
+
: `/${scope}/${table}${buildQueryString(queryOptions)}`;
|
|
100
|
+
return request(config, "GET", path);
|
|
70
101
|
},
|
|
71
102
|
get(table, id, options = {}) {
|
|
72
103
|
return request(config, "GET", `/${scope}/${table}/${id}${buildQueryString(options)}`);
|
|
@@ -77,6 +108,9 @@ function createScopeClient(config, scope) {
|
|
|
77
108
|
lookup(table, options = {}) {
|
|
78
109
|
return request(config, "GET", `/${scope}/lookup/${table}${buildQueryString(options)}`);
|
|
79
110
|
},
|
|
111
|
+
aggregate(table, options) {
|
|
112
|
+
return request(config, "GET", `/${scope}/aggregate/${table}${buildAggregateQueryString(options)}`);
|
|
113
|
+
},
|
|
80
114
|
};
|
|
81
115
|
}
|
|
82
116
|
function createMeScopeClient(config) {
|
|
@@ -111,6 +145,9 @@ export function createClient(config) {
|
|
|
111
145
|
? request(config, "GET", `/schema${qs}`)
|
|
112
146
|
: request(config, "GET", `/schema${qs}`);
|
|
113
147
|
},
|
|
148
|
+
negotiate() {
|
|
149
|
+
return request(config, "POST", "/negotiate");
|
|
150
|
+
},
|
|
114
151
|
};
|
|
115
152
|
}
|
|
116
153
|
//# sourceMappingURL=client.js.map
|
package/sdk/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,0DAA0D;AAC1D,MAAM,OAAO,QAAS,SAAQ,KAAK;IACxB,MAAM,CAAS;IACf,UAAU,CAAS;IACnB,IAAI,CAAsB;IAEnC,YAAY,MAAc,EAAE,UAAkB,EAAE,IAAyB;QACvE,KAAK,CAAC,IAAI,EAAE,OAAO,IAAI,QAAQ,MAAM,IAAI,UAAU,EAAE,CAAC,CAAC;QACvD,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED;;;;GAIG;AACH,SAAS,cAAc,CAAC,OAA4E;IAClG,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC9E,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C;QAClE,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../src/codegen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE5D,2EAA2E;AAC3E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED,6DAA6D;AAC7D,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,gBAAgB,EAAE,CAAC;CAC5B;AAED,8EAA8E;AAC9E,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC,CAAC;CAC5D;AAsHD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,iBAAiB,EAAE,GAC5B,MAAM,
|
|
1
|
+
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../src/codegen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE5D,2EAA2E;AAC3E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED,6DAA6D;AAC7D,MAAM,WA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