@go-labs-sg/bb 1.2.2 → 1.2.4
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 +3 -3
- package/dist/commands.js +4 -0
- package/dist/index.js +19 -4
- package/dist/parse-mutation-payload.js +1 -0
- package/dist/prisma-enums.js +4 -4
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ Global options and flags use `--key=value` or `--key value` (see `bb help`).
|
|
|
59
59
|
| **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`, `get-budget-versions`, `update-budget-status`, `create-budget` / `update-budget` (`--payload`), `delete-budget`, `create-budget-approval`, `add-budget-items`, `update-budget-item`, `remove-budget-item`, `reorder-budget-items`, `update-budget-item-supplier`, `create-budget-category`, `update-budget-category`, `delete-budget-category`, `update-budget-commission`, `update-budget-discount` (`--payload` where noted), `upload-budget-attachment` (`<budgetId>` + local file path; uses `attachment.requestBudgetAttachmentUpload` + PUT + `attachment.confirmBudgetAttachment`) |
|
|
60
60
|
| **Bills** | `list-bills`, `list-claims`, `create-bill` (`--payload`), `update-bill` (`--payload`), `delete-bill`, `create-bill-approval`, `update-bill-status`, `patch-bill-payment` (PAID bills: `--paymentTrackingUrl`, `--paymentReference`, `--quickbooksBillId`, `--paymentDate` ISO; clear with `--clearPaymentTrackingUrl` / `--clearPaymentReference` / `--clearQuickbooksBillId` / `--clearPaymentDate` `true`), `patch-bill-invoice-number`, `get-bill-attachments`, `upload-bill-attachment` (`<billId>` + local path), `get-bill-details` |
|
|
61
61
|
| **Approvals** | `list-approvals` / `get-pending-approvals`, `approve-bill`, `reject-bill`, `approve-budget`, `reject-budget`, `approve-supplier`, `reject-supplier` |
|
|
62
|
-
| **Companies & projects** | `list-companies`, `get-company`, `create-company`, `update-company` (`--payload`), `delete-company`, `list-projects`, `get-project`, `create-project` (optional `--requestQboAccountantNotification false` to skip QBO accountant emails), `update-project` (`--payload`, optional `requestQboAccountantNotification` in JSON), `delete-project`, `update-project-status` |
|
|
62
|
+
| **Companies & projects** | `list-companies`, `get-company`, `create-company`, `update-company` (`--payload`), `delete-company`, `list-projects`, `get-project`, `create-project` (`--asanaTaskId`, `--slackChannelId`, `--slackChannelUrl`, `--slackChannelName`, …; optional `--requestQboAccountantNotification false` to skip QBO accountant emails), `update-project` (`--payload`, optional `requestQboAccountantNotification` in JSON), `delete-project`, `update-project-status` (`<id>` `<status>`: `PITCH` \| `EVENT` \| `COMPLETED` \| `LOST`) |
|
|
63
63
|
| **Contacts** | `list-contacts`, `create-contact-person` (`--payload`), `update-contact-person` (`--payload`) |
|
|
64
64
|
| **Suppliers & items** | `list-suppliers`, `create-supplier` (`--payload`), `update-supplier` (`--payload`), `delete-suppliers` (`--ids` CSV; admin), `create-certification` / `create-payment-method` / `create-supplier-role` / `create-supplier-tag` (`--name`), `get-supplier-details`, `get-supplier-analytics`, `list-items`, `create-item` (`--payload`), `update-item` (`--payload`), `delete-item`, `get-item`, `list-item-categories`, `create-item-category`, `update-item-category`, `delete-item-categories` (`--ids` CSV; admin) |
|
|
65
65
|
| **Dashboard & users** | `list-users`, `get-user-performance`, `get-dashboard`, `get-monthly-metrics`, `get-system-overview`, `get-estimate-performance`, `get-financial-overview` |
|
|
@@ -94,9 +94,9 @@ bun run src/index.ts list-budgets
|
|
|
94
94
|
|
|
95
95
|
### Layout
|
|
96
96
|
|
|
97
|
-
- **`src/prisma-enums.ts`** — Prisma enum string values for runtime; mirror `packages/db/src/generated/prisma/enums.ts` after schema changes.
|
|
97
|
+
- **`src/prisma-enums.ts`** — Prisma enum string values for runtime; mirror `packages/budget-builder/db/src/generated/prisma/enums.ts` after schema changes.
|
|
98
98
|
- **`src/filter-enums.ts`** — “extended” filter enums (ALL + Prisma enums). Keep in line with `packages/utils/src/filter-enums.ts` when those values change.
|
|
99
99
|
|
|
100
100
|
### Publish
|
|
101
101
|
|
|
102
|
-
`prepublishOnly` strips `workspace:` / `catalog:` entries from this package’s `package.json`, runs `tsc`, then `postpack` restores the file — so the npm tarball does not contain monorepo protocol dependencies. Types from `@
|
|
102
|
+
`prepublishOnly` strips `workspace:` / `catalog:` entries from this package’s `package.json`, runs `tsc`, then `postpack` restores the file — so the npm tarball does not contain monorepo protocol dependencies. Types from `@go-labs/budget-builder-api` are compile-time only (`import type`). Prisma enum **values** used at runtime live in `src/prisma-enums.ts` (kept in sync with `packages/budget-builder/db` generated enums) so npm installs do not need `@go-labs/budget-builder-db`.
|
package/dist/commands.js
CHANGED
|
@@ -546,6 +546,10 @@ export async function createProject(opts) {
|
|
|
546
546
|
description: opts.description,
|
|
547
547
|
companyId: opts.companyId,
|
|
548
548
|
contactPersonId: opts.contactPersonId,
|
|
549
|
+
asanaTaskId: opts.asanaTaskId,
|
|
550
|
+
slackChannelId: opts.slackChannelId,
|
|
551
|
+
slackChannelUrl: opts.slackChannelUrl,
|
|
552
|
+
slackChannelName: opts.slackChannelName,
|
|
549
553
|
dateRange: {
|
|
550
554
|
from: new Date(opts.startDate),
|
|
551
555
|
to: opts.endDate ? new Date(opts.endDate) : undefined,
|
package/dist/index.js
CHANGED
|
@@ -125,7 +125,7 @@ Companies & projects
|
|
|
125
125
|
delete-company <id>
|
|
126
126
|
list-projects [--companyId] [--name] [--status] [--page] [--perPage]
|
|
127
127
|
get-project <id>
|
|
128
|
-
create-project --name --companyId --contactPersonId --startDate <ISO> [--endDate] [--description] [--requestQboAccountantNotification false]
|
|
128
|
+
create-project --name --companyId --contactPersonId --asanaTaskId --slackChannelId --slackChannelUrl --slackChannelName --startDate <ISO> [--endDate] [--description] [--requestQboAccountantNotification false]
|
|
129
129
|
update-project --payload '<json>' (project.updateProject; optional requestQboAccountantNotification; default notify like web)
|
|
130
130
|
delete-project <id>
|
|
131
131
|
update-project-status <id> <status>
|
|
@@ -229,7 +229,7 @@ async function main() {
|
|
|
229
229
|
perPage: parsePositiveIntFlag(getFlag(flags, "perPage"), "--perPage"),
|
|
230
230
|
includeDetails: flags.summary === true
|
|
231
231
|
? false
|
|
232
|
-
: parseOptionalBoolFlag(flags, "includeDetails") ?? true,
|
|
232
|
+
: (parseOptionalBoolFlag(flags, "includeDetails") ?? true),
|
|
233
233
|
});
|
|
234
234
|
break;
|
|
235
235
|
}
|
|
@@ -691,14 +691,29 @@ async function main() {
|
|
|
691
691
|
const name = getFlag(flags, "name");
|
|
692
692
|
const companyId = getFlag(flags, "companyId");
|
|
693
693
|
const contactPersonId = getFlag(flags, "contactPersonId");
|
|
694
|
+
const asanaTaskId = getFlag(flags, "asanaTaskId");
|
|
695
|
+
const slackChannelId = getFlag(flags, "slackChannelId");
|
|
696
|
+
const slackChannelUrl = getFlag(flags, "slackChannelUrl");
|
|
697
|
+
const slackChannelName = getFlag(flags, "slackChannelName");
|
|
694
698
|
const startDate = getFlag(flags, "startDate");
|
|
695
|
-
if (!name ||
|
|
696
|
-
|
|
699
|
+
if (!name ||
|
|
700
|
+
!companyId ||
|
|
701
|
+
!contactPersonId ||
|
|
702
|
+
!asanaTaskId ||
|
|
703
|
+
!slackChannelId ||
|
|
704
|
+
!slackChannelUrl ||
|
|
705
|
+
!slackChannelName ||
|
|
706
|
+
!startDate) {
|
|
707
|
+
throw new Error("create-project requires --name --companyId --contactPersonId --asanaTaskId --slackChannelId --slackChannelUrl --slackChannelName --startDate (ISO)");
|
|
697
708
|
}
|
|
698
709
|
await createProject({
|
|
699
710
|
name,
|
|
700
711
|
companyId,
|
|
701
712
|
contactPersonId,
|
|
713
|
+
asanaTaskId,
|
|
714
|
+
slackChannelId,
|
|
715
|
+
slackChannelUrl,
|
|
716
|
+
slackChannelName,
|
|
702
717
|
startDate,
|
|
703
718
|
endDate: getFlag(flags, "endDate"),
|
|
704
719
|
description: getFlag(flags, "description"),
|
|
@@ -196,6 +196,7 @@ export function parseUpdateProjectPayload(raw) {
|
|
|
196
196
|
description: optionalString(o.description),
|
|
197
197
|
companyId: requiredString(o.companyId, "update-project payload.companyId"),
|
|
198
198
|
contactPersonId: requiredString(o.contactPersonId, "update-project payload.contactPersonId"),
|
|
199
|
+
asanaTaskId: requiredString(o.asanaTaskId, "update-project payload.asanaTaskId"),
|
|
199
200
|
dateRange: {
|
|
200
201
|
from: toDate(range.from, "dateRange.from"),
|
|
201
202
|
to: range.to === undefined || range.to === null
|
package/dist/prisma-enums.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Runtime Prisma enum values the CLI needs. Mirrors
|
|
3
|
-
* `packages/db/src/generated/prisma/enums.ts` — keep in sync when the schema changes.
|
|
3
|
+
* `packages/budget-builder/db/src/generated/prisma/enums.ts` — keep in sync when the schema changes.
|
|
4
4
|
*/
|
|
5
5
|
export const EstimationMode = {
|
|
6
6
|
MICRO: "MICRO",
|
|
7
7
|
MANPOWER_SPECIFIED: "MANPOWER_SPECIFIED",
|
|
8
8
|
};
|
|
9
9
|
export const ProjectStatus = {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
PITCH: "PITCH",
|
|
11
|
+
EVENT: "EVENT",
|
|
12
12
|
COMPLETED: "COMPLETED",
|
|
13
|
-
|
|
13
|
+
LOST: "LOST",
|
|
14
14
|
};
|
|
15
15
|
export const BudgetStatus = {
|
|
16
16
|
DRAFT: "DRAFT",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@go-labs-sg/bb",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"description": "Budget Builder CLI — list budgets, bills, approvals, suppliers; approve bills; change status. For AI agents (e.g. Chuck/OpenClaw).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@trpc/client": "^11.16.0",
|
|
25
|
-
"dotenv": "^17.2.4",
|
|
26
25
|
"mime-types": "^3.0.2",
|
|
27
26
|
"superjson": "^2.2.6"
|
|
28
27
|
},
|