@kontur.candy/generator 5.111.1-fetch-fn-in-kclang.0 → 5.112.0-dead-picklist.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.
Files changed (2) hide show
  1. package/dist/index.js +10 -16
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -72532,10 +72532,8 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
72532
72532
  const markupBuilderContext = new _markupGenerator_IMarkupBuildingContext__WEBPACK_IMPORTED_MODULE_52__.MarkupBuildingContext(new _markupGenerator_ElementProcessors_Commons_NodePathsContext__WEBPACK_IMPORTED_MODULE_51__.NodePathsContext(), additionalContent.formSourcesPath, additionalContent.helpersContent, additionalContent.tourSteps, controlCustomizationContext, typeRegistry, formSchemaRng, dataDeclarationHelper, useSchemaValidations);
72533
72533
  const validationGenerator = new _validationGenerator_ValidationGenerator__WEBPACK_IMPORTED_MODULE_18__.ValidationGenerator(sugarRoot, typeRegistry, markupBuilderContext, controlCustomizationContext, formSchemaRng, useSchemaValidations, additionalContent.validationsContent, additionalContent.formJsonSettings);
72534
72534
  if ((_additionalContent$fo5 = additionalContent.formJsonSettings) !== null && _additionalContent$fo5 !== void 0 && _additionalContent$fo5.useServerSideFLangNormalization) {
72535
- var _additionalContent$fe;
72536
72535
  const kclangValidatios = Iterator.from(getImportedKclangValidations(sugarRoot, additionalContent)).toArray().join("\n");
72537
- const fetchFunctionsKClangContent = (_additionalContent$fe = additionalContent.fetchFunctionKClangSources) === null || _additionalContent$fe === void 0 ? void 0 : _additionalContent$fe.join("\n\n");
72538
- const fullKcLangContent = ["// KCLang Fetch Functions\n\n", fetchFunctionsKClangContent, "// KCLang User Formulas\n\n", additionalContent.kcLangContent, "// KCLang User Validations\n\n", kclangValidatios, "// KCLang Generated Sugar Rules\n\n", kcLangFromSugar].join("\n");
72536
+ const fullKcLangContent = ["// KCLang User Formulas\n\n", additionalContent.kcLangContent, "// KCLang User Validations\n\n", kclangValidatios, "// KCLang Generated Sugar Rules\n\n", kcLangFromSugar].join("\n");
72539
72537
  builder.addServerSideResource("All.kclang", fullKcLangContent);
72540
72538
  builder.addServerSideResource("extendedSchema.json", JSON.stringify(extendedSchemaInfo, _Common_SerializationUtils__WEBPACK_IMPORTED_MODULE_7__.excludeUndefinedOrEmptyObjectJsonReplacer));
72541
72539
  }
@@ -72608,9 +72606,6 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
72608
72606
  }) : [];
72609
72607
  const resultRules = combineFlangRules(defaultNormalizationRules.content, ...additionalNormalizationRules, ...customNormalizers);
72610
72608
  builder.addServerSideResource("ServerSide.normalize", resultRules);
72611
- for (const normalizerInfo of additionalNormalizationRules.filter(x => x.normalizerId != undefined)) {
72612
- builder.addServerSideResource(`${normalizerInfo.normalizerId}.flang`, normalizerInfo.content);
72613
- }
72614
72609
  }
72615
72610
  builder.addResource("lazyLoadDeclaration.js", _LazyLoadDeclarationGenerator_LazyLoadDeclarationGenerator__WEBPACK_IMPORTED_MODULE_31__.LazyLoadDeclarationGenerator.convertDeclarationToContent(finalLazyLoadDeclaration));
72616
72611
  const attachmentPathsGenerator = new _AttachmentPaths_AttachmentPathsGenerator__WEBPACK_IMPORTED_MODULE_29__.AttachmentPathsGenerator(markupBuilderContext);
@@ -72818,8 +72813,7 @@ async function readFormSources(formSourcesPath, farmDirectory) {
72818
72813
  tourSteps: await readFileSource(path__WEBPACK_IMPORTED_MODULE_1___default().join(rootPath, "tour"), "tour.js", "{}"),
72819
72814
  hooksContent: await readHooksFile(formSourcesPath),
72820
72815
  customControlsContent: await readCustomControlsFiles(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "controls")),
72821
- fetchFunctionSources: await readFiles(sugarReferences.fetchFunctionFiles.filter(x => path__WEBPACK_IMPORTED_MODULE_1___default().extname(x) == ".js").map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x))),
72822
- fetchFunctionKClangSources: await readFiles(sugarReferences.fetchFunctionFiles.filter(x => path__WEBPACK_IMPORTED_MODULE_1___default().extname(x) == ".kclang").map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x))),
72816
+ fetchFunctionSources: await readFiles(sugarReferences.fetchFunctionFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x))),
72823
72817
  localization: await connectJSFilesWithNames(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "localization")),
