@truto/truto-jsonata 1.0.45 → 1.0.47

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.
@@ -21591,6 +21591,228 @@ var require_lib = __commonJS((exports2) => {
21591
21591
  exports2.impl = impl;
21592
21592
  });
21593
21593
 
21594
+ // node_modules/retry/lib/retry_operation.js
21595
+ var require_retry_operation = __commonJS((exports2, module2) => {
21596
+ function RetryOperation(timeouts, options3) {
21597
+ if (typeof options3 === "boolean") {
21598
+ options3 = { forever: options3 };
21599
+ }
21600
+ this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
21601
+ this._timeouts = timeouts;
21602
+ this._options = options3 || {};
21603
+ this._maxRetryTime = options3 && options3.maxRetryTime || Infinity;
21604
+ this._fn = null;
21605
+ this._errors = [];
21606
+ this._attempts = 1;
21607
+ this._operationTimeout = null;
21608
+ this._operationTimeoutCb = null;
21609
+ this._timeout = null;
21610
+ this._operationStart = null;
21611
+ this._timer = null;
21612
+ if (this._options.forever) {
21613
+ this._cachedTimeouts = this._timeouts.slice(0);
21614
+ }
21615
+ }
21616
+ module2.exports = RetryOperation;
21617
+ RetryOperation.prototype.reset = function() {
21618
+ this._attempts = 1;
21619
+ this._timeouts = this._originalTimeouts.slice(0);
21620
+ };
21621
+ RetryOperation.prototype.stop = function() {
21622
+ if (this._timeout) {
21623
+ clearTimeout(this._timeout);
21624
+ }
21625
+ if (this._timer) {
21626
+ clearTimeout(this._timer);
21627
+ }
21628
+ this._timeouts = [];
21629
+ this._cachedTimeouts = null;
21630
+ };
21631
+ RetryOperation.prototype.retry = function(err) {
21632
+ if (this._timeout) {
21633
+ clearTimeout(this._timeout);
21634
+ }
21635
+ if (!err) {
21636
+ return false;
21637
+ }
21638
+ var currentTime = new Date().getTime();
21639
+ if (err && currentTime - this._operationStart >= this._maxRetryTime) {
21640
+ this._errors.push(err);
21641
+ this._errors.unshift(new Error("RetryOperation timeout occurred"));
21642
+ return false;
21643
+ }
21644
+ this._errors.push(err);
21645
+ var timeout = this._timeouts.shift();
21646
+ if (timeout === undefined) {
21647
+ if (this._cachedTimeouts) {
21648
+ this._errors.splice(0, this._errors.length - 1);
21649
+ timeout = this._cachedTimeouts.slice(-1);
21650
+ } else {
21651
+ return false;
21652
+ }
21653
+ }
21654
+ var self2 = this;
21655
+ this._timer = setTimeout(function() {
21656
+ self2._attempts++;
21657
+ if (self2._operationTimeoutCb) {
21658
+ self2._timeout = setTimeout(function() {
21659
+ self2._operationTimeoutCb(self2._attempts);
21660
+ }, self2._operationTimeout);
21661
+ if (self2._options.unref) {
21662
+ self2._timeout.unref();
21663
+ }
21664
+ }
21665
+ self2._fn(self2._attempts);
21666
+ }, timeout);
21667
+ if (this._options.unref) {
21668
+ this._timer.unref();
21669
+ }
21670
+ return true;
21671
+ };
21672
+ RetryOperation.prototype.attempt = function(fn, timeoutOps) {
21673
+ this._fn = fn;
21674
+ if (timeoutOps) {
21675
+ if (timeoutOps.timeout) {
21676
+ this._operationTimeout = timeoutOps.timeout;
21677
+ }
21678
+ if (timeoutOps.cb) {
21679
+ this._operationTimeoutCb = timeoutOps.cb;
21680
+ }
21681
+ }
21682
+ var self2 = this;
21683
+ if (this._operationTimeoutCb) {
21684
+ this._timeout = setTimeout(function() {
21685
+ self2._operationTimeoutCb();
21686
+ }, self2._operationTimeout);
21687
+ }
21688
+ this._operationStart = new Date().getTime();
21689
+ this._fn(this._attempts);
21690
+ };
21691
+ RetryOperation.prototype.try = function(fn) {
21692
+ console.log("Using RetryOperation.try() is deprecated");
21693
+ this.attempt(fn);
21694
+ };
21695
+ RetryOperation.prototype.start = function(fn) {
21696
+ console.log("Using RetryOperation.start() is deprecated");
21697
+ this.attempt(fn);
21698
+ };
21699
+ RetryOperation.prototype.start = RetryOperation.prototype.try;
21700
+ RetryOperation.prototype.errors = function() {
21701
+ return this._errors;
21702
+ };
21703
+ RetryOperation.prototype.attempts = function() {
21704
+ return this._attempts;
21705
+ };
21706
+ RetryOperation.prototype.mainError = function() {
21707
+ if (this._errors.length === 0) {
21708
+ return null;
21709
+ }
21710
+ var counts = {};
21711
+ var mainError = null;
21712
+ var mainErrorCount = 0;
21713
+ for (var i = 0;i < this._errors.length; i++) {
21714
+ var error = this._errors[i];
21715
+ var message = error.message;
21716
+ var count = (counts[message] || 0) + 1;
21717
+ counts[message] = count;
21718
+ if (count >= mainErrorCount) {
21719
+ mainError = error;
21720
+ mainErrorCount = count;
21721
+ }
21722
+ }
21723
+ return mainError;
21724
+ };
21725
+ });
21726
+
21727
+ // node_modules/retry/lib/retry.js
21728
+ var require_retry = __commonJS((exports2) => {
21729
+ var RetryOperation = require_retry_operation();
21730
+ exports2.operation = function(options3) {
21731
+ var timeouts = exports2.timeouts(options3);
21732
+ return new RetryOperation(timeouts, {
21733
+ forever: options3 && (options3.forever || options3.retries === Infinity),
21734
+ unref: options3 && options3.unref,
21735
+ maxRetryTime: options3 && options3.maxRetryTime
21736
+ });
21737
+ };
21738
+ exports2.timeouts = function(options3) {
21739
+ if (options3 instanceof Array) {
21740
+ return [].concat(options3);
21741
+ }
21742
+ var opts = {
21743
+ retries: 10,
21744
+ factor: 2,
21745
+ minTimeout: 1 * 1000,
21746
+ maxTimeout: Infinity,
21747
+ randomize: false
21748
+ };
21749
+ for (var key in options3) {
21750
+ opts[key] = options3[key];
21751
+ }
21752
+ if (opts.minTimeout > opts.maxTimeout) {
21753
+ throw new Error("minTimeout is greater than maxTimeout");
21754
+ }
21755
+ var timeouts = [];
21756
+ for (var i = 0;i < opts.retries; i++) {
21757
+ timeouts.push(this.createTimeout(i, opts));
21758
+ }
21759
+ if (options3 && options3.forever && !timeouts.length) {
21760
+ timeouts.push(this.createTimeout(i, opts));
21761
+ }
21762
+ timeouts.sort(function(a, b) {
21763
+ return a - b;
21764
+ });
21765
+ return timeouts;
21766
+ };
21767
+ exports2.createTimeout = function(attempt, opts) {
21768
+ var random = opts.randomize ? Math.random() + 1 : 1;
21769
+ var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));
21770
+ timeout = Math.min(timeout, opts.maxTimeout);
21771
+ return timeout;
21772
+ };
21773
+ exports2.wrap = function(obj, options3, methods) {
21774
+ if (options3 instanceof Array) {
21775
+ methods = options3;
21776
+ options3 = null;
21777
+ }
21778
+ if (!methods) {
21779
+ methods = [];
21780
+ for (var key in obj) {
21781
+ if (typeof obj[key] === "function") {
21782
+ methods.push(key);
21783
+ }
21784
+ }
21785
+ }
21786
+ for (var i = 0;i < methods.length; i++) {
21787
+ var method = methods[i];
21788
+ var original = obj[method];
21789
+ obj[method] = function retryWrapper(original2) {
21790
+ var op = exports2.operation(options3);
21791
+ var args = Array.prototype.slice.call(arguments, 1);
21792
+ var callback = args.pop();
21793
+ args.push(function(err) {
21794
+ if (op.retry(err)) {
21795
+ return;
21796
+ }
21797
+ if (err) {
21798
+ arguments[0] = op.mainError();
21799
+ }
21800
+ callback.apply(this, arguments);
21801
+ });
21802
+ op.attempt(function() {
21803
+ original2.apply(obj, args);
21804
+ });
21805
+ }.bind(obj, original);
21806
+ obj[method].options = options3;
21807
+ }
21808
+ };
21809
+ });
21810
+
21811
+ // node_modules/retry/index.js
21812
+ var require_retry2 = __commonJS((exports2, module2) => {
21813
+ module2.exports = require_retry();
21814
+ });
21815
+
21594
21816
  // node_modules/json2md/lib/converters.js
