@go-labs-sg/bb 3.8.0 → 3.10.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/README.md +15 -4
- package/command-manifest.json +208 -1
- package/command-reference.md +33 -1
- package/dist/index.js +122 -32
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -24,6 +24,17 @@ For AI agents using this CLI: do not execute mutations until the user explicitly
|
|
|
24
24
|
|
|
25
25
|
**Registry:** [`@go-labs-sg/bb`](https://www.npmjs.com/package/@go-labs-sg/bb)
|
|
26
26
|
|
|
27
|
+
## QuickBooks names
|
|
28
|
+
|
|
29
|
+
Company, supplier, project, item and item-category mutation names use the same
|
|
30
|
+
`quickBooksNameSchema` as the web forms and API. The CLI bundles that schema from
|
|
31
|
+
`@go-labs/budget-builder-validators/quickbooks/qbo-name`; do not add a CLI-only
|
|
32
|
+
regex, character list or name-length limit. Read-only search filters are not
|
|
33
|
+
mutation names and remain unrestricted by this rule.
|
|
34
|
+
|
|
35
|
+
Item synchronization also validates the complete QuickBooks name, including
|
|
36
|
+
Budget Builder's ` (catalogueCode)` suffix, before queuing a new provider write.
|
|
37
|
+
|
|
27
38
|
## Supplier cursor pages and independent totals
|
|
28
39
|
|
|
29
40
|
`bb supplier list` (alias `list-suppliers`) returns rich `items` and `pageInfo` with opaque `nextCursor`, `previousCursor`, and directional availability. Use `--limit 1-100` (default 10), then pass a returned token unchanged with the same filters and sort. Previous navigation uses `--direction backward --cursor <previousCursor>`. Retired `--page`/`--perPage` flags are rejected; numbered/random-access pages are no longer supported.
|
|
@@ -51,7 +62,7 @@ Roll out the API and maintained CLI together: `suppliers`/`pageCount` and offset
|
|
|
51
62
|
|
|
52
63
|
**Item detail shape:** `item.getItem` / `bb get-item` return the catalogue item's own fields (name, code, cost, rich-text description, GST flags, active/QuickBooks/availability state) with `supplier` narrowed to `{ id, name, gstRegistered, active, status }`, `itemCategory` to `{ id, name }` and attachments to `{ id, name, key, size }`. Full supplier and category records, plain-text `description`, `lowerCaseName` and the QuickBooks sync token are no longer included. `list-items` rows carry the list columns plus the same edit fields.
|
|
53
64
|
|
|
54
|
-
**Supplier detail shape:** `supplier.getSupplierById` / `bb get-supplier-details` keep every supplier field the detail page and pending-update diff compare (contact, banking, PayNow, payment/role/certification ids, address, pending update), with `createdBy` narrowed to `{ id, name, email, image, role }`, attachments to `{ id, name, key, size }`, payment method/role/certification/tags to `{ id, name }` and each catalogue item to `{ id, catalogueCode, name, cost, descriptionRichText, itemCategory { id, name }, _count }`. Approvals carry their ids, status, timestamps and approver/responder users, not budget/bill/quotation links. `lowerCaseName`, the QuickBooks id and sync token, and `createdById` are no longer included.
|
|
65
|
+
**Supplier detail shape:** `supplier.getSupplierById` / `bb get-supplier-details` return the full supplier in one read and keep every supplier field the detail page and pending-update diff compare (contact, banking, PayNow, payment/role/certification ids, address, pending update), with `createdBy` narrowed to `{ id, name, email, image, role }`, attachments to `{ id, name, key, size }`, payment method/role/certification/tags to `{ id, name }` and each catalogue item to `{ id, catalogueCode, name, cost, descriptionRichText, itemCategory { id, name }, _count }`. Approvals carry their ids, status, timestamps and approver/responder users, not budget/bill/quotation links. `lowerCaseName`, the QuickBooks id and sync token, and `createdById` are no longer included.
|
|
55
66
|
|
|
56
67
|
**Project detail shape:** `project.getProjectById` returns the project's own scheduling, ownership, Slack, Asana-task, QuickBooks and win fields plus the derived calendar, Asana and PM-membership fields, with `company { id, name }`, `asanaProject { gid, url }`, `insideSales`/`businessDevelopment`/`wonBy { id, name }`, `projectManager { id, name, email, bannedAt }` and `contactPerson { id, displayName, firstName, lastName }`. `project.getProjectDetailsById` / `bb get-project` returns the same project fields with only the derived Asana fields, `company { id, name }`, `asanaProject { gid, url }`, `wonBy { id, name }` and `contactPerson { id, displayName, firstName, lastName, email, mobile }`; it has no assignment relations, calendar or PM-membership fields. Both no longer include lost/override reasons, deal-automation and deal-lost bookkeeping columns, `winProofRequirement` or the payment-schedule lead days.
|
|
57
68
|
|
|
@@ -706,12 +717,12 @@ Admin/Lead users can run `bb supplier approve <supplierId>` to directly re-appro
|
|
|
706
717
|
| **Budgets** | `list-budgets` (full payload by default; `--summary` or `--includeDetails false` for slim list), `get-budget`, `get-budget-items`, `get-budget-details`, `get-budget-categories` (forward cursor pages of active categories, name A–Z: `--q` / `--limit` / `--cursor`; returns `{ items, pageInfo }`), `get-budget-versions`, `rename-budget-version`, `restore-budget-version`, `update-budget-status` (`ESTIMATE_ACCEPTED` requires win proof, auto-marks `PITCH` or `LOST` projects `WON`, and auto-creates an Asana Event Ops section from Prompt 5 tasks when enabled; Prompt 5 skips quantity-zero items, combines matching non-GO-internal suppliers, keeps each GO internal item separate, removes generated work that repeats another line item or group, adds 5 mandatory supplier subtasks ending in "Get bill and upload to Budget Builder", and sets no subtask due dates; `--projectStatusOnCommercialRejection PITCH\|LOST` is required when rejecting the only accepted/closed budget on a commercial project), `mark-budget-won` (`<budgetId>` + proof file path; `PITCH` or `LOST` projects become `WON` automatically), `create-budget` / `update-budget` (`--payload`; cloned unavailable lines require `unavailableItemReviewAcknowledged: true`), `delete-budget`, `create-budget-approval` (also sends approval request emails), `create-estimate`, `send-estimate-to-contact-person` (same contact-person email workflow as web), `add-budget-items`, `update-budget-item`, `replace-budget-item`, `approve-unavailable-item-exception` (Lead/Admin), `remove-budget-item`, `reorder-budget-items`, `update-budget-item-supplier`, `mark-budget-items-not-utilized`, `restore-budget-item`, `create-placeholder-bill` (admin recovery), `create-budget-category`, `update-budget-category`, `delete-budget-category`, `update-budget-commission`, `delete-budget-commission`, `update-budget-discount`, `delete-budget-discount` (`--payload` where noted), `upload-budget-attachment` (`<budgetId>` + local file path; uses `attachment.requestBudgetAttachmentUpload` + PUT + `attachment.confirmBudgetAttachment`) |
|
|
707
718
|
| **Bills / claims** | `list-bills` (`--isClaimable false` for bills, `--isClaimable true` for claims, omit for both), `list-claims` (claims only), `validate-bill-selection` (`--payload`, plus `--quotationIds q1,q2` or legacy `--quotationId q1`; validates the approved supplier and quotation coverage), `link-bill-quotations` (`<billId> --quotationIds q1,q2`; Admin source-link repair for eligible supplier bills), `stage-bill-attachment` (securely uploads invoice/payment-proof files before creation and returns attachment JSON; ownership and one-hour expiry are enforced by a server-side staged-upload record rather than encoded in the object key), `cleanup-staged-bill-attachments`, `create-bill` (`--payload`; set `isClaimable=false` for a bill and provide approved `quotationIds`, or use `--quotation-exempt` for an eligible server-validated exemption; set `isClaimable=true` for a claim without quotations; supplier bills require positive **before-GST** `extractedAmount` (full invoice subtotal) and `amount` (portion billed), with `amount <= extractedAmount`; line and quotation allocation amounts also exclude GST; an already-paid supplier bill sets `alreadyPaid=true` and requires `paymentReference` plus a staged PDF in `paymentProofAttachments`; admin creation automatically queues QBO finalization while other roles remain pending approval), `update-bill` (`--payload`), `update-bill-payment-evidence` (`--payload`; replaces the payment reference and payment-proof PDFs for an already-paid bill), `delete-bill`, `create-bill-approval` (also sends approval request emails), `update-bill-status` (`PAID` requires `--paymentReference`; pass `--paymentProof <receipt.pdf>` to stage and submit a PDF up to 20MB atomically, or omit it only when BB already has payment proof; moving to `PAID` runs the server's paid-bill notification workflow), `patch-bill-payment` (PAID bills: `--paymentTrackingUrl`, `--paymentReference`, `--quickbooksBillId`, `--paymentDate` ISO; clearing a paid bill's QuickBooks link is not allowed), `patch-bill-invoice-number`, `get-bill-attachments` (newest-first cursor pages: `--limit` 1–50, `--cursor`; returns `{ items, pageInfo }`), `upload-bill-attachment` (`<billId>` + local path), `get-bill-details` (the web bill summary: status, amounts, people, payment, line totals), `get-bill-line-items` / `get-bill-approvals` (newest-first cursor pages: `--limit`, `--cursor`; `{ items, pageInfo }`), `get-bill-payment` (payment status, reference, date, tracking URL, QuickBooks link, external payment) |
|
|
708
719
|
| **Quotations** | `list-quotations` (project, budget, supplier, status, requester and text-search filters; newest-first cursor pages via `--limit` / `--cursor` / `--direction` returning `{ items, pageInfo }`; `--page` / `--perPage` / `--pageSize` are rejected), `count-quotations` (`quotation.getCounts`: filters only, returns `totalCount`, status facets that ignore their own status filter, and `--includeMetrics true` amount metrics), `get-quotation` (web quotation shape), `get-quotation-line-items` (`<quotationId>`; newest-first cursor pages, `--limit 1-100`, `--cursor`), `upload-quotation-attachment` (`<projectId>` + PDF/JPEG/PNG path up to 20MB; returns attachment JSON for payload use), `cleanup-staged-quotation-attachments`, `create-quotation` (`--payload` for `quotation.createDraft`; include `amountWithoutGst`, `gstAmount`, and `lineAmounts` entries `{ budgetItemId, amount }` for multiple selected items), `update-quotation` (`--payload`; updates a `DRAFT` or `REJECTED` quotation), `delete-quotation`, `submit-quotation`, `approve-quotation`, `reject-quotation`, `download-quotation-pdf` (`original`, `staff`, or `final`) |
|
|
709
|
-
| **Customer invoices** | `check-customer-invoice-readiness`, `list-eligible-customer-invoice-budgets`, `preview-customer-invoice-amount`, `list-available-qbo-customer-invoices`, `list-customer-invoices` (global/project/budget filters; cursor pages via `--limit` / `--cursor` / `--direction` returning `{ items, pageInfo }`, `--page` / `--perPage` rejected; `--sortBy totalInvoiceAmount` sorts provider-confirmed totals including GST, with unknown amounts last), `count-customer-invoices` (`customerInvoice.getCounts`: filters only; `totalCount`, lifecycle status facets that ignore their own status filter, and amount metrics), `get-customer-invoice` (web-shaped batch), `get-customer-invoice-invoices`, `get-customer-invoice-lines`, `get-customer-invoice-approvals`, `get-customer-invoice-history`, `get-customer-invoice-email-context`, `preview-qbo-customer-invoice`, `import-qbo-customer-invoice` (BB-only link with reviewed token), `create-customer-invoice`, `resubmit-customer-invoice` (original requester only; one replacement after confirmed expiry voiding; repeated calls return the same replacement), `discard-customer-invoice`, `delete-customer-invoice`, `void-customer-invoice`, `approve-customer-invoice` (admin), `reject-customer-invoice` (admin), `send-customer-invoice-to-contact-person`, `download-customer-invoice-pdf` (non-admins cannot download while approval is pending), `mark-customer-invoice-sent-externally` (admin; `--sentAt` ISO, `--recipients` comma list, optional `--note`; records an APPROVED invoice as SENT/EXTERNAL, sends no email), `sync-customer-invoice` (status only: QuickBooks edits to bill-to address, memo, bill email or total are held as `qboDetailsDrift` and admins are emailed once per QuickBooks revision), `update-customer-invoice-details` (bill-to address and memo; external QuickBooks write; bill email is managed in QuickBooks), `update-customer-invoice-qbo-drift` (admin; `--resolution ACCEPT_QBO` writes BB only, `KEEP_BB` queues BB's address and memo to QuickBooks) |
|
|
720
|
+
| **Customer invoices** | `check-customer-invoice-readiness`, `list-eligible-customer-invoice-budgets`, `preview-customer-invoice-amount`, `list-available-qbo-customer-invoices`, `list-customer-invoices` (global/project/budget filters; cursor pages via `--limit` / `--cursor` / `--direction` returning `{ items, pageInfo }`, `--page` / `--perPage` rejected; `--sortBy totalInvoiceAmount` sorts provider-confirmed totals including GST, with unknown amounts last), `count-customer-invoices` (`customerInvoice.getCounts`: filters only; `totalCount`, lifecycle status facets that ignore their own status filter, and amount metrics), `get-customer-invoice` (web-shaped batch), `get-customer-invoice-invoices`, `get-customer-invoice-lines`, `get-customer-invoice-approvals`, `get-customer-invoice-history`, `get-customer-invoice-payments` (live QuickBooks payments for one invoice), `get-customer-invoice-email-context`, `preview-qbo-customer-invoice`, `import-qbo-customer-invoice` (BB-only link with reviewed token), `create-customer-invoice`, `resubmit-customer-invoice` (original requester only; one replacement after confirmed expiry voiding; repeated calls return the same replacement), `discard-customer-invoice`, `delete-customer-invoice`, `void-customer-invoice`, `approve-customer-invoice` (admin), `reject-customer-invoice` (admin), `send-customer-invoice-to-contact-person`, `download-customer-invoice-pdf` (non-admins cannot download while approval is pending), `mark-customer-invoice-sent-externally` (admin; `--sentAt` ISO, `--recipients` comma list, optional `--note`; records an APPROVED invoice as SENT/EXTERNAL, sends no email), `sync-customer-invoice` (status only: QuickBooks edits to bill-to address, memo, bill email or total are held as `qboDetailsDrift` and admins are emailed once per QuickBooks revision), `update-customer-invoice-details` (bill-to address and memo; external QuickBooks write; bill email is managed in QuickBooks), `update-customer-invoice-qbo-drift` (admin; `--resolution ACCEPT_QBO` writes BB only, `KEEP_BB` queues BB's address and memo to QuickBooks) |
|
|
710
721
|
| **Approvals** | `list-approvals` / `get-pending-approvals` (`--type budget\|supplier\|bill\|quotation\|customer_invoice\|all`), `approve-bill` / `reject-bill` (send reply email), `approve-budget` / `reject-budget` (send reply email), `approve-supplier` / `reject-supplier` (send reply email), `approve-quotation` / `reject-quotation`, `approve-customer-invoice` / `reject-customer-invoice` |
|
|
711
722
|
| **Companies & projects** | `list-companies`, `get-company`, `create-company`, `update-company` (`--payload`), `delete-company`, `list-projects`, `get-project` (its budget overview returns `totalRevenue`, calculated only from Estimate Accepted and Estimate Closed budgets), `get-project-hub-status`, `setup-project-hub`, `sync-project-hub-commercial-documents`, `create-project` (required: `--name`, `--companyId`, `--contactPersonId`, `--insideSalesId`, `--businessDevelopmentId`, `--venue`, `--startDate` as ISO datetime for project/window start; when `--asanaTaskId` is omitted, the CLI searches open Asana lead tasks in the Deals project, prompts for one of the top five matches, and resolves Slack channel fields from the selected deal card; optional `--asanaSearch`, `--pax`, `--endDate`, `--description`, `--projectManagerId`; always requests QBO project import like the web app), `update-project` (`--payload` with `dateRange.from` / `dateRange.to` for the project window; optional `projectManagerId` and `requestQboAccountantNotification` in JSON), `delete-project`, `check-project-reconciliation <id>` (runs the web app's live checks without changing status), `reconcile-project <id>` (reruns checks transactionally and marks an eligible project `RECONCILED`), `complete-project <id>` (reruns validation, marks a reconciled project `COMPLETED`, and queues QuickBooks placeholder cleanup), `import-qbo-project`, `update-project-status` (`<id>` `<status>`: `PITCH` \| `WON` \| `COMPLETED` \| `RECONCILED` \| `LOST`; close-out follows `WON` → `RECONCILED` → `COMPLETED`, and reconciliation requires every accepted/closed budget line to have an Approved/Paid bill or claim or be explicitly Not Utilized; marking `COMPLETED` queues deletion of every remaining project placeholder bill from QuickBooks; for `PITCH` → `WON` also pass a Budget Builder user `--projectManagerId` or `--projectManagerEmail`; when marking `WON` without an accepted/closed budget or proof, pass `--wonOverrideReason`) |
|
|
712
723
|
| **Contacts** | `list-contacts`, `create-contact-person` (`--payload`), `update-contact-person` (`--payload`) |
|
|
713
|
-
| **Suppliers & items** | `list-suppliers` (defaults to active suppliers, `--perPage 10`, sorted by `createdAt` desc; supports `--name`, `--sortBy` for scalar supplier fields, `--sortDir`, `--createdBy`, `--gstRegistered`, `--status`, `--supplierTags`, `--active false` for archived suppliers), `create-supplier` (`--payload`; when supplier status is `PENDING_APPROVAL`, also runs `supplier.createSupplierApproval` and `email.sendSupplierApprovalRequestEmail`), `update-supplier` (`--payload`; when supplier status is `PENDING_APPROVAL`, also runs `supplier.createSupplierApproval` and `email.sendSupplierApprovalRequestEmail`), `delete-suppliers` (`--ids` CSV; admin; archives/deactivates related items), `reactivate-suppliers` (`--ids` CSV; admin; reactivates related items), `create-certification` / `create-payment-method` / `create-supplier-role` / `create-supplier-tag` (`--name`), `get-supplier-details` (includes `supplierApprovalSummary` for pending approvers, superseded approvers, and the actual responder/respondedAt metadata), `get-supplier-analytics` (admin; cursor pages: `--limit` / `--cursor` / `--direction`, optional `--name`, `--status` CSV, `--gstRegistered true|false`, `--createdBy`, `--timeFrame` (with `--startDate`/`--endDate` for `CUSTOM` only), `--sortBy name|gstRegistered|status|phone|email|updatedAt|createdAt`, `--sortDir`; `--page` / `--perPage` rejected; invalid filters are rejected instead of silently widening results), `count-supplier-analytics` (admin; `{ totalCount }` for the same filters), `list-items` (`--includeQuickBooksDeactivationPending true` discovers interrupted QuickBooks deactivations for Admin retry), `create-item` (`--payload`), `update-item` (`--payload`), `archive-items` (`--ids` CSV, max 100; Budget Builder-only; open estimates retain unavailable snapshot lines for resolution), `delete-item` (admin; archives in Budget Builder and makes the item inactive in QuickBooks; blocked while an open estimate references it), `get-item`, `list-item-categories` (cursor pages of active categories: `--limit` / `--cursor` / `--direction`, optional `--name`, `--sortBy createdAt|name|itemCount|createdBy`, `--sortDir`; `--page` / `--perPage` rejected), `count-item-categories` (`{ totalCount }` for the same `--name`), `create-item-category` / `update-item-category` / `delete-item-categories` (admin; `--ids` CSV for delete) |
|
|
714
|
-
| **Dashboard & users** | `whoami` (current authenticated identity and role), `list-users` (forward cursor pages, name A–Z: `--limit` / `--cursor`, optional `--q` matching name or email; `--page` / `--perPage` rejected), `count-users` (`{ totalCount }` for the same `--q`), `create-user` (admin; provisions an API-only service identity with no Google sign-in; `--email`, optional `--name`, optional `--role` defaulting to `USER`), `create-api-key` (`--name`; defaults to the caller; admin-only `--userId` for another user; raw key shown once), `list-api-keys` (newest-first cursor pages: `--limit` 1–100, `--cursor`; returns `{ items, pageInfo }`; defaults to the caller; admin-only `--userId` for another user), `revoke-api-key` (key ID; admin-only `--userId` for another user), `get-user-performance`, `get-dashboard`, `get-monthly-metrics`, `get-system-overview`, `get-estimate-performance`, `get-financial-overview` (performance/dashboard commands are admin-only) |
|
|
724
|
+
| **Suppliers & items** | `list-suppliers` (defaults to active suppliers, `--perPage 10`, sorted by `createdAt` desc; supports `--name`, `--sortBy` for scalar supplier fields, `--sortDir`, `--createdBy`, `--gstRegistered`, `--status`, `--supplierTags`, `--active false` for archived suppliers), `create-supplier` (`--payload`; when supplier status is `PENDING_APPROVAL`, also runs `supplier.createSupplierApproval` and `email.sendSupplierApprovalRequestEmail`), `update-supplier` (`--payload`; when supplier status is `PENDING_APPROVAL`, also runs `supplier.createSupplierApproval` and `email.sendSupplierApprovalRequestEmail`), `delete-suppliers` (`--ids` CSV; admin; archives/deactivates related items), `reactivate-suppliers` (`--ids` CSV; admin; reactivates related items), `create-certification` / `create-payment-method` / `create-supplier-role` / `create-supplier-tag` (`--name`), `get-supplier-details` (includes `supplierApprovalSummary` for pending approvers, superseded approvers, and the actual responder/respondedAt metadata), `get-supplier-overview` / `get-supplier-usage` / `get-supplier-items` `<supplierId>` (the supplier page's per-tab reads: profile, approvals and tab counts without usage or items; usage rows with spending; inventory items), `get-supplier-analytics` (admin; cursor pages: `--limit` / `--cursor` / `--direction`, optional `--name`, `--status` CSV, `--gstRegistered true|false`, `--createdBy`, `--timeFrame` (with `--startDate`/`--endDate` for `CUSTOM` only), `--sortBy name|gstRegistered|status|phone|email|updatedAt|createdAt`, `--sortDir`; `--page` / `--perPage` rejected; invalid filters are rejected instead of silently widening results), `count-supplier-analytics` (admin; `{ totalCount }` for the same filters), `list-items` (`--includeQuickBooksDeactivationPending true` discovers interrupted QuickBooks deactivations for Admin retry), `create-item` (`--payload`), `update-item` (`--payload`), `archive-items` (`--ids` CSV, max 100; Budget Builder-only; open estimates retain unavailable snapshot lines for resolution), `delete-item` (admin; archives in Budget Builder and makes the item inactive in QuickBooks; blocked while an open estimate references it), `get-item`, `list-item-categories` (cursor pages of active categories: `--limit` / `--cursor` / `--direction`, optional `--name`, `--sortBy createdAt|name|itemCount|createdBy`, `--sortDir`; `--page` / `--perPage` rejected), `count-item-categories` (`{ totalCount }` for the same `--name`), `create-item-category` / `update-item-category` / `delete-item-categories` (admin; `--ids` CSV for delete) |
|
|
725
|
+
| **Dashboard & users** | `whoami` (current authenticated identity and role), `list-users` (forward cursor pages, name A–Z: `--limit` / `--cursor`, optional `--q` matching name or email, optional `--projectTeamOnly true` for the active `@getout.sg` users accepted as Inside Sales, Business Development or Project Manager; `--page` / `--perPage` rejected), `count-users` (`{ totalCount }` for the same `--q` and `--projectTeamOnly`), `create-user` (admin; provisions an API-only service identity with no Google sign-in; `--email`, optional `--name`, optional `--role` defaulting to `USER`), `create-api-key` (`--name`; defaults to the caller; admin-only `--userId` for another user; raw key shown once), `list-api-keys` (newest-first cursor pages: `--limit` 1–100, `--cursor`; returns `{ items, pageInfo }`; defaults to the caller; admin-only `--userId` for another user), `revoke-api-key` (key ID; admin-only `--userId` for another user), `get-user-performance`, `get-dashboard`, `get-monthly-metrics`, `get-system-overview`, `get-estimate-performance`, `get-financial-overview` (performance/dashboard commands are admin-only) |
|
|
715
726
|
| **Errors (admin)** | `get-recent-errors`, `get-error`, `get-error-metrics` |
|
|
716
727
|
| **Automation (admin)** | `list-integration-operations` (cursor pages, newest first: `--limit` / `--cursor` / `--direction` with `--search`, `--destination`, `--status`; `--page` / `--perPage` rejected), `count-integration-operations` (`{ filterOptions }` provider options only; no total, so the command does not scan the outbox; filter flags are accepted but ignored), `get-integration-operation <operationId>` (who queued the job, what it is for, saved progress, Retry state), `reconcile-resource-operation <operationId>`, `retry-integration-operation` (QuickBooks jobs with a saved attempt check QuickBooks first and never resend an applied change; Resend resolution requires `--confirmExternalStateReconciled true` plus `--outboundEmailResolution ACCEPTED\|NOT_ACCEPTED_RETRY`; include `--providerMessageId` when accepted) |
|
|
717
728
|
| **Historical / benchmarks** | `get-approved-budgets`, `get-budget-category-benchmarks`, `get-item-pricing-history`, `get-supplier-pricing-history` |
|
package/command-manifest.json
CHANGED
|
@@ -4728,6 +4728,59 @@
|
|
|
4728
4728
|
"effects": [],
|
|
4729
4729
|
"legacyTarget": "get-customer-invoice-history"
|
|
4730
4730
|
},
|
|
4731
|
+
{
|
|
4732
|
+
"path": ["customer-invoice", "payments", "list"],
|
|
4733
|
+
"legacyAliases": [
|
|
4734
|
+
"get-customer-invoice-payments",
|
|
4735
|
+
"get_customer_invoice_payments"
|
|
4736
|
+
],
|
|
4737
|
+
"summary": "List the payments QuickBooks applied to one invoice: payment id, date, reference, amount applied, total and attachment names. Argument: <invoiceId> (from get-customer-invoice-invoices). Live QuickBooks read.",
|
|
4738
|
+
"globalOptions": [
|
|
4739
|
+
{
|
|
4740
|
+
"name": "--help",
|
|
4741
|
+
"description": "Show help for this command."
|
|
4742
|
+
},
|
|
4743
|
+
{
|
|
4744
|
+
"name": "--quiet",
|
|
4745
|
+
"description": "Suppress non-error diagnostics."
|
|
4746
|
+
},
|
|
4747
|
+
{
|
|
4748
|
+
"name": "--debug",
|
|
4749
|
+
"description": "Emit sanitized diagnostic traces."
|
|
4750
|
+
},
|
|
4751
|
+
{
|
|
4752
|
+
"name": "--api-url",
|
|
4753
|
+
"description": "Override the Budget Builder API base URL."
|
|
4754
|
+
},
|
|
4755
|
+
{
|
|
4756
|
+
"name": "--no-browser",
|
|
4757
|
+
"description": "Print the authorization URL without opening a browser."
|
|
4758
|
+
},
|
|
4759
|
+
{
|
|
4760
|
+
"name": "--allow-state-change",
|
|
4761
|
+
"description": "Allow a Budget Builder state change in non-interactive use."
|
|
4762
|
+
},
|
|
4763
|
+
{
|
|
4764
|
+
"name": "--allow-email",
|
|
4765
|
+
"description": "Allow sending email in non-interactive use."
|
|
4766
|
+
},
|
|
4767
|
+
{
|
|
4768
|
+
"name": "--allow-external-write",
|
|
4769
|
+
"description": "Allow writes to external systems in non-interactive use."
|
|
4770
|
+
},
|
|
4771
|
+
{
|
|
4772
|
+
"name": "--allow-delete",
|
|
4773
|
+
"description": "Allow deleting data in non-interactive use."
|
|
4774
|
+
},
|
|
4775
|
+
{
|
|
4776
|
+
"name": "--allow-financial-write",
|
|
4777
|
+
"description": "Allow financial-record changes in non-interactive use."
|
|
4778
|
+
}
|
|
4779
|
+
],
|
|
4780
|
+
"argumentMode": "legacy-passthrough",
|
|
4781
|
+
"effects": [],
|
|
4782
|
+
"legacyTarget": "get-customer-invoice-payments"
|
|
4783
|
+
},
|
|
4731
4784
|
{
|
|
4732
4785
|
"path": ["customer-invoice", "email-context", "get"],
|
|
4733
4786
|
"legacyAliases": [
|
|
@@ -5957,6 +6010,156 @@
|
|
|
5957
6010
|
"effects": [],
|
|
5958
6011
|
"legacyTarget": "get-supplier-details"
|
|
5959
6012
|
},
|
|
6013
|
+
{
|
|
6014
|
+
"path": ["supplier", "overview", "get"],
|
|
6015
|
+
"legacyAliases": ["get-supplier-overview", "get_supplier_overview"],
|
|
6016
|
+
"summary": "Get a supplier's profile, approvals, pending update, attachments and tab counts (usageCount, _count.items). Skips usage rows, spending and items; use get-supplier-usage or get-supplier-items for those.",
|
|
6017
|
+
"globalOptions": [
|
|
6018
|
+
{
|
|
6019
|
+
"name": "--help",
|
|
6020
|
+
"description": "Show help for this command."
|
|
6021
|
+
},
|
|
6022
|
+
{
|
|
6023
|
+
"name": "--quiet",
|
|
6024
|
+
"description": "Suppress non-error diagnostics."
|
|
6025
|
+
},
|
|
6026
|
+
{
|
|
6027
|
+
"name": "--debug",
|
|
6028
|
+
"description": "Emit sanitized diagnostic traces."
|
|
6029
|
+
},
|
|
6030
|
+
{
|
|
6031
|
+
"name": "--api-url",
|
|
6032
|
+
"description": "Override the Budget Builder API base URL."
|
|
6033
|
+
},
|
|
6034
|
+
{
|
|
6035
|
+
"name": "--no-browser",
|
|
6036
|
+
"description": "Print the authorization URL without opening a browser."
|
|
6037
|
+
},
|
|
6038
|
+
{
|
|
6039
|
+
"name": "--allow-state-change",
|
|
6040
|
+
"description": "Allow a Budget Builder state change in non-interactive use."
|
|
6041
|
+
},
|
|
6042
|
+
{
|
|
6043
|
+
"name": "--allow-email",
|
|
6044
|
+
"description": "Allow sending email in non-interactive use."
|
|
6045
|
+
},
|
|
6046
|
+
{
|
|
6047
|
+
"name": "--allow-external-write",
|
|
6048
|
+
"description": "Allow writes to external systems in non-interactive use."
|
|
6049
|
+
},
|
|
6050
|
+
{
|
|
6051
|
+
"name": "--allow-delete",
|
|
6052
|
+
"description": "Allow deleting data in non-interactive use."
|
|
6053
|
+
},
|
|
6054
|
+
{
|
|
6055
|
+
"name": "--allow-financial-write",
|
|
6056
|
+
"description": "Allow financial-record changes in non-interactive use."
|
|
6057
|
+
}
|
|
6058
|
+
],
|
|
6059
|
+
"argumentMode": "legacy-passthrough",
|
|
6060
|
+
"effects": [],
|
|
6061
|
+
"legacyTarget": "get-supplier-overview"
|
|
6062
|
+
},
|
|
6063
|
+
{
|
|
6064
|
+
"path": ["supplier", "usage", "get"],
|
|
6065
|
+
"legacyAliases": ["get-supplier-usage", "get_supplier_usage"],
|
|
6066
|
+
"summary": "Get a supplier's usage rows (accepted/closed budget lines and lines with its actual spending) plus spending, actualSpending and estimatedSpending.",
|
|
6067
|
+
"globalOptions": [
|
|
6068
|
+
{
|
|
6069
|
+
"name": "--help",
|
|
6070
|
+
"description": "Show help for this command."
|
|
6071
|
+
},
|
|
6072
|
+
{
|
|
6073
|
+
"name": "--quiet",
|
|
6074
|
+
"description": "Suppress non-error diagnostics."
|
|
6075
|
+
},
|
|
6076
|
+
{
|
|
6077
|
+
"name": "--debug",
|
|
6078
|
+
"description": "Emit sanitized diagnostic traces."
|
|
6079
|
+
},
|
|
6080
|
+
{
|
|
6081
|
+
"name": "--api-url",
|
|
6082
|
+
"description": "Override the Budget Builder API base URL."
|
|
6083
|
+
},
|
|
6084
|
+
{
|
|
6085
|
+
"name": "--no-browser",
|
|
6086
|
+
"description": "Print the authorization URL without opening a browser."
|
|
6087
|
+
},
|
|
6088
|
+
{
|
|
6089
|
+
"name": "--allow-state-change",
|
|
6090
|
+
"description": "Allow a Budget Builder state change in non-interactive use."
|
|
6091
|
+
},
|
|
6092
|
+
{
|
|
6093
|
+
"name": "--allow-email",
|
|
6094
|
+
"description": "Allow sending email in non-interactive use."
|
|
6095
|
+
},
|
|
6096
|
+
{
|
|
6097
|
+
"name": "--allow-external-write",
|
|
6098
|
+
"description": "Allow writes to external systems in non-interactive use."
|
|
6099
|
+
},
|
|
6100
|
+
{
|
|
6101
|
+
"name": "--allow-delete",
|
|
6102
|
+
"description": "Allow deleting data in non-interactive use."
|
|
6103
|
+
},
|
|
6104
|
+
{
|
|
6105
|
+
"name": "--allow-financial-write",
|
|
6106
|
+
"description": "Allow financial-record changes in non-interactive use."
|
|
6107
|
+
}
|
|
6108
|
+
],
|
|
6109
|
+
"argumentMode": "legacy-passthrough",
|
|
6110
|
+
"effects": [],
|
|
6111
|
+
"legacyTarget": "get-supplier-usage"
|
|
6112
|
+
},
|
|
6113
|
+
{
|
|
6114
|
+
"path": ["supplier", "items", "get"],
|
|
6115
|
+
"legacyAliases": ["get-supplier-items", "get_supplier_items"],
|
|
6116
|
+
"summary": "Get the inventory items catalogued under a supplier.",
|
|
6117
|
+
"globalOptions": [
|
|
6118
|
+
{
|
|
6119
|
+
"name": "--help",
|
|
6120
|
+
"description": "Show help for this command."
|
|
6121
|
+
},
|
|
6122
|
+
{
|
|
6123
|
+
"name": "--quiet",
|
|
6124
|
+
"description": "Suppress non-error diagnostics."
|
|
6125
|
+
},
|
|
6126
|
+
{
|
|
6127
|
+
"name": "--debug",
|
|
6128
|
+
"description": "Emit sanitized diagnostic traces."
|
|
6129
|
+
},
|
|
6130
|
+
{
|
|
6131
|
+
"name": "--api-url",
|
|
6132
|
+
"description": "Override the Budget Builder API base URL."
|
|
6133
|
+
},
|
|
6134
|
+
{
|
|
6135
|
+
"name": "--no-browser",
|
|
6136
|
+
"description": "Print the authorization URL without opening a browser."
|
|
6137
|
+
},
|
|
6138
|
+
{
|
|
6139
|
+
"name": "--allow-state-change",
|
|
6140
|
+
"description": "Allow a Budget Builder state change in non-interactive use."
|
|
6141
|
+
},
|
|
6142
|
+
{
|
|
6143
|
+
"name": "--allow-email",
|
|
6144
|
+
"description": "Allow sending email in non-interactive use."
|
|
6145
|
+
},
|
|
6146
|
+
{
|
|
6147
|
+
"name": "--allow-external-write",
|
|
6148
|
+
"description": "Allow writes to external systems in non-interactive use."
|
|
6149
|
+
},
|
|
6150
|
+
{
|
|
6151
|
+
"name": "--allow-delete",
|
|
6152
|
+
"description": "Allow deleting data in non-interactive use."
|
|
6153
|
+
},
|
|
6154
|
+
{
|
|
6155
|
+
"name": "--allow-financial-write",
|
|
6156
|
+
"description": "Allow financial-record changes in non-interactive use."
|
|
6157
|
+
}
|
|
6158
|
+
],
|
|
6159
|
+
"argumentMode": "legacy-passthrough",
|
|
6160
|
+
"effects": [],
|
|
6161
|
+
"legacyTarget": "get-supplier-items"
|
|
6162
|
+
},
|
|
5960
6163
|
{
|
|
5961
6164
|
"path": ["company", "list"],
|
|
5962
6165
|
"legacyAliases": ["list-companies", "list_companies"],
|
|
@@ -8938,7 +9141,7 @@
|
|
|
8938
9141
|
{
|
|
8939
9142
|
"path": ["user", "list"],
|
|
8940
9143
|
"legacyAliases": ["list-users", "list_users"],
|
|
8941
|
-
"summary": "List users with cursor pagination. [--q] [--limit 1-100] [--cursor <token>] Name A–Z. Returns { items, pageInfo }; follow nextCursor with the same --q. --page/--perPage are rejected.",
|
|
9144
|
+
"summary": "List users with cursor pagination. [--q] [--projectTeamOnly true|false] [--limit 1-100] [--cursor <token>] Name A–Z. Returns { items, pageInfo }; follow nextCursor with the same --q and --projectTeamOnly. --projectTeamOnly true lists only active @getout.sg users, the only accounts accepted as Inside Sales, Business Development or Project Manager. --page/--perPage are rejected.",
|
|
8942
9145
|
"globalOptions": [
|
|
8943
9146
|
{
|
|
8944
9147
|
"name": "--help",
|
|
@@ -8984,6 +9187,10 @@
|
|
|
8984
9187
|
"name": "--q <text>",
|
|
8985
9188
|
"description": "Search user names and emails (name A–Z). A bare --q is rejected; use -q/--quiet to hide logs."
|
|
8986
9189
|
},
|
|
9190
|
+
{
|
|
9191
|
+
"name": "--projectTeamOnly <true|false>",
|
|
9192
|
+
"description": "true lists only active @getout.sg users, the only accounts accepted as Inside Sales, Business Development or Project Manager."
|
|
9193
|
+
},
|
|
8987
9194
|
{
|
|
8988
9195
|
"name": "--limit <1-100>",
|
|
8989
9196
|
"description": "Rows per page. Output is { items, pageInfo }."
|
package/command-reference.md
CHANGED
|
@@ -789,6 +789,14 @@ Legacy aliases: `get-customer-invoice-history`, `get_customer_invoice_history`.
|
|
|
789
789
|
|
|
790
790
|
Effects: none.
|
|
791
791
|
|
|
792
|
+
## `bb customer-invoice payments list`
|
|
793
|
+
|
|
794
|
+
List the payments QuickBooks applied to one invoice: payment id, date, reference, amount applied, total and attachment names. Argument: <invoiceId> (from get-customer-invoice-invoices). Live QuickBooks read.
|
|
795
|
+
|
|
796
|
+
Legacy aliases: `get-customer-invoice-payments`, `get_customer_invoice_payments`.
|
|
797
|
+
|
|
798
|
+
Effects: none.
|
|
799
|
+
|
|
792
800
|
## `bb customer-invoice email-context get`
|
|
793
801
|
|
|
794
802
|
Get customer invoice email context.
|
|
@@ -991,6 +999,30 @@ Legacy aliases: `get-supplier-details`, `get_supplier_details`.
|
|
|
991
999
|
|
|
992
1000
|
Effects: none.
|
|
993
1001
|
|
|
1002
|
+
## `bb supplier overview get`
|
|
1003
|
+
|
|
1004
|
+
Get a supplier's profile, approvals, pending update, attachments and tab counts (usageCount, _count.items). Skips usage rows, spending and items; use get-supplier-usage or get-supplier-items for those.
|
|
1005
|
+
|
|
1006
|
+
Legacy aliases: `get-supplier-overview`, `get_supplier_overview`.
|
|
1007
|
+
|
|
1008
|
+
Effects: none.
|
|
1009
|
+
|
|
1010
|
+
## `bb supplier usage get`
|
|
1011
|
+
|
|
1012
|
+
Get a supplier's usage rows (accepted/closed budget lines and lines with its actual spending) plus spending, actualSpending and estimatedSpending.
|
|
1013
|
+
|
|
1014
|
+
Legacy aliases: `get-supplier-usage`, `get_supplier_usage`.
|
|
1015
|
+
|
|
1016
|
+
Effects: none.
|
|
1017
|
+
|
|
1018
|
+
## `bb supplier items get`
|
|
1019
|
+
|
|
1020
|
+
Get the inventory items catalogued under a supplier.
|
|
1021
|
+
|
|
1022
|
+
Legacy aliases: `get-supplier-items`, `get_supplier_items`.
|
|
1023
|
+
|
|
1024
|
+
Effects: none.
|
|
1025
|
+
|
|
994
1026
|
## `bb company list`
|
|
995
1027
|
|
|
996
1028
|
List companies with cursor pagination. Returns { items, pageInfo }; default sort is createdAt descending with limit 20. Pass nextCursor forward or previousCursor backward unchanged. Legacy page/perPage flags are rejected.
|
|
@@ -1457,7 +1489,7 @@ Effects: state-change, delete.
|
|
|
1457
1489
|
|
|
1458
1490
|
## `bb user list`
|
|
1459
1491
|
|
|
1460
|
-
List users with cursor pagination. [--q] [--limit 1-100] [--cursor <token>] Name A–Z. Returns { items, pageInfo }; follow nextCursor with the same --q. --page/--perPage are rejected.
|
|
1492
|
+
List users with cursor pagination. [--q] [--projectTeamOnly true|false] [--limit 1-100] [--cursor <token>] Name A–Z. Returns { items, pageInfo }; follow nextCursor with the same --q and --projectTeamOnly. --projectTeamOnly true lists only active @getout.sg users, the only accounts accepted as Inside Sales, Business Development or Project Manager. --page/--perPage are rejected.
|
|
1461
1493
|
|
|
1462
1494
|
Legacy aliases: `list-users`, `list_users`.
|
|
1463
1495
|
|
package/dist/index.js
CHANGED
|
@@ -7221,9 +7221,6 @@ var formatValidationMessage = (message, data) => {
|
|
|
7221
7221
|
if (issue.code === "invalid_type" && typeof issue.expected === "string" && issue.message.toLowerCase().includes("required")) {
|
|
7222
7222
|
return `${path} must be a ${issue.expected}${path === "cost" ? ', e.g. "19"' : ""}`;
|
|
7223
7223
|
}
|
|
7224
|
-
if (issue.code === "invalid_format" && issue.format === "regex" && path === "name" && String(issue.pattern ?? issue.message).includes("A-Za-z0-9,.?@&!#'~* _;+-")) {
|
|
7225
|
-
return `${path} contains characters that are not allowed. Allowed: letters, numbers, spaces and , . ? @ & ! # ' ~ * _ ; + -`;
|
|
7226
|
-
}
|
|
7227
7224
|
return `${path}: ${issue.message}`;
|
|
7228
7225
|
});
|
|
7229
7226
|
return issues.every((issue) => issue !== undefined) ? issues.join("; ") : message;
|
|
@@ -7657,6 +7654,12 @@ var billStatusesForUpdateHelp = Object.values(BillStatus2).filter((s) => s !== B
|
|
|
7657
7654
|
var projectStatusesForHelp = Object.values(ProjectStatus2);
|
|
7658
7655
|
var userRolesForHelp = Object.values(UserRole);
|
|
7659
7656
|
|
|
7657
|
+
// ../validators/src/quickbooks/qbo-name.ts
|
|
7658
|
+
var QUICKBOOKS_NAME_VALIDATION_MESSAGE = "Name cannot contain colons, tabs or line breaks (QuickBooks rule)";
|
|
7659
|
+
var quickBooksNameSchema = string2().trim().min(1, { error: "Name is required" }).max(100, { error: "Name cannot be longer than 100 characters" }).regex(/^[^:\t\n]+$/, {
|
|
7660
|
+
error: QUICKBOOKS_NAME_VALIDATION_MESSAGE
|
|
7661
|
+
});
|
|
7662
|
+
|
|
7660
7663
|
// ../utils/src/rich-text.ts
|
|
7661
7664
|
var escapeHtml = (text) => text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
7662
7665
|
var createRichTextFromPlainText = (text) => {
|
|
@@ -8310,7 +8313,7 @@ function parseUpdateProjectPayload(raw) {
|
|
|
8310
8313
|
} : {};
|
|
8311
8314
|
return {
|
|
8312
8315
|
id: requiredString(o.id, "update-project payload.id"),
|
|
8313
|
-
name:
|
|
8316
|
+
name: parseQuickBooksName(o.name),
|
|
8314
8317
|
description: optionalString(o.description),
|
|
8315
8318
|
companyId: requiredString(o.companyId, "update-project payload.companyId"),
|
|
8316
8319
|
contactPersonId: requiredString(o.contactPersonId, "update-project payload.contactPersonId"),
|
|
@@ -8333,25 +8336,31 @@ function parseUpdateProjectPayload(raw) {
|
|
|
8333
8336
|
}
|
|
8334
8337
|
};
|
|
8335
8338
|
}
|
|
8339
|
+
var parseQuickBooksName = (value) => {
|
|
8340
|
+
const result = quickBooksNameSchema.safeParse(value);
|
|
8341
|
+
if (!result.success) {
|
|
8342
|
+
throw validationError(result.error.issues[0]?.message ?? "Invalid QuickBooks name");
|
|
8343
|
+
}
|
|
8344
|
+
return result.data;
|
|
8345
|
+
};
|
|
8336
8346
|
function parseSupplierCreatePayload(raw) {
|
|
8337
|
-
requireObject(raw, "create-supplier payload");
|
|
8338
|
-
return
|
|
8347
|
+
const input = requireObject(raw, "create-supplier payload");
|
|
8348
|
+
return {
|
|
8349
|
+
...input,
|
|
8350
|
+
name: parseQuickBooksName(input.name)
|
|
8351
|
+
};
|
|
8339
8352
|
}
|
|
8340
8353
|
function parseSupplierUpdatePayload(raw) {
|
|
8341
|
-
requireObject(raw, "update-supplier payload");
|
|
8342
|
-
return
|
|
8354
|
+
const input = requireObject(raw, "update-supplier payload");
|
|
8355
|
+
return {
|
|
8356
|
+
...input,
|
|
8357
|
+
name: parseQuickBooksName(input.name)
|
|
8358
|
+
};
|
|
8343
8359
|
}
|
|
8344
|
-
var normalizeItemPayload = (input
|
|
8345
|
-
if (typeof input.name === "string") {
|
|
8346
|
-
const invalidCharacters = [
|
|
8347
|
-
...new Set([...input.name].filter((character) => !/^[A-Za-z0-9,.?@&!#'~* _;+-]$/.test(character)))
|
|
8348
|
-
];
|
|
8349
|
-
if (invalidCharacters.length > 0) {
|
|
8350
|
-
throw validationError(`${command} payload.name contains characters that are not allowed: ${invalidCharacters.join(" ")}. Allowed: letters, numbers, spaces and , . ? @ & ! # ' ~ * _ ; + -`);
|
|
8351
|
-
}
|
|
8352
|
-
}
|
|
8360
|
+
var normalizeItemPayload = (input) => {
|
|
8353
8361
|
const normalized = {
|
|
8354
8362
|
...input,
|
|
8363
|
+
name: parseQuickBooksName(input.name),
|
|
8355
8364
|
...typeof input.cost === "number" && Number.isFinite(input.cost) ? { cost: String(input.cost) } : {}
|
|
8356
8365
|
};
|
|
8357
8366
|
return normalizePlainTextRichTextField({
|
|
@@ -8361,10 +8370,10 @@ var normalizeItemPayload = (input, command) => {
|
|
|
8361
8370
|
});
|
|
8362
8371
|
};
|
|
8363
8372
|
function parseItemCreatePayload(raw) {
|
|
8364
|
-
return normalizeItemPayload(requireObject(raw, "create-item payload")
|
|
8373
|
+
return normalizeItemPayload(requireObject(raw, "create-item payload"));
|
|
8365
8374
|
}
|
|
8366
8375
|
function parseItemUpdatePayload(raw) {
|
|
8367
|
-
return normalizeItemPayload(requireObject(raw, "update-item payload")
|
|
8376
|
+
return normalizeItemPayload(requireObject(raw, "update-item payload"));
|
|
8368
8377
|
}
|
|
8369
8378
|
function parseContactCreatePayload(raw) {
|
|
8370
8379
|
requireObject(raw, "create-contact-person payload");
|
|
@@ -8382,7 +8391,7 @@ function parseCompanyUpdatePayload(raw) {
|
|
|
8382
8391
|
}
|
|
8383
8392
|
return {
|
|
8384
8393
|
id: requiredString(input.id, "id"),
|
|
8385
|
-
name:
|
|
8394
|
+
name: parseQuickBooksName(input.name),
|
|
8386
8395
|
website: requiredString(input.website, "website"),
|
|
8387
8396
|
...input.confirmDistinct === undefined ? {} : { confirmDistinct: input.confirmDistinct },
|
|
8388
8397
|
...billingEmails === undefined ? {} : { billingEmails }
|
|
@@ -9900,11 +9909,16 @@ async function createSupplierTagOption(name) {
|
|
|
9900
9909
|
out(result);
|
|
9901
9910
|
}
|
|
9902
9911
|
async function createItemCategory(name) {
|
|
9903
|
-
const result = await api2.itemCategory.createItemCategory.mutate({
|
|
9912
|
+
const result = await api2.itemCategory.createItemCategory.mutate({
|
|
9913
|
+
name: parseQuickBooksName(name)
|
|
9914
|
+
});
|
|
9904
9915
|
out(result);
|
|
9905
9916
|
}
|
|
9906
9917
|
async function updateItemCategory(opts) {
|
|
9907
|
-
const result = await api2.itemCategory.updateItemCategory.mutate(
|
|
9918
|
+
const result = await api2.itemCategory.updateItemCategory.mutate({
|
|
9919
|
+
...opts,
|
|
9920
|
+
name: parseQuickBooksName(opts.name)
|
|
9921
|
+
});
|
|
9908
9922
|
out(result);
|
|
9909
9923
|
}
|
|
9910
9924
|
async function deleteItemCategoriesByIds(ids) {
|
|
@@ -10024,6 +10038,9 @@ var getCustomerInvoiceApprovals = async (input) => {
|
|
|
10024
10038
|
var getCustomerInvoiceHistory = async (input) => {
|
|
10025
10039
|
out(await api2.customerInvoice.getHistory.query(input));
|
|
10026
10040
|
};
|
|
10041
|
+
var getCustomerInvoicePayments = async (invoiceId) => {
|
|
10042
|
+
out(await api2.customerInvoice.getPayments.query({ invoiceId }));
|
|
10043
|
+
};
|
|
10027
10044
|
var getCustomerInvoiceEmailContext = async (batchId) => {
|
|
10028
10045
|
const result = await api2.customerInvoice.getInvoiceEmailContext.query({
|
|
10029
10046
|
batchId
|
|
@@ -10380,6 +10397,15 @@ async function rejectBudget(budgetId, reason) {
|
|
|
10380
10397
|
email
|
|
10381
10398
|
});
|
|
10382
10399
|
}
|
|
10400
|
+
async function getSupplierOverview(supplierId) {
|
|
10401
|
+
out(await api2.supplier.getSupplierOverview.query({ id: supplierId }));
|
|
10402
|
+
}
|
|
10403
|
+
async function getSupplierUsage(supplierId) {
|
|
10404
|
+
out(await api2.supplier.getSupplierUsage.query({ id: supplierId }));
|
|
10405
|
+
}
|
|
10406
|
+
async function getSupplierItems(supplierId) {
|
|
10407
|
+
out(await api2.supplier.getSupplierItems.query({ id: supplierId }));
|
|
10408
|
+
}
|
|
10383
10409
|
async function getSupplierDetails(supplierId) {
|
|
10384
10410
|
const supplier = await api2.supplier.getSupplierById.query({
|
|
10385
10411
|
id: supplierId
|
|
@@ -10434,7 +10460,9 @@ async function getSupplierDetails(supplierId) {
|
|
|
10434
10460
|
});
|
|
10435
10461
|
}
|
|
10436
10462
|
async function approveSupplier(supplierId) {
|
|
10437
|
-
const supplier = await api2.supplier.
|
|
10463
|
+
const supplier = await api2.supplier.getSupplierOverview.query({
|
|
10464
|
+
id: supplierId
|
|
10465
|
+
});
|
|
10438
10466
|
if (supplier.status === ExtendedApprovalStatus.REJECTED) {
|
|
10439
10467
|
await assertSensitiveWorkflowConfirmed({
|
|
10440
10468
|
action: "Re-approve supplier",
|
|
@@ -10582,7 +10610,10 @@ async function getCompany(id) {
|
|
|
10582
10610
|
out(company);
|
|
10583
10611
|
}
|
|
10584
10612
|
async function createCompany(opts) {
|
|
10585
|
-
const result = await api2.company.createCompany.mutate(
|
|
10613
|
+
const result = await api2.company.createCompany.mutate({
|
|
10614
|
+
...opts,
|
|
10615
|
+
name: parseQuickBooksName(opts.name)
|
|
10616
|
+
});
|
|
10586
10617
|
out(result);
|
|
10587
10618
|
}
|
|
10588
10619
|
var searchExistingCompanies = async (input) => {
|
|
@@ -10638,8 +10669,9 @@ var syncProjectHubCommercialDocuments = async (projectId) => {
|
|
|
10638
10669
|
out(result);
|
|
10639
10670
|
};
|
|
10640
10671
|
async function createProject(opts) {
|
|
10672
|
+
const name = parseQuickBooksName(opts.name);
|
|
10641
10673
|
const links = await resolveCreateProjectLinks({
|
|
10642
|
-
name
|
|
10674
|
+
name,
|
|
10643
10675
|
asanaTaskId: opts.asanaTaskId,
|
|
10644
10676
|
asanaSearch: opts.asanaSearch,
|
|
10645
10677
|
slackChannelId: opts.slackChannelId,
|
|
@@ -10647,7 +10679,7 @@ async function createProject(opts) {
|
|
|
10647
10679
|
slackChannelName: opts.slackChannelName
|
|
10648
10680
|
});
|
|
10649
10681
|
const result = await api2.project.createProject.mutate({
|
|
10650
|
-
name
|
|
10682
|
+
name,
|
|
10651
10683
|
description: opts.description,
|
|
10652
10684
|
companyId: opts.companyId,
|
|
10653
10685
|
contactPersonId: opts.contactPersonId,
|
|
@@ -11505,12 +11537,20 @@ var summaryFor = (legacyTarget) => {
|
|
|
11505
11537
|
return "List an invoice batch's approval requests with approver, requester and responder. <batchId> [--limit 1-50] [--cursor <token>] Newest first. Returns { items, pageInfo }; follow nextCursor.";
|
|
11506
11538
|
if (legacyTarget === "get-customer-invoice-history")
|
|
11507
11539
|
return "List an invoice batch's status history (batch/invoice status changes, source, note, actor). <batchId> [--limit 1-100] [--cursor <token>] Newest first. Returns { items, pageInfo }; follow nextCursor.";
|
|
11540
|
+
if (legacyTarget === "get-customer-invoice-payments")
|
|
11541
|
+
return "List the payments QuickBooks applied to one invoice: payment id, date, reference, amount applied, total and attachment names. Argument: <invoiceId> (from get-customer-invoice-invoices). Live QuickBooks read.";
|
|
11508
11542
|
if (legacyTarget === "get-quotation-line-items")
|
|
11509
11543
|
return "List a quotation's line items with budget-item, supplier and budget detail. <quotationId> [--limit 1-100] [--cursor <token>] Newest first. Returns { items, pageInfo }; follow nextCursor.";
|
|
11510
11544
|
if (legacyTarget === "get-bill-attachments")
|
|
11511
11545
|
return "List bill attachments with cursor pagination. <billId> [--limit 1-50] [--cursor <token>] Newest first. Returns { items, pageInfo }; follow nextCursor.";
|
|
11512
11546
|
if (legacyTarget === "get-budget-categories")
|
|
11513
11547
|
return "List budget categories with cursor pagination. [--q] [--limit 1-100] [--cursor <token>] Active categories, name A\u2013Z. Returns { items, pageInfo }; follow nextCursor with the same --q.";
|
|
11548
|
+
if (legacyTarget === "get-supplier-overview")
|
|
11549
|
+
return "Get a supplier's profile, approvals, pending update, attachments and tab counts (usageCount, _count.items). Skips usage rows, spending and items; use get-supplier-usage or get-supplier-items for those.";
|
|
11550
|
+
if (legacyTarget === "get-supplier-usage")
|
|
11551
|
+
return "Get a supplier's usage rows (accepted/closed budget lines and lines with its actual spending) plus spending, actualSpending and estimatedSpending.";
|
|
11552
|
+
if (legacyTarget === "get-supplier-items")
|
|
11553
|
+
return "Get the inventory items catalogued under a supplier.";
|
|
11514
11554
|
if (legacyTarget === "get-supplier-analytics")
|
|
11515
11555
|
return "List supplier analytics rows with cursor pagination. [--name] [--status CSV] [--gstRegistered true|false] [--createdBy <text>] [--timeFrame ALL|LAST_YEAR|LAST_6_MONTHS|LAST_3_MONTHS|CUSTOM] [--startDate <ISO> --endDate <ISO>] [--sortBy name|gstRegistered|status|phone|email|updatedAt|createdAt] [--sortDir asc|desc] [--limit 1-100] [--cursor <token>] [--direction forward|backward] Admin. Returns { items, pageInfo }; follow nextCursor/previousCursor with the same filters and sort. --page/--perPage are rejected.";
|
|
11516
11556
|
if (legacyTarget === "list-api-keys")
|
|
@@ -11524,7 +11564,7 @@ var summaryFor = (legacyTarget) => {
|
|
|
11524
11564
|
if (legacyTarget === "list-quotations")
|
|
11525
11565
|
return "List quotations with cursor pagination. [--projectId] [--budgetId] [--supplierId] [--status CSV] [--createdBy CSV] [--search] [--limit 1-100] [--cursor <token>] [--direction forward|backward] Newest first; returns { items, pageInfo }. Follow nextCursor/previousCursor with the same filters. --page/--pageSize/--perPage are rejected; --requesterIds remains an alias for --createdBy.";
|
|
11526
11566
|
if (legacyTarget === "list-users")
|
|
11527
|
-
return "List users with cursor pagination. [--q] [--limit 1-100] [--cursor <token>] Name A\u2013Z. Returns { items, pageInfo }; follow nextCursor with the same --q. --page/--perPage are rejected.";
|
|
11567
|
+
return "List users with cursor pagination. [--q] [--projectTeamOnly true|false] [--limit 1-100] [--cursor <token>] Name A\u2013Z. Returns { items, pageInfo }; follow nextCursor with the same --q and --projectTeamOnly. --projectTeamOnly true lists only active @getout.sg users, the only accounts accepted as Inside Sales, Business Development or Project Manager. --page/--perPage are rejected.";
|
|
11528
11568
|
if (legacyTarget === "list-companies")
|
|
11529
11569
|
return "List companies with cursor pagination. Returns { items, pageInfo }; default sort is createdAt descending with limit 20. Pass nextCursor forward or previousCursor backward unchanged. Legacy page/perPage flags are rejected.";
|
|
11530
11570
|
if (legacyTarget === "count-companies")
|
|
@@ -12066,6 +12106,11 @@ var registry2 = [
|
|
|
12066
12106
|
description: "pageInfo.nextCursor from the last page, unchanged; pages forward only."
|
|
12067
12107
|
}
|
|
12068
12108
|
]),
|
|
12109
|
+
legacyCommand("get-customer-invoice-payments", [
|
|
12110
|
+
"customer-invoice",
|
|
12111
|
+
"payments",
|
|
12112
|
+
"list"
|
|
12113
|
+
]),
|
|
12069
12114
|
legacyCommand("get-customer-invoice-email-context", [
|
|
12070
12115
|
"customer-invoice",
|
|
12071
12116
|
"email-context",
|
|
@@ -12118,6 +12163,9 @@ var registry2 = [
|
|
|
12118
12163
|
legacyCommand("approve-supplier", ["supplier", "approve"]),
|
|
12119
12164
|
legacyCommand("reject-supplier", ["supplier", "reject"]),
|
|
12120
12165
|
legacyCommand("get-supplier-details", ["supplier", "detail", "get"]),
|
|
12166
|
+
legacyCommand("get-supplier-overview", ["supplier", "overview", "get"]),
|
|
12167
|
+
legacyCommand("get-supplier-usage", ["supplier", "usage", "get"]),
|
|
12168
|
+
legacyCommand("get-supplier-items", ["supplier", "items", "get"]),
|
|
12121
12169
|
legacyCommand("list-companies", ["company", "list"], [], [
|
|
12122
12170
|
{
|
|
12123
12171
|
name: "--name <text>",
|
|
@@ -12499,6 +12547,10 @@ var registry2 = [
|
|
|
12499
12547
|
name: "--q <text>",
|
|
12500
12548
|
description: "Search user names and emails (name A\u2013Z). A bare --q is rejected; use -q/--quiet to hide logs."
|
|
12501
12549
|
},
|
|
12550
|
+
{
|
|
12551
|
+
name: "--projectTeamOnly <true|false>",
|
|
12552
|
+
description: "true lists only active @getout.sg users, the only accounts accepted as Inside Sales, Business Development or Project Manager."
|
|
12553
|
+
},
|
|
12502
12554
|
{
|
|
12503
12555
|
name: "--limit <1-100>",
|
|
12504
12556
|
description: "Rows per page. Output is { items, pageInfo }."
|
|
@@ -13551,6 +13603,7 @@ Customer invoices
|
|
|
13551
13603
|
get-customer-invoice-lines <invoiceId> [--limit 1-100] [--cursor <token>] One invoice's lines; { items, pageInfo }
|
|
13552
13604
|
get-customer-invoice-approvals <batchId> [--limit 1-50] [--cursor <token>] Approval requests with approver/requester/responder; { items, pageInfo }
|
|
13553
13605
|
get-customer-invoice-history <batchId> [--limit 1-100] [--cursor <token>] Status history; { items, pageInfo }
|
|
13606
|
+
get-customer-invoice-payments <invoiceId> Payments QuickBooks applied to one invoice (date, reference, amount applied, attachment names). Live QuickBooks read.
|
|
13554
13607
|
get-customer-invoice-email-context <batchId> Contact, required CC, budget, and project context for composing an invoice email.
|
|
13555
13608
|
preview-qbo-customer-invoice <budgetId> <qboInvoiceId> Preview an invoice selected from list-available-qbo-customer-invoices; works on accepted/closed estimates.
|
|
13556
13609
|
import-qbo-customer-invoice <budgetId> <qboInvoiceId> --token <previewToken> Confirm the reviewed BB-only link; requires --allow-state-change --allow-financial-write in automation.
|
|
@@ -13615,6 +13668,7 @@ Companies & projects
|
|
|
13615
13668
|
update-project-status <id> <status> [--projectManagerId <userId>] [--projectManagerEmail <email>]
|
|
13616
13669
|
PITCH \u2192 WON requires an accepted/closed estimate. To win a pitch, accept its estimate with mark-budget-won <budgetId> <signed-quote.pdf>, which moves the project to WON.
|
|
13617
13670
|
Required when moving PITCH \u2192 WON: supply --projectManagerId or --projectManagerEmail.
|
|
13671
|
+
The project manager must be an active @getout.sg user; list eligible users with list-users --projectTeamOnly true.
|
|
13618
13672
|
status: ${projectStatusesForHelp.join(", ")}
|
|
13619
13673
|
|
|
13620
13674
|
Contacts
|
|
@@ -13639,6 +13693,9 @@ Suppliers & items
|
|
|
13639
13693
|
archive-items --ids <csv> (item.archiveItems; Budget Builder only; max 100; users can archive their own items, leads/admins any item; open estimates retain snapshot lines and require resolution before send/acceptance)
|
|
13640
13694
|
delete-item <id> (item.deleteItem; admin; archives in Budget Builder and makes the item inactive in QuickBooks; blocked while used by an open estimate)
|
|
13641
13695
|
get-supplier-details <supplierId>
|
|
13696
|
+
get-supplier-overview <supplierId> (supplier.getSupplierOverview; profile, approvals, attachments and tab counts; no usage or items)
|
|
13697
|
+
get-supplier-usage <supplierId> (supplier.getSupplierUsage; usage rows and spending)
|
|
13698
|
+
get-supplier-items <supplierId> (supplier.getSupplierItems; inventory items)
|
|
13642
13699
|
get-supplier-analytics [--name] [--status CSV] [--gstRegistered true|false] [--createdBy <text>] [--timeFrame ALL|LAST_YEAR|LAST_6_MONTHS|LAST_3_MONTHS|CUSTOM] [--startDate <ISO> --endDate <ISO>] [--sortBy name|gstRegistered|status|phone|email|updatedAt|createdAt] [--sortDir asc|desc] [--limit 1-100] [--cursor <token>] [--direction forward|backward]
|
|
13643
13700
|
Admin. Returns { items, pageInfo }; follow nextCursor/previousCursor with the same filters and sort. --page/--perPage are rejected.
|
|
13644
13701
|
count-supplier-analytics [--name] [--status] [--gstRegistered] [--createdBy] [--timeFrame] [--startDate --endDate] Admin. totalCount for the same filters
|
|
@@ -13656,9 +13713,10 @@ Suppliers & items
|
|
|
13656
13713
|
|
|
13657
13714
|
Dashboard & users
|
|
13658
13715
|
whoami Show the user identity and role for the active API key.
|
|
13659
|
-
list-users [--q] [--limit 1-100] [--cursor <token>]
|
|
13660
|
-
Name A\u2013Z. Returns { items, pageInfo }; follow nextCursor with the same --q. --page/--perPage are rejected.
|
|
13661
|
-
|
|
13716
|
+
list-users [--q] [--projectTeamOnly true|false] [--limit 1-100] [--cursor <token>]
|
|
13717
|
+
Name A\u2013Z. Returns { items, pageInfo }; follow nextCursor with the same --q and --projectTeamOnly. --page/--perPage are rejected.
|
|
13718
|
+
--projectTeamOnly true lists only active @getout.sg users, the only accounts accepted as Inside Sales, Business Development or Project Manager.
|
|
13719
|
+
count-users [--q] [--projectTeamOnly true|false] totalCount for the same search
|
|
13662
13720
|
create-user --email <email> [--name <name>] [--role ${userRolesForHelp.join("|")}] (admin; API-only service identity with no Google sign-in)
|
|
13663
13721
|
create-api-key --name <label> [--userId <userId>] (defaults to the caller; admin required for another user; raw key is shown once)
|
|
13664
13722
|
list-api-keys [--userId <userId>] [--limit 1-100] [--cursor <token>] (newest first, { items, pageInfo }; defaults to the caller; admin required for another user)
|
|
@@ -15024,6 +15082,14 @@ Waiting for approval\u2026
|
|
|
15024
15082
|
await getCustomerInvoiceHistory(page);
|
|
15025
15083
|
break;
|
|
15026
15084
|
}
|
|
15085
|
+
case "get-customer-invoice-payments": {
|
|
15086
|
+
const invoiceId = positional[0];
|
|
15087
|
+
if (!invoiceId) {
|
|
15088
|
+
throw new Error("get-customer-invoice-payments requires <invoiceId>");
|
|
15089
|
+
}
|
|
15090
|
+
await getCustomerInvoicePayments(invoiceId);
|
|
15091
|
+
break;
|
|
15092
|
+
}
|
|
15027
15093
|
case "get-customer-invoice-email-context": {
|
|
15028
15094
|
const batchId = positional[0];
|
|
15029
15095
|
if (!batchId) {
|
|
@@ -15241,6 +15307,27 @@ Waiting for approval\u2026
|
|
|
15241
15307
|
await getSupplierDetails(id);
|
|
15242
15308
|
break;
|
|
15243
15309
|
}
|
|
15310
|
+
case "get-supplier-overview": {
|
|
15311
|
+
const id = positional[0];
|
|
15312
|
+
if (!id)
|
|
15313
|
+
throw new Error("get-supplier-overview requires <supplierId>");
|
|
15314
|
+
await getSupplierOverview(id);
|
|
15315
|
+
break;
|
|
15316
|
+
}
|
|
15317
|
+
case "get-supplier-usage": {
|
|
15318
|
+
const id = positional[0];
|
|
15319
|
+
if (!id)
|
|
15320
|
+
throw new Error("get-supplier-usage requires <supplierId>");
|
|
15321
|
+
await getSupplierUsage(id);
|
|
15322
|
+
break;
|
|
15323
|
+
}
|
|
15324
|
+
case "get-supplier-items": {
|
|
15325
|
+
const id = positional[0];
|
|
15326
|
+
if (!id)
|
|
15327
|
+
throw new Error("get-supplier-items requires <supplierId>");
|
|
15328
|
+
await getSupplierItems(id);
|
|
15329
|
+
break;
|
|
15330
|
+
}
|
|
15244
15331
|
case "list-companies": {
|
|
15245
15332
|
await listCompanies(parseCompanyListFlags(flags));
|
|
15246
15333
|
break;
|
|
@@ -15857,11 +15944,13 @@ Waiting for approval\u2026
|
|
|
15857
15944
|
case "count-users": {
|
|
15858
15945
|
rejectRetiredPageFlags(flags);
|
|
15859
15946
|
const q = getFlag(flags, "q");
|
|
15947
|
+
rejectBareFlag(flags, "projectTeamOnly");
|
|
15948
|
+
const projectTeamOnly = parseOptionalBoolFlag(flags, "projectTeamOnly");
|
|
15860
15949
|
if (cmd === "count-users") {
|
|
15861
15950
|
for (const key of ["limit", "cursor"])
|
|
15862
15951
|
if (flags[key] !== undefined)
|
|
15863
|
-
throw new Error(`count-users does not accept --${key}; totals use --q only.`);
|
|
15864
|
-
await countUsers({ q });
|
|
15952
|
+
throw new Error(`count-users does not accept --${key}; totals use --q and --projectTeamOnly only.`);
|
|
15953
|
+
await countUsers({ q, projectTeamOnly });
|
|
15865
15954
|
break;
|
|
15866
15955
|
}
|
|
15867
15956
|
for (const key of ["limit", "cursor"])
|
|
@@ -15873,6 +15962,7 @@ Waiting for approval\u2026
|
|
|
15873
15962
|
throw new Error("--cursor must be a non-empty opaque token of at most 8192 characters.");
|
|
15874
15963
|
await listUsers({
|
|
15875
15964
|
q,
|
|
15965
|
+
projectTeamOnly,
|
|
15876
15966
|
limit: parseProjectLimit(getFlag(flags, "limit")),
|
|
15877
15967
|
cursor
|
|
15878
15968
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@go-labs-sg/bb",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.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",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"command-manifest.json"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@trpc/client": "^11.
|
|
22
|
+
"@trpc/client": "^11.24.0",
|
|
23
23
|
"dotenv": "^18.0.9",
|
|
24
24
|
"mime-types": "^3.0.2",
|
|
25
25
|
"superjson": "^2.2.6"
|