@remotion/lambda 3.2.28 → 3.2.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/lambda",
3
- "version": "3.2.28",
3
+ "version": "3.2.29",
4
4
  "description": "Distributed renderer for Remotion based on AWS Lambda",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -32,12 +32,12 @@
32
32
  "@aws-sdk/client-service-quotas": "3.58.0",
33
33
  "@aws-sdk/lib-storage": "3.58.0",
34
34
  "@aws-sdk/s3-request-presigner": "3.58.0",
35
- "@remotion/bundler": "3.2.28",
36
- "@remotion/cli": "3.2.28",
37
- "@remotion/renderer": "3.2.28",
35
+ "@remotion/bundler": "3.2.29",
36
+ "@remotion/cli": "3.2.29",
37
+ "@remotion/renderer": "3.2.29",
38
38
  "aws-policies": "^1.0.1",
39
39
  "mime-types": "2.1.34",
40
- "remotion": "3.2.28"
40
+ "remotion": "3.2.29"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "react": ">=16.8.0",
@@ -62,5 +62,5 @@
62
62
  "publishConfig": {
63
63
  "access": "public"
64
64
  },
65
- "gitHead": "49bb70afa503bfb0c89ee51d8bf3386ad1b91ac4"
65
+ "gitHead": "9a2ff4d68324af8d1fe55ebdf94bdadccf446a10"
66
66
  }
Binary file
@@ -1,10 +0,0 @@
1
- import type { ImageFormat, StillImageFormat } from '@remotion/renderer';
2
- export declare const getImageFormat: ({ downloadName, outName, configImageFormat, cliFlag, }: {
3
- downloadName: string | null;
4
- outName: string | null;
5
- configImageFormat: ImageFormat | null;
6
- cliFlag: ImageFormat | null;
7
- }) => {
8
- format: StillImageFormat;
9
- source: string;
10
- };
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getImageFormat = void 0;
4
- const deriveExtensionFromFilename = (filename) => {
5
- if (filename === null || filename === void 0 ? void 0 : filename.endsWith('.png')) {
6
- return 'png';
7
- }
8
- if (filename === null || filename === void 0 ? void 0 : filename.endsWith('.jpg')) {
9
- return 'jpeg';
10
- }
11
- if (filename === null || filename === void 0 ? void 0 : filename.endsWith('.jpeg')) {
12
- return 'jpeg';
13
- }
14
- return null;
15
- };
16
- const getImageFormat = ({ downloadName, outName, configImageFormat, cliFlag, }) => {
17
- const outNameExtension = deriveExtensionFromFilename(outName);
18
- const downloadNameExtension = deriveExtensionFromFilename(downloadName);
19
- if (outNameExtension &&
20
- downloadNameExtension &&
21
- outNameExtension !== downloadNameExtension) {
22
- throw new TypeError(`Image format mismatch: ${outName} was given as the S3 output name and ${downloadName} was given as the download name, but the extensions don't match.`);
23
- }
24
- if (downloadNameExtension) {
25
- if (cliFlag && downloadNameExtension !== cliFlag) {
26
- throw new TypeError(`Image format mismatch: ${downloadName} was given as the download name, but --image-format=${cliFlag} was passed. The image formats must match.`);
27
- }
28
- return { format: downloadNameExtension, source: 'Download name extension' };
29
- }
30
- if (outNameExtension) {
31
- if (cliFlag && outNameExtension !== cliFlag) {
32
- throw new TypeError(`Image format mismatch: ${outName} was given as the S3 out name, but --image-format=${cliFlag} was passed. The image formats must match.`);
33
- }
34
- return { format: outNameExtension, source: 'Out name extension' };
35
- }
36
- if (cliFlag === 'none') {
37
- throw new TypeError('The --image-format flag must not be "none" for stills.');
38
- }
39
- if (cliFlag !== null) {
40
- return { format: cliFlag, source: '--image-format flag' };
41
- }
42
- if (configImageFormat !== null && configImageFormat !== 'none') {
43
- return { format: configImageFormat, source: 'Config file' };
44
- }
45
- return { format: 'png', source: 'Default' };
46
- };
47
- exports.getImageFormat = getImageFormat;
@@ -1,23 +0,0 @@
1
- import http from 'http';
2
- import https from 'https';
3
- /**
4
- * @description Calculates cryptographically secure signature for webhooks using Hmac.
5
- * @link https://remotion.dev/docs/lambda/validate-webhooks
6
- * @param payload Stringified request body to encode in the signature.
7
- */
8
- export declare function calculateSignature(payload: string): string;
9
- export declare type InvokeWebhookInput = {
10
- url: string;
11
- type: 'success' | 'error' | 'timeout';
12
- renderId: string;
13
- };
14
- export declare const mockableHttpClients: {
15
- http: typeof http.request;
16
- https: typeof https.request;
17
- };
18
- /**
19
- * @description Calls a webhook.
20
- * @link https://remotion.dev/docs/lambda/rendermediaonlambda#webhook
21
- * @param params.url URL of webhook to call.
22
- */
23
- export declare function invokeWebhook({ url, type, renderId }: InvokeWebhookInput): Promise<void>;
@@ -1,88 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.invokeWebhook = exports.mockableHttpClients = exports.calculateSignature = void 0;
30
- const Crypto = __importStar(require("crypto"));
31
- const http_1 = __importDefault(require("http"));
32
- const https_1 = __importDefault(require("https"));
33
- /**
34
- * @description Calculates cryptographically secure signature for webhooks using Hmac.
35
- * @link https://remotion.dev/docs/lambda/validate-webhooks
36
- * @param payload Stringified request body to encode in the signature.
37
- */
38
- function calculateSignature(payload) {
39
- const secret = 'INSECURE_DEFAULT_SECRET';
40
- const hmac = Crypto.createHmac('sha1', secret);
41
- const signature = 'sha1=' + hmac.update(payload).digest('hex');
42
- return signature;
43
- }
44
- exports.calculateSignature = calculateSignature;
45
- const getWebhookClient = (url) => {
46
- if (url.startsWith('https://')) {
47
- return exports.mockableHttpClients.https;
48
- }
49
- if (url.startsWith('http://')) {
50
- return exports.mockableHttpClients.http;
51
- }
52
- throw new Error('Can only request URLs starting with http:// or https://');
53
- };
54
- exports.mockableHttpClients = {
55
- http: http_1.default.request,
56
- https: https_1.default.request,
57
- };
58
- /**
59
- * @description Calls a webhook.
60
- * @link https://remotion.dev/docs/lambda/rendermediaonlambda#webhook
61
- * @param params.url URL of webhook to call.
62
- */
63
- function invokeWebhook({ url, type, renderId }) {
64
- const payload = JSON.stringify({ result: type, renderId });
65
- return new Promise((resolve, reject) => {
66
- const req = getWebhookClient(url)(url, {
67
- method: 'POST',
68
- headers: {
69
- 'Content-Type': 'application/json',
70
- 'X-Remotion-Signature': calculateSignature(payload),
71
- 'X-Remotion-Status': type,
72
- },
73
- timeout: 5000,
74
- }, (res) => {
75
- if (res.statusCode && res.statusCode > 299) {
76
- reject(new Error(`Sent a webhook but got a status code of ${res.statusCode}`));
77
- return;
78
- }
79
- resolve();
80
- });
81
- req.write(payload);
82
- req.on('error', (err) => {
83
- reject(err);
84
- });
85
- req.end();
86
- });
87
- }
88
- exports.invokeWebhook = invokeWebhook;