@go-labs-sg/bb 1.2.0 → 1.2.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.
package/README.md CHANGED
@@ -93,8 +93,9 @@ bun run src/index.ts list-budgets
93
93
 
94
94
  ### Layout
95
95
 
96
- - **`src/filter-enums.ts`** — “extended” filter enums (ALL + Prisma enums), maintained here so the published package does not depend on unpublished workspace packages. Keep in line with `packages/utils/src/filter-enums.ts` when those values change.
96
+ - **`src/prisma-enums.ts`** — Prisma enum string values for runtime; mirror `packages/db/src/generated/prisma/enums.ts` after schema changes.
97
+ - **`src/filter-enums.ts`** — “extended” filter enums (ALL + Prisma enums). Keep in line with `packages/utils/src/filter-enums.ts` when those values change.
97
98
 
98
99
  ### Publish
99
100
 
100
- `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 `@bb/api` are compile-time only (`import type`). Enum **values** in emitted JS import `@bb/db/enums` (workspace `@bb/db` during monorepo development).
101
+ `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 `@bb/api` are compile-time only (`import type`). Prisma enum **values** used at runtime live in `src/prisma-enums.ts` (kept in sync with `packages/db` generated enums) so npm installs do not need `@bb/db`.
@@ -1,4 +1,4 @@
1
- import { ApprovalStatus, ApprovalType, BillStatus, BudgetStatus, ErrorSeverity, ErrorStatus, EstimationMode, ProjectStatus, } from "@bb/db/enums";
1
+ import { ApprovalStatus, ApprovalType, BillStatus, BudgetStatus, ErrorSeverity, ErrorStatus, EstimationMode, ProjectStatus, } from "./prisma-enums.js";
2
2
  export const ExtendedApprovalStatus = {
3
3
  ...ApprovalStatus,
4
4
  ALL: "ALL",
@@ -1,5 +1,5 @@
1
- import { BillStatus, BudgetStatus, ProjectStatus } from "@bb/db/enums";
2
1
  import { BudgetRole, Deals, ExtendedBillStatus, ExtendedErrorSeverity, ExtendedErrorStatus, ExtendedProjectStatus, TimeFrame, } from "./filter-enums.js";
2
+ import { BillStatus, BudgetStatus, ProjectStatus } from "./prisma-enums.js";
3
3
  const BUDGET_STATUS_VALUES = new Set(Object.values(BudgetStatus));
4
4
  const BILL_STATUS_VALUES = new Set(Object.values(BillStatus));
5
5
  const PROJECT_STATUS_VALUES = new Set(Object.values(ProjectStatus));
@@ -209,7 +209,7 @@ export function parseApprovalTypeFlag(raw) {
209
209
  }
210
210
  return u;
211
211
  }
212
- /** For help text / error messages (single import site for `@bb/db` enums in the CLI). */
212
+ /** For help text / error messages (values from `./prisma-enums.js`, synced with Prisma). */
213
213
  export const budgetStatusesForHelp = Object.values(BudgetStatus);
214
214
  export const billStatusesForHelp = Object.values(BillStatus);
