@remotion/cloudrun 4.1.0-alpha2

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.
Files changed (175) hide show
  1. package/.turbo/turbo-build.log +13 -0
  2. package/LICENSE.md +41 -0
  3. package/dist/admin/bundle-installer.d.ts +1 -0
  4. package/dist/admin/bundle-installer.js +32 -0
  5. package/dist/admin/bundle-renderLogic.d.ts +1 -0
  6. package/dist/admin/bundle-renderLogic.js +39 -0
  7. package/dist/api/check-if-service-exists.d.ts +18 -0
  8. package/dist/api/check-if-service-exists.js +50 -0
  9. package/dist/api/create-bucket.d.ts +13 -0
  10. package/dist/api/create-bucket.js +18 -0
  11. package/dist/api/delete-service.d.ts +12 -0
  12. package/dist/api/delete-service.js +19 -0
  13. package/dist/api/delete-site.d.ts +13 -0
  14. package/dist/api/delete-site.js +30 -0
  15. package/dist/api/deploy-service.d.ts +28 -0
  16. package/dist/api/deploy-service.js +90 -0
  17. package/dist/api/deploy-site.d.ts +35 -0
  18. package/dist/api/deploy-site.js +78 -0
  19. package/dist/api/download-file.d.ts +13 -0
  20. package/dist/api/download-file.js +30 -0
  21. package/dist/api/get-buckets.d.ts +10 -0
  22. package/dist/api/get-buckets.js +23 -0
  23. package/dist/api/get-or-create-bucket.d.ts +17 -0
  24. package/dist/api/get-or-create-bucket.js +42 -0
  25. package/dist/api/get-regions.d.ts +7 -0
  26. package/dist/api/get-regions.js +13 -0
  27. package/dist/api/get-service-info.d.ts +23 -0
  28. package/dist/api/get-service-info.js +36 -0
  29. package/dist/api/get-services.d.ts +14 -0
  30. package/dist/api/get-services.js +49 -0
  31. package/dist/api/get-sites.d.ts +23 -0
  32. package/dist/api/get-sites.js +49 -0
  33. package/dist/api/helpers/IService.d.ts +2 -0
  34. package/dist/api/helpers/IService.js +2 -0
  35. package/dist/api/helpers/construct-service-deploy-request.d.ts +32 -0
  36. package/dist/api/helpers/construct-service-deploy-request.js +36 -0
  37. package/dist/api/helpers/get-auth-client-for-url.d.ts +1 -0
  38. package/dist/api/helpers/get-auth-client-for-url.js +15 -0
  39. package/dist/api/helpers/get-cloud-run-client.d.ts +2 -0
  40. package/dist/api/helpers/get-cloud-run-client.js +15 -0
  41. package/dist/api/helpers/get-cloud-storage-client.d.ts +2 -0
  42. package/dist/api/helpers/get-cloud-storage-client.js +14 -0
  43. package/dist/api/helpers/get-cloudrun-endpoint.d.ts +14 -0
  44. package/dist/api/helpers/get-cloudrun-endpoint.js +36 -0
  45. package/dist/api/helpers/get-resource-manager-client.d.ts +2 -0
  46. package/dist/api/helpers/get-resource-manager-client.js +15 -0
  47. package/dist/api/iam-validation/testPermissions.d.ts +20 -0
  48. package/dist/api/iam-validation/testPermissions.js +48 -0
  49. package/dist/api/render-media-on-cloudrun.d.ts +70 -0
  50. package/dist/api/render-media-on-cloudrun.js +115 -0
  51. package/dist/api/render-still-on-cloudrun.d.ts +47 -0
  52. package/dist/api/render-still-on-cloudrun.js +68 -0
  53. package/dist/api/speculate-service-name.d.ts +13 -0
  54. package/dist/api/speculate-service-name.js +20 -0
  55. package/dist/api/upload-dir.d.ts +18 -0
  56. package/dist/api/upload-dir.js +81 -0
  57. package/dist/cli/args.d.ts +19 -0
  58. package/dist/cli/args.js +11 -0
  59. package/dist/cli/commands/permissions.d.ts +2 -0
  60. package/dist/cli/commands/permissions.js +23 -0
  61. package/dist/cli/commands/regions.d.ts +2 -0
  62. package/dist/cli/commands/regions.js +10 -0
  63. package/dist/cli/commands/render/helpers/renderArgsCheck.d.ts +9 -0
  64. package/dist/cli/commands/render/helpers/renderArgsCheck.js +75 -0
  65. package/dist/cli/commands/render/index.d.ts +2 -0
  66. package/dist/cli/commands/render/index.js +36 -0
  67. package/dist/cli/commands/render/renderMedia.d.ts +2 -0
  68. package/dist/cli/commands/render/renderMedia.js +156 -0
  69. package/dist/cli/commands/render/renderStill.d.ts +2 -0
  70. package/dist/cli/commands/render/renderStill.js +123 -0
  71. package/dist/cli/commands/services/deploy.d.ts +2 -0
  72. package/dist/cli/commands/services/deploy.js +129 -0
  73. package/dist/cli/commands/services/index.d.ts +5 -0
  74. package/dist/cli/commands/services/index.js +64 -0
  75. package/dist/cli/commands/services/ls.d.ts +2 -0
  76. package/dist/cli/commands/services/ls.js +40 -0
  77. package/dist/cli/commands/services/rm.d.ts +2 -0
  78. package/dist/cli/commands/services/rm.js +63 -0
  79. package/dist/cli/commands/services/rmall.d.ts +2 -0
  80. package/dist/cli/commands/services/rmall.js +52 -0
  81. package/dist/cli/commands/sites/create.d.ts +2 -0
  82. package/dist/cli/commands/sites/create.js +138 -0
  83. package/dist/cli/commands/sites/index.d.ts +4 -0
  84. package/dist/cli/commands/sites/index.js +60 -0
  85. package/dist/cli/commands/sites/ls.d.ts +2 -0
  86. package/dist/cli/commands/sites/ls.js +40 -0
  87. package/dist/cli/commands/sites/rm.d.ts +2 -0
  88. package/dist/cli/commands/sites/rm.js +59 -0
  89. package/dist/cli/commands/sites/rmall.d.ts +2 -0
  90. package/dist/cli/commands/sites/rmall.js +38 -0
  91. package/dist/cli/get-gcp-region.d.ts +2 -0
  92. package/dist/cli/get-gcp-region.js +19 -0
  93. package/dist/cli/help.d.ts +1 -0
  94. package/dist/cli/help.js +34 -0
  95. package/dist/cli/helpers/confirm.d.ts +4 -0
  96. package/dist/cli/helpers/confirm.js +12 -0
  97. package/dist/cli/helpers/date-string.d.ts +1 -0
  98. package/dist/cli/helpers/date-string.js +9 -0
  99. package/dist/cli/helpers/progress-bar.d.ts +23 -0
  100. package/dist/cli/helpers/progress-bar.js +81 -0
  101. package/dist/cli/helpers/quit.d.ts +1 -0
  102. package/dist/cli/helpers/quit.js +7 -0
  103. package/dist/cli/helpers/yes-or-no.d.ts +4 -0
  104. package/dist/cli/helpers/yes-or-no.js +44 -0
  105. package/dist/cli/index.d.ts +1 -0
  106. package/dist/cli/index.js +52 -0
  107. package/dist/cli/log.d.ts +21 -0
  108. package/dist/cli/log.js +5 -0
  109. package/dist/defaults.d.ts +1 -0
  110. package/dist/defaults.js +17 -0
  111. package/dist/index.d.ts +20 -0
  112. package/dist/index.js +31 -0
  113. package/dist/internals.d.ts +3 -0
  114. package/dist/internals.js +7 -0
  115. package/dist/pricing/gcp-regions.d.ts +5 -0
  116. package/dist/pricing/gcp-regions.js +77 -0
  117. package/dist/regions.d.ts +2 -0
  118. package/dist/regions.js +5 -0
  119. package/dist/shared/bundle-site.d.ts +2 -0
  120. package/dist/shared/bundle-site.js +5 -0
  121. package/dist/shared/constants.d.ts +13 -0
  122. package/dist/shared/constants.js +18 -0
  123. package/dist/shared/convert-to-serve-url.d.ts +4 -0
  124. package/dist/shared/convert-to-serve-url.js +14 -0
  125. package/dist/shared/docs-url.d.ts +1 -0
  126. package/dist/shared/docs-url.js +4 -0
  127. package/dist/shared/generate-service-name.d.ts +5 -0
  128. package/dist/shared/generate-service-name.js +20 -0
  129. package/dist/shared/get-etag.d.ts +1 -0
  130. package/dist/shared/get-etag.js +24 -0
  131. package/dist/shared/get-storage-operations.d.ts +10 -0
  132. package/dist/shared/get-storage-operations.js +36 -0
  133. package/dist/shared/make-storage-key.d.ts +1 -0
  134. package/dist/shared/make-storage-key.js +11 -0
  135. package/dist/shared/make-storage-url.d.ts +4 -0
  136. package/dist/shared/make-storage-url.js +7 -0
  137. package/dist/shared/random-hash.d.ts +3 -0
  138. package/dist/shared/random-hash.js +14 -0
  139. package/dist/shared/read-dir.d.ts +9 -0
  140. package/dist/shared/read-dir.js +57 -0
  141. package/dist/shared/sa-permissions.json +60 -0
  142. package/dist/shared/service-version-string.d.ts +1 -0
  143. package/dist/shared/service-version-string.js +8 -0
  144. package/dist/shared/validate-bucketname.d.ts +8 -0
  145. package/dist/shared/validate-bucketname.js +35 -0
  146. package/dist/shared/validate-cloudrun-url.d.ts +1 -0
  147. package/dist/shared/validate-cloudrun-url.js +10 -0
  148. package/dist/shared/validate-gcp-codec.d.ts +4 -0
  149. package/dist/shared/validate-gcp-codec.js +29 -0
  150. package/dist/shared/validate-gcp-region.d.ts +2 -0
  151. package/dist/shared/validate-gcp-region.js +10 -0
  152. package/dist/shared/validate-image-remotion-version.d.ts +1 -0
  153. package/dist/shared/validate-image-remotion-version.js +26 -0
  154. package/dist/shared/validate-privacy.d.ts +2 -0
  155. package/dist/shared/validate-privacy.js +12 -0
  156. package/dist/shared/validate-project-id.d.ts +1 -0
  157. package/dist/shared/validate-project-id.js +17 -0
  158. package/dist/shared/validate-region.d.ts +1 -0
  159. package/dist/shared/validate-region.js +15 -0
  160. package/dist/shared/validate-retries.d.ts +1 -0
  161. package/dist/shared/validate-retries.js +21 -0
  162. package/dist/shared/validate-serveurl.d.ts +1 -0
  163. package/dist/shared/validate-serveurl.js +30 -0
  164. package/dist/shared/validate-service-name.d.ts +1 -0
  165. package/dist/shared/validate-service-name.js +9 -0
  166. package/dist/shared/validate-site-name.d.ts +1 -0
  167. package/dist/shared/validate-site-name.js +17 -0
  168. package/package.json +59 -0
  169. package/readme.md +306 -0
  170. package/readmeImages/createSA.png +0 -0
  171. package/readmeImages/downloadEnv.jpg +0 -0
  172. package/readmeImages/downloadEnvFolder.png +0 -0
  173. package/readmeImages/saRole.png +0 -0
  174. package/readmeImages/selectCloudShell.jpg +0 -0
  175. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.executeCommand = void 0;
