mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge branch '0.18' into projects
This commit is contained in:
@@ -229,6 +229,11 @@ module.exports = {
|
||||
log.audit({event: "nodes.module.set",module:mod,enabled:body.enabled,error:err.code||"unexpected_error",message:err.toString()},req);
|
||||
res.status(400).json({error:err.code||"unexpected_error", message:err.toString()});
|
||||
}
|
||||
},
|
||||
|
||||
getIcons: function(req,res) {
|
||||
log.audit({event: "nodes.icons.get"},req);
|
||||
res.json(redNodes.getNodeIcons());
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -87,9 +87,11 @@ function login(req,res) {
|
||||
"prompts":[{id:"username",type:"text",label:"user.username"},{id:"password",type:"password",label:"user.password"}]
|
||||
}
|
||||
} else if (settings.adminAuth.type === "strategy") {
|
||||
|
||||
var urlPrefix = (settings.httpAdminRoot==='/')?"":settings.httpAdminRoot;
|
||||
response = {
|
||||
"type":"strategy",
|
||||
"prompts":[{type:"button",label:settings.adminAuth.strategy.label, url:"/auth/strategy"}]
|
||||
"prompts":[{type:"button",label:settings.adminAuth.strategy.label, url: urlPrefix + "auth/strategy"}]
|
||||
}
|
||||
if (settings.adminAuth.strategy.icon) {
|
||||
response.prompts[0].icon = settings.adminAuth.strategy.icon;
|
||||
@@ -148,14 +150,19 @@ module.exports = {
|
||||
login: login,
|
||||
revoke: revoke,
|
||||
genericStrategy: function(adminApp,strategy) {
|
||||
var session = require('express-session');
|
||||
var crypto = require("crypto");
|
||||
var crypto = require("crypto")
|
||||
var session = require('express-session')
|
||||
var MemoryStore = require('memorystore')(session)
|
||||
|
||||
adminApp.use(session({
|
||||
// As the session is only used across the life-span of an auth
|
||||
// hand-shake, we can use a instance specific random string
|
||||
secret: crypto.randomBytes(20).toString('hex'),
|
||||
resave: false,
|
||||
saveUninitialized:false
|
||||
// As the session is only used across the life-span of an auth
|
||||
// hand-shake, we can use a instance specific random string
|
||||
secret: crypto.randomBytes(20).toString('hex'),
|
||||
resave: false,
|
||||
saveUninitialized: false,
|
||||
store: new MemoryStore({
|
||||
checkPeriod: 86400000 // prune expired entries every 24h
|
||||
})
|
||||
}));
|
||||
//TODO: all passport references ought to be in ./auth
|
||||
adminApp.use(passport.initialize());
|
||||
@@ -186,12 +193,12 @@ module.exports = {
|
||||
|
||||
adminApp.get('/auth/strategy', passport.authenticate(strategy.name));
|
||||
adminApp.get('/auth/strategy/callback',
|
||||
passport.authenticate(strategy.name, {session:false, failureRedirect: '/' }),
|
||||
passport.authenticate(strategy.name, {session:false, failureRedirect: settings.httpAdminRoot }),
|
||||
function(req, res) {
|
||||
var tokens = req.user.tokens;
|
||||
delete req.user.tokens;
|
||||
// Successful authentication, redirect home.
|
||||
res.redirect('/?access_token='+tokens.accessToken);
|
||||
res.redirect(settings.httpAdminRoot + '?access_token='+tokens.accessToken);
|
||||
}
|
||||
);
|
||||
|
||||
|
@@ -64,7 +64,7 @@ function start() {
|
||||
// https://github.com/websockets/ws/pull/632
|
||||
// that is fixed in the 1.x release of the ws module
|
||||
// that we cannot currently pickup as it drops node 0.10 support
|
||||
perMessageDeflate: false
|
||||
//perMessageDeflate: false
|
||||
});
|
||||
|
||||
wsServer.on('connection',function(ws) {
|
||||
@@ -190,15 +190,27 @@ function publish(topic,data,retain) {
|
||||
}
|
||||
}
|
||||
|
||||
var stack = [];
|
||||
var ok2tx = true;
|
||||
function publishTo(ws,topic,data) {
|
||||
var msg = JSON.stringify({topic:topic,data:data});
|
||||
try {
|
||||
ws.send(msg);
|
||||
} catch(err) {
|
||||
removeActiveConnection(ws);
|
||||
removePendingConnection(ws);
|
||||
log.warn(log._("comms.error-send",{message:err.toString()}));
|
||||
if (topic && data) { stack.push({topic:topic,data:data}); }
|
||||
|
||||
if (ok2tx && (stack.length > 0)) {
|
||||
ok2tx = false;
|
||||
try {
|
||||
ws.send(JSON.stringify(stack));
|
||||
} catch(err) {
|
||||
removeActiveConnection(ws);
|
||||
removePendingConnection(ws);
|
||||
log.warn(log._("comms.error-send",{message:err.toString()}));
|
||||
}
|
||||
stack = [];
|
||||
var txtout = setTimeout(function() {
|
||||
ok2tx = true;
|
||||
publishTo(ws);
|
||||
}, 50); // TODO: OK so a 50mS update rate should prob not be hard-coded
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function handleRemoteSubscription(ws,topic) {
|
||||
|
@@ -22,6 +22,7 @@ var library = require("./library");
|
||||
var info = require("./settings");
|
||||
|
||||
var auth = require("../auth");
|
||||
var nodes = require("../admin/nodes"); // TODO: move /icons into here
|
||||
var needsPermission = auth.needsPermission;
|
||||
var runtime;
|
||||
var log;
|
||||
@@ -59,6 +60,8 @@ module.exports = {
|
||||
});
|
||||
}
|
||||
editorApp.get("/",ensureRuntimeStarted,ui.ensureSlash,ui.editor);
|
||||
|
||||
editorApp.get("/icons",needsPermission("nodes.read"),nodes.getIcons,errorHandler);
|
||||
editorApp.get("/icons/:module/:icon",ui.icon);
|
||||
editorApp.get("/icons/:scope/:module/:icon",ui.icon);
|
||||
|
||||
@@ -75,7 +78,7 @@ module.exports = {
|
||||
// Locales
|
||||
var locales = require("./locales");
|
||||
locales.init(runtime);
|
||||
editorApp.get('/locales/nodes',locales.getAllNodes,apiUtil.errorHandler);
|
||||
editorApp.get('/locales/nodes',locales.getAllNodes,apiUtil..errorHandler);
|
||||
editorApp.get(/locales\/(.+)\/?$/,locales.get,apiUtil.errorHandler);
|
||||
|
||||
// Library
|
||||
|
@@ -218,9 +218,10 @@
|
||||
"editConfig": "Edit __type__ config node",
|
||||
"addNewType": "Add new __type__...",
|
||||
"nodeProperties": "node properties",
|
||||
"portLabels": "port labels",
|
||||
"portLabels": "node settings",
|
||||
"labelInputs": "Inputs",
|
||||
"labelOutputs": "Outputs",
|
||||
"settingIcon": "Icon",
|
||||
"noDefaultLabel": "none",
|
||||
"defaultLabel": "use default label",
|
||||
"errors": {
|
||||
@@ -450,8 +451,10 @@
|
||||
},
|
||||
"expressionEditor": {
|
||||
"functions": "Functions",
|
||||
"functionReference": "Function reference",
|
||||
"insert": "Insert",
|
||||
"title": "JSONata Expression editor",
|
||||
"test": "Test",
|
||||
"data": "Example message",
|
||||
"result": "Result",
|
||||
"format": "format expression",
|
||||
|
@@ -95,6 +95,10 @@
|
||||
"args":"",
|
||||
"desc":"Returns a pseudo random number greater than or equal to zero and less than one."
|
||||
},
|
||||
"$millis": {
|
||||
"args":"",
|
||||
"desc":"Returns the number of milliseconds since the Unix Epoch (1 January, 1970 UTC) as a number. All invocations of `$millis()` within an evaluation of an expression will all return the same value."
|
||||
},
|
||||
"$sum": {
|
||||
"args": "array",
|
||||
"desc": "Returns the arithmetic sum of an `array` of numbers. It is an error if the input `array` contains an item which isn't a number."
|
||||
@@ -160,6 +164,10 @@
|
||||
"args": "object",
|
||||
"desc": "Splits an object containing key/value pairs into an array of objects, each of which has a single key/value pair from the input object. If the parameter is an array of objects, then the resultant array contains an object for every key/value pair in every object in the supplied array."
|
||||
},
|
||||
"$merge": {
|
||||
"args": "array<object>",
|
||||
"desc": "Merges an array of `objects` into a single `object` containing all the key/value pairs from each of the objects in the input array. If any of the input objects contain the same key, then the returned `object` will contain the value of the last one in the array. It is an error if the input array contains an item that is not an object."
|
||||
},
|
||||
"$sift": {
|
||||
"args":"object, function",
|
||||
"desc":"Returns an object that contains only the key/value pairs from the `object` parameter that satisfy the predicate `function` passed in as the second parameter.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, key [, object]])`"
|
||||
@@ -187,5 +195,26 @@
|
||||
"$globalContext": {
|
||||
"args": "string",
|
||||
"desc": "Retrieves a global context property."
|
||||
},
|
||||
"$pad": {
|
||||
"args": "string, width [, char]",
|
||||
"desc": "Returns a copy of the `string` with extra padding, if necessary, so that its total number of characters is at least the absolute value of the `width` parameter.\n\nIf `width` is a positive number, then the string is padded to the right; if negative, it is padded to the left.\n\nThe optional `char` argument specifies the padding character(s) to use. If not specified, it defaults to the space character."
|
||||
},
|
||||
"$fromMillis": {
|
||||
"args": "number",
|
||||
"desc": "Convert a number representing milliseconds since the Unix Epoch (1 January, 1970 UTC) to a timestamp string in the ISO 8601 format."
|
||||
},
|
||||
"$formatNumber": {
|
||||
"args": "number, picture [, options]",
|
||||
"desc": "Casts the number to a string and formats it to a decimal representation as specified by the picture string.\n\n The behaviour of this function is consistent with the XPath/XQuery function fn:format-number as defined in the XPath F&O 3.1 specification. The picture string parameter defines how the number is formatted and has the same syntax as fn:format-number.\n\nThe optional third argument options is used to override the default locale specific formatting characters such as the decimal separator. If supplied, this argument must be an object containing name/value pairs specified in the decimal format section of the XPath F&O 3.1 specification."
|
||||
},
|
||||
"$formatBase": {
|
||||
"args": "number [, radix]",
|
||||
"desc": "Casts the number to a string and formats it to an integer represented in the number base specified by the radix argument. If radix is not specified, then it defaults to base 10. radix can be between 2 and 36, otherwise an error is thrown."
|
||||
},
|
||||
"$toMillis": {
|
||||
"args": "timestamp",
|
||||
"desc": "Convert a timestamp string in the ISO 8601 format to the number of milliseconds since the Unix Epoch (1 January, 1970 UTC) as a number. An error is thrown if the string is not in the correct format."
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -208,9 +208,10 @@
|
||||
"editConfig": "__type__ ノードの設定を編集",
|
||||
"addNewType": "新規に __type__ を追加...",
|
||||
"nodeProperties": "プロパティ",
|
||||
"portLabels": "端子名",
|
||||
"portLabels": "設定",
|
||||
"labelInputs": "入力",
|
||||
"labelOutputs": "出力",
|
||||
"settingIcon": "アイコン",
|
||||
"noDefaultLabel": "なし",
|
||||
"defaultLabel": "既定の名前を使用",
|
||||
"errors": {
|
||||
@@ -422,11 +423,13 @@
|
||||
},
|
||||
"expressionEditor": {
|
||||
"functions": "関数",
|
||||
"functionReference": "関数リファレンス",
|
||||
"insert": "挿入",
|
||||
"title": "JSONata式エディタ",
|
||||
"test": "テスト",
|
||||
"data": "メッセージ例",
|
||||
"result": "結果",
|
||||
"format": "形式",
|
||||
"format": "整形",
|
||||
"compatMode": "互換モードが有効になっています",
|
||||
"compatModeDesc": "<h3>JSONata互換モード</h3><p> 入力された式では <code>msg</code> を参照しているため、互換モードで評価します。このモードは将来廃止予定のため、式で <code>msg</code> を使わないよう修正してください。</p><p> JSONataをNode-REDで最初にサポートした際には、 <code>msg</code> オブジェクトの参照が必要でした。例えば <code>msg.payload</code> がペイロードを参照するために使われていました。</p><p> 直接メッセージに対して式を評価するようになったため、この形式は使えなくなります。ペイロードを参照するには、単に <code>payload</code> にしてください。</p>",
|
||||
"noMatch": "一致した結果なし",
|
||||
|
@@ -95,6 +95,10 @@
|
||||
"args": "",
|
||||
"desc": "0以上、1未満の疑似乱数を返します。"
|
||||
},
|
||||
"$millis": {
|
||||
"args": "",
|
||||
"desc": "Unixエポック(1 January, 1970 UTC)からの経過ミリ秒を数値として返します。評価対象式に含まれる `$millis()` の呼び出しは、全て同じ値を返します。"
|
||||
},
|
||||
"$sum": {
|
||||
"args": "array",
|
||||
"desc": "数値の配列 `array` の合計値を返します。 `array` が数値でない要素を含む場合、エラーになります。"
|
||||
@@ -159,6 +163,10 @@
|
||||
"args": "object",
|
||||
"desc": "key/valueのペアを持つオブジェクトを、各要素が1つのkey/valueのペアを持つオブジェクトの配列に分割します。引数がオブジェクトの配列の場合、結果の配列は各オブジェクトから得た各key/valueのペアのオブジェクトを持ちます。"
|
||||
},
|
||||
"$merge": {
|
||||
"args": "array<object>",
|
||||
"desc": "`object` の配列を1つの `object` へマージします。 マージ結果のオブジェクトは入力配列内の各オブジェクトのkey/valueペアを含みます。入力のオブジェクトが同じキーを持つ場合、戻り値の `object` には配列の最後のオブジェクトのkey/value値が格納されます。入力の配列がオブジェクトでない要素を含む場合、エラーとなります。"
|
||||
},
|
||||
"$sift": {
|
||||
"args": "object, function",
|
||||
"desc": "引数 `object` が持つkey/valueのペアのうち、関数 `function` によってふるい分けたオブジェクトのみを返します。\n\n関数 `function` は、以下の引数を持つ必要があります。\n\n`function(value [, key [, object]])`"
|
||||
|
@@ -2,7 +2,7 @@
|
||||
"common": {
|
||||
"label": {
|
||||
"name": "姓名",
|
||||
"ok": "Ok",
|
||||
"ok": "确认",
|
||||
"done": "完成",
|
||||
"cancel": "取消",
|
||||
"delete": "删除",
|
||||
@@ -28,8 +28,8 @@
|
||||
"menu": {
|
||||
"label": {
|
||||
"view": {
|
||||
"view": "表示",
|
||||
"showGrid": "表示网格",
|
||||
"view": "显示",
|
||||
"showGrid": "显示网格",
|
||||
"snapGrid": "对齐网格",
|
||||
"gridSize": "网格尺寸",
|
||||
"textDir": "文本方向",
|
||||
@@ -42,7 +42,7 @@
|
||||
"show": "显示侧边栏"
|
||||
},
|
||||
"userSettings": "设定",
|
||||
"displayStatus": "表示节点状态",
|
||||
"displayStatus": "显示节点状态",
|
||||
"displayConfig": "配置节点设定",
|
||||
"import": "导入",
|
||||
"export": "导出",
|
||||
@@ -256,7 +256,7 @@
|
||||
"social": "社交",
|
||||
"storage": "存储",
|
||||
"analysis": "分析",
|
||||
"advanced": "高级的"
|
||||
"advanced": "高级"
|
||||
},
|
||||
"event": {
|
||||
"nodeAdded": "添加到面板中的节点:",
|
||||
@@ -381,7 +381,7 @@
|
||||
"str": "文字列",
|
||||
"num": "数字",
|
||||
"re": "正则表达式",
|
||||
"bool": "真伪判断",
|
||||
"bool": "布尔",
|
||||
"json": "JSON",
|
||||
"date": "时间戳"
|
||||
}
|
||||
|
@@ -61,7 +61,7 @@ function init(_server,_runtime) {
|
||||
}
|
||||
adminApp.post("/auth/revoke",auth.needsPermission(""),auth.revoke,apiUtil.errorHandler);
|
||||
}
|
||||
|
||||
|
||||
// Editor
|
||||
if (!settings.disableEditor) {
|
||||
editor = require("./editor");
|
||||
|
23
red/api/locales/zh-CN/infotips.json
Normal file
23
red/api/locales/zh-CN/infotips.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"info": {
|
||||
"tip0" : "您可以用 {{core:delete-selection}} 删除选择的节点或链接。",
|
||||
"tip1" : "{{core:search}} 可以在流程内搜索节点。",
|
||||
"tip2": "{{core:toggle-sidebar}} 可以显示或隐藏边栏。",
|
||||
"tip3": "您可以在 {{core:manage-palette}} 中管理节点的控制面板。",
|
||||
"tip4": "边栏中会列出流程中所有的配置节点。您可以通过菜单或者 {{core:show-config-tab}} 来访问这些节点。",
|
||||
"tip5": "您可以在设定中选择显示或隐藏这些提示。",
|
||||
"tip6": "您可以用[left] [up] [down] [right]键来移动被选中的节点。按住[shift]可以更快地移动节点。",
|
||||
"tip7": "把节点拖到连接上可以向连接中插入节点。",
|
||||
"tip8": "您可以用 {{core:show-export-dialog}} 来导出被选中的节点或标签页中的流程。",
|
||||
"tip9": "您可以将流程的json文件拖入编辑框或 {{core:show-import-dialog}} 来导入流程。",
|
||||
"tip10": "按住[shift]后单击并拖动节点可以将该节点的多个连接一并移动到其他节点的端口。",
|
||||
"tip11": "{{core:show-info-tab}} 可以显示「信息」标签页。 {{core:show-debug-tab}} 可以显示「调试」标签页。",
|
||||
"tip12": "按住[ctrl]的同时点击工作界面可以在节点的对话栏中快速添加节点。",
|
||||
"tip13": "按住[ctrl]的同时点击节点的端口或后续节点可以快速连接多个节点。",
|
||||
"tip14": "按住[shift]的同时点击节点会选中所有被连接的节点。",
|
||||
"tip15": "按住[ctrl]的同时点击节点可以在选中或取消选中节点。",
|
||||
"tip16": "{{core:show-previous-tab}} 和 {{core:show-next-tab}} 可以切换标签页。",
|
||||
"tip17": "您可以在节点的属性配置画面中通过 {{core:confirm-edit-tray}} 来更改设置,或者用 {{core:cancel-edit-tray}} 来取消更改。",
|
||||
"tip18": "您可以通过点击 {{core:edit-selected-node}} 来显示被选中节点的属性设置画面。"
|
||||
}
|
||||
}
|
198
red/api/locales/zh-CN/jsonata.json
Normal file
198
red/api/locales/zh-CN/jsonata.json
Normal file
@@ -0,0 +1,198 @@
|
||||
{
|
||||
"$string": {
|
||||
"args": "arg",
|
||||
"desc": "通过以下的类型转换规则将参数*arg*转换成字符串:\n\n - 字符串不转换。\n -函数转换成空的字符串。\n - JSON的值无法用数字表示所以用无限大或者NaN(非数)表示。\n - 用’JSON.stringify’函数将其他值转换成JSON字符串。"
|
||||
},
|
||||
"$length": {
|
||||
"args": "str",
|
||||
"desc": "输出字符串’str’的字数。如果’str’不是字符串,抛出错误。"
|
||||
},
|
||||
"$substring": {
|
||||
"args": "str, start[, length]",
|
||||
"desc": "输出`start`位置后的的首次出现的包括`str`的子字符串。 如果`length`被指定,那么的字符串中将只包括前`length`个文字。如果`start`是负数则输出从`str`末尾开始的`length`个文字"
|
||||
},
|
||||
"$substringBefore": {
|
||||
"args": "str, chars",
|
||||
"desc": "输出’str’中首次出现的’chars’之前的子字符串,如果’str’中不包括’chars’则输出’str’。"
|
||||
},
|
||||
"$substringAfter": {
|
||||
"args": "str, chars",
|
||||
"desc": "输出’str’中首次出现的’chars’之后的子字符串,如果’str’中不包括’chars’则输出’str’。"
|
||||
},
|
||||
"$uppercase": {
|
||||
"args": "str",
|
||||
"desc": "`将’str’中的所有字母变为大写后输出。"
|
||||
},
|
||||
"$lowercase": {
|
||||
"args": "str",
|
||||
"desc": "将’str’中的所有字母变为小写后输出。"
|
||||
},
|
||||
"$trim": {
|
||||
"args": "str",
|
||||
"desc": "将以下步骤应用于`str`来去除所有空白文字并实现标准化。\n\n – 将全部tab制表符、回车键、换行字符用空白代替。\n- 将连续的空白文字变成一个空白文字。\n- 消除开头和末尾的空白文字。\n\n如果`str`没有被指定(即在无输入参数的情况下调用本函数),将上下文的值作为`str`来使用。 如果`str` 不是字符串则抛出错误。"
|
||||
},
|
||||
"$contains": {
|
||||
"args": "str, pattern",
|
||||
"desc": "字符串`str` 和 `pattern`匹配的话输出`true`,不匹配的情况下输出 `false`。 不指定`str`的情况下(比如用一个参数调用本函数时)、将上下文的值作为`str`来使用。参数 `pattern`可以为字符串或正则表达。"
|
||||
},
|
||||
"$split": {
|
||||
"args": "str[, separator][, limit]",
|
||||
"desc": "将参数`str`分解成由子字符串组成的数组。 如果`str`不是字符串抛出错误。可以省略的参数 `separator`中指定字符串`str`的分隔符。分隔符可以是文字或正则表达式。在不指定`separator`的情况下、将分隔符看作空的字符串并把`str`拆分成由单个字母组成的数组。如果`separator`不是字符串则抛出错误。在可省略的参数`limit`中指定分割后的子字符串的最大个数。超出个数的子字符串将被舍弃。如果`limit`没有被指定,`str` 将不考虑子字符串的个数而将字符串完全分隔。如果`limit`是负数则抛出错误。"
|
||||
},
|
||||
"$join": {
|
||||
"args": "array[, separator]",
|
||||
"desc": "用可以省略的参数 `separator`来把多个字符串连接。如果`array`不是字符串则抛出错误。 如果没有指定`separator`,则用空字符串来连接字符(即字符串之间没有`separator`)。 如果`separator`不是字符则抛出错误。"
|
||||
},
|
||||
"$match": {
|
||||
"args": "str, pattern [, limit]",
|
||||
"desc": "对字符串`str`使用正则表达式`pattern`并输出与`str`相匹配的部分信息。"
|
||||
},
|
||||
"$replace": {
|
||||
"args": "str, pattern, replacement [, limit]",
|
||||
"desc": "在字符串`str`中搜索`pattern`并用`replacement`来替换。\n\n可选参数`limit`用来指定替换次数的上限。"
|
||||
},
|
||||
"$now": {
|
||||
"args": "",
|
||||
"desc": "生成ISO 8601互換格式的时刻,并作为字符串输出。"
|
||||
},
|
||||
"$base64encode": {
|
||||
"args": "string",
|
||||
"desc": "将ASCII格式的字符串转换为Base 64格式。将字符串中的文字视作二进制形式的数据处理。包含URI编码在内的字符串文字必须在0x00到0xFF的范围内,否则不会被支持。"
|
||||
},
|
||||
"$base64decode": {
|
||||
"args": "string",
|
||||
"desc": "用UTF-8代码页将Base 64形式二进制值转换为字符串。"
|
||||
},
|
||||
"$number": {
|
||||
"args": "arg",
|
||||
"desc": "用下述的规则将参数 `arg`转换为数值。:\n\n – 数值不做转换。\n – 将字符串中合法的JSON数値表示转换成数値。\n – 其他形式的值则抛出错误。"
|
||||
},
|
||||
"$abs": {
|
||||
"args": "number",
|
||||
"desc": "输出参数`number`的绝对值。"
|
||||
},
|
||||
"$floor": {
|
||||
"args": "number",
|
||||
"desc": "输出比`number`的值小的最大整数。"
|
||||
},
|
||||
"$ceil": {
|
||||
"args": "number",
|
||||
"desc": "输出比`number`的值大的最小整数。"
|
||||
},
|
||||
"$round": {
|
||||
"args": "number [, precision]",
|
||||
"desc": "输出四舍五入后的参数`number`。可省略的参数 `precision`指定四舍五入后小数点下的位数。"
|
||||
},
|
||||
"$power": {
|
||||
"args": "base, exponent",
|
||||
"desc": "输出底数`base`的`exponent`次幂。"
|
||||
},
|
||||
"$sqrt": {
|
||||
"args": "number",
|
||||
"desc": "输出参数 `number`的平方根。"
|
||||
},
|
||||
"$random": {
|
||||
"args": "",
|
||||
"desc": "输出比0大,比1小的伪随机数。"
|
||||
},
|
||||
"$millis": {
|
||||
"args": "",
|
||||
"desc": "返回从UNIX时间 (1970年1月1日 UTC/GMT的午夜)开始到现在的毫秒数。在同一个表达式的测试中所有对`$millis()`的调用将会返回相同的值。"
|
||||
},
|
||||
"$sum": {
|
||||
"args": "array",
|
||||
"desc": "输出数组`array`的总和。如果`array`不是数值则抛出错误。"
|
||||
},
|
||||
"$max": {
|
||||
"args": "array",
|
||||
"desc": "输出数组`array`的最大值。如果`array`不是数值则抛出错误。"
|
||||
},
|
||||
"$min": {
|
||||
"args": "array",
|
||||
"desc": "输出数组`array`的最小值。如果`array`不是数值则抛出错误。。"
|
||||
},
|
||||
"$average": {
|
||||
"args": "array",
|
||||
"desc": "输出数组`array`的平均数。如果`array`不是数值则抛出错误。。"
|
||||
},
|
||||
"$boolean": {
|
||||
"args": "arg",
|
||||
"desc": "用下述规则将数据转换成布尔值。:\n\n - 不转换布尔值`Boolean`。\n – 将空的字符串`string`转换为`false`\n – 将不为空的字符串`string`转换为`true`\n – 将为0的数字`number`转换成`false`\n –将不为0的数字`number`转换成`true`\n –将`null`转换成`false`\n –将空的数组`array`转换成`false`\n –如果数组`array`中含有可以转换成`true`的要素则转换成`true`\n –如果`array`中没有可转换成`true`的要素则转换成`false`\n – 空的对象`object`转换成`false`\n – 非空的对象`object`转换成`true`\n –将函数`function`转换成`false`"
|
||||
},
|
||||
"$not": {
|
||||
"args": "arg",
|
||||
"desc": "输出做取反运算后的布尔值。首先将`arg`转换为布尔值。"
|
||||
},
|
||||
"$exists": {
|
||||
"args": "arg",
|
||||
"desc": "如果算式`arg`的值存在则输出`true`。如果算式的值不存在(比如指向不存在区域的引用)则输出`false`。"
|
||||
},
|
||||
"$count": {
|
||||
"args": "array",
|
||||
"desc": "输出数组中的元素数。"
|
||||
},
|
||||
"$append": {
|
||||
"args": "array, array",
|
||||
"desc": "将两个数组连接。"
|
||||
},
|
||||
"$sort": {
|
||||
"args": "array [, function]",
|
||||
"desc": "输出排序后的数组`array`。\n\n如果使用了比较函数`function`,则下述两个参数需要被指定。\n\n`function(left, right)`\n\n该比较函数是为了比较left和right两个值而被排序算法调用的。如果用户希望left的值被置于right的值之后,那么该函数必须输出布尔值`true`来表示位置交换。而在不需要位置交换时函数必须输出`false`。"
|
||||
},
|
||||
"$reverse": {
|
||||
"args": "array",
|
||||
"desc": "输出倒序后的数组`array`。"
|
||||
},
|
||||
"$shuffle": {
|
||||
"args": "array",
|
||||
"desc": "输出随机排序后的数组 `array`。"
|
||||
},
|
||||
"$zip": {
|
||||
"args": "array, ...",
|
||||
"desc": "将数组中的值按索引顺序打包后输出。"
|
||||
},
|
||||
"$keys": {
|
||||
"args": "object",
|
||||
"desc": "输出由对象内的键组成的数组。如果参数是对象的数组则输出由所有对象中的键去重后组成的队列。"
|
||||
},
|
||||
"$lookup": {
|
||||
"args": "object, key",
|
||||
"desc": "输出对象中与参数`key`对应的值。如果第一个参数`object`是数组,那么数组中所有的对象都将被搜索并输出这些对象中与参数`key`对应的值。"
|
||||
},
|
||||
"$spread": {
|
||||
"args": "object",
|
||||
"desc": "将对象中的键值对分隔成每个要素中只含有一个键值对的数组。如果参数`object`是数组,那么返回值的数组中包含所有对象中的键值对。"
|
||||
},
|
||||
"$merge": {
|
||||
"args": "array<object>",
|
||||
"desc": "将输入数组`objects`中所有的键值对合并到一个`object`中并返回。如果输入数组的要素中含有重复的键,则返回的`object`中将只包含数组中最后出现要素的值。如果输入数组中包括对象以外的元素,则抛出错误。"
|
||||
},
|
||||
"$sift": {
|
||||
"args": "object, function",
|
||||
"desc": "输出参数`object`中符合`function`的键值对。\n\n`function`必须含有下述参数。\n\n`function(value [, key [, object]])`"
|
||||
},
|
||||
"$each": {
|
||||
"args": "object, function",
|
||||
"desc": "将函数`function`应用于`object`中的所有键值对并输出由所有返回值组成的数组。"
|
||||
},
|
||||
"$map": {
|
||||
"args": "array, function",
|
||||
"desc": "将函数`function`应用于数组`array`中所有的值并输出由返回值组成的数组。\n\n`function`中必须含有下述参数。\n\n`function(value [, index [, array]])`"
|
||||
},
|
||||
"$filter": {
|
||||
"args": "array, function",
|
||||
"desc": "输出数组`array`中符合函数`function`条件的值组成的数组。\n\n`function`必须包括下述参数。\n\n`function(value [, index [, array]])`"
|
||||
},
|
||||
"$reduce": {
|
||||
"args": "array, function [, init]",
|
||||
"desc": "将`function`依次应用于数组中的各要素值。 其中,前一个要素值的计算结果将参与到下一次的函数运算中。。\n\n函数`function`接受两个参数并作为中缀表示法中的操作符。\n\n可省略的参数`init`将作为运算的初始值。"
|
||||
},
|
||||
"$flowContext": {
|
||||
"args": "string",
|
||||
"desc": "获取流上下文(流等级的上下文,可以让所有节点共享)的属性。"
|
||||
},
|
||||
"$globalContext": {
|
||||
"args": "string",
|
||||
"desc": "获取全局上下文的属性。"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user