@assinafy/twenty-app 1.0.0 → 1.0.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.
@@ -28967,9 +28967,9 @@ var billable = async (call) => {
28967
28967
  var BLOCKING_REASONS = ["PendingPayment", "InsufficientDocuments", "InsufficientCredits"];
28968
28968
  var toNumber = (value) => typeof value === "number" && Number.isFinite(value) ? value : null;
28969
28969
  var unexpectedEstimate = () => new AppFailure("INTERNAL", "A Assinafy retornou uma estimativa de custo inesperada.");
28970
- var requireNumber = (value) => {
28970
+ var requireNumber = (value, integer = false) => {
28971
28971
  const number = toNumber(value);
28972
- if (number === null) {
28972
+ if (number === null || number < 0 || integer && !Number.isSafeInteger(number)) {
28973
28973
  throw unexpectedEstimate();
28974
28974
  }
28975
28975
  return number;
@@ -28978,7 +28978,7 @@ var normalizeCostEstimate = (raw) => {
28978
28978
  const estimate = typeof raw === "object" && raw !== null ? { ...raw } : {};
28979
28979
  if (typeof estimate.has_sufficient_resources === "boolean") {
28980
28980
  return {
28981
- documents: requireNumber(estimate.documents),
28981
+ documents: requireNumber(estimate.documents, true),
28982
28982
  totalCredits: requireNumber(estimate.total_credits),
28983
28983
  creditBalance: toNumber(estimate.credit_balance),
28984
28984
  documentBalance: toNumber(estimate.document_balance),