4
+ const args_1 = require("./args");
5
+ const permissions_1 = require("./commands/permissions");
6
+ const regions_1 = require("./commands/regions");
7
+ const render_1 = require("./commands/render");
8
+ const services_1 = require("./commands/services");
9
+ const sites_1 = require("./commands/sites");
10
+ const help_1 = require("./help");
11
+ const quit_1 = require("./helpers/quit");
12
+ const log_1 = require("./log");
13
+ const matchCommand = (args, remotionRoot) => {
14
+ if (args_1.parsedCloudrunCli.help || args.length === 0 || args[0] === 'help') {
15
+ (0, help_1.printHelp)();
16
+ (0, quit_1.quit)(0);
17
+ }
18
+ if (args[0] === render_1.RENDER_COMMAND) {
19
+ return (0, render_1.renderCommand)(args.slice(1), remotionRoot);
20
+ }
21
+ if (args[0] === services_1.SERVICES_COMMAND) {
22
+ return (0, services_1.servicesCommand)(args.slice(1));
23
+ }
24
+ if (args[0] === sites_1.SITES_COMMAND) {
25
+ return (0, sites_1.sitesCommand)(args.slice(1), remotionRoot);
26
+ }
27
+ if (args[0] === regions_1.REGIONS_COMMAND) {
28
+ return (0, regions_1.regionsCommand)();
29
+ }
30
+ if (args[0] === permissions_1.PERMISSIONS_COMMAND) {
31
+ return (0, permissions_1.permissionsCommand)();
32
+ }
33
+ if (args[0] === 'deploy') {
34
+ log_1.Log.info(`The "deploy" command does not exist.`);
35
+ log_1.Log.info(`Did you mean "service deploy"?`);
36
+ }
37
+ log_1.Log.error(`Command ${args[0]} not found.`);
38
+ (0, help_1.printHelp)();
39
+ (0, quit_1.quit)(1);
40
+ };
41
+ const executeCommand = async (args, remotionRoot) => {
42
+ try {
43
+ await matchCommand(args, remotionRoot);
44
+ }
45
+ catch (err) {
46
+ const error = err;
47
+ // todo: catch errors and print a message. Check lambda cli for example
48
+ log_1.Log.error(error.stack);
49
+ (0, quit_1.quit)(1);
50
+ }
51
+ };
52
+ exports.executeCommand = executeCommand;
@@ -0,0 +1,21 @@
1
+ export declare const Log: {
2
+ verbose: (message?: any, ...optionalParams: any[]) => void;
3
+ verboseAdvanced: (options: {
4
+ indent: boolean;
5
+ logLevel: "error" | "verbose" | "info" | "warn";
6
+ } & {
7
+ tag?: string | undefined;
8
+ secondTag?: string | undefined;
9
+ }, message?: any, ...optionalParams: any[]) => void;
10
+ info: (message?: any, ...optionalParams: any[]) => void;
11
+ infoAdvanced: (options: {
12
+ indent: boolean;
13
+ logLevel: "error" | "verbose" | "info" | "warn";
14
+ }, message?: any, ...optionalParams: any[]) => void;
15
+ warn: (message?: any, ...optionalParams: any[]) => void;
16
+ warnAdvanced: (options: {
17
+ indent: boolean;
18
+ logLevel: "error" | "verbose" | "info" | "warn";
19
+ }, message?: any, ...optionalParams: any[]) => void;
20
+ error: (message?: any, ...optionalParams: any[]) => void;
21
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Log = void 0;
4
+ const renderer_1 = require("@remotion/renderer");
5
+ exports.Log = renderer_1.RenderInternals.Log;
@@ -0,0 +1 @@
1
+ export * from './shared/constants';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./shared/constants"), exports);
@@ -0,0 +1,20 @@
1
+ import { deleteService } from './api/delete-service';
2
+ import { deleteSite } from './api/delete-site';
3
+ import type { DeployServiceInput, DeployServiceOutput } from './api/deploy-service';
4
+ import { deployService } from './api/deploy-service';
5
+ import { deploySite } from './api/deploy-site';
6
+ import { getOrCreateBucket } from './api/get-or-create-bucket';
7
+ import { getRegions } from './api/get-regions';
8
+ import { getServiceInfo } from './api/get-service-info';
9
+ import { getServices } from './api/get-services';
10
+ import { getSites } from './api/get-sites';
11
+ import { testPermissions } from './api/iam-validation/testPermissions';
12
+ import type { RenderMediaOnCloudrunInput } from './api/render-media-on-cloudrun';
13
+ import { renderMediaOnCloudrun } from './api/render-media-on-cloudrun';
14
+ import { renderStillOnCloudrun } from './api/render-still-on-cloudrun';
15
+ import { speculateServiceName } from './api/speculate-service-name';
16
+ import type { RenderMediaOnCloudrunOutput } from './functions/helpers/payloads';
17
+ import { CloudrunInternals } from './internals';
18
+ import type { GcpRegion } from './pricing/gcp-regions';
19
+ export { CloudrunInternals, deployService, deploySite, deleteSite, deleteService, getServices, getOrCreateBucket, renderMediaOnCloudrun, renderStillOnCloudrun, getServiceInfo, getRegions, getSites, speculateServiceName, testPermissions, };
20
+ export type { GcpRegion, DeployServiceInput, DeployServiceOutput, RenderMediaOnCloudrunOutput, RenderMediaOnCloudrunInput, };
package/dist/index.js ADDED
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.testPermissions = exports.speculateServiceName = exports.getSites = exports.getRegions = exports.getServiceInfo = exports.renderStillOnCloudrun = exports.renderMediaOnCloudrun = exports.getOrCreateBucket = exports.getServices = exports.deleteService = exports.deleteSite = exports.deploySite = exports.deployService = exports.CloudrunInternals = void 0;
4
+ const delete_service_1 = require("./api/delete-service");
5
+ Object.defineProperty(exports, "deleteService", { enumerable: true, get: function () { return delete_service_1.deleteService; } });
6
+ const delete_site_1 = require("./api/delete-site");
7
+ Object.defineProperty(exports, "deleteSite", { enumerable: true, get: function () { return delete_site_1.deleteSite; } });
8
+ const deploy_service_1 = require("./api/deploy-service");
9
+ Object.defineProperty(exports, "deployService", { enumerable: true, get: function () { return deploy_service_1.deployService; } });
10
+ const deploy_site_1 = require("./api/deploy-site");
11
+ Object.defineProperty(exports, "deploySite", { enumerable: true, get: function () { return deploy_site_1.deploySite; } });
12
+ const get_or_create_bucket_1 = require("./api/get-or-create-bucket");
13
+ Object.defineProperty(exports, "getOrCreateBucket", { enumerable: true, get: function () { return get_or_create_bucket_1.getOrCreateBucket; } });
14
+ const get_regions_1 = require("./api/get-regions");
15
+ Object.defineProperty(exports, "getRegions", { enumerable: true, get: function () { return get_regions_1.getRegions; } });
16
+ const get_service_info_1 = require("./api/get-service-info");
17
+ Object.defineProperty(exports, "getServiceInfo", { enumerable: true, get: function () { return get_service_info_1.getServiceInfo; } });
18
+ const get_services_1 = require("./api/get-services");
19
+ Object.defineProperty(exports, "getServices", { enumerable: true, get: function () { return get_services_1.getServices; } });
20
+ const get_sites_1 = require("./api/get-sites");
21
+ Object.defineProperty(exports, "getSites", { enumerable: true, get: function () { return get_sites_1.getSites; } });
22
+ const testPermissions_1 = require("./api/iam-validation/testPermissions");
23
+ Object.defineProperty(exports, "testPermissions", { enumerable: true, get: function () { return testPermissions_1.testPermissions; } });
24
+ const render_media_on_cloudrun_1 = require("./api/render-media-on-cloudrun");
25
+ Object.defineProperty(exports, "renderMediaOnCloudrun", { enumerable: true, get: function () { return render_media_on_cloudrun_1.renderMediaOnCloudrun; } });
26
+ const render_still_on_cloudrun_1 = require("./api/render-still-on-cloudrun");
27
+ Object.defineProperty(exports, "renderStillOnCloudrun", { enumerable: true, get: function () { return render_still_on_cloudrun_1.renderStillOnCloudrun; } });
28
+ const speculate_service_name_1 = require("./api/speculate-service-name");
29
+ Object.defineProperty(exports, "speculateServiceName", { enumerable: true, get: function () { return speculate_service_name_1.speculateServiceName; } });
30
+ const internals_1 = require("./internals");
31
+ Object.defineProperty(exports, "CloudrunInternals", { enumerable: true, get: function () { return internals_1.CloudrunInternals; } });
@@ -0,0 +1,3 @@
1
+ export declare const CloudrunInternals: {
2
+ executeCommand: (args: string[], remotionRoot: string) => Promise<void>;
3
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CloudrunInternals = void 0;
4
+ const index_1 = require("./cli/index");
5
+ exports.CloudrunInternals = {
6
+ executeCommand: index_1.executeCommand,
7
+ };
@@ -0,0 +1,5 @@
1
+ export declare const GCP_REGIONS: readonly ["asia-east1", "asia-east2", "asia-northeast1", "asia-northeast2", "asia-northeast3", "asia-south1", "asia-south2", "asia-southeast1", "asia-southeast2", "australia-southeast1", "australia-southeast2", "europe-central2", "europe-north1", "europe-southwest1", "europe-west1", "europe-west2", "europe-west3", "europe-west4", "europe-west6", "europe-west8", "europe-west9", "me-west1", "northamerica-northeast1", "northamerica-northeast2", "southamerica-east1", "southamerica-west1", "us-central1", "us-east1", "us-east4", "us-east5", "us-south1", "us-west1", "us-west2", "us-west3", "us-west4"];
2
+ export declare const GCP_REGION_SHORTHAND: {
3
+ [key in GcpRegion]: string;
4
+ };
5
+ export declare type GcpRegion = typeof GCP_REGIONS[number];
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GCP_REGION_SHORTHAND = exports.GCP_REGIONS = void 0;
4
+ exports.GCP_REGIONS = [
5
+ 'asia-east1',
6
+ 'asia-east2',
7
+ 'asia-northeast1',
8
+ 'asia-northeast2',
9
+ 'asia-northeast3',
10
+ 'asia-south1',
11
+ 'asia-south2',
12
+ 'asia-southeast1',
13
+ 'asia-southeast2',
14
+ 'australia-southeast1',
15
+ 'australia-southeast2',
16
+ 'europe-central2',
17
+ 'europe-north1',
18
+ 'europe-southwest1',
19
+ 'europe-west1',
20
+ 'europe-west2',
21
+ 'europe-west3',
22
+ 'europe-west4',
23
+ 'europe-west6',
24
+ 'europe-west8',
25
+ 'europe-west9',
26
+ 'me-west1',
27
+ 'northamerica-northeast1',
28
+ 'northamerica-northeast2',
29
+ 'southamerica-east1',
30
+ 'southamerica-west1',
31
+ 'us-central1',
32
+ 'us-east1',
33
+ 'us-east4',
34
+ 'us-east5',
35
+ 'us-south1',
36
+ 'us-west1',
37
+ 'us-west2',
38
+ 'us-west3',
39
+ 'us-west4',
40
+ ];
41
+ exports.GCP_REGION_SHORTHAND = {
42
+ 'us-east5': 'ul.a',
43
+ 'asia-east1': 'de.a',
44
+ 'asia-east2': 'df.a',
45
+ 'asia-northeast1': 'an.a',
46
+ 'asia-northeast2': 'dt.a',
47
+ 'asia-northeast3': 'du.a',
48
+ 'asia-south1': 'el.a',
49
+ 'asia-south2': 'em.a',
50
+ 'asia-southeast1': 'as.a',
51
+ 'asia-southeast2': 'et.a',
52
+ 'australia-southeast1': 'ts.a',
53
+ 'australia-southeast2': 'km.a',
54
+ 'europe-central2': 'lm.a',
55
+ 'europe-north1': 'lz.a',
56
+ 'europe-southwest1': 'no.a',
57
+ 'europe-west1': 'ew.a',
58
+ 'europe-west2': 'nw.a',
59
+ 'europe-west3': 'ey.a',
60
+ 'europe-west4': 'ez.a',
61
+ 'europe-west6': 'oa.a',
62
+ 'europe-west8': 'oc.a',
63
+ 'europe-west9': 'od.a',
64
+ 'me-west1': 'zf.a',
65
+ 'northamerica-northeast1': 'nn.a',
66
+ 'northamerica-northeast2': 'pd.a',
67
+ 'southamerica-east1': 'rj.a',
68
+ 'southamerica-west1': 'tl.a',
69
+ 'us-central1': 'uc.a',
70
+ 'us-east1': 'ue.a',
71
+ 'us-east4': 'uk.a',
72
+ 'us-west1': 'uw.a',
73
+ 'us-south1': 'vp.a',
74
+ 'us-west2': 'wl.a',
75
+ 'us-west4': 'wn.a',
76
+ 'us-west3': 'wm.a',
77
+ };
@@ -0,0 +1,2 @@
1
+ import { GCP_REGIONS } from './pricing/gcp-regions';
2
+ export { GCP_REGIONS };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GCP_REGIONS = void 0;
4
+ const gcp_regions_1 = require("./pricing/gcp-regions");
5
+ Object.defineProperty(exports, "GCP_REGIONS", { enumerable: true, get: function () { return gcp_regions_1.GCP_REGIONS; } });
@@ -0,0 +1,2 @@
1
+ import { bundle } from '@remotion/bundler';
2
+ export declare const bundleSite: typeof bundle;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bundleSite = void 0;
4
+ const bundler_1 = require("@remotion/bundler");
5
+ exports.bundleSite = bundler_1.bundle;
@@ -0,0 +1,13 @@
1
+ import type { GcpRegion } from '../pricing/gcp-regions';
2
+ export declare const DEFAULT_REGION: GcpRegion;
3
+ export declare const BINARY_NAME = "remotion cloudrun";
4
+ export declare const REMOTION_BUCKET_PREFIX = "remotioncloudrun-";
5
+ export declare const RENDER_SERVICE_PREFIX = "remotion";
6
+ export declare const getSitesKey: (siteId: string) => string;
7
+ export declare const DEFAULT_MAX_RETRIES = 1;
8
+ export declare const inputPropsKey: (hash: string) => string;
9
+ export declare type Privacy = 'public' | 'private';
10
+ export declare const DEFAULT_OUTPUT_PRIVACY: Privacy;
11
+ export declare const DEFAULT_TIMEOUT = 300;
12
+ export declare const DEFAULT_MIN_INSTANCES = 0;
13
+ export declare const DEFAULT_MAX_INSTANCES = 100;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_MAX_INSTANCES = exports.DEFAULT_MIN_INSTANCES = exports.DEFAULT_TIMEOUT = exports.DEFAULT_OUTPUT_PRIVACY = exports.inputPropsKey = exports.DEFAULT_MAX_RETRIES = exports.getSitesKey = exports.RENDER_SERVICE_PREFIX = exports.REMOTION_BUCKET_PREFIX = exports.BINARY_NAME = exports.DEFAULT_REGION = void 0;
4
+ exports.DEFAULT_REGION = 'us-east1';
5
+ exports.BINARY_NAME = 'remotion cloudrun';
6
+ exports.REMOTION_BUCKET_PREFIX = 'remotioncloudrun-';
7
+ exports.RENDER_SERVICE_PREFIX = 'remotion';
8
+ const getSitesKey = (siteId) => `sites/${siteId}`;
9
+ exports.getSitesKey = getSitesKey;
10
+ exports.DEFAULT_MAX_RETRIES = 1;
11
+ const inputPropsKey = (hash) => {
12
+ return `input-props/${hash}.json`;
13
+ };
14
+ exports.inputPropsKey = inputPropsKey;
15
+ exports.DEFAULT_OUTPUT_PRIVACY = 'public';
16
+ exports.DEFAULT_TIMEOUT = 300;
17
+ exports.DEFAULT_MIN_INSTANCES = 0;
18
+ exports.DEFAULT_MAX_INSTANCES = 100;
@@ -0,0 +1,4 @@
1
+ export declare const convertToServeUrl: ({ urlOrId, bucketName, }: {
2
+ urlOrId: string;
3
+ bucketName: string;
4
+ }) => string;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertToServeUrl = void 0;
4
+ const docs_url_1 = require("./docs-url");
5
+ const convertToServeUrl = ({ urlOrId, bucketName, }) => {
6
+ if (urlOrId.startsWith('src/')) {
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/cloudrun/setup`);
8
+ }
9
+ if (urlOrId.startsWith('http://') || urlOrId.startsWith('https://')) {
10
+ return urlOrId;
11
+ }
12
+ return `https://storage.googleapis.com/${bucketName}/sites/${urlOrId}/index.html`;
13
+ };
14
+ exports.convertToServeUrl = convertToServeUrl;
@@ -0,0 +1 @@
1
+ export declare const DOCS_URL = "https://remotion.dev";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DOCS_URL = void 0;
4
+ exports.DOCS_URL = 'https://remotion.dev';
@@ -0,0 +1,5 @@
1
+ export declare const generateServiceName: ({ memoryLimit, cpuLimit, timeoutSeconds, }: {
2
+ memoryLimit: string;
3
+ cpuLimit: string;
4
+ timeoutSeconds: number;
5
+ }) => string;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateServiceName = void 0;
4
+ const constants_1 = require("./constants");
5
+ const service_version_string_1 = require("./service-version-string");
6
+ const generateServiceName = ({ memoryLimit, cpuLimit, timeoutSeconds, }) => {
7
+ const sanitisedCPU = cpuLimit.replace(/\./g, '-').substring(0, 10);
8
+ const sanitisedMem = memoryLimit
9
+ .replace(/\./g, '-')
10
+ .substring(0, 10)
11
+ .toLowerCase();
12
+ return [
13
+ constants_1.RENDER_SERVICE_PREFIX,
14
+ (0, service_version_string_1.serviceVersionString)(),
15
+ `mem${sanitisedMem}`,
16
+ `cpu${sanitisedCPU}`,
17
+ `t-${String(timeoutSeconds)}`,
18
+ ].join('--');
19
+ };
20
+ exports.generateServiceName = generateServiceName;
@@ -0,0 +1 @@
1
+ export declare const getEtagOfFile: (filePath: string) => Promise<string>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getEtagOfFile = void 0;
7
+ const crypto_1 = __importDefault(require("crypto"));
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const chunk = 1024 * 1024 * 5; // 5MB
10
+ const md5 = (data) => crypto_1.default.createHash('md5').update(data).digest('hex');
11
+ const getEtagOfFile = async (filePath) => {
12
+ const stream = await fs_1.default.promises.readFile(filePath);
13
+ if (stream.length <= chunk) {
14
+ return `"${md5(stream)}"`;
15
+ }
16
+ const md5Chunks = [];
17
+ const chunksNumber = Math.ceil(stream.length / chunk);
18
+ for (let i = 0; i < chunksNumber; i++) {
19
+ const chunkStream = stream.slice(i * chunk, (i + 1) * chunk);
20
+ md5Chunks.push(md5(chunkStream));
21
+ }
22
+ return `"${md5(Buffer.from(md5Chunks.join(''), 'hex'))}-${chunksNumber}"`;
23
+ };
24
+ exports.getEtagOfFile = getEtagOfFile;
@@ -0,0 +1,10 @@
1
+ import type { File } from '@google-cloud/storage';
2
+ export declare const getStorageDiffOperations: ({ objects, bundle, prefix, }: {
3
+ objects: File[];
4
+ bundle: string;
5
+ prefix: string;
6
+ }) => Promise<{
7
+ toDelete: File[];
8
+ toUpload: string[];
9
+ existingCount: number;
10
+ }>;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getStorageDiffOperations = void 0;
4
+ const read_dir_1 = require("./read-dir");
5
+ const getStorageDiffOperations = async ({ objects, bundle, prefix, }) => {
6
+ const dir = await (0, read_dir_1.readDirectory)({
7
+ dir: bundle,
8
+ etags: {},
9
+ originalDir: bundle,
10
+ });
11
+ const filesOnStorageButNotLocal = objects.filter((fileOnStorage) => {
12
+ var _a;
13
+ const key = (_a = fileOnStorage.name) === null || _a === void 0 ? void 0 : _a.substring(prefix.length);
14
+ return !dir[key];
15
+ });
16
+ const localFilesNotOnStorage = Object.keys(dir).filter((d) => {
17
+ return !objects.find((o) => {
18
+ var _a;
19
+ const key = (_a = o.name) === null || _a === void 0 ? void 0 : _a.substring(prefix.length);
20
+ return key === d && o.metadata.etag === dir[d];
21
+ });
22
+ });
23
+ const existing = Object.keys(dir).filter((d) => {
24
+ return objects.find((o) => {
25
+ var _a;
26
+ const key = (_a = o.name) === null || _a === void 0 ? void 0 : _a.substring(prefix.length);
27
+ return key === d && o.metadata.etag === dir[d];
28
+ });
29
+ });
30
+ return {
31
+ toDelete: filesOnStorageButNotLocal,
32
+ toUpload: localFilesNotOnStorage,
33
+ existingCount: existing.length,
34
+ };
35
+ };
36
+ exports.getStorageDiffOperations = getStorageDiffOperations;
@@ -0,0 +1 @@
1
+ export declare const makeStorageKey: (folder: string, dir: string, filePath: string) => string;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.makeStorageKey = void 0;
7
+ const path_1 = __importDefault(require("path"));
8
+ const makeStorageKey = (folder, dir, filePath) => {
9
+ return `${folder}/${path_1.default.relative(dir, filePath).split(path_1.default.sep).join('/')}`;
10
+ };
11
+ exports.makeStorageKey = makeStorageKey;
@@ -0,0 +1,4 @@
1
+ export declare const makeStorageServeUrl: ({ bucketName, subFolder, }: {
2
+ bucketName: string;
3
+ subFolder: string;
4
+ }) => string;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeStorageServeUrl = void 0;
4
+ const makeStorageServeUrl = ({ bucketName, subFolder, }) => {
5
+ return `https://storage.googleapis.com/${bucketName}/${subFolder}/index.html`;
6
+ };
7
+ exports.makeStorageServeUrl = makeStorageServeUrl;
@@ -0,0 +1,3 @@
1
+ export declare const randomHash: (_options?: {
2
+ randomInTests: boolean;
3
+ }) => string;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.randomHash = void 0;
4
+ const alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789';
5
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
6
+ const randomHash = (_options) => {
7
+ return new Array(10)
8
+ .fill(1)
9
+ .map(() => {
10
+ return alphabet[Math.floor(Math.random() * alphabet.length)];
11
+ })
12
+ .join('');
13
+ };
14
+ exports.randomHash = randomHash;
@@ -0,0 +1,9 @@
1
+ export declare function readDirectory({ dir, etags, originalDir, }: {
2
+ dir: string;
3
+ etags: {
4
+ [key: string]: string;
5
+ };
6
+ originalDir: string;
7
+ }): Promise<{
8
+ [key: string]: string;
9
+ }>;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.readDirectory = void 0;
27
+ const fs = __importStar(require("fs"));
28
+ const path = __importStar(require("path"));
29
+ const get_etag_1 = require("./get-etag");
30
+ // Function to recursively read a directory and return a list of files
31
+ // with their etags and file names
32
+ async function readDirectory({ dir, etags, originalDir, }) {
33
+ const files = fs.readdirSync(dir);
34
+ for (const file of files) {
35
+ if (file.startsWith('.DS_Store'))
36
+ continue;
37
+ const filePath = path.join(dir, file);
38
+ if (fs.lstatSync(filePath).isDirectory()) {
39
+ etags = {
40
+ ...etags,
41
+ ...(await readDirectory({ dir: filePath, etags, originalDir })),
42
+ };
43
+ continue;
44
+ }
45
+ // eslint-disable-next-line no-lonely-if
46
+ if (fs.lstatSync(filePath).isSymbolicLink()) {
47
+ const realPath = fs.realpathSync(filePath);
48
+ etags[path.relative(originalDir, filePath)] = await (0, get_etag_1.getEtagOfFile)(realPath);
49
+ }
50
+ else {
51
+ etags[path.relative(originalDir, filePath)] = await (0, get_etag_1.getEtagOfFile)(filePath);
52
+ }
53
+ }
54
+ // Return the list of files with their etags and file names
55
+ return etags;
56
+ }
57
+ exports.readDirectory = readDirectory;
@@ -0,0 +1,60 @@
1
+ {
2
+ "list": [
3
+ {
4
+ "name": "iam.serviceAccounts.actAs",
5
+ "reason": "When deploying, act as the default service account, which will grant further permissions required during deployment."
6
+ },
7
+ {
8
+ "name": "run.operations.get",
9
+ "reason": "Required during deployment to confirm that deployment was successful."
10
+ },
11
+ {
12
+ "name": "run.routes.invoke",
13
+ "reason": "Invoke the deployed Cloud Run services to perform a render."
14
+ },
15
+ {
16
+ "name": "run.services.create",
17
+ "reason": "Deploy new, and edit existing, Cloud Run services."
18
+ },
19
+ {
20
+ "name": "run.services.get",
21
+ "reason": ""
22
+ },
23
+ {
24
+ "name": "run.services.delete",
25
+ "reason": ""
26
+ },
27
+ {
28
+ "name": "run.services.list",
29
+ "reason": "Get a list of existing Cloud Run services, to ensure no unintended overwriting."
30
+ },
31
+ {
32
+ "name": "run.services.update",
33
+ "reason": "Update a Cloud Run service, for example providing it with more memory or CPU."
34
+ },
35
+ {
36
+ "name": "storage.buckets.create",
37
+ "reason": "Create the storage bucket to store the bundled site and render output."
38
+ },
39
+ {
40
+ "name": "storage.buckets.get",
41
+ "reason": ""
42
+ },
43
+ {
44
+ "name": "storage.buckets.list",
45
+ "reason": "Get a list of existing Cloud Storage resources, to ensure no unintended overwriting of storage buckets."
46
+ },
47
+ {
48
+ "name": "storage.objects.create",
49
+ "reason": "Create new objects in storage. This could be bundled sites, or renders, or logs."
50
+ },
51
+ {
52
+ "name": "storage.objects.delete",
53
+ "reason": ""
54
+ },
55
+ {
56
+ "name": "storage.objects.list",
57
+ "reason": ""
58
+ }
59
+ ]
60
+ }
@@ -0,0 +1 @@
1
+ export declare const serviceVersionString: () => string;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.serviceVersionString = void 0;
4
+ const version_1 = require("remotion/version");
5
+ const serviceVersionString = () => {
6
+ return version_1.VERSION.replace(/\./g, '-').replace(/\+/g, '-').substring(0, 10);
7
+ };
8
+ exports.serviceVersionString = serviceVersionString;