21595
21817
  var require_converters = __commonJS((exports2, module2) => {
21596
21818
  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
@@ -21922,228 +22144,6 @@ var require_lib3 = __commonJS((exports2, module2) => {
21922
22144
  module2.exports = json2md;
21923
22145
  });
21924
22146
 
21925
- // node_modules/retry/lib/retry_operation.js
21926
- var require_retry_operation = __commonJS((exports2, module2) => {
21927
- function RetryOperation(timeouts, options3) {
21928
- if (typeof options3 === "boolean") {
21929
- options3 = { forever: options3 };
21930
- }
21931
- this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
21932
- this._timeouts = timeouts;
21933
- this._options = options3 || {};
21934
- this._maxRetryTime = options3 && options3.maxRetryTime || Infinity;
21935
- this._fn = null;
21936
- this._errors = [];
21937
- this._attempts = 1;
21938
- this._operationTimeout = null;
21939
- this._operationTimeoutCb = null;
21940
- this._timeout = null;
21941
- this._operationStart = null;
21942
- this._timer = null;
21943
- if (this._options.forever) {
21944
- this._cachedTimeouts = this._timeouts.slice(0);
21945
- }
21946
- }
21947
- module2.exports = RetryOperation;
21948
- RetryOperation.prototype.reset = function() {
21949
- this._attempts = 1;
21950
- this._timeouts = this._originalTimeouts.slice(0);
21951
- };
21952
- RetryOperation.prototype.stop = function() {
21953
- if (this._timeout) {
21954
- clearTimeout(this._timeout);
21955
- }
21956
- if (this._timer) {
21957
- clearTimeout(this._timer);
21958
- }
21959
- this._timeouts = [];
21960
- this._cachedTimeouts = null;
21961
- };
21962
- RetryOperation.prototype.retry = function(err) {
21963
- if (this._timeout) {
21964
- clearTimeout(this._timeout);
21965
- }
21966
- if (!err) {
21967
- return false;
21968
- }
21969
- var currentTime = new Date().getTime();
21970
- if (err && currentTime - this._operationStart >= this._maxRetryTime) {
21971
- this._errors.push(err);
21972
- this._errors.unshift(new Error("RetryOperation timeout occurred"));
21973
- return false;
21974
- }
21975
- this._errors.push(err);
21976
- var timeout = this._timeouts.shift();
21977
- if (timeout === undefined) {
21978
- if (this._cachedTimeouts) {
21979
- this._errors.splice(0, this._errors.length - 1);
21980
- timeout = this._cachedTimeouts.slice(-1);
21981
- } else {
21982
- return false;
21983
- }
21984
- }
21985
- var self2 = this;
21986
- this._timer = setTimeout(function() {
21987
- self2._attempts++;
21988
- if (self2._operationTimeoutCb) {
21989
- self2._timeout = setTimeout(function() {
21990
- self2._operationTimeoutCb(self2._attempts);
21991
- }, self2._operationTimeout);
21992
- if (self2._options.unref) {
21993
- self2._timeout.unref();
21994
- }
21995
- }
21996
- self2._fn(self2._attempts);
21997
- }, timeout);
21998
- if (this._options.unref) {
21999
- this._timer.unref();
22000
- }
22001
- return true;
22002
- };
22003
- RetryOperation.prototype.attempt = function(fn, timeoutOps) {
22004
- this._fn = fn;
22005
- if (timeoutOps) {
22006
- if (timeoutOps.timeout) {
22007
- this._operationTimeout = timeoutOps.timeout;
22008
- }
22009
- if (timeoutOps.cb) {
22010
- this._operationTimeoutCb = timeoutOps.cb;
22011
- }
22012
- }
22013
- var self2 = this;
22014
- if (this._operationTimeoutCb) {
22015
- this._timeout = setTimeout(function() {
22016
- self2._operationTimeoutCb();
22017
- }, self2._operationTimeout);
22018
- }
22019
- this._operationStart = new Date().getTime();
22020
- this._fn(this._attempts);
22021
- };
22022
- RetryOperation.prototype.try = function(fn) {
22023
- console.log("Using RetryOperation.try() is deprecated");
22024
- this.attempt(fn);
22025
- };
22026
- RetryOperation.prototype.start = function(fn) {
22027
- console.log("Using RetryOperation.start() is deprecated");
22028
- this.attempt(fn);
22029
- };
22030
- RetryOperation.prototype.start = RetryOperation.prototype.try;
22031
- RetryOperation.prototype.errors = function() {
22032
- return this._errors;
22033
- };
22034
- RetryOperation.prototype.attempts = function() {
22035
- return this._attempts;
22036
- };
22037
- RetryOperation.prototype.mainError = function() {
22038
- if (this._errors.length === 0) {
22039
- return null;
22040
- }
22041
- var counts = {};
22042
- var mainError = null;
22043
- var mainErrorCount = 0;
22044
- for (var i = 0;i < this._errors.length; i++) {
22045
- var error = this._errors[i];
22046
- var message = error.message;
22047
- var count = (counts[message] || 0) + 1;
22048
- counts[message] = count;
22049
- if (count >= mainErrorCount) {
22050
- mainError = error;
22051
- mainErrorCount = count;
22052
- }
22053
- }
22054
- return mainError;
22055
- };
22056
- });
22057
-
22058
- // node_modules/retry/lib/retry.js
22059
- var require_retry = __commonJS((exports2) => {
22060
- var RetryOperation = require_retry_operation();
22061
- exports2.operation = function(options3) {
22062
- var timeouts = exports2.timeouts(options3);
22063
- return new RetryOperation(timeouts, {
22064
- forever: options3 && (options3.forever || options3.retries === Infinity),
22065
- unref: options3 && options3.unref,
22066
- maxRetryTime: options3 && options3.maxRetryTime
22067
- });
22068
- };
22069
- exports2.timeouts = function(options3) {
22070
- if (options3 instanceof Array) {
22071
- return [].concat(options3);
22072
- }
22073
- var opts = {
22074
- retries: 10,
22075
- factor: 2,
22076
- minTimeout: 1 * 1000,
22077
- maxTimeout: Infinity,
22078
- randomize: false
22079
- };
22080
- for (var key in options3) {
22081
- opts[key] = options3[key];
22082
- }
22083
- if (opts.minTimeout > opts.maxTimeout) {
22084
- throw new Error("minTimeout is greater than maxTimeout");
22085
- }
22086
- var timeouts = [];
22087
- for (var i = 0;i < opts.retries; i++) {
22088
- timeouts.push(this.createTimeout(i, opts));
22089
- }
22090
- if (options3 && options3.forever && !timeouts.length) {
22091
- timeouts.push(this.createTimeout(i, opts));
22092
- }
22093
- timeouts.sort(function(a, b) {
22094
- return a - b;
22095
- });
22096
- return timeouts;
22097
- };
22098
- exports2.createTimeout = function(attempt, opts) {
22099
- var random = opts.randomize ? Math.random() + 1 : 1;
22100
- var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));
22101
- timeout = Math.min(timeout, opts.maxTimeout);
22102
- return timeout;
22103
- };
22104
- exports2.wrap = function(obj, options3, methods) {
22105
- if (options3 instanceof Array) {
22106
- methods = options3;
22107
- options3 = null;
22108
- }
22109
- if (!methods) {
22110
- methods = [];
22111
- for (var key in obj) {
22112
- if (typeof obj[key] === "function") {
22113
- methods.push(key);
22114
- }
22115
- }
22116
- }
22117
- for (var i = 0;i < methods.length; i++) {
22118
- var method = methods[i];
22119
- var original = obj[method];
22120
- obj[method] = function retryWrapper(original2) {
22121
- var op = exports2.operation(options3);
22122
- var args = Array.prototype.slice.call(arguments, 1);
22123
- var callback = args.pop();
22124
- args.push(function(err) {
22125
- if (op.retry(err)) {
22126
- return;
22127
- }
22128
- if (err) {
22129
- arguments[0] = op.mainError();
22130
- }
22131
- callback.apply(this, arguments);
22132
- });
22133
- op.attempt(function() {
22134
- original2.apply(obj, args);
22135
- });
22136
- }.bind(obj, original);
22137
- obj[method].options = options3;
22138
- }
22139
- };
22140
- });
22141
-
22142
- // node_modules/retry/index.js
22143
- var require_retry2 = __commonJS((exports2, module2) => {
22144
- module2.exports = require_retry();
22145
- });
22146
-
22147
22147
  // node:buffer
22148
22148
  var exports_buffer = {};
