@ironfang/render 1.0.0 → 2.0.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 +4 -5
- package/dist/client.d.ts +1 -1
- package/dist/client.js +8 -8
- package/dist/index.d.ts +0 -10
- package/dist/index.js +0 -6
- package/dist/webhook.d.ts +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,9 +4,8 @@ The official client for the [Ironfang Render](https://ironfang.com/render) API:
|
|
|
4
4
|
screenshots, PDFs, QR codes, template images, clips and site previews from a
|
|
5
5
|
URL or from HTML you send. Zero dependencies; Node 20 and later.
|
|
6
6
|
|
|
7
|
-
Formerly `@ironfang/renderwolf
|
|
8
|
-
exports
|
|
9
|
-
`Renderwolf-*` headers.
|
|
7
|
+
Formerly `@ironfang/renderwolf`; 2.0.0 removed the old `Renderwolf` and
|
|
8
|
+
`RenderwolfError` exports. Webhooks are signed with the `Ironfang-*` headers.
|
|
10
9
|
|
|
11
10
|
```sh
|
|
12
11
|
npm install @ironfang/render
|
|
@@ -78,8 +77,8 @@ import { verifyWebhook } from '@ironfang/render';
|
|
|
78
77
|
|
|
79
78
|
const ok = await verifyWebhook({
|
|
80
79
|
secret: process.env.RENDER_WEBHOOK_SECRET!,
|
|
81
|
-
timestamp: req.headers['
|
|
82
|
-
signature: req.headers['
|
|
80
|
+
timestamp: req.headers['ironfang-timestamp'],
|
|
81
|
+
signature: req.headers['ironfang-signature'],
|
|
83
82
|
payload: rawBody,
|
|
84
83
|
});
|
|
85
84
|
```
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ClipRequest, Destination, DestinationDraft, ImageRequest, Job, JobSubmission, PdfRequest, QrRequest, RequestFilter, RequestRecord, ScreenshotRequest, SignRequest, SignedUrl, SitePreviewRequest, Usage } from './types.js';
|
|
2
|
-
export declare const VERSION = "
|
|
2
|
+
export declare const VERSION = "2.0.0";
|
|
3
3
|
export interface ClientOptions {
|
|
4
4
|
/** Your `rw_live_...` key. Never ship this to a browser. */
|
|
5
5
|
apiKey: string;
|
package/dist/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IronfangRenderError } from './errors.js';
|
|
2
|
-
export const VERSION = '
|
|
2
|
+
export const VERSION = '2.0.0';
|
|
3
3
|
export class IronfangRender {
|
|
4
4
|
apiKey;
|
|
5
5
|
baseUrl;
|
|
@@ -44,10 +44,10 @@ export class IronfangRender {
|
|
|
44
44
|
return {
|
|
45
45
|
poster: new Uint8Array(await poster.arrayBuffer()),
|
|
46
46
|
video: new Uint8Array(await video.arrayBuffer()),
|
|
47
|
-
credits: num(resp.headers.get('X-
|
|
48
|
-
renderMs: num(resp.headers.get('X-
|
|
49
|
-
outputSeconds: num(resp.headers.get('X-
|
|
50
|
-
cached: resp.headers.get('X-
|
|
47
|
+
credits: num(resp.headers.get('X-Ironfang-Credits')),
|
|
48
|
+
renderMs: num(resp.headers.get('X-Ironfang-Render-Ms')),
|
|
49
|
+
outputSeconds: num(resp.headers.get('X-Ironfang-Output-Seconds')),
|
|
50
|
+
cached: resp.headers.get('X-Ironfang-Cache') === 'hit',
|
|
51
51
|
requestId: requestIdOf(resp),
|
|
52
52
|
headers: resp.headers,
|
|
53
53
|
};
|
|
@@ -58,9 +58,9 @@ export class IronfangRender {
|
|
|
58
58
|
return {
|
|
59
59
|
bytes,
|
|
60
60
|
contentType: (resp.headers.get('Content-Type') ?? 'application/octet-stream').split(';')[0].trim(),
|
|
61
|
-
credits: num(resp.headers.get('X-
|
|
62
|
-
renderMs: num(resp.headers.get('X-
|
|
63
|
-
cached: resp.headers.get('X-
|
|
61
|
+
credits: num(resp.headers.get('X-Ironfang-Credits')),
|
|
62
|
+
renderMs: num(resp.headers.get('X-Ironfang-Render-Ms')),
|
|
63
|
+
cached: resp.headers.get('X-Ironfang-Cache') === 'hit',
|
|
64
64
|
requestId: requestIdOf(resp),
|
|
65
65
|
headers: resp.headers,
|
|
66
66
|
saveTo: (target) => saveBytes(target, bytes),
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
export { IronfangRender, VERSION } from './client.js';
|
|
2
2
|
export type { ClientOptions, RequestOptions, RenderResult, SitePreviewResult, WaitOptions } from './client.js';
|
|
3
3
|
export { IronfangRenderError } from './errors.js';
|
|
4
|
-
import { IronfangRender } from './client.js';
|
|
5
|
-
import { IronfangRenderError } from './errors.js';
|
|
6
|
-
/** @deprecated Use {@link IronfangRender}. Kept from @ironfang/renderwolf. */
|
|
7
|
-
export declare const Renderwolf: typeof IronfangRender;
|
|
8
|
-
/** @deprecated Use {@link IronfangRender}. Kept from @ironfang/renderwolf. */
|
|
9
|
-
export type Renderwolf = IronfangRender;
|
|
10
|
-
/** @deprecated Use {@link IronfangRenderError}. Kept from @ironfang/renderwolf. */
|
|
11
|
-
export declare const RenderwolfError: typeof IronfangRenderError;
|
|
12
|
-
/** @deprecated Use {@link IronfangRenderError}. Kept from @ironfang/renderwolf. */
|
|
13
|
-
export type RenderwolfError = IronfangRenderError;
|
|
14
4
|
export { verifyWebhook, signWebhook } from './webhook.js';
|
|
15
5
|
export type { WebhookInput } from './webhook.js';
|
|
16
6
|
export type * from './types.js';
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
export { IronfangRender, VERSION } from './client.js';
|
|
2
2
|
export { IronfangRenderError } from './errors.js';
|
|
3
|
-
import { IronfangRender } from './client.js';
|
|
4
|
-
import { IronfangRenderError } from './errors.js';
|
|
5
|
-
/** @deprecated Use {@link IronfangRender}. Kept from @ironfang/renderwolf. */
|
|
6
|
-
export const Renderwolf = IronfangRender;
|
|
7
|
-
/** @deprecated Use {@link IronfangRenderError}. Kept from @ironfang/renderwolf. */
|
|
8
|
-
export const RenderwolfError = IronfangRenderError;
|
|
9
3
|
export { verifyWebhook, signWebhook } from './webhook.js';
|
package/dist/webhook.d.ts
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Ironfang Render signs each delivery with HMAC-SHA256 over
|
|
5
5
|
* `<timestamp>.<raw body>` using your endpoint's signing secret, and sends the
|
|
6
|
-
* result as `
|
|
6
|
+
* result as `Ironfang-Signature: v1=<hex>` with `Ironfang-Timestamp` beside
|
|
7
7
|
* it. The check must run over the raw bytes as received: re-serialising parsed
|
|
8
8
|
* JSON changes them and the signature will not match.
|
|
9
9
|
*/
|
|
10
10
|
export interface WebhookInput {
|
|
11
11
|
/** The endpoint's signing secret, shown once when the destination was created. */
|
|
12
12
|
secret: string;
|
|
13
|
-
/** The `
|
|
13
|
+
/** The `Ironfang-Timestamp` header. */
|
|
14
14
|
timestamp: string;
|
|
15
|
-
/** The `
|
|
15
|
+
/** The `Ironfang-Signature` header. */
|
|
16
16
|
signature: string;
|
|
17
17
|
/** The request body exactly as received. */
|
|
18
18
|
payload: Uint8Array | string;
|
package/package.json
CHANGED