@remotion/lambda 4.0.187 → 4.0.188
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/api/__mocks__/clean-items.d.ts +2 -0
- package/dist/api/__mocks__/clean-items.js +24 -0
- package/dist/api/__mocks__/create-function.d.ts +2 -0
- package/dist/api/__mocks__/create-function.js +21 -0
- package/dist/api/__mocks__/delete-function.d.ts +2 -0
- package/dist/api/__mocks__/delete-function.js +9 -0
- package/dist/api/__mocks__/get-functions.d.ts +2 -0
- package/dist/api/__mocks__/get-functions.js +9 -0
- package/dist/api/__mocks__/upload-dir.d.ts +3 -0
- package/dist/api/__mocks__/upload-dir.js +47 -0
- package/dist/api/bucket-exists.d.ts +3 -6
- package/dist/api/bucket-exists.js +5 -5
- package/dist/api/clean-items.d.ts +4 -3
- package/dist/api/clean-items.js +7 -7
- package/dist/api/create-bucket.d.ts +3 -5
- package/dist/api/create-bucket.js +6 -6
- package/dist/api/create-function.d.ts +1 -1
- package/dist/api/delete-function.d.ts +1 -1
- package/dist/api/delete-render.d.ts +10 -3
- package/dist/api/delete-render.js +27 -19
- package/dist/api/delete-site.d.ts +7 -2
- package/dist/api/delete-site.js +23 -15
- package/dist/api/deploy-function.d.ts +1 -1
- package/dist/api/deploy-function.js +2 -2
- package/dist/api/deploy-site.d.ts +9 -5
- package/dist/api/deploy-site.js +11 -12
- package/dist/api/download-media.d.ts +8 -3
- package/dist/api/download-media.js +24 -15
- package/dist/api/estimate-price.d.ts +1 -1
- package/dist/api/get-aws-client.d.ts +4 -2
- package/dist/api/get-aws-client.js +2 -2
- package/dist/api/get-buckets.d.ts +4 -4
- package/dist/api/get-buckets.js +12 -14
- package/dist/api/get-compositions-on-lambda.js +7 -6
- package/dist/api/get-function-info.d.ts +1 -1
- package/dist/api/get-functions.d.ts +1 -1
- package/dist/api/get-or-create-bucket.d.ts +3 -19
- package/dist/api/get-or-create-bucket.js +5 -39
- package/dist/api/get-regions.d.ts +1 -1
- package/dist/api/get-regions.js +1 -2
- package/dist/api/get-render-progress.d.ts +4 -3
- package/dist/api/get-render-progress.js +2 -2
- package/dist/api/get-sites.d.ts +6 -1
- package/dist/api/get-sites.js +21 -14
- package/dist/api/iam-validation/role-permissions.js +2 -1
- package/dist/api/iam-validation/simulate-rule.d.ts +1 -1
- package/dist/api/iam-validation/simulate.d.ts +1 -1
- package/dist/api/iam-validation/user-permissions.js +2 -1
- package/dist/api/make-lambda-payload.d.ts +8 -9
- package/dist/api/make-lambda-payload.js +15 -13
- package/dist/api/mock-functions.d.ts +1 -1
- package/dist/api/presign-url.d.ts +1 -1
- package/dist/api/presign-url.js +4 -4
- package/dist/api/render-media-on-lambda.d.ts +5 -6
- package/dist/api/render-media-on-lambda.js +5 -5
- package/dist/api/render-still-on-lambda.d.ts +8 -6
- package/dist/api/render-still-on-lambda.js +6 -5
- package/dist/api/upload-dir.d.ts +2 -2
- package/dist/api/upload-dir.js +2 -2
- package/dist/cli/args.d.ts +2 -3
- package/dist/cli/commands/render/progress.d.ts +2 -2
- package/dist/cli/commands/render/progress.js +6 -5
- package/dist/cli/commands/render/render.d.ts +3 -1
- package/dist/cli/commands/render/render.js +3 -2
- package/dist/cli/commands/sites/create.d.ts +3 -1
- package/dist/cli/commands/sites/create.js +6 -5
- package/dist/cli/commands/sites/index.d.ts +3 -1
- package/dist/cli/commands/sites/index.js +4 -4
- package/dist/cli/commands/sites/rm.d.ts +3 -1
- package/dist/cli/commands/sites/rm.js +4 -3
- package/dist/cli/commands/sites/rmall.d.ts +3 -1
- package/dist/cli/commands/sites/rmall.js +4 -3
- package/dist/cli/commands/still.d.ts +3 -1
- package/dist/cli/commands/still.js +3 -2
- package/dist/cli/get-aws-region.d.ts +1 -1
- package/dist/cli/helpers/__mocks__/quit.d.ts +1 -0
- package/dist/cli/helpers/__mocks__/quit.js +7 -0
- package/dist/cli/index.d.ts +3 -1
- package/dist/cli/index.js +8 -7
- package/dist/client.d.ts +4 -5
- package/dist/functions/aws-implementation.d.ts +11 -0
- package/dist/functions/aws-implementation.js +49 -0
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +4 -1
- package/dist/functions/compositions.d.ts +3 -2
- package/dist/functions/compositions.js +18 -15
- package/dist/functions/helpers/__mocks__/get-browser-instance.d.ts +3 -0
- package/dist/functions/helpers/__mocks__/get-browser-instance.js +12 -0
- package/dist/functions/helpers/__mocks__/leak-detection.d.ts +4 -0
- package/dist/functions/helpers/__mocks__/leak-detection.js +9 -0
- package/dist/functions/helpers/__mocks__/timer.d.ts +2 -0
- package/dist/functions/helpers/__mocks__/timer.js +10 -0
- package/dist/functions/helpers/calculate-price-from-bucket.d.ts +5 -3
- package/dist/functions/helpers/calculate-price-from-bucket.js +2 -3
- package/dist/functions/helpers/cleanup-props.d.ts +4 -2
- package/dist/functions/helpers/cleanup-props.js +5 -4
- package/dist/functions/helpers/concat-videos.d.ts +2 -2
- package/dist/functions/helpers/create-post-render-data.d.ts +8 -8
- package/dist/functions/helpers/create-post-render-data.js +1 -1
- package/dist/functions/helpers/expected-out-name.d.ts +4 -4
- package/dist/functions/helpers/find-output-file-in-bucket.d.ts +8 -7
- package/dist/functions/helpers/find-output-file-in-bucket.js +5 -6
- package/dist/functions/helpers/get-browser-instance.d.ts +3 -2
- package/dist/functions/helpers/get-browser-instance.js +3 -4
- package/dist/functions/helpers/get-current-region.d.ts +1 -1
- package/dist/functions/helpers/get-current-region.js +3 -3
- package/dist/functions/helpers/get-custom-out-name.d.ts +5 -5
- package/dist/functions/helpers/get-folder-files.d.ts +2 -0
- package/dist/functions/helpers/get-folder-files.js +38 -0
- package/dist/functions/helpers/get-output-url-from-metadata.d.ts +4 -3
- package/dist/functions/helpers/get-output-url-from-metadata.js +4 -5
- package/dist/functions/helpers/get-overall-progress-s3.d.ts +5 -4
- package/dist/functions/helpers/get-overall-progress-s3.js +5 -7
- package/dist/functions/helpers/get-progress.d.ts +8 -7
- package/dist/functions/helpers/get-progress.js +7 -5
- package/dist/functions/helpers/inspect-errors.d.ts +1 -1
- package/dist/functions/helpers/inspect-errors.js +4 -4
- package/dist/functions/helpers/io.d.ts +3 -36
- package/dist/functions/helpers/io.js +3 -104
- package/dist/functions/helpers/lifecycle.d.ts +3 -9
- package/dist/functions/helpers/lifecycle.js +6 -16
- package/dist/functions/helpers/make-aws-artifact.d.ts +3 -0
- package/dist/functions/helpers/make-aws-artifact.js +12 -0
- package/dist/functions/helpers/make-timeout-error.d.ts +5 -4
- package/dist/functions/helpers/make-timeout-error.js +2 -1
- package/dist/functions/helpers/make-timeout-message.d.ts +5 -3
- package/dist/functions/helpers/make-timeout-message.js +8 -9
- package/dist/functions/helpers/merge-chunks.d.ts +10 -10
- package/dist/functions/helpers/merge-chunks.js +7 -8
- package/dist/functions/helpers/overall-render-progress.d.ts +18 -23
- package/dist/functions/helpers/overall-render-progress.js +5 -5
- package/dist/functions/helpers/print-cloudwatch-helper.d.ts +2 -2
- package/dist/functions/helpers/print-logging-helper.d.ts +4 -0
- package/dist/functions/helpers/print-logging-helper.js +12 -0
- package/dist/functions/helpers/read-with-progress.d.ts +4 -3
- package/dist/functions/helpers/read-with-progress.js +2 -2
- package/dist/functions/helpers/render-has-audio-video.d.ts +3 -2
- package/dist/functions/helpers/stream-renderer.d.ts +7 -4
- package/dist/functions/helpers/stream-renderer.js +11 -10
- package/dist/functions/helpers/streamify-response.d.ts +0 -20
- package/dist/functions/helpers/streamify-response.js +1 -62
- package/dist/functions/helpers/validate-composition.d.ts +5 -3
- package/dist/functions/helpers/validate-composition.js +2 -3
- package/dist/functions/index.d.ts +5 -3
- package/dist/functions/index.js +98 -72
- package/dist/functions/info.d.ts +1 -1
- package/dist/functions/info.js +2 -2
- package/dist/functions/launch.d.ts +3 -2
- package/dist/functions/launch.js +54 -41
- package/dist/functions/progress.d.ts +6 -3
- package/dist/functions/progress.js +5 -4
- package/dist/functions/provider-implementation.d.ts +0 -0
- package/dist/functions/provider-implementation.js +1 -0
- package/dist/functions/renderer.d.ts +9 -3
- package/dist/functions/renderer.js +30 -22
- package/dist/functions/start.d.ts +3 -2
- package/dist/functions/start.js +13 -16
- package/dist/functions/still.d.ts +8 -18
- package/dist/functions/still.js +47 -46
- package/dist/index.d.ts +4 -6
- package/dist/internals.d.ts +16 -14
- package/dist/io/delete-file.d.ts +3 -0
- package/dist/io/delete-file.js +12 -0
- package/dist/io/head-file.d.ts +3 -0
- package/dist/io/head-file.js +13 -0
- package/dist/io/list-objects.d.ts +3 -0
- package/dist/io/list-objects.js +58 -0
- package/dist/io/read-file.d.ts +9 -0
- package/dist/io/read-file.js +14 -0
- package/dist/io/write-file.d.ts +5 -0
- package/dist/io/write-file.js +51 -0
- package/dist/pricing/aws-regions.d.ts +0 -3
- package/dist/pricing/aws-regions.js +0 -44
- package/dist/pricing/price-per-1-s.d.ts +1 -1
- package/dist/regions.d.ts +3 -2
- package/dist/regions.js +43 -3
- package/dist/shared/__mocks__/aws-clients.d.ts +2 -0
- package/dist/shared/__mocks__/aws-clients.js +62 -0
- package/dist/shared/__mocks__/bundle-site.d.ts +2 -0
- package/dist/shared/__mocks__/bundle-site.js +32 -0
- package/dist/shared/__mocks__/check-credentials.d.ts +1 -0
- package/dist/shared/__mocks__/check-credentials.js +5 -0
- package/dist/shared/__mocks__/get-account-id.d.ts +2 -0
- package/dist/shared/__mocks__/get-account-id.js +11 -0
- package/dist/shared/__mocks__/read-dir.d.ts +2 -0
- package/dist/shared/__mocks__/read-dir.js +13 -0
- package/dist/shared/aws-clients.d.ts +6 -29
- package/dist/shared/aws-clients.js +7 -177
- package/dist/shared/call-lambda.d.ts +8 -9
- package/dist/shared/call-lambda.js +16 -3
- package/dist/shared/check-credentials.js +2 -2
- package/dist/shared/cleanup-serialized-input-props.d.ts +8 -6
- package/dist/shared/cleanup-serialized-input-props.js +7 -8
- package/dist/shared/compress-props.d.ts +8 -6
- package/dist/shared/compress-props.js +11 -14
- package/dist/shared/constants.d.ts +10 -288
- package/dist/shared/constants.js +1 -46
- package/dist/shared/content-disposition-header.d.ts +1 -6
- package/dist/shared/content-disposition-header.js +2 -2
- package/dist/shared/convert-to-serve-url.d.ts +2 -2
- package/dist/shared/convert-to-serve-url.js +3 -3
- package/dist/shared/get-account-id.d.ts +1 -1
- package/dist/shared/get-aws-urls.d.ts +2 -2
- package/dist/shared/get-credentials.d.ts +9 -0
- package/dist/shared/get-credentials.js +53 -0
- package/dist/shared/get-function-version.d.ts +1 -1
- package/dist/shared/get-function-version.js +2 -1
- package/dist/shared/get-s3-client.d.ts +5 -0
- package/dist/shared/get-s3-client.js +13 -0
- package/dist/shared/get-service-client.d.ts +22 -0
- package/dist/shared/get-service-client.js +117 -0
- package/dist/shared/hosted-layers.d.ts +1 -1
- package/dist/shared/invoke-webhook.d.ts +1 -1
- package/dist/shared/lambda-insights-extensions.d.ts +1 -1
- package/dist/shared/lifecycle-rules.d.ts +4 -3
- package/dist/shared/lifecycle-rules.js +3 -3
- package/dist/shared/make-s3-url.d.ts +1 -1
- package/dist/shared/random-hash.d.ts +1 -3
- package/dist/shared/random-hash.js +3 -4
- package/dist/shared/return-values.d.ts +10 -11
- package/dist/shared/validate-aws-region.d.ts +1 -1
- package/dist/shared/validate-aws-region.js +3 -3
- package/dist/shared/validate-bucketname.d.ts +0 -4
- package/dist/shared/validate-bucketname.js +3 -23
- package/dist/shared/validate-lambda-codec.d.ts +2 -4
- package/dist/shared/validate-lambda-codec.js +3 -13
- package/dist/shared/validate-outname.js +2 -2
- package/dist/shared/validate-privacy.d.ts +1 -1
- package/dist/shared/validate-webhook.d.ts +1 -1
- package/package.json +11 -9
- package/remotionlambda-arm64.zip +0 -0
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type
|
|
1
|
+
import type { CloudProvider, EnhancedErrorInfo, ReceivedArtifact } from '@remotion/serverless';
|
|
2
|
+
import { type DeleteAfter, type Privacy, type RenderMetadata } from '@remotion/serverless/client';
|
|
3
|
+
import type { AwsProvider } from '../functions/aws-implementation';
|
|
3
4
|
import type { ChunkRetry } from '../functions/helpers/get-retry-stats';
|
|
4
|
-
import type {
|
|
5
|
-
import type { ReceivedArtifact } from '../functions/helpers/overall-render-progress';
|
|
6
|
-
import type { EnhancedErrorInfo } from '../functions/helpers/write-lambda-error';
|
|
7
|
-
import type { AwsRegion } from '../pricing/aws-regions';
|
|
8
|
-
import type { CustomCredentials, CustomCredentialsWithoutSensitiveData } from './aws-clients';
|
|
9
|
-
import type { DownloadBehavior } from './content-disposition-header';
|
|
5
|
+
import type { AwsRegion } from '../regions';
|
|
10
6
|
import type { ExpensiveChunk } from './get-most-expensive-chunks';
|
|
11
|
-
import type { LambdaCodec } from './validate-lambda-codec';
|
|
12
7
|
export declare const MIN_MEMORY = 512;
|
|
13
8
|
export declare const MAX_MEMORY = 10240;
|
|
14
9
|
export declare const DEFAULT_MEMORY_SIZE = 2048;
|
|
@@ -27,294 +22,21 @@ export declare const MIN_EPHEMERAL_STORAGE_IN_MB = 512;
|
|
|
27
22
|
export declare const MAX_EPHEMERAL_STORAGE_IN_MB = 10240;
|
|
28
23
|
export declare const DEFAULT_OUTPUT_PRIVACY: Privacy;
|
|
29
24
|
export declare const DEFAULT_CLOUDWATCH_RETENTION_PERIOD = 14;
|
|
30
|
-
export declare const REMOTION_BUCKET_PREFIX = "remotionlambda-";
|
|
31
25
|
export declare const RENDER_FN_PREFIX = "remotion-render-";
|
|
32
26
|
export declare const LOG_GROUP_PREFIX = "/aws/lambda/";
|
|
33
27
|
export declare const LAMBDA_INSIGHTS_PREFIX = "/aws/lambda-insights";
|
|
34
|
-
export declare const rendersPrefix: (renderId: string) => string;
|
|
35
|
-
export declare const overallProgressKey: (renderId: string) => string;
|
|
36
|
-
export type OutNameInput = string | {
|
|
37
|
-
bucketName: string;
|
|
38
|
-
key: string;
|
|
39
|
-
s3OutputProvider?: CustomCredentials;
|
|
40
|
-
};
|
|
41
|
-
export type OutNameInputWithoutCredentials = string | {
|
|
42
|
-
bucketName: string;
|
|
43
|
-
key: string;
|
|
44
|
-
s3OutputProvider?: CustomCredentialsWithoutSensitiveData;
|
|
45
|
-
};
|
|
46
|
-
export type OutNameOutput = {
|
|
47
|
-
renderBucketName: string;
|
|
48
|
-
key: string;
|
|
49
|
-
customCredentials: CustomCredentials | null;
|
|
50
|
-
};
|
|
51
28
|
export declare const getSitesKey: (siteId: string) => string;
|
|
52
|
-
export declare const outName: (renderId: string, extension: string) => string;
|
|
53
|
-
export declare const outStillName: (renderId: string, imageFormat: StillImageFormat) => string;
|
|
54
|
-
export declare const artifactName: (renderId: string, name: string) => string;
|
|
55
|
-
export declare const customOutName: (renderId: string, bucketName: string, name: OutNameInput) => OutNameOutput;
|
|
56
|
-
export declare const inputPropsKey: (hash: string) => string;
|
|
57
|
-
export declare const resolvedPropsKey: (hash: string) => string;
|
|
58
29
|
export declare const RENDERER_PATH_TOKEN = "remotion-bucket";
|
|
59
30
|
export declare const CONCAT_FOLDER_TOKEN = "remotion-concat";
|
|
60
31
|
export declare const REMOTION_CONCATED_TOKEN = "remotion-concated-token";
|
|
61
32
|
export declare const REMOTION_FILELIST_TOKEN = "remotion-filelist";
|
|
62
|
-
export declare enum LambdaRoutines {
|
|
63
|
-
info = "info",
|
|
64
|
-
start = "start",
|
|
65
|
-
launch = "launch",
|
|
66
|
-
status = "status",
|
|
67
|
-
renderer = "renderer",
|
|
68
|
-
still = "still",
|
|
69
|
-
compositions = "compositions"
|
|
70
|
-
}
|
|
71
|
-
type Prettify<T> = {
|
|
72
|
-
[K in keyof T]: T[K];
|
|
73
|
-
} & {};
|
|
74
|
-
export type WebhookOption = Prettify<null | ({
|
|
75
|
-
url: string;
|
|
76
|
-
secret: string | null;
|
|
77
|
-
} & Partial<ToOptions<{
|
|
78
|
-
customData: typeof BrowserSafeApis.options.webhookCustomDataOption;
|
|
79
|
-
}>>)>;
|
|
80
|
-
export type SerializedInputProps = {
|
|
81
|
-
type: 'bucket-url';
|
|
82
|
-
hash: string;
|
|
83
|
-
bucketName: string;
|
|
84
|
-
} | {
|
|
85
|
-
type: 'payload';
|
|
86
|
-
payload: string;
|
|
87
|
-
};
|
|
88
|
-
export type LambdaStartPayload = {
|
|
89
|
-
rendererFunctionName: string | null;
|
|
90
|
-
type: LambdaRoutines.start;
|
|
91
|
-
serveUrl: string;
|
|
92
|
-
composition: string;
|
|
93
|
-
framesPerLambda: number | null;
|
|
94
|
-
inputProps: SerializedInputProps;
|
|
95
|
-
codec: LambdaCodec;
|
|
96
|
-
audioCodec: AudioCodec | null;
|
|
97
|
-
imageFormat: VideoImageFormat;
|
|
98
|
-
crf: number | undefined;
|
|
99
|
-
envVariables: Record<string, string> | undefined;
|
|
100
|
-
pixelFormat: PixelFormat | undefined;
|
|
101
|
-
proResProfile: ProResProfile | undefined;
|
|
102
|
-
x264Preset: X264Preset | null;
|
|
103
|
-
jpegQuality: number | undefined;
|
|
104
|
-
maxRetries: number;
|
|
105
|
-
privacy: Privacy;
|
|
106
|
-
logLevel: LogLevel;
|
|
107
|
-
frameRange: FrameRange | null;
|
|
108
|
-
outName: OutNameInput | null;
|
|
109
|
-
timeoutInMilliseconds: number;
|
|
110
|
-
chromiumOptions: ChromiumOptions;
|
|
111
|
-
scale: number;
|
|
112
|
-
everyNthFrame: number;
|
|
113
|
-
numberOfGifLoops: number | null;
|
|
114
|
-
concurrencyPerLambda: number;
|
|
115
|
-
downloadBehavior: DownloadBehavior;
|
|
116
|
-
muted: boolean;
|
|
117
|
-
version: string;
|
|
118
|
-
overwrite: boolean;
|
|
119
|
-
audioBitrate: string | null;
|
|
120
|
-
videoBitrate: string | null;
|
|
121
|
-
encodingMaxRate: string | null;
|
|
122
|
-
encodingBufferSize: string | null;
|
|
123
|
-
webhook: WebhookOption;
|
|
124
|
-
forceHeight: number | null;
|
|
125
|
-
forceWidth: number | null;
|
|
126
|
-
bucketName: string | null;
|
|
127
|
-
offthreadVideoCacheSizeInBytes: number | null;
|
|
128
|
-
deleteAfter: DeleteAfter | null;
|
|
129
|
-
colorSpace: ColorSpace | null;
|
|
130
|
-
preferLossless: boolean;
|
|
131
|
-
};
|
|
132
|
-
export type LambdaStatusPayload = {
|
|
133
|
-
type: LambdaRoutines.status;
|
|
134
|
-
bucketName: string;
|
|
135
|
-
renderId: string;
|
|
136
|
-
version: string;
|
|
137
|
-
logLevel: LogLevel;
|
|
138
|
-
s3OutputProvider?: CustomCredentials;
|
|
139
|
-
};
|
|
140
|
-
export type LambdaPayloads = {
|
|
141
|
-
info: {
|
|
142
|
-
type: LambdaRoutines.info;
|
|
143
|
-
logLevel: LogLevel;
|
|
144
|
-
};
|
|
145
|
-
start: LambdaStartPayload;
|
|
146
|
-
launch: {
|
|
147
|
-
rendererFunctionName: string | null;
|
|
148
|
-
type: LambdaRoutines.launch;
|
|
149
|
-
serveUrl: string;
|
|
150
|
-
composition: string;
|
|
151
|
-
framesPerLambda: number | null;
|
|
152
|
-
bucketName: string;
|
|
153
|
-
inputProps: SerializedInputProps;
|
|
154
|
-
renderId: string;
|
|
155
|
-
imageFormat: VideoImageFormat;
|
|
156
|
-
codec: LambdaCodec;
|
|
157
|
-
audioCodec: AudioCodec | null;
|
|
158
|
-
crf: number | undefined;
|
|
159
|
-
envVariables: Record<string, string> | undefined;
|
|
160
|
-
pixelFormat: PixelFormat | undefined;
|
|
161
|
-
proResProfile: ProResProfile | undefined;
|
|
162
|
-
x264Preset: X264Preset | null;
|
|
163
|
-
jpegQuality: number | undefined;
|
|
164
|
-
maxRetries: number;
|
|
165
|
-
privacy: Privacy;
|
|
166
|
-
logLevel: LogLevel;
|
|
167
|
-
frameRange: FrameRange | null;
|
|
168
|
-
outName: OutNameInput | null;
|
|
169
|
-
timeoutInMilliseconds: number;
|
|
170
|
-
chromiumOptions: ChromiumOptions;
|
|
171
|
-
scale: number;
|
|
172
|
-
everyNthFrame: number;
|
|
173
|
-
numberOfGifLoops: number | null;
|
|
174
|
-
concurrencyPerLambda: number;
|
|
175
|
-
downloadBehavior: DownloadBehavior;
|
|
176
|
-
muted: boolean;
|
|
177
|
-
overwrite: boolean;
|
|
178
|
-
audioBitrate: string | null;
|
|
179
|
-
videoBitrate: string | null;
|
|
180
|
-
encodingMaxRate: string | null;
|
|
181
|
-
encodingBufferSize: string | null;
|
|
182
|
-
webhook: WebhookOption;
|
|
183
|
-
forceHeight: number | null;
|
|
184
|
-
forceWidth: number | null;
|
|
185
|
-
offthreadVideoCacheSizeInBytes: number | null;
|
|
186
|
-
deleteAfter: DeleteAfter | null;
|
|
187
|
-
colorSpace: ColorSpace | null;
|
|
188
|
-
preferLossless: boolean;
|
|
189
|
-
};
|
|
190
|
-
status: LambdaStatusPayload;
|
|
191
|
-
renderer: {
|
|
192
|
-
concurrencyPerLambda: number;
|
|
193
|
-
type: LambdaRoutines.renderer;
|
|
194
|
-
serveUrl: string;
|
|
195
|
-
frameRange: [number, number];
|
|
196
|
-
chunk: number;
|
|
197
|
-
bucketName: string;
|
|
198
|
-
composition: string;
|
|
199
|
-
fps: number;
|
|
200
|
-
height: number;
|
|
201
|
-
width: number;
|
|
202
|
-
durationInFrames: number;
|
|
203
|
-
retriesLeft: number;
|
|
204
|
-
inputProps: SerializedInputProps;
|
|
205
|
-
renderId: string;
|
|
206
|
-
imageFormat: VideoImageFormat;
|
|
207
|
-
codec: LambdaCodec;
|
|
208
|
-
crf: number | undefined;
|
|
209
|
-
proResProfile: ProResProfile | undefined;
|
|
210
|
-
x264Preset: X264Preset | null;
|
|
211
|
-
pixelFormat: PixelFormat | undefined;
|
|
212
|
-
jpegQuality: number | undefined;
|
|
213
|
-
envVariables: Record<string, string> | undefined;
|
|
214
|
-
privacy: Privacy;
|
|
215
|
-
attempt: number;
|
|
216
|
-
logLevel: LogLevel;
|
|
217
|
-
timeoutInMilliseconds: number;
|
|
218
|
-
chromiumOptions: ChromiumOptions;
|
|
219
|
-
resolvedProps: SerializedInputProps;
|
|
220
|
-
scale: number;
|
|
221
|
-
everyNthFrame: number;
|
|
222
|
-
muted: boolean;
|
|
223
|
-
audioBitrate: string | null;
|
|
224
|
-
videoBitrate: string | null;
|
|
225
|
-
encodingBufferSize: string | null;
|
|
226
|
-
encodingMaxRate: string | null;
|
|
227
|
-
launchFunctionConfig: {
|
|
228
|
-
version: string;
|
|
229
|
-
};
|
|
230
|
-
preferLossless: boolean;
|
|
231
|
-
offthreadVideoCacheSizeInBytes: number | null;
|
|
232
|
-
deleteAfter: DeleteAfter | null;
|
|
233
|
-
colorSpace: ColorSpace | null;
|
|
234
|
-
compositionStart: number;
|
|
235
|
-
framesPerLambda: number;
|
|
236
|
-
progressEveryNthFrame: number;
|
|
237
|
-
};
|
|
238
|
-
still: {
|
|
239
|
-
type: LambdaRoutines.still;
|
|
240
|
-
serveUrl: string;
|
|
241
|
-
composition: string;
|
|
242
|
-
inputProps: SerializedInputProps;
|
|
243
|
-
imageFormat: StillImageFormat;
|
|
244
|
-
envVariables: Record<string, string>;
|
|
245
|
-
attempt: number;
|
|
246
|
-
jpegQuality: number | undefined;
|
|
247
|
-
maxRetries: number;
|
|
248
|
-
frame: number;
|
|
249
|
-
privacy: Privacy;
|
|
250
|
-
logLevel: LogLevel;
|
|
251
|
-
outName: OutNameInput | null;
|
|
252
|
-
timeoutInMilliseconds: number;
|
|
253
|
-
chromiumOptions: ChromiumOptions;
|
|
254
|
-
scale: number;
|
|
255
|
-
downloadBehavior: DownloadBehavior;
|
|
256
|
-
version: string;
|
|
257
|
-
forceHeight: number | null;
|
|
258
|
-
forceWidth: number | null;
|
|
259
|
-
bucketName: string | null;
|
|
260
|
-
offthreadVideoCacheSizeInBytes: number | null;
|
|
261
|
-
deleteAfter: DeleteAfter | null;
|
|
262
|
-
streamed: boolean;
|
|
263
|
-
};
|
|
264
|
-
compositions: {
|
|
265
|
-
type: LambdaRoutines.compositions;
|
|
266
|
-
version: string;
|
|
267
|
-
chromiumOptions: ChromiumOptions;
|
|
268
|
-
logLevel: LogLevel;
|
|
269
|
-
inputProps: SerializedInputProps;
|
|
270
|
-
envVariables: Record<string, string> | undefined;
|
|
271
|
-
timeoutInMilliseconds: number;
|
|
272
|
-
serveUrl: string;
|
|
273
|
-
bucketName: string | null;
|
|
274
|
-
offthreadVideoCacheSizeInBytes: number | null;
|
|
275
|
-
};
|
|
276
|
-
};
|
|
277
|
-
export type LambdaPayload = LambdaPayloads[LambdaRoutines];
|
|
278
|
-
type Discriminated = {
|
|
279
|
-
type: 'still';
|
|
280
|
-
imageFormat: StillImageFormat;
|
|
281
|
-
codec: null;
|
|
282
|
-
} | {
|
|
283
|
-
type: 'video';
|
|
284
|
-
imageFormat: VideoImageFormat;
|
|
285
|
-
muted: boolean;
|
|
286
|
-
frameRange: [number, number];
|
|
287
|
-
everyNthFrame: number;
|
|
288
|
-
codec: LambdaCodec;
|
|
289
|
-
};
|
|
290
|
-
export type RenderMetadata = Discriminated & {
|
|
291
|
-
siteId: string;
|
|
292
|
-
startedDate: number;
|
|
293
|
-
totalChunks: number;
|
|
294
|
-
estimatedTotalLambdaInvokations: number;
|
|
295
|
-
estimatedRenderLambdaInvokations: number;
|
|
296
|
-
compositionId: string;
|
|
297
|
-
audioCodec: AudioCodec | null;
|
|
298
|
-
inputProps: SerializedInputProps;
|
|
299
|
-
framesPerLambda: number;
|
|
300
|
-
memorySizeInMb: number;
|
|
301
|
-
lambdaVersion: string;
|
|
302
|
-
region: AwsRegion;
|
|
303
|
-
renderId: string;
|
|
304
|
-
outName: OutNameInputWithoutCredentials | undefined;
|
|
305
|
-
privacy: Privacy;
|
|
306
|
-
deleteAfter: DeleteAfter | null;
|
|
307
|
-
numberOfGifLoops: number | null;
|
|
308
|
-
audioBitrate: string | null;
|
|
309
|
-
downloadBehavior: DownloadBehavior;
|
|
310
|
-
};
|
|
311
33
|
export type AfterRenderCost = {
|
|
312
34
|
estimatedCost: number;
|
|
313
35
|
estimatedDisplayCost: string;
|
|
314
36
|
currency: string;
|
|
315
37
|
disclaimer: string;
|
|
316
38
|
};
|
|
317
|
-
export type PostRenderData = {
|
|
39
|
+
export type PostRenderData<Provider extends CloudProvider> = {
|
|
318
40
|
cost: AfterRenderCost;
|
|
319
41
|
outputFile: string;
|
|
320
42
|
outputSize: number;
|
|
@@ -333,7 +55,7 @@ export type PostRenderData = {
|
|
|
333
55
|
estimatedBillingDurationInMilliseconds: number;
|
|
334
56
|
deleteAfter: DeleteAfter | null;
|
|
335
57
|
timeToCombine: number | null;
|
|
336
|
-
artifactProgress: ReceivedArtifact[];
|
|
58
|
+
artifactProgress: ReceivedArtifact<Provider>[];
|
|
337
59
|
};
|
|
338
60
|
export type CostsInfo = {
|
|
339
61
|
accruedSoFar: number;
|
|
@@ -351,13 +73,13 @@ type EncodingProgress = {
|
|
|
351
73
|
combinedFrames: number;
|
|
352
74
|
timeToCombine: number | null;
|
|
353
75
|
};
|
|
354
|
-
export type
|
|
76
|
+
export type GenericRenderProgress<Provider extends CloudProvider> = {
|
|
355
77
|
chunks: number;
|
|
356
78
|
done: boolean;
|
|
357
79
|
encodingStatus: EncodingProgress | null;
|
|
358
80
|
costs: CostsInfo;
|
|
359
81
|
renderId: string;
|
|
360
|
-
renderMetadata: RenderMetadata | null;
|
|
82
|
+
renderMetadata: RenderMetadata<Provider> | null;
|
|
361
83
|
bucket: string;
|
|
362
84
|
outputFile: string | null;
|
|
363
85
|
outKey: string | null;
|
|
@@ -385,8 +107,8 @@ export type RenderProgress = {
|
|
|
385
107
|
functionLaunched: number;
|
|
386
108
|
serveUrlOpened: number | null;
|
|
387
109
|
compositionValidated: number | null;
|
|
388
|
-
artifacts: ReceivedArtifact[];
|
|
110
|
+
artifacts: ReceivedArtifact<Provider>[];
|
|
389
111
|
};
|
|
390
|
-
export type
|
|
112
|
+
export type RenderProgress = GenericRenderProgress<AwsProvider>;
|
|
391
113
|
export declare const LAMBDA_CONCURRENCY_LIMIT_QUOTA = "L-B99A9384";
|
|
392
114
|
export {};
|
package/dist/shared/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = exports.
|
|
3
|
+
exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = exports.REMOTION_FILELIST_TOKEN = exports.REMOTION_CONCATED_TOKEN = exports.CONCAT_FOLDER_TOKEN = exports.RENDERER_PATH_TOKEN = exports.getSitesKey = exports.LAMBDA_INSIGHTS_PREFIX = exports.LOG_GROUP_PREFIX = exports.RENDER_FN_PREFIX = exports.DEFAULT_CLOUDWATCH_RETENTION_PERIOD = exports.DEFAULT_OUTPUT_PRIVACY = exports.MAX_EPHEMERAL_STORAGE_IN_MB = exports.MIN_EPHEMERAL_STORAGE_IN_MB = exports.DEFAULT_EPHEMERAL_STORAGE_IN_MB = exports.MAX_FUNCTIONS_PER_RENDER = exports.DEFAULT_MAX_RETRIES = exports.DEFAULT_REGION = exports.COMMAND_NOT_FOUND = exports.BINARY_NAME = exports.DEFAULT_FRAMES_PER_LAMBDA = exports.MINIMUM_FRAMES_PER_LAMBDA = exports.MAX_TIMEOUT = exports.MIN_TIMEOUT = exports.DEFAULT_TIMEOUT = exports.DEFAULT_MEMORY_SIZE = exports.MAX_MEMORY = exports.MIN_MEMORY = void 0;
|
|
4
4
|
exports.MIN_MEMORY = 512;
|
|
5
5
|
exports.MAX_MEMORY = 10240;
|
|
6
6
|
exports.DEFAULT_MEMORY_SIZE = 2048;
|
|
@@ -19,58 +19,13 @@ exports.MIN_EPHEMERAL_STORAGE_IN_MB = 512;
|
|
|
19
19
|
exports.MAX_EPHEMERAL_STORAGE_IN_MB = 10240;
|
|
20
20
|
exports.DEFAULT_OUTPUT_PRIVACY = 'public';
|
|
21
21
|
exports.DEFAULT_CLOUDWATCH_RETENTION_PERIOD = 14;
|
|
22
|
-
exports.REMOTION_BUCKET_PREFIX = 'remotionlambda-';
|
|
23
22
|
exports.RENDER_FN_PREFIX = 'remotion-render-';
|
|
24
23
|
exports.LOG_GROUP_PREFIX = '/aws/lambda/';
|
|
25
24
|
exports.LAMBDA_INSIGHTS_PREFIX = '/aws/lambda-insights';
|
|
26
|
-
const rendersPrefix = (renderId) => `renders/${renderId}`;
|
|
27
|
-
exports.rendersPrefix = rendersPrefix;
|
|
28
|
-
const overallProgressKey = (renderId) => `${(0, exports.rendersPrefix)(renderId)}/progress.json`;
|
|
29
|
-
exports.overallProgressKey = overallProgressKey;
|
|
30
25
|
const getSitesKey = (siteId) => `sites/${siteId}`;
|
|
31
26
|
exports.getSitesKey = getSitesKey;
|
|
32
|
-
const outName = (renderId, extension) => `${(0, exports.rendersPrefix)(renderId)}/out.${extension}`;
|
|
33
|
-
exports.outName = outName;
|
|
34
|
-
const outStillName = (renderId, imageFormat) => `${(0, exports.rendersPrefix)(renderId)}/out.${imageFormat}`;
|
|
35
|
-
exports.outStillName = outStillName;
|
|
36
|
-
const artifactName = (renderId, name) => `${(0, exports.rendersPrefix)(renderId)}/artifacts/${name}`;
|
|
37
|
-
exports.artifactName = artifactName;
|
|
38
|
-
const customOutName = (renderId, bucketName, name) => {
|
|
39
|
-
var _a;
|
|
40
|
-
if (typeof name === 'string') {
|
|
41
|
-
return {
|
|
42
|
-
renderBucketName: bucketName,
|
|
43
|
-
key: `${(0, exports.rendersPrefix)(renderId)}/${name}`,
|
|
44
|
-
customCredentials: null,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
key: name.key,
|
|
49
|
-
renderBucketName: name.bucketName,
|
|
50
|
-
customCredentials: (_a = name.s3OutputProvider) !== null && _a !== void 0 ? _a : null,
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
exports.customOutName = customOutName;
|
|
54
|
-
const inputPropsKey = (hash) => {
|
|
55
|
-
return `input-props/${hash}.json`;
|
|
56
|
-
};
|
|
57
|
-
exports.inputPropsKey = inputPropsKey;
|
|
58
|
-
const resolvedPropsKey = (hash) => {
|
|
59
|
-
return `resolved-props/${hash}.json`;
|
|
60
|
-
};
|
|
61
|
-
exports.resolvedPropsKey = resolvedPropsKey;
|
|
62
27
|
exports.RENDERER_PATH_TOKEN = 'remotion-bucket';
|
|
63
28
|
exports.CONCAT_FOLDER_TOKEN = 'remotion-concat';
|
|
64
29
|
exports.REMOTION_CONCATED_TOKEN = 'remotion-concated-token';
|
|
65
30
|
exports.REMOTION_FILELIST_TOKEN = 'remotion-filelist';
|
|
66
|
-
var LambdaRoutines;
|
|
67
|
-
(function (LambdaRoutines) {
|
|
68
|
-
LambdaRoutines["info"] = "info";
|
|
69
|
-
LambdaRoutines["start"] = "start";
|
|
70
|
-
LambdaRoutines["launch"] = "launch";
|
|
71
|
-
LambdaRoutines["status"] = "status";
|
|
72
|
-
LambdaRoutines["renderer"] = "renderer";
|
|
73
|
-
LambdaRoutines["still"] = "still";
|
|
74
|
-
LambdaRoutines["compositions"] = "compositions";
|
|
75
|
-
})(LambdaRoutines || (exports.LambdaRoutines = LambdaRoutines = {}));
|
|
76
31
|
exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = 'L-B99A9384';
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
type: 'play-in-browser';
|
|
3
|
-
} | {
|
|
4
|
-
type: 'download';
|
|
5
|
-
fileName: string | null;
|
|
6
|
-
};
|
|
1
|
+
import type { DownloadBehavior } from '@remotion/serverless/client';
|
|
7
2
|
export declare const getContentDispositionHeader: (behavior: DownloadBehavior | null) => string | undefined;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getContentDispositionHeader = void 0;
|
|
2
4
|
// By setting the Content-Disposition header in an S3 object,
|
|
3
5
|
// you can control if the user downloads the item if you
|
|
4
6
|
// visit the link
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getContentDispositionHeader = void 0;
|
|
7
7
|
const problematicCharacters = {
|
|
8
8
|
'%3A': ':',
|
|
9
9
|
'%2F': '/',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AwsRegion } from '../
|
|
2
|
-
export declare const
|
|
1
|
+
import type { AwsRegion } from '../regions';
|
|
2
|
+
export declare const convertToServeUrlImplementation: ({ urlOrId, region, bucketName, }: {
|
|
3
3
|
urlOrId: string;
|
|
4
4
|
region: AwsRegion;
|
|
5
5
|
bucketName: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.convertToServeUrlImplementation = void 0;
|
|
4
4
|
const docs_url_1 = require("./docs-url");
|
|
5
|
-
const
|
|
5
|
+
const convertToServeUrlImplementation = ({ urlOrId, region, bucketName, }) => {
|
|
6
6
|
if (urlOrId.startsWith('src/')) {
|
|
7
7
|
throw new Error(`Remotion Lambda can only render based on a URL in the cloud. It seems like you passed a local file: ${urlOrId}. Read the setup guide for Remotion Lambda ${docs_url_1.DOCS_URL}/docs/lambda/setup`);
|
|
8
8
|
}
|
|
@@ -11,4 +11,4 @@ const convertToServeUrl = ({ urlOrId, region, bucketName, }) => {
|
|
|
11
11
|
}
|
|
12
12
|
return `https://${bucketName}.s3.${region}.amazonaws.com/sites/${urlOrId}/index.html`;
|
|
13
13
|
};
|
|
14
|
-
exports.
|
|
14
|
+
exports.convertToServeUrlImplementation = convertToServeUrlImplementation;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { ServerlessRoutines } from '@remotion/serverless/client';
|
|
1
2
|
import type { AwsRegion } from '../client';
|
|
2
|
-
import type { LambdaRoutines } from './constants';
|
|
3
3
|
export declare const getCloudwatchMethodUrl: ({ region, functionName, renderId, rendererFunctionName, method, }: {
|
|
4
4
|
region: AwsRegion;
|
|
5
5
|
functionName: string;
|
|
6
|
-
method:
|
|
6
|
+
method: ServerlessRoutines;
|
|
7
7
|
rendererFunctionName: string | null;
|
|
8
8
|
renderId: string;
|
|
9
9
|
}) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { fromIni } from '@aws-sdk/credential-providers';
|
|
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 {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCredentials = void 0;
|
|
4
|
+
const credential_providers_1 = require("@aws-sdk/credential-providers");
|
|
5
|
+
const is_in_lambda_1 = require("./is-in-lambda");
|
|
6
|
+
const getCredentials = () => {
|
|
7
|
+
if ((0, is_in_lambda_1.isInsideLambda)()) {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
if (process.env.REMOTION_AWS_PROFILE) {
|
|
11
|
+
return (0, credential_providers_1.fromIni)({
|
|
12
|
+
profile: process.env.REMOTION_AWS_PROFILE,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
if (process.env.REMOTION_AWS_ACCESS_KEY_ID &&
|
|
16
|
+
process.env.REMOTION_AWS_SECRET_ACCESS_KEY &&
|
|
17
|
+
process.env.REMOTION_AWS_SESSION_TOKEN) {
|
|
18
|
+
return {
|
|
19
|
+
accessKeyId: process.env.REMOTION_AWS_ACCESS_KEY_ID,
|
|
20
|
+
secretAccessKey: process.env.REMOTION_AWS_SECRET_ACCESS_KEY,
|
|
21
|
+
sessionToken: process.env.REMOTION_AWS_SESSION_TOKEN,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
if (process.env.REMOTION_AWS_ACCESS_KEY_ID &&
|
|
25
|
+
process.env.REMOTION_AWS_SECRET_ACCESS_KEY) {
|
|
26
|
+
return {
|
|
27
|
+
accessKeyId: process.env.REMOTION_AWS_ACCESS_KEY_ID,
|
|
28
|
+
secretAccessKey: process.env.REMOTION_AWS_SECRET_ACCESS_KEY,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
if (process.env.AWS_PROFILE) {
|
|
32
|
+
return (0, credential_providers_1.fromIni)({
|
|
33
|
+
profile: process.env.AWS_PROFILE,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
if (process.env.AWS_ACCESS_KEY_ID &&
|
|
37
|
+
process.env.AWS_SECRET_ACCESS_KEY &&
|
|
38
|
+
process.env.AWS_SESSION_TOKEN) {
|
|
39
|
+
return {
|
|
40
|
+
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
|
|
41
|
+
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
|
|
42
|
+
sessionToken: process.env.AWS_SESSION_TOKEN,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
if (process.env.AWS_ACCESS_KEY_ID && process.env.AWS_SECRET_ACCESS_KEY) {
|
|
46
|
+
return {
|
|
47
|
+
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
|
|
48
|
+
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return undefined;
|
|
52
|
+
};
|
|
53
|
+
exports.getCredentials = getCredentials;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LogLevel } from '@remotion/renderer';
|
|
2
|
-
import type { AwsRegion } from '../
|
|
2
|
+
import type { AwsRegion } from '../regions';
|
|
3
3
|
export declare const getFunctionVersion: ({ functionName, region, logLevel, }: {
|
|
4
4
|
functionName: string;
|
|
5
5
|
region: AwsRegion;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getFunctionVersion = void 0;
|
|
4
|
+
const client_1 = require("@remotion/serverless/client");
|
|
4
5
|
const call_lambda_1 = require("./call-lambda");
|
|
5
6
|
const constants_1 = require("./constants");
|
|
6
7
|
const getFunctionVersion = async ({ functionName, region, logLevel, }) => {
|
|
@@ -11,7 +12,7 @@ const getFunctionVersion = async ({ functionName, region, logLevel, }) => {
|
|
|
11
12
|
logLevel,
|
|
12
13
|
},
|
|
13
14
|
region,
|
|
14
|
-
type:
|
|
15
|
+
type: client_1.ServerlessRoutines.info,
|
|
15
16
|
timeoutInTest: 120000,
|
|
16
17
|
});
|
|
17
18
|
return result.version;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { S3Client } from '@aws-sdk/client-s3';
|
|
2
|
+
import type { CustomCredentials } from '../client';
|
|
3
|
+
import type { AwsProvider } from '../functions/aws-implementation';
|
|
4
|
+
import type { AwsRegion } from '../regions';
|
|
5
|
+
export declare const getS3Client: (region: AwsRegion, customCredentials: CustomCredentials<AwsProvider> | null) => S3Client;
|
|
@@ -0,0 +1,13 @@
|
|
|
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) => {
|
|
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
|
+
});
|
|
12
|
+
};
|
|
13
|
+
exports.getS3Client = getS3Client;
|
|
@@ -0,0 +1,22 @@
|
|
|
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 '../client';
|
|
8
|
+
import type { AwsProvider } from '../functions/aws-implementation';
|
|
9
|
+
import type { AwsRegion } from '../regions';
|
|
10
|
+
export type ServiceMapping = {
|
|
11
|
+
s3: S3Client;
|
|
12
|
+
cloudwatch: CloudWatchLogsClient;
|
|
13
|
+
iam: IAMClient;
|
|
14
|
+
lambda: LambdaClient;
|
|
15
|
+
servicequotas: ServiceQuotasClient;
|
|
16
|
+
sts: STSClient;
|
|
17
|
+
};
|
|
18
|
+
export declare const getServiceClient: <T extends keyof ServiceMapping>({ region, service, customCredentials, }: {
|
|
19
|
+
region: AwsRegion;
|
|
20
|
+
service: T;
|
|
21
|
+
customCredentials: CustomCredentials<AwsProvider> | null;
|
|
22
|
+
}) => ServiceMapping[T];
|