22149
22149
  __export(exports_buffer, {
@@ -29936,15 +29936,15 @@ var require_js2xml = __commonJS((exports2, module2) => {
29936
29936
  if ("attributesFn" in options3) {
29937
29937
  attributes = options3.attributesFn(attributes, currentElementName, currentElement);
29938
29938
  }
29939
- var key, attr, attrName, quote, result = [];
29939
+ var key, attr, attrName, quote2, result = [];
29940
29940
  for (key in attributes) {
29941
29941
  if (attributes.hasOwnProperty(key) && attributes[key] !== null && attributes[key] !== undefined) {
29942
- quote = options3.noQuotesForNativeAttributes && typeof attributes[key] !== "string" ? "" : '"';
29942
+ quote2 = options3.noQuotesForNativeAttributes && typeof attributes[key] !== "string" ? "" : '"';
29943
29943
  attr = "" + attributes[key];
29944
29944
  attr = attr.replace(/"/g, "&quot;");
29945
29945
  attrName = "attributeNameFn" in options3 ? options3.attributeNameFn(key, attr, currentElementName, currentElement) : key;
29946
29946
  result.push(options3.spaces && options3.indentAttributes ? writeIndentation(options3, depth + 1, false) : " ");
29947
- result.push(attrName + "=" + quote + ("attributeValueFn" in options3 ? options3.attributeValueFn(attr, key, currentElementName, currentElement) : attr) + quote);
29947
+ result.push(attrName + "=" + quote2 + ("attributeValueFn" in options3 ? options3.attributeValueFn(attr, key, currentElementName, currentElement) : attr) + quote2);
29948
29948
  }
29949
29949
  }
29950
29950
  if (attributes && Object.keys(attributes).length && options3.spaces && options3.indentAttributes) {
@@ -30398,7 +30398,7 @@ var require_object_inspect = __commonJS((exports2, module2) => {
30398
30398
  var s2 = "<" + $toLowerCase.call(String(obj.nodeName));
30399
30399
  var attrs = obj.attributes || [];
30400
30400
  for (var i2 = 0;i2 < attrs.length; i2++) {
30401
- s2 += " " + attrs[i2].name + "=" + wrapQuotes(quote(attrs[i2].value), "double", opts);
30401
+ s2 += " " + attrs[i2].name + "=" + wrapQuotes(quote2(attrs[i2].value), "double", opts);
30402
30402
  }
30403
30403
  s2 += ">";
30404
30404
  if (obj.childNodes && obj.childNodes.length) {
@@ -30501,7 +30501,7 @@ var require_object_inspect = __commonJS((exports2, module2) => {
30501
30501
  var quoteChar = quotes[style];
30502
30502
  return quoteChar + s2 + quoteChar;
30503
30503
  }
30504
- function quote(s2) {
30504
+ function quote2(s2) {
30505
30505
  return $replace.call(String(s2), /"/g, "&quot;");
30506
30506
  }
30507
30507
  function canTrustToString(obj) {
@@ -31430,7 +31430,7 @@ var require_get_intrinsic = __commonJS((exports2, module2) => {
31430
31430
  var $replace = bind.call($call, String.prototype.replace);
31431
31431
  var $strSlice = bind.call($call, String.prototype.slice);
31432
31432
  var $exec = bind.call($call, RegExp.prototype.exec);
31433
- var rePropName2 = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
31433
+ var rePropName3 = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
31434
31434
  var reEscapeChar2 = /\\(\\)?/g;
31435
31435
  var stringToPath2 = function stringToPath(string) {
31436
31436
  var first = $strSlice(string, 0, 1);
@@ -31441,8 +31441,8 @@ var require_get_intrinsic = __commonJS((exports2, module2) => {
31441
31441
  throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
31442
31442
  }
31443
31443
  var result = [];
31444
- $replace(string, rePropName2, function(match2, number, quote, subString) {
31445
- result[result.length] = quote ? $replace(subString, reEscapeChar2, "$1") : number || match2;
31444
+ $replace(string, rePropName3, function(match2, number, quote2, subString) {
31445
+ result[result.length] = quote2 ? $replace(subString, reEscapeChar2, "$1") : number || match2;
31446
31446
  });
31447
31447
  return result;
31448
31448
  };
@@ -31814,9 +31814,9 @@ var require_utils2 = __commonJS((exports2, module2) => {
31814
31814
  return acc;
31815
31815
  }, target);
31816
31816
  };
31817
- var decode = function(str, defaultDecoder, charset) {
31817
+ var decode = function(str, defaultDecoder, charset2) {
31818
31818
  var strWithoutPlus = str.replace(/\+/g, " ");
31819
- if (charset === "iso-8859-1") {
31819
+ if (charset2 === "iso-8859-1") {
31820
31820
  return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
31821
31821
  }
31822
31822
  try {
@@ -31826,7 +31826,7 @@ var require_utils2 = __commonJS((exports2, module2) => {
31826
31826
  }
31827
31827
  };
31828
31828
  var limit = 1024;
31829
- var encode = function encode(str, defaultEncoder, charset, kind, format) {
31829
+ var encode = function encode(str, defaultEncoder, charset2, kind, format) {
31830
31830
  if (str.length === 0) {
31831
31831
  return str;
31832
31832
  }
@@ -31836,7 +31836,7 @@ var require_utils2 = __commonJS((exports2, module2) => {
31836
31836
  } else if (typeof str !== "string") {
31837
31837
  string = String(str);
31838
31838
  }
31839
- if (charset === "iso-8859-1") {
31839
+ if (charset2 === "iso-8859-1") {
31840
31840
  return escape(string).replace(/%u[0-9a-f]{4}/gi, function($0) {
31841
31841
  return "%26%23" + parseInt($0.slice(2), 16) + "%3B";
31842
31842
  });
@@ -31978,7 +31978,7 @@ var require_stringify = __commonJS((exports2, module2) => {
31978
31978
  return typeof v === "string" || typeof v === "number" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "bigint";
31979
31979
  };
31980
31980
  var sentinel = {};
31981
- var stringify = function stringify(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter2, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) {
31981
+ var stringify = function stringify(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter2, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset2, sideChannel) {
31982
31982
  var obj = object;
31983
31983
  var tmpSc = sideChannel;
31984
31984
  var step = 0;
@@ -32011,14 +32011,14 @@ var require_stringify = __commonJS((exports2, module2) => {
32011
32011
  }
32012
32012
  if (obj === null) {
32013
32013
  if (strictNullHandling) {
32014
- return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, "key", format) : prefix;
32014
+ return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset2, "key", format) : prefix;
32015
32015
  }
32016
32016
  obj = "";
32017
32017
  }
32018
32018
  if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
32019
32019
  if (encoder) {
32020
- var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, "key", format);
32021
- return [formatter(keyValue) + "=" + formatter(encoder(obj, defaults.encoder, charset, "value", format))];
32020
+ var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset2, "key", format);
32021
+ return [formatter(keyValue) + "=" + formatter(encoder(obj, defaults.encoder, charset2, "value", format))];
32022
32022
  }
32023
32023
  return [formatter(prefix) + "=" + formatter(String(obj))];
32024
32024
  }
@@ -32054,7 +32054,7 @@ var require_stringify = __commonJS((exports2, module2) => {
32054
32054
  sideChannel.set(object, step);
32055
32055
  var valueSideChannel = getSideChannel();
32056
32056
  valueSideChannel.set(sentinel, sideChannel);
32057
- pushToArray(values2, stringify(value, keyPrefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, generateArrayPrefix === "comma" && encodeValuesOnly && isArray3(obj) ? null : encoder, filter2, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, valueSideChannel));
32057
+ pushToArray(values2, stringify(value, keyPrefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, generateArrayPrefix === "comma" && encodeValuesOnly && isArray3(obj) ? null : encoder, filter2, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset2, valueSideChannel));
32058
32058
  }
32059
32059
  return values2;
32060
32060
  };
@@ -32071,7 +32071,7 @@ var require_stringify = __commonJS((exports2, module2) => {
32071
32071
  if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") {
32072
32072
  throw new TypeError("Encoder has to be a function.");
32073
32073
  }
32074
- var charset = opts.charset || defaults.charset;
32074
+ var charset2 = opts.charset || defaults.charset;
32075
32075
  if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
32076
32076
  throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
32077
32077
  }
@@ -32104,7 +32104,7 @@ var require_stringify = __commonJS((exports2, module2) => {
32104
32104
  allowDots,
32105
32105
  allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
32106
32106
  arrayFormat,
32107
- charset,
32107
+ charset: charset2,
32108
32108
  charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel,
32109
32109
  commaRoundTrip: !!opts.commaRoundTrip,
32110
32110
  delimiter: typeof opts.delimiter === "undefined" ? defaults.delimiter : opts.delimiter,
@@ -32222,14 +32222,14 @@ var require_parse = __commonJS((exports2, module2) => {
32222
32222
  }
32223
32223
  var skipIndex = -1;
32224
32224
  var i2;
32225
- var charset = options3.charset;
32225
+ var charset2 = options3.charset;
32226
32226
  if (options3.charsetSentinel) {
32227
32227
  for (i2 = 0;i2 < parts.length; ++i2) {
32228
32228
  if (parts[i2].indexOf("utf8=") === 0) {
32229
32229
  if (parts[i2] === charsetSentinel) {
32230
- charset = "utf-8";
32230
+ charset2 = "utf-8";
32231
32231
  } else if (parts[i2] === isoSentinel) {
32232
- charset = "iso-8859-1";
32232
+ charset2 = "iso-8859-1";
32233
32233
  }
32234
32234
  skipIndex = i2;
32235
32235
  i2 = parts.length;
@@ -32246,15 +32246,15 @@ var require_parse = __commonJS((exports2, module2) => {
32246
32246
  var key;
32247
32247
  var val;
32248
32248
  if (pos === -1) {
32249
- key = options3.decoder(part, defaults.decoder, charset, "key");
32249
+ key = options3.decoder(part, defaults.decoder, charset2, "key");
32250
32250
  val = options3.strictNullHandling ? null : "";
32251
32251
  } else {
32252
- key = options3.decoder(part.slice(0, pos), defaults.decoder, charset, "key");
32252
+ key = options3.decoder(part.slice(0, pos), defaults.decoder, charset2, "key");
32253
32253
  val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options3, isArray3(obj[key]) ? obj[key].length : 0), function(encodedVal) {
32254
- return options3.decoder(encodedVal, defaults.decoder, charset, "value");
32254
+ return options3.decoder(encodedVal, defaults.decoder, charset2, "value");
32255
32255
  });
32256
32256
  }
32257
- if (val && options3.interpretNumericEntities && charset === "iso-8859-1") {
32257
+ if (val && options3.interpretNumericEntities && charset2 === "iso-8859-1") {
32258
32258
  val = interpretNumericEntities(String(val));
32259
32259
  }
32260
32260
  if (part.indexOf("[]=") > -1) {
@@ -32354,7 +32354,7 @@ var require_parse = __commonJS((exports2, module2) => {
32354
32354
  if (typeof opts.throwOnLimitExceeded !== "undefined" && typeof opts.throwOnLimitExceeded !== "boolean") {
32355
32355
  throw new TypeError("`throwOnLimitExceeded` option must be a boolean");
32356
32356
  }
32357
- var charset = typeof opts.charset === "undefined" ? defaults.charset : opts.charset;
32357
+ var charset2 = typeof opts.charset === "undefined" ? defaults.charset : opts.charset;
32358
32358
  var duplicates = typeof opts.duplicates === "undefined" ? defaults.duplicates : opts.duplicates;
32359
32359
  if (duplicates !== "combine" && duplicates !== "first" && duplicates !== "last") {
32360
32360
  throw new TypeError("The duplicates option must be either combine, first, or last");
@@ -32366,7 +32366,7 @@ var require_parse = __commonJS((exports2, module2) => {
32366
32366
  allowPrototypes: typeof opts.allowPrototypes === "boolean" ? opts.allowPrototypes : defaults.allowPrototypes,
32367
32367
  allowSparse: typeof opts.allowSparse === "boolean" ? opts.allowSparse : defaults.allowSparse,
32368
32368
  arrayLimit: typeof opts.arrayLimit === "number" ? opts.arrayLimit : defaults.arrayLimit,
32369
- charset,
32369
+ charset: charset2,
32370
32370
  charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel,
32371
32371
  comma: typeof opts.comma === "boolean" ? opts.comma : defaults.comma,
32372
32372
  decodeDotInKeys: typeof opts.decodeDotInKeys === "boolean" ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
@@ -35160,7 +35160,7 @@ __export(exports_src, {
35160
35160
  default: () => trutoJsonata
35161
35161
  });
35162
35162
  module.exports = __toCommonJS(exports_src);
35163
- var import_jsonata = __toESM(require_jsonata());
35163
+ var import_jsonata = __toESM(require_jsonata(), 1);
35164
35164
 
35165
35165
  // node_modules/lodash-es/_freeGlobal.js
35166
35166
  var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
@@ -39488,7 +39488,7 @@ function convertCurrencyToSubunit(arg, currencyCode) {
39488
39488
  var convertCurrencyToSubunit_default = convertCurrencyToSubunit;
39489
39489
 
39490
39490
  // src/functions/convertHtmlToMarkdown.ts
39491
- var import_domino = __toESM(require_lib());
39491
+ var import_domino = __toESM(require_lib(), 1);
39492
39492
 
39493
39493
  // node_modules/@truto/turndown-plugin-gfm/lib/index.js
39494
39494
  var highlightRegExp = /highlight-(?:(?:text|source)-)?([a-z0-9]+)/;
@@ -40615,7 +40615,7 @@ var def = edit(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?
40615
40615
  var list = edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, bullet).getRegex();
40616
40616
  var _tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
40617
40617
  var _comment = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
40618
- var html = edit("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", _comment).replace("tag", _tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
40618
+ var html = edit("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))", "i").replace("comment", _comment).replace("tag", _tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
40619
40619
  var paragraph = edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex();
40620
40620
  var blockquote = edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", paragraph).getRegex();
40621
40621
  var blockNormal = {
@@ -40633,7 +40633,7 @@ var blockNormal = {
40633
40633
  table: noopTest,
40634
40634
  text: blockText
40635
40635
  };
40636
- var gfmTable = edit("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex();
40636
+ var gfmTable = edit("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3}\t)[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex();
40637
40637
  var blockGfm = {
40638
40638
  ...blockNormal,
40639
40639
  lheading: lheadingGfm,
@@ -43789,7 +43789,7 @@ var def2 = edit2(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +
43789
43789
  var list2 = edit2(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, bullet2).getRegex();
43790
43790
  var _tag2 = "address|article|aside|base|basefont|blockquote|body|caption" + "|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption" + "|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe" + "|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option" + "|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title" + "|tr|track|ul";
43791
43791
  var _comment2 = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
43792
- var html2 = edit2("^ {0,3}(?:" + "<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)" + "|comment[^\\n]*(\\n+|$)" + "|<\\?[\\s\\S]*?(?:\\?>\\n*|$)" + "|<![A-Z][\\s\\S]*?(?:>\\n*|$)" + "|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)" + "|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)" + "|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)" + "|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)" + ")", "i").replace("comment", _comment2).replace("tag", _tag2).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
43792
+ var html2 = edit2("^ {0,3}(?:" + "<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)" + "|comment[^\\n]*(\\n+|$)" + "|<\\?[\\s\\S]*?(?:\\?>\\n*|$)" + "|<![A-Z][\\s\\S]*?(?:>\\n*|$)" + "|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)" + "|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)" + "|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)" + "|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)" + ")", "i").replace("comment", _comment2).replace("tag", _tag2).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
43793
43793
  var paragraph2 = edit2(_paragraph2).replace("hr", hr2).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag2).getRegex();
43794
43794
  var blockquote2 = edit2(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", paragraph2).getRegex();
43795
43795
  var blockNormal2 = {
@@ -43807,7 +43807,7 @@ var blockNormal2 = {
43807
43807
  table: noopTest2,
43808
43808
  text: blockText2
43809
43809
  };
43810
- var gfmTable2 = edit2("^ *([^\\n ].*)\\n" + " {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)" + "(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", hr2).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag2).getRegex();
43810
+ var gfmTable2 = edit2("^ *([^\\n ].*)\\n" + " {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)" + "(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", hr2).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3}\t)[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag2).getRegex();
43811
43811
  var blockGfm2 = {
43812
43812
  ...blockNormal2,
43813
43813
  table: gfmTable2,
@@ -45612,6 +45612,195 @@ var convertMarkdownToSlack = (text) => {
45612
45612
  };
45613
45613
  var convertMarkdownToSlack_default = convertMarkdownToSlack;
45614
45614
 
45615
+ // node_modules/p-retry/index.js
45616
+ var import_retry = __toESM(require_retry2(), 1);
45617
+
45618
+ // node_modules/is-network-error/index.js
45619
+ var objectToString2 = Object.prototype.toString;
45620
+ var isError = (value) => objectToString2.call(value) === "[object Error]";
45621
+ var errorMessages = new Set([
45622
+ "network error",
45623
+ "Failed to fetch",
45624
+ "NetworkError when attempting to fetch resource.",
45625
+ "The Internet connection appears to be offline.",
45626
+ "Load failed",
45627
+ "Network request failed",
45628
+ "fetch failed",
45629
+ "terminated"
45630
+ ]);
45631
+ function isNetworkError(error) {
45632
+ const isValid = error && isError(error) && error.name === "TypeError" && typeof error.message === "string";
45633
+ if (!isValid) {
45634
+ return false;
45635
+ }
45636
+ if (error.message === "Load failed") {
45637
+ return error.stack === undefined;
45638
+ }
45639
+ return errorMessages.has(error.message);
45640
+ }
45641
+
45642
+ // node_modules/p-retry/index.js
45643
+ class AbortError extends Error {
45644
+ constructor(message) {
45645
+ super();
45646
+ if (message instanceof Error) {
45647
+ this.originalError = message;
45648
+ ({ message } = message);
45649
+ } else {
45650
+ this.originalError = new Error(message);
45651
+ this.originalError.stack = this.stack;
45652
+ }
45653
+ this.name = "AbortError";
45654
+ this.message = message;
45655
+ }
45656
+ }
45657
+ var decorateErrorWithCounts = (error, attemptNumber, options3) => {
45658
+ const retriesLeft = options3.retries - (attemptNumber - 1);
45659
+ error.attemptNumber = attemptNumber;
45660
+ error.retriesLeft = retriesLeft;
45661
+ return error;
45662
+ };
45663
+ async function pRetry(input, options3) {
45664
+ return new Promise((resolve, reject2) => {
45665
+ options3 = { ...options3 };
45666
+ options3.onFailedAttempt ??= () => {};
45667
+ options3.shouldRetry ??= () => true;
45668
+ options3.retries ??= 10;
45669
+ const operation = import_retry.default.operation(options3);
45670
+ const abortHandler = () => {
45671
+ operation.stop();
45672
+ reject2(options3.signal?.reason);
45673
+ };
45674
+ if (options3.signal && !options3.signal.aborted) {
45675
+ options3.signal.addEventListener("abort", abortHandler, { once: true });
45676
+ }
45677
+ const cleanUp = () => {
45678
+ options3.signal?.removeEventListener("abort", abortHandler);
45679
+ operation.stop();
45680
+ };
45681
+ operation.attempt(async (attemptNumber) => {
45682
+ try {
45683
+ const result = await input(attemptNumber);
45684
+ cleanUp();
45685
+ resolve(result);
45686
+ } catch (error) {
45687
+ try {
45688
+ if (!(error instanceof Error)) {
45689
+ throw new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`);
45690
+ }
45691
+ if (error instanceof AbortError) {
45692
+ throw error.originalError;
45693
+ }
45694
+ if (error instanceof TypeError && !isNetworkError(error)) {
45695
+ throw error;
45696
+ }
45697
+ decorateErrorWithCounts(error, attemptNumber, options3);
45698
+ if (!await options3.shouldRetry(error)) {
45699
+ operation.stop();
45700
+ reject2(error);
45701
+ }
45702
+ await options3.onFailedAttempt(error);
45703
+ if (!operation.retry(error)) {
45704
+ throw operation.mainError();
45705
+ }
45706
+ } catch (finalError) {
45707
+ decorateErrorWithCounts(finalError, attemptNumber, options3);
45708
+ cleanUp();
45709
+ reject2(finalError);
45710
+ }
45711
+ }
45712
+ });
45713
+ });
45714
+ }
45715
+
45716
+ // src/functions/convertMdToPdf.ts
45717
+ function getFilenameFromHeaders(resp, fallback) {
45718
+ const cd = resp.headers.get("content-disposition") || "";
45719
+ const matchStar = cd.match(/filename\*=([^;]+)/i);
45720
+ if (matchStar) {
45721
+ const value = trim_default(matchStar[1]);
45722
+ const parts = split_default(value, "''");
45723
+ if (parts.length === 2) {
45724
+ try {
45725
+ return decodeURIComponent(parts[1]);
45726
+ } catch {
45727
+ return parts[1];
45728
+ }
45729
+ }
45730
+ return trim_default(value, `'"`);
45731
+ }
45732
+ const match = cd.match(/filename="?([^";]+)"?/i);
45733
+ if (match)
45734
+ return match[1];
45735
+ return fallback || "document.pdf";
45736
+ }
45737
+ async function convertMdToPdf(markdown, options3 = {}, assetHeaders = {}) {
45738
+ const documentParserApiUrl = this.environment.lookup("documentParserApiUrl");
45739
+ const documentParserApiKey = this.environment.lookup("documentParserApiKey");
45740
+ if (!documentParserApiKey) {
45741
+ throw new Error("Document parser API key not found in environment");
45742
+ }
45743
+ if (!documentParserApiUrl) {
45744
+ throw new Error("Document parser API URL not found in environment");
45745
+ }
45746
+ if (!markdown || typeof markdown !== "string") {
45747
+ throw new AbortError("Markdown content is required and must be a string");
45748
+ }
45749
+ const requestBody = {
45750
+ markdown,
45751
+ options: options3,
45752
+ assetHeaders
45753
+ };
45754
+ return await pRetry(async () => {
45755
+ const response = await fetch(`${documentParserApiUrl}/md-to-pdf`, {
45756
+ method: "POST",
45757
+ headers: {
45758
+ Authorization: `Bearer ${documentParserApiKey}`,
45759
+ "Content-Type": "application/json",
45760
+ Accept: "application/pdf",
45761
+ "User-Agent": "truto"
45762
+ },
45763
+ body: JSON.stringify(requestBody)
45764
+ });
45765
+ if (!response.ok) {
45766
+ if (response.status === 429) {
45767
+ throw new Error("Rate limit exceeded");
45768
+ }
45769
+ if (response.status >= 500) {
45770
+ throw new Error(`Server error: ${response.status}`);
45771
+ }
45772
+ const errorText = await response.text();
45773
+ let errorMessage = `PDF conversion failed (${response.status})`;
45774
+ try {
45775
+ const errorData = JSON.parse(errorText);
45776
+ errorMessage = errorData.error || errorMessage;
45777
+ if (errorData.details) {
45778
+ errorMessage += `: ${errorData.details}`;
45779
+ }
45780
+ } catch {
45781
+ errorMessage += `: ${errorText}`;
45782
+ }
45783
+ throw new AbortError(errorMessage);
45784
+ }
45785
+ const contentType = response.headers.get("content-type");
45786
+ if (!contentType || !includes_default(contentType, "application/pdf")) {
45787
+ throw new AbortError(`Expected PDF but received: ${contentType}`);
45788
+ }
45789
+ const arrayBuffer = await response.arrayBuffer();
45790
+ const filename = getFilenameFromHeaders(response, options3.filename);
45791
+ const blob2 = new Blob([arrayBuffer], { type: "application/pdf" });
45792
+ blob2.name = filename;
45793
+ return blob2;
45794
+ }, {
45795
+ retries: 5,
45796
+ maxTimeout: 30000,
45797
+ minTimeout: 2500,
45798
+ onFailedAttempt: (error) => {
45799
+ console.warn(`PDF conversion attempt ${error.attemptNumber} failed:`, error.message);
45800
+ }
45801
+ });
45802
+ }
45803
+
45615
45804
  // src/functions/convertNotionToMarkdown.ts
45616
45805
  var formatPlainText = (x) => {
45617
45806
  if (x) {
@@ -45789,7 +45978,7 @@ var convertNotionToMarkdown = function(blocks, linkChildPages = false) {
45789
45978
  var convertNotionToMarkdown_default = convertNotionToMarkdown;
45790
45979
 
45791
45980
  // src/functions/convertNotionToMd.ts
45792
- var import_json2md = __toESM(require_lib3());
45981
+ var import_json2md = __toESM(require_lib3(), 1);
45793
45982
  function convertNotionToMd2(block3) {
45794
45983
  const data = block3[block3.type];
45795
45984
  const plainText = data.rich_text ? data.rich_text.map((x) => {
@@ -50495,17 +50684,17 @@ var digest = async (text, algorithm = "SHA-256", stringType = "hex") => {
50495
50684
  var digest_default = digest;
50496
50685
 
50497
50686
  // src/functions/dtFromFormat.ts
50498
- function dtFromFormat(date, format) {
50687
+ function dtFromFormat(date, format, options3) {
50499
50688
  if (format === "RFC2822") {
50500
- return DateTime.fromRFC2822(date);
50689
+ return DateTime.fromRFC2822(date, options3);
50501
50690
  }
50502
50691
  if (format === "ISO") {
50503
- return DateTime.fromISO(date);
50692
+ return DateTime.fromISO(date, options3);
50504
50693
  }
50505
50694
  if (format === "fromSeconds") {
50506
- return DateTime.fromSeconds(parseInt(date));
50695
+ return DateTime.fromSeconds(parseInt(date), options3);
50507
50696
  }
50508
- return DateTime.fromFormat(date, format);
50697
+ return DateTime.fromFormat(date, format, options3);
50509
50698
  }
50510
50699
  var dtFromFormat_default = dtFromFormat;
50511
50700
 
@@ -50648,107 +50837,6 @@ async function pMap(iterable, mapper, {
50648
50837
  }
50649
50838
  var pMapSkip = Symbol("skip");
50650
50839
 
50651
- // node_modules/p-retry/index.js
50652
- var import_retry = __toESM(require_retry2());
50653
-
50654
- // node_modules/is-network-error/index.js
50655
- var objectToString2 = Object.prototype.toString;
50656
- var isError = (value) => objectToString2.call(value) === "[object Error]";
50657
- var errorMessages = new Set([
50658
- "network error",
50659
- "Failed to fetch",
50660
- "NetworkError when attempting to fetch resource.",
50661
- "The Internet connection appears to be offline.",
50662
- "Load failed",
50663
- "Network request failed",
50664
- "fetch failed",
50665
- "terminated"
50666
- ]);
50667
- function isNetworkError(error) {
50668
- const isValid = error && isError(error) && error.name === "TypeError" && typeof error.message === "string";
50669
- if (!isValid) {
50670
- return false;
50671
- }
50672
- if (error.message === "Load failed") {
50673
- return error.stack === undefined;
50674
- }
50675
- return errorMessages.has(error.message);
50676
- }
50677
-
50678
- // node_modules/p-retry/index.js
50679
- class AbortError extends Error {
50680
- constructor(message) {
50681
- super();
50682
- if (message instanceof Error) {
50683
- this.originalError = message;
50684
- ({ message } = message);
50685
- } else {
50686
- this.originalError = new Error(message);
50687
- this.originalError.stack = this.stack;
50688
- }
50689
- this.name = "AbortError";
50690
- this.message = message;
50691
- }
50692
- }
50693
- var decorateErrorWithCounts = (error, attemptNumber, options3) => {
50694
- const retriesLeft = options3.retries - (attemptNumber - 1);
50695
- error.attemptNumber = attemptNumber;
50696
- error.retriesLeft = retriesLeft;
50697
- return error;
50698
- };
50699
- async function pRetry(input, options3) {
50700
- return new Promise((resolve, reject2) => {
50701
- options3 = { ...options3 };
50702
- options3.onFailedAttempt ??= () => {};
50703
- options3.shouldRetry ??= () => true;
50704
- options3.retries ??= 10;
50705
- const operation = import_retry.default.operation(options3);
50706
- const abortHandler = () => {
50707
- operation.stop();
50708
- reject2(options3.signal?.reason);
50709
- };
50710
- if (options3.signal && !options3.signal.aborted) {
50711
- options3.signal.addEventListener("abort", abortHandler, { once: true });
50712
- }
50713
- const cleanUp = () => {
50714
- options3.signal?.removeEventListener("abort", abortHandler);
50715
- operation.stop();
50716
- };
50717
- operation.attempt(async (attemptNumber) => {
50718
- try {
50719
- const result = await input(attemptNumber);
50720
- cleanUp();
50721
- resolve(result);
50722
- } catch (error) {
50723
- try {
50724
- if (!(error instanceof Error)) {
50725
- throw new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`);
50726
- }
50727
- if (error instanceof AbortError) {
50728
- throw error.originalError;
50729
- }
50730
- if (error instanceof TypeError && !isNetworkError(error)) {
50731
- throw error;
50732
- }
50733
- decorateErrorWithCounts(error, attemptNumber, options3);
50734
- if (!await options3.shouldRetry(error)) {
50735
- operation.stop();
50736
- reject2(error);
50737
- }
50738
- await options3.onFailedAttempt(error);
50739
- if (!operation.retry(error)) {
50740
- throw operation.mainError();
50741
- }
50742
- } catch (finalError) {
50743
- decorateErrorWithCounts(finalError, attemptNumber, options3);
50744
- cleanUp();
50745
- reject2(finalError);
50746
- }
50747
- }
50748
- });
50749
- });
50750
- }
50751
-
50752
50840
  // src/functions/generateEmbeddingsCohere.ts
50753
50841
  async function generateEmbeddingsCohere(body, api_key) {
50754
50842
  if (!isEmpty_default(body.texts)) {
@@ -50957,8 +51045,447 @@ function jsonParse(str) {
50957
51045
  }
50958
51046
  var jsonParse_default = jsonParse;
50959
51047
 
51048
+ // node_modules/@json2csv/formatters/dist/mjs/default.js
51049
+ function defaultFormatter(value) {
51050
+ if (value === null || value === undefined)
51051
+ return "";
51052
+ return `${value}`;
51053
+ }
51054
+ // node_modules/@json2csv/formatters/dist/mjs/number.js
51055
+ function numberFormatter(opts = {}) {
51056
+ const { separator, decimals } = opts;
51057
+ if (separator) {
51058
+ if (decimals) {
51059
+ return (value) => value.toFixed(decimals).replace(".", separator);
51060
+ }
51061
+ return (value) => `${value}`.replace(".", separator);
51062
+ }
51063
+ if (decimals) {
51064
+ return (value) => value.toFixed(decimals);
51065
+ }
51066
+ return (value) => `${value}`;
51067
+ }
51068
+ // node_modules/@json2csv/formatters/dist/mjs/string.js
51069
+ function stringFormatter(opts = {}) {
51070
+ const quote = typeof opts.quote === "string" ? opts.quote : '"';
51071
+ const escapedQuote = typeof opts.escapedQuote === "string" ? opts.escapedQuote : `${quote}${quote}`;
51072
+ if (!quote || quote === escapedQuote) {
51073
+ return (value) => value;
51074
+ }
51075
+ const quoteRegExp = new RegExp(quote, "g");
51076
+ return (value) => {
51077
+ if (value.includes(quote)) {
51078
+ value = value.replace(quoteRegExp, escapedQuote);
51079
+ }
51080
+ return `${quote}${value}${quote}`;
51081
+ };
51082
+ }
51083
+ // node_modules/@json2csv/formatters/dist/mjs/stringExcel.js
51084
+ var quote = '"';
51085
+ var quoteRegExp = new RegExp(quote, "g");
51086
+ // node_modules/@json2csv/formatters/dist/mjs/symbol.js
51087
+ function symbolFormatter(opts = { stringFormatter: stringFormatter() }) {
51088
+ return (value) => opts.stringFormatter(value.toString().slice(7, -1));
51089
+ }
51090
+ // node_modules/@json2csv/formatters/dist/mjs/object.js
51091
+ function objectFormatter(opts = { stringFormatter: stringFormatter() }) {
51092
+ return (value) => {
51093
+ if (value === null)
51094
+ return "";
51095
+ let stringifiedValue = JSON.stringify(value);
51096
+ if (stringifiedValue === undefined)
51097
+ return "";
51098
+ if (stringifiedValue[0] === '"')
51099
+ stringifiedValue = stringifiedValue.replace(/^"(.+)"$/, "$1");
51100
+ return opts.stringFormatter(stringifiedValue);
51101
+ };
51102
+ }
51103
+ // node_modules/@json2csv/plainjs/dist/mjs/utils.js
51104
+ var rePropName2 = RegExp("[^.[\\]]+" + "|" + "\\[(?:" + `([^"'][^[]*)` + "|" + `(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2` + ")\\]" + "|" + "(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))", "g");
51105
+ function castPath2(value) {
51106
+ var _a, _b, _c;
51107
+ const result = [];
51108
+ let match2;
51109
+ while (match2 = rePropName2.exec(value)) {
51110
+ result.push((_c = (_a = match2[3]) !== null && _a !== undefined ? _a : (_b = match2[1]) === null || _b === undefined ? undefined : _b.trim()) !== null && _c !== undefined ? _c : match2[0]);
51111
+ }
51112
+ return result;
51113
+ }
51114
+ function getProp(obj, path, defaultValue) {
51115
+ if (path in obj) {
51116
+ const value = obj[path];
51117
+ return value === undefined ? defaultValue : value;
51118
+ }
51119
+ const processedPath = Array.isArray(path) ? path : castPath2(path, obj);
51120
+ let currentValue = obj;
51121
+ for (const key of processedPath) {
51122
+ currentValue = currentValue === null || currentValue === undefined ? undefined : currentValue[key];
51123
+ if (currentValue === undefined)
51124
+ return defaultValue;
51125
+ }
51126
+ return currentValue;
51127
+ }
51128
+ function flattenReducer(acc, arr) {
51129
+ try {
51130
+ Array.isArray(arr) ? acc.push(...arr) : acc.push(arr);
51131
+ return acc;
51132
+ } catch (err) {
51133
+ return acc.concat(arr);
51134
+ }
51135
+ }
51136
+ function fastJoin(arr, separator) {
51137
+ let isFirst = true;
51138
+ return arr.reduce((acc, elem) => {
51139
+ if (elem === null || elem === undefined) {
51140
+ elem = "";
51141
+ }
51142
+ if (isFirst) {
51143
+ isFirst = false;
51144
+ return `${elem}`;
51145
+ }
51146
+ return `${acc}${separator}${elem}`;
51147
+ }, "");
51148
+ }
51149
+
51150
+ // node_modules/@json2csv/plainjs/dist/mjs/BaseParser.js
51151
+ var FormatterTypes;
51152
+ (function(FormatterTypes2) {
51153
+ FormatterTypes2["header"] = "header";
51154
+ FormatterTypes2["undefined"] = "undefined";
51155
+ FormatterTypes2["boolean"] = "boolean";
51156
+ FormatterTypes2["number"] = "number";
51157
+ FormatterTypes2["bigint"] = "bigint";
51158
+ FormatterTypes2["string"] = "string";
51159
+ FormatterTypes2["symbol"] = "symbol";
51160
+ FormatterTypes2["function"] = "function";
51161
+ FormatterTypes2["object"] = "object";
51162
+ })(FormatterTypes || (FormatterTypes = {}));
51163
+
51164
+ class JSON2CSVBase {
51165
+ constructor(opts) {
51166
+ this.opts = this.preprocessOpts(opts);
51167
+ }
51168
+ preprocessOpts(opts) {
51169
+ const processedOpts = Object.assign({}, opts);
51170
+ if (processedOpts.fields) {
51171
+ processedOpts.fields = this.preprocessFieldsInfo(processedOpts.fields, processedOpts.defaultValue);
51172
+ }
51173
+ processedOpts.transforms = processedOpts.transforms || [];
51174
+ const stringFormatter2 = processedOpts.formatters && processedOpts.formatters["string"] || stringFormatter();
51175
+ const objectFormatter2 = objectFormatter({ stringFormatter: stringFormatter2 });
51176
+ const defaultFormatters = {
51177
+ header: stringFormatter2,
51178
+ undefined: defaultFormatter,
51179
+ boolean: defaultFormatter,
51180
+ number: numberFormatter(),
51181
+ bigint: defaultFormatter,
51182
+ string: stringFormatter2,
51183
+ symbol: symbolFormatter({ stringFormatter: stringFormatter2 }),
51184
+ function: objectFormatter2,
51185
+ object: objectFormatter2
51186
+ };
51187
+ processedOpts.formatters = Object.assign(Object.assign({}, defaultFormatters), processedOpts.formatters);
51188
+ processedOpts.delimiter = processedOpts.delimiter || ",";
51189
+ processedOpts.eol = processedOpts.eol || `
51190
+ `;
51191
+ processedOpts.header = processedOpts.header !== false;
51192
+ processedOpts.includeEmptyRows = processedOpts.includeEmptyRows || false;
51193
+ processedOpts.withBOM = processedOpts.withBOM || false;
51194
+ return processedOpts;
51195
+ }
51196
+ preprocessFieldsInfo(fields, globalDefaultValue) {
51197
+ return fields.map((fieldInfo) => {
51198
+ if (typeof fieldInfo === "string") {
51199
+ return {
51200
+ label: fieldInfo,
51201
+ value: (row) => getProp(row, fieldInfo, globalDefaultValue)
51202
+ };
51203
+ }
51204
+ if (typeof fieldInfo === "object") {
51205
+ const defaultValue = "default" in fieldInfo ? fieldInfo.default : globalDefaultValue;
51206
+ if (typeof fieldInfo.value === "string") {
51207
+ const fieldPath = fieldInfo.value;
51208
+ return {
51209
+ label: fieldInfo.label || fieldInfo.value,
51210
+ value: (row) => getProp(row, fieldPath, defaultValue)
51211
+ };
51212
+ }
51213
+ if (typeof fieldInfo.value === "function") {
51214
+ const label = fieldInfo.label || fieldInfo.value.name || "";
51215
+ const field = { label, default: defaultValue };
51216
+ const valueGetter = fieldInfo.value;
51217
+ return {
51218
+ label,
51219
+ value(row) {
51220
+ const value = valueGetter(row, field);
51221
+ return value === undefined ? defaultValue : value;
51222
+ }
51223
+ };
51224
+ }
51225
+ }
51226
+ throw new Error("Invalid field info option. " + JSON.stringify(fieldInfo));
51227
+ });
51228
+ }
51229
+ getHeader() {
51230
+ return fastJoin(this.opts.fields.map((fieldInfo) => this.opts.formatters.header(fieldInfo.label)), this.opts.delimiter);
51231
+ }
51232
+ preprocessRow(row) {
51233
+ return this.opts.transforms.reduce((rows, transform) => rows.map((row2) => transform(row2)).reduce(flattenReducer, []), [row]);
51234
+ }
51235
+ processRow(row) {
51236
+ if (!row) {
51237
+ return;
51238
+ }
51239
+ const processedRow = this.opts.fields.map((fieldInfo) => this.processCell(row, fieldInfo));
51240
+ if (!this.opts.includeEmptyRows && processedRow.every((field) => field === "")) {
51241
+ return;
51242
+ }
51243
+ return fastJoin(processedRow, this.opts.delimiter);
51244
+ }
51245
+ processCell(row, fieldInfo) {
51246
+ return this.processValue(fieldInfo.value(row));
51247
+ }
51248
+ processValue(value) {
51249
+ const formatter = this.opts.formatters[typeof value];
51250
+ return formatter(value);
51251
+ }
51252
+ }
51253
+ // node_modules/@json2csv/plainjs/dist/mjs/Parser.js
51254
+ class JSON2CSVParser extends JSON2CSVBase {
51255
+ constructor(opts) {
51256
+ super(opts);
51257
+ }
51258
+ parse(data) {
51259
+ const preprocessedData = this.preprocessData(data);
51260
+ this.opts.fields = this.opts.fields || this.preprocessFieldsInfo(preprocessedData.reduce((fields, item) => {
51261
+ Object.keys(item).forEach((field) => {
51262
+ if (!fields.includes(field)) {
51263
+ fields.push(field);
51264
+ }
51265
+ });
51266
+ return fields;
51267
+ }, []), this.opts.defaultValue);
51268
+ const header = this.opts.header ? this.getHeader() : "";
51269
+ const rows = this.processData(preprocessedData);
51270
+ const csv = (this.opts.withBOM ? "\uFEFF" : "") + header + (header && rows ? this.opts.eol : "") + rows;
51271
+ return csv;
51272
+ }
51273
+ preprocessData(data) {
51274
+ const processedData = Array.isArray(data) ? data : [data];
51275
+ if (!this.opts.fields) {
51276
+ if (data === undefined || data === null || processedData.length === 0) {
51277
+ throw new Error('Data should not be empty or the "fields" option should be included');
51278
+ }
51279
+ if (typeof processedData[0] !== "object") {
51280
+ throw new Error('Data items should be objects or the "fields" option should be included');
51281
+ }
51282
+ }
51283
+ if (this.opts.transforms.length === 0)
51284
+ return processedData;
51285
+ return processedData.map((row) => this.preprocessRow(row)).reduce(flattenReducer, []);
51286
+ }
51287
+ processData(data) {
51288
+ return fastJoin(data.map((row) => this.processRow(row)).filter((row) => row), this.opts.eol);
51289
+ }
51290
+ }
51291
+ // node_modules/@streamparser/json/dist/mjs/utils/utf-8.js
51292
+ var charset;
51293
+ (function(charset2) {
51294
+ charset2[charset2["BACKSPACE"] = 8] = "BACKSPACE";
51295
+ charset2[charset2["FORM_FEED"] = 12] = "FORM_FEED";
51296
+ charset2[charset2["NEWLINE"] = 10] = "NEWLINE";
51297
+ charset2[charset2["CARRIAGE_RETURN"] = 13] = "CARRIAGE_RETURN";
51298
+ charset2[charset2["TAB"] = 9] = "TAB";
51299
+ charset2[charset2["SPACE"] = 32] = "SPACE";
51300
+ charset2[charset2["EXCLAMATION_MARK"] = 33] = "EXCLAMATION_MARK";
51301
+ charset2[charset2["QUOTATION_MARK"] = 34] = "QUOTATION_MARK";
51302
+ charset2[charset2["NUMBER_SIGN"] = 35] = "NUMBER_SIGN";
51303
+ charset2[charset2["DOLLAR_SIGN"] = 36] = "DOLLAR_SIGN";
51304
+ charset2[charset2["PERCENT_SIGN"] = 37] = "PERCENT_SIGN";
51305
+ charset2[charset2["AMPERSAND"] = 38] = "AMPERSAND";
51306
+ charset2[charset2["APOSTROPHE"] = 39] = "APOSTROPHE";
51307
+ charset2[charset2["LEFT_PARENTHESIS"] = 40] = "LEFT_PARENTHESIS";
51308
+ charset2[charset2["RIGHT_PARENTHESIS"] = 41] = "RIGHT_PARENTHESIS";
51309
+ charset2[charset2["ASTERISK"] = 42] = "ASTERISK";
51310
+ charset2[charset2["PLUS_SIGN"] = 43] = "PLUS_SIGN";
51311
+ charset2[charset2["COMMA"] = 44] = "COMMA";
51312
+ charset2[charset2["HYPHEN_MINUS"] = 45] = "HYPHEN_MINUS";
51313
+ charset2[charset2["FULL_STOP"] = 46] = "FULL_STOP";
51314
+ charset2[charset2["SOLIDUS"] = 47] = "SOLIDUS";
51315
+ charset2[charset2["DIGIT_ZERO"] = 48] = "DIGIT_ZERO";
51316
+ charset2[charset2["DIGIT_ONE"] = 49] = "DIGIT_ONE";
51317
+ charset2[charset2["DIGIT_TWO"] = 50] = "DIGIT_TWO";
51318
+ charset2[charset2["DIGIT_THREE"] = 51] = "DIGIT_THREE";
51319
+ charset2[charset2["DIGIT_FOUR"] = 52] = "DIGIT_FOUR";
51320
+ charset2[charset2["DIGIT_FIVE"] = 53] = "DIGIT_FIVE";
51321
+ charset2[charset2["DIGIT_SIX"] = 54] = "DIGIT_SIX";
51322
+ charset2[charset2["DIGIT_SEVEN"] = 55] = "DIGIT_SEVEN";
51323
+ charset2[charset2["DIGIT_EIGHT"] = 56] = "DIGIT_EIGHT";
51324
+ charset2[charset2["DIGIT_NINE"] = 57] = "DIGIT_NINE";
51325
+ charset2[charset2["COLON"] = 58] = "COLON";
51326
+ charset2[charset2["SEMICOLON"] = 59] = "SEMICOLON";
51327
+ charset2[charset2["LESS_THAN_SIGN"] = 60] = "LESS_THAN_SIGN";
51328
+ charset2[charset2["EQUALS_SIGN"] = 61] = "EQUALS_SIGN";
51329
+ charset2[charset2["GREATER_THAN_SIGN"] = 62] = "GREATER_THAN_SIGN";
51330
+ charset2[charset2["QUESTION_MARK"] = 63] = "QUESTION_MARK";
51331
+ charset2[charset2["COMMERCIAL_AT"] = 64] = "COMMERCIAL_AT";
51332
+ charset2[charset2["LATIN_CAPITAL_LETTER_A"] = 65] = "LATIN_CAPITAL_LETTER_A";
51333
+ charset2[charset2["LATIN_CAPITAL_LETTER_B"] = 66] = "LATIN_CAPITAL_LETTER_B";
51334
+ charset2[charset2["LATIN_CAPITAL_LETTER_C"] = 67] = "LATIN_CAPITAL_LETTER_C";
51335
+ charset2[charset2["LATIN_CAPITAL_LETTER_D"] = 68] = "LATIN_CAPITAL_LETTER_D";
51336
+ charset2[charset2["LATIN_CAPITAL_LETTER_E"] = 69] = "LATIN_CAPITAL_LETTER_E";
51337
+ charset2[charset2["LATIN_CAPITAL_LETTER_F"] = 70] = "LATIN_CAPITAL_LETTER_F";
51338
+ charset2[charset2["LATIN_CAPITAL_LETTER_G"] = 71] = "LATIN_CAPITAL_LETTER_G";
51339
+ charset2[charset2["LATIN_CAPITAL_LETTER_H"] = 72] = "LATIN_CAPITAL_LETTER_H";
51340
+ charset2[charset2["LATIN_CAPITAL_LETTER_I"] = 73] = "LATIN_CAPITAL_LETTER_I";
51341
+ charset2[charset2["LATIN_CAPITAL_LETTER_J"] = 74] = "LATIN_CAPITAL_LETTER_J";
51342
+ charset2[charset2["LATIN_CAPITAL_LETTER_K"] = 75] = "LATIN_CAPITAL_LETTER_K";
51343
+ charset2[charset2["LATIN_CAPITAL_LETTER_L"] = 76] = "LATIN_CAPITAL_LETTER_L";
51344
+ charset2[charset2["LATIN_CAPITAL_LETTER_M"] = 77] = "LATIN_CAPITAL_LETTER_M";
51345
+ charset2[charset2["LATIN_CAPITAL_LETTER_N"] = 78] = "LATIN_CAPITAL_LETTER_N";
51346
+ charset2[charset2["LATIN_CAPITAL_LETTER_O"] = 79] = "LATIN_CAPITAL_LETTER_O";
51347
+ charset2[charset2["LATIN_CAPITAL_LETTER_P"] = 80] = "LATIN_CAPITAL_LETTER_P";
51348
+ charset2[charset2["LATIN_CAPITAL_LETTER_Q"] = 81] = "LATIN_CAPITAL_LETTER_Q";
51349
+ charset2[charset2["LATIN_CAPITAL_LETTER_R"] = 82] = "LATIN_CAPITAL_LETTER_R";
51350
+ charset2[charset2["LATIN_CAPITAL_LETTER_S"] = 83] = "LATIN_CAPITAL_LETTER_S";
51351
+ charset2[charset2["LATIN_CAPITAL_LETTER_T"] = 84] = "LATIN_CAPITAL_LETTER_T";
51352
+ charset2[charset2["LATIN_CAPITAL_LETTER_U"] = 85] = "LATIN_CAPITAL_LETTER_U";
51353
+ charset2[charset2["LATIN_CAPITAL_LETTER_V"] = 86] = "LATIN_CAPITAL_LETTER_V";
51354
+ charset2[charset2["LATIN_CAPITAL_LETTER_W"] = 87] = "LATIN_CAPITAL_LETTER_W";
51355
+ charset2[charset2["LATIN_CAPITAL_LETTER_X"] = 88] = "LATIN_CAPITAL_LETTER_X";
51356
+ charset2[charset2["LATIN_CAPITAL_LETTER_Y"] = 89] = "LATIN_CAPITAL_LETTER_Y";
51357
+ charset2[charset2["LATIN_CAPITAL_LETTER_Z"] = 90] = "LATIN_CAPITAL_LETTER_Z";
51358
+ charset2[charset2["LEFT_SQUARE_BRACKET"] = 91] = "LEFT_SQUARE_BRACKET";
51359
+ charset2[charset2["REVERSE_SOLIDUS"] = 92] = "REVERSE_SOLIDUS";
51360
+ charset2[charset2["RIGHT_SQUARE_BRACKET"] = 93] = "RIGHT_SQUARE_BRACKET";
51361
+ charset2[charset2["CIRCUMFLEX_ACCENT"] = 94] = "CIRCUMFLEX_ACCENT";
51362
+ charset2[charset2["LOW_LINE"] = 95] = "LOW_LINE";
51363
+ charset2[charset2["GRAVE_ACCENT"] = 96] = "GRAVE_ACCENT";
51364
+ charset2[charset2["LATIN_SMALL_LETTER_A"] = 97] = "LATIN_SMALL_LETTER_A";
51365
+ charset2[charset2["LATIN_SMALL_LETTER_B"] = 98] = "LATIN_SMALL_LETTER_B";
51366
+ charset2[charset2["LATIN_SMALL_LETTER_C"] = 99] = "LATIN_SMALL_LETTER_C";
51367
+ charset2[charset2["LATIN_SMALL_LETTER_D"] = 100] = "LATIN_SMALL_LETTER_D";
51368
+ charset2[charset2["LATIN_SMALL_LETTER_E"] = 101] = "LATIN_SMALL_LETTER_E";
51369
+ charset2[charset2["LATIN_SMALL_LETTER_F"] = 102] = "LATIN_SMALL_LETTER_F";
51370
+ charset2[charset2["LATIN_SMALL_LETTER_G"] = 103] = "LATIN_SMALL_LETTER_G";
51371
+ charset2[charset2["LATIN_SMALL_LETTER_H"] = 104] = "LATIN_SMALL_LETTER_H";
51372
+ charset2[charset2["LATIN_SMALL_LETTER_I"] = 105] = "LATIN_SMALL_LETTER_I";
51373
+ charset2[charset2["LATIN_SMALL_LETTER_J"] = 106] = "LATIN_SMALL_LETTER_J";
51374
+ charset2[charset2["LATIN_SMALL_LETTER_K"] = 107] = "LATIN_SMALL_LETTER_K";
51375
+ charset2[charset2["LATIN_SMALL_LETTER_L"] = 108] = "LATIN_SMALL_LETTER_L";
51376
+ charset2[charset2["LATIN_SMALL_LETTER_M"] = 109] = "LATIN_SMALL_LETTER_M";
51377
+ charset2[charset2["LATIN_SMALL_LETTER_N"] = 110] = "LATIN_SMALL_LETTER_N";
51378
+ charset2[charset2["LATIN_SMALL_LETTER_O"] = 111] = "LATIN_SMALL_LETTER_O";
51379
+ charset2[charset2["LATIN_SMALL_LETTER_P"] = 112] = "LATIN_SMALL_LETTER_P";
51380
+ charset2[charset2["LATIN_SMALL_LETTER_Q"] = 113] = "LATIN_SMALL_LETTER_Q";
51381
+ charset2[charset2["LATIN_SMALL_LETTER_R"] = 114] = "LATIN_SMALL_LETTER_R";
51382
+ charset2[charset2["LATIN_SMALL_LETTER_S"] = 115] = "LATIN_SMALL_LETTER_S";
51383
+ charset2[charset2["LATIN_SMALL_LETTER_T"] = 116] = "LATIN_SMALL_LETTER_T";
51384
+ charset2[charset2["LATIN_SMALL_LETTER_U"] = 117] = "LATIN_SMALL_LETTER_U";
51385
+ charset2[charset2["LATIN_SMALL_LETTER_V"] = 118] = "LATIN_SMALL_LETTER_V";
51386
+ charset2[charset2["LATIN_SMALL_LETTER_W"] = 119] = "LATIN_SMALL_LETTER_W";
51387
+ charset2[charset2["LATIN_SMALL_LETTER_X"] = 120] = "LATIN_SMALL_LETTER_X";
51388
+ charset2[charset2["LATIN_SMALL_LETTER_Y"] = 121] = "LATIN_SMALL_LETTER_Y";
51389
+ charset2[charset2["LATIN_SMALL_LETTER_Z"] = 122] = "LATIN_SMALL_LETTER_Z";
51390
+ charset2[charset2["LEFT_CURLY_BRACKET"] = 123] = "LEFT_CURLY_BRACKET";
51391
+ charset2[charset2["VERTICAL_LINE"] = 124] = "VERTICAL_LINE";
51392
+ charset2[charset2["RIGHT_CURLY_BRACKET"] = 125] = "RIGHT_CURLY_BRACKET";
51393
+ charset2[charset2["TILDE"] = 126] = "TILDE";
51394
+ })(charset || (charset = {}));
51395
+ var escapedSequences = {
51396
+ [charset.QUOTATION_MARK]: charset.QUOTATION_MARK,
51397
+ [charset.REVERSE_SOLIDUS]: charset.REVERSE_SOLIDUS,
51398
+ [charset.SOLIDUS]: charset.SOLIDUS,
51399
+ [charset.LATIN_SMALL_LETTER_B]: charset.BACKSPACE,
51400
+ [charset.LATIN_SMALL_LETTER_F]: charset.FORM_FEED,
51401
+ [charset.LATIN_SMALL_LETTER_N]: charset.NEWLINE,
51402
+ [charset.LATIN_SMALL_LETTER_R]: charset.CARRIAGE_RETURN,
51403
+ [charset.LATIN_SMALL_LETTER_T]: charset.TAB
51404
+ };
51405
+
51406
+ // node_modules/@streamparser/json/dist/mjs/utils/types/tokenType.js
51407
+ var TokenType;
51408
+ (function(TokenType2) {
51409
+ TokenType2[TokenType2["LEFT_BRACE"] = 0] = "LEFT_BRACE";
51410
+ TokenType2[TokenType2["RIGHT_BRACE"] = 1] = "RIGHT_BRACE";
51411
+ TokenType2[TokenType2["LEFT_BRACKET"] = 2] = "LEFT_BRACKET";
51412
+ TokenType2[TokenType2["RIGHT_BRACKET"] = 3] = "RIGHT_BRACKET";
51413
+ TokenType2[TokenType2["COLON"] = 4] = "COLON";
51414
+ TokenType2[TokenType2["COMMA"] = 5] = "COMMA";
51415
+ TokenType2[TokenType2["TRUE"] = 6] = "TRUE";
51416
+ TokenType2[TokenType2["FALSE"] = 7] = "FALSE";
51417
+ TokenType2[TokenType2["NULL"] = 8] = "NULL";
51418
+ TokenType2[TokenType2["STRING"] = 9] = "STRING";
51419
+ TokenType2[TokenType2["NUMBER"] = 10] = "NUMBER";
51420
+ TokenType2[TokenType2["SEPARATOR"] = 11] = "SEPARATOR";
51421
+ })(TokenType || (TokenType = {}));
51422
+
51423
+ // node_modules/@streamparser/json/dist/mjs/tokenizer.js
51424
+ var TokenizerStates;
51425
+ (function(TokenizerStates2) {
51426
+ TokenizerStates2[TokenizerStates2["START"] = 0] = "START";
51427
+ TokenizerStates2[TokenizerStates2["ENDED"] = 1] = "ENDED";
51428
+ TokenizerStates2[TokenizerStates2["ERROR"] = 2] = "ERROR";
51429
+ TokenizerStates2[TokenizerStates2["TRUE1"] = 3] = "TRUE1";
51430
+ TokenizerStates2[TokenizerStates2["TRUE2"] = 4] = "TRUE2";
51431
+ TokenizerStates2[TokenizerStates2["TRUE3"] = 5] = "TRUE3";
51432
+ TokenizerStates2[TokenizerStates2["FALSE1"] = 6] = "FALSE1";
51433
+ TokenizerStates2[TokenizerStates2["FALSE2"] = 7] = "FALSE2";
51434
+ TokenizerStates2[TokenizerStates2["FALSE3"] = 8] = "FALSE3";
51435
+ TokenizerStates2[TokenizerStates2["FALSE4"] = 9] = "FALSE4";
51436
+ TokenizerStates2[TokenizerStates2["NULL1"] = 10] = "NULL1";
51437
+ TokenizerStates2[TokenizerStates2["NULL2"] = 11] = "NULL2";
51438
+ TokenizerStates2[TokenizerStates2["NULL3"] = 12] = "NULL3";
51439
+ TokenizerStates2[TokenizerStates2["STRING_DEFAULT"] = 13] = "STRING_DEFAULT";
51440
+ TokenizerStates2[TokenizerStates2["STRING_AFTER_BACKSLASH"] = 14] = "STRING_AFTER_BACKSLASH";
51441
+ TokenizerStates2[TokenizerStates2["STRING_UNICODE_DIGIT_1"] = 15] = "STRING_UNICODE_DIGIT_1";
51442
+ TokenizerStates2[TokenizerStates2["STRING_UNICODE_DIGIT_2"] = 16] = "STRING_UNICODE_DIGIT_2";
51443
+ TokenizerStates2[TokenizerStates2["STRING_UNICODE_DIGIT_3"] = 17] = "STRING_UNICODE_DIGIT_3";
51444
+ TokenizerStates2[TokenizerStates2["STRING_UNICODE_DIGIT_4"] = 18] = "STRING_UNICODE_DIGIT_4";
51445
+ TokenizerStates2[TokenizerStates2["STRING_INCOMPLETE_CHAR"] = 19] = "STRING_INCOMPLETE_CHAR";
51446
+ TokenizerStates2[TokenizerStates2["NUMBER_AFTER_INITIAL_MINUS"] = 20] = "NUMBER_AFTER_INITIAL_MINUS";
51447
+ TokenizerStates2[TokenizerStates2["NUMBER_AFTER_INITIAL_ZERO"] = 21] = "NUMBER_AFTER_INITIAL_ZERO";
51448
+ TokenizerStates2[TokenizerStates2["NUMBER_AFTER_INITIAL_NON_ZERO"] = 22] = "NUMBER_AFTER_INITIAL_NON_ZERO";
51449
+ TokenizerStates2[TokenizerStates2["NUMBER_AFTER_FULL_STOP"] = 23] = "NUMBER_AFTER_FULL_STOP";
51450
+ TokenizerStates2[TokenizerStates2["NUMBER_AFTER_DECIMAL"] = 24] = "NUMBER_AFTER_DECIMAL";
51451
+ TokenizerStates2[TokenizerStates2["NUMBER_AFTER_E"] = 25] = "NUMBER_AFTER_E";
51452
+ TokenizerStates2[TokenizerStates2["NUMBER_AFTER_E_AND_SIGN"] = 26] = "NUMBER_AFTER_E_AND_SIGN";
51453
+ TokenizerStates2[TokenizerStates2["NUMBER_AFTER_E_AND_DIGIT"] = 27] = "NUMBER_AFTER_E_AND_DIGIT";
51454
+ TokenizerStates2[TokenizerStates2["SEPARATOR"] = 28] = "SEPARATOR";
51455
+ TokenizerStates2[TokenizerStates2["BOM_OR_START"] = 29] = "BOM_OR_START";
51456
+ TokenizerStates2[TokenizerStates2["BOM"] = 30] = "BOM";
51457
+ })(TokenizerStates || (TokenizerStates = {}));
51458
+
51459
+ // node_modules/@streamparser/json/dist/mjs/utils/types/stackElement.js
51460
+ var TokenParserMode;
51461
+ (function(TokenParserMode2) {
51462
+ TokenParserMode2[TokenParserMode2["OBJECT"] = 0] = "OBJECT";
51463
+ TokenParserMode2[TokenParserMode2["ARRAY"] = 1] = "ARRAY";
51464
+ })(TokenParserMode || (TokenParserMode = {}));
51465
+
51466
+ // node_modules/@streamparser/json/dist/mjs/tokenparser.js
51467
+ var TokenParserState;
51468
+ (function(TokenParserState2) {
51469
+ TokenParserState2[TokenParserState2["VALUE"] = 0] = "VALUE";
51470
+ TokenParserState2[TokenParserState2["KEY"] = 1] = "KEY";
51471
+ TokenParserState2[TokenParserState2["COLON"] = 2] = "COLON";
51472
+ TokenParserState2[TokenParserState2["COMMA"] = 3] = "COMMA";
51473
+ TokenParserState2[TokenParserState2["ENDED"] = 4] = "ENDED";
51474
+ TokenParserState2[TokenParserState2["ERROR"] = 5] = "ERROR";
51475
+ TokenParserState2[TokenParserState2["SEPARATOR"] = 6] = "SEPARATOR";
51476
+ })(TokenParserState || (TokenParserState = {}));
51477
+ // src/functions/jsonToCsv.ts
51478
+ function jsonToCsv(json, options3) {
51479
+ const jsonArray = compact_default(castArray_default(json));
51480
+ if (isEmpty_default(jsonArray)) {
51481
+ return "";
51482
+ }
51483
+ const parser3 = new JSON2CSVParser(options3);
51484
+ return parser3.parse(jsonArray);
51485
+ }
51486
+
50960
51487
  // src/functions/jsToXml.ts
50961
- var import_xml_js = __toESM(require_lib4());
51488
+ var import_xml_js = __toESM(require_lib4(), 1);
50962
51489
  function jsToXml_default(json, options3 = { compact: true, spaces: 4 }) {
50963
51490
  return import_xml_js.js2xml(json, options3);
50964
51491
  }
@@ -51071,7 +51598,7 @@ async function parseDocument(file, fileType) {
51071
51598
  var parseDocument_default = parseDocument;
51072
51599
 
51073
51600
  // src/functions/parseQuery.ts
51074
- var import_qs = __toESM(require_lib5());
51601
+ var import_qs = __toESM(require_lib5(), 1);
51075
51602
  function parseQuery(query, options3) {
51076
51603
  return import_qs.default.parse(query, options3);
51077
51604
  }
@@ -55098,7 +55625,7 @@ var z = /* @__PURE__ */ Object.freeze({
55098
55625
  });
55099
55626
 
55100
55627
  // node_modules/@langchain/core/dist/runnables/base.js
55101
- var import_p_retry5 = __toESM(require_p_retry());
55628
+ var import_p_retry6 = __toESM(require_p_retry(), 1);
55102
55629
 
55103
55630
  // node_modules/uuid/dist/esm-browser/regex.js
55104
55631
  var regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
@@ -55158,8 +55685,8 @@ function v4(options3, buf, offset2) {
55158
55685
  }
55159
55686
  var v4_default = v4;
55160
55687
  // node_modules/langsmith/dist/utils/async_caller.js
55161
- var import_p_retry3 = __toESM(require_p_retry2());
55162
- var import_p_queue = __toESM(require_dist());
55688
+ var import_p_retry4 = __toESM(require_p_retry2(), 1);
55689
+ var import_p_queue = __toESM(require_dist(), 1);
55163
55690
 
55164
55691
  // node_modules/langsmith/dist/singletons/fetch.js
55165
55692
  var DEFAULT_FETCH_IMPLEMENTATION = (...args) => fetch(...args);
@@ -55222,7 +55749,7 @@ class AsyncCaller {
55222
55749
  }
55223
55750
  call(callable, ...args) {
55224
55751
  const onFailedResponseHook = this.onFailedResponseHook;
55225
- return this.queue.add(() => import_p_retry3.default(() => callable(...args).catch((error) => {
55752
+ return this.queue.add(() => import_p_retry4.default(() => callable(...args).catch((error) => {
55226
55753
  if (error instanceof Error) {
55227
55754
  throw error;
55228
55755
  } else {
@@ -55305,7 +55832,7 @@ function warnOnce(message) {
55305
55832
  }
55306
55833
 
55307
55834
  // node_modules/langsmith/dist/utils/prompts.js
55308
- var import_semver = __toESM(require_semver2());
55835
+ var import_semver = __toESM(require_semver2(), 1);
55309
55836
  function parsePromptIdentifier(identifier) {
55310
55837
  if (!identifier || identifier.split("/").length > 2 || identifier.startsWith("/") || identifier.endsWith("/") || identifier.split(":").length > 2) {
55311
55838
  throw new Error(`Invalid identifier format: ${identifier}`);
@@ -59275,8 +59802,8 @@ var fast_json_patch_default = {
59275
59802
  };
59276
59803
 
59277
59804
  // node_modules/@langchain/core/dist/load/map_keys.js
59278
- var import_decamelize = __toESM(require_decamelize());
59279
- var import_camelcase = __toESM(require_camelcase());
59805
+ var import_decamelize = __toESM(require_decamelize(), 1);
59806
+ var import_camelcase = __toESM(require_camelcase(), 1);
59280
59807
  function keyToJson(key, map2) {
59281
59808
  return map2?.[key] || import_decamelize.default(key);
59282
59809
  }
@@ -60008,7 +60535,7 @@ ${error.stack}` : "");
60008
60535
  }
60009
60536
 
60010
60537
  // node_modules/@langchain/core/dist/tracers/console.js
60011
- var import_ansi_styles = __toESM(require_ansi_styles());
60538
+ var import_ansi_styles = __toESM(require_ansi_styles(), 1);
60012
60539
  function wrap(style, text) {
60013
60540
  return `${style.open}${text}${style.close}`;
60014
60541
  }
@@ -60754,7 +61281,7 @@ class LangChainTracer extends BaseTracer {
60754
61281
  }
60755
61282
 
60756
61283
  // node_modules/@langchain/core/dist/singletons/callbacks.js
60757
- var import_p_queue2 = __toESM(require_dist());
61284
+ var import_p_queue2 = __toESM(require_dist(), 1);
60758
61285
 
60759
61286
  // node_modules/@langchain/core/dist/singletons/async_local_storage/globals.js
60760
61287
  var TRACING_ALS_KEY2 = Symbol.for("ls:tracing_async_local_storage");
@@ -62836,8 +63363,8 @@ class EventStreamCallbackHandler extends BaseTracer {
62836
63363
  }
62837
63364
 
62838
63365
  // node_modules/@langchain/core/dist/utils/async_caller.js
62839
- var import_p_retry4 = __toESM(require_p_retry());
62840
- var import_p_queue3 = __toESM(require_dist());
63366
+ var import_p_retry5 = __toESM(require_p_retry(), 1);
63367
+ var import_p_queue3 = __toESM(require_dist(), 1);
62841
63368
  var STATUS_NO_RETRY2 = [
62842
63369
  400,
62843
63370
  401,
@@ -62900,7 +63427,7 @@ class AsyncCaller2 {
62900
63427
  this.queue = new PQueue({ concurrency: this.maxConcurrency });
62901
63428
  }
62902
63429
  call(callable, ...args) {
62903
- return this.queue.add(() => import_p_retry4.default(() => callable(...args).catch((error) => {
63430
+ return this.queue.add(() => import_p_retry5.default(() => callable(...args).catch((error) => {
62904
63431
  if (error instanceof Error) {
62905
63432
  throw error;
62906
63433
  } else {
@@ -65402,7 +65929,7 @@ class RunnableRetry extends RunnableBinding {
65402
65929
  return patchConfig(config, { callbacks: runManager?.getChild(tag3) });
65403
65930
  }
65404
65931
  async _invoke(input, config, runManager) {
65405
- return import_p_retry5.default((attemptNumber) => super.invoke(input, this._patchConfigForRetry(attemptNumber, config, runManager)), {
65932
+ return import_p_retry6.default((attemptNumber) => super.invoke(input, this._patchConfigForRetry(attemptNumber, config, runManager)), {
65406
65933
  onFailedAttempt: (error) => this.onFailedAttempt(error, input),
65407
65934
  retries: Math.max(this.maxAttemptNumber - 1, 0),
65408
65935
  randomize: true
@@ -65414,7 +65941,7 @@ class RunnableRetry extends RunnableBinding {
65414
65941
  async _batch(inputs, configs, runManagers, batchOptions) {
65415
65942
  const resultsMap = {};
65416
65943
  try {
65417
- await import_p_retry5.default(async (attemptNumber) => {
65944
+ await import_p_retry6.default(async (attemptNumber) => {
65418
65945
  const remainingIndexes = inputs.map((_, i3) => i3).filter((i3) => resultsMap[i3.toString()] === undefined || resultsMap[i3.toString()] instanceof Error);
65419
65946
  const remainingInputs = remainingIndexes.map((i3) => inputs[i3]);
65420
65947
  const patchedConfigs = remainingIndexes.map((i3) => this._patchConfigForRetry(attemptNumber, configs?.[i3], runManagers?.[i3]));
@@ -66365,7 +66892,7 @@ class BaseDocumentTransformer extends Runnable {
66365
66892
  }
66366
66893
  }
66367
66894
  // node_modules/js-tiktoken/dist/chunk-3652LHBA.js
66368
- var import_base64_js = __toESM(require_base64_js());
66895
+ var import_base64_js = __toESM(require_base64_js(), 1);
66369
66896
  var __defProp2 = Object.defineProperty;
66370
66897
  var __defNormalProp = (obj, key, value) => (key in obj) ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
66371
66898
  var __publicField = (obj, key, value) => {
@@ -67318,7 +67845,7 @@ function sortNodes(array2, idKey = "id", parentIdKey = "parent_id", sequenceKey
67318
67845
  var sortNodes_default = sortNodes;
67319
67846
 
67320
67847
  // src/functions/stringifyQuery.ts
67321
- var import_qs2 = __toESM(require_lib5());
67848
+ var import_qs2 = __toESM(require_lib5(), 1);
67322
67849
  function stringifyQuery(query, options3) {
67323
67850
  return import_qs2.default.stringify(query, options3);
67324
67851
  }
@@ -67342,7 +67869,7 @@ function uuid() {
67342
67869
  var uuid_default = uuid;
67343
67870
 
67344
67871
  // src/functions/xmlToJs.ts
67345
- var import_xml_js2 = __toESM(require_lib4());
67872
+ var import_xml_js2 = __toESM(require_lib4(), 1);
67346
67873
  function xmlToJs(xml, options3 = { compact: true, spaces: 4 }) {
67347
67874
  return import_xml_js2.xml2js(xml, options3);
67348
67875
  }
@@ -67360,94 +67887,6 @@ function zipSqlResponse(columns, data, key) {
67360
67887
  }
67361
67888
  var zipSqlResponse_default = zipSqlResponse;
67362
67889
 
67363
- // src/functions/convertMdToPdf.ts
67364
- function getFilenameFromHeaders(resp, fallback) {
67365
- const cd = resp.headers.get("content-disposition") || "";
67366
- const matchStar = cd.match(/filename\*=([^;]+)/i);
67367
- if (matchStar) {
67368
- const value = trim_default(matchStar[1]);
67369
- const parts = split_default(value, "''");
67370
- if (parts.length === 2) {
67371
- try {
67372
- return decodeURIComponent(parts[1]);
67373
- } catch {
67374
- return parts[1];
67375
- }
67376
- }
67377
- return trim_default(value, `'"`);
67378
- }
67379
- const match2 = cd.match(/filename="?([^";]+)"?/i);
67380
- if (match2)
67381
- return match2[1];
67382
- return fallback || "document.pdf";
67383
- }
67384
- async function convertMdToPdf(markdown, options3 = {}, assetHeaders = {}) {
67385
- const documentParserApiUrl = this.environment.lookup("documentParserApiUrl");
67386
- const documentParserApiKey = this.environment.lookup("documentParserApiKey");
67387
- if (!documentParserApiKey) {
67388
- throw new Error("Document parser API key not found in environment");
67389
- }
67390
- if (!documentParserApiUrl) {
67391
- throw new Error("Document parser API URL not found in environment");
67392
- }
67393
- if (!markdown || typeof markdown !== "string") {
67394
- throw new AbortError("Markdown content is required and must be a string");
67395
- }
67396
- const requestBody = {
67397
- markdown,
67398
- options: options3,
67399
- assetHeaders
67400
- };
67401
- return await pRetry(async () => {
67402
- const response = await fetch(`${documentParserApiUrl}/md-to-pdf`, {
67403
- method: "POST",
67404
- headers: {
67405
- Authorization: `Bearer ${documentParserApiKey}`,
67406
- "Content-Type": "application/json",
67407
- Accept: "application/pdf",
67408
- "User-Agent": "truto"
67409
- },
67410
- body: JSON.stringify(requestBody)
67411
- });
67412
- if (!response.ok) {
67413
- if (response.status === 429) {
67414
- throw new Error("Rate limit exceeded");
67415
- }
67416
- if (response.status >= 500) {
67417
- throw new Error(`Server error: ${response.status}`);
67418
- }
67419
- const errorText = await response.text();
67420
- let errorMessage = `PDF conversion failed (${response.status})`;
67421
- try {
67422
- const errorData = JSON.parse(errorText);
67423
- errorMessage = errorData.error || errorMessage;
67424
- if (errorData.details) {
67425
- errorMessage += `: ${errorData.details}`;
67426
- }
67427
- } catch {
67428
- errorMessage += `: ${errorText}`;
67429
- }
67430
- throw new AbortError(errorMessage);
67431
- }
67432
- const contentType = response.headers.get("content-type");
67433
- if (!contentType || !includes_default(contentType, "application/pdf")) {
67434
- throw new AbortError(`Expected PDF but received: ${contentType}`);
67435
- }
67436
- const arrayBuffer = await response.arrayBuffer();
67437
- const filename = getFilenameFromHeaders(response, options3.filename);
67438
- const blob2 = new Blob([arrayBuffer], { type: "application/pdf" });
67439
- blob2.name = filename;
67440
- return blob2;
67441
- }, {
67442
- retries: 5,
67443
- maxTimeout: 30000,
67444
- minTimeout: 2500,
67445
- onFailedAttempt: (error) => {
67446
- console.warn(`PDF conversion attempt ${error.attemptNumber} failed:`, error.message);
67447
- }
67448
- });
67449
- }
67450
-
67451
67890
  // src/registerJsonataExtensions.ts
67452
67891
  function registerJsonataExtensions(expression) {
67453
67892
  expression.registerFunction("dtFromIso", dtFromIso_default);
@@ -67541,6 +67980,7 @@ function registerJsonataExtensions(expression) {
67541
67980
  expression.registerFunction("flattenDepth", function(arr2, depth) {
67542
67981
  return flattenDepth_default(castArray_default(arr2), depth);
67543
67982
  });
67983
+ expression.registerFunction("jsonToCsv", jsonToCsv);
67544
67984
  return expression;
67545
67985
  }
67546
67986
 
@@ -67549,4 +67989,4 @@ function trutoJsonata(expression) {
67549
67989
  return registerJsonataExtensions(import_jsonata.default(expression));
67550
67990
  }
67551
67991
 
67552
- //# debugId=CAD6369D5675943D64756E2164756E21
67992
+ //# debugId=2C72E83EE5900DAB64756E2164756E21