Skip to content

Commit 838c1a1

Browse files
committed
docs: add v2.0.0 migration guide
Document URL input changes and sign() restrictions.
1 parent 765698d commit 838c1a1

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ or
3434
yarn add @nutrient-sdk/dws-client-typescript
3535
```
3636

37+
## Migration Guides
38+
39+
- v2.0.0: See `docs/MIGRATION.md` for URL input changes and `sign()` restrictions.
40+
3741
## Integration with Coding Agents
3842

3943
This package has built-in support with popular coding agents like Claude Code, GitHub Copilot, Cursor, and Windsurf by exposing scripts that will inject rules instructing the coding agents on how to use the package. This ensures that the coding agent doesn't hallucinate documentation, as well as making full use of all the features offered in Nutrient DWS TypeScript Client.

docs/MIGRATION.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Migration Guide
2+
3+
## 2.0.0
4+
5+
### 1) URL inputs now use `FileInputWithUrl`
6+
7+
`FileInput` no longer includes URLs. If you need to pass URLs, use `FileInputWithUrl`.
8+
9+
```ts
10+
import type { FileInputWithUrl } from '@nutrient-sdk/dws-client-typescript';
11+
12+
const input: FileInputWithUrl = 'https://example.com/doc.pdf';
13+
const result = await client.convert(input, 'docx');
14+
```
15+
16+
### 2) `processRemoteFileInput` removed
17+
18+
If you previously used `processRemoteFileInput`, fetch the remote file yourself and pass a buffer.
19+
20+
```ts
21+
// v1.x (no longer available)
22+
import { processRemoteFileInput } from '@nutrient-sdk/dws-client-typescript';
23+
24+
// v2.0.0+
25+
const res = await fetch('https://example.com/doc.pdf');
26+
const buffer = Buffer.from(await res.arrayBuffer());
27+
const result = await client.sign(buffer, { data: { signatureType: 'cms' } });
28+
```
29+
30+
### 3) `sign()` no longer accepts URLs
31+
32+
`sign()` only accepts local inputs (file path, Buffer, or Uint8Array). For remote files, fetch first and pass a buffer.

0 commit comments

Comments
 (0)