@promptbook/node 0.69.0-10 → 0.69.0-12
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/README.md +0 -1
- package/esm/index.es.js +73 -62
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +2 -0
- package/esm/typings/src/_packages/types.index.d.ts +4 -0
- package/esm/typings/src/config.d.ts +9 -2
- package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorSettings.d.ts +7 -0
- package/esm/typings/src/formats/_common/FormatDefinition.d.ts +9 -6
- package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +4 -3
- package/esm/typings/src/formats/csv/CsvFormatDefinition.d.ts +3 -1
- package/esm/typings/src/formats/csv/CsvSettings.d.ts +5 -0
- package/esm/typings/src/formats/index.d.ts +1 -1
- package/esm/typings/src/formats/json/JsonFormatDefinition.d.ts +3 -2
- package/esm/typings/src/formats/text/TextFormatDefinition.d.ts +3 -1
- package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +3 -2
- package/esm/typings/src/utils/organization/{f.d.ts → empty_object.d.ts} +5 -1
- package/esm/typings/src/utils/organization/just_empty_object.d.ts +12 -0
- package/package.json +2 -2
- package/umd/index.umd.js +73 -62
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.test.d.ts +0 -1
package/README.md
CHANGED
|
@@ -88,7 +88,6 @@ File `write-website-content.ptbk.md`:
|
|
|
88
88
|
> Instructions for creating web page content.
|
|
89
89
|
>
|
|
90
90
|
> - PIPELINE URL https://promptbook.studio/webgpt/write-website-content.ptbk.md
|
|
91
|
-
> - PROMPTBOOK VERSION 0.0.1
|
|
92
91
|
> - INPUT PARAM `{rawTitle}` Automatically suggested a site name or empty text
|
|
93
92
|
> - INPUT PARAM `{rawAssigment}` Automatically generated site entry from image recognition
|
|
94
93
|
> - OUTPUT PARAM `{websiteContent}` Web content
|
package/esm/index.es.js
CHANGED
|
@@ -15,7 +15,7 @@ import * as dotenv from 'dotenv';
|
|
|
15
15
|
/**
|
|
16
16
|
* The version of the Promptbook library
|
|
17
17
|
*/
|
|
18
|
-
var PROMPTBOOK_VERSION = '0.69.0-
|
|
18
|
+
var PROMPTBOOK_VERSION = '0.69.0-11';
|
|
19
19
|
// TODO: !!!! List here all the versions and annotate + put into script
|
|
20
20
|
|
|
21
21
|
/*! *****************************************************************************
|
|
@@ -422,6 +422,19 @@ var RESERVED_PARAMETER_MISSING_VALUE = 'MISSING-' + REPLACING_NONCE;
|
|
|
422
422
|
*/
|
|
423
423
|
var RESERVED_PARAMETER_RESTRICTED = 'RESTRICTED-' + REPLACING_NONCE;
|
|
424
424
|
// <- TODO: [🧜♂️]
|
|
425
|
+
/**
|
|
426
|
+
* @@@
|
|
427
|
+
*
|
|
428
|
+
* @public exported from `@promptbook/core`
|
|
429
|
+
*/
|
|
430
|
+
var DEFAULT_CSV_SETTINGS = {
|
|
431
|
+
header: true,
|
|
432
|
+
delimiter: ',',
|
|
433
|
+
quoteChar: '"',
|
|
434
|
+
newline: '\n',
|
|
435
|
+
skipEmptyLines: true,
|
|
436
|
+
// encoding: 'utf8'
|
|
437
|
+
};
|
|
425
438
|
/**
|
|
426
439
|
* @@@
|
|
427
440
|
*
|
|
@@ -885,7 +898,7 @@ function forEachAsync(array, options, callbackfunction) {
|
|
|
885
898
|
});
|
|
886
899
|
}
|
|
887
900
|
|
|
888
|
-
var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.69.0-
|
|
901
|
+
var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.69.0-11",parameters:[{name:"knowledgeContent",description:"Markdown document content",isInput:true,isOutput:false},{name:"knowledgePieces",description:"The knowledge JSON object",isInput:false,isOutput:true}],templates:[{templateType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",content:"You are experienced data researcher, extract the important knowledge from the document.\n\n# Rules\n\n- Make pieces of information concise, clear, and easy to understand\n- One piece of information should be approximately 1 paragraph\n- Divide the paragraphs by markdown horizontal lines ---\n- Omit irrelevant information\n- Group redundant information\n- Write just extracted information, nothing else\n\n# The document\n\nTake information from this document:\n\n> {knowledgeContent}",resultingParameterName:"knowledgePieces",dependentParameterNames:["knowledgeContent"]}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-from-markdown.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-keywords.ptbk.md",promptbookVersion:"0.69.0-11",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"keywords",description:"Keywords separated by comma",isInput:false,isOutput:true}],templates:[{templateType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",content:"You are experienced data researcher, detect the important keywords in the document.\n\n# Rules\n\n- Write just keywords separated by comma\n\n# The document\n\nTake information from this document:\n\n> {knowledgePieceContent}",resultingParameterName:"keywords",dependentParameterNames:["knowledgePieceContent"]}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-keywords.ptbk.md"},{title:"Prepare Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-title.ptbk.md",promptbookVersion:"0.69.0-11",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"title",description:"The title of the document",isInput:false,isOutput:true}],templates:[{templateType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",content:"You are experienced content creator, write best title for the document.\n\n# Rules\n\n- Write just title, nothing else\n- Title should be concise and clear\n- Write maximum 5 words for the title\n\n# The document\n\n> {knowledgePieceContent}",resultingParameterName:"title",expectations:{words:{min:1,max:8}},dependentParameterNames:["knowledgePieceContent"]}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-title.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.ptbk.md",promptbookVersion:"0.69.0-11",parameters:[{name:"availableModelNames",description:"List of available model names separated by comma (,)",isInput:true,isOutput:false},{name:"personaDescription",description:"Description of the persona",isInput:true,isOutput:false},{name:"modelRequirements",description:"Specific requirements for the model",isInput:false,isOutput:true}],templates:[{templateType:"PROMPT_TEMPLATE",name:"make-model-requirements",title:"Make modelRequirements",content:"You are experienced AI engineer, you need to create virtual assistant.\nWrite\n\n## Sample\n\n```json\n{\n\"modelName\": \"gpt-4o\",\n\"systemMessage\": \"You are experienced AI engineer and helpfull assistant.\",\n\"temperature\": 0.7\n}\n```\n\n## Instructions\n\n- Your output format is JSON object\n- Write just the JSON object, no other text should be present\n- It contains the following keys:\n - `modelName`: The name of the model to use\n - `systemMessage`: The system message to provide context to the model\n - `temperature`: The sampling temperature to use\n\n### Key `modelName`\n\nPick from the following models:\n\n- {availableModelNames}\n\n### Key `systemMessage`\n\nThe system message is used to communicate instructions or provide context to the model at the beginning of a conversation. It is displayed in a different format compared to user messages, helping the model understand its role in the conversation. The system message typically guides the model's behavior, sets the tone, or specifies desired output from the model. By utilizing the system message effectively, users can steer the model towards generating more accurate and relevant responses.\n\nFor example:\n\n> You are an experienced AI engineer and helpful assistant.\n\n> You are a friendly and knowledgeable chatbot.\n\n### Key `temperature`\n\nThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.\n\nYou can pick a value between 0 and 2. For example:\n\n- `0.1`: Low temperature, extremely conservative and deterministic\n- `0.5`: Medium temperature, balanced between conservative and creative\n- `1.0`: High temperature, creative and bit random\n- `1.5`: Very high temperature, extremely creative and often chaotic and unpredictable\n- `2.0`: Maximum temperature, completely random and unpredictable, for some extreme creative use cases\n\n# The assistant\n\nTake this description of the persona:\n\n> {personaDescription}",resultingParameterName:"modelRequirements",format:"JSON",dependentParameterNames:["availableModelNames","personaDescription"]}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-persona.ptbk.md"}];
|
|
889
902
|
|
|
890
903
|
/**
|
|
891
904
|
* This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
|
|
@@ -2641,57 +2654,61 @@ function TODO_USE() {
|
|
|
2641
2654
|
var CsvFormatDefinition = {
|
|
2642
2655
|
formatName: 'CSV',
|
|
2643
2656
|
aliases: ['SPREADSHEET', 'TABLE'],
|
|
2644
|
-
isValid: function (value, schema) {
|
|
2657
|
+
isValid: function (value, settings, schema) {
|
|
2658
|
+
// TODO: !!!!!! Implement CSV validation
|
|
2645
2659
|
TODO_USE(value /* <- TODO: Use value here */);
|
|
2660
|
+
TODO_USE(settings /* <- TODO: Use settings here */);
|
|
2646
2661
|
TODO_USE(schema /* <- TODO: Use schema here */);
|
|
2647
2662
|
return true;
|
|
2648
2663
|
},
|
|
2649
|
-
canBeValid: function (partialValue, schema) {
|
|
2664
|
+
canBeValid: function (partialValue, settings, schema) {
|
|
2650
2665
|
TODO_USE(partialValue /* <- TODO: Use partialValue here */);
|
|
2666
|
+
TODO_USE(settings /* <- TODO: Use settings here */);
|
|
2651
2667
|
TODO_USE(schema /* <- TODO: Use schema here */);
|
|
2652
2668
|
return true;
|
|
2653
2669
|
},
|
|
2654
|
-
heal: function (value, schema) {
|
|
2670
|
+
heal: function (value, settings, schema) {
|
|
2655
2671
|
TODO_USE(value /* <- TODO: Use partialValue here */);
|
|
2672
|
+
TODO_USE(settings /* <- TODO: Use settings here */);
|
|
2656
2673
|
TODO_USE(schema /* <- TODO: Use schema here */);
|
|
2657
2674
|
throw new Error('Not implemented');
|
|
2658
2675
|
},
|
|
2659
2676
|
subvalueDefinitions: [
|
|
2660
2677
|
{
|
|
2661
2678
|
subvalueName: 'ROW',
|
|
2662
|
-
mapValues: function (value, mapCallback) {
|
|
2679
|
+
mapValues: function (value, settings, mapCallback) {
|
|
2663
2680
|
return __awaiter(this, void 0, void 0, function () {
|
|
2664
2681
|
var csv, mappedData;
|
|
2682
|
+
var _this = this;
|
|
2665
2683
|
return __generator(this, function (_a) {
|
|
2666
2684
|
switch (_a.label) {
|
|
2667
2685
|
case 0:
|
|
2668
|
-
csv = parse(value,
|
|
2669
|
-
header: true,
|
|
2670
|
-
delimiter: ',',
|
|
2671
|
-
quoteChar: '"',
|
|
2672
|
-
newline: '\r\n',
|
|
2673
|
-
skipEmptyLines: true,
|
|
2674
|
-
// encoding: 'utf8',
|
|
2675
|
-
// <- TODO: !!!!!! DEFAULT_CSV_OPTIONS
|
|
2676
|
-
// <- TODO: [🧠] How to define parsing options for formats, its different concept than schema
|
|
2677
|
-
});
|
|
2686
|
+
csv = parse(value, settings);
|
|
2678
2687
|
if (csv.errors.length !== 0) {
|
|
2679
2688
|
throw new ParseError(// <- TODO: !!!!!! Split PipelineParseError and FormatParseError -> CsvParseError
|
|
2680
2689
|
spaceTrim$1(function (block) { return "\n CSV parsing error\n\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n "); }));
|
|
2681
2690
|
}
|
|
2682
|
-
return [4 /*yield*/, Promise.all(csv.data.map(function (row, index) {
|
|
2691
|
+
return [4 /*yield*/, Promise.all(csv.data.map(function (row, index) { return __awaiter(_this, void 0, void 0, function () {
|
|
2692
|
+
var _a;
|
|
2693
|
+
var _b;
|
|
2694
|
+
return __generator(this, function (_c) {
|
|
2695
|
+
switch (_c.label) {
|
|
2696
|
+
case 0:
|
|
2697
|
+
_a = [__assign({}, row)];
|
|
2698
|
+
_b = {};
|
|
2699
|
+
// <- TODO: !!!!!! Dynamic new column name and position
|
|
2700
|
+
// <- TODO: !!!!!! Check name collisions
|
|
2701
|
+
return [4 /*yield*/, mapCallback(row, index)];
|
|
2702
|
+
case 1: return [2 /*return*/, (__assign.apply(void 0, _a.concat([(_b.newColumn =
|
|
2703
|
+
// <- TODO: !!!!!! Dynamic new column name and position
|
|
2704
|
+
// <- TODO: !!!!!! Check name collisions
|
|
2705
|
+
_c.sent(), _b)])))];
|
|
2706
|
+
}
|
|
2707
|
+
});
|
|
2708
|
+
}); }))];
|
|
2683
2709
|
case 1:
|
|
2684
2710
|
mappedData = _a.sent();
|
|
2685
|
-
return [2 /*return*/, unparse(mappedData,
|
|
2686
|
-
header: true,
|
|
2687
|
-
delimiter: ',',
|
|
2688
|
-
quoteChar: '"',
|
|
2689
|
-
newline: '\r\n',
|
|
2690
|
-
skipEmptyLines: true,
|
|
2691
|
-
// encoding: 'utf8',
|
|
2692
|
-
// <- TODO: !!!!!! DEFAULT_CSV_OPTIONS
|
|
2693
|
-
// <- TODO: [🧠] How to define parsing options for formats, its different concept than schema
|
|
2694
|
-
})];
|
|
2711
|
+
return [2 /*return*/, unparse(mappedData, settings)];
|
|
2695
2712
|
}
|
|
2696
2713
|
});
|
|
2697
2714
|
});
|
|
@@ -2699,23 +2716,14 @@ var CsvFormatDefinition = {
|
|
|
2699
2716
|
},
|
|
2700
2717
|
{
|
|
2701
2718
|
subvalueName: 'CELL',
|
|
2702
|
-
mapValues: function (value, mapCallback) {
|
|
2719
|
+
mapValues: function (value, settings, mapCallback) {
|
|
2703
2720
|
return __awaiter(this, void 0, void 0, function () {
|
|
2704
2721
|
var csv, mappedData;
|
|
2705
2722
|
var _this = this;
|
|
2706
2723
|
return __generator(this, function (_a) {
|
|
2707
2724
|
switch (_a.label) {
|
|
2708
2725
|
case 0:
|
|
2709
|
-
csv = parse(value,
|
|
2710
|
-
header: true,
|
|
2711
|
-
delimiter: ',',
|
|
2712
|
-
quoteChar: '"',
|
|
2713
|
-
newline: '\r\n',
|
|
2714
|
-
skipEmptyLines: true,
|
|
2715
|
-
// encoding: 'utf8',
|
|
2716
|
-
// <- TODO: !!!!!! DEFAULT_CSV_OPTIONS
|
|
2717
|
-
// <- TODO: [🧠] How to define parsing options for formats, its different concept than schema
|
|
2718
|
-
});
|
|
2726
|
+
csv = parse(value, settings);
|
|
2719
2727
|
if (csv.errors.length !== 0) {
|
|
2720
2728
|
throw new ParseError(// <- TODO: !!!!!! Split PipelineParseError and FormatParseError -> CsvParseError
|
|
2721
2729
|
spaceTrim$1(function (block) { return "\n CSV parsing error\n\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n "); }));
|
|
@@ -2738,16 +2746,7 @@ var CsvFormatDefinition = {
|
|
|
2738
2746
|
}); }))];
|
|
2739
2747
|
case 1:
|
|
2740
2748
|
mappedData = _a.sent();
|
|
2741
|
-
return [2 /*return*/, unparse(mappedData,
|
|
2742
|
-
header: true,
|
|
2743
|
-
delimiter: ',',
|
|
2744
|
-
quoteChar: '"',
|
|
2745
|
-
newline: '\r\n',
|
|
2746
|
-
skipEmptyLines: true,
|
|
2747
|
-
// encoding: 'utf8',
|
|
2748
|
-
// <- TODO: !!!!!! DEFAULT_CSV_OPTIONS
|
|
2749
|
-
// <- TODO: [🧠] How to define parsing options for formats, its different concept than schema
|
|
2750
|
-
})];
|
|
2749
|
+
return [2 /*return*/, unparse(mappedData, settings)];
|
|
2751
2750
|
}
|
|
2752
2751
|
});
|
|
2753
2752
|
});
|
|
@@ -2792,17 +2791,20 @@ function isValidJsonString(value /* <- [👨⚖️] */) {
|
|
|
2792
2791
|
var JsonFormatDefinition = {
|
|
2793
2792
|
formatName: 'JSON',
|
|
2794
2793
|
mimeType: 'application/json',
|
|
2795
|
-
isValid: function (value, schema) {
|
|
2794
|
+
isValid: function (value, settings, schema) {
|
|
2796
2795
|
TODO_USE(schema /* <- TODO: Use schema here */);
|
|
2796
|
+
TODO_USE(settings /* <- TODO: Use settings here */);
|
|
2797
2797
|
return isValidJsonString(value);
|
|
2798
2798
|
},
|
|
2799
|
-
canBeValid: function (partialValue, schema) {
|
|
2799
|
+
canBeValid: function (partialValue, settings, schema) {
|
|
2800
2800
|
TODO_USE(partialValue /* <- TODO: Use partialValue here */);
|
|
2801
|
+
TODO_USE(settings /* <- TODO: Use settings here */);
|
|
2801
2802
|
TODO_USE(schema /* <- TODO: Use schema here */);
|
|
2802
2803
|
return true;
|
|
2803
2804
|
},
|
|
2804
|
-
heal: function (value, schema) {
|
|
2805
|
+
heal: function (value, settings, schema) {
|
|
2805
2806
|
TODO_USE(value /* <- TODO: Use partialValue here */);
|
|
2807
|
+
TODO_USE(settings /* <- TODO: Use settings here */);
|
|
2806
2808
|
TODO_USE(schema /* <- TODO: Use schema here */);
|
|
2807
2809
|
throw new Error('Not implemented');
|
|
2808
2810
|
},
|
|
@@ -2811,7 +2813,7 @@ var JsonFormatDefinition = {
|
|
|
2811
2813
|
/**
|
|
2812
2814
|
* TODO: [🧠] Maybe propper instance of object
|
|
2813
2815
|
* TODO: [0] Make string_serialized_json
|
|
2814
|
-
* TODO: [1] Make type for JSON Schema
|
|
2816
|
+
* TODO: [1] Make type for JSON Settings and Schema
|
|
2815
2817
|
* TODO: [🧠] What to use for validating JSONs - JSON Schema, ZoD, typescript types/interfaces,...?
|
|
2816
2818
|
* TODO: [🍓] In `JsonFormatDefinition` implement simple `isValid`
|
|
2817
2819
|
* TODO: [🍓] In `JsonFormatDefinition` implement partial `canBeValid`
|
|
@@ -2841,7 +2843,7 @@ var TextFormatDefinition = {
|
|
|
2841
2843
|
subvalueDefinitions: [
|
|
2842
2844
|
{
|
|
2843
2845
|
subvalueName: 'LINE',
|
|
2844
|
-
mapValues: function (value, mapCallback) {
|
|
2846
|
+
mapValues: function (value, settings, mapCallback) {
|
|
2845
2847
|
return __awaiter(this, void 0, void 0, function () {
|
|
2846
2848
|
var lines, mappedLines;
|
|
2847
2849
|
return __generator(this, function (_a) {
|
|
@@ -2867,6 +2869,7 @@ var TextFormatDefinition = {
|
|
|
2867
2869
|
],
|
|
2868
2870
|
};
|
|
2869
2871
|
/**
|
|
2872
|
+
* TODO: [1] Make type for XML Text and Schema
|
|
2870
2873
|
* TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages aviable as subvalues
|
|
2871
2874
|
* TODO: [🍓] In `TextFormatDefinition` implement simple `isValid`
|
|
2872
2875
|
* TODO: [🍓] In `TextFormatDefinition` implement partial `canBeValid`
|
|
@@ -2883,18 +2886,21 @@ var TextFormatDefinition = {
|
|
|
2883
2886
|
var XmlFormatDefinition = {
|
|
2884
2887
|
formatName: 'XML',
|
|
2885
2888
|
mimeType: 'application/xml',
|
|
2886
|
-
isValid: function (value, schema) {
|
|
2889
|
+
isValid: function (value, settings, schema) {
|
|
2887
2890
|
TODO_USE(value /* <- TODO: Use value here */);
|
|
2891
|
+
TODO_USE(settings /* <- TODO: Use settings here */);
|
|
2888
2892
|
TODO_USE(schema /* <- TODO: Use schema here */);
|
|
2889
2893
|
return true;
|
|
2890
2894
|
},
|
|
2891
|
-
canBeValid: function (partialValue, schema) {
|
|
2895
|
+
canBeValid: function (partialValue, settings, schema) {
|
|
2892
2896
|
TODO_USE(partialValue /* <- TODO: Use partialValue here */);
|
|
2897
|
+
TODO_USE(settings /* <- TODO: Use settings here */);
|
|
2893
2898
|
TODO_USE(schema /* <- TODO: Use schema here */);
|
|
2894
2899
|
return true;
|
|
2895
2900
|
},
|
|
2896
|
-
heal: function (value, schema) {
|
|
2901
|
+
heal: function (value, settings, schema) {
|
|
2897
2902
|
TODO_USE(value /* <- TODO: Use partialValue here */);
|
|
2903
|
+
TODO_USE(settings /* <- TODO: Use settings here */);
|
|
2898
2904
|
TODO_USE(schema /* <- TODO: Use schema here */);
|
|
2899
2905
|
throw new Error('Not implemented');
|
|
2900
2906
|
},
|
|
@@ -2903,7 +2909,7 @@ var XmlFormatDefinition = {
|
|
|
2903
2909
|
/**
|
|
2904
2910
|
* TODO: [🧠] Maybe propper instance of object
|
|
2905
2911
|
* TODO: [0] Make string_serialized_xml
|
|
2906
|
-
* TODO: [1] Make type for XML Schema
|
|
2912
|
+
* TODO: [1] Make type for XML Settings and Schema
|
|
2907
2913
|
* TODO: [🧠] What to use for validating XMLs - XSD,...
|
|
2908
2914
|
* TODO: [🍓] In `XmlFormatDefinition` implement simple `isValid`
|
|
2909
2915
|
* TODO: [🍓] In `XmlFormatDefinition` implement partial `canBeValid`
|
|
@@ -3721,12 +3727,12 @@ function executeAttempts(options) {
|
|
|
3721
3727
|
*/
|
|
3722
3728
|
function executeFormatCells(options) {
|
|
3723
3729
|
return __awaiter(this, void 0, void 0, function () {
|
|
3724
|
-
var template, jokerParameterNames, parameters, priority, pipelineIdentification, parameterValue, formatDefinition, subvalueDefinition, resultString;
|
|
3730
|
+
var template, jokerParameterNames, parameters, priority, pipelineIdentification, settings, parameterValue, formatDefinition, subvalueDefinition, formatSettings, resultString;
|
|
3725
3731
|
var _this = this;
|
|
3726
3732
|
return __generator(this, function (_a) {
|
|
3727
3733
|
switch (_a.label) {
|
|
3728
3734
|
case 0:
|
|
3729
|
-
template = options.template, jokerParameterNames = options.jokerParameterNames, parameters = options.parameters, priority = options.priority, pipelineIdentification = options.pipelineIdentification;
|
|
3735
|
+
template = options.template, jokerParameterNames = options.jokerParameterNames, parameters = options.parameters, priority = options.priority, pipelineIdentification = options.pipelineIdentification, settings = options.settings;
|
|
3730
3736
|
if (template.foreach === undefined) {
|
|
3731
3737
|
return [2 /*return*/, /* not await */ executeAttempts(options)];
|
|
3732
3738
|
}
|
|
@@ -3755,7 +3761,11 @@ function executeFormatCells(options) {
|
|
|
3755
3761
|
.map(function (subvalueName) { return "- ".concat(subvalueName); })
|
|
3756
3762
|
.join('\n')), "\n\n [\u26F7] This should never happen because cell name should be validated during parsing\n\n ").concat(block(pipelineIdentification), "\n "); }));
|
|
3757
3763
|
}
|
|
3758
|
-
|
|
3764
|
+
if (formatDefinition.formatName === 'CSV') {
|
|
3765
|
+
formatSettings = settings.csvSettings;
|
|
3766
|
+
// <- TODO: !!!!!! More universal, make simmilar pattern for other formats for example \n vs \r\n in text
|
|
3767
|
+
}
|
|
3768
|
+
return [4 /*yield*/, subvalueDefinition.mapValues(parameterValue, formatSettings, function (subparameters, index) { return __awaiter(_this, void 0, void 0, function () {
|
|
3759
3769
|
var mappedParameters, allSubparameters, subresultString;
|
|
3760
3770
|
return __generator(this, function (_a) {
|
|
3761
3771
|
switch (_a.label) {
|
|
@@ -4390,7 +4400,7 @@ function executePipeline(options) {
|
|
|
4390
4400
|
function createPipelineExecutor(options) {
|
|
4391
4401
|
var _this = this;
|
|
4392
4402
|
var pipeline = options.pipeline, tools = options.tools, _a = options.settings, settings = _a === void 0 ? {} : _a;
|
|
4393
|
-
var _b = settings.maxExecutionAttempts, maxExecutionAttempts = _b === void 0 ? MAX_EXECUTION_ATTEMPTS : _b, _c = settings.maxParallelCount, maxParallelCount = _c === void 0 ? MAX_PARALLEL_COUNT : _c, _d = settings.
|
|
4403
|
+
var _b = settings.maxExecutionAttempts, maxExecutionAttempts = _b === void 0 ? MAX_EXECUTION_ATTEMPTS : _b, _c = settings.maxParallelCount, maxParallelCount = _c === void 0 ? MAX_PARALLEL_COUNT : _c, _d = settings.csvSettings, csvSettings = _d === void 0 ? DEFAULT_CSV_SETTINGS : _d, _e = settings.isVerbose, isVerbose = _e === void 0 ? IS_VERBOSE : _e, _f = settings.isNotPreparedWarningSupressed, isNotPreparedWarningSupressed = _f === void 0 ? false : _f;
|
|
4394
4404
|
validatePipeline(pipeline);
|
|
4395
4405
|
var pipelineIdentification = (function () {
|
|
4396
4406
|
// Note: This is a 😐 implementation of [🚞]
|
|
@@ -4425,6 +4435,7 @@ function createPipelineExecutor(options) {
|
|
|
4425
4435
|
settings: {
|
|
4426
4436
|
maxExecutionAttempts: maxExecutionAttempts,
|
|
4427
4437
|
maxParallelCount: maxParallelCount,
|
|
4438
|
+
csvSettings: csvSettings,
|
|
4428
4439
|
isVerbose: isVerbose,
|
|
4429
4440
|
isNotPreparedWarningSupressed: isNotPreparedWarningSupressed,
|
|
4430
4441
|
},
|
|
@@ -7173,7 +7184,7 @@ function extractAllListItemsFromMarkdown(markdown) {
|
|
|
7173
7184
|
function extractOneBlockFromMarkdown(markdown) {
|
|
7174
7185
|
var codeBlocks = extractAllBlocksFromMarkdown(markdown);
|
|
7175
7186
|
if (codeBlocks.length !== 1) {
|
|
7176
|
-
throw new ParseError(spaceTrim$1(function (block) { return "\n There should be exactly 1 code block, found ".concat(codeBlocks.length, " code blocks\n\n ").concat(block(codeBlocks.map(function (block, i) { return "Block ".concat(i + 1, ":\n").concat(block.content); }).join('\n\n\n')), "\n "); }));
|
|
7187
|
+
throw new ParseError(spaceTrim$1(function (block) { return "\n There should be exactly 1 code block in template, found ".concat(codeBlocks.length, " code blocks\n\n ").concat(block(codeBlocks.map(function (block, i) { return "Block ".concat(i + 1, ":\n").concat(block.content); }).join('\n\n\n')), "\n "); }));
|
|
7177
7188
|
}
|
|
7178
7189
|
return codeBlocks[0];
|
|
7179
7190
|
}
|