@kontur.candy/generator 5.55.0 → 5.55.1
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 +22 -75
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -67742,14 +67742,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
67742
67742
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
|
|
67743
67743
|
/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! util */ "util");
|
|
67744
67744
|
/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_2__);
|
|
67745
|
-
/* harmony import */ var
|
|
67746
|
-
/* harmony import */ var
|
|
67745
|
+
/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! crypto */ "crypto");
|
|
67746
|
+
/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_3__);
|
|
67747
|
+
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! chalk */ "./node_modules/chalk/source/index.js");
|
|
67748
|
+
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_4__);
|
|
67747
67749
|
/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! fs-extra */ "./node_modules/fs-extra/lib/index.js");
|
|
67748
67750
|
/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_10__);
|
|
67749
|
-
/* harmony import */ var
|
|
67750
|
-
/* harmony import */ var
|
|
67751
|
-
/* harmony import */ var md5_file__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! md5-file */ "./node_modules/md5-file/index.js");
|
|
67752
|
-
/* harmony import */ var md5_file__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(md5_file__WEBPACK_IMPORTED_MODULE_5__);
|
|
67751
|
+
/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! md5 */ "./node_modules/md5/md5.js");
|
|
67752
|
+
/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_5__);
|
|
67753
67753
|
/* harmony import */ var recursive_readdir__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! recursive-readdir */ "./node_modules/recursive-readdir/index.js");
|
|
67754
67754
|
/* harmony import */ var recursive_readdir__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(recursive_readdir__WEBPACK_IMPORTED_MODULE_6__);
|
|
67755
67755
|
/* harmony import */ var _common_ExtractSugarReferences__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/ExtractSugarReferences */ "./Generator/src/common/ExtractSugarReferences.ts");
|
|
@@ -67778,7 +67778,7 @@ async function readFormSources(formSourcesPath, farmDirectory) {
|
|
|
67778
67778
|
const sugarContent = await readSugarFiles(formSugarDirectoryPath, sugarReferences);
|
|
67779
67779
|
if (sugarReferences.fetchFunctionFiles.length === 0) {
|
|
67780
67780
|
// eslint-disable-next-line no-console
|
|
67781
|
-
console.warn(
|
|
67781
|
+
console.warn(chalk__WEBPACK_IMPORTED_MODULE_4___default().yellow(`[WARN] Форма не содержит ссылок на fetch-функции. Будут автоматически подключены функции из каталога legacyfetchfuctions\n` + `[WARN] В будущем необходимо явно прописывать ссылки на используемые fetch-функции`));
|
|
67782
67782
|
const legacyfetchfunctionsDirectory = (await (0,fs_extra__WEBPACK_IMPORTED_MODULE_10__.pathExists)(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions"))) ? path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions") : path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "candy.farm", "legacyfetchfunctions");
|
|
67783
67783
|
sugarReferences.fetchFunctionFiles = (await readdirAsync(legacyfetchfunctionsDirectory)).map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(legacyfetchfunctionsDirectory, x));
|
|
67784
67784
|
}
|
|
@@ -67884,20 +67884,20 @@ async function getAllDependencies(formSourcesPath, farmDirectory) {
|
|
|
67884
67884
|
}
|
|
67885
67885
|
return [path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, "index.sugar.xml"), ...sugarReferences.fetchFunctionFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x)), ...sugarReferences.sugarFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x + ".sugar.xml")), ...sugarReferences.resourceFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x)), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSourcesPath, "settings.json"))), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSourcesPath, "hooks.js"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "autocalc"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "helpers"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "converters"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "mergers"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "jsHelpers"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "xsltTemplates"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "validations"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "schemas"))), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "tour", "tour.js"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "controls"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "localization")))];
|
|
67886
67886
|
}
|
|
67887
|
-
function normalizeLineEndings(content) {
|
|
67888
|
-
return content.replace(/\r\n/gi, "\n").replace(/\n\r/gi, "\n");
|
|
67889
|
-
}
|
|
67890
67887
|
async function getAllDependenciesHash(formSourcesPath, farmDirectory) {
|
|
67891
67888
|
const allDeps = await getAllDependencies(formSourcesPath, farmDirectory);
|
|
67892
|
-
const hashes = await Promise.all(allDeps.map(async depFilePath =>
|
|
67893
|
-
|
|
67894
|
-
|
|
67895
|
-
|
|
67896
|
-
|
|
67897
|
-
|
|
67898
|
-
|
|
67899
|
-
|
|
67900
|
-
|
|
67889
|
+
const hashes = await Promise.all(allDeps.map(async depFilePath => hashFile(depFilePath)));
|
|
67890
|
+
return md5__WEBPACK_IMPORTED_MODULE_5___default()(hashes.join());
|
|
67891
|
+
}
|
|
67892
|
+
function normalizeLineEndings(content) {
|
|
67893
|
+
return content.replace(/\r/gi, "");
|
|
67894
|
+
}
|
|
67895
|
+
async function hashFile(filePath) {
|
|
67896
|
+
const fileBuffer = await readFileAsync(filePath, "utf-8");
|
|
67897
|
+
const clearedCRLF = normalizeLineEndings(fileBuffer);
|
|
67898
|
+
const hashBuffer = (0,crypto__WEBPACK_IMPORTED_MODULE_3__.createHash)("sha256");
|
|
67899
|
+
hashBuffer.update(clearedCRLF);
|
|
67900
|
+
return hashBuffer.digest("hex");
|
|
67901
67901
|
}
|
|
67902
67902
|
async function readSugarFiles(formSugarDirectoryPath, references) {
|
|
67903
67903
|
const result = {
|
|
@@ -67960,7 +67960,7 @@ async function readAdditionalNormalizersFiles(rootPath) {
|
|
|
67960
67960
|
return normalizerFiles;
|
|
67961
67961
|
} catch (error) {
|
|
67962
67962
|
// eslint-disable-next-line no-console
|
|
67963
|
-
console.warn(
|
|
67963
|
+
console.warn(chalk__WEBPACK_IMPORTED_MODULE_4___default().yellow(`Error while reading normalizers at ${rootPath}`, error));
|
|
67964
67964
|
return [];
|
|
67965
67965
|
}
|
|
67966
67966
|
}
|
|
@@ -70562,7 +70562,7 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70562
70562
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaRegexMatchExpression) {
|
|
70563
70563
|
const arg = this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule);
|
|
70564
70564
|
const correctedArg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.tryExtractValueReferenceAsStringFromDecimal)(arg);
|
|
70565
|
-
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.RegexMatchExpression(correctedArg, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(expression.pattern));
|
|
70565
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.RegexMatchExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(correctedArg), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(expression.pattern));
|
|
70566
70566
|
}
|
|
70567
70567
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaCountExpression) {
|
|
70568
70568
|
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule, "Count"), 0);
|
|
@@ -70738,7 +70738,7 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70738
70738
|
const lastStarIndexSecondPart = secondPartParts.lastIndexOf(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
|
|
70739
70739
|
const secondPartFinalParts = secondPartParts.slice(0, lastStarIndexSecondPart);
|
|
70740
70740
|
const finalIterPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)([...firstPart.getPathParts(), ...secondPartFinalParts]).trimLastStarIfLastToken();
|
|
70741
|
-
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ReduceCallExpression(finalIterPath, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.hashSet, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.hashSet)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddArrayExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.HashSetExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration(), "value")))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.HashSetExpression());
|
|
70741
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ReduceCallExpression(finalIterPath, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.hashSet, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.hashSet)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddArrayExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.HashSetExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DeserializeEnumerationExpression([new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration(), "value")], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BoolLiteralExpression(true))))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.HashSetExpression());
|
|
70742
70742
|
}
|
|
70743
70743
|
}
|
|
70744
70744
|
}
|
|
@@ -130529,59 +130529,6 @@ const forEachStep = (self, fn, node, thisp) => {
|
|
|
130529
130529
|
module.exports = LRUCache
|
|
130530
130530
|
|
|
130531
130531
|
|
|
130532
|
-
/***/ }),
|
|
130533
|
-
|
|
130534
|
-
/***/ "./node_modules/md5-file/index.js":
|
|
130535
|
-
/*!****************************************!*\
|
|
130536
|
-
!*** ./node_modules/md5-file/index.js ***!
|
|
130537
|
-
\****************************************/
|
|
130538
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
130539
|
-
|
|
130540
|
-
const crypto = __webpack_require__(/*! crypto */ "crypto")
|
|
130541
|
-
const fs = __webpack_require__(/*! fs */ "fs")
|
|
130542
|
-
|
|
130543
|
-
const BUFFER_SIZE = 8192
|
|
130544
|
-
|
|
130545
|
-
function md5FileSync (path) {
|
|
130546
|
-
const fd = fs.openSync(path, 'r')
|
|
130547
|
-
const hash = crypto.createHash('md5')
|
|
130548
|
-
const buffer = Buffer.alloc(BUFFER_SIZE)
|
|
130549
|
-
|
|
130550
|
-
try {
|
|
130551
|
-
let bytesRead
|
|
130552
|
-
|
|
130553
|
-
do {
|
|
130554
|
-
bytesRead = fs.readSync(fd, buffer, 0, BUFFER_SIZE)
|
|
130555
|
-
hash.update(buffer.slice(0, bytesRead))
|
|
130556
|
-
} while (bytesRead === BUFFER_SIZE)
|
|
130557
|
-
} finally {
|
|
130558
|
-
fs.closeSync(fd)
|
|
130559
|
-
}
|
|
130560
|
-
|
|
130561
|
-
return hash.digest('hex')
|
|
130562
|
-
}
|
|
130563
|
-
|
|
130564
|
-
function md5File (path) {
|
|
130565
|
-
return new Promise((resolve, reject) => {
|
|
130566
|
-
const output = crypto.createHash('md5')
|
|
130567
|
-
const input = fs.createReadStream(path)
|
|
130568
|
-
|
|
130569
|
-
input.on('error', (err) => {
|
|
130570
|
-
reject(err)
|
|
130571
|
-
})
|
|
130572
|
-
|
|
130573
|
-
output.once('readable', () => {
|
|
130574
|
-
resolve(output.read().toString('hex'))
|
|
130575
|
-
})
|
|
130576
|
-
|
|
130577
|
-
input.pipe(output)
|
|
130578
|
-
})
|
|
130579
|
-
}
|
|
130580
|
-
|
|
130581
|
-
module.exports = md5File
|
|
130582
|
-
module.exports.sync = md5FileSync
|
|
130583
|
-
|
|
130584
|
-
|
|
130585
130532
|
/***/ }),
|
|
130586
130533
|
|
|
130587
130534
|
/***/ "./node_modules/md5/md5.js":
|