@remotion/cloudrun 4.0.296 → 4.0.298

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.
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > @remotion/cloudrun@4.0.296 make /Users/jonathanburger/remotion/packages/cloudrun
3
+ > @remotion/cloudrun@4.0.298 make /Users/jonathanburger/remotion/packages/cloudrun
4
4
  > tsc -d && cp src/shared/sa-permissions.json dist/shared/sa-permissions.json
5
5
 
@@ -1,6 +1,7 @@
1
1
  import { type GitSource, type WebpackOverrideFn } from '@remotion/bundler';
2
2
  import type { ToOptions } from '@remotion/renderer';
3
3
  import type { BrowserSafeApis } from '@remotion/renderer/client';
4
+ import type { Privacy } from '../shared/constants';
4
5
  import type { UploadDirProgress } from './upload-dir';
5
6
  type Options = {
6
7
  onBundleProgress?: (progress: number) => void;
@@ -16,6 +17,7 @@ type Options = {
16
17
  type OptionalParameters = {
17
18
  siteName: string;
18
19
  options: Options;
20
+ privacy: Privacy;
19
21
  } & ToOptions<typeof BrowserSafeApis.optionsMap.deploySiteCloudRun>;
20
22
  export type RawDeploySiteInput = {
21
23
  entryPoint: string;
@@ -39,6 +41,6 @@ export type DeploySiteOutput = Promise<{
39
41
  untouchedFiles: number;
40
42
  };
41
43
  }>;
42
- export declare const internalDeploySiteRaw: ({ entryPoint, bucketName, siteName, options, }: RawDeploySiteInput) => DeploySiteOutput;
44
+ export declare const internalDeploySiteRaw: ({ entryPoint, bucketName, siteName, options, privacy, }: RawDeploySiteInput) => DeploySiteOutput;
43
45
  export declare const deploySite: (input: DeploySiteInput) => DeploySiteOutput;
44
46
  export {};
@@ -12,7 +12,7 @@ const validate_bucketname_1 = require("../shared/validate-bucketname");
12
12
  const validate_site_name_1 = require("../shared/validate-site-name");
13
13
  const get_cloud_storage_client_1 = require("./helpers/get-cloud-storage-client");
14
14
  const upload_dir_1 = require("./upload-dir");
15
- const internalDeploySiteRaw = async ({ entryPoint, bucketName, siteName, options, }) => {
15
+ const internalDeploySiteRaw = async ({ entryPoint, bucketName, siteName, options, privacy, }) => {
16
16
  var _a, _b, _c, _d, _e, _f, _g, _h;
17
17
  (0, validate_bucketname_1.validateBucketName)(bucketName, { mustStartWithRemotion: true });
18
18
  (0, validate_site_name_1.validateSiteName)(siteName);
@@ -56,6 +56,7 @@ const internalDeploySiteRaw = async ({ entryPoint, bucketName, siteName, options
56
56
  onProgress: (_h = options === null || options === void 0 ? void 0 : options.onUploadProgress) !== null && _h !== void 0 ? _h : (() => undefined),
57
57
  keyPrefix: subFolder,
58
58
  toUpload,
59
+ privacy: privacy !== null && privacy !== void 0 ? privacy : 'public',
59
60
  }),
60
61
  Promise.all(toDelete.map((d) => {
61
62
  return (0, io_1.cloudrunDeleteFile)({
@@ -81,7 +82,7 @@ const errorHandled = (0, error_handling_1.wrapWithErrorHandling)(exports.interna
81
82
  * @see [Documentation](https://remotion.dev/docs/cloudrun/deploysite)
82
83
  */
83
84
  const deploySite = (input) => {
84
- var _a, _b;
85
+ var _a, _b, _c;
85
86
  return errorHandled({
86
87
  bucketName: input.bucketName,
87
88
  entryPoint: input.entryPoint,
@@ -89,6 +90,7 @@ const deploySite = (input) => {
89
90
  logLevel: 'info',
90
91
  options: (_a = input.options) !== null && _a !== void 0 ? _a : {},
91
92
  siteName: (_b = input.siteName) !== null && _b !== void 0 ? _b : (0, random_hash_1.randomHash)(),
93
+ privacy: (_c = input === null || input === void 0 ? void 0 : input.privacy) !== null && _c !== void 0 ? _c : 'public',
92
94
  });
93
95
  };
94
96
  exports.deploySite = deploySite;
@@ -1,6 +1,7 @@
1
1
  import { type AudioCodec, type ChromiumOptions, type FrameRange, type LogLevel, type PixelFormat, type ProResProfile, type ToOptions, type VideoImageFormat } from '@remotion/renderer';
2
2
  import { BrowserSafeApis } from '@remotion/renderer/client';
3
3
  import type { z } from 'zod';
4
+ import type { Privacy } from '../defaults';
4
5
  import type { CloudRunCrashResponse, CloudRunPayload, DownloadBehavior, RenderMediaOnCloudrunOutput } from '../functions/helpers/payloads';
5
6
  import type { GcpRegion } from '../pricing/gcp-regions';
6
7
  import type { CloudrunCodec } from '../shared/validate-gcp-codec';
@@ -11,7 +12,7 @@ type InternalRenderMediaOnCloudrun = {
11
12
  serveUrl: string;
12
13
  composition: string;
13
14
  inputProps: Record<string, unknown>;
14
- privacy: 'public' | 'private' | undefined;
15
+ privacy: Privacy | undefined;
15
16
  forceBucketName: string | undefined;
16
17
  outName: string | undefined;
17
18
  updateRenderProgress: ((progress: number, error: boolean) => void) | undefined;
@@ -46,7 +47,7 @@ export type RenderMediaOnCloudrunInput = {
46
47
  cloudRunUrl?: string;
47
48
  serviceName?: string;
48
49
  inputProps?: Record<string, unknown>;
49
- privacy?: 'public' | 'private';
50
+ privacy?: Privacy;
50
51
  forceBucketName?: string;
51
52
  outName?: string;
52
53
  updateRenderProgress?: UpdateRenderProgress;
@@ -50,7 +50,7 @@ const internalRenderMediaOnCloudrunRaw = async ({ cloudRunUrl, serviceName, regi
50
50
  chromiumOptions,
51
51
  muted: muted !== null && muted !== void 0 ? muted : false,
52
52
  outputBucket,
53
- privacy,
53
+ privacy: privacy !== null && privacy !== void 0 ? privacy : 'public',
54
54
  outName,
55
55
  forceWidth,
56
56
  forceHeight,
@@ -1,6 +1,7 @@
1
1
  import type { ChromiumOptions, StillImageFormat, ToOptions } from '@remotion/renderer';
2
2
  import { BrowserSafeApis } from '@remotion/renderer/client';
3
3
  import type { z } from 'zod';
4
+ import type { Privacy } from '../defaults';
4
5
  import type { CloudRunPayload, DownloadBehavior } from '../functions/helpers/payloads';
5
6
  import type { GcpRegion } from '../pricing/gcp-regions';
6
7
  type MandatoryParameters = {
@@ -13,7 +14,7 @@ type OptionalParameters = {
13
14
  cloudRunUrl: string | null;
14
15
  serviceName: string | null;
15
16
  inputProps: Record<string, unknown>;
16
- privacy: 'public' | 'private';
17
+ privacy: Privacy;
17
18
  forceBucketName: string | null;
18
19
  outName: string | null;
19
20
  envVariables: Record<string, string>;
@@ -1,3 +1,4 @@
1
+ import type { Privacy } from '../defaults';
1
2
  export type UploadDirProgress = {
2
3
  totalFiles: number;
3
4
  filesUploaded: number;
@@ -9,10 +10,11 @@ export type MockFile = {
9
10
  content: string;
10
11
  };
11
12
  export declare const getDirFiles: (entry: string) => MockFile[];
12
- export declare const uploadDir: ({ bucket, localDir, onProgress, keyPrefix, toUpload, }: {
13
+ export declare const uploadDir: ({ bucket, localDir, onProgress, keyPrefix, toUpload, privacy, }: {
13
14
  bucket: string;
14
15
  localDir: string;
15
16
  keyPrefix: string;
16
17
  onProgress: (progress: UploadDirProgress) => void;
17
18
  toUpload: string[];
19
+ privacy: Privacy;
18
20
  }) => Promise<void>;
@@ -12,7 +12,7 @@ const getDirFiles = (entry) => {
12
12
  throw new TypeError('should only be executed in test ' + JSON.stringify(entry));
13
13
  };
14
14
  exports.getDirFiles = getDirFiles;
15
- const uploadDir = async ({ bucket, localDir, onProgress, keyPrefix, toUpload, }) => {
15
+ const uploadDir = async ({ bucket, localDir, onProgress, keyPrefix, toUpload, privacy, }) => {
16
16
  async function getFiles(directory, originalDirectory, filesToUpload) {
17
17
  const dirents = await fs_1.promises.readdir(directory, { withFileTypes: true });
18
18
  const _files = await Promise.all(dirents
@@ -57,7 +57,9 @@ const uploadDir = async ({ bucket, localDir, onProgress, keyPrefix, toUpload, })
57
57
  .pipe(cloudStorageClient
58
58
  .bucket(bucket)
59
59
  .file(destination)
60
- .createWriteStream({ public: true }))
60
+ .createWriteStream({
61
+ public: privacy === 'public',
62
+ }))
61
63
  .on('error', (error) => reject(error))
62
64
  .on('progress', (p) => {
63
65
  var _a;
@@ -1,3 +1,4 @@
1
+ import type { Privacy } from '../defaults';
1
2
  import type { GcpRegion } from '../pricing/gcp-regions';
2
3
  type servicesCommandLineOptions = {
3
4
  help: boolean;
@@ -9,6 +10,7 @@ type servicesCommandLineOptions = {
9
10
  force: boolean;
10
11
  ['onlyAllocateCpuDuringRequestProcessing']: boolean;
11
12
  f: boolean;
13
+ privacy: Privacy;
12
14
  ['max-retries']: number;
13
15
  ['out-name']: string | undefined;
14
16
  ['output-bucket']: string;
@@ -16,7 +16,7 @@ const renderArgsCheck_1 = require("./helpers/renderArgsCheck");
16
16
  exports.RENDER_COMMAND = 'render';
17
17
  const { audioBitrateOption, x264Option, offthreadVideoCacheSizeInBytesOption, offthreadVideoThreadsOption, scaleOption, crfOption, jpegQualityOption, videoBitrateOption, enforceAudioOption, mutedOption, colorSpaceOption, numberOfGifLoopsOption, enableMultiprocessOnLinuxOption, glOption, headlessOption, encodingMaxRateOption, encodingBufferSizeOption, delayRenderTimeoutInMillisecondsOption, binariesDirectoryOption, metadataOption, } = client_1.BrowserSafeApis.options;
18
18
  const renderCommand = async (args, remotionRoot, logLevel) => {
19
- var _a, _b, _c;
19
+ var _a, _b, _c, _d;
20
20
  const { serveUrl, cloudRunUrl, outName, forceBucketName, downloadName, privacy, region, } = await (0, renderArgsCheck_1.renderArgsCheck)(exports.RENDER_COMMAND, args, logLevel);
21
21
  const { value: codec, source: codecReason } = client_1.BrowserSafeApis.options.videoCodecOption.getValue({
22
22
  commandLine: cli_1.CliInternals.parsedCli,
@@ -206,7 +206,7 @@ ${downloadName ? ` Downloaded File = ${downloadName}` : ''}
206
206
  inputProps,
207
207
  codec: codec,
208
208
  forceBucketName,
209
- privacy,
209
+ privacy: (_b = args_1.parsedCloudrunCli.privacy) !== null && _b !== void 0 ? _b : 'public',
210
210
  outName,
211
211
  updateRenderProgress,
212
212
  jpegQuality,
@@ -233,7 +233,7 @@ ${downloadName ? ` Downloaded File = ${downloadName}` : ''}
233
233
  delayRenderTimeoutInMilliseconds: puppeteerTimeout,
234
234
  // Special case: Should not use default local concurrency, or from
235
235
  // config file, just when explicitly set
236
- concurrency: (_b = cli_1.CliInternals.parsedCli.concurrency) !== null && _b !== void 0 ? _b : null,
236
+ concurrency: (_c = cli_1.CliInternals.parsedCli.concurrency) !== null && _c !== void 0 ? _c : null,
237
237
  enforceAudioTrack,
238
238
  preferLossless: false,
239
239
  offthreadVideoCacheSizeInBytes,
@@ -241,7 +241,7 @@ ${downloadName ? ` Downloaded File = ${downloadName}` : ''}
241
241
  indent: false,
242
242
  downloadBehavior: { type: 'play-in-browser' },
243
243
  metadata,
244
- renderIdOverride: (_c = args_1.parsedCloudrunCli['render-id-override']) !== null && _c !== void 0 ? _c : null,
244
+ renderIdOverride: (_d = args_1.parsedCloudrunCli['render-id-override']) !== null && _d !== void 0 ? _d : null,
245
245
  renderStatusWebhook: args_1.parsedCloudrunCli.webhook
246
246
  ? {
247
247
  url: args_1.parsedCloudrunCli.webhook,
@@ -18,7 +18,7 @@ const quit_1 = require("../../helpers/quit");
18
18
  const log_1 = require("../../log");
19
19
  exports.SITES_CREATE_SUBCOMMAND = 'create';
20
20
  const sitesCreateSubcommand = async (args, remotionRoot, logLevel) => {
21
- var _a, _b;
21
+ var _a, _b, _c;
22
22
  const { file, reason } = cli_1.CliInternals.findEntryPoint({
23
23
  args,
24
24
  remotionRoot,
@@ -128,6 +128,7 @@ const sitesCreateSubcommand = async (args, remotionRoot, logLevel) => {
128
128
  rootDir: remotionRoot,
129
129
  },
130
130
  indent: false,
131
+ privacy: (_c = args_1.parsedCloudrunCli.privacy) !== null && _c !== void 0 ? _c : 'public',
131
132
  logLevel,
132
133
  });
133
134
  updateProgress(false);
@@ -145,7 +145,7 @@ ${downloadName ? ` Downloaded File = ${downloadName}` : ''}
145
145
  inputProps,
146
146
  imageFormat,
147
147
  composition,
148
- privacy,
148
+ privacy: privacy !== null && privacy !== void 0 ? privacy : 'public',
149
149
  envVariables,
150
150
  frame: stillFrame,
151
151
  jpegQuality,
@@ -62,7 +62,7 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
62
62
  muted: z.ZodBoolean;
63
63
  outputBucket: z.ZodString;
64
64
  outName: z.ZodOptional<z.ZodString>;
65
- privacy: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
65
+ privacy: z.ZodOptional<z.ZodEnum<["public", "private", "no-acl"]>>;
66
66
  logLevel: z.ZodEnum<["trace", "verbose", "info", "warn", "error"]>;
67
67
  delayRenderTimeoutInMilliseconds: z.ZodNullable<z.ZodNumber>;
68
68
  concurrency: z.ZodNullable<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
@@ -155,7 +155,7 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
155
155
  userAgent?: string | null | undefined;
156
156
  } | undefined;
157
157
  outName?: string | undefined;
158
- privacy?: "public" | "private" | undefined;
158
+ privacy?: "public" | "private" | "no-acl" | undefined;
159
159
  metadata?: Record<string, string> | null | undefined;
160
160
  renderIdOverride?: string | null | undefined;
161
161
  renderStatusWebhook?: {
@@ -213,7 +213,7 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
213
213
  userAgent?: string | null | undefined;
214
214
  } | undefined;
215
215
  outName?: string | undefined;
216
- privacy?: "public" | "private" | undefined;
216
+ privacy?: "public" | "private" | "no-acl" | undefined;
217
217
  metadata?: Record<string, string> | null | undefined;
218
218
  renderIdOverride?: string | null | undefined;
219
219
  renderStatusWebhook?: {
@@ -232,7 +232,7 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
232
232
  jpegQuality: z.ZodOptional<z.ZodNumber>;
233
233
  imageFormat: z.ZodEnum<["png", "jpeg", "pdf", "webp"]>;
234
234
  scale: z.ZodNumber;
235
- privacy: z.ZodEnum<["public", "private"]>;
235
+ privacy: z.ZodEnum<["public", "private", "no-acl"]>;
236
236
  envVariables: z.ZodRecord<z.ZodString, z.ZodString>;
237
237
  chromiumOptions: z.ZodOptional<z.ZodObject<{
238
238
  ignoreCertificateErrors: z.ZodOptional<z.ZodBoolean>;
@@ -305,7 +305,7 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
305
305
  envVariables: Record<string, string>;
306
306
  outputBucket: string;
307
307
  outName: string | null;
308
- privacy: "public" | "private";
308
+ privacy: "public" | "private" | "no-acl";
309
309
  logLevel: "trace" | "verbose" | "info" | "warn" | "error";
310
310
  delayRenderTimeoutInMilliseconds: number;
311
311
  offthreadVideoCacheSizeInBytes: number | null;
@@ -346,7 +346,7 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
346
346
  envVariables: Record<string, string>;
347
347
  outputBucket: string;
348
348
  outName: string | null;
349
- privacy: "public" | "private";
349
+ privacy: "public" | "private" | "no-acl";
350
350
  logLevel: "trace" | "verbose" | "info" | "warn" | "error";
351
351
  delayRenderTimeoutInMilliseconds: number;
352
352
  offthreadVideoCacheSizeInBytes: number | null;
@@ -56,7 +56,7 @@ exports.CloudRunPayload = zod_1.z.discriminatedUnion('type', [
56
56
  muted: zod_1.z.boolean(),
57
57
  outputBucket: zod_1.z.string(),
58
58
  outName: zod_1.z.string().optional(),
59
- privacy: zod_1.z.enum(['public', 'private']).optional(),
59
+ privacy: zod_1.z.enum(['public', 'private', 'no-acl']).optional(),
60
60
  logLevel,
61
61
  delayRenderTimeoutInMilliseconds: zod_1.z.number().nullable(),
62
62
  concurrency: zod_1.z.number().or(zod_1.z.string()).nullable(),
@@ -89,7 +89,7 @@ exports.CloudRunPayload = zod_1.z.discriminatedUnion('type', [
89
89
  jpegQuality: zod_1.z.number().optional(),
90
90
  imageFormat: stillImageFormat,
91
91
  scale: zod_1.z.number(),
92
- privacy: zod_1.z.enum(['public', 'private']),
92
+ privacy: zod_1.z.enum(['public', 'private', 'no-acl']),
93
93
  envVariables: zod_1.z.record(zod_1.z.string()),
94
94
  chromiumOptions: chromiumOptions.optional(),
95
95
  outputBucket: zod_1.z.string(),
@@ -6,7 +6,7 @@ export declare const RENDER_SERVICE_PREFIX = "remotion";
6
6
  export declare const getSitesKey: (siteId: string) => string;
7
7
  export declare const DEFAULT_MAX_RETRIES = 1;
8
8
  export declare const inputPropsKey: (hash: string) => string;
9
- export type Privacy = 'public' | 'private';
9
+ export type Privacy = 'public' | 'private' | 'no-acl';
10
10
  export declare const DEFAULT_OUTPUT_PRIVACY: Privacy;
11
11
  export declare const DEFAULT_TIMEOUT = 300;
12
12
  export declare const DEFAULT_MIN_INSTANCES = 0;
@@ -5,7 +5,7 @@ function validatePrivacy(privacy) {
5
5
  if (typeof privacy !== 'string') {
6
6
  throw new TypeError('Privacy must be a string');
7
7
  }
8
- if (privacy !== 'private' && privacy !== 'public') {
9
- throw new TypeError('Privacy must be either "private" or "public"');
8
+ if (privacy !== 'private' && privacy !== 'public' && privacy !== 'no-acl') {
9
+ throw new TypeError('Privacy must be either "private" or "public" or "no-acl"');
10
10
  }
11
11
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/cloudrun"
4
4
  },
5
5
  "name": "@remotion/cloudrun",
6
- "version": "4.0.296",
6
+ "version": "4.0.298",
7
7
  "description": "Render Remotion videos on Google Cloud Run",
8
8
  "main": "dist/index.js",
9
9
  "sideEffects": false,
@@ -16,16 +16,16 @@
16
16
  "@google-cloud/logging": "11.2.0",
17
17
  "google-auth-library": "8.7.0",
18
18
  "zod": "3.22.3",
19
- "@remotion/bundler": "4.0.296",
20
- "@remotion/cli": "4.0.296",
21
- "@remotion/renderer": "4.0.296",
22
- "remotion": "4.0.296"
19
+ "@remotion/bundler": "4.0.298",
20
+ "@remotion/cli": "4.0.298",
21
+ "@remotion/renderer": "4.0.298",
22
+ "remotion": "4.0.298"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/minimist": "1.2.2",
26
26
  "eslint": "9.19.0",
27
- "@remotion/compositor-linux-x64-gnu": "4.0.296",
28
- "@remotion/eslint-config-internal": "4.0.296"
27
+ "@remotion/compositor-linux-x64-gnu": "4.0.298",
28
+ "@remotion/eslint-config-internal": "4.0.298"
29
29
  },
30
30
  "exports": {
31
31
  "./package.json": "./package.json",