@promptbook/website-crawler 0.75.4 → 0.75.5

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/esm/index.es.js CHANGED
@@ -24,7 +24,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
24
24
  *
25
25
  * @see https://github.com/webgptorg/promptbook
26
26
  */
27
- var PROMPTBOOK_ENGINE_VERSION = '0.75.3';
27
+ var PROMPTBOOK_ENGINE_VERSION = '0.75.4';
28
28
  /**
29
29
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
30
30
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -2092,6 +2092,42 @@ var PipelineExecutionError = /** @class */ (function (_super) {
2092
2092
  return PipelineExecutionError;
2093
2093
  }(Error));
2094
2094
 
2095
+ /**
2096
+ * This error indicates problems parsing the format value
2097
+ *
2098
+ * For example, when the format value is not a valid JSON or CSV
2099
+ * This is not thrown directly but in extended classes
2100
+ *
2101
+ * @public exported from `@promptbook/core`
2102
+ */
2103
+ var AbstractFormatError = /** @class */ (function (_super) {
2104
+ __extends(AbstractFormatError, _super);
2105
+ // Note: To allow instanceof do not put here error `name`
2106
+ // public readonly name = 'AbstractFormatError';
2107
+ function AbstractFormatError(message) {
2108
+ var _this = _super.call(this, message) || this;
2109
+ Object.setPrototypeOf(_this, AbstractFormatError.prototype);
2110
+ return _this;
2111
+ }
2112
+ return AbstractFormatError;
2113
+ }(Error));
2114
+
2115
+ /**
2116
+ * This error indicates problem with parsing of CSV
2117
+ *
2118
+ * @public exported from `@promptbook/core`
2119
+ */
2120
+ var CsvFormatError = /** @class */ (function (_super) {
2121
+ __extends(CsvFormatError, _super);
2122
+ function CsvFormatError(message) {
2123
+ var _this = _super.call(this, message) || this;
2124
+ _this.name = 'CsvFormatError';
2125
+ Object.setPrototypeOf(_this, CsvFormatError.prototype);
2126
+ return _this;
2127
+ }
2128
+ return CsvFormatError;
2129
+ }(AbstractFormatError));
2130
+
2095
2131
  /**
2096
2132
  * This error indicates that the pipeline collection cannot be propperly loaded
2097
2133
  *
@@ -2149,10 +2185,14 @@ var LimitReachedError = /** @class */ (function (_super) {
2149
2185
  * @public exported from `@promptbook/core`
2150
2186
  */
2151
2187
  var ERRORS = {
2152
- ExpectError: ExpectError,
2188
+ AbstractFormatError: AbstractFormatError,
2189
+ CsvFormatError: CsvFormatError,
2153
2190
  CollectionError: CollectionError,
2154
2191
  EnvironmentMismatchError: EnvironmentMismatchError,
2192
+ ExpectError: ExpectError,
2193
+ KnowledgeScrapeError: KnowledgeScrapeError,
2155
2194
  LimitReachedError: LimitReachedError,
2195
+ MissingToolsError: MissingToolsError,
2156
2196
  NotFoundError: NotFoundError,
2157
2197
  NotYetImplementedError: NotYetImplementedError,
2158
2198
  ParseError: ParseError,
@@ -3821,42 +3861,6 @@ function union() {
3821
3861
  return union;
3822
3862
  }
3823
3863
 
3824
- /**
3825
- * This error indicates problems parsing the format value
3826
- *
3827
- * For example, when the format value is not a valid JSON or CSV
3828
- * This is not thrown directly but in extended classes
3829
- *
3830
- * @public exported from `@promptbook/core`
3831
- */
3832
- var AbstractFormatError = /** @class */ (function (_super) {
3833
- __extends(AbstractFormatError, _super);
3834
- // Note: To allow instanceof do not put here error `name`
3835
- // public readonly name = 'AbstractFormatError';
3836
- function AbstractFormatError(message) {
3837
- var _this = _super.call(this, message) || this;
3838
- Object.setPrototypeOf(_this, AbstractFormatError.prototype);
3839
- return _this;
3840
- }
3841
- return AbstractFormatError;
3842
- }(Error));
3843
-
3844
- /**
3845
- * This error indicates problem with parsing of CSV
3846
- *
3847
- * @public exported from `@promptbook/core`
3848
- */
3849
- var CsvFormatError = /** @class */ (function (_super) {
3850
- __extends(CsvFormatError, _super);
3851
- function CsvFormatError(message) {
3852
- var _this = _super.call(this, message) || this;
3853
- _this.name = 'CsvFormatError';
3854
- Object.setPrototypeOf(_this, CsvFormatError.prototype);
3855
- return _this;
3856
- }
3857
- return CsvFormatError;
3858
- }(AbstractFormatError));
3859
-
3860
3864
  /**
3861
3865
  * @@@
3862
3866
  *
@@ -3897,7 +3901,7 @@ var CsvFormatDefinition = {
3897
3901
  case 0:
3898
3902
  csv = parse(value, __assign(__assign({}, settings), MANDATORY_CSV_SETTINGS));
3899
3903
  if (csv.errors.length !== 0) {
3900
- throw new CsvFormatError(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 "); }));
3904
+ throw new CsvFormatError(spaceTrim$1(function (block) { return "\n CSV parsing error\n\n Error(s) from CSV parsing:\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n\n The CSV data:\n ").concat(block(value), "\n "); }));
3901
3905
  }
3902
3906
  return [4 /*yield*/, Promise.all(csv.data.map(function (row, index) { return __awaiter(_this, void 0, void 0, function () {
3903
3907
  var _a, _b;
@@ -3935,7 +3939,7 @@ var CsvFormatDefinition = {
3935
3939
  case 0:
3936
3940
  csv = parse(value, __assign(__assign({}, settings), MANDATORY_CSV_SETTINGS));
3937
3941
  if (csv.errors.length !== 0) {
3938
- throw new CsvFormatError(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 "); }));
3942
+ throw new CsvFormatError(spaceTrim$1(function (block) { return "\n CSV parsing error\n\n Error(s) from CSV parsing:\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n\n The CSV data:\n ").concat(block(value), "\n "); }));
3939
3943
  }
3940
3944
  return [4 /*yield*/, Promise.all(csv.data.map(function (row, rowIndex) { return __awaiter(_this, void 0, void 0, function () {
3941
3945
  var _this = this;