@kumologica/sdk 3.2.0-beta1 → 3.2.0-beta11
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/cli/commands/deploy-commands/kumohub.js +4 -2
- package/cli/commands/deploy.js +3 -2
- package/cli/commands/export-commands/github-commands/aws.js +374 -0
- package/cli/commands/export-commands/github.js +6 -0
- package/package.json +18 -8
- package/src/app/lib/aws/ca-sqs-api.js +5 -1
- package/src/app/lib/aws/index.js +135 -175
- package/src/app/lib/github/index.js +242 -0
- package/src/app/preload.js +11 -1
- package/src/app/ui/editor-client/public/red/red.js +295 -216
- package/src/app/ui/editor-client/public/red/red.min.js +1 -1
- package/src/app/ui/editor-client/public/vendor/jsonata/jsonata.min.js +8 -1
- package/src/app/ui/editor-client/src/js/ui/editors/expression.js +169 -141
- package/src/app/ui/editor-client/src/js/ui/tab-awsDeploy.js +126 -75
- package/src/app/ui/editor-client/src/vendor/jsonata/formatter.js +8 -1
|
@@ -22006,6 +22006,7 @@ RED.view.tools = (function() {
|
|
|
22006
22006
|
<span class="option-disabled">Generate script...</span>
|
|
22007
22007
|
<span id="exportCloudFormationBtn" class="option">AWS CloudFormation</span>
|
|
22008
22008
|
<span id="exportServerlessBtn" class="option">Serverless</span>
|
|
22009
|
+
<span id="exportGithubActionBtn" class="option">Github Action Workflow</span>
|
|
22009
22010
|
</div>
|
|
22010
22011
|
</div>
|
|
22011
22012
|
</div>
|
|
@@ -22069,6 +22070,12 @@ RED.view.tools = (function() {
|
|
|
22069
22070
|
});
|
|
22070
22071
|
//tagsSection.expand();
|
|
22071
22072
|
|
|
22073
|
+
// vpc section
|
|
22074
|
+
vpcSection = sections.add({
|
|
22075
|
+
title: 'vpc',
|
|
22076
|
+
collapsible: true,
|
|
22077
|
+
});
|
|
22078
|
+
|
|
22072
22079
|
// event section
|
|
22073
22080
|
eventSection = sections.add({
|
|
22074
22081
|
title: 'Triggers',
|
|
@@ -22091,7 +22098,7 @@ RED.view.tools = (function() {
|
|
|
22091
22098
|
|
|
22092
22099
|
// Function content init
|
|
22093
22100
|
let functionSectionHtml = `
|
|
22094
|
-
<table class="node-info">
|
|
22101
|
+
<table class="node-info">
|
|
22095
22102
|
<tr class="node-info-node-row">
|
|
22096
22103
|
<td>Name</td>
|
|
22097
22104
|
<td colspan="2" style="background: white"><input style="width:100%" id="cloud-fn-name" class="palette-textinput" pattern="[a-zA-Z0-9-_]{1,64}" type="text"></td>
|
|
@@ -22126,7 +22133,10 @@ RED.view.tools = (function() {
|
|
|
22126
22133
|
</tr>
|
|
22127
22134
|
<tr class="node-info-node-row">
|
|
22128
22135
|
<td>Custom Role</td>
|
|
22129
|
-
<td colspan="2" style="background: white; overflow-x:hidden"
|
|
22136
|
+
<td colspan="2" style="background: white; overflow-x:hidden">
|
|
22137
|
+
<input id="cloud-fn-role" list="iamroles-cloud-fn-role-dataList" style="width:100%" class="palette-textinput" placeHolder="optional" type="string">
|
|
22138
|
+
<datalist id="iamroles-cloud-fn-role-dataList"></datalist>
|
|
22139
|
+
</td>
|
|
22130
22140
|
</tr>
|
|
22131
22141
|
</table>
|
|
22132
22142
|
`;
|
|
@@ -22171,6 +22181,28 @@ RED.view.tools = (function() {
|
|
|
22171
22181
|
$(tagsSectionHtml).appendTo(tagsSection.content);
|
|
22172
22182
|
tagsSection.container.show();
|
|
22173
22183
|
|
|
22184
|
+
// VPC section init
|
|
22185
|
+
let vpcSectionHtml = `
|
|
22186
|
+
<table class="node-info">
|
|
22187
|
+
<tbody>
|
|
22188
|
+
<tr class="node-info-node-row">
|
|
22189
|
+
<td>Security Group Ids</td>
|
|
22190
|
+
<td colspan="2" style="background: white; overflow-x:hidden">
|
|
22191
|
+
<input id="cloud-fn-vpc-security-group" style="width:100%" class="palette-textinput" placeHolder="sg-11111, sg-22222" type="string">
|
|
22192
|
+
</td>
|
|
22193
|
+
</tr>
|
|
22194
|
+
<tr class="node-info-node-row">
|
|
22195
|
+
<td>Subnet Ids</td>
|
|
22196
|
+
<td colspan="2" style="background: white; overflow-x:hidden">
|
|
22197
|
+
<input id="cloud-fn-vpc-subnet" style="width:100%" class="palette-textinput" placeHolder="subnet-111, subnet-222" type="string">
|
|
22198
|
+
</td>
|
|
22199
|
+
</tr>
|
|
22200
|
+
</tbody>
|
|
22201
|
+
</table>
|
|
22202
|
+
`;
|
|
22203
|
+
$(vpcSectionHtml).appendTo(vpcSection.content);
|
|
22204
|
+
vpcSection.container.show();
|
|
22205
|
+
|
|
22174
22206
|
// Event section init
|
|
22175
22207
|
$(`
|
|
22176
22208
|
<div style="display:flex; flex-direction: column; justify-content: flex-start;">
|
|
@@ -22180,10 +22212,10 @@ RED.view.tools = (function() {
|
|
|
22180
22212
|
<option value="kinesis">Amazon Kinesis</option>
|
|
22181
22213
|
<option value="sqs">Amazon SQS</option>
|
|
22182
22214
|
<option disabled>────────────────────</option>
|
|
22183
|
-
|
|
22215
|
+
<!--option value="alb">Application Load Balancer</option-->
|
|
22184
22216
|
<!--option value="cognito">Amazon Cognito Sync Trigger</option-->
|
|
22185
22217
|
<!--option value="lex">Amazon Lex</option-->
|
|
22186
|
-
|
|
22218
|
+
<!--option value="alexa">Amazon Alexa</option-->
|
|
22187
22219
|
<option selected value="api">Amazon API Gateway</option>
|
|
22188
22220
|
<!--option value="cf">Amazon CloudFront (Lambda@Edge)</option-->
|
|
22189
22221
|
<!--option value="firehose">Amazon Kinesis Data Firehose</option-->
|
|
@@ -22196,7 +22228,7 @@ RED.view.tools = (function() {
|
|
|
22196
22228
|
<option value="cwevents">Amazon CloudWatch Events</option>
|
|
22197
22229
|
<!--option value="codecommit">Amazon CodeCommit</option-->
|
|
22198
22230
|
<!--option value="config">Amazon Config</option-->
|
|
22199
|
-
|
|
22231
|
+
<!--option value="iot">Amazon IoT Events</option-->
|
|
22200
22232
|
</select>
|
|
22201
22233
|
|
|
22202
22234
|
<a id="add-event" href="#" style="float: right; margin: 0px 0px 0px 5px !important; height: 21px !important;" class="editor-button editor-button-small">
|
|
@@ -22285,6 +22317,12 @@ RED.view.tools = (function() {
|
|
|
22285
22317
|
if (params.timeout) {
|
|
22286
22318
|
$('#cloud-fn-timeout').val(params.timeout);
|
|
22287
22319
|
}
|
|
22320
|
+
if (params.vpcConfig && params.vpcConfig.sg) {
|
|
22321
|
+
$('#cloud-fn-vpc-security-group').val(params.vpcConfig.sg);
|
|
22322
|
+
}
|
|
22323
|
+
if (params.vpcConfig && params.vpcConfig.sn) {
|
|
22324
|
+
$('#cloud-fn-vpc-subnet').val(params.vpcConfig.sn);
|
|
22325
|
+
}
|
|
22288
22326
|
if (params.reservedConcurrency) {
|
|
22289
22327
|
$('#cloud-fn-reservedConcurrency').val(params.reservedConcurrency);
|
|
22290
22328
|
}
|
|
@@ -22342,7 +22380,11 @@ RED.view.tools = (function() {
|
|
|
22342
22380
|
let fnXray = $('#cloud-fn-x-ray').prop('checked');
|
|
22343
22381
|
let fnProfile = getProfile();
|
|
22344
22382
|
let fnRole = $('#cloud-fn-role').val();
|
|
22345
|
-
|
|
22383
|
+
let fnVpcConfig = {
|
|
22384
|
+
sg: $('#cloud-fn-vpc-security-group').val(),
|
|
22385
|
+
sn: $('#cloud-fn-vpc-subnet').val()
|
|
22386
|
+
};
|
|
22387
|
+
|
|
22346
22388
|
// Environment variables
|
|
22347
22389
|
let environment = [];
|
|
22348
22390
|
let envvarRows = $('#cloud-fn-env-table tr');
|
|
@@ -22394,7 +22436,7 @@ RED.view.tools = (function() {
|
|
|
22394
22436
|
events.push(event);
|
|
22395
22437
|
});
|
|
22396
22438
|
|
|
22397
|
-
|
|
22439
|
+
const res = {
|
|
22398
22440
|
functionName: fnName,
|
|
22399
22441
|
description: fnDescription,
|
|
22400
22442
|
memory: fnMemory,
|
|
@@ -22406,7 +22448,10 @@ RED.view.tools = (function() {
|
|
|
22406
22448
|
environment: environment,
|
|
22407
22449
|
tags: tags,
|
|
22408
22450
|
events: events,
|
|
22451
|
+
vpcConfig: fnVpcConfig
|
|
22409
22452
|
};
|
|
22453
|
+
|
|
22454
|
+
return res;
|
|
22410
22455
|
}
|
|
22411
22456
|
|
|
22412
22457
|
async function attachDataList(serviceType, itemId, dataListId) {
|
|
@@ -22678,8 +22723,7 @@ RED.view.tools = (function() {
|
|
|
22678
22723
|
$('#cloud-fn-memory').val('512');
|
|
22679
22724
|
$('#cloud-fn-timeout').val('20');
|
|
22680
22725
|
|
|
22681
|
-
$('#cloud-fn-timeout, #cloud-fn-memory, #cloud-fn-description, #cloud-fn-name, #cloud-fn-reservedConcurrency, #cloud-fn-x-ray, #cloud-fn-role'
|
|
22682
|
-
).change(function () {
|
|
22726
|
+
$('#cloud-fn-timeout, #cloud-fn-memory, #cloud-fn-description, #cloud-fn-name, #cloud-fn-reservedConcurrency, #cloud-fn-x-ray, #cloud-fn-role, #cloud-fn-vpc-subnet, #cloud-fn-security-group').change(function () {
|
|
22683
22727
|
saveSettings();
|
|
22684
22728
|
});
|
|
22685
22729
|
|
|
@@ -22848,6 +22892,14 @@ RED.view.tools = (function() {
|
|
|
22848
22892
|
exportScript(window.__kumologica.cloud.provider.serverless);
|
|
22849
22893
|
});
|
|
22850
22894
|
|
|
22895
|
+
// Export serverless script
|
|
22896
|
+
$('#exportGithubActionBtn').click((e) => {
|
|
22897
|
+
e.preventDefault();
|
|
22898
|
+
hideMenu();
|
|
22899
|
+
exportScript(window.__kumologica.cloud.provider.github);
|
|
22900
|
+
});
|
|
22901
|
+
|
|
22902
|
+
|
|
22851
22903
|
$('#cloud-options-dropdown').click((e) => {
|
|
22852
22904
|
e.stopPropagation();
|
|
22853
22905
|
|
|
@@ -23195,19 +23247,19 @@ RED.view.tools = (function() {
|
|
|
23195
23247
|
function: 'attachDataList',
|
|
23196
23248
|
},
|
|
23197
23249
|
];
|
|
23198
|
-
parameterSets['cognito'] = [
|
|
23199
|
-
|
|
23200
|
-
];
|
|
23201
|
-
parameterSets['iot'] = [
|
|
23202
|
-
|
|
23203
|
-
|
|
23204
|
-
|
|
23205
|
-
|
|
23206
|
-
|
|
23207
|
-
|
|
23208
|
-
|
|
23209
|
-
|
|
23210
|
-
];
|
|
23250
|
+
//parameterSets['cognito'] = [
|
|
23251
|
+
// { label: 'Identity Pool ARN', key: 'identityPool', value: '' },
|
|
23252
|
+
//];
|
|
23253
|
+
//parameterSets['iot'] = [
|
|
23254
|
+
// {
|
|
23255
|
+
// label: 'Rule Name',
|
|
23256
|
+
// key: 'rule',
|
|
23257
|
+
// value: '',
|
|
23258
|
+
// required: true,
|
|
23259
|
+
// function: 'attachDataList',
|
|
23260
|
+
// },
|
|
23261
|
+
// { label: 'Query', key: 'query', value: '', required: true },
|
|
23262
|
+
//];
|
|
23211
23263
|
parameterSets['api'] = [
|
|
23212
23264
|
{
|
|
23213
23265
|
label: 'API',
|
|
@@ -23216,7 +23268,10 @@ RED.view.tools = (function() {
|
|
|
23216
23268
|
required: true,
|
|
23217
23269
|
function: 'attachDataList',
|
|
23218
23270
|
},
|
|
23219
|
-
{ label: 'Deployment Stage', key: 'stage', value: '', required: true }
|
|
23271
|
+
{ label: 'Deployment Stage', key: 'stage', value: '', required: true },
|
|
23272
|
+
{ label: 'Parent Id', key: 'parentId', value: '', required: false },
|
|
23273
|
+
{ label: 'Resource', key: 'resource', value: '', required: false },
|
|
23274
|
+
{ label: 'Authorizer Id', key: 'authorizerId', value: '', required: false }
|
|
23220
23275
|
];
|
|
23221
23276
|
parameterSets['alb'] = [
|
|
23222
23277
|
{
|
|
@@ -23232,23 +23287,23 @@ RED.view.tools = (function() {
|
|
|
23232
23287
|
];
|
|
23233
23288
|
parameterSets['sqs'] = [
|
|
23234
23289
|
{
|
|
23235
|
-
label: 'Queue
|
|
23236
|
-
key: '
|
|
23290
|
+
label: 'Queue Arn',
|
|
23291
|
+
key: 'queueArn',
|
|
23237
23292
|
value: '',
|
|
23238
23293
|
required: true,
|
|
23239
23294
|
function: 'attachDataList',
|
|
23240
23295
|
},
|
|
23241
23296
|
{ label: 'Batch Size', key: 'batchSize', value: '', min: 1, max: 10 },
|
|
23242
23297
|
];
|
|
23243
|
-
parameterSets['alexa'] = [
|
|
23244
|
-
|
|
23245
|
-
|
|
23246
|
-
|
|
23247
|
-
|
|
23248
|
-
|
|
23249
|
-
|
|
23250
|
-
|
|
23251
|
-
];
|
|
23298
|
+
//parameterSets['alexa'] = [
|
|
23299
|
+
// {
|
|
23300
|
+
// label: 'Skill ID',
|
|
23301
|
+
// key: 'skillID',
|
|
23302
|
+
// value: '',
|
|
23303
|
+
// required: true,
|
|
23304
|
+
// function: 'attachDataList',
|
|
23305
|
+
// },
|
|
23306
|
+
//];
|
|
23252
23307
|
parameterSets['kinesis'] = [
|
|
23253
23308
|
{ label: 'Stream ARN', key: 'stream', value: '', required: true },
|
|
23254
23309
|
{ label: 'Batch Size', key: 'batchSize', value: '', min: 1, max: 10000 },
|
|
@@ -23265,48 +23320,44 @@ RED.view.tools = (function() {
|
|
|
23265
23320
|
},
|
|
23266
23321
|
];
|
|
23267
23322
|
parameterSets['cwevents'] = [
|
|
23268
|
-
{
|
|
23269
|
-
|
|
23270
|
-
|
|
23271
|
-
value: '',
|
|
23272
|
-
required: true,
|
|
23273
|
-
function: 'attachDataList',
|
|
23274
|
-
},
|
|
23275
|
-
];
|
|
23276
|
-
parameterSets['cwlogs'] = [
|
|
23277
|
-
{
|
|
23278
|
-
label: 'Log Group',
|
|
23279
|
-
key: 'logGroup',
|
|
23280
|
-
value: '',
|
|
23281
|
-
required: true,
|
|
23282
|
-
function: 'attachDataList',
|
|
23283
|
-
},
|
|
23284
|
-
{ label: 'Filter Name', key: 'filterName', value: '' },
|
|
23285
|
-
{ label: 'Filter Pattern', key: 'filterPattern', value: '' },
|
|
23286
|
-
];
|
|
23287
|
-
parameterSets['codecommit'] = [
|
|
23288
|
-
{
|
|
23289
|
-
label: 'Repository Name',
|
|
23290
|
-
key: 'repository',
|
|
23291
|
-
value: '',
|
|
23292
|
-
required: true,
|
|
23293
|
-
function: 'attachDataList',
|
|
23294
|
-
},
|
|
23295
|
-
{ label: 'Trigger Name', key: 'trigger', value: '', required: true },
|
|
23296
|
-
{
|
|
23297
|
-
label: 'Events',
|
|
23298
|
-
key: 'events',
|
|
23299
|
-
value: '',
|
|
23300
|
-
list: [
|
|
23301
|
-
{ k: 'all', v: 'all' },
|
|
23302
|
-
{ k: 'updateReference', v: 'updateReference' },
|
|
23303
|
-
{ k: 'createReference', v: 'createReference' },
|
|
23304
|
-
{ k: 'deleteReference', v: 'deleteReference' },
|
|
23305
|
-
],
|
|
23306
|
-
},
|
|
23307
|
-
{ label: 'Branch Names', key: 'branchNames', value: '' },
|
|
23308
|
-
{ label: 'Custom Data', key: 'customData', value: '' },
|
|
23323
|
+
{ label: 'Expression', key: 'expression', value: 'cron()', required: true },
|
|
23324
|
+
{ label: 'Reference', key: 'reference', value: '' },
|
|
23325
|
+
{ label: 'Name', key: 'name', value: ''}
|
|
23309
23326
|
];
|
|
23327
|
+
//parameterSets['cwlogs'] = [
|
|
23328
|
+
// {
|
|
23329
|
+
// label: 'Log Group',
|
|
23330
|
+
// key: 'logGroup',
|
|
23331
|
+
// value: '',
|
|
23332
|
+
// required: true,
|
|
23333
|
+
// function: 'attachDataList',
|
|
23334
|
+
// },
|
|
23335
|
+
// { label: 'Filter Name', key: 'filterName', value: '' },
|
|
23336
|
+
// { label: 'Filter Pattern', key: 'filterPattern', value: '' },
|
|
23337
|
+
//];
|
|
23338
|
+
//parameterSets['codecommit'] = [
|
|
23339
|
+
// {
|
|
23340
|
+
// label: 'Repository Name',
|
|
23341
|
+
// key: 'repository',
|
|
23342
|
+
// value: '',
|
|
23343
|
+
// required: true,
|
|
23344
|
+
// function: 'attachDataList',
|
|
23345
|
+
// },
|
|
23346
|
+
// { label: 'Trigger Name', key: 'trigger', value: '', required: true },
|
|
23347
|
+
// {
|
|
23348
|
+
// label: 'Events',
|
|
23349
|
+
// key: 'events',
|
|
23350
|
+
// value: '',
|
|
23351
|
+
// list: [
|
|
23352
|
+
// { k: 'all', v: 'all' },
|
|
23353
|
+
// { k: 'updateReference', v: 'updateReference' },
|
|
23354
|
+
// { k: 'createReference', v: 'createReference' },
|
|
23355
|
+
// { k: 'deleteReference', v: 'deleteReference' },
|
|
23356
|
+
// ],
|
|
23357
|
+
// },
|
|
23358
|
+
// { label: 'Branch Names', key: 'branchNames', value: '' },
|
|
23359
|
+
// { label: 'Custom Data', key: 'customData', value: '' },
|
|
23360
|
+
//];
|
|
23310
23361
|
|
|
23311
23362
|
return {
|
|
23312
23363
|
init: init,
|
|
@@ -32485,7 +32536,7 @@ RED.editor = (function () {
|
|
|
32485
32536
|
RED.editor.registerTypeEditor("_buffer", definition);
|
|
32486
32537
|
|
|
32487
32538
|
})();
|
|
32488
|
-
;(function() {
|
|
32539
|
+
;(function () {
|
|
32489
32540
|
var template =
|
|
32490
32541
|
'<script type="text/x-kumologica" data-template-name="_expression">' +
|
|
32491
32542
|
'<div id="node-input-expression-panels">' +
|
|
@@ -32518,7 +32569,7 @@ RED.editor = (function () {
|
|
|
32518
32569
|
var expressionTestCache = {};
|
|
32519
32570
|
|
|
32520
32571
|
var definition = {
|
|
32521
|
-
show: function(options) {
|
|
32572
|
+
show: function (options) {
|
|
32522
32573
|
var expressionTestCacheId = options.parent || '_';
|
|
32523
32574
|
var value = options.value;
|
|
32524
32575
|
var onComplete = options.complete;
|
|
@@ -32536,7 +32587,7 @@ RED.editor = (function () {
|
|
|
32536
32587
|
{
|
|
32537
32588
|
id: 'node-dialog-cancel',
|
|
32538
32589
|
text: 'Cancel',
|
|
32539
|
-
click: function() {
|
|
32590
|
+
click: function () {
|
|
32540
32591
|
RED.tray.close();
|
|
32541
32592
|
}
|
|
32542
32593
|
},
|
|
@@ -32544,21 +32595,21 @@ RED.editor = (function () {
|
|
|
32544
32595
|
id: 'node-dialog-ok',
|
|
32545
32596
|
text: 'Done',
|
|
32546
32597
|
class: 'primary',
|
|
32547
|
-
click: function() {
|
|
32598
|
+
click: function () {
|
|
32548
32599
|
$('#node-input-expression-help').text('');
|
|
32549
|
-
RED.tray.close(undefined, ()=> {
|
|
32600
|
+
RED.tray.close(undefined, () => {
|
|
32550
32601
|
onComplete(expressionEditor.getValue());
|
|
32551
32602
|
});
|
|
32552
32603
|
}
|
|
32553
32604
|
}
|
|
32554
32605
|
],
|
|
32555
|
-
resize: function(dimensions) {
|
|
32606
|
+
resize: function (dimensions) {
|
|
32556
32607
|
var height = $('#dialog-form').height();
|
|
32557
32608
|
if (panels) {
|
|
32558
32609
|
panels.resize(height);
|
|
32559
32610
|
}
|
|
32560
32611
|
},
|
|
32561
|
-
open: function(tray) {
|
|
32612
|
+
open: function (tray) {
|
|
32562
32613
|
var trayBody = tray.find('.editor-tray-body');
|
|
32563
32614
|
trayBody.addClass('node-input-expression-editor');
|
|
32564
32615
|
var dialogForm = RED.editor.buildEditForm(
|
|
@@ -32568,14 +32619,14 @@ RED.editor = (function () {
|
|
|
32568
32619
|
'editor'
|
|
32569
32620
|
);
|
|
32570
32621
|
var funcSelect = $('#node-input-expression-func');
|
|
32571
|
-
Object.keys(jsonata.functions).forEach(function(f) {
|
|
32622
|
+
Object.keys(jsonata.functions).forEach(function (f) {
|
|
32572
32623
|
funcSelect.append(
|
|
32573
32624
|
$('<option></option>')
|
|
32574
32625
|
.val(f)
|
|
32575
32626
|
.text(f)
|
|
32576
32627
|
);
|
|
32577
32628
|
});
|
|
32578
|
-
funcSelect.change(function(e) {
|
|
32629
|
+
funcSelect.change(function (e) {
|
|
32579
32630
|
var f = $(this).val();
|
|
32580
32631
|
var args = RED._('jsonata:' + f + '.args', { defaultValue: '' });
|
|
32581
32632
|
var title = '<h5>' + f + '(' + args + ')</h5>';
|
|
@@ -32600,7 +32651,7 @@ RED.editor = (function () {
|
|
|
32600
32651
|
var currentFunctionMarker = null;
|
|
32601
32652
|
|
|
32602
32653
|
expressionEditor.getSession().setValue(value || '', -1);
|
|
32603
|
-
expressionEditor.on('changeSelection', function() {
|
|
32654
|
+
expressionEditor.on('changeSelection', function () {
|
|
32604
32655
|
var c = expressionEditor.getCursorPosition();
|
|
32605
32656
|
var token = expressionEditor
|
|
32606
32657
|
.getSession()
|
|
@@ -32675,7 +32726,7 @@ RED.editor = (function () {
|
|
|
32675
32726
|
});
|
|
32676
32727
|
|
|
32677
32728
|
dialogForm.i18n();
|
|
32678
|
-
$('#node-input-expression-func-insert').click(function(e) {
|
|
32729
|
+
$('#node-input-expression-func-insert').click(function (e) {
|
|
32679
32730
|
e.preventDefault();
|
|
32680
32731
|
var pos = expressionEditor.getCursorPosition();
|
|
32681
32732
|
var f = funcSelect.val();
|
|
@@ -32683,7 +32734,7 @@ RED.editor = (function () {
|
|
|
32683
32734
|
expressionEditor.insertSnippet(snippet);
|
|
32684
32735
|
expressionEditor.focus();
|
|
32685
32736
|
});
|
|
32686
|
-
$('#node-input-expression-reformat').click(function(evt) {
|
|
32737
|
+
$('#node-input-expression-reformat').click(function (evt) {
|
|
32687
32738
|
evt.preventDefault();
|
|
32688
32739
|
var v = expressionEditor.getValue() || '';
|
|
32689
32740
|
try {
|
|
@@ -32696,7 +32747,7 @@ RED.editor = (function () {
|
|
|
32696
32747
|
|
|
32697
32748
|
var tabs = RED.tabs.create({
|
|
32698
32749
|
element: $('#node-input-expression-tabs'),
|
|
32699
|
-
onchange: function(tab) {
|
|
32750
|
+
onchange: function (tab) {
|
|
32700
32751
|
$('.node-input-expression-tab-content').hide();
|
|
32701
32752
|
tab.content.show();
|
|
32702
32753
|
trayOptions.resize();
|
|
@@ -32722,12 +32773,12 @@ RED.editor = (function () {
|
|
|
32722
32773
|
lineNumbers: false
|
|
32723
32774
|
});
|
|
32724
32775
|
var changeTimer;
|
|
32725
|
-
$('.node-input-expression-legacy').click(function(e) {
|
|
32776
|
+
$('.node-input-expression-legacy').click(function (e) {
|
|
32726
32777
|
e.preventDefault();
|
|
32727
32778
|
RED.sidebar.info.set(RED._('expressionEditor.compatModeDesc'));
|
|
32728
32779
|
RED.sidebar.info.show();
|
|
32729
32780
|
});
|
|
32730
|
-
var testExpression = function() {
|
|
32781
|
+
var testExpression = function () {
|
|
32731
32782
|
var value = testDataEditor.getValue();
|
|
32732
32783
|
var parsedData;
|
|
32733
32784
|
var currentExpression = expressionEditor.getValue();
|
|
@@ -32739,11 +32790,11 @@ RED.editor = (function () {
|
|
|
32739
32790
|
$('.node-input-expression-legacy').toggle(legacyMode);
|
|
32740
32791
|
try {
|
|
32741
32792
|
expr = jsonata(currentExpression);
|
|
32742
|
-
expr.assign('flowContext', function(val) {
|
|
32793
|
+
expr.assign('flowContext', function (val) {
|
|
32743
32794
|
usesContext = true;
|
|
32744
32795
|
return null;
|
|
32745
32796
|
});
|
|
32746
|
-
expr.assign('globalContext', function(val) {
|
|
32797
|
+
expr.assign('globalContext', function (val) {
|
|
32747
32798
|
usesContext = true;
|
|
32748
32799
|
return null;
|
|
32749
32800
|
});
|
|
@@ -32794,14 +32845,14 @@ RED.editor = (function () {
|
|
|
32794
32845
|
}
|
|
32795
32846
|
};
|
|
32796
32847
|
|
|
32797
|
-
testDataEditor.getSession().on('change', function() {
|
|
32848
|
+
testDataEditor.getSession().on('change', function () {
|
|
32798
32849
|
clearTimeout(changeTimer);
|
|
32799
32850
|
changeTimer = setTimeout(testExpression, 200);
|
|
32800
32851
|
expressionTestCache[
|
|
32801
32852
|
expressionTestCacheId
|
|
32802
32853
|
] = testDataEditor.getValue();
|
|
32803
32854
|
});
|
|
32804
|
-
expressionEditor.getSession().on('change', function() {
|
|
32855
|
+
expressionEditor.getSession().on('change', function () {
|
|
32805
32856
|
clearTimeout(changeTimer);
|
|
32806
32857
|
changeTimer = setTimeout(testExpression, 200);
|
|
32807
32858
|
});
|
|
@@ -32815,7 +32866,7 @@ RED.editor = (function () {
|
|
|
32815
32866
|
});
|
|
32816
32867
|
panels = RED.panels.create({
|
|
32817
32868
|
id: 'node-input-expression-panels',
|
|
32818
|
-
resize: function(p1Height, p2Height) {
|
|
32869
|
+
resize: function (p1Height, p2Height) {
|
|
32819
32870
|
var p1 = $('#node-input-expression-panel-expr');
|
|
32820
32871
|
p1Height -= $(p1.children()[0]).outerHeight(true);
|
|
32821
32872
|
var editorRow = $(p1.children()[1]);
|
|
@@ -32843,7 +32894,7 @@ RED.editor = (function () {
|
|
|
32843
32894
|
}
|
|
32844
32895
|
});
|
|
32845
32896
|
|
|
32846
|
-
$('#node-input-example-reformat').click(function(evt) {
|
|
32897
|
+
$('#node-input-example-reformat').click(function (evt) {
|
|
32847
32898
|
evt.preventDefault();
|
|
32848
32899
|
var v = testDataEditor.getValue() || '';
|
|
32849
32900
|
try {
|
|
@@ -32856,14 +32907,14 @@ RED.editor = (function () {
|
|
|
32856
32907
|
|
|
32857
32908
|
testExpression();
|
|
32858
32909
|
},
|
|
32859
|
-
close: function() {
|
|
32910
|
+
close: function () {
|
|
32860
32911
|
if (options.onclose) {
|
|
32861
32912
|
options.onclose();
|
|
32862
32913
|
}
|
|
32863
32914
|
expressionEditor.destroy();
|
|
32864
32915
|
testDataEditor.destroy();
|
|
32865
32916
|
},
|
|
32866
|
-
show: function() {}
|
|
32917
|
+
show: function () { }
|
|
32867
32918
|
};
|
|
32868
32919
|
RED.tray.show(trayOptions);
|
|
32869
32920
|
}
|
|
@@ -32875,241 +32926,269 @@ RED.editor = (function () {
|
|
|
32875
32926
|
const jsonataFns =
|
|
32876
32927
|
{
|
|
32877
32928
|
"$string": {
|
|
32878
|
-
|
|
32879
|
-
|
|
32929
|
+
"args": "arg",
|
|
32930
|
+
"desc": "Casts the *arg* parameter to a string using the following casting rules:\n\n - Strings are unchanged\n - Functions are converted to an empty string\n - Numeric infinity and NaN throw an error because they cannot be represented as a JSON number\n - All other values are converted to a JSON string using the `JSON.stringify` function"
|
|
32880
32931
|
},
|
|
32881
32932
|
"$length": {
|
|
32882
|
-
|
|
32883
|
-
|
|
32933
|
+
"args": "str",
|
|
32934
|
+
"desc": "Returns the number of characters in the string `str`. An error is thrown if `str` is not a string."
|
|
32884
32935
|
},
|
|
32885
32936
|
"$substring": {
|
|
32886
|
-
|
|
32887
|
-
|
|
32937
|
+
"args": "str, start[, length]",
|
|
32938
|
+
"desc": "Returns a string containing the characters in the first parameter `str` starting at position `start` (zero-offset). If `length` is specified, then the substring will contain maximum `length` characters. If `start` is negative then it indicates the number of characters from the end of `str`."
|
|
32888
32939
|
},
|
|
32889
32940
|
"$substringBefore": {
|
|
32890
|
-
|
|
32891
|
-
|
|
32941
|
+
"args": "str, chars",
|
|
32942
|
+
"desc": "Returns the substring before the first occurrence of the character sequence `chars` in `str`. If `str` does not contain `chars`, then it returns `str`."
|
|
32892
32943
|
},
|
|
32893
32944
|
"$substringAfter": {
|
|
32894
|
-
|
|
32895
|
-
|
|
32945
|
+
"args": "str, chars",
|
|
32946
|
+
"desc": "Returns the substring after the first occurrence of the character sequence `chars` in `str`. If `str` does not contain `chars`, then it returns `str`."
|
|
32896
32947
|
},
|
|
32897
32948
|
"$uppercase": {
|
|
32898
|
-
|
|
32899
|
-
|
|
32949
|
+
"args": "str",
|
|
32950
|
+
"desc": "Returns a string with all the characters of `str` converted to uppercase."
|
|
32900
32951
|
},
|
|
32901
32952
|
"$lowercase": {
|
|
32902
|
-
|
|
32903
|
-
|
|
32953
|
+
"args": "str",
|
|
32954
|
+
"desc": "Returns a string with all the characters of `str` converted to lowercase."
|
|
32904
32955
|
},
|
|
32905
32956
|
"$trim": {
|
|
32906
|
-
|
|
32907
|
-
|
|
32957
|
+
"args": "str",
|
|
32958
|
+
"desc": "Normalizes and trims all whitespace characters in `str` by applying the following steps:\n\n - All tabs, carriage returns, and line feeds are replaced with spaces.\n- Contiguous sequences of spaces are reduced to a single space.\n- Trailing and leading spaces are removed.\n\n If `str` is not specified (i.e. this function is invoked with no arguments), then the context value is used as the value of `str`. An error is thrown if `str` is not a string."
|
|
32908
32959
|
},
|
|
32909
32960
|
"$contains": {
|
|
32910
|
-
|
|
32911
|
-
|
|
32961
|
+
"args": "str, pattern",
|
|
32962
|
+
"desc": "Returns `true` if `str` is matched by `pattern`, otherwise it returns `false`. If `str` is not specified (i.e. this function is invoked with one argument), then the context value is used as the value of `str`. The `pattern` parameter can either be a string or a regular expression."
|
|
32912
32963
|
},
|
|
32913
32964
|
"$split": {
|
|
32914
|
-
|
|
32915
|
-
|
|
32965
|
+
"args": "str[, separator][, limit]",
|
|
32966
|
+
"desc": "Splits the `str` parameter into an array of substrings. It is an error if `str` is not a string. The optional `separator` parameter specifies the characters within the `str` about which it should be split as either a string or regular expression. If `separator` is not specified, then the empty string is assumed, and `str` will be split into an array of single characters. It is an error if `separator` is not a string. The optional `limit` parameter is a number that specifies the maximum number of substrings to include in the resultant array. Any additional substrings are discarded. If `limit` is not specified, then `str` is fully split with no limit to the size of the resultant array. It is an error if `limit` is not a non-negative number."
|
|
32916
32967
|
},
|
|
32917
32968
|
"$join": {
|
|
32918
|
-
|
|
32919
|
-
|
|
32969
|
+
"args": "array[, separator]",
|
|
32970
|
+
"desc": "Joins an array of component strings into a single concatenated string with each component string separated by the optional `separator` parameter. It is an error if the input `array` contains an item which isn't a string. If `separator` is not specified, then it is assumed to be the empty string, i.e. no `separator` between the component strings. It is an error if `separator` is not a string."
|
|
32920
32971
|
},
|
|
32921
32972
|
"$match": {
|
|
32922
|
-
|
|
32923
|
-
|
|
32973
|
+
"args": "str, pattern [, limit]",
|
|
32974
|
+
"desc": "Applies the `str` string to the `pattern` regular expression and returns an array of objects, with each object containing information about each occurrence of a match within `str`."
|
|
32924
32975
|
},
|
|
32925
32976
|
"$replace": {
|
|
32926
|
-
|
|
32927
|
-
|
|
32977
|
+
"args": "str, pattern, replacement [, limit]",
|
|
32978
|
+
"desc": "Finds occurrences of `pattern` within `str` and replaces them with `replacement`.\n\nThe optional `limit` parameter is the maximum number of replacements."
|
|
32928
32979
|
},
|
|
32929
32980
|
"$now": {
|
|
32930
|
-
|
|
32931
|
-
|
|
32981
|
+
"args": "",
|
|
32982
|
+
"desc": "Generates a timestamp in ISO 8601 compatible format and returns it as a string."
|
|
32932
32983
|
},
|
|
32933
32984
|
"$base64encode": {
|
|
32934
|
-
|
|
32935
|
-
|
|
32985
|
+
"args": "string",
|
|
32986
|
+
"desc": "Converts an ASCII string to a base 64 representation. Each character in the string is treated as a byte of binary data. This requires that all characters in the string are in the 0x00 to 0xFF range, which includes all characters in URI encoded strings. Unicode characters outside of that range are not supported."
|
|
32936
32987
|
},
|
|
32937
32988
|
"$base64decode": {
|
|
32938
|
-
|
|
32939
|
-
|
|
32989
|
+
"args": "string",
|
|
32990
|
+
"desc": "Converts base 64 encoded bytes to a string, using a UTF-8 Unicode codepage."
|
|
32940
32991
|
},
|
|
32941
32992
|
"$number": {
|
|
32942
|
-
|
|
32943
|
-
|
|
32993
|
+
"args": "arg",
|
|
32994
|
+
"desc": "Casts the `arg` parameter to a number using the following casting rules:\n\n - Numbers are unchanged\n - Strings that contain a sequence of characters that represent a legal JSON number are converted to that number\n - All other values cause an error to be thrown."
|
|
32944
32995
|
},
|
|
32945
32996
|
"$abs": {
|
|
32946
|
-
|
|
32947
|
-
|
|
32997
|
+
"args": "number",
|
|
32998
|
+
"desc": "Returns the absolute value of the `number` parameter."
|
|
32948
32999
|
},
|
|
32949
33000
|
"$floor": {
|
|
32950
|
-
|
|
32951
|
-
|
|
33001
|
+
"args": "number",
|
|
33002
|
+
"desc": "Returns the value of `number` rounded down to the nearest integer that is smaller or equal to `number`."
|
|
32952
33003
|
},
|
|
32953
33004
|
"$ceil": {
|
|
32954
|
-
|
|
32955
|
-
|
|
33005
|
+
"args": "number",
|
|
33006
|
+
"desc": "Returns the value of `number` rounded up to the nearest integer that is greater than or equal to `number`."
|
|
32956
33007
|
},
|
|
32957
33008
|
"$round": {
|
|
32958
|
-
|
|
32959
|
-
|
|
33009
|
+
"args": "number [, precision]",
|
|
33010
|
+
"desc": "Returns the value of the `number` parameter rounded to the number of decimal places specified by the optional `precision` parameter."
|
|
32960
33011
|
},
|
|
32961
33012
|
"$power": {
|
|
32962
|
-
|
|
32963
|
-
|
|
33013
|
+
"args": "base, exponent",
|
|
33014
|
+
"desc": "Returns the value of `base` raised to the power of `exponent`."
|
|
32964
33015
|
},
|
|
32965
33016
|
"$sqrt": {
|
|
32966
|
-
|
|
32967
|
-
|
|
33017
|
+
"args": "number",
|
|
33018
|
+
"desc": "Returns the square root of the value of the `number` parameter."
|
|
32968
33019
|
},
|
|
32969
33020
|
"$random": {
|
|
32970
|
-
|
|
32971
|
-
|
|
33021
|
+
"args": "",
|
|
33022
|
+
"desc": "Returns a pseudo random number greater than or equal to zero and less than one."
|
|
32972
33023
|
},
|
|
32973
33024
|
"$millis": {
|
|
32974
|
-
|
|
32975
|
-
|
|
33025
|
+
"args": "",
|
|
33026
|
+
"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."
|
|
32976
33027
|
},
|
|
32977
33028
|
"$sum": {
|
|
32978
|
-
|
|
32979
|
-
|
|
33029
|
+
"args": "array",
|
|
33030
|
+
"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."
|
|
32980
33031
|
},
|
|
32981
33032
|
"$max": {
|
|
32982
|
-
|
|
32983
|
-
|
|
33033
|
+
"args": "array",
|
|
33034
|
+
"desc": "Returns the maximum number in an `array` of numbers. It is an error if the input `array` contains an item which isn't a number."
|
|
32984
33035
|
},
|
|
32985
33036
|
"$min": {
|
|
32986
|
-
|
|
32987
|
-
|
|
33037
|
+
"args": "array",
|
|
33038
|
+
"desc": "Returns the minimum number in an `array` of numbers. It is an error if the input `array` contains an item which isn't a number."
|
|
32988
33039
|
},
|
|
32989
33040
|
"$average": {
|
|
32990
|
-
|
|
32991
|
-
|
|
33041
|
+
"args": "array",
|
|
33042
|
+
"desc": "Returns the mean value of an `array` of numbers. It is an error if the input `array` contains an item which isn't a number."
|
|
32992
33043
|
},
|
|
32993
33044
|
"$boolean": {
|
|
32994
|
-
|
|
32995
|
-
|
|
33045
|
+
"args": "arg",
|
|
33046
|
+
"desc": "Casts the argument to a Boolean using the following rules:\n\n - `Boolean` : unchanged\n - `string`: empty : `false`\n - `string`: non-empty : `true`\n - `number`: `0` : `false`\n - `number`: non-zero : `true`\n - `null` : `false`\n - `array`: empty : `false`\n - `array`: contains a member that casts to `true` : `true`\n - `array`: all members cast to `false` : `false`\n - `object`: empty : `false`\n - `object`: non-empty : `true`\n - `function` : `false`"
|
|
32996
33047
|
},
|
|
32997
33048
|
"$not": {
|
|
32998
|
-
|
|
32999
|
-
|
|
33049
|
+
"args": "arg",
|
|
33050
|
+
"desc": "Returns Boolean NOT on the argument. `arg` is first cast to a boolean"
|
|
33000
33051
|
},
|
|
33001
33052
|
"$exists": {
|
|
33002
|
-
|
|
33003
|
-
|
|
33053
|
+
"args": "arg",
|
|
33054
|
+
"desc": "Returns Boolean `true` if the `arg` expression evaluates to a value, or `false` if the expression does not match anything (e.g. a path to a non-existent field reference)."
|
|
33004
33055
|
},
|
|
33005
33056
|
"$count": {
|
|
33006
|
-
|
|
33007
|
-
|
|
33057
|
+
"args": "array",
|
|
33058
|
+
"desc": "Returns the number of items in the array"
|
|
33008
33059
|
},
|
|
33009
33060
|
"$append": {
|
|
33010
|
-
|
|
33011
|
-
|
|
33061
|
+
"args": "array, array",
|
|
33062
|
+
"desc": "Appends two arrays"
|
|
33012
33063
|
},
|
|
33013
33064
|
"$sort": {
|
|
33014
|
-
|
|
33015
|
-
|
|
33065
|
+
"args": "array [, function]",
|
|
33066
|
+
"desc": "Returns an array containing all the values in the `array` parameter, but sorted into order.\n\nIf a comparator `function` is supplied, then it must be a function that takes two parameters:\n\n`function(left, right)`\n\nThis function gets invoked by the sorting algorithm to compare two values left and right. If the value of left should be placed after the value of right in the desired sort order, then the function must return Boolean `true` to indicate a swap. Otherwise it must return `false`."
|
|
33016
33067
|
},
|
|
33017
33068
|
"$reverse": {
|
|
33018
|
-
|
|
33019
|
-
|
|
33069
|
+
"args": "array",
|
|
33070
|
+
"desc": "Returns an array containing all the values from the `array` parameter, but in reverse order."
|
|
33020
33071
|
},
|
|
33021
33072
|
"$shuffle": {
|
|
33022
|
-
|
|
33023
|
-
|
|
33073
|
+
"args": "array",
|
|
33074
|
+
"desc": "Returns an array containing all the values from the `array` parameter, but shuffled into random order."
|
|
33024
33075
|
},
|
|
33025
33076
|
"$zip": {
|
|
33026
|
-
|
|
33027
|
-
|
|
33077
|
+
"args": "array, ...",
|
|
33078
|
+
"desc": "Returns a convolved (zipped) array containing grouped arrays of values from the `array1` … `arrayN` arguments from index 0, 1, 2...."
|
|
33028
33079
|
},
|
|
33029
33080
|
"$keys": {
|
|
33030
|
-
|
|
33031
|
-
|
|
33081
|
+
"args": "object",
|
|
33082
|
+
"desc": "Returns an array containing the keys in the object. If the argument is an array of objects, then the array returned contains a de-duplicated list of all the keys in all of the objects."
|
|
33032
33083
|
},
|
|
33033
33084
|
"$lookup": {
|
|
33034
|
-
|
|
33035
|
-
|
|
33085
|
+
"args": "object, key",
|
|
33086
|
+
"desc": "Returns the value associated with key in object. If the first argument is an array of objects, then all of the objects in the array are searched, and the values associated with all occurrences of key are returned."
|
|
33036
33087
|
},
|
|
33037
33088
|
"$spread": {
|
|
33038
|
-
|
|
33039
|
-
|
|
33089
|
+
"args": "object",
|
|
33090
|
+
"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."
|
|
33040
33091
|
},
|
|
33041
33092
|
"$merge": {
|
|
33042
|
-
|
|
33043
|
-
|
|
33093
|
+
"args": "array<object>",
|
|
33094
|
+
"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."
|
|
33044
33095
|
},
|
|
33045
33096
|
"$sift": {
|
|
33046
|
-
|
|
33047
|
-
|
|
33097
|
+
"args": "object, function",
|
|
33098
|
+
"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]])`"
|
|
33048
33099
|
},
|
|
33049
33100
|
"$each": {
|
|
33050
|
-
|
|
33051
|
-
|
|
33101
|
+
"args": "object, function",
|
|
33102
|
+
"desc": "Returns an array containing the values return by the `function` when applied to each key/value pair in the `object`."
|
|
33052
33103
|
},
|
|
33053
33104
|
"$map": {
|
|
33054
|
-
|
|
33055
|
-
|
|
33105
|
+
"args": "array, function",
|
|
33106
|
+
"desc": "Returns an array containing the results of applying the `function` parameter to each value in the `array` parameter.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, index [, array]])`"
|
|
33056
33107
|
},
|
|
33057
33108
|
"$filter": {
|
|
33058
|
-
|
|
33059
|
-
|
|
33109
|
+
"args": "array, function",
|
|
33110
|
+
"desc": "Returns an array containing only the values in the `array` parameter that satisfy the `function` predicate.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, index [, array]])`"
|
|
33060
33111
|
},
|
|
33061
33112
|
"$reduce": {
|
|
33062
|
-
|
|
33063
|
-
|
|
33113
|
+
"args": "array, function [, init]",
|
|
33114
|
+
"desc": "Returns an aggregated value derived from applying the `function` parameter successively to each value in `array` in combination with the result of the previous application of the function.\n\nThe function must accept two arguments, and behaves like an infix operator between each value within the `array`.\n\nThe optional `init` parameter is used as the initial value in the aggregation."
|
|
33064
33115
|
},
|
|
33065
33116
|
"$flowContext": {
|
|
33066
|
-
|
|
33067
|
-
|
|
33117
|
+
"args": "string[, string]",
|
|
33118
|
+
"desc": "Retrieves a flow context property.\n\nThis is a kumologica-core defined function."
|
|
33068
33119
|
},
|
|
33069
33120
|
"$globalContext": {
|
|
33070
|
-
|
|
33071
|
-
|
|
33121
|
+
"args": "string[, string]",
|
|
33122
|
+
"desc": "Retrieves a global context property.\n\nThis is a kumologica-core defined function."
|
|
33072
33123
|
},
|
|
33073
33124
|
"$pad": {
|
|
33074
|
-
|
|
33075
|
-
|
|
33125
|
+
"args": "string, width [, char]",
|
|
33126
|
+
"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."
|
|
33076
33127
|
},
|
|
33077
33128
|
"$fromMillis": {
|
|
33078
|
-
|
|
33079
|
-
|
|
33129
|
+
"args": "number",
|
|
33130
|
+
"desc": "Convert a number representing milliseconds since the Unix Epoch (1 January, 1970 UTC) to a timestamp string in the ISO 8601 format."
|
|
33080
33131
|
},
|
|
33081
33132
|
"$formatNumber": {
|
|
33082
|
-
|
|
33083
|
-
|
|
33133
|
+
"args": "number, picture [, options]",
|
|
33134
|
+
"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."
|
|
33084
33135
|
},
|
|
33085
33136
|
"$formatBase": {
|
|
33086
|
-
|
|
33087
|
-
|
|
33137
|
+
"args": "number [, radix]",
|
|
33138
|
+
"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."
|
|
33088
33139
|
},
|
|
33089
33140
|
"$toMillis": {
|
|
33090
|
-
|
|
33091
|
-
|
|
33141
|
+
"args": "timestamp",
|
|
33142
|
+
"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."
|
|
33092
33143
|
},
|
|
33093
33144
|
"$env": {
|
|
33094
|
-
|
|
33095
|
-
|
|
33145
|
+
"args": "arg",
|
|
33146
|
+
"desc": "Returns the value of an environment variable.\n\nThis is a kumologica-core defined function."
|
|
33096
33147
|
},
|
|
33097
33148
|
"$eval": {
|
|
33098
|
-
|
|
33099
|
-
|
|
33149
|
+
"args": "expr [, context]",
|
|
33150
|
+
"desc": "Parses and evaluates the string `expr` which contains literal JSON or a JSONata expression using the current context as the context for evaluation."
|
|
33100
33151
|
},
|
|
33101
33152
|
"$formatInteger": {
|
|
33102
|
-
|
|
33103
|
-
|
|
33153
|
+
"args": "number, picture",
|
|
33154
|
+
"desc": "Casts the `number` to a string and formats it to an integer representation as specified by the `picture` string. The picture string parameter defines how the number is formatted and has the same syntax as `fn:format-integer` from the XPath F&O 3.1 specification."
|
|
33104
33155
|
},
|
|
33105
33156
|
"$parseInteger": {
|
|
33106
|
-
|
|
33107
|
-
|
|
33157
|
+
"args": "string, picture",
|
|
33158
|
+
"desc": "Parses the contents of the `string` parameter to an integer (as a JSON number) using the format specified by the `picture` string. The `picture` string parameter has the same format as `$formatInteger`."
|
|
33108
33159
|
|
|
33109
33160
|
},
|
|
33110
33161
|
"$single": {
|
|
33111
|
-
|
|
33112
|
-
|
|
33162
|
+
"args": "array, function",
|
|
33163
|
+
"desc": "Returns the one and only one value in the array parameter that satisfy the function predicate"
|
|
33164
|
+
},
|
|
33165
|
+
"$maskjson": {
|
|
33166
|
+
"args": "object, object",
|
|
33167
|
+
"desc": "Returns masked phone,email,password,phone or card number for a given input JSON content passed as first argument. The masking rule can be passed as the second argument object"
|
|
33168
|
+
},
|
|
33169
|
+
"$maskphone": {
|
|
33170
|
+
"args": "string, object",
|
|
33171
|
+
"desc": "Returns masked phone number for a given input phone number passed as first argument. The masking rule can be passed as the second argument object"
|
|
33172
|
+
},
|
|
33173
|
+
"$maskemail": {
|
|
33174
|
+
"args": "string, object",
|
|
33175
|
+
"desc": "Returns masked email for a given input email id passed as first argument. The masking rule can be passed as the second argument object"
|
|
33176
|
+
},
|
|
33177
|
+
"$maskcard": {
|
|
33178
|
+
"args": "string, object",
|
|
33179
|
+
"desc": "Returns masked card number for a given input credit or debit card number passed as first argument. The masking rule can be passed as the second argument object"
|
|
33180
|
+
},
|
|
33181
|
+
"$maskpassword": {
|
|
33182
|
+
"args": "string, object",
|
|
33183
|
+
"desc": "Returns masked password for a given field as password passed as first argument. The masking rule can be passed as the second argument object"
|
|
33184
|
+
},
|
|
33185
|
+
"$queryparam": {
|
|
33186
|
+
"args": "string",
|
|
33187
|
+
"desc": "Returns the value for the given query parameter key"
|
|
33188
|
+
},
|
|
33189
|
+
"$uriparam": {
|
|
33190
|
+
"args": "string",
|
|
33191
|
+
"desc": "Returns the value for the given path parameter key"
|
|
33113
33192
|
}
|
|
33114
33193
|
}
|
|
33115
33194
|
;
|