@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.
- package/.turbo/turbo-build.log +13 -0
- package/LICENSE.md +41 -0
- package/dist/admin/bundle-installer.d.ts +1 -0
- package/dist/admin/bundle-installer.js +32 -0
- package/dist/admin/bundle-renderLogic.d.ts +1 -0
- package/dist/admin/bundle-renderLogic.js +39 -0
- package/dist/api/check-if-service-exists.d.ts +18 -0
- package/dist/api/check-if-service-exists.js +50 -0
- package/dist/api/create-bucket.d.ts +13 -0
- package/dist/api/create-bucket.js +18 -0
- package/dist/api/delete-service.d.ts +12 -0
- package/dist/api/delete-service.js +19 -0
- package/dist/api/delete-site.d.ts +13 -0
- package/dist/api/delete-site.js +30 -0
- package/dist/api/deploy-service.d.ts +28 -0
- package/dist/api/deploy-service.js +90 -0
- package/dist/api/deploy-site.d.ts +35 -0
- package/dist/api/deploy-site.js +78 -0
- package/dist/api/download-file.d.ts +13 -0
- package/dist/api/download-file.js +30 -0
- package/dist/api/get-buckets.d.ts +10 -0
- package/dist/api/get-buckets.js +23 -0
- package/dist/api/get-or-create-bucket.d.ts +17 -0
- package/dist/api/get-or-create-bucket.js +42 -0
- package/dist/api/get-regions.d.ts +7 -0
- package/dist/api/get-regions.js +13 -0
- package/dist/api/get-service-info.d.ts +23 -0
- package/dist/api/get-service-info.js +36 -0
- package/dist/api/get-services.d.ts +14 -0
- package/dist/api/get-services.js +49 -0
- package/dist/api/get-sites.d.ts +23 -0
- package/dist/api/get-sites.js +49 -0
- package/dist/api/helpers/IService.d.ts +2 -0
- package/dist/api/helpers/IService.js +2 -0
- package/dist/api/helpers/construct-service-deploy-request.d.ts +32 -0
- package/dist/api/helpers/construct-service-deploy-request.js +36 -0
- package/dist/api/helpers/get-auth-client-for-url.d.ts +1 -0
- package/dist/api/helpers/get-auth-client-for-url.js +15 -0
- package/dist/api/helpers/get-cloud-run-client.d.ts +2 -0
- package/dist/api/helpers/get-cloud-run-client.js +15 -0
- package/dist/api/helpers/get-cloud-storage-client.d.ts +2 -0
- package/dist/api/helpers/get-cloud-storage-client.js +14 -0
- package/dist/api/helpers/get-cloudrun-endpoint.d.ts +14 -0
- package/dist/api/helpers/get-cloudrun-endpoint.js +36 -0
- package/dist/api/helpers/get-resource-manager-client.d.ts +2 -0
- package/dist/api/helpers/get-resource-manager-client.js +15 -0
- package/dist/api/iam-validation/testPermissions.d.ts +20 -0
- package/dist/api/iam-validation/testPermissions.js +48 -0
- package/dist/api/render-media-on-cloudrun.d.ts +70 -0
- package/dist/api/render-media-on-cloudrun.js +115 -0
- package/dist/api/render-still-on-cloudrun.d.ts +47 -0
- package/dist/api/render-still-on-cloudrun.js +68 -0
- package/dist/api/speculate-service-name.d.ts +13 -0
- package/dist/api/speculate-service-name.js +20 -0
- package/dist/api/upload-dir.d.ts +18 -0
- package/dist/api/upload-dir.js +81 -0
- package/dist/cli/args.d.ts +19 -0
- package/dist/cli/args.js +11 -0
- package/dist/cli/commands/permissions.d.ts +2 -0
- package/dist/cli/commands/permissions.js +23 -0
- package/dist/cli/commands/regions.d.ts +2 -0
- package/dist/cli/commands/regions.js +10 -0
- package/dist/cli/commands/render/helpers/renderArgsCheck.d.ts +9 -0
- package/dist/cli/commands/render/helpers/renderArgsCheck.js +75 -0
- package/dist/cli/commands/render/index.d.ts +2 -0
- package/dist/cli/commands/render/index.js +36 -0
- package/dist/cli/commands/render/renderMedia.d.ts +2 -0
- package/dist/cli/commands/render/renderMedia.js +156 -0
- package/dist/cli/commands/render/renderStill.d.ts +2 -0
- package/dist/cli/commands/render/renderStill.js +123 -0
- package/dist/cli/commands/services/deploy.d.ts +2 -0
- package/dist/cli/commands/services/deploy.js +129 -0
- package/dist/cli/commands/services/index.d.ts +5 -0
- package/dist/cli/commands/services/index.js +64 -0
- package/dist/cli/commands/services/ls.d.ts +2 -0
- package/dist/cli/commands/services/ls.js +40 -0
- package/dist/cli/commands/services/rm.d.ts +2 -0
- package/dist/cli/commands/services/rm.js +63 -0
- package/dist/cli/commands/services/rmall.d.ts +2 -0
- package/dist/cli/commands/services/rmall.js +52 -0
- package/dist/cli/commands/sites/create.d.ts +2 -0
- package/dist/cli/commands/sites/create.js +138 -0
- package/dist/cli/commands/sites/index.d.ts +4 -0
- package/dist/cli/commands/sites/index.js +60 -0
- package/dist/cli/commands/sites/ls.d.ts +2 -0
- package/dist/cli/commands/sites/ls.js +40 -0
- package/dist/cli/commands/sites/rm.d.ts +2 -0
- package/dist/cli/commands/sites/rm.js +59 -0
- package/dist/cli/commands/sites/rmall.d.ts +2 -0
- package/dist/cli/commands/sites/rmall.js +38 -0
- package/dist/cli/get-gcp-region.d.ts +2 -0
- package/dist/cli/get-gcp-region.js +19 -0
- package/dist/cli/help.d.ts +1 -0
- package/dist/cli/help.js +34 -0
- package/dist/cli/helpers/confirm.d.ts +4 -0
- package/dist/cli/helpers/confirm.js +12 -0
- package/dist/cli/helpers/date-string.d.ts +1 -0
- package/dist/cli/helpers/date-string.js +9 -0
- package/dist/cli/helpers/progress-bar.d.ts +23 -0
- package/dist/cli/helpers/progress-bar.js +81 -0
- package/dist/cli/helpers/quit.d.ts +1 -0
- package/dist/cli/helpers/quit.js +7 -0
- package/dist/cli/helpers/yes-or-no.d.ts +4 -0
- package/dist/cli/helpers/yes-or-no.js +44 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +52 -0
- package/dist/cli/log.d.ts +21 -0
- package/dist/cli/log.js +5 -0
- package/dist/defaults.d.ts +1 -0
- package/dist/defaults.js +17 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +31 -0
- package/dist/internals.d.ts +3 -0
- package/dist/internals.js +7 -0
- package/dist/pricing/gcp-regions.d.ts +5 -0
- package/dist/pricing/gcp-regions.js +77 -0
- package/dist/regions.d.ts +2 -0
- package/dist/regions.js +5 -0
- package/dist/shared/bundle-site.d.ts +2 -0
- package/dist/shared/bundle-site.js +5 -0
- package/dist/shared/constants.d.ts +13 -0
- package/dist/shared/constants.js +18 -0
- package/dist/shared/convert-to-serve-url.d.ts +4 -0
- package/dist/shared/convert-to-serve-url.js +14 -0
- package/dist/shared/docs-url.d.ts +1 -0
- package/dist/shared/docs-url.js +4 -0
- package/dist/shared/generate-service-name.d.ts +5 -0
- package/dist/shared/generate-service-name.js +20 -0
- package/dist/shared/get-etag.d.ts +1 -0
- package/dist/shared/get-etag.js +24 -0
- package/dist/shared/get-storage-operations.d.ts +10 -0
- package/dist/shared/get-storage-operations.js +36 -0
- package/dist/shared/make-storage-key.d.ts +1 -0
- package/dist/shared/make-storage-key.js +11 -0
- package/dist/shared/make-storage-url.d.ts +4 -0
- package/dist/shared/make-storage-url.js +7 -0
- package/dist/shared/random-hash.d.ts +3 -0
- package/dist/shared/random-hash.js +14 -0
- package/dist/shared/read-dir.d.ts +9 -0
- package/dist/shared/read-dir.js +57 -0
- package/dist/shared/sa-permissions.json +60 -0
- package/dist/shared/service-version-string.d.ts +1 -0
- package/dist/shared/service-version-string.js +8 -0
- package/dist/shared/validate-bucketname.d.ts +8 -0
- package/dist/shared/validate-bucketname.js +35 -0
- package/dist/shared/validate-cloudrun-url.d.ts +1 -0
- package/dist/shared/validate-cloudrun-url.js +10 -0
- package/dist/shared/validate-gcp-codec.d.ts +4 -0
- package/dist/shared/validate-gcp-codec.js +29 -0
- package/dist/shared/validate-gcp-region.d.ts +2 -0
- package/dist/shared/validate-gcp-region.js +10 -0
- package/dist/shared/validate-image-remotion-version.d.ts +1 -0
- package/dist/shared/validate-image-remotion-version.js +26 -0
- package/dist/shared/validate-privacy.d.ts +2 -0
- package/dist/shared/validate-privacy.js +12 -0
- package/dist/shared/validate-project-id.d.ts +1 -0
- package/dist/shared/validate-project-id.js +17 -0
- package/dist/shared/validate-region.d.ts +1 -0
- package/dist/shared/validate-region.js +15 -0
- package/dist/shared/validate-retries.d.ts +1 -0
- package/dist/shared/validate-retries.js +21 -0
- package/dist/shared/validate-serveurl.d.ts +1 -0
- package/dist/shared/validate-serveurl.js +30 -0
- package/dist/shared/validate-service-name.d.ts +1 -0
- package/dist/shared/validate-service-name.js +9 -0
- package/dist/shared/validate-site-name.d.ts +1 -0
- package/dist/shared/validate-site-name.js +17 -0
- package/package.json +59 -0
- package/readme.md +306 -0
- package/readmeImages/createSA.png +0 -0
- package/readmeImages/downloadEnv.jpg +0 -0
- package/readmeImages/downloadEnvFolder.png +0 -0
- package/readmeImages/saRole.png +0 -0
- package/readmeImages/selectCloudShell.jpg +0 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { GcpRegion } from '../pricing/gcp-regions';
|
|
2
|
+
export declare const validateBucketName: (bucketName: unknown, options: {
|
|
3
|
+
mustStartWithRemotion: boolean;
|
|
4
|
+
}) => void;
|
|
5
|
+
export declare const parseBucketName: (name: string) => {
|
|
6
|
+
region: GcpRegion | null;
|
|
7
|
+
};
|
|
8
|
+
export declare const makeBucketName: () => string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeBucketName = exports.parseBucketName = exports.validateBucketName = void 0;
|
|
4
|
+
const regions_1 = require("../regions");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
6
|
+
const random_hash_1 = require("./random-hash");
|
|
7
|
+
const validateBucketName = (bucketName, options) => {
|
|
8
|
+
if (typeof bucketName !== 'string') {
|
|
9
|
+
throw new TypeError(`'bucketName' must be a string, but is ${JSON.stringify(bucketName)}`);
|
|
10
|
+
}
|
|
11
|
+
if (options.mustStartWithRemotion &&
|
|
12
|
+
!bucketName.startsWith(constants_1.REMOTION_BUCKET_PREFIX)) {
|
|
13
|
+
throw new Error(`The bucketName parameter must start with ${constants_1.REMOTION_BUCKET_PREFIX}.`);
|
|
14
|
+
}
|
|
15
|
+
if (!bucketName.match(/^(?=^.{3,63}$)(?!^(\d+\.)+\d+$)(^(([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])$)/)) {
|
|
16
|
+
throw new Error(`The bucket ${bucketName} `);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
exports.validateBucketName = validateBucketName;
|
|
20
|
+
const parseBucketName = (name) => {
|
|
21
|
+
const parsed = name.match(new RegExp(`^${constants_1.REMOTION_BUCKET_PREFIX}(.*)-([a-z0-9A-Z]+)$`));
|
|
22
|
+
const region = parsed === null || parsed === void 0 ? void 0 : parsed[1];
|
|
23
|
+
if (!region) {
|
|
24
|
+
return { region: null };
|
|
25
|
+
}
|
|
26
|
+
const realRegionFound = regions_1.GCP_REGIONS.find((r) => r.replace(/-/g, '') === region);
|
|
27
|
+
return { region: realRegionFound !== null && realRegionFound !== void 0 ? realRegionFound : null };
|
|
28
|
+
};
|
|
29
|
+
exports.parseBucketName = parseBucketName;
|
|
30
|
+
const makeBucketName = () => {
|
|
31
|
+
return `${constants_1.REMOTION_BUCKET_PREFIX}${(0, random_hash_1.randomHash)({
|
|
32
|
+
randomInTests: false,
|
|
33
|
+
})}`;
|
|
34
|
+
};
|
|
35
|
+
exports.makeBucketName = makeBucketName;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const validateCloudRunUrl: (cloudRunUrl: unknown) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateCloudRunUrl = void 0;
|
|
4
|
+
const validateCloudRunUrl = (cloudRunUrl) => {
|
|
5
|
+
if (typeof cloudRunUrl !== 'string') {
|
|
6
|
+
throw new TypeError(`"cloudRunUrl" parameter must be a string, but is ${JSON.stringify(cloudRunUrl)}`);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
exports.validateCloudRunUrl = validateCloudRunUrl;
|
|
10
|
+
// To improve this, we could add an endpoint within the image that returns some message to confirm that this is a Cloud Run url
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateCloudrunCodec = void 0;
|
|
4
|
+
const cloudrunCodecs = [
|
|
5
|
+
'h264',
|
|
6
|
+
'vp8',
|
|
7
|
+
'vp9',
|
|
8
|
+
'mp3',
|
|
9
|
+
'aac',
|
|
10
|
+
'wav',
|
|
11
|
+
'gif',
|
|
12
|
+
'prores',
|
|
13
|
+
];
|
|
14
|
+
const validateCloudrunCodec = (codec) => {
|
|
15
|
+
if (typeof codec !== 'string') {
|
|
16
|
+
throw new TypeError('"codec" must be a string ');
|
|
17
|
+
}
|
|
18
|
+
if (!cloudrunCodecs.includes(codec)) {
|
|
19
|
+
throw new TypeError("'" +
|
|
20
|
+
codec +
|
|
21
|
+
"' is not a valid codec for GCP Cloud Run. The following values are supported: " +
|
|
22
|
+
cloudrunCodecs.join(', '));
|
|
23
|
+
}
|
|
24
|
+
if (codec === 'h264-mkv') {
|
|
25
|
+
throw new Error('The "h264-mkv" codec for renderMediaOnCloudrun() is deprecated - it\'s now just "h264".');
|
|
26
|
+
}
|
|
27
|
+
return codec;
|
|
28
|
+
};
|
|
29
|
+
exports.validateCloudrunCodec = validateCloudrunCodec;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateGcpRegion = void 0;
|
|
4
|
+
const gcp_regions_1 = require("../pricing/gcp-regions");
|
|
5
|
+
function validateGcpRegion(region) {
|
|
6
|
+
if (!gcp_regions_1.GCP_REGIONS.includes(region)) {
|
|
7
|
+
throw new TypeError(`${region} is not a valid GCP region. Must be one of: ${gcp_regions_1.GCP_REGIONS.join(', ')}`);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.validateGcpRegion = validateGcpRegion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const validateImageRemotionVersion: () => Promise<void>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateImageRemotionVersion = void 0;
|
|
4
|
+
const artifact_registry_1 = require("@google-cloud/artifact-registry");
|
|
5
|
+
const version_1 = require("remotion/version");
|
|
6
|
+
const validateImageRemotionVersion = async () => {
|
|
7
|
+
var _a;
|
|
8
|
+
const client = new artifact_registry_1.ArtifactRegistryClient({
|
|
9
|
+
projectId: process.env.REMOTION_GCP_PROJECT_ID,
|
|
10
|
+
credentials: {
|
|
11
|
+
client_email: process.env.REMOTION_GCP_CLIENT_EMAIL,
|
|
12
|
+
private_key: process.env.REMOTION_GCP_PRIVATE_KEY,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
const listedTags = await client.listTags({
|
|
16
|
+
parent: 'projects/remotion-dev/locations/us/repositories/cloud-run/packages/render',
|
|
17
|
+
});
|
|
18
|
+
for (const tag of listedTags[0]) {
|
|
19
|
+
if (version_1.VERSION === ((_a = tag.name) === null || _a === void 0 ? void 0 : _a.split('/').pop())) {
|
|
20
|
+
// if match is found, exit the function
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
throw new Error(`The tag for Remotion version ${version_1.VERSION} was not found in the Cloud run registry.`);
|
|
25
|
+
};
|
|
26
|
+
exports.validateImageRemotionVersion = validateImageRemotionVersion;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validatePrivacy = void 0;
|
|
4
|
+
function validatePrivacy(privacy) {
|
|
5
|
+
if (typeof privacy !== 'string') {
|
|
6
|
+
throw new TypeError('Privacy must be a string');
|
|
7
|
+
}
|
|
8
|
+
if (privacy !== 'private' && privacy !== 'public') {
|
|
9
|
+
throw new TypeError('Privacy must be either "private" or "public"');
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.validatePrivacy = validatePrivacy;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const validateProjectID: (projectID: unknown) => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateProjectID = void 0;
|
|
4
|
+
const validateProjectID = (projectID) => {
|
|
5
|
+
if (typeof projectID === 'undefined') {
|
|
6
|
+
throw new TypeError(`The 'project-id' argument must be provided, but is missing.`);
|
|
7
|
+
}
|
|
8
|
+
if (typeof projectID !== 'string') {
|
|
9
|
+
throw new TypeError(`The 'project-id' argument must be a string, but is ${JSON.stringify(projectID)}`);
|
|
10
|
+
}
|
|
11
|
+
if (!projectID.match(/^[a-zA-Z][a-zA-Z0-9-]{0,48}[a-zA-Z0-9]$/g)) {
|
|
12
|
+
throw new Error('The `project-id` must match the RegExp `/^[a-zA-Z][a-zA-Z0-9-]{0,48}[a-zA-Z0-9]$/g`. This means it may only start with a letter, end with a letter or number, and contain up to 49 lowercase letters, numbers or hyphens. You passed: ' +
|
|
13
|
+
projectID +
|
|
14
|
+
'. Check for invalid characters.');
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
exports.validateProjectID = validateProjectID;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const validateRegion: (region: unknown) => "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";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateRegion = void 0;
|
|
4
|
+
const gcp_regions_1 = require("../pricing/gcp-regions");
|
|
5
|
+
const validateRegion = (region) => {
|
|
6
|
+
if (typeof region !== 'string') {
|
|
7
|
+
throw new TypeError(`"region" parameter must be a string, but is ${JSON.stringify(region)}`);
|
|
8
|
+
}
|
|
9
|
+
// check region is part of GCP_REGIONS list
|
|
10
|
+
if (!gcp_regions_1.GCP_REGIONS.includes(region)) {
|
|
11
|
+
throw new TypeError(`"region" parameter must be one of ${gcp_regions_1.GCP_REGIONS.join(', ')}, but is ${JSON.stringify(region)}`);
|
|
12
|
+
}
|
|
13
|
+
return region;
|
|
14
|
+
};
|
|
15
|
+
exports.validateRegion = validateRegion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function validateMaxRetries(maxRetries: unknown): asserts maxRetries is number;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateMaxRetries = void 0;
|
|
4
|
+
function validateMaxRetries(maxRetries) {
|
|
5
|
+
if (typeof maxRetries !== 'number') {
|
|
6
|
+
throw new TypeError('maxRetries must be a number, but is ' + JSON.stringify(maxRetries));
|
|
7
|
+
}
|
|
8
|
+
if (!Number.isFinite(maxRetries)) {
|
|
9
|
+
throw new TypeError('maxRetries must be finite, but is ' + maxRetries);
|
|
10
|
+
}
|
|
11
|
+
if (Number.isNaN(maxRetries)) {
|
|
12
|
+
throw new TypeError('maxRetries is NaN');
|
|
13
|
+
}
|
|
14
|
+
if (maxRetries < 0) {
|
|
15
|
+
throw new TypeError(`maxRetries cannot be negative but is ${maxRetries}`);
|
|
16
|
+
}
|
|
17
|
+
if (maxRetries % 1 !== 0) {
|
|
18
|
+
throw new TypeError(`maxRetries should be an integer, but is ${maxRetries}.`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.validateMaxRetries = validateMaxRetries;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const validateServeUrl: (serveUrl: unknown) => Promise<void>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateServeUrl = void 0;
|
|
4
|
+
const get_cloud_storage_client_1 = require("../api/helpers/get-cloud-storage-client");
|
|
5
|
+
const validateServeUrl = async (serveUrl) => {
|
|
6
|
+
if (typeof serveUrl !== 'string') {
|
|
7
|
+
throw new TypeError(`"serveURL" parameter must be a string, but is ${JSON.stringify(serveUrl)}`);
|
|
8
|
+
}
|
|
9
|
+
// if GCP Storage URL, validate that file exists
|
|
10
|
+
if (serveUrl.startsWith('https://storage.googleapis.com')) {
|
|
11
|
+
const cloudStorageClient = (0, get_cloud_storage_client_1.getCloudStorageClient)();
|
|
12
|
+
const bucketName = serveUrl.split('/')[3];
|
|
13
|
+
const fileName = serveUrl.split('/').slice(4).join('/');
|
|
14
|
+
const siteName = serveUrl.split('/')[5];
|
|
15
|
+
const [exists] = await cloudStorageClient
|
|
16
|
+
.bucket(bucketName)
|
|
17
|
+
.file(fileName)
|
|
18
|
+
.exists();
|
|
19
|
+
if (!exists) {
|
|
20
|
+
throw new Error('serveURL ERROR. File "' +
|
|
21
|
+
fileName +
|
|
22
|
+
'" not found in bucket "' +
|
|
23
|
+
bucketName +
|
|
24
|
+
'". Is your site name correct - "' +
|
|
25
|
+
siteName +
|
|
26
|
+
'"?');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.validateServeUrl = validateServeUrl;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const validateServiceName: (serviceName: unknown) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateServiceName = void 0;
|
|
4
|
+
const validateServiceName = (serviceName) => {
|
|
5
|
+
if (typeof serviceName !== 'string') {
|
|
6
|
+
throw new TypeError(`"serviceName" parameter must be a string, but is ${JSON.stringify(serviceName)}`);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
exports.validateServiceName = validateServiceName;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const validateSiteName: (siteName: unknown) => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateSiteName = void 0;
|
|
4
|
+
const validateSiteName = (siteName) => {
|
|
5
|
+
if (typeof siteName === 'undefined') {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
if (typeof siteName !== 'string') {
|
|
9
|
+
throw new TypeError(`The 'projectName' argument must be a string if provided, but is ${JSON.stringify(siteName)}`);
|
|
10
|
+
}
|
|
11
|
+
if (!siteName.match(/([0-9a-zA-Z-!_.*'()]+)/g)) {
|
|
12
|
+
throw new Error("The `siteName` must match the RegExp `/([0-9a-zA-Z-!_.*'()]+)/g`. You passed: " +
|
|
13
|
+
siteName +
|
|
14
|
+
'. Check for invalid characters.');
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
exports.validateSiteName = validateSiteName;
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@remotion/cloudrun",
|
|
3
|
+
"version": "4.1.0-alpha2",
|
|
4
|
+
"description": "GCP Cloud Run alternative to lambda rendering",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@google-cloud/artifact-registry": "^2.2.2",
|
|
8
|
+
"@google-cloud/functions-framework": "^3.1.3",
|
|
9
|
+
"@google-cloud/run": "^0.4.0",
|
|
10
|
+
"@google-cloud/storage": "^6.9.1",
|
|
11
|
+
"@google-cloud/resource-manager": "^4.3.0",
|
|
12
|
+
"google-auth-library": "^8.7.0",
|
|
13
|
+
"zod": "^3.21.4",
|
|
14
|
+
"@remotion/bundler": "4.1.0-alpha2",
|
|
15
|
+
"@remotion/cli": "4.1.0-alpha2",
|
|
16
|
+
"@remotion/renderer": "4.1.0-alpha2",
|
|
17
|
+
"remotion": "4.1.0-alpha2"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@jonny/eslint-config": "3.0.266",
|
|
21
|
+
"@types/node": "^18.11.2",
|
|
22
|
+
"@types/minimist": "1.2.2",
|
|
23
|
+
"eslint": "8.25.0",
|
|
24
|
+
"prettier": "^2.7.1",
|
|
25
|
+
"prettier-plugin-organize-imports": "^3.2.2",
|
|
26
|
+
"ts-node": "^10.8.0",
|
|
27
|
+
"typescript": "4.7.2",
|
|
28
|
+
"vitest": "0.24.3",
|
|
29
|
+
"@remotion/compositor-linux-x64-gnu": "4.1.0-alpha2"
|
|
30
|
+
},
|
|
31
|
+
"exports": {
|
|
32
|
+
"./package.json": "./package.json",
|
|
33
|
+
".": "./dist/index.js",
|
|
34
|
+
"./defaults": "./dist/defaults.js",
|
|
35
|
+
"./regions": "./dist/regions.js",
|
|
36
|
+
"./permissions.json": "./dist/shared/sa-permissions.json"
|
|
37
|
+
},
|
|
38
|
+
"typesVersions": {
|
|
39
|
+
">=1.0": {
|
|
40
|
+
"defaults": [
|
|
41
|
+
"dist/defaults.d.ts"
|
|
42
|
+
],
|
|
43
|
+
"regions": [
|
|
44
|
+
"dist/regions.d.ts"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "tsc -d && cp src/shared/sa-permissions.json dist/shared/sa-permissions.json && pnpm run buildContainer && pnpm run tarInstaller",
|
|
53
|
+
"buildContainer": "ts-node src/admin/bundle-renderLogic.ts",
|
|
54
|
+
"tarInstaller": "ts-node src/admin/bundle-installer.ts",
|
|
55
|
+
"start": "functions-framework --target=TypescriptFunction",
|
|
56
|
+
"watch": "tsc -w",
|
|
57
|
+
"lint": "eslint src --ext ts,tsx"
|
|
58
|
+
}
|
|
59
|
+
}
|