@bigbinary/neeto-rules-frontend 2.7.21 → 2.7.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/.ready
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Built at 2026-09-
|
|
1
|
+
Built at 2026-09-02T17:36:31.607Z
|
|
@@ -484,6 +484,18 @@ var actionParts = function actionParts(_ref11) {
|
|
|
484
484
|
recipientSubtitle: channelMeta.recipientSubtitle || (option === null || option === void 0 ? void 0 : option.recipientSubtitle)
|
|
485
485
|
};
|
|
486
486
|
};
|
|
487
|
+
|
|
488
|
+
// Which condition fields a host offers can depend on the rule — a trigger may
|
|
489
|
+
// only support a subset. Lookups deliberately keep using the full list so a
|
|
490
|
+
// field already on the rule still resolves after the offer narrows.
|
|
491
|
+
var offeredConditionFields = function offeredConditionFields(_ref12) {
|
|
492
|
+
var _ref13, _schema$conditions$fi, _schema$conditions3, _schema$conditions3$f, _schema$conditions4;
|
|
493
|
+
var schema = _ref12.schema,
|
|
494
|
+
rule = _ref12.rule;
|
|
495
|
+
return (_ref13 = (_schema$conditions$fi = schema === null || schema === void 0 || (_schema$conditions3 = schema.conditions) === null || _schema$conditions3 === void 0 || (_schema$conditions3$f = _schema$conditions3.fieldsFor) === null || _schema$conditions3$f === void 0 ? void 0 : _schema$conditions3$f.call(_schema$conditions3, {
|
|
496
|
+
rule: rule
|
|
497
|
+
})) !== null && _schema$conditions$fi !== void 0 ? _schema$conditions$fi : schema === null || schema === void 0 || (_schema$conditions4 = schema.conditions) === null || _schema$conditions4 === void 0 ? void 0 : _schema$conditions4.fields) !== null && _ref13 !== void 0 ? _ref13 : [];
|
|
498
|
+
};
|
|
487
499
|
var hasTrigger = function hasTrigger(rule) {
|
|
488
500
|
return !ramda.isEmpty((rule === null || rule === void 0 ? void 0 : rule.triggers) || []);
|
|
489
501
|
};
|
|
@@ -495,28 +507,28 @@ var hasAction = function hasAction(rule) {
|
|
|
495
507
|
var isRuleComplete = function isRuleComplete(rule) {
|
|
496
508
|
return hasTrigger(rule) && hasAction(rule);
|
|
497
509
|
};
|
|
498
|
-
var scopeOptionFor = function scopeOptionFor(
|
|
510
|
+
var scopeOptionFor = function scopeOptionFor(_ref14) {
|
|
499
511
|
var _item$value, _schema$scope;
|
|
500
|
-
var schema =
|
|
501
|
-
item =
|
|
512
|
+
var schema = _ref14.schema,
|
|
513
|
+
item = _ref14.item;
|
|
502
514
|
var value = (_item$value = item === null || item === void 0 ? void 0 : item.value) !== null && _item$value !== void 0 ? _item$value : item;
|
|
503
515
|
return ((schema === null || schema === void 0 || (_schema$scope = schema.scope) === null || _schema$scope === void 0 ? void 0 : _schema$scope.options) || []).find(function (candidate) {
|
|
504
516
|
var _candidate$value2;
|
|
505
517
|
return ((_candidate$value2 = candidate.value) !== null && _candidate$value2 !== void 0 ? _candidate$value2 : candidate.id) === value;
|
|
506
518
|
});
|
|
507
519
|
};
|
|
508
|
-
var scopePhoneFields = function scopePhoneFields(
|
|
509
|
-
var
|
|
510
|
-
var schema =
|
|
511
|
-
item =
|
|
512
|
-
return (
|
|
520
|
+
var scopePhoneFields = function scopePhoneFields(_ref15) {
|
|
521
|
+
var _ref16, _item$phoneFields, _scopeOptionFor;
|
|
522
|
+
var schema = _ref15.schema,
|
|
523
|
+
item = _ref15.item;
|
|
524
|
+
return (_ref16 = (_item$phoneFields = item === null || item === void 0 ? void 0 : item.phoneFields) !== null && _item$phoneFields !== void 0 ? _item$phoneFields : (_scopeOptionFor = scopeOptionFor({
|
|
513
525
|
schema: schema,
|
|
514
526
|
item: item
|
|
515
|
-
})) === null || _scopeOptionFor === void 0 ? void 0 : _scopeOptionFor.phoneFields) !== null &&
|
|
527
|
+
})) === null || _scopeOptionFor === void 0 ? void 0 : _scopeOptionFor.phoneFields) !== null && _ref16 !== void 0 ? _ref16 : null;
|
|
516
528
|
};
|
|
517
|
-
var effectiveScopePhoneField = function effectiveScopePhoneField(
|
|
518
|
-
var schema =
|
|
519
|
-
item =
|
|
529
|
+
var effectiveScopePhoneField = function effectiveScopePhoneField(_ref17) {
|
|
530
|
+
var schema = _ref17.schema,
|
|
531
|
+
item = _ref17.item;
|
|
520
532
|
if (item !== null && item !== void 0 && item.phoneField) return item.phoneField;
|
|
521
533
|
var phoneFields = scopePhoneFields({
|
|
522
534
|
schema: schema,
|
|
@@ -524,14 +536,14 @@ var effectiveScopePhoneField = function effectiveScopePhoneField(_ref15) {
|
|
|
524
536
|
});
|
|
525
537
|
return (phoneFields === null || phoneFields === void 0 ? void 0 : phoneFields.length) === 1 ? phoneFields[0].value : undefined;
|
|
526
538
|
};
|
|
527
|
-
var invalidScopeIndexes = function invalidScopeIndexes(
|
|
539
|
+
var invalidScopeIndexes = function invalidScopeIndexes(_ref18) {
|
|
528
540
|
var _scope$requiresPhone;
|
|
529
|
-
var rule =
|
|
530
|
-
schema =
|
|
541
|
+
var rule = _ref18.rule,
|
|
542
|
+
schema = _ref18.schema;
|
|
531
543
|
var scope = schema === null || schema === void 0 ? void 0 : schema.scope;
|
|
532
544
|
if (!(scope !== null && scope !== void 0 && scope.enabled) || !((_scope$requiresPhone = scope.requiresPhone) !== null && _scope$requiresPhone !== void 0 && _scope$requiresPhone.call(scope, (rule === null || rule === void 0 ? void 0 : rule.actions) || []))) return [];
|
|
533
545
|
return ((rule === null || rule === void 0 ? void 0 : rule.scope) || []).reduce(function (indexes, item, index) {
|
|
534
|
-
var
|
|
546
|
+
var _ref19, _item$hasPhoneField;
|
|
535
547
|
var option = scopeOptionFor({
|
|
536
548
|
schema: schema,
|
|
537
549
|
item: item
|
|
@@ -540,15 +552,15 @@ var invalidScopeIndexes = function invalidScopeIndexes(_ref16) {
|
|
|
540
552
|
schema: schema,
|
|
541
553
|
item: item
|
|
542
554
|
});
|
|
543
|
-
var hasPhoneField = (
|
|
555
|
+
var hasPhoneField = (_ref19 = (_item$hasPhoneField = item === null || item === void 0 ? void 0 : item.hasPhoneField) !== null && _item$hasPhoneField !== void 0 ? _item$hasPhoneField : option === null || option === void 0 ? void 0 : option.hasPhoneField) !== null && _ref19 !== void 0 ? _ref19 : phoneFields ? phoneFields.length > 0 : undefined;
|
|
544
556
|
if (hasPhoneField === false) indexes.push(index);
|
|
545
557
|
return indexes;
|
|
546
558
|
}, []);
|
|
547
559
|
};
|
|
548
|
-
var invalidScopePhoneFieldIndexes = function invalidScopePhoneFieldIndexes(
|
|
560
|
+
var invalidScopePhoneFieldIndexes = function invalidScopePhoneFieldIndexes(_ref20) {
|
|
549
561
|
var _scope$requiresPhone2;
|
|
550
|
-
var rule =
|
|
551
|
-
schema =
|
|
562
|
+
var rule = _ref20.rule,
|
|
563
|
+
schema = _ref20.schema;
|
|
552
564
|
var scope = schema === null || schema === void 0 ? void 0 : schema.scope;
|
|
553
565
|
if (!(scope !== null && scope !== void 0 && scope.enabled) || !((_scope$requiresPhone2 = scope.requiresPhone) !== null && _scope$requiresPhone2 !== void 0 && _scope$requiresPhone2.call(scope, (rule === null || rule === void 0 ? void 0 : rule.actions) || []))) return [];
|
|
554
566
|
return ((rule === null || rule === void 0 ? void 0 : rule.scope) || []).reduce(function (indexes, item, index) {
|
|
@@ -585,9 +597,9 @@ var minutesToParts = function minutesToParts(minutes) {
|
|
|
585
597
|
unit: "minutes"
|
|
586
598
|
};
|
|
587
599
|
};
|
|
588
|
-
var partsToMinutes = function partsToMinutes(
|
|
589
|
-
var value =
|
|
590
|
-
unit =
|
|
600
|
+
var partsToMinutes = function partsToMinutes(_ref21) {
|
|
601
|
+
var value = _ref21.value,
|
|
602
|
+
unit = _ref21.unit;
|
|
591
603
|
return (
|
|
592
604
|
// eslint-disable-next-line security/detect-object-injection
|
|
593
605
|
(Number(value) || 0) * (UNIT_MINUTES[unit] || 1)
|
|
@@ -642,22 +654,22 @@ var modeFromJoinType = function modeFromJoinType(joinType) {
|
|
|
642
654
|
};
|
|
643
655
|
|
|
644
656
|
// eslint-disable-next-line security/detect-object-injection
|
|
645
|
-
var valueAt = function valueAt(
|
|
657
|
+
var valueAt = function valueAt(_ref22) {
|
|
646
658
|
var _values$key;
|
|
647
|
-
var values =
|
|
648
|
-
key =
|
|
659
|
+
var values = _ref22.values,
|
|
660
|
+
key = _ref22.key;
|
|
649
661
|
return values === null || values === void 0 || (_values$key = values[key]) === null || _values$key === void 0 ? void 0 : _values$key.value;
|
|
650
662
|
};
|
|
651
663
|
var asArray = function asArray(maybeArray) {
|
|
652
664
|
return Array.isArray(maybeArray) ? maybeArray : [];
|
|
653
665
|
};
|
|
654
666
|
var fieldKeysFromSchema = function fieldKeysFromSchema() {
|
|
655
|
-
var _schema$triggers3, _schema$actor2, _schema$
|
|
667
|
+
var _schema$triggers3, _schema$actor2, _schema$conditions5, _schema$actions3, _schema$delay, _schema$triggers4, _schema$scope2;
|
|
656
668
|
var schema = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
657
669
|
return {
|
|
658
670
|
triggers: ((_schema$triggers3 = schema.triggers) === null || _schema$triggers3 === void 0 ? void 0 : _schema$triggers3.fieldKey) || "events",
|
|
659
671
|
performer: ((_schema$actor2 = schema.actor) === null || _schema$actor2 === void 0 ? void 0 : _schema$actor2.fieldKey) || "performer",
|
|
660
|
-
conditions: ((_schema$
|
|
672
|
+
conditions: ((_schema$conditions5 = schema.conditions) === null || _schema$conditions5 === void 0 ? void 0 : _schema$conditions5.fieldKey) || "conditions",
|
|
661
673
|
actions: ((_schema$actions3 = schema.actions) === null || _schema$actions3 === void 0 ? void 0 : _schema$actions3.fieldKey) || "actions",
|
|
662
674
|
delay: ((_schema$delay = schema.delay) === null || _schema$delay === void 0 ? void 0 : _schema$delay.fieldKey) || "execution_delay",
|
|
663
675
|
leadTime: (_schema$triggers4 = schema.triggers) === null || _schema$triggers4 === void 0 || (_schema$triggers4 = _schema$triggers4.leadTime) === null || _schema$triggers4 === void 0 ? void 0 : _schema$triggers4.fieldKey,
|
|
@@ -668,11 +680,11 @@ var fieldKeysFromSchema = function fieldKeysFromSchema() {
|
|
|
668
680
|
};
|
|
669
681
|
var valuesToRuleModel = function valuesToRuleModel() {
|
|
670
682
|
var _valueAt, _conditions$;
|
|
671
|
-
var
|
|
672
|
-
|
|
673
|
-
values =
|
|
674
|
-
|
|
675
|
-
schema =
|
|
683
|
+
var _ref23 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
684
|
+
_ref23$values = _ref23.values,
|
|
685
|
+
values = _ref23$values === void 0 ? {} : _ref23$values,
|
|
686
|
+
_ref23$schema = _ref23.schema,
|
|
687
|
+
schema = _ref23$schema === void 0 ? {} : _ref23$schema;
|
|
676
688
|
var keys = fieldKeysFromSchema(schema);
|
|
677
689
|
var conditions = asArray(valueAt({
|
|
678
690
|
values: values,
|
|
@@ -716,42 +728,42 @@ var valuesToRuleModel = function valuesToRuleModel() {
|
|
|
716
728
|
}))
|
|
717
729
|
};
|
|
718
730
|
};
|
|
719
|
-
var setTriggers = function setTriggers(
|
|
720
|
-
var schema =
|
|
721
|
-
triggers =
|
|
731
|
+
var setTriggers = function setTriggers(_ref24) {
|
|
732
|
+
var schema = _ref24.schema,
|
|
733
|
+
triggers = _ref24.triggers;
|
|
722
734
|
return {
|
|
723
735
|
path: "".concat(fieldKeysFromSchema(schema).triggers, ".value"),
|
|
724
736
|
value: triggers
|
|
725
737
|
};
|
|
726
738
|
};
|
|
727
|
-
var setPerformer = function setPerformer(
|
|
728
|
-
var schema =
|
|
729
|
-
performer =
|
|
739
|
+
var setPerformer = function setPerformer(_ref25) {
|
|
740
|
+
var schema = _ref25.schema,
|
|
741
|
+
performer = _ref25.performer;
|
|
730
742
|
return {
|
|
731
743
|
path: "".concat(fieldKeysFromSchema(schema).performer, ".value"),
|
|
732
744
|
value: performer
|
|
733
745
|
};
|
|
734
746
|
};
|
|
735
|
-
var setActions = function setActions(
|
|
736
|
-
var schema =
|
|
737
|
-
actions =
|
|
747
|
+
var setActions = function setActions(_ref26) {
|
|
748
|
+
var schema = _ref26.schema,
|
|
749
|
+
actions = _ref26.actions;
|
|
738
750
|
return {
|
|
739
751
|
path: "".concat(fieldKeysFromSchema(schema).actions, ".value"),
|
|
740
752
|
value: actions
|
|
741
753
|
};
|
|
742
754
|
};
|
|
743
|
-
var setConditions = function setConditions(
|
|
744
|
-
var schema =
|
|
745
|
-
conditions =
|
|
755
|
+
var setConditions = function setConditions(_ref27) {
|
|
756
|
+
var schema = _ref27.schema,
|
|
757
|
+
conditions = _ref27.conditions;
|
|
746
758
|
return {
|
|
747
759
|
path: "".concat(fieldKeysFromSchema(schema).conditions, ".value"),
|
|
748
760
|
value: conditions
|
|
749
761
|
};
|
|
750
762
|
};
|
|
751
|
-
var setConditionMode = function setConditionMode(
|
|
752
|
-
var schema =
|
|
753
|
-
conditions =
|
|
754
|
-
joinType =
|
|
763
|
+
var setConditionMode = function setConditionMode(_ref28) {
|
|
764
|
+
var schema = _ref28.schema,
|
|
765
|
+
conditions = _ref28.conditions,
|
|
766
|
+
joinType = _ref28.joinType;
|
|
755
767
|
return setConditions({
|
|
756
768
|
schema: schema,
|
|
757
769
|
conditions: conditions.map(function (condition) {
|
|
@@ -759,34 +771,34 @@ var setConditionMode = function setConditionMode(_ref26) {
|
|
|
759
771
|
})
|
|
760
772
|
});
|
|
761
773
|
};
|
|
762
|
-
var setDelay = function setDelay(
|
|
763
|
-
var schema =
|
|
764
|
-
delay =
|
|
774
|
+
var setDelay = function setDelay(_ref29) {
|
|
775
|
+
var schema = _ref29.schema,
|
|
776
|
+
delay = _ref29.delay;
|
|
765
777
|
return {
|
|
766
778
|
path: "".concat(fieldKeysFromSchema(schema).delay, ".value"),
|
|
767
779
|
value: delay !== null && delay !== void 0 ? delay : {}
|
|
768
780
|
};
|
|
769
781
|
};
|
|
770
|
-
var setActive = function setActive(
|
|
771
|
-
var schema =
|
|
772
|
-
active =
|
|
782
|
+
var setActive = function setActive(_ref30) {
|
|
783
|
+
var schema = _ref30.schema,
|
|
784
|
+
active = _ref30.active;
|
|
773
785
|
return {
|
|
774
786
|
path: "".concat(fieldKeysFromSchema(schema).status, ".value"),
|
|
775
787
|
value: active ? STATUS_KEYS.ENABLED : STATUS_KEYS.DISABLED
|
|
776
788
|
};
|
|
777
789
|
};
|
|
778
|
-
var setScope = function setScope(
|
|
779
|
-
var schema =
|
|
780
|
-
scope =
|
|
790
|
+
var setScope = function setScope(_ref31) {
|
|
791
|
+
var schema = _ref31.schema,
|
|
792
|
+
scope = _ref31.scope;
|
|
781
793
|
return {
|
|
782
794
|
path: "".concat(fieldKeysFromSchema(schema).scope, ".value"),
|
|
783
795
|
value: scope
|
|
784
796
|
};
|
|
785
797
|
};
|
|
786
|
-
var removeArrayItem = function removeArrayItem(
|
|
787
|
-
var values =
|
|
788
|
-
fieldKey =
|
|
789
|
-
index =
|
|
798
|
+
var removeArrayItem = function removeArrayItem(_ref32) {
|
|
799
|
+
var values = _ref32.values,
|
|
800
|
+
fieldKey = _ref32.fieldKey,
|
|
801
|
+
index = _ref32.index;
|
|
790
802
|
var list = asArray(valueAt({
|
|
791
803
|
values: values,
|
|
792
804
|
key: fieldKey
|
|
@@ -813,9 +825,9 @@ var removeArrayItem = function removeArrayItem(_ref30) {
|
|
|
813
825
|
}
|
|
814
826
|
return result;
|
|
815
827
|
};
|
|
816
|
-
var clearArrayItems = function clearArrayItems(
|
|
817
|
-
var values =
|
|
818
|
-
fieldKey =
|
|
828
|
+
var clearArrayItems = function clearArrayItems(_ref33) {
|
|
829
|
+
var values = _ref33.values,
|
|
830
|
+
fieldKey = _ref33.fieldKey;
|
|
819
831
|
var list = asArray(valueAt({
|
|
820
832
|
values: values,
|
|
821
833
|
key: fieldKey
|
|
@@ -2237,7 +2249,7 @@ var nextActionRecipientAt = function nextActionRecipientAt(_ref14) {
|
|
|
2237
2249
|
});
|
|
2238
2250
|
};
|
|
2239
2251
|
var descriptorFor = function descriptorFor(_ref15) {
|
|
2240
|
-
var _schema$actor2
|
|
2252
|
+
var _schema$actor2;
|
|
2241
2253
|
var anchor = _ref15.anchor,
|
|
2242
2254
|
schema = _ref15.schema,
|
|
2243
2255
|
rule = _ref15.rule,
|
|
@@ -2283,7 +2295,10 @@ var descriptorFor = function descriptorFor(_ref15) {
|
|
|
2283
2295
|
title: i18next.t("neetoRules.builder.panes.addCondition"),
|
|
2284
2296
|
subtitle: i18next.t("neetoRules.builder.panes.condFieldSubtitle"),
|
|
2285
2297
|
cascade: true,
|
|
2286
|
-
options: (
|
|
2298
|
+
options: offeredConditionFields({
|
|
2299
|
+
schema: schema,
|
|
2300
|
+
rule: rule
|
|
2301
|
+
}).map(function (field) {
|
|
2287
2302
|
return {
|
|
2288
2303
|
label: field.paneLabel || field.label,
|
|
2289
2304
|
value: optionValue(field),
|
|
@@ -2297,7 +2312,7 @@ var descriptorFor = function descriptorFor(_ref15) {
|
|
|
2297
2312
|
};
|
|
2298
2313
|
case BUILDER_ANCHORS.COND_OP_TOGGLE:
|
|
2299
2314
|
{
|
|
2300
|
-
var _schema$
|
|
2315
|
+
var _schema$conditions2;
|
|
2301
2316
|
var field = findField({
|
|
2302
2317
|
schema: schema,
|
|
2303
2318
|
value: conditionAt({
|
|
@@ -2305,7 +2320,7 @@ var descriptorFor = function descriptorFor(_ref15) {
|
|
|
2305
2320
|
index: index
|
|
2306
2321
|
}).field
|
|
2307
2322
|
});
|
|
2308
|
-
var labels = ((_schema$
|
|
2323
|
+
var labels = ((_schema$conditions2 = schema.conditions) === null || _schema$conditions2 === void 0 ? void 0 : _schema$conditions2.operatorLabels) || {};
|
|
2309
2324
|
var verbs = (field === null || field === void 0 ? void 0 : field.allowMatching) || [];
|
|
2310
2325
|
var fieldLabel = (field === null || field === void 0 ? void 0 : field.paneLabel) || (field === null || field === void 0 ? void 0 : field.label) || "";
|
|
2311
2326
|
var isContains = neetoCist.isNotEmpty(verbs) && verbs.every(isContainsVerb);
|
|
@@ -2788,7 +2803,7 @@ var applyPreview = function applyPreview(_ref19) {
|
|
|
2788
2803
|
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2789
2804
|
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2790
2805
|
var Canvas = function Canvas(_ref) {
|
|
2791
|
-
var _schema$scope, _schema$
|
|
2806
|
+
var _schema$scope, _schema$triggers, _schema$delay, _schema$meta$showName, _schema$meta;
|
|
2792
2807
|
var schema = _ref.schema;
|
|
2793
2808
|
var _useTranslation = reactI18next.useTranslation(),
|
|
2794
2809
|
t = _useTranslation.t;
|
|
@@ -3021,7 +3036,10 @@ var Canvas = function Canvas(_ref) {
|
|
|
3021
3036
|
return i !== index;
|
|
3022
3037
|
}));
|
|
3023
3038
|
};
|
|
3024
|
-
var conditionFields = (
|
|
3039
|
+
var conditionFields = offeredConditionFields({
|
|
3040
|
+
schema: schema,
|
|
3041
|
+
rule: rule
|
|
3042
|
+
});
|
|
3025
3043
|
var canAddCondition = neetoCist.isNotEmpty(conditionFields);
|
|
3026
3044
|
var leadTimeAppliesTo = (schema === null || schema === void 0 || (_schema$triggers = schema.triggers) === null || _schema$triggers === void 0 || (_schema$triggers = _schema$triggers.leadTime) === null || _schema$triggers === void 0 ? void 0 : _schema$triggers.appliesTo) || [];
|
|
3027
3045
|
var hasLeadTimeTrigger = rule.triggers.some(function (trigger) {
|