Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/en-US/handbook/workflow-javascript/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,26 @@ WORKFLOW_SCRIPT_MODULES=crypto,timers,lodash,dayjs
Modules not declared in `WORKFLOW_SCRIPT_MODULES`, including native Node.js modules or installed `node_modules`, **cannot** be used in scripts. This strategy allows administrators to control the modules accessible to users, reducing the risk of excessive script permissions.
:::

When in a non-source-deployed environment, if a module is not installed in `node_modules`, you can manually install the required package into the `storage` directory. For example, to use the `exceljs` package, you can perform the following steps:

```shell
cd storage
npm i --no-save --no-package-lock --prefix . exceljs
```

Then add the package's relative (or absolute) path based on the application's CWD (current working directory) to the environment variable `WORKFLOW_SCRIPT_MODULES`:

```ini
WORKFLOW_SCRIPT_MODULES=./storage/node_modules/exceljs
```

You can then use the `exceljs` package in your script:

```js
const ExcelJS = require('exceljs');
// ...
```

### Global Variables

Global variables such as `global`, `process`, `__dirname`, and `__filename` are **not supported**.
Expand Down
24 changes: 23 additions & 1 deletion docs/fr-FR/handbook/workflow-javascript/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,29 @@ Les modules disponibles dans le flux de travail peuvent être utilisés dans le
WORKFLOW_SCRIPT_MODULES=crypto,timers,lodash,dayjs
```

> **Remarque** : Les modules non déclarés dans `WORKFLOW_SCRIPT_MODULES` ne peuvent pas être utilisés. Cela permet aux administrateurs de contrôler les modules accessibles, réduisant ainsi le risque de permissions excessives.
:::info{title="Note"}
Les modules non déclarés dans `WORKFLOW_SCRIPT_MODULES` ne peuvent pas être utilisés. Cela permet aux administrateurs de contrôler les modules accessibles, réduisant ainsi le risque de permissions excessives.
:::

When in a non-source-deployed environment, if a module is not installed in `node_modules`, you can manually install the required package into the `storage` directory. For example, to use the `exceljs` package, you can perform the following steps:

```shell
cd storage
npm i --no-save --no-package-lock --prefix . exceljs
```

Then add the package's relative (or absolute) path based on the application's CWD (current working directory) to the environment variable `WORKFLOW_SCRIPT_MODULES`:

```ini
WORKFLOW_SCRIPT_MODULES=./storage/node_modules/exceljs
```

You can then use the `exceljs` package in your script:

```js
const ExcelJS = require('exceljs');
// ...
```

### Variables globales

Expand Down
20 changes: 20 additions & 0 deletions docs/ja-JP/handbook/workflow-javascript/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,26 @@ WORKFLOW_SCRIPT_MODULES=crypto,timers,lodash,dayjs
`WORKFLOW_SCRIPT_MODULES` に宣言されていないモジュールは、Node.js ネイティブモジュールやインストール済みモジュールであってもスクリプトで使用することはできません。このポリシーは、運用レベルでユーザーが使用可能なモジュールリストを制御し、スクリプト権限が過剰になるのを防ぐためのものです。
:::

When in a non-source-deployed environment, if a module is not installed in `node_modules`, you can manually install the required package into the `storage` directory. For example, to use the `exceljs` package, you can perform the following steps:

```shell
cd storage
npm i --no-save --no-package-lock --prefix . exceljs
```

Then add the package's relative (or absolute) path based on the application's CWD (current working directory) to the environment variable `WORKFLOW_SCRIPT_MODULES`:

```ini
WORKFLOW_SCRIPT_MODULES=./storage/node_modules/exceljs
```

You can then use the `exceljs` package in your script:

```js
const ExcelJS = require('exceljs');
// ...
```

### グローバル変数

`global`、`process`、`__dirname`、`__filename` などのグローバル変数は**サポートされていません**。
Expand Down
20 changes: 20 additions & 0 deletions docs/ru-RU/handbook/workflow-javascript/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,26 @@ WORKFLOW_SCRIPT_MODULES=crypto,timers,lodash,dayjs
Модули, не объявленные в `WORKFLOW_SCRIPT_MODULES`, включая собственные модули Node.js или установленные `node_modules`, **не могут** использоваться в скриптах. Эта стратегия позволяет администраторам контролировать модули, доступные пользователям, что снижает риск чрезмерных разрешений скрипта.
:::

When in a non-source-deployed environment, if a module is not installed in `node_modules`, you can manually install the required package into the `storage` directory. For example, to use the `exceljs` package, you can perform the following steps:

```shell
cd storage
npm i --no-save --no-package-lock --prefix . exceljs
```

Then add the package's relative (or absolute) path based on the application's CWD (current working directory) to the environment variable `WORKFLOW_SCRIPT_MODULES`:

```ini
WORKFLOW_SCRIPT_MODULES=./storage/node_modules/exceljs
```

You can then use the `exceljs` package in your script:

```js
const ExcelJS = require('exceljs');
// ...
```

### Глобальные переменные

Глобальные переменные, такие как `global`, `process`, `__dirname` и `__filename` **не поддерживаются**.
Expand Down
20 changes: 20 additions & 0 deletions docs/zh-CN/handbook/workflow-javascript/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,26 @@ WORKFLOW_SCRIPT_MODULES=crypto,timers,lodash,dayjs
在环境变量 `WORKFLOW_SCRIPT_MODULES` 中未声明的模块,即使是 Node.js 原生的或 `node_modules` 中已安装的,也**不能**在脚本中使用。该策略可以用于在运维层管控用户可使用的模块列表,在一些场景下避免脚本权限过高。
:::

在非源码部署的环境下,如果某个模块未在 node_modules 中安装,可以将需要的包手动安装到 storage 目录中。例如需要使用 `exceljs` 包时,可以执行如下操作:

```shell
cd storage
npm i --no-save --no-package-lock --prefix . exceljs
```

然后将该包基于应用 CWD(当前工作目录)的相对(或绝对路径)添加到环境变量 `WORKFLOW_SCRIPT_MODULES` 中:

```ini
WORKFLOW_SCRIPT_MODULES=./storage/node_modules/exceljs
```

即可在脚本中使用 `exceljs` 包:

```js
const ExcelJS = require('exceljs');
// ...
```

### 全局变量

**不支持** `global`、`process`、`__dirname` 和 `__filename` 等全局变量。
Expand Down
Loading