@promptbook/pdf 0.77.0-6 → 0.77.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/README.md CHANGED
@@ -23,10 +23,6 @@
23
23
 
24
24
 
25
25
 
26
- <blockquote style="color: #ff8811">
27
- <b>⚠ Warning:</b> This is a pre-release version of the library. It is not yet ready for production use. Please look at <a href="https://www.npmjs.com/package/@promptbook/core?activeTab=versions">latest stable release</a>.
28
- </blockquote>
29
-
30
26
  ## 📦 Package `@promptbook/pdf`
31
27
 
32
28
  - Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
package/esm/index.es.js CHANGED
@@ -20,7 +20,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
20
20
  *
21
21
  * @see https://github.com/webgptorg/promptbook
22
22
  */
23
- var PROMPTBOOK_ENGINE_VERSION = '0.77.0-5';
23
+ var PROMPTBOOK_ENGINE_VERSION = '0.77.0';
24
24
  /**
25
25
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
26
26
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1941,7 +1941,7 @@ var LimitReachedError = /** @class */ (function (_super) {
1941
1941
  *
1942
1942
  * @public exported from `@promptbook/core`
1943
1943
  */
1944
- var ERRORS = {
1944
+ var PROMPTBOOK_ERRORS = {
1945
1945
  AbstractFormatError: AbstractFormatError,
1946
1946
  CsvFormatError: CsvFormatError,
1947
1947
  CollectionError: CollectionError,
@@ -1959,6 +1959,35 @@ var ERRORS = {
1959
1959
  UnexpectedError: UnexpectedError,
1960
1960
  // TODO: [🪑]> VersionMismatchError,
1961
1961
  };
1962
+ /**
1963
+ * Index of all javascript errors
1964
+ *
1965
+ * @private for internal usage
1966
+ */
1967
+ var COMMON_JAVASCRIPT_ERRORS = {
1968
+ Error: Error,
1969
+ EvalError: EvalError,
1970
+ RangeError: RangeError,
1971
+ ReferenceError: ReferenceError,
1972
+ SyntaxError: SyntaxError,
1973
+ TypeError: TypeError,
1974
+ URIError: URIError,
1975
+ AggregateError: AggregateError,
1976
+ /*
1977
+ Note: Not widely supported
1978
+ > InternalError,
1979
+ > ModuleError,
1980
+ > HeapError,
1981
+ > WebAssemblyCompileError,
1982
+ > WebAssemblyRuntimeError,
1983
+ */
1984
+ };
1985
+ /**
1986
+ * Index of all errors
1987
+ *
1988
+ * @private for internal usage
1989
+ */
1990
+ var ALL_ERRORS = __assign(__assign({}, PROMPTBOOK_ERRORS), COMMON_JAVASCRIPT_ERRORS);
1962
1991
  /**
1963
1992
  * Note: [💞] Ignore a discrepancy between file name and entity name
1964
1993
  */
@@ -1969,11 +1998,11 @@ var ERRORS = {
1969
1998
  * @public exported from `@promptbook/utils`
1970
1999
  */
1971
2000
  function deserializeError(error) {
1972
- if (error.name === 'Error') {
1973
- return new Error(error.message);
2001
+ var ErrorClass = ALL_ERRORS[error.name];
2002
+ if (ErrorClass === undefined) {
2003
+ return new Error("".concat(error.name, ": ").concat(error.message));
1974
2004
  }
1975
- var CustomError = ERRORS[error.name];
1976
- return new CustomError(error.message);
2005
+ return new ErrorClass(error.message);
1977
2006
  }
1978
2007
 
1979
2008
  /**
@@ -2047,8 +2076,8 @@ function isPipelinePrepared(pipeline) {
2047
2076
  */
2048
2077
  function serializeError(error) {
2049
2078
  var name = error.name, message = error.message, stack = error.stack;
2050
- if (!__spreadArray(['Error'], __read(Object.keys(ERRORS)), false).includes(name)) {
2051
- throw new UnexpectedError(spaceTrim$1(function (block) { return "\n \n Cannot serialize error with name \"".concat(name, "\"\n\n ").concat(block(stack || message), "\n \n "); }));
2079
+ if (!Object.keys(ALL_ERRORS).includes(name)) {
2080
+ console.error(spaceTrim$1(function (block) { return "\n \n Cannot serialize error with name \"".concat(name, "\"\n\n ").concat(block(stack || message), "\n \n "); }));
2052
2081
  }
2053
2082
  return {
2054
2083
  name: name,