72824
72818
  importedFiles: await readImportedFiles(formSourcesPath),
72825
72819
  additionalNormalizers: additionalNormalizers
@@ -73514,7 +73508,7 @@ class MinusBinaryExpression extends BinaryExpression {
73514
73508
  }
73515
73509
  class MultiplicativeBinaryExpression extends BinaryExpression {
73516
73510
  needAddBraces(child) {
73517
- return !(child instanceof NegateUnaryExpression || child instanceof ValueReferenceExpression || child instanceof ArgumentReferenceExpression || child instanceof CastExpression || child instanceof ConstExpression);
73511
+ return !(child instanceof NegateUnaryExpression || child instanceof ValueReferenceExpression || child instanceof ArgumentReferenceExpression || child instanceof SumBinaryExpression || child instanceof MinusBinaryExpression || child instanceof CastExpression || child instanceof ConstExpression);
73518
73512
  }
73519
73513
  getType() {
73520
73514
  return BuildInTypeExpression.decimal;
@@ -75777,7 +75771,7 @@ class FormulaExpressionToFlangExpressionConverter {
75777
75771
  if (result == undefined) {
75778
75772
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
75779
75773
  }
75780
- return result;
75774
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.wrapWithArgumentsCondition)(result);
75781
75775
  }
75782
75776
  compileConcatExpression(expression, prefix, target, addPrecalculationRule) {
75783
75777
  const result = expression.arguments.reduce((acc, curr) => {
@@ -75817,7 +75811,7 @@ class FormulaExpressionToFlangExpressionConverter {
75817
75811
  if (result == undefined) {
75818
75812
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
75819
75813
  }
75820
- return result;
75814
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.wrapWithArgumentsCondition)(result);
75821
75815
  }
75822
75816
  compileDivisionExpression(expression, prefix, target, addPrecalculationRule) {
75823
75817
  const makeDivision = (numerator, denominator) => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression(denominator, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DivisionBinaryExpression(numerator, denominator), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression());
@@ -75828,7 +75822,7 @@ class FormulaExpressionToFlangExpressionConverter {
75828
75822
  if (result == undefined) {
75829
75823
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
75830
75824
  }
75831
- return result;
75825
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.wrapWithArgumentsCondition)(result);
75832
75826
  }
75833
75827
  preparePathAndAdjustMultiplicity(prefix, path) {
75834
75828
  const resultPath = this.adjustPathMultiplicity(prefix.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createModelPath)(path.replace(/\@/g, ""), "auto")).normalize());
@@ -76580,8 +76574,8 @@ class OptionalElementsRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MO
76580
76574
  return this.rules;
76581
76575
  }
76582
76576
  selectPrimaryElements() {
76583
- const optionalBlocksPaths = Iterator.from(this.dataDeclarationHelper.getAllPaths());
76584
- const primaryElements = optionalBlocksPaths.map(path => this.formSchemaRng.getElementByPath(path)).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrUndefined).filter(_common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_3__.isFormSchemaRngElement).toArray();
76577
+ const optionalBlocksPaths = this.dataDeclarationHelper.getOptionalBlocksPaths();
76578
+ const primaryElements = optionalBlocksPaths.map(path => this.formSchemaRng.getElementByPath(path)).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrUndefined).filter(_common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_3__.isFormSchemaRngElement);
76585
76579
  return primaryElements;
76586
76580
  }
76587
76581
  buildRulesForElement(element) {
@@ -76743,8 +76737,8 @@ class OptionalElementsRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MO
76743
76737
  }
76744
76738
  createIsMultipleChildExistsExpression(element) {
76745
76739
  const childrenPath = this.formSchemaRng.getPath(element).trimLastStarIfLastToken();
76746
- const childrenFieldRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(childrenPath, "children"), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string);
76747
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NotEqExpression(childrenFieldRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.StringLiteralExpression("[]")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NotEqExpression(childrenFieldRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NullLiteralExpression()));
76740
+ const childrenFieldRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(childrenPath, "children"), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.array);
76741
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.GtExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ArrayLengthExpression(childrenFieldRef), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.DecimalLiteralExpression(0));
76748
76742
  }
76749
76743
  createElementExistenceValueRefForLeftPart(element) {
76750
76744
  const elementPath = this.formSchemaRng.getPath(element).toEachIteration();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "5.111.1-fetch-fn-in-kclang.0",
3
+ "version": "5.112.0-dead-picklist.0",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,