Skip to content

Commit cd2e9d8

Browse files
committed
Release 4.0.147
1 parent 98eb95a commit cd2e9d8

File tree

3 files changed

+6
-32
lines changed

3 files changed

+6
-32
lines changed

invocations.go

+4-27
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,15 @@ func invokeRenderLambda(options RemotionOptions) (*RemotionRenderResponse, error
4444
}
4545

4646
// Unmarshal response from Lambda function
47-
var renderResponseOutput RawInvokeResponse
47+
var renderResponseOutput RemotionRenderResponse
4848

4949
responseMarshallingError := json.Unmarshal(invocationResult.Payload, &renderResponseOutput)
5050

5151
if responseMarshallingError != nil {
5252
return nil, responseMarshallingError
5353
}
5454

55-
return SantitiseRenderResponse(renderResponseOutput)
56-
}
57-
58-
func SantitiseRenderResponse(response RawInvokeResponse) (*RemotionRenderResponse, error) {
59-
var renderBody RemotionRenderResponse
60-
61-
responseMarshallingError := json.Unmarshal([]byte(response.Body), &renderBody)
62-
if responseMarshallingError != nil {
63-
return nil, responseMarshallingError
64-
}
65-
66-
return &renderBody, nil
55+
return &renderResponseOutput, nil
6756
}
6857

6958
func invokeRenderProgressLambda(config RenderConfig) (*RenderProgress, error) {
@@ -102,24 +91,12 @@ func invokeRenderProgressLambda(config RenderConfig) (*RenderProgress, error) {
10291
}
10392

10493
// Unmarshal response from Lambda function
105-
var renderProgressOutput RawInvokeResponse
94+
var renderProgressOutput RenderProgress
10695

10796
resultUnmarshallError := json.Unmarshal(invokeResult.Payload, &renderProgressOutput)
10897
if resultUnmarshallError != nil {
10998
return nil, resultUnmarshallError
11099
}
111100

112-
return SantitiseProgressResponse(renderProgressOutput)
113-
}
114-
115-
func SantitiseProgressResponse(response RawInvokeResponse) (*RenderProgress, error) {
116-
var renderProgressBody RenderProgress
117-
118-
responseMarshallingError := json.Unmarshal([]byte(response.Body), &renderProgressBody)
119-
if responseMarshallingError != nil {
120-
print(responseMarshallingError.Error())
121-
return nil, responseMarshallingError
122-
}
123-
124-
return &renderProgressBody, nil;
101+
return &renderProgressOutput, nil
125102
}

models.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,8 @@ type renderInternalOptions struct {
9191
}
9292

9393
type RawInvokeResponse struct {
94-
StatusCode int `json:"statusCode"`
95-
Headers struct {
96-
ContentType string `json:"content-type"`
97-
} `json:"headers"`
9894
Body string `json:"body"`
95+
Type string `json:"type"`
9996
}
10097

10198
type RemotionRenderResponse struct {

version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package lambda_go_sdk;
22

3-
const VERSION = "4.0.146"
3+
const VERSION = "4.0.147"

0 commit comments

Comments
 (0)