@truenorth-it/dataverse-client 1.0.2 → 1.0.4
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 +37 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# @truenorth-it/dataverse-client
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Unlock your Dataverse data.** Your CRM data is trapped behind OData queries, Azure AD service principals, and Microsoft SDK complexity. Your frontend team just wants JSON. This package is the key.
|
|
4
|
+
|
|
5
|
+
A type-safe JavaScript/TypeScript client that turns your Dataverse instance into clean REST endpoints. Secure by architecture — every request is authenticated, authorised, and scoped to the logged-in user. No Microsoft dependencies in your frontend. No Azure tokens in the browser.
|
|
6
|
+
|
|
7
|
+
Works with **any** deployment — generate TypeScript types specific to your Dataverse org, or use it untyped.
|
|
4
8
|
|
|
5
9
|
## Installation
|
|
6
10
|
|
|
@@ -31,6 +35,21 @@ for (const record of result.data) {
|
|
|
31
35
|
}
|
|
32
36
|
```
|
|
33
37
|
|
|
38
|
+
## Why this exists
|
|
39
|
+
|
|
40
|
+
Your Dataverse data is locked behind APIs designed for platform consultants — not for frontend teams building customer portals. Between your React app and the data sit Azure AD client credentials, OData entity navigation, MSAL token management, and GUID-based lookups.
|
|
41
|
+
|
|
42
|
+
This client eliminates all of that:
|
|
43
|
+
|
|
44
|
+
| You write | Instead of |
|
|
45
|
+
|---|---|
|
|
46
|
+
| `client.me.list("incident")` | OData queries, `$filter`, `$expand`, GUID joins |
|
|
47
|
+
| `getAccessTokenSilently()` | MSAL, client credentials, service principal config |
|
|
48
|
+
| Nothing — it's automatic | Custom row-level security middleware |
|
|
49
|
+
| `npx dataverse-client generate` | Manually typing Dataverse schemas |
|
|
50
|
+
|
|
51
|
+
**Stop building middleware. Start building your portal.**
|
|
52
|
+
|
|
34
53
|
## Types are optional
|
|
35
54
|
|
|
36
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.
|
|
@@ -240,6 +259,23 @@ const result = await client.me.create("casenotes", {
|
|
|
240
259
|
console.log(result.data.annotationid); // new note GUID
|
|
241
260
|
```
|
|
242
261
|
|
|
262
|
+
The API automatically binds contact and account relationship fields when creating records.
|
|
263
|
+
For tables with auto-binding configured (like `incident`), you only need to provide content fields:
|
|
264
|
+
|
|
265
|
+
```typescript
|
|
266
|
+
// Create a case — contact and account are auto-bound from your identity
|
|
267
|
+
const newCase = await client.me.create("incident", {
|
|
268
|
+
title: "VPN not connecting",
|
|
269
|
+
description: "Getting timeout errors when connecting to corporate VPN.",
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
console.log(newCase.data.incidentid); // new case GUID
|
|
273
|
+
console.log(newCase.data.ticketnumber); // auto-generated case number
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
You do **not** need to set `primarycontactid` or `customerid_account` — the API resolves
|
|
277
|
+
these from your authenticated identity and binds them automatically.
|
|
278
|
+
|
|
243
279
|
### Update a record
|
|
244
280
|
|
|
245
281
|
Available on all scopes (`me`, `team`, `all`):
|