@remotion/lambda-client 4.0.314 → 4.0.315
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/.turbo/turbo-formatting.log +7 -0
- package/.turbo/turbo-make.log +2 -2
- package/dist/aws-clients.d.ts +6 -5
- package/dist/aws-clients.js +10 -5
- package/dist/aws-provider.d.ts +2 -0
- package/dist/bucket-exists.js +2 -1
- package/dist/call-lambda-async.js +1 -1
- package/dist/call-lambda-streaming.js +1 -1
- package/dist/call-lambda-sync.js +1 -1
- package/dist/clean-items.d.ts +2 -1
- package/dist/clean-items.js +2 -1
- package/dist/create-bucket.js +25 -5
- package/dist/delete-file.js +7 -2
- package/dist/delete-function.d.ts +4 -1
- package/dist/delete-function.js +2 -2
- package/dist/delete-render.d.ts +2 -0
- package/dist/delete-render.js +7 -1
- package/dist/esm/index.mjs +232 -106
- package/dist/get-account-id.js +1 -1
- package/dist/get-aws-client.d.ts +3 -1
- package/dist/get-aws-client.js +2 -1
- package/dist/get-buckets.js +3 -1
- package/dist/get-compositions-on-lambda.d.ts +3 -1
- package/dist/get-compositions-on-lambda.js +3 -1
- package/dist/get-function-version.d.ts +3 -1
- package/dist/get-function-version.js +4 -1
- package/dist/get-functions.d.ts +2 -0
- package/dist/get-functions.js +5 -2
- package/dist/get-render-progress.d.ts +2 -0
- package/dist/get-render-progress.js +2 -0
- package/dist/get-s3-client.d.ts +3 -1
- package/dist/get-s3-client.js +2 -1
- package/dist/get-service-client.d.ts +3 -1
- package/dist/get-service-client.js +13 -5
- package/dist/get-sites.d.ts +4 -2
- package/dist/get-sites.js +6 -2
- package/dist/head-file.js +2 -1
- package/dist/index.d.ts +14 -10
- package/dist/is-flaky-error.js +2 -1
- package/dist/lifecycle-rules.d.ts +3 -1
- package/dist/lifecycle-rules.js +17 -5
- package/dist/list-objects.js +4 -1
- package/dist/make-lambda-payload.d.ts +4 -2
- package/dist/make-lambda-payload.js +4 -2
- package/dist/presign-url.d.ts +5 -2
- package/dist/presign-url.js +4 -2
- package/dist/read-file.d.ts +3 -1
- package/dist/read-file.js +2 -1
- package/dist/render-media-on-lambda.d.ts +2 -0
- package/dist/render-media-on-lambda.js +3 -1
- package/dist/render-still-on-lambda.d.ts +5 -1
- package/dist/render-still-on-lambda.js +3 -1
- package/dist/test/request-handler.test.d.ts +1 -0
- package/dist/test/request-handler.test.js +36 -0
- package/dist/types.d.ts +4 -0
- package/dist/types.js +2 -0
- package/dist/write-file.js +2 -1
- package/package.json +3 -3
- package/src/aws-clients.ts +18 -3
- package/src/aws-provider.ts +2 -0
- package/src/bucket-exists.ts +8 -1
- package/src/call-lambda-async.ts +5 -1
- package/src/call-lambda-streaming.ts +5 -1
- package/src/call-lambda-sync.ts +5 -1
- package/src/clean-items.ts +3 -0
- package/src/create-bucket.ts +25 -5
- package/src/delete-file.ts +9 -1
- package/src/delete-function.ts +6 -2
- package/src/delete-render.ts +8 -1
- package/src/get-account-id.ts +1 -1
- package/src/get-aws-client.ts +4 -0
- package/src/get-buckets.ts +3 -0
- package/src/get-compositions-on-lambda.ts +5 -0
- package/src/get-function-version.ts +6 -0
- package/src/get-functions.ts +12 -1
- package/src/get-render-progress.ts +4 -0
- package/src/get-s3-client.ts +4 -0
- package/src/get-service-client.ts +17 -3
- package/src/get-sites.ts +8 -0
- package/src/head-file.ts +2 -0
- package/src/index.ts +1 -0
- package/src/is-flaky-error.ts +4 -1
- package/src/lifecycle-rules.ts +21 -6
- package/src/list-objects.ts +4 -0
- package/src/make-lambda-payload.ts +6 -0
- package/src/presign-url.ts +13 -2
- package/src/read-file.ts +4 -0
- package/src/render-media-on-lambda.ts +4 -0
- package/src/render-still-on-lambda.ts +7 -1
- package/src/test/request-handler.test.ts +42 -0
- package/src/types.ts +7 -0
- package/src/write-file.ts +2 -0
- package/tsconfig.tsbuildinfo +1 -1
package/dist/get-account-id.js
CHANGED
|
@@ -6,7 +6,7 @@ const aws_clients_1 = require("./aws-clients");
|
|
|
6
6
|
const validate_aws_region_1 = require("./validate-aws-region");
|
|
7
7
|
const getAccountIdImplementation = async (options) => {
|
|
8
8
|
(0, validate_aws_region_1.validateAwsRegion)(options.region);
|
|
9
|
-
const callerIdentity = await (0, aws_clients_1.getStsClient)(options.region).send(new client_sts_1.GetCallerIdentityCommand({}));
|
|
9
|
+
const callerIdentity = await (0, aws_clients_1.getStsClient)(options.region, null).send(new client_sts_1.GetCallerIdentityCommand({}));
|
|
10
10
|
if (!callerIdentity.Account) {
|
|
11
11
|
throw new Error('Cannot get account ID');
|
|
12
12
|
}
|
package/dist/get-aws-client.d.ts
CHANGED
|
@@ -8,11 +8,13 @@ import type { CustomCredentials } from '@remotion/serverless-client';
|
|
|
8
8
|
import type { AwsProvider } from './aws-provider';
|
|
9
9
|
import { type ServiceMapping } from './get-service-client';
|
|
10
10
|
import type { AwsRegion } from './regions';
|
|
11
|
+
import type { RequestHandler } from './types';
|
|
11
12
|
export type GetAwsClientInput<T extends keyof ServiceMapping> = {
|
|
12
13
|
region: AwsRegion;
|
|
13
14
|
service: T;
|
|
14
15
|
customCredentials?: CustomCredentials<AwsProvider> | null;
|
|
15
16
|
forcePathStyle?: boolean;
|
|
17
|
+
requestHandler?: RequestHandler;
|
|
16
18
|
};
|
|
17
19
|
type SdkMapping = {
|
|
18
20
|
s3: typeof S3SDK;
|
|
@@ -26,5 +28,5 @@ export type GetAwsClientOutput<T extends keyof ServiceMapping> = {
|
|
|
26
28
|
client: ServiceMapping[T];
|
|
27
29
|
sdk: SdkMapping[T];
|
|
28
30
|
};
|
|
29
|
-
export declare const getAwsClient: <T extends keyof ServiceMapping>({ region, service, customCredentials, forcePathStyle, }: GetAwsClientInput<T>) => GetAwsClientOutput<T>;
|
|
31
|
+
export declare const getAwsClient: <T extends keyof ServiceMapping>({ region, service, customCredentials, forcePathStyle, requestHandler, }: GetAwsClientInput<T>) => GetAwsClientOutput<T>;
|
|
30
32
|
export {};
|
package/dist/get-aws-client.js
CHANGED
|
@@ -45,13 +45,14 @@ const get_service_client_1 = require("./get-service-client");
|
|
|
45
45
|
* @description Exposes full access to the AWS SDK used by Remotion, allowing interaction with AWS infrastructure beyond provided functionalities.
|
|
46
46
|
* @see [Documentation](https://remotion.dev/docs/lambda/getawsclient)
|
|
47
47
|
*/
|
|
48
|
-
const getAwsClient = ({ region, service, customCredentials, forcePathStyle, }) => {
|
|
48
|
+
const getAwsClient = ({ region, service, customCredentials, forcePathStyle, requestHandler, }) => {
|
|
49
49
|
return {
|
|
50
50
|
client: (0, get_service_client_1.getServiceClient)({
|
|
51
51
|
region,
|
|
52
52
|
service,
|
|
53
53
|
customCredentials: customCredentials !== null && customCredentials !== void 0 ? customCredentials : null,
|
|
54
54
|
forcePathStyle: forcePathStyle !== null && forcePathStyle !== void 0 ? forcePathStyle : false,
|
|
55
|
+
requestHandler,
|
|
55
56
|
}),
|
|
56
57
|
sdk: {
|
|
57
58
|
lambda: LambdaSDK,
|
package/dist/get-buckets.js
CHANGED
|
@@ -5,11 +5,12 @@ const client_s3_1 = require("@aws-sdk/client-s3");
|
|
|
5
5
|
const constants_1 = require("./constants");
|
|
6
6
|
const get_s3_client_1 = require("./get-s3-client");
|
|
7
7
|
const validate_bucketname_1 = require("./validate-bucketname");
|
|
8
|
-
const getRemotionBuckets = async ({ region, forceBucketName, forcePathStyle, }) => {
|
|
8
|
+
const getRemotionBuckets = async ({ region, forceBucketName, forcePathStyle, requestHandler, }) => {
|
|
9
9
|
const { Buckets } = await (0, get_s3_client_1.getS3Client)({
|
|
10
10
|
region,
|
|
11
11
|
customCredentials: null,
|
|
12
12
|
forcePathStyle,
|
|
13
|
+
requestHandler,
|
|
13
14
|
}).send(new client_s3_1.ListBucketsCommand({}));
|
|
14
15
|
if (!Buckets) {
|
|
15
16
|
return [];
|
|
@@ -32,6 +33,7 @@ const getRemotionBuckets = async ({ region, forceBucketName, forcePathStyle, })
|
|
|
32
33
|
region,
|
|
33
34
|
customCredentials: null,
|
|
34
35
|
forcePathStyle,
|
|
36
|
+
requestHandler,
|
|
35
37
|
}).send(new client_s3_1.GetBucketLocationCommand({
|
|
36
38
|
Bucket: bucket.Name,
|
|
37
39
|
}));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BrowserSafeApis, ChromiumOptions, ToOptions, VideoConfig } from '@remotion/serverless-client';
|
|
2
2
|
import type { AwsRegion } from './regions';
|
|
3
|
+
import type { RequestHandler } from './types';
|
|
3
4
|
export type GetCompositionsOnLambdaInput = {
|
|
4
5
|
chromiumOptions?: ChromiumOptions;
|
|
5
6
|
region: AwsRegion;
|
|
@@ -13,6 +14,7 @@ export type GetCompositionsOnLambdaInput = {
|
|
|
13
14
|
*/
|
|
14
15
|
dumpBrowserLogs?: boolean;
|
|
15
16
|
forcePathStyle?: boolean;
|
|
17
|
+
requestHandler: RequestHandler | null | undefined;
|
|
16
18
|
} & Partial<ToOptions<typeof BrowserSafeApis.optionsMap.getCompositionsOnLambda>>;
|
|
17
19
|
export type GetCompositionsOnLambdaOutput = VideoConfig[];
|
|
18
|
-
export declare const getCompositionsOnLambda: ({ chromiumOptions, serveUrl, region, inputProps, functionName, envVariables, logLevel, timeoutInMilliseconds, forceBucketName: bucketName, dumpBrowserLogs, offthreadVideoCacheSizeInBytes, forcePathStyle, }: GetCompositionsOnLambdaInput) => Promise<GetCompositionsOnLambdaOutput>;
|
|
20
|
+
export declare const getCompositionsOnLambda: ({ chromiumOptions, serveUrl, region, inputProps, functionName, envVariables, logLevel, timeoutInMilliseconds, forceBucketName: bucketName, dumpBrowserLogs, offthreadVideoCacheSizeInBytes, forcePathStyle, requestHandler, }: GetCompositionsOnLambdaInput) => Promise<GetCompositionsOnLambdaOutput>;
|
|
@@ -7,7 +7,7 @@ const aws_provider_1 = require("./aws-provider");
|
|
|
7
7
|
* @description Gets the compositions inside a Lambda function.
|
|
8
8
|
* @see [Documentation](https://remotion.dev/docs/lambda/getcompositionsonlambda)
|
|
9
9
|
*/
|
|
10
|
-
const getCompositionsOnLambda = async ({ chromiumOptions, serveUrl, region, inputProps, functionName, envVariables, logLevel, timeoutInMilliseconds, forceBucketName: bucketName, dumpBrowserLogs, offthreadVideoCacheSizeInBytes, forcePathStyle, }) => {
|
|
10
|
+
const getCompositionsOnLambda = async ({ chromiumOptions, serveUrl, region, inputProps, functionName, envVariables, logLevel, timeoutInMilliseconds, forceBucketName: bucketName, dumpBrowserLogs, offthreadVideoCacheSizeInBytes, forcePathStyle, requestHandler, }) => {
|
|
11
11
|
var _a;
|
|
12
12
|
const stringifiedInputProps = (0, serverless_client_1.serializeOrThrow)(inputProps, 'input-props');
|
|
13
13
|
const serializedInputProps = await (0, serverless_client_1.compressInputProps)({
|
|
@@ -26,6 +26,7 @@ const getCompositionsOnLambda = async ({ chromiumOptions, serveUrl, region, inpu
|
|
|
26
26
|
providerSpecifics: aws_provider_1.awsImplementation,
|
|
27
27
|
forcePathStyle: forcePathStyle !== null && forcePathStyle !== void 0 ? forcePathStyle : false,
|
|
28
28
|
skipPutAcl: false,
|
|
29
|
+
requestHandler,
|
|
29
30
|
});
|
|
30
31
|
try {
|
|
31
32
|
const res = await aws_provider_1.awsImplementation.callFunctionSync({
|
|
@@ -46,6 +47,7 @@ const getCompositionsOnLambda = async ({ chromiumOptions, serveUrl, region, inpu
|
|
|
46
47
|
},
|
|
47
48
|
region,
|
|
48
49
|
timeoutInTest: 120000,
|
|
50
|
+
requestHandler,
|
|
49
51
|
});
|
|
50
52
|
return res.compositions;
|
|
51
53
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { LogLevel } from '@remotion/serverless-client';
|
|
2
2
|
import type { AwsRegion } from './regions';
|
|
3
|
-
|
|
3
|
+
import type { RequestHandler } from './types';
|
|
4
|
+
export declare const getFunctionVersion: ({ functionName, region, logLevel, requestHandler, }: {
|
|
4
5
|
functionName: string;
|
|
5
6
|
region: AwsRegion;
|
|
6
7
|
logLevel: LogLevel;
|
|
8
|
+
requestHandler: RequestHandler | null | undefined;
|
|
7
9
|
}) => Promise<string>;
|
|
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getFunctionVersion = void 0;
|
|
4
4
|
const serverless_client_1 = require("@remotion/serverless-client");
|
|
5
5
|
const aws_provider_1 = require("./aws-provider");
|
|
6
|
-
const getFunctionVersion = async ({ functionName, region, logLevel, }) => {
|
|
6
|
+
const getFunctionVersion = async ({ functionName, region, logLevel, requestHandler, }) => {
|
|
7
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
|
|
8
10
|
const result = await aws_provider_1.awsImplementation.callFunctionSync({
|
|
9
11
|
functionName,
|
|
10
12
|
payload: {
|
|
@@ -14,6 +16,7 @@ const getFunctionVersion = async ({ functionName, region, logLevel, }) => {
|
|
|
14
16
|
region,
|
|
15
17
|
type: serverless_client_1.ServerlessRoutines.info,
|
|
16
18
|
timeoutInTest: 120000,
|
|
19
|
+
requestHandler,
|
|
17
20
|
});
|
|
18
21
|
return result.version;
|
|
19
22
|
}
|
package/dist/get-functions.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { FunctionInfo, LogLevel } from '@remotion/serverless-client';
|
|
2
2
|
import type { AwsRegion } from './regions';
|
|
3
|
+
import type { RequestHandler } from './types';
|
|
3
4
|
export type GetFunctionsInput = {
|
|
4
5
|
region: AwsRegion;
|
|
5
6
|
compatibleOnly: boolean;
|
|
6
7
|
logLevel?: LogLevel;
|
|
8
|
+
requestHandler?: RequestHandler;
|
|
7
9
|
};
|
|
8
10
|
export declare const getFunctions: (params: GetFunctionsInput) => Promise<FunctionInfo[]>;
|
package/dist/get-functions.js
CHANGED
|
@@ -6,9 +6,9 @@ const serverless_client_1 = require("@remotion/serverless-client");
|
|
|
6
6
|
const aws_clients_1 = require("./aws-clients");
|
|
7
7
|
const constants_1 = require("./constants");
|
|
8
8
|
const get_function_version_1 = require("./get-function-version");
|
|
9
|
-
const getAllFunctions = async ({ existing, nextMarker, region, }) => {
|
|
9
|
+
const getAllFunctions = async ({ existing, nextMarker, region, requestHandler, }) => {
|
|
10
10
|
const allLambdas = [...existing];
|
|
11
|
-
const lambdas = await (0, aws_clients_1.getLambdaClient)(region).send(new client_lambda_1.ListFunctionsCommand({
|
|
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
12
|
Marker: nextMarker !== null && nextMarker !== void 0 ? nextMarker : undefined,
|
|
13
13
|
}));
|
|
14
14
|
if (!lambdas.Functions) {
|
|
@@ -22,6 +22,7 @@ const getAllFunctions = async ({ existing, nextMarker, region, }) => {
|
|
|
22
22
|
existing: allLambdas,
|
|
23
23
|
nextMarker: lambdas.NextMarker,
|
|
24
24
|
region,
|
|
25
|
+
requestHandler,
|
|
25
26
|
});
|
|
26
27
|
}
|
|
27
28
|
return allLambdas;
|
|
@@ -35,6 +36,7 @@ const getFunctions = async (params) => {
|
|
|
35
36
|
existing: [],
|
|
36
37
|
nextMarker: null,
|
|
37
38
|
region: params.region,
|
|
39
|
+
requestHandler: params.requestHandler,
|
|
38
40
|
});
|
|
39
41
|
const remotionLambdas = lambdas.filter((f) => {
|
|
40
42
|
var _a;
|
|
@@ -47,6 +49,7 @@ const getFunctions = async (params) => {
|
|
|
47
49
|
functionName: fn.FunctionName,
|
|
48
50
|
region: params.region,
|
|
49
51
|
logLevel: (_a = params.logLevel) !== null && _a !== void 0 ? _a : 'info',
|
|
52
|
+
requestHandler: params.requestHandler,
|
|
50
53
|
});
|
|
51
54
|
return version;
|
|
52
55
|
}
|
|
@@ -2,6 +2,7 @@ import type { CustomCredentials, LogLevel } from '@remotion/serverless-client';
|
|
|
2
2
|
import { type AwsProvider } from './aws-provider';
|
|
3
3
|
import type { RenderProgress } from './constants';
|
|
4
4
|
import type { AwsRegion } from './regions';
|
|
5
|
+
import type { RequestHandler } from './types';
|
|
5
6
|
export type GetRenderProgressInput = {
|
|
6
7
|
functionName: string;
|
|
7
8
|
bucketName: string;
|
|
@@ -11,5 +12,6 @@ export type GetRenderProgressInput = {
|
|
|
11
12
|
s3OutputProvider?: CustomCredentials<AwsProvider>;
|
|
12
13
|
forcePathStyle?: boolean;
|
|
13
14
|
skipLambdaInvocation?: boolean;
|
|
15
|
+
requestHandler?: RequestHandler;
|
|
14
16
|
};
|
|
15
17
|
export declare const getRenderProgress: (input: GetRenderProgressInput) => Promise<RenderProgress>;
|
|
@@ -31,6 +31,7 @@ const getRenderProgress = async (input) => {
|
|
|
31
31
|
memorySizeInMb: parsed.memorySizeInMb,
|
|
32
32
|
timeoutInMilliseconds: parsed.timeoutInSeconds * 1000,
|
|
33
33
|
functionName: input.functionName,
|
|
34
|
+
requestHandler: input.requestHandler,
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
const result = await aws_provider_1.awsImplementation.callFunctionSync({
|
|
@@ -39,6 +40,7 @@ const getRenderProgress = async (input) => {
|
|
|
39
40
|
payload: (0, make_lambda_payload_1.getRenderProgressPayload)(input),
|
|
40
41
|
region: input.region,
|
|
41
42
|
timeoutInTest: 120000,
|
|
43
|
+
requestHandler: input.requestHandler,
|
|
42
44
|
});
|
|
43
45
|
return result;
|
|
44
46
|
};
|
package/dist/get-s3-client.d.ts
CHANGED
|
@@ -2,8 +2,10 @@ import type { S3Client } from '@aws-sdk/client-s3';
|
|
|
2
2
|
import type { CustomCredentials } from '@remotion/serverless-client';
|
|
3
3
|
import type { AwsProvider } from './aws-provider';
|
|
4
4
|
import type { AwsRegion } from './regions';
|
|
5
|
-
|
|
5
|
+
import type { RequestHandler } from './types';
|
|
6
|
+
export declare const getS3Client: ({ region, customCredentials, forcePathStyle, requestHandler, }: {
|
|
6
7
|
region: AwsRegion;
|
|
7
8
|
customCredentials: CustomCredentials<AwsProvider> | null;
|
|
8
9
|
forcePathStyle: boolean;
|
|
10
|
+
requestHandler: RequestHandler | null;
|
|
9
11
|
}) => S3Client;
|
package/dist/get-s3-client.js
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getS3Client = void 0;
|
|
4
4
|
const get_service_client_1 = require("./get-service-client");
|
|
5
|
-
const getS3Client = ({ region, customCredentials, forcePathStyle, }) => {
|
|
5
|
+
const getS3Client = ({ region, customCredentials, forcePathStyle, requestHandler, }) => {
|
|
6
6
|
var _a;
|
|
7
7
|
return (0, get_service_client_1.getServiceClient)({
|
|
8
8
|
region: (_a = customCredentials === null || customCredentials === void 0 ? void 0 : customCredentials.region) !== null && _a !== void 0 ? _a : region,
|
|
9
9
|
service: 's3',
|
|
10
10
|
customCredentials,
|
|
11
11
|
forcePathStyle,
|
|
12
|
+
requestHandler,
|
|
12
13
|
});
|
|
13
14
|
};
|
|
14
15
|
exports.getS3Client = getS3Client;
|
|
@@ -7,6 +7,7 @@ import { STSClient } from '@aws-sdk/client-sts';
|
|
|
7
7
|
import type { CustomCredentials } from '@remotion/serverless-client';
|
|
8
8
|
import type { AwsProvider } from './aws-provider';
|
|
9
9
|
import type { AwsRegion } from './regions';
|
|
10
|
+
import type { RequestHandler } from './types';
|
|
10
11
|
export type ServiceMapping = {
|
|
11
12
|
s3: S3Client;
|
|
12
13
|
cloudwatch: CloudWatchLogsClient;
|
|
@@ -15,9 +16,10 @@ export type ServiceMapping = {
|
|
|
15
16
|
servicequotas: ServiceQuotasClient;
|
|
16
17
|
sts: STSClient;
|
|
17
18
|
};
|
|
18
|
-
export declare const getServiceClient: <T extends keyof ServiceMapping>({ region, service, customCredentials, forcePathStyle, }: {
|
|
19
|
+
export declare const getServiceClient: <T extends keyof ServiceMapping>({ region, service, customCredentials, forcePathStyle, requestHandler, }: {
|
|
19
20
|
region: AwsRegion;
|
|
20
21
|
service: T;
|
|
21
22
|
customCredentials: CustomCredentials<AwsProvider> | null;
|
|
22
23
|
forcePathStyle: boolean;
|
|
24
|
+
requestHandler: RequestHandler | null;
|
|
23
25
|
}) => ServiceMapping[T];
|
|
@@ -11,7 +11,7 @@ const serverless_client_1 = require("@remotion/serverless-client");
|
|
|
11
11
|
const check_credentials_1 = require("./check-credentials");
|
|
12
12
|
const get_credentials_1 = require("./get-credentials");
|
|
13
13
|
const get_env_variable_1 = require("./get-env-variable");
|
|
14
|
-
const getCredentialsHash = ({ customCredentials, region, service, forcePathStyle, }) => {
|
|
14
|
+
const getCredentialsHash = ({ customCredentials, region, service, forcePathStyle, requestHandler, }) => {
|
|
15
15
|
const hashComponents = {};
|
|
16
16
|
if ((0, get_env_variable_1.getEnvVariable)('REMOTION_SKIP_AWS_CREDENTIALS_CHECK')) {
|
|
17
17
|
hashComponents.credentials = {
|
|
@@ -46,10 +46,11 @@ const getCredentialsHash = ({ customCredentials, region, service, forcePathStyle
|
|
|
46
46
|
hashComponents.region = region;
|
|
47
47
|
hashComponents.service = service;
|
|
48
48
|
hashComponents.forcePathStyle = forcePathStyle;
|
|
49
|
+
hashComponents.requestHandler = requestHandler;
|
|
49
50
|
return (0, serverless_client_1.random)(JSON.stringify(hashComponents)).toString().replace('0.', '');
|
|
50
51
|
};
|
|
51
52
|
const _clients = {};
|
|
52
|
-
const getServiceClient = ({ region, service, customCredentials, forcePathStyle, }) => {
|
|
53
|
+
const getServiceClient = ({ region, service, customCredentials, forcePathStyle, requestHandler, }) => {
|
|
53
54
|
var _a;
|
|
54
55
|
const Client = (() => {
|
|
55
56
|
if (service === 'cloudwatch') {
|
|
@@ -77,6 +78,7 @@ const getServiceClient = ({ region, service, customCredentials, forcePathStyle,
|
|
|
77
78
|
customCredentials,
|
|
78
79
|
service,
|
|
79
80
|
forcePathStyle,
|
|
81
|
+
requestHandler,
|
|
80
82
|
});
|
|
81
83
|
if (!_clients[key]) {
|
|
82
84
|
(0, check_credentials_1.checkCredentials)();
|
|
@@ -87,6 +89,12 @@ const getServiceClient = ({ region, service, customCredentials, forcePathStyle,
|
|
|
87
89
|
},
|
|
88
90
|
}
|
|
89
91
|
: undefined;
|
|
92
|
+
// Merge custom requestHandler with lambda options
|
|
93
|
+
const finalRequestHandler = requestHandler
|
|
94
|
+
? lambdaOptions
|
|
95
|
+
? { ...requestHandler, ...lambdaOptions }
|
|
96
|
+
: requestHandler
|
|
97
|
+
: lambdaOptions;
|
|
90
98
|
const client = customCredentials
|
|
91
99
|
? new Client({
|
|
92
100
|
region: (_a = customCredentials.region) !== null && _a !== void 0 ? _a : 'us-east-1',
|
|
@@ -97,20 +105,20 @@ const getServiceClient = ({ region, service, customCredentials, forcePathStyle,
|
|
|
97
105
|
}
|
|
98
106
|
: undefined,
|
|
99
107
|
endpoint: customCredentials.endpoint,
|
|
100
|
-
requestHandler:
|
|
108
|
+
requestHandler: finalRequestHandler,
|
|
101
109
|
forcePathStyle: customCredentials.forcePathStyle,
|
|
102
110
|
maxAttempts: service === 'lambda' ? 1 : undefined,
|
|
103
111
|
})
|
|
104
112
|
: (0, get_env_variable_1.getEnvVariable)('REMOTION_SKIP_AWS_CREDENTIALS_CHECK')
|
|
105
113
|
? new Client({
|
|
106
114
|
region,
|
|
107
|
-
requestHandler:
|
|
115
|
+
requestHandler: finalRequestHandler,
|
|
108
116
|
maxAttempts: service === 'lambda' ? 1 : undefined,
|
|
109
117
|
})
|
|
110
118
|
: new Client({
|
|
111
119
|
region,
|
|
112
120
|
credentials: (0, get_credentials_1.getCredentials)(),
|
|
113
|
-
requestHandler:
|
|
121
|
+
requestHandler: finalRequestHandler,
|
|
114
122
|
maxAttempts: service === 'lambda' ? 1 : undefined,
|
|
115
123
|
});
|
|
116
124
|
if ((0, get_env_variable_1.getEnvVariable)('REMOTION_DISABLE_AWS_CLIENT_CACHE')) {
|
package/dist/get-sites.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { ProviderSpecifics } from '@remotion/serverless-client';
|
|
|
2
2
|
import type { AwsProvider } from './aws-provider';
|
|
3
3
|
import type { BucketWithLocation } from './get-buckets';
|
|
4
4
|
import type { AwsRegion } from './regions';
|
|
5
|
+
import type { RequestHandler } from './types';
|
|
5
6
|
type Site = {
|
|
6
7
|
sizeInBytes: number;
|
|
7
8
|
lastModified: number | null;
|
|
@@ -15,6 +16,7 @@ type MandatoryParameters = {
|
|
|
15
16
|
type OptionalParameters = {
|
|
16
17
|
forceBucketName: string | null;
|
|
17
18
|
forcePathStyle: boolean;
|
|
19
|
+
requestHandler: RequestHandler | null;
|
|
18
20
|
};
|
|
19
21
|
type GetSitesInternalInput = MandatoryParameters & OptionalParameters;
|
|
20
22
|
export type GetSitesInput = MandatoryParameters & Partial<OptionalParameters>;
|
|
@@ -22,8 +24,8 @@ export type GetSitesOutput = {
|
|
|
22
24
|
sites: Site[];
|
|
23
25
|
buckets: BucketWithLocation[];
|
|
24
26
|
};
|
|
25
|
-
export declare const internalGetSites: ({ region, forceBucketName, providerSpecifics, forcePathStyle, }: GetSitesInternalInput & {
|
|
27
|
+
export declare const internalGetSites: ({ region, forceBucketName, providerSpecifics, forcePathStyle, requestHandler, }: GetSitesInternalInput & {
|
|
26
28
|
providerSpecifics: ProviderSpecifics<AwsProvider>;
|
|
27
29
|
}) => Promise<GetSitesOutput>;
|
|
28
|
-
export declare const getSites: ({ region, forceBucketName, forcePathStyle, }: GetSitesInput) => Promise<GetSitesOutput>;
|
|
30
|
+
export declare const getSites: ({ region, forceBucketName, forcePathStyle, requestHandler, }: GetSitesInput) => Promise<GetSitesOutput>;
|
|
29
31
|
export {};
|
package/dist/get-sites.js
CHANGED
|
@@ -4,18 +4,20 @@ exports.getSites = exports.internalGetSites = void 0;
|
|
|
4
4
|
const aws_provider_1 = require("./aws-provider");
|
|
5
5
|
const constants_1 = require("./constants");
|
|
6
6
|
const make_s3_url_1 = require("./make-s3-url");
|
|
7
|
-
const internalGetSites = async ({ region, forceBucketName, providerSpecifics, forcePathStyle, }) => {
|
|
7
|
+
const internalGetSites = async ({ region, forceBucketName, providerSpecifics, forcePathStyle, requestHandler, }) => {
|
|
8
8
|
var _a;
|
|
9
9
|
const remotionBuckets = forceBucketName
|
|
10
10
|
? await providerSpecifics.getBuckets({
|
|
11
11
|
region,
|
|
12
12
|
forceBucketName,
|
|
13
13
|
forcePathStyle,
|
|
14
|
+
requestHandler,
|
|
14
15
|
})
|
|
15
16
|
: await providerSpecifics.getBuckets({
|
|
16
17
|
region,
|
|
17
18
|
forceBucketName: null,
|
|
18
19
|
forcePathStyle,
|
|
20
|
+
requestHandler,
|
|
19
21
|
});
|
|
20
22
|
const accountId = await providerSpecifics.getAccountId({ region });
|
|
21
23
|
const sites = {};
|
|
@@ -26,6 +28,7 @@ const internalGetSites = async ({ region, forceBucketName, providerSpecifics, fo
|
|
|
26
28
|
region,
|
|
27
29
|
expectedBucketOwner: accountId,
|
|
28
30
|
forcePathStyle,
|
|
31
|
+
requestHandler,
|
|
29
32
|
});
|
|
30
33
|
for (const file of ls) {
|
|
31
34
|
const siteKeyMatch = (_a = file.Key) === null || _a === void 0 ? void 0 : _a.match(/sites\/([0-9a-zA-Z-!_.*'()]+)\/(.*)$/);
|
|
@@ -68,12 +71,13 @@ exports.internalGetSites = internalGetSites;
|
|
|
68
71
|
* @description Gets an array of Remotion projects in Cloud Storage, in your GCP project.
|
|
69
72
|
* @see [Documentation](https://remotion.dev/docs/cloudrun/getsites)
|
|
70
73
|
*/
|
|
71
|
-
const getSites = ({ region, forceBucketName, forcePathStyle, }) => {
|
|
74
|
+
const getSites = ({ region, forceBucketName, forcePathStyle, requestHandler, }) => {
|
|
72
75
|
return (0, exports.internalGetSites)({
|
|
73
76
|
region,
|
|
74
77
|
forceBucketName: forceBucketName !== null && forceBucketName !== void 0 ? forceBucketName : null,
|
|
75
78
|
forcePathStyle: forcePathStyle !== null && forcePathStyle !== void 0 ? forcePathStyle : false,
|
|
76
79
|
providerSpecifics: aws_provider_1.awsImplementation,
|
|
80
|
+
requestHandler: requestHandler !== null && requestHandler !== void 0 ? requestHandler : null,
|
|
77
81
|
});
|
|
78
82
|
};
|
|
79
83
|
exports.getSites = getSites;
|
package/dist/head-file.js
CHANGED
|
@@ -3,11 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.lambdaHeadFileImplementation = void 0;
|
|
4
4
|
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
5
5
|
const get_s3_client_1 = require("./get-s3-client");
|
|
6
|
-
const lambdaHeadFileImplementation = async ({ bucketName, key, region, customCredentials, forcePathStyle, }) => {
|
|
6
|
+
const lambdaHeadFileImplementation = async ({ bucketName, key, region, customCredentials, forcePathStyle, requestHandler, }) => {
|
|
7
7
|
const head = await (0, get_s3_client_1.getS3Client)({
|
|
8
8
|
region,
|
|
9
9
|
customCredentials,
|
|
10
10
|
forcePathStyle,
|
|
11
|
+
requestHandler,
|
|
11
12
|
}).send(new client_s3_1.HeadObjectCommand({
|
|
12
13
|
Bucket: bucketName,
|
|
13
14
|
Key: key,
|
package/dist/index.d.ts
CHANGED
|
@@ -22,27 +22,29 @@ export type { AwsRegion } from './regions';
|
|
|
22
22
|
export { renderMediaOnLambda, renderVideoOnLambda, type RenderMediaOnLambdaInput, type RenderMediaOnLambdaOutput, } from './render-media-on-lambda';
|
|
23
23
|
export { renderStillOnLambda, type RenderStillOnLambdaInput, type RenderStillOnLambdaOutput, } from './render-still-on-lambda';
|
|
24
24
|
export { speculateFunctionName, type SpeculateFunctionNameInput, } from './speculate-function-name';
|
|
25
|
+
export type { RequestHandler } from './types';
|
|
25
26
|
export { validateWebhookSignature } from './validate-webhook-signature';
|
|
26
27
|
export declare const LambdaClientInternals: {
|
|
27
28
|
generateRandomHashWithLifeCycleRule: <Provider extends import("@remotion/serverless-client").CloudProvider>({ deleteAfter, randomHashFn, }: {
|
|
28
29
|
deleteAfter: import("@remotion/serverless-client").DeleteAfter | null;
|
|
29
30
|
randomHashFn: import("@remotion/serverless-client").ProviderSpecifics<Provider>["randomHash"];
|
|
30
31
|
}) => string;
|
|
31
|
-
getLambdaClient: (region: import("./regions").AwsRegion, _timeoutInTest
|
|
32
|
-
getS3Client: ({ region, customCredentials, forcePathStyle, }: {
|
|
32
|
+
getLambdaClient: (region: import("./regions").AwsRegion, _timeoutInTest: number | undefined, requestHandler: import("./types").RequestHandler | null) => import("@aws-sdk/client-lambda").LambdaClient;
|
|
33
|
+
getS3Client: ({ region, customCredentials, forcePathStyle, requestHandler, }: {
|
|
33
34
|
region: import("./regions").AwsRegion;
|
|
34
35
|
customCredentials: import("@remotion/serverless-client").CustomCredentials<import("./aws-provider").AwsProvider> | null;
|
|
35
36
|
forcePathStyle: boolean;
|
|
37
|
+
requestHandler: import("./types").RequestHandler | null;
|
|
36
38
|
}) => import("@aws-sdk/client-s3").S3Client;
|
|
37
39
|
getS3RenderUrl: ({ renderId, region, bucketName, }: {
|
|
38
40
|
renderId: string;
|
|
39
41
|
region: import("./regions").AwsRegion;
|
|
40
42
|
bucketName: string;
|
|
41
43
|
}) => string;
|
|
42
|
-
getIamClient: (region: import("./regions").AwsRegion) => import("@aws-sdk/client-iam").IAMClient;
|
|
43
|
-
getStsClient: (region: import("./regions").AwsRegion) => import("@aws-sdk/client-sts").STSClient;
|
|
44
|
-
getCloudWatchLogsClient: (region: import("./regions").AwsRegion) => import("@aws-sdk/client-cloudwatch-logs").CloudWatchLogsClient;
|
|
45
|
-
getServiceQuotasClient: (region: import("./regions").AwsRegion) => import("@aws-sdk/client-service-quotas").ServiceQuotasClient;
|
|
44
|
+
getIamClient: (region: import("./regions").AwsRegion, requestHandler: import("./types").RequestHandler | null) => import("@aws-sdk/client-iam").IAMClient;
|
|
45
|
+
getStsClient: (region: import("./regions").AwsRegion, requestHandler: import("./types").RequestHandler | null) => import("@aws-sdk/client-sts").STSClient;
|
|
46
|
+
getCloudWatchLogsClient: (region: import("./regions").AwsRegion, requestHandler: import("./types").RequestHandler | null) => import("@aws-sdk/client-cloudwatch-logs").CloudWatchLogsClient;
|
|
47
|
+
getServiceQuotasClient: (region: import("./regions").AwsRegion, requestHandler: import("./types").RequestHandler | null) => import("@aws-sdk/client-service-quotas").ServiceQuotasClient;
|
|
46
48
|
parseJsonOrThrowSource: (data: Uint8Array, type: string) => any;
|
|
47
49
|
getCloudwatchMethodUrl: ({ region, functionName, renderId, rendererFunctionName, method, }: {
|
|
48
50
|
region: import("./regions").AwsRegion;
|
|
@@ -69,7 +71,7 @@ export declare const LambdaClientInternals: {
|
|
|
69
71
|
parseBucketName: (name: string) => {
|
|
70
72
|
region: import("./regions").AwsRegion | null;
|
|
71
73
|
};
|
|
72
|
-
makeLambdaRenderMediaPayload: ({ rendererFunctionName, frameRange, framesPerLambda, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, x264Preset, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, encodingMaxRate, encodingBufferSize, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, deleteAfter, colorSpace, preferLossless, forcePathStyle, metadata, apiKey, offthreadVideoThreads, storageClass, }: import("./make-lambda-payload").InnerRenderMediaOnLambdaInput) => Promise<import("@remotion/serverless-client").ServerlessStartPayload<import("./aws-provider").AwsProvider>>;
|
|
74
|
+
makeLambdaRenderMediaPayload: ({ rendererFunctionName, frameRange, framesPerLambda, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, x264Preset, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, encodingMaxRate, encodingBufferSize, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, deleteAfter, colorSpace, preferLossless, forcePathStyle, metadata, apiKey, offthreadVideoThreads, storageClass, requestHandler, }: import("./make-lambda-payload").InnerRenderMediaOnLambdaInput) => Promise<import("@remotion/serverless-client").ServerlessStartPayload<import("./aws-provider").AwsProvider>>;
|
|
73
75
|
renderMediaOnLambdaOptionalToRequired: (options: import("./render-media-on-lambda").RenderMediaOnLambdaInput) => import("./make-lambda-payload").InnerRenderMediaOnLambdaInput;
|
|
74
76
|
internalDeleteRender: (input: import("./delete-render").DeleteRenderInput & {
|
|
75
77
|
providerSpecifics: import("@remotion/serverless-client").ProviderSpecifics<import("./aws-provider").AwsProvider>;
|
|
@@ -77,11 +79,12 @@ export declare const LambdaClientInternals: {
|
|
|
77
79
|
}) => Promise<{
|
|
78
80
|
freedBytes: number;
|
|
79
81
|
}>;
|
|
80
|
-
internalGetSites: ({ region, forceBucketName, providerSpecifics, forcePathStyle, }: ({
|
|
82
|
+
internalGetSites: ({ region, forceBucketName, providerSpecifics, forcePathStyle, requestHandler, }: ({
|
|
81
83
|
region: import("./regions").AwsRegion;
|
|
82
84
|
} & {
|
|
83
85
|
forceBucketName: string | null;
|
|
84
86
|
forcePathStyle: boolean;
|
|
87
|
+
requestHandler: import("./types").RequestHandler | null;
|
|
85
88
|
}) & {
|
|
86
89
|
providerSpecifics: import("@remotion/serverless-client").ProviderSpecifics<import("./aws-provider").AwsProvider>;
|
|
87
90
|
}) => Promise<import("./get-sites").GetSitesOutput>;
|
|
@@ -104,7 +107,7 @@ export declare const LambdaClientInternals: {
|
|
|
104
107
|
getEnvVariable: (name: string) => string | undefined;
|
|
105
108
|
internalRenderMediaOnLambdaRaw: (input: import("./make-lambda-payload").InnerRenderMediaOnLambdaInput) => Promise<import("./render-media-on-lambda").RenderMediaOnLambdaOutput>;
|
|
106
109
|
internalRenderStillOnLambda: (input: import("./render-still-on-lambda").RenderStillOnLambdaNonNullInput) => Promise<import("./render-still-on-lambda").RenderStillOnLambdaOutput>;
|
|
107
|
-
cleanItems: <Provider extends import("@remotion/serverless-client").CloudProvider>({ bucket, onAfterItemDeleted, onBeforeItemDeleted, region, list, providerSpecifics, forcePathStyle, }: {
|
|
110
|
+
cleanItems: <Provider extends import("@remotion/serverless-client").CloudProvider>({ bucket, onAfterItemDeleted, onBeforeItemDeleted, region, list, providerSpecifics, forcePathStyle, requestHandler, }: {
|
|
108
111
|
bucket: string;
|
|
109
112
|
region: Provider["region"];
|
|
110
113
|
list: string[];
|
|
@@ -118,8 +121,9 @@ export declare const LambdaClientInternals: {
|
|
|
118
121
|
}) => void;
|
|
119
122
|
providerSpecifics: import("@remotion/serverless-client").ProviderSpecifics<Provider>;
|
|
120
123
|
forcePathStyle: boolean;
|
|
124
|
+
requestHandler: Provider["requestHandler"] | null;
|
|
121
125
|
}) => Promise<void[]>;
|
|
122
|
-
makeLambdaRenderStillPayload: ({ serveUrl, inputProps, imageFormat, envVariables, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, offthreadVideoCacheSizeInBytes, deleteAfter, forcePathStyle, apiKey, storageClass, }: import("./render-still-on-lambda").RenderStillOnLambdaNonNullInput) => Promise<import("@remotion/serverless-client").ServerlessPayloads<import("./aws-provider").AwsProvider>[import("@remotion/serverless-client").ServerlessRoutines.still]>;
|
|
126
|
+
makeLambdaRenderStillPayload: ({ serveUrl, inputProps, imageFormat, envVariables, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, offthreadVideoCacheSizeInBytes, deleteAfter, forcePathStyle, apiKey, storageClass, requestHandler, }: import("./render-still-on-lambda").RenderStillOnLambdaNonNullInput) => Promise<import("@remotion/serverless-client").ServerlessPayloads<import("./aws-provider").AwsProvider>[import("@remotion/serverless-client").ServerlessRoutines.still]>;
|
|
123
127
|
getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, logLevel, forcePathStyle, }: import("./get-render-progress").GetRenderProgressInput) => import("@remotion/serverless-client").ServerlessStatusPayload<import("./aws-provider").AwsProvider>;
|
|
124
128
|
innerSpeculateFunctionName: ({ diskSizeInMb, memorySizeInMb, timeoutInSeconds, }: import("./speculate-function-name").SpeculateFunctionNameInput) => string;
|
|
125
129
|
};
|
package/dist/is-flaky-error.js
CHANGED
|
@@ -28,7 +28,8 @@ const isFlakyError = (err) => {
|
|
|
28
28
|
if (message.includes('Compositor exited') && !message.includes('SIGSEGV')) {
|
|
29
29
|
return true;
|
|
30
30
|
}
|
|
31
|
-
if (message.includes('Timed out
|
|
31
|
+
if (message.includes('Timed out') &&
|
|
32
|
+
message.includes('while setting up the headless browser')) {
|
|
32
33
|
return true;
|
|
33
34
|
}
|
|
34
35
|
// https://github.com/remotion-dev/remotion/issues/2742
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { CustomCredentials } from '@remotion/serverless-client';
|
|
2
2
|
import type { AwsProvider } from './aws-provider';
|
|
3
3
|
import type { AwsRegion } from './regions';
|
|
4
|
-
|
|
4
|
+
import type { RequestHandler } from './types';
|
|
5
|
+
export declare const applyLifeCyleOperation: ({ enableFolderExpiry, bucketName, region, customCredentials, forcePathStyle, requestHandler, }: {
|
|
5
6
|
enableFolderExpiry: boolean | null;
|
|
6
7
|
bucketName: string;
|
|
7
8
|
region: AwsRegion;
|
|
8
9
|
customCredentials: CustomCredentials<AwsProvider> | null;
|
|
9
10
|
forcePathStyle: boolean;
|
|
11
|
+
requestHandler: RequestHandler | null;
|
|
10
12
|
}) => Promise<void>;
|
package/dist/lifecycle-rules.js
CHANGED
|
@@ -5,7 +5,7 @@ const client_s3_1 = require("@aws-sdk/client-s3");
|
|
|
5
5
|
const apply_lifecycle_1 = require("./apply-lifecycle");
|
|
6
6
|
const get_s3_client_1 = require("./get-s3-client");
|
|
7
7
|
const lifecycle_1 = require("./lifecycle");
|
|
8
|
-
const createLCRules = async ({ bucketName, region, customCredentials, forcePathStyle, }) => {
|
|
8
|
+
const createLCRules = async ({ bucketName, region, customCredentials, forcePathStyle, requestHandler, }) => {
|
|
9
9
|
var _a;
|
|
10
10
|
const lcRules = (0, lifecycle_1.getLifeCycleRules)();
|
|
11
11
|
// create the lifecyle rules
|
|
@@ -15,7 +15,12 @@ const createLCRules = async ({ bucketName, region, customCredentials, forcePathS
|
|
|
15
15
|
});
|
|
16
16
|
const createCommand = new client_s3_1.PutBucketLifecycleConfigurationCommand(createCommandInput);
|
|
17
17
|
try {
|
|
18
|
-
await (0, get_s3_client_1.getS3Client)({
|
|
18
|
+
await (0, get_s3_client_1.getS3Client)({
|
|
19
|
+
region,
|
|
20
|
+
customCredentials,
|
|
21
|
+
forcePathStyle,
|
|
22
|
+
requestHandler,
|
|
23
|
+
}).send(createCommand);
|
|
19
24
|
}
|
|
20
25
|
catch (err) {
|
|
21
26
|
if ((_a = err.stack) === null || _a === void 0 ? void 0 : _a.includes('AccessDenied')) {
|
|
@@ -23,13 +28,18 @@ const createLCRules = async ({ bucketName, region, customCredentials, forcePathS
|
|
|
23
28
|
}
|
|
24
29
|
}
|
|
25
30
|
};
|
|
26
|
-
const deleteLCRules = async ({ bucketName, region, customCredentials, forcePathStyle, }) => {
|
|
31
|
+
const deleteLCRules = async ({ bucketName, region, customCredentials, forcePathStyle, requestHandler, }) => {
|
|
27
32
|
var _a;
|
|
28
33
|
const deleteCommandInput = (0, apply_lifecycle_1.deleteLifeCycleInput)({
|
|
29
34
|
bucketName,
|
|
30
35
|
});
|
|
31
36
|
try {
|
|
32
|
-
await (0, get_s3_client_1.getS3Client)({
|
|
37
|
+
await (0, get_s3_client_1.getS3Client)({
|
|
38
|
+
region,
|
|
39
|
+
customCredentials,
|
|
40
|
+
forcePathStyle,
|
|
41
|
+
requestHandler,
|
|
42
|
+
}).send(new client_s3_1.DeleteBucketLifecycleCommand(deleteCommandInput));
|
|
33
43
|
}
|
|
34
44
|
catch (err) {
|
|
35
45
|
if ((_a = err.stack) === null || _a === void 0 ? void 0 : _a.includes('AccessDenied')) {
|
|
@@ -37,7 +47,7 @@ const deleteLCRules = async ({ bucketName, region, customCredentials, forcePathS
|
|
|
37
47
|
}
|
|
38
48
|
}
|
|
39
49
|
};
|
|
40
|
-
const applyLifeCyleOperation = async ({ enableFolderExpiry, bucketName, region, customCredentials, forcePathStyle, }) => {
|
|
50
|
+
const applyLifeCyleOperation = async ({ enableFolderExpiry, bucketName, region, customCredentials, forcePathStyle, requestHandler, }) => {
|
|
41
51
|
if (enableFolderExpiry === null) {
|
|
42
52
|
return;
|
|
43
53
|
}
|
|
@@ -47,6 +57,7 @@ const applyLifeCyleOperation = async ({ enableFolderExpiry, bucketName, region,
|
|
|
47
57
|
region,
|
|
48
58
|
customCredentials,
|
|
49
59
|
forcePathStyle,
|
|
60
|
+
requestHandler,
|
|
50
61
|
});
|
|
51
62
|
}
|
|
52
63
|
else {
|
|
@@ -55,6 +66,7 @@ const applyLifeCyleOperation = async ({ enableFolderExpiry, bucketName, region,
|
|
|
55
66
|
region,
|
|
56
67
|
customCredentials,
|
|
57
68
|
forcePathStyle,
|
|
69
|
+
requestHandler,
|
|
58
70
|
});
|
|
59
71
|
}
|
|
60
72
|
};
|