@formfeed/sdk 0.3.0 → 0.3.2

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.
Files changed (2) hide show
  1. package/README.md +5 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @formfeed/sdk
2
2
 
3
3
  The TypeScript client for the [Formfeed](https://formfeed.dev) API: generate PDFs and images from
4
- templates. It has no dependencies and uses only Web APIs (`fetch`, Web Crypto), so it runs in Node 22+,
4
+ templates, and fill Word and PowerPoint templates. It has no dependencies and uses only Web APIs (`fetch`, Web Crypto), so it runs in Node 22+,
5
5
  Deno, Bun, Cloudflare Workers and browsers.
6
6
 
7
7
  - Retries `429` and `503` with the server's `Retry-After`.
@@ -60,6 +60,10 @@ await client.templates.create({
60
60
 
61
61
  const filled = await client.renders.create({ template: 'offer', output: 'docx', data }); // or output: 'pdf'
62
62
 
63
+ // a new version with a new document; without `file` the latest document is kept
64
+ await client.templates.versions.create('offer', { file: { data: await readFile('offer-v2.docx'), name: 'offer.docx' } });
65
+ const docx = await client.templates.versions.file('offer', 'latest'); // the document's bytes
66
+
63
67
  // any office document to PDF (Word, Excel, PowerPoint, OpenDocument, RTF)
64
68
  const pdf = await client.pdf.convert({ file: { data: await readFile('report.xlsx'), name: 'report.xlsx' } }, { single_page_sheets: true });
65
69
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formfeed/sdk",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Formfeed API client: renders, templates, webhooks. No dependencies, Web APIs only.",
5
5
  "license": "MIT",
6
6
  "type": "module",