bopodev-db 0.1.28 → 0.1.29
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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +4 -0
- package/dist/index.d.ts +2 -1
- package/dist/ping.d.ts +3 -0
- package/dist/repositories/companies.d.ts +32 -0
- package/dist/repositories/helpers.d.ts +16 -0
- package/dist/repositories/index.d.ts +3 -0
- package/dist/repositories/legacy.d.ts +1415 -0
- package/dist/schema.d.ts +218 -0
- package/package.json +4 -2
- package/src/client.ts +249 -114
- package/src/index.ts +2 -1
- package/src/migrations/0001_issues_external_link.sql +1 -0
- package/src/migrations/0002_issues_goal_goals_owner_agent.sql +2 -0
- package/src/migrations/0003_issue_goals_junction.sql +12 -0
- package/src/migrations/meta/_journal.json +21 -0
- package/src/ping.ts +7 -0
- package/src/repositories/companies.ts +41 -0
- package/src/repositories/helpers.ts +104 -0
- package/src/repositories/index.ts +3 -0
- package/src/{repositories.ts → repositories/legacy.ts} +142 -115
- package/src/schema.ts +22 -0
package/.turbo/turbo-build.log
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { and, asc, desc, eq, gt, inArray, like, notInArray, sql } from "drizzle-orm";
|
|
1
|
+
export { and, asc, desc, eq, gt, inArray, like, max, notInArray, sql } from "drizzle-orm";
|
|
2
2
|
export * from "./bootstrap";
|
|
3
3
|
export * from "./client";
|
|
4
4
|
export { resolveDefaultDbPath, resolveBopoInstanceRoot } from "./default-paths";
|
|
5
|
+
export * from "./ping";
|
|
5
6
|
export * from "./repositories";
|
|
6
7
|
export * from "./schema";
|
package/dist/ping.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { BopoDb } from "../client";
|
|
2
|
+
export declare function createCompany(db: BopoDb, input: {
|
|
3
|
+
name: string;
|
|
4
|
+
mission?: string | null;
|
|
5
|
+
}): Promise<{
|
|
6
|
+
name: string;
|
|
7
|
+
mission?: string | null;
|
|
8
|
+
id: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare function listCompanies(db: BopoDb): Promise<{
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
mission: string | null;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
}[]>;
|
|
16
|
+
export declare function getCompany(db: BopoDb, id: string): Promise<{
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
mission: string | null;
|
|
20
|
+
createdAt: Date;
|
|
21
|
+
} | null>;
|
|
22
|
+
export declare function updateCompany(db: BopoDb, input: {
|
|
23
|
+
id: string;
|
|
24
|
+
name?: string;
|
|
25
|
+
mission?: string | null;
|
|
26
|
+
}): Promise<{
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
mission: string | null;
|
|
30
|
+
createdAt: Date;
|
|
31
|
+
} | null>;
|
|
32
|
+
export declare function deleteCompany(db: BopoDb, id: string): Promise<boolean>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { BopoDb } from "../client";
|
|
2
|
+
export declare class RepositoryValidationError extends Error {
|
|
3
|
+
constructor(message: string);
|
|
4
|
+
}
|
|
5
|
+
export declare function assertProjectBelongsToCompany(db: BopoDb, companyId: string, projectId: string): Promise<void>;
|
|
6
|
+
export declare function assertIssueBelongsToCompany(db: BopoDb, companyId: string, issueId: string): Promise<void>;
|
|
7
|
+
export declare function assertGoalBelongsToCompany(db: BopoDb, companyId: string, goalId: string): Promise<void>;
|
|
8
|
+
/** Ensures a goal can be linked to an issue: same company; project-scoped goals must match the issue's project. */
|
|
9
|
+
export declare function assertIssueGoalAssignable(db: BopoDb, companyId: string, issueProjectId: string, goalId: string | null | undefined): Promise<void>;
|
|
10
|
+
/** Validates each goal can be linked to an issue (same company; project goals must match issue project). */
|
|
11
|
+
export declare function assertIssueGoalsAssignable(db: BopoDb, companyId: string, issueProjectId: string, goalIds: string[]): Promise<void>;
|
|
12
|
+
export declare function assertAgentBelongsToCompany(db: BopoDb, companyId: string, agentId: string): Promise<void>;
|
|
13
|
+
export declare function assertTemplateBelongsToCompany(db: BopoDb, companyId: string, templateId: string): Promise<void>;
|
|
14
|
+
export declare function compactUpdate<T extends Record<string, unknown>>(input: T): {
|
|
15
|
+
[k: string]: unknown;
|
|
16
|
+
};
|