@codemation/core-nodes-ocr 0.2.0

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 (43) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/LICENSE +37 -0
  3. package/README.md +67 -0
  4. package/codemation.plugin.ts +27 -0
  5. package/dist/analyzeInvoiceNode-BIw8j_Zb.cjs +360 -0
  6. package/dist/analyzeInvoiceNode-BIw8j_Zb.cjs.map +1 -0
  7. package/dist/analyzeInvoiceNode-uVwe3GHD.js +321 -0
  8. package/dist/analyzeInvoiceNode-uVwe3GHD.js.map +1 -0
  9. package/dist/chunk-BaqVhFee.cjs +46 -0
  10. package/dist/codemation.plugin.cjs +17891 -0
  11. package/dist/codemation.plugin.cjs.map +1 -0
  12. package/dist/codemation.plugin.d.cts +325 -0
  13. package/dist/codemation.plugin.d.ts +266 -0
  14. package/dist/codemation.plugin.js +17883 -0
  15. package/dist/codemation.plugin.js.map +1 -0
  16. package/dist/index-C2KJPzqN.d.ts +876 -0
  17. package/dist/index-DoHR1J8T.d.ts +880 -0
  18. package/dist/index-OvXJkNm1.d.ts +874 -0
  19. package/dist/index.cjs +8 -0
  20. package/dist/index.d.cts +199 -0
  21. package/dist/index.d.ts +147 -0
  22. package/dist/index.js +3 -0
  23. package/dist/metadata.json +72 -0
  24. package/dist/runtimeTypes-C6YqmQG-.d.cts +762 -0
  25. package/dist/runtimeTypes-ffl603pJ.d.cts +764 -0
  26. package/dist/token-CIu4PqRI.js +58 -0
  27. package/dist/token-CIu4PqRI.js.map +1 -0
  28. package/dist/token-CgF09kyP.cjs +62 -0
  29. package/dist/token-CgF09kyP.cjs.map +1 -0
  30. package/dist/token-util-B2kSJtEV.cjs +458 -0
  31. package/dist/token-util-B2kSJtEV.cjs.map +1 -0
  32. package/dist/token-util-BsR6OYHz.js +5 -0
  33. package/dist/token-util-EUxa8JtH.js +470 -0
  34. package/dist/token-util-EUxa8JtH.js.map +1 -0
  35. package/dist/token-util-Lr5foG4r.cjs +8 -0
  36. package/package.json +70 -0
  37. package/src/credentials/azureContentUnderstandingCredential.ts +76 -0
  38. package/src/index.ts +5 -0
  39. package/src/lib/analyzeWithAzure.ts +130 -0
  40. package/src/lib/readBinaryBody.ts +51 -0
  41. package/src/nodes/analyzeDocumentNode.ts +70 -0
  42. package/src/nodes/analyzeImageNode.ts +70 -0
  43. package/src/nodes/analyzeInvoiceNode.ts +61 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-util-B2kSJtEV.cjs","names":["__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__export","__copyProps","__toCommonJS","__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__export","__copyProps","__toCommonJS","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__export","__copyProps","__toESM","__toCommonJS","import_os","import_token_error","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__export","__copyProps","__toESM","__toCommonJS","fs","path","__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__export","__copyProps","__toCommonJS"],"sources":["../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-error.js","../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/auth-errors.js","../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-io.js","../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/auth-config.js","../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/oauth.js","../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-util.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_error_exports = {};\n__export(token_error_exports, {\n VercelOidcTokenError: () => VercelOidcTokenError\n});\nmodule.exports = __toCommonJS(token_error_exports);\nclass VercelOidcTokenError extends Error {\n constructor(message, cause) {\n super(message);\n this.name = \"VercelOidcTokenError\";\n this.cause = cause;\n }\n toString() {\n if (this.cause) {\n return `${this.name}: ${this.message}: ${this.cause}`;\n }\n return `${this.name}: ${this.message}`;\n }\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n VercelOidcTokenError\n});\n","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar auth_errors_exports = {};\n__export(auth_errors_exports, {\n AccessTokenMissingError: () => AccessTokenMissingError,\n RefreshAccessTokenFailedError: () => RefreshAccessTokenFailedError\n});\nmodule.exports = __toCommonJS(auth_errors_exports);\nclass AccessTokenMissingError extends Error {\n constructor() {\n super(\n \"No authentication found. Please log in with the Vercel CLI (vercel login).\"\n );\n this.name = \"AccessTokenMissingError\";\n }\n}\nclass RefreshAccessTokenFailedError extends Error {\n constructor(cause) {\n super(\"Failed to refresh authentication token.\", { cause });\n this.name = \"RefreshAccessTokenFailedError\";\n }\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n AccessTokenMissingError,\n RefreshAccessTokenFailedError\n});\n","\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_io_exports = {};\n__export(token_io_exports, {\n findRootDir: () => findRootDir,\n getUserDataDir: () => getUserDataDir\n});\nmodule.exports = __toCommonJS(token_io_exports);\nvar import_path = __toESM(require(\"path\"));\nvar import_fs = __toESM(require(\"fs\"));\nvar import_os = __toESM(require(\"os\"));\nvar import_token_error = require(\"./token-error\");\nfunction findRootDir() {\n try {\n let dir = process.cwd();\n while (dir !== import_path.default.dirname(dir)) {\n const pkgPath = import_path.default.join(dir, \".vercel\");\n if (import_fs.default.existsSync(pkgPath)) {\n return dir;\n }\n dir = import_path.default.dirname(dir);\n }\n } catch (e) {\n throw new import_token_error.VercelOidcTokenError(\n \"Token refresh only supported in node server environments\"\n );\n }\n return null;\n}\nfunction getUserDataDir() {\n if (process.env.XDG_DATA_HOME) {\n return process.env.XDG_DATA_HOME;\n }\n switch (import_os.default.platform()) {\n case \"darwin\":\n return import_path.default.join(import_os.default.homedir(), \"Library/Application Support\");\n case \"linux\":\n return import_path.default.join(import_os.default.homedir(), \".local/share\");\n case \"win32\":\n if (process.env.LOCALAPPDATA) {\n return process.env.LOCALAPPDATA;\n }\n return null;\n default:\n return null;\n }\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n findRootDir,\n getUserDataDir\n});\n","\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar auth_config_exports = {};\n__export(auth_config_exports, {\n isValidAccessToken: () => isValidAccessToken,\n readAuthConfig: () => readAuthConfig,\n writeAuthConfig: () => writeAuthConfig\n});\nmodule.exports = __toCommonJS(auth_config_exports);\nvar fs = __toESM(require(\"fs\"));\nvar path = __toESM(require(\"path\"));\nvar import_token_util = require(\"./token-util\");\nfunction getAuthConfigPath() {\n const dataDir = (0, import_token_util.getVercelDataDir)();\n if (!dataDir) {\n throw new Error(\n `Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`\n );\n }\n return path.join(dataDir, \"auth.json\");\n}\nfunction readAuthConfig() {\n try {\n const authPath = getAuthConfigPath();\n if (!fs.existsSync(authPath)) {\n return null;\n }\n const content = fs.readFileSync(authPath, \"utf8\");\n if (!content) {\n return null;\n }\n return JSON.parse(content);\n } catch (error) {\n return null;\n }\n}\nfunction writeAuthConfig(config) {\n const authPath = getAuthConfigPath();\n const authDir = path.dirname(authPath);\n if (!fs.existsSync(authDir)) {\n fs.mkdirSync(authDir, { mode: 504, recursive: true });\n }\n fs.writeFileSync(authPath, JSON.stringify(config, null, 2), { mode: 384 });\n}\nfunction isValidAccessToken(authConfig, expirationBufferMs = 0) {\n if (!authConfig.token)\n return false;\n if (typeof authConfig.expiresAt !== \"number\")\n return true;\n const nowInSeconds = Math.floor(Date.now() / 1e3);\n const bufferInSeconds = expirationBufferMs / 1e3;\n return authConfig.expiresAt >= nowInSeconds + bufferInSeconds;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n isValidAccessToken,\n readAuthConfig,\n writeAuthConfig\n});\n","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar oauth_exports = {};\n__export(oauth_exports, {\n processTokenResponse: () => processTokenResponse,\n refreshTokenRequest: () => refreshTokenRequest\n});\nmodule.exports = __toCommonJS(oauth_exports);\nvar import_os = require(\"os\");\nconst VERCEL_ISSUER = \"https://vercel.com\";\nconst VERCEL_CLI_CLIENT_ID = \"cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp\";\nconst userAgent = `@vercel/oidc node-${process.version} ${(0, import_os.platform)()} (${(0, import_os.arch)()}) ${(0, import_os.hostname)()}`;\nlet _tokenEndpoint = null;\nasync function getTokenEndpoint() {\n if (_tokenEndpoint) {\n return _tokenEndpoint;\n }\n const discoveryUrl = `${VERCEL_ISSUER}/.well-known/openid-configuration`;\n const response = await fetch(discoveryUrl, {\n headers: { \"user-agent\": userAgent }\n });\n if (!response.ok) {\n throw new Error(\"Failed to discover OAuth endpoints\");\n }\n const metadata = await response.json();\n if (!metadata || typeof metadata.token_endpoint !== \"string\") {\n throw new Error(\"Invalid OAuth discovery response\");\n }\n const endpoint = metadata.token_endpoint;\n _tokenEndpoint = endpoint;\n return endpoint;\n}\nasync function refreshTokenRequest(options) {\n const tokenEndpoint = await getTokenEndpoint();\n return await fetch(tokenEndpoint, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n \"user-agent\": userAgent\n },\n body: new URLSearchParams({\n client_id: VERCEL_CLI_CLIENT_ID,\n grant_type: \"refresh_token\",\n ...options\n })\n });\n}\nasync function processTokenResponse(response) {\n const json = await response.json();\n if (!response.ok) {\n const errorMsg = typeof json === \"object\" && json && \"error\" in json ? String(json.error) : \"Token refresh failed\";\n return [new Error(errorMsg)];\n }\n if (typeof json !== \"object\" || json === null) {\n return [new Error(\"Invalid token response\")];\n }\n if (typeof json.access_token !== \"string\") {\n return [new Error(\"Missing access_token in response\")];\n }\n if (json.token_type !== \"Bearer\") {\n return [new Error(\"Invalid token_type in response\")];\n }\n if (typeof json.expires_in !== \"number\") {\n return [new Error(\"Missing expires_in in response\")];\n }\n return [null, json];\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n processTokenResponse,\n refreshTokenRequest\n});\n","\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_util_exports = {};\n__export(token_util_exports, {\n assertVercelOidcTokenResponse: () => assertVercelOidcTokenResponse,\n findProjectInfo: () => findProjectInfo,\n getTokenPayload: () => getTokenPayload,\n getVercelDataDir: () => getVercelDataDir,\n getVercelOidcToken: () => getVercelOidcToken,\n getVercelToken: () => getVercelToken,\n isExpired: () => isExpired,\n loadToken: () => loadToken,\n saveToken: () => saveToken\n});\nmodule.exports = __toCommonJS(token_util_exports);\nvar path = __toESM(require(\"path\"));\nvar fs = __toESM(require(\"fs\"));\nvar import_token_error = require(\"./token-error\");\nvar import_token_io = require(\"./token-io\");\nvar import_auth_config = require(\"./auth-config\");\nvar import_oauth = require(\"./oauth\");\nvar import_auth_errors = require(\"./auth-errors\");\nfunction getVercelDataDir() {\n const vercelFolder = \"com.vercel.cli\";\n const dataDir = (0, import_token_io.getUserDataDir)();\n if (!dataDir) {\n return null;\n }\n return path.join(dataDir, vercelFolder);\n}\nasync function getVercelToken(options) {\n const authConfig = (0, import_auth_config.readAuthConfig)();\n if (!authConfig?.token) {\n throw new import_auth_errors.AccessTokenMissingError();\n }\n if ((0, import_auth_config.isValidAccessToken)(authConfig, options?.expirationBufferMs)) {\n return authConfig.token;\n }\n if (!authConfig.refreshToken) {\n (0, import_auth_config.writeAuthConfig)({});\n throw new import_auth_errors.RefreshAccessTokenFailedError(\"No refresh token available\");\n }\n try {\n const tokenResponse = await (0, import_oauth.refreshTokenRequest)({\n refresh_token: authConfig.refreshToken\n });\n const [tokensError, tokens] = await (0, import_oauth.processTokenResponse)(tokenResponse);\n if (tokensError || !tokens) {\n (0, import_auth_config.writeAuthConfig)({});\n throw new import_auth_errors.RefreshAccessTokenFailedError(tokensError);\n }\n const updatedConfig = {\n token: tokens.access_token,\n expiresAt: Math.floor(Date.now() / 1e3) + tokens.expires_in\n };\n if (tokens.refresh_token) {\n updatedConfig.refreshToken = tokens.refresh_token;\n }\n (0, import_auth_config.writeAuthConfig)(updatedConfig);\n return updatedConfig.token;\n } catch (error) {\n (0, import_auth_config.writeAuthConfig)({});\n if (error instanceof import_auth_errors.AccessTokenMissingError || error instanceof import_auth_errors.RefreshAccessTokenFailedError) {\n throw error;\n }\n throw new import_auth_errors.RefreshAccessTokenFailedError(error);\n }\n}\nasync function getVercelOidcToken(authToken, projectId, teamId) {\n const url = `https://api.vercel.com/v1/projects/${projectId}/token?source=vercel-oidc-refresh${teamId ? `&teamId=${teamId}` : \"\"}`;\n const res = await fetch(url, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${authToken}`\n }\n });\n if (!res.ok) {\n throw new import_token_error.VercelOidcTokenError(\n `Failed to refresh OIDC token: ${res.statusText}`\n );\n }\n const tokenRes = await res.json();\n assertVercelOidcTokenResponse(tokenRes);\n return tokenRes;\n}\nfunction assertVercelOidcTokenResponse(res) {\n if (!res || typeof res !== \"object\") {\n throw new TypeError(\n \"Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again\"\n );\n }\n if (!(\"token\" in res) || typeof res.token !== \"string\") {\n throw new TypeError(\n \"Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again\"\n );\n }\n}\nfunction findProjectInfo() {\n const dir = (0, import_token_io.findRootDir)();\n if (!dir) {\n throw new import_token_error.VercelOidcTokenError(\n \"Unable to find project root directory. Have you linked your project with `vc link?`\"\n );\n }\n const prjPath = path.join(dir, \".vercel\", \"project.json\");\n if (!fs.existsSync(prjPath)) {\n throw new import_token_error.VercelOidcTokenError(\n \"project.json not found, have you linked your project with `vc link?`\"\n );\n }\n const prj = JSON.parse(fs.readFileSync(prjPath, \"utf8\"));\n if (typeof prj.projectId !== \"string\" && typeof prj.orgId !== \"string\") {\n throw new TypeError(\n \"Expected a string-valued projectId property. Try running `vc link` to re-link your project.\"\n );\n }\n return { projectId: prj.projectId, teamId: prj.orgId };\n}\nfunction saveToken(token, projectId) {\n const dir = (0, import_token_io.getUserDataDir)();\n if (!dir) {\n throw new import_token_error.VercelOidcTokenError(\n \"Unable to find user data directory. Please reach out to Vercel support.\"\n );\n }\n const tokenPath = path.join(dir, \"com.vercel.token\", `${projectId}.json`);\n const tokenJson = JSON.stringify(token);\n fs.mkdirSync(path.dirname(tokenPath), { mode: 504, recursive: true });\n fs.writeFileSync(tokenPath, tokenJson);\n fs.chmodSync(tokenPath, 432);\n return;\n}\nfunction loadToken(projectId) {\n const dir = (0, import_token_io.getUserDataDir)();\n if (!dir) {\n throw new import_token_error.VercelOidcTokenError(\n \"Unable to find user data directory. Please reach out to Vercel support.\"\n );\n }\n const tokenPath = path.join(dir, \"com.vercel.token\", `${projectId}.json`);\n if (!fs.existsSync(tokenPath)) {\n return null;\n }\n const token = JSON.parse(fs.readFileSync(tokenPath, \"utf8\"));\n assertVercelOidcTokenResponse(token);\n return token;\n}\nfunction getTokenPayload(token) {\n const tokenParts = token.split(\".\");\n if (tokenParts.length !== 3) {\n throw new import_token_error.VercelOidcTokenError(\n \"Invalid token. Please run `vc env pull` and try again\"\n );\n }\n const base64 = tokenParts[1].replace(/-/g, \"+\").replace(/_/g, \"/\");\n const padded = base64.padEnd(\n base64.length + (4 - base64.length % 4) % 4,\n \"=\"\n );\n return JSON.parse(Buffer.from(padded, \"base64\").toString(\"utf8\"));\n}\nfunction isExpired(token, bufferMs = 0) {\n return token.exp * 1e3 < Date.now() + bufferMs;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n assertVercelOidcTokenResponse,\n findProjectInfo,\n getTokenPayload,\n getVercelDataDir,\n getVercelOidcToken,\n getVercelToken,\n isExpired,\n loadToken,\n saveToken\n});\n"],"x_google_ignoreList":[0,1,2,3,4,5],"mappings":";;;;CACA,IAAIA,cAAY,OAAO;CACvB,IAAIC,qBAAmB,OAAO;CAC9B,IAAIC,sBAAoB,OAAO;CAC/B,IAAIC,iBAAe,OAAO,UAAU;CACpC,IAAIC,cAAY,QAAQ,QAAQ;AAC9B,OAAK,IAAI,QAAQ,IACf,aAAU,QAAQ,MAAM;GAAE,KAAK,IAAI;GAAO,YAAY;GAA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SAAS,OAAO,CAAC;;CAEnE,SAAS,UAAU,OAAO,WAAW,GAAG;AACtC,SAAO,MAAM,MAAM,MAAM,KAAK,KAAK,GAAG"}
