@remotion/lambda-client 4.0.509 → 4.0.511
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/dist/cjs/aws-provider.d.ts +1 -0
- package/dist/cjs/aws-region-metadata.d.ts +10 -0
- package/dist/cjs/convert-to-serve-url.d.ts +1 -1
- package/dist/cjs/get-aws-urls.d.ts +12 -4
- package/dist/cjs/index.d.ts +7 -1
- package/dist/cjs/index.js +139 -25
- package/dist/cjs/make-s3-url.d.ts +1 -1
- package/dist/cjs/price-per-1s.d.ts +9 -32
- package/dist/cjs/regions.d.ts +1 -1
- package/dist/cjs/regions.js +2 -0
- package/dist/cjs/validate-bucketname.d.ts +1 -1
- package/dist/esm/index.mjs +139 -25
- package/dist/esm/regions.mjs +2 -0
- package/package.json +3 -3
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type AwsPartition = 'aws' | 'aws-cn';
|
|
2
|
+
export type AwsBillingCurrency = 'USD' | 'CNY';
|
|
3
|
+
export type AwsRegionMetadata = {
|
|
4
|
+
partition: AwsPartition;
|
|
5
|
+
dnsSuffix: 'amazonaws.com' | 'amazonaws.com.cn';
|
|
6
|
+
consoleDomain: 'console.aws.amazon.com' | 'console.amazonaws.cn';
|
|
7
|
+
billingCurrency: AwsBillingCurrency;
|
|
8
|
+
};
|
|
9
|
+
export declare const getAwsPartitionMetadata: (partition: AwsPartition) => AwsRegionMetadata;
|
|
10
|
+
export declare const getAwsRegionMetadata: (region: "af-south-1" | "ap-east-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-4" | "ap-southeast-5" | "ca-central-1" | "cn-north-1" | "cn-northwest-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2") => AwsRegionMetadata;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const convertToServeUrlImplementation: ({ urlOrId, region, bucketName, }: {
|
|
2
2
|
urlOrId: string;
|
|
3
|
-
region: "af-south-1" | "ap-east-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-4" | "ap-southeast-5" | "ca-central-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2";
|
|
3
|
+
region: "af-south-1" | "ap-east-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-4" | "ap-southeast-5" | "ca-central-1" | "cn-north-1" | "cn-northwest-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2";
|
|
4
4
|
bucketName: string;
|
|
5
5
|
}) => string;
|
|
@@ -1,24 +1,32 @@
|
|
|
1
1
|
import type { GetLoggingUrlForRendererFunction, ServerlessRoutines } from '@remotion/serverless-client';
|
|
2
2
|
import type { AwsProvider } from './aws-provider';
|
|
3
3
|
export declare const getCloudwatchMethodUrl: ({ region, functionName, renderId, rendererFunctionName, method, }: {
|
|
4
|
-
region: "af-south-1" | "ap-east-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-4" | "ap-southeast-5" | "ca-central-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2";
|
|
4
|
+
region: "af-south-1" | "ap-east-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-4" | "ap-southeast-5" | "ca-central-1" | "cn-north-1" | "cn-northwest-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2";
|
|
5
5
|
functionName: string;
|
|
6
6
|
method: ServerlessRoutines;
|
|
7
7
|
rendererFunctionName: string | null;
|
|
8
8
|
renderId: string;
|
|
9
9
|
}) => string;
|
|
10
10
|
export declare const getLambdaInsightsUrl: ({ region, functionName, }: {
|
|
11
|
-
region: "af-south-1" | "ap-east-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-4" | "ap-southeast-5" | "ca-central-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2";
|
|
11
|
+
region: "af-south-1" | "ap-east-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-4" | "ap-southeast-5" | "ca-central-1" | "cn-north-1" | "cn-northwest-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2";
|
|
12
12
|
functionName: string;
|
|
13
13
|
}) => string;
|
|
14
14
|
export declare const getCloudwatchRendererUrl: GetLoggingUrlForRendererFunction<AwsProvider>;
|
|
15
15
|
export declare const getS3RenderUrl: ({ renderId, region, bucketName, }: {
|
|
16
16
|
renderId: string;
|
|
17
|
-
region: "af-south-1" | "ap-east-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-4" | "ap-southeast-5" | "ca-central-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2";
|
|
17
|
+
region: "af-south-1" | "ap-east-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-4" | "ap-southeast-5" | "ca-central-1" | "cn-north-1" | "cn-northwest-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2";
|
|
18
18
|
bucketName: string;
|
|
19
19
|
}) => string;
|
|
20
20
|
export declare const getProgressJsonUrl: ({ region, bucketName, renderId, }: {
|
|
21
|
-
region: "af-south-1" | "ap-east-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-4" | "ap-southeast-5" | "ca-central-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2";
|
|
21
|
+
region: "af-south-1" | "ap-east-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-4" | "ap-southeast-5" | "ca-central-1" | "cn-north-1" | "cn-northwest-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2";
|
|
22
22
|
bucketName: string;
|
|
23
23
|
renderId: string;
|
|
24
24
|
}) => string;
|
|
25
|
+
export declare const getLambdaFunctionUrl: ({ region, functionName, }: {
|
|
26
|
+
region: "af-south-1" | "ap-east-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-4" | "ap-southeast-5" | "ca-central-1" | "cn-north-1" | "cn-northwest-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2";
|
|
27
|
+
functionName: string;
|
|
28
|
+
}) => string;
|
|
29
|
+
export declare const getS3BucketUrl: ({ region, bucketName, }: {
|
|
30
|
+
region: "af-south-1" | "ap-east-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-4" | "ap-southeast-5" | "ca-central-1" | "cn-north-1" | "cn-northwest-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2";
|
|
31
|
+
bucketName: string;
|
|
32
|
+
}) => string;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -2,12 +2,13 @@ export type { EnhancedErrorInfo, GetOrCreateBucketInput, GetOrCreateBucketOutput
|
|
|
2
2
|
export type { RuntimePreference } from './runtime-preference';
|
|
3
3
|
import { getCloudWatchLogsClient, getIamClient, getLambdaClient, getServiceQuotasClient, getStsClient } from './aws-clients';
|
|
4
4
|
import { awsImplementation } from './aws-provider';
|
|
5
|
+
import { getAwsPartitionMetadata, getAwsRegionMetadata } from './aws-region-metadata';
|
|
5
6
|
import { parseJsonOrThrowSource } from './call-lambda-streaming';
|
|
6
7
|
import { cleanItems } from './clean-items';
|
|
7
8
|
import { DEFAULT_CLOUDWATCH_RETENTION_PERIOD, DEFAULT_EPHEMERAL_STORAGE_IN_MB, MAX_EPHEMERAL_STORAGE_IN_MB } from './constants';
|
|
8
9
|
import { convertToServeUrlImplementation } from './convert-to-serve-url';
|
|
9
10
|
import { internalDeleteRender } from './delete-render';
|
|
10
|
-
import { getCloudwatchMethodUrl, getCloudwatchRendererUrl, getS3RenderUrl } from './get-aws-urls';
|
|
11
|
+
import { getCloudwatchMethodUrl, getCloudwatchRendererUrl, getLambdaFunctionUrl, getS3BucketUrl, getS3RenderUrl } from './get-aws-urls';
|
|
11
12
|
import { getEnvVariable } from './get-env-variable';
|
|
12
13
|
import { getS3Client } from './get-s3-client';
|
|
13
14
|
import { internalGetSites } from './get-sites';
|
|
@@ -31,6 +32,7 @@ import { validateServeUrl } from './validate-serveurl';
|
|
|
31
32
|
export type { CustomCredentials, DeleteAfter, WebhookErrorPayload, WebhookPayload, WebhookSuccessPayload, WebhookTimeoutPayload, } from '@remotion/serverless-client';
|
|
32
33
|
export { appRouterWebhook, NextWebhookArgs } from './app-router-webhook';
|
|
33
34
|
export { AwsProvider } from './aws-provider';
|
|
35
|
+
export type { AwsBillingCurrency, AwsPartition, AwsRegionMetadata, } from './aws-region-metadata';
|
|
34
36
|
export type { RenderProgress } from './constants';
|
|
35
37
|
export { deleteFunction, DeleteFunctionInput } from './delete-function';
|
|
36
38
|
export { deleteRender, type DeleteRenderInput } from './delete-render';
|
|
@@ -63,6 +65,8 @@ export declare const LambdaClientInternals: {
|
|
|
63
65
|
parseJsonOrThrowSource: typeof parseJsonOrThrowSource;
|
|
64
66
|
getCloudwatchMethodUrl: typeof getCloudwatchMethodUrl;
|
|
65
67
|
getCloudwatchRendererUrl: typeof getCloudwatchRendererUrl;
|
|
68
|
+
getLambdaFunctionUrl: typeof getLambdaFunctionUrl;
|
|
69
|
+
getS3BucketUrl: typeof getS3BucketUrl;
|
|
66
70
|
MAX_EPHEMERAL_STORAGE_IN_MB: typeof MAX_EPHEMERAL_STORAGE_IN_MB;
|
|
67
71
|
parseFunctionName: typeof parseFunctionName;
|
|
68
72
|
isFlakyError: typeof isFlakyError;
|
|
@@ -92,4 +96,6 @@ export declare const LambdaClientInternals: {
|
|
|
92
96
|
makeLambdaRenderStillPayload: typeof makeLambdaRenderStillPayload;
|
|
93
97
|
getRenderProgressPayload: typeof getRenderProgressPayload;
|
|
94
98
|
innerSpeculateFunctionName: typeof innerSpeculateFunctionName;
|
|
99
|
+
getAwsPartitionMetadata: typeof getAwsPartitionMetadata;
|
|
100
|
+
getAwsRegionMetadata: typeof getAwsRegionMetadata;
|
|
95
101
|
};
|
package/dist/cjs/index.js
CHANGED
|
@@ -72198,7 +72198,7 @@ var validateDownloadBehavior = (downloadBehavior) => {
|
|
|
72198
72198
|
}
|
|
72199
72199
|
}
|
|
72200
72200
|
};
|
|
72201
|
-
var VERSION = "4.0.
|
|
72201
|
+
var VERSION = "4.0.511";
|
|
72202
72202
|
var isColorSupported = () => {
|
|
72203
72203
|
const env = process.env || {};
|
|
72204
72204
|
const isForceDisabled = "NO_COLOR" in env;
|
|
@@ -72722,10 +72722,11 @@ var calculateChunkTimes = ({
|
|
|
72722
72722
|
};
|
|
72723
72723
|
var checkBucketListing = async ({
|
|
72724
72724
|
bucketName,
|
|
72725
|
-
region
|
|
72725
|
+
region,
|
|
72726
|
+
dnsSuffix
|
|
72726
72727
|
}) => {
|
|
72727
72728
|
try {
|
|
72728
|
-
const res = await fetch(`https://${bucketName}.s3.${region}
|
|
72729
|
+
const res = await fetch(`https://${bucketName}.s3.${region}.${dnsSuffix}/`);
|
|
72729
72730
|
if (res.status === 200) {
|
|
72730
72731
|
console.warn(`Warning: Your bucket ${bucketName} allows public listing of its contents. See https://remotion.dev/docs/lambda/bucket-security for how to fix this.`);
|
|
72731
72732
|
}
|
|
@@ -72755,7 +72756,11 @@ var internalGetOrCreateBucket = async (params) => {
|
|
|
72755
72756
|
forcePathStyle: params.forcePathStyle,
|
|
72756
72757
|
requestHandler: params.requestHandler
|
|
72757
72758
|
});
|
|
72758
|
-
await checkBucketListing({
|
|
72759
|
+
await checkBucketListing({
|
|
72760
|
+
bucketName: existingBucketName,
|
|
72761
|
+
region,
|
|
72762
|
+
dnsSuffix: params.providerSpecifics.getServiceDnsSuffix(region)
|
|
72763
|
+
});
|
|
72759
72764
|
return { bucketName: remotionBuckets[0].name, alreadyExisted: true };
|
|
72760
72765
|
}
|
|
72761
72766
|
const bucketName = makeBucketName(params.region, params.providerSpecifics);
|
|
@@ -73612,22 +73617,22 @@ var findOutputFileInBucket = async ({
|
|
|
73612
73617
|
throw err;
|
|
73613
73618
|
}
|
|
73614
73619
|
};
|
|
73615
|
-
var display = (accrued) => {
|
|
73620
|
+
var display = (accrued, currency) => {
|
|
73616
73621
|
if (accrued < 0.001) {
|
|
73617
|
-
return "
|
|
73622
|
+
return `<${currency === "CNY" ? "¥" : "$"}0.001`;
|
|
73618
73623
|
}
|
|
73619
73624
|
return new Intl.NumberFormat("en-US", {
|
|
73620
|
-
currency
|
|
73625
|
+
currency,
|
|
73621
73626
|
style: "currency",
|
|
73622
73627
|
currencyDisplay: "narrowSymbol",
|
|
73623
73628
|
minimumFractionDigits: 3
|
|
73624
73629
|
}).format(accrued);
|
|
73625
73630
|
};
|
|
73626
|
-
var formatCostsInfo = (accrued) => {
|
|
73631
|
+
var formatCostsInfo = (accrued, currency = "USD") => {
|
|
73627
73632
|
return {
|
|
73628
73633
|
accruedSoFar: accrued,
|
|
73629
|
-
displayCost: display(accrued),
|
|
73630
|
-
currency
|
|
73634
|
+
displayCost: display(accrued, currency),
|
|
73635
|
+
currency,
|
|
73631
73636
|
disclaimer: "Estimated cost only. Does not include charges for other AWS services."
|
|
73632
73637
|
};
|
|
73633
73638
|
};
|
|
@@ -73862,6 +73867,7 @@ var getProgress = async ({
|
|
|
73862
73867
|
functionName,
|
|
73863
73868
|
requestHandler
|
|
73864
73869
|
}) => {
|
|
73870
|
+
const billingCurrency = providerSpecifics.getBillingCurrency(region);
|
|
73865
73871
|
const overallProgress = await getOverallProgressFromStorage({
|
|
73866
73872
|
renderId,
|
|
73867
73873
|
bucketName,
|
|
@@ -73957,7 +73963,7 @@ var getProgress = async ({
|
|
|
73957
73963
|
timeToCombine: overallProgress.timeToCombine
|
|
73958
73964
|
},
|
|
73959
73965
|
timeToRenderFrames: overallProgress.timeToRenderFrames,
|
|
73960
|
-
costs: formatCostsInfo(0),
|
|
73966
|
+
costs: formatCostsInfo(0, billingCurrency),
|
|
73961
73967
|
renderId,
|
|
73962
73968
|
renderMetadata,
|
|
73963
73969
|
bucket: bucketName,
|
|
@@ -74051,7 +74057,7 @@ var getProgress = async ({
|
|
|
74051
74057
|
filesDeleted: 0,
|
|
74052
74058
|
minFilesToDelete: 0
|
|
74053
74059
|
},
|
|
74054
|
-
costs: priceFromBucket ? formatCostsInfo(priceFromBucket.accruedSoFar) : formatCostsInfo(0),
|
|
74060
|
+
costs: priceFromBucket ? formatCostsInfo(priceFromBucket.accruedSoFar, billingCurrency) : formatCostsInfo(0, billingCurrency),
|
|
74055
74061
|
currentTime: now,
|
|
74056
74062
|
done: true,
|
|
74057
74063
|
encodingStatus: {
|
|
@@ -74109,7 +74115,7 @@ var getProgress = async ({
|
|
|
74109
74115
|
timeToCombine: overallProgress.timeToCombine
|
|
74110
74116
|
},
|
|
74111
74117
|
timeToRenderFrames: overallProgress.timeToRenderFrames,
|
|
74112
|
-
costs: priceFromBucket ? formatCostsInfo(priceFromBucket.accruedSoFar) : formatCostsInfo(0),
|
|
74118
|
+
costs: priceFromBucket ? formatCostsInfo(priceFromBucket.accruedSoFar, billingCurrency) : formatCostsInfo(0, billingCurrency),
|
|
74113
74119
|
renderId,
|
|
74114
74120
|
renderMetadata,
|
|
74115
74121
|
bucket: bucketName,
|
|
@@ -74491,6 +74497,51 @@ function getStsClient(region, requestHandler) {
|
|
|
74491
74497
|
// src/aws-provider.ts
|
|
74492
74498
|
var import_node_events = require("node:events");
|
|
74493
74499
|
|
|
74500
|
+
// src/aws-region-metadata.ts
|
|
74501
|
+
var regionPartitions = {
|
|
74502
|
+
"af-south-1": "aws",
|
|
74503
|
+
"ap-east-1": "aws",
|
|
74504
|
+
"ap-northeast-1": "aws",
|
|
74505
|
+
"ap-northeast-2": "aws",
|
|
74506
|
+
"ap-northeast-3": "aws",
|
|
74507
|
+
"ap-south-1": "aws",
|
|
74508
|
+
"ap-southeast-1": "aws",
|
|
74509
|
+
"ap-southeast-2": "aws",
|
|
74510
|
+
"ap-southeast-4": "aws",
|
|
74511
|
+
"ap-southeast-5": "aws",
|
|
74512
|
+
"ca-central-1": "aws",
|
|
74513
|
+
"cn-north-1": "aws-cn",
|
|
74514
|
+
"cn-northwest-1": "aws-cn",
|
|
74515
|
+
"eu-central-1": "aws",
|
|
74516
|
+
"eu-central-2": "aws",
|
|
74517
|
+
"eu-north-1": "aws",
|
|
74518
|
+
"eu-south-1": "aws",
|
|
74519
|
+
"eu-west-1": "aws",
|
|
74520
|
+
"eu-west-2": "aws",
|
|
74521
|
+
"eu-west-3": "aws",
|
|
74522
|
+
"sa-east-1": "aws",
|
|
74523
|
+
"us-east-1": "aws",
|
|
74524
|
+
"us-east-2": "aws",
|
|
74525
|
+
"us-west-1": "aws",
|
|
74526
|
+
"us-west-2": "aws"
|
|
74527
|
+
};
|
|
74528
|
+
var partitionMetadata = {
|
|
74529
|
+
aws: {
|
|
74530
|
+
partition: "aws",
|
|
74531
|
+
dnsSuffix: "amazonaws.com",
|
|
74532
|
+
consoleDomain: "console.aws.amazon.com",
|
|
74533
|
+
billingCurrency: "USD"
|
|
74534
|
+
},
|
|
74535
|
+
"aws-cn": {
|
|
74536
|
+
partition: "aws-cn",
|
|
74537
|
+
dnsSuffix: "amazonaws.com.cn",
|
|
74538
|
+
consoleDomain: "console.amazonaws.cn",
|
|
74539
|
+
billingCurrency: "CNY"
|
|
74540
|
+
}
|
|
74541
|
+
};
|
|
74542
|
+
var getAwsPartitionMetadata = (partition) => partitionMetadata[partition];
|
|
74543
|
+
var getAwsRegionMetadata = (region) => getAwsPartitionMetadata(regionPartitions[region]);
|
|
74544
|
+
|
|
74494
74545
|
// src/bucket-exists.ts
|
|
74495
74546
|
var import_client_s32 = __toESM(require_dist_cjs79(), 1);
|
|
74496
74547
|
|
|
@@ -74638,7 +74689,8 @@ var callLambdaWithStreamingWithoutRetry = async ({
|
|
|
74638
74689
|
}
|
|
74639
74690
|
if (event.InvokeComplete) {
|
|
74640
74691
|
if (event.InvokeComplete.ErrorCode) {
|
|
74641
|
-
const
|
|
74692
|
+
const { consoleDomain } = getAwsRegionMetadata(region);
|
|
74693
|
+
const logs = `https://${region}.${consoleDomain}/cloudwatch/home?region=${region}#logsV2:logs-insights$3FqueryDetail$3D~(end~0~start~-3600~timeType~'RELATIVE~unit~'seconds~editorString~'fields*20*40timestamp*2c*20*40requestId*2c*20*40message*0a*7c*20filter*20*40requestId*20like*20*${res.$metadata.requestId}*22*0a*7c*20sort*20*40timestamp*20asc~source~(~'*2faws*2flambda*2f${functionName}))`;
|
|
74642
74694
|
if (event.InvokeComplete.ErrorCode === "Unhandled") {
|
|
74643
74695
|
throw new Error(`Lambda function ${functionName} failed with an unhandled error: ${event.InvokeComplete.ErrorDetails} See ${logs} to see the logs of this invocation.`);
|
|
74644
74696
|
}
|
|
@@ -74735,7 +74787,8 @@ var convertToServeUrlImplementation = ({
|
|
|
74735
74787
|
if (urlOrId.startsWith("http://") || urlOrId.startsWith("https://")) {
|
|
74736
74788
|
return urlOrId;
|
|
74737
74789
|
}
|
|
74738
|
-
|
|
74790
|
+
const { dnsSuffix } = getAwsRegionMetadata(region);
|
|
74791
|
+
return `https://${bucketName}.s3.${region}.${dnsSuffix}/sites/${urlOrId}/index.html`;
|
|
74739
74792
|
};
|
|
74740
74793
|
|
|
74741
74794
|
// src/create-bucket.ts
|
|
@@ -74781,6 +74834,7 @@ var createBucket = async ({ region, bucketName, forcePathStyle, requestHandler }
|
|
|
74781
74834
|
}
|
|
74782
74835
|
let usedBucketPolicy = false;
|
|
74783
74836
|
try {
|
|
74837
|
+
const { partition } = getAwsRegionMetadata(region);
|
|
74784
74838
|
const policy = JSON.stringify({
|
|
74785
74839
|
Version: "2012-10-17",
|
|
74786
74840
|
Statement: [
|
|
@@ -74789,7 +74843,7 @@ var createBucket = async ({ region, bucketName, forcePathStyle, requestHandler }
|
|
|
74789
74843
|
Effect: "Allow",
|
|
74790
74844
|
Principal: "*",
|
|
74791
74845
|
Action: "s3:GetObject",
|
|
74792
|
-
Resource: `arn:
|
|
74846
|
+
Resource: `arn:${partition}:s3:::${bucketName}/*`
|
|
74793
74847
|
}
|
|
74794
74848
|
]
|
|
74795
74849
|
});
|
|
@@ -74859,6 +74913,16 @@ var deleteFunction = async ({
|
|
|
74859
74913
|
|
|
74860
74914
|
// src/price-per-1s.ts
|
|
74861
74915
|
var pricing = {
|
|
74916
|
+
"cn-north-1": {
|
|
74917
|
+
"Lambda Requests": { price: "0.00000136" },
|
|
74918
|
+
"Lambda Duration-ARM": { price: "0.000090800" },
|
|
74919
|
+
"Lambda Storage-Duration-ARM": { price: "0.0000002303" }
|
|
74920
|
+
},
|
|
74921
|
+
"cn-northwest-1": {
|
|
74922
|
+
"Lambda Requests": { price: "0.00000136" },
|
|
74923
|
+
"Lambda Duration-ARM": { price: "0.000090800" },
|
|
74924
|
+
"Lambda Storage-Duration-ARM": { price: "0.0000002049" }
|
|
74925
|
+
},
|
|
74862
74926
|
"af-south-1": {
|
|
74863
74927
|
"Lambda Duration-Provisioned": {
|
|
74864
74928
|
rateCode: "X7CK6KFXNWY9RF6Z.JRTCKXETXF.6YS6EN2CT7",
|
|
@@ -75667,6 +75731,8 @@ var AWS_REGIONS = [
|
|
|
75667
75731
|
"ap-southeast-4",
|
|
75668
75732
|
"ap-southeast-5",
|
|
75669
75733
|
"ca-central-1",
|
|
75734
|
+
"cn-north-1",
|
|
75735
|
+
"cn-northwest-1",
|
|
75670
75736
|
"sa-east-1"
|
|
75671
75737
|
];
|
|
75672
75738
|
|
|
@@ -75770,7 +75836,8 @@ var cloudWatchUrlWithQuery = ({
|
|
|
75770
75836
|
functionNameToUse,
|
|
75771
75837
|
query
|
|
75772
75838
|
}) => {
|
|
75773
|
-
|
|
75839
|
+
const { consoleDomain } = getAwsRegionMetadata(region);
|
|
75840
|
+
return `https://${region}.${consoleDomain}/cloudwatch/home?region=${region}#logsV2:log-groups/log-group/$252Faws$252Flambda$252F${functionNameToUse}/log-events$3FfilterPattern$3D${encodeAwsUrlParams(query)}`;
|
|
75774
75841
|
};
|
|
75775
75842
|
var getCloudwatchMethodUrl = ({
|
|
75776
75843
|
region,
|
|
@@ -75787,7 +75854,8 @@ var getLambdaInsightsUrl = ({
|
|
|
75787
75854
|
region,
|
|
75788
75855
|
functionName
|
|
75789
75856
|
}) => {
|
|
75790
|
-
|
|
75857
|
+
const { consoleDomain } = getAwsRegionMetadata(region);
|
|
75858
|
+
return `https://${region}.${consoleDomain}/cloudwatch/home?region=${region}#lambda-insights:functions/${functionName}`;
|
|
75791
75859
|
};
|
|
75792
75860
|
var getCloudwatchRendererUrl = ({ region, functionName, renderId, rendererFunctionName, chunk }) => {
|
|
75793
75861
|
const functionNameToUse = rendererFunctionName ?? functionName;
|
|
@@ -75799,14 +75867,31 @@ var getS3RenderUrl = ({
|
|
|
75799
75867
|
region,
|
|
75800
75868
|
bucketName
|
|
75801
75869
|
}) => {
|
|
75802
|
-
|
|
75870
|
+
const { consoleDomain, partition } = getAwsRegionMetadata(region);
|
|
75871
|
+
const consoleHost = partition === "aws" ? `s3.${consoleDomain}` : `${region}.${consoleDomain}`;
|
|
75872
|
+
return `https://${consoleHost}/s3/buckets/${bucketName}?region=${region}&prefix=renders/${renderId}/`;
|
|
75803
75873
|
};
|
|
75804
75874
|
var getProgressJsonUrl = ({
|
|
75805
75875
|
region,
|
|
75806
75876
|
bucketName,
|
|
75807
75877
|
renderId
|
|
75808
75878
|
}) => {
|
|
75809
|
-
|
|
75879
|
+
const { consoleDomain } = getAwsRegionMetadata(region);
|
|
75880
|
+
return `https://${region}.${consoleDomain}/s3/object/${bucketName}?region=${region}&bucketType=general&prefix=renders/${renderId}/progress.json`;
|
|
75881
|
+
};
|
|
75882
|
+
var getLambdaFunctionUrl = ({
|
|
75883
|
+
region,
|
|
75884
|
+
functionName
|
|
75885
|
+
}) => {
|
|
75886
|
+
const { consoleDomain } = getAwsRegionMetadata(region);
|
|
75887
|
+
return `https://${region}.${consoleDomain}/lambda/home#/functions/${functionName}?tab=code`;
|
|
75888
|
+
};
|
|
75889
|
+
var getS3BucketUrl = ({
|
|
75890
|
+
region,
|
|
75891
|
+
bucketName
|
|
75892
|
+
}) => {
|
|
75893
|
+
const { consoleDomain } = getAwsRegionMetadata(region);
|
|
75894
|
+
return `https://${region}.${consoleDomain}/s3/buckets/${bucketName}/?region=${region}`;
|
|
75810
75895
|
};
|
|
75811
75896
|
|
|
75812
75897
|
// src/get-buckets.ts
|
|
@@ -75996,8 +76081,9 @@ var getOutputUrlFromMetadata = ({
|
|
|
75996
76081
|
customCredentials,
|
|
75997
76082
|
bucketNamePrefix: REMOTION_BUCKET_PREFIX
|
|
75998
76083
|
});
|
|
76084
|
+
const { dnsSuffix } = getAwsRegionMetadata(currentRegion);
|
|
75999
76085
|
return {
|
|
76000
|
-
url: `https://s3.${currentRegion}
|
|
76086
|
+
url: `https://s3.${currentRegion}.${dnsSuffix}/${renderBucketName}/${key}`,
|
|
76001
76087
|
key
|
|
76002
76088
|
};
|
|
76003
76089
|
};
|
|
@@ -76497,6 +76583,9 @@ var awsImplementation = {
|
|
|
76497
76583
|
return MAX_EPHEMERAL_STORAGE_IN_MB;
|
|
76498
76584
|
},
|
|
76499
76585
|
estimatePrice,
|
|
76586
|
+
getBillingCurrency: (region) => getAwsRegionMetadata(region).billingCurrency,
|
|
76587
|
+
getRendererFunctionTransport: (region) => getAwsRegionMetadata(region).partition === "aws-cn" ? "s3" : "response-streaming",
|
|
76588
|
+
getServiceDnsSuffix: (region) => getAwsRegionMetadata(region).dnsSuffix,
|
|
76500
76589
|
getLoggingUrlForMethod: getCloudwatchMethodUrl,
|
|
76501
76590
|
getLoggingUrlForRendererFunction: getCloudwatchRendererUrl,
|
|
76502
76591
|
isFlakyError,
|
|
@@ -76676,7 +76765,8 @@ var makeS3ServeUrl = ({
|
|
|
76676
76765
|
subFolder,
|
|
76677
76766
|
region
|
|
76678
76767
|
}) => {
|
|
76679
|
-
|
|
76768
|
+
const { dnsSuffix } = getAwsRegionMetadata(region);
|
|
76769
|
+
return `https://${bucketName}.s3.${region}.${dnsSuffix}/${subFolder}/index.html`;
|
|
76680
76770
|
};
|
|
76681
76771
|
|
|
76682
76772
|
// src/get-sites.ts
|
|
@@ -77038,7 +77128,7 @@ var makeLambdaRenderStillPayload = async ({
|
|
|
77038
77128
|
offthreadVideoCacheSizeInBytes,
|
|
77039
77129
|
deleteAfter,
|
|
77040
77130
|
type: ServerlessRoutines.still,
|
|
77041
|
-
streamed:
|
|
77131
|
+
streamed: awsImplementation.getRendererFunctionTransport(region) === "response-streaming",
|
|
77042
77132
|
forcePathStyle,
|
|
77043
77133
|
licenseKey: licenseKey ?? null,
|
|
77044
77134
|
offthreadVideoThreads: offthreadVideoThreads ?? null,
|
|
@@ -77176,7 +77266,7 @@ var innerRenderStillOnLambda = async (input) => {
|
|
|
77176
77266
|
const { functionName, region, onInit } = input;
|
|
77177
77267
|
try {
|
|
77178
77268
|
const payload = await makeLambdaRenderStillPayload(input);
|
|
77179
|
-
const res = await new Promise((resolve, reject) => {
|
|
77269
|
+
const res = payload.streamed ? await new Promise((resolve, reject) => {
|
|
77180
77270
|
awsImplementation.callFunctionStreaming({
|
|
77181
77271
|
functionName,
|
|
77182
77272
|
type: ServerlessRoutines.still,
|
|
@@ -77214,7 +77304,27 @@ var innerRenderStillOnLambda = async (input) => {
|
|
|
77214
77304
|
}).catch((err) => {
|
|
77215
77305
|
reject(err);
|
|
77216
77306
|
});
|
|
77307
|
+
}) : await awsImplementation.callFunctionSync({
|
|
77308
|
+
functionName,
|
|
77309
|
+
type: ServerlessRoutines.still,
|
|
77310
|
+
payload,
|
|
77311
|
+
region,
|
|
77312
|
+
timeoutInTest: 120000,
|
|
77313
|
+
requestHandler: input.requestHandler
|
|
77217
77314
|
});
|
|
77315
|
+
if (!payload.streamed) {
|
|
77316
|
+
onInit?.({
|
|
77317
|
+
renderId: res.renderId,
|
|
77318
|
+
cloudWatchLogs: getCloudwatchMethodUrl({
|
|
77319
|
+
functionName,
|
|
77320
|
+
method: ServerlessRoutines.still,
|
|
77321
|
+
region,
|
|
77322
|
+
rendererFunctionName: null,
|
|
77323
|
+
renderId: res.renderId
|
|
77324
|
+
}),
|
|
77325
|
+
lambdaInsightsUrl: getLambdaInsightsUrl({ functionName, region })
|
|
77326
|
+
});
|
|
77327
|
+
}
|
|
77218
77328
|
return {
|
|
77219
77329
|
estimatedPrice: res.estimatedPrice,
|
|
77220
77330
|
url: res.output,
|
|
@@ -77723,6 +77833,8 @@ var LambdaClientInternals = {
|
|
|
77723
77833
|
parseJsonOrThrowSource,
|
|
77724
77834
|
getCloudwatchMethodUrl,
|
|
77725
77835
|
getCloudwatchRendererUrl,
|
|
77836
|
+
getLambdaFunctionUrl,
|
|
77837
|
+
getS3BucketUrl,
|
|
77726
77838
|
MAX_EPHEMERAL_STORAGE_IN_MB,
|
|
77727
77839
|
parseFunctionName,
|
|
77728
77840
|
isFlakyError,
|
|
@@ -77751,5 +77863,7 @@ var LambdaClientInternals = {
|
|
|
77751
77863
|
cleanItems,
|
|
77752
77864
|
makeLambdaRenderStillPayload,
|
|
77753
77865
|
getRenderProgressPayload,
|
|
77754
|
-
innerSpeculateFunctionName
|
|
77866
|
+
innerSpeculateFunctionName,
|
|
77867
|
+
getAwsPartitionMetadata,
|
|
77868
|
+
getAwsRegionMetadata
|
|
77755
77869
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const makeS3ServeUrl: ({ bucketName, subFolder, region, }: {
|
|
2
2
|
bucketName: string;
|
|
3
3
|
subFolder: string;
|
|
4
|
-
region: "af-south-1" | "ap-east-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-4" | "ap-southeast-5" | "ca-central-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2";
|
|
4
|
+
region: "af-south-1" | "ap-east-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-4" | "ap-southeast-5" | "ca-central-1" | "cn-north-1" | "cn-northwest-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2";
|
|
5
5
|
}) => string;
|
|
@@ -1,37 +1,14 @@
|
|
|
1
1
|
import type { AwsRegion } from './regions';
|
|
2
|
+
type Price = {
|
|
3
|
+
rateCode?: string;
|
|
4
|
+
price: string;
|
|
5
|
+
};
|
|
2
6
|
export declare const pricing: {
|
|
3
7
|
[key in AwsRegion]: {
|
|
4
|
-
'Lambda
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
'Lambda Duration-Provisioned': {
|
|
9
|
-
rateCode: string;
|
|
10
|
-
price: string;
|
|
11
|
-
};
|
|
12
|
-
'Lambda Provisioned-Concurrency': {
|
|
13
|
-
rateCode: string;
|
|
14
|
-
price: string;
|
|
15
|
-
};
|
|
16
|
-
'Lambda Requests': {
|
|
17
|
-
rateCode: string;
|
|
18
|
-
price: string;
|
|
19
|
-
};
|
|
20
|
-
'Lambda Duration-ARM': {
|
|
21
|
-
rateCode: string;
|
|
22
|
-
price: string;
|
|
23
|
-
};
|
|
24
|
-
'Lambda Requests-ARM': {
|
|
25
|
-
rateCode: string;
|
|
26
|
-
price: string;
|
|
27
|
-
};
|
|
28
|
-
'Lambda Storage-Duration': {
|
|
29
|
-
rateCode: string;
|
|
30
|
-
price: string;
|
|
31
|
-
};
|
|
32
|
-
'Lambda Storage-Duration-ARM': {
|
|
33
|
-
rateCode: string;
|
|
34
|
-
price: string;
|
|
35
|
-
};
|
|
8
|
+
'Lambda Requests': Price;
|
|
9
|
+
'Lambda Duration-ARM': Price;
|
|
10
|
+
'Lambda Storage-Duration-ARM': Price;
|
|
11
|
+
[key: string]: Price;
|
|
36
12
|
};
|
|
37
13
|
};
|
|
14
|
+
export {};
|
package/dist/cjs/regions.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const DEFAULT_AWS_REGIONS: readonly ["eu-central-1", "eu-west-1", "eu-west-2", "eu-west-3", "eu-north-1", "us-east-1", "us-east-2", "us-west-1", "us-west-2", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ca-central-1", "sa-east-1"];
|
|
2
|
-
export declare const AWS_REGIONS: readonly ["eu-central-1", "eu-central-2", "eu-west-1", "eu-west-2", "eu-west-3", "eu-south-1", "eu-north-1", "us-east-1", "us-east-2", "us-west-1", "us-west-2", "af-south-1", "ap-south-1", "ap-east-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ap-southeast-4", "ap-southeast-5", "ca-central-1", "sa-east-1"];
|
|
2
|
+
export declare const AWS_REGIONS: readonly ["eu-central-1", "eu-central-2", "eu-west-1", "eu-west-2", "eu-west-3", "eu-south-1", "eu-north-1", "us-east-1", "us-east-2", "us-west-1", "us-west-2", "af-south-1", "ap-south-1", "ap-east-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ap-southeast-4", "ap-southeast-5", "ca-central-1", "cn-north-1", "cn-northwest-1", "sa-east-1"];
|
|
3
3
|
export type AwsRegion = (typeof AWS_REGIONS)[number];
|
package/dist/cjs/regions.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const parseBucketName: (name: string) => {
|
|
2
|
-
region: "af-south-1" | "ap-east-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-4" | "ap-southeast-5" | "ca-central-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2" | null;
|
|
2
|
+
region: "af-south-1" | "ap-east-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-4" | "ap-southeast-5" | "ca-central-1" | "cn-north-1" | "cn-northwest-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2" | null;
|
|
3
3
|
};
|
package/dist/esm/index.mjs
CHANGED
|
@@ -71541,7 +71541,7 @@ var validateDownloadBehavior = (downloadBehavior) => {
|
|
|
71541
71541
|
}
|
|
71542
71542
|
}
|
|
71543
71543
|
};
|
|
71544
|
-
var VERSION = "4.0.
|
|
71544
|
+
var VERSION = "4.0.511";
|
|
71545
71545
|
var isColorSupported = () => {
|
|
71546
71546
|
const env = process.env || {};
|
|
71547
71547
|
const isForceDisabled = "NO_COLOR" in env;
|
|
@@ -72065,10 +72065,11 @@ var calculateChunkTimes = ({
|
|
|
72065
72065
|
};
|
|
72066
72066
|
var checkBucketListing = async ({
|
|
72067
72067
|
bucketName,
|
|
72068
|
-
region
|
|
72068
|
+
region,
|
|
72069
|
+
dnsSuffix
|
|
72069
72070
|
}) => {
|
|
72070
72071
|
try {
|
|
72071
|
-
const res = await fetch(`https://${bucketName}.s3.${region}
|
|
72072
|
+
const res = await fetch(`https://${bucketName}.s3.${region}.${dnsSuffix}/`);
|
|
72072
72073
|
if (res.status === 200) {
|
|
72073
72074
|
console.warn(`Warning: Your bucket ${bucketName} allows public listing of its contents. See https://remotion.dev/docs/lambda/bucket-security for how to fix this.`);
|
|
72074
72075
|
}
|
|
@@ -72098,7 +72099,11 @@ var internalGetOrCreateBucket = async (params) => {
|
|
|
72098
72099
|
forcePathStyle: params.forcePathStyle,
|
|
72099
72100
|
requestHandler: params.requestHandler
|
|
72100
72101
|
});
|
|
72101
|
-
await checkBucketListing({
|
|
72102
|
+
await checkBucketListing({
|
|
72103
|
+
bucketName: existingBucketName,
|
|
72104
|
+
region,
|
|
72105
|
+
dnsSuffix: params.providerSpecifics.getServiceDnsSuffix(region)
|
|
72106
|
+
});
|
|
72102
72107
|
return { bucketName: remotionBuckets[0].name, alreadyExisted: true };
|
|
72103
72108
|
}
|
|
72104
72109
|
const bucketName = makeBucketName(params.region, params.providerSpecifics);
|
|
@@ -72955,22 +72960,22 @@ var findOutputFileInBucket = async ({
|
|
|
72955
72960
|
throw err;
|
|
72956
72961
|
}
|
|
72957
72962
|
};
|
|
72958
|
-
var display = (accrued) => {
|
|
72963
|
+
var display = (accrued, currency) => {
|
|
72959
72964
|
if (accrued < 0.001) {
|
|
72960
|
-
return "
|
|
72965
|
+
return `<${currency === "CNY" ? "¥" : "$"}0.001`;
|
|
72961
72966
|
}
|
|
72962
72967
|
return new Intl.NumberFormat("en-US", {
|
|
72963
|
-
currency
|
|
72968
|
+
currency,
|
|
72964
72969
|
style: "currency",
|
|
72965
72970
|
currencyDisplay: "narrowSymbol",
|
|
72966
72971
|
minimumFractionDigits: 3
|
|
72967
72972
|
}).format(accrued);
|
|
72968
72973
|
};
|
|
72969
|
-
var formatCostsInfo = (accrued) => {
|
|
72974
|
+
var formatCostsInfo = (accrued, currency = "USD") => {
|
|
72970
72975
|
return {
|
|
72971
72976
|
accruedSoFar: accrued,
|
|
72972
|
-
displayCost: display(accrued),
|
|
72973
|
-
currency
|
|
72977
|
+
displayCost: display(accrued, currency),
|
|
72978
|
+
currency,
|
|
72974
72979
|
disclaimer: "Estimated cost only. Does not include charges for other AWS services."
|
|
72975
72980
|
};
|
|
72976
72981
|
};
|
|
@@ -73205,6 +73210,7 @@ var getProgress = async ({
|
|
|
73205
73210
|
functionName,
|
|
73206
73211
|
requestHandler
|
|
73207
73212
|
}) => {
|
|
73213
|
+
const billingCurrency = providerSpecifics.getBillingCurrency(region);
|
|
73208
73214
|
const overallProgress = await getOverallProgressFromStorage({
|
|
73209
73215
|
renderId,
|
|
73210
73216
|
bucketName,
|
|
@@ -73300,7 +73306,7 @@ var getProgress = async ({
|
|
|
73300
73306
|
timeToCombine: overallProgress.timeToCombine
|
|
73301
73307
|
},
|
|
73302
73308
|
timeToRenderFrames: overallProgress.timeToRenderFrames,
|
|
73303
|
-
costs: formatCostsInfo(0),
|
|
73309
|
+
costs: formatCostsInfo(0, billingCurrency),
|
|
73304
73310
|
renderId,
|
|
73305
73311
|
renderMetadata,
|
|
73306
73312
|
bucket: bucketName,
|
|
@@ -73394,7 +73400,7 @@ var getProgress = async ({
|
|
|
73394
73400
|
filesDeleted: 0,
|
|
73395
73401
|
minFilesToDelete: 0
|
|
73396
73402
|
},
|
|
73397
|
-
costs: priceFromBucket ? formatCostsInfo(priceFromBucket.accruedSoFar) : formatCostsInfo(0),
|
|
73403
|
+
costs: priceFromBucket ? formatCostsInfo(priceFromBucket.accruedSoFar, billingCurrency) : formatCostsInfo(0, billingCurrency),
|
|
73398
73404
|
currentTime: now,
|
|
73399
73405
|
done: true,
|
|
73400
73406
|
encodingStatus: {
|
|
@@ -73452,7 +73458,7 @@ var getProgress = async ({
|
|
|
73452
73458
|
timeToCombine: overallProgress.timeToCombine
|
|
73453
73459
|
},
|
|
73454
73460
|
timeToRenderFrames: overallProgress.timeToRenderFrames,
|
|
73455
|
-
costs: priceFromBucket ? formatCostsInfo(priceFromBucket.accruedSoFar) : formatCostsInfo(0),
|
|
73461
|
+
costs: priceFromBucket ? formatCostsInfo(priceFromBucket.accruedSoFar, billingCurrency) : formatCostsInfo(0, billingCurrency),
|
|
73456
73462
|
renderId,
|
|
73457
73463
|
renderMetadata,
|
|
73458
73464
|
bucket: bucketName,
|
|
@@ -73834,6 +73840,51 @@ function getStsClient(region, requestHandler) {
|
|
|
73834
73840
|
// src/aws-provider.ts
|
|
73835
73841
|
import { EventEmitter } from "node:events";
|
|
73836
73842
|
|
|
73843
|
+
// src/aws-region-metadata.ts
|
|
73844
|
+
var regionPartitions = {
|
|
73845
|
+
"af-south-1": "aws",
|
|
73846
|
+
"ap-east-1": "aws",
|
|
73847
|
+
"ap-northeast-1": "aws",
|
|
73848
|
+
"ap-northeast-2": "aws",
|
|
73849
|
+
"ap-northeast-3": "aws",
|
|
73850
|
+
"ap-south-1": "aws",
|
|
73851
|
+
"ap-southeast-1": "aws",
|
|
73852
|
+
"ap-southeast-2": "aws",
|
|
73853
|
+
"ap-southeast-4": "aws",
|
|
73854
|
+
"ap-southeast-5": "aws",
|
|
73855
|
+
"ca-central-1": "aws",
|
|
73856
|
+
"cn-north-1": "aws-cn",
|
|
73857
|
+
"cn-northwest-1": "aws-cn",
|
|
73858
|
+
"eu-central-1": "aws",
|
|
73859
|
+
"eu-central-2": "aws",
|
|
73860
|
+
"eu-north-1": "aws",
|
|
73861
|
+
"eu-south-1": "aws",
|
|
73862
|
+
"eu-west-1": "aws",
|
|
73863
|
+
"eu-west-2": "aws",
|
|
73864
|
+
"eu-west-3": "aws",
|
|
73865
|
+
"sa-east-1": "aws",
|
|
73866
|
+
"us-east-1": "aws",
|
|
73867
|
+
"us-east-2": "aws",
|
|
73868
|
+
"us-west-1": "aws",
|
|
73869
|
+
"us-west-2": "aws"
|
|
73870
|
+
};
|
|
73871
|
+
var partitionMetadata = {
|
|
73872
|
+
aws: {
|
|
73873
|
+
partition: "aws",
|
|
73874
|
+
dnsSuffix: "amazonaws.com",
|
|
73875
|
+
consoleDomain: "console.aws.amazon.com",
|
|
73876
|
+
billingCurrency: "USD"
|
|
73877
|
+
},
|
|
73878
|
+
"aws-cn": {
|
|
73879
|
+
partition: "aws-cn",
|
|
73880
|
+
dnsSuffix: "amazonaws.com.cn",
|
|
73881
|
+
consoleDomain: "console.amazonaws.cn",
|
|
73882
|
+
billingCurrency: "CNY"
|
|
73883
|
+
}
|
|
73884
|
+
};
|
|
73885
|
+
var getAwsPartitionMetadata = (partition) => partitionMetadata[partition];
|
|
73886
|
+
var getAwsRegionMetadata = (region) => getAwsPartitionMetadata(regionPartitions[region]);
|
|
73887
|
+
|
|
73837
73888
|
// src/bucket-exists.ts
|
|
73838
73889
|
var import_client_s32 = __toESM(require_dist_cjs79(), 1);
|
|
73839
73890
|
|
|
@@ -73981,7 +74032,8 @@ var callLambdaWithStreamingWithoutRetry = async ({
|
|
|
73981
74032
|
}
|
|
73982
74033
|
if (event.InvokeComplete) {
|
|
73983
74034
|
if (event.InvokeComplete.ErrorCode) {
|
|
73984
|
-
const
|
|
74035
|
+
const { consoleDomain } = getAwsRegionMetadata(region);
|
|
74036
|
+
const logs = `https://${region}.${consoleDomain}/cloudwatch/home?region=${region}#logsV2:logs-insights$3FqueryDetail$3D~(end~0~start~-3600~timeType~'RELATIVE~unit~'seconds~editorString~'fields*20*40timestamp*2c*20*40requestId*2c*20*40message*0a*7c*20filter*20*40requestId*20like*20*${res.$metadata.requestId}*22*0a*7c*20sort*20*40timestamp*20asc~source~(~'*2faws*2flambda*2f${functionName}))`;
|
|
73985
74037
|
if (event.InvokeComplete.ErrorCode === "Unhandled") {
|
|
73986
74038
|
throw new Error(`Lambda function ${functionName} failed with an unhandled error: ${event.InvokeComplete.ErrorDetails} See ${logs} to see the logs of this invocation.`);
|
|
73987
74039
|
}
|
|
@@ -74078,7 +74130,8 @@ var convertToServeUrlImplementation = ({
|
|
|
74078
74130
|
if (urlOrId.startsWith("http://") || urlOrId.startsWith("https://")) {
|
|
74079
74131
|
return urlOrId;
|
|
74080
74132
|
}
|
|
74081
|
-
|
|
74133
|
+
const { dnsSuffix } = getAwsRegionMetadata(region);
|
|
74134
|
+
return `https://${bucketName}.s3.${region}.${dnsSuffix}/sites/${urlOrId}/index.html`;
|
|
74082
74135
|
};
|
|
74083
74136
|
|
|
74084
74137
|
// src/create-bucket.ts
|
|
@@ -74124,6 +74177,7 @@ var createBucket = async ({ region, bucketName, forcePathStyle, requestHandler }
|
|
|
74124
74177
|
}
|
|
74125
74178
|
let usedBucketPolicy = false;
|
|
74126
74179
|
try {
|
|
74180
|
+
const { partition } = getAwsRegionMetadata(region);
|
|
74127
74181
|
const policy = JSON.stringify({
|
|
74128
74182
|
Version: "2012-10-17",
|
|
74129
74183
|
Statement: [
|
|
@@ -74132,7 +74186,7 @@ var createBucket = async ({ region, bucketName, forcePathStyle, requestHandler }
|
|
|
74132
74186
|
Effect: "Allow",
|
|
74133
74187
|
Principal: "*",
|
|
74134
74188
|
Action: "s3:GetObject",
|
|
74135
|
-
Resource: `arn:
|
|
74189
|
+
Resource: `arn:${partition}:s3:::${bucketName}/*`
|
|
74136
74190
|
}
|
|
74137
74191
|
]
|
|
74138
74192
|
});
|
|
@@ -74202,6 +74256,16 @@ var deleteFunction = async ({
|
|
|
74202
74256
|
|
|
74203
74257
|
// src/price-per-1s.ts
|
|
74204
74258
|
var pricing = {
|
|
74259
|
+
"cn-north-1": {
|
|
74260
|
+
"Lambda Requests": { price: "0.00000136" },
|
|
74261
|
+
"Lambda Duration-ARM": { price: "0.000090800" },
|
|
74262
|
+
"Lambda Storage-Duration-ARM": { price: "0.0000002303" }
|
|
74263
|
+
},
|
|
74264
|
+
"cn-northwest-1": {
|
|
74265
|
+
"Lambda Requests": { price: "0.00000136" },
|
|
74266
|
+
"Lambda Duration-ARM": { price: "0.000090800" },
|
|
74267
|
+
"Lambda Storage-Duration-ARM": { price: "0.0000002049" }
|
|
74268
|
+
},
|
|
74205
74269
|
"af-south-1": {
|
|
74206
74270
|
"Lambda Duration-Provisioned": {
|
|
74207
74271
|
rateCode: "X7CK6KFXNWY9RF6Z.JRTCKXETXF.6YS6EN2CT7",
|
|
@@ -75010,6 +75074,8 @@ var AWS_REGIONS = [
|
|
|
75010
75074
|
"ap-southeast-4",
|
|
75011
75075
|
"ap-southeast-5",
|
|
75012
75076
|
"ca-central-1",
|
|
75077
|
+
"cn-north-1",
|
|
75078
|
+
"cn-northwest-1",
|
|
75013
75079
|
"sa-east-1"
|
|
75014
75080
|
];
|
|
75015
75081
|
|
|
@@ -75113,7 +75179,8 @@ var cloudWatchUrlWithQuery = ({
|
|
|
75113
75179
|
functionNameToUse,
|
|
75114
75180
|
query
|
|
75115
75181
|
}) => {
|
|
75116
|
-
|
|
75182
|
+
const { consoleDomain } = getAwsRegionMetadata(region);
|
|
75183
|
+
return `https://${region}.${consoleDomain}/cloudwatch/home?region=${region}#logsV2:log-groups/log-group/$252Faws$252Flambda$252F${functionNameToUse}/log-events$3FfilterPattern$3D${encodeAwsUrlParams(query)}`;
|
|
75117
75184
|
};
|
|
75118
75185
|
var getCloudwatchMethodUrl = ({
|
|
75119
75186
|
region,
|
|
@@ -75130,7 +75197,8 @@ var getLambdaInsightsUrl = ({
|
|
|
75130
75197
|
region,
|
|
75131
75198
|
functionName
|
|
75132
75199
|
}) => {
|
|
75133
|
-
|
|
75200
|
+
const { consoleDomain } = getAwsRegionMetadata(region);
|
|
75201
|
+
return `https://${region}.${consoleDomain}/cloudwatch/home?region=${region}#lambda-insights:functions/${functionName}`;
|
|
75134
75202
|
};
|
|
75135
75203
|
var getCloudwatchRendererUrl = ({ region, functionName, renderId, rendererFunctionName, chunk }) => {
|
|
75136
75204
|
const functionNameToUse = rendererFunctionName ?? functionName;
|
|
@@ -75142,14 +75210,31 @@ var getS3RenderUrl = ({
|
|
|
75142
75210
|
region,
|
|
75143
75211
|
bucketName
|
|
75144
75212
|
}) => {
|
|
75145
|
-
|
|
75213
|
+
const { consoleDomain, partition } = getAwsRegionMetadata(region);
|
|
75214
|
+
const consoleHost = partition === "aws" ? `s3.${consoleDomain}` : `${region}.${consoleDomain}`;
|
|
75215
|
+
return `https://${consoleHost}/s3/buckets/${bucketName}?region=${region}&prefix=renders/${renderId}/`;
|
|
75146
75216
|
};
|
|
75147
75217
|
var getProgressJsonUrl = ({
|
|
75148
75218
|
region,
|
|
75149
75219
|
bucketName,
|
|
75150
75220
|
renderId
|
|
75151
75221
|
}) => {
|
|
75152
|
-
|
|
75222
|
+
const { consoleDomain } = getAwsRegionMetadata(region);
|
|
75223
|
+
return `https://${region}.${consoleDomain}/s3/object/${bucketName}?region=${region}&bucketType=general&prefix=renders/${renderId}/progress.json`;
|
|
75224
|
+
};
|
|
75225
|
+
var getLambdaFunctionUrl = ({
|
|
75226
|
+
region,
|
|
75227
|
+
functionName
|
|
75228
|
+
}) => {
|
|
75229
|
+
const { consoleDomain } = getAwsRegionMetadata(region);
|
|
75230
|
+
return `https://${region}.${consoleDomain}/lambda/home#/functions/${functionName}?tab=code`;
|
|
75231
|
+
};
|
|
75232
|
+
var getS3BucketUrl = ({
|
|
75233
|
+
region,
|
|
75234
|
+
bucketName
|
|
75235
|
+
}) => {
|
|
75236
|
+
const { consoleDomain } = getAwsRegionMetadata(region);
|
|
75237
|
+
return `https://${region}.${consoleDomain}/s3/buckets/${bucketName}/?region=${region}`;
|
|
75153
75238
|
};
|
|
75154
75239
|
|
|
75155
75240
|
// src/get-buckets.ts
|
|
@@ -75339,8 +75424,9 @@ var getOutputUrlFromMetadata = ({
|
|
|
75339
75424
|
customCredentials,
|
|
75340
75425
|
bucketNamePrefix: REMOTION_BUCKET_PREFIX
|
|
75341
75426
|
});
|
|
75427
|
+
const { dnsSuffix } = getAwsRegionMetadata(currentRegion);
|
|
75342
75428
|
return {
|
|
75343
|
-
url: `https://s3.${currentRegion}
|
|
75429
|
+
url: `https://s3.${currentRegion}.${dnsSuffix}/${renderBucketName}/${key}`,
|
|
75344
75430
|
key
|
|
75345
75431
|
};
|
|
75346
75432
|
};
|
|
@@ -76324,6 +76410,9 @@ var awsImplementation = {
|
|
|
76324
76410
|
return MAX_EPHEMERAL_STORAGE_IN_MB;
|
|
76325
76411
|
},
|
|
76326
76412
|
estimatePrice,
|
|
76413
|
+
getBillingCurrency: (region) => getAwsRegionMetadata(region).billingCurrency,
|
|
76414
|
+
getRendererFunctionTransport: (region) => getAwsRegionMetadata(region).partition === "aws-cn" ? "s3" : "response-streaming",
|
|
76415
|
+
getServiceDnsSuffix: (region) => getAwsRegionMetadata(region).dnsSuffix,
|
|
76327
76416
|
getLoggingUrlForMethod: getCloudwatchMethodUrl,
|
|
76328
76417
|
getLoggingUrlForRendererFunction: getCloudwatchRendererUrl,
|
|
76329
76418
|
isFlakyError,
|
|
@@ -76503,7 +76592,8 @@ var makeS3ServeUrl = ({
|
|
|
76503
76592
|
subFolder,
|
|
76504
76593
|
region
|
|
76505
76594
|
}) => {
|
|
76506
|
-
|
|
76595
|
+
const { dnsSuffix } = getAwsRegionMetadata(region);
|
|
76596
|
+
return `https://${bucketName}.s3.${region}.${dnsSuffix}/${subFolder}/index.html`;
|
|
76507
76597
|
};
|
|
76508
76598
|
|
|
76509
76599
|
// src/get-sites.ts
|
|
@@ -76865,7 +76955,7 @@ var makeLambdaRenderStillPayload = async ({
|
|
|
76865
76955
|
offthreadVideoCacheSizeInBytes,
|
|
76866
76956
|
deleteAfter,
|
|
76867
76957
|
type: ServerlessRoutines.still,
|
|
76868
|
-
streamed:
|
|
76958
|
+
streamed: awsImplementation.getRendererFunctionTransport(region) === "response-streaming",
|
|
76869
76959
|
forcePathStyle,
|
|
76870
76960
|
licenseKey: licenseKey ?? null,
|
|
76871
76961
|
offthreadVideoThreads: offthreadVideoThreads ?? null,
|
|
@@ -77003,7 +77093,7 @@ var innerRenderStillOnLambda = async (input) => {
|
|
|
77003
77093
|
const { functionName, region, onInit } = input;
|
|
77004
77094
|
try {
|
|
77005
77095
|
const payload = await makeLambdaRenderStillPayload(input);
|
|
77006
|
-
const res = await new Promise((resolve, reject) => {
|
|
77096
|
+
const res = payload.streamed ? await new Promise((resolve, reject) => {
|
|
77007
77097
|
awsImplementation.callFunctionStreaming({
|
|
77008
77098
|
functionName,
|
|
77009
77099
|
type: ServerlessRoutines.still,
|
|
@@ -77041,7 +77131,27 @@ var innerRenderStillOnLambda = async (input) => {
|
|
|
77041
77131
|
}).catch((err) => {
|
|
77042
77132
|
reject(err);
|
|
77043
77133
|
});
|
|
77134
|
+
}) : await awsImplementation.callFunctionSync({
|
|
77135
|
+
functionName,
|
|
77136
|
+
type: ServerlessRoutines.still,
|
|
77137
|
+
payload,
|
|
77138
|
+
region,
|
|
77139
|
+
timeoutInTest: 120000,
|
|
77140
|
+
requestHandler: input.requestHandler
|
|
77044
77141
|
});
|
|
77142
|
+
if (!payload.streamed) {
|
|
77143
|
+
onInit?.({
|
|
77144
|
+
renderId: res.renderId,
|
|
77145
|
+
cloudWatchLogs: getCloudwatchMethodUrl({
|
|
77146
|
+
functionName,
|
|
77147
|
+
method: ServerlessRoutines.still,
|
|
77148
|
+
region,
|
|
77149
|
+
rendererFunctionName: null,
|
|
77150
|
+
renderId: res.renderId
|
|
77151
|
+
}),
|
|
77152
|
+
lambdaInsightsUrl: getLambdaInsightsUrl({ functionName, region })
|
|
77153
|
+
});
|
|
77154
|
+
}
|
|
77045
77155
|
return {
|
|
77046
77156
|
estimatedPrice: res.estimatedPrice,
|
|
77047
77157
|
url: res.output,
|
|
@@ -77671,6 +77781,8 @@ var LambdaClientInternals = {
|
|
|
77671
77781
|
parseJsonOrThrowSource,
|
|
77672
77782
|
getCloudwatchMethodUrl,
|
|
77673
77783
|
getCloudwatchRendererUrl,
|
|
77784
|
+
getLambdaFunctionUrl,
|
|
77785
|
+
getS3BucketUrl,
|
|
77674
77786
|
MAX_EPHEMERAL_STORAGE_IN_MB,
|
|
77675
77787
|
parseFunctionName,
|
|
77676
77788
|
isFlakyError,
|
|
@@ -77699,7 +77811,9 @@ var LambdaClientInternals = {
|
|
|
77699
77811
|
cleanItems,
|
|
77700
77812
|
makeLambdaRenderStillPayload,
|
|
77701
77813
|
getRenderProgressPayload,
|
|
77702
|
-
innerSpeculateFunctionName
|
|
77814
|
+
innerSpeculateFunctionName,
|
|
77815
|
+
getAwsPartitionMetadata,
|
|
77816
|
+
getAwsRegionMetadata
|
|
77703
77817
|
};
|
|
77704
77818
|
export {
|
|
77705
77819
|
validateWebhookSignature,
|
package/dist/esm/regions.mjs
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/lambda-client"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/lambda-client",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.511",
|
|
7
7
|
"main": "dist/cjs/index.js",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"formatting": "oxfmt src --check",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"@aws-sdk/lib-storage": "3.986.0",
|
|
27
27
|
"mime-types": "2.1.34",
|
|
28
28
|
"@aws-sdk/credential-provider-ini": "3.972.5",
|
|
29
|
-
"@remotion/serverless-client": "4.0.
|
|
29
|
+
"@remotion/serverless-client": "4.0.511",
|
|
30
30
|
"@types/express": "5.0.1",
|
|
31
31
|
"express": "4.21.0",
|
|
32
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
32
|
+
"@remotion/eslint-config-internal": "4.0.511",
|
|
33
33
|
"eslint": "9.19.0",
|
|
34
34
|
"next": "16.2.11",
|
|
35
35
|
"@types/mime-types": "2.1.1",
|