@vercel/build-utils
Advanced tools
| /** | ||
| * Shared utilities for generating internal service paths. | ||
| * | ||
| * These are used by builders (e.g. @vercel/python) to produce cron entries | ||
| * and rewrite routes for service builds. | ||
| */ | ||
| /** | ||
| * Reserved internal namespace used by services routing/runtime plumbing. | ||
| */ | ||
| export declare const INTERNAL_SERVICE_PREFIX = "/_svc"; | ||
| export declare function getInternalServiceFunctionPath(serviceName: string): string; | ||
| export declare function getInternalServiceCronPathPrefix(serviceName: string): string; | ||
| export declare function getInternalServiceCronPath(serviceName: string, entrypoint: string, handler?: string): string; |
| "use strict"; | ||
| var __defProp = Object.defineProperty; | ||
| var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
| var __getOwnPropNames = Object.getOwnPropertyNames; | ||
| var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
| var __export = (target, all) => { | ||
| for (var name in all) | ||
| __defProp(target, name, { get: all[name], enumerable: true }); | ||
| }; | ||
| var __copyProps = (to, from, except, desc) => { | ||
| if (from && typeof from === "object" || typeof from === "function") { | ||
| for (let key of __getOwnPropNames(from)) | ||
| if (!__hasOwnProp.call(to, key) && key !== except) | ||
| __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
| } | ||
| return to; | ||
| }; | ||
| var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
| var service_path_utils_exports = {}; | ||
| __export(service_path_utils_exports, { | ||
| INTERNAL_SERVICE_PREFIX: () => INTERNAL_SERVICE_PREFIX, | ||
| getInternalServiceCronPath: () => getInternalServiceCronPath, | ||
| getInternalServiceCronPathPrefix: () => getInternalServiceCronPathPrefix, | ||
| getInternalServiceFunctionPath: () => getInternalServiceFunctionPath | ||
| }); | ||
| module.exports = __toCommonJS(service_path_utils_exports); | ||
| const INTERNAL_SERVICE_PREFIX = "/_svc"; | ||
| function normalizeInternalServiceEntrypoint(entrypoint) { | ||
| const normalized = entrypoint.replace(/\\/g, "/").replace(/^\/+/, "").replace(/\.[^/.]+$/, ""); | ||
| return normalized || "index"; | ||
| } | ||
| function getInternalServiceFunctionPath(serviceName) { | ||
| return `${INTERNAL_SERVICE_PREFIX}/${serviceName}/index`; | ||
| } | ||
| function getInternalServiceCronPathPrefix(serviceName) { | ||
| return `${INTERNAL_SERVICE_PREFIX}/${serviceName}/crons`; | ||
| } | ||
| function getInternalServiceCronPath(serviceName, entrypoint, handler = "cron") { | ||
| const normalizedEntrypoint = normalizeInternalServiceEntrypoint(entrypoint); | ||
| return `${getInternalServiceCronPathPrefix(serviceName)}/${normalizedEntrypoint}/${handler}`; | ||
| } | ||
| // Annotate the CommonJS export names for ESM import in node: | ||
| 0 && (module.exports = { | ||
| INTERNAL_SERVICE_PREFIX, | ||
| getInternalServiceCronPath, | ||
| getInternalServiceCronPathPrefix, | ||
| getInternalServiceFunctionPath | ||
| }); |
+6
-0
| # @vercel/build-utils | ||
| ## 13.17.0 | ||
| ### Minor Changes | ||
| - Support dynamically specifying crons from a python service ([#15930](https://github.com/vercel/vercel/pull/15930)) | ||
| ## 13.16.0 | ||
@@ -4,0 +10,0 @@ |
+1
-0
@@ -40,2 +40,3 @@ import FileBlob from './file-blob'; | ||
| export * from './node-entrypoint'; | ||
| export * from './service-path-utils'; | ||
| export { getEncryptedEnv, type EncryptedEnvFile, } from './process-serverless/get-encrypted-env-file'; | ||
@@ -42,0 +43,0 @@ export { getLambdaEnvironment } from './process-serverless/get-lambda-environment'; |
+9
-0
@@ -121,2 +121,4 @@ /// <reference types="node" /> | ||
| workspace?: string; | ||
| /** Cron schedule expression (e.g., "0 0 * * *"). Only present for cron services. */ | ||
| schedule?: string; | ||
| }; | ||
@@ -223,2 +225,7 @@ } | ||
| shutdown?: () => Promise<void>; | ||
| /** | ||
| * Cron entries produced by the builder for this service. | ||
| * Used by the dev orchestrator to schedule cron triggers. | ||
| */ | ||
| crons?: Cron[]; | ||
| } | ||
@@ -550,2 +557,3 @@ /** | ||
| deploymentId?: string; | ||
| crons?: Cron[]; | ||
| } | ||
@@ -563,2 +571,3 @@ export type BuildResultVX = { | ||
| output: Lambda | EdgeFunction; | ||
| crons?: Cron[]; | ||
| } | ||
@@ -565,0 +574,0 @@ export type BuildVX = (options: BuildOptions) => Promise<BuildResultVX>; |
+1
-1
| { | ||
| "name": "@vercel/build-utils", | ||
| "version": "13.16.0", | ||
| "version": "13.17.0", | ||
| "license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 11 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 3 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 11 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 3 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1759649
0.25%144
1.41%43163
0.22%