@kontur.candy/generator 5.4.0 → 5.5.0-digest-check.0
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/index.js +195 -86
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -60223,6 +60223,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
60223
60223
|
|
|
60224
60224
|
|
|
60225
60225
|
const getRngSchemaFilename = (formSchemasDirPath, gfv) => {
|
|
60226
|
+
if (!Boolean(Number(gfv))) {
|
|
60227
|
+
return ".rng.xml";
|
|
60228
|
+
}
|
|
60226
60229
|
const maxSubversion = (0,fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync)(formSchemasDirPath).map(fileName => fileName.includes(".rng.xml") && !fileName.includes("схема.rng.xml")).filter(i => i === true).length - 1;
|
|
60227
60230
|
if (maxSubversion === undefined || !(0,fs__WEBPACK_IMPORTED_MODULE_0__.existsSync)(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSchemasDirPath, `${gfv}.${maxSubversion}.rng.xml`))) {
|
|
60228
60231
|
return ".rng.xml";
|
|
@@ -79401,8 +79404,8 @@ class FLangValidationBuildContext {
|
|
|
79401
79404
|
popVisibilityCondition() {
|
|
79402
79405
|
this.visibilityConditions.pop();
|
|
79403
79406
|
}
|
|
79404
|
-
buildBasicValidations(targetPath, typeNode, schemaTypeNode, optional, highOrderDescription) {
|
|
79405
|
-
var _typeNode$base, _typeNode$description
|
|
79407
|
+
buildBasicValidations(targetPath, typeNode, schemaTypeNode, optional, highOrderDescription, nodeGId) {
|
|
79408
|
+
var _typeNode$base, _typeNode$description;
|
|
79406
79409
|
const validations = [];
|
|
79407
79410
|
const valueReference = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.ValueReferenceExpression(targetPath.toCurrentIteration(), "value");
|
|
79408
79411
|
const baseName = (_typeNode$base = typeNode === null || typeNode === void 0 ? void 0 : typeNode.base) !== null && _typeNode$base !== void 0 ? _typeNode$base : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.baseType;
|
|
@@ -79413,7 +79416,7 @@ class FLangValidationBuildContext {
|
|
|
79413
79416
|
validations.push(baseTypeValidation);
|
|
79414
79417
|
}
|
|
79415
79418
|
}
|
|
79416
|
-
const typeValidations = this.createTypeValidations(valueReference, typeNode, schemaTypeNode);
|
|
79419
|
+
const typeValidations = this.createTypeValidations(valueReference, typeNode, schemaTypeNode, nodeGId);
|
|
79417
79420
|
for (const typeValidation of typeValidations) {
|
|
79418
79421
|
validations.push(typeValidation);
|
|
79419
79422
|
}
|
|
@@ -79421,60 +79424,58 @@ class FLangValidationBuildContext {
|
|
|
79421
79424
|
return [];
|
|
79422
79425
|
}
|
|
79423
79426
|
this.pathsWithValidations.add(targetPath);
|
|
79424
|
-
|
|
79427
|
+
const schemaNode = this.schemaRng.getElementByPath(targetPath);
|
|
79428
|
+
const parentNode = schemaNode != undefined ? this.getFirstAcceptedParent(schemaNode) : undefined;
|
|
79429
|
+
const allChildrenPaths = parentNode instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_0__.FormSchemaRngElement ? this.schemaRng.getAllChildren(parentNode).map(x => this.schemaRng.getPath(x, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each)).filter(x => !(0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_11__.getMatchedAndDifferentModelPaths)(targetPath, x).differentPath.isContainIteration()) : undefined;
|
|
79430
|
+
const restChecks = allChildrenPaths === null || allChildrenPaths === void 0 ? void 0 : allChildrenPaths.map(childPath => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.ValueReferenceExpression(childPath.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.StringLiteralExpression(""))).reduce(_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.combineByAndFlangExpr, undefined);
|
|
79431
|
+
const errorValidations = validations.filter(x => !x.checkType || x.checkType === "error");
|
|
79432
|
+
const errorExpression = this.createFlangExpression((0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_3__.reverseArray)(errorValidations), targetPath, valueReference, "error", highOrderDescription !== null && highOrderDescription !== void 0 ? highOrderDescription : typeNode === null || typeNode === void 0 ? void 0 : typeNode.requiredDescription, optional, parentNode, restChecks);
|
|
79433
|
+
const result = [];
|
|
79434
|
+
result.push({
|
|
79435
|
+
statement: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.ValueReferenceExpression(targetPath, "error"), errorExpression),
|
|
79436
|
+
checkType: "error"
|
|
79437
|
+
});
|
|
79438
|
+
const warningValidations = validations.filter(x => x.checkType === "warning");
|
|
79439
|
+
if (warningValidations.length === 0) {
|
|
79440
|
+
return result;
|
|
79441
|
+
}
|
|
79442
|
+
const warningExpression = this.createFlangExpression(warningValidations, targetPath, valueReference, "warning", highOrderDescription !== null && highOrderDescription !== void 0 ? highOrderDescription : typeNode === null || typeNode === void 0 ? void 0 : typeNode.requiredDescription, true, parentNode, restChecks);
|
|
79443
|
+
result.push({
|
|
79444
|
+
statement: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.ValueReferenceExpression(targetPath, "warning"), warningExpression),
|
|
79445
|
+
checkType: "warning"
|
|
79446
|
+
});
|
|
79447
|
+
return result;
|
|
79448
|
+
}
|
|
79449
|
+
createFlangExpression(validations, targetPath, valueReference, checkType, requiredDescription, optional, parentNode, restChecks) {
|
|
79450
|
+
let expression = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_3__.IterUtils.reduce(validations, (result, {
|
|
79451
|
+
condition,
|
|
79452
|
+
message
|
|
79453
|
+
}) => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.ConditionalExpression(condition, message, result), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NullLiteralExpression());
|
|
79425
79454
|
if (!optional) {
|
|
79426
|
-
const requiredDescription = highOrderDescription !== null && highOrderDescription !== void 0 ? highOrderDescription : typeNode === null || typeNode === void 0 ? void 0 : typeNode.requiredDescription;
|
|
79427
|
-
const getFirstAcceptedParent = schemaNode => {
|
|
79428
|
-
let parentNode = schemaNode === null || schemaNode === void 0 ? void 0 : schemaNode.parent;
|
|
79429
|
-
while (parentNode != undefined) {
|
|
79430
|
-
if (parentNode instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_0__.FormSchemaRngElement) {
|
|
79431
|
-
var _parentNode$multiple;
|
|
79432
|
-
if ((_parentNode$multiple = parentNode.multiple) !== null && _parentNode$multiple !== void 0 ? _parentNode$multiple : false) {
|
|
79433
|
-
return undefined;
|
|
79434
|
-
}
|
|
79435
|
-
if (parentNode.isOptional()) {
|
|
79436
|
-
return parentNode;
|
|
79437
|
-
}
|
|
79438
|
-
parentNode = parentNode.parent;
|
|
79439
|
-
} else {
|
|
79440
|
-
return undefined;
|
|
79441
|
-
}
|
|
79442
|
-
}
|
|
79443
|
-
return undefined;
|
|
79444
|
-
};
|
|
79445
|
-
const schemaNode = this.schemaRng.getElementByPath(targetPath);
|
|
79446
|
-
const parentNode = schemaNode != undefined ? getFirstAcceptedParent(schemaNode) : undefined;
|
|
79447
|
-
const requiredExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.IsEqualsBinaryExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.IsEqualsBinaryExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.StringLiteralExpression(""))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.StringLiteralExpression("[" + JSON.stringify(requiredDescription !== null && requiredDescription !== void 0 ? requiredDescription : "Поле должно быть заполнено") + "]"), errorExpression);
|
|
79448
79455
|
if (parentNode instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_0__.FormSchemaRngElement) {
|
|
79456
|
+
const requiredExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.IsEqualsBinaryExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.IsEqualsBinaryExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.StringLiteralExpression(""))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.StringLiteralExpression("[" + JSON.stringify(requiredDescription !== null && requiredDescription !== void 0 ? requiredDescription : "Поле должно быть заполнено") + "]"), expression);
|
|
79449
79457
|
const targetCheck = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.EqExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.EqExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.StringLiteralExpression("")));
|
|
79450
|
-
const allChildrenPaths = this.schemaRng.getAllChildren(parentNode).map(x => this.schemaRng.getPath(x, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each)).filter(x => !(0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_11__.getMatchedAndDifferentModelPaths)(targetPath, x).differentPath.isContainIteration());
|
|
79451
|
-
const restChecks = allChildrenPaths.map(childPath => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.ValueReferenceExpression(childPath.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.StringLiteralExpression(""))).reduce(_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.combineByAndFlangExpr, undefined);
|
|
79452
79458
|
if (restChecks != undefined) {
|
|
79453
79459
|
const finalChildrenCondition = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.AndBinaryExpression(targetCheck, restChecks);
|
|
79454
|
-
|
|
79460
|
+
expression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.ConditionalExpression(finalChildrenCondition, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NullLiteralExpression(), requiredExpression);
|
|
79455
79461
|
} else {
|
|
79456
|
-
|
|
79462
|
+
expression = requiredExpression;
|
|
79457
79463
|
}
|
|
79458
79464
|
} else {
|
|
79459
|
-
|
|
79465
|
+
expression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.IsEqualsBinaryExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.IsEqualsBinaryExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.StringLiteralExpression(""))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.StringLiteralExpression("[" + JSON.stringify(requiredDescription !== null && requiredDescription !== void 0 ? requiredDescription : "Поле должно быть заполнено") + "]"), expression);
|
|
79460
79466
|
}
|
|
79461
79467
|
} else {
|
|
79462
|
-
|
|
79468
|
+
expression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.IsEqualsBinaryExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.IsEqualsBinaryExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.StringLiteralExpression(""))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NullLiteralExpression(), expression);
|
|
79463
79469
|
}
|
|
79464
|
-
const checkType = (_typeNode$checkType = typeNode === null || typeNode === void 0 ? void 0 : typeNode.checkType) !== null && _typeNode$checkType !== void 0 ? _typeNode$checkType : "error";
|
|
79465
79470
|
const visibilityFlangCondition = this.visibilityConditions.map(x => {
|
|
79466
79471
|
const target = new _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.AbsoluteModelFieldPath(targetPath, checkType);
|
|
79467
79472
|
const prefix = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(x.path.getPathPartsAsArray().filter(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.isSimpleToken));
|
|
79468
|
-
const flangExpr = this.
|
|
79473
|
+
const flangExpr = this.getFlangExpressionFromKCLangCondition(prefix, target, x.condition, x.invertRequired);
|
|
79469
79474
|
return flangExpr;
|
|
79470
79475
|
}).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.isNotNullOrUndefined).reduce((acc, current) => acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.AndBinaryExpression(acc, current) : current, undefined);
|
|
79471
|
-
|
|
79472
|
-
return [{
|
|
79473
|
-
statement: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.ValueReferenceExpression(targetPath, checkType), finalExpression),
|
|
79474
|
-
checkType: checkType
|
|
79475
|
-
}];
|
|
79476
|
+
return visibilityFlangCondition != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.ConditionalExpression(visibilityFlangCondition, expression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NullLiteralExpression()) : expression;
|
|
79476
79477
|
}
|
|
79477
|
-
|
|
79478
|
+
getFlangExpressionFromKCLangCondition(prefix, target, condition, invertRequired) {
|
|
79478
79479
|
const fullKcLangExpr = `
|
|
79479
79480
|
in ${prefix.toLegacyPath()} {
|
|
79480
79481
|
check Test === (${condition}) ? 1 : 0;
|
|
@@ -79535,24 +79536,43 @@ class FLangValidationBuildContext {
|
|
|
79535
79536
|
return undefined;
|
|
79536
79537
|
}
|
|
79537
79538
|
}
|
|
79538
|
-
*createTypeValidations(valueReference, typeNode, schemaTypeNode) {
|
|
79539
|
-
var _typeNode$children$fi, _typeNode$children, _typeNode$children$fi2, _schemaTypeNode$enume, _typeNode$children2, _typeNodeLength$value, _typeNode$children3, _typeNodeMinLength$va, _typeNode$children4, _typeNodeMaxLength$va, _typeNode$children5, _typeNodeMinInclusive, _typeNode$children6, _typeNodeMaxInclusive, _typeNode$children7, _typeNodeTotalDigits$, _typeNode$children$fi3, _typeNode$children8, _schemaTypeNode$patte, _typeNode$children9, _typeNodeInteger$valu, _typeNode$children10, _typeNodeFractional$v;
|
|
79540
|
-
|
|
79539
|
+
*createTypeValidations(valueReference, typeNode, schemaTypeNode, nodeGId) {
|
|
79540
|
+
var _typeNode$checkType, _typeNode$children$fi, _typeNode$children, _typeNode$children$fi2, _schemaTypeNode$enume, _digest$gId, _typeNode$children2, _typeNodeLength$value, _typeNode$children3, _typeNodeMinLength$va, _typeNode$children4, _typeNodeMaxLength$va, _typeNode$children5, _typeNodeMinInclusive, _typeNode$children6, _typeNodeMaxInclusive, _typeNode$children7, _typeNodeTotalDigits$, _typeNode$children$fi3, _typeNode$children8, _schemaTypeNode$patte, _typeNode$children9, _typeNodeInteger$valu, _typeNode$children10, _typeNodeFractional$v;
|
|
79541
|
+
const checkType = (_typeNode$checkType = typeNode === null || typeNode === void 0 ? void 0 : typeNode.checkType) !== null && _typeNode$checkType !== void 0 ? _typeNode$checkType : "error";
|
|
79541
79542
|
const typeNodeEnumerations = (_typeNode$children$fi = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children = typeNode.children) === null || _typeNode$children === void 0 ? void 0 : (_typeNode$children$fi2 = _typeNode$children.filter(x => x instanceof _validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_2__.EnumerationTypeCheckNode)) === null || _typeNode$children$fi2 === void 0 ? void 0 : _typeNode$children$fi2.map(x => x.value)) !== null && _typeNode$children$fi !== void 0 ? _typeNode$children$fi : [];
|
|
79542
79543
|
const enumerationItems = (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.arrayIsNotEmpty)(typeNodeEnumerations) ? typeNodeEnumerations : (_schemaTypeNode$enume = schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.enumeration) !== null && _schemaTypeNode$enume !== void 0 ? _schemaTypeNode$enume : [];
|
|
79543
79544
|
if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.arrayIsNotEmpty)(enumerationItems)) {
|
|
79544
79545
|
const enumerationRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.OneOfExpression(valueReference, enumerationItems.map(item => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.StringLiteralExpression(item)));
|
|
79545
|
-
yield
|
|
79546
|
-
|
|
79547
|
-
|
|
79546
|
+
yield {
|
|
79547
|
+
condition: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NegateUnaryExpression(enumerationRuleBody),
|
|
79548
|
+
message: makeMessage({
|
|
79549
|
+
enumerationAllowedValues: enumerationItems
|
|
79550
|
+
}, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description),
|
|
79551
|
+
checkType: checkType
|
|
79552
|
+
};
|
|
79553
|
+
}
|
|
79554
|
+
const digest = typeNode === null || typeNode === void 0 ? void 0 : typeNode.getValidations(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_2__.DigestcheckTypeCheckNode).find(x => x);
|
|
79555
|
+
const gId = (_digest$gId = digest === null || digest === void 0 ? void 0 : digest.gId) !== null && _digest$gId !== void 0 ? _digest$gId : nodeGId;
|
|
79556
|
+
if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.isNotNullOrEmpty)(gId)) {
|
|
79557
|
+
var _ref3, _digest$description, _ref4, _digest$checkType;
|
|
79558
|
+
const ruleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.IsEqualsBinaryExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.IsEqualsBinaryExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.StringLiteralExpression(""))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.HasPicklistValueExpression(valueReference, `${gId}[code]`));
|
|
79559
|
+
yield {
|
|
79560
|
+
condition: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NegateUnaryExpression(ruleBody),
|
|
79561
|
+
message: makeArrayLiteral((_ref3 = (_digest$description = digest === null || digest === void 0 ? void 0 : digest.description) !== null && _digest$description !== void 0 ? _digest$description : typeNode === null || typeNode === void 0 ? void 0 : typeNode.description) !== null && _ref3 !== void 0 ? _ref3 : "Поле заполнено не по справочнику"),
|
|
79562
|
+
checkType: (_ref4 = (_digest$checkType = digest === null || digest === void 0 ? void 0 : digest.checkType) !== null && _digest$checkType !== void 0 ? _digest$checkType : typeNode === null || typeNode === void 0 ? void 0 : typeNode.checkType) !== null && _ref4 !== void 0 ? _ref4 : "error"
|
|
79563
|
+
};
|
|
79548
79564
|
}
|
|
79549
79565
|
const typeNodeLength = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children2 = typeNode.children) === null || _typeNode$children2 === void 0 ? void 0 : _typeNode$children2.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_2__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_2__.LengthTypeCheckNode));
|
|
79550
79566
|
const lengthValue = (_typeNodeLength$value = typeNodeLength === null || typeNodeLength === void 0 ? void 0 : typeNodeLength.value) !== null && _typeNodeLength$value !== void 0 ? _typeNodeLength$value : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.length;
|
|
79551
79567
|
if (lengthValue != undefined) {
|
|
79552
79568
|
const lengthExprRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.LenExpression(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.DecimalLiteralExpression(lengthValue)));
|
|
79553
|
-
yield
|
|
79554
|
-
|
|
79555
|
-
|
|
79569
|
+
yield {
|
|
79570
|
+
condition: lengthExprRuleBody,
|
|
79571
|
+
message: makeMessage({
|
|
79572
|
+
length: lengthValue
|
|
79573
|
+
}, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description),
|
|
79574
|
+
checkType: checkType
|
|
79575
|
+
};
|
|
79556
79576
|
}
|
|
79557
79577
|
const typeNodeMinLength = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children3 = typeNode.children) === null || _typeNode$children3 === void 0 ? void 0 : _typeNode$children3.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_2__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_2__.MinlengthTypeCheckNode));
|
|
79558
79578
|
const minLengthValue = (_typeNodeMinLength$va = typeNodeMinLength === null || typeNodeMinLength === void 0 ? void 0 : typeNodeMinLength.value) !== null && _typeNodeMinLength$va !== void 0 ? _typeNodeMinLength$va : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.minLength;
|
|
@@ -79560,69 +79580,105 @@ class FLangValidationBuildContext {
|
|
|
79560
79580
|
const maxLengthValue = (_typeNodeMaxLength$va = typeNodeMaxLength === null || typeNodeMaxLength === void 0 ? void 0 : typeNodeMaxLength.value) !== null && _typeNodeMaxLength$va !== void 0 ? _typeNodeMaxLength$va : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.maxLength;
|
|
79561
79581
|
if (minLengthValue != undefined && maxLengthValue != undefined) {
|
|
79562
79582
|
const lengthExprRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.GeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.LenExpression(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.DecimalLiteralExpression(minLengthValue)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.LeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.LenExpression(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.DecimalLiteralExpression(maxLengthValue))));
|
|
79563
|
-
yield
|
|
79564
|
-
|
|
79565
|
-
|
|
79566
|
-
|
|
79583
|
+
yield {
|
|
79584
|
+
condition: lengthExprRuleBody,
|
|
79585
|
+
message: makeMessage({
|
|
79586
|
+
minLength: minLengthValue,
|
|
79587
|
+
maxLength: maxLengthValue
|
|
79588
|
+
}, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description),
|
|
79589
|
+
checkType: checkType
|
|
79590
|
+
};
|
|
79567
79591
|
} else if (minLengthValue != undefined) {
|
|
79568
79592
|
const lengthExprRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.GeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.LenExpression(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.DecimalLiteralExpression(minLengthValue)));
|
|
79569
|
-
yield
|
|
79570
|
-
|
|
79571
|
-
|
|
79593
|
+
yield {
|
|
79594
|
+
condition: lengthExprRuleBody,
|
|
79595
|
+
message: makeMessage({
|
|
79596
|
+
minLength: minLengthValue
|
|
79597
|
+
}, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description),
|
|
79598
|
+
checkType: checkType
|
|
79599
|
+
};
|
|
79572
79600
|
} else if (maxLengthValue != undefined) {
|
|
79573
79601
|
const lengthExprRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.LeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.LenExpression(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.DecimalLiteralExpression(maxLengthValue)));
|
|
79574
|
-
yield
|
|
79575
|
-
|
|
79576
|
-
|
|
79602
|
+
yield {
|
|
79603
|
+
condition: lengthExprRuleBody,
|
|
79604
|
+
message: makeMessage({
|
|
79605
|
+
maxLength: maxLengthValue
|
|
79606
|
+
}, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description),
|
|
79607
|
+
checkType: checkType
|
|
79608
|
+
};
|
|
79577
79609
|
}
|
|
79578
79610
|
const typeNodeMinInclusive = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children5 = typeNode.children) === null || _typeNode$children5 === void 0 ? void 0 : _typeNode$children5.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_2__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_2__.MininclusiveTypeCheckNode));
|
|
79579
79611
|
const minInclusiveValue = (_typeNodeMinInclusive = typeNodeMinInclusive === null || typeNodeMinInclusive === void 0 ? void 0 : typeNodeMinInclusive.value) !== null && _typeNodeMinInclusive !== void 0 ? _typeNodeMinInclusive : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.minInclusive;
|
|
79580
79612
|
if (minInclusiveValue != undefined) {
|
|
79581
79613
|
const minInclusiveRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.GeExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.castOperandToDecimalIfNeed)(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.DecimalLiteralExpression(minInclusiveValue)));
|
|
79582
|
-
yield
|
|
79583
|
-
|
|
79584
|
-
|
|
79614
|
+
yield {
|
|
79615
|
+
condition: minInclusiveRuleBody,
|
|
79616
|
+
message: makeMessage({
|
|
79617
|
+
minInclusive: minInclusiveValue
|
|
79618
|
+
}, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description),
|
|
79619
|
+
checkType: checkType
|
|
79620
|
+
};
|
|
79585
79621
|
}
|
|
79586
79622
|
const typeNodeMaxInclusive = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children6 = typeNode.children) === null || _typeNode$children6 === void 0 ? void 0 : _typeNode$children6.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_2__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_2__.MaxinclusiveTypeCheckNode));
|
|
79587
79623
|
const maxInclusiveValue = (_typeNodeMaxInclusive = typeNodeMaxInclusive === null || typeNodeMaxInclusive === void 0 ? void 0 : typeNodeMaxInclusive.value) !== null && _typeNodeMaxInclusive !== void 0 ? _typeNodeMaxInclusive : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.maxInclusive;
|
|
79588
79624
|
if (maxInclusiveValue != undefined) {
|
|
79589
79625
|
const maxInclusiveRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.LeExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.castOperandToDecimalIfNeed)(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.DecimalLiteralExpression(maxInclusiveValue)));
|
|
79590
|
-
yield
|
|
79591
|
-
|
|
79592
|
-
|
|
79626
|
+
yield {
|
|
79627
|
+
condition: maxInclusiveRuleBody,
|
|
79628
|
+
message: makeMessage({
|
|
79629
|
+
maxInclusive: maxInclusiveValue
|
|
79630
|
+
}, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description),
|
|
79631
|
+
checkType: checkType
|
|
79632
|
+
};
|
|
79593
79633
|
}
|
|
79594
79634
|
const typeNodeTotalDigits = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children7 = typeNode.children) === null || _typeNode$children7 === void 0 ? void 0 : _typeNode$children7.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_2__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_2__.TotaldigitsTypeCheckNode));
|
|
79595
79635
|
const totalDigitsValue = (_typeNodeTotalDigits$ = typeNodeTotalDigits === null || typeNodeTotalDigits === void 0 ? void 0 : typeNodeTotalDigits.value) !== null && _typeNodeTotalDigits$ !== void 0 ? _typeNodeTotalDigits$ : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.totalDigits;
|
|
79596
79636
|
if (totalDigitsValue != undefined) {
|
|
79597
79637
|
const totalDigitsRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.LeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NumLenExpression(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.DecimalLiteralExpression(totalDigitsValue)));
|
|
79598
|
-
yield
|
|
79599
|
-
|
|
79600
|
-
|
|
79638
|
+
yield {
|
|
79639
|
+
condition: totalDigitsRuleBody,
|
|
79640
|
+
message: makeMessage({
|
|
79641
|
+
totalDigitsMaxCount: totalDigitsValue
|
|
79642
|
+
}, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description),
|
|
79643
|
+
checkType: checkType
|
|
79644
|
+
};
|
|
79601
79645
|
}
|
|
79602
79646
|
const typeNodePatterns = (_typeNode$children$fi3 = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children8 = typeNode.children) === null || _typeNode$children8 === void 0 ? void 0 : _typeNode$children8.filter((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_2__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_2__.PatternTypeCheckNode)).map(x => x.value).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.isNotNullOrUndefined)) !== null && _typeNode$children$fi3 !== void 0 ? _typeNode$children$fi3 : [];
|
|
79603
79647
|
const stringPatterns = ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.arrayIsNotEmpty)(typeNodePatterns) ? typeNodePatterns : (_schemaTypeNode$patte = schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.patterns) !== null && _schemaTypeNode$patte !== void 0 ? _schemaTypeNode$patte : []).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.isNotNullOrUndefined);
|
|
79604
79648
|
const patterns = stringPatterns.map(pattern => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.RegexMatchExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.StringLiteralExpression(pattern))).reduce((acc, current) => acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.OrBinaryExpression(acc, current) : current, undefined);
|
|
79605
79649
|
if (patterns != undefined) {
|
|
79606
79650
|
const totalDigitsRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NegateUnaryExpression(patterns);
|
|
79607
|
-
yield
|
|
79608
|
-
|
|
79609
|
-
|
|
79651
|
+
yield {
|
|
79652
|
+
condition: totalDigitsRuleBody,
|
|
79653
|
+
message: makeMessage({
|
|
79654
|
+
patterns: stringPatterns
|
|
79655
|
+
}, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description),
|
|
79656
|
+
checkType: checkType
|
|
79657
|
+
};
|
|
79610
79658
|
}
|
|
79611
79659
|
const typeNodeInteger = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children9 = typeNode.children) === null || _typeNode$children9 === void 0 ? void 0 : _typeNode$children9.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_2__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_2__.IntegerdigitsTypeCheckNode));
|
|
79612
79660
|
const integerDigits = (_typeNodeInteger$valu = typeNodeInteger === null || typeNodeInteger === void 0 ? void 0 : typeNodeInteger.value) !== null && _typeNodeInteger$valu !== void 0 ? _typeNodeInteger$valu : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.integerDigits;
|
|
79613
79661
|
if (integerDigits != undefined) {
|
|
79614
79662
|
const integerDigitsRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.LeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.MinusBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NumLenExpression(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.FractionalLenExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.castOperandToDecimalIfNeed)(valueReference))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.DecimalLiteralExpression(integerDigits)));
|
|
79615
|
-
yield
|
|
79616
|
-
|
|
79617
|
-
|
|
79663
|
+
yield {
|
|
79664
|
+
condition: integerDigitsRuleBody,
|
|
79665
|
+
message: makeMessage({
|
|
79666
|
+
integerDigitsMaxCount: integerDigits
|
|
79667
|
+
}, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description),
|
|
79668
|
+
checkType: checkType
|
|
79669
|
+
};
|
|
79618
79670
|
}
|
|
79619
79671
|
const typeNodeFractional = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children10 = typeNode.children) === null || _typeNode$children10 === void 0 ? void 0 : _typeNode$children10.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_2__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_2__.FractiondigitsTypeCheckNode));
|
|
79620
79672
|
const fractionalDigits = (_typeNodeFractional$v = typeNodeFractional === null || typeNodeFractional === void 0 ? void 0 : typeNodeFractional.value) !== null && _typeNodeFractional$v !== void 0 ? _typeNodeFractional$v : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.fractionDigits;
|
|
79621
79673
|
if (fractionalDigits != undefined) {
|
|
79622
79674
|
const fractionalDigitsRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.LeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.FractionalLenExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.castOperandToDecimalIfNeed)(valueReference)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.DecimalLiteralExpression(fractionalDigits)));
|
|
79623
|
-
yield
|
|
79624
|
-
|
|
79625
|
-
|
|
79675
|
+
yield {
|
|
79676
|
+
condition: fractionalDigitsRuleBody,
|
|
79677
|
+
message: makeMessage({
|
|
79678
|
+
fractionalDigitsMaxCount: fractionalDigits
|
|
79679
|
+
}, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description),
|
|
79680
|
+
checkType: checkType
|
|
79681
|
+
};
|
|
79626
79682
|
}
|
|
79627
79683
|
}
|
|
79628
79684
|
createBaseTypeValidation(valueReference, baseType, baseDescription) {
|
|
@@ -79633,28 +79689,61 @@ class FLangValidationBuildContext {
|
|
|
79633
79689
|
return undefined;
|
|
79634
79690
|
case "integer":
|
|
79635
79691
|
{
|
|
79636
|
-
return
|
|
79692
|
+
return {
|
|
79693
|
+
condition: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.RegexMatchExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.StringLiteralExpression("^-?\\d+$"))),
|
|
79694
|
+
message: makeArrayLiteral(baseDescription !== null && baseDescription !== void 0 ? baseDescription : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_7__.StringTypeMessageGenerator.getBaseTypeMessage(baseType))
|
|
79695
|
+
};
|
|
79637
79696
|
}
|
|
79638
79697
|
case "decimal":
|
|
79639
79698
|
{
|
|
79640
|
-
return
|
|
79699
|
+
return {
|
|
79700
|
+
condition: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.RegexMatchExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.StringLiteralExpression("^-?\\d+(([.]\\d+$)|($))"))),
|
|
79701
|
+
message: makeArrayLiteral(baseDescription !== null && baseDescription !== void 0 ? baseDescription : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_7__.StringTypeMessageGenerator.getBaseTypeMessage(baseType))
|
|
79702
|
+
};
|
|
79641
79703
|
}
|
|
79642
79704
|
case "date":
|
|
79643
79705
|
{
|
|
79644
|
-
return
|
|
79706
|
+
return {
|
|
79707
|
+
condition: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.RegexMatchExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.StringLiteralExpression("^(0[1-9]|[12][0-9]|3[01])\\.(0[1-9]|1[012])\\.(19|20)[0-9]{2}$"))),
|
|
79708
|
+
message: makeArrayLiteral(baseDescription !== null && baseDescription !== void 0 ? baseDescription : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_7__.StringTypeMessageGenerator.getBaseTypeMessage(baseType))
|
|
79709
|
+
};
|
|
79645
79710
|
}
|
|
79646
79711
|
case "gYear":
|
|
79647
79712
|
{
|
|
79648
|
-
return
|
|
79713
|
+
return {
|
|
79714
|
+
condition: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.RegexMatchExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.StringLiteralExpression("^\\d{4}$"))),
|
|
79715
|
+
message: makeArrayLiteral(baseDescription !== null && baseDescription !== void 0 ? baseDescription : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_7__.StringTypeMessageGenerator.getBaseTypeMessage(baseType))
|
|
79716
|
+
};
|
|
79649
79717
|
}
|
|
79650
79718
|
case "gMonth":
|
|
79651
79719
|
{
|
|
79652
|
-
return
|
|
79720
|
+
return {
|
|
79721
|
+
condition: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.RegexMatchExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_12__.StringLiteralExpression("^(--(0[1-9]|1[0-2]))$"))),
|
|
79722
|
+
message: makeArrayLiteral(baseDescription !== null && baseDescription !== void 0 ? baseDescription : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_7__.StringTypeMessageGenerator.getBaseTypeMessage(baseType))
|
|
79723
|
+
};
|
|
79653
79724
|
}
|
|
79654
79725
|
default:
|
|
79655
79726
|
throw new Error(`Unknown base type name: '${baseType}'`);
|
|
79656
79727
|
}
|
|
79657
79728
|
}
|
|
79729
|
+
getFirstAcceptedParent(schemaNode) {
|
|
79730
|
+
let parentNode = schemaNode === null || schemaNode === void 0 ? void 0 : schemaNode.parent;
|
|
79731
|
+
while (parentNode != undefined) {
|
|
79732
|
+
if (parentNode instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_0__.FormSchemaRngElement) {
|
|
79733
|
+
var _parentNode$multiple;
|
|
79734
|
+
if ((_parentNode$multiple = parentNode.multiple) !== null && _parentNode$multiple !== void 0 ? _parentNode$multiple : false) {
|
|
79735
|
+
return undefined;
|
|
79736
|
+
}
|
|
79737
|
+
if (parentNode.isOptional()) {
|
|
79738
|
+
return parentNode;
|
|
79739
|
+
}
|
|
79740
|
+
parentNode = parentNode.parent;
|
|
79741
|
+
} else {
|
|
79742
|
+
return undefined;
|
|
79743
|
+
}
|
|
79744
|
+
}
|
|
79745
|
+
return undefined;
|
|
79746
|
+
}
|
|
79658
79747
|
getAllPathsWithValidations() {
|
|
79659
79748
|
return this.pathsWithValidations.values();
|
|
79660
79749
|
}
|
|
@@ -79757,6 +79846,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
79757
79846
|
/* harmony export */ "NullCoalesceExpression": () => (/* binding */ NullCoalesceExpression),
|
|
79758
79847
|
/* harmony export */ "OneOfExpression": () => (/* binding */ OneOfExpression),
|
|
79759
79848
|
/* harmony export */ "NoDepsExpression": () => (/* binding */ NoDepsExpression),
|
|
79849
|
+
/* harmony export */ "HasPicklistValueExpression": () => (/* binding */ HasPicklistValueExpression),
|
|
79760
79850
|
/* harmony export */ "FLangStatement": () => (/* binding */ FLangStatement),
|
|
79761
79851
|
/* harmony export */ "SetStatement": () => (/* binding */ SetStatement)
|
|
79762
79852
|
/* harmony export */ });
|
|
@@ -80581,6 +80671,25 @@ class NoDepsExpression extends FLangExpression {
|
|
|
80581
80671
|
return `nodeps(${this.expression.convertToString()})`;
|
|
80582
80672
|
}
|
|
80583
80673
|
}
|
|
80674
|
+
class HasPicklistValueExpression extends FLangExpression {
|
|
80675
|
+
constructor(expression, gidAndColumns) {
|
|
80676
|
+
super();
|
|
80677
|
+
this.expression = void 0;
|
|
80678
|
+
this.gidExpression = void 0;
|
|
80679
|
+
this.expression = expression;
|
|
80680
|
+
this.gidExpression = new StringLiteralExpression(gidAndColumns);
|
|
80681
|
+
}
|
|
80682
|
+
getType() {
|
|
80683
|
+
return BuildInTypeExpression.bool;
|
|
80684
|
+
}
|
|
80685
|
+
getChildNodes() {
|
|
80686
|
+
return [];
|
|
80687
|
+
}
|
|
80688
|
+
convertToString() {
|
|
80689
|
+
const expression = this.expression.convertToString();
|
|
80690
|
+
return `hasPicklistValue(${expression}, ${this.gidExpression})`;
|
|
80691
|
+
}
|
|
80692
|
+
}
|
|
80584
80693
|
class FLangStatement extends FLangNode {}
|
|
80585
80694
|
class SetStatement extends FLangStatement {
|
|
80586
80695
|
constructor(left, right) {
|
|
@@ -99081,7 +99190,7 @@ class ComboBoxConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__
|
|
|
99081
99190
|
if (typeNode == undefined && schemaTypeNode == undefined) {
|
|
99082
99191
|
return [];
|
|
99083
99192
|
}
|
|
99084
|
-
return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional == undefined ? element === null || element === void 0 ? void 0 : element.isOptional() : node.validationInfo.optional);
|
|
99193
|
+
return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional == undefined ? element === null || element === void 0 ? void 0 : element.isOptional() : node.validationInfo.optional, undefined, node.gId);
|
|
99085
99194
|
}
|
|
99086
99195
|
buildChildrenDataDeclaration(context) {
|
|
99087
99196
|
const node = this.getCurrentNodeAs(_ComboBoxNode__WEBPACK_IMPORTED_MODULE_8__.ComboBoxNode);
|
|
@@ -102250,7 +102359,7 @@ class PicklistConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_3__
|
|
|
102250
102359
|
if (typeNode == undefined && schemaTypeNode == undefined) {
|
|
102251
102360
|
return [];
|
|
102252
102361
|
}
|
|
102253
|
-
return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional == undefined ? element === null || element === void 0 ? void 0 : element.isOptional() : node.validationInfo.optional);
|
|
102362
|
+
return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional == undefined ? element === null || element === void 0 ? void 0 : element.isOptional() : node.validationInfo.optional, undefined, node.gId);
|
|
102254
102363
|
}
|
|
102255
102364
|
doBuildNodeValidations(validationGenerator) {
|
|
102256
102365
|
const node = this.getCurrentNodeAs(_PicklistNode__WEBPACK_IMPORTED_MODULE_6__.PicklistNode);
|
|
@@ -103220,7 +103329,7 @@ class SelectConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_3__.S
|
|
|
103220
103329
|
if (typeNode == undefined && schemaTypeNode == undefined) {
|
|
103221
103330
|
return [];
|
|
103222
103331
|
}
|
|
103223
|
-
return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional == undefined ? element === null || element === void 0 ? void 0 : element.isOptional() : node.validationInfo.optional);
|
|
103332
|
+
return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional == undefined ? element === null || element === void 0 ? void 0 : element.isOptional() : node.validationInfo.optional, undefined, node.gId);
|
|
103224
103333
|
}
|
|
103225
103334
|
doBuildNormalizeRules(builder) {
|
|
103226
103335
|
const node = this.getCurrentNodeAs(_SelectNode__WEBPACK_IMPORTED_MODULE_6__.SelectNode);
|
|
@@ -103565,7 +103674,7 @@ class TaxRebateConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_3_
|
|
|
103565
103674
|
if (typeNode == undefined && schemaTypeNode == undefined) {
|
|
103566
103675
|
return [];
|
|
103567
103676
|
}
|
|
103568
|
-
return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional == undefined ? element === null || element === void 0 ? void 0 : element.isOptional() : node.validationInfo.optional);
|
|
103677
|
+
return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional == undefined ? element === null || element === void 0 ? void 0 : element.isOptional() : node.validationInfo.optional, undefined, node.gId);
|
|
103569
103678
|
}
|
|
103570
103679
|
doBuildNodeValidations(validationGenerator) {
|
|
103571
103680
|
const node = this.getCurrentNodeAs(_TaxRebateNode__WEBPACK_IMPORTED_MODULE_7__.TaxRebateNode);
|