apify-cli 0.21.10-beta.10 → 0.21.10-beta.11

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/dist/actor.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{a as o,b as r,c as m,e as a}from"./chunk-A3JEYXK4.js";r("Actor");for(let n of a)n.registerCommand("actor",o);await m("actor");
2
+ import{a as o,b as r,c as m,e as a}from"./chunk-BQP4A7WO.js";r("Actor");for(let n of a)n.registerCommand("actor",o);await m("actor");
3
3
  //# sourceMappingURL=actor.js.map
package/dist/apify.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{a as o,b as i,c as r,d as m}from"./chunk-A3JEYXK4.js";i("Apify");for(let a of m)a.registerCommand("apify",o);await r("apify");
2
+ import{a as o,b as i,c as r,d as m}from"./chunk-BQP4A7WO.js";i("Apify");for(let a of m)a.registerCommand("apify",o);await r("apify");
3
3
  //# sourceMappingURL=apify.js.map
@@ -1,4 +1,4 @@
1
- var Ra=Object.defineProperty;var l=(t,e)=>Ra(t,"name",{value:e,configurable:!0});import de from"process";import ue from"chalk";import{satisfies as Hc}from"semver";import Jc from"yargs/yargs";import Oi from"chalk";import Cc from"indent-string";import Ic from"widest-line";import $c from"wrap-ansi";import at from"chalk";function qe(t){t.stdoutOutput&&console.log(...t.stdoutOutput),t.stderrOutput&&console.error(...t.stderrOutput)}l(qe,"internalLog");function _(t){qe({[t.stdout?"stdoutOutput":"stderrOutput"]:[t.message]})}l(_,"simpleLog");function m(t){qe({[t.stdout?"stdoutOutput":"stderrOutput"]:[at.red("Error:"),t.message]})}l(m,"error");function x(t){qe({[t.stdout?"stdoutOutput":"stderrOutput"]:[at.yellow.bold("Warning:"),t.message]})}l(x,"warning");function R(t){qe({[t.stdout?"stdoutOutput":"stderrOutput"]:[at.green("Success:"),t.message]})}l(R,"success");function ye(t){qe({[t.stdout?"stdoutOutput":"stderrOutput"]:[at.gray("Run:"),t.message]})}l(ye,"run");function v(t){qe({[t.stdout?"stdoutOutput":"stderrOutput"]:[at.white("Info:"),t.message]})}l(v,"info");function Ks(t){qe({[t.stdout?"stdoutOutput":"stderrOutput"]:[at.blue(t.message),t.url]})}l(Ks,"link");import Ut from"chalk";import Ei from"indent-string";import Ri from"widest-line";import _i from"wrap-ansi";import{realpathSync as _a}from"fs";import{dirname as xa}from"path";var qs="0.0.0";var Oa="0.21.10-beta.10",Na="0e634801dd5b0e4c9dd165a14e18b213b133820f";function La(){if(process.env.APIFY_CLI_MARKED_INSTALL_METHOD)return process.env.APIFY_CLI_MARKED_INSTALL_METHOD;if(process.env.APIFY_CLI_BUNDLE)return"bundle";let t=process.argv[1];if(!t)return x({message:"Failed to detect install method of CLI, assuming npm"}),"npm";let e=_a(t);return process.env.VOLTA_HOME&&e.includes(process.env.VOLTA_HOME)?"volta":e.includes("homebrew/Cellar")||e.includes("linuxbrew/Cellar")?"homebrew":process.env.PNPM_HOME&&e.includes(process.env.PNPM_HOME)?"pnpm":process.env.BUN_INSTALL&&e.includes(process.env.BUN_INSTALL)?"bun":"npm"}l(La,"detectInstallMethod");function Da(){return process.versions.bun?{runtime:"bun",version:process.versions.bun,nodeVersion:process.versions.node}:process.versions.deno?{runtime:"deno",version:process.versions.deno,nodeVersion:process.versions.node}:{runtime:"node",version:process.versions.node}}l(Da,"getRuntimeInfo");var $t=null;function ee(){if($t)return $t;let t=La(),e=Da();return $t={version:Oa,hash:Na,arch:process.env.APIFY_BUNDLE_ARCH??process.arch,platform:process.platform==="win32"?"windows":process.platform,runtime:e.runtime,extraRuntimeData:e.nodeVersion?`(emulating node ${e.nodeVersion})`:"",installMethod:t,get fullVersionString(){return`apify-cli/${this.version} (${this.hash.slice(0,7)}) running on ${this.platform}-${this.arch} with ${this.runtime}-${e.version}${this.extraRuntimeData?` ${this.extraRuntimeData}`:""}, installed via ${this.installMethod}`}},t==="bundle"&&($t.installPath=xa(process.execPath)),$t}l(ee,"useCLIMetadata");import{createWriteStream as Ka,existsSync as ne,mkdirSync as qa,readdirSync as ni,readFileSync as Ot,writeFileSync as ir}from"fs";import{mkdir as Wa,readFile as za}from"fs/promises";import{get as Xa}from"https";import{dirname as ai,join as Ae}from"path";import ie from"process";import{finished as Za}from"stream/promises";import{DurationFormatter as ci,TimeTypes as Ze}from"@sapphire/duration";import{Timestamp as os}from"@sapphire/timestamp";import Qa from"adm-zip";import ec from"ajv/dist/2019.js";import{ApifyClient as li}from"apify-client";import tc from"archiver";import{AxiosHeaders as rc}from"axios";import oc from"escape-string-regexp";import{globby as ui}from"globby";import{getEncoding as sc}from"istextorbinary";import{Mime as ic}from"mime";import nc from"mime/types/other.js";import ac from"mime/types/standard.js";import{gte as cc,minVersion as lc,satisfies as uc}from"semver";import{ACTOR_ENV_VARS as ss,ACTOR_JOB_TERMINAL_STATUSES as dc,ACTOR_NAME as xt,APIFY_ENV_VARS as mc,KEY_VALUE_STORE_KEYS as ii,LOCAL_ACTOR_ENV_VARS as is,LOCAL_STORAGE_SUBDIRS as ns,SOURCE_FILE_FORMATS as _t}from"@apify/consts";import{homedir as ka}from"os";import{join as We}from"path";import{KEY_VALUE_STORE_KEYS as Fa,META_ORIGINS as Ua}from"@apify/consts";var Ws={name:"apify-cli",version:"0.21.10-beta.10",description:"Apify command-line interface (CLI) helps you manage the Apify cloud platform and develop, build, and deploy Apify Actors.",exports:"./dist/index.js",type:"module",scripts:{"dev:apify":"tsx ./src/entrypoints/apify.ts","dev:actor":"tsx ./src/entrypoints/actor.ts","test:all":"yarn test:local && yarn test:api","test:local":"vitest run --testNamePattern '^((?!\\[api]).)*$' --exclude ./test/api","test:api":"vitest run --testNamePattern '\\[api\\]'","test:python":"vitest run --testNamePattern '\\[python\\]'","test:cucumber":'cross-env NODE_OPTIONS="--import tsx" cucumber-js',lint:"eslint src test scripts features --ext .ts,.cjs,.mjs","lint:fix":"eslint src test scripts features --fix --ext .ts,.cjs,.mjs",format:'biome format . && prettier --check "**/*.{md,yml,yaml}"',"format:fix":'biome format --write . && prettier --write "**/*.{md,yml,yaml}"',clean:"rimraf dist",build:"yarn clean && tsc && tsup","build-bundles":"bun run scripts/build-cli-bundles.ts",prepack:"yarn insert-cli-metadata && yarn build && yarn update-docs","insert-cli-metadata":"tsx scripts/insert-cli-metadata.ts","update-docs":"tsx scripts/generate-cli-docs.ts",postinstall:`node -e "console.log('We have an active developer community on Discord. You can find it on https://discord.gg/crawlee-apify-801163717915574323.');"`},files:["dist"],bin:{actor:"./dist/actor.js",apify:"./dist/apify.js","apify-cli":"./dist/apify.js"},contributors:["Jakub Drobn\xEDk <jakub.drobnik@apify.com>","Jan Curn <jan@apify.com>","Vlad Frangu <vlad.frangu@apify.com>"],repository:{type:"git",url:"git+https://github.com/apify/apify-cli.git"},keywords:["apify","client","node","command","line","bash"],author:{name:"Apify",email:"support@apify.com",url:"https://www.apify.com"},license:"Apache-2.0",bugs:{url:"https://github.com/apify/apify-cli/issues"},homepage:"https://github.com/apify/apify-cli#readme",engines:{node:">=18"},dependencies:{"@apify/actor-templates":"^0.1.5","@apify/consts":"^2.36.0","@apify/input_schema":"^3.17.0","@apify/utilities":"^2.15.1","@crawlee/memory-storage":"^3.12.0","@inquirer/core":"^10.1.15","@inquirer/input":"^4.2.1","@inquirer/password":"^4.0.17","@inquirer/select":"^4.3.1","@root/walk":"~1.1.0","@sapphire/duration":"^1.1.2","@sapphire/result":"^2.7.2","@sapphire/timestamp":"^1.0.3","@skyra/jaro-winkler":"^1.1.1","adm-zip":"~0.5.15",ajv:"~8.17.1","apify-client":"^2.12.6",archiver:"~7.0.1",axios:"^1.11.0",chalk:"~5.5.0","cli-table3":"^0.6.5","computer-name":"~0.1.0",configparser:"~0.3.10",cors:"~2.8.5","detect-indent":"~7.0.1","escape-string-regexp":"~5.0.0",execa:"^9.5.2",express:"~5.1.0",globby:"~14.1.0",handlebars:"~4.7.8","indent-string":"^5.0.0","is-ci":"~4.1.0",istextorbinary:"~9.5.0",jju:"~1.4.0","js-levenshtein":"^1.1.6","lodash.clonedeep":"^4.5.0",mime:"~4.0.4",mixpanel:"~0.18.0",open:"~10.2.0",ow:"~2.0.0",rimraf:"~6.0.1",semver:"~7.7.0","string-width":"^7.2.0","strip-ansi":"^7.1.0",tiged:"~2.12.7",which:"^5.0.0","widest-line":"^5.0.0","wrap-ansi":"^9.0.0",yargs:"^17.7.2"},devDependencies:{"@apify/eslint-config":"^1.0.0","@apify/tsconfig":"^0.1.1","@biomejs/biome":"^2.0.0","@crawlee/types":"^3.11.1","@cucumber/cucumber":"^12.0.0","@types/adm-zip":"^0.5.5","@types/archiver":"^6.0.2","@types/bun":"^1.2.5","@types/chai":"^4.3.17","@types/cors":"^2.8.17","@types/execa":"^2.0.2","@types/express":"^5.0.0","@types/fs-extra":"^11","@types/is-ci":"^3.0.4","@types/jju":"^1.4.5","@types/js-levenshtein":"^1","@types/lodash.clonedeep":"^4","@types/mime":"^4.0.0","@types/node":"^22.0.0","@types/semver":"^7.5.8","@types/which":"^3.0.4","@types/yargs":"^17.0.33","@yarnpkg/core":"^4.1.2",apify:"^3.2.4",chai:"^4.4.1","cross-env":"^10.0.0",eslint:"^9.25.1","eslint-config-prettier":"^10.1.2","lint-staged":"^16.0.0","mdast-util-from-markdown":"^2.0.2","mock-stdin":"^1.0.0",prettier:"^3.5.3",tsup:"^8.5.0",tsx:"^4.16.5",typescript:"^5.8.3","typescript-eslint":"^8.31.0",vitest:"^3.0.0"},volta:{node:"22.18.0",yarn:"4.9.2"},packageManager:"yarn@4.9.2",devEngines:{runtime:[{name:"node",version:">= 20",onFail:"error"},{name:"bun",version:">= 1.2.5",onFail:"ignore"}],packageManager:{name:"yarn",version:">= 4",onFail:"warn"}},"lint-staged":{"*":"biome format --write --no-errors-on-unmatched","*.{mjs,js,ts}":"eslint --fix --ext mjs,js,ts","*.md":"prettier --write"}};var ze="storage",Qo="apify_storage",es=1,er={actorSpecification:es,name:null,version:"0.0",buildTag:"latest",environmentVariables:{}},zs={SCRAPY:"scrapy",CRAWLEE:"crawlee",PRE_CRAWLEE_APIFY_SDK:"apify",UNKNOWN:"unknown"},Xs=1440*60*1e3,ct=l(()=>{let t=We(ka(),".apify");return process.env.__APIFY_INTERNAL_TEST_AUTH_PATH__?We(t,process.env.__APIFY_INTERNAL_TEST_AUTH_PATH__):t},"GLOBAL_CONFIGS_FOLDER"),se=l(()=>We(ct(),"auth.json"),"AUTH_FILE_PATH"),tr=l(()=>We(ct(),"secrets.json"),"SECRETS_FILE_PATH"),rr=l(()=>We(ct(),"state.json"),"STATE_FILE_PATH"),De=l(()=>We(ct(),"telemetry.json"),"TELEMETRY_FILE_PATH"),or="apify.json",ts=".actor",ja="actor.json",M=We(ts,ja),rs=new RegExp(`^${Fa.INPUT}\\..*`),we=Ws.engines.node,Zs={"X-Apify-Request-Origin":Ua.CLI},Xe="3.9.0",Qs=".venv",ei="ea75e434d4b4d2405d79ed9d14bfc93b";import{existsSync as Ma,mkdirSync as Ba}from"fs";import{readFile as Va,stat as ti,unlink as Ya,writeFile as Ga}from"fs/promises";import{join as ri,sep as Ha}from"path";import{rimraf as Ja}from"rimraf";var oi=l(async(t,e={},r=null)=>{let o=await Va(t,"utf-8"),s=JSON.parse(o),i;r?(i=s,i[r]={...s[r],...e}):i={...s,...e},await Ga(t,JSON.stringify(i,null," "))},"updateLocalJson"),sr=l((t,e)=>{e||(e=t,t="."),e.split(Ha).reduce((o,s)=>(o=ri(o,s),Ma(o)||Ba(o),o),t)},"ensureFolderExistsSync"),Et=l(async t=>{await Ja(t)},"rimrafPromised"),Rt=l(async t=>{(await ti(t)).isFile()&&await Ya(t)},"deleteFile"),si=l(async(t,e)=>(await Promise.all(t.map(async s=>ti(ri(e,s))))).map(s=>s.size).reduce((s,i)=>s+i,0),"sumFilesSizeInBytes");var lt=ec,nr=l(async t=>new Promise((e,r)=>{Xa(t,o=>{o.statusCode===301||o.statusCode===302?(e(nr(o.headers.location)),o.destroy()):e(o)}).on("error",r)}),"httpsGet"),ae=l(()=>{let t=mc.LOCAL_STORAGE_DIR;return ie.env[t]||ie.env.CRAWLEE_STORAGE_DIR||ze},"getLocalStorageDir"),Te=l(t=>{let e=ss.DEFAULT_KEY_VALUE_STORE_ID,r=t||ie.env[e]||is[e];return Ae(ae(),ns.keyValueStores,r)},"getLocalKeyValueStorePath"),di=l(t=>{let e=ss.DEFAULT_DATASET_ID,r=t||ie.env[e]||is[e];return Ae(ae(),ns.datasets,r)},"getLocalDatasetPath"),mi=l(t=>{let e=ss.DEFAULT_REQUEST_QUEUE_ID,r=t||ie.env[e]||is[e];return Ae(ae(),ns.requestQueues,r)},"getLocalRequestQueuePath"),k=l(async()=>{let t={};try{let e=await za(se(),"utf-8");t=JSON.parse(e)}catch{return{}}if(!t.username&&!t.id)throw new Error('Corrupted local user info was found. Please run "apify login" to fix it.');return t},"getLocalUserInfo");async function S(){let t=await Nt();if(!t)throw new Error('You are not logged in with your Apify account. Call "apify login" to fix that.');return t}l(S,"getLoggedClientOrThrow");var pi=l(t=>{if(!t&&ne(ct())&&ne(se())){let e=Ot(se(),"utf-8");return JSON.parse(e).token}return t},"getTokenWithAuthFileFallback"),as=l((t,e)=>(t=pi(t),{token:t,baseUrl:e||ie.env.APIFY_CLIENT_BASE_URL,requestInterceptors:[r=>{r.headers??=new rc;for(let[o,s]of Object.entries(Zs))r.headers[o]=s;return r}]}),"getApifyClientOptions");async function Nt(t,e){t=pi(t);let r=new li(as(t,e)),o;try{o=await r.user("me").get()}catch{return null}return Qe(se()),ir(se(),JSON.stringify({token:r.token,...o},null," ")),r}l(Nt,"getLoggedClient");var cs=l(t=>Ae(t,M),"getLocalConfigPath"),ve=l(t=>{if(ne(t))return JSON.parse(Ot(t,{encoding:"utf-8"}))},"getJsonFileContent"),Pe=l(t=>ve(cs(t)),"getLocalConfig"),ar=l(async(t,e)=>{let r=Ae(e||ie.cwd(),M);await Wa(ai(r),{recursive:!0}),ir(r,JSON.stringify(t,null," "))},"setLocalConfig"),pc=[ae(),"node_modules",".venv"],cr=l(async t=>{let e=Te();sr(t,di()),sr(t,mi()),sr(t,e);let r=Ae(t,".gitignore"),o="";ne(r)&&(o=Ot(r,{encoding:"utf-8"}));let s=[];for(let i of pc)RegExp(`^${oc(i)}$`,"mg").test(o)||s.push(i);s.length>0&&(o.length>0?(s.unshift("# Added by Apify CLI"),ir(r,`
1
+ var Ra=Object.defineProperty;var l=(t,e)=>Ra(t,"name",{value:e,configurable:!0});import de from"process";import ue from"chalk";import{satisfies as Hc}from"semver";import Jc from"yargs/yargs";import Oi from"chalk";import Cc from"indent-string";import Ic from"widest-line";import $c from"wrap-ansi";import at from"chalk";function qe(t){t.stdoutOutput&&console.log(...t.stdoutOutput),t.stderrOutput&&console.error(...t.stderrOutput)}l(qe,"internalLog");function _(t){qe({[t.stdout?"stdoutOutput":"stderrOutput"]:[t.message]})}l(_,"simpleLog");function m(t){qe({[t.stdout?"stdoutOutput":"stderrOutput"]:[at.red("Error:"),t.message]})}l(m,"error");function x(t){qe({[t.stdout?"stdoutOutput":"stderrOutput"]:[at.yellow.bold("Warning:"),t.message]})}l(x,"warning");function R(t){qe({[t.stdout?"stdoutOutput":"stderrOutput"]:[at.green("Success:"),t.message]})}l(R,"success");function ye(t){qe({[t.stdout?"stdoutOutput":"stderrOutput"]:[at.gray("Run:"),t.message]})}l(ye,"run");function v(t){qe({[t.stdout?"stdoutOutput":"stderrOutput"]:[at.white("Info:"),t.message]})}l(v,"info");function Ks(t){qe({[t.stdout?"stdoutOutput":"stderrOutput"]:[at.blue(t.message),t.url]})}l(Ks,"link");import Ut from"chalk";import Ei from"indent-string";import Ri from"widest-line";import _i from"wrap-ansi";import{realpathSync as _a}from"fs";import{dirname as xa}from"path";var qs="0.0.0";var Oa="0.21.10-beta.11",Na="badf83845c5e76864614fc12e4cb3f1ee4ece855";function La(){if(process.env.APIFY_CLI_MARKED_INSTALL_METHOD)return process.env.APIFY_CLI_MARKED_INSTALL_METHOD;if(process.env.APIFY_CLI_BUNDLE)return"bundle";let t=process.argv[1];if(!t)return x({message:"Failed to detect install method of CLI, assuming npm"}),"npm";let e=_a(t);return process.env.VOLTA_HOME&&e.includes(process.env.VOLTA_HOME)?"volta":e.includes("homebrew/Cellar")||e.includes("linuxbrew/Cellar")?"homebrew":process.env.PNPM_HOME&&e.includes(process.env.PNPM_HOME)?"pnpm":process.env.BUN_INSTALL&&e.includes(process.env.BUN_INSTALL)?"bun":"npm"}l(La,"detectInstallMethod");function Da(){return process.versions.bun?{runtime:"bun",version:process.versions.bun,nodeVersion:process.versions.node}:process.versions.deno?{runtime:"deno",version:process.versions.deno,nodeVersion:process.versions.node}:{runtime:"node",version:process.versions.node}}l(Da,"getRuntimeInfo");var $t=null;function ee(){if($t)return $t;let t=La(),e=Da();return $t={version:Oa,hash:Na,arch:process.env.APIFY_BUNDLE_ARCH??process.arch,platform:process.platform==="win32"?"windows":process.platform,runtime:e.runtime,extraRuntimeData:e.nodeVersion?`(emulating node ${e.nodeVersion})`:"",installMethod:t,get fullVersionString(){return`apify-cli/${this.version} (${this.hash.slice(0,7)}) running on ${this.platform}-${this.arch} with ${this.runtime}-${e.version}${this.extraRuntimeData?` ${this.extraRuntimeData}`:""}, installed via ${this.installMethod}`}},t==="bundle"&&($t.installPath=xa(process.execPath)),$t}l(ee,"useCLIMetadata");import{createWriteStream as Ka,existsSync as ne,mkdirSync as qa,readdirSync as ni,readFileSync as Ot,writeFileSync as ir}from"fs";import{mkdir as Wa,readFile as za}from"fs/promises";import{get as Xa}from"https";import{dirname as ai,join as Ae}from"path";import ie from"process";import{finished as Za}from"stream/promises";import{DurationFormatter as ci,TimeTypes as Ze}from"@sapphire/duration";import{Timestamp as os}from"@sapphire/timestamp";import Qa from"adm-zip";import ec from"ajv/dist/2019.js";import{ApifyClient as li}from"apify-client";import tc from"archiver";import{AxiosHeaders as rc}from"axios";import oc from"escape-string-regexp";import{globby as ui}from"globby";import{getEncoding as sc}from"istextorbinary";import{Mime as ic}from"mime";import nc from"mime/types/other.js";import ac from"mime/types/standard.js";import{gte as cc,minVersion as lc,satisfies as uc}from"semver";import{ACTOR_ENV_VARS as ss,ACTOR_JOB_TERMINAL_STATUSES as dc,ACTOR_NAME as xt,APIFY_ENV_VARS as mc,KEY_VALUE_STORE_KEYS as ii,LOCAL_ACTOR_ENV_VARS as is,LOCAL_STORAGE_SUBDIRS as ns,SOURCE_FILE_FORMATS as _t}from"@apify/consts";import{homedir as ka}from"os";import{join as We}from"path";import{KEY_VALUE_STORE_KEYS as Fa,META_ORIGINS as Ua}from"@apify/consts";var Ws={name:"apify-cli",version:"0.21.10-beta.11",description:"Apify command-line interface (CLI) helps you manage the Apify cloud platform and develop, build, and deploy Apify Actors.",exports:"./dist/index.js",type:"module",scripts:{"dev:apify":"tsx ./src/entrypoints/apify.ts","dev:actor":"tsx ./src/entrypoints/actor.ts","test:all":"yarn test:local && yarn test:api","test:local":"vitest run --testNamePattern '^((?!\\[api]).)*$' --exclude ./test/api","test:api":"vitest run --testNamePattern '\\[api\\]'","test:python":"vitest run --testNamePattern '\\[python\\]'","test:cucumber":'cross-env NODE_OPTIONS="--import tsx" cucumber-js',lint:"eslint src test scripts features --ext .ts,.cjs,.mjs","lint:fix":"eslint src test scripts features --fix --ext .ts,.cjs,.mjs",format:'biome format . && prettier --check "**/*.{md,yml,yaml}"',"format:fix":'biome format --write . && prettier --write "**/*.{md,yml,yaml}"',clean:"rimraf dist",build:"yarn clean && tsc && tsup","build-bundles":"bun run scripts/build-cli-bundles.ts",prepack:"yarn insert-cli-metadata && yarn build && yarn update-docs","insert-cli-metadata":"tsx scripts/insert-cli-metadata.ts","update-docs":"tsx scripts/generate-cli-docs.ts",postinstall:`node -e "console.log('We have an active developer community on Discord. You can find it on https://discord.gg/crawlee-apify-801163717915574323.');"`},files:["dist"],bin:{actor:"./dist/actor.js",apify:"./dist/apify.js","apify-cli":"./dist/apify.js"},contributors:["Jakub Drobn\xEDk <jakub.drobnik@apify.com>","Jan Curn <jan@apify.com>","Vlad Frangu <vlad.frangu@apify.com>"],repository:{type:"git",url:"git+https://github.com/apify/apify-cli.git"},keywords:["apify","client","node","command","line","bash"],author:{name:"Apify",email:"support@apify.com",url:"https://www.apify.com"},license:"Apache-2.0",bugs:{url:"https://github.com/apify/apify-cli/issues"},homepage:"https://github.com/apify/apify-cli#readme",engines:{node:">=18"},dependencies:{"@apify/actor-templates":"^0.1.5","@apify/consts":"^2.36.0","@apify/input_schema":"^3.17.0","@apify/utilities":"^2.15.1","@crawlee/memory-storage":"^3.12.0","@inquirer/core":"^10.1.15","@inquirer/input":"^4.2.1","@inquirer/password":"^4.0.17","@inquirer/select":"^4.3.1","@root/walk":"~1.1.0","@sapphire/duration":"^1.1.2","@sapphire/result":"^2.7.2","@sapphire/timestamp":"^1.0.3","@skyra/jaro-winkler":"^1.1.1","adm-zip":"~0.5.15",ajv:"~8.17.1","apify-client":"^2.12.6",archiver:"~7.0.1",axios:"^1.11.0",chalk:"~5.5.0","cli-table3":"^0.6.5","computer-name":"~0.1.0",configparser:"~0.3.10",cors:"~2.8.5","detect-indent":"~7.0.1","escape-string-regexp":"~5.0.0",execa:"^9.5.2",express:"~5.1.0",globby:"~14.1.0",handlebars:"~4.7.8","indent-string":"^5.0.0","is-ci":"~4.1.0",istextorbinary:"~9.5.0",jju:"~1.4.0","js-levenshtein":"^1.1.6","lodash.clonedeep":"^4.5.0",mime:"~4.0.4",mixpanel:"~0.18.0",open:"~10.2.0",ow:"~2.0.0",rimraf:"~6.0.1",semver:"~7.7.0","string-width":"^7.2.0","strip-ansi":"^7.1.0",tiged:"~2.12.7",which:"^5.0.0","widest-line":"^5.0.0","wrap-ansi":"^9.0.0",yargs:"^17.7.2"},devDependencies:{"@apify/eslint-config":"^1.0.0","@apify/tsconfig":"^0.1.1","@biomejs/biome":"^2.0.0","@crawlee/types":"^3.11.1","@cucumber/cucumber":"^12.0.0","@types/adm-zip":"^0.5.5","@types/archiver":"^6.0.2","@types/bun":"^1.2.5","@types/chai":"^4.3.17","@types/cors":"^2.8.17","@types/execa":"^2.0.2","@types/express":"^5.0.0","@types/fs-extra":"^11","@types/is-ci":"^3.0.4","@types/jju":"^1.4.5","@types/js-levenshtein":"^1","@types/lodash.clonedeep":"^4","@types/mime":"^4.0.0","@types/node":"^22.0.0","@types/semver":"^7.5.8","@types/which":"^3.0.4","@types/yargs":"^17.0.33","@yarnpkg/core":"^4.1.2",apify:"^3.2.4",chai:"^4.4.1","cross-env":"^10.0.0",eslint:"^9.25.1","eslint-config-prettier":"^10.1.2","lint-staged":"^16.0.0","mdast-util-from-markdown":"^2.0.2","mock-stdin":"^1.0.0",prettier:"^3.5.3",tsup:"^8.5.0",tsx:"^4.16.5",typescript:"^5.8.3","typescript-eslint":"^8.31.0",vitest:"^3.0.0"},volta:{node:"22.18.0",yarn:"4.9.2"},packageManager:"yarn@4.9.2",devEngines:{runtime:[{name:"node",version:">= 20",onFail:"error"},{name:"bun",version:">= 1.2.5",onFail:"ignore"}],packageManager:{name:"yarn",version:">= 4",onFail:"warn"}},"lint-staged":{"*":"biome format --write --no-errors-on-unmatched","*.{mjs,js,ts}":"eslint --fix --ext mjs,js,ts","*.md":"prettier --write"}};var ze="storage",Qo="apify_storage",es=1,er={actorSpecification:es,name:null,version:"0.0",buildTag:"latest",environmentVariables:{}},zs={SCRAPY:"scrapy",CRAWLEE:"crawlee",PRE_CRAWLEE_APIFY_SDK:"apify",UNKNOWN:"unknown"},Xs=1440*60*1e3,ct=l(()=>{let t=We(ka(),".apify");return process.env.__APIFY_INTERNAL_TEST_AUTH_PATH__?We(t,process.env.__APIFY_INTERNAL_TEST_AUTH_PATH__):t},"GLOBAL_CONFIGS_FOLDER"),se=l(()=>We(ct(),"auth.json"),"AUTH_FILE_PATH"),tr=l(()=>We(ct(),"secrets.json"),"SECRETS_FILE_PATH"),rr=l(()=>We(ct(),"state.json"),"STATE_FILE_PATH"),De=l(()=>We(ct(),"telemetry.json"),"TELEMETRY_FILE_PATH"),or="apify.json",ts=".actor",ja="actor.json",M=We(ts,ja),rs=new RegExp(`^${Fa.INPUT}\\..*`),we=Ws.engines.node,Zs={"X-Apify-Request-Origin":Ua.CLI},Xe="3.9.0",Qs=".venv",ei="ea75e434d4b4d2405d79ed9d14bfc93b";import{existsSync as Ma,mkdirSync as Ba}from"fs";import{readFile as Va,stat as ti,unlink as Ya,writeFile as Ga}from"fs/promises";import{join as ri,sep as Ha}from"path";import{rimraf as Ja}from"rimraf";var oi=l(async(t,e={},r=null)=>{let o=await Va(t,"utf-8"),s=JSON.parse(o),i;r?(i=s,i[r]={...s[r],...e}):i={...s,...e},await Ga(t,JSON.stringify(i,null," "))},"updateLocalJson"),sr=l((t,e)=>{e||(e=t,t="."),e.split(Ha).reduce((o,s)=>(o=ri(o,s),Ma(o)||Ba(o),o),t)},"ensureFolderExistsSync"),Et=l(async t=>{await Ja(t)},"rimrafPromised"),Rt=l(async t=>{(await ti(t)).isFile()&&await Ya(t)},"deleteFile"),si=l(async(t,e)=>(await Promise.all(t.map(async s=>ti(ri(e,s))))).map(s=>s.size).reduce((s,i)=>s+i,0),"sumFilesSizeInBytes");var lt=ec,nr=l(async t=>new Promise((e,r)=>{Xa(t,o=>{o.statusCode===301||o.statusCode===302?(e(nr(o.headers.location)),o.destroy()):e(o)}).on("error",r)}),"httpsGet"),ae=l(()=>{let t=mc.LOCAL_STORAGE_DIR;return ie.env[t]||ie.env.CRAWLEE_STORAGE_DIR||ze},"getLocalStorageDir"),Te=l(t=>{let e=ss.DEFAULT_KEY_VALUE_STORE_ID,r=t||ie.env[e]||is[e];return Ae(ae(),ns.keyValueStores,r)},"getLocalKeyValueStorePath"),di=l(t=>{let e=ss.DEFAULT_DATASET_ID,r=t||ie.env[e]||is[e];return Ae(ae(),ns.datasets,r)},"getLocalDatasetPath"),mi=l(t=>{let e=ss.DEFAULT_REQUEST_QUEUE_ID,r=t||ie.env[e]||is[e];return Ae(ae(),ns.requestQueues,r)},"getLocalRequestQueuePath"),k=l(async()=>{let t={};try{let e=await za(se(),"utf-8");t=JSON.parse(e)}catch{return{}}if(!t.username&&!t.id)throw new Error('Corrupted local user info was found. Please run "apify login" to fix it.');return t},"getLocalUserInfo");async function S(){let t=await Nt();if(!t)throw new Error('You are not logged in with your Apify account. Call "apify login" to fix that.');return t}l(S,"getLoggedClientOrThrow");var pi=l(t=>{if(!t&&ne(ct())&&ne(se())){let e=Ot(se(),"utf-8");return JSON.parse(e).token}return t},"getTokenWithAuthFileFallback"),as=l((t,e)=>(t=pi(t),{token:t,baseUrl:e||ie.env.APIFY_CLIENT_BASE_URL,requestInterceptors:[r=>{r.headers??=new rc;for(let[o,s]of Object.entries(Zs))r.headers[o]=s;return r}]}),"getApifyClientOptions");async function Nt(t,e){t=pi(t);let r=new li(as(t,e)),o;try{o=await r.user("me").get()}catch{return null}return Qe(se()),ir(se(),JSON.stringify({token:r.token,...o},null," ")),r}l(Nt,"getLoggedClient");var cs=l(t=>Ae(t,M),"getLocalConfigPath"),ve=l(t=>{if(ne(t))return JSON.parse(Ot(t,{encoding:"utf-8"}))},"getJsonFileContent"),Pe=l(t=>ve(cs(t)),"getLocalConfig"),ar=l(async(t,e)=>{let r=Ae(e||ie.cwd(),M);await Wa(ai(r),{recursive:!0}),ir(r,JSON.stringify(t,null," "))},"setLocalConfig"),pc=[ae(),"node_modules",".venv"],cr=l(async t=>{let e=Te();sr(t,di()),sr(t,mi()),sr(t,e);let r=Ae(t,".gitignore"),o="";ne(r)&&(o=Ot(r,{encoding:"utf-8"}));let s=[];for(let i of pc)RegExp(`^${oc(i)}$`,"mg").test(o)||s.push(i);s.length>0&&(o.length>0?(s.unshift("# Added by Apify CLI"),ir(r,`
2
2
  ${s.join(`
3
3
  `)}
4
4
  `,{flag:"a"})):ir(r,`${s.join(`
@@ -71,7 +71,7 @@ ${q.gray(`${f.username}/${f.name}`)}`,Runs:V.isSmallTerminal()&&u>=56?Ir:q.cyan(
71
71
  ${r.message||r}`}):m({message:`Failed to rename the deprecated "apify.json" file to "apify.json.deprecated".
72
72
  ${Dl(r,{showHidden:!1})}`})}}l(kl,"handleBothConfigVersionsFound");var Fl=["name","version","buildTag"];async function Ul(t,e,r){let o={...t};if(typeof o.version=="object"&&(o=jl(o)),o={actorSpecification:es,environmentVariables:t?.env||void 0,...Fl.reduce((i,n)=>(i[n]=t[n],i),{})},!await H({message:'The new version of Apify CLI uses the ".actor/actor.json" instead of the "apify.json" file. Your "apify.json" file will be automatically updated to the new format under ".actor/actor.json". The original file will be renamed by adding the ".deprecated" suffix. Do you want to continue?'}))return Ht({message:'Command can not run with old "apify.json" structure. Either let the CLI auto-update it or follow the guide on https://github.com/apify/apify-cli/blob/master/MIGRATIONS.md and update it manually.',exists:!0,config:o});try{await xl(Nl(r),{recursive:!0}),await Ol(r,JSON.stringify(o,null," "))}catch(i){let n=i;return Ht({message:`Failed to write the new "actor.json" file to path: '${r}'.
73
73
  ${n.message||n}`,exists:!0,config:o})}try{await tn(e,`${e}.deprecated`)}catch(i){let n=i;x({message:`Failed to rename the deprecated "apify.json" file to "apify.json.deprecated".
74
- ${n.message||n}`})}return v({message:'The "apify.json" file has been migrated to ".actor/actor.json" and the original file renamed to "apify.json.deprecated". The deprecated file is no longer used by the CLI or Apify Console. If you do not need it for some specific purpose, it can be safely deleted. Do not forget to commit the new file to your Git repository.'}),Or(o)}l(Ul,"handleMigrationFlow");function jl(t){let e={name:t.name,template:t.template,version:t.version.versionNumber,buildTag:t.version.buildTag,env:null};if(t.version.envVars?.length){let r={};t.version.envVars.forEach(o=>{o.name&&o.value&&(r[o.name]=o.value)}),e.env=r}return e}l(jl,"updateLocalConfigStructure");var an=l(async(t,e)=>{let{data:r}=await Gl.get(t,{responseType:"arraybuffer"}),o=new Yl(Buffer.from(r,"binary"));o.extractEntryTo(o.getEntries()[0].entryName,e,!1)},"extractGitHubZip"),vt=class extends h{static name="pull";static description="Download Actor code to current directory. Clones Git repositories or fetches Actor files based on the source type.";static flags={version:A.string({char:"v",description:"Actor version number which will be pulled, e.g. 1.2. Default: the highest version",required:!1}),dir:A.string({description:"Directory where the Actor should be pulled to",required:!1})};static args={actorId:w.string({required:!1,description:'Name or ID of the Actor to run (e.g. "apify/hello-world" or "E2jjCZBezvAZnX8Rb"). If not provided, the command will update the Actor in the current directory based on its name in ".actor/actor.json" file.'})};async run(){let e=sn.cwd(),r=await Me({cwd:e});if(r.isErr()){m({message:r.unwrapErr().message}),sn.exitCode=5;return}let{config:o}=r.unwrap(),s=await k(),i=await S(),n=!this.args.actorId,a=s.username||s.id,c=this.args?.actorId||o?.id||(o?.name?`${a}/${o.name}`:void 0);if(!c)throw new Error("Cannot find Actor in this directory.");let d;try{d=await i.actor(c).get()}catch{throw new Error(`Cannot find Actor with ID/name '${c}' in your account.`)}if(!d)throw new Error(`Cannot find Actor with ID/name '${c}' in your account.`);let{name:u,versions:f}=d,p=null;if(this.flags.version&&(p=f.find(y=>y.versionNumber===this.flags.version),!p))throw new Error(`Cannot find version ${this.flags.version} of Actor ${c}.`);p||(p=f.reduce((y,b)=>Hl(`${b.versionNumber}.0`,`${y.versionNumber}.0`)?b:y));let g=n?e:Vl(e,this.flags.dir??u);if(rn(g,{recursive:!0}),!n&&Ml(g).length!==0){m({message:`Directory ${g} is not empty. Please empty it or choose another directory.`});return}switch(p.sourceType){case"TARBALL":{await an(p.tarballUrl,g);break}case"SOURCE_FILES":{let{sourceFiles:y}=p;for(let b of y){let C=Bl(b.name);if(rn(`${g}/${C}`,{recursive:!0}),!b.folder){let T=b.format==="BASE64"?Buffer.from(b.content,"base64").toString():b.content;if(b.name===M){let I=nn.parse(T);I.name=d.name,on(`${g}/${b.name}`,nn.update(T,I))}else on(`${g}/${b.name}`,T)}}break}case"GIT_REPO":{let{gitRepoUrl:y}=p,[b,C]=y.split("#"),T,I;C&&([T,I]=C.split(":"));let L=b;I&&(L+=`/${I}`),T&&(L+=`#${T}`);let D=Jl(L);try{await D.clone(g)}catch(j){throw new Error(`Failed to pull Actor from ${y}. ${j.message}`)}break}case"GITHUB_GIST":{await an(`${p.gitHubGistUrl}/archive/master.zip`,g);break}default:throw new Error(`Unknown source type: ${p.sourceType}`)}R({message:n?`Actor ${u} updated at ${g}/`:`Pulled to ${g}/`})}};import{readFileSync as Wl,statSync as zl,unlinkSync as Xl}from"fs";import{join as Zl,resolve as Ql}from"path";import rt from"process";import eu from"is-ci";import tu from"open";import{fetchManifest as ru}from"@apify/actor-templates";import{ACTOR_JOB_STATUSES as ot,ACTOR_SOURCE_TYPES as vs,MAX_MULTIFILE_BYTES as hn}from"@apify/consts";import{readFileSync as Kl,writeFileSync as ql}from"fs";var Ts="@",cn=100,ln=5e4,Nr=l(()=>{try{return JSON.parse(Kl(tr(),"utf-8"))||{}}catch{return{}}},"getSecretsFile"),un=l(t=>(Qe(tr()),ql(tr(),JSON.stringify(t,null," ")),t),"writeSecretsFile"),dn=l((t,e)=>{let r=Nr();if(r[t])throw new Error(`Secret with name ${t} already exists. Call "apify secrets rm ${t}" to remove it.`);if(typeof t!="string"||t.length>cn)throw new Error(`Secret name has to be string with maximum length ${cn}.`);if(typeof e!="string"||e.length>ln)throw new Error(`Secret value has to be string with maximum length ${ln}.`);return r[t]=e,un(r)},"addSecret"),mn=l(t=>{let e=Nr();if(!e[t])throw new Error(`Secret with name ${t} doesn't exist.`);delete e[t],un(e)},"removeSecret"),pn=l(t=>new RegExp(`^${Ts}.{1}`).test(t),"isSecretKey"),fn=l((t,e)=>{e=e||Nr();let r={};return Object.keys(t).forEach(o=>{if(pn(t[o])){let s=t[o].replace(new RegExp(`^${Ts}`),"");e[s]?r[o]=e[s]:x({message:`Value for ${s} not found in local secrets. Set it by calling "apify secrets add ${s} [SECRET_VALUE]"`})}else r[o]=t[o]}),r},"replaceSecretsValue"),gn=l((t,e)=>{e=e||Nr();let r=[];return Object.keys(t).forEach(o=>{if(pn(t[o])){let s=t[o].replace(new RegExp(`^${Ts}`),"");e[s]?r.push({name:o,value:e[s],isSecret:!0}):x({message:`Value for ${s} not found in local secrets. Set it by calling "apify secrets add ${s} [SECRET_VALUE]"`})}else r.push({name:o,value:t[o]})}),r},"transformEnvToEnvVars");var Ss="temp_file.zip",ou={build:"latest",memoryMbytes:4096,timeoutSecs:3600},yn="0.0",su="latest",St=class extends h{static name="push";static description=`Deploys Actor to Apify platform using settings from '${M}'.
74
+ ${n.message||n}`})}return v({message:'The "apify.json" file has been migrated to ".actor/actor.json" and the original file renamed to "apify.json.deprecated". The deprecated file is no longer used by the CLI or Apify Console. If you do not need it for some specific purpose, it can be safely deleted. Do not forget to commit the new file to your Git repository.'}),Or(o)}l(Ul,"handleMigrationFlow");function jl(t){let e={name:t.name,template:t.template,version:t.version.versionNumber,buildTag:t.version.buildTag,env:null};if(t.version.envVars?.length){let r={};t.version.envVars.forEach(o=>{o.name&&o.value&&(r[o.name]=o.value)}),e.env=r}return e}l(jl,"updateLocalConfigStructure");var an=l(async(t,e)=>{let{data:r}=await Gl.get(t,{responseType:"arraybuffer"}),o=new Yl(Buffer.from(r,"binary"));o.extractEntryTo(o.getEntries()[0].entryName,e,!1)},"extractGitHubZip"),vt=class extends h{static name="pull";static description="Download Actor code to current directory. Clones Git repositories or fetches Actor files based on the source type.";static flags={version:A.string({char:"v",description:"Actor version number which will be pulled, e.g. 1.2. Default: the highest version",required:!1}),dir:A.string({description:"Directory where the Actor should be pulled to",required:!1})};static args={actorId:w.string({required:!1,description:'Name or ID of the Actor to run (e.g. "apify/hello-world" or "E2jjCZBezvAZnX8Rb"). If not provided, the command will update the Actor in the current directory based on its name in ".actor/actor.json" file.'})};async run(){let e=sn.cwd(),r=await Me({cwd:e});if(r.isErr()){m({message:r.unwrapErr().message}),sn.exitCode=5;return}let{config:o}=r.unwrap(),s=await k(),i=await S(),n=!this.args.actorId,a=s.username||s.id,c=this.args?.actorId||o?.id||(o?.name?`${a}/${o.name}`:void 0);if(!c)throw new Error("Cannot find Actor in this directory.");let d;try{d=await i.actor(c).get()}catch{throw new Error(`Cannot find Actor with ID/name '${c}' in your account.`)}if(!d)throw new Error(`Cannot find Actor with ID/name '${c}' in your account.`);let{name:u,versions:f}=d;if(d.isSourceCodeHidden&&!d.versions.length)throw new Error("You cannot pull source code of this Actor because you do not have permission to do so.");let p=null;if(this.flags.version&&(p=f.find(y=>y.versionNumber===this.flags.version),!p))throw new Error(`Cannot find version ${this.flags.version} of Actor ${c}.`);p||(p=f.reduce((y,b)=>Hl(`${b.versionNumber}.0`,`${y.versionNumber}.0`)?b:y));let g=n?e:Vl(e,this.flags.dir??u);if(rn(g,{recursive:!0}),!n&&Ml(g).length!==0){m({message:`Directory ${g} is not empty. Please empty it or choose another directory.`});return}switch(p.sourceType){case"TARBALL":{await an(p.tarballUrl,g);break}case"SOURCE_FILES":{let{sourceFiles:y}=p;for(let b of y){let C=Bl(b.name);if(rn(`${g}/${C}`,{recursive:!0}),!b.folder){let T=b.format==="BASE64"?Buffer.from(b.content,"base64").toString():b.content;if(b.name===M){let I=nn.parse(T);I.name=d.name,on(`${g}/${b.name}`,nn.update(T,I))}else on(`${g}/${b.name}`,T)}}break}case"GIT_REPO":{let{gitRepoUrl:y}=p,[b,C]=y.split("#"),T,I;C&&([T,I]=C.split(":"));let L=b;I&&(L+=`/${I}`),T&&(L+=`#${T}`);let D=Jl(L);try{await D.clone(g)}catch(j){throw new Error(`Failed to pull Actor from ${y}. ${j.message}`)}break}case"GITHUB_GIST":{await an(`${p.gitHubGistUrl}/archive/master.zip`,g);break}default:throw new Error(`Unknown source type: ${p.sourceType}`)}R({message:n?`Actor ${u} updated at ${g}/`:`Pulled to ${g}/`})}};import{readFileSync as Wl,statSync as zl,unlinkSync as Xl}from"fs";import{join as Zl,resolve as Ql}from"path";import rt from"process";import eu from"is-ci";import tu from"open";import{fetchManifest as ru}from"@apify/actor-templates";import{ACTOR_JOB_STATUSES as ot,ACTOR_SOURCE_TYPES as vs,MAX_MULTIFILE_BYTES as hn}from"@apify/consts";import{readFileSync as Kl,writeFileSync as ql}from"fs";var Ts="@",cn=100,ln=5e4,Nr=l(()=>{try{return JSON.parse(Kl(tr(),"utf-8"))||{}}catch{return{}}},"getSecretsFile"),un=l(t=>(Qe(tr()),ql(tr(),JSON.stringify(t,null," ")),t),"writeSecretsFile"),dn=l((t,e)=>{let r=Nr();if(r[t])throw new Error(`Secret with name ${t} already exists. Call "apify secrets rm ${t}" to remove it.`);if(typeof t!="string"||t.length>cn)throw new Error(`Secret name has to be string with maximum length ${cn}.`);if(typeof e!="string"||e.length>ln)throw new Error(`Secret value has to be string with maximum length ${ln}.`);return r[t]=e,un(r)},"addSecret"),mn=l(t=>{let e=Nr();if(!e[t])throw new Error(`Secret with name ${t} doesn't exist.`);delete e[t],un(e)},"removeSecret"),pn=l(t=>new RegExp(`^${Ts}.{1}`).test(t),"isSecretKey"),fn=l((t,e)=>{e=e||Nr();let r={};return Object.keys(t).forEach(o=>{if(pn(t[o])){let s=t[o].replace(new RegExp(`^${Ts}`),"");e[s]?r[o]=e[s]:x({message:`Value for ${s} not found in local secrets. Set it by calling "apify secrets add ${s} [SECRET_VALUE]"`})}else r[o]=t[o]}),r},"replaceSecretsValue"),gn=l((t,e)=>{e=e||Nr();let r=[];return Object.keys(t).forEach(o=>{if(pn(t[o])){let s=t[o].replace(new RegExp(`^${Ts}`),"");e[s]?r.push({name:o,value:e[s],isSecret:!0}):x({message:`Value for ${s} not found in local secrets. Set it by calling "apify secrets add ${s} [SECRET_VALUE]"`})}else r.push({name:o,value:t[o]})}),r},"transformEnvToEnvVars");var Ss="temp_file.zip",ou={build:"latest",memoryMbytes:4096,timeoutSecs:3600},yn="0.0",su="latest",St=class extends h{static name="push";static description=`Deploys Actor to Apify platform using settings from '${M}'.
75
75
  Files under '${hn/1024**2}' MB upload as "Multiple source files"; larger projects upload as ZIP file.
76
76
  Use --force to override newer remote versions.`;static flags={version:A.string({char:"v",description:`Actor version number to which the files should be pushed. By default, it is taken from the '${M}' file.`,required:!1}),"build-tag":A.string({char:"b",description:`Build tag to be applied to the successful Actor build. By default, it is taken from the '${M}' file`,required:!1}),"wait-for-finish":A.string({char:"w",description:"Seconds for waiting to build to finish, if no value passed, it waits forever.",required:!1}),"no-prompt":A.boolean({description:"Do not prompt for opening the Actor details in a browser. This will also not open the browser automatically.",default:!1,required:!1}),force:A.boolean({description:"Push an Actor even when the local files are older than the Actor on the platform.",default:!1,required:!1}),dir:A.string({description:"Directory where the Actor is located",required:!1})};static args={actorId:w.string({required:!1,description:`Name or ID of the Actor to push (e.g. "apify/hello-world" or "E2jjCZBezvAZnX8Rb"). If not provided, the command will create or modify the Actor with the name specified in '${M}' file.`})};async run(){let e=Ql(rt.cwd(),this.flags.dir??"."),r=await hi(e);if(!r.length){m({message:"You need to call this command from a folder that has an Actor in it!"}),rt.exitCode=4;return}if(![or,"actor.json",".actor/actor.json",".actor"].some(P=>r.some(Q=>Q===P||Q.startsWith(P)))){m({message:["A valid Actor could not be found in the current directory. Please make sure you are in the correct directory.","You can also turn this directory into an Actor by running `apify init`."].join(`
77
77
  `)}),rt.exitCode=4;return}let o=await S(),s=await Me({cwd:e});if(s.isErr()){m({message:s.unwrapErr().message}),rt.exitCode=5;return}let{config:i}=s.unwrap(),n=await k(),c=!!n.organizationOwnerUserId?`/organization/${n.id}`:"",d,u,f=!1,p=this.flags.version||i?.version||yn,g=this.flags.buildTag||i?.buildTag;!g&&p===yn&&(g=su);let y=Number.isNaN(this.flags.waitForFinish)?void 0:Number.parseInt(this.flags.waitForFinish,10)*1e3,b=this.args.actorId;if(b){if(u=await o.actor(b).get(),!u)throw new Error(`Cannot find Actor with ID '${b}' in your account.`);d=u.id}else{let P=n.username||n.id;if(u=await o.actor(`${P}/${i.name}`).get(),u)d=u.id;else{let{templates:Q}=await ru(),Le=Q.find(Qt=>Qt.name===i.template)?.defaultRunOptions||ou,Zo={name:i.name,defaultRunOptions:Le,versions:[{versionNumber:p,buildTag:g,sourceType:vs.SOURCE_FILES,sourceFiles:[]}]};u=await o.actors().create(Zo),d=u.id,f=!0,v({message:`Created Actor with name ${i.name} on Apify.`})}}v({message:`Deploying Actor '${i.name}' to Apify.`});let C=await si(r,e),T=o.actor(d),I,L,D;if(C<hn){let P=await T.get();if(!f){let Q=r.reduce((Le,Zo)=>{let{mtimeMs:Qt,ctimeMs:Hs}=zl(Zl(e,Zo)),Js=Qt>Hs?Qt:Hs;return Le>Js?Le:Js},0),he=P?.modifiedAt.valueOf();if(!this.flags.force&&he&&Q<he&&(i?.name||b))throw new Error(`Actor with identifier "${i?.name||b}" is already on the platform and was modified there since modified locally.
@@ -233,4 +233,4 @@ Customize with --memory and --timeout flags.
233
233
  4. INPUT_SCHEMA.json
234
234
 
235
235
  Optionally specify custom schema path to validate.`;static args={path:w.string({required:!1,description:"Optional path to your INPUT_SCHEMA.json file. If not provided ./INPUT_SCHEMA.json is used."})};static hiddenAliases=["vis"];async run(){let{inputSchema:e,inputSchemaPath:r}=await nt({forcePath:this.args.path,cwd:lm.cwd()});if(!e)throw new Error(`Input schema has not been found at ${r}.`);r?v({message:`Validating input schema stored at ${r}`}):v({message:`Validating input schema embedded in '${M}'`});let o=new lt({strict:!1});um(o,e),R({message:"Input schema is valid."})}};var N_=[vr,Pr,Mr,ao,Io,xo,Ho,qo,zo,Br,Kt,Jt,Xr,co,uo,go,fo,$o,Eo,Ro,_o,Po,Xo,Wt],L_=[yt,ht,gt,ft,pt,mt,Wt,Kt,Jt];export{br as a,Kf as b,qf as c,N_ as d,L_ as e};
236
- //# sourceMappingURL=chunk-A3JEYXK4.js.map
236
+ //# sourceMappingURL=chunk-BQP4A7WO.js.map