@remotion/lambda-client 4.0.370 → 4.0.371
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/index.js +1 -1
- package/dist/esm/index.mjs +1 -1
- package/package.json +3 -3
- package/dist/app-router-webhook.d.ts +0 -10
- package/dist/app-router-webhook.js +0 -51
- package/dist/apply-lifecycle.d.ts +0 -8
- package/dist/apply-lifecycle.js +0 -18
- package/dist/aws-clients.d.ts +0 -12
- package/dist/aws-clients.js +0 -56
- package/dist/aws-provider.d.ts +0 -27
- package/dist/aws-provider.js +0 -94
- package/dist/bucket-exists.d.ts +0 -3
- package/dist/bucket-exists.js +0 -27
- package/dist/call-lambda-async.d.ts +0 -2
- package/dist/call-lambda-async.js +0 -20
- package/dist/call-lambda-streaming.d.ts +0 -6
- package/dist/call-lambda-streaming.js +0 -126
- package/dist/call-lambda-sync.d.ts +0 -2
- package/dist/call-lambda-sync.js +0 -30
- package/dist/check-credentials.d.ts +0 -1
- package/dist/check-credentials.js +0 -39
- package/dist/clean-items.d.ts +0 -17
- package/dist/clean-items.js +0 -26
- package/dist/constants.d.ts +0 -25
- package/dist/constants.js +0 -26
- package/dist/content-disposition-header.d.ts +0 -2
- package/dist/content-disposition-header.js +0 -50
- package/dist/convert-to-serve-url.d.ts +0 -6
- package/dist/convert-to-serve-url.js +0 -14
- package/dist/create-bucket.d.ts +0 -3
- package/dist/create-bucket.js +0 -65
- package/dist/delete-file.d.ts +0 -3
- package/dist/delete-file.js +0 -17
- package/dist/delete-function.d.ts +0 -7
- package/dist/delete-function.js +0 -15
- package/dist/delete-render.d.ts +0 -22
- package/dist/delete-render.js +0 -90
- package/dist/encode-aws-url-params.d.ts +0 -1
- package/dist/encode-aws-url-params.js +0 -7
- package/dist/estimate-price.d.ts +0 -17
- package/dist/estimate-price.js +0 -45
- package/dist/express-webhook.d.ts +0 -3
- package/dist/express-webhook.js +0 -54
- package/dist/get-account-id.d.ts +0 -3
- package/dist/get-account-id.js +0 -15
- package/dist/get-aws-client.d.ts +0 -32
- package/dist/get-aws-client.js +0 -67
- package/dist/get-aws-urls.d.ts +0 -25
- package/dist/get-aws-urls.js +0 -31
- package/dist/get-buckets.d.ts +0 -9
- package/dist/get-buckets.js +0 -64
- package/dist/get-compositions-on-lambda.d.ts +0 -20
- package/dist/get-compositions-on-lambda.js +0 -62
- package/dist/get-credentials.d.ts +0 -9
- package/dist/get-credentials.js +0 -55
- package/dist/get-env-variable.d.ts +0 -1
- package/dist/get-env-variable.js +0 -15
- package/dist/get-function-name.d.ts +0 -8
- package/dist/get-function-name.js +0 -17
- package/dist/get-function-version.d.ts +0 -9
- package/dist/get-function-version.js +0 -35
- package/dist/get-functions.d.ts +0 -10
- package/dist/get-functions.js +0 -80
- package/dist/get-output-url-from-metadata.d.ts +0 -3
- package/dist/get-output-url-from-metadata.js +0 -18
- package/dist/get-render-progress.d.ts +0 -17
- package/dist/get-render-progress.js +0 -47
- package/dist/get-s3-client.d.ts +0 -11
- package/dist/get-s3-client.js +0 -15
- package/dist/get-service-client.d.ts +0 -25
- package/dist/get-service-client.js +0 -131
- package/dist/get-sites.d.ts +0 -31
- package/dist/get-sites.js +0 -83
- package/dist/head-file.d.ts +0 -3
- package/dist/head-file.js +0 -18
- package/dist/index.d.ts +0 -129
- package/dist/index.js +0 -108
- package/dist/is-cli.d.ts +0 -2
- package/dist/is-cli.js +0 -10
- package/dist/is-flaky-error.d.ts +0 -1
- package/dist/is-flaky-error.js +0 -78
- package/dist/is-in-lambda.d.ts +0 -1
- package/dist/is-in-lambda.js +0 -9
- package/dist/is-likely-to-have-aws-profile.d.ts +0 -1
- package/dist/is-likely-to-have-aws-profile.js +0 -50
- package/dist/lambda-version-string.d.ts +0 -1
- package/dist/lambda-version-string.js +0 -7
- package/dist/lifecycle-rules.d.ts +0 -12
- package/dist/lifecycle-rules.js +0 -73
- package/dist/lifecycle.d.ts +0 -7
- package/dist/lifecycle.js +0 -24
- package/dist/list-objects.d.ts +0 -3
- package/dist/list-objects.js +0 -70
- package/dist/make-lambda-payload.d.ts +0 -59
- package/dist/make-lambda-payload.js +0 -150
- package/dist/make-s3-url.d.ts +0 -6
- package/dist/make-s3-url.js +0 -7
- package/dist/p-limit.d.ts +0 -1
- package/dist/p-limit.js +0 -57
- package/dist/pages-router-webhook.d.ts +0 -5
- package/dist/pages-router-webhook.js +0 -56
- package/dist/parse-function-name.d.ts +0 -8
- package/dist/parse-function-name.js +0 -17
- package/dist/presign-url.d.ts +0 -17
- package/dist/presign-url.js +0 -66
- package/dist/price-per-1s.d.ts +0 -37
- package/dist/price-per-1s.js +0 -822
- package/dist/random-hash.d.ts +0 -1
- package/dist/random-hash.js +0 -13
- package/dist/read-file.d.ts +0 -11
- package/dist/read-file.js +0 -19
- package/dist/regions.d.ts +0 -3
- package/dist/regions.js +0 -48
- package/dist/render-media-on-lambda.d.ts +0 -66
- package/dist/render-media-on-lambda.js +0 -133
- package/dist/render-still-on-lambda.d.ts +0 -61
- package/dist/render-still-on-lambda.js +0 -121
- package/dist/runtime-preference.d.ts +0 -2
- package/dist/runtime-preference.js +0 -8
- package/dist/speculate-function-name.d.ts +0 -7
- package/dist/speculate-function-name.js +0 -39
- package/dist/types.d.ts +0 -4
- package/dist/types.js +0 -2
- package/dist/validate-aws-region.d.ts +0 -2
- package/dist/validate-aws-region.js +0 -9
- package/dist/validate-bucketname.d.ts +0 -4
- package/dist/validate-bucketname.js +0 -15
- package/dist/validate-disk-size-in-mb.d.ts +0 -1
- package/dist/validate-disk-size-in-mb.js +0 -23
- package/dist/validate-lambda-codec.d.ts +0 -2
- package/dist/validate-lambda-codec.js +0 -21
- package/dist/validate-memory-size.d.ts +0 -1
- package/dist/validate-memory-size.js +0 -22
- package/dist/validate-presign-expiration.d.ts +0 -1
- package/dist/validate-presign-expiration.js +0 -29
- package/dist/validate-serveurl.d.ts +0 -1
- package/dist/validate-serveurl.js +0 -9
- package/dist/validate-webhook-signature.d.ts +0 -5
- package/dist/validate-webhook-signature.js +0 -28
- package/dist/write-file.d.ts +0 -5
- package/dist/write-file.js +0 -83
package/dist/get-aws-urls.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getProgressJsonUrl = exports.getS3RenderUrl = exports.getCloudwatchRendererUrl = exports.getLambdaInsightsUrl = exports.getCloudwatchMethodUrl = void 0;
|
|
4
|
-
const encode_aws_url_params_1 = require("./encode-aws-url-params");
|
|
5
|
-
const cloudWatchUrlWithQuery = ({ region, functionNameToUse, query, }) => {
|
|
6
|
-
return `https://${region}.console.aws.amazon.com/cloudwatch/home?region=${region}#logsV2:log-groups/log-group/$252Faws$252Flambda$252F${functionNameToUse}/log-events$3FfilterPattern$3D${(0, encode_aws_url_params_1.encodeAwsUrlParams)(query)}`;
|
|
7
|
-
};
|
|
8
|
-
const getCloudwatchMethodUrl = ({ region, functionName, renderId, rendererFunctionName, method, }) => {
|
|
9
|
-
const functionNameToUse = rendererFunctionName !== null && rendererFunctionName !== void 0 ? rendererFunctionName : functionName;
|
|
10
|
-
const query = `"method=${method},renderId=${renderId}"`;
|
|
11
|
-
return cloudWatchUrlWithQuery({ region, functionNameToUse, query });
|
|
12
|
-
};
|
|
13
|
-
exports.getCloudwatchMethodUrl = getCloudwatchMethodUrl;
|
|
14
|
-
const getLambdaInsightsUrl = ({ region, functionName, }) => {
|
|
15
|
-
return `https://${region}.console.aws.amazon.com/cloudwatch/home?region=${region}#lambda-insights:functions/${functionName}`;
|
|
16
|
-
};
|
|
17
|
-
exports.getLambdaInsightsUrl = getLambdaInsightsUrl;
|
|
18
|
-
const getCloudwatchRendererUrl = ({ region, functionName, renderId, rendererFunctionName, chunk }) => {
|
|
19
|
-
const functionNameToUse = rendererFunctionName !== null && rendererFunctionName !== void 0 ? rendererFunctionName : functionName;
|
|
20
|
-
const query = `"method=renderer,renderId=${renderId}${chunk === null ? '' : `,chunk=${chunk},`}"`;
|
|
21
|
-
return cloudWatchUrlWithQuery({ region, functionNameToUse, query });
|
|
22
|
-
};
|
|
23
|
-
exports.getCloudwatchRendererUrl = getCloudwatchRendererUrl;
|
|
24
|
-
const getS3RenderUrl = ({ renderId, region, bucketName, }) => {
|
|
25
|
-
return `https://s3.console.aws.amazon.com/s3/buckets/${bucketName}?region=${region}&prefix=renders/${renderId}/`;
|
|
26
|
-
};
|
|
27
|
-
exports.getS3RenderUrl = getS3RenderUrl;
|
|
28
|
-
const getProgressJsonUrl = ({ region, bucketName, renderId, }) => {
|
|
29
|
-
return `https://${region}.console.aws.amazon.com/s3/object/${bucketName}?region=${region}&bucketType=general&prefix=renders/${renderId}/progress.json`;
|
|
30
|
-
};
|
|
31
|
-
exports.getProgressJsonUrl = getProgressJsonUrl;
|
package/dist/get-buckets.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ProviderSpecifics } from '@remotion/serverless-client';
|
|
2
|
-
import type { AwsProvider } from './aws-provider';
|
|
3
|
-
import type { AwsRegion } from './regions';
|
|
4
|
-
export type BucketWithLocation = {
|
|
5
|
-
name: string;
|
|
6
|
-
creationDate: number;
|
|
7
|
-
region: AwsRegion;
|
|
8
|
-
};
|
|
9
|
-
export declare const getRemotionBuckets: ProviderSpecifics<AwsProvider>['getBuckets'];
|
package/dist/get-buckets.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRemotionBuckets = void 0;
|
|
4
|
-
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
5
|
-
const constants_1 = require("./constants");
|
|
6
|
-
const get_s3_client_1 = require("./get-s3-client");
|
|
7
|
-
const validate_bucketname_1 = require("./validate-bucketname");
|
|
8
|
-
const getRemotionBuckets = async ({ region, forceBucketName, forcePathStyle, requestHandler, }) => {
|
|
9
|
-
const { Buckets } = await (0, get_s3_client_1.getS3Client)({
|
|
10
|
-
region,
|
|
11
|
-
customCredentials: null,
|
|
12
|
-
forcePathStyle,
|
|
13
|
-
requestHandler,
|
|
14
|
-
}).send(new client_s3_1.ListBucketsCommand({}));
|
|
15
|
-
if (!Buckets) {
|
|
16
|
-
return [];
|
|
17
|
-
}
|
|
18
|
-
const remotionBuckets = Buckets.filter((b) => {
|
|
19
|
-
var _a;
|
|
20
|
-
if (forceBucketName) {
|
|
21
|
-
return b.Name === forceBucketName;
|
|
22
|
-
}
|
|
23
|
-
return (_a = b.Name) === null || _a === void 0 ? void 0 : _a.startsWith(constants_1.REMOTION_BUCKET_PREFIX);
|
|
24
|
-
});
|
|
25
|
-
const locations = await Promise.all(remotionBuckets.map(async (bucket) => {
|
|
26
|
-
var _a, _b;
|
|
27
|
-
const { region: parsedRegion } = (0, validate_bucketname_1.parseBucketName)(bucket.Name);
|
|
28
|
-
if (parsedRegion) {
|
|
29
|
-
return parsedRegion;
|
|
30
|
-
}
|
|
31
|
-
try {
|
|
32
|
-
const result = await (0, get_s3_client_1.getS3Client)({
|
|
33
|
-
region,
|
|
34
|
-
customCredentials: null,
|
|
35
|
-
forcePathStyle,
|
|
36
|
-
requestHandler,
|
|
37
|
-
}).send(new client_s3_1.GetBucketLocationCommand({
|
|
38
|
-
Bucket: bucket.Name,
|
|
39
|
-
}));
|
|
40
|
-
// AWS docs: Buckets in Region us-east-1 have a LocationConstraint of null!!
|
|
41
|
-
return (_a = result.LocationConstraint) !== null && _a !== void 0 ? _a : 'us-east-1';
|
|
42
|
-
}
|
|
43
|
-
catch (err) {
|
|
44
|
-
// Sometimes the API returns a bucket even if it was deleted before
|
|
45
|
-
if ((_b = err.stack) === null || _b === void 0 ? void 0 : _b.includes('NoSuchBucket')) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
throw err;
|
|
49
|
-
}
|
|
50
|
-
}));
|
|
51
|
-
const bucketsWithLocation = remotionBuckets
|
|
52
|
-
.map((bucket, i) => {
|
|
53
|
-
return {
|
|
54
|
-
creationDate: bucket.CreationDate.getTime(),
|
|
55
|
-
name: bucket.Name,
|
|
56
|
-
region: locations[i],
|
|
57
|
-
};
|
|
58
|
-
})
|
|
59
|
-
.filter((b) => b.region);
|
|
60
|
-
return bucketsWithLocation.filter((bucket) => {
|
|
61
|
-
return bucket.region === region;
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
exports.getRemotionBuckets = getRemotionBuckets;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { BrowserSafeApis, ChromiumOptions, ToOptions, VideoConfig } from '@remotion/serverless-client';
|
|
2
|
-
import type { AwsRegion } from './regions';
|
|
3
|
-
import type { RequestHandler } from './types';
|
|
4
|
-
export type GetCompositionsOnLambdaInput = {
|
|
5
|
-
chromiumOptions?: ChromiumOptions;
|
|
6
|
-
region: AwsRegion;
|
|
7
|
-
inputProps: Record<string, unknown>;
|
|
8
|
-
functionName: string;
|
|
9
|
-
serveUrl: string;
|
|
10
|
-
envVariables?: Record<string, string>;
|
|
11
|
-
forceBucketName?: string;
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated in favor of `logLevel`: true
|
|
14
|
-
*/
|
|
15
|
-
dumpBrowserLogs?: boolean;
|
|
16
|
-
forcePathStyle?: boolean;
|
|
17
|
-
requestHandler?: RequestHandler | null;
|
|
18
|
-
} & Partial<ToOptions<typeof BrowserSafeApis.optionsMap.getCompositionsOnLambda>>;
|
|
19
|
-
export type GetCompositionsOnLambdaOutput = VideoConfig[];
|
|
20
|
-
export declare const getCompositionsOnLambda: ({ chromiumOptions, serveUrl, region, inputProps, functionName, envVariables, logLevel, timeoutInMilliseconds, forceBucketName: bucketName, dumpBrowserLogs, offthreadVideoCacheSizeInBytes, forcePathStyle, requestHandler, mediaCacheSizeInBytes, }: GetCompositionsOnLambdaInput) => Promise<GetCompositionsOnLambdaOutput>;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCompositionsOnLambda = void 0;
|
|
4
|
-
const serverless_client_1 = require("@remotion/serverless-client");
|
|
5
|
-
const aws_provider_1 = require("./aws-provider");
|
|
6
|
-
/*
|
|
7
|
-
* @description Gets the compositions inside a Lambda function.
|
|
8
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/getcompositionsonlambda)
|
|
9
|
-
*/
|
|
10
|
-
const getCompositionsOnLambda = async ({ chromiumOptions, serveUrl, region, inputProps, functionName, envVariables, logLevel, timeoutInMilliseconds, forceBucketName: bucketName, dumpBrowserLogs, offthreadVideoCacheSizeInBytes, forcePathStyle, requestHandler, mediaCacheSizeInBytes, }) => {
|
|
11
|
-
var _a;
|
|
12
|
-
const stringifiedInputProps = (0, serverless_client_1.serializeOrThrow)(inputProps, 'input-props');
|
|
13
|
-
const serializedInputProps = await (0, serverless_client_1.compressInputProps)({
|
|
14
|
-
stringifiedInputProps,
|
|
15
|
-
region,
|
|
16
|
-
userSpecifiedBucketName: bucketName !== null && bucketName !== void 0 ? bucketName : null,
|
|
17
|
-
propsType: 'input-props',
|
|
18
|
-
needsToUpload: (0, serverless_client_1.getNeedsToUpload)({
|
|
19
|
-
type: 'video-or-audio',
|
|
20
|
-
sizes: [
|
|
21
|
-
stringifiedInputProps.length,
|
|
22
|
-
JSON.stringify(envVariables).length,
|
|
23
|
-
],
|
|
24
|
-
providerSpecifics: aws_provider_1.awsImplementation,
|
|
25
|
-
}),
|
|
26
|
-
providerSpecifics: aws_provider_1.awsImplementation,
|
|
27
|
-
forcePathStyle: forcePathStyle !== null && forcePathStyle !== void 0 ? forcePathStyle : false,
|
|
28
|
-
skipPutAcl: false,
|
|
29
|
-
requestHandler,
|
|
30
|
-
});
|
|
31
|
-
try {
|
|
32
|
-
const res = await aws_provider_1.awsImplementation.callFunctionSync({
|
|
33
|
-
functionName,
|
|
34
|
-
type: serverless_client_1.ServerlessRoutines.compositions,
|
|
35
|
-
payload: {
|
|
36
|
-
type: serverless_client_1.ServerlessRoutines.compositions,
|
|
37
|
-
chromiumOptions: chromiumOptions !== null && chromiumOptions !== void 0 ? chromiumOptions : {},
|
|
38
|
-
serveUrl,
|
|
39
|
-
envVariables,
|
|
40
|
-
inputProps: serializedInputProps,
|
|
41
|
-
logLevel: dumpBrowserLogs ? 'verbose' : (logLevel !== null && logLevel !== void 0 ? logLevel : 'info'),
|
|
42
|
-
timeoutInMilliseconds: timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : 30000,
|
|
43
|
-
version: serverless_client_1.VERSION,
|
|
44
|
-
bucketName: bucketName !== null && bucketName !== void 0 ? bucketName : null,
|
|
45
|
-
offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes !== null && offthreadVideoCacheSizeInBytes !== void 0 ? offthreadVideoCacheSizeInBytes : null,
|
|
46
|
-
forcePathStyle: forcePathStyle !== null && forcePathStyle !== void 0 ? forcePathStyle : false,
|
|
47
|
-
mediaCacheSizeInBytes: mediaCacheSizeInBytes !== null && mediaCacheSizeInBytes !== void 0 ? mediaCacheSizeInBytes : null,
|
|
48
|
-
},
|
|
49
|
-
region,
|
|
50
|
-
timeoutInTest: 120000,
|
|
51
|
-
requestHandler,
|
|
52
|
-
});
|
|
53
|
-
return res.compositions;
|
|
54
|
-
}
|
|
55
|
-
catch (err) {
|
|
56
|
-
if ((_a = err.stack) === null || _a === void 0 ? void 0 : _a.includes('UnrecognizedClientException')) {
|
|
57
|
-
throw new Error('UnrecognizedClientException: The AWS credentials provided were probably mixed up. Learn how to fix this issue here: https://remotion.dev/docs/lambda/troubleshooting/unrecognizedclientexception');
|
|
58
|
-
}
|
|
59
|
-
throw err;
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
exports.getCompositionsOnLambda = getCompositionsOnLambda;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { fromIni } from '@aws-sdk/credential-provider-ini';
|
|
2
|
-
type CredentialPair = {
|
|
3
|
-
accessKeyId: string;
|
|
4
|
-
secretAccessKey: string;
|
|
5
|
-
sessionToken?: string;
|
|
6
|
-
};
|
|
7
|
-
type AwsCredentialIdentityProvider = ReturnType<typeof fromIni>;
|
|
8
|
-
export declare const getCredentials: () => CredentialPair | AwsCredentialIdentityProvider | undefined;
|
|
9
|
-
export {};
|
package/dist/get-credentials.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCredentials = void 0;
|
|
4
|
-
const credential_provider_ini_1 = require("@aws-sdk/credential-provider-ini");
|
|
5
|
-
const get_env_variable_1 = require("./get-env-variable");
|
|
6
|
-
const is_in_lambda_1 = require("./is-in-lambda");
|
|
7
|
-
const getCredentials = () => {
|
|
8
|
-
if ((0, is_in_lambda_1.isInsideLambda)()) {
|
|
9
|
-
return undefined;
|
|
10
|
-
}
|
|
11
|
-
if ((0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_PROFILE')) {
|
|
12
|
-
return (0, credential_provider_ini_1.fromIni)({
|
|
13
|
-
profile: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_PROFILE'),
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
if ((0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID') &&
|
|
17
|
-
(0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SECRET_ACCESS_KEY') &&
|
|
18
|
-
(0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SESSION_TOKEN')) {
|
|
19
|
-
return {
|
|
20
|
-
accessKeyId: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID'),
|
|
21
|
-
secretAccessKey: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SECRET_ACCESS_KEY'),
|
|
22
|
-
sessionToken: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SESSION_TOKEN'),
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
if ((0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID') &&
|
|
26
|
-
(0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SECRET_ACCESS_KEY')) {
|
|
27
|
-
return {
|
|
28
|
-
accessKeyId: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID'),
|
|
29
|
-
secretAccessKey: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SECRET_ACCESS_KEY'),
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
if ((0, get_env_variable_1.getEnvVariable)('AWS_PROFILE')) {
|
|
33
|
-
return (0, credential_provider_ini_1.fromIni)({
|
|
34
|
-
profile: (0, get_env_variable_1.getEnvVariable)('AWS_PROFILE'),
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
if ((0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID') &&
|
|
38
|
-
(0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY') &&
|
|
39
|
-
(0, get_env_variable_1.getEnvVariable)('AWS_SESSION_TOKEN')) {
|
|
40
|
-
return {
|
|
41
|
-
accessKeyId: (0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID'),
|
|
42
|
-
secretAccessKey: (0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY'),
|
|
43
|
-
sessionToken: (0, get_env_variable_1.getEnvVariable)('AWS_SESSION_TOKEN'),
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
if ((0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID') &&
|
|
47
|
-
(0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY')) {
|
|
48
|
-
return {
|
|
49
|
-
accessKeyId: (0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID'),
|
|
50
|
-
secretAccessKey: (0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY'),
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
return undefined;
|
|
54
|
-
};
|
|
55
|
-
exports.getCredentials = getCredentials;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getEnvVariable: (name: string) => string | undefined;
|
package/dist/get-env-variable.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getEnvVariable = void 0;
|
|
4
|
-
const getEnvVariable = (name) => {
|
|
5
|
-
if (typeof process !== 'undefined' &&
|
|
6
|
-
typeof process.env !== 'undefined' &&
|
|
7
|
-
process.env[name]) {
|
|
8
|
-
return process.env[name];
|
|
9
|
-
}
|
|
10
|
-
if (typeof Deno !== 'undefined' && Deno.env.has(name)) {
|
|
11
|
-
return Deno.env.get(name);
|
|
12
|
-
}
|
|
13
|
-
return undefined;
|
|
14
|
-
};
|
|
15
|
-
exports.getEnvVariable = getEnvVariable;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseFunctionName = void 0;
|
|
4
|
-
const constants_1 = require("./constants");
|
|
5
|
-
const parseFunctionName = (functionName) => {
|
|
6
|
-
const match = functionName.match(new RegExp(constants_1.RENDER_FN_PREFIX + '(.*)-mem(\\d+)mb-disk(\\d+)mb-(\\d+)sec$'));
|
|
7
|
-
if (!match) {
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
return {
|
|
11
|
-
version: match[1],
|
|
12
|
-
memorySizeInMb: parseInt(match[2], 10),
|
|
13
|
-
diskSizeInMb: parseInt(match[3], 10),
|
|
14
|
-
timeoutInSeconds: parseInt(match[4], 10),
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
exports.parseFunctionName = parseFunctionName;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { LogLevel } from '@remotion/serverless-client';
|
|
2
|
-
import type { AwsRegion } from './regions';
|
|
3
|
-
import type { RequestHandler } from './types';
|
|
4
|
-
export declare const getFunctionVersion: ({ functionName, region, logLevel, requestHandler, }: {
|
|
5
|
-
functionName: string;
|
|
6
|
-
region: AwsRegion;
|
|
7
|
-
logLevel: LogLevel;
|
|
8
|
-
requestHandler: RequestHandler | null | undefined;
|
|
9
|
-
}) => Promise<string>;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFunctionVersion = void 0;
|
|
4
|
-
const serverless_client_1 = require("@remotion/serverless-client");
|
|
5
|
-
const aws_provider_1 = require("./aws-provider");
|
|
6
|
-
const getFunctionVersion = async ({ functionName, region, logLevel, requestHandler, }) => {
|
|
7
|
-
try {
|
|
8
|
-
// For now, we'll pass requestHandler to the awsImplementation if needed
|
|
9
|
-
// This might require deeper changes in the serverless-client framework
|
|
10
|
-
const result = await aws_provider_1.awsImplementation.callFunctionSync({
|
|
11
|
-
functionName,
|
|
12
|
-
payload: {
|
|
13
|
-
logLevel,
|
|
14
|
-
type: serverless_client_1.ServerlessRoutines.info,
|
|
15
|
-
},
|
|
16
|
-
region,
|
|
17
|
-
type: serverless_client_1.ServerlessRoutines.info,
|
|
18
|
-
timeoutInTest: 120000,
|
|
19
|
-
requestHandler,
|
|
20
|
-
});
|
|
21
|
-
return result.version;
|
|
22
|
-
}
|
|
23
|
-
catch (err) {
|
|
24
|
-
// Prerelease versions had no info command
|
|
25
|
-
if (err.message.includes(serverless_client_1.COMMAND_NOT_FOUND)) {
|
|
26
|
-
return 'n/a';
|
|
27
|
-
}
|
|
28
|
-
// Bug in certain version of AWS S3 kit
|
|
29
|
-
if (err.message.includes('AWS CRT binary not present ')) {
|
|
30
|
-
return 'n/a';
|
|
31
|
-
}
|
|
32
|
-
throw err;
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
exports.getFunctionVersion = getFunctionVersion;
|
package/dist/get-functions.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { FunctionInfo, LogLevel } from '@remotion/serverless-client';
|
|
2
|
-
import type { AwsRegion } from './regions';
|
|
3
|
-
import type { RequestHandler } from './types';
|
|
4
|
-
export type GetFunctionsInput = {
|
|
5
|
-
region: AwsRegion;
|
|
6
|
-
compatibleOnly: boolean;
|
|
7
|
-
logLevel?: LogLevel;
|
|
8
|
-
requestHandler?: RequestHandler;
|
|
9
|
-
};
|
|
10
|
-
export declare const getFunctions: (params: GetFunctionsInput) => Promise<FunctionInfo[]>;
|
package/dist/get-functions.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFunctions = void 0;
|
|
4
|
-
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
5
|
-
const serverless_client_1 = require("@remotion/serverless-client");
|
|
6
|
-
const aws_clients_1 = require("./aws-clients");
|
|
7
|
-
const constants_1 = require("./constants");
|
|
8
|
-
const get_function_version_1 = require("./get-function-version");
|
|
9
|
-
const getAllFunctions = async ({ existing, nextMarker, region, requestHandler, }) => {
|
|
10
|
-
const allLambdas = [...existing];
|
|
11
|
-
const lambdas = await (0, aws_clients_1.getLambdaClient)(region, undefined, requestHandler !== null && requestHandler !== void 0 ? requestHandler : null).send(new client_lambda_1.ListFunctionsCommand({
|
|
12
|
-
Marker: nextMarker !== null && nextMarker !== void 0 ? nextMarker : undefined,
|
|
13
|
-
}));
|
|
14
|
-
if (!lambdas.Functions) {
|
|
15
|
-
return allLambdas;
|
|
16
|
-
}
|
|
17
|
-
for (const lambda of lambdas.Functions) {
|
|
18
|
-
allLambdas.push(lambda);
|
|
19
|
-
}
|
|
20
|
-
if (lambdas.NextMarker) {
|
|
21
|
-
return getAllFunctions({
|
|
22
|
-
existing: allLambdas,
|
|
23
|
-
nextMarker: lambdas.NextMarker,
|
|
24
|
-
region,
|
|
25
|
-
requestHandler,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
return allLambdas;
|
|
29
|
-
};
|
|
30
|
-
/*
|
|
31
|
-
* @description Retrieves a list of functions that Remotion deployed to AWS Lambda in a certain region.
|
|
32
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/getfunctions)
|
|
33
|
-
*/
|
|
34
|
-
const getFunctions = async (params) => {
|
|
35
|
-
const lambdas = await getAllFunctions({
|
|
36
|
-
existing: [],
|
|
37
|
-
nextMarker: null,
|
|
38
|
-
region: params.region,
|
|
39
|
-
requestHandler: params.requestHandler,
|
|
40
|
-
});
|
|
41
|
-
const remotionLambdas = lambdas.filter((f) => {
|
|
42
|
-
var _a;
|
|
43
|
-
return (_a = f.FunctionName) === null || _a === void 0 ? void 0 : _a.startsWith(constants_1.RENDER_FN_PREFIX);
|
|
44
|
-
});
|
|
45
|
-
const configs = await Promise.all(remotionLambdas.map(async (fn) => {
|
|
46
|
-
var _a;
|
|
47
|
-
try {
|
|
48
|
-
const version = await (0, get_function_version_1.getFunctionVersion)({
|
|
49
|
-
functionName: fn.FunctionName,
|
|
50
|
-
region: params.region,
|
|
51
|
-
logLevel: (_a = params.logLevel) !== null && _a !== void 0 ? _a : 'info',
|
|
52
|
-
requestHandler: params.requestHandler,
|
|
53
|
-
});
|
|
54
|
-
return version;
|
|
55
|
-
}
|
|
56
|
-
catch (_b) {
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
}));
|
|
60
|
-
const list = remotionLambdas.map((lambda, i) => {
|
|
61
|
-
var _a, _b;
|
|
62
|
-
return {
|
|
63
|
-
functionName: lambda.FunctionName,
|
|
64
|
-
version: configs[i],
|
|
65
|
-
memorySizeInMb: lambda.MemorySize,
|
|
66
|
-
timeoutInSeconds: lambda.Timeout,
|
|
67
|
-
diskSizeInMb: (_b = (_a = lambda.EphemeralStorage) === null || _a === void 0 ? void 0 : _a.Size) !== null && _b !== void 0 ? _b : constants_1.DEFAULT_EPHEMERAL_STORAGE_IN_MB,
|
|
68
|
-
};
|
|
69
|
-
});
|
|
70
|
-
if (!params.compatibleOnly) {
|
|
71
|
-
return list;
|
|
72
|
-
}
|
|
73
|
-
return list.filter((l) => {
|
|
74
|
-
if (!params.compatibleOnly) {
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
return l.version === serverless_client_1.VERSION;
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
exports.getFunctions = getFunctions;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOutputUrlFromMetadata = void 0;
|
|
4
|
-
const serverless_client_1 = require("@remotion/serverless-client");
|
|
5
|
-
const constants_1 = require("./constants");
|
|
6
|
-
const getOutputUrlFromMetadata = ({ renderMetadata, bucketName, customCredentials, currentRegion, }) => {
|
|
7
|
-
const { key, renderBucketName } = (0, serverless_client_1.getExpectedOutName)({
|
|
8
|
-
renderMetadata,
|
|
9
|
-
bucketName,
|
|
10
|
-
customCredentials,
|
|
11
|
-
bucketNamePrefix: constants_1.REMOTION_BUCKET_PREFIX,
|
|
12
|
-
});
|
|
13
|
-
return {
|
|
14
|
-
url: `https://s3.${currentRegion}.amazonaws.com/${renderBucketName}/${key}`,
|
|
15
|
-
key,
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
exports.getOutputUrlFromMetadata = getOutputUrlFromMetadata;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { CustomCredentials, LogLevel } from '@remotion/serverless-client';
|
|
2
|
-
import { type AwsProvider } from './aws-provider';
|
|
3
|
-
import type { RenderProgress } from './constants';
|
|
4
|
-
import type { AwsRegion } from './regions';
|
|
5
|
-
import type { RequestHandler } from './types';
|
|
6
|
-
export type GetRenderProgressInput = {
|
|
7
|
-
functionName: string;
|
|
8
|
-
bucketName: string;
|
|
9
|
-
renderId: string;
|
|
10
|
-
region: AwsRegion;
|
|
11
|
-
logLevel?: LogLevel;
|
|
12
|
-
s3OutputProvider?: CustomCredentials<AwsProvider>;
|
|
13
|
-
forcePathStyle?: boolean;
|
|
14
|
-
skipLambdaInvocation?: boolean;
|
|
15
|
-
requestHandler?: RequestHandler;
|
|
16
|
-
};
|
|
17
|
-
export declare const getRenderProgress: (input: GetRenderProgressInput) => Promise<RenderProgress>;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRenderProgress = void 0;
|
|
4
|
-
const serverless_client_1 = require("@remotion/serverless-client");
|
|
5
|
-
const aws_provider_1 = require("./aws-provider");
|
|
6
|
-
const make_lambda_payload_1 = require("./make-lambda-payload");
|
|
7
|
-
const parse_function_name_1 = require("./parse-function-name");
|
|
8
|
-
/*
|
|
9
|
-
* @description Gets the current status of a render originally triggered via renderMediaOnLambda().
|
|
10
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/getrenderprogress)
|
|
11
|
-
*/
|
|
12
|
-
const getRenderProgress = async (input) => {
|
|
13
|
-
var _a, _b;
|
|
14
|
-
if (input.skipLambdaInvocation) {
|
|
15
|
-
const parsed = (0, parse_function_name_1.parseFunctionName)(input.functionName);
|
|
16
|
-
if (!parsed) {
|
|
17
|
-
throw new Error([
|
|
18
|
-
`The function name ${input.functionName} does not adhere to the function name convention (https://www.remotion.dev/docs/lambda/naming-convention).`,
|
|
19
|
-
'Cannot determine memory and disk size from the function name.',
|
|
20
|
-
'You must call getRenderProgress with `skipLambdaInvocation` set to false.',
|
|
21
|
-
].join('\n'));
|
|
22
|
-
}
|
|
23
|
-
return (0, serverless_client_1.getProgress)({
|
|
24
|
-
bucketName: input.bucketName,
|
|
25
|
-
renderId: input.renderId,
|
|
26
|
-
region: input.region,
|
|
27
|
-
forcePathStyle: (_a = input.forcePathStyle) !== null && _a !== void 0 ? _a : false,
|
|
28
|
-
customCredentials: (_b = input.s3OutputProvider) !== null && _b !== void 0 ? _b : null,
|
|
29
|
-
expectedBucketOwner: null,
|
|
30
|
-
providerSpecifics: aws_provider_1.awsImplementation,
|
|
31
|
-
memorySizeInMb: parsed.memorySizeInMb,
|
|
32
|
-
timeoutInMilliseconds: parsed.timeoutInSeconds * 1000,
|
|
33
|
-
functionName: input.functionName,
|
|
34
|
-
requestHandler: input.requestHandler,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
const result = await aws_provider_1.awsImplementation.callFunctionSync({
|
|
38
|
-
functionName: input.functionName,
|
|
39
|
-
type: serverless_client_1.ServerlessRoutines.status,
|
|
40
|
-
payload: (0, make_lambda_payload_1.getRenderProgressPayload)(input),
|
|
41
|
-
region: input.region,
|
|
42
|
-
timeoutInTest: 120000,
|
|
43
|
-
requestHandler: input.requestHandler,
|
|
44
|
-
});
|
|
45
|
-
return result;
|
|
46
|
-
};
|
|
47
|
-
exports.getRenderProgress = getRenderProgress;
|
package/dist/get-s3-client.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { S3Client } from '@aws-sdk/client-s3';
|
|
2
|
-
import type { CustomCredentials } from '@remotion/serverless-client';
|
|
3
|
-
import type { AwsProvider } from './aws-provider';
|
|
4
|
-
import type { AwsRegion } from './regions';
|
|
5
|
-
import type { RequestHandler } from './types';
|
|
6
|
-
export declare const getS3Client: ({ region, customCredentials, forcePathStyle, requestHandler, }: {
|
|
7
|
-
region: AwsRegion;
|
|
8
|
-
customCredentials: CustomCredentials<AwsProvider> | null;
|
|
9
|
-
forcePathStyle: boolean;
|
|
10
|
-
requestHandler: RequestHandler | null;
|
|
11
|
-
}) => S3Client;
|
package/dist/get-s3-client.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getS3Client = void 0;
|
|
4
|
-
const get_service_client_1 = require("./get-service-client");
|
|
5
|
-
const getS3Client = ({ region, customCredentials, forcePathStyle, requestHandler, }) => {
|
|
6
|
-
var _a;
|
|
7
|
-
return (0, get_service_client_1.getServiceClient)({
|
|
8
|
-
region: (_a = customCredentials === null || customCredentials === void 0 ? void 0 : customCredentials.region) !== null && _a !== void 0 ? _a : region,
|
|
9
|
-
service: 's3',
|
|
10
|
-
customCredentials,
|
|
11
|
-
forcePathStyle,
|
|
12
|
-
requestHandler,
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
exports.getS3Client = getS3Client;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { CloudWatchLogsClient } from '@aws-sdk/client-cloudwatch-logs';
|
|
2
|
-
import { IAMClient } from '@aws-sdk/client-iam';
|
|
3
|
-
import { LambdaClient } from '@aws-sdk/client-lambda';
|
|
4
|
-
import { S3Client } from '@aws-sdk/client-s3';
|
|
5
|
-
import { ServiceQuotasClient } from '@aws-sdk/client-service-quotas';
|
|
6
|
-
import { STSClient } from '@aws-sdk/client-sts';
|
|
7
|
-
import type { CustomCredentials } from '@remotion/serverless-client';
|
|
8
|
-
import type { AwsProvider } from './aws-provider';
|
|
9
|
-
import type { AwsRegion } from './regions';
|
|
10
|
-
import type { RequestHandler } from './types';
|
|
11
|
-
export type ServiceMapping = {
|
|
12
|
-
s3: S3Client;
|
|
13
|
-
cloudwatch: CloudWatchLogsClient;
|
|
14
|
-
iam: IAMClient;
|
|
15
|
-
lambda: LambdaClient;
|
|
16
|
-
servicequotas: ServiceQuotasClient;
|
|
17
|
-
sts: STSClient;
|
|
18
|
-
};
|
|
19
|
-
export declare const getServiceClient: <T extends keyof ServiceMapping>({ region, service, customCredentials, forcePathStyle, requestHandler, }: {
|
|
20
|
-
region: AwsRegion;
|
|
21
|
-
service: T;
|
|
22
|
-
customCredentials: CustomCredentials<AwsProvider> | null;
|
|
23
|
-
forcePathStyle: boolean;
|
|
24
|
-
requestHandler: RequestHandler | null;
|
|
25
|
-
}) => ServiceMapping[T];
|