@html-css-to-image/client 0.7.0 → 0.8.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.
@@ -131,7 +131,7 @@ export class HtmlCssToImageClient {
131
131
  const params = new URLSearchParams();
132
132
  params.append('url', request.url);
133
133
  Object.entries(request)
134
- .filter(([key, _]) => key !== 'url' && key != 'pdf_options' && key !== '__type')
134
+ .filter(([key, _]) => key !== 'url' && key != 'pdf_options' && key !== 'dedupe_duration_s' && key !== '__type')
135
135
  .sort((a, b) => a[0].localeCompare(b[0]))
136
136
  .forEach(([key, value]) => {
137
137
  if (value !== undefined && value !== null && (value !== false || key === 'transparent_background')) {
@@ -78,6 +78,14 @@ export declare abstract class BaseCreateImageRequest {
78
78
  * Ensure the image is only ever rendered and saved one time.
79
79
  */
80
80
  max_render_once?: boolean;
81
+ /**
82
+ * Reuse an identical image created within this many seconds without consuming image credits.
83
+ * HTML/CSS defaults vary by plan, while URL requests default to 0. Set to 0 to disable deduplication.
84
+ * This applies only to standard single-image POST creation requests. It does not apply to image
85
+ * batch requests and is not included in signed create-and-render URLs generated by the client.
86
+ * @see https://docs.htmlcsstoimage.com/parameters/dedupe_duration_s/
87
+ */
88
+ dedupe_duration_s?: number;
81
89
  /**
82
90
  * Disable Twemoji fallback rendering.
83
91
  */
@@ -59,6 +59,14 @@ export class BaseCreateImageRequest {
59
59
  * Ensure the image is only ever rendered and saved one time.
60
60
  */
61
61
  max_render_once;
62
+ /**
63
+ * Reuse an identical image created within this many seconds without consuming image credits.
64
+ * HTML/CSS defaults vary by plan, while URL requests default to 0. Set to 0 to disable deduplication.
65
+ * This applies only to standard single-image POST creation requests. It does not apply to image
66
+ * batch requests and is not included in signed create-and-render URLs generated by the client.
67
+ * @see https://docs.htmlcsstoimage.com/parameters/dedupe_duration_s/
68
+ */
69
+ dedupe_duration_s;
62
70
  /**
63
71
  * Disable Twemoji fallback rendering.
64
72
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@html-css-to-image/client",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "description": "Lightweight TypeScript client for the HTML/CSS to Image API. Generate images from HTML/CSS, URLs, or templates in your TypeScript or JavaScript projects.",
6
6
  "main": "dist/index.js",