215
215
  export const billStatusesForUpdateHelp = Object.values(BillStatus).filter((s) => s !== BillStatus.PENDING_APPROVAL);
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Runtime Prisma enum values the CLI needs. Mirrors
3
+ * `packages/db/src/generated/prisma/enums.ts` — keep in sync when the schema changes.
4
+ */
5
+ export const EstimationMode = {
6
+ MICRO: "MICRO",
7
+ MANPOWER_SPECIFIED: "MANPOWER_SPECIFIED",
8
+ };
9
+ export const ProjectStatus = {
10
+ NOT_STARTED: "NOT_STARTED",
11
+ IN_PROGRESS: "IN_PROGRESS",
12
+ COMPLETED: "COMPLETED",
13
+ CANCELLED: "CANCELLED",
14
+ };
15
+ export const BudgetStatus = {
16
+ DRAFT: "DRAFT",
17
+ PENDING_APPROVAL: "PENDING_APPROVAL",
18
+ APPROVED: "APPROVED",
19
+ REJECTED: "REJECTED",
20
+ ESTIMATE_CREATED: "ESTIMATE_CREATED",
21
+ ESTIMATE_SENT: "ESTIMATE_SENT",
22
+ ESTIMATE_ACCEPTED: "ESTIMATE_ACCEPTED",
23
+ ESTIMATE_REJECTED: "ESTIMATE_REJECTED",
24
+ ESTIMATE_CLOSED: "ESTIMATE_CLOSED",
25
+ };
26
+ export const ApprovalStatus = {
27
+ PENDING_APPROVAL: "PENDING_APPROVAL",
28
+ APPROVED: "APPROVED",
29
+ REJECTED: "REJECTED",
30
+ };
31
+ export const ApprovalType = {
32
+ BUDGET: "BUDGET",
33
+ SUPPLIER: "SUPPLIER",
34
+ BILL: "BILL",
35
+ };
36
+ export const ErrorSeverity = {
37
+ LOW: "LOW",
38
+ MEDIUM: "MEDIUM",
39
+ HIGH: "HIGH",
40
+ CRITICAL: "CRITICAL",
41
+ };
42
+ export const ErrorStatus = {
43
+ UNRESOLVED: "UNRESOLVED",
44
+ INVESTIGATING: "INVESTIGATING",
45
+ RESOLVED: "RESOLVED",
46
+ IGNORED: "IGNORED",
47
+ };
48
+ export const BillStatus = {
49
+ DRAFT: "DRAFT",
50
+ PENDING_APPROVAL: "PENDING_APPROVAL",
51
+ CHECKED: "CHECKED",
52
+ APPROVED: "APPROVED",
53
+ PAID: "PAID",
54
+ REJECTED: "REJECTED",
55
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-labs-sg/bb",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
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",
@@ -1,5 +0,0 @@
1
- import type { AppRouter } from "@bb/api";
2
- import { type CreateTRPCProxyClient } from "@trpc/client";
3
- export declare const api: CreateTRPCProxyClient<AppRouter>;
4
- export declare function requireApiKey(): string;
5
- //# sourceMappingURL=api-client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAGN,KAAK,qBAAqB,EAC1B,MAAM,cAAc,CAAC;AAetB,eAAO,MAAM,GAAG,EAAE,qBAAqB,CAAC,SAAS,CAgB/C,CAAC;AAEH,wBAAgB,aAAa,IAAI,MAAM,CAOtC"}
@@ -1,28 +0,0 @@
1
- import type { BudgetStatus } from "@bb/db/enums";
2
- import type { ExtendedBudgetStatus } from "@bb/utils/filter-enums";
3
- export declare function listBudgets(opts: {
4
- projectId?: string;
5
- name?: string;
6
- statuses?: ExtendedBudgetStatus[];
7
- page?: number;
8
- perPage?: number;
9
- }): Promise<void>;
10
- export declare function getBudget(id: string): Promise<void>;
11
- export declare function updateBudgetStatus(budgetId: string, status: BudgetStatus): Promise<void>;
12
- export declare function listBills(opts: {
13
- projectId?: string;
14
- budgetId?: string;
15
- status?: string;
16
- page?: number;
17
- pageSize?: number;
18
- }): Promise<void>;
19
- export declare function approveBill(billId: string): Promise<void>;
20
- export declare function listApprovals(opts: {
21
- type?: string;
22
- }): Promise<void>;
23
- export declare function listSuppliers(opts: {
24
- name?: string;
25
- page?: number;
26
- perPage?: number;
27
- }): Promise<void>;
28
- //# sourceMappingURL=commands.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAWnE,wBAAsB,WAAW,CAAC,IAAI,EAAE;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAShB;AAED,wBAAsB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMzD;AAED,wBAAsB,kBAAkB,CACvC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GAClB,OAAO,CAAC,IAAI,CAAC,CAMf;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,IAAI,CAAC,CAehB;AAED,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmB/D;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA6C1E;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAOhB"}
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import "./load-env.js";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=load-env.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"load-env.d.ts","sourceRoot":"","sources":["../src/load-env.ts"],"names":[],"mappings":""}
@@ -1,11 +0,0 @@
1
- /**
2
- * Minimal argv parser for bb CLI.
3
- * Supports: command [positional...] [--key=value] [--key value]
4
- */
5
- export declare function parseArgs(argv: string[]): {
6
- command: string;
7
- positional: string[];
8
- flags: Record<string, string | true>;
9
- };
10
- export declare function getFlag<T extends string | number>(flags: Record<string, string | true>, key: string, parse?: (s: string) => T): T | undefined;
11
- //# sourceMappingURL=parse-args.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse-args.d.ts","sourceRoot":"","sources":["../src/parse-args.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;CACrC,CA8BA;AAED,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAChD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,EACpC,GAAG,EAAE,MAAM,EACX,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,CAAC,GACtB,CAAC,GAAG,SAAS,CAIf"}