@mkja/o-data 0.0.2 → 0.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 +8 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,16 +32,16 @@ It has two parts:
|
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
34
|
# with bun
|
|
35
|
-
bun add o-data
|
|
35
|
+
bun add @mkja/o-data
|
|
36
36
|
|
|
37
37
|
# or with npm
|
|
38
|
-
npm install o-data
|
|
38
|
+
npm install @mkja/o-data
|
|
39
39
|
|
|
40
40
|
# or with pnpm
|
|
41
|
-
pnpm add o-data
|
|
41
|
+
pnpm add @mkja/o-data
|
|
42
42
|
|
|
43
43
|
# or with yarn
|
|
44
|
-
yarn add o-data
|
|
44
|
+
yarn add @mkja/o-data
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
The runtime expects a `fetch`‑compatible environment (`Request`, `Response`, `Headers`); it works in modern Node (with `fetch`) and browsers.
|
|
@@ -56,7 +56,7 @@ You can either write a schema by hand:
|
|
|
56
56
|
|
|
57
57
|
```ts
|
|
58
58
|
// schema.ts
|
|
59
|
-
import { schema } from "o-data/schema";
|
|
59
|
+
import { schema } from "@mkja/o-data/schema";
|
|
60
60
|
|
|
61
61
|
export const crmSchema = schema({
|
|
62
62
|
namespace: "Microsoft.Dynamics.CRM",
|
|
@@ -92,7 +92,7 @@ export const crmSchema = schema({
|
|
|
92
92
|
|
|
93
93
|
```ts
|
|
94
94
|
// client.ts
|
|
95
|
-
import { OdataClient } from "o-data";
|
|
95
|
+
import { OdataClient } from "@mkja/o-data";
|
|
96
96
|
import { crmSchema } from "./schema"; // or generated-o-data-schema
|
|
97
97
|
|
|
98
98
|
const client = new OdataClient(crmSchema, {
|
|
@@ -298,7 +298,7 @@ const res = await client
|
|
|
298
298
|
});
|
|
299
299
|
|
|
300
300
|
if (res.ok) {
|
|
301
|
-
const ok: boolean = res.result
|
|
301
|
+
const ok: boolean = res.result; // mapped from Edm.Boolean (flat at top level)
|
|
302
302
|
}
|
|
303
303
|
```
|
|
304
304
|
|
|
@@ -325,7 +325,7 @@ const res = await client
|
|
|
325
325
|
});
|
|
326
326
|
|
|
327
327
|
if (res.ok) {
|
|
328
|
-
const count: number = res.result
|
|
328
|
+
const count: number = res.result; // flat at top level
|
|
329
329
|
}
|
|
330
330
|
```
|
|
331
331
|
|
|
@@ -422,7 +422,6 @@ const client = new OdataClient(myservice_schema, {
|
|
|
422
422
|
## Status and limitations
|
|
423
423
|
|
|
424
424
|
- The library is still **early (0.0.x)**; APIs may change.
|
|
425
|
-
- Some operations are marked `TODO` in the runtime (e.g. delete support outside batch, collection‑bound actions/functions implementation, richer pagination).
|
|
426
425
|
- The generator doesn’t yet handle OData operation overloading beyond keeping the first operation per name.
|
|
427
426
|
|
|
428
427
|
---
|