@twick/cloud-export-video 0.14.15 → 0.14.16

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/core/renderer.js CHANGED
@@ -71,4 +71,4 @@ const renderTwickVideo = async (variables, settings) => {
71
71
  }
72
72
  };
73
73
 
74
- export default renderTwickVideo;
74
+ export { renderTwickVideo };
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@twick/cloud-export-video",
3
- "version": "0.14.15",
3
+ "version": "0.14.16",
4
4
  "description": "Twick cloud function for exporting video with platform-specific templates (AWS Lambda container)",
5
5
  "type": "module",
6
6
  "main": "core/renderer.js",
7
7
  "exports": {
8
8
  ".": "./core/renderer.js",
9
9
  "./aws": "./platform/aws/handler.js",
10
+ "./aws/cjs": "./platform/aws/handler.cjs",
10
11
  "./platform/aws/*": "./platform/aws/*"
11
12
  },
12
13
  "bin": {
@@ -43,13 +44,13 @@
43
44
  },
44
45
  "dependencies": {
45
46
  "@sparticuz/chromium": "^129.0.0",
46
- "@twick/2d": "0.14.15",
47
- "@twick/core": "0.14.15",
48
- "@twick/ffmpeg": "0.14.15",
49
- "@twick/renderer": "0.14.15",
50
- "@twick/ui": "0.14.15",
51
- "@twick/vite-plugin": "0.14.15",
52
- "@twick/visualizer": "0.14.15",
47
+ "@twick/2d": "0.14.16",
48
+ "@twick/core": "0.14.16",
49
+ "@twick/ffmpeg": "0.14.16",
50
+ "@twick/renderer": "0.14.16",
51
+ "@twick/ui": "0.14.16",
52
+ "@twick/vite-plugin": "0.14.16",
53
+ "@twick/visualizer": "0.14.16",
53
54
  "@aws-sdk/client-s3": "^3.620.0",
54
55
  "ffmpeg-static": "^5.2.0",
55
56
  "fluent-ffmpeg": "^2.1.3"
@@ -33,4 +33,4 @@ ENV HOME=/tmp
33
33
 
34
34
  ENV DONT_WRITE_TO_META_FILES=true
35
35
 
36
- CMD ["platform/aws/handler.handler"]
36
+ CMD ["handler.handler"]
@@ -1,5 +1,5 @@
1
1
  import { S3Client, PutObjectCommand } from '@aws-sdk/client-s3';
2
- import renderTwickVideo from '../../core/renderer.js';
2
+ import { renderTwickVideo } from '@twick/cloud-export-video';
3
3
 
4
4
  const s3Client = new S3Client({
5
5
  region: process.env.EXPORT_VIDEO_S3_REGION || process.env.AWS_REGION || 'us-east-1',
@@ -107,11 +107,25 @@ const buildPublicUrl = ({ bucket, key, region, baseUrl }) => {
107
107
  * Returns: JSON payload containing the uploaded video URL and metadata
108
108
  */
109
109
 
110
- export const handler = async (event) => {
110
+ const handler = async (event) => {
111
111
  console.log('Video processor function invoked');
112
112
  console.log('Event:', JSON.stringify(event));
113
113
  const projectData = event.arguments || {};
114
114
 
115
+ if(!renderTwickVideo) {
116
+ return {
117
+ statusCode: 500,
118
+ headers: {
119
+ 'Content-Type': 'application/json',
120
+ 'Access-Control-Allow-Origin': '*',
121
+ },
122
+ body: JSON.stringify({
123
+ error: 'Failed to load renderTwickVideo',
124
+ message: 'Failed to load renderTwickVideo',
125
+ }),
126
+ };
127
+ }
128
+
115
129
  try {
116
130
  // Validate required fields
117
131
  if (!projectData) {
@@ -293,3 +307,5 @@ ${mediaFiles.map((file, index) => ` ${index + 1}. ${file.filename} (${file.data
293
307
  };
294
308
  }
295
309
  };
310
+
311
+ module.exports.handler = handler;