@xberg-io/sdk 0.8.0 → 0.8.1
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 +19 -1
- package/dist/index.d.ts +374 -28
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -31
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ and Xberg Pro document-processing APIs. One `XbergClient` speaks to either
|
|
|
35
35
|
product: the shared surface (extraction, jobs, audit, curated presets, RAG) is
|
|
36
36
|
written once, and tier-specific methods are capability-gated.
|
|
37
37
|
|
|
38
|
-
- ESM-only, modern (Node
|
|
38
|
+
- ESM-only, modern (Node 24+, Bun, Deno, Cloudflare Workers)
|
|
39
39
|
- Dual-target: two generated schema sets (Enterprise + Pro), never merged
|
|
40
40
|
- Generated types via `openapi-typescript`, runtime via `openapi-fetch`
|
|
41
41
|
- Tree-shakable, no bundled dependencies
|
|
@@ -162,6 +162,24 @@ is parsed from the `Retry-After` response header.
|
|
|
162
162
|
The low-level `createClient(...)` factory (a thin `openapi-fetch` wrapper)
|
|
163
163
|
is still exported for direct OpenAPI access.
|
|
164
164
|
|
|
165
|
+
### Selecting a Pro project
|
|
166
|
+
|
|
167
|
+
A local Pro workspace or administrator can select another visible project with
|
|
168
|
+
`projectId`. Submission sends `X-Project-ID`; job reads, pagination and
|
|
169
|
+
cancellation send the documented `project_id` query parameter. Polling helpers
|
|
170
|
+
keep that selection throughout the operation:
|
|
171
|
+
|
|
172
|
+
```ts
|
|
173
|
+
const job = await pro.extractAndWait({ projectId, file: data });
|
|
174
|
+
const result = await pro.getJobResult(job.id, { projectId });
|
|
175
|
+
const jobs = await pro.listJobs({ projectId, limit: 20, offset: 0 });
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
The same option is accepted by `extract`, `extractBatch`, `getJob`, `cancelJob`,
|
|
179
|
+
`waitForJob` and `waitForJobs`. Omitting it preserves the credential's default
|
|
180
|
+
project. This option is Pro-only; an Enterprise target rejects it before
|
|
181
|
+
submission. Project API keys still cannot select another project's data.
|
|
182
|
+
|
|
165
183
|
## Docs
|
|
166
184
|
|
|
167
185
|
- SDK docs: <https://docs.sdks.xberg.io>
|