@kontur.candy/tools 2.255.0 → 2.256.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/distr/Common/CommonConstants/DefaultServicesUrls.js +1 -3
- package/distr/Common/CommonConstants/DefaultServicesUrls.js.map +1 -1
- package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/GeneratorPool.js +0 -5
- package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/GeneratorPool.js.map +1 -1
- package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/ReadSourcesAndProcessSugarWorker.js +1 -1
- package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/ReadSourcesAndProcessSugarWorker.js.map +1 -1
- package/distr/Tools/src/LocalServerFrontEndDist/enhancedClient.js +1 -1
- package/distr/Tools/src/StaticFilesForProductionResourcesDir/client.js +13 -14
- package/distr/Tools/src/StaticFilesForProductionResourcesDir/client.js.map +1 -1
- package/distr/Tools/src/StaticFilesForProductionResourcesDir/client.min.js +13 -14
- package/distr/Tools/src/StaticFilesForProductionResourcesDir/client.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,14 +10,12 @@ const DEFAULT_PICKLIST_URL = "";
|
|
|
10
10
|
const DEFAULT_NIDUS_URL = "";
|
|
11
11
|
const DEFAULT_FSPRINTER_URL = "";
|
|
12
12
|
const DEFAULT_CONTRACTORS_URL = "";
|
|
13
|
-
const DEFAULT_PERSONS_URL = "";
|
|
14
13
|
const defaultServicesUrls = exports.defaultServicesUrls = {
|
|
15
14
|
keformsUrl: DEFAULT_KEFORMS_URL,
|
|
16
15
|
staffServiceUrl: DEFAULT_STAFF_SERVICE_URL,
|
|
17
16
|
picklistUrl: DEFAULT_PICKLIST_URL,
|
|
18
17
|
nidusUrl: DEFAULT_NIDUS_URL,
|
|
19
18
|
fsPrinterUrl: DEFAULT_FSPRINTER_URL,
|
|
20
|
-
contractorsApiUrl: DEFAULT_CONTRACTORS_URL
|
|
21
|
-
personsApiUrl: DEFAULT_PERSONS_URL
|
|
19
|
+
contractorsApiUrl: DEFAULT_CONTRACTORS_URL
|
|
22
20
|
};
|
|
23
21
|
//# sourceMappingURL=DefaultServicesUrls.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultServicesUrls.js","names":["DEFAULT_KEFORMS_URL","DEFAULT_STAFF_SERVICE_URL","exports","DEFAULT_PICKLIST_URL","DEFAULT_NIDUS_URL","DEFAULT_FSPRINTER_URL","DEFAULT_CONTRACTORS_URL","
|
|
1
|
+
{"version":3,"file":"DefaultServicesUrls.js","names":["DEFAULT_KEFORMS_URL","DEFAULT_STAFF_SERVICE_URL","exports","DEFAULT_PICKLIST_URL","DEFAULT_NIDUS_URL","DEFAULT_FSPRINTER_URL","DEFAULT_CONTRACTORS_URL","defaultServicesUrls","keformsUrl","staffServiceUrl","picklistUrl","nidusUrl","fsPrinterUrl","contractorsApiUrl"],"sources":["../../../../Common/CommonConstants/DefaultServicesUrls.ts"],"sourcesContent":["const DEFAULT_KEFORMS_URL = \"\";\nexport const DEFAULT_STAFF_SERVICE_URL = \"https://api.kontur.ru/staff\";\nconst DEFAULT_PICKLIST_URL = \"\";\nconst DEFAULT_NIDUS_URL = \"\";\nconst DEFAULT_FSPRINTER_URL = \"\";\nconst DEFAULT_CONTRACTORS_URL = \"\";\n\nexport const defaultServicesUrls = {\n keformsUrl: DEFAULT_KEFORMS_URL,\n staffServiceUrl: DEFAULT_STAFF_SERVICE_URL,\n picklistUrl: DEFAULT_PICKLIST_URL,\n nidusUrl: DEFAULT_NIDUS_URL,\n fsPrinterUrl: DEFAULT_FSPRINTER_URL,\n contractorsApiUrl: DEFAULT_CONTRACTORS_URL,\n};\n"],"mappings":";;;;;;AAAA,MAAMA,mBAAmB,GAAG,EAAE;AACvB,MAAMC,yBAAyB,GAAAC,OAAA,CAAAD,yBAAA,GAAG,6BAA6B;AACtE,MAAME,oBAAoB,GAAG,EAAE;AAC/B,MAAMC,iBAAiB,GAAG,EAAE;AAC5B,MAAMC,qBAAqB,GAAG,EAAE;AAChC,MAAMC,uBAAuB,GAAG,EAAE;AAE3B,MAAMC,mBAAmB,GAAAL,OAAA,CAAAK,mBAAA,GAAG;EAC/BC,UAAU,EAAER,mBAAmB;EAC/BS,eAAe,EAAER,yBAAyB;EAC1CS,WAAW,EAAEP,oBAAoB;EACjCQ,QAAQ,EAAEP,iBAAiB;EAC3BQ,YAAY,EAAEP,qBAAqB;EACnCQ,iBAAiB,EAAEP;AACvB,CAAC","ignoreList":[]}
|
|
@@ -8,8 +8,6 @@ exports.GeneratorPool = void 0;
|
|
|
8
8
|
var _nodePath = _interopRequireDefault(require("node:path"));
|
|
9
9
|
var _ThreadPool = require("../../../../../Common/multithread/ThreadPool");
|
|
10
10
|
var _IterableUtils = require("../../../../../Common/IterableUtils");
|
|
11
|
-
const WORKER_MAX_OLD_GENERATION_MB = 512;
|
|
12
|
-
|
|
13
11
|
// Candy always runs from compiled `distr/` where `.js` file exists.
|
|
14
12
|
const WORKER_JS_FILENAME = "ReadSourcesAndProcessSugarWorker.js";
|
|
15
13
|
const defaultWorkerScriptPath = _nodePath.default.join(__dirname, WORKER_JS_FILENAME);
|
|
@@ -26,9 +24,6 @@ class GeneratorPool {
|
|
|
26
24
|
workerOptions: {
|
|
27
25
|
workerData: {
|
|
28
26
|
generatorPath: generatorPath
|
|
29
|
-
},
|
|
30
|
-
resourceLimits: {
|
|
31
|
-
maxOldGenerationSizeMb: WORKER_MAX_OLD_GENERATION_MB
|
|
32
27
|
}
|
|
33
28
|
}
|
|
34
29
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeneratorPool.js","names":["_nodePath","_interopRequireDefault","require","_ThreadPool","_IterableUtils","
|
|
1
|
+
{"version":3,"file":"GeneratorPool.js","names":["_nodePath","_interopRequireDefault","require","_ThreadPool","_IterableUtils","WORKER_JS_FILENAME","defaultWorkerScriptPath","path","join","__dirname","GeneratorPool","constructor","generatorPath","options","pool","maxWorkers","workerPath","ThreadPool","size","Math","max","workerOptions","workerData","generate","message","Error","response","exec","type","errorText","reconstructForm","generatedForm","dispose","_this$pool","undefined","formContent","result","key","item","iterateEntries","ArrayBuffer","Buffer","from","exports"],"sources":["../../../../../../src/BuildTasks/Generator/GeneratorWorker/GeneratorPool.ts"],"sourcesContent":["import path from \"node:path\";\n\nimport { ThreadPool } from \"../../../../../Common/multithread/ThreadPool\";\nimport { GeneratedForm } from \"../../Form/GenerateForm\";\nimport { iterateEntries } from \"../../../../../Common/IterableUtils\";\n\nimport type { CallMessage, CallResponse, GeneratedFormWorkerMessage } from \"./ReadSourcesAndProcessSugarWorker\";\n\n// Candy always runs from compiled `distr/` where `.js` file exists.\nconst WORKER_JS_FILENAME = \"ReadSourcesAndProcessSugarWorker.js\";\nconst defaultWorkerScriptPath = path.join(__dirname, WORKER_JS_FILENAME);\n\ninterface Options {\n workerPath?: string;\n maxWorkers?: number;\n}\n\nexport class GeneratorPool {\n private pool?: ThreadPool;\n\n public constructor(generatorPath: string, options: Options = {}) {\n const { maxWorkers = 1, workerPath = defaultWorkerScriptPath } = options;\n this.pool = new ThreadPool({\n workerPath: workerPath,\n size: Math.max(1, maxWorkers),\n workerOptions: { workerData: { generatorPath: generatorPath } },\n });\n }\n\n public async generate(message: CallMessage): Promise<GeneratedForm> {\n if (!this.pool) {\n throw new Error(\"GeneratorPool: exec on disposed pool\");\n }\n const response = await this.pool.exec<CallMessage, CallResponse>(message);\n if (response.type === \"Error\") {\n throw new Error(response.errorText);\n }\n return this.reconstructForm(response.generatedForm);\n }\n\n public async dispose(): Promise<void> {\n await this.pool?.dispose();\n this.pool = undefined;\n }\n\n private reconstructForm(formContent: GeneratedFormWorkerMessage): GeneratedForm {\n const result: GeneratedForm = {};\n for (const [key, item] of iterateEntries(formContent)) {\n // Transferred ArrayBuffer -> reconstruct a Buffer (zero-copy view).\n // String values pass through as-is.\n result[key] = item instanceof ArrayBuffer ? Buffer.from(item) : item;\n }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A,CAAWD,OAAO,CAAC,CAAC;IAC1B,IAAI,CAAClB,IAAI,GAAGoB,SAAS;EACzB;EAEQJ,eAAeA,CAACK,WAAuC,EAAiB;IAC5E,MAAMC,MAAqB,GAAG,CAAC,CAAC;IAChC,KAAK,MAAM,CAACC,GAAG,EAAEC,IAAI,CAAC,IAAI,IAAAC,6BAAc,EAACJ,WAAW,CAAC,EAAE;MACnD;MACA;MACAC,MAAM,CAACC,GAAG,CAAC,GAAGC,IAAI,YAAYE,WAAW,GAAGC,MAAM,CAACC,IAAI,CAACJ,IAAI,CAAC,GAAGA,IAAI;IACxE;IACA,OAAOF,MAAM;EACjB;AACJ;AAACO,OAAA,CAAAjC,aAAA,GAAAA,aAAA","ignoreList":[]}
|
package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/ReadSourcesAndProcessSugarWorker.js
CHANGED
|
@@ -15,7 +15,7 @@ const generator = (0, _GeneratorRequireUtils.importGenerator)(generatorPath);
|
|
|
15
15
|
const formContent = await generator.processSugar(formSource.sugarContent, formSource.resources, options);
|
|
16
16
|
|
|
17
17
|
// eslint-disable-next-line no-warning-comments
|
|
18
|
-
// TODO(2026-
|
|
18
|
+
// TODO(2026-07-31): временно отключаем валидацию компиляции Flang на бэкенде (исправить в задаче https://yt.skbkontur.ru/issue/FS-9242)
|
|
19
19
|
// const validator = new GeneratorSourcesValidator(generationOptions);
|
|
20
20
|
// await validator.validate(formContent);
|
|
21
21
|
|
package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/ReadSourcesAndProcessSugarWorker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadSourcesAndProcessSugarWorker.js","names":["_nodeWorker_threads","require","_IterableUtils","_GeneratorRequireUtils","_TypedThreadWorker","generatorPath","workerData","generator","importGenerator","startWorker","formPath","farmPath","options","send","formSource","readSources","formContent","processSugar","sugarContent","resources","result","transferList","key","formContentItem","iterateEntries","Buffer","content","buffer","slice","byteOffset","byteLength","push","type","gfv","generatedForm","error","_formSource","errorText","Error","toString","stack"],"sources":["../../../../../../src/BuildTasks/Generator/GeneratorWorker/ReadSourcesAndProcessSugarWorker.ts"],"sourcesContent":["import { workerData } from \"node:worker_threads\";\n\nimport type { GeneratedForm, GenerationOptions } from \"../../Form/GenerateForm\";\nimport type { FormSource } from \"../../FormSource\";\nimport { iterateEntries } from \"../../../../../Common/IterableUtils\";\n\nimport { importGenerator } from \"./GeneratorRequireUtils\";\nimport { startWorker } from \"./TypedThreadWorker\";\n\nexport interface GeneratedFormWorkerMessage {\n [relativeFileName: string]: string | ArrayBuffer;\n}\n\nexport type CallMessage = [formPath: string, farmPath: string, options: GenerationOptions | undefined];\n\nexport type CallResponse =\n | { type: \"Result\"; gfv: string; generatedForm: GeneratedFormWorkerMessage }\n | { type: \"Error\"; gfv?: string; errorText: string };\n\nconst { generatorPath } = workerData as { generatorPath: string };\nconst generator = importGenerator(generatorPath);\n\nstartWorker<CallMessage, CallResponse>(async ([formPath, farmPath, options], send): Promise<void> => {\n let formSource: FormSource | undefined;\n try {\n formSource = await generator.readSources(formPath, farmPath);\n const formContent: GeneratedForm = await generator.processSugar(\n formSource.sugarContent,\n formSource.resources,\n options\n );\n\n // eslint-disable-next-line no-warning-comments\n // TODO(2026-
|
|
1
|
+
{"version":3,"file":"ReadSourcesAndProcessSugarWorker.js","names":["_nodeWorker_threads","require","_IterableUtils","_GeneratorRequireUtils","_TypedThreadWorker","generatorPath","workerData","generator","importGenerator","startWorker","formPath","farmPath","options","send","formSource","readSources","formContent","processSugar","sugarContent","resources","result","transferList","key","formContentItem","iterateEntries","Buffer","content","buffer","slice","byteOffset","byteLength","push","type","gfv","generatedForm","error","_formSource","errorText","Error","toString","stack"],"sources":["../../../../../../src/BuildTasks/Generator/GeneratorWorker/ReadSourcesAndProcessSugarWorker.ts"],"sourcesContent":["import { workerData } from \"node:worker_threads\";\n\nimport type { GeneratedForm, GenerationOptions } from \"../../Form/GenerateForm\";\nimport type { FormSource } from \"../../FormSource\";\nimport { iterateEntries } from \"../../../../../Common/IterableUtils\";\n\nimport { importGenerator } from \"./GeneratorRequireUtils\";\nimport { startWorker } from \"./TypedThreadWorker\";\n\nexport interface GeneratedFormWorkerMessage {\n [relativeFileName: string]: string | ArrayBuffer;\n}\n\nexport type CallMessage = [formPath: string, farmPath: string, options: GenerationOptions | undefined];\n\nexport type CallResponse =\n | { type: \"Result\"; gfv: string; generatedForm: GeneratedFormWorkerMessage }\n | { type: \"Error\"; gfv?: string; errorText: string };\n\nconst { generatorPath } = workerData as { generatorPath: string };\nconst generator = importGenerator(generatorPath);\n\nstartWorker<CallMessage, CallResponse>(async ([formPath, farmPath, options], send): Promise<void> => {\n let formSource: FormSource | undefined;\n try {\n formSource = await generator.readSources(formPath, farmPath);\n const formContent: GeneratedForm = await generator.processSugar(\n formSource.sugarContent,\n formSource.resources,\n options\n );\n\n // eslint-disable-next-line no-warning-comments\n // TODO(2026-07-31): временно отключаем валидацию компиляции Flang на бэкенде (исправить в задаче https://yt.skbkontur.ru/issue/FS-9242)\n // const validator = new GeneratorSourcesValidator(generationOptions);\n // await validator.validate(formContent);\n\n const result: GeneratedFormWorkerMessage = {};\n const transferList: ArrayBuffer[] = [];\n\n for (const [key, formContentItem] of iterateEntries(formContent)) {\n if (formContentItem instanceof Buffer) {\n // Buffer.buffer is typed as ArrayBuffer | SharedArrayBuffer,\n // but Node.js Buffers never use SharedArrayBuffer in practice.\n const content = formContentItem.buffer.slice(\n formContentItem.byteOffset,\n formContentItem.byteOffset + formContentItem.byteLength\n ) as ArrayBuffer;\n result[key] = content;\n transferList.push(content);\n } else {\n result[key] = formContentItem as string;\n }\n }\n\n send(\n {\n type: \"Result\",\n gfv: formSource.resources.gfv,\n generatedForm: result,\n },\n transferList\n );\n } catch (error) {\n const errorText = error instanceof Error ? `${error.toString()}\\n${error.stack}` : `${error}`;\n send({\n type: \"Error\",\n gfv: formSource?.resources.gfv,\n errorText: errorText,\n });\n }\n});\n"],"mappings":";;AAAA,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