@xberg-io/sdk 0.5.0 → 0.7.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/README.md CHANGED
@@ -48,9 +48,8 @@ pnpm add @xberg-io/sdk
48
48
 
49
49
  ## Targets
50
50
 
51
- `XbergClient` defaults to Xberg Enterprise (`baseUrl` defaults to
52
- `https://api.xberg.io`). To talk to a self-hosted Xberg Pro instance, pass
53
- `target: "pro"` with an explicit `baseUrl`:
51
+ Both products are self-hosted, so `XbergClient` requires the deployment's
52
+ `baseUrl`. Pass `target: "pro"` when the target is already known:
54
53
 
55
54
  ```ts
56
55
  import { XbergClient } from "@xberg-io/sdk";
@@ -59,8 +58,8 @@ const pro = new XbergClient({ apiKey: process.env.XBERG_API_KEY!, target: "pro",
59
58
  ```
60
59
 
61
60
  When `target` is omitted the tier is discovered lazily from `GET /healthz`.
62
- Calling a method not available on the connected tier (e.g. `usage()` on Pro, or
63
- `login()` on Enterprise) throws a clear "not available on this tier" error.
61
+ Calling a method not available on the connected tier (e.g. `versions()` on Pro,
62
+ or `login()` on Enterprise) throws a clear "not available on this tier" error.
64
63
 
65
64
  ## Quickstart — single file
66
65
 
@@ -68,7 +67,7 @@ Calling a method not available on the connected tier (e.g. `usage()` on Pro, or
68
67
  import { XbergClient } from "@xberg-io/sdk";
69
68
  import { readFile } from "node:fs/promises";
70
69
 
71
- const client = new XbergClient({ apiKey: process.env.XBERG_API_KEY! });
70
+ const client = new XbergClient({ baseUrl: "https://xberg.example.com", apiKey: process.env.XBERG_API_KEY! });
72
71
 
73
72
  const data = await readFile("invoice.pdf");
74
73
  const result = await client.extractAndWait({
@@ -83,7 +82,7 @@ console.log(result.result?.content);
83
82
  import { XbergClient } from "@xberg-io/sdk";
84
83
  import { readFile } from "node:fs/promises";
85
84
 
86
- const client = new XbergClient({ apiKey: process.env.XBERG_API_KEY! });
85
+ const client = new XbergClient({ baseUrl: "https://xberg.example.com", apiKey: process.env.XBERG_API_KEY! });
87
86
 
88
87
  const files = await Promise.all(
89
88
  ["a.pdf", "b.pdf", "c.pdf"].map(async (name) => ({
@@ -122,18 +121,23 @@ Shared surface (both tiers):
122
121
  extraction result (`GET /v1/jobs/{id}/result`). They are different schemas — the
123
122
  polling helpers return the former, `getJobResult` the latter.
124
123
 
125
- Saved presets are shared but the two products spell the route differently —
126
- Enterprise serves `/v1/saved_presets`, Pro `/v1/saved-presets`, with identical
127
- schemas. The client resolves the tier and picks the spelling for you.
124
+ Saved presets are shared, and both products serve them at `/v1/saved_presets`
125
+ with identical schemas.
128
126
 
129
- Xberg Pro only: `login`, `authConfig`, `getRagConfig` / `setRagConfig`, and the
127
+ Xberg Pro only: `login`, `authConfig`, `getRagConfig` / `setRagConfig`,
128
+ `getLicenseInfo`, `putLocalUpload`, and the
130
129
  control plane — `listProjects` / `createProject`, `listApiKeys` / `createApiKey` /
131
130
  `revokeApiKey`, `listIntegrations` / `createIntegration` / `getIntegration` /
132
131
  `deleteIntegration`, `connectIntegration` / `disconnectIntegration`,
133
132
  `listIntegrationDocuments` / `fetchIntegrationDocument`.
134
133
 
135
134
  Xberg Enterprise only: `getDocument`, `versions`, `diff` / `getDiffJob`,
136
- `presignUpload` / `confirmUpload`, `usage`, `listExtractionEvents`, `getJobPage`,
135
+ `listExtractionEvents`, `listSubscriptionDeliveries` / `getSubscriptionDelivery`.
136
+
137
+ Both tiers also carry `stopAutoTuneJob` and `listManagedEmbeddingPresets`.
138
+
139
+ Available on both tiers, though earlier releases wrongly gated them to
140
+ Enterprise: `presignUpload` / `confirmUpload`, `usage`, `getJobPage`,
137
141
  `submitEnrich` / `getEnrichStatus`, `streamCrawlEvents` (an `AsyncIterable` over
138
142
  a Server-Sent Events stream).
139
143