@@ -0,0 +1,5 @@
1
+ import { t as require_token_util } from "./token-util-EUxa8JtH.js";
2
+
3
+ export default require_token_util();
4
+
5
+ export { };
@@ -0,0 +1,470 @@
1
+ import { createRequire } from "node:module";
2
+
3
+ //#region rolldown:runtime
4
+ var __create$3 = Object.create;
5
+ var __defProp$6 = Object.defineProperty;
6
+ var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames$6 = Object.getOwnPropertyNames;
8
+ var __getProtoOf$3 = Object.getPrototypeOf;
9
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
10
+ var __commonJS = (cb, mod) => function() {
11
+ return mod || (0, cb[__getOwnPropNames$6(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
+ };
13
+ var __copyProps$6 = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames$6(from), i = 0, n = keys.length, key; i < n; i++) {
15
+ key = keys[i];
16
+ if (!__hasOwnProp$6.call(to, key) && key !== except) __defProp$6(to, key, {
17
+ get: ((k) => from[k]).bind(null, key),
18
+ enumerable: !(desc = __getOwnPropDesc$6(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM$3 = (mod, isNodeMode, target) => (target = mod != null ? __create$3(__getProtoOf$3(mod)) : {}, __copyProps$6(isNodeMode || !mod || !mod.__esModule ? __defProp$6(target, "default", {
24
+ value: mod,
25
+ enumerable: true
26
+ }) : target, mod));
27
+ var __toCommonJS$6 = (mod) => __copyProps$6(__defProp$6({}, "__esModule", { value: true }), mod);
28
+ var __toDynamicImportESM = (isNodeMode) => (mod) => __toESM$3(mod.default, isNodeMode);
29
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
30
+
31
+ //#endregion
32
+ //#region ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-error.js
33
+ var require_token_error = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-error.js": ((exports, module) => {
34
+ var __defProp$5 = Object.defineProperty;
35
+ var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
36
+ var __getOwnPropNames$5 = Object.getOwnPropertyNames;
37
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
38
+ var __export$5 = (target, all) => {
39
+ for (var name in all) __defProp$5(target, name, {
40
+ get: all[name],
41
+ enumerable: true
42
+ });
43
+ };
44
+ var __copyProps$5 = (to, from, except, desc) => {
45
+ if (from && typeof from === "object" || typeof from === "function") {
46
+ for (let key of __getOwnPropNames$5(from)) if (!__hasOwnProp$5.call(to, key) && key !== except) __defProp$5(to, key, {
47
+ get: () => from[key],
48
+ enumerable: !(desc = __getOwnPropDesc$5(from, key)) || desc.enumerable
49
+ });
50
+ }
51
+ return to;
52
+ };
53
+ var __toCommonJS$5 = (mod) => __copyProps$5(__defProp$5({}, "__esModule", { value: true }), mod);
54
+ var token_error_exports = {};
55
+ __export$5(token_error_exports, { VercelOidcTokenError: () => VercelOidcTokenError });
56
+ module.exports = __toCommonJS$5(token_error_exports);
57
+ var VercelOidcTokenError = class extends Error {
58
+ constructor(message, cause) {
59
+ super(message);
60
+ this.name = "VercelOidcTokenError";
61
+ this.cause = cause;
62
+ }
63
+ toString() {
64
+ if (this.cause) return `${this.name}: ${this.message}: ${this.cause}`;
65
+ return `${this.name}: ${this.message}`;
66
+ }
67
+ };
68
+ }) });
69
+
70
+ //#endregion
71
+ //#region ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/auth-errors.js
72
+ var require_auth_errors = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/auth-errors.js": ((exports, module) => {
73
+ var __defProp$4 = Object.defineProperty;
74
+ var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
75
+ var __getOwnPropNames$4 = Object.getOwnPropertyNames;
76
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
77
+ var __export$4 = (target, all) => {
78
+ for (var name in all) __defProp$4(target, name, {
79
+ get: all[name],
80
+ enumerable: true
81
+ });
82
+ };
83
+ var __copyProps$4 = (to, from, except, desc) => {
84
+ if (from && typeof from === "object" || typeof from === "function") {
85
+ for (let key of __getOwnPropNames$4(from)) if (!__hasOwnProp$4.call(to, key) && key !== except) __defProp$4(to, key, {
86
+ get: () => from[key],
87
+ enumerable: !(desc = __getOwnPropDesc$4(from, key)) || desc.enumerable
88
+ });
89
+ }
90
+ return to;
91
+ };
92
+ var __toCommonJS$4 = (mod) => __copyProps$4(__defProp$4({}, "__esModule", { value: true }), mod);
93
+ var auth_errors_exports = {};
94
+ __export$4(auth_errors_exports, {
95
+ AccessTokenMissingError: () => AccessTokenMissingError,
96
+ RefreshAccessTokenFailedError: () => RefreshAccessTokenFailedError
97
+ });
98
+ module.exports = __toCommonJS$4(auth_errors_exports);
99
+ var AccessTokenMissingError = class extends Error {
100
+ constructor() {
101
+ super("No authentication found. Please log in with the Vercel CLI (vercel login).");
102
+ this.name = "AccessTokenMissingError";
103
+ }
104
+ };
105
+ var RefreshAccessTokenFailedError = class extends Error {
106
+ constructor(cause) {
107
+ super("Failed to refresh authentication token.", { cause });
108
+ this.name = "RefreshAccessTokenFailedError";
109
+ }
110
+ };
111
+ }) });
112
+
113
+ //#endregion
114
+ //#region ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-io.js
115
+ var require_token_io = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-io.js": ((exports, module) => {
116
+ var __create$2 = Object.create;
117
+ var __defProp$3 = Object.defineProperty;
118
+ var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
119
+ var __getOwnPropNames$3 = Object.getOwnPropertyNames;
120
+ var __getProtoOf$2 = Object.getPrototypeOf;
121
+ var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
122
+ var __export$3 = (target, all) => {
123
+ for (var name in all) __defProp$3(target, name, {
124
+ get: all[name],
125
+ enumerable: true
126
+ });
127
+ };
128
+ var __copyProps$3 = (to, from, except, desc) => {
129
+ if (from && typeof from === "object" || typeof from === "function") {
130
+ for (let key of __getOwnPropNames$3(from)) if (!__hasOwnProp$3.call(to, key) && key !== except) __defProp$3(to, key, {
131
+ get: () => from[key],
132
+ enumerable: !(desc = __getOwnPropDesc$3(from, key)) || desc.enumerable
133
+ });
134
+ }
135
+ return to;
136
+ };
137
+ var __toESM$2 = (mod, isNodeMode, target) => (target = mod != null ? __create$2(__getProtoOf$2(mod)) : {}, __copyProps$3(isNodeMode || !mod || !mod.__esModule ? __defProp$3(target, "default", {
138
+ value: mod,
139
+ enumerable: true
140
+ }) : target, mod));
141
+ var __toCommonJS$3 = (mod) => __copyProps$3(__defProp$3({}, "__esModule", { value: true }), mod);
142
+ var token_io_exports = {};
143
+ __export$3(token_io_exports, {
144
+ findRootDir: () => findRootDir,
145
+ getUserDataDir: () => getUserDataDir
146
+ });
147
+ module.exports = __toCommonJS$3(token_io_exports);
148
+ var import_path = __toESM$2(__require("path"));
149
+ var import_fs = __toESM$2(__require("fs"));
150
+ var import_os$1 = __toESM$2(__require("os"));
151
+ var import_token_error$1 = require_token_error();
152
+ function findRootDir() {
153
+ try {
154
+ let dir = process.cwd();
155
+ while (dir !== import_path.default.dirname(dir)) {
156
+ const pkgPath = import_path.default.join(dir, ".vercel");
157
+ if (import_fs.default.existsSync(pkgPath)) return dir;
158
+ dir = import_path.default.dirname(dir);
159
+ }
160
+ } catch (e) {
161
+ throw new import_token_error$1.VercelOidcTokenError("Token refresh only supported in node server environments");
162
+ }
163
+ return null;
164
+ }
165
+ function getUserDataDir() {
166
+ if (process.env.XDG_DATA_HOME) return process.env.XDG_DATA_HOME;
167
+ switch (import_os$1.default.platform()) {
168
+ case "darwin": return import_path.default.join(import_os$1.default.homedir(), "Library/Application Support");
169
+ case "linux": return import_path.default.join(import_os$1.default.homedir(), ".local/share");
170
+ case "win32":
171
+ if (process.env.LOCALAPPDATA) return process.env.LOCALAPPDATA;
172
+ return null;
173
+ default: return null;
174
+ }
175
+ }
176
+ }) });
177
+
178
+ //#endregion
179
+ //#region ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/auth-config.js
180
+ var require_auth_config = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/auth-config.js": ((exports, module) => {
181
+ var __create$1 = Object.create;
182
+ var __defProp$2 = Object.defineProperty;
183
+ var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
184
+ var __getOwnPropNames$2 = Object.getOwnPropertyNames;
185
+ var __getProtoOf$1 = Object.getPrototypeOf;
186
+ var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
187
+ var __export$2 = (target, all) => {
188
+ for (var name in all) __defProp$2(target, name, {
189
+ get: all[name],
190
+ enumerable: true
191
+ });
192
+ };
193
+ var __copyProps$2 = (to, from, except, desc) => {
194
+ if (from && typeof from === "object" || typeof from === "function") {
195
+ for (let key of __getOwnPropNames$2(from)) if (!__hasOwnProp$2.call(to, key) && key !== except) __defProp$2(to, key, {
196
+ get: () => from[key],
197
+ enumerable: !(desc = __getOwnPropDesc$2(from, key)) || desc.enumerable
198
+ });
199
+ }
200
+ return to;
201
+ };
202
+ var __toESM$1 = (mod, isNodeMode, target) => (target = mod != null ? __create$1(__getProtoOf$1(mod)) : {}, __copyProps$2(isNodeMode || !mod || !mod.__esModule ? __defProp$2(target, "default", {
203
+ value: mod,
204
+ enumerable: true
205
+ }) : target, mod));
206
+ var __toCommonJS$2 = (mod) => __copyProps$2(__defProp$2({}, "__esModule", { value: true }), mod);
207
+ var auth_config_exports = {};
208
+ __export$2(auth_config_exports, {
209
+ isValidAccessToken: () => isValidAccessToken,
210
+ readAuthConfig: () => readAuthConfig,
211
+ writeAuthConfig: () => writeAuthConfig
212
+ });
213
+ module.exports = __toCommonJS$2(auth_config_exports);
214
+ var fs$1 = __toESM$1(__require("fs"));
215
+ var path$1 = __toESM$1(__require("path"));
216
+ var import_token_util = require_token_util();
217
+ function getAuthConfigPath() {
218
+ const dataDir = (0, import_token_util.getVercelDataDir)();
219
+ if (!dataDir) throw new Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`);
220
+ return path$1.join(dataDir, "auth.json");
221
+ }
222
+ function readAuthConfig() {
223
+ try {
224
+ const authPath = getAuthConfigPath();
225
+ if (!fs$1.existsSync(authPath)) return null;
226
+ const content = fs$1.readFileSync(authPath, "utf8");
227
+ if (!content) return null;
228
+ return JSON.parse(content);
229
+ } catch (error) {
230
+ return null;
231
+ }
232
+ }
233
+ function writeAuthConfig(config) {
234
+ const authPath = getAuthConfigPath();
235
+ const authDir = path$1.dirname(authPath);
236
+ if (!fs$1.existsSync(authDir)) fs$1.mkdirSync(authDir, {
237
+ mode: 504,
238
+ recursive: true
239
+ });
240
+ fs$1.writeFileSync(authPath, JSON.stringify(config, null, 2), { mode: 384 });
241
+ }
242
+ function isValidAccessToken(authConfig, expirationBufferMs = 0) {
243
+ if (!authConfig.token) return false;
244
+ if (typeof authConfig.expiresAt !== "number") return true;
245
+ const nowInSeconds = Math.floor(Date.now() / 1e3);
246
+ const bufferInSeconds = expirationBufferMs / 1e3;
247
+ return authConfig.expiresAt >= nowInSeconds + bufferInSeconds;
248
+ }
249
+ }) });
250
+
251
+ //#endregion
252
+ //#region ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/oauth.js
253
+ var require_oauth = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/oauth.js": ((exports, module) => {
254
+ var __defProp$1 = Object.defineProperty;
255
+ var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
256
+ var __getOwnPropNames$1 = Object.getOwnPropertyNames;
257
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
258
+ var __export$1 = (target, all) => {
259
+ for (var name in all) __defProp$1(target, name, {
260
+ get: all[name],
261
+ enumerable: true
262
+ });
263
+ };
264
+ var __copyProps$1 = (to, from, except, desc) => {
265
+ if (from && typeof from === "object" || typeof from === "function") {
266
+ for (let key of __getOwnPropNames$1(from)) if (!__hasOwnProp$1.call(to, key) && key !== except) __defProp$1(to, key, {
267
+ get: () => from[key],
268
+ enumerable: !(desc = __getOwnPropDesc$1(from, key)) || desc.enumerable
269
+ });
270
+ }
271
+ return to;
272
+ };
273
+ var __toCommonJS$1 = (mod) => __copyProps$1(__defProp$1({}, "__esModule", { value: true }), mod);
274
+ var oauth_exports = {};
275
+ __export$1(oauth_exports, {
276
+ processTokenResponse: () => processTokenResponse,
277
+ refreshTokenRequest: () => refreshTokenRequest
278
+ });
279
+ module.exports = __toCommonJS$1(oauth_exports);
280
+ var import_os = __require("os");
281
+ const VERCEL_ISSUER = "https://vercel.com";
282
+ const VERCEL_CLI_CLIENT_ID = "cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp";
283
+ const userAgent = `@vercel/oidc node-${process.version} ${(0, import_os.platform)()} (${(0, import_os.arch)()}) ${(0, import_os.hostname)()}`;
284
+ let _tokenEndpoint = null;
285
+ async function getTokenEndpoint() {
286
+ if (_tokenEndpoint) return _tokenEndpoint;
287
+ const discoveryUrl = `${VERCEL_ISSUER}/.well-known/openid-configuration`;
288
+ const response = await fetch(discoveryUrl, { headers: { "user-agent": userAgent } });
289
+ if (!response.ok) throw new Error("Failed to discover OAuth endpoints");
290
+ const metadata = await response.json();
291
+ if (!metadata || typeof metadata.token_endpoint !== "string") throw new Error("Invalid OAuth discovery response");
292
+ const endpoint = metadata.token_endpoint;
293
+ _tokenEndpoint = endpoint;
294
+ return endpoint;
295
+ }
296
+ async function refreshTokenRequest(options) {
297
+ const tokenEndpoint = await getTokenEndpoint();
298
+ return await fetch(tokenEndpoint, {
299
+ method: "POST",
300
+ headers: {
301
+ "Content-Type": "application/x-www-form-urlencoded",
302
+ "user-agent": userAgent
303
+ },
304
+ body: new URLSearchParams({
305
+ client_id: VERCEL_CLI_CLIENT_ID,
306
+ grant_type: "refresh_token",
307
+ ...options
308
+ })
309
+ });
310
+ }
311
+ async function processTokenResponse(response) {
312
+ const json = await response.json();
313
+ if (!response.ok) {
314
+ const errorMsg = typeof json === "object" && json && "error" in json ? String(json.error) : "Token refresh failed";
315
+ return [new Error(errorMsg)];
316
+ }
317
+ if (typeof json !== "object" || json === null) return [/* @__PURE__ */ new Error("Invalid token response")];
318
+ if (typeof json.access_token !== "string") return [/* @__PURE__ */ new Error("Missing access_token in response")];
319
+ if (json.token_type !== "Bearer") return [/* @__PURE__ */ new Error("Invalid token_type in response")];
320
+ if (typeof json.expires_in !== "number") return [/* @__PURE__ */ new Error("Missing expires_in in response")];
321
+ return [null, json];
322
+ }
323
+ }) });
324
+
325
+ //#endregion
326
+ //#region ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-util.js
327
+ var require_token_util = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-util.js": ((exports, module) => {
328
+ var __create = Object.create;
329
+ var __defProp = Object.defineProperty;
330
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
331
+ var __getOwnPropNames = Object.getOwnPropertyNames;
332
+ var __getProtoOf = Object.getPrototypeOf;
333
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
334
+ var __export = (target, all) => {
335
+ for (var name in all) __defProp(target, name, {
336
+ get: all[name],
337
+ enumerable: true
338
+ });
339
+ };
340
+ var __copyProps = (to, from, except, desc) => {
341
+ if (from && typeof from === "object" || typeof from === "function") {
342
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
343
+ get: () => from[key],
344
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
345
+ });
346
+ }
347
+ return to;
348
+ };
349
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
350
+ value: mod,
351
+ enumerable: true
352
+ }) : target, mod));
353
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
354
+ var token_util_exports = {};
355
+ __export(token_util_exports, {
356
+ assertVercelOidcTokenResponse: () => assertVercelOidcTokenResponse,
357
+ findProjectInfo: () => findProjectInfo,
358
+ getTokenPayload: () => getTokenPayload,
359
+ getVercelDataDir: () => getVercelDataDir,
360
+ getVercelOidcToken: () => getVercelOidcToken,
361
+ getVercelToken: () => getVercelToken,
362
+ isExpired: () => isExpired,
363
+ loadToken: () => loadToken,
364
+ saveToken: () => saveToken
365
+ });
366
+ module.exports = __toCommonJS(token_util_exports);
367
+ var path = __toESM(__require("path"));
368
+ var fs = __toESM(__require("fs"));
369
+ var import_token_error = require_token_error();
370
+ var import_token_io = require_token_io();
371
+ var import_auth_config = require_auth_config();
372
+ var import_oauth = require_oauth();
373
+ var import_auth_errors = require_auth_errors();
374
+ function getVercelDataDir() {
375
+ const vercelFolder = "com.vercel.cli";
376
+ const dataDir = (0, import_token_io.getUserDataDir)();
377
+ if (!dataDir) return null;
378
+ return path.join(dataDir, vercelFolder);
379
+ }
380
+ async function getVercelToken(options) {
381
+ const authConfig = (0, import_auth_config.readAuthConfig)();
382
+ if (!authConfig?.token) throw new import_auth_errors.AccessTokenMissingError();
383
+ if ((0, import_auth_config.isValidAccessToken)(authConfig, options?.expirationBufferMs)) return authConfig.token;
384
+ if (!authConfig.refreshToken) {
385
+ (0, import_auth_config.writeAuthConfig)({});
386
+ throw new import_auth_errors.RefreshAccessTokenFailedError("No refresh token available");
387
+ }
388
+ try {
389
+ const tokenResponse = await (0, import_oauth.refreshTokenRequest)({ refresh_token: authConfig.refreshToken });
390
+ const [tokensError, tokens] = await (0, import_oauth.processTokenResponse)(tokenResponse);
391
+ if (tokensError || !tokens) {
392
+ (0, import_auth_config.writeAuthConfig)({});
393
+ throw new import_auth_errors.RefreshAccessTokenFailedError(tokensError);
394
+ }
395
+ const updatedConfig = {
396
+ token: tokens.access_token,
397
+ expiresAt: Math.floor(Date.now() / 1e3) + tokens.expires_in
398
+ };
399
+ if (tokens.refresh_token) updatedConfig.refreshToken = tokens.refresh_token;
400
+ (0, import_auth_config.writeAuthConfig)(updatedConfig);
401
+ return updatedConfig.token;
402
+ } catch (error) {
403
+ (0, import_auth_config.writeAuthConfig)({});
404
+ if (error instanceof import_auth_errors.AccessTokenMissingError || error instanceof import_auth_errors.RefreshAccessTokenFailedError) throw error;
405
+ throw new import_auth_errors.RefreshAccessTokenFailedError(error);
406
+ }
407
+ }
408
+ async function getVercelOidcToken(authToken, projectId, teamId) {
409
+ const url = `https://api.vercel.com/v1/projects/${projectId}/token?source=vercel-oidc-refresh${teamId ? `&teamId=${teamId}` : ""}`;
410
+ const res = await fetch(url, {
411
+ method: "POST",
412
+ headers: { Authorization: `Bearer ${authToken}` }
413
+ });
414
+ if (!res.ok) throw new import_token_error.VercelOidcTokenError(`Failed to refresh OIDC token: ${res.statusText}`);
415
+ const tokenRes = await res.json();
416
+ assertVercelOidcTokenResponse(tokenRes);
417
+ return tokenRes;
418
+ }
419
+ function assertVercelOidcTokenResponse(res) {
420
+ if (!res || typeof res !== "object") throw new TypeError("Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again");
421
+ if (!("token" in res) || typeof res.token !== "string") throw new TypeError("Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again");
422
+ }
423
+ function findProjectInfo() {
424
+ const dir = (0, import_token_io.findRootDir)();
425
+ if (!dir) throw new import_token_error.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`");
426
+ const prjPath = path.join(dir, ".vercel", "project.json");
427
+ if (!fs.existsSync(prjPath)) throw new import_token_error.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`");
428
+ const prj = JSON.parse(fs.readFileSync(prjPath, "utf8"));
429
+ if (typeof prj.projectId !== "string" && typeof prj.orgId !== "string") throw new TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project.");
430
+ return {
431
+ projectId: prj.projectId,
432
+ teamId: prj.orgId
433
+ };
434
+ }
435
+ function saveToken(token, projectId) {
436
+ const dir = (0, import_token_io.getUserDataDir)();
437
+ if (!dir) throw new import_token_error.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");
438
+ const tokenPath = path.join(dir, "com.vercel.token", `${projectId}.json`);
439
+ const tokenJson = JSON.stringify(token);
440
+ fs.mkdirSync(path.dirname(tokenPath), {
441
+ mode: 504,
442
+ recursive: true
443
+ });
444
+ fs.writeFileSync(tokenPath, tokenJson);
445
+ fs.chmodSync(tokenPath, 432);
446
+ }
447
+ function loadToken(projectId) {
448
+ const dir = (0, import_token_io.getUserDataDir)();
449
+ if (!dir) throw new import_token_error.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");
450
+ const tokenPath = path.join(dir, "com.vercel.token", `${projectId}.json`);
451
+ if (!fs.existsSync(tokenPath)) return null;
452
+ const token = JSON.parse(fs.readFileSync(tokenPath, "utf8"));
453
+ assertVercelOidcTokenResponse(token);
454
+ return token;
455
+ }
456
+ function getTokenPayload(token) {
457
+ const tokenParts = token.split(".");
458
+ if (tokenParts.length !== 3) throw new import_token_error.VercelOidcTokenError("Invalid token. Please run `vc env pull` and try again");
459
+ const base64 = tokenParts[1].replace(/-/g, "+").replace(/_/g, "/");
460
+ const padded = base64.padEnd(base64.length + (4 - base64.length % 4) % 4, "=");
461
+ return JSON.parse(Buffer.from(padded, "base64").toString("utf8"));
462
+ }
463
+ function isExpired(token, bufferMs = 0) {
464
+ return token.exp * 1e3 < Date.now() + bufferMs;
465
+ }
466
+ }) });
467
+
468
+ //#endregion
469
+ export { __toDynamicImportESM as a, __commonJS as i, require_auth_errors as n, __toESM$3 as o, require_token_error as r, require_token_util as t };
470
+ //# sourceMappingURL=token-util-EUxa8JtH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-util-EUxa8JtH.js","names":["__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__export","__copyProps","__toCommonJS","__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__export","__copyProps","__toCommonJS","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__export","__copyProps","__toESM","__toCommonJS","import_os","import_token_error","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__export","__copyProps","__toESM","__toCommonJS","fs","path","__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__export","__copyProps","__toCommonJS"],"sources":["../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-error.js","../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/auth-errors.js","../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-io.js","../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/auth-config.js","../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/oauth.js","../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-util.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_error_exports = {};\n__export(token_error_exports, {\n VercelOidcTokenError: () => VercelOidcTokenError\n});\nmodule.exports = __toCommonJS(token_error_exports);\nclass VercelOidcTokenError extends Error {\n constructor(message, cause) {\n super(message);\n this.name = \"VercelOidcTokenError\";\n this.cause = cause;\n }\n toString() {\n if (this.cause) {\n return `${this.name}: ${this.message}: ${this.cause}`;\n }\n return `${this.name}: ${this.message}`;\n }\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n VercelOidcTokenError\n});\n","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar auth_errors_exports = {};\n__export(auth_errors_exports, {\n AccessTokenMissingError: () => AccessTokenMissingError,\n RefreshAccessTokenFailedError: () => RefreshAccessTokenFailedError\n});\nmodule.exports = __toCommonJS(auth_errors_exports);\nclass AccessTokenMissingError extends Error {\n constructor() {\n super(\n \"No authentication found. Please log in with the Vercel CLI (vercel login).\"\n );\n this.name = \"AccessTokenMissingError\";\n }\n}\nclass RefreshAccessTokenFailedError extends Error {\n constructor(cause) {\n super(\"Failed to refresh authentication token.\", { cause });\n this.name = \"RefreshAccessTokenFailedError\";\n }\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n AccessTokenMissingError,\n RefreshAccessTokenFailedError\n});\n","\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_io_exports = {};\n__export(token_io_exports, {\n findRootDir: () => findRootDir,\n getUserDataDir: () => getUserDataDir\n});\nmodule.exports = __toCommonJS(token_io_exports);\nvar import_path = __toESM(require(\"path\"));\nvar import_fs = __toESM(require(\"fs\"));\nvar import_os = __toESM(require(\"os\"));\nvar import_token_error = require(\"./token-error\");\nfunction findRootDir() {\n try {\n let dir = process.cwd();\n while (dir !== import_path.default.dirname(dir)) {\n const pkgPath = import_path.default.join(dir, \".vercel\");\n if (import_fs.default.existsSync(pkgPath)) {\n return dir;\n }\n dir = import_path.default.dirname(dir);\n }\n } catch (e) {\n throw new import_token_error.VercelOidcTokenError(\n \"Token refresh only supported in node server environments\"\n );\n }\n return null;\n}\nfunction getUserDataDir() {\n if (process.env.XDG_DATA_HOME) {\n return process.env.XDG_DATA_HOME;\n }\n switch (import_os.default.platform()) {\n case \"darwin\":\n return import_path.default.join(import_os.default.homedir(), \"Library/Application Support\");\n case \"linux\":\n return import_path.default.join(import_os.default.homedir(), \".local/share\");\n case \"win32\":\n if (process.env.LOCALAPPDATA) {\n return process.env.LOCALAPPDATA;\n }\n return null;\n default:\n return null;\n }\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n findRootDir,\n getUserDataDir\n});\n","\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar auth_config_exports = {};\n__export(auth_config_exports, {\n isValidAccessToken: () => isValidAccessToken,\n readAuthConfig: () => readAuthConfig,\n writeAuthConfig: () => writeAuthConfig\n});\nmodule.exports = __toCommonJS(auth_config_exports);\nvar fs = __toESM(require(\"fs\"));\nvar path = __toESM(require(\"path\"));\nvar import_token_util = require(\"./token-util\");\nfunction getAuthConfigPath() {\n const dataDir = (0, import_token_util.getVercelDataDir)();\n if (!dataDir) {\n throw new Error(\n `Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`\n );\n }\n return path.join(dataDir, \"auth.json\");\n}\nfunction readAuthConfig() {\n try {\n const authPath = getAuthConfigPath();\n if (!fs.existsSync(authPath)) {\n return null;\n }\n const content = fs.readFileSync(authPath, \"utf8\");\n if (!content) {\n return null;\n }\n return JSON.parse(content);\n } catch (error) {\n return null;\n }\n}\nfunction writeAuthConfig(config) {\n const authPath = getAuthConfigPath();\n const authDir = path.dirname(authPath);\n if (!fs.existsSync(authDir)) {\n fs.mkdirSync(authDir, { mode: 504, recursive: true });\n }\n fs.writeFileSync(authPath, JSON.stringify(config, null, 2), { mode: 384 });\n}\nfunction isValidAccessToken(authConfig, expirationBufferMs = 0) {\n if (!authConfig.token)\n return false;\n if (typeof authConfig.expiresAt !== \"number\")\n return true;\n const nowInSeconds = Math.floor(Date.now() / 1e3);\n const bufferInSeconds = expirationBufferMs / 1e3;\n return authConfig.expiresAt >= nowInSeconds + bufferInSeconds;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n isValidAccessToken,\n readAuthConfig,\n writeAuthConfig\n});\n","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar oauth_exports = {};\n__export(oauth_exports, {\n processTokenResponse: () => processTokenResponse,\n refreshTokenRequest: () => refreshTokenRequest\n});\nmodule.exports = __toCommonJS(oauth_exports);\nvar import_os = require(\"os\");\nconst VERCEL_ISSUER = \"https://vercel.com\";\nconst VERCEL_CLI_CLIENT_ID = \"cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp\";\nconst userAgent = `@vercel/oidc node-${process.version} ${(0, import_os.platform)()} (${(0, import_os.arch)()}) ${(0, import_os.hostname)()}`;\nlet _tokenEndpoint = null;\nasync function getTokenEndpoint() {\n if (_tokenEndpoint) {\n return _tokenEndpoint;\n }\n const discoveryUrl = `${VERCEL_ISSUER}/.well-known/openid-configuration`;\n const response = await fetch(discoveryUrl, {\n headers: { \"user-agent\": userAgent }\n });\n if (!response.ok) {\n throw new Error(\"Failed to discover OAuth endpoints\");\n }\n const metadata = await response.json();\n if (!metadata || typeof metadata.token_endpoint !== \"string\") {\n throw new Error(\"Invalid OAuth discovery response\");\n }\n const endpoint = metadata.token_endpoint;\n _tokenEndpoint = endpoint;\n return endpoint;\n}\nasync function refreshTokenRequest(options) {\n const tokenEndpoint = await getTokenEndpoint();\n return await fetch(tokenEndpoint, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n \"user-agent\": userAgent\n },\n body: new URLSearchParams({\n client_id: VERCEL_CLI_CLIENT_ID,\n grant_type: \"refresh_token\",\n ...options\n })\n });\n}\nasync function processTokenResponse(response) {\n const json = await response.json();\n if (!response.ok) {\n const errorMsg = typeof json === \"object\" && json && \"error\" in json ? String(json.error) : \"Token refresh failed\";\n return [new Error(errorMsg)];\n }\n if (typeof json !== \"object\" || json === null) {\n return [new Error(\"Invalid token response\")];\n }\n if (typeof json.access_token !== \"string\") {\n return [new Error(\"Missing access_token in response\")];\n }\n if (json.token_type !== \"Bearer\") {\n return [new Error(\"Invalid token_type in response\")];\n }\n if (typeof json.expires_in !== \"number\") {\n return [new Error(\"Missing expires_in in response\")];\n }\n return [null, json];\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n processTokenResponse,\n refreshTokenRequest\n});\n","\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_util_exports = {};\n__export(token_util_exports, {\n assertVercelOidcTokenResponse: () => assertVercelOidcTokenResponse,\n findProjectInfo: () => findProjectInfo,\n getTokenPayload: () => getTokenPayload,\n getVercelDataDir: () => getVercelDataDir,\n getVercelOidcToken: () => getVercelOidcToken,\n getVercelToken: () => getVercelToken,\n isExpired: () => isExpired,\n loadToken: () => loadToken,\n saveToken: () => saveToken\n});\nmodule.exports = __toCommonJS(token_util_exports);\nvar path = __toESM(require(\"path\"));\nvar fs = __toESM(require(\"fs\"));\nvar import_token_error = require(\"./token-error\");\nvar import_token_io = require(\"./token-io\");\nvar import_auth_config = require(\"./auth-config\");\nvar import_oauth = require(\"./oauth\");\nvar import_auth_errors = require(\"./auth-errors\");\nfunction getVercelDataDir() {\n const vercelFolder = \"com.vercel.cli\";\n const dataDir = (0, import_token_io.getUserDataDir)();\n if (!dataDir) {\n return null;\n }\n return path.join(dataDir, vercelFolder);\n}\nasync function getVercelToken(options) {\n const authConfig = (0, import_auth_config.readAuthConfig)();\n if (!authConfig?.token) {\n throw new import_auth_errors.AccessTokenMissingError();\n }\n if ((0, import_auth_config.isValidAccessToken)(authConfig, options?.expirationBufferMs)) {\n return authConfig.token;\n }\n if (!authConfig.refreshToken) {\n (0, import_auth_config.writeAuthConfig)({});\n throw new import_auth_errors.RefreshAccessTokenFailedError(\"No refresh token available\");\n }\n try {\n const tokenResponse = await (0, import_oauth.refreshTokenRequest)({\n refresh_token: authConfig.refreshToken\n });\n const [tokensError, tokens] = await (0, import_oauth.processTokenResponse)(tokenResponse);\n if (tokensError || !tokens) {\n (0, import_auth_config.writeAuthConfig)({});\n throw new import_auth_errors.RefreshAccessTokenFailedError(tokensError);\n }\n const updatedConfig = {\n token: tokens.access_token,\n expiresAt: Math.floor(Date.now() / 1e3) + tokens.expires_in\n };\n if (tokens.refresh_token) {\n updatedConfig.refreshToken = tokens.refresh_token;\n }\n (0, import_auth_config.writeAuthConfig)(updatedConfig);\n return updatedConfig.token;\n } catch (error) {\n (0, import_auth_config.writeAuthConfig)({});\n if (error instanceof import_auth_errors.AccessTokenMissingError || error instanceof import_auth_errors.RefreshAccessTokenFailedError) {\n throw error;\n }\n throw new import_auth_errors.RefreshAccessTokenFailedError(error);\n }\n}\nasync function getVercelOidcToken(authToken, projectId, teamId) {\n const url = `https://api.vercel.com/v1/projects/${projectId}/token?source=vercel-oidc-refresh${teamId ? `&teamId=${teamId}` : \"\"}`;\n const res = await fetch(url, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${authToken}`\n }\n });\n if (!res.ok) {\n throw new import_token_error.VercelOidcTokenError(\n `Failed to refresh OIDC token: ${res.statusText}`\n );\n }\n const tokenRes = await res.json();\n assertVercelOidcTokenResponse(tokenRes);\n return tokenRes;\n}\nfunction assertVercelOidcTokenResponse(res) {\n if (!res || typeof res !== \"object\") {\n throw new TypeError(\n \"Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again\"\n );\n }\n if (!(\"token\" in res) || typeof res.token !== \"string\") {\n throw new TypeError(\n \"Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again\"\n );\n }\n}\nfunction findProjectInfo() {\n const dir = (0, import_token_io.findRootDir)();\n if (!dir) {\n throw new import_token_error.VercelOidcTokenError(\n \"Unable to find project root directory. Have you linked your project with `vc link?`\"\n );\n }\n const prjPath = path.join(dir, \".vercel\", \"project.json\");\n if (!fs.existsSync(prjPath)) {\n throw new import_token_error.VercelOidcTokenError(\n \"project.json not found, have you linked your project with `vc link?`\"\n );\n }\n const prj = JSON.parse(fs.readFileSync(prjPath, \"utf8\"));\n if (typeof prj.projectId !== \"string\" && typeof prj.orgId !== \"string\") {\n throw new TypeError(\n \"Expected a string-valued projectId property. Try running `vc link` to re-link your project.\"\n );\n }\n return { projectId: prj.projectId, teamId: prj.orgId };\n}\nfunction saveToken(token, projectId) {\n const dir = (0, import_token_io.getUserDataDir)();\n if (!dir) {\n throw new import_token_error.VercelOidcTokenError(\n \"Unable to find user data directory. Please reach out to Vercel support.\"\n );\n }\n const tokenPath = path.join(dir, \"com.vercel.token\", `${projectId}.json`);\n const tokenJson = JSON.stringify(token);\n fs.mkdirSync(path.dirname(tokenPath), { mode: 504, recursive: true });\n fs.writeFileSync(tokenPath, tokenJson);\n fs.chmodSync(tokenPath, 432);\n return;\n}\nfunction loadToken(projectId) {\n const dir = (0, import_token_io.getUserDataDir)();\n if (!dir) {\n throw new import_token_error.VercelOidcTokenError(\n \"Unable to find user data directory. Please reach out to Vercel support.\"\n );\n }\n const tokenPath = path.join(dir, \"com.vercel.token\", `${projectId}.json`);\n if (!fs.existsSync(tokenPath)) {\n return null;\n }\n const token = JSON.parse(fs.readFileSync(tokenPath, \"utf8\"));\n assertVercelOidcTokenResponse(token);\n return token;\n}\nfunction getTokenPayload(token) {\n const tokenParts = token.split(\".\");\n if (tokenParts.length !== 3) {\n throw new import_token_error.VercelOidcTokenError(\n \"Invalid token. Please run `vc env pull` and try again\"\n );\n }\n const base64 = tokenParts[1].replace(/-/g, \"+\").replace(/_/g, \"/\");\n const padded = base64.padEnd(\n base64.length + (4 - base64.length % 4) % 4,\n \"=\"\n );\n return JSON.parse(Buffer.from(padded, \"base64\").toString(\"utf8\"));\n}\nfunction isExpired(token, bufferMs = 0) {\n return token.exp * 1e3 < Date.now() + bufferMs;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n assertVercelOidcTokenResponse,\n findProjectInfo,\n getTokenPayload,\n getVercelDataDir,\n getVercelOidcToken,\n getVercelToken,\n isExpired,\n loadToken,\n saveToken\n});\n"],"x_google_ignoreList":[0,1,2,3,4,5],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACA,IAAIA,cAAY,OAAO;CACvB,IAAIC,qBAAmB,OAAO;CAC9B,IAAIC,sBAAoB,OAAO;CAC/B,IAAIC,iBAAe,OAAO,UAAU;CACpC,IAAIC,cAAY,QAAQ,QAAQ;AAC9B,OAAK,IAAI,QAAQ,IACf,aAAU,QAAQ,MAAM;GAAE,KAAK,IAAI;GAAO,YAAY;GAAM,CAAC;;CAEjE,IAAIC,iBAAe,IAAI,MAAM,QAAQ,SAAS;AAC5C,MAA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0 +1,8 @@
1
+ const require_token_util$1 = require('./token-util-B2kSJtEV.cjs');
2
+
3
+ Object.defineProperty(exports, 'default', {
4
+ enumerable: true,
5
+ get: function () {
6
+ return require_token_util$1.require_token_util();
7
+ }
8
+ });