@promptbook/legacy-documents 0.75.4 → 0.75.6
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 +44 -40
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +4 -2
- package/esm/typings/src/errors/0-BoilerplateError.d.ts +12 -0
- package/esm/typings/src/errors/{index.d.ts → 0-index.d.ts} +10 -2
- package/esm/typings/src/errors/utils/ErrorJson.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +44 -40
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -23,7 +23,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
23
23
|
*
|
|
24
24
|
* @see https://github.com/webgptorg/promptbook
|
|
25
25
|
*/
|
|
26
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.75.
|
|
26
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.75.5';
|
|
27
27
|
/**
|
|
28
28
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
29
29
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -2114,6 +2114,42 @@ var PipelineExecutionError = /** @class */ (function (_super) {
|
|
|
2114
2114
|
return PipelineExecutionError;
|
|
2115
2115
|
}(Error));
|
|
2116
2116
|
|
|
2117
|
+
/**
|
|
2118
|
+
* This error indicates problems parsing the format value
|
|
2119
|
+
*
|
|
2120
|
+
* For example, when the format value is not a valid JSON or CSV
|
|
2121
|
+
* This is not thrown directly but in extended classes
|
|
2122
|
+
*
|
|
2123
|
+
* @public exported from `@promptbook/core`
|
|
2124
|
+
*/
|
|
2125
|
+
var AbstractFormatError = /** @class */ (function (_super) {
|
|
2126
|
+
__extends(AbstractFormatError, _super);
|
|
2127
|
+
// Note: To allow instanceof do not put here error `name`
|
|
2128
|
+
// public readonly name = 'AbstractFormatError';
|
|
2129
|
+
function AbstractFormatError(message) {
|
|
2130
|
+
var _this = _super.call(this, message) || this;
|
|
2131
|
+
Object.setPrototypeOf(_this, AbstractFormatError.prototype);
|
|
2132
|
+
return _this;
|
|
2133
|
+
}
|
|
2134
|
+
return AbstractFormatError;
|
|
2135
|
+
}(Error));
|
|
2136
|
+
|
|
2137
|
+
/**
|
|
2138
|
+
* This error indicates problem with parsing of CSV
|
|
2139
|
+
*
|
|
2140
|
+
* @public exported from `@promptbook/core`
|
|
2141
|
+
*/
|
|
2142
|
+
var CsvFormatError = /** @class */ (function (_super) {
|
|
2143
|
+
__extends(CsvFormatError, _super);
|
|
2144
|
+
function CsvFormatError(message) {
|
|
2145
|
+
var _this = _super.call(this, message) || this;
|
|
2146
|
+
_this.name = 'CsvFormatError';
|
|
2147
|
+
Object.setPrototypeOf(_this, CsvFormatError.prototype);
|
|
2148
|
+
return _this;
|
|
2149
|
+
}
|
|
2150
|
+
return CsvFormatError;
|
|
2151
|
+
}(AbstractFormatError));
|
|
2152
|
+
|
|
2117
2153
|
/**
|
|
2118
2154
|
* This error indicates that the pipeline collection cannot be propperly loaded
|
|
2119
2155
|
*
|
|
@@ -2187,10 +2223,14 @@ var NotYetImplementedError = /** @class */ (function (_super) {
|
|
|
2187
2223
|
* @public exported from `@promptbook/core`
|
|
2188
2224
|
*/
|
|
2189
2225
|
var ERRORS = {
|
|
2190
|
-
|
|
2226
|
+
AbstractFormatError: AbstractFormatError,
|
|
2227
|
+
CsvFormatError: CsvFormatError,
|
|
2191
2228
|
CollectionError: CollectionError,
|
|
2192
2229
|
EnvironmentMismatchError: EnvironmentMismatchError,
|
|
2230
|
+
ExpectError: ExpectError,
|
|
2231
|
+
KnowledgeScrapeError: KnowledgeScrapeError,
|
|
2193
2232
|
LimitReachedError: LimitReachedError,
|
|
2233
|
+
MissingToolsError: MissingToolsError,
|
|
2194
2234
|
NotFoundError: NotFoundError,
|
|
2195
2235
|
NotYetImplementedError: NotYetImplementedError,
|
|
2196
2236
|
ParseError: ParseError,
|
|
@@ -3964,42 +4004,6 @@ function union() {
|
|
|
3964
4004
|
return union;
|
|
3965
4005
|
}
|
|
3966
4006
|
|
|
3967
|
-
/**
|
|
3968
|
-
* This error indicates problems parsing the format value
|
|
3969
|
-
*
|
|
3970
|
-
* For example, when the format value is not a valid JSON or CSV
|
|
3971
|
-
* This is not thrown directly but in extended classes
|
|
3972
|
-
*
|
|
3973
|
-
* @public exported from `@promptbook/core`
|
|
3974
|
-
*/
|
|
3975
|
-
var AbstractFormatError = /** @class */ (function (_super) {
|
|
3976
|
-
__extends(AbstractFormatError, _super);
|
|
3977
|
-
// Note: To allow instanceof do not put here error `name`
|
|
3978
|
-
// public readonly name = 'AbstractFormatError';
|
|
3979
|
-
function AbstractFormatError(message) {
|
|
3980
|
-
var _this = _super.call(this, message) || this;
|
|
3981
|
-
Object.setPrototypeOf(_this, AbstractFormatError.prototype);
|
|
3982
|
-
return _this;
|
|
3983
|
-
}
|
|
3984
|
-
return AbstractFormatError;
|
|
3985
|
-
}(Error));
|
|
3986
|
-
|
|
3987
|
-
/**
|
|
3988
|
-
* This error indicates problem with parsing of CSV
|
|
3989
|
-
*
|
|
3990
|
-
* @public exported from `@promptbook/core`
|
|
3991
|
-
*/
|
|
3992
|
-
var CsvFormatError = /** @class */ (function (_super) {
|
|
3993
|
-
__extends(CsvFormatError, _super);
|
|
3994
|
-
function CsvFormatError(message) {
|
|
3995
|
-
var _this = _super.call(this, message) || this;
|
|
3996
|
-
_this.name = 'CsvFormatError';
|
|
3997
|
-
Object.setPrototypeOf(_this, CsvFormatError.prototype);
|
|
3998
|
-
return _this;
|
|
3999
|
-
}
|
|
4000
|
-
return CsvFormatError;
|
|
4001
|
-
}(AbstractFormatError));
|
|
4002
|
-
|
|
4003
4007
|
/**
|
|
4004
4008
|
* @@@
|
|
4005
4009
|
*
|
|
@@ -4040,7 +4044,7 @@ var CsvFormatDefinition = {
|
|
|
4040
4044
|
case 0:
|
|
4041
4045
|
csv = parse(value, __assign(__assign({}, settings), MANDATORY_CSV_SETTINGS));
|
|
4042
4046
|
if (csv.errors.length !== 0) {
|
|
4043
|
-
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 "); }));
|
|
4047
|
+
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 setings:\n ").concat(block(JSON.stringify(__assign(__assign({}, settings), MANDATORY_CSV_SETTINGS), null, 2)), "\n\n The CSV data:\n ").concat(block(value), "\n "); }));
|
|
4044
4048
|
}
|
|
4045
4049
|
return [4 /*yield*/, Promise.all(csv.data.map(function (row, index) { return __awaiter(_this, void 0, void 0, function () {
|
|
4046
4050
|
var _a, _b;
|
|
@@ -4078,7 +4082,7 @@ var CsvFormatDefinition = {
|
|
|
4078
4082
|
case 0:
|
|
4079
4083
|
csv = parse(value, __assign(__assign({}, settings), MANDATORY_CSV_SETTINGS));
|
|
4080
4084
|
if (csv.errors.length !== 0) {
|
|
4081
|
-
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 "); }));
|
|
4085
|
+
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 setings:\n ").concat(block(JSON.stringify(__assign(__assign({}, settings), MANDATORY_CSV_SETTINGS), null, 2)), "\n\n The CSV data:\n ").concat(block(value), "\n "); }));
|
|
4082
4086
|
}
|
|
4083
4087
|
return [4 /*yield*/, Promise.all(csv.data.map(function (row, rowIndex) { return __awaiter(_this, void 0, void 0, function () {
|
|
4084
4088
|
var _this = this;
|