@go-labs-sg/bb 2.13.0 → 2.15.0

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/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import { BUDGET_BUILDER_API_BASE_URL, configureBudgetBuilderApiBaseUrl, DEFAULT_
7
7
  import { consumeCliQuietFlags, logCliAction, sanitizeFlagsForTrace, setCliQuiet, shouldLogCliActions, } from "./cli-trace.js";
8
8
  import { addBudgetItems, approveBill, approveBudget, approveCustomerInvoice, approveQuotation, approveSupplier, archiveItemsByIds, checkCustomerInvoiceReadiness, checkProjectReconciliation, cleanupStagedBillAttachments, cleanupStagedQuotationAttachments, completeProject, createApiKeyForUser, createBillApproval, createBillFromPayload, createBudgetApproval, createBudgetCategory, createBudgetFromPayload, createCompany, createContactPersonFromPayload, createCustomerInvoice, createEstimate, createInboundSource, createItemCategory, createItemFromPayload, createPlaceholderBillForBudgetItem, createProject, createQuotationFromPayload, createSupplierCertification, createSupplierFromPayload, createSupplierPaymentMethod, createSupplierRoleOption, createSupplierTagOption, createUser, deleteBillById, deleteBudgetById, deleteBudgetCategory, deleteBudgetCommission, deleteBudgetDiscount, deleteCompanyById, deleteCustomerInvoice, deleteItemById, deleteItemCategoriesByIds, deleteProjectById, deleteQuotationById, deleteSuppliersByIds, discardCreatingCustomerInvoice, downloadCustomerInvoicePdf, downloadQuotationPdf, getApprovedBudgets, getBillAttachments, getBillDetails, getBudget, getBudgetCategories, getBudgetCategoryBenchmarks, getBudgetDetails, getBudgetItemsOnly, getBudgetVersions, getCompany, getCustomerInvoice, getCustomerInvoiceEmailContext, getDashboard, getErrorMetrics, getEstimatePerformance, getFinancialOverview, getInboundSource, getInboundSubmission, getItem, getItemPricingHistory, getMonthlyMetrics, getProject, getProjectHubStatus, getQuotationDetails, getRecentErrors, getSupplierAnalytics, getSupplierDetails, getSupplierPricingHistory, getSystemOverview, getUserPerformance, importQuickBooksProjectId, listApiKeysForUser, listApprovals, listBills, listBudgets, listCompanies, listContacts, listCustomerInvoices, listEligibleCustomerInvoiceBudgets, listInboundSources, listInboundSubmissions, listIntegrationOperations, listItemCategories, listItems, listProjects, listQuotations, listSuppliers, listUsers, markBudgetWonWithProof, patchBillInvoiceNumber, patchBillPayment, reactivateSuppliersByIds, reconcileProject, rejectBill, rejectBudget, rejectCustomerInvoice, rejectQuotation, rejectSupplier, removeBudgetItem, renameBudgetVersion, reorderBudgetItemsCli, restoreBudgetVersion, retryIntegrationOperation, revokeApiKeyForUser, saveInboundAutomationConfig, saveInboundMappingVersion, sendCustomerInvoiceToContactPersonFromPayload, sendEstimateToContactPersonFromPayload, setBudgetItemsNotUtilized, setupProjectHub, stageBillAttachmentsFromPaths, submitQuotation, syncCustomerInvoice, syncProjectHubCommercialDocuments, updateBillFromPayload, updateBillPaymentEvidenceFromPayload, updateBillStatus, updateBudgetCategory, updateBudgetCommissionFromPayload, updateBudgetDiscountFromPayload, updateBudgetFromPayload, updateBudgetItem, updateBudgetItemSupplierCli, updateBudgetStatus, updateCompanyFromPayload, updateContactPersonFromPayload, updateInboundProcessing, updateInboundSource, updateItemCategory, updateItemFromPayload, updateProjectFromPayload, updateProjectStatus, updateQuotationFromPayload, updateSupplierFromPayload, uploadBillAttachmentFromPath, uploadBillAttachmentsFromPaths, uploadBillDocumentsFromPaths, uploadBudgetAttachmentFromPath, uploadQuotationAttachmentFromPath, validateBillSelectionFromPayload, voidCustomerInvoice, whoAmI, } from "./commands.js";
9
9
  import { getFlag, parseArgs } from "./parse-args.js";
10
- import { billStatusesForUpdateHelp, budgetStatusesForHelp, isBudgetStatusUpdate, parseApprovalTypeFlag, parseBillStatusForUpdate, parseCommaSeparatedBillStatuses, parseCommaSeparatedBudgetStatuses, parseCommaSeparatedCustomerInvoiceStatuses, parseCommaSeparatedIds, parseCommaSeparatedQuotationStatuses, parseCommaSeparatedSupplierStatuses, parseOptionalBillListSortBy, parseOptionalBillListSortDir, parseOptionalDashboardRole, parseOptionalDeals, parseOptionalErrorSeverity, parseOptionalErrorStatus, parseOptionalExtendedProjectStatus, parseOptionalFinancialRole, parseOptionalSupplierAnalyticsTimeFrame, parseOptionalTimeFrame, parseProjectStatusForUpdate, parseUserRole, projectStatusesForHelp, userRolesForHelp, } from "./parse-cli-enums.js";
10
+ import { billStatusesForUpdateHelp, budgetStatusesForHelp, isBudgetStatusUpdate, parseApprovalTypeFlag, parseBillStatusForUpdate, parseCommaSeparatedBillStatuses, parseCommaSeparatedBudgetStatuses, parseCommaSeparatedCustomerInvoiceStatuses, parseCommaSeparatedIds, parseCommaSeparatedIntegrationOperationStatuses, parseCommaSeparatedQuotationStatuses, parseCommaSeparatedSupplierStatuses, parseOptionalBillListSortBy, parseOptionalBillListSortDir, parseOptionalDashboardRole, parseOptionalDeals, parseOptionalErrorSeverity, parseOptionalErrorStatus, parseOptionalExtendedProjectStatus, parseOptionalFinancialRole, parseOptionalSupplierAnalyticsTimeFrame, parseOptionalTimeFrame, parseProjectStatusForUpdate, parseUserRole, projectStatusesForHelp, userRolesForHelp, } from "./parse-cli-enums.js";
11
11
  import { parseJsonFlag, parseOptionalNumber as parseOptNum, } from "./parse-json-flag.js";
12
12
  import { createCompletionScript, createHumanHelp, resolveCommand, } from "./registry/index.js";
13
13
  import { CliRuntimeError, clearActiveCliSession, confirmCurrentCommand, createProcessRuntime, emitCommandError, emitCommandResult, setActiveCliSession, } from "./runtime/index.js";
@@ -45,21 +45,6 @@ function parseCustomerInvoiceSortBy(value) {
45
45
  }
46
46
  return value;
47
47
  }
