apify-cli 0.14.2-beta.4 → 0.15.0-beta.1

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/README.md CHANGED
@@ -298,7 +298,7 @@ USAGE
298
298
  $ apify actor
299
299
  ```
300
300
 
301
- _See code: [src/commands/actor/index.js](https://github.com/apify/apify-cli/blob/v0.14.2/src/commands/actor/index.js)_
301
+ _See code: [src/commands/actor/index.js](https://github.com/apify/apify-cli/blob/v0.15.0/src/commands/actor/index.js)_
302
302
 
303
303
  ## `apify actor:get-input`
304
304
 
@@ -309,7 +309,7 @@ USAGE
309
309
  $ apify actor:get-input
310
310
  ```
311
311
 
312
- _See code: [src/commands/actor/get-input.js](https://github.com/apify/apify-cli/blob/v0.14.2/src/commands/actor/get-input.js)_
312
+ _See code: [src/commands/actor/get-input.js](https://github.com/apify/apify-cli/blob/v0.15.0/src/commands/actor/get-input.js)_
313
313
 
314
314
  ## `apify actor:get-value KEY`
315
315
 
@@ -323,7 +323,7 @@ ARGUMENTS
323
323
  KEY Key of the record in key-value store
324
324
  ```
325
325
 
326
- _See code: [src/commands/actor/get-value.js](https://github.com/apify/apify-cli/blob/v0.14.2/src/commands/actor/get-value.js)_
326
+ _See code: [src/commands/actor/get-value.js](https://github.com/apify/apify-cli/blob/v0.15.0/src/commands/actor/get-value.js)_
327
327
 
328
328
  ## `apify actor:push-data [ITEM]`
329
329
 
@@ -344,7 +344,7 @@ DESCRIPTION
344
344
  $ cat ./test.json | apify actor:push-data
345
345
  ```
346
346
 
347
- _See code: [src/commands/actor/push-data.js](https://github.com/apify/apify-cli/blob/v0.14.2/src/commands/actor/push-data.js)_
347
+ _See code: [src/commands/actor/push-data.js](https://github.com/apify/apify-cli/blob/v0.15.0/src/commands/actor/push-data.js)_
348
348
 
349
349
  ## `apify actor:set-value KEY [VALUE]`
350
350
 
@@ -374,7 +374,7 @@ DESCRIPTION
374
374
  $ cat ./my-text-file.txt | apify actor:set-value KEY --contentType text/plain
375
375
  ```
376
376
 
377
- _See code: [src/commands/actor/set-value.js](https://github.com/apify/apify-cli/blob/v0.14.2/src/commands/actor/set-value.js)_
377
+ _See code: [src/commands/actor/set-value.js](https://github.com/apify/apify-cli/blob/v0.15.0/src/commands/actor/set-value.js)_
378
378
 
379
379
  ## `apify call [ACTID]`
380
380
 
@@ -399,7 +399,7 @@ DESCRIPTION
399
399
  takes input for the actor from the default local key-value store by default.
400
400
  ```
401
401
 
402
- _See code: [src/commands/call.js](https://github.com/apify/apify-cli/blob/v0.14.2/src/commands/call.js)_
402
+ _See code: [src/commands/call.js](https://github.com/apify/apify-cli/blob/v0.15.0/src/commands/call.js)_
403
403
 
404
404
  ## `apify create [ACTORNAME]`
405
405
 
@@ -421,7 +421,7 @@ OPTIONS
421
421
  --skip-dependency-install Skip installing actor dependencies.
422
422
  ```
423
423
 
424
- _See code: [src/commands/create.js](https://github.com/apify/apify-cli/blob/v0.14.2/src/commands/create.js)_
424
+ _See code: [src/commands/create.js](https://github.com/apify/apify-cli/blob/v0.15.0/src/commands/create.js)_
425
425
 
426
426
  ## `apify info`
427
427
 
@@ -435,7 +435,7 @@ DESCRIPTION
435
435
  The information is printed to the console.
436
436
  ```
437
437
 
438
- _See code: [src/commands/info.js](https://github.com/apify/apify-cli/blob/v0.14.2/src/commands/info.js)_
438
+ _See code: [src/commands/info.js](https://github.com/apify/apify-cli/blob/v0.15.0/src/commands/info.js)_
439
439
 
440
440
  ## `apify init [ACTORNAME]`
441
441
 
@@ -455,7 +455,7 @@ DESCRIPTION
455
455
  WARNING: The directory at "storage" will be overwritten if it already exists.
456
456
  ```
457
457
 
458
- _See code: [src/commands/init.js](https://github.com/apify/apify-cli/blob/v0.14.2/src/commands/init.js)_
458
+ _See code: [src/commands/init.js](https://github.com/apify/apify-cli/blob/v0.15.0/src/commands/init.js)_
459
459
 
460
460
  ## `apify login`
461
461
 
@@ -473,7 +473,7 @@ DESCRIPTION
473
473
  "apify" commands. To log out, call "apify logout".
474
474
  ```
475
475
 
476
- _See code: [src/commands/login.js](https://github.com/apify/apify-cli/blob/v0.14.2/src/commands/login.js)_
476
+ _See code: [src/commands/login.js](https://github.com/apify/apify-cli/blob/v0.15.0/src/commands/login.js)_
477
477
 
478
478
  ## `apify logout`
479
479
 
@@ -488,7 +488,7 @@ DESCRIPTION
488
488
  call "apify login".
489
489
  ```
490
490
 
491
- _See code: [src/commands/logout.js](https://github.com/apify/apify-cli/blob/v0.14.2/src/commands/logout.js)_
491
+ _See code: [src/commands/logout.js](https://github.com/apify/apify-cli/blob/v0.15.0/src/commands/logout.js)_
492
492
 
493
493
  ## `apify push [ACTORID]`
494
494
 
@@ -523,7 +523,7 @@ DESCRIPTION
523
523
  WARNING: If the target actor already exists in your Apify account, it will be overwritten!
524
524
  ```
525
525
 
526
- _See code: [src/commands/push.js](https://github.com/apify/apify-cli/blob/v0.14.2/src/commands/push.js)_
526
+ _See code: [src/commands/push.js](https://github.com/apify/apify-cli/blob/v0.15.0/src/commands/push.js)_
527
527
 
528
528
  ## `apify run`
529
529
 
@@ -553,7 +553,7 @@ DESCRIPTION
553
553
  You can set up your own main file or environment variables by changing it.
554
554
  ```
555
555
 
556
- _See code: [src/commands/run.js](https://github.com/apify/apify-cli/blob/v0.14.2/src/commands/run.js)_
556
+ _See code: [src/commands/run.js](https://github.com/apify/apify-cli/blob/v0.15.0/src/commands/run.js)_
557
557
 
558
558
  ## `apify secrets`
559
559
 
@@ -581,7 +581,7 @@ DESCRIPTION
581
581
  of the actor.
582
582
  ```
583
583
 
584
- _See code: [src/commands/secrets/index.js](https://github.com/apify/apify-cli/blob/v0.14.2/src/commands/secrets/index.js)_
584
+ _See code: [src/commands/secrets/index.js](https://github.com/apify/apify-cli/blob/v0.15.0/src/commands/secrets/index.js)_
585
585
 
586
586
  ## `apify secrets:add NAME VALUE`
587
587
 
@@ -599,7 +599,7 @@ DESCRIPTION
599
599
  The secrets are stored to a file at ~/.apify
600
600
  ```
601
601
 
602
- _See code: [src/commands/secrets/add.js](https://github.com/apify/apify-cli/blob/v0.14.2/src/commands/secrets/add.js)_
602
+ _See code: [src/commands/secrets/add.js](https://github.com/apify/apify-cli/blob/v0.15.0/src/commands/secrets/add.js)_
603
603
 
604
604
  ## `apify secrets:rm NAME`
605
605
 
@@ -613,7 +613,7 @@ ARGUMENTS
613
613
  NAME Name of the secret
614
614
  ```
615
615
 
616
- _See code: [src/commands/secrets/rm.js](https://github.com/apify/apify-cli/blob/v0.14.2/src/commands/secrets/rm.js)_
616
+ _See code: [src/commands/secrets/rm.js](https://github.com/apify/apify-cli/blob/v0.15.0/src/commands/secrets/rm.js)_
617
617
 
618
618
  ## `apify vis [PATH]`
619
619
 
@@ -637,5 +637,5 @@ DESCRIPTION
637
637
  You can also pass any custom path to your input schema to have it validated instead.
638
638
  ```
639
639
 
640
- _See code: [src/commands/vis.js](https://github.com/apify/apify-cli/blob/v0.14.2/src/commands/vis.js)_
640
+ _See code: [src/commands/vis.js](https://github.com/apify/apify-cli/blob/v0.15.0/src/commands/vis.js)_
641
641
  <!-- commandsstop -->
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "apify-cli",
3
- "version": "0.14.2",
3
+ "version": "0.15.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "apify-cli",
9
- "version": "0.14.2",
9
+ "version": "0.15.0",
10
10
  "hasInstallScript": true,
11
11
  "license": "Apache-2.0",
12
12
  "dependencies": {
@@ -1 +1 @@
1
- {"version":"0.14.2","commands":{"call":{"id":"call","description":"Runs a specific actor remotely on the Apify cloud platform.\nThe actor is run under your current Apify account. Therefore you need to be logged in by calling \"apify login\". It takes input for the actor from the default local key-value store by default.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"build":{"name":"build","type":"option","char":"b","description":"Tag or number of the build to run (e.g. \"latest\" or \"1.2.34\").","required":false},"timeout":{"name":"timeout","type":"option","char":"t","description":"Timeout for the actor run in seconds. Zero value means there is no timeout.","required":false},"memory":{"name":"memory","type":"option","char":"m","description":"Amount of memory allocated for the actor run, in megabytes.","required":false},"wait-for-finish":{"name":"wait-for-finish","type":"option","char":"w","description":"Seconds for waiting to run to finish, if no value passed, it waits forever.","required":false}},"args":[{"name":"actId","description":"Name or ID of the actor to run (e.g. \"apify/hello-world\" or \"E2jjCZBezvAZnX8Rb\"). If not provided, the command runs the remote actor specified in the \".actor/actor.json\" file.","required":false}]},"check-version":{"id":"check-version","description":"Checks that installed Apify CLI version is up to date.","pluginName":"apify-cli","pluginType":"core","hidden":true,"aliases":["cv"],"flags":{"enforce-update":{"name":"enforce-update","type":"boolean","char":"e","description":"[Optional] Enforce version update from NPM","required":false,"allowNo":false}},"args":[]},"create":{"id":"create","description":"Creates a new actor project directory from a selected boilerplate template.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"template":{"name":"template","type":"option","char":"t","description":"Template for the actor. If not provided, the command will prompt for it.\nVisit https://raw.githubusercontent.com/apify/actor-templates/master/templates/manifest.json to find available template names.","required":false},"skip-dependency-install":{"name":"skip-dependency-install","type":"boolean","description":"Skip installing actor dependencies.","required":false,"allowNo":false},"template-archive-url":{"name":"template-archive-url","type":"option","description":"Actor template archive url. Useful for developing new templates.","hidden":true,"required":false}},"args":[{"name":"actorName","description":"Name of the actor and its directory","required":false}]},"edit-input-schema":{"id":"edit-input-schema","description":"Lets you edit your input schema that would be used on the platform in a visual input schema editor.","pluginName":"apify-cli","pluginType":"core","hidden":true,"aliases":["eis"],"flags":{},"args":[{"name":"path","description":"Optional path to your INPUT_SCHEMA.json file. If not provided default platform location for input schema is used.","required":false}]},"info":{"id":"info","description":"Displays information about the currently active Apify account.\nThe information is printed to the console.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"init":{"id":"init","description":"Initializes a new actor project in an existing directory.\nThe command only creates the \".actor/actor.json\" file and the \"storage\" directory in the current directory, but will not touch anything else.\n\nWARNING: The directory at \"storage\" will be overwritten if it already exists.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"actorName","description":"Name of the actor. If not provided, you will be prompted for it.","required":false}]},"login-new":{"id":"login-new","description":"Logs in to your Apify account using your API token.\nThe API token and other account information is stored in the ~/.apify directory, from where it is read by all other \"apify\" commands. To log out, call \"apify logout\".","pluginName":"apify-cli","pluginType":"core","hidden":true,"aliases":[],"flags":{"token":{"name":"token","type":"option","char":"t","description":"[Optional] Apify API token","required":false}},"args":[]},"login":{"id":"login","description":"Logs in to your Apify account using a provided API token.\nThe API token and other account information is stored in the ~/.apify directory, from where it is read by all other \"apify\" commands. To log out, call \"apify logout\".","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"token":{"name":"token","type":"option","char":"t","description":"[Optional] Apify API token","required":false}},"args":[]},"logout":{"id":"logout","description":"Logs out of your Apify account.\nThe command deletes the API token and all other account information stored in the ~/.apify directory. To log in again, call \"apify login\".","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"push":{"id":"push","description":"Uploads the actor to the Apify platform and builds it there.\nThe actor settings are read from the \".actor/actor.json\" file in the current directory, but they can be overridden using command-line options.\nNOTE: If the source files are smaller than 3 MB then they are uploaded as \n\"Multiple source files\", otherwise they are uploaded as \"Zip file\".\n\nWARNING: If the target actor already exists in your Apify account, it will be overwritten!","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"version-number":{"name":"version-number","type":"option","description":"DEPRECATED: Use flag version instead. Actor version number to which the files should be pushed. By default, it is taken from the \".actor/actor.json\" file.","required":false},"version":{"name":"version","type":"option","char":"v","description":"Actor version number to which the files should be pushed. By default, it is taken from the \".actor/actor.json\" file.","required":false},"build-tag":{"name":"build-tag","type":"option","char":"b","description":"Build tag to be applied to the successful actor build. By default, it is taken from the \".actor/actor.json\" file","required":false},"wait-for-finish":{"name":"wait-for-finish","type":"option","char":"w","description":"Seconds for waiting to build to finish, if no value passed, it waits forever.","required":false}},"args":[{"name":"actorId","description":"ID of an existing actor on the Apify platform where the files will be pushed. If not provided, the command will create or modify the actor with the name specified in \".actor/actor.json\" file.","required":false}]},"run":{"id":"run","description":"Runs the actor locally in the current directory by executing \"npm start\".\nIt sets various APIFY_XYZ environment variables in order to provide a working execution environment for the actor. For example, this causes the actor input, as well as all other data in key-value stores, datasets or request queues to be stored in the \"storage\" directory, rather than on the Apify platform.\n\nNOTE: You can override the command's default behavior by overriding the npm start script value in a package.json file. You can set up your own main file or environment variables by changing it.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"purge":{"name":"purge","type":"boolean","char":"p","description":"Shortcut that combines the --purge-queue, --purge-dataset and --purge-key-value-store options.","required":false,"allowNo":false},"purge-queue":{"name":"purge-queue","type":"boolean","description":"Deletes the local directory containing the default request queue before the run starts.","required":false,"allowNo":false},"purge-dataset":{"name":"purge-dataset","type":"boolean","description":"Deletes the local directory containing the default dataset before the run starts.","required":false,"allowNo":false},"purge-key-value-store":{"name":"purge-key-value-store","type":"boolean","description":"Deletes all records from the default key-value store in the local directory before the run starts, except for the \"INPUT\" key.","required":false,"allowNo":false}},"args":[]},"vis":{"id":"vis","description":"Validates input schema and prints errors found.\nThe input schema for the actor is used from these locations in order of preference.\nThe first one found is validated as it would be the one used on the Apify platform.\n1. Directly embedded object in \".actor/actor.json\" under 'input' key\n2. Path to JSON file referenced in \".actor/actor.json\" under 'input' key\n3. JSON file at .actor/INPUT_SCHEMA.json\n4. JSON file at INPUT_SCHEMA.json\n\nYou can also pass any custom path to your input schema to have it validated instead.\n","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"path","description":"Optional path to your INPUT_SCHEMA.json file. If not provided ./INPUT_SCHEMA.json is used.","required":false}]},"actor:get-input":{"id":"actor:get-input","description":"Gets the actor input value from the default key-value store associated with the actor run.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"actor:get-value":{"id":"actor:get-value","description":"Gets a value from the default key-value store associated with the actor run.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"key","description":"Key of the record in key-value store","required":true}]},"actor":{"id":"actor","description":"Commands are designed to be used in actor runs. All commands are in PoC state, do not use in production environments.\n","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"actor:push-data":{"id":"actor:push-data","description":"Stores an object or an array of objects to the default dataset of the actor run.\nIt is possible to pass data using item argument or stdin.\nPassing data using argument:\n$ apify actor:push-data {\"foo\": \"bar\"}\nPassing data using stdin with pipe:\n$ cat ./test.json | apify actor:push-data\n","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"item","description":"JSON string with one object or array of objects containing data to be stored in the default dataset.","required":false}]},"actor:set-value":{"id":"actor:set-value","description":"Sets or removes record into the default KeyValueStore associated with the actor run.\nIt is possible to pass data using argument or stdin.\nPassing data using argument:\n$ apify actor:set-value KEY my-value\nPassing data using stdin with pipe:\n$ cat ./my-text-file.txt | apify actor:set-value KEY --contentType text/plain\n","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"contentType":{"name":"contentType","type":"option","char":"c","description":"Specifies a custom MIME content type of the record. By default \"application/json\" is used.","required":false}},"args":[{"name":"key","description":"Key of the record in key-value store.","required":true},{"name":"value","description":"Record data, which can be one of the following values:\n- If empty, the record in the key-value store is deleted.\n- If no `contentType` flag is specified, value is expected to be any JSON string value.\n- If options.contentType is set, value is taken as is.","required":false}]},"secrets:add":{"id":"secrets:add","description":"Adds a new secret value.\nThe secrets are stored to a file at ~/.apify","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"name","description":"Name of the secret","required":true},{"name":"value","description":"Value of the secret","required":true}]},"secrets":{"id":"secrets","description":"Manages secret values for actor environment variables.\n\nExample:\n$ apify secrets:add mySecret TopSecretValue123\n\nNow the \"mySecret\" value can be used in an environment variable defined in \".actor/actor.json\" file by adding the \"@\" prefix:\n\n{\n \"actorSpecification\": 1,\n \"name\": \"my_actor\",\n \"environmentVariables\": { \"SECRET_ENV_VAR\": \"@mySecret\" },\n \"version\": \"0.1\n}\n\nWhen the actor is pushed to Apify cloud, the \"SECRET_ENV_VAR\" and its value is stored as a secret environment variable of the actor.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"secrets:rm":{"id":"secrets:rm","description":"Removes the secret.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"name","description":"Name of the secret","required":true}]}}}
1
+ {"version":"0.15.0","commands":{"call":{"id":"call","description":"Runs a specific actor remotely on the Apify cloud platform.\nThe actor is run under your current Apify account. Therefore you need to be logged in by calling \"apify login\". It takes input for the actor from the default local key-value store by default.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"build":{"name":"build","type":"option","char":"b","description":"Tag or number of the build to run (e.g. \"latest\" or \"1.2.34\").","required":false},"timeout":{"name":"timeout","type":"option","char":"t","description":"Timeout for the actor run in seconds. Zero value means there is no timeout.","required":false},"memory":{"name":"memory","type":"option","char":"m","description":"Amount of memory allocated for the actor run, in megabytes.","required":false},"wait-for-finish":{"name":"wait-for-finish","type":"option","char":"w","description":"Seconds for waiting to run to finish, if no value passed, it waits forever.","required":false}},"args":[{"name":"actId","description":"Name or ID of the actor to run (e.g. \"apify/hello-world\" or \"E2jjCZBezvAZnX8Rb\"). If not provided, the command runs the remote actor specified in the \".actor/actor.json\" file.","required":false}]},"check-version":{"id":"check-version","description":"Checks that installed Apify CLI version is up to date.","pluginName":"apify-cli","pluginType":"core","hidden":true,"aliases":["cv"],"flags":{"enforce-update":{"name":"enforce-update","type":"boolean","char":"e","description":"[Optional] Enforce version update from NPM","required":false,"allowNo":false}},"args":[]},"create":{"id":"create","description":"Creates a new actor project directory from a selected boilerplate template.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"template":{"name":"template","type":"option","char":"t","description":"Template for the actor. If not provided, the command will prompt for it.\nVisit https://raw.githubusercontent.com/apify/actor-templates/master/templates/manifest.json to find available template names.","required":false},"skip-dependency-install":{"name":"skip-dependency-install","type":"boolean","description":"Skip installing actor dependencies.","required":false,"allowNo":false},"template-archive-url":{"name":"template-archive-url","type":"option","description":"Actor template archive url. Useful for developing new templates.","hidden":true,"required":false}},"args":[{"name":"actorName","description":"Name of the actor and its directory","required":false}]},"edit-input-schema":{"id":"edit-input-schema","description":"Lets you edit your input schema that would be used on the platform in a visual input schema editor.","pluginName":"apify-cli","pluginType":"core","hidden":true,"aliases":["eis"],"flags":{},"args":[{"name":"path","description":"Optional path to your INPUT_SCHEMA.json file. If not provided default platform location for input schema is used.","required":false}]},"info":{"id":"info","description":"Displays information about the currently active Apify account.\nThe information is printed to the console.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"init":{"id":"init","description":"Initializes a new actor project in an existing directory.\nThe command only creates the \".actor/actor.json\" file and the \"storage\" directory in the current directory, but will not touch anything else.\n\nWARNING: The directory at \"storage\" will be overwritten if it already exists.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"actorName","description":"Name of the actor. If not provided, you will be prompted for it.","required":false}]},"login-new":{"id":"login-new","description":"Logs in to your Apify account using your API token.\nThe API token and other account information is stored in the ~/.apify directory, from where it is read by all other \"apify\" commands. To log out, call \"apify logout\".","pluginName":"apify-cli","pluginType":"core","hidden":true,"aliases":[],"flags":{"token":{"name":"token","type":"option","char":"t","description":"[Optional] Apify API token","required":false}},"args":[]},"login":{"id":"login","description":"Logs in to your Apify account using a provided API token.\nThe API token and other account information is stored in the ~/.apify directory, from where it is read by all other \"apify\" commands. To log out, call \"apify logout\".","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"token":{"name":"token","type":"option","char":"t","description":"[Optional] Apify API token","required":false}},"args":[]},"logout":{"id":"logout","description":"Logs out of your Apify account.\nThe command deletes the API token and all other account information stored in the ~/.apify directory. To log in again, call \"apify login\".","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"push":{"id":"push","description":"Uploads the actor to the Apify platform and builds it there.\nThe actor settings are read from the \".actor/actor.json\" file in the current directory, but they can be overridden using command-line options.\nNOTE: If the source files are smaller than 3 MB then they are uploaded as \n\"Multiple source files\", otherwise they are uploaded as \"Zip file\".\n\nWARNING: If the target actor already exists in your Apify account, it will be overwritten!","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"version-number":{"name":"version-number","type":"option","description":"DEPRECATED: Use flag version instead. Actor version number to which the files should be pushed. By default, it is taken from the \".actor/actor.json\" file.","required":false},"version":{"name":"version","type":"option","char":"v","description":"Actor version number to which the files should be pushed. By default, it is taken from the \".actor/actor.json\" file.","required":false},"build-tag":{"name":"build-tag","type":"option","char":"b","description":"Build tag to be applied to the successful actor build. By default, it is taken from the \".actor/actor.json\" file","required":false},"wait-for-finish":{"name":"wait-for-finish","type":"option","char":"w","description":"Seconds for waiting to build to finish, if no value passed, it waits forever.","required":false}},"args":[{"name":"actorId","description":"ID of an existing actor on the Apify platform where the files will be pushed. If not provided, the command will create or modify the actor with the name specified in \".actor/actor.json\" file.","required":false}]},"run":{"id":"run","description":"Runs the actor locally in the current directory by executing \"npm start\".\nIt sets various APIFY_XYZ environment variables in order to provide a working execution environment for the actor. For example, this causes the actor input, as well as all other data in key-value stores, datasets or request queues to be stored in the \"storage\" directory, rather than on the Apify platform.\n\nNOTE: You can override the command's default behavior by overriding the npm start script value in a package.json file. You can set up your own main file or environment variables by changing it.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"purge":{"name":"purge","type":"boolean","char":"p","description":"Shortcut that combines the --purge-queue, --purge-dataset and --purge-key-value-store options.","required":false,"allowNo":false},"purge-queue":{"name":"purge-queue","type":"boolean","description":"Deletes the local directory containing the default request queue before the run starts.","required":false,"allowNo":false},"purge-dataset":{"name":"purge-dataset","type":"boolean","description":"Deletes the local directory containing the default dataset before the run starts.","required":false,"allowNo":false},"purge-key-value-store":{"name":"purge-key-value-store","type":"boolean","description":"Deletes all records from the default key-value store in the local directory before the run starts, except for the \"INPUT\" key.","required":false,"allowNo":false}},"args":[]},"vis":{"id":"vis","description":"Validates input schema and prints errors found.\nThe input schema for the actor is used from these locations in order of preference.\nThe first one found is validated as it would be the one used on the Apify platform.\n1. Directly embedded object in \".actor/actor.json\" under 'input' key\n2. Path to JSON file referenced in \".actor/actor.json\" under 'input' key\n3. JSON file at .actor/INPUT_SCHEMA.json\n4. JSON file at INPUT_SCHEMA.json\n\nYou can also pass any custom path to your input schema to have it validated instead.\n","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"path","description":"Optional path to your INPUT_SCHEMA.json file. If not provided ./INPUT_SCHEMA.json is used.","required":false}]},"actor:get-input":{"id":"actor:get-input","description":"Gets the actor input value from the default key-value store associated with the actor run.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"actor:get-value":{"id":"actor:get-value","description":"Gets a value from the default key-value store associated with the actor run.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"key","description":"Key of the record in key-value store","required":true}]},"actor":{"id":"actor","description":"Commands are designed to be used in actor runs. All commands are in PoC state, do not use in production environments.\n","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"actor:push-data":{"id":"actor:push-data","description":"Stores an object or an array of objects to the default dataset of the actor run.\nIt is possible to pass data using item argument or stdin.\nPassing data using argument:\n$ apify actor:push-data {\"foo\": \"bar\"}\nPassing data using stdin with pipe:\n$ cat ./test.json | apify actor:push-data\n","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"item","description":"JSON string with one object or array of objects containing data to be stored in the default dataset.","required":false}]},"actor:set-value":{"id":"actor:set-value","description":"Sets or removes record into the default KeyValueStore associated with the actor run.\nIt is possible to pass data using argument or stdin.\nPassing data using argument:\n$ apify actor:set-value KEY my-value\nPassing data using stdin with pipe:\n$ cat ./my-text-file.txt | apify actor:set-value KEY --contentType text/plain\n","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"contentType":{"name":"contentType","type":"option","char":"c","description":"Specifies a custom MIME content type of the record. By default \"application/json\" is used.","required":false}},"args":[{"name":"key","description":"Key of the record in key-value store.","required":true},{"name":"value","description":"Record data, which can be one of the following values:\n- If empty, the record in the key-value store is deleted.\n- If no `contentType` flag is specified, value is expected to be any JSON string value.\n- If options.contentType is set, value is taken as is.","required":false}]},"secrets:add":{"id":"secrets:add","description":"Adds a new secret value.\nThe secrets are stored to a file at ~/.apify","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"name","description":"Name of the secret","required":true},{"name":"value","description":"Value of the secret","required":true}]},"secrets":{"id":"secrets","description":"Manages secret values for actor environment variables.\n\nExample:\n$ apify secrets:add mySecret TopSecretValue123\n\nNow the \"mySecret\" value can be used in an environment variable defined in \".actor/actor.json\" file by adding the \"@\" prefix:\n\n{\n \"actorSpecification\": 1,\n \"name\": \"my_actor\",\n \"environmentVariables\": { \"SECRET_ENV_VAR\": \"@mySecret\" },\n \"version\": \"0.1\n}\n\nWhen the actor is pushed to Apify cloud, the \"SECRET_ENV_VAR\" and its value is stored as a secret environment variable of the actor.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"secrets:rm":{"id":"secrets:rm","description":"Removes the secret.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"name","description":"Name of the secret","required":true}]}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apify-cli",
3
- "version": "0.14.2-beta.4",
3
+ "version": "0.15.0-beta.1",
4
4
  "description": "Apify command-line interface helps you create, develop, build and run Apify actors, and manage the Apify cloud platform.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -3,6 +3,7 @@ const fs = require('fs');
3
3
  const path = require('path');
4
4
  const actorTemplates = require('@apify/actor-templates');
5
5
  const unzipper = require('unzipper');
6
+ const semver = require('semver');
6
7
  const { ApifyCommand } = require('../lib/apify_command');
7
8
  const execWithLog = require('../lib/exec');
8
9
  const outputs = require('../lib/outputs');
@@ -15,8 +16,10 @@ const {
15
16
  detectPythonVersion,
16
17
  isPythonVersionSupported,
17
18
  getPythonCommand,
19
+ detectNodeVersion,
20
+ isNodeVersionSupported,
18
21
  } = require('../lib/utils');
19
- const { EMPTY_LOCAL_CONFIG, LOCAL_CONFIG_PATH, PYTHON_VENV_PATH } = require('../lib/consts');
22
+ const { EMPTY_LOCAL_CONFIG, LOCAL_CONFIG_PATH, PYTHON_VENV_PATH, SUPPORTED_NODEJS_VERSION } = require('../lib/consts');
20
23
  const { httpsGet, ensureValidActorName, getTemplateDefinition } = require('../lib/create-utils');
21
24
 
22
25
  class CreateCommand extends ApifyCommand {
@@ -76,14 +79,25 @@ class CreateCommand extends ApifyCommand {
76
79
  let dependenciesInstalled = false;
77
80
  if (!skipDependencyInstall) {
78
81
  if (fs.existsSync(packageJsonPath)) {
79
- // If the actor is a Node.js actor (has package.json), run `npm install`
80
- await updateLocalJson(packageJsonPath, { name: actorName });
81
- // Run npm install in actor dir.
82
- // For efficiency, don't install Puppeteer for templates that don't use it
83
- const cmdArgs = ['install'];
84
- if (skipOptionalDeps) cmdArgs.push('--no-optional');
85
- await execWithLog(getNpmCmd(), cmdArgs, { cwd: actFolderDir });
86
- dependenciesInstalled = true;
82
+ const currentNodeVersion = detectNodeVersion();
83
+ const minimumSupportedNodeVersion = semver.minVersion(SUPPORTED_NODEJS_VERSION);
84
+ if (currentNodeVersion) {
85
+ if (!isNodeVersionSupported(currentNodeVersion)) {
86
+ outputs.warning(`You are running Node.js version ${currentNodeVersion}, which is no longer supported. `
87
+ + `Please upgrade to Node.js version ${minimumSupportedNodeVersion} or later.`);
88
+ }
89
+ // If the actor is a Node.js actor (has package.json), run `npm install`
90
+ await updateLocalJson(packageJsonPath, { name: actorName });
91
+ // Run npm install in actor dir.
92
+ // For efficiency, don't install Puppeteer for templates that don't use it
93
+ const cmdArgs = ['install'];
94
+ if (skipOptionalDeps) cmdArgs.push('--no-optional');
95
+ await execWithLog(getNpmCmd(), cmdArgs, { cwd: actFolderDir });
96
+ dependenciesInstalled = true;
97
+ } else {
98
+ outputs.error(`No Node.js detected! Please install Node.js ${minimumSupportedNodeVersion} or higher`
99
+ + ' to be able to run Node.js actors locally.');
100
+ }
87
101
  } else if (fs.existsSync(requirementsTxtPath)) {
88
102
  const pythonVersion = detectPythonVersion(actFolderDir);
89
103
  if (pythonVersion) {
@@ -11,6 +11,7 @@ const {
11
11
  getLocalUserInfo, purgeDefaultQueue, purgeDefaultKeyValueStore,
12
12
  purgeDefaultDataset, getLocalConfigOrThrow, getNpmCmd, checkIfStorageIsEmpty,
13
13
  detectPythonVersion, isPythonVersionSupported, getPythonCommand,
14
+ detectNodeVersion, isNodeVersionSupported,
14
15
  } = require('../lib/utils');
15
16
  const { error, info, warning } = require('../lib/outputs');
16
17
  const { replaceSecretsValue } = require('../lib/secrets');
@@ -86,26 +87,30 @@ class RunCommand extends ApifyCommand {
86
87
  }
87
88
 
88
89
  if (packageJsonExists) { // Actor is written in Node.js
89
- const serverJsFile = path.join(cwd, 'server.js');
90
- const packageJson = await loadJson(packageJsonPath);
91
- if ((!packageJson.scripts || !packageJson.scripts.start) && !fs.existsSync(serverJsFile)) {
92
- throw new Error('The "npm start" script was not found in package.json. Please set it up for your project. '
93
- + 'For more information about that call "apify help run".');
94
- }
90
+ const currentNodeVersion = detectNodeVersion();
91
+ const minimumSupportedNodeVersion = semver.minVersion(SUPPORTED_NODEJS_VERSION);
92
+ if (currentNodeVersion) {
93
+ const serverJsFile = path.join(cwd, 'server.js');
94
+ const packageJson = await loadJson(packageJsonPath);
95
+ if ((!packageJson.scripts || !packageJson.scripts.start) && !fs.existsSync(serverJsFile)) {
96
+ throw new Error('The "npm start" script was not found in package.json. Please set it up for your project. '
97
+ + 'For more information about that call "apify help run".');
98
+ }
95
99
 
96
- // --max-http-header-size=80000
97
- // Increases default size of headers. The original limit was 80kb, but from node 10+ they decided to lower it to 8kb.
98
- // However they did not think about all the sites there with large headers,
99
- // so we put back the old limit of 80kb, which seems to work just fine.
100
- const currentNodeVersion = process.versions.node;
101
- const lastSupportedVersion = semver.minVersion(SUPPORTED_NODEJS_VERSION);
102
- if (semver.gte(currentNodeVersion, lastSupportedVersion)) {
103
- env.NODE_OPTIONS = env.NODE_OPTIONS ? `${env.NODE_OPTIONS} --max-http-header-size=80000` : '--max-http-header-size=80000';
100
+ // --max-http-header-size=80000
101
+ // Increases default size of headers. The original limit was 80kb, but from node 10+ they decided to lower it to 8kb.
102
+ // However they did not think about all the sites there with large headers,
103
+ // so we put back the old limit of 80kb, which seems to work just fine.
104
+ if (isNodeVersionSupported(currentNodeVersion)) {
105
+ env.NODE_OPTIONS = env.NODE_OPTIONS ? `${env.NODE_OPTIONS} --max-http-header-size=80000` : '--max-http-header-size=80000';
106
+ } else {
107
+ warning(`You are running Node.js version ${currentNodeVersion}, which is no longer supported. `
108
+ + `Please upgrade to Node.js version ${minimumSupportedNodeVersion} or later.`);
109
+ }
110
+ await execWithLog(getNpmCmd(), ['start'], { env });
104
111
  } else {
105
- warning(`You are running Node.js version ${currentNodeVersion}, which is no longer supported. `
106
- + `Please upgrade to Node.js version ${lastSupportedVersion} or later.`);
112
+ error(`No Node.js detected! Please install Node.js ${minimumSupportedNodeVersion} or higher to be able to run Node.js actors locally.`);
107
113
  }
108
- await execWithLog(getNpmCmd(), ['start'], { env });
109
114
  } else if (mainPyExists) {
110
115
  const pythonVersion = detectPythonVersion(cwd);
111
116
  if (pythonVersion) {
package/src/lib/utils.js CHANGED
@@ -20,6 +20,7 @@ const https = require('https');
20
20
  const { ApifyClient } = require('apify-client');
21
21
  const {
22
22
  execSync,
23
+ spawnSync,
23
24
  } = require('child_process');
24
25
  const semver = require('semver');
25
26
  const {
@@ -31,6 +32,7 @@ const {
31
32
  DEPRECATED_LOCAL_CONFIG_NAME,
32
33
  ACTOR_SPECIFICATION_VERSION,
33
34
  APIFY_CLIENT_DEFAULT_HEADERS,
35
+ SUPPORTED_NODEJS_VERSION,
34
36
  MINIMUM_SUPPORTED_PYTHON_VERSION,
35
37
  } = require('./consts');
36
38
  const {
@@ -518,7 +520,10 @@ const getPythonCommand = (directory) => {
518
520
  const detectPythonVersion = (directory) => {
519
521
  const pythonCommand = getPythonCommand(directory);
520
522
  try {
521
- return execSync(`${pythonCommand} -c "import platform; print(platform.python_version(), end='')"`, { encoding: 'utf-8' });
523
+ const spawnResult = spawnSync(pythonCommand, ['-c', 'import platform; print(platform.python_version())'], { encoding: 'utf-8' });
524
+ if (!spawnResult.error && spawnResult.stdout) {
525
+ return spawnResult.stdout.trim();
526
+ }
522
527
  } catch {
523
528
  return undefined;
524
529
  }
@@ -528,6 +533,24 @@ const isPythonVersionSupported = (installedPythonVersion) => {
528
533
  return semver.satisfies(installedPythonVersion, `^${MINIMUM_SUPPORTED_PYTHON_VERSION}`);
529
534
  };
530
535
 
536
+ const detectNodeVersion = () => {
537
+ try {
538
+ const spawnResult = spawnSync('node', ['--version'], { encoding: 'utf-8' });
539
+ if (!spawnResult.error && spawnResult.stdout) {
540
+ return spawnResult.stdout.trim().replace(/^v/, '');
541
+ }
542
+ } catch {
543
+ return undefined;
544
+ }
545
+ };
546
+
547
+ const isNodeVersionSupported = (installedNodeVersion) => {
548
+ // SUPPORTED_NODEJS_VERSION can be a version range,
549
+ // we need to get the minimum supported version from that range to be able to compare them
550
+ const minimumSupportedNodeVersion = semver.minVersion(SUPPORTED_NODEJS_VERSION);
551
+ return semver.gte(installedNodeVersion, minimumSupportedNodeVersion);
552
+ };
553
+
531
554
  module.exports = {
532
555
  getLoggedClientOrThrow,
533
556
  getLocalConfig,
@@ -558,4 +581,6 @@ module.exports = {
558
581
  detectPythonVersion,
559
582
  isPythonVersionSupported,
560
583
  getPythonCommand,
584
+ detectNodeVersion,
585
+ isNodeVersionSupported,
561
586
  };
@@ -1,4 +1,4 @@
1
- const { execSync } = require('child_process');
1
+ const fs = require('fs');
2
2
  const process = require('process');
3
3
  const axios = require('axios');
4
4
  const chalk = require('chalk');
@@ -37,7 +37,7 @@ const detectInstallationType = () => {
37
37
  // If the real command path is like `/opt/homebrew/Cellar/apify-cli/...` or `/home/linuxbrew/.linuxbrew/Cellar/apify-cli/...`,
38
38
  // then the CLI is installed via Homebrew
39
39
  if (process.platform === 'linux' || process.platform === 'darwin') {
40
- const realCommandPath = execSync(`realpath "${commandPath}"`);
40
+ const realCommandPath = fs.realpathSync(commandPath);
41
41
  if (realCommandPath.includes('homebrew/Cellar') || realCommandPath.includes('linuxbrew/Cellar')) {
42
42
  return INSTALLATION_TYPE.HOMEBREW;
43
43
  }