48
- const INTEGRATION_OPERATION_STATUSES = [
49
- "PENDING",
50
- "PROCESSING",
51
- "FAILED",
52
- "COMPLETED",
53
- ];
54
- function parseIntegrationOperationStatus(value) {
55
- if (value === undefined)
56
- return undefined;
57
- const normalized = value.toUpperCase();
58
- if (!INTEGRATION_OPERATION_STATUSES.includes(normalized)) {
59
- throw new Error(`Invalid --status "${value}". Use one of: ${INTEGRATION_OPERATION_STATUSES.join(", ")}.`);
60
- }
61
- return normalized;
62
- }
63
48
  function parseCommercialRejectionProjectStatus(flags) {
64
49
  const raw = flags.projectStatusOnCommercialRejection;
65
50
  if (raw === undefined)
@@ -344,7 +329,7 @@ Errors
344
329
  get-error-metrics (admin)
345
330
 
346
331
  Automation (admin)
347
- list-integration-operations [--destination] [--status PENDING|PROCESSING|FAILED|COMPLETED] [--page] [--perPage]
332
+ list-integration-operations [--search] [--destination <provider,...>] [--status <PENDING|PROCESSING|FAILED|COMPLETED,...>] [--page] [--perPage]
348
333
  retry-integration-operation <operationId> [--confirmExternalStateReconciled true|false]
349
334
 
350
335
  Historical / benchmarks
@@ -2009,10 +1994,11 @@ export async function runCli(argv = process.argv, runtime = createProcessRuntime
2009
1994
  }
2010
1995
  case "list-integration-operations": {
2011
1996
  await listIntegrationOperations({
2012
- destination: getFlag(flags, "destination"),
1997
+ destination: parseCommaSeparatedIds(getFlag(flags, "destination")),
2013
1998
  page: parsePositiveIntFlag(getFlag(flags, "page"), "--page") ?? 1,
2014
1999
  perPage: parsePositiveIntFlag(getFlag(flags, "perPage"), "--perPage") ?? 25,
2015
- status: parseIntegrationOperationStatus(getFlag(flags, "status")),
2000
+ search: getFlag(flags, "search"),
2001
+ status: parseCommaSeparatedIntegrationOperationStatuses(getFlag(flags, "status")),
2016
2002
  });
2017
2003
  break;
2018
2004
  }
@@ -26,6 +26,12 @@ const SUPPLIER_ANALYTICS_TF = new Set([
26
26
  const SUPPLIER_APPROVAL_STATUS_VALUES = new Set(Object.values(ExtendedApprovalStatus));
27
27
  const EXT_ERROR_SEVERITY_VALUES = new Set(Object.values(ExtendedErrorSeverity));
28
28
  const EXT_ERROR_STATUS_VALUES = new Set(Object.values(ExtendedErrorStatus));
29
+ const INTEGRATION_OPERATION_STATUS_VALUES = new Set([
30
+ "PENDING",
31
+ "PROCESSING",
32
+ "FAILED",
33
+ "COMPLETED",
34
+ ]);
29
35
  export function isBudgetStatusListToken(s) {
30
36
  if (s === "ALL")
31
37
  return true;
@@ -139,6 +145,22 @@ export function parseCommaSeparatedIds(raw) {
139
145
  .filter(Boolean);
140
146
  return ids.length > 0 ? ids : undefined;
141
147
  }
148
+ export function parseCommaSeparatedIntegrationOperationStatuses(raw) {
149
+ if (raw === undefined)
150
+ return undefined;
151
+ const statuses = raw
152
+ .split(",")
153
+ .map((value) => value.trim().toUpperCase())
154
+ .filter(Boolean);
155
+ if (statuses.length === 0)
156
+ return undefined;
157
+ for (const status of statuses) {
158
+ if (!INTEGRATION_OPERATION_STATUS_VALUES.has(status)) {
159
+ throw new Error(`Invalid integration operation status "${status}". Use one or more of: ${[...INTEGRATION_OPERATION_STATUS_VALUES].join(", ")}.`);
160
+ }
161
+ }
162
+ return statuses;
163
+ }
142
164
  export function parseCommaSeparatedBudgetStatuses(raw) {
143
165
  if (raw === undefined)
144
166
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-labs-sg/bb",
3
- "version": "2.13.0",
3
+ "version": "2.15.0",
4
4
  "description": "Budget Builder CLI for AI agents — manage budgets, bills, claims, quotations, and customer invoices with explicit workflow previews for sensitive changes.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -163,7 +163,7 @@ Admin inspecting a failed integration before a confirmed retry:
163
163
 
164
164
  ```bash
165
165
  bb auth whoami
166
- bb integration operation list --status FAILED
166
+ bb integration operation list --status FAILED,PENDING --search "QuickBooks"
167
167
  bb integration operation retry <operation-id>
168
168
  ```
169
169